diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..1631ce9 --- /dev/null +++ b/.env.example @@ -0,0 +1,62 @@ +# Copy to v12/.env and fill in your own values. v12/.env is gitignored. +# Each example reads only the keys it needs — set the ones for the example you +# plan to run, leave the others empty. + +# ── APIKey ────────────────────────────────────────────────────────────── +# Used by every example. Tenant API key from the LoginRadius admin console. +LR_API_KEY= + +# ── APISecret ─────────────────────────────────────────────────────────── +# Server-side only. Required by the api-key-secret and x-loginradius-headers examples. +LR_API_SECRET= + +# ── AccessToken (user-context) ────────────────────────────────────────── +# Returned by a prior login flow. Required by the access-token example. +LR_ACCESS_TOKEN= +LR_OIDC_APP_NAME= + +# ── BearerToken ───────────────────────────────────────────────────────── +# Required by the bearer-token example. +LR_BEARER_TOKEN= + +# ── M2MBearerToken (JWT) ──────────────────────────────────────────────── +# Obtained via the OAuth M2M token endpoint. Required by the m2m-bearer-token example. +LR_M2M_BEARER_TOKEN= + +# ── ClientId + ClientSecret (OAuth app) ───────────────────────────────── +# Required by the client-id-secret example. +LR_CLIENT_ID= +LR_CLIENT_SECRET= +LR_TARGET_UID= + +# ── X-LoginRadius-Api{Key,Secret} (header-only overrides) ─────────────── +# Required by x-loginradius-headers/ when the header value must differ from +# the query value. +LR_X_API_KEY= +LR_X_API_SECRET= + +# ── Misc ──────────────────────────────────────────────────────────────── +# Social-provider access token (Facebook/Google/etc.) for token exchange. +# Used by the api-key-secret and x-loginradius-headers examples. +LR_SOCIAL_TOKEN= + +# ── login example ────────────────────────────────────────────────────── +LR_EMAIL= + +# ── Demo server (com.loginradius.sdk.demo.DemoServer) ──────────────────── +# Reuses LR_API_KEY / LR_API_SECRET above. Optional server-selection trio — +# leave unset to use the production API. +LR_DOMAIN= +LR_CUSTOM_DOMAIN= +LR_BASE_URL= + +# Where email links point back to. +# +# LR_VERIFICATION_URL must address the demo's own verify ROUTE, not the site +# root — LoginRadius appends ?vtoken=... to it, and the handler reads that, +# verifies the account and redirects to / with a banner. +LR_VERIFICATION_URL=http://localhost:8080/api/auth/verify +LR_RESET_PASSWORD_URL=http://localhost:8080/?reset=1 + +# Server port. +LR_DEMO_PORT=8080 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c5164ab --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,55 @@ +# GENERATED FILE — do not edit it in this repository. +# This workflow is produced alongside the rest of this SDK and is overwritten +# whenever the SDK is regenerated. Raise changes where the SDK is generated. +# +# These steps mirror this SDK's own build verification, with the pinned +# maven:3-eclipse-temurin-17 image replaced by setup-java. +name: CI + +on: + push: + branches: [master, main] + pull_request: + +permissions: + contents: read + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: Build and test (JDK 17) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-java@v4 + with: + distribution: temurin + # Matches the pom's . Bump both together. + java-version: '17' + cache: maven + + - name: Package + run: mvn -B -q -DskipTests package + + # Deliberately not -q: a gate should show the test count, not just its + # exit code. A run that executed zero tests must not look like a pass. + - name: Test + run: mvn -B test + + # NO spotless step, deliberately. The generator's pom configures + # spotless 2.43.0 with google-java-format 1.8, and spotless refuses that + # combination on JVM 17 outright: + # + # You are running Spotless on JVM 17. This requires google-java-format + # of at least 1.10.0 (you are using 1.8). + # + # So `mvn spotless:check` fails before it formats anything — it would make + # this workflow permanently red while saying nothing about the code. The + # SDK's own build does not run it either, so Java formatting is currently + # unenforced rather than enforced in one place. Fixing that means bumping + # google-java-format in the pom and accepting a whole-tree reformat — a + # separate change from wiring up CI. diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml deleted file mode 100644 index ef04a4e..0000000 --- a/.github/workflows/maven-publish.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: release-to-maven-central -on: - push: - branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 16 - uses: actions/setup-java@v1 - with: - java-version: 16 - - name: Import GPG key - id: import_gpg - uses: crazy-max/ghaction-import-gpg@v4 - with: - gpg_private_key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} - passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }} - - name: Build with Maven - run: mvn -B verify --file LoginRadius-JavaSDK/pom.xml - - - - name: Set up Apache Maven Central - uses: actions/setup-java@v1 - with: # running setup-java again overwrites the settings.xml - java-version: 16 - distribution: 'adopt' - server-id: ossrh - server-username: MAVEN_USERNAME # env variable for username in deploy - server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy - - - - name: Publish to Apache Maven Central - run: mvn --batch-mode deploy --file LoginRadius-JavaSDK/pom.xml - env: - MAVEN_USERNAME: ${{secrets.MAVEN_USERNAME}} - MAVEN_CENTRAL_TOKEN: ${{secrets.MAVEN_PASSWORD}} - MAVEN_OPTS: ${{secrets.MAVEN_OPTS}} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..a990e67 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,140 @@ +# GENERATED FILE — do not edit it in this repository. +# This workflow is produced alongside the rest of this SDK and is overwritten +# whenever the SDK is regenerated. Raise changes where the SDK is generated. +# +# Replaces the previous maven-publish.yml, which deployed on every push to +# master, built --file LoginRadius-JavaSDK/pom.xml (the pom is at the root now), +# ran JDK 16 against a Java-17 pom, and never passed +# -Psign-artifacts — so Central would have rejected the artifacts anyway. +# +# Two gates stand in front of a release, and both are deliberate: +# 1. the 'release' GitHub Environment, which should have required reviewers; +# 2. autoPublish=false on central-publishing-maven-plugin, so the bundle is +# uploaded and validated but a human presses Publish in the Central +# Portal. A version on Central can never be replaced. +name: Release + +on: + push: + tags: ['v*'] + workflow_dispatch: + inputs: + tag: + description: 'Existing tag to publish (e.g. v12.0.0-rc.1)' + required: true + type: string + dry_run: + description: 'Build and sign only — do not upload to Central' + required: false + default: false + type: boolean + +permissions: + contents: read + +concurrency: + group: release-${{ github.ref }} + cancel-in-progress: false + +jobs: + publish: + name: Publish com.loginradius.sdk:java-sdk to Maven Central + runs-on: ubuntu-latest + # Requires a human approval on the 'release' environment. The GPG key and + # Central token belong on that environment, not on the repository, so no + # other workflow can reach them. + environment: release + permissions: + contents: write # create the GitHub Release + steps: + - name: Resolve tag + id: tag + run: | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + echo "name=${{ inputs.tag }}" >> "$GITHUB_OUTPUT" + else + echo "name=${{ github.ref_name }}" >> "$GITHUB_OUTPUT" + fi + + - uses: actions/checkout@v4 + with: + ref: ${{ steps.tag.outputs.name }} + fetch-depth: 0 + + - uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '17' + cache: maven + # Writes a settings.xml whose id matches + # central in the pom, and + # imports the signing key. The values below are ENV VAR NAMES, not + # the secrets themselves — that is this action's contract. + server-id: central + server-username: MAVEN_USERNAME + server-password: MAVEN_CENTRAL_TOKEN + gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} + gpg-passphrase: MAVEN_GPG_PASSPHRASE + + # The pom , the tag and the generated SDK version are three + # independent facts until something compares them. + - name: Tag matches the pom and the SDK version + run: | + expected='12.0.0-rc.1' + pom="$(mvn -B -q -DforceStdout help:evaluate -Dexpression=project.version)" + tag='${{ steps.tag.outputs.name }}' + if [ "${pom}" != "${expected}" ]; then + echo "::error::pom version ${pom} does not match the generated SDK version ${expected}" + exit 1 + fi + if [ "${tag}" != "v${expected}" ]; then + echo "::error::tag ${tag} does not match the generated SDK version v${expected}" + exit 1 + fi + + - name: Test + run: mvn -B test + + # -Psign-artifacts carries BOTH halves of publishing: maven-gpg-plugin + # (Central rejects unsigned artifacts) and central-publishing-maven-plugin + # (Central Portal takes an uploaded bundle, not a deploy to a URL). + # Without the profile this is a no-op deploy that silently publishes + # nothing, which is what the workflow this replaces did. + - name: Verify and sign + env: + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + run: mvn -B -Psign-artifacts verify + + - name: Upload the bundle to Central + if: ${{ github.event_name == 'push' || inputs.dry_run == false }} + env: + MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} + MAVEN_CENTRAL_TOKEN: ${{ secrets.MAVEN_PASSWORD }} + MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} + MAVEN_OPTS: ${{ secrets.MAVEN_OPTS }} + # Stops at 'validated'. Finish the release by pressing Publish at + # https://central.sonatype.com/publishing/deployments + run: mvn -B -Psign-artifacts deploy -DskipTests + + - name: Upload the artifacts to this run + uses: actions/upload-artifact@v4 + with: + name: maven-artifacts + path: | + target/*.jar + target/*.asc + if-no-files-found: error + + - name: Create the GitHub Release + if: ${{ github.event_name == 'push' || inputs.dry_run == false }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + TAG: ${{ steps.tag.outputs.name }} + run: | + if gh release view "${TAG}" >/dev/null 2>&1; then + echo "release ${TAG} already exists — nothing to do" + exit 0 + fi + PRERELEASE='--prerelease' + gh release create "${TAG}" --verify-tag --title "${TAG}" \ + --notes-file CHANGELOG.md ${PRERELEASE} diff --git a/.gitignore b/.gitignore index 652af39..a530464 100644 --- a/.gitignore +++ b/.gitignore @@ -1,28 +1,21 @@ -# Make sure to ignore Eclipse files -.classpath -.project -.settings -.html +*.class -# Macisms -.DS_Store -# Where maven compiles by default +# Mobile Tools for Java (J2ME) +.mtj.tmp/ - -#IntelliJ project files -*.iml -.idea - -.bash_profile - -# Java Files that should be ignored -.class - -# Package Files +# Package Files # +*.jar *.war *.ear -# Backup files -*.bak -scratch -/target/ +# exclude jar for gradle wrapper +!gradle/wrapper/*.jar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + +# build files +**/target +target +.gradle +build diff --git a/CHANGELOG.md b/CHANGELOG.md index 975332e..771f0b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,594 +1,54 @@ -> **LoginRadius Java SDK Change Log** provides information regarding what has changed, more specifically what changes, improvements and bug fix has been made to the SDK. For more details please refer to the [LoginRadius API Documentation](https://www.loginradius.com/docs/api/v2/deployment/sdk-libraries/java-library/) - - -# Version 11.7.0 - -**Release Date:** March 24, 2025 - -## Enhancements - -We've introduced a brand-new set of Webhook APIs, designed with enhanced functionality and flexibility. These new APIs support advanced features including: - -- Custom header configuration -- Query parameter support -- Webhook authentication methods (Bearer Token and Basic Auth) -- Support for a custom `Name` parameter to label each webhook subscription - -As part of this upgrade, the legacy Webhook APIs have been deprecated in favor of the new, more robust versions. - -## Newly Added APIs - -- `getWebhookSubscriptionDetail` – Retrieve detailed information about a specific webhook subscription -- `createWebhookSubscription` – Create a new webhook subscription with advanced configuration options -- `deleteWebhookSubscription` – Remove an existing webhook subscription -- `updateWebhookSubscription` – Modify an existing webhook subscription -- `listAllWebhooks` – Retrieve a list of all configured webhook subscriptions -- `getWebhookEvents` – Fetch available webhook events supported by the system - -## Deprecated APIs - -The following legacy APIs have been deprecated: - -- `webHookUnsubscribe` -- `webhookTest` -- `webHookSubscribe` -- `getWebHookSubscribedURLs` - - -# Version 11.6.0 - -Release on **July 02, 2024** - -## Added following APIs: -- `MFAValidateAuthenticatorCode` -- `MFAVerifyAuthenticatorCode` -- `RevokeAllRefreshToken ` -- `MultipurposeEmailTokenGeneration` -- `MultipurposeSMSOTPGeneration` -- `MFAReAuthenticateByAuthenticatorCode` -- `AuthSendVerificationEmailForLinkingSocialProfiles ` -- `SlidingAccessToken` -- `AccessTokenViaCustomJWTToken` -- `MFAResetAuthenticatorByToken` -- `MFAResetAuthenticatorByUid` - -## Breaking Changes - -For developers migrating to v11.6.0, there will be minor breaking changes in terms of SDK implementation. In this version, we have added/removed following parameter in respective Api. - -- Added `isVoiceOtp` parameter in `ResetPhoneIDVerificationByUid` API -- Added `isVoiceOtp` parameter in `MFAConfigureByAccessToken` API -- Added `isVoiceOtp` and `options` parameter in `MFAUpdatePhoneNumberByToken` API -- Added `isVoiceOtp`, `emailTemplate2FA` and `options` parameter in `MFALoginByEmail` API -- Added `isVoiceOtp` and `emailTemplate2FA` parameter in `MFALoginByUserName` API -- Added `isVoiceOtp` , `emailTemplate2FA` and `options` parameter in `MFALoginByPhone` API -- Added `isVoiceOtp` and `options` parameter in `MFAUpdatePhoneNumber` API -- Added `isVoiceOtp` parameter in `MFAResendOTP` API -- Added `isVoiceOtp` parameter in `MFAReAuthenticate` API -- Added `isVoiceOtp` and `options` parameter in `UpdateProfileByAccessToken` API -- Added `isVoiceOtp` parameter in `UserRegistrationByEmail` API -- Added `isVoiceOtp` parameter in `UserRegistrationByCaptcha` API -- Added `isVoiceOtp` parameter in `OneTouchLoginByPhone` API -- Added `isVoiceOtp` parameter in `PasswordlessLoginPhoneVerification` API -- Added `isVoiceOtp` parameter in `PasswordlessLoginByPhone` API -- Added `isVoiceOtp` parameter in `ForgotPasswordByPhoneOTP` API -- Added `isVoiceOtp` parameter in `PhoneVerificationByOTP` API -- Added `isVoiceOtp` parameter in `PhoneVerificationOTPByAccessToken` API -- Added `isVoiceOtp` parameter in `PhoneResendVerificationOTP` API -- Added `isVoiceOtp` parameter in `UpdatePhoneNumber` API -- Added `isVoiceOtp` and `emailTemplate` parameter in `UserRegistrationByPhone` API -- Added `isVoiceOtp` parameter in `SendForgotPINSMSByPhone` API -- Added `uuid` parameter in `VerifyEmail` API -- Added `h-captcha-response` in the Captcha Model -- Removed `smsTemplate2FA` parameter in `MFAConfigureByAccessToken` API - - - -## Removed (Deprecated) APIs: -- `MFAValidateGoogleAuthCode` -- `MFAReAuthenticateByGoogleAuth` -- `MFAResetGoogleAuthByToken ` -- `MFAResetGoogleAuthenticatorByUid` - -# Version 11.5.0 -Release on January 20, 2023 - -## Enhancements - -- We have updated some of the dependencies to the latest Version. - -## Removed (Deprecated) APIs: -- `AuthGetRegistrationData` -- `ValidateRegistrationDataCode` -- `GetRegistrationData` -- `AddRegistrationData` -- `UpdateRegistrationData` -- `DeleteRegistrationData` -- `DeleteAllRecordsByDataSource` -- `GetAccessTokenByVkontakteAccessToken` -- `GetAlbum` -- `GetAlbumsWithCursor` -- `GetAudios` -- `GetAudiosWithCursor` -- `GetCheckIns` -- `GetCheckInsWithCursor` -- `GetContacts` -- `GetEvents` -- `GetEventsWithCursor` -- `GetFollowings` -- `GetFollowingsWithCursor` -- `GetGroups` -- `GetGroupsWithCursor` -- `GetLikes` -- `GetLikesWithCursor` -- `GetMentions` -- `PostMessage` -- `GetPage` -- `GetPhotos` -- `GetPosts` -- `StatusPosting` -- `TrackableStatusPosting` -- `GetTrackableStatusStats` -- `TrackableStatusFetching` -- `GetVideos` -- `GetRefreshedSocialUserProfile` - -## Breaking Changes - -For developers migrating to v11.5.0, there will be minor breaking change in terms of SDK implementation. In this version, we have added `emailTemplate` parameter in `userRegistrationByPhone` Api. - - -# Version 11.4.0 -Release on June 1, 2022 - - -## Enhancements - -- We are introducing an additional param `getLrServerTime` in the manual SOTT generation function `getSott()`, we recomend using this method to generate SOTT manually, the old function `getSott()` will also exist but it is deprecated and will be removed in a future version of SDK. -- Enhancement in `README.md` file. - - -# Version 11.3.1 -Release on January 28, 2022 - - -## Enhancements - -- Added a feature to add ApiKey and ApiSecret directly in LoginRadius manual SOTT generation method. -- Code optimization for better performance. -- Added Licence and Contribution Guideline files. - -## Breaking Changes - -For developers migrating from v11.3.0, there will be 1 minor breaking change in terms of SDK implementation. In this version, we have added a feature to add ApiKey & ApiSecret directly into the manual SOTT generation method `getSott()`. - -# Version 11.3.0 -Release on October 10, 2021 - - -## Enhancements - -- Added JWT Login feature in SDK demo - -## Added new multiple APIs for better user experience -- JWT token by Access Token -- JWT token by Email and Password -- JWT token by Username and Password -- JWT token by Phone and Password - -# Version 11.2.0 -Release on September 7, 2021 - - -## Enhancements - -- Updated Jquery with latest version(3.6.0) in SDK Demo - -## Added new multiple APIs for better user experience - -- MFAEmailOtpByAccessToken -- MFAValidateEmailOtpByAccessToken -- MFAResetEmailOtpAuthenticatorByAccessToken -- MFASecurityQuestionAnswerByAccessToken -- MFAResetSecurityQuestionAuthenticatorByAccessToken -- MFAEmailOTP -- MFAValidateEmailOtp -- MFASecurityQuestionAnswer -- MFASecurityQuestionAnswerVerification -- MFAResetEmailOtpAuthenticatorByUid -- MFAResetSecurityQuestionAuthenticatorByUid -- ReAuthValidateEmailOtp -- ReAuthSendEmailOtp -- ReAuthBySecurityQuestion - -#### Added `EmailTemplate2FA` parameter in the following API -- MFALoginByEmail -- MFALoginByUserName -- MFALoginByPhone - -#### Added `RbaBrowserEmailTemplate`, `RbaCityEmailTemplate` ,`RbaCountryEmailTemplate` , `RbaIpEmailTemplate` parameter in the following API -- MFAValidateOTPByPhone -- MFAValidateGoogleAuthCode -- MFAValidateBackupCode - -#### Added `emailTemplate`, `verificationUrl` ,`welcomeEmailTemplate` parameter in the following API - -- GetProfileByAccessToken - -#### Removed `smsTemplate2FA ` parameter from the following API -- mfaValidateGoogleAuthCode - -# Version 11.1.0 -Release on April 21, 2021 - -## Enhancements - - - Added Proxy Server Feature. - -## Added new multiple APIs for better user experience - -- Get Profile By Ping. -- Passwordless Login Verification By Email And OTP. -- Passwordless Login Verification By User Name And OTP. - -# Version 11.0.1 -Release on March 17, 2021 - -## Enhancements - - - Added X-Origin-IP header support. - - Added 429 error code handling for "Too Many Request in a particular time frame". - - -# Version 11.0.0 -Release on July 28, 2020 - -## Enhancements - - - Added a parameter isWeb in "RefreshAccessToken" API. - - Added a parameter SocialAppName in "getAccessTokenByFacebookAccessToken, getAccessTokenByTwitterAccessToken, - getAccessTokenByGoogleAccessToken, getAccessTokenByLinkedinAccessToken, getAccessTokenByAppleIdCode, getAccessTokenByGoogleAuthCode" native Social login APIs. - - -## Added new multiple APIs for better user experience - - - Added linkSocialIdentities(POST) API. - - Added linkSocialIdentitiesByPing(POST) API. - - Added getAccessTokenByAppleIdCode API. - - Added getAccessTokenByWeChatCode API. - - -## Removed APIs: - - - linkSocialIdentity API(PUT) - - getSocialIdentity API(GET) - -### Version 10.0.2 -Release on **April 27,2020** - -##### Bug Fixes - - - Fixed Access Token caching issue. - -### Version 10.0.0 -Release on **September 30,2019** - -##### Enhancements -## This full version release includes major breaking changes with several improvements and optimizations : - - - Enhanced the coding standards of SDK to follow industry programming styles and best practices. - - Enhanced security standards of SDK. - - Reduced code between the business layer and persistence layer for optimization of SDK performance. - - Added internal parameter validations in the API function - - ApiKey and ApiSecret usage redundancy removed - - All LoginRadius related features need to be defined once only and SDK will handle them automatically - - Improved the naming conventions of API functions for better readability. - - Better Exception Handling for LoginRadius API Response in SDK - - Revamped complete SDK and restructured it with latest API function names and parameters - - Added detailed description to API functions and parameters for better understanding - - Updated the demo according to latest SDK changes - - Reduced dependency on libraries - - Implemented API Region Feature - - Added PIN Authentication feature APIs. - - Added Consent Management feature APIs. - -## Added new multiple APIs for better user experience - - - Update Phone ID by UID - - Upsert Email - - Role Context profile - - MFA Resend OTP - - User Registration By Captcha - - Get Access Token via Linkedin Token - - Get Access Token By Foursquare Access Token - - Get Active Session By Account Id - - Get Active Session By Profile Id - - Delete User Profiles By Email - - Verify Multifactor OTP Authentication - - Verify Multifactor Password Authentication - - Verify Multifactor PIN Authentication - - Update UID - - MFA Re-authentication by PIN - - PIN Login - - Forgot PIN By Email - - Forgot PIN By UserName - - Reset PIN By ResetToken - - Reset PIN By SecurityAnswer And Email - - Reset PIN By SecurityAnswer And Username - - Reset PIN By SecurityAnswer And Phone - - Forgot PIN By Phone - - Change PIN By Token - - Reset PIN by Phone and OTP - - Reset PIN by Email and OTP - - Reset PIN by Username and OTP - - Set PIN By PinAuthToken - - Invalidate PIN Session Token - - Submit Consent By ConsentToken - - Get Consent Logs - - Submit Consent By AccessToken - - Verify Consent By AccessToken - - Update Consent Profile By AccessToken - - Get Consent Logs By Uid - - Album With Cursor - - Audio With Cursor - - Check In With Cursor - - Event With Cursor - - Following With Cursor - - Group With Cursor - - Like With Cursor - - -## Removed APIs: - - GetCompanies API - - Getstatus API - -### Version 10.0.0-beta -Release on **Aug 5, 2019** - -> **Note: The version contains several breaking changes.** - -##### Enhancements - - ## This beta version release includes major changes with several improvements and optimizations : -- Enhanced the coding standards of SDK to follow industry programming styles and best practices. -- Enhanced security standards of SDK. -- Reduced code between the business layer and persistence layer for optimization of SDK performance. -- Added internal parameter validations in the API function -- ApiKey and ApiSecret usage redundancy removed -- All LoginRadius related features need to be defined once only and SDK will handle them automatically -- Improved the naming conventions of API functions for better readability. -- Better Error and Exception Handling for LoginRadius API Response in SDK -- Revamped complete SDK and restructured it with latest API function names and parameters -- Added detailed description to API functions and parameters for better understanding -- Updated the demo according to latest SDK changes -- Reduced dependency on libraries -- Implemented APIRegion Feature - -## Added new multiple APIs for better user experience -- Update Phone ID by UID -- Upsert Email -- Role Context profile -- MFA Resend OTP -- User Registration By Captcha -- Get Access Token via Linkedin Token -- Get Access Token By Foursquare Access Token -- Get Active Session By Account Id -- Get Active Session By Profile Id - -## Removed APIs: -- GetCompanies API - -### Version 4.2.2 -Released on **March 26, 2019** -##### Enhancements - - - Added gzip Accept-Encoding HTTPS header in requests sent to an LoginRadius server - -### Version 4.2.1 -Released on **November 23, 2018** -##### Enhancements - - - LoginRadiusClient.java optimization - - Update Exception object to include ValidationError model - - Added Unit tests - - Updated demo with new UI and features - - -### Version 4.2.0 -Released on **October 11, 2018** -##### Enhancements - - - Added Custom Domain option - - Added more fields to LoginRadiusUltimateUserProfile model - - Auth Delete Account API (GET) - - Access Token API (GET) - - Status Posting API (GET) - - Phone Login API (POST) - - MFA Email Login API (POST) - - MFA User Name Login API (POST) - - MFA Phone Login API (POST) - - Update MFA by Access Token (PUT) - - Update MFA Setting (PUT) - - Access Token via Vkontakte Token API (GET) - - Access Token via Google JWT API (GET) - - WebHook Subscribe API (POST) - - WebHook Test API (GET) - - WebHook Subscribed URLs API (GET) - - WebHook Unsubscribe API (DEL) - - Delete All Records by Datasource API (DEL) - -##### Breaking Changes - - - Renamed LoginRadiusConstant variables with 2FA to MFA - - -### Version 4.1.0 -Released on **September 20, 2018** - -##### Enhancements - - - Added API Request Signing(Enabling this feature customer don’t need to pass apisecret in API request. They can pass a dynamically generated hash value instead of this. Also, this feature will make sure that the message has not tampered during transit when someone calls our APIs). - - Add Request Access Token in Header(LoginRadius access token can be passed on to the request as in header for auth apis). - - Option to Prevent Sending Email Verification(an option to prevent sending email verification in case of optional email verification flow). - - Recaptcha for Auth APIs(By enabling this option customer can enforce client to pass reCaptcha in some auth APIs for authentication). - - Access Token on Registration Event. - - API Secret in Headers for all Account APIs. - - Remove Phone ID by access token API - - Added Get Email Verification token API - - Added Get Forgot Password token API - - Auth Verify Email by OTP API - - Auth Reset Password by OTP API - - Account Identities by Email API - - One Touch Login by Email API - - One Touch Login By Phone API - - One Touch OTP Verification API - - Smart Login by Email API - - Smart Login by Username API - - Smart Login Ping API - - Smart Login Verify Token API - - PasswordLess Login by Email API - - PasswordLess Login By UserName API - - PasswordLess Login Verification API - - Phone Login Using One Time Passcode API - - Phone Send One time Passcode API - -##### Breaking Changes - -- For developers migrating from v4.0.1, there will be some breaking changes in terms of SDK implementation. In this version, we have updated endpoints and renamed "Auto Login" to "Smart Login", "No Registration/Simplified Registration" to "One touch Login" and "Instant Link Login" to "PasswordLess Login". Also, changed the methods of the above APIs accordingly. - - We define new Method by using it you can directly initilize your api key and secret key.you dont have to initilize in every method. - - For more details, please have a look [here](https://docs.loginradius.com/api/v2/deployment/sdk-libraries/java-library) - - - - -### Version 4.0.1 -Released on **December 28, 2017** - -##### Enhancements - - - Updated endpoint of Configuration API. - -### Version 4.0.0 -Released on **November 17, 2017** - -##### Enhancements - - - Added new configuration api for better implementation. - - Added new reset password by security answer API. - - Added new remove an email management API. - - Added custom scopes and external permissions enhancement in social login. - - Significantly improved code performance. - -##### Bug Fixes - - - Fixed issue remove Unirest library for http request. - - Fixed issue thread leak when calling RestRequest. - - -### Version 3.4.0 -Released on **September 06, 2017** - -##### Enhancements - - - Added new verified and unverified both email ids stored in different profile fields. - - Added new projection of fields in all APIs - - Added new verify auto login email API. - - Added new management API to generate SOTT. - - Added new context role expiration in add/update role context API. - - Added new risk based authentication in login API. - - Significantly improved code performance. - -### Version 3.3.0 -Released on **July 20, 2017** - -##### Enhancements - - - Added new Custom Registration Data APIs. - - Added new Get Security Questions By Access Token,Email,UserName and Phone APIs - - Added new Simplified Registration APIs. - - Significantly improved code performance. - -##### Bug Fixes - - - Fixed Issue related to missing fields in Login API. - - -### Version 3.2.0 -Released on **June 15, 2017** - -##### Enhancements - - - Added new access token API based on UID (user impersonation) - - Added new Auto Login APIs - - Added new backup code API in case of device lost and Google Authenticator enabled. - - Significantly improved code performance. - -##### Bug Fixes - - Issue with NULL Support at Update Account APIs. - - -### Version 3.1.0 -Released on **May 10, 2017** - -##### Enhancements - - - Added new Two Factor Authentication [2FA] APIs. - - Added new api to get basic server information for sott time validation. - - Added new Context based Roles and Permissions Management APIs - - Added new fields in APIs response Unverified email ids in UserProfile and Image in PhotoAPI. - - Added new email prompt Auto login. - - Significantly improved code performance. - - Increased custom connection and socket timeout 15000(milliseconds). - - - - - -### Version 3.0.0 -Released on **April 13, 2017** - - -##### Enhancements - - - Updated with [api-v2](https://docs.loginradius.com/api/v2/getting-started/introduction) - - Added new multiple APIs for better user experience. - - EndUser add and remove multiple Emails. - - Added update profile feature in SDK. - - Significantly improved code performance. - - Reduce number of library from SDK. - - Added phonenuber and username login. - - By default the connection timeout (the time it takes to connect to a server) is 10000, and the socket timeout (the time it takes to receive data) is 60000. - - -### Version 2.5.3 -Released on **January 12, 2017** - -##### Enhancements - - Significantly improved code performance. - -##### Bug Fixes - - Updated SDK to Fetch Custom Fields. - - - -### Version 2.5.1 -Released on **June 20, 2016** - -##### Enhancements - - - Custom object APIs have been newly added - - Wrapper methods for latest LoginRadius APIs have been added in Account API and User API - - Significantly improved code performance. - -##### API breaking changes - - - This is a revamp of the previous SDK. Most of the classes are re-written for providing ease of implementation and to cover all of the existing - - There are breaking changes in user-create/user-register and user-update apis - -##### Bug Fixes - - - User create/update and User register can now be used to update custom fields - - Issue with the method UserEmailAvailabilty is fixed and the method returns isExist=true - - Issue with Token validate and invalidate methods is fixed and these methods return expected results. - - +# v12 changelog + +## v12.0.0-rc.1 + +The first Java SDK generated from the LoginRadius OpenAPI specification. There +is no earlier v12, and no 11.x Java SDK it replaces in place — see +`MIGRATION_GUIDE.md` if you are coming from a hand-written integration. + +### What's new + +- **Generated from the OpenAPI spec.** Every operation in + `LoginRadius-Public-APIs.yaml` is reachable through a typed service on + `LoginRadiusClient` — 57 services. +- **Typed request and response models** for every schema in the spec, rather + than maps and hand-built JSON. +- **Centralised authentication.** All nine credentials are injected by a single + OkHttp interceptor, configured once on `LoginRadiusConfig`. Each is sent as a + header by preference — keeping secrets out of access logs and URL caches — + and additionally as a query parameter for the operations that accept nothing + else. +- **Typed errors.** `LoginRadiusException` exposes the HTTP status, LoginRadius + error code, description, and raw body, plus `isAuth()`, `isForbidden()`, + `isRateLimit()`, and `isServer()`. The API's three different error envelopes + are normalised to one shape. +- **Cross-cutting request options** applied to every request: `originIp`, + `serverRegion`, `fields`, `preventWebhook`, and arbitrary `defaultHeaders`. + Default headers are merged at the lowest precedence and cannot mask a + credential. +- **Request signing.** Opt-in `digest` / `x-Request-Expires` headers on + `/manage/` endpoints, excluding the access-token exchange. The API secret is + stripped from the URL before signing. +- **Debug logging** with credential values redacted, so a log is safe to share. +- **SOTT generation** matching every other LoginRadius SDK byte for byte, + guarded by golden-value tests. +- **Custom OkHttpClient support** that extends your client rather than replacing + it, and leaves your timeouts alone unless you set one explicitly. + +### Fixed before first release + +- **The 42 operations the spec pins to their own host.** The generator inlines + each pin into the operation, so neither `setBasePath` nor the client-level + server list reached them: an explicit `baseURL` was silently ignored for + migration, cloud-api, OIDC, OAuth, and SSO traffic. 31 of them additionally + carried an unsubstituted template variable, so the request went to a host with + literal braces in it and failed as a DNS error. +- **`java.version` was left at the generator's 1.8 default** rather than the 17 + the manifest declares. + +### Known limitations + +- Request signing has not been validated against a live tenant. The + implementation matches the reference algorithm and is covered by + cross-language golden-value tests, but no signed request has been accepted by + the API yet. It ships opt-in and off by default. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index efe7108..941bf63 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,41 +1,44 @@ -# Contributing +# Contributing to the v12 Java SDK -[Java SDK](https://github.com/LoginRadius/java-sdk) is [MIT](LICENSE) licensed and accepts contributions via GitHub pull requests. This document outlines some of the conventions on development workflow, commit message formatting, contact points, and other resources to make it easier to get your contribution accepted. +Thank you for taking the time. This SDK is **generated**, which changes how +contributions work — please read this before opening a pull request. -## Getting Started +## Files under `v12/` are not edited by hand -- Fork the repository on GitHub. -- If you find any bug or Improvement in our existing code-base, please create a pull request as mentioned in Contribution Flow. +The client, facade, tests, examples, demo and docs are all produced from the +LoginRadius OpenAPI specification and a shared behavioural contract, then copied +into this repository. A change committed here is overwritten by the next +release, and it would not reach the other LoginRadius SDKs. -## Contribution Flow +So a pull request that edits files under `v12/` cannot be merged, however good +the change is. This is not a judgement on the contribution — it is that the +change has to be made where the code comes from. -This is a rough outline of what a contributor's workflow looks like: +## Please open an issue instead -- Create a separate branch from the `dev` branch to base your work. -- Make commits of logical units. -- Make sure your commit messages are in the proper format (see below). -- Push your changes to a topic branch in your fork of the repository. -- Submit a pull request to the original repository. -- **Please ensure that you raise a PR on the `dev` branch instead of `master`.** +Describe what you expected and what happened. Useful detail: -#### Commit Messages +- the SDK version, and the operation or option involved +- a minimal snippet that reproduces it +- for a wrong request: the parameter you set and what reached the API -Please follow the below format while writing commit messages: +We apply the fix at the source, so it arrives in the next release rather than +being patched into a file that the release would overwrite. -``` - title: One line description about your change - - description: An optional description of your changes. -``` +## If the API itself is wrong -Thanks for your contributions! +Some problems are in the specification rather than the SDK: a missing endpoint, +an operation that declares the wrong field name, a response that does not match +what the API returns. Those cannot be fixed in a client at all. Report them the +same way and say what the API actually did — we route them to the API team. -## Code of Conduct +## Running the SDK locally -### Our Pledge +You do not need any of the generation machinery to build or test what is here: -In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to make participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. - -### Our Responsibilities +```bash +mvn -B package +``` -Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. \ No newline at end of file +The demo under `demo/` runs against a real tenant; see its README for the +credentials it needs. Never commit a filled `.env`. diff --git a/GENERATED.md b/GENERATED.md new file mode 100644 index 0000000..115bd44 --- /dev/null +++ b/GENERATED.md @@ -0,0 +1,26 @@ +# This directory is generated + +Everything in `v12/` — the client, the facade, the tests, the examples, the +demo, the docs and the package metadata — is generated from the LoginRadius +OpenAPI specification and copied here. + +**Do not edit files here.** The next release overwrites them, and a fix made +here never reaches the other LoginRadius SDKs. + +## Found a problem? + +Open an issue on this repository. Include the SDK version, the operation or +option involved, and what you expected — that is enough for us to reproduce it. + +A pull request that edits files in `v12/` cannot be merged, because the change +would be lost on the next release. If you have a fix in mind, describe it in the +issue and we will apply it at the source. + +## Why it works this way + +Generating the SDK from the specification is what keeps it complete and in step +with the API: every operation is present, the models match the wire format, and +credential handling, base-URL precedence and error classification are defined in +one place rather than repeated per method. The cost is that generated files are +not editable in place; the benefit is that a fix is made once, at the source, +and cannot be lost. diff --git a/LoginRadius-JavaSDK/pom.xml b/LoginRadius-JavaSDK/pom.xml deleted file mode 100644 index e6da3e2..0000000 --- a/LoginRadius-JavaSDK/pom.xml +++ /dev/null @@ -1,146 +0,0 @@ - - - 4.0.0 - - com.loginradius.sdk - java-sdk - 11.7.0 - LoginRadius-CustomerIdentity-JavaSDK - LoginRadius Java SDK - https://github.com/LoginRadius/java-sdk - - - - MIT License - http://www.opensource.org/licenses/mit-license.php - - - - - - support - LoginRadius Support - support@loginradius.com - LoginRadius - https://www.loginradius.com - - - - - scm:git:git@github.com:LoginRadius/java-sdk.git.git - scm:git:git@github.com:LoginRadius/java-sdk.git.git - git@github.com:LoginRadius/java-sdk.git.git - - - - - com.google.code.gson - gson - 2.10 - - - - - javax.servlet - servlet-api - 2.5 - - - - commons-codec - commons-codec - 1.15 - - - - - - - ossrh - https://oss.sonatype.org/content/repositories/snapshots - - - - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.6 - - - sign-artifacts - verify - - sign - - - - - - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.8 - true - - ossrh - https://oss.sonatype.org/ - true - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.9.0 - - 16 - 16 - - - - org.apache.maven.plugins - maven-source-plugin - - - attach-sources - - jar - - - - - - - org.apache.maven.plugins - maven-javadoc-plugin - - 16 - public - true - true - true - true - LoginRadius Java - LoginRadius Java]]> - Copyright © 2015 LoginRadius, Inc. All Rights Reserved.]]> - -Xdoclint:none - - - - attach-javadocs - - jar - - - - - - - - - - - - diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/account/AccountApi.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/account/AccountApi.java deleted file mode 100644 index c32a526..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/account/AccountApi.java +++ /dev/null @@ -1,1192 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. -*/ - -package com.loginradius.sdk.api.account; - -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.JsonObject; -import com.google.gson.reflect.TypeToken; -import com.loginradius.sdk.helper.JsonDeserializer; -import com.loginradius.sdk.helper.LoginRadiusRequest; -import com.loginradius.sdk.helper.LoginRadiusValidator; -import com.loginradius.sdk.models.requestmodels.*; -import com.loginradius.sdk.models.responsemodels.AccessTokenBase; -import com.loginradius.sdk.models.responsemodels.ListReturn; -import com.loginradius.sdk.models.responsemodels.MultiToken; -import com.loginradius.sdk.models.responsemodels.UserPasswordHash; -import com.loginradius.sdk.models.responsemodels.otherobjects.DeleteResponse; -import com.loginradius.sdk.models.responsemodels.otherobjects.EmailVerificationTokenResponse; -import com.loginradius.sdk.models.responsemodels.otherobjects.ForgotPasswordResponse; -import com.loginradius.sdk.models.responsemodels.otherobjects.PostResponse; -import com.loginradius.sdk.models.responsemodels.otherobjects.PrivacyPolicyHistoryResponse; -import com.loginradius.sdk.models.responsemodels.userprofile.Identity; -import com.loginradius.sdk.util.AsyncHandler; -import com.loginradius.sdk.util.ErrorResponse; -import com.loginradius.sdk.util.LoginRadiusSDK; - - -public class AccountApi { - private static Gson gson =new Gson(); - - public AccountApi(){ - if (!LoginRadiusSDK.validate()){ - throw new LoginRadiusSDK.InitializeException(); - } - } - - - // - // This API is used to update the information of existing accounts in your Cloud Storage. See our Advanced API Usage section - // Here for more capabilities. - // - // Json data for update account - // UID, the unified identifier for each user account - // The fields parameter filters the API response so that the response only includes a specific set of fields - // Boolean, pass true if you wish to update any user - // profile field with a NULL value. - // Response containing Definition for Complete profile data - // 18.15 - - public void UpdateAccountByUid(JsonObject payload, String uid, - String fields, Boolean nullSupport, final AsyncHandler handler) { - - if (payload == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("payload")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - if (nullSupport != null && nullSupport) { - queryParameters.put("nullSupport", String.valueOf(nullSupport)); - } - - String resourcePath = "identity/v2/manage/account/" + uid; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(payload), - new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() { - }; - Identity successResponse = JsonDeserializer.deserializeJson(response, typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - - - // - // This API is used to retrieve all of the accepted Policies by the user, associated with their UID. - // - // UID, the unified identifier for each user account - // Complete Policy History data - // 15.1.1 - - - public void getPrivacyPolicyHistoryByUid(String uid, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "identity/v2/manage/account/" + uid + "/privacypolicy/history"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PrivacyPolicyHistoryResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to create an account in Cloud Storage. This API bypass the normal email verification process and manually creates the user.

In order to use this API, you need to format a JSON request body with all of the mandatory fields - //
- // Model Class containing Definition of payload for Account Create API - // The fields parameter filters the API response so that the response only includes a specific set of fields - // Response containing Definition for Complete profile data - // 18.1 - - - public void createAccount(AccountCreateModel accountCreateModel, String fields, final AsyncHandler handler) { - - if (accountCreateModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accountCreateModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - String resourcePath = "identity/v2/manage/account"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(accountCreateModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - Identity successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to retrieve all of the profile data, associated with the specified account by email in Cloud Storage. - // - // Email of the user - // The fields parameter filters the API response so that the response only includes a specific set of fields - // Response containing Definition for Complete profile data - // 18.2 - - - public void getAccountProfileByEmail(String email, String fields, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(email)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("email")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - queryParameters.put("email", email); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - String resourcePath = "identity/v2/manage/account"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - Identity successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to retrieve all of the profile data associated with the specified account by user name in Cloud Storage. - // - // UserName of the user - // The fields parameter filters the API response so that the response only includes a specific set of fields - // Response containing Definition for Complete profile data - // 18.3 - - - public void getAccountProfileByUserName(String userName, String fields, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(userName)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("userName")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - queryParameters.put("userName", userName); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - String resourcePath = "identity/v2/manage/account"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - Identity successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to retrieve all of the profile data, associated with the account by phone number in Cloud Storage. - // - // The Registered Phone Number - // The fields parameter filters the API response so that the response only includes a specific set of fields - // Response containing Definition for Complete profile data - // 18.4 - - - public void getAccountProfileByPhone(String phone, String fields, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(phone)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("phone")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - queryParameters.put("phone", phone); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - String resourcePath = "identity/v2/manage/account"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - Identity successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to retrieve all of the profile data, associated with the account by uid in Cloud Storage. - // - // UID, the unified identifier for each user account - // The fields parameter filters the API response so that the response only includes a specific set of fields - // Response containing Definition for Complete profile data - // 18.5 - - - public void getAccountProfileByUid(String uid, String fields, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - String resourcePath = "identity/v2/manage/account/" + uid; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - Identity successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to update the information of existing accounts in your Cloud Storage. See our Advanced API Usage section Here for more capabilities. - // - // Model Class containing Definition of payload for Account Update API - // UID, the unified identifier for each user account - // The fields parameter filters the API response so that the response only includes a specific set of fields - // Response containing Definition for Complete profile data - // 18.15 - - - public void updateAccountByUid(AccountUserProfileUpdateModel accountUserProfileUpdateModel, String uid, - String fields, final AsyncHandler handler) { - - if (accountUserProfileUpdateModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accountUserProfileUpdateModel")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - String resourcePath = "identity/v2/manage/account/" + uid; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(accountUserProfileUpdateModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - Identity successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to update the PhoneId by using the Uid's. Admin can update the PhoneId's for both the verified and unverified profiles. It will directly replace the PhoneId and bypass the OTP verification process. - // - // Phone number - // UID, the unified identifier for each user account - // The fields parameter filters the API response so that the response only includes a specific set of fields - // Response containing Definition for Complete profile data - // 18.16 - - - public void updatePhoneIDByUid(String phone, String uid, - String fields, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(phone)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("phone")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - JsonObject bodyParameters = new JsonObject(); - bodyParameters.addProperty("phone", phone); - - String resourcePath = "identity/v2/manage/account/" + uid + "/phoneid"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(bodyParameters), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - Identity successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API use to retrive the hashed password of a specified account in Cloud Storage. - // - // UID, the unified identifier for each user account - // Response containing Definition for Complete PasswordHash data - // 18.17 - - - public void getAccountPasswordHashByUid(String uid, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "identity/v2/manage/account/" + uid + "/password"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - UserPasswordHash successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to set the password of an account in Cloud Storage. - // - // New password - // UID, the unified identifier for each user account - // Response containing Definition for Complete PasswordHash data - // 18.18 - - - public void setAccountPasswordByUid(String password, String uid, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(password)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("password")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - JsonObject bodyParameters = new JsonObject(); - bodyParameters.addProperty("password", password); - - String resourcePath = "identity/v2/manage/account/" + uid + "/password"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(bodyParameters), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - UserPasswordHash successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API deletes the Users account and allows them to re-register for a new account. - // - // UID, the unified identifier for each user account - // Response containing Definition of Delete Request - // 18.19 - - - public void deleteAccountByUid(String uid, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "identity/v2/manage/account/" + uid; - - LoginRadiusRequest.execute("DELETE", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - DeleteResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to invalidate the Email Verification status on an account. - // - // UID, the unified identifier for each user account - // Email template name - // Email verification url - // Response containing Definition of Complete Validation data - // 18.20 - - - public void invalidateAccountEmailVerification(String uid, String emailTemplate, - String verificationUrl, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate)) { - queryParameters.put("emailTemplate", emailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(verificationUrl)) { - queryParameters.put("verificationUrl", verificationUrl); - } - - String resourcePath = "identity/v2/manage/account/" + uid + "/invalidateemail"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API Returns a Forgot Password Token it can also be used to send a Forgot Password email to the customer. Note: If you have the UserName workflow enabled, you may replace the 'email' parameter with 'username' in the body. - // - // user's email - // Email template name - // Url to which user should get re-directed to for resetting the password - // If set to true, the API will also send a Forgot Password email to the customer, bypassing any Bot Protection challenges that they are faced with. - // Response containing Definition of Complete Forgot Password data - // 18.22 - - - public void getForgotPasswordToken(String email, String emailTemplate, - String resetPasswordUrl, Boolean sendEmail, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(email)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("email")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate)) { - queryParameters.put("emailTemplate", emailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(resetPasswordUrl)) { - queryParameters.put("resetPasswordUrl", resetPasswordUrl); - } - - if (sendEmail != null && sendEmail) { - queryParameters.put("sendEmail", String.valueOf(sendEmail)); - } - - JsonObject bodyParameters = new JsonObject(); - bodyParameters.addProperty("email", email); - - String resourcePath = "identity/v2/manage/account/forgot/token"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(bodyParameters), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - ForgotPasswordResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API Returns an Email Verification token. - // - // user's email - // Response containing Definition of Complete Verification data - // 18.23 - - - public void getEmailVerificationToken(String email, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(email)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("email")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - JsonObject bodyParameters = new JsonObject(); - bodyParameters.addProperty("email", email); - - String resourcePath = "identity/v2/manage/account/verify/token"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(bodyParameters), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - EmailVerificationTokenResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // The API is used to get LoginRadius access token based on UID. - // - // UID, the unified identifier for each user account - // Response containing Definition of Complete Token data - // 18.24 - - - public void getAccessTokenByUid(String uid, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - queryParameters.put("uid", uid); - - String resourcePath = "identity/v2/manage/account/access_token"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - AccessTokenBase successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API Allows you to reset the phone no verification of an end user’s account. - // - // UID, the unified identifier for each user account - // SMS Template name - // Boolean, pass true if you wish to trigger voice OTP - // Response containing Definition of Complete Validation data - // 18.27 - - - public void resetPhoneIDVerificationByUid(String uid, String smsTemplate, - Boolean isVoiceOtp, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate)) { - queryParameters.put("smsTemplate", smsTemplate); - } - - if (isVoiceOtp != null && isVoiceOtp) { - queryParameters.put("isVoiceOtp", String.valueOf(isVoiceOtp)); - } - - String resourcePath = "identity/v2/manage/account/" + uid + "/invalidatephone"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to add/upsert another emails in account profile by different-different email types. If the email type is same then it will simply update the existing email, otherwise it will add a new email in Email array. - // - // Model Class containing Definition of payload for UpsertEmail Property - // UID, the unified identifier for each user account - // The fields parameter filters the API response so that the response only includes a specific set of fields - // Response containing Definition for Complete profile data - // 18.29 - - - public void upsertEmail(UpsertEmailModel upsertEmailModel, String uid, - String fields, final AsyncHandler handler) { - - if (upsertEmailModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("upsertEmailModel")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - String resourcePath = "identity/v2/manage/account/" + uid + "/email"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(upsertEmailModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - Identity successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // Use this API to Remove emails from a user Account - // - // user's email - // UID, the unified identifier for each user account - // The fields parameter filters the API response so that the response only includes a specific set of fields - // Response containing Definition for Complete profile data - // 18.30 - - - public void removeEmail(String email, String uid, - String fields, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(email)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("email")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - JsonObject bodyParameters = new JsonObject(); - bodyParameters.addProperty("email", email); - - String resourcePath = "identity/v2/manage/account/" + uid + "/email"; - - LoginRadiusRequest.execute("DELETE", resourcePath, queryParameters, gson.toJson(bodyParameters), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - Identity successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to refresh an access token via it's associated refresh token. - // - // LoginRadius refresh token - // Response containing Definition of Complete Token data - // 18.31 - - - public void refreshAccessTokenByRefreshToken(String refreshToken, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(refreshToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("refreshToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - queryParameters.put("refresh_Token", refreshToken); - - String resourcePath = "identity/v2/manage/account/access_token/refresh"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - AccessTokenBase successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // The Revoke Refresh Access Token API is used to revoke a refresh token or the Provider Access Token, revoking an existing refresh token will invalidate the refresh token but the associated access token will work until the expiry. - // - // LoginRadius refresh token - // Response containing Definition of Delete Request - // 18.32 - - - public void revokeRefreshToken(String refreshToken, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(refreshToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("refreshToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - queryParameters.put("refresh_Token", refreshToken); - - String resourcePath = "identity/v2/manage/account/access_token/refresh/revoke"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - DeleteResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // The Revoke All Refresh Access Token API is used to revoke all refresh tokens for a specific user. - // - // UID, the unified identifier for each user account - // Response containing Definition of Delete Request - // 18.33 - - - public void revokeAllRefreshToken(String uid, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "identity/v2/manage/account/" + uid + "/access_token/refresh/revoke"; - - LoginRadiusRequest.execute("DELETE", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - DeleteResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API generate Email tokens and Email OTPs for Email verification, Add email, Forgot password, Delete user, Passwordless login, Forgot pin, One-touch login and Auto login. - // - // Model Class containing Definition of payload for Multipurpose Email Token Generation API - // The identifier type for the token that we need to generate - // Response containing Definition for Complete MultiToken - // 18.34 - - - public void multipurposeEmailTokenGeneration(MultiEmailToken multiEmailToken, String tokentype, final AsyncHandler handler) { - - if (multiEmailToken == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("multiEmailToken")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(tokentype)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("tokentype")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "identity/v2/manage/account/emailtoken/" + tokentype; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(multiEmailToken), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - MultiToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // Note: This is intended for specific workflows where an email may be associated to multiple UIDs. This API is used to retrieve all of the identities (UID and Profiles), associated with a specified email in Cloud Storage. - // - // Email of the user - // The fields parameter filters the API response so that the response only includes a specific set of fields - // Complete user Identity data - // 18.35 - - - public void getAccountIdentitiesByEmail(String email, String fields, final AsyncHandler> handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(email)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("email")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - queryParameters.put("email", email); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - String resourcePath = "identity/v2/manage/account/identities"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - ListReturn successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to delete all user profiles associated with an Email. - // - // Email of the user - // Response containing Definition of Delete Request - // 18.36 - - - public void accountDeleteByEmail(String email, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(email)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("email")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - queryParameters.put("email", email); - - String resourcePath = "identity/v2/manage/account"; - - LoginRadiusRequest.execute("DELETE", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - DeleteResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to update a user's Uid. It will update all profiles, custom objects and consent management logs associated with the Uid. - // - // Payload containing Update UID - // UID, the unified identifier for each user account - // Response containing Definition of Complete Validation data - // 18.41 - - - public void accountUpdateUid(UpdateUidModel updateUidModel, String uid, final AsyncHandler handler) { - - if (updateUidModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("updateUidModel")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - queryParameters.put("uid", uid); - - String resourcePath = "identity/v2/manage/account/uid"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(updateUidModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API generates SMS OTP for Add phone, Phone Id verification, Forgot password, Forgot pin, One-touch login, smart login and Passwordless login. - // - // - // The identifier type for the OTP that we need to generate - // Response containing Definition for Complete MultiToken - // 18.44 - - - public void multipurposeSMSOTPGeneration(MultiSmsOtp multiSmsOtp, String smsotptype, final AsyncHandler handler) { - - if (multiSmsOtp == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("multiSmsOtp")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(smsotptype)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("smsotptype")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "identity/v2/manage/account/smsotp/" + smsotptype; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(multiSmsOtp), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - MultiToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/account/RoleApi.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/account/RoleApi.java deleted file mode 100644 index 1120c0a..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/account/RoleApi.java +++ /dev/null @@ -1,593 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. -*/ - -package com.loginradius.sdk.api.account; - -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; -import com.loginradius.sdk.helper.JsonDeserializer; -import com.loginradius.sdk.helper.LoginRadiusRequest; -import com.loginradius.sdk.helper.LoginRadiusValidator; -import com.loginradius.sdk.models.requestmodels.AccountRoleContextModel; -import com.loginradius.sdk.models.requestmodels.PermissionsModel; -import com.loginradius.sdk.models.requestmodels.RoleContextAdditionalPermissionRemoveRoleModel; -import com.loginradius.sdk.models.requestmodels.RoleContextRemoveRoleModel; -import com.loginradius.sdk.models.requestmodels.RolesModel; -import com.loginradius.sdk.models.responsemodels.ListData; -import com.loginradius.sdk.models.responsemodels.ListReturn; -import com.loginradius.sdk.models.responsemodels.otherobjects.DeleteResponse; -import com.loginradius.sdk.models.responsemodels.otherobjects.RoleContextResponseModel; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.RoleContext; -import com.loginradius.sdk.util.AsyncHandler; -import com.loginradius.sdk.util.ErrorResponse; -import com.loginradius.sdk.util.LoginRadiusSDK; - - -public class RoleApi { - private static Gson gson =new Gson(); - - public RoleApi(){ - if (!LoginRadiusSDK.validate()){ - throw new LoginRadiusSDK.InitializeException(); - } - } - - - - // - // API is used to retrieve all the assigned roles of a particular User. - // - // UID, the unified identifier for each user account - // Response containing Definition of Complete Roles data - // 18.6 - - - public void getRolesByUid(String uid, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "identity/v2/manage/account/" + uid + "/role"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - com.loginradius.sdk.models.responsemodels.otherobjects.AccountRolesModel successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to assign your desired roles to a given user. - // - // Model Class containing Definition of payload for Create Role API - // UID, the unified identifier for each user account - // Response containing Definition of Complete Roles data - // 18.7 - - - public void assignRolesByUid(com.loginradius.sdk.models.requestmodels.AccountRolesModel accountRolesModel, String uid, final AsyncHandler handler) { - - if (accountRolesModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accountRolesModel")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "identity/v2/manage/account/" + uid + "/role"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(accountRolesModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - com.loginradius.sdk.models.responsemodels.otherobjects.AccountRolesModel successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to unassign roles from a user. - // - // Model Class containing Definition of payload for Create Role API - // UID, the unified identifier for each user account - // Response containing Definition of Delete Request - // 18.8 - - - public void unassignRolesByUid(com.loginradius.sdk.models.requestmodels.AccountRolesModel accountRolesModel, String uid, final AsyncHandler handler) { - - if (accountRolesModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accountRolesModel")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "identity/v2/manage/account/" + uid + "/role"; - - LoginRadiusRequest.execute("DELETE", resourcePath, queryParameters, gson.toJson(accountRolesModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - DeleteResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API Gets the contexts that have been configured and the associated roles and permissions. - // - // UID, the unified identifier for each user account - // Complete user RoleContext data - // 18.9 - - - public void getRoleContextByUid(String uid, final AsyncHandler> handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "identity/v2/manage/account/" + uid + "/rolecontext"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - ListReturn successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // The API is used to retrieve role context by the context name. - // - // Name of context - // Complete user RoleContext data - // 18.10 - - - public void getRoleContextByContextName(String contextName, final AsyncHandler> handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(contextName)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("contextName")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "identity/v2/manage/account/rolecontext/" + contextName; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - ListReturn successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API creates a Context with a set of Roles - // - // Model Class containing Definition of RoleContext payload - // UID, the unified identifier for each user account - // Complete user RoleContext data - // 18.11 - - - public void updateRoleContextByUid(AccountRoleContextModel accountRoleContextModel, String uid, final AsyncHandler> handler) { - - if (accountRoleContextModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accountRoleContextModel")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "identity/v2/manage/account/" + uid + "/rolecontext"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(accountRoleContextModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - ListReturn successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API Deletes the specified Role Context - // - // Name of context - // UID, the unified identifier for each user account - // Response containing Definition of Delete Request - // 18.12 - - - public void deleteRoleContextByUid(String contextName, String uid, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(contextName)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("contextName")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "identity/v2/manage/account/" + uid + "/rolecontext/" + contextName; - - LoginRadiusRequest.execute("DELETE", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - DeleteResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API Deletes the specified Role from a Context. - // - // Name of context - // Model Class containing Definition of payload for RoleContextRemoveRole API - // UID, the unified identifier for each user account - // Response containing Definition of Delete Request - // 18.13 - - - public void deleteRolesFromRoleContextByUid(String contextName, RoleContextRemoveRoleModel roleContextRemoveRoleModel, - String uid, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(contextName)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("contextName")); - } - - if (roleContextRemoveRoleModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("roleContextRemoveRoleModel")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "identity/v2/manage/account/" + uid + "/rolecontext/" + contextName + "/role"; - - LoginRadiusRequest.execute("DELETE", resourcePath, queryParameters, gson.toJson(roleContextRemoveRoleModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - DeleteResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API Deletes Additional Permissions from Context. - // - // Name of context - // Model Class containing Definition of payload for RoleContextAdditionalPermissionRemoveRole API - // UID, the unified identifier for each user account - // Response containing Definition of Delete Request - // 18.14 - - - public void deleteAdditionalPermissionFromRoleContextByUid(String contextName, RoleContextAdditionalPermissionRemoveRoleModel roleContextAdditionalPermissionRemoveRoleModel, - String uid, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(contextName)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("contextName")); - } - - if (roleContextAdditionalPermissionRemoveRoleModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("roleContextAdditionalPermissionRemoveRoleModel")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "identity/v2/manage/account/" + uid + "/rolecontext/" + contextName + "/additionalpermission"; - - LoginRadiusRequest.execute("DELETE", resourcePath, queryParameters, gson.toJson(roleContextAdditionalPermissionRemoveRoleModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - DeleteResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API retrieves the complete list of created roles with permissions of your app. - // - // Complete user Roles List data - // 41.1 - - - public void getRolesList(final AsyncHandler> handler) { - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "identity/v2/manage/role"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - ListData successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API creates a role with permissions. - // - // Model Class containing Definition of payload for Roles API - // Complete user Roles data - // 41.2 - - - public void createRoles(RolesModel rolesModel, final AsyncHandler> handler) { - - if (rolesModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("rolesModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "identity/v2/manage/role"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(rolesModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - ListData successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to delete the role. - // - // Created RoleName - // Response containing Definition of Delete Request - // 41.3 - - - public void deleteRole(String role, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(role)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("role")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "identity/v2/manage/role/" + role; - - LoginRadiusRequest.execute("DELETE", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - DeleteResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to add permissions to a given role. - // - // Model Class containing Definition for PermissionsModel Property - // Created RoleName - // Response containing Definition of Complete role data - // 41.4 - - - public void addRolePermissions(PermissionsModel permissionsModel, String role, final AsyncHandler handler) { - - if (permissionsModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("permissionsModel")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(role)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("role")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "identity/v2/manage/role/" + role + "/permission"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(permissionsModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - com.loginradius.sdk.models.responsemodels.otherobjects.RoleModel successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // API is used to remove permissions from a role. - // - // Model Class containing Definition for PermissionsModel Property - // Created RoleName - // Response containing Definition of Complete role data - // 41.5 - - - public void removeRolePermissions(PermissionsModel permissionsModel, String role, final AsyncHandler handler) { - - if (permissionsModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("permissionsModel")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(role)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("role")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "identity/v2/manage/role/" + role + "/permission"; - - LoginRadiusRequest.execute("DELETE", resourcePath, queryParameters, gson.toJson(permissionsModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - com.loginradius.sdk.models.responsemodels.otherobjects.RoleModel successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/account/SottApi.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/account/SottApi.java deleted file mode 100644 index 872f8f5..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/account/SottApi.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. -*/ - -package com.loginradius.sdk.api.account; - -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; -import com.loginradius.sdk.helper.JsonDeserializer; -import com.loginradius.sdk.helper.LoginRadiusRequest; -import com.loginradius.sdk.models.responsemodels.SottResponseData; -import com.loginradius.sdk.util.AsyncHandler; -import com.loginradius.sdk.util.ErrorResponse; -import com.loginradius.sdk.util.LoginRadiusSDK; - - -public class SottApi { - private static Gson gson =new Gson(); - - public SottApi(){ - if (!LoginRadiusSDK.validate()){ - throw new LoginRadiusSDK.InitializeException(); - } - } - - - - // - // This API allows you to generate SOTT with a given expiration time. - // - // The time difference you would like to pass, If you not pass difference then the default value is 10 minutes - // Sott data For Registration - // 18.28 - - - public void generateSott(Integer timeDifference, final AsyncHandler handler) { - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - if (timeDifference != null) { - queryParameters.put("timeDifference", String.valueOf(timeDifference)); - } - - String resourcePath = "identity/v2/manage/account/sott"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - SottResponseData successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/advanced/ConfigurationApi.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/advanced/ConfigurationApi.java deleted file mode 100644 index 0773ecc..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/advanced/ConfigurationApi.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. -*/ - -package com.loginradius.sdk.api.advanced; - -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; -import com.loginradius.sdk.helper.JsonDeserializer; -import com.loginradius.sdk.helper.LoginRadiusRequest; -import com.loginradius.sdk.models.responsemodels.configobjects.ConfigResponseModel; -import com.loginradius.sdk.models.responsemodels.otherobjects.ServiceInfoModel; -import com.loginradius.sdk.util.AsyncHandler; -import com.loginradius.sdk.util.ErrorResponse; -import com.loginradius.sdk.util.LoginRadiusSDK; - - -public class ConfigurationApi { - private static Gson gson =new Gson(); - - public ConfigurationApi(){ - if (!LoginRadiusSDK.validate()){ - throw new LoginRadiusSDK.InitializeException(); - } - } - - - // - // This API is used to get the configurations which are set in the LoginRadius Dashboard for a particular LoginRadius site/environment - // - // LoginRadius API Key - // Response containing LoginRadius App configurations which are set in the LoginRadius Dashboard for a particular LoginRadius - // site/environment - // 100 - - public void getConfigurations(final AsyncHandler handler) - { - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - String resourcePath = "ciam/appinfo"; - - LoginRadiusRequest.execute("GET",resourcePath,queryParameters,null,new AsyncHandler() - { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - ConfigResponseModel successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - - - // - // This API allows you to query your LoginRadius account for basic server information and server time information which is useful when generating an SOTT token. - // - // The time difference you would like to pass, If you not pass difference then the default value is 10 minutes - // Response containing Definition of Complete service info data - // 3.1 - - - public void getServerInfo(Integer timeDifference, final AsyncHandler handler) { - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (timeDifference != null) { - queryParameters.put("timeDifference", String.valueOf(timeDifference)); - } - - String resourcePath = "identity/v2/serverinfo"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - ServiceInfoModel successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/advanced/ConsentManagementApi.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/advanced/ConsentManagementApi.java deleted file mode 100644 index e4bec20..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/advanced/ConsentManagementApi.java +++ /dev/null @@ -1,279 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. -*/ - -package com.loginradius.sdk.api.advanced; - -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; -import com.loginradius.sdk.helper.JsonDeserializer; -import com.loginradius.sdk.helper.LoginRadiusRequest; -import com.loginradius.sdk.helper.LoginRadiusValidator; -import com.loginradius.sdk.models.requestmodels.ConsentSubmitModel; -import com.loginradius.sdk.models.requestmodels.ConsentUpdateModel; -import com.loginradius.sdk.models.responsemodels.AccessToken; -import com.loginradius.sdk.models.responsemodels.ConsentLogsResponseModel; -import com.loginradius.sdk.models.responsemodels.ConsentProfile; -import com.loginradius.sdk.models.responsemodels.ConsentProfileValidResponse; -import com.loginradius.sdk.models.responsemodels.userprofile.Identity; -import com.loginradius.sdk.util.AsyncHandler; -import com.loginradius.sdk.util.ErrorResponse; -import com.loginradius.sdk.util.LoginRadiusSDK; - - -public class ConsentManagementApi { - private static Gson gson =new Gson(); - - public ConsentManagementApi(){ - if (!LoginRadiusSDK.validate()){ - throw new LoginRadiusSDK.InitializeException(); - } - } - - - - // - // This API is used to get the Consent logs of the user. - // - // UID, the unified identifier for each user account - // Response containing consent logs - // 18.37 - - - public void getConsentLogsByUid(String uid, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "identity/v2/manage/account/" + uid + "/consent/logs"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - ConsentLogsResponseModel successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is to submit consent form using consent token. - // - // The consent token received after login error 1226 - // Model class containing list of multiple consent - // Response containing User Profile Data and access token - // 43.1 - - - public void submitConsentByConsentToken(String consentToken, ConsentSubmitModel consentSubmitModel, final AsyncHandler> handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(consentToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("consentToken")); - } - - if (consentSubmitModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("consentSubmitModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("consentToken", consentToken); - - String resourcePath = "identity/v2/auth/consent"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(consentSubmitModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - AccessToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to fetch consent logs. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Response containing consent logs - // 43.2 - - - public void getConsentLogs(String accessToken, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/consent/logs"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - ConsentLogsResponseModel successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // API to provide a way to end user to submit a consent form for particular event type. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Model class containing list of multiple consent - // Response containing Definition for Complete profile data - // 43.3 - - - public void submitConsentByAccessToken(String accessToken, ConsentSubmitModel consentSubmitModel, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (consentSubmitModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("consentSubmitModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/consent/profile"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(consentSubmitModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - Identity successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to check if consent is submitted for a particular event or not. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Allowed events: Login, Register, UpdateProfile, ResetPassword, ChangePassword, emailVerification, AddEmail, RemoveEmail, BlockAccount, DeleteAccount, SetUsername, AssignRoles, UnassignRoles, SetPassword, LinkAccount, UnlinkAccount, UpdatePhoneId, VerifyPhoneNumber, CreateCustomObject, UpdateCustomobject, DeleteCustomObject - // true/false - // Response containing consent profile - // 43.4 - - - public void verifyConsentByAccessToken(String accessToken, String event, - Boolean isCustom, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(event)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("event")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("event", event); - queryParameters.put("isCustom", String.valueOf(isCustom)); - - String resourcePath = "identity/v2/auth/consent/verify"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - ConsentProfileValidResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is to update consents using access token. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Model class containg list of multiple consent - // Response containing consent profile - // 43.5 - - - public void updateConsentProfileByAccessToken(String accessToken, ConsentUpdateModel consentUpdateModel, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (consentUpdateModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("consentUpdateModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/consent"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(consentUpdateModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - ConsentProfile successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/advanced/CustomObjectApi.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/advanced/CustomObjectApi.java deleted file mode 100644 index 3cc4208..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/advanced/CustomObjectApi.java +++ /dev/null @@ -1,525 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. -*/ - -package com.loginradius.sdk.api.advanced; - -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.JsonObject; -import com.google.gson.reflect.TypeToken; -import com.loginradius.sdk.helper.JsonDeserializer; -import com.loginradius.sdk.helper.LoginRadiusRequest; -import com.loginradius.sdk.helper.LoginRadiusValidator; -import com.loginradius.sdk.models.enums.CustomObjectUpdateOperationType; -import com.loginradius.sdk.models.responsemodels.ListData; -import com.loginradius.sdk.models.responsemodels.UserCustomObjectData; -import com.loginradius.sdk.models.responsemodels.otherobjects.DeleteResponse; -import com.loginradius.sdk.util.AsyncHandler; -import com.loginradius.sdk.util.ErrorResponse; -import com.loginradius.sdk.util.LoginRadiusSDK; - - -public class CustomObjectApi { - private static Gson gson =new Gson(); - - public CustomObjectApi(){ - if (!LoginRadiusSDK.validate()){ - throw new LoginRadiusSDK.InitializeException(); - } - } - - - - // - // This API is used to write information in JSON format to the custom object for the specified account. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // LoginRadius Custom Object Name - // LoginRadius Custom Object Name - // Response containing Definition for Complete user custom object data - // 6.1 - - - public void createCustomObjectByToken(String accessToken, String objectName, - JsonObject payload, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(objectName)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("objectName")); - } - - if (payload == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("payload")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("objectName", objectName); - - String resourcePath = "identity/v2/auth/customobject"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(payload), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - UserCustomObjectData successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to update the specified custom object data of the specified account. If the value of updatetype is 'replace' then it will fully replace custom object with the new custom object and if the value of updatetype is 'partialreplace' then it will perform an upsert type operation - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // LoginRadius Custom Object Name - // Unique identifier of the user's record in Custom Object - // LoginRadius Custom Object Name - // Possible values: replace, partialreplace. - // Response containing Definition for Complete user custom object data - // 6.2 - - - public void updateCustomObjectByToken(String accessToken, String objectName, - String objectRecordId, JsonObject payload, CustomObjectUpdateOperationType updateType, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(objectName)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("objectName")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(objectRecordId)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("objectRecordId")); - } - - if (payload == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("payload")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("objectName", objectName); - - if (updateType != null) { - queryParameters.put("updateType", String.valueOf(updateType)); - } - - String resourcePath = "identity/v2/auth/customobject/" + objectRecordId; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(payload), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - UserCustomObjectData successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to retrieve the specified Custom Object data for the specified account. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // LoginRadius Custom Object Name - // Complete user CustomObject data - // 6.3 - - - public void getCustomObjectByToken(String accessToken, String objectName, final AsyncHandler> handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(objectName)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("objectName")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("objectName", objectName); - - String resourcePath = "identity/v2/auth/customobject"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - ListData successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to retrieve the Custom Object data for the specified account. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // LoginRadius Custom Object Name - // Unique identifier of the user's record in Custom Object - // Response containing Definition for Complete user custom object data - // 6.4 - - - public void getCustomObjectByRecordIDAndToken(String accessToken, String objectName, - String objectRecordId, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(objectName)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("objectName")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(objectRecordId)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("objectRecordId")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("objectName", objectName); - - String resourcePath = "identity/v2/auth/customobject/" + objectRecordId; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - UserCustomObjectData successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to remove the specified Custom Object data using ObjectRecordId of a specified account. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // LoginRadius Custom Object Name - // Unique identifier of the user's record in Custom Object - // Response containing Definition of Delete Request - // 6.5 - - - public void deleteCustomObjectByToken(String accessToken, String objectName, - String objectRecordId, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(objectName)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("objectName")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(objectRecordId)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("objectRecordId")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("objectName", objectName); - - String resourcePath = "identity/v2/auth/customobject/" + objectRecordId; - - LoginRadiusRequest.execute("DELETE", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - DeleteResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to write information in JSON format to the custom object for the specified account. - // - // LoginRadius Custom Object Name - // LoginRadius Custom Object Name - // UID, the unified identifier for each user account - // Response containing Definition for Complete user custom object data - // 19.1 - - - public void createCustomObjectByUid(String objectName, JsonObject payload, - String uid, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(objectName)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("objectName")); - } - - if (payload == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("payload")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - queryParameters.put("objectName", objectName); - - String resourcePath = "identity/v2/manage/account/" + uid + "/customobject"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(payload), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - UserCustomObjectData successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to update the specified custom object data of a specified account. If the value of updatetype is 'replace' then it will fully replace custom object with new custom object and if the value of updatetype is partialreplace then it will perform an upsert type operation. - // - // LoginRadius Custom Object Name - // Unique identifier of the user's record in Custom Object - // LoginRadius Custom Object Name - // UID, the unified identifier for each user account - // Possible values: replace, partialreplace. - // Response containing Definition for Complete user custom object data - // 19.2 - - - public void updateCustomObjectByUid(String objectName, String objectRecordId, - JsonObject payload, String uid, CustomObjectUpdateOperationType updateType, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(objectName)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("objectName")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(objectRecordId)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("objectRecordId")); - } - - if (payload == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("payload")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - queryParameters.put("objectName", objectName); - - if (updateType != null) { - queryParameters.put("updateType", String.valueOf(updateType)); - } - - String resourcePath = "identity/v2/manage/account/" + uid + "/customobject/" + objectRecordId; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(payload), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - UserCustomObjectData successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to retrieve all the custom objects by UID from cloud storage. - // - // LoginRadius Custom Object Name - // UID, the unified identifier for each user account - // Complete user CustomObject data - // 19.3 - - - public void getCustomObjectByUid(String objectName, String uid, final AsyncHandler> handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(objectName)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("objectName")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - queryParameters.put("objectName", objectName); - - String resourcePath = "identity/v2/manage/account/" + uid + "/customobject"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - ListData successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to retrieve the Custom Object data for the specified account. - // - // LoginRadius Custom Object Name - // Unique identifier of the user's record in Custom Object - // UID, the unified identifier for each user account - // Response containing Definition for Complete user custom object data - // 19.4 - - - public void getCustomObjectByRecordID(String objectName, String objectRecordId, - String uid, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(objectName)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("objectName")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(objectRecordId)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("objectRecordId")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - queryParameters.put("objectName", objectName); - - String resourcePath = "identity/v2/manage/account/" + uid + "/customobject/" + objectRecordId; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - UserCustomObjectData successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to remove the specified Custom Object data using ObjectRecordId of specified account. - // - // LoginRadius Custom Object Name - // Unique identifier of the user's record in Custom Object - // UID, the unified identifier for each user account - // Response containing Definition of Delete Request - // 19.5 - - - public void deleteCustomObjectByRecordID(String objectName, String objectRecordId, - String uid, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(objectName)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("objectName")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(objectRecordId)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("objectRecordId")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - queryParameters.put("objectName", objectName); - - String resourcePath = "identity/v2/manage/account/" + uid + "/customobject/" + objectRecordId; - - LoginRadiusRequest.execute("DELETE", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - DeleteResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/advanced/MultiFactorAuthenticationApi.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/advanced/MultiFactorAuthenticationApi.java deleted file mode 100644 index 09de7e5..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/advanced/MultiFactorAuthenticationApi.java +++ /dev/null @@ -1,1602 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. -*/ - -package com.loginradius.sdk.api.advanced; - -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.JsonObject; -import com.google.gson.reflect.TypeToken; -import com.loginradius.sdk.helper.JsonDeserializer; -import com.loginradius.sdk.helper.LoginRadiusRequest; -import com.loginradius.sdk.helper.LoginRadiusValidator; -import com.loginradius.sdk.models.requestmodels.EmailIdModel; -import com.loginradius.sdk.models.requestmodels.MultiFactorAuthModelByAuthenticatorCode; -import com.loginradius.sdk.models.requestmodels.MultiFactorAuthModelByAuthenticatorCodeSecurityAnswer; -import com.loginradius.sdk.models.requestmodels.MultiFactorAuthModelByBackupCode; -import com.loginradius.sdk.models.requestmodels.MultiFactorAuthModelByEmailOtp; -import com.loginradius.sdk.models.requestmodels.MultiFactorAuthModelByEmailOtpWithLockout; -import com.loginradius.sdk.models.requestmodels.MultiFactorAuthModelWithLockout; -import com.loginradius.sdk.models.requestmodels.SecurityQuestionAnswerModelByAccessToken; -import com.loginradius.sdk.models.requestmodels.SecurityQuestionAnswerUpdateModel; -import com.loginradius.sdk.models.responsemodels.AccessToken; -import com.loginradius.sdk.models.responsemodels.MultiFactorAuthenticationResponse; -import com.loginradius.sdk.models.responsemodels.MultiFactorAuthenticationSettingsResponse; -import com.loginradius.sdk.models.responsemodels.SmsResponseData; -import com.loginradius.sdk.models.responsemodels.otherobjects.BackupCodeResponse; -import com.loginradius.sdk.models.responsemodels.otherobjects.DeleteResponse; -import com.loginradius.sdk.models.responsemodels.otherobjects.GetResponse; -import com.loginradius.sdk.models.responsemodels.otherobjects.PostResponse; -import com.loginradius.sdk.models.responsemodels.userprofile.Identity; -import com.loginradius.sdk.models.responsemodels.userprofile.UserProfile; -import com.loginradius.sdk.util.AsyncHandler; -import com.loginradius.sdk.util.ErrorResponse; -import com.loginradius.sdk.util.LoginRadiusSDK; - - -public class MultiFactorAuthenticationApi { - private static Gson gson =new Gson(); - - public MultiFactorAuthenticationApi(){ - if (!LoginRadiusSDK.validate()){ - throw new LoginRadiusSDK.InitializeException(); - } - } - - - - // - // This API is used to configure the Multi-factor authentication after login by using the access token when MFA is set as optional on the LoginRadius site. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Boolean, pass true if you wish to trigger voice OTP - // Response containing Definition of Complete Multi-Factor Authentication Settings data - // 5.7 - - - public void mfaConfigureByAccessToken(String accessToken, Boolean isVoiceOtp, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (isVoiceOtp != null && isVoiceOtp) { - queryParameters.put("isVoiceOtp", String.valueOf(isVoiceOtp)); - } - - String resourcePath = "identity/v2/auth/account/2fa"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - MultiFactorAuthenticationSettingsResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to trigger the Multi-factor authentication settings after login for secure actions - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Model Class containing Definition of payload for MultiFactorAuthModel With Lockout API - // The fields parameter filters the API response so that the response only includes a specific set of fields - // Response containing Definition for Complete profile data - // 5.9 - - - public void mfaUpdateSetting(String accessToken, MultiFactorAuthModelWithLockout multiFactorAuthModelWithLockout, - String fields, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (multiFactorAuthModelWithLockout == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("multiFactorAuthModelWithLockout")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - String resourcePath = "identity/v2/auth/account/2fa/verification/otp"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(multiFactorAuthModelWithLockout), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - Identity successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to update the Multi-factor authentication phone number by sending the verification OTP to the provided phone number - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Phone Number For 2FA - // SMS Template Name - // Boolean, pass true if you wish to trigger voice OTP - // PreventVerificationEmail (Specifying this value prevents the verification email from being sent. Only applicable if you have the optional email verification flow) - // Response containing Definition for Complete SMS data - // 5.11 - - - public void mfaUpdatePhoneNumberByToken(String accessToken, String phoneNo2FA, - String smsTemplate2FA, Boolean isVoiceOtp, String options, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(phoneNo2FA)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("phoneNo2FA")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate2FA)) { - queryParameters.put("smsTemplate2FA", smsTemplate2FA); - } - - if (isVoiceOtp != null && isVoiceOtp) { - queryParameters.put("isVoiceOtp", String.valueOf(isVoiceOtp)); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(options)) { - queryParameters.put("options", options); - } - - JsonObject bodyParameters = new JsonObject(); - bodyParameters.addProperty("phoneNo2FA", phoneNo2FA); - - String resourcePath = "identity/v2/auth/account/2fa"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(bodyParameters), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - SmsResponseData successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API Resets the Authenticator configurations on a given account via the access_token. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Pass true to remove Authenticator. - // Response containing Definition of Delete Request - // 5.12.1 - - - public void mfaResetAuthenticatorByToken(String accessToken, Boolean authenticator, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - JsonObject bodyParameters = new JsonObject(); - bodyParameters.addProperty("authenticator", authenticator); - - String resourcePath = "identity/v2/auth/account/2fa/authenticator"; - - LoginRadiusRequest.execute("DELETE", resourcePath, queryParameters, gson.toJson(bodyParameters), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - DeleteResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API resets the SMS Authenticator configurations on a given account via the access token. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Pass 'otpauthenticator' to remove SMS Authenticator - // Response containing Definition of Delete Request - // 5.12.2 - - - public void mfaResetSMSAuthByToken(String accessToken, Boolean otpauthenticator, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - JsonObject bodyParameters = new JsonObject(); - bodyParameters.addProperty("otpauthenticator", otpauthenticator); - - String resourcePath = "identity/v2/auth/account/2fa/authenticator"; - - LoginRadiusRequest.execute("DELETE", resourcePath, queryParameters, gson.toJson(bodyParameters), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - DeleteResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to get a set of backup codes via access token to allow the user login on a site that has Multi-factor Authentication enabled in the event that the user does not have a secondary factor available. We generate 10 codes, each code can only be consumed once. If any user attempts to go over the number of invalid login attempts configured in the Dashboard then the account gets blocked automatically - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Response containing Definition of Complete Backup Code data - // 5.13 - - - public void mfaBackupCodeByAccessToken(String accessToken, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/account/2fa/backupcode"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - BackupCodeResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // API is used to reset the backup codes on a given account via the access token. This API call will generate 10 new codes, each code can only be consumed once - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Response containing Definition of Complete Backup Code data - // 5.14 - - - public void mfaResetBackupCodeByAccessToken(String accessToken, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/account/2fa/backupcode/reset"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - BackupCodeResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is created to send the OTP to the email if email OTP authenticator is enabled in app's MFA configuration. - // - // access_token - // EmailId - // EmailTemplate2FA - // Response containing Definition of Complete Validation data - // 5.17 - - - public void mfaEmailOtpByAccessToken(String accessToken, String emailId, - String emailTemplate2FA, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(emailId)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("emailId")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("emailId", emailId); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate2FA)) { - queryParameters.put("emailTemplate2FA", emailTemplate2FA); - } - - String resourcePath = "identity/v2/auth/account/2fa/otp/email"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to set up MFA Email OTP authenticator on profile after login. - // - // access_token - // payload - // Response containing Definition for Complete profile data - // 5.18 - - - public void mfaValidateEmailOtpByAccessToken(String accessToken, MultiFactorAuthModelByEmailOtpWithLockout multiFactorAuthModelByEmailOtpWithLockout, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (multiFactorAuthModelByEmailOtpWithLockout == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("multiFactorAuthModelByEmailOtpWithLockout")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/account/2fa/verification/otp/email"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(multiFactorAuthModelByEmailOtpWithLockout), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - Identity successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to reset the Email OTP Authenticator settings for an MFA-enabled user - // - // access_token - // Response containing Definition of Delete Request - // 5.19 - - - public void mfaResetEmailOtpAuthenticatorByAccessToken(String accessToken, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/account/2fa/authenticator/otp/email"; - - LoginRadiusRequest.execute("DELETE", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - DeleteResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to set up MFA Security Question authenticator on profile after login. - // - // access_token - // payload - // Response containing Definition of Complete Validation data - // 5.20 - - - public void mfaSecurityQuestionAnswerByAccessToken(String accessToken, SecurityQuestionAnswerModelByAccessToken securityQuestionAnswerModelByAccessToken, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (securityQuestionAnswerModelByAccessToken == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("securityQuestionAnswerModelByAccessToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/account/2fa/securityquestionanswer"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(securityQuestionAnswerModelByAccessToken), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to Reset MFA Security Question Authenticator By Access Token - // - // access_token - // Response containing Definition of Delete Request - // 5.21 - - - public void mfaResetSecurityQuestionAuthenticatorByAccessToken(String accessToken, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/account/2fa/authenticator/securityquestionanswer"; - - LoginRadiusRequest.execute("DELETE", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - DeleteResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API can be used to login by emailid on a Multi-factor authentication enabled LoginRadius site. - // - // user's email - // Password for the email - // Email template name - // The fields parameter filters the API response so that the response only includes a specific set of fields - // Url where the user is logging from - // SMS Template name - // SMS Template Name - // Email verification url - // 2FA Email template name - // Boolean, pass true if you wish to trigger voice OTP - // PreventVerificationEmail (Specifying this value prevents the verification email from being sent. Only applicable if you have the optional email verification flow) - // Complete user UserProfile data - // 9.8.1 - - - public void mfaLoginByEmail(String email, String password, - String emailTemplate, String fields, String loginUrl, String smsTemplate, - String smsTemplate2FA, String verificationUrl, String emailTemplate2FA, Boolean isVoiceOtp, String options, final AsyncHandler> handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(email)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("email")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(password)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("password")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate)) { - queryParameters.put("emailTemplate", emailTemplate); - } - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(loginUrl)) { - queryParameters.put("loginUrl", loginUrl); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate)) { - queryParameters.put("smsTemplate", smsTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate2FA)) { - queryParameters.put("smsTemplate2FA", smsTemplate2FA); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(verificationUrl)) { - queryParameters.put("verificationUrl", verificationUrl); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate2FA)) { - queryParameters.put("emailTemplate2FA", emailTemplate2FA); - } - - if (isVoiceOtp != null && isVoiceOtp) { - queryParameters.put("isVoiceOtp", String.valueOf(isVoiceOtp)); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(options)) { - queryParameters.put("options", options); - } - - JsonObject bodyParameters = new JsonObject(); - bodyParameters.addProperty("email", email); - bodyParameters.addProperty("password", password); - - String resourcePath = "identity/v2/auth/login/2fa"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(bodyParameters), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - MultiFactorAuthenticationResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API can be used to login by username on a Multi-factor authentication enabled LoginRadius site. - // - // Password for the email - // Username of the user - // Email template name - // The fields parameter filters the API response so that the response only includes a specific set of fields - // Url where the user is logging from - // SMS Template name - // SMS Template Name - // Email verification url - // 2FA Email template name - // Boolean, pass true if you wish to trigger voice OTP - // Complete user UserProfile data - // 9.8.2 - - - public void mfaLoginByUserName(String password, String username, - String emailTemplate, String fields, String loginUrl, String smsTemplate, - String smsTemplate2FA, String verificationUrl,String emailTemplate2FA, Boolean isVoiceOtp, final AsyncHandler> handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(password)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("password")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(username)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("username")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate)) { - queryParameters.put("emailTemplate", emailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(loginUrl)) { - queryParameters.put("loginUrl", loginUrl); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate)) { - queryParameters.put("smsTemplate", smsTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate2FA)) { - queryParameters.put("smsTemplate2FA", smsTemplate2FA); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(verificationUrl)) { - queryParameters.put("verificationUrl", verificationUrl); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate2FA)) { - queryParameters.put("emailTemplate2FA", emailTemplate2FA); - } - - if (isVoiceOtp != null && isVoiceOtp) { - queryParameters.put("isVoiceOtp", String.valueOf(isVoiceOtp)); - } - - JsonObject bodyParameters = new JsonObject(); - bodyParameters.addProperty("password", password); - bodyParameters.addProperty("username", username); - - String resourcePath = "identity/v2/auth/login/2fa"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(bodyParameters), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - MultiFactorAuthenticationResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API can be used to login by Phone on a Multi-factor authentication enabled LoginRadius site. - // - // Password for the email - // New Phone Number - // Email template name - // The fields parameter filters the API response so that the response only includes a specific set of fields - // Url where the user is logging from - // SMS Template name - // SMS Template Name - // Email verification url - // 2FA Email template name - // Boolean, pass true if you wish to trigger voice OTP - // PreventVerificationEmail (Specifying this value prevents the verification email from being sent. Only applicable if you have the optional email verification flow) - // Complete user UserProfile data - // 9.8.3 - - - public void mfaLoginByPhone(String password, String phone, - String emailTemplate, String fields, String loginUrl, String smsTemplate, - String smsTemplate2FA, String verificationUrl,String emailTemplate2FA, Boolean isVoiceOtp, String options, final AsyncHandler> handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(password)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("password")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(phone)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("phone")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate)) { - queryParameters.put("emailTemplate", emailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(loginUrl)) { - queryParameters.put("loginUrl", loginUrl); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate)) { - queryParameters.put("smsTemplate", smsTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate2FA)) { - queryParameters.put("smsTemplate2FA", smsTemplate2FA); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(verificationUrl)) { - queryParameters.put("verificationUrl", verificationUrl); - } - - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate2FA)) { - queryParameters.put("emailTemplate2FA", emailTemplate2FA); - } - if (isVoiceOtp != null && isVoiceOtp) { - queryParameters.put("isVoiceOtp", String.valueOf(isVoiceOtp)); - } - if (!LoginRadiusValidator.isNullOrWhiteSpace(options)) { - queryParameters.put("options", options); - } - - JsonObject bodyParameters = new JsonObject(); - bodyParameters.addProperty("password", password); - bodyParameters.addProperty("phone", phone); - - String resourcePath = "identity/v2/auth/login/2fa"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(bodyParameters), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - MultiFactorAuthenticationResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to login via Multi-factor authentication by passing the One Time Password received via SMS - // - // Model Class containing Definition of payload for MultiFactorAuthModel With Lockout API - // A Uniquely generated MFA identifier token after successful authentication - // The fields parameter filters the API response so that the response only includes a specific set of fields - // SMS Template Name - // - // - // - // - // Complete user UserProfile data - // 9.12 - - - public void mfaValidateOTPByPhone(MultiFactorAuthModelWithLockout multiFactorAuthModelWithLockout, String secondFactorAuthenticationToken, - String fields,String smsTemplate2FA, String rbaBrowserEmailTemplate, String rbaCityEmailTemplate, String rbaCountryEmailTemplate, String rbaIpEmailTemplate, final AsyncHandler> handler) { - - if (multiFactorAuthModelWithLockout == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("multiFactorAuthModelWithLockout")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(secondFactorAuthenticationToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("secondFactorAuthenticationToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("secondFactorAuthenticationToken", secondFactorAuthenticationToken); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate2FA)) { - queryParameters.put("smsTemplate2FA", smsTemplate2FA); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaBrowserEmailTemplate)) { - queryParameters.put("rbaBrowserEmailTemplate", rbaBrowserEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaCityEmailTemplate)) { - queryParameters.put("rbaCityEmailTemplate", rbaCityEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaCountryEmailTemplate)) { - queryParameters.put("rbaCountryEmailTemplate", rbaCountryEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaIpEmailTemplate)) { - queryParameters.put("rbaIpEmailTemplate", rbaIpEmailTemplate); - } - - String resourcePath = "identity/v2/auth/login/2fa/verification/otp"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(multiFactorAuthModelWithLockout), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - AccessToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to validate the backup code provided by the user and if valid, we return an access token allowing the user to login incases where Multi-factor authentication (MFA) is enabled and the secondary factor is unavailable. When a user initially downloads the Backup codes, We generate 10 codes, each code can only be consumed once. if any user attempts to go over the number of invalid login attempts configured in the Dashboard then the account gets blocked automatically - // - // Model Class containing Definition of payload for MultiFactorAuth By BackupCode API - // A Uniquely generated MFA identifier token after successful authentication - // The fields parameter filters the API response so that the response only includes a specific set of fields - // - // - // - // - // Complete user UserProfile data - // 9.14 - - - public void mfaValidateBackupCode(MultiFactorAuthModelByBackupCode multiFactorAuthModelByBackupCode, String secondFactorAuthenticationToken, - String fields, String rbaBrowserEmailTemplate, String rbaCityEmailTemplate, String rbaCountryEmailTemplate, String rbaIpEmailTemplate, final AsyncHandler> handler) { - - if (multiFactorAuthModelByBackupCode == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("multiFactorAuthModelByBackupCode")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(secondFactorAuthenticationToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("secondFactorAuthenticationToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("secondFactorAuthenticationToken", secondFactorAuthenticationToken); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaBrowserEmailTemplate)) { - queryParameters.put("rbaBrowserEmailTemplate", rbaBrowserEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaCityEmailTemplate)) { - queryParameters.put("rbaCityEmailTemplate", rbaCityEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaCountryEmailTemplate)) { - queryParameters.put("rbaCountryEmailTemplate", rbaCountryEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaIpEmailTemplate)) { - queryParameters.put("rbaIpEmailTemplate", rbaIpEmailTemplate); - } - - String resourcePath = "identity/v2/auth/login/2fa/verification/backupcode"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(multiFactorAuthModelByBackupCode), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - AccessToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to update (if configured) the phone number used for Multi-factor authentication by sending the verification OTP to the provided phone number - // - // Phone Number For 2FA - // A Uniquely generated MFA identifier token after successful authentication - // SMS Template Name - // Boolean, pass true if you wish to trigger voice OTP - // PreventVerificationEmail (Specifying this value prevents the verification email from being sent. Only applicable if you have the optional email verification flow) - // Response containing Definition for Complete SMS data - // 9.16 - - - public void mfaUpdatePhoneNumber(String phoneNo2FA, String secondFactorAuthenticationToken, - String smsTemplate2FA, Boolean isVoiceOtp,String options, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(phoneNo2FA)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("phoneNo2FA")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(secondFactorAuthenticationToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("secondFactorAuthenticationToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("secondFactorAuthenticationToken", secondFactorAuthenticationToken); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate2FA)) { - queryParameters.put("smsTemplate2FA", smsTemplate2FA); - } - - if (isVoiceOtp != null && isVoiceOtp) { - queryParameters.put("isVoiceOtp", String.valueOf(isVoiceOtp)); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(options)) { - queryParameters.put("options", options); - } - - JsonObject bodyParameters = new JsonObject(); - bodyParameters.addProperty("phoneNo2FA", phoneNo2FA); - - String resourcePath = "identity/v2/auth/login/2fa"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(bodyParameters), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - SmsResponseData successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to resending the verification OTP to the provided phone number - // - // A Uniquely generated MFA identifier token after successful authentication - // SMS Template Name - // Boolean, pass true if you wish to trigger voice OTP - // Response containing Definition for Complete SMS data - // 9.17 - - - public void mfaResendOTP(String secondFactorAuthenticationToken, String smsTemplate2FA, - Boolean isVoiceOtp, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(secondFactorAuthenticationToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("secondFactorAuthenticationToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("secondFactorAuthenticationToken", secondFactorAuthenticationToken); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate2FA)) { - queryParameters.put("smsTemplate2FA", smsTemplate2FA); - } - - if (isVoiceOtp != null && isVoiceOtp) { - queryParameters.put("isVoiceOtp", String.valueOf(isVoiceOtp)); - } - - String resourcePath = "identity/v2/auth/login/2fa/resend"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - SmsResponseData successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // An API designed to send the MFA Email OTP to the email. - // - // payload - // SecondFactorAuthenticationToken - // EmailTemplate2FA - // Response containing Definition of Complete Validation data - // 9.18 - - - public void mfaEmailOTP(EmailIdModel emailIdModel, String secondFactorAuthenticationToken, - String emailTemplate2FA, final AsyncHandler handler) { - - if (emailIdModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("emailIdModel")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(secondFactorAuthenticationToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("secondFactorAuthenticationToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("secondFactorAuthenticationToken", secondFactorAuthenticationToken); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate2FA)) { - queryParameters.put("emailTemplate2FA", emailTemplate2FA); - } - - String resourcePath = "identity/v2/auth/login/2fa/otp/email"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(emailIdModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to Verify MFA Email OTP by MFA Token - // - // payload - // SecondFactorAuthenticationToken - // RbaBrowserEmailTemplate - // RbaCityEmailTemplate - // RbaCountryEmailTemplate - // RbaIpEmailTemplate - // Response Containing Access Token and Complete Profile Data - // 9.25 - - - public void mfaValidateEmailOtp(MultiFactorAuthModelByEmailOtp multiFactorAuthModelByEmailOtp, String secondFactorAuthenticationToken, - String rbaBrowserEmailTemplate, String rbaCityEmailTemplate, String rbaCountryEmailTemplate, String rbaIpEmailTemplate, final AsyncHandler> handler) { - - if (multiFactorAuthModelByEmailOtp == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("multiFactorAuthModelByEmailOtp")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(secondFactorAuthenticationToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("secondFactorAuthenticationToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("secondFactorAuthenticationToken", secondFactorAuthenticationToken); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaBrowserEmailTemplate)) { - queryParameters.put("rbaBrowserEmailTemplate", rbaBrowserEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaCityEmailTemplate)) { - queryParameters.put("rbaCityEmailTemplate", rbaCityEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaCountryEmailTemplate)) { - queryParameters.put("rbaCountryEmailTemplate", rbaCountryEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaIpEmailTemplate)) { - queryParameters.put("rbaIpEmailTemplate", rbaIpEmailTemplate); - } - - String resourcePath = "identity/v2/auth/login/2fa/verification/otp/email"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(multiFactorAuthModelByEmailOtp), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - AccessToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to set the security questions on the profile with the MFA token when MFA flow is required. - // - // payload - // SecondFactorAuthenticationToken - // Response Containing Access Token and Complete Profile Data - // 9.26 - - - public void mfaSecurityQuestionAnswer(SecurityQuestionAnswerUpdateModel securityQuestionAnswerUpdateModel, String secondFactorAuthenticationToken, final AsyncHandler> handler) { - - if (securityQuestionAnswerUpdateModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("securityQuestionAnswerUpdateModel")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(secondFactorAuthenticationToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("secondFactorAuthenticationToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("secondFactorAuthenticationToken", secondFactorAuthenticationToken); - - String resourcePath = "identity/v2/auth/login/2fa/securityquestionanswer"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(securityQuestionAnswerUpdateModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - AccessToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to resending the verification OTP to the provided phone number - // - // payload - // SecondFactorAuthenticationToken - // RbaBrowserEmailTemplate - // RbaCityEmailTemplate - // RbaCountryEmailTemplate - // RbaIpEmailTemplate - // Response Containing Access Token and Complete Profile Data - // 9.27 - - - public void mfaSecurityQuestionAnswerVerification(SecurityQuestionAnswerUpdateModel securityQuestionAnswerUpdateModel, String secondFactorAuthenticationToken, - String rbaBrowserEmailTemplate, String rbaCityEmailTemplate, String rbaCountryEmailTemplate, String rbaIpEmailTemplate, final AsyncHandler> handler) { - - if (securityQuestionAnswerUpdateModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("securityQuestionAnswerUpdateModel")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(secondFactorAuthenticationToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("secondFactorAuthenticationToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("secondFactorAuthenticationToken", secondFactorAuthenticationToken); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaBrowserEmailTemplate)) { - queryParameters.put("rbaBrowserEmailTemplate", rbaBrowserEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaCityEmailTemplate)) { - queryParameters.put("rbaCityEmailTemplate", rbaCityEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaCountryEmailTemplate)) { - queryParameters.put("rbaCountryEmailTemplate", rbaCountryEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaIpEmailTemplate)) { - queryParameters.put("rbaIpEmailTemplate", rbaIpEmailTemplate); - } - - String resourcePath = "identity/v2/auth/login/2fa/verification/securityquestionanswer"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(securityQuestionAnswerUpdateModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - AccessToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API resets the SMS Authenticator configurations on a given account via the UID. - // - // Pass 'otpauthenticator' to remove SMS Authenticator - // UID, the unified identifier for each user account - // Response containing Definition of Delete Request - // 18.21.1 - - - public void mfaResetSMSAuthenticatorByUid(Boolean otpauthenticator, String uid, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - queryParameters.put("uid", uid); - - JsonObject bodyParameters = new JsonObject(); - bodyParameters.addProperty("otpauthenticator", otpauthenticator); - - String resourcePath = "identity/v2/manage/account/2fa/authenticator"; - - LoginRadiusRequest.execute("DELETE", resourcePath, queryParameters, gson.toJson(bodyParameters), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - DeleteResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API resets the Authenticator configurations on a given account via the UID. - // - // Pass true to remove Authenticator. - // UID, the unified identifier for each user account - // Response containing Definition of Delete Request - // 18.21.2 - - - public void mfaResetAuthenticatorByUid(Boolean authenticator, String uid, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - queryParameters.put("uid", uid); - - JsonObject bodyParameters = new JsonObject(); - bodyParameters.addProperty("authenticator", authenticator); - - String resourcePath = "identity/v2/manage/account/2fa/authenticator"; - - LoginRadiusRequest.execute("DELETE", resourcePath, queryParameters, gson.toJson(bodyParameters), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - DeleteResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to reset the backup codes on a given account via the UID. This API call will generate 10 new codes, each code can only be consumed once. - // - // UID, the unified identifier for each user account - // Response containing Definition of Complete Backup Code data - // 18.25 - - - public void mfaBackupCodeByUid(String uid, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - queryParameters.put("uid", uid); - - String resourcePath = "identity/v2/manage/account/2fa/backupcode"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - BackupCodeResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to reset the backup codes on a given account via the UID. This API call will generate 10 new codes, each code can only be consumed once. - // - // UID, the unified identifier for each user account - // Response containing Definition of Complete Backup Code data - // 18.26 - - - public void mfaResetBackupCodeByUid(String uid, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - queryParameters.put("uid", uid); - - String resourcePath = "identity/v2/manage/account/2fa/backupcode/reset"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - BackupCodeResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to reset the Email OTP Authenticator settings for an MFA-enabled user. - // - // UID, the unified identifier for each user account - // Response containing Definition of Delete Request - // 18.42 - - - public void mfaResetEmailOtpAuthenticatorByUid(String uid, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - queryParameters.put("uid", uid); - - String resourcePath = "identity/v2/manage/account/2fa/authenticator/otp/email"; - - LoginRadiusRequest.execute("DELETE", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - DeleteResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to reset the Security Question Authenticator settings for an MFA-enabled user. - // - // UID, the unified identifier for each user account - // Response containing Definition of Delete Request - // 18.43 - - - public void mfaResetSecurityQuestionAuthenticatorByUid(String uid, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - queryParameters.put("uid", uid); - - String resourcePath = "identity/v2/manage/account/2fa/authenticator/securityquestionanswer"; - - LoginRadiusRequest.execute("DELETE", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - DeleteResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to login to a user's account during the second MFA step with an Authenticator Code. - // - // Model Class containing Definition of payload for MultiFactorAuthModel By Authenticator Code API - // A Uniquely generated MFA identifier token after successful authentication - // The fields parameter filters the API response so that the response only includes a specific set of fields - // Complete user UserProfile data - // 44.7 - - - public void mfaValidateAuthenticatorCode(MultiFactorAuthModelByAuthenticatorCode multiFactorAuthModelByAuthenticatorCode, String secondfactorauthenticationtoken, - String fields, final AsyncHandler> handler) { - - if (multiFactorAuthModelByAuthenticatorCode == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("multiFactorAuthModelByAuthenticatorCode")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(secondfactorauthenticationtoken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("secondfactorauthenticationtoken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("secondfactorauthenticationtoken", secondfactorauthenticationtoken); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - String resourcePath = "identity/v2/auth/login/2fa/verification/authenticatorcode"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(multiFactorAuthModelByAuthenticatorCode), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - MultiFactorAuthenticationResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to validate an Authenticator Code as part of the MFA process. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Model Class containing Definition of payload for MultiFactorAuthModel By Authenticator Code API with security answer - // The fields parameter filters the API response so that the response only includes a specific set of fields - // Complete user UserProfile data - // 44.8 - - - public void mfaVerifyAuthenticatorCode(String accessToken, MultiFactorAuthModelByAuthenticatorCodeSecurityAnswer multiFactorAuthModelByAuthenticatorCodeSecurityAnswer, - String fields, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (multiFactorAuthModelByAuthenticatorCodeSecurityAnswer == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("multiFactorAuthModelByAuthenticatorCodeSecurityAnswer")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - String resourcePath = "identity/v2/auth/account/2fa/verification/authenticatorcode"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(multiFactorAuthModelByAuthenticatorCodeSecurityAnswer), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - UserProfile successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/advanced/ReAuthenticationApi.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/advanced/ReAuthenticationApi.java deleted file mode 100644 index 19f75e3..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/advanced/ReAuthenticationApi.java +++ /dev/null @@ -1,560 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. -*/ - -package com.loginradius.sdk.api.advanced; - -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; -import com.loginradius.sdk.helper.JsonDeserializer; -import com.loginradius.sdk.helper.LoginRadiusRequest; -import com.loginradius.sdk.helper.LoginRadiusValidator; -import com.loginradius.sdk.models.requestmodels.EventBasedMultiFactorToken; -import com.loginradius.sdk.models.requestmodels.MultiFactorAuthModelByAuthenticatorCode; -import com.loginradius.sdk.models.requestmodels.PINAuthEventBasedAuthModelWithLockout; -import com.loginradius.sdk.models.requestmodels.PasswordEventBasedAuthModelWithLockout; -import com.loginradius.sdk.models.requestmodels.ReauthByBackupCodeModel; -import com.loginradius.sdk.models.requestmodels.ReauthByEmailOtpModel; -import com.loginradius.sdk.models.requestmodels.ReauthByOtpModel; -import com.loginradius.sdk.models.requestmodels.SecurityQuestionAnswerUpdateModel; -import com.loginradius.sdk.models.responsemodels.EventBasedMultiFactorAuthenticationToken; -import com.loginradius.sdk.models.responsemodels.MultiFactorAuthenticationSettingsResponse; -import com.loginradius.sdk.models.responsemodels.otherobjects.PostResponse; -import com.loginradius.sdk.models.responsemodels.otherobjects.PostValidationResponse; -import com.loginradius.sdk.util.AsyncHandler; -import com.loginradius.sdk.util.ErrorResponse; -import com.loginradius.sdk.util.LoginRadiusSDK; - - -public class ReAuthenticationApi { - private static Gson gson =new Gson(); - - public ReAuthenticationApi(){ - if (!LoginRadiusSDK.validate()){ - throw new LoginRadiusSDK.InitializeException(); - } - } - - - - // - // This API is used to trigger the Multi-Factor Autentication workflow for the provided access token - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // SMS Template Name - // Boolean, pass true if you wish to trigger voice OTP - // Response containing Definition of Complete Multi-Factor Authentication Settings data - // 14.3 - - - public void mfaReAuthenticate(String accessToken, String smsTemplate2FA, Boolean isVoiceOtp, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate2FA)) { - queryParameters.put("smsTemplate2FA", smsTemplate2FA); - } - - if (isVoiceOtp != null && isVoiceOtp) { - queryParameters.put("isVoiceOtp", String.valueOf(isVoiceOtp)); - } - - String resourcePath = "identity/v2/auth/account/reauth/2fa"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - MultiFactorAuthenticationSettingsResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to re-authenticate via Multi-factor authentication by passing the One Time Password received via SMS - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Model Class containing Definition for MFA Reauthentication by OTP - // Complete user Multi-Factor Authentication Token data - // 14.4 - - - public void mfaReAuthenticateByOTP(String accessToken, ReauthByOtpModel reauthByOtpModel, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (reauthByOtpModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("reauthByOtpModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/account/reauth/2fa/otp"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(reauthByOtpModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - EventBasedMultiFactorAuthenticationToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to re-authenticate by set of backup codes via access token on the site that has Multi-factor authentication enabled in re-authentication for the user that does not have the device - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Model Class containing Definition for MFA Reauthentication by Backup code - // Complete user Multi-Factor Authentication Token data - // 14.5 - - - public void mfaReAuthenticateByBackupCode(String accessToken, ReauthByBackupCodeModel reauthByBackupCodeModel, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (reauthByBackupCodeModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("reauthByBackupCodeModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/account/reauth/2fa/backupcode"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(reauthByBackupCodeModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - EventBasedMultiFactorAuthenticationToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to re-authenticate via Multi-factor-authentication by passing the password - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Model Class containing Definition of payload for PasswordEventBasedAuthModel with Lockout API - // SMS Template Name - // Complete user Multi-Factor Authentication Token data - // 14.7 - - - public void mfaReAuthenticateByPassword(String accessToken, PasswordEventBasedAuthModelWithLockout passwordEventBasedAuthModelWithLockout, - String smsTemplate2FA, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (passwordEventBasedAuthModelWithLockout == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("passwordEventBasedAuthModelWithLockout")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate2FA)) { - queryParameters.put("smsTemplate2FA", smsTemplate2FA); - } - - String resourcePath = "identity/v2/auth/account/reauth/password"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(passwordEventBasedAuthModelWithLockout), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - EventBasedMultiFactorAuthenticationToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used on the server-side to validate and verify the re-authentication token created by the MFA re-authentication API. This API checks re-authentications created by OTP. - // - // Model Class containing Definition for SecondFactorValidationToken - // UID, the unified identifier for each user account - // Response containing Definition of Complete Validation data - // 18.38 - - - public void verifyMultiFactorOtpReauthentication(EventBasedMultiFactorToken eventBasedMultiFactorToken, String uid, final AsyncHandler handler) { - - if (eventBasedMultiFactorToken == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("eventBasedMultiFactorToken")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "identity/v2/manage/account/" + uid + "/reauth/2fa"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(eventBasedMultiFactorToken), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostValidationResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used on the server-side to validate and verify the re-authentication token created by the MFA re-authentication API. This API checks re-authentications created by password. - // - // Model Class containing Definition for SecondFactorValidationToken - // UID, the unified identifier for each user account - // Response containing Definition of Complete Validation data - // 18.39 - - - public void verifyMultiFactorPasswordReauthentication(EventBasedMultiFactorToken eventBasedMultiFactorToken, String uid, final AsyncHandler handler) { - - if (eventBasedMultiFactorToken == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("eventBasedMultiFactorToken")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "identity/v2/manage/account/" + uid + "/reauth/password"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(eventBasedMultiFactorToken), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostValidationResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used on the server-side to validate and verify the re-authentication token created by the MFA re-authentication API. This API checks re-authentications created by PIN. - // - // Model Class containing Definition for SecondFactorValidationToken - // UID, the unified identifier for each user account - // Response containing Definition of Complete Validation data - // 18.40 - - - public void verifyMultiFactorPINReauthentication(EventBasedMultiFactorToken eventBasedMultiFactorToken, String uid, final AsyncHandler handler) { - - if (eventBasedMultiFactorToken == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("eventBasedMultiFactorToken")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(uid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("uid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apiSecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "identity/v2/manage/account/" + uid + "/reauth/pin"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(eventBasedMultiFactorToken), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostValidationResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to validate the triggered MFA authentication flow with a password. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Model Class containing Definition of payload for PIN - // SMS Template Name - // Response containing Definition response of MFA reauthentication - // 42.13 - - - public void verifyPINAuthentication(String accessToken, PINAuthEventBasedAuthModelWithLockout pINAuthEventBasedAuthModelWithLockout, - String smsTemplate2FA, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (pINAuthEventBasedAuthModelWithLockout == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("pINAuthEventBasedAuthModelWithLockout")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate2FA)) { - queryParameters.put("smsTemplate2FA", smsTemplate2FA); - } - - String resourcePath = "identity/v2/auth/account/reauth/pin"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(pINAuthEventBasedAuthModelWithLockout), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - EventBasedMultiFactorAuthenticationToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to validate the triggered MFA authentication flow with an Email OTP. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // payload - // Response containing Definition response of MFA reauthentication - // 42.14 - - - public void reAuthValidateEmailOtp(String accessToken, ReauthByEmailOtpModel reauthByEmailOtpModel, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (reauthByEmailOtpModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("reauthByEmailOtpModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/account/reauth/2fa/otp/email/verify"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(reauthByEmailOtpModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - EventBasedMultiFactorAuthenticationToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to send the MFA Email OTP to the email for Re-authentication - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // EmailId - // EmailTemplate2FA - // Response containing Definition of Complete Validation data - // 42.15 - - - public void reAuthSendEmailOtp(String accessToken, String emailId, - String emailTemplate2FA, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(emailId)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("emailId")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("emailId", emailId); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate2FA)) { - queryParameters.put("emailTemplate2FA", emailTemplate2FA); - } - - String resourcePath = "identity/v2/auth/account/reauth/2fa/otp/email"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to validate the triggered MFA re-authentication flow with security questions answers. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // payload - // Response containing Definition response of MFA reauthentication - // 42.16 - - - public void reAuthBySecurityQuestion(String accessToken, SecurityQuestionAnswerUpdateModel securityQuestionAnswerUpdateModel, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (securityQuestionAnswerUpdateModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("securityQuestionAnswerUpdateModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/account/reauth/2fa/securityquestionanswer/verify"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(securityQuestionAnswerUpdateModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - EventBasedMultiFactorAuthenticationToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to validate the triggered MFA authentication flow with the Authenticator Code. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Model Class containing Definition of payload for MultiFactorAuthModel By Authenticator Code API - // Complete user Multi-Factor Authentication Token data - // 44.6 - - - public void mfaReAuthenticateByAuthenticatorCode(String accessToken, MultiFactorAuthModelByAuthenticatorCode multiFactorAuthModelByAuthenticatorCode, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (multiFactorAuthModelByAuthenticatorCode == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("multiFactorAuthModelByAuthenticatorCode")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/account/reauth/2fa/authenticatorcode"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(multiFactorAuthModelByAuthenticatorCode), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - EventBasedMultiFactorAuthenticationToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/advanced/WebHookApi.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/advanced/WebHookApi.java deleted file mode 100644 index 44a939a..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/advanced/WebHookApi.java +++ /dev/null @@ -1,244 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. -*/ - -package com.loginradius.sdk.api.advanced; - -import com.loginradius.sdk.helper.*; -import com.loginradius.sdk.util.*; -import com.google.gson.Gson; -import java.util.Iterator; -import com.google.gson.JsonObject; -import com.google.gson.reflect.TypeToken; -import java.util.HashMap; -import java.util.Map.Entry; -import java.util.Map; -import com.loginradius.sdk.models.responsemodels.otherobjects.*; -import com.loginradius.sdk.models.requestmodels.*; -import com.loginradius.sdk.models.responsemodels.*; - - -public class WebHookApi { - private static Gson gson =new Gson(); - - public WebHookApi(){ - if (!LoginRadiusSDK.validate()){ - throw new LoginRadiusSDK.InitializeException(); - } - } - - - - // - // This API is used to get details of a webhook subscription by Id - // - // Unique ID of the webhook - // Response containing Definition for Complete WebHook data - // 40.1 - - - public void getWebhookSubscriptionDetail(String hookId, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(hookId)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("hookId")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apikey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apisecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "v2/manage/webhooks/" + hookId; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - com.loginradius.sdk.models.responsemodels.otherobjects.WebHookSubscribeModel successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to create a new webhook subscription on your LoginRadius site. - // - // Model Class containing Definition of payload for Webhook Subscribe API - // Response containing Definition for Complete WebHook data - // 40.2 - - - public void createWebhookSubscription(com.loginradius.sdk.models.requestmodels.WebHookSubscribeModel webHookSubscribeModel, final AsyncHandler handler) { - - if (webHookSubscribeModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("webHookSubscribeModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apikey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apisecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "v2/manage/webhooks"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(webHookSubscribeModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - com.loginradius.sdk.models.responsemodels.otherobjects.WebHookSubscribeModel successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to delete webhook subscription - // - // Unique ID of the webhook - // Response containing Definition of Delete Request - // 40.3 - - - public void deleteWebhookSubscription(String hookId, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(hookId)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("hookId")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apikey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apisecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "v2/manage/webhooks/" + hookId; - - LoginRadiusRequest.execute("DELETE", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - DeleteResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to update a webhook subscription - // - // Unique ID of the webhook - // Model Class containing Definition for WebHookSubscriptionUpdateModel Property - // Response containing Definition for Complete WebHook data - // 40.4 - - - public void updateWebhookSubscription(String hookId, WebHookSubscriptionUpdateModel webHookSubscriptionUpdateModel, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(hookId)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("hookId")); - } - - if (webHookSubscriptionUpdateModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("webHookSubscriptionUpdateModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apikey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apisecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "v2/manage/webhooks/" + hookId; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(webHookSubscriptionUpdateModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - com.loginradius.sdk.models.responsemodels.otherobjects.WebHookSubscribeModel successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to get the list of all the webhooks - // - // Response Containing List of Webhhook Data - // 40.5 - - - public void listAllWebhooks(final AsyncHandler> handler) { - - Map queryParameters = new HashMap(); - queryParameters.put("apikey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apisecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "v2/manage/webhooks"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - ListReturn successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to retrieve all the webhook events. - // - // Model Class containing Definition for WebHookEventModel Property - // 40.6 - - - public void getWebhookEvents(final AsyncHandler handler) { - - Map queryParameters = new HashMap(); - queryParameters.put("apikey", LoginRadiusSDK.getApiKey()); - queryParameters.put("apisecret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "v2/manage/webhooks/events"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - WebHookEventModel successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/authentication/AuthenticationApi.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/authentication/AuthenticationApi.java deleted file mode 100644 index 0bf1d65..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/authentication/AuthenticationApi.java +++ /dev/null @@ -1,1943 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. -*/ - -package com.loginradius.sdk.api.authentication; - -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.JsonObject; -import com.google.gson.reflect.TypeToken; -import com.loginradius.sdk.helper.JsonDeserializer; -import com.loginradius.sdk.helper.LoginRadiusRequest; -import com.loginradius.sdk.helper.LoginRadiusValidator; -import com.loginradius.sdk.models.requestmodels.AuthUserRegistrationModel; -import com.loginradius.sdk.models.requestmodels.AuthUserRegistrationModelWithCaptcha; -import com.loginradius.sdk.models.requestmodels.EmailAuthenticationModel; -import com.loginradius.sdk.models.requestmodels.EmailVerificationByOtpModel; -import com.loginradius.sdk.models.requestmodels.ResetPasswordByEmailAndOtpModel; -import com.loginradius.sdk.models.requestmodels.ResetPasswordByResetTokenModel; -import com.loginradius.sdk.models.requestmodels.ResetPasswordBySecurityAnswerAndEmailModel; -import com.loginradius.sdk.models.requestmodels.ResetPasswordBySecurityAnswerAndPhoneModel; -import com.loginradius.sdk.models.requestmodels.ResetPasswordBySecurityAnswerAndUserNameModel; -import com.loginradius.sdk.models.requestmodels.ResetPasswordByUserNameModel; -import com.loginradius.sdk.models.requestmodels.UnlockProfileModel; -import com.loginradius.sdk.models.requestmodels.UserNameAuthenticationModel; -import com.loginradius.sdk.models.requestmodels.UserProfileUpdateModel; -import com.loginradius.sdk.models.responsemodels.AccessToken; -import com.loginradius.sdk.models.responsemodels.AccessTokenBase; -import com.loginradius.sdk.models.responsemodels.SecurityQuestions; -import com.loginradius.sdk.models.responsemodels.configobjects.EmailVerificationData; -import com.loginradius.sdk.models.responsemodels.otherobjects.DeleteRequestAcceptResponse; -import com.loginradius.sdk.models.responsemodels.otherobjects.DeleteResponse; -import com.loginradius.sdk.models.responsemodels.otherobjects.ExistResponse; -import com.loginradius.sdk.models.responsemodels.otherobjects.PostResponse; -import com.loginradius.sdk.models.responsemodels.otherobjects.PostResponseResendEmailVerification; -import com.loginradius.sdk.models.responsemodels.otherobjects.PrivacyPolicyHistoryResponse; -import com.loginradius.sdk.models.responsemodels.otherobjects.TokenInfoResponseModel; -import com.loginradius.sdk.models.responsemodels.otherobjects.UserProfilePostResponse; -import com.loginradius.sdk.models.responsemodels.userprofile.Identity; -import com.loginradius.sdk.util.AsyncHandler; -import com.loginradius.sdk.util.ErrorResponse; -import com.loginradius.sdk.util.LoginRadiusSDK; - - -public class AuthenticationApi { - private static Gson gson =new Gson(); - - public AuthenticationApi(){ - if (!LoginRadiusSDK.validate()){ - throw new LoginRadiusSDK.InitializeException(); - } - } - - - // - // This API is used to update the user's profile by passing the access_token. - // - // Uniquely generated identifier key by LoginRadius - // that is activated after successful authentication. - // Json data for update profile - // Email template name - // The fields parameter filters the API response so that - // the response only includes a specific set of fields - // Boolean, pass true if you wish to update any user - // profile field with a NULL value. - // SMS Template name - // Email verification url - // Response containing Definition for Complete profile data - // 5.4 - - public void updateProfileByAccessToken(String accessToken, JsonObject payload, - String emailTemplate, String fields, Boolean nullSupport, String smsTemplate, String verificationUrl, - final AsyncHandler> handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (payload == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("payload")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate)) { - queryParameters.put("emailTemplate", emailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - if (nullSupport != null && nullSupport) { - queryParameters.put("nullSupport", String.valueOf(nullSupport)); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate)) { - queryParameters.put("smsTemplate", smsTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(verificationUrl)) { - queryParameters.put("verificationUrl", verificationUrl); - } - - String resourcePath = "identity/v2/auth/account"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(payload), - new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() { - }; - UserProfilePostResponse successResponse = JsonDeserializer.deserializeJson(response, - typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - - // - // This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. - // - // Email of the user - // Response containing Definition for Complete SecurityQuestions data - // 2.1 - - - public void getSecurityQuestionsByEmail(String email, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(email)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("email")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("email", email); - - String resourcePath = "identity/v2/auth/securityquestion/email"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - SecurityQuestions[] successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. - // - // UserName of the user - // Response containing Definition for Complete SecurityQuestions data - // 2.2 - - - public void getSecurityQuestionsByUserName(String userName, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(userName)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("userName")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("userName", userName); - - String resourcePath = "identity/v2/auth/securityquestion/username"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - SecurityQuestions[] successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. - // - // The Registered Phone Number - // Response containing Definition for Complete SecurityQuestions data - // 2.3 - - - public void getSecurityQuestionsByPhone(String phone, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(phone)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("phone")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("phone", phone); - - String resourcePath = "identity/v2/auth/securityquestion/phone"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - SecurityQuestions[] successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Response containing Definition for Complete SecurityQuestions data - // 2.4 - - - public void getSecurityQuestionsByAccessToken(String accessToken, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/securityquestion/accesstoken"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - SecurityQuestions[] successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This api validates access token, if valid then returns a response with its expiry otherwise error. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Response containing Definition of Complete Token data - // 4.1 - - - public void authValidateAccessToken(String accessToken, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/access_token/validate"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - AccessTokenBase successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This api call invalidates the active access token or expires an access token's validity. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Boolean value that when set as true, in addition of the access token being invalidated, it will no longer have the capability of being refreshed. - // Response containing Definition of Complete Validation data - // 4.2 - - - public void authInValidateAccessToken(String accessToken, Boolean preventRefresh, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (preventRefresh != null && preventRefresh) { - queryParameters.put("preventRefresh", String.valueOf(preventRefresh)); - } - - String resourcePath = "identity/v2/auth/access_token/invalidate"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This api call provide the active access token Information - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Response containing Definition of Token Information - // 4.3 - - - public void getAccessTokenInfo(String accessToken, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/access_token"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - TokenInfoResponseModel successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API retrieves a copy of the user data based on the access token. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // The fields parameter filters the API response so that the response only includes a specific set of fields - // - // - // - // Response containing Definition for Complete profile data - // 5.2 - - - public void getProfileByAccessToken(String accessToken, String fields, String emailTemplate,String verificationUrl, String welcomeEmailTemplate, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate)) { - queryParameters.put("emailTemplate", emailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(verificationUrl)) { - queryParameters.put("verificationUrl", verificationUrl); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(welcomeEmailTemplate)) { - queryParameters.put("welcomeEmailTemplate", welcomeEmailTemplate); - } - - String resourcePath = "identity/v2/auth/account"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - Identity successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API sends a welcome email - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Name of the welcome email template - // Response containing Definition of Complete Validation data - // 5.3 - - - public void sendWelcomeEmail(String accessToken, String welcomeEmailTemplate, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(welcomeEmailTemplate)) { - queryParameters.put("welcomeEmailTemplate", welcomeEmailTemplate); - } - - String resourcePath = "identity/v2/auth/account/sendwelcomeemail"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to update the user's profile by passing the access token. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Model Class containing Definition of payload for User Profile update API - // Email template name - // The fields parameter filters the API response so that the response only includes a specific set of fields - // SMS Template name - // Email verification url - // Boolean, pass true if you wish to trigger voice OTP - // PreventVerificationEmail (Specifying this value prevents the verification email from being sent. Only applicable if you have the optional email verification flow) - // Response containing Definition of Complete Validation and UserProfile data - // 5.4 - - - public void updateProfileByAccessToken(String accessToken, UserProfileUpdateModel userProfileUpdateModel, - String emailTemplate, String fields, String smsTemplate, String verificationUrl, Boolean isVoiceOtp, String options, final AsyncHandler> handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (userProfileUpdateModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("userProfileUpdateModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate)) { - queryParameters.put("emailTemplate", emailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate)) { - queryParameters.put("smsTemplate", smsTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(verificationUrl)) { - queryParameters.put("verificationUrl", verificationUrl); - } - - if (isVoiceOtp != null && isVoiceOtp) { - queryParameters.put("isVoiceOtp", String.valueOf(isVoiceOtp)); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(options)) { - queryParameters.put("options", options); - } - - String resourcePath = "identity/v2/auth/account"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(userProfileUpdateModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - UserProfilePostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API will send a confirmation email for account deletion to the customer's email when passed the customer's access token - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Url of the site - // Email template name - // Response containing Definition of Delete Request - // 5.5 - - - public void deleteAccountWithEmailConfirmation(String accessToken, String deleteUrl, - String emailTemplate, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(deleteUrl)) { - queryParameters.put("deleteUrl", deleteUrl); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate)) { - queryParameters.put("emailTemplate", emailTemplate); - } - - String resourcePath = "identity/v2/auth/account"; - - LoginRadiusRequest.execute("DELETE", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - DeleteRequestAcceptResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to delete an account by passing it a delete token. - // - // Delete token received in the email - // Response containing Definition of Complete Validation data - // 5.6 - - - public void deleteAccountByDeleteToken(String deletetoken, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(deletetoken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("deletetoken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("deletetoken", deletetoken); - - String resourcePath = "identity/v2/auth/account/delete"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to allow a customer with a valid access token to unlock their account provided that they successfully pass the prompted Bot Protection challenges. The Block or Suspend block types are not applicable for this API. For additional details see our Auth Security Configuration documentation.You are only required to pass the Post Parameters that correspond to the prompted challenges. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Payload containing Unlock Profile API - // Response containing Definition of Complete Validation data - // 5.15 - - - public void unlockAccountByToken(String accessToken, UnlockProfileModel unlockProfileModel, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (unlockProfileModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("unlockProfileModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/account/unlock"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(unlockProfileModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to get a user's profile using the clientGuid parameter if no callback feature enabled - // - // ClientGuid - // EmailTemplate - // Fields - // VerificationUrl - // WelcomeEmailTemplate - // Response containing User Profile Data and access token - // 5.16 - - - public void getProfileByPing(String clientGuid, String emailTemplate, - String fields, String verificationUrl, String welcomeEmailTemplate, final AsyncHandler> handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(clientGuid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("clientGuid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("clientGuid", clientGuid); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate)) { - queryParameters.put("emailTemplate", emailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(verificationUrl)) { - queryParameters.put("verificationUrl", verificationUrl); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(welcomeEmailTemplate)) { - queryParameters.put("welcomeEmailTemplate", welcomeEmailTemplate); - } - - String resourcePath = "identity/v2/auth/account/ping"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - AccessToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to check the email exists or not on your site. - // - // Email of the user - // Response containing Definition Complete ExistResponse data - // 8.1 - - - public void checkEmailAvailability(String email, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(email)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("email")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("email", email); - - String resourcePath = "identity/v2/auth/email"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - ExistResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to verify the email of user. Note: This API will only return the full profile if you have 'Enable auto login after email verification' set in your LoginRadius Admin Console's Email Workflow settings under 'Verification Email'. - // - // Verification token received in the email - // The fields parameter filters the API response so that the response only includes a specific set of fields - // Mention URL to log the main URL(Domain name) in Database. - // Name of the welcome email template - // The uuid received in the response - // Response containing Definition of Complete Validation, UserProfile data and Access Token - // 8.2 - - - public void verifyEmail(String verificationToken, String fields, - String url, String welcomeEmailTemplate, String uuid, final AsyncHandler>> handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(verificationToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("verificationToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("verificationToken", verificationToken); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(url)) { - queryParameters.put("url", url); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(welcomeEmailTemplate)) { - queryParameters.put("welcomeEmailTemplate", welcomeEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(uuid)) { - queryParameters.put("uuid", uuid); - } - - String resourcePath = "identity/v2/auth/email"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken>> typeToken = new TypeToken>>() {}; - UserProfilePostResponse> successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to verify the email of user when the OTP Email verification flow is enabled, please note that you must contact LoginRadius to have this feature enabled. - // - // Model Class containing Definition for EmailVerificationByOtpModel API - // The fields parameter filters the API response so that the response only includes a specific set of fields - // Mention URL to log the main URL(Domain name) in Database. - // Name of the welcome email template - // Response containing Definition of Complete Validation, UserProfile data and Access Token - // 8.3 - - - public void verifyEmailByOTP(EmailVerificationByOtpModel emailVerificationByOtpModel, String fields, - String url, String welcomeEmailTemplate, final AsyncHandler>> handler) { - - if (emailVerificationByOtpModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("emailVerificationByOtpModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(url)) { - queryParameters.put("url", url); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(welcomeEmailTemplate)) { - queryParameters.put("welcomeEmailTemplate", welcomeEmailTemplate); - } - - String resourcePath = "identity/v2/auth/email"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(emailVerificationByOtpModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken>> typeToken = new TypeToken>>() {}; - UserProfilePostResponse> successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to add additional emails to a user's account. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // user's email - // String to identify the type of parameter - // Email template name - // Email verification url - // Response containing Definition of Complete Validation data - // 8.5 - - - public void addEmail(String accessToken, String email, - String type, String emailTemplate, String verificationUrl, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(email)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("email")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(type)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("type")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate)) { - queryParameters.put("emailTemplate", emailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(verificationUrl)) { - queryParameters.put("verificationUrl", verificationUrl); - } - - JsonObject bodyParameters = new JsonObject(); - bodyParameters.addProperty("email", email); - bodyParameters.addProperty("type", type); - - String resourcePath = "identity/v2/auth/email"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(bodyParameters), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to remove additional emails from a user's account. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // user's email - // Response containing Definition of Delete Request - // 8.6 - - - public void removeEmail(String accessToken, String email, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(email)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("email")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - JsonObject bodyParameters = new JsonObject(); - bodyParameters.addProperty("email", email); - - String resourcePath = "identity/v2/auth/email"; - - LoginRadiusRequest.execute("DELETE", resourcePath, queryParameters, gson.toJson(bodyParameters), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - DeleteResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API retrieves a copy of the user data based on the Email - // - // Model Class containing Definition of payload for Email Authentication API - // Email template name - // The fields parameter filters the API response so that the response only includes a specific set of fields - // Url where the user is logging from - // Email verification url - // Response containing User Profile Data and access token - // 9.2.1 - - - public void loginByEmail(EmailAuthenticationModel emailAuthenticationModel, String emailTemplate, - String fields, String loginUrl, String verificationUrl, final AsyncHandler> handler) { - - if (emailAuthenticationModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("emailAuthenticationModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate)) { - queryParameters.put("emailTemplate", emailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(loginUrl)) { - queryParameters.put("loginUrl", loginUrl); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(verificationUrl)) { - queryParameters.put("verificationUrl", verificationUrl); - } - - String resourcePath = "identity/v2/auth/login"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(emailAuthenticationModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - AccessToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API retrieves a copy of the user data based on the Username - // - // Model Class containing Definition of payload for Username Authentication API - // Email template name - // The fields parameter filters the API response so that the response only includes a specific set of fields - // Url where the user is logging from - // Email verification url - // Response containing User Profile Data and access token - // 9.2.2 - - - public void loginByUserName(UserNameAuthenticationModel userNameAuthenticationModel, String emailTemplate, - String fields, String loginUrl, String verificationUrl, final AsyncHandler> handler) { - - if (userNameAuthenticationModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("userNameAuthenticationModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate)) { - queryParameters.put("emailTemplate", emailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(loginUrl)) { - queryParameters.put("loginUrl", loginUrl); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(verificationUrl)) { - queryParameters.put("verificationUrl", verificationUrl); - } - - String resourcePath = "identity/v2/auth/login"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(userNameAuthenticationModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - AccessToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to send the reset password url to a specified account. Note: If you have the UserName workflow enabled, you may replace the 'email' parameter with 'username' - // - // user's email - // Url to which user should get re-directed to for resetting the password - // Email template name - // Response containing Definition of Complete Validation data - // 10.1 - - - public void forgotPassword(String email, String resetPasswordUrl, - String emailTemplate, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(email)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("email")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(resetPasswordUrl)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("resetPasswordUrl")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("resetPasswordUrl", resetPasswordUrl); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate)) { - queryParameters.put("emailTemplate", emailTemplate); - } - - JsonObject bodyParameters = new JsonObject(); - bodyParameters.addProperty("email", email); - - String resourcePath = "identity/v2/auth/password"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(bodyParameters), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to reset password for the specified account by security question - // - // Model Class containing Definition of payload for ResetPasswordBySecurityAnswerAndEmail API - // Response containing Definition of Validation data and access token - // 10.3.1 - - - public void resetPasswordBySecurityAnswerAndEmail(ResetPasswordBySecurityAnswerAndEmailModel resetPasswordBySecurityAnswerAndEmailModel, final AsyncHandler> handler) { - - if (resetPasswordBySecurityAnswerAndEmailModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("resetPasswordBySecurityAnswerAndEmailModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/password/securityanswer"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(resetPasswordBySecurityAnswerAndEmailModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - UserProfilePostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to reset password for the specified account by security question - // - // Model Class containing Definition of payload for ResetPasswordBySecurityAnswerAndPhone API - // Response containing Definition of Validation data and access token - // 10.3.2 - - - public void resetPasswordBySecurityAnswerAndPhone(ResetPasswordBySecurityAnswerAndPhoneModel resetPasswordBySecurityAnswerAndPhoneModel, final AsyncHandler> handler) { - - if (resetPasswordBySecurityAnswerAndPhoneModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("resetPasswordBySecurityAnswerAndPhoneModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/password/securityanswer"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(resetPasswordBySecurityAnswerAndPhoneModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - UserProfilePostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to reset password for the specified account by security question - // - // Model Class containing Definition of payload for ResetPasswordBySecurityAnswerAndUserName API - // Response containing Definition of Validation data and access token - // 10.3.3 - - - public void resetPasswordBySecurityAnswerAndUserName(ResetPasswordBySecurityAnswerAndUserNameModel resetPasswordBySecurityAnswerAndUserNameModel, final AsyncHandler> handler) { - - if (resetPasswordBySecurityAnswerAndUserNameModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("resetPasswordBySecurityAnswerAndUserNameModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/password/securityanswer"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(resetPasswordBySecurityAnswerAndUserNameModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - UserProfilePostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to set a new password for the specified account. - // - // Model Class containing Definition of payload for ResetToken API - // Response containing Definition of Validation data and access token - // 10.7.1 - - - public void resetPasswordByResetToken(ResetPasswordByResetTokenModel resetPasswordByResetTokenModel, final AsyncHandler> handler) { - - if (resetPasswordByResetTokenModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("resetPasswordByResetTokenModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/password/reset"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(resetPasswordByResetTokenModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - UserProfilePostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to set a new password for the specified account. - // - // Model Class containing Definition of payload for ResetPasswordByEmailAndOtp API - // Response containing Definition of Validation data and access token - // 10.7.2 - - - public void resetPasswordByEmailOTP(ResetPasswordByEmailAndOtpModel resetPasswordByEmailAndOtpModel, final AsyncHandler> handler) { - - if (resetPasswordByEmailAndOtpModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("resetPasswordByEmailAndOtpModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/password/reset"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(resetPasswordByEmailAndOtpModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - UserProfilePostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to set a new password for the specified account if you are using the username as the unique identifier in your workflow - // - // Model Class containing Definition of payload for ResetPasswordByUserName API - // Response containing Definition of Validation data and access token - // 10.7.3 - - - public void resetPasswordByOTPAndUserName(ResetPasswordByUserNameModel resetPasswordByUserNameModel, final AsyncHandler> handler) { - - if (resetPasswordByUserNameModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("resetPasswordByUserNameModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/password/reset"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(resetPasswordByUserNameModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - UserProfilePostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to change the accounts password based on the previous password - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // New password - // User's current password - // Response containing Definition of Complete Validation data - // 10.8 - - - public void changePassword(String accessToken, String newPassword, - String oldPassword, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(newPassword)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("newPassword")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(oldPassword)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("oldPassword")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - JsonObject bodyParameters = new JsonObject(); - bodyParameters.addProperty("newPassword", newPassword); - bodyParameters.addProperty("oldPassword", oldPassword); - - String resourcePath = "identity/v2/auth/password/change"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(bodyParameters), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to unlink up a social provider account with the specified account based on the access token and the social providers user access token. The unlinked account will automatically get removed from your database. - // - // Access_Token - // Name of the provider - // Unique ID of the linked account - // Response containing Definition of Delete Request - // 12.2 - - - public void unlinkSocialIdentities(String accessToken, String provider, - String providerId, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(provider)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("provider")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(providerId)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("providerId")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - JsonObject bodyParameters = new JsonObject(); - bodyParameters.addProperty("provider", provider); - bodyParameters.addProperty("providerId", providerId); - - String resourcePath = "identity/v2/auth/socialidentity"; - - LoginRadiusRequest.execute("DELETE", resourcePath, queryParameters, gson.toJson(bodyParameters), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - DeleteResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to link up a social provider account with an existing LoginRadius account on the basis of access token and the social providers user access token. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Access token of the account to be linked - // Response containing Definition of Complete Validation data - // 12.4 - - - public void linkSocialIdentities(String accessToken, String candidateToken, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(candidateToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("candidateToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - JsonObject bodyParameters = new JsonObject(); - bodyParameters.addProperty("candidateToken", candidateToken); - - String resourcePath = "identity/v2/auth/socialidentity"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(bodyParameters), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to link up a social provider account with an existing LoginRadius account on the basis of ping and the social providers user access token. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Unique ID generated by client - // Response containing Definition of Complete Validation data - // 12.5 - - - public void linkSocialIdentitiesByPing(String accessToken, String clientGuid, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(clientGuid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("clientGuid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - JsonObject bodyParameters = new JsonObject(); - bodyParameters.addProperty("clientGuid", clientGuid); - - String resourcePath = "identity/v2/auth/socialidentity"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(bodyParameters), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to set or change UserName by access token. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Username of the user - // Response containing Definition of Complete Validation data - // 13.1 - - - public void setOrChangeUserName(String accessToken, String username, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(username)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("username")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - JsonObject bodyParameters = new JsonObject(); - bodyParameters.addProperty("username", username); - - String resourcePath = "identity/v2/auth/username"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(bodyParameters), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to check the UserName exists or not on your site. - // - // UserName of the user - // Response containing Definition Complete ExistResponse data - // 13.2 - - - public void checkUserNameAvailability(String username, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(username)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("username")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("username", username); - - String resourcePath = "identity/v2/auth/username"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - ExistResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to update the privacy policy stored in the user's profile by providing the access token of the user accepting the privacy policy - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // The fields parameter filters the API response so that the response only includes a specific set of fields - // Response containing Definition for Complete profile data - // 15.1 - - - public void acceptPrivacyPolicy(String accessToken, String fields, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - String resourcePath = "identity/v2/auth/privacypolicy/accept"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - Identity successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API will return all the accepted privacy policies for the user by providing the access token of that user. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Complete Policy History data - // 15.2 - - - public void getPrivacyPolicyHistoryByAccessToken(String accessToken, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/privacypolicy/history"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PrivacyPolicyHistoryResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API creates a user in the database as well as sends a verification email to the user. - // - // Model Class containing Definition of payload for Auth User Registration API - // LoginRadius Secured One Time Token - // Email template name - // The fields parameter filters the API response so that the response only includes a specific set of fields - // PreventVerificationEmail (Specifying this value prevents the verification email from being sent. Only applicable if you have the optional email verification flow) - // Email verification url - // Name of the welcome email template - // Boolean, pass true if you wish to trigger voice OTP - // Response containing Definition of Complete Validation, UserProfile data and Access Token - // 17.1.1 - - - public void userRegistrationByEmail(AuthUserRegistrationModel authUserRegistrationModel, String sott, - String emailTemplate, String fields, String options, String verificationUrl, String welcomeEmailTemplate, - Boolean isVoiceOtp, final AsyncHandler>> handler) { - - if (authUserRegistrationModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("authUserRegistrationModel")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(sott)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("sott")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("sott", sott); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate)) { - queryParameters.put("emailTemplate", emailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(options)) { - queryParameters.put("options", options); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(verificationUrl)) { - queryParameters.put("verificationUrl", verificationUrl); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(welcomeEmailTemplate)) { - queryParameters.put("welcomeEmailTemplate", welcomeEmailTemplate); - } - - if (isVoiceOtp != null && isVoiceOtp) { - queryParameters.put("isVoiceOtp", String.valueOf(isVoiceOtp)); - } - - String resourcePath = "identity/v2/auth/register"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(authUserRegistrationModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken>> typeToken = new TypeToken>>() {}; - UserProfilePostResponse> successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API creates a user in the database as well as sends a verification email to the user. - // - // Model Class containing Definition of payload for Auth User Registration by Recaptcha API - // Email template name - // The fields parameter filters the API response so that the response only includes a specific set of fields - // PreventVerificationEmail (Specifying this value prevents the verification email from being sent. Only applicable if you have the optional email verification flow) - // SMS Template name - // Email verification url - // Name of the welcome email template - // Boolean, pass true if you wish to trigger voice OTP - // Response containing Definition of Complete Validation, UserProfile data and Access Token - // 17.2 - - - public void userRegistrationByCaptcha(AuthUserRegistrationModelWithCaptcha authUserRegistrationModelWithCaptcha, String emailTemplate, - String fields, String options, String smsTemplate, String verificationUrl, String welcomeEmailTemplate, - Boolean isVoiceOtp, final AsyncHandler>> handler) { - - if (authUserRegistrationModelWithCaptcha == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("authUserRegistrationModelWithCaptcha")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate)) { - queryParameters.put("emailTemplate", emailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(options)) { - queryParameters.put("options", options); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate)) { - queryParameters.put("smsTemplate", smsTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(verificationUrl)) { - queryParameters.put("verificationUrl", verificationUrl); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(welcomeEmailTemplate)) { - queryParameters.put("welcomeEmailTemplate", welcomeEmailTemplate); - } - - if (isVoiceOtp != null && isVoiceOtp) { - queryParameters.put("isVoiceOtp", String.valueOf(isVoiceOtp)); - } - - String resourcePath = "identity/v2/auth/register/captcha"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(authUserRegistrationModelWithCaptcha), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken>> typeToken = new TypeToken>>() {}; - UserProfilePostResponse> successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API resends the verification email to the user. - // - // user's email - // Email template name - // Email verification url - // Response containing Definition of Complete Validation data - // 17.3 - - - public void authResendEmailVerification(String email, String emailTemplate, - String verificationUrl, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(email)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("email")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate)) { - queryParameters.put("emailTemplate", emailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(verificationUrl)) { - queryParameters.put("verificationUrl", verificationUrl); - } - - JsonObject bodyParameters = new JsonObject(); - bodyParameters.addProperty("email", email); - - String resourcePath = "identity/v2/auth/register"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(bodyParameters), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to Send verification email to the unverified email of the social profile. This API can be used only incase of optional verification workflow. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Unique string used in the Smart Login request - // Response containing Definition for Complete AuthSendVerificationEmailForLinkingSocialProfiles API Response - // 44.9 - - - public void authSendVerificationEmailForLinkingSocialProfiles(String accessToken, String clientguid, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(clientguid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("clientguid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("clientguid", clientguid); - - String resourcePath = "identity/v2/auth/email/sendverificationemail"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponseResendEmailVerification successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/authentication/OneTouchLoginApi.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/authentication/OneTouchLoginApi.java deleted file mode 100644 index 5d1c2b3..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/authentication/OneTouchLoginApi.java +++ /dev/null @@ -1,274 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. -*/ - -package com.loginradius.sdk.api.authentication; - -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.JsonObject; -import com.google.gson.reflect.TypeToken; -import com.loginradius.sdk.helper.JsonDeserializer; -import com.loginradius.sdk.helper.LoginRadiusRequest; -import com.loginradius.sdk.helper.LoginRadiusValidator; -import com.loginradius.sdk.models.requestmodels.OneTouchLoginByEmailModel; -import com.loginradius.sdk.models.requestmodels.OneTouchLoginByPhoneModel; -import com.loginradius.sdk.models.responsemodels.AccessToken; -import com.loginradius.sdk.models.responsemodels.otherobjects.PostResponse; -import com.loginradius.sdk.models.responsemodels.otherobjects.VerifiedResponse; -import com.loginradius.sdk.models.responsemodels.userprofile.Identity; -import com.loginradius.sdk.models.responsemodels.userprofile.UserProfile; -import com.loginradius.sdk.util.AsyncHandler; -import com.loginradius.sdk.util.ErrorResponse; -import com.loginradius.sdk.util.LoginRadiusSDK; - - -public class OneTouchLoginApi { - private static Gson gson =new Gson(); - - public OneTouchLoginApi(){ - if (!LoginRadiusSDK.validate()){ - throw new LoginRadiusSDK.InitializeException(); - } - } - - - - // - // This API is used to send a link to a specified email for a frictionless login/registration - // - // Model Class containing Definition of payload for OneTouchLogin By EmailModel API - // Name of the One Touch Login Email Template - // Url where the user will redirect after success authentication - // Name of the welcome email template - // Response containing Definition of Complete Validation data - // 1.2 - - - public void oneTouchLoginByEmail(OneTouchLoginByEmailModel oneTouchLoginByEmailModel, String oneTouchLoginEmailTemplate, - String redirecturl, String welcomeemailtemplate, final AsyncHandler handler) { - - if (oneTouchLoginByEmailModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("oneTouchLoginByEmailModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(oneTouchLoginEmailTemplate)) { - queryParameters.put("oneTouchLoginEmailTemplate", oneTouchLoginEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(redirecturl)) { - queryParameters.put("redirecturl", redirecturl); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(welcomeemailtemplate)) { - queryParameters.put("welcomeemailtemplate", welcomeemailtemplate); - } - - String resourcePath = "identity/v2/auth/onetouchlogin/email"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(oneTouchLoginByEmailModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to send one time password to a given phone number for a frictionless login/registration. - // - // Model Class containing Definition of payload for OneTouchLogin By PhoneModel API - // SMS Template name - // Boolean, pass true if you wish to trigger voice OTP - // Response containing Definition of Complete Validation data - // 1.4 - - - public void oneTouchLoginByPhone(OneTouchLoginByPhoneModel oneTouchLoginByPhoneModel, String smsTemplate, - Boolean isVoiceOtp, final AsyncHandler handler) { - - if (oneTouchLoginByPhoneModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("oneTouchLoginByPhoneModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate)) { - queryParameters.put("smsTemplate", smsTemplate); - } - - if (isVoiceOtp != null && isVoiceOtp) { - queryParameters.put("isVoiceOtp", String.valueOf(isVoiceOtp)); - } - - String resourcePath = "identity/v2/auth/onetouchlogin/phone"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(oneTouchLoginByPhoneModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to verify the otp for One Touch Login. - // - // The Verification Code - // New Phone Number - // The fields parameter filters the API response so that the response only includes a specific set of fields - // SMS Template name - // Response Containing Access Token and Complete Profile Data - // 1.5 - - - public void oneTouchLoginOTPVerification(String otp, String phone, - String fields, String smsTemplate, final AsyncHandler> handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(otp)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("otp")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(phone)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("phone")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("otp", otp); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate)) { - queryParameters.put("smsTemplate", smsTemplate); - } - - JsonObject bodyParameters = new JsonObject(); - bodyParameters.addProperty("phone", phone); - - String resourcePath = "identity/v2/auth/onetouchlogin/phone/verify"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(bodyParameters), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - AccessToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API verifies the provided token for One Touch Login - // - // Verification token received in the email - // Name of the welcome email template - // Complete verified response data - // 8.4.2 - - - public void oneTouchEmailVerification(String verificationToken, String welcomeEmailTemplate, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(verificationToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("verificationToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("verificationToken", verificationToken); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(welcomeEmailTemplate)) { - queryParameters.put("welcomeEmailTemplate", welcomeEmailTemplate); - } - - String resourcePath = "identity/v2/auth/email/onetouchlogin"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - VerifiedResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to check if the One Touch Login link has been clicked or not. - // - // Unique string used in the Smart Login request - // The fields parameter filters the API response so that the response only includes a specific set of fields - // Response containing User Profile Data and access token - // 9.21.2 - - - public void oneTouchLoginPing(String clientGuid, String fields, final AsyncHandler> handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(clientGuid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("clientGuid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("clientGuid", clientGuid); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - String resourcePath = "identity/v2/auth/login/smartlogin/ping"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - AccessToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/authentication/PINAuthenticationApi.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/authentication/PINAuthenticationApi.java deleted file mode 100644 index 2e3a062..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/authentication/PINAuthenticationApi.java +++ /dev/null @@ -1,592 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. -*/ - -package com.loginradius.sdk.api.authentication; - -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; -import com.loginradius.sdk.helper.JsonDeserializer; -import com.loginradius.sdk.helper.LoginRadiusRequest; -import com.loginradius.sdk.helper.LoginRadiusValidator; -import com.loginradius.sdk.models.requestmodels.ChangePINModel; -import com.loginradius.sdk.models.requestmodels.ForgotPINLinkByEmailModel; -import com.loginradius.sdk.models.requestmodels.ForgotPINLinkByUserNameModel; -import com.loginradius.sdk.models.requestmodels.ForgotPINOtpByPhoneModel; -import com.loginradius.sdk.models.requestmodels.LoginByPINModel; -import com.loginradius.sdk.models.requestmodels.PINRequiredModel; -import com.loginradius.sdk.models.requestmodels.ResetPINByEmailAndOtpModel; -import com.loginradius.sdk.models.requestmodels.ResetPINByPhoneAndOTPModel; -import com.loginradius.sdk.models.requestmodels.ResetPINByResetToken; -import com.loginradius.sdk.models.requestmodels.ResetPINBySecurityQuestionAnswerAndEmailModel; -import com.loginradius.sdk.models.requestmodels.ResetPINBySecurityQuestionAnswerAndPhoneModel; -import com.loginradius.sdk.models.requestmodels.ResetPINBySecurityQuestionAnswerAndUsernameModel; -import com.loginradius.sdk.models.requestmodels.ResetPINByUsernameAndOtpModel; -import com.loginradius.sdk.models.responsemodels.AccessToken; -import com.loginradius.sdk.models.responsemodels.SmsResponseData; -import com.loginradius.sdk.models.responsemodels.otherobjects.PostResponse; -import com.loginradius.sdk.models.responsemodels.otherobjects.UserProfilePostResponse; -import com.loginradius.sdk.models.responsemodels.userprofile.Identity; -import com.loginradius.sdk.util.AsyncHandler; -import com.loginradius.sdk.util.ErrorResponse; -import com.loginradius.sdk.util.LoginRadiusSDK; - - -public class PINAuthenticationApi { - private static Gson gson =new Gson(); - - public PINAuthenticationApi(){ - if (!LoginRadiusSDK.validate()){ - throw new LoginRadiusSDK.InitializeException(); - } - } - - - - // - // This API is used to login a user by pin and session token. - // - // Model Class containing Definition of payload for LoginByPin API - // Session Token of user - // Response containing User Profile Data and access token - // 9.22 - - - public void pinLogin(LoginByPINModel loginByPINModel, String sessionToken, final AsyncHandler> handler) { - - if (loginByPINModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("loginByPINModel")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(sessionToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("sessionToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("session_token", sessionToken); - - String resourcePath = "identity/v2/auth/login/pin"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(loginByPINModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - AccessToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API sends the reset pin email to specified email address. - // - // Model Class containing Definition for Forgot Pin Link By Email API - // Email template name - // Reset PIN Url - // Response containing Definition of Complete Validation data - // 42.1 - - - public void sendForgotPINEmailByEmail(ForgotPINLinkByEmailModel forgotPINLinkByEmailModel, String emailTemplate, - String resetPINUrl, final AsyncHandler handler) { - - if (forgotPINLinkByEmailModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("forgotPINLinkByEmailModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate)) { - queryParameters.put("emailTemplate", emailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(resetPINUrl)) { - queryParameters.put("resetPINUrl", resetPINUrl); - } - - String resourcePath = "identity/v2/auth/pin/forgot/email"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(forgotPINLinkByEmailModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API sends the reset pin email using username. - // - // Model Class containing Definition for Forgot Pin Link By UserName API - // Email template name - // Reset PIN Url - // Response containing Definition of Complete Validation data - // 42.2 - - - public void sendForgotPINEmailByUsername(ForgotPINLinkByUserNameModel forgotPINLinkByUserNameModel, String emailTemplate, - String resetPINUrl, final AsyncHandler handler) { - - if (forgotPINLinkByUserNameModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("forgotPINLinkByUserNameModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate)) { - queryParameters.put("emailTemplate", emailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(resetPINUrl)) { - queryParameters.put("resetPINUrl", resetPINUrl); - } - - String resourcePath = "identity/v2/auth/pin/forgot/username"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(forgotPINLinkByUserNameModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to reset pin using reset token. - // - // Model Class containing Definition of payload for Reset Pin By Reset Token API - // Response containing Definition of Complete Validation data - // 42.3 - - - public void resetPINByResetToken(ResetPINByResetToken resetPINByResetToken, final AsyncHandler handler) { - - if (resetPINByResetToken == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("resetPINByResetToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/pin/reset/token"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(resetPINByResetToken), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to reset pin using security question answer and email. - // - // Model Class containing Definition of payload for Reset Pin By Security Question and Email API - // Response containing Definition of Complete Validation data - // 42.4 - - - public void resetPINByEmailAndSecurityAnswer(ResetPINBySecurityQuestionAnswerAndEmailModel resetPINBySecurityQuestionAnswerAndEmailModel, final AsyncHandler handler) { - - if (resetPINBySecurityQuestionAnswerAndEmailModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("resetPINBySecurityQuestionAnswerAndEmailModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/pin/reset/securityanswer/email"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(resetPINBySecurityQuestionAnswerAndEmailModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to reset pin using security question answer and username. - // - // Model Class containing Definition of payload for Reset Pin By Security Question and UserName API - // Response containing Definition of Complete Validation data - // 42.5 - - - public void resetPINByUsernameAndSecurityAnswer(ResetPINBySecurityQuestionAnswerAndUsernameModel resetPINBySecurityQuestionAnswerAndUsernameModel, final AsyncHandler handler) { - - if (resetPINBySecurityQuestionAnswerAndUsernameModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("resetPINBySecurityQuestionAnswerAndUsernameModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/pin/reset/securityanswer/username"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(resetPINBySecurityQuestionAnswerAndUsernameModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to reset pin using security question answer and phone. - // - // Model Class containing Definition of payload for Reset Pin By Security Question and Phone API - // Response containing Definition of Complete Validation data - // 42.6 - - - public void resetPINByPhoneAndSecurityAnswer(ResetPINBySecurityQuestionAnswerAndPhoneModel resetPINBySecurityQuestionAnswerAndPhoneModel, final AsyncHandler handler) { - - if (resetPINBySecurityQuestionAnswerAndPhoneModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("resetPINBySecurityQuestionAnswerAndPhoneModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/pin/reset/securityanswer/phone"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(resetPINBySecurityQuestionAnswerAndPhoneModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API sends the OTP to specified phone number - // - // Model Class containing Definition for Forgot Pin Otp By Phone API - // - // Boolean, pass true if you wish to trigger voice OTP - // Response Containing Validation Data and SMS Data - // 42.7 - - - public void sendForgotPINSMSByPhone(ForgotPINOtpByPhoneModel forgotPINOtpByPhoneModel, String smsTemplate, - Boolean isVoiceOtp, final AsyncHandler> handler) { - - if (forgotPINOtpByPhoneModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("forgotPINOtpByPhoneModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate)) { - queryParameters.put("smsTemplate", smsTemplate); - } - - if (isVoiceOtp != null && isVoiceOtp) { - queryParameters.put("isVoiceOtp", String.valueOf(isVoiceOtp)); - } - - String resourcePath = "identity/v2/auth/pin/forgot/otp"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(forgotPINOtpByPhoneModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - UserProfilePostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to change a user's PIN using access token. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Model Class containing Definition for change PIN Property - // Response containing Definition of Complete Validation data - // 42.8 - - - public void changePINByAccessToken(String accessToken, ChangePINModel changePINModel, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (changePINModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("changePINModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/pin/change"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(changePINModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to reset pin using phoneId and OTP. - // - // Model Class containing Definition of payload for Reset Pin By Phone and Otp API - // Response containing Definition of Complete Validation data - // 42.9 - - - public void resetPINByPhoneAndOtp(ResetPINByPhoneAndOTPModel resetPINByPhoneAndOTPModel, final AsyncHandler handler) { - - if (resetPINByPhoneAndOTPModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("resetPINByPhoneAndOTPModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/pin/reset/otp/phone"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(resetPINByPhoneAndOTPModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to reset pin using email and OTP. - // - // Model Class containing Definition of payload for Reset Pin By Email and Otp API - // Response containing Definition of Complete Validation data - // 42.10 - - - public void resetPINByEmailAndOtp(ResetPINByEmailAndOtpModel resetPINByEmailAndOtpModel, final AsyncHandler handler) { - - if (resetPINByEmailAndOtpModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("resetPINByEmailAndOtpModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/pin/reset/otp/email"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(resetPINByEmailAndOtpModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to reset pin using username and OTP. - // - // Model Class containing Definition of payload for Reset Pin By Username and Otp API - // Response containing Definition of Complete Validation data - // 42.11 - - - public void resetPINByUsernameAndOtp(ResetPINByUsernameAndOtpModel resetPINByUsernameAndOtpModel, final AsyncHandler handler) { - - if (resetPINByUsernameAndOtpModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("resetPINByUsernameAndOtpModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/pin/reset/otp/username"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(resetPINByUsernameAndOtpModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to change a user's PIN using Pin Auth token. - // - // Model Class containing Definition for PIN - // Pin Auth Token - // Response containing User Profile Data and access token - // 42.12 - - - public void setPINByPinAuthToken(PINRequiredModel pINRequiredModel, String pinAuthToken, final AsyncHandler> handler) { - - if (pINRequiredModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("pINRequiredModel")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(pinAuthToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("pinAuthToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("pinAuthToken", pinAuthToken); - - String resourcePath = "identity/v2/auth/pin/set/pinauthtoken"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(pINRequiredModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - AccessToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to invalidate pin session token. - // - // Session Token of user - // Response containing Definition of Complete Validation data - // 44.1 - - - public void inValidatePinSessionToken(String sessionToken, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(sessionToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("sessionToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("session_token", sessionToken); - - String resourcePath = "identity/v2/auth/session_token/invalidate"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/authentication/PasswordLessLoginApi.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/authentication/PasswordLessLoginApi.java deleted file mode 100644 index be0dc45..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/authentication/PasswordLessLoginApi.java +++ /dev/null @@ -1,359 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. -*/ - -package com.loginradius.sdk.api.authentication; - -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; -import com.loginradius.sdk.helper.JsonDeserializer; -import com.loginradius.sdk.helper.LoginRadiusRequest; -import com.loginradius.sdk.helper.LoginRadiusValidator; -import com.loginradius.sdk.models.requestmodels.PasswordLessLoginByEmailAndOtpModel; -import com.loginradius.sdk.models.requestmodels.PasswordLessLoginByUserNameAndOtpModel; -import com.loginradius.sdk.models.requestmodels.PasswordLessLoginOtpModel; -import com.loginradius.sdk.models.responsemodels.AccessToken; -import com.loginradius.sdk.models.responsemodels.SmsResponseData; -import com.loginradius.sdk.models.responsemodels.otherobjects.GetResponse; -import com.loginradius.sdk.models.responsemodels.otherobjects.PostResponse; -import com.loginradius.sdk.models.responsemodels.userprofile.Identity; -import com.loginradius.sdk.util.AsyncHandler; -import com.loginradius.sdk.util.ErrorResponse; -import com.loginradius.sdk.util.LoginRadiusSDK; - - -public class PasswordLessLoginApi { - private static Gson gson =new Gson(); - - public PasswordLessLoginApi(){ - if (!LoginRadiusSDK.validate()){ - throw new LoginRadiusSDK.InitializeException(); - } - } - - - - // - // This API verifies an account by OTP and allows the customer to login. - // - // Model Class containing Definition of payload for PasswordLessLoginOtpModel API - // The fields parameter filters the API response so that the response only includes a specific set of fields - // SMS Template name - // Boolean, pass true if you wish to trigger voice OTP - // Response containing User Profile Data and access token - // 9.6 - - - public void passwordlessLoginPhoneVerification(PasswordLessLoginOtpModel passwordLessLoginOtpModel, String fields, - String smsTemplate, Boolean isVoiceOtp, final AsyncHandler> handler) { - - if (passwordLessLoginOtpModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("passwordLessLoginOtpModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate)) { - queryParameters.put("smsTemplate", smsTemplate); - } - - if (isVoiceOtp != null && isVoiceOtp) { - queryParameters.put("isVoiceOtp", String.valueOf(isVoiceOtp)); - } - - String resourcePath = "identity/v2/auth/login/passwordlesslogin/otp/verify"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(passwordLessLoginOtpModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - AccessToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // API can be used to send a One-time Passcode (OTP) provided that the account has a verified PhoneID - // - // The Registered Phone Number - // SMS Template name - // Boolean, pass true if you wish to trigger voice OTP - // Response Containing Definition of SMS Data - // 9.15 - - - public void passwordlessLoginByPhone(String phone, String smsTemplate, - Boolean isVoiceOtp, final AsyncHandler> handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(phone)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("phone")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("phone", phone); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate)) { - queryParameters.put("smsTemplate", smsTemplate); - } - - if (isVoiceOtp != null && isVoiceOtp) { - queryParameters.put("isVoiceOtp", String.valueOf(isVoiceOtp)); - } - - String resourcePath = "identity/v2/auth/login/passwordlesslogin/otp"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - GetResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to send a Passwordless Login verification link to the provided Email ID - // - // Email of the user - // Passwordless Login Template Name - // Email verification url - // Response containing Definition of Complete Validation data - // 9.18.1 - - - public void passwordlessLoginByEmail(String email, String passwordLessLoginTemplate, - String verificationUrl, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(email)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("email")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("email", email); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(passwordLessLoginTemplate)) { - queryParameters.put("passwordLessLoginTemplate", passwordLessLoginTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(verificationUrl)) { - queryParameters.put("verificationUrl", verificationUrl); - } - - String resourcePath = "identity/v2/auth/login/passwordlesslogin/email"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to send a Passwordless Login Verification Link to a customer by providing their UserName - // - // UserName of the user - // Passwordless Login Template Name - // Email verification url - // Response containing Definition of Complete Validation data - // 9.18.2 - - - public void passwordlessLoginByUserName(String username, String passwordLessLoginTemplate, - String verificationUrl, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(username)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("username")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("username", username); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(passwordLessLoginTemplate)) { - queryParameters.put("passwordLessLoginTemplate", passwordLessLoginTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(verificationUrl)) { - queryParameters.put("verificationUrl", verificationUrl); - } - - String resourcePath = "identity/v2/auth/login/passwordlesslogin/email"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to verify the Passwordless Login verification link. Note: If you are using Passwordless Login by Phone you will need to use the Passwordless Login Phone Verification API - // - // Verification token received in the email - // The fields parameter filters the API response so that the response only includes a specific set of fields - // Name of the welcome email template - // Response containing User Profile Data and access token - // 9.19 - - - public void passwordlessLoginVerification(String verificationToken, String fields, - String welcomeEmailTemplate, final AsyncHandler> handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(verificationToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("verificationToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apikey", LoginRadiusSDK.getApiKey()); - queryParameters.put("verificationToken", verificationToken); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(welcomeEmailTemplate)) { - queryParameters.put("welcomeEmailTemplate", welcomeEmailTemplate); - } - - String resourcePath = "identity/v2/auth/login/passwordlesslogin/email/verify"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - AccessToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to verify the otp sent to the email when doing a passwordless login. - // - // payload - // Fields - // Response containing User Profile Data and access token - // 9.23 - - - public void passwordlessLoginVerificationByEmailAndOTP(PasswordLessLoginByEmailAndOtpModel passwordLessLoginByEmailAndOtpModel, String fields, final AsyncHandler> handler) { - - if (passwordLessLoginByEmailAndOtpModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("passwordLessLoginByEmailAndOtpModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - String resourcePath = "identity/v2/auth/login/passwordlesslogin/email/verifyotp"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(passwordLessLoginByEmailAndOtpModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - AccessToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to verify the otp sent to the email when doing a passwordless login. - // - // payload - // Fields - // Response containing User Profile Data and access token - // 9.24 - - - public void passwordlessLoginVerificationByUserNameAndOTP(PasswordLessLoginByUserNameAndOtpModel passwordLessLoginByUserNameAndOtpModel, String fields, final AsyncHandler> handler) { - - if (passwordLessLoginByUserNameAndOtpModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("passwordLessLoginByUserNameAndOtpModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - String resourcePath = "identity/v2/auth/login/passwordlesslogin/username/verifyotp"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(passwordLessLoginByUserNameAndOtpModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - AccessToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/authentication/PhoneAuthenticationApi.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/authentication/PhoneAuthenticationApi.java deleted file mode 100644 index 61b81ca..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/authentication/PhoneAuthenticationApi.java +++ /dev/null @@ -1,604 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. -*/ - -package com.loginradius.sdk.api.authentication; - -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.JsonObject; -import com.google.gson.reflect.TypeToken; -import com.loginradius.sdk.helper.JsonDeserializer; -import com.loginradius.sdk.helper.LoginRadiusRequest; -import com.loginradius.sdk.helper.LoginRadiusValidator; -import com.loginradius.sdk.models.requestmodels.AuthUserRegistrationModel; -import com.loginradius.sdk.models.requestmodels.PhoneAuthenticationModel; -import com.loginradius.sdk.models.requestmodels.ResetPasswordByOTPModel; -import com.loginradius.sdk.models.responsemodels.AccessToken; -import com.loginradius.sdk.models.responsemodels.SmsResponseData; -import com.loginradius.sdk.models.responsemodels.otherobjects.DeleteResponse; -import com.loginradius.sdk.models.responsemodels.otherobjects.ExistResponse; -import com.loginradius.sdk.models.responsemodels.otherobjects.PostResponse; -import com.loginradius.sdk.models.responsemodels.otherobjects.UserProfilePostResponse; -import com.loginradius.sdk.models.responsemodels.userprofile.Identity; -import com.loginradius.sdk.util.AsyncHandler; -import com.loginradius.sdk.util.ErrorResponse; -import com.loginradius.sdk.util.LoginRadiusSDK; - - -public class PhoneAuthenticationApi { - private static Gson gson =new Gson(); - - public PhoneAuthenticationApi(){ - if (!LoginRadiusSDK.validate()){ - throw new LoginRadiusSDK.InitializeException(); - } - } - - - - // - // This API retrieves a copy of the user data based on the Phone - // - // Model Class containing Definition of payload for PhoneAuthenticationModel API - // The fields parameter filters the API response so that the response only includes a specific set of fields - // Url where the user is logging from - // SMS Template name - // - // Response containing User Profile Data and access token - // 9.2.3 - - - public void loginByPhone(PhoneAuthenticationModel phoneAuthenticationModel, String fields, - String loginUrl, String smsTemplate, String options, final AsyncHandler> handler) { - - if (phoneAuthenticationModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("phoneAuthenticationModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(loginUrl)) { - queryParameters.put("loginUrl", loginUrl); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate)) { - queryParameters.put("smsTemplate", smsTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(options)) { - queryParameters.put("options", options); - } - - String resourcePath = "identity/v2/auth/login"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(phoneAuthenticationModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - AccessToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to send the OTP to reset the account password. - // - // New Phone Number - // SMS Template name - // Boolean, pass true if you wish to trigger voice OTP - // Response Containing Validation Data and SMS Data - // 10.4 - - - public void forgotPasswordByPhoneOTP(String phone, String smsTemplate, - Boolean isVoiceOtp, final AsyncHandler> handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(phone)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("phone")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate)) { - queryParameters.put("smsTemplate", smsTemplate); - } - - if (isVoiceOtp != null && isVoiceOtp) { - queryParameters.put("isVoiceOtp", String.valueOf(isVoiceOtp)); - } - - JsonObject bodyParameters = new JsonObject(); - bodyParameters.addProperty("phone", phone); - - String resourcePath = "identity/v2/auth/password/otp"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(bodyParameters), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - UserProfilePostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to reset the password - // - // Model Class containing Definition of payload for ResetPasswordByOTP API - // Response containing Definition of Complete Validation data - // 10.5 - - - public void resetPasswordByPhoneOTP(ResetPasswordByOTPModel resetPasswordByOTPModel, final AsyncHandler handler) { - - if (resetPasswordByOTPModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("resetPasswordByOTPModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/password/otp"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(resetPasswordByOTPModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to validate the verification code sent to verify a user's phone number - // - // The Verification Code - // New Phone Number - // The fields parameter filters the API response so that the response only includes a specific set of fields - // SMS Template name - // Boolean, pass true if you wish to trigger voice OTP - // Response containing User Profile Data and access token - // 11.1.1 - - - public void phoneVerificationByOTP(String otp, String phone, - String fields, String smsTemplate, Boolean isVoiceOtp, final AsyncHandler> handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(otp)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("otp")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(phone)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("phone")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("otp", otp); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate)) { - queryParameters.put("smsTemplate", smsTemplate); - } - - if (isVoiceOtp != null && isVoiceOtp) { - queryParameters.put("isVoiceOtp", String.valueOf(isVoiceOtp)); - } - - JsonObject bodyParameters = new JsonObject(); - bodyParameters.addProperty("phone", phone); - - String resourcePath = "identity/v2/auth/phone/otp"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(bodyParameters), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - AccessToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to consume the verification code sent to verify a user's phone number. Use this call for front-end purposes in cases where the user is already logged in by passing the user's access token. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // The Verification Code - // SMS Template name - // Boolean, pass true if you wish to trigger voice OTP - // Response containing Definition of Complete Validation data - // 11.1.2 - - - public void phoneVerificationOTPByAccessToken(String accessToken, String otp, - String smsTemplate, Boolean isVoiceOtp, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(otp)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("otp")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("otp", otp); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate)) { - queryParameters.put("smsTemplate", smsTemplate); - } - - if (isVoiceOtp != null && isVoiceOtp) { - queryParameters.put("isVoiceOtp", String.valueOf(isVoiceOtp)); - } - - String resourcePath = "identity/v2/auth/phone/otp"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to resend a verification OTP to verify a user's Phone Number. The user will receive a verification code that they will need to input - // - // New Phone Number - // SMS Template name - // Boolean, pass true if you wish to trigger voice OTP - // Response Containing Validation Data and SMS Data - // 11.2.1 - - - public void phoneResendVerificationOTP(String phone, String smsTemplate, - Boolean isVoiceOtp, final AsyncHandler> handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(phone)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("phone")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate)) { - queryParameters.put("smsTemplate", smsTemplate); - } - - if (isVoiceOtp != null && isVoiceOtp) { - queryParameters.put("isVoiceOtp", String.valueOf(isVoiceOtp)); - } - - JsonObject bodyParameters = new JsonObject(); - bodyParameters.addProperty("phone", phone); - - String resourcePath = "identity/v2/auth/phone/otp"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(bodyParameters), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - UserProfilePostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to resend a verification OTP to verify a user's Phone Number in cases in which an active token already exists - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // New Phone Number - // SMS Template name - // Boolean, pass true if you wish to trigger voice OTP - // Response Containing Validation Data and SMS Data - // 11.2.2 - - - public void phoneResendVerificationOTPByToken(String accessToken, String phone, - String smsTemplate, Boolean isVoiceOtp, final AsyncHandler> handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(phone)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("phone")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate)) { - queryParameters.put("smsTemplate", smsTemplate); - } - - if (isVoiceOtp != null && isVoiceOtp) { - queryParameters.put("isVoiceOtp", String.valueOf(isVoiceOtp)); - } - - JsonObject bodyParameters = new JsonObject(); - bodyParameters.addProperty("phone", phone); - - String resourcePath = "identity/v2/auth/phone/otp"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(bodyParameters), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - UserProfilePostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to update the login Phone Number of users - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // New Phone Number - // SMS Template name - // Boolean, pass true if you wish to trigger voice OTP - // Response Containing Validation Data and SMS Data - // 11.5 - - - public void updatePhoneNumber(String accessToken, String phone, - String smsTemplate, Boolean isVoiceOtp, final AsyncHandler> handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(phone)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("phone")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate)) { - queryParameters.put("smsTemplate", smsTemplate); - } - - if (isVoiceOtp != null && isVoiceOtp) { - queryParameters.put("isVoiceOtp", String.valueOf(isVoiceOtp)); - } - - JsonObject bodyParameters = new JsonObject(); - bodyParameters.addProperty("phone", phone); - - String resourcePath = "identity/v2/auth/phone"; - - LoginRadiusRequest.execute("PUT", resourcePath, queryParameters, gson.toJson(bodyParameters), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - UserProfilePostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to check the Phone Number exists or not on your site. - // - // The Registered Phone Number - // Response containing Definition Complete ExistResponse data - // 11.6 - - - public void checkPhoneNumberAvailability(String phone, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(phone)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("phone")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("phone", phone); - - String resourcePath = "identity/v2/auth/phone"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - ExistResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to delete the Phone ID on a user's account via the access token - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Response containing Definition of Delete Request - // 11.7 - - - public void removePhoneIDByAccessToken(String accessToken, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/phone"; - - LoginRadiusRequest.execute("DELETE", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - DeleteResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API registers the new users into your Cloud Storage and triggers the phone verification process. - // - // Model Class containing Definition of payload for Auth User Registration API - // LoginRadius Secured One Time Token - // The fields parameter filters the API response so that the response only includes a specific set of fields - // PreventVerificationEmail (Specifying this value prevents the verification email from being sent. Only applicable if you have the optional email verification flow) - // SMS Template name - // Email verification url - // Name of the welcome email template - // Name of the email template - // Boolean, pass true if you wish to trigger voice OTP - // Response containing Definition of Complete Validation, UserProfile data and Access Token - // 17.1.2 - - - public void userRegistrationByPhone(AuthUserRegistrationModel authUserRegistrationModel, String sott, - String fields, String options, String smsTemplate, String verificationUrl, String welcomeEmailTemplate, String emailTemplate, Boolean isVoiceOtp, final AsyncHandler>> handler) { - - if (authUserRegistrationModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("authUserRegistrationModel")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(sott)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("sott")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("sott", sott); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(options)) { - queryParameters.put("options", options); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate)) { - queryParameters.put("smsTemplate", smsTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(verificationUrl)) { - queryParameters.put("verificationUrl", verificationUrl); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(welcomeEmailTemplate)) { - queryParameters.put("welcomeEmailTemplate", welcomeEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate)) { - queryParameters.put("emailTemplate", emailTemplate); - } - - if (isVoiceOtp != null && isVoiceOtp) { - queryParameters.put("isVoiceOtp", String.valueOf(isVoiceOtp)); - } - - String resourcePath = "identity/v2/auth/register"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(authUserRegistrationModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken>> typeToken = new TypeToken>>() {}; - UserProfilePostResponse> successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/authentication/RiskBasedAuthenticationApi.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/authentication/RiskBasedAuthenticationApi.java deleted file mode 100644 index 922771f..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/authentication/RiskBasedAuthenticationApi.java +++ /dev/null @@ -1,409 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. -*/ - -package com.loginradius.sdk.api.authentication; - -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; -import com.loginradius.sdk.helper.JsonDeserializer; -import com.loginradius.sdk.helper.LoginRadiusRequest; -import com.loginradius.sdk.helper.LoginRadiusValidator; -import com.loginradius.sdk.models.requestmodels.EmailAuthenticationModel; -import com.loginradius.sdk.models.requestmodels.PhoneAuthenticationModel; -import com.loginradius.sdk.models.requestmodels.UserNameAuthenticationModel; -import com.loginradius.sdk.models.responsemodels.AccessToken; -import com.loginradius.sdk.models.responsemodels.userprofile.Identity; -import com.loginradius.sdk.util.AsyncHandler; -import com.loginradius.sdk.util.ErrorResponse; -import com.loginradius.sdk.util.LoginRadiusSDK; - - -public class RiskBasedAuthenticationApi { - private static Gson gson =new Gson(); - - public RiskBasedAuthenticationApi(){ - if (!LoginRadiusSDK.validate()){ - throw new LoginRadiusSDK.InitializeException(); - } - } - - - - // - // This API retrieves a copy of the user data based on the Email - // - // Model Class containing Definition of payload for Email Authentication API - // Email template name - // The fields parameter filters the API response so that the response only includes a specific set of fields - // Url where the user is logging from - // Password Delegation Allows you to use a third-party service to store your passwords rather than LoginRadius Cloud storage. - // RiskBased Authentication Password Delegation App - // Risk Based Authentication Browser EmailTemplate - // Risk Based Authentication Browser Sms Template - // Risk Based Authentication City Email Template - // Risk Based Authentication City SmsTemplate - // Risk Based Authentication Country EmailTemplate - // Risk Based Authentication Country SmsTemplate - // Risk Based Authentication Ip EmailTemplate - // Risk Based Authentication Ip SmsTemplate - // Risk Based Authentication Oneclick EmailTemplate - // Risk Based Authentication Oneclick EmailTemplate - // SMS Template name - // Email verification url - // Response containing User Profile Data and access token - // 9.2.4 - - - public void rbaLoginByEmail(EmailAuthenticationModel emailAuthenticationModel, String emailTemplate, - String fields, String loginUrl, Boolean passwordDelegation, String passwordDelegationApp, String rbaBrowserEmailTemplate, - String rbaBrowserSmsTemplate, String rbaCityEmailTemplate, String rbaCitySmsTemplate, String rbaCountryEmailTemplate, - String rbaCountrySmsTemplate, String rbaIpEmailTemplate, String rbaIpSmsTemplate, String rbaOneclickEmailTemplate, - String rbaOTPSmsTemplate, String smsTemplate, String verificationUrl, final AsyncHandler> handler) { - - if (emailAuthenticationModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("emailAuthenticationModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate)) { - queryParameters.put("emailTemplate", emailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(loginUrl)) { - queryParameters.put("loginUrl", loginUrl); - } - - if (passwordDelegation != null && passwordDelegation) { - queryParameters.put("passwordDelegation", String.valueOf(passwordDelegation)); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(passwordDelegationApp)) { - queryParameters.put("passwordDelegationApp", passwordDelegationApp); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaBrowserEmailTemplate)) { - queryParameters.put("rbaBrowserEmailTemplate", rbaBrowserEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaBrowserSmsTemplate)) { - queryParameters.put("rbaBrowserSmsTemplate", rbaBrowserSmsTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaCityEmailTemplate)) { - queryParameters.put("rbaCityEmailTemplate", rbaCityEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaCitySmsTemplate)) { - queryParameters.put("rbaCitySmsTemplate", rbaCitySmsTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaCountryEmailTemplate)) { - queryParameters.put("rbaCountryEmailTemplate", rbaCountryEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaCountrySmsTemplate)) { - queryParameters.put("rbaCountrySmsTemplate", rbaCountrySmsTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaIpEmailTemplate)) { - queryParameters.put("rbaIpEmailTemplate", rbaIpEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaIpSmsTemplate)) { - queryParameters.put("rbaIpSmsTemplate", rbaIpSmsTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaOneclickEmailTemplate)) { - queryParameters.put("rbaOneclickEmailTemplate", rbaOneclickEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaOTPSmsTemplate)) { - queryParameters.put("rbaOTPSmsTemplate", rbaOTPSmsTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate)) { - queryParameters.put("smsTemplate", smsTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(verificationUrl)) { - queryParameters.put("verificationUrl", verificationUrl); - } - - String resourcePath = "identity/v2/auth/login"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(emailAuthenticationModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - AccessToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API retrieves a copy of the user data based on the Username - // - // Model Class containing Definition of payload for Username Authentication API - // Email template name - // The fields parameter filters the API response so that the response only includes a specific set of fields - // Url where the user is logging from - // Password Delegation Allows you to use a third-party service to store your passwords rather than LoginRadius Cloud storage. - // RiskBased Authentication Password Delegation App - // Risk Based Authentication Browser EmailTemplate - // Risk Based Authentication Browser Sms Template - // Risk Based Authentication City Email Template - // Risk Based Authentication City SmsTemplate - // Risk Based Authentication Country EmailTemplate - // Risk Based Authentication Country SmsTemplate - // Risk Based Authentication Ip EmailTemplate - // Risk Based Authentication Ip SmsTemplate - // Risk Based Authentication Oneclick EmailTemplate - // Risk Based Authentication OTPSmsTemplate - // SMS Template name - // Email verification url - // Response containing User Profile Data and access token - // 9.2.5 - - - public void rbaLoginByUserName(UserNameAuthenticationModel userNameAuthenticationModel, String emailTemplate, - String fields, String loginUrl, Boolean passwordDelegation, String passwordDelegationApp, String rbaBrowserEmailTemplate, - String rbaBrowserSmsTemplate, String rbaCityEmailTemplate, String rbaCitySmsTemplate, String rbaCountryEmailTemplate, - String rbaCountrySmsTemplate, String rbaIpEmailTemplate, String rbaIpSmsTemplate, String rbaOneclickEmailTemplate, - String rbaOTPSmsTemplate, String smsTemplate, String verificationUrl, final AsyncHandler> handler) { - - if (userNameAuthenticationModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("userNameAuthenticationModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate)) { - queryParameters.put("emailTemplate", emailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(loginUrl)) { - queryParameters.put("loginUrl", loginUrl); - } - - if (passwordDelegation != null && passwordDelegation) { - queryParameters.put("passwordDelegation", String.valueOf(passwordDelegation)); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(passwordDelegationApp)) { - queryParameters.put("passwordDelegationApp", passwordDelegationApp); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaBrowserEmailTemplate)) { - queryParameters.put("rbaBrowserEmailTemplate", rbaBrowserEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaBrowserSmsTemplate)) { - queryParameters.put("rbaBrowserSmsTemplate", rbaBrowserSmsTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaCityEmailTemplate)) { - queryParameters.put("rbaCityEmailTemplate", rbaCityEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaCitySmsTemplate)) { - queryParameters.put("rbaCitySmsTemplate", rbaCitySmsTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaCountryEmailTemplate)) { - queryParameters.put("rbaCountryEmailTemplate", rbaCountryEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaCountrySmsTemplate)) { - queryParameters.put("rbaCountrySmsTemplate", rbaCountrySmsTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaIpEmailTemplate)) { - queryParameters.put("rbaIpEmailTemplate", rbaIpEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaIpSmsTemplate)) { - queryParameters.put("rbaIpSmsTemplate", rbaIpSmsTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaOneclickEmailTemplate)) { - queryParameters.put("rbaOneclickEmailTemplate", rbaOneclickEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaOTPSmsTemplate)) { - queryParameters.put("rbaOTPSmsTemplate", rbaOTPSmsTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate)) { - queryParameters.put("smsTemplate", smsTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(verificationUrl)) { - queryParameters.put("verificationUrl", verificationUrl); - } - - String resourcePath = "identity/v2/auth/login"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(userNameAuthenticationModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - AccessToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API retrieves a copy of the user data based on the Phone - // - // Model Class containing Definition of payload for PhoneAuthenticationModel API - // Email template name - // The fields parameter filters the API response so that the response only includes a specific set of fields - // Url where the user is logging from - // Password Delegation Allows you to use a third-party service to store your passwords rather than LoginRadius Cloud storage. - // RiskBased Authentication Password Delegation App - // Risk Based Authentication Browser EmailTemplate - // Risk Based Authentication Browser Sms Template - // Risk Based Authentication City Email Template - // Risk Based Authentication City SmsTemplate - // Risk Based Authentication Country EmailTemplate - // Risk Based Authentication Country SmsTemplate - // Risk Based Authentication Ip EmailTemplate - // Risk Based Authentication Ip SmsTemplate - // Risk Based Authentication Oneclick EmailTemplate - // Risk Based Authentication OTPSmsTemplate - // SMS Template name - // Email verification url - // Response containing User Profile Data and access token - // 9.2.6 - - - public void rbaLoginByPhone(PhoneAuthenticationModel phoneAuthenticationModel, String emailTemplate, - String fields, String loginUrl, Boolean passwordDelegation, String passwordDelegationApp, String rbaBrowserEmailTemplate, - String rbaBrowserSmsTemplate, String rbaCityEmailTemplate, String rbaCitySmsTemplate, String rbaCountryEmailTemplate, - String rbaCountrySmsTemplate, String rbaIpEmailTemplate, String rbaIpSmsTemplate, String rbaOneclickEmailTemplate, - String rbaOTPSmsTemplate, String smsTemplate, String verificationUrl, final AsyncHandler> handler) { - - if (phoneAuthenticationModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("phoneAuthenticationModel")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate)) { - queryParameters.put("emailTemplate", emailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(loginUrl)) { - queryParameters.put("loginUrl", loginUrl); - } - - if (passwordDelegation != null && passwordDelegation) { - queryParameters.put("passwordDelegation", String.valueOf(passwordDelegation)); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(passwordDelegationApp)) { - queryParameters.put("passwordDelegationApp", passwordDelegationApp); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaBrowserEmailTemplate)) { - queryParameters.put("rbaBrowserEmailTemplate", rbaBrowserEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaBrowserSmsTemplate)) { - queryParameters.put("rbaBrowserSmsTemplate", rbaBrowserSmsTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaCityEmailTemplate)) { - queryParameters.put("rbaCityEmailTemplate", rbaCityEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaCitySmsTemplate)) { - queryParameters.put("rbaCitySmsTemplate", rbaCitySmsTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaCountryEmailTemplate)) { - queryParameters.put("rbaCountryEmailTemplate", rbaCountryEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaCountrySmsTemplate)) { - queryParameters.put("rbaCountrySmsTemplate", rbaCountrySmsTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaIpEmailTemplate)) { - queryParameters.put("rbaIpEmailTemplate", rbaIpEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaIpSmsTemplate)) { - queryParameters.put("rbaIpSmsTemplate", rbaIpSmsTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaOneclickEmailTemplate)) { - queryParameters.put("rbaOneclickEmailTemplate", rbaOneclickEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(rbaOTPSmsTemplate)) { - queryParameters.put("rbaOTPSmsTemplate", rbaOTPSmsTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smsTemplate)) { - queryParameters.put("smsTemplate", smsTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(verificationUrl)) { - queryParameters.put("verificationUrl", verificationUrl); - } - - String resourcePath = "identity/v2/auth/login"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters, gson.toJson(phoneAuthenticationModel), new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - AccessToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/authentication/SlidingTokenApi.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/authentication/SlidingTokenApi.java deleted file mode 100644 index 2d61182..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/authentication/SlidingTokenApi.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. -*/ - -package com.loginradius.sdk.api.authentication; - -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; -import com.loginradius.sdk.helper.JsonDeserializer; -import com.loginradius.sdk.helper.LoginRadiusRequest; -import com.loginradius.sdk.helper.LoginRadiusValidator; -import com.loginradius.sdk.models.responsemodels.AccessTokenBase; -import com.loginradius.sdk.util.AsyncHandler; -import com.loginradius.sdk.util.ErrorResponse; -import com.loginradius.sdk.util.LoginRadiusSDK; - - -public class SlidingTokenApi { - private static Gson gson =new Gson(); - - public SlidingTokenApi(){ - if (!LoginRadiusSDK.validate()){ - throw new LoginRadiusSDK.InitializeException(); - } - } - - - - // - // - // - // - // Response containing Definition of Complete Token data - // 1.3 - - - public void slidingAccessToken(String accessToken, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - - String resourcePath = "identity/v2/auth/access_token/sliding_token"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - AccessTokenBase successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/authentication/SmartLoginApi.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/authentication/SmartLoginApi.java deleted file mode 100644 index df263c8..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/authentication/SmartLoginApi.java +++ /dev/null @@ -1,234 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. -*/ - -package com.loginradius.sdk.api.authentication; - -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; -import com.loginradius.sdk.helper.JsonDeserializer; -import com.loginradius.sdk.helper.LoginRadiusRequest; -import com.loginradius.sdk.helper.LoginRadiusValidator; -import com.loginradius.sdk.models.responsemodels.AccessToken; -import com.loginradius.sdk.models.responsemodels.otherobjects.PostResponse; -import com.loginradius.sdk.models.responsemodels.otherobjects.VerifiedResponse; -import com.loginradius.sdk.models.responsemodels.userprofile.Identity; -import com.loginradius.sdk.util.AsyncHandler; -import com.loginradius.sdk.util.ErrorResponse; -import com.loginradius.sdk.util.LoginRadiusSDK; - - -public class SmartLoginApi { - private static Gson gson =new Gson(); - - public SmartLoginApi(){ - if (!LoginRadiusSDK.validate()){ - throw new LoginRadiusSDK.InitializeException(); - } - } - - - - // - // This API verifies the provided token for Smart Login - // - // Verification token received in the email - // Name of the welcome email template - // Complete verified response data - // 8.4.1 - - - public void smartLoginTokenVerification(String verificationToken, String welcomeEmailTemplate, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(verificationToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("verificationToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("verificationToken", verificationToken); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(welcomeEmailTemplate)) { - queryParameters.put("welcomeEmailTemplate", welcomeEmailTemplate); - } - - String resourcePath = "identity/v2/auth/email/smartlogin"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - VerifiedResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API sends a Smart Login link to the user's Email Id. - // - // Unique string used in the Smart Login request - // Email of the user - // Url where the user will redirect after success authentication - // Email template for Smart Login link - // Name of the welcome email template - // Response containing Definition of Complete Validation data - // 9.17.1 - - - public void smartLoginByEmail(String clientGuid, String email, - String redirectUrl, String smartLoginEmailTemplate, String welcomeEmailTemplate, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(clientGuid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("clientGuid")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(email)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("email")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("clientGuid", clientGuid); - queryParameters.put("email", email); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(redirectUrl)) { - queryParameters.put("redirectUrl", redirectUrl); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smartLoginEmailTemplate)) { - queryParameters.put("smartLoginEmailTemplate", smartLoginEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(welcomeEmailTemplate)) { - queryParameters.put("welcomeEmailTemplate", welcomeEmailTemplate); - } - - String resourcePath = "identity/v2/auth/login/smartlogin"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API sends a Smart Login link to the user's Email Id. - // - // Unique string used in the Smart Login request - // UserName of the user - // Url where the user will redirect after success authentication - // Email template for Smart Login link - // Name of the welcome email template - // Response containing Definition of Complete Validation data - // 9.17.2 - - - public void smartLoginByUserName(String clientGuid, String username, - String redirectUrl, String smartLoginEmailTemplate, String welcomeEmailTemplate, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(clientGuid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("clientGuid")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(username)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("username")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("clientGuid", clientGuid); - queryParameters.put("username", username); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(redirectUrl)) { - queryParameters.put("redirectUrl", redirectUrl); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(smartLoginEmailTemplate)) { - queryParameters.put("smartLoginEmailTemplate", smartLoginEmailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(welcomeEmailTemplate)) { - queryParameters.put("welcomeEmailTemplate", welcomeEmailTemplate); - } - - String resourcePath = "identity/v2/auth/login/smartlogin"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostResponse successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to check if the Smart Login link has been clicked or not - // - // Unique string used in the Smart Login request - // The fields parameter filters the API response so that the response only includes a specific set of fields - // Response containing User Profile Data and access token - // 9.21.1 - - - public void smartLoginPing(String clientGuid, String fields, final AsyncHandler> handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(clientGuid)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("clientGuid")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("clientGuid", clientGuid); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(fields)) { - queryParameters.put("fields", fields); - } - - String resourcePath = "identity/v2/auth/login/smartlogin/ping"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken> typeToken = new TypeToken>() {}; - AccessToken successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/cloud/SsoJwtApi.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/cloud/SsoJwtApi.java deleted file mode 100644 index 3ff0085..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/cloud/SsoJwtApi.java +++ /dev/null @@ -1,230 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. -*/ - -package com.loginradius.sdk.api.cloud; - -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; -import com.loginradius.sdk.helper.JsonDeserializer; -import com.loginradius.sdk.helper.LoginRadiusRequest; -import com.loginradius.sdk.helper.LoginRadiusValidator; -import com.loginradius.sdk.models.requestmodels.SsoAuthenticationModel; -import com.loginradius.sdk.models.responsemodels.SsoJwtResponseData; -import com.loginradius.sdk.util.AsyncHandler; -import com.loginradius.sdk.util.ErrorResponse; -import com.loginradius.sdk.util.LoginRadiusSDK; - - -public class SsoJwtApi { - private static Gson gson =new Gson(); - - public SsoJwtApi(){ - if (!LoginRadiusSDK.validate()){ - throw new LoginRadiusSDK.InitializeException(); - } - } - - - - // - // This API is used to get the JWT token by access token. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Jwt App Name - // Response containing Definition Complete SsoJwtResponseData data - - public void jwtTokenByAccessToken(String accessToken, String jwtAppName,final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(jwtAppName)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("jwtAppName")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("access_token", accessToken); - queryParameters.put("jwtapp", jwtAppName); - - String resourcePath = "sso/jwt/api/token"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters,null,new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - SsoJwtResponseData successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to get a JWT token by Email and Password. - // - // Model Class containing Definition of payload for SSO Jwt Cloud Api - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Jwt App Name - // Response containing Definition Complete SsoJwtResponseData data - - public void jwtTokenByEmail(SsoAuthenticationModel ssoAuthenticationModel, String jwtAppName,String emailTemplate,String loginUrl, String verificationUrl,final AsyncHandler handler) { - - if (ssoAuthenticationModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("ssoAuthenticationModel")); - } - if (LoginRadiusValidator.isNullOrWhiteSpace(jwtAppName)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("jwtAppName")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("jwtapp", jwtAppName); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate)) { - queryParameters.put("emailTemplate", emailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(loginUrl)) { - queryParameters.put("loginUrl", loginUrl); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(verificationUrl)) { - queryParameters.put("verificationurl", verificationUrl); - } - String resourcePath = "sso/jwt/api/login"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters,gson.toJson(ssoAuthenticationModel),new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - SsoJwtResponseData successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to get a JWT token by UserName and Password. - // - // Model Class containing Definition of payload for SSO Jwt Cloud Api - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Jwt App Name - // Response containing Definition Complete SsoJwtResponseData data - - public void jwtTokenByUserName(SsoAuthenticationModel ssoAuthenticationModel, String jwtAppName, String emailTemplate,String loginUrl, String verificationUrl, final AsyncHandler handler) { - - - if (ssoAuthenticationModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("ssoAuthenticationModel")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(jwtAppName)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("jwtAppName")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("jwtapp", jwtAppName); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate)) { - queryParameters.put("emailTemplate", emailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(loginUrl)) { - queryParameters.put("loginUrl", loginUrl); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(verificationUrl)) { - queryParameters.put("verificationurl", verificationUrl); - } - String resourcePath = "sso/jwt/api/login"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters,gson.toJson(ssoAuthenticationModel),new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - SsoJwtResponseData successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - // - // This API is used to get a JWT token by Phone and Password. - // - // Model Class containing Definition of payload for SSO Jwt Cloud Api - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Jwt App Name - // Response containing Definition Complete SsoJwtResponseData data - - public void jwtTokenByPhone(SsoAuthenticationModel ssoAuthenticationModel,String jwtAppName,String emailTemplate,String loginUrl, String verificationUrl,final AsyncHandler handler) { - - if (ssoAuthenticationModel == null) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("ssoAuthenticationModel")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(jwtAppName)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("jwtAppName")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("jwtapp", jwtAppName); - - - if (!LoginRadiusValidator.isNullOrWhiteSpace(emailTemplate)) { - queryParameters.put("emailTemplate", emailTemplate); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(loginUrl)) { - queryParameters.put("loginUrl", loginUrl); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(verificationUrl)) { - queryParameters.put("verificationurl", verificationUrl); - } - - String resourcePath = "sso/jwt/api/login"; - - LoginRadiusRequest.execute("POST", resourcePath, queryParameters,gson.toJson(ssoAuthenticationModel),new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - SsoJwtResponseData successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/social/NativeSocialApi.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/social/NativeSocialApi.java deleted file mode 100644 index fc9d060..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/social/NativeSocialApi.java +++ /dev/null @@ -1,447 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. -*/ - -package com.loginradius.sdk.api.social; - -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; -import com.loginradius.sdk.helper.JsonDeserializer; -import com.loginradius.sdk.helper.LoginRadiusRequest; -import com.loginradius.sdk.helper.LoginRadiusValidator; -import com.loginradius.sdk.models.responsemodels.AccessTokenBase; -import com.loginradius.sdk.util.AsyncHandler; -import com.loginradius.sdk.util.ErrorResponse; -import com.loginradius.sdk.util.LoginRadiusSDK; - - -public class NativeSocialApi { - private static Gson gson =new Gson(); - - public NativeSocialApi(){ - if (!LoginRadiusSDK.validate()){ - throw new LoginRadiusSDK.InitializeException(); - } - } - - - - // - // The API is used to get LoginRadius access token by sending Facebook's access token. It will be valid for the specific duration of time specified in the response. - // - // Facebook Access Token - // Name of Social provider APP - // Response containing Definition of Complete Token data - // 20.3 - - - public void getAccessTokenByFacebookAccessToken(String fbAccessToken, String socialAppName, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(fbAccessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("fbAccessToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("fb_Access_Token", fbAccessToken); - queryParameters.put("key", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(socialAppName)) { - queryParameters.put("socialAppName", socialAppName); - } - - String resourcePath = "api/v2/access_token/facebook"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - AccessTokenBase successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // The API is used to get LoginRadius access token by sending Twitter's access token. It will be valid for the specific duration of time specified in the response. - // - // Twitter Access Token - // Twitter Token Secret - // Name of Social provider APP - // Response containing Definition of Complete Token data - // 20.4 - - - public void getAccessTokenByTwitterAccessToken(String twAccessToken, String twTokenSecret, - String socialAppName, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(twAccessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("twAccessToken")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(twTokenSecret)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("twTokenSecret")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("key", LoginRadiusSDK.getApiKey()); - queryParameters.put("tw_Access_Token", twAccessToken); - queryParameters.put("tw_Token_Secret", twTokenSecret); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(socialAppName)) { - queryParameters.put("socialAppName", socialAppName); - } - - String resourcePath = "api/v2/access_token/twitter"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - AccessTokenBase successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // The API is used to get LoginRadius access token by sending Google's access token. It will be valid for the specific duration of time specified in the response. - // - // Google Access Token - // Google Client ID - // LoginRadius refresh token - // Name of Social provider APP - // Response containing Definition of Complete Token data - // 20.5 - - - public void getAccessTokenByGoogleAccessToken(String googleAccessToken, String clientId, - String refreshToken, String socialAppName, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(googleAccessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("googleAccessToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("google_Access_Token", googleAccessToken); - queryParameters.put("key", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(clientId)) { - queryParameters.put("client_id", clientId); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(refreshToken)) { - queryParameters.put("refresh_token", refreshToken); - } - - if (!LoginRadiusValidator.isNullOrWhiteSpace(socialAppName)) { - queryParameters.put("socialAppName", socialAppName); - } - - String resourcePath = "api/v2/access_token/google"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - AccessTokenBase successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to Get LoginRadius Access Token using google jwt id token for google native mobile login/registration. - // - // Custom JWT Token - // Response containing Definition of Complete Token data - // 20.6 - - - public void getAccessTokenByGoogleJWTAccessToken(String idToken, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(idToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("idToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("id_Token", idToken); - queryParameters.put("key", LoginRadiusSDK.getApiKey()); - - String resourcePath = "api/v2/access_token/googlejwt"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - AccessTokenBase successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // The API is used to get LoginRadius access token by sending Linkedin's access token. It will be valid for the specific duration of time specified in the response. - // - // Linkedin Access Token - // Name of Social provider APP - // Response containing Definition of Complete Token data - // 20.7 - - - public void getAccessTokenByLinkedinAccessToken(String lnAccessToken, String socialAppName, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(lnAccessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("lnAccessToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("key", LoginRadiusSDK.getApiKey()); - queryParameters.put("ln_Access_Token", lnAccessToken); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(socialAppName)) { - queryParameters.put("socialAppName", socialAppName); - } - - String resourcePath = "api/v2/access_token/linkedin"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - AccessTokenBase successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // The API is used to get LoginRadius access token by sending Foursquare's access token. It will be valid for the specific duration of time specified in the response. - // - // Foursquare Access Token - // Response containing Definition of Complete Token data - // 20.8 - - - public void getAccessTokenByFoursquareAccessToken(String fsAccessToken, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(fsAccessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("fsAccessToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("fs_Access_Token", fsAccessToken); - queryParameters.put("key", LoginRadiusSDK.getApiKey()); - - String resourcePath = "api/v2/access_token/foursquare"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - AccessTokenBase successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // The API is used to get LoginRadius access token by sending a valid Apple ID OAuth Code. It will be valid for the specific duration of time specified in the response. - // - // Apple Code - // Name of Social provider APP - // Response containing Definition of Complete Token data - // 20.12 - - - public void getAccessTokenByAppleIdCode(String code, String socialAppName, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(code)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("code")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("code", code); - queryParameters.put("key", LoginRadiusSDK.getApiKey()); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(socialAppName)) { - queryParameters.put("socialAppName", socialAppName); - } - - String resourcePath = "api/v2/access_token/apple"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - AccessTokenBase successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to retrieve a LoginRadius access token by passing in a valid WeChat OAuth Code. - // - // WeChat Code - // Response containing Definition of Complete Token data - // 20.13 - - - public void getAccessTokenByWeChatCode(String code, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(code)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("code")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("code", code); - queryParameters.put("key", LoginRadiusSDK.getApiKey()); - - String resourcePath = "api/v2/access_token/wechat"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - AccessTokenBase successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // The API is used to get LoginRadius access token by sending Google's AuthCode. It will be valid for the specific duration of time specified in the response. - // - // Google AuthCode - // Name of Social provider APP - // Response containing Definition of Complete Token data - // 20.16 - - - public void getAccessTokenByGoogleAuthCode(String googleAuthcode, String socialAppName, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(googleAuthcode)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("googleAuthcode")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("apiKey", LoginRadiusSDK.getApiKey()); - queryParameters.put("google_authcode", googleAuthcode); - - if (!LoginRadiusValidator.isNullOrWhiteSpace(socialAppName)) { - queryParameters.put("socialAppName", socialAppName); - } - - String resourcePath = "api/v2/access_token/google"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - AccessTokenBase successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API is used to retrieve a LoginRadius access token by passing in a valid custom JWT token. - // - // Custom JWT Token - // JWT Provider Name - // Response containing Definition of Complete Token data - // 44.3 - - - public void accessTokenViaCustomJWTToken(String idToken, String providername, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(idToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("idToken")); - } - - if (LoginRadiusValidator.isNullOrWhiteSpace(providername)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("providername")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("id_Token", idToken); - queryParameters.put("key", LoginRadiusSDK.getApiKey()); - queryParameters.put("providername", providername); - - String resourcePath = "api/v2/access_token/jwt"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - AccessTokenBase successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/social/SocialApi.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/social/SocialApi.java deleted file mode 100644 index 1bdfd45..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/api/social/SocialApi.java +++ /dev/null @@ -1,303 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. -*/ - -package com.loginradius.sdk.api.social; - -import java.util.HashMap; -import java.util.Map; - -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; -import com.loginradius.sdk.helper.JsonDeserializer; -import com.loginradius.sdk.helper.LoginRadiusRequest; -import com.loginradius.sdk.helper.LoginRadiusValidator; -import com.loginradius.sdk.models.responsemodels.AccessTokenBase; -import com.loginradius.sdk.models.responsemodels.PostMethodResponseBase; -import com.loginradius.sdk.models.responsemodels.UserActiveSession; -import com.loginradius.sdk.util.AsyncHandler; -import com.loginradius.sdk.util.ErrorResponse; -import com.loginradius.sdk.util.LoginRadiusSDK; - - -public class SocialApi { - private static Gson gson =new Gson(); - - public SocialApi(){ - if (!LoginRadiusSDK.validate()){ - throw new LoginRadiusSDK.InitializeException(); - } - } - - - - // - // This API Is used to translate the Request Token returned during authentication into an Access Token that can be used with other API calls. - // - // Token generated from a successful oauth from social platform - // Response containing Definition of Complete Token data - // 20.1 - - - public void exchangeAccessToken(String token, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(token)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("token")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("secret", LoginRadiusSDK.getApiSecret()); - queryParameters.put("token", token); - - String resourcePath = "api/v2/access_token"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - AccessTokenBase successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // The Refresh Access Token API is used to refresh the provider access token after authentication. It will be valid for up to 60 days on LoginRadius depending on the provider. In order to use the access token in other APIs, always refresh the token using this API.

Supported Providers : Facebook,Yahoo,Google,Twitter, Linkedin.

Contact LoginRadius support team to enable this API. - //
- // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Allows you to specify a desired expiration time in minutes for the newly issued access token. - // Is web or not. - // Response containing Definition of Complete Token data - // 20.2 - - - public void refreshAccessToken(String accessToken, Integer expiresIn, - Boolean isWeb, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("secret", LoginRadiusSDK.getApiSecret()); - - if (expiresIn != null) { - queryParameters.put("expiresIn", String.valueOf(expiresIn)); - } - - if (isWeb != null && isWeb) { - queryParameters.put("isWeb", String.valueOf(isWeb)); - } - - String resourcePath = "api/v2/access_token/refresh"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - AccessTokenBase successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This API validates access token, if valid then returns a response with its expiry otherwise error. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Response containing Definition of Complete Token data - // 20.9 - - - public void validateAccessToken(String accessToken, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("key", LoginRadiusSDK.getApiKey()); - queryParameters.put("secret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "api/v2/access_token/validate"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - AccessTokenBase successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This api invalidates the active access token or expires an access token validity. - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // Response containing Definition for Complete Validation data - // 20.10 - - - public void inValidateAccessToken(String accessToken, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accessToken)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accessToken")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("access_token", accessToken); - queryParameters.put("key", LoginRadiusSDK.getApiKey()); - queryParameters.put("secret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "api/v2/access_token/invalidate"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - PostMethodResponseBase successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This api is use to get all active session by Access Token. - // - // Token generated from a successful oauth from social platform - // Response containing Definition for Complete active sessions - // 20.11.1 - - - public void getActiveSession(String token, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(token)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("token")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("key", LoginRadiusSDK.getApiKey()); - queryParameters.put("secret", LoginRadiusSDK.getApiSecret()); - queryParameters.put("token", token); - - String resourcePath = "api/v2/access_token/activesession"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - UserActiveSession successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This api is used to get all active sessions by AccountID(UID). - // - // UID, the unified identifier for each user account - // Response containing Definition for Complete active sessions - // 20.11.2 - - - public void getActiveSessionByAccountID(String accountId, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(accountId)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("accountId")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("accountId", accountId); - queryParameters.put("key", LoginRadiusSDK.getApiKey()); - queryParameters.put("secret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "api/v2/access_token/activesession"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - UserActiveSession successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } - - // - // This api is used to get all active sessions by ProfileId. - // - // Social Provider Id - // Response containing Definition for Complete active sessions - // 20.11.3 - - - public void getActiveSessionByProfileID(String profileId, final AsyncHandler handler) { - - if (LoginRadiusValidator.isNullOrWhiteSpace(profileId)) { - throw new IllegalArgumentException(LoginRadiusValidator.getValidationMessage("profileId")); - } - - Map queryParameters = new HashMap(); - queryParameters.put("key", LoginRadiusSDK.getApiKey()); - queryParameters.put("profileId", profileId); - queryParameters.put("secret", LoginRadiusSDK.getApiSecret()); - - String resourcePath = "api/v2/access_token/activesession"; - - LoginRadiusRequest.execute("GET", resourcePath, queryParameters, null, new AsyncHandler() { - - @Override - public void onSuccess(String response) { - TypeToken typeToken = new TypeToken() {}; - UserActiveSession successResponse = JsonDeserializer.deserializeJson(response,typeToken); - handler.onSuccess(successResponse); - } - - @Override - public void onFailure(ErrorResponse errorResponse) { - handler.onFailure(errorResponse); - } - }); - } -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/helper/JsonDeserializer.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/helper/JsonDeserializer.java deleted file mode 100644 index 9207904..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/helper/JsonDeserializer.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.loginradius.sdk.helper; - -import com.google.gson.Gson; -import com.google.gson.reflect.TypeToken; - -public class JsonDeserializer { - private JsonDeserializer() { - } - - private static Gson gson = new Gson(); - - public static T deserializeJson(String jsonString, TypeToken type) { - T result = null; - result = gson.fromJson(jsonString, type.getType()); - return result; - } - -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/helper/LoginRadiusRequest.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/helper/LoginRadiusRequest.java deleted file mode 100644 index e2f889c..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/helper/LoginRadiusRequest.java +++ /dev/null @@ -1,331 +0,0 @@ - -package com.loginradius.sdk.helper; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.OutputStreamWriter; -import java.io.UnsupportedEncodingException; -import java.net.Authenticator; -import java.net.HttpURLConnection; -import java.net.InetSocketAddress; -import java.net.MalformedURLException; -import java.net.PasswordAuthentication; -import java.net.Proxy; -import java.net.SocketTimeoutException; -import java.net.URL; -import java.net.URLEncoder; -import java.net.UnknownHostException; -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Locale; -import java.util.Map; -import java.util.TimeZone; -import java.util.zip.GZIPInputStream; - -import javax.crypto.Mac; -import javax.crypto.spec.SecretKeySpec; - -import org.apache.commons.codec.binary.Base64; - -import com.google.gson.reflect.TypeToken; -import com.loginradius.sdk.util.AsyncHandler; -import com.loginradius.sdk.util.ErrorResponse; -import com.loginradius.sdk.util.LoginRadiusSDK; - -public class LoginRadiusRequest { - private LoginRadiusRequest() { - } - - private static final String encoding = "UTF-8"; - private static final String keySecret = "apiSecret"; - private static final String keyToken = "access_token"; - - private static String authorization = ""; - private static String apiSecret = ""; - private static String sott = ""; - - static ErrorResponse errorResponse; - private static Integer code = 0; - - public static void execute(String method, String resourcePath, Map params, String payload, - final AsyncHandler asyncHandler) { - String serviceUrl = LoginRadiusSDK.getDomain() + "/" + resourcePath; - if (!LoginRadiusValidator.isNullOrWhiteSpace(LoginRadiusSDK.getApiRegion())) { - params.put("region", LoginRadiusSDK.getApiRegion()); - } - if (resourcePath.equals("ciam/appinfo")) { - serviceUrl = LoginRadiusSDK.getConfigDomain() + "/" + resourcePath; - } - if (resourcePath.contains("sso/")) { - serviceUrl = LoginRadiusSDK.getCloudDomain() + "/" + resourcePath; - } - if (params.containsKey("sott")) { - sott = params.get("sott"); - params.remove("sott"); - } - if (params.containsKey(keySecret) && serviceUrl.contains("/identity/v2")) { - apiSecret = params.get(keySecret); - params.remove(keySecret); - } - if (params.containsKey(keyToken) && resourcePath.contains("identity/v2/auth")) { - authorization = params.get(keyToken); - params.remove(keyToken); - } - - String task = LoginRadiusRequestRunner(method, LoginRadiusSDK.getRequestUrl(serviceUrl, params), payload); - if (code == 200 && !task.contains("description") && !task.contains("Description")) { - asyncHandler.onSuccess(task); - } else { - ErrorResponse errorResponse = exception(task); - asyncHandler.onFailure(errorResponse); - } - } - - private static String LoginRadiusRequestRunner(String method, String url, String payload) { - - try { - Proxy proxy=null; - - if(!LoginRadiusValidator.isNullOrWhiteSpace(LoginRadiusSDK.getProxyHost()) && !LoginRadiusValidator.isNullOrWhiteSpace(LoginRadiusSDK.getProxyPort()) && !LoginRadiusValidator.isNullOrWhiteSpace(LoginRadiusSDK.getProxyUserName()) && !LoginRadiusValidator.isNullOrWhiteSpace(LoginRadiusSDK.getProxyPassword())) { - - proxy=setProxy(LoginRadiusSDK.getProxyHost(), Integer.parseInt(LoginRadiusSDK.getProxyPort()), LoginRadiusSDK.getProxyUserName(), LoginRadiusSDK.getProxyPassword()); - - } else if(!LoginRadiusValidator.isNullOrWhiteSpace(LoginRadiusSDK.getProxyHost()) && !LoginRadiusValidator.isNullOrWhiteSpace(LoginRadiusSDK.getProxyPort())) { - - proxy=setProxyWithoutAuthentication(LoginRadiusSDK.getProxyHost(),Integer.parseInt(LoginRadiusSDK.getProxyPort())); - - } - - URL connectionUrl = new URL(url); - HttpURLConnection con = null; - - if (proxy != null) { - con = (HttpURLConnection) connectionUrl.openConnection(proxy); - }else { - con = (HttpURLConnection) connectionUrl.openConnection(); - } - con.setRequestMethod(method); - - if(LoginRadiusSDK.getConnectionTimeout() != null && LoginRadiusSDK.getReadTimeout() != null) { - con.setConnectTimeout(LoginRadiusSDK.getConnectionTimeout()); - con.setReadTimeout(LoginRadiusSDK.getReadTimeout()); - }else if(LoginRadiusSDK.getConnectionTimeout() != null ) { - con.setConnectTimeout(LoginRadiusSDK.getConnectionTimeout()); - con.setReadTimeout(15000); - }else { - con.setConnectTimeout(15000); // set timeout to 15 seconds - con.setReadTimeout(15000); - } - - - - con.setRequestProperty("Content-Type", "application/json"); - con.setRequestProperty("charset", encoding); - con.setRequestProperty("Accept-Encoding", "gzip"); - - if (!sott.equals("")) { - con.setRequestProperty("X-LoginRadius-Sott", sott); - } - if (!authorization.equals("")) { - con.setRequestProperty("Authorization", "Bearer " + authorization); - authorization = ""; - } - if(LoginRadiusSDK.getOriginIp()!=null && LoginRadiusSDK.getOriginIp()!="") { - con.setRequestProperty("X-Origin-IP", LoginRadiusSDK.getOriginIp()); - - } - if (!apiSecret.equals("") && LoginRadiusSDK.getRequestSigning()) { - String time = getTime(); - con.setRequestProperty("X-Request-Expires", time); - if (payload != null) { - con.setRequestProperty("digest", "SHA-256=" + encode(apiSecret, - time + ":" + URLEncoder.encode(url, encoding).toLowerCase() + ":" + payload)); - } else { - con.setRequestProperty("digest", "SHA-256=" - + encode(apiSecret, time + ":" + URLEncoder.encode(url, encoding).toLowerCase())); - } - } else if (!apiSecret.equals("") && !LoginRadiusSDK.getRequestSigning()) { - con.setRequestProperty("X-LoginRadius-ApiSecret", apiSecret); - } - con.setDoOutput(true); - if (!method.equals("GET")) { - OutputStream os = con.getOutputStream(); - OutputStreamWriter body = new OutputStreamWriter(os, encoding); - String p = payload != null ? payload : "{}"; - body.write(p); - body.flush(); - body.close(); - } - - int responseCode = con.getResponseCode(); - if (responseCode == HttpURLConnection.HTTP_OK) { - code = responseCode; - return readStream(con.getInputStream(), con.getContentEncoding()); - } else if(responseCode == 429){ - code = 106; - return "Too Many Request in a particular time frame"; - }else { - code = responseCode; - return readStream(con.getErrorStream(), con.getContentEncoding()); - } - - } catch (UnknownHostException e) { - code = 101; - return e.toString(); - } catch (IllegalArgumentException e) { - code = 102; - return e.toString(); - } catch (MalformedURLException e) { - code = 103; - return e.toString(); - } catch (SocketTimeoutException e) { - code = 104; - return e.toString(); - } catch (IOException e) { - code = 105; - return e.toString(); - } - } - - private static String readStream(InputStream in, String en) { - BufferedReader reader = null; - StringBuilder response = new StringBuilder(); - try { - if ("gzip".equals(en)) { - reader = new BufferedReader(new InputStreamReader(new GZIPInputStream(in))); - } else { - reader = new BufferedReader(new InputStreamReader(in)); - } - String line = ""; - while ((line = reader.readLine()) != null) { - response.append(line); - } - } catch (IOException e) { - e.printStackTrace(); - } finally { - if (reader != null) { - try { - reader.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - return response.toString(); - } - - public static String encode(String key, final String data) { - String s = null; - try { - Mac sha256_HMAC = Mac.getInstance("HmacSHA256"); - SecretKeySpec secret_key = new SecretKeySpec(key.getBytes(encoding), "HmacSHA256"); - sha256_HMAC.init(secret_key); - s = Base64.encodeBase64String(sha256_HMAC.doFinal(data.getBytes(encoding))); - - } catch (NoSuchAlgorithmException e) { - e.printStackTrace(); - } catch (InvalidKeyException e) { - e.printStackTrace(); - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - - return s; - } - - private static String getTime() { - TimeZone timeZone = TimeZone.getTimeZone("UTC"); - Calendar calendar = Calendar.getInstance(timeZone); - DateFormat dateFormat = new SimpleDateFormat("yyyy-M-d H:m:s", Locale.US); - dateFormat.setTimeZone(timeZone); - calendar.add(Calendar.MINUTE, 60); - return dateFormat.format(calendar.getTime()); - } - - /** - * - * Method used to add proxy settings with authentication - * - * @param host The host - * @param port The port - * @param username The username - * @param password The password - * @return The Proxy - */ - private static Proxy setProxy(String host, int port, final String username, final String password) { - - Authenticator authenticator = new Authenticator() { - - public PasswordAuthentication getPasswordAuthentication() { - - return (new PasswordAuthentication(username, password.toCharArray())); - } - }; - Authenticator.setDefault(authenticator); - - return new Proxy(Proxy.Type.HTTP, new InetSocketAddress(host, port)); - } - - /** - * - * Method used to add proxy settings without Authentication - * - * @param host The host - * @param port The port - * @return The Proxy - */ - public static Proxy setProxyWithoutAuthentication(String host, int port) { - - return new Proxy(Proxy.Type.HTTP, new InetSocketAddress(host, port)); - - } - private static ErrorResponse exception(String error) { - ErrorResponse obj = new ErrorResponse(); - switch (code) { - case 101: - obj.setDescription( - "Thrown to indicate that the IP address of a host could not be determined, Please Check your internet connection"); - obj.setErrorCode(101); - obj.setMessage("UnknownHostException"); - break; - case 102: - obj.setDescription(error); - obj.setErrorCode(102); - obj.setMessage("IllegalArgumentException"); - break; - case 103: - obj.setDescription(error); - obj.setErrorCode(103); - obj.setMessage("MalformedURLException"); - break; - case 104: - obj.setDescription(error); - obj.setErrorCode(104); - obj.setMessage("SocketTimeoutException"); - break; - case 105: - obj.setDescription(error); - obj.setErrorCode(105); - obj.setMessage("IOException"); - break; - case 106: - obj.setDescription(error); - obj.setErrorCode(106); - obj.setMessage("TOO_MANY_REQUESTS"); - break; - default: - TypeToken typeToken = new TypeToken() { - }; - obj = JsonDeserializer.deserializeJson(error, typeToken); - break; - } - - return obj; - } -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/helper/LoginRadiusValidator.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/helper/LoginRadiusValidator.java deleted file mode 100644 index cd9f3ab..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/helper/LoginRadiusValidator.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.loginradius.sdk.helper; - -public class LoginRadiusValidator { - private LoginRadiusValidator() { - } - - public static boolean isNullOrWhiteSpace(String str) { - if (str != null) { - str = str.trim(); - } - return str != null && !str.isEmpty() ? false : true; - } - - public static String getValidationMessage(final String s) { - return "The " + s + " is a Required Paramter So its can not be null or empty"; - } -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/enums/ConsentProfileActions.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/enums/ConsentProfileActions.java deleted file mode 100644 index 902200f..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/enums/ConsentProfileActions.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.enums; - -// - // Enum Consent Profile Actions type of operation on parameters like subscribe,unsubscribe,notopted - // - public enum ConsentProfileActions { - - Subscribe, - - Unsubscribe, - - NotOpted - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/enums/ConsentProfileUpdateType.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/enums/ConsentProfileUpdateType.java deleted file mode 100644 index e59ea9d..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/enums/ConsentProfileUpdateType.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.enums; - -// - // Enum Consent Profile Update Type to define the type of update - // - public enum ConsentProfileUpdateType { - - ConsentEditor, - - FormMigration, - - Default - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/enums/CustomObjectUpdateOperationType.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/enums/CustomObjectUpdateOperationType.java deleted file mode 100644 index 142b161..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/enums/CustomObjectUpdateOperationType.java +++ /dev/null @@ -1,20 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.enums; - -// - // Enum Custom Object Operation Type to define the type of update - // - public enum CustomObjectUpdateOperationType { - - Default, - - Replace, - - PartialReplace - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/enums/OperationType.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/enums/OperationType.java deleted file mode 100644 index 4c8ed13..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/enums/OperationType.java +++ /dev/null @@ -1,16 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.enums; - -// - // Enum Operation Type to define the type of operation on parameters like address, phone etc - // - public enum OperationType { - - delete - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/AccountCreateModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/AccountCreateModel.java deleted file mode 100644 index 475e344..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/AccountCreateModel.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for Account Create API - // - public class AccountCreateModel extends AuthUserRegistrationModel { - - - @SerializedName("DisableLogin") - private Boolean disableLogin; - - @SerializedName("EmailVerified") - private Boolean emailVerified; - - @SerializedName("PhoneIdVerified") - private Boolean phoneIdVerified; - - @SerializedName("PrivacyPolicy") - private PrivacyPolicy privacyPolicy; - - @SerializedName("RegistrationSource") - private String registrationSource; - - - - // - // To disable traditional login for user - // - public Boolean getDisableLogin() { - return disableLogin; - } - // - // To disable traditional login for user - // - public void setDisableLogin(Boolean disableLogin) { - this.disableLogin = disableLogin; - } - // - // boolean type value, default is true - // - public Boolean getEmailVerified() { - return emailVerified; - } - // - // boolean type value, default is true - // - public void setEmailVerified(Boolean emailVerified) { - this.emailVerified = emailVerified; - } - // - // boolean type value, default is false - // - public Boolean getPhoneIdVerified() { - return phoneIdVerified; - } - // - // boolean type value, default is false - // - public void setPhoneIdVerified(Boolean phoneIdVerified) { - this.phoneIdVerified = phoneIdVerified; - } - // - // Object type by default false, string represents Version, AcceptSource and datetime represents AcceptDateTime - // - public PrivacyPolicy getPrivacyPolicy() { - return privacyPolicy; - } - // - // Object type by default false, string represents Version, AcceptSource and datetime represents AcceptDateTime - // - public void setPrivacyPolicy(PrivacyPolicy privacyPolicy) { - this.privacyPolicy = privacyPolicy; - } - // - // URL of the webproperty from where the user is registered. - // - public String getRegistrationSource() { - return registrationSource; - } - // - // URL of the webproperty from where the user is registered. - // - public void setRegistrationSource(String registrationSource) { - this.registrationSource = registrationSource; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/AccountRoleContextModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/AccountRoleContextModel.java deleted file mode 100644 index d67d3f8..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/AccountRoleContextModel.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of RoleContext payload - // - public class AccountRoleContextModel { - - - @SerializedName("RoleContext") - private List roleContext; - - - - // - // Array of RoleContext object, see body tab for structure - // - public List getRoleContext() { - return roleContext; - } - // - // Array of RoleContext object, see body tab for structure - // - public void setRoleContext(List roleContext) { - this.roleContext = roleContext; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/AccountRolesModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/AccountRolesModel.java deleted file mode 100644 index ce3466b..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/AccountRolesModel.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for Create Role API - // - public class AccountRolesModel { - - - @SerializedName("Roles") - private List roles; - - - - // - // Array of String, which represents the role name - // - public List getRoles() { - return roles; - } - // - // Array of String, which represents the role name - // - public void setRoles(List roles) { - this.roles = roles; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/AccountUserProfileUpdateModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/AccountUserProfileUpdateModel.java deleted file mode 100644 index df06211..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/AccountUserProfileUpdateModel.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for Account Update API - // - public class AccountUserProfileUpdateModel extends UserProfileUpdateModel { - - - @SerializedName("DisableLogin") - private Boolean disableLogin; - - @SerializedName("EmailVerified") - private Boolean emailVerified; - - @SerializedName("IsActive") - private Boolean isActive; - - @SerializedName("IsDeleted") - private Boolean isDeleted; - - @SerializedName("IsLoginLocked") - private Boolean isLoginLocked; - - @SerializedName("PhoneIdVerified") - private Boolean phoneIdVerified; - - @SerializedName("PrivacyPolicy") - private PrivacyPolicy privacyPolicy; - - @SerializedName("RegistrationSource") - private String registrationSource; - - - - // - // To disable traditional login for user - // - public Boolean getDisableLogin() { - return disableLogin; - } - // - // To disable traditional login for user - // - public void setDisableLogin(Boolean disableLogin) { - this.disableLogin = disableLogin; - } - // - // boolean type value, default is true - // - public Boolean getEmailVerified() { - return emailVerified; - } - // - // boolean type value, default is true - // - public void setEmailVerified(Boolean emailVerified) { - this.emailVerified = emailVerified; - } - // - // boolean type value, default is true - // - public Boolean getIsActive() { - return isActive; - } - // - // boolean type value, default is true - // - public void setIsActive(Boolean isActive) { - this.isActive = isActive; - } - // - // boolean type value, default is true - // - public Boolean getIsDeleted() { - return isDeleted; - } - // - // boolean type value, default is true - // - public void setIsDeleted(Boolean isDeleted) { - this.isDeleted = isDeleted; - } - // - // Pass true if wants to lock the user's Login field else false. - // - public Boolean getIsLoginLocked() { - return isLoginLocked; - } - // - // Pass true if wants to lock the user's Login field else false. - // - public void setIsLoginLocked(Boolean isLoginLocked) { - this.isLoginLocked = isLoginLocked; - } - // - // boolean type value, default is false - // - public Boolean getPhoneIdVerified() { - return phoneIdVerified; - } - // - // boolean type value, default is false - // - public void setPhoneIdVerified(Boolean phoneIdVerified) { - this.phoneIdVerified = phoneIdVerified; - } - // - // Object type by default false, string represents Version, AcceptSource and datetime represents AcceptDateTime - // - public PrivacyPolicy getPrivacyPolicy() { - return privacyPolicy; - } - // - // Object type by default false, string represents Version, AcceptSource and datetime represents AcceptDateTime - // - public void setPrivacyPolicy(PrivacyPolicy privacyPolicy) { - this.privacyPolicy = privacyPolicy; - } - // - // URL of the webproperty from where the user is registered. - // - public String getRegistrationSource() { - return registrationSource; - } - // - // URL of the webproperty from where the user is registered. - // - public void setRegistrationSource(String registrationSource) { - this.registrationSource = registrationSource; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Address.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Address.java deleted file mode 100644 index deec9e8..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Address.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; -import com.loginradius.sdk.models.enums.OperationType; - - // - // Model Class containing Definition for Address Property - // - public class Address { - - - @SerializedName("Address1") - private String address1; - - @SerializedName("Address2") - private String address2; - - @SerializedName("City") - private String city; - - @SerializedName("Country") - private String country; - - @SerializedName("op") - private OperationType op; - - @SerializedName("PostalCode") - private String postalCode; - - @SerializedName("Region") - private String region; - - @SerializedName("State") - private String state; - - @SerializedName("Type") - private String type; - - - - // - // Address field value that needs to be updated - // - public String getAddress1() { - return address1; - } - // - // Address field value that needs to be updated - // - public void setAddress1(String address1) { - this.address1 = address1; - } - // - // Address field value that needs to be updated - // - public String getAddress2() { - return address2; - } - // - // Address field value that needs to be updated - // - public void setAddress2(String address2) { - this.address2 = address2; - } - // - // user's city - // - public String getCity() { - return city; - } - // - // user's city - // - public void setCity(String city) { - this.city = city; - } - // - // Country of the user - // - public String getCountry() { - return country; - } - // - // Country of the user - // - public void setCountry(String country) { - this.country = country; - } - // - // operation type - // - public OperationType getOp() { - return op; - } - // - // operation type - // - public void setOp(OperationType op) { - this.op = op; - } - // - // Postal code value that need to be updated - // - public String getPostalCode() { - return postalCode; - } - // - // Postal code value that need to be updated - // - public void setPostalCode(String postalCode) { - this.postalCode = postalCode; - } - // - // Region - // - public String getRegion() { - return region; - } - // - // Region - // - public void setRegion(String region) { - this.region = region; - } - // - // State of the user - // - public String getState() { - return state; - } - // - // State of the user - // - public void setState(String state) { - this.state = state; - } - // - // String to identify the type of parameter - // - public String getType() { - return type; - } - // - // String to identify the type of parameter - // - public void setType(String type) { - this.type = type; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/AgeRange.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/AgeRange.java deleted file mode 100644 index 09ee746..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/AgeRange.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for Age Range Property - // - public class AgeRange { - - - @SerializedName("Max") - private Integer max; - - @SerializedName("Min") - private Integer min; - - - - // - // Maximum Value Range - // - public Integer getMax() { - return max; - } - // - // Maximum Value Range - // - public void setMax(Integer max) { - this.max = max; - } - // - // Minimum Value Range - // - public Integer getMin() { - return min; - } - // - // Minimum Value Range - // - public void setMin(Integer min) { - this.min = min; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/AuthUserRegistrationModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/AuthUserRegistrationModel.java deleted file mode 100644 index 26aff71..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/AuthUserRegistrationModel.java +++ /dev/null @@ -1,1627 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.List; -import java.util.Map; - -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for Auth User Registration API - // - public class AuthUserRegistrationModel { - - - @SerializedName("About") - private String about; - - @SerializedName("AcceptPrivacyPolicy") - private Boolean acceptPrivacyPolicy; - - @SerializedName("Addresses") - private List
addresses; - - @SerializedName("Age") - private String age; - - @SerializedName("AgeRange") - private AgeRange ageRange; - - @SerializedName("Associations") - private String associations; - - @SerializedName("Awards") - private List awards; - - @SerializedName("Badges") - private List badges; - - @SerializedName("BirthDate") - private String birthDate; - - @SerializedName("Books") - private List books; - - @SerializedName("Certifications") - private List certifications; - - @SerializedName("City") - private String city; - - @SerializedName("Company") - private String company; - - @SerializedName("Consents") - private ConsentSubmitModel consents; - - @SerializedName("Country") - private Country country; - - @SerializedName("Courses") - private List courses; - - @SerializedName("CoverPhoto") - private String coverPhoto; - - @SerializedName("Currency") - private String currency; - - @SerializedName("CurrentStatus") - private List currentStatus; - - @SerializedName("CustomFields") - private Map customFields; - - @SerializedName("Educations") - private List educations; - - @SerializedName("Email") - private List email; - - @SerializedName("ExternalUserLoginId") - private String externalUserLoginId; - - @SerializedName("Family") - private List family; - - @SerializedName("Favicon") - private String favicon; - - @SerializedName("FavoriteThings") - private List favoriteThings; - - @SerializedName("FirstName") - private String firstName; - - @SerializedName("FollowersCount") - private Integer followersCount; - - @SerializedName("FriendsCount") - private Integer friendsCount; - - @SerializedName("FullName") - private String fullName; - - @SerializedName("Games") - private List games; - - @SerializedName("Gender") - private String gender; - - @SerializedName("GistsUrl") - private String gistsUrl; - - @SerializedName("GravatarImageUrl") - private String gravatarImageUrl; - - @SerializedName("Hireable") - private Boolean hireable; - - @SerializedName("HomeTown") - private String homeTown; - - @SerializedName("Honors") - private String honors; - - @SerializedName("HttpsImageUrl") - private String httpsImageUrl; - - @SerializedName("IMAccounts") - private List iMAccounts; - - @SerializedName("ImageUrl") - private String imageUrl; - - @SerializedName("Industry") - private String industry; - - @SerializedName("InspirationalPeople") - private List inspirationalPeople; - - @SerializedName("InterestedIn") - private List interestedIn; - - @SerializedName("Interests") - private List interests; - - @SerializedName("IsEmailSubscribed") - private Boolean isEmailSubscribed; - - @SerializedName("IsGeoEnabled") - private String isGeoEnabled; - - @SerializedName("IsProtected") - private Boolean isProtected; - - @SerializedName("IsTwoFactorAuthenticationEnabled") - private Boolean isTwoFactorAuthenticationEnabled; - - @SerializedName("JobBookmarks") - private List jobBookmarks; - - @SerializedName("Languages") - private List languages; - - @SerializedName("LastName") - private String lastName; - - @SerializedName("LocalCity") - private String localCity; - - @SerializedName("LocalCountry") - private String localCountry; - - @SerializedName("LocalLanguage") - private String localLanguage; - - @SerializedName("MainAddress") - private String mainAddress; - - @SerializedName("MemberUrlResources") - private List memberUrlResources; - - @SerializedName("MiddleName") - private String middleName; - - @SerializedName("Movies") - private List movies; - - @SerializedName("MutualFriends") - private List mutualFriends; - - @SerializedName("NickName") - private String nickName; - - @SerializedName("NumRecommenders") - private Integer numRecommenders; - - @SerializedName("Password") - private String password; - - @SerializedName("Patents") - private List patents; - - @SerializedName("PhoneId") - private String phoneId; - - @SerializedName("PhoneNumbers") - private List phoneNumbers; - - @SerializedName("PINInfo") - private PinModel pinInfo; - - @SerializedName("PlacesLived") - private List placesLived; - - @SerializedName("Political") - private String political; - - @SerializedName("Positions") - private List positions; - - @SerializedName("Prefix") - private String prefix; - - @SerializedName("PrivateGists") - private Integer privateGists; - - @SerializedName("ProfessionalHeadline") - private String professionalHeadline; - - @SerializedName("ProfileCity") - private String profileCity; - - @SerializedName("ProfileCountry") - private String profileCountry; - - @SerializedName("ProfileImageUrls") - private Map profileImageUrls; - - @SerializedName("ProfileName") - private String profileName; - - @SerializedName("ProfileUrl") - private String profileUrl; - - @SerializedName("Projects") - private List projects; - - @SerializedName("ProviderAccessCredential") - private ProviderAccessCredential providerAccessCredential; - - @SerializedName("Publications") - private List publications; - - @SerializedName("PublicGists") - private Integer publicGists; - - @SerializedName("PublicRepository") - private String publicRepository; - - @SerializedName("Quota") - private String quota; - - @SerializedName("RecommendationsReceived") - private List recommendationsReceived; - - @SerializedName("RelatedProfileViews") - private List relatedProfileViews; - - @SerializedName("RelationshipStatus") - private String relationshipStatus; - - @SerializedName("Religion") - private String religion; - - @SerializedName("RepositoryUrl") - private String repositoryUrl; - - @SerializedName("SecurityQuestionAnswer") - private Map securityQuestionAnswer; - - @SerializedName("Skills") - private List skills; - - @SerializedName("Sports") - private List sports; - - @SerializedName("StarredUrl") - private String starredUrl; - - @SerializedName("State") - private String state; - - @SerializedName("Subscription") - private GitHubPlan subscription; - - @SerializedName("Suffix") - private String suffix; - - @SerializedName("Suggestions") - private Suggestions suggestions; - - @SerializedName("TagLine") - private String tagLine; - - @SerializedName("TeleVisionShow") - private List teleVisionShow; - - @SerializedName("ThumbnailImageUrl") - private String thumbnailImageUrl; - - @SerializedName("TimeZone") - private String timeZone; - - @SerializedName("TotalPrivateRepository") - private Integer totalPrivateRepository; - - @SerializedName("TotalStatusesCount") - private Integer totalStatusesCount; - - @SerializedName("Uid") - private String uid; - - @SerializedName("UserName") - private String userName; - - @SerializedName("Volunteer") - private List volunteer; - - @SerializedName("WebProfiles") - private Map webProfiles; - - @SerializedName("Website") - private String website; - - - - // - // About value that need to be inserted - // - public String getAbout() { - return about; - } - // - // About value that need to be inserted - // - public void setAbout(String about) { - this.about = about; - } - // - // caption to accept the privacy policy - // - public Boolean getAcceptPrivacyPolicy() { - return acceptPrivacyPolicy; - } - // - // caption to accept the privacy policy - // - public void setAcceptPrivacyPolicy(Boolean acceptPrivacyPolicy) { - this.acceptPrivacyPolicy = acceptPrivacyPolicy; - } - // - // Array of objects,String represents address of user - // - public List
getAddresses() { - return addresses; - } - // - // Array of objects,String represents address of user - // - public void setAddresses(List
addresses) { - this.addresses = addresses; - } - // - // User's Age - // - public String getAge() { - return age; - } - // - // User's Age - // - public void setAge(String age) { - this.age = age; - } - // - // user's age range. - // - public AgeRange getAgeRange() { - return ageRange; - } - // - // user's age range. - // - public void setAgeRange(AgeRange ageRange) { - this.ageRange = ageRange; - } - // - // Organization a person is assosciated with - // - public String getAssociations() { - return associations; - } - // - // Organization a person is assosciated with - // - public void setAssociations(String associations) { - this.associations = associations; - } - // - // Array of Objects,String represents Id, Name and Issuer - // - public List getAwards() { - return awards; - } - // - // Array of Objects,String represents Id, Name and Issuer - // - public void setAwards(List awards) { - this.awards = awards; - } - // - // User's Badges. - // - public List getBadges() { - return badges; - } - // - // User's Badges. - // - public void setBadges(List badges) { - this.badges = badges; - } - // - // user's birthdate - // - public String getBirthDate() { - return birthDate; - } - // - // user's birthdate - // - public void setBirthDate(String birthDate) { - this.birthDate = birthDate; - } - // - // Array of Objects,String represents Id,Name,Category,CreatedDate - // - public List getBooks() { - return books; - } - // - // Array of Objects,String represents Id,Name,Category,CreatedDate - // - public void setBooks(List books) { - this.books = books; - } - // - // Array of Objects,string represents Id,Name,Authority Number,StartDate,EndDate - // - public List getCertifications() { - return certifications; - } - // - // Array of Objects,string represents Id,Name,Authority Number,StartDate,EndDate - // - public void setCertifications(List certifications) { - this.certifications = certifications; - } - // - // user's city - // - public String getCity() { - return city; - } - // - // user's city - // - public void setCity(String city) { - this.city = city; - } - // - // users company name - // - public String getCompany() { - return company; - } - // - // users company name - // - public void setCompany(String company) { - this.company = company; - } - // - // List of Consents - // - public ConsentSubmitModel getConsents() { - return consents; - } - // - // List of Consents - // - public void setConsents(ConsentSubmitModel consents) { - this.consents = consents; - } - // - // Country of the user - // - public Country getCountry() { - return country; - } - // - // Country of the user - // - public void setCountry(Country country) { - this.country = country; - } - // - // users course information - // - public List getCourses() { - return courses; - } - // - // users course information - // - public void setCourses(List courses) { - this.courses = courses; - } - // - // URL of the photo that need to be inserted - // - public String getCoverPhoto() { - return coverPhoto; - } - // - // URL of the photo that need to be inserted - // - public void setCoverPhoto(String coverPhoto) { - this.coverPhoto = coverPhoto; - } - // - // Currency - // - public String getCurrency() { - return currency; - } - // - // Currency - // - public void setCurrency(String currency) { - this.currency = currency; - } - // - // Array of Objects,String represents id ,Text ,Source and CreatedDate - // - public List getCurrentStatus() { - return currentStatus; - } - // - // Array of Objects,String represents id ,Text ,Source and CreatedDate - // - public void setCurrentStatus(List currentStatus) { - this.currentStatus = currentStatus; - } - // - // Custom fields as user set on LoginRadius Admin Console. - // - public Map getCustomFields() { - return customFields; - } - // - // Custom fields as user set on LoginRadius Admin Console. - // - public void setCustomFields(Map customFields) { - this.customFields = customFields; - } - // - // Array of Objects,which represents the educations record - // - public List getEducations() { - return educations; - } - // - // Array of Objects,which represents the educations record - // - public void setEducations(List educations) { - this.educations = educations; - } - // - // boolean type value, default is true - // - public List getEmail() { - return email; - } - // - // boolean type value, default is true - // - public void setEmail(List email) { - this.email = email; - } - // - // External User Login Id - // - public String getExternalUserLoginId() { - return externalUserLoginId; - } - // - // External User Login Id - // - public void setExternalUserLoginId(String externalUserLoginId) { - this.externalUserLoginId = externalUserLoginId; - } - // - // user's family - // - public List getFamily() { - return family; - } - // - // user's family - // - public void setFamily(List family) { - this.family = family; - } - // - // URL of the favicon that need to be inserted - // - public String getFavicon() { - return favicon; - } - // - // URL of the favicon that need to be inserted - // - public void setFavicon(String favicon) { - this.favicon = favicon; - } - // - // Array of Objects,strings represents Id ,Name ,Type - // - public List getFavoriteThings() { - return favoriteThings; - } - // - // Array of Objects,strings represents Id ,Name ,Type - // - public void setFavoriteThings(List favoriteThings) { - this.favoriteThings = favoriteThings; - } - // - // user's first name - // - public String getFirstName() { - return firstName; - } - // - // user's first name - // - public void setFirstName(String firstName) { - this.firstName = firstName; - } - // - // user's followers count - // - public Integer getFollowersCount() { - return followersCount; - } - // - // user's followers count - // - public void setFollowersCount(Integer followersCount) { - this.followersCount = followersCount; - } - // - // users friends count - // - public Integer getFriendsCount() { - return friendsCount; - } - // - // users friends count - // - public void setFriendsCount(Integer friendsCount) { - this.friendsCount = friendsCount; - } - // - // Users complete name - // - public String getFullName() { - return fullName; - } - // - // Users complete name - // - public void setFullName(String fullName) { - this.fullName = fullName; - } - // - // Array of Objects,string represents Id,Name,Category,CreatedDate - // - public List getGames() { - return games; - } - // - // Array of Objects,string represents Id,Name,Category,CreatedDate - // - public void setGames(List games) { - this.games = games; - } - // - // user's gender - // - public String getGender() { - return gender; - } - // - // user's gender - // - public void setGender(String gender) { - this.gender = gender; - } - // - // - // - public String getGistsUrl() { - return gistsUrl; - } - // - // - // - public void setGistsUrl(String gistsUrl) { - this.gistsUrl = gistsUrl; - } - // - // URL of image that need to be inserted - // - public String getGravatarImageUrl() { - return gravatarImageUrl; - } - // - // URL of image that need to be inserted - // - public void setGravatarImageUrl(String gravatarImageUrl) { - this.gravatarImageUrl = gravatarImageUrl; - } - // - // boolean type value, default value is true - // - public Boolean getHireable() { - return hireable; - } - // - // boolean type value, default value is true - // - public void setHireable(Boolean hireable) { - this.hireable = hireable; - } - // - // user's home town name - // - public String getHomeTown() { - return homeTown; - } - // - // user's home town name - // - public void setHomeTown(String homeTown) { - this.homeTown = homeTown; - } - // - // Awards lists from the social provider - // - public String getHonors() { - return honors; - } - // - // Awards lists from the social provider - // - public void setHonors(String honors) { - this.honors = honors; - } - // - // URL of the Image that need to be inserted - // - public String getHttpsImageUrl() { - return httpsImageUrl; - } - // - // URL of the Image that need to be inserted - // - public void setHttpsImageUrl(String httpsImageUrl) { - this.httpsImageUrl = httpsImageUrl; - } - // - // Array of objects, String represents account type and account name. - // - public List getIMAccounts() { - return iMAccounts; - } - // - // Array of objects, String represents account type and account name. - // - public void setIMAccounts(List iMAccounts) { - this.iMAccounts = iMAccounts; - } - // - // image URL should be absolute and has HTTPS domain - // - public String getImageUrl() { - return imageUrl; - } - // - // image URL should be absolute and has HTTPS domain - // - public void setImageUrl(String imageUrl) { - this.imageUrl = imageUrl; - } - // - // Industry name - // - public String getIndustry() { - return industry; - } - // - // Industry name - // - public void setIndustry(String industry) { - this.industry = industry; - } - // - // Array of Objects,string represents Id and Name - // - public List getInspirationalPeople() { - return inspirationalPeople; - } - // - // Array of Objects,string represents Id and Name - // - public void setInspirationalPeople(List inspirationalPeople) { - this.inspirationalPeople = inspirationalPeople; - } - // - // array of string represents interest - // - public List getInterestedIn() { - return interestedIn; - } - // - // array of string represents interest - // - public void setInterestedIn(List interestedIn) { - this.interestedIn = interestedIn; - } - // - // Array of objects, string shows InterestedType and InterestedName - // - public List getInterests() { - return interests; - } - // - // Array of objects, string shows InterestedType and InterestedName - // - public void setInterests(List interests) { - this.interests = interests; - } - // - // boolean type value, default is true - // - public Boolean getIsEmailSubscribed() { - return isEmailSubscribed; - } - // - // boolean type value, default is true - // - public void setIsEmailSubscribed(Boolean isEmailSubscribed) { - this.isEmailSubscribed = isEmailSubscribed; - } - // - // boolean type value, default is true - // - public String getIsGeoEnabled() { - return isGeoEnabled; - } - // - // boolean type value, default is true - // - public void setIsGeoEnabled(String isGeoEnabled) { - this.isGeoEnabled = isGeoEnabled; - } - // - // boolean type value, default is true - // - public Boolean getIsProtected() { - return isProtected; - } - // - // boolean type value, default is true - // - public void setIsProtected(Boolean isProtected) { - this.isProtected = isProtected; - } - // - // boolean type value, true if MFA enables otherwise false - // - public Boolean getIsTwoFactorAuthenticationEnabled() { - return isTwoFactorAuthenticationEnabled; - } - // - // boolean type value, true if MFA enables otherwise false - // - public void setIsTwoFactorAuthenticationEnabled(Boolean isTwoFactorAuthenticationEnabled) { - this.isTwoFactorAuthenticationEnabled = isTwoFactorAuthenticationEnabled; - } - // - // Array of Objects,Strings,boolean,object represents IsApplied,ApplyTimestamp,IsSaved,SavedTimestamp,Job - // - public List getJobBookmarks() { - return jobBookmarks; - } - // - // Array of Objects,Strings,boolean,object represents IsApplied,ApplyTimestamp,IsSaved,SavedTimestamp,Job - // - public void setJobBookmarks(List jobBookmarks) { - this.jobBookmarks = jobBookmarks; - } - // - // language known by user's - // - public List getLanguages() { - return languages; - } - // - // language known by user's - // - public void setLanguages(List languages) { - this.languages = languages; - } - // - // user's last name - // - public String getLastName() { - return lastName; - } - // - // user's last name - // - public void setLastName(String lastName) { - this.lastName = lastName; - } - // - // Local City of the user - // - public String getLocalCity() { - return localCity; - } - // - // Local City of the user - // - public void setLocalCity(String localCity) { - this.localCity = localCity; - } - // - // Local country of the user - // - public String getLocalCountry() { - return localCountry; - } - // - // Local country of the user - // - public void setLocalCountry(String localCountry) { - this.localCountry = localCountry; - } - // - // Local language of the user - // - public String getLocalLanguage() { - return localLanguage; - } - // - // Local language of the user - // - public void setLocalLanguage(String localLanguage) { - this.localLanguage = localLanguage; - } - // - // Main address of the user - // - public String getMainAddress() { - return mainAddress; - } - // - // Main address of the user - // - public void setMainAddress(String mainAddress) { - this.mainAddress = mainAddress; - } - // - // Array of Objects,String represents Url,UrlName - // - public List getMemberUrlResources() { - return memberUrlResources; - } - // - // Array of Objects,String represents Url,UrlName - // - public void setMemberUrlResources(List memberUrlResources) { - this.memberUrlResources = memberUrlResources; - } - // - // user's middle name - // - public String getMiddleName() { - return middleName; - } - // - // user's middle name - // - public void setMiddleName(String middleName) { - this.middleName = middleName; - } - // - // Array of Objects,strings represents Id,Name,Category,CreatedDate - // - public List getMovies() { - return movies; - } - // - // Array of Objects,strings represents Id,Name,Category,CreatedDate - // - public void setMovies(List movies) { - this.movies = movies; - } - // - // Array of Objects, strings represents Id,Name,FirstName,LastName,Birthday,Hometown,Link,Gender - // - public List getMutualFriends() { - return mutualFriends; - } - // - // Array of Objects, strings represents Id,Name,FirstName,LastName,Birthday,Hometown,Link,Gender - // - public void setMutualFriends(List mutualFriends) { - this.mutualFriends = mutualFriends; - } - // - // Nick name of the user - // - public String getNickName() { - return nickName; - } - // - // Nick name of the user - // - public void setNickName(String nickName) { - this.nickName = nickName; - } - // - // Count for the user profile recommended - // - public Integer getNumRecommenders() { - return numRecommenders; - } - // - // Count for the user profile recommended - // - public void setNumRecommenders(Integer numRecommenders) { - this.numRecommenders = numRecommenders; - } - // - // Password for the email - // - public String getPassword() { - return password; - } - // - // Password for the email - // - public void setPassword(String password) { - this.password = password; - } - // - // Patents Registered - // - public List getPatents() { - return patents; - } - // - // Patents Registered - // - public void setPatents(List patents) { - this.patents = patents; - } - // - // Phone ID (Unique Phone Number Identifier of the user) - // - public String getPhoneId() { - return phoneId; - } - // - // Phone ID (Unique Phone Number Identifier of the user) - // - public void setPhoneId(String phoneId) { - this.phoneId = phoneId; - } - // - // Users Phone Number - // - public List getPhoneNumbers() { - return phoneNumbers; - } - // - // Users Phone Number - // - public void setPhoneNumbers(List phoneNumbers) { - this.phoneNumbers = phoneNumbers; - } - // - // PIN Info - // - public PinModel getPINInfo() { - return pinInfo; - } - // - // PIN Info - // - public void setPINInfo(PinModel pinInfo) { - this.pinInfo = pinInfo; - } - // - // Array of Objects,strings Name and boolean IsPrimary - // - public List getPlacesLived() { - return placesLived; - } - // - // Array of Objects,strings Name and boolean IsPrimary - // - public void setPlacesLived(List placesLived) { - this.placesLived = placesLived; - } - // - // List of Political interest - // - public String getPolitical() { - return political; - } - // - // List of Political interest - // - public void setPolitical(String political) { - this.political = political; - } - // - // Array of Objects,which represents the PositionSummary,StartDate,EndDate,IsCurrent,Company,Location - // - public List getPositions() { - return positions; - } - // - // Array of Objects,which represents the PositionSummary,StartDate,EndDate,IsCurrent,Company,Location - // - public void setPositions(List positions) { - this.positions = positions; - } - // - // Prefix for FirstName - // - public String getPrefix() { - return prefix; - } - // - // Prefix for FirstName - // - public void setPrefix(String prefix) { - this.prefix = prefix; - } - // - // user private Repository Urls - // - public Integer getPrivateGists() { - return privateGists; - } - // - // user private Repository Urls - // - public void setPrivateGists(Integer privateGists) { - this.privateGists = privateGists; - } - // - // This field provide by linkedin.contain our linkedin profile headline - // - public String getProfessionalHeadline() { - return professionalHeadline; - } - // - // This field provide by linkedin.contain our linkedin profile headline - // - public void setProfessionalHeadline(String professionalHeadline) { - this.professionalHeadline = professionalHeadline; - } - // - // ProfileCity value that need to be inserted - // - public String getProfileCity() { - return profileCity; - } - // - // ProfileCity value that need to be inserted - // - public void setProfileCity(String profileCity) { - this.profileCity = profileCity; - } - // - // ProfileCountry value that need to be inserted - // - public String getProfileCountry() { - return profileCountry; - } - // - // ProfileCountry value that need to be inserted - // - public void setProfileCountry(String profileCountry) { - this.profileCountry = profileCountry; - } - // - // ProfileImageUrls that need to be inserted - // - public Map getProfileImageUrls() { - return profileImageUrls; - } - // - // ProfileImageUrls that need to be inserted - // - public void setProfileImageUrls(Map profileImageUrls) { - this.profileImageUrls = profileImageUrls; - } - // - // ProfileName value field that need to be inserted - // - public String getProfileName() { - return profileName; - } - // - // ProfileName value field that need to be inserted - // - public void setProfileName(String profileName) { - this.profileName = profileName; - } - // - // User profile url like facebook profile Url - // - public String getProfileUrl() { - return profileUrl; - } - // - // User profile url like facebook profile Url - // - public void setProfileUrl(String profileUrl) { - this.profileUrl = profileUrl; - } - // - // Array of Objects,string represents Id,Name,Summary With StartDate,EndDate,IsCurrent - // - public List getProjects() { - return projects; - } - // - // Array of Objects,string represents Id,Name,Summary With StartDate,EndDate,IsCurrent - // - public void setProjects(List projects) { - this.projects = projects; - } - // - // Object,string represents AccessToken,TokenSecret - // - public ProviderAccessCredential getProviderAccessCredential() { - return providerAccessCredential; - } - // - // Object,string represents AccessToken,TokenSecret - // - public void setProviderAccessCredential(ProviderAccessCredential providerAccessCredential) { - this.providerAccessCredential = providerAccessCredential; - } - // - // Array of Objects,string represents Id,Title,Publisher,Authors,Date,Url,Summary - // - public List getPublications() { - return publications; - } - // - // Array of Objects,string represents Id,Title,Publisher,Authors,Date,Url,Summary - // - public void setPublications(List publications) { - this.publications = publications; - } - // - // gist is a Git repository, which means that it can be forked and cloned. - // - public Integer getPublicGists() { - return publicGists; - } - // - // gist is a Git repository, which means that it can be forked and cloned. - // - public void setPublicGists(Integer publicGists) { - this.publicGists = publicGists; - } - // - // user public Repository Urls - // - public String getPublicRepository() { - return publicRepository; - } - // - // user public Repository Urls - // - public void setPublicRepository(String publicRepository) { - this.publicRepository = publicRepository; - } - // - // Quota - // - public String getQuota() { - return quota; - } - // - // Quota - // - public void setQuota(String quota) { - this.quota = quota; - } - // - // Array of Objects,string represents Id,RecommendationType,RecommendationText,Recommender - // - public List getRecommendationsReceived() { - return recommendationsReceived; - } - // - // Array of Objects,string represents Id,RecommendationType,RecommendationText,Recommender - // - public void setRecommendationsReceived(List recommendationsReceived) { - this.recommendationsReceived = recommendationsReceived; - } - // - // Array of Objects,String represents Id,FirstName,LastName - // - public List getRelatedProfileViews() { - return relatedProfileViews; - } - // - // Array of Objects,String represents Id,FirstName,LastName - // - public void setRelatedProfileViews(List relatedProfileViews) { - this.relatedProfileViews = relatedProfileViews; - } - // - // user's relationship status - // - public String getRelationshipStatus() { - return relationshipStatus; - } - // - // user's relationship status - // - public void setRelationshipStatus(String relationshipStatus) { - this.relationshipStatus = relationshipStatus; - } - // - // String shows users religion - // - public String getReligion() { - return religion; - } - // - // String shows users religion - // - public void setReligion(String religion) { - this.religion = religion; - } - // - // Repository URL - // - public String getRepositoryUrl() { - return repositoryUrl; - } - // - // Repository URL - // - public void setRepositoryUrl(String repositoryUrl) { - this.repositoryUrl = repositoryUrl; - } - // - // Valid JSON object of Unique Security Question ID and Answer of set Security Question - // - public Map getSecurityQuestionAnswer() { - return securityQuestionAnswer; - } - // - // Valid JSON object of Unique Security Question ID and Answer of set Security Question - // - public void setSecurityQuestionAnswer(Map securityQuestionAnswer) { - this.securityQuestionAnswer = securityQuestionAnswer; - } - // - // Array of objects, String represents ID and Name - // - public List getSkills() { - return skills; - } - // - // Array of objects, String represents ID and Name - // - public void setSkills(List skills) { - this.skills = skills; - } - // - // Array of objects, String represents ID and Name - // - public List getSports() { - return sports; - } - // - // Array of objects, String represents ID and Name - // - public void setSports(List sports) { - this.sports = sports; - } - // - // Git users bookmark repositories - // - public String getStarredUrl() { - return starredUrl; - } - // - // Git users bookmark repositories - // - public void setStarredUrl(String starredUrl) { - this.starredUrl = starredUrl; - } - // - // State of the user - // - public String getState() { - return state; - } - // - // State of the user - // - public void setState(String state) { - this.state = state; - } - // - // Object,string represents Name,Space,PrivateRepos,Collaborators - // - public GitHubPlan getSubscription() { - return subscription; - } - // - // Object,string represents Name,Space,PrivateRepos,Collaborators - // - public void setSubscription(GitHubPlan subscription) { - this.subscription = subscription; - } - // - // Suffix for the User. - // - public String getSuffix() { - return suffix; - } - // - // Suffix for the User. - // - public void setSuffix(String suffix) { - this.suffix = suffix; - } - // - // Object,array of objects represents CompaniestoFollow,IndustriestoFollow,NewssourcetoFollow,PeopletoFollow - // - public Suggestions getSuggestions() { - return suggestions; - } - // - // Object,array of objects represents CompaniestoFollow,IndustriestoFollow,NewssourcetoFollow,PeopletoFollow - // - public void setSuggestions(Suggestions suggestions) { - this.suggestions = suggestions; - } - // - // Tagline that need to be inserted - // - public String getTagLine() { - return tagLine; - } - // - // Tagline that need to be inserted - // - public void setTagLine(String tagLine) { - this.tagLine = tagLine; - } - // - // Array of Objects,string represents Id,Name,Category,CreatedDate - // - public List getTeleVisionShow() { - return teleVisionShow; - } - // - // Array of Objects,string represents Id,Name,Category,CreatedDate - // - public void setTeleVisionShow(List teleVisionShow) { - this.teleVisionShow = teleVisionShow; - } - // - // URL for the Thumbnail - // - public String getThumbnailImageUrl() { - return thumbnailImageUrl; - } - // - // URL for the Thumbnail - // - public void setThumbnailImageUrl(String thumbnailImageUrl) { - this.thumbnailImageUrl = thumbnailImageUrl; - } - // - // The Current Time Zone. - // - public String getTimeZone() { - return timeZone; - } - // - // The Current Time Zone. - // - public void setTimeZone(String timeZone) { - this.timeZone = timeZone; - } - // - // Total Private repository - // - public Integer getTotalPrivateRepository() { - return totalPrivateRepository; - } - // - // Total Private repository - // - public void setTotalPrivateRepository(Integer totalPrivateRepository) { - this.totalPrivateRepository = totalPrivateRepository; - } - // - // Count of Total status - // - public Integer getTotalStatusesCount() { - return totalStatusesCount; - } - // - // Count of Total status - // - public void setTotalStatusesCount(Integer totalStatusesCount) { - this.totalStatusesCount = totalStatusesCount; - } - // - // UID, the unified identifier for each user account - // - public String getUid() { - return uid; - } - // - // UID, the unified identifier for each user account - // - public void setUid(String uid) { - this.uid = uid; - } - // - // Username of the user - // - public String getUserName() { - return userName; - } - // - // Username of the user - // - public void setUserName(String userName) { - this.userName = userName; - } - // - // Array of Objects,string represents Id,Role,Organization,Cause - // - public List getVolunteer() { - return volunteer; - } - // - // Array of Objects,string represents Id,Role,Organization,Cause - // - public void setVolunteer(List volunteer) { - this.volunteer = volunteer; - } - // - // Twitter, Facebook ProfileUrls - // - public Map getWebProfiles() { - return webProfiles; - } - // - // Twitter, Facebook ProfileUrls - // - public void setWebProfiles(Map webProfiles) { - this.webProfiles = webProfiles; - } - // - // Personal Website a User has - // - public String getWebsite() { - return website; - } - // - // Personal Website a User has - // - public void setWebsite(String website) { - this.website = website; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/AuthUserRegistrationModelWithCaptcha.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/AuthUserRegistrationModelWithCaptcha.java deleted file mode 100644 index c4c372d..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/AuthUserRegistrationModelWithCaptcha.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for Auth User Registration by Recaptcha API - // - public class AuthUserRegistrationModelWithCaptcha extends AuthUserRegistrationModel { - - - @SerializedName("g-recaptcha-response") - private String g_recaptcha_response; - - @SerializedName("qq_captcha_randstr") - private String qq_captcha_randstr; - - @SerializedName("qq_captcha_ticket") - private String qq_captcha_ticket; - - @SerializedName("recaptcha_challenge_field") - private String recaptcha_challenge_field; - - @SerializedName("recaptcha_response_field") - private String recaptcha_response_field; - - - - // - // The acknowledgement received by Google in Google recaptcha authorisation process. - // - public String getG_Recaptcha_Response() { - return g_recaptcha_response; - } - // - // The acknowledgement received by Google in Google recaptcha authorisation process. - // - public void setG_Recaptcha_Response(String g_recaptcha_response) { - this.g_recaptcha_response = g_recaptcha_response; - } - // - // the value of the user's random string retrieved from the QQ captcha - // - public String getQq_Captcha_Randstr() { - return qq_captcha_randstr; - } - // - // the value of the user's random string retrieved from the QQ captcha - // - public void setQq_Captcha_Randstr(String qq_captcha_randstr) { - this.qq_captcha_randstr = qq_captcha_randstr; - } - // - // QQ Captcha ticket received from QQ in the QQ Captcha authorization process - // - public String getQq_Captcha_Ticket() { - return qq_captcha_ticket; - } - // - // QQ Captcha ticket received from QQ in the QQ Captcha authorization process - // - public void setQq_Captcha_Ticket(String qq_captcha_ticket) { - this.qq_captcha_ticket = qq_captcha_ticket; - } - // - // V1 recaptcha field (optional in case of V2 recaptcha) - // - public String getRecaptcha_challenge_field() { - return recaptcha_challenge_field; - } - // - // V1 recaptcha field (optional in case of V2 recaptcha) - // - public void setRecaptcha_challenge_field(String recaptcha_challenge_field) { - this.recaptcha_challenge_field = recaptcha_challenge_field; - } - // - // V1 recaptcha field (optional in case of V2 recaptcha) - // - public String getRecaptcha_response_field() { - return recaptcha_response_field; - } - // - // V1 recaptcha field (optional in case of V2 recaptcha) - // - public void setRecaptcha_response_field(String recaptcha_response_field) { - this.recaptcha_response_field = recaptcha_response_field; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Awards.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Awards.java deleted file mode 100644 index a154725..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Awards.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for Awards Property - // - public class Awards { - - - @SerializedName("Id") - private String id; - - @SerializedName("Issuer") - private String issuer; - - @SerializedName("Name") - private String name; - - - - // - // Id of the Awards - // - public String getId() { - return id; - } - // - // Id of the Awards - // - public void setId(String id) { - this.id = id; - } - // - // Award issuer details - // - public String getIssuer() { - return issuer; - } - // - // Award issuer details - // - public void setIssuer(String issuer) { - this.issuer = issuer; - } - // - // Award name - // - public String getName() { - return name; - } - // - // Award name - // - public void setName(String name) { - this.name = name; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Badges.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Badges.java deleted file mode 100644 index e07b081..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Badges.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for Badges Property - // - public class Badges { - - - @SerializedName("BadgeId") - private String badgeId; - - @SerializedName("BadgeMessage") - private String badgeMessage; - - @SerializedName("BageId") - private String bageId; - - @SerializedName("BageMessage") - private String bageMessage; - - @SerializedName("Description") - private String description; - - @SerializedName("ImageUrl") - private String imageUrl; - - @SerializedName("Name") - private String name; - - - - // - // Badge ID - // - public String getBadgeId() { - return badgeId; - } - // - // Badge ID - // - public void setBadgeId(String badgeId) { - this.badgeId = badgeId; - } - // - // Badge Message - // - public String getBadgeMessage() { - return badgeMessage; - } - // - // Badge Message - // - public void setBadgeMessage(String badgeMessage) { - this.badgeMessage = badgeMessage; - } - // - // Bage Id - // - public String getBageId() { - return bageId; - } - // - // Bage Id - // - public void setBageId(String bageId) { - this.bageId = bageId; - } - // - // Bage Message - // - public String getBageMessage() { - return bageMessage; - } - // - // Bage Message - // - public void setBageMessage(String bageMessage) { - this.bageMessage = bageMessage; - } - // - // detailed information - // - public String getDescription() { - return description; - } - // - // detailed information - // - public void setDescription(String description) { - this.description = description; - } - // - // image URL should be absolute and has HTTPS domain - // - public String getImageUrl() { - return imageUrl; - } - // - // image URL should be absolute and has HTTPS domain - // - public void setImageUrl(String imageUrl) { - this.imageUrl = imageUrl; - } - // - // Badge Name - // - public String getName() { - return name; - } - // - // Badge Name - // - public void setName(String name) { - this.name = name; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Books.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Books.java deleted file mode 100644 index 9a060bc..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Books.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for Books Property - // - public class Books { - - - @SerializedName("Category") - private String category; - - @SerializedName("CreatedDate") - private String createdDate; - - @SerializedName("Id") - private String id; - - @SerializedName("Name") - private String name; - - - - // - // Book category - // - public String getCategory() { - return category; - } - // - // Book category - // - public void setCategory(String category) { - this.category = category; - } - // - // Date of Creation of Profile - // - public String getCreatedDate() { - return createdDate; - } - // - // Date of Creation of Profile - // - public void setCreatedDate(String createdDate) { - this.createdDate = createdDate; - } - // - // Id of book - // - public String getId() { - return id; - } - // - // Id of book - // - public void setId(String id) { - this.id = id; - } - // - // book name - // - public String getName() { - return name; - } - // - // book name - // - public void setName(String name) { - this.name = name; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/CaptchaModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/CaptchaModel.java deleted file mode 100644 index 88e2fb5..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/CaptchaModel.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.Map; -import java.util.List; -import java.util.UUID; -import com.google.gson.JsonObject; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.*; -import com.google.gson.annotations.SerializedName; - -// -// Model Class containing Definition for ReCaptchaBodyModel Property -// -public class CaptchaModel { - - - @SerializedName("g-recaptcha-response") - private String g_recaptcha_response; - - @SerializedName("h-captcha-response") - private String h_captcha_response; - - @SerializedName("qq_captcha_randstr") - private String qq_captcha_randstr; - - @SerializedName("qq_captcha_ticket") - private String qq_captcha_ticket; - - - - // - // The acknowledgement received by Google in Google recaptcha authorisation process. - // - public String getG_Recaptcha_Response() { - return g_recaptcha_response; - } - // - // The acknowledgement received by Google in Google recaptcha authorisation process. - // - public void setG_Recaptcha_Response(String g_recaptcha_response) { - this.g_recaptcha_response = g_recaptcha_response; - } - // - // The acknowledgement received by Google in Google recaptcha authorisation process. - // - public String getH_captcha_response() { - return h_captcha_response; - } - // - // The acknowledgement received by Google in Google recaptcha authorisation process. - // - public void setH_captcha_response(String h_captcha_response) { - this.h_captcha_response = h_captcha_response; - } - // - // the value of the user's random string retrieved from the QQ captcha - // - public String getQq_Captcha_Randstr() { - return qq_captcha_randstr; - } - // - // the value of the user's random string retrieved from the QQ captcha - // - public void setQq_Captcha_Randstr(String qq_captcha_randstr) { - this.qq_captcha_randstr = qq_captcha_randstr; - } - // - // QQ Captcha ticket received from QQ in the QQ Captcha authorization process - // - public String getQq_Captcha_Ticket() { - return qq_captcha_ticket; - } - // - // QQ Captcha ticket received from QQ in the QQ Captcha authorization process - // - public void setQq_Captcha_Ticket(String qq_captcha_ticket) { - this.qq_captcha_ticket = qq_captcha_ticket; - } -} \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Certifications.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Certifications.java deleted file mode 100644 index 2c0586d..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Certifications.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for Certifications Property - // - public class Certifications { - - - @SerializedName("Authority") - private String authority; - - @SerializedName("EndDate") - private String endDate; - - @SerializedName("Id") - private String id; - - @SerializedName("Name") - private String name; - - @SerializedName("Number") - private String number; - - @SerializedName("StartDate") - private String startDate; - - - - // - // Authority of certifications - // - public String getAuthority() { - return authority; - } - // - // Authority of certifications - // - public void setAuthority(String authority) { - this.authority = authority; - } - // - // Certification end date - // - public String getEndDate() { - return endDate; - } - // - // Certification end date - // - public void setEndDate(String endDate) { - this.endDate = endDate; - } - // - // Certification id - // - public String getId() { - return id; - } - // - // Certification id - // - public void setId(String id) { - this.id = id; - } - // - // Certification name - // - public String getName() { - return name; - } - // - // Certification name - // - public void setName(String name) { - this.name = name; - } - // - // Certification number - // - public String getNumber() { - return number; - } - // - // Certification number - // - public void setNumber(String number) { - this.number = number; - } - // - // Certification start date - // - public String getStartDate() { - return startDate; - } - // - // Certification start date - // - public void setStartDate(String startDate) { - this.startDate = startDate; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ChangePINModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ChangePINModel.java deleted file mode 100644 index b689877..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ChangePINModel.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for change PIN Property - // - public class ChangePINModel { - - - @SerializedName("NewPIN") - private String newPIN; - - @SerializedName("OldPIN") - private String oldPIN; - - - - // - // New PIN of user - // - public String getNewPIN() { - return newPIN; - } - // - // New PIN of user - // - public void setNewPIN(String newPIN) { - this.newPIN = newPIN; - } - // - // Old PIN of user - // - public String getOldPIN() { - return oldPIN; - } - // - // Old PIN of user - // - public void setOldPIN(String oldPIN) { - this.oldPIN = oldPIN; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ConsentDataModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ConsentDataModel.java deleted file mode 100644 index 1c842fc..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ConsentDataModel.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model class containing defination of consent data - // - public class ConsentDataModel { - - - @SerializedName("ConsentOptionId") - private String consentOptionId; - - @SerializedName("IsAccepted") - private Boolean isAccepted; - - - - // - // Consent Option Id - // - public String getConsentOptionId() { - return consentOptionId; - } - // - // Consent Option Id - // - public void setConsentOptionId(String consentOptionId) { - this.consentOptionId = consentOptionId; - } - // - // Is Accepted - // - public Boolean getIsAccepted() { - return isAccepted; - } - // - // Is Accepted - // - public void setIsAccepted(Boolean isAccepted) { - this.isAccepted = isAccepted; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ConsentEventModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ConsentEventModel.java deleted file mode 100644 index 1fd0ea0..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ConsentEventModel.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model class containing list of consent - // - public class ConsentEventModel { - - - @SerializedName("Event") - private String event; - - @SerializedName("IsCustom") - private Boolean isCustom; - - - - // - // Allowed events: Login, Register, UpdateProfile, ResetPassword, ChangePassword, emailVerification, AddEmail, RemoveEmail, BlockAccount, DeleteAccount, SetUsername, AssignRoles, UnassignRoles, SetPassword, LinkAccount, UnlinkAccount, UpdatePhoneId, VerifyPhoneNumber, CreateCustomObject, UpdateCustomobject, DeleteCustomObject - // - public String getEvent() { - return event; - } - // - // Allowed events: Login, Register, UpdateProfile, ResetPassword, ChangePassword, emailVerification, AddEmail, RemoveEmail, BlockAccount, DeleteAccount, SetUsername, AssignRoles, UnassignRoles, SetPassword, LinkAccount, UnlinkAccount, UpdatePhoneId, VerifyPhoneNumber, CreateCustomObject, UpdateCustomobject, DeleteCustomObject - // - public void setEvent(String event) { - this.event = event; - } - // - // true/false - // - public Boolean getIsCustom() { - return isCustom; - } - // - // true/false - // - public void setIsCustom(Boolean isCustom) { - this.isCustom = isCustom; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ConsentSubmitModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ConsentSubmitModel.java deleted file mode 100644 index af99481..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ConsentSubmitModel.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // Model class containing list of multiple consent - // - public class ConsentSubmitModel { - - - @SerializedName("Data") - private List data; - - @SerializedName("Events") - private List events; - - - - // - // Data - // - public List getData() { - return data; - } - // - // Data - // - public void setData(List data) { - this.data = data; - } - // - // The event associated with the consent form - // - public List getEvents() { - return events; - } - // - // The event associated with the consent form - // - public void setEvents(List events) { - this.events = events; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ConsentUpdateModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ConsentUpdateModel.java deleted file mode 100644 index 5f675bd..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ConsentUpdateModel.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // Model class containg list of multiple consent - // - public class ConsentUpdateModel { - - - @SerializedName("Consents") - private List consents; - - - - // - // List of Consents - // - public List getConsents() { - return consents; - } - // - // List of Consents - // - public void setConsents(List consents) { - this.consents = consents; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Country.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Country.java deleted file mode 100644 index 7768870..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Country.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for Country Property - // - public class Country { - - - @SerializedName("Code") - private String code; - - @SerializedName("Name") - private String name; - - - - // - // Country code - // - public String getCode() { - return code; - } - // - // Country code - // - public void setCode(String code) { - this.code = code; - } - // - // Country name - // - public String getName() { - return name; - } - // - // Country name - // - public void setName(String name) { - this.name = name; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Courses.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Courses.java deleted file mode 100644 index 3f21904..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Courses.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for Courses Property - // - public class Courses { - - - @SerializedName("Id") - private String id; - - @SerializedName("Name") - private String name; - - @SerializedName("Number") - private String number; - - - - // - // Course id - // - public String getId() { - return id; - } - // - // Course id - // - public void setId(String id) { - this.id = id; - } - // - // Course name - // - public String getName() { - return name; - } - // - // Course name - // - public void setName(String name) { - this.name = name; - } - // - // Course number - // - public String getNumber() { - return number; - } - // - // Course number - // - public void setNumber(String number) { - this.number = number; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/CurrentStatus.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/CurrentStatus.java deleted file mode 100644 index 793385f..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/CurrentStatus.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for Current Status Property - // - public class CurrentStatus { - - - @SerializedName("CreatedDate") - private String createdDate; - - @SerializedName("Id") - private String id; - - @SerializedName("Source") - private String source; - - @SerializedName("Text") - private String text; - - - - // - // Current status created date - // - public String getCreatedDate() { - return createdDate; - } - // - // Current status created date - // - public void setCreatedDate(String createdDate) { - this.createdDate = createdDate; - } - // - // Current status id - // - public String getId() { - return id; - } - // - // Current status id - // - public void setId(String id) { - this.id = id; - } - // - // Current status source - // - public String getSource() { - return source; - } - // - // Current status source - // - public void setSource(String source) { - this.source = source; - } - // - // Current status text - // - public String getText() { - return text; - } - // - // Current status text - // - public void setText(String text) { - this.text = text; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Education.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Education.java deleted file mode 100644 index ada2576..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Education.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for Education Property - // - public class Education { - - - @SerializedName("activities") - private String activities; - - @SerializedName("degree") - private String degree; - - @SerializedName("EndDate") - private String endDate; - - @SerializedName("fieldofstudy") - private String fieldofstudy; - - @SerializedName("notes") - private String notes; - - @SerializedName("School") - private String school; - - @SerializedName("StartDate") - private String startDate; - - @SerializedName("type") - private String type; - - @SerializedName("year") - private String year; - - - - // - // Activities - // - public String getActivities() { - return activities; - } - // - // Activities - // - public void setActivities(String activities) { - this.activities = activities; - } - // - // Degree - // - public String getDegree() { - return degree; - } - // - // Degree - // - public void setDegree(String degree) { - this.degree = degree; - } - // - // Education End Date - // - public String getEndDate() { - return endDate; - } - // - // Education End Date - // - public void setEndDate(String endDate) { - this.endDate = endDate; - } - // - // Fields of study - // - public String getFieldofstudy() { - return fieldofstudy; - } - // - // Fields of study - // - public void setFieldofstudy(String fieldofstudy) { - this.fieldofstudy = fieldofstudy; - } - // - // Notes - // - public String getNotes() { - return notes; - } - // - // Notes - // - public void setNotes(String notes) { - this.notes = notes; - } - // - // School of the user - // - public String getSchool() { - return school; - } - // - // School of the user - // - public void setSchool(String school) { - this.school = school; - } - // - // Start date of Education of user - // - public String getStartDate() { - return startDate; - } - // - // Start date of Education of user - // - public void setStartDate(String startDate) { - this.startDate = startDate; - } - // - // Type - // - public String getType() { - return type; - } - // - // Type - // - public void setType(String type) { - this.type = type; - } - // - // Year of Education - // - public String getYear() { - return year; - } - // - // Year of Education - // - public void setYear(String year) { - this.year = year; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Email.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Email.java deleted file mode 100644 index 6d66c5a..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Email.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for Email Property - // - public class Email { - - - @SerializedName("Type") - private String type; - - @SerializedName("Value") - private String value; - - - - // - // type of email id - // - public String getType() { - return type; - } - // - // type of email id - // - public void setType(String type) { - this.type = type; - } - // - // Email address - // - public String getValue() { - return value; - } - // - // Email address - // - public void setValue(String value) { - this.value = value; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/EmailAuthenticationModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/EmailAuthenticationModel.java deleted file mode 100644 index bcfeedc..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/EmailAuthenticationModel.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.Map; - -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for Email Authentication API - // - public class EmailAuthenticationModel extends ReCaptchaModel { - - - @SerializedName("email") - private String email; - - @SerializedName("password") - private String password; - - @SerializedName("SecurityAnswer") - private Map securityAnswer; - - - - // - // user's email - // - public String getEmail() { - return email; - } - // - // user's email - // - public void setEmail(String email) { - this.email = email; - } - // - // Password for the email - // - public String getPassword() { - return password; - } - // - // Password for the email - // - public void setPassword(String password) { - this.password = password; - } - // - // Valid JSON object of Unique Security Question ID and Answer of set Security Question. It is only required for locked accounts when logging in. Details about this feature - // - public Map getSecurityAnswer() { - return securityAnswer; - } - // - // Valid JSON object of Unique Security Question ID and Answer of set Security Question. It is only required for locked accounts when logging in. Details about this feature - // - public void setSecurityAnswer(Map securityAnswer) { - this.securityAnswer = securityAnswer; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/EmailIdModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/EmailIdModel.java deleted file mode 100644 index 91df720..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/EmailIdModel.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // - // - public class EmailIdModel { - - - @SerializedName("EmailId") - private String emailId; - - - - // - // - // - public String getEmailId() { - return emailId; - } - // - // - // - public void setEmailId(String emailId) { - this.emailId = emailId; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/EmailModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/EmailModel.java deleted file mode 100644 index 0717348..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/EmailModel.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for EmailModel Property - // - public class EmailModel { - - - @SerializedName("Type") - private String type; - - @SerializedName("Value") - private String value; - - - - // - // String to identify the type of parameter - // - public String getType() { - return type; - } - // - // String to identify the type of parameter - // - public void setType(String type) { - this.type = type; - } - // - // Value of the dropdown member - // - public String getValue() { - return value; - } - // - // Value of the dropdown member - // - public void setValue(String value) { - this.value = value; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/EmailVerificationByOtpModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/EmailVerificationByOtpModel.java deleted file mode 100644 index 5e1807d..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/EmailVerificationByOtpModel.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for EmailVerificationByOtpModel API - // - public class EmailVerificationByOtpModel extends LockoutModel { - - - @SerializedName("Email") - private String email; - - @SerializedName("Otp") - private String otp; - - @SerializedName("uuid") - private String uuid; - - - - // - // user's email - // - public String getEmail() { - return email; - } - // - // user's email - // - public void setEmail(String email) { - this.email = email; - } - // - // The Verification Code - // - public String getOtp() { - return otp; - } - // - // The Verification Code - // - public void setOtp(String otp) { - this.otp = otp; - } - // - // The uuid received in the response - // - public String getUuid() { - return uuid; - } - // - // The uuid received in the response - // - public void setUuid(String uuid) { - this.uuid = uuid; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/EventBasedMultiFactorToken.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/EventBasedMultiFactorToken.java deleted file mode 100644 index dc5f4fb..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/EventBasedMultiFactorToken.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for SecondFactorValidationToken - // - public class EventBasedMultiFactorToken { - - - @SerializedName("SecondFactorValidationToken") - private String secondFactorValidationToken; - - - - // - // second factor validation token - // - public String getSecondFactorValidationToken() { - return secondFactorValidationToken; - } - // - // second factor validation token - // - public void setSecondFactorValidationToken(String secondFactorValidationToken) { - this.secondFactorValidationToken = secondFactorValidationToken; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ExternalIds.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ExternalIds.java deleted file mode 100644 index 72cc12d..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ExternalIds.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; -import com.loginradius.sdk.models.enums.OperationType; - - // - // Model Class containing Definition for Externallds Property - // - public class ExternalIds { - - - @SerializedName("Op") - private OperationType op; - - @SerializedName("Source") - private String source; - - @SerializedName("SourceId") - private String sourceId; - - - - // - // Languages operation Type - // - public OperationType getOp() { - return op; - } - // - // Languages operation Type - // - public void setOp(OperationType op) { - this.op = op; - } - // - // ExternalId source - // - public String getSource() { - return source; - } - // - // ExternalId source - // - public void setSource(String source) { - this.source = source; - } - // - // External source id - // - public String getSourceId() { - return sourceId; - } - // - // External source id - // - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Family.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Family.java deleted file mode 100644 index b097a0e..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Family.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for Family Property - // - public class Family { - - - @SerializedName("Id") - private String id; - - @SerializedName("Name") - private String name; - - @SerializedName("Relationship") - private String relationship; - - - - // - // Family id - // - public String getId() { - return id; - } - // - // Family id - // - public void setId(String id) { - this.id = id; - } - // - // Family name - // - public String getName() { - return name; - } - // - // Family name - // - public void setName(String name) { - this.name = name; - } - // - // Family relationship - // - public String getRelationship() { - return relationship; - } - // - // Family relationship - // - public void setRelationship(String relationship) { - this.relationship = relationship; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/FavoriteThings.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/FavoriteThings.java deleted file mode 100644 index a376c9f..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/FavoriteThings.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for FavoriteThings Property - // - public class FavoriteThings { - - - @SerializedName("Id") - private String id; - - @SerializedName("Name") - private String name; - - @SerializedName("Type") - private String type; - - - - // - // Id of favorite things - // - public String getId() { - return id; - } - // - // Id of favorite things - // - public void setId(String id) { - this.id = id; - } - // - // Name of favorite things - // - public String getName() { - return name; - } - // - // Name of favorite things - // - public void setName(String name) { - this.name = name; - } - // - // Type of favorite things - // - public String getType() { - return type; - } - // - // Type of favorite things - // - public void setType(String type) { - this.type = type; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ForgotPINLinkByEmailModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ForgotPINLinkByEmailModel.java deleted file mode 100644 index f7da81a..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ForgotPINLinkByEmailModel.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for Forgot Pin Link By Email API - // - public class ForgotPINLinkByEmailModel { - - - @SerializedName("Email") - private String email; - - - - // - // user's email - // - public String getEmail() { - return email; - } - // - // user's email - // - public void setEmail(String email) { - this.email = email; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ForgotPINLinkByUserNameModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ForgotPINLinkByUserNameModel.java deleted file mode 100644 index 3920bd6..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ForgotPINLinkByUserNameModel.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for Forgot Pin Link By UserName API - // - public class ForgotPINLinkByUserNameModel { - - - @SerializedName("UserName") - private String userName; - - - - // - // Username of the user - // - public String getUserName() { - return userName; - } - // - // Username of the user - // - public void setUserName(String userName) { - this.userName = userName; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ForgotPINOtpByPhoneModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ForgotPINOtpByPhoneModel.java deleted file mode 100644 index f2ea9db..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ForgotPINOtpByPhoneModel.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for Forgot Pin Otp By Phone API - // - public class ForgotPINOtpByPhoneModel { - - - @SerializedName("Phone") - private String phone; - - - - // - // New Phone Number - // - public String getPhone() { - return phone; - } - // - // New Phone Number - // - public void setPhone(String phone) { - this.phone = phone; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Games.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Games.java deleted file mode 100644 index e7b5c30..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Games.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for Games Property - // - public class Games { - - - @SerializedName("Category") - private String category; - - @SerializedName("CreatedDate") - private String createdDate; - - @SerializedName("Id") - private String id; - - @SerializedName("Name") - private String name; - - - - // - // Category of game - // - public String getCategory() { - return category; - } - // - // Category of game - // - public void setCategory(String category) { - this.category = category; - } - // - // Game created date - // - public String getCreatedDate() { - return createdDate; - } - // - // Game created date - // - public void setCreatedDate(String createdDate) { - this.createdDate = createdDate; - } - // - // Id of game - // - public String getId() { - return id; - } - // - // Id of game - // - public void setId(String id) { - this.id = id; - } - // - // Game name - // - public String getName() { - return name; - } - // - // Game name - // - public void setName(String name) { - this.name = name; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/GitHubPlan.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/GitHubPlan.java deleted file mode 100644 index 0c1f0f5..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/GitHubPlan.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for GitHubPlan Property - // - public class GitHubPlan { - - - @SerializedName("Collaborators") - private String collaborators; - - @SerializedName("Name") - private String name; - - @SerializedName("PrivateRepos") - private String privateRepos; - - @SerializedName("Space") - private String space; - - - - // - // Github plan collaborators - // - public String getCollaborators() { - return collaborators; - } - // - // Github plan collaborators - // - public void setCollaborators(String collaborators) { - this.collaborators = collaborators; - } - // - // Github plan name - // - public String getName() { - return name; - } - // - // Github plan name - // - public void setName(String name) { - this.name = name; - } - // - // Private repos of github - // - public String getPrivateRepos() { - return privateRepos; - } - // - // Private repos of github - // - public void setPrivateRepos(String privateRepos) { - this.privateRepos = privateRepos; - } - // - // Github plan space - // - public String getSpace() { - return space; - } - // - // Github plan space - // - public void setSpace(String space) { - this.space = space; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/IMAccount.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/IMAccount.java deleted file mode 100644 index abf9575..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/IMAccount.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for IMAccount Property - // - public class IMAccount { - - - @SerializedName("AccountName") - private String accountName; - - @SerializedName("AccountType") - private String accountType; - - - - // - // Name of account - // - public String getAccountName() { - return accountName; - } - // - // Name of account - // - public void setAccountName(String accountName) { - this.accountName = accountName; - } - // - // Type of account - // - public String getAccountType() { - return accountType; - } - // - // Type of account - // - public void setAccountType(String accountType) { - this.accountType = accountType; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/InspirationalPeople.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/InspirationalPeople.java deleted file mode 100644 index 188d566..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/InspirationalPeople.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for InspirationalPeople Property - // - public class InspirationalPeople { - - - @SerializedName("Id") - private String id; - - @SerializedName("Name") - private String name; - - - - // - // ID of inspirational people - // - public String getId() { - return id; - } - // - // ID of inspirational people - // - public void setId(String id) { - this.id = id; - } - // - // name of inspirational people - // - public String getName() { - return name; - } - // - // name of inspirational people - // - public void setName(String name) { - this.name = name; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Interests.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Interests.java deleted file mode 100644 index 4432c76..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Interests.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for Interests Property - // - public class Interests { - - - @SerializedName("InterestedName") - private String interestedName; - - @SerializedName("InterestedType") - private String interestedType; - - - - // - // Name of interested - // - public String getInterestedName() { - return interestedName; - } - // - // Name of interested - // - public void setInterestedName(String interestedName) { - this.interestedName = interestedName; - } - // - // Type of interested - // - public String getInterestedType() { - return interestedType; - } - // - // Type of interested - // - public void setInterestedType(String interestedType) { - this.interestedType = interestedType; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Job.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Job.java deleted file mode 100644 index 1290e91..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Job.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for Job Property - // - public class Job { - - - @SerializedName("Active") - private Boolean active; - - @SerializedName("Company") - private JobBookmarkCompany company; - - @SerializedName("DescriptionSnippet") - private String descriptionSnippet; - - @SerializedName("Id") - private String id; - - @SerializedName("Position") - private JobBookmarkPosition position; - - @SerializedName("PostingTimestamp") - private String postingTimestamp; - - - - // - // Is active or not - // - public Boolean getActive() { - return active; - } - // - // Is active or not - // - public void setActive(Boolean active) { - this.active = active; - } - // - // Job company - // - public JobBookmarkCompany getCompany() { - return company; - } - // - // Job company - // - public void setCompany(JobBookmarkCompany company) { - this.company = company; - } - // - // Job description - // - public String getDescriptionSnippet() { - return descriptionSnippet; - } - // - // Job description - // - public void setDescriptionSnippet(String descriptionSnippet) { - this.descriptionSnippet = descriptionSnippet; - } - // - // Job id - // - public String getId() { - return id; - } - // - // Job id - // - public void setId(String id) { - this.id = id; - } - // - // Position of job - // - public JobBookmarkPosition getPosition() { - return position; - } - // - // Position of job - // - public void setPosition(JobBookmarkPosition position) { - this.position = position; - } - // - // Job posting timestamp - // - public String getPostingTimestamp() { - return postingTimestamp; - } - // - // Job posting timestamp - // - public void setPostingTimestamp(String postingTimestamp) { - this.postingTimestamp = postingTimestamp; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/JobBookmarkCompany.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/JobBookmarkCompany.java deleted file mode 100644 index df1e16b..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/JobBookmarkCompany.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for JobBookmarkCompany Property - // - public class JobBookmarkCompany { - - - @SerializedName("Id") - private String id; - - @SerializedName("Name") - private String name; - - - - // - // Company id - // - public String getId() { - return id; - } - // - // Company id - // - public void setId(String id) { - this.id = id; - } - // - // Company name - // - public String getName() { - return name; - } - // - // Company name - // - public void setName(String name) { - this.name = name; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/JobBookmarkPosition.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/JobBookmarkPosition.java deleted file mode 100644 index 2395a5d..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/JobBookmarkPosition.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for JobBookmarkPosition Property - // - public class JobBookmarkPosition { - - - @SerializedName("Title") - private String title; - - - - // - // Position title - // - public String getTitle() { - return title; - } - // - // Position title - // - public void setTitle(String title) { - this.title = title; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/JobBookmarks.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/JobBookmarks.java deleted file mode 100644 index 9135bad..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/JobBookmarks.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for JobBookmarks Property - // - public class JobBookmarks { - - - @SerializedName("ApplyTimestamp") - private String applyTimestamp; - - @SerializedName("IsApplied") - private Boolean isApplied; - - @SerializedName("IsSaved") - private Boolean isSaved; - - @SerializedName("Job") - private Job job; - - @SerializedName("SavedTimestamp") - private String savedTimestamp; - - - - // - // Job Bookmarks Apply Timestamp - // - public String getApplyTimestamp() { - return applyTimestamp; - } - // - // Job Bookmarks Apply Timestamp - // - public void setApplyTimestamp(String applyTimestamp) { - this.applyTimestamp = applyTimestamp; - } - // - // Job bookmark is applied or not - // - public Boolean getIsApplied() { - return isApplied; - } - // - // Job bookmark is applied or not - // - public void setIsApplied(Boolean isApplied) { - this.isApplied = isApplied; - } - // - // Job bookmark is saved or not - // - public Boolean getIsSaved() { - return isSaved; - } - // - // Job bookmark is saved or not - // - public void setIsSaved(Boolean isSaved) { - this.isSaved = isSaved; - } - // - // Job - // - public Job getJob() { - return job; - } - // - // Job - // - public void setJob(Job job) { - this.job = job; - } - // - // Saved time stamp of Job bookmarks - // - public String getSavedTimestamp() { - return savedTimestamp; - } - // - // Saved time stamp of Job bookmarks - // - public void setSavedTimestamp(String savedTimestamp) { - this.savedTimestamp = savedTimestamp; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Languages.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Languages.java deleted file mode 100644 index 9e7e001..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Languages.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; -import com.loginradius.sdk.models.enums.OperationType; - - // - // Model Class containing Definition for Languages Property - // - public class Languages { - - - @SerializedName("Id") - private String id; - - @SerializedName("Name") - private String name; - - @SerializedName("Op") - private OperationType op; - - @SerializedName("Proficiency") - private String proficiency; - - - - // - // Language id - // - public String getId() { - return id; - } - // - // Language id - // - public void setId(String id) { - this.id = id; - } - // - // Name of language - // - public String getName() { - return name; - } - // - // Name of language - // - public void setName(String name) { - this.name = name; - } - // - // Languages operation Type - // - public OperationType getOp() { - return op; - } - // - // Languages operation Type - // - public void setOp(OperationType op) { - this.op = op; - } - // - // Proficiency in language - // - public String getProficiency() { - return proficiency; - } - // - // Proficiency in language - // - public void setProficiency(String proficiency) { - this.proficiency = proficiency; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/LockoutModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/LockoutModel.java deleted file mode 100644 index 588d7da..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/LockoutModel.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.Map; - -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for LockoutModel Property - // - public class LockoutModel extends ReCaptchaModel { - - - @SerializedName("SecurityAnswer") - private Map securityAnswer; - - - - // - // Valid JSON object of Unique Security Question ID and Answer of set Security Question. It is only required for locked accounts when logging in. Details about this feature - // - public Map getSecurityAnswer() { - return securityAnswer; - } - // - // Valid JSON object of Unique Security Question ID and Answer of set Security Question. It is only required for locked accounts when logging in. Details about this feature - // - public void setSecurityAnswer(Map securityAnswer) { - this.securityAnswer = securityAnswer; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/LoginByPINModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/LoginByPINModel.java deleted file mode 100644 index f816078..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/LoginByPINModel.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for LoginByPin API - // - public class LoginByPINModel { - - - @SerializedName("PIN") - private String pin; - - - - // - // PIN of user - // - public String getPIN() { - return pin; - } - // - // PIN of user - // - public void setPIN(String pin) { - this.pin = pin; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Memberurlresources.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Memberurlresources.java deleted file mode 100644 index 25d3585..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Memberurlresources.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for Memberurlresources Property - // - public class Memberurlresources { - - - @SerializedName("Url") - private String url; - - @SerializedName("UrlName") - private String urlName; - - - - // - // String represents website url - // - public String getUrl() { - return url; - } - // - // String represents website url - // - public void setUrl(String url) { - this.url = url; - } - // - // URL name - // - public String getUrlName() { - return urlName; - } - // - // URL name - // - public void setUrlName(String urlName) { - this.urlName = urlName; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Movies.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Movies.java deleted file mode 100644 index de2569f..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Movies.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for Movies Property - // - public class Movies { - - - @SerializedName("Category") - private String category; - - @SerializedName("CreatedDate") - private String createdDate; - - @SerializedName("Id") - private String id; - - @SerializedName("Name") - private String name; - - - - // - // Category of movie - // - public String getCategory() { - return category; - } - // - // Category of movie - // - public void setCategory(String category) { - this.category = category; - } - // - // Movie created date - // - public String getCreatedDate() { - return createdDate; - } - // - // Movie created date - // - public void setCreatedDate(String createdDate) { - this.createdDate = createdDate; - } - // - // Id of movie - // - public String getId() { - return id; - } - // - // Id of movie - // - public void setId(String id) { - this.id = id; - } - // - // Name of movie - // - public String getName() { - return name; - } - // - // Name of movie - // - public void setName(String name) { - this.name = name; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/MultiEmailToken.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/MultiEmailToken.java deleted file mode 100644 index 0169bb7..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/MultiEmailToken.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for Multipurpose Email Token Generation API - // - public class MultiEmailToken { - - - @SerializedName("clientguid") - private String clientguid; - - @SerializedName("Email") - private String email; - - @SerializedName("Name") - private String name; - - @SerializedName("Type") - private String type; - - @SerializedName("Uid") - private String uid; - - @SerializedName("UserName") - private String userName; - - - - // - // Unique ID generated by client - // - public String getClientguid() { - return clientguid; - } - // - // Unique ID generated by client - // - public void setClientguid(String clientguid) { - this.clientguid = clientguid; - } - // - // user's email - // - public String getEmail() { - return email; - } - // - // user's email - // - public void setEmail(String email) { - this.email = email; - } - // - // Name of the customer - // - public String getName() { - return name; - } - // - // Name of the customer - // - public void setName(String name) { - this.name = name; - } - // - // String to identify the type of parameter - // - public String getType() { - return type; - } - // - // String to identify the type of parameter - // - public void setType(String type) { - this.type = type; - } - // - // UID, the unified identifier for each user account - // - public String getUid() { - return uid; - } - // - // UID, the unified identifier for each user account - // - public void setUid(String uid) { - this.uid = uid; - } - // - // Username of the user - // - public String getUserName() { - return userName; - } - // - // Username of the user - // - public void setUserName(String userName) { - this.userName = userName; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/MultiFactorAuthModelByAuthenticatorCode.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/MultiFactorAuthModelByAuthenticatorCode.java deleted file mode 100644 index 13fb694..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/MultiFactorAuthModelByAuthenticatorCode.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for MultiFactorAuthModel By Authenticator Code API - // - public class MultiFactorAuthModelByAuthenticatorCode { - - - @SerializedName("AuthenticatorCode") - private String authenticatorCode; - - - - // - // The code generated by authenticator app after scanning QR code - // - public String getAuthenticatorCode() { - return authenticatorCode; - } - // - // The code generated by authenticator app after scanning QR code - // - public void setAuthenticatorCode(String authenticatorCode) { - this.authenticatorCode = authenticatorCode; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/MultiFactorAuthModelByAuthenticatorCodeSecurityAnswer.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/MultiFactorAuthModelByAuthenticatorCodeSecurityAnswer.java deleted file mode 100644 index 790616b..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/MultiFactorAuthModelByAuthenticatorCodeSecurityAnswer.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.Map; - -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for MultiFactorAuthModel By Authenticator Code API with security answer - // - public class MultiFactorAuthModelByAuthenticatorCodeSecurityAnswer extends MultiFactorAuthModelByAuthenticatorCode { - - - @SerializedName("SecurityAnswer") - private Map securityAnswer; - - - - // - // Valid JSON object of Unique Security Question ID and Answer of set Security Question. It is only required for locked accounts when logging in. Details about this feature - // - public Map getSecurityAnswer() { - return securityAnswer; - } - // - // Valid JSON object of Unique Security Question ID and Answer of set Security Question. It is only required for locked accounts when logging in. Details about this feature - // - public void setSecurityAnswer(Map securityAnswer) { - this.securityAnswer = securityAnswer; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/MultiFactorAuthModelByBackupCode.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/MultiFactorAuthModelByBackupCode.java deleted file mode 100644 index e43c77d..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/MultiFactorAuthModelByBackupCode.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for MultiFactorAuth By BackupCode API - // - public class MultiFactorAuthModelByBackupCode { - - - @SerializedName("BackupCode") - private String backupCode; - - - - // - // The Code generated as a recourse - // - public String getBackupCode() { - return backupCode; - } - // - // The Code generated as a recourse - // - public void setBackupCode(String backupCode) { - this.backupCode = backupCode; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/MultiFactorAuthModelByEmailOtp.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/MultiFactorAuthModelByEmailOtp.java deleted file mode 100644 index c1fafa0..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/MultiFactorAuthModelByEmailOtp.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // - // - public class MultiFactorAuthModelByEmailOtp { - - - @SerializedName("EmailId") - private String emailId; - - @SerializedName("Otp") - private String otp; - - - - // - // - // - public String getEmailId() { - return emailId; - } - // - // - // - public void setEmailId(String emailId) { - this.emailId = emailId; - } - // - // - // - public String getOtp() { - return otp; - } - // - // - // - public void setOtp(String otp) { - this.otp = otp; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/MultiFactorAuthModelByEmailOtpWithLockout.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/MultiFactorAuthModelByEmailOtpWithLockout.java deleted file mode 100644 index d6b7908..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/MultiFactorAuthModelByEmailOtpWithLockout.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // - // - public class MultiFactorAuthModelByEmailOtpWithLockout extends LockoutModel { - - - @SerializedName("EmailId") - private String emailId; - - @SerializedName("Otp") - private String otp; - - - - // - // - // - public String getEmailId() { - return emailId; - } - // - // - // - public void setEmailId(String emailId) { - this.emailId = emailId; - } - // - // - // - public String getOtp() { - return otp; - } - // - // - // - public void setOtp(String otp) { - this.otp = otp; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/MultiFactorAuthModelWithLockout.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/MultiFactorAuthModelWithLockout.java deleted file mode 100644 index 8e54756..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/MultiFactorAuthModelWithLockout.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for MultiFactorAuthModel With Lockout API - // - public class MultiFactorAuthModelWithLockout extends LockoutModel { - - - @SerializedName("Otp") - private String otp; - - - - // - // The Verification Code - // - public String getOtp() { - return otp; - } - // - // The Verification Code - // - public void setOtp(String otp) { - this.otp = otp; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/MultiSmsOtp.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/MultiSmsOtp.java deleted file mode 100644 index 5a177b2..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/MultiSmsOtp.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // - // - public class MultiSmsOtp { - - - @SerializedName("Name") - private String name; - - @SerializedName("Phone") - private String phone; - - @SerializedName("Uid") - private String uid; - - - - // - // - // - public String getName() { - return name; - } - // - // - // - public void setName(String name) { - this.name = name; - } - // - // - // - public String getPhone() { - return phone; - } - // - // - // - public void setPhone(String phone) { - this.phone = phone; - } - // - // - // - public String getUid() { - return uid; - } - // - // - // - public void setUid(String uid) { - this.uid = uid; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/MutualFriends.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/MutualFriends.java deleted file mode 100644 index b977205..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/MutualFriends.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for MutualFriends Property - // - public class MutualFriends { - - - @SerializedName("Birthday") - private String birthday; - - @SerializedName("FirstName") - private String firstName; - - @SerializedName("Gender") - private String gender; - - @SerializedName("Hometown") - private String hometown; - - @SerializedName("Id") - private String id; - - @SerializedName("LastName") - private String lastName; - - @SerializedName("Link") - private String link; - - @SerializedName("Name") - private String name; - - - - // - // Birthday of mutual friend - // - public String getBirthday() { - return birthday; - } - // - // Birthday of mutual friend - // - public void setBirthday(String birthday) { - this.birthday = birthday; - } - // - // first name of mutual friend - // - public String getFirstName() { - return firstName; - } - // - // first name of mutual friend - // - public void setFirstName(String firstName) { - this.firstName = firstName; - } - // - // Gender of mutual friend - // - public String getGender() { - return gender; - } - // - // Gender of mutual friend - // - public void setGender(String gender) { - this.gender = gender; - } - // - // Hometown of mutual friend - // - public String getHometown() { - return hometown; - } - // - // Hometown of mutual friend - // - public void setHometown(String hometown) { - this.hometown = hometown; - } - // - // Id of mutual friend - // - public String getId() { - return id; - } - // - // Id of mutual friend - // - public void setId(String id) { - this.id = id; - } - // - // Last name of mutual friend - // - public String getLastName() { - return lastName; - } - // - // Last name of mutual friend - // - public void setLastName(String lastName) { - this.lastName = lastName; - } - // - // Link of mutual friend - // - public String getLink() { - return link; - } - // - // Link of mutual friend - // - public void setLink(String link) { - this.link = link; - } - // - // Name of mutual friend - // - public String getName() { - return name; - } - // - // Name of mutual friend - // - public void setName(String name) { - this.name = name; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/NameId.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/NameId.java deleted file mode 100644 index 1d1a011..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/NameId.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for NameId Property - // - public class NameId { - - - @SerializedName("Id") - private String id; - - @SerializedName("Name") - private String name; - - - - // - // Id - // - public String getId() { - return id; - } - // - // Id - // - public void setId(String id) { - this.id = id; - } - // - // Name - // - public String getName() { - return name; - } - // - // Name - // - public void setName(String name) { - this.name = name; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/OneTouchLoginByEmailModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/OneTouchLoginByEmailModel.java deleted file mode 100644 index ed7548a..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/OneTouchLoginByEmailModel.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for OneTouchLogin By EmailModel API - // - public class OneTouchLoginByEmailModel extends ReCaptchaBodyModel { - - - @SerializedName("clientguid") - private String clientguid; - - @SerializedName("Email") - private String email; - - @SerializedName("Name") - private String name; - - - - // - // Unique ID generated by client - // - public String getClientguid() { - return clientguid; - } - // - // Unique ID generated by client - // - public void setClientguid(String clientguid) { - this.clientguid = clientguid; - } - // - // user's email - // - public String getEmail() { - return email; - } - // - // user's email - // - public void setEmail(String email) { - this.email = email; - } - // - // Name of the customer - // - public String getName() { - return name; - } - // - // Name of the customer - // - public void setName(String name) { - this.name = name; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/OneTouchLoginByPhoneModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/OneTouchLoginByPhoneModel.java deleted file mode 100644 index 59895f0..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/OneTouchLoginByPhoneModel.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for OneTouchLogin By PhoneModel API - // - public class OneTouchLoginByPhoneModel extends ReCaptchaBodyModel { - - - @SerializedName("Name") - private String name; - - @SerializedName("Phone") - private String phone; - - - - // - // Name of the customer - // - public String getName() { - return name; - } - // - // Name of the customer - // - public void setName(String name) { - this.name = name; - } - // - // New Phone Number - // - public String getPhone() { - return phone; - } - // - // New Phone Number - // - public void setPhone(String phone) { - this.phone = phone; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/OptionalReCaptchaModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/OptionalReCaptchaModel.java deleted file mode 100644 index 68ad74f..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/OptionalReCaptchaModel.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; - -// - // Model Class containing Definition for OptionalReCaptcha Property - // - public class OptionalReCaptchaModel extends ReCaptchaModel { - - - - - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PINAuthEventBasedAuthModelWithLockout.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PINAuthEventBasedAuthModelWithLockout.java deleted file mode 100644 index e190877..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PINAuthEventBasedAuthModelWithLockout.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for PIN - // - public class PINAuthEventBasedAuthModelWithLockout { - - - @SerializedName("PIN") - private String pin; - - - - // - // PIN of user - // - public String getPIN() { - return pin; - } - // - // PIN of user - // - public void setPIN(String pin) { - this.pin = pin; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PINRequiredModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PINRequiredModel.java deleted file mode 100644 index dd01b28..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PINRequiredModel.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for PIN - // - public class PINRequiredModel { - - - @SerializedName("PIN") - private String pin; - - - - // - // PIN of user - // - public String getPIN() { - return pin; - } - // - // PIN of user - // - public void setPIN(String pin) { - this.pin = pin; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PasswordEventBasedAuthModelWithLockout.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PasswordEventBasedAuthModelWithLockout.java deleted file mode 100644 index c045d3c..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PasswordEventBasedAuthModelWithLockout.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for PasswordEventBasedAuthModel with Lockout API - // - public class PasswordEventBasedAuthModelWithLockout extends LockoutModel { - - - @SerializedName("password") - private String password; - - - - // - // Password for the email - // - public String getPassword() { - return password; - } - // - // Password for the email - // - public void setPassword(String password) { - this.password = password; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PasswordLessLoginByEmailAndOtpModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PasswordLessLoginByEmailAndOtpModel.java deleted file mode 100644 index abb44d7..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PasswordLessLoginByEmailAndOtpModel.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // - // - public class PasswordLessLoginByEmailAndOtpModel { - - - @SerializedName("Email") - private String email; - - @SerializedName("Otp") - private String otp; - - @SerializedName("welcomeEmailTemplate") - private String welcomeEmailTemplate; - - - - // - // - // - public String getEmail() { - return email; - } - // - // - // - public void setEmail(String email) { - this.email = email; - } - // - // - // - public String getOtp() { - return otp; - } - // - // - // - public void setOtp(String otp) { - this.otp = otp; - } - // - // - // - public String getWelcomeEmailTemplate() { - return welcomeEmailTemplate; - } - // - // - // - public void setWelcomeEmailTemplate(String welcomeEmailTemplate) { - this.welcomeEmailTemplate = welcomeEmailTemplate; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PasswordLessLoginByUserNameAndOtpModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PasswordLessLoginByUserNameAndOtpModel.java deleted file mode 100644 index f25d787..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PasswordLessLoginByUserNameAndOtpModel.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // - // - public class PasswordLessLoginByUserNameAndOtpModel { - - - @SerializedName("Otp") - private String otp; - - @SerializedName("UserName") - private String userName; - - @SerializedName("welcomeEmailTemplate") - private String welcomeEmailTemplate; - - - - // - // - // - public String getOtp() { - return otp; - } - // - // - // - public void setOtp(String otp) { - this.otp = otp; - } - // - // - // - public String getUserName() { - return userName; - } - // - // - // - public void setUserName(String userName) { - this.userName = userName; - } - // - // - // - public String getWelcomeEmailTemplate() { - return welcomeEmailTemplate; - } - // - // - // - public void setWelcomeEmailTemplate(String welcomeEmailTemplate) { - this.welcomeEmailTemplate = welcomeEmailTemplate; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PasswordLessLoginOtpModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PasswordLessLoginOtpModel.java deleted file mode 100644 index 7c7d459..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PasswordLessLoginOtpModel.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for PasswordLessLoginOtpModel API - // - public class PasswordLessLoginOtpModel extends LockoutModel { - - - @SerializedName("Otp") - private String otp; - - @SerializedName("Phone") - private String phone; - - - - // - // The Verification Code - // - public String getOtp() { - return otp; - } - // - // The Verification Code - // - public void setOtp(String otp) { - this.otp = otp; - } - // - // New Phone Number - // - public String getPhone() { - return phone; - } - // - // New Phone Number - // - public void setPhone(String phone) { - this.phone = phone; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Patents.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Patents.java deleted file mode 100644 index a088861..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Patents.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for Patents Property - // - public class Patents { - - - @SerializedName("Date") - private String date; - - @SerializedName("Id") - private String id; - - @SerializedName("Title") - private String title; - - - - // - // Date of patents - // - public String getDate() { - return date; - } - // - // Date of patents - // - public void setDate(String date) { - this.date = date; - } - // - // Id of the patents - // - public String getId() { - return id; - } - // - // Id of the patents - // - public void setId(String id) { - this.id = id; - } - // - // Title of the patents - // - public String getTitle() { - return title; - } - // - // Title of the patents - // - public void setTitle(String title) { - this.title = title; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PermissionsModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PermissionsModel.java deleted file mode 100644 index 81c4381..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PermissionsModel.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for PermissionsModel Property - // - public class PermissionsModel { - - - @SerializedName("Permissions") - private List permissions; - - - - // - // Any Permission name for the role - // - public List getPermissions() { - return permissions; - } - // - // Any Permission name for the role - // - public void setPermissions(List permissions) { - this.permissions = permissions; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Phone.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Phone.java deleted file mode 100644 index d19a5fc..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Phone.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; -import com.loginradius.sdk.models.enums.OperationType; - - // - // Model Class containing Definition for Phone Property - // - public class Phone { - - - @SerializedName("op") - private OperationType op; - - @SerializedName("PhoneNumber") - private String phoneNumber; - - @SerializedName("PhoneType") - private String phoneType; - - - - // - // operation type - // - public OperationType getOp() { - return op; - } - // - // operation type - // - public void setOp(OperationType op) { - this.op = op; - } - // - // Phone number - // - public String getPhoneNumber() { - return phoneNumber; - } - // - // Phone number - // - public void setPhoneNumber(String phoneNumber) { - this.phoneNumber = phoneNumber; - } - // - // Phone type - // - public String getPhoneType() { - return phoneType; - } - // - // Phone type - // - public void setPhoneType(String phoneType) { - this.phoneType = phoneType; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PhoneAuthenticationModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PhoneAuthenticationModel.java deleted file mode 100644 index 79e57a6..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PhoneAuthenticationModel.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.Map; - -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for PhoneAuthenticationModel API - // - public class PhoneAuthenticationModel extends ReCaptchaModel { - - - @SerializedName("password") - private String password; - - @SerializedName("phone") - private String phone; - - @SerializedName("SecurityAnswer") - private Map securityAnswer; - - - - // - // Password for the email - // - public String getPassword() { - return password; - } - // - // Password for the email - // - public void setPassword(String password) { - this.password = password; - } - // - // New Phone Number - // - public String getPhone() { - return phone; - } - // - // New Phone Number - // - public void setPhone(String phone) { - this.phone = phone; - } - // - // Valid JSON object of Unique Security Question ID and Answer of set Security Question. It is only required for locked accounts when logging in. Details about this feature - // - public Map getSecurityAnswer() { - return securityAnswer; - } - // - // Valid JSON object of Unique Security Question ID and Answer of set Security Question. It is only required for locked accounts when logging in. Details about this feature - // - public void setSecurityAnswer(Map securityAnswer) { - this.securityAnswer = securityAnswer; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PinModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PinModel.java deleted file mode 100644 index 0f907f5..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PinModel.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for PinInfo - // - public class PinModel { - - - @SerializedName("PIN") - private String pin; - - @SerializedName("Skipped") - private Boolean skipped; - - - - // - // PIN of user - // - public String getPIN() { - return pin; - } - // - // PIN of user - // - public void setPIN(String pin) { - this.pin = pin; - } - // - // possible values are true/false/null - // - public Boolean getSkipped() { - return skipped; - } - // - // possible values are true/false/null - // - public void setSkipped(Boolean skipped) { - this.skipped = skipped; - } - } diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PlacesLived.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PlacesLived.java deleted file mode 100644 index 8ee62f9..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PlacesLived.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; -import com.loginradius.sdk.models.enums.OperationType; - - // - // Model Class containing Definition for PlacesLived Property - // - public class PlacesLived { - - - @SerializedName("IsPrimary") - private Boolean isPrimary; - - @SerializedName("Name") - private String name; - - @SerializedName("op") - private OperationType op; - - - - // - // place is primary or not - // - public Boolean getIsPrimary() { - return isPrimary; - } - // - // place is primary or not - // - public void setIsPrimary(Boolean isPrimary) { - this.isPrimary = isPrimary; - } - // - // Name of lived place - // - public String getName() { - return name; - } - // - // Name of lived place - // - public void setName(String name) { - this.name = name; - } - // - // Places Lived Operation type - // - public OperationType getOp() { - return op; - } - // - // Places Lived Operation type - // - public void setOp(OperationType op) { - this.op = op; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PositionCompany.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PositionCompany.java deleted file mode 100644 index 03d2c30..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PositionCompany.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for PositionCompany Property - // - public class PositionCompany { - - - @SerializedName("Industry") - private String industry; - - @SerializedName("Name") - private String name; - - @SerializedName("Type") - private String type; - - - - // - // position company industry - // - public String getIndustry() { - return industry; - } - // - // position company industry - // - public void setIndustry(String industry) { - this.industry = industry; - } - // - // position company name - // - public String getName() { - return name; - } - // - // position company name - // - public void setName(String name) { - this.name = name; - } - // - // position company type - // - public String getType() { - return type; - } - // - // position company type - // - public void setType(String type) { - this.type = type; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PrivacyPolicy.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PrivacyPolicy.java deleted file mode 100644 index 805976e..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PrivacyPolicy.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for PrivacyPolicy Property - // - public class PrivacyPolicy { - - - @SerializedName("Version") - private String version; - - - - // - // Privacy policy version - // - public String getVersion() { - return version; - } - // - // Privacy policy version - // - public void setVersion(String version) { - this.version = version; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ProfessionalPosition.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ProfessionalPosition.java deleted file mode 100644 index b6b783a..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ProfessionalPosition.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for ProfessionalPosition Property - // - public class ProfessionalPosition { - - - @SerializedName("Company") - private PositionCompany company; - - @SerializedName("EndDate") - private String endDate; - - @SerializedName("IsCurrent") - private String isCurrent; - - @SerializedName("Location") - private String location; - - @SerializedName("Position") - private String position; - - @SerializedName("StartDate") - private String startDate; - - @SerializedName("Summary") - private String summary; - - - - // - // Company of the professional position - // - public PositionCompany getCompany() { - return company; - } - // - // Company of the professional position - // - public void setCompany(PositionCompany company) { - this.company = company; - } - // - // End date of the professional position - // - public String getEndDate() { - return endDate; - } - // - // End date of the professional position - // - public void setEndDate(String endDate) { - this.endDate = endDate; - } - // - // Is current or not - // - public String getIsCurrent() { - return isCurrent; - } - // - // Is current or not - // - public void setIsCurrent(String isCurrent) { - this.isCurrent = isCurrent; - } - // - // Location of the professional position - // - public String getLocation() { - return location; - } - // - // Location of the professional position - // - public void setLocation(String location) { - this.location = location; - } - // - // Position - // - public String getPosition() { - return position; - } - // - // Position - // - public void setPosition(String position) { - this.position = position; - } - // - // Start date of the professional position - // - public String getStartDate() { - return startDate; - } - // - // Start date of the professional position - // - public void setStartDate(String startDate) { - this.startDate = startDate; - } - // - // Summary of the professional position - // - public String getSummary() { - return summary; - } - // - // Summary of the professional position - // - public void setSummary(String summary) { - this.summary = summary; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Projects.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Projects.java deleted file mode 100644 index bc053cf..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Projects.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for Projects Property - // - public class Projects { - - - @SerializedName("EndDate") - private String endDate; - - @SerializedName("Id") - private String id; - - @SerializedName("IsCurrent") - private String isCurrent; - - @SerializedName("Name") - private String name; - - @SerializedName("StartDate") - private String startDate; - - @SerializedName("Summary") - private String summary; - - @SerializedName("With") - private List with; - - - - // - // End date of the project - // - public String getEndDate() { - return endDate; - } - // - // End date of the project - // - public void setEndDate(String endDate) { - this.endDate = endDate; - } - // - // Id of the project - // - public String getId() { - return id; - } - // - // Id of the project - // - public void setId(String id) { - this.id = id; - } - // - // is current or not - // - public String getIsCurrent() { - return isCurrent; - } - // - // is current or not - // - public void setIsCurrent(String isCurrent) { - this.isCurrent = isCurrent; - } - // - // Name of the project - // - public String getName() { - return name; - } - // - // Name of the project - // - public void setName(String name) { - this.name = name; - } - // - // Start date of the project - // - public String getStartDate() { - return startDate; - } - // - // Start date of the project - // - public void setStartDate(String startDate) { - this.startDate = startDate; - } - // - // Summary of the project - // - public String getSummary() { - return summary; - } - // - // Summary of the project - // - public void setSummary(String summary) { - this.summary = summary; - } - // - // Projects done with - // - public List getWith() { - return with; - } - // - // Projects done with - // - public void setWith(List with) { - this.with = with; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ProviderAccessCredential.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ProviderAccessCredential.java deleted file mode 100644 index 3e44eb5..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ProviderAccessCredential.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for ProviderAccessCredential Property - // - public class ProviderAccessCredential { - - - @SerializedName("AccessToken") - private String accessToken; - - @SerializedName("TokenSecret") - private String tokenSecret; - - - - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // - public String getAccessToken() { - return accessToken; - } - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - // - // secret token of the provider - // - public String getTokenSecret() { - return tokenSecret; - } - // - // secret token of the provider - // - public void setTokenSecret(String tokenSecret) { - this.tokenSecret = tokenSecret; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Publications.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Publications.java deleted file mode 100644 index 6559075..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Publications.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for Publications Property - // - public class Publications { - - - @SerializedName("Authors") - private List authors; - - @SerializedName("Date") - private String date; - - @SerializedName("Id") - private String id; - - @SerializedName("Publisher") - private String publisher; - - @SerializedName("Summary") - private String summary; - - @SerializedName("Title") - private String title; - - @SerializedName("Url") - private String url; - - - - // - // Author of the publication - // - public List getAuthors() { - return authors; - } - // - // Author of the publication - // - public void setAuthors(List authors) { - this.authors = authors; - } - // - // Date of the publication - // - public String getDate() { - return date; - } - // - // Date of the publication - // - public void setDate(String date) { - this.date = date; - } - // - // Id of the Publication - // - public String getId() { - return id; - } - // - // Id of the Publication - // - public void setId(String id) { - this.id = id; - } - // - // Publisher of the Publication - // - public String getPublisher() { - return publisher; - } - // - // Publisher of the Publication - // - public void setPublisher(String publisher) { - this.publisher = publisher; - } - // - // Summary of the publication - // - public String getSummary() { - return summary; - } - // - // Summary of the publication - // - public void setSummary(String summary) { - this.summary = summary; - } - // - // Title of the publication - // - public String getTitle() { - return title; - } - // - // Title of the publication - // - public void setTitle(String title) { - this.title = title; - } - // - // Publication url - // - public String getUrl() { - return url; - } - // - // Publication url - // - public void setUrl(String url) { - this.url = url; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PublicationsAuthors.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PublicationsAuthors.java deleted file mode 100644 index ad40fd4..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/PublicationsAuthors.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for PublicationsAuthors Property - // - public class PublicationsAuthors { - - - @SerializedName("Id") - private String id; - - @SerializedName("Name") - private String name; - - - - // - // Author id of the publication - // - public String getId() { - return id; - } - // - // Author id of the publication - // - public void setId(String id) { - this.id = id; - } - // - // Author name - // - public String getName() { - return name; - } - // - // Author name - // - public void setName(String name) { - this.name = name; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ReCaptchaBodyModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ReCaptchaBodyModel.java deleted file mode 100644 index 9900a40..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ReCaptchaBodyModel.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for ReCaptchaBodyModel Property - // - public class ReCaptchaBodyModel { - - - @SerializedName("g-recaptcha-response") - private String g_recaptcha_response; - - @SerializedName("qq_captcha_randstr") - private String qq_captcha_randstr; - - @SerializedName("qq_captcha_ticket") - private String qq_captcha_ticket; - - - - // - // The acknowledgement received by Google in Google recaptcha authorisation process. - // - public String getG_Recaptcha_Response() { - return g_recaptcha_response; - } - // - // The acknowledgement received by Google in Google recaptcha authorisation process. - // - public void setG_Recaptcha_Response(String g_recaptcha_response) { - this.g_recaptcha_response = g_recaptcha_response; - } - // - // the value of the user's random string retrieved from the QQ captcha - // - public String getQq_Captcha_Randstr() { - return qq_captcha_randstr; - } - // - // the value of the user's random string retrieved from the QQ captcha - // - public void setQq_Captcha_Randstr(String qq_captcha_randstr) { - this.qq_captcha_randstr = qq_captcha_randstr; - } - // - // QQ Captcha ticket received from QQ in the QQ Captcha authorization process - // - public String getQq_Captcha_Ticket() { - return qq_captcha_ticket; - } - // - // QQ Captcha ticket received from QQ in the QQ Captcha authorization process - // - public void setQq_Captcha_Ticket(String qq_captcha_ticket) { - this.qq_captcha_ticket = qq_captcha_ticket; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ReCaptchaModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ReCaptchaModel.java deleted file mode 100644 index e370946..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ReCaptchaModel.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; - -// - // Model Class containing Definition for ReCaptchaBodyModel Property - // - public class ReCaptchaModel extends CaptchaModel { - - - - - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ReauthByBackupCodeModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ReauthByBackupCodeModel.java deleted file mode 100644 index 815f1b8..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ReauthByBackupCodeModel.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for MFA Reauthentication by Backup code - // - public class ReauthByBackupCodeModel { - - - @SerializedName("BackupCode") - private String backupCode; - - - - // - // The Code generated as a recourse - // - public String getBackupCode() { - return backupCode; - } - // - // The Code generated as a recourse - // - public void setBackupCode(String backupCode) { - this.backupCode = backupCode; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ReauthByEmailOtpModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ReauthByEmailOtpModel.java deleted file mode 100644 index 9a70007..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ReauthByEmailOtpModel.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // - // - public class ReauthByEmailOtpModel extends LockoutModel { - - - @SerializedName("EmailId") - private String emailId; - - @SerializedName("Otp") - private String otp; - - - - // - // - // - public String getEmailId() { - return emailId; - } - // - // - // - public void setEmailId(String emailId) { - this.emailId = emailId; - } - // - // - // - public String getOtp() { - return otp; - } - // - // - // - public void setOtp(String otp) { - this.otp = otp; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ReauthByGoogleAuthenticatorCodeModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ReauthByGoogleAuthenticatorCodeModel.java deleted file mode 100644 index 0333dde..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ReauthByGoogleAuthenticatorCodeModel.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for MFA Reauthentication by Google Authenticator - // - public class ReauthByGoogleAuthenticatorCodeModel { - - - @SerializedName("GoogleAuthenticatorCode") - private String googleAuthenticatorCode; - - - - // - // The code generated by google authenticator app after scanning QR code - // - public String getGoogleAuthenticatorCode() { - return googleAuthenticatorCode; - } - // - // The code generated by google authenticator app after scanning QR code - // - public void setGoogleAuthenticatorCode(String googleAuthenticatorCode) { - this.googleAuthenticatorCode = googleAuthenticatorCode; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ReauthByOtpModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ReauthByOtpModel.java deleted file mode 100644 index e6ae756..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ReauthByOtpModel.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for MFA Reauthentication by OTP - // - public class ReauthByOtpModel extends LockoutModel { - - - @SerializedName("Otp") - private String otp; - - - - // - // The Verification Code - // - public String getOtp() { - return otp; - } - // - // The Verification Code - // - public void setOtp(String otp) { - this.otp = otp; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/RecommendationsReceived.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/RecommendationsReceived.java deleted file mode 100644 index 803bfb6..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/RecommendationsReceived.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for RecommendationsReceived - // - public class RecommendationsReceived { - - - @SerializedName("Id") - private String id; - - @SerializedName("RecommendationText") - private String recommendationText; - - @SerializedName("RecommendationType") - private String recommendationType; - - @SerializedName("Recommender") - private String recommender; - - - - // - // Recommendation id - // - public String getId() { - return id; - } - // - // Recommendation id - // - public void setId(String id) { - this.id = id; - } - // - // Recommendation text - // - public String getRecommendationText() { - return recommendationText; - } - // - // Recommendation text - // - public void setRecommendationText(String recommendationText) { - this.recommendationText = recommendationText; - } - // - // Recommendation type - // - public String getRecommendationType() { - return recommendationType; - } - // - // Recommendation type - // - public void setRecommendationType(String recommendationType) { - this.recommendationType = recommendationType; - } - // - // Recommender - // - public String getRecommender() { - return recommender; - } - // - // Recommender - // - public void setRecommender(String recommender) { - this.recommender = recommender; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/RelatedProfileViews.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/RelatedProfileViews.java deleted file mode 100644 index 67c31b3..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/RelatedProfileViews.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for RelatedProfileViews Property - // - public class RelatedProfileViews { - - - @SerializedName("FirstName") - private String firstName; - - @SerializedName("Id") - private String id; - - @SerializedName("LastName") - private String lastName; - - - - // - // user's first name - // - public String getFirstName() { - return firstName; - } - // - // user's first name - // - public void setFirstName(String firstName) { - this.firstName = firstName; - } - // - // ID of the User - // - public String getId() { - return id; - } - // - // ID of the User - // - public void setId(String id) { - this.id = id; - } - // - // user's last name - // - public String getLastName() { - return lastName; - } - // - // user's last name - // - public void setLastName(String lastName) { - this.lastName = lastName; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPINByEmailAndOtpModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPINByEmailAndOtpModel.java deleted file mode 100644 index 7c27473..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPINByEmailAndOtpModel.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for Reset Pin By Email and Otp API - // - public class ResetPINByEmailAndOtpModel extends LockoutModel { - - - @SerializedName("Email") - private String email; - - @SerializedName("Otp") - private String otp; - - @SerializedName("PIN") - private String pin; - - - - // - // user's email - // - public String getEmail() { - return email; - } - // - // user's email - // - public void setEmail(String email) { - this.email = email; - } - // - // The Verification Code - // - public String getOtp() { - return otp; - } - // - // The Verification Code - // - public void setOtp(String otp) { - this.otp = otp; - } - // - // PIN of user - // - public String getPIN() { - return pin; - } - // - // PIN of user - // - public void setPIN(String pin) { - this.pin = pin; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPINByPhoneAndOTPModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPINByPhoneAndOTPModel.java deleted file mode 100644 index 603bbc8..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPINByPhoneAndOTPModel.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for Reset Pin By Phone and Otp API - // - public class ResetPINByPhoneAndOTPModel extends LockoutModel { - - - @SerializedName("Otp") - private String otp; - - @SerializedName("Phone") - private String phone; - - @SerializedName("PIN") - private String pin; - - - - // - // The Verification Code - // - public String getOtp() { - return otp; - } - // - // The Verification Code - // - public void setOtp(String otp) { - this.otp = otp; - } - // - // New Phone Number - // - public String getPhone() { - return phone; - } - // - // New Phone Number - // - public void setPhone(String phone) { - this.phone = phone; - } - // - // PIN of user - // - public String getPIN() { - return pin; - } - // - // PIN of user - // - public void setPIN(String pin) { - this.pin = pin; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPINByResetToken.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPINByResetToken.java deleted file mode 100644 index 842396f..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPINByResetToken.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for Reset Pin By Reset Token API - // - public class ResetPINByResetToken { - - - @SerializedName("PIN") - private String pin; - - @SerializedName("ResetToken") - private String resetToken; - - - - // - // PIN of user - // - public String getPIN() { - return pin; - } - // - // PIN of user - // - public void setPIN(String pin) { - this.pin = pin; - } - // - // reset token received in the email - // - public String getResetToken() { - return resetToken; - } - // - // reset token received in the email - // - public void setResetToken(String resetToken) { - this.resetToken = resetToken; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPINBySecurityQuestionAnswer.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPINBySecurityQuestionAnswer.java deleted file mode 100644 index 995843c..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPINBySecurityQuestionAnswer.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.Map; - -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for Reset Pin By Security Question API - // - public class ResetPINBySecurityQuestionAnswer { - - - @SerializedName("PIN") - private String pin; - - @SerializedName("SecurityAnswer") - private Map securityAnswer; - - - - // - // PIN of user - // - public String getPIN() { - return pin; - } - // - // PIN of user - // - public void setPIN(String pin) { - this.pin = pin; - } - // - // Valid JSON object of Unique Security Question ID and Answer of set Security Question. It is only required for locked accounts when logging in. Details about this feature - // - public Map getSecurityAnswer() { - return securityAnswer; - } - // - // Valid JSON object of Unique Security Question ID and Answer of set Security Question. It is only required for locked accounts when logging in. Details about this feature - // - public void setSecurityAnswer(Map securityAnswer) { - this.securityAnswer = securityAnswer; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPINBySecurityQuestionAnswerAndEmailModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPINBySecurityQuestionAnswerAndEmailModel.java deleted file mode 100644 index 62f1f6b..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPINBySecurityQuestionAnswerAndEmailModel.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for Reset Pin By Security Question and Email API - // - public class ResetPINBySecurityQuestionAnswerAndEmailModel extends ResetPINBySecurityQuestionAnswer { - - - @SerializedName("Email") - private String email; - - - - // - // user's email - // - public String getEmail() { - return email; - } - // - // user's email - // - public void setEmail(String email) { - this.email = email; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPINBySecurityQuestionAnswerAndPhoneModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPINBySecurityQuestionAnswerAndPhoneModel.java deleted file mode 100644 index ac0bbb7..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPINBySecurityQuestionAnswerAndPhoneModel.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for Reset Pin By Security Question and Phone API - // - public class ResetPINBySecurityQuestionAnswerAndPhoneModel extends ResetPINBySecurityQuestionAnswer { - - - @SerializedName("Phone") - private String phone; - - - - // - // New Phone Number - // - public String getPhone() { - return phone; - } - // - // New Phone Number - // - public void setPhone(String phone) { - this.phone = phone; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPINBySecurityQuestionAnswerAndUsernameModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPINBySecurityQuestionAnswerAndUsernameModel.java deleted file mode 100644 index 3c24811..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPINBySecurityQuestionAnswerAndUsernameModel.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for Reset Pin By Security Question and UserName API - // - public class ResetPINBySecurityQuestionAnswerAndUsernameModel extends ResetPINBySecurityQuestionAnswer { - - - @SerializedName("Username") - private String username; - - - - // - // Username of the user - // - public String getUsername() { - return username; - } - // - // Username of the user - // - public void setUsername(String username) { - this.username = username; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPINByUsernameAndOtpModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPINByUsernameAndOtpModel.java deleted file mode 100644 index bfe4b93..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPINByUsernameAndOtpModel.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for Reset Pin By Username and Otp API - // - public class ResetPINByUsernameAndOtpModel extends LockoutModel { - - - @SerializedName("Otp") - private String otp; - - @SerializedName("PIN") - private String pin; - - @SerializedName("Username") - private String username; - - - - // - // The Verification Code - // - public String getOtp() { - return otp; - } - // - // The Verification Code - // - public void setOtp(String otp) { - this.otp = otp; - } - // - // PIN of user - // - public String getPIN() { - return pin; - } - // - // PIN of user - // - public void setPIN(String pin) { - this.pin = pin; - } - // - // Username of the user - // - public String getUsername() { - return username; - } - // - // Username of the user - // - public void setUsername(String username) { - this.username = username; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPasswordByEmailAndOtpModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPasswordByEmailAndOtpModel.java deleted file mode 100644 index 2128e28..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPasswordByEmailAndOtpModel.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for ResetPasswordByEmailAndOtp API - // - public class ResetPasswordByEmailAndOtpModel extends LockoutModel { - - - @SerializedName("Email") - private String email; - - @SerializedName("Otp") - private String otp; - - @SerializedName("Password") - private String password; - - @SerializedName("ResetPasswordEmailTemplate") - private String resetPasswordEmailTemplate; - - @SerializedName("WelcomeEmailTemplate") - private String welcomeEmailTemplate; - - - - // - // user's email - // - public String getEmail() { - return email; - } - // - // user's email - // - public void setEmail(String email) { - this.email = email; - } - // - // The Verification Code - // - public String getOtp() { - return otp; - } - // - // The Verification Code - // - public void setOtp(String otp) { - this.otp = otp; - } - // - // Password for the email - // - public String getPassword() { - return password; - } - // - // Password for the email - // - public void setPassword(String password) { - this.password = password; - } - // - // If you are sending an email via the sendemail parameter, this parameter allows you to specify which reset Password email template you would like to use. - // - public String getResetPasswordEmailTemplate() { - return resetPasswordEmailTemplate; - } - // - // If you are sending an email via the sendemail parameter, this parameter allows you to specify which reset Password email template you would like to use. - // - public void setResetPasswordEmailTemplate(String resetPasswordEmailTemplate) { - this.resetPasswordEmailTemplate = resetPasswordEmailTemplate; - } - // - // If you are sending an email via the sendemail parameter, this parameter allows you to specify which welcome email template you would like to use. - // - public String getWelcomeEmailTemplate() { - return welcomeEmailTemplate; - } - // - // If you are sending an email via the sendemail parameter, this parameter allows you to specify which welcome email template you would like to use. - // - public void setWelcomeEmailTemplate(String welcomeEmailTemplate) { - this.welcomeEmailTemplate = welcomeEmailTemplate; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPasswordByOTPModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPasswordByOTPModel.java deleted file mode 100644 index aa0aab7..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPasswordByOTPModel.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for ResetPasswordByOTP API - // - public class ResetPasswordByOTPModel extends LockoutModel { - - - @SerializedName("otp") - private String otp; - - @SerializedName("password") - private String password; - - @SerializedName("Phone") - private String phone; - - @SerializedName("ResetPasswordSmsTemplate") - private String resetPasswordSmsTemplate; - - @SerializedName("smsTemplate") - private String smsTemplate; - - - - // - // The Verification Code - // - public String getOtp() { - return otp; - } - // - // The Verification Code - // - public void setOtp(String otp) { - this.otp = otp; - } - // - // Password for the email - // - public String getPassword() { - return password; - } - // - // Password for the email - // - public void setPassword(String password) { - this.password = password; - } - // - // New Phone Number - // - public String getPhone() { - return phone; - } - // - // New Phone Number - // - public void setPhone(String phone) { - this.phone = phone; - } - // - // If you are sending an sms via the sendsms parameter, this parameter allows you to specify which reset password sms template you would like to use. - // - public String getResetPasswordSmsTemplate() { - return resetPasswordSmsTemplate; - } - // - // If you are sending an sms via the sendsms parameter, this parameter allows you to specify which reset password sms template you would like to use. - // - public void setResetPasswordSmsTemplate(String resetPasswordSmsTemplate) { - this.resetPasswordSmsTemplate = resetPasswordSmsTemplate; - } - // - // SMS template name - // - public String getSmsTemplate() { - return smsTemplate; - } - // - // SMS template name - // - public void setSmsTemplate(String smsTemplate) { - this.smsTemplate = smsTemplate; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPasswordByResetTokenModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPasswordByResetTokenModel.java deleted file mode 100644 index df49231..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPasswordByResetTokenModel.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for ResetToken API - // - public class ResetPasswordByResetTokenModel extends LockoutModel { - - - @SerializedName("Password") - private String password; - - @SerializedName("ResetPasswordEmailTemplate") - private String resetPasswordEmailTemplate; - - @SerializedName("ResetToken") - private String resetToken; - - @SerializedName("WelcomeEmailTemplate") - private String welcomeEmailTemplate; - - - - // - // Password for the email - // - public String getPassword() { - return password; - } - // - // Password for the email - // - public void setPassword(String password) { - this.password = password; - } - // - // If you are sending an email via the sendemail parameter, this parameter allows you to specify which reset Password email template you would like to use. - // - public String getResetPasswordEmailTemplate() { - return resetPasswordEmailTemplate; - } - // - // If you are sending an email via the sendemail parameter, this parameter allows you to specify which reset Password email template you would like to use. - // - public void setResetPasswordEmailTemplate(String resetPasswordEmailTemplate) { - this.resetPasswordEmailTemplate = resetPasswordEmailTemplate; - } - // - // reset token received in the email - // - public String getResetToken() { - return resetToken; - } - // - // reset token received in the email - // - public void setResetToken(String resetToken) { - this.resetToken = resetToken; - } - // - // If you are sending an email via the sendemail parameter, this parameter allows you to specify which welcome email template you would like to use. - // - public String getWelcomeEmailTemplate() { - return welcomeEmailTemplate; - } - // - // If you are sending an email via the sendemail parameter, this parameter allows you to specify which welcome email template you would like to use. - // - public void setWelcomeEmailTemplate(String welcomeEmailTemplate) { - this.welcomeEmailTemplate = welcomeEmailTemplate; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPasswordBySecurityAnswerAndEmailModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPasswordBySecurityAnswerAndEmailModel.java deleted file mode 100644 index c57e12c..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPasswordBySecurityAnswerAndEmailModel.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.Map; - -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for ResetPasswordBySecurityAnswerAndEmail API - // - public class ResetPasswordBySecurityAnswerAndEmailModel { - - - @SerializedName("Email") - private String email; - - @SerializedName("password") - private String password; - - @SerializedName("ResetPasswordEmailTemplate") - private String resetPasswordEmailTemplate; - - @SerializedName("SecurityAnswer") - private Map securityAnswer; - - - - // - // LoginRadius user identifier (if phone no login then phone no and if email login then email id) - // - public String getEmail() { - return email; - } - // - // LoginRadius user identifier (if phone no login then phone no and if email login then email id) - // - public void setEmail(String email) { - this.email = email; - } - // - // Password for the email - // - public String getPassword() { - return password; - } - // - // Password for the email - // - public void setPassword(String password) { - this.password = password; - } - // - // If you are sending an email via the sendemail parameter, this parameter allows you to specify which reset Password email template you would like to use. - // - public String getResetPasswordEmailTemplate() { - return resetPasswordEmailTemplate; - } - // - // If you are sending an email via the sendemail parameter, this parameter allows you to specify which reset Password email template you would like to use. - // - public void setResetPasswordEmailTemplate(String resetPasswordEmailTemplate) { - this.resetPasswordEmailTemplate = resetPasswordEmailTemplate; - } - // - // Valid JSON object of Unique Security Question ID and Answer of set Security Question. It is only required for locked accounts when logging in. Details about this feature - // - public Map getSecurityAnswer() { - return securityAnswer; - } - // - // Valid JSON object of Unique Security Question ID and Answer of set Security Question. It is only required for locked accounts when logging in. Details about this feature - // - public void setSecurityAnswer(Map securityAnswer) { - this.securityAnswer = securityAnswer; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPasswordBySecurityAnswerAndPhoneModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPasswordBySecurityAnswerAndPhoneModel.java deleted file mode 100644 index 633ec8e..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPasswordBySecurityAnswerAndPhoneModel.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.Map; - -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for ResetPasswordBySecurityAnswerAndPhone API - // - public class ResetPasswordBySecurityAnswerAndPhoneModel { - - - @SerializedName("password") - private String password; - - @SerializedName("Phone") - private String phone; - - @SerializedName("ResetPasswordEmailTemplate") - private String resetPasswordEmailTemplate; - - @SerializedName("SecurityAnswer") - private Map securityAnswer; - - - - // - // Password for the email - // - public String getPassword() { - return password; - } - // - // Password for the email - // - public void setPassword(String password) { - this.password = password; - } - // - // New Phone Number - // - public String getPhone() { - return phone; - } - // - // New Phone Number - // - public void setPhone(String phone) { - this.phone = phone; - } - // - // If you are sending an email via the sendemail parameter, this parameter allows you to specify which reset Password email template you would like to use. - // - public String getResetPasswordEmailTemplate() { - return resetPasswordEmailTemplate; - } - // - // If you are sending an email via the sendemail parameter, this parameter allows you to specify which reset Password email template you would like to use. - // - public void setResetPasswordEmailTemplate(String resetPasswordEmailTemplate) { - this.resetPasswordEmailTemplate = resetPasswordEmailTemplate; - } - // - // Valid JSON object of Unique Security Question ID and Answer of set Security Question. It is only required for locked accounts when logging in. Details about this feature - // - public Map getSecurityAnswer() { - return securityAnswer; - } - // - // Valid JSON object of Unique Security Question ID and Answer of set Security Question. It is only required for locked accounts when logging in. Details about this feature - // - public void setSecurityAnswer(Map securityAnswer) { - this.securityAnswer = securityAnswer; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPasswordBySecurityAnswerAndUserNameModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPasswordBySecurityAnswerAndUserNameModel.java deleted file mode 100644 index 2aa65eb..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPasswordBySecurityAnswerAndUserNameModel.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.Map; - -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for ResetPasswordBySecurityAnswerAndUserName API - // - public class ResetPasswordBySecurityAnswerAndUserNameModel { - - - @SerializedName("password") - private String password; - - @SerializedName("ResetPasswordEmailTemplate") - private String resetPasswordEmailTemplate; - - @SerializedName("SecurityAnswer") - private Map securityAnswer; - - @SerializedName("UserName") - private String userName; - - - - // - // Password for the email - // - public String getPassword() { - return password; - } - // - // Password for the email - // - public void setPassword(String password) { - this.password = password; - } - // - // If you are sending an email via the sendemail parameter, this parameter allows you to specify which reset Password email template you would like to use. - // - public String getResetPasswordEmailTemplate() { - return resetPasswordEmailTemplate; - } - // - // If you are sending an email via the sendemail parameter, this parameter allows you to specify which reset Password email template you would like to use. - // - public void setResetPasswordEmailTemplate(String resetPasswordEmailTemplate) { - this.resetPasswordEmailTemplate = resetPasswordEmailTemplate; - } - // - // Valid JSON object of Unique Security Question ID and Answer of set Security Question. It is only required for locked accounts when logging in. Details about this feature - // - public Map getSecurityAnswer() { - return securityAnswer; - } - // - // Valid JSON object of Unique Security Question ID and Answer of set Security Question. It is only required for locked accounts when logging in. Details about this feature - // - public void setSecurityAnswer(Map securityAnswer) { - this.securityAnswer = securityAnswer; - } - // - // Username of the user - // - public String getUserName() { - return userName; - } - // - // Username of the user - // - public void setUserName(String userName) { - this.userName = userName; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPasswordByUserNameModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPasswordByUserNameModel.java deleted file mode 100644 index 34a45a6..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/ResetPasswordByUserNameModel.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for ResetPasswordByUserName API - // - public class ResetPasswordByUserNameModel extends LockoutModel { - - - @SerializedName("Otp") - private String otp; - - @SerializedName("Password") - private String password; - - @SerializedName("ResetPasswordEmailTemplate") - private String resetPasswordEmailTemplate; - - @SerializedName("UserName") - private String userName; - - @SerializedName("WelcomeEmailTemplate") - private String welcomeEmailTemplate; - - - - // - // The Verification Code - // - public String getOtp() { - return otp; - } - // - // The Verification Code - // - public void setOtp(String otp) { - this.otp = otp; - } - // - // Password for the email - // - public String getPassword() { - return password; - } - // - // Password for the email - // - public void setPassword(String password) { - this.password = password; - } - // - // If you are sending an email via the sendemail parameter, this parameter allows you to specify which reset Password email template you would like to use. - // - public String getResetPasswordEmailTemplate() { - return resetPasswordEmailTemplate; - } - // - // If you are sending an email via the sendemail parameter, this parameter allows you to specify which reset Password email template you would like to use. - // - public void setResetPasswordEmailTemplate(String resetPasswordEmailTemplate) { - this.resetPasswordEmailTemplate = resetPasswordEmailTemplate; - } - // - // Username of the user - // - public String getUserName() { - return userName; - } - // - // Username of the user - // - public void setUserName(String userName) { - this.userName = userName; - } - // - // If you are sending an email via the sendemail parameter, this parameter allows you to specify which welcome email template you would like to use. - // - public String getWelcomeEmailTemplate() { - return welcomeEmailTemplate; - } - // - // If you are sending an email via the sendemail parameter, this parameter allows you to specify which welcome email template you would like to use. - // - public void setWelcomeEmailTemplate(String welcomeEmailTemplate) { - this.welcomeEmailTemplate = welcomeEmailTemplate; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/RoleContextAdditionalPermissionRemoveRoleModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/RoleContextAdditionalPermissionRemoveRoleModel.java deleted file mode 100644 index 59aba71..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/RoleContextAdditionalPermissionRemoveRoleModel.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for RoleContextAdditionalPermissionRemoveRole API - // - public class RoleContextAdditionalPermissionRemoveRoleModel { - - - @SerializedName("AdditionalPermissions") - private List additionalPermissions; - - - - // - // Array of String, which represents the additional permissions - // - public List getAdditionalPermissions() { - return additionalPermissions; - } - // - // Array of String, which represents the additional permissions - // - public void setAdditionalPermissions(List additionalPermissions) { - this.additionalPermissions = additionalPermissions; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/RoleContextRemoveRoleModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/RoleContextRemoveRoleModel.java deleted file mode 100644 index 3960aad..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/RoleContextRemoveRoleModel.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for RoleContextRemoveRole API - // - public class RoleContextRemoveRoleModel { - - - @SerializedName("Roles") - private List roles; - - - - // - // Array of String, which represents the role name - // - public List getRoles() { - return roles; - } - // - // Array of String, which represents the role name - // - public void setRoles(List roles) { - this.roles = roles; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/RoleContextRoleModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/RoleContextRoleModel.java deleted file mode 100644 index 48ef72c..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/RoleContextRoleModel.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for RoleContextRole API - // - public class RoleContextRoleModel { - - - @SerializedName("AdditionalPermissions") - private List additionalPermissions; - - @SerializedName("Context") - private String context; - - @SerializedName("Expiration") - private String expiration; - - @SerializedName("Roles") - private List roles; - - - - // - // Array of String, which represents the additional permissions - // - public List getAdditionalPermissions() { - return additionalPermissions; - } - // - // Array of String, which represents the additional permissions - // - public void setAdditionalPermissions(List additionalPermissions) { - this.additionalPermissions = additionalPermissions; - } - // - // Array of RoleContext object, see body tab for structure - // - public String getContext() { - return context; - } - // - // Array of RoleContext object, see body tab for structure - // - public void setContext(String context) { - this.context = context; - } - // - // Role expiration date - // - public String getExpiration() { - return expiration; - } - // - // Role expiration date - // - public void setExpiration(String expiration) { - this.expiration = expiration; - } - // - // Array of String, which represents the role name - // - public List getRoles() { - return roles; - } - // - // Array of String, which represents the role name - // - public void setRoles(List roles) { - this.roles = roles; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/RoleModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/RoleModel.java deleted file mode 100644 index 14945b7..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/RoleModel.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.Map; - -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for Roles API - // - public class RoleModel { - - - @SerializedName("Name") - private String name; - - @SerializedName("Permissions") - private Map permissions; - - - - // - // Name of role - // - public String getName() { - return name; - } - // - // Name of role - // - public void setName(String name) { - this.name = name; - } - // - // Any Permission name for the role - // - public Map getPermissions() { - return permissions; - } - // - // Any Permission name for the role - // - public void setPermissions(Map permissions) { - this.permissions = permissions; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/RolesModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/RolesModel.java deleted file mode 100644 index 74fbe07..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/RolesModel.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for Roles API - // - public class RolesModel { - - - @SerializedName("Roles") - private List roles; - - - - // - // Array of String, which represents the role name - // - public List getRoles() { - return roles; - } - // - // Array of String, which represents the role name - // - public void setRoles(List roles) { - this.roles = roles; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/SecurityQuestionAnswerModelByAccessToken.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/SecurityQuestionAnswerModelByAccessToken.java deleted file mode 100644 index 1640b31..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/SecurityQuestionAnswerModelByAccessToken.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // - // - public class SecurityQuestionAnswerModelByAccessToken { - - - @SerializedName("ReplaceSecurityQuestionAnswer") - private Boolean replaceSecurityQuestionAnswer; - - @SerializedName("SecurityQuestionAnswer") - private List securityQuestionAnswer; - - - - // - // - // - public Boolean getReplaceSecurityQuestionAnswer() { - return replaceSecurityQuestionAnswer; - } - // - // - // - public void setReplaceSecurityQuestionAnswer(Boolean replaceSecurityQuestionAnswer) { - this.replaceSecurityQuestionAnswer = replaceSecurityQuestionAnswer; - } - // - // - // - public List getSecurityQuestionAnswer() { - return securityQuestionAnswer; - } - // - // - // - public void setSecurityQuestionAnswer(List securityQuestionAnswer) { - this.securityQuestionAnswer = securityQuestionAnswer; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/SecurityQuestionAnswerUpdateModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/SecurityQuestionAnswerUpdateModel.java deleted file mode 100644 index 06c859d..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/SecurityQuestionAnswerUpdateModel.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // - // - public class SecurityQuestionAnswerUpdateModel { - - - @SerializedName("SecurityQuestionAnswer") - private List securityQuestionAnswer; - - - - // - // - // - public List getSecurityQuestionAnswer() { - return securityQuestionAnswer; - } - // - // - // - public void setSecurityQuestionAnswer(List securityQuestionAnswer) { - this.securityQuestionAnswer = securityQuestionAnswer; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/SecurityQuestionModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/SecurityQuestionModel.java deleted file mode 100644 index e0e6b27..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/SecurityQuestionModel.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // - // - public class SecurityQuestionModel { - - - @SerializedName("Answer") - private String answer; - - @SerializedName("QuestionId") - private String questionId; - - - - // - // - // - public String getAnswer() { - return answer; - } - // - // - // - public void setAnswer(String answer) { - this.answer = answer; - } - // - // - // - public String getQuestionId() { - return questionId; - } - // - // - // - public void setQuestionId(String questionId) { - this.questionId = questionId; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/SecurityQuestionOptionalModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/SecurityQuestionOptionalModel.java deleted file mode 100644 index feac850..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/SecurityQuestionOptionalModel.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // - // - public class SecurityQuestionOptionalModel { - - - @SerializedName("Answer") - private String answer; - - @SerializedName("QuestionId") - private String questionId; - - - - // - // - // - public String getAnswer() { - return answer; - } - // - // - // - public void setAnswer(String answer) { - this.answer = answer; - } - // - // - // - public String getQuestionId() { - return questionId; - } - // - // - // - public void setQuestionId(String questionId) { - this.questionId = questionId; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Skills.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Skills.java deleted file mode 100644 index 792d186..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Skills.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for Skills Property - // - public class Skills { - - - @SerializedName("Id") - private String id; - - @SerializedName("Name") - private String name; - - - - // - // id of skill - // - public String getId() { - return id; - } - // - // id of skill - // - public void setId(String id) { - this.id = id; - } - // - // name of skills - // - public String getName() { - return name; - } - // - // name of skills - // - public void setName(String name) { - this.name = name; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Sports.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Sports.java deleted file mode 100644 index db3755d..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Sports.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for Sports Property - // - public class Sports { - - - @SerializedName("Id") - private String id; - - @SerializedName("Name") - private String name; - - - - // - // Id of sport - // - public String getId() { - return id; - } - // - // Id of sport - // - public void setId(String id) { - this.id = id; - } - // - // Name of sport - // - public String getName() { - return name; - } - // - // Name of sport - // - public void setName(String name) { - this.name = name; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/SsoAuthenticationModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/SsoAuthenticationModel.java deleted file mode 100644 index 632f8bb..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/SsoAuthenticationModel.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for SSO JWT Cloud API - // - public class SsoAuthenticationModel { - - - @SerializedName("email") - private String email; - - @SerializedName("username") - private String username ; - - @SerializedName("phone") - private String phone; - - - @SerializedName("password") - private String password; - - - - // - // user's email - // - public String getEmail() { - return email; - } - // - // user's email - // - public void setEmail(String email) { - this.email = email; - } - // - // user's username - // - public String getUserName() { - return username; - } - // - // user's username - // - public void setUserName(String username) { - this.username = username; - } - // - // user's phone - // - public String getPhone() { - return phone; - } - // - // user's phone - // - public void setPhone(String phone) { - this.phone = phone; - } - // - // Password for the email - // - public String getPassword() { - return password; - } - // - // Password for the email - // - public void setPassword(String password) { - this.password = password; - } - - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Suggestions.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Suggestions.java deleted file mode 100644 index c717417..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Suggestions.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for Suggestions Property - // - public class Suggestions { - - - @SerializedName("CompaniestoFollow") - private List companiestoFollow; - - @SerializedName("IndustriestoFollow") - private List industriestoFollow; - - @SerializedName("NewssourcetoFollow") - private List newssourcetoFollow; - - @SerializedName("PeopletoFollow") - private List peopletoFollow; - - - - // - // Companies needs to follow - // - public List getCompaniestoFollow() { - return companiestoFollow; - } - // - // Companies needs to follow - // - public void setCompaniestoFollow(List companiestoFollow) { - this.companiestoFollow = companiestoFollow; - } - // - // Industries needs to follow - // - public List getIndustriestoFollow() { - return industriestoFollow; - } - // - // Industries needs to follow - // - public void setIndustriestoFollow(List industriestoFollow) { - this.industriestoFollow = industriestoFollow; - } - // - // News sources needs to follow - // - public List getNewssourcetoFollow() { - return newssourcetoFollow; - } - // - // News sources needs to follow - // - public void setNewssourcetoFollow(List newssourcetoFollow) { - this.newssourcetoFollow = newssourcetoFollow; - } - // - // People needs to follow - // - public List getPeopletoFollow() { - return peopletoFollow; - } - // - // People needs to follow - // - public void setPeopletoFollow(List peopletoFollow) { - this.peopletoFollow = peopletoFollow; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Television.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Television.java deleted file mode 100644 index 1ca87b3..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Television.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for Television Property - // - public class Television { - - - @SerializedName("Category") - private String category; - - @SerializedName("CreatedDate") - private String createdDate; - - @SerializedName("Id") - private String id; - - @SerializedName("Name") - private String name; - - - - // - // Television category - // - public String getCategory() { - return category; - } - // - // Television category - // - public void setCategory(String category) { - this.category = category; - } - // - // Date - // - public String getCreatedDate() { - return createdDate; - } - // - // Date - // - public void setCreatedDate(String createdDate) { - this.createdDate = createdDate; - } - // - // ID of the User - // - public String getId() { - return id; - } - // - // ID of the User - // - public void setId(String id) { - this.id = id; - } - // - // Name of the customer - // - public String getName() { - return name; - } - // - // Name of the customer - // - public void setName(String name) { - this.name = name; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/UnlockProfileModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/UnlockProfileModel.java deleted file mode 100644 index c304f9b..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/UnlockProfileModel.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; - -// - // Payload containing Unlock Profile API - // - public class UnlockProfileModel extends LockoutModel { - - - - - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/UpdateUidModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/UpdateUidModel.java deleted file mode 100644 index 700aaf6..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/UpdateUidModel.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Payload containing Update UID - // - public class UpdateUidModel { - - - @SerializedName("NewUid") - private String newUid; - - - - // - // New Uid - // - public String getNewUid() { - return newUid; - } - // - // New Uid - // - public void setNewUid(String newUid) { - this.newUid = newUid; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/UpsertEmailModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/UpsertEmailModel.java deleted file mode 100644 index f9d4a26..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/UpsertEmailModel.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for UpsertEmail Property - // - public class UpsertEmailModel { - - - @SerializedName("Email") - private List email; - - - - // - // user's email - // - public List getEmail() { - return email; - } - // - // user's email - // - public void setEmail(List email) { - this.email = email; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/UserNameAuthenticationModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/UserNameAuthenticationModel.java deleted file mode 100644 index c6cd530..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/UserNameAuthenticationModel.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.Map; - -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for Username Authentication API - // - public class UserNameAuthenticationModel extends ReCaptchaModel { - - - @SerializedName("password") - private String password; - - @SerializedName("SecurityAnswer") - private Map securityAnswer; - - @SerializedName("username") - private String username; - - - - // - // Password for the email - // - public String getPassword() { - return password; - } - // - // Password for the email - // - public void setPassword(String password) { - this.password = password; - } - // - // Valid JSON object of Unique Security Question ID and Answer of set Security Question. It is only required for locked accounts when logging in. Details about this feature - // - public Map getSecurityAnswer() { - return securityAnswer; - } - // - // Valid JSON object of Unique Security Question ID and Answer of set Security Question. It is only required for locked accounts when logging in. Details about this feature - // - public void setSecurityAnswer(Map securityAnswer) { - this.securityAnswer = securityAnswer; - } - // - // Username of the user - // - public String getUsername() { - return username; - } - // - // Username of the user - // - public void setUsername(String username) { - this.username = username; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/UserProfileUpdateModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/UserProfileUpdateModel.java deleted file mode 100644 index 6648907..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/UserProfileUpdateModel.java +++ /dev/null @@ -1,1612 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.List; -import java.util.Map; - -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition of payload for User Profile update API - // - public class UserProfileUpdateModel extends OptionalReCaptchaModel { - - - @SerializedName("About") - private String about; - - @SerializedName("Addresses") - private List
addresses; - - @SerializedName("Age") - private String age; - - @SerializedName("AgeRange") - private AgeRange ageRange; - - @SerializedName("Associations") - private String associations; - - @SerializedName("Awards") - private List awards; - - @SerializedName("Badges") - private List badges; - - @SerializedName("BirthDate") - private String birthDate; - - @SerializedName("Books") - private List books; - - @SerializedName("Certifications") - private List certifications; - - @SerializedName("City") - private String city; - - @SerializedName("Company") - private String company; - - @SerializedName("Country") - private Country country; - - @SerializedName("Courses") - private List courses; - - @SerializedName("CoverPhoto") - private String coverPhoto; - - @SerializedName("Currency") - private String currency; - - @SerializedName("CurrentStatus") - private List currentStatus; - - @SerializedName("CustomFields") - private Map customFields; - - @SerializedName("Educations") - private List educations; - - @SerializedName("Email") - private List email; - - @SerializedName("ExternalIds") - private List externalIds; - - @SerializedName("ExternalUserLoginId") - private String externalUserLoginId; - - @SerializedName("Family") - private List family; - - @SerializedName("Favicon") - private String favicon; - - @SerializedName("FavoriteThings") - private List favoriteThings; - - @SerializedName("FirstName") - private String firstName; - - @SerializedName("FollowersCount") - private Integer followersCount; - - @SerializedName("FriendsCount") - private Integer friendsCount; - - @SerializedName("FullName") - private String fullName; - - @SerializedName("Games") - private List games; - - @SerializedName("Gender") - private String gender; - - @SerializedName("GistsUrl") - private String gistsUrl; - - @SerializedName("GravatarImageUrl") - private String gravatarImageUrl; - - @SerializedName("Hireable") - private Boolean hireable; - - @SerializedName("HomeTown") - private String homeTown; - - @SerializedName("Honors") - private String honors; - - @SerializedName("HttpsImageUrl") - private String httpsImageUrl; - - @SerializedName("IMAccounts") - private List iMAccounts; - - @SerializedName("ImageUrl") - private String imageUrl; - - @SerializedName("Industry") - private String industry; - - @SerializedName("InspirationalPeople") - private List inspirationalPeople; - - @SerializedName("InterestedIn") - private List interestedIn; - - @SerializedName("Interests") - private List interests; - - @SerializedName("IsEmailSubscribed") - private Boolean isEmailSubscribed; - - @SerializedName("IsGeoEnabled") - private String isGeoEnabled; - - @SerializedName("IsProtected") - private Boolean isProtected; - - @SerializedName("JobBookmarks") - private List jobBookmarks; - - @SerializedName("Languages") - private List languages; - - @SerializedName("LastName") - private String lastName; - - @SerializedName("LocalCity") - private String localCity; - - @SerializedName("LocalCountry") - private String localCountry; - - @SerializedName("LocalLanguage") - private String localLanguage; - - @SerializedName("MainAddress") - private String mainAddress; - - @SerializedName("MemberUrlResources") - private List memberUrlResources; - - @SerializedName("MiddleName") - private String middleName; - - @SerializedName("Movies") - private List movies; - - @SerializedName("MutualFriends") - private List mutualFriends; - - @SerializedName("NickName") - private String nickName; - - @SerializedName("NullSupport") - private Boolean nullSupport; - - @SerializedName("NumRecommenders") - private Integer numRecommenders; - - @SerializedName("Password") - private String password; - - @SerializedName("Patents") - private List patents; - - @SerializedName("PhoneId") - private String phoneId; - - @SerializedName("PhoneNumbers") - private List phoneNumbers; - - @SerializedName("PINInfo") - private PinModel pinInfo; - - @SerializedName("PlacesLived") - private List placesLived; - - @SerializedName("Political") - private String political; - - @SerializedName("Positions") - private List positions; - - @SerializedName("Prefix") - private String prefix; - - @SerializedName("PrivateGists") - private Integer privateGists; - - @SerializedName("ProfessionalHeadline") - private String professionalHeadline; - - @SerializedName("ProfileCity") - private String profileCity; - - @SerializedName("ProfileCountry") - private String profileCountry; - - @SerializedName("ProfileImageUrls") - private Map profileImageUrls; - - @SerializedName("ProfileName") - private String profileName; - - @SerializedName("ProfileUrl") - private String profileUrl; - - @SerializedName("Projects") - private List projects; - - @SerializedName("ProviderAccessCredential") - private ProviderAccessCredential providerAccessCredential; - - @SerializedName("Publications") - private List publications; - - @SerializedName("PublicGists") - private Integer publicGists; - - @SerializedName("PublicRepository") - private String publicRepository; - - @SerializedName("Quota") - private String quota; - - @SerializedName("RecommendationsReceived") - private List recommendationsReceived; - - @SerializedName("RelatedProfileViews") - private List relatedProfileViews; - - @SerializedName("RelationshipStatus") - private String relationshipStatus; - - @SerializedName("Religion") - private String religion; - - @SerializedName("RepositoryUrl") - private String repositoryUrl; - - @SerializedName("SecurityQuestionAnswer") - private Map securityQuestionAnswer; - - @SerializedName("Skills") - private List skills; - - @SerializedName("Sports") - private List sports; - - @SerializedName("StarredUrl") - private String starredUrl; - - @SerializedName("State") - private String state; - - @SerializedName("Subscription") - private GitHubPlan subscription; - - @SerializedName("Suffix") - private String suffix; - - @SerializedName("Suggestions") - private Suggestions suggestions; - - @SerializedName("TagLine") - private String tagLine; - - @SerializedName("TeleVisionShow") - private List teleVisionShow; - - @SerializedName("ThumbnailImageUrl") - private String thumbnailImageUrl; - - @SerializedName("TimeZone") - private String timeZone; - - @SerializedName("TotalPrivateRepository") - private Integer totalPrivateRepository; - - @SerializedName("TotalStatusesCount") - private Integer totalStatusesCount; - - @SerializedName("Uid") - private String uid; - - @SerializedName("UserName") - private String userName; - - @SerializedName("Volunteer") - private List volunteer; - - @SerializedName("WebProfiles") - private Map webProfiles; - - @SerializedName("Website") - private String website; - - - - // - // About value that need to be inserted - // - public String getAbout() { - return about; - } - // - // About value that need to be inserted - // - public void setAbout(String about) { - this.about = about; - } - // - // Array of objects,String represents address of user - // - public List
getAddresses() { - return addresses; - } - // - // Array of objects,String represents address of user - // - public void setAddresses(List
addresses) { - this.addresses = addresses; - } - // - // User's Age - // - public String getAge() { - return age; - } - // - // User's Age - // - public void setAge(String age) { - this.age = age; - } - // - // user's age range. - // - public AgeRange getAgeRange() { - return ageRange; - } - // - // user's age range. - // - public void setAgeRange(AgeRange ageRange) { - this.ageRange = ageRange; - } - // - // Organization a person is assosciated with - // - public String getAssociations() { - return associations; - } - // - // Organization a person is assosciated with - // - public void setAssociations(String associations) { - this.associations = associations; - } - // - // Array of Objects,String represents Id, Name and Issuer - // - public List getAwards() { - return awards; - } - // - // Array of Objects,String represents Id, Name and Issuer - // - public void setAwards(List awards) { - this.awards = awards; - } - // - // User's Badges. - // - public List getBadges() { - return badges; - } - // - // User's Badges. - // - public void setBadges(List badges) { - this.badges = badges; - } - // - // user's birthdate - // - public String getBirthDate() { - return birthDate; - } - // - // user's birthdate - // - public void setBirthDate(String birthDate) { - this.birthDate = birthDate; - } - // - // Array of Objects,String represents Id,Name,Category,CreatedDate - // - public List getBooks() { - return books; - } - // - // Array of Objects,String represents Id,Name,Category,CreatedDate - // - public void setBooks(List books) { - this.books = books; - } - // - // Array of Objects,string represents Id,Name,Authority Number,StartDate,EndDate - // - public List getCertifications() { - return certifications; - } - // - // Array of Objects,string represents Id,Name,Authority Number,StartDate,EndDate - // - public void setCertifications(List certifications) { - this.certifications = certifications; - } - // - // user's city - // - public String getCity() { - return city; - } - // - // user's city - // - public void setCity(String city) { - this.city = city; - } - // - // users company name - // - public String getCompany() { - return company; - } - // - // users company name - // - public void setCompany(String company) { - this.company = company; - } - // - // Country of the user - // - public Country getCountry() { - return country; - } - // - // Country of the user - // - public void setCountry(Country country) { - this.country = country; - } - // - // users course information - // - public List getCourses() { - return courses; - } - // - // users course information - // - public void setCourses(List courses) { - this.courses = courses; - } - // - // URL of the photo that need to be inserted - // - public String getCoverPhoto() { - return coverPhoto; - } - // - // URL of the photo that need to be inserted - // - public void setCoverPhoto(String coverPhoto) { - this.coverPhoto = coverPhoto; - } - // - // Currency - // - public String getCurrency() { - return currency; - } - // - // Currency - // - public void setCurrency(String currency) { - this.currency = currency; - } - // - // Array of Objects,String represents id ,Text ,Source and CreatedDate - // - public List getCurrentStatus() { - return currentStatus; - } - // - // Array of Objects,String represents id ,Text ,Source and CreatedDate - // - public void setCurrentStatus(List currentStatus) { - this.currentStatus = currentStatus; - } - // - // Custom fields as user set on LoginRadius Admin Console. - // - public Map getCustomFields() { - return customFields; - } - // - // Custom fields as user set on LoginRadius Admin Console. - // - public void setCustomFields(Map customFields) { - this.customFields = customFields; - } - // - // Array of Objects,which represents the educations record - // - public List getEducations() { - return educations; - } - // - // Array of Objects,which represents the educations record - // - public void setEducations(List educations) { - this.educations = educations; - } - // - // user's email - // - public List getEmail() { - return email; - } - // - // user's email - // - public void setEmail(List email) { - this.email = email; - } - // - // Array of Objects,string represents SourceId,Source - // - public List getExternalIds() { - return externalIds; - } - // - // Array of Objects,string represents SourceId,Source - // - public void setExternalIds(List externalIds) { - this.externalIds = externalIds; - } - // - // External User Login Id - // - public String getExternalUserLoginId() { - return externalUserLoginId; - } - // - // External User Login Id - // - public void setExternalUserLoginId(String externalUserLoginId) { - this.externalUserLoginId = externalUserLoginId; - } - // - // user's family - // - public List getFamily() { - return family; - } - // - // user's family - // - public void setFamily(List family) { - this.family = family; - } - // - // URL of the favicon that need to be inserted - // - public String getFavicon() { - return favicon; - } - // - // URL of the favicon that need to be inserted - // - public void setFavicon(String favicon) { - this.favicon = favicon; - } - // - // Array of Objects,strings represents Id ,Name ,Type - // - public List getFavoriteThings() { - return favoriteThings; - } - // - // Array of Objects,strings represents Id ,Name ,Type - // - public void setFavoriteThings(List favoriteThings) { - this.favoriteThings = favoriteThings; - } - // - // user's first name - // - public String getFirstName() { - return firstName; - } - // - // user's first name - // - public void setFirstName(String firstName) { - this.firstName = firstName; - } - // - // user's followers count - // - public Integer getFollowersCount() { - return followersCount; - } - // - // user's followers count - // - public void setFollowersCount(Integer followersCount) { - this.followersCount = followersCount; - } - // - // users friends count - // - public Integer getFriendsCount() { - return friendsCount; - } - // - // users friends count - // - public void setFriendsCount(Integer friendsCount) { - this.friendsCount = friendsCount; - } - // - // Users complete name - // - public String getFullName() { - return fullName; - } - // - // Users complete name - // - public void setFullName(String fullName) { - this.fullName = fullName; - } - // - // Array of Objects,string represents Id,Name,Category,CreatedDate - // - public List getGames() { - return games; - } - // - // Array of Objects,string represents Id,Name,Category,CreatedDate - // - public void setGames(List games) { - this.games = games; - } - // - // user's gender - // - public String getGender() { - return gender; - } - // - // user's gender - // - public void setGender(String gender) { - this.gender = gender; - } - // - // Git Repository URL - // - public String getGistsUrl() { - return gistsUrl; - } - // - // Git Repository URL - // - public void setGistsUrl(String gistsUrl) { - this.gistsUrl = gistsUrl; - } - // - // URL of image that need to be inserted - // - public String getGravatarImageUrl() { - return gravatarImageUrl; - } - // - // URL of image that need to be inserted - // - public void setGravatarImageUrl(String gravatarImageUrl) { - this.gravatarImageUrl = gravatarImageUrl; - } - // - // boolean type value, default value is true - // - public Boolean getHireable() { - return hireable; - } - // - // boolean type value, default value is true - // - public void setHireable(Boolean hireable) { - this.hireable = hireable; - } - // - // user's home town name - // - public String getHomeTown() { - return homeTown; - } - // - // user's home town name - // - public void setHomeTown(String homeTown) { - this.homeTown = homeTown; - } - // - // Awards lists from the social provider - // - public String getHonors() { - return honors; - } - // - // Awards lists from the social provider - // - public void setHonors(String honors) { - this.honors = honors; - } - // - // URL of the Image that need to be inserted - // - public String getHttpsImageUrl() { - return httpsImageUrl; - } - // - // URL of the Image that need to be inserted - // - public void setHttpsImageUrl(String httpsImageUrl) { - this.httpsImageUrl = httpsImageUrl; - } - // - // Array of objects, String represents account type and account name. - // - public List getIMAccounts() { - return iMAccounts; - } - // - // Array of objects, String represents account type and account name. - // - public void setIMAccounts(List iMAccounts) { - this.iMAccounts = iMAccounts; - } - // - // image URL should be absolute and has HTTPS domain - // - public String getImageUrl() { - return imageUrl; - } - // - // image URL should be absolute and has HTTPS domain - // - public void setImageUrl(String imageUrl) { - this.imageUrl = imageUrl; - } - // - // Industry name - // - public String getIndustry() { - return industry; - } - // - // Industry name - // - public void setIndustry(String industry) { - this.industry = industry; - } - // - // Array of Objects,string represents Id and Name - // - public List getInspirationalPeople() { - return inspirationalPeople; - } - // - // Array of Objects,string represents Id and Name - // - public void setInspirationalPeople(List inspirationalPeople) { - this.inspirationalPeople = inspirationalPeople; - } - // - // array of string represents interest - // - public List getInterestedIn() { - return interestedIn; - } - // - // array of string represents interest - // - public void setInterestedIn(List interestedIn) { - this.interestedIn = interestedIn; - } - // - // Array of objects, string shows InterestedType and InterestedName - // - public List getInterests() { - return interests; - } - // - // Array of objects, string shows InterestedType and InterestedName - // - public void setInterests(List interests) { - this.interests = interests; - } - // - // boolean type value, default is true - // - public Boolean getIsEmailSubscribed() { - return isEmailSubscribed; - } - // - // boolean type value, default is true - // - public void setIsEmailSubscribed(Boolean isEmailSubscribed) { - this.isEmailSubscribed = isEmailSubscribed; - } - // - // boolean type value, default is true - // - public String getIsGeoEnabled() { - return isGeoEnabled; - } - // - // boolean type value, default is true - // - public void setIsGeoEnabled(String isGeoEnabled) { - this.isGeoEnabled = isGeoEnabled; - } - // - // boolean type value, default is true - // - public Boolean getIsProtected() { - return isProtected; - } - // - // boolean type value, default is true - // - public void setIsProtected(Boolean isProtected) { - this.isProtected = isProtected; - } - // - // Array of Objects,Strings,boolean,object represents IsApplied,ApplyTimestamp,IsSaved,SavedTimestamp,Job - // - public List getJobBookmarks() { - return jobBookmarks; - } - // - // Array of Objects,Strings,boolean,object represents IsApplied,ApplyTimestamp,IsSaved,SavedTimestamp,Job - // - public void setJobBookmarks(List jobBookmarks) { - this.jobBookmarks = jobBookmarks; - } - // - // language known by user's - // - public List getLanguages() { - return languages; - } - // - // language known by user's - // - public void setLanguages(List languages) { - this.languages = languages; - } - // - // user's last name - // - public String getLastName() { - return lastName; - } - // - // user's last name - // - public void setLastName(String lastName) { - this.lastName = lastName; - } - // - // Local City of the user - // - public String getLocalCity() { - return localCity; - } - // - // Local City of the user - // - public void setLocalCity(String localCity) { - this.localCity = localCity; - } - // - // Local country of the user - // - public String getLocalCountry() { - return localCountry; - } - // - // Local country of the user - // - public void setLocalCountry(String localCountry) { - this.localCountry = localCountry; - } - // - // Local language of the user - // - public String getLocalLanguage() { - return localLanguage; - } - // - // Local language of the user - // - public void setLocalLanguage(String localLanguage) { - this.localLanguage = localLanguage; - } - // - // Main address of the user - // - public String getMainAddress() { - return mainAddress; - } - // - // Main address of the user - // - public void setMainAddress(String mainAddress) { - this.mainAddress = mainAddress; - } - // - // Array of Objects,String represents Url,UrlName - // - public List getMemberUrlResources() { - return memberUrlResources; - } - // - // Array of Objects,String represents Url,UrlName - // - public void setMemberUrlResources(List memberUrlResources) { - this.memberUrlResources = memberUrlResources; - } - // - // user's middle name - // - public String getMiddleName() { - return middleName; - } - // - // user's middle name - // - public void setMiddleName(String middleName) { - this.middleName = middleName; - } - // - // Array of Objects,strings represents Id,Name,Category,CreatedDate - // - public List getMovies() { - return movies; - } - // - // Array of Objects,strings represents Id,Name,Category,CreatedDate - // - public void setMovies(List movies) { - this.movies = movies; - } - // - // Array of Objects, strings represents Id,Name,FirstName,LastName,Birthday,Hometown,Link,Gender - // - public List getMutualFriends() { - return mutualFriends; - } - // - // Array of Objects, strings represents Id,Name,FirstName,LastName,Birthday,Hometown,Link,Gender - // - public void setMutualFriends(List mutualFriends) { - this.mutualFriends = mutualFriends; - } - // - // Nick name of the user - // - public String getNickName() { - return nickName; - } - // - // Nick name of the user - // - public void setNickName(String nickName) { - this.nickName = nickName; - } - // - // Boolean, pass true if you wish to update any user profile field with a NULL value, You can get the details - // - public Boolean getNullSupport() { - return nullSupport; - } - // - // Boolean, pass true if you wish to update any user profile field with a NULL value, You can get the details - // - public void setNullSupport(Boolean nullSupport) { - this.nullSupport = nullSupport; - } - // - // Count for the user profile recommended - // - public Integer getNumRecommenders() { - return numRecommenders; - } - // - // Count for the user profile recommended - // - public void setNumRecommenders(Integer numRecommenders) { - this.numRecommenders = numRecommenders; - } - // - // Password for the email - // - public String getPassword() { - return password; - } - // - // Password for the email - // - public void setPassword(String password) { - this.password = password; - } - // - // Patents Registered - // - public List getPatents() { - return patents; - } - // - // Patents Registered - // - public void setPatents(List patents) { - this.patents = patents; - } - // - // Phone ID (Unique Phone Number Identifier of the user) - // - public String getPhoneId() { - return phoneId; - } - // - // Phone ID (Unique Phone Number Identifier of the user) - // - public void setPhoneId(String phoneId) { - this.phoneId = phoneId; - } - // - // Users Phone Number - // - public List getPhoneNumbers() { - return phoneNumbers; - } - // - // Users Phone Number - // - public void setPhoneNumbers(List phoneNumbers) { - this.phoneNumbers = phoneNumbers; - } - // - // PIN Info - // - public PinModel getPINInfo() { - return pinInfo; - } - // - // PIN Info - // - public void setPINInfo(PinModel pinInfo) { - this.pinInfo = pinInfo; - } - // - // Array of Objects,strings Name and boolean IsPrimary - // - public List getPlacesLived() { - return placesLived; - } - // - // Array of Objects,strings Name and boolean IsPrimary - // - public void setPlacesLived(List placesLived) { - this.placesLived = placesLived; - } - // - // List of Political interest - // - public String getPolitical() { - return political; - } - // - // List of Political interest - // - public void setPolitical(String political) { - this.political = political; - } - // - // Array of Objects,which represents the PositionSummary,StartDate,EndDate,IsCurrent,Company,Location - // - public List getPositions() { - return positions; - } - // - // Array of Objects,which represents the PositionSummary,StartDate,EndDate,IsCurrent,Company,Location - // - public void setPositions(List positions) { - this.positions = positions; - } - // - // Prefix for FirstName - // - public String getPrefix() { - return prefix; - } - // - // Prefix for FirstName - // - public void setPrefix(String prefix) { - this.prefix = prefix; - } - // - // user private Repository Urls - // - public Integer getPrivateGists() { - return privateGists; - } - // - // user private Repository Urls - // - public void setPrivateGists(Integer privateGists) { - this.privateGists = privateGists; - } - // - // This field provide by linkedin.contain our linkedin profile headline - // - public String getProfessionalHeadline() { - return professionalHeadline; - } - // - // This field provide by linkedin.contain our linkedin profile headline - // - public void setProfessionalHeadline(String professionalHeadline) { - this.professionalHeadline = professionalHeadline; - } - // - // ProfileCity value that need to be inserted - // - public String getProfileCity() { - return profileCity; - } - // - // ProfileCity value that need to be inserted - // - public void setProfileCity(String profileCity) { - this.profileCity = profileCity; - } - // - // ProfileCountry value that need to be inserted - // - public String getProfileCountry() { - return profileCountry; - } - // - // ProfileCountry value that need to be inserted - // - public void setProfileCountry(String profileCountry) { - this.profileCountry = profileCountry; - } - // - // ProfileImageUrls that need to be inserted - // - public Map getProfileImageUrls() { - return profileImageUrls; - } - // - // ProfileImageUrls that need to be inserted - // - public void setProfileImageUrls(Map profileImageUrls) { - this.profileImageUrls = profileImageUrls; - } - // - // ProfileName value field that need to be inserted - // - public String getProfileName() { - return profileName; - } - // - // ProfileName value field that need to be inserted - // - public void setProfileName(String profileName) { - this.profileName = profileName; - } - // - // User profile url like facebook profile Url - // - public String getProfileUrl() { - return profileUrl; - } - // - // User profile url like facebook profile Url - // - public void setProfileUrl(String profileUrl) { - this.profileUrl = profileUrl; - } - // - // Array of Objects,string represents Id,Name,Summary With StartDate,EndDate,IsCurrent - // - public List getProjects() { - return projects; - } - // - // Array of Objects,string represents Id,Name,Summary With StartDate,EndDate,IsCurrent - // - public void setProjects(List projects) { - this.projects = projects; - } - // - // Object,string represents AccessToken,TokenSecret - // - public ProviderAccessCredential getProviderAccessCredential() { - return providerAccessCredential; - } - // - // Object,string represents AccessToken,TokenSecret - // - public void setProviderAccessCredential(ProviderAccessCredential providerAccessCredential) { - this.providerAccessCredential = providerAccessCredential; - } - // - // Array of Objects,string represents Id,Title,Publisher,Authors,Date,Url,Summary - // - public List getPublications() { - return publications; - } - // - // Array of Objects,string represents Id,Title,Publisher,Authors,Date,Url,Summary - // - public void setPublications(List publications) { - this.publications = publications; - } - // - // gist is a Git repository, which means that it can be forked and cloned. - // - public Integer getPublicGists() { - return publicGists; - } - // - // gist is a Git repository, which means that it can be forked and cloned. - // - public void setPublicGists(Integer publicGists) { - this.publicGists = publicGists; - } - // - // user public Repository Urls - // - public String getPublicRepository() { - return publicRepository; - } - // - // user public Repository Urls - // - public void setPublicRepository(String publicRepository) { - this.publicRepository = publicRepository; - } - // - // Quota - // - public String getQuota() { - return quota; - } - // - // Quota - // - public void setQuota(String quota) { - this.quota = quota; - } - // - // Array of Objects,string represents Id,RecommendationType,RecommendationText,Recommender - // - public List getRecommendationsReceived() { - return recommendationsReceived; - } - // - // Array of Objects,string represents Id,RecommendationType,RecommendationText,Recommender - // - public void setRecommendationsReceived(List recommendationsReceived) { - this.recommendationsReceived = recommendationsReceived; - } - // - // Array of Objects,String represents Id,FirstName,LastName - // - public List getRelatedProfileViews() { - return relatedProfileViews; - } - // - // Array of Objects,String represents Id,FirstName,LastName - // - public void setRelatedProfileViews(List relatedProfileViews) { - this.relatedProfileViews = relatedProfileViews; - } - // - // user's relationship status - // - public String getRelationshipStatus() { - return relationshipStatus; - } - // - // user's relationship status - // - public void setRelationshipStatus(String relationshipStatus) { - this.relationshipStatus = relationshipStatus; - } - // - // String shows users religion - // - public String getReligion() { - return religion; - } - // - // String shows users religion - // - public void setReligion(String religion) { - this.religion = religion; - } - // - // Repository URL - // - public String getRepositoryUrl() { - return repositoryUrl; - } - // - // Repository URL - // - public void setRepositoryUrl(String repositoryUrl) { - this.repositoryUrl = repositoryUrl; - } - // - // Valid JSON object of Unique Security Question ID and Answer of set Security Question - // - public Map getSecurityQuestionAnswer() { - return securityQuestionAnswer; - } - // - // Valid JSON object of Unique Security Question ID and Answer of set Security Question - // - public void setSecurityQuestionAnswer(Map securityQuestionAnswer) { - this.securityQuestionAnswer = securityQuestionAnswer; - } - // - // Array of objects, String represents ID and Name - // - public List getSkills() { - return skills; - } - // - // Array of objects, String represents ID and Name - // - public void setSkills(List skills) { - this.skills = skills; - } - // - // Array of objects, String represents ID and Name - // - public List getSports() { - return sports; - } - // - // Array of objects, String represents ID and Name - // - public void setSports(List sports) { - this.sports = sports; - } - // - // Git users bookmark repositories - // - public String getStarredUrl() { - return starredUrl; - } - // - // Git users bookmark repositories - // - public void setStarredUrl(String starredUrl) { - this.starredUrl = starredUrl; - } - // - // State of the user - // - public String getState() { - return state; - } - // - // State of the user - // - public void setState(String state) { - this.state = state; - } - // - // Object,string represents Name,Space,PrivateRepos,Collaborators - // - public GitHubPlan getSubscription() { - return subscription; - } - // - // Object,string represents Name,Space,PrivateRepos,Collaborators - // - public void setSubscription(GitHubPlan subscription) { - this.subscription = subscription; - } - // - // Suffix for the User. - // - public String getSuffix() { - return suffix; - } - // - // Suffix for the User. - // - public void setSuffix(String suffix) { - this.suffix = suffix; - } - // - // Object,array of objects represents CompaniestoFollow,IndustriestoFollow,NewssourcetoFollow,PeopletoFollow - // - public Suggestions getSuggestions() { - return suggestions; - } - // - // Object,array of objects represents CompaniestoFollow,IndustriestoFollow,NewssourcetoFollow,PeopletoFollow - // - public void setSuggestions(Suggestions suggestions) { - this.suggestions = suggestions; - } - // - // Tagline that need to be inserted - // - public String getTagLine() { - return tagLine; - } - // - // Tagline that need to be inserted - // - public void setTagLine(String tagLine) { - this.tagLine = tagLine; - } - // - // Array of Objects,string represents Id,Name,Category,CreatedDate - // - public List getTeleVisionShow() { - return teleVisionShow; - } - // - // Array of Objects,string represents Id,Name,Category,CreatedDate - // - public void setTeleVisionShow(List teleVisionShow) { - this.teleVisionShow = teleVisionShow; - } - // - // URL for the Thumbnail - // - public String getThumbnailImageUrl() { - return thumbnailImageUrl; - } - // - // URL for the Thumbnail - // - public void setThumbnailImageUrl(String thumbnailImageUrl) { - this.thumbnailImageUrl = thumbnailImageUrl; - } - // - // The Current Time Zone. - // - public String getTimeZone() { - return timeZone; - } - // - // The Current Time Zone. - // - public void setTimeZone(String timeZone) { - this.timeZone = timeZone; - } - // - // Total Private repository - // - public Integer getTotalPrivateRepository() { - return totalPrivateRepository; - } - // - // Total Private repository - // - public void setTotalPrivateRepository(Integer totalPrivateRepository) { - this.totalPrivateRepository = totalPrivateRepository; - } - // - // Count of Total status - // - public Integer getTotalStatusesCount() { - return totalStatusesCount; - } - // - // Count of Total status - // - public void setTotalStatusesCount(Integer totalStatusesCount) { - this.totalStatusesCount = totalStatusesCount; - } - // - // UID, the unified identifier for each user account - // - public String getUid() { - return uid; - } - // - // UID, the unified identifier for each user account - // - public void setUid(String uid) { - this.uid = uid; - } - // - // Username of the user - // - public String getUserName() { - return userName; - } - // - // Username of the user - // - public void setUserName(String userName) { - this.userName = userName; - } - // - // Array of Objects,string represents Id,Role,Organization,Cause - // - public List getVolunteer() { - return volunteer; - } - // - // Array of Objects,string represents Id,Role,Organization,Cause - // - public void setVolunteer(List volunteer) { - this.volunteer = volunteer; - } - // - // Twitter, Facebook ProfileUrls - // - public Map getWebProfiles() { - return webProfiles; - } - // - // Twitter, Facebook ProfileUrls - // - public void setWebProfiles(Map webProfiles) { - this.webProfiles = webProfiles; - } - // - // Personal Website a User has - // - public String getWebsite() { - return website; - } - // - // Personal Website a User has - // - public void setWebsite(String website) { - this.website = website; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Volunteer.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Volunteer.java deleted file mode 100644 index e49521c..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/Volunteer.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for Volunteer Property - // - public class Volunteer { - - - @SerializedName("Cause") - private String cause; - - @SerializedName("Id") - private String id; - - @SerializedName("Organization") - private String organization; - - @SerializedName("Role") - private String role; - - - - // - // Cause of volunteer - // - public String getCause() { - return cause; - } - // - // Cause of volunteer - // - public void setCause(String cause) { - this.cause = cause; - } - // - // Volunteer Id - // - public String getId() { - return id; - } - // - // Volunteer Id - // - public void setId(String id) { - this.id = id; - } - // - // Volunteer organization - // - public String getOrganization() { - return organization; - } - // - // Volunteer organization - // - public void setOrganization(String organization) { - this.organization = organization; - } - // - // Volunteer role - // - public String getRole() { - return role; - } - // - // Volunteer role - // - public void setRole(String role) { - this.role = role; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/WebHookSubscribeModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/WebHookSubscribeModel.java deleted file mode 100644 index 25a7470..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/WebHookSubscribeModel.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.Map; -import java.util.List; -import java.util.UUID; -import com.google.gson.JsonObject; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.*; -import com.google.gson.annotations.SerializedName; -import com.loginradius.sdk.models.requestmodels.*; - - // - // Model Class containing Definition of payload for Webhook Subscribe API - // - public class WebHookSubscribeModel { - - - @SerializedName("Event") - private String event; - - @SerializedName("TargetUrl") - private String targetUrl; - - @SerializedName("Name") - private String name; - - @SerializedName("Headers") - private Map headers; - - @SerializedName("QueryParams") - private Map queryParams; - - @SerializedName("Authentication") - private WebhookAuthenticationModel authentication; - - - - // - // Allowed events: Login, Register, UpdateProfile, ResetPassword, ChangePassword, emailVerification, AddEmail, RemoveEmail, BlockAccount, DeleteAccount, SetUsername, AssignRoles, UnassignRoles, SetPassword, LinkAccount, UnlinkAccount, UpdatePhoneId, VerifyPhoneNumber, CreateCustomObject, UpdateCustomobject, DeleteCustomObject - // - public String getEvent() { - return event; - } - // - // Allowed events: Login, Register, UpdateProfile, ResetPassword, ChangePassword, emailVerification, AddEmail, RemoveEmail, BlockAccount, DeleteAccount, SetUsername, AssignRoles, UnassignRoles, SetPassword, LinkAccount, UnlinkAccount, UpdatePhoneId, VerifyPhoneNumber, CreateCustomObject, UpdateCustomobject, DeleteCustomObject - // - public void setEvent(String event) { - this.event = event; - } - // - // URL where trigger will send data when it invoke - // - public String getTargetUrl() { - return targetUrl; - } - // - // URL where trigger will send data when it invoke - // - public void setTargetUrl(String targetUrl) { - this.targetUrl = targetUrl; - } - // - // Name of the customer - // - public String getName() { - return name; - } - // - // Name of the customer - // - public void setName(String name) { - this.name = name; - } - // - // Custom headers for the webhook - // - public Map getHeaders() { - return headers; - } - // - // Custom headers for the webhook - // - public void setHeaders(Map headers) { - this.headers = headers; - } - // - // Query parameters for the webhook - // - public Map getQueryParams() { - return queryParams; - } - // - // Query parameters for the webhook - // - public void setQueryParams(Map queryParams) { - this.queryParams = queryParams; - } - // - // Authentication details for the webhook - // - public WebhookAuthenticationModel getAuthentication() { - return authentication; - } - // - // Authentication details for the webhook - // - public void setAuthentication(WebhookAuthenticationModel authentication) { - this.authentication = authentication; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/WebHookSubscriptionUpdateModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/WebHookSubscriptionUpdateModel.java deleted file mode 100644 index 76e753d..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/WebHookSubscriptionUpdateModel.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.Map; -import java.util.List; -import java.util.UUID; -import com.google.gson.JsonObject; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.*; -import com.google.gson.annotations.SerializedName; -import com.loginradius.sdk.models.requestmodels.*; - - // - // Model Class containing Definition for WebHookSubscriptionUpdateModel Property - // - public class WebHookSubscriptionUpdateModel { - - - @SerializedName("Headers") - private Map headers; - - @SerializedName("QueryParams") - private Map queryParams; - - @SerializedName("Authentication") - private WebhookAuthenticationModel authentication; - - - - // - // Custom headers for the webhook - // - public Map getHeaders() { - return headers; - } - // - // Custom headers for the webhook - // - public void setHeaders(Map headers) { - this.headers = headers; - } - // - // Query parameters for the webhook - // - public Map getQueryParams() { - return queryParams; - } - // - // Query parameters for the webhook - // - public void setQueryParams(Map queryParams) { - this.queryParams = queryParams; - } - // - // Authentication details for the webhook - // - public WebhookAuthenticationModel getAuthentication() { - return authentication; - } - // - // Authentication details for the webhook - // - public void setAuthentication(WebhookAuthenticationModel authentication) { - this.authentication = authentication; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/WebhookAuthCredentials.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/WebhookAuthCredentials.java deleted file mode 100644 index c1988aa..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/WebhookAuthCredentials.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.Map; -import java.util.List; -import java.util.UUID; -import com.google.gson.JsonObject; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.*; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for WebhookAuthCredentials Property - // - public class WebhookAuthCredentials { - - - @SerializedName("Username") - private String username; - - @SerializedName("Password") - private String password; - - - - // - // Username of the user - // - public String getUsername() { - return username; - } - // - // Username of the user - // - public void setUsername(String username) { - this.username = username; - } - // - // Password for the email - // - public String getPassword() { - return password; - } - // - // Password for the email - // - public void setPassword(String password) { - this.password = password; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/WebhookAuthenticationModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/WebhookAuthenticationModel.java deleted file mode 100644 index cc0ba39..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/WebhookAuthenticationModel.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.Map; -import java.util.List; -import java.util.UUID; -import com.google.gson.JsonObject; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.*; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for WebhookAuthenticationModel Property - // - public class WebhookAuthenticationModel { - - - @SerializedName("AuthType") - private String authType; - - @SerializedName("BasicAuth") - private WebhookAuthCredentials basicAuth; - - @SerializedName("BearerToken") - private WebhookBearerToken bearerToken; - - - - // - // Webhook Authentication Type - // - public String getAuthType() { - return authType; - } - // - // Webhook Authentication Type - // - public void setAuthType(String authType) { - this.authType = authType; - } - // - // Webhook Basic Authentication - // - public WebhookAuthCredentials getBasicAuth() { - return basicAuth; - } - // - // Webhook Basic Authentication - // - public void setBasicAuth(WebhookAuthCredentials basicAuth) { - this.basicAuth = basicAuth; - } - // - // Bearer Token for authentication - // - public WebhookBearerToken getBearerToken() { - return bearerToken; - } - // - // Bearer Token for authentication - // - public void setBearerToken(WebhookBearerToken bearerToken) { - this.bearerToken = bearerToken; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/WebhookBearerToken.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/WebhookBearerToken.java deleted file mode 100644 index c58fc2b..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/requestmodels/WebhookBearerToken.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.requestmodels; -import java.util.Map; -import java.util.List; -import java.util.UUID; -import com.google.gson.JsonObject; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.*; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for WebhookBearerToken Property - // - public class WebhookBearerToken { - - - @SerializedName("Token") - private String token; - - - - // - // Webhook Bearer Token - // - public String getToken() { - return token; - } - // - // Webhook Bearer Token - // - public void setToken(String token) { - this.token = token; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/AccessToken.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/AccessToken.java deleted file mode 100644 index 6fa91e4..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/AccessToken.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition of Complete Profile data - // - public class AccessToken extends AccessTokenBase { - - - @SerializedName("Profile") - private T profile; - - - - // - // Complete user profile data - // - public T getProfile() { - return profile; - } - // - // Complete user profile data - // - public void setProfile(T profile) { - this.profile = profile; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/AccessTokenBase.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/AccessTokenBase.java deleted file mode 100644 index cae7bcc..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/AccessTokenBase.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels; -import java.util.UUID; - -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition of Complete Token data - // - public class AccessTokenBase { - - - @SerializedName("access_token") - private UUID access_token; - - @SerializedName("expires_in") - private String expires_in; - - @SerializedName("refresh_token") - private UUID refresh_token; - - @SerializedName("session_expires_in") - private String session_expires_in; - - @SerializedName("session_token") - private UUID session_token; - - - - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // - public UUID getAccess_Token() { - return access_token; - } - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // - public void setAccess_Token(UUID access_token) { - this.access_token = access_token; - } - // - // Expiration time of Access Token - // - public String getExpires_In() { - return expires_in; - } - // - // Expiration time of Access Token - // - public void setExpires_In(String expires_in) { - this.expires_in = expires_in; - } - // - // refresh token to refresh access token - // - public UUID getRefresh_Token() { - return refresh_token; - } - // - // refresh token to refresh access token - // - public void setRefresh_Token(UUID refresh_token) { - this.refresh_token = refresh_token; - } - // - // session token expiry time - // - public String getSession_expires_in() { - return session_expires_in; - } - // - // session token expiry time - // - public void setSession_expires_in(String session_expires_in) { - this.session_expires_in = session_expires_in; - } - // - // session token of user - // - public UUID getSession_token() { - return session_token; - } - // - // session token of user - // - public void setSession_token(UUID session_token) { - this.session_token = session_token; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/ActiveSessionDetail.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/ActiveSessionDetail.java deleted file mode 100644 index 51f8aa6..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/ActiveSessionDetail.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition of Complete ActiveSession data - // - public class ActiveSessionDetail { - - - @SerializedName("AccessToken") - private String accessToken; - - @SerializedName("Browser") - private String browser; - - @SerializedName("City") - private String city; - - @SerializedName("Country") - private String country; - - @SerializedName("Device") - private String device; - - @SerializedName("DeviceType") - private String deviceType; - - @SerializedName("Ip") - private String ip; - - @SerializedName("LoginDate") - private String loginDate; - - @SerializedName("Os") - private String os; - - - - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // - public String getAccessToken() { - return accessToken; - } - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - // - // Browser details of user - // - public String getBrowser() { - return browser; - } - // - // Browser details of user - // - public void setBrowser(String browser) { - this.browser = browser; - } - // - // user's city - // - public String getCity() { - return city; - } - // - // user's city - // - public void setCity(String city) { - this.city = city; - } - // - // Country of the user - // - public String getCountry() { - return country; - } - // - // Country of the user - // - public void setCountry(String country) { - this.country = country; - } - // - // Device of user - // - public String getDevice() { - return device; - } - // - // Device of user - // - public void setDevice(String device) { - this.device = device; - } - // - // type of device - // - public String getDeviceType() { - return deviceType; - } - // - // type of device - // - public void setDeviceType(String deviceType) { - this.deviceType = deviceType; - } - // - // IP of user - // - public String getIp() { - return ip; - } - // - // IP of user - // - public void setIp(String ip) { - this.ip = ip; - } - // - // last login date - // - public String getLoginDate() { - return loginDate; - } - // - // last login date - // - public void setLoginDate(String loginDate) { - this.loginDate = loginDate; - } - // - // Os Details of user - // - public String getOs() { - return os; - } - // - // Os Details of user - // - public void setOs(String os) { - this.os = os; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/ConsentLogsResponseModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/ConsentLogsResponseModel.java deleted file mode 100644 index 470947c..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/ConsentLogsResponseModel.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // Response containing consent logs - // - public class ConsentLogsResponseModel { - - - @SerializedName("ConsentLogs") - private List consentLogs; - - @SerializedName("Uid") - private String uid; - - - - // - // List of consent logs - // - public List getConsentLogs() { - return consentLogs; - } - // - // List of consent logs - // - public void setConsentLogs(List consentLogs) { - this.consentLogs = consentLogs; - } - // - // UID, the unified identifier for each user account - // - public String getUid() { - return uid; - } - // - // UID, the unified identifier for each user account - // - public void setUid(String uid) { - this.uid = uid; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/ConsentOption.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/ConsentOption.java deleted file mode 100644 index 36aa520..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/ConsentOption.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels; -import com.google.gson.annotations.SerializedName; - - // - // Response containing consent information - // - public class ConsentOption { - - - @SerializedName("AcceptOnDate") - private String acceptOnDate; - - @SerializedName("ConsentOptionId") - private String consentOptionId; - - - - // - // Consent Accept on Date - // - public String getAcceptOnDate() { - return acceptOnDate; - } - // - // Consent Accept on Date - // - public void setAcceptOnDate(String acceptOnDate) { - this.acceptOnDate = acceptOnDate; - } - // - // Consent Option Id - // - public String getConsentOptionId() { - return consentOptionId; - } - // - // Consent Option Id - // - public void setConsentOptionId(String consentOptionId) { - this.consentOptionId = consentOptionId; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/ConsentProfile.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/ConsentProfile.java deleted file mode 100644 index d607ca3..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/ConsentProfile.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // Response containing consent profile - // - public class ConsentProfile { - - - @SerializedName("AcceptedConsentVersions") - private List acceptedConsentVersions; - - @SerializedName("Consents") - private List consents; - - - - // - // List of consent version - // - public List getAcceptedConsentVersions() { - return acceptedConsentVersions; - } - // - // List of consent version - // - public void setAcceptedConsentVersions(List acceptedConsentVersions) { - this.acceptedConsentVersions = acceptedConsentVersions; - } - // - // List of Consents - // - public List getConsents() { - return consents; - } - // - // List of Consents - // - public void setConsents(List consents) { - this.consents = consents; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/ConsentProfileLog.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/ConsentProfileLog.java deleted file mode 100644 index 020bde9..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/ConsentProfileLog.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels; -import com.google.gson.annotations.SerializedName; -import com.loginradius.sdk.models.enums.ConsentProfileActions; - - // - // Response containing consent profile logs - // - public class ConsentProfileLog { - - - @SerializedName("ConsentId") - private String consentId; - - @SerializedName("Event") - private ConsentProfileActions event; - - - - // - // Consent ID - // - public String getConsentId() { - return consentId; - } - // - // Consent ID - // - public void setConsentId(String consentId) { - this.consentId = consentId; - } - // - // ConsentProfileActions - // - public ConsentProfileActions getEvent() { - return event; - } - // - // ConsentProfileActions - // - public void setEvent(ConsentProfileActions event) { - this.event = event; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/ConsentProfileLogs.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/ConsentProfileLogs.java deleted file mode 100644 index ed0a63f..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/ConsentProfileLogs.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels; -import java.util.List; - -import com.google.gson.annotations.SerializedName; -import com.loginradius.sdk.models.enums.ConsentProfileUpdateType; - - // - // Response containg consent profile logs - // - public class ConsentProfileLogs { - - - @SerializedName("ConsentLogs") - private List consentLogs; - - @SerializedName("CurrentConsentFormsVersions") - private List currentConsentFormsVersions; - - @SerializedName("Host") - private String host; - - @SerializedName("Id") - private String id; - - @SerializedName("IP") - private String iP; - - @SerializedName("LoggedOnDate") - private String loggedOnDate; - - @SerializedName("UpdateType") - private ConsentProfileUpdateType updateType; - - @SerializedName("UserAgent") - private String userAgent; - - - - // - // List of consent logs - // - public List getConsentLogs() { - return consentLogs; - } - // - // List of consent logs - // - public void setConsentLogs(List consentLogs) { - this.consentLogs = consentLogs; - } - // - // List of consetforms version - // - public List getCurrentConsentFormsVersions() { - return currentConsentFormsVersions; - } - // - // List of consetforms version - // - public void setCurrentConsentFormsVersions(List currentConsentFormsVersions) { - this.currentConsentFormsVersions = currentConsentFormsVersions; - } - // - // Host name - // - public String getHost() { - return host; - } - // - // Host name - // - public void setHost(String host) { - this.host = host; - } - // - // ID of the User - // - public String getId() { - return id; - } - // - // ID of the User - // - public void setId(String id) { - this.id = id; - } - // - // users ip address - // - public String getIP() { - return iP; - } - // - // users ip address - // - public void setIP(String iP) { - this.iP = iP; - } - // - // Logged On Date - // - public String getLoggedOnDate() { - return loggedOnDate; - } - // - // Logged On Date - // - public void setLoggedOnDate(String loggedOnDate) { - this.loggedOnDate = loggedOnDate; - } - // - // Consent Profile Update Type - // - public ConsentProfileUpdateType getUpdateType() { - return updateType; - } - // - // Consent Profile Update Type - // - public void setUpdateType(ConsentProfileUpdateType updateType) { - this.updateType = updateType; - } - // - // UserAgent - // - public String getUserAgent() { - return userAgent; - } - // - // UserAgent - // - public void setUserAgent(String userAgent) { - this.userAgent = userAgent; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/ConsentProfileValidResponse.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/ConsentProfileValidResponse.java deleted file mode 100644 index 9147708..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/ConsentProfileValidResponse.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels; -import com.google.gson.annotations.SerializedName; - - // - // Response containing consent profile - // - public class ConsentProfileValidResponse { - - - @SerializedName("ConsentProfile") - private ConsentProfile consentProfile; - - @SerializedName("IsValid") - private Boolean isValid; - - - - // - // Consent Profile - // - public ConsentProfile getConsentProfile() { - return consentProfile; - } - // - // Consent Profile - // - public void setConsentProfile(ConsentProfile consentProfile) { - this.consentProfile = consentProfile; - } - // - // check data is validate - // - public Boolean getIsValid() { - return isValid; - } - // - // check data is validate - // - public void setIsValid(Boolean isValid) { - this.isValid = isValid; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/ConsentVersions.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/ConsentVersions.java deleted file mode 100644 index 3402f8a..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/ConsentVersions.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels; -import com.google.gson.annotations.SerializedName; - - // - // Response containing consent version information - // - public class ConsentVersions { - - - @SerializedName("Event") - private String event; - - @SerializedName("IsCustom") - private Boolean isCustom; - - @SerializedName("Version") - private Integer version; - - - - // - // Allowed events: Login, Register, UpdateProfile, ResetPassword, ChangePassword, emailVerification, AddEmail, RemoveEmail, BlockAccount, DeleteAccount, SetUsername, AssignRoles, UnassignRoles, SetPassword, LinkAccount, UnlinkAccount, UpdatePhoneId, VerifyPhoneNumber, CreateCustomObject, UpdateCustomobject, DeleteCustomObject - // - public String getEvent() { - return event; - } - // - // Allowed events: Login, Register, UpdateProfile, ResetPassword, ChangePassword, emailVerification, AddEmail, RemoveEmail, BlockAccount, DeleteAccount, SetUsername, AssignRoles, UnassignRoles, SetPassword, LinkAccount, UnlinkAccount, UpdatePhoneId, VerifyPhoneNumber, CreateCustomObject, UpdateCustomobject, DeleteCustomObject - // - public void setEvent(String event) { - this.event = event; - } - // - // true/false - // - public Boolean getIsCustom() { - return isCustom; - } - // - // true/false - // - public void setIsCustom(Boolean isCustom) { - this.isCustom = isCustom; - } - // - // privacy policy version - // - public Integer getVersion() { - return version; - } - // - // privacy policy version - // - public void setVersion(Integer version) { - this.version = version; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/EmailOtpStatus.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/EmailOtpStatus.java deleted file mode 100644 index a4cefd5..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/EmailOtpStatus.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels; -import com.google.gson.annotations.SerializedName; - - // - // - // - public class EmailOtpStatus { - - - @SerializedName("Email") - private String email; - - - - // - // - // - public String getEmail() { - return email; - } - // - // - // - public void setEmail(String email) { - this.email = email; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/EntityPermissionAcknowledgement.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/EntityPermissionAcknowledgement.java deleted file mode 100644 index 4c3c679..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/EntityPermissionAcknowledgement.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition of Complete Validation data - // - public class EntityPermissionAcknowledgement { - - - @SerializedName("IsAllowed") - private Boolean isAllowed; - - - - // - // Webhook is allowed or not - // - public Boolean getIsAllowed() { - return isAllowed; - } - // - // Webhook is allowed or not - // - public void setIsAllowed(Boolean isAllowed) { - this.isAllowed = isAllowed; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/EventBasedMultiFactorAuthenticationToken.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/EventBasedMultiFactorAuthenticationToken.java deleted file mode 100644 index 75eebbf..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/EventBasedMultiFactorAuthenticationToken.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels; -import java.util.UUID; - -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition response of MFA reauthentication - // - public class EventBasedMultiFactorAuthenticationToken { - - - @SerializedName("ExpireIn") - private String expireIn; - - @SerializedName("SecondFactorValidationToken") - private UUID secondFactorValidationToken; - - - - // - // Expiration time of Access Token - // - public String getExpireIn() { - return expireIn; - } - // - // Expiration time of Access Token - // - public void setExpireIn(String expireIn) { - this.expireIn = expireIn; - } - // - // second factor validation token - // - public UUID getSecondFactorValidationToken() { - return secondFactorValidationToken; - } - // - // second factor validation token - // - public void setSecondFactorValidationToken(UUID secondFactorValidationToken) { - this.secondFactorValidationToken = secondFactorValidationToken; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/ListData.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/ListData.java deleted file mode 100644 index 151b685..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/ListData.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition of Complete List data - // - public class ListData { - - - @SerializedName("Count") - private int count; - - @SerializedName("data") - private List data; - - - - // - // count - // - public int getCount() { - return count; - } - // - // count - // - public void setCount(int count) { - this.count = count; - } - // - // Data - // - public List getData() { - return data; - } - // - // Data - // - public void setData(List data) { - this.data = data; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/ListReturn.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/ListReturn.java deleted file mode 100644 index f6643f0..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/ListReturn.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition of Complete List data - // - public class ListReturn { - - - @SerializedName("Data") - private List data; - - - - // - // Data - // - public List getData() { - return data; - } - // - // Data - // - public void setData(List data) { - this.data = data; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/MultiFactorAuthenticationResponse.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/MultiFactorAuthenticationResponse.java deleted file mode 100644 index 6cf4e94..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/MultiFactorAuthenticationResponse.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels; -import java.util.UUID; - -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition of Complete Multi-Factor Authentication data - // - public class MultiFactorAuthenticationResponse { - - - @SerializedName("access_token") - private UUID access_token; - - @SerializedName("expires_in") - private String expires_in; - - @SerializedName("Profile") - private T profile; - - @SerializedName("refresh_token") - private UUID refresh_token; - - @SerializedName("SecondFactorAuthentication") - private MultiFactorAuthenticationToken secondFactorAuthentication; - - - - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // - public UUID getAccess_Token() { - return access_token; - } - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // - public void setAccess_Token(UUID access_token) { - this.access_token = access_token; - } - // - // Expiration time of Access Token - // - public String getExpires_In() { - return expires_in; - } - // - // Expiration time of Access Token - // - public void setExpires_In(String expires_in) { - this.expires_in = expires_in; - } - // - // Complete user profile data - // - public T getProfile() { - return profile; - } - // - // Complete user profile data - // - public void setProfile(T profile) { - this.profile = profile; - } - // - // refresh token to refresh access token - // - public UUID getRefresh_Token() { - return refresh_token; - } - // - // refresh token to refresh access token - // - public void setRefresh_Token(UUID refresh_token) { - this.refresh_token = refresh_token; - } - // - // second factor authentication - // - public MultiFactorAuthenticationToken getSecondFactorAuthentication() { - return secondFactorAuthentication; - } - // - // second factor authentication - // - public void setSecondFactorAuthentication(MultiFactorAuthenticationToken secondFactorAuthentication) { - this.secondFactorAuthentication = secondFactorAuthentication; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/MultiFactorAuthenticationSettingsResponse.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/MultiFactorAuthenticationSettingsResponse.java deleted file mode 100644 index a96e5b0..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/MultiFactorAuthenticationSettingsResponse.java +++ /dev/null @@ -1,186 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition of Complete Multi-Factor Authentication Settings data - // - public class MultiFactorAuthenticationSettingsResponse { - - - @SerializedName("Email") - private List email; - - @SerializedName("EmailOTPStatus") - private EmailOtpStatus emailOTPStatus; - - @SerializedName("IsEmailOtpAuthenticatorVerified") - private Boolean isEmailOtpAuthenticatorVerified; - - @SerializedName("IsGoogleAuthenticatorVerified") - private Boolean isGoogleAuthenticatorVerified; - - @SerializedName("IsOTPAuthenticatorVerified") - private Boolean isOTPAuthenticatorVerified; - - @SerializedName("IsSecurityQuestionAuthenticatorVerified") - private Boolean isSecurityQuestionAuthenticatorVerified; - - @SerializedName("ManualEntryCode") - private String manualEntryCode; - - @SerializedName("OTPPhoneNo") - private String oTPPhoneNo; - - @SerializedName("OTPStatus") - private SmsResponseData oTPStatus; - - @SerializedName("QRCode") - private String qRCode; - - @SerializedName("SecurityQuestions") - private List securityQuestions; - - - - // - // - // - public List getEmail() { - return email; - } - // - // - // - public void setEmail(List email) { - this.email = email; - } - // - // - // - public EmailOtpStatus getEmailOTPStatus() { - return emailOTPStatus; - } - // - // - // - public void setEmailOTPStatus(EmailOtpStatus emailOTPStatus) { - this.emailOTPStatus = emailOTPStatus; - } - // - // - // - public Boolean getIsEmailOtpAuthenticatorVerified() { - return isEmailOtpAuthenticatorVerified; - } - // - // - // - public void setIsEmailOtpAuthenticatorVerified(Boolean isEmailOtpAuthenticatorVerified) { - this.isEmailOtpAuthenticatorVerified = isEmailOtpAuthenticatorVerified; - } - // - // google authenticator verified or not - // - public Boolean getIsGoogleAuthenticatorVerified() { - return isGoogleAuthenticatorVerified; - } - // - // google authenticator verified or not - // - public void setIsGoogleAuthenticatorVerified(Boolean isGoogleAuthenticatorVerified) { - this.isGoogleAuthenticatorVerified = isGoogleAuthenticatorVerified; - } - // - // OTP authenticator verified or not - // - public Boolean getIsOTPAuthenticatorVerified() { - return isOTPAuthenticatorVerified; - } - // - // OTP authenticator verified or not - // - public void setIsOTPAuthenticatorVerified(Boolean isOTPAuthenticatorVerified) { - this.isOTPAuthenticatorVerified = isOTPAuthenticatorVerified; - } - // - // - // - public Boolean getIsSecurityQuestionAuthenticatorVerified() { - return isSecurityQuestionAuthenticatorVerified; - } - // - // - // - public void setIsSecurityQuestionAuthenticatorVerified(Boolean isSecurityQuestionAuthenticatorVerified) { - this.isSecurityQuestionAuthenticatorVerified = isSecurityQuestionAuthenticatorVerified; - } - // - // Manual entry code - // - public String getManualEntryCode() { - return manualEntryCode; - } - // - // Manual entry code - // - public void setManualEntryCode(String manualEntryCode) { - this.manualEntryCode = manualEntryCode; - } - // - // Otp phone number - // - public String getOTPPhoneNo() { - return oTPPhoneNo; - } - // - // Otp phone number - // - public void setOTPPhoneNo(String oTPPhoneNo) { - this.oTPPhoneNo = oTPPhoneNo; - } - // - // OTP status - // - public SmsResponseData getOTPStatus() { - return oTPStatus; - } - // - // OTP status - // - public void setOTPStatus(SmsResponseData oTPStatus) { - this.oTPStatus = oTPStatus; - } - // - // QR code - // - public String getQRCode() { - return qRCode; - } - // - // QR code - // - public void setQRCode(String qRCode) { - this.qRCode = qRCode; - } - // - // Response containing Definition for Complete SecurityQuestions data - // - public List getSecurityQuestions() { - return securityQuestions; - } - // - // Response containing Definition for Complete SecurityQuestions data - // - public void setSecurityQuestions(List securityQuestions) { - this.securityQuestions = securityQuestions; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/MultiFactorAuthenticationToken.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/MultiFactorAuthenticationToken.java deleted file mode 100644 index acda5aa..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/MultiFactorAuthenticationToken.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels; -import java.util.UUID; - -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete MFAuthentication Token - // - public class MultiFactorAuthenticationToken extends MultiFactorAuthenticationSettingsResponse { - - - @SerializedName("ExpireIn") - private String expireIn; - - @SerializedName("SecondFactorAuthenticationToken") - private UUID secondFactorAuthenticationToken; - - - - // - // Expiration time of Access Token - // - public String getExpireIn() { - return expireIn; - } - // - // Expiration time of Access Token - // - public void setExpireIn(String expireIn) { - this.expireIn = expireIn; - } - // - // second factor authentication token - // - public UUID getSecondFactorAuthenticationToken() { - return secondFactorAuthenticationToken; - } - // - // second factor authentication token - // - public void setSecondFactorAuthenticationToken(UUID secondFactorAuthenticationToken) { - this.secondFactorAuthenticationToken = secondFactorAuthenticationToken; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/MultiToken.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/MultiToken.java deleted file mode 100644 index 569bf36..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/MultiToken.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete MultiToken - // - public class MultiToken { - - - @SerializedName("ExpiresIn") - private String expiresIn; - - @SerializedName("IdentityProviders") - private List identityProviders; - - @SerializedName("Token") - private String token; - - - - // - // - // - public String getExpiresIn() { - return expiresIn; - } - // - // - // - public void setExpiresIn(String expiresIn) { - this.expiresIn = expiresIn; - } - // - // Identity providers - // - public List getIdentityProviders() { - return identityProviders; - } - // - // Identity providers - // - public void setIdentityProviders(List identityProviders) { - this.identityProviders = identityProviders; - } - // - // Token - // - public String getToken() { - return token; - } - // - // Token - // - public void setToken(String token) { - this.token = token; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/PostMethodResponseBase.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/PostMethodResponseBase.java deleted file mode 100644 index 516928e..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/PostMethodResponseBase.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Validation data - // - public class PostMethodResponseBase { - - - @SerializedName("isPosted") - private Boolean isPosted; - - - - // - // check data is posted - // - public Boolean getIsPosted() { - return isPosted; - } - // - // check data is posted - // - public void setIsPosted(Boolean isPosted) { - this.isPosted = isPosted; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/SecurityQuestions.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/SecurityQuestions.java deleted file mode 100644 index b4455e7..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/SecurityQuestions.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete SecurityQuestions data - // - public class SecurityQuestions { - - - @SerializedName("Question") - private String question; - - @SerializedName("QuestionId") - private String questionId; - - - - // - // Question - // - public String getQuestion() { - return question; - } - // - // Question - // - public void setQuestion(String question) { - this.question = question; - } - // - // Id of question - // - public String getQuestionId() { - return questionId; - } - // - // Id of question - // - public void setQuestionId(String questionId) { - this.questionId = questionId; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/SmsResponseData.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/SmsResponseData.java deleted file mode 100644 index c8910c7..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/SmsResponseData.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete SMS data - // - public class SmsResponseData { - - - @SerializedName("AccountSid") - private String accountSid; - - @SerializedName("Sid") - private String sid; - - - - // - // Account Sid - // - public String getAccountSid() { - return accountSid; - } - // - // Account Sid - // - public void setAccountSid(String accountSid) { - this.accountSid = accountSid; - } - // - // Sid - // - public String getSid() { - return sid; - } - // - // Sid - // - public void setSid(String sid) { - this.sid = sid; - } - } diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/SottResponseData.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/SottResponseData.java deleted file mode 100644 index df6fd2c..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/SottResponseData.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Sott data - // - public class SottResponseData { - - - @SerializedName("ExpiryTime") - private String expiryTime; - - @SerializedName("Sott") - private String sott; - - - - // - // Sott expiry time - // - public String getExpiryTime() { - return expiryTime; - } - // - // Sott expiry time - // - public void setExpiryTime(String expiryTime) { - this.expiryTime = expiryTime; - } - // - // SOTT is a secure one time token - // - public String getSott() { - return sott; - } - // - // SOTT is a secure one time token - // - public void setSott(String sott) { - this.sott = sott; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/SsoJwtResponseData.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/SsoJwtResponseData.java deleted file mode 100644 index 77b5699..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/SsoJwtResponseData.java +++ /dev/null @@ -1,28 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels; - -import com.google.gson.annotations.SerializedName; - -// -// Response containing Definition of Jwt Response Data -// -public class SsoJwtResponseData { - - @SerializedName("signature") - private String signature; - - public String getSignature() { - return signature; - } - - public void setSignature(String signature) { - this.signature = signature; - } - -} \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/UserActiveSession.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/UserActiveSession.java deleted file mode 100644 index e345f98..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/UserActiveSession.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete active sessions - // - public class UserActiveSession { - - - @SerializedName("data") - private List data; - - @SerializedName("nextCursor") - private int nextCursor; - - - - // - // Data - // - public List getData() { - return data; - } - // - // Data - // - public void setData(List data) { - this.data = data; - } - // - // Cursor value if not all contacts can be retrieved once. - // - public int getNextCursor() { - return nextCursor; - } - // - // Cursor value if not all contacts can be retrieved once. - // - public void setNextCursor(int nextCursor) { - this.nextCursor = nextCursor; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/UserCustomObjectData.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/UserCustomObjectData.java deleted file mode 100644 index 7d2db48..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/UserCustomObjectData.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels; -import com.google.gson.JsonObject; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete user custom object data - // - public class UserCustomObjectData { - - - @SerializedName("CustomObject") - private JsonObject customObject; - - @SerializedName("DateCreated") - private String dateCreated; - - @SerializedName("DateModified") - private String dateModified; - - @SerializedName("Id") - private String id; - - @SerializedName("IsActive") - private Boolean isActive; - - @SerializedName("IsDeleted") - private Boolean isDeleted; - - @SerializedName("Uid") - private String uid; - - - - // - // custom object - // - public JsonObject getCustomObject() { - return customObject; - } - // - // custom object - // - public void setCustomObject(JsonObject customObject) { - this.customObject = customObject; - } - // - // Custom object created date - // - public String getDateCreated() { - return dateCreated; - } - // - // Custom object created date - // - public void setDateCreated(String dateCreated) { - this.dateCreated = dateCreated; - } - // - // Custom object modified date - // - public String getDateModified() { - return dateModified; - } - // - // Custom object modified date - // - public void setDateModified(String dateModified) { - this.dateModified = dateModified; - } - // - // Custom object id - // - public String getId() { - return id; - } - // - // Custom object id - // - public void setId(String id) { - this.id = id; - } - // - // boolean type value, default is true - // - public Boolean getIsActive() { - return isActive; - } - // - // boolean type value, default is true - // - public void setIsActive(Boolean isActive) { - this.isActive = isActive; - } - // - // boolean type value, default is true - // - public Boolean getIsDeleted() { - return isDeleted; - } - // - // boolean type value, default is true - // - public void setIsDeleted(Boolean isDeleted) { - this.isDeleted = isDeleted; - } - // - // UID, the unified identifier for each user account - // - public String getUid() { - return uid; - } - // - // UID, the unified identifier for each user account - // - public void setUid(String uid) { - this.uid = uid; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/UserPasswordHash.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/UserPasswordHash.java deleted file mode 100644 index e1d2e4b..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/UserPasswordHash.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete PasswordHash data - // - public class UserPasswordHash { - - - @SerializedName("PasswordHash") - private String passwordHash; - - - - // - // Password hash - // - public String getPasswordHash() { - return passwordHash; - } - // - // Password hash - // - public void setPasswordHash(String passwordHash) { - this.passwordHash = passwordHash; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/WebHookEventModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/WebHookEventModel.java deleted file mode 100644 index db7cd6f..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/WebHookEventModel.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels; -import java.util.Map; -import java.util.List; -import java.util.UUID; -import com.google.gson.JsonObject; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.*; -import com.google.gson.annotations.SerializedName; - - // - // Model Class containing Definition for WebHookEventModel Property - // - public class WebHookEventModel { - - - @SerializedName("Data") - private List data; - - - - // - // Data - // - public List getData() { - return data; - } - // - // Data - // - public void setData(List data) { - this.data = data; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/ApiRequestSigningConfig.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/ApiRequestSigningConfig.java deleted file mode 100644 index 478ccf6..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/ApiRequestSigningConfig.java +++ /dev/null @@ -1,44 +0,0 @@ - -package com.loginradius.sdk.models.responsemodels.configobjects; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - -public class ApiRequestSigningConfig { - - @SerializedName("IsEnabled") - @Expose - private Boolean isEnabled; - @SerializedName("Mode") - @Expose - private String mode; - - /// - /// IsEnabled - /// - public Boolean getIsEnabled() { - return isEnabled; - } - - /// - /// IsEnabled - /// - public void setIsEnabled(Boolean isEnabled) { - this.isEnabled = isEnabled; - } - - /// - /// ApiRequestSigningConfig's Mode - /// - public String getMode() { - return mode; - } - - /// - /// ApiRequestSigningConfig's Mode - /// - public void setMode(String mode) { - this.mode = mode; - } - -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/ApiVersion.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/ApiVersion.java deleted file mode 100644 index 3d5d782..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/ApiVersion.java +++ /dev/null @@ -1,44 +0,0 @@ - -package com.loginradius.sdk.models.responsemodels.configobjects; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - -public class ApiVersion { - - @SerializedName("v1") - @Expose - private Boolean v1; - @SerializedName("v2") - @Expose - private Boolean v2; - - /// - /// APIVersion V1 - /// - public Boolean getV1() { - return v1; - } - - /// - /// APIVersion V1 - /// - public void setV1(Boolean v1) { - this.v1 = v1; - } - - /// - /// APIVersion V2 - /// - public Boolean getV2() { - return v2; - } - - /// - /// APIVersion V2 - /// - public void setV2(Boolean v2) { - this.v2 = v2; - } - -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/Apis.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/Apis.java deleted file mode 100644 index 8efbbb3..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/Apis.java +++ /dev/null @@ -1,129 +0,0 @@ - -package com.loginradius.sdk.models.responsemodels.configobjects; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - -public class Apis { - - @SerializedName("PostForgotPasswordByEmail") - @Expose - private Boolean postForgotPasswordByEmail; - @SerializedName("PostForgotPasswordByPhone") - @Expose - private Boolean postForgotPasswordByPhone; - @SerializedName("PutChangePassword") - @Expose - private Boolean putChangePassword; - @SerializedName("PostLoginByEmailAndPassword") - @Expose - private Boolean postLoginByEmailAndPassword; - @SerializedName("PostLoginByUserNameAndPassword") - @Expose - private Boolean postLoginByUserNameAndPassword; - @SerializedName("PostLoginByPhoneAndPassword") - @Expose - private Boolean postLoginByPhoneAndPassword; - @SerializedName("PutUpdateProfile") - @Expose - private Boolean putUpdateProfile; - - /// - /// PostForgotPasswordByEmail - /// - public Boolean getPostForgotPasswordByEmail() { - return postForgotPasswordByEmail; - } - - /// - /// PostForgotPasswordByEmail - /// - public void setPostForgotPasswordByEmail(Boolean postForgotPasswordByEmail) { - this.postForgotPasswordByEmail = postForgotPasswordByEmail; - } - - /// - /// PostForgotPasswordByPhone - /// - public Boolean getPostForgotPasswordByPhone() { - return postForgotPasswordByPhone; - } - - /// - /// PostForgotPasswordByPhone - /// - public void setPostForgotPasswordByPhone(Boolean postForgotPasswordByPhone) { - this.postForgotPasswordByPhone = postForgotPasswordByPhone; - } - - /// - /// PutChangePassword - /// - public Boolean getPutChangePassword() { - return putChangePassword; - } - - /// - /// PutChangePassword - /// - public void setPutChangePassword(Boolean putChangePassword) { - this.putChangePassword = putChangePassword; - } - - /// - /// PostLoginByEmailAndPassword - /// - public Boolean getPostLoginByEmailAndPassword() { - return postLoginByEmailAndPassword; - } - - /// - /// PostLoginByEmailAndPassword - /// - public void setPostLoginByEmailAndPassword(Boolean postLoginByEmailAndPassword) { - this.postLoginByEmailAndPassword = postLoginByEmailAndPassword; - } - - /// - /// PostLoginByUserNameAndPassword - /// - public Boolean getPostLoginByUserNameAndPassword() { - return postLoginByUserNameAndPassword; - } - - /// - /// PostLoginByUserNameAndPassword - /// - public void setPostLoginByUserNameAndPassword(Boolean postLoginByUserNameAndPassword) { - this.postLoginByUserNameAndPassword = postLoginByUserNameAndPassword; - } - - /// - /// PostLoginByPhoneAndPassword - /// - public Boolean getPostLoginByPhoneAndPassword() { - return postLoginByPhoneAndPassword; - } - - /// - /// PostLoginByPhoneAndPassword - /// - public void setPostLoginByPhoneAndPassword(Boolean postLoginByPhoneAndPassword) { - this.postLoginByPhoneAndPassword = postLoginByPhoneAndPassword; - } - - /// - /// PutUpdateProfile - /// - public Boolean getPutUpdateProfile() { - return putUpdateProfile; - } - - /// - /// PutUpdateProfile - /// - public void setPutUpdateProfile(Boolean putUpdateProfile) { - this.putUpdateProfile = putUpdateProfile; - } - -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/ConfigResponseModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/ConfigResponseModel.java deleted file mode 100644 index 7d2b9d8..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/ConfigResponseModel.java +++ /dev/null @@ -1,709 +0,0 @@ - -package com.loginradius.sdk.models.responsemodels.configobjects; - -import java.util.List; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - -public class ConfigResponseModel { - - @SerializedName("SocialSchema") - @Expose - private SocialSchema socialSchema; - @SerializedName("RegistrationFormSchema") - @Expose - private List registrationFormSchema = null; - @SerializedName("SecurityQuestions") - @Expose - private SecurityQuestions securityQuestions; - @SerializedName("IsHttps") - @Expose - private Boolean isHttps; - @SerializedName("AppName") - @Expose - private String appName; - @SerializedName("IsCustomerRegistration") - @Expose - private Boolean isCustomerRegistration; - @SerializedName("ApiVersion") - @Expose - private ApiVersion apiVersion; - @SerializedName("EmailVerificationFlow") - @Expose - private String emailVerificationFlow; - @SerializedName("IsPhoneLogin") - @Expose - private Boolean isPhoneLogin; - @SerializedName("IsDisabledSocialRegistration") - @Expose - private Boolean isDisabledSocialRegistration; - @SerializedName("IsDisabledAccountLinking") - @Expose - private Boolean isDisabledAccountLinking; - @SerializedName("IsAgeRestriction") - @Expose - private Boolean isAgeRestriction; - @SerializedName("IsSecurityQuestion") - @Expose - private Boolean isSecurityQuestion; - @SerializedName("AskRequiredFieldsOnTraditionalLogin") - @Expose - private Boolean askRequiredFieldsOnTraditionalLogin; - @SerializedName("IsLogoutOnEmailVerification") - @Expose - private Boolean isLogoutOnEmailVerification; - @SerializedName("IsNoCallbackForSocialLogin") - @Expose - private Boolean isNoCallbackForSocialLogin; - @SerializedName("IsUserNameLogin") - @Expose - private Boolean isUserNameLogin; - @SerializedName("IsMobileCallbackForSocialLogin") - @Expose - private Boolean isMobileCallbackForSocialLogin; - @SerializedName("IsInvisibleRecaptcha") - @Expose - private Boolean isInvisibleRecaptcha; - @SerializedName("IsBackendJobEnabled") - @Expose - private Boolean isBackendJobEnabled; - @SerializedName("AskPasswordOnSocialLogin") - @Expose - private Boolean askPasswordOnSocialLogin; - @SerializedName("AskEmailIdForUnverifiedUserLogin") - @Expose - private Boolean askEmailIdForUnverifiedUserLogin; - @SerializedName("AskOptionalFieldsOnSocialSignup") - @Expose - private Boolean askOptionalFieldsOnSocialSignup; - @SerializedName("IsRiskBasedAuthentication") - @Expose - private Boolean isRiskBasedAuthentication; - @SerializedName("IsV2Recaptcha") - @Expose - private Boolean isV2Recaptcha; - @SerializedName("CheckPhoneNoAvailabilityOnRegistration") - @Expose - private Boolean checkPhoneNoAvailabilityOnRegistration; - @SerializedName("DuplicateEmailWithUniqueUsername") - @Expose - private Boolean duplicateEmailWithUniqueUsername; - @SerializedName("StoreOnlyRegistrationFormFieldsForSocial") - @Expose - private Boolean storeOnlyRegistrationFormFieldsForSocial; - @SerializedName("OTPEmailVerification") - @Expose - private Boolean oTPEmailVerification; - @SerializedName("LoginLockedConfiguration") - @Expose - private LoginLockedConfiguration loginLockedConfiguration; - @SerializedName("IsInstantSignin") - @Expose - private IsInstantSignin isInstantSignin; - @SerializedName("IsLoginOnEmailVerification") - @Expose - private Boolean isLoginOnEmailVerification; - @SerializedName("TwoFactorAuthentication") - @Expose - private TwoFactorAuthentication twoFactorAuthentication; - @SerializedName("IsRememberMe") - @Expose - private Boolean isRememberMe; - @SerializedName("V2RecaptchaSiteKey") - @Expose - private String v2RecaptchaSiteKey; - @SerializedName("QQTencentCaptchaKey") - @Expose - private String qQTencentCaptchaKey; - @SerializedName("NoRegistration") - @Expose - private Boolean noRegistration; - @SerializedName("CustomDomain") - @Expose - private Object customDomain; - @SerializedName("PrivacyPolicyConfiguration") - @Expose - private PrivacyPolicyConfiguration privacyPolicyConfiguration; - @SerializedName("OptionalRecaptchaConfiguration") - @Expose - private OptionalRecaptchaConfiguration optionalRecaptchaConfiguration; - @SerializedName("ApiRequestSigningConfig") - @Expose - private ApiRequestSigningConfig apiRequestSigningConfig; - - /// - /// SocialSchema - /// - public SocialSchema getSocialSchema() { - return socialSchema; - } - - /// - /// SocialSchema - /// - public void setSocialSchema(SocialSchema socialSchema) { - this.socialSchema = socialSchema; - } - - /// - /// RegistrationFormSchema - /// - public List getRegistrationFormSchema() { - return registrationFormSchema; - } - - /// - /// RegistrationFormSchema - /// - public void setRegistrationFormSchema(List registrationFormSchema) { - this.registrationFormSchema = registrationFormSchema; - } - - /// - /// SecurityQuestions - /// - public SecurityQuestions getSecurityQuestions() { - return securityQuestions; - } - - /// - /// SecurityQuestions - /// - public void setSecurityQuestions(SecurityQuestions securityQuestions) { - this.securityQuestions = securityQuestions; - } - - /// - /// IsHttps - /// - public Boolean getIsHttps() { - return isHttps; - } - - /// - /// IsHttps - /// - public void setIsHttps(Boolean isHttps) { - this.isHttps = isHttps; - } - - /// - /// AppName - /// - public String getAppName() { - return appName; - } - - /// - /// AppName - /// - public void setAppName(String appName) { - this.appName = appName; - } - - /// - /// IsCustomerRegistration - /// - public Boolean getIsCustomerRegistration() { - return isCustomerRegistration; - } - - /// - /// IsCustomerRegistration - /// - public void setIsCustomerRegistration(Boolean isCustomerRegistration) { - this.isCustomerRegistration = isCustomerRegistration; - } - - /// - /// ApiVersion - /// - public ApiVersion getApiVersion() { - return apiVersion; - } - - /// - /// ApiVersion - /// - public void setApiVersion(ApiVersion apiVersion) { - this.apiVersion = apiVersion; - } - - /// - /// EmailVerificationFlow - /// - public String getEmailVerificationFlow() { - return emailVerificationFlow; - } - - /// - /// EmailVerificationFlow - /// - public void setEmailVerificationFlow(String emailVerificationFlow) { - this.emailVerificationFlow = emailVerificationFlow; - } - - /// - /// IsPhoneLogin - /// - public Boolean getIsPhoneLogin() { - return isPhoneLogin; - } - - /// - /// IsPhoneLogin - /// - public void setIsPhoneLogin(Boolean isPhoneLogin) { - this.isPhoneLogin = isPhoneLogin; - } - - /// - /// IsDisabledSocialRegistration - /// - public Boolean getIsDisabledSocialRegistration() { - return isDisabledSocialRegistration; - } - - /// - /// IsDisabledSocialRegistration - /// - public void setIsDisabledSocialRegistration(Boolean isDisabledSocialRegistration) { - this.isDisabledSocialRegistration = isDisabledSocialRegistration; - } - - /// - /// IsDisabledAccountLinking - /// - public Boolean getIsDisabledAccountLinking() { - return isDisabledAccountLinking; - } - - /// - /// IsDisabledAccountLinking - /// - public void setIsDisabledAccountLinking(Boolean isDisabledAccountLinking) { - this.isDisabledAccountLinking = isDisabledAccountLinking; - } - - /// - /// IsAgeRestriction - /// - public Boolean getIsAgeRestriction() { - return isAgeRestriction; - } - - /// - /// IsAgeRestriction - /// - public void setIsAgeRestriction(Boolean isAgeRestriction) { - this.isAgeRestriction = isAgeRestriction; - } - - /// - /// IsSecurityQuestion - /// - public Boolean getIsSecurityQuestion() { - return isSecurityQuestion; - } - - /// - /// IsSecurityQuestion - /// - public void setIsSecurityQuestion(Boolean isSecurityQuestion) { - this.isSecurityQuestion = isSecurityQuestion; - } - - /// - /// AskRequiredFieldsOnTraditionalLogin - /// - public Boolean getAskRequiredFieldsOnTraditionalLogin() { - return askRequiredFieldsOnTraditionalLogin; - } - - /// - /// AskRequiredFieldsOnTraditionalLogin - /// - public void setAskRequiredFieldsOnTraditionalLogin(Boolean askRequiredFieldsOnTraditionalLogin) { - this.askRequiredFieldsOnTraditionalLogin = askRequiredFieldsOnTraditionalLogin; - } - - /// - /// IsLogoutOnEmailVerification - /// - public Boolean getIsLogoutOnEmailVerification() { - return isLogoutOnEmailVerification; - } - - /// - /// IsLogoutOnEmailVerification - /// - public void setIsLogoutOnEmailVerification(Boolean isLogoutOnEmailVerification) { - this.isLogoutOnEmailVerification = isLogoutOnEmailVerification; - } - - /// - /// IsNoCallbackForSocialLogin - /// - public Boolean getIsNoCallbackForSocialLogin() { - return isNoCallbackForSocialLogin; - } - - /// - /// IsNoCallbackForSocialLogin - /// - public void setIsNoCallbackForSocialLogin(Boolean isNoCallbackForSocialLogin) { - this.isNoCallbackForSocialLogin = isNoCallbackForSocialLogin; - } - - /// - /// IsUserNameLogin - /// - public Boolean getIsUserNameLogin() { - return isUserNameLogin; - } - - /// - /// IsUserNameLogin - /// - public void setIsUserNameLogin(Boolean isUserNameLogin) { - this.isUserNameLogin = isUserNameLogin; - } - - /// - /// IsMobileCallbackForSocialLogin - /// - public Boolean getIsMobileCallbackForSocialLogin() { - return isMobileCallbackForSocialLogin; - } - - /// - /// IsMobileCallbackForSocialLogin - /// - public void setIsMobileCallbackForSocialLogin(Boolean isMobileCallbackForSocialLogin) { - this.isMobileCallbackForSocialLogin = isMobileCallbackForSocialLogin; - } - - /// - /// IsInvisibleRecaptcha - /// - public Boolean getIsInvisibleRecaptcha() { - return isInvisibleRecaptcha; - } - - /// - /// IsInvisibleRecaptcha - /// - public void setIsInvisibleRecaptcha(Boolean isInvisibleRecaptcha) { - this.isInvisibleRecaptcha = isInvisibleRecaptcha; - } - - /// - /// IsBackendJobEnabled - /// - public Boolean getIsBackendJobEnabled() { - return isBackendJobEnabled; - } - - /// - /// IsBackendJobEnabled - /// - public void setIsBackendJobEnabled(Boolean isBackendJobEnabled) { - this.isBackendJobEnabled = isBackendJobEnabled; - } - - /// - /// AskPasswordOnSocialLogin - /// - public Boolean getAskPasswordOnSocialLogin() { - return askPasswordOnSocialLogin; - } - - /// - /// AskPasswordOnSocialLogin - /// - public void setAskPasswordOnSocialLogin(Boolean askPasswordOnSocialLogin) { - this.askPasswordOnSocialLogin = askPasswordOnSocialLogin; - } - - /// - /// AskEmailIdForUnverifiedUserLogin - /// - public Boolean getAskEmailIdForUnverifiedUserLogin() { - return askEmailIdForUnverifiedUserLogin; - } - - /// - /// AskEmailIdForUnverifiedUserLogin - /// - public void setAskEmailIdForUnverifiedUserLogin(Boolean askEmailIdForUnverifiedUserLogin) { - this.askEmailIdForUnverifiedUserLogin = askEmailIdForUnverifiedUserLogin; - } - - /// - /// AskOptionalFieldsOnSocialSignup - /// - public Boolean getAskOptionalFieldsOnSocialSignup() { - return askOptionalFieldsOnSocialSignup; - } - - /// - /// AskOptionalFieldsOnSocialSignup - /// - public void setAskOptionalFieldsOnSocialSignup(Boolean askOptionalFieldsOnSocialSignup) { - this.askOptionalFieldsOnSocialSignup = askOptionalFieldsOnSocialSignup; - } - - /// - /// IsRiskBasedAuthentication - /// - public Boolean getIsRiskBasedAuthentication() { - return isRiskBasedAuthentication; - } - - /// - /// IsRiskBasedAuthentication - /// - public void setIsRiskBasedAuthentication(Boolean isRiskBasedAuthentication) { - this.isRiskBasedAuthentication = isRiskBasedAuthentication; - } - - /// - /// IsV2Recaptcha - /// - public Boolean getIsV2Recaptcha() { - return isV2Recaptcha; - } - - /// - /// IsV2Recaptcha - /// - public void setIsV2Recaptcha(Boolean isV2Recaptcha) { - this.isV2Recaptcha = isV2Recaptcha; - } - - /// - /// CheckPhoneNoAvailabilityOnRegistration - /// - public Boolean getCheckPhoneNoAvailabilityOnRegistration() { - return checkPhoneNoAvailabilityOnRegistration; - } - - /// - /// CheckPhoneNoAvailabilityOnRegistration - /// - public void setCheckPhoneNoAvailabilityOnRegistration(Boolean checkPhoneNoAvailabilityOnRegistration) { - this.checkPhoneNoAvailabilityOnRegistration = checkPhoneNoAvailabilityOnRegistration; - } - - /// - /// DuplicateEmailWithUniqueUsername - /// - public Boolean getDuplicateEmailWithUniqueUsername() { - return duplicateEmailWithUniqueUsername; - } - - /// - /// DuplicateEmailWithUniqueUsername - /// - public void setDuplicateEmailWithUniqueUsername(Boolean duplicateEmailWithUniqueUsername) { - this.duplicateEmailWithUniqueUsername = duplicateEmailWithUniqueUsername; - } - - /// - /// StoreOnlyRegistrationFormFieldsForSocial - /// - public Boolean getStoreOnlyRegistrationFormFieldsForSocial() { - return storeOnlyRegistrationFormFieldsForSocial; - } - - /// - /// StoreOnlyRegistrationFormFieldsForSocial - /// - public void setStoreOnlyRegistrationFormFieldsForSocial(Boolean storeOnlyRegistrationFormFieldsForSocial) { - this.storeOnlyRegistrationFormFieldsForSocial = storeOnlyRegistrationFormFieldsForSocial; - } - - /// - /// OTPEmailVerification - /// - public Boolean getOTPEmailVerification() { - return oTPEmailVerification; - } - - /// - /// OTPEmailVerification - /// - public void setOTPEmailVerification(Boolean oTPEmailVerification) { - this.oTPEmailVerification = oTPEmailVerification; - } - - /// - /// LoginLockedConfiguration - /// - public LoginLockedConfiguration getLoginLockedConfiguration() { - return loginLockedConfiguration; - } - - /// - /// LoginLockedConfiguration - /// - public void setLoginLockedConfiguration(LoginLockedConfiguration loginLockedConfiguration) { - this.loginLockedConfiguration = loginLockedConfiguration; - } - - /// - /// IsInstantSignin - /// - public IsInstantSignin getIsInstantSignin() { - return isInstantSignin; - } - - /// - /// IsInstantSignin - /// - public void setIsInstantSignin(IsInstantSignin isInstantSignin) { - this.isInstantSignin = isInstantSignin; - } - - /// - /// IsLoginOnEmailVerification - /// - public Boolean getIsLoginOnEmailVerification() { - return isLoginOnEmailVerification; - } - - /// - /// IsLoginOnEmailVerification - /// - public void setIsLoginOnEmailVerification(Boolean isLoginOnEmailVerification) { - this.isLoginOnEmailVerification = isLoginOnEmailVerification; - } - - /// - /// TwoFactorAuthentication - /// - public TwoFactorAuthentication getTwoFactorAuthentication() { - return twoFactorAuthentication; - } - - /// - /// TwoFactorAuthentication - /// - public void setTwoFactorAuthentication(TwoFactorAuthentication twoFactorAuthentication) { - this.twoFactorAuthentication = twoFactorAuthentication; - } - - /// - /// IsRememberMe - /// - public Boolean getIsRememberMe() { - return isRememberMe; - } - - /// - /// IsRememberMe - /// - public void setIsRememberMe(Boolean isRememberMe) { - this.isRememberMe = isRememberMe; - } - - /// - /// V2RecaptchaSiteKey - /// - public String getV2RecaptchaSiteKey() { - return v2RecaptchaSiteKey; - } - - /// - /// V2RecaptchaSiteKey - /// - public void setV2RecaptchaSiteKey(String v2RecaptchaSiteKey) { - this.v2RecaptchaSiteKey = v2RecaptchaSiteKey; - } - - /// - /// QQTencentCaptchaKey - /// - public String getQQTencentCaptchaKey() { - return qQTencentCaptchaKey; - } - - /// - /// QQTencentCaptchaKey - /// - public void setQQTencentCaptchaKey(String qQTencentCaptchaKey) { - this.qQTencentCaptchaKey = qQTencentCaptchaKey; - } - - /// - /// NoRegistration - /// - public Boolean getNoRegistration() { - return noRegistration; - } - - /// - /// NoRegistration - /// - public void setNoRegistration(Boolean noRegistration) { - this.noRegistration = noRegistration; - } - - /// - /// CustomDomain - /// - public Object getCustomDomain() { - return customDomain; - } - - /// - /// CustomDomain - /// - public void setCustomDomain(Object customDomain) { - this.customDomain = customDomain; - } - - /// - /// PrivacyPolicyConfiguration - /// - public PrivacyPolicyConfiguration getPrivacyPolicyConfiguration() { - return privacyPolicyConfiguration; - } - - /// - /// PrivacyPolicyConfiguration - /// - public void setPrivacyPolicyConfiguration(PrivacyPolicyConfiguration privacyPolicyConfiguration) { - this.privacyPolicyConfiguration = privacyPolicyConfiguration; - } - - /// - /// OptionalRecaptchaConfiguration - /// - public OptionalRecaptchaConfiguration getOptionalRecaptchaConfiguration() { - return optionalRecaptchaConfiguration; - } - - /// - /// OptionalRecaptchaConfiguration - /// - public void setOptionalRecaptchaConfiguration(OptionalRecaptchaConfiguration optionalRecaptchaConfiguration) { - this.optionalRecaptchaConfiguration = optionalRecaptchaConfiguration; - } - - /// - /// ApiRequestSigningConfig - /// - public ApiRequestSigningConfig getApiRequestSigningConfig() { - return apiRequestSigningConfig; - } - - /// - /// ApiRequestSigningConfig - /// - public void setApiRequestSigningConfig(ApiRequestSigningConfig apiRequestSigningConfig) { - this.apiRequestSigningConfig = apiRequestSigningConfig; - } - -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/EmailVerificationData.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/EmailVerificationData.java deleted file mode 100644 index 20e002a..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/EmailVerificationData.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.loginradius.sdk.models.responsemodels.configobjects; - -import com.google.gson.annotations.SerializedName; -import com.loginradius.sdk.models.responsemodels.AccessTokenBase; - -public class EmailVerificationData extends AccessTokenBase { - - @SerializedName("Profile") - private T profile; - - @SerializedName("Email") - private String email; - - /// - /// user's email - /// - public String getEmail() { - return email; - } - - /// - /// user's email - /// - public void setEmail(String email) { - this.email = email; - } - - /// - /// user's profile data - /// - public T getProfile() { - return profile; - } - - /// - /// user's profile data - /// - public void setProfile(T profile) { - this.profile = profile; - } -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/IsInstantSignin.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/IsInstantSignin.java deleted file mode 100644 index 86aab93..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/IsInstantSignin.java +++ /dev/null @@ -1,44 +0,0 @@ - -package com.loginradius.sdk.models.responsemodels.configobjects; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - -public class IsInstantSignin { - - @SerializedName("EmailLink") - @Expose - private Boolean emailLink; - @SerializedName("SmsOtp") - @Expose - private Boolean smsOtp; - - /// - /// user's email link - /// - public Boolean getEmailLink() { - return emailLink; - } - - /// - /// user's email link - /// - public void setEmailLink(Boolean emailLink) { - this.emailLink = emailLink; - } - - /// - /// user's sms/otp - /// - public Boolean getSmsOtp() { - return smsOtp; - } - - /// - /// user's sms/otp - /// - public void setSmsOtp(Boolean smsOtp) { - this.smsOtp = smsOtp; - } - -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/LoginLockedConfiguration.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/LoginLockedConfiguration.java deleted file mode 100644 index 065cc23..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/LoginLockedConfiguration.java +++ /dev/null @@ -1,61 +0,0 @@ - -package com.loginradius.sdk.models.responsemodels.configobjects; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - -public class LoginLockedConfiguration { - - @SerializedName("LoginLockedType") - @Expose - private String loginLockedType; - @SerializedName("MaximumFailedLoginAttempts") - @Expose - private Integer maximumFailedLoginAttempts; - @SerializedName("SuspendConfiguration") - @Expose - private SuspendConfiguration suspendConfiguration; - - /// - /// LoginLockedType - /// - public String getLoginLockedType() { - return loginLockedType; - } - - /// - /// LoginLockedType - /// - public void setLoginLockedType(String loginLockedType) { - this.loginLockedType = loginLockedType; - } - - /// - /// MaximumFailedLoginAttempts - /// - public Integer getMaximumFailedLoginAttempts() { - return maximumFailedLoginAttempts; - } - - /// - /// MaximumFailedLoginAttempts - /// - public void setMaximumFailedLoginAttempts(Integer maximumFailedLoginAttempts) { - this.maximumFailedLoginAttempts = maximumFailedLoginAttempts; - } - - /// - /// SuspendConfiguration - /// - public SuspendConfiguration getSuspendConfiguration() { - return suspendConfiguration; - } - - /// - /// SuspendConfiguration - /// - public void setSuspendConfiguration(SuspendConfiguration suspendConfiguration) { - this.suspendConfiguration = suspendConfiguration; - } - -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/OptionalRecaptchaConfiguration.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/OptionalRecaptchaConfiguration.java deleted file mode 100644 index 0c7166d..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/OptionalRecaptchaConfiguration.java +++ /dev/null @@ -1,44 +0,0 @@ - -package com.loginradius.sdk.models.responsemodels.configobjects; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - -public class OptionalRecaptchaConfiguration { - - @SerializedName("IsEnabled") - @Expose - private Boolean isEnabled; - @SerializedName("Apis") - @Expose - private Apis apis; - - /// - /// IsEnabled - /// - public Boolean getIsEnabled() { - return isEnabled; - } - - /// - /// IsEnabled - /// - public void setIsEnabled(Boolean isEnabled) { - this.isEnabled = isEnabled; - } - - /// - /// Apis - /// - public Apis getApis() { - return apis; - } - - /// - /// Apis - /// - public void setApis(Apis apis) { - this.apis = apis; - } - -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/PrivacyPolicyConfiguration.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/PrivacyPolicyConfiguration.java deleted file mode 100644 index c60919a..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/PrivacyPolicyConfiguration.java +++ /dev/null @@ -1,6 +0,0 @@ - -package com.loginradius.sdk.models.responsemodels.configobjects; - -public class PrivacyPolicyConfiguration { - -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/Provider.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/Provider.java deleted file mode 100644 index 2c0c3d1..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/Provider.java +++ /dev/null @@ -1,44 +0,0 @@ - -package com.loginradius.sdk.models.responsemodels.configobjects; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - -public class Provider { - - @SerializedName("Name") - @Expose - private String name; - @SerializedName("Endpoint") - @Expose - private String endpoint; - - /// - /// Provider's name - /// - public String getName() { - return name; - } - - /// - /// Provider's name - /// - public void setName(String name) { - this.name = name; - } - - /// - /// Provider's EndPoint - /// - public String getEndpoint() { - return endpoint; - } - - /// - /// Provider's EndPoint - /// - public void setEndpoint(String endpoint) { - this.endpoint = endpoint; - } - -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/RegistrationFormSchema.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/RegistrationFormSchema.java deleted file mode 100644 index 3d79204..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/RegistrationFormSchema.java +++ /dev/null @@ -1,180 +0,0 @@ - -package com.loginradius.sdk.models.responsemodels.configobjects; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - -public class RegistrationFormSchema { - - @SerializedName("Checked") - @Expose - private Boolean checked; - @SerializedName("type") - @Expose - private String type; - @SerializedName("name") - @Expose - private String name; - @SerializedName("display") - @Expose - private String display; - @SerializedName("rules") - @Expose - private String rules; - @SerializedName("options") - @Expose - private Object options; - @SerializedName("permission") - @Expose - private String permission; - @SerializedName("DataSource") - @Expose - private Object dataSource; - @SerializedName("Parent") - @Expose - private String parent; - @SerializedName("ParentDataSource") - @Expose - private Object parentDataSource; - - /// - /// Checked - /// - public Boolean getChecked() { - return checked; - } - - /// - /// Checked - /// - public void setChecked(Boolean checked) { - this.checked = checked; - } - - /// - /// Type - /// - public String getType() { - return type; - } - - /// - /// Type - /// - public void setType(String type) { - this.type = type; - } - - /// - /// Name - /// - public String getName() { - return name; - } - - /// - /// Name - /// - public void setName(String name) { - this.name = name; - } - - /// - /// Display - /// - public String getDisplay() { - return display; - } - - /// - /// Display - /// - public void setDisplay(String display) { - this.display = display; - } - - /// - /// Rules - /// - public String getRules() { - return rules; - } - - /// - /// Rules - /// - public void setRules(String rules) { - this.rules = rules; - } - - /// - /// Options - /// - public Object getOptions() { - return options; - } - - /// - /// Options - /// - public void setOptions(Object options) { - this.options = options; - } - - /// - /// User's permissions - /// - public String getPermission() { - return permission; - } - - /// - /// User's permissions - /// - public void setPermission(String permission) { - this.permission = permission; - } - - /// - /// Data Source - /// - public Object getDataSource() { - return dataSource; - } - - /// - /// Data Source - /// - public void setDataSource(Object dataSource) { - this.dataSource = dataSource; - } - - /// - /// Parent data - /// - public String getParent() { - return parent; - } - - /// - /// Parent data - /// - public void setParent(String parent) { - this.parent = parent; - } - - /// - /// Partent data source - /// - public Object getParentDataSource() { - return parentDataSource; - } - - /// - /// Parent data source - /// - public void setParentDataSource(Object parentDataSource) { - this.parentDataSource = parentDataSource; - } - -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/SecurityQuestions.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/SecurityQuestions.java deleted file mode 100644 index 01db2ee..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/SecurityQuestions.java +++ /dev/null @@ -1,46 +0,0 @@ - -package com.loginradius.sdk.models.responsemodels.configobjects; - -import java.util.List; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - -public class SecurityQuestions { - - @SerializedName("Questions") - @Expose - private List questions = null; - @SerializedName("SecurityQuestionCount") - @Expose - private Integer securityQuestionCount; - - /// - /// Question - /// - public List getQuestions() { - return questions; - } - - /// - /// Question - /// - public void setQuestions(List questions) { - this.questions = questions; - } - - /// - /// Number of Question - /// - public Integer getSecurityQuestionCount() { - return securityQuestionCount; - } - - /// - /// Number of Question - /// - public void setSecurityQuestionCount(Integer securityQuestionCount) { - this.securityQuestionCount = securityQuestionCount; - } - -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/SocialSchema.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/SocialSchema.java deleted file mode 100644 index 189b73d..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/SocialSchema.java +++ /dev/null @@ -1,29 +0,0 @@ - -package com.loginradius.sdk.models.responsemodels.configobjects; - -import java.util.List; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - -public class SocialSchema { - - @SerializedName("Providers") - @Expose - private List providers = null; - - /// - /// Social Providers - /// - public List getProviders() { - return providers; - } - - /// - /// Social Providers - /// - public void setProviders(List providers) { - this.providers = providers; - } - -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/SuspendConfiguration.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/SuspendConfiguration.java deleted file mode 100644 index cdd6928..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/SuspendConfiguration.java +++ /dev/null @@ -1,27 +0,0 @@ - -package com.loginradius.sdk.models.responsemodels.configobjects; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - -public class SuspendConfiguration { - - @SerializedName("EffectivePeriodInSeconds") - @Expose - private Integer effectivePeriodInSeconds; - - /// - /// Suspended time in seconds - /// - public Integer getEffectivePeriodInSeconds() { - return effectivePeriodInSeconds; - } - - /// - /// Suspended time in seconds - /// - public void setEffectivePeriodInSeconds(Integer effectivePeriodInSeconds) { - this.effectivePeriodInSeconds = effectivePeriodInSeconds; - } - -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/TwoFactorAuthentication.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/TwoFactorAuthentication.java deleted file mode 100644 index b83bfcb..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/configobjects/TwoFactorAuthentication.java +++ /dev/null @@ -1,61 +0,0 @@ - -package com.loginradius.sdk.models.responsemodels.configobjects; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - -public class TwoFactorAuthentication { - - @SerializedName("IsEnabled") - @Expose - private Boolean isEnabled; - @SerializedName("IsRequired") - @Expose - private Boolean isRequired; - @SerializedName("IsGoogleAuthenticator") - @Expose - private Boolean isGoogleAuthenticator; - - /// - /// Enable two factor authentication true or false - /// - public Boolean getIsEnabled() { - return isEnabled; - } - - /// - /// Enable two factor authentication true or false - /// - public void setIsEnabled(Boolean isEnabled) { - this.isEnabled = isEnabled; - } - - /// - /// IsRequired - /// - public Boolean getIsRequired() { - return isRequired; - } - - /// - /// IsRequired - /// - public void setIsRequired(Boolean isRequired) { - this.isRequired = isRequired; - } - - /// - /// Enable google authenticator true or false - /// - public Boolean getIsGoogleAuthenticator() { - return isGoogleAuthenticator; - } - - /// - /// Enable google authenticator true or false - /// - public void setIsGoogleAuthenticator(Boolean isGoogleAuthenticator) { - this.isGoogleAuthenticator = isGoogleAuthenticator; - } - -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/AccountRolesModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/AccountRolesModel.java deleted file mode 100644 index 626ad43..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/AccountRolesModel.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.otherobjects; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition of Complete Roles data - // - public class AccountRolesModel { - - - @SerializedName("Roles") - private List roles; - - - - // - // Array of String, which represents the role name - // - public List getRoles() { - return roles; - } - // - // Array of String, which represents the role name - // - public void setRoles(List roles) { - this.roles = roles; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/BackupCodeResponse.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/BackupCodeResponse.java deleted file mode 100644 index 71bc6b5..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/BackupCodeResponse.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.otherobjects; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition of Complete Backup Code data - // - public class BackupCodeResponse { - - - @SerializedName("BackUpCodes") - private List backUpCodes; - - - - // - // The Code generated as a recourse - // - public List getBackUpCodes() { - return backUpCodes; - } - // - // The Code generated as a recourse - // - public void setBackUpCodes(List backUpCodes) { - this.backUpCodes = backUpCodes; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/DeleteRequestAcceptResponse.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/DeleteRequestAcceptResponse.java deleted file mode 100644 index 232271d..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/DeleteRequestAcceptResponse.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.otherobjects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition of Delete Request - // - public class DeleteRequestAcceptResponse { - - - @SerializedName("IsDeleteRequestAccepted") - private Boolean isDeleteRequestAccepted; - - - - // - // Is Delete Request Accepted - // - public Boolean getIsDeleteRequestAccepted() { - return isDeleteRequestAccepted; - } - // - // Is Delete Request Accepted - // - public void setIsDeleteRequestAccepted(Boolean isDeleteRequestAccepted) { - this.isDeleteRequestAccepted = isDeleteRequestAccepted; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/DeleteResponse.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/DeleteResponse.java deleted file mode 100644 index a9a1c42..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/DeleteResponse.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.otherobjects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition of Delete Request - // - public class DeleteResponse { - - - @SerializedName("IsDeleted") - private Boolean isDeleted; - - @SerializedName("RecordsDeleted") - private Integer recordsDeleted; - - - - // - // boolean type value, default is true - // - public Boolean getIsDeleted() { - return isDeleted; - } - // - // boolean type value, default is true - // - public void setIsDeleted(Boolean isDeleted) { - this.isDeleted = isDeleted; - } - // - // Number of Records Deleted - // - public Integer getRecordsDeleted() { - return recordsDeleted; - } - // - // Number of Records Deleted - // - public void setRecordsDeleted(Integer recordsDeleted) { - this.recordsDeleted = recordsDeleted; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/EmailVerificationTokenResponse.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/EmailVerificationTokenResponse.java deleted file mode 100644 index 70fa53e..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/EmailVerificationTokenResponse.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.otherobjects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition of Complete Verification data - // - public class EmailVerificationTokenResponse { - - - @SerializedName("VerificationToken") - private String verificationToken; - - - - // - // Verification token received in the email - // - public String getVerificationToken() { - return verificationToken; - } - // - // Verification token received in the email - // - public void setVerificationToken(String verificationToken) { - this.verificationToken = verificationToken; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/ExistResponse.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/ExistResponse.java deleted file mode 100644 index 8b0a363..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/ExistResponse.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.otherobjects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition Complete ExistResponse data - // - public class ExistResponse { - - - @SerializedName("IsExist") - private Boolean isExist; - - - - // - // IsExist - // - public Boolean getIsExist() { - return isExist; - } - // - // IsExist - // - public void setIsExist(Boolean isExist) { - this.isExist = isExist; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/ForgotPasswordResponse.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/ForgotPasswordResponse.java deleted file mode 100644 index 3516af7..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/ForgotPasswordResponse.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.otherobjects; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition of Complete Forgot Password data - // - public class ForgotPasswordResponse { - - - @SerializedName("ForgotToken") - private String forgotToken; - - @SerializedName("IdentityProviders") - private List identityProviders; - - - - // - // Forgot token - // - public String getForgotToken() { - return forgotToken; - } - // - // Forgot token - // - public void setForgotToken(String forgotToken) { - this.forgotToken = forgotToken; - } - // - // Identity providers - // - public List getIdentityProviders() { - return identityProviders; - } - // - // Identity providers - // - public void setIdentityProviders(List identityProviders) { - this.identityProviders = identityProviders; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/GetResponse.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/GetResponse.java deleted file mode 100644 index fb4ef58..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/GetResponse.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.otherobjects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition of Complete GetType data - // - public class GetResponse { - - - @SerializedName("Data") - private T data; - - - - // - // Data - // - public T getData() { - return data; - } - // - // Data - // - public void setData(T data) { - this.data = data; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/PinInformation.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/PinInformation.java deleted file mode 100644 index cab9f4b..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/PinInformation.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.otherobjects; -import com.google.gson.annotations.SerializedName; - - // - // Response Model Class containing Definition of PIN Information - // - public class PinInformation { - - - @SerializedName("LastPINChangeDate") - private String lastPINChangeDate; - - @SerializedName("LastPINChangeToken") - private String lastPINChangeToken; - - @SerializedName("PIN") - private String pin; - - @SerializedName("Skipped") - private Boolean skipped; - - @SerializedName("SkippedDate") - private String skippedDate; - - - - // - // Last PIN Change Date - // - public String getLastPINChangeDate() { - return lastPINChangeDate; - } - // - // Last PIN Change Date - // - public void setLastPINChangeDate(String lastPINChangeDate) { - this.lastPINChangeDate = lastPINChangeDate; - } - // - // Last PIN Change Token - // - public String getLastPINChangeToken() { - return lastPINChangeToken; - } - // - // Last PIN Change Token - // - public void setLastPINChangeToken(String lastPINChangeToken) { - this.lastPINChangeToken = lastPINChangeToken; - } - // - // PIN of user - // - public String getPIN() { - return pin; - } - // - // PIN of user - // - public void setPIN(String pin) { - this.pin = pin; - } - // - // possible values are true/false/null - // - public Boolean getSkipped() { - return skipped; - } - // - // possible values are true/false/null - // - public void setSkipped(Boolean skipped) { - this.skipped = skipped; - } - // - // Skipped Date - // - public String getSkippedDate() { - return skippedDate; - } - // - // Skipped Date - // - public void setSkippedDate(String skippedDate) { - this.skippedDate = skippedDate; - } - } diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/PostResponse.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/PostResponse.java deleted file mode 100644 index a74e147..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/PostResponse.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.otherobjects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition of Complete Validation data - // - public class PostResponse { - - - @SerializedName("IsPosted") - private Boolean isPosted; - - - - // - // check data is posted - // - public Boolean getIsPosted() { - return isPosted; - } - // - // check data is posted - // - public void setIsPosted(Boolean isPosted) { - this.isPosted = isPosted; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/PostResponseResendEmailVerification.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/PostResponseResendEmailVerification.java deleted file mode 100644 index 1b1a22c..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/PostResponseResendEmailVerification.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.otherobjects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete AuthSendVerificationEmailForLinkingSocialProfiles API Response - // - public class PostResponseResendEmailVerification { - - - @SerializedName("IsPosted") - private Boolean isPosted; - - @SerializedName("uuid") - private String uuid; - - - - // - // check data is posted - // - public Boolean getIsPosted() { - return isPosted; - } - // - // check data is posted - // - public void setIsPosted(Boolean isPosted) { - this.isPosted = isPosted; - } - // - // The uuid received in the response - // - public String getUuid() { - return uuid; - } - // - // The uuid received in the response - // - public void setUuid(String uuid) { - this.uuid = uuid; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/PostValidationResponse.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/PostValidationResponse.java deleted file mode 100644 index 6fa78e9..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/PostValidationResponse.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.otherobjects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition of Complete Validation data - // - public class PostValidationResponse { - - - @SerializedName("IsValid") - private Boolean isValid; - - - - // - // check data is validate - // - public Boolean getIsValid() { - return isValid; - } - // - // check data is validate - // - public void setIsValid(Boolean isValid) { - this.isValid = isValid; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/PrivacyPolicyHistoryResponse.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/PrivacyPolicyHistoryResponse.java deleted file mode 100644 index 953007b..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/PrivacyPolicyHistoryResponse.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.otherobjects; -import java.util.List; - -import com.google.gson.annotations.SerializedName; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.AcceptedPrivacyPolicy; - - // - // Response containing Definition of Complete PrivacyPolicyHistory - // - public class PrivacyPolicyHistoryResponse { - - - @SerializedName("Current") - private AcceptedPrivacyPolicy current; - - @SerializedName("History") - private List history; - - @SerializedName("Uid") - private String uid; - - - - // - // Current privacy policy - // - public AcceptedPrivacyPolicy getCurrent() { - return current; - } - // - // Current privacy policy - // - public void setCurrent(AcceptedPrivacyPolicy current) { - this.current = current; - } - // - // Privacy policy history - // - public List getHistory() { - return history; - } - // - // Privacy policy history - // - public void setHistory(List history) { - this.history = history; - } - // - // UID, the unified identifier for each user account - // - public String getUid() { - return uid; - } - // - // UID, the unified identifier for each user account - // - public void setUid(String uid) { - this.uid = uid; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/RoleContextResponse.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/RoleContextResponse.java deleted file mode 100644 index cc29cdc..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/RoleContextResponse.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.otherobjects; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition of RoleContext - // - public class RoleContextResponse { - - - @SerializedName("AdditionalPermissions") - private List additionalPermissions; - - @SerializedName("Expiration") - private String expiration; - - @SerializedName("Roles") - private List roles; - - - - // - // Array of String, which represents the additional permissions - // - public List getAdditionalPermissions() { - return additionalPermissions; - } - // - // Array of String, which represents the additional permissions - // - public void setAdditionalPermissions(List additionalPermissions) { - this.additionalPermissions = additionalPermissions; - } - // - // Role expiration date - // - public String getExpiration() { - return expiration; - } - // - // Role expiration date - // - public void setExpiration(String expiration) { - this.expiration = expiration; - } - // - // Array of String, which represents the role name - // - public List getRoles() { - return roles; - } - // - // Array of String, which represents the role name - // - public void setRoles(List roles) { - this.roles = roles; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/RoleContextResponseModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/RoleContextResponseModel.java deleted file mode 100644 index 4b9b876..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/RoleContextResponseModel.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.otherobjects; -import java.util.List; - -import com.google.gson.annotations.SerializedName; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.Email; - - // - // Response containing Definition of RoleContext Profile - // - public class RoleContextResponseModel { - - - @SerializedName("Email") - private List email; - - @SerializedName("FullName") - private String fullName; - - @SerializedName("ImageUrl") - private String imageUrl; - - @SerializedName("LastLoginDate") - private String lastLoginDate; - - @SerializedName("RoleContext") - private RoleContextResponse roleContext; - - @SerializedName("Uid") - private String uid; - - - - // - // user's email - // - public List getEmail() { - return email; - } - // - // user's email - // - public void setEmail(List email) { - this.email = email; - } - // - // Users complete name - // - public String getFullName() { - return fullName; - } - // - // Users complete name - // - public void setFullName(String fullName) { - this.fullName = fullName; - } - // - // image URL should be absolute and has HTTPS domain - // - public String getImageUrl() { - return imageUrl; - } - // - // image URL should be absolute and has HTTPS domain - // - public void setImageUrl(String imageUrl) { - this.imageUrl = imageUrl; - } - // - // last login date - // - public String getLastLoginDate() { - return lastLoginDate; - } - // - // last login date - // - public void setLastLoginDate(String lastLoginDate) { - this.lastLoginDate = lastLoginDate; - } - // - // Array of RoleContext object, see body tab for structure - // - public RoleContextResponse getRoleContext() { - return roleContext; - } - // - // Array of RoleContext object, see body tab for structure - // - public void setRoleContext(RoleContextResponse roleContext) { - this.roleContext = roleContext; - } - // - // UID, the unified identifier for each user account - // - public String getUid() { - return uid; - } - // - // UID, the unified identifier for each user account - // - public void setUid(String uid) { - this.uid = uid; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/RoleModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/RoleModel.java deleted file mode 100644 index a74bdd5..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/RoleModel.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.otherobjects; -import java.util.Map; - -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition of Complete role data - // - public class RoleModel { - - - @SerializedName("Name") - private String name; - - @SerializedName("Permissions") - private Map permissions; - - - - // - // Array of String, which represents the role name - // - public String getName() { - return name; - } - // - // Array of String, which represents the role name - // - public void setName(String name) { - this.name = name; - } - // - // Any Permission name for the role - // - public Map getPermissions() { - return permissions; - } - // - // Any Permission name for the role - // - public void setPermissions(Map permissions) { - this.permissions = permissions; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/ServiceInfoModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/ServiceInfoModel.java deleted file mode 100644 index 783be5f..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/ServiceInfoModel.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.otherobjects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition of Complete service info data - // - public class ServiceInfoModel { - - - @SerializedName("CurrentTime") - private String currentTime; - - @SerializedName("ServerLocation") - private String serverLocation; - - @SerializedName("ServerName") - private String serverName; - - @SerializedName("Sott") - private ServiceSottInfo sott; - - - - // - // Current time - // - public String getCurrentTime() { - return currentTime; - } - // - // Current time - // - public void setCurrentTime(String currentTime) { - this.currentTime = currentTime; - } - // - // Location of server - // - public String getServerLocation() { - return serverLocation; - } - // - // Location of server - // - public void setServerLocation(String serverLocation) { - this.serverLocation = serverLocation; - } - // - // server name - // - public String getServerName() { - return serverName; - } - // - // server name - // - public void setServerName(String serverName) { - this.serverName = serverName; - } - // - // SOTT is a secure one time token - // - public ServiceSottInfo getSott() { - return sott; - } - // - // SOTT is a secure one time token - // - public void setSott(ServiceSottInfo sott) { - this.sott = sott; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/ServiceSottInfo.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/ServiceSottInfo.java deleted file mode 100644 index 846e4d9..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/ServiceSottInfo.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.otherobjects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition of Complete Sott data - // - public class ServiceSottInfo { - - - @SerializedName("EndTime") - private String endTime; - - @SerializedName("ForWardedIP") - private String forWardedIP; - - @SerializedName("IP") - private String iP; - - @SerializedName("StartTime") - private String startTime; - - @SerializedName("TimeDifference") - private String timeDifference; - - - - // - // EndTime - // - public String getEndTime() { - return endTime; - } - // - // EndTime - // - public void setEndTime(String endTime) { - this.endTime = endTime; - } - // - // Forwarded IP - // - public String getForWardedIP() { - return forWardedIP; - } - // - // Forwarded IP - // - public void setForWardedIP(String forWardedIP) { - this.forWardedIP = forWardedIP; - } - // - // users ip address - // - public String getIP() { - return iP; - } - // - // users ip address - // - public void setIP(String iP) { - this.iP = iP; - } - // - // Start time - // - public String getStartTime() { - return startTime; - } - // - // Start time - // - public void setStartTime(String startTime) { - this.startTime = startTime; - } - // - // Difference between start time and end time - // - public String getTimeDifference() { - return timeDifference; - } - // - // Difference between start time and end time - // - public void setTimeDifference(String timeDifference) { - this.timeDifference = timeDifference; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/TokenInfoResponseModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/TokenInfoResponseModel.java deleted file mode 100644 index 39ed4d1..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/TokenInfoResponseModel.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.otherobjects; -import java.util.UUID; - -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition of Token Information - // - public class TokenInfoResponseModel { - - - @SerializedName("access_token") - private UUID access_token; - - @SerializedName("isrememberme") - private Boolean isrememberme; - - @SerializedName("provider") - private String provider; - - - - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // - public UUID getAccess_Token() { - return access_token; - } - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // - public void setAccess_Token(UUID access_token) { - this.access_token = access_token; - } - // - // is remember login or not - // - public Boolean getIsRememberMe() { - return isrememberme; - } - // - // is remember login or not - // - public void setIsRememberMe(Boolean isrememberme) { - this.isrememberme = isrememberme; - } - // - // Name of the provider - // - public String getProvider() { - return provider; - } - // - // Name of the provider - // - public void setProvider(String provider) { - this.provider = provider; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/UserProfilePostResponse.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/UserProfilePostResponse.java deleted file mode 100644 index 50b47d2..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/UserProfilePostResponse.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.otherobjects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition of Complete Validation and UserProfile data - // - public class UserProfilePostResponse { - - - @SerializedName("Data") - private T data; - - @SerializedName("IsPosted") - private Boolean isPosted; - - - - // - // Data - // - public T getData() { - return data; - } - // - // Data - // - public void setData(T data) { - this.data = data; - } - // - // check data is posted - // - public Boolean getIsPosted() { - return isPosted; - } - // - // check data is posted - // - public void setIsPosted(Boolean isPosted) { - this.isPosted = isPosted; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/VerifiedResponse.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/VerifiedResponse.java deleted file mode 100644 index 111845c..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/VerifiedResponse.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.otherobjects; -import com.google.gson.annotations.SerializedName; - - // - // Complete verified response data - // - public class VerifiedResponse { - - - @SerializedName("IsPosted") - private Boolean isPosted; - - @SerializedName("IsVerified") - private Boolean isVerified; - - - - // - // check data is posted - // - public Boolean getIsPosted() { - return isPosted; - } - // - // check data is posted - // - public void setIsPosted(Boolean isPosted) { - this.isPosted = isPosted; - } - // - // is verified or not - // - public Boolean getIsVerified() { - return isVerified; - } - // - // is verified or not - // - public void setIsVerified(Boolean isVerified) { - this.isVerified = isVerified; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/WebHookAuthentication.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/WebHookAuthentication.java deleted file mode 100644 index 29530cc..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/WebHookAuthentication.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.otherobjects; -import java.util.Map; -import java.util.List; -import java.util.UUID; -import com.google.gson.JsonObject; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.*; -import com.google.gson.annotations.SerializedName; - - // - // Authentication details for the webhook - // - public class WebHookAuthentication { - - - @SerializedName("AuthType") - private String authType; - - @SerializedName("BasicAuth") - private WebhookBasicAuthCredentials basicAuth; - - @SerializedName("BearerToken") - private WebhookBearerToken bearerToken; - - - - // - // Webhook Authentication Type - // - public String getAuthType() { - return authType; - } - // - // Webhook Authentication Type - // - public void setAuthType(String authType) { - this.authType = authType; - } - // - // Webhook Basic Authentication - // - public WebhookBasicAuthCredentials getBasicAuth() { - return basicAuth; - } - // - // Webhook Basic Authentication - // - public void setBasicAuth(WebhookBasicAuthCredentials basicAuth) { - this.basicAuth = basicAuth; - } - // - // Bearer Token for authentication - // - public WebhookBearerToken getBearerToken() { - return bearerToken; - } - // - // Bearer Token for authentication - // - public void setBearerToken(WebhookBearerToken bearerToken) { - this.bearerToken = bearerToken; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/WebHookSubscribeModel.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/WebHookSubscribeModel.java deleted file mode 100644 index eb061a7..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/WebHookSubscribeModel.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.otherobjects; -import java.util.Map; -import java.util.List; -import java.util.UUID; -import com.google.gson.JsonObject; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.*; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete WebHook data - // - public class WebHookSubscribeModel { - - - @SerializedName("Id") - private String id; - - @SerializedName("TargetUrl") - private String targetUrl; - - @SerializedName("Event") - private String event; - - @SerializedName("CreatedDate") - private String createdDate; - - @SerializedName("LastModifiedDate") - private String lastModifiedDate; - - @SerializedName("SecretName") - private String secretName; - - @SerializedName("Name") - private String name; - - @SerializedName("IsIntegrationWebhook") - private Boolean isIntegrationWebhook; - - @SerializedName("Headers") - private Map headers; - - @SerializedName("QueryParams") - private Map queryParams; - - @SerializedName("Authentication") - private WebHookAuthentication authentication; - - - - // - // ID of the User - // - public String getId() { - return id; - } - // - // ID of the User - // - public void setId(String id) { - this.id = id; - } - // - // URL where trigger will send data when it invoke - // - public String getTargetUrl() { - return targetUrl; - } - // - // URL where trigger will send data when it invoke - // - public void setTargetUrl(String targetUrl) { - this.targetUrl = targetUrl; - } - // - // Allowed events: Login, Register, UpdateProfile, ResetPassword, ChangePassword, emailVerification, AddEmail, RemoveEmail, BlockAccount, DeleteAccount, SetUsername, AssignRoles, UnassignRoles, SetPassword, LinkAccount, UnlinkAccount, UpdatePhoneId, VerifyPhoneNumber, CreateCustomObject, UpdateCustomobject, DeleteCustomObject - // - public String getEvent() { - return event; - } - // - // Allowed events: Login, Register, UpdateProfile, ResetPassword, ChangePassword, emailVerification, AddEmail, RemoveEmail, BlockAccount, DeleteAccount, SetUsername, AssignRoles, UnassignRoles, SetPassword, LinkAccount, UnlinkAccount, UpdatePhoneId, VerifyPhoneNumber, CreateCustomObject, UpdateCustomobject, DeleteCustomObject - // - public void setEvent(String event) { - this.event = event; - } - // - // Date of Creation of Profile - // - public String getCreatedDate() { - return createdDate; - } - // - // Date of Creation of Profile - // - public void setCreatedDate(String createdDate) { - this.createdDate = createdDate; - } - // - // LastModifiedDate value that need to be inserted - // - public String getLastModifiedDate() { - return lastModifiedDate; - } - // - // LastModifiedDate value that need to be inserted - // - public void setLastModifiedDate(String lastModifiedDate) { - this.lastModifiedDate = lastModifiedDate; - } - // - // The event associated with the consent form - // - public String getSecretName() { - return secretName; - } - // - // The event associated with the consent form - // - public void setSecretName(String secretName) { - this.secretName = secretName; - } - // - // Webhook Name - // - public String getName() { - return name; - } - // - // Webhook Name - // - public void setName(String name) { - this.name = name; - } - // - // The event associated with the consent form - // - public Boolean getIsIntegrationWebhook() { - return isIntegrationWebhook; - } - // - // The event associated with the consent form - // - public void setIsIntegrationWebhook(Boolean isIntegrationWebhook) { - this.isIntegrationWebhook = isIntegrationWebhook; - } - // - // Custom headers for the webhook - // - public Map getHeaders() { - return headers; - } - // - // Custom headers for the webhook - // - public void setHeaders(Map headers) { - this.headers = headers; - } - // - // Query parameters for the webhook - // - public Map getQueryParams() { - return queryParams; - } - // - // Query parameters for the webhook - // - public void setQueryParams(Map queryParams) { - this.queryParams = queryParams; - } - // - // Authentication details for the webhook - // - public WebHookAuthentication getAuthentication() { - return authentication; - } - // - // Authentication details for the webhook - // - public void setAuthentication(WebHookAuthentication authentication) { - this.authentication = authentication; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/WebhookBasicAuthCredentials.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/WebhookBasicAuthCredentials.java deleted file mode 100644 index aa541aa..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/WebhookBasicAuthCredentials.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.otherobjects; -import java.util.Map; -import java.util.List; -import java.util.UUID; -import com.google.gson.JsonObject; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.*; -import com.google.gson.annotations.SerializedName; - - // - // Credentials for basic authentication - // - public class WebhookBasicAuthCredentials { - - - @SerializedName("Username") - private String username; - - @SerializedName("Password") - private String password; - - - - // - // Username for basic authentication - // - public String getUsername() { - return username; - } - // - // Username for basic authentication - // - public void setUsername(String username) { - this.username = username; - } - // - // Password for basic authentication - // - public String getPassword() { - return password; - } - // - // Password for basic authentication - // - public void setPassword(String password) { - this.password = password; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/WebhookBearerToken.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/WebhookBearerToken.java deleted file mode 100644 index bc47bcf..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/otherobjects/WebhookBearerToken.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.otherobjects; -import java.util.Map; -import java.util.List; -import java.util.UUID; -import com.google.gson.JsonObject; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.*; -import com.google.gson.annotations.SerializedName; - - // - // WebhookBearerToken for authentication - // - public class WebhookBearerToken { - - - @SerializedName("Token") - private String token; - - - - // - // Bearer Token for Webhook authentication - // - public String getToken() { - return token; - } - // - // Bearer Token for Webhook authentication - // - public void setToken(String token) { - this.token = token; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/Identity.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/Identity.java deleted file mode 100644 index 3272c28..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/Identity.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete profile data - // - public class Identity extends UserProfile { - - - @SerializedName("Identities") - private List identities; - - - - // - // User Identities list - // - public List getIdentities() { - return identities; - } - // - // User Identities list - // - public void setIdentities(List identities) { - this.identities = identities; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/SocialUserProfile.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/SocialUserProfile.java deleted file mode 100644 index 320b81d..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/SocialUserProfile.java +++ /dev/null @@ -1,1770 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile; -import java.util.List; -import java.util.Map; - -import com.google.gson.annotations.SerializedName; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.Address; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.AgeRange; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.Awards; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.Badges; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.Books; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.Certifications; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.Country; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.Courses; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.CurrentStatus; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.Education; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.Email; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.Family; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.FavoriteThings; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.Games; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.GitHubPlan; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.IMAccount; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.InspirationalPeople; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.Interests; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.JobBookmarks; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.KloutProfile; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.Languages; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.Memberurlresources; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.Movies; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.MutualFriends; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.Patents; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.Phone; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.PlacesLived; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.ProfessionalPosition; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.Projects; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.ProviderAccessCredential; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.Publications; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.RecommendationsReceived; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.RelatedProfileViews; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.Skills; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.Sports; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.Suggestions; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.Television; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.Volunteer; - - // - // Response containing Definition for Complete SocialUserProfile data - // - public class SocialUserProfile { - - - @SerializedName("About") - private String about; - - @SerializedName("Addresses") - private List
addresses; - - @SerializedName("Age") - private String age; - - @SerializedName("AgeRange") - private AgeRange ageRange; - - @SerializedName("Associations") - private String associations; - - @SerializedName("Awards") - private List awards; - - @SerializedName("Badges") - private List badges; - - @SerializedName("BirthDate") - private String birthDate; - - @SerializedName("BoardsCount") - private Integer boardsCount; - - @SerializedName("Books") - private List books; - - @SerializedName("Certifications") - private List certifications; - - @SerializedName("City") - private String city; - - @SerializedName("Company") - private String company; - - @SerializedName("Country") - private Country country; - - @SerializedName("Courses") - private List courses; - - @SerializedName("CoverPhoto") - private String coverPhoto; - - @SerializedName("Created") - private String created; - - @SerializedName("CreatedDate") - private String createdDate; - - @SerializedName("Currency") - private String currency; - - @SerializedName("CurrentStatus") - private List currentStatus; - - @SerializedName("Educations") - private List educations; - - @SerializedName("Email") - private List email; - - @SerializedName("Family") - private List family; - - @SerializedName("Favicon") - private String favicon; - - @SerializedName("FavoriteThings") - private List favoriteThings; - - @SerializedName("FirstLogin") - private Boolean firstLogin; - - @SerializedName("FirstName") - private String firstName; - - @SerializedName("FollowersCount") - private Integer followersCount; - - @SerializedName("FriendsCount") - private Integer friendsCount; - - @SerializedName("FullName") - private String fullName; - - @SerializedName("Games") - private List games; - - @SerializedName("Gender") - private String gender; - - @SerializedName("GistsUrl") - private String gistsUrl; - - @SerializedName("GravatarImageUrl") - private String gravatarImageUrl; - - @SerializedName("Hireable") - private Boolean hireable; - - @SerializedName("HomeTown") - private String homeTown; - - @SerializedName("Honors") - private String honors; - - @SerializedName("HttpsImageUrl") - private String httpsImageUrl; - - @SerializedName("ID") - private String iD; - - @SerializedName("IMAccounts") - private List iMAccounts; - - @SerializedName("ImageUrl") - private String imageUrl; - - @SerializedName("Industry") - private String industry; - - @SerializedName("InspirationalPeople") - private List inspirationalPeople; - - @SerializedName("InterestedIn") - private List interestedIn; - - @SerializedName("Interests") - private List interests; - - @SerializedName("IsGeoEnabled") - private String isGeoEnabled; - - @SerializedName("IsProtected") - private Boolean isProtected; - - @SerializedName("JobBookmarks") - private List jobBookmarks; - - @SerializedName("KloutScore") - private KloutProfile kloutScore; - - @SerializedName("Language") - private String language; - - @SerializedName("Languages") - private List languages; - - @SerializedName("LastLoginDate") - private String lastLoginDate; - - @SerializedName("LastName") - private String lastName; - - @SerializedName("LikesCount") - private Integer likesCount; - - @SerializedName("LocalCity") - private String localCity; - - @SerializedName("LocalCountry") - private String localCountry; - - @SerializedName("LocalLanguage") - private String localLanguage; - - @SerializedName("LRUserID") - private String lRUserID; - - @SerializedName("MainAddress") - private String mainAddress; - - @SerializedName("MemberUrlResources") - private List memberUrlResources; - - @SerializedName("MiddleName") - private String middleName; - - @SerializedName("ModifiedDate") - private String modifiedDate; - - @SerializedName("Movies") - private List movies; - - @SerializedName("MutualFriends") - private List mutualFriends; - - @SerializedName("NickName") - private String nickName; - - @SerializedName("NumRecommenders") - private Integer numRecommenders; - - @SerializedName("Patents") - private List patents; - - @SerializedName("PhoneNumbers") - private List phoneNumbers; - - @SerializedName("PinsCount") - private Integer pinsCount; - - @SerializedName("PlacesLived") - private List placesLived; - - @SerializedName("Political") - private String political; - - @SerializedName("Positions") - private List positions; - - @SerializedName("Prefix") - private String prefix; - - @SerializedName("PreviousUids") - private List previousUids; - - @SerializedName("PrivateGists") - private Integer privateGists; - - @SerializedName("ProfessionalHeadline") - private String professionalHeadline; - - @SerializedName("ProfileCity") - private String profileCity; - - @SerializedName("ProfileCountry") - private String profileCountry; - - @SerializedName("ProfileImageUrls") - private Map profileImageUrls; - - @SerializedName("ProfileModifiedDate") - private String profileModifiedDate; - - @SerializedName("ProfileName") - private String profileName; - - @SerializedName("ProfileUrl") - private String profileUrl; - - @SerializedName("Projects") - private List projects; - - @SerializedName("Provider") - private String provider; - - @SerializedName("ProviderAccessCredential") - private ProviderAccessCredential providerAccessCredential; - - @SerializedName("Publications") - private List publications; - - @SerializedName("PublicGists") - private Integer publicGists; - - @SerializedName("PublicRepository") - private String publicRepository; - - @SerializedName("Quota") - private String quota; - - @SerializedName("Quote") - private String quote; - - @SerializedName("RecommendationsReceived") - private List recommendationsReceived; - - @SerializedName("RelatedProfileViews") - private List relatedProfileViews; - - @SerializedName("RelationshipStatus") - private String relationshipStatus; - - @SerializedName("Religion") - private String religion; - - @SerializedName("RepositoryUrl") - private String repositoryUrl; - - @SerializedName("SignupDate") - private String signupDate; - - @SerializedName("Skills") - private List skills; - - @SerializedName("Sports") - private List sports; - - @SerializedName("StarredUrl") - private String starredUrl; - - @SerializedName("State") - private String state; - - @SerializedName("Subscription") - private GitHubPlan subscription; - - @SerializedName("Suffix") - private String suffix; - - @SerializedName("Suggestions") - private Suggestions suggestions; - - @SerializedName("TagLine") - private String tagLine; - - @SerializedName("TeleVisionShow") - private List teleVisionShow; - - @SerializedName("ThumbnailImageUrl") - private String thumbnailImageUrl; - - @SerializedName("TimeZone") - private String timeZone; - - @SerializedName("TotalPrivateRepository") - private Integer totalPrivateRepository; - - @SerializedName("TotalStatusesCount") - private Integer totalStatusesCount; - - @SerializedName("UpdatedTime") - private String updatedTime; - - @SerializedName("Verified") - private String verified; - - @SerializedName("Volunteer") - private List volunteer; - - @SerializedName("WebProfiles") - private Map webProfiles; - - @SerializedName("Website") - private String website; - - - - // - // About value that need to be inserted - // - public String getAbout() { - return about; - } - // - // About value that need to be inserted - // - public void setAbout(String about) { - this.about = about; - } - // - // Array of objects,String represents address of user - // - public List
getAddresses() { - return addresses; - } - // - // Array of objects,String represents address of user - // - public void setAddresses(List
addresses) { - this.addresses = addresses; - } - // - // User's Age - // - public String getAge() { - return age; - } - // - // User's Age - // - public void setAge(String age) { - this.age = age; - } - // - // user's age range. - // - public AgeRange getAgeRange() { - return ageRange; - } - // - // user's age range. - // - public void setAgeRange(AgeRange ageRange) { - this.ageRange = ageRange; - } - // - // Organization a person is assosciated with - // - public String getAssociations() { - return associations; - } - // - // Organization a person is assosciated with - // - public void setAssociations(String associations) { - this.associations = associations; - } - // - // Array of Objects,String represents Id, Name and Issuer - // - public List getAwards() { - return awards; - } - // - // Array of Objects,String represents Id, Name and Issuer - // - public void setAwards(List awards) { - this.awards = awards; - } - // - // User's Badges. - // - public List getBadges() { - return badges; - } - // - // User's Badges. - // - public void setBadges(List badges) { - this.badges = badges; - } - // - // user's birthdate - // - public String getBirthDate() { - return birthDate; - } - // - // user's birthdate - // - public void setBirthDate(String birthDate) { - this.birthDate = birthDate; - } - // - // boards count - // - public Integer getBoardsCount() { - return boardsCount; - } - // - // boards count - // - public void setBoardsCount(Integer boardsCount) { - this.boardsCount = boardsCount; - } - // - // Array of Objects,String represents Id,Name,Category,CreatedDate - // - public List getBooks() { - return books; - } - // - // Array of Objects,String represents Id,Name,Category,CreatedDate - // - public void setBooks(List books) { - this.books = books; - } - // - // Array of Objects,string represents Id,Name,Authority Number,StartDate,EndDate - // - public List getCertifications() { - return certifications; - } - // - // Array of Objects,string represents Id,Name,Authority Number,StartDate,EndDate - // - public void setCertifications(List certifications) { - this.certifications = certifications; - } - // - // user's city - // - public String getCity() { - return city; - } - // - // user's city - // - public void setCity(String city) { - this.city = city; - } - // - // users company name - // - public String getCompany() { - return company; - } - // - // users company name - // - public void setCompany(String company) { - this.company = company; - } - // - // Country of the user - // - public Country getCountry() { - return country; - } - // - // Country of the user - // - public void setCountry(Country country) { - this.country = country; - } - // - // users course information - // - public List getCourses() { - return courses; - } - // - // users course information - // - public void setCourses(List courses) { - this.courses = courses; - } - // - // URL of the photo that need to be inserted - // - public String getCoverPhoto() { - return coverPhoto; - } - // - // URL of the photo that need to be inserted - // - public void setCoverPhoto(String coverPhoto) { - this.coverPhoto = coverPhoto; - } - // - // created - // - public String getCreated() { - return created; - } - // - // created - // - public void setCreated(String created) { - this.created = created; - } - // - // Date of Creation of Profile - // - public String getCreatedDate() { - return createdDate; - } - // - // Date of Creation of Profile - // - public void setCreatedDate(String createdDate) { - this.createdDate = createdDate; - } - // - // Currency - // - public String getCurrency() { - return currency; - } - // - // Currency - // - public void setCurrency(String currency) { - this.currency = currency; - } - // - // Array of Objects,String represents id ,Text ,Source and CreatedDate - // - public List getCurrentStatus() { - return currentStatus; - } - // - // Array of Objects,String represents id ,Text ,Source and CreatedDate - // - public void setCurrentStatus(List currentStatus) { - this.currentStatus = currentStatus; - } - // - // Array of Objects,which represents the educations record - // - public List getEducations() { - return educations; - } - // - // Array of Objects,which represents the educations record - // - public void setEducations(List educations) { - this.educations = educations; - } - // - // user's email - // - public List getEmail() { - return email; - } - // - // user's email - // - public void setEmail(List email) { - this.email = email; - } - // - // user's family - // - public List getFamily() { - return family; - } - // - // user's family - // - public void setFamily(List family) { - this.family = family; - } - // - // URL of the favicon that need to be inserted - // - public String getFavicon() { - return favicon; - } - // - // URL of the favicon that need to be inserted - // - public void setFavicon(String favicon) { - this.favicon = favicon; - } - // - // Array of Objects,strings represents Id ,Name ,Type - // - public List getFavoriteThings() { - return favoriteThings; - } - // - // Array of Objects,strings represents Id ,Name ,Type - // - public void setFavoriteThings(List favoriteThings) { - this.favoriteThings = favoriteThings; - } - // - // first login - // - public Boolean getFirstLogin() { - return firstLogin; - } - // - // first login - // - public void setFirstLogin(Boolean firstLogin) { - this.firstLogin = firstLogin; - } - // - // user's first name - // - public String getFirstName() { - return firstName; - } - // - // user's first name - // - public void setFirstName(String firstName) { - this.firstName = firstName; - } - // - // user's followers count - // - public Integer getFollowersCount() { - return followersCount; - } - // - // user's followers count - // - public void setFollowersCount(Integer followersCount) { - this.followersCount = followersCount; - } - // - // users friends count - // - public Integer getFriendsCount() { - return friendsCount; - } - // - // users friends count - // - public void setFriendsCount(Integer friendsCount) { - this.friendsCount = friendsCount; - } - // - // Users complete name - // - public String getFullName() { - return fullName; - } - // - // Users complete name - // - public void setFullName(String fullName) { - this.fullName = fullName; - } - // - // Array of Objects,string represents Id,Name,Category,CreatedDate - // - public List getGames() { - return games; - } - // - // Array of Objects,string represents Id,Name,Category,CreatedDate - // - public void setGames(List games) { - this.games = games; - } - // - // user's gender - // - public String getGender() { - return gender; - } - // - // user's gender - // - public void setGender(String gender) { - this.gender = gender; - } - // - // Git Repository URL - // - public String getGistsUrl() { - return gistsUrl; - } - // - // Git Repository URL - // - public void setGistsUrl(String gistsUrl) { - this.gistsUrl = gistsUrl; - } - // - // URL of image that need to be inserted - // - public String getGravatarImageUrl() { - return gravatarImageUrl; - } - // - // URL of image that need to be inserted - // - public void setGravatarImageUrl(String gravatarImageUrl) { - this.gravatarImageUrl = gravatarImageUrl; - } - // - // boolean type value, default value is true - // - public Boolean getHireable() { - return hireable; - } - // - // boolean type value, default value is true - // - public void setHireable(Boolean hireable) { - this.hireable = hireable; - } - // - // user's home town name - // - public String getHomeTown() { - return homeTown; - } - // - // user's home town name - // - public void setHomeTown(String homeTown) { - this.homeTown = homeTown; - } - // - // Awards lists from the social provider - // - public String getHonors() { - return honors; - } - // - // Awards lists from the social provider - // - public void setHonors(String honors) { - this.honors = honors; - } - // - // URL of the Image that need to be inserted - // - public String getHttpsImageUrl() { - return httpsImageUrl; - } - // - // URL of the Image that need to be inserted - // - public void setHttpsImageUrl(String httpsImageUrl) { - this.httpsImageUrl = httpsImageUrl; - } - // - // ID of the User - // - public String getID() { - return iD; - } - // - // ID of the User - // - public void setID(String iD) { - this.iD = iD; - } - // - // Array of objects, String represents account type and account name. - // - public List getIMAccounts() { - return iMAccounts; - } - // - // Array of objects, String represents account type and account name. - // - public void setIMAccounts(List iMAccounts) { - this.iMAccounts = iMAccounts; - } - // - // image URL should be absolute and has HTTPS domain - // - public String getImageUrl() { - return imageUrl; - } - // - // image URL should be absolute and has HTTPS domain - // - public void setImageUrl(String imageUrl) { - this.imageUrl = imageUrl; - } - // - // Industry name - // - public String getIndustry() { - return industry; - } - // - // Industry name - // - public void setIndustry(String industry) { - this.industry = industry; - } - // - // Array of Objects,string represents Id and Name - // - public List getInspirationalPeople() { - return inspirationalPeople; - } - // - // Array of Objects,string represents Id and Name - // - public void setInspirationalPeople(List inspirationalPeople) { - this.inspirationalPeople = inspirationalPeople; - } - // - // array of string represents interest - // - public List getInterestedIn() { - return interestedIn; - } - // - // array of string represents interest - // - public void setInterestedIn(List interestedIn) { - this.interestedIn = interestedIn; - } - // - // Array of objects, string shows InterestedType and InterestedName - // - public List getInterests() { - return interests; - } - // - // Array of objects, string shows InterestedType and InterestedName - // - public void setInterests(List interests) { - this.interests = interests; - } - // - // boolean type value, default is true - // - public String getIsGeoEnabled() { - return isGeoEnabled; - } - // - // boolean type value, default is true - // - public void setIsGeoEnabled(String isGeoEnabled) { - this.isGeoEnabled = isGeoEnabled; - } - // - // boolean type value, default is true - // - public Boolean getIsProtected() { - return isProtected; - } - // - // boolean type value, default is true - // - public void setIsProtected(Boolean isProtected) { - this.isProtected = isProtected; - } - // - // Array of Objects,Strings,boolean,object represents IsApplied,ApplyTimestamp,IsSaved,SavedTimestamp,Job - // - public List getJobBookmarks() { - return jobBookmarks; - } - // - // Array of Objects,Strings,boolean,object represents IsApplied,ApplyTimestamp,IsSaved,SavedTimestamp,Job - // - public void setJobBookmarks(List jobBookmarks) { - this.jobBookmarks = jobBookmarks; - } - // - // Object, string represents KloutId and double represents Score - // - public KloutProfile getKloutScore() { - return kloutScore; - } - // - // Object, string represents KloutId and double represents Score - // - public void setKloutScore(KloutProfile kloutScore) { - this.kloutScore = kloutScore; - } - // - // language known by user's - // - public String getLanguage() { - return language; - } - // - // language known by user's - // - public void setLanguage(String language) { - this.language = language; - } - // - // language known by user's - // - public List getLanguages() { - return languages; - } - // - // language known by user's - // - public void setLanguages(List languages) { - this.languages = languages; - } - // - // last login date - // - public String getLastLoginDate() { - return lastLoginDate; - } - // - // last login date - // - public void setLastLoginDate(String lastLoginDate) { - this.lastLoginDate = lastLoginDate; - } - // - // user's last name - // - public String getLastName() { - return lastName; - } - // - // user's last name - // - public void setLastName(String lastName) { - this.lastName = lastName; - } - // - // likes count - // - public Integer getLikesCount() { - return likesCount; - } - // - // likes count - // - public void setLikesCount(Integer likesCount) { - this.likesCount = likesCount; - } - // - // Local City of the user - // - public String getLocalCity() { - return localCity; - } - // - // Local City of the user - // - public void setLocalCity(String localCity) { - this.localCity = localCity; - } - // - // Local country of the user - // - public String getLocalCountry() { - return localCountry; - } - // - // Local country of the user - // - public void setLocalCountry(String localCountry) { - this.localCountry = localCountry; - } - // - // Local language of the user - // - public String getLocalLanguage() { - return localLanguage; - } - // - // Local language of the user - // - public void setLocalLanguage(String localLanguage) { - this.localLanguage = localLanguage; - } - // - // LR user id - // - public String getLRUserID() { - return lRUserID; - } - // - // LR user id - // - public void setLRUserID(String lRUserID) { - this.lRUserID = lRUserID; - } - // - // Main address of the user - // - public String getMainAddress() { - return mainAddress; - } - // - // Main address of the user - // - public void setMainAddress(String mainAddress) { - this.mainAddress = mainAddress; - } - // - // Array of Objects,String represents Url,UrlName - // - public List getMemberUrlResources() { - return memberUrlResources; - } - // - // Array of Objects,String represents Url,UrlName - // - public void setMemberUrlResources(List memberUrlResources) { - this.memberUrlResources = memberUrlResources; - } - // - // user's middle name - // - public String getMiddleName() { - return middleName; - } - // - // user's middle name - // - public void setMiddleName(String middleName) { - this.middleName = middleName; - } - // - // profile updated date - // - public String getModifiedDate() { - return modifiedDate; - } - // - // profile updated date - // - public void setModifiedDate(String modifiedDate) { - this.modifiedDate = modifiedDate; - } - // - // Array of Objects,strings represents Id,Name,Category,CreatedDate - // - public List getMovies() { - return movies; - } - // - // Array of Objects,strings represents Id,Name,Category,CreatedDate - // - public void setMovies(List movies) { - this.movies = movies; - } - // - // Array of Objects, strings represents Id,Name,FirstName,LastName,Birthday,Hometown,Link,Gender - // - public List getMutualFriends() { - return mutualFriends; - } - // - // Array of Objects, strings represents Id,Name,FirstName,LastName,Birthday,Hometown,Link,Gender - // - public void setMutualFriends(List mutualFriends) { - this.mutualFriends = mutualFriends; - } - // - // Nick name of the user - // - public String getNickName() { - return nickName; - } - // - // Nick name of the user - // - public void setNickName(String nickName) { - this.nickName = nickName; - } - // - // Count for the user profile recommended - // - public Integer getNumRecommenders() { - return numRecommenders; - } - // - // Count for the user profile recommended - // - public void setNumRecommenders(Integer numRecommenders) { - this.numRecommenders = numRecommenders; - } - // - // Patents Registered - // - public List getPatents() { - return patents; - } - // - // Patents Registered - // - public void setPatents(List patents) { - this.patents = patents; - } - // - // Users Phone Number - // - public List getPhoneNumbers() { - return phoneNumbers; - } - // - // Users Phone Number - // - public void setPhoneNumbers(List phoneNumbers) { - this.phoneNumbers = phoneNumbers; - } - // - // count of pins - // - public Integer getPinsCount() { - return pinsCount; - } - // - // count of pins - // - public void setPinsCount(Integer pinsCount) { - this.pinsCount = pinsCount; - } - // - // Array of Objects,strings Name and boolean IsPrimary - // - public List getPlacesLived() { - return placesLived; - } - // - // Array of Objects,strings Name and boolean IsPrimary - // - public void setPlacesLived(List placesLived) { - this.placesLived = placesLived; - } - // - // List of Political interest - // - public String getPolitical() { - return political; - } - // - // List of Political interest - // - public void setPolitical(String political) { - this.political = political; - } - // - // Array of Objects,which represents the PositionSummary,StartDate,EndDate,IsCurrent,Company,Location - // - public List getPositions() { - return positions; - } - // - // Array of Objects,which represents the PositionSummary,StartDate,EndDate,IsCurrent,Company,Location - // - public void setPositions(List positions) { - this.positions = positions; - } - // - // Prefix for FirstName - // - public String getPrefix() { - return prefix; - } - // - // Prefix for FirstName - // - public void setPrefix(String prefix) { - this.prefix = prefix; - } - // - // previous ids - // - public List getPreviousUids() { - return previousUids; - } - // - // previous ids - // - public void setPreviousUids(List previousUids) { - this.previousUids = previousUids; - } - // - // user private Repository Urls - // - public Integer getPrivateGists() { - return privateGists; - } - // - // user private Repository Urls - // - public void setPrivateGists(Integer privateGists) { - this.privateGists = privateGists; - } - // - // This field provide by linkedin.contain our linkedin profile headline - // - public String getProfessionalHeadline() { - return professionalHeadline; - } - // - // This field provide by linkedin.contain our linkedin profile headline - // - public void setProfessionalHeadline(String professionalHeadline) { - this.professionalHeadline = professionalHeadline; - } - // - // ProfileCity value that need to be inserted - // - public String getProfileCity() { - return profileCity; - } - // - // ProfileCity value that need to be inserted - // - public void setProfileCity(String profileCity) { - this.profileCity = profileCity; - } - // - // ProfileCountry value that need to be inserted - // - public String getProfileCountry() { - return profileCountry; - } - // - // ProfileCountry value that need to be inserted - // - public void setProfileCountry(String profileCountry) { - this.profileCountry = profileCountry; - } - // - // ProfileImageUrls that need to be inserted - // - public Map getProfileImageUrls() { - return profileImageUrls; - } - // - // ProfileImageUrls that need to be inserted - // - public void setProfileImageUrls(Map profileImageUrls) { - this.profileImageUrls = profileImageUrls; - } - // - // profile updated date - // - public String getProfileModifiedDate() { - return profileModifiedDate; - } - // - // profile updated date - // - public void setProfileModifiedDate(String profileModifiedDate) { - this.profileModifiedDate = profileModifiedDate; - } - // - // ProfileName value field that need to be inserted - // - public String getProfileName() { - return profileName; - } - // - // ProfileName value field that need to be inserted - // - public void setProfileName(String profileName) { - this.profileName = profileName; - } - // - // User profile url like facebook profile Url - // - public String getProfileUrl() { - return profileUrl; - } - // - // User profile url like facebook profile Url - // - public void setProfileUrl(String profileUrl) { - this.profileUrl = profileUrl; - } - // - // Array of Objects,string represents Id,Name,Summary With StartDate,EndDate,IsCurrent - // - public List getProjects() { - return projects; - } - // - // Array of Objects,string represents Id,Name,Summary With StartDate,EndDate,IsCurrent - // - public void setProjects(List projects) { - this.projects = projects; - } - // - // Name of the provider - // - public String getProvider() { - return provider; - } - // - // Name of the provider - // - public void setProvider(String provider) { - this.provider = provider; - } - // - // Object,string represents AccessToken,TokenSecret - // - public ProviderAccessCredential getProviderAccessCredential() { - return providerAccessCredential; - } - // - // Object,string represents AccessToken,TokenSecret - // - public void setProviderAccessCredential(ProviderAccessCredential providerAccessCredential) { - this.providerAccessCredential = providerAccessCredential; - } - // - // Array of Objects,string represents Id,Title,Publisher,Authors,Date,Url,Summary - // - public List getPublications() { - return publications; - } - // - // Array of Objects,string represents Id,Title,Publisher,Authors,Date,Url,Summary - // - public void setPublications(List publications) { - this.publications = publications; - } - // - // gist is a Git repository, which means that it can be forked and cloned. - // - public Integer getPublicGists() { - return publicGists; - } - // - // gist is a Git repository, which means that it can be forked and cloned. - // - public void setPublicGists(Integer publicGists) { - this.publicGists = publicGists; - } - // - // user public Repository Urls - // - public String getPublicRepository() { - return publicRepository; - } - // - // user public Repository Urls - // - public void setPublicRepository(String publicRepository) { - this.publicRepository = publicRepository; - } - // - // Quota - // - public String getQuota() { - return quota; - } - // - // Quota - // - public void setQuota(String quota) { - this.quota = quota; - } - // - // quote - // - public String getQuote() { - return quote; - } - // - // quote - // - public void setQuote(String quote) { - this.quote = quote; - } - // - // Array of Objects,string represents Id,RecommendationType,RecommendationText,Recommender - // - public List getRecommendationsReceived() { - return recommendationsReceived; - } - // - // Array of Objects,string represents Id,RecommendationType,RecommendationText,Recommender - // - public void setRecommendationsReceived(List recommendationsReceived) { - this.recommendationsReceived = recommendationsReceived; - } - // - // Array of Objects,String represents Id,FirstName,LastName - // - public List getRelatedProfileViews() { - return relatedProfileViews; - } - // - // Array of Objects,String represents Id,FirstName,LastName - // - public void setRelatedProfileViews(List relatedProfileViews) { - this.relatedProfileViews = relatedProfileViews; - } - // - // user's relationship status - // - public String getRelationshipStatus() { - return relationshipStatus; - } - // - // user's relationship status - // - public void setRelationshipStatus(String relationshipStatus) { - this.relationshipStatus = relationshipStatus; - } - // - // String shows users religion - // - public String getReligion() { - return religion; - } - // - // String shows users religion - // - public void setReligion(String religion) { - this.religion = religion; - } - // - // Repository URL - // - public String getRepositoryUrl() { - return repositoryUrl; - } - // - // Repository URL - // - public void setRepositoryUrl(String repositoryUrl) { - this.repositoryUrl = repositoryUrl; - } - // - // Signup date - // - public String getSignupDate() { - return signupDate; - } - // - // Signup date - // - public void setSignupDate(String signupDate) { - this.signupDate = signupDate; - } - // - // Array of objects, String represents ID and Name - // - public List getSkills() { - return skills; - } - // - // Array of objects, String represents ID and Name - // - public void setSkills(List skills) { - this.skills = skills; - } - // - // Array of objects, String represents ID and Name - // - public List getSports() { - return sports; - } - // - // Array of objects, String represents ID and Name - // - public void setSports(List sports) { - this.sports = sports; - } - // - // Git users bookmark repositories - // - public String getStarredUrl() { - return starredUrl; - } - // - // Git users bookmark repositories - // - public void setStarredUrl(String starredUrl) { - this.starredUrl = starredUrl; - } - // - // State of the user - // - public String getState() { - return state; - } - // - // State of the user - // - public void setState(String state) { - this.state = state; - } - // - // Object,string represents Name,Space,PrivateRepos,Collaborators - // - public GitHubPlan getSubscription() { - return subscription; - } - // - // Object,string represents Name,Space,PrivateRepos,Collaborators - // - public void setSubscription(GitHubPlan subscription) { - this.subscription = subscription; - } - // - // Suffix for the User. - // - public String getSuffix() { - return suffix; - } - // - // Suffix for the User. - // - public void setSuffix(String suffix) { - this.suffix = suffix; - } - // - // Object,array of objects represents CompaniestoFollow,IndustriestoFollow,NewssourcetoFollow,PeopletoFollow - // - public Suggestions getSuggestions() { - return suggestions; - } - // - // Object,array of objects represents CompaniestoFollow,IndustriestoFollow,NewssourcetoFollow,PeopletoFollow - // - public void setSuggestions(Suggestions suggestions) { - this.suggestions = suggestions; - } - // - // Tagline that need to be inserted - // - public String getTagLine() { - return tagLine; - } - // - // Tagline that need to be inserted - // - public void setTagLine(String tagLine) { - this.tagLine = tagLine; - } - // - // Array of Objects,string represents Id,Name,Category,CreatedDate - // - public List getTeleVisionShow() { - return teleVisionShow; - } - // - // Array of Objects,string represents Id,Name,Category,CreatedDate - // - public void setTeleVisionShow(List teleVisionShow) { - this.teleVisionShow = teleVisionShow; - } - // - // URL for the Thumbnail - // - public String getThumbnailImageUrl() { - return thumbnailImageUrl; - } - // - // URL for the Thumbnail - // - public void setThumbnailImageUrl(String thumbnailImageUrl) { - this.thumbnailImageUrl = thumbnailImageUrl; - } - // - // The Current Time Zone. - // - public String getTimeZone() { - return timeZone; - } - // - // The Current Time Zone. - // - public void setTimeZone(String timeZone) { - this.timeZone = timeZone; - } - // - // Total Private repository - // - public Integer getTotalPrivateRepository() { - return totalPrivateRepository; - } - // - // Total Private repository - // - public void setTotalPrivateRepository(Integer totalPrivateRepository) { - this.totalPrivateRepository = totalPrivateRepository; - } - // - // Count of Total status - // - public Integer getTotalStatusesCount() { - return totalStatusesCount; - } - // - // Count of Total status - // - public void setTotalStatusesCount(Integer totalStatusesCount) { - this.totalStatusesCount = totalStatusesCount; - } - // - // updated date - // - public String getUpdatedTime() { - return updatedTime; - } - // - // updated date - // - public void setUpdatedTime(String updatedTime) { - this.updatedTime = updatedTime; - } - // - // verified - // - public String getVerified() { - return verified; - } - // - // verified - // - public void setVerified(String verified) { - this.verified = verified; - } - // - // Array of Objects,string represents Id,Role,Organization,Cause - // - public List getVolunteer() { - return volunteer; - } - // - // Array of Objects,string represents Id,Role,Organization,Cause - // - public void setVolunteer(List volunteer) { - this.volunteer = volunteer; - } - // - // Twitter, Facebook ProfileUrls - // - public Map getWebProfiles() { - return webProfiles; - } - // - // Twitter, Facebook ProfileUrls - // - public void setWebProfiles(Map webProfiles) { - this.webProfiles = webProfiles; - } - // - // Personal Website a User has - // - public String getWebsite() { - return website; - } - // - // Personal Website a User has - // - public void setWebsite(String website) { - this.website = website; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/UserProfile.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/UserProfile.java deleted file mode 100644 index 2aedd04..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/UserProfile.java +++ /dev/null @@ -1,494 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile; -import java.util.List; -import java.util.Map; - -import com.google.gson.annotations.SerializedName; -import com.loginradius.sdk.models.responsemodels.ConsentProfile; -import com.loginradius.sdk.models.responsemodels.otherobjects.PinInformation; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.AcceptedPrivacyPolicy; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.Email; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.ExternalIds; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.OrganizationResponseInProfile; -import com.loginradius.sdk.models.responsemodels.userprofile.objects.RegistrationData; - - // - // Response containing Definition for Complete UserProfile data - // - public class UserProfile extends SocialUserProfile { - - - @SerializedName("ConsentProfile") - private ConsentProfile consentProfile; - - @SerializedName("CustomFields") - private Map customFields; - - @SerializedName("EmailVerified") - private Boolean emailVerified; - - @SerializedName("ExternalIds") - private List externalIds; - - @SerializedName("ExternalUserLoginId") - private String externalUserLoginId; - - @SerializedName("IsActive") - private Boolean isActive; - - @SerializedName("IsCustomUid") - private Boolean isCustomUid; - - @SerializedName("IsDeleted") - private Boolean isDeleted; - - @SerializedName("IsEmailSubscribed") - private Boolean isEmailSubscribed; - - @SerializedName("IsLoginLocked") - private Boolean isLoginLocked; - - @SerializedName("IsRequiredFieldsFilledOnce") - private Boolean isRequiredFieldsFilledOnce; - - @SerializedName("IsSecurePassword") - private Boolean isSecurePassword; - - @SerializedName("LastLoginLocation") - private String lastLoginLocation; - - @SerializedName("LastPasswordChangeDate") - private String lastPasswordChangeDate; - - @SerializedName("LastPasswordChangeToken") - private String lastPasswordChangeToken; - - @SerializedName("LoginLockedType") - private String loginLockedType; - - @SerializedName("NoOfLogins") - private Integer noOfLogins; - - @SerializedName("Organizations") - private List organizations; - - @SerializedName("Password") - private String password; - - @SerializedName("PasswordExpirationDate") - private String passwordExpirationDate; - - @SerializedName("PhoneId") - private String phoneId; - - @SerializedName("PhoneIdVerified") - private Boolean phoneIdVerified; - - @SerializedName("PIN") - private PinInformation pin; - - @SerializedName("PrivacyPolicy") - private AcceptedPrivacyPolicy privacyPolicy; - - @SerializedName("RegistrationData") - private RegistrationData registrationData; - - @SerializedName("RegistrationProvider") - private String registrationProvider; - - @SerializedName("RegistrationSource") - private String registrationSource; - - @SerializedName("Roles") - private List roles; - - @SerializedName("Uid") - private String uid; - - @SerializedName("UnverifiedEmail") - private List unverifiedEmail; - - @SerializedName("UserName") - private String userName; - - - - // - // List of Consents - // - public ConsentProfile getConsentProfile() { - return consentProfile; - } - // - // List of Consents - // - public void setConsentProfile(ConsentProfile consentProfile) { - this.consentProfile = consentProfile; - } - // - // Custom fields as user set on LoginRadius Admin Console. - // - public Map getCustomFields() { - return customFields; - } - // - // Custom fields as user set on LoginRadius Admin Console. - // - public void setCustomFields(Map customFields) { - this.customFields = customFields; - } - // - // boolean type value, default is true - // - public Boolean getEmailVerified() { - return emailVerified; - } - // - // boolean type value, default is true - // - public void setEmailVerified(Boolean emailVerified) { - this.emailVerified = emailVerified; - } - // - // Array of Objects,string represents SourceId,Source - // - public List getExternalIds() { - return externalIds; - } - // - // Array of Objects,string represents SourceId,Source - // - public void setExternalIds(List externalIds) { - this.externalIds = externalIds; - } - // - // External User Login Id - // - public String getExternalUserLoginId() { - return externalUserLoginId; - } - // - // External User Login Id - // - public void setExternalUserLoginId(String externalUserLoginId) { - this.externalUserLoginId = externalUserLoginId; - } - // - // boolean type value, default is true - // - public Boolean getIsActive() { - return isActive; - } - // - // boolean type value, default is true - // - public void setIsActive(Boolean isActive) { - this.isActive = isActive; - } - // - // id is custom of not - // - public Boolean getIsCustomUid() { - return isCustomUid; - } - // - // id is custom of not - // - public void setIsCustomUid(Boolean isCustomUid) { - this.isCustomUid = isCustomUid; - } - // - // boolean type value, default is true - // - public Boolean getIsDeleted() { - return isDeleted; - } - // - // boolean type value, default is true - // - public void setIsDeleted(Boolean isDeleted) { - this.isDeleted = isDeleted; - } - // - // boolean type value, default is true - // - public Boolean getIsEmailSubscribed() { - return isEmailSubscribed; - } - // - // boolean type value, default is true - // - public void setIsEmailSubscribed(Boolean isEmailSubscribed) { - this.isEmailSubscribed = isEmailSubscribed; - } - // - // Pass true if wants to lock the user's Login field else false. - // - public Boolean getIsLoginLocked() { - return isLoginLocked; - } - // - // Pass true if wants to lock the user's Login field else false. - // - public void setIsLoginLocked(Boolean isLoginLocked) { - this.isLoginLocked = isLoginLocked; - } - // - // Required fields filled once or not - // - public Boolean getIsRequiredFieldsFilledOnce() { - return isRequiredFieldsFilledOnce; - } - // - // Required fields filled once or not - // - public void setIsRequiredFieldsFilledOnce(Boolean isRequiredFieldsFilledOnce) { - this.isRequiredFieldsFilledOnce = isRequiredFieldsFilledOnce; - } - // - // Is secure password or not - // - public Boolean getIsSecurePassword() { - return isSecurePassword; - } - // - // Is secure password or not - // - public void setIsSecurePassword(Boolean isSecurePassword) { - this.isSecurePassword = isSecurePassword; - } - // - // Last login location - // - public String getLastLoginLocation() { - return lastLoginLocation; - } - // - // Last login location - // - public void setLastLoginLocation(String lastLoginLocation) { - this.lastLoginLocation = lastLoginLocation; - } - // - // Last password change date - // - public String getLastPasswordChangeDate() { - return lastPasswordChangeDate; - } - // - // Last password change date - // - public void setLastPasswordChangeDate(String lastPasswordChangeDate) { - this.lastPasswordChangeDate = lastPasswordChangeDate; - } - // - // Last password change token - // - public String getLastPasswordChangeToken() { - return lastPasswordChangeToken; - } - // - // Last password change token - // - public void setLastPasswordChangeToken(String lastPasswordChangeToken) { - this.lastPasswordChangeToken = lastPasswordChangeToken; - } - // - // Type of Lockout - // - public String getLoginLockedType() { - return loginLockedType; - } - // - // Type of Lockout - // - public void setLoginLockedType(String loginLockedType) { - this.loginLockedType = loginLockedType; - } - // - // Number of Logins - // - public Integer getNoOfLogins() { - return noOfLogins; - } - // - // Number of Logins - // - public void setNoOfLogins(Integer noOfLogins) { - this.noOfLogins = noOfLogins; - } - // - // - // - public List getOrganizations() { - return organizations; - } - // - // - // - public void setOrganizations(List organizations) { - this.organizations = organizations; - } - // - // Password for the email - // - public String getPassword() { - return password; - } - // - // Password for the email - // - public void setPassword(String password) { - this.password = password; - } - // - // Date of password expiration - // - public String getPasswordExpirationDate() { - return passwordExpirationDate; - } - // - // Date of password expiration - // - public void setPasswordExpirationDate(String passwordExpirationDate) { - this.passwordExpirationDate = passwordExpirationDate; - } - // - // Phone ID (Unique Phone Number Identifier of the user) - // - public String getPhoneId() { - return phoneId; - } - // - // Phone ID (Unique Phone Number Identifier of the user) - // - public void setPhoneId(String phoneId) { - this.phoneId = phoneId; - } - // - // boolean type value, default is false - // - public Boolean getPhoneIdVerified() { - return phoneIdVerified; - } - // - // boolean type value, default is false - // - public void setPhoneIdVerified(Boolean phoneIdVerified) { - this.phoneIdVerified = phoneIdVerified; - } - // - // PIN of user - // - public PinInformation getPIN() { - return pin; - } - // - // PIN of user - // - public void setPIN(PinInformation pin) { - this.pin = pin; - } - // - // Object type by default false, string represents Version, AcceptSource and datetime represents AcceptDateTime - // - public AcceptedPrivacyPolicy getPrivacyPolicy() { - return privacyPolicy; - } - // - // Object type by default false, string represents Version, AcceptSource and datetime represents AcceptDateTime - // - public void setPrivacyPolicy(AcceptedPrivacyPolicy privacyPolicy) { - this.privacyPolicy = privacyPolicy; - } - // - // User Registartion Data - // - public RegistrationData getRegistrationData() { - return registrationData; - } - // - // User Registartion Data - // - public void setRegistrationData(RegistrationData registrationData) { - this.registrationData = registrationData; - } - // - // Provider with which user registered - // - public String getRegistrationProvider() { - return registrationProvider; - } - // - // Provider with which user registered - // - public void setRegistrationProvider(String registrationProvider) { - this.registrationProvider = registrationProvider; - } - // - // URL of the webproperty from where the user is registered. - // - public String getRegistrationSource() { - return registrationSource; - } - // - // URL of the webproperty from where the user is registered. - // - public void setRegistrationSource(String registrationSource) { - this.registrationSource = registrationSource; - } - // - // - // - public List getRoles() { - return roles; - } - // - // - // - public void setRoles(List roles) { - this.roles = roles; - } - // - // UID, the unified identifier for each user account - // - public String getUid() { - return uid; - } - // - // UID, the unified identifier for each user account - // - public void setUid(String uid) { - this.uid = uid; - } - // - // Unverified Email Address - // - public List getUnverifiedEmail() { - return unverifiedEmail; - } - // - // Unverified Email Address - // - public void setUnverifiedEmail(List unverifiedEmail) { - this.unverifiedEmail = unverifiedEmail; - } - // - // Username of the user - // - public String getUserName() { - return userName; - } - // - // Username of the user - // - public void setUserName(String userName) { - this.userName = userName; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/AcceptedPrivacyPolicy.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/AcceptedPrivacyPolicy.java deleted file mode 100644 index 4566874..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/AcceptedPrivacyPolicy.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete privacy policy data - // - public class AcceptedPrivacyPolicy { - - - @SerializedName("AcceptDateTime") - private String acceptDateTime; - - @SerializedName("AcceptSource") - private String acceptSource; - - @SerializedName("Version") - private String version; - - - - // - // Privacy policy accept date time - // - public String getAcceptDateTime() { - return acceptDateTime; - } - // - // Privacy policy accept date time - // - public void setAcceptDateTime(String acceptDateTime) { - this.acceptDateTime = acceptDateTime; - } - // - // Privacy policy accept source - // - public String getAcceptSource() { - return acceptSource; - } - // - // Privacy policy accept source - // - public void setAcceptSource(String acceptSource) { - this.acceptSource = acceptSource; - } - // - // Privacy policy version - // - public String getVersion() { - return version; - } - // - // Privacy policy version - // - public void setVersion(String version) { - this.version = version; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Address.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Address.java deleted file mode 100644 index 2d353e9..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Address.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Address data - // - public class Address { - - - @SerializedName("Address1") - private String address1; - - @SerializedName("Address2") - private String address2; - - @SerializedName("City") - private String city; - - @SerializedName("Country") - private String country; - - @SerializedName("PostalCode") - private String postalCode; - - @SerializedName("Region") - private String region; - - @SerializedName("State") - private String state; - - @SerializedName("Type") - private String type; - - - - // - // Address field value that needs to be updated - // - public String getAddress1() { - return address1; - } - // - // Address field value that needs to be updated - // - public void setAddress1(String address1) { - this.address1 = address1; - } - // - // Address field value that needs to be updated - // - public String getAddress2() { - return address2; - } - // - // Address field value that needs to be updated - // - public void setAddress2(String address2) { - this.address2 = address2; - } - // - // user's city - // - public String getCity() { - return city; - } - // - // user's city - // - public void setCity(String city) { - this.city = city; - } - // - // Country of the user - // - public String getCountry() { - return country; - } - // - // Country of the user - // - public void setCountry(String country) { - this.country = country; - } - // - // Postal code value that need to be updated - // - public String getPostalCode() { - return postalCode; - } - // - // Postal code value that need to be updated - // - public void setPostalCode(String postalCode) { - this.postalCode = postalCode; - } - // - // Region - // - public String getRegion() { - return region; - } - // - // Region - // - public void setRegion(String region) { - this.region = region; - } - // - // State of the user - // - public String getState() { - return state; - } - // - // State of the user - // - public void setState(String state) { - this.state = state; - } - // - // type of address - // - public String getType() { - return type; - } - // - // type of address - // - public void setType(String type) { - this.type = type; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/AgeRange.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/AgeRange.java deleted file mode 100644 index a6ecb8e..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/AgeRange.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Age data - // - public class AgeRange { - - - @SerializedName("Max") - private Integer max; - - @SerializedName("Min") - private Integer min; - - - - // - // Maximum Value Range - // - public Integer getMax() { - return max; - } - // - // Maximum Value Range - // - public void setMax(Integer max) { - this.max = max; - } - // - // Minimum Value Range - // - public Integer getMin() { - return min; - } - // - // Minimum Value Range - // - public void setMin(Integer min) { - this.min = min; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Awards.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Awards.java deleted file mode 100644 index d4331a1..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Awards.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Awards data - // - public class Awards { - - - @SerializedName("Id") - private String id; - - @SerializedName("Issuer") - private String issuer; - - @SerializedName("Name") - private String name; - - - - // - // Id of the Awards - // - public String getId() { - return id; - } - // - // Id of the Awards - // - public void setId(String id) { - this.id = id; - } - // - // Award issuer details - // - public String getIssuer() { - return issuer; - } - // - // Award issuer details - // - public void setIssuer(String issuer) { - this.issuer = issuer; - } - // - // Award name - // - public String getName() { - return name; - } - // - // Award name - // - public void setName(String name) { - this.name = name; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Badges.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Badges.java deleted file mode 100644 index 64c57f7..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Badges.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Badges data - // - public class Badges { - - - @SerializedName("BadgeId") - private String badgeId; - - @SerializedName("BadgeMessage") - private String badgeMessage; - - @SerializedName("BageId") - private String bageId; - - @SerializedName("BageMessage") - private String bageMessage; - - @SerializedName("Description") - private String description; - - @SerializedName("ImageUrl") - private String imageUrl; - - @SerializedName("Name") - private String name; - - - - // - // Badge ID - // - public String getBadgeId() { - return badgeId; - } - // - // Badge ID - // - public void setBadgeId(String badgeId) { - this.badgeId = badgeId; - } - // - // Badge Message - // - public String getBadgeMessage() { - return badgeMessage; - } - // - // Badge Message - // - public void setBadgeMessage(String badgeMessage) { - this.badgeMessage = badgeMessage; - } - // - // Badge ID - // - public String getBageId() { - return bageId; - } - // - // Badge ID - // - public void setBageId(String bageId) { - this.bageId = bageId; - } - // - // Badge Message - // - public String getBageMessage() { - return bageMessage; - } - // - // Badge Message - // - public void setBageMessage(String bageMessage) { - this.bageMessage = bageMessage; - } - // - // detailed information - // - public String getDescription() { - return description; - } - // - // detailed information - // - public void setDescription(String description) { - this.description = description; - } - // - // image URL should be absolute and has HTTPS domain - // - public String getImageUrl() { - return imageUrl; - } - // - // image URL should be absolute and has HTTPS domain - // - public void setImageUrl(String imageUrl) { - this.imageUrl = imageUrl; - } - // - // Badge Name - // - public String getName() { - return name; - } - // - // Badge Name - // - public void setName(String name) { - this.name = name; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Books.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Books.java deleted file mode 100644 index 912213c..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Books.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Books data - // - public class Books { - - - @SerializedName("Category") - private String category; - - @SerializedName("CreatedDate") - private String createdDate; - - @SerializedName("Id") - private String id; - - @SerializedName("Name") - private String name; - - - - // - // Book category - // - public String getCategory() { - return category; - } - // - // Book category - // - public void setCategory(String category) { - this.category = category; - } - // - // Date of Creation of Profile - // - public String getCreatedDate() { - return createdDate; - } - // - // Date of Creation of Profile - // - public void setCreatedDate(String createdDate) { - this.createdDate = createdDate; - } - // - // Id of book - // - public String getId() { - return id; - } - // - // Id of book - // - public void setId(String id) { - this.id = id; - } - // - // book name - // - public String getName() { - return name; - } - // - // book name - // - public void setName(String name) { - this.name = name; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Certifications.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Certifications.java deleted file mode 100644 index 900603b..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Certifications.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Certifications data - // - public class Certifications { - - - @SerializedName("Authority") - private String authority; - - @SerializedName("EndDate") - private String endDate; - - @SerializedName("Id") - private String id; - - @SerializedName("Name") - private String name; - - @SerializedName("Number") - private String number; - - @SerializedName("StartDate") - private String startDate; - - - - // - // Authority of certifications - // - public String getAuthority() { - return authority; - } - // - // Authority of certifications - // - public void setAuthority(String authority) { - this.authority = authority; - } - // - // Certification end date - // - public String getEndDate() { - return endDate; - } - // - // Certification end date - // - public void setEndDate(String endDate) { - this.endDate = endDate; - } - // - // Certification id - // - public String getId() { - return id; - } - // - // Certification id - // - public void setId(String id) { - this.id = id; - } - // - // Certification name - // - public String getName() { - return name; - } - // - // Certification name - // - public void setName(String name) { - this.name = name; - } - // - // Certification number - // - public String getNumber() { - return number; - } - // - // Certification number - // - public void setNumber(String number) { - this.number = number; - } - // - // Certification start date - // - public String getStartDate() { - return startDate; - } - // - // Certification start date - // - public void setStartDate(String startDate) { - this.startDate = startDate; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Country.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Country.java deleted file mode 100644 index f7ae200..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Country.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Country data - // - public class Country { - - - @SerializedName("Code") - private String code; - - @SerializedName("Name") - private String name; - - - - // - // Country code - // - public String getCode() { - return code; - } - // - // Country code - // - public void setCode(String code) { - this.code = code; - } - // - // Country name - // - public String getName() { - return name; - } - // - // Country name - // - public void setName(String name) { - this.name = name; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Courses.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Courses.java deleted file mode 100644 index 13212a2..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Courses.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Courses data - // - public class Courses { - - - @SerializedName("Id") - private String id; - - @SerializedName("Name") - private String name; - - @SerializedName("Number") - private String number; - - - - // - // Course id - // - public String getId() { - return id; - } - // - // Course id - // - public void setId(String id) { - this.id = id; - } - // - // Course name - // - public String getName() { - return name; - } - // - // Course name - // - public void setName(String name) { - this.name = name; - } - // - // Course number - // - public String getNumber() { - return number; - } - // - // Course number - // - public void setNumber(String number) { - this.number = number; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/CurrentStatus.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/CurrentStatus.java deleted file mode 100644 index 54a1b04..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/CurrentStatus.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete CurrentStatus data - // - public class CurrentStatus { - - - @SerializedName("CreatedDate") - private String createdDate; - - @SerializedName("Id") - private String id; - - @SerializedName("Source") - private String source; - - @SerializedName("Text") - private String text; - - - - // - // Current status created date - // - public String getCreatedDate() { - return createdDate; - } - // - // Current status created date - // - public void setCreatedDate(String createdDate) { - this.createdDate = createdDate; - } - // - // Current status id - // - public String getId() { - return id; - } - // - // Current status id - // - public void setId(String id) { - this.id = id; - } - // - // Current status source - // - public String getSource() { - return source; - } - // - // Current status source - // - public void setSource(String source) { - this.source = source; - } - // - // Current status text - // - public String getText() { - return text; - } - // - // Current status text - // - public void setText(String text) { - this.text = text; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/DataValue.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/DataValue.java deleted file mode 100644 index 30fba74..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/DataValue.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response Model Class containing Definition of Registration Data - // - public class DataValue { - - - @SerializedName("DataSource") - private String dataSource; - - @SerializedName("Value") - private RegistrationDataValueObject value; - - - - // - // Registration Data Source - // - public String getDataSource() { - return dataSource; - } - // - // Registration Data Source - // - public void setDataSource(String dataSource) { - this.dataSource = dataSource; - } - // - // Value of the dropdown member - // - public RegistrationDataValueObject getValue() { - return value; - } - // - // Value of the dropdown member - // - public void setValue(RegistrationDataValueObject value) { - this.value = value; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Education.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Education.java deleted file mode 100644 index 44a229a..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Education.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Education data - // - public class Education { - - - @SerializedName("activities") - private String activities; - - @SerializedName("degree") - private String degree; - - @SerializedName("EndDate") - private String endDate; - - @SerializedName("fieldofstudy") - private String fieldofstudy; - - @SerializedName("notes") - private String notes; - - @SerializedName("School") - private String school; - - @SerializedName("StartDate") - private String startDate; - - @SerializedName("type") - private String type; - - @SerializedName("year") - private String year; - - - - // - // Activities - // - public String getActivities() { - return activities; - } - // - // Activities - // - public void setActivities(String activities) { - this.activities = activities; - } - // - // Degree - // - public String getDegree() { - return degree; - } - // - // Degree - // - public void setDegree(String degree) { - this.degree = degree; - } - // - // Education End Date - // - public String getEndDate() { - return endDate; - } - // - // Education End Date - // - public void setEndDate(String endDate) { - this.endDate = endDate; - } - // - // Fields of study - // - public String getFieldofstudy() { - return fieldofstudy; - } - // - // Fields of study - // - public void setFieldofstudy(String fieldofstudy) { - this.fieldofstudy = fieldofstudy; - } - // - // Notes - // - public String getNotes() { - return notes; - } - // - // Notes - // - public void setNotes(String notes) { - this.notes = notes; - } - // - // School of the user - // - public String getSchool() { - return school; - } - // - // School of the user - // - public void setSchool(String school) { - this.school = school; - } - // - // Start date of Education of user - // - public String getStartDate() { - return startDate; - } - // - // Start date of Education of user - // - public void setStartDate(String startDate) { - this.startDate = startDate; - } - // - // Type - // - public String getType() { - return type; - } - // - // Type - // - public void setType(String type) { - this.type = type; - } - // - // Year of Education - // - public String getYear() { - return year; - } - // - // Year of Education - // - public void setYear(String year) { - this.year = year; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Email.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Email.java deleted file mode 100644 index 5f06b94..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Email.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Email data - // - public class Email { - - - @SerializedName("Type") - private String type; - - @SerializedName("Value") - private String value; - - - - // - // type of email id - // - public String getType() { - return type; - } - // - // type of email id - // - public void setType(String type) { - this.type = type; - } - // - // Email address - // - public String getValue() { - return value; - } - // - // Email address - // - public void setValue(String value) { - this.value = value; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/ExternalIds.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/ExternalIds.java deleted file mode 100644 index 6138d6b..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/ExternalIds.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Externalids data - // - public class ExternalIds { - - - @SerializedName("Source") - private String source; - - @SerializedName("SourceId") - private String sourceId; - - - - // - // ExternalId source - // - public String getSource() { - return source; - } - // - // ExternalId source - // - public void setSource(String source) { - this.source = source; - } - // - // External source id - // - public String getSourceId() { - return sourceId; - } - // - // External source id - // - public void setSourceId(String sourceId) { - this.sourceId = sourceId; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Family.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Family.java deleted file mode 100644 index f8cf745..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Family.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Family data - // - public class Family { - - - @SerializedName("Id") - private String id; - - @SerializedName("Name") - private String name; - - @SerializedName("Relationship") - private String relationship; - - - - // - // Family id - // - public String getId() { - return id; - } - // - // Family id - // - public void setId(String id) { - this.id = id; - } - // - // Family name - // - public String getName() { - return name; - } - // - // Family name - // - public void setName(String name) { - this.name = name; - } - // - // Family relationship - // - public String getRelationship() { - return relationship; - } - // - // Family relationship - // - public void setRelationship(String relationship) { - this.relationship = relationship; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/FavoriteThings.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/FavoriteThings.java deleted file mode 100644 index cc46675..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/FavoriteThings.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Favorite data - // - public class FavoriteThings { - - - @SerializedName("Id") - private String id; - - @SerializedName("Name") - private String name; - - @SerializedName("Type") - private String type; - - - - // - // Id of favorite things - // - public String getId() { - return id; - } - // - // Id of favorite things - // - public void setId(String id) { - this.id = id; - } - // - // Name of favorite things - // - public String getName() { - return name; - } - // - // Name of favorite things - // - public void setName(String name) { - this.name = name; - } - // - // Type of favorite things - // - public String getType() { - return type; - } - // - // Type of favorite things - // - public void setType(String type) { - this.type = type; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Games.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Games.java deleted file mode 100644 index 729ce8e..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Games.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Games data - // - public class Games { - - - @SerializedName("Category") - private String category; - - @SerializedName("CreatedDate") - private String createdDate; - - @SerializedName("Id") - private String id; - - @SerializedName("Name") - private String name; - - - - // - // Category of game - // - public String getCategory() { - return category; - } - // - // Category of game - // - public void setCategory(String category) { - this.category = category; - } - // - // Game created date - // - public String getCreatedDate() { - return createdDate; - } - // - // Game created date - // - public void setCreatedDate(String createdDate) { - this.createdDate = createdDate; - } - // - // Id of game - // - public String getId() { - return id; - } - // - // Id of game - // - public void setId(String id) { - this.id = id; - } - // - // Game name - // - public String getName() { - return name; - } - // - // Game name - // - public void setName(String name) { - this.name = name; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/GitHubPlan.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/GitHubPlan.java deleted file mode 100644 index 87823a0..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/GitHubPlan.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete GitHubPlan data - // - public class GitHubPlan { - - - @SerializedName("Collaborators") - private String collaborators; - - @SerializedName("Name") - private String name; - - @SerializedName("PrivateRepos") - private String privateRepos; - - @SerializedName("Space") - private String space; - - - - // - // Github plan collaborators - // - public String getCollaborators() { - return collaborators; - } - // - // Github plan collaborators - // - public void setCollaborators(String collaborators) { - this.collaborators = collaborators; - } - // - // Github plan name - // - public String getName() { - return name; - } - // - // Github plan name - // - public void setName(String name) { - this.name = name; - } - // - // Private repos of github - // - public String getPrivateRepos() { - return privateRepos; - } - // - // Private repos of github - // - public void setPrivateRepos(String privateRepos) { - this.privateRepos = privateRepos; - } - // - // Github plan space - // - public String getSpace() { - return space; - } - // - // Github plan space - // - public void setSpace(String space) { - this.space = space; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/IMAccount.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/IMAccount.java deleted file mode 100644 index 78c7614..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/IMAccount.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete IMAccount data - // - public class IMAccount { - - - @SerializedName("AccountName") - private String accountName; - - @SerializedName("AccountType") - private String accountType; - - - - // - // Name of account - // - public String getAccountName() { - return accountName; - } - // - // Name of account - // - public void setAccountName(String accountName) { - this.accountName = accountName; - } - // - // Type of account - // - public String getAccountType() { - return accountType; - } - // - // Type of account - // - public void setAccountType(String accountType) { - this.accountType = accountType; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/InspirationalPeople.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/InspirationalPeople.java deleted file mode 100644 index 759ce36..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/InspirationalPeople.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Inspirational People data - // - public class InspirationalPeople { - - - @SerializedName("Id") - private String id; - - @SerializedName("Name") - private String name; - - - - // - // ID of inspirational people - // - public String getId() { - return id; - } - // - // ID of inspirational people - // - public void setId(String id) { - this.id = id; - } - // - // name of inspirational people - // - public String getName() { - return name; - } - // - // name of inspirational people - // - public void setName(String name) { - this.name = name; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Interests.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Interests.java deleted file mode 100644 index 5f8eb32..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Interests.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Interests data - // - public class Interests { - - - @SerializedName("InterestedName") - private String interestedName; - - @SerializedName("InterestedType") - private String interestedType; - - - - // - // Name of interested - // - public String getInterestedName() { - return interestedName; - } - // - // Name of interested - // - public void setInterestedName(String interestedName) { - this.interestedName = interestedName; - } - // - // Type of interested - // - public String getInterestedType() { - return interestedType; - } - // - // Type of interested - // - public void setInterestedType(String interestedType) { - this.interestedType = interestedType; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Job.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Job.java deleted file mode 100644 index e8db882..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Job.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Job data - // - public class Job { - - - @SerializedName("Active") - private Boolean active; - - @SerializedName("Company") - private JobBookmarkCompany company; - - @SerializedName("DescriptionSnippet") - private String descriptionSnippet; - - @SerializedName("Id") - private String id; - - @SerializedName("Position") - private JobBookmarkPosition position; - - @SerializedName("PostingTimestamp") - private String postingTimestamp; - - - - // - // Is active or not - // - public Boolean getActive() { - return active; - } - // - // Is active or not - // - public void setActive(Boolean active) { - this.active = active; - } - // - // Job company - // - public JobBookmarkCompany getCompany() { - return company; - } - // - // Job company - // - public void setCompany(JobBookmarkCompany company) { - this.company = company; - } - // - // Job description - // - public String getDescriptionSnippet() { - return descriptionSnippet; - } - // - // Job description - // - public void setDescriptionSnippet(String descriptionSnippet) { - this.descriptionSnippet = descriptionSnippet; - } - // - // Job id - // - public String getId() { - return id; - } - // - // Job id - // - public void setId(String id) { - this.id = id; - } - // - // Position of job - // - public JobBookmarkPosition getPosition() { - return position; - } - // - // Position of job - // - public void setPosition(JobBookmarkPosition position) { - this.position = position; - } - // - // Job posting timestamp - // - public String getPostingTimestamp() { - return postingTimestamp; - } - // - // Job posting timestamp - // - public void setPostingTimestamp(String postingTimestamp) { - this.postingTimestamp = postingTimestamp; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/JobBookmarkCompany.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/JobBookmarkCompany.java deleted file mode 100644 index 9e64bbe..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/JobBookmarkCompany.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Job Bookmark Company data - // - public class JobBookmarkCompany { - - - @SerializedName("Id") - private String id; - - @SerializedName("Name") - private String name; - - - - // - // Company id - // - public String getId() { - return id; - } - // - // Company id - // - public void setId(String id) { - this.id = id; - } - // - // Company name - // - public String getName() { - return name; - } - // - // Company name - // - public void setName(String name) { - this.name = name; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/JobBookmarkPosition.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/JobBookmarkPosition.java deleted file mode 100644 index 3412d99..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/JobBookmarkPosition.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Job Bookmark Position data - // - public class JobBookmarkPosition { - - - @SerializedName("Title") - private String title; - - - - // - // Position title - // - public String getTitle() { - return title; - } - // - // Position title - // - public void setTitle(String title) { - this.title = title; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/JobBookmarks.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/JobBookmarks.java deleted file mode 100644 index a3e6a6a..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/JobBookmarks.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Job Bookmark data - // - public class JobBookmarks { - - - @SerializedName("ApplyTimestamp") - private String applyTimestamp; - - @SerializedName("IsApplied") - private Boolean isApplied; - - @SerializedName("IsSaved") - private Boolean isSaved; - - @SerializedName("Job") - private Job job; - - @SerializedName("SavedTimestamp") - private String savedTimestamp; - - - - // - // Job Bookmarks Apply Timestamp - // - public String getApplyTimestamp() { - return applyTimestamp; - } - // - // Job Bookmarks Apply Timestamp - // - public void setApplyTimestamp(String applyTimestamp) { - this.applyTimestamp = applyTimestamp; - } - // - // Job bookmark is applied or not - // - public Boolean getIsApplied() { - return isApplied; - } - // - // Job bookmark is applied or not - // - public void setIsApplied(Boolean isApplied) { - this.isApplied = isApplied; - } - // - // Job bookmark is saved or not - // - public Boolean getIsSaved() { - return isSaved; - } - // - // Job bookmark is saved or not - // - public void setIsSaved(Boolean isSaved) { - this.isSaved = isSaved; - } - // - // Job - // - public Job getJob() { - return job; - } - // - // Job - // - public void setJob(Job job) { - this.job = job; - } - // - // Saved time stamp of Job bookmarks - // - public String getSavedTimestamp() { - return savedTimestamp; - } - // - // Saved time stamp of Job bookmarks - // - public void setSavedTimestamp(String savedTimestamp) { - this.savedTimestamp = savedTimestamp; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/KloutProfile.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/KloutProfile.java deleted file mode 100644 index fed999d..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/KloutProfile.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Klout Profile data - // - public class KloutProfile { - - - @SerializedName("KloutId") - private String kloutId; - - @SerializedName("Score") - private Double score; - - - - // - // Id of klout - // - public String getKloutId() { - return kloutId; - } - // - // Id of klout - // - public void setKloutId(String kloutId) { - this.kloutId = kloutId; - } - // - // Object, string represents KloutId and double represents Score - // - public Double getScore() { - return score; - } - // - // Object, string represents KloutId and double represents Score - // - public void setScore(Double score) { - this.score = score; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Languages.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Languages.java deleted file mode 100644 index 5a7f2e2..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Languages.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Languages data - // - public class Languages { - - - @SerializedName("Id") - private String id; - - @SerializedName("Name") - private String name; - - @SerializedName("Proficiency") - private String proficiency; - - - - // - // Language id - // - public String getId() { - return id; - } - // - // Language id - // - public void setId(String id) { - this.id = id; - } - // - // Name of language - // - public String getName() { - return name; - } - // - // Name of language - // - public void setName(String name) { - this.name = name; - } - // - // Proficiency in language - // - public String getProficiency() { - return proficiency; - } - // - // Proficiency in language - // - public void setProficiency(String proficiency) { - this.proficiency = proficiency; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Memberurlresources.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Memberurlresources.java deleted file mode 100644 index a474089..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Memberurlresources.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Member url resources data - // - public class Memberurlresources { - - - @SerializedName("Url") - private String url; - - @SerializedName("UrlName") - private String urlName; - - - - // - // String represents website url - // - public String getUrl() { - return url; - } - // - // String represents website url - // - public void setUrl(String url) { - this.url = url; - } - // - // URL name - // - public String getUrlName() { - return urlName; - } - // - // URL name - // - public void setUrlName(String urlName) { - this.urlName = urlName; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Movies.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Movies.java deleted file mode 100644 index 5827c2c..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Movies.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Movies data - // - public class Movies { - - - @SerializedName("Category") - private String category; - - @SerializedName("CreatedDate") - private String createdDate; - - @SerializedName("Id") - private String id; - - @SerializedName("Name") - private String name; - - - - // - // Category of movie - // - public String getCategory() { - return category; - } - // - // Category of movie - // - public void setCategory(String category) { - this.category = category; - } - // - // Movie created date - // - public String getCreatedDate() { - return createdDate; - } - // - // Movie created date - // - public void setCreatedDate(String createdDate) { - this.createdDate = createdDate; - } - // - // Id of movie - // - public String getId() { - return id; - } - // - // Id of movie - // - public void setId(String id) { - this.id = id; - } - // - // Name of movie - // - public String getName() { - return name; - } - // - // Name of movie - // - public void setName(String name) { - this.name = name; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/MutualFriends.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/MutualFriends.java deleted file mode 100644 index 7124ca1..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/MutualFriends.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete MutualFriends data - // - public class MutualFriends { - - - @SerializedName("Birthday") - private String birthday; - - @SerializedName("FirstName") - private String firstName; - - @SerializedName("Gender") - private String gender; - - @SerializedName("Hometown") - private String hometown; - - @SerializedName("Id") - private String id; - - @SerializedName("LastName") - private String lastName; - - @SerializedName("Link") - private String link; - - @SerializedName("Name") - private String name; - - - - // - // Birthday of mutual friend - // - public String getBirthday() { - return birthday; - } - // - // Birthday of mutual friend - // - public void setBirthday(String birthday) { - this.birthday = birthday; - } - // - // first name of mutual friend - // - public String getFirstName() { - return firstName; - } - // - // first name of mutual friend - // - public void setFirstName(String firstName) { - this.firstName = firstName; - } - // - // Gender of mutual friend - // - public String getGender() { - return gender; - } - // - // Gender of mutual friend - // - public void setGender(String gender) { - this.gender = gender; - } - // - // Hometown of mutual friend - // - public String getHometown() { - return hometown; - } - // - // Hometown of mutual friend - // - public void setHometown(String hometown) { - this.hometown = hometown; - } - // - // Id of mutual friend - // - public String getId() { - return id; - } - // - // Id of mutual friend - // - public void setId(String id) { - this.id = id; - } - // - // Last name of mutual friend - // - public String getLastName() { - return lastName; - } - // - // Last name of mutual friend - // - public void setLastName(String lastName) { - this.lastName = lastName; - } - // - // Link of mutual friend - // - public String getLink() { - return link; - } - // - // Link of mutual friend - // - public void setLink(String link) { - this.link = link; - } - // - // Name of mutual friend - // - public String getName() { - return name; - } - // - // Name of mutual friend - // - public void setName(String name) { - this.name = name; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/NameId.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/NameId.java deleted file mode 100644 index 402ddf8..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/NameId.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete NameId data - // - public class NameId { - - - @SerializedName("Id") - private String id; - - @SerializedName("Name") - private String name; - - - - // - // Id - // - public String getId() { - return id; - } - // - // Id - // - public void setId(String id) { - this.id = id; - } - // - // Name - // - public String getName() { - return name; - } - // - // Name - // - public void setName(String name) { - this.name = name; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/OrganizationResponseInProfile.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/OrganizationResponseInProfile.java deleted file mode 100644 index b4ac09c..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/OrganizationResponseInProfile.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for OrganizationResponseInProfile - // - public class OrganizationResponseInProfile { - - - @SerializedName("Id") - private String id; - - - - // - // ID of the User - // - public String getId() { - return id; - } - // - // ID of the User - // - public void setId(String id) { - this.id = id; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Patents.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Patents.java deleted file mode 100644 index 8299df7..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Patents.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Patents data - // - public class Patents { - - - @SerializedName("Date") - private String date; - - @SerializedName("Id") - private String id; - - @SerializedName("Title") - private String title; - - - - // - // Date of patents - // - public String getDate() { - return date; - } - // - // Date of patents - // - public void setDate(String date) { - this.date = date; - } - // - // Id of the patents - // - public String getId() { - return id; - } - // - // Id of the patents - // - public void setId(String id) { - this.id = id; - } - // - // Title of the patents - // - public String getTitle() { - return title; - } - // - // Title of the patents - // - public void setTitle(String title) { - this.title = title; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Phone.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Phone.java deleted file mode 100644 index de1a86d..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Phone.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Phone data - // - public class Phone { - - - @SerializedName("PhoneNumber") - private String phoneNumber; - - @SerializedName("PhoneType") - private String phoneType; - - - - // - // Phone number - // - public String getPhoneNumber() { - return phoneNumber; - } - // - // Phone number - // - public void setPhoneNumber(String phoneNumber) { - this.phoneNumber = phoneNumber; - } - // - // Phone type - // - public String getPhoneType() { - return phoneType; - } - // - // Phone type - // - public void setPhoneType(String phoneType) { - this.phoneType = phoneType; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/PlacesLived.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/PlacesLived.java deleted file mode 100644 index beb2ea1..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/PlacesLived.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete PlacesLived data - // - public class PlacesLived { - - - @SerializedName("IsPrimary") - private Boolean isPrimary; - - @SerializedName("Name") - private String name; - - - - // - // place is primary or not - // - public Boolean getIsPrimary() { - return isPrimary; - } - // - // place is primary or not - // - public void setIsPrimary(Boolean isPrimary) { - this.isPrimary = isPrimary; - } - // - // Name of lived place - // - public String getName() { - return name; - } - // - // Name of lived place - // - public void setName(String name) { - this.name = name; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/PositionCompany.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/PositionCompany.java deleted file mode 100644 index 49e9bba..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/PositionCompany.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Position Company data - // - public class PositionCompany { - - - @SerializedName("Industry") - private String industry; - - @SerializedName("Name") - private String name; - - @SerializedName("Type") - private String type; - - - - // - // position company industry - // - public String getIndustry() { - return industry; - } - // - // position company industry - // - public void setIndustry(String industry) { - this.industry = industry; - } - // - // position company name - // - public String getName() { - return name; - } - // - // position company name - // - public void setName(String name) { - this.name = name; - } - // - // position company type - // - public String getType() { - return type; - } - // - // position company type - // - public void setType(String type) { - this.type = type; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/ProfessionalPosition.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/ProfessionalPosition.java deleted file mode 100644 index a6475a2..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/ProfessionalPosition.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Professional Position data - // - public class ProfessionalPosition { - - - @SerializedName("Company") - private PositionCompany company; - - @SerializedName("EndDate") - private String endDate; - - @SerializedName("IsCurrent") - private String isCurrent; - - @SerializedName("Location") - private String location; - - @SerializedName("Position") - private String position; - - @SerializedName("StartDate") - private String startDate; - - @SerializedName("Summary") - private String summary; - - - - // - // Company of the professional position - // - public PositionCompany getCompany() { - return company; - } - // - // Company of the professional position - // - public void setCompany(PositionCompany company) { - this.company = company; - } - // - // End date of the professional position - // - public String getEndDate() { - return endDate; - } - // - // End date of the professional position - // - public void setEndDate(String endDate) { - this.endDate = endDate; - } - // - // Is current or not - // - public String getIsCurrent() { - return isCurrent; - } - // - // Is current or not - // - public void setIsCurrent(String isCurrent) { - this.isCurrent = isCurrent; - } - // - // Location of the professional position - // - public String getLocation() { - return location; - } - // - // Location of the professional position - // - public void setLocation(String location) { - this.location = location; - } - // - // Position - // - public String getPosition() { - return position; - } - // - // Position - // - public void setPosition(String position) { - this.position = position; - } - // - // Start date of the professional position - // - public String getStartDate() { - return startDate; - } - // - // Start date of the professional position - // - public void setStartDate(String startDate) { - this.startDate = startDate; - } - // - // Summary of the professional position - // - public String getSummary() { - return summary; - } - // - // Summary of the professional position - // - public void setSummary(String summary) { - this.summary = summary; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Projects.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Projects.java deleted file mode 100644 index bffd060..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Projects.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Projects data - // - public class Projects { - - - @SerializedName("EndDate") - private String endDate; - - @SerializedName("Id") - private String id; - - @SerializedName("IsCurrent") - private String isCurrent; - - @SerializedName("Name") - private String name; - - @SerializedName("StartDate") - private String startDate; - - @SerializedName("Summary") - private String summary; - - @SerializedName("With") - private List with; - - - - // - // End date of the project - // - public String getEndDate() { - return endDate; - } - // - // End date of the project - // - public void setEndDate(String endDate) { - this.endDate = endDate; - } - // - // Id of the project - // - public String getId() { - return id; - } - // - // Id of the project - // - public void setId(String id) { - this.id = id; - } - // - // is current or not - // - public String getIsCurrent() { - return isCurrent; - } - // - // is current or not - // - public void setIsCurrent(String isCurrent) { - this.isCurrent = isCurrent; - } - // - // Name of the project - // - public String getName() { - return name; - } - // - // Name of the project - // - public void setName(String name) { - this.name = name; - } - // - // Start date of the project - // - public String getStartDate() { - return startDate; - } - // - // Start date of the project - // - public void setStartDate(String startDate) { - this.startDate = startDate; - } - // - // Summary of the project - // - public String getSummary() { - return summary; - } - // - // Summary of the project - // - public void setSummary(String summary) { - this.summary = summary; - } - // - // Projects done with - // - public List getWith() { - return with; - } - // - // Projects done with - // - public void setWith(List with) { - this.with = with; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/ProviderAccessCredential.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/ProviderAccessCredential.java deleted file mode 100644 index 2f309e5..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/ProviderAccessCredential.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Provider Access Credential data - // - public class ProviderAccessCredential { - - - @SerializedName("AccessToken") - private String accessToken; - - @SerializedName("TokenSecret") - private String tokenSecret; - - - - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // - public String getAccessToken() { - return accessToken; - } - // - // Uniquely generated identifier key by LoginRadius that is activated after successful authentication. - // - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - // - // secret token of the provider - // - public String getTokenSecret() { - return tokenSecret; - } - // - // secret token of the provider - // - public void setTokenSecret(String tokenSecret) { - this.tokenSecret = tokenSecret; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Publications.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Publications.java deleted file mode 100644 index 3af7989..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Publications.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Publications data - // - public class Publications { - - - @SerializedName("Authors") - private List authors; - - @SerializedName("Date") - private String date; - - @SerializedName("Id") - private String id; - - @SerializedName("Publisher") - private String publisher; - - @SerializedName("Summary") - private String summary; - - @SerializedName("Title") - private String title; - - @SerializedName("Url") - private String url; - - - - // - // Author of the publication - // - public List getAuthors() { - return authors; - } - // - // Author of the publication - // - public void setAuthors(List authors) { - this.authors = authors; - } - // - // Date of the publication - // - public String getDate() { - return date; - } - // - // Date of the publication - // - public void setDate(String date) { - this.date = date; - } - // - // Id of the Publication - // - public String getId() { - return id; - } - // - // Id of the Publication - // - public void setId(String id) { - this.id = id; - } - // - // Publisher of the Publication - // - public String getPublisher() { - return publisher; - } - // - // Publisher of the Publication - // - public void setPublisher(String publisher) { - this.publisher = publisher; - } - // - // Summary of the publication - // - public String getSummary() { - return summary; - } - // - // Summary of the publication - // - public void setSummary(String summary) { - this.summary = summary; - } - // - // Title of the publication - // - public String getTitle() { - return title; - } - // - // Title of the publication - // - public void setTitle(String title) { - this.title = title; - } - // - // Publication url - // - public String getUrl() { - return url; - } - // - // Publication url - // - public void setUrl(String url) { - this.url = url; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/PublicationsAuthors.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/PublicationsAuthors.java deleted file mode 100644 index f0a2042..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/PublicationsAuthors.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Publications Authors data - // - public class PublicationsAuthors { - - - @SerializedName("Id") - private String id; - - @SerializedName("Name") - private String name; - - - - // - // Author id of the publication - // - public String getId() { - return id; - } - // - // Author id of the publication - // - public void setId(String id) { - this.id = id; - } - // - // Author name - // - public String getName() { - return name; - } - // - // Author name - // - public void setName(String name) { - this.name = name; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/RecommendationsReceived.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/RecommendationsReceived.java deleted file mode 100644 index f867f8c..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/RecommendationsReceived.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Recommendations Received data - // - public class RecommendationsReceived { - - - @SerializedName("Id") - private String id; - - @SerializedName("RecommendationText") - private String recommendationText; - - @SerializedName("RecommendationType") - private String recommendationType; - - @SerializedName("Recommender") - private String recommender; - - - - // - // Recommendation id - // - public String getId() { - return id; - } - // - // Recommendation id - // - public void setId(String id) { - this.id = id; - } - // - // Recommendation text - // - public String getRecommendationText() { - return recommendationText; - } - // - // Recommendation text - // - public void setRecommendationText(String recommendationText) { - this.recommendationText = recommendationText; - } - // - // Recommendation type - // - public String getRecommendationType() { - return recommendationType; - } - // - // Recommendation type - // - public void setRecommendationType(String recommendationType) { - this.recommendationType = recommendationType; - } - // - // Recommender - // - public String getRecommender() { - return recommender; - } - // - // Recommender - // - public void setRecommender(String recommender) { - this.recommender = recommender; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/RegistrationData.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/RegistrationData.java deleted file mode 100644 index 9661afa..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/RegistrationData.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Registration Data - // - public class RegistrationData { - - - @SerializedName("Data") - private List data; - - - - // - // Data - // - public List getData() { - return data; - } - // - // Data - // - public void setData(List data) { - this.data = data; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/RegistrationDataValueObject.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/RegistrationDataValueObject.java deleted file mode 100644 index 51a768d..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/RegistrationDataValueObject.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Registration Data value - // - public class RegistrationDataValueObject { - - - @SerializedName("Id") - private String id; - - - - // - // ID of the User - // - public String getId() { - return id; - } - // - // ID of the User - // - public void setId(String id) { - this.id = id; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/RelatedProfileViews.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/RelatedProfileViews.java deleted file mode 100644 index 9a6fbd5..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/RelatedProfileViews.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Related profileviews data - // - public class RelatedProfileViews { - - - @SerializedName("FirstName") - private String firstName; - - @SerializedName("Id") - private String id; - - @SerializedName("LastName") - private String lastName; - - - - // - // user's first name - // - public String getFirstName() { - return firstName; - } - // - // user's first name - // - public void setFirstName(String firstName) { - this.firstName = firstName; - } - // - // Id of profile view - // - public String getId() { - return id; - } - // - // Id of profile view - // - public void setId(String id) { - this.id = id; - } - // - // user's last name - // - public String getLastName() { - return lastName; - } - // - // user's last name - // - public void setLastName(String lastName) { - this.lastName = lastName; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/RoleContext.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/RoleContext.java deleted file mode 100644 index 52b1e69..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/RoleContext.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete RoleContext data - // - public class RoleContext { - - - @SerializedName("AdditionalPermissions") - private List additionalPermissions; - - @SerializedName("Context") - private String context; - - @SerializedName("Expiration") - private String expiration; - - @SerializedName("Roles") - private List roles; - - - - // - // Array of String, which represents the additional permissions - // - public List getAdditionalPermissions() { - return additionalPermissions; - } - // - // Array of String, which represents the additional permissions - // - public void setAdditionalPermissions(List additionalPermissions) { - this.additionalPermissions = additionalPermissions; - } - // - // Array of RoleContext object, see body tab for structure - // - public String getContext() { - return context; - } - // - // Array of RoleContext object, see body tab for structure - // - public void setContext(String context) { - this.context = context; - } - // - // Role expiration date - // - public String getExpiration() { - return expiration; - } - // - // Role expiration date - // - public void setExpiration(String expiration) { - this.expiration = expiration; - } - // - // Array of String, which represents the role name - // - public List getRoles() { - return roles; - } - // - // Array of String, which represents the role name - // - public void setRoles(List roles) { - this.roles = roles; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Skills.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Skills.java deleted file mode 100644 index 11ecf68..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Skills.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Skills data - // - public class Skills { - - - @SerializedName("Id") - private String id; - - @SerializedName("Name") - private String name; - - - - // - // id of skill - // - public String getId() { - return id; - } - // - // id of skill - // - public void setId(String id) { - this.id = id; - } - // - // name of skills - // - public String getName() { - return name; - } - // - // name of skills - // - public void setName(String name) { - this.name = name; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Sports.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Sports.java deleted file mode 100644 index 1652d44..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Sports.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Sports data - // - public class Sports { - - - @SerializedName("Id") - private String id; - - @SerializedName("Name") - private String name; - - - - // - // Id of sport - // - public String getId() { - return id; - } - // - // Id of sport - // - public void setId(String id) { - this.id = id; - } - // - // Name of sport - // - public String getName() { - return name; - } - // - // Name of sport - // - public void setName(String name) { - this.name = name; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Suggestions.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Suggestions.java deleted file mode 100644 index bc143ad..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Suggestions.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import java.util.List; - -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Suggestions data - // - public class Suggestions { - - - @SerializedName("CompaniestoFollow") - private List companiestoFollow; - - @SerializedName("IndustriestoFollow") - private List industriestoFollow; - - @SerializedName("NewssourcetoFollow") - private List newssourcetoFollow; - - @SerializedName("PeopletoFollow") - private List peopletoFollow; - - - - // - // Companies needs to follow - // - public List getCompaniestoFollow() { - return companiestoFollow; - } - // - // Companies needs to follow - // - public void setCompaniestoFollow(List companiestoFollow) { - this.companiestoFollow = companiestoFollow; - } - // - // Industries needs to follow - // - public List getIndustriestoFollow() { - return industriestoFollow; - } - // - // Industries needs to follow - // - public void setIndustriestoFollow(List industriestoFollow) { - this.industriestoFollow = industriestoFollow; - } - // - // News sources needs to follow - // - public List getNewssourcetoFollow() { - return newssourcetoFollow; - } - // - // News sources needs to follow - // - public void setNewssourcetoFollow(List newssourcetoFollow) { - this.newssourcetoFollow = newssourcetoFollow; - } - // - // People needs to follow - // - public List getPeopletoFollow() { - return peopletoFollow; - } - // - // People needs to follow - // - public void setPeopletoFollow(List peopletoFollow) { - this.peopletoFollow = peopletoFollow; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Television.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Television.java deleted file mode 100644 index 4a45835..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Television.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Television data - // - public class Television { - - - @SerializedName("Category") - private String category; - - @SerializedName("CreatedDate") - private String createdDate; - - @SerializedName("Id") - private String id; - - @SerializedName("Name") - private String name; - - - - // - // Television category - // - public String getCategory() { - return category; - } - // - // Television category - // - public void setCategory(String category) { - this.category = category; - } - // - // Date - // - public String getCreatedDate() { - return createdDate; - } - // - // Date - // - public void setCreatedDate(String createdDate) { - this.createdDate = createdDate; - } - // - // Id of television - // - public String getId() { - return id; - } - // - // Id of television - // - public void setId(String id) { - this.id = id; - } - // - // Name of volunteer - // - public String getName() { - return name; - } - // - // Name of volunteer - // - public void setName(String name) { - this.name = name; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Volunteer.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Volunteer.java deleted file mode 100644 index 1397214..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/models/responsemodels/userprofile/objects/Volunteer.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -package com.loginradius.sdk.models.responsemodels.userprofile.objects; -import com.google.gson.annotations.SerializedName; - - // - // Response containing Definition for Complete Volunteer data - // - public class Volunteer { - - - @SerializedName("Cause") - private String cause; - - @SerializedName("Id") - private String id; - - @SerializedName("Organization") - private String organization; - - @SerializedName("Role") - private String role; - - - - // - // Cause of volunteer - // - public String getCause() { - return cause; - } - // - // Cause of volunteer - // - public void setCause(String cause) { - this.cause = cause; - } - // - // Volunteer Id - // - public String getId() { - return id; - } - // - // Volunteer Id - // - public void setId(String id) { - this.id = id; - } - // - // name - // - public String getOrganization() { - return organization; - } - // - // name - // - public void setOrganization(String organization) { - this.organization = organization; - } - // - // Name of role - // - public String getRole() { - return role; - } - // - // Name of role - // - public void setRole(String role) { - this.role = role; - } - } \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/util/AsyncHandler.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/util/AsyncHandler.java deleted file mode 100644 index f9fc8a3..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/util/AsyncHandler.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.loginradius.sdk.util; - -public interface AsyncHandler { - - public void onSuccess(T data); - - public void onFailure(ErrorResponse errorcode); - -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/util/ErrorResponse.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/util/ErrorResponse.java deleted file mode 100644 index c4d8c25..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/util/ErrorResponse.java +++ /dev/null @@ -1,160 +0,0 @@ -package com.loginradius.sdk.util; - -import java.util.List; - -public class ErrorResponse { - private String description; - - private String message; - - private Boolean isProviderError; - - private Object providerErrorResponse; - - private Integer errorCode; - - private String Description; - - private String Message; - - private Boolean IsProviderError; - - private Object ProviderErrorResponse; - - private Integer ErrorCode; - - private List ExtraInfo = null; - - private List Errors = null; - - private Object Data; - - /** - * - * @return The description - */ - public String getDescription() { - return description == null ? Description : description; - } - - /** - * - * @param description The Description - */ - public void setDescription(final String description) { - this.description = description; - } - - /** - * - * @return The message - */ - public String getMessage() { - return message == null ? Message : message; - } - - /** - * - * @param message The Message - */ - public void setMessage(final String message) { - this.message = message; - } - - /** - * - * @return The isProviderError - */ - public Boolean getIsProviderError() { - return isProviderError == null ? IsProviderError : isProviderError; - } - - /** - * - * @param isProviderError The IsProviderError - */ - public void setIsProviderError(final Boolean isProviderError) { - this.isProviderError = isProviderError; - } - - /** - * - * @return The providerErrorResponse - */ - public Object getProviderErrorResponse() { - return providerErrorResponse == null ? ProviderErrorResponse : providerErrorResponse; - } - - /** - * - * @param providerErrorResponse The ProviderErrorResponse - */ - public void setProviderErrorResponse(final Object providerErrorResponse) { - this.providerErrorResponse = providerErrorResponse; - } - - /** - * - * @return The errorCode - */ - public Integer getErrorCode() { - return errorCode == null ? ErrorCode : errorCode; - } - - /** - * - * @param errorCode The ErrorCode - */ - public void setErrorCode(final Integer errorCode) { - this.errorCode = errorCode; - } - - /** - * - * @return The ExtraInfo - */ - public List getExtraInfo() { - return ExtraInfo; - } - - /** - * - * @param ExtraInfo The ExtraInfo - */ - public void setExtraInfo(final List ExtraInfo) { - this.ExtraInfo = ExtraInfo; - } - - /** - * - * @return The Errors - */ - public List getErrors() { - return Errors; - } - - /** - * - * @param Errors The Errors - */ - public void setErrors(final List Errors) { - this.Errors = Errors; - } - - /** - * - * @return The Data - */ - public Object getData() { - return Data; - } - - /** - * - * @param Data The Data - */ - - public void setData(Object Data) { - this.Data = Data; - } -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/util/ExtraInfo.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/util/ExtraInfo.java deleted file mode 100644 index d1cbbd4..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/util/ExtraInfo.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.loginradius.sdk.util; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - -public class ExtraInfo { - @SerializedName("Description") - @Expose - private String description; - @SerializedName("ErrorCode") - @Expose - private Integer errorCode; - @SerializedName("Message") - @Expose - private String message; - - public String getDescription() { - return description; - } - - public void setDescription(final String description) { - this.description = description; - } - - public Integer getErrorCode() { - return errorCode; - } - - public void setErrorCode(final Integer errorCode) { - this.errorCode = errorCode; - } - - public String getMessage() { - return message; - } - - public void setMessage(final String message) { - this.message = message; - } - -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/util/LoginRadiusSDK.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/util/LoginRadiusSDK.java deleted file mode 100644 index d22667a..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/util/LoginRadiusSDK.java +++ /dev/null @@ -1,245 +0,0 @@ -package com.loginradius.sdk.util; - -import java.util.Map; -import java.util.TreeMap; - - -public class LoginRadiusSDK { - private LoginRadiusSDK() { - } - - private static String LOGINRADIUS_API_ROOT = "https://api.loginradius.com"; - private static String LOGINRADIUS_API_CONFIG_ROOT = "https://config.lrcontent.com"; - private static String LOGINRADIUS_API_CLOUD_ROOT = "https://cloud-api.loginradius.com"; - - public static class Initialize { - - private static String apiKey; - private static String apiSecret; - private static Boolean apiRequestSigning = false; - private static String apiRegion; - private static String originIp; - private static String proxyHost; - private static String proxyPort; - private static String proxyUserName; - private static String proxyPassword; - private static Integer connectionTimeout; - private static Integer readTimeout; - public static void setApiKey(final String apiKey) { - Initialize.apiKey = apiKey; - } - - public static void setApiSecret(final String apiSecret) { - Initialize.apiSecret = apiSecret; - } - - public static void setRequestSigning(final Boolean apiRequestSigning) { - Initialize.apiRequestSigning = apiRequestSigning; - } - - public static void setCustomDomain(final String domain) { - LOGINRADIUS_API_ROOT = domain; - } - - public static void setApiRegion(final String apiRegion) { - Initialize.apiRegion = apiRegion; - } - public static void setOriginIp(final String originIp) { - Initialize.originIp = originIp; - } - public static void setProxyHost(final String proxyHost) { - Initialize.proxyHost = proxyHost; - } - public static void setProxyPort(final String proxyPort) { - Initialize.proxyPort = proxyPort; - } - public static void setProxyUserName(final String proxyUserName) { - Initialize.proxyUserName = proxyUserName; - } - public static void setProxyPassword(final String proxyPassword) { - Initialize.proxyPassword = proxyPassword; - } - public static void setConnectionTimeout(final Integer connectionTimeout) { - Initialize.connectionTimeout = connectionTimeout; - } - public static void setReadTimeout(final Integer readTimeout) { - Initialize.readTimeout = readTimeout; - } - - } - - public static String getApiKey() { - return Initialize.apiKey; - } - - public static String getApiSecret() { - return Initialize.apiSecret; - } - - public static Boolean getRequestSigning() { - return Initialize.apiRequestSigning; - } - - public static String getDomain() { - return LOGINRADIUS_API_ROOT; - } - public static String getCloudDomain() { - return LOGINRADIUS_API_CLOUD_ROOT; - } - public static String getConfigDomain() { - return LOGINRADIUS_API_CONFIG_ROOT; - } - - public static String getApiRegion() { - return Initialize.apiRegion; - } - public static String getOriginIp() { - return Initialize.originIp; - } - public static String getProxyHost() { - return Initialize.proxyHost; - } - public static String getProxyPort() { - return Initialize.proxyPort; - } - public static String getProxyUserName() { - return Initialize.proxyUserName; - } - public static String getProxyPassword() { - return Initialize.proxyPassword; - } - public static Integer getConnectionTimeout() { - return Initialize.connectionTimeout; - } - public static Integer getReadTimeout() { - return Initialize.readTimeout; - } - - - - public static boolean validate() { - return Initialize.apiKey == null || Initialize.apiKey.length() == 0 || Initialize.apiSecret == null - || Initialize.apiSecret.length() == 0 ? false : true; - } - - @SuppressWarnings("serial") - public static class InitializeException extends RuntimeException { - public InitializeException() { - super("LoginRadius SDK not initialized properly"); - } - } - - /** - * Creates url after appending loginradius api root url and query parameters - * - * @param url url for appending to the api url - * @param queryArgs extra parameters for sending with url - * @return complete url for fetching data - */ - public static String getRequestUrl(String url, final Map queryArgs) { - String keyvalueString = ""; - if (queryArgs != null && !queryArgs.isEmpty()) { - keyvalueString = createKeyValueString(queryArgs); - } - return url.contains("?") ? url + "&" + keyvalueString : url + "?" + keyvalueString; - } - - /** - * Creates key-value string - * - * @param queryArgs parameters that will attach to the url - * @return query string with the given parameters - */ - public static String createKeyValueString(final Map queryArgs) { - String[] sb = new String[queryArgs.size()]; - int i = 0; - for (Map.Entry entry : queryArgs.entrySet()) { - sb[i] = entry.getKey() + "=" + entry.getValue(); - i++; - } - return combine(sb, "&"); - } - - /** - * Combine to create key-value string - * - * @param s Array String where the glue will be appended - * @param glue String to be appended with Array String - * @return appended String - */ - public static String combine(String[] s, final String glue) { - int k = s.length; - StringBuilder out = new StringBuilder(); - out.append(s[0]); - for (int x = 1; x < k; ++x) - out.append(glue).append(s[x]); - return out.toString(); - } - - /** - * Replaces placeholders in path String if necessary - * - * @param path path for endpoint - * @param map input parameter map - * @return String with placeholders replaced (if necessary) - */ - public static String getFinalPath(String path, final Map map) { - String finalPath = path; - Map data = new TreeMap(String.CASE_INSENSITIVE_ORDER); - if (map != null && !map.isEmpty()) { - data.putAll(map); - } - if (isPlaceholders(path)) { - finalPath = replacePlaceholders(path, data); - } - return finalPath; - } - - /** - * Checks whether a path contains a placeholder in the form {{...}} - * - * @param path path to check - * @return true if contains placeholder, otherwise false - */ - private static Boolean isPlaceholders(final String path) { - return path.contains("{{") && path.contains("}}"); - } - - /** - * Replaces placeholders in the form {{...}} with the corresponding field. - * ensures map values with {{ | }} will not effect the result - * - * @param path path containing placeholders - * @param data map containing field value (pass treemap for map with - * case-insensitive keys) - * @return string with placeholders replaced - */ - private static String replacePlaceholders(String path, final Map data) { - String res = path; - String[] arr = res.split("/"); - for (int i = 0; i < arr.length; i++) { - if (isPlaceholders(arr[i])) { - String field = arr[i].substring(arr[i].indexOf("{{") + 2, arr[i].indexOf("}}")); - arr[i] = data.get(field); - } - } - return join(arr); - } - - /** - * Join array of strings with delimitor "/" - * - * @param arr - * @return string - */ - private static String join(final String[] arr) { - String res = ""; - for (int i = 0; i < arr.length; i++) { - res += arr[i]; - if (i != arr.length - 1) { - res += "/"; - } - } - return res; - } -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/util/RandomStringUUID.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/util/RandomStringUUID.java deleted file mode 100644 index 63d1aab..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/util/RandomStringUUID.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.loginradius.sdk.util; - -/* - * - * Created by LoginRadius Development Team on 02/06/2017 - Copyright 2025 LoginRadius Inc. All rights reserved. - - */ - -import java.util.UUID; - -public class RandomStringUUID { - public static String getGuuid() { - // - // Creating a random UUID (Universally unique identifier). - // - UUID uuid = UUID.randomUUID(); - String randomUUIDString = uuid.toString(); - - return randomUUIDString; - } -} diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/util/Sott.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/util/Sott.java deleted file mode 100644 index fe17ae8..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/util/Sott.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * - * Created by LoginRadius Development Team - Copyright 2025 LoginRadius Inc. All rights reserved. -*/ - -package com.loginradius.sdk.util; - -import java.io.UnsupportedEncodingException; -import java.nio.charset.StandardCharsets; -import java.security.InvalidAlgorithmParameterException; -import java.security.InvalidKeyException; -import java.security.Key; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.security.spec.AlgorithmParameterSpec; -import java.security.spec.InvalidKeySpecException; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.Base64; -import java.util.Calendar; -import java.util.Locale; -import java.util.TimeZone; - -import javax.crypto.BadPaddingException; -import javax.crypto.Cipher; -import javax.crypto.IllegalBlockSizeException; -import javax.crypto.NoSuchPaddingException; -import javax.crypto.SecretKeyFactory; -import javax.crypto.spec.IvParameterSpec; -import javax.crypto.spec.PBEKeySpec; -import javax.crypto.spec.SecretKeySpec; - -import com.loginradius.sdk.api.advanced.ConfigurationApi; -import com.loginradius.sdk.helper.LoginRadiusValidator; -import com.loginradius.sdk.models.responsemodels.otherobjects.ServiceInfoModel; - -public class Sott { - - private static String initVector = "tu89geji340t89u2"; - private static String plaintext=""; - // - // Generate SOTT Manually. - // - // ServiceInfoModel Model Class containing Definition of payload for SOTT - // LoginRadius Api Key. - // LoginRadius Api Secret. - // If true it will call LoginRadius Get Server Time Api and fetch basic server information and server time information which is useful when generating an SOTT token.. - // Sott data - - public static String getSott(ServiceInfoModel service,String apiKey,String apiSecret,boolean getLrServerTime) throws java.lang.Exception { - String secret = !LoginRadiusValidator.isNullOrWhiteSpace(apiSecret)? apiSecret:LoginRadiusSDK.getApiSecret(); - String key = !LoginRadiusValidator.isNullOrWhiteSpace(apiKey)? apiKey:LoginRadiusSDK.getApiKey(); - String token = null; - String timeDifference =(service!=null && !LoginRadiusValidator.isNullOrWhiteSpace(service.getSott().getTimeDifference())) ?service.getSott().getTimeDifference():"10"; - - if (service != null && !LoginRadiusValidator.isNullOrWhiteSpace(service.getSott().getStartTime()) && !LoginRadiusValidator.isNullOrWhiteSpace(service.getSott().getEndTime()) ) { - plaintext = service.getSott().getStartTime() + "#" + key + "#" + service.getSott().getEndTime(); - } - - if(getLrServerTime) { - ConfigurationApi config = new ConfigurationApi(); - config.getServerInfo(Integer.parseInt(timeDifference), new AsyncHandler < ServiceInfoModel > () { - - @Override - public void onFailure(ErrorResponse errorResponse) {} - - @Override - public void onSuccess(ServiceInfoModel service) { - - if(service!=null && !LoginRadiusValidator.isNullOrWhiteSpace( service.getSott().getStartTime()) && !LoginRadiusValidator.isNullOrWhiteSpace( service.getSott().getEndTime()) ) { - plaintext = service.getSott().getStartTime() + "#" + key + "#" + service.getSott().getEndTime(); - } - - } - - }); - } - - if(plaintext.isEmpty()) { - TimeZone timeZone = TimeZone.getTimeZone("UTC"); - Calendar calendar = Calendar.getInstance(timeZone); - DateFormat dateFormat = new SimpleDateFormat("yyyy/M/d H:m:s", Locale.US); - dateFormat.setTimeZone(timeZone); - plaintext = dateFormat.format(calendar.getTime()) + "#" + key + "#"; - calendar.add(Calendar.MINUTE, Integer.parseInt(timeDifference)); - plaintext += dateFormat.format(calendar.getTime()); - } - token = encrypt(plaintext, secret); - - String finalToken = token + "*" + createMd5(token); - return finalToken; - } - - - // - // Generate SOTT Manually. - // - // ServiceInfoModel Model Class containing Definition of payload for SOTT - // LoginRadius Api Key. - // LoginRadius Api Secret. - // Sott data - @Deprecated - public static String getSott(ServiceInfoModel service,String apiKey,String apiSecret) throws java.lang.Exception { - String secret = !LoginRadiusValidator.isNullOrWhiteSpace(apiSecret)? apiSecret:LoginRadiusSDK.getApiSecret(); - String key = !LoginRadiusValidator.isNullOrWhiteSpace(apiKey)? apiKey:LoginRadiusSDK.getApiKey(); - String token = null; - - if (service != null && !LoginRadiusValidator.isNullOrWhiteSpace(service.getSott().getStartTime()) && !LoginRadiusValidator.isNullOrWhiteSpace(service.getSott().getEndTime()) ) { - String plaintext = service.getSott().getStartTime() + "#" + key + "#" + service.getSott().getEndTime(); - token = encrypt(plaintext, secret); - } else { - - String timeDifference =(service!=null && !LoginRadiusValidator.isNullOrWhiteSpace(service.getSott().getTimeDifference())) ?service.getSott().getTimeDifference():"10"; - TimeZone timeZone = TimeZone.getTimeZone("UTC"); - Calendar calendar = Calendar.getInstance(timeZone); - DateFormat dateFormat = new SimpleDateFormat("yyyy/M/d H:m:s", Locale.US); - dateFormat.setTimeZone(timeZone); - String plaintext = dateFormat.format(calendar.getTime()) + "#" + key + "#"; - calendar.add(Calendar.MINUTE, Integer.parseInt(timeDifference)); - plaintext += dateFormat.format(calendar.getTime()); - token = encrypt(plaintext, secret); - - } - - String finalToken = token + "*" + createMd5(token); - return finalToken; - } - - private static String encrypt(final String plaintext, final String passPhrase) throws NoSuchAlgorithmException, - InvalidKeySpecException, UnsupportedEncodingException, NoSuchPaddingException, InvalidKeyException, - InvalidAlgorithmParameterException, IllegalBlockSizeException, BadPaddingException { - int iterations = 10000; - int keysize = 256; - char[] chars = passPhrase.toCharArray(); - - byte[] salt = new byte[8]; - - PBEKeySpec pbeSpec = new PBEKeySpec(chars, salt, iterations, keysize); - SecretKeyFactory skf = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1"); - Key secretKey = skf.generateSecret(pbeSpec); - byte[] key = new byte[32]; - - System.arraycopy(secretKey.getEncoded(), 0, key, 0, 32); - - SecretKeySpec secretKeySpec = new SecretKeySpec(key, "AES"); - AlgorithmParameterSpec ivSpec = new IvParameterSpec(initVector.getBytes("UTF-8")); - Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); - cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, ivSpec); - byte[] result = cipher.doFinal(plaintext.getBytes("UTF-8")); - - return Base64.getEncoder().encodeToString(result); - - } - - /* - * private static String decrypt(String cipherText, String passPhrase) throws - * NoSuchAlgorithmException, InvalidKeySpecException, - * UnsupportedEncodingException, NoSuchPaddingException, InvalidKeyException, - * InvalidAlgorithmParameterException, IllegalBlockSizeException, - * BadPaddingException { int iterations = 10000; int keysize = 256; char[] chars - * = passPhrase.toCharArray(); String token= cipherText.substring(0, - * cipherText.lastIndexOf('*')).replace("%2B","+"); - * - * byte[] salt = new byte[8]; System.out.println(salt); - * - * PBEKeySpec pbeSpec = new PBEKeySpec(chars, salt, iterations, keysize); - * SecretKeyFactory skf = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1"); - * Key secretKey = skf.generateSecret(pbeSpec); byte[] key = new byte[32]; - * - * System.arraycopy(secretKey.getEncoded(), 0, key, 0, 32); SecretKeySpec - * secretKeySpec = new SecretKeySpec(key, "AES"); AlgorithmParameterSpec ivSpec - * = new IvParameterSpec(initVector.getBytes("UTF-8")); Cipher cipher = - * Cipher.getInstance("AES/CBC/PKCS5Padding"); cipher.init(Cipher.DECRYPT_MODE, - * secretKeySpec, ivSpec); byte[] result = - * cipher.doFinal(token.getBytes("UTF-8")); - * - * return new String(result); } - */ - - private static String createMd5(final String token) throws NoSuchAlgorithmException { - byte[] asciiBytes = token.getBytes(StandardCharsets.US_ASCII); - MessageDigest md = MessageDigest.getInstance("MD5"); - byte[] hashBytes = md.digest(asciiBytes); - final StringBuilder builder = new StringBuilder(); - for (byte b : hashBytes) { - builder.append(String.format("%02x", b)); - } - return builder.toString(); - } - -} \ No newline at end of file diff --git a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/util/ValidationError.java b/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/util/ValidationError.java deleted file mode 100644 index ea63ae9..0000000 --- a/LoginRadius-JavaSDK/src/main/java/com/loginradius/sdk/util/ValidationError.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.loginradius.sdk.util; - -import com.google.gson.annotations.Expose; -import com.google.gson.annotations.SerializedName; - -public class ValidationError { - @SerializedName("FieldName") - @Expose - private String fieldName; - @SerializedName("ErrorMessage") - @Expose - private String errorMessage; - - public String getFieldName() { - return fieldName; - } - - public void setFieldName(final String fieldName) { - this.fieldName = fieldName; - } - - public String getErrorMessage() { - return errorMessage; - } - - public void setErrorMessage(final String errorMessage) { - this.errorMessage = errorMessage; - } - -} diff --git a/LoginRadius-Public-APIs.yaml b/LoginRadius-Public-APIs.yaml new file mode 100644 index 0000000..fd39474 --- /dev/null +++ b/LoginRadius-Public-APIs.yaml @@ -0,0 +1,58931 @@ +openapi: 3.0.1 +info: + title: LoginRadius API + description: This is a LoginRadius API server. Which you can use to authenticate and manage the user. + version: 1.0.0 + contact: + name: API Support + url: https://www.loginradius.com + email: support@loginradius.com +servers: + - url: https://api.loginradius.com + description: LoginRadius Prod Server + - url: https://{domain}.hub.loginradius.com + description: LoginRadius Default HostedPage Server + variables: + domain: + default: example + description: LoginRadius Tenant Name + - url: https://{customDomain} + description: Custom Domain Hosted By LoginRadius + variables: + customDomain: + default: example.com + description: Custom domain +security: + - APIKey: [] + - ClientId: [] +tags: + - name: Registration + description: Registeration API's + - name: Login + description: Login API's + - name: User + description: User Actions APIs + - name: Password + description: Password API's + - name: Security + description: User Security API's + - name: Session + description: Session Management APIs + - name: Custom Object + description: Custom Object APIs + - name: Accounts + description: Account Management APIs + - name: Account Session + x-displayName: Session Management + description: Access Token APIs + - name: Account Security + x-displayName: Security Management + description: Account Security APIs + - name: Account Custom Object + x-displayName: Custom Object Management + description: Account Custom Object APIs + - name: Multipurpose Tokens + description: Multipurpose Tokens API + - name: Roles Management + description: APIs for managing roles for B2C Tenant. + - name: Organization + description: Manage Organizations and their settings + - name: Organization User Roles + description: Manage role assignments for users within Organizations + - name: Organization Connections + description: Manage identity provider connections for Organizations + - name: Organization Connection Group Roles + description: Manage group to role mappings for Organization connections + - name: Organization Domains + description: Manage domains associated with Organizations + - name: Organization Invitations + description: API's for managing Organization invitations + - name: Permissions + description: Manage permissions that can be assigned to roles + - name: Roles + description: Manage roles that can be assigned to users + - name: SOTT + description: SOTT actions + - name: Custom Fields + description: Custom Fields actions + - name: Webhooks + description: Webhooks actions + - name: Workflows + description: Workflows actions + - name: SMS Templates + description: SMS Templates actions + - name: Passkey Configuration + description: Passkey Configuration actions + - name: Push Notification Configuration + description: Push Notification Configuration actions + - name: Security Questions + description: Security Questions actions + - name: Domain Access Restrictions + description: Domain Access Restrictions actions + - name: Email Templates + description: Email Templates actions + - name: Social Providers + description: Social Providers actions + - name: Second Factor Configuration + description: Second Factor Configuration actions + - name: Captcha Configuration + description: Captcha Configuration actions + - name: IP Access Restrictions + description: IP Access Restrictions actions + - name: JWT Integrations + description: JWT Integrations actions + - name: SAML Integrations + description: SAML Integrations actions + - name: OAuth Integrations + description: OAuth Integrations actions + - name: OAuth Clients + description: OAuth Clients actions + - name: OAuth Custom Providers + description: OAuth Custom Providers actions + - name: JWT Custom Providers + description: JWT Custom Providers actions + - name: SAML Custom Providers + description: SAML Custom Providers actions + - name: Password Policy + description: Password Policy actions + - name: Identity + description: Identity Analytics APIs + - name: Custom Objects + description: Custom Object Analytics APIs + - name: Insights + description: Aggregation Analytics APIs + - name: SAML + description: Federated SSO SAML APIs + - name: JWT + description: Federated SSO JWT APIs + - name: Cross Device SSO + description: Cross Device SSO APIs + - name: OAuth M2M + description: OAuth M2M APIs + - name: OAuth + description: OAuth APIs + - name: OIDC + description: OpenId Connect + - name: User Migration + description: Bulk Migration APIs + - name: Consent + description: Consent actions + - name: BigCommerce SSO + description: BigCommerce SSO integration APIs + - name: Shopify SSO + description: Shopify SSO integration APIs + - name: PerfectMind SSO + description: PerfectMind SSO integration APIs +paths: + /identity/v2/auth/password: + post: + summary: Forgot Password + description: Initiates the Password recovery process using Username or Email. + operationId: ForgotPassword + tags: + - Password + parameters: + - $ref: '#/components/parameters/EmailTemplate' + - $ref: '#/components/parameters/ResetPasswordUrl' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/GoogleRecaptchaResponseAlt' + - $ref: '#/components/parameters/QQRecaptchaTicket' + - $ref: '#/components/parameters/QQRecaptchaRandstr' + - $ref: '#/components/parameters/HCaptchaResponse' + requestBody: + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/EmailUserNameModel' + - $ref: '#/components/schemas/CaptchaModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + USERNAME_REQUIRED: + $ref: '#/components/examples/USERNAME_REQUIRED' + EMAIL_ID_OR_USER_REQUIRED: + $ref: '#/components/examples/EMAIL_ID_OR_USER_REQUIRED' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + CAPTCHA_NOT_VALID: + $ref: '#/components/examples/CAPTCHA_NOT_VALID' + RESET_PASSWORD_URL_INVALID: + $ref: '#/components/examples/RESET_PASSWORD_URL_INVALID' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + EMAIL_SEND_LIMIT_REACHED: + $ref: '#/components/examples/EMAIL_SEND_LIMIT_REACHED' + put: + tags: + - Password + operationId: ResetPasswordByResetToken + summary: Reset Password with token and OTP + description: Sets a new Password for the specified Account using a reset token and OTP. + parameters: + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/GoogleRecaptchaResponseAlt' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/HCaptchaResponse' + - $ref: '#/components/parameters/QQCaptchaTicket' + - $ref: '#/components/parameters/QQCaptchaRandstr' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ResetPassword' + examples: + ResetPasswordByEmailAndOTP: + $ref: '#/components/examples/ResetPasswordByEmailAndOTP' + ResetPasswordByUsernameAndOTP: + $ref: '#/components/examples/ResetPasswordByUsernameAndOTP' + ResetPasswordByResetToken: + $ref: '#/components/examples/ResetPasswordByResetToken' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/ResetPasswordResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + POST_BODY_INVALID: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + API_KEY_AND_RESET_TOKEN_REQUIRED: + $ref: '#/components/examples/API_KEY_AND_RESET_TOKEN_REQUIRED' + API_KEY_AND_PASSWORD_REQUIRED: + $ref: '#/components/examples/API_KEY_AND_PASSWORD_REQUIRED' + PASSWORD_AND_RESET_TOKEN_REQUIRED: + $ref: '#/components/examples/PASSWORD_AND_RESET_TOKEN_REQUIRED' + RESET_TOKEN_REQUIRED: + $ref: '#/components/examples/RESET_TOKEN_REQUIRED' + PASSWORD_REQUIRED: + $ref: '#/components/examples/PASSWORD_REQUIRED' + SERVER_SIDE_VALIDATION_ERROR: + $ref: '#/components/examples/SERVER_SIDE_VALIDATION_ERROR' + USERNAME_REQUIRED: + $ref: '#/components/examples/USERNAME_REQUIRED_PARAM' + OTP_REQUIRED: + $ref: '#/components/examples/OTP_REQUIRED' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + EMAIL_PHONE_USERNAME_PAYLOAD_REQUIRED: + $ref: '#/components/examples/EMAIL_PHONE_USERNAME_PAYLOAD_REQUIRED' + EMAIL_REQUIRED: + $ref: '#/components/examples/EMAIL_REQUIRED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + USER_ID_LOCKED_WITH_TIMEOUT: + $ref: '#/components/examples/USER_ID_LOCKED_WITH_TIMEOUT' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + SECURITY_QUESTION_NOT_VALID: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_VALID' + SECURITY_QUESTION_OR_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_INVALID' + SECURITY_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_ANSWER_INVALID' + VERIFICATION_OTP_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_OTP_NOT_VALID' + VERIFICATION_VTOKEN_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_VTOKEN_NOT_VALID' + LINK_EXPIRED: + $ref: '#/components/examples/LINK_EXPIRED' + LINK_ALREADY_VERIFIED: + $ref: '#/components/examples/LINK_ALREADY_VERIFIED' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + WEAK_PASSWORD: + $ref: '#/components/examples/WEAK_PASSWORD' + PASSWORD_IN_HISTORY: + $ref: '#/components/examples/PASSWORD_IN_HISTORY' + BREACHED_PASSWORD: + $ref: '#/components/examples/BREACHED_PASSWORD' + ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/ACTIVE_SESSIONS_EXCEEDED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + /identity/v2/auth/password/change: + put: + tags: + - Password + summary: Update Password + operationId: ChangePassword + description: Updates the Account Password using the current Password for verification. + parameters: + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/GoogleRecaptchaResponseAlt' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/HCaptchaResponse' + - $ref: '#/components/parameters/QQCaptchaTicket' + - $ref: '#/components/parameters/QQCaptchaRandstr' + - $ref: '#/components/parameters/AccessToken' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/changePassword' + responses: + '200': + description: Password change successful + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + POST_BODY_INVALID: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + OLD_PASSWORD_REQUIRED: + $ref: '#/components/examples/OLD_PASSWORD_REQUIRED' + NEW_PASSWORD_REQUIRED: + $ref: '#/components/examples/NEW_PASSWORD_REQUIRED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + INVALID_PASSWORD: + $ref: '#/components/examples/INVALID_PASSWORD' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + CAPTCHA_NOT_VALID: + $ref: '#/components/examples/CAPTCHA_NOT_VALID' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + USER_ID_LOCKED_WITH_TIMEOUT: + $ref: '#/components/examples/USER_ID_LOCKED_WITH_TIMEOUT' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + SECURITY_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_ANSWER_INVALID' + WEAK_PASSWORD: + $ref: '#/components/examples/WEAK_PASSWORD' + PASSWORD_IN_HISTORY: + $ref: '#/components/examples/PASSWORD_IN_HISTORY' + BREACHED_PASSWORD: + $ref: '#/components/examples/BREACHED_PASSWORD' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/password/reset: + put: + tags: + - Password + operationId: ResetPassword + summary: Reset Password with token and OTP + description: Sets a new Password for the specified Account using a reset token and OTP. + parameters: + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/GoogleRecaptchaResponseAlt' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/HCaptchaResponse' + - $ref: '#/components/parameters/QQCaptchaTicket' + - $ref: '#/components/parameters/QQCaptchaRandstr' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ResetPassword' + examples: + ResetPasswordByEmailAndOTP: + $ref: '#/components/examples/ResetPasswordByEmailAndOTP' + ResetPasswordByUsernameAndOTP: + $ref: '#/components/examples/ResetPasswordByUsernameAndOTP' + ResetPasswordByResetToken: + $ref: '#/components/examples/ResetPasswordByResetToken' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/ResetPasswordResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + POST_BODY_INVALID: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + API_KEY_AND_RESET_TOKEN_REQUIRED: + $ref: '#/components/examples/API_KEY_AND_RESET_TOKEN_REQUIRED' + API_KEY_AND_PASSWORD_REQUIRED: + $ref: '#/components/examples/API_KEY_AND_PASSWORD_REQUIRED' + PASSWORD_AND_RESET_TOKEN_REQUIRED: + $ref: '#/components/examples/PASSWORD_AND_RESET_TOKEN_REQUIRED' + RESET_TOKEN_REQUIRED: + $ref: '#/components/examples/RESET_TOKEN_REQUIRED' + PASSWORD_REQUIRED: + $ref: '#/components/examples/PASSWORD_REQUIRED' + SERVER_SIDE_VALIDATION_ERROR: + $ref: '#/components/examples/SERVER_SIDE_VALIDATION_ERROR' + USERNAME_REQUIRED: + $ref: '#/components/examples/USERNAME_REQUIRED_PARAM' + OTP_REQUIRED: + $ref: '#/components/examples/OTP_REQUIRED' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + EMAIL_PHONE_USERNAME_PAYLOAD_REQUIRED: + $ref: '#/components/examples/EMAIL_PHONE_USERNAME_PAYLOAD_REQUIRED' + EMAIL_REQUIRED: + $ref: '#/components/examples/EMAIL_REQUIRED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + USER_ID_LOCKED_WITH_TIMEOUT: + $ref: '#/components/examples/USER_ID_LOCKED_WITH_TIMEOUT' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + SECURITY_QUESTION_NOT_VALID: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_VALID' + SECURITY_QUESTION_OR_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_INVALID' + SECURITY_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_ANSWER_INVALID' + VERIFICATION_OTP_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_OTP_NOT_VALID' + VERIFICATION_VTOKEN_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_VTOKEN_NOT_VALID' + LINK_EXPIRED: + $ref: '#/components/examples/LINK_EXPIRED' + LINK_ALREADY_VERIFIED: + $ref: '#/components/examples/LINK_ALREADY_VERIFIED' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + WEAK_PASSWORD: + $ref: '#/components/examples/WEAK_PASSWORD' + PASSWORD_IN_HISTORY: + $ref: '#/components/examples/PASSWORD_IN_HISTORY' + BREACHED_PASSWORD: + $ref: '#/components/examples/BREACHED_PASSWORD' + ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/ACTIVE_SESSIONS_EXCEEDED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + /identity/v2/auth/password/otp: + put: + tags: + - Password + summary: Reset Password with Phone and OTP + description: Resets the Password using OTP and Phone number verification. + operationId: ResetPasswordWithOTP + parameters: + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/GoogleRecaptchaResponseAlt' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/HCaptchaResponse' + - $ref: '#/components/parameters/QQCaptchaTicket' + - $ref: '#/components/parameters/QQCaptchaRandstr' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ResetPasswordWithOTP' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/ResetPasswordResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + POST_BODY_INVALID: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + PASSWORD_REQUIRED: + $ref: '#/components/examples/PASSWORD_REQUIRED' + OTP_REQUIRED: + $ref: '#/components/examples/OTP_REQUIRED' + PHONE_REQUIRED: + $ref: '#/components/examples/PHONE_REQUIRED' + SERVER_SIDE_VALIDATION_ERROR: + $ref: '#/components/examples/SERVER_SIDE_VALIDATION_ERROR' + INVALID_PHONE_NUMBER: + $ref: '#/components/examples/INVALID_PHONE_NUMBER' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + PHONE_NO_LOGIN_NOT_ENABLED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/PHONE_NO_LOGIN_NOT_ENABLED' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + USER_ID_LOCKED_WITH_TIMEOUT: + $ref: '#/components/examples/USER_ID_LOCKED_WITH_TIMEOUT' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + SECURITY_QUESTION_NOT_VALID: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_VALID' + SECURITY_QUESTION_OR_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_INVALID' + SECURITY_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_ANSWER_INVALID' + WEAK_PASSWORD: + $ref: '#/components/examples/WEAK_PASSWORD' + OTP_NOT_EXISTS: + $ref: '#/components/examples/OTP_NOT_EXISTS' + OTP_INVALID: + $ref: '#/components/examples/OTP_INVALID' + OTP_ALREADY_USED: + $ref: '#/components/examples/OTP_ALREADY_USED' + OTP_EXPIRED: + $ref: '#/components/examples/OTP_EXPIRED' + PASSWORD_IN_HISTORY: + $ref: '#/components/examples/PASSWORD_IN_HISTORY' + BREACHED_PASSWORD: + $ref: '#/components/examples/BREACHED_PASSWORD' + ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/ACTIVE_SESSIONS_EXCEEDED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + SMS_CONFIGURATION_NOT_EXISTS: + $ref: '#/components/examples/SMS_CONFIGURATION_NOT_EXISTS' + SMS_SEND_LIMIT_REACHED: + $ref: '#/components/examples/SMS_SEND_LIMIT_REACHED' + OTP_SEND_FAILED: + $ref: '#/components/examples/OTP_SEND_FAILED' + '500': + description: Internal Server Error - an unexpected error occurred on the server. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED' + post: + summary: Retrieve Password reset OTP + description: Requests an OTP for resetting the Password using the User's Phone number. + operationId: RequestOTPForPasswordReset + tags: + - Password + parameters: + - $ref: '#/components/parameters/SmsTemplate' + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/GoogleRecaptchaResponseAlt' + - $ref: '#/components/parameters/HCaptchaResponse' + - $ref: '#/components/parameters/QQCaptchaTicket' + - $ref: '#/components/parameters/QQCaptchaRandstr' + - $ref: '#/components/parameters/IsVoiceOtp' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ForgotPasswordPhoneModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/SMSResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + PHONE_REQUIRED: + $ref: '#/components/examples/PHONE_REQUIRED' + INVALID_PHONE_NUMBER: + $ref: '#/components/examples/INVALID_PHONE_NUMBER' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + CAPTCHA_NOT_VALID: + $ref: '#/components/examples/CAPTCHA_NOT_VALID' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + SMS_CONFIGURATION_NOT_EXISTS: + $ref: '#/components/examples/SMS_CONFIGURATION_NOT_EXISTS' + VOICE_SMS_CONFIGURATION_NOT_ENABLED: + $ref: '#/components/examples/VOICE_SMS_CONFIGURATION_NOT_ENABLED' + SMS_SEND_LIMIT_REACHED: + $ref: '#/components/examples/SMS_SEND_LIMIT_REACHED' + OTP_SEND_FAILED: + $ref: '#/components/examples/OTP_SEND_FAILED' + OTP_LIMIT_REACHED: + $ref: '#/components/examples/OTP_LIMIT_REACHED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + /identity/v2/auth/password/securityanswer: + put: + summary: Reset Password with security question + description: Resets the Password using a security question and Email, Username, or Phone. + operationId: ResetPasswordSecurityAnswer + tags: + - Password + parameters: + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ResetPasswordBySecurityAnswer' + examples: + SecurityAnswerAndEmail: + $ref: '#/components/examples/ResetPasswordBySecurityAnswerAndEmail' + SecurityAnswerAndPhone: + $ref: '#/components/examples/ResetPasswordBySecurityAnswerAndPhone' + SecurityAnswerAndUserId: + $ref: '#/components/examples/ResetPasswordBySecurityAnswerAndUserId' + SecurityAnswerAndUsername: + $ref: '#/components/examples/ResetPasswordBySecurityAnswerAndUsername' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/ResetPasswordResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + POST_BODY_INVALID: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + SECUREITY_ANSWER_REQUIRED_VALIDATION: + $ref: '#/components/examples/SECUREITY_ANSWER_REQUIRED_VALIDATION' + PASSWORD_REQUIRED_VALIDATION: + $ref: '#/components/examples/PASSWORD_REQUIRED_VALIDATION' + EMAIL_PHONE_USERNAME_PAYLOAD_REQUIRED: + $ref: '#/components/examples/EMAIL_PHONE_USERNAME_PAYLOAD_REQUIRED' + USERNAME_REQUIRED: + $ref: '#/components/examples/USERNAME_REQUIRED_PARAM' + EMAIL_ID_OR_USER_REQUIRED: + $ref: '#/components/examples/EMAIL_ID_OR_USER_REQUIRED' + SERVER_SIDE_VALIDATION_ERROR: + $ref: '#/components/examples/SERVER_SIDE_VALIDATION_ERROR' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + SECURITY_QUESTION_OR_ANSWER_NOT_ENABLED: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_NOT_ENABLED' + SECURITY_QUESTION_NOT_VALID: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_VALID' + SECURITY_QUESTION_OR_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_INVALID' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + WEAK_PASSWORD: + $ref: '#/components/examples/WEAK_PASSWORD' + BREACHED_PASSWORD: + $ref: '#/components/examples/BREACHED_PASSWORD' + PASSWORD_IN_HISTORY: + $ref: '#/components/examples/PASSWORD_IN_HISTORY' + ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/ACTIVE_SESSIONS_EXCEEDED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + SECURITY_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_ANSWER_INVALID' + SECURITY_QUESTION_NOT_SAVED_IN_PROFILE: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_SAVED_IN_PROFILE' + /identity/v2/auth/register: + post: + summary: Registration by Email/Phone/Username via SOTT + description: Registers a new User using Email, Phone, or Username via a Secure One Time Token (SOTT). + operationId: UserRegistrationBySottEmailPhoneUserName + tags: + - Registration + parameters: + - $ref: '#/components/parameters/EmailTemplate' + - $ref: '#/components/parameters/Sott' + - $ref: '#/components/parameters/WelcomeEmailTemplate' + - $ref: '#/components/parameters/VerificationUrl' + - $ref: '#/components/parameters/SmsTemplate' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/Fields' + - $ref: '#/components/parameters/X-LoginRadius-Sott' + - $ref: '#/components/parameters/Options' + - $ref: '#/components/parameters/InvitationToken' + - $ref: '#/components/parameters/IsVoiceOtp' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileRequestModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/RegistrationResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + PASSWORD_REQUIRED: + $ref: '#/components/examples/PASSWORD_REQUIRED' + SOTT_REQUIRED: + $ref: '#/components/examples/SOTT_REQUIRED' + PHONE_REQUIRED_PARAM: + $ref: '#/components/examples/PHONE_REQUIRED_PARAM' + PHONE_OR_EMAIL_REQUIRED_PARAM: + $ref: '#/components/examples/PHONE_OR_EMAIL_REQUIRED_PARAM' + SERVER_SIDE_VALIDATION_ERROR: + $ref: '#/components/examples/SERVER_SIDE_VALIDATION_ERROR' + EMAIL_REQUIRED_PARAM: + $ref: '#/components/examples/EMAIL_REQUIRED_PARAM' + USERNAME_REQUIRED_PARAM: + $ref: '#/components/examples/USERNAME_REQUIRED_PARAM' + EMAIL_PHONE_REQUIRED_PARAM: + $ref: '#/components/examples/EMAIL_PHONE_REQUIRED_PARAM' + USERNAME_EMAIL_REQUIRED_PARAM: + $ref: '#/components/examples/USERNAME_EMAIL_REQUIRED_PARAM' + EMAIL_TYPE_REQUIRED: + $ref: '#/components/examples/EMAIL_TYPE_REQUIRED' + GENDER_INVALID: + $ref: '#/components/examples/GENDER_INVALID' + BIRTH_DATE_INVALID: + $ref: '#/components/examples/BIRTH_DATE_INVALID' + ADDRESS_TYPE_REQUIRED: + $ref: '#/components/examples/ADDRESS_TYPE_REQUIRED' + PARAMETER_NOT_FORMATTED: + $ref: '#/components/examples/PARAMETER_NOT_FORMATTED' + ADDRESS_TYPE_CAN_NOT_BE_SAME: + $ref: '#/components/examples/ADDRESS_TYPE_CAN_NOT_BE_SAME' + EMAIL_ID_CAN_NOT_BE_SAME: + $ref: '#/components/examples/EMAIL_ID_CAN_NOT_BE_SAME' + PRIMARY_EMAIL_CAN_BE_ONLY_ONE: + $ref: '#/components/examples/PRIMARY_EMAIL_CAN_BE_ONLY_ONE' + INVITATION_TOKEN_INVALID: + $ref: '#/components/examples/INVITATION_TOKEN_INVALID' + INVALID_PHONE_NUMBER: + $ref: '#/components/examples/INVALID_PHONE_NUMBER' + EMAIL_VALUE_REQUIRED_PARAM: + $ref: '#/components/examples/EMAIL_VALUE_REQUIRED_PARAM' + INVALID_INVITATION_ID_ACCEPTED: + $ref: '#/components/examples/INVALID_INVITATION_ID_ACCEPTED' + INVALID_INVITATION_ID_EXPIRED: + $ref: '#/components/examples/INVALID_INVITATION_ID_EXPIRED' + INVALID_INVITATION_ID_REVOKED: + $ref: '#/components/examples/INVALID_INVITATION_ID_REVOKED' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + TRIAL_PLAN_USER_LIMIT_REACHED: + $ref: '#/components/examples/TRIAL_PLAN_USER_LIMIT_REACHED' + SECURED_ONE_TIME_TOKEN_IS_INVALID: + $ref: '#/components/examples/SECURED_ONE_TIME_TOKEN_IS_INVALID' + PHONE_NO_LOGIN_NOT_ENABLED: + $ref: '#/components/examples/PHONE_NO_LOGIN_NOT_ENABLED' + SMS_CONFIGURATION_NOT_EXISTS: + $ref: '#/components/examples/SMS_CONFIGURATION_NOT_EXISTS' + VOICE_SMS_CONFIGURATION_NOT_ENABLED: + $ref: '#/components/examples/VOICE_SMS_CONFIGURATION_NOT_ENABLED' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + TRADITIONAL_REGISTRATION_DISABLED: + $ref: '#/components/examples/TRADITIONAL_REGISTRATION_DISABLED' + CUSTOM_FIELD_NOT_VALID: + $ref: '#/components/examples/CUSTOM_FIELD_NOT_VALID' + EMAILID_ALREADY_REGISTERED: + $ref: '#/components/examples/EMAILID_ALREADY_REGISTERED' + EMAILID_ALREADY_REGISTERED_WITH_SOCIAL_ACCOUNT: + $ref: '#/components/examples/EMAILID_ALREADY_REGISTERED_WITH_SOCIAL_ACCOUNT' + DOMAIN_NO_VALID_MX_RECORD: + $ref: '#/components/examples/DOMAIN_NO_VALID_MX_RECORD' + EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER: + $ref: '#/components/examples/EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER' + THIS_EMAIL_ID_IS_NOT_ALLOWED_TO_REGISTER: + $ref: '#/components/examples/THIS_EMAIL_ID_IS_NOT_ALLOWED_TO_REGISTER' + ACCOUNT_NOT_ALLOWED_TO_LOGIN: + $ref: '#/components/examples/ACCOUNT_NOT_ALLOWED_TO_LOGIN' + PIN_REQUIRED: + $ref: '#/components/examples/PIN_REQUIRED' + CONSENT_FORM_NOT_SUBMITTED: + $ref: '#/components/examples/CONSENT_FORM_NOT_SUBMITTED' + CONSENT_FORM_VALIDATION_FAILED: + $ref: '#/components/examples/CONSENT_FORM_VALIDATION_FAILED' + SECURITY_QUESTION_OR_ANSWER_NOT_ENABLED: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_NOT_ENABLED' + SECURITY_QUESTION_NOT_VALID: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_VALID' + SECURITY_QUESTION_OR_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_INVALID' + PRIVACY_POLICY_NOT_ACCEPTED: + $ref: '#/components/examples/PRIVACY_POLICY_NOT_ACCEPTED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + AGE_UNDERAGE: + $ref: '#/components/examples/AGE_UNDERAGE' + WEAK_PASSWORD: + $ref: '#/components/examples/WEAK_PASSWORD' + BREACHED_PASSWORD: + $ref: '#/components/examples/BREACHED_PASSWORD' + PHONE_NO_ALREADY_REGISTERED: + $ref: '#/components/examples/PHONE_NO_ALREADY_REGISTERED' + USERNAME_ALREADY_REGISTERED: + $ref: '#/components/examples/USERNAME_ALREADY_REGISTERED' + VERIFICATION_URL_IS_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_URL_IS_NOT_VALID' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + INVITATION_NOT_FOUND: + $ref: '#/components/examples/INVITATION_NOT_FOUND' + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND' + ROLE_DOES_NOT_EXISTS: + $ref: '#/components/examples/ROLE_DOES_NOT_EXISTS_PARTNER' + '500': + description: Internal Server Error - an unexpected error occurred on the server. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + put: + tags: + - User + summary: Resend verification Email + operationId: ResendEmailVerification + description: Resends the verification Email to the User to confirm their Email address. + parameters: + - $ref: '#/components/parameters/VerificationUrl' + - $ref: '#/components/parameters/EmailTemplate' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EmailModel' + responses: + '200': + description: User registration successful and verification Email sent + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedResponse' + '400': + description: Bad Request - Invalid parameters or missing required fields + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + EMAIL_REQUIRED: + $ref: '#/components/examples/EMAIL_ID_OR_USER_REQUIRED' + EMAIL_OR_USERNAME_ONLY_ONE: + $ref: '#/components/examples/EMAIL_OR_USERNAME_ONLY_ONE' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Status Forbidden- Insufficient permissions to perform this action + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + EMAIL_ALLREADY_VERIFIED: + $ref: '#/components/examples/EMAIL_ALLREADY_VERIFIED' + EMAILID_VERIFICATION_DISABLE: + $ref: '#/components/examples/EMAILID_VERIFICATION_DISABLE' + EMAIL_SEND_LIMIT_REACHED: + $ref: '#/components/examples/EMAIL_SEND_LIMIT_REACHED' + VERIFICATION_URL_IS_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_URL_IS_NOT_VALID' + EMAIL_ID_NOT_EXIST_IN_PROFILE: + $ref: '#/components/examples/EMAIL_ID_NOT_EXIST_IN_PROFILE' + /identity/v2/auth/register/captcha: + post: + tags: + - Registration + summary: Registration by Email/Phone/Username via Captcha + description: Registers a new User using Email, Phone, or Username with Captcha verification. + operationId: UserRegistrationByReCaptchaEmailPhoneUserName + parameters: + - $ref: '#/components/parameters/VerificationUrl' + - $ref: '#/components/parameters/EmailTemplate' + - $ref: '#/components/parameters/SmsTemplate' + - $ref: '#/components/parameters/WelcomeEmailTemplate' + - $ref: '#/components/parameters/Options' + - $ref: '#/components/parameters/IsVoiceOtp' + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/GoogleRecaptchaResponseAlt' + - $ref: '#/components/parameters/QQRecaptchaTicket' + - $ref: '#/components/parameters/QQRecaptchaRandstr' + - $ref: '#/components/parameters/HCaptchaResponse' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/Fields' + - $ref: '#/components/parameters/InvitationToken' + requestBody: + required: true + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/CaptchaModel' + - $ref: '#/components/schemas/ProfileRequestModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/RegistrationResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + PASSWORD_REQUIRED: + $ref: '#/components/examples/PASSWORD_REQUIRED' + PHONE_REQUIRED_PARAM: + $ref: '#/components/examples/PHONE_REQUIRED_PARAM' + PHONE_OR_EMAIL_REQUIRED_PARAM: + $ref: '#/components/examples/PHONE_OR_EMAIL_REQUIRED_PARAM' + SERVER_SIDE_VALIDATION_ERROR: + $ref: '#/components/examples/SERVER_SIDE_VALIDATION_ERROR' + EMAIL_REQUIRED_PARAM: + $ref: '#/components/examples/EMAIL_REQUIRED_PARAM' + USERNAME_REQUIRED_PARAM: + $ref: '#/components/examples/USERNAME_REQUIRED_PARAM' + EMAIL_PHONE_REQUIRED_PARAM: + $ref: '#/components/examples/EMAIL_PHONE_REQUIRED_PARAM' + USERNAME_EMAIL_REQUIRED_PARAM: + $ref: '#/components/examples/USERNAME_EMAIL_REQUIRED_PARAM' + EMAIL_TYPE_REQUIRED: + $ref: '#/components/examples/EMAIL_TYPE_REQUIRED' + GENDER_INVALID: + $ref: '#/components/examples/GENDER_INVALID' + BIRTH_DATE_INVALID: + $ref: '#/components/examples/BIRTH_DATE_INVALID' + ADDRESS_TYPE_REQUIRED: + $ref: '#/components/examples/ADDRESS_TYPE_REQUIRED' + PARAMETER_NOT_FORMATTED: + $ref: '#/components/examples/PARAMETER_NOT_FORMATTED' + ADDRESS_TYPE_CAN_NOT_BE_SAME: + $ref: '#/components/examples/ADDRESS_TYPE_CAN_NOT_BE_SAME' + EMAIL_ID_CAN_NOT_BE_SAME: + $ref: '#/components/examples/EMAIL_ID_CAN_NOT_BE_SAME' + PRIMARY_EMAIL_CAN_BE_ONLY_ONE: + $ref: '#/components/examples/PRIMARY_EMAIL_CAN_BE_ONLY_ONE' + INVITATION_TOKEN_INVALID: + $ref: '#/components/examples/INVITATION_TOKEN_INVALID' + INVALID_PHONE_NUMBER: + $ref: '#/components/examples/INVALID_PHONE_NUMBER' + EMAIL_VALUE_REQUIRED_PARAM: + $ref: '#/components/examples/EMAIL_VALUE_REQUIRED_PARAM' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + TRIAL_PLAN_USER_LIMIT_REACHED: + $ref: '#/components/examples/TRIAL_PLAN_USER_LIMIT_REACHED' + CAPTCHA_NOT_VALID: + $ref: '#/components/examples/CAPTCHA_NOT_VALID' + PHONE_NO_LOGIN_NOT_ENABLED: + $ref: '#/components/examples/PHONE_NO_LOGIN_NOT_ENABLED' + SMS_CONFIGURATION_NOT_EXISTS: + $ref: '#/components/examples/SMS_CONFIGURATION_NOT_EXISTS' + VOICE_SMS_CONFIGURATION_NOT_ENABLED: + $ref: '#/components/examples/VOICE_SMS_CONFIGURATION_NOT_ENABLED' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + INVALID_INVITATION_ID_ACCEPTED: + $ref: '#/components/examples/INVALID_INVITATION_ID_ACCEPTED' + INVALID_INVITATION_ID_EXPIRED: + $ref: '#/components/examples/INVALID_INVITATION_ID_EXPIRED' + INVALID_INVITATION_ID_REVOKED: + $ref: '#/components/examples/INVALID_INVITATION_ID_REVOKED' + TRADITIONAL_REGISTRATION_DISABLED: + $ref: '#/components/examples/TRADITIONAL_REGISTRATION_DISABLED' + CUSTOM_FIELD_NOT_VALID: + $ref: '#/components/examples/CUSTOM_FIELD_NOT_VALID' + EMAILID_ALREADY_REGISTERED: + $ref: '#/components/examples/EMAILID_ALREADY_REGISTERED' + EMAILID_ALREADY_REGISTERED_WITH_SOCIAL_ACCOUNT: + $ref: '#/components/examples/EMAILID_ALREADY_REGISTERED_WITH_SOCIAL_ACCOUNT' + DOMAIN_NO_VALID_MX_RECORD: + $ref: '#/components/examples/DOMAIN_NO_VALID_MX_RECORD' + EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER: + $ref: '#/components/examples/EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER' + THIS_EMAIL_ID_IS_NOT_ALLOWED_TO_REGISTER: + $ref: '#/components/examples/THIS_EMAIL_ID_IS_NOT_ALLOWED_TO_REGISTER' + ACCOUNT_NOT_ALLOWED_TO_LOGIN: + $ref: '#/components/examples/ACCOUNT_NOT_ALLOWED_TO_LOGIN' + PIN_REQUIRED: + $ref: '#/components/examples/PIN_REQUIRED' + CONSENT_FORM_NOT_SUBMITTED: + $ref: '#/components/examples/CONSENT_FORM_NOT_SUBMITTED' + CONSENT_FORM_VALIDATION_FAILED: + $ref: '#/components/examples/CONSENT_FORM_VALIDATION_FAILED' + SECURITY_QUESTION_OR_ANSWER_NOT_ENABLED: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_NOT_ENABLED' + SECURITY_QUESTION_NOT_VALID: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_VALID' + SECURITY_QUESTION_OR_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_INVALID' + PRIVACY_POLICY_NOT_ACCEPTED: + $ref: '#/components/examples/PRIVACY_POLICY_NOT_ACCEPTED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + AGE_UNDERAGE: + $ref: '#/components/examples/AGE_UNDERAGE' + WEAK_PASSWORD: + $ref: '#/components/examples/WEAK_PASSWORD' + BREACHED_PASSWORD: + $ref: '#/components/examples/BREACHED_PASSWORD' + PHONE_NO_ALREADY_REGISTERED: + $ref: '#/components/examples/PHONE_NO_ALREADY_REGISTERED' + USERNAME_ALREADY_REGISTERED: + $ref: '#/components/examples/USERNAME_ALREADY_REGISTERED' + VERIFICATION_URL_IS_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_URL_IS_NOT_VALID' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + INVITATION_NOT_FOUND: + $ref: '#/components/examples/INVITATION_NOT_FOUND' + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND' + ROLE_DOES_NOT_EXISTS: + $ref: '#/components/examples/ROLE_DOES_NOT_EXISTS_PARTNER' + '500': + description: Internal Server Error - an unexpected error occurred on the server. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /identity/v2/auth/register/passkey/begin: + get: + tags: + - Registration + summary: Initiate Registration with Passkey + operationId: beginPasskeyRegistration + description: Begins the registration process using a Passkey. + parameters: + - $ref: '#/components/parameters/PasskeyIdentifier' + responses: + '200': + description: Successfully initiated credential registration + content: + application/json: + schema: + type: object + description: Response object returned to initiate Passkey registration (WebAuthn) + properties: + RegisterBeginCredential: + type: object + description: OpenAPI schema for protocol.PublicKeyCredentialCreationOptions + properties: + publicKey: + $ref: '#/components/schemas/PublicKeyCredentialCreationOptions' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + TRIAL_PLAN_USER_LIMIT_REACHED: + $ref: '#/components/examples/TRIAL_PLAN_USER_LIMIT_REACHED' + EMAILID_ALREADY_REGISTERED: + $ref: '#/components/examples/EMAILID_ALREADY_REGISTERED' + EMAILID_ALREADY_REGISTERED_WITH_SOCIAL_ACCOUNT: + $ref: '#/components/examples/EMAILID_ALREADY_REGISTERED_WITH_SOCIAL_ACCOUNT' + PASSKEY_NOT_ENABLED_IN_APP: + $ref: '#/components/examples/PASSKEY_NOT_ENABLED_IN_APP' + DOMAIN_NO_VALID_MX_RECORD: + $ref: '#/components/examples/DOMAIN_NO_VALID_MX_RECORD' + EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER: + $ref: '#/components/examples/EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER' + THIS_EMAIL_ID_IS_NOT_ALLOWED_TO_REGISTER: + $ref: '#/components/examples/THIS_EMAIL_ID_IS_NOT_ALLOWED_TO_REGISTER' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + PASSKEY_CONFIG_INVALID: + $ref: '#/components/examples/PASSKEY_CONFIG_INVALID' + PASSKEY_VERIFICATION_FAILED: + $ref: '#/components/examples/PASSKEY_VERIFICATION_FAILED' + /identity/v2/auth/register/passkey/finish: + post: + tags: + - Registration + summary: Complete Registration with Passkey + operationId: finishPasskeyRegistration + description: Completes the registration process using a Passkey. + parameters: + - $ref: '#/components/parameters/VerificationUrl' + - $ref: '#/components/parameters/EmailTemplate' + - $ref: '#/components/parameters/WelcomeEmailTemplate' + - $ref: '#/components/parameters/Fields' + - $ref: '#/components/parameters/Options' + - $ref: '#/components/parameters/InvitationToken' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PasskeyRegisterFinish' + responses: + '200': + description: Successfully finish credential registration + content: + application/json: + schema: + $ref: '#/components/schemas/RegistrationResponse' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + EMAIL_VALUE_REQUIRED_PARAM: + $ref: '#/components/examples/EMAIL_VALUE_REQUIRED_PARAM' + EMAIL_TYPE_REQUIRED_PARAM: + $ref: '#/components/examples/EMAIL_TYPE_REQUIRED_PARAM' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + PASS_KEY_CREDENTIAL_REQUIRED: + $ref: '#/components/examples/PASS_KEY_CREDENTIAL_REQUIRED' + GENDER_INVALID: + $ref: '#/components/examples/GENDER_INVALID' + BIRTH_DATE_INVALID: + $ref: '#/components/examples/BIRTH_DATE_INVALID' + ADDRESS_TYPE_REQUIRED: + $ref: '#/components/examples/ADDRESS_TYPE_REQUIRED' + PARAMETER_NOT_FORMATTED: + $ref: '#/components/examples/PARAMETER_NOT_FORMATTED' + ADDRESS_TYPE_CAN_NOT_BE_SAME: + $ref: '#/components/examples/ADDRESS_TYPE_CAN_NOT_BE_SAME' + EMAIL_ID_CAN_NOT_BE_SAME: + $ref: '#/components/examples/EMAIL_ID_CAN_NOT_BE_SAME' + PRIMARY_EMAIL_CAN_BE_ONLY_ONE: + $ref: '#/components/examples/PRIMARY_EMAIL_CAN_BE_ONLY_ONE' + INVITATION_TOKEN_INVALID: + $ref: '#/components/examples/INVITATION_TOKEN_INVALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_USER_LIMIT_REACHED: + $ref: '#/components/examples/TRIAL_PLAN_USER_LIMIT_REACHED' + PASSKEY_NOT_ENABLED_IN_APP: + $ref: '#/components/examples/PASSKEY_NOT_ENABLED_IN_APP' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + TRADITIONAL_REGISTRATION_DISABLED: + $ref: '#/components/examples/TRADITIONAL_REGISTRATION_DISABLED' + CUSTOM_FIELD_NOT_VALID: + $ref: '#/components/examples/CUSTOM_FIELD_NOT_VALID' + EMAILID_ALREADY_REGISTERED: + $ref: '#/components/examples/EMAILID_ALREADY_REGISTERED' + EMAILID_ALREADY_REGISTERED_WITH_SOCIAL_ACCOUNT: + $ref: '#/components/examples/EMAILID_ALREADY_REGISTERED_WITH_SOCIAL_ACCOUNT' + DOMAIN_NO_VALID_MX_RECORD: + $ref: '#/components/examples/DOMAIN_NO_VALID_MX_RECORD' + EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER: + $ref: '#/components/examples/EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER' + THIS_EMAIL_ID_IS_NOT_ALLOWED_TO_REGISTER: + $ref: '#/components/examples/THIS_EMAIL_ID_IS_NOT_ALLOWED_TO_REGISTER' + PASSKEY_CONFIG_INVALID: + $ref: '#/components/examples/PASSKEY_CONFIG_INVALID' + PASS_KEY_CREDENTIAL_REQUIRED: + $ref: '#/components/examples/PASS_KEY_CREDENTIAL_REQUIRED' + PASSKEY_VERIFICATION_FAILED: + $ref: '#/components/examples/PASSKEY_VERIFICATION_FAILED' + ACCOUNT_NOT_ALLOWED_TO_LOGIN: + $ref: '#/components/examples/ACCOUNT_NOT_ALLOWED_TO_LOGIN' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + PIN_REQUIRED: + $ref: '#/components/examples/PIN_REQUIRED' + CONSENT_FORM_NOT_SUBMITTED: + $ref: '#/components/examples/CONSENT_FORM_NOT_SUBMITTED' + CONSENT_FORM_VALIDATION_FAILED: + $ref: '#/components/examples/CONSENT_FORM_VALIDATION_FAILED' + SECURITY_QUESTION_OR_ANSWER_NOT_ENABLED: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_NOT_ENABLED' + SECURITY_QUESTION_NOT_VALID: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_VALID' + SECURITY_QUESTION_OR_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_INVALID' + PRIVACY_POLICY_NOT_ACCEPTED: + $ref: '#/components/examples/PRIVACY_POLICY_NOT_ACCEPTED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + AGE_UNDERAGE: + $ref: '#/components/examples/AGE_UNDERAGE' + INVALID_INVITATION_ID_ACCEPTED: + $ref: '#/components/examples/INVALID_INVITATION_ID_ACCEPTED' + INVALID_INVITATION_ID_EXPIRED: + $ref: '#/components/examples/INVALID_INVITATION_ID_EXPIRED' + INVALID_INVITATION_ID_REVOKED: + $ref: '#/components/examples/INVALID_INVITATION_ID_REVOKED' + VERIFICATION_URL_IS_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_URL_IS_NOT_VALID' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + INVITATION_NOT_FOUND: + $ref: '#/components/examples/INVITATION_NOT_FOUND' + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND' + ROLE_DOES_NOT_EXISTS: + $ref: '#/components/examples/ROLE_DOES_NOT_EXISTS_PARTNER' + '500': + description: Internal Server Error - an unexpected error occurred on the server. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /identity/v2/auth/login: + post: + summary: Login with credentials + description: Authenticates a User using Email, Username, or Phone, providing an Access Token for further API interactions. + operationId: EmailByLoginUserNamePhone + tags: + - Login + parameters: + - $ref: '#/components/parameters/EmailTemplate' + - $ref: '#/components/parameters/LoginUrl' + - $ref: '#/components/parameters/VerificationUrl' + - $ref: '#/components/parameters/SmsTemplate' + - $ref: '#/components/parameters/IsVoiceOtp' + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/BreachedPasswordEmailTemplate' + - $ref: '#/components/parameters/BreachedPasswordSmsTemplate' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/Fields' + - $ref: '#/components/parameters/Options' + - $ref: '#/components/parameters/RbaBrowserEmailTemplate' + - $ref: '#/components/parameters/RbaOneClickEmailTemplate' + - $ref: '#/components/parameters/RbaCityEmailTemplate' + - $ref: '#/components/parameters/RbaCountryEmailTemplate' + - $ref: '#/components/parameters/RbaIPEmailTemplate' + - $ref: '#/components/parameters/RbaDeviceEmailTemplate' + - $ref: '#/components/parameters/RbaOtpSMSTemplate' + - $ref: '#/components/parameters/RbaBrowserSMSTemplate' + - $ref: '#/components/parameters/RbaCitySMSTemplate' + - $ref: '#/components/parameters/RbaCountrySMSTemplate' + - $ref: '#/components/parameters/RbaIPSMSTemplate' + - $ref: '#/components/parameters/RbaDeviceSMSTemplate' + - $ref: '#/components/parameters/InvitationToken' + - $ref: '#/components/parameters/EmailTemplate2FA' + - $ref: '#/components/parameters/DuoRedirectUri' + requestBody: + required: true + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/LoginByEmailRequest' + - $ref: '#/components/schemas/LoginByUsernameRequest' + - $ref: '#/components/schemas/LoginByPhone' + examples: + LoginByEmailRequest: + $ref: '#/components/examples/LoginByEmailRequest' + LoginByUserNameRequest: + $ref: '#/components/examples/LoginByUserNameRequest' + LoginByPhoneRequest: + $ref: '#/components/examples/LoginByPhoneRequest' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/AuthResponseOptionalMfa' + - $ref: '#/components/schemas/AuthResponseRequiredMfa' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + PASSWORD_REQUIRED: + $ref: '#/components/examples/PASSWORD_REQUIRED' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + INVITATION_TOKEN_INVALID: + $ref: '#/components/examples/INVITATION_TOKEN_INVALID' + INVALID_PHONE_NUMBER: + $ref: '#/components/examples/INVALID_PHONE_NUMBER' + DUO_REDIRECT_URI_REQUIRED: + $ref: '#/components/examples/DUO_REDIRECT_URI_REQUIRED' + USERNAME_REQUIRED_PARAM: + $ref: '#/components/examples/USERNAME_REQUIRED_PARAM' + USERNAME_PASSWORD_REQUIRED: + $ref: '#/components/examples/USERNAME_PASSWORD_REQUIRED' + PHONE_OR_EMAIL_OR_USER_REQUIRED_PARAM: + $ref: '#/components/examples/PHONE_OR_EMAIL_OR_USER_REQUIRED_PARAM' + PHONE_OR_EMAIL_OR_USER_REQUIRED_PASSWORD_REQUIRED_PARAM: + $ref: '#/components/examples/PHONE_OR_EMAIL_OR_USER_REQUIRED_PASSWORD_REQUIRED_PARAM' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + USERNAME_OR_PASSWORD_WRONG: + $ref: '#/components/examples/USERNAME_OR_PASSWORD_WRONG' + USERNAME_OR_PASSWORD_WRONG_FOR_BLOCK_LOCKOUT: + $ref: '#/components/examples/USERNAME_OR_PASSWORD_WRONG_FOR_BLOCK_LOCKOUT' + USERNAME_OR_PASSWORD_WRONG_FOR_SUSPEND_LOCKOUT: + $ref: '#/components/examples/USERNAME_OR_PASSWORD_WRONG_FOR_SUSPEND_LOCKOUT' + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + USER_NAME_AUTHENTICATION_ENABLED: + $ref: '#/components/examples/USER_NAME_AUTHENTICATION_ENABLED' + LOGIN_WITH_PASSWORD_NOT_ENABLED: + $ref: '#/components/examples/LOGIN_WITH_PASSWORD_NOT_ENABLED' + CAPTCHA_NOT_VALID: + $ref: '#/components/examples/CAPTCHA_NOT_VALID' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + PHONE_NO_LOGIN_NOT_ENABLED: + $ref: '#/components/examples/PHONE_NO_LOGIN_NOT_ENABLED' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + ACCOUNT_NOT_ALLOWED_TO_LOGIN: + $ref: '#/components/examples/ACCOUNT_NOT_ALLOWED_TO_LOGIN' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + USER_ID_LOCKED_WITH_TIMEOUT: + $ref: '#/components/examples/USER_ID_LOCKED_WITH_TIMEOUT' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + SECURITY_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_ANSWER_INVALID' + SECURITY_QUESTION_NOT_VALID: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_VALID' + SECURITY_QUESTION_OR_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_INVALID' + ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/ACTIVE_SESSIONS_EXCEEDED' + BREACHED_PASSWORD_LOGIN: + $ref: '#/components/examples/BREACHED_PASSWORD_LOGIN' + INVALID_INVITATION_ID_ACCEPTED: + $ref: '#/components/examples/INVALID_INVITATION_ID_ACCEPTED' + INVALID_INVITATION_ID_EXPIRED: + $ref: '#/components/examples/INVALID_INVITATION_ID_EXPIRED' + INVALID_INVITATION_ID_REVOKED: + $ref: '#/components/examples/INVALID_INVITATION_ID_REVOKED' + EMAIL_NOT_VERIFIED: + $ref: '#/components/examples/EMAIL_NOT_VERIFIED' + PHONE_NOT_VERIFIED: + $ref: '#/components/examples/PHONE_NOT_VERIFIED' + EMAIL_OR_PHONE_NUMBER_REQUIRED_VERIFIED: + $ref: '#/components/examples/EMAIL_OR_PHONE_NUMBER_REQUIRED_VERIFIED' + EMAIL_SEND_LIMIT_REACHED: + $ref: '#/components/examples/EMAIL_SEND_LIMIT_REACHED' + SMS_CONFIGURATION_NOT_EXISTS: + $ref: '#/components/examples/SMS_CONFIGURATION_NOT_EXISTS' + VOICE_SMS_CONFIGURATION_NOT_ENABLED: + $ref: '#/components/examples/VOICE_SMS_CONFIGURATION_NOT_ENABLED' + SMS_SEND_LIMIT_REACHED: + $ref: '#/components/examples/SMS_SEND_LIMIT_REACHED' + OTP_SEND_FAILED: + $ref: '#/components/examples/OTP_SEND_FAILED' + RBA_ACCOUNT_IS_BLOCKED_BY_BROWSER_RISK: + $ref: '#/components/examples/RBA_ACCOUNT_IS_BLOCKED_BY_BROWSER_RISK' + RBA_ACCOUNT_IS_BLOCKED_BY_CITY_RISK: + $ref: '#/components/examples/RBA_ACCOUNT_IS_BLOCKED_BY_CITY_RISK' + RBA_ACCOUNT_IS_BLOCKED_BY_COUNTRY_RISK: + $ref: '#/components/examples/RBA_ACCOUNT_IS_BLOCKED_BY_COUNTRY_RISK' + RBA_ACCOUNT_IS_BLOCKED_BY_DEVICE_RISK: + $ref: '#/components/examples/RBA_ACCOUNT_IS_BLOCKED_BY_DEVICE_RISK' + RBA_ACCOUNT_IS_BLOCKED_BY_IP_RISK: + $ref: '#/components/examples/RBA_ACCOUNT_IS_BLOCKED_BY_IP_RISK' + RBA_EMAIL_VERIFICATION_BY_BROWSER_RISK: + $ref: '#/components/examples/RBA_EMAIL_VERIFICATION_BY_BROWSER_RISK' + RBA_EMAIL_VERIFICATION_BY_CITY_RISK: + $ref: '#/components/examples/RBA_EMAIL_VERIFICATION_BY_CITY_RISK' + RBA_EMAIL_VERIFICATION_BY_COUNTRY_RISK: + $ref: '#/components/examples/RBA_EMAIL_VERIFICATION_BY_COUNTRY_RISK' + RBA_EMAIL_VERIFICATION_BY_DEVICE_RISK: + $ref: '#/components/examples/RBA_EMAIL_VERIFICATION_BY_DEVICE_RISK' + RBA_EMAIL_VERIFICATION_BY_IP_RISK: + $ref: '#/components/examples/RBA_EMAIL_VERIFICATION_BY_IP_RISK' + RBA_SECURITY_ANSWER_VERIFICATION_BY_BROWSER_RISK: + $ref: '#/components/examples/RBA_SECURITY_ANSWER_VERIFICATION_BY_BROWSER_RISK' + RBA_SECURITY_ANSWER_VERIFICATION_BY_CITY_RISK: + $ref: '#/components/examples/RBA_SECURITY_ANSWER_VERIFICATION_BY_CITY_RISK' + RBA_SECURITY_ANSWER_VERIFICATION_BY_COUNTRY_RISK: + $ref: '#/components/examples/RBA_SECURITY_ANSWER_VERIFICATION_BY_COUNTRY_RISK' + RBA_SECURITY_ANSWER_VERIFICATION_BY_DEVICE_RISK: + $ref: '#/components/examples/RBA_SECURITY_ANSWER_VERIFICATION_BY_DEVICE_RISK' + RBA_SMS_VERIFICATION_BY_BROWSER_RISK: + $ref: '#/components/examples/RBA_SMS_VERIFICATION_BY_BROWSER_RISK' + RBA_SMS_VERIFICATION_BY_CITY_RISK: + $ref: '#/components/examples/RBA_SMS_VERIFICATION_BY_CITY_RISK' + RBA_SMS_VERIFICATION_BY_COUNTRY_RISK: + $ref: '#/components/examples/RBA_SMS_VERIFICATION_BY_COUNTRY_RISK' + RBA_SMS_VERIFICATION_BY_DEVICE_RISK: + $ref: '#/components/examples/RBA_SMS_VERIFICATION_BY_DEVICE_RISK' + RBA_SMS_VERIFICATION_BY_IP_RISK: + $ref: '#/components/examples/RBA_SMS_VERIFICATION_BY_IP_RISK' + PIN_IS_REQUIRED: + $ref: '#/components/examples/PIN_IS_REQUIRED' + CONSENT_FORM_VALIDATION_FAILED: + $ref: '#/components/examples/CONSENT_FORM_VALIDATION_FAILED' + CONSENT_FORM_NOT_SUBMITTED: + $ref: '#/components/examples/CONSENT_FORM_NOT_SUBMITTED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD' + SOMETHING_GOING_WRONG: + $ref: '#/components/examples/SOMETHING_GOING_WRONG' + TWO_FACTOR_AUTHENTICATION_PUSH_CONFIG_INVALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_PUSH_CONFIG_INVALID' + TWO_FACTOR_AUTHENTICATION_DUO_AUTH_CONFIG_INVALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_DUO_AUTH_CONFIG_INVALID' + EMAIL_ID_NOT_EXISTS: + $ref: '#/components/examples/EMAIL_ID_NOT_EXISTS' + DUO_AUTHENTICATOR_REDIRECT_URI_INVALID: + $ref: '#/components/examples/DUO_AUTHENTICATOR_REDIRECT_URI_INVALID' + DUO_AUTHENTICATOR_REDIRECT_URI_NOT_WHITELISTED: + $ref: '#/components/examples/DUO_AUTHENTICATOR_REDIRECT_URI_NOT_WHITELISTED' + VERIFICATION_URL_IS_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_URL_IS_NOT_VALID' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + INVITATION_NOT_FOUND: + $ref: '#/components/examples/INVITATION_NOT_FOUND' + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND' + ROLE_DOES_NOT_EXISTS: + $ref: '#/components/examples/ROLE_DOES_NOT_EXISTS_PARTNER' + '500': + description: Internal Server Error - an unexpected error occurred on the server. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /identity/v2/auth/email: + post: + summary: Add Email + description: Adds an Email to a User's account, either as a primary or additional Email. + operationId: AddEmail + tags: + - User + parameters: + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/EmailTemplate' + - $ref: '#/components/parameters/VerificationUrl' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AddEmailModel' + responses: + '200': + description: Status OK:The request was successful. + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + PARAMETER_NOT_FORMATTED: + $ref: '#/components/examples/PARAMETER_NOT_FORMATTED' + EMAIL_REQUIRED: + $ref: '#/components/examples/EMAIL_REQUIRED' + EMAIL_TYPE_CAN_NOT_NULL: + $ref: '#/components/examples/EMAIL_TYPE_CAN_NOT_NULL' + SERVER_SIDE_VALIDATION_ERROR: + $ref: '#/components/examples/SERVER_SIDE_VALIDATION_ERROR' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: 'Status Forbidden: The server understood the request, but refuses to authorize it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + DOMAIN_NO_VALID_MX_RECORD: + $ref: '#/components/examples/DOMAIN_NO_VALID_MX_RECORD' + EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER: + $ref: '#/components/examples/EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER' + THIS_EMAIL_ID_IS_NOT_ALLOWED_TO_REGISTER: + $ref: '#/components/examples/THIS_EMAIL_ID_IS_NOT_ALLOWED_TO_REGISTER' + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + CANNOT_ADD_EMAIL_ADDRESS: + $ref: '#/components/examples/CANNOT_ADD_EMAIL_ADDRESS' + EMAILID_ALREADY_REGISTERED: + $ref: '#/components/examples/EMAILID_ALREADY_REGISTERED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + EMAIL_SEND_LIMIT_REACHED: + $ref: '#/components/examples/EMAIL_SEND_LIMIT_REACHED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + VERIFICATION_URL_IS_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_URL_IS_NOT_VALID' + put: + tags: + - User + operationId: UpdateEmail + summary: Verify Email + description: Verifies the User's Email when OTP Email Verification is enabled, requiring LoginRadius activation. + parameters: + - $ref: '#/components/parameters/Url' + - $ref: '#/components/parameters/WelcomeEmailTemplate' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/GoogleRecaptchaResponseAlt' + - $ref: '#/components/parameters/QQRecaptchaTicket' + - $ref: '#/components/parameters/QQRecaptchaRandstr' + - $ref: '#/components/parameters/HCaptchaResponse' + requestBody: + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/VerifyEmailModel' + - $ref: '#/components/schemas/CaptchaModel' + responses: + '200': + description: Email existence check response + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/AuthResponse' + - $ref: '#/components/schemas/AuthResponseEmailVerification' + - $ref: '#/components/schemas/AuthResponseForgotReset' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + PARAMETER_NOT_FORMATTED: + $ref: '#/components/examples/PARAMETER_NOT_FORMATTED' + EMAIL_UUID_OTP_REQUIRED: + $ref: '#/components/examples/EMAIL_UUID_OTP_REQUIRED' + EMAIL_UUID_REQUIRED: + $ref: '#/components/examples/EMAIL_UUID_REQUIRED' + EMAIL_USERNAME_UUID_OTP_REQUIRED: + $ref: '#/components/examples/EMAIL_USERNAME_UUID_OTP_REQUIRED' + EMAIL_USERNAME_UUID_REQUIRED: + $ref: '#/components/examples/EMAIL_USERNAME_UUID_REQUIRED' + EMAIL_OR_USERNAME_ONLY_ONE: + $ref: '#/components/examples/EMAIL_OR_USERNAME_ONLY_ONE' + OTP_REQUIRED: + $ref: '#/components/examples/OTP_REQUIRED' + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: 'Status Forbidden: The server understood the request, but refuses to authorize it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + INVALID_UUID: + $ref: '#/components/examples/INVALID_UUID' + EMAIL_OTP_NOT_EXISTS: + $ref: '#/components/examples/EMAIL_OTP_NOT_EXISTS' + EMAIL_OTP_ALREADY_USED: + $ref: '#/components/examples/EMAIL_OTP_ALREADY_USED' + EMAIL_OTP_EXPIRED: + $ref: '#/components/examples/EMAIL_OTP_EXPIRED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + SECURITY_QUESTION_NOT_VALID: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_VALID' + SECURITY_QUESTION_OR_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_INVALID' + SECURITY_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_ANSWER_INVALID' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + APP_NOT_EXISTS: + $ref: '#/components/examples/APP_NOT_EXISTS' + CONSENT_FORM_VALIDATION_FAILED: + $ref: '#/components/examples/CONSENT_FORM_VALIDATION_FAILED' + CONSENT_FORM_NOT_SUBMITTED: + $ref: '#/components/examples/CONSENT_FORM_NOT_SUBMITTED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + EMAIL_ALREADY_USED: + $ref: '#/components/examples/EMAIL_ALREADY_USED' + VERIFICATION_VTOKEN_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_VTOKEN_NOT_VALID' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + security: + - BearerToken: [] + APIKey: [] + get: + tags: + - User + operationId: CheckEmailAvailability + summary: Check Email availability + description: Verifies Email availability or checks Email using a Verification Token or OTP. + parameters: + - $ref: '#/components/parameters/Email' + - $ref: '#/components/parameters/Username' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/VerificationToken' + - $ref: '#/components/parameters/Otp' + - $ref: '#/components/parameters/Uuid' + - $ref: '#/components/parameters/Url' + - $ref: '#/components/parameters/WelcomeEmailTemplate' + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/GoogleRecaptchaResponseAlt' + - $ref: '#/components/parameters/QQRecaptchaTicket' + - $ref: '#/components/parameters/QQRecaptchaRandstr' + - $ref: '#/components/parameters/HCaptchaResponse' + responses: + '200': + description: Email existence check response + content: + application/json: + schema: + type: object + oneOf: + - $ref: '#/components/schemas/IsExist' + - $ref: '#/components/schemas/AuthResponse' + - $ref: '#/components/schemas/AuthResponseEmailVerification' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + VERIFICATION_TOKEN_REQUIRED: + $ref: '#/components/examples/VERIFICATION_TOKEN_REQUIRED' + EMAIL_UUID_OTP_REQUIRED: + $ref: '#/components/examples/EMAIL_UUID_OTP_REQUIRED' + EMAIL_UUID_REQUIRED: + $ref: '#/components/examples/EMAIL_UUID_REQUIRED' + EMAIL_USERNAME_UUID_OTP_REQUIRED: + $ref: '#/components/examples/EMAIL_USERNAME_UUID_OTP_REQUIRED' + EMAIL_USERNAME_UUID_REQUIRED: + $ref: '#/components/examples/EMAIL_USERNAME_UUID_REQUIRED' + EMAIL_OR_USERNAME_ONLY_ONE: + $ref: '#/components/examples/EMAIL_OR_USERNAME_ONLY_ONE' + OTP_REQUIRED: + $ref: '#/components/examples/OTP_REQUIRED' + EMAIL_REQUIRED: + $ref: '#/components/examples/EMAIL_REQUIRED' + '403': + description: 'Status Forbidden: The server understood the request, but refuses to authorize it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + IDENTIFIER_AVAILABILITY_CHECK_DISABLED: + $ref: '#/components/examples/IDENTIFIER_AVAILABILITY_CHECK_DISABLED' + CAPTCHA_NOT_VALID: + $ref: '#/components/examples/CAPTCHA_NOT_VALID' + VERIFICATION_LINK_INVALID: + $ref: '#/components/examples/VERIFICATION_LINK_INVALID' + EMAIL_OTP_NOT_EXISTS: + $ref: '#/components/examples/EMAIL_OTP_NOT_EXISTS' + LINK_ALREADY_VERIFIED: + $ref: '#/components/examples/LINK_ALREADY_VERIFIED' + EMAIL_OTP_ALREADY_USED: + $ref: '#/components/examples/EMAIL_OTP_ALREADY_USED' + LINK_EXPIRED: + $ref: '#/components/examples/LINK_EXPIRED' + EMAIL_OTP_EXPIRED: + $ref: '#/components/examples/EMAIL_OTP_EXPIRED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + SECURITY_QUESTION_NOT_VALID: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_VALID' + SECURITY_QUESTION_OR_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_INVALID' + SECURITY_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_ANSWER_INVALID' + CONSENT_FORM_VALIDATION_FAILED: + $ref: '#/components/examples/CONSENT_FORM_VALIDATION_FAILED' + CONSENT_FORM_NOT_SUBMITTED: + $ref: '#/components/examples/CONSENT_FORM_NOT_SUBMITTED' + CONSENT_FORM_NOT_AVAILABLE: + $ref: '#/components/examples/CONSENT_FORM_NOT_AVAILABLE' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + VERIFICATION_VTOKEN_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_VTOKEN_NOT_VALID' + INVALID_UUID: + $ref: '#/components/examples/INVALID_UUID' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + delete: + tags: + - User + summary: Remove Email + description: Removes additional Emails from a User's account. + operationId: deleteemailbyaccesstoken + parameters: + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + responses: + '200': + description: 'Status OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsDeleted' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + DELETE_BODY_INVALID: + $ref: '#/components/examples/DELETE_BODY_INVALID' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + '403': + description: 'Status Forbidden: The server understood the request, but refuses to authorize it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + ONE_EMAILID_IS_REQUIRED: + $ref: '#/components/examples/ONE_EMAILID_IS_REQUIRED' + EMAIL_ID_NOT_EXISTS: + $ref: '#/components/examples/EMAIL_ID_NOT_EXISTS' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + requestBody: + required: true + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/AccessTokenInBody' + - $ref: '#/components/schemas/DeleteEmailRequest' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/login/passkey/begin: + get: + tags: + - Login + summary: Initiate Login with Passkey + operationId: beginPasskeyLogin + description: Begins the login process using a Passkey. + parameters: + - $ref: '#/components/parameters/PasskeyIdentifier' + - $ref: '#/components/parameters/VerificationUrl' + - $ref: '#/components/parameters/EmailTemplate' + responses: + '200': + description: Successfully initiated login + content: + application/json: + schema: + type: object + description: Response object returned to initiate Passkey login (WebAuthn) + properties: + LoginBeginCredential: + type: object + description: OpenAPI schema for protocol.PublicKeyCredentialRequestOptions + properties: + publicKey: + $ref: '#/components/schemas/PublicKeyCredentialRequestOptions' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + PASSKEY_NOT_ENABLED_IN_APP: + $ref: '#/components/examples/PASSKEY_NOT_ENABLED_IN_APP' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/ACTIVE_SESSIONS_EXCEEDED' + PASSKEY_NOT_CONFIGURED_IN_PROFILE: + $ref: '#/components/examples/PASSKEY_NOT_CONFIGURED_IN_PROFILE' + EMAIL_SEND_LIMIT_REACHED: + $ref: '#/components/examples/EMAIL_SEND_LIMIT_REACHED' + EMAIL_NOT_VERIFIED: + $ref: '#/components/examples/EMAIL_NOT_VERIFIED' + PASSKEY_CONFIG_INVALID: + $ref: '#/components/examples/PASSKEY_CONFIG_INVALID' + PASSKEY_VERIFICATION_FAILED: + $ref: '#/components/examples/PASSKEY_VERIFICATION_FAILED' + VERIFICATION_URL_IS_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_URL_IS_NOT_VALID' + /identity/v2/auth/login/passkey/finish: + post: + tags: + - Login + summary: Complete Login with Passkey + operationId: finishPasskeyLogin + description: Completes the login process using a Passkey. + parameters: + - $ref: '#/components/parameters/LoginUrl' + - $ref: '#/components/parameters/VerificationUrl' + - $ref: '#/components/parameters/EmailTemplate' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/Fields' + - $ref: '#/components/parameters/Options' + - $ref: '#/components/parameters/InvitationToken' + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/GoogleRecaptchaResponseAlt' + - $ref: '#/components/parameters/QQRecaptchaTicket' + - $ref: '#/components/parameters/QQRecaptchaRandstr' + - $ref: '#/components/parameters/HCaptchaResponse' + - $ref: '#/components/parameters/RbaBrowserEmailTemplate' + - $ref: '#/components/parameters/RbaOneClickEmailTemplate' + - $ref: '#/components/parameters/RbaCityEmailTemplate' + - $ref: '#/components/parameters/RbaCountryEmailTemplate' + - $ref: '#/components/parameters/RbaIPEmailTemplate' + - $ref: '#/components/parameters/RbaDeviceEmailTemplate' + - $ref: '#/components/parameters/RbaOtpSMSTemplate' + - $ref: '#/components/parameters/RbaBrowserSMSTemplate' + - $ref: '#/components/parameters/RbaCitySMSTemplate' + - $ref: '#/components/parameters/RbaCountrySMSTemplate' + - $ref: '#/components/parameters/RbaIPSMSTemplate' + - $ref: '#/components/parameters/RbaDeviceSMSTemplate' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PasskeyLoginFinish' + responses: + '200': + description: Successfully finish login + content: + application/json: + schema: + $ref: '#/components/schemas/AuthResponse' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + PASS_KEY_CREDENTIAL_REQUIRED: + $ref: '#/components/examples/PASS_KEY_CREDENTIAL_REQUIRED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + CAPTCHA_NOT_VALID: + $ref: '#/components/examples/CAPTCHA_NOT_VALID' + PASSKEY_NOT_ENABLED_IN_APP: + $ref: '#/components/examples/PASSKEY_NOT_ENABLED_IN_APP' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + USER_ID_LOCKED_WITH_TIMEOUT: + $ref: '#/components/examples/USER_ID_LOCKED_WITH_TIMEOUT' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + SECURITY_QUESTION_NOT_VALID: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_VALID' + SECURITY_QUESTION_OR_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_INVALID' + SOMETHING_GOING_WRONG: + $ref: '#/components/examples/SOMETHING_GOING_WRONG' + SECURITY_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_ANSWER_INVALID' + ACCOUNT_NOT_ALLOWED_TO_LOGIN: + $ref: '#/components/examples/ACCOUNT_NOT_ALLOWED_TO_LOGIN' + PASSKEY_CONFIG_INVALID: + $ref: '#/components/examples/PASSKEY_CONFIG_INVALID' + PASSKEY_VERIFICATION_FAILED: + $ref: '#/components/examples/PASSKEY_VERIFICATION_FAILED' + PASSKEY_VERIFICATION_FAILED_FOR_BLOCK_LOCKOUT: + $ref: '#/components/examples/PASSKEY_VERIFICATION_FAILED_FOR_BLOCK_LOCKOUT' + PASSKEY_VERIFICATION_FAILED_FOR_SUSPEND_LOCKOUT: + $ref: '#/components/examples/PASSKEY_VERIFICATION_FAILED_FOR_SUSPEND_LOCKOUT' + ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/ACTIVE_SESSIONS_EXCEEDED' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + INVITATION_TOKEN_INVALID: + $ref: '#/components/examples/INVITATION_TOKEN_INVALID' + EMAIL_SEND_LIMIT_REACHED: + $ref: '#/components/examples/EMAIL_SEND_LIMIT_REACHED' + EMAIL_NOT_VERIFIED: + $ref: '#/components/examples/EMAIL_NOT_VERIFIED' + RBA_ACCOUNT_IS_BLOCKED_BY_BROWSER_RISK: + $ref: '#/components/examples/RBA_ACCOUNT_IS_BLOCKED_BY_BROWSER_RISK' + RBA_ACCOUNT_IS_BLOCKED_BY_CITY_RISK: + $ref: '#/components/examples/RBA_ACCOUNT_IS_BLOCKED_BY_CITY_RISK' + RBA_ACCOUNT_IS_BLOCKED_BY_COUNTRY_RISK: + $ref: '#/components/examples/RBA_ACCOUNT_IS_BLOCKED_BY_COUNTRY_RISK' + RBA_ACCOUNT_IS_BLOCKED_BY_DEVICE_RISK: + $ref: '#/components/examples/RBA_ACCOUNT_IS_BLOCKED_BY_DEVICE_RISK' + RBA_ACCOUNT_IS_BLOCKED_BY_IP_RISK: + $ref: '#/components/examples/RBA_ACCOUNT_IS_BLOCKED_BY_IP_RISK' + RBA_EMAIL_VERIFICATION_BY_BROWSER_RISK: + $ref: '#/components/examples/RBA_EMAIL_VERIFICATION_BY_BROWSER_RISK' + RBA_EMAIL_VERIFICATION_BY_CITY_RISK: + $ref: '#/components/examples/RBA_EMAIL_VERIFICATION_BY_CITY_RISK' + RBA_EMAIL_VERIFICATION_BY_COUNTRY_RISK: + $ref: '#/components/examples/RBA_EMAIL_VERIFICATION_BY_COUNTRY_RISK' + RBA_EMAIL_VERIFICATION_BY_DEVICE_RISK: + $ref: '#/components/examples/RBA_EMAIL_VERIFICATION_BY_DEVICE_RISK' + RBA_EMAIL_VERIFICATION_BY_IP_RISK: + $ref: '#/components/examples/RBA_EMAIL_VERIFICATION_BY_IP_RISK' + RBA_SECURITY_ANSWER_VERIFICATION_BY_BROWSER_RISK: + $ref: '#/components/examples/RBA_SECURITY_ANSWER_VERIFICATION_BY_BROWSER_RISK' + RBA_SECURITY_ANSWER_VERIFICATION_BY_CITY_RISK: + $ref: '#/components/examples/RBA_SECURITY_ANSWER_VERIFICATION_BY_CITY_RISK' + RBA_SECURITY_ANSWER_VERIFICATION_BY_COUNTRY_RISK: + $ref: '#/components/examples/RBA_SECURITY_ANSWER_VERIFICATION_BY_COUNTRY_RISK' + RBA_SECURITY_ANSWER_VERIFICATION_BY_DEVICE_RISK: + $ref: '#/components/examples/RBA_SECURITY_ANSWER_VERIFICATION_BY_DEVICE_RISK' + RBA_SMS_VERIFICATION_BY_BROWSER_RISK: + $ref: '#/components/examples/RBA_SMS_VERIFICATION_BY_BROWSER_RISK' + RBA_SMS_VERIFICATION_BY_CITY_RISK: + $ref: '#/components/examples/RBA_SMS_VERIFICATION_BY_CITY_RISK' + RBA_SMS_VERIFICATION_BY_COUNTRY_RISK: + $ref: '#/components/examples/RBA_SMS_VERIFICATION_BY_COUNTRY_RISK' + RBA_SMS_VERIFICATION_BY_DEVICE_RISK: + $ref: '#/components/examples/RBA_SMS_VERIFICATION_BY_DEVICE_RISK' + RBA_SMS_VERIFICATION_BY_IP_RISK: + $ref: '#/components/examples/RBA_SMS_VERIFICATION_BY_IP_RISK' + PIN_IS_REQUIRED: + $ref: '#/components/examples/PIN_IS_REQUIRED' + CONSENT_FORM_VALIDATION_FAILED: + $ref: '#/components/examples/CONSENT_FORM_VALIDATION_FAILED' + CONSENT_FORM_NOT_SUBMITTED: + $ref: '#/components/examples/CONSENT_FORM_NOT_SUBMITTED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + VERIFICATION_URL_IS_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_URL_IS_NOT_VALID' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + INVITATION_NOT_FOUND: + $ref: '#/components/examples/INVITATION_NOT_FOUND' + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND' + ROLE_DOES_NOT_EXISTS: + $ref: '#/components/examples/ROLE_DOES_NOT_EXISTS_PARTNER' + '500': + description: Internal Server Error - an unexpected error occurred on the server. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /identity/v2/auth/login/passkey/autofill/begin: + get: + tags: + - Login + summary: Initiate Login with Autofill Passkey + operationId: beginAutofillPasskeyLogin + description: Begins the login process using an Autofill Passkey. + responses: + '200': + description: Successfully initiated login + content: + application/json: + schema: + type: object + description: Response object returned to initiate Passkey login (WebAuthn) + properties: + LoginBeginCredential: + type: object + description: OpenAPI schema for protocol.PublicKeyCredentialRequestOptions + properties: + publicKey: + $ref: '#/components/schemas/PublicKeyCredentialRequestOptions' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + PASSKEY_NOT_ENABLED_IN_APP: + $ref: '#/components/examples/PASSKEY_NOT_ENABLED_IN_APP' + PASSKEY_AUTOFILL_NOT_ENABLED_IN_APP: + $ref: '#/components/examples/PASSKEY_AUTOFILL_NOT_ENABLED_IN_APP' + PASSKEY_CONFIG_INVALID: + $ref: '#/components/examples/PASSKEY_CONFIG_INVALID' + PASSKEY_VERIFICATION_FAILED: + $ref: '#/components/examples/PASSKEY_VERIFICATION_FAILED' + /identity/v2/auth/login/passkey/autofill/finish: + post: + tags: + - Login + summary: Complete Login with Autofill Passkey + operationId: finishAutofillPasskeyLogin + description: Completes the login process using an Autofill Passkey. + parameters: + - $ref: '#/components/parameters/LoginUrl' + - $ref: '#/components/parameters/VerificationUrl' + - $ref: '#/components/parameters/EmailTemplate' + - $ref: '#/components/parameters/InvitationToken' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/Fields' + - $ref: '#/components/parameters/Options' + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/GoogleRecaptchaResponseAlt' + - $ref: '#/components/parameters/QQRecaptchaTicket' + - $ref: '#/components/parameters/QQRecaptchaRandstr' + - $ref: '#/components/parameters/HCaptchaResponse' + - $ref: '#/components/parameters/RbaBrowserEmailTemplate' + - $ref: '#/components/parameters/RbaOneClickEmailTemplate' + - $ref: '#/components/parameters/RbaCityEmailTemplate' + - $ref: '#/components/parameters/RbaCountryEmailTemplate' + - $ref: '#/components/parameters/RbaIPEmailTemplate' + - $ref: '#/components/parameters/RbaDeviceEmailTemplate' + - $ref: '#/components/parameters/RbaOtpSMSTemplate' + - $ref: '#/components/parameters/RbaBrowserSMSTemplate' + - $ref: '#/components/parameters/RbaCitySMSTemplate' + - $ref: '#/components/parameters/RbaCountrySMSTemplate' + - $ref: '#/components/parameters/RbaIPSMSTemplate' + - $ref: '#/components/parameters/RbaDeviceSMSTemplate' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PasskeyLoginAutofillRequest' + responses: + '200': + description: Successfully finish login + content: + application/json: + schema: + $ref: '#/components/schemas/AuthResponse' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + PASS_KEY_CREDENTIAL_REQUIRED: + $ref: '#/components/examples/PASS_KEY_CREDENTIAL_REQUIRED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + CAPTCHA_NOT_VALID: + $ref: '#/components/examples/CAPTCHA_NOT_VALID' + PASSKEY_NOT_ENABLED_IN_APP: + $ref: '#/components/examples/PASSKEY_NOT_ENABLED_IN_APP' + PASSKEY_AUTOFILL_NOT_ENABLED_IN_APP: + $ref: '#/components/examples/PASSKEY_AUTOFILL_NOT_ENABLED_IN_APP' + PASSKEY_VERIFICATION_FAILED: + $ref: '#/components/examples/PASSKEY_VERIFICATION_FAILED' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + PASSKEY_NOT_CONFIGURED_IN_PROFILE: + $ref: '#/components/examples/PASSKEY_NOT_CONFIGURED_IN_PROFILE' + PASSKEY_CONFIG_INVALID: + $ref: '#/components/examples/PASSKEY_CONFIG_INVALID' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + USER_ID_LOCKED_WITH_TIMEOUT: + $ref: '#/components/examples/USER_ID_LOCKED_WITH_TIMEOUT' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + SECURITY_QUESTION_NOT_VALID: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_VALID' + SECURITY_QUESTION_OR_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_INVALID' + SOMETHING_GOING_WRONG: + $ref: '#/components/examples/SOMETHING_GOING_WRONG' + SECURITY_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_ANSWER_INVALID' + ACCOUNT_NOT_ALLOWED_TO_LOGIN: + $ref: '#/components/examples/ACCOUNT_NOT_ALLOWED_TO_LOGIN' + PASSKEY_VERIFICATION_FAILED_FOR_BLOCK_LOCKOUT: + $ref: '#/components/examples/PASSKEY_VERIFICATION_FAILED_FOR_BLOCK_LOCKOUT' + PASSKEY_VERIFICATION_FAILED_FOR_SUSPEND_LOCKOUT: + $ref: '#/components/examples/PASSKEY_VERIFICATION_FAILED_FOR_SUSPEND_LOCKOUT' + ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/ACTIVE_SESSIONS_EXCEEDED' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + INVITATION_TOKEN_INVALID: + $ref: '#/components/examples/INVITATION_TOKEN_INVALID' + EMAIL_SEND_LIMIT_REACHED: + $ref: '#/components/examples/EMAIL_SEND_LIMIT_REACHED' + EMAIL_NOT_VERIFIED: + $ref: '#/components/examples/EMAIL_NOT_VERIFIED' + RBA_ACCOUNT_IS_BLOCKED_BY_BROWSER_RISK: + $ref: '#/components/examples/RBA_ACCOUNT_IS_BLOCKED_BY_BROWSER_RISK' + RBA_ACCOUNT_IS_BLOCKED_BY_CITY_RISK: + $ref: '#/components/examples/RBA_ACCOUNT_IS_BLOCKED_BY_CITY_RISK' + RBA_ACCOUNT_IS_BLOCKED_BY_COUNTRY_RISK: + $ref: '#/components/examples/RBA_ACCOUNT_IS_BLOCKED_BY_COUNTRY_RISK' + RBA_ACCOUNT_IS_BLOCKED_BY_DEVICE_RISK: + $ref: '#/components/examples/RBA_ACCOUNT_IS_BLOCKED_BY_DEVICE_RISK' + RBA_ACCOUNT_IS_BLOCKED_BY_IP_RISK: + $ref: '#/components/examples/RBA_ACCOUNT_IS_BLOCKED_BY_IP_RISK' + RBA_EMAIL_VERIFICATION_BY_BROWSER_RISK: + $ref: '#/components/examples/RBA_EMAIL_VERIFICATION_BY_BROWSER_RISK' + RBA_EMAIL_VERIFICATION_BY_CITY_RISK: + $ref: '#/components/examples/RBA_EMAIL_VERIFICATION_BY_CITY_RISK' + RBA_EMAIL_VERIFICATION_BY_COUNTRY_RISK: + $ref: '#/components/examples/RBA_EMAIL_VERIFICATION_BY_COUNTRY_RISK' + RBA_EMAIL_VERIFICATION_BY_DEVICE_RISK: + $ref: '#/components/examples/RBA_EMAIL_VERIFICATION_BY_DEVICE_RISK' + RBA_EMAIL_VERIFICATION_BY_IP_RISK: + $ref: '#/components/examples/RBA_EMAIL_VERIFICATION_BY_IP_RISK' + RBA_SECURITY_ANSWER_VERIFICATION_BY_BROWSER_RISK: + $ref: '#/components/examples/RBA_SECURITY_ANSWER_VERIFICATION_BY_BROWSER_RISK' + RBA_SECURITY_ANSWER_VERIFICATION_BY_CITY_RISK: + $ref: '#/components/examples/RBA_SECURITY_ANSWER_VERIFICATION_BY_CITY_RISK' + RBA_SECURITY_ANSWER_VERIFICATION_BY_COUNTRY_RISK: + $ref: '#/components/examples/RBA_SECURITY_ANSWER_VERIFICATION_BY_COUNTRY_RISK' + RBA_SECURITY_ANSWER_VERIFICATION_BY_DEVICE_RISK: + $ref: '#/components/examples/RBA_SECURITY_ANSWER_VERIFICATION_BY_DEVICE_RISK' + RBA_SMS_VERIFICATION_BY_BROWSER_RISK: + $ref: '#/components/examples/RBA_SMS_VERIFICATION_BY_BROWSER_RISK' + RBA_SMS_VERIFICATION_BY_CITY_RISK: + $ref: '#/components/examples/RBA_SMS_VERIFICATION_BY_CITY_RISK' + RBA_SMS_VERIFICATION_BY_COUNTRY_RISK: + $ref: '#/components/examples/RBA_SMS_VERIFICATION_BY_COUNTRY_RISK' + RBA_SMS_VERIFICATION_BY_DEVICE_RISK: + $ref: '#/components/examples/RBA_SMS_VERIFICATION_BY_DEVICE_RISK' + RBA_SMS_VERIFICATION_BY_IP_RISK: + $ref: '#/components/examples/RBA_SMS_VERIFICATION_BY_IP_RISK' + PIN_IS_REQUIRED: + $ref: '#/components/examples/PIN_IS_REQUIRED' + CONSENT_FORM_VALIDATION_FAILED: + $ref: '#/components/examples/CONSENT_FORM_VALIDATION_FAILED' + CONSENT_FORM_NOT_SUBMITTED: + $ref: '#/components/examples/CONSENT_FORM_NOT_SUBMITTED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + VERIFICATION_URL_IS_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_URL_IS_NOT_VALID' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + INVITATION_NOT_FOUND: + $ref: '#/components/examples/INVITATION_NOT_FOUND' + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND' + ROLE_DOES_NOT_EXISTS: + $ref: '#/components/examples/ROLE_DOES_NOT_EXISTS_PARTNER' + '500': + description: Internal Server Error - an unexpected error occurred on the server. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /identity/v2/auth/login/2fa/register/passkey/begin: + get: + tags: + - Security + summary: Begin Passkey Registration with MFA Token + operationId: beginMFAPasskeyRegistration + description: Begins the MFA Passkey registration flow. + parameters: + - $ref: '#/components/parameters/SecondFactorToken' + responses: + '200': + description: Successfully initiated credential registration + content: + application/json: + schema: + type: object + description: Response object returned to initiate Passkey registration (WebAuthn) + properties: + RegisterBeginCredential: + type: object + description: Container for the WebAuthn registration initiation data + properties: + publicKey: + $ref: '#/components/schemas/PublicKeyCredentialCreationOptions' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + SECOND_FACTOR_AUTH_TOKEN_REQUIRED: + $ref: '#/components/examples/SECOND_FACTOR_AUTH_TOKEN_REQUIRED' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID' + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_PASSKEY_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_PASSKEY_AUTHENTICATION_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + PASSKEY_ONLY_SUPPORT_EMAIL: + $ref: '#/components/examples/PASSKEY_ONLY_SUPPORT_EMAIL' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + PASSKEY_CONFIG_INVALID: + $ref: '#/components/examples/PASSKEY_CONFIG_INVALID' + PASSKEY_VERIFICATION_FAILED: + $ref: '#/components/examples/PASSKEY_VERIFICATION_FAILED' + security: + - APIKey: [] + /identity/v2/auth/login/2fa/register/passkey/finish: + post: + tags: + - Security + summary: Complete Passkey registration + operationId: finishMFAPasskeyRegistration + description: Completes the MFA Passkey registration process using the provided MFA token. + parameters: + - $ref: '#/components/parameters/SecondFactorToken' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/Fields' + - $ref: '#/components/parameters/RbaBrowserEmailTemplate' + - $ref: '#/components/parameters/RbaOneClickEmailTemplate' + - $ref: '#/components/parameters/RbaCityEmailTemplate' + - $ref: '#/components/parameters/RbaCountryEmailTemplate' + - $ref: '#/components/parameters/RbaIPEmailTemplate' + - $ref: '#/components/parameters/RbaDeviceEmailTemplate' + - $ref: '#/components/parameters/RbaOtpSMSTemplate' + - $ref: '#/components/parameters/RbaBrowserSMSTemplate' + - $ref: '#/components/parameters/RbaCitySMSTemplate' + - $ref: '#/components/parameters/RbaCountrySMSTemplate' + - $ref: '#/components/parameters/RbaIPSMSTemplate' + - $ref: '#/components/parameters/RbaDeviceSMSTemplate' + requestBody: + required: true + content: + application/json: + schema: + type: object + description: Passkey Credentials to finish Passkey registration (WebAuthn) + properties: + PasskeyCredential: + $ref: '#/components/schemas/PasskeyCredentialCreationResponse' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/AuthResponse' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + SECOND_FACTOR_AUTH_TOKEN_REQUIRED: + $ref: '#/components/examples/SECOND_FACTOR_AUTH_TOKEN_REQUIRED' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + PASS_KEY_CREDENTIAL_REQUIRED: + $ref: '#/components/examples/PASS_KEY_CREDENTIAL_REQUIRED' + INVALID_INVITATION_ID_ACCEPTED: + $ref: '#/components/examples/INVALID_INVITATION_ID_ACCEPTED' + INVALID_INVITATION_ID_EXPIRED: + $ref: '#/components/examples/INVALID_INVITATION_ID_EXPIRED' + INVALID_INVITATION_ID_REVOKED: + $ref: '#/components/examples/INVALID_INVITATION_ID_REVOKED' + INVITATION_TOKEN_INVALID: + $ref: '#/components/examples/INVITATION_TOKEN_INVALID' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID' + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_PASSKEY_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_PASSKEY_AUTHENTICATION_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + PASSKEY_ONLY_SUPPORT_EMAIL: + $ref: '#/components/examples/PASSKEY_ONLY_SUPPORT_EMAIL' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + USER_ID_LOCKED_WITH_TIMEOUT: + $ref: '#/components/examples/USER_ID_LOCKED_WITH_TIMEOUT' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + LOGIN_IS_LOCKED_FOR_MFA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_MFA' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + PASSKEY_CONFIG_INVALID: + $ref: '#/components/examples/PASSKEY_CONFIG_INVALID' + PASS_KEY_CREDENTIAL_REQUIRED: + $ref: '#/components/examples/PASS_KEY_CREDENTIAL_REQUIRED' + PASSKEY_VERIFICATION_FAILED: + $ref: '#/components/examples/PASSKEY_VERIFICATION_FAILED' + CONSENT_FORM_VALIDATION_FAILED: + $ref: '#/components/examples/CONSENT_FORM_VALIDATION_FAILED' + CONSENT_FORM_NOT_SUBMITTED: + $ref: '#/components/examples/CONSENT_FORM_NOT_SUBMITTED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + '404': + description: Not Found - the requested resource does not exist. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + INVITATION_NOT_FOUND: + $ref: '#/components/examples/INVITATION_NOT_FOUND' + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND' + ROLE_DOES_NOT_EXISTS: + $ref: '#/components/examples/ROLE_DOES_NOT_EXISTS_PARTNER' + '500': + description: Internal Server Error - an unexpected error occurred on the server. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - APIKey: [] + /identity/v2/auth/login/2fa/passkey/begin: + get: + tags: + - Security + summary: Begin Passkey Login with MFA Token + operationId: beginPasskeyMFAVerification + description: Begins the MFA Passkey verification flow. + parameters: + - $ref: '#/components/parameters/SecondFactorToken' + responses: + '200': + description: Successfully initiated login + content: + application/json: + schema: + type: object + description: Response object returned to initiate Passkey login (WebAuthn) + properties: + LoginBeginCredential: + type: object + description: Container for the WebAuthn login initiation data + properties: + publicKey: + $ref: '#/components/schemas/PublicKeyCredentialRequestOptions' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + SECOND_FACTOR_AUTH_TOKEN_REQUIRED: + $ref: '#/components/examples/SECOND_FACTOR_AUTH_TOKEN_REQUIRED' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID' + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_PASSKEY_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_PASSKEY_AUTHENTICATION_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + PASSKEY_ONLY_SUPPORT_EMAIL: + $ref: '#/components/examples/PASSKEY_ONLY_SUPPORT_EMAIL' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + TWO_FACTOR_PASSKEY_NOT_CONFIGURED_ON_PROFILE: + $ref: '#/components/examples/TWO_FACTOR_PASSKEY_NOT_CONFIGURED_ON_PROFILE' + ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/ACTIVE_SESSIONS_EXCEEDED' + PASSKEY_CONFIG_INVALID: + $ref: '#/components/examples/PASSKEY_CONFIG_INVALID' + PASSKEY_VERIFICATION_FAILED: + $ref: '#/components/examples/PASSKEY_VERIFICATION_FAILED' + security: + - APIKey: [] + /identity/v2/auth/login/2fa/passkey/finish: + post: + tags: + - Security + summary: Complete Passkey Login with MFA Token + operationId: finishPasskeyMFAVerification + description: Completes the MFA Passkey verification flow. + parameters: + - $ref: '#/components/parameters/SecondFactorToken' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/Fields' + - $ref: '#/components/parameters/RbaBrowserEmailTemplate' + - $ref: '#/components/parameters/RbaOneClickEmailTemplate' + - $ref: '#/components/parameters/RbaCityEmailTemplate' + - $ref: '#/components/parameters/RbaCountryEmailTemplate' + - $ref: '#/components/parameters/RbaIPEmailTemplate' + - $ref: '#/components/parameters/RbaDeviceEmailTemplate' + - $ref: '#/components/parameters/RbaOtpSMSTemplate' + - $ref: '#/components/parameters/RbaBrowserSMSTemplate' + - $ref: '#/components/parameters/RbaCitySMSTemplate' + - $ref: '#/components/parameters/RbaCountrySMSTemplate' + - $ref: '#/components/parameters/RbaIPSMSTemplate' + - $ref: '#/components/parameters/RbaDeviceSMSTemplate' + requestBody: + required: true + content: + application/json: + schema: + type: object + description: Passkey Credentials to finish Passkey verify (WebAuthn) + properties: + PasskeyCredential: + $ref: '#/components/schemas/PasskeyCredentialAssertionResponse' + responses: + '200': + description: Successfully finish login + content: + application/json: + schema: + $ref: '#/components/schemas/AuthResponse' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + SECOND_FACTOR_AUTH_TOKEN_REQUIRED: + $ref: '#/components/examples/SECOND_FACTOR_AUTH_TOKEN_REQUIRED' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + PASS_KEY_CREDENTIAL_REQUIRED: + $ref: '#/components/examples/PASS_KEY_CREDENTIAL_REQUIRED' + INVALID_INVITATION_ID_ACCEPTED: + $ref: '#/components/examples/INVALID_INVITATION_ID_ACCEPTED' + INVALID_INVITATION_ID_EXPIRED: + $ref: '#/components/examples/INVALID_INVITATION_ID_EXPIRED' + INVALID_INVITATION_ID_REVOKED: + $ref: '#/components/examples/INVALID_INVITATION_ID_REVOKED' + INVITATION_TOKEN_INVALID: + $ref: '#/components/examples/INVITATION_TOKEN_INVALID' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID' + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_PASSKEY_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_PASSKEY_AUTHENTICATION_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + PASSKEY_ONLY_SUPPORT_EMAIL: + $ref: '#/components/examples/PASSKEY_ONLY_SUPPORT_EMAIL' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + TWO_FACTOR_PASSKEY_NOT_CONFIGURED_ON_PROFILE: + $ref: '#/components/examples/TWO_FACTOR_PASSKEY_NOT_CONFIGURED_ON_PROFILE' + USER_ID_LOCKED_WITH_TIMEOUT: + $ref: '#/components/examples/USER_ID_LOCKED_WITH_TIMEOUT' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + LOGIN_IS_LOCKED_FOR_MFA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_MFA' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + PASSKEY_CONFIG_INVALID: + $ref: '#/components/examples/PASSKEY_CONFIG_INVALID' + PASS_KEY_CREDENTIAL_REQUIRED: + $ref: '#/components/examples/PASS_KEY_CREDENTIAL_REQUIRED' + PASSKEY_VERIFICATION_FAILED: + $ref: '#/components/examples/PASSKEY_VERIFICATION_FAILED' + CONSENT_FORM_VALIDATION_FAILED: + $ref: '#/components/examples/CONSENT_FORM_VALIDATION_FAILED' + CONSENT_FORM_NOT_SUBMITTED: + $ref: '#/components/examples/CONSENT_FORM_NOT_SUBMITTED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + '404': + description: Not Found - the requested resource does not exist. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + INVITATION_NOT_FOUND: + $ref: '#/components/examples/INVITATION_NOT_FOUND' + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND' + ROLE_DOES_NOT_EXISTS: + $ref: '#/components/examples/ROLE_DOES_NOT_EXISTS_PARTNER' + '500': + description: Internal Server Error - an unexpected error occurred on the server. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - APIKey: [] + /identity/v2/auth/login/2fa/push: + post: + tags: + - Security + summary: Resend Push Notification + operationId: mfaResendPushNotification + description: Resends a Push Notification for Multi-Factor Authentication. + parameters: + - $ref: '#/components/parameters/SecondFactorToken' + responses: + '200': + description: Push Notification sent for verification + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedResponse' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + SECOND_FACTOR_AUTH_TOKEN_REQUIRED: + $ref: '#/components/examples/SECOND_FACTOR_AUTH_TOKEN_REQUIRED' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID' + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_Push_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_Push_AUTHENTICATION_NOT_ENABLED' + MFA_PUSH_VERIFICATION_COMPLETE: + $ref: '#/components/examples/MFA_PUSH_VERIFICATION_COMPLETE' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + TWO_FACTOR_PUSH_AUTHENTICATION_NOT_CONFIGURED_ON_PROFILE: + $ref: '#/components/examples/TWO_FACTOR_PUSH_AUTHENTICATION_NOT_CONFIGURED_ON_PROFILE' + TWO_FACTOR_AUTHENTICATION_PUSH_CONFIG_INVALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_PUSH_CONFIG_INVALID' + /identity/v2/auth/login/2fa/push/ping: + get: + tags: + - Security + summary: Check Push Notification Verification Status + operationId: pingPushVerificationStatus + description: Checks the status of Push Notification verification and returns the login response when verified. + parameters: + - $ref: '#/components/parameters/SecondFactorToken' + - $ref: '#/components/parameters/RbaBrowserEmailTemplate' + - $ref: '#/components/parameters/RbaOneClickEmailTemplate' + - $ref: '#/components/parameters/RbaCityEmailTemplate' + - $ref: '#/components/parameters/RbaCountryEmailTemplate' + - $ref: '#/components/parameters/RbaIPEmailTemplate' + - $ref: '#/components/parameters/RbaDeviceEmailTemplate' + - $ref: '#/components/parameters/RbaOtpSMSTemplate' + - $ref: '#/components/parameters/RbaBrowserSMSTemplate' + - $ref: '#/components/parameters/RbaCitySMSTemplate' + - $ref: '#/components/parameters/RbaCountrySMSTemplate' + - $ref: '#/components/parameters/RbaIPSMSTemplate' + - $ref: '#/components/parameters/RbaDeviceSMSTemplate' + responses: + '200': + description: Successfully verified and give login response + content: + application/json: + schema: + $ref: '#/components/schemas/AuthResponse' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + SECOND_FACTOR_AUTH_TOKEN_REQUIRED: + $ref: '#/components/examples/SECOND_FACTOR_AUTH_TOKEN_REQUIRED' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID' + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_Push_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_Push_AUTHENTICATION_NOT_ENABLED' + MFA_PUSH_VERIFICATION_PENDING: + $ref: '#/components/examples/MFA_PUSH_VERIFICATION_PENDING' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + TWO_FACTOR_PASSKEY_NOT_CONFIGURED_ON_PROFILE: + $ref: '#/components/examples/TWO_FACTOR_PASSKEY_NOT_CONFIGURED_ON_PROFILE' + ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/ACTIVE_SESSIONS_EXCEEDED' + LOGIN_IS_LOCKED_FOR_MFA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_MFA' + USER_ID_LOCKED_WITH_TIMEOUT: + $ref: '#/components/examples/USER_ID_LOCKED_WITH_TIMEOUT' + MFA_PUSH_VERIFICATION_DENIED: + $ref: '#/components/examples/MFA_PUSH_VERIFICATION_DENIED' + /identity/v2/auth/login/2fa/resend: + get: + summary: Resend SMS OTP with MFA Token + description: Resends the Multi-Factor Authentication OTP via SMS for login. + operationId: Resend2FAOTP + tags: + - Security + parameters: + - $ref: '#/components/parameters/SecondFactorToken' + - $ref: '#/components/parameters/IsVoiceOtp' + responses: + '200': + description: Successful MFA login or MFA challenge required + content: + application/json: + schema: + $ref: '#/components/schemas/SMSResponseData' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + SECOND_FACTOR_AUTH_TOKEN_REQUIRED: + $ref: '#/components/examples/SECOND_FACTOR_AUTH_TOKEN_REQUIRED' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID' + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED_IN_APP_CONFIG: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED_IN_APP_CONFIG' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + TWO_FACTOR_AUTHENTICATION_PHONE_NOT_VERIFIED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_PHONE_NOT_VERIFIED' + SMS_CONFIGURATION_NOT_EXISTS: + $ref: '#/components/examples/SMS_CONFIGURATION_NOT_EXISTS' + SOMETHING_GOING_WRONG: + $ref: '#/components/examples/SOMETHING_GOING_WRONG' + VOICE_SMS_CONFIGURATION_NOT_ENABLED: + $ref: '#/components/examples/VOICE_SMS_CONFIGURATION_NOT_ENABLED' + INVALID_PHONE_NUMBER: + $ref: '#/components/examples/INVALID_PHONE_NUMBER' + SMS_SEND_LIMIT_REACHED: + $ref: '#/components/examples/SMS_SEND_LIMIT_REACHED' + OTP_SEND_FAILED: + $ref: '#/components/examples/OTP_SEND_FAILED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + /identity/v2/auth/login/2fa/sms/resend: + get: + summary: Resend SMS OTP with MFA Token + description: Resends the Multi-Factor Authentication OTP via SMS for login. + operationId: Resend2faSMSOtp + tags: + - Security + parameters: + - $ref: '#/components/parameters/SecondFactorToken' + - $ref: '#/components/parameters/IsVoiceOtp' + responses: + '200': + description: Successful MFA login or MFA challenge required + content: + application/json: + schema: + $ref: '#/components/schemas/SMSResponseData' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + SECOND_FACTOR_AUTH_TOKEN_REQUIRED: + $ref: '#/components/examples/SECOND_FACTOR_AUTH_TOKEN_REQUIRED' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID' + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED_IN_APP_CONFIG: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED_IN_APP_CONFIG' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + TWO_FACTOR_AUTHENTICATION_PHONE_NOT_VERIFIED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_PHONE_NOT_VERIFIED' + SMS_CONFIGURATION_NOT_EXISTS: + $ref: '#/components/examples/SMS_CONFIGURATION_NOT_EXISTS' + SOMETHING_GOING_WRONG: + $ref: '#/components/examples/SOMETHING_GOING_WRONG' + VOICE_SMS_CONFIGURATION_NOT_ENABLED: + $ref: '#/components/examples/VOICE_SMS_CONFIGURATION_NOT_ENABLED' + INVALID_PHONE_NUMBER: + $ref: '#/components/examples/INVALID_PHONE_NUMBER' + SMS_SEND_LIMIT_REACHED: + $ref: '#/components/examples/SMS_SEND_LIMIT_REACHED' + OTP_SEND_FAILED: + $ref: '#/components/examples/OTP_SEND_FAILED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + /identity/v2/auth/login/2fa/duo: + put: + tags: + - Security + summary: Verify Duo with MFA Token + operationId: DuoAuthVerificationByMFASecondFactorToken + description: Verifies Duo authentication for a User using a second factor token. + parameters: + - $ref: '#/components/parameters/SecondFactorToken' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/Fields' + - $ref: '#/components/parameters/RbaBrowserEmailTemplate' + - $ref: '#/components/parameters/RbaOneClickEmailTemplate' + - $ref: '#/components/parameters/RbaCityEmailTemplate' + - $ref: '#/components/parameters/RbaCountryEmailTemplate' + - $ref: '#/components/parameters/RbaIPEmailTemplate' + - $ref: '#/components/parameters/RbaDeviceEmailTemplate' + - $ref: '#/components/parameters/RbaOtpSMSTemplate' + - $ref: '#/components/parameters/RbaBrowserSMSTemplate' + - $ref: '#/components/parameters/RbaCitySMSTemplate' + - $ref: '#/components/parameters/RbaCountrySMSTemplate' + - $ref: '#/components/parameters/RbaIPSMSTemplate' + - $ref: '#/components/parameters/RbaDeviceSMSTemplate' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DuoVerifyRequest' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/AuthResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + SECOND_FACTOR_AUTH_TOKEN_REQUIRED: + $ref: '#/components/examples/SECOND_FACTOR_AUTH_TOKEN_REQUIRED' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + DUO_CODE_REQUIRED: + $ref: '#/components/examples/DUO_CODE_REQUIRED' + DUO_STATE_REQUIRED: + $ref: '#/components/examples/DUO_STATE_REQUIRED' + DUO_CODE_STATE_REQUIRED: + $ref: '#/components/examples/DUO_CODE_STATE_REQUIRED' + INVALID_INVITATION_ID_ACCEPTED: + $ref: '#/components/examples/INVALID_INVITATION_ID_ACCEPTED' + INVALID_INVITATION_ID_EXPIRED: + $ref: '#/components/examples/INVALID_INVITATION_ID_EXPIRED' + INVALID_INVITATION_ID_REVOKED: + $ref: '#/components/examples/INVALID_INVITATION_ID_REVOKED' + INVITATION_TOKEN_INVALID: + $ref: '#/components/examples/INVITATION_TOKEN_INVALID' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID' + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + DUO_AUTH_NOT_ENABLED: + $ref: '#/components/examples/DUO_AUTH_NOT_ENABLED' + DUO_STATE_NOT_VALID: + $ref: '#/components/examples/DUO_STATE_NOT_VALID' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + USER_ID_LOCKED_WITH_TIMEOUT: + $ref: '#/components/examples/USER_ID_LOCKED_WITH_TIMEOUT' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + LOGIN_IS_LOCKED_FOR_MFA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_MFA' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/ACTIVE_SESSIONS_EXCEEDED' + TWO_FACTOR_AUTHENTICATION_DUO_AUTH_CONFIG_INVALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_DUO_AUTH_CONFIG_INVALID' + DUO_AUTHENTICATOR_VERIFICATION_FAILED: + $ref: '#/components/examples/DUO_AUTHENTICATOR_VERIFICATION_FAILED' + CONSENT_FORM_VALIDATION_FAILED: + $ref: '#/components/examples/CONSENT_FORM_VALIDATION_FAILED' + CONSENT_FORM_NOT_SUBMITTED: + $ref: '#/components/examples/CONSENT_FORM_NOT_SUBMITTED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + INVITATION_NOT_FOUND: + $ref: '#/components/examples/INVITATION_NOT_FOUND' + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND' + ROLE_DOES_NOT_EXISTS: + $ref: '#/components/examples/ROLE_DOES_NOT_EXISTS_PARTNER' + '500': + description: Internal Server Error - an unexpected error occurred on the server. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - APIKey: [] + /identity/v2/auth/login/2fa/backupcode: + put: + tags: + - Security + summary: Verify Backup Code with MFA Token + operationId: VerifyBackupCodeForMFALogin + description: Verifies a User's MFA backup code as a second factor during the login process, typically used when the primary MFA method is unavailable. + parameters: + - $ref: '#/components/parameters/SecondFactorToken' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/RbaBrowserEmailTemplate' + - $ref: '#/components/parameters/RbaCityEmailTemplate' + - $ref: '#/components/parameters/RbaCountryEmailTemplate' + - $ref: '#/components/parameters/RbaIPEmailTemplate' + - $ref: '#/components/parameters/RbaDeviceEmailTemplate' + - $ref: '#/components/parameters/RbaBrowserSMSTemplate' + - $ref: '#/components/parameters/RbaCitySMSTemplate' + - $ref: '#/components/parameters/RbaCountrySMSTemplate' + - $ref: '#/components/parameters/RbaIPSMSTemplate' + - $ref: '#/components/parameters/RbaDeviceSMSTemplate' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TwoFAAuthByBackupCode' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/AuthResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + SECOND_FACTOR_AUTH_TOKEN_REQUIRED: + $ref: '#/components/examples/SECOND_FACTOR_AUTH_TOKEN_REQUIRED' + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + BACKUP_CODE_REQUIRED: + $ref: '#/components/examples/BACKUP_CODE_REQUIRED' + INVALID_INVITATION_ID_ACCEPTED: + $ref: '#/components/examples/INVALID_INVITATION_ID_ACCEPTED' + INVALID_INVITATION_ID_EXPIRED: + $ref: '#/components/examples/INVALID_INVITATION_ID_EXPIRED' + INVALID_INVITATION_ID_REVOKED: + $ref: '#/components/examples/INVALID_INVITATION_ID_REVOKED' + INVITATION_TOKEN_INVALID: + $ref: '#/components/examples/INVITATION_TOKEN_INVALID' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID' + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + TWO_FACTOR_AUTHENTICATION_BACKUP_CODE_NOT_CONFIGURED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_BACKUP_CODE_NOT_CONFIGURED' + TWO_FACTOR_AUTHENTICATION_BACKUP_CODE_NOT_VALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_BACKUP_CODE_NOT_VALID' + USER_ID_LOCKED_WITH_TIMEOUT: + $ref: '#/components/examples/USER_ID_LOCKED_WITH_TIMEOUT' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + LOGIN_IS_LOCKED_FOR_MFA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_MFA' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/ACTIVE_SESSIONS_EXCEEDED' + CONSENT_FORM_VALIDATION_FAILED: + $ref: '#/components/examples/CONSENT_FORM_VALIDATION_FAILED' + CONSENT_FORM_NOT_SUBMITTED: + $ref: '#/components/examples/CONSENT_FORM_NOT_SUBMITTED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + INVITATION_NOT_FOUND: + $ref: '#/components/examples/INVITATION_NOT_FOUND' + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND' + ROLE_DOES_NOT_EXISTS: + $ref: '#/components/examples/ROLE_DOES_NOT_EXISTS_PARTNER' + '500': + description: Internal Server Error - an unexpected error occurred on the server. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /identity/v2/auth/login/2fa/email: + post: + tags: + - Security + summary: Resend Email OTP with MFA Token + operationId: ResendEmailOTPMFAToken + description: Sends the OTP to the Email if the Email OTP authenticator is enabled in the Tenant's MFA configuration. + parameters: + - $ref: '#/components/parameters/SecondFactorToken' + - $ref: '#/components/parameters/IsVoiceOtp' + - $ref: '#/components/parameters/EmailTemplate2FA' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EmailModel' + responses: + '200': + description: OTP sent successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedResponse' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + EMAIL_ID_REQUIRED: + $ref: '#/components/examples/EMAILID_REQUIRD' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + SECOND_FACTOR_AUTH_TOKEN_REQUIRED: + $ref: '#/components/examples/SECOND_FACTOR_AUTH_TOKEN_REQUIRED' + '403': + description: Forbidden - The client is not authorized to perform this action. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID' + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_EmailOTP_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_EmailOTP_AUTHENTICATION_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + Email_ID_NOT_EXISTS: + $ref: '#/components/examples/EMAIL_ID_NOT_EXISTS' + EMAIL_SEND_LIMIT_REACHED: + $ref: '#/components/examples/EMAIL_SEND_LIMIT_REACHED' + put: + tags: + - Security + summary: Verify Email OTP with MFA Token + operationId: ValidateMfaOTPByEmail + description: Logs in to a User's account during the second MFA step with an OTP sent to the Email. + parameters: + - $ref: '#/components/parameters/SecondFactorToken' + - $ref: '#/components/parameters/RbaBrowserEmailTemplate' + - $ref: '#/components/parameters/RbaCityEmailTemplate' + - $ref: '#/components/parameters/RbaCountryEmailTemplate' + - $ref: '#/components/parameters/RbaIPEmailTemplate' + - $ref: '#/components/parameters/RbaDeviceEmailTemplate' + - $ref: '#/components/parameters/RbaBrowserSMSTemplate' + - $ref: '#/components/parameters/RbaCitySMSTemplate' + - $ref: '#/components/parameters/RbaCountrySMSTemplate' + - $ref: '#/components/parameters/RbaIPSMSTemplate' + - $ref: '#/components/parameters/RbaDeviceSMSTemplate' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ReAuthModelByEmailOtp' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/AuthResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + PARAMETER_NOT_FORMATTED: + $ref: '#/components/examples/PARAMETER_NOT_FORMATTED' + EMAIL_NOT_FORMATTED: + $ref: '#/components/examples/EMAIL_NOT_FORMATTED' + OTP_NOT_FORMATTED: + $ref: '#/components/examples/OTP_NOT_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + SECOND_FACTOR_AUTH_TOKEN_REQUIRED: + $ref: '#/components/examples/SECOND_FACTOR_AUTH_TOKEN_REQUIRED' + INVITATION_ACCEPTED: + $ref: '#/components/examples/INVALID_INVITATION_ID_ACCEPTED' + INVITATION_EXPIRED: + $ref: '#/components/examples/INVALID_INVITATION_ID_EXPIRED' + INVITATION_REVOKED: + $ref: '#/components/examples/INVALID_INVITATION_ID_REVOKED' + INVITATION_TOKEN_INVALID: + $ref: '#/components/examples/INVITATION_TOKEN_INVALID' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID' + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + LOGIN_IS_LOCKED_FOR_MFA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_MFA' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/ACTIVE_SESSIONS_EXCEEDED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + USER_ID_LOCKED_WITH_TIMEOUT: + $ref: '#/components/examples/USER_ID_LOCKED_WITH_TIMEOUT' + OTP_NOT_EXISTS: + $ref: '#/components/examples/OTP_NOT_EXISTS' + CONSENT_FORM_NOT_SUBMITTED: + $ref: '#/components/examples/CONSENT_FORM_NOT_SUBMITTED' + CONSENT_FORM_VALIDATION_FAILED: + $ref: '#/components/examples/CONSENT_FORM_VALIDATION_FAILED' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + INVITATION_NOT_FOUND: + $ref: '#/components/examples/INVITATION_NOT_FOUND' + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND' + ROLE_DOES_NOT_EXISTS: + $ref: '#/components/examples/ROLE_DOES_NOT_EXISTS_PARTNER' + '500': + description: Internal Server Error - an unexpected error occurred on the server. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED' + OPERATION_FAILED_PARTNER: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /identity/v2/auth/email/sendverificationemail: + get: + tags: + - User + operationId: SendEmailVerification + summary: Send verification Email for social profile linking + description: Sends a verification Email to the unverified Email of the social profile. This is applicable only in optional verification workflows. + parameters: + - $ref: '#/components/parameters/EmailTemplate' + - $ref: '#/components/parameters/VerificationUrl' + - $ref: '#/components/parameters/ClientGuid' + - $ref: '#/components/parameters/AccessToken' + responses: + '200': + description: Email Verification request successful. + content: + application/json: + schema: + $ref: '#/components/schemas/SendEmailVerificationResponse' + '400': + description: Bad Request - Invalid parameters or missing required fields. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + CLIENT_GUID_REQUIRED: + $ref: '#/components/examples/CLIENT_GUID_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + ACCESS_TOKEN_OR_CLIENT_GUID_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_OR_CLIENT_GUID_REQUIRED' + INVALID_PROVIDER_IN_ORGANIZATION: + $ref: '#/components/examples/INVALID_PROVIDER_IN_ORGANIZATION' + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND' + SP_JWT_CONFIG_NOT_FOUND: + $ref: '#/components/examples/SP_JWT_CONFIG_NOT_FOUND' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Forbidden - Insufficient permissions to perform this action. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + CLIENT_GUID_NOT_VALID: + $ref: '#/components/examples/CLIENT_GUID_NOT_VALID' + AUTOLOGIN_LINK_ALREADY_USED: + $ref: '#/components/examples/AUTOLOGIN_LINK_ALREADY_USED' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + EMAILID_VERIFICATION_DISABLE: + $ref: '#/components/examples/EMAILID_VERIFICATION_DISABLE' + NO_CALLBACK_LOGIN_NOT_ENABLED: + $ref: '#/components/examples/NO_CALLBACK_LOGIN_NOT_ENABLED' + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + PROVIDER_NOT_CONFIGURED: + $ref: '#/components/examples/PROVIDER_NOT_CONFIGURED' + PROVIDER_NOT_SUPPORTED: + $ref: '#/components/examples/PROVIDER_NOT_SUPPORTED' + PROVIDER_NOT_VALID: + $ref: '#/components/examples/PROVIDER_NOT_VALID' + PROVIDER_SIDE_ERROR: + $ref: '#/components/examples/PROVIDER_SIDE_ERROR' + JWT_SP_TOKEN_INVALID: + $ref: '#/components/examples/JWT_SP_TOKEN_INVALID' + PROVIDER_ID_MISSING: + $ref: '#/components/examples/PROVIDER_ID_MISSING' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + EMAIL_ALLREADY_VERIFIED_TOKEN: + $ref: '#/components/examples/EMAIL_ALLREADY_VERIFIED_TOKEN' + EMAIL_SEND_LIMIT_REACHED: + $ref: '#/components/examples/EMAIL_SEND_LIMIT_REACHED' + VERIFICATION_URL_IS_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_URL_IS_NOT_VALID' + '500': + description: Internal Server Error - An unexpected error occurred. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED_PARTNER: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/account/delete: + get: + tags: + - User + summary: Delete Account by Email token or OTP + operationId: DeleteAccount + description: Deletes an Account using a delete token or OTP. + parameters: + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/DeleteToken' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/Email' + - $ref: '#/components/parameters/Otp' + responses: + '200': + description: Account deletion request successful. + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedResponse' + '400': + description: Bad Request - Invalid parameters or missing required fields. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DELETE_TOKEN_REQUIRED: + $ref: '#/components/examples/DELETE_TOKEN_REQUIRED' + EMAIL_OTP_REQUIRED: + $ref: '#/components/examples/EMAIL_OTP_REQUIRED' + EMAIL_REQUIRED: + $ref: '#/components/examples/EMAIL_REQUIRED' + OTP_REQUIRED: + $ref: '#/components/examples/OTP_REQUIRED' + OTP_OR_DELETE_TOKEN_REQUIRED: + $ref: '#/components/examples/OTP_OR_DELETE_TOKEN_REQUIRED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Status Forbidden - Insufficient permissions to perform this action. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + DELETE_TOKEN_IS_INVALID: + $ref: '#/components/examples/DELETE_TOKEN_IS_INVALID' + OTP_NOT_EXISTS: + $ref: '#/components/examples/OTP_NOT_EXISTS' + LINK_INVALID: + $ref: '#/components/examples/LINK_INVALID' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + post: + summary: Delete Account by Phone OTP + description: Deletes an Account using a Phone OTP. + operationId: DeleteAccByPhoneOTP + tags: + - User + parameters: + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/GoogleRecaptchaResponseAlt' + - $ref: '#/components/parameters/HCaptchaResponse' + - $ref: '#/components/parameters/QQCaptchaTicket' + - $ref: '#/components/parameters/QQCaptchaRandstr' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/VerifyDeleteAccountOtp' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsDeleted' + '400': + description: 'Bad Request: The request was invalid or cannot be served.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + PARAMETER_NOT_FORMATTED: + $ref: '#/components/examples/PARAMETER_NOT_FORMATTED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Status Forbidden - Insufficient permissions to perform this action. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + OTP_INVALID: + $ref: '#/components/examples/OTP_INVALID' + OTP_ALREADY_USED: + $ref: '#/components/examples/OTP_ALREADY_USED' + OTP_EXPIRED: + $ref: '#/components/examples/OTP_EXPIRED' + OTP_NOT_EXISTS: + $ref: '#/components/examples/OTP_NOT_EXISTS' + PHONE_DOES_NOT_EXIST: + $ref: '#/components/examples/PHONE_DOES_NOT_EXIST' + SECURITY_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_ANSWER_INVALID' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + security: + - APIKey: [] + BearerToken: [] + /identity/v2/auth/access_token/invalidate: + get: + tags: + - Session + summary: Invalidate Access Token + operationId: InvalidateAccessToken + description: Invalidates an active Access Token, expiring its validity. + parameters: + - $ref: '#/components/parameters/PreventRefresh' + responses: + '200': + description: Access Token invalidation request successful. + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedResponse' + '400': + description: Status Bad Request. The request was invalid or malformed. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + PREVENT_REFRESH_NOT_VALID: + $ref: '#/components/examples/PREVENT_REFRESH_NOT_VALID' + '403': + description: Status Forbidden. The request was valid, but the User does not have the necessary permissions. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/privacypolicy/history: + get: + tags: + - User + operationId: GetPrivacyPolicyHistory + summary: Retrieve Privacy Policy History + description: Returns all accepted Privacy Policies for a User using their Access Token. + parameters: + - $ref: '#/components/parameters/AccessToken' + responses: + '200': + description: Privacy Policy History retrieved successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/PrivacyPolicyHistoryResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + '403': + description: Forbidden - User does not have permission to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/username: + get: + tags: + - Login + operationId: CheckUserNameAvailability + summary: Check Username availability + description: Checks if a Username is available for registration on the platform. + parameters: + - $ref: '#/components/parameters/Username' + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/GoogleRecaptchaResponseAlt' + - $ref: '#/components/parameters/QQRecaptchaTicket' + - $ref: '#/components/parameters/QQRecaptchaRandstr' + - $ref: '#/components/parameters/HCaptchaResponse' + responses: + '200': + description: Username existence check response + content: + application/json: + schema: + type: object + properties: + IsExist: + type: boolean + description: Indicates whether the Username exists in the system. + example: + IsExist: true + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + USERNAME_REQUIRED_PARAM: + $ref: '#/components/examples/USERNAME_REQUIRED_PARAM' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + IDENTIFIER_AVAILABILITY_CHECK_DISABLED: + $ref: '#/components/examples/IDENTIFIER_AVAILABILITY_CHECK_DISABLED' + CAPTCHA_NOT_VALID: + $ref: '#/components/examples/CAPTCHA_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + put: + tags: + - User + summary: Update Username + description: Sets or changes the User's Username using the Access Token. + operationId: setorchangeusernamebyaccesstoken + parameters: + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SetUserNameRequest' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + POST_BODY_INVALID: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + USERNAME_REQUIRED_PARAM: + $ref: '#/components/examples/USERNAME_REQUIRED_PARAM' + SERVER_SIDE_VALIDATION_ERROR: + $ref: '#/components/examples/SERVER_SIDE_VALIDATION_ERROR' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + USERNAME_ALREADY_REGISTERED: + $ref: '#/components/examples/USERNAME_ALREADY_REGISTERED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/account: + get: + summary: Retrieve User + description: Retrieves User details based on the Access Token. + operationId: getAccountDetails + tags: + - User + parameters: + - $ref: '#/components/parameters/WelcomeEmailTemplate' + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + responses: + '200': + description: Successfully retrieved account details. + content: + application/json: + schema: + $ref: '#/components/schemas/IdentityResponseWithSocialWithoutLogins' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + PIN_IS_REQUIRED: + $ref: '#/components/examples/PIN_IS_REQUIRED' + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND' + SP_JWT_CONFIG_NOT_FOUND: + $ref: '#/components/examples/SP_JWT_CONFIG_NOT_FOUND' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + SOCIAL_REGISTRATION_NOT_ALLOWED: + $ref: '#/components/examples/SOCIAL_REGISTRATION_NOT_ALLOWED' + INVALID_INVITATION_ID_ACCEPTED: + $ref: '#/components/examples/INVALID_INVITATION_ID_ACCEPTED' + INVALID_INVITATION_ID_EXPIRED: + $ref: '#/components/examples/INVALID_INVITATION_ID_EXPIRED' + INVALID_INVITATION_ID_REVOKED: + $ref: '#/components/examples/INVALID_INVITATION_ID_REVOKED' + INVITATION_TOKEN_INVALID: + $ref: '#/components/examples/INVITATION_TOKEN_INVALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Forbidden - User does not have permission to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + INVALID_PROVIDER_IN_ORGANIZATION: + $ref: '#/components/examples/INVALID_PROVIDER_IN_ORGANIZATION' + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + PROVIDER_NOT_CONFIGURED: + $ref: '#/components/examples/PROVIDER_NOT_CONFIGURED' + PROVIDER_NOT_SUPPORTED: + $ref: '#/components/examples/PROVIDER_NOT_SUPPORTED' + PROVIDER_NOT_VALID: + $ref: '#/components/examples/PROVIDER_NOT_VALID' + PROVIDER_SIDE_ERROR: + $ref: '#/components/examples/PROVIDER_SIDE_ERROR' + PROVIDER_ID_MISSING: + $ref: '#/components/examples/PROVIDER_ID_MISSING' + EMAIL_DOMAIN_NOT_ALLOWED_IN_ORGANIZATION: + $ref: '#/components/examples/EMAIL_DOMAIN_NOT_ALLOWED_IN_ORGANIZATION' + AGE_UNDERAGE: + $ref: '#/components/examples/AGE_UNDERAGE' + UNVERIFIED_EXISTING_ACCOUNT_WITH_SAME_PHONE_ID: + $ref: '#/components/examples/UNVERIFIED_EXISTING_ACCOUNT_WITH_SAME_PHONE_ID' + EMAIL_NOT_VERIFIED: + $ref: '#/components/examples/EMAIL_NOT_VERIFIED' + ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/ACTIVE_SESSIONS_EXCEEDED' + EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER: + $ref: '#/components/examples/EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER' + THIS_EMAIL_ID_IS_NOT_ALLOWED_TO_REGISTER: + $ref: '#/components/examples/THIS_EMAIL_ID_IS_NOT_ALLOWED_TO_REGISTER' + SIGNUP_NOT_ALLOWED_IN_ORG: + $ref: '#/components/examples/SIGNUP_NOT_ALLOWED_IN_ORG' + SOMETHING_GOING_WRONG: + $ref: '#/components/examples/SOMETHING_GOING_WRONG' + TRIAL_PLAN_USER_LIMIT_REACHED: + $ref: '#/components/examples/TRIAL_PLAN_USER_LIMIT_REACHED' + JWT_SP_TOKEN_INVALID: + $ref: '#/components/examples/JWT_SP_TOKEN_INVALID' + CONSENT_FORM_VALIDATION_FAILED: + $ref: '#/components/examples/CONSENT_FORM_VALIDATION_FAILED' + CONSENT_FORM_NOT_SUBMITTED: + $ref: '#/components/examples/CONSENT_FORM_NOT_SUBMITTED' + AUTOLOOKUP_DOMAIN_NOT_MATCH: + $ref: '#/components/examples/AUTOLOOKUP_DOMAIN_NOT_MATCH' + UNVERIFIED_EXISTING_ACCOUNT_WITH_SAME_EMAIL_ID: + $ref: '#/components/examples/UNVERIFIED_EXISTING_ACCOUNT_WITH_SAME_EMAIL_ID' + UNVERIFIED_EXISTING_ACCOUNT_WITH_SAME_EMAIL_ID_IN_EMAIL_VERIFCATION_DISABLED: + $ref: '#/components/examples/UNVERIFIED_EXISTING_ACCOUNT_WITH_SAME_EMAIL_ID_IN_EMAIL_VERIFCATION_DISABLED' + EMAILID_ALREADY_REGISTERED: + $ref: '#/components/examples/EMAILID_ALREADY_REGISTERED' + PHONE_NO_ALREADY_REGISTERED: + $ref: '#/components/examples/PHONE_NO_ALREADY_REGISTERED' + SOCIAL_REGISTRATION_NOT_ALLOWED: + $ref: '#/components/examples/SOCIAL_REGISTRATION_NOT_ALLOWED' + '404': + description: 'Status Not Found: The requested resource could not be found.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + INVITATION_NOT_FOUND: + $ref: '#/components/examples/INVITATION_NOT_FOUND' + ROLE_DOES_NOT_EXISTS: + $ref: '#/components/examples/ROLE_DOES_NOT_EXISTS_PARTNER' + '500': + description: 'Status Internal Server Error: An unexpected error occurred.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + OPERATION_FAILED_PARTNER: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - BearerToken: [] + APIKey: [] + put: + tags: + - User + summary: Update User + description: Updates the User's account information using a valid Access Token. + operationId: updateAccountByAccessToken + parameters: + - $ref: '#/components/parameters/VerificationUrl' + - $ref: '#/components/parameters/EmailTemplate' + - $ref: '#/components/parameters/SmsTemplate' + - $ref: '#/components/parameters/NullSupport' + - $ref: '#/components/parameters/IsVoiceOtp' + - $ref: '#/components/parameters/Fields' + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/QQRecaptchaTicket' + - $ref: '#/components/parameters/QQRecaptchaRandstr' + - $ref: '#/components/parameters/HCaptchaResponse' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/AccessToken' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateByTokenResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + USERNAME_REQUIRED: + $ref: '#/components/examples/USERNAME_REQUIRED' + GENDER_INVALID: + $ref: '#/components/examples/GENDER_INVALID' + BIRTH_DATE_INVALID: + $ref: '#/components/examples/BIRTH_DATE_INVALID' + ADDRESS_TYPE_REQUIRED: + $ref: '#/components/examples/ADDRESS_TYPE_REQUIRED' + PARAMETER_NOT_FORMATTED: + $ref: '#/components/examples/PARAMETER_NOT_FORMATTED' + ADDRESS_TYPE_CAN_NOT_BE_SAME: + $ref: '#/components/examples/ADDRESS_TYPE_CAN_NOT_BE_SAME' + EMAIL_TYPE_VALUE_REQUIRED_PARAM: + $ref: '#/components/examples/EMAIL_TYPE_VALUE_REQUIRED_PARAM' + EMAIL_VALUE_REQUIRED_PARAM: + $ref: '#/components/examples/EMAIL_VALUE_REQUIRED_PARAM' + EMAIL_TYPE_REQUIRED: + $ref: '#/components/examples/EMAIL_TYPE_REQUIRED' + EMAIL_ID_CAN_NOT_BE_SAME: + $ref: '#/components/examples/EMAIL_ID_CAN_NOT_BE_SAME' + PRIMARY_EMAIL_CAN_BE_ONLY_ONE: + $ref: '#/components/examples/PRIMARY_EMAIL_CAN_BE_ONLY_ONE' + CUSTOM_FIELD_LENGTH_EXCEEDED: + $ref: '#/components/examples/CUSTOM_FIELD_LENGTH_EXCEEDED' + SERVER_SIDE_VALIDATION_ERROR: + $ref: '#/components/examples/SERVER_SIDE_VALIDATION_ERROR' + PHONE_TYPE_CAN_NOT_BE_SAME: + $ref: '#/components/examples/PHONE_TYPE_CAN_NOT_BE_SAME' + PHONE_TYPE_REQUIRED: + $ref: '#/components/examples/PHONE_TYPE_REQUIRED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: 'Status Forbidden: The server understood the request, but refuses to authorize it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + CAPTCHA_NOT_VALID: + $ref: '#/components/examples/CAPTCHA_NOT_VALID' + SECURITY_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_ANSWER_INVALID' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + EMAIL_ID_NOT_ALLOWED_TO_UPDATE: + $ref: '#/components/examples/EMAIL_ID_NOT_ALLOWED_TO_UPDATE' + EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER: + $ref: '#/components/examples/EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER' + THIS_EMAIL_ID_IS_NOT_ALLOWED_TO_REGISTER: + $ref: '#/components/examples/THIS_EMAIL_ID_IS_NOT_ALLOWED_TO_REGISTER' + CUSTOM_FIELD_NOT_VALID: + $ref: '#/components/examples/CUSTOM_FIELD_NOT_VALID' + SECURITY_QUESTION_OR_ANSWER_NOT_ENABLED: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_NOT_ENABLED' + SECURITY_QUESTION_NOT_VALID: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_VALID' + SECURITY_QUESTION_OR_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_INVALID' + PRIVACY_POLICY_NOT_ACCEPTED: + $ref: '#/components/examples/PRIVACY_POLICY_NOT_ACCEPTED' + ACTIVE_LOGIN_SESSIONS_NOT_ENABLED: + $ref: '#/components/examples/ACTIVE_LOGIN_SESSIONS_NOT_ENABLED' + AGE_UNDERAGE: + $ref: '#/components/examples/AGE_UNDERAGE' + EMAILID_ALREADY_REGISTERED: + $ref: '#/components/examples/EMAILID_ALREADY_REGISTERED' + PHONE_NO_ALREADY_REGISTERED: + $ref: '#/components/examples/PHONE_NO_ALREADY_REGISTERED' + INVALID_PHONE_NUMBER: + $ref: '#/components/examples/INVALID_PHONE_NUMBER' + SMS_CONFIGURATION_NOT_EXISTS: + $ref: '#/components/examples/SMS_CONFIGURATION_NOT_EXISTS' + VOICE_SMS_CONFIGURATION_NOT_ENABLED: + $ref: '#/components/examples/VOICE_SMS_CONFIGURATION_NOT_ENABLED' + SMS_SEND_LIMIT_REACHED: + $ref: '#/components/examples/SMS_SEND_LIMIT_REACHED' + OTP_SEND_FAILED: + $ref: '#/components/examples/OTP_SEND_FAILED' + WEAK_PASSWORD: + $ref: '#/components/examples/WEAK_PASSWORD' + BREACHED_PASSWORD: + $ref: '#/components/examples/BREACHED_PASSWORD' + PASSWORD_IN_HISTORY: + $ref: '#/components/examples/PASSWORD_IN_HISTORY' + USERNAME_ALREADY_REGISTERED: + $ref: '#/components/examples/USERNAME_ALREADY_REGISTERED' + VERIFICATION_URL_IS_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_URL_IS_NOT_VALID' + security: + - BearerToken: [] + APIKey: [] + requestBody: + required: true + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/AccessTokenInBody' + - $ref: '#/components/schemas/ProfileRequestModel' + delete: + summary: Send User deletion Email + description: Sends a confirmation Email for User deletion to the User's Email using their Access Token. + operationId: deleteAccountByAccessToken + tags: + - User + parameters: + - $ref: '#/components/parameters/EmailTemplate' + - $ref: '#/components/parameters/DeleteUrl' + - $ref: '#/components/parameters/AccessToken' + responses: + '200': + description: 'Status Ok: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsDeleteRequestAccepted' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + DELETE_URL_IS_NOT_WHITELISTED: + $ref: '#/components/examples/DELETE_URL_IS_NOT_WHITELISTED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: 'Status Forbidden: The server understood the request, but refuses to authorize it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + USER_ID_NOT_VALID: + $ref: '#/components/examples/USER_ID_NOT_VALID' + EMAIL_ID_NOT_EXIST_IN_PROFILE: + $ref: '#/components/examples/EMAIL_ID_NOT_EXIST_IN_PROFILE' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + EMAIL_SEND_LIMIT_REACHED: + $ref: '#/components/examples/EMAIL_SEND_LIMIT_REACHED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/account/otp: + get: + summary: Retrieve delete Account OTP + description: Retrieves the OTP for the specified Account to facilitate account deletion. + operationId: SendDeleteOtp + tags: + - User + parameters: + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/SmsTemplate' + - $ref: '#/components/parameters/IsVoiceOtp' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/SMSResponse' + '400': + description: 'Bad Request: The request was invalid or cannot be served.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + INVALID_PHONE_NUMBER: + $ref: '#/components/examples/INVALID_PHONE_NUMBER' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + '401': + description: 'Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + PHONE_DOES_NOT_EXIST: + $ref: '#/components/examples/PHONE_DOES_NOT_EXIST' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + SMS_CONFIGURATION_NOT_EXISTS: + $ref: '#/components/examples/SMS_CONFIGURATION_NOT_EXISTS' + VOICE_SMS_CONFIGURATION_NOT_ENABLED: + $ref: '#/components/examples/VOICE_SMS_CONFIGURATION_NOT_ENABLED' + SMS_SEND_LIMIT_REACHED: + $ref: '#/components/examples/SMS_SEND_LIMIT_REACHED' + OTP_SEND_FAILED: + $ref: '#/components/examples/OTP_SEND_FAILED' + security: + - APIKey: [] + BearerToken: [] + /identity/v2/auth/account/2fa/totp: + delete: + tags: + - Security + summary: Reset TOTP + operationId: MFAResetTotpByToken + description: Resets TOTP Authenticator configurations for an Account using an Access Token. + parameters: + - $ref: '#/components/parameters/AccessToken' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsDeleted' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + DELETE_BODY_INVALID: + $ref: '#/components/examples/DELETE_BODY_INVALID' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + INVALID_PHONE_NUMBER: + $ref: '#/components/examples/INVALID_PHONE_NUMBER' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID' + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED_IN_APP_CONFIG: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED_IN_APP_CONFIG' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_VALID_FOR_DELETE: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_VALID_FOR_DELETE' + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_ENABLED_IN_APP_CONFIG: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_ENABLED_IN_APP_CONFIG' + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_ENABLED_IN_APP_CONFIG_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_ENABLED_IN_APP_CONFIG_OLD' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_CONFIGURED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_CONFIGURED' + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_CONFIGURED_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_CONFIGURED_OLD' + TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED' + security: + - BearerToken: [] + APIKey: [] + put: + summary: Verify TOTP code + description: Validates an Authenticator Code as part of the MFA process. + tags: + - Security + operationId: Verify2faTOTPAuth + parameters: + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticatorCodeRequest' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IdentityResponseWithSocialWithoutLogins' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + AUTH_PAYLOAD_REQUIRED: + $ref: '#/components/examples/AUTH_PARAMETER_REQUIRED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_ENABLED_IN_APP_CONFIG_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_ENABLED_IN_APP_CONFIG_OLD' + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_ENABLED_IN_APP_CONFIG: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_ENABLED_IN_APP_CONFIG' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + SOMETHING_GOING_WRONG: + $ref: '#/components/examples/SOMETHING_GOING_WRONG' + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_CODE_INCORRECT: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_CODE_INCORRECT' + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_CODE_INCORRECT_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_CODE_INCORRECT_OLD' + USER_ID_LOCKED_WITH_TIMEOUT: + $ref: '#/components/examples/USER_ID_LOCKED_WITH_TIMEOUT' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/privacypolicy/accept: + get: + tags: + - User + summary: Accept Privacy Policy + description: Updates the Privacy Policy stored in a User's profile using their Access Token. + operationId: getPrivacyPolicyAcceptance + parameters: + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + responses: + '200': + description: User information along with Privacy Policy acceptance details. + content: + application/json: + schema: + $ref: '#/components/schemas/IdentityResponseWithSocialWithoutLogins' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + '403': + description: Forbidden - User does not have permission to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + PRIVACY_POLICY_NOT_AVAILABLE: + $ref: '#/components/examples/PRIVACY_POLICY_NOT_AVAILABLE' + PRIVACY_POLICY_ALREADY_ACCEPTED: + $ref: '#/components/examples/PRIVACY_POLICY_ALREADY_ACCEPTED' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/account/sendwelcomeemail: + get: + tags: + - User + summary: Send Welcome Email + description: Sends a welcome Email to the User. + operationId: sendWelcomeEmail + parameters: + - $ref: '#/components/parameters/WelcomeEmailTemplate' + - $ref: '#/components/parameters/AccessToken' + responses: + '200': + description: 'Status OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedResponse' + '400': + description: 'Status Bad Request: Invalid request parameters' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: 'Status Forbidden: Access denied' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/account/passkey: + get: + tags: + - User + summary: List registered Passkeys + description: Lists all registered Passkeys for a User with a valid Access Token. + operationId: accountListPasskey + parameters: + - $ref: '#/components/parameters/AccessToken' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/PasskeyListResponse' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + PASSKEY_NOT_ENABLED_IN_APP: + $ref: '#/components/examples/PASSKEY_NOT_ENABLED_IN_APP' + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + PASSKEY_NOT_CONFIGURED_IN_PROFILE: + $ref: '#/components/examples/PASSKEY_NOT_CONFIGURED_IN_PROFILE' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/account/passkey/{passkeyId}: + delete: + tags: + - User + summary: Remove Passkey + description: Removes a specific Passkey from the User's Account. + operationId: accountRemovePasskey + parameters: + - $ref: '#/components/parameters/passkeyId' + - $ref: '#/components/parameters/AccessToken' + responses: + '200': + description: Remove Passkey credential from account + content: + application/json: + schema: + $ref: '#/components/schemas/IsDeleted' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + PASSKEY_NOT_ENABLED_IN_APP: + $ref: '#/components/examples/PASSKEY_NOT_ENABLED_IN_APP' + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + PASSKEY_NOT_CONFIGURED_IN_PROFILE: + $ref: '#/components/examples/PASSKEY_NOT_CONFIGURED_IN_PROFILE' + INVALID_PASSKEY_ID: + $ref: '#/components/examples/INVALID_PASSKEY_ID' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/account/register/passkey/begin: + get: + tags: + - Login + summary: Begin Passkey registration + description: Initiates the Passkey registration process for an Account using an Access Token. + operationId: accountRegisterPasskeyBegin + parameters: + - $ref: '#/components/parameters/AccessToken' + responses: + '200': + description: Successfully initiated credential registration + content: + application/json: + schema: + type: object + description: Response object returned to initiate Passkey registration (WebAuthn) + properties: + RegisterBeginCredential: + type: object + description: Container for the WebAuthn registration initiation data + properties: + publicKey: + $ref: '#/components/schemas/PublicKeyCredentialCreationOptions' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + PASSKEY_NOT_ENABLED_IN_APP: + $ref: '#/components/examples/PASSKEY_NOT_ENABLED_IN_APP' + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + PASSKEY_ONLY_SUPPORT_EMAIL: + $ref: '#/components/examples/PASSKEY_ONLY_SUPPORT_EMAIL' + PASSKEY_CONFIG_INVALID: + $ref: '#/components/examples/PASSKEY_CONFIG_INVALID' + PASSKEY_VERIFICATION_FAILED: + $ref: '#/components/examples/PASSKEY_VERIFICATION_FAILED' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/account/register/passkey/finish: + post: + tags: + - Login + summary: Complete Passkey registration + description: Completes the Passkey registration process for an Account using an Access Token. + operationId: accountRegisterPasskeyFinish + parameters: + - $ref: '#/components/parameters/AccessToken' + requestBody: + required: true + content: + application/json: + schema: + type: object + description: Passkey Credentials to finish Passkey registration (WebAuthn) + properties: + PasskeyCredential: + $ref: '#/components/schemas/PasskeyCredentialCreationResponse' + responses: + '200': + description: Successfully finished credential registration + content: + application/json: + schema: + $ref: '#/components/schemas/PasskeyListResponse' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + PASS_KEY_CREDENTIAL_REQUIRED: + $ref: '#/components/examples/PASS_KEY_CREDENTIAL_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + PASSKEY_NOT_ENABLED_IN_APP: + $ref: '#/components/examples/PASSKEY_NOT_ENABLED_IN_APP' + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + PASSKEY_CONFIG_INVALID: + $ref: '#/components/examples/PASSKEY_CONFIG_INVALID' + PASSKEY_VERIFICATION_FAILED: + $ref: '#/components/examples/PASSKEY_VERIFICATION_FAILED' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/account/2fa/register/passkey/begin: + get: + tags: + - Security + summary: Begin MFA Passkey registration + description: Initiates the MFA Passkey registration flow for an Account. + operationId: accountRegisterMFAPasskeyBegin + parameters: + - $ref: '#/components/parameters/AccessToken' + responses: + '200': + description: Successfully initiated credential registration + content: + application/json: + schema: + type: object + description: Response object returned to initiate Passkey registration (WebAuthn) + properties: + RegisterBeginCredential: + type: object + description: Container for the WebAuthn registration initiation data + properties: + publicKey: + $ref: '#/components/schemas/PublicKeyCredentialCreationOptions' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_PASSKEY_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_PASSKEY_AUTHENTICATION_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + PASSKEY_ONLY_SUPPORT_EMAIL: + $ref: '#/components/examples/PASSKEY_ONLY_SUPPORT_EMAIL' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + PASSKEY_CONFIG_INVALID: + $ref: '#/components/examples/PASSKEY_CONFIG_INVALID' + PASSKEY_VERIFICATION_FAILED: + $ref: '#/components/examples/PASSKEY_VERIFICATION_FAILED' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/account/2fa/register/passkey/finish: + post: + tags: + - Security + summary: Complete MFA Passkey registration + description: Completes the MFA Passkey registration flow for an Account. + operationId: accountRegisterMFAPasskeyFinish + parameters: + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - PasskeyCredential + description: Passkey Credentials to finish Passkey registration (WebAuthn) + properties: + PasskeyCredential: + $ref: '#/components/schemas/PasskeyCredentialCreationResponse' + responses: + '200': + description: Successfully finished credential registration + content: + application/json: + schema: + $ref: '#/components/schemas/PasskeyCredentialObject' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + PASS_KEY_CREDENTIAL_REQUIRED: + $ref: '#/components/examples/PASS_KEY_CREDENTIAL_REQUIRED' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_PASSKEY_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_PASSKEY_AUTHENTICATION_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + PASSKEY_ONLY_SUPPORT_EMAIL: + $ref: '#/components/examples/PASSKEY_ONLY_SUPPORT_EMAIL' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + PASSKEY_CONFIG_INVALID: + $ref: '#/components/examples/PASSKEY_CONFIG_INVALID' + PASSKEY_VERIFICATION_FAILED: + $ref: '#/components/examples/PASSKEY_VERIFICATION_FAILED' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/account/2fa/passkey: + delete: + tags: + - Security + summary: Reset Passkey Authenticator + description: Resets the Passkey Authenticator settings for the specified User. + operationId: ResetMFAPasskeyByAccessToken + parameters: + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsDeleted' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_PASSKEY_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_PASSKEY_AUTHENTICATION_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + TWO_FACTOR_PASSKEY_NOT_CONFIGURED_ON_PROFILE: + $ref: '#/components/examples/TWO_FACTOR_PASSKEY_NOT_CONFIGURED_ON_PROFILE' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/account/2fa/duo: + delete: + tags: + - Security + summary: Reset Duo Authenticator + description: Resets the Duo Authenticator settings for a User with MFA enabled, allowing reconfiguration or recovery of Duo access. + operationId: ResetDuoAuthViaAccessToken + parameters: + - $ref: '#/components/parameters/AccessToken' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsDeleted' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + DUO_AUTH_NOT_ENABLED: + $ref: '#/components/examples/DUO_AUTH_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + TWO_FACTOR_DUO_AUTHENTICATOR_NOT_CONFIGURED_ON_PROFILE: + $ref: '#/components/examples/TWO_FACTOR_DUO_AUTHENTICATOR_NOT_CONFIGURED_ON_PROFILE' + security: + - BearerToken: [] + APIKey: [] + put: + tags: + - Security + summary: Verify Duo authentication + operationId: DuoAuthenticationVerificationByAccessToken + description: Verifies Duo authentication for a User using an Access Token, typically after initial authentication. + parameters: + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/Fields' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DuoVerifyRequest' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/Profile' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + POST_BODY_INVALID: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + DUO_CODE_REQUIRED: + $ref: '#/components/examples/DUO_CODE_REQUIRED' + DUO_STATE_REQUIRED: + $ref: '#/components/examples/DUO_STATE_REQUIRED' + DUO_CODE_STATE_REQUIRED: + $ref: '#/components/examples/DUO_CODE_STATE_REQUIRED' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + DUO_AUTH_NOT_ENABLED: + $ref: '#/components/examples/DUO_AUTH_NOT_ENABLED' + DUO_STATE_NOT_VALID: + $ref: '#/components/examples/DUO_STATE_NOT_VALID' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + DUO_AUTHENTICATOR_VERIFICATION_FAILED: + $ref: '#/components/examples/DUO_AUTHENTICATOR_VERIFICATION_FAILED' + TWO_FACTOR_AUTHENTICATION_DUO_AUTH_CONFIG_INVALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_DUO_AUTH_CONFIG_INVALID' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + LOGIN_IS_LOCKED_FOR_MFA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_MFA' + USER_ID_LOCKED_WITH_TIMEOUT: + $ref: '#/components/examples/USER_ID_LOCKED_WITH_TIMEOUT' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/account/2fa/backupcode: + get: + tags: + - Security + summary: Generate backup codes + description: Generates a set of backup codes for a User with MFA enabled. Returns an error if backup codes already exist. + operationId: mfaGenerateBackupCodes + parameters: + - $ref: '#/components/parameters/AccessToken' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/MFABackUpCodeResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_ON_PROFILE: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_ON_PROFILE' + TWO_FACTOR_AUTHENTICATION_BACKUP_CODE_ALREADY_CONFIGURED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_BACKUP_CODE_ALREADY_CONFIGURED' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/account/2fa/backupcode/reset: + get: + tags: + - Security + summary: Reset backup codes + description: Resets backup codes for a User with MFA enabled, allowing regeneration of backup codes. + operationId: mfaResetBackupCodes + parameters: + - $ref: '#/components/parameters/AccessToken' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/MFABackUpCodeResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_ON_PROFILE: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_ON_PROFILE' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/account/reauth/otp/email: + get: + summary: Send Email OTP + description: Sends a One-Time Password (OTP) to the User's Email for re-authentication. + operationId: SendReAuthEmailOtp + tags: + - Security + parameters: + - $ref: '#/components/parameters/EmailId' + - $ref: '#/components/parameters/EmailTemplate' + - $ref: '#/components/parameters/AccessToken' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + EVENT_BASED_TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/EVENT_BASED_TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + EMAIL_ID_NOT_EXISTS: + $ref: '#/components/examples/EMAIL_ID_NOT_EXISTS' + EMAIL_ID_NOT_EXIST_IN_PROFILE: + $ref: '#/components/examples/EMAIL_ID_NOT_EXIST_IN_PROFILE' + EMAIL_SEND_LIMIT_REACHED: + $ref: '#/components/examples/EMAIL_SEND_LIMIT_REACHED' + security: + - BearerToken: [] + APIKey: [] + put: + summary: Verify Email OTP + description: Validates the One-Time Password (OTP) sent to the User's Email during re-authentication. + operationId: ValidateEmailOtpForReauth + tags: + - Security + parameters: + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ReAuthModelByEmailOtp' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/ReAuthResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + OTP_PAYLOAD_REQUIRED: + $ref: '#/components/examples/OTP_PAYLOAD_REQUIRED' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: 'Forbidden: The server understood the request, but refuses to authorize it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + EVENT_BASED_TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/EVENT_BASED_TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + EMAIL_ID_NOT_EXISTS: + $ref: '#/components/examples/EMAIL_ID_NOT_EXISTS' + EMAIL_ID_NOT_EXIST_IN_PROFILE: + $ref: '#/components/examples/EMAIL_ID_NOT_EXIST_IN_PROFILE' + USER_ID_LOCKED_WITH_TIMEOUT: + $ref: '#/components/examples/USER_ID_LOCKED_WITH_TIMEOUT' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + OTP_NOT_EXISTS: + $ref: '#/components/examples/OTP_NOT_EXISTS' + OTP_INVALID: + $ref: '#/components/examples/OTP_INVALID' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/passkey/forgot: + post: + tags: + - Login + summary: Initiate Forgot Passkey + operationId: PasskeyForgot + description: Initiates the forgot Passkey process for a User. + parameters: + - $ref: '#/components/parameters/ResetPasskeyUrl' + - $ref: '#/components/parameters/EmailTemplate' + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/GoogleRecaptchaResponseAlt' + - $ref: '#/components/parameters/QQRecaptchaTicket' + - $ref: '#/components/parameters/QQRecaptchaRandstr' + - $ref: '#/components/parameters/HCaptchaResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PasskeyForgot' + responses: + '200': + description: Successfully submit request to reset the Passkey + content: + application/json: + schema: + type: object + properties: + IsPosted: + type: boolean + description: Indicates if the request was successfully posted. + example: true + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + EMAIL_REQUIRED_PARAM: + $ref: '#/components/examples/EMAIL_REQUIRED_PARAM' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + CAPTCHA_NOT_VALID: + $ref: '#/components/examples/CAPTCHA_NOT_VALID' + PASSKEY_NOT_ENABLED_IN_APP: + $ref: '#/components/examples/PASSKEY_NOT_ENABLED_IN_APP' + RESET_PASSKEY_URL_INVALID: + $ref: '#/components/examples/RESET_PASSKEY_URL_INVALID' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + EMAIL_SEND_LIMIT_REACHED: + $ref: '#/components/examples/EMAIL_SEND_LIMIT_REACHED' + /identity/v2/auth/passkey/reset/begin: + get: + tags: + - Login + summary: Begin Passkey Reset + operationId: beginPasskeyReset + description: Begins the reset Passkey process for a User. + parameters: + - $ref: '#/components/parameters/VToken' + responses: + '200': + description: Successfully initiated Passkey reset + content: + application/json: + schema: + type: object + description: Response object returned to initiate new Passkey registration (WebAuthn) + properties: + RegisterBeginCredential: + type: object + description: Container for the WebAuthn registration initiation data + properties: + publicKey: + $ref: '#/components/schemas/PublicKeyCredentialCreationOptions' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + VERIFICATION_TOKEN_REQUIRED: + $ref: '#/components/examples/VERIFICATION_TOKEN_REQUIRED' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + PASSKEY_NOT_ENABLED_IN_APP: + $ref: '#/components/examples/PASSKEY_NOT_ENABLED_IN_APP' + VERIFICATION_VTOKEN_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_VTOKEN_NOT_VALID' + LINK_EXPIRED: + $ref: '#/components/examples/LINK_EXPIRED' + LINK_ALREADY_VERIFIED: + $ref: '#/components/examples/LINK_ALREADY_VERIFIED' + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + PASSKEY_ONLY_SUPPORT_EMAIL: + $ref: '#/components/examples/PASSKEY_ONLY_SUPPORT_EMAIL' + PASSKEY_CONFIG_INVALID: + $ref: '#/components/examples/PASSKEY_CONFIG_INVALID' + PASSKEY_VERIFICATION_FAILED: + $ref: '#/components/examples/PASSKEY_VERIFICATION_FAILED' + /identity/v2/auth/passkey/reset/finish: + post: + tags: + - Login + summary: Complete Passkey Reset + operationId: finishPasskeyReset + description: Completes the reset Passkey process for a User. + parameters: + - $ref: '#/components/parameters/VToken' + requestBody: + required: true + content: + application/json: + schema: + type: object + description: Passkey Credentials to finish Passkey registration (WebAuthn) + properties: + PasskeyCredential: + $ref: '#/components/schemas/PasskeyCredentialCreationResponse' + responses: + '200': + description: Successfully finish reset Passkey process + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedResponse' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + VERIFICATION_TOKEN_REQUIRED: + $ref: '#/components/examples/VERIFICATION_TOKEN_REQUIRED' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + PASS_KEY_CREDENTIAL_REQUIRED: + $ref: '#/components/examples/PASS_KEY_CREDENTIAL_REQUIRED' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + VERIFICATION_VTOKEN_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_VTOKEN_NOT_VALID' + PASSKEY_NOT_ENABLED_IN_APP: + $ref: '#/components/examples/PASSKEY_NOT_ENABLED_IN_APP' + LINK_EXPIRED: + $ref: '#/components/examples/LINK_EXPIRED' + LINK_ALREADY_VERIFIED: + $ref: '#/components/examples/LINK_ALREADY_VERIFIED' + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + PASSKEY_ONLY_SUPPORT_EMAIL: + $ref: '#/components/examples/PASSKEY_ONLY_SUPPORT_EMAIL' + PASSKEY_CONFIG_INVALID: + $ref: '#/components/examples/PASSKEY_CONFIG_INVALID' + PASSKEY_VERIFICATION_FAILED: + $ref: '#/components/examples/PASSKEY_VERIFICATION_FAILED' + /identity/v2/auth/access_token/validate: + get: + summary: Validate Access Token + tags: + - Session + description: Validates an Access Token, returning its expiry if valid, or an error if invalid. + operationId: AuthValidateAccessToken + parameters: + - $ref: '#/components/parameters/AccessToken' + responses: + '200': + description: 'Status OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/AccessTokenResponse' + '400': + description: 'Status Bad Request: Invalid request parameters' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + '403': + description: 'Status Forbidden: Access denied' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/access_token: + get: + summary: Retrieve Access Token information + tags: + - Session + description: Obtains detailed information about the provided Access Token. + operationId: GetAccessTokenInfo + responses: + '200': + description: 'Status OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/AccessTokenInfo' + '400': + description: 'Status Bad Request: Invalid request parameters' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + '403': + description: 'Status Forbidden: Access denied' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/account/unlock: + put: + tags: + - User + summary: Unlock User + description: Unlocks a User's Account with a valid Access Token after successfully passing Bot Protection challenges. + operationId: unlockaccountbyaccesstoken + parameters: + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/QQRecaptchaTicket' + - $ref: '#/components/parameters/QQRecaptchaRandstr' + - $ref: '#/components/parameters/HCaptchaResponse' + requestBody: + $ref: '#/components/requestBodies/UnlockAccountRequest' + responses: + '200': + description: 'Status OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Request Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + ACCOUNT_ALREADY_UNLOCKED: + $ref: '#/components/examples/ACCOUNT_ALREADY_UNLOCKED' + CAPTCHA_IS_NOT_VALID: + $ref: '#/components/examples/CAPTCHA_IS_NOT_VALID' + SECURITY_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_ANSWER_INVALID' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + SECURITY_QUESTION_NOT_VALID: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_VALID' + SECURITY_QUESTION_OR_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_INVALID' + SOMETHING_GOING_WRONG: + $ref: '#/components/examples/SOMETHING_GOING_WRONG' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/socialidentity: + delete: + tags: + - User + summary: Unlink social identities + description: Unlinks a social provider account from the specified Account using Access Tokens, removing it from the database. + operationId: unlinkSocialIdentitiesByAccessToken + parameters: + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UnlinkSocialIdentityRequest' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/IsDeleted' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + DELETE_BODY_INVALID: + $ref: '#/components/examples/DELETE_BODY_INVALID' + PROVIDER_IS_REQUIRED: + $ref: '#/components/examples/PROVIDER_IS_REQUIRED' + PROVIDER_ID_IS_REQUIRED: + $ref: '#/components/examples/PROVIDER_ID_IS_REQUIRED' + '403': + description: 'Status Forbidden: The server understood the request, but refuses to authorize it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + ENDPOINT_NOT_SUPPORTED_BY_PROVIDER: + $ref: '#/components/examples/ENDPOINT_NOT_SUPPORTED_BY_PROVIDER' + ACCOUNT_LINKING_DISABLED: + $ref: '#/components/examples/ACCOUNT_LINKING_DISABLED' + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + SAME_ACCOUNT_CANT_BE_UNLINKED: + $ref: '#/components/examples/SAME_ACCOUNT_CANT_BE_UNLINKED' + ACCOUNT_IS_NOT_LINKED_WITH_ANY_ACCOUNT: + $ref: '#/components/examples/ACCOUNT_IS_NOT_LINKED_WITH_ANY_ACCOUNT' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + PROVIDER_NOT_VALID: + $ref: '#/components/examples/PROVIDER_NOT_VALID' + PROVIDER_ID_NOT_LINKED_WITH_THIS_ACCOUNT: + $ref: '#/components/examples/PROVIDER_ID_NOT_LINKED_WITH_THIS_ACCOUNT' + security: + - BearerToken: [] + APIKey: [] + post: + summary: Link social identities + description: Links a social provider account to an existing Account using Access Tokens. + operationId: linkSocialIdentitiesByAccessToken + tags: + - User + parameters: + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CandidateTokenModel' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + CANDIDATE_TOKEN_REQUIRED: + $ref: '#/components/examples/CANDIDATE_TOKEN_REQUIRED' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + SP_JWT_CONFIG_NOT_FOUND: + $ref: '#/components/examples/SP_JWT_CONFIG_NOT_FOUND' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + '403': + description: 'Status Forbidden: The server understood the request, but refuses to authorize it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + ACCOUNT_LINKING_DISABLED: + $ref: '#/components/examples/ACCOUNT_LINKING_DISABLED' + SAME_PROVIDER_CANT_BE_LINKED: + $ref: '#/components/examples/SAME_PROVIDER_CANT_BE_LINKED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + CONSENT_FORM_NOT_SUBMITTED: + $ref: '#/components/examples/CONSENT_FORM_NOT_SUBMITTED' + EMAIL_NOT_VERIFIED_CAN_NOT_LINK: + $ref: '#/components/examples/EMAIL_NOT_VERIFIED_CAN_NOT_LINK' + PROVIDER_NOT_CONFIGURED: + $ref: '#/components/examples/PROVIDER_NOT_CONFIGURED' + PROVIDER_NOT_SUPPORTED: + $ref: '#/components/examples/PROVIDER_NOT_SUPPORTED' + PROVIDER_NOT_VALID: + $ref: '#/components/examples/PROVIDER_NOT_VALID' + PROVIDER_SIDE_ERROR: + $ref: '#/components/examples/PROVIDER_SIDE_ERROR' + JWT_SP_TOKEN_INVALID: + $ref: '#/components/examples/JWT_SP_TOKEN_INVALID' + PROVIDER_ID_MISSING: + $ref: '#/components/examples/PROVIDER_ID_MISSING' + AGE_UNDERAGE: + $ref: '#/components/examples/AGE_UNDERAGE' + EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER: + $ref: '#/components/examples/EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER' + THIS_EMAIL_ID_IS_NOT_ALLOWED_TO_REGISTER: + $ref: '#/components/examples/THIS_EMAIL_ID_IS_NOT_ALLOWED_TO_REGISTER' + ACCOUNT_IS_ALREADY_EXIST_WITH_SAME_EMAIL: + $ref: '#/components/examples/ACCOUNT_IS_ALREADY_EXIST_WITH_SAME_EMAIL' + SAME_ACCOUNT_CANT_BE_LINKED: + $ref: '#/components/examples/SAME_ACCOUNT_CANT_BE_LINKED' + ACCOUNT_IS_ALREADY_LINKED: + $ref: '#/components/examples/ACCOUNT_IS_ALREADY_LINKED' + EMAILID_ALREADY_REGISTERED: + $ref: '#/components/examples/EMAILID_ALREADY_REGISTERED' + UNVERIFIED_EXISTING_ACCOUNT_WITH_SAME_EMAIL_ID_IN_EMAIL_VERIFCATION_DISABLED: + $ref: '#/components/examples/UNVERIFIED_EXISTING_ACCOUNT_WITH_SAME_EMAIL_ID_IN_EMAIL_VERIFCATION_DISABLED' + UNVERIFIED_EXISTING_ACCOUNT_WITH_SAME_EMAIL_ID: + $ref: '#/components/examples/UNVERIFIED_EXISTING_ACCOUNT_WITH_SAME_EMAIL_ID' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/socialidentity/ping: + post: + summary: Link social identities via PING + description: Links a social provider account with an existing Account using the Access Token and the social provider's User Access Token. + operationId: LinkSocialIdentitiesByPing + tags: + - User + parameters: + - $ref: '#/components/parameters/AccessToken' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ClientGuidBodyModel' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + SP_JWT_CONFIG_NOT_FOUND: + $ref: '#/components/examples/SP_JWT_CONFIG_NOT_FOUND' + CLIENT_GUID_REQUIRED: + $ref: '#/components/examples/CLIENT_GUID_REQUIRED' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + '403': + description: 'Status Forbidden: The server understood the request, but refuses to authorize it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + NO_CALLBACK_LOGIN_NOT_ENABLED: + $ref: '#/components/examples/NO_CALLBACK_LOGIN_NOT_ENABLED' + CLIENT_GUID_NOT_VALID: + $ref: '#/components/examples/CLIENT_GUID_NOT_VALID' + ENDPOINT_NOT_SUPPORTED_BY_PROVIDER: + $ref: '#/components/examples/ENDPOINT_NOT_SUPPORTED_BY_PROVIDER' + AUTOLOGIN_LINK_ALREADY_USED: + $ref: '#/components/examples/AUTOLOGIN_LINK_ALREADY_USED' + ACCOUNT_LINKING_DISABLED: + $ref: '#/components/examples/ACCOUNT_LINKING_DISABLED' + SAME_PROVIDER_CANT_BE_LINKED: + $ref: '#/components/examples/SAME_PROVIDER_CANT_BE_LINKED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + CONSENT_FORM_NOT_SUBMITTED: + $ref: '#/components/examples/CONSENT_FORM_NOT_SUBMITTED' + EMAIL_NOT_VERIFIED_CAN_NOT_LINK: + $ref: '#/components/examples/EMAIL_NOT_VERIFIED_CAN_NOT_LINK' + PROVIDER_NOT_CONFIGURED: + $ref: '#/components/examples/PROVIDER_NOT_CONFIGURED' + PROVIDER_NOT_SUPPORTED: + $ref: '#/components/examples/PROVIDER_NOT_SUPPORTED' + PROVIDER_NOT_VALID: + $ref: '#/components/examples/PROVIDER_NOT_VALID' + PROVIDER_SIDE_ERROR: + $ref: '#/components/examples/PROVIDER_SIDE_ERROR' + JWT_SP_TOKEN_INVALID: + $ref: '#/components/examples/JWT_SP_TOKEN_INVALID' + PROVIDER_ID_MISSING: + $ref: '#/components/examples/PROVIDER_ID_MISSING' + AGE_UNDERAGE: + $ref: '#/components/examples/AGE_UNDERAGE' + EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER: + $ref: '#/components/examples/EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER' + THIS_EMAIL_ID_IS_NOT_ALLOWED_TO_REGISTER: + $ref: '#/components/examples/THIS_EMAIL_ID_IS_NOT_ALLOWED_TO_REGISTER' + ACCOUNT_IS_ALREADY_EXIST_WITH_SAME_EMAIL: + $ref: '#/components/examples/ACCOUNT_IS_ALREADY_EXIST_WITH_SAME_EMAIL' + SAME_ACCOUNT_CANT_BE_LINKED: + $ref: '#/components/examples/SAME_ACCOUNT_CANT_BE_LINKED' + ACCOUNT_IS_ALREADY_LINKED: + $ref: '#/components/examples/ACCOUNT_IS_ALREADY_LINKED' + EMAILID_ALREADY_REGISTERED: + $ref: '#/components/examples/EMAILID_ALREADY_REGISTERED' + UNVERIFIED_EXISTING_ACCOUNT_WITH_SAME_EMAIL_ID_IN_EMAIL_VERIFCATION_DISABLED: + $ref: '#/components/examples/UNVERIFIED_EXISTING_ACCOUNT_WITH_SAME_EMAIL_ID_IN_EMAIL_VERIFCATION_DISABLED' + UNVERIFIED_EXISTING_ACCOUNT_WITH_SAME_EMAIL_ID: + $ref: '#/components/examples/UNVERIFIED_EXISTING_ACCOUNT_WITH_SAME_EMAIL_ID' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/account/2fa/push: + delete: + tags: + - Security + summary: Reset MFA Push Notification + operationId: ResetMfaPushAuthSettings + description: Resets the MFA Push Authenticator settings for a User. + responses: + '200': + description: 'Status OK: The request has succeeded and the MFA Push Authenticator settings have been reset.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsDeleted' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: 'Status Forbidden: The server understood the request, but is refusing to fulfill it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_Push_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_Push_AUTHENTICATION_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + TWO_FACTOR_AUTHENTICATION_NOT_VALID_FOR_DELETE: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_VALID_FOR_DELETE' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD' + TWO_FACTOR_PUSH_AUTHENTICATION_NOT_CONFIGURED_ON_PROFILE: + $ref: '#/components/examples/TWO_FACTOR_PUSH_AUTHENTICATION_NOT_CONFIGURED_ON_PROFILE' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + /identity/v2/auth/account/2fa/push/ping: + get: + tags: + - Security + summary: Check push device registration status + operationId: GetMfaPushDeviceStatus + description: Checks whether a Push Notification device is registered on the User's profile for MFA, using an Access Token. + parameters: + - $ref: '#/components/parameters/AccessToken' + responses: + '200': + description: 'OK: The request was successful and a Push Notification device is registered on the profile.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsRegistered' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_Push_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_Push_AUTHENTICATION_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + TWO_FACTOR_PUSH_AUTHENTICATION_NOT_CONFIGURED_ON_PROFILE: + $ref: '#/components/examples/TWO_FACTOR_PUSH_AUTHENTICATION_NOT_CONFIGURED_ON_PROFILE' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/onetouchlogin/email: + post: + summary: Retrieve link or OTP for one-touch login + description: Initiates a one-touch login process using an Email. + operationId: OneTouchLoginByEmail + tags: + - Login + parameters: + - $ref: '#/components/parameters/RedirectUrl' + - $ref: '#/components/parameters/OneTouchLoginEmailTemplate' + - $ref: '#/components/parameters/WelcomeEmailTemplate' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/GoogleRecaptchaResponseAlt' + - $ref: '#/components/parameters/QQRecaptchaTicket' + - $ref: '#/components/parameters/QQRecaptchaRandstr' + - $ref: '#/components/parameters/HCaptchaResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OneTouchLoginByEmail' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedResponse' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + CLIENT_GUID_REQUIRED: + $ref: '#/components/examples/CLIENT_GUID_REQUIRED' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + EMAIL_REQUIRED: + $ref: '#/components/examples/EMAIL_REQUIRED' + EMAILID_REQUIRD: + $ref: '#/components/examples/EMAILID_REQUIRD' + CAPTCHA_REQUIRED: + $ref: '#/components/examples/CAPTCHA_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + CAPTCHA_IS_NOT_VALID: + $ref: '#/components/examples/CAPTCHA_IS_NOT_VALID' + NO_REGISTRATION_NOT_ENABLED: + $ref: '#/components/examples/NO_REGISTRATION_NOT_ENABLED' + EMAILID_REQUIRD: + $ref: '#/components/examples/EMAILID_REQUIRD' + TRIAL_PLAN_USER_LIMIT_REACHED: + $ref: '#/components/examples/TRIAL_PLAN_USER_LIMIT_REACHED' + EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER: + $ref: '#/components/examples/EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER' + EMAIL_ALREADY_USED: + $ref: '#/components/examples/EMAIL_ALREADY_USED' + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED' + CLIENT_GUID_MUST_BE_UNIQUE: + $ref: '#/components/examples/CLIENT_GUID_MUST_BE_UNIQUE' + EMAIL_SEND_LIMIT_REACHED: + $ref: '#/components/examples/EMAIL_SEND_LIMIT_REACHED' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + REDIRECT_URL_IS_NOT_WHITELISTED: + $ref: '#/components/examples/REDIRECT_URL_IS_NOT_WHITELISTED' + /identity/v2/auth/onetouchlogin/phone: + post: + summary: Retrieve OTP for one-touch login + description: Initiates a one-touch login process using a Phone number. + operationId: OneTouchLoginByPhone + tags: + - Login + parameters: + - $ref: '#/components/parameters/SmsTemplate' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/IsVoiceOtp' + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/GoogleRecaptchaResponseAlt' + - $ref: '#/components/parameters/QQRecaptchaTicket' + - $ref: '#/components/parameters/QQRecaptchaRandstr' + - $ref: '#/components/parameters/HCaptchaResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OneTouchLoginByPhone' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedResponse' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + PHONE_REQUIRED: + $ref: '#/components/examples/PHONE_REQUIRED' + CAPTCHA_REQUIRED: + $ref: '#/components/examples/CAPTCHA_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + INVALID_PHONE_NUMBER: + $ref: '#/components/examples/INVALID_PHONE_NUMBER' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + CAPTCHA_IS_NOT_VALID: + $ref: '#/components/examples/CAPTCHA_IS_NOT_VALID' + PHONE_NO_LOGIN_NOT_ENABLED: + $ref: '#/components/examples/PHONE_NO_LOGIN_NOT_ENABLED' + NO_REGISTRATION_NOT_ENABLED: + $ref: '#/components/examples/NO_REGISTRATION_NOT_ENABLED' + SMS_CONFIGURATION_NOT_EXISTS: + $ref: '#/components/examples/SMS_CONFIGURATION_NOT_EXISTS' + TRIAL_PLAN_USER_LIMIT_REACHED: + $ref: '#/components/examples/TRIAL_PLAN_USER_LIMIT_REACHED' + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED' + VOICE_SMS_CONFIGURATION_NOT_ENABLED: + $ref: '#/components/examples/VOICE_SMS_CONFIGURATION_NOT_ENABLED' + SMS_SEND_LIMIT_REACHED: + $ref: '#/components/examples/SMS_SEND_LIMIT_REACHED' + OTP_SEND_FAILED: + $ref: '#/components/examples/OTP_SEND_FAILED' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + /identity/v2/auth/onetouchlogin/phone/verify: + post: + summary: Verify one-touch login + description: Verifies a one-time passcode (OTP) for login without requiring User registration, including captcha validation and optional security answers. + operationId: LoginByNoRegistrationPassCode + tags: + - Login + parameters: + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/Otp' + - $ref: '#/components/parameters/SmsTemplate' + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/GoogleRecaptchaResponseAlt' + - $ref: '#/components/parameters/QQRecaptchaTicket' + - $ref: '#/components/parameters/QQRecaptchaRandstr' + - $ref: '#/components/parameters/HCaptchaResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/VerifyOtpPhoneModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedResponse' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + POST_BODY_INVALID: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + PHONE_REQUIRED: + $ref: '#/components/examples/PHONE_REQUIRED' + OTP_REQUIRED: + $ref: '#/components/examples/OTP_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + INVALID_PHONE_NUMBER: + $ref: '#/components/examples/INVALID_PHONE_NUMBER' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + PHONE_NO_LOGIN_NOT_ENABLED: + $ref: '#/components/examples/PHONE_NO_LOGIN_NOT_ENABLED' + NO_REGISTRATION_NOT_ENABLED: + $ref: '#/components/examples/NO_REGISTRATION_NOT_ENABLED' + ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/ACTIVE_SESSIONS_EXCEEDED' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + SECURITY_QUESTION_NOT_VALID: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_VALID' + SECURITY_QUESTION_OR_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_INVALID' + SOMETHING_GOING_WRONG: + $ref: '#/components/examples/SOMETHING_GOING_WRONG' + PHONE_NOT_VERIFIED: + $ref: '#/components/examples/PHONE_NOT_VERIFIED' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + OTP_NOT_EXISTS: + $ref: '#/components/examples/OTP_NOT_EXISTS' + OTP_INVALID: + $ref: '#/components/examples/OTP_INVALID' + OTP_ALREADY_USED: + $ref: '#/components/examples/OTP_ALREADY_USED' + LOGIN_IS_LOCKED_FOR_MFA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_MFA' + PASSWORD_IN_HISTORY: + $ref: '#/components/examples/PASSWORD_IN_HISTORY' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + SECURITY_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_ANSWER_INVALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + '500': + description: Internal Server Error - an unexpected error occurred on the server. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /identity/v2/auth/email/onetouchlogin: + get: + summary: Verify one-touch login by Email + description: Verifies the auto-login Email using a Verification Token. + operationId: VerifyAutoLoginEmailOneTouch + tags: + - Login + parameters: + - $ref: '#/components/parameters/Email' + - $ref: '#/components/parameters/WelcomeEmailTemplate' + - $ref: '#/components/parameters/VerificationToken' + - $ref: '#/components/parameters/VToken' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedVerified' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + VERIFICATION_TOKEN_REQUIRED: + $ref: '#/components/examples/VERIFICATION_TOKEN_REQUIRED' + EMAILID_REQUIRD: + $ref: '#/components/examples/EMAILID_REQUIRD' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + NO_REGISTRATION_NOT_ENABLED: + $ref: '#/components/examples/NO_REGISTRATION_NOT_ENABLED' + VERIFICATION_VTOKEN_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_VTOKEN_NOT_VALID' + NO_REGISTRATION_LOGIN_LINK_ALREADY_USED: + $ref: '#/components/examples/NO_REGISTRATION_LOGIN_LINK_ALREADY_USED' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/ACTIVE_SESSIONS_EXCEEDED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + /identity/v2/auth/account/reauth/pin: + put: + description: Verifies the PIN for a User using an Access Token, typically used when re-verification is required. + summary: Verify PIN + operationId: ReauthPin + tags: + - Security + parameters: + - $ref: '#/components/parameters/SmsTemplate' + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PinReauthRequest' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/ReAuthResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + '401': + description: 'Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + PIN_AUTH_WRONG: + $ref: '#/components/examples/PIN_AUTH_WRONG' + '403': + description: 'Forbidden: The server understood the request, but refuses to authorize it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + PIN_AUTH_NOT_ENABLED: + $ref: '#/components/examples/PIN_AUTH_NOT_ENABLED' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + PIN_NOT_CONFIGURED: + $ref: '#/components/examples/PIN_NOT_CONFIGURED' + EVENT_BASED_TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/EVENT_BASED_TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/account/reauth/2fa/duo: + put: + tags: + - Security + summary: Verify Duo + operationId: DuoAuthenticationReAuthVerificationByAccessToken + description: Verifies Duo authentication for a User using an Access Token, typically used when re-verification is required. + parameters: + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/AccessToken' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DuoVerifyRequest' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/ReAuthResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + POST_BODY_INVALID: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + DUO_CODE_REQUIRED: + $ref: '#/components/examples/DUO_CODE_REQUIRED' + DUO_STATE_REQUIRED: + $ref: '#/components/examples/DUO_STATE_REQUIRED' + DUO_CODE_STATE_REQUIRED: + $ref: '#/components/examples/DUO_CODE_STATE_REQUIRED' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + EVENT_BASED_TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/EVENT_BASED_TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + DUO_AUTH_NOT_ENABLED: + $ref: '#/components/examples/DUO_AUTH_NOT_ENABLED' + DUO_STATE_NOT_VALID: + $ref: '#/components/examples/DUO_STATE_NOT_VALID' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + TWO_FACTOR_DUO_AUTHENTICATOR_NOT_CONFIGURED_ON_PROFILE: + $ref: '#/components/examples/TWO_FACTOR_DUO_AUTHENTICATOR_NOT_CONFIGURED_ON_PROFILE' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + DUO_AUTHENTICATOR_VERIFICATION_FAILED: + $ref: '#/components/examples/DUO_AUTHENTICATOR_VERIFICATION_FAILED' + TWO_FACTOR_AUTHENTICATION_DUO_AUTH_CONFIG_INVALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_DUO_AUTH_CONFIG_INVALID' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + LOGIN_IS_LOCKED_FOR_MFA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_MFA' + USER_ID_LOCKED_WITH_TIMEOUT: + $ref: '#/components/examples/USER_ID_LOCKED_WITH_TIMEOUT' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/account/reauth/password: + put: + summary: Verify Password + description: Verifies the Password for a User using an Access Token, typically used when re-verification is required. + operationId: ReauthPassword + tags: + - Security + parameters: + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/SmsTemplate' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/GoogleRecaptchaResponseAlt' + - $ref: '#/components/parameters/QQRecaptchaTicket' + - $ref: '#/components/parameters/QQRecaptchaRandstr' + - $ref: '#/components/parameters/HCaptchaResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PasswordReauthRequest' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/ReAuthResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + PASSWORD_REQUIRED: + $ref: '#/components/examples/PASSWORD_REQUIRED' + '401': + description: 'Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + PASSWORD_IS_WRONG: + $ref: '#/components/examples/PASSWORD_IS_WRONG' + '403': + description: 'Forbidden: The server understood the request, but refuses to authorize it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + EVENT_BASED_TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/EVENT_BASED_TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + USER_ID_LOCKED_WITH_TIMEOUT: + $ref: '#/components/examples/USER_ID_LOCKED_WITH_TIMEOUT' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + SECURITY_QUESTION_NOT_VALID: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_VALID' + SECURITY_QUESTION_OR_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_INVALID' + SECURITY_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_ANSWER_INVALID' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/account/reauth/2fa: + get: + summary: Retrieve Step-Up Authentication settings + description: Triggers Step-Up Authentication for Multi-Factor Authentication (MFA) settings, allowing Users to verify their MFA methods. + operationId: ReauthTrigger + tags: + - Security + parameters: + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/SMSTemplate2FA' + - $ref: '#/components/parameters/DuoRedirectUri' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/TwoFactorAuthenticationSettings' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + DUO_REDIRECT_URI_REQUIRED: + $ref: '#/components/examples/DUO_REDIRECT_URI_REQUIRED' + '403': + description: 'Forbidden: The server understood the request, but refuses to authorize it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + EVENT_BASED_TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/EVENT_BASED_TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + DUO_AUTHENTICATOR_REDIRECT_URI_INVALID: + $ref: '#/components/examples/DUO_AUTHENTICATOR_REDIRECT_URI_INVALID' + DUO_AUTHENTICATOR_REDIRECT_URI_NOT_WHITELISTED: + $ref: '#/components/examples/DUO_AUTHENTICATOR_REDIRECT_URI_NOT_WHITELISTED' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + PHONE_NOT_VERIFIED: + $ref: '#/components/examples/PHONE_NOT_VERIFIED' + EMAIL_OR_PHONE_NOT_VERIFIED: + $ref: '#/components/examples/EMAIL_OR_PHONE_NOT_VERIFIED' + EMAIL_NOT_VERIFIED: + $ref: '#/components/examples/EMAIL_NOT_VERIFIED' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD_MFA: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD_MFA' + SOMETHING_GOING_WRONG: + $ref: '#/components/examples/SOMETHING_GOING_WRONG' + TWO_FACTOR_AUTHENTICATION_DUO_AUTH_CONFIG_INVALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_DUO_AUTH_CONFIG_INVALID' + SMS_CONFIGURATION_NOT_EXISTS: + $ref: '#/components/examples/SMS_CONFIGURATION_NOT_EXISTS' + '500': + description: Internal Server Error - an unexpected error occurred on the server. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/account/reauth/2fa/{type}: + put: + summary: Verify backup code or OTP + description: Validates the triggered MFA authentication flow using a backup code, OTP, or authenticator code. + operationId: ValidateReauthMFA + tags: + - Security + parameters: + - $ref: '#/components/parameters/ReAuthType' + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/GoogleRecaptchaResponseAlt' + - $ref: '#/components/parameters/QQRecaptchaTicket' + - $ref: '#/components/parameters/QQRecaptchaRandstr' + - $ref: '#/components/parameters/HCaptchaResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ReAuthTwoFAModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/ReAuthResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + BACKUP_CODE_REQUIRED: + $ref: '#/components/examples/BACKUP_CODE_REQUIRED' + OTP_REQUIRED: + $ref: '#/components/examples/OTP_REQUIRED' + GOOGLE_AUTH_CODE_REQUIRED: + $ref: '#/components/examples/GOOGLE_AUTH_CODE_REQUIRED' + AUTHENTICATOR_CODE_REQUIRED: + $ref: '#/components/examples/AUTHENTICATOR_CODE_REQUIRED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: 'Forbidden: The server understood the request, but refuses to authorize it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + EVENT_BASED_TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/EVENT_BASED_TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + USER_ID_LOCKED_WITH_TIMEOUT: + $ref: '#/components/examples/USER_ID_LOCKED_WITH_TIMEOUT' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_ENABLED_IN_APP_CONFIG: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_ENABLED_IN_APP_CONFIG' + TWO_FACTOR_AUTHENTICATION_BACKUP_CODE_NOT_VALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_BACKUP_CODE_NOT_VALID' + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_CODE_INCORRECT_OLD_MFA: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_CODE_INCORRECT_OLD_MFA' + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_CODE_INCORRECT: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_CODE_INCORRECT' + TWO_FACTOR_AUTHENTICATION_BACKUP_CODE_NOT_CONFIGURED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_BACKUP_CODE_NOT_CONFIGURED' + OTP_NOT_EXISTS: + $ref: '#/components/examples/OTP_NOT_EXISTS' + OTP_INVALID: + $ref: '#/components/examples/OTP_INVALID' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + RESOURCE_NOT_FOUND: + $ref: '#/components/examples/RESOURCE_NOT_FOUND' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/account/reauth/2fa/otp/email/verify: + put: + summary: Verify Email OTP + description: Verifies the User with Email OTP and Access Token, typically used when re-authentication via Email OTP is required. + operationId: ValidateEmailOtpForReauthMFA + tags: + - Security + parameters: + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ReAuthModelByEmailOtp' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/ReAuthResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + EMAIL_REQUIRED: + $ref: '#/components/examples/EMAIL_REQUIRED' + OTP_PAYLOAD_REQUIRED: + $ref: '#/components/examples/OTP_PAYLOAD_REQUIRED' + '403': + description: 'Forbidden: The server understood the request, but refuses to authorize it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + EVENT_BASED_TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/EVENT_BASED_TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + USER_ID_LOCKED_WITH_TIMEOUT: + $ref: '#/components/examples/USER_ID_LOCKED_WITH_TIMEOUT' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + OTP_NOT_EXISTS: + $ref: '#/components/examples/OTP_NOT_EXISTS' + OTP_INVALID: + $ref: '#/components/examples/OTP_INVALID' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/account/reauth/2fa/email: + get: + summary: Send Email OTP + description: Sends a One-Time Password (OTP) to the User's Email for re-authentication. + operationId: SendEmailOtpForReauthMFA + tags: + - Security + parameters: + - $ref: '#/components/parameters/EmailId' + - $ref: '#/components/parameters/EmailTemplate' + - $ref: '#/components/parameters/AccessToken' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + EVENT_BASED_TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/EVENT_BASED_TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + EMAIL_ID_NOT_EXISTS: + $ref: '#/components/examples/EMAIL_ID_NOT_EXISTS' + EMAIL_ID_NOT_EXIST_IN_PROFILE: + $ref: '#/components/examples/EMAIL_ID_NOT_EXIST_IN_PROFILE' + EMAIL_SEND_LIMIT_REACHED: + $ref: '#/components/examples/EMAIL_SEND_LIMIT_REACHED' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/account/reauth/2fa/securityquestionanswer/verify: + post: + summary: Verify security question answer + description: Validates the triggered MFA authentication flow using a security question answer. + operationId: ValidateSecurityQuestionReauthMFA + tags: + - Security + parameters: + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/TwoFAAuthBySecQuesAuthModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/ReAuthResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + PARAMETER_NOT_FORMATTED: + $ref: '#/components/examples/PARAMETER_NOT_FORMATTED' + SECURITY_QUES_ANS_REQUIRED: + $ref: '#/components/examples/SECURITY_QUES_ANS_REQUIRED' + '403': + description: 'Forbidden: The server understood the request, but refuses to authorize it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + EVENT_BASED_TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/EVENT_BASED_TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + USER_ID_LOCKED_WITH_TIMEOUT: + $ref: '#/components/examples/USER_ID_LOCKED_WITH_TIMEOUT' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + TWO_FACTOR_SECURITY_QUESTION_AUTHENTICATION_NOT_VERIFIED: + $ref: '#/components/examples/TWO_FACTOR_SECURITY_QUESTION_AUTHENTICATION_NOT_VERIFIED' + TWO_FACTOR_AUTHENTICATION_METHOD_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_METHOD_ENABLED' + SECURITY_QUESTION_OR_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_INVALID' + SECURITY_QUESTION_NOT_SAVED_IN_PROFILE: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_SAVED_IN_PROFILE' + SECURITY_QUESTION_NOT_VALID: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_VALID' + SECURITY_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_ANSWER_INVALID' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/email/smartlogin: + get: + summary: Verify smart login by Email + description: Verifies the auto-login Email using a Verification Token. + operationId: VerifyAutoLoginEmailSmartLogin + tags: + - Login + parameters: + - $ref: '#/components/parameters/VerificationToken' + - $ref: '#/components/parameters/VToken' + - $ref: '#/components/parameters/WelcomeEmailTemplate' + - $ref: '#/components/parameters/Email' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedVerified' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + EMAILID_REQUIRD: + $ref: '#/components/examples/EMAILID_REQUIRD' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + VERIFICATION_TOKEN_REQUIRED: + $ref: '#/components/examples/VERIFICATION_TOKEN_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + AUTOLOGIN_NOT_ENABLED: + $ref: '#/components/examples/AUTOLOGIN_NOT_ENABLED' + VERIFICATION_VTOKEN_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_VTOKEN_NOT_VALID' + AUTOLOGIN_LINK_ALREADY_USED: + $ref: '#/components/examples/AUTOLOGIN_LINK_ALREADY_USED' + AUTOLOGIN_LINK_ALREADY_VERIFIED: + $ref: '#/components/examples/AUTOLOGIN_LINK_ALREADY_VERIFIED' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/ACTIVE_SESSIONS_EXCEEDED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + /identity/v2/auth/login/smartlogin: + get: + summary: Retrieve OTP or Link for Smart Login + description: Initiates a smart login process using Email, Username, or Phone, allowing flexibility based on the User's input. + operationId: GetSmartLogin + tags: + - Login + parameters: + - $ref: '#/components/parameters/Email' + - $ref: '#/components/parameters/Username' + - $ref: '#/components/parameters/Phone' + - $ref: '#/components/parameters/ClientGuid' + - $ref: '#/components/parameters/WelcomeEmailTemplate' + - $ref: '#/components/parameters/RedirectUrl' + - $ref: '#/components/parameters/SmsTemplate' + - $ref: '#/components/parameters/IsVoiceOtp' + - $ref: '#/components/parameters/SmartLoginEmailTemplate' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedResponse' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + INVALID_PHONE_NUMBER: + $ref: '#/components/examples/INVALID_PHONE_NUMBER' + EMAIL_PHONE_USERNAME_PAYLOAD_REQUIRED: + $ref: '#/components/examples/EMAIL_PHONE_USERNAME_PAYLOAD_REQUIRED' + CLIENT_GUID_REQUIRED: + $ref: '#/components/examples/CLIENT_GUID_REQUIRED' + EMAIL_PHONE_USERNAME_AND_CLIENT_GUID_REQUIRED: + $ref: '#/components/examples/EMAIL_PHONE_USERNAME_AND_CLIENT_GUID_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + USER_NAME_AUTHENTICATION_ENABLED: + $ref: '#/components/examples/USER_NAME_AUTHENTICATION_ENABLED' + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + AUTOLOGIN_NOT_ENABLED: + $ref: '#/components/examples/AUTOLOGIN_NOT_ENABLED' + SMS_CONFIGURATION_NOT_EXISTS: + $ref: '#/components/examples/SMS_CONFIGURATION_NOT_EXISTS' + PHONE_NOT_VERIFIED: + $ref: '#/components/examples/PHONE_NOT_VERIFIED' + PHONE_NO_LOGIN_NOT_ENABLED: + $ref: '#/components/examples/PHONE_NO_LOGIN_NOT_ENABLED' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + SMS_SEND_LIMIT_REACHED: + $ref: '#/components/examples/SMS_SEND_LIMIT_REACHED' + OTP_SEND_FAILED: + $ref: '#/components/examples/OTP_SEND_FAILED' + CLIENT_GUID_MUST_BE_UNIQUE: + $ref: '#/components/examples/CLIENT_GUID_MUST_BE_UNIQUE' + EMAIL_SEND_LIMIT_REACHED: + $ref: '#/components/examples/EMAIL_SEND_LIMIT_REACHED' + VOICE_SMS_CONFIGURATION_NOT_ENABLED: + $ref: '#/components/examples/VOICE_SMS_CONFIGURATION_NOT_ENABLED' + OTP_LIMIT_REACHED: + $ref: '#/components/examples/OTP_LIMIT_REACHED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + REDIRECT_URL_IS_NOT_WHITELISTED: + $ref: '#/components/examples/REDIRECT_URL_IS_NOT_WHITELISTED' + /identity/v2/auth/login/smartlogin/ping: + get: + summary: Ping Smart Login + description: Checks in the background if the smart login is verified successfully. + operationId: PingSmartLogin + tags: + - Login + parameters: + - $ref: '#/components/parameters/ClientGuidRequired' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/AuthResponse' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + CLIENT_GUID_REQUIRED: + $ref: '#/components/examples/CLIENT_GUID_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + AUTOLOGIN_NOT_ENABLED: + $ref: '#/components/examples/AUTOLOGIN_NOT_ENABLED' + CLIENT_GUID_NOT_VALID: + $ref: '#/components/examples/CLIENT_GUID_NOT_VALID' + AUTOLOGIN_LINK_ALREADY_USED: + $ref: '#/components/examples/AUTOLOGIN_LINK_ALREADY_USED' + AUTOLOGIN_LINK_NOT_VERIFIED: + $ref: '#/components/examples/AUTOLOGIN_LINK_NOT_VERIFIED' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/ACTIVE_SESSIONS_EXCEEDED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + /identity/v2/auth/login/passwordlesslogin/email: + get: + summary: Initiate passwordless login by Email + description: Initiates a Passwordless login process using an Email or Username. This variant is login-only — the identifier must already belong to an existing User, and CAPTCHA is only required when the App configures optional CAPTCHA for this endpoint. Use the POST variant to auto-register an unknown Email with a registration profile. + operationId: PasswordlessLoginByEmail + tags: + - Login + parameters: + - $ref: '#/components/parameters/Email' + - $ref: '#/components/parameters/Username' + - $ref: '#/components/parameters/PasswordlessLoginTemplate' + - $ref: '#/components/parameters/VerificationUrl' + - $ref: '#/components/parameters/InvitationToken' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/GoogleRecaptchaResponseAlt' + - $ref: '#/components/parameters/QQRecaptchaTicket' + - $ref: '#/components/parameters/QQRecaptchaRandstr' + - $ref: '#/components/parameters/HCaptchaResponse' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedResponse' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + EMAILID_REQUIRD: + $ref: '#/components/examples/EMAILID_REQUIRD' + CAPTCHA_REQUIRED: + $ref: '#/components/examples/CAPTCHA_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + INVALID_INVITATION_ID_REVOKED: + $ref: '#/components/examples/INVALID_INVITATION_ID_REVOKED' + INVALID_INVITATION_ID_EXPIRED: + $ref: '#/components/examples/INVALID_INVITATION_ID_EXPIRED' + INVALID_INVITATION_ID_ACCEPTED: + $ref: '#/components/examples/INVALID_INVITATION_ID_ACCEPTED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + USER_NAME_AUTHENTICATION_ENABLED: + $ref: '#/components/examples/USER_NAME_AUTHENTICATION_ENABLED' + ONE_CLICK_SIGIN_NOT_ENABLED: + $ref: '#/components/examples/ONE_CLICK_SIGIN_NOT_ENABLED' + TOKEN_LIMIT_REACHED: + $ref: '#/components/examples/TOKEN_LIMIT_REACHED' + EMAIL_SEND_LIMIT_REACHED: + $ref: '#/components/examples/EMAIL_SEND_LIMIT_REACHED' + CAPTCHA_NOT_VALID: + $ref: '#/components/examples/CAPTCHA_NOT_VALID' + VERIFICATION_URL_IS_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_URL_IS_NOT_VALID' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + EMAIL_ALREADY_USED: + $ref: '#/components/examples/EMAIL_ALREADY_USED' + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + INVITATION_NOT_FOUND: + $ref: '#/components/examples/INVITATION_NOT_FOUND' + ROLE_DOES_NOT_EXISTS: + $ref: '#/components/examples/ROLE_DOES_NOT_EXISTS_PARTNER' + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND' + '500': + description: Internal Server Error - an unexpected error occurred on the server. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + post: + summary: Initiate passwordless login by Email with a registration profile + description: POST variant of passwordless login by Email. The email identifier and the full registration profile are supplied in the JSON body (same schema as /auth/register). When passwordless email auto-registration is enabled, a previously-unknown email is auto-registered with the supplied profile fields, and the request must carry a valid SOTT or CAPTCHA. This endpoint registers by email only — any PhoneId or UserName supplied in the body is ignored (not validated and not stored), and Password is not required. Sending the profile in the body (instead of query parameters) keeps PII out of URLs and logs. + operationId: PasswordlessLoginByEmailWithProfile + tags: + - Login + parameters: + - $ref: '#/components/parameters/EmailTemplate' + - $ref: '#/components/parameters/VerificationUrl' + - $ref: '#/components/parameters/InvitationToken' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/GoogleRecaptchaResponseAlt' + - $ref: '#/components/parameters/QQRecaptchaTicket' + - $ref: '#/components/parameters/QQRecaptchaRandstr' + - $ref: '#/components/parameters/HCaptchaResponse' + - $ref: '#/components/parameters/X-LoginRadius-Sott' + - $ref: '#/components/parameters/Sott' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileRequestModel' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedResponse' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + EMAILID_REQUIRD: + $ref: '#/components/examples/EMAILID_REQUIRD' + EMAIL_TYPE_REQUIRED: + $ref: '#/components/examples/EMAIL_TYPE_REQUIRED' + SOTT_OR_CAPTCHA_REQUIRED: + $ref: '#/components/examples/SOTT_OR_CAPTCHA_REQUIRED' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + INVALID_INVITATION_ID_REVOKED: + $ref: '#/components/examples/INVALID_INVITATION_ID_REVOKED' + INVALID_INVITATION_ID_EXPIRED: + $ref: '#/components/examples/INVALID_INVITATION_ID_EXPIRED' + INVALID_INVITATION_ID_ACCEPTED: + $ref: '#/components/examples/INVALID_INVITATION_ID_ACCEPTED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + ONE_CLICK_SIGIN_NOT_ENABLED: + $ref: '#/components/examples/ONE_CLICK_SIGIN_NOT_ENABLED' + CAPTCHA_NOT_VALID: + $ref: '#/components/examples/CAPTCHA_NOT_VALID' + SECURED_ONE_TIME_TOKEN_IS_INVALID: + $ref: '#/components/examples/SECURED_ONE_TIME_TOKEN_IS_INVALID' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + EMAIL_ALREADY_USED: + $ref: '#/components/examples/EMAIL_ALREADY_USED' + VERIFICATION_URL_IS_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_URL_IS_NOT_VALID' + TOKEN_LIMIT_REACHED: + $ref: '#/components/examples/TOKEN_LIMIT_REACHED' + EMAIL_SEND_LIMIT_REACHED: + $ref: '#/components/examples/EMAIL_SEND_LIMIT_REACHED' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + INVITATION_NOT_FOUND: + $ref: '#/components/examples/INVITATION_NOT_FOUND' + ROLE_DOES_NOT_EXISTS: + $ref: '#/components/examples/ROLE_DOES_NOT_EXISTS_PARTNER' + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND' + '500': + description: Internal Server Error - an unexpected error occurred on the server. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /identity/v2/auth/login/passwordlesslogin/otp: + get: + summary: Initiate passwordless login by Phone + description: 'Initiates a Passwordless login process using a Phone number — an OTP is sent to the supplied Phone number. This variant is login-only: the Phone number must already belong to an existing User, and CAPTCHA is only required when the App configures optional CAPTCHA for this endpoint. Use the POST variant to auto-register an unknown Phone number with a registration profile.' + operationId: PasswordlessLoginByPhone + tags: + - Login + parameters: + - $ref: '#/components/parameters/Phone' + - $ref: '#/components/parameters/SmsTemplate' + - $ref: '#/components/parameters/IsVoiceOtp' + - $ref: '#/components/parameters/Options' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/GoogleRecaptchaResponseAlt' + - $ref: '#/components/parameters/QQRecaptchaTicket' + - $ref: '#/components/parameters/QQRecaptchaRandstr' + - $ref: '#/components/parameters/HCaptchaResponse' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/SMSResponse' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + PHONE_REQUIRED: + $ref: '#/components/examples/PHONE_REQUIRED' + INVALID_PHONE_NUMBER: + $ref: '#/components/examples/INVALID_PHONE_NUMBER' + CAPTCHA_REQUIRED: + $ref: '#/components/examples/CAPTCHA_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + ONE_CLICK_SIGIN_NOT_ENABLED: + $ref: '#/components/examples/ONE_CLICK_SIGIN_NOT_ENABLED' + CAPTCHA_NOT_VALID: + $ref: '#/components/examples/CAPTCHA_NOT_VALID' + PHONE_NUMBER_NOT_EXISTS: + $ref: '#/components/examples/PHONE_NUMBER_NOT_EXISTS' + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED' + PHONE_NO_LOGIN_NOT_ENABLED: + $ref: '#/components/examples/PHONE_NO_LOGIN_NOT_ENABLED' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + SMS_CONFIGURATION_NOT_EXISTS: + $ref: '#/components/examples/SMS_CONFIGURATION_NOT_EXISTS' + VOICE_SMS_CONFIGURATION_NOT_ENABLED: + $ref: '#/components/examples/VOICE_SMS_CONFIGURATION_NOT_ENABLED' + SMS_SEND_LIMIT_REACHED: + $ref: '#/components/examples/SMS_SEND_LIMIT_REACHED' + OTP_SEND_FAILED: + $ref: '#/components/examples/OTP_SEND_FAILED' + OTP_LIMIT_REACHED: + $ref: '#/components/examples/OTP_LIMIT_REACHED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + '500': + description: Internal Server Error - an unexpected error occurred on the server. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + post: + summary: Initiate passwordless login by Phone with a registration profile + description: POST variant of passwordless login by Phone. The phone identifier (PhoneId) and the full registration profile are supplied in the JSON body (same schema as /auth/register). When passwordless phone auto-registration is enabled, a previously-unknown phone number is auto-registered with the supplied profile fields, and the request must carry a valid SOTT or CAPTCHA. This endpoint registers by phone only — any Email or UserName supplied in the body is ignored (not validated and not stored), and Password is not required. Sending the profile in the body (instead of query parameters) keeps PII out of URLs and logs. + operationId: PasswordlessLoginByPhoneWithProfile + tags: + - Login + parameters: + - $ref: '#/components/parameters/SmsTemplate' + - $ref: '#/components/parameters/IsVoiceOtp' + - $ref: '#/components/parameters/Options' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/GoogleRecaptchaResponseAlt' + - $ref: '#/components/parameters/QQRecaptchaTicket' + - $ref: '#/components/parameters/QQRecaptchaRandstr' + - $ref: '#/components/parameters/HCaptchaResponse' + - $ref: '#/components/parameters/X-LoginRadius-Sott' + - $ref: '#/components/parameters/Sott' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ProfileRequestModel' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/SMSResponse' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + PHONE_REQUIRED: + $ref: '#/components/examples/PHONE_REQUIRED' + INVALID_PHONE_NUMBER: + $ref: '#/components/examples/INVALID_PHONE_NUMBER' + SOTT_OR_CAPTCHA_REQUIRED: + $ref: '#/components/examples/SOTT_OR_CAPTCHA_REQUIRED' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + ONE_CLICK_SIGIN_NOT_ENABLED: + $ref: '#/components/examples/ONE_CLICK_SIGIN_NOT_ENABLED' + CAPTCHA_NOT_VALID: + $ref: '#/components/examples/CAPTCHA_NOT_VALID' + SECURED_ONE_TIME_TOKEN_IS_INVALID: + $ref: '#/components/examples/SECURED_ONE_TIME_TOKEN_IS_INVALID' + PHONE_NUMBER_NOT_EXISTS: + $ref: '#/components/examples/PHONE_NUMBER_NOT_EXISTS' + PHONE_NO_LOGIN_NOT_ENABLED: + $ref: '#/components/examples/PHONE_NO_LOGIN_NOT_ENABLED' + SMS_CONFIGURATION_NOT_EXISTS: + $ref: '#/components/examples/SMS_CONFIGURATION_NOT_EXISTS' + VOICE_SMS_CONFIGURATION_NOT_ENABLED: + $ref: '#/components/examples/VOICE_SMS_CONFIGURATION_NOT_ENABLED' + SMS_SEND_LIMIT_REACHED: + $ref: '#/components/examples/SMS_SEND_LIMIT_REACHED' + OTP_SEND_FAILED: + $ref: '#/components/examples/OTP_SEND_FAILED' + OTP_LIMIT_REACHED: + $ref: '#/components/examples/OTP_LIMIT_REACHED' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + '500': + description: Internal Server Error - an unexpected error occurred on the server. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /identity/v2/auth/login/passwordlesslogin/email/verify: + get: + summary: Verify Email for passwordless login + description: Verifies the Email using the provided Verification Token for passwordless login. + operationId: PasswordlessEmailVerification + tags: + - Login + parameters: + - $ref: '#/components/parameters/VerificationToken' + - $ref: '#/components/parameters/WelcomeEmailTemplate' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/SMSTemplate2FA' + - $ref: '#/components/parameters/DuoRedirectUri' + responses: + '200': + description: Success + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/AuthResponseRequiredMfa' + - $ref: '#/components/schemas/AuthResponseOptionalMfa' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + INVITATION_TOKEN_INVALID: + $ref: '#/components/examples/INVITATION_TOKEN_INVALID' + VERIFICATION_TOKEN_REQUIRED: + $ref: '#/components/examples/VERIFICATION_TOKEN_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + INVALID_INVITATION_ID_REVOKED: + $ref: '#/components/examples/INVALID_INVITATION_ID_REVOKED' + INVALID_INVITATION_ID_EXPIRED: + $ref: '#/components/examples/INVALID_INVITATION_ID_EXPIRED' + INVALID_INVITATION_ID_ACCEPTED: + $ref: '#/components/examples/INVALID_INVITATION_ID_ACCEPTED' + DUO_REDIRECT_URI_REQUIRED: + $ref: '#/components/examples/DUO_REDIRECT_URI_REQUIRED' + INVALID_PHONE_NUMBER: + $ref: '#/components/examples/INVALID_PHONE_NUMBER' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ONE_CLICK_SIGIN_NOT_ENABLED: + $ref: '#/components/examples/ONE_CLICK_SIGIN_NOT_ENABLED' + VERIFICATION_OTP_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_OTP_NOT_VALID' + LINK_EXPIRED: + $ref: '#/components/examples/LINK_EXPIRED' + LINK_ALREADY_USED: + $ref: '#/components/examples/LINK_ALREADY_USED' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/ACTIVE_SESSIONS_EXCEEDED' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + DUO_AUTHENTICATOR_REDIRECT_URI_INVALID: + $ref: '#/components/examples/DUO_AUTHENTICATOR_REDIRECT_URI_INVALID' + DUO_AUTHENTICATOR_REDIRECT_URI_NOT_WHITELISTED: + $ref: '#/components/examples/DUO_AUTHENTICATOR_REDIRECT_URI_NOT_WHITELISTED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD' + SOMETHING_GOING_WRONG: + $ref: '#/components/examples/SOMETHING_GOING_WRONG' + TWO_FACTOR_AUTHENTICATION_DUO_AUTH_CONFIG_INVALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_DUO_AUTH_CONFIG_INVALID' + SMS_CONFIGURATION_NOT_EXISTS: + $ref: '#/components/examples/SMS_CONFIGURATION_NOT_EXISTS' + OTP_SEND_FAILED: + $ref: '#/components/examples/OTP_SEND_FAILED' + VOICE_SMS_CONFIGURATION_NOT_ENABLED: + $ref: '#/components/examples/VOICE_SMS_CONFIGURATION_NOT_ENABLED' + SMS_SEND_LIMIT_REACHED: + $ref: '#/components/examples/SMS_SEND_LIMIT_REACHED' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + INVITATION_NOT_FOUND: + $ref: '#/components/examples/INVITATION_NOT_FOUND' + ROLE_DOES_NOT_EXISTS: + $ref: '#/components/examples/ROLE_DOES_NOT_EXISTS_PARTNER' + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND' + '500': + description: Internal Server Error - an unexpected error occurred on the server. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /identity/v2/auth/login/passwordlesslogin/otp/verify: + put: + summary: Verify Phone for passwordless login + description: Verifies the OTP sent to the Phone number for passwordless login. + operationId: PasswordlessLoginPhoneVerification + tags: + - Login + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PhoneOTPModel' + parameters: + - $ref: '#/components/parameters/SmsTemplate' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/GoogleRecaptchaResponseAlt' + - $ref: '#/components/parameters/QQRecaptchaTicket' + - $ref: '#/components/parameters/QQRecaptchaRandstr' + - $ref: '#/components/parameters/HCaptchaResponse' + - $ref: '#/components/parameters/EmailTemplate2FA' + - $ref: '#/components/parameters/DuoRedirectUri' + responses: + '200': + description: Success + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/AuthResponseRequiredMfa' + - $ref: '#/components/schemas/AuthResponseOptionalMfa' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + PHONE_NOT_BLANK: + $ref: '#/components/examples/PHONE_NOT_BLANK' + PHONE_REQUIRED: + $ref: '#/components/examples/PHONE_REQUIRED' + OTP_NOT_BLANK: + $ref: '#/components/examples/OTP_NOT_BLANK' + OTP_REQUIRED: + $ref: '#/components/examples/OTP_REQUIRED' + DUO_REDIRECT_URI_REQUIRED: + $ref: '#/components/examples/DUO_REDIRECT_URI_REQUIRED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + ONE_CLICK_SIGIN_NOT_ENABLED: + $ref: '#/components/examples/ONE_CLICK_SIGIN_NOT_ENABLED' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + PHONE_NO_LOGIN_NOT_ENABLED: + $ref: '#/components/examples/PHONE_NO_LOGIN_NOT_ENABLED' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + SECURITY_QUESTION_NOT_VALID: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_VALID' + SECURITY_QUESTION_OR_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_INVALID' + SECURITY_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_ANSWER_INVALID' + PHONE_NOT_VERIFIED: + $ref: '#/components/examples/PHONE_NOT_VERIFIED' + LINK_EXPIRED: + $ref: '#/components/examples/LINK_EXPIRED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + SOMETHING_GOING_WRONG: + $ref: '#/components/examples/SOMETHING_GOING_WRONG' + OTP_NOT_EXISTS: + $ref: '#/components/examples/OTP_NOT_EXISTS' + OTP_INVALID: + $ref: '#/components/examples/OTP_INVALID' + OTP_ALREADY_USED: + $ref: '#/components/examples/OTP_ALREADY_USED' + OTP_EXPIRED: + $ref: '#/components/examples/OTP_EXPIRED' + PASSWORD_IN_HISTORY: + $ref: '#/components/examples/PASSWORD_IN_HISTORY' + ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/ACTIVE_SESSIONS_EXCEEDED' + DUO_AUTHENTICATOR_REDIRECT_URI_INVALID: + $ref: '#/components/examples/DUO_AUTHENTICATOR_REDIRECT_URI_INVALID' + DUO_AUTHENTICATOR_REDIRECT_URI_NOT_WHITELISTED: + $ref: '#/components/examples/DUO_AUTHENTICATOR_REDIRECT_URI_NOT_WHITELISTED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD' + TWO_FACTOR_AUTHENTICATION_DUO_AUTH_CONFIG_INVALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_DUO_AUTH_CONFIG_INVALID' + EMAIL_ID_NOT_EXISTS: + $ref: '#/components/examples/EMAIL_ID_NOT_EXISTS' + EMAIL_SEND_LIMIT_REACHED: + $ref: '#/components/examples/EMAIL_SEND_LIMIT_REACHED' + '500': + description: Internal Server Error - an unexpected error occurred on the server. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /identity/v2/auth/login/passwordlesslogin/username/verifyotp: + post: + summary: Verify Username for passwordless login + description: Verifies the OTP sent to the Username for passwordless login. + operationId: PasswordlessLoginByUsernameAndOTP + tags: + - Login + parameters: + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/SMSTemplate2FA' + - $ref: '#/components/parameters/DuoRedirectUri' + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/GoogleRecaptchaResponseAlt' + - $ref: '#/components/parameters/QQRecaptchaTicket' + - $ref: '#/components/parameters/QQRecaptchaRandstr' + - $ref: '#/components/parameters/HCaptchaResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PasswordLessUserNameOTPModel' + responses: + '200': + description: Success + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/AuthResponseRequiredMfa' + - $ref: '#/components/schemas/AuthResponseOptionalMfa' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + OTP_NOT_BLANK: + $ref: '#/components/examples/OTP_NOT_BLANK' + OTP_REQUIRED: + $ref: '#/components/examples/OTP_REQUIRED' + USER_NAME_NOT_BLANK: + $ref: '#/components/examples/USER_NAME_NOT_BLANK' + USERNAME_REQUIRED_PARAM: + $ref: '#/components/examples/USERNAME_REQUIRED_PARAM' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + INVALID_INVITATION_ID_REVOKED: + $ref: '#/components/examples/INVALID_INVITATION_ID_REVOKED' + INVALID_INVITATION_ID_EXPIRED: + $ref: '#/components/examples/INVALID_INVITATION_ID_EXPIRED' + INVALID_INVITATION_ID_ACCEPTED: + $ref: '#/components/examples/INVALID_INVITATION_ID_ACCEPTED' + DUO_REDIRECT_URI_REQUIRED: + $ref: '#/components/examples/DUO_REDIRECT_URI_REQUIRED' + INVALID_PHONE_NUMBER: + $ref: '#/components/examples/INVALID_PHONE_NUMBER' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + USER_NAME_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/USER_NAME_AUTHENTICATION_NOT_ENABLED' + ONE_CLICK_SIGIN_NOT_ENABLED: + $ref: '#/components/examples/ONE_CLICK_SIGIN_NOT_ENABLED' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + SECURITY_QUESTION_NOT_VALID: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_VALID' + SECURITY_QUESTION_OR_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_INVALID' + SOMETHING_GOING_WRONG: + $ref: '#/components/examples/SOMETHING_GOING_WRONG' + ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/ACTIVE_SESSIONS_EXCEEDED' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + VERIFICATION_OTP_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_OTP_NOT_VALID' + VERIFICATION_VTOKEN_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_VTOKEN_NOT_VALID' + LINK_EXPIRED: + $ref: '#/components/examples/LINK_EXPIRED' + LINK_ALREADY_USED: + $ref: '#/components/examples/LINK_ALREADY_USED' + LOGIN_IS_LOCKED_FOR_MFA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_MFA' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + DUO_AUTHENTICATOR_REDIRECT_URI_INVALID: + $ref: '#/components/examples/DUO_AUTHENTICATOR_REDIRECT_URI_INVALID' + DUO_AUTHENTICATOR_REDIRECT_URI_NOT_WHITELISTED: + $ref: '#/components/examples/DUO_AUTHENTICATOR_REDIRECT_URI_NOT_WHITELISTED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD' + TWO_FACTOR_AUTHENTICATION_DUO_AUTH_CONFIG_INVALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_DUO_AUTH_CONFIG_INVALID' + SMS_CONFIGURATION_NOT_EXISTS: + $ref: '#/components/examples/SMS_CONFIGURATION_NOT_EXISTS' + OTP_SEND_FAILED: + $ref: '#/components/examples/OTP_SEND_FAILED' + VOICE_SMS_CONFIGURATION_NOT_ENABLED: + $ref: '#/components/examples/VOICE_SMS_CONFIGURATION_NOT_ENABLED' + SMS_SEND_LIMIT_REACHED: + $ref: '#/components/examples/SMS_SEND_LIMIT_REACHED' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + INVITATION_NOT_FOUND: + $ref: '#/components/examples/INVITATION_NOT_FOUND' + ROLE_DOES_NOT_EXISTS: + $ref: '#/components/examples/ROLE_DOES_NOT_EXISTS_PARTNER' + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND' + '500': + description: Internal Server Error - an unexpected error occurred on the server. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /identity/v2/auth/login/passwordlesslogin/email/verifyotp: + post: + summary: Verify Email and OTP for passwordless login + description: Verifies the OTP sent to the Email for passwordless login. + operationId: PasswordlessLoginByEmailAndOTP + tags: + - Login + parameters: + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/SMSTemplate2FA' + - $ref: '#/components/parameters/DuoRedirectUri' + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/GoogleRecaptchaResponseAlt' + - $ref: '#/components/parameters/QQRecaptchaTicket' + - $ref: '#/components/parameters/QQRecaptchaRandstr' + - $ref: '#/components/parameters/HCaptchaResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PasswordLessEmailOTPModel' + responses: + '200': + description: Success + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/AuthResponseRequiredMfa' + - $ref: '#/components/schemas/AuthResponseOptionalMfa' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + PARAMETER_NOT_FORMATTED: + $ref: '#/components/examples/PARAMETER_NOT_FORMATTED' + OTP_NOT_BLANK: + $ref: '#/components/examples/OTP_NOT_BLANK' + OTP_REQUIRED: + $ref: '#/components/examples/OTP_REQUIRED' + EMAIL_REQUIRED: + $ref: '#/components/examples/EMAIL_REQUIRED' + EMAIL_NOT_BLANK: + $ref: '#/components/examples/EMAIL_NOT_BLANK' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + DUO_REDIRECT_URI_REQUIRED: + $ref: '#/components/examples/DUO_REDIRECT_URI_REQUIRED' + INVALID_PHONE_NUMBER: + $ref: '#/components/examples/INVALID_PHONE_NUMBER' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + USER_NAME_AUTHENTICATION_ENABLED: + $ref: '#/components/examples/USER_NAME_AUTHENTICATION_ENABLED' + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + ONE_CLICK_SIGIN_NOT_ENABLED: + $ref: '#/components/examples/ONE_CLICK_SIGIN_NOT_ENABLED' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + SECURITY_QUESTION_NOT_VALID: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_VALID' + SECURITY_QUESTION_OR_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_INVALID' + SOMETHING_GOING_WRONG: + $ref: '#/components/examples/SOMETHING_GOING_WRONG' + SECURITY_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_ANSWER_INVALID' + ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/ACTIVE_SESSIONS_EXCEEDED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + VERIFICATION_OTP_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_OTP_NOT_VALID' + VERIFICATION_VTOKEN_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_VTOKEN_NOT_VALID' + LINK_EXPIRED: + $ref: '#/components/examples/LINK_EXPIRED' + LINK_ALREADY_USED: + $ref: '#/components/examples/LINK_ALREADY_USED' + LOGIN_IS_LOCKED_FOR_MFA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_MFA' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + DUO_AUTHENTICATOR_REDIRECT_URI_INVALID: + $ref: '#/components/examples/DUO_AUTHENTICATOR_REDIRECT_URI_INVALID' + DUO_AUTHENTICATOR_REDIRECT_URI_NOT_WHITELISTED: + $ref: '#/components/examples/DUO_AUTHENTICATOR_REDIRECT_URI_NOT_WHITELISTED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD' + TWO_FACTOR_AUTHENTICATION_DUO_AUTH_CONFIG_INVALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_DUO_AUTH_CONFIG_INVALID' + SMS_CONFIGURATION_NOT_EXISTS: + $ref: '#/components/examples/SMS_CONFIGURATION_NOT_EXISTS' + OTP_SEND_FAILED: + $ref: '#/components/examples/OTP_SEND_FAILED' + VOICE_SMS_CONFIGURATION_NOT_ENABLED: + $ref: '#/components/examples/VOICE_SMS_CONFIGURATION_NOT_ENABLED' + SMS_SEND_LIMIT_REACHED: + $ref: '#/components/examples/SMS_SEND_LIMIT_REACHED' + '404': + description: Not Found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + INVITATION_NOT_FOUND: + $ref: '#/components/examples/INVITATION_NOT_FOUND' + ROLE_DOES_NOT_EXISTS: + $ref: '#/components/examples/ROLE_DOES_NOT_EXISTS_PARTNER' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + INVITATION_TOKEN_INVALID: + $ref: '#/components/examples/INVITATION_TOKEN_INVALID' + INVALID_INVITATION_ID_REVOKED: + $ref: '#/components/examples/INVALID_INVITATION_ID_REVOKED' + INVALID_INVITATION_ID_EXPIRED: + $ref: '#/components/examples/INVALID_INVITATION_ID_EXPIRED' + INVALID_INVITATION_ID_ACCEPTED: + $ref: '#/components/examples/INVALID_INVITATION_ID_ACCEPTED' + '500': + description: Internal Server Error - an unexpected error occurred on the server. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /identity/v2/auth/login/pin: + post: + summary: Login with PIN + description: Allows Users to log in using their previously set PIN along with a valid session token. + operationId: PINLogin + tags: + - Security + parameters: + - $ref: '#/components/parameters/SessionTokenQuery' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/GoogleRecaptchaResponseAlt' + - $ref: '#/components/parameters/QQCaptchaTicket' + - $ref: '#/components/parameters/QQCaptchaRandstr' + - $ref: '#/components/parameters/HCaptchaResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PINLoginModel' + responses: + '200': + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/AuthResponse' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + PIN_REQUIRED_PARAM: + $ref: '#/components/examples/PIN_REQUIRED_PARAM' + SESSION_TOKEN_REQUIRED: + $ref: '#/components/examples/SESSION_TOKEN_REQUIRED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + PIN_AUTH_WRONG: + $ref: '#/components/examples/PIN_AUTH_WRONG' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + PIN_AUTH_SESSION_TOKEN_NOT_VALID: + $ref: '#/components/examples/PIN_AUTH_SESSION_TOKEN_NOT_VALID' + PIN_AUTH_SESSION_TOKEN_EXPIRED: + $ref: '#/components/examples/PIN_AUTH_SESSION_TOKEN_EXPIRED' + PIN_LOGIN_NOT_ENABLED: + $ref: '#/components/examples/PIN_LOGIN_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + USER_ID_LOCKED_WITH_TIMEOUT: + $ref: '#/components/examples/USER_ID_LOCKED_WITH_TIMEOUT' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/ACTIVE_SESSIONS_EXCEEDED' + PIN_NOT_CONFIGURED: + $ref: '#/components/examples/PIN_NOT_CONFIGURED' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + /identity/v2/auth/customobject: + get: + summary: Retrieve Custom Objects + description: Retrieves Custom Objects associated with the authenticated User using an Access Token. + operationId: getCustomObjectByToken + tags: + - Custom Object + parameters: + - $ref: '#/components/parameters/CustomObjectId' + - $ref: '#/components/parameters/ObjectName' + - $ref: '#/components/parameters/AccessToken' + responses: + '200': + description: Successfully retrieved Custom Objects + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectsResponseModel' + examples: + default: + $ref: '#/components/examples/CUSTOM_OBJECTS_RESPONSE_EXAMPLE' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + CUSTOM_OBJECT_NAME_REQUIRED: + $ref: '#/components/examples/CUSTOM_OBJECT_NAME_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: 'Status Forbidden: The server understood the request, but refuses to authorize it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + CUSTOM_OBJECT_NOT_CONFIGURED: + $ref: '#/components/examples/CUSTOM_OBJECT_NOT_CONFIGURED' + CUSTOM_OBJECT_NAME_NOT_VALID: + $ref: '#/components/examples/CUSTOM_OBJECT_NAME_NOT_VALID' + CUSTOM_OBJECT_RECORD_NOT_EXIST: + $ref: '#/components/examples/CUSTOM_OBJECT_RECORD_NOT_EXIST' + security: + - BearerToken: [] + APIKey: [] + post: + summary: Create Custom Object + description: Creates a Custom Object associated with the authenticated User using an Access Token. + operationId: createCustomObjectByToken + tags: + - Custom Object + parameters: + - $ref: '#/components/parameters/CustomObjectId' + - $ref: '#/components/parameters/ObjectName' + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectRequest' + responses: + '200': + description: Successfully created the Custom Object + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectResponseModel' + examples: + default: + $ref: '#/components/examples/CUSTOM_OBJECT_RESPONSE_EXAMPLE' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + CUSTOM_OBJECT_JSON_NOT_VALID: + $ref: '#/components/examples/CUSTOM_OBJECT_JSON_NOT_VALID' + CUSTOM_OBJECT_NAME_REQUIRED: + $ref: '#/components/examples/CUSTOM_OBJECT_NAME_REQUIRED' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: 'Status Forbidden: The server understood the request, but refuses to authorize it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + CUSTOM_OBJECT_NOT_CONFIGURED: + $ref: '#/components/examples/CUSTOM_OBJECT_NOT_CONFIGURED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + CUSTOM_OBJECT_NAME_NOT_VALID: + $ref: '#/components/examples/CUSTOM_OBJECT_NAME_NOT_VALID' + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/customobject/{objectrecordid}: + get: + summary: Retrieve Custom Object by ID + description: Retrieves the Custom Object associated with the specified User using an Access Token and record ID. + operationId: getCustomObjectByTokenAndRecordId + tags: + - Custom Object + parameters: + - $ref: '#/components/parameters/ObjectRecordId' + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/ObjectName' + - $ref: '#/components/parameters/CustomObjectId' + responses: + '200': + description: Successfully retrieved the Custom Object + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectResponseModel' + examples: + default: + $ref: '#/components/examples/CUSTOM_OBJECT_RESPONSE_EXAMPLE' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + CUSTOM_OBJECT_NAME_REQUIRED: + $ref: '#/components/examples/CUSTOM_OBJECT_NAME_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: 'Status Forbidden: The server understood the request, but refuses to authorize it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + CUSTOM_OBJECT_RECORD_ID_NOT_VALID: + $ref: '#/components/examples/CUSTOM_OBJECT_RECORD_ID_NOT_VALID' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + CUSTOM_OBJECT_NAME_NOT_VALID: + $ref: '#/components/examples/CUSTOM_OBJECT_NAME_NOT_VALID' + CUSTOM_OBJECT_NOT_CONFIGURED: + $ref: '#/components/examples/CUSTOM_OBJECT_NOT_CONFIGURED' + security: + - BearerToken: [] + APIKey: [] + put: + summary: Update Custom Object by ID + description: Updates a Custom Object associated with the authenticated User using an Access Token and record ID. + operationId: updateCustomObjectByTokenAndRecordId + tags: + - Custom Object + parameters: + - $ref: '#/components/parameters/ObjectRecordId' + - $ref: '#/components/parameters/ObjectName' + - $ref: '#/components/parameters/UpdateType' + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/CustomObjectId' + requestBody: + description: JSON payload representing the Custom Object to be updated. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectRequest' + responses: + '200': + description: Successfully updated the Custom Object + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectResponseModel' + examples: + default: + $ref: '#/components/examples/CUSTOM_OBJECT_RESPONSE_EXAMPLE' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + CUSTOM_OBJECT_JSON_NOT_VALID: + $ref: '#/components/examples/CUSTOM_OBJECT_JSON_NOT_VALID' + CUSTOM_OBJECT_NAME_REQUIRED: + $ref: '#/components/examples/CUSTOM_OBJECT_NAME_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: 'Status Forbidden: The server understood the request, but refuses to authorize it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + CUSTOM_OBJECT_RECORD_ID_NOT_VALID: + $ref: '#/components/examples/CUSTOM_OBJECT_RECORD_ID_NOT_VALID' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + CUSTOM_OBJECT_NOT_CONFIGURED: + $ref: '#/components/examples/CUSTOM_OBJECT_NOT_CONFIGURED' + CUSTOM_OBJECT_NAME_NOT_VALID: + $ref: '#/components/examples/CUSTOM_OBJECT_NAME_NOT_VALID' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED' + security: + - BearerToken: [] + APIKey: [] + delete: + summary: Delete Custom Object by ID + description: Deletes the Custom Object associated with the specified User using an Access Token and record ID. + operationId: deleteCustomObjectByTokenAndRecordId + tags: + - Custom Object + parameters: + - $ref: '#/components/parameters/ObjectRecordId' + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/ObjectName' + - $ref: '#/components/parameters/CustomObjectId' + responses: + '200': + description: Successfully deleted the Custom Object + content: + application/json: + schema: + $ref: '#/components/schemas/IsDeleted' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + CUSTOM_OBJECT_NAME_REQUIRED: + $ref: '#/components/examples/CUSTOM_OBJECT_NAME_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: 'Status Forbidden: The server understood the request, but refuses to authorize it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + CUSTOM_OBJECT_RECORD_ID_NOT_VALID: + $ref: '#/components/examples/CUSTOM_OBJECT_RECORD_ID_NOT_VALID' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + CUSTOM_OBJECT_NOT_CONFIGURED: + $ref: '#/components/examples/CUSTOM_OBJECT_NOT_CONFIGURED' + CUSTOM_OBJECT_NAME_NOT_VALID: + $ref: '#/components/examples/CUSTOM_OBJECT_NAME_NOT_VALID' + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/phone: + put: + summary: Change Phone number + description: Updates the User's Phone number using the Access Token. + operationId: ChangePhoneNumber + tags: + - User + parameters: + - $ref: '#/components/parameters/SmsTemplate' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/IsVoiceOtp' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PhoneIdModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/SMSResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + INVALID_PHONE_NUMBER: + $ref: '#/components/examples/INVALID_PHONE_NUMBER' + PHONE_REQUIRED: + $ref: '#/components/examples/PHONE_REQUIRED' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + PHONE_NO_LOGIN_NOT_ENABLED: + $ref: '#/components/examples/PHONE_NO_LOGIN_NOT_ENABLED' + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + PHONE_NO_ALREADY_REGISTERED: + $ref: '#/components/examples/PHONE_NO_ALREADY_REGISTERED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + SMS_CONFIGURATION_NOT_EXISTS: + $ref: '#/components/examples/SMS_CONFIGURATION_NOT_EXISTS' + VOICE_SMS_CONFIGURATION_NOT_ENABLED: + $ref: '#/components/examples/VOICE_SMS_CONFIGURATION_NOT_ENABLED' + SMS_SEND_LIMIT_REACHED: + $ref: '#/components/examples/SMS_SEND_LIMIT_REACHED' + OTP_SEND_FAILED: + $ref: '#/components/examples/OTP_SEND_FAILED' + security: + - BearerToken: [] + APIKey: [] + delete: + summary: Remove Phone number + description: Removes the User's Phone number using the Access Token. + operationId: RemovePhoneIdByToken + tags: + - User + parameters: + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsDeleted' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + PHONE_NO_LOGIN_NOT_ENABLED: + $ref: '#/components/examples/PHONE_NO_LOGIN_NOT_ENABLED' + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + EMAIL_NOT_VERIFIED: + $ref: '#/components/examples/EMAIL_NOT_VERIFIED' + PHONE_NUMBER_NOT_EXISTS: + $ref: '#/components/examples/PHONE_NUMBER_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + security: + - BearerToken: [] + APIKey: [] + get: + summary: Check Phone availability + description: Verifies if a Phone number is available for registration. + operationId: GetPhoneNumberAvailability + tags: + - Login + parameters: + - $ref: '#/components/parameters/Phone' + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/GoogleRecaptchaResponseAlt' + - $ref: '#/components/parameters/QQRecaptchaTicket' + - $ref: '#/components/parameters/QQRecaptchaRandstr' + - $ref: '#/components/parameters/HCaptchaResponse' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsExist' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + INVALID_PHONE_NUMBER: + $ref: '#/components/examples/INVALID_PHONE_NUMBER' + PHONE_REQUIRED: + $ref: '#/components/examples/PHONE_REQUIRED' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + IDENTIFIER_AVAILABILITY_CHECK_DISABLED: + $ref: '#/components/examples/IDENTIFIER_AVAILABILITY_CHECK_DISABLED' + CAPTCHA_NOT_VALID: + $ref: '#/components/examples/CAPTCHA_NOT_VALID' + SMS_CONFIGURATION_NOT_EXISTS: + $ref: '#/components/examples/SMS_CONFIGURATION_NOT_EXISTS' + /identity/v2/auth/phone/otp: + post: + summary: Resend Phone OTP + description: Resends the Phone OTP using either the Access Token or Phone number. + operationId: ResendPhoneOtp + tags: + - User + parameters: + - $ref: '#/components/parameters/SmsTemplate' + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/IsVoiceOtp' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PhoneIdModelOptional' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/SMSResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + INVALID_PHONE_NUMBER: + $ref: '#/components/examples/INVALID_PHONE_NUMBER' + PHONE_REQUIRED: + $ref: '#/components/examples/PHONE_REQUIRED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + PHONE_NO_LOGIN_NOT_ENABLED: + $ref: '#/components/examples/PHONE_NO_LOGIN_NOT_ENABLED' + PHONE_NUMBER_NOT_EXISTS: + $ref: '#/components/examples/PHONE_NUMBER_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + SMS_CONFIGURATION_NOT_EXISTS: + $ref: '#/components/examples/SMS_CONFIGURATION_NOT_EXISTS' + VOICE_SMS_CONFIGURATION_NOT_ENABLED: + $ref: '#/components/examples/VOICE_SMS_CONFIGURATION_NOT_ENABLED' + SMS_SEND_LIMIT_REACHED: + $ref: '#/components/examples/SMS_SEND_LIMIT_REACHED' + OTP_SEND_FAILED: + $ref: '#/components/examples/OTP_SEND_FAILED' + PHONE_NUMBER_ALREADY_VERIFIED: + $ref: '#/components/examples/PHONE_NUMBER_ALREADY_VERIFIED' + ACCESS_TOKEN_INVALID_OR_PHONE_NUMBER_ALREADY_VERIFIED: + $ref: '#/components/examples/ACCESS_TOKEN_INVALID_OR_PHONE_NUMBER_ALREADY_VERIFIED' + security: + - BearerToken: [] + APIKey: [] + ClientId: [] + put: + summary: Verify Phone + description: Validates the verification code sent to confirm a User's Phone number when the User is logged in and provides an Access Token. + operationId: VerifyPhoneOtp + tags: + - User + parameters: + - $ref: '#/components/parameters/Otp' + - $ref: '#/components/parameters/SmsTemplate' + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/GoogleRecaptchaResponseAlt' + - $ref: '#/components/parameters/QQRecaptchaTicket' + - $ref: '#/components/parameters/QQRecaptchaRandstr' + - $ref: '#/components/parameters/HCaptchaResponse' + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/VerifyOtpPhoneModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/IsPostedResponse' + - $ref: '#/components/schemas/AuthResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + OTP_REQUIRED: + $ref: '#/components/examples/OTP_REQUIRED' + OTP_NOT_EXISTS: + $ref: '#/components/examples/OTP_NOT_EXISTS' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + PHONE_REQUIRED: + $ref: '#/components/examples/PHONE_REQUIRED' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + INVALID_PHONE_NUMBER: + $ref: '#/components/examples/INVALID_PHONE_NUMBER' + INVITATION_TOKEN_INVALID: + $ref: '#/components/examples/INVITATION_TOKEN_INVALID' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + PHONE_NO_LOGIN_NOT_ENABLED: + $ref: '#/components/examples/PHONE_NO_LOGIN_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + PHONE_NUMBER_ALREADY_VERIFIED: + $ref: '#/components/examples/PHONE_NUMBER_ALREADY_VERIFIED' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + SECURITY_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_ANSWER_INVALID' + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + OTP_NOT_EXISTS: + $ref: '#/components/examples/OTP_NOT_EXISTS' + OTP_ALREADY_USED: + $ref: '#/components/examples/OTP_ALREADY_USED' + OTP_EXPIRED: + $ref: '#/components/examples/OTP_EXPIRED' + PASSWORD_IN_HISTORY: + $ref: '#/components/examples/PASSWORD_IN_HISTORY' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/ACTIVE_SESSIONS_EXCEEDED' + SMS_CONFIGURATION_NOT_EXISTS: + $ref: '#/components/examples/SMS_CONFIGURATION_NOT_EXISTS' + SMS_SEND_LIMIT_REACHED: + $ref: '#/components/examples/SMS_SEND_LIMIT_REACHED' + OTP_SEND_FAILED: + $ref: '#/components/examples/OTP_SEND_FAILED' + SECURITY_QUESTION_NOT_VALID: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_VALID' + SECURITY_QUESTION_OR_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_INVALID' + PIN_IS_REQUIRED: + $ref: '#/components/examples/PIN_IS_REQUIRED' + CONSENT_FORM_VALIDATION_FAILED: + $ref: '#/components/examples/CONSENT_FORM_VALIDATION_FAILED' + CONSENT_FORM_NOT_SUBMITTED: + $ref: '#/components/examples/CONSENT_FORM_NOT_SUBMITTED' + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + APP_NOT_EXISTS: + $ref: '#/components/examples/APP_NOT_EXISTS' + CONSENT_FORM_NOT_AVAILABLE: + $ref: '#/components/examples/CONSENT_FORM_NOT_AVAILABLE' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + PHONE_NUMBER_NOT_EXISTS: + $ref: '#/components/examples/PHONE_NUMBER_NOT_EXISTS' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + OTP_INVALID: + $ref: '#/components/examples/OTP_INVALID' + RBA_ACCOUNT_IS_BLOCKED_BY_BROWSER_RISK: + $ref: '#/components/examples/RBA_ACCOUNT_IS_BLOCKED_BY_BROWSER_RISK' + RBA_ACCOUNT_IS_BLOCKED_BY_CITY_RISK: + $ref: '#/components/examples/RBA_ACCOUNT_IS_BLOCKED_BY_CITY_RISK' + RBA_ACCOUNT_IS_BLOCKED_BY_COUNTRY_RISK: + $ref: '#/components/examples/RBA_ACCOUNT_IS_BLOCKED_BY_COUNTRY_RISK' + RBA_ACCOUNT_IS_BLOCKED_BY_DEVICE_RISK: + $ref: '#/components/examples/RBA_ACCOUNT_IS_BLOCKED_BY_DEVICE_RISK' + RBA_ACCOUNT_IS_BLOCKED_BY_IP_RISK: + $ref: '#/components/examples/RBA_ACCOUNT_IS_BLOCKED_BY_IP_RISK' + RBA_EMAIL_VERIFICATION_BY_BROWSER_RISK: + $ref: '#/components/examples/RBA_EMAIL_VERIFICATION_BY_BROWSER_RISK' + RBA_EMAIL_VERIFICATION_BY_CITY_RISK: + $ref: '#/components/examples/RBA_EMAIL_VERIFICATION_BY_CITY_RISK' + RBA_EMAIL_VERIFICATION_BY_COUNTRY_RISK: + $ref: '#/components/examples/RBA_EMAIL_VERIFICATION_BY_COUNTRY_RISK' + RBA_EMAIL_VERIFICATION_BY_DEVICE_RISK: + $ref: '#/components/examples/RBA_EMAIL_VERIFICATION_BY_DEVICE_RISK' + RBA_EMAIL_VERIFICATION_BY_IP_RISK: + $ref: '#/components/examples/RBA_EMAIL_VERIFICATION_BY_IP_RISK' + RBA_SECURITY_ANSWER_VERIFICATION_BY_BROWSER_RISK: + $ref: '#/components/examples/RBA_SECURITY_ANSWER_VERIFICATION_BY_BROWSER_RISK' + RBA_SECURITY_ANSWER_VERIFICATION_BY_CITY_RISK: + $ref: '#/components/examples/RBA_SECURITY_ANSWER_VERIFICATION_BY_CITY_RISK' + RBA_SECURITY_ANSWER_VERIFICATION_BY_COUNTRY_RISK: + $ref: '#/components/examples/RBA_SECURITY_ANSWER_VERIFICATION_BY_COUNTRY_RISK' + RBA_SECURITY_ANSWER_VERIFICATION_BY_DEVICE_RISK: + $ref: '#/components/examples/RBA_SECURITY_ANSWER_VERIFICATION_BY_DEVICE_RISK' + RBA_SMS_VERIFICATION_BY_BROWSER_RISK: + $ref: '#/components/examples/RBA_SMS_VERIFICATION_BY_BROWSER_RISK' + RBA_SMS_VERIFICATION_BY_CITY_RISK: + $ref: '#/components/examples/RBA_SMS_VERIFICATION_BY_CITY_RISK' + RBA_SMS_VERIFICATION_BY_COUNTRY_RISK: + $ref: '#/components/examples/RBA_SMS_VERIFICATION_BY_COUNTRY_RISK' + RBA_SMS_VERIFICATION_BY_DEVICE_RISK: + $ref: '#/components/examples/RBA_SMS_VERIFICATION_BY_DEVICE_RISK' + RBA_SMS_VERIFICATION_BY_IP_RISK: + $ref: '#/components/examples/RBA_SMS_VERIFICATION_BY_IP_RISK' + /identity/v2/auth/pin/change: + put: + tags: + - Security + summary: Update PIN with Access Token + operationId: ChangePinByAccessToken + description: Updates an existing PIN by providing the current PIN and a valid Access Token for authentication, allowing a User to change their PIN while logged in. + parameters: + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/GoogleRecaptchaResponseAlt' + - $ref: '#/components/parameters/HCaptchaResponse' + - $ref: '#/components/parameters/QQCaptchaTicket' + - $ref: '#/components/parameters/QQCaptchaRandstr' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ChangePin' + responses: + '200': + description: Successfully submit request to reset the PIN + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedResponse' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + OLD_PIN_REQUIRED_PARAM: + $ref: '#/components/examples/OLD_PIN_REQUIRED_PARAM' + NEW_PIN_REQUIRED_PARAM: + $ref: '#/components/examples/NEW_PIN_REQUIRED_PARAM' + SERVER_SIDE_VALIDATION_ERROR: + $ref: '#/components/examples/SERVER_SIDE_VALIDATION_ERROR' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + OLD_PIN_WRONG: + $ref: '#/components/examples/OLD_PIN_WRONG' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + PIN_AUTH_NOT_ENABLED: + $ref: '#/components/examples/PIN_AUTH_NOT_ENABLED' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + USER_ID_LOCKED_WITH_TIMEOUT: + $ref: '#/components/examples/USER_ID_LOCKED_WITH_TIMEOUT' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + SECURITY_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_ANSWER_INVALID' + PIN_NOT_CONFIGURED: + $ref: '#/components/examples/PIN_NOT_CONFIGURED' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/pin/set/pinauthtoken: + post: + tags: + - Security + summary: Set PIN with Authentication Token + operationId: setPinByPinAuthToken + description: Sets a PIN for Users logging in or registering for the first time. Requires a valid PIN authentication token and is typically part of the onboarding or initial setup process. + parameters: + - $ref: '#/components/parameters/PinAuthTokenQuery' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PINModel' + responses: + '200': + description: Successfully submit request to reset the PIN + content: + application/json: + schema: + $ref: '#/components/schemas/AuthResponse' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + PIN_REQUIRED_PARAM: + $ref: '#/components/examples/PIN_REQUIRED_PARAM' + PIN_AUTH_TOKEN_REQUIRED: + $ref: '#/components/examples/PIN_AUTH_TOKEN_REQUIRED' + SERVER_SIDE_VALIDATION_ERROR: + $ref: '#/components/examples/SERVER_SIDE_VALIDATION_ERROR' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + PIN_AUTH_TOKEN_NOT_VALID: + $ref: '#/components/examples/PIN_AUTH_TOKEN_NOT_VALID' + PIN_AUTH_TOKEN_EXPIRED: + $ref: '#/components/examples/PIN_AUTH_TOKEN_EXPIRED' + PIN_AUTH_NOT_ENABLED: + $ref: '#/components/examples/PIN_AUTH_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + /identity/v2/auth/pin/forgot/email: + post: + tags: + - Security + summary: Send PIN Reset Email + operationId: forgotPinByEmail + description: Sends a PIN reset Email to the User's registered Email, enabling them to reset their PIN if forgotten. + parameters: + - $ref: '#/components/parameters/EmailTemplate' + - $ref: '#/components/parameters/ResetPinURL' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ForgotPinByEmail' + responses: + '200': + description: Successfully submit request to reset the PIN + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedResponse' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + EMAIL_REQUIRED: + $ref: '#/components/examples/EMAIL_REQUIRED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + PIN_AUTH_NOT_ENABLED: + $ref: '#/components/examples/PIN_AUTH_NOT_ENABLED' + USER_NAME_AUTHENTICATION_ENABLED: + $ref: '#/components/examples/USER_NAME_AUTHENTICATION_ENABLED' + RESET_PIN_URL_INVALID: + $ref: '#/components/examples/RESET_PIN_URL_INVALID' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + EMAIL_SEND_LIMIT_REACHED: + $ref: '#/components/examples/EMAIL_SEND_LIMIT_REACHED' + /identity/v2/auth/pin/forgot/username: + post: + tags: + - Security + summary: Send PIN Reset Email by Username + operationId: forgotPinByUsername + description: Sends a PIN reset Email to the User IDentified by their Username, enabling them to reset their PIN if forgotten. + parameters: + - $ref: '#/components/parameters/EmailTemplate' + - $ref: '#/components/parameters/ResetPinURL' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ForgotPinByUsername' + responses: + '200': + description: Successfully submit request to reset the PIN + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedResponse' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + EMAIL_REQUIRED: + $ref: '#/components/examples/USERNAME_REQUIRED_PARAM' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + PIN_AUTH_NOT_ENABLED: + $ref: '#/components/examples/PIN_AUTH_NOT_ENABLED' + RESET_PIN_URL_INVALID: + $ref: '#/components/examples/RESET_PIN_URL_INVALID' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + EMAIL_ID_NOT_EXIST_IN_PROFILE: + $ref: '#/components/examples/EMAIL_ID_NOT_EXIST_IN_PROFILE' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + EMAIL_SEND_LIMIT_REACHED: + $ref: '#/components/examples/EMAIL_SEND_LIMIT_REACHED' + /identity/v2/auth/pin/forgot/otp: + post: + tags: + - Security + summary: Send OTP for PIN Reset + operationId: forgotPinByPhone + description: Sends a One-Time Password (OTP) to the User's registered Phone number, enabling them to reset their PIN if forgotten. + parameters: + - $ref: '#/components/parameters/SmsTemplate' + - $ref: '#/components/parameters/IsVoiceOtp' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ForgotPinByPhone' + responses: + '200': + description: Successfully submit request to reset the PIN + content: + application/json: + schema: + $ref: '#/components/schemas/SMSResponse' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + EMAIL_REQUIRED: + $ref: '#/components/examples/PHONE_REQUIRED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + PIN_AUTH_NOT_ENABLED: + $ref: '#/components/examples/PIN_AUTH_NOT_ENABLED' + INVALID_PHONE_NUMBER: + $ref: '#/components/examples/INVALID_PHONE_NUMBER' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + SMS_CONFIGURATION_NOT_EXISTS: + $ref: '#/components/examples/SMS_CONFIGURATION_NOT_EXISTS' + VOICE_SMS_CONFIGURATION_NOT_ENABLED: + $ref: '#/components/examples/VOICE_SMS_CONFIGURATION_NOT_ENABLED' + SMS_SEND_LIMIT_REACHED: + $ref: '#/components/examples/SMS_SEND_LIMIT_REACHED' + OTP_SEND_FAILED: + $ref: '#/components/examples/OTP_SEND_FAILED' + /identity/v2/auth/pin/reset/otp/{type}: + put: + summary: Reset PIN with OTP + operationId: resetPinByOTP + description: Allows a User to reset their PIN by verifying a One-Time Password (OTP). The User must provide the OTP, a new PIN, and one identifier (Phone, Email, or Username), enabling secure PIN recovery when the User forgets their PIN. + tags: + - Security + parameters: + - $ref: '#/components/parameters/ReAuthType' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/GoogleRecaptchaResponse' + - $ref: '#/components/parameters/GoogleRecaptchaResponseAlt' + - $ref: '#/components/parameters/QQCaptchaTicket' + - $ref: '#/components/parameters/QQCaptchaRandstr' + - $ref: '#/components/parameters/HCaptchaResponse' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ResetPINByOTP' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedResponse' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + EMAIL_REQUIRED_PARAM: + $ref: '#/components/examples/EMAIL_REQUIRED_PARAM' + PIN_REQUIRED_PARAM: + $ref: '#/components/examples/PIN_REQUIRED_PARAM' + USERNAME_REQUIRED_PARAM: + $ref: '#/components/examples/USERNAME_REQUIRED_PARAM' + PHONE_REQUIRED_PARAM: + $ref: '#/components/examples/PHONE_PAYLOAD_REQUIRED' + RESOURCE_NOT_FOUND: + $ref: '#/components/examples/RESOURCE_NOT_FOUND' + SERVER_SIDE_VALIDATION_ERROR: + $ref: '#/components/examples/SERVER_SIDE_VALIDATION_ERROR' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + PIN_AUTH_NOT_ENABLED: + $ref: '#/components/examples/PIN_AUTH_NOT_ENABLED' + USER_NAME_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/USER_NAME_AUTHENTICATION_NOT_ENABLED' + USER_NAME_AUTHENTICATION_ENABLED: + $ref: '#/components/examples/USER_NAME_AUTHENTICATION_ENABLED' + PHONE_NO_LOGIN_NOT_ENABLED: + $ref: '#/components/examples/PHONE_NO_LOGIN_NOT_ENABLED' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + USER_ID_LOCKED_WITH_TIMEOUT: + $ref: '#/components/examples/USER_ID_LOCKED_WITH_TIMEOUT' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + VERIFICATION_OTP_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_OTP_NOT_VALID' + LINK_EXPIRED: + $ref: '#/components/examples/LINK_EXPIRED' + LINK_ALREADY_VERIFIED: + $ref: '#/components/examples/LINK_ALREADY_VERIFIED' + OTP_NOT_EXISTS: + $ref: '#/components/examples/OTP_NOT_EXISTS' + OTP_INVALID: + $ref: '#/components/examples/OTP_INVALID' + '500': + description: Internal Server Error - an unexpected error occurred on the server. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED' + /identity/v2/auth/pin/reset/token: + put: + summary: Reset PIN with Reset Token + operationId: resetPinByResetToken + description: Allows a User to reset their PIN by providing a reset token received via Email and a new PIN, enabling secure PIN recovery when the User forgets their PIN. + tags: + - Security + parameters: + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ResetPINByToken' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedResponse' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + RESET_TOKEN_REQUIRED: + $ref: '#/components/examples/RESET_TOKEN_REQUIRED' + PIN_REQUIRED_PARAM: + $ref: '#/components/examples/PIN_REQUIRED_PARAM' + SERVER_SIDE_VALIDATION_ERROR: + $ref: '#/components/examples/SERVER_SIDE_VALIDATION_ERROR' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + PIN_AUTH_NOT_ENABLED: + $ref: '#/components/examples/PIN_AUTH_NOT_ENABLED' + VERIFICATION_VTOKEN_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_VTOKEN_NOT_VALID' + LINK_EXPIRED: + $ref: '#/components/examples/LINK_EXPIRED' + PIN_LINK_ALREADY_VERIFIED: + $ref: '#/components/examples/PIN_LINK_ALREADY_VERIFIED' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + /identity/v2/auth/login/2fa/sms/phone: + put: + tags: + - Security + summary: Update Phone with MFA Token + operationId: MFAUpdatePhoneNumberByMfaToken + description: Sends a verification OTP to the provided Phone number as part of the process to update the Phone number used for Multi-Factor Authentication. + parameters: + - $ref: '#/components/parameters/SecondFactorToken' + - $ref: '#/components/parameters/SMSTemplate2FA' + - $ref: '#/components/parameters/IsVoiceOtp' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/MFAPhoneUpdateModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/SMSResponseData' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + SECOND_FACTOR_AUTH_TOKEN_REQUIRED: + $ref: '#/components/examples/SECOND_FACTOR_AUTH_TOKEN_REQUIRED' + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + MFA_PHONE_REQUIRED: + $ref: '#/components/examples/MFA_PHONE_REQUIRED' + INVALID_PHONE_NUMBER: + $ref: '#/components/examples/INVALID_PHONE_NUMBER' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID' + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED_IN_APP_CONFIG: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED_IN_APP_CONFIG' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + TWO_FACTOR_AUTHENTICATION_PHONE_ALREADY_USED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_PHONE_ALREADY_USED' + TWO_FACTOR_AUTHENTICATION_INVALID_PHONE_UPDATE_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_INVALID_PHONE_UPDATE_OLD' + TWO_FACTOR_AUTHENTICATION_INVALID_PHONE_UPDATE: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_INVALID_PHONE_UPDATE' + SMS_CONFIGURATION_NOT_EXISTS: + $ref: '#/components/examples/SMS_CONFIGURATION_NOT_EXISTS' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_ON_PROFILE: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_ON_PROFILE' + TWO_FACTOR_SECURITY_QUESTION_AUTHENTICATION_NOT_VERIFIED: + $ref: '#/components/examples/TWO_FACTOR_SECURITY_QUESTION_AUTHENTICATION_NOT_VERIFIED' + VOICE_SMS_CONFIGURATION_NOT_ENABLED: + $ref: '#/components/examples/VOICE_SMS_CONFIGURATION_NOT_ENABLED' + SMS_SEND_LIMIT_REACHED: + $ref: '#/components/examples/SMS_SEND_LIMIT_REACHED' + OTP_SEND_FAILED: + $ref: '#/components/examples/OTP_SEND_FAILED' + SOMETHING_GOING_WRONG: + $ref: '#/components/examples/SOMETHING_GOING_WRONG' + /identity/v2/auth/account/2fa: + get: + tags: + - Security + summary: Retrieve MFA settings + operationId: GetMFASettings + description: Retrieves all MFA settings configured for the User, including the status of each authenticator type and available configuration details. + parameters: + - $ref: '#/components/parameters/DuoRedirectUri' + - $ref: '#/components/parameters/AccessToken' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/TwoFactorAuthenticationSettings' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + DUO_REDIRECT_URI_REQUIRED: + $ref: '#/components/examples/DUO_REDIRECT_URI_REQUIRED' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + DUO_AUTHENTICATOR_REDIRECT_URI_INVALID: + $ref: '#/components/examples/DUO_AUTHENTICATOR_REDIRECT_URI_INVALID' + DUO_AUTHENTICATOR_REDIRECT_URI_NOT_WHITELISTED: + $ref: '#/components/examples/DUO_AUTHENTICATOR_REDIRECT_URI_NOT_WHITELISTED' + TWO_FACTOR_AUTHENTICATION_DUO_AUTH_CONFIG_INVALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_DUO_AUTH_CONFIG_INVALID' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + PHONE_NOT_VERIFIED: + $ref: '#/components/examples/PHONE_NOT_VERIFIED' + EMAIL_OR_PHONE_NOT_VERIFIED: + $ref: '#/components/examples/EMAIL_OR_PHONE_NOT_VERIFIED' + EMAIL_NOT_VERIFIED: + $ref: '#/components/examples/EMAIL_NOT_VERIFIED' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED' + SOMETHING_GOING_WRONG: + $ref: '#/components/examples/SOMETHING_GOING_WRONG' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/account/2fa/sms/phone: + put: + tags: + - Security + summary: Update Phone by token + operationId: MFAUpdatePhoneNumberByToken + description: Sends a verification OTP to the provided Phone number as part of the process to update the Phone number used for MFA. + parameters: + - $ref: '#/components/parameters/SMSTemplate2FA' + - $ref: '#/components/parameters/IsVoiceOtp' + - $ref: '#/components/parameters/AccessToken' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/MFAPhoneUpdateModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/SMSResponseData' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + MFA_PHONE_REQUIRED: + $ref: '#/components/examples/MFA_PHONE_REQUIRED' + INVALID_PHONE_NUMBER: + $ref: '#/components/examples/INVALID_PHONE_NUMBER' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID' + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED_IN_APP_CONFIG: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED_IN_APP_CONFIG' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + TWO_FACTOR_AUTHENTICATION_PHONE_ALREADY_USED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_PHONE_ALREADY_USED' + TWO_FACTOR_AUTHENTICATION_INVALID_PHONE_UPDATE_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_INVALID_PHONE_UPDATE_OLD' + TWO_FACTOR_AUTHENTICATION_INVALID_PHONE_UPDATE: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_INVALID_PHONE_UPDATE' + SMS_CONFIGURATION_NOT_EXISTS: + $ref: '#/components/examples/SMS_CONFIGURATION_NOT_EXISTS' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_ON_PROFILE: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_ON_PROFILE' + VOICE_SMS_CONFIGURATION_NOT_ENABLED: + $ref: '#/components/examples/VOICE_SMS_CONFIGURATION_NOT_ENABLED' + SMS_SEND_LIMIT_REACHED: + $ref: '#/components/examples/SMS_SEND_LIMIT_REACHED' + OTP_SEND_FAILED: + $ref: '#/components/examples/OTP_SEND_FAILED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + SOMETHING_GOING_WRONG: + $ref: '#/components/examples/SOMETHING_GOING_WRONG' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/login/2fa/sms: + put: + tags: + - Security + summary: Verify SMS OTP + operationId: ValidateMfaOTPByPhone + description: Allows Users to log in with Multi-Factor Authentication using the OTP sent via SMS or Voice OTP. + parameters: + - $ref: '#/components/parameters/SecondFactorToken' + - $ref: '#/components/parameters/SMSTemplate2FA' + - $ref: '#/components/parameters/Fields' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/IsVoiceOtp' + - $ref: '#/components/parameters/RbaBrowserEmailTemplate' + - $ref: '#/components/parameters/RbaCityEmailTemplate' + - $ref: '#/components/parameters/RbaCountryEmailTemplate' + - $ref: '#/components/parameters/RbaIPEmailTemplate' + - $ref: '#/components/parameters/RbaDeviceEmailTemplate' + - $ref: '#/components/parameters/RbaOtpSMSTemplate' + - $ref: '#/components/parameters/RbaBrowserSMSTemplate' + - $ref: '#/components/parameters/RbaCitySMSTemplate' + - $ref: '#/components/parameters/RbaCountrySMSTemplate' + - $ref: '#/components/parameters/RbaIPSMSTemplate' + - $ref: '#/components/parameters/RbaDeviceSMSTemplate' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/MFAVerifyPhoneOtpModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/AuthResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + SECOND_FACTOR_AUTH_TOKEN_REQUIRED: + $ref: '#/components/examples/SECOND_FACTOR_AUTH_TOKEN_REQUIRED' + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + OTP_REQUIRED: + $ref: '#/components/examples/OTP_REQUIRED' + INVALID_INVITATION_ID_ACCEPTED: + $ref: '#/components/examples/INVALID_INVITATION_ID_ACCEPTED' + INVALID_INVITATION_ID_EXPIRED: + $ref: '#/components/examples/INVALID_INVITATION_ID_EXPIRED' + INVALID_INVITATION_ID_REVOKED: + $ref: '#/components/examples/INVALID_INVITATION_ID_REVOKED' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID' + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED_IN_APP_CONFIG: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED_IN_APP_CONFIG' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + SECURITY_QUESTION_NOT_VALID: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_VALID' + SECURITY_QUESTION_OR_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_INVALID' + SECURITY_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_ANSWER_INVALID' + LOGIN_IS_LOCKED_FOR_MFA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_MFA' + ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/ACTIVE_SESSIONS_EXCEEDED' + CONSENT_FORM_VALIDATION_FAILED: + $ref: '#/components/examples/CONSENT_FORM_VALIDATION_FAILED' + CONSENT_FORM_NOT_SUBMITTED: + $ref: '#/components/examples/CONSENT_FORM_NOT_SUBMITTED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + OTP_NOT_EXISTS: + $ref: '#/components/examples/OTP_NOT_EXISTS' + OTP_INVALID: + $ref: '#/components/examples/OTP_INVALID' + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + INVITATION_NOT_FOUND: + $ref: '#/components/examples/INVITATION_NOT_FOUND' + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND' + ROLE_DOES_NOT_EXISTS: + $ref: '#/components/examples/ROLE_DOES_NOT_EXISTS_PARTNER' + '500': + description: Internal Server Error - an unexpected error occurred on the server. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /identity/v2/auth/login/2fa/totp: + put: + summary: Verify TOTP Code with MFA Token + description: Validates the TOTP Authenticator code provided by the User as part of the Multi-Factor Authentication login process. + operationId: VerifyTotpByMfaToken + tags: + - Security + parameters: + - $ref: '#/components/parameters/SecondFactorToken' + - $ref: '#/components/parameters/Fields' + - $ref: '#/components/parameters/RbaBrowserEmailTemplate' + - $ref: '#/components/parameters/RbaCityEmailTemplate' + - $ref: '#/components/parameters/RbaCountryEmailTemplate' + - $ref: '#/components/parameters/RbaIPEmailTemplate' + - $ref: '#/components/parameters/RbaDeviceEmailTemplate' + - $ref: '#/components/parameters/RbaBrowserSMSTemplate' + - $ref: '#/components/parameters/RbaCitySMSTemplate' + - $ref: '#/components/parameters/RbaCountrySMSTemplate' + - $ref: '#/components/parameters/RbaIPSMSTemplate' + - $ref: '#/components/parameters/RbaDeviceSMSTemplate' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AuthenticatorCodeRequest' + responses: + '200': + description: Successful MFA login or MFA challenge required + content: + application/json: + schema: + $ref: '#/components/schemas/AuthResponse' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + AUTH_PAYLOAD_REQUIRED: + $ref: '#/components/examples/AUTH_PARAMETER_REQUIRED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + SECOND_FACTOR_AUTH_TOKEN_REQUIRED: + $ref: '#/components/examples/SECOND_FACTOR_AUTH_TOKEN_REQUIRED' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID' + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_ENABLED_IN_APP_CONFIG_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_ENABLED_IN_APP_CONFIG_OLD' + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_ENABLED_IN_APP_CONFIG: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_ENABLED_IN_APP_CONFIG' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + LOGIN_IS_LOCKED_FOR_MFA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_MFA' + ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/ACTIVE_SESSIONS_EXCEEDED' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_CODE_INCORRECT: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_CODE_INCORRECT' + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_CODE_INCORRECT_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_CODE_INCORRECT_OLD' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + USER_ID_LOCKED_WITH_TIMEOUT: + $ref: '#/components/examples/USER_ID_LOCKED_WITH_TIMEOUT' + SECURITY_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_ANSWER_INVALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + CONSENT_FORM_VALIDATION_FAILED: + $ref: '#/components/examples/CONSENT_FORM_VALIDATION_FAILED' + CONSENT_FORM_NOT_SUBMITTED: + $ref: '#/components/examples/CONSENT_FORM_NOT_SUBMITTED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + INVITATION_NOT_FOUND: + $ref: '#/components/examples/INVITATION_NOT_FOUND' + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND' + ROLE_DOES_NOT_EXISTS: + $ref: '#/components/examples/ROLE_DOES_NOT_EXISTS_PARTNER' + '500': + description: Internal Server Error - an unexpected error occurred on the server. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /identity/v2/auth/account/2fa/sms: + delete: + tags: + - Security + summary: Reset SMS Authenticator + operationId: MFAResetSMSAuthByToken + description: Resets SMS Authenticator configurations for an Account using an Access Token. + parameters: + - $ref: '#/components/parameters/AccessToken' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsDeleted' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + DELETE_BODY_INVALID: + $ref: '#/components/examples/DELETE_BODY_INVALID' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + INVALID_PHONE_NUMBER: + $ref: '#/components/examples/INVALID_PHONE_NUMBER' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID' + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED_IN_APP_CONFIG: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED_IN_APP_CONFIG' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_VALID_FOR_DELETE: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_VALID_FOR_DELETE' + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_ENABLED_IN_APP_CONFIG: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_ENABLED_IN_APP_CONFIG' + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_ENABLED_IN_APP_CONFIG_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_ENABLED_IN_APP_CONFIG_OLD' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_CONFIGURED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_CONFIGURED' + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_CONFIGURED_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_CONFIGURED_OLD' + TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED' + security: + - BearerToken: [] + APIKey: [] + put: + tags: + - Security + summary: Verify Phone MFA + operationId: MFAVerifyPhoneNumberByAccessToken + description: Updates Phone-based MFA settings after a successful login, managing or verifying Phone MFA configurations for secure operations. + parameters: + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/Fields' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/MFAVerifyPhoneOtpModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/Profile' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OTP_REQUIRED: + $ref: '#/components/examples/OTP_REQUIRED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID' + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED_IN_APP_CONFIG: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED_IN_APP_CONFIG' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + TWO_FACTOR_AUTHENTICATION_PHONE_ALREADY_USED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_PHONE_ALREADY_USED' + TWO_FACTOR_AUTHENTICATION_INVALID_PHONE_UPDATE_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_INVALID_PHONE_UPDATE_OLD' + TWO_FACTOR_AUTHENTICATION_INVALID_PHONE_UPDATE: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_INVALID_PHONE_UPDATE' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_ON_PROFILE: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_ON_PROFILE' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + SOMETHING_GOING_WRONG: + $ref: '#/components/examples/SOMETHING_GOING_WRONG' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + USER_ID_LOCKED_WITH_TIMEOUT: + $ref: '#/components/examples/USER_ID_LOCKED_WITH_TIMEOUT' + LOGIN_IS_LOCKED_FOR_MFA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_MFA' + OTP_NOT_EXISTS: + $ref: '#/components/examples/OTP_NOT_EXISTS' + OTP_INVALID: + $ref: '#/components/examples/OTP_INVALID' + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + SECURITY_QUESTION_NOT_VALID: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_VALID' + SECURITY_QUESTION_OR_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_INVALID' + SECURITY_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_ANSWER_INVALID' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/account/2fa/email: + get: + tags: + - Security + summary: Resend Email OTP + operationId: ResendTwoFactorEmailOtp + description: Sends the OTP to the Email if the Email OTP Authenticator is enabled in the Tenant's MFA configuration. + parameters: + - $ref: '#/components/parameters/EmailId' + - $ref: '#/components/parameters/EmailTemplate2FA' + - $ref: '#/components/parameters/AccessToken' + responses: + '200': + description: OTP resent successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedResponse' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + EMAIL_ID_REQUIRED: + $ref: '#/components/examples/EMAILID_REQUIRD' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + '403': + description: Forbidden - The client is not authorized to perform this action. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_EmailOTP_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_EmailOTP_AUTHENTICATION_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + security: + - APIKey: [] + delete: + tags: + - Security + summary: Reset Email OTP Authenticator + description: Resets the Email OTP Authenticator settings for a User with MFA enabled, allowing reconfiguration. + operationId: ResetMFAEmailAuthByAccessToken + parameters: + - $ref: '#/components/parameters/AccessToken' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsDeleted' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_EmailOTP_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_EmailOTP_AUTHENTICATION_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + security: + - BearerToken: [] + APIKey: [] + put: + tags: + - Security + summary: Verify Email OTP + operationId: EmailOTPAuthVerificationByAccessToken + description: Verifies Email OTP authentication for a User using an Access Token. + parameters: + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/Fields' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ReAuthModelByEmailOtp' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/Profile' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + POST_BODY_INVALID: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + EMAIL_REQUIRED: + $ref: '#/components/examples/EMAIL_REQUIRED' + OTP_PAYLOAD_REQUIRED: + $ref: '#/components/examples/OTP_PAYLOAD_REQUIRED' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA' + LOGIN_IS_LOCKED_FOR_MFA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_MFA' + USER_ID_LOCKED_WITH_TIMEOUT: + $ref: '#/components/examples/USER_ID_LOCKED_WITH_TIMEOUT' + USER_ID_LOCKED: + $ref: '#/components/examples/USER_ID_LOCKED' + OTP_NOT_EXISTS: + $ref: '#/components/examples/OTP_NOT_EXISTS' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/consent: + post: + summary: Submit Consent with Token + description: Submits User consent information using a consent token. + operationId: SubmitConsentByConsentToken + tags: + - User + parameters: + - $ref: '#/components/parameters/ConsentToken' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ConsentSubmit' + responses: + '200': + description: 'Status OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/ConsentResponse' + '400': + description: 'Bad Request: The request was invalid or cannot be served.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + PARAMETER_NOT_FORMATTED: + $ref: '#/components/examples/PARAMETER_NOT_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + CONSENT_TOKEN_REQUIRED: + $ref: '#/components/examples/CONSENT_TOKEN_REQUIRED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + CONSENT_FORM_NOT_ENABLED: + $ref: '#/components/examples/CONSENT_FORM_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + CONSENT_FORM_NOT_SUBMITTED: + $ref: '#/components/examples/CONSENT_FORM_NOT_SUBMITTED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + CONSENT_TOKEN_NOT_VALID: + $ref: '#/components/examples/CONSENT_TOKEN_NOT_VALID' + CONSENT_TOKEN_EXPIRED: + $ref: '#/components/examples/CONSENT_TOKEN_EXPIRED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + CONSENT_FORM_VALIDATION_FAILED: + $ref: '#/components/examples/CONSENT_FORM_VALIDATION_FAILED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + put: + summary: Update Consent Profile + description: Updates the consent profile using an Access Token. + operationId: UpdateConsentByAccessToken + tags: + - User + parameters: + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ConsentUpdate' + responses: + '200': + description: 'Status OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/ConsentProfile' + '400': + description: 'Bad Request: The request was invalid or cannot be served.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + CONSENT_FORM_NOT_ENABLED: + $ref: '#/components/examples/CONSENT_FORM_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + CONSENT_FORM_VALIDATION_FAILED: + $ref: '#/components/examples/CONSENT_FORM_VALIDATION_FAILED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + CONSENT_FORM_NOT_AVAILABLE: + $ref: '#/components/examples/CONSENT_FORM_NOT_AVAILABLE' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/consent/profile: + post: + summary: Submit Consent + description: Submits User consent information using an Access Token. + operationId: SubmitConsentByAccessToken + tags: + - User + parameters: + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ConsentSubmit' + responses: + '200': + description: 'Status OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/Profile' + '400': + description: 'Bad Request: The request was invalid or cannot be served.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + PARAMETER_NOT_FORMATTED: + $ref: '#/components/examples/PARAMETER_NOT_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + CONSENT_FORM_NOT_ENABLED: + $ref: '#/components/examples/CONSENT_FORM_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + CONSENT_FORM_VALIDATION_FAILED: + $ref: '#/components/examples/CONSENT_FORM_VALIDATION_FAILED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + CONSENT_FORM_NOT_SUBMITTED: + $ref: '#/components/examples/CONSENT_FORM_NOT_SUBMITTED' + CONSENT_FORM_NOT_AVAILABLE: + $ref: '#/components/examples/CONSENT_FORM_NOT_AVAILABLE' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/consent/logs: + get: + summary: Retrieve Consent Logs + description: Retrieves consent logs for a User based on the provided Access Token. + operationId: GetConsentLogs + tags: + - User + parameters: + - $ref: '#/components/parameters/AccessToken' + responses: + '200': + description: 'Status OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/ConsentLogsResponse' + '400': + description: 'Bad Request: The request was invalid or cannot be served.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + TOKEN_REQUIRED: + $ref: '#/components/examples/TOKEN_REQUIRED' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + CONSENT_LOGS_NOT_AVAILABLE: + $ref: '#/components/examples/CONSENT_LOGS_NOT_AVAILABLE' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + CONSENT_FORM_NOT_AVAILABLE: + $ref: '#/components/examples/CONSENT_FORM_NOT_AVAILABLE' + CONSENT_FORM_NOT_ENABLED: + $ref: '#/components/examples/CONSENT_FORM_NOT_ENABLED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/consent/verify: + get: + summary: Retrieve Consent Status + description: Retrieves the consent verification status for a User based on the provided Access Token and event. + operationId: GetVerifiedConsentWithAccessToken + tags: + - User + parameters: + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/Event' + - $ref: '#/components/parameters/IsCustom' + responses: + '200': + description: 'Status OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/VerifyConsent' + '400': + description: 'Bad Request: The request was invalid or cannot be served.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + TOKEN_REQUIRED: + $ref: '#/components/examples/TOKEN_REQUIRED' + EVENT_REQUIRED: + $ref: '#/components/examples/EVENT_REQUIRED' + IS_CUSTOM_REQUIRED: + $ref: '#/components/examples/ISCUSTOM_REQUIRED' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + CONSENT_FORM_NOT_ENABLED: + $ref: '#/components/examples/CONSENT_FORM_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED' + CONSENT_FORM_NOT_AVAILABLE: + $ref: '#/components/examples/CONSENT_FORM_NOT_AVAILABLE' + CONSENT_FORM_NOT_SUBMITTED: + $ref: '#/components/examples/CONSENT_FORM_NOT_SUBMITTED' + CONSENT_FORM_VALIDATION_FAILED: + $ref: '#/components/examples/CONSENT_FORM_VALIDATION_FAILED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + security: + - BearerToken: [] + APIKey: [] + /identity/v2/auth/invitations/{invitation_token}: + get: + summary: Retrieve invitation details + description: Retrieves details about a specific invitation using the invitation token. + operationId: getInvitation + tags: + - User + parameters: + - $ref: '#/components/parameters/InvitationTokenPath' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/InvitationToken' + '400': + description: Bad Request - the request is malformed or invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + PARAMETER_NOT_FORMATTED: + $ref: '#/components/examples/INVITATION_TOKEN_REQUIRED' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + '403': + description: Forbidden - the client is not allowed to access this resource. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + '404': + description: Not Found - the invitation token does not exist or is invalid. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + INVITATION_NOT_FOUND: + $ref: '#/components/examples/INVITATION_NOT_FOUND' + /identity/v2/manage/account/emailtoken/{tokentype}: + post: + summary: Retrieve Multipurpose Email Token + description: Retrieves a multi-purpose Email token for verification, Password reset, and other Email-related actions. + operationId: MultipurposeEmailTokenAPI + tags: + - Multipurpose Tokens + parameters: + - $ref: '#/components/parameters/tokenType' + requestBody: + required: true + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/EmailVerificationOrForgotPINModel' + - $ref: '#/components/schemas/AddEmailModelManage' + - $ref: '#/components/schemas/ForgotPasswordOrPasswordLessLoginOrAutoLoginModel' + - $ref: '#/components/schemas/DeleteUserModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/GenerateTokenResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + TOKEN_TYPE_REQUIRED: + $ref: '#/components/examples/TOKEN_TYPE_REQUIRED' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + EMAILID_OR_USERNAME_REQUIRD: + $ref: '#/components/examples/EMAILID_OR_USERNAME_REQUIRD' + EMAILID_REQUIRD: + $ref: '#/components/examples/EMAILID_REQUIRD' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + UID_REQUIRED: + $ref: '#/components/examples/UID_REQUIRED' + EMAIL_TYPE_CAN_NOT_NULL: + $ref: '#/components/examples/EMAIL_TYPE_CAN_NOT_NULL' + EMAIL_TYPE_CAN_NOT_NULL-EMAIL_REQUIRED-UID_REQUIRED: + $ref: '#/components/examples/EMAIL_TYPE_CAN_NOT_NULL-EMAIL_REQUIRED-UID_REQUIRED' + EMAIL_REQUIRED: + $ref: '#/components/examples/EMAIL_REQUIRED' + EMAIL_OR_USER_REQUIRED_PARAM: + $ref: '#/components/examples/EMAIL_OR_USER_REQUIRED_PARAM' + EMAIL_OR_USER_REQUIRED_PARAM-CLIENT_GUID_REQUIRED: + $ref: '#/components/examples/EMAIL_OR_USER_REQUIRED_PARAM-CLIENT_GUID_REQUIRED' + CLIENT_GUID_REQUIRED-EMAIL_REQUIRED: + $ref: '#/components/examples/CLIENT_GUID_REQUIRED-EMAIL_REQUIRED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + AUTOLOGIN_NOT_ENABLED: + $ref: '#/components/examples/AUTOLOGIN_NOT_ENABLED' + CANNOT_ADD_EMAIL_ADDRESS: + $ref: '#/components/examples/CANNOT_ADD_EMAIL_ADDRESS' + CLIENT_GUID_MUST_BE_UNIQUE: + $ref: '#/components/examples/CLIENT_GUID_MUST_BE_UNIQUE' + EMAIL_ALLREADY_VERIFIED_TOKEN: + $ref: '#/components/examples/EMAIL_ALLREADY_VERIFIED_TOKEN' + EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER: + $ref: '#/components/examples/EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER' + EMAIL_ID_NOT_EXIST_IN_PROFILE: + $ref: '#/components/examples/EMAIL_ID_NOT_EXIST_IN_PROFILE' + EMAILID_ALREADY_REGISTERED: + $ref: '#/components/examples/EMAILID_ALREADY_REGISTERED' + EMAILID_VERIFICATION_DISABLE: + $ref: '#/components/examples/EMAILID_VERIFICATION_DISABLE' + INVALID_TOKEN_TYPE: + $ref: '#/components/examples/INVALID_TOKEN_TYPE' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + NO_REGISTRATION_NOT_ENABLED: + $ref: '#/components/examples/NO_REGISTRATION_NOT_ENABLED' + ONE_CLICK_SIGIN_NOT_ENABLED: + $ref: '#/components/examples/ONE_CLICK_SIGIN_NOT_ENABLED' + PIN_AUTH_NOT_ENABLED: + $ref: '#/components/examples/PIN_AUTH_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + SECRET_DOESNT_HAVE_ACCESS: + $ref: '#/components/examples/SECRET_DOESNT_HAVE_ACCESS' + THIS_EMAIL_ID_IS_NOT_ALLOWED_TO_REGISTER: + $ref: '#/components/examples/THIS_EMAIL_ID_IS_NOT_ALLOWED_TO_REGISTER' + TOKEN_LIMIT_REACHED: + $ref: '#/components/examples/TOKEN_LIMIT_REACHED' + TRIAL_PLAN_USER_LIMIT_REACHED: + $ref: '#/components/examples/TRIAL_PLAN_USER_LIMIT_REACHED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + USER_NAME_AUTHENTICATION_ENABLED: + $ref: '#/components/examples/USER_NAME_AUTHENTICATION_ENABLED' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + VERIFICATION_URL_IS_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_URL_IS_NOT_VALID' + REQUEST_EXPIRY_TIME_IS_INVALID: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_IS_INVALID' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/smsotp/{smsotptype}: + post: + summary: Multipurpose SMS OTP + description: Generates an OTP for the User, applicable for adding a Phone, Phone ID verification, and other SMS-related actions. + operationId: MultipurposeSmsOtpAPI + tags: + - Multipurpose Tokens + parameters: + - $ref: '#/components/parameters/smsOtpType' + requestBody: + required: true + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/AddPhoneModel' + - $ref: '#/components/schemas/PhoneIdModel' + - $ref: '#/components/schemas/OneTouchLoginPhoneModel' + - $ref: '#/components/schemas/DeleteUserModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/GenerateTokenResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + TOKEN_TYPE_REQUIRED: + $ref: '#/components/examples/SMS_OTP_TYPE_REQUIRED' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + INVALID_PHONE_NUMBER: + $ref: '#/components/examples/INVALID_PHONE_NUMBER' + UID_REQUIRED: + $ref: '#/components/examples/UID_REQUIRED' + PHONE_REQUIRED_PARAM-UID_REQUIRED: + $ref: '#/components/examples/PHONE_REQUIRED_PARAM-UID_REQUIRED' + PHONE_REQUIRED_PARAM: + $ref: '#/components/examples/PHONE_REQUIRED_PARAM' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + PHONE_NO_LOGIN_NOT_ENABLED: + $ref: '#/components/examples/PHONE_NO_LOGIN_NOT_ENABLED' + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + REQUEST_EXPIRY_TIME_IS_INVALID: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_IS_INVALID' + PHONE_NO_ALREADY_REGISTERED: + $ref: '#/components/examples/PHONE_NO_ALREADY_REGISTERED' + OTP_LIMIT_REACHED: + $ref: '#/components/examples/OTP_LIMIT_REACHED' + PHONE_NUMBER_NOT_EXISTS: + $ref: '#/components/examples/PHONE_NUMBER_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + PHONE_NUMBER_ALREADY_VERIFIED: + $ref: '#/components/examples/PHONE_NUMBER_ALREADY_VERIFIED' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + PIN_AUTH_NOT_ENABLED: + $ref: '#/components/examples/PIN_AUTH_NOT_ENABLED' + NO_REGISTRATION_NOT_ENABLED: + $ref: '#/components/examples/NO_REGISTRATION_NOT_ENABLED' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED' + TRIAL_PLAN_USER_LIMIT_REACHED: + $ref: '#/components/examples/TRIAL_PLAN_USER_LIMIT_REACHED' + USER_NAME_AUTHENTICATION_ENABLED: + $ref: '#/components/examples/USER_NAME_AUTHENTICATION_ENABLED' + AUTOLOGIN_NOT_ENABLED: + $ref: '#/components/examples/AUTOLOGIN_NOT_ENABLED' + PHONE_NOT_VERIFIED: + $ref: '#/components/examples/PHONE_NOT_VERIFIED' + PHONE_DOES_NOT_EXIST: + $ref: '#/components/examples/PHONE_DOES_NOT_EXIST' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/{uid}/rolecontext: + get: + summary: Retrieve Context by UID + description: | + Retrieves User Roles for all Contexts using the UID. + + This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + operationId: GetRoleContextByUid + tags: + - Roles Management + parameters: + - $ref: '#/components/parameters/UidPathParam' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/RoleContextResponseModal' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + USER_ID_REQUIRED: + $ref: '#/components/examples/UID_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + SECRET_DOESNT_HAVE_ACCESS: + $ref: '#/components/examples/SECRET_DOESNT_HAVE_ACCESS' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_INVALID_OR_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_INVALID_OR_EXPIRED' + B2B_FEATURE_ENABLED: + $ref: '#/components/examples/B2B_FEATURE_ENABLED' + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + put: + summary: Upsert Context by UID + description: | + Creates or updates a Context with a set of Roles using the UID. + + This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + operationId: UpsertRoleContextByUid + tags: + - Roles Management + parameters: + - $ref: '#/components/parameters/UidPathParam' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/XPreventWebhook' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateRoleContextBodyModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/RoleContextResponseModal' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + USER_ID_REQUIRED: + $ref: '#/components/examples/UID_REQUIRED' + PUT_BODY_INVALID: + $ref: '#/components/examples/PUT_BODY_INVALID' + PARAMETER_NOT_WELL_FORMATTED_CONTEXT: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_CONTEXT' + PARAMETER_NOT_WELL_FORMATTED_ROLE: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_ROLE' + PARAMETER_NOT_WELL_FORMATTED_ROLE_NULL: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_ROLE_NULL' + INVALID_DATE_ROLES: + $ref: '#/components/examples/INVALID_DATE_ROLES' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + SECRET_DOESNT_HAVE_ACCESS: + $ref: '#/components/examples/SECRET_DOESNT_HAVE_ACCESS' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ROLE_DOES_NOT_EXISTS: + $ref: '#/components/examples/ROLE_DOES_NOT_EXISTS' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_INVALID_OR_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_INVALID_OR_EXPIRED' + B2B_FEATURE_ENABLED: + $ref: '#/components/examples/B2B_FEATURE_ENABLED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/roleContext/{contextName}: + get: + summary: Retrieve Role Context + description: | + Retrieves the Role Context for a specified Role. + + This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + operationId: GetRoleContextByContextName + tags: + - Roles Management + parameters: + - $ref: '#/components/parameters/ContextName' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/RoleContextProfileResponseModel' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + SECRET_DOESNT_HAVE_ACCESS: + $ref: '#/components/examples/SECRET_DOESNT_HAVE_ACCESS' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTEXT_NAME_REQUIRED: + $ref: '#/components/examples/CONTEXT_NAME_REQUIRED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ROLE_CONTEXT_NOT_VALID: + $ref: '#/components/examples/ROLE_CONTEXT_NOT_VALID' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_INVALID_OR_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_INVALID_OR_EXPIRED' + B2B_FEATURE_ENABLED: + $ref: '#/components/examples/B2B_FEATURE_ENABLED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/{uid}/role: + get: + summary: Retrieve Roles by UID + description: | + Retrieves Roles associated with a specified UID. + + This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + operationId: GetRolesByUid + tags: + - Roles Management + parameters: + - $ref: '#/components/parameters/UidPathParam' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/UserRolesModel' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + USER_ID_REQUIRED: + $ref: '#/components/examples/UID_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + SECRET_DOESNT_HAVE_ACCESS: + $ref: '#/components/examples/SECRET_DOESNT_HAVE_ACCESS' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_INVALID_OR_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_INVALID_OR_EXPIRED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + put: + summary: Assign Roles by UID + description: | + Updates and assigns Roles to a User using the UID. + + This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + operationId: SaveRolesByUid + tags: + - Roles Management + parameters: + - $ref: '#/components/parameters/UidPathParam' + - $ref: '#/components/parameters/PreventWebhook' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserRolesModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/UserRolesModel' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + USER_ID_REQUIRED: + $ref: '#/components/examples/UID_REQUIRED' + PUT_BODY_INVALID: + $ref: '#/components/examples/PUT_BODY_INVALID' + ROLES_CAN_NOT_BE_EMPTY: + $ref: '#/components/examples/ROLES_CAN_NOT_BE_EMPTY' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + SECRET_DOESNT_HAVE_ACCESS: + $ref: '#/components/examples/SECRET_DOESNT_HAVE_ACCESS' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + ROLE_DOES_NOT_EXISTS: + $ref: '#/components/examples/ROLE_DOES_NOT_EXISTS' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_INVALID_OR_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_INVALID_OR_EXPIRED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + delete: + summary: Unassign Roles by UID + description: | + Removes specified Roles from a User using the UID. + + This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + operationId: DeleteRolesByUid + tags: + - Roles Management + parameters: + - $ref: '#/components/parameters/UidPathParam' + - $ref: '#/components/parameters/PreventWebhook' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserRolesModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + USER_ID_REQUIRED: + $ref: '#/components/examples/UID_REQUIRED' + DELETE_BODY_INVALID: + $ref: '#/components/examples/DELETE_BODY_INVALID' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + SECRET_DOESNT_HAVE_ACCESS: + $ref: '#/components/examples/SECRET_DOESNT_HAVE_ACCESS' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + ROLE_DOES_NOT_EXISTS: + $ref: '#/components/examples/ROLE_DOES_NOT_EXISTS' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_INVALID_OR_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_INVALID_OR_EXPIRED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/{uid}/rolecontext/{contextName}/role: + delete: + summary: Delete Role from Context + description: | + Deletes the specified Role from a Context. + + This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + operationId: DeleteContextRoleByUid + tags: + - Roles Management + parameters: + - $ref: '#/components/parameters/UidPathParam' + - $ref: '#/components/parameters/ContextName' + - $ref: '#/components/parameters/PreventWebhook' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RemoveRoleContextRoleModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + USER_ID_REQUIRED: + $ref: '#/components/examples/UID_REQUIRED' + DELETE_BODY_INVALID: + $ref: '#/components/examples/DELETE_BODY_INVALID' + PARAMETER_NOT_WELL_FORMATTED_ROLE: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_ROLE' + PARAMETER_NOT_WELL_FORMATTED_ROLE_NULL: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_ROLE_NULL' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + SECRET_DOESNT_HAVE_ACCESS: + $ref: '#/components/examples/SECRET_DOESNT_HAVE_ACCESS' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + ROLE_DOES_NOT_EXISTS: + $ref: '#/components/examples/ROLE_DOES_NOT_EXISTS' + ROLE_CONTEXT_NOT_VALID: + $ref: '#/components/examples/ROLE_CONTEXT_NOT_VALID' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_INVALID_OR_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_INVALID_OR_EXPIRED' + B2B_FEATURE_ENABLED: + $ref: '#/components/examples/B2B_FEATURE_ENABLED' + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/{uid}/rolecontext/{contextName}/additionalpermission: + delete: + summary: Delete Additional Permissions from Context + description: | + Removes specified additional Permissions from a Context. + + This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + operationId: DeleteRoleContextAdditionalPermissionsByUid + tags: + - Roles Management + parameters: + - $ref: '#/components/parameters/UidPathParam' + - $ref: '#/components/parameters/ContextName' + - $ref: '#/components/parameters/PreventWebhook' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RemoveRoleContextAdditionalPermissionsModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + USER_ID_REQUIRED: + $ref: '#/components/examples/UID_REQUIRED' + DELETE_BODY_INVALID: + $ref: '#/components/examples/DELETE_BODY_INVALID' + PARAMETER_NOT_WELL_FORMATTED_ADDPERMISSION_NULL: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_ADDPERMISSION_NULL' + PARAMETER_NOT_WELL_FORMATTED_ADDPERMISSION: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_ADDPERMISSION' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + SECRET_DOESNT_HAVE_ACCESS: + $ref: '#/components/examples/SECRET_DOESNT_HAVE_ACCESS' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + CONTENT_TYPE_INVALID: + $ref: '#/components/examples/CONTENT_TYPE_INVALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + ROLE_DOES_NOT_EXISTS: + $ref: '#/components/examples/ROLE_DOES_NOT_EXISTS' + ROLE_CONTEXT_NOT_VALID: + $ref: '#/components/examples/ROLE_CONTEXT_NOT_VALID' + ADDITIONALPERMISSIONS_NOT_EXITS: + $ref: '#/components/examples/ADDITIONALPERMISSIONS_NOT_EXITS' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_INVALID_OR_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_INVALID_OR_EXPIRED' + B2B_FEATURE_ENABLED: + $ref: '#/components/examples/B2B_FEATURE_ENABLED' + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/{uid}/rolecontext/{contextName}: + delete: + summary: Delete Role Context + description: | + Deletes the specified Role Context. + + This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + operationId: DeleteRoleContextByUid + tags: + - Roles Management + parameters: + - $ref: '#/components/parameters/ContextName' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/UidPathParam' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + USER_ID_REQUIRED: + $ref: '#/components/examples/UID_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + SECRET_DOESNT_HAVE_ACCESS: + $ref: '#/components/examples/SECRET_DOESNT_HAVE_ACCESS' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ROLE_CONTEXT_NOT_VALID: + $ref: '#/components/examples/ROLE_CONTEXT_NOT_VALID' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_INVALID_OR_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_INVALID_OR_EXPIRED' + B2B_FEATURE_ENABLED: + $ref: '#/components/examples/B2B_FEATURE_ENABLED' + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/passkey: + get: + summary: List Passkeys + description: Retrieves a list of Passkeys configured for a specified User. + operationId: ListPasskeyUser + tags: + - Accounts + parameters: + - $ref: '#/components/parameters/UidQueryParam' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/PasskeyListResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + UID_REQUIRED: + $ref: '#/components/examples/UID_REQUIRED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_INVALID_OR_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_INVALID_OR_EXPIRED' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + SECRET_DOESNT_HAVE_ACCESS: + $ref: '#/components/examples/SECRET_DOESNT_HAVE_ACCESS' + REQUEST_EXPIRY_TIME_IS_INVALID: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_IS_INVALID' + PASSKEY_NOT_ENABLED_IN_APP: + $ref: '#/components/examples/PASSKEY_NOT_ENABLED_IN_APP' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + PASSKEY_NOT_CONFIGURED_IN_PROFILE: + $ref: '#/components/examples/PASSKEY_NOT_CONFIGURED_IN_PROFILE' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/passkey/{passkeyId}: + delete: + summary: Delete Passkey + description: Removes configured Passkey for specified User. + operationId: DeletePasskeyByUid + tags: + - Accounts + parameters: + - $ref: '#/components/parameters/UidQueryParam' + - $ref: '#/components/parameters/passkeyId' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsDeleted' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + UID_REQUIRED: + $ref: '#/components/examples/UID_REQUIRED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_INVALID_OR_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_INVALID_OR_EXPIRED' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + SECRET_DOESNT_HAVE_ACCESS: + $ref: '#/components/examples/SECRET_DOESNT_HAVE_ACCESS' + REQUEST_EXPIRY_TIME_IS_INVALID: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_IS_INVALID' + PASSKEY_NOT_ENABLED_IN_APP: + $ref: '#/components/examples/PASSKEY_NOT_ENABLED_IN_APP' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + PASSKEY_NOT_CONFIGURED_IN_PROFILE: + $ref: '#/components/examples/PASSKEY_NOT_CONFIGURED_IN_PROFILE' + INVALID_PASSKEY_ID: + $ref: '#/components/examples/INVALID_PASSKEY_ID' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/2fa/passkey: + delete: + summary: Reset MFA Passkey + description: Resets the MFA Passkey for the specified User. + operationId: ResetMfaPasskeyByUid + tags: + - Account Security + parameters: + - $ref: '#/components/parameters/UidQueryParam' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsDeleted' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + UID_REQUIRED: + $ref: '#/components/examples/UID_REQUIRED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_INVALID_OR_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_INVALID_OR_EXPIRED' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + SECRET_DOESNT_HAVE_ACCESS: + $ref: '#/components/examples/SECRET_DOESNT_HAVE_ACCESS' + REQUEST_EXPIRY_TIME_IS_INVALID: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_IS_INVALID' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + TWO_FACTOR_AUTHENTICATION_PASSKEY_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_PASSKEY_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_PASSKEY_NOT_CONFIGURED_ON_PROFILE: + $ref: '#/components/examples/TWO_FACTOR_PASSKEY_NOT_CONFIGURED_ON_PROFILE' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/2fa/push: + delete: + summary: Reset MFA Push Notification + description: Resets the Push Notification Authenticator for the specified User. + operationId: ResetMfaPushByUid + tags: + - Account Security + parameters: + - $ref: '#/components/parameters/UidQueryParam' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsDeleted' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: 'Status Forbidden: The server understood the request, but is refusing to fulfill it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UID_REQUIRED: + $ref: '#/components/examples/UID_REQUIRED' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_Push_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_Push_AUTHENTICATION_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + TWO_FACTOR_PUSH_AUTHENTICATION_NOT_CONFIGURED_ON_PROFILE: + $ref: '#/components/examples/TWO_FACTOR_PUSH_AUTHENTICATION_NOT_CONFIGURED_ON_PROFILE' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + SECRET_DOESNT_HAVE_ACCESS: + $ref: '#/components/examples/SECRET_DOESNT_HAVE_ACCESS' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_INVALID_OR_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_INVALID_OR_EXPIRED' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + REQUEST_EXPIRY_TIME_IS_INVALID: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_IS_INVALID' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/2fa/duo: + delete: + summary: Reset Duo + description: Resets the Duo Authenticator for the specified User. + operationId: ResetDuoAuthByUid + tags: + - Account Security + parameters: + - $ref: '#/components/parameters/UidQueryParam' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsDeleted' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + UID_REQUIRED: + $ref: '#/components/examples/UID_REQUIRED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: 'Status Forbidden: The server understood the request, but is refusing to fulfill it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + DUO_AUTH_NOT_ENABLED: + $ref: '#/components/examples/DUO_AUTH_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + TWO_FACTOR_DUO_AUTHENTICATOR_NOT_CONFIGURED_ON_PROFILE: + $ref: '#/components/examples/TWO_FACTOR_DUO_AUTHENTICATOR_NOT_CONFIGURED_ON_PROFILE' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + SECRET_DOESNT_HAVE_ACCESS: + $ref: '#/components/examples/SECRET_DOESNT_HAVE_ACCESS' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_INVALID_OR_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_INVALID_OR_EXPIRED' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + REQUEST_EXPIRY_TIME_IS_INVALID: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_IS_INVALID' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/2fa/email: + delete: + summary: Reset Email OTP + description: Resets the Email OTP Authenticator for the specified User. + operationId: ResetEmailAuthenticatorByUid + tags: + - Account Security + parameters: + - $ref: '#/components/parameters/UidQueryParam' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsDeleted' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + UID_REQUIRED: + $ref: '#/components/examples/UID_REQUIRED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: 'Status Forbidden: The server understood the request, but is refusing to fulfill it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_EmailOTP_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_EmailOTP_AUTHENTICATION_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + SECRET_DOESNT_HAVE_ACCESS: + $ref: '#/components/examples/SECRET_DOESNT_HAVE_ACCESS' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_INVALID_OR_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_INVALID_OR_EXPIRED' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + REQUEST_EXPIRY_TIME_IS_INVALID: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_IS_INVALID' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/2fa/backupcode: + get: + summary: Generate Backup Codes + description: Generates a set of backup codes for the specified User. + operationId: mfaGenerateBackupCodesByUid + tags: + - Account Security + parameters: + - $ref: '#/components/parameters/UidQueryParam' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/MFABackUpCodeResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + UID_REQUIRED: + $ref: '#/components/examples/UID_REQUIRED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_INVALID_OR_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_INVALID_OR_EXPIRED' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + SECRET_DOESNT_HAVE_ACCESS: + $ref: '#/components/examples/SECRET_DOESNT_HAVE_ACCESS' + REQUEST_EXPIRY_TIME_IS_INVALID: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_IS_INVALID' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_ON_PROFILE: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_ON_PROFILE' + TWO_FACTOR_AUTHENTICATION_BACKUP_CODE_ALREADY_CONFIGURED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_BACKUP_CODE_ALREADY_CONFIGURED' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/2fa/backupcode/reset: + get: + summary: Reset Backup Codes + description: Resets and generates a new set of backup codes for the specified User. + operationId: mfaResetBackupCodesByUid + tags: + - Account Security + parameters: + - $ref: '#/components/parameters/UidQueryParam' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/MFABackUpCodeResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + UID_REQUIRED: + $ref: '#/components/examples/UID_REQUIRED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_INVALID_OR_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_INVALID_OR_EXPIRED' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + SECRET_DOESNT_HAVE_ACCESS: + $ref: '#/components/examples/SECRET_DOESNT_HAVE_ACCESS' + REQUEST_EXPIRY_TIME_IS_INVALID: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_IS_INVALID' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_ON_PROFILE: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_ON_PROFILE' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/access_token/refresh: + get: + summary: Refresh Access Token + description: Refreshes the Access Token using a Refresh Token. + operationId: refreshAccessToken + tags: + - Account Session + parameters: + - $ref: '#/components/parameters/RefreshToken' + responses: + '200': + description: 'Status OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/AccessTokenResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + REFRESH_TOKEN_REQUIRED: + $ref: '#/components/examples/REFRESH_TOKEN_REQUIRED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: 'Status Forbidden: The server understood the request, but refuses to authorize it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + REFRESH_TOKEN_INVALID: + $ref: '#/components/examples/REFRESH_TOKEN_INVALID' + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/ACTIVE_SESSIONS_EXCEEDED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + SECRET_DOESNT_HAVE_ACCESS: + $ref: '#/components/examples/SECRET_DOESNT_HAVE_ACCESS' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_INVALID_OR_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_INVALID_OR_EXPIRED' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + REQUEST_EXPIRY_TIME_IS_INVALID: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_IS_INVALID' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/access_token/refresh/revoke: + get: + summary: Revoke Refresh Token + description: Revokes the specified Refresh Token. + operationId: revokeRefreshToken + tags: + - Account Session + parameters: + - $ref: '#/components/parameters/RefreshToken' + responses: + '200': + description: 'Status OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsDeleted' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + REFRESH_TOKEN_REQUIRED: + $ref: '#/components/examples/REFRESH_TOKEN_REQUIRED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: 'Status Forbidden: The server understood the request, but refuses to authorize it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + REFRESH_TOKEN_INVALID: + $ref: '#/components/examples/REFRESH_TOKEN_INVALID' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + SECRET_DOESNT_HAVE_ACCESS: + $ref: '#/components/examples/SECRET_DOESNT_HAVE_ACCESS' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_INVALID_OR_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_INVALID_OR_EXPIRED' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + REQUEST_EXPIRY_TIME_IS_INVALID: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_IS_INVALID' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/{uid}/access_token/refresh/revoke: + delete: + summary: Revoke refresh tokens + description: Revokes all active refresh tokens for a specified User. + operationId: revokeAllRefreshToken + tags: + - Account Session + parameters: + - $ref: '#/components/parameters/UidPath' + responses: + '200': + description: 'Status OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsDeleted' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: 'Status Forbidden: The server understood the request, but refuses to authorize it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + SECRET_DOESNT_HAVE_ACCESS: + $ref: '#/components/examples/SECRET_DOESNT_HAVE_ACCESS' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_INVALID_OR_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_INVALID_OR_EXPIRED' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + REQUEST_EXPIRY_TIME_IS_INVALID: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_IS_INVALID' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/{uid}/customobject: + get: + summary: List Custom Objects + tags: + - Account Custom Object + description: Retrieves all Custom Objects associated with the UID. + operationId: GetCustomObjectByUid + parameters: + - $ref: '#/components/parameters/UidPath' + - $ref: '#/components/parameters/ObjectName' + - $ref: '#/components/parameters/CustomObjectId' + responses: + '200': + description: 'Status OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectsResponseModel' + examples: + default: + $ref: '#/components/examples/CUSTOM_OBJECTS_RESPONSE_EXAMPLE' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + CUSTOM_OBJECT_NAME_REQUIRED: + $ref: '#/components/examples/CUSTOM_OBJECT_NAME_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: 'Status Forbidden: The server understood the request, but refuses to authorize it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + REQUEST_EXPIRY_TIME_IS_INVALID: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_IS_INVALID' + SECRET_DOESNT_HAVE_ACCESS: + $ref: '#/components/examples/SECRET_DOESNT_HAVE_ACCESS' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + CUSTOM_OBJECT_NAME_NOT_VALID: + $ref: '#/components/examples/CUSTOM_OBJECT_NAME_NOT_VALID' + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + CUSTOM_OBJECT_NOT_CONFIGURED: + $ref: '#/components/examples/CUSTOM_OBJECT_NOT_CONFIGURED' + CUSTOM_OBJECT_RECORD_NOT_EXIST: + $ref: '#/components/examples/CUSTOM_OBJECT_RECORD_NOT_EXIST' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + post: + summary: Create Custom Object + tags: + - Account Custom Object + description: Creates a new Custom Object for the User. + parameters: + - $ref: '#/components/parameters/UidPath' + - $ref: '#/components/parameters/ObjectName' + - $ref: '#/components/parameters/CustomObjectId' + operationId: CreateCustomObject + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectRequest' + responses: + '200': + description: 'Status OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectResponseModel' + examples: + default: + $ref: '#/components/examples/CUSTOM_OBJECT_RESPONSE_EXAMPLE' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + CUSTOM_OBJECT_NAME_REQUIRED: + $ref: '#/components/examples/CUSTOM_OBJECT_NAME_REQUIRED' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: 'Status Forbidden: The server understood the request, but refuses to authorize it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + REQUEST_EXPIRY_TIME_IS_INVALID: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_IS_INVALID' + SECRET_DOESNT_HAVE_ACCESS: + $ref: '#/components/examples/SECRET_DOESNT_HAVE_ACCESS' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + CUSTOM_OBJECT_NAME_NOT_VALID: + $ref: '#/components/examples/CUSTOM_OBJECT_NAME_NOT_VALID' + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + CUSTOM_OBJECT_NOT_CONFIGURED: + $ref: '#/components/examples/CUSTOM_OBJECT_NOT_CONFIGURED' + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_OIDC' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/{uid}/customobject/{objectrecordid}: + get: + summary: Retrieve Custom Object + description: Retrieves the Custom Object associated with the specified User using the UID and record ID. + operationId: getCustomObjectByUidAndRecordId + tags: + - Account Custom Object + parameters: + - $ref: '#/components/parameters/ObjectRecordId' + - $ref: '#/components/parameters/UidPath' + - $ref: '#/components/parameters/ObjectName' + - $ref: '#/components/parameters/CustomObjectId' + responses: + '200': + description: 'Status OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectResponseModel' + examples: + default: + $ref: '#/components/examples/CUSTOM_OBJECT_RESPONSE_EXAMPLE' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + CUSTOM_OBJECT_NAME_REQUIRED: + $ref: '#/components/examples/CUSTOM_OBJECT_NAME_REQUIRED' + CUSTOM_OBJECT_NAME_NOT_VALID: + $ref: '#/components/examples/CUSTOM_OBJECT_NAME_NOT_VALID' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: 'Status Forbidden: The server understood the request, but refuses to authorize it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + REQUEST_EXPIRY_TIME_IS_INVALID: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_IS_INVALID' + SECRET_DOESNT_HAVE_ACCESS: + $ref: '#/components/examples/SECRET_DOESNT_HAVE_ACCESS' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + CUSTOM_OBJECT_NOT_CONFIGURED: + $ref: '#/components/examples/CUSTOM_OBJECT_NOT_CONFIGURED' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + put: + summary: Update Custom Object + description: Updates a Custom Object associated with the authenticated User using the UID and record ID. + operationId: updateCustomObjectByUidAndRecordId + tags: + - Account Custom Object + parameters: + - $ref: '#/components/parameters/ObjectRecordId' + - $ref: '#/components/parameters/UidPath' + - $ref: '#/components/parameters/UpdateType' + - $ref: '#/components/parameters/ObjectName' + - $ref: '#/components/parameters/CustomObjectId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectRequest' + responses: + '200': + description: 'Status OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/CustomObjectResponseModel' + examples: + default: + $ref: '#/components/examples/CUSTOM_OBJECT_RESPONSE_EXAMPLE' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + CUSTOM_OBJECT_NAME_REQUIRED: + $ref: '#/components/examples/CUSTOM_OBJECT_NAME_REQUIRED' + CUSTOM_OBJECT_NAME_NOT_VALID: + $ref: '#/components/examples/CUSTOM_OBJECT_NAME_NOT_VALID' + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + CUSTOM_OBJECT_JSON_NOT_VALID: + $ref: '#/components/examples/CUSTOM_OBJECT_JSON_NOT_VALID' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: 'Status Forbidden: The server understood the request, but refuses to authorize it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + REQUEST_EXPIRY_TIME_IS_INVALID: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_IS_INVALID' + SECRET_DOESNT_HAVE_ACCESS: + $ref: '#/components/examples/SECRET_DOESNT_HAVE_ACCESS' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + CUSTOM_OBJECT_NOT_CONFIGURED: + $ref: '#/components/examples/CUSTOM_OBJECT_NOT_CONFIGURED' + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_OIDC' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + delete: + summary: Delete Custom Object + description: Deletes the Custom Object associated with the specified User using the UID and record ID. + operationId: deleteCustomObjectByUidAndRecordId + tags: + - Account Custom Object + parameters: + - $ref: '#/components/parameters/ObjectRecordId' + - $ref: '#/components/parameters/UidPath' + - $ref: '#/components/parameters/ObjectName' + - $ref: '#/components/parameters/CustomObjectId' + responses: + '200': + description: 'Status OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsDeleted' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + CUSTOM_OBJECT_NAME_REQUIRED: + $ref: '#/components/examples/CUSTOM_OBJECT_NAME_REQUIRED' + CUSTOM_OBJECT_RECORD_ID_NOT_VALID: + $ref: '#/components/examples/CUSTOM_OBJECT_RECORD_ID_NOT_VALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: 'Status Forbidden: The server understood the request, but refuses to authorize it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + REQUEST_EXPIRY_TIME_IS_INVALID: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_IS_INVALID' + SECRET_DOESNT_HAVE_ACCESS: + $ref: '#/components/examples/SECRET_DOESNT_HAVE_ACCESS' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + CUSTOM_OBJECT_NAME_NOT_VALID: + $ref: '#/components/examples/CUSTOM_OBJECT_NAME_NOT_VALID' + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + CUSTOM_OBJECT_NOT_CONFIGURED: + $ref: '#/components/examples/CUSTOM_OBJECT_NOT_CONFIGURED' + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_OIDC' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account: + delete: + summary: Delete Account by Email + description: Deletes an Account based on the specified Email. + operationId: DeleteAccountByEmail + tags: + - Accounts + parameters: + - $ref: '#/components/parameters/Email' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + responses: + '200': + description: Account successfully deleted. + content: + application/json: + schema: + $ref: '#/components/schemas/IsDeletedResponseWithCount' + '400': + description: Bad Request - Invalid or missing parameters. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + EMAIL_REQUIRED: + $ref: '#/components/examples/EMAIL_REQUIRED' + INVALID_EMAIL: + $ref: '#/components/examples/INVALID_EMAIL' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Forbidden - The client is not authorized to perform this action. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + EMAIL_ID_NOT_EXISTS: + $ref: '#/components/examples/EMAIL_ID_NOT_EXISTS' + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + REQUEST_EXPIRY_TIME_IS_INVALID: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_IS_INVALID' + SERVER_SIDE_VALIDATION_ERROR: + $ref: '#/components/examples/SERVER_SIDE_VALIDATION_ERROR' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + get: + summary: Retrieve Account + description: Retrieves Account Identity details using Email, Username, Phone, or Query parameter. + operationId: GetAccountIdentity + tags: + - Accounts + parameters: + - $ref: '#/components/parameters/Email' + - $ref: '#/components/parameters/Username' + - $ref: '#/components/parameters/Phone' + - $ref: '#/components/parameters/QParam' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + responses: + '200': + description: Account Identity retrieved successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/IdentityResponseWithSocialWithoutLogins' + '400': + description: Bad Request - Invalid or missing parameters. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + Q_REQUIRED: + $ref: '#/components/examples/Q_REQUIRED' + Q_NOT_VALID: + $ref: '#/components/examples/Q_NOT_VALID' + QUERY_KEY_REQUIRED: + $ref: '#/components/examples/QUERY_KEY_REQUIRED' + QUERY_VALUE_REQUIRED: + $ref: '#/components/examples/QUERY_VALUE_REQUIRED' + EMAIL_REQUIRED: + $ref: '#/components/examples/EMAIL_REQUIRED' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + USERNAME_REQUIRED: + $ref: '#/components/examples/USERNAME_REQUIRED' + PHONE_REQUIRED: + $ref: '#/components/examples/PHONE_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + MULTIPLE_QUERY_PARAMETERS: + $ref: '#/components/examples/MULTIPLE_QUERY_PARAMETERS' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + QUERY_KEY_INDEX_NOT_FOUND: + $ref: '#/components/examples/QUERY_KEY_INDEX_NOT_FOUND' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Forbidden - The client is not authorized to perform this action. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + EMAIL_ID_NOT_EXISTS: + $ref: '#/components/examples/EMAIL_ID_NOT_EXISTS' + USERNAME_NOT_EXISTS: + $ref: '#/components/examples/USERNAME_NOT_EXISTS' + PHONE_NUMBER_NOT_EXISTS: + $ref: '#/components/examples/PHONE_NUMBER_NOT_EXISTS' + PHONE_NUMBER_LOGIN_ENABLED: + $ref: '#/components/examples/PHONE_NUMBER_LOGIN_ENABLED' + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + REQUEST_EXPIRY_TIME_IS_INVALID: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_IS_INVALID' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + post: + summary: Create Account + description: Creates a new Account with the provided details. + operationId: CreateUser + tags: + - Accounts + parameters: + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ManageRegisterModel' + responses: + '200': + description: User account successfully created. + content: + application/json: + schema: + $ref: '#/components/schemas/IdentityResponseWithSocialWithoutLogins' + '400': + description: Bad Request - Invalid or missing parameters. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + PASSWORD_REQUIRED: + $ref: '#/components/examples/PASSWORD_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + PHONE_OR_EMAIL_REQUIRED_PARAM: + $ref: '#/components/examples/PHONE_OR_EMAIL_REQUIRED_PARAM' + EMAIL_REQUIRED_PARAM: + $ref: '#/components/examples/EMAIL_REQUIRED_PARAM' + PHONE_REQUIRED_PARAM: + $ref: '#/components/examples/PHONE_REQUIRED_PARAM' + USERNAME_REQUIRED_PARAM: + $ref: '#/components/examples/USERNAME_REQUIRED_PARAM' + EMAIL_VALUE_REQUIRED_PARAM: + $ref: '#/components/examples/EMAIL_VALUE_REQUIRED_PARAM' + EMAIL_TYPE_VALUE_REQUIRED_PARAM: + $ref: '#/components/examples/EMAIL_TYPE_VALUE_REQUIRED_PARAM' + EMAIL_TYPE_REQUIRED: + $ref: '#/components/examples/EMAIL_TYPE_REQUIRED' + EMAIL_ID_CAN_NOT_BE_SAME: + $ref: '#/components/examples/EMAIL_ID_CAN_NOT_BE_SAME' + PRIMARY_EMAIL_CAN_BE_ONLY_ONE: + $ref: '#/components/examples/PRIMARY_EMAIL_CAN_BE_ONLY_ONE' + PARAMETER_NOT_FORMATTED: + $ref: '#/components/examples/PARAMETER_NOT_FORMATTED' + ADDRESS_TYPE_REQUIRED: + $ref: '#/components/examples/ADDRESS_TYPE_REQUIRED' + ADDRESS_TYPE_CAN_NOT_BE_SAME: + $ref: '#/components/examples/ADDRESS_TYPE_CAN_NOT_BE_SAME' + BIRTH_DATE_INVALID: + $ref: '#/components/examples/BIRTH_DATE_INVALID' + GENDER_INVALID: + $ref: '#/components/examples/GENDER_INVALID' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + '401': + description: Unauthorized - The request requires User authentication. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: Forbidden - The client is not authorized to perform this action. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ACTIVE_LOGIN_SESSIONS_NOT_ENABLED: + $ref: '#/components/examples/ACTIVE_LOGIN_SESSIONS_NOT_ENABLED' + PRIVACY_POLICY_NOT_ACCEPTED: + $ref: '#/components/examples/PRIVACY_POLICY_NOT_ACCEPTED' + SECURITY_QUESTION_OR_ANSWER_NOT_ENABLED: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_NOT_ENABLED' + SECURITY_QUESTION_NOT_VALID: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_VALID' + SECURITY_QUESTION_OR_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_INVALID' + CUSTOM_FIELD_NOT_VALID: + $ref: '#/components/examples/CUSTOM_FIELD_NOT_VALID' + EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER: + $ref: '#/components/examples/EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER' + THIS_EMAIL_ID_IS_NOT_ALLOWED_TO_REGISTER: + $ref: '#/components/examples/THIS_EMAIL_ID_IS_NOT_ALLOWED_TO_REGISTER' + AGE_UNDERAGE: + $ref: '#/components/examples/AGE_UNDERAGE' + EMAILID_ALREADY_REGISTERED: + $ref: '#/components/examples/EMAILID_ALREADY_REGISTERED' + PHONE_NO_ALREADY_REGISTERED: + $ref: '#/components/examples/PHONE_NO_ALREADY_REGISTERED' + INVALID_PHONE_NUMBER: + $ref: '#/components/examples/INVALID_PHONE_NUMBER' + SMS_CONFIGURATION_NOT_EXISTS: + $ref: '#/components/examples/SMS_CONFIGURATION_NOT_EXISTS' + WEAK_PASSWORD: + $ref: '#/components/examples/WEAK_PASSWORD' + BREACHED_PASSWORD: + $ref: '#/components/examples/BREACHED_PASSWORD' + PASSWORD_IN_HISTORY: + $ref: '#/components/examples/PASSWORD_IN_HISTORY' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + UID_IS_NOT_VALID: + $ref: '#/components/examples/UID_IS_NOT_VALID' + ACCOUNT_ID_IS_ALREADY_REGISTERED: + $ref: '#/components/examples/ACCOUNT_ID_IS_ALREADY_REGISTERED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + PRIVACY_POLICY_NOT_VALID: + $ref: '#/components/examples/PRIVACY_POLICY_NOT_VALID' + PIN_REQUIRED: + $ref: '#/components/examples/PIN_REQUIRED' + REQUEST_EXPIRY_TIME_IS_INVALID: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_IS_INVALID' + SERVER_SIDE_VALIDATION_ERROR: + $ref: '#/components/examples/SERVER_SIDE_VALIDATION_ERROR' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/{uid}: + get: + summary: Retrieve Account by UID + description: Retrieves Account Identity details using the UID. + operationId: GetAccountIdentityByUID + tags: + - Accounts + parameters: + - $ref: '#/components/parameters/UidPath' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + responses: + '200': + description: Account Identity retrieved successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/IdentityResponseWithSocialWithoutLogins' + '400': + description: Bad Request - Invalid or missing parameters. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UID_REQUIRED: + $ref: '#/components/examples/UID_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: Forbidden - The client is not authorized to perform this action. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + REQUEST_EXPIRY_TIME_IS_INVALID: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_IS_INVALID' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + delete: + summary: Delete Account by UID + description: Deletes an Account based on the specified UID. + operationId: DeleteAccountByUID + tags: + - Accounts + parameters: + - $ref: '#/components/parameters/UidPath' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + responses: + '200': + description: Account successfully deleted. + content: + application/json: + schema: + $ref: '#/components/schemas/IsDeletedResponseWithCount' + '400': + description: Bad Request - Invalid or missing parameters. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UID_REQUIRED: + $ref: '#/components/examples/UID_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + REQUEST_EXPIRY_TIME_IS_INVALID: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_IS_INVALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: Forbidden - The client is not authorized to perform this action. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + REQUEST_EXPIRY_TIME_IS_INVALID: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_IS_INVALID' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + put: + summary: Update Account by UID + description: Updates Account details using the UID. + operationId: UpdateAccountProfileByUID + tags: + - Accounts + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + parameters: + - $ref: '#/components/parameters/UidPath' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/NullSupport' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ManageRegisterModel' + responses: + '200': + description: Account profile updated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/IdentityResponseWithSocialWithoutLogins' + '400': + description: Bad Request - Invalid or missing parameters. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UID_REQUIRED: + $ref: '#/components/examples/UID_REQUIRED' + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + PARAMETER_NOT_FORMATTED: + $ref: '#/components/examples/PARAMETER_NOT_FORMATTED' + EMAIL_ID_CAN_NOT_BE_SAME: + $ref: '#/components/examples/EMAIL_ID_CAN_NOT_BE_SAME' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + PRIMARY_EMAIL_CAN_BE_ONLY_ONE: + $ref: '#/components/examples/PRIMARY_EMAIL_CAN_BE_ONLY_ONE' + EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER: + $ref: '#/components/examples/EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER' + THIS_EMAIL_ID_IS_NOT_ALLOWED_TO_REGISTER: + $ref: '#/components/examples/THIS_EMAIL_ID_IS_NOT_ALLOWED_TO_REGISTER' + GENDER_INVALID: + $ref: '#/components/examples/GENDER_INVALID' + BIRTH_DATE_INVALID: + $ref: '#/components/examples/BIRTH_DATE_INVALID' + ADDRESS_TYPE_REQUIRED: + $ref: '#/components/examples/ADDRESS_TYPE_REQUIRED' + ADDRESS_TYPE_CAN_NOT_BE_SAME: + $ref: '#/components/examples/ADDRESS_TYPE_CAN_NOT_BE_SAME' + EMAIL_TYPE_VALUE_REQUIRED_PARAM: + $ref: '#/components/examples/EMAIL_TYPE_VALUE_REQUIRED_PARAM' + EMAIL_VALUE_REQUIRED_PARAM: + $ref: '#/components/examples/EMAIL_VALUE_REQUIRED_PARAM' + EMAIL_TYPE_REQUIRED: + $ref: '#/components/examples/EMAIL_TYPE_REQUIRED' + USERNAME_REQUIRED: + $ref: '#/components/examples/USERNAME_REQUIRED' + PIN_REQUIRED: + $ref: '#/components/examples/PIN_REQUIRED' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: Forbidden - The client is not authorized to perform this action. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + UID_IS_NOT_VALID: + $ref: '#/components/examples/UID_IS_NOT_VALID' + ACCOUNT_ID_IS_ALREADY_REGISTERED: + $ref: '#/components/examples/ACCOUNT_ID_IS_ALREADY_REGISTERED' + CUSTOM_FIELD_NOT_VALID: + $ref: '#/components/examples/CUSTOM_FIELD_NOT_VALID' + SECURITY_QUESTION_OR_ANSWER_NOT_ENABLED: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_NOT_ENABLED' + SECURITY_QUESTION_NOT_VALID: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_VALID' + SECURITY_QUESTION_OR_ANSWER_INVALID: + $ref: '#/components/examples/SECURITY_QUESTION_OR_ANSWER_INVALID' + PRIVACY_POLICY_NOT_ACCEPTED: + $ref: '#/components/examples/PRIVACY_POLICY_NOT_ACCEPTED' + ACTIVE_LOGIN_SESSIONS_NOT_ENABLED: + $ref: '#/components/examples/ACTIVE_LOGIN_SESSIONS_NOT_ENABLED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + REQUEST_EXPIRY_TIME_IS_INVALID: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_IS_INVALID' + /identity/v2/manage/account/access_token: + get: + summary: Retrieve Impersonation Token + description: Retrieves an Impersonation Token for an Account using the UID. + operationId: GetImpersonationToken + tags: + - Accounts + parameters: + - $ref: '#/components/parameters/UidQueryParam' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + responses: + '200': + description: Impersonation token retrieved successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/AccessToken' + '400': + description: Bad Request - Invalid or missing parameters. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UID_REQUIRED: + $ref: '#/components/examples/UID_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + '401': + description: Unauthorized - The request requires User authentication. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: Forbidden - The client is not authorized to perform this action. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/ACTIVE_SESSIONS_EXCEEDED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + REQUEST_EXPIRY_TIME_IS_INVALID: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_IS_INVALID' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/sott: + get: + summary: Generate SOTT + description: Generates a Secure One Time Token (SOTT) with a given expiration time. + operationId: GenerateSott + tags: + - Accounts + parameters: + - name: timedifference + in: query + required: false + description: The time difference you would like to pass. If no value is passed, the default value is 10 minutes. + schema: + type: string + default: '10' + example: '10' + responses: + '200': + description: SOTT generated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/GenerateSottResponse' + '400': + description: Bad Request - Invalid or missing parameters. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + PARAMETER_NOT_FORMATTED: + $ref: '#/components/examples/PARAMETER_NOT_FORMATTED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + '401': + description: Unauthorized - The request requires application authentication. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: Forbidden - The client is not authorized to perform this action. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + REQUEST_EXPIRY_TIME_IS_INVALID: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_IS_INVALID' + '500': + description: Internal Server Error - The server encountered an unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + SOMETHING_GOING_WRONG: + $ref: '#/components/examples/SOMETHING_GOING_WRONG' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + /identity/v2/manage/account/forgot/token: + post: + summary: Retrieve Forgot Password Token + description: Generates a Forgot Password Token for the User and optionally sends an Email with the token. + operationId: ForgotPasswordTokenAndEmail + tags: + - Multipurpose Tokens + parameters: + - $ref: '#/components/parameters/SendEmail' + - $ref: '#/components/parameters/ResetPasswordUrl' + - $ref: '#/components/parameters/EmailTemplate' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + requestBody: + required: true + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/UsernameModel' + - $ref: '#/components/schemas/EmailToValidateServerSide' + responses: + '200': + description: Forgot Password token generated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/ForgotPasswordTokenModel' + '400': + description: Bad Request - Invalid or missing parameters. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + EMAIL_REQUIRED: + $ref: '#/components/examples/EMAIL_REQUIRED' + USERNAME_REQUIRED_CORE: + $ref: '#/components/examples/USERNAME_REQUIRED_CORE' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + INVALID_REQUEST_BODY: + $ref: '#/components/examples/INVALID_REQUEST_BODY' + EMAILID_OR_USERNAME_REQUIRD: + $ref: '#/components/examples/EMAILID_OR_USERNAME_REQUIRD' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + SEND_EMAIL_INVALID_PARAMETER: + $ref: '#/components/examples/SEND_EMAIL_INVALID_PARAMETER' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + '401': + description: Unauthorized - The request requires User authentication. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Forbidden - The client is not authorized to perform this action. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + EMAIL_SEND_LIMIT_REACHED: + $ref: '#/components/examples/EMAIL_SEND_LIMIT_REACHED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + REQUEST_EXPIRY_TIME_IS_INVALID: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_IS_INVALID' + RESET_PASSWORD_URL_INVALID: + $ref: '#/components/examples/RESET_PASSWORD_URL_INVALID' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/vtoken: + get: + summary: Retrieve Email Verification Token + description: Retrieves an Email Verification Token for a specified Email. Optionally sends the verification Email to the User when sendemail is set to true. + operationId: GetVerificationToken + tags: + - Multipurpose Tokens + parameters: + - $ref: '#/components/parameters/Email' + - $ref: '#/components/parameters/VType' + - $ref: '#/components/parameters/ExpireIn' + - $ref: '#/components/parameters/SendEmail' + - $ref: '#/components/parameters/VerificationUrl' + - $ref: '#/components/parameters/EmailTemplate' + responses: + '200': + description: Verification token retrieved successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/VerificationLinkResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + EMAIL_REQUIRED: + $ref: '#/components/examples/EMAIL_REQUIRED' + VERIFICATION_TYPE_REQUIRED: + $ref: '#/components/examples/VERIFICATION_TYPE_REQUIRED' + VTYPE_INVALID: + $ref: '#/components/examples/VTYPE_INVALID' + EXPIRE_IN_INVALID_FORMAT: + $ref: '#/components/examples/EXPIRE_IN_INVALID_FORMAT' + SEND_EMAIL_INVALID_PARAMETER: + $ref: '#/components/examples/SEND_EMAIL_INVALID_PARAMETER' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + EMAILID_VERIFICATION_DISABLE: + $ref: '#/components/examples/EMAILID_VERIFICATION_DISABLE' + USER_NOT_EXISTS: + $ref: '#/components/examples/USER_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + EMAIL_ALLREADY_VERIFIED_TOKEN: + $ref: '#/components/examples/EMAIL_ALLREADY_VERIFIED_TOKEN' + VERIFICATION_URL_IS_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_URL_IS_NOT_VALID' + EMAIL_SENDING_FAIL: + $ref: '#/components/examples/EMAIL_SENDING_FAIL' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/identities: + get: + summary: Retrieve Account by Email + description: Retrieves Account associated with a specified Email. + operationId: GetIdentities + tags: + - Accounts + parameters: + - $ref: '#/components/parameters/Email' + - $ref: '#/components/parameters/Fields' + responses: + '200': + description: User Identities retrieved successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/IdentitiesResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + EMAIL_REQUIRED: + $ref: '#/components/examples/EMAIL_REQUIRED' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + PHONE_NUMBER_LOGIN_ENABLED: + $ref: '#/components/examples/PHONE_NUMBER_LOGIN_ENABLED' + EMAIL_ID_NOT_EXISTS: + $ref: '#/components/examples/EMAIL_ID_NOT_EXISTS' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/{uid}/email: + delete: + summary: Delete Email + description: Removes an Email from an Account. + operationId: DeleteEmailFromAccount + tags: + - Accounts + parameters: + - $ref: '#/components/parameters/UidPath' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EmailModelManage' + responses: + '200': + description: Email successfully deleted from the Account. + content: + application/json: + schema: + $ref: '#/components/schemas/Identity' + '400': + description: Bad Request - Invalid or missing parameters. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UID_REQUIRED: + $ref: '#/components/examples/UID_REQUIRED' + DELETE_BODY_INVALID: + $ref: '#/components/examples/DELETE_BODY_INVALID' + PARAMETER_NOT_FORMATTED: + $ref: '#/components/examples/PARAMETER_NOT_FORMATTED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: Forbidden - The client is not authorized to perform this action. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + ONE_EMAILID_IS_REQUIRED: + $ref: '#/components/examples/ONE_EMAILID_IS_REQUIRED' + EMAIL_ID_NOT_EXISTS: + $ref: '#/components/examples/EMAIL_ID_NOT_EXISTS' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + put: + summary: Upsert Email + description: Adds or updates an Email associated with an Account using the UID. + operationId: UpsertEmailForAccount + tags: + - Accounts + parameters: + - $ref: '#/components/parameters/UidPath' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpsertEmailModel' + responses: + '200': + description: Email successfully upserted for the Account. + content: + application/json: + schema: + $ref: '#/components/schemas/IdentityResponseWithSocialWithoutLogins' + '400': + description: Bad Request - Invalid or missing parameters. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + EMAIL_CAN_NOT_NULL: + $ref: '#/components/examples/EMAIL_CAN_NOT_NULL' + EMAIL_TYPE_AND_VALUE_CAN_NOT_NULL: + $ref: '#/components/examples/EMAIL_TYPE_AND_VALUE_CAN_NOT_NULL' + EMAIL_VALUE_CAN_NOT_NULL: + $ref: '#/components/examples/EMAIL_VALUE_CAN_NOT_NULL' + EMAIL_TYPE_CAN_NOT_NULL: + $ref: '#/components/examples/EMAIL_TYPE_CAN_NOT_NULL' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: Forbidden - The client is not authorized to perform this action. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + CANNOT_ADD_EMAIL_ADDRESS: + $ref: '#/components/examples/CANNOT_ADD_EMAIL_ADDRESS' + EMAILID_ALREADY_REGISTERED: + $ref: '#/components/examples/EMAILID_ALREADY_REGISTERED' + EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER: + $ref: '#/components/examples/EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/{uid}/phoneid: + put: + summary: Update Phone + description: Updates the PhoneID associated with an Account using the UID. + operationId: UpdatePhoneNumber + tags: + - Accounts + parameters: + - $ref: '#/components/parameters/UidPath' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PhoneModel' + responses: + '200': + description: Phone number successfully updated for the Account. + content: + application/json: + schema: + $ref: '#/components/schemas/IdentityResponseWithSocialWithoutLogins' + '400': + description: Bad Request - Invalid or missing parameters. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UID_REQUIRED: + $ref: '#/components/examples/UID_REQUIRED' + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + PHONE_NOT_BLANK: + $ref: '#/components/examples/PHONE_NOT_BLANK' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: Forbidden - The client is not authorized to perform this action. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + PHONE_NO_LOGIN_NOT_ENABLED: + $ref: '#/components/examples/PHONE_NO_LOGIN_NOT_ENABLED' + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + PHONE_NO_ALREADY_REGISTERED: + $ref: '#/components/examples/PHONE_NO_ALREADY_REGISTERED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/{uid}/invalidateemail: + put: + summary: Invalidate Email Verification + description: Invalidates the Email Verification status for an Account using the UID. + operationId: InvalidateEmailVerification + tags: + - Accounts + parameters: + - $ref: '#/components/parameters/UidPath' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/EmailTemplate' + - $ref: '#/components/parameters/VerificationUrl' + responses: + '200': + description: Email Verification status invalidated successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedResponse' + '400': + description: Bad Request - Invalid or missing parameters. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UID_REQUIRED: + $ref: '#/components/examples/UID_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: Forbidden - The client is not authorized to perform this action. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + CAN_NOT_ENFORCE_EMAIL_INVALIDATION: + $ref: '#/components/examples/CAN_NOT_ENFORCE_EMAIL_INVALIDATION' + EMAIL_ALREADY_UNVERIFIED: + $ref: '#/components/examples/EMAIL_ALREADY_UNVERIFIED' + EMAIL_SEND_LIMIT_REACHED: + $ref: '#/components/examples/EMAIL_SEND_LIMIT_REACHED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + VERIFICATION_URL_IS_NOT_VALID: + $ref: '#/components/examples/VERIFICATION_URL_IS_NOT_VALID' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/{uid}/invalidatephone: + put: + summary: Invalidate Phone verification + description: Resets the Phone verification status for an Account using the UID. + operationId: ResetPhoneVerification + tags: + - Accounts + parameters: + - $ref: '#/components/parameters/UidPath' + - $ref: '#/components/parameters/XPreventWebhook' + - $ref: '#/components/parameters/PreventWebhook' + - $ref: '#/components/parameters/SmsTemplate' + - $ref: '#/components/parameters/IsVoiceOtp' + responses: + '200': + description: Phone verification status reset successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedResponse' + '400': + description: Bad Request - Invalid or missing parameters. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UID_REQUIRED: + $ref: '#/components/examples/UID_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + INVALID_PHONE_NUMBER: + $ref: '#/components/examples/INVALID_PHONE_NUMBER' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: Forbidden - The client is not authorized to perform this action. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + PHONE_NO_LOGIN_NOT_ENABLED: + $ref: '#/components/examples/PHONE_NO_LOGIN_NOT_ENABLED' + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + CAN_NOT_ENFORCE_PHONE_INVALIDATION: + $ref: '#/components/examples/CAN_NOT_ENFORCE_PHONE_INVALIDATION' + PHONE_NUMBER_ALREADY_UNVERIFIED: + $ref: '#/components/examples/PHONE_NUMBER_ALREADY_UNVERIFIED' + SMS_CONFIGURATION_NOT_EXISTS: + $ref: '#/components/examples/SMS_CONFIGURATION_NOT_EXISTS' + VOICE_SMS_CONFIGURATION_NOT_ENABLED: + $ref: '#/components/examples/VOICE_SMS_CONFIGURATION_NOT_ENABLED' + SMS_SEND_LIMIT_REACHED: + $ref: '#/components/examples/SMS_SEND_LIMIT_REACHED' + OTP_SEND_FAILED: + $ref: '#/components/examples/OTP_SEND_FAILED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/{uid}/privacypolicy/history: + get: + summary: Retrieve Privacy Policy History + description: Retrieves the Privacy Policy acceptance history for an Account by UID. + operationId: GetPrivacyPolicyHistoryByUid + tags: + - Accounts + parameters: + - $ref: '#/components/parameters/UidPath' + responses: + '200': + description: Privacy Policy History retrieved successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/PrivacyPolicyHistoryResponse' + '400': + description: Bad Request - Invalid or missing parameters. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + '401': + description: Unauthorized - The request requires User authentication. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: Forbidden - The client is not authorized to perform this action. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/{uid}/password: + get: + summary: Retrieve Password + description: Retrieves the Password details for an Account using the UID. + operationId: GetProfilePassword + tags: + - Accounts + parameters: + - $ref: '#/components/parameters/UidPath' + responses: + '200': + description: Password details retrieved successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/PasswordResponse' + '400': + description: Bad Request - Invalid or missing parameters. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: Forbidden - The client is not authorized to perform this action. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + put: + summary: Update Password + description: Sets or updates the Password for an Account using the UID. + operationId: SetProfilePassword + tags: + - Accounts + parameters: + - $ref: '#/components/parameters/UidPath' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PasswordModel' + responses: + '200': + description: Password successfully set for the Account. + content: + application/json: + schema: + $ref: '#/components/schemas/PasswordResponse' + '400': + description: Bad Request - Invalid or missing parameters. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + PASSWORD_REQUIRED: + $ref: '#/components/examples/PASSWORD_REQUIRED' + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + SERVER_SIDE_VALIDATION_ERROR: + $ref: '#/components/examples/SERVER_SIDE_VALIDATION_ERROR' + '401': + description: Unauthorized - The request requires User authentication. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: Forbidden - The client is not authorized to perform this action. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + WEAK_PASSWORD: + $ref: '#/components/examples/WEAK_PASSWORD' + PASSWORD_IN_HISTORY: + $ref: '#/components/examples/PASSWORD_IN_HISTORY' + BREACHED_PASSWORD: + $ref: '#/components/examples/BREACHED_PASSWORD' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/{uid}/reauth/pin: + post: + summary: Verify PIN MFA Token + description: Validates and verifies the 'SecondFactorValidationToken' generated by the Step-Up Authenticate By PIN API. + operationId: ValidateSecondFactorTokenForPin + tags: + - Account Security + parameters: + - $ref: '#/components/parameters/UidPath' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EventBasedSecondFactorToken' + responses: + '200': + description: Second factor token successfully validated for step-up by PIN + content: + application/json: + schema: + $ref: '#/components/schemas/IsValid' + '400': + description: Bad Request - Invalid or missing parameters. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + SECOND_FACTOR_VALIDATION_TOKEN_REQUIRED: + $ref: '#/components/examples/SECOND_FACTOR_VALIDATION_TOKEN_REQUIRED' + UID_REQUIRED: + $ref: '#/components/examples/UID_REQUIRED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: Forbidden - The client is not authorized to perform this action. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_INVALID_OR_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_INVALID_OR_EXPIRED' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + SECRET_DOESNT_HAVE_ACCESS: + $ref: '#/components/examples/SECRET_DOESNT_HAVE_ACCESS' + REQUEST_EXPIRY_TIME_IS_INVALID: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_IS_INVALID' + EVENT_BASED_TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/EVENT_BASED_TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED' + SECOND_FACTOR_VERIFICATION_TOKEN_NOT_VALID: + $ref: '#/components/examples/SECOND_FACTOR_VERIFICATION_TOKEN_NOT_VALID' + PIN_AUTH_NOT_ENABLED: + $ref: '#/components/examples/PIN_AUTH_NOT_ENABLED' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/{uid}/reauth/password: + post: + summary: Verify Password MFA Token + description: Validates and verifies the 'SecondFactorValidationToken' generated by the Step-Up Authenticate By Password API. + operationId: ValidateSecondFactorTokenForPassword + tags: + - Account Security + parameters: + - $ref: '#/components/parameters/UidPath' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EventBasedSecondFactorToken' + responses: + '200': + description: Second factor token successfully validated for step-up by Password + content: + application/json: + schema: + $ref: '#/components/schemas/IsValid' + '400': + description: Bad Request - Invalid or missing parameters. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID' + SECOND_FACTOR_VALIDATION_TOKEN_REQUIRED: + $ref: '#/components/examples/SECOND_FACTOR_VALIDATION_TOKEN_REQUIRED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + UID_REQUIRED: + $ref: '#/components/examples/UID_REQUIRED' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: Forbidden - The client is not authorized to perform this action. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID' + ACCESS_TOKEN_INVALID_OR_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_INVALID_OR_EXPIRED' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED' + SECRET_DOESNT_HAVE_ACCESS: + $ref: '#/components/examples/SECRET_DOESNT_HAVE_ACCESS' + REQUEST_EXPIRY_TIME_IS_INVALID: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_IS_INVALID' + EVENT_BASED_TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/EVENT_BASED_TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT' + TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED' + SECOND_FACTOR_VERIFICATION_TOKEN_NOT_VALID: + $ref: '#/components/examples/SECOND_FACTOR_VERIFICATION_TOKEN_NOT_VALID' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/{uid}/consent/logs: + get: + summary: Retrieve Consent Logs + description: Retrieves Consent Management logs for the specified User. + operationId: GetConsentLogsByUid + tags: + - Accounts + parameters: + - $ref: '#/components/parameters/UidPath' + responses: + '200': + description: 'Status OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/ConsentLogsResponse' + '400': + description: 'Bad Request: The request was invalid or cannot be served.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + '401': + description: 'Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + CONSENT_LOGS_NOT_AVAILABLE: + $ref: '#/components/examples/CONSENT_LOGS_NOT_AVAILABLE' + CONSENT_FORM_NOT_AVAILABLE: + $ref: '#/components/examples/CONSENT_FORM_NOT_AVAILABLE' + CONSENT_FORM_NOT_ENABLED: + $ref: '#/components/examples/CONSENT_FORM_NOT_ENABLED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + SECRET_DOESNT_HAVE_ACCESS: + $ref: '#/components/examples/SECRET_DOESNT_HAVE_ACCESS' + REQUEST_EXPIRY_TIME_IS_INVALID: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_IS_INVALID' + IP_ACCESS_DENIED: + $ref: '#/components/examples/IP_ACCESS_DENIED' + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/2fa/totp: + delete: + tags: + - Account Security + summary: Reset TOTP + description: Resets MFA settings for the specified User. + operationId: MFAResetTotpByUid + parameters: + - $ref: '#/components/parameters/UidQueryParam' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsDeleted' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + UID_REQUIRED: + $ref: '#/components/examples/UID_REQUIRED' + DELETE_BODY_INVALID: + $ref: '#/components/examples/DELETE_BODY_INVALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + SECRET_DOESNT_HAVE_ACCESS: + $ref: '#/components/examples/SECRET_DOESNT_HAVE_ACCESS' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_ENABLED_IN_APP_CONFIG: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_ENABLED_IN_APP_CONFIG' + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_ENABLED_IN_APP_CONFIG_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_ENABLED_IN_APP_CONFIG_OLD' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED' + TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_CONFIGURED_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_CONFIGURED_OLD' + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_CONFIGURED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_CONFIGURED' + TWO_FACTOR_AUTHENTICATION_NOT_VALID_FOR_DELETE: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_VALID_FOR_DELETE' + TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED_IN_APP_CONFIG: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED_IN_APP_CONFIG' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /identity/v2/manage/account/2fa/sms: + delete: + tags: + - Account Security + summary: Reset SMS Authenticator + description: Resets MFA settings for the specified User. + operationId: MFAResetSMSAuthByUid + parameters: + - $ref: '#/components/parameters/UidQueryParam' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsDeleted' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED' + API_SECRET_OR_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SECRET_OR_SIGNATURE_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED' + API_SIGNATURE_REQUIRED: + $ref: '#/components/examples/API_SIGNATURE_REQUIRED' + API_SIGNATURE_INVALID: + $ref: '#/components/examples/API_SIGNATURE_INVALID' + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_INVALID_FORMAT' + REQUEST_EXPIRY_TIME_REQUIRED: + $ref: '#/components/examples/REQUEST_EXPIRY_TIME_REQUIRED' + UID_REQUIRED: + $ref: '#/components/examples/UID_REQUIRED' + DELETE_BODY_INVALID: + $ref: '#/components/examples/DELETE_BODY_INVALID' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED' + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID' + SECRET_DOESNT_HAVE_ACCESS: + $ref: '#/components/examples/SECRET_DOESNT_HAVE_ACCESS' + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_ENABLED' + RAAS_PROFILE_NOT_EXISTS: + $ref: '#/components/examples/RAAS_PROFILE_NOT_EXISTS' + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_ENABLED_IN_APP_CONFIG: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_ENABLED_IN_APP_CONFIG' + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_ENABLED_IN_APP_CONFIG_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_ENABLED_IN_APP_CONFIG_OLD' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD' + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED' + TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED' + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_CONFIGURED_OLD: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_CONFIGURED_OLD' + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_CONFIGURED: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_CONFIGURED' + TWO_FACTOR_AUTHENTICATION_NOT_VALID_FOR_DELETE: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_NOT_VALID_FOR_DELETE' + TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED_IN_APP_CONFIG: + $ref: '#/components/examples/TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED_IN_APP_CONFIG' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + - Digest: [] + XRequestExpiresTime: [] + /api/v2/access_token/refresh: + get: + summary: Refresh Access Token + description: Refreshes the Access Token using a valid Refresh Token to extend session validity. The resulting token lifetime depends on the `expiresin` parameter and the User's registration profile (see the `expiresin` parameter). + operationId: NativeRefreshAccessToken + tags: + - Account Session + security: + - XLoginRadiusAPISecret: [] + - ApiSecret: [] + parameters: + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/IsWeb' + - $ref: '#/components/parameters/ExpiresIn' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/AccessTokenResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponseNative' + examples: + GENERIC_REQUIRED: + $ref: '#/components/examples/GENERIC_REQUIRED' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND_NATIVE' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponseNative' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID_NATIVE' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponseNative' + examples: + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID_NATIVE' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED_NATIVE' + REFRESH_TOKEN_INVALID: + $ref: '#/components/examples/REFRESH_TOKEN_INVALID_NATIVE' + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT_NATIVE' + ENDPOINT_NOT_SUPPORTED_BY_CURRENT_PROVIDER: + $ref: '#/components/examples/ENDPOINT_NOT_SUPPORTED_BY_CURRENT_PROVIDER' + PROVIDER_SIDE_ERROR: + $ref: '#/components/examples/PROVIDER_SIDE_ERROR_NATIVE' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST_NATIVE' + /api/v2/access_token: + get: + summary: Retrieve Access Token + description: Translates the Request Token obtained during authentication into an Access Token for use with other API calls. + operationId: GetAccessToken + tags: + - Account Session + security: + - XLoginRadiusAPISecret: [] + - ApiSecret: [] + parameters: + - $ref: '#/components/parameters/Token' + responses: + '200': + description: 'Status Ok: The request was successful' + content: + application/json: + schema: + $ref: '#/components/schemas/AccessTokenResponse' + '400': + description: 'Status Bad Request: The request was invalid or cannot be otherwise served.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponseNative' + examples: + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND_NATIVE' + '401': + description: 'Status Unauthorized: The request requires User authentication or the provided credentials are invalid.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponseNative' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID_NATIVE' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponseNative' + examples: + REQUEST_TOKEN_NOT_VALID: + $ref: '#/components/examples/REQUEST_TOKEN_NOT_VALID_NATIVE' + REQUEST_TOKEN_EXPIRED: + $ref: '#/components/examples/REQUEST_TOKEN_EXPIRED' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID_NATIVE' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED_NATIVE' + /api/v2/access_token/validate: + get: + summary: Validate Access Token + description: Validates the provided Access Token to ensure its authenticity and validity. + operationId: ValidateAccessToken + tags: + - Account Session + security: + - XLoginRadiusAPISecret: [] + XLoginRadiusAPIKey: [] + - ApiSecret: [] + APIKey: [] + parameters: + - $ref: '#/components/parameters/AccessTokenRequired' + responses: + '200': + description: 'Status Ok: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/AccessTokenResponse' + '400': + description: 'Status Bad Request: The request was invalid or cannot be served.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponseNative' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED_NATIVE' + GENERIC_REQUIRED: + $ref: '#/components/examples/GENERIC_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED_NATIVE' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED_NATIVE' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED_NATIVE' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND_NATIVE' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponseNative' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID_NATIVE' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponseNative' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID_NATIVE' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID_NATIVE' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED_NATIVE' + /api/v2/access_token/invalidate: + get: + summary: Invalidate Access Token + description: Invalidates the specified Access Token, terminating its validity. + operationId: NativeInvalidateAccessToken + tags: + - Account Session + parameters: + - $ref: '#/components/parameters/AccessToken' + - $ref: '#/components/parameters/PreventRefresh' + security: + - XLoginRadiusAPISecret: [] + XLoginRadiusAPIKey: [] + - ApiSecret: [] + APIKey: [] + responses: + '200': + description: 'Status Ok: The request was successful' + content: + application/json: + schema: + $ref: '#/components/schemas/IsPostedResponse' + '400': + description: 'Status Bad Request: The request was invalid or cannot be served.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponseNative' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED_NATIVE' + GENERIC_REQUIRED: + $ref: '#/components/examples/GENERIC_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED_NATIVE' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED_NATIVE' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED_NATIVE' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND_NATIVE' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponseNative' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID_NATIVE' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponseNative' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID_NATIVE' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID_NATIVE' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED_NATIVE' + /api/v2/access_token/activesession: + get: + summary: Retrieve active session + description: Retrieves details of the current active session for the authenticated User. + operationId: GetActiveSession + tags: + - Account Session + parameters: + - $ref: '#/components/parameters/TokenNotRequired' + - $ref: '#/components/parameters/ProfileId' + - $ref: '#/components/parameters/AccountId' + security: + - XLoginRadiusAPISecret: [] + XLoginRadiusAPIKey: [] + - ApiSecret: [] + APIKey: [] + responses: + '200': + description: 'Status OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/ActiveSessionResponse' + '400': + description: 'Status Bad Request: The request was invalid or cannot be served.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponseNative' + examples: + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED_NATIVE' + GENERIC_REQUIRED: + $ref: '#/components/examples/GENERIC_REQUIRED' + API_SECRET_REQUIRED: + $ref: '#/components/examples/API_SECRET_REQUIRED_NATIVE' + API_SECRET_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_SECRET_NOT_WELL_FORMATTED_NATIVE' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED_NATIVE' + OAUTH_TOKEN_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND_NATIVE' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponseNative' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID_NATIVE' + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponseNative' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID_NATIVE' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID_NATIVE' + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED_NATIVE' + PROFILE_ID_MISSING: + $ref: '#/components/examples/PROFILE_ID_MISSING' + USER_ID_NOT_VALID: + $ref: '#/components/examples/USER_ID_NOT_VALID_NATIVE' + ACCOUNT_ID_REQUIRED: + $ref: '#/components/examples/ACCOUNT_ID_REQUIRED' + ACCOUNT_ID_IS_INVALID: + $ref: '#/components/examples/ACCOUNT_ID_IS_INVALID_NATIVE' + ACTIVE_TOKEN_NOT_EXISTS: + $ref: '#/components/examples/ACTIVE_TOKEN_NOT_EXISTS' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED_OIDC' + /api/v2/access_token/{nativeProvider}: + get: + summary: Login via social provider + description: Retrieves an Access Token for authentication through a native social provider. + operationId: NativeProviderAccessToken + tags: + - Login + parameters: + - $ref: '#/components/parameters/NativeProvider' + - $ref: '#/components/parameters/SocialAppName' + - $ref: '#/components/parameters/RedirectUriOptional' + - $ref: '#/components/parameters/RefreshToken' + - $ref: '#/components/parameters/ProviderName' + - $ref: '#/components/parameters/Code' + - $ref: '#/components/parameters/TwitterToken' + - $ref: '#/components/parameters/TwitterSecret' + - $ref: '#/components/parameters/GoogleAuthCode' + - $ref: '#/components/parameters/ClientId' + - $ref: '#/components/parameters/GoogleAccessToken' + - $ref: '#/components/parameters/IdToken' + - $ref: '#/components/parameters/FourSquareAccessToken' + - $ref: '#/components/parameters/LinkedInAccessToken' + - $ref: '#/components/parameters/FacebookAccessToken' + - $ref: '#/components/parameters/InvitationToken' + responses: + '200': + description: 'Status OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/AccessTokenResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponseNative' + examples: + GENERIC_REQUIRED: + $ref: '#/components/examples/GENERIC_REQUIRED' + REFRESH_TOKEN_REQUIRED: + $ref: '#/components/examples/REFRESH_TOKEN_REQUIRED' + JWTAPP_PROVIDER_REQUIRED: + $ref: '#/components/examples/JWTAPP_PROVIDER_REQUIRED' + PROVIDER_NAME_REQUIRED: + $ref: '#/components/examples/PROVIDER_NAME_REQUIRED' + ACCESS_TOKEN_REQUIRED: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED' + SP_JWT_CONFIG_NOT_FOUND: + $ref: '#/components/examples/SP_JWT_CONFIG_NOT_FOUND' + INVALID_PROVIDER_IN_ORGANIZATION: + $ref: '#/components/examples/INVALID_PROVIDER_IN_ORGANIZATION' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED_PROVIDER' + API_KEY_NOT_WELL_FORMATTED: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED_NATIVE' + '401': + description: 'Status Unauthorized: The request requires User authentication.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponseNative' + examples: + API_SECRET_NOT_VALID: + $ref: '#/components/examples/API_SECRET_NOT_VALID_NATIVE' + '403': + description: 'Status Forbidden: The server understood the request, but refuses to authorize it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponseNative' + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID_NATIVE' + PROVIDER_NAME_NOT_VALID: + $ref: '#/components/examples/PROVIDER_NAME_NOT_VALID' + SOMETHING_GOING_WRONG: + $ref: '#/components/examples/SOMETHING_GOING_WRONG' + TRIAL_PLAN_USER_LIMIT_REACHED: + $ref: '#/components/examples/TRIAL_PLAN_USER_LIMIT_REACHED' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED' + PROVIDER_NOT_CONFIGURED: + $ref: '#/components/examples/PROVIDER_NOT_CONFIGURED' + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED' + PROVIDER_NOT_SUPPORTED: + $ref: '#/components/examples/PROVIDER_NOT_SUPPORTED' + PROVIDER_NOT_VALID: + $ref: '#/components/examples/PROVIDER_NOT_VALID' + PROVIDER_SIDE_ERROR: + $ref: '#/components/examples/PROVIDER_SIDE_ERROR_NATIVE' + CLIENT_GUID_MUST_BE_UNIQUE: + $ref: '#/components/examples/CLIENT_GUID_MUST_BE_UNIQUE' + EMAIL_DOMAIN_NOT_ALLOWED_IN_ORGANIZATION: + $ref: '#/components/examples/EMAIL_DOMAIN_NOT_ALLOWED_IN_ORGANIZATION' + AUTOLOOKUP_DOMAIN_NOT_MATCH: + $ref: '#/components/examples/AUTOLOOKUP_DOMAIN_NOT_MATCH' + '500': + description: 'Status Internal Server Error: The server encountered an unexpected condition that prevented it from fulfilling the request.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponseNative' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - APIKey: [] + ApiSecret: [] + - XLoginRadiusAPISecret: [] + XLoginRadiusAPIKey: [] + /v2/manage/invitations/{invitationid}: + get: + summary: Retrieve invitation by ID + operationId: getInvitationByInvitationId + description: Retrieves invitation details by invitation ID. + tags: + - User + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + parameters: + - $ref: '#/components/parameters/InvitationId' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/Invitation' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + INVITATION_ID_REQUIRED: + $ref: '#/components/examples/INVITATION_ID_REQUIRED' + INVALID_INVITATION_ID: + $ref: '#/components/examples/INVALID_INVITATION_ID' + B2B_NOT_ENABLED: + $ref: '#/components/examples/B2B_NOT_ENABLED' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + INVITATION_NOT_FOUND: + $ref: '#/components/examples/INVITATION_NOT_FOUND' + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_PARTNER' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + put: + summary: Update invitation by ID + operationId: updateInvitationByInvitationId + description: Updates invitation details by invitation ID. + tags: + - Organization Invitations + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + parameters: + - $ref: '#/components/parameters/InvitationId' + - $ref: '#/components/parameters/InvitationUrl' + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + RolesIds: + type: array + description: The list of Role IDs associated with the invitation. Each Role ID is typically in the format *role_*, where ** is a string of alphanumeric characters. + items: + type: string + example: + - role_123456 + - role_78901 + ResendEmail: + type: boolean + description: Indicates whether to resend the invitation Email. If set to true, the invitation Email will be resent to the User. + example: true + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/Invitation' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + INVITATION_ID_INVALID: + $ref: '#/components/examples/INVITATION_ID_REQUIRED' + INVALID_JSON_BODY: + $ref: '#/components/examples/INVALID_JSON_BODY' + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED_PARTNER' + INVITATION_ID_REQUIRED: + $ref: '#/components/examples/INVITATION_ID_REQUIRED' + ROLE_OR_RESEND_EMAIL_REQUIRED: + $ref: '#/components/examples/ROLE_OR_RESEND_EMAIL_REQUIRED' + INVALID_INVITATION_URL: + $ref: '#/components/examples/INVALID_INVITATION_URL' + INVITATION_ACCEPTED: + $ref: '#/components/examples/INVITATION_ACCEPTED' + INVITATION_EXPIRED: + $ref: '#/components/examples/INVITATION_EXPIRED' + INVITATION_REVOKED: + $ref: '#/components/examples/INVITATION_REVOKED' + INVALID_ROLE_ID: + $ref: '#/components/examples/INVALID_ROLE_ID' + INVALID_INVITER_UID: + $ref: '#/components/examples/INVALID_INVITER_UID' + B2B_NOT_ENABLED: + $ref: '#/components/examples/B2B_NOT_ENABLED' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + INVITATION_NOT_FOUND: + $ref: '#/components/examples/INVITATION_NOT_FOUND' + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_PARTNER' + ROLE_NOT_EXIST: + $ref: '#/components/examples/ROLE_NOT_EXIST' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + delete: + summary: Delete invitation by ID + operationId: deleteInvitationByInvitationId + description: Deletes or revokes an invitation by invitation ID. + tags: + - Organization Invitations + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + parameters: + - $ref: '#/components/parameters/InvitationId' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/Invitation' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + INVITATION_ID_INVALID: + $ref: '#/components/examples/INVITATION_ID_REQUIRED' + Invitation_ID_REQUIRED: + $ref: '#/components/examples/INVITATION_ID_REQUIRED' + INVITATION_ACCEPTED: + $ref: '#/components/examples/INVITATION_ACCEPTED' + INVITATION_EXPIRED: + $ref: '#/components/examples/INVITATION_EXPIRED' + INVITATION_REVOKED: + $ref: '#/components/examples/INVITATION_REVOKED' + B2B_NOT_ENABLED: + $ref: '#/components/examples/B2B_NOT_ENABLED' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + INVITATION_NOT_FOUND: + $ref: '#/components/examples/INVITATION_NOT_FOUND' + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_PARTNER' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /v2/manage/invitations: + get: + summary: List invitations by Organization ID + operationId: getInvitationsByOrgId + description: Lists all invitations by Organization ID. + tags: + - Organization Invitations + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + parameters: + - name: orgid + in: query + required: true + schema: + type: string + description: The ID of the Organization to retrieve invitations for. + example: org_123456789 + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + type: object + properties: + Data: + type: array + items: + $ref: '#/components/schemas/Invitation' + TotalCount: + type: integer + example: 100 + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ORGANIZATION_ID_REQUIRED: + $ref: '#/components/examples/ORGANIZATION_ID_REQUIRED' + ORGANIZATION_ID_INVALID: + $ref: '#/components/examples/ORGANIZATION_ID_INVALID' + B2B_NOT_ENABLED: + $ref: '#/components/examples/B2B_NOT_ENABLED' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_PARTNER' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + post: + summary: Send invitation + operationId: sendInvitation + description: Sends a new invitation. + tags: + - Organization Invitations + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + parameters: + - $ref: '#/components/parameters/InvitationUrl' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SendInvitation' + example: + email: user@example.com + roleIds: + - role_12345 + - role_67890 + orgId: org_123456789 + inviterUid: '123456789' + responses: + '200': + description: Invitation sent successfully + content: + application/json: + schema: + $ref: '#/components/schemas/Invitation' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_POST_BODY_REQUIRED: + $ref: '#/components/examples/JSON_POST_BODY_REQUIRED' + INVALID_JSON_BODY: + $ref: '#/components/examples/INVALID_JSON_BODY' + SEND_INVITATION_REQUIRED: + $ref: '#/components/examples/SEND_INVITATION_REQUIRED' + INVALID_INVITATION_URL: + $ref: '#/components/examples/INVALID_INVITATION_URL' + INVALID_EMAIL: + $ref: '#/components/examples/INVALID_EMAIL' + ORGANIZATION_ID_INVALID: + $ref: '#/components/examples/ORGANIZATION_ID_INVALID' + INVALID_ROLE_ID: + $ref: '#/components/examples/INVALID_ROLE_ID' + INVALID_INVITER_UID: + $ref: '#/components/examples/INVALID_INVITER_UID' + INVITATION_ALREADY_ACTIVE: + $ref: '#/components/examples/INVITATION_ALREADY_ACTIVE' + B2B_NOT_ENABLED: + $ref: '#/components/examples/B2B_NOT_ENABLED' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_PARTNER' + ROLE_NOT_EXIST: + $ref: '#/components/examples/ROLE_NOT_EXIST' + '409': + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + USER_EXISTS_IN_ORG: + $ref: '#/components/examples/USER_EXISTS_IN_ORG' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /v2/manage/invitations/{invitationid}/resend: + post: + summary: Resend invitation by ID + operationId: resendInvitationByInvitationId + description: Resends an invitation by invitation ID. + tags: + - Organization Invitations + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + parameters: + - $ref: '#/components/parameters/InvitationId' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/ResendInvitation' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + INVITATION_ID_REQUIRED: + $ref: '#/components/examples/INVITATION_ID_REQUIRED' + INVALID_INVITATION_ID: + $ref: '#/components/examples/INVALID_INVITATION_ID' + INVITATION_ACCEPTED: + $ref: '#/components/examples/INVITATION_ACCEPTED' + INVITATION_EXPIRED: + $ref: '#/components/examples/INVITATION_EXPIRED' + INVITATION_REVOKED: + $ref: '#/components/examples/INVITATION_REVOKED' + B2B_NOT_ENABLED: + $ref: '#/components/examples/B2B_NOT_ENABLED' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + INVITATION_NOT_FOUND: + $ref: '#/components/examples/INVITATION_NOT_FOUND' + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_PARTNER' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /v2/manage/organizations: + get: + description: Retrieves a list of all Organizations in the Tenant. + operationId: GetAllOrganizations + responses: + '200': + content: + application/json: + schema: + type: object + properties: + Data: + items: + $ref: '#/components/schemas/OrganizationsResponse' + type: array + description: 'OK: The request was successful.' + '400': + content: + application/json: + examples: + B2B_NOT_ENABLED: + $ref: '#/components/examples/B2B_NOT_ENABLED' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + '403': + content: + application/json: + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '500': + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Internal Server Error: The server encountered an unexpected error.' + summary: List Organizations + tags: + - Organization + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + post: + description: Creates a new Organization in the Tenant. + operationId: CreateOrganization + requestBody: + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/OrganizationBase' + - type: object + required: + - Name + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationsResponse' + description: 'OK: The request was successful.' + '400': + content: + application/json: + examples: + DOMAIN_DUPLICATE: + $ref: '#/components/examples/DOMAIN_DUPLICATE' + DOMAIN_NAME_INVALID: + $ref: '#/components/examples/DOMAIN_NAME_INVALID' + DOMAIN_NO_VALID_MX_RECORD: + $ref: '#/components/examples/DOMAIN_NO_VALID_MX_RECORD' + DOMAIN_SPAM_OR_GENERIC_DOMAIN: + $ref: '#/components/examples/DOMAIN_SPAM_OR_GENERIC_DOMAIN' + JSON_POST_BODY_REQUIRED: + $ref: '#/components/examples/JSON_POST_BODY_REQUIRED' + NAME_REQUIRED: + $ref: '#/components/examples/NAME_REQUIRED' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + '403': + content: + application/json: + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + TRIAL_PLAN_ORG_LIMIT_REACHED: + $ref: '#/components/examples/TRIAL_PLAN_ORG_LIMIT_REACHED' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '409': + content: + application/json: + examples: + ORGANIZATION_ALREADY_EXIST: + $ref: '#/components/examples/ORGANIZATION_ALREADY_EXIST' + ORGANIZATION_DOMAIN_ALREADY_EXIST: + $ref: '#/components/examples/ORGANIZATION_DOMAIN_ALREADY_EXIST' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + '500': + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Internal Server Error: The server encountered an unexpected error.' + summary: Create Organization + tags: + - Organization + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + /v2/manage/organizations/{orgId}: + delete: + description: Deletes an Organization by its ID. + operationId: DeleteOrganization + parameters: + - $ref: '#/components/parameters/orgId' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + description: 'OK: The request was successful.' + '400': + content: + application/json: + examples: + ORGANIZATION_ID_INVALID: + $ref: '#/components/examples/ORGANIZATION_ID_INVALID' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + '403': + content: + application/json: + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '404': + content: + application/json: + examples: + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '500': + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Internal Server Error: The server encountered an unexpected error.' + summary: Delete Organization + tags: + - Organization + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + get: + description: Retrieves details of a specific Organization by its ID. + operationId: GetOrganization + parameters: + - $ref: '#/components/parameters/orgId' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationsResponse' + description: 'OK: The request was successful.' + '400': + content: + application/json: + examples: + ORGANIZATION_ID_INVALID: + $ref: '#/components/examples/ORGANIZATION_ID_INVALID' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + '403': + content: + application/json: + examples: + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '404': + content: + application/json: + examples: + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '500': + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Internal Server Error: The server encountered an unexpected error.' + summary: Retrieve Organization details + tags: + - Organization + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + put: + description: Updates an Organization by its ID. Supports updating org fields, policies, and status in a single request. + operationId: UpdateOrganization + parameters: + - $ref: '#/components/parameters/orgId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationUpdateRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationsResponse' + description: 'OK: The request was successful.' + '400': + content: + application/json: + examples: + DOMAIN_DUPLICATE: + $ref: '#/components/examples/DOMAIN_DUPLICATE' + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED_PARTNER' + ORGANIZATION_ID_INVALID: + $ref: '#/components/examples/ORGANIZATION_ID_INVALID' + ORGANIZATION_MEMBER_ROLE_NOT_VALID: + $ref: '#/components/examples/ORGANIZATION_MEMBER_ROLE_NOT_VALID' + STATUS_UPDATE_INVALID: + $ref: '#/components/examples/STATUS_UPDATE_INVALID' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + '403': + content: + application/json: + examples: + ORGANIZATION_DOMAIN_CAN_NOT_DELETED: + $ref: '#/components/examples/ORGANIZATION_DOMAIN_CAN_NOT_DELETED' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + ORGANIZATION_JIT_POLICY_NOT_ALLOWED: + $ref: '#/components/examples/ORGANIZATION_JIT_POLICY_NOT_ALLOWED' + ORGANIZATION_MFA_ENFORCEMENT_NOT_ALLOWED: + $ref: '#/components/examples/ORGANIZATION_MFA_ENFORCEMENT_NOT_ALLOWED' + ORGANIZATION_MFA_NONE_ENFORCEMENT_NOT_ALLOWED: + $ref: '#/components/examples/ORGANIZATION_MFA_NONE_ENFORCEMENT_NOT_ALLOWED' + ORGANIZATION_MFA_ENFORCEMENT_ONLY_FORCE_ALLOWED: + $ref: '#/components/examples/ORGANIZATION_MFA_ENFORCEMENT_ONLY_FORCE_ALLOWED' + ORGANIZATION_MFA_FORCE_AUTHENTICATORS_DISABLED: + $ref: '#/components/examples/ORGANIZATION_MFA_FORCE_AUTHENTICATORS_DISABLED' + ORGANIZATION_ENABLE_MFA_ENFORCEMENT_NOT_ALLOWED: + $ref: '#/components/examples/ORGANIZATION_ENABLE_MFA_ENFORCEMENT_NOT_ALLOWED' + ORGANIZATION_DISABLE_MFA_ENFORCEMENT_NOT_ALLOWED: + $ref: '#/components/examples/ORGANIZATION_DISABLE_MFA_ENFORCEMENT_NOT_ALLOWED' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '409': + content: + application/json: + examples: + ORGANIZATION_ALREADY_EXIST: + $ref: '#/components/examples/ORGANIZATION_ALREADY_EXIST' + ORGANIZATION_DOMAIN_ALREADY_EXIST: + $ref: '#/components/examples/ORGANIZATION_DOMAIN_ALREADY_EXIST' + CONNECTION_DOMAIN_ALREADY_EXIST: + $ref: '#/components/examples/CONNECTION_DOMAIN_ALREADY_EXIST' + STATUS_UPDATED_ALREADY: + $ref: '#/components/examples/STATUS_UPDATED_ALREADY' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + '500': + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Internal Server Error: The server encountered an unexpected error.' + summary: Update Organization + tags: + - Organization + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + /v2/manage/organizations/{orgId}/connections: + get: + description: Lists all Identity Provider connections for an Organization. + operationId: GetAllOrganizationConnections + parameters: + - $ref: '#/components/parameters/orgId' + responses: + '200': + content: + application/json: + schema: + type: object + properties: + Data: + items: + $ref: '#/components/schemas/ConnectionResponse' + type: array + description: 'OK: The request was successful.' + '400': + content: + application/json: + examples: + ORGANIZATION_ID_INVALID: + $ref: '#/components/examples/ORGANIZATION_ID_INVALID' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + '403': + content: + application/json: + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '404': + content: + application/json: + examples: + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '500': + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Internal Server Error: The server encountered an unexpected error.' + summary: List Organization connections + tags: + - Organization Connections + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + post: + description: Creates a new Identity Provider connection for an Organization. + operationId: CreateOrganizationConnection + parameters: + - $ref: '#/components/parameters/orgId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationConnectionCreateRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ConnectionResponse' + description: 'OK: The request was successful.' + '400': + content: + application/json: + examples: + CONNECTION_TYPE_INVALID: + $ref: '#/components/examples/CONNECTION_TYPE_INVALID' + CONNECTION_TYPE_REQUIRED: + $ref: '#/components/examples/CONNECTION_TYPE_REQUIRED' + CUSTOM_MAPPING_INVALID: + $ref: '#/components/examples/CUSTOM_MAPPING_INVALID' + JSON_POST_BODY_REQUIRED: + $ref: '#/components/examples/JSON_POST_BODY_REQUIRED' + NAME_INVALID: + $ref: '#/components/examples/NAME_INVALID' + NAME_REQUIRED: + $ref: '#/components/examples/NAME_REQUIRED' + OIDC_IDP_ISSUER_INVALID: + $ref: '#/components/examples/OIDC_IDP_ISSUER_INVALID' + ORGANIZATION_ID_INVALID: + $ref: '#/components/examples/ORGANIZATION_ID_INVALID' + CONN_SAML_IDP_CERTIFICATE_INVALID: + $ref: '#/components/examples/CONN_SAML_IDP_CERTIFICATE_INVALID' + SAML_METADATA_ENDPOINT_INVALID: + $ref: '#/components/examples/SAML_METADATA_ENDPOINT_INVALID' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + '403': + content: + application/json: + examples: + ORGANIZATION_DOMAIN_NOT_VERIFIED: + $ref: '#/components/examples/ORGANIZATION_DOMAIN_NOT_VERIFIED' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '404': + content: + application/json: + examples: + ORGANIZATION_DOMAIN_NOT_EXIST: + $ref: '#/components/examples/ORGANIZATION_DOMAIN_NOT_EXIST' + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '409': + content: + application/json: + examples: + CONNECTION_ALREADY_EXIST: + $ref: '#/components/examples/CONNECTION_ALREADY_EXIST' + CONNECTION_DOMAIN_ALREADY_EXIST: + $ref: '#/components/examples/CONNECTION_DOMAIN_ALREADY_EXIST' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + '500': + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Internal Server Error: The server encountered an unexpected error.' + summary: Create Organization connection + tags: + - Organization Connections + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + /v2/manage/organizations/{orgId}/connections/{connId}: + delete: + description: Deletes an Identity Provider connection from an Organization. + operationId: DeleteOrganizationConnection + parameters: + - $ref: '#/components/parameters/orgId' + - $ref: '#/components/parameters/connId' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + description: 'OK: The request was successful.' + '400': + content: + application/json: + examples: + CONNECTION_ID_INVALID: + $ref: '#/components/examples/CONNECTION_ID_INVALID' + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED_PARTNER' + ORGANIZATION_ID_INVALID: + $ref: '#/components/examples/ORGANIZATION_ID_INVALID' + STATUS_UPDATE_INVALID: + $ref: '#/components/examples/STATUS_UPDATE_INVALID' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + '403': + content: + application/json: + examples: + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '404': + content: + application/json: + examples: + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '409': + content: + application/json: + examples: + STATUS_UPDATED_ALREADY: + $ref: '#/components/examples/STATUS_UPDATED_ALREADY' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + '500': + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Internal Server Error: The server encountered an unexpected error.' + summary: Delete Organization connection + tags: + - Organization Connections + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + get: + description: Retrieves details of a specific Identity Provider connection. + operationId: GetOrganizationConnection + parameters: + - $ref: '#/components/parameters/orgId' + - $ref: '#/components/parameters/connId' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ConnectionResponse' + description: 'OK: The request was successful.' + '400': + content: + application/json: + examples: + CONNECTION_ID_INVALID: + $ref: '#/components/examples/CONNECTION_ID_INVALID' + ORGANIZATION_ID_INVALID: + $ref: '#/components/examples/ORGANIZATION_ID_INVALID' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + '403': + content: + application/json: + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '404': + content: + application/json: + examples: + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '500': + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Internal Server Error: The server encountered an unexpected error.' + summary: Retrieve Organization connection + tags: + - Organization Connections + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + put: + description: Updates the configuration of an Identity Provider connection. + operationId: UpdateOrganizationConnection + parameters: + - $ref: '#/components/parameters/orgId' + - $ref: '#/components/parameters/connId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationConnectionRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ConnectionResponse' + description: 'OK: The request was successful.' + '400': + content: + application/json: + examples: + CONNECTION_ID_INVALID: + $ref: '#/components/examples/CONNECTION_ID_INVALID' + CUSTOM_MAPPING_INVALID: + $ref: '#/components/examples/CUSTOM_MAPPING_INVALID' + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED_PARTNER' + NAME_INVALID: + $ref: '#/components/examples/NAME_INVALID' + OIDC_IDP_ISSUER_INVALID: + $ref: '#/components/examples/OIDC_IDP_ISSUER_INVALID' + ORGANIZATION_ID_INVALID: + $ref: '#/components/examples/ORGANIZATION_ID_INVALID' + CONN_SAML_IDP_CERTIFICATE_INVALID: + $ref: '#/components/examples/CONN_SAML_IDP_CERTIFICATE_INVALID' + SAML_METADATA_ENDPOINT_INVALID: + $ref: '#/components/examples/SAML_METADATA_ENDPOINT_INVALID' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + '403': + content: + application/json: + examples: + ORGANIZATION_DOMAIN_NOT_VERIFIED: + $ref: '#/components/examples/ORGANIZATION_DOMAIN_NOT_VERIFIED' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '404': + content: + application/json: + examples: + ORGANIZATION_DOMAIN_NOT_EXIST: + $ref: '#/components/examples/ORGANIZATION_DOMAIN_NOT_EXIST' + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '409': + content: + application/json: + examples: + CONNECTION_ALREADY_EXIST: + $ref: '#/components/examples/CONNECTION_ALREADY_EXIST' + CONNECTION_DOMAIN_ALREADY_EXIST: + $ref: '#/components/examples/CONNECTION_DOMAIN_ALREADY_EXIST' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + '500': + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Internal Server Error: The server encountered an unexpected error.' + summary: Update Organization connection + tags: + - Organization Connections + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + /v2/manage/organizations/{orgId}/connections/{connId}/grouproles: + get: + description: Lists all group-to-role mappings for an Identity Provider connection. + operationId: GetAllConnectionGroupRoles + parameters: + - $ref: '#/components/parameters/orgId' + - $ref: '#/components/parameters/connId' + responses: + '200': + content: + application/json: + schema: + type: object + properties: + Data: + items: + $ref: '#/components/schemas/ConnectionGroupRoleResponse' + type: array + description: 'OK: The request was successful.' + '400': + content: + application/json: + examples: + CONNECTION_ID_INVALID: + $ref: '#/components/examples/CONNECTION_ID_INVALID' + ORGANIZATION_ID_INVALID: + $ref: '#/components/examples/ORGANIZATION_ID_INVALID' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + '403': + content: + application/json: + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '404': + content: + application/json: + examples: + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '500': + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Internal Server Error: The server encountered an unexpected error.' + summary: List Organization connection group Roles + tags: + - Organization Connection Group Roles + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + post: + description: Creates a new group-to-role mapping for an Identity Provider connection. + operationId: CreateConnectionGroupRole + parameters: + - $ref: '#/components/parameters/connId' + - $ref: '#/components/parameters/orgId' + requestBody: + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/ConnectionGroupRoleRequest' + - type: object + required: + - Name + - GroupId + - RoleId + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ConnectionGroupRoleResponse' + description: 'OK: The request was successful.' + '400': + content: + application/json: + examples: + CONNECTION_ID_INVALID: + $ref: '#/components/examples/CONNECTION_ID_INVALID' + GROUP_ROLE_GROUP_ID_REQUIRED: + $ref: '#/components/examples/GROUP_ROLE_GROUP_ID_REQUIRED' + GROUP_ROLE_ROLE_ID_INVALID: + $ref: '#/components/examples/GROUP_ROLE_ROLE_ID_INVALID' + GROUP_ROLE_ROLE_ID_REQUIRED: + $ref: '#/components/examples/GROUP_ROLE_ROLE_ID_REQUIRED' + INVALID_ROLE_ID: + $ref: '#/components/examples/INVALID_ROLE_ID' + JSON_POST_BODY_REQUIRED: + $ref: '#/components/examples/JSON_POST_BODY_REQUIRED' + NAME_INVALID: + $ref: '#/components/examples/NAME_INVALID' + NAME_REQUIRED: + $ref: '#/components/examples/NAME_REQUIRED' + ORGANIZATION_ID_INVALID: + $ref: '#/components/examples/ORGANIZATION_ID_INVALID' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + '403': + content: + application/json: + examples: + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '404': + content: + application/json: + examples: + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '409': + content: + application/json: + examples: + GROUP_ROLE_NAME_ALREADY_EXIST: + $ref: '#/components/examples/GROUP_ROLE_NAME_ALREADY_EXIST' + GROUP_ROLE_GROUP_ID_ALREADY_EXIST: + $ref: '#/components/examples/GROUP_ROLE_GROUP_ID_ALREADY_EXIST' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + '500': + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Internal Server Error: The server encountered an unexpected error.' + summary: Create Organization connection group Role + tags: + - Organization Connection Group Roles + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + /v2/manage/organizations/{orgId}/connections/{connId}/grouproles/{groupRoleId}: + delete: + description: Deletes a specific group-to-role mapping. + operationId: DeleteConnectionGroupRole + parameters: + - $ref: '#/components/parameters/orgId' + - $ref: '#/components/parameters/connId' + - $ref: '#/components/parameters/groupRoleId' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + description: 'OK: The request was successful.' + '400': + content: + application/json: + examples: + CONNECTION_ID_INVALID: + $ref: '#/components/examples/CONNECTION_ID_INVALID' + GROUP_ROLE_ID_INVALID: + $ref: '#/components/examples/GROUP_ROLE_ID_INVALID' + ORGANIZATION_ID_INVALID: + $ref: '#/components/examples/ORGANIZATION_ID_INVALID' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + '403': + content: + application/json: + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '404': + content: + application/json: + examples: + GROUP_ROLE_NOT_EXIST: + $ref: '#/components/examples/GROUP_ROLE_NOT_EXIST' + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '409': + content: + application/json: + examples: + GROUP_ROLE_NAME_ALREADY_EXIST: + $ref: '#/components/examples/GROUP_ROLE_NAME_ALREADY_EXIST' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + '500': + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Internal Server Error: The server encountered an unexpected error.' + summary: Delete Organization connection group Role + tags: + - Organization Connection Group Roles + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + put: + description: Updates a specific group-to-role mapping. + operationId: UpdateConnectionGroupRole + parameters: + - $ref: '#/components/parameters/connId' + - $ref: '#/components/parameters/groupRoleId' + - $ref: '#/components/parameters/orgId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ConnectionGroupRoleRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ConnectionGroupRoleResponse' + description: 'OK: The request was successful.' + '400': + content: + application/json: + examples: + CONNECTION_ID_INVALID: + $ref: '#/components/examples/CONNECTION_ID_INVALID' + GROUP_ROLE_GROUP_ID_REQUIRED: + $ref: '#/components/examples/GROUP_ROLE_GROUP_ID_REQUIRED' + GROUP_ROLE_ID_INVALID: + $ref: '#/components/examples/GROUP_ROLE_ID_INVALID' + GROUP_ROLE_ROLE_ID_INVALID: + $ref: '#/components/examples/GROUP_ROLE_ROLE_ID_INVALID' + GROUP_ROLE_ROLE_ID_REQUIRED: + $ref: '#/components/examples/GROUP_ROLE_ROLE_ID_REQUIRED' + INVALID_ROLE_ID: + $ref: '#/components/examples/INVALID_ROLE_ID' + JSON_POST_BODY_REQUIRED: + $ref: '#/components/examples/JSON_POST_BODY_REQUIRED' + NAME_INVALID: + $ref: '#/components/examples/NAME_INVALID' + ORGANIZATION_ID_INVALID: + $ref: '#/components/examples/ORGANIZATION_ID_INVALID' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + '403': + content: + application/json: + examples: + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '404': + content: + application/json: + examples: + GROUP_ROLE_NOT_EXIST: + $ref: '#/components/examples/GROUP_ROLE_NOT_EXIST' + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '409': + content: + application/json: + examples: + GROUP_ROLE_NAME_ALREADY_EXIST: + $ref: '#/components/examples/GROUP_ROLE_NAME_ALREADY_EXIST' + GROUP_ROLE_GROUP_ID_ALREADY_EXIST: + $ref: '#/components/examples/GROUP_ROLE_GROUP_ID_ALREADY_EXIST' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + '500': + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Internal Server Error: The server encountered an unexpected error.' + summary: Update Organization connection group Role + tags: + - Organization Connection Group Roles + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + /v2/manage/organizations/{orgId}/connections/{connId}/status: + put: + description: Updates the active status of an Identity Provider connection. + operationId: UpdateConnectionStatus + parameters: + - $ref: '#/components/parameters/orgId' + - $ref: '#/components/parameters/connId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ConnectionStatusRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ConnectionStatusResponse' + description: 'OK: The request was successful.' + '400': + content: + application/json: + examples: + ORGANIZATION_ID_INVALID: + $ref: '#/components/examples/ORGANIZATION_ID_INVALID' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + '403': + content: + application/json: + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '404': + content: + application/json: + examples: + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '500': + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Internal Server Error: The server encountered an unexpected error.' + summary: Update Organization connection status + tags: + - Organization Connections + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + /v2/manage/organizations/{orgId}/domains: + get: + description: Lists all domains associated with an Organization. + operationId: GetAllOrganizationDomains + parameters: + - $ref: '#/components/parameters/orgId' + responses: + '200': + content: + application/json: + schema: + type: object + properties: + Data: + items: + $ref: '#/components/schemas/OrganizationsDomainsResponse' + type: array + description: 'OK: The request was successful.' + '400': + content: + application/json: + examples: + ORGANIZATION_ID_INVALID: + $ref: '#/components/examples/ORGANIZATION_ID_INVALID' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + '403': + content: + application/json: + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '404': + content: + application/json: + examples: + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '500': + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Internal Server Error: The server encountered an unexpected error.' + summary: List Organization domains + tags: + - Organization Domains + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + post: + description: Adds a new domain to an Organization. + operationId: AddOrganizationDomain + parameters: + - $ref: '#/components/parameters/orgId' + requestBody: + content: + application/json: + schema: + type: object + properties: + DomainName: + type: string + example: example.com + required: + - DomainName + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationsDomainsResponse' + description: 'OK: The request was successful.' + '400': + content: + application/json: + examples: + DOMAIN_NO_VALID_MX_RECORD: + $ref: '#/components/examples/DOMAIN_NO_VALID_MX_RECORD' + DOMAIN_SPAM_OR_GENERIC_DOMAIN: + $ref: '#/components/examples/DOMAIN_SPAM_OR_GENERIC_DOMAIN' + JSON_POST_BODY_REQUIRED: + $ref: '#/components/examples/JSON_POST_BODY_REQUIRED' + ORGANIZATION_DOMAIN_ID_INVALID: + $ref: '#/components/examples/ORGANIZATION_DOMAIN_ID_INVALID' + ORGANIZATION_DOMAIN_NAME_INVALID: + $ref: '#/components/examples/ORGANIZATION_DOMAIN_NAME_INVALID' + ORGANIZATION_ID_INVALID: + $ref: '#/components/examples/ORGANIZATION_ID_INVALID' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + '403': + content: + application/json: + examples: + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '404': + content: + application/json: + examples: + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '500': + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Internal Server Error: The server encountered an unexpected error.' + summary: Add Organization domain + tags: + - Organization Domains + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + /v2/manage/organizations/{orgId}/domains/{domainId}: + delete: + description: Deletes a domain from an Organization. + operationId: DeleteOrganizationDomain + parameters: + - $ref: '#/components/parameters/orgId' + - $ref: '#/components/parameters/domainId' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + description: 'OK: The request was successful.' + '400': + content: + application/json: + examples: + ORGANIZATION_DOMAIN_ID_INVALID: + $ref: '#/components/examples/ORGANIZATION_DOMAIN_ID_INVALID' + ORGANIZATION_ID_INVALID: + $ref: '#/components/examples/ORGANIZATION_ID_INVALID' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + '403': + content: + application/json: + examples: + ORGANIZATION_DOMAIN_CAN_NOT_DELETED: + $ref: '#/components/examples/ORGANIZATION_DOMAIN_CAN_NOT_DELETED' + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '404': + content: + application/json: + examples: + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '500': + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Internal Server Error: The server encountered an unexpected error.' + summary: Delete Organization domain + tags: + - Organization Domains + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + get: + description: Retrieves details of a specific Organization domain. + operationId: GetOrganizationDomain + parameters: + - $ref: '#/components/parameters/orgId' + - $ref: '#/components/parameters/domainId' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationsDomainsResponse' + description: 'OK: The request was successful.' + '400': + content: + application/json: + examples: + ORGANIZATION_ID_INVALID: + $ref: '#/components/examples/ORGANIZATION_ID_INVALID' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + '403': + content: + application/json: + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '404': + content: + application/json: + examples: + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '500': + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Internal Server Error: The server encountered an unexpected error.' + summary: Retrieve Organization domain + tags: + - Organization Domains + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + post: + description: Verifies the ownership of an Organization domain. + operationId: VerifyOrganizationDomain + parameters: + - $ref: '#/components/parameters/domainId' + - $ref: '#/components/parameters/orgId' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationsDomainsResponse' + description: 'OK: The request was successful.' + '400': + content: + application/json: + examples: + DOMAIN_TXT_RECORD_FAILED: + $ref: '#/components/examples/DOMAIN_TXT_RECORD_FAILED' + ORGANIZATION_DOMAIN_ALREADY_VERIFY: + $ref: '#/components/examples/ORGANIZATION_DOMAIN_ALREADY_VERIFY' + ORGANIZATION_DOMAIN_ID_INVALID: + $ref: '#/components/examples/ORGANIZATION_DOMAIN_ID_INVALID' + ORGANIZATION_ID_INVALID: + $ref: '#/components/examples/ORGANIZATION_ID_INVALID' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + '403': + content: + application/json: + examples: + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '404': + content: + application/json: + examples: + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '500': + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Internal Server Error: The server encountered an unexpected error.' + summary: Verify Organization domain + tags: + - Organization Domains + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + /v2/manage/permissions: + get: + summary: List Permissions + operationId: Permissions + description: Retrieves a list of all Permissions. + tags: + - Permissions + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + type: object + properties: + Data: + type: array + items: + $ref: '#/components/schemas/Permissions' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + post: + summary: Create Permission + operationId: AddPermission + description: Adds a new Permission. + tags: + - Permissions + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PermissionsPostRequest' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/Permissions' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_POST_BODY_REQUIRED: + $ref: '#/components/examples/JSON_POST_BODY_REQUIRED' + PARAMETER_NOT_WELL_FORMATTED_REQUIRED: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_REQUIRED' + INVALID_OBJECT_ID: + $ref: '#/components/examples/INVALID_ID' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '409': + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + DUPLICATE_PERMISSION_NAME: + $ref: '#/components/examples/DUPLICATE_PERMISSION_NAME' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /v2/manage/permissions/{id}: + get: + summary: Retrieve Permission by ID + operationId: GetPermissionById + description: Retrieves a Permission by its ID. + tags: + - Permissions + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + parameters: + - $ref: '#/components/parameters/permissionId' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/Permissions' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + PERMISSION_ID_REQUIRED: + $ref: '#/components/examples/PERMISSION_ID_REQUIRED' + PERMISSION_ID_INVALID: + $ref: '#/components/examples/PERMISSION_ID_INVALID' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + put: + summary: Update Permission + operationId: UpdateTenantPermission + description: 'Updates a specific Permission. Note: The Name field cannot be modified for non-B2B apps. If a different Name value is provided, the API will return an error.' + tags: + - Permissions + parameters: + - $ref: '#/components/parameters/permissionId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PermissionPutRequest' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/Permissions' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED_PARTNER' + PERMISSION_ID_REQUIRED: + $ref: '#/components/examples/PERMISSION_ID_REQUIRED' + PERMISSION_ID_INVALID: + $ref: '#/components/examples/PERMISSION_ID_INVALID' + PARAMETER_NOT_WELL_FORMATTED: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_REQUIRED' + NAME_NOT_ALLOWED_TO_UPDATE: + $ref: '#/components/examples/NAME_NOT_ALLOWED_TO_UPDATE' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '409': + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + DUPLICATE_PERMISSION_NAME: + $ref: '#/components/examples/DUPLICATE_PERMISSION_NAME' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + delete: + summary: Delete Permission + operationId: DeleteTenantPermission + description: Deletes a specific Permission. + tags: + - Permissions + parameters: + - $ref: '#/components/parameters/permissionId' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + PERMISSION_ID_REQUIRED: + $ref: '#/components/examples/PERMISSION_ID_REQUIRED' + PERMISSION_ID_INVALID: + $ref: '#/components/examples/PERMISSION_ID_INVALID' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /v2/manage/roles: + get: + description: Lists all Roles within the Tenant. + operationId: GetAllTenantRoles + summary: List Tenant Roles + tags: + - Roles + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + type: object + properties: + Data: + type: array + items: + $ref: '#/components/schemas/TenantRole' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + post: + description: Creates a Role within the Tenant. + operationId: CreateTenantRole + summary: Create Tenant Role + tags: + - Roles + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RolePostRequest' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/TenantRole' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_POST_BODY_REQUIRED: + $ref: '#/components/examples/JSON_POST_BODY_REQUIRED' + PARAMETER_NOT_WELL_FORMATTED_REQUIRED: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_REQUIRED' + PERMISSION_ID_INVALID: + $ref: '#/components/examples/PERMISSION_ID_INVALID' + INVALID_BODY_JSON: + $ref: '#/components/examples/INVALID_BODY_JSON' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '409': + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + DUPLICATE_ROLE_NAME: + $ref: '#/components/examples/DUPLICATE_ROLE_NAME' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /v2/manage/roles/{id}: + get: + description: Retrieves details of a Role by its ID. + operationId: GetRoleById + summary: Retrieve Role by ID + tags: + - Roles + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + parameters: + - $ref: '#/components/parameters/roleId' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/Role' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ROLE_ID_REQUIRED: + $ref: '#/components/examples/ROLE_ID_REQUIRED' + INVALID_ROLE_ID: + $ref: '#/components/examples/INVALID_ROLE_ID' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '404': + description: 'Not Found: The requested resource could not be found.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ROLE_DOES_NOT_EXISTS: + $ref: '#/components/examples/ROLE_DOES_NOT_EXISTS_PARTNER' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + put: + description: Updates a Role by its ID. + operationId: UpdateRole + summary: Update Role + tags: + - Roles + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + parameters: + - $ref: '#/components/parameters/roleId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RolesPutRequest' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/Role' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED_PARTNER' + PARAMETER_NOT_WELL_FORMATTED_REQUIRED: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_REQUIRED' + PERMISSION_ID_INVALID: + $ref: '#/components/examples/PERMISSION_ID_INVALID' + ROLE_ID_REQUIRED: + $ref: '#/components/examples/ROLE_ID_REQUIRED' + INVALID_BODY_JSON: + $ref: '#/components/examples/INVALID_BODY_JSON' + INVALID_ROLE_ID: + $ref: '#/components/examples/INVALID_ROLE_ID' + NAME_NOT_ALLOWED_TO_UPDATE: + $ref: '#/components/examples/NAME_NOT_ALLOWED_TO_UPDATE' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + '404': + description: 'Not Found: The requested resource could not be found.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ROLE_DOES_NOT_EXISTS: + $ref: '#/components/examples/ROLE_DOES_NOT_EXISTS_PARTNER' + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_PARTNER' + '409': + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + DUPLICATE_ROLE_NAME: + $ref: '#/components/examples/DUPLICATE_ROLE_NAME' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + delete: + description: Deletes a Role by its ID. + operationId: DeleteTenantRole + summary: Delete Role + tags: + - Roles + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + parameters: + - $ref: '#/components/parameters/roleId' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ROLE_ID_REQUIRED: + $ref: '#/components/examples/ROLE_ID_REQUIRED' + INVALID_ROLE_ID: + $ref: '#/components/examples/INVALID_ROLE_ID' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + DEFAULT_ROLE_CANNOT_BE_DELETED: + $ref: '#/components/examples/DEFAULT_ROLE_CANNOT_BE_DELETED' + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + '404': + description: 'Not Found: The requested resource could not be found.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ROLE_DOES_NOT_EXISTS: + $ref: '#/components/examples/ROLE_DOES_NOT_EXISTS_PARTNER' + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_PARTNER' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /v2/manage/roles/{name}/name: + get: + summary: Retrieve Role by name + description: Retrieves details of a Role by its name. + operationId: RoleByName + tags: + - Roles + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + parameters: + - name: name + in: path + description: Role Name + required: true + schema: + type: string + example: Admin + - name: orgid + in: query + description: Organization ID + required: false + schema: + type: string + example: org_2enk23n3 + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + type: object + properties: + Data: + type: array + items: + $ref: '#/components/schemas/Role' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ROLE_ID_REQUIRED: + $ref: '#/components/examples/ROLE_NAME_REQUIRED' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /v2/manage/roles/{id}/default: + put: + description: | + Sets a Role as the default for new Users. This API is supported only for B2B tenants. + operationId: SetDefaultRole + summary: Set default Role + tags: + - Roles + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + parameters: + - $ref: '#/components/parameters/roleId' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/DefaultResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ROLE_ID_REQUIRED: + $ref: '#/components/examples/ROLE_ID_REQUIRED' + INVALID_ROLE_ID: + $ref: '#/components/examples/INVALID_ROLE_ID' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ROLE_DOES_NOT_BELONGS_TO_TENANT: + $ref: '#/components/examples/ROLE_DOES_NOT_BELONGS_TO_TENANT' + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + B2B_NOT_ENABLED: + $ref: '#/components/examples/B2B_NOT_ENABLED' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /v2/manage/account/{uid}/orgcontext: + get: + summary: Retrieve Organization context by UID + description: Retrieves User Roles for all Organizations by UID. + operationId: getOrgContextByUid + tags: + - Organization User Roles + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + parameters: + - $ref: '#/components/parameters/Uid' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + type: object + properties: + Data: + type: array + items: + $ref: '#/components/schemas/UserRole' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + USER_ID_REQUIRED: + $ref: '#/components/examples/USER_ID_REQUIRED' + USER_DOES_NOT_EXISTS: + $ref: '#/components/examples/USER_DOES_NOT_EXISTS' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + B2B_NOT_ENABLED: + $ref: '#/components/examples/B2B_NOT_ENABLED' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + delete: + summary: Delete Organization context by UID + description: Deletes User Roles for all Organizations by UID. + operationId: deleteOrgContextByUid + tags: + - Organization User Roles + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + parameters: + - $ref: '#/components/parameters/Uid' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + USER_ID_REQUIRED: + $ref: '#/components/examples/USER_ID_REQUIRED' + USER_DOES_NOT_EXISTS: + $ref: '#/components/examples/USER_DOES_NOT_EXISTS' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + B2B_NOT_ENABLED: + $ref: '#/components/examples/B2B_NOT_ENABLED' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /v2/manage/account/{uid}/orgcontext/{orgId}: + get: + summary: Retrieve Organization Roles by OrgID and UID + description: Retrieves User Roles of an Organization by UID and OrgID. + operationId: getOrgContextByUidAndOrgId + tags: + - Organization User Roles + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + parameters: + - $ref: '#/components/parameters/Uid' + - $ref: '#/components/parameters/orgId' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + type: object + properties: + Data: + type: array + items: + $ref: '#/components/schemas/UserRole' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + USER_ID_REQUIRED: + $ref: '#/components/examples/USER_ID_REQUIRED' + USER_DOES_NOT_EXISTS: + $ref: '#/components/examples/USER_DOES_NOT_EXISTS' + ORGANIZATION_ID_REQUIRED: + $ref: '#/components/examples/ORGANIZATION_ID_REQUIRED' + ORGANIZATION_ID_INVALID: + $ref: '#/components/examples/ORGANIZATION_ID_INVALID' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + B2B_NOT_ENABLED: + $ref: '#/components/examples/B2B_NOT_ENABLED' + '404': + description: 'Not Found: The requested resource could not be found.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_PARTNER' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + delete: + summary: Delete Organization Roles by OrgID and UID + description: Deletes User Roles of an Organization by UID and OrgID. + operationId: deleteOrgContextByUidAndOrgId + tags: + - Organization User Roles + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + parameters: + - $ref: '#/components/parameters/Uid' + - $ref: '#/components/parameters/orgId' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + USER_ID_REQUIRED: + $ref: '#/components/examples/USER_ID_REQUIRED' + USER_DOES_NOT_EXISTS: + $ref: '#/components/examples/USER_DOES_NOT_EXISTS' + ORGANIZATION_ID_REQUIRED: + $ref: '#/components/examples/ORGANIZATION_ID_REQUIRED' + ORGANIZATION_ID_INVALID: + $ref: '#/components/examples/ORGANIZATION_ID_INVALID' + '403': + description: 'Forbidden: The server understood the request, but is refusing to fulfill it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + B2B_NOT_ENABLED: + $ref: '#/components/examples/B2B_NOT_ENABLED' + '404': + description: 'Not Found: The requested resource could not be found.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_PARTNER' + USER_NOT_FOUND_IN_ORG: + $ref: '#/components/examples/USER_NOT_FOUND_IN_ORG' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /v2/manage/account/{uid}/orgcontext/{orgId}/roles: + put: + summary: Assign Roles in Organization + description: Assigns Roles to a User within a specific Organization. + operationId: assignRolesToUser + tags: + - Organization User Roles + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + parameters: + - $ref: '#/components/parameters/Uid' + - $ref: '#/components/parameters/orgId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UserRolePutRequest' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + type: object + properties: + Data: + type: array + items: + $ref: '#/components/schemas/UserRole' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + USER_ID_REQUIRED: + $ref: '#/components/examples/USER_ID_REQUIRED' + ORGANIZATION_ID_REQUIRED: + $ref: '#/components/examples/ORGANIZATION_ID_REQUIRED' + ORGANIZATION_ID_INVALID: + $ref: '#/components/examples/ORGANIZATION_ID_INVALID' + INVALID_ROLE_ID: + $ref: '#/components/examples/INVALID_ROLE_ID' + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED_PARTNER' + ROLE_DOES_NOT_BELONGS_TO_ORG: + $ref: '#/components/examples/ROLE_DOES_NOT_BELONGS_TO_ORG' + INVALID_BODY_JSON: + $ref: '#/components/examples/INVALID_BODY_JSON' + PARAMETER_NOT_WELL_FORMATTED: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_REQUIRED' + B2B_EMAIL_NOT_AVAILABLE: + $ref: '#/components/examples/B2B_EMAIL_NOT_AVAILABLE' + '403': + description: 'Forbidden: The server understood the request, but is refusing to fulfill it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + ROLE_DOES_NOT_BELONGS_TO_ORG: + $ref: '#/components/examples/ROLE_DOES_NOT_BELONGS_TO_ORG' + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + B2B_NOT_ENABLED: + $ref: '#/components/examples/B2B_NOT_ENABLED' + '404': + description: 'Not Found: The requested resource could not be found.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_PARTNER' + USER_DOES_NOT_EXISTS: + $ref: '#/components/examples/USER_DOES_NOT_EXISTS' + '409': + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + USER_ROLE_ALREADY_EXISTS: + $ref: '#/components/examples/USER_ROLE_ALREADY_EXISTS' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /v2/manage/account/{uid}/orgcontext/roles: + put: + summary: Assign Roles in Tenant + description: Assigns Roles to a User within a Tenant. + operationId: assignRolesToUserInAllOrgs + tags: + - Organization User Roles + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + parameters: + - $ref: '#/components/parameters/Uid' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + type: object + properties: + Data: + type: array + items: + $ref: '#/components/schemas/UserRole' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + USER_ID_REQUIRED: + $ref: '#/components/examples/USER_ID_REQUIRED' + INVALID_ROLE_ID: + $ref: '#/components/examples/INVALID_ROLE_ID' + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED_PARTNER' + INVALID_BODY_JSON: + $ref: '#/components/examples/INVALID_BODY_JSON' + PARAMETER_NOT_WELL_FORMATTED: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_REQUIRED' + B2B_EMAIL_NOT_AVAILABLE: + $ref: '#/components/examples/B2B_EMAIL_NOT_AVAILABLE' + '403': + description: 'Forbidden: The server understood the request, but is refusing to fulfill it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ROLE_DOES_NOT_BELONGS_TO_TENANT: + $ref: '#/components/examples/ROLE_DOES_NOT_BELONGS_TO_TENANT' + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + B2B_NOT_ENABLED: + $ref: '#/components/examples/B2B_NOT_ENABLED' + '404': + description: 'Not Found: The requested resource could not be found.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + USER_DOES_NOT_EXISTS: + $ref: '#/components/examples/USER_DOES_NOT_EXISTS' + '409': + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + DUPLICATE_ROLE_NAME: + $ref: '#/components/examples/USER_ROLE_ALREADY_EXISTS' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /v2/manage/organizations/{orgId}/orgcontext: + get: + summary: Retrieve Organization context + description: Retrieves User Roles for all Organizations by OrgID. + operationId: getOrgContextByOrgId + tags: + - Organization + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + parameters: + - name: orgId + in: path + description: Unique identifier of the Organization. + required: true + schema: + type: string + example: org_fasf432d + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + type: object + properties: + Data: + type: array + items: + $ref: '#/components/schemas/UserRole' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ORGANIZATION_ID_REQUIRED: + $ref: '#/components/examples/ORGANIZATION_ID_REQUIRED' + ORGANIZATION_ID_INVALID: + $ref: '#/components/examples/ORGANIZATION_ID_INVALID' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + B2B_NOT_ENABLED: + $ref: '#/components/examples/B2B_NOT_ENABLED' + '404': + description: 'Not Found: The requested resource could not be found.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_PARTNER' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /v2/manage/organizations/{orgId}/roles: + get: + description: Lists all Roles defined within an Organization. + operationId: getOrgRolesByOrgId + summary: List Organization Roles + tags: + - Organization + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + parameters: + - $ref: '#/components/parameters/orgId' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + type: object + properties: + Data: + type: array + items: + $ref: '#/components/schemas/Role' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ORGANIZATION_ID_REQUIRED: + $ref: '#/components/examples/ORGANIZATION_ID_REQUIRED' + ORGANIZATION_ID_INVALID: + $ref: '#/components/examples/ORGANIZATION_ID_INVALID' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + B2B_NOT_ENABLED: + $ref: '#/components/examples/B2B_NOT_ENABLED' + '404': + description: 'Not Found: The requested resource could not be found.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_PARTNER' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + post: + summary: Create Role in Organization + description: Creates a Role within an Organization. + operationId: CreateOrgTenantRole + tags: + - Organization + security: + - APIKey: [] + APISecret: [] + - ClientId: [] + ClientSecret: [] + - M2MBearerToken: [] + parameters: + - $ref: '#/components/parameters/orgId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RolePostRequest' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/Role' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ORGANIZATION_ID_REQUIRED: + $ref: '#/components/examples/ORGANIZATION_ID_REQUIRED' + ORGANIZATION_ID_INVALID: + $ref: '#/components/examples/ORGANIZATION_ID_INVALID' + JSON_POST_BODY_REQUIRED: + $ref: '#/components/examples/JSON_POST_BODY_REQUIRED' + INVALID_BODY_JSON: + $ref: '#/components/examples/INVALID_BODY_JSON' + PARAMETER_NOT_WELL_FORMATTED: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED' + PERMISSION_ID_INVALID: + $ref: '#/components/examples/PERMISSION_ID_INVALID' + ROLE_NAME_REQUIRED: + $ref: '#/components/examples/ROLE_NAME_REQUIRED' + '403': + description: 'Forbidden: The server understood the request, but is refusing to fulfill it.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE' + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + B2B_NOT_ENABLED: + $ref: '#/components/examples/B2B_NOT_ENABLED' + '404': + description: 'Not Found: The requested resource could not be found.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ORGANIZATION_NOT_FOUND: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_PARTNER' + '409': + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + DUPLICATE_ROLE_NAME: + $ref: '#/components/examples/DUPLICATE_ROLE_NAME' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /v2/manage/sott: + get: + summary: List SOTTs + operationId: GetAllSOTT + description: Retrieves a list of all Secure One Time Token (SOTT) entries associated with the Tenant. + tags: + - SOTT + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + properties: + Data: + type: array + items: + $ref: '#/components/schemas/SottList' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + SOTT_NOT_FOUND: + $ref: '#/components/examples/SOTT_NOT_FOUND' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + post: + summary: Generate SOTT + operationId: AddSott + description: Generates a new Secure One Time Token (SOTT) for the Tenant based on specified technology and parameters. + tags: + - SOTT + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SottGenerateTechnology' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/SottResponse' + '400': + description: Bad Request - The request could not be understood by the server due to malformed syntax. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + PARAMETER_NOT_WELL_FORMATTED_REQUIRED: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_REQUIRED' + TECHNOLOGY_SELECTION_INVALID: + $ref: '#/components/examples/TECHNOLOGY_SELECTION_INVALID' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + /v2/manage/workflows: + get: + summary: List workflows + operationId: getAllWorkflows + description: Retrieves a list of all workflows configured for the Tenant. + tags: + - Workflows + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + type: object + properties: + Data: + type: array + items: + $ref: '#/components/schemas/WorkflowConfigWithoutData' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + IDENTITY_ORCHESTRATION_NOT_ENABLED: + $ref: '#/components/examples/IDENTITY_ORCHESTRATION_NOT_ENABLED' + '404': + description: 'Not found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + WORKFLOW_CONFIG_NOT_FOUND: + $ref: '#/components/examples/WORKFLOW_CONFIG_NOT_FOUND' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + post: + summary: Add workflow + operationId: addWorkflow + description: Adds a new workflow configuration to the Tenant. + tags: + - Workflows + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/AddWorkflowConfig' + examples: + WORKFLOW_PAYLOAD: + $ref: '#/components/examples/WORKFLOW_PAYLOAD' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/WorkflowConfig' + examples: + WORKFLOW_RESPONSE: + $ref: '#/components/examples/WORKFLOW_RESPONSE' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + POST_BODY_INVALID: + $ref: '#/components/examples/JSON_POST_BODY_REQUIRED' + WORKFLOW_STATE_IS_INVALID: + $ref: '#/components/examples/WORKFLOW_STATE_IS_INVALID' + INVALID_WORKFLOW_NAME: + $ref: '#/components/examples/INVALID_WORKFLOW_NAME' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + IDENTITY_ORCHESTRATION_NOT_ENABLED: + $ref: '#/components/examples/IDENTITY_ORCHESTRATION_NOT_ENABLED' + '409': + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + WORKFLOW_CONFIG_EXISTS: + $ref: '#/components/examples/WORKFLOW_CONFIG_EXISTS_WITH_SAME_NAME' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + /v2/manage/workflows/{workflowId}: + get: + summary: Retrieve Workflow + operationId: getWorkflowById + description: Retrieves details of a specific Workflow using its unique identifier. + tags: + - Workflows + parameters: + - $ref: '#/components/parameters/WorkflowId' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/WorkflowConfig' + examples: + WORKFLOW_RESPONSE: + $ref: '#/components/examples/WORKFLOW_RESPONSE' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + IDENTITY_ORCHESTRATION_NOT_ENABLED: + $ref: '#/components/examples/IDENTITY_ORCHESTRATION_NOT_ENABLED' + '404': + description: 'Not found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + WORKFLOW_CONFIG_NOT_FOUND: + $ref: '#/components/examples/WORKFLOW_CONFIG_NOT_FOUND' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + put: + summary: Update Workflow + operationId: updateWorkflow + description: Updates the configuration of an existing Workflow. + tags: + - Workflows + parameters: + - $ref: '#/components/parameters/WorkflowId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateWorkflowConfig' + examples: + WORKFLOW_PAYLOAD: + $ref: '#/components/examples/WORKFLOW_PAYLOAD' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/WorkflowConfig' + examples: + WORKFLOW_RESPONSE: + $ref: '#/components/examples/WORKFLOW_RESPONSE' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + PUT_BODY_INVALID: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + WORKFLOW_STATE_IS_INVALID: + $ref: '#/components/examples/WORKFLOW_STATE_IS_INVALID' + INVALID_WORKFLOW_NAME: + $ref: '#/components/examples/INVALID_WORKFLOW_NAME' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + IDENTITY_ORCHESTRATION_NOT_ENABLED: + $ref: '#/components/examples/IDENTITY_ORCHESTRATION_NOT_ENABLED' + WORKFLOW_CONFIG_UPDATE_EXISTS: + $ref: '#/components/examples/WORKFLOW_CONFIG_EXISTS_WITH_SAME_NAME' + '404': + description: 'Not found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + WORKFLOW_CONFIG_NOT_FOUND: + $ref: '#/components/examples/WORKFLOW_CONFIG_NOT_FOUND' + '409': + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + WORKFLOW_CONFIG_UPDATE_EXISTS: + $ref: '#/components/examples/WORKFLOW_CONFIG_EXISTS_WITH_SAME_NAME' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + delete: + summary: Delete Workflow + operationId: deleteWorkflow + description: Deletes an existing Workflow from the system. + tags: + - Workflows + parameters: + - $ref: '#/components/parameters/WorkflowId' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + IDENTITY_ORCHESTRATION_NOT_ENABLED: + $ref: '#/components/examples/IDENTITY_ORCHESTRATION_NOT_ENABLED' + '404': + description: 'Not found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + WORKFLOW_CONFIG_NOT_FOUND: + $ref: '#/components/examples/WORKFLOW_CONFIG_NOT_FOUND' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + /v2/manage/workflows/{workflowId}/versions: + get: + summary: List Workflow Versions + description: Returns a list of all available versions for a specified Workflow. + operationId: GetAllWorkflowVersionList + tags: + - Workflows + parameters: + - $ref: '#/components/parameters/WorkflowId' + responses: + '200': + description: List of workflow versions. + content: + application/json: + schema: + $ref: '#/components/schemas/VersionListResponse' + '400': + description: Invalid workflow ID. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + INVALID_WORKFLOW_ID: + $ref: '#/components/examples/INVALID_WORKFLOW_ID' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + IDENTITY_ORCHESTRATION_NOT_ENABLED: + $ref: '#/components/examples/IDENTITY_ORCHESTRATION_NOT_ENABLED' + '404': + description: Workflow not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + WORKFLOW_NOT_FOUND: + $ref: '#/components/examples/WORKFLOW_CONFIG_NOT_FOUND' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + /v2/manage/workflows/{workflowId}/versions/{version}: + delete: + summary: Delete Workflow Version + description: Deletes a specific version of a Workflow from the system. + operationId: DeleteWorkflowVersion + tags: + - Workflows + parameters: + - $ref: '#/components/parameters/WorkflowId' + - $ref: '#/components/parameters/Version' + responses: + '200': + description: Workflow version deleted successfully. + content: + application/json: + schema: + $ref: '#/components/schemas/IsDeleted' + '400': + description: Invalid workflow id. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + INVALID_WORKFLOW_ID: + $ref: '#/components/examples/INVALID_WORKFLOW_ID' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + IDENTITY_ORCHESTRATION_NOT_ENABLED: + $ref: '#/components/examples/IDENTITY_ORCHESTRATION_NOT_ENABLED' + '404': + description: Workflow version not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + WORKFLOW_CONFIG_NOT_FOUND: + $ref: '#/components/examples/WORKFLOW_CONFIG_NOT_FOUND' + WORKFLOW_VERSION_NOT_FOUND: + $ref: '#/components/examples/WORKFLOW_VERSION_NOT_FOUND' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + put: + summary: Restore Workflow Version + description: Restores a specific version of a Workflow to its active state. + operationId: RestoreWorkflowVersion + tags: + - Workflows + parameters: + - $ref: '#/components/parameters/WorkflowId' + - $ref: '#/components/parameters/Version' + responses: + '200': + description: Workflow version restored successfully. + content: + application/json: + schema: + type: object + properties: + Data: + $ref: '#/components/schemas/WorkflowData' + '400': + description: Invalid workflow id. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + INVALID_WORKFLOW_ID: + $ref: '#/components/examples/INVALID_WORKFLOW_ID' + '403': + description: Unauthorized access to restore workflow version. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + FAILED_TO_RESTORE_WORKFLOW_VERSION: + $ref: '#/components/examples/FAILED_TO_RESTORE_WORKFLOW_VERSION' + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + IDENTITY_ORCHESTRATION_NOT_ENABLED: + $ref: '#/components/examples/IDENTITY_ORCHESTRATION_NOT_ENABLED' + '404': + description: Workflow version not found. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + WORKFLOW_CONFIG_NOT_FOUND: + $ref: '#/components/examples/WORKFLOW_CONFIG_NOT_FOUND' + WORKFLOW_VERSION_NOT_FOUND: + $ref: '#/components/examples/WORKFLOW_VERSION_NOT_FOUND' + '500': + description: Internal server error. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + /v2/manage/webhooks: + get: + summary: List webhook configurations + operationId: GetAllWebhooksConfigurations + description: Retrieves a list of all configured webhooks for the Tenant, including detailed information about each webhook and its subscribed events. + tags: + - Webhooks + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/WebhookSubscriptionResponse' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + WEBHOOK_FEATURE_NOT_ENABLED: + $ref: '#/components/examples/WEBHOOK_FEATURE_NOT_ENABLED' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + WEBHOOK_CONFIG_NOT_FOUND: + $ref: '#/components/examples/WEBHOOK_CONFIG_NOT_FOUND' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + post: + summary: Create webhook configuration + operationId: CreateWebhookConfiguration + description: Creates a new webhook configuration for the Tenant, allowing registration of a webhook with details such as the Target URL and subscribed events. + tags: + - Webhooks + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WebhookSubscriptionCreateModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/WebhookSubscription' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + PARAMETER_NOT_WELL_FORMATTED_REQUIRED: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_REQUIRED' + INVALID_WEBHOOK_EVENT_TYPE: + $ref: '#/components/examples/INVALID_WEBHOOK_EVENT_TYPE' + WEB_HOOK_TARGET_URL_IS_NOT_VALID: + $ref: '#/components/examples/WEB_HOOK_TARGET_URL_IS_NOT_VALID' + WEB_HOOK_TARGET_URL_IS_NOT_REACHABLE: + $ref: '#/components/examples/WEB_HOOK_TARGET_URL_IS_NOT_REACHABLE' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + WEBHOOK_FEATURE_NOT_ENABLED: + $ref: '#/components/examples/WEBHOOK_FEATURE_NOT_ENABLED' + '409': + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + WEB_HOOK_TARGET_URL_IS_ALREADY_SUBSCRIBE: + $ref: '#/components/examples/WEB_HOOK_TARGET_URL_IS_ALREADY_SUBSCRIBE' + WEB_HOOK_NOT_ALLOWED_MORE_THAN_MAX_LIMIT: + $ref: '#/components/examples/WEB_HOOK_NOT_ALLOWED_MORE_THAN_MAX_LIMIT' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + /v2/manage/webhooks/{hookId}: + get: + summary: Retrieve webhook configuration + operationId: GetWebhookConfigurationById + description: Retrieves the details of a specific webhook configuration for the Tenant by its unique ID, including the Target URL, subscribed events, and other settings. + tags: + - Webhooks + parameters: + - $ref: '#/components/parameters/HookId' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/WebhookSubscription' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + INVALID_WEBHOOK_ID: + $ref: '#/components/examples/INVALID_WEBHOOK_ID' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + WEBHOOK_FEATURE_NOT_ENABLED: + $ref: '#/components/examples/WEBHOOK_FEATURE_NOT_ENABLED' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + WEBHOOK_CONFIG_NOT_FOUND: + $ref: '#/components/examples/WEBHOOK_CONFIG_NOT_FOUND' + security: + - M2MBearerToken: [] + put: + summary: Update webhook configuration + operationId: UpdateWebhookConfigurationById + description: Updates an existing webhook configuration for the Tenant by its unique ID, modifying details such as the Target URL, subscribed events, or other settings. + tags: + - Webhooks + parameters: + - $ref: '#/components/parameters/HookId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/WebhookSubscriptionUpdateModel' + examples: + example1: + summary: Example to update all the fields in webhook + value: + TargetUrl: https://example.com/webhook + Name: Test Webhook + SecretName: xyz + Headers: + x-test-header: qa + QueryParams: + apikey: '123456' + Authentication: + AuthType: Basic + BasicAuth: + Username: admin + Password: password123 + example2: + summary: Example to reset Headers, Query Params and Authentication + value: + Headers: {} + QueryParams: {} + TargetUrl: https://example.com/webhook + Authentication: + AuthType: Basic + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/WebhookSubscription' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + INVALID_WEBHOOK_ID: + $ref: '#/components/examples/INVALID_WEBHOOK_ID' + PARAMETER_NOT_WELL_FORMATTED_REQUIRED: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_REQUIRED' + WEB_HOOK_TARGET_URL_IS_NOT_VALID: + $ref: '#/components/examples/WEB_HOOK_TARGET_URL_IS_NOT_VALID' + WEB_HOOK_TARGET_URL_IS_NOT_REACHABLE: + $ref: '#/components/examples/WEB_HOOK_TARGET_URL_IS_NOT_REACHABLE' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + WEBHOOK_FEATURE_NOT_ENABLED: + $ref: '#/components/examples/WEBHOOK_FEATURE_NOT_ENABLED' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + WEBHOOK_CONFIG_NOT_FOUND: + $ref: '#/components/examples/WEBHOOK_CONFIG_NOT_FOUND' + CANNOT_UPDATE_WEBHOOK: + $ref: '#/components/examples/CANNOT_UPDATE_WEBHOOK' + '409': + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + WEB_HOOK_TARGET_URL_IS_ALREADY_SUBSCRIBE: + $ref: '#/components/examples/WEB_HOOK_TARGET_URL_IS_ALREADY_SUBSCRIBE' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + delete: + summary: Delete webhook configuration + operationId: DeleteWebhookConfigurationById + description: Deletes a specific webhook configuration for the Tenant using its unique ID, permanently removing the webhook from receiving further event notifications. + tags: + - Webhooks + parameters: + - $ref: '#/components/parameters/HookId' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + INVALID_WEBHOOK_ID: + $ref: '#/components/examples/INVALID_WEBHOOK_ID' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + WEBHOOK_FEATURE_NOT_ENABLED: + $ref: '#/components/examples/WEBHOOK_FEATURE_NOT_ENABLED' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + WEBHOOK_CONFIG_NOT_FOUND: + $ref: '#/components/examples/WEBHOOK_CONFIG_NOT_FOUND' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + /v2/manage/webhooks/events: + get: + summary: List webhook events + operationId: GetAllEvents + description: Retrieves a list of all available webhook events that can be subscribed to by the Tenant for configuring webhooks to receive notifications for specific activities. + tags: + - Webhooks + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/WebhookEvents' + examples: + WEBHOOK_EVENTS: + $ref: '#/components/examples/WEBHOOK_EVENTS' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + WEBHOOK_FEATURE_NOT_ENABLED: + $ref: '#/components/examples/WEBHOOK_FEATURE_NOT_ENABLED' + security: + - M2MBearerToken: [] + /v2/manage/smstemplates: + get: + summary: List SMS templates + description: Retrieves a list of SMS templates for a specified customer and Tenant. + operationId: GetSmsTemplates + tags: + - SMS Templates + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + type: object + properties: + Data: + type: array + items: + $ref: '#/components/schemas/SmsTemplate' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + post: + summary: Create SMS template + description: Creates a new SMS template for a specified customer and Tenant. + operationId: CreateSmsTemplate + tags: + - SMS Templates + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SmsTemplate' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/SmsTemplate' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_POST_BODY_REQUIRED: + $ref: '#/components/examples/JSON_POST_BODY_REQUIRED' + INVALID_SMS_TYPE: + $ref: '#/components/examples/INVALID_SMS_TYPE' + '403': + description: Forbidden due to invalid request body or SMS configuration details. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '409': + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + SMS_TEMPLATE_EXISTS: + $ref: '#/components/examples/SMS_TEMPLATE_ALREADY_EXISTS' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + /v2/manage/sms-templates/{templateType}: + put: + summary: Update SMS template + description: Updates an existing SMS template by its type for a specified customer and Tenant. + operationId: UpdateSmsTemplate + tags: + - SMS Templates + parameters: + - $ref: '#/components/parameters/SmsTemplateType' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateSmsTemplateModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/SmsTemplate' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + INVALID_SMS_TYPE: + $ref: '#/components/examples/INVALID_SMS_TYPE' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '404': + description: 'Not found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + SMS_TEMPLATE_NOT_FOUND: + $ref: '#/components/examples/SMS_TEMPLATE_NOT_FOUND' + SMS_TEMPLATE_NOT_EXISTS: + $ref: '#/components/examples/SMS_TEMPLATE_NOT_EXISTS' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + delete: + summary: Delete SMS template + description: Deletes an SMS template by its type for a specified customer and Tenant. + operationId: DeleteSmsTemplate + tags: + - SMS Templates + parameters: + - $ref: '#/components/parameters/SmsTemplateType' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteSmsTemplateModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + INVALID_SMS_TYPE: + $ref: '#/components/examples/INVALID_SMS_TYPE' + JSON_DELETE_BODY_REQUIRED: + $ref: '#/components/examples/JSON_DELETE_BODY_REQUIRED' + '403': + description: Forbidden due to invalid request body or SMS configuration details. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + DEFAULT_SMS_TEMPLATE_CANNOT_BE_DELETED: + $ref: '#/components/examples/DEFAULT_SMS_TEMPLATE_CANNOT_BE_DELETED' + '404': + description: 'Not found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + SMS_TEMPLATE_NOT_FOUND: + $ref: '#/components/examples/SMS_TEMPLATE_NOT_FOUND' + SMS_TEMPLATE_NOT_EXISTS: + $ref: '#/components/examples/SMS_TEMPLATE_NOT_EXISTS' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + /v2/manage/passkey: + get: + summary: Retrieve Passkey configuration + description: Retrieves the current Passkey configuration settings for the Tenant. + operationId: getPassKeyConfig + tags: + - Passkey Configuration + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/PassKeyConfig' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + PASSKEY_FEATURE_NOT_ENABLED: + $ref: '#/components/examples/PASSKEY_FEATURE_NOT_ENABLED' + '404': + description: 'Not found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + PASSKEY_NOT_FOUND: + $ref: '#/components/examples/PASSKEY_NOT_FOUND' + security: + - M2MBearerToken: [] + put: + summary: Update Passkey configuration + description: Creates or updates the Passkey configuration settings for the Tenant. + operationId: upsertPassKeyConfig + tags: + - Passkey Configuration + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PassKeyConfig' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/PassKeyConfig' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + PARAMETER_NOT_WELL_FORMATTED_REQUIRED: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_REQUIRED' + JSON_POST_BODY_REQUIRED: + $ref: '#/components/examples/JSON_POST_BODY_REQUIRED' + INVALID_PASSKEY_SELECTION: + $ref: '#/components/examples/INVALID_PASSKEY_SELECTION' + INVALID_PASSKEY_ATTESTATION: + $ref: '#/components/examples/INVALID_PASSKEY_ATTESTATION' + INVALID_RP_ORIGIN_URL: + $ref: '#/components/examples/INVALID_RP_ORIGIN_URL' + RP_ORIGIN_RPID_MISMATCH: + $ref: '#/components/examples/RP_ORIGIN_RPID_MISMATCH' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + PASSKEY_FEATURE_NOT_ENABLED: + $ref: '#/components/examples/PASSKEY_FEATURE_NOT_ENABLED' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + /v2/manage/2fa/push-notification-settings: + get: + summary: Retrieve Push Notification settings + description: Retrieves the current Push Notification settings for second factor authentication. + operationId: getPushSettings + tags: + - Push Notification Configuration + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/PushAuthenticator' + examples: + PUSH_AUTHENTICATOR_EXAMPLE: + $ref: '#/components/examples/PUSH_AUTHENTICATOR_EXAMPLE' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + SECOND_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/SECOND_FACTOR_AUTHENTICATION_NOT_ENABLED' + PUSH_NOTIFICATIONS_NOT_ENABLED: + $ref: '#/components/examples/PUSH_NOTIFICATIONS_NOT_ENABLED' + '404': + description: 'Not found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + PUSH_SETTINGS_NOT_FOUND: + $ref: '#/components/examples/PUSH_SETTINGS_NOT_FOUND' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + post: + summary: Create Push Notification settings + description: Creates new Push Notification settings for second factor authentication. + operationId: createPushSettings + tags: + - Push Notification Configuration + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PushAuthenticator' + examples: + PUSH_AUTHENTICATOR_EXAMPLE: + $ref: '#/components/examples/PUSH_AUTHENTICATOR_EXAMPLE' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/PushAuthenticator' + examples: + PUSH_AUTHENTICATOR_EXAMPLE: + $ref: '#/components/examples/PUSH_AUTHENTICATOR_EXAMPLE' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + PARAMETER_NOT_WELL_FORMATTED_REQUIRED: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_REQUIRED' + JSON_POST_BODY_REQUIRED: + $ref: '#/components/examples/JSON_POST_BODY_REQUIRED' + INVALID_NOTIFICATION_SERVICE_CUSTOM: + $ref: '#/components/examples/INVALID_NOTIFICATION_SERVICE_CUSTOM' + ATLEAST_ANDORID_OR_IOS_ENABLED: + $ref: '#/components/examples/ATLEAST_ANDORID_OR_IOS_ENABLED' + INVALID_NOTIFICATION_SERVICE: + $ref: '#/components/examples/INVALID_NOTIFICATION_SERVICE' + INVALID_IOS_ENVIRONMENT: + $ref: '#/components/examples/INVALID_IOS_ENVIRONMENT' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + SECOND_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/SECOND_FACTOR_AUTHENTICATION_NOT_ENABLED' + PUSH_NOTIFICATIONS_NOT_ENABLED: + $ref: '#/components/examples/PUSH_NOTIFICATIONS_NOT_ENABLED' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + put: + summary: Update Push Notification settings + description: Updates existing Push Notification settings for second factor authentication. + operationId: updatePushSettings + tags: + - Push Notification Configuration + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PushAuthenticator' + examples: + PUSH_AUTHENTICATOR_EXAMPLE: + $ref: '#/components/examples/PUSH_AUTHENTICATOR_EXAMPLE' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/PushAuthenticator' + examples: + PUSH_AUTHENTICATOR_EXAMPLE: + $ref: '#/components/examples/PUSH_AUTHENTICATOR_EXAMPLE' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + PARAMETER_NOT_WELL_FORMATTED_REQUIRED: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_REQUIRED' + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + ATLEAST_ANDORID_OR_IOS_ENABLED: + $ref: '#/components/examples/ATLEAST_ANDORID_OR_IOS_ENABLED' + INVALID_NOTIFICATION_SERVICE: + $ref: '#/components/examples/INVALID_NOTIFICATION_SERVICE' + INVALID_IOS_ENVIRONMENT: + $ref: '#/components/examples/INVALID_IOS_ENVIRONMENT' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + SECOND_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/SECOND_FACTOR_AUTHENTICATION_NOT_ENABLED' + PUSH_NOTIFICATIONS_NOT_ENABLED: + $ref: '#/components/examples/PUSH_NOTIFICATIONS_NOT_ENABLED' + '404': + description: 'Not found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + PUSH_SETTINGS_NOT_FOUND: + $ref: '#/components/examples/PUSH_SETTINGS_NOT_FOUND' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + /v2/manage/security-questions: + get: + summary: Retrieve security questions + description: Retrieves a list of all available security questions for the Tenant. + tags: + - Security Questions + operationId: getSecurityQuestions + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + type: object + properties: + Data: + type: array + items: + $ref: '#/components/schemas/SecurityQuestion' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + SECURITY_QUESTION_NOT_ENABLED: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_ENABLED' + security: + - M2MBearerToken: [] + post: + summary: Add security question + description: Adds a new security question to the Tenant's configuration. + tags: + - Security Questions + operationId: addSecurityQuestion + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SecurityQuestionInput' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/SecurityQuestion' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_POST_BODY_REQUIRED: + $ref: '#/components/examples/JSON_POST_BODY_REQUIRED' + PARAMETER_NOT_WELL_FORMATTED_REQUIRED: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_REQUIRED' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + SECURITY_QUESTION_NOT_ENABLED: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_ENABLED' + '409': + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + SECURITY_QUESTION_ALREADY_ADDED: + $ref: '#/components/examples/SECURITY_QUESTION_ALREADY_ADDED' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + /v2/manage/security-questions/{securityQuestionID}: + put: + summary: Update security question + description: Updates an existing security question by its ID. + tags: + - Security Questions + operationId: updateSecurityQuestion + parameters: + - $ref: '#/components/parameters/SecurityQuestionId' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SecurityQuestionInput' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/SecurityQuestion' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + PARAMETER_NOT_WELL_FORMATTED_REQUIRED: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_REQUIRED' + INVALID_QUESTION_ID: + $ref: '#/components/examples/INVALID_QUESTION_ID' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + SECURITY_QUESTION_NOT_ENABLED: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_ENABLED' + '404': + description: 'Not found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + SECURITY_QUESTION_CONFIG_NOT_FOUND: + $ref: '#/components/examples/SECURITY_QUESTION_CONFIG_NOT_FOUND' + '409': + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + SECURITY_QUESTION_ALREADY_ADDED: + $ref: '#/components/examples/SECURITY_QUESTION_ALREADY_ADDED' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + delete: + summary: Delete security question + description: Deletes a security question by its ID. + tags: + - Security Questions + operationId: deleteSecurityQuestion + parameters: + - $ref: '#/components/parameters/SecurityQuestionId' + responses: + '200': + description: Deletion status + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + INVALID_QUESTION_ID: + $ref: '#/components/examples/INVALID_QUESTION_ID' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + SECURITY_QUESTION_NOT_ENABLED: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_ENABLED' + '404': + description: 'Not found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + SECURITY_QUESTION_CONFIG_NOT_FOUND: + $ref: '#/components/examples/SECURITY_QUESTION_CONFIG_NOT_FOUND' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + /v2/manage/security-questions/count: + get: + summary: Retrieve security question count + description: Retrieves the number of security questions to render for a User. + operationId: getSecurityQuestionRenderCount + tags: + - Security Questions + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/SecurityQuestionsRender' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + SECURITY_QUESTION_NOT_ENABLED: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_ENABLED' + '404': + description: 'Not found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + SECURITY_QUESTION_CONFIG_NOT_FOUND: + $ref: '#/components/examples/SECURITY_QUESTION_CONFIG_NOT_FOUND' + security: + - M2MBearerToken: [] + put: + summary: Update security question count + description: Updates the number of security questions to render for a User. + operationId: updateSecurityQuestionRenderCount + tags: + - Security Questions + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SecurityQuestionsRender' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/SecurityQuestionsRender' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + PARAMETER_NOT_WELL_FORMATTED_REQUIRED: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_REQUIRED' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + SECURITY_QUESTION_NOT_ENABLED: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_ENABLED' + '404': + description: 'Not found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + SECURITY_QUESTION_CONFIG_NOT_FOUND: + $ref: '#/components/examples/SECURITY_QUESTION_CONFIG_NOT_FOUND' + '409': + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + SECURITY_QUESTION_RENDER_COUNT_ERROR: + $ref: '#/components/examples/SECURITY_QUESTION_RENDER_COUNT_ERROR' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + /v2/manage/restrictions/domain-access: + get: + summary: Retrieve Domain Access Restrictions + operationId: GetDomainAccessRestrictionsByAppID + description: Retrieves the domain access restrictions configured for the Tenant. + tags: + - Domain Access Restrictions + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/DomainAccessRestrictions' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + DOMAIN_WHITE_LISTING_NOT_ENABLED: + $ref: '#/components/examples/DOMAIN_WHITE_LISTING_NOT_ENABLED' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + DOMAIN_RESTRICTION_CONFIG_NOT_FOUND: + $ref: '#/components/examples/DOMAIN_RESTRICTION_CONFIG_NOT_FOUND' + security: + - M2MBearerToken: [] + put: + summary: Update Domain Access Restrictions + operationId: UpdateDomainAccessRestrictionsByAppID + description: Updates the domain access restrictions for the Tenant. + tags: + - Domain Access Restrictions + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DomainAccessRestrictions' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/DomainAccessRestrictions' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + PUT_BODY_INVALID: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + DOMAIN_WHITE_LISTING_NOT_ENABLED: + $ref: '#/components/examples/DOMAIN_WHITE_LISTING_NOT_ENABLED' + '409': + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + SAME_DOMAIN_OR_EMAIL_CANNOT_EXIST_IN_BOTH_LIST: + $ref: '#/components/examples/SAME_DOMAIN_OR_EMAIL_CANNOT_EXIST_IN_BOTH_LIST' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + /v2/manage/email-templates: + get: + summary: List Email templates + description: Retrieves all Email templates configured for the Tenant. + operationId: getEmailTemplates + tags: + - Email Templates + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + type: object + properties: + Data: + type: array + items: + $ref: '#/components/schemas/EmailTemplateResponse' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + EMAIL_TEMPLATE_NOT_CREATED: + $ref: '#/components/examples/EMAIL_TEMPLATE_NOT_CREATED' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + post: + summary: Create Email template + description: Adds a new Email template to the Tenant's configuration. + operationId: addEmailTemplate + tags: + - Email Templates + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EmailTemplateModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/EmailTemplateResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_POST_BODY_REQUIRED: + $ref: '#/components/examples/JSON_POST_BODY_REQUIRED' + PARAMETER_NOT_WELL_FORMATTED_REQUIRED: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_REQUIRED' + PARAMETER_NOT_WELL_FORMATTED_ALPHANUMERIC: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_ALPHANUMERIC' + PARAMETER_NOT_WELL_FORMATTED_EMAIL: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_EMAIL' + INVALID_FROM_EMAIL_OR_NAME: + $ref: '#/components/examples/INVALID_FROM_EMAIL_OR_NAME' + INVALID_EMAIL_TYPE: + $ref: '#/components/examples/INVALID_EMAIL_TYPE' + INVALID_EMAIL_TEMPLATES_INVALID_EMAIL_TYPE: + $ref: '#/components/examples/INVALID_EMAIL_TEMPLATES_INVALID_EMAIL_TYPE' + INVALID_EMAIL_TEMPLATES_INVALID_TOKEN_TYPE: + $ref: '#/components/examples/INVALID_EMAIL_TEMPLATES_INVALID_TOKEN_TYPE' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '409': + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + EMAIL_TEMPLATE_EXISTS: + $ref: '#/components/examples/EMAIL_TEMPLATE_EXISTS' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + /v2/manage/email-templates/{templateType}: + put: + summary: Update Email Template + description: Updates the Email template for a specified Email template type within a specific Tenant. + operationId: UpdateEmailTemplate + tags: + - Email Templates + security: + - M2MBearerToken: [] + parameters: + - $ref: '#/components/parameters/EmailTemplateType' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UpdateEmailTemplate' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/EmailTemplateResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + PARAMETER_NOT_WELL_FORMATTED_REQUIRED: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_REQUIRED' + PARAMETER_NOT_WELL_FORMATTED_ALPHANUMERIC: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_ALPHANUMERIC' + PARAMETER_NOT_WELL_FORMATTED_EMAIL: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_EMAIL' + INVALID_FROM_EMAIL_OR_NAME: + $ref: '#/components/examples/INVALID_FROM_EMAIL_OR_NAME' + INVALID_EMAIL_TYPE: + $ref: '#/components/examples/INVALID_EMAIL_TYPE' + INVALID_EMAIL_TEMPLATES_INVALID_EMAIL_TYPE: + $ref: '#/components/examples/INVALID_EMAIL_TEMPLATES_INVALID_EMAIL_TYPE' + INVALID_EMAIL_TEMPLATES_INVALID_TOKEN_TYPE: + $ref: '#/components/examples/INVALID_EMAIL_TEMPLATES_INVALID_TOKEN_TYPE' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '404': + description: 'Not found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + EMAIL_TEMPLATE_NOT_CREATED: + $ref: '#/components/examples/EMAIL_TEMPLATE_NOT_CREATED' + EMAIL_TEMPLATE_NOT_EXISTS: + $ref: '#/components/examples/EMAIL_TEMPLATE_NOT_EXISTS' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + delete: + summary: Delete Email Template + description: Deletes the Email template for a specified Email template type within a specific Tenant. + operationId: deleteEmailTemplate + tags: + - Email Templates + security: + - M2MBearerToken: [] + parameters: + - $ref: '#/components/parameters/EmailTemplateType' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteEmailTemplate' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + INVALID_EMAIL_TYPE: + $ref: '#/components/examples/INVALID_EMAIL_TYPE' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + DEFAULT_EMAIL_TEMPLATE_CANNOT_BE_DELETED: + $ref: '#/components/examples/DEFAULT_EMAIL_TEMPLATE_CANNOT_BE_DELETED' + '404': + description: 'Not found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + EMAIL_TEMPLATE_NOT_EXISTS: + $ref: '#/components/examples/EMAIL_TEMPLATE_NOT_EXISTS' + EMAIL_TEMPLATE_NOT_CREATED: + $ref: '#/components/examples/EMAIL_TEMPLATE_NOT_CREATED' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /v2/manage/providers: + get: + summary: List social provider configurations + operationId: GetAllProviderConfigurations + description: Retrieves all social provider configurations available for the Tenant. + tags: + - Social Providers + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + properties: + Data: + type: array + items: + $ref: '#/components/schemas/ProviderConfigOptions' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + security: + - M2MBearerToken: [] + put: + summary: Set social provider status + operationId: SetProvidersStatus + description: Sets the status of social providers for the Tenant. + tags: + - Social Providers + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProviderStatusList' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + properties: + Data: + type: array + items: + $ref: '#/components/schemas/Provider' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + PARAMETER_NOT_WELL_FORMATTED_REQUIRED: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_REQUIRED' + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + /v2/manage/providers/{provider}: + get: + summary: Retrieve social provider configuration + operationId: GetSocialProviderByName + description: Retrieves the social provider configuration for a specified provider name for the Tenant. + tags: + - Social Providers + parameters: + - $ref: '#/components/parameters/ProviderNamePath' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/AppProvider' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '404': + description: 'Not found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + PROVIDER_NOT_CONFIGURED: + $ref: '#/components/examples/PROVIDER_NOT_CONFIGURED_PARTNER' + PROVIDER_NOT_ACTIVE: + $ref: '#/components/examples/PROVIDER_NOT_ACTIVE' + security: + - M2MBearerToken: [] + delete: + summary: Delete social provider configuration + operationId: DeleteSocialProviderByName + description: Deletes the social provider configuration for a specified provider name for the Tenant. + tags: + - Social Providers + parameters: + - $ref: '#/components/parameters/ProviderNamePath' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + PROVIDER_IS_NOT_SUPPORT_CONFIGURATION_SETTINGS: + $ref: '#/components/examples/PROVIDER_IS_NOT_SUPPORT_CONFIGURATION_SETTINGS' + '404': + description: 'Not found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + PROVIDER_NOT_CONFIGURED: + $ref: '#/components/examples/PROVIDER_NOT_CONFIGURED_PARTNER' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + put: + summary: Update social provider configuration + operationId: UpdateSocialProviderByName + description: Updates the social provider configuration for a specified provider name for the Tenant. + tags: + - Social Providers + parameters: + - $ref: '#/components/parameters/ProviderNamePath' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AppProvider' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/AppProvider' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + PARAMETER_NOT_WELL_FORMATTED_REQUIRED: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_REQUIRED' + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + PROVIDER_IS_NOT_SUPPORT_CONFIGURATION_SETTINGS: + $ref: '#/components/examples/PROVIDER_IS_NOT_SUPPORT_CONFIGURATION_SETTINGS' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + /v2/manage/providers/setorder: + put: + summary: Set social provider order + operationId: SetProvidersOrder + description: Sets the order of social providers for the Tenant to be listed in the UI. + tags: + - Social Providers + requestBody: + content: + application/json: + schema: + properties: + Data: + type: array + items: + type: string + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + properties: + Data: + type: array + items: + type: string + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + PARAMETER_NOT_WELL_FORMATTED_REQUIRED: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_REQUIRED' + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + PROVIDER_IS_NOT_VALID: + $ref: '#/components/examples/PROVIDER_IS_NOT_VALID' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + /v2/manage/providers/active: + get: + summary: Retrieve enabled social providers + operationId: GetEnabledProviders + description: Retrieves a list of all enabled social providers for the Tenant. + tags: + - Social Providers + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + properties: + Data: + type: array + items: + $ref: '#/components/schemas/Provider' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + security: + - M2MBearerToken: [] + /v2/manage/2fa/config: + get: + summary: Retrieve second factor configuration + operationId: GetSecondFactorConfiguration + description: Retrieves the second factor authentication configuration for the Tenant. + tags: + - Second Factor Configuration + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/MFASettings' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + security: + - M2MBearerToken: [] + put: + summary: Update second factor configuration + operationId: UpdateSecondFactorConfiguration + description: Updates the second factor authentication configuration for the Tenant. + tags: + - Second Factor Configuration + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/MFASettings' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/MFASettings' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + ATLEAST_ONE_MFA: + $ref: '#/components/examples/ATLEAST_ONE_MFA' + PUSH_NOTIFICATIONS_NOT_ENABLED: + $ref: '#/components/examples/PUSH_NOTIFICATIONS_NOT_ENABLED' + DUO_AUTH_NOT_ENABLED: + $ref: '#/components/examples/DUO_AUTH_NOT_ENABLED_PARTNER' + SECURITY_QUESTION_NOT_ENABLED: + $ref: '#/components/examples/SECURITY_QUESTION_NOT_ENABLED' + PASSKEY_FEATURE_NOT_ENABLED: + $ref: '#/components/examples/PASSKEY_FEATURE_NOT_ENABLED' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + /v2/manage/2fa/totp-authenticator-settings: + get: + summary: Retrieve TOTP configuration + operationId: GetTOTPConfiguration + description: Retrieves the Time-based One Time Password (TOTP) configuration for a specific Tenant. + tags: + - Second Factor Configuration + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/GoogleAuthenticator' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + SECOND_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/SECOND_FACTOR_AUTHENTICATION_NOT_ENABLED' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + GOOGLE_AUTHENTICATOR_CONFIG_NOT_FOUND: + $ref: '#/components/examples/GOOGLE_AUTHENTICATOR_CONFIG_NOT_FOUND' + security: + - M2MBearerToken: [] + put: + summary: Update TOTP configuration + operationId: UpdateTOTPConfiguration + description: Updates the Time-based One Time Password (TOTP) configuration for a specific Tenant. + tags: + - Second Factor Configuration + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/GoogleAuthenticator' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/GoogleAuthenticator' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + PARAMETER_NOT_WELL_FORMATTED_REQUIRED: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_REQUIRED' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + SECOND_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/SECOND_FACTOR_AUTHENTICATION_NOT_ENABLED' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + /v2/manage/2fa/duo-authenticator-settings: + get: + summary: Retrieve Duo configuration + operationId: GetDuoAuthenticatorConfiguration + description: Retrieves the Duo Authentication configuration for a specific Tenant. + tags: + - Second Factor Configuration + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/DuoSecurityAuthenticator' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + SECOND_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/SECOND_FACTOR_AUTHENTICATION_NOT_ENABLED' + ENABLE_DUO_SECURITY_AUTHENTICATOR: + $ref: '#/components/examples/DUO_AUTH_NOT_ENABLED_PARTNER' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + DUO_AUTH_SETTINGS_NOT_FOUND: + $ref: '#/components/examples/DUO_AUTH_SETTINGS_NOT_FOUND' + security: + - M2MBearerToken: [] + put: + summary: Update Duo configuration + operationId: UpdateDuoAuthenticatorConfiguration + description: Updates the Duo Authentication configuration for a specific Tenant. + tags: + - Second Factor Configuration + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DuoSecurityAuthenticator' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/DuoSecurityAuthenticator' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + PARAMETER_NOT_WELL_FORMATTED: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + SECOND_FACTOR_AUTHENTICATION_NOT_ENABLED: + $ref: '#/components/examples/SECOND_FACTOR_AUTHENTICATION_NOT_ENABLED' + ENABLE_DUO_SECURITY_AUTHENTICATOR: + $ref: '#/components/examples/DUO_AUTH_NOT_ENABLED_PARTNER' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + /v2/manage/captcha: + get: + summary: Retrieve captcha configuration + operationId: GetCaptchaConfiguration + description: Retrieves the captcha configuration settings for a specific Tenant. + tags: + - Captcha Configuration + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/CaptchaConfig' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + security: + - M2MBearerToken: [] + put: + summary: Update captcha configuration + operationId: UpdateCaptchaConfiguration + description: Updates the captcha configuration settings for a specific Tenant. + tags: + - Captcha Configuration + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CaptchaConfig' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/CaptchaConfig' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + PARAMETER_NOT_WELL_FORMATTED_INVALID: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_INVALID' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + CAPTCHA_CONFIG_VALUE_NOT_VALID: + $ref: '#/components/examples/CAPTCHA_CONFIG_VALUE_NOT_VALID' + CAPTCHA_THRESHOLD_INVALID: + $ref: '#/components/examples/CAPTCHA_THRESHOLD_INVALID' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + /v2/manage/restrictions/ip-access: + get: + summary: Retrieve IP Access Restrictions + operationId: GetIPAccessRestrictions + description: Retrieves the IP access restrictions configured for a specific Tenant. + tags: + - IP Access Restrictions + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IPAccessRestrictions' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + IP_AUTHORIZATION_DISABLED: + $ref: '#/components/examples/IP_AUTHORIZATION_DISABLED' + security: + - M2MBearerToken: [] + put: + summary: Update IP Access Restrictions + operationId: UpdateIPAccessRestrictions + description: Updates the IP access restrictions for a specific Tenant. + tags: + - IP Access Restrictions + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/IPAccessRestrictions' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IPAccessRestrictions' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + SPECIAL_CHARACTERS_NOT_ALLOWED: + $ref: '#/components/examples/SPECIAL_CHARACTERS_NOT_ALLOWED' + INVALID_IP_ADDRESS: + $ref: '#/components/examples/INVALID_IP_ADDRESS' + SAME_START_AND_END: + $ref: '#/components/examples/SAME_START_AND_END' + INVALID_IP_ADDRESS_RANGE: + $ref: '#/components/examples/INVALID_IP_ADDRESS_RANGE' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + IP_AUTHORIZATION_DISABLED: + $ref: '#/components/examples/IP_AUTHORIZATION_DISABLED' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + delete: + summary: Reset IP Access Restrictions + operationId: ResetIPAccessRestrictions + description: Resets the IP access restrictions to their default state. + tags: + - IP Access Restrictions + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + IP_AUTHORIZATION_DISABLED: + $ref: '#/components/examples/IP_AUTHORIZATION_DISABLED' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + /v2/manage/integrations/jwt: + get: + summary: List JWT Integrations + operationId: GetAllJwtIntegrations + description: Retrieves a list of all configured JWT-based integrations for the Tenant, including algorithms, mapping, endpoints, and settings used for authentication and federation. + tags: + - JWT Integrations + security: + - M2MBearerToken: [] + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + properties: + Data: + type: array + items: + $ref: '#/components/schemas/JwtIntegrationResponse' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JWT_CONFIG_NOT_FOUND: + $ref: '#/components/examples/JWT_CONFIG_NOT_FOUND' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + post: + summary: Create JWT Integration + operationId: CreateJwtIntegration + description: Creates a new JWT-based Integration configuration for the Tenant by specifying algorithms, mapping, and endpoint information, enabling authentication and federation with the specified IdP. + tags: + - JWT Integrations + security: + - M2MBearerToken: [] + requestBody: + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/JwtIntegrationCreateCore' + - $ref: '#/components/schemas/JwtIntegrationRequest' + required: true + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/JwtIntegrationResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_POST_BODY_REQUIRED: + $ref: '#/components/examples/JSON_POST_BODY_REQUIRED' + SSO_APPNAME_REQUIRED: + $ref: '#/components/examples/SSO_APPNAME_REQUIRED' + SSO_APPNAME_LENGTH_EXCEEDED: + $ref: '#/components/examples/SSO_APPNAME_LENGTH_EXCEEDED' + SSO_APPNAME_INVALID: + $ref: '#/components/examples/SSO_APPNAME_INVALID' + JWT_ALOGITHM_REQUIRED: + $ref: '#/components/examples/JWT_ALOGITHM_REQUIRED' + JWT_ALOGRITHM_INVALID: + $ref: '#/components/examples/JWT_ALOGRITHM_INVALID' + JWT_RESPONSE_MODE_INVALID: + $ref: '#/components/examples/JWT_RESPONSE_MODE_INVALID' + JWT_QUERY_STRING_PARAMETER_INVALID: + $ref: '#/components/examples/JWT_QUERY_STRING_PARAMETER_INVALID' + JWT_LOGIN_URL_INVALID: + $ref: '#/components/examples/JWT_LOGIN_URL_INVALID' + JWT_EXPIRY_TIME_INVALID: + $ref: '#/components/examples/JWT_EXPIRY_TIME_INVALID' + JWT_NOT_BEFORE_INVALID: + $ref: '#/components/examples/JWT_NOT_BEFORE_INVALID' + JWT_NOT_BEFORE_LESS_THAN_EXPIRY: + $ref: '#/components/examples/JWT_NOT_BEFORE_LESS_THAN_EXPIRY' + JWT_SECRET_REQUIRED: + $ref: '#/components/examples/JWT_SECRET_REQUIRED' + JWT_SECRET_INVALID: + $ref: '#/components/examples/JWT_SECRET_INVALID' + JWT_MAPPING_REQUIRED: + $ref: '#/components/examples/JWT_MAPPING_REQUIRED' + JWT_MAPPING_INVALID: + $ref: '#/components/examples/JWT_MAPPING_INVALID' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '409': + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JWT_CONFIG_ALREADY_EXIST: + $ref: '#/components/examples/JWT_CONFIG_ALREADY_EXIST' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /v2/manage/integrations/jwt/{jwtApp}: + delete: + summary: Delete JWT Integration configuration + operationId: DeleteJwtIntegration + description: Deletes an existing JWT-based integration configuration for the Tenant using its AppName, permanently disabling authentication and federation with that IdP. + tags: + - JWT Integrations + security: + - M2MBearerToken: [] + parameters: + - $ref: '#/components/parameters/jwtApp' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + examples: + JWT_CONFIG_NOT_FOUND: + $ref: '#/components/examples/JWT_CONFIG_NOT_FOUND' + schema: + $ref: '#/components/schemas/ErrorResponse' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + get: + summary: Retrieve JWT Integration configuration + operationId: GetJwtIntegrationByAppName + description: Retrieves the details of a specific JWT-based integration configuration for the Tenant using the AppName, including algorithms, mapping, and endpoints associated with the application. + tags: + - JWT Integrations + security: + - M2MBearerToken: [] + parameters: + - $ref: '#/components/parameters/jwtApp' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/JwtIntegrationResponse' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JWT_CONFIG_NOT_FOUND: + $ref: '#/components/examples/JWT_CONFIG_NOT_FOUND' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + put: + summary: Update JWT Integration configuration + operationId: UpdateJwtIntegrationByAppName + description: Updates an existing JWT-based integration configuration for the Tenant identified by the AppName, modifying details such as algorithms, mapping, or endpoint information. + tags: + - JWT Integrations + security: + - M2MBearerToken: [] + parameters: + - $ref: '#/components/parameters/jwtApp' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/JwtIntegrationBaseModel' + required: true + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/JwtIntegrationResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_POST_BODY_REQUIRED: + $ref: '#/components/examples/JSON_POST_BODY_REQUIRED' + JWT_ALOGRITHM_INVALID: + $ref: '#/components/examples/JWT_ALOGRITHM_INVALID' + JWT_RESPONSE_MODE_INVALID: + $ref: '#/components/examples/JWT_RESPONSE_MODE_INVALID' + JWT_QUERY_STRING_PARAMETER_INVALID: + $ref: '#/components/examples/JWT_QUERY_STRING_PARAMETER_INVALID' + JWT_LOGIN_URL_INVALID: + $ref: '#/components/examples/JWT_LOGIN_URL_INVALID' + JWT_EXPIRY_TIME_INVALID: + $ref: '#/components/examples/JWT_EXPIRY_TIME_INVALID' + JWT_NOT_BEFORE_INVALID: + $ref: '#/components/examples/JWT_NOT_BEFORE_INVALID' + JWT_NOT_BEFORE_LESS_THAN_EXPIRY: + $ref: '#/components/examples/JWT_NOT_BEFORE_LESS_THAN_EXPIRY' + JWT_SECRET_INVALID: + $ref: '#/components/examples/JWT_SECRET_INVALID' + JWT_MAPPING_INVALID: + $ref: '#/components/examples/JWT_MAPPING_INVALID' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JWT_CONFIG_NOT_FOUND: + $ref: '#/components/examples/JWT_CONFIG_NOT_FOUND' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /v2/manage/integrations/jwt/algo: + get: + summary: List supported JWT algorithms + operationId: GetJwtIntegrationSupportedAlgoList + tags: + - JWT Integrations + security: + - M2MBearerToken: [] + description: Retrieves a list of all supported cryptographic algorithms that can be used by JWT clients for signing and verification when configuring a JWT-based Identity Provider (IdP) for the Tenant. + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + type: object + properties: + Data: + type: array + items: + type: string + /v2/manage/integrations/jwt/data-mapping: + get: + summary: List JWT data mapping fields + operationId: GetJwtIntegrationDataMappingFieldsList + description: Retrieves a list of available data mapping fields that can be used when configuring JWT-based Identity Provider (IdP) integrations for the Tenant, including all supported fields for mapping JWT claims to User profile attributes. + tags: + - JWT Integrations + security: + - M2MBearerToken: [] + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + type: object + properties: + Data: + type: array + items: + type: string + /v2/manage/integrations/saml: + get: + summary: List SAML Integrations + description: Retrieves a list of all configured SAML-based Identity Provider integrations for the Tenant, including metadata and settings for authentication. + operationId: GetAllSamlIntegrations + responses: + '200': + content: + application/json: + schema: + properties: + Data: + items: + $ref: '#/components/schemas/SamlIntegrationResponse' + type: array + description: 'OK: The request was successful.' + '403': + content: + application/json: + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '404': + content: + application/json: + examples: + SAML_CONFIG_NOT_FOUND: + $ref: '#/components/examples/SAML_CONFIG_NOT_FOUND' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Not Found: The server cannot find the requested resource.' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + tags: + - SAML Integrations + security: + - M2MBearerToken: [] + post: + description: Creates a new SAML-based Identity Provider integration for the Tenant, enabling authentication and federation with the specified IdP. + operationId: CreateSamlIntegration + requestBody: + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/SamlIntegrationCreateCore' + - $ref: '#/components/schemas/SamlIntegrationRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SamlIntegrationResponse' + description: 'OK: The request was successful.' + '400': + content: + application/json: + examples: + JSON_POST_BODY_REQUIRED: + $ref: '#/components/examples/JSON_POST_BODY_REQUIRED' + SSO_APPNAME_REQUIRED_SAML: + $ref: '#/components/examples/SSO_APPNAME_REQUIRED_SAML' + SSO_APPNAME_LENGTH_EXCEEDED_SAML: + $ref: '#/components/examples/SSO_APPNAME_LENGTH_EXCEEDED_SAML' + SSO_APPNAME_INVALID_SAML: + $ref: '#/components/examples/SSO_APPNAME_INVALID_SAML' + SAML_IDP_LOCATION_BINDING_REQUIRED: + $ref: '#/components/examples/SAML_IDP_LOCATION_BINDING_REQUIRED' + SAML_IDP_BINDING_INVALID: + $ref: '#/components/examples/SAML_IDP_BINDING_INVALID' + SAML_IDP_LOCATION_REQUIRED: + $ref: '#/components/examples/SAML_IDP_LOCATION_REQUIRED' + SAML_IDP_LOCATION_INVALID: + $ref: '#/components/examples/SAML_IDP_LOCATION_INVALID' + SAML_SP_LOGOUT_URI_REQUIRED_IDP: + $ref: '#/components/examples/SAML_SP_LOGOUT_URI_REQUIRED_IDP' + SAML_SP_LOGOUT_INVALID_IDP: + $ref: '#/components/examples/SAML_SP_LOGOUT_INVALID_IDP' + SAML_LOGIN_URI_REQUIRED: + $ref: '#/components/examples/SAML_LOGIN_URI_REQUIRED' + SAML_LOGIN_URI_INVALID: + $ref: '#/components/examples/SAML_LOGIN_URI_INVALID' + SAML_AFTER_LOGOUT_URI_REQUIRED: + $ref: '#/components/examples/SAML_AFTER_LOGOUT_URI_REQUIRED' + SAML_AFTER_LOGOUT_URI_INVALID: + $ref: '#/components/examples/SAML_AFTER_LOGOUT_URI_INVALID' + SAML_SP_CERTIFICATE_INVALID: + $ref: '#/components/examples/SAML_SP_CERTIFICATE_INVALID' + SAML_SP_CERTIFICATE_REQUIRED: + $ref: '#/components/examples/SAML_SP_CERTIFICATE_REQUIRED' + SAML_ATTRIBUTE_FORMAT_REQUIRED: + $ref: '#/components/examples/SAML_ATTRIBUTE_FORMAT_REQUIRED' + SAML_AUDIENCE_REQUIRED: + $ref: '#/components/examples/SAML_AUDIENCE_REQUIRED' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + schema: + $ref: '#/components/schemas/ErrorResponse' + '409': + content: + application/json: + examples: + SAML_CONFIG_ALREADY_ADDED: + $ref: '#/components/examples/SAML_CONFIG_ALREADY_ADDED' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Conflict: The request could not be completed due to a conflict with the current state of the resource.' + '500': + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Internal Server Error: The server encountered an unexpected error.' + summary: Create SAML IdP Configuration + tags: + - SAML Integrations + security: + - M2MBearerToken: [] + /v2/manage/integrations/saml/{samlApp}: + delete: + description: Deletes the SAML-based Identity Provider configuration for the Tenant identified by the application name, disabling authentication for the specified application. + operationId: DeleteSamlIntegrationByAppName + parameters: + - $ref: '#/components/parameters/samlApp' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + description: 'OK: The request was successful.' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + schema: + $ref: '#/components/schemas/ErrorResponse' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + examples: + SAML_CONFIG_NOT_FOUND: + $ref: '#/components/examples/SAML_CONFIG_NOT_FOUND' + schema: + $ref: '#/components/schemas/ErrorResponse' + '500': + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Internal Server Error: The server encountered an unexpected error.' + summary: Delete SAML IdP Configuration + tags: + - SAML Integrations + security: + - M2MBearerToken: [] + get: + description: Retrieves the SAML-based Identity Provider configuration details for the Tenant using the application name, including metadata and settings. + operationId: GetSamlIntegrationByAppName + parameters: + - $ref: '#/components/parameters/samlApp' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SamlIntegrationResponse' + description: 'OK: The request was successful.' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + schema: + $ref: '#/components/schemas/ErrorResponse' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + examples: + SAML_CONFIG_NOT_FOUND: + $ref: '#/components/examples/SAML_CONFIG_NOT_FOUND' + schema: + $ref: '#/components/schemas/ErrorResponse' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Retrieve SAML IdP client configuration by app name + tags: + - SAML Integrations + security: + - M2MBearerToken: [] + put: + operationId: UpdateSamlIntegrationByAppName + description: Updates an existing SAML-based Identity Provider configuration for the Tenant identified by the application name, modifying necessary settings. + parameters: + - $ref: '#/components/parameters/samlApp' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SamlIntegrationRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SamlIntegrationResponse' + description: 'OK: The request was successful.' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + examples: + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + SAML_IDP_BINDING_INVALID: + $ref: '#/components/examples/SAML_IDP_BINDING_INVALID' + SAML_IDP_LOCATION_INVALID: + $ref: '#/components/examples/SAML_IDP_LOCATION_INVALID' + SAML_SP_LOGOUT_INVALID_IDP: + $ref: '#/components/examples/SAML_SP_LOGOUT_INVALID_IDP' + SAML_LOGIN_URI_INVALID: + $ref: '#/components/examples/SAML_LOGIN_URI_INVALID' + SAML_AFTER_LOGOUT_URI_INVALID: + $ref: '#/components/examples/SAML_AFTER_LOGOUT_URI_INVALID' + SAML_SP_CERTIFICATE_INVALID: + $ref: '#/components/examples/SAML_SP_CERTIFICATE_INVALID' + SAML_ATTRIBUTE_FORMAT_REQUIRED: + $ref: '#/components/examples/SAML_ATTRIBUTE_FORMAT_REQUIRED' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + schema: + $ref: '#/components/schemas/ErrorResponse' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + examples: + SAML_CONFIG_NOT_FOUND: + $ref: '#/components/examples/SAML_CONFIG_NOT_FOUND' + schema: + $ref: '#/components/schemas/ErrorResponse' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Update SAML IdP client configuration by app name + tags: + - SAML Integrations + security: + - M2MBearerToken: [] + /v2/manage/integrations/saml/{samlApp}/renew-certificate: + post: + description: Renews the SAML Identity Provider certificate to replace an expiring or compromised signing certificate. + operationId: RenewSamlIntegrationCertificate + parameters: + - $ref: '#/components/parameters/samlApp' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SamlIntegrationResponse' + description: 'OK: The request was successful.' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + schema: + $ref: '#/components/schemas/ErrorResponse' + '404': + content: + application/json: + examples: + SAML_CONFIG_NOT_FOUND: + $ref: '#/components/examples/SAML_CONFIG_NOT_FOUND' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Not Found: The server cannot find the requested resource.' + '409': + content: + application/json: + examples: + SAML_CONFIG_ALREADY_ADDED: + $ref: '#/components/examples/SAML_CONFIG_ALREADY_ADDED' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Conflict: The request could not be completed due to a conflict with the current state of the resource.' + '500': + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Internal Server Error: The server encountered an unexpected error.' + summary: Renew SAML IdP Certificate + tags: + - SAML Integrations + security: + - M2MBearerToken: [] + /v2/manage/integrations/oauth: + get: + summary: List OAuth Integrations + operationId: GetAllOAuthIntegrations + description: Retrieves a list of all configured OAuth/OIDC integrations for the Tenant, including redirect URIs, allowed scopes, grant types, claim mappings, and token settings. + tags: + - OAuth Integrations + security: + - M2MBearerToken: [] + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + properties: + Data: + type: array + items: + $ref: '#/components/schemas/OAuthIntegrationResponse' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + post: + summary: Create OAuth Integration + operationId: CreateOAuthIntegration + description: Creates a new OAuth/OIDC integration configuration for the Tenant. The response returns the integration's identifier (Id), which is also the {oAuthApp} segment of the runtime OAuth/OIDC endpoints. Only the authorization_code and refresh_token grant types are permitted. + tags: + - OAuth Integrations + security: + - M2MBearerToken: [] + requestBody: + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/OAuthIntegrationCreateCore' + - $ref: '#/components/schemas/OAuthIntegrationBaseModel' + required: true + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthIntegrationResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_POST_BODY_REQUIRED: + $ref: '#/components/examples/JSON_POST_BODY_REQUIRED' + OAUTH_INTEGRATION_CONFIG_INVALID: + $ref: '#/components/examples/OAUTH_INTEGRATION_CONFIG_INVALID' + OAUTH_INTEGRATION_WORKFLOW_NOT_FOUND: + $ref: '#/components/examples/OAUTH_INTEGRATION_WORKFLOW_NOT_FOUND' + OAUTH_GRANT_TYPE_INVALID: + $ref: '#/components/examples/OAUTH_GRANT_TYPE_INVALID' + OAUTH_SCOPE_INVALID: + $ref: '#/components/examples/OAUTH_SCOPE_INVALID' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /v2/manage/integrations/oauth/{integrationId}: + get: + summary: Retrieve OAuth Integration configuration + operationId: GetOAuthIntegrationById + description: Retrieves the details of a specific OAuth/OIDC integration configuration for the Tenant using its Id, including redirect URIs, scopes, grant types, claim mappings, and token settings. + tags: + - OAuth Integrations + security: + - M2MBearerToken: [] + parameters: + - $ref: '#/components/parameters/integrationId' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthIntegrationResponse' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OAUTH_INTEGRATION_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_INTEGRATION_CONFIG_NOT_FOUND' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + put: + summary: Update OAuth Integration configuration + operationId: UpdateOAuthIntegrationById + description: Updates an existing OAuth/OIDC integration configuration for the Tenant identified by its Id. Id and DisplayName are immutable; only configuration fields are updated. Omitting a field leaves its stored value unchanged, as does a token lifetime of 0; passing an explicit empty AllowedScopes array removes all scopes from the integration. + tags: + - OAuth Integrations + security: + - M2MBearerToken: [] + parameters: + - $ref: '#/components/parameters/integrationId' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthIntegrationBaseModel' + required: true + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthIntegrationResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + OAUTH_INTEGRATION_CONFIG_INVALID: + $ref: '#/components/examples/OAUTH_INTEGRATION_CONFIG_INVALID' + OAUTH_INTEGRATION_WORKFLOW_NOT_FOUND: + $ref: '#/components/examples/OAUTH_INTEGRATION_WORKFLOW_NOT_FOUND' + OAUTH_GRANT_TYPE_INVALID: + $ref: '#/components/examples/OAUTH_GRANT_TYPE_INVALID' + OAUTH_SCOPE_INVALID: + $ref: '#/components/examples/OAUTH_SCOPE_INVALID' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OAUTH_INTEGRATION_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_INTEGRATION_CONFIG_NOT_FOUND' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + delete: + summary: Delete OAuth Integration configuration + operationId: DeleteOAuthIntegration + description: Deletes an existing OAuth/OIDC integration configuration for the Tenant using its Id, permanently removing it. + tags: + - OAuth Integrations + security: + - M2MBearerToken: [] + parameters: + - $ref: '#/components/parameters/integrationId' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OAUTH_INTEGRATION_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_INTEGRATION_CONFIG_NOT_FOUND' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /v2/manage/integrations/oauth/{integrationId}/credentials: + put: + summary: Rotate OAuth Integration client secret + operationId: RotateOAuthIntegrationCredentials + description: Regenerates the client secret for an existing OAuth/OIDC integration identified by its Id. The ClientId and Id are unchanged; only the secret is rotated. The new plaintext ClientSecret is returned once in this response, and only its hash is persisted server-side. + tags: + - OAuth Integrations + security: + - M2MBearerToken: [] + parameters: + - $ref: '#/components/parameters/integrationId' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthIntegrationCredentialsResponse' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OAUTH_INTEGRATION_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_INTEGRATION_CONFIG_NOT_FOUND' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /v2/manage/custom-providers/jwt: + get: + summary: List JWT SP configurations + operationId: GetAllJwtConfigSPConfigurations + description: Retrieves a list of all Service Provider (SP) configurations associated with JWT clients for the Tenant, including endpoints, mapping, and other settings for each SP setup. + tags: + - JWT Custom Providers + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + properties: + Data: + type: array + items: + $ref: '#/components/schemas/JwtSpConfig' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JWT_CONFIG_NOT_FOUND: + $ref: '#/components/examples/JWT_CONFIG_NOT_FOUND' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + post: + summary: Create JWT SP configuration + operationId: CreateJwtSPClientConfiguration + description: Creates a new Service Provider (SP) configuration for a JWT client in the Tenant, defining details such as endpoints, mapping, and other required settings. + tags: + - JWT Custom Providers + requestBody: + required: true + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/JwtSpConfigCreateCore' + - $ref: '#/components/schemas/JwtSpConfigBaseModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/JwtSpConfig' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_POST_BODY_REQUIRED: + $ref: '#/components/examples/JSON_POST_BODY_REQUIRED' + RAAS_UPDATE_FIELDS_INVALID: + $ref: '#/components/examples/RAAS_UPDATE_FIELDS_INVALID' + SSO_MAPPING_INVALID_JWT_SP: + $ref: '#/components/examples/SSO_MAPPING_INVALID_JWT_SP' + ID_MAPPING_REQUIRED: + $ref: '#/components/examples/ID_MAPPING_REQUIRED' + SSO_MAPPING_REQUIRED_JWT_SP: + $ref: '#/components/examples/SSO_MAPPING_REQUIRED_JWT_SP' + JWT_CLOCK_SKEW_INVALID: + $ref: '#/components/examples/JWT_CLOCK_SKEW_INVALID' + JWT_AUDIENCE_REQUIRED: + $ref: '#/components/examples/JWT_AUDIENCE_REQUIRED' + JWT_ISSUER_REQUIRED: + $ref: '#/components/examples/JWT_ISSUER_REQUIRED' + AUTO_LOOKUP_DOMAIN_INVALID: + $ref: '#/components/examples/AUTO_LOOKUP_DOMAIN_INVALID' + DOMAIN_NAME_IS_REQUIRED_JWT_SP: + $ref: '#/components/examples/DOMAIN_NAME_IS_REQUIRED_JWT_SP' + JWT_JWKSURL_INVALID: + $ref: '#/components/examples/JWT_JWKSURL_INVALID' + JWT_KEY_INVALID: + $ref: '#/components/examples/JWT_KEY_INVALID' + JWT_LOGIN_URL_INVALID_JWT_SP: + $ref: '#/components/examples/JWT_LOGIN_URL_INVALID_JWT_SP' + JWT_ALOGRITHM_INVALID: + $ref: '#/components/examples/JWT_ALOGRITHM_INVALID' + JWT_ALGORITHM_REQUIRED: + $ref: '#/components/examples/JWT_ALGORITHM_REQUIRED' + SSO_APPNAME_INVALID_JWT_SP: + $ref: '#/components/examples/SSO_APPNAME_INVALID_JWT_SP' + SSO_APPNAME_REQUIRED_JWT_SP: + $ref: '#/components/examples/SSO_APPNAME_REQUIRED_JWT_SP' + SSO_APPNAME_LENGTH_EXCEEDED_JWT_SP: + $ref: '#/components/examples/SSO_APPNAME_LENGTH_EXCEEDED_JWT_SP' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + MISSING_JWKSURL: + $ref: '#/components/examples/MISSING_JWKSURL' + MISSING_JWT_KEY: + $ref: '#/components/examples/MISSING_JWT_KEY' + '409': + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JWT_CONFIG_ALREADY_EXIST: + $ref: '#/components/examples/JWT_CONFIG_ALREADY_EXIST' + DOMAIN_NAME_ALREADY_EXISTS: + $ref: '#/components/examples/DOMAIN_NAME_ALREADY_EXISTS' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + /v2/manage/custom-providers/jwt/{jwtApp}: + get: + summary: Retrieve JWT SP configuration + operationId: GetJwtSPClientConfigurationByAppName + description: Retrieves the Service Provider (SP) configuration details for a JWT client in the Tenant using the AppName, including endpoints, mapping, and other configured settings. + tags: + - JWT Custom Providers + security: + - M2MBearerToken: [] + parameters: + - $ref: '#/components/parameters/jwtApp' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/JwtSpConfig' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JWT_CONFIG_NOT_FOUND: + $ref: '#/components/examples/JWT_CONFIG_NOT_FOUND' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + put: + summary: Update JWT SP configuration + operationId: UpdateJwtSPClientConfigurationByAppName + description: Updates an existing Service Provider (SP) configuration for a JWT client in the Tenant identified by the AppName, modifying settings such as endpoints, mapping, or other configuration details. + tags: + - JWT Custom Providers + security: + - M2MBearerToken: [] + parameters: + - $ref: '#/components/parameters/jwtApp' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/JwtSpConfigBaseModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/JwtSpConfig' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + RAAS_UPDATE_FIELDS_INVALID: + $ref: '#/components/examples/RAAS_UPDATE_FIELDS_INVALID' + SSO_MAPPING_INVALID_JWT_SP: + $ref: '#/components/examples/SSO_MAPPING_INVALID_JWT_SP' + ID_MAPPING_REQUIRED: + $ref: '#/components/examples/ID_MAPPING_REQUIRED' + SSO_MAPPING_REQUIRED_JWT_SP: + $ref: '#/components/examples/SSO_MAPPING_REQUIRED_JWT_SP' + JWT_CLOCK_SKEW_INVALID: + $ref: '#/components/examples/JWT_CLOCK_SKEW_INVALID' + JWT_AUDIENCE_REQUIRED: + $ref: '#/components/examples/JWT_AUDIENCE_REQUIRED' + JWT_ISSUER_REQUIRED: + $ref: '#/components/examples/JWT_ISSUER_REQUIRED' + AUTO_LOOKUP_DOMAIN_INVALID: + $ref: '#/components/examples/AUTO_LOOKUP_DOMAIN_INVALID' + DOMAIN_NAME_IS_REQUIRED_JWT_SP: + $ref: '#/components/examples/DOMAIN_NAME_IS_REQUIRED_JWT_SP' + JWT_JWKSURL_INVALID: + $ref: '#/components/examples/JWT_JWKSURL_INVALID' + JWT_KEY_INVALID: + $ref: '#/components/examples/JWT_KEY_INVALID' + JWT_LOGIN_URL_INVALID_JWT_SP: + $ref: '#/components/examples/JWT_LOGIN_URL_INVALID_JWT_SP' + JWT_ALOGRITHM_INVALID: + $ref: '#/components/examples/JWT_ALOGRITHM_INVALID' + JWT_ALGORITHM_REQUIRED: + $ref: '#/components/examples/JWT_ALGORITHM_REQUIRED' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JWT_CONFIG_NOT_FOUND: + $ref: '#/components/examples/JWT_CONFIG_NOT_FOUND' + MISSING_JWKSURL: + $ref: '#/components/examples/MISSING_JWKSURL' + MISSING_JWT_KEY: + $ref: '#/components/examples/MISSING_JWT_KEY' + '409': + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + DOMAIN_NAME_ALREADY_EXISTS: + $ref: '#/components/examples/DOMAIN_NAME_ALREADY_EXISTS' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + delete: + summary: Delete JWT SP configuration + operationId: DeleteJwtSPClientConfigurationByAppName + description: Deletes the Service Provider (SP) configuration for a JWT client in the Tenant identified by the AppName, permanently disabling the application's service provider integration. + tags: + - JWT Custom Providers + security: + - M2MBearerToken: [] + parameters: + - $ref: '#/components/parameters/jwtApp' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JWT_CONFIG_NOT_FOUND: + $ref: '#/components/examples/JWT_CONFIG_NOT_FOUND' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /v2/manage/custom-providers/saml: + get: + summary: List SAML SP Configurations + operationId: GetAllSAMLSPClientConfigurations + description: Retrieves a list of all Service Provider configurations for SAML clients within the Tenant, including details such as datamap, endpoints, and certificates. + tags: + - SAML Custom Providers + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + properties: + Data: + type: array + items: + $ref: '#/components/schemas/SamlSpConfig' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + security: + - M2MBearerToken: [] + post: + summary: Create SAML SP Configuration + operationId: CreateSAMLSPClientConfiguration + description: Creates a new Service Provider configuration for a SAML client within the Tenant, defining necessary settings for SAML authentication flows. + tags: + - SAML Custom Providers + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SamlSpConfigModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/SamlSpConfig' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_POST_BODY_REQUIRED: + $ref: '#/components/examples/JSON_POST_BODY_REQUIRED' + SAML_PROVIDR_NAME_INVALID: + $ref: '#/components/examples/SAML_PROVIDR_NAME_INVALID' + SAML_PROVIDR_NAME_LENGTH_EXCEEDED: + $ref: '#/components/examples/SAML_PROVIDR_NAME_LENGTH_EXCEEDED' + SSO_FRIENDLY_PROVIDER_NAME_INVALID: + $ref: '#/components/examples/SSO_FRIENDLY_PROVIDER_NAME_INVALID' + SAML_IDP_CERTIFICATE_IS_REQUIRED: + $ref: '#/components/examples/SAML_IDP_CERTIFICATE_IS_REQUIRED' + SAML_IDP_CERTIFICATE_INVALID: + $ref: '#/components/examples/SAML_IDP_CERTIFICATE_INVALID' + SSO_MAPPING_INVALID: + $ref: '#/components/examples/SSO_MAPPING_INVALID' + SSO_MAPPING_REQUIRED: + $ref: '#/components/examples/SSO_MAPPING_REQUIRED' + INVALID_DOMAIN_NAME_SP: + $ref: '#/components/examples/INVALID_DOMAIN_NAME_SP' + DOMAIN_NAME_IS_REQUIRED_SP: + $ref: '#/components/examples/DOMAIN_NAME_IS_REQUIRED_SP' + SAML_SP_LOGOUT_INVALID: + $ref: '#/components/examples/SAML_SP_LOGOUT_INVALID' + SAML_SP_LOCATION_INVALID: + $ref: '#/components/examples/SAML_SP_LOCATION_INVALID' + SAML_SP_LOGOUT_REQUIRED: + $ref: '#/components/examples/SAML_SP_LOGOUT_REQUIRED' + SAML_SP_LOCATION_REQUIRED: + $ref: '#/components/examples/SAML_SP_LOCATION_REQUIRED' + SAML_SP_BINDING_INVALID: + $ref: '#/components/examples/SAML_SP_BINDING_INVALID' + SAML_SP_LOCATION_LOGOUT_BINDING_REQUIRED: + $ref: '#/components/examples/SAML_SP_LOCATION_LOGOUT_BINDING_REQUIRED' + SAML_PROVIDR_NAME_REQUIRED: + $ref: '#/components/examples/SAML_PROVIDR_NAME_REQUIRED' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + SAML_CONFIG_NOT_FOUND: + $ref: '#/components/examples/SAML_CONFIG_NOT_FOUND' + '409': + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + DOMAIN_NAME_ALREADY_EXISTS: + $ref: '#/components/examples/DOMAIN_NAME_ALREADY_EXISTS' + SAML_CONFIG_ALREADY_ADDED: + $ref: '#/components/examples/SAML_CONFIG_ALREADY_ADDED' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + /v2/manage/custom-providers/saml/keys: + get: + summary: Retrieve SAML SP Mapping Keys + operationId: GetSamlSPClientMappingKeys + description: Retrieves a list of mapping keys available for configuring attribute mappings in SAML Service Provider clients within the Tenant. + tags: + - SAML Custom Providers + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + properties: + Data: + type: array + items: + $ref: '#/components/schemas/SamlKeys' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + security: + - M2MBearerToken: [] + /v2/manage/custom-providers/saml/{samlApp}: + get: + summary: Retrieve SAML SP Configuration + operationId: GetSAMLSPClientConfigurationByAppName + description: Retrieves the Service Provider configuration details for a SAML client within the Tenant, identified by the application name. + tags: + - SAML Custom Providers + parameters: + - $ref: '#/components/parameters/samlApp' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/SamlSpConfig' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + SAML_CONFIG_NOT_FOUND: + $ref: '#/components/examples/SAML_CONFIG_NOT_FOUND' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + put: + summary: Update SAML SP Configuration + operationId: UpdateSAMLSPClientConfigurationByAppName + description: Updates an existing Service Provider configuration for a SAML client within the Tenant, identified by the application name. + tags: + - SAML Custom Providers + parameters: + - $ref: '#/components/parameters/samlApp' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SamlSpConfigModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/SamlSpConfig' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + SSO_FRIENDLY_PROVIDER_NAME_INVALID: + $ref: '#/components/examples/SSO_FRIENDLY_PROVIDER_NAME_INVALID' + SAML_IDP_CERTIFICATE_INVALID: + $ref: '#/components/examples/SAML_IDP_CERTIFICATE_INVALID' + SSO_MAPPING_INVALID: + $ref: '#/components/examples/SSO_MAPPING_INVALID' + INVALID_DOMAIN_NAME_SP: + $ref: '#/components/examples/INVALID_DOMAIN_NAME_SP' + DOMAIN_NAME_IS_REQUIRED_SP: + $ref: '#/components/examples/DOMAIN_NAME_IS_REQUIRED_SP' + SAML_SP_LOGOUT_INVALID: + $ref: '#/components/examples/SAML_SP_LOGOUT_INVALID' + SAML_SP_LOCATION_INVALID: + $ref: '#/components/examples/SAML_SP_LOCATION_INVALID' + SAML_SP_BINDING_INVALID: + $ref: '#/components/examples/SAML_SP_BINDING_INVALID' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + SAML_CONFIG_NOT_FOUND: + $ref: '#/components/examples/SAML_CONFIG_NOT_FOUND' + '409': + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + DOMAIN_NAME_ALREADY_EXISTS: + $ref: '#/components/examples/DOMAIN_NAME_ALREADY_EXISTS' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + delete: + summary: Delete SAML SP Configuration + operationId: DeleteSAMLSPClientConfigurationByAppName + description: Deletes the Service Provider configuration for a SAML client within the Tenant, identified by the application name. + tags: + - SAML Custom Providers + parameters: + - $ref: '#/components/parameters/samlApp' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + SAML_CONFIG_NOT_FOUND: + $ref: '#/components/examples/SAML_CONFIG_NOT_FOUND' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + /v2/manage/custom-providers/saml/{samlApp}/renew-certificate: + post: + description: Renews the SAML Service Provider certificate to replace an expiring or compromised certificate. + operationId: RenewSAMLSppCertificate + parameters: + - $ref: '#/components/parameters/samlApp' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SamlSpConfig' + description: 'OK: The request was successful.' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + schema: + $ref: '#/components/schemas/ErrorResponse' + '404': + content: + application/json: + examples: + SAML_CONFIG_NOT_FOUND: + $ref: '#/components/examples/SAML_CONFIG_NOT_FOUND' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Not Found: The server cannot find the requested resource.' + '409': + content: + application/json: + examples: + SAML_CONFIG_ALREADY_ADDED: + $ref: '#/components/examples/SAML_CONFIG_ALREADY_ADDED' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Conflict: The request could not be completed due to a conflict with the current state of the resource.' + '500': + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Internal Server Error: The server encountered an unexpected error.' + summary: Renew SAML SP Certificate + tags: + - SAML Custom Providers + security: + - M2MBearerToken: [] + /v2/manage/custom-fields: + get: + summary: List custom fields + operationId: GetAllCustomFields + description: Retrieves all Custom Fields created for the Tenant. + tags: + - Custom Fields + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + properties: + Data: + type: array + items: + $ref: '#/components/schemas/RaasCustomField' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + CUSTOM_FIELD_LIMIT_EXCEEDED: + $ref: '#/components/examples/CUSTOM_FIELD_LIMIT_EXCEEDED' + security: + - M2MBearerToken: [] + post: + summary: Create custom field + operationId: CreateCustomField + description: Creates a new Custom Field for the Tenant. + tags: + - Custom Fields + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/RaasCustomFieldModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/RaasCustomField' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_POST_BODY_REQUIRED: + $ref: '#/components/examples/JSON_POST_BODY_REQUIRED' + PARAMETER_NOT_WELL_FORMATTED_REQUIRED: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_REQUIRED' + INVALID_NAME: + $ref: '#/components/examples/INVALID_NAME' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '409': + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + CUSTOM_FIELD_ALLREADY_EXISTS: + $ref: '#/components/examples/CUSTOM_FIELD_ALLREADY_EXISTS' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + put: + summary: Set custom field + operationId: SetCustomField + description: Updates or sets a Custom Field instance in RAAS to be displayed on forms for the Tenant. + tags: + - Custom Fields + requestBody: + required: true + content: + application/json: + schema: + properties: + Data: + type: array + items: + $ref: '#/components/schemas/RaasConfigData' + minItems: 1 + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + properties: + Data: + type: array + items: + $ref: '#/components/schemas/RaasConfig' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + CUSTOM_FIELD_NOT_FOUND: + $ref: '#/components/examples/CUSTOM_FIELD_NOT_FOUND' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + /v2/manage/custom-fields/{cfname}: + delete: + summary: Delete custom field + operationId: DeleteCustomField + description: Deletes a Custom Field by name for the Tenant. + tags: + - Custom Fields + security: + - M2MBearerToken: [] + parameters: + - $ref: '#/components/parameters/CustomFieldsName' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + CUSTOM_FIELD_NOT_FOUND: + $ref: '#/components/examples/CUSTOM_FIELD_NOT_FOUND' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /v2/manage/custom-fields/list: + get: + summary: List custom fields + operationId: ListCustomFields + description: Retrieves all custom fields for the Tenant, returned as an array of strings. + tags: + - Custom Fields + security: + - M2MBearerToken: [] + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + properties: + Data: + type: array + items: + type: string + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + CUSTOMER_REGISTRATION_CUSTOM_DATA_NOT_EXISTS: + $ref: '#/components/examples/CUSTOMER_REGISTRATION_CUSTOM_DATA_NOT_EXISTS' + /v2/manage/custom-fields/active: + get: + summary: List active custom fields + operationId: GetActiveCustomFields + description: Retrieves all custom fields currently active in the registration form for the Tenant. + tags: + - Custom Fields + security: + - M2MBearerToken: [] + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + properties: + Data: + type: array + items: + $ref: '#/components/schemas/RaasConfig' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + CUSTOMER_REGISTRATION_CUSTOM_DATA_NOT_EXISTS: + $ref: '#/components/examples/CUSTOMER_REGISTRATION_CUSTOM_DATA_NOT_EXISTS' + CUSTOM_FIELD_NOT_FOUND: + $ref: '#/components/examples/CUSTOM_FIELD_NOT_FOUND' + /v2/manage/custom-fields/limit: + get: + summary: Retrieve custom field limit + operationId: GetCustomFieldLimit + description: Retrieves the Custom Field Limit configured for the Tenant. + tags: + - Custom Fields + security: + - M2MBearerToken: [] + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/CustomFieldLimitResponse' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /v2/manage/oauth-clients: + get: + description: Retrieves a comprehensive list of OAuth client configurations for the Tenant, including client IDs, redirect URIs, scopes, and other relevant settings. + operationId: GetAllOAuthClientsConfigurations + responses: + '200': + content: + application/json: + schema: + properties: + Data: + items: + $ref: '#/components/schemas/OAuthClientResponse' + type: array + description: 'OK: The request was successful.' + '403': + content: + application/json: + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '500': + description: 'Status Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: List OAuth clients + tags: + - OAuth Clients + security: + - M2MBearerToken: [] + post: + description: Creates a new OAuth client configuration for the Tenant by specifying redirect URIs, scopes, and other necessary settings to enable OAuth authentication and authorization. + operationId: CreateOAuthClientConfiguration + requestBody: + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/OAuthClientCreateCore' + - $ref: '#/components/schemas/OAuthClientRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthClientResponse' + description: 'OK: The request was successful.' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + examples: + JSON_POST_BODY_REQUIRED: + $ref: '#/components/examples/JSON_POST_BODY_REQUIRED' + SSO_APPNAME_REQUIRED_OAUTH: + $ref: '#/components/examples/SSO_APPNAME_REQUIRED_OAUTH' + SSO_APPNAME_LENGTH_EXCEEDED_OAUTH: + $ref: '#/components/examples/SSO_APPNAME_LENGTH_EXCEEDED_OAUTH' + SSO_APPNAME_INVALID_OAUTH: + $ref: '#/components/examples/SSO_APPNAME_INVALID_OAUTH' + OAUTH_AUDIENCE_SCOPES_INVALID: + $ref: '#/components/examples/OAUTH_AUDIENCE_SCOPES_INVALID' + OAUTH_GRANT_TYPE_INVALID: + $ref: '#/components/examples/OAUTH_GRANT_TYPE_INVALID' + OAUTH_SCOPE_INVALID: + $ref: '#/components/examples/OAUTH_SCOPE_INVALID' + OAUTH_CLIENT_TYPE_INVALID: + $ref: '#/components/examples/OAUTH_CLIENT_TYPE_INVALID' + OAUTH_DESCRIPTION_LENGTH_EXCEEDED: + $ref: '#/components/examples/OAUTH_DESCRIPTION_LENGTH_EXCEEDED' + OAUTH_TOKEN_AUTH_METHOD_INVALID: + $ref: '#/components/examples/OAUTH_TOKEN_AUTH_METHOD_INVALID' + OAUTH_GTY_CLIENT_CRED_NOT_ALLOWED_WITH_NONE: + $ref: '#/components/examples/OAUTH_GTY_CLIENT_CRED_NOT_ALLOWED_WITH_NONE' + OAUTH_GTY_TOKEN_EXCH_NOT_ALLOWED_WITH_NONE: + $ref: '#/components/examples/OAUTH_GTY_TOKEN_EXCH_NOT_ALLOWED_WITH_NONE' + OAUTH_JWTCONFIG_TOKEN_TTL_INVALID: + $ref: '#/components/examples/OAUTH_JWTCONFIG_TOKEN_TTL_INVALID' + OAUTH_REFRESH_TOKEN_TTL_INVALID: + $ref: '#/components/examples/OAUTH_REFRESH_TOKEN_TTL_INVALID' + OAUTH_REFRESH_TOKEN_TTL_MUST_GT_TOKEN_TTL: + $ref: '#/components/examples/OAUTH_REFRESH_TOKEN_TTL_MUST_GT_TOKEN_TTL' + OAUTH_LOGIN_REDIRECT_URL_INVALID: + $ref: '#/components/examples/OAUTH_LOGIN_REDIRECT_URL_INVALID' + OAUTH_CORS_ORIGIN_INVALID: + $ref: '#/components/examples/OAUTH_CORS_ORIGIN_INVALID' + OAUTH_DEVICE_CODE_BOTH_VERIFICATION_URL_REQUIRED: + $ref: '#/components/examples/OAUTH_DEVICE_CODE_BOTH_VERIFICATION_URL_REQUIRED' + OAUTH_DEVICE_CODE_VERIFICATION_URL_REQUIRED: + $ref: '#/components/examples/OAUTH_DEVICE_CODE_VERIFICATION_URL_REQUIRED' + OAUTH_DEVICE_CODE_AFTER_VERIFICATION_URL_REQUIRED: + $ref: '#/components/examples/OAUTH_DEVICE_CODE_AFTER_VERIFICATION_URL_REQUIRED' + OAUTH_DEVICE_CODE_EXPIRE_INVALID: + $ref: '#/components/examples/OAUTH_DEVICE_CODE_EXPIRE_INVALID' + OAUTH_DEVICE_CODE_POLLING_INTERVAL_INVALID: + $ref: '#/components/examples/OAUTH_DEVICE_CODE_POLLING_INTERVAL_INVALID' + OAUTH_DEVICE_CODE_USER_CHAR_SET_INVALID: + $ref: '#/components/examples/OAUTH_DEVICE_CODE_USER_CHAR_SET_INVALID' + OAUTH_DEVICE_CODE_USER_CODE_MASK_INVALID: + $ref: '#/components/examples/OAUTH_DEVICE_CODE_USER_CODE_MASK_INVALID' + OAUTH_DEVICE_CODE_VERIFICATION_URL_INVALID: + $ref: '#/components/examples/OAUTH_DEVICE_CODE_VERIFICATION_URL_INVALID' + OAUTH_DEVICE_CODE_AFTER_VERIFICATION_URL_INVALID: + $ref: '#/components/examples/OAUTH_DEVICE_CODE_AFTER_VERIFICATION_URL_INVALID' + OAUTH_LOGOUT_REDIRECT_URL_INVALID: + $ref: '#/components/examples/OAUTH_LOGOUT_REDIRECT_URL_INVALID' + OAUTH_CIBA_TOKEN_TTL_INVALID: + $ref: '#/components/examples/OAUTH_CIBA_TOKEN_TTL_INVALID' + OAUTH_CIBA_LOGOUT_URI_INVALID: + $ref: '#/components/examples/OAUTH_CIBA_LOGOUT_URI_INVALID' + OAUTH_CIBA_LOGOUT_URI_REQUIRED: + $ref: '#/components/examples/OAUTH_CIBA_LOGOUT_URI_REQUIRED' + OAUTH_SECRET_FORMAT_INVALID: + $ref: '#/components/examples/OAUTH_SECRET_FORMAT_INVALID' + OAUTH_REFRESH_TOKEN_ROTATION_OVERLAP_INVALID: + $ref: '#/components/examples/OAUTH_REFRESH_TOKEN_ROTATION_OVERLAP_INVALID' + schema: + $ref: '#/components/schemas/ErrorResponse' + '403': + content: + application/json: + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + WORKFLOW_NOT_FOUND: + $ref: '#/components/examples/WORKFLOW_NOT_FOUND' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '409': + description: 'Status Conflict: The request could not be completed due to a conflict with the current state of the resource.' + content: + application/json: + examples: + OAUTH_CONFIG_ALREADY_EXIST: + $ref: '#/components/examples/OAUTH_CONFIG_ALREADY_EXIST' + schema: + $ref: '#/components/schemas/ErrorResponse' + '500': + description: 'Status Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Create OAuth client + tags: + - OAuth Clients + security: + - M2MBearerToken: [] + /v2/manage/oauth-clients/{oAuthClientName}: + delete: + description: Deletes the OAuth client configuration for the Tenant identified by the application name. + operationId: DeleteOAuthClient + parameters: + - $ref: '#/components/parameters/oAuthClientName' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + description: 'OK: The request was successful.' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + schema: + $ref: '#/components/schemas/ErrorResponse' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OAUTH_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_CONFIG_NOT_FOUND' + '500': + description: 'Status Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Delete OAuth Client Configuration + tags: + - OAuth Clients + security: + - M2MBearerToken: [] + get: + description: Retrieves the OAuth client configuration details for the Tenant using the application name. + operationId: GetOAuthClientConfigurationByAppName + parameters: + - $ref: '#/components/parameters/oAuthClientName' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthClientResponse' + description: 'OK: The request was successful.' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + schema: + $ref: '#/components/schemas/ErrorResponse' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OAUTH_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_CONFIG_NOT_FOUND' + '500': + description: 'Status Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Retrieve OAuth Client Configuration + tags: + - OAuth Clients + security: + - M2MBearerToken: [] + put: + description: Updates the OAuth client configuration for the Tenant identified by the application name. + operationId: UpdateOAuthClientConfigurationByAppName + parameters: + - $ref: '#/components/parameters/oAuthClientName' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthClientRequest' + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthClientResponse' + description: 'OK: The request was successful.' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + examples: + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + OAUTH_AUDIENCE_SCOPES_INVALID: + $ref: '#/components/examples/OAUTH_AUDIENCE_SCOPES_INVALID' + OAUTH_GRANT_TYPE_INVALID: + $ref: '#/components/examples/OAUTH_GRANT_TYPE_INVALID' + OAUTH_SCOPE_INVALID: + $ref: '#/components/examples/OAUTH_SCOPE_INVALID' + OAUTH_CLIENT_TYPE_INVALID: + $ref: '#/components/examples/OAUTH_CLIENT_TYPE_INVALID' + OAUTH_DESCRIPTION_LENGTH_EXCEEDED: + $ref: '#/components/examples/OAUTH_DESCRIPTION_LENGTH_EXCEEDED' + OAUTH_TOKEN_AUTH_METHOD_INVALID: + $ref: '#/components/examples/OAUTH_TOKEN_AUTH_METHOD_INVALID' + OAUTH_PASSWORD_LESS_LOGIN_FEATURE_DISABLED: + $ref: '#/components/examples/OAUTH_PASSWORD_LESS_LOGIN_FEATURE_DISABLED' + OAUTH_PASSWORD_LESS_EMAIL_LOGIN_DISABLED: + $ref: '#/components/examples/OAUTH_PASSWORD_LESS_EMAIL_LOGIN_DISABLED' + OAUTH_PASSWORD_LESS_SMS_LOGIN_DISABLED: + $ref: '#/components/examples/OAUTH_PASSWORD_LESS_SMS_LOGIN_DISABLED' + OAUTH_GTY_CLIENT_CRED_NOT_ALLOWED_WITH_NONE: + $ref: '#/components/examples/OAUTH_GTY_CLIENT_CRED_NOT_ALLOWED_WITH_NONE' + OAUTH_GTY_TOKEN_EXCH_NOT_ALLOWED_WITH_NONE: + $ref: '#/components/examples/OAUTH_GTY_TOKEN_EXCH_NOT_ALLOWED_WITH_NONE' + OAUTH_JWTCONFIG_TOKEN_TTL_INVALID: + $ref: '#/components/examples/OAUTH_JWTCONFIG_TOKEN_TTL_INVALID' + OAUTH_REFRESH_TOKEN_TTL_INVALID: + $ref: '#/components/examples/OAUTH_REFRESH_TOKEN_TTL_INVALID' + OAUTH_REFRESH_TOKEN_TTL_MUST_GT_TOKEN_TTL: + $ref: '#/components/examples/OAUTH_REFRESH_TOKEN_TTL_MUST_GT_TOKEN_TTL' + OAUTH_LOGIN_REDIRECT_URL_INVALID: + $ref: '#/components/examples/OAUTH_LOGIN_REDIRECT_URL_INVALID' + OAUTH_CORS_ORIGIN_INVALID: + $ref: '#/components/examples/OAUTH_CORS_ORIGIN_INVALID' + OAUTH_DEVICE_CODE_BOTH_VERIFICATION_URL_REQUIRED: + $ref: '#/components/examples/OAUTH_DEVICE_CODE_BOTH_VERIFICATION_URL_REQUIRED' + OAUTH_DEVICE_CODE_VERIFICATION_URL_REQUIRED: + $ref: '#/components/examples/OAUTH_DEVICE_CODE_VERIFICATION_URL_REQUIRED' + OAUTH_DEVICE_CODE_AFTER_VERIFICATION_URL_REQUIRED: + $ref: '#/components/examples/OAUTH_DEVICE_CODE_AFTER_VERIFICATION_URL_REQUIRED' + OAUTH_DEVICE_CODE_EXPIRE_INVALID: + $ref: '#/components/examples/OAUTH_DEVICE_CODE_EXPIRE_INVALID' + OAUTH_DEVICE_CODE_POLLING_INTERVAL_INVALID: + $ref: '#/components/examples/OAUTH_DEVICE_CODE_POLLING_INTERVAL_INVALID' + OAUTH_DEVICE_CODE_USER_CHAR_SET_INVALID: + $ref: '#/components/examples/OAUTH_DEVICE_CODE_USER_CHAR_SET_INVALID' + OAUTH_DEVICE_CODE_USER_CODE_MASK_INVALID: + $ref: '#/components/examples/OAUTH_DEVICE_CODE_USER_CODE_MASK_INVALID' + OAUTH_DEVICE_CODE_VERIFICATION_URL_INVALID: + $ref: '#/components/examples/OAUTH_DEVICE_CODE_VERIFICATION_URL_INVALID' + OAUTH_DEVICE_CODE_AFTER_VERIFICATION_URL_INVALID: + $ref: '#/components/examples/OAUTH_DEVICE_CODE_AFTER_VERIFICATION_URL_INVALID' + OAUTH_LOGOUT_REDIRECT_URL_INVALID: + $ref: '#/components/examples/OAUTH_LOGOUT_REDIRECT_URL_INVALID' + OAUTH_CIBA_TOKEN_TTL_INVALID: + $ref: '#/components/examples/OAUTH_CIBA_TOKEN_TTL_INVALID' + OAUTH_CIBA_LOGOUT_URI_INVALID: + $ref: '#/components/examples/OAUTH_CIBA_LOGOUT_URI_INVALID' + OAUTH_CIBA_LOGOUT_URI_REQUIRED: + $ref: '#/components/examples/OAUTH_CIBA_LOGOUT_URI_REQUIRED' + OAUTH_SECRET_FORMAT_INVALID: + $ref: '#/components/examples/OAUTH_SECRET_FORMAT_INVALID' + OAUTH_REFRESH_TOKEN_ROTATION_OVERLAP_INVALID: + $ref: '#/components/examples/OAUTH_REFRESH_TOKEN_ROTATION_OVERLAP_INVALID' + schema: + $ref: '#/components/schemas/ErrorResponse' + '403': + content: + application/json: + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + WORKFLOW_NOT_FOUND: + $ref: '#/components/examples/WORKFLOW_NOT_FOUND' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OAUTH_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_CONFIG_NOT_FOUND' + '500': + description: 'Status Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Update OAuth Client Configuration + tags: + - OAuth Clients + security: + - M2MBearerToken: [] + /v2/manage/oauth-clients/credentials/{oAuthClientName}: + put: + description: Resets the client secret for the OAuth client configuration identified by the AppName within the Tenant, generating a new client secret and invalidating the previous one to enhance security. + operationId: ResetOAuthClientConfigurationSecretByAppName + parameters: + - $ref: '#/components/parameters/oAuthClientName' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthClientSecretResetResponse' + description: 'OK: The request was successful.' + '403': + content: + application/json: + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OAUTH_CONFIG_NOT_FOUND: + $ref: '#/components/examples/OAUTH_CONFIG_NOT_FOUND' + '409': + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OAUTH_CONFIG_CREDENTIALS_RESET_FAILED: + $ref: '#/components/examples/OAUTH_CONFIG_CREDENTIALS_RESET_FAILED' + '500': + description: 'Status Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + schema: + $ref: '#/components/schemas/ErrorResponse' + summary: Reset OAuth client secret + tags: + - OAuth Clients + security: + - M2MBearerToken: [] + /v2/manage/oauth-clients/connections-metadata: + get: + description: Retrieves metadata for OAuth client connections within the Tenant. + operationId: GetOAuthClientConnectionsMetadata + responses: + '200': + content: + application/json: + schema: + properties: + CustomIdp: + type: array + items: + type: string + Enterprise: + type: array + items: + type: string + SocialLogins: + type: array + items: + type: string + description: 'OK: The request was successful.' + '403': + content: + application/json: + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + schema: + $ref: '#/components/schemas/ErrorResponse' + description: 'Status Forbidden: The client does not have permission to access the resource.' + summary: Retrieve OAuth Client Metadata + tags: + - OAuth Clients + security: + - M2MBearerToken: [] + /v2/manage/custom-providers/oauth: + get: + summary: List custom OAuth providers + operationId: GetAllCustomOAuthProviders + description: Retrieves all custom OAuth providers configured for the Tenant. + tags: + - OAuth Custom Providers + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + properties: + Data: + type: array + items: + $ref: '#/components/schemas/OAuth2Provider' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ERROR_UNMARSHALLING_DATA: + $ref: '#/components/examples/ERROR_UNMARSHALLING_DATA' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + CUSTOM_OAUTH_CONFIG_NOT_FOUND: + $ref: '#/components/examples/CUSTOM_OAUTH_CONFIG_NOT_FOUND' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + post: + summary: Create custom OAuth provider + operationId: CreateCustomProvider + description: Creates a new Custom OAuth provider for the Tenant. + tags: + - OAuth Custom Providers + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CustomOAuth2Model' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/OAuth2Provider' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_POST_BODY_REQUIRED: + $ref: '#/components/examples/JSON_POST_BODY_REQUIRED' + PARAMETER_NOT_WELL_FORMATTED_INVALID: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_INVALID' + PARAMETER_NOT_WELL_FORMATTED_REQUIRED: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_REQUIRED' + ERROR_UNMARSHALLING_DATA: + $ref: '#/components/examples/ERROR_UNMARSHALLING_DATA' + INVALID_DOMAIN_NAME: + $ref: '#/components/examples/INVALID_DOMAIN_NAME' + DOMAIN_NAME_IS_REQUIRED: + $ref: '#/components/examples/DOMAIN_NAME_IS_REQUIRED' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '409': + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + DOMAIN_NAME_ALREADY_EXISTS: + $ref: '#/components/examples/DOMAIN_NAME_ALREADY_EXISTS' + CUSTOM_OAUTH_PROVIDER_ALREADY_ADDED: + $ref: '#/components/examples/CUSTOM_OAUTH_PROVIDER_ALREADY_ADDED' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + put: + summary: Update custom OAuth provider + operationId: UpdateCustomProvider + description: Updates an existing Custom OAuth provider for the Tenant using the provider name specified in the request body. + tags: + - OAuth Custom Providers + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CustomOAuth2UpdateModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/OAuth2Provider' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + PARAMETER_NOT_WELL_FORMATTED_REQUIRED: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_REQUIRED' + ERROR_UNMARSHALLING_DATA: + $ref: '#/components/examples/ERROR_UNMARSHALLING_DATA' + INVALID_DOMAIN_NAME: + $ref: '#/components/examples/INVALID_DOMAIN_NAME' + DOMAIN_NAME_IS_REQUIRED: + $ref: '#/components/examples/DOMAIN_NAME_IS_REQUIRED' + PROVIDER_IS_NOT_VALID: + $ref: '#/components/examples/PROVIDER_IS_NOT_VALID' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + CUSTOM_OAUTH_CONFIG_NOT_FOUND: + $ref: '#/components/examples/CUSTOM_OAUTH_CONFIG_NOT_FOUND' + '409': + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + DOMAIN_NAME_ALREADY_EXISTS: + $ref: '#/components/examples/DOMAIN_NAME_ALREADY_EXISTS' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + delete: + summary: Delete custom OAuth provider + operationId: DeleteCustomProvider + description: Deletes an existing Custom OAuth provider for the Tenant using the provider name specified in the request body. + tags: + - OAuth Custom Providers + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CustomOAuth2DeleteModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_DELETE_BODY_REQUIRED: + $ref: '#/components/examples/JSON_DELETE_BODY_REQUIRED' + PARAMETER_NOT_WELL_FORMATTED_REQUIRED: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_REQUIRED' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + CUSTOM_OAUTH_CONFIG_NOT_FOUND: + $ref: '#/components/examples/CUSTOM_OAUTH_CONFIG_NOT_FOUND' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + /v2/manage/custom-providers/oauth/keys: + get: + summary: Retrieve custom OAuth provider keys + operationId: GetCustomProviderKeys + description: Retrieves all custom OAuth provider keys for the Tenant. + tags: + - OAuth Custom Providers + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + properties: + Data: + type: array + items: + $ref: '#/components/schemas/CustomProviderKeys' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + ERROR_RAAS_CONFIG_EMPTY: + $ref: '#/components/examples/ERROR_RAAS_CONFIG_EMPTY' + security: + - M2MBearerToken: [] + /v2/manage/password-policies: + get: + summary: Retrieve Password policy + operationId: GetPasswordPolicy + description: Retrieves the Password policy settings for a specific Tenant. + tags: + - Password Policy + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/PasswordPolicy' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + put: + summary: Update Password policy + operationId: UpdatePasswordPolicy + description: Updates the Password policy settings for a specific Tenant. + tags: + - Password Policy + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PasswordPolicy' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/PasswordPolicy' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_PUT_BODY_REQUIRED: + $ref: '#/components/examples/JSON_PUT_BODY_REQUIRED' + INVALID_EXPIRATION_FREQUENCY_TYPE: + $ref: '#/components/examples/INVALID_EXPIRATION_FREQUENCY_TYPE' + INVALID_EXPIRATION_FREQUENCY: + $ref: '#/components/examples/INVALID_EXPIRATION_FREQUENCY' + INVALID_MAX_PASSWORD_HISTORY: + $ref: '#/components/examples/INVALID_MAX_PASSWORD_HISTORY' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + '404': + description: 'Not Found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + CUSTOMER_REGISTRATION_CONFIG_NOT_FOUND: + $ref: '#/components/examples/CUSTOMER_REGISTRATION_CONFIG_NOT_FOUND' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + security: + - M2MBearerToken: [] + /identity: + get: + summary: Retrieve User's by pagination + description: Retrieves User's data using the specified pagination parameters. + servers: + - url: https://cloud-api.loginradius.com + description: LoginRadius Cloud API Prod Server + tags: + - Identity + operationId: getUserProfilesByPageId + parameters: + - $ref: '#/components/parameters/Next' + - $ref: '#/components/parameters/Region' + responses: + '200': + description: Status Ok - The request was successful. + content: + application/json: + schema: + $ref: '#/components/schemas/UserProfileResponse' + '400': + description: Bad Request - Invalid query parameters. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + ApiKeySecretMissing: + $ref: '#/components/examples/ApiKeySecretMissing' + ApiKeyMissing: + $ref: '#/components/examples/ApiKeyMissing' + ApiSecretMissing: + $ref: '#/components/examples/ApiSecretMissing' + ApiKeyInvalid: + $ref: '#/components/examples/ApiKeyInvalid' + ApiSecretInvalid: + $ref: '#/components/examples/ApiSecretInvalid' + NextParamInvalid: + $ref: '#/components/examples/NextParamInvalid' + NextParamNotValid: + $ref: '#/components/examples/NextParamNotValid' + '401': + description: Unauthorized - The request requires User authentication. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + AccessRestriction: + $ref: '#/components/examples/AccessRestriction' + '403': + description: Forbidden - Access to the resource is denied. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + NextParamMissing: + $ref: '#/components/examples/NextParamMissing' + ApiKeyUnauthorized: + $ref: '#/components/examples/ApiKeyUnauthorized' + ApiSecretUnauthorized: + $ref: '#/components/examples/ApiSecretUnauthorized' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + post: + summary: Retrieve User's by query + description: Retrieves User's data based on specified query filters. + servers: + - url: https://cloud-api.loginradius.com + description: LoginRadius Cloud API Prod Server + parameters: + - $ref: '#/components/parameters/Region' + tags: + - Identity + operationId: queryUserProfiles + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UserProfileRequestBody' + responses: + '200': + description: Status Ok -The request was successful. + content: + application/json: + schema: + $ref: '#/components/schemas/UserProfileScrollResponse' + '400': + description: Bad Request - Invalid query parameters. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + PostBodyInvalid: + $ref: '#/components/examples/PostBodyInvalid' + ApiKeySecretMissing: + $ref: '#/components/examples/ApiKeySecretMissing' + ApiKeyMissing: + $ref: '#/components/examples/ApiKeyMissing' + ApiSecretMissing: + $ref: '#/components/examples/ApiSecretMissing' + ApiKeyInvalid: + $ref: '#/components/examples/ApiKeyInvalid' + ApiSecretInvalid: + $ref: '#/components/examples/ApiSecretInvalid' + ParameterBadFormat: + $ref: '#/components/examples/ParameterBadFormat' + DateRangeMissing: + $ref: '#/components/examples/DateRangeMissing' + DateRangeFromInvalidFormat: + $ref: '#/components/examples/DateRangeFromInvalidFormat' + DateRangeToInvalidFormat: + $ref: '#/components/examples/DateRangeToInvalidFormat' + DateRangeInvalid: + $ref: '#/components/examples/DateRangeInvalid' + QueryFormatInvalid: + $ref: '#/components/examples/QueryFormatInvalid' + QueryInvalid: + $ref: '#/components/examples/QueryInvalid' + '401': + description: Unauthorized - The request requires User authentication. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + AccessRestriction: + $ref: '#/components/examples/AccessRestriction' + '403': + description: Forbidden - Access to the resource is denied. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + ApiKeyUnauthorized: + $ref: '#/components/examples/ApiKeyUnauthorized' + ApiSecretUnauthorized: + $ref: '#/components/examples/ApiSecretUnauthorized' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + /identity/customobject: + get: + summary: Retrieve User's and Custom Object data by pagination + description: Retrieves User's and Custom Object data per User based on the pagination parameters. + servers: + - url: https://cloud-api.loginradius.com + description: LoginRadius Cloud API Prod Server + tags: + - Custom Objects + operationId: getCustomObjectByQuery + parameters: + - $ref: '#/components/parameters/Region' + - $ref: '#/components/parameters/CustomObject' + - $ref: '#/components/parameters/Next' + responses: + '200': + description: Status Ok - The request was successful. + content: + application/json: + schema: + $ref: '#/components/schemas/userProfileNextResponseWithCustomObject' + '400': + description: Bad Request - Invalid query parameters. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + ApiKeySecretMissing: + $ref: '#/components/examples/ApiKeySecretMissing' + ApiKeyMissing: + $ref: '#/components/examples/ApiKeyMissing' + ApiSecretMissing: + $ref: '#/components/examples/ApiSecretMissing' + ApiKeyInvalid: + $ref: '#/components/examples/ApiKeyInvalid' + ApiSecretInvalid: + $ref: '#/components/examples/ApiSecretInvalid' + CustomObjectNameInvalid: + $ref: '#/components/examples/CustomObjectNameInvalid' + CustomObjectNotAvailable: + $ref: '#/components/examples/CustomObjectNotAvailable' + NextParamInvalid: + $ref: '#/components/examples/NextParamInvalid' + NextParamNotValid: + $ref: '#/components/examples/NextParamNotValid' + '401': + description: Unauthorized - The request requires User authentication. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + AccessRestriction: + $ref: '#/components/examples/AccessRestriction' + '403': + description: Forbidden - The request was valid, but the server is refusing to respond to it. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + NextParamMissing: + $ref: '#/components/examples/NextParamMissing' + ApiKeyUnauthorized: + $ref: '#/components/examples/ApiKeyUnauthorized' + ApiSecretUnauthorized: + $ref: '#/components/examples/ApiSecretUnauthorized' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + post: + summary: Retrieve User's and Custom Object data by query + description: Retrieves User's and Custom Objects data per User based on the query. + servers: + - url: https://cloud-api.loginradius.com + description: LoginRadius Cloud API Prod Server + tags: + - Custom Objects + operationId: postCustomObjectByQuery + parameters: + - $ref: '#/components/parameters/Region' + - $ref: '#/components/parameters/CustomObject' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UserProfileRequestBody' + responses: + '200': + description: Status Ok - The request was successful. + content: + application/json: + schema: + $ref: '#/components/schemas/userProfileScrollResponseWithCustomObject' + '400': + description: Bad Request - Invalid query parameters. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + PostBodyInvalid: + $ref: '#/components/examples/PostBodyInvalid' + ApiKeySecretMissing: + $ref: '#/components/examples/ApiKeySecretMissing' + ApiKeyMissing: + $ref: '#/components/examples/ApiKeyMissing' + ApiSecretMissing: + $ref: '#/components/examples/ApiSecretMissing' + ApiKeyInvalid: + $ref: '#/components/examples/ApiKeyInvalid' + ApiSecretInvalid: + $ref: '#/components/examples/ApiSecretInvalid' + ParameterBadFormat: + $ref: '#/components/examples/ParameterBadFormat' + DateRangeMissing: + $ref: '#/components/examples/DateRangeMissing' + DateRangeFromInvalidFormat: + $ref: '#/components/examples/DateRangeFromInvalidFormat' + DateRangeToInvalidFormat: + $ref: '#/components/examples/DateRangeToInvalidFormat' + DateRangeInvalid: + $ref: '#/components/examples/DateRangeInvalid' + QueryFormatInvalid: + $ref: '#/components/examples/QueryFormatInvalid' + QueryInvalid: + $ref: '#/components/examples/QueryInvalid' + CustomObjectNameInvalid: + $ref: '#/components/examples/CustomObjectNameInvalid' + CustomObjectNotAvailable: + $ref: '#/components/examples/CustomObjectNotAvailable' + '401': + description: Unauthorized - The request requires User authentication. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + AccessRestriction: + $ref: '#/components/examples/AccessRestriction' + '403': + description: Forbidden - The request was valid, but the server is refusing to respond to it + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + ApiKeyUnauthorized: + $ref: '#/components/examples/ApiKeyUnauthorized' + ApiSecretUnauthorized: + $ref: '#/components/examples/ApiSecretUnauthorized' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + /customobject: + get: + summary: Retrieve Custom Object data by pagination + description: Retrieves Custom Object data based on specified pagination parameters. + servers: + - url: https://cloud-api.loginradius.com + description: LoginRadius Cloud API Prod Server + tags: + - Custom Objects + operationId: getAllCustomObjectsByQuery + parameters: + - $ref: '#/components/parameters/CustomObject' + - $ref: '#/components/parameters/Region' + - $ref: '#/components/parameters/Next' + responses: + '200': + description: Status Ok - The request was successful. + content: + application/json: + schema: + $ref: '#/components/schemas/UserProfileNextResponse' + '400': + description: Bad Request - Invalid query parameters. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + ApiKeySecretMissing: + $ref: '#/components/examples/ApiKeySecretMissing' + ApiKeyMissing: + $ref: '#/components/examples/ApiKeyMissing' + ApiSecretMissing: + $ref: '#/components/examples/ApiSecretMissing' + ApiKeyInvalid: + $ref: '#/components/examples/ApiKeyInvalid' + ApiSecretInvalid: + $ref: '#/components/examples/ApiSecretInvalid' + CustomObjectNameMissing: + $ref: '#/components/examples/CustomObjectNameMissing' + CustomObjectNameInvalid: + $ref: '#/components/examples/CustomObjectNameInvalid' + CustomObjectSchemaNotSet: + $ref: '#/components/examples/CustomObjectSchemaNotSet' + NextParamInvalid: + $ref: '#/components/examples/NextParamInvalid' + NextParamNotValid: + $ref: '#/components/examples/NextParamNotValid' + QueryInvalid: + $ref: '#/components/examples/QueryInvalid' + '403': + description: Forbidden - The request was valid, but the server is refusing to respond to it. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + NextParamMissing: + $ref: '#/components/examples/NextParamMissing' + ApiKeyUnauthorized: + $ref: '#/components/examples/ApiKeyUnauthorized' + ApiSecretUnauthorized: + $ref: '#/components/examples/ApiSecretUnauthorized' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + post: + summary: Retrieve Custom Object data by query + description: Retrieves Custom Object data based on specified query filters. + servers: + - url: https://cloud-api.loginradius.com + description: LoginRadius Cloud API Prod Server + tags: + - Custom Objects + operationId: postAllCustomObjectsByQuery + parameters: + - $ref: '#/components/parameters/CustomObject' + - $ref: '#/components/parameters/Region' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/UserProfileRequestBody' + responses: + '200': + description: Status Ok - The request was successful. + content: + application/json: + schema: + $ref: '#/components/schemas/UserProfileScrollResponse' + '400': + description: Bad Request - Invalid query parameters. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + PostBodyInvalid: + $ref: '#/components/examples/PostBodyInvalid' + ApiKeySecretMissing: + $ref: '#/components/examples/ApiKeySecretMissing' + ApiKeyMissing: + $ref: '#/components/examples/ApiKeyMissing' + ApiSecretMissing: + $ref: '#/components/examples/ApiSecretMissing' + ApiKeyInvalid: + $ref: '#/components/examples/ApiKeyInvalid' + ApiSecretInvalid: + $ref: '#/components/examples/ApiSecretInvalid' + ParameterBadFormat: + $ref: '#/components/examples/ParameterBadFormat' + CustomObjectNameMissing: + $ref: '#/components/examples/CustomObjectNameMissing' + CustomObjectNameInvalid: + $ref: '#/components/examples/CustomObjectNameInvalid' + CustomObjectSchemaNotSet: + $ref: '#/components/examples/CustomObjectSchemaNotSet' + DateRangeMissing: + $ref: '#/components/examples/DateRangeMissing' + DateRangeFromInvalidFormat: + $ref: '#/components/examples/DateRangeFromInvalidFormat' + DateRangeToInvalidFormat: + $ref: '#/components/examples/DateRangeToInvalidFormat' + DateRangeInvalid: + $ref: '#/components/examples/DateRangeInvalid' + QueryFormatInvalid: + $ref: '#/components/examples/QueryFormatInvalid' + QueryInvalid: + $ref: '#/components/examples/QueryInvalid' + '401': + description: Unauthorized - The request requires User authentication. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + AccessRestriction: + $ref: '#/components/examples/AccessRestriction' + '403': + description: Forbidden - The request was valid, but the server is refusing to respond to it due to access restrictions. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + ApiKeyUnauthorized: + $ref: '#/components/examples/ApiKeyUnauthorized' + ApiSecretUnauthorized: + $ref: '#/components/examples/ApiSecretUnauthorized' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + /insights/userprofiles: + post: + summary: Retrieve User's data by filters + description: Retrieves users based on specified query parameters. + servers: + - url: https://cloud-api.loginradius.com + description: LoginRadius Cloud API Prod Server + parameters: + - $ref: '#/components/parameters/Region' + tags: + - Insights + operationId: queryUserProfilesInsights + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/requestPayload' + responses: + '200': + description: Successful response with User data. + content: + application/json: + schema: + $ref: '#/components/schemas/InsightsResponse' + '400': + description: Bad Request - The request was invalid or cannot be served. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + ApiKeySecretMissing: + $ref: '#/components/examples/ApiKeySecretMissing' + ApiKeyMissing: + $ref: '#/components/examples/ApiKeyMissing' + ApiSecretMissing: + $ref: '#/components/examples/ApiSecretMissing' + ApiKeyInvalid: + $ref: '#/components/examples/ApiKeyInvalid' + ApiSecretInvalid: + $ref: '#/components/examples/ApiSecretInvalid' + QueryInvalid: + $ref: '#/components/examples/QueryInvalid' + PostBodyInvalid: + $ref: '#/components/examples/PostBodyInvalid' + '401': + description: Unauthorized - The request requires User authentication. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + AccessRestriction: + $ref: '#/components/examples/AccessRestriction' + '403': + description: Forbidden - The request was valid, but the server is refusing to respond to it. + content: + application/json: + schema: + $ref: '#/components/schemas/ApiError' + examples: + ApiKeyUnauthorized: + $ref: '#/components/examples/ApiKeyUnauthorized' + ApiSecretUnauthorized: + $ref: '#/components/examples/ApiSecretUnauthorized' + security: + - APIKey: [] + APISecret: [] + - XLoginRadiusAPIKey: [] + XLoginRadiusAPISecret: [] + /api/jwt/{JwtAppName}/login: + post: + operationId: GetJWTTokenByLoginCredentials + summary: Retrieve JWT token + description: Retrieves a JWT token using login credentials such as Email, Phone, Username, and Password. + parameters: + - $ref: '#/components/parameters/JwtAppName' + - $ref: '#/components/parameters/Nonce' + requestBody: + $ref: '#/components/requestBodies/JWTLoginRequest' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/JWTSignature' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + examples: + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST_SSO' + EMAIL_PAYLOAD_REQUIRED: + $ref: '#/components/examples/EMAIL_PAYLOAD_REQUIRED' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID_SSO' + INVALID_HOST: + $ref: '#/components/examples/INVALID_HOST' + INVALID_PHONE_NUMBER: + $ref: '#/components/examples/INVALID_PHONE_NUMBER_SSO' + INVALID_POST_BODY: + $ref: '#/components/examples/INVALID_POST_BODY' + JWT_APP_NAME_REQUIRED: + $ref: '#/components/examples/JWT_APP_NAME_REQUIRED' + JWT_APP_NOT_MATCHED: + $ref: '#/components/examples/JWT_APP_NOT_MATCHED' + PASSWORD_EMAIL_PAYLOAD_REQUIRED: + $ref: '#/components/examples/PASSWORD_EMAIL_PAYLOAD_REQUIRED' + PASSWORD_PAYLOAD_REQUIRED: + $ref: '#/components/examples/PASSWORD_PAYLOAD_REQUIRED' + PASSWORD_PHONE_PAYLOAD_REQUIRED: + $ref: '#/components/examples/PASSWORD_PHONE_PAYLOAD_REQUIRED' + PASSWORD_USERNAME_PAYLOAD_REQUIRED: + $ref: '#/components/examples/PASSWORD_USERNAME_PAYLOAD_REQUIRED' + PHONE_OR_EMAIL_OR_USER_REQUIRED_PARAM: + $ref: '#/components/examples/PHONE_OR_EMAIL_OR_USER_REQUIRED_PARAM_SSO' + PHONE_PAYLOAD_REQUIRED: + $ref: '#/components/examples/PHONE_PAYLOAD_REQUIRED_SSO' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID_SSO' + USERNAME_PAYLOAD_REQUIRED: + $ref: '#/components/examples/USERNAME_PAYLOAD_REQUIRED' + schema: + $ref: '#/components/schemas/ErrorResponse' + '401': + description: 'Status Unauthorized: The client must authenticate itself to get the requested response.' + content: + application/json: + examples: + JWT_CONFIG_NOT_FOUND: + $ref: '#/components/examples/JWT_CONFIG_NOT_FOUND_SSO' + JWT_CONFIG_NOT_VALID: + $ref: '#/components/examples/JWT_CONFIG_NOT_VALID' + USERNAME_OR_PASSWORD_WRONG: + $ref: '#/components/examples/USERNAME_OR_PASSWORD_WRONG_SSO' + USERNAME_OR_PASSWORD_WRONG_FOR_BLOCK_LOCKOUT: + $ref: '#/components/examples/USERNAME_OR_PASSWORD_WRONG_FOR_BLOCK_LOCKOUT' + USERNAME_OR_PASSWORD_WRONG_FOR_SUSPEND_LOCKOUT: + $ref: '#/components/examples/USERNAME_OR_PASSWORD_WRONG_FOR_SUSPEND_LOCKOUT' + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR_SSO' + schema: + $ref: '#/components/schemas/ErrorResponse' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + examples: + ACCOUNT_NOT_ALLOWED_TO_LOGIN: + $ref: '#/components/examples/ACCOUNT_NOT_ALLOWED_TO_LOGIN_SSO' + ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/ACTIVE_SESSIONS_EXCEEDED_SSO' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID_SSO' + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT_SSO' + APP_NOT_EXISTS: + $ref: '#/components/examples/APP_NOT_EXISTS' + BREACHED_PASSWORD_LOGIN: + $ref: '#/components/examples/BREACHED_PASSWORD_LOGIN_SSO' + CAPTCHA_NOT_VALID: + $ref: '#/components/examples/CAPTCHA_NOT_VALID_SSO' + CHANGE_BREACHED_PASSWORD: + $ref: '#/components/examples/CHANGE_BREACHED_PASSWORD' + CONSENT_FORM_NOT_SUBMITTED: + $ref: '#/components/examples/CONSENT_FORM_NOT_SUBMITTED_SSO' + CONSENT_FORM_VALIDATION_FAILED: + $ref: '#/components/examples/CONSENT_FORM_VALIDATION_FAILED' + EMAIL_NOT_VERIFIED: + $ref: '#/components/examples/EMAIL_NOT_VERIFIED_SSO' + EMAIL_SEND_LIMIT_REACHED: + $ref: '#/components/examples/EMAIL_SEND_LIMIT_REACHED' + EMAIl_OR_PHONE_NUMBER_REQUIRED_VERIFIED: + $ref: '#/components/examples/EMAIl_OR_PHONE_NUMBER_REQUIRED_VERIFIED' + LOGIN_DISABLED: + $ref: '#/components/examples/LOGIN_DISABLED_SSO' + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_RECAPTCHA_SSO' + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION_SSO' + LOGIN_WITH_PASSWORD_NOT_ENABLED: + $ref: '#/components/examples/LOGIN_WITH_PASSWORD_NOT_ENABLED_SSO' + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_SSO' + OTP_SEND_FAILED: + $ref: '#/components/examples/OTP_SEND_FAILED_SSO' + PHONE_NO_LOGIN_NOT_ENABLED: + $ref: '#/components/examples/PHONE_NO_LOGIN_NOT_ENABLED_SSO' + PHONE_NOT_VERIFIED: + $ref: '#/components/examples/PHONE_NOT_VERIFIED_SSO' + PIN_IS_REQUIRED: + $ref: '#/components/examples/PIN_IS_REQUIRED_SSO' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED_SSO' + RBA_ACCOUNT_IS_BLOCKED: + $ref: '#/components/examples/RBA_ACCOUNT_IS_BLOCKED' + RBA_EMAIL_VERIFICATION: + $ref: '#/components/examples/RBA_EMAIL_VERIFICATION' + RBA_SECURITY_ANSWER_VERIFICATION: + $ref: '#/components/examples/RBA_SECURITY_ANSWER_VERIFICATION' + RBA_SMS_VERIFICATION: + $ref: '#/components/examples/RBA_SMS_VERIFICATION' + SMS_CONFIGURATION_NOT_EXISTS: + $ref: '#/components/examples/SMS_CONFIGURATION_NOT_EXISTS_SSO' + SMS_SEND_LIMIT_REACHED: + $ref: '#/components/examples/SMS_SEND_LIMIT_REACHED_SSO' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED_SSO' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED_SSO' + USER_ID_LOCKED_SSO: + $ref: '#/components/examples/USER_ID_LOCKED_SSO' + USER_ID_LOCKED_WITH_TIMEOUT_SSO: + $ref: '#/components/examples/USER_ID_LOCKED_WITH_TIMEOUT_SSO' + USER_NAME_AUTHENTICATION_ENABLED_SSO: + $ref: '#/components/examples/USER_NAME_AUTHENTICATION_ENABLED_SSO' + USER_NOT_EXISTS_SSO: + $ref: '#/components/examples/USER_NOT_EXISTS_SSO' + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - APIKey: [] + - XLoginRadiusAPIKey: [] + tags: + - JWT + x-order: 2 + servers: + - description: LoginRadius Prod Tenant Endpoint + url: https://{TenantName}.hub.loginradius.com + variables: + TenantName: + default: TenantName + description: Tenant Name + - description: LoginRadius Prod Custom Domain Endpoint + url: https://{CustomDomain} + variables: + CustomDomain: + default: auth.example.com + description: Tenant Custom Domain Name + /api/jwt/{JwtAppName}/token: + get: + operationId: GetJWTTokenByAccessToken + summary: Retrieve JWT token by Access Token + description: Retrieves a JWT token using an Access Token obtained after successful login. + parameters: + - $ref: '#/components/parameters/JwtAppName' + - $ref: '#/components/parameters/Nonce' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/JWTSignature' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + examples: + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST_SSO' + EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/EMAILID_ID_FORMAT_NOT_VALID_SSO' + INVALID_HOST: + $ref: '#/components/examples/INVALID_HOST' + INVALID_PROVIDER_IN_ORGANIZATION_SSO: + $ref: '#/components/examples/INVALID_PROVIDER_IN_ORGANIZATION_SSO' + JWT_ACCESS_TOKEN_REQUIRED_SSO: + $ref: '#/components/examples/JWT_ACCESS_TOKEN_REQUIRED' + JWT_APP_NAME_REQUIRED: + $ref: '#/components/examples/JWT_APP_NAME_REQUIRED' + JWT_APP_NOT_MATCHED: + $ref: '#/components/examples/JWT_APP_NOT_MATCHED' + OAUTH_TOKEN_CONFIG_NOT_FOUND_SSO: + $ref: '#/components/examples/OAUTH_TOKEN_CONFIG_NOT_FOUND_SSO' + ORGANIZATION_NOT_FOUND_SSO: + $ref: '#/components/examples/ORGANIZATION_NOT_FOUND_SSO' + SOCIAL_REGISTRATION_NOT_ALLOWED: + $ref: '#/components/examples/SOCIAL_REGISTRATION_NOT_ALLOWED' + USER_ID_LOCKED_WITH_TIMEOUT_SSO: + $ref: '#/components/examples/USER_ID_LOCKED_WITH_TIMEOUT_SSO' + schema: + $ref: '#/components/schemas/ErrorResponse' + '401': + description: 'Status Unauthorized: The client must authenticate itself to get the requested response.' + content: + application/json: + examples: + JWT_CONFIG_NOT_FOUND: + $ref: '#/components/examples/JWT_CONFIG_NOT_FOUND_SSO' + JWT_CONFIG_NOT_VALID: + $ref: '#/components/examples/JWT_CONFIG_NOT_VALID' + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR_SSO' + schema: + $ref: '#/components/schemas/ErrorResponse' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + examples: + ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/ACCESS_TOKEN_EXPIRED_SSO' + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID_SSO' + ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/ACTIVE_SESSIONS_EXCEEDED_SSO' + AGE_UNDERAGE_SSO: + $ref: '#/components/examples/AGE_UNDERAGE_SSO' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID_SSO' + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT_SSO' + APP_NOT_EXISTS: + $ref: '#/components/examples/APP_NOT_EXISTS' + AUTOLOOKUP_DOMAIN_NOT_MATCH: + $ref: '#/components/examples/AUTOLOOKUP_DOMAIN_NOT_MATCH' + CONSENT_FORM_NOT_SUBMITTED: + $ref: '#/components/examples/CONSENT_FORM_NOT_SUBMITTED_SSO' + CONSENT_FORM_VALIDATION_FAILED: + $ref: '#/components/examples/CONSENT_FORM_VALIDATION_FAILED' + EMAIL_DOMAIN_NOT_ALLOWED_IN_ORGANIZATION_SSO: + $ref: '#/components/examples/EMAIL_DOMAIN_NOT_ALLOWED_IN_ORGANIZATION_SSO' + EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER_SSO: + $ref: '#/components/examples/EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER_SSO' + EMAIL_NOT_VERIFIED: + $ref: '#/components/examples/EMAIL_NOT_VERIFIED_SSO' + EMAILID_ALREADY_REGISTERED_SSO: + $ref: '#/components/examples/EMAILID_ALREADY_REGISTERED_SSO' + JWT_SP_TOKEN_INVALID: + $ref: '#/components/examples/JWT_SP_TOKEN_INVALID_SSO' + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_SSO' + ORGANIZATION_NOT_ACTIVE: + $ref: '#/components/examples/ORGANIZATION_NOT_ACTIVE_SSO' + PHONE_NO_ALREADY_REGISTERED: + $ref: '#/components/examples/PHONE_NO_ALREADY_REGISTERED_SSO' + PIN_IS_REQUIRED: + $ref: '#/components/examples/PIN_IS_REQUIRED_SSO' + PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/PRIVACY_POLICY_MISMATCHED_SSO' + PROVIDER_ID_MISSING: + $ref: '#/components/examples/PROVIDER_ID_MISSING_SSO' + PROVIDER_NOT_CONFIGURED: + $ref: '#/components/examples/PROVIDER_NOT_CONFIGURED_SSO' + PROVIDER_NOT_SUPPORTED: + $ref: '#/components/examples/PROVIDER_NOT_SUPPORTED_SSO' + PROVIDER_NOT_VALID: + $ref: '#/components/examples/PROVIDER_NOT_VALID_SSO' + PROVIDER_SIDE_ERROR: + $ref: '#/components/examples/PROVIDER_SIDE_ERROR_SSO' + ROLE_DOES_NOT_EXISTS_SSO: + $ref: '#/components/examples/ROLE_DOES_NOT_EXISTS_SSO' + SIGNUP_NOT_ALLOWED_IN_ORG: + $ref: '#/components/examples/SIGNUP_NOT_ALLOWED_IN_ORG' + SOMETHING_GOING_WRONG_SSO: + $ref: '#/components/examples/SOMETHING_GOING_WRONG_SSO' + THIS_EMAIL_ID_IS_NOT_ALLOWED_TO_REGISTER_SSO: + $ref: '#/components/examples/THIS_EMAIL_ID_IS_NOT_ALLOWED_TO_REGISTER_SSO' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED_SSO' + TRIAL_PLAN_USER_LIMIT_REACHED_SSO: + $ref: '#/components/examples/TRIAL_PLAN_USER_LIMIT_REACHED_SSO' + UNVERIFIED_EXISTING_ACCOUNT_WITH_SAME_EMAIL_ID_SSO: + $ref: '#/components/examples/UNVERIFIED_EXISTING_ACCOUNT_WITH_SAME_EMAIL_ID_SSO' + UNVERIFIED_EXISTING_ACCOUNT_WITH_SAME_EMAIL_ID_SSO_IN_EMAIL_VERIFCATION_DISABLED: + $ref: '#/components/examples/UNVERIFIED_EXISTING_ACCOUNT_WITH_SAME_EMAIL_ID_IN_EMAIL_VERIFCATION_DISABLED_SSO' + UNVERIFIED_EXISTING_ACCOUNT_WITH_SAME_PHONE_ID: + $ref: '#/components/examples/UNVERIFIED_EXISTING_ACCOUNT_WITH_SAME_PHONE_ID' + USER_ID_BLOCKED: + $ref: '#/components/examples/USER_ID_BLOCKED_SSO' + USER_NOT_EXISTS_SSO: + $ref: '#/components/examples/USER_NOT_EXISTS_SSO' + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - APIKey: [] + AccessToken: [] + - XLoginRadiusAPIKey: [] + BearerToken: [] + tags: + - JWT + x-order: 1 + servers: + - description: LoginRadius Prod Tenant Endpoint + url: https://{TenantName}.hub.loginradius.com + variables: + TenantName: + default: TenantName + description: Tenant Name + - description: LoginRadius Prod Custom Domain Endpoint + url: https://{CustomDomain} + variables: + CustomDomain: + default: auth.example.com + description: Tenant Custom Domain Name + /api/oauth/{OAuthAppName}/device: + post: + operationId: GetOAuthDeviceCode + summary: Retrieve OAuth device code + description: Initiates the OAuth 2.0 Device Authorization Grant per RFC 8628. Returns a device_code and user_code that the client displays to the end-user for out-of-band authorization on a secondary device. The client then polls the token endpoint with the device_code until the user completes authorization. + parameters: + - $ref: '#/components/parameters/OAuthAppName' + requestBody: + $ref: '#/components/requestBodies/OAuthDeviceCodeRequest' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthDeviceCodeResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + examples: + CLIENT_ID_REQUIRED: + $ref: '#/components/examples/CLIENT_ID_REQUIRED' + CONTENT_TYPE_NOT_SUPPORTED: + $ref: '#/components/examples/CONTENT_TYPE_NOT_SUPPORTED' + OAUTH_APP_RESTRICTED: + $ref: '#/components/examples/OAUTH_APP_RESTRICTED' + OAUTH_DANGEROUS_REQUEST: + $ref: '#/components/examples/OAUTH_DANGEROUS_REQUEST' + OAUTH_HOST_NOT_WHITELISTED: + $ref: '#/components/examples/OAUTH_HOST_NOT_WHITELISTED' + OAUTH_POST_BODY_INVALID: + $ref: '#/components/examples/OAUTH_POST_BODY_INVALID' + OAUTH_TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/OAUTH_TRIAL_PLAN_EXPIRED' + SCOPE_INVALID: + $ref: '#/components/examples/SCOPE_INVALID' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '401': + description: 'Status Unauthorized: The client must authenticate itself to get the requested response.' + content: + application/json: + examples: + CLIENT_ID_INVALID: + $ref: '#/components/examples/CLIENT_ID_INVALID' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + examples: + OAUTH_CONF_NOT_EXIST: + $ref: '#/components/examples/OAUTH_CONF_NOT_EXIST' + TOKEN_CONF_INVALID: + $ref: '#/components/examples/TOKEN_CONF_INVALID' + TOKEN_CONF_NOT_EXIST: + $ref: '#/components/examples/TOKEN_CONF_NOT_EXIST' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + tags: + - OAuth + x-order: 1 + servers: + - description: LoginRadius Prod Tenant Endpoint + url: https://{TenantName}.hub.loginradius.com + variables: + TenantName: + default: TenantName + description: Tenant Name + - description: LoginRadius Prod Custom Domain Endpoint + url: https://{CustomDomain} + variables: + CustomDomain: + default: auth.example.com + description: Tenant Custom Domain Name + /api/oauth/{OAuthAppName}/introspect: + post: + operationId: IntrospectOAuthToken + summary: Introspect OAuth token + description: 'Returns the active state and metadata of an OAuth access or refresh token per RFC 7662 (OAuth 2.0 Token Introspection). The client must authenticate using either HTTP Basic authentication (Authorization: Basic base64(client_id:client_secret)) or by including client_id and client_secret in the POST body, depending on the token_endpoint_auth_method configured for the OAuth application. Returns active: true with associated claims for valid tokens, or active: false for invalid, expired, or revoked tokens.' + parameters: + - $ref: '#/components/parameters/OAuthAppName' + requestBody: + $ref: '#/components/requestBodies/OAuthRevokeRefreshTokenRequest' + responses: + '200': + description: 'OK: Introspection result (active true with claims, or active false).' + content: + application/json: + schema: + $ref: '#/components/schemas/OIDCTokenIntrospectResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + examples: + CLIENT_ID_REQUIRED: + $ref: '#/components/examples/CLIENT_ID_REQUIRED' + CLIENT_SECRET_BASIC_REQUIRED: + $ref: '#/components/examples/CLIENT_SECRET_BASIC_REQUIRED' + CLIENT_SECRET_POST_REQUIRED: + $ref: '#/components/examples/CLIENT_SECRET_POST_REQUIRED' + CLIENT_SECRET_REQUIRED: + $ref: '#/components/examples/CLIENT_SECRET_REQUIRED' + CONTENT_TYPE_NOT_SUPPORTED: + $ref: '#/components/examples/CONTENT_TYPE_NOT_SUPPORTED' + OAUTH_APP_RESTRICTED: + $ref: '#/components/examples/OAUTH_APP_RESTRICTED' + OAUTH_DANGEROUS_REQUEST: + $ref: '#/components/examples/OAUTH_DANGEROUS_REQUEST' + OAUTH_HOST_NOT_WHITELISTED: + $ref: '#/components/examples/OAUTH_HOST_NOT_WHITELISTED' + OAUTH_POST_BODY_INVALID: + $ref: '#/components/examples/OAUTH_POST_BODY_INVALID' + OAUTH_TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/OAUTH_TRIAL_PLAN_EXPIRED' + TOKEN_REQUIRED: + $ref: '#/components/examples/TOKEN_REQUIRED_SSO' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '401': + description: 'Status Unauthorized: The client must authenticate itself to get the requested response.' + content: + application/json: + examples: + CLIENT_ID_INVALID: + $ref: '#/components/examples/CLIENT_ID_INVALID' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + examples: + CLIENT_SECRET_INVALID: + $ref: '#/components/examples/CLIENT_SECRET_INVALID' + OAUTH_CONF_NOT_EXIST: + $ref: '#/components/examples/OAUTH_CONF_NOT_EXIST' + TOKEN_CONF_INVALID: + $ref: '#/components/examples/TOKEN_CONF_INVALID' + TOKEN_CONF_NOT_EXIST: + $ref: '#/components/examples/TOKEN_CONF_NOT_EXIST' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + tags: + - OAuth + x-order: 4 + servers: + - description: LoginRadius Prod Tenant Endpoint + url: https://{TenantName}.hub.loginradius.com + variables: + TenantName: + default: TenantName + description: Tenant Name + - description: LoginRadius Prod Custom Domain Endpoint + url: https://{CustomDomain} + variables: + CustomDomain: + default: auth.example.com + description: Tenant Custom Domain Name + /api/oauth/{OAuthAppName}/revoke: + post: + operationId: RevokeOAuthRefreshToken + summary: Revoke OAuth refresh token + description: Revokes an OAuth refresh token per RFC 7009 (OAuth 2.0 Token Revocation), invalidating it and preventing any further use. The client must authenticate using client_id and client_secret via HTTP Basic or POST body. + parameters: + - $ref: '#/components/parameters/OAuthAppName' + requestBody: + $ref: '#/components/requestBodies/OAuthRevokeRefreshTokenRequest' + responses: + '200': + description: 'OK: The request was successful.' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + examples: + CLIENT_ID_REQUIRED: + $ref: '#/components/examples/CLIENT_ID_REQUIRED' + CLIENT_SECRET_BASIC_REQUIRED: + $ref: '#/components/examples/CLIENT_SECRET_BASIC_REQUIRED' + CLIENT_SECRET_POST_REQUIRED: + $ref: '#/components/examples/CLIENT_SECRET_POST_REQUIRED' + CLIENT_SECRET_REQUIRED: + $ref: '#/components/examples/CLIENT_SECRET_REQUIRED' + CONTENT_TYPE_NOT_SUPPORTED: + $ref: '#/components/examples/CONTENT_TYPE_NOT_SUPPORTED' + OAUTH_APP_RESTRICTED: + $ref: '#/components/examples/OAUTH_APP_RESTRICTED' + OAUTH_DANGEROUS_REQUEST: + $ref: '#/components/examples/OAUTH_DANGEROUS_REQUEST' + OAUTH_HOST_NOT_WHITELISTED: + $ref: '#/components/examples/OAUTH_HOST_NOT_WHITELISTED' + OAUTH_POST_BODY_INVALID: + $ref: '#/components/examples/OAUTH_POST_BODY_INVALID' + OAUTH_TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/OAUTH_TRIAL_PLAN_EXPIRED' + REFRESH_TOKEN_INVALID_SSO: + $ref: '#/components/examples/REFRESH_TOKEN_INVALID_SSO' + TOKEN_REQUIRED: + $ref: '#/components/examples/TOKEN_REQUIRED_SSO' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '401': + description: 'Status Unauthorized: The client must authenticate itself to get the requested response.' + content: + application/json: + examples: + CLIENT_ID_INVALID: + $ref: '#/components/examples/CLIENT_ID_INVALID' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + examples: + CLIENT_SECRET_INVALID: + $ref: '#/components/examples/CLIENT_SECRET_INVALID' + OAUTH_CONF_NOT_EXIST: + $ref: '#/components/examples/OAUTH_CONF_NOT_EXIST' + TOKEN_CONF_INVALID: + $ref: '#/components/examples/TOKEN_CONF_INVALID' + TOKEN_CONF_NOT_EXIST: + $ref: '#/components/examples/TOKEN_CONF_NOT_EXIST' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + tags: + - OAuth + x-order: 3 + servers: + - description: LoginRadius Prod Tenant Endpoint + url: https://{TenantName}.hub.loginradius.com + variables: + TenantName: + default: TenantName + description: Tenant Name + - description: LoginRadius Prod Custom Domain Endpoint + url: https://{CustomDomain} + variables: + CustomDomain: + default: auth.example.com + description: Tenant Custom Domain Name + /api/oauth/{OAuthAppName}/token: + post: + operationId: GetOAuthTokens + summary: Retrieve OAuth tokens + description: Retrieves OAuth tokens for authentication and authorization purposes. + parameters: + - $ref: '#/components/parameters/OAuthAppName' + requestBody: + $ref: '#/components/requestBodies/OAuthTokenRequest' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthTokenResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + examples: + ACCESS_TOKEN_INVALID: + $ref: '#/components/examples/ACCESS_TOKEN_INVALID_SSO' + ACCESS_TOKEN_INVALID_OR_EXPIRED_SSO: + $ref: '#/components/examples/ACCESS_TOKEN_INVALID_OR_EXPIRED_SSO' + CLIENT_ID_REQUIRED: + $ref: '#/components/examples/CLIENT_ID_REQUIRED' + CLIENT_SECRET_BASIC_REQUIRED: + $ref: '#/components/examples/CLIENT_SECRET_BASIC_REQUIRED' + CLIENT_SECRET_POST_REQUIRED: + $ref: '#/components/examples/CLIENT_SECRET_POST_REQUIRED' + CLIENT_SECRET_REQUIRED: + $ref: '#/components/examples/CLIENT_SECRET_REQUIRED' + CODE_EXPIRED: + $ref: '#/components/examples/CODE_EXPIRED' + CODE_INVALID: + $ref: '#/components/examples/CODE_INVALID' + CODE_INVALID_OR_EXPIRED: + $ref: '#/components/examples/CODE_INVALID_OR_EXPIRED' + CODE_IS_ALREADY_USED: + $ref: '#/components/examples/CODE_IS_ALREADY_USED' + CODE_REQUIRED: + $ref: '#/components/examples/CODE_REQUIRED' + CODE_VERIFIER_INVALID: + $ref: '#/components/examples/CODE_VERIFIER_INVALID' + CODE_VERIFIER_REQUIRED: + $ref: '#/components/examples/CODE_VERIFIER_REQUIRED' + CONTENT_TYPE_NOT_SUPPORTED: + $ref: '#/components/examples/CONTENT_TYPE_NOT_SUPPORTED' + DEVICE_AUTHORIZATION_PENDING: + $ref: '#/components/examples/DEVICE_AUTHORIZATION_PENDING' + DEVICE_CODE_INVALID: + $ref: '#/components/examples/DEVICE_CODE_INVALID' + DEVICE_CODE_REQUIRED: + $ref: '#/components/examples/DEVICE_CODE_REQUIRED' + DEVICE_SLOW_DOWN: + $ref: '#/components/examples/DEVICE_SLOW_DOWN' + GRANT_TYPE_INVALID: + $ref: '#/components/examples/GRANT_TYPE_INVALID' + GRANT_TYPE_REQUIRED: + $ref: '#/components/examples/GRANT_TYPE_REQUIRED' + OAUTH_ACCESS_DENIED: + $ref: '#/components/examples/OAUTH_ACCESS_DENIED' + OAUTH_ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/OAUTH_ACCESS_TOKEN_EXPIRED' + OAUTH_ACCOUNT_NOT_ALLOWED_TO_LOGIN: + $ref: '#/components/examples/OAUTH_ACCOUNT_NOT_ALLOWED_TO_LOGIN' + OAUTH_ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/OAUTH_ACTIVE_SESSIONS_EXCEEDED' + OAUTH_APP_NOT_EXISTS: + $ref: '#/components/examples/OAUTH_APP_NOT_EXISTS' + OAUTH_APP_RESTRICTED: + $ref: '#/components/examples/OAUTH_APP_RESTRICTED' + OAUTH_BREACHED_PASSWORD_LOGIN: + $ref: '#/components/examples/OAUTH_BREACHED_PASSWORD_LOGIN' + OAUTH_CAPTCHA_NOT_VALID: + $ref: '#/components/examples/OAUTH_CAPTCHA_NOT_VALID' + OAUTH_CHANGE_BREACHED_PASSWORD: + $ref: '#/components/examples/OAUTH_CHANGE_BREACHED_PASSWORD' + OAUTH_CONSENT_FORM_NOT_SUBMITTED: + $ref: '#/components/examples/OAUTH_CONSENT_FORM_NOT_SUBMITTED' + OAUTH_CONSENT_FORM_VALIDATION_FAILED: + $ref: '#/components/examples/OAUTH_CONSENT_FORM_VALIDATION_FAILED' + OAUTH_DANGEROUS_REQUEST: + $ref: '#/components/examples/OAUTH_DANGEROUS_REQUEST' + OAUTH_EMAIL_NOT_VERIFIED: + $ref: '#/components/examples/OAUTH_EMAIL_NOT_VERIFIED' + OAUTH_EMAIL_SEND_LIMIT_REACHED: + $ref: '#/components/examples/OAUTH_EMAIL_SEND_LIMIT_REACHED' + OAUTH_EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/OAUTH_EMAILID_ID_FORMAT_NOT_VALID' + OAUTH_EMAIl_OR_PHONE_NUMBER_REQUIRED_VERIFIED: + $ref: '#/components/examples/OAUTH_EMAIl_OR_PHONE_NUMBER_REQUIRED_VERIFIED' + OAUTH_HOST_NOT_WHITELISTED: + $ref: '#/components/examples/OAUTH_HOST_NOT_WHITELISTED' + OAUTH_INVALID_PHONE_NUMBER: + $ref: '#/components/examples/OAUTH_INVALID_PHONE_NUMBER' + OAUTH_LOGIN_DISABLED: + $ref: '#/components/examples/OAUTH_LOGIN_DISABLED' + OAUTH_LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/OAUTH_LOGIN_IS_LOCKED_FOR_RECAPTCHA' + OAUTH_LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/OAUTH_LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + OAUTH_LOGIN_WITH_PASSWORD_NOT_ENABLED: + $ref: '#/components/examples/OAUTH_LOGIN_WITH_PASSWORD_NOT_ENABLED' + OAUTH_OPERATION_FAILED: + $ref: '#/components/examples/OAUTH_OPERATION_FAILED' + OAUTH_OTP_SEND_FAILED: + $ref: '#/components/examples/OAUTH_OTP_SEND_FAILED' + OAUTH_PHONE_NO_LOGIN_NOT_ENABLED: + $ref: '#/components/examples/OAUTH_PHONE_NO_LOGIN_NOT_ENABLED' + OAUTH_PHONE_NOT_VERIFIED: + $ref: '#/components/examples/OAUTH_PHONE_NOT_VERIFIED' + OAUTH_PIN_IS_REQUIRED: + $ref: '#/components/examples/OAUTH_PIN_IS_REQUIRED' + OAUTH_POST_BODY_INVALID: + $ref: '#/components/examples/OAUTH_POST_BODY_INVALID' + OAUTH_PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/OAUTH_PRIVACY_POLICY_MISMATCHED' + OAUTH_RBA_ACCOUNT_IS_BLOCKED: + $ref: '#/components/examples/OAUTH_RBA_ACCOUNT_IS_BLOCKED' + OAUTH_RBA_EMAIL_VERIFICATION: + $ref: '#/components/examples/OAUTH_RBA_EMAIL_VERIFICATION' + OAUTH_RBA_SECURITY_ANSWER_VERIFICATION: + $ref: '#/components/examples/OAUTH_RBA_SECURITY_ANSWER_VERIFICATION' + OAUTH_RBA_SMS_VERIFICATION: + $ref: '#/components/examples/OAUTH_RBA_SMS_VERIFICATION' + OAUTH_REFRESH_TOKEN_ALREADY_USED: + $ref: '#/components/examples/OAUTH_REFRESH_TOKEN_ALREADY_USED' + OAUTH_REFRESH_TOKEN_EXPIRED: + $ref: '#/components/examples/OAUTH_REFRESH_TOKEN_EXPIRED' + OAUTH_REFRESH_TOKEN_FORMAT_INVALID: + $ref: '#/components/examples/OAUTH_REFRESH_TOKEN_FORMAT_INVALID' + OAUTH_REFRESH_TOKEN_FROM_DIFF_CLIENT: + $ref: '#/components/examples/OAUTH_REFRESH_TOKEN_FROM_DIFF_CLIENT' + OAUTH_REFRESH_TOKEN_INVALID_OR_REVOKED: + $ref: '#/components/examples/OAUTH_REFRESH_TOKEN_INVALID_OR_REVOKED' + OAUTH_REFRESH_TOKEN_MAX_ACTIVE_SESSION_EXCEED: + $ref: '#/components/examples/OAUTH_REFRESH_TOKEN_MAX_ACTIVE_SESSION_EXCEED' + OAUTH_REFRESH_TOKEN_REVOKED_ACCOUNT_SECURITY_CHANGE: + $ref: '#/components/examples/OAUTH_REFRESH_TOKEN_REVOKED_ACCOUNT_SECURITY_CHANGE' + OAUTH_REFRESH_TOKEN_SOMETHING_GOING_WRONG: + $ref: '#/components/examples/OAUTH_REFRESH_TOKEN_SOMETHING_GOING_WRONG' + OAUTH_REFRESH_TOKEN_USER_NOT_FOUND: + $ref: '#/components/examples/OAUTH_REFRESH_TOKEN_USER_NOT_FOUND' + OAUTH_SMS_CONFIGURATION_NOT_EXISTS: + $ref: '#/components/examples/OAUTH_SMS_CONFIGURATION_NOT_EXISTS' + OAUTH_SMS_SEND_LIMIT_REACHED: + $ref: '#/components/examples/OAUTH_SMS_SEND_LIMIT_REACHED' + OAUTH_TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/OAUTH_TRIAL_PLAN_EXPIRED' + OAUTH_USER_ID_BLOCKED: + $ref: '#/components/examples/OAUTH_USER_ID_BLOCKED' + OAUTH_USER_ID_LOCKED_SSO: + $ref: '#/components/examples/OAUTH_USER_ID_LOCKED' + OAUTH_USER_NAME_AUTHENTICATION_ENABLED_SSO: + $ref: '#/components/examples/OAUTH_USER_NAME_AUTHENTICATION_ENABLED' + OAUTH_USER_NOT_EXISTS_SSO: + $ref: '#/components/examples/OAUTH_USER_NOT_EXISTS' + OAUTH_USERNAME_OR_PASSWORD_WRONG: + $ref: '#/components/examples/OAUTH_USERNAME_OR_PASSWORD_WRONG' + OAUTH_USERNAME_OR_PASSWORD_WRONG_FOR_BLOCK_LOCKOUT: + $ref: '#/components/examples/OAUTH_USERNAME_OR_PASSWORD_WRONG_FOR_BLOCK_LOCKOUT' + OAUTH_USERNAME_OR_PASSWORD_WRONG_FOR_SUSPEND_LOCKOUT: + $ref: '#/components/examples/OAUTH_USERNAME_OR_PASSWORD_WRONG_FOR_SUSPEND_LOCKOUT' + PASSWORD_REQUIRED: + $ref: '#/components/examples/PASSWORD_REQUIRED_SSO' + REDIRECT_URI_INVALID: + $ref: '#/components/examples/REDIRECT_URI_INVALID' + REDIRECT_URI_REQUIRED: + $ref: '#/components/examples/REDIRECT_URI_REQUIRED' + REFRESH_TOKEN_INVALID_SSO: + $ref: '#/components/examples/REFRESH_TOKEN_INVALID_SSO' + REFRESH_TOKEN_REQUIRED_SSO: + $ref: '#/components/examples/REFRESH_TOKEN_REQUIRED_SSO' + RESPONSE_TYPE_INVALID: + $ref: '#/components/examples/RESPONSE_TYPE_INVALID' + SCOPE_INVALID: + $ref: '#/components/examples/SCOPE_INVALID' + TOKEN_REQUIRED: + $ref: '#/components/examples/TOKEN_REQUIRED_SSO' + USERNAME_REQUIRED_SSO: + $ref: '#/components/examples/USERNAME_REQUIRED_SSO' + RESOURCE_PERMISSION_NOT_FOUND: + $ref: '#/components/examples/RESOURCE_PERMISSION_NOT_FOUND' + USER_PERMISSION_NOT_FOUND: + $ref: '#/components/examples/USER_PERMISSION_NOT_FOUND' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '401': + description: 'Status Unauthorized: The client must authenticate itself to get the requested response.' + content: + application/json: + examples: + CLIENT_ID_INVALID: + $ref: '#/components/examples/CLIENT_ID_INVALID' + /DEVICE_ACCESS_TOKEN_EXPIRED_SSO: + $ref: '#/components/examples/DEVICE_ACCESS_TOKEN_EXPIRED' + OAUTH_REDIRECT_URI_MISMATCH: + $ref: '#/components/examples/OAUTH_REDIRECT_URI_MISMATCH' + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR_SSO' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + examples: + CLIENT_SECRET_INVALID: + $ref: '#/components/examples/CLIENT_SECRET_INVALID' + OAUTH_APP_RESTRICTED: + $ref: '#/components/examples/OAUTH_APP_RESTRICTED' + OAUTH_CONF_NOT_EXIST: + $ref: '#/components/examples/OAUTH_CONF_NOT_EXIST' + TOKEN_CONF_INVALID: + $ref: '#/components/examples/TOKEN_CONF_INVALID' + TOKEN_CONF_NOT_EXIST: + $ref: '#/components/examples/TOKEN_CONF_NOT_EXIST' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + tags: + - OAuth + x-order: 2 + servers: + - description: LoginRadius Prod Tenant Endpoint + url: https://{TenantName}.hub.loginradius.com + variables: + TenantName: + default: TenantName + description: Tenant Name + - description: LoginRadius Prod Custom Domain Endpoint + url: https://{CustomDomain} + variables: + CustomDomain: + default: auth.example.com + description: Tenant Custom Domain Name + /api/oauth/{OAuthAppName}/par: + post: + operationId: OAuthPushedAuthorizationRequest + summary: OAuth 2.0 Pushed Authorization Request (PAR) + description: Accepts an OAuth 2.0 authorization request and stores it server-side per RFC 9126 (OAuth 2.0 Pushed Authorization Requests). Returns a short-lived request_uri that the client passes as the sole parameter to the authorization endpoint, keeping all sensitive request parameters out of the browser URL. This feature must be explicitly enabled on the OAuth application configuration. + parameters: + - $ref: '#/components/parameters/OAuthAppName' + requestBody: + $ref: '#/components/requestBodies/OAuthPARRequest' + responses: + '201': + description: 'Created: PAR accepted. Use the returned request_uri as the sole parameter to the authorization endpoint within expires_in seconds.' + content: + application/json: + schema: + $ref: '#/components/schemas/PARResponse' + '400': + description: 'Status Bad Request: One or more request parameters are missing or invalid.' + content: + application/json: + examples: + CLIENT_ID_REQUIRED: + $ref: '#/components/examples/CLIENT_ID_REQUIRED' + CLIENT_SECRET_REQUIRED: + $ref: '#/components/examples/CLIENT_SECRET_REQUIRED' + REDIRECT_URI_REQUIRED: + $ref: '#/components/examples/REDIRECT_URI_REQUIRED' + REDIRECT_URI_NOT_VALID: + $ref: '#/components/examples/REDIRECT_URI_NOT_VALID' + RESPONSE_TYPE_INVALID: + $ref: '#/components/examples/RESPONSE_TYPE_INVALID' + SCOPE_INVALID: + $ref: '#/components/examples/SCOPE_INVALID' + CONTENT_TYPE_NOT_SUPPORTED: + $ref: '#/components/examples/CONTENT_TYPE_NOT_SUPPORTED' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '403': + description: 'Status Forbidden: The application or client is not permitted to use this endpoint.' + content: + application/json: + examples: + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT_SSO' + PAR_FEATURE_DISABLED: + $ref: '#/components/examples/PAR_FEATURE_DISABLED' + OAUTH_CONF_NOT_EXIST: + $ref: '#/components/examples/OAUTH_CONF_NOT_EXIST' + TOKEN_CONF_NOT_EXIST: + $ref: '#/components/examples/TOKEN_CONF_NOT_EXIST' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + tags: + - OAuth + x-order: 5 + servers: + - description: LoginRadius Prod Tenant Endpoint + url: https://{TenantName}.hub.loginradius.com + variables: + TenantName: + default: TenantName + description: Tenant Name + - description: LoginRadius Prod Custom Domain Endpoint + url: https://{CustomDomain} + variables: + CustomDomain: + default: auth.example.com + description: Tenant Custom Domain Name + /service/oauth/{OAuthAppName}/.well-known/oauth-authorization-server: + get: + operationId: GetOAuthAuthorizationServerMetadataOAuth + summary: OAuth Authorization Server Metadata (OAuth app) + description: | + Returns OAuth 2.0 Authorization Server Metadata (RFC 8414) for the given OAuth app. + Use this endpoint for OAuth 2.0 client discovery when using the OAuth flow path. + parameters: + - $ref: '#/components/parameters/OAuthAppName' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthAuthorizationServerMetadata' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + tags: + - OAuth + x-order: 1 + servers: + - description: LoginRadius Prod Tenant Endpoint + url: https://{TenantName}.hub.loginradius.com + variables: + TenantName: + default: TenantName + description: Tenant Name + - description: LoginRadius Prod Custom Domain Endpoint + url: https://{CustomDomain} + variables: + CustomDomain: + default: auth.example.com + description: Tenant Custom Domain Name + /api/oidc/{OIDCAppName}/device: + post: + operationId: GetOIDCDeviceCode + summary: Retrieve OIDC device code + description: Initiates the OAuth 2.0 Device Authorization Grant per RFC 8628. Returns a device_code and user_code that the client displays to the end-user for out-of-band authorization on a secondary device. The client then polls the token endpoint with the device_code until the user completes authorization. + parameters: + - $ref: '#/components/parameters/OIDCAppName' + requestBody: + $ref: '#/components/requestBodies/OIDCDeviceCodeRequest' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/OIDCDeviceCodeResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + examples: + CLIENT_ID_REQUIRED: + $ref: '#/components/examples/CLIENT_ID_REQUIRED' + CONTENT_TYPE_NOT_SUPPORTED: + $ref: '#/components/examples/CONTENT_TYPE_NOT_SUPPORTED' + OAUTH_APP_RESTRICTED: + $ref: '#/components/examples/OAUTH_APP_RESTRICTED' + OAUTH_DANGEROUS_REQUEST: + $ref: '#/components/examples/OAUTH_DANGEROUS_REQUEST' + OAUTH_HOST_NOT_WHITELISTED: + $ref: '#/components/examples/OAUTH_HOST_NOT_WHITELISTED' + OAUTH_POST_BODY_INVALID: + $ref: '#/components/examples/OAUTH_POST_BODY_INVALID' + OAUTH_TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/OAUTH_TRIAL_PLAN_EXPIRED' + SCOPE_INVALID: + $ref: '#/components/examples/SCOPE_INVALID' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '401': + description: 'Status Unauthorized: The client must authenticate itself to get the requested response.' + content: + application/json: + examples: + CLIENT_ID_INVALID: + $ref: '#/components/examples/CLIENT_ID_INVALID' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + examples: + OAUTH_CONF_NOT_EXIST: + $ref: '#/components/examples/OAUTH_CONF_NOT_EXIST' + TOKEN_CONF_INVALID: + $ref: '#/components/examples/TOKEN_CONF_INVALID' + TOKEN_CONF_NOT_EXIST: + $ref: '#/components/examples/TOKEN_CONF_NOT_EXIST' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + tags: + - OIDC + x-order: 5 + servers: + - description: LoginRadius Prod Tenant Endpoint + url: https://{TenantName}.hub.loginradius.com + variables: + TenantName: + default: TenantName + description: Tenant Name + - description: LoginRadius Prod Custom Domain Endpoint + url: https://{CustomDomain} + variables: + CustomDomain: + default: auth.example.com + description: Tenant Custom Domain Name + /api/oidc/{OIDCAppName}/introspect: + post: + operationId: IntrospectOIDCToken + summary: Introspect OIDC token + description: 'Returns the active state and metadata of an OIDC access or refresh token per RFC 7662 (OAuth 2.0 Token Introspection). The client must authenticate using either HTTP Basic authentication (Authorization: Basic base64(client_id:client_secret)) or by including client_id and client_secret in the POST body, depending on the token_endpoint_auth_method configured for the OIDC application. Returns active: true with associated claims for valid tokens, or active: false for invalid, expired, or revoked tokens.' + parameters: + - $ref: '#/components/parameters/OIDCAppName' + requestBody: + $ref: '#/components/requestBodies/OAuthRevokeRefreshTokenRequest' + responses: + '200': + description: 'OK: Introspection result (active true with claims, or active false).' + content: + application/json: + schema: + $ref: '#/components/schemas/OIDCTokenIntrospectResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + examples: + CLIENT_ID_REQUIRED: + $ref: '#/components/examples/CLIENT_ID_REQUIRED' + CLIENT_SECRET_BASIC_REQUIRED: + $ref: '#/components/examples/CLIENT_SECRET_BASIC_REQUIRED' + CLIENT_SECRET_POST_REQUIRED: + $ref: '#/components/examples/CLIENT_SECRET_POST_REQUIRED' + CLIENT_SECRET_REQUIRED: + $ref: '#/components/examples/CLIENT_SECRET_REQUIRED' + CONTENT_TYPE_NOT_SUPPORTED: + $ref: '#/components/examples/CONTENT_TYPE_NOT_SUPPORTED' + OAUTH_APP_RESTRICTED: + $ref: '#/components/examples/OAUTH_APP_RESTRICTED' + OAUTH_DANGEROUS_REQUEST: + $ref: '#/components/examples/OAUTH_DANGEROUS_REQUEST' + OAUTH_HOST_NOT_WHITELISTED: + $ref: '#/components/examples/OAUTH_HOST_NOT_WHITELISTED' + OAUTH_POST_BODY_INVALID: + $ref: '#/components/examples/OAUTH_POST_BODY_INVALID' + OAUTH_TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/OAUTH_TRIAL_PLAN_EXPIRED' + TOKEN_REQUIRED: + $ref: '#/components/examples/TOKEN_REQUIRED_SSO' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '401': + description: 'Status Unauthorized: The client must authenticate itself to get the requested response.' + content: + application/json: + examples: + CLIENT_ID_INVALID: + $ref: '#/components/examples/CLIENT_ID_INVALID' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + examples: + CLIENT_SECRET_INVALID: + $ref: '#/components/examples/CLIENT_SECRET_INVALID' + OAUTH_CONF_NOT_EXIST: + $ref: '#/components/examples/OAUTH_CONF_NOT_EXIST' + TOKEN_CONF_INVALID: + $ref: '#/components/examples/TOKEN_CONF_INVALID' + TOKEN_CONF_NOT_EXIST: + $ref: '#/components/examples/TOKEN_CONF_NOT_EXIST' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + tags: + - OIDC + x-order: 6 + servers: + - description: LoginRadius Prod Tenant Endpoint + url: https://{TenantName}.hub.loginradius.com + variables: + TenantName: + default: TenantName + description: Tenant Name + - description: LoginRadius Prod Custom Domain Endpoint + url: https://{CustomDomain} + variables: + CustomDomain: + default: auth.example.com + description: Tenant Custom Domain Name + /api/oidc/{OIDCAppName}/revoke: + post: + operationId: RevokeOIDCRefreshToken + summary: Revoke OIDC refresh token + description: Revokes an OIDC refresh token per RFC 7009 (OAuth 2.0 Token Revocation), invalidating it and preventing any further use. The client must authenticate using client_id and client_secret via HTTP Basic or POST body. + parameters: + - $ref: '#/components/parameters/OIDCAppName' + requestBody: + $ref: '#/components/requestBodies/OAuthRevokeRefreshTokenRequest' + responses: + '200': + description: 'OK: The request was successful.' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + examples: + CLIENT_ID_REQUIRED: + $ref: '#/components/examples/CLIENT_ID_REQUIRED' + CLIENT_SECRET_BASIC_REQUIRED: + $ref: '#/components/examples/CLIENT_SECRET_BASIC_REQUIRED' + CLIENT_SECRET_POST_REQUIRED: + $ref: '#/components/examples/CLIENT_SECRET_POST_REQUIRED' + CLIENT_SECRET_REQUIRED: + $ref: '#/components/examples/CLIENT_SECRET_REQUIRED' + CONTENT_TYPE_NOT_SUPPORTED: + $ref: '#/components/examples/CONTENT_TYPE_NOT_SUPPORTED' + OAUTH_APP_RESTRICTED: + $ref: '#/components/examples/OAUTH_APP_RESTRICTED' + OAUTH_DANGEROUS_REQUEST: + $ref: '#/components/examples/OAUTH_DANGEROUS_REQUEST' + OAUTH_HOST_NOT_WHITELISTED: + $ref: '#/components/examples/OAUTH_HOST_NOT_WHITELISTED' + OAUTH_POST_BODY_INVALID: + $ref: '#/components/examples/OAUTH_POST_BODY_INVALID' + OAUTH_TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/OAUTH_TRIAL_PLAN_EXPIRED' + REFRESH_TOKEN_INVALID_SSO: + $ref: '#/components/examples/REFRESH_TOKEN_INVALID_SSO' + TOKEN_REQUIRED: + $ref: '#/components/examples/TOKEN_REQUIRED_SSO' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '401': + description: 'Status Unauthorized: The client must authenticate itself to get the requested response.' + content: + application/json: + examples: + CLIENT_ID_INVALID: + $ref: '#/components/examples/CLIENT_ID_INVALID' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + examples: + CLIENT_SECRET_INVALID: + $ref: '#/components/examples/CLIENT_SECRET_INVALID' + OAUTH_CONF_NOT_EXIST: + $ref: '#/components/examples/OAUTH_CONF_NOT_EXIST' + TOKEN_CONF_INVALID: + $ref: '#/components/examples/TOKEN_CONF_INVALID' + TOKEN_CONF_NOT_EXIST: + $ref: '#/components/examples/TOKEN_CONF_NOT_EXIST' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + tags: + - OIDC + x-order: 7 + servers: + - description: LoginRadius Prod Tenant Endpoint + url: https://{TenantName}.hub.loginradius.com + variables: + TenantName: + default: TenantName + description: Tenant Name + - description: LoginRadius Prod Custom Domain Endpoint + url: https://{CustomDomain} + variables: + CustomDomain: + default: auth.example.com + description: Tenant Custom Domain Name + /api/oidc/{OIDCAppName}/token: + post: + operationId: GetOIDCTokens + summary: Retrieve OIDC tokens + description: Retrieves OpenID Connect (OIDC) tokens for User authentication. + parameters: + - $ref: '#/components/parameters/OIDCAppName' + requestBody: + $ref: '#/components/requestBodies/OIDCTokenRequest' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/OIDCTokenResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + examples: + ACCESS_TOKEN_INVALID: + $ref: '#/components/examples/ACCESS_TOKEN_INVALID_SSO' + ACCESS_TOKEN_INVALID_OR_EXPIRED_SSO: + $ref: '#/components/examples/ACCESS_TOKEN_INVALID_OR_EXPIRED_SSO' + CLIENT_ID_REQUIRED: + $ref: '#/components/examples/CLIENT_ID_REQUIRED' + CLIENT_SECRET_BASIC_REQUIRED: + $ref: '#/components/examples/CLIENT_SECRET_BASIC_REQUIRED' + CLIENT_SECRET_POST_REQUIRED: + $ref: '#/components/examples/CLIENT_SECRET_POST_REQUIRED' + CLIENT_SECRET_REQUIRED: + $ref: '#/components/examples/CLIENT_SECRET_REQUIRED' + CODE_EXPIRED: + $ref: '#/components/examples/CODE_EXPIRED' + CODE_INVALID: + $ref: '#/components/examples/CODE_INVALID' + CODE_INVALID_OR_EXPIRED: + $ref: '#/components/examples/CODE_INVALID_OR_EXPIRED' + CODE_IS_ALREADY_USED: + $ref: '#/components/examples/CODE_IS_ALREADY_USED' + CODE_REQUIRED: + $ref: '#/components/examples/CODE_REQUIRED' + CODE_VERIFIER_INVALID: + $ref: '#/components/examples/CODE_VERIFIER_INVALID' + CODE_VERIFIER_REQUIRED: + $ref: '#/components/examples/CODE_VERIFIER_REQUIRED' + CONTENT_TYPE_NOT_SUPPORTED: + $ref: '#/components/examples/CONTENT_TYPE_NOT_SUPPORTED' + DEVICE_AUTHORIZATION_PENDING: + $ref: '#/components/examples/DEVICE_AUTHORIZATION_PENDING' + DEVICE_CODE_INVALID: + $ref: '#/components/examples/DEVICE_CODE_INVALID' + DEVICE_CODE_REQUIRED: + $ref: '#/components/examples/DEVICE_CODE_REQUIRED' + DEVICE_SLOW_DOWN: + $ref: '#/components/examples/DEVICE_SLOW_DOWN' + GRANT_TYPE_INVALID: + $ref: '#/components/examples/GRANT_TYPE_INVALID' + GRANT_TYPE_REQUIRED: + $ref: '#/components/examples/GRANT_TYPE_REQUIRED' + OAUTH_ACCESS_DENIED: + $ref: '#/components/examples/OAUTH_ACCESS_DENIED' + OAUTH_ACCESS_TOKEN_EXPIRED: + $ref: '#/components/examples/OAUTH_ACCESS_TOKEN_EXPIRED' + OAUTH_ACCOUNT_NOT_ALLOWED_TO_LOGIN: + $ref: '#/components/examples/OAUTH_ACCOUNT_NOT_ALLOWED_TO_LOGIN' + OAUTH_ACTIVE_SESSIONS_EXCEEDED: + $ref: '#/components/examples/OAUTH_ACTIVE_SESSIONS_EXCEEDED' + OAUTH_APP_NOT_EXISTS: + $ref: '#/components/examples/OAUTH_APP_NOT_EXISTS' + OAUTH_APP_RESTRICTED: + $ref: '#/components/examples/OAUTH_APP_RESTRICTED' + OAUTH_BREACHED_PASSWORD_LOGIN: + $ref: '#/components/examples/OAUTH_BREACHED_PASSWORD_LOGIN' + OAUTH_CAPTCHA_NOT_VALID: + $ref: '#/components/examples/OAUTH_CAPTCHA_NOT_VALID' + OAUTH_CHANGE_BREACHED_PASSWORD: + $ref: '#/components/examples/OAUTH_CHANGE_BREACHED_PASSWORD' + OAUTH_CONSENT_FORM_NOT_SUBMITTED: + $ref: '#/components/examples/OAUTH_CONSENT_FORM_NOT_SUBMITTED' + OAUTH_CONSENT_FORM_VALIDATION_FAILED: + $ref: '#/components/examples/OAUTH_CONSENT_FORM_VALIDATION_FAILED' + OAUTH_DANGEROUS_REQUEST: + $ref: '#/components/examples/OAUTH_DANGEROUS_REQUEST' + OAUTH_EMAIL_NOT_VERIFIED: + $ref: '#/components/examples/OAUTH_EMAIL_NOT_VERIFIED' + OAUTH_EMAIL_SEND_LIMIT_REACHED: + $ref: '#/components/examples/OAUTH_EMAIL_SEND_LIMIT_REACHED' + OAUTH_EMAILID_ID_FORMAT_NOT_VALID: + $ref: '#/components/examples/OAUTH_EMAILID_ID_FORMAT_NOT_VALID' + OAUTH_EMAIl_OR_PHONE_NUMBER_REQUIRED_VERIFIED: + $ref: '#/components/examples/OAUTH_EMAIl_OR_PHONE_NUMBER_REQUIRED_VERIFIED' + OAUTH_HOST_NOT_WHITELISTED: + $ref: '#/components/examples/OAUTH_HOST_NOT_WHITELISTED' + OAUTH_INVALID_PHONE_NUMBER: + $ref: '#/components/examples/OAUTH_INVALID_PHONE_NUMBER' + OAUTH_LOGIN_DISABLED: + $ref: '#/components/examples/OAUTH_LOGIN_DISABLED' + OAUTH_LOGIN_IS_LOCKED_FOR_RECAPTCHA: + $ref: '#/components/examples/OAUTH_LOGIN_IS_LOCKED_FOR_RECAPTCHA' + OAUTH_LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + $ref: '#/components/examples/OAUTH_LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION' + OAUTH_LOGIN_WITH_PASSWORD_NOT_ENABLED: + $ref: '#/components/examples/OAUTH_LOGIN_WITH_PASSWORD_NOT_ENABLED' + OAUTH_OPERATION_FAILED: + $ref: '#/components/examples/OAUTH_OPERATION_FAILED' + OAUTH_OTP_SEND_FAILED: + $ref: '#/components/examples/OAUTH_OTP_SEND_FAILED' + OAUTH_PHONE_NO_LOGIN_NOT_ENABLED: + $ref: '#/components/examples/OAUTH_PHONE_NO_LOGIN_NOT_ENABLED' + OAUTH_PHONE_NOT_VERIFIED: + $ref: '#/components/examples/OAUTH_PHONE_NOT_VERIFIED' + OAUTH_PIN_IS_REQUIRED: + $ref: '#/components/examples/OAUTH_PIN_IS_REQUIRED' + OAUTH_POST_BODY_INVALID: + $ref: '#/components/examples/OAUTH_POST_BODY_INVALID' + OAUTH_PRIVACY_POLICY_MISMATCHED: + $ref: '#/components/examples/OAUTH_PRIVACY_POLICY_MISMATCHED' + OAUTH_RBA_ACCOUNT_IS_BLOCKED: + $ref: '#/components/examples/OAUTH_RBA_ACCOUNT_IS_BLOCKED' + OAUTH_RBA_EMAIL_VERIFICATION: + $ref: '#/components/examples/OAUTH_RBA_EMAIL_VERIFICATION' + OAUTH_RBA_SECURITY_ANSWER_VERIFICATION: + $ref: '#/components/examples/OAUTH_RBA_SECURITY_ANSWER_VERIFICATION' + OAUTH_RBA_SMS_VERIFICATION: + $ref: '#/components/examples/OAUTH_RBA_SMS_VERIFICATION' + OAUTH_REFRESH_TOKEN_ALREADY_USED: + $ref: '#/components/examples/OAUTH_REFRESH_TOKEN_ALREADY_USED' + OAUTH_REFRESH_TOKEN_EXPIRED: + $ref: '#/components/examples/OAUTH_REFRESH_TOKEN_EXPIRED' + OAUTH_REFRESH_TOKEN_FORMAT_INVALID: + $ref: '#/components/examples/OAUTH_REFRESH_TOKEN_FORMAT_INVALID' + OAUTH_REFRESH_TOKEN_FROM_DIFF_CLIENT: + $ref: '#/components/examples/OAUTH_REFRESH_TOKEN_FROM_DIFF_CLIENT' + OAUTH_REFRESH_TOKEN_INVALID_OR_REVOKED: + $ref: '#/components/examples/OAUTH_REFRESH_TOKEN_INVALID_OR_REVOKED' + OAUTH_REFRESH_TOKEN_MAX_ACTIVE_SESSION_EXCEED: + $ref: '#/components/examples/OAUTH_REFRESH_TOKEN_MAX_ACTIVE_SESSION_EXCEED' + OAUTH_REFRESH_TOKEN_REVOKED_ACCOUNT_SECURITY_CHANGE: + $ref: '#/components/examples/OAUTH_REFRESH_TOKEN_REVOKED_ACCOUNT_SECURITY_CHANGE' + OAUTH_REFRESH_TOKEN_SOMETHING_GOING_WRONG: + $ref: '#/components/examples/OAUTH_REFRESH_TOKEN_SOMETHING_GOING_WRONG' + OAUTH_REFRESH_TOKEN_USER_NOT_FOUND: + $ref: '#/components/examples/OAUTH_REFRESH_TOKEN_USER_NOT_FOUND' + OAUTH_SMS_CONFIGURATION_NOT_EXISTS: + $ref: '#/components/examples/OAUTH_SMS_CONFIGURATION_NOT_EXISTS' + OAUTH_SMS_SEND_LIMIT_REACHED: + $ref: '#/components/examples/OAUTH_SMS_SEND_LIMIT_REACHED' + OAUTH_TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/OAUTH_TRIAL_PLAN_EXPIRED' + OAUTH_USER_ID_BLOCKED: + $ref: '#/components/examples/OAUTH_USER_ID_BLOCKED' + OAUTH_USER_ID_LOCKED_SSO: + $ref: '#/components/examples/OAUTH_USER_ID_LOCKED' + OAUTH_USER_NAME_AUTHENTICATION_ENABLED_SSO: + $ref: '#/components/examples/OAUTH_USER_NAME_AUTHENTICATION_ENABLED' + OAUTH_USER_NOT_EXISTS_SSO: + $ref: '#/components/examples/OAUTH_USER_NOT_EXISTS' + OAUTH_USERNAME_OR_PASSWORD_WRONG: + $ref: '#/components/examples/OAUTH_USERNAME_OR_PASSWORD_WRONG' + OAUTH_USERNAME_OR_PASSWORD_WRONG_FOR_BLOCK_LOCKOUT: + $ref: '#/components/examples/OAUTH_USERNAME_OR_PASSWORD_WRONG_FOR_BLOCK_LOCKOUT' + OAUTH_USERNAME_OR_PASSWORD_WRONG_FOR_SUSPEND_LOCKOUT: + $ref: '#/components/examples/OAUTH_USERNAME_OR_PASSWORD_WRONG_FOR_SUSPEND_LOCKOUT' + PASSWORD_REQUIRED: + $ref: '#/components/examples/PASSWORD_REQUIRED_SSO' + REDIRECT_URI_INVALID: + $ref: '#/components/examples/REDIRECT_URI_INVALID' + REDIRECT_URI_REQUIRED: + $ref: '#/components/examples/REDIRECT_URI_REQUIRED' + REFRESH_TOKEN_INVALID_SSO: + $ref: '#/components/examples/REFRESH_TOKEN_INVALID_SSO' + REFRESH_TOKEN_REQUIRED_SSO: + $ref: '#/components/examples/REFRESH_TOKEN_REQUIRED_SSO' + RESPONSE_TYPE_INVALID: + $ref: '#/components/examples/RESPONSE_TYPE_INVALID' + SCOPE_INVALID: + $ref: '#/components/examples/SCOPE_INVALID' + TOKEN_REQUIRED: + $ref: '#/components/examples/TOKEN_REQUIRED_SSO' + USERNAME_REQUIRED_SSO: + $ref: '#/components/examples/USERNAME_REQUIRED_SSO' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '401': + description: 'Status Unauthorized: The client must authenticate itself to get the requested response.' + content: + application/json: + examples: + CLIENT_ID_INVALID: + $ref: '#/components/examples/CLIENT_ID_INVALID' + /DEVICE_ACCESS_TOKEN_EXPIRED_SSO: + $ref: '#/components/examples/DEVICE_ACCESS_TOKEN_EXPIRED' + OAUTH_REDIRECT_URI_MISMATCH: + $ref: '#/components/examples/OAUTH_REDIRECT_URI_MISMATCH' + GENERIC_AUTH_ERROR: + $ref: '#/components/examples/GENERIC_AUTH_ERROR_SSO' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + examples: + CLIENT_SECRET_INVALID: + $ref: '#/components/examples/CLIENT_SECRET_INVALID' + OAUTH_APP_RESTRICTED: + $ref: '#/components/examples/OAUTH_APP_RESTRICTED' + OAUTH_CONF_NOT_EXIST: + $ref: '#/components/examples/OAUTH_CONF_NOT_EXIST' + TOKEN_CONF_INVALID: + $ref: '#/components/examples/TOKEN_CONF_INVALID' + TOKEN_CONF_NOT_EXIST: + $ref: '#/components/examples/TOKEN_CONF_NOT_EXIST' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + tags: + - OIDC + x-order: 6 + servers: + - description: LoginRadius Prod Tenant Endpoint + url: https://{TenantName}.hub.loginradius.com + variables: + TenantName: + default: TenantName + description: Tenant Name + - description: LoginRadius Prod Custom Domain Endpoint + url: https://{CustomDomain} + variables: + CustomDomain: + default: auth.example.com + description: Tenant Custom Domain Name + /api/oidc/{OIDCAppName}/par: + post: + operationId: OIDCPushedAuthorizationRequest + summary: OIDC Pushed Authorization Request (PAR) + description: Accepts an OIDC authorization request and stores it server-side per RFC 9126 (OAuth 2.0 Pushed Authorization Requests). Returns a short-lived request_uri that the client passes as the sole parameter to the authorization endpoint, keeping all sensitive request parameters out of the browser URL. This feature must be explicitly enabled on the OIDC application configuration. + parameters: + - $ref: '#/components/parameters/OIDCAppName' + requestBody: + $ref: '#/components/requestBodies/OAuthPARRequest' + responses: + '201': + description: 'Created: PAR accepted. Use the returned request_uri as the sole parameter to the authorization endpoint within expires_in seconds.' + content: + application/json: + schema: + $ref: '#/components/schemas/PARResponse' + '400': + description: 'Status Bad Request: One or more request parameters are missing or invalid.' + content: + application/json: + examples: + CLIENT_ID_REQUIRED: + $ref: '#/components/examples/CLIENT_ID_REQUIRED' + CLIENT_SECRET_REQUIRED: + $ref: '#/components/examples/CLIENT_SECRET_REQUIRED' + REDIRECT_URI_REQUIRED: + $ref: '#/components/examples/REDIRECT_URI_REQUIRED' + REDIRECT_URI_NOT_VALID: + $ref: '#/components/examples/REDIRECT_URI_NOT_VALID' + RESPONSE_TYPE_INVALID: + $ref: '#/components/examples/RESPONSE_TYPE_INVALID' + SCOPE_INVALID: + $ref: '#/components/examples/SCOPE_INVALID' + CONTENT_TYPE_NOT_SUPPORTED: + $ref: '#/components/examples/CONTENT_TYPE_NOT_SUPPORTED' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '403': + description: 'Status Forbidden: The application or client is not permitted to use this endpoint.' + content: + application/json: + examples: + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT_SSO' + PAR_FEATURE_DISABLED: + $ref: '#/components/examples/PAR_FEATURE_DISABLED' + OAUTH_CONF_NOT_EXIST: + $ref: '#/components/examples/OAUTH_CONF_NOT_EXIST' + TOKEN_CONF_NOT_EXIST: + $ref: '#/components/examples/TOKEN_CONF_NOT_EXIST' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + tags: + - OIDC + x-order: 7 + servers: + - description: LoginRadius Prod Tenant Endpoint + url: https://{TenantName}.hub.loginradius.com + variables: + TenantName: + default: TenantName + description: Tenant Name + - description: LoginRadius Prod Custom Domain Endpoint + url: https://{CustomDomain} + variables: + CustomDomain: + default: auth.example.com + description: Tenant Custom Domain Name + /api/oidc/{OIDCAppName}/register: + post: + operationId: OIDCDynamicClientRegistration + summary: OIDC dynamic client registration + description: Registers a new OAuth 2.0/OIDC client dynamically per RFC 7591 (OAuth 2.0 Dynamic Client Registration Protocol). The client submits desired metadata (redirect_uris, client_name, grant_types, etc.) and receives the registered client metadata including the assigned client_id and client_secret. This feature must be explicitly enabled on the OIDC application configuration. + parameters: + - $ref: '#/components/parameters/OIDCAppName' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/DynamicClientRegistrationRequest' + responses: + '200': + description: 'OK: Returns the registered client metadata.' + content: + application/json: + schema: + $ref: '#/components/schemas/DynamicClientRegistrationResponse' + '400': + description: 'Status Bad Request: Invalid registration request.' + content: + application/json: + examples: + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST_SSO' + INVALID_HOST: + $ref: '#/components/examples/INVALID_HOST' + schema: + $ref: '#/components/schemas/ErrorResponse' + '403': + description: 'Status Forbidden: Dynamic client registration is not enabled.' + content: + application/json: + examples: + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT_SSO' + DCR_FEATURE_DISABLED: + $ref: '#/components/examples/DCR_FEATURE_DISABLED' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED_SSO' + schema: + $ref: '#/components/schemas/ErrorResponse' + tags: + - OIDC + servers: + - description: LoginRadius Prod Tenant Endpoint + url: https://{TenantName}.hub.loginradius.com + variables: + TenantName: + default: TenantName + description: Tenant Name + - description: LoginRadius Prod Custom Domain Endpoint + url: https://{CustomDomain} + variables: + CustomDomain: + default: auth.example.com + description: Tenant Custom Domain Name + /api/oidc/{OIDCAppName}/register/{clientID}: + get: + operationId: GetDynamicClient + summary: Get a Dynamic Client + description: Retrieves the metadata of a dynamically registered OAuth 2.0/OIDC client per RFC 7592 (OAuth 2.0 Dynamic Client Registration Management Protocol). Requires the registration_access_token issued at registration time. + parameters: + - $ref: '#/components/parameters/OIDCAppName' + - $ref: '#/components/parameters/OAuthDynamicClientId' + security: + - BearerToken: [] + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthDynamicClientResponse' + '400': + description: 'Status Bad Request: The registration_access_token is missing.' + content: + application/json: + examples: + DCR_REGISTRATION_TOKEN_REQUIRED: + $ref: '#/components/examples/DCR_REGISTRATION_TOKEN_REQUIRED' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '401': + description: 'Status Unauthorized: The registration_access_token is invalid or the client was not found.' + content: + application/json: + examples: + DCR_REGISTRATION_TOKEN_INVALID: + $ref: '#/components/examples/DCR_REGISTRATION_TOKEN_INVALID' + DCR_CLIENT_NOT_FOUND: + $ref: '#/components/examples/DCR_CLIENT_NOT_FOUND' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '403': + description: 'Status Forbidden: Dynamic client registration is not enabled on this authorization server.' + content: + application/json: + examples: + DCR_FEATURE_DISABLED: + $ref: '#/components/examples/DCR_FEATURE_DISABLED' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + tags: + - OIDC + x-order: 11 + put: + operationId: UpdateDynamicClient + summary: Update a Dynamic Client + description: Updates the metadata of a dynamically registered OAuth 2.0/OIDC client per RFC 7592. Requires the registration_access_token issued at registration time. + parameters: + - $ref: '#/components/parameters/OIDCAppName' + - $ref: '#/components/parameters/OAuthDynamicClientId' + security: + - BearerToken: [] + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthDynamicClientRequest' + responses: + '200': + description: 'OK: The client was successfully updated.' + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthDynamicClientResponse' + '400': + description: 'Status Bad Request: The client metadata is invalid or the registration_access_token is missing.' + content: + application/json: + examples: + DCR_REGISTRATION_TOKEN_REQUIRED: + $ref: '#/components/examples/DCR_REGISTRATION_TOKEN_REQUIRED' + DCR_CLIENT_NAME_REQUIRED: + $ref: '#/components/examples/DCR_CLIENT_NAME_REQUIRED' + DCR_REDIRECT_URI_REQUIRED: + $ref: '#/components/examples/DCR_REDIRECT_URI_REQUIRED' + DCR_REDIRECT_URI_EMPTY: + $ref: '#/components/examples/DCR_REDIRECT_URI_EMPTY' + DCR_REDIRECT_URI_INVALID: + $ref: '#/components/examples/DCR_REDIRECT_URI_INVALID' + DCR_POST_LOGOUT_REQUEST_URI_INVALID: + $ref: '#/components/examples/DCR_POST_LOGOUT_REQUEST_URI_INVALID' + DCR_BACK_CHANNEL_LOGOUT_URI_INVALID: + $ref: '#/components/examples/DCR_BACK_CHANNEL_LOGOUT_URI_INVALID' + DCR_REQUEST_URI_INVALID: + $ref: '#/components/examples/DCR_REQUEST_URI_INVALID' + DCR_GRANT_TYPE_NOT_SUPPORTED: + $ref: '#/components/examples/DCR_GRANT_TYPE_NOT_SUPPORTED' + ACCESS_DENIED_GRANT_TYPE_NOT_ALLOWED: + $ref: '#/components/examples/ACCESS_DENIED_GRANT_TYPE_NOT_ALLOWED' + DCR_RESPONSE_TYPE_REQUIRED: + $ref: '#/components/examples/DCR_RESPONSE_TYPE_REQUIRED' + DCR_RESPONSE_TYPE_INVALID: + $ref: '#/components/examples/DCR_RESPONSE_TYPE_INVALID' + DCR_RESPONSE_TYPE_ALLOWED_WITH_GRANT_TYPE: + $ref: '#/components/examples/DCR_RESPONSE_TYPE_ALLOWED_WITH_GRANT_TYPE' + DCR_TOKEN_AUTH_METHOD_NOT_SUPPORTED: + $ref: '#/components/examples/DCR_TOKEN_AUTH_METHOD_NOT_SUPPORTED' + DCR_LOGO_URL_INVALID: + $ref: '#/components/examples/DCR_LOGO_URL_INVALID' + DCR_TOS_URL_INVALID: + $ref: '#/components/examples/DCR_TOS_URL_INVALID' + DCR_POLICY_URL_INVALID: + $ref: '#/components/examples/DCR_POLICY_URL_INVALID' + DCR_CLIENT_URL_INVALID: + $ref: '#/components/examples/DCR_CLIENT_URL_INVALID' + DCR_JWKS_MUTUALLY_EXCLUSIVE: + $ref: '#/components/examples/DCR_JWKS_MUTUALLY_EXCLUSIVE' + DCR_JWKS_URI_INVALID: + $ref: '#/components/examples/DCR_JWKS_URI_INVALID' + DCR_JWKS_INVALID_JSON: + $ref: '#/components/examples/DCR_JWKS_INVALID_JSON' + DCR_JWKS_INVALID_STRUCTURE: + $ref: '#/components/examples/DCR_JWKS_INVALID_STRUCTURE' + DCR_JWKS_INVALID_KEY_PARAMS: + $ref: '#/components/examples/DCR_JWKS_INVALID_KEY_PARAMS' + DCR_JWKS_URI_FETCH_FAILED: + $ref: '#/components/examples/DCR_JWKS_URI_FETCH_FAILED' + DCR_ID_TOKEN_SIGNING_ALG_NOT_SUPPORTED: + $ref: '#/components/examples/DCR_ID_TOKEN_SIGNING_ALG_NOT_SUPPORTED' + DCR_USERINFO_SIGNING_ALG_NOT_SUPPORTED: + $ref: '#/components/examples/DCR_USERINFO_SIGNING_ALG_NOT_SUPPORTED' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '401': + description: 'Status Unauthorized: The registration_access_token is invalid or the client was not found.' + content: + application/json: + examples: + DCR_REGISTRATION_TOKEN_INVALID: + $ref: '#/components/examples/DCR_REGISTRATION_TOKEN_INVALID' + DCR_CLIENT_NOT_FOUND: + $ref: '#/components/examples/DCR_CLIENT_NOT_FOUND' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '403': + description: 'Status Forbidden: Dynamic client registration is not enabled on this authorization server.' + content: + application/json: + examples: + DCR_FEATURE_DISABLED: + $ref: '#/components/examples/DCR_FEATURE_DISABLED' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + tags: + - OIDC + x-order: 12 + delete: + operationId: DeleteDynamicClient + summary: Delete a Dynamic Client + description: Deletes a dynamically registered OAuth 2.0/OIDC client per RFC 7592. Requires the registration_access_token issued at registration time. Returns 204 No Content on success. + parameters: + - $ref: '#/components/parameters/OIDCAppName' + - $ref: '#/components/parameters/OAuthDynamicClientId' + security: + - BearerToken: [] + responses: + '204': + description: 'No Content: The client was successfully deleted.' + '400': + description: 'Status Bad Request: The registration_access_token is missing.' + content: + application/json: + examples: + DCR_REGISTRATION_TOKEN_REQUIRED: + $ref: '#/components/examples/DCR_REGISTRATION_TOKEN_REQUIRED' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '401': + description: 'Status Unauthorized: The registration_access_token is invalid or the client was not found.' + content: + application/json: + examples: + DCR_REGISTRATION_TOKEN_INVALID: + $ref: '#/components/examples/DCR_REGISTRATION_TOKEN_INVALID' + DCR_CLIENT_NOT_FOUND: + $ref: '#/components/examples/DCR_CLIENT_NOT_FOUND' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '403': + description: 'Status Forbidden: Dynamic client registration is not enabled on this authorization server.' + content: + application/json: + examples: + DCR_FEATURE_DISABLED: + $ref: '#/components/examples/DCR_FEATURE_DISABLED' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + tags: + - OIDC + x-order: 13 + servers: + - description: LoginRadius Prod Tenant Endpoint + url: https://{TenantName}.hub.loginradius.com + variables: + TenantName: + default: TenantName + description: Tenant Name + - description: LoginRadius Prod Custom Domain Endpoint + url: https://{CustomDomain} + variables: + CustomDomain: + default: auth.example.com + description: Tenant Custom Domain Name + /service/oauth/introspect: + post: + operationId: GetM2MTokenInfo + summary: Retrieve M2M token info + description: Retrieves information about a Machine-to-Machine (M2M) token. + requestBody: + $ref: '#/components/requestBodies/OAuthM2MTokenIntrospectRequest' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthM2MIntrospectResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + examples: + CLIENT_ID_REQUIRED: + $ref: '#/components/examples/CLIENT_ID_REQUIRED' + CLIENT_SECRET_BASIC_REQUIRED: + $ref: '#/components/examples/CLIENT_SECRET_BASIC_REQUIRED' + CLIENT_SECRET_POST_REQUIRED: + $ref: '#/components/examples/CLIENT_SECRET_POST_REQUIRED' + CLIENT_SECRET_REQUIRED: + $ref: '#/components/examples/CLIENT_SECRET_REQUIRED' + CONTENT_TYPE_NOT_SUPPORTED: + $ref: '#/components/examples/CONTENT_TYPE_NOT_SUPPORTED' + OAUTH_APP_RESTRICTED: + $ref: '#/components/examples/OAUTH_APP_RESTRICTED' + OAUTH_DANGEROUS_REQUEST: + $ref: '#/components/examples/OAUTH_DANGEROUS_REQUEST' + OAUTH_HOST_NOT_WHITELISTED: + $ref: '#/components/examples/OAUTH_HOST_NOT_WHITELISTED' + OAUTH_POST_BODY_INVALID: + $ref: '#/components/examples/OAUTH_POST_BODY_INVALID' + OAUTH_TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/OAUTH_TRIAL_PLAN_EXPIRED' + TOKEN_REQUIRED: + $ref: '#/components/examples/TOKEN_REQUIRED_SSO' + TOKEN_TYPE_HINT_INVALID: + $ref: '#/components/examples/TOKEN_TYPE_HINT_INVALID' + TOKEN_TYPE_HINT_REQUIRED: + $ref: '#/components/examples/TOKEN_TYPE_HINT_REQUIRED' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '401': + description: 'Status Unauthorized: The client must authenticate itself to get the requested response.' + content: + application/json: + examples: + CLIENT_ID_INVALID: + $ref: '#/components/examples/CLIENT_ID_INVALID' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + examples: + CLIENT_SECRET_INVALID: + $ref: '#/components/examples/CLIENT_SECRET_INVALID' + M2M_CONF_NOT_EXIST: + $ref: '#/components/examples/M2M_CONF_NOT_EXIST' + TOKEN_CONF_INVALID: + $ref: '#/components/examples/TOKEN_CONF_INVALID' + TOKEN_CONF_NOT_EXIST: + $ref: '#/components/examples/TOKEN_CONF_NOT_EXIST' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + tags: + - OAuth M2M + x-order: 3 + servers: + - description: LoginRadius Prod Tenant Endpoint + url: https://{TenantName}.hub.loginradius.com + variables: + TenantName: + default: TenantName + description: Tenant Name + - description: LoginRadius Prod Custom Domain Endpoint + url: https://{CustomDomain} + variables: + CustomDomain: + default: auth.example.com + description: Tenant Custom Domain Name + /service/oauth/jwks: + get: + operationId: GetM2MJWKSConfig + summary: Retrieve JSON Web Key Set + description: Retrieves the JSON Web Key Set (JWKS) for verifying token signatures. + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/JWKSResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + examples: + OAUTH_APP_RESTRICTED: + $ref: '#/components/examples/OAUTH_APP_RESTRICTED' + OAUTH_DANGEROUS_REQUEST: + $ref: '#/components/examples/OAUTH_DANGEROUS_REQUEST' + OAUTH_HOST_NOT_WHITELISTED: + $ref: '#/components/examples/OAUTH_HOST_NOT_WHITELISTED' + OAUTH_TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/OAUTH_TRIAL_PLAN_EXPIRED' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + examples: + TOKEN_CONF_INVALID: + $ref: '#/components/examples/TOKEN_CONF_INVALID' + TOKEN_CONF_NOT_EXIST: + $ref: '#/components/examples/TOKEN_CONF_NOT_EXIST' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + tags: + - OAuth M2M + x-order: 1 + servers: + - description: LoginRadius Prod Tenant Endpoint + url: https://{TenantName}.hub.loginradius.com + variables: + TenantName: + default: TenantName + description: Tenant Name + - description: LoginRadius Prod Custom Domain Endpoint + url: https://{CustomDomain} + variables: + CustomDomain: + default: auth.example.com + description: Tenant Custom Domain Name + /service/oauth/revoke: + post: + operationId: RevokeM2MToken + summary: Revoke M2M token + description: Revokes a Machine-to-Machine (M2M) token to invalidate it. + requestBody: + $ref: '#/components/requestBodies/OAuthM2MTokenRevokeRequest' + responses: + '200': + description: 'OK: The request was successful.' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + examples: + ACCESS_TOKEN_INVALID_OR_EXPIRED_SSO: + $ref: '#/components/examples/ACCESS_TOKEN_INVALID_OR_EXPIRED_SSO' + CLIENT_ID_REQUIRED: + $ref: '#/components/examples/CLIENT_ID_REQUIRED' + CLIENT_SECRET_BASIC_REQUIRED: + $ref: '#/components/examples/CLIENT_SECRET_BASIC_REQUIRED' + CLIENT_SECRET_POST_REQUIRED: + $ref: '#/components/examples/CLIENT_SECRET_POST_REQUIRED' + CLIENT_SECRET_REQUIRED: + $ref: '#/components/examples/CLIENT_SECRET_REQUIRED' + CONTENT_TYPE_NOT_SUPPORTED: + $ref: '#/components/examples/CONTENT_TYPE_NOT_SUPPORTED' + OAUTH_APP_RESTRICTED: + $ref: '#/components/examples/OAUTH_APP_RESTRICTED' + OAUTH_DANGEROUS_REQUEST: + $ref: '#/components/examples/OAUTH_DANGEROUS_REQUEST' + OAUTH_HOST_NOT_WHITELISTED: + $ref: '#/components/examples/OAUTH_HOST_NOT_WHITELISTED' + OAUTH_POST_BODY_INVALID: + $ref: '#/components/examples/OAUTH_POST_BODY_INVALID' + OAUTH_TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/OAUTH_TRIAL_PLAN_EXPIRED' + TOKEN_EXPIRED: + $ref: '#/components/examples/TOKEN_EXPIRED' + TOKEN_INVALID: + $ref: '#/components/examples/TOKEN_INVALID' + TOKEN_REQUIRED: + $ref: '#/components/examples/TOKEN_REQUIRED_SSO' + TOKEN_TYPE_HINT_INVALID: + $ref: '#/components/examples/TOKEN_TYPE_HINT_INVALID' + TOKEN_TYPE_HINT_REQUIRED: + $ref: '#/components/examples/TOKEN_TYPE_HINT_REQUIRED' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '401': + description: 'Status Unauthorized: The client must authenticate itself to get the requested response.' + content: + application/json: + examples: + CLIENT_ID_INVALID: + $ref: '#/components/examples/CLIENT_ID_INVALID' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + examples: + CLIENT_SECRET_INVALID: + $ref: '#/components/examples/CLIENT_SECRET_INVALID' + M2M_CONF_NOT_EXIST: + $ref: '#/components/examples/M2M_CONF_NOT_EXIST' + TOKEN_CONF_INVALID: + $ref: '#/components/examples/TOKEN_CONF_INVALID' + TOKEN_CONF_NOT_EXIST: + $ref: '#/components/examples/TOKEN_CONF_NOT_EXIST' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + tags: + - OAuth M2M + x-order: 4 + servers: + - description: LoginRadius Prod Tenant Endpoint + url: https://{TenantName}.hub.loginradius.com + variables: + TenantName: + default: TenantName + description: Tenant Name + - description: LoginRadius Prod Custom Domain Endpoint + url: https://{CustomDomain} + variables: + CustomDomain: + default: auth.example.com + description: Tenant Custom Domain Name + /service/oauth/token: + post: + operationId: GenerateM2MToken + summary: Generate M2M token + description: Generates a Machine-to-Machine (M2M) token for application authentication. + requestBody: + $ref: '#/components/requestBodies/OAuthM2MTokenGenerateRequest' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthM2MTokenResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + examples: + AUDIENCE_REQUIRED: + $ref: '#/components/examples/AUDIENCE_REQUIRED' + CLIENT_ID_REQUIRED: + $ref: '#/components/examples/CLIENT_ID_REQUIRED' + CLIENT_SECRET_BASIC_REQUIRED: + $ref: '#/components/examples/CLIENT_SECRET_BASIC_REQUIRED' + CLIENT_SECRET_POST_REQUIRED: + $ref: '#/components/examples/CLIENT_SECRET_POST_REQUIRED' + CLIENT_SECRET_REQUIRED: + $ref: '#/components/examples/CLIENT_SECRET_REQUIRED' + CONTENT_TYPE_NOT_SUPPORTED: + $ref: '#/components/examples/CONTENT_TYPE_NOT_SUPPORTED' + GRANT_TYPE_INVALID: + $ref: '#/components/examples/GRANT_TYPE_INVALID' + OAUTH_APP_RESTRICTED: + $ref: '#/components/examples/OAUTH_APP_RESTRICTED' + OAUTH_DANGEROUS_REQUEST: + $ref: '#/components/examples/OAUTH_DANGEROUS_REQUEST' + OAUTH_HOST_NOT_WHITELISTED: + $ref: '#/components/examples/OAUTH_HOST_NOT_WHITELISTED' + OAUTH_POST_BODY_INVALID: + $ref: '#/components/examples/OAUTH_POST_BODY_INVALID' + OAUTH_TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/OAUTH_TRIAL_PLAN_EXPIRED' + RESOURCE_PERMISSION_NOT_FOUND: + $ref: '#/components/examples/RESOURCE_PERMISSION_NOT_FOUND' + USER_PERMISSION_NOT_FOUND: + $ref: '#/components/examples/USER_PERMISSION_NOT_FOUND' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '401': + description: 'Status Unauthorized: The client must authenticate itself to get the requested response.' + content: + application/json: + examples: + CLIENT_ID_INVALID: + $ref: '#/components/examples/CLIENT_ID_INVALID' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + examples: + CLIENT_SECRET_INVALID: + $ref: '#/components/examples/CLIENT_SECRET_INVALID' + M2M_CONF_NOT_EXIST: + $ref: '#/components/examples/M2M_CONF_NOT_EXIST' + TOKEN_CONF_INVALID: + $ref: '#/components/examples/TOKEN_CONF_INVALID' + TOKEN_CONF_NOT_EXIST: + $ref: '#/components/examples/TOKEN_CONF_NOT_EXIST' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + tags: + - OAuth M2M + x-order: 2 + servers: + - description: LoginRadius Prod Tenant Endpoint + url: https://{TenantName}.hub.loginradius.com + variables: + TenantName: + default: TenantName + description: Tenant Name + - description: LoginRadius Prod Custom Domain Endpoint + url: https://{CustomDomain} + variables: + CustomDomain: + default: auth.example.com + description: Tenant Custom Domain Name + /service/oidc/{OIDCAppName}/.well-known/openid-configuration: + get: + operationId: GetOIDCDiscoveryConfig + summary: OpenID Connect Discovery endpoint + description: Returns the OpenID Provider Configuration Information per OpenID Connect Discovery 1.0 (Section 4). Clients use this endpoint to dynamically discover the issuer, supported endpoints, scopes, response types, claims, and signing algorithms. The response includes the authorization_endpoint, token_endpoint, userinfo_endpoint, jwks_uri, and other metadata needed to configure an OIDC Relying Party. + parameters: + - $ref: '#/components/parameters/OIDCAppName' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/OIDCDiscoveryResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + examples: + OAUTH_APP_RESTRICTED: + $ref: '#/components/examples/OAUTH_APP_RESTRICTED' + OAUTH_DANGEROUS_REQUEST: + $ref: '#/components/examples/OAUTH_DANGEROUS_REQUEST' + OAUTH_HOST_NOT_WHITELISTED: + $ref: '#/components/examples/OAUTH_HOST_NOT_WHITELISTED' + OAUTH_TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/OAUTH_TRIAL_PLAN_EXPIRED' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + examples: + OAUTH_CONF_NOT_EXIST: + $ref: '#/components/examples/OAUTH_CONF_NOT_EXIST' + TOKEN_CONF_INVALID: + $ref: '#/components/examples/TOKEN_CONF_INVALID' + TOKEN_CONF_NOT_EXIST: + $ref: '#/components/examples/TOKEN_CONF_NOT_EXIST' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + tags: + - OIDC + x-order: 1 + servers: + - description: LoginRadius Prod Tenant Endpoint + url: https://{TenantName}.hub.loginradius.com + variables: + TenantName: + default: TenantName + description: Tenant Name + - description: LoginRadius Prod Custom Domain Endpoint + url: https://{CustomDomain} + variables: + CustomDomain: + default: auth.example.com + description: Tenant Custom Domain Name + /service/oidc/{OIDCAppName}/.well-known/oauth-authorization-server: + get: + operationId: GetOAuthAuthorizationServerMetadataOIDC + summary: OAuth Authorization Server Metadata (OIDC app) + description: | + Returns OAuth 2.0 Authorization Server Metadata (RFC 8414) for the given OIDC app. + Use this endpoint for OAuth 2.0 client discovery when using the OIDC flow path. + Response does not include OpenID Connect-specific fields (e.g. userinfo_endpoint, claims_supported). + parameters: + - $ref: '#/components/parameters/OIDCAppName' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthAuthorizationServerMetadata' + '400': + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + tags: + - OIDC + x-order: 2 + servers: + - description: LoginRadius Prod Tenant Endpoint + url: https://{TenantName}.hub.loginradius.com + variables: + TenantName: + default: TenantName + description: Tenant Name + - description: LoginRadius Prod Custom Domain Endpoint + url: https://{CustomDomain} + variables: + CustomDomain: + default: auth.example.com + description: Tenant Custom Domain Name + /service/oidc/{OIDCAppName}/jwks: + get: + operationId: GetOIDCJWKSConfig + summary: Retrieve JSON Web Key Set + description: Retrieves the JSON Web Key Set (JWKS) for verifying token signatures. + parameters: + - $ref: '#/components/parameters/OIDCAppName' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/JWKSResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + examples: + OAUTH_APP_RESTRICTED: + $ref: '#/components/examples/OAUTH_APP_RESTRICTED' + OAUTH_DANGEROUS_REQUEST: + $ref: '#/components/examples/OAUTH_DANGEROUS_REQUEST' + OAUTH_HOST_NOT_WHITELISTED: + $ref: '#/components/examples/OAUTH_HOST_NOT_WHITELISTED' + OAUTH_TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/OAUTH_TRIAL_PLAN_EXPIRED' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + examples: + OAUTH_CONF_NOT_EXIST: + $ref: '#/components/examples/OAUTH_CONF_NOT_EXIST' + TOKEN_CONF_INVALID: + $ref: '#/components/examples/TOKEN_CONF_INVALID' + TOKEN_CONF_NOT_EXIST: + $ref: '#/components/examples/TOKEN_CONF_NOT_EXIST' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + tags: + - OIDC + x-order: 2 + servers: + - description: LoginRadius Prod Tenant Endpoint + url: https://{TenantName}.hub.loginradius.com + variables: + TenantName: + default: TenantName + description: Tenant Name + - description: LoginRadius Prod Custom Domain Endpoint + url: https://{CustomDomain} + variables: + CustomDomain: + default: auth.example.com + description: Tenant Custom Domain Name + /service/oidc/{OIDCAppName}/userinfo: + get: + operationId: GetOIDCUserinfo + summary: Retrieve OIDC User info + description: Retrieves User information using OpenID Connect (OIDC) standards. + parameters: + - $ref: '#/components/parameters/OIDCAppName' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/OIDCUserinfoResponse' + application/jwt: + schema: + $ref: '#/components/schemas/OIDCUserinfoJWTResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + examples: + ACCESS_TOKEN_INVALID_OR_EXPIRED_SSO: + $ref: '#/components/examples/ACCESS_TOKEN_INVALID_OR_EXPIRED_SSO' + ACCESS_TOKEN_REQUIRED_SSO: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED_SSO' + OAUTH_APP_RESTRICTED: + $ref: '#/components/examples/OAUTH_APP_RESTRICTED' + OAUTH_DANGEROUS_REQUEST: + $ref: '#/components/examples/OAUTH_DANGEROUS_REQUEST' + OAUTH_HOST_NOT_WHITELISTED: + $ref: '#/components/examples/OAUTH_HOST_NOT_WHITELISTED' + OAUTH_TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/OAUTH_TRIAL_PLAN_EXPIRED' + TOKEN_EXPIRED: + $ref: '#/components/examples/TOKEN_EXPIRED' + TOKEN_INVALID: + $ref: '#/components/examples/TOKEN_INVALID' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + examples: + OPENID_CONF_INVALID: + $ref: '#/components/examples/OPENID_CONF_INVALID' + OAUTH_CONF_NOT_EXIST: + $ref: '#/components/examples/OAUTH_CONF_NOT_EXIST' + TOKEN_CONF_INVALID: + $ref: '#/components/examples/TOKEN_CONF_INVALID' + TOKEN_CONF_NOT_EXIST: + $ref: '#/components/examples/TOKEN_CONF_NOT_EXIST' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + security: + - AccessToken: [] + - BearerToken: [] + tags: + - OIDC + x-order: 3 + post: + operationId: GetOIDCUserinfoByPost + summary: Retrieve OIDC User info via POST + description: Retrieves User information using OpenID Connect (OIDC) standards via the POST method. + parameters: + - $ref: '#/components/parameters/OIDCAppName' + requestBody: + $ref: '#/components/requestBodies/OIDCUserinfoRequest' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/OIDCUserinfoResponse' + application/jwt: + schema: + $ref: '#/components/schemas/OIDCUserinfoJWTResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + examples: + ACCESS_TOKEN_INVALID_OR_EXPIRED_SSO: + $ref: '#/components/examples/ACCESS_TOKEN_INVALID_OR_EXPIRED_SSO' + ACCESS_TOKEN_REQUIRED_SSO: + $ref: '#/components/examples/ACCESS_TOKEN_REQUIRED_SSO' + CONTENT_TYPE_NOT_SUPPORTED: + $ref: '#/components/examples/CONTENT_TYPE_NOT_SUPPORTED' + OAUTH_APP_RESTRICTED: + $ref: '#/components/examples/OAUTH_APP_RESTRICTED' + OAUTH_DANGEROUS_REQUEST: + $ref: '#/components/examples/OAUTH_DANGEROUS_REQUEST' + OAUTH_HOST_NOT_WHITELISTED: + $ref: '#/components/examples/OAUTH_HOST_NOT_WHITELISTED' + OAUTH_TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/OAUTH_TRIAL_PLAN_EXPIRED' + TOKEN_EXPIRED: + $ref: '#/components/examples/TOKEN_EXPIRED' + TOKEN_INVALID: + $ref: '#/components/examples/TOKEN_INVALID' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + examples: + OPENID_CONF_INVALID: + $ref: '#/components/examples/OPENID_CONF_INVALID' + OAUTH_CONF_NOT_EXIST: + $ref: '#/components/examples/OAUTH_CONF_NOT_EXIST' + TOKEN_CONF_INVALID: + $ref: '#/components/examples/TOKEN_CONF_INVALID' + TOKEN_CONF_NOT_EXIST: + $ref: '#/components/examples/TOKEN_CONF_NOT_EXIST' + schema: + $ref: '#/components/schemas/OAuthErrorResponse' + tags: + - OIDC + x-order: 4 + servers: + - description: LoginRadius Prod Tenant Endpoint + url: https://{TenantName}.hub.loginradius.com + variables: + TenantName: + default: TenantName + description: Tenant Name + - description: LoginRadius Prod Custom Domain Endpoint + url: https://{CustomDomain} + variables: + CustomDomain: + default: auth.example.com + description: Tenant Custom Domain Name + /service/saml/idp/metadata: + get: + operationId: GetSAMLIDPMetadata + summary: Retrieve SAML IDP metadata + description: Retrieves metadata for a SAML Identity Provider (IDP). + parameters: + - $ref: '#/components/parameters/SamlAppName' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/xml: + schema: + $ref: '#/components/schemas/SamlIdpMetadataResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + examples: + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST_SSO' + INVALID_HOST: + $ref: '#/components/examples/INVALID_HOST' + SAML_APP_NAME_REQUIRED: + $ref: '#/components/examples/SAML_APP_NAME_REQUIRED' + SP_SAML_CONFIG_NOT_FOUND: + $ref: '#/components/examples/SP_SAML_CONFIG_NOT_FOUND' + SP_SAML_CONFIG_NOT_VALID: + $ref: '#/components/examples/SP_SAML_CONFIG_NOT_VALID' + schema: + $ref: '#/components/schemas/ErrorResponse' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + examples: + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + $ref: '#/components/examples/APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT_SSO' + SAML_METADATA_RESPONSE_INVALID: + $ref: '#/components/examples/SAML_METADATA_RESPONSE_INVALID' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED_SSO' + schema: + $ref: '#/components/schemas/ErrorResponse' + tags: + - SAML + servers: + - description: LoginRadius Prod Tenant Endpoint + url: https://{TenantName}.hub.loginradius.com + variables: + TenantName: + default: TenantName + description: Tenant Name + - description: LoginRadius Prod Custom Domain Endpoint + url: https://{CustomDomain} + variables: + CustomDomain: + default: auth.example.com + description: Tenant Custom Domain Name + /sso/mobile/generate: + get: + operationId: GenerateQRCode + summary: Retrieve QR code + description: Retrieves a QR code for Cross Device SSO. + parameters: + - $ref: '#/components/parameters/CodeExpiryTTL' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/QRCodeResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + examples: + API_KEY_NOT_WELL_FORMATTED_SSO: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED_SSO' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED_SSO' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST_SSO' + EXPIRE_IN_INVALID_FORMAT_SSO: + $ref: '#/components/examples/EXPIRE_IN_INVALID_FORMAT_SSO' + MOBILE_EXPIRY_PARAM_INVALID: + $ref: '#/components/examples/MOBILE_EXPIRY_PARAM_INVALID' + schema: + $ref: '#/components/schemas/ErrorResponse' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID_SSO' + SOMETHING_GOING_WRONG_SSO: + $ref: '#/components/examples/SOMETHING_GOING_WRONG_SSO' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED_SSO' + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - APIKey: [] + - XLoginRadiusAPIKey: [] + servers: + - description: LoginRadius Cloud API Endpoint + url: https://cloud-api.loginradius.com + tags: + - Cross Device SSO + x-order: 1 + /sso/mobile/token: + get: + operationId: GetAccessTokenByPing + summary: Retrieve Access Token by ping + description: Retrieves an Access Token by ping after a User scans a QR code during mobile login. + parameters: + - $ref: '#/components/parameters/QRCode' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/AccessTokenByPingQRCodeResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + examples: + API_KEY_NOT_WELL_FORMATTED_SSO: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED_SSO' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED_SSO' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST_SSO' + MOBILE_ACCESS_TOKEN_INVALID_OR_EXPIRED_SSO: + $ref: '#/components/examples/MOBILE_ACCESS_TOKEN_INVALID_OR_EXPIRED' + MOBILE_CODE_NOT_VALID_OR_EXPIRED: + $ref: '#/components/examples/MOBILE_CODE_NOT_VALID_OR_EXPIRED' + MOBILE_CODE_REQUIRED: + $ref: '#/components/examples/MOBILE_CODE_REQUIRED' + schema: + $ref: '#/components/schemas/ErrorResponse' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + examples: + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID_SSO' + SOMETHING_GOING_WRONG_SSO: + $ref: '#/components/examples/SOMETHING_GOING_WRONG_SSO' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED_SSO' + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - APIKey: [] + - XLoginRadiusAPIKey: [] + servers: + - description: LoginRadius Cloud API Endpoint + url: https://cloud-api.loginradius.com + tags: + - Cross Device SSO + x-order: 3 + post: + operationId: MapQRCodeToAccessToken + summary: Map QR code to Access Token + description: Maps a scanned QR code to an Access Token during mobile login. + requestBody: + $ref: '#/components/requestBodies/QRCodeMapToTokenRequest' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/QRCodeMapToTokenResponse' + '400': + description: 'Status Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + examples: + API_KEY_NOT_WELL_FORMATTED_SSO: + $ref: '#/components/examples/API_KEY_NOT_WELL_FORMATTED_SSO' + API_KEY_REQUIRED: + $ref: '#/components/examples/API_KEY_REQUIRED_SSO' + CODE_AND_TOKEN_REQUIRED: + $ref: '#/components/examples/CODE_AND_TOKEN_REQUIRED' + DANGEROUS_REQUEST: + $ref: '#/components/examples/DANGEROUS_REQUEST_SSO' + INVALID_POST_BODY: + $ref: '#/components/examples/INVALID_POST_BODY' + MOBILE_CODE_NOT_VALID_OR_EXPIRED: + $ref: '#/components/examples/MOBILE_CODE_NOT_VALID_OR_EXPIRED' + MOBILE_CODE_REQUIRED: + $ref: '#/components/examples/MOBILE_CODE_REQUIRED' + POST_BODY_INVALID: + $ref: '#/components/examples/POST_BODY_INVALID_SSO' + schema: + $ref: '#/components/schemas/ErrorResponse' + '403': + description: 'Status Forbidden: The client does not have permission to access the resource.' + content: + application/json: + examples: + ACCESS_TOKEN_NOT_VALID: + $ref: '#/components/examples/ACCESS_TOKEN_NOT_VALID_SSO' + API_KEY_NOT_VALID: + $ref: '#/components/examples/API_KEY_NOT_VALID_SSO' + SOMETHING_GOING_WRONG_SSO: + $ref: '#/components/examples/SOMETHING_GOING_WRONG_SSO' + TRIAL_PLAN_EXPIRED: + $ref: '#/components/examples/TRIAL_PLAN_EXPIRED_SSO' + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - APIKey: [] + - XLoginRadiusAPIKey: [] + servers: + - description: LoginRadius Cloud API Endpoint + url: https://cloud-api.loginradius.com + tags: + - Cross Device SSO + x-order: 2 + /bulk/upsert: + post: + summary: Batch upload Users + operationId: BatchUpload + description: Uploads an array of Users with optional Password and migration configuration. + tags: + - User Migration + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BatchUpload' + examples: + b2cBatchUplaod: + $ref: '#/components/examples/b2cBatchUplaod' + b2cBatchUplaodWithPasswordConfig: + $ref: '#/components/examples/b2cBatchUplaodWithPasswordConfig' + b2cDeltaBatchUplaod: + $ref: '#/components/examples/b2cDeltaBatchUplaod' + b2bBatchUplaod: + $ref: '#/components/examples/b2bBatchUplaod' + b2bBatchUplaodWithPasswordConfig: + $ref: '#/components/examples/b2bBatchUplaodWithPasswordConfig' + b2bDeltaBatchUplaod: + $ref: '#/components/examples/b2bDeltaBatchUplaod' + b2bBatchUplaodOnlyOrgs: + $ref: '#/components/examples/b2bBatchUplaodOnlyOrgs' + b2bBatchUplaodOnlyRoles: + $ref: '#/components/examples/b2bBatchUplaodOnlyRoles' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/BatchUploadResponse' + examples: + success: + $ref: '#/components/examples/batchUploadSuccess' + partial_success: + $ref: '#/components/examples/batchUploadPartialSuccess' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/BatchUploadErrorResponse' + examples: + JSON_POST_BODY_REQUIRED: + $ref: '#/components/examples/JSON_POST_BODY_REQUIRED' + SUBKEYLENGTH_RANGE: + $ref: '#/components/examples/SUBKEYLENGTH_RANGE' + SALTKEYLENGTH_RANGE: + $ref: '#/components/examples/SALTKEYLENGTH_RANGE' + INVALID_PASSWORD_HASH_CONFIG: + $ref: '#/components/examples/INVALID_PASSWORD_HASH_CONFIG' + INITIAL_PROFILE_BODY_VALIDATIONS: + $ref: '#/components/examples/ValidateIdentity' + B2B_ORG_AND_ROLE_VALIDATION: + $ref: '#/components/examples/B2B_ORG_AND_ROLE_VALIDATION' + IDENTITY_VALIDATION_ERRORS: + $ref: '#/components/examples/IDENTITY_VALIDATION_ERRORS' + BATCH_MIGRATION_TOO_MANY_RECORDS: + $ref: '#/components/examples/BATCH_MIGRATION_TOO_MANY_RECORDS' + BATCH_MIGRATION_NO_RECORDS: + $ref: '#/components/examples/BATCH_MIGRATION_NO_RECORDS' + MISSING_UNIQUE_INDEX: + $ref: '#/components/examples/MISSING_UNIQUE_INDEX' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + MIGRATION_FAILED: + $ref: '#/components/examples/MIGRATION_FAILED' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + servers: + - description: LoginRadius Migration Endpoint + url: https://migration.loginradius.com/v2 + security: + - APIKey: [] + APISecret: [] + /consent/options: + get: + summary: Retrieve Consent Options + operationId: GetConsentOptions + description: Lists all consent options available for a specific Tenant. + security: + - M2MBearerToken: [] + tags: + - Consent + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + type: object + properties: + Data: + type: array + items: + $ref: '#/components/schemas/ConsentOptions' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + CONSENT_MANAGEMENT_NOT_ENABLED: + $ref: '#/components/examples/CONSENT_MANAGEMENT_NOT_ENABLED' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + post: + summary: Create Consent Option + operationId: CreateConsentOption + security: + - M2MBearerToken: [] + description: Creates a new consent option for a specific Tenant. + tags: + - Consent + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ConsentOptionModel' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/ConsentOptions' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_POST_BODY_REQUIRED: + $ref: '#/components/examples/JSON_POST_BODY_REQUIRED' + PARAMETER_NOT_WELL_FORMATTED_REQUIRED: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + CONSENT_MANAGEMENT_NOT_ENABLED: + $ref: '#/components/examples/CONSENT_MANAGEMENT_NOT_ENABLED' + '409': + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + CONSENT_OPTION_ID_ALREADY_EXISTS: + $ref: '#/components/examples/CONSENT_OPTION_ID_ALREADY_EXISTS' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /consent/options/{optionId}: + delete: + summary: Delete Consent Option + operationId: DeleteConsentOption + description: Deletes the consent option identified by the option ID for the Tenant. + security: + - M2MBearerToken: [] + tags: + - Consent + parameters: + - $ref: '#/components/parameters/OptionId' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsDeleted' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + CONSENT_MANAGEMENT_NOT_ENABLED: + $ref: '#/components/examples/CONSENT_MANAGEMENT_NOT_ENABLED' + '404': + description: 'Not found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + CONSENT_OPTION_NOT_FOUND: + $ref: '#/components/examples/CONSENT_OPTION_NOT_FOUND' + '409': + description: 'Conflict: The request could not be completed due to a conflict with the current state of the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + CONSENT_OPTION_IN_USE: + $ref: '#/components/examples/CONSENT_OPTION_IN_USE' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /consent/forms: + get: + summary: Retrieve Consent Forms + description: Retrieves all Consent Forms configured for the Tenant. + operationId: GetConsentForms + security: + - M2MBearerToken: [] + tags: + - Consent + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + type: object + properties: + Data: + type: array + items: + $ref: '#/components/schemas/ConsentForm' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + CONSENT_MANAGEMENT_NOT_ENABLED: + $ref: '#/components/examples/CONSENT_MANAGEMENT_NOT_ENABLED' + '500': + description: 'Internal Server Error: An unexpected error occurred.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + post: + summary: Add Consent Form + description: Adds a new Consent Form for the Tenant. + operationId: AddConsentForm + security: + - M2MBearerToken: [] + tags: + - Consent + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/ConsentFormModel' + responses: + '200': + description: 'Created: The Consent Form was successfully created.' + content: + application/json: + schema: + $ref: '#/components/schemas/ConsentForm' + '400': + description: 'Bad Request: The request was invalid.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + JSON_POST_BODY_REQUIRED: + $ref: '#/components/examples/JSON_POST_BODY_REQUIRED' + PARAMETER_NOT_WELL_FORMATTED: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED' + CONSENT_OPTION_INVALID: + $ref: '#/components/examples/CONSENT_OPTION_INVALID' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + CONSENT_MANAGEMENT_NOT_ENABLED: + $ref: '#/components/examples/CONSENT_MANAGEMENT_NOT_ENABLED' + '409': + description: 'Conflict: The Consent Form already exists.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + CONSENT_FORM_ALREADY_EXISTS_FOR_EVENT_START_DATE: + $ref: '#/components/examples/CONSENT_FORM_ALREADY_EXISTS_FOR_EVENT_START_DATE' + '500': + description: 'Internal Server Error: An unexpected error occurred.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /consent/forms/{version}: + delete: + summary: Delete Consent Form + operationId: DeleteConsentForm + description: Deletes the Consent Form identified by the form version for the Tenant. + security: + - M2MBearerToken: [] + tags: + - Consent + parameters: + - $ref: '#/components/parameters/FormVersion' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + $ref: '#/components/schemas/IsDeleted' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + PARAMETER_NOT_WELL_FORMATTED_INVALID_VERSION: + $ref: '#/components/examples/PARAMETER_NOT_WELL_FORMATTED_INVALID_VERSION' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + CONSENT_MANAGEMENT_NOT_ENABLED: + $ref: '#/components/examples/CONSENT_MANAGEMENT_NOT_ENABLED' + '404': + description: 'Not found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + CONSENT_FORM_NOT_FOUND: + $ref: '#/components/examples/CONSENT_FORM_NOT_FOUND' + '410': + description: 'Gone: The resource requested is no longer available and will not be available again.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + CONSENT_FORM_ALREADY_DELETED: + $ref: '#/components/examples/CONSENT_FORM_ALREADY_DELETED' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /consent/forms/active: + get: + summary: Retrieve Active Consent Forms + operationId: GetActiveConsentForms + description: Retrieves a list of active Consent Forms configured for the Tenant. + security: + - M2MBearerToken: [] + tags: + - Consent + parameters: + - $ref: '#/components/parameters/Event' + responses: + '200': + description: 'OK: The request was successful.' + content: + application/json: + schema: + type: object + properties: + Data: + type: array + items: + $ref: '#/components/schemas/ConsentForm' + '403': + description: 'Forbidden: The client does not have permission to access the resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + UNAUTHORIZED_ACCESS: + $ref: '#/components/examples/UNAUTHORIZED_ACCESS' + CONSENT_MANAGEMENT_NOT_ENABLED: + $ref: '#/components/examples/CONSENT_MANAGEMENT_NOT_ENABLED' + '404': + description: 'Not found: The server cannot find the requested resource.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + CONSENT_FORMS_NOT_FOUND: + $ref: '#/components/examples/CONSENT_FORMS_NOT_FOUND' + '500': + description: 'Internal Server Error: The server encountered an unexpected error.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + examples: + OPERATION_FAILED: + $ref: '#/components/examples/OPERATION_FAILED_PARTNER' + /sso/bigcommerce/auth: + get: + summary: BigCommerce OAuth Authorization + operationId: BigCommerceAuth + description: Handles BigCommerce OAuth authorization callbacks. Accepts either an authorization code (for install flow) or a signed_payload (for load/uninstall callbacks). Returns an HTML page on success. + tags: + - BigCommerce SSO + servers: + - url: https://{domain}.hub.loginradius.com + description: LoginRadius Hosted Plugins Server + variables: + domain: + default: example + description: LoginRadius Tenant Name + parameters: + - $ref: '#/components/parameters/BigCommerceCode' + - $ref: '#/components/parameters/BigCommerceSignedPayload' + responses: + '200': + description: 'OK: Authorization successful, returns HTML page.' + content: + text/html: + schema: + type: string + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: [] + /sso/bigcommerce/api/token: + get: + summary: Generate BigCommerce Login URL (GET) + operationId: GetBigCommerceLoginUrl + description: Generates a BigCommerce customer login URL using the provided LoginRadius access token. If the customer does not exist in BigCommerce, it creates one. Returns a login URL that can be used to authenticate the user into BigCommerce. + tags: + - BigCommerce SSO + servers: + - url: https://{domain}.hub.loginradius.com + description: LoginRadius Hosted Plugins Server + variables: + domain: + default: example + description: LoginRadius Tenant Name + parameters: + - $ref: '#/components/parameters/AccessTokenRequired' + - $ref: '#/components/parameters/BigCommerceStore' + - $ref: '#/components/parameters/PasswordQuery' + - $ref: '#/components/parameters/ReturnUrl' + responses: + '200': + description: 'OK: BigCommerce login URL generated successfully.' + content: + application/json: + schema: + $ref: '#/components/schemas/BigCommerceLoginUrlResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '401': + description: 'Unauthorized: The API key or access token is missing or invalid.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '403': + description: 'Forbidden: The request is not allowed.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - APIKey: [] + - XLoginRadiusAPIKey: [] + post: + summary: Generate BigCommerce Login URL (POST) + operationId: PostBigCommerceLoginUrl + description: Generates a BigCommerce customer login URL using the provided LoginRadius access token sent in the request body. If the customer does not exist in BigCommerce, it creates one. Returns a login URL that can be used to authenticate the user into BigCommerce. + tags: + - BigCommerce SSO + servers: + - url: https://{domain}.hub.loginradius.com + description: LoginRadius Hosted Plugins Server + variables: + domain: + default: example + description: LoginRadius Tenant Name + parameters: + - $ref: '#/components/parameters/BigCommerceStore' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BigCommerceTokenPostRequest' + responses: + '200': + description: 'OK: BigCommerce login URL generated successfully.' + content: + application/json: + schema: + $ref: '#/components/schemas/BigCommerceLoginUrlResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '401': + description: 'Unauthorized: The API key or access token is missing or invalid.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '403': + description: 'Forbidden: The request is not allowed.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - APIKey: [] + - XLoginRadiusAPIKey: [] + /sso/bigcommerce/api/validatepassword: + post: + summary: Validate BigCommerce Customer Password + operationId: ValidateBigCommercePassword + description: Validates a BigCommerce customer's password by checking the provided email and password against the BigCommerce store's customer records. + tags: + - BigCommerce SSO + servers: + - url: https://{domain}.hub.loginradius.com + description: LoginRadius Hosted Plugins Server + variables: + domain: + default: example + description: LoginRadius Tenant Name + parameters: + - $ref: '#/components/parameters/BigCommerceStore' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/BigCommerceValidatePasswordRequest' + responses: + '200': + description: 'OK: Password validation result returned.' + content: + application/json: + schema: + $ref: '#/components/schemas/BigCommerceValidatePasswordResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '401': + description: 'Unauthorized: The API key is missing or invalid.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '403': + description: 'Forbidden: The request is not allowed.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - APIKey: [] + - XLoginRadiusAPIKey: [] + /sso/shopify/api/token: + get: + summary: Generate Shopify Multipass Login URL + operationId: GetShopifyLoginUrl + description: Generates a Shopify Multipass login URL using the provided LoginRadius access token. Uses Shopify's Multipass feature to create a single sign-on URL that authenticates the user into the Shopify store. + tags: + - Shopify SSO + servers: + - url: https://{domain}.hub.loginradius.com + description: LoginRadius Hosted Plugins Server + variables: + domain: + default: example + description: LoginRadius Tenant Name + parameters: + - $ref: '#/components/parameters/AccessTokenRequired' + - $ref: '#/components/parameters/ShopifyStore' + - $ref: '#/components/parameters/ReturnUrl' + responses: + '200': + description: 'OK: Shopify Multipass login URL generated successfully.' + content: + application/json: + schema: + $ref: '#/components/schemas/ShopifyLoginUrlResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '401': + description: 'Unauthorized: The API key or access token is missing or invalid.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '403': + description: 'Forbidden: The request is not allowed.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - APIKey: [] + - XLoginRadiusAPIKey: [] + /sso/perfectmind/session: + get: + summary: Generate PerfectMind Login Session + operationId: GetPerfectMindSession + description: Generates a PerfectMind login session using the provided LoginRadius access token. Returns a session ID and URL that can be used to authenticate the user into the PerfectMind platform. + tags: + - PerfectMind SSO + servers: + - url: https://{domain}.hub.loginradius.com + description: LoginRadius Hosted Plugins Server + variables: + domain: + default: example + description: LoginRadius Tenant Name + parameters: + - $ref: '#/components/parameters/AccessTokenRequired' + - $ref: '#/components/parameters/PerfectMindSiteName' + responses: + '200': + description: 'OK: PerfectMind session generated successfully.' + content: + application/json: + schema: + $ref: '#/components/schemas/PerfectMindSessionResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '401': + description: 'Unauthorized: The API key or access token is missing or invalid.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '403': + description: 'Forbidden: The request is not allowed.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - APIKey: [] + - XLoginRadiusAPIKey: [] + /sso/perfectmind/contact: + get: + summary: Get PerfectMind Contact IDs + operationId: GetPerfectMindContact + description: Retrieves PerfectMind contact IDs associated with the user's email address. Uses the LoginRadius access token to look up the user and match them against PerfectMind contacts using email and birth date. + tags: + - PerfectMind SSO + servers: + - url: https://{domain}.hub.loginradius.com + description: LoginRadius Hosted Plugins Server + variables: + domain: + default: example + description: LoginRadius Tenant Name + parameters: + - $ref: '#/components/parameters/AccessTokenRequired' + - $ref: '#/components/parameters/PerfectMindSiteName' + - $ref: '#/components/parameters/BirthDate' + - $ref: '#/components/parameters/PerfectScanID' + responses: + '200': + description: 'OK: PerfectMind contact information retrieved successfully.' + content: + application/json: + schema: + $ref: '#/components/schemas/PerfectMindContactResponse' + '400': + description: 'Bad Request: The request could not be understood by the server due to malformed syntax.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '401': + description: 'Unauthorized: The API key or access token is missing or invalid.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '403': + description: 'Forbidden: The request is not allowed.' + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + security: + - APIKey: [] + - XLoginRadiusAPIKey: [] +components: + securitySchemes: + AccessToken: + description: Access Token in QueryString + in: query + name: access_token + type: apiKey + BearerToken: + type: http + scheme: bearer + description: Bearer token for user authentication + APIKey: + type: apiKey + name: apikey + in: query + description: Tenant API Key for authentication + APISecret: + type: apiKey + name: apisecret + in: query + description: Tenant API Secret for authentication + ClientId: + type: apiKey + name: client_id + in: query + description: Application Client ID for authentication + ClientSecret: + type: apiKey + name: client_secret + in: query + description: Application Client Secret for authentication + M2MBearerToken: + type: http + scheme: bearer + bearerFormat: JWT + description: M2M Token for authentication + Digest: + type: apiKey + name: digest + in: header + description: Request Signing Digest for authentication + XRequestExpiresTime: + type: apiKey + name: X-Request-Expires + in: header + description: Request expiry time for API authentication + ApiSecret: + type: apiKey + in: query + name: secret + XLoginRadiusAPISecret: + type: apiKey + in: header + name: X-LoginRadius-ApiSecret + XLoginRadiusAPIKey: + type: apiKey + in: header + name: X-LoginRadius-ApiKey + parameters: + GoogleRecaptchaResponse: + name: g-recaptcha-response + in: query + required: false + schema: + type: string + description: Google reCAPTCHA response parameter which will be sent to the server for verification. + example: 03AGdBq24e1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f3g4h5i6j7k8l9m0n1o2p3q4r5s6t7u8v9w0x1y2z3a4b5c6d7e8f9g0h1i2j3k4l5m6n7o8p9q0r1s2t3u4v5w6x7y8z9 + GoogleRecaptchaResponseAlt: + name: g_recaptcha_response + in: query + required: false + schema: + type: string + description: Google reCAPTCHA Response + example: 03AGdBq24e1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f3g4h5i6j7k8l9m0n1o2p3q4r5s6t7u8v9w0x1y2z3a4b5c6d7e8f9g0h1i2j3k4l5m6n7o8p9q0r1s2t3u4v5w6x7y8z9 + PreventWebhook: + name: prevent_webhook + in: query + required: false + schema: + type: boolean + description: When true, suppresses webhook events for this operation. + example: true + XPreventWebhook: + name: X-PreventWebhook + in: header + required: false + schema: + type: boolean + description: When true, suppresses webhook events for this operation. + example: true + HCaptchaResponse: + name: h-captcha-response + in: query + required: false + schema: + type: string + description: hCaptcha Response + example: 03AGdBq24e1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f3g4h5i6j7k8l9m0n1o2p3q4r5s6t7u8v9w0x1y2z3a4b5c6d7e8f9g0h1i2j3k4l5m6n7o8p9q0r1s2t3u4v5w6x7y8z9 + QQCaptchaTicket: + name: qq_captcha_ticket + in: query + required: false + schema: + type: string + description: QQ Captcha ticket (required if Bot Protection is enabled) + example: 03AGdBq24eJ9O8dpLsw0Pr0OTtWfkmK34K0jQde + QQCaptchaRandstr: + name: qq_captcha_randstr + in: query + required: false + schema: + type: string + description: QQ Captcha rand string (required if Bot Protection is enabled) + example: 03AGdBq24eJ9O8dpLsw0Pr0OTtWfkmK34K0jQde + EmailTemplate: + name: emailtemplate + in: query + required: false + schema: + type: string + description: Name of the Email template to use for this notification. + example: Email-Template + ResetPasswordUrl: + name: resetpasswordurl + in: query + required: false + schema: + type: string + description: Callback URL for the Password Reset link in the Email. + example: https://example.com/resetpassword + QQRecaptchaTicket: + name: qq_captcha_ticket + in: query + required: false + schema: + type: string + description: QQ reCAPTCHA Response + example: 03AGdBq24e1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f3g4h5i6j7k8l9m0n1o2p3q4r5s6t7u8v9w0x1y2z3a4b5c6d7e8f9g0h1i2j3k4l5m6n7o8p9q0r1s2t3u4v5w6x7y8z9 + QQRecaptchaRandstr: + name: qq_captcha_randstr + in: query + required: false + schema: + type: string + description: QQ reCAPTCHA Response + example: 03AGdBq24e1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f3g4h5i6j7k8l9m0n1o2p3q4r5s6t7u8v9w0x1y2z3a4b5c6d7e8f9g0h1i2j3k4l5m6n7o8p9q0r1s2t3u4v5w6x7y8z9 + AccessToken: + name: access_token + in: query + description: Access Token of the User + required: false + style: form + explode: true + schema: + type: string + example: 493318dd-487a-439b-8302-5e27f1110244 + SmsTemplate: + name: smstemplate + in: query + required: false + schema: + type: string + description: SMS Template + example: SMS-Template + IsVoiceOtp: + name: isvoiceotp + in: query + required: false + schema: + type: boolean + description: Boolean flag to enforce sending SMS content via Voice. + example: true + VerificationUrl: + name: verificationurl + in: query + required: false + schema: + type: string + description: Verification URL for the User which will be included in the Email template.. + example: https://example.com/verify?token=123456 + Sott: + name: sott + in: query + required: false + schema: + type: string + description: SOTT should be generated from the server side and passed here or in the X-LoginRadius-Sott header. + example: UIsmfxExgK9McHpzD+rGVaV7UtZkZiptaz5WVYqY9W9nzW1JJ2J/vYbeQZJPNMzOs1o1gLfd+Ays87hyphDWsqFBzJv3wBNfNLVZJdAK/HE=*b8ca7b7afcca0254b8cfdce843dc6253 + WelcomeEmailTemplate: + name: welcomeemailtemplate + in: query + required: false + schema: + type: string + description: Welcome Email Template + example: Welcome-Email-Template + Fields: + name: fields + in: query + description: Comma-separated list of profile fields to include in the response. + required: false + style: form + explode: true + schema: + type: string + example: Email,username + X-LoginRadius-Sott: + name: X-LoginRadius-Sott + in: header + schema: + type: string + description: SOTT should be generated from the server side and passed here or in sott query parameter. + example: UIsmfxExgK9McHpzD+rGVaV7UtZkZiptaz5WVYqY9W9nzW1JJ2J/vYbeQZJPNMzOs1o1gLfd+Ays87hyphDWsqFBzJv3wBNfNLVZJdAK/HE=*b8ca7b7afcca0254b8cfdce843dc6253 + Options: + name: options + in: query + required: false + schema: + type: string + description: Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail + example: preventverificationemail + InvitationToken: + name: invitation_token + in: query + required: false + schema: + type: string + description: Invitation token of an organization + example: f7e7e0c9-cd54-426f-97a7-5ebd846ddcc5 + PasskeyIdentifier: + name: identifier + in: query + description: Email of the User + required: true + style: form + schema: + type: string + example: test@example.com + LoginUrl: + name: loginurl + in: query + required: false + schema: + type: string + description: Login URL for the User which will come in the login logs from where the User logged in. + example: https://example.com/login + BreachedPasswordEmailTemplate: + name: breachedpasswordemailtemplate + in: query + required: false + schema: + type: string + description: Email template name for breached Password notifications. + example: Breached-PasswordEmail-Template + BreachedPasswordSmsTemplate: + name: breachedpasswordsmstemplate + in: query + required: false + schema: + type: string + description: SMS template name for breached Password notifications. + example: Breached-PasswordSMS-Template + RbaBrowserEmailTemplate: + name: rbabrowseremailtemplate + in: query + required: false + schema: + type: string + description: RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. + example: RBA-Browser-Email-Template + RbaOneClickEmailTemplate: + name: rbaoneclickemailtemplate + in: query + required: false + schema: + type: string + description: RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. + example: RBA-One-Click-Email-Template + RbaCityEmailTemplate: + name: rbacityemailtemplate + in: query + required: false + schema: + type: string + description: RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. + example: RBA-City-Email-Template + RbaCountryEmailTemplate: + name: rbacountryemailtemplate + in: query + required: false + schema: + type: string + description: RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. + example: RBA-Country-Email-Template + RbaIPEmailTemplate: + name: rbaipemailtemplate + in: query + required: false + schema: + type: string + description: RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. + example: RBA-IP-Email-Template + RbaDeviceEmailTemplate: + name: rbadeviceemailtemplate + in: query + required: false + schema: + type: string + description: RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. + example: RBA-Device-Email-Template + RbaOtpSMSTemplate: + name: rbaotpsmstemplate + in: query + required: false + schema: + type: string + description: RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. + example: RBA-OTP-SMS-Template + RbaBrowserSMSTemplate: + name: rbabrowsersmstemplate + in: query + required: false + schema: + type: string + description: RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. + example: RBA-Browser-SMS-Template + RbaCitySMSTemplate: + name: rbacitysmstemplate + in: query + required: false + schema: + type: string + description: RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. + example: RBA-City-SMS-Template + RbaCountrySMSTemplate: + name: rbacountrysmstemplate + in: query + required: false + schema: + type: string + description: RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. + example: RBA-Country-SMS-Template + RbaIPSMSTemplate: + name: rbaipsmstemplate + in: query + required: false + schema: + type: string + description: RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. + example: RBA-IP-SMS-Template + RbaDeviceSMSTemplate: + name: rbadevicesmstemplate + in: query + required: false + schema: + type: string + description: RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. + example: RBA-Device-SMS-Template + EmailTemplate2FA: + name: emailtemplate2fa + in: query + required: false + schema: + type: string + description: Name of the 2FA Email template to use for this notification. + example: Email-Template + DuoRedirectUri: + name: duoredirecturi + in: query + required: false + schema: + type: string + description: Duo auth redirection url. + example: https://example.com/duo/callback + Email: + name: email + in: query + required: false + schema: + type: string + format: email + description: Email address of the associated Account. + example: test@gmail.com + Username: + name: username + in: query + required: false + schema: + type: string + description: Username of the associated Account. + example: testuser + VerificationToken: + name: verificationtoken + in: query + required: false + schema: + type: string + description: Verification token received in the Email. + example: '123456' + Otp: + name: otp + in: query + required: false + schema: + type: string + description: One-time passcode sent to the User's Email. + example: '123456' + Uuid: + name: uuid + in: query + required: false + schema: + type: string + description: Email template for the welcome Email. + example: Welcome-Email-Template + Url: + name: url + in: query + required: false + schema: + type: string + description: URL to log the main domain in the database. + example: https://example.com + SecondFactorToken: + name: secondfactorauthenticationtoken + in: query + required: true + schema: + type: string + description: Second factor token + example: 4asdf575-5678-4065-b717-fa0n7i5ca81a + ClientGuid: + name: clientguid + in: query + required: false + schema: + type: string + description: Client GUID for the request. + example: 12345678-1234-1234-1234-123456789012 + DeleteToken: + name: deletetoken + in: query + required: false + schema: + type: string + description: This is required if the OTP is not passed in the query parameter. + example: 1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef + PreventRefresh: + name: preventRefresh + in: query + required: false + schema: + type: boolean + description: Whether to prevent the token from being refreshed (true/false). + example: true + NullSupport: + name: nullsupport + in: query + description: Bool flag, if this flag is sent as true then the fields which are send in payload as null then in the profile as well that will be saved as null only + required: false + style: form + explode: true + schema: + type: boolean + example: true + DeleteUrl: + name: deleteurl + in: query + description: DeleteUrl URL which is being sent in the Email + required: false + style: form + explode: true + schema: + type: string + example: https://example.com/deleteurl + passkeyId: + name: passkeyId + in: path + description: Id asscociated with the Passkey + required: true + schema: + type: string + example: 133f5cf974b94726a6a7cebec917765c + EmailId: + name: emailid + in: query + required: false + schema: + type: string + format: email + description: The Email address of User + example: test@gmail.com + ResetPasskeyUrl: + name: resetpasskeyurl + in: query + required: false + schema: + type: string + description: Reset Passkey URL + example: https://example.com/resetpasskey + VToken: + name: vtoken + in: query + required: false + schema: + type: string + description: Verification token received in the Email. + example: '123456' + RedirectUrl: + name: redirecturl + in: query + required: false + schema: + type: string + description: The URL to which the User will be redirected after completing the operation, such as login or verification. + example: https://example.com/redirect + OneTouchLoginEmailTemplate: + name: onetouchloginemailtemplate + in: query + required: false + schema: + type: string + description: One Touch Login Email Template + example: One-Touch-Login-Email-Template + SMSTemplate2FA: + name: smstemplate2fa + in: query + required: false + schema: + type: string + description: SMS template name to be used for sending the 2FA code to the User. + example: SMS-Template + ReAuthType: + name: type + in: path + required: true + schema: + type: string + enum: + - backupcode + - otp + - googleauthenticatorcode + - authenticatorcode + description: The method of ReAuth MFA verification to use. + example: otp + Phone: + name: phone + in: query + required: false + schema: + type: string + format: phone + description: Phone ID of the associated Account. + example: '+1234567890' + SmartLoginEmailTemplate: + name: smartloginemailtemplate + in: query + required: false + schema: + type: string + description: The template name for the smart login Email. + example: Smart-Login-Email-Template + ClientGuidRequired: + name: clientguid + in: query + required: true + schema: + type: string + description: Client GUID for the request. + example: 12345678-1234-1234-1234-123456789012 + PasswordlessLoginTemplate: + name: passwordlesslogintemplate + in: query + required: false + schema: + type: string + description: Passwordless Login Template + example: Passwordless-Login-Template + SessionTokenQuery: + name: session_token + in: query + required: true + schema: + type: string + description: Session Token for PIN Auth + example: 4asdf575-5678-4065-b717-fa0n7i5ca81a + CustomObjectId: + name: customobjectid + in: query + description: Unique identifier for the Custom Object record + required: false + schema: + type: string + example: customObject12 + ObjectName: + name: objectname + in: query + description: Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. + required: false + schema: + type: string + example: customObjectName1 + ObjectRecordId: + name: objectrecordid + in: path + description: Unique identifier for the Custom Object record. The ID is used to target a specific Custom Object. + required: true + schema: + type: string + format: uuid + example: 123e4567-e89b-12d3-a456-426614174000 + UpdateType: + name: updateType + description: | + The type of update to be performed on the Custom Object. This parameter is used to specify whether the update should be a full update or a partial update. + in: query + required: true + schema: + type: string + enum: + - partialreplace + - replace + - default + example: partialreplace + PinAuthTokenQuery: + name: pinauthtoken + in: query + required: true + schema: + type: string + description: Pin auth token to set the PIN on account + example: 6******2-3**8-4**5-8**d-3**********9 + ResetPinURL: + name: resetpinurl + in: query + required: false + schema: + type: string + description: Reset PIN URL + example: https://example.com/resetpin + ConsentToken: + name: consenttoken + in: query + required: true + schema: + type: string + description: The consent token for the User. + example: 8f2e1c3a-ab10-498c-8b12-a5b7c9e18dfc + Event: + name: event + in: query + description: Event type to filter consent verification (e.g., `login`). + required: true + schema: + type: string + example: login + IsCustom: + name: iscustom + in: query + description: This field value is used to filter the consent verification by custom events. The iscustom value should be a boolean. If true, it filters for custom events; if false, it filters for standard events. + required: true + schema: + type: boolean + example: true + InvitationTokenPath: + name: invitation_token + in: path + required: true + description: The token of the invitation to retrieve. + schema: + type: string + example: inv_aH840_snjODabaji + tokenType: + name: tokentype + in: path + description: 'Token purpose: `emailverification`, `forgotpin`, `addemail`, `deleteuser`, `onetouchlogin`, or `autologin`.' + required: true + schema: + type: string + enum: + - emailverification + - forgotpin + - addemail + - deleteuser + - onetouchlogin + - autologin + example: emailverification + smsOtpType: + name: smsotptype + in: path + description: 'OTP purpose: `addphone`, `phoneidverification`, `forgotpassword`, `forgotpin`, `onetouchlogin`, `smartlogin`, `passwordlesslogin`, or `deleteuser`.' + required: true + schema: + type: string + enum: + - addphone + - phoneidverification + - forgotpassword + - forgotpin + - onetouchlogin + - smartlogin + - passwordlesslogin + - deleteuser + example: addphone + UidPathParam: + name: uid + in: path + description: UID of the User + required: true + schema: + type: string + example: 680fada271a140ebc0716144 + ContextName: + name: contextName + in: path + description: Name of the Role Context + required: true + schema: + type: string + example: Home + UidQueryParam: + name: uid + in: query + description: The UID associated with the User + required: true + schema: + type: string + example: 43e4417bd2de4a1fa82445274f864203 + RefreshToken: + name: refresh_token + description: Refresh Token + in: query + required: true + schema: + type: string + description: The refresh token is a long-lived token that can be used to obtain a new Access Token without requiring the User to re-authenticate. It is typically issued alongside the Access Token during the initial authentication process and can be used to refresh the Access Token when it expires. + example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c + UidPath: + name: uid + in: path + description: The UID associated with the User + required: true + schema: + type: string + example: 43e4417bd2de4a1fa82445274f864203 + QParam: + name: q + in: query + required: false + schema: + type: string + description: Query filter in `key:value` format. The key must be an indexed profile field. + example: ID:1234567890 + SendEmail: + name: sendemail + in: query + required: false + schema: + type: string + enum: + - 'true' + - 'false' + description: Indicates whether to send an Email with the forgot Password token. + example: 'true' + VType: + name: vtype + in: query + required: true + schema: + type: string + enum: + - email + description: The type of verification. Currently, only "Email" is supported. + example: email + ExpireIn: + name: expires_in + in: query + required: false + schema: + type: string + description: The expiration time for the token in seconds. + example: '3600' + IsWeb: + name: isweb + in: query + description: Indicates if the request is from a web client + required: false + schema: + type: string + example: 'true' + ExpiresIn: + name: expiresin + in: query + description: |- + Overrides the default lifetime of the Access Token. The unit and the default applied when this parameter is omitted depend on the User's registration profile: + * Email profiles: the value is interpreted in minutes. When omitted, + the Access Token uses the application's configured token expiry. + + * Social login profiles: the value is interpreted in seconds. When omitted, + the Access Token adopts the expiry returned by the social provider, falling + back to the application's configured token expiry if the provider returns none. + required: false + style: form + explode: true + schema: + type: integer + format: int32 + example: 43333 + Token: + name: token + in: query + required: true + schema: + type: string + description: Access Token of the User. + example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c + AccessTokenRequired: + name: access_token + in: query + description: Access Token of the User + required: true + schema: + type: string + example: 1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef + TokenNotRequired: + name: token + in: query + required: false + schema: + type: string + description: Access Token of the User. + example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c + ProfileId: + name: profileid + in: query + description: Account ID of the User + required: false + schema: + type: string + example: 1234567890abcdef + AccountId: + name: accountid + in: query + description: Account ID of the User + required: false + schema: + type: string + example: 1234567890abcdef + NativeProvider: + name: nativeProvider + in: path + description: Indicates the provider for the native application. This parameter is used to specify the authentication provider for the native app. + required: true + schema: + type: string + enum: + - applejwt + - applert + - facebookjwt + - apple + - jwt + - facebook + - foursquare + - google + - googlejwt + - linkedin + - twitter + - wechat + - qq + example: google + SocialAppName: + name: socialappname + in: query + description: Indicates the name of the social application. This parameter is used to specify the social app for which the Access Token is being requested. + required: false + schema: + type: string + example: facebook_1 + RedirectUriOptional: + description: Redirect URI for the OAuth/OIDC callback + example: https://example.com/callback + in: query + name: redirect_uri + required: false + schema: + type: string + format: uri + ProviderName: + name: providername + in: query + description: The name of the provider. This parameter is used to specify the provider for authentication. + required: false + schema: + type: string + example: google + Code: + name: code + in: query + description: The authorization code received from the apple, wechat, qq provider. The parameter is used to exchange the authorization code for an Access Token. + required: false + schema: + type: string + format: uuid + example: 683987c4-9249-4165-b1f1-925f0b84021e + TwitterToken: + name: tw_access_token + in: query + description: The Access Token used for Twitter authentication. The parameter is used to authenticate the User with Twitter. + required: false + schema: + type: string + format: uuid + example: 123e4567-e89b-12d3-a456-426614174000 + TwitterSecret: + name: tw_token_secret + in: query + description: The secret token used for Twitter authentication. The parameter is used to authenticate the User with Twitter. + required: false + schema: + type: string + format: uuid + example: 123e4567-e89b-12d3-a456-426614174000 + GoogleAuthCode: + name: google_authcode + in: query + description: The authorization code received from Google. This parameter is used to exchange the authorization code for an Access Token. + required: false + schema: + type: string + format: uuid + example: 123e4567-e89b-12d3-a456-426614174000 + ClientId: + name: client_id + in: query + required: false + schema: + type: string + description: OIDC application Client ID for request authentication. + example: 1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef + GoogleAccessToken: + name: google_access_token + in: query + description: The Access Token received from Google. The parameter is used to authenticate the User with Google services. + required: false + schema: + type: string + format: uuid + example: 123e4567-e89b-12d3-a456-426614174000 + IdToken: + name: id_token + in: query + description: The ID token used for googlejwt, facebookjwt, applejwt authentication. The parameter is used to verify the User's identity. + required: false + schema: + type: string + format: uuid + example: 123e4567-e89b-12d3-a456-426614174000 + FourSquareAccessToken: + name: fs_access_token + in: query + description: The Access Token used for Foursquare authentication. The parameter is used to authenticate the User with Foursquare. + required: false + schema: + type: string + format: uuid + example: 123e4567-e89b-12d3-a456-426614174000 + LinkedInAccessToken: + name: ln_access_token + in: query + description: The Access Token used for LinkedIn authentication. The parameter is used to authenticate the User with LinkedIn. + required: false + schema: + type: string + format: uuid + example: 123e4567-e89b-12d3-a456-426614174000 + FacebookAccessToken: + name: fb_access_token + in: query + description: The Access Token used for Facebook authentication. The parameter is used to authenticate the User with Facebook. + required: false + schema: + type: string + format: uuid + example: 123e4567-e89b-12d3-a456-426614174000 + InvitationId: + name: invitationid + in: path + required: true + schema: + type: string + example: inv_123456789 + description: The ID of the invitation. The ID is typically in the format *inv_*, where ** is a string of alphanumeric characters. + InvitationUrl: + name: invitation_url + in: query + schema: + type: string + example: https://example.com/accept-invite + description: The URL to which the User will be redirected after accepting the invitation. This URL should be a valid URL and can include query parameters if needed. + orgId: + description: Organization ID + in: path + name: orgId + required: true + schema: + type: string + example: org_1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef + connId: + description: Organization Connection ID + in: path + name: connId + required: true + schema: + type: string + example: conn_1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef + groupRoleId: + description: Organization Connection Group Role ID + in: path + name: groupRoleId + required: true + schema: + type: string + example: group_role_1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef + domainId: + description: Organization Domain ID + in: path + name: domainId + required: true + schema: + type: string + example: org_domain_1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef + permissionId: + name: id + in: path + description: The unique identifier for the Permission + required: true + schema: + type: string + example: perm_2enk23n3 + roleId: + name: id + in: path + description: Role ID + required: true + schema: + type: string + example: role_2enk23n3 + Uid: + name: uid + in: path + description: UID of the User + required: true + schema: + type: string + example: '123456789' + WorkflowId: + name: workflowId + in: path + required: true + description: The ID of the workflow. + schema: + type: string + example: 1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef + Version: + name: version + in: path + required: true + schema: + type: string + description: The version identifier to delete. + example: v1.0.0 + HookId: + name: hookId + in: path + required: true + schema: + type: string + description: Webhook ID + example: 1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef + SmsTemplateType: + name: templateType + in: path + required: true + description: The type of SMS template to delete. + schema: + type: string + enum: + - verification + - forgotpassword + - welcome + - changephoneno + - onetimepasscode + - secondfactorauthentication + - noregistrationpasswordlesslogin + - resetpassword + - suspicious_ip_sms_to_user + - suspicious_city_sms_to_user + - suspicious_country_sms_to_user + - suspicious_browser_sms_to_user + - suspicious_device_sms_to_user + - forgotpin + - deleteuser + - breached_password + example: verification + SecurityQuestionId: + name: securityQuestionID + in: path + required: true + schema: + type: string + example: 1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef + EmailTemplateType: + name: templateType + in: path + required: true + description: The type of Email template to delete. + schema: + type: string + enum: + - registration + - forgotpassword + - forgotprovider + - deleteaccount + - add_email + - welcome + - oneclicksignin + - autologin + - noregistrationpasswordlesslogin + - resetpassword + - suspicious_ip_email_to_user + - suspicious_city_email_to_user + - suspicious_country_email_to_user + - suspicious_browser_email_to_user + - risk_identified_to_admin + - forgotpin + - secondfactorauthentication + - invite_user_to_organization + - suspicious_device_email_to_user + - breached_password + - admin_notification_breached_password + - add_passkey + - delete_passkey + - forget_passkey + example: registration + ProviderNamePath: + name: provider + in: path + required: true + schema: + type: string + enum: + - FACEBOOK + - GOOGLE + - YAHOO + - LIVE + - TWITTER + - LINKEDIN + - FOURSQUARE + - QQ + - GITHUB + - PAYPAL + - SINAWEIBO + - WECHAT + - APPLE + - SALESFORCE + - AMAZON + description: Provider Name + example: FACEBOOK + jwtApp: + name: jwtApp + in: path + description: The jwt App identifier + required: true + schema: + type: string + example: 1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef + samlApp: + name: samlApp + in: path + description: The SAML App identifier + required: true + schema: + type: string + example: my-saml-app + integrationId: + name: integrationId + in: path + description: The OAuth integration identifier. It is the integration's OAuth application name, so the same value is the {oAuthApp} path segment of the runtime OAuth/OIDC endpoints (e.g. /api/oidc/{integrationId}/token). + required: true + schema: + type: string + example: 9f2c14b7a83d4e6bb0517c8e2d3a6f45 + CustomFieldsName: + name: cfname + in: path + required: true + schema: + type: string + example: custom_field_name + description: Custom Fields Name + example: custom_field_name + oAuthClientName: + description: Name of the OAuth Client + in: path + name: oAuthClientName + required: true + schema: + type: string + example: my-oauth-client + Next: + name: next + in: query + description: | + Scroll or pagination token for fetching the next set of results. This token is used to retrieve the next page of results in a paginated response. + If not provided, the API will return the first page of results. + schema: + type: string + example: DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAABXcWem... + required: false + examples: + example1: + value: DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAABXcWem... + Region: + name: region + in: query + description: The region to filter results by. + schema: + type: string + example: us-east-1 + required: false + examples: + us-east-1: + value: us-east-1 + CustomObject: + name: customobject + in: query + description: | + Custom Object identifier for filtering results. This parameter allows you to specify a Custom Object to filter the results returned by the API. + schema: + type: string + required: false + example: customObject123,customObject456 + JwtAppName: + description: JWT App Name + example: example_jwt_app + in: path + name: JwtAppName + required: true + schema: + type: string + Nonce: + description: random nonce claim + example: 3f444945100b4730810bf4598841769d + in: query + name: Nonce + schema: + type: string + OAuthAppName: + description: OAuth App Name + example: example_oauth_app + in: path + name: OAuthAppName + required: true + schema: + type: string + OIDCAppName: + description: OIDC App Name + example: example_oidc_app + in: path + name: OIDCAppName + required: true + schema: + type: string + OAuthDynamicClientId: + name: clientID + in: path + required: true + description: The client_id of the dynamically registered OAuth client. + schema: + type: string + example: abc123def456 + SamlAppName: + description: Saml App Name + example: example_saml_app + in: query + name: appName + required: true + schema: + type: string + CodeExpiryTTL: + description: Code Expiry time (in second) in second, Min:0, Max:300 + example: '30' + in: query + name: expiry + schema: + type: string + default: '60' + QRCode: + description: QR Code By Generate QR Code API + example: MzUwOTczMDAtODM0MC00Y2FkLWE3MDgtNmY2ZDRiMDA4NjZlIzIwMjEtMTItMjlUMTc6NDk6MjIuNDY0Wg== + in: query + name: code + schema: + type: string + OptionId: + name: optionId + in: path + required: true + schema: + type: string + description: The ID of the Consent option to delete. + example: sms_consent_12 + FormVersion: + name: version + in: path + required: true + schema: + type: string + description: The version of the Consent form to delete. + example: '3' + BigCommerceCode: + name: code + in: query + description: BigCommerce OAuth authorization code + required: false + schema: + type: string + example: abc123def456 + BigCommerceSignedPayload: + name: signed_payload + in: query + description: BigCommerce signed payload for load/uninstall callbacks + required: false + schema: + type: string + example: eyJhbGciOiJIUzI1NiJ9... + BigCommerceStore: + name: store + in: query + description: BigCommerce store hash identifier + required: true + schema: + type: string + example: abc123 + PasswordQuery: + name: password + in: query + description: User's password + required: false + schema: + type: string + example: MyPassword123 + ReturnUrl: + name: return_url + in: query + description: URL to redirect the user to after login + required: false + schema: + type: string + example: https://example.com/dashboard + ShopifyStore: + name: store + in: query + description: Shopify store domain (e.g., mystore.myshopify.com) + required: true + schema: + type: string + example: mystore.myshopify.com + PerfectMindSiteName: + name: perfectmindsitename + in: query + description: PerfectMind site name identifier + required: true + schema: + type: string + example: mysite + BirthDate: + name: birthdate + in: query + description: User's birth date for PerfectMind contact lookup + required: false + schema: + type: string + example: '1990-01-15' + PerfectScanID: + name: perfectScanID + in: query + description: PerfectMind scan ID for contact lookup + required: false + schema: + type: string + example: scan123 + schemas: + CaptchaModel: + type: object + properties: + g-recaptcha-response: + type: string + description: The Google reCAPTCHA response which is sent to the server for verification. + nullable: true + example: 03AGdBq24... + qq_captcha_ticket: + type: string + description: The QQ Captcha ticket which is sent to the server for verification. + example: 03AGdBq24... + nullable: true + qq_captcha_randstr: + type: string + description: The QQ Captcha random string which is sent to the server for verification. + example: 03AGdBq24... + nullable: true + h-captcha-response: + type: string + description: The hCaptcha response which is sent to the server for verification. + example: 03AGdBq24... + nullable: true + ResetPasswordByResetTokenCore: + type: object + properties: + ResetToken: + type: string + description: The reset token received via Email. + example: xxxxxxxxxxxxxxxxxxxx + Password: + type: string + description: The new Password for the Account. + example: new_secure_password + welcomeemailtemplate: + type: string + description: Optional welcome Email template. + example: welcome_template + ResetPasswordEmailTemplate: + type: string + description: Optional reset Password Email template. + example: reset_password_template + SecurityAnswer: + type: object + additionalProperties: + type: string + nullable: true + description: A map of security question keys and their corresponding answers. + required: + - ResetToken + - Password + ResetPasswordByEmailOtpCore: + type: object + properties: + otp: + type: string + description: One-time passcode sent to the User's Email. + example: '123456' + email: + type: string + format: email + description: User's Email address. + example: user@example.com + Password: + type: string + description: The new Password for the Account. + example: new_secure_password + welcomeemailtemplate: + type: string + description: Optional welcome Email template. + example: welcome_template + ResetPasswordEmailTemplate: + type: string + description: Optional reset Password Email template. + example: reset_password_template + SecurityAnswer: + type: object + additionalProperties: + type: string + nullable: true + description: A map of security question keys and their corresponding answers. + required: + - otp + - email + - Password + ResetPasswordByUsernameOtpCore: + type: object + properties: + otp: + type: string + description: One-Time Password for verification. + example: '123456' + username: + type: string + description: Username of the Account. + example: user123 + Password: + type: string + description: The new Password for the Account. + example: new_secure_password + welcomeemailtemplate: + type: string + description: Optional welcome Email template. + example: welcome_template + ResetPasswordEmailTemplate: + type: string + description: Optional reset Password Email template. + example: reset_password_template + SecurityAnswer: + type: object + additionalProperties: + type: string + nullable: true + description: A map of security question keys and their corresponding answers. + required: + - otp + - username + - Password + ResetPassword: + oneOf: + - allOf: + - $ref: '#/components/schemas/CaptchaModel' + - $ref: '#/components/schemas/ResetPasswordByResetTokenCore' + - allOf: + - $ref: '#/components/schemas/CaptchaModel' + - $ref: '#/components/schemas/ResetPasswordByEmailOtpCore' + - allOf: + - $ref: '#/components/schemas/CaptchaModel' + - $ref: '#/components/schemas/ResetPasswordByUsernameOtpCore' + SocialIdentity: + type: object + properties: + TokenSignSecret: + type: integer + example: 12345 + FirstLogin: + type: boolean + example: true + IsProtected: + type: boolean + example: false + Hireable: + type: boolean + example: true + FollowersCount: + type: integer + example: 1250 + FriendsCount: + type: integer + example: 458 + TotalStatusesCount: + type: integer + example: 2341 + NumRecommenders: + type: integer + example: 15 + TotalPrivateRepository: + type: integer + example: 8 + PublicGists: + type: integer + example: 23 + PrivateGists: + type: integer + example: 5 + PinsCount: + type: integer + example: 67 + BoardsCount: + type: integer + example: 12 + LikesCount: + type: integer + example: 892 + SessionLimit: + type: integer + example: 10 + ID: + type: string + example: usr_12345abc + Provider: + type: string + example: facebook + FullName: + type: string + nullable: true + example: John Robert Smith + FirstName: + type: string + example: John + LastName: + type: string + example: Smith + PhoneId: + type: string + example: +1-555-123-4567 + Prefix: + type: string + example: Mr. + MiddleName: + type: string + example: Robert + Suffix: + type: string + example: Jr. + NickName: + type: string + example: Johnny + ProfileName: + type: string + example: johnsmith + BirthDate: + type: string + example: '1990-05-15' + Gender: + type: string + example: male + Website: + type: string + example: https://www.johnsmith.com + ThumbnailImageUrl: + type: string + example: https://example.com/thumbnails/john.jpg + ImageUrl: + type: string + example: https://example.com/images/john.jpg + Favicon: + type: string + example: https://example.com/favicon.ico + ProfileUrl: + type: string + example: https://example.com/profile/johnsmith + HomeTown: + type: string + example: Boston + State: + type: string + example: Massachusetts + City: + type: string + example: Cambridge + Industry: + type: string + example: Technology + About: + type: string + example: Passionate software developer with 10+ years of experience + TimeZone: + type: string + example: America/New_York + LocalLanguage: + type: string + example: en-US + CoverPhoto: + type: string + example: https://example.com/cover/john.jpg + TagLine: + type: string + example: Building the future through code + Language: + type: string + example: English + Verified: + type: string + example: 'true' + UpdatedTime: + type: string + example: '2024-03-20T15:30:00Z' + IsGeoEnabled: + type: string + example: 'true' + Associations: + type: string + example: IEEE, ACM + Honors: + type: string + example: Best Developer Award 2023 + HttpsImageUrl: + type: string + example: https://example.com/secure/images/john.jpg + MainAddress: + type: string + example: 123 Tech Street, Cambridge, MA 02142 + Created: + type: string + example: '2020-01-15T10:00:00Z' + LocalCity: + type: string + example: Cambridge + ProfileCity: + type: string + example: Cambridge + LocalCountry: + type: string + example: United States + ProfileCountry: + type: string + example: United States + RelationshipStatus: + type: string + example: Married + Quota: + type: string + example: '1000' + Quote: + type: string + example: Stay hungry, stay foolish + Religion: + type: string + example: Private + Political: + type: string + example: Private + PublicRepository: + type: string + example: '25' + RepositoryUrl: + type: string + example: https://github.com/johnsmith + Age: + type: string + example: '33' + ProfessionalHeadline: + type: string + example: Senior Software Engineer at Tech Corp + LRUserID: + type: string + example: LR123456 + Currency: + type: string + example: USD + StarredUrl: + type: string + example: https://github.com/johnsmith?tab=stars + GistsUrl: + type: string + example: https://gist.github.com/johnsmith + Company: + type: string + example: Tech Corp + GravatarImageUrl: + type: string + example: https://gravatar.com/avatar/123456 + CreatedDate: + type: string + format: date-time + example: '2020-01-15T10:00:00Z' + ModifiedDate: + type: string + format: date-time + example: '2024-03-20T15:30:00Z' + ProfileModifiedDate: + type: string + format: date-time + example: '2024-03-19T12:00:00Z' + LastLoginDate: + type: string + format: date-time + example: '2024-03-20T16:45:00Z' + SignupDate: + type: string + format: date-time + example: '2020-01-15T10:00:00Z' + Country: + type: object + nullable: true + properties: + Name: + type: string + example: United States + Code: + type: string + example: US + AgeRange: + type: object + nullable: true + properties: + Min: + type: integer + example: 30 + Max: + type: integer + example: 35 + KloutScore: + type: object + nullable: true + properties: + KloutId: + type: string + example: klout123456 + Score: + type: integer + example: 75 + Suggestions: + type: object + nullable: true + properties: + SuggestedFriends: + type: array + nullable: true + items: + type: string + example: + - user123 + - user456 + - user789 + Subscription: + type: object + nullable: true + properties: + Name: + type: string + example: Pro Plan + Space: + type: string + example: 100GB + PrivateRepos: + type: string + example: '50' + Collaborators: + type: string + example: '10' + ProviderAccessCredential: + type: object + nullable: true + properties: + AccessToken: + type: string + example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... + TokenSecret: + type: string + example: abc123def456... + ProfileImageUrls: + type: object + nullable: true + additionalProperties: + type: string + example: + small: https://example.com/images/small.jpg + medium: https://example.com/images/medium.jpg + large: https://example.com/images/large.jpg + WebProfiles: + type: object + nullable: true + additionalProperties: + type: string + example: + linkedin: https://linkedin.com/in/johnsmith + twitter: https://twitter.com/johnsmith + PreviousUids: + type: array + nullable: true + items: + type: string + example: + - old_id_123 + - old_id_456 + InterestedIn: + type: array + nullable: true + items: + type: string + example: + - Technology + - Innovation + - AI + Positions: + type: array + nullable: true + items: + type: object + nullable: true + properties: + Position: + type: string + example: Senior Software Engineer + Summary: + type: string + example: Leading backend development team + StartDate: + type: string + format: date-time + example: '2022-01-15T00:00:00Z' + EndDate: + type: string + format: date-time + example: '2024-03-20T00:00:00Z' + IsCurrent: + type: boolean + example: true + Company: + type: object + nullable: true + properties: + Name: + type: string + example: Tech Corp + Type: + type: string + example: Public Company + Industry: + type: string + example: Software Development + Comapny: + type: object + nullable: true + properties: + Name: + type: string + example: Tech Corp + Type: + type: string + example: Public Company + Industry: + type: string + example: Software Development + Educations: + type: array + nullable: true + items: + type: object + nullable: true + properties: + School: + type: string + example: MIT + Year: + type: string + example: '2012' + Type: + type: string + example: Bachelor's + Notes: + type: string + example: Computer Science Major + Activities: + type: string + example: Robotics Club, Coding Competition + Degree: + type: string + example: BS Computer Science + FieldOfStudy: + type: string + example: Computer Science + StartDate: + type: string + format: date-time + example: '2008-09-01T00:00:00Z' + EndDate: + type: string + format: date-time + example: '2012-05-30T00:00:00Z' + PhoneNumbers: + type: array + nullable: true + items: + type: object + nullable: true + properties: + PhoneType: + type: string + example: Mobile + PhoneNumber: + type: string + example: +1-555-123-4567 + op: + type: string + example: add + IMAccounts: + type: array + nullable: true + items: + type: object + nullable: true + properties: + AccountType: + type: string + example: Skype + AccountName: + type: string + example: johnsmith_skype + Addresses: + type: array + nullable: true + items: + type: object + nullable: true + properties: + Type: + type: string + example: Home + AddressType: + type: string + example: Primary + Address1: + type: string + example: 123 Tech Street + Address2: + type: string + example: Apt 4B + City: + type: string + example: Cambridge + State: + type: string + example: MA + PostalCode: + type: string + example: '02142' + Region: + type: string + example: New England + Op: + type: string + example: add + Country: + type: string + example: USA + Interests: + type: array + nullable: true + items: + type: object + nullable: true + properties: + InterestType: + type: string + example: Professional + InterestName: + type: string + example: Software Architecture + Sports: + type: array + nullable: true + items: + type: object + nullable: true + properties: + Id: + type: string + example: sport_123 + Name: + type: string + example: Basketball + InspirationalPeople: + type: array + nullable: true + items: + type: object + nullable: true + properties: + Name: + type: string + example: Linus Torvalds + Id: + type: string + example: person_123 + Awards: + type: array + nullable: true + items: + type: object + nullable: true + properties: + Id: + type: string + example: award_123 + Name: + type: string + example: Best Developer Award + Issuer: + type: string + example: Tech Conference 2023 + Skills: + type: array + nullable: true + items: + type: object + nullable: true + properties: + Id: + type: string + example: skill_123 + Name: + type: string + example: Python Programming + CurrentStatus: + type: array + nullable: true + items: + type: object + nullable: true + properties: + Id: + type: string + example: status_123 + Text: + type: string + example: Working on exciting new project + Source: + type: string + example: LinkedIn + CreatedDate: + type: string + format: date-time + example: '2024-03-20T15:30:00Z' + Certifications: + type: array + nullable: true + items: + type: object + nullable: true + properties: + Id: + type: string + example: cert_123 + Name: + type: string + example: AWS Certified Solutions Architect + Authority: + type: string + example: Amazon Web Services + Number: + type: string + example: CERT123456 + StartDate: + type: string + format: date-time + example: '2023-01-15T00:00:00Z' + EndDate: + type: string + format: date-time + example: '2026-01-15T00:00:00Z' + Courses: + type: array + nullable: true + items: + type: object + nullable: true + properties: + Id: + type: string + example: course_123 + Name: + type: string + example: Advanced Machine Learning + Number: + type: string + example: CS701 + Volunteer: + type: array + nullable: true + items: + type: object + nullable: true + properties: + Organization: + type: string + example: Code for America + Role: + type: string + example: Technical Mentor + Cause: + type: string + example: Education + Id: + type: string + example: vol_123 + RecommendationsReceived: + type: array + nullable: true + items: + type: object + nullable: true + properties: + Id: + type: string + example: rec_123 + Recommender: + type: string + example: Jane Doe + RecommendationText: + type: string + example: Excellent team player and technical leader + RecommendationType: + type: string + example: Professional + Languages: + type: array + nullable: true + items: + type: object + nullable: true + properties: + Id: + type: string + example: lang_123 + Name: + type: string + example: English + Proficiency: + type: string + example: Native + op: + type: string + example: add + Projects: + type: array + nullable: true + items: + type: object + nullable: true + properties: + Id: + type: string + example: proj_123 + Name: + type: string + example: AI-Powered Analytics Platform + Summary: + type: string + example: Led development of machine learning analytics solution + StartDate: + type: string + format: date-time + example: '2023-01-01T00:00:00Z' + EndDate: + type: string + format: date-time + example: '2024-01-01T00:00:00Z' + IsCurrent: + type: string + example: 'true' + With: + type: array + nullable: true + items: + type: object + nullable: true + properties: + Id: + type: string + example: user_123 + Name: + type: string + example: Jane Doe + Games: + type: array + nullable: true + items: + type: object + nullable: true + properties: + Id: + type: string + example: game_123 + Category: + type: string + example: Strategy + Name: + type: string + example: Chess + CreatedDate: + type: string + format: date-time + example: '2024-01-15T10:30:00Z' + Family: + type: array + nullable: true + items: + type: object + nullable: true + properties: + Id: + type: string + example: fam_123 + Name: + type: string + example: Jane Smith + Relationship: + type: string + example: Spouse + TelevisionShow: + type: array + nullable: true + items: + type: object + nullable: true + properties: + Id: + type: string + example: show_123 + Category: + type: string + example: Science Fiction + Name: + type: string + example: Black Mirror + CreatedDate: + type: string + format: date-time + example: '2024-01-15T10:30:00Z' + MutualFriends: + type: array + nullable: true + items: + type: object + nullable: true + properties: + Id: + type: string + example: friend_123 + Name: + type: string + example: Alice Johnson + FirstName: + type: string + example: Alice + LastName: + type: string + example: Johnson + Birthday: + type: string + format: date-time + example: '1992-05-15T00:00:00Z' + Hometown: + type: string + example: Chicago + Link: + type: string + example: https://example.com/profile/alice + Gender: + type: string + example: female + Movies: + type: array + nullable: true + items: + type: object + nullable: true + properties: + MovieName: + type: string + example: The Matrix + Genre: + type: string + example: Science Fiction + Books: + type: array + nullable: true + items: + type: object + nullable: true + properties: + Id: + type: string + example: book_123 + Category: + type: string + example: Technology + Name: + type: string + example: Clean Code + CreatedDate: + type: string + example: '2024-01-15' + Patents: + type: array + nullable: true + items: + type: object + nullable: true + properties: + Id: + type: string + example: pat_123 + Title: + type: string + example: Novel Machine Learning Algorithm + Date: + type: string + example: '2023-06-15' + FavoriteThings: + type: array + nullable: true + items: + type: object + nullable: true + properties: + Id: + type: string + example: fav_123 + Name: + type: string + example: Programming + Type: + type: string + example: Hobby + RelatedProfileViews: + type: array + nullable: true + items: + type: object + nullable: true + properties: + FirstName: + type: string + example: Sarah + LastName: + type: string + example: Connor + Id: + type: string + example: view_123 + PlacesLived: + type: array + nullable: true + items: + type: object + nullable: true + properties: + Name: + type: string + example: San Francisco + Operation: + type: string + example: add + IsPrimary: + type: boolean + example: true + Publications: + type: array + nullable: true + items: + type: object + nullable: true + properties: + Title: + type: string + example: Modern Software Architecture + Publisher: + type: string + example: Tech Publishing House + Date: + type: string + format: date-time + example: '2023-08-15T00:00:00Z' + Id: + type: string + example: pub_123 + Url: + type: string + example: https://example.com/publications/123 + Summary: + type: string + example: A comprehensive guide to modern software architecture + Authors: + type: array + nullable: true + items: + type: object + nullable: true + properties: + Id: + type: string + example: author_123 + Name: + type: string + example: John Smith + JobBookmarks: + type: array + nullable: true + items: + type: object + nullable: true + properties: + IsApplied: + type: boolean + example: true + IsSaved: + type: boolean + example: true + ApplyTimestamp: + type: string + format: date-time + example: '2024-02-15T14:30:00Z' + SavedTimestamp: + type: string + format: date-time + example: '2024-02-14T10:00:00Z' + Job: + type: object + nullable: true + properties: + Active: + type: boolean + example: true + Id: + type: string + example: job_123 + DescriptionSnippet: + type: string + example: Senior Role in cloud architecture + PostingTimestamp: + type: string + format: date-time + example: '2024-02-01T09:00:00Z' + Compony: + type: object + nullable: true + properties: + Id: + type: string + example: comp_123 + Name: + type: string + example: Tech Corp + Position: + type: object + nullable: true + properties: + Title: + type: string + example: Senior Cloud Architect + Badges: + type: array + nullable: true + items: + type: object + nullable: true + properties: + BadgeId: + type: string + example: badge_123 + BageId: + type: string + example: badge_123 + Name: + type: string + example: Top Contributor + BadgeMessage: + type: string + example: Awarded for exceptional contributions + BageMessage: + type: string + example: Awarded for exceptional contributions + Description: + type: string + example: Recognition for community support + ImageUrl: + type: string + example: https://example.com/badges/top-contributor.png + MemberUrlResources: + type: array + nullable: true + items: + type: object + nullable: true + properties: + UrlName: + type: string + example: Portfolio + Url: + type: string + example: https://johnsmith.dev + Email: + type: array + nullable: true + items: + type: object + nullable: true + properties: + Type: + type: string + example: Primary + Value: + type: string + example: john.smith@example.com + Profile: + type: object + properties: + IsPasswordBreached: + type: boolean + description: Indicates if the Password has been breached. + example: false + IsActive: + type: boolean + description: Indicates if the User Account is active. + example: true + IsDeleted: + type: boolean + description: Indicates if the User Account is deleted. + example: false + EmailVerified: + type: boolean + description: Indicates if the User's Email is verified. + example: true + IsLoginLocked: + type: boolean + description: Indicates if the User's login is locked. + example: false + IsRequiredFieldsFilledOnce: + type: boolean + description: Indicates if required fields have been filled at least once. + example: true + FirstLogin: + type: boolean + description: Indicates if this is the User's first login. + example: true + nullable: true + IsProtected: + type: boolean + description: Indicates if the User Account is protected. + example: false + Hireable: + type: boolean + description: Indicates if the User is hireable. + example: true + IsSecurePassword: + type: boolean + description: Indicates if the Password is secure. + nullable: true + example: true + IsCustomUid: + type: boolean + description: Indicates if the UID is custom. + example: false + PhoneIdVerified: + type: boolean + description: Indicates if the Phone ID is verified. + example: true + IsEmailSubscribed: + type: boolean + description: Indicates if the User is subscribed to emails. + example: true + NoOfLogins: + type: integer + description: Number of logins by the User. + example: 10 + FollowersCount: + type: integer + description: Number of followers the User has. + example: 1250 + FriendsCount: + type: integer + description: Number of friends the User has. + example: 458 + TotalStatusesCount: + type: integer + description: Total number of statuses posted by the User. + example: 2341 + NumRecommenders: + type: integer + description: Number of recommenders for the User. + example: 15 + TotalPrivateRepository: + type: integer + description: Total number of private repositories. + example: 8 + PublicGists: + type: integer + description: Total number of public gists. + example: 23 + PrivateGists: + type: integer + description: Total number of private gists. + example: 5 + PinsCount: + type: integer + description: Total number of PINs. + example: 67 + BoardsCount: + type: integer + description: Total number of boards. + example: 12 + LikesCount: + type: integer + description: Total number of likes. + example: 892 + SessionLimit: + type: integer + example: 5 + ID: + type: string + description: Unique identifier for the User Profile. + example: usr_12345abc + Password: + type: string + example: '********' + LoginLockedType: + type: string + example: None + Provider: + type: string + description: Provider of the User Profile. + example: facebook + LastPasswordChangeToken: + type: string + example: tkn_abc123xyz + FullName: + type: string + description: Full name of the User. + nullable: true + example: John Robert Smith + FirstName: + type: string + nullable: true + description: First name of the User. + example: John + LastName: + type: string + nullable: true + description: Last name of the User. + example: Smith + RegistrationProvider: + type: string + example: google + RegistrationSource: + type: string + example: web + LastLoginLocation: + type: string + example: New York, USA + ExternalUserLoginId: + type: string + example: ext_789xyz + PhoneId: + type: string + description: Phone ID of the User. + example: +1-555-123-4567 + nullable: true + UserName: + type: string + nullable: true + description: The Username of the User. + example: john_doe + Prefix: + type: string + nullable: true + description: The prefix for the User's name. + example: Mr. + MiddleName: + type: string + description: The middle name of the User. + example: Robert + nullable: true + Suffix: + type: string + nullable: true + description: The suffix for the User's name. + example: Jr. + NickName: + type: string + nullable: true + description: The nickname of the User. + example: Johnny + ProfileName: + type: string + nullable: true + description: The profile name of the User. + example: johnsmith + BirthDate: + type: string + nullable: true + description: The birth date of the User. + example: '1990-05-15' + Gender: + type: string + nullable: true + description: The gender of the User. + example: male + Website: + type: string + nullable: true + description: The website of the User. + example: https://www.johnsmith.com + ThumbnailImageUrl: + type: string + nullable: true + description: The URL of the User's thumbnail image. + example: https://example.com/thumbnails/john.jpg + ImageUrl: + type: string + nullable: true + description: The URL of the User's profile image. + example: https://example.com/images/john.jpg + Favicon: + type: string + nullable: true + description: The URL of the User's favicon. + example: https://example.com/favicon.ico + ProfileUrl: + type: string + nullable: true + description: The URL of the User's profile. + example: https://example.com/profile/johnsmith + HomeTown: + type: string + nullable: true + description: The hometown of the User. + example: Boston + State: + type: string + nullable: true + description: The state of the User. + example: Massachusetts + City: + type: string + nullable: true + description: The city of the User. + example: Cambridge + Industry: + type: string + nullable: true + description: The industry of the User. + example: Technology + About: + type: string + nullable: true + description: A brief description about the User. + example: Passionate software developer with 10+ years of experience + TimeZone: + type: string + nullable: true + description: The time zone of the User. + example: America/New_York + LocalLanguage: + type: string + nullable: true + description: The local language of the User. + example: en-US + CoverPhoto: + type: string + nullable: true + description: The URL of the User's cover photo. + example: https://example.com/cover/john.jpg + TagLine: + type: string + nullable: true + description: The tagline of the User. + example: Building the future through code + Language: + type: string + nullable: true + description: The language of the User. + example: English + Verified: + type: string + description: Indicates if the User is verified. + example: 'true' + nullable: true + UpdatedTime: + type: string + nullable: true + description: The last updated time of the User's profile. + example: '2024-03-20T15:30:00Z' + IsGeoEnabled: + type: string + nullable: true + description: Indicates if geolocation is enabled for the User. + example: 'true' + Associations: + type: string + nullable: true + description: The associations of the User. + example: IEEE, ACM + Honors: + type: string + nullable: true + description: The honors received by the User. + example: Best Developer Award 2023 + HttpsImageUrl: + type: string + nullable: true + description: The HTTPS URL of the User's profile image. + example: https://example.com/secure/images/john.jpg + MainAddress: + nullable: true + type: string + description: The main address of the User. + example: 123 Tech Street, Cambridge, MA 02142 + Created: + nullable: true + type: string + description: The creation date of the User's account. + example: '2020-01-15T10:00:00Z' + LocalCity: + nullable: true + type: string + description: The local city of the User. + example: Cambridge + ProfileCity: + nullable: true + type: string + description: The profile city of the User. + example: Cambridge + LocalCountry: + type: string + nullable: true + description: The local country of the User. + example: United States + ProfileCountry: + type: string + nullable: true + description: The profile country of the User. + example: United States + RelationshipStatus: + type: string + nullable: true + description: The relationship status of the User. + example: Married + Quota: + type: string + nullable: true + description: The quota assigned to the User. + example: '1000' + Quote: + type: string + nullable: true + description: A quote associated with the User. + example: Stay hungry, stay foolish + Religion: + type: string + nullable: true + description: The religion of the User. + example: Private + Political: + type: string + nullable: true + description: The political views of the User. + example: Private + PublicRepository: + type: string + nullable: true + description: The number of public repositories owned by the User. + example: '25' + RepositoryUrl: + type: string + nullable: true + description: The URL of the User's repository. + example: https://github.com/johnsmith + Age: + type: string + description: The age of the User. + example: '33' + nullable: true + ProfessionalHeadline: + type: string + nullable: true + description: The professional headline of the User. + example: Senior Software Engineer at Tech Corp + LRUserID: + type: string + nullable: true + description: The LoginRadius User ID. + example: LR123456 + Currency: + type: string + nullable: true + description: The preferred currency of the User. + example: USD + StarredUrl: + type: string + nullable: true + description: The URL of the User's starred items. + example: https://github.com/johnsmith?tab=stars + GistsUrl: + type: string + nullable: true + description: The URL of the User's gists. + example: https://gist.github.com/johnsmith + Company: + type: string + nullable: true + description: The company the User is associated with. + example: Tech Corp + GravatarImageUrl: + type: string + nullable: true + description: The URL of the User's Gravatar image. + example: https://gravatar.com/avatar/123456 + LastPasswordChangeDate: + nullable: true + type: string + format: date-time + description: The date of the last Password change. + example: '2024-03-15T10:00:00Z' + PasswordExpirationDate: + type: string + format: date-time + nullable: true + description: The expiration date of the Password. + example: '2024-06-15T10:00:00Z' + CreatedDate: + type: string + format: date-time + description: The date the Account was created. + example: '2020-01-15T10:00:00Z' + ModifiedDate: + type: string + format: date-time + description: The date the Account was last modified. + example: '2024-03-20T15:30:00Z' + ProfileModifiedDate: + type: string + format: date-time + nullable: true + description: The date the Profile was last modified. + example: '2024-03-19T12:00:00Z' + LastLoginDate: + nullable: true + type: string + format: date-time + description: The date of the last login. + example: '2024-03-20T16:45:00Z' + SignupDate: + type: string + format: date-time + description: The date the User signed up. + example: '2020-01-15T10:00:00Z' + PrivacyPolicy: + type: object + nullable: true + properties: + Version: + type: string + description: The version of the Privacy Policy. + example: '1.0' + AcceptSource: + type: string + description: The source of the Privacy Policy acceptance. + example: Web + AcceptDateTime: + type: string + format: date-time + description: The date and time of Privacy Policy acceptance. + example: '2024-03-20T15:30:00Z' + Country: + type: object + nullable: true + properties: + Code: + type: string + description: The country code. + example: US + Name: + type: string + description: The country name. + example: United States + AgeRange: + type: object + nullable: true + properties: + Min: + type: integer + description: The minimum age in the range. + example: 18 + Max: + type: integer + description: The maximum age in the range. + example: 35 + KloutScore: + type: object + nullable: true + properties: + KloutId: + type: string + description: The Klout ID. + example: klout_12345 + Score: + type: number + format: float + description: The Klout score. + example: 75.5 + Suggestions: + type: object + nullable: true + properties: + CompaniesToFollow: + type: array + description: List of companies suggested to follow. + items: + type: object + properties: + Id: + type: string + nullable: true + description: The unique identifier. + example: company_12345 + Name: + type: string + nullable: true + description: The name of the company. + example: Tech Corp + IndustriesToFollow: + type: array + description: List of industries suggested to follow. + items: + type: object + properties: + Id: + type: string + nullable: true + description: The unique identifier. + example: industry_12345 + Name: + type: string + nullable: true + description: The name of the industry. + example: Software Development + NewssourceToFollow: + type: array + description: List of news sources suggested to follow. + items: + type: object + properties: + Id: + type: string + nullable: true + description: The unique identifier. + example: news_12345 + Name: + type: string + nullable: true + description: The name of the news source. + example: Tech News Daily + PeopleToFollow: + type: array + description: List of people suggested to follow. + items: + type: object + properties: + Id: + type: string + nullable: true + description: The unique identifier. + example: person_12345 + Name: + type: string + nullable: true + description: The name of the person. + example: John Doe + Subscription: + type: object + nullable: true + properties: + Name: + type: string + description: The name of the subscription. + example: Pro Plan + Space: + type: string + description: The allocated space for the subscription. + example: 100GB + PrivateRepos: + type: string + description: The number of private repositories allowed. + example: '50' + Collaborators: + type: string + description: The number of collaborators allowed. + example: '10' + PIN: + type: object + nullable: true + properties: + Skipped: + type: boolean + description: Indicates if the PIN setup was skipped. + example: false + PIN: + type: string + description: The PIN value. + example: '1234' + LastPINChangeToken: + type: string + description: The token for the last PIN change. + example: token_12345 + nullable: true + LastPINChangeDate: + nullable: true + type: string + format: date-time + description: The date of the last PIN change. + example: '2024-03-15T10:00:00Z' + SkippedDate: + nullable: true + type: string + format: date-time + description: The date the PIN setup was skipped. + example: '2024-03-10T10:00:00Z' + ConsentProfile: + type: object + nullable: true + description: Consent profile details. + properties: + AcceptedConsentVersions: + type: array + nullable: true + items: + type: object + properties: + IsCustom: + type: boolean + description: Indicates if the Consent version is custom. + example: false + Version: + type: integer + description: The version of the Consent. + example: 1 + Event: + type: string + description: The event associated with the Consent. + example: Signup + Consents: + type: array + nullable: true + items: + type: object + properties: + ConsentOptionId: + type: string + description: The ID of the Consent option. + example: 123e4567e89b12d3a456426614174000 + AcceptOnDate: + nullable: true + type: string + format: date-time + description: The date the Consent was accepted. + example: '2024-03-20T15:30:00Z' + RegistrationData: + type: object + nullable: true + description: Registration data details. + properties: + Data: + type: array + nullable: true + items: + type: object + properties: + DataSource: + type: string + description: The source of the registration data. + example: Web + Value: + type: object + properties: + Id: + type: string + description: The ID of the registration data value. + example: data_12345 + ProviderAccessCredential: + type: object + nullable: true + description: Provider access credential details. + properties: + AccessToken: + type: string + description: Access Token for the provider. + example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... + TokenSecret: + type: string + description: Token secret for the provider. + example: abc123def456... + CustomFields: + type: object + nullable: true + additionalProperties: + type: string + description: Custom fields associated with the User. + example: + hobby: Photography + favorite_color: Blue + ProfileImageUrls: + type: object + nullable: true + additionalProperties: + type: string + description: URLs of the User's profile images. + example: + small: https://example.com/small.jpg + large: https://example.com/large.jpg + WebProfiles: + type: object + nullable: true + additionalProperties: + type: string + description: The User's web profiles. + example: + linkedin: https://linkedin.com/in/johndoe + github: https://github.com/johndoe + Roles: + type: array + nullable: true + items: + type: string + description: Roles assigned to the User. + example: + - Admin + - User + Uid: + type: string + example: 577fabca-a33e-4a08-96e6-0ade8d846613 + description: the unique id which belongs to the Account + PreviousUids: + type: array + nullable: true + items: + type: string + description: Previous UIDs associated with the Account. + example: + - old_UID_123 + - old_UID_456 + InterestedIn: + type: array + nullable: true + items: + type: string + description: Interests of the User. + example: + - Technology + - Music + ExternalIds: + type: array + nullable: true + items: + type: object + properties: + Operation: + type: string + description: The operation performed on the external ID. + example: add + Source: + type: string + description: The source of the external ID. + example: LinkedIn + SourceId: + type: string + description: The source ID of the external ID. + example: source_12345 + UnverifiedEmail: + type: array + nullable: true + items: + type: object + properties: + Type: + type: string + description: The type of the Email. + example: Primary + Value: + type: string + description: The Email address. + example: john.doe@example.com + Positions: + type: array + nullable: true + description: List of positions held by the User. + items: + type: object + properties: + Position: + type: string + description: The position held by the User. + example: Senior Software Engineer + Summary: + type: string + description: A summary of the position. + example: Leading backend development team. + StartDate: + type: string + format: date-time + description: The start date of the position. + example: '2022-01-15T00:00:00Z' + EndDate: + type: string + format: date-time + description: The end date of the position. + example: '2024-03-20T00:00:00Z' + IsCurrent: + type: string + description: Indicates if the position is current. + example: 'true' + Location: + type: string + description: The location of the position. + example: New York + Company: + type: object + properties: + Name: + type: string + description: The name of the company. + example: Tech Corp + Type: + type: string + description: The type of the company. + example: Public Company + Industry: + type: string + description: The industry of the company. + example: Software Development + Educations: + type: array + nullable: true + description: List of educational qualifications of the User. + items: + type: object + properties: + School: + type: string + description: The name of the school. + example: MIT + Year: + type: string + description: The year of graduation. + example: '2012' + Type: + type: string + description: The type of degree. + example: Bachelor's + Notes: + type: string + description: Additional notes about the education. + example: Computer Science Major + Activities: + type: string + description: Activities participated in during education. + example: Robotics Club, Coding Competition + Degree: + type: string + description: The degree obtained. + example: BS Computer Science + FieldOfStudy: + type: string + description: The field of study. + example: Computer Science + StartDate: + type: string + format: date-time + description: The start date of the education. + example: '2008-09-01T00:00:00Z' + EndDate: + type: string + format: date-time + description: The end date of the education. + example: '2012-05-30T00:00:00Z' + PhoneNumbers: + type: array + nullable: true + description: List of Phone numbers associated with the User. + items: + type: object + properties: + PhoneType: + type: string + description: The type of Phone (e.g., Mobile, Home). + example: Mobile + PhoneNumber: + type: string + description: The Phone number. + example: +1-555-123-4567 + Operation: + type: string + description: The operation performed on the Phone number. + example: add + IMAccounts: + type: array + nullable: true + description: List of instant messaging accounts associated with the User. + items: + type: object + properties: + AccountType: + type: string + description: The type of instant messaging account. + example: Skype + AccountName: + type: string + description: The name of the instant messaging account. + example: johnsmith_skype + Addresses: + type: array + nullable: true + description: List of addresses associated with the User. + items: + type: object + properties: + Type: + type: string + description: The type of address (e.g., Home, Work). + example: Home + Address1: + type: string + description: The first line of the address. + example: 123 Tech Street + Address2: + type: string + description: The second line of the address. + example: Apt 4B + City: + type: string + description: The city of the address. + example: Cambridge + State: + type: string + description: The state of the address. + example: MA + PostalCode: + type: string + description: The postal code of the address. + example: '02142' + Region: + type: string + description: The region of the address. + example: New England + Country: + type: string + description: The country of the address. + example: USA + Operation: + type: string + description: The operation performed on the address. + example: add + Interests: + type: array + nullable: true + description: List of interests of the User. + items: + type: object + properties: + InterestedType: + type: string + description: The type of interest (e.g., Professional, Personal). + example: Professional + InterestedName: + type: string + description: The name of the interest. + example: Software Architecture + Sports: + type: array + nullable: true + description: List of sports the User is interested in. + items: + type: object + properties: + Id: + type: string + description: The ID of the sport. + example: sport_123 + Name: + type: string + description: The name of the sport. + example: Basketball + InspirationalPeople: + type: array + nullable: true + description: List of inspirational people for the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the person. + example: person_123 + Name: + type: string + description: The name of the person. + example: Linus Torvalds + Awards: + type: array + nullable: true + description: List of awards received by the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the award. + example: award_123 + Name: + type: string + description: The name of the award. + example: Best Developer Award + Issuer: + type: string + description: The issuer of the award. + example: Tech Conference 2023 + Skills: + type: array + nullable: true + description: List of skills possessed by the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the skill. + example: skill_123 + Name: + type: string + description: The name of the skill. + example: Python Programming + CurrentStatus: + type: array + nullable: true + description: List of current statuses of the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the status. + example: status_123 + Text: + type: string + description: The text of the status. + example: Working on exciting new project + Source: + type: string + description: The source of the status. + example: LinkedIn + CreatedDate: + type: string + format: date-time + description: The date the status was created. + example: '2024-03-20T15:30:00Z' + Certifications: + type: array + nullable: true + description: List of certifications obtained by the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the certification. + example: cert_123 + Name: + type: string + description: The name of the certification. + example: AWS Certified Solutions Architect + Authority: + type: string + description: The authority issuing the certification. + example: Amazon Web Services + Number: + type: string + description: The certification number. + example: CERT123456 + StartDate: + type: string + format: date-time + description: The start date of the certification. + example: '2023-01-15T00:00:00Z' + EndDate: + type: string + format: date-time + description: The end date of the certification. + example: '2026-01-15T00:00:00Z' + Courses: + type: array + nullable: true + description: List of courses completed by the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the course. + example: course_123 + Name: + type: string + description: The name of the course. + example: Advanced Machine Learning + Number: + type: string + description: The course number. + example: CS701 + Volunteer: + type: array + nullable: true + description: List of volunteer activities by the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the volunteer activity. + example: vol_123 + Role: + type: string + description: The Role in the volunteer activity. + example: Technical Mentor + Organization: + type: string + description: The organization for the volunteer activity. + example: Code for America + Cause: + type: string + description: The cause of the volunteer activity. + example: Education + RecommendationsReceived: + type: array + nullable: true + description: List of recommendations received by the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the recommendation. + example: rec_123 + RecommendationType: + type: string + description: The type of recommendation. + example: Professional + RecommendationText: + type: string + description: The text of the recommendation. + example: Excellent team player and technical leader + Recommender: + type: string + description: The name of the recommender. + example: Jane Doe + Languages: + type: array + nullable: true + description: List of languages known by the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the language. + example: lang_123 + Name: + type: string + description: The name of the language. + example: English + Proficiency: + type: string + description: The proficiency level in the language. + example: Native + Projects: + type: array + nullable: true + description: List of projects undertaken by the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the project. + example: proj_123 + Name: + type: string + description: The name of the project. + example: AI-Powered Analytics Platform + Summary: + type: string + description: A summary of the project. + example: Led development of machine learning analytics solution + StartDate: + type: string + format: date-time + description: The start date of the project. + example: '2023-01-01T00:00:00Z' + EndDate: + type: string + format: date-time + description: The end date of the project. + example: '2024-01-01T00:00:00Z' + IsCurrent: + type: string + description: Indicates if the project is current. + example: 'true' + Games: + type: array + nullable: true + description: List of games the User is interested in. + items: + type: object + properties: + Id: + type: string + description: The ID of the game. + example: game_123 + Category: + type: string + description: The category of the game. + example: Strategy + Name: + type: string + description: The name of the game. + example: Chess + CreatedDate: + type: string + format: date-time + description: The date the game was added. + example: '2024-01-15T10:30:00Z' + Family: + type: array + nullable: true + description: List of family members of the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the family member. + example: fam_123 + Relationship: + type: string + description: The relationship with the family member. + example: Spouse + Name: + type: string + description: The name of the family member. + example: Jane Smith + TelevisionShow: + type: array + nullable: true + description: List of television shows the User is interested in. + items: + type: object + properties: + Id: + type: string + description: The ID of the television show. + example: show_123 + Category: + type: string + description: The category of the television show. + example: Science Fiction + Name: + type: string + description: The name of the television show. + example: Black Mirror + CreatedDate: + type: string + format: date-time + description: The date the television show was added. + example: '2024-01-15T10:30:00Z' + MutualFriends: + type: array + nullable: true + description: List of mutual friends of the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the mutual friend. + example: friend_123 + Name: + type: string + description: The name of the mutual friend. + example: Alice Johnson + FirstName: + type: string + description: The first name of the mutual friend. + example: Alice + LastName: + type: string + description: The last name of the mutual friend. + example: Johnson + Birthday: + type: string + format: date-time + description: The birthday of the mutual friend. + example: '1992-05-15T00:00:00Z' + Hometown: + type: string + description: The hometown of the mutual friend. + example: Chicago + Link: + type: string + description: The profile link of the mutual friend. + example: https://example.com/profile/alice + Gender: + type: string + description: The gender of the mutual friend. + example: female + Movies: + type: array + nullable: true + description: List of movies the User is interested in. + items: + type: object + properties: + Id: + type: string + description: The ID of the movie. + example: movie_123 + Category: + type: string + description: The category of the movie. + example: Science Fiction + Name: + type: string + description: The name of the movie. + example: The Matrix + Books: + type: array + nullable: true + description: List of books the User is interested in. + items: + type: object + properties: + Id: + type: string + description: The ID of the book. + example: book_123 + Category: + type: string + description: The category of the book. + example: Technology + Name: + type: string + description: The name of the book. + example: Clean Code + CreatedDate: + type: string + format: date-time + description: The date the book was added. + example: '2023-10-01T00:00:00Z' + Patents: + type: array + nullable: true + description: List of patents owned by the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the patent. + example: pat_123 + Title: + type: string + description: The title of the patent. + example: Novel Machine Learning Algorithm + Date: + type: string + format: date-time + description: The date the patent was filed. + example: '2023-10-01T00:00:00Z' + FavoriteThings: + type: array + nullable: true + description: List of favorite things of the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the favorite thing. + example: fav_123 + Name: + type: string + description: The name of the favorite thing. + example: Programming + Type: + type: string + description: The type of the favorite thing. + example: Hobby + RelatedProfileViews: + type: array + nullable: true + description: List of related profile views of the User. + items: + type: object + properties: + FirstName: + type: string + description: The first name of the related profile. + example: Sarah + LastName: + type: string + description: The last name of the related profile. + example: Connor + Id: + type: string + description: The ID of the related profile. + example: view_123 + PlacesLived: + type: array + nullable: true + description: List of places the User has lived. + items: + type: object + properties: + Name: + type: string + description: The name of the place. + example: San Francisco + Operation: + type: string + description: The operation performed on the place. + example: add + IsPrimary: + type: boolean + description: Indicates if the place is the primary residence. + example: true + Publications: + type: array + nullable: true + description: List of publications by the User. + items: + type: object + properties: + Title: + type: string + description: The title of the publication. + example: Modern Software Architecture + Publisher: + type: string + description: The publisher of the publication. + example: Tech Publishing House + Date: + type: string + format: date-time + description: The date the publication was released. + example: '2023-08-15T00:00:00Z' + Id: + type: string + description: The ID of the publication. + example: pub_123 + Url: + type: string + description: The URL of the publication. + example: https://example.com/publications/123 + Summary: + type: string + description: A summary of the publication. + example: A comprehensive guide to modern software architecture + Authors: + type: array + nullable: true + items: + type: object + properties: + Id: + type: string + description: The ID of the author. + example: author_123 + Name: + type: string + description: The name of the author. + example: John Smith + JobBookmarks: + type: array + nullable: true + description: List of job bookmarks by the User. + items: + type: object + properties: + IsApplied: + type: boolean + description: Indicates if the job has been applied for. + example: true + IsSaved: + type: boolean + description: Indicates if the job has been saved. + example: true + ApplyTimestamp: + type: string + format: date-time + description: The timestamp of the job application. + example: '2024-02-15T14:30:00Z' + SavedTimestamp: + type: string + format: date-time + description: The timestamp of the job being saved. + example: '2024-02-14T10:00:00Z' + Job: + type: object + properties: + Active: + type: boolean + description: Indicates if the job is active. + example: true + Id: + type: string + description: The ID of the job. + example: job_123 + DescriptionSnippet: + type: string + description: A snippet of the job description. + example: Senior Role in cloud architecture + PostingTimestamp: + type: string + format: date-time + description: The timestamp of the job posting. + example: '2024-02-01T09:00:00Z' + Badges: + type: array + nullable: true + description: List of badges earned by the User. + items: + type: object + properties: + BadgeId: + type: string + description: The ID of the badge. + example: badge_123 + Name: + type: string + description: The name of the badge. + example: Top Contributor + BadgeMessage: + type: string + description: The message associated with the badge. + example: Awarded for exceptional contributions + Description: + type: string + description: A description of the badge. + example: Recognition for community support + ImageUrl: + type: string + description: The URL of the badge image. + example: https://example.com/badges/top-contributor.png + MemberUrlResources: + type: array + nullable: true + description: List of member URL resources. + items: + type: object + properties: + Url: + type: string + description: The URL of the resource. + example: https://johnsmith.dev + UrlName: + type: string + description: The name of the URL resource. + example: Portfolio + Organizations: + type: array + nullable: true + description: List of organizations associated with the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the organization. + example: org_123 + Name: + type: string + description: The name of the organization. + example: Acme Corp + LogoURL: + type: string + description: The logo URL of the organization. + example: https://cdn.example.com/orgs/acme/logo.png + Email: + type: array + nullable: true + description: List of Email addresses associated with the User. + items: + type: object + properties: + Type: + type: string + description: The type of the Email (e.g., Primary, Secondary). + example: Primary + Value: + type: string + description: The Email address. + example: john.doe@example.com + PasskeyLogin: + type: object + nullable: true + description: Passkey login details for the User. + properties: + ProgressiveFlag: + type: boolean + example: true + LocalEnrollmentFlag: + type: boolean + example: false + ProgressiveEnrollmentDate: + nullable: true + type: string + format: date-time + description: The date of progressive enrollment. + example: '2024-03-15T10:00:00Z' + Identities: + type: array + nullable: true + items: + $ref: '#/components/schemas/SocialIdentity' + AuthResponse: + type: object + properties: + Profile: + $ref: '#/components/schemas/Profile' + access_token: + type: string + example: 68***-91**-****-b**b-e**********9 + description: Bearer token for authenticating API requests. + refresh_token: + type: string + example: 68***-91**-****-b**b-e**********9 + description: Long-lived token for obtaining new Access Tokens. + expires_in: + type: string + format: date-time + example: '2023-10-01T12:00:00Z' + description: Expiration time of the Access Token in seconds. + ResetPasswordResponse: + properties: + IsPosted: + type: boolean + Data: + $ref: '#/components/schemas/AuthResponse' + ApiError: + type: object + properties: + ErrorCode: + type: integer + format: int32 + description: The error code + Message: + type: string + description: The error message + Description: + type: string + description: A detailed description of the error + EmailUserNameModel: + type: object + properties: + Email: + type: string + description: The Email address of the User + example: test@gmail.com + format: email + UserName: + type: string + description: The Username of the User + example: testuser + IsPostedResponse: + type: object + properties: + IsPosted: + type: boolean + description: Indicates whether the item is posted + ChangePasswordCore: + type: object + required: + - OldPassword + - NewPassword + properties: + OldPassword: + type: string + description: User's current password + example: xxxxxxx + NewPassword: + type: string + description: User's new password + example: xxxxxxxxxxx + SecurityAnswer: + type: object + additionalProperties: + type: string + description: Optional map of security question IDs/keys to answers, used to unlock an account that is locked pending security-question verification. + example: + mother_maiden_name: Smith + changePassword: + allOf: + - $ref: '#/components/schemas/CaptchaModel' + - $ref: '#/components/schemas/ChangePasswordCore' + ErrorResponse: + type: object + properties: + Message: + type: string + description: Brief message describing the error. + Description: + type: string + description: Detailed description of the error. + ErrorCode: + type: integer + description: Error code for identifying the error type. + Code: + type: integer + description: HTTP status code associated with the error. + nullable: true + ResetPasswordWithOTPCore: + type: object + description: Reset Password by Phone and otp + properties: + resetpasswordemailtemplate: + type: string + description: Email template for Password reset (optional) + example: reset_template_v1 + resetPasswordSmsTemplate: + type: string + description: SMS template for Password reset (optional) + example: sms_reset_v1 + smstemplate: + type: string + description: SMS template (optional) + example: otp_template_v1 + SecurityAnswer: + type: object + description: Map of security question answers + additionalProperties: + type: string + example: + What is your pet's name?: Fluffy + What is your mother's maiden name?: Smith + Password: + type: string + description: New password + example: StrongP@ssw0rd! + otp: + type: string + description: One-Time Password received via SMS/email + example: '123456' + phone: + type: string + description: Phone number for OTP delivery + example: '+919999999999' + required: + - Password + - otp + - phone + ResetPasswordWithOTP: + allOf: + - $ref: '#/components/schemas/ResetPasswordWithOTPCore' + - $ref: '#/components/schemas/CaptchaModel' + ForgotPasswordPhoneModel: + type: object + properties: + Phone: + type: string + description: Phone number associated with the Account for Password reset. + example: '+1234567890' + g-recaptcha-response: + type: string + nullable: true + example: 03AGdBq24... + qq_captcha_ticket: + type: string + nullable: true + example: 03AGdBq24eJ9O8dpLsw0Pr0OTtWfkmK34K0jQde + qq_captcha_randstr: + type: string + nullable: true + example: 03AGdBq24eJ9O8dpLsw0Pr0OTtWfkmK34K0jQde + h-captcha-response: + type: string + nullable: true + example: 03AGdBq24e1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7a8b9c0d1e2f3g4h5i6j7k8l9m0n1o2p3q4r5s6t7u8v9w0x1y2z3a4b5c6d7e8f9g0h1i2j3k4l5m6n7o8p9q0r1s2t3u4v5w6x7y8z9 + required: + - Phone + SMSResponseData: + type: object + description: SMS response data details + required: + - Sid + properties: + AccountSid: + type: string + nullable: true + description: The unique identifier for the Account + example: ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX + Sid: + type: string + description: The unique identifier for the SMS message + example: SMXXXXXXXXXXXXXXXX + SMSResponse: + type: object + required: + - IsPosted + - Data + properties: + IsPosted: + type: boolean + description: Indicates whether the SMS was successfully posted + example: true + Data: + $ref: '#/components/schemas/SMSResponseData' + ResetPasswordBySecurityAnswer: + type: object + required: + - SecurityAnswer + - password + properties: + SecurityAnswer: + type: object + additionalProperties: + type: string + description: A map of question IDs or keys to answers + example: + mother_maiden_name: Smith + ResetPasswordEmailTemplate: + type: string + description: Optional Email template to use for Password reset + example: reset-password-template + password: + type: string + description: New Password to set + example: MySecureP@ssw0rd + Phone: + type: string + description: User's Phone number + example: '+919876543210' + Email: + type: string + description: User's Email address + example: user@example.com + UserName: + type: string + description: Optional username + example: john_doe + userid: + type: string + description: Optional User ID + example: abc123 + EmailModel: + type: object + properties: + email: + type: string + format: email + description: The User's Email address + example: xyz@example.com + required: + - email + ProfileRequestModel: + type: object + properties: + UserName: + type: string + example: johndoe123 + PhoneId: + type: string + example: '15555551234' + Gender: + type: string + example: M + BirthDate: + type: string + example: '1990-01-01' + Prefix: + type: string + example: Mr. + FirstName: + type: string + example: John + MiddleName: + type: string + example: Robert + LastName: + type: string + example: Doe + Suffix: + type: string + example: Jr. + NickName: + type: string + example: Johnny + ProfileName: + type: string + example: John R. Doe + About: + type: string + example: Software developer passionate about creating great User experiences + Company: + type: string + example: Tech Corp Inc. + ImageUrl: + type: string + example: https://example.com/images/profile.jpg + TimeZone: + type: string + example: America/New_York + Website: + type: string + example: https://johndoe.com + ThumbnailImageUrl: + type: string + example: https://example.com/images/thumbnail.jpg + Favicon: + type: string + example: https://example.com/favicon.ico + ProfileUrl: + type: string + example: https://example.com/profile/johndoe + HomeTown: + type: string + example: Boston + State: + type: string + example: Massachusetts + City: + type: string + example: Cambridge + Industry: + type: string + example: Technology + LocalLanguage: + type: string + example: en-US + Language: + type: string + example: English + CoverPhoto: + type: string + example: https://example.com/images/cover.jpg + TagLine: + type: string + example: Building the future of technology + MainAddress: + type: string + example: 123 Tech Street + LocalCity: + type: string + example: Cambridge + ProfileCity: + type: string + example: Cambridge + LocalCountry: + type: string + example: United States + ProfileCountry: + type: string + example: United States + Quota: + type: string + example: premium + Religion: + type: string + example: Prefer not to say + Political: + type: string + example: Independent + RelationshipStatus: + type: string + example: Married + HttpsImageUrl: + type: string + example: https://example.com/images/secure/profile.jpg + IsGeoEnabled: + type: string + example: 'true' + Associations: + type: string + example: IEEE, ACM + Honors: + type: string + example: Best Developer Award 2023 + PublicRepository: + type: string + example: '10' + RepositoryUrl: + type: string + example: https://github.com/johndoe + ProfessionalHeadline: + type: string + example: Senior Software Engineer + Currency: + type: string + example: USD + StarredUrl: + type: string + example: https://github.com/johndoe?tab=stars + GistsUrl: + type: string + example: https://gist.github.com/johndoe + GravatarImageUrl: + type: string + example: https://gravatar.com/avatar/123456 + ExternalUserLoginId: + type: string + example: github|12345 + InterestedIn: + type: array + items: + type: string + example: + - Technology + - AI + - Machine Learning + FollowersCount: + type: integer + example: 1000 + FriendsCount: + type: integer + example: 500 + TotalStatusesCount: + type: integer + example: 250 + NumRecommenders: + type: integer + example: 50 + TotalPrivateRepository: + type: integer + example: 5 + PublicGists: + type: integer + example: 15 + PrivateGists: + type: integer + example: 10 + SessionLimit: + type: integer + example: 5 + CustomFields: + type: object + additionalProperties: + type: string + example: + skill_level: expert + availability: full-time + ProfileImageUrls: + type: object + additionalProperties: + type: string + example: + small: https://example.com/images/small.jpg + medium: https://example.com/images/medium.jpg + large: https://example.com/images/large.jpg + WebProfiles: + type: object + additionalProperties: + type: string + example: + linkedin: https://linkedin.com/in/johndoe + twitter: https://twitter.com/johndoe + SecurityQuestionAnswer: + type: object + additionalProperties: + type: string + example: + First pet's name?: Spot + Mother's maiden name?: Smith + Country: + type: object + properties: + Name: + type: string + example: United States + Code: + type: string + example: US + ProviderAccessCredential: + type: object + properties: + AccessToken: + type: string + example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... + RefreshToken: + type: string + example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... + ExpiresIn: + type: integer + example: 3600 + Suggestions: + type: object + properties: + CompaniesToFollow: + type: array + items: + type: object + properties: + Id: + type: string + example: comp_123 + Name: + type: string + example: Microsoft + IndustriesToFollow: + type: array + items: + type: object + properties: + Id: + type: string + example: ind_456 + Name: + type: string + example: Software Development + NewssourceToFollow: + type: array + items: + type: object + properties: + Id: + type: string + example: news_789 + Name: + type: string + example: TechCrunch + PeopleToFollow: + type: array + items: + type: object + properties: + Id: + type: string + example: user_101 + Name: + type: string + example: Jane Smith + Subscription: + type: object + properties: + Name: + type: string + example: Premium Plan + Space: + type: string + example: 50GB + PrivateRepos: + type: string + example: Unlimited + Collaborators: + type: string + example: '10' + AgeRange: + type: object + properties: + Min: + type: integer + example: 25 + Max: + type: integer + example: 34 + PrivacyPolicy: + type: object + properties: + Version: + type: string + example: 2.1.0 + PINInfo: + type: object + properties: + PIN: + type: string + example: '123456' + Skipped: + type: boolean + example: false + Addresses: + type: array + items: + type: object + properties: + Type: + type: string + example: Home + AddressType: + type: string + example: Primary + Address1: + type: string + example: 123 Main Street + Address2: + type: string + example: Apt 4B + City: + type: string + example: Boston + State: + type: string + example: MA + PostalCode: + type: string + example: '02108' + Region: + type: string + example: New England + Op: + type: string + example: add + Country: + type: string + example: USA + Positions: + type: array + items: + type: object + properties: + Position: + type: string + example: Senior Software Engineer + Summary: + type: string + example: Leading the frontend development team + StartDate: + type: string + format: date-time + example: '2020-01-15T00:00:00Z' + EndDate: + type: string + format: date-time + example: '2023-06-30T00:00:00Z' + IsCurrent: + type: boolean + nullable: true + example: true + Company: + type: object + properties: + Name: + type: string + example: Tech Solutions Inc + Type: + type: string + example: Private + Industry: + type: string + example: Information Technology + Educations: + type: array + items: + type: object + properties: + School: + type: string + example: MIT + Year: + type: string + example: '2019' + Type: + type: string + example: University + Notes: + type: string + example: Graduated with honors + Activities: + type: string + example: Robotics Club, Chess Team + Degree: + type: string + example: Bachelor of Science + FieldOfStudy: + type: string + example: Computer Science + StartDate: + type: string + format: date-time + example: '2015-09-01T00:00:00Z' + EndDate: + type: string + format: date-time + example: '2019-05-30T00:00:00Z' + PhoneNumbers: + type: array + items: + type: object + properties: + PhoneType: + type: string + example: Mobile + PhoneNumber: + type: string + example: +1-555-555-0123 + op: + type: string + example: add + IMAccounts: + type: array + items: + type: object + properties: + AccountType: + type: string + example: Skype + AccountName: + type: string + example: john.doe.123 + Interests: + type: array + items: + type: object + properties: + InterestType: + type: string + example: Professional + InterestName: + type: string + example: Artificial Intelligence + Sports: + type: array + items: + type: object + properties: + Id: + type: string + example: sport_123 + Name: + type: string + example: Basketball + InspirationalPeople: + type: array + items: + type: object + properties: + Name: + type: string + example: Ada Lovelace + Id: + type: string + example: insp_789 + Awards: + type: array + items: + type: object + properties: + Id: + type: string + example: award_456 + Name: + type: string + example: Innovation Excellence Award + Issuer: + type: string + example: Tech Industry Association + Skills: + type: array + items: + type: object + properties: + Id: + type: string + example: skill_123 + Name: + type: string + example: React.js + CurrentStatus: + type: array + items: + type: object + properties: + Id: + type: string + example: status_789 + Text: + type: string + example: Working on an exciting new project! + Source: + type: string + example: LinkedIn + CreatedDate: + type: string + format: date-time + example: '2023-12-01T09:00:00Z' + Certifications: + type: array + items: + type: object + properties: + Id: + type: string + example: cert_456 + Name: + type: string + example: AWS Certified Solutions Architect + Authority: + type: string + example: Amazon Web Services + Number: + type: string + example: CERT123456 + StartDate: + type: string + format: date-time + example: '2023-01-15T00:00:00Z' + EndDate: + type: string + format: date-time + example: '2026-01-14T23:59:59Z' + Courses: + type: array + items: + type: object + properties: + Id: + type: string + example: course_789 + Name: + type: string + example: Advanced Machine Learning + Number: + type: string + example: CS501 + Volunteer: + type: array + items: + type: object + properties: + Organization: + type: string + example: Code for Good + Role: + type: string + example: Technical Mentor + Cause: + type: string + example: Education + Id: + type: string + example: vol_123 + RecommendationsReceived: + type: array + items: + type: object + properties: + Id: + type: string + example: rec_456 + Recommender: + type: string + example: Jane Smith + RecommendationText: + type: string + example: John is an exceptional developer with great leadership skills + RecommendationType: + type: string + example: Professional + Languages: + type: array + items: + type: object + properties: + Id: + type: string + example: lang_789 + Name: + type: string + example: Spanish + Proficiency: + type: string + example: Advanced + op: + type: string + example: add + Projects: + type: array + items: + type: object + properties: + Id: + type: string + example: proj_123 + Name: + type: string + example: AI-Powered Analytics Platform + Summary: + type: string + example: Developed a machine learning platform for business analytics + StartDate: + type: string + format: date-time + example: '2023-03-01T00:00:00Z' + EndDate: + type: string + format: date-time + example: '2023-11-30T00:00:00Z' + IsCurrent: + type: string + example: 'false' + With: + type: array + items: + type: object + properties: + Id: + type: string + example: user_456 + Name: + type: string + example: Sarah Johnson + Games: + type: array + items: + type: object + properties: + Id: + type: string + example: game_789 + Category: + type: string + example: Strategy + Name: + type: string + example: Chess + CreatedDate: + type: string + format: date-time + example: '2023-01-01T00:00:00Z' + Family: + type: array + items: + type: object + properties: + Id: + type: string + example: fam_123 + Name: + type: string + example: Jane Doe + Relationship: + type: string + example: Spouse + TeleVisionShow: + type: array + items: + type: object + properties: + Id: + type: string + example: show_456 + Category: + type: string + example: Science Fiction + Name: + type: string + example: Black Mirror + CreatedDate: + type: string + format: date-time + example: '2023-06-15T00:00:00Z' + MutualFriends: + type: array + items: + type: object + properties: + Id: + type: string + example: friend_789 + Name: + type: string + example: Mike Wilson + FirstName: + type: string + example: Mike + LastName: + type: string + example: Wilson + Birthday: + type: string + format: date-time + example: '1992-04-15T00:00:00Z' + Hometown: + type: string + example: Chicago + Link: + type: string + example: https://example.com/profile/mikewilson + Gender: + type: string + example: M + Movies: + type: array + items: + type: object + properties: + Id: + type: string + example: movie_123 + Category: + type: string + example: Drama + Name: + type: string + example: The Social Network + CreatedDate: + type: string + format: date-time + example: '2023-07-20T00:00:00Z' + Books: + type: array + items: + type: object + properties: + Id: + type: string + example: book_456 + Category: + type: string + example: Technology + Name: + type: string + example: Clean Code + CreatedDate: + type: string + example: '2023-08-01' + Patents: + type: array + items: + type: object + properties: + Id: + type: string + example: pat_789 + Title: + type: string + example: Method for Efficient Data Processing + Date: + type: string + example: '2023-09-15' + FavoriteThings: + type: array + items: + type: object + properties: + Id: + type: string + example: fav_123 + Name: + type: string + example: Coffee + Type: + type: string + example: Beverage + RelatedProfileViews: + type: array + items: + type: object + properties: + FirstName: + type: string + example: Alice + LastName: + type: string + example: Brown + Id: + type: string + example: view_456 + PlacesLived: + type: array + items: + type: object + properties: + Name: + type: string + example: San Francisco, CA + Operation: + type: string + example: add + IsPrimary: + type: boolean + example: true + Publications: + type: array + items: + type: object + properties: + Title: + type: string + example: Modern Web Development Practices + Publisher: + type: string + example: Tech Publishing House + Date: + type: string + format: date-time + example: '2023-10-01T00:00:00Z' + Id: + type: string + example: pub_789 + Url: + type: string + example: https://example.com/publications/modern-web-dev + Summary: + type: string + example: A comprehensive guide to modern web development techniques + Authors: + type: array + items: + type: object + properties: + Id: + type: string + example: author_123 + Name: + type: string + example: John Doe + JobBookmarks: + type: array + items: + type: object + properties: + IsApplied: + type: boolean + example: true + IsSaved: + type: boolean + example: true + ApplyTimestamp: + type: string + format: date-time + example: '2023-11-15T14:30:00Z' + SavedTimestamp: + type: string + format: date-time + example: '2023-11-14T10:00:00Z' + Job: + type: object + properties: + Active: + type: boolean + example: true + Id: + type: string + example: job_456 + DescriptionSnippet: + type: string + example: Senior developer position for an innovative startup + PostingTimestamp: + type: string + format: date-time + example: '2023-11-10T09:00:00Z' + Compony: + type: object + properties: + Id: + type: string + example: comp_789 + Name: + type: string + example: Innovation Tech + Position: + type: object + properties: + Title: + type: string + example: Senior Full Stack Developer + Badges: + type: array + items: + type: object + properties: + BadgeId: + type: string + example: badge_123 + BageId: + type: string + example: badge_123 + Name: + type: string + example: Top Contributor + BadgeMessage: + type: string + example: Awarded for exceptional contributions + BageMessage: + type: string + example: Awarded for exceptional contributions + Description: + type: string + example: This badge is awarded to top 1% contributors + ImageUrl: + type: string + example: https://example.com/badges/top-contributor.png + MemberUrlResources: + type: array + items: + type: object + properties: + UrlName: + type: string + example: Portfolio + Url: + type: string + example: https://johndoe.dev + ExternalIds: + type: array + items: + type: object + properties: + Operation: + type: string + example: add + Source: + type: string + example: GitHub + SourceId: + type: string + example: gh_123456 + IsEmailSubscribed: + type: boolean + example: true + IsProtected: + type: boolean + example: false + Hireable: + type: boolean + example: true + IsTwoFactorAuthenticationEnabled: + type: boolean + example: true + DisableLogin: + type: boolean + example: false + AcceptPrivacyPolicy: + type: boolean + example: true + recaptcha_response_field: + type: string + example: 03AGdBq24PGRwz... + recaptcha_challenge_field: + type: string + example: challenge_xyz789 + CaptchaModel: + type: object + properties: + CaptchaId: + type: string + example: cap_123456 + CaptchaValue: + type: string + example: 7X4K9 + RegistrationSource: + type: string + example: Website + FullName: + type: string + nullable: true + example: John Robert Doe Jr. + Consents: + type: object + properties: + Events: + type: array + items: + type: object + properties: + IsCustom: + type: boolean + example: false + Event: + type: string + example: marketing_emails + Data: + type: array + items: + type: object + properties: + IsAccepted: + type: boolean + example: true + ConsentOptionId: + type: string + example: 123e4567e89b12d3a456426614174000 + Password: + type: string + example: SecureP@ssw0rd123 + Email: + type: array + items: + type: object + properties: + Type: + type: string + example: Primary + Value: + type: string + example: john.doe@example.com + ProfileWithoutIdentities: + type: object + properties: + IsPasswordBreached: + type: boolean + example: false + IsActive: + type: boolean + example: true + IsDeleted: + type: boolean + example: false + EmailVerified: + type: boolean + example: true + IsLoginLocked: + type: boolean + example: false + IsRequiredFieldsFilledOnce: + type: boolean + example: true + FirstLogin: + type: boolean + example: false + IsProtected: + type: boolean + example: false + Hireable: + type: boolean + example: true + IsSecurePassword: + type: boolean + nullable: true + example: true + IsCustomUid: + type: boolean + example: false + PhoneIdVerified: + type: boolean + example: true + IsEmailSubscribed: + type: boolean + example: true + NoOfLogins: + type: integer + example: 42 + FollowersCount: + type: integer + example: 150 + FriendsCount: + type: integer + example: 89 + TotalStatusesCount: + type: integer + example: 234 + NumRecommenders: + type: integer + example: 12 + TotalPrivateRepository: + type: integer + example: 5 + PublicGists: + type: integer + example: 8 + PrivateGists: + type: integer + example: 3 + PinsCount: + type: integer + example: 25 + BoardsCount: + type: integer + example: 6 + LikesCount: + type: integer + example: 342 + SessionLimit: + type: integer + example: 5 + ID: + type: string + example: usr_12345 + Password: + type: string + example: '********' + LoginLockedType: + type: string + example: None + Provider: + type: string + example: email + LastPasswordChangeToken: + type: string + example: tkn_abc123xyz + FullName: + type: string + nullable: true + example: John Michael Doe + FirstName: + type: string + example: John + LastName: + type: string + example: Doe + Uid: + type: string + example: u123456789 + RegistrationProvider: + type: string + example: google + RegistrationSource: + type: string + example: web + LastLoginLocation: + type: string + example: New York, USA + ExternalUserLoginId: + type: string + example: ext_789xyz + PhoneId: + type: string + example: '+1234567890' + UserName: + type: string + example: johndoe + Prefix: + type: string + example: Mr + MiddleName: + type: string + example: Michael + Suffix: + type: string + example: Jr + NickName: + type: string + example: Johnny + ProfileName: + type: string + example: John.Doe + BirthDate: + type: string + example: '1980-01-01' + Gender: + type: string + example: male + Website: + type: string + example: https://johndoe.com + ThumbnailImageUrl: + type: string + example: https://example.com/thumb/profile.jpg + ImageUrl: + type: string + example: https://example.com/profile.jpg + Favicon: + type: string + example: https://example.com/favicon.ico + ProfileUrl: + type: string + example: https://example.com/johndoe + HomeTown: + type: string + example: Boston + State: + type: string + example: Massachusetts + City: + type: string + example: Boston + Industry: + type: string + example: Technology + About: + type: string + example: Software developer passionate about creating great User experiences + TimeZone: + type: string + example: America/New_York + LocalLanguage: + type: string + example: en-US + CoverPhoto: + type: string + example: https://example.com/cover.jpg + TagLine: + type: string + example: Building the future of tech + Language: + type: string + example: English + Verified: + type: string + example: 'true' + UpdatedTime: + type: string + example: '2024-03-20T15:30:00Z' + IsGeoEnabled: + type: string + example: 'true' + Associations: + type: string + example: IEEE, ACM + Honors: + type: string + example: Best Developer Award 2023 + HttpsImageUrl: + type: string + example: https://example.com/secure/profile.jpg + MainAddress: + type: string + example: 123 Tech Street + Created: + type: string + example: '2023-01-01T10:00:00Z' + LocalCity: + type: string + example: Boston + ProfileCity: + type: string + example: Boston + LocalCountry: + type: string + example: United States + ProfileCountry: + type: string + example: United States + RelationshipStatus: + type: string + example: Single + Quota: + type: string + example: '1000' + Quote: + type: string + example: Code is poetry + Religion: + type: string + example: Prefer not to say + Political: + type: string + example: Independent + PublicRepository: + type: string + example: '15' + RepositoryUrl: + type: string + example: https://github.com/johndoe + Age: + type: string + example: '35' + ProfessionalHeadline: + type: string + example: Senior Software Engineer + LRUserID: + type: string + example: lr_123456 + Currency: + type: string + example: USD + StarredUrl: + type: string + example: https://github.com/johndoe?tab=stars + GistsUrl: + type: string + example: https://gist.github.com/johndoe + Company: + type: string + example: Tech Corp Inc. + GravatarImageUrl: + type: string + example: https://gravatar.com/avatar/123 + LastPasswordChangeDate: + type: string + format: date-time + example: '2024-02-15T14:30:00Z' + PasswordExpirationDate: + type: string + format: date-time + example: '2024-05-15T14:30:00Z' + CreatedDate: + type: string + format: date-time + example: '2023-01-01T10:00:00Z' + ModifiedDate: + type: string + format: date-time + example: '2024-03-20T15:30:00Z' + ProfileModifiedDate: + type: string + format: date-time + example: '2024-03-15T12:30:00Z' + LastLoginDate: + type: string + format: date-time + example: '2024-03-20T09:30:00Z' + SignupDate: + type: string + format: date-time + example: '2023-01-01T10:00:00Z' + PrivacyPolicy: + type: object + properties: + Version: + type: string + example: '2.0' + AcceptSource: + type: string + example: web + AcceptDateTime: + type: string + format: date-time + example: '2023-01-01T10:00:00Z' + Country: + type: object + properties: + Name: + type: string + example: United States + Code: + type: string + example: US + AgeRange: + type: object + properties: + Min: + type: integer + example: 25 + Max: + type: integer + example: 34 + KloutScore: + type: object + properties: + KloutId: + type: string + example: klout_123 + Score: + type: integer + example: 63 + Suggestions: + type: object + properties: + CompaniesToFollow: + type: array + items: + type: object + properties: + Id: + type: string + example: comp_123 + Name: + type: string + example: Tech Corp + IndustriesToFollow: + type: array + items: + type: object + properties: + Id: + type: string + example: ind_123 + Name: + type: string + example: Software Development + NewssourceToFollow: + type: array + items: + type: object + properties: + Id: + type: string + example: news_123 + Name: + type: string + example: Tech Daily + PeopleToFollow: + type: array + items: + type: object + properties: + Id: + type: string + example: usr_789 + Name: + type: string + example: Jane Smith + Subscription: + type: object + properties: + Name: + type: string + example: Pro Plan + Space: + type: string + example: 50GB + PrivateRepos: + type: string + example: '10' + Collaborators: + type: string + example: '5' + PIN: + type: object + properties: + Skipped: + type: boolean + example: false + LastPINChangeToken: + type: string + example: pin_token_123 + LastPINChangeDate: + type: string + format: date-time + example: '2024-02-01T12:00:00Z' + SkippedDate: + type: string + format: date-time + example: '2024-01-01T10:00:00Z' + PINHashingConfig: + type: string + example: sha256 + PIN: + type: string + example: '****' + IsPINSet: + type: boolean + example: true + ConsentProfile: + type: object + properties: + Consents: + type: array + items: + type: object + properties: + ConsentOptionId: + type: string + example: 123e4567e89b12d3a456426614174000 + AcceptedOn: + type: string + format: date-time + example: '2024-03-20T15:30:00Z' + AcceptedConsentVersions: + type: array + items: + type: object + properties: + IsCustom: + type: boolean + example: false + Event: + type: string + example: signup + Version: + type: string + example: '1.0' + RegistrationData: + type: object + properties: + Data: + type: array + items: + type: object + properties: + DataSource: + type: string + example: web_form + Value: + type: object + properties: + Id: + type: string + example: reg_123 + ProviderAccessCredential: + type: object + properties: + AccessToken: + type: string + example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... + TokenSecret: + type: string + example: secret_token_xyz + CustomFields: + type: object + additionalProperties: + type: string + example: custom_value + ProfileImageUrls: + type: object + additionalProperties: + type: string + example: https://example.com/images/profile_small.jpg + WebProfiles: + type: object + additionalProperties: + type: string + example: https://linkedin.com/in/johndoe + Roles: + type: array + items: + type: string + example: admin + example: + - admin + - user + PreviousUids: + type: array + items: + type: string + example: old_UID_123 + example: + - old_UID_123 + - old_UID_456 + InterestedIn: + type: array + items: + type: string + example: software development + example: + - technology + - sports + ExternalIds: + type: array + items: + type: object + properties: + Operation: + type: string + example: link + Source: + type: string + example: github + SourceId: + type: string + example: gh_123456 + UnverifiedEmail: + type: array + items: + type: object + properties: + Type: + type: string + example: work + Value: + type: string + example: john.doe@company.com + Positions: + type: array + items: + type: object + properties: + Position: + type: string + example: Senior Software Engineer + Summary: + type: string + example: Leading backend development team + StartDate: + type: string + format: date-time + example: '2022-01-01T00:00:00Z' + EndDate: + type: string + format: date-time + example: '2024-03-20T00:00:00Z' + IsCurrent: + type: boolean + example: true + Company: + type: object + properties: + Name: + type: string + example: Tech Corp Inc. + Type: + type: string + example: Public Company + Industry: + type: string + example: Information Technology + Educations: + type: array + items: + type: object + properties: + School: + type: string + example: MIT + Year: + type: string + example: '2020' + Type: + type: string + example: University + Notes: + type: string + example: Dean's List + Activities: + type: string + example: Robotics Club, Coding Competition + Degree: + type: string + example: Master of Science + FieldOfStudy: + type: string + example: Computer Science + StartDate: + type: string + format: date-time + example: '2018-09-01T00:00:00Z' + EndDate: + type: string + format: date-time + example: '2020-05-30T00:00:00Z' + PhoneNumbers: + type: array + items: + type: object + properties: + PhoneType: + type: string + example: mobile + PhoneNumber: + type: string + example: +1-555-123-4567 + op: + type: string + example: add + IMAccounts: + type: array + items: + type: object + properties: + AccountType: + type: string + example: skype + AccountName: + type: string + example: john.doe.123 + Addresses: + type: array + items: + type: object + properties: + Type: + type: string + example: home + AddressType: + type: string + example: primary + Address1: + type: string + example: 123 Tech Street + Address2: + type: string + example: Apt 4B + City: + type: string + example: San Francisco + State: + type: string + example: CA + PostalCode: + type: string + example: '94105' + Region: + type: string + example: Bay Area + Op: + type: string + example: add + Country: + type: string + example: United States + Interests: + type: array + items: + type: object + properties: + InterestType: + type: string + example: professional + InterestName: + type: string + example: Artificial Intelligence + Sports: + type: array + items: + type: object + properties: + Id: + type: string + example: sport_123 + Name: + type: string + example: Basketball + InspirationalPeople: + type: array + items: + type: object + properties: + Name: + type: string + example: Ada Lovelace + Id: + type: string + example: insp_123 + Awards: + type: array + items: + type: object + properties: + Id: + type: string + example: award_123 + Name: + type: string + example: Innovation Award + Issuer: + type: string + example: Tech Association + Skills: + type: array + items: + type: object + properties: + Id: + type: string + example: skill_123 + Name: + type: string + example: Python Programming + CurrentStatus: + type: array + items: + type: object + properties: + Id: + type: string + example: status_123 + Text: + type: string + example: Working on exciting AI project + Source: + type: string + example: linkedin + CreatedDate: + type: string + format: date-time + example: '2024-03-20T15:30:00Z' + Certifications: + type: array + items: + type: object + properties: + Id: + type: string + example: cert_123 + Name: + type: string + example: AWS Certified Solutions Architect + Authority: + type: string + example: Amazon Web Services + Number: + type: string + example: CERT-123-45678 + StartDate: + type: string + format: date-time + example: '2023-01-01T00:00:00Z' + EndDate: + type: string + format: date-time + example: '2026-01-01T00:00:00Z' + Courses: + type: array + items: + type: object + properties: + Id: + type: string + example: course_123 + Name: + type: string + example: Advanced Machine Learning + Number: + type: string + example: CS-401 + Volunteer: + type: array + items: + type: object + properties: + Organization: + type: string + example: Code for Good + Role: + type: string + example: Technical Mentor + Cause: + type: string + example: Education + Id: + type: string + example: vol_123 + RecommendationsReceived: + type: array + items: + type: object + properties: + Id: + type: string + example: rec_123 + Recommender: + type: string + example: Jane Smith + RecommendationText: + type: string + example: Excellent team player and technical leader + RecommendationType: + type: string + example: professional + Languages: + type: array + items: + type: object + properties: + Id: + type: string + example: lang_123 + Name: + type: string + example: Spanish + Proficiency: + type: string + example: fluent + op: + type: string + example: add + Projects: + type: array + items: + type: object + properties: + Id: + type: string + example: proj_123 + Name: + type: string + example: AI-Powered Analytics Platform + Summary: + type: string + example: Led development of machine learning pipeline + StartDate: + type: string + format: date-time + example: '2023-06-01T00:00:00Z' + EndDate: + type: string + format: date-time + example: '2024-02-28T00:00:00Z' + IsCurrent: + type: string + example: 'false' + With: + type: array + items: + type: object + properties: + Id: + type: string + example: user_789 + Name: + type: string + example: Sarah Johnson + Games: + type: array + items: + type: object + properties: + Id: + type: string + example: game_123 + Category: + type: string + example: Strategy + Name: + type: string + example: Chess + CreatedDate: + type: string + format: date-time + example: '2024-01-15T10:30:00Z' + Family: + type: array + items: + type: object + properties: + Id: + type: string + example: fam_123 + Name: + type: string + example: Jane Doe + Relationship: + type: string + example: Spouse + TelevisionShow: + type: array + items: + type: object + properties: + Id: + type: string + example: show_123 + Category: + type: string + example: Science Fiction + Name: + type: string + example: Black Mirror + CreatedDate: + type: string + format: date-time + example: '2024-02-01T12:00:00Z' + MutualFriends: + type: array + items: + type: object + properties: + Id: + type: string + example: friend_123 + Name: + type: string + example: Alice Smith + FirstName: + type: string + example: Alice + LastName: + type: string + example: Smith + Birthday: + type: string + format: date-time + example: '1985-03-15T00:00:00Z' + Hometown: + type: string + example: Chicago + Link: + type: string + example: https://example.com/alice.smith + Gender: + type: string + example: female + Movies: + type: array + items: + type: object + properties: + MovieName: + type: string + example: The Matrix + Genre: + type: string + example: Science Fiction + Books: + type: array + items: + type: object + properties: + Id: + type: string + example: book_123 + Category: + type: string + example: Non-fiction + Name: + type: string + example: Clean Code + CreatedDate: + type: string + example: '2024-01-01' + Patents: + type: array + items: + type: object + properties: + Id: + type: string + example: pat_123 + Title: + type: string + example: AI-Based Data Processing System + Date: + type: string + example: '2023-06-15' + FavoriteThings: + type: array + items: + type: object + properties: + Id: + type: string + example: fav_123 + Name: + type: string + example: Photography + Type: + type: string + example: Hobby + RelatedProfileViews: + type: array + items: + type: object + properties: + FirstName: + type: string + example: Robert + LastName: + type: string + example: Johnson + Id: + type: string + example: view_123 + PlacesLived: + type: array + items: + type: object + properties: + Name: + type: string + example: Seattle, WA + Operation: + type: string + example: add + IsPrimary: + type: boolean + example: true + Publications: + type: array + items: + type: object + properties: + Title: + type: string + example: Modern Software Architecture + Publisher: + type: string + example: Tech Publishing House + Date: + type: string + format: date-time + example: '2023-08-15T00:00:00Z' + Id: + type: string + example: pub_123 + Url: + type: string + example: https://example.com/publication/123 + Summary: + type: string + example: A comprehensive guide to modern software architecture patterns + Authors: + type: array + items: + type: object + properties: + Id: + type: string + example: auth_123 + Name: + type: string + example: John Doe + JobBookmarks: + type: array + items: + type: object + properties: + IsApplied: + type: boolean + example: true + IsSaved: + type: boolean + example: true + ApplyTimestamp: + type: string + format: date-time + example: '2024-02-15T14:30:00Z' + SavedTimestamp: + type: string + format: date-time + example: '2024-02-10T09:15:00Z' + Job: + type: object + properties: + Active: + type: boolean + example: true + Id: + type: string + example: job_123 + DescriptionSnippet: + type: string + example: Senior Software Engineer position + PostingTimestamp: + type: string + format: date-time + example: '2024-02-01T00:00:00Z' + Compony: + type: object + properties: + Id: + type: string + example: comp_123 + Name: + type: string + example: Tech Corp Inc. + Position: + type: object + properties: + Title: + type: string + example: Senior Software Engineer + Badges: + type: array + items: + type: object + properties: + BadgeId: + type: string + example: badge_123 + BageId: + type: string + example: badge_123 + Name: + type: string + example: Top Contributor + BadgeMessage: + type: string + example: Awarded for exceptional contributions + BageMessage: + type: string + example: Awarded for exceptional contributions + Description: + type: string + example: Recognition for outstanding community support + ImageUrl: + type: string + example: https://example.com/badges/top-contributor.png + MemberUrlResources: + type: array + items: + type: object + properties: + UrlName: + type: string + example: Portfolio + Url: + type: string + example: https://johndoe.com + Organizations: + type: array + items: + type: object + properties: + Id: + type: string + example: org_123 + Name: + type: string + example: Acme Corp + LogoURL: + type: string + example: https://cdn.example.com/orgs/acme/logo.png + Email: + type: array + items: + type: object + properties: + Type: + type: string + example: work + Value: + type: string + example: john.doe@company.com + PasskeyLogin: + type: object + nullable: true + properties: + ProgressiveFlag: + type: boolean + example: true + LocalEnrollmentFlag: + type: boolean + example: false + ProgressiveEnrollmentDate: + type: string + format: date-time + example: '2024-03-01T12:00:00Z' + AuthResponseWithoutIdentites: + properties: + Profile: + $ref: '#/components/schemas/ProfileWithoutIdentities' + access_token: + type: string + example: 684920ba-917b-4168-b59b-eae70b430209 + description: Bearer token for authenticating API requests. + refresh_token: + type: string + example: 684920ba-917b-4168-b59b-eae70b430209 + description: Long-lived token for obtaining new Access Tokens. + expires_in: + type: string + example: '3600' + description: Expiration time of the Access Token in seconds. + RegistrationResponse: + properties: + IsPosted: + type: boolean + Data: + $ref: '#/components/schemas/AuthResponseWithoutIdentites' + PublicKeyCredentialCreationOptions: + type: object + description: | + The parameters for creating a new public key credential. + This contains all the necessary information for the client to generate + a new credential and for the authenticator to attest to that credential. + required: + - rp + - user + - challenge + - pubKeyCredParams + properties: + rp: + type: object + description: | + Information about the Relying Party (the website or service) requesting + the credential creation. + required: + - name + - id + properties: + id: + type: string + description: | + The domain name of the Relying Party. This is used by the authenticator + to ensure credentials are created for the correct domain. + example: example.com + name: + type: string + description: | + The human-readable name of the Relying Party, which may be displayed + to the User by the authenticator. + example: Example Corporation + icon: + type: string + description: | + Optional. A URL pointing to an image resource for the Relying Party, + which may be displayed to the User by the authenticator. + example: https://example.com/icon.png + user: + type: object + description: | + Information about the User for whom the credential is being created. + This information will be stored in the authenticator. + required: + - id + - name + - displayName + properties: + id: + type: string + description: | + A unique identifier for the User. This should be opaque but stable + across different sessions for the same User. + example: MIIBkzCCATigAwIBAjCCAZMwggE4oAMCAQIwggGTMII= + name: + type: string + description: | + The User's Username or Email address, which may be displayed to the User + by the authenticator. + example: user@example.com + displayName: + type: string + description: | + The User's display name, which may be shown to the User by the authenticator + during credential creation. + example: John Doe + icon: + type: string + description: | + Optional. A URL pointing to an image resource for the User, which may be + displayed to the User by the authenticator. + example: https://example.com/user-icon.png + challenge: + type: string + description: | + A cryptographically random challenge generated by the Relying Party server. + This is used to prevent replay attacks and ensure the credential creation + is fresh. + example: Vu8M80YRTOBz3wMFXFJJKCrDf6pfuOQTlPp1GH_8-Jc + pubKeyCredParams: + type: array + description: | + An array of acceptable public key credential types and cryptographic algorithms. + The client will select one from this list based on the capabilities of the + authenticator. + items: + type: object + required: + - type + - alg + properties: + type: + type: string + description: | + The type of credential to be created. For WebAuthn this is always "public-key". + enum: + - public-key + example: public-key + alg: + type: integer + description: | + The COSE identifier for the cryptographic algorithm to be used. + Common values are -7 (ES256), -257 (RS256), -8 (EdDSA). + example: -7 + timeout: + type: integer + description: | + Optional. The time, in milliseconds, that the User has to respond to the + credential creation request before it times out. + example: 60000 + excludeCredentials: + type: array + description: | + Optional. An array of credentials that should not be created again. + This is used to prevent a User from registering the same credential + multiple times. + items: + type: object + required: + - id + - type + properties: + id: + type: string + description: | + The credential ID of the credential to exclude. + example: LFdoCFJTyB82ZzSJUHc-c72yraRc_1mPvGX8ToE8su39xX26Jcqd31LUP5iRLBop + type: + type: string + description: | + The type of credential to exclude. For WebAuthn this is always "public-key". + enum: + - public-key + example: public-key + transports: + type: array + description: | + Optional. Hints as to how the client might communicate with the + authenticator of the credential to exclude. + items: + type: string + enum: + - usb + - nfc + - ble + - internal + - hybrid + - smart-card + example: + - internal + - usb + authenticatorSelection: + type: object + description: | + Optional. Specifies requirements for the authenticator to be used for + credential creation. + properties: + authenticatorAttachment: + type: string + description: | + Optional. Specifies whether the authenticator should be a platform + authenticator (like TouchID, Windows Hello) or a cross-platform + authenticator (like a security key). + enum: + - platform + - cross-platform + example: platform + requireResidentKey: + type: boolean + description: | + Optional. Indicates whether the authenticator must be capable of + storing the credential on the device (resident key / discoverable credential). + example: true + residentKey: + type: string + description: | + Optional. Specifies the Relying Party's requirements for client-side + discoverable credentials (resident keys). + enum: + - discouraged + - preferred + - required + example: preferred + userVerification: + type: string + description: | + Optional. Specifies whether User verification is required, preferred, + or discouraged for credential creation. + enum: + - required + - preferred + - discouraged + example: preferred + attestation: + type: string + description: | + Optional. Specifies whether the authenticator should attach attestation + information to the credential. + enum: + - none + - indirect + - direct + - enterprise + example: direct + extensions: + type: object + description: Optional WebAuthn extensions to influence authenticator behavior + properties: + credProps: + type: boolean + description: Requests information about the credential’s properties (e.g., if it's discoverable) + example: true + exampleExtension: + type: string + description: Placeholder for other extension values (can be vendor-specific) + example: some-value + PasskeyCredentialCreationResponse: + type: object + description: | + CredentialCreationResponse represents the response from a client when creating new credentials. + It is the result of the navigator.credentials.create() call on the client side and is + sent to the server for verification during the registration process. + required: + - id + - rawId + - response + - type + properties: + id: + type: string + description: | + Base64URL-encoded string representing the ID of the newly created credential. + This is typically the same as rawId, but encoded as a string. + example: AUiVKBdB9M_87caeOwmagMqNO0zrQwV3yV74qnGzDiA4ky6d9OHmQQGHN0kCogAiHeuMKJKoNJ6xwTXM6xjQwx3fEKfW3yQb4P8mJ2iQPgTOdHweeDGHUF8_UWTUyoxJ + rawId: + type: string + description: | + Base64URL-encoded ArrayBuffer containing the credential ID. This ID is used by the + Relying Party to identify the credential for future authentications. + example: c29tZS1leGFtcGxlLXJhd0lk + response: + type: object + description: | + The authenticator's response to the client's request to create a credential. + Contains attestation information that can be used to verify the credential's origin. + required: + - clientDataJSON + - attestationObject + properties: + clientDataJSON: + type: string + description: | + Base64URL-encoded JSON serialized client data. Contains information about the + credential creation like the challenge, origin, and type of credential. + example: c29tZS1leGFtcGxlLXJhd0lk + attestationObject: + type: string + description: | + Base64URL-encoded attestation object. Contains the attestation statement and + authenticator data used to verify the credential's provenance. + example: c29tZS1leGFtcGxlLXJhd0lk + transports: + type: array + items: + type: string + enum: + - usb + - nfc + - ble + - internal + - hybrid + description: | + List of transports supported by the authenticator for this credential. + May be included by the client or extracted from attestation metadata. + example: + - usb + - nfc + type: + type: string + description: | + String describing the credential type. For WebAuthn, this is always "public-key". + enum: + - public-key + example: public-key + clientExtensionResults: + type: object + description: Results of any WebAuthn extensions processed by the client. + properties: + credProps: + type: object + description: Credential Properties Extension results. + properties: + rk: + type: boolean + authenticatorAttachment: + type: string + description: | + Indicates the authenticator attachment modality used during credential creation. This helps + identify the type of authenticator used, either a platform authenticator integrated into the + device or a roaming authenticator that can be connected to different devices. + enum: + - platform + - cross-platform + example: platform + PasskeyRegisterFinishCore: + type: object + properties: + PasskeyCredential: + $ref: '#/components/schemas/PasskeyCredentialCreationResponse' + ProfileRequestEmailOnly: + type: object + properties: + Gender: + type: string + example: M + BirthDate: + type: string + example: '1990-01-01' + Prefix: + type: string + example: Mr. + FirstName: + type: string + example: John + MiddleName: + type: string + example: Robert + LastName: + type: string + example: Doe + Suffix: + type: string + example: Jr. + NickName: + type: string + example: Johnny + ProfileName: + type: string + example: John R. Doe + About: + type: string + example: Software developer passionate about creating great User experiences + Company: + type: string + example: Tech Corp Inc. + ImageUrl: + type: string + example: https://example.com/images/profile.jpg + TimeZone: + type: string + example: America/New_York + Website: + type: string + example: https://johndoe.com + ThumbnailImageUrl: + type: string + example: https://example.com/images/thumbnail.jpg + Favicon: + type: string + example: https://example.com/favicon.ico + ProfileUrl: + type: string + example: https://example.com/profile/johndoe + HomeTown: + type: string + example: Boston + State: + type: string + example: Massachusetts + City: + type: string + example: Cambridge + Industry: + type: string + example: Technology + LocalLanguage: + type: string + example: en-US + Language: + type: string + example: English + CoverPhoto: + type: string + example: https://example.com/images/cover.jpg + TagLine: + type: string + example: Building the future of technology + MainAddress: + type: string + example: 123 Tech Street + LocalCity: + type: string + example: Cambridge + ProfileCity: + type: string + example: Cambridge + LocalCountry: + type: string + example: United States + ProfileCountry: + type: string + example: United States + Quota: + type: string + example: premium + Religion: + type: string + example: Prefer not to say + Political: + type: string + example: Independent + RelationshipStatus: + type: string + example: Married + HttpsImageUrl: + type: string + example: https://example.com/images/secure/profile.jpg + IsGeoEnabled: + type: string + example: 'true' + Associations: + type: string + example: IEEE, ACM + Honors: + type: string + example: Best Developer Award 2023 + PublicRepository: + type: string + example: '10' + RepositoryUrl: + type: string + example: https://github.com/johndoe + ProfessionalHeadline: + type: string + example: Senior Software Engineer + Currency: + type: string + example: USD + StarredUrl: + type: string + example: https://github.com/johndoe?tab=stars + GistsUrl: + type: string + example: https://gist.github.com/johndoe + GravatarImageUrl: + type: string + example: https://gravatar.com/avatar/123456 + ExternalUserLoginId: + type: string + example: github|12345 + InterestedIn: + type: array + items: + type: string + example: + - Technology + - AI + - Machine Learning + FollowersCount: + type: integer + example: 1000 + FriendsCount: + type: integer + example: 500 + TotalStatusesCount: + type: integer + example: 250 + NumRecommenders: + type: integer + example: 50 + TotalPrivateRepository: + type: integer + example: 5 + PublicGists: + type: integer + example: 15 + PrivateGists: + type: integer + example: 10 + SessionLimit: + type: integer + example: 5 + CustomFields: + type: object + additionalProperties: + type: string + example: + skill_level: expert + availability: full-time + ProfileImageUrls: + type: object + additionalProperties: + type: string + example: + small: https://example.com/images/small.jpg + medium: https://example.com/images/medium.jpg + large: https://example.com/images/large.jpg + WebProfiles: + type: object + additionalProperties: + type: string + example: + linkedin: https://linkedin.com/in/johndoe + twitter: https://twitter.com/johndoe + SecurityQuestionAnswer: + type: object + additionalProperties: + type: string + example: + First pet's name?: Spot + Mother's maiden name?: Smith + Country: + type: object + properties: + Name: + type: string + example: United States + Code: + type: string + example: US + Suggestions: + type: object + properties: + CompaniesToFollow: + type: array + items: + type: object + properties: + Id: + type: string + example: comp_123 + Name: + type: string + example: Microsoft + IndustriesToFollow: + type: array + items: + type: object + properties: + Id: + type: string + example: ind_456 + Name: + type: string + example: Software Development + NewssourceToFollow: + type: array + items: + type: object + properties: + Id: + type: string + example: news_789 + Name: + type: string + example: TechCrunch + PeopleToFollow: + type: array + items: + type: object + properties: + Id: + type: string + example: user_101 + Name: + type: string + example: Jane Smith + Subscription: + type: object + properties: + Name: + type: string + example: Premium Plan + Space: + type: string + example: 50GB + PrivateRepos: + type: string + example: Unlimited + Collaborators: + type: string + example: '10' + AgeRange: + type: object + properties: + Min: + type: integer + example: 25 + Max: + type: integer + example: 34 + PrivacyPolicy: + type: object + properties: + Version: + type: string + example: 2.1.0 + PINInfo: + type: object + properties: + PIN: + type: string + example: '123456' + Skipped: + type: boolean + example: false + Addresses: + type: array + items: + type: object + properties: + Type: + type: string + example: Home + AddressType: + type: string + example: Primary + Address1: + type: string + example: 123 Main Street + Address2: + type: string + example: Apt 4B + City: + type: string + example: Boston + State: + type: string + example: MA + PostalCode: + type: string + example: '02108' + Region: + type: string + example: New England + Op: + type: string + example: add + Country: + type: string + example: USA + Positions: + type: array + items: + type: object + properties: + Position: + type: string + example: Senior Software Engineer + Summary: + type: string + example: Leading the frontend development team + StartDate: + type: string + format: date-time + example: '2020-01-15T00:00:00Z' + EndDate: + type: string + format: date-time + example: '2023-06-30T00:00:00Z' + IsCurrent: + type: boolean + nullable: true + example: true + Company: + type: object + properties: + Name: + type: string + example: Tech Solutions Inc + Type: + type: string + example: Private + Industry: + type: string + example: Information Technology + Educations: + type: array + items: + type: object + properties: + School: + type: string + example: MIT + Year: + type: string + example: '2019' + Type: + type: string + example: University + Notes: + type: string + example: Graduated with honors + Activities: + type: string + example: Robotics Club, Chess Team + Degree: + type: string + example: Bachelor of Science + FieldOfStudy: + type: string + example: Computer Science + StartDate: + type: string + format: date-time + example: '2015-09-01T00:00:00Z' + EndDate: + type: string + format: date-time + example: '2019-05-30T00:00:00Z' + PhoneNumbers: + type: array + items: + type: object + properties: + PhoneType: + type: string + example: Mobile + PhoneNumber: + type: string + example: +1-555-555-0123 + op: + type: string + example: add + IMAccounts: + type: array + items: + type: object + properties: + AccountType: + type: string + example: Skype + AccountName: + type: string + example: john.doe.123 + Interests: + type: array + items: + type: object + properties: + InterestType: + type: string + example: Professional + InterestName: + type: string + example: Artificial Intelligence + Sports: + type: array + items: + type: object + properties: + Id: + type: string + example: sport_123 + Name: + type: string + example: Basketball + InspirationalPeople: + type: array + items: + type: object + properties: + Name: + type: string + example: Ada Lovelace + Id: + type: string + example: insp_789 + Awards: + type: array + items: + type: object + properties: + Id: + type: string + example: award_456 + Name: + type: string + example: Innovation Excellence Award + Issuer: + type: string + example: Tech Industry Association + Skills: + type: array + items: + type: object + properties: + Id: + type: string + example: skill_123 + Name: + type: string + example: React.js + CurrentStatus: + type: array + items: + type: object + properties: + Id: + type: string + example: status_789 + Text: + type: string + example: Working on an exciting new project! + Source: + type: string + example: LinkedIn + CreatedDate: + type: string + format: date-time + example: '2023-12-01T09:00:00Z' + Certifications: + type: array + items: + type: object + properties: + Id: + type: string + example: cert_456 + Name: + type: string + example: AWS Certified Solutions Architect + Authority: + type: string + example: Amazon Web Services + Number: + type: string + example: CERT123456 + StartDate: + type: string + format: date-time + example: '2023-01-15T00:00:00Z' + EndDate: + type: string + format: date-time + example: '2026-01-14T23:59:59Z' + Courses: + type: array + items: + type: object + properties: + Id: + type: string + example: course_789 + Name: + type: string + example: Advanced Machine Learning + Number: + type: string + example: CS501 + Volunteer: + type: array + items: + type: object + properties: + Organization: + type: string + example: Code for Good + Role: + type: string + example: Technical Mentor + Cause: + type: string + example: Education + Id: + type: string + example: vol_123 + RecommendationsReceived: + type: array + items: + type: object + properties: + Id: + type: string + example: rec_456 + Recommender: + type: string + example: Jane Smith + RecommendationText: + type: string + example: John is an exceptional developer with great leadership skills + RecommendationType: + type: string + example: Professional + Languages: + type: array + items: + type: object + properties: + Id: + type: string + example: lang_789 + Name: + type: string + example: Spanish + Proficiency: + type: string + example: Advanced + op: + type: string + example: add + Projects: + type: array + items: + type: object + properties: + Id: + type: string + example: proj_123 + Name: + type: string + example: AI-Powered Analytics Platform + Summary: + type: string + example: Developed a machine learning platform for business analytics + StartDate: + type: string + format: date-time + example: '2023-03-01T00:00:00Z' + EndDate: + type: string + format: date-time + example: '2023-11-30T00:00:00Z' + IsCurrent: + type: string + example: 'false' + With: + type: array + items: + type: object + properties: + Id: + type: string + example: user_456 + Name: + type: string + example: Sarah Johnson + Games: + type: array + items: + type: object + properties: + Id: + type: string + example: game_789 + Category: + type: string + example: Strategy + Name: + type: string + example: Chess + CreatedDate: + type: string + format: date-time + example: '2023-01-01T00:00:00Z' + Family: + type: array + items: + type: object + properties: + Id: + type: string + example: fam_123 + Name: + type: string + example: Jane Doe + Relationship: + type: string + example: Spouse + TeleVisionShow: + type: array + items: + type: object + properties: + Id: + type: string + example: show_456 + Category: + type: string + example: Science Fiction + Name: + type: string + example: Black Mirror + CreatedDate: + type: string + format: date-time + example: '2023-06-15T00:00:00Z' + MutualFriends: + type: array + items: + type: object + properties: + Id: + type: string + example: friend_789 + Name: + type: string + example: Mike Wilson + FirstName: + type: string + example: Mike + LastName: + type: string + example: Wilson + Birthday: + type: string + format: date-time + example: '1992-04-15T00:00:00Z' + Hometown: + type: string + example: Chicago + Link: + type: string + example: https://example.com/profile/mikewilson + Gender: + type: string + example: M + Movies: + type: array + items: + type: object + properties: + Id: + type: string + example: movie_123 + Category: + type: string + example: Drama + Name: + type: string + example: The Social Network + CreatedDate: + type: string + format: date-time + example: '2023-07-20T00:00:00Z' + Books: + type: array + items: + type: object + properties: + Id: + type: string + example: book_456 + Category: + type: string + example: Technology + Name: + type: string + example: Clean Code + CreatedDate: + type: string + example: '2023-08-01' + Patents: + type: array + items: + type: object + properties: + Id: + type: string + example: pat_789 + Title: + type: string + example: Method for Efficient Data Processing + Date: + type: string + example: '2023-09-15' + FavoriteThings: + type: array + items: + type: object + properties: + Id: + type: string + example: fav_123 + Name: + type: string + example: Coffee + Type: + type: string + example: Beverage + RelatedProfileViews: + type: array + items: + type: object + properties: + FirstName: + type: string + example: Alice + LastName: + type: string + example: Brown + Id: + type: string + example: view_456 + PlacesLived: + type: array + items: + type: object + properties: + Name: + type: string + example: San Francisco, CA + Operation: + type: string + example: add + IsPrimary: + type: boolean + example: true + Publications: + type: array + items: + type: object + properties: + Title: + type: string + example: Modern Web Development Practices + Publisher: + type: string + example: Tech Publishing House + Date: + type: string + format: date-time + example: '2023-10-01T00:00:00Z' + Id: + type: string + example: pub_789 + Url: + type: string + example: https://example.com/publications/modern-web-dev + Summary: + type: string + example: A comprehensive guide to modern web development techniques + Authors: + type: array + items: + type: object + properties: + Id: + type: string + example: author_123 + Name: + type: string + example: John Doe + JobBookmarks: + type: array + items: + type: object + properties: + IsApplied: + type: boolean + example: true + IsSaved: + type: boolean + example: true + ApplyTimestamp: + type: string + format: date-time + example: '2023-11-15T14:30:00Z' + SavedTimestamp: + type: string + format: date-time + example: '2023-11-14T10:00:00Z' + Job: + type: object + properties: + Active: + type: boolean + example: true + Id: + type: string + example: job_456 + DescriptionSnippet: + type: string + example: Senior developer position for an innovative startup + PostingTimestamp: + type: string + format: date-time + example: '2023-11-10T09:00:00Z' + Compony: + type: object + properties: + Id: + type: string + example: comp_789 + Name: + type: string + example: Innovation Tech + Position: + type: object + properties: + Title: + type: string + example: Senior Full Stack Developer + Badges: + type: array + items: + type: object + properties: + BadgeId: + type: string + example: badge_123 + BageId: + type: string + example: badge_123 + Name: + type: string + example: Top Contributor + BadgeMessage: + type: string + example: Awarded for exceptional contributions + BageMessage: + type: string + example: Awarded for exceptional contributions + Description: + type: string + example: This badge is awarded to top 1% contributors + ImageUrl: + type: string + example: https://example.com/badges/top-contributor.png + MemberUrlResources: + type: array + items: + type: object + properties: + UrlName: + type: string + example: Portfolio + Url: + type: string + example: https://johndoe.dev + ExternalIds: + type: array + items: + type: object + properties: + Operation: + type: string + example: add + Source: + type: string + example: GitHub + SourceId: + type: string + example: gh_123456 + IsEmailSubscribed: + type: boolean + example: true + IsProtected: + type: boolean + example: false + Hireable: + type: boolean + example: true + DisableLogin: + type: boolean + example: false + AcceptPrivacyPolicy: + type: boolean + example: true + RegistrationSource: + type: string + example: Website + FullName: + type: string + example: John Robert Doe Jr. + Consents: + type: object + properties: + Events: + type: array + items: + type: object + properties: + IsCustom: + type: boolean + example: false + Event: + type: string + example: marketing_emails + Data: + type: array + items: + type: object + properties: + IsAccepted: + type: boolean + example: true + ConsentOptionId: + type: string + example: 123e4567e89b12d3a456426614174000 + Email: + type: array + items: + type: object + properties: + Type: + type: string + example: Primary + Value: + type: string + example: john.doe@example.com + PasskeyRegisterFinish: + allOf: + - $ref: '#/components/schemas/PasskeyRegisterFinishCore' + - $ref: '#/components/schemas/ProfileRequestEmailOnly' + LoginByEmailRequestCore: + type: object + properties: + SecurityAnswer: + type: object + additionalProperties: + type: string + description: The security answers which is set for the User, this will be used when the User is blocked for the security question. + nullable: true + Email: + type: string + description: The Email address of the User + Password: + type: string + description: The Password of the User + LoginByEmailRequest: + type: object + allOf: + - $ref: '#/components/schemas/CaptchaModel' + - $ref: '#/components/schemas/LoginByEmailRequestCore' + LoginByUsernameRequestCore: + type: object + required: + - username + - password + properties: + username: + type: string + description: The Username of the User + password: + type: string + format: password + description: The Password of the User + securityAnswer: + type: string + description: The security answer which is set for the User, this will be used when the User is blocked for the security question. + LoginByUsernameRequest: + type: object + allOf: + - $ref: '#/components/schemas/CaptchaModel' + - $ref: '#/components/schemas/LoginByUsernameRequestCore' + LoginByPhoneCore: + type: object + required: + - phone + - password + properties: + phone: + type: string + description: The Phone number of the User + password: + type: string + format: password + description: The Password of the User + securityAnswer: + type: string + description: The security answer which is set for the User, this will be used when the User is blocked for the security question. + LoginByPhone: + type: object + allOf: + - $ref: '#/components/schemas/CaptchaModel' + - $ref: '#/components/schemas/LoginByPhoneCore' + AuthResponseOptionalMfa: + type: object + allOf: + - $ref: '#/components/schemas/AuthResponse' + properties: + SecondFactorAuthentication: + type: object + description: The two-factor authentication method response, if the User has 2FA enabled. + nullable: true + TwoFactorAuthenticationTokenObjectCore: + type: object + properties: + SecondFactorAuthenticationToken: + type: string + description: Token for second factor authentication + example: 684920ba-917b-4168-b59b-eae70b430209 + ExpireIn: + type: string + format: date-time + description: Expiration time of the token + example: '2021-04-06T08:36:53.3005592Z' + EmailOTPStatus: + type: object + properties: + Email: + type: string + example: u**r@e*****e.c*m + SecurityQuestions: + type: object + properties: + QuestionId: + type: string + example: db7****8a73e4******bd9****8c20 + Question: + type: string + example: What is your pet's name? + TwoFactorAuthenticationSettings: + type: object + description: This holds the second factor authentication settings excluding SecondFactorAuthentication token + properties: + QRCode: + type: string + nullable: true + example: data:image/png;base64,... + PushQRCode: + type: string + nullable: true + example: https://devapi.lrinternal.com/identity/v2/auth/qr-code?apikey=xxx&token=xxxxx&size=150 + ManualEntryCode: + type: string + nullable: true + example: HBRWENLDHEZGIMBYHFTDINJSMVRDANDBHE4WINJTMYZTCYZSGFRA + DuoAuthEndpoint: + type: string + nullable: true + example: https://api.duosecurity.com/auth + IsGoogleAuthenticatorVerified: + type: boolean + IsPushDeviceRegistered: + type: boolean + IsAuthenticatorVerified: + type: boolean + IsEmailOtpAuthenticatorVerified: + type: boolean + IsOTPAuthenticatorVerified: + type: boolean + IsDuoAuthenticatorVerified: + type: boolean + IsPasskeyAuthenticatorVerified: + type: boolean + OTPPhoneNo: + type: string + nullable: true + example: '+1234567890' + OTPStatus: + $ref: '#/components/schemas/SMSResponseData' + Email: + type: array + items: + type: string + format: email + example: + - user@example.com + EmailOTPStatus: + $ref: '#/components/schemas/EmailOTPStatus' + IsSecurityQuestionAuthenticatorVerified: + type: boolean + SecurityQuestions: + type: array + items: + $ref: '#/components/schemas/SecurityQuestions' + TwoFactorAuthenticationTokenObject: + type: object + description: This holds the second factor authentication settings including SecondFactorAuthentication token + allOf: + - $ref: '#/components/schemas/TwoFactorAuthenticationTokenObjectCore' + - $ref: '#/components/schemas/TwoFactorAuthenticationSettings' + AuthResponseRequiredMfaCore: + type: object + properties: + access_token: + type: string + example: 00000000-0000-0000-0000-000000000000 + description: Empty access_token + expires_in: + type: string + format: date-time + example: '0001-01-01T00:00:00Z' + description: Empty expires_in + AuthResponseRequiredMfa: + type: object + allOf: + - $ref: '#/components/schemas/TwoFactorAuthenticationTokenObject' + - $ref: '#/components/schemas/AuthResponseRequiredMfaCore' + IsExist: + properties: + IsExist: + type: boolean + description: Indicates whether the Email exists in the system. + AuthResponseEmailVerification: + properties: + IsPosted: + type: boolean + Data: + type: object + properties: + Email: + type: string + example: test@gmail.com + VerifyEmailModel: + type: object + required: + - otp + properties: + otp: + type: string + description: One-time passcode sent to the User's Email. [required if 'email' or 'uuid' is passed] + email: + type: string + description: User's Email address (required if `uuid` or `username` is not passed). + username: + type: string + description: Username of the associated Account (required if `email` or `uuid` is not passed). Cannot be combined with `email`. + UUID: + type: string + description: UUID received in the response of the Auth send verification Email API (required if `email` or `username` is not passed). + verificationtoken: + type: string + description: Verification token received in Email (required if `email` is not passed). + securityanswer: + type: object + description: JSON object with unique security question IDs and answers. + AuthResponseForgotReset: + type: object + properties: + IsPosted: + type: boolean + Data: + $ref: '#/components/schemas/AuthResponse' + AddEmailModel: + type: object + required: + - email + properties: + email: + type: string + description: email + type: + type: string + description: type + AccessTokenInBody: + type: object + properties: + access_token: + type: string + description: Access Token for authentication + DeleteEmailRequest: + type: object + required: + - email + properties: + email: + type: string + IsDeleted: + type: object + properties: + IsDeleted: + type: boolean + description: Indicates if the item is deleted + PublicKeyCredentialRequestOptions: + type: object + description: | + Represents the options for a WebAuthn credential assertion (authentication). This object is typically generated by the server and sent to the client to initiate the authentication ceremony using `navigator.credentials.get()`. + required: + - challenge + - rpId + - allowCredentials + - timeout + properties: + challenge: + type: string + description: | + A cryptographic challenge that the authenticator signs over. This is a base64url-encoded string generated by the server to prevent replay attacks. + example: F8e3QHkHo-vlv-3R09qOfmBDY8A9GrqYK9hVujdjGHE + rpId: + type: string + description: | + The relying party identifier (usually the domain of the website) that the credential should be scoped to. + example: login2website.com + allowCredentials: + type: array + description: | + A list of descriptors for credentials acceptable to the server. This allows the server to guide the client to use a particular credential. + items: + type: object + required: + - type + - id + properties: + type: + type: string + description: The type of public key credential. + example: public-key + id: + type: string + description: | + The base64url-encoded identifier of the credential. This corresponds to the ID of a previously registered credential. + example: bzsKo52E6_sh5mCC3FjB_w + transports: + type: array + description: | + An array of transport methods supported by the authenticator for this credential. Values can include "usb", "nfc", "ble", or "internal". + items: + type: string + example: + - internal + timeout: + type: integer + description: | + Time, in milliseconds, that the caller is willing to wait for the authentication operation to complete. + example: 60000 + userVerification: + type: string + description: | + Specifies the preferred level of User verification for the authentication. Options are "required", "preferred", or "discouraged". + enum: + - required + - preferred + - discouraged + example: preferred + extensions: + type: object + description: | + Additional parameters requesting specific processing by the client or authenticator. These are optional and can be used to enable advanced features. + properties: + appid: + type: string + description: | + Used for backwards compatibility with FIDO U2F authenticators. Indicates the AppID for which the credential should be scoped. + example: https://example.com + exampleExtension: + type: string + description: | + Placeholder for other extension values (can be vendor-specific). + example: some-value + PasskeyCredentialAssertionResponse: + type: object + description: | + CredentialAssertionResponse represents the response from a client when asserting credentials. + It is the result of the navigator.credentials.get() call on the client side and is + sent to the server for verification during the authentication process. + required: + - id + - rawId + - response + - type + properties: + id: + type: string + description: | + Base64URL-encoded string representing the ID of the credential used for the authentication assertion. + This is typically the same as rawId, but encoded as a string. + example: LFdoCFJTyB82ZzSJUHc-c72yraRc_1mPvGX8ToE8su39xX26Jcqd31LUP5iRLBop + type: + type: string + description: | + String describing the credential type. For WebAuthn, this is always "public-key". + enum: + - public-key + example: public-key + rawId: + type: string + format: byte + description: | + Base64URL-encoded ArrayBuffer containing the credential ID. This ID is used by the + Relying Party to identify the credential used for the authentication assertion. + example: c29tZS1leGFtcGxlLXJhd0lk + authenticatorAttachment: + type: string + description: | + Indicates the authenticator attachment modality used during assertion. This helps identify + the type of authenticator used, either a platform authenticator integrated into the device + or a roaming authenticator that can be connected to different devices. + enum: + - platform + - cross-platform + example: platform + response: + type: object + description: | + The authenticator's response to the client's request to generate an assertion. + Contains information about the authentication like the signature and client data. + required: + - clientDataJSON + - authenticatorData + - signature + properties: + clientDataJSON: + type: string + format: byte + description: | + Base64URL-encoded JSON serialized client data. Contains information about the + authentication like the challenge, origin, and type of credential. + example: c29tZS1leGFtcGxlLXJhd0lk + authenticatorData: + type: string + format: byte + description: | + Base64URL-encoded authenticator data. Contains information about the authentication + such as the RP ID hash, User presence/verification flags, counter, and extensions. + example: c29tZS1leGFtcGxlLXJhd0lk + signature: + type: string + format: byte + description: | + Base64URL-encoded signature. This is the actual assertion signature produced by + the authenticator using its private key. + example: c29tZS1leGFtcGxlLXJhd0lk + userHandle: + type: string + format: byte + description: | + Optional. Base64URL-encoded User handle (user.id). Allows the Relying Party to + link the assertion to a specific User account. It might be empty if the authenticator + doesn't store it. + example: c29tZS1leGFtcGxlLXJhd0lk + PasskeyLoginFinishCore: + type: object + description: Response payload after a User attempts to authenticate using a Passkey + properties: + SecurityAnswer: + type: object + additionalProperties: + type: string + description: The security answers + nullable: true + email: + type: string + description: Email address of the User attempting authentication + example: mymy@yopmail.com + PasskeyCredential: + $ref: '#/components/schemas/PasskeyCredentialAssertionResponse' + PasskeyLoginFinish: + allOf: + - $ref: '#/components/schemas/PasskeyLoginFinishCore' + - $ref: '#/components/schemas/CaptchaModel' + PasskeyLoginAutofillRequestCore: + type: object + properties: + SecurityAnswer: + type: object + additionalProperties: + type: string + description: The security answers + nullable: true + PasskeyCredential: + $ref: '#/components/schemas/PasskeyCredentialAssertionResponse' + PasskeyLoginAutofillRequest: + type: object + description: Response payload after a User attempts to authenticate using a Passkey + allOf: + - $ref: '#/components/schemas/CaptchaModel' + - $ref: '#/components/schemas/PasskeyLoginAutofillRequestCore' + DuoVerifyRequest: + type: object + properties: + State: + type: string + description: The state which is received from Duo authenticator. + example: k93jf0291fj29f3j29fj2309f + Code: + type: string + description: The code which is received from Duo authenticator. + example: DI.1S2dYGJUL5YF4WxLE_M...OXYAHTkw + required: + - State + - Code + TwoFAAuthByBackupCode: + type: object + properties: + backupcode: + type: string + description: The backup code to verify MFA + required: + - backupcode + example: + backupcode: AD45XH56 + ReAuthModelByEmailOtp: + type: object + required: + - emailid + - otp + properties: + emailid: + type: string + description: User's Email address. + otp: + type: string + description: One-Time Password sent to the User's Email. + SendEmailVerificationResponse: + type: object + properties: + IsPosted: + type: boolean + description: Indicates if the Email was successfully posted. + example: true + UUID: + type: string + description: Unique identifier for the request. + example: 6******7-4**5-a**b-c******1 + VerifyDeleteAccountOtp: + type: object + properties: + SecurityAnswer: + type: object + additionalProperties: + type: string + description: Security answers for Account verification + nullable: true + otp: + type: string + description: One-Time Password for Account deletion + minLength: 1 + g-recaptcha-response: + type: string + description: Google reCAPTCHA response + nullable: true + qq_captcha_ticket: + type: string + description: QQ captcha ticket + nullable: true + qq_captcha_randstr: + type: string + description: QQ captcha random string + nullable: true + h-captcha-response: + type: string + description: hCaptcha response + nullable: true + required: + - otp + PrivacyPolicyHistoryResponse: + type: object + properties: + Uid: + type: string + nullable: true + description: The unique identifier (UID) of the User. + example: 123e4567-e89b-12d3-a456-426614174000 + Current: + type: object + nullable: true + description: The current accepted Privacy Policy. + properties: + Version: + type: string + nullable: true + description: The version of the Privacy Policy. + example: '1.0' + AcceptSource: + type: string + nullable: true + description: The source from which the Privacy Policy was accepted. + example: Web + AcceptDateTime: + type: string + format: date-time + nullable: true + description: The date and time when the Privacy Policy was accepted. + example: '2024-03-20T15:30:00Z' + History: + type: array + nullable: true + description: The history of accepted privacy policies. + items: + type: object + properties: + Version: + type: string + nullable: true + description: The version of the Privacy Policy. + example: '1.0' + AcceptSource: + type: string + nullable: true + description: The source from which the Privacy Policy was accepted. + example: Mobile App + AcceptDateTime: + type: string + format: date-time + nullable: true + description: The date and time when the Privacy Policy was accepted. + example: '2023-05-15T10:00:00Z' + SetUserNameRequest: + type: object + required: + - username + properties: + username: + type: string + description: The Username to change of the User + title: Set Or Change UserName Request + description: Structure of the request body for set or change username + Identity: + type: object + properties: + IsPasswordBreached: + type: boolean + description: Indicates if the Password has been breached. + example: false + IsActive: + type: boolean + description: Indicates if the User Account is active. + example: true + IsDeleted: + type: boolean + description: Indicates if the User Account is deleted. + example: false + EmailVerified: + type: boolean + description: Indicates if the User's Email is verified. + example: true + IsLoginLocked: + type: boolean + description: Indicates if the User's login is locked. + example: false + IsRequiredFieldsFilledOnce: + type: boolean + description: Indicates if required fields have been filled at least once. + example: true + FirstLogin: + type: boolean + description: Indicates if this is the User's first login. + example: true + nullable: true + IsProtected: + type: boolean + description: Indicates if the User Account is protected. + example: false + Hireable: + type: boolean + description: Indicates if the User is hireable. + example: true + IsSecurePassword: + type: boolean + description: Indicates if the Password is secure. + nullable: true + example: true + IsCustomUid: + type: boolean + description: Indicates if the UID is custom. + example: false + PhoneIdVerified: + type: boolean + description: Indicates if the Phone ID is verified. + example: true + IsEmailSubscribed: + type: boolean + description: Indicates if the User is subscribed to emails. + example: true + NoOfLogins: + type: integer + description: Number of logins by the User. + example: 10 + FollowersCount: + type: integer + description: Number of followers the User has. + example: 1250 + FriendsCount: + type: integer + description: Number of friends the User has. + example: 458 + TotalStatusesCount: + type: integer + description: Total number of statuses posted by the User. + example: 2341 + NumRecommenders: + type: integer + description: Number of recommenders for the User. + example: 15 + TotalPrivateRepository: + type: integer + description: Total number of private repositories. + example: 8 + PublicGists: + type: integer + description: Total number of public gists. + example: 23 + PrivateGists: + type: integer + description: Total number of private gists. + example: 5 + PinsCount: + type: integer + description: Total number of PINs. + example: 67 + BoardsCount: + type: integer + description: Total number of boards. + example: 12 + LikesCount: + type: integer + description: Total number of likes. + example: 892 + ID: + type: string + description: Unique identifier for the User Profile. + example: usr_12345abc + Provider: + type: string + description: Provider of the User Profile. + example: facebook + FullName: + type: string + description: Full name of the User. + nullable: true + example: John Robert Smith + FirstName: + type: string + nullable: true + description: First name of the User. + example: John + LastName: + type: string + nullable: true + description: Last name of the User. + example: Smith + PhoneId: + type: string + description: Phone ID of the User. + example: +1-555-123-4567 + nullable: true + UserName: + type: string + nullable: true + description: The Username of the User. + example: john_doe + Prefix: + type: string + nullable: true + description: The prefix for the User's name. + example: Mr. + MiddleName: + type: string + description: The middle name of the User. + example: Robert + nullable: true + Suffix: + type: string + nullable: true + description: The suffix for the User's name. + example: Jr. + NickName: + type: string + nullable: true + description: The nickname of the User. + example: Johnny + ProfileName: + type: string + nullable: true + description: The profile name of the User. + example: johnsmith + BirthDate: + type: string + nullable: true + description: The birth date of the User. + example: '1990-05-15' + Gender: + type: string + nullable: true + description: The gender of the User. + example: male + Website: + type: string + nullable: true + description: The website of the User. + example: https://www.johnsmith.com + ThumbnailImageUrl: + type: string + nullable: true + description: The URL of the User's thumbnail image. + example: https://example.com/thumbnails/john.jpg + ImageUrl: + type: string + nullable: true + description: The URL of the User's profile image. + example: https://example.com/images/john.jpg + Favicon: + type: string + nullable: true + description: The URL of the User's favicon. + example: https://example.com/favicon.ico + ProfileUrl: + type: string + nullable: true + description: The URL of the User's profile. + example: https://example.com/profile/johnsmith + HomeTown: + type: string + nullable: true + description: The hometown of the User. + example: Boston + State: + type: string + nullable: true + description: The state of the User. + example: Massachusetts + City: + type: string + nullable: true + description: The city of the User. + example: Cambridge + Industry: + type: string + nullable: true + description: The industry of the User. + example: Technology + About: + type: string + nullable: true + description: A brief description about the User. + example: Passionate software developer with 10+ years of experience + TimeZone: + type: string + nullable: true + description: The time zone of the User. + example: America/New_York + LocalLanguage: + type: string + nullable: true + description: The local language of the User. + example: en-US + CoverPhoto: + type: string + nullable: true + description: The URL of the User's cover photo. + example: https://example.com/cover/john.jpg + TagLine: + type: string + nullable: true + description: The tagline of the User. + example: Building the future through code + Language: + type: string + nullable: true + description: The language of the User. + example: English + Verified: + type: string + description: Indicates if the User is verified. + example: 'true' + nullable: true + UpdatedTime: + type: string + nullable: true + description: The last updated time of the User's profile. + example: '2024-03-20T15:30:00Z' + IsGeoEnabled: + type: string + nullable: true + description: Indicates if geolocation is enabled for the User. + example: 'true' + Associations: + type: string + nullable: true + description: The associations of the User. + example: IEEE, ACM + Honors: + type: string + nullable: true + description: The honors received by the User. + example: Best Developer Award 2023 + HttpsImageUrl: + type: string + nullable: true + description: The HTTPS URL of the User's profile image. + example: https://example.com/secure/images/john.jpg + MainAddress: + nullable: true + type: string + description: The main address of the User. + example: 123 Tech Street, Cambridge, MA 02142 + Created: + nullable: true + type: string + description: The creation date of the User's account. + example: '2020-01-15T10:00:00Z' + LocalCity: + nullable: true + type: string + description: The local city of the User. + example: Cambridge + ProfileCity: + nullable: true + type: string + description: The profile city of the User. + example: Cambridge + LocalCountry: + type: string + nullable: true + description: The local country of the User. + example: United States + ProfileCountry: + type: string + nullable: true + description: The profile country of the User. + example: United States + RelationshipStatus: + type: string + nullable: true + description: The relationship status of the User. + example: Married + Quota: + type: string + nullable: true + description: The quota assigned to the User. + example: '1000' + Quote: + type: string + nullable: true + description: A quote associated with the User. + example: Stay hungry, stay foolish + Religion: + type: string + nullable: true + description: The religion of the User. + example: Private + Political: + type: string + nullable: true + description: The political views of the User. + example: Private + PublicRepository: + type: string + nullable: true + description: The number of public repositories owned by the User. + example: '25' + RepositoryUrl: + type: string + nullable: true + description: The URL of the User's repository. + example: https://github.com/johnsmith + Age: + type: string + description: The age of the User. + example: '33' + nullable: true + ProfessionalHeadline: + type: string + nullable: true + description: The professional headline of the User. + example: Senior Software Engineer at Tech Corp + LRUserID: + type: string + nullable: true + description: The LoginRadius User ID. + example: LR123456 + Currency: + type: string + nullable: true + description: The preferred currency of the User. + example: USD + StarredUrl: + type: string + nullable: true + description: The URL of the User's starred items. + example: https://github.com/johnsmith?tab=stars + GistsUrl: + type: string + nullable: true + description: The URL of the User's gists. + example: https://gist.github.com/johnsmith + Company: + type: string + nullable: true + description: The company the User is associated with. + example: Tech Corp + GravatarImageUrl: + type: string + nullable: true + description: The URL of the User's Gravatar image. + example: https://gravatar.com/avatar/123456 + LastPasswordChangeDate: + nullable: true + type: string + format: date-time + description: The date of the last Password change. + example: '2024-03-15T10:00:00Z' + PasswordExpirationDate: + type: string + format: date-time + nullable: true + description: The expiration date of the Password. + example: '2024-06-15T10:00:00Z' + CreatedDate: + type: string + format: date-time + description: The date the Account was created. + example: '2020-01-15T10:00:00Z' + ModifiedDate: + type: string + format: date-time + description: The date the Account was last modified. + example: '2024-03-20T15:30:00Z' + ProfileModifiedDate: + type: string + format: date-time + nullable: true + description: The date the Profile was last modified. + example: '2024-03-19T12:00:00Z' + LastLoginDate: + nullable: true + type: string + format: date-time + description: The date of the last login. + example: '2024-03-20T16:45:00Z' + SignupDate: + type: string + format: date-time + description: The date the User signed up. + example: '2020-01-15T10:00:00Z' + PrivacyPolicy: + type: object + nullable: true + properties: + Version: + type: string + description: The version of the Privacy Policy. + example: '1.0' + AcceptSource: + type: string + description: The source of the Privacy Policy acceptance. + example: Web + AcceptDateTime: + type: string + format: date-time + description: The date and time of Privacy Policy acceptance. + example: '2024-03-20T15:30:00Z' + Country: + type: object + nullable: true + properties: + Code: + type: string + description: The country code. + example: US + Name: + type: string + description: The country name. + example: United States + AgeRange: + type: object + nullable: true + properties: + Min: + type: integer + description: The minimum age in the range. + example: 18 + Max: + type: integer + description: The maximum age in the range. + example: 35 + KloutScore: + type: object + nullable: true + properties: + KloutId: + type: string + description: The Klout ID. + example: klout_12345 + Score: + type: number + format: float + description: The Klout score. + example: 75.5 + Suggestions: + type: object + nullable: true + properties: + CompaniesToFollow: + type: array + description: List of companies suggested to follow. + items: + type: object + properties: + Id: + type: string + nullable: true + description: The unique identifier. + example: company_12345 + Name: + type: string + nullable: true + description: The name of the company. + example: Tech Corp + IndustriesToFollow: + type: array + description: List of industries suggested to follow. + items: + type: object + properties: + Id: + type: string + nullable: true + description: The unique identifier. + example: industry_12345 + Name: + type: string + nullable: true + description: The name of the industry. + example: Software Development + NewssourceToFollow: + type: array + description: List of news sources suggested to follow. + items: + type: object + properties: + Id: + type: string + nullable: true + description: The unique identifier. + example: news_12345 + Name: + type: string + nullable: true + description: The name of the news source. + example: Tech News Daily + PeopleToFollow: + type: array + description: List of people suggested to follow. + items: + type: object + properties: + Id: + type: string + nullable: true + description: The unique identifier. + example: person_12345 + Name: + type: string + nullable: true + description: The name of the person. + example: John Doe + Subscription: + type: object + nullable: true + properties: + Name: + type: string + description: The name of the subscription. + example: Pro Plan + Space: + type: string + description: The allocated space for the subscription. + example: 100GB + PrivateRepos: + type: string + description: The number of private repositories allowed. + example: '50' + Collaborators: + type: string + description: The number of collaborators allowed. + example: '10' + PIN: + type: object + nullable: true + properties: + Skipped: + type: boolean + description: Indicates if the PIN setup was skipped. + example: false + PIN: + type: string + description: The PIN value. + example: '1234' + LastPINChangeToken: + type: string + description: The token for the last PIN change. + example: token_12345 + nullable: true + LastPINChangeDate: + nullable: true + type: string + format: date-time + description: The date of the last PIN change. + example: '2024-03-15T10:00:00Z' + SkippedDate: + nullable: true + type: string + format: date-time + description: The date the PIN setup was skipped. + example: '2024-03-10T10:00:00Z' + ConsentProfile: + type: object + nullable: true + description: Consent profile details. + properties: + AcceptedConsentVersions: + type: array + nullable: true + items: + type: object + properties: + IsCustom: + type: boolean + description: Indicates if the Consent version is custom. + example: false + Version: + type: integer + description: The version of the Consent. + example: 1 + Event: + type: string + description: The event associated with the Consent. + example: Signup + Consents: + type: array + nullable: true + items: + type: object + properties: + ConsentOptionId: + type: string + description: The ID of the Consent option. + example: 123e4567e89b12d3a456426614174000 + AcceptOnDate: + nullable: true + type: string + format: date-time + description: The date the Consent was accepted. + example: '2024-03-20T15:30:00Z' + RegistrationData: + type: object + nullable: true + description: Registration data details. + properties: + Data: + type: array + nullable: true + items: + type: object + properties: + DataSource: + type: string + description: The source of the registration data. + example: Web + Value: + type: object + properties: + Id: + type: string + description: The ID of the registration data value. + example: data_12345 + ProviderAccessCredential: + type: object + nullable: true + description: Provider access credential details. + properties: + AccessToken: + type: string + description: Access Token for the provider. + example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... + TokenSecret: + type: string + description: Token secret for the provider. + example: abc123def456... + CustomFields: + type: object + nullable: true + additionalProperties: + type: string + description: Custom fields associated with the User. + example: + hobby: Photography + favorite_color: Blue + ProfileImageUrls: + type: object + nullable: true + additionalProperties: + type: string + description: URLs of the User's profile images. + example: + small: https://example.com/small.jpg + large: https://example.com/large.jpg + WebProfiles: + type: object + nullable: true + additionalProperties: + type: string + description: The User's web profiles. + example: + linkedin: https://linkedin.com/in/johndoe + github: https://github.com/johndoe + Roles: + type: array + nullable: true + items: + type: string + description: Roles assigned to the User. + example: + - Admin + - User + Uid: + type: string + example: 577fabca-a33e-4a08-96e6-0ade8d846613 + description: the unique id which belongs to the Account + PreviousUids: + type: array + nullable: true + items: + type: string + description: Previous UIDs associated with the Account. + example: + - old_UID_123 + - old_UID_456 + InterestedIn: + type: array + nullable: true + items: + type: string + description: Interests of the User. + example: + - Technology + - Music + ExternalIds: + type: array + nullable: true + items: + type: object + properties: + Operation: + type: string + description: The operation performed on the external ID. + example: add + Source: + type: string + description: The source of the external ID. + example: LinkedIn + SourceId: + type: string + description: The source ID of the external ID. + example: source_12345 + UnverifiedEmail: + type: array + nullable: true + items: + type: object + properties: + Type: + type: string + description: The type of the Email. + example: Primary + Value: + type: string + description: The Email address. + example: john.doe@example.com + Positions: + type: array + nullable: true + description: List of positions held by the User. + items: + type: object + properties: + Position: + type: string + description: The position held by the User. + example: Senior Software Engineer + Summary: + type: string + description: A summary of the position. + example: Leading backend development team. + StartDate: + type: string + format: date-time + description: The start date of the position. + example: '2022-01-15T00:00:00Z' + EndDate: + type: string + format: date-time + description: The end date of the position. + example: '2024-03-20T00:00:00Z' + IsCurrent: + type: string + description: Indicates if the position is current. + example: 'true' + Location: + type: string + description: The location of the position. + example: New York + Company: + type: object + properties: + Name: + type: string + description: The name of the company. + example: Tech Corp + Type: + type: string + description: The type of the company. + example: Public Company + Industry: + type: string + description: The industry of the company. + example: Software Development + Educations: + type: array + nullable: true + description: List of educational qualifications of the User. + items: + type: object + properties: + School: + type: string + description: The name of the school. + example: MIT + Year: + type: string + description: The year of graduation. + example: '2012' + Type: + type: string + description: The type of degree. + example: Bachelor's + Notes: + type: string + description: Additional notes about the education. + example: Computer Science Major + Activities: + type: string + description: Activities participated in during education. + example: Robotics Club, Coding Competition + Degree: + type: string + description: The degree obtained. + example: BS Computer Science + FieldOfStudy: + type: string + description: The field of study. + example: Computer Science + StartDate: + type: string + format: date-time + description: The start date of the education. + example: '2008-09-01T00:00:00Z' + EndDate: + type: string + format: date-time + description: The end date of the education. + example: '2012-05-30T00:00:00Z' + PhoneNumbers: + type: array + nullable: true + description: List of Phone numbers associated with the User. + items: + type: object + properties: + PhoneType: + type: string + description: The type of Phone (e.g., Mobile, Home). + example: Mobile + PhoneNumber: + type: string + description: The Phone number. + example: +1-555-123-4567 + Operation: + type: string + description: The operation performed on the Phone number. + example: add + IMAccounts: + type: array + nullable: true + description: List of instant messaging accounts associated with the User. + items: + type: object + properties: + AccountType: + type: string + description: The type of instant messaging account. + example: Skype + AccountName: + type: string + description: The name of the instant messaging account. + example: johnsmith_skype + Addresses: + type: array + nullable: true + description: List of addresses associated with the User. + items: + type: object + properties: + Type: + type: string + description: The type of address (e.g., Home, Work). + example: Home + Address1: + type: string + description: The first line of the address. + example: 123 Tech Street + Address2: + type: string + description: The second line of the address. + example: Apt 4B + City: + type: string + description: The city of the address. + example: Cambridge + State: + type: string + description: The state of the address. + example: MA + PostalCode: + type: string + description: The postal code of the address. + example: '02142' + Region: + type: string + description: The region of the address. + example: New England + Country: + type: string + description: The country of the address. + example: USA + Operation: + type: string + description: The operation performed on the address. + example: add + Interests: + type: array + nullable: true + description: List of interests of the User. + items: + type: object + properties: + InterestedType: + type: string + description: The type of interest (e.g., Professional, Personal). + example: Professional + InterestedName: + type: string + description: The name of the interest. + example: Software Architecture + Sports: + type: array + nullable: true + description: List of sports the User is interested in. + items: + type: object + properties: + Id: + type: string + description: The ID of the sport. + example: sport_123 + Name: + type: string + description: The name of the sport. + example: Basketball + InspirationalPeople: + type: array + nullable: true + description: List of inspirational people for the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the person. + example: person_123 + Name: + type: string + description: The name of the person. + example: Linus Torvalds + Awards: + type: array + nullable: true + description: List of awards received by the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the award. + example: award_123 + Name: + type: string + description: The name of the award. + example: Best Developer Award + Issuer: + type: string + description: The issuer of the award. + example: Tech Conference 2023 + Skills: + type: array + nullable: true + description: List of skills possessed by the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the skill. + example: skill_123 + Name: + type: string + description: The name of the skill. + example: Python Programming + CurrentStatus: + type: array + nullable: true + description: List of current statuses of the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the status. + example: status_123 + Text: + type: string + description: The text of the status. + example: Working on exciting new project + Source: + type: string + description: The source of the status. + example: LinkedIn + CreatedDate: + type: string + format: date-time + description: The date the status was created. + example: '2024-03-20T15:30:00Z' + Certifications: + type: array + nullable: true + description: List of certifications obtained by the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the certification. + example: cert_123 + Name: + type: string + description: The name of the certification. + example: AWS Certified Solutions Architect + Authority: + type: string + description: The authority issuing the certification. + example: Amazon Web Services + Number: + type: string + description: The certification number. + example: CERT123456 + StartDate: + type: string + format: date-time + description: The start date of the certification. + example: '2023-01-15T00:00:00Z' + EndDate: + type: string + format: date-time + description: The end date of the certification. + example: '2026-01-15T00:00:00Z' + Courses: + type: array + nullable: true + description: List of courses completed by the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the course. + example: course_123 + Name: + type: string + description: The name of the course. + example: Advanced Machine Learning + Number: + type: string + description: The course number. + example: CS701 + Volunteer: + type: array + nullable: true + description: List of volunteer activities by the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the volunteer activity. + example: vol_123 + Role: + type: string + description: The Role in the volunteer activity. + example: Technical Mentor + Organization: + type: string + description: The organization for the volunteer activity. + example: Code for America + Cause: + type: string + description: The cause of the volunteer activity. + example: Education + RecommendationsReceived: + type: array + nullable: true + description: List of recommendations received by the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the recommendation. + example: rec_123 + RecommendationType: + type: string + description: The type of recommendation. + example: Professional + RecommendationText: + type: string + description: The text of the recommendation. + example: Excellent team player and technical leader + Recommender: + type: string + description: The name of the recommender. + example: Jane Doe + Languages: + type: array + nullable: true + description: List of languages known by the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the language. + example: lang_123 + Name: + type: string + description: The name of the language. + example: English + Proficiency: + type: string + description: The proficiency level in the language. + example: Native + Projects: + type: array + nullable: true + description: List of projects undertaken by the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the project. + example: proj_123 + Name: + type: string + description: The name of the project. + example: AI-Powered Analytics Platform + Summary: + type: string + description: A summary of the project. + example: Led development of machine learning analytics solution + StartDate: + type: string + format: date-time + description: The start date of the project. + example: '2023-01-01T00:00:00Z' + EndDate: + type: string + format: date-time + description: The end date of the project. + example: '2024-01-01T00:00:00Z' + IsCurrent: + type: string + description: Indicates if the project is current. + example: 'true' + Games: + type: array + nullable: true + description: List of games the User is interested in. + items: + type: object + properties: + Id: + type: string + description: The ID of the game. + example: game_123 + Category: + type: string + description: The category of the game. + example: Strategy + Name: + type: string + description: The name of the game. + example: Chess + CreatedDate: + type: string + format: date-time + description: The date the game was added. + example: '2024-01-15T10:30:00Z' + Family: + type: array + nullable: true + description: List of family members of the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the family member. + example: fam_123 + Relationship: + type: string + description: The relationship with the family member. + example: Spouse + Name: + type: string + description: The name of the family member. + example: Jane Smith + TelevisionShow: + type: array + nullable: true + description: List of television shows the User is interested in. + items: + type: object + properties: + Id: + type: string + description: The ID of the television show. + example: show_123 + Category: + type: string + description: The category of the television show. + example: Science Fiction + Name: + type: string + description: The name of the television show. + example: Black Mirror + CreatedDate: + type: string + format: date-time + description: The date the television show was added. + example: '2024-01-15T10:30:00Z' + MutualFriends: + type: array + nullable: true + description: List of mutual friends of the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the mutual friend. + example: friend_123 + Name: + type: string + description: The name of the mutual friend. + example: Alice Johnson + FirstName: + type: string + description: The first name of the mutual friend. + example: Alice + LastName: + type: string + description: The last name of the mutual friend. + example: Johnson + Birthday: + type: string + format: date-time + description: The birthday of the mutual friend. + example: '1992-05-15T00:00:00Z' + Hometown: + type: string + description: The hometown of the mutual friend. + example: Chicago + Link: + type: string + description: The profile link of the mutual friend. + example: https://example.com/profile/alice + Gender: + type: string + description: The gender of the mutual friend. + example: female + Movies: + type: array + nullable: true + description: List of movies the User is interested in. + items: + type: object + properties: + Id: + type: string + description: The ID of the movie. + example: movie_123 + Category: + type: string + description: The category of the movie. + example: Science Fiction + Name: + type: string + description: The name of the movie. + example: The Matrix + Books: + type: array + nullable: true + description: List of books the User is interested in. + items: + type: object + properties: + Id: + type: string + description: The ID of the book. + example: book_123 + Category: + type: string + description: The category of the book. + example: Technology + Name: + type: string + description: The name of the book. + example: Clean Code + CreatedDate: + type: string + format: date-time + description: The date the book was added. + example: '2023-10-01T00:00:00Z' + Patents: + type: array + nullable: true + description: List of patents owned by the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the patent. + example: pat_123 + Title: + type: string + description: The title of the patent. + example: Novel Machine Learning Algorithm + Date: + type: string + format: date-time + description: The date the patent was filed. + example: '2023-10-01T00:00:00Z' + FavoriteThings: + type: array + nullable: true + description: List of favorite things of the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the favorite thing. + example: fav_123 + Name: + type: string + description: The name of the favorite thing. + example: Programming + Type: + type: string + description: The type of the favorite thing. + example: Hobby + RelatedProfileViews: + type: array + nullable: true + description: List of related profile views of the User. + items: + type: object + properties: + FirstName: + type: string + description: The first name of the related profile. + example: Sarah + LastName: + type: string + description: The last name of the related profile. + example: Connor + Id: + type: string + description: The ID of the related profile. + example: view_123 + PlacesLived: + type: array + nullable: true + description: List of places the User has lived. + items: + type: object + properties: + Name: + type: string + description: The name of the place. + example: San Francisco + Operation: + type: string + description: The operation performed on the place. + example: add + IsPrimary: + type: boolean + description: Indicates if the place is the primary residence. + example: true + Publications: + type: array + nullable: true + description: List of publications by the User. + items: + type: object + properties: + Title: + type: string + description: The title of the publication. + example: Modern Software Architecture + Publisher: + type: string + description: The publisher of the publication. + example: Tech Publishing House + Date: + type: string + format: date-time + description: The date the publication was released. + example: '2023-08-15T00:00:00Z' + Id: + type: string + description: The ID of the publication. + example: pub_123 + Url: + type: string + description: The URL of the publication. + example: https://example.com/publications/123 + Summary: + type: string + description: A summary of the publication. + example: A comprehensive guide to modern software architecture + Authors: + type: array + nullable: true + items: + type: object + properties: + Id: + type: string + description: The ID of the author. + example: author_123 + Name: + type: string + description: The name of the author. + example: John Smith + JobBookmarks: + type: array + nullable: true + description: List of job bookmarks by the User. + items: + type: object + properties: + IsApplied: + type: boolean + description: Indicates if the job has been applied for. + example: true + IsSaved: + type: boolean + description: Indicates if the job has been saved. + example: true + ApplyTimestamp: + type: string + format: date-time + description: The timestamp of the job application. + example: '2024-02-15T14:30:00Z' + SavedTimestamp: + type: string + format: date-time + description: The timestamp of the job being saved. + example: '2024-02-14T10:00:00Z' + Job: + type: object + properties: + Active: + type: boolean + description: Indicates if the job is active. + example: true + Id: + type: string + description: The ID of the job. + example: job_123 + DescriptionSnippet: + type: string + description: A snippet of the job description. + example: Senior Role in cloud architecture + PostingTimestamp: + type: string + format: date-time + description: The timestamp of the job posting. + example: '2024-02-01T09:00:00Z' + Badges: + type: array + nullable: true + description: List of badges earned by the User. + items: + type: object + properties: + BadgeId: + type: string + description: The ID of the badge. + example: badge_123 + Name: + type: string + description: The name of the badge. + example: Top Contributor + BadgeMessage: + type: string + description: The message associated with the badge. + example: Awarded for exceptional contributions + Description: + type: string + description: A description of the badge. + example: Recognition for community support + ImageUrl: + type: string + description: The URL of the badge image. + example: https://example.com/badges/top-contributor.png + MemberUrlResources: + type: array + nullable: true + description: List of member URL resources. + items: + type: object + properties: + Url: + type: string + description: The URL of the resource. + example: https://johnsmith.dev + UrlName: + type: string + description: The name of the URL resource. + example: Portfolio + Organizations: + type: array + nullable: true + description: List of organizations associated with the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the organization. + example: org_123 + Name: + type: string + description: The name of the organization. + example: Acme Corp + LogoURL: + type: string + description: The logo URL of the organization. + example: https://cdn.example.com/orgs/acme/logo.png + ObjectId: + type: string + description: The object ID of the User. + example: 507f1f77bcf86cd799439011 + Email: + type: array + nullable: true + description: List of Email addresses associated with the User. + items: + type: object + properties: + Type: + type: string + description: The type of the Email (e.g., Primary, Secondary). + example: Primary + Value: + type: string + description: The Email address. + example: john.doe@example.com + PasskeyLogin: + type: object + nullable: true + description: Passkey login details for the User. + properties: + ProgressiveEnrollmentDate: + nullable: true + type: string + format: date-time + description: The date of progressive enrollment. + example: '2024-03-15T10:00:00Z' + IdentityResponseWithSocialWithoutLoginsCore: + type: object + properties: + Identities: + type: array + nullable: true + description: List of identities with social information but without login details. + items: + $ref: '#/components/schemas/SocialIdentity' + IdentityResponseWithSocialWithoutLogins: + type: object + allOf: + - $ref: '#/components/schemas/Identity' + - $ref: '#/components/schemas/IdentityResponseWithSocialWithoutLoginsCore' + UpdateByTokenResponse: + properties: + IsPosted: + type: boolean + Data: + $ref: '#/components/schemas/IdentityResponseWithSocialWithoutLogins' + IsDeleteRequestAccepted: + description: Indicates if the item delete request is accepted + type: object + properties: + IsDeleteRequestAccepted: + type: boolean + AuthenticatorCodeRequest: + type: object + description: >- + Body for the TOTP verification endpoints. LoginRadius has two + authenticator generations and they do NOT share a field name: a tenant + on Google Authenticator must send `googleauthenticatorcode`, while the + newer generic authenticator uses `authenticatorcode`. Sending the wrong + one returns ErrorCode 908 ("The googleauthenticatorcode is a required + parameter." / "The authenticatorcode is a required parameter."), so both + are declared here and callers populate whichever their tenant expects. + DO NOT drop `googleauthenticatorcode` when refreshing this file from an + external copy — tools/verify-spec-invariants.mjs will fail the build. + properties: + googleauthenticatorcode: + type: string + description: >- + The Google Authenticator (TOTP) code. Required by tenants configured + for Google Authenticator. + authenticatorcode: + type: string + description: >- + The Authenticator code for multi-factor authentication. Used by + tenants on the newer generic authenticator configuration. + PasskeyCredentialObject: + type: object + description: A single credential object + properties: + Id: + type: string + description: Unique identifier for the Passkey credential, typically a hashed or encoded key ID. + example: 43e4417bd2de4a1fa82445274f864203 + Authenticator: + type: string + description: (Optional) Name of the authenticator used to register the Passkey, such as iCloud Keychain or Windows Hello. May be null or omitted if not available. + example: iCloud Keychain + Identifier: + type: string + description: User-provided identifier associated with the Passkey, usually an unique id. + example: efdc233182cd4f578432d2134ea75081 + CreatedAt: + type: string + format: date-time + description: Timestamp indicating when the Passkey credential was created. + example: '2024-06-03T08:40:58.088Z' + PasskeyListResponse: + type: object + description: Response containing a list of registered Passkey credentials + properties: + Credentials: + type: array + description: List of Passkey credentials associated with the User + items: + $ref: '#/components/schemas/PasskeyCredentialObject' + MFABackUpCodeResponse: + type: object + properties: + BackUpCodes: + type: array + items: + type: string + description: List of Backup Codes generated for MFA + required: + - BackUpCodes + example: + BackUpCodes: + - ABC123DEF + - XYZ789GHI + - JKL456MNO + - PQR987STU + - VWX654YZA + ReAuthResponse: + type: object + properties: + SecondFactorValidationToken: + type: string + description: The token used for second factor validation. + example: 68***-91**-****-b**b-e**********9 + ExpireIn: + type: string + format: date-time + description: Expiry timestamp for the token. + example: '2023-10-01T12:00:00Z' + required: + - SecondFactorValidationToken + - ExpireIn + PasskeyForgotCore: + type: object + properties: + email: + type: string + description: Email address of the User requesting a Passkey reset + example: xyz@example.com + PasskeyForgot: + type: object + description: Request to reset the Passkey associated with a User account due to loss or inability to access the current Passkey + allOf: + - $ref: '#/components/schemas/CaptchaModel' + - $ref: '#/components/schemas/PasskeyForgotCore' + AccessTokenResponse: + type: object + properties: + access_token: + type: string + example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c + description: Bearer token for authenticating API requests. + refresh_token: + type: string + example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c + description: Long-lived token for obtaining new Access Tokens. + expires_in: + type: string + example: '3600' + description: Expiration time of the Access Token in seconds. + AccessTokenInfo: + type: object + properties: + provider: + type: string + description: The provider for which the Access Token is issued. + example: facebook + access_token: + type: string + description: The Access Token associated with the provider. + example: '********-****-****-****-************' + isrememberme: + type: boolean + description: Indicates whether the "Remember Me" option was selected during login. + example: true + UnlockAccountRequestCore: + type: object + required: + - SecurityAnswer + properties: + SecurityAnswer: + type: object + description: Security answer's of the User if the User is locked by security questions + CandidateTokenModel: + type: object + properties: + candidatetoken: + type: string + description: The candidate token + required: + - candidatetoken + UnlinkSocialIdentityRequest: + type: object + required: + - provider + - providerid + properties: + provider: + type: string + providerid: + type: string + access_token: + type: string + title: Unlink social identities request + description: Structure of the request body for unlinking the social identities from profile + ClientGuidBodyModel: + properties: + clientgUID: + type: string + description: The client's gUID to link social identity + access_token: + type: string + description: The Access Token of the User + title: Link social identity with gUID + description: Structure of the request body to link social identity + IsRegistered: + type: object + properties: + IsRegistered: + type: boolean + description: Indicates if the Push Notification device is registered + example: true + OneTouchLoginByEmail: + type: object + properties: + Email: + type: string + format: email + description: The Email address for the one-touch login. + example: user@example.com + Name: + type: string + description: The name of the User. + example: John Doe + ClientGuid: + type: string + description: The client GUID for the one-touch login process. + example: 123e4567-e89b-12d3-a456-426614174000 + GoogleRecaptchaResponse: + type: string + description: Google reCAPTCHA response. + example: 03AGdBq26... + QQCaptchaTicket: + type: string + description: QQ Captcha ticket. + example: ticket123 + QQCaptchaRandomString: + type: string + description: QQ Captcha random string. + example: random123 + HCaptchaResponse: + type: string + description: hCaptcha response. + example: hCaptcha123 + required: + - Email + - ClientGuid + OneTouchLoginByPhone: + type: object + properties: + Phone: + type: string + description: The Phone number for the one-touch login. + example: '+1234567890' + Name: + type: string + description: The name of the User. + example: John Doe + GoogleRecaptchaResponse: + type: string + description: Google reCAPTCHA response. + example: 03AGdBq26... + QQCaptchaTicket: + type: string + description: QQ Captcha ticket. + example: ticket123 + QQCaptchaRandomString: + type: string + description: QQ Captcha random string. + example: random123 + HCaptchaResponse: + type: string + description: hCaptcha response. + example: hCaptcha123 + required: + - Phone + VerifyOtpPhoneModel: + type: object + properties: + SecurityAnswer: + type: object + additionalProperties: + type: string + description: Optional security answers for additional verification. + example: + question1: answer1 + question2: answer2 + Phone: + type: string + description: The Phone number for OTP verification. + example: '+1234567890' + GoogleRecaptchaResponse: + type: string + description: Google reCAPTCHA response. + example: 03AGdBq26... + QQCaptchaTicket: + type: string + description: QQ Captcha ticket. + example: ticket123 + QQCaptchaRandomString: + type: string + description: QQ Captcha random string. + example: random123 + HCaptchaResponse: + type: string + description: hCaptcha response. + example: hCaptcha123 + required: + - Phone + IsPostedVerified: + type: object + properties: + IsPosted: + type: boolean + description: Indicates if the item is posted. + example: true + IsVerified: + type: boolean + description: Indicates if the item is verified. + example: true + PinReauthRequest: + type: object + required: + - pin + properties: + pin: + type: string + description: The PIN code to reauthenticate the User. + example: '123456' + PasswordReauthRequestCore: + type: object + properties: + SecurityAnswer: + type: object + additionalProperties: + type: string + description: The security answers which is set for the User, this will be used when the User is blocked for the security question. + nullable: true + Password: + type: string + description: The Password of the User + PasswordReauthRequest: + type: object + allOf: + - $ref: '#/components/schemas/CaptchaModel' + - $ref: '#/components/schemas/PasswordReauthRequestCore' + example: + password: MySecurePassword123! + SecurityAnswer: + 9d1f4208bda845d885eab43266d6543f: Smith + g-recaptcha-response: 03AGdBq24... + qq_captcha_ticket: ticket-example + qq_captcha_randstr: randstr-example + h-captcha-response: 10000000-aaaa-bbbb-cccc-000000000001 + ReAuthTwoFAModelCore: + type: object + properties: + googleauthenticatorcode: + type: string + otp: + type: string + backupcode: + type: string + authenticatorcode: + type: string + securityAnswer: + type: object + additionalProperties: + type: string + oneOf: + - required: + - googleauthenticatorcode + - required: + - otp + - required: + - backupcode + - required: + - authenticatorcode + ReAuthTwoFAModel: + type: object + allOf: + - $ref: '#/components/schemas/CaptchaModel' + - $ref: '#/components/schemas/ReAuthTwoFAModelCore' + example: + otp: '1234' + g-recaptcha-response: 03AGdBq24... + TwoFAAuthBySecQuesAuthModel: + type: object + required: + - securityquestionanswer + properties: + securityquestionanswer: + type: array + description: List of security question answers (required, not blank) + items: + type: object + required: + - QuestionId + - Answer + properties: + QuestionId: + type: string + description: ID of the security question (required, not blank) + example: 1eb72cc9-7a2c-44f7-817d-00a94a9c1a24 + Answer: + type: string + description: Answer to the security question (required, not blank) + example: cat + PhoneOTPModelCore: + type: object + properties: + OTP: + type: string + description: The one-time Password (OTP). + example: '123456' + Phone: + type: string + description: The Phone number associated with the OTP. + example: '+1234567890' + SecurityAnswer: + type: object + additionalProperties: + type: string + description: Optional security answers for additional verification. + required: + - OTP + - Phone + PhoneOTPModel: + type: object + allOf: + - $ref: '#/components/schemas/CaptchaModel' + - $ref: '#/components/schemas/PhoneOTPModelCore' + PasswordLessUserNameOTPModelCore: + type: object + properties: + SecurityAnswer: + type: object + additionalProperties: + type: string + description: The security answers which is set for the User, this will be used when the User is blocked for the security question. + nullable: true + WelcomeEmailTemplate: + type: string + description: The template for the welcome Email. + example: WelcomeTemplate + Otp: + type: string + description: The one-time Password (OTP) for verification. + example: '123456' + UserName: + type: string + description: The Username associated with the Account. + example: john_doe + required: + - Otp + - UserName + PasswordLessUserNameOTPModel: + type: object + allOf: + - $ref: '#/components/schemas/CaptchaModel' + - $ref: '#/components/schemas/PasswordLessUserNameOTPModelCore' + PasswordLessEmailOTPModelCore: + type: object + properties: + SecurityAnswer: + type: object + additionalProperties: + type: string + description: The security answers which is set for the User, this will be used when the User is blocked for the security question. + nullable: true + WelcomeEmailTemplate: + type: string + description: The template for the welcome Email. + example: WelcomeTemplate + Otp: + type: string + description: The one-time Password (OTP) for verification. + example: '123456' + Email: + type: string + description: The Email associated with the Account. + example: hello@example.com + required: + - Otp + - Email + PasswordLessEmailOTPModel: + type: object + allOf: + - $ref: '#/components/schemas/CaptchaModel' + - $ref: '#/components/schemas/PasswordLessEmailOTPModelCore' + PINLoginModel: + type: object + required: + - pin + properties: + pin: + type: string + description: PIN used to log in the User. + g-recaptcha-response: + type: string + description: Google reCAPTCHA response. + nullable: true + qq_captcha_ticket: + type: string + description: QQ captcha ticket. + nullable: true + qq_captcha_randstr: + type: string + description: QQ captcha random string. + nullable: true + h-captcha-response: + type: string + description: hCaptcha response. + nullable: true + example: + pin: '7890' + CustomObjectResponseModel: + type: object + properties: + IsActive: + type: boolean + example: true + IsDeleted: + type: boolean + example: false + CustomObject: + type: object + additionalProperties: true + example: + key1: value1 + key2: 123 + Id: + type: string + example: abc123 + Uid: + type: string + example: user456 + DateCreated: + type: string + format: date-time + example: '2024-05-28T12:34:56Z' + DateModified: + type: string + format: date-time + example: '2024-05-29T09:10:11Z' + CustomObjectsResponseModel: + type: object + properties: + Count: + type: integer + example: 2 + data: + type: array + items: + $ref: '#/components/schemas/CustomObjectResponseModel' + CustomObjectRequest: + type: object + additionalProperties: true + example: + firstName: John + lastName: Doe + age: 30 + address: + street: 123 Main St + city: Metropolis + isActive: true + PhoneIdModel: + type: object + properties: + phone: + type: string + description: The Phone number of the User. + required: + - phone + example: + phone: '+1234567890' + description: This model is used in changing the Phone number. + PhoneIdModelOptional: + type: object + properties: + phone: + type: string + description: The Phone number of the User. + example: + phone: '+1234567890' + description: This model is used while resending the OTP to Phone number. + ChangePinCore: + type: object + required: + - oldpin + - newpin + properties: + oldpin: + type: string + example: '7547' + newpin: + type: string + example: '4321' + SecurityAnswer: + type: object + additionalProperties: + type: string + description: Optional map of security question IDs/keys to answers, used to unlock an account that is locked pending security-question verification. + example: + mother_maiden_name: Smith + ChangePin: + allOf: + - $ref: '#/components/schemas/CaptchaModel' + - $ref: '#/components/schemas/ChangePinCore' + PINModel: + type: object + required: + - pin + properties: + pin: + type: string + description: New PIN to be set by the User. + example: + pin: '7890' + ForgotPinByEmail: + type: object + properties: + email: + type: string + description: The Email of the User. + required: + - email + example: + email: test@example.com + description: This model is used in forgot PIN by Email API + ForgotPinByUsername: + type: object + properties: + username: + type: string + description: The Username of the User. + required: + - username + example: + username: jamesbond + description: This model is used in forgot PIN by Username API + ForgotPinByPhone: + type: object + properties: + phone: + type: string + description: The Phone number of the User. + required: + - phone + example: + phone: '+1234567890' + description: This model is used in forgot PIN by Phone API + ResetPINByOTP: + type: object + required: + - otp + - pin + properties: + otp: + type: string + description: One-Time Password received by the User for verification. + pin: + type: string + description: New PIN to be set by the User. + phone: + type: string + description: Phone number associated with the User's account. + username: + type: string + description: Username of the User. + email: + type: string + format: email + description: Email address associated with the User's account. + g-recaptcha-response: + type: string + description: Google reCAPTCHA response. + nullable: true + qq_captcha_ticket: + type: string + description: QQ captcha ticket. + nullable: true + qq_captcha_randstr: + type: string + description: QQ captcha random string. + nullable: true + h-captcha-response: + type: string + description: hCaptcha response. + nullable: true + oneOf: + - required: + - phone + - required: + - email + - required: + - username + example: + otp: '123456' + pin: '7890' + username: johndoe + ResetPINByToken: + type: object + required: + - resettoken + - pin + properties: + resettoken: + type: string + description: The reset token received via Email. + pin: + type: string + description: New PIN to be set by the User. + example: + pin: '7890' + resettoken: xxxxxxxxxxxxxxxxxxxx + MFAPhoneUpdateModel: + type: object + properties: + phoneno2fa: + type: string + description: The Phone number of the User. + required: + - phoneno2fa + example: + phoneno2fa: '+1234567890' + description: This model is used in changing the Phone number. + MFAVerifyPhoneOtpModelCore: + type: object + required: + - otp + properties: + SecurityAnswer: + type: object + additionalProperties: + type: string + description: Optional security answers for additional verification. + example: + 9d1f4208bda845d885eab43266d6543f: Fluffy + 9d1f4208bda845d885eab43266d65500: Smith + otp: + type: string + description: The one-time Password (OTP). + example: '123456' + MFAVerifyPhoneOtpModel: + type: object + allOf: + - $ref: '#/components/schemas/CaptchaModel' + - $ref: '#/components/schemas/MFAVerifyPhoneOtpModelCore' + ConsentData: + type: object + properties: + consentoptionid: + type: string + example: marketing_emails + isaccepted: + type: boolean + example: true + required: + - consentoptionid + - isaccepted + ConsentUpdate: + type: object + properties: + consents: + type: array + items: + $ref: '#/components/schemas/ConsentData' + example: + - consentoptionid: marketing_emails + isaccepted: true + required: + - consents + ConsentVersion: + type: object + properties: + IsCustom: + type: boolean + example: true + Version: + type: integer + example: 1 + Event: + type: string + example: newsletter_signup + ConsentOption: + type: object + properties: + ConsentOptionId: + type: string + example: 123e4567e89b12d3a456426614174000 + AcceptOnDate: + type: string + format: date-time + example: '2023-10-01T12:00:00Z' + ConsentProfile: + type: object + properties: + AcceptedConsentVersions: + type: array + items: + $ref: '#/components/schemas/ConsentVersion' + example: + - IsCustom: true + Version: 1 + Event: newsletter_signup + Consents: + type: array + items: + $ref: '#/components/schemas/ConsentOption' + example: + - ConsentOptionId: 123e4567e89b12d3a456426614174000 + AcceptOnDate: '2023-10-01T12:00:00Z' + ConsentEvent: + type: object + properties: + event: + type: string + example: newsletter_signup + iscustom: + type: boolean + example: false + required: + - event + - iscustom + ConsentSubmit: + type: object + properties: + events: + type: array + items: + $ref: '#/components/schemas/ConsentEvent' + example: + - event: newsletter_signup + iscustom: false + data: + type: array + items: + $ref: '#/components/schemas/ConsentData' + example: + - consentoptionid: marketing_emails + isaccepted: true + required: + - events + - data + ConsentResponse: + type: object + properties: + Profile: + $ref: '#/components/schemas/Profile' + access_token: + type: string + description: The Access Token string + refresh_token: + type: string + description: The refresh token string + expires_in: + type: string + description: Expiration time of the Access Token + ConsentProfileLog: + type: object + properties: + ConsentId: + type: string + description: Unique identifier for the consent option + example: 123e4567e89b12d3a456426614174000 + Event: + type: string + description: Event associated with this consent log entry + example: newsletter_signup + ConsentLog: + type: object + properties: + UpdateType: + type: string + description: Type of update performed + example: consent-update + nullable: true + UserAgent: + type: string + description: User agent string + example: Mozilla/5.0 + nullable: true + IP: + type: string + description: IP address of the User + example: 192.168.1.1 + nullable: true + Host: + type: string + description: Host information + example: loginradius.com + nullable: true + LoggedOnDate: + type: string + format: date-time + description: Date and time when the log was created + example: '2025-07-15T12:34:56Z' + nullable: true + CurrentConsentFormsVersions: + type: array + items: + $ref: '#/components/schemas/ConsentVersion' + description: List of current consent form versions + ConsentLogs: + type: array + items: + $ref: '#/components/schemas/ConsentProfileLog' + nullable: true + description: List of consent profile logs + Id: + type: string + description: ObjectId (MongoDB) of the log entry + example: 60c72b2f9b1e8d3f4c8b4567 + ConsentLogsResponse: + type: object + properties: + Uid: + type: string + description: User identifier + nullable: true + ConsentLogs: + type: array + items: + $ref: '#/components/schemas/ConsentLog' + description: List of consent logs + nullable: true + VerifyConsent: + type: object + properties: + ConsentProfile: + $ref: '#/components/schemas/ConsentProfile' + IsValid: + type: boolean + description: Indicates if the consent is valid + InvitationToken: + type: object + properties: + Email: + type: string + description: The Email address of the User to whom the invitation is sent. + example: test@example.com + Status: + type: string + enum: + - Accepted + - Revoked + - Expired + - Invited + description: The status of the invitation. Possible values are *invited*, *accepted*, *expired*, and *revoked*. + example: Invited + IsEmailExist: + type: boolean + description: Indicates whether the Email address is already associated with an existing User account. + example: true + EmailVerificationOrForgotPINModel: + type: object + properties: + email: + type: string + format: email + description: The Email address of the User + example: john.doe@gmail.com + required: + - email + description: This model is used to verify the Email address of a User or send the forgot PIN request. It requires the Email address of the User. + AddEmailModelManage: + type: object + properties: + email: + type: string + format: email + description: Email to add to the User's Account. + type: + type: string + description: Email type (e.g., primary or secondary). + uid: + type: string + description: The UID of the User. + required: + - email + - type + - uid + description: The model is used to add an Email address to a User account. It requires the Email address, the type of Email (e.g., primary or secondary), and the User's unique identifier (UID). + example: + email: user@example.com + type: secondary + uid: abc123 + ForgotPasswordOrPasswordLessLoginOrAutoLoginModel: + type: object + properties: + email: + type: string + format: email + description: The Email address of the User. + example: user@example.com + username: + type: string + example: johndoe + description: The Username of the User. + anyOf: + - required: + - email + - required: + - username + DeleteUserModel: + type: object + properties: + uid: + type: string + example: abc123 + description: The UID of the User. + required: + - uid + GenerateTokenResponse: + type: object + properties: + Token: + type: string + example: e3c12e4f2c134f2ba2c6f623e1d3be7f + description: The generated token for the specific request. + ExpiresIn: + type: string + format: date-time + example: '2025-12-31T23:59:59Z' + description: The expiration date and time of the token. + IdentityProviders: + type: array + items: + type: string + nullable: true + description: The identity providers associated with the specified token, it will display a list of identity providers from where the User is already authenticated. + example: + - google + - facebook + AddPhoneModel: + type: object + properties: + phone: + type: string + description: Phone number to add to the User's Account. + uid: + type: string + description: The UID of the User. + required: + - phone + - uid + description: This model is used to add a Phone number to a User account. It requires the Phone number and the User's unique identifier (UID). + example: + phone: '+1234567890' + uid: abc123 + OneTouchLoginPhoneModel: + type: object + properties: + phone: + type: string + description: The Phone number of the User. + name: + type: string + description: The name of the User. + required: + - phone + example: + phone: '+1234567890' + name: john doe + TimeStamp: + type: string + format: date-time + description: Timestamp in ISO 8601 format with milliseconds and timezone. + example: '2024-05-14T12:34:56.789Z' + RoleContext: + type: object + properties: + Context: + type: string + nullable: true + description: The Context name. + example: school + Roles: + type: array + items: + type: string + description: List of Roles in this Context. + example: + - Admin + - Student + AdditionalPermissions: + type: array + items: + type: string + description: Additional Permissions for this Context. + example: + - read + - write + Expiration: + $ref: '#/components/schemas/TimeStamp' + RoleContextResponseModal: + type: object + properties: + Data: + type: array + items: + $ref: '#/components/schemas/RoleContext' + description: List of Role Contexts. + required: + - Data + RoleContextBodyModel: + type: object + properties: + Roles: + type: array + items: + type: string + description: List of Roles for the Context. + example: + - Admin + - Student + AdditionalPermissions: + type: array + items: + type: string + description: Additional Permissions for the Context. + example: + - read + - write + Expiration: + type: string + format: date-time + nullable: true + description: Expiration date/time in ISO 8601 format. + example: '2025-05-14T12:34:56.789Z' + Context: + type: string + description: The Context name or identifier. + example: school + required: + - Roles + - AdditionalPermissions + - Context + UpdateRoleContextBodyModel: + type: object + properties: + rolecontext: + type: array + items: + $ref: '#/components/schemas/RoleContextBodyModel' + description: List of Role Context objects. + required: + - rolecontext + RoleContextBody: + type: object + properties: + Context: + type: string + nullable: true + example: school + Roles: + type: array + items: + type: string + example: + - Admin + - Student + AdditionalPermissions: + type: array + items: + type: string + example: + - read + - write + Expiration: + $ref: '#/components/schemas/TimeStamp' + SecondFactorAuthenticator: + type: object + properties: + IsVerified: + type: boolean + example: true + IsEnabled: + type: boolean + example: true + SecondFactor: + type: string + nullable: true + example: TOTP + PushDevice: + type: object + properties: + deviceName: + type: string + example: Pixel 7 + deviceType: + type: string + example: Android + deviceToken: + type: string + example: abcdef123456 + publicKey: + type: string + example: MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAn... + createdAt: + type: string + format: date-time + example: '2025-05-14T12:34:56.789Z' + SecondFactorAuthenticationPushDevice: + type: object + properties: + IsVerified: + type: boolean + example: true + IsEnabled: + type: boolean + example: true + PushDevice: + $ref: '#/components/schemas/PushDevice' + CredentialObj: + type: object + properties: + Id: + type: string + description: Unique credential identifier. + example: a1b2c3d4e5f6 + Authenticator: + type: string + description: Authenticator type. + example: FIDO2 + Identifier: + type: string + description: Credential identifier (e.g., Username or email). + example: user@example.com + CreatedAt: + type: string + format: date-time + description: Credential creation time. + example: '2025-05-14T12:34:56.789Z' + SecondFactorAuthenticationPasskeyCredential: + type: object + properties: + IsVerified: + type: boolean + example: true + IsEnabled: + type: boolean + example: true + PasskeyCredential: + $ref: '#/components/schemas/CredentialObj' + GenericSecondFactorAuthentication: + type: object + properties: + GoogleAuthenticator: + $ref: '#/components/schemas/SecondFactorAuthenticator' + OTPAuthenticator: + $ref: '#/components/schemas/SecondFactorAuthenticator' + EmailOTPAuthenticator: + $ref: '#/components/schemas/SecondFactorAuthenticator' + BackUpCodes: + type: array + items: + type: string + example: + - '123456' + - '654321' + - '789012' + Authenticator: + $ref: '#/components/schemas/SecondFactorAuthenticator' + PushAuthenticator: + $ref: '#/components/schemas/SecondFactorAuthenticationPushDevice' + DuoSecurityAuthenticator: + $ref: '#/components/schemas/SecondFactorAuthenticator' + PasskeyAuthenticator: + $ref: '#/components/schemas/SecondFactorAuthenticationPasskeyCredential' + SecondFactorAuthenticationCore: + type: object + properties: + SecurityQuestionAuthenticator: + $ref: '#/components/schemas/SecondFactorAuthenticator' + SecondFactorAuthentication: + allOf: + - $ref: '#/components/schemas/GenericSecondFactorAuthentication' + - $ref: '#/components/schemas/SecondFactorAuthenticationCore' + Email: + type: object + properties: + Type: + type: string + description: The type of the Email (e.g., primary, secondary). + example: primary + Value: + type: string + format: email + description: The Email address. + example: user@example.com + required: + - Type + - Value + RoleContextProfileModel: + type: object + properties: + RoleContext: + $ref: '#/components/schemas/RoleContextBody' + Uid: + type: string + nullable: true + description: Unique identifier for the User. + example: '12345' + LastLoginDate: + type: string + format: date-time + nullable: true + description: Last login date in ISO 8601 format. + example: '2025-05-14T12:34:56.789Z' + FullName: + type: string + nullable: true + description: Full name of the User. + example: John Doe + ImageUrl: + type: string + nullable: true + description: URL to the User's image. + example: https://example.com/avatar.jpg + SecondFactorAuthentication: + $ref: '#/components/schemas/SecondFactorAuthentication' + Email: + type: array + items: + $ref: '#/components/schemas/Email' + required: + - RoleContext + - Email + RoleContextProfileResponseModel: + type: object + properties: + Data: + type: array + items: + $ref: '#/components/schemas/RoleContextProfileModel' + description: List of Role Context profiles. + required: + - Data + UserRolesModel: + type: object + properties: + Roles: + type: array + items: + type: string + description: List of User Roles. + example: + - Admin + - User + DeleteResponse: + type: object + properties: + IsDeleted: + type: boolean + description: Indicates if the resource was deleted + RemoveRoleContextRoleModel: + type: object + properties: + roles: + type: array + items: + type: string + description: List of Roles to remove. + example: + - Admin + - Student + required: + - roles + RemoveRoleContextAdditionalPermissionsModel: + type: object + properties: + additionalpermissions: + type: array + items: + type: string + description: List of Additional Permissions to remove. + example: + - read + - write + required: + - additionalpermissions + ManageRegisterModel: + type: object + properties: + Uid: + type: string + nullable: true + description: The unique identifier (UID) of the User. + example: 123e4567-e89b-12d3-a456-426614174000 + UserName: + type: string + nullable: true + description: The Username of the User. + example: john_doe + PhoneId: + type: string + nullable: true + description: The Phone ID of the User. + example: +1-555-123-4567 + Gender: + type: string + nullable: true + description: The gender of the User. + example: male + BirthDate: + type: string + nullable: true + description: The birth date of the User. + example: '1990-05-15' + Prefix: + type: string + nullable: true + description: The prefix for the User's name. + example: Mr. + FirstName: + type: string + nullable: true + description: The first name of the User. + example: John + MiddleName: + type: string + nullable: true + description: The middle name of the User. + example: Robert + LastName: + type: string + nullable: true + description: The last name of the User. + example: Smith + Suffix: + type: string + nullable: true + description: The suffix for the User's name. + example: Jr. + NickName: + type: string + nullable: true + description: The nickname of the User. + example: Johnny + ProfileName: + type: string + nullable: true + description: The profile name of the User. + example: johnsmith + About: + type: string + nullable: true + description: A brief description about the User. + example: Passionate software developer with 10+ years of experience + Company: + type: string + nullable: true + description: The company the User is associated with. + example: Tech Corp + ImageUrl: + type: string + nullable: true + description: The URL of the User's profile image. + example: https://example.com/images/john.jpg + TimeZone: + type: string + nullable: true + description: The time zone of the User. + example: America/New_York + Website: + type: string + nullable: true + description: The website of the User. + example: https://www.johnsmith.com + ThumbnailImageUrl: + type: string + nullable: true + description: The URL of the User's thumbnail image. + example: https://example.com/thumbnails/john.jpg + Favicon: + type: string + nullable: true + description: The URL of the User's favicon. + example: https://example.com/favicon.ico + ProfileUrl: + type: string + nullable: true + description: The URL of the User's profile. + example: https://example.com/profile/johnsmith + HomeTown: + type: string + nullable: true + description: The hometown of the User. + example: Boston + State: + type: string + nullable: true + description: The state of the User. + example: Massachusetts + City: + type: string + nullable: true + description: The city of the User. + example: Cambridge + Industry: + type: string + nullable: true + description: The industry of the User. + example: Technology + LocalLanguage: + type: string + nullable: true + description: The local language of the User. + example: en-US + Language: + type: string + nullable: true + description: The language of the User. + example: English + CoverPhoto: + type: string + nullable: true + description: The URL of the User's cover photo. + example: https://example.com/cover/john.jpg + TagLine: + type: string + nullable: true + description: The tagline of the User. + example: Building the future through code + MainAddress: + type: string + nullable: true + description: The main address of the User. + example: 123 Tech Street, Cambridge, MA 02142 + LocalCity: + type: string + nullable: true + description: The local city of the User. + example: Cambridge + ProfileCity: + type: string + nullable: true + description: The profile city of the User. + example: Cambridge + LocalCountry: + type: string + nullable: true + description: The local country of the User. + example: United States + ProfileCountry: + type: string + nullable: true + description: The profile country of the User. + example: United States + Quota: + type: string + nullable: true + description: The quota assigned to the User. + example: '1000' + Religion: + type: string + nullable: true + description: The religion of the User. + example: Private + Political: + type: string + nullable: true + description: The political views of the User. + example: Private + RelationshipStatus: + type: string + nullable: true + description: The relationship status of the User. + example: Married + HttpsImageUrl: + type: string + nullable: true + description: The HTTPS URL of the User's profile image. + example: https://example.com/secure/images/john.jpg + IsGeoEnabled: + type: string + nullable: true + description: Indicates if geolocation is enabled for the User. + example: 'true' + Associations: + type: string + nullable: true + description: The associations of the User. + example: IEEE, ACM + Honors: + type: string + nullable: true + description: The honors received by the User. + example: Best Developer Award 2023 + PublicRepository: + type: string + nullable: true + description: The number of public repositories owned by the User. + example: '25' + RepositoryUrl: + type: string + nullable: true + description: The URL of the User's repository. + example: https://github.com/johnsmith + ProfessionalHeadline: + type: string + nullable: true + description: The professional headline of the User. + example: Senior Software Engineer at Tech Corp + Currency: + type: string + nullable: true + description: The preferred currency of the User. + example: USD + StarredUrl: + type: string + nullable: true + description: The URL of the User's starred items. + example: https://github.com/johnsmith?tab=stars + GistsUrl: + type: string + nullable: true + description: The URL of the User's gists. + example: https://gist.github.com/johnsmith + GravatarImageUrl: + type: string + nullable: true + description: The URL of the User's Gravatar image. + example: https://gravatar.com/avatar/123456 + ExternalUserLoginId: + type: string + nullable: true + description: The external User login ID. + example: external_12345 + InterestedIn: + type: array + items: + type: string + nullable: true + description: Interests of the User. + example: + - Technology + - Innovation + - AI + FollowersCount: + type: integer + nullable: true + description: The number of followers the User has. + example: 1250 + FriendsCount: + type: integer + nullable: true + description: The number of friends the User has. + example: 458 + TotalStatusesCount: + type: integer + nullable: true + description: The total number of statuses posted by the User. + example: 2341 + NumRecommenders: + type: integer + nullable: true + description: The number of recommenders for the User. + example: 15 + TotalPrivateRepository: + type: integer + nullable: true + description: The total number of private repositories owned by the User. + example: 8 + PublicGists: + type: integer + nullable: true + description: The total number of public gists owned by the User. + example: 23 + PrivateGists: + type: integer + nullable: true + description: The total number of private gists owned by the User. + example: 5 + SessionLimit: + type: integer + nullable: true + description: The session limit for the User. + example: 10 + CustomFields: + type: object + additionalProperties: + type: string + nullable: true + description: Custom fields associated with the User. + example: + hobby: Photography + favorite_color: Blue + ProfileImageUrls: + type: object + additionalProperties: + type: string + nullable: true + description: URLs of the User's profile images. + example: + small: https://example.com/small.jpg + large: https://example.com/large.jpg + WebProfiles: + type: object + additionalProperties: + type: string + nullable: true + description: The User's web profiles. + example: + linkedin: https://linkedin.com/in/johndoe + github: https://github.com/johndoe + SecurityQuestionAnswer: + type: object + additionalProperties: + type: string + nullable: true + description: Security question answers for the User. + example: + What is your pet's name?: Fluffy + Country: + type: object + description: The country details of the User. + properties: + Code: + type: string + description: The country code. + example: US + Name: + type: string + description: The country name. + example: United States + ProviderAccessCredential: + type: object + description: The provider access credentials of the User. + properties: + AccessToken: + type: string + nullable: true + description: The Access Token for the provider. + example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... + TokenSecret: + type: string + nullable: true + description: The token secret for the provider. + example: abc123def456... + Suggestions: + type: object + description: Suggestions for the User to follow. + properties: + CompaniesToFollow: + type: array + description: List of companies suggested to follow. + items: + type: object + properties: + Id: + type: string + nullable: true + description: The ID of the company. + example: company_123 + Name: + type: string + nullable: true + description: The name of the company. + example: Tech Corp + IndustriesToFollow: + type: array + description: List of industries suggested to follow. + items: + type: object + properties: + Id: + type: string + nullable: true + description: The ID of the industry. + example: industry_123 + Name: + type: string + nullable: true + description: The name of the industry. + example: Software Development + NewssourceToFollow: + type: array + description: List of news sources suggested to follow. + items: + type: object + properties: + Id: + type: string + nullable: true + description: The ID of the news source. + example: news_123 + Name: + type: string + nullable: true + description: The name of the news source. + example: Tech News Daily + PeopleToFollow: + type: array + description: List of people suggested to follow. + items: + type: object + properties: + Id: + type: string + nullable: true + description: The ID of the person. + example: person_123 + Name: + type: string + nullable: true + description: The name of the person. + example: John Doe + Subscription: + type: object + description: Subscription details of the User. + properties: + Name: + type: string + nullable: true + description: The name of the subscription. + example: Pro Plan + Space: + type: string + nullable: true + description: The allocated space for the subscription. + example: 100GB + PrivateRepos: + type: string + nullable: true + description: The number of private repositories allowed. + example: '50' + Collaborators: + type: string + nullable: true + description: The number of collaborators allowed. + example: '10' + AgeRange: + type: object + description: The age range of the User. + properties: + Min: + type: integer + nullable: true + description: The minimum age in the range. + example: 18 + Max: + type: integer + nullable: true + description: The maximum age in the range. + example: 35 + PrivacyPolicy: + type: object + description: The Privacy Policy details of the User. + properties: + Version: + type: string + nullable: true + description: The version of the Privacy Policy. + example: '1.0' + PINInfo: + type: object + description: PIN information of the User. + properties: + PIN: + type: string + nullable: true + description: The PIN of the User. + example: '1234' + Skipped: + type: boolean + nullable: true + description: Indicates if the PIN setup was skipped. + example: false + IsValid: + type: boolean + nullable: true + description: Indicates if the PIN is valid. + example: true + IOValidationRequired: + type: boolean + description: Indicates if IO validation is required. + example: false + Addresses: + type: array + description: List of addresses associated with the User. + items: + type: object + properties: + Type: + type: string + description: The type of address (e.g., Home, Work). + example: Home + Address1: + type: string + description: The first line of the address. + example: 123 Tech Street + City: + type: string + description: The city of the address. + example: Cambridge + State: + type: string + description: The state of the address. + example: MA + Country: + type: string + description: The country of the address. + example: USA + Positions: + type: array + description: List of positions held by the User. + items: + type: object + properties: + Position: + type: string + description: The position held by the User. + example: Senior Software Engineer + Company: + type: string + description: The company where the position was held. + example: Tech Corp + StartDate: + type: string + format: date-time + description: The start date of the position. + example: '2022-01-15T00:00:00Z' + EndDate: + type: string + format: date-time + description: The end date of the position. + example: '2024-03-20T00:00:00Z' + IsCurrent: + type: boolean + description: Indicates if the position is current. + example: true + Educations: + type: array + description: List of educational qualifications of the User. + items: + type: object + properties: + School: + type: string + description: The name of the school. + example: MIT + Degree: + type: string + description: The degree obtained. + example: BS Computer Science + FieldOfStudy: + type: string + description: The field of study. + example: Computer Science + StartDate: + type: string + format: date-time + description: The start date of the education. + example: '2008-09-01T00:00:00Z' + EndDate: + type: string + format: date-time + description: The end date of the education. + example: '2012-05-30T00:00:00Z' + PhoneNumbers: + type: array + description: List of Phone numbers associated with the User. + items: + type: object + properties: + PhoneType: + type: string + description: The type of Phone (e.g., Mobile, Home). + example: Mobile + PhoneNumber: + type: string + description: The Phone number. + example: +1-555-123-4567 + Operation: + type: string + description: The operation performed on the Phone number. + example: add + IMAccounts: + type: array + description: List of instant messaging accounts associated with the User. + items: + type: object + properties: + AccountType: + type: string + description: The type of instant messaging account. + example: Skype + AccountName: + type: string + description: The name of the instant messaging account. + example: johnsmith_skype + Interests: + type: array + description: List of interests of the User. + items: + type: object + properties: + InterestedType: + type: string + description: The type of interest (e.g., Professional, Personal). + example: Professional + InterestedName: + type: string + description: The name of the interest. + example: Software Architecture + Sports: + type: array + description: List of sports the User is interested in. + items: + type: object + properties: + Id: + type: string + description: The ID of the sport. + example: sport_123 + Name: + type: string + description: The name of the sport. + example: Basketball + InspirationalPeople: + type: array + description: List of inspirational people for the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the person. + example: person_123 + Name: + type: string + description: The name of the person. + example: Linus Torvalds + Awards: + type: array + description: List of awards received by the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the award. + example: award_123 + Name: + type: string + description: The name of the award. + example: Best Developer Award + Issuer: + type: string + description: The issuer of the award. + example: Tech Conference 2023 + Skills: + type: array + description: List of skills possessed by the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the skill. + example: skill_123 + Name: + type: string + description: The name of the skill. + example: Python Programming + CurrentStatus: + type: array + description: List of current statuses of the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the status. + example: status_123 + Text: + type: string + description: The text of the status. + example: Working on exciting new project + Source: + type: string + description: The source of the status. + example: LinkedIn + CreatedDate: + type: string + format: date-time + description: The date the status was created. + example: '2024-03-20T15:30:00Z' + Certifications: + type: array + description: List of certifications obtained by the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the certification. + example: cert_123 + Name: + type: string + description: The name of the certification. + example: AWS Certified Solutions Architect + Authority: + type: string + description: The authority that issued the certification. + example: Amazon Web Services + StartDate: + type: string + format: date-time + description: The start date of the certification. + example: '2023-01-15T00:00:00Z' + EndDate: + type: string + format: date-time + description: The end date of the certification. + example: '2026-01-15T00:00:00Z' + Courses: + type: array + description: List of courses completed by the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the course. + example: course_123 + Name: + type: string + description: The name of the course. + example: Introduction to Machine Learning + Number: + type: string + description: The course number. + example: ML101 + Volunteer: + type: array + description: List of volunteer experiences of the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the volunteer experience. + example: volunteer_123 + Role: + type: string + description: The Role of the User in the volunteer experience. + example: Volunteer Developer + Organization: + type: string + description: The organization where the User volunteered. + example: Open Source Initiative + Cause: + type: string + description: The cause supported by the volunteer experience. + example: Education + RecommendationsReceived: + type: array + description: List of recommendations received by the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the recommendation. + example: recommendation_123 + RecommendationType: + type: string + description: The type of recommendation. + example: Professional + RecommendationText: + type: string + description: The text of the recommendation. + example: John is an exceptional software engineer. + Recommender: + type: string + description: The name of the person who gave the recommendation. + example: Jane Doe + Languages: + type: array + description: List of languages known by the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the language. + example: lang_123 + Name: + type: string + description: The name of the language. + example: English + Proficiency: + type: string + description: The proficiency level in the language. + example: Fluent + Projects: + type: array + description: List of projects associated with the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the project. + example: project_123 + Name: + type: string + description: The name of the project. + example: AI Research + Summary: + type: string + description: A brief summary of the project. + example: Developed an AI model for image recognition. + StartDate: + type: string + format: date-time + description: The start date of the project. + example: '2022-01-01T00:00:00Z' + EndDate: + type: string + format: date-time + description: The end date of the project. + example: '2023-01-01T00:00:00Z' + IsCurrent: + type: boolean + description: Indicates if the project is ongoing. + example: true + Games: + type: array + description: List of games the User is interested in. + items: + type: object + properties: + Id: + type: string + description: The ID of the game. + example: game_123 + Category: + type: string + description: The category of the game. + example: Strategy + Name: + type: string + description: The name of the game. + example: Chess + CreatedDate: + type: string + format: date-time + description: The date the game was added. + example: '2023-05-15T10:00:00Z' + Family: + type: array + description: List of family members associated with the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the family member. + example: family_123 + Relationship: + type: string + description: The relationship with the family member. + example: Brother + Name: + type: string + description: The name of the family member. + example: John Doe + TelevisionShow: + type: array + description: List of television shows the User is interested in. + items: + type: object + properties: + Id: + type: string + description: The ID of the television show. + example: tv_123 + Category: + type: string + description: The category of the television show. + example: Drama + Name: + type: string + description: The name of the television show. + example: Breaking Bad + CreatedDate: + type: string + format: date-time + description: The date the television show was added. + example: '2023-05-15T10:00:00Z' + MutualFriends: + type: array + description: List of mutual friends associated with the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the mutual friend. + example: friend_123 + Name: + type: string + description: The name of the mutual friend. + example: Jane Doe + FirstName: + type: string + description: The first name of the mutual friend. + example: Jane + LastName: + type: string + description: The last name of the mutual friend. + example: Doe + Birthday: + type: string + format: date + description: The birthday of the mutual friend. + example: '1990-05-15' + Hometown: + type: string + description: The hometown of the mutual friend. + example: Boston + Link: + type: string + description: The profile link of the mutual friend. + example: https://example.com/janedoe + Gender: + type: string + description: The gender of the mutual friend. + example: female + Movies: + type: array + description: List of movies the User is interested in. + items: + type: object + properties: + Id: + type: string + description: The ID of the movie. + example: movie_123 + Category: + type: string + description: The category of the movie. + example: Action + Name: + type: string + description: The name of the movie. + example: Inception + CreatedDate: + type: string + format: date-time + description: The date the movie was added. + example: '2023-05-15T10:00:00Z' + Books: + type: array + description: List of books the User is interested in. + items: + type: object + properties: + Id: + type: string + description: The ID of the book. + example: book_123 + Category: + type: string + description: The category of the book. + example: Fiction + Name: + type: string + description: The name of the book. + example: The Great Gatsby + CreatedDate: + type: string + format: date-time + description: The date the book was added. + example: '2023-05-15T10:00:00Z' + Patents: + type: array + description: List of patents associated with the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the patent. + example: patent_123 + Title: + type: string + description: The title of the patent. + example: AI-Based Image Recognition + Date: + type: string + format: date + description: The date the patent was filed. + example: '2023-05-15' + FavoriteThings: + type: array + description: List of favorite things of the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the favorite thing. + example: fav_123 + Name: + type: string + description: The name of the favorite thing. + example: Photography + Type: + type: string + description: The type of the favorite thing. + example: Hobby + RelatedProfileViews: + type: array + description: List of related profile views for the User. + items: + type: object + properties: + FirstName: + type: string + description: The first name of the related profile. + example: John + LastName: + type: string + description: The last name of the related profile. + example: Doe + Id: + type: string + description: The ID of the related profile. + example: profile_123 + PlacesLived: + type: array + description: List of places the User has lived. + items: + type: object + properties: + IsPrimary: + type: boolean + description: Indicates if the place is the primary residence. + example: true + Name: + type: string + description: The name of the place. + example: New York + Operation: + type: string + description: The operation performed on the place. + example: add + Publications: + type: array + description: List of publications associated with the User. + items: + type: object + properties: + Id: + type: string + description: The ID of the publication. + example: pub_123 + Title: + type: string + description: The title of the publication. + example: AI Research Paper + Publisher: + type: string + description: The publisher of the publication. + example: Tech Journal + Date: + type: string + format: date + description: The date the publication was published. + example: '2023-05-15' + Url: + type: string + format: uri + description: The URL of the publication. + example: https://example.com/publication + Summary: + type: string + description: A brief summary of the publication. + example: This paper discusses AI advancements in image recognition. + Authors: + type: array + description: List of authors of the publication. + items: + type: object + properties: + Id: + type: string + description: The ID of the author. + example: author_123 + Name: + type: string + description: The name of the author. + example: John Doe + JobBookmarks: + type: array + description: List of job bookmarks associated with the User. + items: + type: object + properties: + IsApplied: + type: boolean + description: Indicates if the job has been applied for. + example: true + IsSaved: + type: boolean + description: Indicates if the job has been saved. + example: true + ApplyTimestamp: + type: string + format: date-time + description: The timestamp when the job was applied for. + example: '2023-05-15T10:00:00Z' + SavedTimestamp: + type: string + format: date-time + description: The timestamp when the job was saved. + example: '2023-05-10T10:00:00Z' + Job: + type: object + description: Details of the job. + properties: + Id: + type: string + description: The ID of the job. + example: job_123 + Title: + type: string + description: The title of the job. + example: Software Engineer + Company: + type: string + description: The company offering the job. + example: Tech Corp + Badges: + type: array + description: List of badges associated with the User. + items: + type: object + properties: + BadgeId: + type: string + description: The ID of the badge. + example: badge_123 + Name: + type: string + description: The name of the badge. + example: Top Contributor + BadgeMessage: + type: string + description: A message associated with the badge. + example: Awarded for outstanding contributions. + Description: + type: string + description: A description of the badge. + example: This badge is awarded to users who contribute significantly to the community. + ImageUrl: + type: string + description: The URL of the badge image. + example: https://example.com/badges/top-contributor.png + MemberUrlResources: + type: array + description: List of member URL resources associated with the User. + items: + type: object + properties: + Url: + type: string + format: uri + description: The URL of the resource. + example: https://example.com/resource + UrlName: + type: string + description: The name of the resource URL. + example: Personal Website + ExternalIds: + type: array + description: List of external IDs associated with the User. + items: + type: object + properties: + Operation: + type: string + description: The operation performed on the external ID. + example: add + Source: + type: string + description: The source of the external ID. + example: LinkedIn + SourceId: + type: string + description: The source ID of the external ID. + example: source_12345 + IsEmailSubscribed: + type: boolean + nullable: true + description: Indicates if the User is subscribed to emails. + example: true + IsProtected: + type: boolean + nullable: true + description: Indicates if the User Account is protected. + example: false + Hireable: + type: boolean + nullable: true + description: Indicates if the User is hireable. + example: true + IsTwoFactorAuthenticationEnabled: + type: boolean + nullable: true + description: Indicates if two-factor authentication is enabled for the User. + example: true + IsActive: + type: boolean + nullable: true + description: Indicates if the User Account is active. + example: true + IsDeleted: + type: boolean + nullable: true + description: Indicates if the User Account is deleted. + example: false + EmailVerified: + type: boolean + nullable: true + description: Indicates if the User's Email is verified. + example: true + PhoneIdVerified: + type: boolean + nullable: true + description: Indicates if the User's Phone ID is verified. + example: true + DisableLogin: + type: boolean + nullable: true + description: Indicates if login is disabled for the User. + example: false + IsLoginLocked: + type: boolean + nullable: true + description: Indicates if the User's login is locked. + example: false + AcceptPrivacyPolicy: + type: boolean + nullable: true + description: Indicates if the User has accepted the Privacy Policy. + example: true + ReCaptchaResponseField: + type: string + nullable: true + description: The response field for reCAPTCHA verification. + example: 03AGdBq24... + ReCaptchaChallengeField: + type: string + nullable: true + description: The challenge field for reCAPTCHA verification. + example: 03AGdBq24... + RegistrationSource: + type: string + nullable: true + description: The source of the User's registration. + example: Web + FullName: + type: string + nullable: true + description: The full name of the User. + example: John Robert Smith + Consents: + type: object + description: Consent registration details. + properties: + Events: + type: array + description: List of consent acceptance events. + items: + type: object + properties: + IsCustom: + type: boolean + description: Indicates if the consent is custom. + example: true + Event: + type: string + description: The event associated with the Consent. + example: Signup + Data: + type: array + description: List of consent options accepted by the User. + items: + type: object + properties: + IsAccepted: + type: boolean + description: Indicates if the consent option is accepted. + example: true + ConsentOptionId: + type: string + description: The ID of the Consent option. + example: 123e4567e89b12d3a456426614174000 + Password: + type: string + description: The Password of the User. + example: password123 + Email: + type: array + description: List of Email addresses associated with the User. + items: + type: object + properties: + Type: + type: string + description: The type of the Email (e.g., Primary, Secondary). + example: Primary + Value: + type: string + format: email + description: The Email address. + example: user@example.com + IsDeletedResponseWithCount: + type: object + properties: + IsDeleted: + type: boolean + description: Indicates whether the Account was successfully deleted. + example: true + RecordsDeleted: + type: integer + description: The number of records that were deleted. + example: 5 + AccessToken: + type: object + properties: + access_token: + type: string + description: The generated Access Token. + example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... + refresh_token: + type: string + nullable: true + description: The refresh token associated with the Access Token. + example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... + expires_in: + type: string + format: date-time + description: The expiration time of the Access Token. + example: '2024-03-20T15:30:00Z' + SessionToken: + type: object + description: Session token details. + properties: + session_token: + type: string + description: The session token for specific features. + example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... + session_expires_in: + type: string + format: date-time + description: The expiration time of the session token. + example: '2024-03-20T16:30:00Z' + GenerateSottResponse: + type: object + properties: + Sott: + type: string + description: The generated Secure One Time Token (SOTT). + example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... + ExpiryTime: + type: string + format: date-time + description: The SOTT expiration time. + example: '2026-12-31T23:59:59.000Z' + required: + - Sott + - ExpiryTime + UsernameModel: + type: object + properties: + Username: + type: string + description: The Username to validate or process. + example: john_doe + required: + - Username + EmailToValidateServerSide: + type: object + properties: + Email: + type: string + format: email + description: The Email address to validate on the server side. + example: user@example.com + required: + - Email + ForgotPasswordTokenModel: + type: object + properties: + ForgotToken: + type: string + description: The generated forgot Password token. + example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... + IdentityProviders: + type: array + description: List of identity providers associated with the User. + items: + type: string + example: + - google + - facebook + required: + - ForgotToken + - IdentityProviders + VerificationLinkResponse: + type: object + properties: + VerificationToken: + type: string + description: The generated Verification Token. + example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9... + expires_in: + type: string + format: date-time + description: The expiration time of the token. + example: '2024-03-20T15:30:00Z' + IdentitiesResponse: + type: object + properties: + Data: + type: array + nullable: true + description: List of User Identities with social information but without login details. + items: + $ref: '#/components/schemas/IdentityResponseWithSocialWithoutLogins' + UpsertEmailModel: + type: object + properties: + Email: + type: array + items: + type: object + properties: + Type: + type: string + description: The type of Email (e.g., primary, secondary). + example: primary + Value: + type: string + format: email + description: The Email address to be added or updated. + example: user@example.com + description: A list of Email addresses to be added or updated for the Account. + required: + - Email + EmailModelManage: + type: object + properties: + email: + type: string + format: email + description: The Email address to be processed. + example: user@example.com + required: + - email + PhoneModel: + type: object + properties: + phone: + type: string + description: The Phone number to be updated. + example: +1-555-123-4567 + required: + - phone + PasswordResponse: + type: object + properties: + PasswordHash: + type: string + nullable: true + description: The hashed Password of the User account. + example: $2a$12$eImiTXuWVxfM37uY4JANjQ== + PasswordModel: + type: object + properties: + Password: + type: string + description: The new Password to be set for the Account. + example: SecurePassword123! + required: + - Password + EventBasedSecondFactorToken: + type: object + properties: + secondfactorvalidationtoken: + type: string + description: | + The event-based second factor token. This token is used to verify the identity of the User during the authentication process. + format: string + minLength: 36 + maxLength: 36 + example: 683987c4-9249-4165-b1f1-925f0b84021e + required: + - secondfactorvalidationtoken + IsValid: + type: object + properties: + IsValid: + type: boolean + description: | + Indicates whether the provided event-based second factor token is valid or not. A value of `true` means the token is valid, + while `false` indicates that the token is invalid or has expired. + example: true + required: + - IsValid + ErrorResponseNative: + type: object + properties: + message: + type: string + description: Brief message describing the error. + description: + type: string + description: Detailed description of the error. + errorCode: + type: integer + description: Error code for identifying the error type. + ActiveSession: + type: object + properties: + AccessToken: + type: string + example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9 + Browser: + type: string + example: Chrome + Device: + type: string + example: Laptop + Os: + type: string + example: Windows 10 + DeviceType: + type: string + example: Desktop + City: + type: string + example: San Francisco + Country: + type: string + example: USA + Ip: + type: string + example: 192.168.1.1 + LoginDate: + type: string + format: date-time + example: '2023-06-01T12:34:56Z' + ActiveSessionResponse: + type: object + properties: + nextCursor: + type: integer + data: + type: array + items: + $ref: '#/components/schemas/ActiveSession' + Invitation: + type: object + properties: + Id: + type: string + description: The unique identifier for the invitation. The ID is typically in the format *inv_*, where ** is a string of alphanumeric characters. + example: inv_123456789 + EmailId: + type: string + description: The Email address of the User to whom the invitation is sent. + example: user@example.com + Status: + type: string + enum: + - invited + - accepted + - expired + - revoked + description: The status of the invitation. Possible values are *invited*, *accepted*, *expired*, and *revoked*. + example: invited + RoleIds: + type: array + description: The list of Role IDs associated with the invitation. Each Role ID is typically in the format *role_*, where ** is a string of alphanumeric characters. + items: + type: string + example: + - role_12345 + - role_56789 + OrgId: + type: string + description: The unique identifier for the organization associated with the invitation. The ID is typically in the format *org_*, where ** is a string of alphanumeric characters. + example: org_123456789 + CreatedDate: + type: string + description: The date and time when the invitation was created, UTC format. + format: date-time + example: '2023-01-01T00:00:00Z' + ExpirationDate: + type: string + description: The date and time when the invitation expires, UTC format. + format: date-time + example: '2023-01-01T00:00:00Z' + ModifiedDate: + type: string + description: The date and time when the invitation was last modified, UTC format. + format: date-time + example: '2023-01-01T00:00:00Z' + InviterUid: + type: string + description: The unique identifier for the User who sent the invitation. The ID is typically in the format unique_id, where ** is a string of alphanumeric characters. + example: '123456789' + SendInvitation: + type: object + required: + - email + - roleIds + - orgId + - inviterUid + properties: + email: + type: string + format: email + roleIds: + type: array + items: + type: string + example: + - role_12345 + - role_56789 + orgId: + type: string + inviterUid: + type: string + ResendInvitation: + type: object + properties: + Resent: + type: boolean + description: Indicates whether the invitation was resent + example: true + OrganizationDomainRequest: + properties: + DomainName: + type: string + example: example.com + description: The domain name to be verified + IsVerified: + type: boolean + example: false + description: Indicates whether the domain has been verified + type: object + OrganizationBase: + properties: + Display: + nullable: true + properties: + LogoURL: + type: string + example: https://example.com/logo.jpg + description: URL to the organization's logo + Name: + type: string + example: Org1 + description: Display name of the organization + type: object + Domains: + items: + $ref: '#/components/schemas/OrganizationDomainRequest' + type: array + Metadata: + additionalProperties: + type: string + example: + hello: world + type: object + description: Additional metadata for the organization + Name: + type: string + example: Org1 + description: Name of the organization + type: object + ConnectionGroupRoleRequest: + properties: + GroupId: + type: string + example: eca8da89-09ed-476f-a689-11fa9a0b14ce + description: Unique identifier of the group to which the Role belongs. + Name: + type: string + example: Security + description: Name of the group Role connection. + RoleId: + type: string + example: role_Z6NE1ZkupP7lwD6E + description: Unique identifier of the Role. + type: object + ConnectionGroupRoleResponseCore: + properties: + Id: + type: string + example: group_role_Z6NFN5kupP7lwD6G + description: Unique identifier of the group-to-role mapping. + type: object + ConnectionGroupRoleResponse: + allOf: + - $ref: '#/components/schemas/ConnectionGroupRoleRequest' + - $ref: '#/components/schemas/ConnectionGroupRoleResponseCore' + ConnectionResponseCore: + properties: + Id: + type: string + example: conn_Z5ZtmHl2aMpi5VZP + description: Unique identifier for the connection + IsActive: + type: boolean + example: true + description: Indicates whether the connection is active + CreatedDate: + format: date-time + type: string + example: '2023-10-01T00:00:00Z' + description: Date when the connection was created + GroupRoles: + nullable: true + items: + $ref: '#/components/schemas/ConnectionGroupRoleResponse' + type: array + ModifiedDate: + format: date-time + type: string + example: '2023-10-01T00:00:00Z' + description: Date when the connection was last modified + type: object + OrganizationsConnectionBase: + properties: + Name: + type: string + example: AzureAD + description: Name of the connection + Domain: + type: string + example: example.com + description: Domain associated with the connection + Attributes: + description: Attribute mapping between the IdP claims and user fields. + properties: + CustomMapping: + additionalProperties: + type: string + type: object + example: + Gender: gender + description: Custom attribute mapping for the connection + Email: + type: string + example: email + description: Email attribute for the connection + FirstName: + type: string + example: firstName + description: First name attribute for the connection + Groups: + type: string + example: groups + description: Groups attribute for the connection + ID: + type: string + example: sub + description: Unique identifier attribute for the connection + LastName: + type: string + example: lastName + description: Last name attribute for the connection + type: object + type: object + OrganizationsConnectionSamlBase: + properties: + IDPEntityId: + type: string + example: https://exampleIdp.com + description: Unique identifier for the Identity Provider (IdP). + IDPMetadataUrl: + type: string + example: https://exampleIdp.com/metadata.xml + description: URL to the IdP metadata XML file. + IsIDPInitiated: + type: boolean + example: true + description: Indicates whether the SAML connection is initiated by the IdP. + IDPLoginUrl: + type: string + example: https://exampleIdp.com/sso/saml + description: The IdP's SAML single sign-on (login) URL. + IDPLogoutUrl: + type: string + example: https://exampleIdp.com/slo/saml + description: The IdP's SAML single logout (SLO) URL. + IDPCertificate: + description: IdP certificate details, including the PEM value and its validity window. + nullable: true + properties: + Certificate: + type: string + description: The Identity Provider's certificate in PEM format. + example: | + -----BEGIN CERTIFICATE----- + ... + -----END CERTIFICATE----- + NotAfter: + format: date-time + type: string + example: '2023-10-01T00:00:00Z' + description: The expiration date of the IdP certificate. + NotBefore: + format: date-time + type: string + example: '2023-10-01T00:00:00Z' + description: The start date of the IdP certificate validity. + type: object + type: object + SamlConnectionResponseCore: + type: object + properties: + ConnectionType: + enum: + - saml_custom + - saml_okta + - saml_entraid + - saml_google_workspace + - saml_salesforce + type: string + example: saml_custom + description: The type of SAML connection. + IDPLoginBinding: + type: string + readOnly: true + example: urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect + description: SAML binding for the IdP login URL, derived from the IdP metadata. + IDPLogoutBinding: + type: string + readOnly: true + example: urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect + description: SAML binding for the IdP logout URL, derived from the IdP metadata. + EntityId: + type: string + readOnly: true + example: https://example.hub.loginradius.com/saml/sp/Z5ZtBULhXHAJKrLsOmeWbZh5dmjKYuVWTw + description: The unique identifier for the SAML service provider. + MetadataUrl: + type: string + readOnly: true + example: https://example.hub.loginradius.com/saml/sp/Z5ZtBULhXHAJKrLsOmeWbZh5dmjKYuVWTw/metadata.xml + description: The URL to the SAML metadata XML file. + ACSEndpoint: + type: string + readOnly: true + example: https://example.hub.loginradius.com/saml/sp/acs/Z5ZtBULhXHAJKrLsOmeWbZh5dmjKYuVWTw + description: The Assertion Consumer Service (ACS) endpoint URL for SAML responses. + SPCertificate: + readOnly: true + nullable: true + properties: + Certificate: + type: string + description: The SAML service provider's certificate in PEM format. + example: | + -----BEGIN CERTIFICATE----- + ... + -----END CERTIFICATE----- + type: object + SamlConnectionResponse: + title: SAMLConnectionResponse + allOf: + - $ref: '#/components/schemas/OrganizationsConnectionSamlBase' + - $ref: '#/components/schemas/SamlConnectionResponseCore' + OidcConnectionBase: + properties: + AuthorizationUrl: + type: string + example: https://exampleIdp.com/oidc/authorize + description: The URL to the OpenID Connect provider's authorization endpoint. This is where users are redirected to authenticate and authorize access. + ClientId: + type: string + example: '123456' + description: The client identifier issued to the application by the OpenID Connect provider. This is used to identify the application during the authentication process. + ClientSecret: + type: string + example: '654321' + description: The client secret issued to the application by the OpenID Connect provider. This is used to authenticate the application when requesting tokens. + Issuer: + type: string + example: https://exampleIdp.com + description: The issuer identifier for the OpenID Connect provider. This is typically the base URL of the provider and is used to validate tokens. + Scopes: + items: + type: string + type: array + description: The scopes requested by the application during the authentication process. Scopes define the access level and Permissions granted to the application. + example: + - openid + - email + TokenAuthMethod: + type: string + example: client_secret_post + description: The method used to authenticate the application when requesting tokens. Common methods include `client_secret_post` and `client_secret_basic`. + TokenUrl: + type: string + example: https://exampleIdp.com/oidc/token + description: The URL to the OpenID Connect provider's token endpoint. This is where the application exchanges the authorization code for tokens. + UserInfoUrl: + type: string + example: https://exampleIdp.com/oidc/userinfo + description: The URL to the OpenID Connect provider's UserInfo endpoint. + UserInfoExtractByIdToken: + type: boolean + nullable: true + description: Indicates if user info should be extracted by ID token. + JWKSEndpoint: + type: string + example: https://exampleIdp.com/oidc/jwks + description: The JWKS endpoint for verifying the ID token. + type: object + OidcConnectionResponseCore: + type: object + properties: + ConnectionType: + enum: + - oidc_custom + example: oidc_custom + type: string + description: Type of the connection, which is OIDC in this case. + RedirectURI: + type: string + readOnly: true + example: https://example.hub.loginradius.com/oauth/sp/Z5ZtBULhXHAJKrLsOmeWbZh5dmjKYuVWTw/callback + description: The redirect URI for the OIDC connection, where the authorization server will send the User after authentication. + OidcConnectionResponse: + title: OIDCConnectionResponse + allOf: + - $ref: '#/components/schemas/OidcConnectionBase' + - $ref: '#/components/schemas/OidcConnectionResponseCore' + ConnectionResponseVariant: + oneOf: + - $ref: '#/components/schemas/SamlConnectionResponse' + - $ref: '#/components/schemas/OidcConnectionResponse' + ConnectionResponse: + allOf: + - $ref: '#/components/schemas/ConnectionResponseCore' + - $ref: '#/components/schemas/OrganizationsConnectionBase' + - $ref: '#/components/schemas/ConnectionResponseVariant' + OrganizationsDomainsResponseCore: + type: object + properties: + Id: + type: string + example: org_domain_Z5Zviy2xEEUTal7S + description: Unique identifier for the organization domain. + VerificationStrategy: + type: string + example: manual + description: Strategy used for domain verification, e.g., 'manual'. + VerificationToken: + type: string + example: '123456' + description: Token used for domain verification. + OrganizationsDomainsResponse: + allOf: + - $ref: '#/components/schemas/OrganizationDomainRequest' + - $ref: '#/components/schemas/OrganizationsDomainsResponseCore' + OrganizationsPolicyBase: + properties: + JITPolicy: + nullable: true + properties: + Enabled: + nullable: true + type: boolean + example: false + description: Indicates if JIT provisioning is enabled + type: object + description: Just-In-Time (JIT) provisioning policy for the organization + MFAPolicy: + nullable: true + properties: + EnforcementMode: + type: string + example: optional + description: Mode of enforcement for Multi-Factor Authentication (MFA) + type: object + description: Multi-Factor Authentication (MFA) policy for the organization + MemberPolicy: + nullable: true + properties: + DefaultMemberRole: + type: string + example: role_Z5OCrdbNBZ8OzruS + description: Default Role assigned to new members in the organization + type: object + description: Member policy for the organization + PasswordPolicy: + nullable: true + properties: + ExpiryDays: + type: integer + example: 100 + description: Number of days after which the Password expires + MaxLength: + type: integer + example: 25 + description: Maximum length of the Password + MinLength: + type: integer + example: 8 + description: Minimum length of the Password + RequireLowercase: + type: boolean + description: Indicates if at least one lowercase letter is required in the Password + RequireNumber: + type: boolean + description: Indicates if at least one number is required in the Password + RequireSpecialChar: + type: boolean + description: Indicates if at least one special character is required in the Password + RequireUppercase: + type: boolean + description: Indicates if at least one uppercase letter is required in the Password + type: object + description: Password policy for the organization + SessionPolicy: + nullable: true + properties: + AccessTokenTTL: + type: integer + example: 14400 + description: Time-to-live (TTL) for Access Tokens in seconds + RefreshTokenTTL: + type: integer + example: 324345 + description: Time-to-live (TTL) for refresh tokens in seconds + type: object + description: Session policy for the organization + type: object + OrganizationsResponseCore: + type: object + properties: + Connections: + nullable: true + items: + $ref: '#/components/schemas/ConnectionResponse' + type: array + description: List of connections associated with the organization + CreatedDate: + format: date-time + type: string + example: '2023-10-01T00:00:00Z' + description: Date when the organization was created + Domains: + nullable: true + items: + $ref: '#/components/schemas/OrganizationsDomainsResponse' + type: array + example: + - domain: example.com + isDefault: true + description: List of domains associated with the organization + Id: + type: string + example: org_Z5ZtBULhXHAJKrLs + description: Unique identifier for the organization + IsActive: + type: boolean + example: true + description: Indicates whether the organization is active + ModifiedDate: + format: date-time + type: string + example: '2023-10-01T00:00:00Z' + description: Date when the organization was last modified + Policies: + $ref: '#/components/schemas/OrganizationsPolicyBase' + OrganizationsResponse: + allOf: + - $ref: '#/components/schemas/OrganizationBase' + - $ref: '#/components/schemas/OrganizationsResponseCore' + OrganizationUpdateRequest: + properties: + Name: + type: string + example: Org1 + description: Name of the organization + Display: + nullable: true + properties: + LogoURL: + type: string + example: https://example.com/logo.jpg + description: URL to the organization's logo + Name: + type: string + example: Org1 + description: Display name of the organization + type: object + Metadata: + additionalProperties: + type: string + example: + hello: world + type: object + description: Additional metadata for the organization + Domains: + items: + $ref: '#/components/schemas/OrganizationDomainRequest' + type: array + IsAuthRestrictedToDomain: + nullable: true + type: boolean + description: Restricts authentication to registered domains only + Policies: + nullable: true + allOf: + - $ref: '#/components/schemas/OrganizationsPolicyBase' + IsActive: + nullable: true + type: boolean + description: Indicates whether the organization is active or not + type: object + SamlConnectionRequestCore: + type: object + properties: + ConnectionType: + description: Type of the connection, which is SAML in this case. + enum: + - saml_custom + - saml_okta + - saml_entraid + - saml_google_workspace + - saml_salesforce + type: string + IDPCertificate: + description: PEM-encoded IdP signing certificate used to verify SAML assertions. + type: string + nullable: false + example: | + -----BEGIN CERTIFICATE----- + ... + -----END CERTIFICATE----- + SamlConnectionRequest: + title: SAMLConnectionRequest + allOf: + - $ref: '#/components/schemas/OrganizationsConnectionBase' + - $ref: '#/components/schemas/OrganizationsConnectionSamlBase' + - $ref: '#/components/schemas/SamlConnectionRequestCore' + OidcConnectionRequestCore: + type: object + properties: + ConnectionType: + description: Type of the connection, which is OIDC in this case. + enum: + - oidc_custom + example: oidc_custom + type: string + OidcConnectionRequest: + title: OIDCConnectionRequest + allOf: + - $ref: '#/components/schemas/OrganizationsConnectionBase' + - $ref: '#/components/schemas/OidcConnectionRequestCore' + - $ref: '#/components/schemas/OidcConnectionBase' + OrganizationConnectionCreateRequest: + oneOf: + - title: SAMLConnectionCreateRequest + allOf: + - $ref: '#/components/schemas/SamlConnectionRequest' + - type: object + required: + - Name + - ConnectionType + - Domain + - title: OIDCConnectionCreateRequest + allOf: + - $ref: '#/components/schemas/OidcConnectionRequest' + - type: object + required: + - Name + - ConnectionType + - Domain + OrganizationConnectionRequest: + oneOf: + - $ref: '#/components/schemas/SamlConnectionRequest' + - $ref: '#/components/schemas/OidcConnectionRequest' + ConnectionStatusRequest: + properties: + Active: + type: boolean + description: Indicates whether the connection is active. + type: object + ConnectionStatusResponse: + properties: + IsActive: + type: boolean + description: Indicates whether the connection is active. + type: object + Permissions: + type: object + properties: + Id: + type: string + description: The unique identifier for the Permission + example: perm_2enk23n3 + Name: + type: string + description: The name of the Permission + example: read:users + Description: + type: string + description: The description of the Permission + example: Read users data + ResourceId: + type: string + description: The identifier of the Auth Server API resource this permission belongs to. Only present if the permission is associated with a resource. + example: 507f1f77bcf86cd799439011 + CreatedDate: + type: string + format: date-time + description: The date the Permission was created + example: '2025-02-18T12:18:38.270Z' + ModifiedDate: + type: string + format: date-time + description: The date the Permission was last modified + example: '2025-02-18T12:19:12.255Z' + PermissionsPostRequest: + type: object + required: + - Name + properties: + Name: + type: string + description: The name of the Permission + example: read:users + Description: + type: string + description: The description of the Permission + example: Read users data + ResourceId: + type: string + description: The hex ID of the Auth Server API resource to associate this permission with. + example: 507f1f77bcf86cd799439011 + PermissionPutRequest: + type: object + required: + - Name + - Description + properties: + Name: + type: string + description: The name of the Permission. For non-B2B apps, the name cannot be modified and must match the existing permission name. + example: read:users + Description: + type: string + description: The description of the Permission + example: Read users data + ResourceId: + type: string + description: The hex ID of the Auth Server API resource to associate this permission with. + example: 507f1f77bcf86cd799439011 + Permission: + type: object + properties: + ID: + type: string + description: Permission ID + example: perm_2enk23n3 + Name: + type: string + description: Permission Name + example: read:users + Description: + type: string + description: Permission Description + example: Read users data + OriginalName: + type: string + description: Original (unnormalized) Permission Name + example: read:users + ResourceId: + type: string + description: The identifier of the Auth Server API resource this permission belongs to. Only present if the permission is associated with a resource. + example: 507f1f77bcf86cd799439011 + TenantRole: + type: object + properties: + Id: + type: string + description: Role ID + example: role_dsag432d + Name: + type: string + description: Role Name + example: Admin + Description: + type: string + description: Role Description + example: Admin Role + Level: + type: string + description: Role Level + example: tenant + OrgId: + type: string + description: Organization ID + example: '' + Permissions: + type: array + items: + $ref: '#/components/schemas/Permission' + CreatedDate: + type: string + format: date-time + description: Role Created Date + example: '2023-10-01T00:00:00Z' + ModifiedDate: + type: string + format: date-time + description: Role Modified Date + example: '2023-10-01T00:00:00Z' + RolePostRequest: + type: object + required: + - Name + properties: + Name: + type: string + description: Role Name + example: Admin + Description: + type: string + description: Role Description + example: Admin Role + Permissions: + type: array + items: + type: string + description: A Permission granted to the Role, e.g., 'perm_23hi32n', 'perm_238snu2'. + example: perm_23hi32n + Role: + type: object + properties: + Id: + type: string + description: Role ID + example: role_dsag432d + Name: + type: string + description: Role Name + example: Admin + Description: + type: string + description: Role Description + example: Admin Role + Level: + type: string + description: Role Level + example: org + OrgId: + type: string + description: Organization ID + example: org_fasf432d + OriginalName: + type: string + description: Original (unnormalized) Role Name + example: Admin + Permissions: + type: array + items: + $ref: '#/components/schemas/Permission' + CreatedDate: + type: string + format: date-time + description: Role Created Date + example: '2023-10-01T00:00:00Z' + ModifiedDate: + type: string + format: date-time + description: Role Modified Date + example: '2023-10-01T00:00:00Z' + RolesPutRequest: + type: object + required: + - Name + - Description + - Permissions + properties: + Name: + type: string + description: Role Name + example: Admin + Description: + type: string + description: Role Description + example: Admin Role + Permissions: + type: array + items: + type: string + description: A Permission granted to the Role, e.g., 'perm_23hi32n', 'perm_238snu2'. + example: perm_23hi32n + DefaultResponse: + type: object + properties: + IsDefault: + type: boolean + description: Indicates if the Role is set as default + UserRole: + type: object + properties: + Id: + type: string + description: Unique identifier of the User Role. + example: user_role_ru43jd3 + Uid: + type: string + description: Unique identifier of the User. + example: '123456789' + RoleId: + type: string + description: Unique identifier of the Role. + example: Role_dsag432d + OrgId: + type: string + description: Unique identifier of the organization. + example: org_fasf432d + Email: + type: string + format: email + description: Email address of the User. + example: defaultuser@email.com + CreatedDate: + type: string + format: date-time + description: Date and time when the User Role was created. + example: '2023-10-01T00:00:00Z' + UserRolePutRequest: + type: object + required: + - RoleIds + properties: + RoleIds: + type: array + items: + type: string + description: Unique identifier of the Role. + example: + - role_dsag432d + - role_abc123 + Technology: + type: string + description: The technologies provided by LR + enum: + - android + - ios + - phonegap + - ionic + - xamarin + - reactnative + example: android + SottList: + type: object + properties: + AuthenticityToken: + type: string + description: The authenticity token + example: 1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef + Technology: + $ref: '#/components/schemas/Technology' + CreatedDate: + type: string + format: date-time + description: The date the SOTT was created + example: '2023-10-01T12:00:00Z' + DateRange: + type: string + description: The date range for the SOTT + example: '10' + IsEncoded: + type: boolean + description: Indicates if the SOTT is encoded + example: true + Comment: + type: string + description: Additional comments + example: This is a test comment + SottGenerate: + type: object + properties: + ExpiresInMinutes: + type: integer + format: int32 + description: The number of minutes until the SOTT expires. + example: 30 + Encoded: + type: boolean + description: Indicates whether the SOTT should be encoded. + example: true + Comment: + type: string + description: A comment associated with the SOTT. + example: This is a test comment. + required: + - ExpiresInMinutes + SottGenerateTechnologyCore: + type: object + properties: + Technology: + $ref: '#/components/schemas/Technology' + required: + - Technology + SottGenerateTechnology: + type: object + allOf: + - $ref: '#/components/schemas/SottGenerate' + - $ref: '#/components/schemas/SottGenerateTechnologyCore' + SottResponse: + type: object + properties: + AuthenticityToken: + type: string + description: The authenticity token + Technology: + $ref: '#/components/schemas/Technology' + Sott: + type: string + description: The SOTT (Secure One Time Token) + Comment: + type: string + description: Additional comments + CreatedDate: + type: string + format: date-time + description: The date the SOTT was created + DateRange: + type: string + description: The date range for the SOTT + IsEncoded: + type: boolean + description: Indicates if the SOTT is encoded + WorkflowConfigWithoutData: + type: object + properties: + Id: + type: string + example: '12345' + Name: + type: string + example: Profile Theme Alpha + ThemeName: + type: string + example: DarkMode + Description: + type: string + example: A modern dark theme for User profiles + State: + type: string + example: active + AddWorkflowConfig: + type: object + required: + - Name + - Data + properties: + Name: + type: string + ThemeName: + type: string + Description: + type: string + Data: + type: object + State: + type: string + enum: + - ACTIVE + - DEBUG + - ARCHIVE + WorkflowConfig: + type: object + properties: + Id: + type: string + WorkflowName: + type: string + ThemeName: + type: string + Description: + type: string + Data: + type: object + State: + type: string + UpdateWorkflowConfig: + type: object + properties: + Name: + type: string + ThemeName: + type: string + Description: + type: string + Data: + type: object + State: + type: string + enum: + - ACTIVE + - DEBUG + - ARCHIVE + VersionListResponse: + type: object + properties: + Data: + type: array + items: + type: object + properties: + versionId: + type: string + description: The version ID of the workflow. + example: v1.0.0 + createdDate: + type: string + format: date-time + description: The creation date of the workflow version. + example: '2024-06-17T12:34:56Z' + WorkflowData: + type: object + properties: + tree: + type: object + properties: + entryNodeId: + type: string + description: The entry node ID of the tree. + example: start + nodes: + type: object + additionalProperties: + type: object + properties: + id: + type: string + example: node1 + type: + type: string + example: decision + connections: + type: array + items: + type: object + additionalProperties: + type: string + nodes: + type: object + additionalProperties: + type: object + properties: + id: + type: string + example: node1 + type: + type: string + example: action + nodes: + type: array + items: + type: object + properties: + id: + type: string + example: child1 + UID: + type: string + example: UID123 + type: + type: string + example: child + childType: + type: string + example: form + data: + type: object + formnodeprops: + type: object + nullable: true + properties: + choiceFieldType: + type: string + example: single + choices: + type: array + items: + type: object + properties: + value: + type: string + example: option1 + text: + type: string + example: Option 1 + attributeMapping: + type: string + example: attr1 + defaultChoice: + type: string + example: option1 + output: + type: array + items: + type: object + data: + type: object + selected: + type: boolean + example: false + innerNodes: + type: object + additionalProperties: + type: object + properties: + id: + type: string + example: inner1 + UID: + type: string + example: UID456 + type: + type: string + example: inner + childType: + type: string + example: form + data: + type: object + formnodeprops: + type: object + nullable: true + properties: + choiceFieldType: + type: string + example: multiple + choices: + type: array + items: + type: object + properties: + value: + type: string + example: option2 + text: + type: string + example: Option 2 + attributeMapping: + type: string + example: attr2 + defaultChoice: + type: string + example: option2 + policies: + type: object + additionalProperties: + type: array + items: + type: object + versionId: + type: string + description: The version ID of the workflow. + example: v1.0.0 + createdDate: + type: string + format: date-time + description: The creation date of the workflow version. + example: '2024-06-17T12:34:56Z' + description: + type: string + description: Description of the workflow version. + example: Initial version of the workflow + BasicAuthWebhook: + type: object + properties: + Username: + type: string + description: The Username for basic authentication + example: admin + Password: + type: string + nullable: true + description: The Password for basic authentication + example: password123 + Bearertoken: + type: object + properties: + Token: + type: string + nullable: true + description: The bearer token for authentication + example: 1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef + WebhookAuthentication: + type: object + properties: + AuthType: + type: string + description: The type of authentication used for the webhook + enum: + - Basic + - Bearer + example: Basic + BasicAuth: + $ref: '#/components/schemas/BasicAuthWebhook' + BearerToken: + $ref: '#/components/schemas/Bearertoken' + WebhookSubscription: + type: object + properties: + Id: + type: string + description: The unique identifier for the webhook subscription + example: wh_001 + TargetUrl: + type: string + description: The target URL for the webhook + example: https://example.com/webhook + Event: + type: string + description: The event that triggers the webhook + example: Login + CreatedDate: + type: string + format: date-time + description: The date when the webhook subscription was created + example: '2025-04-08T12:00:00Z' + LastModifiedDate: + type: string + format: date-time + description: The date when the webhook subscription was last modified + example: '2025-04-08T12:30:00Z' + SecretName: + type: string + description: The name of the secret used for the webhook + example: webhook-secret + Name: + type: string + description: The name of the webhook subscription + example: TestSecret + IsIntegrationWebhook: + type: boolean + description: Indicates if the webhook is an integration webhook + example: true + Headers: + type: object + additionalProperties: + type: string + description: The headers to be included in the webhook request + example: + X-Custom-Header: CustomValue + Authorization: Bearer abc123 + QueryParams: + type: object + additionalProperties: + type: string + description: The query parameters to be included in the webhook request + example: + token: xyz987 + mode: sync + Authentication: + $ref: '#/components/schemas/WebhookAuthentication' + WebhookSubscriptionResponse: + type: object + properties: + Data: + type: array + items: + $ref: '#/components/schemas/WebhookSubscription' + WebhookSubscriptionCreateModel: + type: object + properties: + Event: + type: string + description: The event that triggers the webhook + enum: + - Login + - Register + - UpdateProfile + - ResetPassword + - ChangePassword + - EmailVerification + - AddEmail + - RemoveEmail + - BlockAccount + - DeleteAccount + - SetUsername + - AssignRoles + - UnassignRoles + - SetPassword + - LinkAccount + - UnlinkAccount + - UpdatePhoneId + - VerifyPhoneNumber + - InvalidateEmailVerification + - RemoveRoleContext + - CreateCustomObject + - UpdateCustomObject + - DeleteCustomObject + - InvalidatePhoneVerification + - RemovePhoneId + - ConsentProfileUpdate + - SetPIN + - ResetPIN + - ChangePIN + TargetUrl: + type: string + description: The target URL for the webhook + Name: + type: string + description: The name of the webhook subscription + SecretName: + type: string + description: The name of the secret used for the webhook + CustomObjects: + type: string + description: Custom Objects associated with the webhook + Headers: + type: object + additionalProperties: + type: string + description: The headers to be included in the webhook request + QueryParams: + type: object + additionalProperties: + type: string + description: The query parameters to be included in the webhook request + Authentication: + $ref: '#/components/schemas/WebhookAuthentication' + required: + - Event + - TargetUrl + WebhookSubscriptionUpdateModel: + type: object + properties: + TargetUrl: + type: string + description: The target URL for the webhook + Name: + type: string + nullable: true + description: The name of the webhook subscription + SecretName: + type: string + description: The name of the secret used for the webhook + CustomObjects: + type: string + description: Custom Objects associated with the webhook + Headers: + type: object + additionalProperties: + type: string + description: The headers to be included in the webhook request + QueryParams: + type: object + additionalProperties: + type: string + description: The query parameters to be included in the webhook request + Authentication: + $ref: '#/components/schemas/WebhookAuthentication' + required: + - TargetUrl + WebhookEvents: + type: string + enum: + - Login + - Register + - UpdateProfile + - ResetPassword + - ChangePassword + - EmailVerification + - AddEmail + - RemoveEmail + - BlockAccount + - DeleteAccount + - SetUsername + - AssignRoles + - UnassignRoles + - SetPassword + - LinkAccount + - UnlinkAccount + - UpdatePhoneId + - VerifyPhoneNumber + - InvalidateEmailVerification + - RemoveRoleContext + - CreateCustomObject + - UpdateCustomObject + - DeleteCustomObject + - InvalidatePhoneVerification + - RemovePhoneId + - ConsentProfileUpdate + - SetPIN + - ResetPIN + - ChangePIN + - OrgCreated + - OrgUpdated + - OrgDeleted + - OrgRoleCreated + - OrgRoleUpdated + - OrgRoleDeleted + - OrgConnectionCreated + - OrgConnectionUpdated + - OrgConnectionDeleted + - OrgMembershipCreated + - OrgMembershipUpdated + - OrgMembershipDeleted + - OrgInvitationCreated + SmsTemplate: + type: object + required: + - SmsTemplateType + - Name + - Template + properties: + SmsTemplateType: + type: string + description: The type of the SMS template. + enum: + - verification + - forgotpassword + - welcome + - changephoneno + - onetimepasscode + - secondfactorauthentication + - noregistrationpasswordlesslogin + - resetpassword + - suspicious_ip_sms_to_user + - suspicious_city_sms_to_user + - suspicious_country_sms_to_user + - suspicious_browser_sms_to_user + - suspicious_device_sms_to_user + - forgotpin + - deleteuser + - breached_password + example: verification + Name: + type: string + description: The name of the SMS template. + example: Welcome Message + Template: + type: string + description: The content of the SMS template. + example: Welcome to our service, {{username}}! + IsDefault: + type: boolean + description: Set to true to mark this template as the default for its SmsTemplateType. + default: false + UpdateSmsTemplateModel: + type: object + properties: + Name: + type: string + description: The name of the SMS template. + example: Updated Message + Template: + type: string + description: The updated template content. + example: Hello, {{username}}! We're glad to have you. + IsActive: + type: boolean + description: Indicates if the template is active. + example: true + IsDefault: + type: boolean + description: Set to true to mark this template as the default for its SmsTemplateType. + example: false + DeleteSmsTemplateModel: + type: object + required: + - Name + properties: + Name: + type: string + description: The name of the SMS template to delete. + example: Welcome Message + PassKeyConfig: + type: object + properties: + IsEnabled: + type: boolean + description: Whether PassKey is enabled. + example: true + PasskeySelection: + type: string + enum: + - AutoFill + - Button + - Both + description: The type of PassKey selection. + example: Both + ProgressiveEnrollment: + type: boolean + description: Whether progressive enrollment is enabled. + example: true + ProgressiveEnrollmentDelay: + type: integer + description: Delay in minutes for progressive enrollment. + example: 5 + LocalEnrollment: + type: boolean + description: Whether local enrollment is enabled. + example: true + RPDisplayName: + type: string + description: Display name for the relying party. + example: Acme Corporation + RPID: + type: string + description: ID for the relying party. + example: acme.com + RPOrigins: + type: array + items: + type: string + description: List of allowed origins for the relying party. + example: + - https://login.acme.com + - https://auth.acme.com + Attestation: + type: string + enum: + - none + - indirect + - direct + description: The type of PassKey Attestation flow. + example: indirect + required: + - IsEnabled + - PasskeySelection + - LocalEnrollment + - RPDisplayName + - RPID + - RPOrigins + AWSPushConfig: + type: object + properties: + AccessKeyId: + type: string + description: AWS access key ID. + example: AKIAIOSFODNN7EXAMPLE + SecretAccessKey: + type: string + description: AWS secret access key. + example: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY + Region: + type: string + description: AWS region. + example: us-west-2 + AndroidPushConfig: + type: object + properties: + Enabled: + type: boolean + description: Indicates if Android Push Notifications are enabled. + example: true + PlatformARN: + type: string + description: The platform ARN for Android Push Notifications. + example: arn:aws:sns:us-east-1:123456789012:app/GCM/MyApp + PlaystoreUrl: + type: string + description: The URL to the app in the Google Play Store. + example: https://play.google.com/store/apps/details?id=com.example.app + ServiceJson: + type: string + description: JSON string for Android Push Notification service. + example: '{}' + IOSPushConfig: + type: object + properties: + Enabled: + type: boolean + description: Indicates if iOS Push Notifications are enabled. + example: true + AppstoreUrl: + type: string + description: The URL to the app in the Apple App Store. + example: https://apps.apple.com/app/id123456789 + PlatformARN: + type: string + description: The platform ARN for iOS Push Notifications. + example: arn:aws:sns:us-east-1:123456789012:app/APNS/myapp + BundleId: + type: string + description: The bundle ID of the iOS app. + example: com.example.myapp + ApnsCertificate: + type: string + description: The APNs certificate. + example: | + -----BEGIN CERTIFICATE----- + MIID... + -----END CERTIFICATE----- + Environment: + type: string + enum: + - Sandbox + - Production + description: The environment for APNs (e.g., sandbox, production). + example: Sandbox + PushAuthenticator: + type: object + properties: + IsEnabled: + type: boolean + description: Indicates if push authentication is enabled. + NotificationService: + type: string + enum: + - AWS + - Native + description: The type of notification service (e.g., AWS, Native). + CustomAppName: + type: string + description: Custom application name if applicable. + QRCodeWidth: + type: integer + description: The width of the QR code for push authentication. + Message: + type: string + description: Custom message for Push Notifications. + AWSsettings: + $ref: '#/components/schemas/AWSPushConfig' + AndroidSettings: + $ref: '#/components/schemas/AndroidPushConfig' + IOSsettings: + $ref: '#/components/schemas/IOSPushConfig' + SecurityQuestion: + type: object + properties: + QuestionId: + type: string + description: Unique identifier of the security question. + example: 1234567890abcdef1234567890abcdef + Question: + type: string + description: The security question text. + example: What is your mother's maiden name? + SecurityQuestionInput: + type: object + properties: + question: + type: string + description: The security question text. + example: What is your favorite color? + required: + - question + SecurityQuestionsRender: + type: object + properties: + RenderQuestionCount: + type: integer + minimum: 1 + maximum: 10 + description: The number of security questions to render. + required: + - RenderQuestionCount + DomainAccessRestrictions: + type: object + properties: + Allowlist: + type: array + items: + type: string + description: List of allowed domains/emails + Blocklist: + type: array + items: + type: string + description: List of blocked domains/emails + example: + Allowlist: + - email@example.com + - example.org + Blocklist: + - email@spam.com + - malware.org + EmailTemplateResponse: + type: object + properties: + TemplateType: + type: string + description: The type of the Email template + example: welcome + TemplateName: + type: string + description: The name of the Email template + example: Welcome Email + Template: + type: string + example: Welcome to our service! We are glad to have you. + Subject: + type: string + description: The subject of the Email template + example: Welcome to our service! + IsActive: + type: boolean + description: Indicates if the Email template is active + example: true + IsDefault: + type: boolean + description: Indicates if this is the default Email template for the given TemplateType + example: false + TextTemplate: + type: string + description: The text version of the Email template + example: Welcome to our service! We are glad to have you. + FromName: + type: string + description: The name of the sender + example: Support Team + FromEmail: + type: string + description: The Email address of the sender + example: test@gmail.com + EmailConfigId: + type: string + description: Email configuration ID for sending this template. + example: 123e4567-e89b-12d3-a456-426614174000 + VerificationTokenType: + type: string + description: The Email Verification token type for the template. + enum: + - MagicLink + - Otp + example: Otp + EmailTemplateModel: + type: object + properties: + TemplateType: + type: string + description: The type of the Email template + enum: + - registration + - forgotpassword + - forgotprovider + - deleteaccount + - add_email + - welcome + - oneclicksignin + - autologin + - noregistrationpasswordlesslogin + - resetpassword + - suspicious_ip_email_to_user + - suspicious_city_email_to_user + - suspicious_country_email_to_user + - suspicious_browser_email_to_user + - risk_identified_to_admin + - forgotpin + - secondfactorauthentication + - invite_user_to_organization + - suspicious_device_email_to_user + - breached_password + - admin_notification_breached_password + - add_passkey + - delete_passkey + - forget_passkey + TemplateName: + type: string + description: The name of the Email template + Template: + type: string + description: The content of the Email template + Subject: + type: string + description: The subject of the Email template + TextTemplate: + type: string + description: The text version of the Email template + FromName: + type: string + description: The name of the sender + FromEmail: + type: string + description: The Email address of the sender + EmailConfigId: + type: string + description: Email configuration ID for sending this template. + IsDefault: + type: boolean + description: Set to true to mark this template as the default for its TemplateType. + default: false + VerificationTokenType: + type: string + enum: + - MagicLink + - Otp + description: | + The Email Verification token type for the template. This will be set only for 'registration','forgotpassword','deleteaccount','add_email','oneclicksignin', 'autologin','noregistrationpasswordlesslogin','forgotpin','breached_password' and 'forget_passkey' templates. + required: + - TemplateType + - Template + - Subject + UpdateEmailTemplate: + type: object + properties: + TemplateName: + type: string + description: The name of the Email template + Template: + type: string + description: The content of the Email template + Subject: + type: string + description: The subject of the Email template + TextTemplate: + type: string + description: The text version of the Email template + FromName: + type: string + description: The name of the sender + FromEmail: + type: string + description: The Email address of the sender + EmailConfigId: + type: string + description: Email configuration ID for sending this template. + IsDefault: + type: boolean + description: Set to true to mark this template as the default for its TemplateType. + default: false + VerificationTokenType: + type: string + enum: + - MagicLink + - Otp + description: | + The Email Verification token type for the template. This will be set only for 'registration','forgotpassword','deleteaccount','add_email','oneclicksignin', 'autologin','noregistrationpasswordlesslogin','forgotpin','breached_password' and 'forget_passkey' templates. + required: + - Template + - Subject + DeleteEmailTemplate: + type: object + properties: + TemplateName: + type: string + description: The name of the template + required: + - TemplateName + AppleSecretConfiguration: + type: object + properties: + Certificate: + type: string + description: Certificate for Apple configuration + example: | + -----BEGIN CERTIFICATE----- + MIIDXTCCAkWgAwIBAgIJAL5v1Z3k5Y2mMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV + ... + -----END CERTIFICATE----- + KeyIdentifier: + type: string + description: Key identifier for Apple configuration + example: ABCDEFGHIJ + ServiceId: + type: string + description: Service ID for Apple configuration + example: com.example.app + BundleId: + type: string + description: Bundle ID for Apple configuration + example: com.example.app + TeamId: + type: string + description: Team ID for Apple configuration + example: ABCDEFGHIJ + ProviderConfigOptions: + type: object + properties: + Provider: + type: string + description: The name of the provider. + example: FACEBOOK + Key: + type: string + description: The key for the provider. + example: exampleKey + Secret: + type: string + description: The secret for the provider. + example: exampleSecret + ExtraField1: + type: string + description: An extra field for additional information. + example: exampleId + nullable: true + ExtraField2: + type: string + description: Another extra field for additional information. + nullable: true + example: example.html + IsActive: + type: boolean + description: The status of the provider. + example: true + AppleSecretConfiguration: + $ref: '#/components/schemas/AppleSecretConfiguration' + example: + Provider: ExampleProvider + Key: exampleKey + Secret: exampleSecret + ExtraField1: exampleId + ExtraField2: example.html + IsActive: true + AppleSecretConfiguration: + Certificate: Certificate + KeyIdentifier: KeyIdentifier + ServiceId: ServiceId + BundleId: BundleId + TeamId: TeamId + ProviderStatusModel: + type: object + properties: + ProviderName: + type: string + description: Name of the provider + example: FACEBOOK + IsActive: + type: boolean + description: Status of the provider + example: true + required: + - ProviderName + - IsActive + example: + ProviderName: ExampleProvider + IsActive: true + ProviderStatusList: + type: object + properties: + Data: + type: array + items: + $ref: '#/components/schemas/ProviderStatusModel' + description: List of provider statuses + example: + Data: + - ProviderName: ExampleProvider1 + IsActive: true + - ProviderName: ExampleProvider2 + IsActive: false + Provider: + type: object + properties: + ProviderName: + type: string + description: Name of the provider + example: ExampleProvider + IsActive: + type: boolean + description: Status of the provider + example: true + example: + ProviderName: ExampleProvider + IsActive: true + AppProvider: + type: object + properties: + IsActive: + type: boolean + description: Indicates whether the provider is active. + example: true + Key: + type: string + description: The key for the provider application. + example: exampleKey + Secret: + type: string + description: The secret for the provider application. + example: exampleSecret + ExtraField1: + type: string + description: An extra field for additional configuration. + example: extraValue1 + ExtraField2: + type: string + description: Another extra field for additional configuration. + example: extraValue2 + AppleSecretConfiguration: + $ref: '#/components/schemas/AppleSecretConfiguration' + MFASettings: + type: object + properties: + IsSecondFactorAuthenticatorEnabled: + type: boolean + description: Indicates if the second factor authenticator is enabled + IsRequired: + type: boolean + description: Indicates if MFA is required + IsAuthenticatorEnabled: + type: boolean + description: Indicates if TOTP Authenticator is enabled + IsEmailOtpAuthenticatorEnabled: + type: boolean + description: Indicates if Email OTP Authenticator is enabled + IsSmsOtpAuthenticatorEnabled: + type: boolean + description: Indicates if SMS OTP Authenticator is enabled + IsSecurityQuestionAsMFAEnabled: + type: boolean + description: Indicates if Security Question as MFA is enabled + MinimumSecurityQuestionsToAsk: + type: integer + description: Minimum number of security questions to ask + IsPushAuthenticatorEnabled: + type: boolean + description: Indicates if Push Authenticator is enabled + IsDuoAuthenticatorEnabled: + type: boolean + description: Indicates if Duo Authenticator is enabled + IsPasskeyMFAEnabled: + type: boolean + description: Indicates if Passkey MFA is enabled + GoogleAuthenticator: + type: object + properties: + IsEnabled: + type: boolean + description: Indicates if TOTP Authenticator is enabled + QRCodeWidth: + type: integer + description: Width of the QR code + minimum: 1 + maximum: 400 + IssuerId: + type: string + description: Issuer ID for TOTP Authenticator + AccountSecretKey: + type: string + description: Account secret key for TOTP Authenticator + required: + - IssuerId + DuoSecurityAuthenticator: + type: object + properties: + IsEnabled: + type: boolean + description: Indicates if Duo Security is enabled + ClientId: + type: string + description: The client ID for Duo Security + ClientSecret: + type: string + description: The client secret for Duo Security + APIHost: + type: string + description: The API host for Duo Security + CaptchaKeys: + type: object + properties: + PublicKey: + type: string + nullable: true + example: 1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef + PrivateKey: + type: string + nullable: true + example: 1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef + GoogleRecaptchaV3Core: + type: object + properties: + Threshold: + type: number + format: float + nullable: true + example: 0.5 + GoogleRecaptchaV3: + type: object + allOf: + - $ref: '#/components/schemas/CaptchaKeys' + - $ref: '#/components/schemas/GoogleRecaptchaV3Core' + HCaptchaCore: + type: object + properties: + Threshold: + type: number + format: float + nullable: true + example: 0.5 + IsInvisibleCaptcha: + type: boolean + example: true + IsDarkTheme: + type: boolean + example: false + HCaptcha: + type: object + allOf: + - $ref: '#/components/schemas/CaptchaKeys' + - $ref: '#/components/schemas/HCaptchaCore' + CaptchaConfig: + type: object + properties: + IsEnabled: + type: boolean + nullable: true + QQTencentCaptcha: + $ref: '#/components/schemas/CaptchaKeys' + GoogleRecaptchaV2: + $ref: '#/components/schemas/CaptchaKeys' + GoogleRecaptchaV3: + $ref: '#/components/schemas/GoogleRecaptchaV3' + HCaptcha: + $ref: '#/components/schemas/HCaptcha' + EnabledCaptcha: + type: string + nullable: true + description: | + The enabled captcha type. Must pass the EnabledCaptchaValidation. + IPAccessRestrictions: + type: object + properties: + AllowedIPs: + type: array + items: + type: string + description: List of allowed IP addresses + DeniedIPs: + type: array + items: + type: string + description: List of blocked IP addresses + JwtIntegrationBaseModel: + properties: + Algo: + enum: + - HS256 + - HS384 + - HS512 + - RS256 + - RS384 + - RS512 + - ES256 + - ES384 + - ES512 + type: string + example: HS256 + Secret: + type: string + example: f5d70720-1a95-4cff-a2c5-5fd25e115aab + MappingTemplate: + type: string + example: '{"email": "{{Email.0.Value}}"}' + Mapping: + additionalProperties: + type: string + type: object + Metadata: + additionalProperties: + type: string + type: object + Audience: + items: + type: string + type: array + example: + - aud1 + - aud2 + NotAfterDifference: + type: integer + example: 900 + NotBeforeDifference: + type: integer + example: 0 + QueryStringParameter: + type: string + example: id_token + ResponseMode: + enum: + - query + - fragment + - form_post + type: string + example: query + LoginUrl: + type: string + example: https://example.com + type: object + example: + Algo: HS256 + Audience: + - aud1 + - aud2 + LoginUrl: https://example.com + Mapping: + email: Email[0].Value + uid: Uid + Metadata: + orgId: '123456' + NotAfterDifference: 900 + NotBeforeDifference: 0 + QueryStringParameter: id_token + ResponseMode: query + Secret: f5d70720-1a95-4cff-a2c5-5fd25e115aab + JwtIntegrationResponseCore: + type: object + properties: + AppName: + type: string + example: jwtapp + example: + AppName: jwtapp + JwtIntegrationResponse: + allOf: + - $ref: '#/components/schemas/JwtIntegrationBaseModel' + - $ref: '#/components/schemas/JwtIntegrationResponseCore' + JwtIntegrationCreateCore: + type: object + properties: + AppName: + type: string + required: + - AppName + - Algo + - Secret + JwtIntegrationRequestCore: + type: object + properties: + AppName: + type: string + example: + AppName: jwtapp + JwtIntegrationRequest: + allOf: + - $ref: '#/components/schemas/JwtIntegrationBaseModel' + - $ref: '#/components/schemas/JwtIntegrationRequestCore' + SamlIntegrationResponse: + properties: + AfterLogoutUrl: + type: string + example: https://example.com/logout + AppName: + type: string + example: ExampleApp + ArtifactReceiver: + type: string + example: https://example.com/artifact-receiver + AssertionConsumerService: + properties: + Binding: + enum: + - urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST + - urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect + type: string + example: urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST + Location: + type: string + example: https://example.com/acs + type: object + Attributes: + additionalProperties: + properties: + AlternativeMappingKey: + type: string + example: exampleKey + Format: + type: string + example: urn:oasis:names:tc:SAML:2.0:nameid-format:transient + IsStatic: + type: boolean + Value: + type: string + example: exampleValue + type: object + type: object + Audiences: + items: + type: string + type: array + example: + - https://example.com/audience1 + - https://example.com/audience2 + DefaultRequestBinding: + type: string + example: urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST + IdpCertificate: + properties: + Certificate: + type: string + example: MIIC...example...certificate + Key: + type: string + example: MIIC...example...key + type: object + IsIdpInitiated: + type: boolean + example: true + IssuerUrl: + type: string + example: https://example.com/issuer + LoginUrl: + type: string + example: https://example.com/login + NameIdFormat: + type: string + example: urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress + NotOnOrAfter: + type: integer + example: 1609459200 + RelayStateParameter: + type: string + example: exampleRelayState + SamlVersion: + type: string + example: '2.0' + SpCertificate: + properties: + Certificate: + type: string + example: MIIC...example...spcertificate + type: object + SpLogoutUrl: + type: string + example: https://example.com/sp-logout + IsPrebuiltIntegration: + type: boolean + example: true + ReplyUrl: + type: string + example: https://example.com/reply + IntegrationType: + type: string + example: exampleType + IntegrationConfigs: + type: object + properties: + IdpSHA1Fingerprint: + type: string + example: exampleFingerprint + AccountName: + type: string + example: exampleAccount + type: object + example: + AfterLogoutUrl: https://example.com/logout + AppName: ExampleApp + ArtifactReceiver: https://example.com/artifact-receiver + AssertionConsumerService: + Binding: urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST + Location: https://example.com/acs + Attributes: + additionalProperties: + AlternativeMappingKey: exampleKey + Format: urn:oasis:names:tc:SAML:2.0:nameid-format:transient + IsStatic: true + Value: exampleValue + Audiences: + - https://example.com/audience1 + - https://example.com/audience2 + DefaultRequestBinding: urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST + IdpCertificate: + Certificate: MIIC...example...certificate + Key: MIIC...example...key + IsIdpInitiated: true + IssuerUrl: https://example.com/issuer + LoginUrl: https://example.com/login + NameIdFormat: urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress + NotOnOrAfter: 1609459200 + RelayStateParameter: exampleRelayState + SamlVersion: '2.0' + SpCertificate: + Certificate: MIIC...example...spcertificate + SpLogoutUrl: https://example.com/sp-logout + IsPrebuiltIntegration: true + ReplyUrl: https://example.com/reply + IntegrationType: exampleType + IntegrationConfigs: + IdpSHA1Fingerprint: exampleFingerprint + AccountName: exampleAccount + SamlIntegrationCreateCore: + type: object + properties: + AppName: + type: string + required: + - AppName + Certificates: + type: object + properties: + Certificate: + type: string + nullable: true + example: certificate + Key: + type: string + nullable: true + example: key + SamlIntegrationRequest: + properties: + AfterLogoutUrl: + type: string + AssertionConsumerService: + properties: + Binding: + enum: + - urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST + - urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect + type: string + example: urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST + Location: + type: string + example: https://example.com/acs + type: object + Attributes: + additionalProperties: + properties: + AlternativeMappingKey: + type: string + example: exampleKey + Format: + type: string + example: urn:oasis:names:tc:SAML:2.0:nameid-format:transient + IsStatic: + type: boolean + Value: + type: string + example: exampleValue + type: object + type: object + Audiences: + items: + type: string + type: array + DefaultRequestBinding: + enum: + - urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST + - urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect + type: string + IsIdpInitiated: + type: boolean + IssuerUrl: + type: string + LoginUrl: + type: string + NameIdFormat: + enum: + - urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified + - urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress + - urn:oasis:names:tc:SAML:2.0:nameid-format:persistent + - urn:oasis:names:tc:SAML:2.0:nameid-format:transient + type: string + NotOnOrAfter: + type: integer + RelayStateParameter: + type: string + SpCertificate: + $ref: '#/components/schemas/Certificates' + SpLogoutUrl: + type: string + type: object + OAuthIntegrationBaseModel: + properties: + RedirectURIs: + type: array + items: + type: string + example: + - https://app.example.com/callback + AllowedScopes: + type: array + items: + type: string + enum: + - openid + - email + - phone + - profile + - address + example: + - openid + - email + GrantTypes: + type: array + description: Only authorization_code and refresh_token are permitted for OAuth integrations. + items: + type: string + enum: + - authorization_code + - refresh_token + example: + - authorization_code + - refresh_token + AccessTokenMappingTemplate: + type: string + example: '{"email": "{{Email.0.Value}}"}' + IdTokenMappingTemplate: + type: string + example: '{"sub": "{{Uid}}"}' + AccessTokenTTL: + type: integer + description: Access token lifetime in seconds. Defaults to 3600 when omitted. + default: 3600 + example: 3600 + IDTokenTTL: + type: integer + description: ID token lifetime in seconds. Defaults to 3600 when omitted. + default: 3600 + example: 3600 + RefreshTokenTTL: + type: integer + description: Refresh token lifetime in seconds. Defaults to 86400 when omitted. + default: 86400 + example: 86400 + EnablePKCE: + type: boolean + example: true + IsPrebuiltIntegration: + type: boolean + example: false + IntegrationType: + type: string + example: workday + TokenAuthMethod: + type: string + description: Token-endpoint client authentication method. Defaults to client_secret_post when omitted. + default: client_secret_post + enum: + - client_secret_basic + - client_secret_post + - client_secret_auto + - none + example: client_secret_post + DefaultWorkflow: + type: string + description: Name of the identity-orchestration workflow the authorize request falls back to when it carries no workflow parameter. Requires the IDENTITY_ORCHESTRATION feature; ignored when it is disabled. The workflow must already exist on the tenant, otherwise the request is rejected as an invalid integration configuration. Surrounding whitespace is trimmed; send an empty or blank string to clear it. + example: passwordless-signin + Connections: + type: object + description: Scopes which login methods this integration offers. A provider may only be listed here if it is already enabled on the app, otherwise the request is rejected as an invalid integration configuration. Omit to leave the stored value unchanged; send an empty array to clear a provider list. Setting Enabled to true without also sending a PasswordLessLogin block disables passwordless email and SMS login for this integration. + properties: + Enabled: + type: boolean + PasswordLessLogin: + type: object + properties: + Enabled: + type: boolean + Email: + type: boolean + SMS: + type: boolean + TraditionalLogin: + type: boolean + SocialLogins: + type: array + items: + type: object + properties: + IsEnabled: + type: boolean + ProviderName: + type: string + example: Google + CustomIdp: + type: array + items: + type: object + properties: + IsEnabled: + type: boolean + ProviderName: + type: string + example: jwt_custom + Enterprise: + type: array + items: + type: object + properties: + IsEnabled: + type: boolean + ProviderName: + type: string + example: saml_okta + type: object + OAuthIntegrationResponseCore: + type: object + properties: + Id: + type: string + description: The integration identifier. It is also the {oAuthApp} path segment of the runtime OAuth/OIDC endpoints, e.g. /api/oidc/{Id}/token. + example: 9f2c14b7a83d4e6bb0517c8e2d3a6f45 + DisplayName: + type: string + description: Customer-provided display label. Identification/display only. + example: workday-prod + ClientId: + type: string + description: System-generated, immutable client identifier. + example: 3b1e4f9c-2a7d-4c58-9e10-8f6b2d5a1c34 + ClientSecret: + type: string + description: Plaintext client secret. Returned only once, in the create response (and the rotate-credentials response). It is never returned on read operations — only the hash is stored server-side. + example: 8Jd2f9AqL0xR7bTnU3vY1wZ5cP6eK4hM + example: + Id: 9f2c14b7a83d4e6bb0517c8e2d3a6f45 + DisplayName: workday-prod + ClientId: 3b1e4f9c-2a7d-4c58-9e10-8f6b2d5a1c34 + ClientSecret: 8Jd2f9AqL0xR7bTnU3vY1wZ5cP6eK4hM + OAuthIntegrationResponse: + allOf: + - $ref: '#/components/schemas/OAuthIntegrationBaseModel' + - $ref: '#/components/schemas/OAuthIntegrationResponseCore' + OAuthIntegrationCreateCore: + type: object + properties: + DisplayName: + type: string + example: workday-prod + required: + - DisplayName + - RedirectURIs + - GrantTypes + OAuthIntegrationCredentialsResponse: + type: object + description: Client credentials returned after rotating an OAuth integration's secret. The plaintext ClientSecret is returned only once, in this response; only the hash is persisted server-side. + properties: + ClientId: + type: string + description: The integration's immutable client identifier (unchanged by rotation). + example: 3b1e4f9c-2a7d-4c58-9e10-8f6b2d5a1c34 + ClientSecret: + type: string + description: The newly generated plaintext client secret. Shown only once. + example: 8Jd2f9AqL0xR7bTnU3vY1wZ5cP6eK4hM + example: + ClientId: 3b1e4f9c-2a7d-4c58-9e10-8f6b2d5a1c34 + ClientSecret: 8Jd2f9AqL0xR7bTnU3vY1wZ5cP6eK4hM + JwtIssuerValidation: + type: object + properties: + ExpectedValue: + type: string + example: issuer + MatchValue: + type: boolean + example: true + IsMandatory: + type: boolean + example: true + JwtValidation: + type: object + properties: + IsMandatory: + type: boolean + example: true + JwtAudienceValidation: + type: object + properties: + ExpectedValues: + type: array + items: + type: string + example: + - aud1 + - aud2 + MatchValue: + type: boolean + example: true + IsMandatory: + type: boolean + example: true + JwtSpConfig: + type: object + properties: + Id: + type: string + format: objectId + example: 507f1f77bcf86cd799439011 + IsActive: + type: boolean + example: true + AppId: + type: integer + example: 123 + AppName: + type: string + example: MyApp + Algo: + type: string + example: HS256 + Mapping: + type: object + additionalProperties: + type: string + example: + key1: value1 + key2: value2 + Key: + type: string + nullable: true + example: my-secret-key + TokenQueryParameterName: + type: string + example: token + ClockSkew: + type: integer + example: 300 + LoginUrl: + type: string + example: https://example.com/login + Issuer: + $ref: '#/components/schemas/JwtIssuerValidation' + Subject: + $ref: '#/components/schemas/JwtValidation' + Audience: + $ref: '#/components/schemas/JwtAudienceValidation' + ExpirationTimeDifference: + type: integer + example: 3600 + UseAuthorizationHeader: + type: boolean + example: true + NotBefore: + $ref: '#/components/schemas/JwtValidation' + Expiration: + $ref: '#/components/schemas/JwtValidation' + JWKSUrl: + type: string + nullable: true + example: https://example.com/.well-known/jwks.json + UpdateEmailProfile: + type: boolean + example: true + RaasUpdateFields: + type: array + items: + type: string + example: + - field1 + - field2 + Domain: + type: string + nullable: true + example: example.com + EnableAutoLookUp: + type: boolean + nullable: true + example: true + Version: + type: string + nullable: true + example: v1 + ListInInterface: + type: boolean + example: true + CreatedDate: + type: string + format: date-time + example: '2023-01-01T00:00:00Z' + LastModifiedDate: + type: string + format: date-time + example: '2023-01-02T00:00:00Z' + JwtSpConfigCreateCore: + type: object + properties: + AppName: + type: string + example: MyApp + required: + - AppName + - Algo + - Mapping + JwtClaimSubjectProperty: + type: object + properties: + ExpectedValue: + type: string + nullable: true + example: expected-value + MatchValue: + type: boolean + nullable: true + example: true + IsMandatory: + type: boolean + nullable: true + example: true + JwtClaimMandatory: + type: object + properties: + IsMandatory: + type: boolean + nullable: true + example: true + JwtClaimAudienceProperty: + type: object + properties: + ExpectedValues: + type: array + items: + type: string + example: + - aud1 + - aud2 + MatchValue: + type: boolean + nullable: true + example: true + IsMandatory: + type: boolean + nullable: true + example: true + JwtSpConfigBaseModel: + type: object + properties: + Algo: + type: string + nullable: true + example: HS256 + Mapping: + type: object + additionalProperties: + type: string + example: + key1: value1 + key2: value2 + Key: + type: string + nullable: true + example: my-secret-key + TokenQueryParameterName: + type: string + nullable: true + example: token + ClockSkew: + type: integer + nullable: true + example: 300 + LoginUrl: + type: string + nullable: true + example: https://example.com/login + Issuer: + $ref: '#/components/schemas/JwtClaimSubjectProperty' + Subject: + $ref: '#/components/schemas/JwtClaimMandatory' + Audience: + $ref: '#/components/schemas/JwtClaimAudienceProperty' + ExpirationTimeDifference: + type: integer + nullable: true + example: 3600 + UseAuthorizationHeader: + type: boolean + nullable: true + example: true + NotBefore: + $ref: '#/components/schemas/JwtClaimMandatory' + Expiration: + $ref: '#/components/schemas/JwtClaimMandatory' + JWKSUrl: + type: string + nullable: true + example: https://example.com/.well-known/jwks.json + UpdateEmailProfile: + type: boolean + nullable: true + example: true + RaasUpdateFields: + type: array + items: + type: string + example: + - field1 + - field2 + Domain: + type: string + nullable: true + example: example.com + EnableAutoLookUp: + type: boolean + nullable: true + example: true + ListInInterface: + type: boolean + nullable: true + example: true + CertificateWithoutKey: + type: object + properties: + Certificate: + type: string + nullable: true + example: certificate + IdentityProvider: + type: object + properties: + Binding: + type: string + nullable: true + example: binding + Location: + type: string + nullable: true + example: location + LogOut: + type: string + nullable: true + example: logout + SamlSpConfig: + type: object + properties: + Id: + type: string + format: objectId + example: 507f1f77bcf86cd799439011 + IsActive: + type: boolean + example: true + IsDeleted: + type: boolean + example: false + IsIdpInitiated: + type: boolean + example: true + DataMap: + type: object + additionalProperties: + type: string + example: + key1: value1 + key2: value2 + AppId: + type: string + format: objectId + example: 507f1f77bcf86cd799439011 + AppID: + type: integer + example: 123 + RelayStateParameter: + type: string + example: relayState + Provider: + type: string + example: providerName + FriendlyProviderName: + type: string + example: Friendly Provider + DefaultLogoutUrl: + type: string + example: https://example.com/logout + ServiceProviderACSUrl: + type: string + example: https://example.com/acs + SamlServiceProvider: + type: string + nullable: true + example: SAML Service Provider + IdpCertificate: + $ref: '#/components/schemas/Certificates' + SpCertificate: + $ref: '#/components/schemas/CertificateWithoutKey' + IdentityProvider: + $ref: '#/components/schemas/IdentityProvider' + EnableAutoLookUp: + type: boolean + nullable: true + example: true + Domain: + type: string + nullable: true + example: example.com + ListInInterface: + type: boolean + example: true + CreatedDate: + type: string + format: date-time + example: '2023-01-01T00:00:00Z' + LastModifiedDate: + type: string + format: date-time + example: '2023-01-02T00:00:00Z' + SamlSpConfigModel: + type: object + properties: + Provider: + type: string + example: providerName + IsIdpInitiated: + type: boolean + nullable: true + example: true + DataMap: + type: object + additionalProperties: + type: string + example: + key1: value1 + key2: value2 + RelayStateParameter: + type: string + nullable: true + example: relayState + FriendlyProviderName: + type: string + nullable: true + example: Friendly Provider + IdpCertificate: + $ref: '#/components/schemas/Certificates' + IdentityProvider: + $ref: '#/components/schemas/IdentityProvider' + EnableAutoLookUp: + type: boolean + nullable: true + example: true + Domain: + type: string + nullable: true + example: example.com + ListInInterface: + type: boolean + nullable: true + example: true + SamlServiceProvider: + type: string + nullable: true + example: SAML Service Provider + required: + - Provider + - DataMap + SamlKeys: + type: array + items: + type: string + example: + - ID + - Provider + - FirstName + - MiddleName + - LastName + - FullName + - NickName + - ProfileName + - Gender + - Website + - Email + - Country + - ThumbnailImageUrl + - Favicon + - ProfileUrl + - HomeTown + - State + - Industry + - About + - LocalLanguage + - TagLine + - Language + - Verified + - UpdatedTime + - MainAddress + - Created + - LocalCity + - ProfileCity + - LocalCountry + - ProfileCountry + - RelationshipStatus + - Quote + - Religion + - Age + - Uid + - IsEmailSubscribed + - NoOfLogins + - BirthDate + - ImageUrl + - City + - TimeZone + - CoverPhoto + - Company + - PhoneId + RaasCustomField: + type: object + properties: + Key: + type: string + nullable: true + description: The key of the custom field. + example: custom_field_1 + Display: + type: string + nullable: true + description: The display name of the custom field. + example: Custom Field 1 + RaasOptions: + type: object + properties: + Value: + type: string + nullable: true + description: The value of the option. + example: option1 + Text: + type: string + nullable: true + description: The text of the option. + example: Option 1 + RaasConfigData: + type: object + properties: + Type: + type: string + description: The type of the configuration. + example: text + enum: + - text + - html + - password + - hidden + - option + - multi + - email + - string + Name: + type: string + description: The name of the configuration. + example: Configuration Name + Display: + type: string + description: The display name of the configuration. + example: Display Name + Rules: + type: string + description: The rules associated with the configuration. + example: Rules for the configuration + Options: + type: array + items: + $ref: '#/components/schemas/RaasOptions' + description: A list of options for the configuration. + Permission: + type: string + description: The permission required for the configuration. + example: Permission Name + Checked: + type: boolean + description: Indicates whether the configuration is checked. + example: true + Parent: + type: string + description: The parent field + example: Address + required: + - Type + - Name + - Permission + RaasConfig: + type: object + properties: + Type: + type: string + nullable: true + description: The type of the configuration. + example: email + Name: + type: string + nullable: true + description: The name of the configuration. + example: Email Id + Display: + type: string + nullable: true + description: The display name of the configuration. + example: Email ID + Rules: + type: string + nullable: true + description: The rules associated with the configuration. + example: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$ + Permission: + type: string + nullable: true + description: The permission level required for the configuration. + example: r + Options: + type: array + items: + $ref: '#/components/schemas/RaasOptions' + description: The options available for the configuration. + Checked: + type: boolean + nullable: true + description: Indicates if the configuration is checked. + example: true + required: + - Type + - Name + - permission + RaasCustomFieldModel: + type: object + properties: + CustomField: + type: string + description: Name of the field you want to add as a custom field in the configuration. Must be alphanumeric with optional internal hyphens (-) or underscores (_), must start and end with an alphanumeric character, and cannot contain dots, spaces, or other special characters (max length 60). + minLength: 1 + maxLength: 60 + pattern: ^[A-Za-z0-9]([A-Za-z0-9_-]{0,58}[A-Za-z0-9])?$ + required: + - CustomField + CustomFieldLimitResponse: + type: object + properties: + CustomFieldLimit: + type: integer + description: The limit for custom fields. + OAuthClientResponse: + properties: + AllowedCorsOrigin: + items: + type: string + type: array + example: + - https://example.com + AllowedScopes: + items: + type: string + type: array + example: + - openid + - profile + - email + AllowedWebOrigin: + items: + type: string + type: array + example: + - https://example.com + AppId: + type: number + example: 123456 + AppName: + type: string + example: MyApp + AudienceScopes: + additionalProperties: + items: + type: string + type: array + example: + - openid + - profile + - email + type: object + BackChannelLogout: + nullable: true + properties: + IsEnabled: + type: boolean + example: true + LogoutInitiator: + properties: + Mode: + type: string + example: RPInitiated + Intiators: + type: object + properties: + RPLogout: + type: boolean + IDPLogout: + type: boolean + PasswordChange: + type: boolean + AccountDelete: + type: boolean + type: object + LogoutTokenTTL: + type: integer + example: 3600 + LogoutURIs: + items: + type: string + type: array + example: + - https://example.com/logout + type: object + ClientId: + format: uuid + type: string + example: 123e4567-e89b-12d3-a456-426614174000 + ClientSecret: + type: string + example: exampleSecret + ClientType: + type: string + enum: + - public + - confidential + example: confidential + Connections: + type: object + properties: + Enabled: + type: boolean + example: true + PasswordlessLogin: + type: object + properties: + Enabled: + type: boolean + Email: + type: boolean + SMS: + type: boolean + TraditionalLogin: + type: boolean + SocialLogins: + type: array + items: + type: object + properties: + IsEnabled: + type: boolean + ProviderName: + type: string + example: Google + CustomIdp: + type: array + items: + type: object + properties: + IsEnabled: + type: boolean + ProviderName: + type: string + example: Google + Enterprise: + type: array + items: + type: object + properties: + IsEnabled: + type: boolean + ProviderName: + type: string + example: Google + CreatedDate: + format: date-time + type: string + example: '2023-10-01T12:00:00Z' + Description: + type: string + example: Internal billing reconciliation cron + DeviceCodeConfig: + nullable: true + properties: + AfterVerificationUrl: + type: string + example: https://example.com/after-verification + DeviceCodeExpire: + type: integer + example: 300 + PollingInterval: + type: integer + example: 5 + UserCodeCharacterSet: + enum: + - Base20 + - Alpha + - Digits + - Alphanumeric + type: string + example: Base20 + UserCodeMask: + type: string + example: '6' + VerificationUrl: + type: string + example: https://example.com/verification + type: object + EnableCorsOrigin: + type: boolean + example: true + ForceReAuthentication: + type: boolean + example: true + GlobalClient: + type: boolean + example: true + GrantTypes: + items: + type: string + type: array + example: + - authorization_code + - client_credentials + IdTokenAudiences: + items: + type: string + example: + - example-audience + type: array + JwtTokenConfig: + nullable: true + properties: + Algorithm: + type: string + example: RS256 + IdTokenTTL: + type: integer + example: 3600 + TokenTTL: + type: integer + example: 3600 + type: object + LastModifiedDate: + format: date-time + nullable: true + type: string + example: '2023-10-01T12:00:00Z' + LoginUrl: + nullable: true + type: string + example: https://example.com/login + LoginRedirectUri: + items: + type: string + type: array + example: + - https://example.com/login + LogoutRedirectUri: + items: + type: string + type: array + example: + - https://example.com/logout + AccessTokenMappingTemplate: + type: string + example: '{"email": "{{Email.0.Value}}"}' + IdTokenMappingTemplate: + type: string + example: '{"email": "{{Email.0.Value}}"}' + Mapping: + additionalProperties: + type: string + type: object + Metadata: + additionalProperties: + type: string + example: exampleValue + type: object + example: + key1: value1 + key2: value2 + RedirectURIExactMatch: + type: boolean + example: true + RefreshTokenRotation: + nullable: true + type: object + properties: + ReuseInterval: + type: integer + minimum: 0 + maximum: 60 + example: 30 + RefreshTokenTTL: + type: integer + example: 3600 + Secret: + type: string + example: exampleSecret + SignedUserInfo: + type: boolean + TokenAuthMethod: + type: string + example: client_secret_basic + TokenWebOriginMatch: + type: boolean + example: true + type: object + OAuthClientCreateCore: + type: object + properties: + AppName: + type: string + required: + - AppName + - TokenAuthMethod + OAuthClientRequest: + properties: + AllowedCorsOrigin: + items: + type: string + type: array + AllowedScopes: + items: + type: string + enum: + - email + - phone + - profile + - address + type: array + AudienceScopes: + additionalProperties: + items: + type: string + type: array + type: object + BackChannelLogout: + nullable: true + properties: + IsEnabled: + type: boolean + LogoutTokenTTL: + type: integer + example: 3600 + LogoutURIs: + items: + type: string + type: array + example: + - https://example.com/logout + type: object + ClientType: + type: string + enum: + - public + - confidential + description: Whether the client can keep a secret confidential. `confidential` clients (server-side / M2M) authenticate with their secret; `public` clients (SPA / native) default to token endpoint auth method `none` and rely on PKCE. When omitted it is derived server-side from the resolved token endpoint auth method. + example: confidential + Connections: + type: object + properties: + Enabled: + type: boolean + PasswordlessLogin: + type: object + properties: + Enabled: + type: boolean + Email: + type: boolean + SMS: + type: boolean + TraditionalLogin: + type: boolean + SocialLogins: + type: array + items: + type: object + properties: + IsEnabled: + type: boolean + ProviderName: + type: string + example: Google + CustomIdp: + type: array + items: + type: object + properties: + IsEnabled: + type: boolean + ProviderName: + type: string + example: SAML + Enterprise: + type: array + items: + type: object + properties: + IsEnabled: + type: boolean + ProviderName: + type: string + example: SAML + Description: + type: string + maxLength: 255 + description: Optional free-text description of the application, shown only in the admin console (never exposed to end users). + example: Internal billing reconciliation cron + DeviceCodeConfig: + nullable: true + properties: + AfterVerificationUrl: + type: string + example: https://example.com/after-verification + DeviceCodeExpire: + type: integer + example: 300 + PollingInterval: + type: integer + example: 5 + UserCodeCharacterSet: + enum: + - Base20 + - Alpha + - Digits + - Alphanumeric + type: string + example: Base20 + UserCodeMask: + type: string + example: XXXX-XXXX + VerificationUrl: + type: string + example: https://example.com/verification + type: object + EnableCorsOrigin: + type: boolean + ForceReAuthentication: + type: boolean + GrantTypes: + items: + type: string + enum: + - authorization_code + - implicit + - password + - client_credentials + - refresh_token + - urn:ietf:params:oauth:grant-type:device_code + - http://loginradius.com/oauth/grant-type/exchange_token + type: array + IdTokenAudiences: + items: + type: string + type: array + JwtTokenConfig: + nullable: true + properties: + IdTokenTTL: + type: integer + example: 3600 + TokenTTL: + type: integer + example: 3600 + type: object + LoginUrl: + nullable: true + type: string + LoginRedirectUri: + items: + type: string + type: array + LogoutRedirectUri: + items: + type: string + type: array + AccessTokenMappingTemplate: + type: string + example: '{"email": "{{Email.0.Value}}"}' + IdTokenMappingTemplate: + type: string + example: '{"email": "{{Email.0.Value}}"}' + Mapping: + additionalProperties: + type: string + type: object + Metadata: + additionalProperties: + type: string + type: object + RedirectURIExactMatch: + type: boolean + RefreshTokenRotation: + nullable: true + type: object + properties: + ReuseInterval: + type: integer + minimum: 0 + maximum: 60 + example: 30 + RefreshTokenTTL: + nullable: true + type: integer + SessionTokenTTL: + type: integer + nullable: true + Secret: + type: string + SignedUserInfo: + type: boolean + TokenAuthMethod: + enum: + - client_secret_basic + - client_secret_post + - client_secret_auto + - none + type: string + type: object + OAuthClientSecretResetResponse: + properties: + ClientId: + format: uuid + type: string + ClientSecret: + type: string + type: object + OAuth2Provider: + type: object + properties: + IsActive: + type: boolean + example: true + description: Indicates if the OAuth2 provider is active. + CreatedAt: + type: string + format: date-time + example: '2023-10-01T12:00:00Z' + description: The date and time when the OAuth2 provider was created. + LastModified: + type: string + format: date-time + example: '2023-10-01T12:00:00Z' + description: The date and time when the OAuth2 provider was last modified. + QueryParam: + type: object + additionalProperties: + type: string + example: exampleValue + description: The query parameters for the OAuth2 provider. + Headers: + type: object + additionalProperties: + type: string + description: The headers for the OAuth2 provider. + example: + Authorization: Bearer token + DataMap: + type: object + additionalProperties: + type: string + description: The data map for the OAuth2 provider. + ProviderName: + type: string + description: The name of the OAuth2 provider. + example: ExampleProvider + ApplicationID: + type: string + description: The application ID for the OAuth2 provider. + example: '1234567890' + ApplicationKey: + type: string + description: The application key for the OAuth2 provider. + example: abcdefghijklmnop + ApplicationSecret: + type: string + description: The application secret for the OAuth2 provider. + example: secret123 + Scope: + type: string + description: The scope for the OAuth2 provider. + example: read write + ResponseType: + type: string + description: The response type for the OAuth2 provider. + example: code + UserLoginEndpoint: + type: string + description: The User login endpoint for the OAuth2 provider. + example: https://example.com/oauth2/login + ExtraParameterInRedirectToProvider: + type: string + description: Extra parameters in redirect to provider. + example: extra_param=value + AccessTokenEndpoint: + type: string + description: The Access Token endpoint for the OAuth2 provider. + example: https://example.com/oauth2/token + RequestTokenHttpMethod: + type: string + description: The HTTP method for requesting tokens. + example: POST + AccessTokenParameterNameForApiAccess: + type: string + description: The Access Token parameter name for API access. + example: access_token + UserprofileEndpoint: + type: string + description: The User profile endpoint for the OAuth2 provider. + example: https://example.com/oauth2/userinfo + Domain: + type: string + description: The domain for the OAuth2 provider. + example: example.com + EnableAutoLookUp: + type: boolean + nullable: true + description: Indicates if auto lookup is enabled. + example: true + ListInInterface: + type: boolean + description: Indicates if the provider should be listed in the interface. + example: true + CustomOAuth2UpdateModel: + type: object + properties: + ProviderName: + type: string + description: The name of the OAuth2 provider. + ExtraParameterInRedirectToProvider: + type: string + description: Extra parameters in redirect to provider. + EnableAutoLookUp: + type: boolean + nullable: true + description: Indicates if auto lookup is enabled. + Domain: + type: string + description: The domain for the OAuth2 provider. + UserLoginEndpoint: + type: string + description: The User login endpoint for the OAuth2 provider. + AccessTokenEndpoint: + type: string + description: The Access Token endpoint for the OAuth2 provider. + ApplicationKey: + type: string + description: The application key for the OAuth2 provider. + ApplicationSecret: + type: string + description: The application secret for the OAuth2 provider. + ApplicationID: + type: string + description: The application ID for the OAuth2 provider. + Scope: + type: string + description: The scope for the OAuth2 provider. + ResponseType: + type: string + description: The response type for the OAuth2 provider. + UserprofileEndpoint: + type: string + description: The User profile endpoint for the OAuth2 provider. + DataMap: + type: object + additionalProperties: + type: string + description: The data map for the OAuth2 provider. + AccessTokenParameterNameForApiAccess: + type: string + description: The Access Token parameter name for API access. + RequestTokenHttpMethod: + type: string + description: The HTTP method for requesting tokens. + Headers: + type: object + additionalProperties: + type: string + description: The headers for the OAuth2 provider. + QueryParam: + type: object + additionalProperties: + type: string + description: The query parameters for the OAuth2 provider. + required: + - ProviderName + CustomOAuth2Model: + type: object + properties: + ProviderName: + type: string + description: The name of the OAuth2 provider. + ExtraParameterInRedirectToProvider: + type: string + description: Extra parameters in redirect to provider. + UserLoginEndpoint: + type: string + description: The User login endpoint for the OAuth2 provider. + AccessTokenEndpoint: + type: string + description: The Access Token endpoint for the OAuth2 provider. + ApplicationKey: + type: string + description: The application key for the OAuth2 provider. + ApplicationSecret: + type: string + description: The application secret for the OAuth2 provider. + EnableAutoLookUp: + type: boolean + nullable: true + description: Indicates if auto lookup is enabled. + Domain: + type: string + description: The domain for the OAuth2 provider. + ApplicationID: + type: string + description: The application ID for the OAuth2 provider. + Scope: + type: string + description: The scope for the OAuth2 provider. + ResponseType: + type: string + description: The response type for the OAuth2 provider. + UserprofileEndpoint: + type: string + description: The User profile endpoint for the OAuth2 provider. + UserInfoExtractByIdToken: + type: boolean + nullable: true + description: Indicates if user info should be extracted by ID token. + JWKSEndpoint: + type: string + description: The JWKS endpoint for verifying the ID token. + DataMap: + type: object + additionalProperties: + type: string + description: The data map for the OAuth2 provider. + AccessTokenParameterNameForApiAccess: + type: string + description: The Access Token parameter name for API access. + TrasnsportType: + type: string + description: The transport type. + RequestTokenHttpMethod: + type: string + enum: + - GET + - POST + description: The HTTP method for requesting tokens. + Headers: + type: object + additionalProperties: + type: string + description: The headers for the OAuth2 provider. + QueryParam: + type: object + additionalProperties: + type: string + description: The query parameters for the OAuth2 provider. + ListInInterface: + type: boolean + description: Indicates if the provider should be listed in the interface. + required: + - ProviderName + - UserLoginEndpoint + - AccessTokenEndpoint + - ApplicationKey + - ApplicationSecret + - Scope + - ResponseType + - DataMap + - RequestTokenHttpMethod + CustomOAuth2DeleteModel: + type: object + properties: + ProviderName: + type: string + description: The name of the OAuth2 provider to be deleted. + required: + - ProviderName + CustomProviderKeys: + type: object + properties: + Key: + type: string + description: The key of the custom provider. + example: custom_provider_key + Display: + type: string + description: The display name of the custom provider. + example: Custom Provider + PasswordPolicy: + type: object + properties: + DictionaryPasswordValidation: + type: boolean + nullable: true + example: true + ProfileDataPasswordValidation: + type: boolean + nullable: true + example: true + ProfileDataPasswordExactMatch: + type: boolean + nullable: true + example: false + CommonPasswordPreventionValidation: + type: boolean + nullable: true + example: true + MaxPasswordHistory: + type: integer + nullable: true + example: 5 + ExpirationFrequency: + type: integer + nullable: true + example: 90 + ExpirationFrequencyType: + type: string + nullable: true + enum: + - day + - month + - year + PasswordValidationRules: + type: string + nullable: true + example: At least one uppercase letter, one lowercase letter, one number, and one special character + UserProfile: + type: object + properties: + AppName: + type: string + description: Application name. + example: myApp + Uid: + type: string + description: Unique User identifier. + example: '123456' + ID: + type: string + nullable: true + description: Internal User ID. + example: abcde + Provider: + type: string + nullable: true + description: Authentication provider. + example: google + Prefix: + type: string + nullable: true + description: Name prefix. + example: Mr. + FirstName: + type: string + nullable: true + description: User's first name. + example: John + MiddleName: + type: string + nullable: true + description: User's middle name. + example: A. + LastName: + type: string + nullable: true + description: User's last name. + example: Doe + Suffix: + type: string + nullable: true + description: Name suffix. + example: Jr. + FullName: + type: string + nullable: true + description: Full name. + example: John A. Doe + NickName: + type: string + nullable: true + description: Nickname. + example: Johnny + ProfileName: + type: string + nullable: true + description: Profile name. + example: johnnydoe + BirthDate: + type: string + nullable: true + format: date + description: Birth date. + example: '1990-01-01' + Gender: + type: string + nullable: true + description: Gender. + example: male + Website: + type: string + nullable: true + description: Personal website URL. + example: https://johndoe.com + Email: + description: Email address or object. + oneOf: + - type: string + - type: object + example: john@example.com + Country: + description: Country or object. + oneOf: + - type: string + - type: object + example: USA + ThumbnailImageUrl: + type: string + nullable: true + description: Thumbnail image URL. + example: https://example.com/thumb.jpg + ImageUrl: + description: Image URL or object. + oneOf: + - type: string + - type: object + example: https://example.com/image.jpg + Favicon: + description: Favicon URL or object. + oneOf: + - type: string + - type: object + example: https://example.com/favicon.ico + ProfileUrl: + description: Profile URL or object. + oneOf: + - type: string + - type: object + example: https://example.com/profile + HomeTown: + type: string + nullable: true + description: Hometown. + example: New York + State: + type: string + nullable: true + description: State. + example: NY + City: + type: string + nullable: true + description: City. + example: New York + Industry: + type: string + nullable: true + description: Industry. + example: Software + About: + type: string + nullable: true + description: About the User. + example: Software engineer with 10 years of experience. + TimeZone: + type: string + nullable: true + description: Time zone. + example: America/New_York + LocalLanguage: + type: string + nullable: true + description: Local language. + example: en + CoverPhoto: + description: Cover photo URL or object. + oneOf: + - type: string + - type: object + example: https://example.com/cover.jpg + TagLine: + type: string + nullable: true + description: Tag line. + example: Keep it simple. + Language: + type: string + nullable: true + description: Preferred language. + example: en + Verified: + type: string + nullable: true + description: Verification status. + example: 'true' + UpdatedTime: + type: string + nullable: true + format: date-time + description: Last updated time. + example: '2023-01-01T12:00:00Z' + Positions: + description: Positions or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + Educations: + description: Educations or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + PhoneNumbers: + description: Phone numbers or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + IMAccounts: + description: IM accounts or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + Addresses: + description: Addresses or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + MainAddress: + type: string + nullable: true + description: Main address. + example: 123 Main St + Created: + type: string + nullable: true + format: date-time + description: Created timestamp. + example: '2020-01-01T00:00:00Z' + CreatedDate: + type: string + nullable: true + format: date-time + description: Created date. + example: '2020-01-01T00:00:00Z' + ModifiedDate: + type: string + nullable: true + format: date-time + description: Modified date. + example: '2021-01-01T00:00:00Z' + ProfileModifiedDate: + type: string + nullable: true + format: date-time + description: Profile modified date. + example: '2021-06-01T00:00:00Z' + LocalCity: + type: string + nullable: true + description: Local city. + example: Brooklyn + ProfileCity: + type: string + nullable: true + description: Profile city. + example: Manhattan + LocalCountry: + type: string + nullable: true + description: Local country. + example: USA + ProfileCountry: + type: string + nullable: true + description: Profile country. + example: USA + FirstLogin: + type: boolean + description: Whether this is the User's first login. + example: false + IsProtected: + type: boolean + description: Whether the profile is protected. + example: false + RelationshipStatus: + type: string + nullable: true + description: Relationship status. + example: single + Quota: + type: string + nullable: true + description: Quota. + example: unlimited + InterestedIn: + type: array + nullable: true + items: + type: string + description: List of interests. + example: + - sports + - music + Interests: + description: Interests or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + Religion: + type: string + nullable: true + description: Religion. + example: None + Political: + type: string + nullable: true + description: Political views. + example: Independent + Sports: + description: Sports or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + InspirationalPeople: + description: Inspirational people or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + HttpsImageUrl: + description: HTTPS image URL or object. + oneOf: + - type: string + - type: object + example: https://example.com/image.jpg + FollowersCount: + type: integer + description: Number of followers. + example: 100 + FriendsCount: + type: integer + description: Number of friends. + example: 50 + IsGeoEnabled: + type: string + nullable: true + description: Whether geo is enabled. + example: 'true' + TotalStatusesCount: + type: integer + description: Total number of statuses. + example: 200 + Associations: + type: string + nullable: true + description: Associations. + example: IEEE + NumRecommenders: + type: integer + description: Number of recommenders. + example: 5 + Honors: + type: string + nullable: true + description: Honors. + example: Best Developer + Awards: + description: Awards or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + Skills: + description: Skills or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + CurrentStatus: + description: Current status or object. + oneOf: + - type: string + - type: object + example: Active + Certifications: + description: Certifications or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + Courses: + description: Courses or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + Volunteer: + description: Volunteer or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + RecommendationsReceived: + description: Recommendations received or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + Languages: + description: Languages or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + Projects: + description: Projects or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + Games: + description: Games or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + Family: + description: Family or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + TeleVisionShow: + description: Television shows or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + MutualFriends: + description: Mutual friends or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + Movies: + description: Movies or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + Books: + description: Books or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + AgeRange: + description: Age range or object. + oneOf: + - type: string + - type: object + example: 18-25 + PublicRepository: + description: Public repository or object. + oneOf: + - type: string + - type: object + example: https://github.com/johndoe + Hireable: + type: boolean + description: Whether the User is hireable. + example: true + RepositoryUrl: + description: Repository URL or object. + oneOf: + - type: string + - type: object + example: https://github.com/johndoe + Age: + type: integer + nullable: true + description: Age of the User. + example: 30 + Patents: + description: Patents or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + FavoriteThings: + description: Favorite things or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + ProfessionalHeadline: + type: string + nullable: true + description: Professional headline. + example: Senior Software Engineer + RelatedProfileViews: + description: Related profile views or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + KloutScore: + description: Klout score or object. + oneOf: + - type: number + - type: object + example: 55.5 + LRUserID: + type: string + nullable: true + description: LoginRadius User ID. + example: lr_123456 + PlacesLived: + description: Places lived or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + Publications: + description: Publications or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + JobBookmarks: + description: Job bookmarks or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + Suggestions: + description: Suggestions or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + Badges: + description: Badges or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + MemberUrlResources: + description: Member URL resources or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + TotalPrivateRepository: + type: integer + description: Total number of private repositories. + example: 2 + Currency: + type: string + nullable: true + description: Currency. + example: USD + StarredUrl: + description: Starred URL or object. + oneOf: + - type: string + - type: object + example: https://github.com/johndoe/starred + GistsUrl: + description: Gists URL or object. + oneOf: + - type: string + - type: object + example: https://gist.github.com/johndoe + PublicGists: + type: integer + description: Number of public gists. + example: 10 + PrivateGists: + type: integer + description: Number of private gists. + example: 5 + Subscription: + description: Subscription or object. + oneOf: + - type: string + - type: object + example: premium + Company: + type: string + nullable: true + description: Company name. + example: Acme Corp + GravatarImageUrl: + description: Gravatar image URL or object. + oneOf: + - type: string + - type: object + example: https://www.gravatar.com/avatar/abc123 + ProfileImageUrls: + description: Profile image URLs or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + WebProfiles: + description: Web profiles or object. + oneOf: + - type: array + items: {} + - type: object + example: [] + PinsCount: + type: integer + description: Number of PINs. + example: 12 + BoardsCount: + type: integer + description: Number of boards. + example: 3 + LikesCount: + type: integer + description: Number of likes. + example: 100 + EmailVerifiedFromSocial: + type: boolean + description: Whether Email is verified from social login. + example: true + SignupDate: + type: string + nullable: true + format: date-time + description: Signup date. + example: '2020-01-01T00:00:00Z' + LastLoginDate: + type: string + nullable: true + format: date-time + description: Last login date. + example: '2023-01-01T00:00:00Z' + CustomFields: + description: Custom fields or object. + oneOf: + - type: object + - type: array + items: {} + example: {} + LastPasswordChangeDate: + type: string + nullable: true + format: date-time + description: Last Password change date. + example: '2023-01-01T00:00:00Z' + PasswordExpirationDate: + type: string + nullable: true + format: date-time + description: Password expiration date. + example: '2023-12-31T00:00:00Z' + LastPasswordChangeToken: + type: string + nullable: true + description: Last Password change token. + example: token123 + EmailVerified: + type: boolean + description: Whether Email is verified. + example: true + IsActive: + type: boolean + description: Whether the User is active. + example: true + IsDeleted: + type: boolean + description: Whether the User is deleted. + example: false + IsEmailSubscribed: + type: boolean + description: Whether the User is subscribed to emails. + example: true + UserName: + type: string + nullable: true + description: Username. + example: johndoe + NoOfLogins: + type: integer + description: Number of logins. + example: 20 + PreviousUids: + type: array + nullable: true + items: + type: string + description: Previous UIDs. + example: + - oldUID1 + - oldUID2 + PhoneId: + type: string + nullable: true + description: Phone ID. + example: phone123 + PhoneIdVerified: + type: boolean + description: Whether Phone ID is verified. + example: true + Roles: + type: array + nullable: true + items: + type: string + description: List of Roles. + example: + - admin + - user + ExternalUserLoginId: + type: string + nullable: true + description: External User login ID. + example: extlogin123 + FailedLoginAttempt: + type: integer + description: Number of failed login attempts. + example: 0 + SecurityQuestionFailedResetPasswordAttempts: + type: integer + description: Failed security question attempts for Password reset. + example: 0 + SecurityQuestionFailedLoginAttempt: + type: integer + description: Failed security question attempts for login. + example: 0 + DisableLogin: + type: boolean + description: Whether login is disabled. + example: false + RegistrationProvider: + type: string + nullable: true + description: Registration provider. + example: google + IsLoginLocked: + type: boolean + description: Whether login is locked. + example: false + LoginLockedType: + type: string + nullable: true + description: Type of login lock. + example: temporary + LastLoginLocation: + type: string + nullable: true + description: Last login location. + example: New York + RegistrationSource: + type: string + nullable: true + description: Registration source. + example: web + IsCustomUid: + type: boolean + description: Whether UID is custom. + example: false + UnverifiedEmail: + description: Unverified Email or object. + oneOf: + - type: string + - type: object + example: unverified@example.com + RoleContext: + description: Role Context or object. + oneOf: + - type: object + - type: array + items: {} + example: {} + KnownLoginVariables: + description: Known login variables or object. + oneOf: + - type: object + - type: array + items: {} + example: {} + IsSecurePassword: + type: boolean + description: Whether the Password is secure. + nullable: true + example: true + PrivacyPolicy: + description: Privacy Policy or object. + oneOf: + - type: object + - type: array + items: {} + example: {} + LoginLockedTimeout: + type: string + nullable: true + description: Login locked timeout. + example: '2023-01-01T01:00:00Z' + ExternalIds: + description: External IDs or object. + oneOf: + - type: object + - type: array + items: {} + example: {} + IsRequiredFieldsFilledOnce: + type: boolean + description: Whether required fields are filled at least once. + example: true + SignupLog: + description: Signup log or object. + oneOf: + - type: object + - type: array + items: {} + example: {} + LastAcceptedConsentVersion: + type: number + format: float + description: Last accepted consent version. + example: 1 + user_agent: + description: User agent or object. + oneOf: + - type: string + - type: object + example: Mozilla/5.0 + UserProfileResponse: + type: object + properties: + data: + type: array + description: List of User profiles. + items: + $ref: '#/components/schemas/UserProfile' + next: + type: string + description: Scroll or pagination token for fetching the next set of results. + example: DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAABXcWem... + QueryGroup: + type: object + properties: + operator: + type: string + enum: + - AND + - OR + description: Logical operator to combine rules. + example: AND + rules: + type: array + items: + $ref: '#/components/schemas/QueryRule' + minItems: 1 + required: + - operator + - rules + QueryRule: + type: object + properties: + group: + $ref: '#/components/schemas/QueryGroup' + name: + type: string + description: Name of the field to query. + example: status + operator: + type: string + description: Operator for the query (e.g., =, !=, >, <). + example: '=' + value: + description: Value to compare against. Can be string, boolean, or number. + example: active + IdentityQuery: + type: object + properties: + group: + $ref: '#/components/schemas/QueryGroup' + UserProfileRequestBody: + type: object + properties: + from: + type: string + format: date + description: Start date in YYYY-MM-DD format. + to: + type: string + format: date + description: End date in YYYY-MM-DD format. + size: + type: integer + minimum: 1 + maximum: 1000 + description: Number of results to return. + q: + $ref: '#/components/schemas/IdentityQuery' + SimpleUserProfileResponse: + type: object + properties: + _id: + type: string + description: Unique identifier for the User profile + example: user_123456789 + DateCreated: + type: string + format: date-time + description: Date and time when the profile was created + example: '2023-10-01T12:00:00Z' + DateModified: + type: string + format: date-time + description: Date and time when the profile was last modified + example: '2023-10-02T12:00:00Z' + IsActive: + type: boolean + description: Whether the profile is active + IsDeleted: + type: boolean + description: Whether the profile is deleted + CustomObject: + type: object + additionalProperties: true + description: Custom data associated with the User + Uid: + type: string + description: Unique identifier of the User + example: UID_123456789 + UserProfileScrollResponse: + type: object + properties: + total: + type: integer + description: Total number of User profiles matching the query. + example: 100 + data: + type: array + description: List of User profiles. + items: + $ref: '#/components/schemas/SimpleUserProfileResponse' + next: + type: string + description: Scroll or pagination token for fetching the next set of results. + example: DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAABXcWem... + ExtendUserProfileWithCustomObjectCore: + type: object + properties: + CustomObject: + type: object + description: Custom Object associated with the User profile. + additionalProperties: + type: object + description: Custom fields defined by the User. + example: + field1: value1 + field2: value2 + example: + field1: + subfield: subvalue + ExtendUserProfileWithCustomObject: + allOf: + - $ref: '#/components/schemas/UserProfile' + - $ref: '#/components/schemas/ExtendUserProfileWithCustomObjectCore' + userProfileNextResponseWithCustomObject: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/ExtendUserProfileWithCustomObject' + next: + type: string + description: The token to retrieve the next page of results. + nullable: true + example: DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAABXcWem... + userProfileScrollResponseWithCustomObject: + type: object + properties: + total: + type: integer + description: Total number of User profiles matching the query. + example: 100 + data: + type: array + description: List of User profiles. + items: + $ref: '#/components/schemas/ExtendUserProfileWithCustomObject' + next: + type: string + description: Scroll or pagination token for fetching the next set of results. + example: DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAABXcWem... + UserProfileNextResponse: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/SimpleUserProfileResponse' + next: + type: string + description: The token to retrieve the next page of results. + nullable: true + example: DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAABXcWem... + RangeObj: + type: object + properties: + key: + type: string + description: Optional. Key for the range bucket. + example: range-1 + to: + description: Upper bound of the range (inclusive or exclusive depending on context). + oneOf: + - type: string + - type: integer + - type: number + example: 100 + from: + description: Lower bound of the range (inclusive or exclusive depending on context). + oneOf: + - type: string + - type: integer + - type: number + example: 0 + description: | + Defines a single range for range-based aggregations, with optional key. + AggregationObj: + type: object + properties: + field: + type: string + description: The field to aggregate on. + example: status + type: + type: string + description: The type of aggregation (e.g., terms, range, histogram). + example: terms + ranges: + type: object + additionalProperties: + $ref: '#/components/schemas/RangeObj' + description: | + Optional. A map of range names to range objects, used for range aggregations. + interval: + description: | + Optional. The interval for histogram aggregations. Can be string, integer, or float. + oneOf: + - type: string + - type: integer + - type: number + example: 10 + format: + type: string + description: Optional. Format string for date or numeric values. + example: yyyy-MM-dd + description: | + Configuration for a single aggregation, including field, type, and optional range or interval. + Aggregation: + type: object + required: + - aggregations + properties: + aggregations: + type: object + additionalProperties: + $ref: '#/components/schemas/AggregationObj' + description: | + A map of aggregation names to their configuration objects. + description: | + Defines the aggregation structure for the insights query. + requestPayload: + type: object + properties: + from: + type: string + format: date-time + description: Start of the time range for the query (ISO 8601 format). + to: + type: string + format: date-time + description: End of the time range for the query (ISO 8601 format). + q: + $ref: '#/components/schemas/Aggregation' + description: | + The request payload for insights queries, specifying the time range and aggregation details. + InsightsResponse: + type: object + properties: + total: + type: integer + format: int32 + description: Total number of results + aggregations: + type: object + additionalProperties: true + description: Aggregated data + LoginByEmail: + description: Login By Email + type: object + properties: + email: + type: string + example: user123@example.com + password: + type: string + example: Password123 + required: + - email + - password + LoginByUserName: + description: Login By UserName + type: object + properties: + password: + type: string + example: Password123 + username: + type: string + example: user123 + required: + - username + - password + JWTSignature: + description: JWT Signature Response + type: object + properties: + signature: + type: string + example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdWQiOiIxMTI1NjNmNi0xNDgwLTQwYjgtOGUyOC1lMDcyY2EyMTJjODIiLCJlbWFpbCI6Im1heWFua2xydGVzdDIrQGdtYWlsLmNvbSIsImV4cCI6MTc0NTQ4MzA4MSwiZmlyc3RuYW1lIjoiTWF5YW5rIiwiaWF0IjoxNzQ1NDgxMjgxLCJpc3MiOiJodHRwczovL2ludGVybmFsLW1heWFuay5odWIubG9naW5yYWRpdXMuY29tLyIsImp0aSI6IjlhNGZkOGY1LWU4NDMtNDgzZS1hODNiLTJlNTM4NzY5ZTYxNiIsImxhc3RuYW1lIjoiQWdhcndhbCIsIm5iZiI6MTc0NTQ4MTI4MSwic3ViIjoiMWFjM2Q5ZGMzYzdkNDJlMDhhMzJiZjU0NjIyYmNjYzMifQ.m88HgYiikjAJju5mKeqJLgdEbqoAGGLVGLhxmB81jWc + OAuthDeviceCode: + description: OAuth Device Code Request + type: object + properties: + client_id: + type: string + example: 68106262-3938-4435-87ed-3e410b360209 + scope: + type: string + example: openid Email profile + required: + - client_id + OAuthDeviceCodeResponse: + description: OAuth Device Code Response + type: object + properties: + device_code: + type: string + example: device_code + expires_in: + type: integer + example: 1800 + interval: + type: integer + example: 5 + user_code: + type: string + example: user_code + verification_uri: + type: string + example: https://example.com/device/verification + verification_uri_complete: + type: string + example: https://example.com/device/verification?user_code=user_code + OAuthErrorResponse: + type: object + properties: + error: + type: string + error_description: + type: string + OAuthRevokeRefreshToken: + description: OAuth Revoke Refresh Token Request + type: object + properties: + client_id: + type: string + example: 68106262-3938-4435-87ed-3e410b360209 + client_secret: + type: string + example: AQvsBHrjOYFNJdvndATLBPoavRZUp1fj4656 + token: + type: string + example: 3976a9391e31d3c1cf854c83f9f65078:90f... + required: + - client_id + - client_secret + - token + OIDCTokenIntrospectResponse: + description: OIDC Token Introspection Response (RFC 7662). When active is false, only active is returned. When active is true, standard claims may be included. + type: object + properties: + active: + type: boolean + description: True if the token is valid and active; false otherwise. + example: true + sub: + type: string + description: Subject (e.g. user or client identifier) + example: 699f40ae-8040-42fe-a1cd-e1eb10cf73ef + cid: + type: string + description: Client ID (audience/client) + example: ddff8a63-cbc3-4723-8415-b910c4d8770d + azp: + type: string + description: Authorized party + example: ddff8a63-cbc3-4723-8415-b910c4d8770d + iss: + type: string + description: Issuer + example: https://{TenantEndpoint}/service/oidc/{oidcAppName} + exp: + type: integer + description: Expiration time (Unix) + example: 1745988311 + iat: + type: integer + description: Issued at (Unix) + example: 1745981111 + nbf: + type: integer + description: Not before (Unix) + example: 1745981111 + gty: + type: string + description: Grant type (e.g. authorization_code, refresh_token, password) + example: authorization_code + scp: + type: array + items: + type: string + description: Scopes + example: + - openid + - profile + aud: + type: array + items: + type: string + description: Audience + jti: + type: string + description: JWT ID + required: + - active + OAuthAuthorizationCodeFlow: + description: Authorization Code Flow + type: object + properties: + client_id: + type: string + example: 68106262-3938-4435-87ed-3e410b360209 + client_secret: + type: string + example: AQvsBHrjOYFNJdvndATLBPoavRZUp1fj4656 + code: + type: string + example: ab261e646022e92c620e2be8c10469d... + grant_type: + type: string + default: authorization_code + redirect_uri: + type: string + example: https://example.com/callback + response_type: + type: string + default: token + required: + - client_id + - client_secret + - grant_type + - redirect_uri + - code + OAuthAuthorizationCodePKCEFlow: + description: Authorization Code PKCE Flow + type: object + properties: + client_id: + type: string + example: 68106262-3938-4435-87ed-3e410b360209 + code: + type: string + example: ab261e646022e92c620e2be8c10469d... + code_verifier: + type: string + example: 3Cc3HvI2dyIGee-ZBqCtS5tlXXBFEuCByG06QLiEcAU + grant_type: + type: string + default: authorization_code + redirect_uri: + type: string + example: https://example.com/callback + response_type: + type: string + default: token + required: + - client_id + - grant_type + - redirect_uri + - code + - code_verifier + OAuthRefreshTokenFlow: + description: Refresh Token Flow + type: object + properties: + client_id: + type: string + example: 68106262-3938-4435-87ed-3e410b360209 + client_secret: + type: string + example: AQvsBHrjOYFNJdvndATLBPoavRZUp1fj4656 + grant_type: + type: string + default: refresh_token + response_type: + type: string + default: token + token: + type: string + example: 3976a9391e31d3c1cf854c83f9f65078:90f... + required: + - client_id + - client_secret + - grant_type + - token + OAuthPasswordCredentialFlow: + description: Password Credential Flow + type: object + properties: + client_id: + type: string + example: 68106262-3938-4435-87ed-3e410b360209 + client_secret: + type: string + example: AQvsBHrjOYFNJdvndATLBPoavRZUp1fj4656 + grant_type: + type: string + default: password + password: + type: string + example: pass@123 + response_type: + type: string + default: token + scope: + type: string + example: openid Email profile + username: + type: string + example: user@example.com + required: + - client_id + - client_secret + - grant_type + - username + - password + OAuthDeviceCodeFlow: + description: Device Code Flow + type: object + properties: + client_id: + type: string + example: 68106262-3938-4435-87ed-3e410b360209 + device_code: + type: string + example: device_code + grant_type: + type: string + default: urn:ietf:params:oauth:grant-type:device_code + response_type: + type: string + default: token + scope: + type: string + example: openid Email profile + required: + - client_id + - grant_type + - device_code + OAuthLoginRadiusTokenExchangeFlow: + description: LoginRadius Token Exchange Flow converts Loginradius GUID or JWT Encrypted token to OAuth Tokens + type: object + properties: + client_id: + type: string + example: 68106262-3938-4435-87ed-3e410b360209 + client_secret: + type: string + example: AQvsBHrjOYFNJdvndATLBPoavRZUp1fj4656 + grant_type: + type: string + default: http://loginradius.com/oauth/grant-type/exchange_token + response_type: + type: string + default: token + scope: + type: string + example: openid Email profile + token: + type: string + example: 68106262-3938-4435-87ed-3e410b360209 + required: + - client_id + - client_secret + - grant_type + - token + OAuthTokenResponse: + description: OAuth Token Response + type: object + properties: + access_token: + type: string + format: jwt + example: eyJhbGciOiJIUz... + expire_in: + type: string + example: '3600' + refresh_token: + type: string + example: 3976a9391e31d3c1cf854c83f9f65078:90f... + token_type: + type: string + default: Bearer + PARRequest: + type: object + properties: + client_id: + type: string + description: OAuth 2.0 client identifier. + client_secret: + type: string + description: Client secret. Optional when client credentials are provided via HTTP Basic Authentication in the Authorization header. + redirect_uri: + type: string + format: uri + description: Redirect URI registered for the client. + response_type: + type: string + description: 'Space-separated list of desired response types. Valid values: code, token, id_token.' + example: code + scope: + type: string + description: Space-separated list of requested scopes. Must include openid for OIDC flows. + example: openid profile email + state: + type: string + description: Opaque value to maintain state between the request and the callback. + nonce: + type: string + description: String associating a client session with an ID Token. Required when response_type includes id_token. + code_challenge: + type: string + description: PKCE code challenge derived from the code_verifier (RFC 7636). + code_challenge_method: + type: string + enum: + - plain + - S256 + description: PKCE code challenge transformation method. + response_mode: + type: string + enum: + - query + - fragment + - form_post + description: Mechanism for returning authorization response parameters to the client. + prompt: + type: string + enum: + - login + - none + description: Controls whether the authorization server prompts the user for re-authentication. + display: + type: string + enum: + - page + - popup + - touch + - wap + description: How the authorization server displays the authentication UI to the end-user. + max_age: + type: string + description: Maximum authentication age in seconds. Requires re-authentication if exceeded. + acr_values: + type: string + description: Space-separated list of requested Authentication Context Class Reference values. + login_hint: + type: string + description: Hint about the end-user login identifier (email or phone). + id_token_hint: + type: string + description: Previously issued ID Token passed as a hint about the authenticated end-user. + ui_locales: + type: string + description: Space-separated list of preferred UI display locales. + org_id: + type: string + description: B2B organization identifier. Only valid when B2B features are enabled on the app. + claims: + type: string + description: JSON-encoded claims request object specifying desired claims in the ID Token or userinfo response. + authorization_details: + type: string + description: JSON-encoded array of authorization detail objects per RFC 9396 (Rich Authorization Requests). Requires RAR to be enabled on the application. + resource: + type: string + description: Resource indicator (RFC 8707) identifying the target API. Must match a configured API resource on the authorization server. + required: + - client_id + - redirect_uri + - response_type + - scope + PARResponse: + type: object + properties: + request_uri: + type: string + description: Opaque URI identifying the pushed authorization request. Pass this as the request_uri parameter in a subsequent authorization request. Valid for expires_in seconds from issuance. + example: urn:ietf:params:oauth:request_uri:bwc4JfAkLMx3-oPIg_b2kD2U + expires_in: + type: integer + description: Lifetime of the request_uri in seconds. + example: 600 + required: + - request_uri + - expires_in + OAuthAuthorizationServerMetadata: + description: OAuth 2.0 Authorization Server Metadata (RFC 8414). Standard discovery document for OAuth 2.0 authorization servers; does not include OpenID Connect-specific fields (e.g. userinfo_endpoint, claims_supported). + type: object + required: + - issuer + - token_endpoint + - jwks_uri + - response_types_supported + - grant_types_supported + properties: + issuer: + type: string + description: The authorization server's issuer identifier (MUST match the requested issuer). + example: https://{TenantEndpoint}/service/oidc/{oidcAppName} + authorization_endpoint: + type: string + description: URL of the authorization endpoint. + example: https://{TenantEndpoint}/service/oidc/{oidcAppName}/authorize + token_endpoint: + type: string + description: URL of the token endpoint. + example: https://{TenantEndpoint}/api/oidc/{oidcAppName}/token + jwks_uri: + type: string + description: URL of the JSON Web Key Set document. + example: https://{TenantEndpoint}/service/oidc/{oidcAppName}/jwks + response_types_supported: + type: array + items: + type: string + description: List of OAuth 2.0 response_type values supported. + example: + - code + grant_types_supported: + type: array + items: + type: string + description: List of OAuth 2.0 grant type values supported. + example: + - authorization_code + - refresh_token + - urn:ietf:params:oauth:grant-type:device_code + token_endpoint_auth_methods_supported: + type: array + items: + type: string + description: List of client authentication methods supported at the token endpoint. + example: + - none + - client_secret_post + - client_secret_basic + registration_endpoint: + type: string + description: URL of the dynamic client registration endpoint (optional). + example: https://{TenantEndpoint}/api/oidc/{oidcAppName}/register + scopes_supported: + type: array + items: + type: string + description: List of OAuth 2.0 scope values supported. + example: + - openid + - email + - phone + - profile + - address + response_modes_supported: + type: array + items: + type: string + example: + - query + - form_post + - fragment + code_challenge_methods_supported: + type: array + items: + type: string + description: PKCE code challenge methods supported. + example: + - S256 + revocation_endpoint: + type: string + description: URL of the token revocation endpoint. + example: https://{TenantEndpoint}/api/oidc/{oidcAppName}/revoke + revocation_endpoint_auth_methods_supported: + type: array + items: + type: string + example: + - none + - client_secret_post + - client_secret_basic + device_authorization_endpoint: + type: string + description: URL of the device authorization endpoint. + example: https://{TenantEndpoint}/service/oidc/{oidcAppName}/device/authorize + token_endpoint_auth_signing_alg_values_supported: + type: array + items: + type: string + example: + - RS256 + subject_types_supported: + type: array + items: + type: string + description: List of subject identifier types supported. + example: + - public + ClientIdMetadataDocumentSupported: + type: boolean + description: Indicates if the client metadata document is supported. + example: true + OIDCDeviceCode: + description: OIDC Device Code Request + type: object + properties: + client_id: + type: string + example: 68106262-3938-4435-87ed-3e410b360209 + scope: + type: string + example: openid Email profile + required: + - client_id + OIDCDeviceCodeResponse: + description: OIDC Device Code Response + type: object + properties: + device_code: + type: string + example: device_code + expires_in: + type: integer + example: 1800 + interval: + type: integer + example: 5 + user_code: + type: string + example: user_code + verification_uri: + type: string + example: https://example.com/device/verification + verification_uri_complete: + type: string + example: https://example.com/device/verification?user_code=user_code + OIDCTokenResponse: + description: OIDC Token Response + type: object + properties: + access_token: + type: string + format: jwt + example: eyJhbGciOiJIUz... + expire_in: + type: string + example: '3600' + id_token: + type: string + format: jwt + example: id_token + refresh_token: + type: string + example: 3976a9391e31d3c1cf854c83f9f65078:90f... + token_type: + type: string + default: Bearer + DynamicClientRegistrationRequest: + type: object + description: Request for OIDC Dynamic Client Registration (RFC 7591). + properties: + redirect_uris: + type: array + description: Array of redirection URI strings. + items: + type: string + format: uri + client_name: + type: string + description: Human-readable name of the client. + client_uri: + type: string + description: URL of the home page of the client. + format: uri + logo_uri: + type: string + description: URL of the client logo. + format: uri + token_endpoint_auth_method: + type: string + description: Authentication method for the token endpoint. + grant_types: + type: array + description: Array of OAuth 2.0 grant types. + items: + type: string + response_types: + type: array + description: Array of OAuth 2.0 response types. + items: + type: string + DynamicClientRegistrationResponse: + type: object + description: Response from OIDC Dynamic Client Registration (RFC 7591). + properties: + client_id: + type: string + description: The registered client identifier. + client_secret: + type: string + description: The client secret (if applicable). + client_id_issued_at: + type: integer + description: Time at which the client ID was issued (Unix timestamp). + client_secret_expires_at: + type: integer + description: Time at which the client secret expires (0 means it does not expire). + redirect_uris: + type: array + items: + type: string + format: uri + client_name: + type: string + token_endpoint_auth_method: + type: string + grant_types: + type: array + items: + type: string + response_types: + type: array + items: + type: string + OAuthDynamicClientRequest: + type: object + required: + - client_name + - redirect_uris + properties: + client_name: + type: string + description: Human-readable name of the client. + example: My OIDC App + client_uri: + type: string + description: URL of the client's home page. + example: https://example.com + grant_types: + type: array + items: + type: string + description: OAuth 2.0 grant types the client will use. Defaults to ["authorization_code"]. + example: + - authorization_code + - refresh_token + response_types: + type: array + items: + type: string + description: OAuth 2.0 response types. Defaults to ["code"]. + example: + - code + redirect_uris: + type: array + items: + type: string + description: Redirect URIs for redirect-based flows. Required. + example: + - https://example.com/callback + post_logout_redirect_uris: + type: array + items: + type: string + description: Post-logout redirect URIs. + example: + - https://example.com/logout-callback + request_uris: + type: array + items: + type: string + description: Pre-registered request_uri values for JAR (JWT Authorization Request). + example: + - https://example.com/request.jwt + application_type: + type: string + enum: + - web + - native + description: Kind of application. Defaults to "web". + example: web + token_endpoint_auth_method: + type: string + enum: + - client_secret_basic + - client_secret_post + - private_key_jwt + - none + description: Client authentication method at the token endpoint. + example: client_secret_basic + scope: + type: string + description: Space-separated scopes the client may request. + example: openid profile email + logo_uri: + type: string + description: URL of the client's logo image. + example: https://example.com/logo.png + tos_uri: + type: string + description: URL of the client's Terms of Service. + example: https://example.com/tos + policy_uri: + type: string + description: URL of the client's Privacy Policy. + example: https://example.com/privacy + contacts: + type: array + items: + type: string + description: Contact email addresses for the client. + example: + - admin@example.com + software_id: + type: string + description: Unique identifier for the client software. + example: my-app-v2 + software_version: + type: string + description: Version of the client software. + example: 2.1.0 + jwks_uri: + type: string + description: URL of the client's JWKS document. Mutually exclusive with jwks. + example: https://example.com/.well-known/jwks.json + jwks: + type: object + description: Inline JSON Web Key Set. Mutually exclusive with jwks_uri. + example: + keys: + - kty: RSA + 'n': 0vx7... + e: AQAB + kid: '2011-04-29' + id_token_signed_response_alg: + type: string + description: JWS algorithm for signing ID tokens. Defaults to RS256. + example: RS256 + userinfo_signed_response_alg: + type: string + description: JWS algorithm for signing UserInfo responses. If set, UserInfo returns a signed JWT. + example: RS256 + backchannel_logout_uri: + type: string + description: URL to which the OP sends logout tokens (OIDC Back-Channel Logout). + example: https://example.com/backchannel-logout + backchannel_logout_session_required: + type: boolean + description: Whether the OP must include a sid claim in logout tokens. + example: true + OAuthDynamicClientResponseCore: + type: object + properties: + client_id: + type: string + description: Unique client identifier issued by the authorization server. + example: abc123def456 + client_secret: + type: string + description: Client secret. Only returned for confidential clients. + example: s3cr3t-value + client_id_issued_at: + type: integer + format: int64 + description: Unix timestamp when the client_id was issued. + example: 1710000000 + client_secret_expires_at: + type: integer + format: int64 + description: Unix timestamp when the client_secret expires. 0 means it does not expire. + example: 0 + registration_access_token: + type: string + description: Bearer token to access the client configuration endpoint. Only returned on initial registration. + example: reg-access-token-value + registration_client_uri: + type: string + description: URL of the client configuration endpoint for this client. + example: https://example.hub.loginradius.com/oidc/myapp/register/abc123def456 + OAuthDynamicClientResponse: + allOf: + - $ref: '#/components/schemas/OAuthDynamicClientRequest' + - $ref: '#/components/schemas/OAuthDynamicClientResponseCore' + OAuthM2MTokenIntrospect: + description: M2M Token Introspect Request + type: object + properties: + client_id: + type: string + example: 68106262-3938-4435-87ed-3e410b360209 + client_secret: + type: string + example: AQvsBHrjOYFNJdvndATLBPoavRZUp1fj4656 + token: + type: string + example: 3976a9391e31d3c1cf854c83f9f65078:90f... + token_type_hint: + type: string + example: access_token + default: access_token + required: + - client_id + - client_secret + - token + - token_type_hint + OAuthM2MIntrospectResponse: + description: M2M Token Introspect Response + type: object + properties: + active: + type: boolean + example: true + aud: + type: array + items: + type: string + example: + - https://{TenantEndpoint}/identity/v2/manage + cid: + type: string + example: ddff8a63-cbc3-4723-8415-b910c4d8770d + exp: + type: integer + example: 1745988311 + gty: + type: string + example: client_credentials + iat: + type: integer + example: 1745981111 + iss: + type: string + example: https://{TenantEndpoint}/ + jti: + type: string + example: e20a1ae9-880a-4829-88ff-690141d958b5 + nbf: + type: integer + example: 1745981111 + scp: + type: array + items: + type: string + example: + - all + sub: + type: string + example: 699f40ae-8040-42fe-a1cd-e1eb10cf73ef@client + JWKSResponse: + description: JWKS Config Response + type: object + properties: + keys: + type: array + items: + properties: + alg: + type: string + example: RS256 + e: + type: string + example: AQAB + kid: + type: string + example: 31524f1ce57e45fd967d7431e18b97c6 + kty: + type: string + example: RSA + 'n': + type: string + example: 0u2t0m8XWLAOTYWR4vtT... + use: + type: string + example: sig + type: object + OAuthM2MTokenRevoke: + description: M2M Token Service Request + type: object + properties: + client_id: + type: string + example: 68106262-3938-4435-87ed-3e410b360209 + client_secret: + type: string + example: AQvsBHrjOYFNJdvndATLBPoavRZUp1fj4656 + token: + type: string + example: 3976a9391e31d3c1cf854c83f9f65078:90f... + token_type_hint: + type: string + example: access_token + default: access_token + required: + - client_id + - client_secret + - token + - token_type_hint + OAuthM2MTokenGenerate: + description: M2M Token Generate Request + type: object + properties: + audience: + type: string + example: https://api.loginradius.com/identity/v2/manage + client_id: + type: string + example: 68106262-3938-4435-87ed-3e410b360209 + client_secret: + type: string + example: AQvsBHrjOYFNJdvndATLBPoavRZUp1fj4656 + grant_type: + type: string + example: client_credentials + default: client_credentials + required: + - client_id + - client_secret + - grant_type + - audience + OAuthM2MTokenResponse: + description: M2M Token Response + type: object + properties: + access_token: + type: string + format: jwt + example: eyJhbGciOiJIUz... + expire_in: + type: string + example: '3600' + token_type: + type: string + default: Bearer + OIDCDiscoveryResponse: + description: OIDC Discovery Config Response + type: object + properties: + acr_values_supported: + type: array + items: + type: string + example: + - loginradius:nist:level:1:re-auth + authorization_endpoint: + type: string + example: https://{TenantEndpoint}/service/oidc/{oidcAppName}/authorize + backchannel_logout_session_supported: + type: boolean + example: true + backchannel_logout_supported: + type: boolean + example: true + claims_supported: + type: array + items: + type: string + example: + - picture + - zoneinfo + - locale + - email + - phone_number + - middle_name + - nickname + - profile + - auth_time + - phone_number_verified + - address + - website + - birthdate + - updated_at + - acr + - email_verified + - name + - given_name + - preferred_username + - gender + - family_name + code_challenge_methods_supported: + type: array + items: + type: string + example: + - S256 + end_session_endpoint: + type: string + example: https://{TenantEndpoint}/service/oidc/{oidcAppName}/logout + grant_types_supported: + type: array + items: + type: string + example: + - authorization_code + - implicit + - refresh_token + - password + - urn:ietf:params:oauth:grant-type:device_code + id_token_signing_alg_values_supported: + type: array + items: + type: string + example: + - RS256 + issuer: + type: string + example: https://{TenantEndpoint}/service/oidc/{oidcAppName} + jwks_uri: + type: string + example: https://{TenantEndpoint}/service/oidc/{oidcAppName}/jwks + request_parameter_supported: + type: boolean + example: false + response_modes_supported: + type: array + items: + type: string + example: + - query + - form_post + - fragment + response_types_supported: + type: array + items: + type: string + example: + - code + - token + - id_token + - code token + - code id_token + - token id_token + - code token id_token + revocation_endpoint: + type: string + example: https://{TenantEndpoint}/api/oidc/{oidcAppName}/revoke + introspection_endpoint: + type: string + description: OAuth 2.0 Token Introspection endpoint (RFC 7662) + example: https://{TenantEndpoint}/api/oidc/{oidcAppName}/introspect + revocation_endpoint_auth_methods_supported: + type: array + items: + type: string + example: + - client_secret_post + - client_secret_basic + scopes_supported: + type: array + items: + type: string + example: + - openid + - email + - phone + - profile + - address + subject_types_supported: + type: array + items: + type: string + example: + - public + token_endpoint: + type: string + example: https://{TenantEndpoint}/api/oidc/{oidcAppName}/token + token_endpoint_auth_methods_supported: + type: array + items: + type: string + example: + - client_secret_post + - client_secret_basic + userinfo_endpoint: + type: string + example: https://{TenantEndpoint}/service/oidc/{oidcAppName}/userinfo + OIDCUserinfoResponse: + description: OIDC UserInfo Response + type: object + additionalProperties: true + example: + birthdate: 10-12-1985 + email: user@example.com + email_verified: true + family_name: Garcia + gender: F + given_name: Ava + middle_name: Marie + nickname: Ava + preferred_username: avagarcia + sub: fddf331f038a409c96bfb1733e6d0c63 + updated_at: 1747206183 + website: https://www.avagarcia.com + OIDCUserinfoJWTResponse: + description: OIDC UserInfo JWT Response when SignedUserInfo is true + type: string + format: jwt + example: eyJhbGciOiJSUzI1NiIsImtpZCI6IjMxNTI0ZjFjZTU3ZTQ1ZmQ5NjdkNzQzMWUxOGI5N2M2IiwidHlwIjoiSldUIn0.eyJhdWQiOiIzMTVhMjA3MC05NjM5LTRlMTktOTk1Ni1kMTFmYjZlNmIwOTAiLCJleHAiOjE3NDcyMTk3ODUsImlhdCI6MTc0NzIxODg4NSwiaXNzIjoiaHR0cHM6Ly9hdXRoLmV4YW1wbGUuY29tL3NlcnZpY2Uvb2lkYy9vaWRjLWFwcCIsImp0aSI6IjljMmE2YzcxLTg0NmQtNDliNS05NzNlLWMwYjlkNDY1ZmFmMiIsIm5iZiI6MTc0NzIxODg4NSwic3ViIjoiNjEyMDFmYzI4ODYyNDcwYTljN2I3MTJkMDE2NjkwNjUifQ.dusZxEqtDzpRO3bsd4V51RPJj3GvXu0_BDsOrVUl2WJQuNxfE49xDiZ7YZOtDhQhBGDCWBffdqSm9JcF0CfC4kCpF4S9qE21JiPGGjJCMMu7zFdCR7hcYdWKUZ_n0eaAO5MltTWDOD7te_Gb-EUZm1mJ7w4hQbApt-JodIglU5C3ydq6WydX_hrYpOy-lPqYBpP2r69FqKwKJRwoOt7jmNmUdFNjgdBal_OE9JimFX1hd603rbAoTW_VhEKmapF5iKhQpiqAqerh9QI3UEzpuIqiW9ewgVKL1Y_tEdI11I2BDU1jgNGaU3bBT58lYrMw1f6GQcliPhHX_NleyGJwHA + OIDCUserinfo: + description: OIDC Userinfo request + type: object + properties: + access_token: + type: string + format: jwt + example: eyJhbGciOiJIUz... + required: + - access_token + SamlIdpMetadataResponse: + description: Saml IdP Metadata Response + type: object + properties: + DSNS: + type: string + example: http://www.w3.org/2000/09/xmldsig# + xml: + attribute: true + name: xmlns:ds + EntityId: + type: string + example: https://auth.example.com/ + xml: + attribute: true + name: entityID + IDPSSODescriptor: + type: object + properties: + ProtocolSupportEnumeration: + type: string + example: urn:oasis:names:tc:SAML:2.0:protocol + xml: + attribute: true + name: protocolSupportEnumeration + SigningKeyDescriptor: + type: object + properties: + KeyInfo: + type: object + properties: + X509Data: + type: object + properties: + X509Certificate: + type: object + properties: + Cert: + type: string + example: MIID... + xml: + prefix: ds + xml: + prefix: ds + xml: + name: KeyInfo + prefix: ds + Use: + type: string + example: signing + xml: + attribute: true + name: use + xml: + name: KeyDescriptor + SingleLogoutService: + type: array + items: + properties: + Binding: + type: string + example: urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST + xml: + attribute: true + name: Binding + Location: + type: string + example: https://auth.example.com.com//service/saml/idp/logout?appName=example_saml_app + xml: + attribute: true + name: Location + type: object + xml: + name: SingleLogoutService + xml: + name: SingleLogoutService + SingleSignOnService: + type: array + items: + properties: + Binding: + type: string + example: urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST + xml: + attribute: true + name: Binding + Location: + type: string + example: https://auth.example.com.com/service/saml/idp/login?appName=example_saml_app + xml: + attribute: true + name: Location + type: object + xml: + name: SingleSignOnService + xml: + name: SingleSignOnService + WantAuthnRequestsSigned: + type: string + example: 'false' + xml: + attribute: true + name: WantAuthnRequestsSigned + xml: + name: IDPSSODescriptor + XMLNS: + type: string + example: urn:oasis:names:tc:SAML:2.0:metadata + xml: + attribute: true + name: xmlns + xml: + name: EntityDescriptor + QRCodeResponse: + description: QR Code Response + type: object + properties: + code: + type: string + example: ZGQzMjFhOGEtMjk0ZC00YmZmLThiYTItMTY4ODQ1MmQ1NmVmIzIwMjUtMDQtMjlUMDU6MDY6NDIuNTI2Wg== + AccessTokenByPingQRCodeResponse: + description: Access Token By Ping QR Code Response + type: object + properties: + access_token: + type: string + example: 68106262-3938-4435-87ed-3e410b360209 + nullable: true + QRCodeMapToToken: + description: QR Code Map to Access Token Request + type: object + properties: + access_token: + type: string + example: 68106262-3938-4435-87ed-3e410b360209 + code: + type: string + example: MzUwOTczMDAtODM0MC00Y2FkLWE3MDgtNmY2ZDRiMDA4NjZlIzIwMjEtMTItMjlUMTc6NDk6MjIuNDY0Wg== + QRCodeMapToTokenResponse: + description: QR Code Map to Access Token Response + type: object + properties: + isPosted: + type: boolean + PasswordEncryptionModel: + type: object + properties: + IsPerPasswordSalt: + type: boolean + default: false + description: Whether to generate a unique salt for each password + example: true + NumberOfIteration: + type: integer + minimum: 0 + nullable: true + description: Number of hashing iterations to apply. + example: 100000 + PasswordHasherVersion: + type: string + default: V1 + description: Version identifier for the Password hashing algorithm. + example: V1 + enum: + - V1 + - V2 + - V3 + - V4 + - V5 + SubKeyLength: + type: integer + minimum: 0 + nullable: true + description: Length of the derived key (in bytes). + example: 32 + SaltKeyLength: + type: integer + minimum: 0 + nullable: true + description: Length of the salt key (in bytes). + example: 16 + Salt: + type: string + nullable: true + description: Global salt value (used when IsPerPasswordSalt is false) + example: c2FsdFZhbHVlMTIz + Type: + type: string + description: The encryption or hashing algorithm used. + example: PBKDF2 + enum: + - MD5 + - BCRYPT + - PBKDF2 + - SHA1 + - SHA256 + - SHA512 + - HMAC_SHA1 + - HMAC_SHA256 + - ARGON2ID + - ARGON2I + SaltAttachType: + type: string + description: How to attach salt to password + example: Prepend + enum: + - None + - Prepend + - Append + PasswordHashEncodingType: + type: string + nullable: true + description: Encoding type for the Password hash output + example: Base64 + enum: + - Default + - Base64 + - HexaDecimal + - UTF8 + - BitConverter + PasswordSaltEncodingType: + type: string + nullable: true + description: Encoding type for the salt + example: Base64 + enum: + - Default + - Base64 + - HexaDecimal + - UTF8 + - BitConverter + PlaintextPasswordEncoding: + type: string + nullable: true + description: Encoding type for the plaintext Password before hashing. + example: Default + enum: + - Default + - Base64 + - UTF8 + PasswordHashThread: + type: integer + nullable: true + minimum: 0 + maximum: 128 + description: Number of threads for Argon2 algorithms + example: 2 + PasswordHashMemory: + type: integer + nullable: true + minimum: 0 + maximum: 8192 + description: Memory usage (in KB) for Argon2 algorithms + example: 64 + required: + - Type + DeltaMigrationModel: + type: object + properties: + DeltaMigration: + type: boolean + description: Indicates if delta migration is enabled. + example: true + OverWriteDuplicate: + type: boolean + description: If true, existing records will be overwritten when duplicates are found. + example: false + required: + - DeltaMigration + - OverWriteDuplicate + BatchUpload: + type: object + properties: + PasswordEncryption: + $ref: '#/components/schemas/PasswordEncryptionModel' + Profiles: + type: array + items: + $ref: '#/components/schemas/ProfileRequestModel' + description: A list of User profile objects to be uploaded in batch. + DeltaMigrationModel: + $ref: '#/components/schemas/DeltaMigrationModel' + required: + - Profiles + BulkInsertErrorReport: + type: object + properties: + RecordNumber: + type: integer + format: int32 + description: Row no of the record that failed. + example: 3 + Message: + type: string + description: Description of the error encountered during insert or update. + example: Email address already exists + required: + - RecordNumber + - Message + BulkInsertReport: + type: object + properties: + RecordInserted: + type: integer + format: int64 + description: Number of records successfully inserted. + example: 150 + RecordUpdated: + type: integer + format: int64 + description: Number of records successfully updated. + example: 50 + Failed: + type: array + description: List of records that failed to insert or update. + items: + $ref: '#/components/schemas/BulkInsertErrorReport' + required: + - RecordInserted + - RecordUpdated + BatchUploadResponse: + type: object + properties: + Profile: + $ref: '#/components/schemas/BulkInsertReport' + Roles: + $ref: '#/components/schemas/BulkInsertReport' + required: + - Profile + BatchUploadErrorResponse: + type: object + required: + - ErrorCode + - Message + - Description + properties: + ErrorCode: + type: integer + format: int32 + description: Error code for identifying the error type. + example: 908 + Message: + type: string + description: Brief message describing the error. + example: A parameter is not formatted correctly + Description: + type: string + description: Detailed description of the error. + example: A parameter is not formatted correctly in the request, please check all the parameters in the API call. + Errors: + type: array + description: List of individual field errors. + items: + type: object + properties: + FieldName: + type: string + description: Identifier for the record that caused the error. + example: Record 1 + ErrorMessage: + type: string + description: Description of the specific error related to the field. + example: Email address is already registered with your LoginRadius site + required: + - FieldName + - ErrorMessage + ConsentOptions: + type: object + properties: + ConsentId: + type: string + description: Unique identifier for the consent option. + example: d290f1ee6c544b90e6d701748f0851 + Title: + type: string + description: Title of the consent option. + example: SMS Consent + Description: + type: string + description: Description of the consent option. + example: Consent to receive SMS notifications + CreatedOn: + type: string + format: date-time + description: Creation date of the consent option. + example: '2023-01-01T00:00:00Z' + nullable: true + IsActive: + type: boolean + description: Indicates if the consent option is currently active. + example: true + ConsentOptionModel: + type: object + properties: + Title: + type: string + description: Title of the consent option. + example: SMS Consent + maxLength: 150 + Description: + type: string + description: Description of the consent option. + example: Consent to receive SMS notifications + maxLength: 1000 + ConsentFormEvent: + type: object + properties: + IsCustom: + type: boolean + description: Indicates if the event is custom. + example: true + Name: + type: string + description: Name of the event. + example: Register + ConsentFormOption: + type: object + properties: + IsRequired: + type: boolean + description: Indicates if this consent option is required. + example: true + ConsentOptionId: + type: string + description: Unique identifier for the consent option. + example: 123e4567e89b12d3a456426614174000 + IsActive: + type: boolean + description: Indicates if the consent option is active. + example: true + ConsentForm: + type: object + properties: + IsActive: + type: boolean + description: Indicates if the consent form is active. + example: true + Version: + type: integer + format: int32 + description: Version number of the consent form. + example: 1 + Events: + type: array + items: + $ref: '#/components/schemas/ConsentFormEvent' + description: List of events associated with the consent form. + StartFromDate: + type: string + format: date-time + nullable: true + description: Start date of the consent form. + example: '2023-01-01T00:00:00Z' + CreatedOnDate: + type: string + format: date-time + nullable: true + description: Creation date of the consent form. + example: '2023-01-01T00:00:00Z' + ConsentOptions: + type: array + items: + $ref: '#/components/schemas/ConsentFormOption' + description: List of consent options in the form. + TermOfService: + type: string + description: Terms of service text. + example: I agree to the terms of service. + PrivacyPolicy: + type: string + description: Privacy Policy text. + example: I agree to the Privacy Policy. + IsWorkflowForm: + type: boolean + description: Indicates if this is a workflow form. + example: true + ConsentFormOptions: + type: object + properties: + IsRequired: + type: boolean + description: Indicates if this consent option is required. + example: true + ConsentOptionId: + type: string + description: Unique identifier for the consent option. + example: 123e4567e89b12d3a456426614174000 + ConsentFormModel: + type: object + properties: + Events: + type: array + items: + type: string + description: List of events associated with the consent form. + example: + - Register + - Login + StartFromDate: + type: string + format: date-time + nullable: true + description: Start date of the consent form. + example: '2023-01-01T00:00:00Z' + ConsentOptions: + type: array + items: + $ref: '#/components/schemas/ConsentFormOptions' + description: List of consent options in the form. + TermOfService: + type: string + description: Terms of service text. + example: I agree to the terms of service. + PrivacyPolicy: + type: string + description: Privacy Policy text. + example: I agree to the Privacy Policy. + IsWorkflowForm: + type: boolean + description: Indicates if this is a workflow form. + example: true + BigCommerceLoginUrlResponse: + type: object + properties: + loginUrl: + type: string + description: BigCommerce login URL for the customer. + example: https://store-abc123.mybigcommerce.com/login/token/eyJhbGciOiJIUzI1NiJ9 + BigCommerceTokenPostRequest: + type: object + required: + - access_token + properties: + access_token: + type: string + description: LoginRadius access token of the authenticated user. + example: 1234567890abcdef1234567890abcdef + password: + type: string + description: Optional password for BigCommerce customer creation. + return_url: + type: string + description: URL to redirect the user to after login. + example: https://example.com/dashboard + BigCommerceValidatePasswordRequest: + type: object + required: + - emailid + - password + properties: + emailid: + type: string + description: Email address of the BigCommerce customer. + example: user@example.com + password: + type: string + description: Password to validate for the BigCommerce customer. + example: MyPassword123 + BigCommerceValidatePasswordResponse: + type: object + properties: + verified: + type: boolean + description: Whether the password is valid for the BigCommerce customer. + example: true + ShopifyLoginUrlResponse: + type: object + properties: + url: + type: string + description: Shopify Multipass login URL for the customer. + example: https://mystore.myshopify.com/account/login/multipass/v1/eyJhbGciOiJIUzI1NiJ9 + PerfectMindSessionResponse: + type: object + properties: + SessionId: + type: string + description: PerfectMind session identifier. + example: abc123-def456-ghi789 + URL: + type: string + description: PerfectMind login URL with the session. + example: https://mysite.perfectmind.com/session/abc123 + IsNewLink: + type: boolean + description: Whether a new session link was generated. + example: true + PerfectMindContactResponse: + type: object + properties: + Email: + type: string + description: Email address associated with the PerfectMind contact. + example: user@example.com + ContactId: + type: array + items: + type: string + description: List of PerfectMind contact IDs matching the email. + example: + - '12345' + - '67890' + examples: + ResetPasswordByEmailAndOTP: + summary: Reset using OTP and Email (QQ Captcha) + value: + otp: '123456' + email: user@example.com + Password: new_secure_password + welcomeemailtemplate: welcome_template + ResetPasswordEmailTemplate: reset_password_template + SecurityAnswer: + 9d1f4208bda845d885eab43266d6543f: Buddy + qq_captcha_ticket: qq-ticket-abc + qq_captcha_randstr: qq-randstr-xyz + ResetPasswordByUsernameAndOTP: + summary: Reset using OTP and Username (hCaptcha) + value: + otp: '654321' + username: user123 + Password: new_secure_password + welcomeemailtemplate: welcome_template + ResetPasswordEmailTemplate: reset_password_template + SecurityAnswer: + 9d1f4208bda845d885eab43266d6543f: Delhi + h-captcha-response: hcaptcha-token-999 + ResetPasswordByResetToken: + summary: Reset using ResetToken (Google Recaptcha) + value: + ResetToken: xxxxxxxxxxxxxxxxxxxx + Password: new_secure_password + welcomeemailtemplate: welcome_template + ResetPasswordEmailTemplate: reset_password_template + SecurityAnswer: + 9d1f4208bda845d885eab43266d6543f: Fluffy + 9d1f4208bda845d885eab43266d65500: Blue + g-recaptcha-response: google-captcha-token-123 + API_KEY_REQUIRED: + summary: API_KEY_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The apikey is a required parameter. + API_KEY_NOT_WELL_FORMATTED: + summary: API_KEY_NOT_WELL_FORMATTED + value: + ErrorCode: 920 + Message: API key is invalid + Description: The provided LoginRadius API key is invalid, please use a valid API key of your LoginRadius account. + DANGEROUS_REQUEST: + summary: DANGEROUS_REQUEST + value: + ErrorCode: 1214 + Message: Dangerous request + Description: A potentially dangerous request value was detected. + CONTENT_TYPE_INVALID: + summary: CONTENT_TYPE_INVALID + value: + ErrorCode: 1083 + Message: This content type header is not supported + Description: Please use a valid content type header as application/json. + JSON_PUT_BODY_REQUIRED: + summary: JSON_PUT_BODY_REQUIRED + value: + ErrorCode: 1079 + Message: Put body is invalid or empty + Description: Please use a valid put body in JSON format in order to process this request. + API_KEY_AND_RESET_TOKEN_REQUIRED: + summary: API_KEY_AND_RESET_TOKEN_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The apikey is a required parameter,The resettoken is a required parameter. + API_KEY_AND_PASSWORD_REQUIRED: + summary: API_KEY_AND_PASSWORD_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The apikey is a required parameter,The password is a required parameter. + PASSWORD_AND_RESET_TOKEN_REQUIRED: + summary: PASSWORD_AND_RESET_TOKEN_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The password is a required parameter,The resettoken is a required parameter. + RESET_TOKEN_REQUIRED: + summary: RESET_TOKEN_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The resettoken is a required parameter. + PASSWORD_REQUIRED: + summary: PASSWORD_REQUIRED + value: + Message: Password is required + ErrorCode: 908 + Description: The password is required in order to process this request. + SERVER_SIDE_VALIDATION_ERROR: + summary: SERVER_SIDE_VALIDATION_ERROR + value: + ErrorCode: 1134 + Message: Validation failed for one or more fields + Description: Validation failed for one or more fields. Please check the errors field for more information. + USERNAME_REQUIRED_PARAM: + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The username is a required parameter. Please provide a valid username to process the request. + OTP_REQUIRED: + summary: OTP_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The OTP is a required parameter. + EMAILID_ID_FORMAT_NOT_VALID: + summary: EMAILID_ID_FORMAT_NOT_VALID + value: + ErrorCode: 1038 + Message: Valid email ID is required + Description: The provided email ID is invalid or not well-formatted, a valid email ID is required in order to process this request. + EMAIL_PHONE_USERNAME_PAYLOAD_REQUIRED: + summary: EMAIL_PHONE_USERNAME_PAYLOAD_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The email/username/phone is a required parameter. + EMAIL_REQUIRED: + summary: EMAIL_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The email is a required parameter. + GENERIC_AUTH_ERROR: + summary: GENERIC_AUTH_ERROR + value: + errorCode: 1409 + message: Authentication failed + description: The credentials provided could not be authenticated. + API_KEY_NOT_VALID: + summary: API_KEY_NOT_VALID + value: + ErrorCode: 901 + Message: The API key is unauthorized + Description: The provided LoginRadius API key is invalid or is not authorized, please use a valid or authorized LoginRadius API key or check the API key for your LoginRadius account. + TRIAL_PLAN_EXPIRED: + summary: TRIAL_PLAN_EXPIRED + value: + ErrorCode: 6003 + Message: Trial plan expired + Description: The trial plan has expired. To continue using the service, please contact support. + RAAS_PROFILE_NOT_EXISTS: + summary: RAAS_PROFILE_NOT_EXISTS + value: + ErrorCode: 1039 + Message: An email profile is not created or does not exist + Description: An email profile is not created on this Account ID, please use a valid Account ID or create an email profile before processing this request. + USER_ID_BLOCKED: + summary: USER_ID_BLOCKED + value: + ErrorCode: 991 + Message: User ID is blocked + Description: The user ID is blocked, please use a valid user ID in order to process this request. + USER_ID_LOCKED_WITH_TIMEOUT: + summary: USER_ID_LOCKED_WITH_TIMEOUT + value: + Data: + LoginLockedTimeout: '2025-07-11T21:40:44.875Z' + Description: Your account has been locked, please try again after sometime. + ErrorCode: 1198 + Message: Your account has been locked + LOGIN_IS_LOCKED_FOR_RECAPTCHA: + summary: LOGIN_IS_LOCKED_FOR_RECAPTCHA + value: + ErrorCode: 1132 + Message: Your account has been locked + Description: Your account has been locked, please login with a valid reCAPTCHA in order to continue. + USER_ID_LOCKED: + summary: USER_ID_LOCKED + value: + ErrorCode: 1198 + Message: Your account has been locked + Description: Your account has been locked, please try again after sometime. + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + summary: LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION + value: + ErrorCode: 1148 + Message: Your account has been locked + Description: Your account has been locked, please login with an answer to the security question in order to continue. + SECURITY_QUESTION_NOT_VALID: + summary: SECURITY_QUESTION_NOT_VALID + value: + ErrorCode: 1091 + Message: Security question is invalid + Description: This security question is invalid, please use a correct or valid security question. + SECURITY_QUESTION_OR_ANSWER_INVALID: + summary: SECURITY_QUESTION_OR_ANSWER_INVALID + value: + ErrorCode: 1094 + Message: Your security answer or question is incorrect. + Description: Your security question or answer is incorrect, please enter the correct security question or answer. + SECURITY_ANSWER_INVALID: + summary: SECURITY_ANSWER_INVALID + value: + ErrorCode: 1093 + Message: Security answer is invalid + Description: The security answer is invalid, please use a valid security answer in order to process this request. + VERIFICATION_OTP_NOT_VALID: + summary: VERIFICATION_OTP_NOT_VALID + value: + ErrorCode: 1185 + Message: Verification OTP is invalid + Description: The LoginRadius verification OTP is invalid, please use a valid verification OTP in order to process this request. + VERIFICATION_VTOKEN_NOT_VALID: + summary: VERIFICATION_VTOKEN_NOT_VALID + value: + ErrorCode: 1063 + Message: Verification token (vtoken) is invalid + Description: The LoginRadius verification token is invalid, please use a valid verification token in order to process this request. + LINK_EXPIRED: + summary: LINK_EXPIRED + value: + ErrorCode: 975 + Message: Your verification link or otp has expired + Description: This verification link or otp has expired, please request for new verification link or otp. + LINK_ALREADY_VERIFIED: + summary: LINK_ALREADY_VERIFIED + value: + ErrorCode: 974 + Message: The email verification link has already been used + Description: Each link can only be used once, you can log in now if you have already verified the email, OR use the ‘forgot password’ option. + USER_NOT_EXISTS: + summary: USER_NOT_EXISTS + value: + ErrorCode: 938 + Message: User does not exist + Description: The user does not exist, please use a valid user in order to process this request. + WEAK_PASSWORD: + value: + ErrorCode: 1216 + Message: Weak password + Description: A potential password vulnerability was detected. + PASSWORD_IN_HISTORY: + summary: PASSWORD_IN_HISTORY + value: + ErrorCode: 1015 + Message: The new password is invalid + Description: Your new password is too similar to your old passwords, please try a different password. + BREACHED_PASSWORD: + summary: BREACHED_PASSWORD + value: + ErrorCode: 1315 + Message: The password you’re trying to set is exposed in an external data breach. + Description: The specific password you’re setting is found in a data breach unrelated to this app/service. Please set a different password. + ACTIVE_SESSIONS_EXCEEDED: + summary: ACTIVE_SESSIONS_EXCEEDED + value: + ErrorCode: 1338 + Message: Exceeded active login session limit + Description: You have exceeded the maximum number of allowed active login sessions. Please log out of any other active session before attempting to log in again. If you need further assistance, contact support. + PRIVACY_POLICY_MISMATCHED: + summary: PRIVACY_POLICY_MISMATCHED + value: + Data: + access_token: 6******2-3**8-4**5-8**d-3**********9 + expires_in: 300 + refresh_token: 6******2-3**8-4**5-8**d-3**********9 + Description: You have not accepted the current Privacy Policy. + ErrorCode: 1194 + Message: Privacy Policy does not match + POST_BODY_INVALID: + summary: POST_BODY_INVALID + value: + ErrorCode: 965 + Message: The post body is invalid + Description: Please use a valid post body and make sure that it is in a valid JSON format. + USERNAME_REQUIRED: + summary: USERNAME_REQUIRED + value: + ErrorCode: 1075 + Message: Username is required + Description: The username is required in order to process this request. + EMAIL_ID_OR_USER_REQUIRED: + summary: EMAIL_ID_OR_USER_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The email/username is a required parameter. + CAPTCHA_NOT_VALID: + summary: CAPTCHA_NOT_VALID + value: + errorcode: 982 + message: Captcha is not valid + description: The captcha is not valid, please use a valid captcha in order to process this request. + RESET_PASSWORD_URL_INVALID: + summary: RESET_PASSWORD_URL_INVALID + value: + ErrorCode: 1252 + Message: Reset password URL is invalid + Description: The reset password URL is invalid, please use a valid reset password URL in order to process this request. + EMAIL_SEND_LIMIT_REACHED: + value: + Description: The account limit for email requests for this resource has been reached for this time due to too many request. + ErrorCode: 1122 + Message: You have reached a limit for sending emails + ACCESS_TOKEN_REQUIRED: + summary: ACCESS_TOKEN_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The access_token is a required parameter. + OAUTH_TOKEN_CONFIG_NOT_FOUND: + summary: OAUTH_TOKEN_CONFIG_NOT_FOUND + value: + Description: Unable to retrieve token configuration for the specified app. + ErrorCode: 2017 + Message: Request is invalid + OLD_PASSWORD_REQUIRED: + summary: OLD_PASSWORD_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The oldpassword is a required parameter. + NEW_PASSWORD_REQUIRED: + summary: NEW_PASSWORD_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The newpassword is a required parameter. + INVALID_PASSWORD: + summary: INVALID_PASSWORD + value: + ErrorCode: 967 + Message: Current password is invalid + Description: Your current password is invalid, please use the correct password. + ACCESS_TOKEN_NOT_VALID: + summary: ACCESS_TOKEN_NOT_VALID + value: + ErrorCode: 905 + Message: Access token is invalid + Description: The LoginRadius access token is invalid, please use the correct or valid access token in order to process this request. + ACCESS_TOKEN_EXPIRED: + summary: ACCESS_TOKEN_EXPIRED + value: + ErrorCode: 906 + Message: Access token has expired + Description: The LoginRadius access token has expired, please request a new token from LoginRadius API. + PHONE_REQUIRED: + summary: PHONE_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The Phone is a required parameter. + INVALID_PHONE_NUMBER: + summary: INVALID_PHONE_NUMBER + value: + ErrorCode: 1096 + Message: Invalid phone number. + Description: The provided phone number is not valid or not well-formatted, please review the phone number in order to process this request. + PHONE_NO_LOGIN_NOT_ENABLED: + summary: PHONE_NO_LOGIN_NOT_ENABLED + value: + ErrorCode: 1074 + Message: Phone number login is not enabled + Description: The phone number login is not enabled, please enable the phone number login in order to process this request. + OTP_NOT_EXISTS: + summary: OTP_NOT_EXISTS + value: + ErrorCode: 1067 + Message: Invalid OTP Code + Description: The OTP code is invalid, please request for a new OTP. + OTP_INVALID: + summary: OTP_INVALID + value: + ErrorCode: 1070 + Message: The OTP cannot be accessed + Description: This OTP is either expired or has already been used, please request for a new OTP. + OTP_ALREADY_USED: + summary: OTP_ALREADY_USED + value: + ErrorCode: 1068 + Message: The OTP has already been used + Description: Each OTP can only be used once, you can now login if you have already verified the phone number. + OTP_EXPIRED: + summary: OTP_EXPIRED + value: + ErrorCode: 1069 + Message: Verification OTP has expired + Description: This verification OTP has expired, please use ‘resend OTP’ option to verify your phone number. + SMS_CONFIGURATION_NOT_EXISTS: + summary: SMS_CONFIGURATION_NOT_EXISTS + value: + ErrorCode: 1071 + Message: SMS configuration does not exist + Description: The SMS configuration does not exist, please use a valid SMS configuration in order to process this request. + SMS_SEND_LIMIT_REACHED: + summary: SMS_SEND_LIMIT_REACHED + value: + ErrorCode: 1123 + Message: You have reached a limit for sending SMS + Description: The account limit for SMS requests for this resource has been reached for this time due to too many request. + OTP_SEND_FAILED: + summary: OTP_SEND_FAILED + value: + Description: The Verification OTP Code sending failed, please try again. + ErrorCode: 1072 + Message: The Verification code (OTP) send failed + OPERATION_FAILED: + summary: OPERATION_FAILED + value: + ErrorCode: 950 + Message: Operation failed due to an unknown error + Description: An unknown error has occurred, please try again in a few minutes or contact your system admin. + VOICE_SMS_CONFIGURATION_NOT_ENABLED: + summary: VOICE_SMS_CONFIGURATION_NOT_ENABLED + value: + ErrorCode: 1281 + Message: Voice OTP has not been configured + Description: The Voice OTP has not been configured, please configure it. + OTP_LIMIT_REACHED: + summary: OTP_LIMIT_REACHED + value: + ErrorCode: 1179 + Message: You have reached a limit for generating OTP + Description: The limit for generating OTP for this resource has been reached. The limit will auto reset upon reaching the configured request disabled period. + ResetPasswordBySecurityAnswerAndEmail: + summary: Reset Password By Security Answer and Email Example + value: + SecurityAnswer: + 9d1f4208bda845d885eab43266d6543f: Smith + ResetPasswordEmailTemplate: reset-password-template + password: MySecureP@ssw0rd + Email: user@example.com + ResetPasswordBySecurityAnswerAndPhone: + summary: Reset Password By Security Answer and Phone Example + value: + SecurityAnswer: + 9d1f4208bda845d885eab43266d6543f: Smith + ResetPasswordEmailTemplate: reset-password-template + password: MySecureP@ssw0rd + Phone: '+919876543210' + ResetPasswordBySecurityAnswerAndUserId: + summary: Reset Password By Security Answer and UserId Example + value: + SecurityAnswer: + 9d1f4208bda845d885eab43266d6543f: Smith + ResetPasswordEmailTemplate: reset-password-template + password: MySecureP@ssw0rd + userid: john_doe + ResetPasswordBySecurityAnswerAndUsername: + summary: Reset Password By Security Answer and Username Example + value: + SecurityAnswer: + 9d1f4208bda845d885eab43266d6543f: Smith + ResetPasswordEmailTemplate: reset-password-template + password: MySecureP@ssw0rd + UserName: john_doe + SECUREITY_ANSWER_REQUIRED_VALIDATION: + summary: SECUREITY_ANSWER_REQUIRED_VALIDATION + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The value of secuityanswer can not be null or empty. + PASSWORD_REQUIRED_VALIDATION: + summary: PASSWORD_REQUIRED_VALIDATION + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The value of password can not be null or empty. + SECURITY_QUESTION_OR_ANSWER_NOT_ENABLED: + value: + ErrorCode: 1095 + Message: Security question or answer is not enabled + Description: The security question or answer is not enabled. Please enable the security question or answer. + SECURITY_QUESTION_NOT_SAVED_IN_PROFILE: + summary: SECURITY_QUESTION_NOT_SAVED_IN_PROFILE + value: + ErrorCode: 1092 + Message: Security question and answer is not saved in profile + Description: This security question and answer is not saved in your profile, please update the security question and answer in profile. + EMAIL_OR_USERNAME_ONLY_ONE: + summary: EMAIL_OR_USERNAME_ONLY_ONE + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: Please provide either email or username. + EMAIL_ALLREADY_VERIFIED: + summary: EMAIL_ALLREADY_VERIFIED + value: + ErrorCode: 1025 + Message: This email address is already verified + Description: This email address has already been confirmed, so you cannot resend the verification email. + EMAILID_VERIFICATION_DISABLE: + summary: EMAILID_VERIFICATION_DISABLE + value: + ErrorCode: 1034 + Message: Verification emails cannot be sent, as the email verification option is disabled for your site + Description: The email address verification option is disabled for your site, please enable it before sending any verification emails. + VERIFICATION_URL_IS_NOT_VALID: + summary: VERIFICATION_URL_IS_NOT_VALID + value: + ErrorCode: 1249 + Message: The VerificationUrl URL is invalid + Description: The VerificationUrl is invalid, please reach out to LoginRadius support for more information. + EMAIL_ID_NOT_EXIST_IN_PROFILE: + summary: EMAIL_ID_NOT_EXIST_IN_PROFILE + value: + ErrorCode: 1340 + Message: Email address does not exist in the profile + Description: The request cannot be processed as the email address does not exist in the user's profile. + SOTT_REQUIRED: + summary: SOTT_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The sott is a required parameter. + PHONE_REQUIRED_PARAM: + summary: PHONE_REQUIRED_PARAM + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The PhoneId is a required parameter. + PHONE_OR_EMAIL_REQUIRED_PARAM: + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The email/phone number is a required parameter. Please provide a valid email or phone number to process the request. + EMAIL_REQUIRED_PARAM: + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The email is a required parameter. Please provide a valid email to process the request. + EMAIL_PHONE_REQUIRED_PARAM: + summary: EMAIL_PHONE_REQUIRED_PARAM + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The email is a required parameter,The PhoneId is a required parameter. + USERNAME_EMAIL_REQUIRED_PARAM: + summary: USERNAME_EMAIL_REQUIRED_PARAM + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The username is a required parameter,The email is a required parameter. + EMAIL_TYPE_REQUIRED: + summary: EMAIL_TYPE_REQUIRED + value: + ErrorCode: 1201 + Message: Email type is required + Description: The email type is required in order to process this request. + GENDER_INVALID: + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The value of gender is invalid. Please use a valid value of gender to process the request. + BIRTH_DATE_INVALID: + summary: BIRTH_DATE_INVALID + value: + ErrorCode: 968 + Message: The date is invalid or has an invalid format + Description: The provided birth date either is in the future or has an invalid format. Please use a valid date and date format (mm/dd/yyyy). + ADDRESS_TYPE_REQUIRED: + summary: ADDRESS_TYPE_REQUIRED + value: + ErrorCode: 1125 + Message: Address type is required + Description: The request couldn't be processed. The address type must be specified in the address. + PARAMETER_NOT_FORMATTED: + summary: PARAMETER_NOT_FORMATTED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly. + Description: A parameter is not formatted correctly in the request, please check all the parameters in the API call + ADDRESS_TYPE_CAN_NOT_BE_SAME: + summary: ADDRESS_TYPE_CAN_NOT_BE_SAME + value: + ErrorCode: 1107 + Message: Address type can not be same + Description: Please use different address types in the case of multiple addresses. + EMAIL_ID_CAN_NOT_BE_SAME: + value: + ErrorCode: 1202 + Message: Email address can not be same + Description: Please use different email addresses in the case of multiple email addresses. + PRIMARY_EMAIL_CAN_BE_ONLY_ONE: + value: + ErrorCode: 1203 + Message: Primary email address can be only one + Description: The primary email address can be only one. + INVITATION_TOKEN_INVALID: + summary: INVITATION_TOKEN_INVALID + value: + ErrorCode: 8173 + Message: Invitation token is not valid. + Description: Invitation token is not valid, this invitation either accepted, expired or revoked. + EMAIL_VALUE_REQUIRED_PARAM: + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The value is a required parameter. Please ensure it is provided and correctly formatted. + INVALID_INVITATION_ID_ACCEPTED: + summary: INVALID_INVITATION_ID_ACCEPTED + value: + ErrorCode: 8175 + Message: The invitation id/token is invalid + Description: This invitation id/token is accepted. Please enter a valid invitation id/token. + INVALID_INVITATION_ID_EXPIRED: + summary: INVALID_INVITATION_ID_EXPIRED + value: + ErrorCode: 8175 + Message: The invitation id/token is invalid + Description: This invitation id/token is expired. Please enter a valid invitation id/token. + INVALID_INVITATION_ID_REVOKED: + summary: INVALID_INVITATION_ID_REVOKED + value: + ErrorCode: 8175 + Message: The invitation id/token is invalid + Description: This invitation id/token is revoked. Please enter a valid invitation id/token. + TRIAL_PLAN_USER_LIMIT_REACHED: + summary: TRIAL_PLAN_USER_LIMIT_REACHED + value: + ErrorCode: 6004 + Message: User creation limit reached for the trial plan + Description: The trial plan user creation limit has been reached. Upgrade your plan to add more users. + SECURED_ONE_TIME_TOKEN_IS_INVALID: + summary: SECURED_ONE_TIME_TOKEN_IS_INVALID + value: + ErrorCode: 1049 + Message: Secured one-time token (SOTT) is invalid + Description: Secured one-time token (SOTT) is invalid, please use a valid secure one-time token (SOTT) in order to process this request. + ORGANIZATION_NOT_ACTIVE: + summary: ORGANIZATION_NOT_ACTIVE + value: + ErrorCode: 8180 + Message: Organization is not active + Description: Organization is not active, Please provide valid organization id. + TRADITIONAL_REGISTRATION_DISABLED: + summary: TRADITIONAL_REGISTRATION_DISABLED + value: + ErrorCode: 1190 + Message: Traditional registration is disabled + Description: The traditional registration is disabled, please enable the traditional registration in order to process this request. + CUSTOM_FIELD_NOT_VALID: + summary: CUSTOM_FIELD_NOT_VALID + value: + ErrorCode: 993 + Message: Custom field is invalid + Description: This custom field is invalid. Please use a correct or valid custom field. + EMAILID_ALREADY_REGISTERED: + summary: EMAILID_ALREADY_REGISTERED + value: + ErrorCode: 936 + Message: Email ID is already registered + Description: The provided email ID is already registered, please use a different email ID. + EMAILID_ALREADY_REGISTERED_WITH_SOCIAL_ACCOUNT: + summary: EMAILID_ALREADY_REGISTERED_WITH_SOCIAL_ACCOUNT + value: + ErrorCode: 1030 + Message: This email address cannot be registered, as it is already registered under a social account + Description: An account already exists with this email address. If you've forgotten which social provider you have previously registered under, please use the forgot user ID or social provider link. + DOMAIN_NO_VALID_MX_RECORD: + value: + Description: The domain is not configured to handle emails. Please verify that the domain has valid MX records set up. + ErrorCode: 7900 + Message: A parameter is not formatted correctly. + EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER: + summary: EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER + value: + ErrorCode: 1247 + Message: Email id domain is not allowed to register + Description: The provided Email ID domain is not allowed to register, please use a different email ID. + THIS_EMAIL_ID_IS_NOT_ALLOWED_TO_REGISTER: + summary: THIS_EMAIL_ID_IS_NOT_ALLOWED_TO_REGISTER + value: + ErrorCode: 1056 + Message: This email ID is not allowed to register + Description: The email ID you are trying to register with is not allowed. + ACCOUNT_NOT_ALLOWED_TO_LOGIN: + summary: ACCOUNT_NOT_ALLOWED_TO_LOGIN + value: + ErrorCode: 1220 + Message: Account is not allowed to login + Description: The account is not allowed to login, please use a valid account in order to process this request. + PIN_REQUIRED: + value: + ErrorCode: 1234 + Message: PIN is required. + Description: The PIN is a required field. Please provide a valid PIN. + CONSENT_FORM_NOT_SUBMITTED: + summary: CONSENT_FORM_NOT_SUBMITTED + value: + Data: + ConsentProfile: + AcceptedConsentVersions: + - Event: FirstLogin + IsCustom: false + Version: 1 + Consents: + Options: + - ConsentOptionId: 123e4567e89b12d3a456426614174000 + ConsentToken: 6******2-3**8-4**5-8**d-3**********9 + Events: + - IsCustom: false + Name: Login + Description: Consent form not submitted, please accept the consent form. + ErrorCode: 1226 + Message: Consent form not submitted. + CONSENT_FORM_VALIDATION_FAILED: + value: + Description: Consent form validation failed. + ErrorCode: 1225 + Message: Consent form validation failed + PRIVACY_POLICY_NOT_ACCEPTED: + value: + ErrorCode: 1196 + Message: Privacy Policy is not accepted + Description: Privacy Policy must be accepted for registration. + AGE_UNDERAGE: + summary: AGE_UNDERAGE + value: + ErrorCode: 1163 + Message: You are not eligible for registration + Description: You are not eligible for registration, your age must be above specified by admin of this site. + PHONE_NO_ALREADY_REGISTERED: + summary: PHONE_NO_ALREADY_REGISTERED + value: + ErrorCode: 1058 + Message: Phone number is already registered with your LoginRadius site + Description: The phone number has to be unique for your LoginRadius site, please use a different phone number. + USERNAME_ALREADY_REGISTERED: + summary: USERNAME_ALREADY_REGISTERED + value: + ErrorCode: 1017 + Message: This username is already registered with this website + Description: The username you have selected is already in use, please choose a different username. + INVITATION_NOT_FOUND: + summary: INVITATION_NOT_FOUND + value: + ErrorCode: 8169 + Message: Invitation not found + Description: Invitation not found, Please provide valid invitation id. + ORGANIZATION_NOT_FOUND: + summary: ORGANIZATION_NOT_FOUND + value: + ErrorCode: 1026 + Message: Organization not found + Description: The organization not found, please use a valid organization in order to process this request. + ROLE_DOES_NOT_EXISTS_PARTNER: + summary: ROLE_DOES_NOT_EXISTS_PARTNER + value: + ErrorCode: 8125 + Message: Role does not exist + Description: Role does not exist, Please provide valid Role id. + OPERATION_FAILED_PARTNER: + summary: OPERATION_FAILED_PARTNER + value: + Message: Operation failed due to an internal error. + Description: An unknown internal error occurred, please try again in a few minutes or contact your system administrator. + ErrorCode: 7909 + PASSKEY_NOT_ENABLED_IN_APP: + summary: PASSKEY_NOT_ENABLED_IN_APP + value: + ErrorCode: 1320 + Message: Passkeys not enabled in this application. + Description: Please enable passkeys in the admin console to allow users to log in with passkeys. + PASSKEY_CONFIG_INVALID: + summary: PASSKEY_CONFIG_INVALID + value: + ErrorCode: 1322 + Message: Passkey configuration is invalid + Description: The pass key configuration is invalid, please use a valid pass key configuration in order to process this request. + PASSKEY_VERIFICATION_FAILED: + summary: PASSKEY_VERIFICATION_FAILED + value: + ErrorCode: 1321 + Message: Passkey verification failed + Description: The pass key verification failed, please use a valid pass key in order to process this request. + EMAIL_TYPE_REQUIRED_PARAM: + summary: EMAIL_TYPE_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The type is a required parameter. + PASS_KEY_CREDENTIAL_REQUIRED: + summary: PASS_KEY_CREDENTIAL_REQUIRED + value: + Message: Pass key credential is required + ErrorCode: 908 + Description: The pass key credential is required in order to process this request. + LoginByEmailRequest: + summary: LoginByEmailRequest + description: Login by email payload where email,password is required. securityanswer should be passed if the user is blocked by security question. + value: + email: john.doe@example.com + password: password123 + securityanswer: + db7****8a73e4******bd9****8c20: Answer + LoginByUserNameRequest: + summary: LoginByUsernameRequest + description: Login by username payload where username,password is required. securityanswer should be passed if the user is blocked by security question. + value: + username: johndoe + password: password123 + securityAnswer: + db7****8a73e4******bd9****8c20: Answer + LoginByPhoneRequest: + summary: LoginByPhone + description: Login by phone payload where phone,password is required. securityanswer should be passed if the user is blocked by security question. + value: + phone: '+1234567890' + password: password123 + securityAnswer: + db7****8a73e4******bd9****8c20: Answer + DUO_REDIRECT_URI_REQUIRED: + summary: DUO_REDIRECT_URI_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The duo redirect uri is a required parameter. + USERNAME_PASSWORD_REQUIRED: + summary: USERNAME_PASSWORD_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The username is a required parameter,The password is a required parameter. + PHONE_OR_EMAIL_OR_USER_REQUIRED_PARAM: + summary: PHONE_OR_EMAIL_OR_USER_REQUIRED_PARAM + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The email/username/phone is a required parameter + PHONE_OR_EMAIL_OR_USER_REQUIRED_PASSWORD_REQUIRED_PARAM: + summary: PHONE_OR_EMAIL_OR_USER_REQUIRED_PASSWORD_REQUIRED_PARAM + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The email/username/phone is a required parameter,The password is a required parameter. + USERNAME_OR_PASSWORD_WRONG: + summary: USERNAME_OR_PASSWORD_WRONG + value: + ErrorCode: 966 + Message: Username or password is wrong + Description: The username or password is wrong, please use a valid username or password in order to process this request. + USERNAME_OR_PASSWORD_WRONG_FOR_BLOCK_LOCKOUT: + summary: USERNAME_OR_PASSWORD_WRONG_FOR_BLOCK_LOCKOUT + value: + Description: You have {count} tries left before your account gets suspended. + ErrorCode: 966 + Message: Invalid user ID and/or password + USERNAME_OR_PASSWORD_WRONG_FOR_SUSPEND_LOCKOUT: + summary: USERNAME_OR_PASSWORD_WRONG_FOR_SUSPEND_LOCKOUT + value: + Description: You have {count} tries left before your account gets blocked. + ErrorCode: 966 + Message: Invalid user ID and/or password + USER_NAME_AUTHENTICATION_ENABLED: + summary: USER_NAME_AUTHENTICATION_ENABLED + value: + ErrorCode: 1183 + Message: UserName authentication is enabled + Description: You can't login from email/phone, please use username for login. + LOGIN_WITH_PASSWORD_NOT_ENABLED: + summary: LOGIN_WITH_PASSWORD_NOT_ENABLED + value: + ErrorCode: 1023 + Message: Login with password is not enabled + Description: The login with password is not enabled, please enable the login with password in order to process this request. + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT: + summary: APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT + value: + ErrorCode: 909 + Message: Your LoginRadius site does not have permission to access this endpoint + Description: Your LoginRadius site does not have permission to access this endpoint, please contact LoginRadius support for more information. + LOGIN_DISABLED: + summary: LOGIN_DISABLED + value: + ErrorCode: 1130 + Message: Login services have been disabled for your account + Description: Login services have been disabled for your account, please contact the admin or site owner. + BREACHED_PASSWORD_LOGIN: + summary: BREACHED_PASSWORD_LOGIN + value: + ErrorCode: 1316 + Message: Your password is exposed in an external data breach. + Description: Your password is found in a data breach unrelated to this app/service. Please reset your password using the email we sent you. + EMAIL_NOT_VERIFIED: + summary: EMAIL_NOT_VERIFIED + value: + ErrorCode: 970 + Message: Email is not verified + Description: The email is not verified, please verify the email in order to process this request. + PHONE_NOT_VERIFIED: + summary: PHONE_NOT_VERIFIED + value: + ErrorCode: 1066 + Message: Phone is not verified + Description: The phone is not verified, please verify the phone in order to process this request. + EMAIL_OR_PHONE_NUMBER_REQUIRED_VERIFIED: + summary: EMAIL_OR_PHONE_NUMBER_REQUIRED_VERIFIED + value: + ErrorCode: 1287 + Message: Email or phone number is required and verified + Description: The email or phone number is required and verified in order to process this request. + RBA_ACCOUNT_IS_BLOCKED_BY_BROWSER_RISK: + value: + Description: Your account has been blocked by the system admin, please contact the admin for more information. + ErrorCode: 1164 + ExtraInfo: + - Description: Login attempt from a new browser is detected. + ErrorCode: 1168 + Message: Login attempt from a new browser is detected + Message: Your account has been blocked due to suspicious activity + RBA_ACCOUNT_IS_BLOCKED_BY_CITY_RISK: + value: + Description: Your account has been blocked by the system admin, please contact the admin for more information. + ErrorCode: 1164 + ExtraInfo: + - Description: Login attempt from a new city is detected. + ErrorCode: 1169 + Message: Login attempt from a new city is detected + Message: Your account has been blocked due to suspicious activity + RBA_ACCOUNT_IS_BLOCKED_BY_COUNTRY_RISK: + value: + Description: Your account has been blocked by the system admin, please contact the admin for more information. + ErrorCode: 1164 + ExtraInfo: + - Description: Login attempt from a new country is detected. + ErrorCode: 1170 + Message: Login attempt from a new country is detected + Message: Your account has been blocked due to suspicious activity + RBA_ACCOUNT_IS_BLOCKED_BY_DEVICE_RISK: + value: + Description: Your account has been blocked by the system admin, please contact the admin for more information. + ErrorCode: 1164 + ExtraInfo: + - Description: Login attempt from a new device is detected. + ErrorCode: 1301 + Message: Login attempt from a new device is detected + Message: Your account has been blocked due to suspicious activity + RBA_ACCOUNT_IS_BLOCKED_BY_IP_RISK: + value: + Description: Your account has been blocked by the system admin, please contact the admin for more information. + ErrorCode: 1164 + ExtraInfo: + - Description: Login attempt from a new ip is detected. + ErrorCode: 1171 + Message: Login attempt from a new ip is detected + Message: Your account has been blocked due to suspicious activity + RBA_EMAIL_VERIFICATION_BY_BROWSER_RISK: + value: + Description: We have identified a suspicious activity with your account, a verification code has been sent to your email to secure your account. + ErrorCode: 1166 + ExtraInfo: + - Description: Login attempt from a new browser is detected. + ErrorCode: 1168 + Message: Login attempt from a new browser is detected + Message: A verification code has been sent to your email + RBA_EMAIL_VERIFICATION_BY_CITY_RISK: + value: + Description: We have identified a suspicious activity with your account, a verification code has been sent to your email to secure your account. + ErrorCode: 1166 + ExtraInfo: + - Description: Login attempt from a new city is detected. + ErrorCode: 1169 + Message: Login attempt from a new city is detected + Message: A verification code has been sent to your email + RBA_EMAIL_VERIFICATION_BY_COUNTRY_RISK: + value: + Description: We have identified a suspicious activity with your account, a verification code has been sent to your email to secure your account. + ErrorCode: 1166 + ExtraInfo: + - Description: Login attempt from a new country is detected. + ErrorCode: 1170 + Message: Login attempt from a new country is detected + Message: A verification code has been sent to your email + RBA_EMAIL_VERIFICATION_BY_DEVICE_RISK: + value: + Description: We have identified a suspicious activity with your account, a verification code has been sent to your email to secure your account. + ErrorCode: 1166 + ExtraInfo: + - Description: Login attempt from a new device is detected. + ErrorCode: 1301 + Message: Login attempt from a new device is detected + Message: A verification code has been sent to your email + RBA_EMAIL_VERIFICATION_BY_IP_RISK: + value: + Description: We have identified a suspicious activity with your account, a verification code has been sent to your email to secure your account. + ErrorCode: 1166 + ExtraInfo: + - Description: Login attempt from a new ip is detected. + ErrorCode: 1171 + Message: Login attempt from a new ip is detected + Message: A verification code has been sent to your email + RBA_SECURITY_ANSWER_VERIFICATION_BY_BROWSER_RISK: + value: + Description: We have identified a suspicious activity with your account, please answer the security question's to secure your account. + ErrorCode: 1165 + ExtraInfo: + - Description: Login attempt from a new browser is detected. + ErrorCode: 1168 + Message: Login attempt from a new browser is detected + Message: Please answer the security question's to secure your account + RBA_SECURITY_ANSWER_VERIFICATION_BY_CITY_RISK: + value: + Description: We have identified a suspicious activity with your account, please answer the security question's to secure your account. + ErrorCode: 1165 + ExtraInfo: + - Description: Login attempt from a new city is detected. + ErrorCode: 1169 + Message: Login attempt from a new city is detected + Message: Please answer the security question's to secure your account + RBA_SECURITY_ANSWER_VERIFICATION_BY_COUNTRY_RISK: + value: + Description: We have identified a suspicious activity with your account, please answer the security question's to secure your account. + ErrorCode: 1165 + ExtraInfo: + - Description: Login attempt from a new country is detected. + ErrorCode: 1170 + Message: Login attempt from a new country is detected + Message: Please answer the security question's to secure your account + RBA_SECURITY_ANSWER_VERIFICATION_BY_DEVICE_RISK: + value: + Description: We have identified a suspicious activity with your account, please answer the security question's to secure your account. + ErrorCode: 1165 + ExtraInfo: + - Description: Login attempt from a new device is detected. + ErrorCode: 1301 + Message: Login attempt from a new device is detected + Message: Please answer the security question's to secure your account + RBA_SMS_VERIFICATION_BY_BROWSER_RISK: + value: + Description: We have identified a suspicious activity with your account, a verification code has been sent to your phone to secure your account. + ErrorCode: 1167 + ExtraInfo: + - Description: Login attempt from a new browser is detected. + ErrorCode: 1168 + Message: Login attempt from a new browser is detected + Message: A verification code has been sent to you phone + RBA_SMS_VERIFICATION_BY_CITY_RISK: + value: + Description: We have identified a suspicious activity with your account, a verification code has been sent to your phone to secure your account. + ErrorCode: 1167 + ExtraInfo: + - Description: Login attempt from a new city is detected. + ErrorCode: 1169 + Message: Login attempt from a new city is detected + Message: A verification code has been sent to you phone + RBA_SMS_VERIFICATION_BY_COUNTRY_RISK: + value: + Description: We have identified a suspicious activity with your account, a verification code has been sent to your phone to secure your account. + ErrorCode: 1167 + ExtraInfo: + - Description: Login attempt from a new country is detected. + ErrorCode: 1170 + Message: Login attempt from a new country is detected + Message: A verification code has been sent to you phone + RBA_SMS_VERIFICATION_BY_DEVICE_RISK: + value: + Description: We have identified a suspicious activity with your account, a verification code has been sent to your phone to secure your account. + ErrorCode: 1167 + ExtraInfo: + - Description: Login attempt from a new device is detected. + ErrorCode: 1301 + Message: Login attempt from a new device is detected + Message: A verification code has been sent to you phone + RBA_SMS_VERIFICATION_BY_IP_RISK: + value: + Description: We have identified a suspicious activity with your account, please answer the security question's to secure your account. + ErrorCode: 1165 + ExtraInfo: + - Description: Login attempt from a new ip is detected. + ErrorCode: 1171 + Message: Login attempt from a new ip is detected + Message: Please answer the security question's to secure your account + PIN_IS_REQUIRED: + summary: PIN_IS_REQUIRED + value: + Data: + PINAuthToken: 6******2-3**8-4**5-8**d-3**********9 + Description: The PIN is required and needs to be set, please set PIN in the profile for login. + ErrorCode: 1243 + Message: PIN is required + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD: + summary: TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD + value: + ErrorCode: 1098 + Message: Two factor authentication client is not configured + Description: The Google two factor authentication client is not enabled, please configure or enable at least one two factor authentication client on your profile for login. + SOMETHING_GOING_WRONG: + summary: SOMETHING_GOING_WRONG + value: + ErrorCode: 2030 + Message: Oops, something went wrong, please try again. + Description: Oops, something went wrong, please try again. + TWO_FACTOR_AUTHENTICATION_PUSH_CONFIG_INVALID: + summary: TWO_FACTOR_AUTHENTICATION_PUSH_CONFIG_INVALID + value: + ErrorCode: 1298 + Message: Push Notification configuration error + Description: There appears to be a problem with the settings for using push notifications as a two-factor authentication method. Please review your configuration to ensure it's valid. + TWO_FACTOR_AUTHENTICATION_DUO_AUTH_CONFIG_INVALID: + summary: TWO_FACTOR_AUTHENTICATION_DUO_AUTH_CONFIG_INVALID + value: + ErrorCode: 1331 + Message: Duo Authenticator configuration error + Description: It appears to be a configuration issue with Duo Authenticator for two-factor authentication. Please review your configuration to ensure it is valid. + EMAIL_ID_NOT_EXISTS: + value: + ErrorCode: 1023 + Message: Email address does not exist + Description: The provided email address does not exist. Please use a valid email address. + DUO_AUTHENTICATOR_REDIRECT_URI_INVALID: + summary: DUO_AUTHENTICATOR_REDIRECT_URI_INVALID + value: + ErrorCode: 1336 + Message: Duo Authenticator redirect URI is invalid + Description: Duo Authenticator redirect URI is invalid, Please provide the valid Duo Authenticator redirect URI. + DUO_AUTHENTICATOR_REDIRECT_URI_NOT_WHITELISTED: + summary: DUO_AUTHENTICATOR_REDIRECT_URI_NOT_WHITELISTED + value: + ErrorCode: 1335 + Message: Duo Authenticator redirect URI is not whitelisted + Description: Please whitelist the Duo Authenticator redirect URI or reach out to support. + VERIFICATION_TOKEN_REQUIRED: + summary: VERIFICATION_TOKEN_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The verificationtoken is a required parameter. + EMAIL_UUID_OTP_REQUIRED: + summary: EMAIL_UUID_OTP_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The otp is a required parameter,The email or uuid is a required parameter. + EMAIL_UUID_REQUIRED: + summary: EMAIL_UUID_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The email or uuid is a required parameter. + EMAIL_USERNAME_UUID_OTP_REQUIRED: + summary: EMAIL_USERNAME_UUID_OTP_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The otp is a required parameter,The email/username or uuid is a required parameter. + EMAIL_USERNAME_UUID_REQUIRED: + summary: EMAIL_USERNAME_UUID_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The email/username or uuid is a required parameter. + IDENTIFIER_AVAILABILITY_CHECK_DISABLED: + value: + ErrorCode: 1411 + Message: Identifier availability check is disabled + Description: The email, phone and username availability check APIs have been disabled for this tenant. + VERIFICATION_LINK_INVALID: + summary: VERIFICATION_LINK_INVALID + value: + ErrorCode: 973 + Message: Invalid email verification link + Description: The email verification link is invalid, please request a new link. + EMAIL_OTP_NOT_EXISTS: + summary: EMAIL_OTP_NOT_EXISTS + value: + ErrorCode: 1188 + Message: Invalid email verification OTP + Description: The email verification OTP is invalid, please request a new OTP. + EMAIL_OTP_ALREADY_USED: + summary: EMAIL_OTP_ALREADY_USED + value: + ErrorCode: 1186 + Message: The email verification OTP has already been used + Description: Each OTP can only be used once, you can log in now if you have already verified the email, OR use the ‘forgot password’ option. + EMAIL_OTP_EXPIRED: + summary: EMAIL_OTP_EXPIRED + value: + ErrorCode: 1187 + Message: Email Verification OTP has expired + Description: This email verification OTP has expired, please use the ‘forgot password’ option to verify your email. + CONSENT_FORM_NOT_AVAILABLE: + summary: CONSENT_FORM_NOT_AVAILABLE + value: + ErrorCode: 1224 + Message: Consent form is not available + Description: There is no consent form available currently for your LoginRadius site, please configure consent form. + INVALID_UUID: + summary: INVALID_UUID + value: + ErrorCode: 1291 + Message: This uuid is invalid + Description: This is not a valid uuid, please use a valid uuid. + API_SECRET_NOT_VALID: + summary: API_SECRET_NOT_VALID + value: + ErrorCode: 902 + Message: The API secret is unauthorized + Description: The provided LoginRadius API secret is invalid or is not authorized, please use a valid or authorized LoginRadius API secret or check the API secret for your LoginRadius account. + APP_NOT_EXISTS: + value: + Description: The provided site does not exist, please use a valid LoginRadius site in order to process this request. + ErrorCode: 942 + Message: Site does not exist + EMAIL_ALREADY_USED: + summary: EMAIL_ALREADY_USED + value: + ErrorCode: 1046 + Message: This email has already been registered with your LoginRadius site + Description: This email has already been registered with your LoginRadius site, please use a different mail address. + EMAIL_TYPE_CAN_NOT_NULL: + summary: EMAIL_TYPE_CAN_NOT_NULL + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The type is a required parameter. + ACCOUNT_ID_IS_INVALID: + summary: ACCOUNT_ID_IS_INVALID + value: + ErrorCode: 984 + Message: Account ID is invalid + Description: The provided account ID is invalid, please use a valid account ID in order to process this request. + CANNOT_ADD_EMAIL_ADDRESS: + summary: CANNOT_ADD_EMAIL_ADDRESS + value: + ErrorCode: 1177 + Message: Cannot add email address + Description: The email address you are trying to add is not allowed. + DELETE_BODY_INVALID: + summary: DELETE_BODY_INVALID + value: + ErrorCode: 1084 + Message: Delete body is invalid + Description: Please use a valid delete body and make sure that it is in a valid JSON format. + ONE_EMAILID_IS_REQUIRED: + summary: ONE_EMAILID_IS_REQUIRED + value: + ErrorCode: 1005 + Message: User account should have at least one email address + Description: This email address cannot be deleted as this is the only email address in your Profile. Please add an additional email address in order to remove this. + PASSKEY_NOT_CONFIGURED_IN_PROFILE: + summary: PASSKEY_NOT_CONFIGURED_IN_PROFILE + value: + ErrorCode: 1323 + Message: Passkey not configured in your profile. + Description: Please add a passkey in your profile to use this feature. You can configure your passkey in the profile settings. + PASSKEY_VERIFICATION_FAILED_FOR_BLOCK_LOCKOUT: + summary: PASSKEY_VERIFICATION_FAILED_FOR_BLOCK_LOCKOUT + value: + Description: You have {count} tries left before your account gets blocked. + ErrorCode: 1321 + Message: An unexpected error occurred while verifying your passkey. + PASSKEY_VERIFICATION_FAILED_FOR_SUSPEND_LOCKOUT: + summary: PASSKEY_VERIFICATION_FAILED_FOR_SUSPEND_LOCKOUT + value: + Description: You have {count} tries left before your account gets suspended. + ErrorCode: 1321 + Message: An unexpected error occurred while verifying your passkey. + PASSKEY_AUTOFILL_NOT_ENABLED_IN_APP: + summary: PASSKEY_AUTOFILL_NOT_ENABLED_IN_APP + value: + Message: Passkeys autofill not enabled in this application. + ErrorCode: 1326 + Description: Passkey autofill functionality is currently disabled. Please enable it in the admin console to allow users to log in with autofill. + SECOND_FACTOR_AUTH_TOKEN_REQUIRED: + summary: SECOND_FACTOR_AUTH_TOKEN_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The secondfactorauthenticationtoken is a required parameter. + TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID: + summary: TWO_FACTOR_AUTHENTICATION_TOKEN_NOT_VALID + value: + ErrorCode: 1103 + Message: Two factor authentication token is invalid + Description: The LoginRadius two factor authentication token is invalid, please use the correct or valid token in order to process this request. + TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED: + summary: TWO_FACTOR_AUTHENTICATION_TOKEN_EXPIRED + value: + ErrorCode: 1104 + Message: Two factor authentication token has expired + Description: The LoginRadius two factor authentication token has expired, please request a new token from LoginRadius API. + TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + summary: TWO_FACTOR_AUTHENTICATION_NOT_ENABLED + value: + ErrorCode: 1097 + Message: Two factor authentication is not enabled + Description: Two factor authentication is not enabled, please enable two factor authentication for login. + TWO_FACTOR_AUTHENTICATION_PASSKEY_AUTHENTICATION_NOT_ENABLED: + summary: TWO_FACTOR_AUTHENTICATION_PASSKEY_AUTHENTICATION_NOT_ENABLED + value: + ErrorCode: 1327 + Message: Passkeys are not set up for Two-Factor Authentication + Description: Please set up passkeys for two-factor authentication in your account settings. + PASSKEY_ONLY_SUPPORT_EMAIL: + summary: PASSKEY_ONLY_SUPPORT_EMAIL + value: + ErrorCode: 1324 + Message: Passkey login unavailable for this account type. + Description: Passkey login is only available if registered with an email ID. Please try logging in with your email or consider updating your account information if you have the option. + LOGIN_IS_LOCKED_FOR_MFA: + summary: LOGIN_IS_LOCKED_FOR_MFA + value: + ErrorCode: 1263 + Message: Your account has been locked + Description: Your account has been locked, please login with your credentials again in order to unlock your account. + TWO_FACTOR_PASSKEY_NOT_CONFIGURED_ON_PROFILE: + summary: TWO_FACTOR_PASSKEY_NOT_CONFIGURED_ON_PROFILE + value: + ErrorCode: 1328 + Message: Passkey as two factor authentication is not configured for this profile + Description: Passkey as two factor authentication is not configured, please configure or enable two factor authentication on your profile for login. + TWO_FACTOR_AUTHENTICATION_Push_AUTHENTICATION_NOT_ENABLED: + summary: TWO_FACTOR_AUTHENTICATION_Push_AUTHENTICATION_NOT_ENABLED + value: + ErrorCode: 1299 + Message: Push Notifications are not set up for Two-Factor Authentication + Description: Please set up push notifications for two-factor authentication in your account settings. + MFA_PUSH_VERIFICATION_COMPLETE: + summary: MFA_PUSH_VERIFICATION_COMPLETE + value: + ErrorCode: 1311 + Message: Push Notification Verification Already Done + Description: You have already verified your account with push notification. You don't need to verify again. + TWO_FACTOR_PUSH_AUTHENTICATION_NOT_CONFIGURED_ON_PROFILE: + summary: TWO_FACTOR_PUSH_AUTHENTICATION_NOT_CONFIGURED_ON_PROFILE + value: + ErrorCode: 1313 + Message: Push notification as two factor authentication is not configured for this profile + Description: Push notification as two factor authentication is not configured, please configure or enable two factor authentication on your profile for login. + MFA_PUSH_VERIFICATION_PENDING: + summary: MFA_PUSH_VERIFICATION_PENDING + value: + ErrorCode: 1295 + Message: Push Notification Verification Pending + Description: We've sent a verification message to your registered device. Please tap Approve when it arrives to complete the process. + MFA_PUSH_VERIFICATION_DENIED: + summary: MFA_PUSH_VERIFICATION_DENIED + value: + ErrorCode: 1312 + Message: Push Notification Verification Denied + Description: It appears you declined the push notification request for verification. To proceed, please tap Approve on the notification when it reappears on your device. + TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED_IN_APP_CONFIG: + summary: TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED_IN_APP_CONFIG + value: + ErrorCode: 1280 + Message: SMS OTP is not enabled for two-factor authentication + Description: SMS OTP not enabled for two-factor authentication, please enable and try again. + TWO_FACTOR_AUTHENTICATION_PHONE_NOT_VERIFIED: + summary: TWO_FACTOR_AUTHENTICATION_PHONE_NOT_VERIFIED + value: + ErrorCode: 1117 + Message: This phone number is not registered + Description: This phone number is not registered on your profile for two factor authentication + DUO_CODE_REQUIRED: + summary: DUO_CODE_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The code is a required parameter. + DUO_STATE_REQUIRED: + summary: DUO_STATE_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The state is a required parameter. + DUO_CODE_STATE_REQUIRED: + summary: DUO_CODE_STATE_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The state is a required parameter,The code is a required parameter. + DUO_AUTH_NOT_ENABLED: + summary: DUO_AUTH_NOT_ENABLED + value: + ErrorCode: 1330 + Message: Duo Authenticator is not set up for two-factor authentication + Description: Please set up Duo Authenticator for two-factor authentication in your account settings. + DUO_STATE_NOT_VALID: + summary: DUO_STATE_NOT_VALID + value: + ErrorCode: 908 + Message: Duo Authenticator state is not valid + Description: Please enter the correct state value for Duo Authenticator. + DUO_AUTHENTICATOR_VERIFICATION_FAILED: + summary: DUO_AUTHENTICATOR_VERIFICATION_FAILED + value: + ErrorCode: 1332 + Message: Duo Authenticator verification failed + Description: Please try again as Duo Authenticator verification failed. + BACKUP_CODE_REQUIRED: + summary: BACKUP_CODE_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The backupcode is a required parameter. + TWO_FACTOR_AUTHENTICATION_BACKUP_CODE_NOT_CONFIGURED: + summary: TWO_FACTOR_AUTHENTICATION_BACKUP_CODE_NOT_CONFIGURED + value: + ErrorCode: 1128 + Message: Two factor authentication backup code is not configured + Description: The two factor authentication backup code is not enabled, please enable or configure two factor authentication for login. + TWO_FACTOR_AUTHENTICATION_BACKUP_CODE_NOT_VALID: + summary: TWO_FACTOR_AUTHENTICATION_BACKUP_CODE_NOT_VALID + value: + ErrorCode: 1129 + Message: Two factor authentication backup code is not valid or has already been used + Description: The two factor authentication backup code is not valid or has already been used, please use a valid two factor authentication backup code for login. + EMAIL_NOT_FORMATTED: + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly. + Description: The value of email can not be null or empty. + OTP_NOT_FORMATTED: + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly. + Description: The value of OTP can not be null or empty. + EMAILID_REQUIRD: + summary: EMAILID_REQUIRD + value: + ErrorCode: 1032 + Message: Email address is required + Description: Email address is required, please use a valid email address in order to process this request. + TWO_FACTOR_AUTHENTICATION_EmailOTP_AUTHENTICATION_NOT_ENABLED: + summary: TWO_FACTOR_AUTHENTICATION_EmailOTP_AUTHENTICATION_NOT_ENABLED + value: + ErrorCode: 1256 + Message: Email OTP two factor authentication is not enabled + Description: The Email OTP two factor authentication is not enabled, please enable Email OTP two factor authentication for login. + CLIENT_GUID_REQUIRED: + summary: CLIENT_GUID_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The clientguid is a required parameter. + ACCESS_TOKEN_OR_CLIENT_GUID_REQUIRED: + summary: ACCESS_TOKEN_OR_CLIENT_GUID_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The access_token or clientGuid is a required parameter. + INVALID_PROVIDER_IN_ORGANIZATION: + summary: INVALID_PROVIDER_IN_ORGANIZATION + value: + ErrorCode: 1269 + Message: Invalid provider in organization + Description: The specified provider is not valid or not configured for this organization. Please check your configuration. + SP_JWT_CONFIG_NOT_FOUND: + summary: SP_JWT_CONFIG_NOT_FOUND + value: + ErrorCode: 1282 + Message: SP JWT configuration not found + Description: The SP JWT configuration not found, please use a valid SP JWT configuration in order to process this request. + CLIENT_GUID_NOT_VALID: + summary: CLIENT_GUID_NOT_VALID + value: + ErrorCode: 1140 + Message: Client GUID is invalid + Description: The client GUID is invalid or expired, please use a valid client GUID in order to process this request. + AUTOLOGIN_LINK_ALREADY_USED: + summary: AUTOLOGIN_LINK_ALREADY_USED + value: + ErrorCode: 1137 + Message: Autologin link already used + Description: The autologin link already used, please use a valid autologin link in order to process this request. + NO_CALLBACK_LOGIN_NOT_ENABLED: + summary: NO_CALLBACK_LOGIN_NOT_ENABLED + value: + ErrorCode: 1160 + Message: No callback login is enabled + Description: The no callback login is enabled, please disable the no callback login in order to process this request. + PROVIDER_NOT_CONFIGURED: + summary: PROVIDER_NOT_CONFIGURED + value: + Description: This social provider has not been configured for the site. + ErrorCode: 1223 + Message: Social provider has not been configured for the site. + PROVIDER_NOT_SUPPORTED: + summary: PROVIDER_NOT_SUPPORTED + value: + ErrorCode: 1232 + Message: Provider is not supported. + Description: Oops, this ID Provider is not supported in your LoginRadius account. + PROVIDER_NOT_VALID: + summary: PROVIDER_NOT_VALID + value: + ErrorCode: 1065 + Message: Provider is not valid + Description: The provider is not valid, please use a valid provider in order to process this request. + PROVIDER_SIDE_ERROR: + summary: PROVIDER_SIDE_ERROR + value: + ErrorCode: 1000 + Message: Provider side error + Description: The provider side error, please use a valid provider in order to process this request. + JWT_SP_TOKEN_INVALID: + summary: JWT_SP_TOKEN_INVALID + value: + ErrorCode: 1283 + Message: Invalid or expired JWT token + Description: JWT service provider token is invalid or expired, please use a valid token to process this request. + PROVIDER_ID_MISSING: + summary: PROVIDER_ID_MISSING + value: + ErrorCode: 1302 + Message: provider ID is missing in social data + Description: provider ID is missing in social data. + EMAIL_ALLREADY_VERIFIED_TOKEN: + summary: EMAIL_ALLREADY_VERIFIED_TOKEN + value: + ErrorCode: 1126 + Message: Email has already been verified + Description: Provided email address has already been verified, so its verification token couldn’t be generated. + DELETE_TOKEN_REQUIRED: + summary: DELETE_TOKEN_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The deletetoken is a required parameter. + EMAIL_OTP_REQUIRED: + summary: EMAIL_OTP_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The otp is a required parameter,The email is a required parameter. + OTP_OR_DELETE_TOKEN_REQUIRED: + summary: OTP_OR_DELETE_TOKEN_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The deleteToken/(otp & email) is a required parameter. + DELETE_TOKEN_IS_INVALID: + summary: DELETE_TOKEN_IS_INVALID + value: + ErrorCode: 1119 + Message: The LoginRadius DeleteToken is invalid + Description: The LoginRadius DeleteToken is invalid, please use the correct or valid DeleteToken in order to process this request. + LINK_INVALID: + summary: LINK_INVALID + value: + ErrorCode: 979 + Message: The link cannot be accessed + Description: The link is either expired or has already been used, please request a new link. + PHONE_DOES_NOT_EXIST: + summary: PHONE_DOES_NOT_EXIST + value: + ErrorCode: 1292 + Message: A phone number is not currently linked to your account + Description: Your request cannot be processed as no phone number is linked to your account. + PREVENT_REFRESH_NOT_VALID: + summary: PREVENT_REFRESH_NOT_VALID + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The value 'preventRefresh' is not valid. + SOCIAL_REGISTRATION_NOT_ALLOWED: + value: + Description: The new social registration are not allowed, please login from your existing account or link this account. + ErrorCode: 1051 + Message: New social registration is not allowed + EMAIL_DOMAIN_NOT_ALLOWED_IN_ORGANIZATION: + summary: EMAIL_DOMAIN_NOT_ALLOWED_IN_ORGANIZATION + value: + Description: The email domain used is not allowed for this organization connection. Please use an valid domain. + ErrorCode: 2065 + Message: Email domain not allowed in organization connection + UNVERIFIED_EXISTING_ACCOUNT_WITH_SAME_PHONE_ID: + value: + Description: Please verify your phoneid first to log in with this social provider. + ErrorCode: 1285 + Message: Cannot login with this social provider as phoneid is not yet verified + SIGNUP_NOT_ALLOWED_IN_ORG: + value: + Description: User signup is restricted for this organization. + ErrorCode: 1271 + Message: Signup not allowed in organization + AUTOLOOKUP_DOMAIN_NOT_MATCH: + value: + Description: The email domain does not exist in the AutoLookUp configuration. Please enter a valid email domain name. + ErrorCode: 1288 + Message: Invalid email domain. + UNVERIFIED_EXISTING_ACCOUNT_WITH_SAME_EMAIL_ID: + summary: UNVERIFIED_EXISTING_ACCOUNT_WITH_SAME_EMAIL_ID + value: + ErrorCode: 1026 + Message: Cannot login with this social provider as email address is not yet verified + Description: Please verify your email address first to log in with this social provider. + UNVERIFIED_EXISTING_ACCOUNT_WITH_SAME_EMAIL_ID_IN_EMAIL_VERIFCATION_DISABLED: + summary: UNVERIFIED_EXISTING_ACCOUNT_WITH_SAME_EMAIL_ID_IN_EMAIL_VERIFCATION_DISABLED + value: + ErrorCode: 1033 + Message: Cannot login with this social provider as the same email address is already being used with another account + Description: please login with your existing account. If you’ve forgotten which provider you have previously registered under, please use the Forgot User ID or Social Provider link. + EMAIL_TYPE_VALUE_REQUIRED_PARAM: + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The type and value are required parameters. Please ensure both are provided and correctly formatted. + CUSTOM_FIELD_LENGTH_EXCEEDED: + value: + ErrorCode: 6007 + Message: Custom field length exceeded + Description: The value provided for the custom field is too long. Please ensure it does not exceed 1000 characters and try again. + PHONE_TYPE_CAN_NOT_BE_SAME: + value: + ErrorCode: 1124 + Message: Phone type cannot be same + Description: Please use different phone types in the case of multiple phone numbers. + PHONE_TYPE_REQUIRED: + value: + ErrorCode: 1213 + Message: Phone type is required + Description: The request couldn't be processed, the phone type must be specified in the phone numbers. + EMAIL_ID_NOT_ALLOWED_TO_UPDATE: + value: + ErrorCode: 1174 + Message: Email update is not allowed + Description: Update email is not allowed as email already exists in this account + ACTIVE_LOGIN_SESSIONS_NOT_ENABLED: + summary: ACTIVE_LOGIN_SESSIONS_NOT_ENABLED + value: + ErrorCode: 1339 + Message: Restrict Login Sharing feature not enabled + Description: Please enable the Restrict Login Sharing feature to proceed further. + DELETE_URL_IS_NOT_WHITELISTED: + summary: DELETE_URL_IS_NOT_WHITELISTED + value: + ErrorCode: 2066 + Message: The delete URL is not whitelisted + Description: The delete URL is not whitelisted, please whitelist the URL on the tenant settings. + USER_ID_NOT_VALID: + summary: USER_ID_NOT_VALID + value: + ErrorCode: 937 + Message: User ID is invalid + Description: The user ID is invalid, please use a valid user ID in order to process this request. + AUTH_PARAMETER_REQUIRED: + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly. + Description: The authenticatorcode is a required parameter. + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_ENABLED_IN_APP_CONFIG_OLD: + summary: TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_ENABLED_IN_APP_CONFIG_OLD + value: + ErrorCode: 1279 + Message: Google Authenticator is not enabled for two-factor authentication + Description: Google Authenticator not enabled for two-factor authentication, please enable and try again. + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_ENABLED_IN_APP_CONFIG: + summary: TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_ENABLED_IN_APP_CONFIG + value: + ErrorCode: 1279 + Message: The authenticator method is not enabled for two-factor authentication. + Description: Please enable the authenticator method for two-factor authentication and try again. + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_CODE_INCORRECT: + summary: TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_CODE_INCORRECT + value: + ErrorCode: 1102 + Message: The two-factor authenticator code is incorrect + Description: Please enter the correct authenticator code. + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_CODE_INCORRECT_OLD: + summary: TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_CODE_INCORRECT + value: + ErrorCode: 1331 + Message: Google two factor authentication code is incorrect + Description: The Google two factor authentication code is incorrect, please enter the correct authentication code for login. + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED: + summary: TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED + value: + ErrorCode: 1098 + Message: A two-factor authentication method is not enabled + Description: A working two-factor authentication method is necessary. Please configure or enable a two-factor authentication method. + TWO_FACTOR_AUTHENTICATION_NOT_VALID_FOR_DELETE: + summary: TWO_FACTOR_AUTHENTICATION_NOT_VALID_FOR_DELETE + value: + ErrorCode: 1121 + Message: This is not valid request for removing two factor authentication + Description: This is not valid request for removing two factor authentication + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_CONFIGURED: + summary: TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_CONFIGURED + value: + ErrorCode: 1099 + Message: Two-factor authenticator is not configured. + Description: Two-factor authenticator app is not configured. Please configure an authenticator to enable two-factor authentication. + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_CONFIGURED_OLD: + summary: TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_NOT_CONFIGURED_OLD + value: + ErrorCode: 1099 + Message: Two-factor authenticator is not configured. + Description: Two-factor authenticator app is not configured. Please configure an authenticator to enable two-factor authentication. + TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED: + summary: TWO_FACTOR_AUTHENTICATION_OTP_AUTHENTICATION_NOT_ENABLED + value: + ErrorCode: 1100 + Message: OTP two factor authentication is not enabled + Description: The OTP two factor authentication is not enabled, please enable OTP two factor authentication for login. + PRIVACY_POLICY_NOT_AVAILABLE: + value: + ErrorCode: 1195 + Message: Privacy Policy is not available + Description: There is no Privacy Policy available currently for your LoginRadius site. + PRIVACY_POLICY_ALREADY_ACCEPTED: + value: + ErrorCode: 1222 + Message: Current Privacy Policy is already accepted + Description: Current Privacy Policy is already accepted. + INVALID_PASSKEY_ID: + summary: INVALID_PASSKEY_ID + value: + ErrorCode: 1325 + Message: Invalid Passkey ID + Description: The provided Passkey ID is invalid; it cannot be removed. + TWO_FACTOR_DUO_AUTHENTICATOR_NOT_CONFIGURED_ON_PROFILE: + summary: TWO_FACTOR_DUO_AUTHENTICATOR_NOT_CONFIGURED_ON_PROFILE + value: + ErrorCode: 1334 + Message: Duo Authenticator as two-factor authentication method is not configured for this profile + Description: Please configure or enable two-factor authentication in your account for login. + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_ON_PROFILE: + summary: TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_ON_PROFILE + value: + ErrorCode: 1101 + Message: Two factor authentication is not configured for this profile + Description: Two factor authentication is not configured, please configure or enable two factor authentication on your profile for login. + TWO_FACTOR_AUTHENTICATION_BACKUP_CODE_ALREADY_CONFIGURED: + summary: TWO_FACTOR_AUTHENTICATION_BACKUP_CODE_ALREADY_CONFIGURED + value: + ErrorCode: 1127 + Message: Two factor authentication backup code is already generated + Description: The two factor authentication backup code is already generated, please reset your two factor authentication backup code. + EVENT_BASED_TWO_FACTOR_AUTHENTICATION_NOT_ENABLED: + summary: EVENT_BASED_TWO_FACTOR_AUTHENTICATION_NOT_ENABLED + value: + ErrorCode: 1191 + Message: Event Based two factor authentication is not enabled + Description: Event Based two factor authentication is not enabled, please enable event based two factor authentication for login. + OTP_PAYLOAD_REQUIRED: + summary: OTP_PAYLOAD_REQUIRED + value: + Message: A parameter is not formatted correctly + ErrorCode: 908 + Description: The otp is a required parameter. + RESET_PASSKEY_URL_INVALID: + summary: RESET_PASSKEY_URL_INVALID + value: + ErrorCode: 1329 + Message: The reset passkey URL is invalid + Description: The reset passkey Url is invalid, please reach out to LoginRadius support for more information. + ACCOUNT_ALREADY_UNLOCKED: + value: + ErrorCode: 1221 + Message: Account is already unlocked + Description: The account is already unlocked, you can access or manage your profile. + CAPTCHA_IS_NOT_VALID: + summary: CAPTCHA_IS_NOT_VALID + value: + ErrorCode: 1218 + Message: CAPTCHA is invalid + Description: CAPTCHA is invalid, please enter the correct CAPTCHA value. + CANDIDATE_TOKEN_REQUIRED: + summary: CANDIDATE_TOKEN_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The candidatetoken is a required parameter. + ACCOUNT_LINKING_DISABLED: + summary: ACCOUNT_LINKING_DISABLED + value: + ErrorCode: 1054 + Message: Account linking is disabled + Description: The account linking is disabled, please enable the account linking in order to process this request. + SAME_PROVIDER_CANT_BE_LINKED: + summary: SAME_PROVIDER_CANT_BE_LINKED + value: + ErrorCode: 1251 + Message: Same provider can't be linked + Description: The same provider can't be linked, please use a valid provider in order to process this request. + EMAIL_NOT_VERIFIED_CAN_NOT_LINK: + summary: EMAIL_NOT_VERIFIED_CAN_NOT_LINK + value: + ErrorCode: 1254 + Message: Email is not verified can not link + Description: The email is not verified can not link, please verify the email in order to process this request. + ACCOUNT_IS_ALREADY_EXIST_WITH_SAME_EMAIL: + summary: ACCOUNT_IS_ALREADY_EXIST_WITH_SAME_EMAIL + value: + ErrorCode: 1253 + Message: Account is already exist with same email + Description: The account is already exist with same email, please use a valid account in order to process this request. + SAME_ACCOUNT_CANT_BE_LINKED: + summary: SAME_ACCOUNT_CANT_BE_LINKED + value: + ErrorCode: 983 + Message: Same account can't be linked + Description: The same account can't be linked, please use a valid account in order to process this request. + ACCOUNT_IS_ALREADY_LINKED: + summary: ACCOUNT_IS_ALREADY_LINKED + value: + ErrorCode: 986 + Message: Account is already linked + Description: The account is already linked, please use a valid account in order to process this request. + PROVIDER_IS_REQUIRED: + summary: PROVIDER_IS_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The value of provider can not be null or empty. + PROVIDER_ID_IS_REQUIRED: + summary: PROVIDER_ID_IS_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The value of providerid can not be null or empty. + ENDPOINT_NOT_SUPPORTED_BY_PROVIDER: + summary: ENDPOINT_NOT_SUPPORTED_BY_PROVIDER + value: + ErrorCode: 1078 + Message: Endpoint not supported by provider + Description: The endpoint not supported by provider, please use a valid endpoint in order to process this request. + SAME_ACCOUNT_CANT_BE_UNLINKED: + summary: SAME_ACCOUNT_CANT_BE_UNLINKED + value: + ErrorCode: 1219 + Message: Account cannot be unlinked + Description: An account cannot be unlinked from itself. + ACCOUNT_IS_NOT_LINKED_WITH_ANY_ACCOUNT: + summary: ACCOUNT_IS_NOT_LINKED_WITH_ANY_ACCOUNT + value: + ErrorCode: 987 + Message: Account cannot be unlinked + Description: This account is not linked to any other account, so it cannot be unlinked. + PROVIDER_ID_NOT_LINKED_WITH_THIS_ACCOUNT: + summary: PROVIDER_ID_NOT_LINKED_WITH_THIS_ACCOUNT + value: + ErrorCode: 989 + Message: Provider ID cannot be unlinked + Description: This provider ID is not linked to any other account, so it cannot be unlinked. + CAPTCHA_REQUIRED: + summary: CAPTCHA_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The captcha is a required parameter. + NO_REGISTRATION_NOT_ENABLED: + summary: NO_REGISTRATION_NOT_ENABLED + value: + ErrorCode: 1146 + Message: One touch login is not enabled for your LoginRadius site + Description: The one touch login is not enabled for your LoginRadius site, please reach out to LoginRadius support for more information. + CLIENT_GUID_MUST_BE_UNIQUE: + summary: CLIENT_GUID_MUST_BE_UNIQUE + value: + ErrorCode: 1136 + Message: Client GUID must be unique + Description: You have already used this client GUID, please use a unique client GUID. + REDIRECT_URL_IS_NOT_WHITELISTED: + summary: REDIRECT_URL_IS_NOT_WHITELISTED + value: + ErrorCode: 2067 + Message: The redirect URL is not whitelisted + Description: The redirect URL is not whitelisted, please whitelist the URL on the tenant settings. + NO_REGISTRATION_LOGIN_LINK_ALREADY_USED: + summary: NO_REGISTRATION_LOGIN_LINK_ALREADY_USED + value: + ErrorCode: 1145 + Message: The one touch login link has already been used + Description: Each link can only be used once, please click the sign in button for a new link. + PIN_AUTH_WRONG: + summary: PIN_AUTH_WRONG + value: + ErrorCode: 1236 + Message: Invalid PIN + Description: Please use a valid PIN for the Authentication. + PIN_AUTH_NOT_ENABLED: + summary: PIN_AUTH_NOT_ENABLED + value: + ErrorCode: 1233 + Message: PIN Authentication is not configured. + Description: PIN Authentication is not configured, please reach out to LoginRadius support for more information. + PIN_NOT_CONFIGURED: + summary: PIN_AUTH_NOT_CONFIGURED + value: + ErrorCode: 1235 + Message: PIN is not available + Description: The PIN is not available in the profile, please add PIN in the profile in order to process this request. + PASSWORD_IS_WRONG: + summary: PASSWORD_IS_WRONG + value: + ErrorCode: 1205 + Message: Invalid password + Description: Please use a valid password. + EMAIL_OR_PHONE_NOT_VERIFIED: + summary: EMAIL_OR_PHONE_NOT_VERIFIED + value: + ErrorCode: 1162 + Message: Email or Phone is not verified + Description: This email has not yet been verified, please click the link in your email to confirm your email address. + TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED_OLD_MFA: + summary: TWO_FACTOR_AUTHENTICATION_NOT_CONFIGURED + value: + ErrorCode: 1098 + Message: Two factor authentication client is not configured + Description: The Google two factor authentication client is not enabled, please configure or enable at least one two factor authentication client on your profile for login. + GOOGLE_AUTH_CODE_REQUIRED: + summary: GOOGLE_AUTH_CODE_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The googleauthenticatorcode is a required parameter. + AUTHENTICATOR_CODE_REQUIRED: + summary: AUTHENTICATOR_CODE_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The authenticatorcode is a required parameter. + TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_CODE_INCORRECT_OLD_MFA: + summary: TWO_FACTOR_AUTHENTICATION_AUTHENTICATOR_CODE_INCORRECT + value: + ErrorCode: 1102 + Message: Google two factor authentication code is incorrect + Description: The Google two factor authentication code is incorrect, please enter the correct authentication code for login. + RESOURCE_NOT_FOUND: + summary: RESOURCE_NOT_FOUND + value: + ErrorCode: 404 + Message: Resource not found + Description: Sorry, the resource you were looking for was not found. + SECURITY_QUES_ANS_REQUIRED: + summary: SECURITY_QUES_ANS_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The securityquestionanswer is a required parameter. + TWO_FACTOR_SECURITY_QUESTION_AUTHENTICATION_NOT_VERIFIED: + summary: TWO_FACTOR_SECURITY_QUESTION_AUTHENTICATION_NOT_VERIFIED + value: + ErrorCode: 1259 + Message: Security question two factor authentication is not verified on the profile + Description: The Security question two factor authentication is not verified on profile, please verify security question two factor authentication on profile. + TWO_FACTOR_AUTHENTICATION_METHOD_ENABLED: + summary: TWO_FACTOR_AUTHENTICATION_METHOD_ENABLED + value: + ErrorCode: 1258 + Message: One of the Two Factor authentication methods is already enabled + Description: One of the Two Factor authentication methods is already enabled, can not update Two Factor authentication security question answers. + AUTOLOGIN_NOT_ENABLED: + summary: AUTOLOGIN_NOT_ENABLED + value: + ErrorCode: 1135 + Message: Smart login option is not enabled for your LoginRadius site + Description: The smart login option is not enabled for your LoginRadius site, please reach out to LoginRadius support for more information. + AUTOLOGIN_LINK_ALREADY_VERIFIED: + summary: AUTOLOGIN_LINK_ALREADY_VERIFIED + value: + ErrorCode: 1138 + Message: The smart login link has already been verified + Description: This smart login link has already been verified, please click the smart login button for a new link. + EMAIL_PHONE_USERNAME_AND_CLIENT_GUID_REQUIRED: + summary: EMAIL_PHONE_USERNAME_AND_CLIENT_GUID_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The email/username/phone is a required parameter.,The clientguid is a required parameter. + AUTOLOGIN_LINK_NOT_VERIFIED: + summary: AUTOLOGIN_LINK_NOT_VERIFIED + value: + ErrorCode: 1139 + Message: The smart login link has not been verified + Description: This smart login link has not been verified, please click the smart login link in your email to verify. + ONE_CLICK_SIGIN_NOT_ENABLED: + summary: ONE_CLICK_SIGIN_NOT_ENABLED + value: + ErrorCode: 1059 + Message: Password less login option is not enabled for your LoginRadius site + Description: The password less login option is not enabled for your LoginRadius site, please reach out to LoginRadius support for more information. + TOKEN_LIMIT_REACHED: + summary: TOKEN_LIMIT_REACHED + value: + ErrorCode: 1178 + Message: You have reached a limit for generating token + Description: The limit for generating a token for this resource has been reached. The limit will auto reset upon reaching the configured request disabled period. + SOTT_OR_CAPTCHA_REQUIRED: + summary: SOTT_OR_CAPTCHA_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: SOTT or captcha is a required parameter. + PHONE_NUMBER_NOT_EXISTS: + summary: PHONE_NUMBER_NOT_EXISTS + value: + ErrorCode: 1043 + Message: Phone number is invalid or does not exist + Description: The provided phone number is invalid or does not exist, please use a valid phone number in order to process this request. + LINK_ALREADY_USED: + summary: LINK_ALREADY_USED + value: + ErrorCode: 1062 + Message: The password less login link has already been used + Description: Each link can only be used once, please click the password less login button for a new link. + PHONE_NOT_BLANK: + summary: PHONE_NOT_BLANK + value: + ErrorCode: 912 + Message: A parameter is not formatted correctly + Description: The value of Phone cannot be null or empty. + OTP_NOT_BLANK: + summary: OTP_NOT_BLANK + value: + ErrorCode: 910 + Message: A parameter is not formatted correctly + Description: The value of OTP cannot be null or empty. + USER_NAME_NOT_BLANK: + summary: USER_NAME_NOT_BLANK + value: + ErrorCode: 910 + Message: A parameter is not formatted correctly + Description: The value of UserName cannot be null or empty. + HTTPStatusCode: 400 + USER_NAME_AUTHENTICATION_NOT_ENABLED: + summary: USER_NAME_AUTHENTICATION_NOT_ENABLED + value: + ErrorCode: 1238 + Message: UserName authentication is not enabled + Description: UserName authentication is not enabled. + EMAIL_NOT_BLANK: + summary: EMAIL_NOT_BLANK + value: + ErrorCode: 912 + Message: A parameter is not formatted correctly + Description: The value of Email cannot be null or empty. + PIN_REQUIRED_PARAM: + summary: PIN_REQUIRED_PARAM + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The pin is a required parameter. + SESSION_TOKEN_REQUIRED: + summary: SESSION_TOKEN_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The session_token is a required parameter. + PIN_AUTH_SESSION_TOKEN_NOT_VALID: + summary: PIN_AUTH_SESSION_TOKEN_NOT_VALID + value: + ErrorCode: 1245 + Message: Session token is invalid + Description: PIN authentication session token is invalid, please use valid PIN authentication session token. + PIN_AUTH_SESSION_TOKEN_EXPIRED: + summary: PIN_AUTH_SESSION_TOKEN_EXPIRED + value: + ErrorCode: 1246 + Message: Session token has expired + Description: The LoginRadius PIN authentication session token expired, please request a new PIN authentication session token from LoginRadius API. + PIN_LOGIN_NOT_ENABLED: + summary: PIN_LOGIN_NOT_ENABLED + value: + ErrorCode: 1244 + Message: PIN Login is not enabled + Description: PIN Login is not enabled. + CUSTOM_OBJECTS_RESPONSE_EXAMPLE: + summary: CustomObjectsResponseModel + value: + Count: 2 + data: + - IsActive: true + IsDeleted: false + CustomObject: + firstName: John + lastName: Doe + age: 30 + Id: abc123 + Uid: user456 + DateCreated: '2024-05-28T12:34:56Z' + DateModified: '2024-05-29T09:10:11Z' + - IsActive: false + IsDeleted: true + CustomObject: + company: Acme Corp + Role: Engineer + Id: def789 + Uid: user789 + DateCreated: '2024-05-20T08:00:00Z' + DateModified: '2024-05-21T10:00:00Z' + CUSTOM_OBJECT_NAME_REQUIRED: + summary: CUSTOM_OBJECT_NAME_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The objectname is a required parameter. + CUSTOM_OBJECT_NOT_CONFIGURED: + summary: CUSTOM_OBJECT_NOT_CONFIGURED + value: + ErrorCode: 999 + Message: Site is not configured for custom object setting + Description: The custom object setting is not configured for this site, please contact LoginRadius support. + CUSTOM_OBJECT_NAME_NOT_VALID: + summary: CUSTOM_OBJECT_NAME_NOT_VALID + value: + ErrorCode: 1064 + Message: Custom object name is invalid + Description: The custom object name used in this request is incorrect or does not exist. + CUSTOM_OBJECT_RECORD_NOT_EXIST: + summary: CUSTOM_OBJECT_RECORD_NOT_EXIST + value: + ErrorCode: 1057 + Message: Custom object is not found or does not exist + Description: The requested custom object of the user's account could not be found, please create a custom object before requesting. + CUSTOM_OBJECT_RESPONSE_EXAMPLE: + summary: CustomObjectResponseModel + value: + IsActive: true + IsDeleted: false + CustomObject: + firstName: John + lastName: Doe + age: 30 + Id: abc123 + Uid: user456 + DateCreated: '2024-05-28T12:34:56Z' + DateModified: '2024-05-29T09:10:11Z' + CUSTOM_OBJECT_JSON_NOT_VALID: + summary: CUSTOM_OBJECT_JSON_NOT_VALID + value: + ErrorCode: 1035 + Message: Custom object JSON is invalid + Description: The provided custom object JSON is invalid, please use a valid or well-formatted JSON in order to process this request + CUSTOM_OBJECT_RECORD_ID_NOT_VALID: + summary: CUSTOM_OBJECT_RECORD_ID_NOT_VALID + value: + ErrorCode: 995 + Message: Unique record ID is invalid + Description: This unique record Id is invalid, please enter a valid unique record ID. + PHONE_NUMBER_ALREADY_VERIFIED: + summary: PHONE_NUMBER_ALREADY_VERIFIED + value: + ErrorCode: 1073 + Message: This phone number has already been confirmed + Description: This phone number has already been confirmed, so you cannot resend the verification OTP + ACCESS_TOKEN_INVALID_OR_PHONE_NUMBER_ALREADY_VERIFIED: + summary: ACCESS_TOKEN_INVALID_OR_PHONE_NUMBER_ALREADY_VERIFIED + value: + ErrorCode: 1120 + Message: Access token is invalid or phone number is already verified + Description: The LoginRadius access token is invalid or the phone number has already been verified. + OLD_PIN_REQUIRED_PARAM: + summary: OLD_PIN_REQUIRED_PARAM + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The value of oldpin can not be null or empty. + NEW_PIN_REQUIRED_PARAM: + summary: NEW_PIN_REQUIRED_PARAM + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The value of newpin can not be null or empty. + OLD_PIN_WRONG: + summary: OLD_PIN_WRONG + value: + ErrorCode: 1241 + Message: Current pin is invalid + Description: Your current pin is invalid, please use the correct pin. + PIN_AUTH_TOKEN_REQUIRED: + summary: PIN_AUTH_TOKEN_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The pinauthtoken is a required parameter. + PIN_AUTH_TOKEN_NOT_VALID: + summary: PIN_AUTH_TOKEN_NOT_VALID + value: + ErrorCode: 1239 + Message: PINAuth token is invalid + Description: PINAuth token is invalid, please use the correct or valid PINAuth token in order to process this request. + PIN_AUTH_TOKEN_EXPIRED: + summary: PIN_AUTH_TOKEN_EXPIRED + value: + ErrorCode: 1240 + Message: PINAuth token has expired + Description: The LoginRadius PINAuth token expired, please request a new PINAuth token from LoginRadius API. + RESET_PIN_URL_INVALID: + summary: RESET_PIN_URL_INVALID + value: + ErrorCode: 1248 + Message: The reset pin URL is invalid + Description: The reset pin Url is invalid, please reach out to LoginRadius support for more information. + PHONE_PAYLOAD_REQUIRED: + summary: PHONE_PAYLOAD_REQUIRED + value: + Description: The phone is a required parameter. + ErrorCode: 908 + Message: A parameter is not formatted correctly + PIN_LINK_ALREADY_VERIFIED: + summary: PIN_LINK_ALREADY_VERIFIED + value: + ErrorCode: 1242 + Message: The email verification link has already been used + Description: Each link can only be used once, you can log in now if you have already verified the email, OR use the 'forgot pin' option. + MFA_PHONE_REQUIRED: + summary: MFA_PHONE_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The phoneno2fa is a required parameter. + TWO_FACTOR_AUTHENTICATION_PHONE_ALREADY_USED: + summary: TWO_FACTOR_AUTHENTICATION_PHONE_ALREADY_USED + value: + ErrorCode: 1106 + Message: This phone number is already registered + Description: This phone number is already registered on your profile for two factor authentication., please use a different phone number for login. + TWO_FACTOR_AUTHENTICATION_INVALID_PHONE_UPDATE_OLD: + summary: TWO_FACTOR_AUTHENTICATION_INVALID_PHONE_UPDATE_OLD + value: + ErrorCode: 1250 + Message: This is not valid request for updating phone number for two factor authentication + Description: Google two factor or OTP two factor authentication or security question two factor authentication is already enabled on the profile, please use the update profile API for updating phone number. + TWO_FACTOR_AUTHENTICATION_INVALID_PHONE_UPDATE: + summary: TWO_FACTOR_AUTHENTICATION_INVALID_PHONE_UPDATE + value: + ErrorCode: 1250 + Message: Invalid request to update the phone number for two-factor authentication. + Description: Authenticator, OTP, or security question-based two-factor authentication method is already enabled. Please use the update profile API to update the phone number. + CONSENT_FORM_NOT_ENABLED: + summary: CONSENT_FORM_NOT_ENABLED + value: + ErrorCode: 1227 + Message: Consent Management is not enabled. + Description: Consent Management is not enabled, please reach out to LoginRadius support for more information. + CONSENT_TOKEN_REQUIRED: + summary: CONSENT_TOKEN_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The consenttoken is a required parameter. + CONSENT_TOKEN_NOT_VALID: + summary: CONSENT_TOKEN_NOT_VALID + value: + ErrorCode: 1229 + Message: Consent token is invalid + Description: Consent token is invalid, please use the correct or valid consent token in order to process this request. + CONSENT_TOKEN_EXPIRED: + summary: CONSENT_TOKEN_EXPIRED + value: + ErrorCode: 1230 + Message: Consent token has expired + Description: The LoginRadius consent token expired, please request a new consent token from LoginRadius API. + TOKEN_REQUIRED: + summary: TOKEN_REQUIRED + value: + error: invalid_request + error_description: The token is a required parameter. + CONSENT_LOGS_NOT_AVAILABLE: + summary: CONSENT_LOGS_NOT_AVAILABLE + value: + ErrorCode: 1228 + Message: Consent logs not available. + Description: Consent logs not available. + EVENT_REQUIRED: + summary: EVENT_REQUIRED + value: + error: invalid_request + error_description: The event is a required parameter. + ISCUSTOM_REQUIRED: + summary: IS_CUSTOM_REQUIRED + value: + error: invalid_request + error_description: The is_custom parameter is a required parameter. + INVITATION_TOKEN_REQUIRED: + summary: INVITATION_TOKEN_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The Invitation token is required. Please enter a valid Invitation token. + TOKEN_TYPE_REQUIRED: + summary: TOKEN_TYPE_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The tokentype is a required parameter. + API_SECRET_NOT_WELL_FORMATTED: + summary: API_SECRET_NOT_WELL_FORMATTED + value: + ErrorCode: 921 + Message: API secret is invalid + Description: The provided LoginRadius API secret is invalid, please use a valid API secret of your LoginRadius account. + API_SECRET_OR_SIGNATURE_REQUIRED: + summary: API_SECRET_OR_SIGNATURE_REQUIRED + value: + ErrorCode: 1209 + Message: API-Signature/API-Secret is missing + Description: The request is missing the API-Signature/API-Secret, please use a valid API-Signature/API-Secret parameter in order to process this request. + API_SECRET_REQUIRED: + summary: API_SECRET_REQUIRED + value: + ErrorCode: 923 + Message: API secret is missing + Description: The request is missing the API secret, please use the valid API secret parameter in order to process this request. + API_SIGNATURE_REQUIRED: + summary: API_SIGNATURE_REQUIRED + value: + ErrorCode: 1207 + Message: API signature is missing + Description: The request is missing the API signature, please use a valid API signature parameter in order to process this request. + EMAILID_OR_USERNAME_REQUIRD: + summary: EMAILID_OR_USERNAME_REQUIRD + value: + ErrorCode: 1141 + Message: Email address or username is required + Description: Email address or username is required, please use a valid email address or username in order to process this request. + API_SIGNATURE_INVALID: + summary: API_SIGNATURE_INVALID + value: + ErrorCode: 1208 + Message: API signature is invalid + Description: The API signature is invalid, please use a valid API signature parameter in order to process this request. + REQUEST_EXPIRY_TIME_INVALID_FORMAT: + summary: REQUEST_EXPIRY_TIME_INVALID_FORMAT + value: + ErrorCode: 1211 + Message: The request expiry time has an invalid format + Description: The request expiry time has an invalid format, please use a valid date-time format. + REQUEST_EXPIRY_TIME_REQUIRED: + summary: REQUEST_EXPIRY_TIME_REQUIRED + value: + ErrorCode: 1210 + Message: Request expiry time is missing + Description: The request is missing the request expiry time, please use a valid request expiry time parameter in order to process this request. + UID_REQUIRED: + summary: UID_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The uid is a required parameter. + EMAIL_TYPE_CAN_NOT_NULL-EMAIL_REQUIRED-UID_REQUIRED: + summary: EMAIL_TYPE_CAN_NOT_NULL-EMAIL_REQUIRED-UID_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The type is a required parameter,The email is a required parameter,The uid is a required parameter. + EMAIL_OR_USER_REQUIRED_PARAM: + summary: EMAIL_OR_USER_REQUIRED_PARAM + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The email/username is a required parameter. + EMAIL_OR_USER_REQUIRED_PARAM-CLIENT_GUID_REQUIRED: + summary: EMAIL_OR_USER_REQUIRED_PARAM-CLIENT_GUID_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The email/username is a required parameter,The clientguid is a required parameter. + CLIENT_GUID_REQUIRED-EMAIL_REQUIRED: + summary: CLIENT_GUID_REQUIRED-EMAIL_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The clientguid is a required parameter,The email is a required parameter. + INVALID_TOKEN_TYPE: + summary: INVALID_TOKEN_TYPE + value: + ErrorCode: 1181 + Message: You have entered an invalid token type + Description: The allowed token types are emailverification, addemail, forgotpassword, deleteuser, passwordlesslogin, forgotpin, onetouchlogin and autologin. + SECRET_DOESNT_HAVE_ACCESS: + summary: SECRET_DOESNT_HAVE_ACCESS + value: + ErrorCode: 1143 + Message: Access Unauthorized + Description: Your LoginRadius site secret does not have authorization to access this endpoint. + REQUEST_EXPIRY_TIME_IS_INVALID: + summary: REQUEST_EXPIRY_TIME_IS_INVALID + value: + ErrorCode: 1212 + Message: The request expiry time is invalid + Description: The request expiry time is invalid, please use a valid request expiry time in order to process this request. + SMS_OTP_TYPE_REQUIRED: + summary: SMS_OTP_TYPE_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The smsotptype is a required parameter. + PHONE_REQUIRED_PARAM-UID_REQUIRED: + summary: PHONE_REQUIRED_PARAM-UID_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The PhoneId is a required parameter,The uid is a required parameter. + ACCESS_TOKEN_INVALID_OR_EXPIRED: + summary: ACCESS_TOKEN_INVALID_OR_EXPIRED + value: + ErrorCode: 2024 + Message: The Access Token is expired or invalid + Description: The Access Token is expired or invalid, please request a new Access Token from the LoginRadius API. + B2B_FEATURE_ENABLED: + summary: B2B_FEATURE_ENABLED + value: + ErrorCode: 8179 + Message: B2B feature is enabled + Description: Request couldn't be processed, B2B feature is enabled for this site. + PUT_BODY_INVALID: + summary: PUT_BODY_INVALID + value: + ErrorCode: 1079 + Message: Put body is invalid + Description: Please use a valid put body and make sure that it is in a valid JSON format. + PARAMETER_NOT_WELL_FORMATTED_CONTEXT: + summary: PARAMETER_NOT_WELL_FORMATTED_CONTEXT + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The context is a required parameter. + PARAMETER_NOT_WELL_FORMATTED_ROLE: + summary: PARAMETER_NOT_WELL_FORMATTED_ROLE + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The Roles is a required parameter. + PARAMETER_NOT_WELL_FORMATTED_ROLE_NULL: + summary: PARAMETER_NOT_WELL_FORMATTED_ROLE_NULL + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The value of Roles can not be null or empty. + INVALID_DATE_ROLES: + summary: INVALID_DATE_ROLES + value: + ErrorCode: 1172 + Message: Invalid date + Description: A date was specified that was not in the correct format or not a valid date. + ROLE_DOES_NOT_EXISTS: + summary: ROLE_DOES_NOT_EXISTS + value: + ErrorCode: 1047 + Message: Role does not exist + Description: The provided Role for the user does not exist, please use a valid Role in order to process this request. + CONTEXT_NAME_REQUIRED: + summary: CONTEXT_NAME_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The contextName is a required parameter. + ROLE_CONTEXT_NOT_VALID: + summary: ROLE_CONTEXT_NOT_VALID + value: + ErrorCode: 1133 + Message: Role Context Name is not Valid. + Description: Your Role context name is not valid, please use a valid Role context name. + ROLES_CAN_NOT_BE_EMPTY: + summary: ROLES_CAN_NOT_BE_EMPTY + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The value of Roles can not be null or empty. + PARAMETER_NOT_WELL_FORMATTED_ADDPERMISSION_NULL: + summary: PARAMETER_NOT_WELL_FORMATTED_ADDPERMISSION_NULL + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The value of additionalPermissions can not be null or empty. + PARAMETER_NOT_WELL_FORMATTED_ADDPERMISSION: + summary: PARAMETER_NOT_WELL_FORMATTED_ADDPERMISSION + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The additionalPermissions is a required parameter. + ADDITIONALPERMISSIONS_NOT_EXITS: + summary: ADDITIONALPERMISSIONS_NOT_EXITS + value: + ErrorCode: 1142 + Message: Additional Permission does not exist + Description: Additional Permission for the user does not exist, please use a valid additional Permission in order to process this request. + IP_ACCESS_DENIED: + summary: IP_ACCESS_DENIED + value: + ErrorCode: 1206 + Message: IP Access Denied + Description: Access denied to the resource due to unauthorized IP. + REFRESH_TOKEN_REQUIRED: + summary: REFRESH_TOKEN_REQUIRED + value: + ErrorCode: 1337 + Message: Refresh token is missing from social ID provider + Description: The ID Provider refresh token is required to generate the LoginRadius access token, please use the correct token in order to process this request. + REFRESH_TOKEN_INVALID: + summary: REFRESH_TOKEN_INVALID + value: + ErrorCode: 1217 + Message: Refresh token invalid + Description: LoginRadius refresh token is invalid. + OPERATION_FAILED_OIDC: + summary: OPERATION_FAILED_OIDC + value: + Message: Operation failed due to an unknown error + Description: An unknown error has occurred, please try again in a few minutes or contact your system admin. + ErrorCode: 950 + Q_REQUIRED: + summary: Q_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The q is a required parameter. + Q_NOT_VALID: + summary: Q_NOT_VALID + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The value of q is not valid. + QUERY_KEY_REQUIRED: + summary: QUERY_KEY_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The query key is a required parameter. + QUERY_VALUE_REQUIRED: + summary: QUERY_VALUE_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The query value is a required parameter. + MULTIPLE_QUERY_PARAMETERS: + value: + ErrorCode: 1277 + Message: Multiple query parameters + Description: Multiple query parameters in request. Please pass any required one. + QUERY_KEY_INDEX_NOT_FOUND: + summary: QUERY_KEY_INDEX_NOT_FOUND + value: + ErrorCode: 1341 + Message: Query key index not found + Description: The specified query key index does not exist, please reach out to LoginRadius support for more information. + USERNAME_NOT_EXISTS: + value: + ErrorCode: 1022 + Message: Username does not exist + Description: The provided username does not exist. Please enter a valid username. + PHONE_NUMBER_LOGIN_ENABLED: + value: + ErrorCode: 1077 + Message: Phone number login is enabled + Description: The phone number login is enabled, so login or get Profile by email ID is unavailable. Please use a verified phone number for login or get Profile. + UID_IS_NOT_VALID: + value: + ErrorCode: 1200 + Message: Uid is not valid + Description: The uid is not valid. The uid can contain alphabets, digits, underscore, and dash only, and its length must be between 1 to 50. + ACCOUNT_ID_IS_ALREADY_REGISTERED: + summary: ACCOUNT_ID_IS_ALREADY_REGISTERED + value: + ErrorCode: 1044 + Message: This account ID is already registered with your site + Description: The account ID has to be unique for your site. Please use a different account ID to process this request. + PRIVACY_POLICY_NOT_VALID: + summary: PRIVACY_POLICY_NOT_VALID + value: + ErrorCode: 1197 + Message: Privacy Policy version is not valid + Description: The Privacy Policy version is not valid. + INVALID_EMAIL: + value: + ErrorCode: 8137 + Message: Invalid email + Description: Invalid email, Please provide valid email. + USERNAME_REQUIRED_CORE: + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The UserName is a required parameter. Please provide a valid UserName to process the request. + INVALID_REQUEST_BODY: + value: + ErrorCode: 1090 + Message: Invalid request body or payload + Description: An error has occurred while parsing the API payload. Please review the request and try again. + SEND_EMAIL_INVALID_PARAMETER: + summary: SEND_EMAIL_INVALID_PARAMETER + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The value 'invalid_value' is not valid for sendemail. + VERIFICATION_TYPE_REQUIRED: + summary: VERIFICATION_TYPE_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The vtype is a required parameter. + VTYPE_INVALID: + summary: VTYPE_INVALID + value: + ErrorCode: 1306 + Message: The vtype is invalid + Description: The provided vtype is invalid, please provide a valid verification type (email). + EXPIRE_IN_INVALID_FORMAT: + summary: EXPIRE_IN_INVALID_FORMAT + value: + Description: Please provide expiry time in number format only. + ErrorCode: 1307 + Message: The expires_in has invalid format + EMAIL_SENDING_FAIL: + value: + ErrorCode: 7921 + Message: Email sending failed + Description: Email was not sent successfully, Please check the settings in your email configuration. + EMAIL_CAN_NOT_NULL: + summary: EMAIL_CAN_NOT_NULL + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The value of email can not be null or empty. + EMAIL_TYPE_AND_VALUE_CAN_NOT_NULL: + summary: EMAIL_TYPE_AND_VALUE_CAN_NOT_NULL + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The type is a required parameter,The value is a required parameter + EMAIL_VALUE_CAN_NOT_NULL: + summary: EMAIL_VALUE_CAN_NOT_NULL + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The value is a required parameter + CAN_NOT_ENFORCE_EMAIL_INVALIDATION: + summary: CAN_NOT_ENFORCE_EMAIL_INVALIDATION + value: + ErrorCode: 1113 + Message: The profile cannot be enforced to invalidate the email verification. + Description: The request could not be processed. There is no email profile associated with this UID, thus the email verification cannot be enforced. + EMAIL_ALREADY_UNVERIFIED: + summary: EMAIL_ALREADY_UNVERIFIED + value: + ErrorCode: 1115 + Message: The profile cannot be enforced to invalidate the email verification. + Description: The request could not be processed. Email already unverified associated with UID, thus cannot enforce email verification. + CAN_NOT_ENFORCE_PHONE_INVALIDATION: + summary: CAN_NOT_ENFORCE_PHONE_INVALIDATION + value: + ErrorCode: 1147 + Message: The profile cannot be enforced to invalidate the phone verification. + Description: The request could not be processed. There is no phone profile associated with UID, so the phone verification cannot be enforced. + PHONE_NUMBER_ALREADY_UNVERIFIED: + summary: PHONE_NUMBER_ALREADY_UNVERIFIED + value: + ErrorCode: 1161 + Message: This phone number is already unverified + Description: This phone number is unverified, cannot invalidate. + SECOND_FACTOR_VALIDATION_TOKEN_REQUIRED: + summary: SECOND_FACTOR_VALIDATION_TOKEN_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The secondfactorvalidationtoken is a required parameter. + SECOND_FACTOR_VERIFICATION_TOKEN_NOT_VALID: + summary: SECOND_FACTOR_VERIFICATION_TOKEN_NOT_VALID + value: + ErrorCode: 1193 + Message: Two factor validation token is invalid + Description: The LoginRadius two factor Validation token is invalid, please use the correct or valid token in order to process this request. + GENERIC_REQUIRED: + summary: GENERIC_REQUIRED + value: + errorCode: 908 + message: A parameter is not formatted correctly + description: A parameter is not formatted correctly in the request, please check all the parameters in the API call. + OAUTH_TOKEN_CONFIG_NOT_FOUND_NATIVE: + summary: OAUTH_TOKEN_CONFIG_NOT_FOUND + value: + errorCode: 2017 + message: Request is invalid + description: Unable to retrieve token configuration for the specified app. + API_SECRET_NOT_VALID_NATIVE: + summary: API_SECRET_NOT_VALID + value: + errorCode: 902 + message: The API secret is unauthorized + description: The provided LoginRadius API secret is invalid or is not authorized, please use a valid or authorized LoginRadius API secret or check the API secret for your LoginRadius account. + ACCESS_TOKEN_NOT_VALID_NATIVE: + summary: ACCESS_TOKEN_NOT_VALID + value: + errorCode: 905 + message: Access token is invalid + description: The LoginRadius access token is invalid, please use the correct or valid access token in order to process this request. + ACCESS_TOKEN_EXPIRED_NATIVE: + summary: ACCESS_TOKEN_EXPIRED + value: + errorCode: 906 + message: Access token has expired + description: The LoginRadius access token has expired, please request a new token from LoginRadius API. + REFRESH_TOKEN_INVALID_NATIVE: + summary: REFRESH_TOKEN_INVALID_NATIVE + value: + errorCode: 1217 + message: Refresh token invalid + description: LoginRadius refresh token is invalid. + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT_NATIVE: + summary: APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT + value: + errorCode: 909 + message: Your LoginRadius site does not have permission to access this endpoint + description: Your LoginRadius site does not have permission to access this endpoint, please contact LoginRadius support for more information. + ENDPOINT_NOT_SUPPORTED_BY_CURRENT_PROVIDER: + summary: ENDPOINT_NOT_SUPPORTED_BY_CURRENT_PROVIDER + value: + errorCode: 910 + message: Endpoint is not supported by the current provider + description: The requested endpoint is not supported by this social identity provider. + PROVIDER_SIDE_ERROR_NATIVE: + summary: PROVIDER_SIDE_ERROR + value: + errorCode: 1000 + message: An error has occurred at the social identity provider’s end. + description: An error has occurred at the social identity provider’s end, please check the ‘providerErrorResponse’ for more details. + DANGEROUS_REQUEST_NATIVE: + summary: DANGEROUS_REQUEST + value: + errorCode: 1214 + message: Dangerous request + description: A potentially dangerous request value was detected. + REQUEST_TOKEN_NOT_VALID_NATIVE: + summary: REQUEST_TOKEN_NOT_VALID + value: + errorCode: 903 + message: Request token is invalid + description: The LoginRadius request token is invalid, please check the POST request on your callback page and the token field in the request. + REQUEST_TOKEN_EXPIRED: + summary: REQUEST_TOKEN_EXPIRED + value: + errorCode: 904 + message: Request token has expired + description: The LoginRadius request token has expired, please request a new token from LoginRadius API. + API_KEY_REQUIRED_NATIVE: + summary: API_KEY_REQUIRED + value: + errorCode: 922 + message: API key is missing + description: The request is missing the API key, please use the valid API key parameter in order to process this request. + API_SECRET_REQUIRED_NATIVE: + summary: API_SECRET_REQUIRED + value: + errorCode: 923 + message: API secret is missing + description: The request is missing the API secret, please use the valid API secret parameter in order to process this request. + API_SECRET_NOT_WELL_FORMATTED_NATIVE: + summary: API_SECRET_NOT_WELL_FORMATTED + value: + errorCode: 921 + message: API secret is invalid + description: The provided LoginRadius API secret is invalid, please use a valid API secret of your LoginRadius account. + API_KEY_NOT_WELL_FORMATTED_NATIVE: + summary: API_KEY_NOT_WELL_FORMATTED + value: + errorCode: 920 + message: API key is invalid + description: The provided LoginRadius API key is invalid, please use a valid API key of your LoginRadius account. + API_KEY_NOT_VALID_NATIVE: + summary: API_KEY_NOT_VALID + value: + errorCode: 901 + message: The API key is unauthorized + description: The provided LoginRadius API key is invalid or is not authorized, please use a valid or authorized LoginRadius API key or check the API key for your LoginRadius account. + PROFILE_ID_MISSING: + summary: PROFILE_ID_MISSING + value: + errorCode: 1061 + message: Profile ID is missing + description: This request is missing the Profile ID, please use a valid Profile ID parameter in order to process this request. + USER_ID_NOT_VALID_NATIVE: + summary: USER_ID_NOT_VALID + value: + errorCode: 937 + message: User ID is invalid + description: The user ID is invalid, please use a valid user ID in order to process this request. + ACCOUNT_ID_REQUIRED: + summary: ACCOUNT_ID_REQUIRED + value: + errorCode: 1037 + message: Account ID is required + description: The account ID is required, please use a valid account ID in order to process this request. + ACCOUNT_ID_IS_INVALID_NATIVE: + summary: ACCOUNT_ID_IS_INVALID + value: + errorCode: 984 + message: Account ID is invalid + description: This Account ID is invalid, please use valid account ID. + ACTIVE_TOKEN_NOT_EXISTS: + summary: ACTIVE_TOKEN_NOT_EXISTS + value: + errorCode: 1055 + message: Session has expired + description: The LoginRadius session token has expired, there is no current active session for this user. + ACCESS_TOKEN_REQUIRED_OIDC: + summary: ACCESS_TOKEN_REQUIRED + value: + errorCode: 1060 + message: Access token is missing + description: This request is missing the access token, please use the valid access token parameter in order to process this request. + JWTAPP_PROVIDER_REQUIRED: + summary: JWTAPP_PROVIDER_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The providername is a required parameter. + PROVIDER_NAME_REQUIRED: + summary: PROVIDER_NAME_REQUIRED + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The providerName is a required parameter. + API_KEY_REQUIRED_PROVIDER: + summary: API_KEY_REQUIRED_PROVIDER + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The apikey is a required parameter. + PROVIDER_NAME_NOT_VALID: + summary: PROVIDER_NAME_NOT_VALID + value: + ErrorCode: 912 + Message: Provider is not valid + Description: The provider name is invalid, please use a valid provider name. + INVITATION_ID_REQUIRED: + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The invitation id is required. + INVALID_INVITATION_ID: + value: + ErrorCode: 8175 + Message: The invitation id/token is invalid + Description: The invitation id is invalid. Please enter a valid invitation id. + B2B_NOT_ENABLED: + summary: B2B_NOT_ENABLED + value: + Description: The B2B feature is not enabled or configured for your app. Please contact LoginRadius support for more information. + ErrorCode: 1267 + Message: B2B feature is not enabled or not configured properly + UNAUTHORIZED_ACCESS: + value: + Message: Access Unauthorized + Description: Access Unauthorized, please use valid authorization to access this endpoint. + ErrorCode: 6002 + ORGANIZATION_NOT_FOUND_PARTNER: + summary: ORGANIZATION_NOT_FOUND_PARTNER + value: + Description: The entered organization or its configuration does not exist. + ErrorCode: 8118 + Message: Organization not found + INVALID_JSON_BODY: + value: + ErrorCode: 8044 + Message: Invalid Body + Description: BodyType is selected as JSON, but the Body doesn't contain valid JSON data. Please input valid JSON data. + JSON_PUT_BODY_REQUIRED_PARTNER: + summary: JSON_PUT_BODY_REQUIRED_PARTNER + value: + Message: Put body is invalid or empty + Description: Please use a valid put body in JSON format in order to process this request. + ErrorCode: 7934 + ROLE_OR_RESEND_EMAIL_REQUIRED: + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The RoleIds or ResendEmail field is required. Please enter at least one field. + INVALID_INVITATION_URL: + value: + ErrorCode: 8176 + Message: The Invitation URL is invalid + Description: The Invitation is invalid, please whitelist the url. + INVITATION_ACCEPTED: + value: + ErrorCode: 8175 + Message: The invitation id/token is invalid + Description: This invitation id/token is accepted. Please enter a valid invitation id/token. + INVITATION_EXPIRED: + value: + ErrorCode: 8175 + Message: The invitation id/token is invalid + Description: This invitation id/token is expired. Please enter a valid invitation id/token. + INVITATION_REVOKED: + value: + ErrorCode: 8175 + Message: The invitation id/token is invalid + Description: This invitation id/token is revoked. Please enter a valid invitation id/token. + INVALID_ROLE_ID: + value: + Description: Invalid Role id, Please provide valid Role id. + ErrorCode: 8124 + Message: Invalid Role id + INVALID_INVITER_UID: + value: + ErrorCode: 8174 + Message: Inviter uid invalid or inviter does not exist/active + Description: Inviter uid invalid or inviter does not exist/active, Please provide the valid inviter uid. + ROLE_NOT_EXIST: + value: + ErrorCode: 8125 + Message: Role does not exist + Description: Role does not exist, Please provide valid Role id. + ORGANIZATION_ID_REQUIRED: + value: + ErrorCode: 8129 + Message: Organization id is required + Description: Organization id is required, Please provide organization id. + ORGANIZATION_ID_INVALID: + value: + Description: This Organization ID is invalid, please use valid Organization ID. + ErrorCode: 8117 + Message: Organization ID is invalid + JSON_POST_BODY_REQUIRED: + value: + ErrorCode: 7914 + Message: Post body is invalid + Description: Please use a valid post body in JSON format. + SEND_INVITATION_REQUIRED: + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly + Description: The OrgId, InviterUid, EmailId, RoleIds are required. + INVITATION_ALREADY_ACTIVE: + value: + ErrorCode: 8171 + Message: invitation is active + Description: Invitation is already active, Can not send the invite again. + USER_EXISTS_IN_ORG: + value: + ErrorCode: 8170 + Message: User already exist in an organization + Description: User already exist in an organization, Please provide correct email id. + DOMAIN_DUPLICATE: + value: + Description: The Domain is already in use. Please enter a valid Domain. + ErrorCode: 7900 + Message: A parameter is not formatted correctly. + DOMAIN_NAME_INVALID: + value: + Description: The DomainName is invalid. Please enter a valid DomainName. + ErrorCode: 7900 + Message: A parameter is not formatted correctly. + DOMAIN_SPAM_OR_GENERIC_DOMAIN: + value: + Description: The Domain is a spam or generic domain. Please enter a valid Domain. + ErrorCode: 7900 + Message: A parameter is not formatted correctly. + NAME_REQUIRED: + value: + Description: The Name is required. Please enter a valid Name. + ErrorCode: 7900 + Message: A parameter is not formatted correctly. + TRIAL_PLAN_ORG_LIMIT_REACHED: + value: + Message: Organization creation limit reached for the trial plan + Description: The trial plan organization creation limit has been reached. Upgrade your plan to create more organizations. + ErrorCode: 8188 + ORGANIZATION_ALREADY_EXIST: + value: + Description: Organization exists with the same name. Use a different organization name. + ErrorCode: 8116 + Message: Organization exists with the same name + ORGANIZATION_DOMAIN_ALREADY_EXIST: + value: + Description: Domain exists with the same name. Use a different Domain name. + ErrorCode: 8157 + Message: Domain exists with the same name + ORGANIZATION_MEMBER_ROLE_NOT_VALID: + value: + Description: This Organization member Role is invalid, please use valid Organization member Role + ErrorCode: 8159 + Message: Organization member Role is invalid + STATUS_UPDATE_INVALID: + value: + Description: Status update is invalid, Please provide valid status. + ErrorCode: 8167 + Message: Status update is invalid + ORGANIZATION_DOMAIN_CAN_NOT_DELETED: + value: + Description: Organization domain can not be deleted, domain is currently being used in a connection. + ErrorCode: 8178 + Message: Organization domain can not be deleted + ORGANIZATION_JIT_POLICY_NOT_ALLOWED: + value: + Description: Just-In-Time (JIT) provisioning is not allowed because there are no active connections configured for this organization. Please check your organization settings. + ErrorCode: 8181 + Message: JIT policy not allowed in organization + ORGANIZATION_MFA_ENFORCEMENT_NOT_ALLOWED: + value: + Description: Organization MFA enforcement can not be enabled because MFA is disabled for the tenant. + ErrorCode: 8160 + Message: Organization MFA enforcement not allowed + ORGANIZATION_MFA_NONE_ENFORCEMENT_NOT_ALLOWED: + value: + Description: Organization MFA enforcement can not be disabled because MFA is enabled for the tenant. + ErrorCode: 8160 + Message: Organization MFA enforcement not allowed + ORGANIZATION_MFA_ENFORCEMENT_ONLY_FORCE_ALLOWED: + value: + Description: MFA enforcement must be set to 'Force' because this tenant has a mandatory MFA flow configured. + ErrorCode: 8160 + Message: Organization MFA enforcement not allowed + ORGANIZATION_MFA_FORCE_AUTHENTICATORS_DISABLED: + value: + Description: To enable 'force' MFA enforcement, at least one MFA authenticator method must be enabled for this tenant. + ErrorCode: 8160 + Message: Organization MFA enforcement not allowed + ORGANIZATION_ENABLE_MFA_ENFORCEMENT_NOT_ALLOWED: + value: + Description: Organization MFA enforcement can not be enabled because MFA is disabled for the tenant. + ErrorCode: 8160 + Message: Organization MFA enforcement not allowed + ORGANIZATION_DISABLE_MFA_ENFORCEMENT_NOT_ALLOWED: + value: + Description: Organization MFA enforcement can not be disabled because MFA is enabled for the tenant. + ErrorCode: 8160 + Message: Organization MFA enforcement not allowed + CONNECTION_DOMAIN_ALREADY_EXIST: + value: + Description: The domain is associated with a different connection. Please use a different organization domain. + ErrorCode: 8149 + Message: Domain exists with another connection + STATUS_UPDATED_ALREADY: + value: + Description: Status already updated, Please provide valid status. + ErrorCode: 8166 + Message: Status already updated + CONNECTION_TYPE_INVALID: + value: + Description: The ConnectionType is invalid. Please enter a valid ConnectionType. + ErrorCode: 7900 + Message: A parameter is not formatted correctly. + CONNECTION_TYPE_REQUIRED: + value: + Description: The ConnectionType is required. Please enter a valid ConnectionType. + ErrorCode: 7900 + Message: A parameter is not formatted correctly. + CUSTOM_MAPPING_INVALID: + value: + Description: The CustomMapping provided is invalid. Please enter a valid CustomMapping. + ErrorCode: 7900 + Message: A parameter is not formatted correctly. + NAME_INVALID: + value: + Description: Invalid Name. It must be alphanumeric, hyphens (-), underscores (_), not start/end with hyphen/underscore, and max length 60. + ErrorCode: 7900 + Message: A parameter is not formatted correctly. + OIDC_IDP_ISSUER_INVALID: + value: + Description: The provided Identity Provider (IdP) issuer is invalid. Please verify the Issuer + ErrorCode: 7900 + Message: A parameter is not formatted correctly. + CONN_SAML_IDP_CERTIFICATE_INVALID: + value: + Description: The IdpCertificate is invalid. Please enter a valid IdpCertificate. + ErrorCode: 7900 + Message: A parameter is not formatted correctly. + SAML_METADATA_ENDPOINT_INVALID: + value: + Description: The provided SAML metadata endpoint is invalid or not accessible. Please verify the IDPMetadataURL + ErrorCode: 7900 + Message: A parameter is not formatted correctly. + ORGANIZATION_DOMAIN_NOT_VERIFIED: + value: + Description: Organization domain is not verified, Please verify the domain. + ErrorCode: 8177 + Message: Organization domain is not verified + ORGANIZATION_DOMAIN_NOT_EXIST: + value: + Description: The provided domain is not associated with the organization. Please use a different organization domain. + ErrorCode: 8150 + Message: Domain does not exist within the organization + CONNECTION_ALREADY_EXIST: + value: + Description: Connection exists with the same name. Use a different Connection name. + ErrorCode: 8148 + Message: Connection exists with the same name + CONNECTION_ID_INVALID: + value: + Description: This Connection ID is invalid, please use valid Connection ID. + ErrorCode: 8151 + Message: Connection ID is invalid + GROUP_ROLE_GROUP_ID_REQUIRED: + value: + Description: The GroupId is required. Please enter a valid GroupId. + ErrorCode: 7900 + Message: A parameter is not formatted correctly. + GROUP_ROLE_ROLE_ID_INVALID: + value: + Description: The RoleId is invalid. Please enter a valid RoleId. + ErrorCode: 7900 + Message: A parameter is not formatted correctly. + GROUP_ROLE_ROLE_ID_REQUIRED: + value: + Description: The RoleId is required. Please enter a valid RoleId. + ErrorCode: 7900 + Message: A parameter is not formatted correctly. + GROUP_ROLE_NAME_ALREADY_EXIST: + value: + Description: Connection GroupRole exists with the same name. Use a Connection GroupRole name. + ErrorCode: 8161 + Message: GroupRole exists with the same name + GROUP_ROLE_GROUP_ID_ALREADY_EXIST: + value: + Description: Connection GroupRole exists with the same GroupId. Use a different GroupRole GroupId. + ErrorCode: 8162 + Message: GroupRole exists with the same GroupId + GROUP_ROLE_ID_INVALID: + value: + Description: This GroupRole ID is invalid, Please use a valid GroupRole ID. + ErrorCode: 8164 + Message: GroupRole ID is invalid + GROUP_ROLE_NOT_EXIST: + value: + Description: This GroupRole ID is not exist, Please use a valid GroupRole ID. + ErrorCode: 8163 + Message: GroupRole ID not exist + ORGANIZATION_DOMAIN_ID_INVALID: + value: + Description: This Domain ID is invalid, please use valid Domain ID. + ErrorCode: 8154 + Message: Domain ID is invalid + ORGANIZATION_DOMAIN_NAME_INVALID: + value: + Description: The DomainName is invalid. Please enter a valid DomainName. + ErrorCode: 7900 + Message: A parameter is not formatted correctly. + DOMAIN_TXT_RECORD_FAILED: + value: + Description: Unable to fetch the Domain TXT record. Please ensure the domain is valid and correctly configured. + ErrorCode: 8168 + Message: Failed to fetch Domain TXT record + ORGANIZATION_DOMAIN_ALREADY_VERIFY: + value: + Description: This Organization domain is already verified + ErrorCode: 8156 + Message: Domain already verified + PARAMETER_NOT_WELL_FORMATTED_REQUIRED: + value: + Message: A parameter is not formatted correctly. + Description: The parameter is not formatted correctly, please check all the parameters in the API call + ErrorCode: 7900 + INVALID_ID: + value: + Message: Invalid ID + Description: Invalid ID, please provide a valid ID. + ErrorCode: 8080 + DUPLICATE_PERMISSION_NAME: + value: + ErrorCode: 8120 + Message: Duplicate Permission name + Description: Duplicate Permission name, Please provide valid Permission name. + PERMISSION_ID_REQUIRED: + value: + ErrorCode: 8122 + Message: Permission id is required + Description: Permission id is required, Please provide Permission id. + PERMISSION_ID_INVALID: + value: + ErrorCode: 8119 + Message: Invalid Permission id + Description: Invalid Permission id, Please provide valid Permission id. + NAME_NOT_ALLOWED_TO_UPDATE: + value: + ErrorCode: 8231 + Message: Name field is not allowed to update + Description: Name field is not allowed to update. Please use the same name value in update request. + INVALID_BODY_JSON: + value: + Message: Invalid Body + Description: BodyType is selected as JSON, but the Body doesn't contain valid JSON data. Please input valid JSON data. + ErrorCode: 8044 + DUPLICATE_ROLE_NAME: + value: + ErrorCode: 8123 + Message: Duplicate Role name + Description: Duplicate Role name, Please provide valid Role name. + ROLE_ID_REQUIRED: + value: + ErrorCode: 8126 + Message: Role id is required + Description: Role id is required, Please provide Role id. + DEFAULT_ROLE_CANNOT_BE_DELETED: + value: + ErrorCode: 8128 + Message: Default Role cannot be deleted + Description: Default Role cannot be deleted, Please provide valid Role id. + ROLE_NAME_REQUIRED: + value: + ErrorCode: 8127 + Message: Role name is required + Description: Role name is required, Please provide Role name. + ROLE_DOES_NOT_BELONGS_TO_TENANT: + value: + ErrorCode: 8143 + Message: Role does not belong to tenant + Description: Role does not belong to tenant, Please provide valid Role id. + USER_ID_REQUIRED: + value: + ErrorCode: 8131 + Message: User id is required + Description: User id is required, Please provide user id. + USER_DOES_NOT_EXISTS: + value: + ErrorCode: 8132 + Message: User does not exist + Description: User does not exist, Please provide valid user id. + USER_NOT_FOUND_IN_ORG: + value: + Description: User not found in organization, Please provide valid user id. + ErrorCode: 8135 + Message: User not found in organization + ROLE_DOES_NOT_BELONGS_TO_ORG: + value: + ErrorCode: 8142 + Message: Role does not belong to organization + Description: Role does not belong to organization, Please provide valid Role id. + B2B_EMAIL_NOT_AVAILABLE: + summary: B2B_EMAIL_NOT_AVAILABLE + value: + ErrorCode: 8045 + Message: Email is missing + Description: Cannot assign Role to the user in the organization because the email is not available for the user. Please provide a valid uid. + USER_ROLE_ALREADY_EXISTS: + value: + ErrorCode: 8130 + Message: User Role already exists + Description: User Role already exists, Please provide valid Role id. + PARAMETER_NOT_WELL_FORMATTED: + value: + Message: A parameter is not formatted correctly. + Description: A parameter is not formatted correctly in the request, please check all the parameters in the API call + ErrorCode: 7900 + SOTT_NOT_FOUND: + value: + Message: SOTT not found + Description: SOTT not found or the resource does not exist. + ErrorCode: 8068 + TECHNOLOGY_SELECTION_INVALID: + value: + Message: Sott configuration is invalid + Description: Technology selection is invalid, Please provide valid value. + ErrorCode: 8101 + IDENTITY_ORCHESTRATION_NOT_ENABLED: + value: + ErrorCode: 8070 + Message: Workflows are not enabled for this app/site. + Description: The request cannot be processed. Please enable workflows and try again to proceed with this request. + WORKFLOW_CONFIG_NOT_FOUND: + value: + Message: Workflow config not found. + Description: Workflow config not found, Please configure the workflow config. + ErrorCode: 8033 + WORKFLOW_PAYLOAD: + value: + Name: mfa-auth + ThemeName: default + Data: + edges: + - id: reactflow__edge-6799ebff-ab72-4ebd-869b-65672bd0a799true-SuccessFinalNode + markerEnd: + color: '#30b3ff' + type: arrowclosed + selected: 'false' + source: 6799ebff-ab72-4ebd-869b-65672bd0a799 + sourceHandle: 'true' + style: + stroke: '#30b3ff' + strokeWidth: '1' + target: SuccessFinalNode + targetHandle: null + type: smoothstep + - id: reactflow__edge-6799ebff-ab72-4ebd-869b-65672bd0a799false-FailureFinalNode + markerEnd: + color: '#30b3ff' + type: arrowclosed + selected: 'false' + source: 6799ebff-ab72-4ebd-869b-65672bd0a799 + sourceHandle: 'false' + style: + stroke: '#30b3ff' + strokeWidth: '1' + target: FailureFinalNode + targetHandle: null + type: smoothstep + - id: reactflow__edge-e0e82eb2-ee65-4a6b-ab25-3e6c6dcb2913false-1eb72cc9-7a2c-44f7-817d-00a94a9c1a24 + markerEnd: + color: '#30b3ff' + type: arrowclosed + selected: 'false' + source: e0e82eb2-ee65-4a6b-ab25-3e6c6dcb2913 + sourceHandle: 'false' + style: + stroke: '#30b3ff' + strokeWidth: '1' + target: 1eb72cc9-7a2c-44f7-817d-00a94a9c1a24 + targetHandle: null + type: smoothstep + - id: reactflow__edge-1eb72cc9-7a2c-44f7-817d-00a94a9c1a24authenticator-ac8ae2f4-48b9-4c35-bd68-4cbf11730b8b + markerEnd: + color: '#30b3ff' + type: arrowclosed + selected: 'false' + source: 1eb72cc9-7a2c-44f7-817d-00a94a9c1a24 + sourceHandle: authenticator + style: + stroke: '#30b3ff' + strokeWidth: '1' + target: ac8ae2f4-48b9-4c35-bd68-4cbf11730b8b + targetHandle: null + type: smoothstep + - id: reactflow__edge-ac8ae2f4-48b9-4c35-bd68-4cbf11730b8bfalse-FailureFinalNode + markerEnd: + color: '#30b3ff' + type: arrowclosed + selected: 'false' + source: ac8ae2f4-48b9-4c35-bd68-4cbf11730b8b + sourceHandle: 'false' + style: + stroke: '#30b3ff' + strokeWidth: '1' + target: FailureFinalNode + targetHandle: null + type: smoothstep + - id: reactflow__edge-initialNodeoutput-dd8723a2-afc1-4529-a0a6-2c0712af3e65 + markerEnd: + color: '#30b3ff' + type: arrowclosed + selected: 'false' + source: initialNode + sourceHandle: output + style: + stroke: '#30b3ff' + strokeWidth: '1' + target: dd8723a2-afc1-4529-a0a6-2c0712af3e65 + targetHandle: null + type: smoothstep + - id: reactflow__edge-dd8723a2-afc1-4529-a0a6-2c0712af3e65output-b92fb05a-578a-4097-aec0-2df33b4c27a0 + markerEnd: + color: '#30b3ff' + type: arrowclosed + selected: 'false' + source: dd8723a2-afc1-4529-a0a6-2c0712af3e65 + sourceHandle: output + style: + stroke: '#30b3ff' + strokeWidth: '1' + target: b92fb05a-578a-4097-aec0-2df33b4c27a0 + targetHandle: null + type: smoothstep + - id: reactflow__edge-b92fb05a-578a-4097-aec0-2df33b4c27a0true-e0e82eb2-ee65-4a6b-ab25-3e6c6dcb2913 + markerEnd: + color: '#30b3ff' + type: arrowclosed + selected: 'false' + source: b92fb05a-578a-4097-aec0-2df33b4c27a0 + sourceHandle: 'true' + style: + stroke: '#30b3ff' + strokeWidth: '1' + target: e0e82eb2-ee65-4a6b-ab25-3e6c6dcb2913 + targetHandle: null + type: smoothstep + - id: reactflow__edge-b92fb05a-578a-4097-aec0-2df33b4c27a0false-FailureFinalNode + markerEnd: + color: '#30b3ff' + type: arrowclosed + selected: 'false' + source: b92fb05a-578a-4097-aec0-2df33b4c27a0 + sourceHandle: 'false' + style: + stroke: '#30b3ff' + strokeWidth: '1' + target: FailureFinalNode + targetHandle: null + type: smoothstep + - id: reactflow__edge-ac8ae2f4-48b9-4c35-bd68-4cbf11730b8btrue-4fd9fc82-5cc5-4410-94c7-cc8ac301a31e + markerEnd: + color: '#30b3ff' + type: arrowclosed + selected: 'false' + source: ac8ae2f4-48b9-4c35-bd68-4cbf11730b8b + sourceHandle: 'true' + style: + stroke: '#30b3ff' + strokeWidth: '1' + target: 4fd9fc82-5cc5-4410-94c7-cc8ac301a31e + targetHandle: null + type: smoothstep + - id: reactflow__edge-e0e82eb2-ee65-4a6b-ab25-3e6c6dcb2913authenticator-4fd9fc82-5cc5-4410-94c7-cc8ac301a31e + markerEnd: + color: '#30b3ff' + type: arrowclosed + selected: 'false' + source: e0e82eb2-ee65-4a6b-ab25-3e6c6dcb2913 + sourceHandle: authenticator + style: + stroke: '#30b3ff' + strokeWidth: '1' + target: 4fd9fc82-5cc5-4410-94c7-cc8ac301a31e + targetHandle: null + type: smoothstep + - id: reactflow__edge-4fd9fc82-5cc5-4410-94c7-cc8ac301a31eoutput-6799ebff-ab72-4ebd-869b-65672bd0a799 + markerEnd: + color: '#30b3ff' + type: arrowclosed + selected: 'false' + source: 4fd9fc82-5cc5-4410-94c7-cc8ac301a31e + sourceHandle: output + style: + stroke: '#30b3ff' + strokeWidth: '1' + target: 6799ebff-ab72-4ebd-869b-65672bd0a799 + targetHandle: null + type: smoothstep + innerNodes: + 46d6674e-bbc6-44bc-951f-98cffd6441b6: + data: + description: Displays the option to field to enter TOTP (when Authenticator is already configured). + label: Authenticator Input + properties: null + dragging: 'false' + extent: parent + height: '50' + hidden: 'true' + id: 46d6674e-bbc6-44bc-951f-98cffd6441b6 + isChildNode: 'true' + nodes: null + parentNode: 4fd9fc82-5cc5-4410-94c7-cc8ac301a31e + position: + x: '290.33256209500405' + 'y': '-206.97348008280136' + positionAbsolute: + x: '290.33256209500405' + 'y': '-206.97348008280136' + selected: 'false' + type: authenticatorinput + width: '150' + a655db76-8831-411b-82f5-1be2784e4a78: + data: + description: Prompts the user to enter the email and stores the input. It is used with the Web Page node. + label: Email + properties: + - elementType: emailonlyasinput + id: '1' + label: Email Only as Input + type: checkbox + value: 'false' + - elementType: isprimary + id: '2' + label: Is Primary + primaryParentId: '1' + type: checkbox + value: 'true' + - elementType: emailtype + id: '3' + label: Email Type + primaryParentId: '1' + secondaryParentId: '2' + type: text + value: '' + - elementType: rules + id: '4' + label: Validation String + primaryParentId: '1' + type: text + value: '' + draggable: 'true' + dragging: 'false' + extent: parent + height: '50' + hidden: 'true' + id: a655db76-8831-411b-82f5-1be2784e4a78 + isChildNode: 'true' + nodes: null + parentNode: dd8723a2-afc1-4529-a0a6-2c0712af3e65 + position: + x: '-499.8966093003752' + 'y': '-455.39881839572' + positionAbsolute: + x: '-499.8966093003752' + 'y': '-455.39881839572' + selected: 'false' + type: email + width: '150' + fff21a66-437c-4a8a-96e0-744efaff8d87: + data: + description: Prompts the user to enter their password and stores the input. This node is to be used for entering the password during registration, login, password update and password forget etc. It is used with the Web Page node. + label: Password + properties: + - elementType: passwordonlyasinput + id: '1' + label: Password Only as Input + tag: password + type: checkbox + value: 'false' + - elementType: oldpassword + id: '2' + label: Old Password + primaryParentId: '1' + tag: password + type: checkbox + value: 'false' + - elementType: newpassword + id: '3' + label: New Password + primaryParentId: '1' + tag: password + type: checkbox + value: 'false' + - elementType: confirmpassword + id: '4' + label: Confirm Password + primaryParentId: '1' + tag: password + type: checkbox + value: 'false' + - elementType: validatepassword + id: '5' + label: Validate Password + primaryParentId: '1' + tag: policy + type: checkbox + value: 'false' + draggable: 'true' + dragging: 'false' + extent: parent + height: '50' + hidden: 'true' + id: fff21a66-437c-4a8a-96e0-744efaff8d87 + isChildNode: 'true' + nodes: null + parentNode: dd8723a2-afc1-4529-a0a6-2c0712af3e65 + position: + x: '-480.96896447653376' + 'y': '-480.2413522270118' + positionAbsolute: + x: '-480.96896447653376' + 'y': '-480.2413522270118' + selected: 'false' + type: password + width: '150' + nodes: + 1eb72cc9-7a2c-44f7-817d-00a94a9c1a24: + data: + description: 'Define the MFA flow (mandatory or optional), settings and method(s) for all users. To let users register/configure the MFA method from the available method(s) on login. ' + label: Configure MFA + properties: + - elementType: mfaflow + id: '1' + label: MFA Flow + options: + - text: Mandatory + value: Mandatory + - text: Optional + value: Optional + required: 'true' + type: select + value: Mandatory + - elementType: message + id: '2' + label: Message + required: 'true' + type: text + value: Authenticator + - elementType: mfamethods + id: '3' + label: MFA Methods + options: + - checked: 'false' + text: Authenticator + value: Authenticator + - checked: 'false' + text: Security Question + value: Security Question + - checked: 'false' + text: Email OTP + value: Email OTP + - checked: 'false' + text: SMS OTP + value: SMS OTP + outputSelector: 'true' + required: 'true' + type: multiselect + value: + - Authenticator + - elementType: authenticatorbuttontext + id: '4' + label: Authenticator Button Text + parentPropertyId: '3' + parentPropertyValue: Authenticator + required: 'true' + type: text + value: Configure Authenticator + - elementType: securityquestionbuttontext + id: '5' + label: Security Question Button Text + parentPropertyId: '3' + parentPropertyValue: Security Question + required: 'true' + type: text + value: '' + - elementType: emailotpbuttontext + id: '6' + label: Email OTP Button Text + parentPropertyId: '3' + parentPropertyValue: Email OTP + required: 'true' + type: text + value: '' + - elementType: smsotpbuttontext + id: '7' + label: SMS OTP Button Text + parentPropertyId: '3' + parentPropertyValue: SMS OTP + required: 'true' + type: text + value: '' + dragging: 'false' + height: '130' + id: 1eb72cc9-7a2c-44f7-817d-00a94a9c1a24 + nodes: null + output: + - displayName: EmailOTP + id: emailotp + - displayName: SMSOTP + id: smsotp + - displayName: Authenticator + id: authenticator + - displayName: SecurityQuestion + id: securityquestion + - displayName: Skip + id: skip + - displayName: 'False' + id: 'false' + position: + x: '-189.86368278693385' + 'y': '-453.57986075944297' + positionAbsolute: + x: '-189.86368278693385' + 'y': '-453.57986075944297' + selected: 'false' + type: configuremfa + width: '164' + 4fd9fc82-5cc5-4410-94c7-cc8ac301a31e: + data: + description: Combines multiple nodes that request input into a single page for display to the user. Drag and drop nodes onto the web page node to combine them. + label: Web Page + properties: + - elementType: title + id: '1' + label: Web Page Header + required: 'true' + type: text + value: Authenticator Code + - elementType: description + id: '2' + label: Web Page Description + required: 'true' + type: text + value: Enter the Authenticator Code + - elementType: buttontext + id: '3' + label: Submit Button Text + required: 'true' + type: text + value: Verify + - elementType: footer + id: '4' + label: Web Page Footer + required: 'true' + type: text + value: LoginRadius + - elementType: buttons + id: '5' + label: Buttons + type: buttons + value: null + dragging: 'false' + height: '114' + id: 4fd9fc82-5cc5-4410-94c7-cc8ac301a31e + nodes: + - data: + label: Authenticator Input + id: 46d6674e-bbc6-44bc-951f-98cffd6441b6 + isChildNode: 'true' + type: authenticatorinput + output: + - displayName: output + id: output + position: + x: '276.136828477123' + 'y': '-237.73090292154373' + positionAbsolute: + x: '276.136828477123' + 'y': '-237.73090292154373' + selected: 'false' + type: webpage + width: '230' + 6799ebff-ab72-4ebd-869b-65672bd0a799: + data: + description: Verifies if the entered TOTP for authenticator is valid or not. + label: Verify Authenticator + properties: null + dragging: 'false' + height: '90' + id: 6799ebff-ab72-4ebd-869b-65672bd0a799 + nodes: null + output: + - displayName: 'True' + id: 'true' + - displayName: 'False' + id: 'false' + position: + x: '616.5127762283203' + 'y': '-370.34395454050144' + positionAbsolute: + x: '616.5127762283203' + 'y': '-370.34395454050144' + selected: 'false' + type: verifyauthenticatortotp + width: '164' + FailureFinalNode: + data: + description: 'Denotes that the workflow ended at failure. ' + label: Failure + properties: + - id: '1' + label: Redirect URL + type: text + value: '' + dragging: 'false' + height: '40' + id: FailureFinalNode + nodes: null + position: + x: '868.1393360508125' + 'y': '-6.556228920048781' + positionAbsolute: + x: '868.1393360508125' + 'y': '-6.556228920048781' + selected: 'false' + type: finalNegative + width: '40' + SuccessFinalNode: + data: + description: 'Denotes that the workflow ended in success. ' + label: Success + properties: + - id: '1' + label: Redirect URL + type: text + value: '' + dragging: 'false' + height: '40' + id: SuccessFinalNode + nodes: null + position: + x: '870.7506472583059' + 'y': '-346.426228223721' + positionAbsolute: + x: '870.7506472583059' + 'y': '-346.426228223721' + selected: 'false' + type: finalPositive + width: '40' + ac8ae2f4-48b9-4c35-bd68-4cbf11730b8b: + data: + description: To configure the Authenticator method while setting up MFA. Businesses can also customize the labels and descriptions that will be displayed on the Authenticator screen. + label: Configure Authenticator + properties: + - elementType: issuerid + id: '1' + label: Issuer ID + required: 'true' + type: text + value: LR + - elementType: qrcodewidth + id: '2' + label: QR Code Width + required: 'true' + type: text + value: '200' + - elementType: qrcodeheight + id: '3' + label: QR Code Height + required: 'true' + type: text + value: '200' + - elementType: displaygetapp + id: '4' + label: Display Get App + type: checkbox + value: 'false' + - elementType: getapptext + id: '5' + label: Get App Text + parentPropertyId: '4' + parentPropertyValue: 'true' + required: 'true' + type: text + value: '' + - elementType: getapplink + id: '6' + label: Get App Link + parentPropertyId: '4' + parentPropertyValue: 'true' + required: 'true' + type: text + value: '' + - elementType: googleauthenticatorlabel + id: '7' + label: Authenticator label + required: 'true' + type: text + value: Configure Authenticator + - elementType: googleauthenticatordescription + id: '8' + label: Authenticator Description + required: 'true' + type: text + value: Configure authenticator to use MFA + - elementType: defaultbuttontext + id: '9' + label: Default Button Text + required: 'true' + type: text + value: Authenticator + dragging: 'false' + height: '90' + id: ac8ae2f4-48b9-4c35-bd68-4cbf11730b8b + nodes: null + output: + - displayName: 'True' + id: 'true' + - displayName: 'False' + id: 'false' + position: + x: '39.63816595865569' + 'y': '-491.36370171146075' + positionAbsolute: + x: '39.63816595865569' + 'y': '-491.36370171146075' + selected: 'false' + type: configureauthenticator + width: '164' + b92fb05a-578a-4097-aec0-2df33b4c27a0: + data: + description: Verifies if the authentication is successful or not, along with other statutes such as account locked, password expired. + label: Auth + properties: + - elementType: accesstoken + id: '1' + label: Access Token + readOnly: 'true' + type: checkbox + value: 'true' + - elementType: sessiontoken + id: '2' + label: Session Token + type: checkbox + value: 'false' + - elementType: authvalidation + id: '3' + label: Auth Validation + options: + - text: Email Unverified + value: emailunverified + - text: Phone Unverified + value: phoneunverified + - text: Password Expired + value: passwordexpired + - text: Account Locked + value: accountlocked + type: multiselect + value: null + height: '90' + id: b92fb05a-578a-4097-aec0-2df33b4c27a0 + nodes: null + output: + - displayName: 'True' + id: 'true' + - displayName: 'False' + id: 'false' + - displayName: Account Locked + id: accountlocked + - displayName: Password Expired + id: passwordexpired + - displayName: Email Unverified + id: emailunverified + - displayName: Phone Unverified + id: phoneunverified + position: + x: '-215.98193694275392' + 'y': '-66.19912170548083' + selected: 'false' + type: auth + width: '164' + dd8723a2-afc1-4529-a0a6-2c0712af3e65: + data: + description: Combines multiple nodes that request input into a single page for display to the user. Drag and drop nodes onto the web page node to combine them. + label: Web Page + properties: + - elementType: title + id: '1' + label: Web Page Header + required: 'true' + type: text + value: MFA Authenticator + - elementType: description + id: '2' + label: Web Page Description + required: 'true' + type: text + value: MFA Authenticator Flow + - elementType: buttontext + id: '3' + label: Submit Button Text + required: 'true' + type: text + value: Submit + - elementType: footer + id: '4' + label: Web Page Footer + required: 'true' + type: text + value: LoginRadius + - elementType: buttons + id: '5' + label: Buttons + type: buttons + value: null + dragging: 'false' + height: '158' + id: dd8723a2-afc1-4529-a0a6-2c0712af3e65 + nodes: + - data: + label: Email + id: a655db76-8831-411b-82f5-1be2784e4a78 + isChildNode: 'true' + type: email + - data: + label: Password + id: fff21a66-437c-4a8a-96e0-744efaff8d87 + isChildNode: 'true' + type: password + output: + - displayName: output + id: output + position: + x: '-520.0072319257067' + 'y': '-209.33943568578155' + positionAbsolute: + x: '-520.0072319257067' + 'y': '-209.33943568578155' + selected: 'false' + type: webpage + width: '230' + e0e82eb2-ee65-4a6b-ab25-3e6c6dcb2913: + data: + description: To check whether the user has configured MFA or not. If configured, it gets and displays the configured method(s) for the user to select one and proceed. If not, the next node should be Configure MFA node (if the business wants that user should not proceed without MFA). + label: MFA Configured State + properties: + - elementType: mfamethods + id: '1' + label: MFA Methods + options: + - checked: 'false' + text: Authenticator + value: Authenticator + - checked: 'false' + text: Security Question + value: Security Question + - checked: 'false' + text: Email OTP + value: Email OTP + - checked: 'false' + text: SMS OTP + value: SMS OTP + outputSelector: 'true' + required: 'true' + type: multiselect + value: + - Authenticator + - elementType: authenticatorbuttontext + id: '2' + label: Authenticator Button Text + parentPropertyId: '1' + parentPropertyValue: Authenticator + required: 'true' + type: text + value: Authenticator + - elementType: securityquestionbuttontext + id: '3' + label: Security Question Button Text + parentPropertyId: '1' + parentPropertyValue: Security Question + required: 'true' + type: text + value: '' + - elementType: emailotpbuttontext + id: '4' + label: Email OTP Button Text + parentPropertyId: '1' + parentPropertyValue: Email OTP + required: 'true' + type: text + value: '' + - elementType: smsotpbuttontext + id: '5' + label: SMS OTP Button Text + parentPropertyId: '1' + parentPropertyValue: SMS OTP + required: 'true' + type: text + value: '' + dragging: 'false' + height: '130' + id: e0e82eb2-ee65-4a6b-ab25-3e6c6dcb2913 + nodes: null + output: + - displayName: EmailOTP + id: emailotp + - displayName: SMSOTP + id: smsotp + - displayName: Authenticator + id: authenticator + - displayName: SecurityQuestion + id: securityquestion + - displayName: BackupCode + id: backupcode + - displayName: 'False' + id: 'false' + position: + x: '28.222649657516513' + 'y': '-239.82180479922073' + positionAbsolute: + x: '28.222649657516513' + 'y': '-239.82180479922073' + selected: 'false' + type: mfastate + width: '164' + initialNode: + data: + label: initial node + dragging: 'false' + height: '40' + id: initialNode + nodes: null + position: + x: '-640.0257070587011' + 'y': '-185.85618992280232' + positionAbsolute: + x: '-640.0257070587011' + 'y': '-185.85618992280232' + selected: 'false' + type: initial + width: '40' + policies: + email: + - elementType: shouldrestrict + id: '1' + label: Should Restrict + type: checkbox + value: 'false' + - elementType: blacklistwhitelist + id: '2' + label: Blacklist/Whitelist + options: + - text: Blacklist + value: Blacklist + - text: Whitelist + value: Whitelist + type: select + value: '' + - elementType: emaildomain + id: '3' + label: Email/Domain + type: multivalue + value: '' + password: + - elementType: rules + id: '4' + label: Password Validation + tooltipMessage: Validate password property must be enabled + type: text + value: min_length[6]|max_length[32]|required + - elementType: passwordexpiration + id: '5' + label: Password Expiration + options: + - text: Days + value: Days + - text: Month + value: Month + - text: Year + value: Year + type: selectinput + value: '' + - elementType: passwordhistory + id: '6' + label: Password History + type: text + value: '' + - elementType: confirmpasswordprotection + id: '7' + label: Common Password Protection + type: checkbox + value: 'false' + - elementType: dictionarypasswordprevention + id: '8' + label: Dictionary Password Prevention + type: checkbox + value: 'false' + - elementType: profilefieldpasswordprevention + id: '9' + label: Profile Field Password Prevention + type: checkbox + value: 'false' + phone: + - elementType: isprimary + id: '14' + label: Is Primary + type: checkbox + value: 'false' + - elementType: countrycode + id: '15' + label: Country Code + type: checkbox + value: 'false' + - elementType: setdefaultcountrycode + id: '16' + isSearchEnabled: 'true' + label: Set Default Country Code + options: optionsofsetcountrycode + primaryParentId: '15' + type: select + value: '' + - elementType: allowparticularcountrycode + id: '17' + isSearchEnabled: 'true' + label: Allow particular country code + options: optionsofallowcountrycode + primaryParentId: '15' + type: multiselect + value: null + pininput: + - elementType: rules + id: '13' + label: Pin Validation + type: text + value: '' + username: + - elementType: isprimary + id: '10' + label: Is Primary + type: checkbox + value: 'false' + - elementType: duplicateemail + id: '11' + label: Duplicate Email + primaryParentId: '10' + type: checkbox + value: 'false' + - elementType: casesensitiveusername + id: '12' + label: Case sensitive Username + type: checkbox + value: 'false' + tree: + entryNodeId: dd8723a2-afc1-4529-a0a6-2c0712af3e65 + nodes: + 1eb72cc9-7a2c-44f7-817d-00a94a9c1a24: + connections: + - emailotp: '' + - smsotp: '' + - authenticator: ac8ae2f4-48b9-4c35-bd68-4cbf11730b8b + - securityquestion: '' + - skip: '' + - 'false': '' + id: 1eb72cc9-7a2c-44f7-817d-00a94a9c1a24 + type: configuremfa + 4fd9fc82-5cc5-4410-94c7-cc8ac301a31e: + connections: + - output: 6799ebff-ab72-4ebd-869b-65672bd0a799 + id: 4fd9fc82-5cc5-4410-94c7-cc8ac301a31e + type: webpage + 6799ebff-ab72-4ebd-869b-65672bd0a799: + connections: + - 'true': SuccessFinalNode + - 'false': FailureFinalNode + id: 6799ebff-ab72-4ebd-869b-65672bd0a799 + type: verifyauthenticatortotp + ac8ae2f4-48b9-4c35-bd68-4cbf11730b8b: + connections: + - 'true': 4fd9fc82-5cc5-4410-94c7-cc8ac301a31e + - 'false': FailureFinalNode + id: ac8ae2f4-48b9-4c35-bd68-4cbf11730b8b + type: configureauthenticator + b92fb05a-578a-4097-aec0-2df33b4c27a0: + connections: + - 'true': e0e82eb2-ee65-4a6b-ab25-3e6c6dcb2913 + - 'false': FailureFinalNode + - accountlocked: '' + - passwordexpired: '' + - emailunverified: '' + - phoneunverified: '' + id: b92fb05a-578a-4097-aec0-2df33b4c27a0 + type: auth + dd8723a2-afc1-4529-a0a6-2c0712af3e65: + connections: + - output: b92fb05a-578a-4097-aec0-2df33b4c27a0 + id: dd8723a2-afc1-4529-a0a6-2c0712af3e65 + type: webpage + e0e82eb2-ee65-4a6b-ab25-3e6c6dcb2913: + connections: + - emailotp: '' + - smsotp: '' + - authenticator: 4fd9fc82-5cc5-4410-94c7-cc8ac301a31e + - securityquestion: '' + - backupcode: '' + - 'false': 1eb72cc9-7a2c-44f7-817d-00a94a9c1a24 + id: e0e82eb2-ee65-4a6b-ab25-3e6c6dcb2913 + type: mfastate + staticNodes: + failureFinalNode: + position: + x: '400' + 'y': '300' + initialNode: + position: + x: '-640.0257070587011' + 'y': '-185.85618992280232' + successFinalNode: + position: + x: '100' + 'y': '300' + viewport: + x: '647.0394243743131' + 'y': '464.4454913683603' + zoom: '0.8972987530157684' + Description: description + State: ACTIVE + WORKFLOW_RESPONSE: + value: + Id: 6799ebff-ab72-4ebd-869b-65672bd0a799 + Name: mfa-auth + ThemeName: default + Data: + edges: + - id: reactflow__edge-6799ebff-ab72-4ebd-869b-65672bd0a799true-SuccessFinalNode + markerEnd: + color: '#30b3ff' + type: arrowclosed + selected: 'false' + source: 6799ebff-ab72-4ebd-869b-65672bd0a799 + sourceHandle: 'true' + style: + stroke: '#30b3ff' + strokeWidth: '1' + target: SuccessFinalNode + targetHandle: null + type: smoothstep + - id: reactflow__edge-6799ebff-ab72-4ebd-869b-65672bd0a799false-FailureFinalNode + markerEnd: + color: '#30b3ff' + type: arrowclosed + selected: 'false' + source: 6799ebff-ab72-4ebd-869b-65672bd0a799 + sourceHandle: 'false' + style: + stroke: '#30b3ff' + strokeWidth: '1' + target: FailureFinalNode + targetHandle: null + type: smoothstep + - id: reactflow__edge-e0e82eb2-ee65-4a6b-ab25-3e6c6dcb2913false-1eb72cc9-7a2c-44f7-817d-00a94a9c1a24 + markerEnd: + color: '#30b3ff' + type: arrowclosed + selected: 'false' + source: e0e82eb2-ee65-4a6b-ab25-3e6c6dcb2913 + sourceHandle: 'false' + style: + stroke: '#30b3ff' + strokeWidth: '1' + target: 1eb72cc9-7a2c-44f7-817d-00a94a9c1a24 + targetHandle: null + type: smoothstep + - id: reactflow__edge-1eb72cc9-7a2c-44f7-817d-00a94a9c1a24authenticator-ac8ae2f4-48b9-4c35-bd68-4cbf11730b8b + markerEnd: + color: '#30b3ff' + type: arrowclosed + selected: 'false' + source: 1eb72cc9-7a2c-44f7-817d-00a94a9c1a24 + sourceHandle: authenticator + style: + stroke: '#30b3ff' + strokeWidth: '1' + target: ac8ae2f4-48b9-4c35-bd68-4cbf11730b8b + targetHandle: null + type: smoothstep + - id: reactflow__edge-ac8ae2f4-48b9-4c35-bd68-4cbf11730b8bfalse-FailureFinalNode + markerEnd: + color: '#30b3ff' + type: arrowclosed + selected: 'false' + source: ac8ae2f4-48b9-4c35-bd68-4cbf11730b8b + sourceHandle: 'false' + style: + stroke: '#30b3ff' + strokeWidth: '1' + target: FailureFinalNode + targetHandle: null + type: smoothstep + - id: reactflow__edge-initialNodeoutput-dd8723a2-afc1-4529-a0a6-2c0712af3e65 + markerEnd: + color: '#30b3ff' + type: arrowclosed + selected: 'false' + source: initialNode + sourceHandle: output + style: + stroke: '#30b3ff' + strokeWidth: '1' + target: dd8723a2-afc1-4529-a0a6-2c0712af3e65 + targetHandle: null + type: smoothstep + - id: reactflow__edge-dd8723a2-afc1-4529-a0a6-2c0712af3e65output-b92fb05a-578a-4097-aec0-2df33b4c27a0 + markerEnd: + color: '#30b3ff' + type: arrowclosed + selected: 'false' + source: dd8723a2-afc1-4529-a0a6-2c0712af3e65 + sourceHandle: output + style: + stroke: '#30b3ff' + strokeWidth: '1' + target: b92fb05a-578a-4097-aec0-2df33b4c27a0 + targetHandle: null + type: smoothstep + - id: reactflow__edge-b92fb05a-578a-4097-aec0-2df33b4c27a0true-e0e82eb2-ee65-4a6b-ab25-3e6c6dcb2913 + markerEnd: + color: '#30b3ff' + type: arrowclosed + selected: 'false' + source: b92fb05a-578a-4097-aec0-2df33b4c27a0 + sourceHandle: 'true' + style: + stroke: '#30b3ff' + strokeWidth: '1' + target: e0e82eb2-ee65-4a6b-ab25-3e6c6dcb2913 + targetHandle: null + type: smoothstep + - id: reactflow__edge-b92fb05a-578a-4097-aec0-2df33b4c27a0false-FailureFinalNode + markerEnd: + color: '#30b3ff' + type: arrowclosed + selected: 'false' + source: b92fb05a-578a-4097-aec0-2df33b4c27a0 + sourceHandle: 'false' + style: + stroke: '#30b3ff' + strokeWidth: '1' + target: FailureFinalNode + targetHandle: null + type: smoothstep + - id: reactflow__edge-ac8ae2f4-48b9-4c35-bd68-4cbf11730b8btrue-4fd9fc82-5cc5-4410-94c7-cc8ac301a31e + markerEnd: + color: '#30b3ff' + type: arrowclosed + selected: 'false' + source: ac8ae2f4-48b9-4c35-bd68-4cbf11730b8b + sourceHandle: 'true' + style: + stroke: '#30b3ff' + strokeWidth: '1' + target: 4fd9fc82-5cc5-4410-94c7-cc8ac301a31e + targetHandle: null + type: smoothstep + - id: reactflow__edge-e0e82eb2-ee65-4a6b-ab25-3e6c6dcb2913authenticator-4fd9fc82-5cc5-4410-94c7-cc8ac301a31e + markerEnd: + color: '#30b3ff' + type: arrowclosed + selected: 'false' + source: e0e82eb2-ee65-4a6b-ab25-3e6c6dcb2913 + sourceHandle: authenticator + style: + stroke: '#30b3ff' + strokeWidth: '1' + target: 4fd9fc82-5cc5-4410-94c7-cc8ac301a31e + targetHandle: null + type: smoothstep + - id: reactflow__edge-4fd9fc82-5cc5-4410-94c7-cc8ac301a31eoutput-6799ebff-ab72-4ebd-869b-65672bd0a799 + markerEnd: + color: '#30b3ff' + type: arrowclosed + selected: 'false' + source: 4fd9fc82-5cc5-4410-94c7-cc8ac301a31e + sourceHandle: output + style: + stroke: '#30b3ff' + strokeWidth: '1' + target: 6799ebff-ab72-4ebd-869b-65672bd0a799 + targetHandle: null + type: smoothstep + innerNodes: + 46d6674e-bbc6-44bc-951f-98cffd6441b6: + data: + description: Displays the option to field to enter TOTP (when Authenticator is already configured). + label: Authenticator Input + properties: null + dragging: 'false' + extent: parent + height: '50' + hidden: 'true' + id: 46d6674e-bbc6-44bc-951f-98cffd6441b6 + isChildNode: 'true' + nodes: null + parentNode: 4fd9fc82-5cc5-4410-94c7-cc8ac301a31e + position: + x: '290.33256209500405' + 'y': '-206.97348008280136' + positionAbsolute: + x: '290.33256209500405' + 'y': '-206.97348008280136' + selected: 'false' + type: authenticatorinput + width: '150' + a655db76-8831-411b-82f5-1be2784e4a78: + data: + description: Prompts the user to enter the email and stores the input. It is used with the Web Page node. + label: Email + properties: + - elementType: emailonlyasinput + id: '1' + label: Email Only as Input + type: checkbox + value: 'false' + - elementType: isprimary + id: '2' + label: Is Primary + primaryParentId: '1' + type: checkbox + value: 'true' + - elementType: emailtype + id: '3' + label: Email Type + primaryParentId: '1' + secondaryParentId: '2' + type: text + value: '' + - elementType: rules + id: '4' + label: Validation String + primaryParentId: '1' + type: text + value: '' + draggable: 'true' + dragging: 'false' + extent: parent + height: '50' + hidden: 'true' + id: a655db76-8831-411b-82f5-1be2784e4a78 + isChildNode: 'true' + nodes: null + parentNode: dd8723a2-afc1-4529-a0a6-2c0712af3e65 + position: + x: '-499.8966093003752' + 'y': '-455.39881839572' + positionAbsolute: + x: '-499.8966093003752' + 'y': '-455.39881839572' + selected: 'false' + type: email + width: '150' + fff21a66-437c-4a8a-96e0-744efaff8d87: + data: + description: Prompts the user to enter their password and stores the input. This node is to be used for entering the password during registration, login, password update and password forget etc. It is used with the Web Page node. + label: Password + properties: + - elementType: passwordonlyasinput + id: '1' + label: Password Only as Input + tag: password + type: checkbox + value: 'false' + - elementType: oldpassword + id: '2' + label: Old Password + primaryParentId: '1' + tag: password + type: checkbox + value: 'false' + - elementType: newpassword + id: '3' + label: New Password + primaryParentId: '1' + tag: password + type: checkbox + value: 'false' + - elementType: confirmpassword + id: '4' + label: Confirm Password + primaryParentId: '1' + tag: password + type: checkbox + value: 'false' + - elementType: validatepassword + id: '5' + label: Validate Password + primaryParentId: '1' + tag: policy + type: checkbox + value: 'false' + draggable: 'true' + dragging: 'false' + extent: parent + height: '50' + hidden: 'true' + id: fff21a66-437c-4a8a-96e0-744efaff8d87 + isChildNode: 'true' + nodes: null + parentNode: dd8723a2-afc1-4529-a0a6-2c0712af3e65 + position: + x: '-480.96896447653376' + 'y': '-480.2413522270118' + positionAbsolute: + x: '-480.96896447653376' + 'y': '-480.2413522270118' + selected: 'false' + type: password + width: '150' + nodes: + 1eb72cc9-7a2c-44f7-817d-00a94a9c1a24: + data: + description: 'Define the MFA flow (mandatory or optional), settings and method(s) for all users. To let users register/configure the MFA method from the available method(s) on login. ' + label: Configure MFA + properties: + - elementType: mfaflow + id: '1' + label: MFA Flow + options: + - text: Mandatory + value: Mandatory + - text: Optional + value: Optional + required: 'true' + type: select + value: Mandatory + - elementType: message + id: '2' + label: Message + required: 'true' + type: text + value: Authenticator + - elementType: mfamethods + id: '3' + label: MFA Methods + options: + - checked: 'false' + text: Authenticator + value: Authenticator + - checked: 'false' + text: Security Question + value: Security Question + - checked: 'false' + text: Email OTP + value: Email OTP + - checked: 'false' + text: SMS OTP + value: SMS OTP + outputSelector: 'true' + required: 'true' + type: multiselect + value: + - Authenticator + - elementType: authenticatorbuttontext + id: '4' + label: Authenticator Button Text + parentPropertyId: '3' + parentPropertyValue: Authenticator + required: 'true' + type: text + value: Configure Authenticator + - elementType: securityquestionbuttontext + id: '5' + label: Security Question Button Text + parentPropertyId: '3' + parentPropertyValue: Security Question + required: 'true' + type: text + value: '' + - elementType: emailotpbuttontext + id: '6' + label: Email OTP Button Text + parentPropertyId: '3' + parentPropertyValue: Email OTP + required: 'true' + type: text + value: '' + - elementType: smsotpbuttontext + id: '7' + label: SMS OTP Button Text + parentPropertyId: '3' + parentPropertyValue: SMS OTP + required: 'true' + type: text + value: '' + dragging: 'false' + height: '130' + id: 1eb72cc9-7a2c-44f7-817d-00a94a9c1a24 + nodes: null + output: + - displayName: EmailOTP + id: emailotp + - displayName: SMSOTP + id: smsotp + - displayName: Authenticator + id: authenticator + - displayName: SecurityQuestion + id: securityquestion + - displayName: Skip + id: skip + - displayName: 'False' + id: 'false' + position: + x: '-189.86368278693385' + 'y': '-453.57986075944297' + positionAbsolute: + x: '-189.86368278693385' + 'y': '-453.57986075944297' + selected: 'false' + type: configuremfa + width: '164' + 4fd9fc82-5cc5-4410-94c7-cc8ac301a31e: + data: + description: Combines multiple nodes that request input into a single page for display to the user. Drag and drop nodes onto the web page node to combine them. + label: Web Page + properties: + - elementType: title + id: '1' + label: Web Page Header + required: 'true' + type: text + value: Authenticator Code + - elementType: description + id: '2' + label: Web Page Description + required: 'true' + type: text + value: Enter the Authenticator Code + - elementType: buttontext + id: '3' + label: Submit Button Text + required: 'true' + type: text + value: Verify + - elementType: footer + id: '4' + label: Web Page Footer + required: 'true' + type: text + value: LoginRadius + - elementType: buttons + id: '5' + label: Buttons + type: buttons + value: null + dragging: 'false' + height: '114' + id: 4fd9fc82-5cc5-4410-94c7-cc8ac301a31e + nodes: + - data: + label: Authenticator Input + id: 46d6674e-bbc6-44bc-951f-98cffd6441b6 + isChildNode: 'true' + type: authenticatorinput + output: + - displayName: output + id: output + position: + x: '276.136828477123' + 'y': '-237.73090292154373' + positionAbsolute: + x: '276.136828477123' + 'y': '-237.73090292154373' + selected: 'false' + type: webpage + width: '230' + 6799ebff-ab72-4ebd-869b-65672bd0a799: + data: + description: Verifies if the entered TOTP for authenticator is valid or not. + label: Verify Authenticator + properties: null + dragging: 'false' + height: '90' + id: 6799ebff-ab72-4ebd-869b-65672bd0a799 + nodes: null + output: + - displayName: 'True' + id: 'true' + - displayName: 'False' + id: 'false' + position: + x: '616.5127762283203' + 'y': '-370.34395454050144' + positionAbsolute: + x: '616.5127762283203' + 'y': '-370.34395454050144' + selected: 'false' + type: verifyauthenticatortotp + width: '164' + FailureFinalNode: + data: + description: 'Denotes that the workflow ended at failure. ' + label: Failure + properties: + - id: '1' + label: Redirect URL + type: text + value: '' + dragging: 'false' + height: '40' + id: FailureFinalNode + nodes: null + position: + x: '868.1393360508125' + 'y': '-6.556228920048781' + positionAbsolute: + x: '868.1393360508125' + 'y': '-6.556228920048781' + selected: 'false' + type: finalNegative + width: '40' + SuccessFinalNode: + data: + description: 'Denotes that the workflow ended in success. ' + label: Success + properties: + - id: '1' + label: Redirect URL + type: text + value: '' + dragging: 'false' + height: '40' + id: SuccessFinalNode + nodes: null + position: + x: '870.7506472583059' + 'y': '-346.426228223721' + positionAbsolute: + x: '870.7506472583059' + 'y': '-346.426228223721' + selected: 'false' + type: finalPositive + width: '40' + ac8ae2f4-48b9-4c35-bd68-4cbf11730b8b: + data: + description: To configure the Authenticator method while setting up MFA. Businesses can also customize the labels and descriptions that will be displayed on the Authenticator screen. + label: Configure Authenticator + properties: + - elementType: issuerid + id: '1' + label: Issuer ID + required: 'true' + type: text + value: LR + - elementType: qrcodewidth + id: '2' + label: QR Code Width + required: 'true' + type: text + value: '200' + - elementType: qrcodeheight + id: '3' + label: QR Code Height + required: 'true' + type: text + value: '200' + - elementType: displaygetapp + id: '4' + label: Display Get App + type: checkbox + value: 'false' + - elementType: getapptext + id: '5' + label: Get App Text + parentPropertyId: '4' + parentPropertyValue: 'true' + required: 'true' + type: text + value: '' + - elementType: getapplink + id: '6' + label: Get App Link + parentPropertyId: '4' + parentPropertyValue: 'true' + required: 'true' + type: text + value: '' + - elementType: googleauthenticatorlabel + id: '7' + label: Authenticator label + required: 'true' + type: text + value: Configure Authenticator + - elementType: googleauthenticatordescription + id: '8' + label: Authenticator Description + required: 'true' + type: text + value: Configure authenticator to use MFA + - elementType: defaultbuttontext + id: '9' + label: Default Button Text + required: 'true' + type: text + value: Authenticator + dragging: 'false' + height: '90' + id: ac8ae2f4-48b9-4c35-bd68-4cbf11730b8b + nodes: null + output: + - displayName: 'True' + id: 'true' + - displayName: 'False' + id: 'false' + position: + x: '39.63816595865569' + 'y': '-491.36370171146075' + positionAbsolute: + x: '39.63816595865569' + 'y': '-491.36370171146075' + selected: 'false' + type: configureauthenticator + width: '164' + b92fb05a-578a-4097-aec0-2df33b4c27a0: + data: + description: Verifies if the authentication is successful or not, along with other statutes such as account locked, password expired. + label: Auth + properties: + - elementType: accesstoken + id: '1' + label: Access Token + readOnly: 'true' + type: checkbox + value: 'true' + - elementType: sessiontoken + id: '2' + label: Session Token + type: checkbox + value: 'false' + - elementType: authvalidation + id: '3' + label: Auth Validation + options: + - text: Email Unverified + value: emailunverified + - text: Phone Unverified + value: phoneunverified + - text: Password Expired + value: passwordexpired + - text: Account Locked + value: accountlocked + type: multiselect + value: null + height: '90' + id: b92fb05a-578a-4097-aec0-2df33b4c27a0 + nodes: null + output: + - displayName: 'True' + id: 'true' + - displayName: 'False' + id: 'false' + - displayName: Account Locked + id: accountlocked + - displayName: Password Expired + id: passwordexpired + - displayName: Email Unverified + id: emailunverified + - displayName: Phone Unverified + id: phoneunverified + position: + x: '-215.98193694275392' + 'y': '-66.19912170548083' + selected: 'false' + type: auth + width: '164' + dd8723a2-afc1-4529-a0a6-2c0712af3e65: + data: + description: Combines multiple nodes that request input into a single page for display to the user. Drag and drop nodes onto the web page node to combine them. + label: Web Page + properties: + - elementType: title + id: '1' + label: Web Page Header + required: 'true' + type: text + value: MFA Authenticator + - elementType: description + id: '2' + label: Web Page Description + required: 'true' + type: text + value: MFA Authenticator Flow + - elementType: buttontext + id: '3' + label: Submit Button Text + required: 'true' + type: text + value: Submit + - elementType: footer + id: '4' + label: Web Page Footer + required: 'true' + type: text + value: LoginRadius + - elementType: buttons + id: '5' + label: Buttons + type: buttons + value: null + dragging: 'false' + height: '158' + id: dd8723a2-afc1-4529-a0a6-2c0712af3e65 + nodes: + - data: + label: Email + id: a655db76-8831-411b-82f5-1be2784e4a78 + isChildNode: 'true' + type: email + - data: + label: Password + id: fff21a66-437c-4a8a-96e0-744efaff8d87 + isChildNode: 'true' + type: password + output: + - displayName: output + id: output + position: + x: '-520.0072319257067' + 'y': '-209.33943568578155' + positionAbsolute: + x: '-520.0072319257067' + 'y': '-209.33943568578155' + selected: 'false' + type: webpage + width: '230' + e0e82eb2-ee65-4a6b-ab25-3e6c6dcb2913: + data: + description: To check whether the user has configured MFA or not. If configured, it gets and displays the configured method(s) for the user to select one and proceed. If not, the next node should be Configure MFA node (if the business wants that user should not proceed without MFA). + label: MFA Configured State + properties: + - elementType: mfamethods + id: '1' + label: MFA Methods + options: + - checked: 'false' + text: Authenticator + value: Authenticator + - checked: 'false' + text: Security Question + value: Security Question + - checked: 'false' + text: Email OTP + value: Email OTP + - checked: 'false' + text: SMS OTP + value: SMS OTP + outputSelector: 'true' + required: 'true' + type: multiselect + value: + - Authenticator + - elementType: authenticatorbuttontext + id: '2' + label: Authenticator Button Text + parentPropertyId: '1' + parentPropertyValue: Authenticator + required: 'true' + type: text + value: Authenticator + - elementType: securityquestionbuttontext + id: '3' + label: Security Question Button Text + parentPropertyId: '1' + parentPropertyValue: Security Question + required: 'true' + type: text + value: '' + - elementType: emailotpbuttontext + id: '4' + label: Email OTP Button Text + parentPropertyId: '1' + parentPropertyValue: Email OTP + required: 'true' + type: text + value: '' + - elementType: smsotpbuttontext + id: '5' + label: SMS OTP Button Text + parentPropertyId: '1' + parentPropertyValue: SMS OTP + required: 'true' + type: text + value: '' + dragging: 'false' + height: '130' + id: e0e82eb2-ee65-4a6b-ab25-3e6c6dcb2913 + nodes: null + output: + - displayName: EmailOTP + id: emailotp + - displayName: SMSOTP + id: smsotp + - displayName: Authenticator + id: authenticator + - displayName: SecurityQuestion + id: securityquestion + - displayName: BackupCode + id: backupcode + - displayName: 'False' + id: 'false' + position: + x: '28.222649657516513' + 'y': '-239.82180479922073' + positionAbsolute: + x: '28.222649657516513' + 'y': '-239.82180479922073' + selected: 'false' + type: mfastate + width: '164' + initialNode: + data: + label: initial node + dragging: 'false' + height: '40' + id: initialNode + nodes: null + position: + x: '-640.0257070587011' + 'y': '-185.85618992280232' + positionAbsolute: + x: '-640.0257070587011' + 'y': '-185.85618992280232' + selected: 'false' + type: initial + width: '40' + policies: + email: + - elementType: shouldrestrict + id: '1' + label: Should Restrict + type: checkbox + value: 'false' + - elementType: blacklistwhitelist + id: '2' + label: Blacklist/Whitelist + options: + - text: Blacklist + value: Blacklist + - text: Whitelist + value: Whitelist + type: select + value: '' + - elementType: emaildomain + id: '3' + label: Email/Domain + type: multivalue + value: '' + password: + - elementType: rules + id: '4' + label: Password Validation + tooltipMessage: Validate password property must be enabled + type: text + value: min_length[6]|max_length[32]|required + - elementType: passwordexpiration + id: '5' + label: Password Expiration + options: + - text: Days + value: Days + - text: Month + value: Month + - text: Year + value: Year + type: selectinput + value: '' + - elementType: passwordhistory + id: '6' + label: Password History + type: text + value: '' + - elementType: confirmpasswordprotection + id: '7' + label: Common Password Protection + type: checkbox + value: 'false' + - elementType: dictionarypasswordprevention + id: '8' + label: Dictionary Password Prevention + type: checkbox + value: 'false' + - elementType: profilefieldpasswordprevention + id: '9' + label: Profile Field Password Prevention + type: checkbox + value: 'false' + phone: + - elementType: isprimary + id: '14' + label: Is Primary + type: checkbox + value: 'false' + - elementType: countrycode + id: '15' + label: Country Code + type: checkbox + value: 'false' + - elementType: setdefaultcountrycode + id: '16' + isSearchEnabled: 'true' + label: Set Default Country Code + options: optionsofsetcountrycode + primaryParentId: '15' + type: select + value: '' + - elementType: allowparticularcountrycode + id: '17' + isSearchEnabled: 'true' + label: Allow particular country code + options: optionsofallowcountrycode + primaryParentId: '15' + type: multiselect + value: null + pininput: + - elementType: rules + id: '13' + label: Pin Validation + type: text + value: '' + username: + - elementType: isprimary + id: '10' + label: Is Primary + type: checkbox + value: 'false' + - elementType: duplicateemail + id: '11' + label: Duplicate Email + primaryParentId: '10' + type: checkbox + value: 'false' + - elementType: casesensitiveusername + id: '12' + label: Case sensitive Username + type: checkbox + value: 'false' + tree: + entryNodeId: dd8723a2-afc1-4529-a0a6-2c0712af3e65 + nodes: + 1eb72cc9-7a2c-44f7-817d-00a94a9c1a24: + connections: + - emailotp: '' + - smsotp: '' + - authenticator: ac8ae2f4-48b9-4c35-bd68-4cbf11730b8b + - securityquestion: '' + - skip: '' + - 'false': '' + id: 1eb72cc9-7a2c-44f7-817d-00a94a9c1a24 + type: configuremfa + 4fd9fc82-5cc5-4410-94c7-cc8ac301a31e: + connections: + - output: 6799ebff-ab72-4ebd-869b-65672bd0a799 + id: 4fd9fc82-5cc5-4410-94c7-cc8ac301a31e + type: webpage + 6799ebff-ab72-4ebd-869b-65672bd0a799: + connections: + - 'true': SuccessFinalNode + - 'false': FailureFinalNode + id: 6799ebff-ab72-4ebd-869b-65672bd0a799 + type: verifyauthenticatortotp + ac8ae2f4-48b9-4c35-bd68-4cbf11730b8b: + connections: + - 'true': 4fd9fc82-5cc5-4410-94c7-cc8ac301a31e + - 'false': FailureFinalNode + id: ac8ae2f4-48b9-4c35-bd68-4cbf11730b8b + type: configureauthenticator + b92fb05a-578a-4097-aec0-2df33b4c27a0: + connections: + - 'true': e0e82eb2-ee65-4a6b-ab25-3e6c6dcb2913 + - 'false': FailureFinalNode + - accountlocked: '' + - passwordexpired: '' + - emailunverified: '' + - phoneunverified: '' + id: b92fb05a-578a-4097-aec0-2df33b4c27a0 + type: auth + dd8723a2-afc1-4529-a0a6-2c0712af3e65: + connections: + - output: b92fb05a-578a-4097-aec0-2df33b4c27a0 + id: dd8723a2-afc1-4529-a0a6-2c0712af3e65 + type: webpage + e0e82eb2-ee65-4a6b-ab25-3e6c6dcb2913: + connections: + - emailotp: '' + - smsotp: '' + - authenticator: 4fd9fc82-5cc5-4410-94c7-cc8ac301a31e + - securityquestion: '' + - backupcode: '' + - 'false': 1eb72cc9-7a2c-44f7-817d-00a94a9c1a24 + id: e0e82eb2-ee65-4a6b-ab25-3e6c6dcb2913 + type: mfastate + staticNodes: + failureFinalNode: + position: + x: '400' + 'y': '300' + initialNode: + position: + x: '-640.0257070587011' + 'y': '-185.85618992280232' + successFinalNode: + position: + x: '100' + 'y': '300' + viewport: + x: '647.0394243743131' + 'y': '464.4454913683603' + zoom: '0.8972987530157684' + Description: description + State: ACTIVE + WORKFLOW_STATE_IS_INVALID: + value: + ErrorCode: 8031 + Message: Workflow configuration is invalid. + Description: The provided workflow state is invalid. Please enter the valid workflow state. + INVALID_WORKFLOW_NAME: + summary: INVALID_WORKFLOW_NAME + value: + ErrorCode: 8031 + Message: Workflow configuration is invalid. + Description: Invalid Name. It must be alphanumeric, hyphens (-), underscores (_), colon(:) not start/end with hyphen/underscore/colon, and max length 60. + WORKFLOW_CONFIG_EXISTS_WITH_SAME_NAME: + value: + ErrorCode: 8032 + Message: Workflow configuration already exist with same name. + Description: Workflow configuration already exists with same name, Please use another name to update the workflow name. + INVALID_WORKFLOW_ID: + summary: INVALID_WORKFLOW_ID + value: + ErrorCode: 8191 + Message: Invalid workflow id + Description: Invalid workflow id, Please provide valid workflow id. + FAILED_TO_RESTORE_WORKFLOW_VERSION: + summary: FAILED_TO_RESTORE_WORKFLOW_VERSION + value: + ErrorCode: 8023 + Message: Failed to restore workflow version + Description: Failed to restore the workflow version. Please try again. + WORKFLOW_VERSION_NOT_FOUND: + summary: WORKFLOW_VERSION_NOT_FOUND + value: + ErrorCode: 7972 + Message: Workflow version not found + Description: Workflow version not found or the resource does not exist. + WEBHOOK_FEATURE_NOT_ENABLED: + summary: WEBHOOK_FEATURE_NOT_ENABLED + value: + Message: Site is not configured for WebHook management + Description: Request couldn't be processed, WebHook management feature is not enabled for this site. + ErrorCode: 7984 + WEBHOOK_CONFIG_NOT_FOUND: + value: + Message: WebHook configuration not found + Description: WebHook configuration not found or the resource does not exist. + ErrorCode: 7986 + INVALID_WEBHOOK_EVENT_TYPE: + summary: INVALID_WEBHOOK_EVENT_TYPE + value: + Message: Invalid WebHook Event type + Description: Request couldn't be processed due to invalid WebHook Event type. + ErrorCode: 7985 + WEB_HOOK_TARGET_URL_IS_NOT_VALID: + value: + Message: Webhook target URL is invalid + Description: The provided Webhook target URL is invalid, please enter a valid web URL. + ErrorCode: 7987 + WEB_HOOK_TARGET_URL_IS_NOT_REACHABLE: + value: + Message: Webhook target URL is not reachable + Description: Please check the provided Webhook target URL, we couldn't reach the server at the provided URL. + ErrorCode: 8106 + WEB_HOOK_TARGET_URL_IS_ALREADY_SUBSCRIBE: + value: + Message: Webhook target URL is already subscribed + Description: The provided Webhook target URL is already subscribed, please enter a unique web URL. + ErrorCode: 7989 + WEB_HOOK_NOT_ALLOWED_MORE_THAN_MAX_LIMIT: + value: + Message: Number of Webhook subscriptions exceeded the limit + Description: Number of Webhook subscriptions must be less than or equal to 5, unsubscribe at least one and try again. + ErrorCode: 7988 + INVALID_WEBHOOK_ID: + value: + Message: A parameter is not formatted correctly (Parameter name in Response) + Description: The webhook subscription id is not valid. + ErrorCode: 7900 + CANNOT_UPDATE_WEBHOOK: + value: + Message: WebHook configuration not found + Description: WebHook configuration not found or the resource does not exist. + ErrorCode: 8016 + WEBHOOK_EVENTS: + value: Login + INVALID_SMS_TYPE: + value: + Message: Invalid SMS Template type + Description: Request couldn't be processed due to invalid SMS type. + ErrorCode: 7959 + SMS_TEMPLATE_ALREADY_EXISTS: + value: + Message: SMS template already exist. + Description: SMS template with the same name already exists, please use a unique name in order to process the request. + ErrorCode: 7955 + SMS_TEMPLATE_NOT_FOUND: + value: + Message: SMS template is not configured or the resource does not exist + Description: You don't have any SMS template configured for the LoginRadius site. + ErrorCode: 7954 + SMS_TEMPLATE_NOT_EXISTS: + value: + Message: SMS template does not exist. + Description: Provided SMS template does not exist, Please use a valid SMS template in order to process this request. + ErrorCode: 7956 + JSON_DELETE_BODY_REQUIRED: + value: + ErrorCode: 7935 + Message: Delete body is invalid or empty + Description: Please use a valid delete body in JSON format in order to process this request. + DEFAULT_SMS_TEMPLATE_CANNOT_BE_DELETED: + value: + Message: Default SMS template cannot be deleted + Description: The default SMS template cannot be deleted. Please set another template as default before deleting this one. + ErrorCode: 8259 + PASSKEY_FEATURE_NOT_ENABLED: + value: + ErrorCode: 8069 + Message: Site is not configured for passkeys + Description: Passkeys is not configured for this site, Please contact LoginRadius support for more information. + PASSKEY_NOT_FOUND: + value: + ErrorCode: 8054 + Message: PassKey configuration not found or does not exist. + Description: There is no PassKey configuration available. + INVALID_PASSKEY_SELECTION: + value: + ErrorCode: 7991 + Message: Invalid passkey configuration + Description: The value can be 'AutoFill', 'Button', or 'Both'. + INVALID_PASSKEY_ATTESTATION: + value: + ErrorCode: 7991 + Message: Invalid passkey configuration + Description: The value of attestation can be “none”,“indirect” or “direct”. + INVALID_RP_ORIGIN_URL: + value: + ErrorCode: 7991 + Message: Invalid passkey configuration + Description: The RPOrigin URL is invalid. Please enter a valid RPOrigin URL. + RP_ORIGIN_RPID_MISMATCH: + value: + ErrorCode: 7991 + Message: Invalid passkey configuration + Description: The RPOrigin URL does not match the RPID. Please ensure that the RPOrigin URL ends with the RPID value. + PUSH_AUTHENTICATOR_EXAMPLE: + value: + IsEnabled: true + NotificationService: AWS + CustomAppName: MyCustomApp + QRCodeWidth: 200 + Message: Please approve the login request + AWSsettings: + AccessKeyId: your-access-key-id + SecretAccessKey: your-secret-access-key + Region: us-west-2 + AndroidSettings: + Enabled: true + PlatformARN: arn:aws:sns:us-west-2:123456789012:app/GCM/MyAndroidApp + PlaystoreUrl: https://play.google.com/store/apps/details?id=com.example.myapp + ServiceJson: '{"project_id":"my-project-id","api_key":"my-api-key"}' + IOSsettings: + Enabled: true + AppstoreUrl: https://apps.apple.com/us/app/myapp/id1234567890 + PlatformARN: arn:aws:sns:us-west-2:123456789012:app/APNS/MyiOSApp + BundleId: com.example.myapp + ApnsCertificate: base64-encoded-cert + Environment: Production + SECOND_FACTOR_AUTHENTICATION_NOT_ENABLED: + value: + ErrorCode: 7953 + Message: Site is not configured for second factor authentication. + Description: Request couldn't be processed, second factor authentication feature is not enabled for this site. + PUSH_NOTIFICATIONS_NOT_ENABLED: + value: + ErrorCode: 8052 + Message: Site is not configured for Push Notifications MFA. + Description: Request couldn't be processed,Push Notifications MFA feature is not enabled for this site. + PUSH_SETTINGS_NOT_FOUND: + value: + ErrorCode: 8050 + Message: Push Notification settings not found or does not exist + Description: There is no Push Notification settings/configuration available. + ATLEAST_ANDORID_OR_IOS_ENABLED: + value: + ErrorCode: 8047 + Message: Push notification authenticator configuration is invalid. + Description: Atleast one of the Android or iOS settings must be enabled for the Custom Notification App. + INVALID_NOTIFICATION_SERVICE: + value: + ErrorCode: 8047 + Message: Push notification authenticator configuration is invalid. + Description: The value can be “AWS” or “Native”. + INVALID_IOS_ENVIRONMENT: + value: + ErrorCode: 8047 + Message: Push notification authenticator configuration is invalid. + Description: The value can be “Production” or “Sandbox”. + INVALID_NOTIFICATION_SERVICE_CUSTOM: + value: + ErrorCode: 8047 + Message: Push notification authenticator configuration is invalid. + Description: Please provide a value for the Notification Service field when the Notification App is set to Custom. + SECURITY_QUESTION_NOT_ENABLED: + value: + ErrorCode: 7951 + Message: Site is not configured for security question + Description: Request couldn't be processed, security question feature is not enabled for this site. + SECURITY_QUESTION_ALREADY_ADDED: + value: + ErrorCode: 7948 + Message: Security question already exists + Description: A similar security question has already been configured. + INVALID_QUESTION_ID: + value: + ErrorCode: 7949 + Message: Security question not found or does not exist + Description: The requested security question id is invalid or does not exist. + SECURITY_QUESTION_CONFIG_NOT_FOUND: + value: + ErrorCode: 7947 + Message: Security question configuration not found + Description: Security question settings are not configured or the resource does not exist. + SECURITY_QUESTION_RENDER_COUNT_ERROR: + value: + ErrorCode: 8010 + Message: Can not update security question configuration's number of security question to appear count. + Description: The number of security questions to appear count of security question configuration should be greater than or equal to the number of security question to appear count of two factor security question authenticator. + DOMAIN_WHITE_LISTING_NOT_ENABLED: + value: + Message: Site is not configured for Domain White Listing. + Description: Request couldn't be processed, Domain White Listing feature is not enabled for this site. + ErrorCode: 8110 + DOMAIN_RESTRICTION_CONFIG_NOT_FOUND: + value: + Message: Domain access restriction configuration not found. + Description: Domain access restriction configuration is not configured or the resource does not exist. + ErrorCode: 8111 + SAME_DOMAIN_OR_EMAIL_CANNOT_EXIST_IN_BOTH_LIST: + summary: SAME_DOMAIN_OR_EMAIL_CANNOT_EXIST_IN_BOTH_LIST + value: + ErrorCode: 8190 + Message: Same domain or email cannot exist in both list. + Description: Same domain or email cannot exist in both list. Please add it to the appropriate list. + EMAIL_TEMPLATE_NOT_CREATED: + value: + ErrorCode: 7922 + Message: Email template is not configured. + Description: You have not added any email templates for this site, Please add at least one email template. + PARAMETER_NOT_WELL_FORMATTED_ALPHANUMERIC: + value: + ErrorCode: 7900 + Message: A parameter is not formatted correctly. + Description: The value of '%s' property should be a valid alphanumeric format. + PARAMETER_NOT_WELL_FORMATTED_EMAIL: + value: + ErrorCode: 7900 + Message: A parameter is not formatted correctly. + Description: The value of '%s' property should be a valid email format. + INVALID_FROM_EMAIL_OR_NAME: + value: + ErrorCode: 8099 + Message: Invalid email templates configuration + Description: '''FromName'' and ''FromEmail'' must be both valid or both empty.' + INVALID_EMAIL_TYPE: + value: + ErrorCode: 8099 + Message: Invalid email templates configuration + Description: The email type is invalid. Please provide a valid email type. + INVALID_EMAIL_TEMPLATES_INVALID_EMAIL_TYPE: + summary: INVALID_EMAIL_TEMPLATES_INVALID_EMAIL_TYPE + value: + ErrorCode: 8099 + Message: Invalid email templates configuration + Description: The verification token type can't be updated for this email type. Please provide a valid email type. + INVALID_EMAIL_TEMPLATES_INVALID_TOKEN_TYPE: + summary: INVALID_EMAIL_TEMPLATES_INVALID_TOKEN_TYPE + value: + ErrorCode: 8099 + Message: Invalid email templates configuration + Description: The email verification token type is invalid. Please provide a valid email verification token type. + EMAIL_TEMPLATE_EXISTS: + value: + ErrorCode: 7930 + Message: Email template already exist. + Description: The email template is already exist, Please use a different or unique name for the new email template. + EMAIL_TEMPLATE_NOT_EXISTS: + value: + ErrorCode: 7923 + Message: Email template does not exist + Description: The email template does not exist, Please use a valid email template. + DEFAULT_EMAIL_TEMPLATE_CANNOT_BE_DELETED: + value: + Message: Default email template cannot be deleted + Description: The default email template cannot be deleted. Please set another template as default before deleting this one. + ErrorCode: 8258 + PROVIDER_NOT_CONFIGURED_PARTNER: + summary: PROVIDER_NOT_CONFIGURED_PARTNER + value: + Message: Provider not configured + Description: Provider not configured, Please provide valid provider name. + ErrorCode: 8147 + PROVIDER_NOT_ACTIVE: + value: + Message: Provider is not active + Description: Provider is not active, Please provide valid provider name. + ErrorCode: 8041 + PROVIDER_IS_NOT_SUPPORT_CONFIGURATION_SETTINGS: + value: + Message: Your selected configuration setting is not supported by the ID provider + Description: This provider does not support your current configuration settings, Please change the provider configuration. + ErrorCode: 7910 + PROVIDER_IS_NOT_VALID: + value: + Message: Provider name is invalid + Description: The provider name used in the request is incorrect or does not exist, Please use a valid provider name + ErrorCode: 7911 + ATLEAST_ONE_MFA: + value: + ErrorCode: 8020 + Message: At least one MFA method must be enabled. + Description: At least one MFA method must be enabled. Enable another MFA option before disabling this one + DUO_AUTH_NOT_ENABLED_PARTNER: + summary: DUO_AUTH_NOT_ENABLED_PARTNER + value: + ErrorCode: 8072 + Message: Site is not configured for Duo Security Authenticator MFA. + Description: Request couldn't be processed,Duo Security Authenticator MFA feature is not enabled for this site. + GOOGLE_AUTHENTICATOR_CONFIG_NOT_FOUND: + value: + ErrorCode: 7952 + Message: Google Authenticator settings not found or does not exist + Description: There is no google authenticator settings/configuration available. + DUO_AUTH_SETTINGS_NOT_FOUND: + value: + ErrorCode: 8073 + Message: Duo Security Authenticator settings not found or does not exist + Description: There is no Duo Security Authenticator settings/configuration available. + PARAMETER_NOT_WELL_FORMATTED_INVALID: + value: + ErrorCode: 7900 + Message: A parameter is not formatted correctly. + Description: The value of '%s' property is invalid. + CAPTCHA_CONFIG_VALUE_NOT_VALID: + value: + Message: Captcha config is invalid + Description: One or more captcha configuration value is missing (key, secret or threshold). Please provide all the necessary captcha fields. + ErrorCode: 8021 + CAPTCHA_THRESHOLD_INVALID: + value: + Message: Captcha config is invalid + Description: Threshold value must be between 0 and 1. Please provide a valid threshold and try again. + ErrorCode: 8021 + IP_AUTHORIZATION_DISABLED: + value: + ErrorCode: 7973 + Message: Site is not configured for IP Restrictions. + Description: Request couldn't be processed,IP Restrictions feature is not enabled for this site. + SPECIAL_CHARACTERS_NOT_ALLOWED: + value: + ErrorCode: 8019 + Message: Only hyphen (-) is allowed between the start IP and end IP + Description: Only hyphen (-) is allowed between the start IP and end IP. Please try again. + INVALID_IP_ADDRESS: + value: + ErrorCode: 8018 + Message: Invalid IP configuration + Description: Request couldn't be processed, IP address is invalid or not well formatted. + SAME_START_AND_END: + value: + ErrorCode: 7975 + Message: Start IP and End IP cannot be the same + Description: Start IP and End IP cannot be the same. Please try again. + INVALID_IP_ADDRESS_RANGE: + value: + ErrorCode: 8018 + Message: Invalid IP configuration + Description: Start IP should be lower than the end IP and both IP addresses must be valid. Ensure that the provided range is valid. + JWT_CONFIG_NOT_FOUND: + value: + Description: JWT configuration not found or the resource does not exist. + ErrorCode: 7958 + Message: JWT configuration not found + SSO_APPNAME_REQUIRED: + value: + ErrorCode: 8087 + Message: Jwt configuration not valid + Description: The AppName is required. Please use a valid AppName. + SSO_APPNAME_LENGTH_EXCEEDED: + value: + ErrorCode: 8087 + Message: Jwt configuration not valid + Description: The AppName length exceeded the maximum limit of 60 characters. Please enter a valid AppName. + SSO_APPNAME_INVALID: + value: + ErrorCode: 8087 + Message: Jwt configuration not valid + Description: The AppName provided is invalid. It must contain only alphanumeric characters, hyphens (-), and underscores (_), and must not start or end with a hyphen or underscore. Please use a valid AppName. + JWT_ALOGITHM_REQUIRED: + value: + ErrorCode: 8087 + Message: Jwt configuration not valid + Description: The Algo is required. Please use a valid Algo. + JWT_ALOGRITHM_INVALID: + value: + ErrorCode: 8087 + Message: Jwt configuration not valid + Description: The Algo provided is invalid. Please use a valid Algo. + JWT_RESPONSE_MODE_INVALID: + value: + ErrorCode: 8087 + Message: Jwt configuration not valid + Description: The ResponseMode provided is invalid. Please use a valid ResponseMode. + JWT_QUERY_STRING_PARAMETER_INVALID: + value: + ErrorCode: 8087 + Message: Jwt configuration not valid + Description: The QueryStringParameter provided is invalid. It must contain only alphanumeric characters, hyphens (-), and underscores (_),Please enter a valid QueryStringParameter. + JWT_LOGIN_URL_INVALID: + value: + Message: Jwt configuration not valid + Description: The LoginUrl provided is invalid. Please use a valid LoginUrl. + ErrorCode: 8087 + JWT_EXPIRY_TIME_INVALID: + value: + ErrorCode: 8087 + Message: Jwt configuration not valid + Description: The NotAfterDifference provided is invalid. Please use a valid NotAfterDifference. + JWT_NOT_BEFORE_INVALID: + value: + ErrorCode: 8087 + Message: Jwt configuration not valid + Description: The NotBeforeDifference provided is invalid. Please use a valid NotBeforeDifference. + JWT_NOT_BEFORE_LESS_THAN_EXPIRY: + value: + ErrorCode: 8087 + Message: Jwt configuration not valid + Description: The NotBeforeDifference must be less than NotAfterDifference. Please use a valid NotBeforeDifference. + JWT_SECRET_REQUIRED: + value: + ErrorCode: 8087 + Message: Jwt configuration not valid + Description: The Secret is required. Please use a valid Secret. + JWT_SECRET_INVALID: + value: + ErrorCode: 8087 + Message: Jwt configuration not valid + Description: The Secret is not compatible with the %s Algo. Please use a valid Secret. + JWT_MAPPING_REQUIRED: + value: + ErrorCode: 8087 + Message: Jwt configuration not valid + Description: The Mapping is required. Please use a valid Mapping. + JWT_MAPPING_INVALID: + value: + ErrorCode: 8087 + Message: Jwt configuration not valid + Description: The Mapping provided is invalid. Please use a valid Mapping. + JWT_CONFIG_ALREADY_EXIST: + value: + Description: Request couldn't be processed due duplicated app name of JWT configuration, Please use a unique name in order to process this request. + ErrorCode: 7960 + Message: A JWT config already exist + SAML_CONFIG_NOT_FOUND: + value: + Description: Security Assertion Markup Language (SAML) configuration is not configured or the resource does not exist. + ErrorCode: 7938 + Message: SAML configuration not found + SSO_APPNAME_REQUIRED_SAML: + value: + ErrorCode: 8097 + Message: SAML IDP config is invalid + Description: The AppName is required. Please use a valid AppName. + SSO_APPNAME_LENGTH_EXCEEDED_SAML: + value: + ErrorCode: 8097 + Message: SAML IDP config is invalid + Description: The AppName length exceeded the maximum limit of 60 characters. Please enter a valid AppName. + SSO_APPNAME_INVALID_SAML: + value: + ErrorCode: 8097 + Message: SAML IDP config is invalid + Description: The AppName provided is invalid. It must contain only alphanumeric characters, hyphens (-), and underscores (_), and must not start or end with a hyphen or underscore. Please use a valid AppName. + SAML_IDP_LOCATION_BINDING_REQUIRED: + value: + ErrorCode: 8097 + Message: SAML IDP config is invalid + Description: The AssertionConsumerService Location and Binding is required. Please enter a valid AssertionConsumerService Location and Binding. + SAML_IDP_BINDING_INVALID: + value: + ErrorCode: 8097 + Message: SAML IDP config is invalid + Description: The AssertionConsumerService Binding is invalid. Please enter a valid AssertionConsumerService Binding. + SAML_IDP_LOCATION_REQUIRED: + value: + ErrorCode: 8097 + Message: SAML IDP config is invalid + Description: The AssertionConsumerService Location is required. Please enter a valid AssertionConsumerService Location. + SAML_IDP_LOCATION_INVALID: + value: + ErrorCode: 8097 + Message: SAML IDP config is invalid + Description: The AssertionConsumerService Location is invalid. Please enter a valid AssertionConsumerService Location. + SAML_SP_LOGOUT_URI_REQUIRED_IDP: + value: + ErrorCode: 8097 + Message: SAML IDP config is invalid + Description: The SpLogoutUrl is required. Please enter a valid SpLogoutURI. + SAML_SP_LOGOUT_INVALID_IDP: + value: + ErrorCode: 8097 + Message: SAML IDP config is invalid + Description: The SpLogoutUrl is invalid. Please enter a valid SpLogoutUrl. + SAML_LOGIN_URI_REQUIRED: + value: + ErrorCode: 8097 + Message: SAML IDP config is invalid + Description: The LoginUrl is required. Please enter a valid LoginURI. + SAML_LOGIN_URI_INVALID: + value: + ErrorCode: 8097 + Message: SAML IDP config is invalid + Description: The LoginUrl is invalid. Please enter a valid LoginURI. + SAML_AFTER_LOGOUT_URI_REQUIRED: + value: + ErrorCode: 8097 + Message: SAML IDP config is invalid + Description: The AfterLogoutUrl is required. Please enter a valid AfterLogoutURI. + SAML_AFTER_LOGOUT_URI_INVALID: + value: + ErrorCode: 8097 + Message: SAML IDP config is invalid + Description: The AfterLogoutUrl is invalid. Please enter a valid AfterLogoutURI. + SAML_SP_CERTIFICATE_INVALID: + value: + ErrorCode: 8097 + Message: SAML IDP config is invalid + Description: The SpCertificate is invalid. Please enter a valid SpCertificate. + SAML_SP_CERTIFICATE_REQUIRED: + value: + ErrorCode: 8097 + Message: SAML IDP config is invalid + Description: The SpCertificate is required. Please enter a valid SpCertificate. + SAML_ATTRIBUTE_FORMAT_REQUIRED: + value: + ErrorCode: 8097 + Message: SAML IDP config is invalid + Description: The Attribute Format is required. Please enter a valid AttributeFormat. + SAML_AUDIENCE_REQUIRED: + value: + ErrorCode: 8097 + Message: SAML IDP config is invalid + Description: The Audiences is required. Please enter a valid Audiences. + SAML_CONFIG_ALREADY_ADDED: + value: + Description: Security Assertion Markup Language (SAML) configuration for the provided ProviderName has already been added to your LoginRadius site. + ErrorCode: 7939 + Message: SAML configuration already exist + OAUTH_INTEGRATION_CONFIG_INVALID: + summary: OAUTH_INTEGRATION_CONFIG_INVALID + value: + ErrorCode: 8253 + Message: OAuth integration configuration is invalid + Description: The GrantTypes provided are not allowed. Only authorization_code and refresh_token are supported for OAuth integrations. + OAUTH_INTEGRATION_WORKFLOW_NOT_FOUND: + summary: OAUTH_INTEGRATION_WORKFLOW_NOT_FOUND + value: + ErrorCode: 8253 + Message: OAuth integration configuration is invalid + Description: The workflow you are requesting does not exist. Please enter the name of an existing workflow. + OAUTH_GRANT_TYPE_INVALID: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The GrantTypes provided are invalid, Please enter a valid GrantType. + OAUTH_SCOPE_INVALID: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The AllowedScopes provided are invalid, Please enter a valid scope. + OAUTH_INTEGRATION_CONFIG_NOT_FOUND: + summary: OAUTH_INTEGRATION_CONFIG_NOT_FOUND + value: + ErrorCode: 8254 + Message: OAuth integration configuration not found + Description: The OAuth integration configuration is not configured or the resource does not exist. + RAAS_UPDATE_FIELDS_INVALID: + value: + Message: Jwt configuration not valid + Description: The UpdateFields provided is invalid. Please enter a valid UpdateFields. + ErrorCode: 8087 + SSO_MAPPING_INVALID_JWT_SP: + value: + Message: Jwt configuration not valid + Description: The Mapping provided is invalid. Please enter a valid Mapping. + ErrorCode: 8087 + ID_MAPPING_REQUIRED: + value: + Message: Jwt configuration not valid + Description: The ID Mapping is required. Please enter a valid ID Mapping. + ErrorCode: 8087 + SSO_MAPPING_REQUIRED_JWT_SP: + value: + Message: Jwt configuration not valid + Description: The Mapping is required. Please enter a valid Mapping. + ErrorCode: 8087 + JWT_CLOCK_SKEW_INVALID: + value: + Message: Jwt configuration not valid + Description: The ClockSkew provided is invalid. Please enter a valid ClockSkew. + ErrorCode: 8087 + JWT_AUDIENCE_REQUIRED: + value: + Message: Jwt configuration not valid + Description: The Audience is required. Please enter a valid Audience. + ErrorCode: 8087 + JWT_ISSUER_REQUIRED: + value: + Message: Jwt configuration not valid + Description: The Issuer is required. Please enter a valid Issuer. + ErrorCode: 8087 + AUTO_LOOKUP_DOMAIN_INVALID: + value: + Message: Jwt configuration not valid + Description: The Domain provided is invalid. Please enter a valid email Domain. + ErrorCode: 8087 + DOMAIN_NAME_IS_REQUIRED_JWT_SP: + value: + Message: Jwt configuration not valid + Description: You have chosen EnableAutoLookUp as true. Please enter a valid domain name. + ErrorCode: 8087 + JWT_JWKSURL_INVALID: + value: + Message: Jwt configuration not valid + Description: The JWKSURL provided is invalid. Please enter a valid JWKSURL. + ErrorCode: 8087 + JWT_KEY_INVALID: + value: + Message: Jwt configuration not valid + Description: The Key provided is invalid. Please enter a valid Key. + ErrorCode: 8087 + JWT_LOGIN_URL_INVALID_JWT_SP: + value: + ErrorCode: 8087 + Message: Jwt configuration not valid + Description: The LoginUrl provided is invalid. Please use a valid LoginUrl. + JWT_ALGORITHM_REQUIRED: + value: + Message: Jwt configuration not valid + Description: The Algo is required. Please enter a valid Algo. + ErrorCode: 8087 + SSO_APPNAME_INVALID_JWT_SP: + value: + Message: Jwt configuration not valid + Description: The AppName provided is invalid. It must contain only alphanumeric characters, hyphens (-), and underscores (_), and must not start or end with a hyphen or underscore. Please use a valid AppName. + ErrorCode: 8087 + SSO_APPNAME_REQUIRED_JWT_SP: + value: + Message: Jwt configuration not valid + Description: The AppName is required. Please use a valid AppName. + ErrorCode: 8087 + SSO_APPNAME_LENGTH_EXCEEDED_JWT_SP: + value: + Message: Jwt configuration not valid + Description: The AppName length exceeded the maximum limit of 60 characters. Please enter a valid AppName. + ErrorCode: 8087 + MISSING_JWKSURL: + value: + Message: Jwt configuration not valid + Description: Atleast one of the Key or JWKS URL fields with a valid input is required for an ES or RS algorithm. + ErrorCode: 8087 + MISSING_JWT_KEY: + value: + Message: Jwt configuration not valid + Description: A valid JWT key is required in the `key` field for an HS algorithm. + ErrorCode: 8087 + DOMAIN_NAME_ALREADY_EXISTS: + value: + Message: Domain name already exists + Description: The entered domain name is already associated with a configuration. Please input a different domain name. + ErrorCode: 8038 + SAML_PROVIDR_NAME_INVALID: + value: + Message: SAML SP config is invalid + Description: The Provider is invalid. It must contain only alphanumeric characters, hyphens (-), and underscores (_), and cannot start or end with a hyphen or underscore. Please enter a valid Provider name. + ErrorCode: 8089 + SAML_PROVIDR_NAME_LENGTH_EXCEEDED: + value: + Message: SAML SP config is invalid + Description: The Provider name length exceeded the maximum limit of 60 characters. Please enter a valid Provider name. + ErrorCode: 8089 + SSO_FRIENDLY_PROVIDER_NAME_INVALID: + value: + Message: SAML SP config is invalid + Description: The FriendlyProviderName is invalid. Please enter a valid FriendlyProviderName with a maximum length of 60 characters. + ErrorCode: 8089 + SAML_IDP_CERTIFICATE_IS_REQUIRED: + value: + Message: SAML SP config is invalid + Description: The IdpCertificate is required. Please enter a valid IdpCertificate. + ErrorCode: 8089 + SAML_IDP_CERTIFICATE_INVALID: + value: + Message: SAML SP config is invalid + Description: The IdpCertificate is invalid. Please enter a valid IdpCertificate. + ErrorCode: 8089 + SSO_MAPPING_INVALID: + value: + Message: SAML SP config is invalid + Description: The Mapping provided is invalid. Please enter a valid Mapping. + ErrorCode: 8089 + SSO_MAPPING_REQUIRED: + value: + Message: SAML SP config is invalid + Description: The Mapping is required. Please enter a valid Mapping. + ErrorCode: 8089 + INVALID_DOMAIN_NAME_SP: + value: + Message: SAML SP config is invalid + Description: The provided domain name is invalid. Please enter a valid domain name. + ErrorCode: 8089 + DOMAIN_NAME_IS_REQUIRED_SP: + value: + Message: SAML SP config is invalid + Description: You have chosen EnableAutoLookUp as true. Please enter a valid domain name. + ErrorCode: 8089 + SAML_SP_LOGOUT_INVALID: + value: + Message: SAML SP config is invalid + Description: The IdentityProvider Logout is invalid. Please enter a valid IdentityProvider Logout. + ErrorCode: 8089 + SAML_SP_LOCATION_INVALID: + value: + Message: SAML SP config is invalid + Description: The IdentityProvider Location is invalid. Please enter a valid IdentityProvider Location. + ErrorCode: 8089 + SAML_SP_LOGOUT_REQUIRED: + value: + Message: SAML SP config is invalid + Description: The IdentityProvider Logout is required. Please enter a valid IdentityProvider Logout. + ErrorCode: 8089 + SAML_SP_LOCATION_REQUIRED: + value: + Message: SAML SP config is invalid + Description: The IdentityProvider Location is required. Please enter a valid IdentityProvider Location. + ErrorCode: 8089 + SAML_SP_BINDING_INVALID: + value: + Message: SAML SP config is invalid + Description: The IdentityProvider Binding is invalid. Please enter a valid IdentityProvider Binding. + ErrorCode: 8089 + SAML_SP_LOCATION_LOGOUT_BINDING_REQUIRED: + value: + Message: SAML SP config is invalid + Description: The IdentityProvider Location, Logout and Binding is required. Please enter a valid IdentityProvider Location, Logout and Binding. + ErrorCode: 8089 + SAML_PROVIDR_NAME_REQUIRED: + value: + Message: SAML SP config is invalid + Description: The Provider is required. Please enter a Provider name. + ErrorCode: 8089 + CUSTOM_FIELD_LIMIT_EXCEEDED: + value: + Message: Custom field limit exceeded + Description: The maximum number of custom fields allowed is 15. Please remove some custom fields to add new ones. + ErrorCode: 8042 + CUSTOM_FIELD_NOT_FOUND: + value: + Message: Custom field does not exist + Description: The Custom field is not configured, Please configure the custom fields before proceeding. + ErrorCode: 7929 + INVALID_NAME: + summary: INVALID_NAME + value: + ErrorCode: 8108 + Message: Invalid name + Description: Invalid Name. It must be alphanumeric, hyphens (-), underscores (_), not start/end with hyphen/underscore, and max length 60. + CUSTOM_FIELD_ALLREADY_EXISTS: + value: + Message: Custom field is already created + Description: This custom field is already created for this site, Please use the existing field. + ErrorCode: 7919 + CUSTOMER_REGISTRATION_CUSTOM_DATA_NOT_EXISTS: + value: + Message: Custom data is not configured for this site + Description: The Custom data is not configured for this site, Please configure the custom data. + ErrorCode: 7928 + SSO_APPNAME_REQUIRED_OAUTH: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The AppName is required. Please use a valid AppName. + SSO_APPNAME_LENGTH_EXCEEDED_OAUTH: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The AppName length exceeded the maximum limit of 60 characters. Please enter a valid AppName. + SSO_APPNAME_INVALID_OAUTH: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The AppName provided is invalid. It must contain only alphanumeric characters, hyphens (-), and underscores (_), and must not start or end with a hyphen or underscore. Please use a valid AppName. + OAUTH_AUDIENCE_SCOPES_INVALID: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The AudienceScopes provided is invalid, Please enter a valid AudienceScopes. + OAUTH_CLIENT_TYPE_INVALID: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The ClientType provided is invalid. Please enter a valid ClientType (public or confidential). + OAUTH_DESCRIPTION_LENGTH_EXCEEDED: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The Description length exceeded the maximum limit of 255 characters. Please enter a valid Description. + OAUTH_TOKEN_AUTH_METHOD_INVALID: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The TokenAuthMethod provided is invalid, Please enter a valid TokenAuthMethod. + OAUTH_GTY_CLIENT_CRED_NOT_ALLOWED_WITH_NONE: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The Client Credentials Grant Types is not allowed with none Token Authentication Type. + OAUTH_GTY_TOKEN_EXCH_NOT_ALLOWED_WITH_NONE: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The Token Exchange Grant Types is not allowed with none Token Authentication Type. + OAUTH_JWTCONFIG_TOKEN_TTL_INVALID: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The JwtTokenConfig IdTokenTTL provided is invalid, Please enter a valid JwtTokenConfig IdTokenTTL. + OAUTH_REFRESH_TOKEN_TTL_INVALID: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The RefreshTokenTTL provided is invalid, Please enter a valid RefreshTokenTTL + OAUTH_REFRESH_TOKEN_TTL_MUST_GT_TOKEN_TTL: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The RefreshTokenTTL provided must be greater than JwtTokenConfig TokenTTL, if JwtTokenConfig TokenTTL not provided then RefreshTokenTTL must be greater than 3600. + OAUTH_LOGIN_REDIRECT_URL_INVALID: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The LoginRedirectURL provided is invalid, Please enter a valid LoginRedirectURL + OAUTH_CORS_ORIGIN_INVALID: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The AllowedCorsOrigin provided is invalid, Please enter a valid AllowedCorsOrigin URLs + OAUTH_DEVICE_CODE_BOTH_VERIFICATION_URL_REQUIRED: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The DeviceCodeConfig VerificationURL and AfterVerificationURL are required. + OAUTH_DEVICE_CODE_VERIFICATION_URL_REQUIRED: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The DeviceCodeConfig VerificationURL is required. + OAUTH_DEVICE_CODE_AFTER_VERIFICATION_URL_REQUIRED: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The DeviceCodeConfig AfterVerificationURL is required. + OAUTH_DEVICE_CODE_EXPIRE_INVALID: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The DeviceCodeExpire provided is invalid, Please enter a valid DeviceCodeExpire + OAUTH_DEVICE_CODE_POLLING_INTERVAL_INVALID: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The PollingInterval provided is invalid, Please enter a valid PollingInterval + OAUTH_DEVICE_CODE_USER_CHAR_SET_INVALID: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The DeviceCodeConfig UserCodeCharacterSet provided is invalid, Please enter a valid UserCodeCharacterSet + OAUTH_DEVICE_CODE_USER_CODE_MASK_INVALID: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The DeviceCodeConfig UserCodeMask provided is invalid, Please enter a valid UserCodeMask + OAUTH_DEVICE_CODE_VERIFICATION_URL_INVALID: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The DeviceCodeConfig VerificationURL provided is invalid, Please enter a valid VerificationURL + OAUTH_DEVICE_CODE_AFTER_VERIFICATION_URL_INVALID: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The DeviceCodeConfig AfterVerificationURL provided is invalid, Please enter a valid AfterVerificationURL + OAUTH_LOGOUT_REDIRECT_URL_INVALID: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The LogoutRedirectURL provided is invalid, Please enter a valid LogoutRedirectURL + OAUTH_CIBA_TOKEN_TTL_INVALID: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The BackChannelLogout LogoutTokenTTL provided is invalid, Please enter a valid LogoutTokenTTL. + OAUTH_CIBA_LOGOUT_URI_INVALID: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The BackChannelLogout LogoutURI provided is invalid, Please enter a valid BackChannelLogout LogoutURI + OAUTH_CIBA_LOGOUT_URI_REQUIRED: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The BackChannelLogout LogoutURI is required. + OAUTH_SECRET_FORMAT_INVALID: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The Secret provided is not formatted or invalid, Please enter a valid Secret. + OAUTH_REFRESH_TOKEN_ROTATION_OVERLAP_INVALID: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The RefreshTokenRotation ReuseInterval provided is invalid. Please enter a value between 0 and 60. + WORKFLOW_NOT_FOUND: + summary: WORKFLOW_NOT_FOUND + value: + ErrorCode: 1399 + Message: Workflow not found + Description: The workflow you are requesting does not exist. Please enter the name of an existing workflow. + OAUTH_CONFIG_ALREADY_EXIST: + value: + Description: OAuth configuration already exist for this site, Please use a unique name in order to process this request. + ErrorCode: 7982 + Message: A OAuth config already exist + OAUTH_CONFIG_NOT_FOUND: + value: + Description: OAuth configuration not found or the resource does not exist. + ErrorCode: 7981 + Message: OAuth configuration not found + OAUTH_PASSWORD_LESS_LOGIN_FEATURE_DISABLED: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The PasswordLessLogin feature is disabled, Please enable the PasswordLessLogin feature to update Connections PasswordLessLogin. + OAUTH_PASSWORD_LESS_EMAIL_LOGIN_DISABLED: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The Email PasswordLessLogin cannot be enabled because Passwordless Email login is disabled for the tenant. Please enable Passwordless Email login first. + OAUTH_PASSWORD_LESS_SMS_LOGIN_DISABLED: + value: + ErrorCode: 8088 + Message: OAuth configuration not valid + Description: The SMS PasswordLessLogin cannot be enabled because Passwordless Phone (SMS) login is disabled for the tenant. Please enable Passwordless Phone login first. + OAUTH_CONFIG_CREDENTIALS_RESET_FAILED: + value: + Description: Global client is enabled for the oauth config. Please disable the global client first. + ErrorCode: 8014 + Message: Oauth config client credentials reset failed. + ERROR_UNMARSHALLING_DATA: + value: + Message: Error unmarshalling data + Description: Error unmarshalling data, Please provide valid data. + ErrorCode: 8081 + CUSTOM_OAUTH_CONFIG_NOT_FOUND: + value: + Message: Custom OAuth configuration not found + Description: Custom OAuth provider is not configured or the resource does not exist. + ErrorCode: 7936 + INVALID_DOMAIN_NAME: + value: + Message: Invalid custom provider config + Description: The provided domain name is invalid. Please enter a valid domain name. + ErrorCode: 8007 + DOMAIN_NAME_IS_REQUIRED: + value: + Message: Invalid domain name + Description: You have chosen EnableAutoLookUp as true. Please enter a valid domain name. + ErrorCode: 8039 + CUSTOM_OAUTH_PROVIDER_ALREADY_ADDED: + value: + Message: Custom OAuth provider already exist + Description: A custom OAuth provider is already configured on your site. + ErrorCode: 7937 + ERROR_RAAS_CONFIG_EMPTY: + value: + Message: Raas config is empty + Description: Raas config is empty, Please provide valid data. + ErrorCode: 8083 + INVALID_EXPIRATION_FREQUENCY_TYPE: + value: + Message: Invalid password policy configuration + Description: Invalid expiration frequency type, Please provide valid type. + ErrorCode: 7983 + INVALID_EXPIRATION_FREQUENCY: + value: + Message: Invalid password policy configuration + Description: Invalid expiration frequency, Please provide valid frequency. + ErrorCode: 7983 + INVALID_MAX_PASSWORD_HISTORY: + value: + Message: Invalid password policy configuration + Description: The maximum password history value is invalid. Please provide a valid value between 1 and 100. + ErrorCode: 7983 + CUSTOMER_REGISTRATION_CONFIG_NOT_FOUND: + value: + Message: User registration configuration not found + Description: The user registration configuration does not exist for this site. Please setup the configuration for user registration. + ErrorCode: 7933 + ApiKeySecretMissing: + summary: ApiKeySecretMissing + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly in the request, please check all the parameters in the API call. + Description: The apikey is a required parameter,The apisecret is a required parameter. + ApiKeyMissing: + summary: ApiKeyMissing + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly in the request, please check all the parameters in the API call. + Description: The apikey is a required parameter. + ApiSecretMissing: + summary: ApiSecretMissing + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly in the request, please check all the parameters in the API call. + Description: The apisecret is a required parameter. + ApiKeyInvalid: + summary: ApiKeyInvalid + value: + ErrorCode: 920 + Message: API key is invalid + Description: The provided LoginRadius API key is invalid, please use a valid API key of your LoginRadius account. + ApiSecretInvalid: + summary: ApiSecretInvalid + value: + ErrorCode: 921 + Message: API secret is invalid + Description: The provided LoginRadius API secret is invalid, please use a valid API secret of your LoginRadius account. + NextParamInvalid: + summary: NextParamInvalid + value: + ErrorCode: 1042 + Message: Pass a valid next param + Description: The next param is either expired or invalid. Please start with a POST request again. + NextParamNotValid: + summary: NextParamNotValid + value: + ErrorCode: 1046 + Message: Pass a valid next param + Description: The next param is not valid. + AccessRestriction: + summary: AccessRestriction + value: + ErrorCode: 909 + Message: Your LoginRadius site does not have permission to access this endpoint + Description: Your LoginRadius site does not have permission to access this endpoint, please contact LoginRadius support for more information. + NextParamMissing: + summary: NextParamMissing + value: + ErrorCode: 1043 + Message: Pass a valid next param + Description: The next param is missing. Please start with a POST request to get next value. + ApiKeyUnauthorized: + summary: ApiKeyUnauthorized + value: + ErrorCode: 901 + Message: The API key is unauthorized + Description: The provided LoginRadius API key is invalid or is not authorized, please use a valid or authorized LoginRadius API key or check the API key for your LoginRadius account. + ApiSecretUnauthorized: + summary: ApiSecretUnauthorized + value: + ErrorCode: 902 + Message: The API Secret is unauthorized + Description: The provided LoginRadius API secret is invalid or is not authorized, please use a valid LoginRadius API secret or check the API secret for your LoginRadius account. + PostBodyInvalid: + summary: PostBodyInvalid + value: + ErrorCode: 965 + Message: The post body is invalid. + Description: Please use a valid post body and make sure that it is in a valid JSON format. + ParameterBadFormat: + summary: ParameterBadFormat + value: + ErrorCode: 908 + Message: A parameter is not formatted correctly in the request, please check all the parameters in the API call. + Description: Verify that the datatypes for all of the parameters and parameters are correct when making the API call. + DateRangeMissing: + summary: DateRangeMissing + value: + ErrorCode: 928 + Message: The date range is missing + Description: From & To dates are required parameters. please pass correct From & To dates. + DateRangeFromInvalidFormat: + summary: DateRangeFromInvalidFormat + value: + ErrorCode: 925 + Message: The date range has an invalid format + Description: The From date has an invalid format, please use a valid ISO_8601 date format. + DateRangeToInvalidFormat: + summary: DateRangeToInvalidFormat + value: + ErrorCode: 926 + Message: The date range has an invalid format + Description: The To date has an invalid format, please use a valid ISO_8601 date format. + DateRangeInvalid: + summary: DateRangeInvalid + value: + ErrorCode: 927 + Message: The date range is invalid + Description: The From data is greater than or equal to the To date, please pass correct From & To dates. + QueryFormatInvalid: + summary: QueryFormatInvalid + value: + ErrorCode: 919 + Message: The query format is not valid + Description: The format of the query is not valid, query should be an object. + QueryInvalid: + summary: QueryInvalid + value: + ErrorCode: 918 + Message: The query is invalid + Description: The query is not correct, please review the query and send the correct parameters. + CustomObjectNameInvalid: + summary: CustomObjectNameInvalid + value: + ErrorCode: 1064 + Message: Custom object name is invalid + Description: The custom object name used in this request is incorrect or does not exist. + CustomObjectNotAvailable: + summary: CustomObjectNotAvailable + value: + ErrorCode: 1064 + Message: Custom objects are not available + Description: The custom objects are not available for this App. Please contact LoginRadius support for more information + CustomObjectNameMissing: + summary: CustomObjectNameMissing + value: + ErrorCode: 1036 + Message: The Custom Object name is required + Description: The Custom Object name is required, please pass a Custom Object name. + CustomObjectSchemaNotSet: + summary: CustomObjectSchemaNotSet + value: + ErrorCode: 1003 + Message: Schema is not set for the passed Custom Object + Description: The Custom Object schema is not set in dashboard. Schema should be set to query Custom Object. Please contact LoginRadius Support. + DANGEROUS_REQUEST_SSO: + value: + Description: A potentially dangerous request value was detected. + ErrorCode: 1214 + Message: Dangerous request + EMAIL_PAYLOAD_REQUIRED: + value: + Description: The email is a required parameter. + ErrorCode: 908 + Message: A parameter is not formatted correctly + EMAILID_ID_FORMAT_NOT_VALID_SSO: + value: + Description: The provided email ID is invalid or not well-formatted, a valid email ID is required in order to process this request. + ErrorCode: 1038 + Message: Valid email ID is required + INVALID_HOST: + value: + Description: Your request is coming from an invalid host and this host is not configured on LoginRadius.
Please follow these instructions to get the social login working on your website. + ErrorCode: 1309 + Message: Invalid Requested Host + INVALID_PHONE_NUMBER_SSO: + value: + Description: The provided phone number is not valid or not well-formatted, please review the phone number in order to process this request. + ErrorCode: 1096 + Message: Invalid phone number. + INVALID_POST_BODY: + value: + Description: Please use a valid post body and make sure that it is in a valid JSON format + ErrorCode: 2007 + Message: invalid_request + JWT_APP_NAME_REQUIRED: + value: + Description: The JwtApp is a required parameter. + ErrorCode: 908 + Message: A parameter is not formatted correctly + JWT_APP_NOT_MATCHED: + value: + Description: The jwtapp query parameter did not match the value in the request path. + ErrorCode: 908 + Message: A parameter is not formatted correctly + PASSWORD_EMAIL_PAYLOAD_REQUIRED: + value: + Description: The password is a required parameter, The email is a required parameter. + ErrorCode: 908 + Message: A parameter is not formatted correctly + PASSWORD_PAYLOAD_REQUIRED: + value: + Description: The password is a required parameter. + ErrorCode: 908 + Message: A parameter is not formatted correctly + PASSWORD_PHONE_PAYLOAD_REQUIRED: + value: + Description: The password is a required parameter, The phone is a required parameter. + ErrorCode: 908 + Message: A parameter is not formatted correctly + PASSWORD_USERNAME_PAYLOAD_REQUIRED: + value: + Description: The password is a required parameter, The username is a required parameter. + ErrorCode: 908 + Message: A parameter is not formatted correctly + PHONE_OR_EMAIL_OR_USER_REQUIRED_PARAM_SSO: + value: + Description: The email/username/phone is a required parameter. + ErrorCode: 908 + Message: A parameter is not formatted correctly + PHONE_PAYLOAD_REQUIRED_SSO: + value: + Description: The phone is a required parameter. + ErrorCode: 908 + Message: A parameter is not formatted correctly + POST_BODY_INVALID_SSO: + value: + Description: Please use a valid post body and make sure that it is in a valid JSON format. + ErrorCode: 965 + Message: The post body is invalid + USERNAME_PAYLOAD_REQUIRED: + value: + Description: The username is a required parameter. + ErrorCode: 908 + Message: A parameter is not formatted correctly + JWT_CONFIG_NOT_FOUND_SSO: + value: + Description: The JWT configuration not found or the resource does not exist. + ErrorCode: 1180 + Message: JWT configuration not found. + JWT_CONFIG_NOT_VALID: + value: + Description: The JWT configuration is not valid, please check the JWT configuration for your LoginRadius account. + ErrorCode: 1189 + Message: JWT configuration not valid. + USERNAME_OR_PASSWORD_WRONG_SSO: + value: + Description: Please use a valid user ID and password combination. + ErrorCode: 966 + Message: Invalid user ID and/or password + GENERIC_AUTH_ERROR_SSO: + summary: GENERIC_AUTH_ERROR + value: + Description: The credentials provided could not be authenticated. + ErrorCode: 1409 + Message: Authentication failed + ACCOUNT_NOT_ALLOWED_TO_LOGIN_SSO: + value: + Description: The provided account is not allowed to login, please reach out to LoginRadius support for more information. + ErrorCode: 1220 + Message: Account is not allowed to login + ACTIVE_SESSIONS_EXCEEDED_SSO: + value: + Description: You have exceeded the maximum number of allowed active login sessions. Please log out of any other active session before attempting to log in again. If you need further assistance, contact support. + ErrorCode: 1338 + Message: Exceeded active login session limit + API_KEY_NOT_VALID_SSO: + value: + Description: The provided LoginRadius API key is invalid or is not authorized, please use a valid or authorized LoginRadius API key or check the API key for your LoginRadius account. + ErrorCode: 901 + Message: The API key is unauthorized + APP_DOESNT_HAVE_PERMISSION_TO_ACCESS_THIS_ENDPOINT_SSO: + value: + Description: Your LoginRadius site does not have permission to access this endpoint, please contact LoginRadius support for more information. + ErrorCode: 909 + Message: Your LoginRadius site does not have permission to access this endpoint + BREACHED_PASSWORD_LOGIN_SSO: + value: + Description: Your password is found in a data breach unrelated to this app/service. Please reset your password using the email we sent you. + ErrorCode: 1316 + Message: Your password is exposed in an external data breach. + CAPTCHA_NOT_VALID_SSO: + value: + Description: CAPTCHA is invalid, please enter the correct CAPTCHA value. + ErrorCode: 982 + Message: CAPTCHA is invalid + CHANGE_BREACHED_PASSWORD: + value: + Description: Your password is exposed in an external data breach. As a caution, we’ve already sent you an email with steps to reset your password. Please try to login after resetting your password. + ErrorCode: 1317 + Message: Please reset your password via the email we sent you. + CONSENT_FORM_NOT_SUBMITTED_SSO: + value: + Description: Consent form not submitted, please accept the consent form. + ErrorCode: 1226 + Message: Consent form not submitted. + EMAIL_NOT_VERIFIED_SSO: + value: + Description: This email has not yet been verified, please click the link in your email to confirm your email address. + ErrorCode: 970 + Message: Email is not verified + EMAIl_OR_PHONE_NUMBER_REQUIRED_VERIFIED: + value: + Description: The email or phone number is not verified, please verify email or phone number for login. + ErrorCode: 1287 + Message: Email or phone number is not verified + LOGIN_DISABLED_SSO: + value: + Description: Login services have been disabled for your account, please contact the admin or site owner. + ErrorCode: 1130 + Message: Login services have been disabled for your account + LOGIN_IS_LOCKED_FOR_RECAPTCHA_SSO: + value: + Description: Your account has been locked, please login with a valid reCAPTCHA in order to continue. + ErrorCode: 1132 + Message: Your account has been locked + LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION_SSO: + value: + Description: Your account has been locked, please login with an answer to the security question in order to continue. + ErrorCode: 1148 + Message: Your account has been locked + LOGIN_WITH_PASSWORD_NOT_ENABLED_SSO: + value: + Description: Password-based login is disabled for your site. Please enable the Login with Password feature. + ErrorCode: 1286 + Message: You cannot log in with a password + OPERATION_FAILED_SSO: + value: + Description: An unknown error has occurred, please try again in a few minutes or contact your system admin. + ErrorCode: 950 + Message: Operation failed due to an unknown error + OTP_SEND_FAILED_SSO: + value: + Description: The Verification OTP Code sending failed, please try again. + ErrorCode: 1072 + Message: The Verification code (OTP) send failed + PHONE_NO_LOGIN_NOT_ENABLED_SSO: + value: + Description: Phone number login is not enabled on your site. + ErrorCode: 1074 + Message: Phone number login is not enabled + PHONE_NOT_VERIFIED_SSO: + value: + Description: The provided phone number is not verified, please use a verified phone number for login. + ErrorCode: 1066 + Message: Phone number is not verified + PIN_IS_REQUIRED_SSO: + value: + Description: The PIN is required and needs to be set, please set PIN in the profile for login. + ErrorCode: 1243 + Message: PIN is required + PRIVACY_POLICY_MISMATCHED_SSO: + value: + Description: You have not accepted the current Privacy Policy. + ErrorCode: 1194 + Message: Privacy Policy does not match + RBA_ACCOUNT_IS_BLOCKED: + value: + Description: Your account has been blocked by the system admin, please contact the admin for more information. + ErrorCode: 1164 + Message: Your account has been blocked due to suspicious activity + RBA_EMAIL_VERIFICATION: + value: + Description: We have identified a suspicious activity with your account, a verification code has been sent to your email to secure your account. + ErrorCode: 1166 + Message: A verification code has been sent to your email + RBA_SECURITY_ANSWER_VERIFICATION: + value: + Description: We have identified a suspicious activity with your account, please answer the security question's to secure your account. + ErrorCode: 1165 + Message: Please answer the security question's to secure your account + RBA_SMS_VERIFICATION: + value: + Description: We have identified a suspicious activity with your account, a verification code has been sent to your phone to secure your account. + ErrorCode: 1167 + Message: A verification code has been sent to you phone + SMS_CONFIGURATION_NOT_EXISTS_SSO: + value: + Description: The SMS configuration does not exist, please configure SMS settings. + ErrorCode: 1071 + Message: The SMS configuration does not exist + SMS_SEND_LIMIT_REACHED_SSO: + value: + Description: The account limit for SMS requests for this resource has been reached for this time due to too many request. + ErrorCode: 1123 + Message: You have reached a limit for sending SMS + TRIAL_PLAN_EXPIRED_SSO: + value: + Description: The trial plan has expired. To continue using the service, please contact support. + ErrorCode: 6003 + Message: Trial plan expired + USER_ID_BLOCKED_SSO: + value: + Description: Your account has been blocked by the system admin, please contact the admin for more information. + ErrorCode: 991 + Message: Your account is blocked + USER_ID_LOCKED_SSO: + value: + Description: Your account has been locked, please try again after sometime. + ErrorCode: 1198 + Message: Your account has been locked + USER_ID_LOCKED_WITH_TIMEOUT_SSO: + value: + Description: Your account has been locked, please try again after sometime. + ErrorCode: 1198 + Message: Your account has been locked + USER_NAME_AUTHENTICATION_ENABLED_SSO: + value: + Description: You can't login from email/phone, please use username for login. + ErrorCode: 1183 + Message: UserName authentication is enabled + USER_NOT_EXISTS_SSO: + value: + Description: The user's account does not exist, please use a valid user or create the user before processing this request. + ErrorCode: 938 + Message: User does not exist + INVALID_PROVIDER_IN_ORGANIZATION_SSO: + value: + Description: The specified provider is not valid or not configured for this organization. Please check your configuration. + ErrorCode: 1269 + Message: Invalid provider in organization + JWT_ACCESS_TOKEN_REQUIRED: + value: + Description: The access_token is a required parameter. + ErrorCode: 908 + Message: A parameter is not formatted correctly + OAUTH_TOKEN_CONFIG_NOT_FOUND_SSO: + value: + Description: Unable to retrieve token configuration for the specified app. + ErrorCode: 2017 + Message: Request is invalid + ORGANIZATION_NOT_FOUND_SSO: + value: + Description: The entered organization or its configuration does not exist. + ErrorCode: 1273 + Message: Organization not found + ACCESS_TOKEN_EXPIRED_SSO: + value: + Description: The LoginRadius access token has expired, please request a new token from LoginRadius API. + ErrorCode: 906 + Message: Access token has expired + ACCESS_TOKEN_NOT_VALID_SSO: + value: + Description: The LoginRadius access token is invalid, please use the correct or valid access token in order to process this request. + ErrorCode: 905 + Message: Access token is invalid + AGE_UNDERAGE_SSO: + value: + Description: You are not eligible for registration, your age must be above specified by admin of this site. + ErrorCode: 1163 + Message: You are not eligible for registration + EMAIL_DOMAIN_NOT_ALLOWED_IN_ORGANIZATION_SSO: + value: + Description: The email domain used is not allowed for this organization connection. Please use an valid domain. + ErrorCode: 2065 + Message: Email domain not allowed in organization connection + EMAIL_DOMAIN_NOT_ALLOWED_TO_REGISTER_SSO: + value: + Description: The provided Email id domain is not allowed to register, please reach out to LoginRadius support for more information. + ErrorCode: 1247 + Message: Email id domain is not allowed to register + EMAILID_ALREADY_REGISTERED_SSO: + value: + Description: The email address has to be unique for your LoginRadius site, please use a different email address. + ErrorCode: 936 + Message: Email address is already registered with your LoginRadius site + JWT_SP_TOKEN_INVALID_SSO: + value: + Description: JWT service provider token is invalid or expired, please use a valid token to process this request. + ErrorCode: 1283 + Message: Invalid or expired JWT token + ORGANIZATION_NOT_ACTIVE_SSO: + value: + Description: Organization is not active, Please provide valid organization id. + ErrorCode: 8180 + Message: Organization is not active + PHONE_NO_ALREADY_REGISTERED_SSO: + value: + Description: The phone number has to be unique for your LoginRadius site, please use a different phone number. + ErrorCode: 1058 + Message: Phone number is already registered with your LoginRadius site + PROVIDER_ID_MISSING_SSO: + value: + Description: provider ID is missing in social data. + ErrorCode: 1302 + Message: provider ID is missing in social data + PROVIDER_NOT_CONFIGURED_SSO: + value: + Description: This social provider has not been configured for the site. + ErrorCode: 1223 + Message: Social provider has not been configured for the site. + PROVIDER_NOT_SUPPORTED_SSO: + value: + Description: Oops, this ID Provider is not supported in your LoginRadius account. + ErrorCode: 1232 + Message: Provider is not supported. + PROVIDER_NOT_VALID_SSO: + value: + Description: The provider name or provider ID is invalid, please use a valid provider name or provider ID. + ErrorCode: 1065 + Message: Provider name or Provider Id is invalid + PROVIDER_SIDE_ERROR_SSO: + value: + Description: An error has occurred at the social identity provider’s end, please check the ‘providerErrorResponse’ for more details. + ErrorCode: 1000 + Message: An error has occurred at the social identity provider’s end. + ROLE_DOES_NOT_EXISTS_SSO: + value: + Description: The provided Role for the user does not exist, please use a valid Role in order to process this request. + ErrorCode: 1047 + Message: Role does not exist + SOMETHING_GOING_WRONG_SSO: + value: + Description: Oops, something went wrong, please try again. + ErrorCode: 2030 + Message: Oops, something went wrong, please try again. + THIS_EMAIL_ID_IS_NOT_ALLOWED_TO_REGISTER_SSO: + value: + Description: The provided Email is not allowed to register, please reach out to LoginRadius support for more information. + ErrorCode: 1056 + Message: Email is not allowed to register + TRIAL_PLAN_USER_LIMIT_REACHED_SSO: + value: + Description: The trial plan user creation limit has been reached. Upgrade your plan to add more users. + ErrorCode: 6004 + Message: User creation limit reached for the trial plan + UNVERIFIED_EXISTING_ACCOUNT_WITH_SAME_EMAIL_ID_SSO: + value: + Description: Please verify your email address first to log in with this social provider. + ErrorCode: 1026 + Message: Cannot login with this social provider as email address is not yet verified + UNVERIFIED_EXISTING_ACCOUNT_WITH_SAME_EMAIL_ID_IN_EMAIL_VERIFCATION_DISABLED_SSO: + value: + Description: please login with your existing account. If you’ve forgotten which provider you have previously registered under, please use the Forgot User ID or Social Provider link. + ErrorCode: 1033 + Message: Cannot login with this social provider as the same email address is already being used with another account + CLIENT_ID_REQUIRED: + value: + error: invalid_request + error_description: The client_id is a required parameter. + CONTENT_TYPE_NOT_SUPPORTED: + value: + error: This content type header is not supported + error_description: Please use a valid content type header as application/json. + OAUTH_APP_RESTRICTED: + value: + error: invalid_request + error_description: Your LoginRadius site does not have permission to access this endpoint, please contact LoginRadius support for more information. + OAUTH_DANGEROUS_REQUEST: + value: + error: Dangerous request + error_description: A potentially dangerous request value was detected. + OAUTH_HOST_NOT_WHITELISTED: + value: + error: invalid_request + error_description: Your request is coming from an invalid host and this host is not configured on LoginRadius.
Please follow these instructions to get the social login working on your website. + OAUTH_POST_BODY_INVALID: + value: + error: invalid_request + error_description: Please use a valid post body and make sure that it is in a valid JSON format + OAUTH_TRIAL_PLAN_EXPIRED: + value: + error: invalid_request + error_description: The trial plan has expired. To continue using the service, please contact support. + SCOPE_INVALID: + value: + error: invalid_request + error_description: The scope parameter contained an invalid value, check your scope again. + CLIENT_ID_INVALID: + value: + error: invalid_client + error_description: The client_id is not valid, check your client_id again. + OAUTH_CONF_NOT_EXIST: + value: + error: unauthorized_client + error_description: The configuration not found. + TOKEN_CONF_INVALID: + value: + error: unauthorized_client + error_description: The Token configuration is not valid. + TOKEN_CONF_NOT_EXIST: + value: + error: unauthorized_client + error_description: The Token configuration not found. + CLIENT_SECRET_BASIC_REQUIRED: + value: + error: invalid_request + error_description: The client_secret is required to be part of an authorization header. + CLIENT_SECRET_POST_REQUIRED: + value: + error: invalid_request + error_description: The client_secret is required to be in your request body. + CLIENT_SECRET_REQUIRED: + value: + error: invalid_request + error_description: The client_secret is a required parameter. + TOKEN_REQUIRED_SSO: + value: + error: invalid_request + error_description: The token is a required parameter. + CLIENT_SECRET_INVALID: + value: + error: unauthorized_client + error_description: The client_secret is not valid, check your client_secret again. + REFRESH_TOKEN_INVALID_SSO: + value: + error: invalid_grant + error_description: The refresh_token is not valid. + ACCESS_TOKEN_INVALID_SSO: + value: + error: invalid_grant + error_description: The access_token is not valid. + ACCESS_TOKEN_INVALID_OR_EXPIRED_SSO: + value: + error: invalid_request + error_description: The access_token is invalid or expired. + CODE_EXPIRED: + value: + error: invalid_grant + error_description: The code has been expired. + CODE_INVALID: + value: + error: invalid_grant + error_description: The code is not valid. + CODE_INVALID_OR_EXPIRED: + value: + error: invalid_request + error_description: The code is invalid or expired. + CODE_IS_ALREADY_USED: + value: + error: invalid_grant + error_description: The code is already used. + CODE_REQUIRED: + value: + error: invalid_request + error_description: The code is a required parameter. + CODE_VERIFIER_INVALID: + value: + error: invalid_grant + error_description: The Code Verifier is invalid. + CODE_VERIFIER_REQUIRED: + value: + error: invalid_request + error_description: The Code Verifier is required. + DEVICE_AUTHORIZATION_PENDING: + value: + error: authorization_pending + error_description: The authorization is pending + DEVICE_CODE_INVALID: + value: + error: invalid_request + error_description: The device_code is invalid or expired. + DEVICE_CODE_REQUIRED: + value: + error: invalid_request + error_description: The device_code is a required parameter. + DEVICE_SLOW_DOWN: + value: + error: slow_down + error_description: Slow down the request polling + GRANT_TYPE_INVALID: + value: + error: unsupported_grant_type + error_description: The grant_type is not valid, check grant_type parameter again. + GRANT_TYPE_REQUIRED: + value: + error: invalid_request + error_description: The grant_type is a required parameter. + OAUTH_ACCESS_DENIED: + value: + error: invalid_request + error_description: Access denied. The specified grant_type has not been allowed. + OAUTH_ACCESS_TOKEN_EXPIRED: + value: + error: invalid_grant + error_description: The access_token has been expired. + OAUTH_ACCOUNT_NOT_ALLOWED_TO_LOGIN: + value: + error: invalid_grant + error_description: The provided account is not allowed to login, please reach out to LoginRadius support for more information. + OAUTH_ACTIVE_SESSIONS_EXCEEDED: + value: + error: invalid_grant + error_description: You have exceeded the maximum number of allowed active login sessions. Please log out of any other active session before attempting to log in again. If you need further assistance, contact support. + OAUTH_APP_NOT_EXISTS: + value: + error: invalid_grant + error_description: The provided site does not exist, please use a valid LoginRadius site in order to process this request. + OAUTH_BREACHED_PASSWORD_LOGIN: + value: + error: invalid_grant + error_description: Your password is found in a data breach unrelated to this app/service. Please reset your password using the email we sent you. + OAUTH_CAPTCHA_NOT_VALID: + value: + error: invalid_grant + error_description: CAPTCHA is invalid, please enter the correct CAPTCHA value. + OAUTH_CHANGE_BREACHED_PASSWORD: + value: + error: invalid_grant + error_description: Your password is exposed in an external data breach. As a caution, we’ve already sent you an email with steps to reset your password. Please try to login after resetting your password. + OAUTH_CONSENT_FORM_NOT_SUBMITTED: + value: + error: invalid_grant + error_description: Consent form not submitted, please accept the consent form. + OAUTH_CONSENT_FORM_VALIDATION_FAILED: + value: + error: invalid_grant + error_description: Consent form validation failed. + OAUTH_EMAIL_NOT_VERIFIED: + value: + error: invalid_grant + error_description: This email has not yet been verified, please click the link in your email to confirm your email address. + OAUTH_EMAIL_SEND_LIMIT_REACHED: + value: + error: invalid_grant + error_description: The account limit for email requests for this resource has been reached for this time due to too many request. + OAUTH_EMAILID_ID_FORMAT_NOT_VALID: + value: + error: invalid_grant + error_description: The provided email ID is invalid or not well-formatted, a valid email ID is required in order to process this request. + OAUTH_EMAIl_OR_PHONE_NUMBER_REQUIRED_VERIFIED: + value: + error: invalid_grant + error_description: The email or phone number is not verified, please verify email or phone number for login. + OAUTH_INVALID_PHONE_NUMBER: + value: + error: invalid_grant + error_description: The provided phone number is not valid or not well-formatted, please review the phone number in order to process this request. + OAUTH_LOGIN_DISABLED: + value: + error: invalid_grant + error_description: Login services have been disabled for your account, please contact the admin or site owner. + OAUTH_LOGIN_IS_LOCKED_FOR_RECAPTCHA: + value: + error: invalid_grant + error_description: Your account has been locked, please login with a valid reCAPTCHA in order to continue. + OAUTH_LOGIN_IS_LOCKED_FOR_SECURITY_QUESTION: + value: + error: invalid_grant + error_description: Your account has been locked, please login with an answer to the security question in order to continue. + OAUTH_LOGIN_WITH_PASSWORD_NOT_ENABLED: + value: + error: invalid_grant + error_description: Password-based login is disabled for your site. Please enable the Login with Password feature. + OAUTH_OPERATION_FAILED: + value: + error: invalid_grant + error_description: An unknown error has occurred, please try again in a few minutes or contact your system admin. + OAUTH_OTP_SEND_FAILED: + value: + error: invalid_grant + error_description: The Verification OTP Code sending failed, please try again. + OAUTH_PHONE_NO_LOGIN_NOT_ENABLED: + value: + error: invalid_grant + error_description: Phone number login is not enabled on your site. + OAUTH_PHONE_NOT_VERIFIED: + value: + error: invalid_grant + error_description: The provided phone number is not verified, please use a verified phone number for login. + OAUTH_PIN_IS_REQUIRED: + value: + error: invalid_grant + error_description: The PIN is required and needs to be set, please set PIN in the profile for login. + OAUTH_PRIVACY_POLICY_MISMATCHED: + value: + error: invalid_grant + error_description: You have not accepted the current Privacy Policy. + OAUTH_RBA_ACCOUNT_IS_BLOCKED: + value: + error: invalid_grant + error_description: Your account has been blocked by the system admin, please contact the admin for more information. + OAUTH_RBA_EMAIL_VERIFICATION: + value: + error: invalid_grant + error_description: We have identified a suspicious activity with your account, a verification code has been sent to your email to secure your account. + OAUTH_RBA_SECURITY_ANSWER_VERIFICATION: + value: + error: invalid_grant + error_description: We have identified a suspicious activity with your account, please answer the security question's to secure your account. + OAUTH_RBA_SMS_VERIFICATION: + value: + error: invalid_grant + error_description: We have identified a suspicious activity with your account, a verification code has been sent to your phone to secure your account. + OAUTH_REFRESH_TOKEN_ALREADY_USED: + value: + error: invalid_grant + error_description: The refresh_token has already been used. + OAUTH_REFRESH_TOKEN_EXPIRED: + value: + error: invalid_grant + error_description: The refresh_token has expired. + OAUTH_REFRESH_TOKEN_FORMAT_INVALID: + value: + error: invalid_grant + error_description: The refresh_token format is invalid. + OAUTH_REFRESH_TOKEN_FROM_DIFF_CLIENT: + value: + error: invalid_grant + error_description: The refresh_token was not issued for this client. + OAUTH_REFRESH_TOKEN_INVALID_OR_REVOKED: + value: + error: invalid_grant + error_description: The refresh_token is invalid or has been revoked. + OAUTH_REFRESH_TOKEN_MAX_ACTIVE_SESSION_EXCEED: + value: + error: invalid_grant + error_description: The active session exceeded the maximum number of sessions. + OAUTH_REFRESH_TOKEN_REVOKED_ACCOUNT_SECURITY_CHANGE: + value: + error: invalid_grant + error_description: The refresh_token has been revoked following a recent password reset or security update to your account. + OAUTH_REFRESH_TOKEN_SOMETHING_GOING_WRONG: + value: + error: invalid_grant + error_description: Something went wrong, please try again + OAUTH_REFRESH_TOKEN_USER_NOT_FOUND: + value: + error: invalid_grant + error_description: The user associated with the refresh_token was not found. + OAUTH_SMS_CONFIGURATION_NOT_EXISTS: + value: + error: invalid_grant + error_description: The SMS configuration does not exist, please configure SMS settings. + OAUTH_SMS_SEND_LIMIT_REACHED: + value: + error: invalid_grant + error_description: The account limit for SMS requests for this resource has been reached for this time due to too many request. + OAUTH_USER_ID_BLOCKED: + value: + error: invalid_grant + error_description: Your account has been blocked by the system admin, please contact the admin for more information. + OAUTH_USER_ID_LOCKED: + value: + error: invalid_grant + error_description: Your account has been locked, please try again after sometime. + OAUTH_USER_NAME_AUTHENTICATION_ENABLED: + value: + error: invalid_grant + error_description: You can't login from email/phone, please use username for login. + OAUTH_USER_NOT_EXISTS: + value: + error: invalid_grant + error_description: The user's account does not exist, please use a valid user or create the user before processing this request. + OAUTH_USERNAME_OR_PASSWORD_WRONG: + value: + error: invalid_grant + error_description: Please use a valid user ID and password combination. + OAUTH_USERNAME_OR_PASSWORD_WRONG_FOR_BLOCK_LOCKOUT: + value: + error: invalid_grant + error_description: You have {count} tries left before your account gets suspended. + OAUTH_USERNAME_OR_PASSWORD_WRONG_FOR_SUSPEND_LOCKOUT: + value: + error: invalid_grant + error_description: You have {count} tries left before your account gets blocked. + PASSWORD_REQUIRED_SSO: + value: + error: invalid_request + error_description: The password is a required parameter. + REDIRECT_URI_INVALID: + value: + error: invalid_request + error_description: The redirect_uri is not valid, check redirect_uri parameter again. + REDIRECT_URI_REQUIRED: + value: + error: invalid_request + error_description: The redirect_uri is a required parameter. + REFRESH_TOKEN_REQUIRED_SSO: + value: + error: invalid_request + error_description: The refresh_token is a required parameter. + RESPONSE_TYPE_INVALID: + value: + error: invalid_request + error_description: The response_type must contain a valid value. + USERNAME_REQUIRED_SSO: + value: + error: invalid_request + error_description: The username is a required parameter. + RESOURCE_PERMISSION_NOT_FOUND: + value: + error: invalid_request + error_description: The resource does not contain any permissions. + USER_PERMISSION_NOT_FOUND: + value: + error: invalid_request + error_description: The user does not have permission to access the resource. + DEVICE_ACCESS_TOKEN_EXPIRED: + value: + error: expired_token + error_description: The access token is expired + OAUTH_REDIRECT_URI_MISMATCH: + value: + error: redirect_uri_mismatch + error_description: Parameter redirect_uri does not match as provided in the authorization + REDIRECT_URI_NOT_VALID: + value: + Description: The provided redirect_uri does not match any registered redirect URIs. + ErrorCode: 1236 + Message: Invalid Redirect URI + PAR_FEATURE_DISABLED: + value: + error: access_denied + error_description: Pushed Authorization Request (PAR) is disabled on this authorization server. + DCR_FEATURE_DISABLED: + value: + error: access_denied + error_description: Dynamic client registration is disabled on this authorization server. + DCR_REGISTRATION_TOKEN_REQUIRED: + value: + error: invalid_request + error_description: The registration_access_token is required. + DCR_REGISTRATION_TOKEN_INVALID: + value: + error: unauthorized_client + error_description: The provided registration_access_token is invalid or has expired. + DCR_CLIENT_NOT_FOUND: + value: + error: unauthorized_client + error_description: The dynamic client was not found. + DCR_CLIENT_NAME_REQUIRED: + value: + error: invalid_client_metadata + error_description: The client_name parameter is required. + DCR_REDIRECT_URI_REQUIRED: + value: + error: invalid_client_metadata + error_description: The redirect_uris parameter is required. + DCR_REDIRECT_URI_EMPTY: + value: + error: invalid_client_metadata + error_description: The redirect_uris parameter must not contain empty values. + DCR_REDIRECT_URI_INVALID: + value: + error: invalid_client_metadata + error_description: One or more values in redirect_uris are invalid. + DCR_POST_LOGOUT_REQUEST_URI_INVALID: + value: + error: invalid_client_metadata + error_description: The post_logout_redirect_uris parameter must be a valid HTTPS URL. + DCR_BACK_CHANNEL_LOGOUT_URI_INVALID: + value: + error: invalid_client_metadata + error_description: The backchannel_logout_uri parameter must be a valid HTTPS URL. + DCR_REQUEST_URI_INVALID: + value: + error: invalid_client_metadata + error_description: The request_uris parameter must be a valid HTTPS URL. + DCR_GRANT_TYPE_NOT_SUPPORTED: + value: + error: invalid_client_metadata + error_description: The grant type is not supported. + ACCESS_DENIED_GRANT_TYPE_NOT_ALLOWED: + value: + error: invalid_client_metadata + error_description: Access denied. The specified grant_type has not been allowed. + DCR_RESPONSE_TYPE_REQUIRED: + value: + error: invalid_client_metadata + error_description: The response_types is required parameter. + DCR_RESPONSE_TYPE_INVALID: + value: + error: invalid_client_metadata + error_description: The response_type is not supported. + DCR_RESPONSE_TYPE_ALLOWED_WITH_GRANT_TYPE: + value: + error: invalid_client_metadata + error_description: The response_type is only allowed with the authorization_code or implicit grant_type. + DCR_TOKEN_AUTH_METHOD_NOT_SUPPORTED: + value: + error: invalid_client_metadata + error_description: The token endpoint authentication method is not supported. + DCR_LOGO_URL_INVALID: + value: + error: invalid_client_metadata + error_description: The logo_uri parameter must be a valid HTTPS URL. + DCR_TOS_URL_INVALID: + value: + error: invalid_client_metadata + error_description: The tos_uri parameter must be a valid HTTPS URL. + DCR_POLICY_URL_INVALID: + value: + error: invalid_client_metadata + error_description: The policy_uri parameter must be a valid HTTPS URL. + DCR_CLIENT_URL_INVALID: + value: + error: invalid_client_metadata + error_description: The client_uri parameter must be a valid HTTPS URL. + DCR_JWKS_MUTUALLY_EXCLUSIVE: + value: + error: invalid_client_metadata + error_description: Both jwks and jwks_uri are present. Only one of these parameters may be specified. + DCR_JWKS_URI_INVALID: + value: + error: invalid_client_metadata + error_description: The jwks_uri parameter must be a valid HTTPS URL. + DCR_JWKS_INVALID_JSON: + value: + error: invalid_client_metadata + error_description: The jwks parameter contains invalid JSON. + DCR_JWKS_INVALID_STRUCTURE: + value: + error: invalid_client_metadata + error_description: The jwks parameter must contain a non-empty 'keys' array with valid entries. + DCR_JWKS_INVALID_KEY_PARAMS: + value: + error: invalid_client_metadata + error_description: The jwks RSA key parameters are invalid. + DCR_JWKS_URI_FETCH_FAILED: + value: + error: invalid_client_metadata + error_description: Failed to fetch jwks from the supplied jwks_uri. + DCR_ID_TOKEN_SIGNING_ALG_NOT_SUPPORTED: + value: + error: invalid_client_metadata + error_description: The id_token_signed_response_alg value is not supported. + DCR_USERINFO_SIGNING_ALG_NOT_SUPPORTED: + value: + error: invalid_client_metadata + error_description: The userinfo_signed_response_alg value is not supported. + TOKEN_TYPE_HINT_INVALID: + value: + error: invalid_request + error_description: The token_type_hint is not valid, check token_type_hint parameter again. + TOKEN_TYPE_HINT_REQUIRED: + value: + error: invalid_request + error_description: The token_type_hint is a required parameter. + M2M_CONF_NOT_EXIST: + value: + error: unauthorized_client + error_description: The Machine to Machine configuration not found. + TOKEN_EXPIRED: + value: + error: invalid_grant + error_description: The token has been expired. + TOKEN_INVALID: + value: + error: invalid_grant + error_description: The token is not valid. + AUDIENCE_REQUIRED: + value: + error: invalid_request + error_description: The audience is a required parameter. + ACCESS_TOKEN_REQUIRED_SSO: + value: + error: invalid_request + error_description: The access_token is a required parameter. + OPENID_CONF_INVALID: + value: + error: unauthorized_client + error_description: The Openid configuration is not valid. + SAML_APP_NAME_REQUIRED: + value: + Description: The appName is a required parameter. + ErrorCode: 908 + Message: A parameter is not formatted correctly + SP_SAML_CONFIG_NOT_FOUND: + value: + Description: SAML configuration not found. + ErrorCode: 3001 + Message: SAML configuration not found. + SP_SAML_CONFIG_NOT_VALID: + value: + Description: Failed to retrieve issuer URL, check for errors in config issuer URL or login URL. + ErrorCode: 3002 + Message: SAML configuration not valid. + SAML_METADATA_RESPONSE_INVALID: + value: + Description: Failed to convert metadata to xml response. + ErrorCode: 2030 + Message: Oops, something went wrong, please try again. + API_KEY_NOT_WELL_FORMATTED_SSO: + value: + Description: The provided LoginRadius API key is invalid, please use a valid API key of your LoginRadius account. + ErrorCode: 920 + Message: API key is invalid + API_KEY_REQUIRED_SSO: + value: + Description: The request is missing the API key, please use the valid API key parameter in order to process this request. + ErrorCode: 922 + Message: API key is missing + EXPIRE_IN_INVALID_FORMAT_SSO: + value: + Description: Please provide expiry time in number format only. + ErrorCode: 1307 + Message: The expires_in has invalid format + MOBILE_EXPIRY_PARAM_INVALID: + value: + Description: The expiry is not valid. + ErrorCode: 908 + Message: A parameter is not formatted correctly + MOBILE_ACCESS_TOKEN_INVALID_OR_EXPIRED: + value: + Description: The access_token is invalid or expired. + ErrorCode: 2010 + Message: invalid_grant + MOBILE_CODE_NOT_VALID_OR_EXPIRED: + value: + Description: The code is not valid or expired. + ErrorCode: 908 + Message: A parameter is not formatted correctly + MOBILE_CODE_REQUIRED: + value: + Description: The code is a required parameter. + ErrorCode: 908 + Message: A parameter is not formatted correctly + CODE_AND_TOKEN_REQUIRED: + value: + Description: The access_token is a required parameter, The code is a required parameter. + ErrorCode: 908 + Message: A parameter is not formatted correctly + b2cBatchUplaod: + summary: Batch Upload B2C + value: + Profiles: + - FirstName: Ajay + LastName: Sharma + Email: + - Type: Primary + Value: ajaysharma@yopmail.com + PasswordHash: Rfc2898DeriveBytes$1000$VAh9OF7J0c2p2kpx4ozwDg==$6cwqAkcvs6+zadhoH9kiuWhjNuC84PhrUbMew0fBO6k=:BA4zsWmfF + - FirstName: Priya + LastName: Patel + Email: + - Type: Primary + Value: priya.patel@tempmail.com + PasswordHash: Rfc2898DeriveBytes$1000$XBk2PG8K1d3q3lry5paxEh==$7dxrBlcws7+zbeipiI0ljvXikOvD95QisVcNfx1gCP7l=:CB5atXngG + - FirstName: Rajesh + LastName: Kumar + Email: + - Type: Primary + Value: rajesh.kumar@mailbox.org + PasswordHash: Rfc2898DeriveBytes$1000$YCl3QH9L2e4r4msz6qbyFi==$8eysCmd xt8+acrjqjJ1mkwYjlPwE06RjtWdOgy2hDQ8m=:DC6buYohH + - FirstName: Sneha + LastName: Gupta + Email: + - Type: Primary + Value: sneha.gupta@guerrillamail.com + PasswordHash: Rfc2898DeriveBytes$1000$ZDm4RI0M3f5s5nta7rcxGj==$9fztDney5u9+bdsksKk2nlxZkmQxF17SjuXePhz3hEQ9n=:ED7cvZpiI + b2cBatchUplaodWithPasswordConfig: + summary: Batch Upload B2C with password Config + value: + PasswordEncryption: + Type: PBKDF2 + IsPerPasswordSalt: true + NumberOfIteration: 1000 + SaltAttachType: Prepend + PasswordHasherVersion: V1 + Profiles: + - FirstName: Ajay + LastName: Sharma + Email: + - Type: Primary + Value: ajaysharma@yopmail.com + PasswordHash: Rfc2898DeriveBytes$1000$VAh9OF7J0c2p2kpx4ozwDg==$6cwqAkcvs6+zadhoH9kiuWhjNuC84PhrUbMew0fBO6k=:BA4zsWmfF + - FirstName: Priya + LastName: Patel + Email: + - Type: Primary + Value: priya.patel@tempmail.com + PasswordHash: Rfc2898DeriveBytes$1000$XBk2PG8K1d3q3lry5paxEh==$7dxrBlcws7+zbeipiI0ljvXikOvD95QisVcNfx1gCP7l=:CB5atXngG + - FirstName: Rajesh + LastName: Kumar + Email: + - Type: Primary + Value: rajesh.kumar@mailbox.org + PasswordHash: Rfc2898DeriveBytes$1000$YCl3QH9L2e4r4msz6qbyFi==$8eysCmd xt8+acrjqjJ1mkwYjlPwE06RjtWdOgy2hDQ8m=:DC6buYohH + - FirstName: Sneha + LastName: Gupta + Email: + - Type: Primary + Value: sneha.gupta@guerrillamail.com + PasswordHash: Rfc2898DeriveBytes$1000$ZDm4RI0M3f5s5nta7rcxGj==$9fztDney5u9+bdsksKk2nlxZkmQxF17SjuXePhz3hEQ9n=:ED7cvZpiI + b2cDeltaBatchUplaod: + summary: Batch Upload B2C with delta flag enabled + value: + DeltaMigrationModel: + DeltaMigration: true + OverWriteDuplicate: true + Profiles: + - FirstName: Ajay + LastName: Sharma + Email: + - Type: Primary + Value: ajaysharma@yopmail.com + PasswordHash: Rfc2898DeriveBytes$1000$VAh9OF7J0c2p2kpx4ozwDg==$6cwqAkcvs6+zadhoH9kiuWhjNuC84PhrUbMew0fBO6k=:BA4zsWmfF + - FirstName: Priya + LastName: Patel + Email: + - Type: Primary + Value: priya.patel@tempmail.com + PasswordHash: Rfc2898DeriveBytes$1000$XBk2PG8K1d3q3lry5paxEh==$7dxrBlcws7+zbeipiI0ljvXikOvD95QisVcNfx1gCP7l=:CB5atXngG + - FirstName: Rajesh + LastName: Kumar + Email: + - Type: Primary + Value: rajesh.kumar@mailbox.org + PasswordHash: Rfc2898DeriveBytes$1000$YCl3QH9L2e4r4msz6qbyFi==$8eysCmd xt8+acrjqjJ1mkwYjlPwE06RjtWdOgy2hDQ8m=:DC6buYohH + - FirstName: Sneha + LastName: Gupta + Email: + - Type: Primary + Value: sneha.gupta@guerrillamail.com + PasswordHash: Rfc2898DeriveBytes$1000$ZDm4RI0M3f5s5nta7rcxGj==$9fztDney5u9+bdsksKk2nlxZkmQxF17SjuXePhz3hEQ9n=:ED7cvZpiI + b2bBatchUplaod: + summary: Batch Upload B2B + value: + Profiles: + - FirstName: Ajay + LastName: Sharma + Email: + - Type: Primary + Value: ajaysharma@yopmail.com + PasswordHash: Rfc2898DeriveBytes$1000$VAh9OF7J0c2p2kpx4ozwDg==$6cwqAkcvs6+zadhoH9kiuWhjNuC84PhrUbMew0fBO6k=:BA4zsWmfF + OrgRoles: + - OrgId: org_aCXnRa2wQdvMpz1y + RoleIds: + - role_aDikRwnDb67DwpBp + - FirstName: Priya + LastName: Patel + Email: + - Type: Primary + Value: priya.patel@tempmail.com + PasswordHash: Rfc2898DeriveBytes$1000$XBk2PG8K1d3q3lry5paxEh==$7dxrBlcws7+zbeipiI0ljvXikOvD95QisVcNfx1gCP7l=:CB5atXngG + OrgRoles: + - OrgId: org_aCXnRa2wQdvMpz1y + RoleIds: + - role_aDikRwnDb67DwpBp + - FirstName: Rajesh + LastName: Kumar + Email: + - Type: Primary + Value: rajesh.kumar@mailbox.org + PasswordHash: Rfc2898DeriveBytes$1000$YCl3QH9L2e4r4msz6qbyFi==$8eysCmd xt8+acrjqjJ1mkwYjlPwE06RjtWdOgy2hDQ8m=:DC6buYohH + OrgRoles: + - OrgId: org_aCXnRa2wQdvMpz1y + RoleIds: + - role_aDikRwnDb67DwpBp + - FirstName: Sneha + LastName: Gupta + Email: + - Type: Primary + Value: sneha.gupta@guerrillamail.com + PasswordHash: Rfc2898DeriveBytes$1000$ZDm4RI0M3f5s5nta7rcxGj==$9fztDney5u9+bdsksKk2nlxZkmQxF17SjuXePhz3hEQ9n=:ED7cvZpiI + OrgRoles: + - OrgId: org_aCXnRa2wQdvMpz1y + RoleIds: + - role_aDikRwnDb67DwpBp + b2bBatchUplaodWithPasswordConfig: + summary: Batch Upload B2B with password Config + value: + PasswordEncryption: + Type: PBKDF2 + IsPerPasswordSalt: true + NumberOfIteration: 1000 + SaltAttachType: None + PasswordHasherVersion: V5 + SubKeyLength: 64 + SaltKeyLength: 32 + Profiles: + - FirstName: Ajay + LastName: Sharma + Email: + - Type: Primary + Value: ajaysharma@yopmail.com + PasswordHash: Rfc2898DeriveBytes$1000$VAh9OF7J0c2p2kpx4ozwDg==$6cwqAkcvs6+zadhoH9kiuWhjNuC84PhrUbMew0fBO6k=:BA4zsWmfF + OrgRoles: + - OrgId: org_aCXnRa2wQdvMpz1y + RoleIds: + - role_aDikRwnDb67DwpBp + - FirstName: Priya + LastName: Patel + Email: + - Type: Primary + Value: priya.patel@tempmail.com + PasswordHash: Rfc2898DeriveBytes$1000$XBk2PG8K1d3q3lry5paxEh==$7dxrBlcws7+zbeipiI0ljvXikOvD95QisVcNfx1gCP7l=:CB5atXngG + OrgRoles: + - OrgId: org_aCXnRa2wQdvMpz1y + RoleIds: + - role_aDikRwnDb67DwpBp + - FirstName: Rajesh + LastName: Kumar + Email: + - Type: Primary + Value: rajesh.kumar@mailbox.org + PasswordHash: Rfc2898DeriveBytes$1000$YCl3QH9L2e4r4msz6qbyFi==$8eysCmd xt8+acrjqjJ1mkwYjlPwE06RjtWdOgy2hDQ8m=:DC6buYohH + OrgRoles: + - OrgId: org_aCXnRa2wQdvMpz1y + RoleIds: + - role_aDikRwnDb67DwpBp + - FirstName: Sneha + LastName: Gupta + Email: + - Type: Primary + Value: sneha.gupta@guerrillamail.com + PasswordHash: Rfc2898DeriveBytes$1000$ZDm4RI0M3f5s5nta7rcxGj==$9fztDney5u9+bdsksKk2nlxZkmQxF17SjuXePhz3hEQ9n=:ED7cvZpiI + OrgRoles: + - OrgId: org_aCXnRa2wQdvMpz1y + RoleIds: + - role_aDikRwnDb67DwpBp + b2bDeltaBatchUplaod: + summary: Batch Upload B2B with delta flag enabled + value: + DeltaMigrationModel: + DeltaMigration: true + OverWriteDuplicate: true + Profiles: + - FirstName: Ajay + LastName: Sharma + Email: + - Type: Primary + Value: ajaysharma@yopmail.com + PasswordHash: Rfc2898DeriveBytes$1000$VAh9OF7J0c2p2kpx4ozwDg==$6cwqAkcvs6+zadhoH9kiuWhjNuC84PhrUbMew0fBO6k=:BA4zsWmfF + OrgRoles: + - OrgId: org_aCXnRa2wQdvMpz1y + RoleIds: + - role_aDikRwnDb67DwpBp + - FirstName: Priya + LastName: Patel + Email: + - Type: Primary + Value: priya.patel@tempmail.com + PasswordHash: Rfc2898DeriveBytes$1000$XBk2PG8K1d3q3lry5paxEh==$7dxrBlcws7+zbeipiI0ljvXikOvD95QisVcNfx1gCP7l=:CB5atXngG + OrgRoles: + - OrgId: org_aCXnRa2wQdvMpz1y + RoleIds: + - role_aDikRwnDb67DwpBp + - FirstName: Rajesh + LastName: Kumar + Email: + - Type: Primary + Value: rajesh.kumar@mailbox.org + PasswordHash: Rfc2898DeriveBytes$1000$YCl3QH9L2e4r4msz6qbyFi==$8eysCmd xt8+acrjqjJ1mkwYjlPwE06RjtWdOgy2hDQ8m=:DC6buYohH + OrgRoles: + - OrgId: org_aCXnRa2wQdvMpz1y + RoleIds: + - role_aDikRwnDb67DwpBp + - FirstName: Sneha + LastName: Gupta + Email: + - Type: Primary + Value: sneha.gupta@guerrillamail.com + PasswordHash: Rfc2898DeriveBytes$1000$ZDm4RI0M3f5s5nta7rcxGj==$9fztDney5u9+bdsksKk2nlxZkmQxF17SjuXePhz3hEQ9n=:ED7cvZpiI + OrgRoles: + - OrgId: org_aCXnRa2wQdvMpz1y + RoleIds: + - role_aDikRwnDb67DwpBp + b2bBatchUplaodOnlyOrgs: + summary: Batch Upload B2B with orgIds only + value: + Profiles: + - FirstName: Ajay + LastName: Sharma + Email: + - Type: Primary + Value: ajaysharma@yopmail.com + PasswordHash: Rfc2898DeriveBytes$1000$VAh9OF7J0c2p2kpx4ozwDg==$6cwqAkcvs6+zadhoH9kiuWhjNuC84PhrUbMew0fBO6k=:BA4zsWmfF + OrgRoles: + - OrgId: org_aCXnRa2wQdvMpz1y + - FirstName: Priya + LastName: Patel + Email: + - Type: Primary + Value: priya.patel@tempmail.com + PasswordHash: Rfc2898DeriveBytes$1000$XBk2PG8K1d3q3lry5paxEh==$7dxrBlcws7+zbeipiI0ljvXikOvD95QisVcNfx1gCP7l=:CB5atXngG + OrgRoles: + - OrgId: org_aCXnRa2wQdvMpz1y + - FirstName: Rajesh + LastName: Kumar + Email: + - Type: Primary + Value: rajesh.kumar@mailbox.org + PasswordHash: Rfc2898DeriveBytes$1000$YCl3QH9L2e4r4msz6qbyFi==$8eysCmd xt8+acrjqjJ1mkwYjlPwE06RjtWdOgy2hDQ8m=:DC6buYohH + OrgRoles: + - OrgId: org_aCXnRa2wQdvMpz1y + - FirstName: Sneha + LastName: Gupta + Email: + - Type: Primary + Value: sneha.gupta@guerrillamail.com + PasswordHash: Rfc2898DeriveBytes$1000$ZDm4RI0M3f5s5nta7rcxGj==$9fztDney5u9+bdsksKk2nlxZkmQxF17SjuXePhz3hEQ9n=:ED7cvZpiI + OrgRoles: + - OrgId: org_aCXnRa2wQdvMpz1y + RoleIds: + - role_aDikRwnDb67DwpBp + b2bBatchUplaodOnlyRoles: + summary: Batch Upload B2B with roleIds only + value: + Profiles: + - FirstName: Ajay + LastName: Sharma + Email: + - Type: Primary + Value: ajaysharma@yopmail.com + PasswordHash: Rfc2898DeriveBytes$1000$VAh9OF7J0c2p2kpx4ozwDg==$6cwqAkcvs6+zadhoH9kiuWhjNuC84PhrUbMew0fBO6k=:BA4zsWmfF + RoleIds: + - role_aDikRwnDb67DwpBp + - FirstName: Priya + LastName: Patel + Email: + - Type: Primary + Value: priya.patel@tempmail.com + PasswordHash: Rfc2898DeriveBytes$1000$XBk2PG8K1d3q3lry5paxEh==$7dxrBlcws7+zbeipiI0ljvXikOvD95QisVcNfx1gCP7l=:CB5atXngG + RoleIds: + - role_aDikRwnDb67DwpBp + - role_bCikRwnDb67FgpBp + - FirstName: Rajesh + LastName: Kumar + Email: + - Type: Primary + Value: rajesh.kumar@mailbox.org + PasswordHash: Rfc2898DeriveBytes$1000$YCl3QH9L2e4r4msz6qbyFi==$8eysCmd xt8+acrjqjJ1mkwYjlPwE06RjtWdOgy2hDQ8m=:DC6buYohH + - FirstName: Sneha + LastName: Gupta + Email: + - Type: Primary + Value: sneha.gupta@guerrillamail.com + PasswordHash: Rfc2898DeriveBytes$1000$ZDm4RI0M3f5s5nta7rcxGj==$9fztDney5u9+bdsksKk2nlxZkmQxF17SjuXePhz3hEQ9n=:ED7cvZpiI + RoleIds: + - role_aDikRwnDb67DwpBp + - role_bCikRwnDb67FgpBp + OrgRoles: + - OrgId: org_aCXnRa2wQdvMpz1y + RoleIds: + - role_aDikRwnDb67DwpBp + batchUploadSuccess: + summary: Migration with no failed records + value: + Profile: + RecordInserted: 150 + RecordUpdated: 20 + Failed: [] + batchUploadPartialSuccess: + summary: Migration with failed records + value: + Profile: + RecordInserted: 120 + RecordUpdated: 30 + Failed: + - RecordNumber: 2 + Message: Email is a primary identity and cannot be duplicated + - RecordNumber: 5 + Message: Email is a primary identity and cannot be duplicated + SUBKEYLENGTH_RANGE: + value: + ErrorCode: 8035 + Message: SubkeyLength field value needs to be between 32 and 128. + Description: SubkeyLength field value needs to be between 32 and 128. + SALTKEYLENGTH_RANGE: + value: + ErrorCode: 8034 + Message: SaltkeyLength field value needs to be between 16 and 128. + Description: SaltkeyLength field value needs to be between 16 and 128. + INVALID_PASSWORD_HASH_CONFIG: + value: + ErrorCode: 7992 + Message: Invalid password hash configuration + Description: SubKeyLength or SaltKeyLength is invalid. Please use the values greater than or equal to 16. + ValidateIdentity: + value: + Message: One or more records have parameters that are not formatted correctly. + Description: Some records in the request contain invalid or incorrectly formatted parameters. Please review the 'Errors' array for details on each affected record. + ErrorCode: 8198 + Errors: + - FieldName: Record 1 + ErrorMessage: The uid is not valid, The uid can contains alphabets, digits, underscore and dash only and length must be between 1 to 50. + - FieldName: Record 2 + ErrorMessage: The account ID has to be unique for your Site, please use a different account ID in order to process this request. + - FieldName: Record 3 + ErrorMessage: The value of gender is invalid, please use a valid value of gender to process request. + - FieldName: Record 4 + ErrorMessage: The provided birth date either is in the future or has an invalid format, please use the valid date and date format (mm/dd/yyyy). + - FieldName: Record 5 + ErrorMessage: Please use different address types in the case of multiple addresses. + - FieldName: Record 6 + ErrorMessage: The request couldn't be processed, the address type must be specified in the address. + - FieldName: Record 7 + ErrorMessage: The type is a required parameter, The value is a required parameter. + - FieldName: Record 8 + ErrorMessage: The value is a required parameter. + - FieldName: Record 9 + ErrorMessage: The request couldn't be processed, the email type must be specified in the address. + - FieldName: Record 10 + ErrorMessage: The provided email ID is invalid or not well-formatted, a valid email ID is required in order to process this request. + - FieldName: Record 11 + ErrorMessage: Please use different email addresses in the case of multiple email addresses. + - FieldName: Record 12 + ErrorMessage: The primary email address can be only one. + - FieldName: Record 13 + ErrorMessage: The provided Email id domain is not allowed to register, please reach out to LoginRadius support for more information. + - FieldName: Record 14 + ErrorMessage: This custom field is invalid, please use a correct or valid custom field. + - FieldName: Record 15 + ErrorMessage: A username is required, please use a valid username in order to process this request. + - FieldName: Record 16 + ErrorMessage: The security question or answer is not enabled, please enable security question or answer. + - FieldName: Record 17 + ErrorMessage: This security question is invalid, please use a correct or valid security question. + - FieldName: Record 18 + ErrorMessage: Your security question or answer is incorrect, please enter the correct security question or answer. + - FieldName: Record 19 + ErrorMessage: This security question is invalid, please use a correct or valid security question. + - FieldName: Record 20 + ErrorMessage: A parameter is not formatted correctly in the request, please check all the parameters in the API call. + B2B_ORG_AND_ROLE_VALIDATION: + value: + Message: One or more records have parameters that are not formatted correctly. + Description: Some records in the request contain invalid or incorrectly formatted parameters. Please review the 'Errors' array for details on each affected record. + ErrorCode: 8198 + Errors: + - FieldName: Record 1 + ErrorMessage: The specified tenant Role ID is invalid or cannot be assigned to the user. Please review the Role mapping. + - FieldName: Record 2 + ErrorMessage: The organization ID is invalid or refers to an organization the user cannot be assigned to. + - FieldName: Record 3 + ErrorMessage: The Role ID is not valid for the selected organization. Please verify the organization-role mapping. + - FieldName: Record 4 + ErrorMessage: The organization Role ID is invalid or not assignable. Please ensure it exists and is accessible. + - FieldName: Record 5 + ErrorMessage: The default Role ID provided is not valid or cannot be assigned. Please select a valid default Role. + IDENTITY_VALIDATION_ERRORS: + value: + Message: One or more records have parameters that are not formatted correctly. + Description: Some records in the request contain invalid or incorrectly formatted parameters. Please review the 'Errors' array for details on each affected record. + ErrorCode: 8198 + Errors: + - FieldName: Record 1 + ErrorMessage: The Privacy Policy version is not valid. + - FieldName: Record 2 + ErrorMessage: The request couldn't be processed, the address type must be specified in the address. + - FieldName: Record 3 + ErrorMessage: The request couldn't be processed, the phone type must be specified in the phone numbers. + - FieldName: Record 4 + ErrorMessage: Please use different phone types in the case of multiple phone numbers. + - FieldName: Record 5 + ErrorMessage: You are not eligible for registration, your age must be above specified by admin of this site. + - FieldName: Record 6 + ErrorMessage: The email address has to be unique for your LoginRadius site, please use a different email address. + - FieldName: Record 7 + ErrorMessage: The username you have selected is already in use, please choose a different username. + - FieldName: Record 8 + ErrorMessage: The phone number has to be unique for your LoginRadius site, please use a different phone number. + BATCH_MIGRATION_TOO_MANY_RECORDS: + summary: BATCH_MIGRATION_TOO_MANY_RECORDS + value: + ErrorCode: 8199 + Message: Too many records in batch migration. + Description: The request contains more than the allowed 500 records for a batch migration. Please split the data into smaller batches and try again. + BATCH_MIGRATION_NO_RECORDS: + summary: BATCH_MIGRATION_NO_RECORDS + value: + ErrorCode: 8246 + Message: Profiles array must contain at least one profile. + Description: The Profiles array is required and must contain at least one profile. Please provide at least one profile in the request to proceed with the batch migration. + MISSING_UNIQUE_INDEX: + summary: MISSING_UNIQUE_INDEX + value: + ErrorCode: 8247 + Message: Your account isn't ready for migration yet. + Description: Migration isn't enabled for your login configuration (such as phone or username login). Please contact support and ask them to enable migration for your account. + MIGRATION_FAILED: + value: + Message: User migration failed. + Description: The user migration process encountered an unexpected error and could not be completed. Please contact support for assistance. + ErrorCode: 8197 + CONSENT_MANAGEMENT_NOT_ENABLED: + summary: CONSENT_MANAGEMENT_NOT_ENABLED + value: + Message: Consent Management is not enabled for this site. + Description: Consent Management feature is not enabled for this site. + ErrorCode: 8200 + CONSENT_OPTION_ID_ALREADY_EXISTS: + summary: CONSENT_OPTION_ID_ALREADY_EXISTS + value: + Message: Consent Option ID already exists + Description: Consent Option ID already exists. Please use another ID to add new config. + ErrorCode: 8201 + CONSENT_OPTION_NOT_FOUND: + summary: CONSENT_OPTION_NOT_FOUND + value: + Message: Consent Option not found + Description: The Consent Option not found for this tenant. + ErrorCode: 8203 + CONSENT_OPTION_IN_USE: + summary: CONSENT_OPTION_IN_USE + value: + Message: Consent Option in use + Description: This consent option is currently in use and cannot be deleted because it is part of an active consent form. + ErrorCode: 8205 + CONSENT_OPTION_INVALID: + summary: CONSENT_OPTION_INVALID + value: + Message: Consent Option is invalid + Description: Consent Option is invalid. Please provide a valid consent option. + ErrorCode: 8206 + CONSENT_FORM_ALREADY_EXISTS_FOR_EVENT_START_DATE: + summary: CONSENT_FORM_ALREADY_EXISTS_FOR_EVENT_START_DATE + value: + Message: Consent form already exists for the event with the same start date + Description: Consent form already exists for the event with the same start date. Please provide a different start date. + ErrorCode: 8207 + PARAMETER_NOT_WELL_FORMATTED_INVALID_VERSION: + summary: PARAMETER_NOT_WELL_FORMATTED_INVALID_VERSION + value: + Message: A parameter is not formatted correctly. + Description: The provided consent form version is invalid. Please enter a valid consent form version in integer format. + ErrorCode: 7900 + CONSENT_FORM_NOT_FOUND: + summary: CONSENT_FORM_NOT_FOUND + value: + Message: Consent form not found + Description: Consent form not found. + ErrorCode: 8208 + CONSENT_FORM_ALREADY_DELETED: + summary: CONSENT_FORM_ALREADY_DELETED + value: + Message: Consent form already deleted + Description: Consent form already deleted. + ErrorCode: 8209 + CONSENT_FORMS_NOT_FOUND: + summary: CONSENT_FORMS_NOT_FOUND + value: + Message: Active consent Forms not found + Description: Active consent Forms not found for this tenant. + ErrorCode: 8202 + requestBodies: + UnlockAccountRequest: + content: + application/json: + schema: + allOf: + - $ref: '#/components/schemas/UnlockAccountRequestCore' + - $ref: '#/components/schemas/CaptchaModel' + required: true + JWTLoginRequest: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/LoginByEmail' + - $ref: '#/components/schemas/LoginByPhone' + - $ref: '#/components/schemas/LoginByUserName' + application/x-www-form-urlencoded: + schema: + oneOf: + - $ref: '#/components/schemas/LoginByEmail' + - $ref: '#/components/schemas/LoginByPhone' + - $ref: '#/components/schemas/LoginByUserName' + required: true + OAuthDeviceCodeRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthDeviceCode' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/OAuthDeviceCode' + required: true + OAuthRevokeRefreshTokenRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthRevokeRefreshToken' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/OAuthRevokeRefreshToken' + required: true + OAuthTokenRequest: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/OAuthAuthorizationCodeFlow' + - $ref: '#/components/schemas/OAuthAuthorizationCodePKCEFlow' + - $ref: '#/components/schemas/OAuthRefreshTokenFlow' + - $ref: '#/components/schemas/OAuthPasswordCredentialFlow' + - $ref: '#/components/schemas/OAuthDeviceCodeFlow' + - $ref: '#/components/schemas/OAuthLoginRadiusTokenExchangeFlow' + application/x-www-form-urlencoded: + schema: + oneOf: + - $ref: '#/components/schemas/OAuthAuthorizationCodeFlow' + - $ref: '#/components/schemas/OAuthAuthorizationCodePKCEFlow' + - $ref: '#/components/schemas/OAuthRefreshTokenFlow' + - $ref: '#/components/schemas/OAuthPasswordCredentialFlow' + - $ref: '#/components/schemas/OAuthDeviceCodeFlow' + - $ref: '#/components/schemas/OAuthLoginRadiusTokenExchangeFlow' + required: true + OAuthPARRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/PARRequest' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/PARRequest' + required: true + OIDCDeviceCodeRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/OIDCDeviceCode' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/OIDCDeviceCode' + required: true + OIDCTokenRequest: + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/OAuthAuthorizationCodeFlow' + - $ref: '#/components/schemas/OAuthAuthorizationCodePKCEFlow' + - $ref: '#/components/schemas/OAuthRefreshTokenFlow' + - $ref: '#/components/schemas/OAuthPasswordCredentialFlow' + - $ref: '#/components/schemas/OAuthDeviceCodeFlow' + - $ref: '#/components/schemas/OAuthLoginRadiusTokenExchangeFlow' + application/x-www-form-urlencoded: + schema: + oneOf: + - $ref: '#/components/schemas/OAuthAuthorizationCodeFlow' + - $ref: '#/components/schemas/OAuthAuthorizationCodePKCEFlow' + - $ref: '#/components/schemas/OAuthRefreshTokenFlow' + - $ref: '#/components/schemas/OAuthPasswordCredentialFlow' + - $ref: '#/components/schemas/OAuthDeviceCodeFlow' + - $ref: '#/components/schemas/OAuthLoginRadiusTokenExchangeFlow' + required: true + OAuthM2MTokenIntrospectRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthM2MTokenIntrospect' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/OAuthM2MTokenIntrospect' + required: true + OAuthM2MTokenRevokeRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthM2MTokenRevoke' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/OAuthM2MTokenRevoke' + required: true + OAuthM2MTokenGenerateRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/OAuthM2MTokenGenerate' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/OAuthM2MTokenGenerate' + required: true + OIDCUserinfoRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/OIDCUserinfo' + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/OIDCUserinfo' + required: true + QRCodeMapToTokenRequest: + content: + application/json: + schema: + $ref: '#/components/schemas/QRCodeMapToToken' + required: true +x-tagGroups: + - name: Authentication API + tags: + - Registration + - Login + - User + - Password + - Security + - Session + - Custom Object + - name: Account API + tags: + - Accounts + - Account Session + - Account Security + - Account Custom Object + - Multipurpose Tokens + - Roles Management + - name: Single Sign-On API + tags: + - OAuth + - OIDC + - OAuth M2M + - JWT + - SAML + - Cross Device SSO + - name: Analytics API + tags: + - Identity + - Custom Objects + - Insights + - name: Management API + tags: + - User Migration + - Social Providers + - OAuth Custom Providers + - JWT Custom Providers + - SAML Custom Providers + - OAuth Clients + - JWT Integrations + - SAML Integrations + - OAuth Integrations + - Password Policy + - Second Factor Configuration + - Passkey Configuration + - Push Notification Configuration + - Captcha Configuration + - Security Questions + - Domain Access Restrictions + - IP Access Restrictions + - Email Templates + - SMS Templates + - Custom Fields + - Roles + - Permissions + - Webhooks + - Consent + - Workflows + - SOTT + - name: Partner IAM API + tags: + - Organization + - Organization User Roles + - Organization Connections + - Organization Connection Group Roles + - Organization Domains + - Organization Invitations + - name: Hosted Plugins API + tags: + - BigCommerce SSO + - Shopify SSO + - PerfectMind SSO diff --git a/MIGRATION_GUIDE.md b/MIGRATION_GUIDE.md new file mode 100644 index 0000000..a5abb13 --- /dev/null +++ b/MIGRATION_GUIDE.md @@ -0,0 +1,263 @@ +# Adopting the v12 Java SDK + +## Scope of this guide + +This covers what v12 looks like and how to move an existing integration onto it: +construction, credentials, request and response shapes, error handling, server +selection, and custom HTTP. + +It covers the v11 → v12 differences that change *every* call site: +coordinates, construction, the call style, and error handling. + +**It does not include a full endpoint-by-endpoint mapping** from v11's method +surface. Every operation in the API is present in v12, so the mapping exists — +it just is not written out here. The representative flows below show how to +derive it, and `docs/API.md` lists all 392 operations with the +endpoint each one calls, which is the reliable way to find a v11 method's +counterpart. Tell us which methods you depend on and we will prioritise those. + +## Why migrate + +- Every operation in the API, not a hand-maintained subset that drifts behind it. +- Typed models everywhere, instead of maps and hand-built JSON. +- One place where credentials, signing, and logging are applied — so one place + to audit. +- Behaviour defined once and applied everywhere in the client, rather than + re-implemented per method, so credentials and error handling are consistent + across every operation. + +## Decide whether to migrate + +You should migrate if you need operations the old integration never covered, if +you want typed errors rather than status-code checks scattered through your +code, or if you need the cross-cutting options (`originIp`, `serverRegion`, +`fields`, `preventWebhook`, default headers, signing). + +You can wait if your integration touches only a handful of stable endpoints and +works. v12 is a new artifact; nothing forces the move on a schedule. + +## What's different at a glance + +| | Before | v12 | +|---|---|---| +| Construction | per-service objects, often static | one `LoginRadiusClient` per tenant | +| Credentials | passed per call, or global mutable state | set once on `LoginRadiusConfig` | +| Requests | maps / hand-built JSON | typed model classes | +| Responses | maps / raw JSON | typed model classes | +| Errors | status codes, raw bodies | `LoginRadiusException` + predicates | +| Base URL | often hardcoded | four-level precedence, see below | +| Java level | 8 | 17 | + +## Coordinates + +The Maven coordinate is unchanged, so this is a version bump rather than a new +dependency: + +```xml + + + com.loginradius.sdk + java-sdk + 11.7.0 + + + + + com.loginradius.sdk + java-sdk + 12.0.0-rc.1 + +``` + +Because the coordinate is the same, Maven will not let both versions resolve in +one build. There is no side-by-side period: a module is on v11 or on v12. + +## Construction + +v11 configured the SDK through a **process-global singleton**, then instantiated +one class per API. v12 gives you a client object that owns its configuration: + +```java +// v11 — global state, set once at startup +LoginRadiusSDK.Initialize init = new LoginRadiusSDK.Initialize(); +init.setApiKey(""); +init.setApiSecret(""); + +AuthenticationApi authenticationApi = new AuthenticationApi(); +AccountApi accountApi = new AccountApi(); + +// v12 — configuration belongs to the client +LoginRadiusClient client = LoginRadiusClient.create( + LoginRadiusConfig.builder() + .apiKey(System.getenv("LR_API_KEY")) + .apiSecret(System.getenv("LR_API_SECRET")) // server-side only + .build()); + +// every service hangs off that client +client.login; client.account; client.user; +``` + +That difference matters if you serve more than one tenant: v11's global config +made a second credential set impossible without reconfiguring the whole process +between calls. In v12 you construct one client per tenant and hold both. + +## Call style — the change that touches every call site + +v11 was **callback-based**. Every method took an `AsyncHandler` and reported +through `onSuccess` / `onFailure`. v12 methods **return their result** and throw +on failure: + +```java +// v11 +authenticationApi.loginByEmail(model, null, null, null, null, + new AsyncHandler>() { + @Override public void onSuccess(AccessToken response) { + System.out.println(response.getAccess_Token()); + } + @Override public void onFailure(ErrorResponse errorResponse) { + System.out.println(errorResponse.getDescription()); + } + }); + +// v12 +var response = client.login.emailByLoginUserNamePhone(model, null, null, null, + null, null, null, null, null, null, null, null); +System.out.println(response.getAccessToken()); +``` + +Anonymous-handler nesting disappears, and so does the class of bug where a +`onFailure` body forgot to stop the surrounding flow. In exchange, code that +relied on the callback returning immediately now blocks — wrap the call in +whatever executor your application already uses if you need that back. + +Build it once per tenant and hold it. Every service field shares the underlying +HTTP client, interceptors, and configuration, so constructing per request throws +away connection pooling for no benefit. + +`create` throws `IllegalArgumentException` if no credential is set at all, which +is otherwise a confusing 401 on the first call. + +## Auth posture + +Nine credentials, each sent as a header by preference and additionally as a +query parameter where the API accepts nothing else. Set only what your endpoints +need. + +`apiSecret` and `clientSecret` are **server-side only**. They authorise acting +on any user's behalf; a build that ships either to a browser or a mobile app has +leaked the tenant. + +## Request and response shapes + +Operations take typed models: + +```java +EmailByLoginUserNamePhoneRequest body = + new EmailByLoginUserNamePhoneRequest( + new LoginByEmailRequest().email(email).password(password)); + +EmailByLoginUserNamePhone200Response response = + client.login.emailByLoginUserNamePhone(body, null, null, /* … */); +``` + +Operations with many optional parameters take them positionally, so a call with +one required argument still passes `null` for the rest. Where a response is a +`oneOf`, the model exposes each branch as a getter that throws +`ClassCastException` if that branch did not match — check the branch you expect +rather than assuming. + +## Error handling + +v11 delivered failures to `onFailure(ErrorResponse)` — a second code path, +easy to leave empty, and impossible to propagate out of the enclosing method +without extra plumbing. v12 throws, so failures travel on the same path as every +other exception in your application: + +```java +// v11 +accountApi.getAccountProfileByUid(uid, null, new AsyncHandler() { + @Override public void onSuccess(Identity response) { use(response); } + @Override public void onFailure(ErrorResponse e) { + // no way to rethrow usefully from here + log.warn(e.getDescription()); + } +}); + +// v12 +try { + client.accounts.getAccountIdentityByUID(uid, null, null); +} catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + + if (lr.isAuth()) { /* credential rejected — do not retry as-is */ } + if (lr.isRateLimit()) { /* back off */ } + if (lr.isServer()) { /* retry with backoff */ } + + log.warn("{} ({}) status={}", lr.description(), lr.code(), lr.statusCode()); +} +``` + +The API returns three different error envelopes depending on the endpoint +family — PascalCase, camelCase, and the OAuth `{error, error_description}` +shape. All three normalise to the same exception, so your handling works +everywhere rather than on some endpoints only. + +An empty or non-JSON body — common when a gateway or WAF blocks the request +before the API sees it — still produces a typed exception carrying a +status-based hint. + +## Server selection + +``` +baseURL("https://…") → exactly that +customDomain("auth.acme.com") → https://auth.acme.com +domain("acme") → https://acme.hub.loginradius.com +(nothing) → https://api.loginradius.com +``` + +The specification pins 42 operations to their own host. An explicit `baseURL` +redirects those too — that is what makes pointing the SDK at a proxy or a +staging environment actually move all of your traffic. + +## Custom HTTP client + +```java +OkHttpClient yours = new OkHttpClient.Builder() + .proxy(proxy) + .connectTimeout(Duration.ofSeconds(90)) + .build(); + +LoginRadiusConfig.builder().apiKey(key).httpClient(yours).build(); +``` + +Your client is extended, not replaced. The SDK adds its credential interceptor +and leaves your timeouts alone unless you set `timeout` explicitly. + +## Representative endpoint mapping + +v11 method names came from a hand-written surface; v12's come from the +specification's `operationId`. Most differ, and the reliable way to find a +counterpart is to match the **HTTP endpoint** rather than the name — +`docs/API.md` lists the endpoint for all 392 operations. + +| v11 | v12 | Endpoint | +| --- | --- | --- | +| `AuthenticationApi.loginByEmail` | `client.login.emailByLoginUserNamePhone` | `POST /identity/v2/auth/login` | +| `AccountApi.getAccountProfileByUid` | `client.accounts.getAccountIdentityByUID` | `GET /identity/v2/manage/account/{uid}` | + +Note the second one is admin-scoped (`/manage/`, authorised by the API secret). +For the signed-in user's own profile, `client.user.getAccountDetails` calls +`GET /identity/v2/auth/account` with their access token — usually what a +customer-facing integration wants. + +## What we don't migrate for you + +- Stored access tokens and sessions. Tokens issued before the migration remain + valid; the SDK does not manage their lifecycle. +- Your error-handling policy. The predicates tell you what kind of failure it + was; retry and backoff are yours. +- Secret storage. The SDK reads what you give it and never persists anything. + +## Need help? + + diff --git a/README.md b/README.md index 3c453a6..b32c3df 100644 --- a/README.md +++ b/README.md @@ -1,7314 +1,221 @@ -# LoginRadius Java SDK -LoginRadius Customer Identity and Access Management SDK for Java +# LoginRadius Java SDK — v12 -![Home Image](http://docs.lrcontent.com/resources/github/banner-1544x500.png) +[![CI](https://github.com/LoginRadius/java-sdk/actions/workflows/ci.yml/badge.svg)](https://github.com/LoginRadius/java-sdk/actions/workflows/ci.yml) +Official Java SDK for the [LoginRadius](https://www.loginradius.com) Customer +Identity and Access Management (CIAM) platform, generated from the LoginRadius +OpenAPI specification: every operation is present, the models match the wire +format, and credentials, base-URL precedence, error classification, request +signing and SOTT are applied in one place rather than per call. -## Introduction ## +## What changed in v12 -LoginRadius Java Customer Registration wrapper provides access to LoginRadius Identity Management Platform API. +v12 is generated rather than hand-written. Practically, that means: -LoginRadius is an Identity Management Platform that simplifies user registration while securing data. LoginRadius Platform simplifies and secures your user registration process, increases conversion with Social Login that combines 30 major social platforms, and offers a full solution with Traditional User Registration. You can gather a wealth of user profile data from Social Login or Traditional User Registration. +- **Full API coverage.** 57 services covering every operation in the spec, not a + hand-maintained subset that drifts behind the API. +- **Typed models** for every request and response. +- **One credential path.** Credentials, cross-cutting request options, signing, + and debug logging are applied by a single interceptor, so there is one place + to audit rather than one per method. +- **Typed errors** with intent-based predicates (`isAuth()`, `isRateLimit()`) + instead of status-code comparisons at every call site. -LoginRadius centralizes it all in one place, making it easy to manage and access. Easily integrate LoginRadius with all of your third-party applications, like MailChimp, Google Analytics, Livefyre and many more, making it easy to utilize the data you are capturing. +v12 has never been released, so it is not a drop-in replacement for 11.x. See +`MIGRATION_GUIDE.md`. -LoginRadius helps businesses boost user engagement on their web/mobile platform, manage online identities, utilize social media for marketing, capture accurate consumer data, and get unique social insight into their customer base. - -Please visit [here](http://www.loginradius.com/) for more information. - - -# Installing - -LoginRadius is now using Maven. At present the jars *are* available from a public [maven]( http://search.maven.org/#search%7Cga%7C1%7Cloginradius) repository. - -Use the following dependency in your project: +## Install ```xml com.loginradius.sdk java-sdk - 11.6.0 + 12.0.0-rc.1 - -``` - -The jars are also available [here](http://search.maven.org/#search%7Cga%7C1%7Cloginradius). Select the directory for -the latest version and download the jar files. - -## Documentation - -Java Library -===== - ------ - ->Disclaimer
->This library is meant to help you with a quick implementation of the LoginRadius platform and also to serve as a reference point for the LoginRadius API. Keep in mind that it is an open source library, which means you are free to download and customize the library functions based on your specific application needs. - - - -## Installation - -This documentation presumes you have worked through the client-side implementation to setup your LoginRadius User Registration interfaces that will service the initial registration and login process. Details on this can be found in the [getting started guide.](https://www.loginradius.com/docs/api/v2/getting-started/introduction) - -Use the following dependency in your project: - -You can also compile the source by running the following commands. This will generate the javadocs in java-sdk/target/apidocs - - -`$ git clone https://github.com/LoginRadius/java-sdk.git`
-`$ cd java-sdk`
-`$ mvn install ` # Requires maven, download from http://maven.apache.org/download.html -`$ mvn dependency:copy-dependencies` # This will generate all dependencies here: java-sdk/target/dependency -The jars are also available at [Maven](https://mvnrepository.com/artifact/com.loginradius.sdk/java-sdk). - -Select the directory for the latest version and download the jar files. - -## Initialize SDK -Before using the SDK, you must initialize the SDK with the help API Key and secret of your LoginRadius site. This information can be found in your LoginRadius account as described [here](https://www.loginradius.com/docs/api/v2/admin-console/platform-security/api-key-and-secret/#api-key-and-secret) - -```java -LoginRadiusSDK.Initialize init = new LoginRadiusSDK.Initialize(); -init.setApiKey(""); -init.setApiSecret(""); -``` -LoginRadius allows you add X-Origin-IP in your headers and it determines the IP address of the client's request,this can also be useful to overcome analytics discrepancies where the analytics depend on header data. - -```java -init.setOriginIp(""); -``` - -### Custom Domain -When initializing the SDK, optionally specify a custom domain. - -```java -init.setCustomDomain(""); -``` - - - -### API Request Signing -When initializing the SDK, you can optionally specify enabling this feature. Enabling this feature means the customer does not need to pass an API secret in an API request. Instead, they can pass a dynamically generated hash value. This feature will also make sure that the message is not tampered during transit when someone calls our APIs. - -```java -init.setRequestSigning(true); -``` -### Connection Time out -You can optionally specify custom connections timeouts -```java -init.setConnectionTimeout(15000); //set connection timeout in millisecond -``` -### Read Time out -You can optionally specify custom Read timeouts -```java -init.setReadTimeout(15000); //set read timeout in millisecond -``` - -### Proxy -When making requests to the LoginRadius API, you may also o set the proxy for your web requests so that requests made to api.loginradius.com will be processed by your proxy. - -```java -init.setProxyHost(""); -init.setProxyPort(""); -init.setProxyUserName(""); -init.setProxyPassword(""); -``` - -## Quickstart Guide - -The User Registration system relies on two identifiers which you can retrieve as follows: - -Pass the token returned in the User Registration login response to the code behind. You can use a javascript function in the login and sociallogin onSuccess functions. Additional details on setting up and configuring your interface is available [here](https://www.loginradius.com/docs/api/v2/deployment/js-libraries/getting-started/#user-registration-getting-started). You can set the action in the redirect function to the desired servlet or .jsp. - -```java -function redirect(token) { - var form = document.createElement("form"); - form.method = "POST"; - form.action = "Profile.jsp"; - var _token = document.createElement("input"); - _token.type = "hidden"; - _token.name = "token"; - _token.value = token; - form.appendChild(_token); - document.body.appendChild(form); - form.submit(); -} -``` - -### SOTT Configuration -Sott class that uses 256-bit AES encryption which is not supported by Java out of the box, -Before calling the class of SOTT you need to install the JCE unlimited strength jars in the security folder. -
-* To apply the policy files: - - 1. Download the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files from Oracle. -
-Be sure to download the correct policy file updates for your version of Java: -
-Java 6 -http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html -
-java 7 -http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html -
-java 8 -http://www.oracle.com/technetwork/java/javase/downloads/jce8-download-2133166.html -
- 2. Uncompress and extract the downloaded file. The download includes a Readme.txt and two .jar files with the same names as the existing policy files. -
- 3. Locate the two existing policy files: -
-local_policy.jar -
-US_export_policy.jar -
-On UNIX, look in /lib/security/ -
-On Windows, look in C:/Program Files/Java/jre/lib/security/ -
- 4. Replace the existing policy files with the unlimited strength policy files you extracted. - - -* After complete the configuration, use below code to get the SOTT. - -* By default, the SOTT expiration time will be 10 minutes if you use the below code. - -```java -Sott sott = new Sott(); -String sottResponse = sott.getSott(null); -``` -* If you want to validate your SOTT for long term then pass required timedifference in minutes. -* We recommend to set `getLrServerTime=true`for generating manual SOTT for a long term because it uses the server time not your system local time. - -```java -ServiceSottInfo serviceSottInfo=new ServiceSottInfo(); - -serviceSottInfo.setTimeDifference(""); // (Optional) The time difference will be used to set the expiration time of SOTT, If you do not pass time difference then the default expiration time of SOTT is 10 minutes. - -ServiceInfoModel service=new ServiceInfoModel(); -service.setSott(serviceSottInfo); - - -//The LoginRadius API key and primary API secret can be passed additionally, If the credentials will not be passed then this SOTT function will pick the API credentials from the SDK configuration. -String apiKey="";//(Optional) LoginRadius Api Key. -String apiSecret="";//(Optional) LoginRadius Api Secret (Only Primary Api Secret is used to generate the SOTT manually). - - -boolean getLrServerTime=true;//(Optional) If true it will call LoginRadius Get Server Time Api and fetch basic server information and server time information which is useful when generating an SOTT token. - - -try { - String sottResponse = Sott.getSott(service,apiKey,apiSecret,getLrServerTime); - System.out.println("sott = " + sottResponse); - -} catch (Exception e) { - e.printStackTrace(); - -} -``` - - - -### Authentication API - - -List of APIs in this Section:
- -* PUT : [Auth Update Profile by Token](#UpdateProfileByAccessToken-put-)
-* PUT : [Auth Unlock Account by Access Token](#UnlockAccountByToken-put-)
-* PUT : [Auth Verify Email By OTP](#VerifyEmailByOTP-put-)
-* PUT : [Auth Reset Password by Security Answer and Email](#ResetPasswordBySecurityAnswerAndEmail-put-)
-* PUT : [Auth Reset Password by Security Answer and Phone](#ResetPasswordBySecurityAnswerAndPhone-put-)
-* PUT : [Auth Reset Password by Security Answer and UserName](#ResetPasswordBySecurityAnswerAndUserName-put-)
-* PUT : [Auth Reset Password by Reset Token](#ResetPasswordByResetToken-put-)
-* PUT : [Auth Reset Password by OTP](#ResetPasswordByEmailOTP-put-)
-* PUT : [Auth Reset Password by OTP and UserName](#ResetPasswordByOTPAndUserName-put-)
-* PUT : [Auth Change Password](#ChangePassword-put-)
-* PUT : [Auth Set or Change UserName](#SetOrChangeUserName-put-)
-* PUT : [Auth Resend Email Verification](#AuthResendEmailVerification-put-)
-* POST : [Auth Add Email](#AddEmail-post-)
-* POST : [Auth Login by Email](#LoginByEmail-post-)
-* POST : [Auth Login by Username](#LoginByUserName-post-)
-* POST : [Auth Forgot Password](#ForgotPassword-post-)
-* POST : [Auth Link Social Identities](#LinkSocialIdentities-post-)
-* POST : [Auth Link Social Identities By Ping](#LinkSocialIdentitiesByPing-post-)
-* POST : [Auth User Registration by Email](#UserRegistrationByEmail-post-)
-* POST : [Auth User Registration By Captcha](#UserRegistrationByCaptcha-post-)
-* GET : [Get Security Questions By Email](#GetSecurityQuestionsByEmail-get-)
-* GET : [Get Security Questions By UserName](#GetSecurityQuestionsByUserName-get-)
-* GET : [Get Security Questions By Phone](#GetSecurityQuestionsByPhone-get-)
-* GET : [Get Security Questions By Access Token](#GetSecurityQuestionsByAccessToken-get-)
-* GET : [Auth Validate Access token](#AuthValidateAccessToken-get-)
-* GET : [Access Token Invalidate](#AuthInValidateAccessToken-get-)
-* GET : [Access Token Info](#GetAccessTokenInfo-get-)
-* GET : [Auth Read all Profiles by Token](#GetProfileByAccessToken-get-)
-* GET : [Auth Send Welcome Email](#SendWelcomeEmail-get-)
-* GET : [Auth Delete Account](#DeleteAccountByDeleteToken-get-)
-* GET : [Get Profile By Ping](#GetProfileByPing-get-)
-* GET : [Auth Check Email Availability](#CheckEmailAvailability-get-)
-* GET : [Auth Verify Email](#VerifyEmail-get-)
-* GET : [Auth Check UserName Availability](#CheckUserNameAvailability-get-)
-* GET : [Auth Privacy Policy Accept](#AcceptPrivacyPolicy-get-)
-* GET : [Auth Privacy Policy History By Access Token](#GetPrivacyPolicyHistoryByAccessToken-get-)
-* GET : [Auth send verification Email for linking social profiles](#AuthSendVerificationEmailForLinkingSocialProfiles-get-)
-* DELETE : [Auth Delete Account with Email Confirmation](#DeleteAccountWithEmailConfirmation-delete-)
-* DELETE : [Auth Remove Email](#RemoveEmail-delete-)
-* DELETE : [Auth Unlink Social Identities](#UnlinkSocialIdentities-delete-)
- - - - -
Auth Update Profile by Token (PUT)
- - This API is used to update the user's profile by passing the access token. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-update-profile-by-token/) - -```Java - -String accessToken = ""; //Required -UserProfileUpdateModel userProfileUpdateModel = new UserProfileUpdateModel(); //Required -userProfileUpdateModel.setFirstName("firstName"); -userProfileUpdateModel.setLastName("lastName"); -String emailTemplate = ""; //Optional -String fields = null; //Optional - -String smsTemplate = ""; //Optional -String verificationUrl = ""; //Optional -Boolean isVoiceOtp = false; //Optional -String options = ""; //Optional - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.updateProfileByAccessToken(accessToken, userProfileUpdateModel, emailTemplate, fields, smsTemplate, verificationUrl, isVoiceOtp , options , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(UserProfilePostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Auth Unlock Account by Access Token (PUT)
- - This API is used to allow a customer with a valid access token to unlock their account provided that they successfully pass the prompted Bot Protection challenges. The Block or Suspend block types are not applicable for this API. For additional details see our Auth Security Configuration documentation.You are only required to pass the Post Parameters that correspond to the prompted challenges. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-unlock-account-by-access-token/) - -```java - -String accessToken = ""; //Required -UnlockProfileModel unlockProfileModel = new UnlockProfileModel(); //Required -unlockProfileModel.setG_Recaptcha_Response("g-recaptcha-response"); - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.unlockAccountByToken(accessToken, unlockProfileModel , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Auth Verify Email By OTP (PUT)
- - This API is used to verify the email of user when the OTP Email verification flow is enabled, please note that you must contact LoginRadius to have this feature enabled. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-verify-email-by-otp/) - -```java - -EmailVerificationByOtpModel emailVerificationByOtpModel = new EmailVerificationByOtpModel(); //Required -emailVerificationByOtpModel.setEmail("email"); -emailVerificationByOtpModel.setOtp("otp"); -String fields = null; //Optional -String url = ""; //Optional -String welcomeEmailTemplate = ""; //Optional - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.verifyEmailByOTP( emailVerificationByOtpModel, fields, url, welcomeEmailTemplate , new AsyncHandler>> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(UserProfilePostResponse> response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Auth Reset Password by Security Answer and Email (PUT)
- - This API is used to reset password for the specified account by security question [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-email) - -```java - -ResetPasswordBySecurityAnswerAndEmailModel resetPasswordBySecurityAnswerAndEmailModel = new ResetPasswordBySecurityAnswerAndEmailModel(); //Required -resetPasswordBySecurityAnswerAndEmailModel.setEmail("email"); -resetPasswordBySecurityAnswerAndEmailModel.setPassword("password"); -Map securityAnswer= new HashMap (); -securityAnswer.put("", "" ); -resetPasswordBySecurityAnswerAndEmailModel.setSecurityAnswer(securityAnswer); - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.resetPasswordBySecurityAnswerAndEmail( resetPasswordBySecurityAnswerAndEmailModel , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(UserProfilePostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Auth Reset Password by Security Answer and Phone (PUT)
- - This API is used to reset password for the specified account by security question [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-phone) - -```java - -ResetPasswordBySecurityAnswerAndPhoneModel resetPasswordBySecurityAnswerAndPhoneModel = new ResetPasswordBySecurityAnswerAndPhoneModel(); //Required -resetPasswordBySecurityAnswerAndPhoneModel.setPassword("password"); -resetPasswordBySecurityAnswerAndPhoneModel.setPhone("phone"); -Map securityAnswer= new HashMap (); -securityAnswer.put("", "" ); -resetPasswordBySecurityAnswerAndPhoneModel.setSecurityAnswer(securityAnswer); - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.resetPasswordBySecurityAnswerAndPhone( resetPasswordBySecurityAnswerAndPhoneModel , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(UserProfilePostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Auth Reset Password by Security Answer and UserName (PUT)
- - This API is used to reset password for the specified account by security question [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-username) - -```java - -ResetPasswordBySecurityAnswerAndUserNameModel resetPasswordBySecurityAnswerAndUserNameModel = new ResetPasswordBySecurityAnswerAndUserNameModel(); //Required -resetPasswordBySecurityAnswerAndUserNameModel.setPassword("password"); -Map securityAnswer= new HashMap (); -securityAnswer.put("", "" ); -resetPasswordBySecurityAnswerAndUserNameModel.setSecurityAnswer(securityAnswer); -resetPasswordBySecurityAnswerAndUserNameModel.setUserName("userName"); - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.resetPasswordBySecurityAnswerAndUserName( resetPasswordBySecurityAnswerAndUserNameModel , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(UserProfilePostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - -
Auth Reset Password by Reset Token (PUT)
- - This API is used to set a new password for the specified account. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-reset-token) - -```java - -ResetPasswordByResetTokenModel resetPasswordByResetTokenModel = new ResetPasswordByResetTokenModel(); //Required -resetPasswordByResetTokenModel.setPassword("password"); -resetPasswordByResetTokenModel.setResetToken("resetToken"); - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.resetPasswordByResetToken( resetPasswordByResetTokenModel , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(UserProfilePostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Auth Reset Password by OTP (PUT)
- - This API is used to set a new password for the specified account. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-otp) - -```java - -ResetPasswordByEmailAndOtpModel resetPasswordByEmailAndOtpModel = new ResetPasswordByEmailAndOtpModel(); //Required -resetPasswordByEmailAndOtpModel.setEmail("email"); -resetPasswordByEmailAndOtpModel.setOtp("otp"); -resetPasswordByEmailAndOtpModel.setPassword("password"); - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.resetPasswordByEmailOTP( resetPasswordByEmailAndOtpModel , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(UserProfilePostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - ``` +12.0.0-rc.1 is a prerelease. Maven resolves an exact version, so this +coordinate works as written; a `[12.0.0,)` range would skip it. - - - - - -
Auth Reset Password by OTP and UserName (PUT)
+Requires Java 17 or later. - This API is used to set a new password for the specified account if you are using the username as the unique identifier in your workflow [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-reset-password-by-otp-and-username/) +## Quickstart ```java +LoginRadiusClient client = LoginRadiusClient.create( + LoginRadiusConfig.builder() + .apiKey(System.getenv("LR_API_KEY")) + .build()); -ResetPasswordByUserNameModel resetPasswordByUserNameModel = new ResetPasswordByUserNameModel(); //Required -resetPasswordByUserNameModel.setOtp("otp"); -resetPasswordByUserNameModel.setPassword("password"); -resetPasswordByUserNameModel.setUserName("userName"); - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.resetPasswordByOTPAndUserName( resetPasswordByUserNameModel , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(UserProfilePostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - +var result = client.login.checkUserNameAvailability("alice", null, null, null, null, null); ``` - - +Construct one client per tenant and reuse it: every service field shares the +underlying HTTP client, interceptors, and configuration. +## Authentication +Set whichever credentials your endpoints require; the SDK sends only what you +set. Each is sent as a header and, where the API accepts nothing else, also as a +query parameter. -
Auth Change Password (PUT)
+| Option | Sent as | Notes | +|---|---|---| +| `apiKey` | `X-LoginRadius-ApiKey`, `?apikey` | Almost every endpoint | +| `apiSecret` | `X-LoginRadius-ApiSecret`, `?apisecret` | **Server-side only** | +| `accessToken` | `?access_token` | User-context endpoints | +| `bearerToken` | `Authorization: Bearer` | | +| `m2mBearerToken` | `Authorization: Bearer` | Machine-to-machine JWT | +| `clientId` / `clientSecret` | `?client_id`, `?client_secret` | **Secret is server-side only** | +| `xLoginRadiusApiKey` / `xLoginRadiusApiSecret` | headers only | When header and query values must differ | - This API is used to change the accounts password based on the previous password [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-change-password) +Never ship `apiSecret` or `clientSecret` to a browser or mobile app: they +authorise acting on any user's behalf. -```java - -String accessToken = ""; //Required -String newPassword = ""; //Required -String oldPassword = ""; //Required +## Server selection -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.changePassword(accessToken, newPassword, oldPassword , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); +Resolved in this order — the first one set wins: ``` - - - - - - -
Auth Set or Change UserName (PUT)
- - This API is used to set or change UserName by access token. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-set-or-change-user-name/) - -```java - -String accessToken = ""; //Required -String username = ""; //Required - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.setOrChangeUserName(accessToken, username , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - +baseURL("https://…") → exactly that +customDomain("auth.acme.com") → https://auth.acme.com +domain("acme") → https://acme.hub.loginradius.com +(nothing) → https://api.loginradius.com ``` - - +The specification pins 42 operations to their own host — the migration and +cloud-api services, plus tenant-hub and custom-domain templates. Setting +`baseURL` redirects those too, so pointing the SDK at a proxy or a staging host +really does move all of your traffic. Leave it unset and the pins stand, with +their template variables filled from `domain` / `customDomain`. +## Cross-cutting request options - -
Auth Resend Email Verification (PUT)
- - This API resends the verification email to the user. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-resend-email-verification/) +Applied to every request by the same interceptor that injects credentials: ```java - -String email = ""; //Required -String emailTemplate = ""; //Optional -String verificationUrl = ""; //Optional - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.authResendEmailVerification(email, emailTemplate, verificationUrl , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - +LoginRadiusConfig.builder() + .apiKey(key) + .originIp("203.0.113.7") // X-Origin-IP — risk-based auth, audit trails + .serverRegion("eu") // ?region + .fields("Email,Uid") // ?fields — response field selector + .preventWebhook(true) // X-PreventWebhook + .defaultHeaders(Map.of("X-Correlation-Id", id)) + .build(); ``` - - - +Default headers are merged at the lowest precedence: they cannot mask the SDK's +own credential or `User-Agent` headers. +## Request signing -
Auth Add Email (POST)
- - This API is used to add additional emails to a user's account. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-add-email) +Opt-in and off by default: ```java - -String accessToken = ""; //Required -String email = ""; //Required -String type = ""; //Required -String emailTemplate = ""; //Optional -String verificationUrl = ""; //Optional - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.addEmail(accessToken, email, type, emailTemplate, verificationUrl , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - +LoginRadiusConfig.builder().apiKey(k).apiSecret(s).apiRequestSigning(true).build(); ``` - - - - +Adds `digest` and `x-Request-Expires` to `/manage/` requests only, never to +`/manage/account/access_token`. The API secret is stripped from the URL before +the signature is computed, so it never appears in a signed URL. -
Auth Login by Email (POST)
- - This API retrieves a copy of the user data based on the Email [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-login-by-email) +## Debug logging ```java - -EmailAuthenticationModel emailAuthenticationModel = new EmailAuthenticationModel(); //Required -emailAuthenticationModel.setEmail("email"); -emailAuthenticationModel.setPassword("password"); -String emailTemplate = ""; //Optional -String fields = null; //Optional -String loginUrl = ""; //Optional -String verificationUrl = ""; //Optional - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.loginByEmail( emailAuthenticationModel, emailTemplate, fields, loginUrl, verificationUrl , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessToken response) { - System.out.println(response.getAccess_Token()); - } -}); - +LoginRadiusConfig.builder().apiKey(k).debug(System.err).build(); ``` - - - - +Credential values are redacted before anything is written; the header name is +kept, so a debug log is safe to paste into a ticket. -
Auth Login by Username (POST)
- - This API retrieves a copy of the user data based on the Username [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-login-by-username) +## Custom HTTP client ```java - -UserNameAuthenticationModel userNameAuthenticationModel = new UserNameAuthenticationModel(); //Required -userNameAuthenticationModel.setPassword("password"); -userNameAuthenticationModel.setUsername("username"); -String emailTemplate = ""; //Optional -String fields = null; //Optional -String loginUrl = ""; //Optional -String verificationUrl = ""; //Optional - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.loginByUserName( userNameAuthenticationModel, emailTemplate, fields, loginUrl, verificationUrl , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessToken response) { - System.out.println(response.getAccess_Token()); - } -}); - +OkHttpClient yours = new OkHttpClient.Builder().proxy(proxy).build(); +LoginRadiusConfig.builder().apiKey(k).httpClient(yours).build(); ``` - - - - +Your client is extended, never replaced — your proxy, TLS, dispatcher, and +interceptors keep applying. The SDK adds only its credential interceptor, and +leaves your timeouts alone unless you set `timeout` explicitly. -
Auth Forgot Password (POST)
+Note the ordering: OkHttp runs application interceptors in the order added, and +the SDK's is added after yours, so an interceptor of yours sees the request +before credentials are applied. Use a network interceptor to observe the +finished request. - This API is used to send the reset password url to a specified account. Note: If you have the UserName workflow enabled, you may replace the 'email' parameter with 'username' [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-forgot-password) +## Error handling ```java - -String email = ""; //Required -String resetPasswordUrl = ""; //Required -String emailTemplate = ""; //Optional - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.forgotPassword(email, resetPasswordUrl, emailTemplate , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - +try { + client.account.getAccountProfileByUid(uid, null, null); +} catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + if (lr.isAuth()) { /* credential rejected */ } + if (lr.isRateLimit()) { /* back off */ } + System.err.println(lr.description() + " (" + lr.code() + ")"); +} ``` - - - +The API returns three different error envelopes depending on the endpoint +family; all three are normalised to the same typed exception. +## Examples -
Auth Link Social Identities (POST)
+15 runnable examples under `com.loginradius.sdk.examples` — most run offline. +See that package's `README.md`. - This API is used to link up a social provider account with an existing LoginRadius account on the basis of access token and the social providers user access token. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-link-social-identities) +## Demo -```java +A complete browser flow — register, log in, profile, password reset — in +`com.loginradius.sdk.demo`. Copy `.env.example` to `.env`, fill it in, and run +`DemoServer`. -String accessToken = ""; //Required -String candidateToken = ""; //Required +## Migrating from v11 -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.linkSocialIdentities(accessToken, candidateToken , new AsyncHandler (){ +See `MIGRATION_GUIDE.md`. -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); +## Support -``` +- Bugs and feature requests: +- Account or integration questions: +- API documentation: - +## API reference +The API itself is documented at +[https://www.loginradius.com/docs/api/openapi/customer-identity-api](https://www.loginradius.com/docs/api/openapi/customer-identity-api) — endpoint behaviour, request and response fields, and what +each operation does. This SDK is generated from the same specification, so the +two stay in step. +[`docs/API.md`](./docs/API.md) lists every one of the 392 +operations with its method name, HTTP verb and path, grouped across the +57 services. +Javadoc for this SDK's own types is published with each release and rendered at +[javadoc.io](https://javadoc.io); your IDE shows the same content inline from the +sources jar. -
Auth Link Social Identities By Ping (POST)
+## Validating a LoginRadius JWT - This API is used to link up a social provider account with an existing LoginRadius account on the basis of ping and the social providers user access token. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-link-social-identities-by-ping) +`JwtValidation.validate` verifies a token issued by one of your JWT apps. It is +entirely local — no network call, no credentials, no client. ```java - -String accessToken = ""; //Required -String clientGuid = ""; //Required - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.linkSocialIdentitiesByPing(accessToken, clientGuid , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Auth User Registration by Email (POST)
- - This API creates a user in the database as well as sends a verification email to the user. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-user-registration-by-email) - -```Java - -AuthUserRegistrationModel authUserRegistrationModel = new AuthUserRegistrationModel(); //Required -List email = new ArrayList < EmailModel >(); -EmailModel emailModel = new EmailModel(); -emailModel.setType("type"); -emailModel.setValue("value"); -email.add(emailModel); -authUserRegistrationModel.setEmail(email); -authUserRegistrationModel.setFirstName("firstName"); -authUserRegistrationModel.setLastName("lastName"); -authUserRegistrationModel.setPassword("password"); -String sott = ""; //Required -String emailTemplate = ""; //Optional -String fields = null; //Optional -String options = ""; //Optional -String verificationUrl = ""; //Optional -String welcomeEmailTemplate = ""; //Optional -Boolean isVoiceOtp = false; //Optional - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.userRegistrationByEmail( authUserRegistrationModel, sott, emailTemplate, fields, options, verificationUrl, welcomeEmailTemplate, isVoiceOtp , new AsyncHandler>> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(UserProfilePostResponse> response) { - System.out.println(response.getIsPosted()); - } -}); - +Map claims = JwtValidation.validate(token, + new JwtValidation.Params(JwtValidation.Algorithm.HS256, secret.getBytes(UTF_8)) + .issuer("LoginRadius")); ``` - - - - - -
Auth User Registration By Captcha (POST)
- - This API creates a user in the database as well as sends a verification email to the user. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-user-registration-by-recaptcha) - -```Java - -AuthUserRegistrationModelWithCaptcha authUserRegistrationModelWithCaptcha = new AuthUserRegistrationModelWithCaptcha(); //Required -List email = new ArrayList < EmailModel >(); -EmailModel emailModel = new EmailModel(); -emailModel.setType("type"); -emailModel.setValue("value"); -email.add(emailModel); -authUserRegistrationModelWithCaptcha.setEmail(email); -authUserRegistrationModelWithCaptcha.setFirstName("firstName"); -authUserRegistrationModelWithCaptcha.setG_Recaptcha_Response("g-recaptcha-response"); -authUserRegistrationModelWithCaptcha.setLastName("lastName"); -authUserRegistrationModelWithCaptcha.setPassword("password"); -String emailTemplate = ""; //Optional -String fields = null; //Optional -String options = ""; //Optional -String smsTemplate = ""; //Optional -String verificationUrl = ""; //Optional -String welcomeEmailTemplate = ""; //Optional -Boolean isVoiceOtp = false; //Optional - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.userRegistrationByCaptcha( authUserRegistrationModelWithCaptcha, emailTemplate, fields, options, smsTemplate, verificationUrl, welcomeEmailTemplate, isVoiceOtp , new AsyncHandler>> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(UserProfilePostResponse> response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Get Security Questions By Email (GET)
- - This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/security-questions-by-email/) - -```java - -String email = ""; //Required - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.getSecurityQuestionsByEmail(email , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(SecurityQuestions[] response) { - System.out.println(response[0].getQuestion()); - } -}); - -``` - - - - - - -
Get Security Questions By UserName (GET)
- - This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/security-questions-by-user-name/) - -```java - -String userName = ""; //Required - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.getSecurityQuestionsByUserName(userName , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(SecurityQuestions[] response) { - System.out.println(response[0].getQuestion()); - } -}); - -``` - - - - - - -
Get Security Questions By Phone (GET)
- - This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/security-questions-by-phone/) - -```java - -String phone = ""; //Required - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.getSecurityQuestionsByPhone(phone , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(SecurityQuestions[] response) { - System.out.println(response[0].getQuestion()); - } -}); - -``` - - - - - - -
Get Security Questions By Access Token (GET)
- - This API is used to retrieve the list of questions that are configured on the respective LoginRadius site. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/security-questions-by-access-token/) - -```java - -String accessToken = ""; //Required - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.getSecurityQuestionsByAccessToken(accessToken , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(SecurityQuestions[] response) { - System.out.println(response[0].getQuestion()); - } -}); - -``` - - - - - - -
Auth Validate Access token (GET)
- - This api validates access token, if valid then returns a response with its expiry otherwise error. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-validate-access-token/) - -```java - -String accessToken = ""; //Required - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.authValidateAccessToken(accessToken , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessTokenBase response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - -
Access Token Invalidate (GET)
- - This api call invalidates the active access token or expires an access token's validity. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-invalidate-access-token/) - -```java - -String accessToken = ""; //Required -Boolean preventRefresh = true; //Optional - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.authInValidateAccessToken(accessToken, preventRefresh , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Access Token Info (GET)
- - This api call provide the active access token Information [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-access-token-info/) - -```java - -String accessToken = ""; //Required - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.getAccessTokenInfo(accessToken , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(TokenInfoResponseModel response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - -
Auth Read all Profiles by Token (GET)
- - This API retrieves a copy of the user data based on the access token. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-read-profiles-by-token/) - -```java - -String accessToken = ""; //Required -String fields = null; //Optional -String emailTemplate = ""; //Optional -String verificationUrl = ""; //Optional -String welcomeEmailTemplate = ""; //Optional - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.getProfileByAccessToken(accessToken, fields, emailTemplate, verificationUrl, welcomeEmailTemplate , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(Identity response) { - System.out.println(response.getUid()); - } -}); - -``` - - - - - - -
Auth Send Welcome Email (GET)
- - This API sends a welcome email [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-send-welcome-email/) - -```java - -String accessToken = ""; //Required -String welcomeEmailTemplate = ""; //Optional - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.sendWelcomeEmail(accessToken, welcomeEmailTemplate , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Auth Delete Account (GET)
- - This API is used to delete an account by passing it a delete token. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-delete-account/) - -```java - -String deletetoken = ""; //Required - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.deleteAccountByDeleteToken(deletetoken , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - -
Get Profile By Ping (GET)
- -This API is used to get a user's profile using the clientGuid parameter if no callback feature enabled. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/social-login-by-ping/) - -```java - -String clientGuid = ""; //Required -String emailTemplate = ""; //Optional -String fields = null; //Optional -String verificationUrl = ""; //Optional -String welcomeEmailTemplate = ""; //Optional - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.getProfileByPing(clientGuid, emailTemplate, fields, verificationUrl, welcomeEmailTemplate , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessToken response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - -
Auth Check Email Availability (GET)
- - This API is used to check the email exists or not on your site. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-email-availability/) - -```java - -String email = ""; //Required - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.checkEmailAvailability(email , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(ExistResponse response) { - System.out.println(response.getIsExist()); - } -}); - -``` - - - - - - -
Auth Verify Email (GET)
- - This API is used to verify the email of user. Note: This API will only return the full profile if you have 'Enable auto login after email verification' set in your LoginRadius Admin Console's Email Workflow settings under 'Verification Email'. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-verify-email/) - -```Java - -String verificationToken = ""; //Required -String fields = null; //Optional -String url = ""; //Optional -String welcomeEmailTemplate = ""; //Optional -String uuid = ""; //Optional - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.verifyEmail(verificationToken, fields, url, welcomeEmailTemplate , uuid, new AsyncHandler>> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(UserProfilePostResponse> response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Auth Check UserName Availability (GET)
- - This API is used to check the UserName exists or not on your site. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-username-availability/) - -```java - -String username = ""; //Required - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.checkUserNameAvailability(username , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(ExistResponse response) { - System.out.println(response.getIsExist()); - } -}); - -``` - - - - - - -
Auth Privacy Policy Accept (GET)
- - This API is used to update the privacy policy stored in the user's profile by providing the access token of the user accepting the privacy policy [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-privacy-policy-accept) - -```java - -String accessToken = ""; //Required -String fields = null; //Optional - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.acceptPrivacyPolicy(accessToken, fields , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(Identity response) { - System.out.println(response.getUid()); - } -}); - -``` - - - - - - -
Auth Privacy Policy History By Access Token (GET)
- - This API will return all the accepted privacy policies for the user by providing the access token of that user. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/privacy-policy-history-by-access-token/) - -```java - -String accessToken = ""; //Required - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.getPrivacyPolicyHistoryByAccessToken(accessToken , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PrivacyPolicyHistoryResponse response) { - System.out.println(response.getCurrent()); - } -}); - -``` - - -
Auth send verification Email for linking social profiles (GET)
- - This API is used to Send verification email to the unverified email of the social profile. This API can be used only incase of optional verification workflow. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-send-verification-for-social-email/) - -```Java - -String accessToken = ""; //Required -String clientguid = ""; //Required - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.authSendVerificationEmailForLinkingSocialProfiles(accessToken, clientguid , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponseResendEmailVerification response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - -
Auth Delete Account with Email Confirmation (DELETE)
- - This API will send a confirmation email for account deletion to the customer's email when passed the customer's access token [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-delete-account-with-email-confirmation/) - -```java - -String accessToken = ""; //Required -String deleteUrl = ""; //Optional -String emailTemplate = ""; //Optional - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.deleteAccountWithEmailConfirmation(accessToken, deleteUrl, emailTemplate , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(DeleteRequestAcceptResponse response) { - System.out.println(response.getIsDeleteRequestAccepted()); - } -}); - -``` - - - - - - -
Auth Remove Email (DELETE)
- - This API is used to remove additional emails from a user's account. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-remove-email) - -```java - -String accessToken = ""; //Required -String email = ""; //Required - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.removeEmail(accessToken, email , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(DeleteResponse response) { - System.out.println(response.getIsDeleted()); - } -}); - -``` - - - - - - -
Auth Unlink Social Identities (DELETE)
- - This API is used to unlink up a social provider account with the specified account based on the access token and the social providers user access token. The unlinked account will automatically get removed from your database. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-unlink-social-identities) - -```java - -String accessToken = ""; //Required -String provider = ""; //Required -String providerId = ""; //Required - -AuthenticationApi authenticationApi = new AuthenticationApi(); -authenticationApi.unlinkSocialIdentities(accessToken, provider, providerId , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(DeleteResponse response) { - System.out.println(response.getIsDeleted()); - } -}); - -``` - - - - - - - - - -### Account API - - -List of APIs in this Section:
- -* PUT : [Account Update](#UpdateAccountByUid-put-)
-* PUT : [Update Phone ID by UID](#UpdatePhoneIDByUid-put-)
-* PUT : [Account Set Password](#SetAccountPasswordByUid-put-)
-* PUT : [Account Invalidate Verification Email](#InvalidateAccountEmailVerification-put-)
-* PUT : [Reset phone ID verification](#ResetPhoneIDVerificationByUid-put-)
-* PUT : [Upsert Email](#UpsertEmail-put-)
-* PUT : [Update UID](#AccountUpdateUid-put-)
-* POST : [Account Create](#CreateAccount-post-)
-* POST : [Forgot Password token](#GetForgotPasswordToken-post-)
-* POST : [Email Verification token](#GetEmailVerificationToken-post-)
-* POST : [Multipurpose Email Token Generation API](#MultipurposeEmailTokenGeneration-post-)
-* POST : [Multipurpose SMS OTP Generation API](#MultipurposeSMSOTPGeneration-post-)
-* GET : [Get Privacy Policy History By Uid](#GetPrivacyPolicyHistoryByUid-get-)
-* GET : [Account Profiles by Email](#GetAccountProfileByEmail-get-)
-* GET : [Account Profiles by Username](#GetAccountProfileByUserName-get-)
-* GET : [Account Profile by Phone ID](#GetAccountProfileByPhone-get-)
-* GET : [Account Profiles by UID](#GetAccountProfileByUid-get-)
-* GET : [Account Password](#GetAccountPasswordHashByUid-get-)
-* GET : [Access Token based on UID or User impersonation API](#GetAccessTokenByUid-get-)
-* GET : [Refresh Access Token by Refresh Token](#RefreshAccessTokenByRefreshToken-get-)
-* GET : [Revoke Refresh Token](#RevokeRefreshToken-get-)
-* GET : [Account Identities by Email](#GetAccountIdentitiesByEmail-get-)
-* DELETE : [Account Delete](#DeleteAccountByUid-delete-)
-* DELETE : [Account Remove Email](#RemoveEmail-delete-)
-* DELETE : [Revoke All Refresh Token](#RevokeAllRefreshToken-delete-)
-* DELETE : [Delete User Profiles By Email](#AccountDeleteByEmail-delete-)
- - - - -
Account Update (PUT)
- - This API is used to update the information of existing accounts in your Cloud Storage. See our Advanced API Usage section Here for more capabilities. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-update) - -```java - -AccountUserProfileUpdateModel accountUserProfileUpdateModel = new AccountUserProfileUpdateModel(); //Required -accountUserProfileUpdateModel.setFirstName("firstName"); -accountUserProfileUpdateModel.setLastName("lastName"); -String uid = ""; //Required -String fields = null; //Optional - - -AccountApi accountApi = new AccountApi(); -accountApi.updateAccountByUid( accountUserProfileUpdateModel, uid, fields , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(Identity response) { - System.out.println(response.getUid()); - } -}); - -``` - - - - - - -
Update Phone ID by UID (PUT)
- - This API is used to update the PhoneId by using the Uid's. Admin can update the PhoneId's for both the verified and unverified profiles. It will directly replace the PhoneId and bypass the OTP verification process. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/update-phoneid-by-uid) - -```java - -String phone = ""; //Required -String uid = ""; //Required -String fields = null; //Optional - -AccountApi accountApi = new AccountApi(); -accountApi.updatePhoneIDByUid(phone, uid, fields , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(Identity response) { - System.out.println(response.getUid()); - } -}); - -``` - - - - - - -
Account Set Password (PUT)
- - This API is used to set the password of an account in Cloud Storage. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-set-password) - -```java - -String password = ""; //Required -String uid = ""; //Required - -AccountApi accountApi = new AccountApi(); -accountApi.setAccountPasswordByUid(password, uid , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(UserPasswordHash response) { - System.out.println(response.getPasswordHash()); - } -}); - -``` - - - - - - -
Account Invalidate Verification Email (PUT)
- - This API is used to invalidate the Email Verification status on an account. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-invalidate-verification-email) - -```java - -String uid = ""; //Required -String emailTemplate = ""; //Optional -String verificationUrl = ""; //Optional - -AccountApi accountApi = new AccountApi(); -accountApi.invalidateAccountEmailVerification(uid, emailTemplate, verificationUrl , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Reset phone ID verification (PUT)
- - This API Allows you to reset the phone no verification of an end user’s account. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/reset-phone-id-verification) - -```Java - -String uid = ""; //Required -String smsTemplate = ""; //Optional -Boolean isVoiceOtp = false; //Optional - -AccountApi accountApi = new AccountApi(); -accountApi.resetPhoneIDVerificationByUid(uid, smsTemplate, isVoiceOtp , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Upsert Email (PUT)
- - This API is used to add/upsert another emails in account profile by different-different email types. If the email type is same then it will simply update the existing email, otherwise it will add a new email in Email array. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/upsert-email) - -```java - -UpsertEmailModel upsertEmailModel = new UpsertEmailModel(); //Required -List email = new ArrayList < EmailModel >(); -EmailModel emailModel = new EmailModel(); -emailModel.setType("type"); -emailModel.setValue("value"); -email.add(emailModel); -upsertEmailModel.setEmail(email); -String uid = ""; //Required -String fields = null; //Optional - -AccountApi accountApi = new AccountApi(); -accountApi.upsertEmail( upsertEmailModel, uid, fields , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(Identity response) { - System.out.println(response.getUid()); - } -}); - -``` - - - - - - -
Update UID (PUT)
- - This API is used to update a user's Uid. It will update all profiles, custom objects and consent management logs associated with the Uid. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-update/) - -```java - -UpdateUidModel updateUidModel = new UpdateUidModel(); //Required -updateUidModel.setNewUid("newUid"); -String uid = ""; //Required - -AccountApi accountApi = new AccountApi(); -accountApi.accountUpdateUid( updateUidModel, uid , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Account Create (POST)
- - This API is used to create an account in Cloud Storage. This API bypass the normal email verification process and manually creates the user.

In order to use this API, you need to format a JSON request body with all of the mandatory fields [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-create) - -```java - -AccountCreateModel accountCreateModel = new AccountCreateModel(); //Required -List email = new ArrayList < EmailModel >(); -EmailModel emailModel = new EmailModel(); -emailModel.setType("type"); -emailModel.setValue("value"); -email.add(emailModel); -accountCreateModel.setEmail(email); -accountCreateModel.setFirstName("firstName"); -accountCreateModel.setLastName("lastName"); -accountCreateModel.setPassword("password"); -String fields = null; //Optional - -AccountApi accountApi = new AccountApi(); -accountApi.createAccount( accountCreateModel, fields , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(Identity response) { - System.out.println(response.getUid()); - } -}); - -``` - - - - - - -
Forgot Password token (POST)
- - This API Returns a Forgot Password Token it can also be used to send a Forgot Password email to the customer. Note: If you have the UserName workflow enabled, you may replace the 'email' parameter with 'username' in the body. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/get-forgot-password-token) - -```java - -String email = ""; //Required -String emailTemplate = ""; //Optional -String resetPasswordUrl = ""; //Optional -Boolean sendEmail = true; //Optional - -AccountApi accountApi = new AccountApi(); -accountApi.getForgotPasswordToken(email, emailTemplate, resetPasswordUrl, sendEmail , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(ForgotPasswordResponse response) { - System.out.println(response.getForgotToken()); - } -}); - -``` - - - - - - -
Email Verification token (POST)
- - This API Returns an Email Verification token. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/get-email-verification-token) - -```java - -String email = ""; //Required - -AccountApi accountApi = new AccountApi(); -accountApi.getEmailVerificationToken(email , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(EmailVerificationTokenResponse response) { - System.out.println(response.getVerificationToken()); - } -}); - -``` - - -
Multipurpose Email Token Generation API (POST)
- - This API generate Email tokens and Email OTPs for Email verification, Add email, Forgot password, Delete user, Passwordless login, Forgot pin, One-touch login and Auto login. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/multipurpose-token-and-sms-otp-generation-api/multipurpose-email-token-generation/) - -```Java - -MultiEmailToken multiEmailToken = new MultiEmailToken(); //Required -multiEmailToken.setClientguid("clientguid"); -multiEmailToken.setEmail("email"); -multiEmailToken.setName("name"); -multiEmailToken.setType("type"); -multiEmailToken.setUid("uid"); -multiEmailToken.setUserName("userName"); -String tokentype = ""; //Required - -AccountApi accountApi = new AccountApi(); -accountApi.multipurposeEmailTokenGeneration( multiEmailToken, tokentype , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(MultiToken response) { - System.out.println(response.getExpiresIn()); - } -}); - -``` - - - - - - -
Multipurpose SMS OTP Generation API (POST)
- - This API generates SMS OTP for Add phone, Phone Id verification, Forgot password, Forgot pin, One-touch login, smart login and Passwordless login. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/multipurpose-token-and-sms-otp-generation-api/multipurpose-sms-otp-generation/) - -```Java - -MultiSmsOtp multiSmsOtp = new MultiSmsOtp(); //Required -multiSmsOtp.setName("name"); -multiSmsOtp.setPhone("phone"); -multiSmsOtp.setUid("uid"); -String smsotptype = ""; //Required - -AccountApi accountApi = new AccountApi(); -accountApi.multipurposeSMSOTPGeneration( multiSmsOtp, smsotptype , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(MultiToken response) { - System.out.println(response.getExpiresIn()); - } -}); - -``` - - - - - - -
Get Privacy Policy History By Uid (GET)
- - This API is used to retrieve all of the accepted Policies by the user, associated with their UID. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/privacy-policy-history-by-uid/) - -```java - -String uid = ""; //Required - -AccountApi accountApi = new AccountApi(); -accountApi.getPrivacyPolicyHistoryByUid(uid , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PrivacyPolicyHistoryResponse response) { - System.out.println(response.getCurrent()); - } -}); - -``` - - - - - - -
Account Profiles by Email (GET)
- - This API is used to retrieve all of the profile data, associated with the specified account by email in Cloud Storage. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-profiles-by-email) - -```java - -String email = ""; //Required -String fields = null; //Optional - -AccountApi accountApi = new AccountApi(); -accountApi.getAccountProfileByEmail(email, fields , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(Identity response) { - System.out.println(response.getUid()); - } -}); - -``` - - - - - - -
Account Profiles by Username (GET)
- - This API is used to retrieve all of the profile data associated with the specified account by user name in Cloud Storage. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-profiles-by-user-name) - -```java - -String userName = ""; //Required -String fields = null; //Optional - -AccountApi accountApi = new AccountApi(); -accountApi.getAccountProfileByUserName(userName, fields , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(Identity response) { - System.out.println(response.getUid()); - } -}); - -``` - - - - - - -
Account Profile by Phone ID (GET)
- - This API is used to retrieve all of the profile data, associated with the account by phone number in Cloud Storage. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-profiles-by-phone-id/) - -```java - -String phone = ""; //Required -String fields = null; //Optional - -AccountApi accountApi = new AccountApi(); -accountApi.getAccountProfileByPhone(phone, fields , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(Identity response) { - System.out.println(response.getUid()); - } -}); - -``` - - - - - - -
Account Profiles by UID (GET)
- - This API is used to retrieve all of the profile data, associated with the account by uid in Cloud Storage. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-profiles-by-uid) - -```java - -String uid = ""; //Required -String fields = null; //Optional - -AccountApi accountApi = new AccountApi(); -accountApi.getAccountProfileByUid(uid, fields , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(Identity response) { - System.out.println(response.getUid()); - } -}); - -``` - - - - - - -
Account Password (GET)
- - This API use to retrive the hashed password of a specified account in Cloud Storage. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-password) - -```java - -String uid = ""; //Required - -AccountApi accountApi = new AccountApi(); -accountApi.getAccountPasswordHashByUid(uid , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(UserPasswordHash response) { - System.out.println(response.getPasswordHash()); - } -}); - -``` - - - - - - -
Access Token based on UID or User impersonation API (GET)
- - The API is used to get LoginRadius access token based on UID. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-impersonation-api) - -```java - -String uid = ""; //Required - -AccountApi accountApi = new AccountApi(); -accountApi.getAccessTokenByUid(uid , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessTokenBase response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - -
Refresh Access Token by Refresh Token (GET)
- - This API is used to refresh an access token via it's associated refresh token. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/refresh-token/refresh-access-token-by-refresh-token) - -```java - -String refreshToken = ""; //Required - -AccountApi accountApi = new AccountApi(); -accountApi.refreshAccessTokenByRefreshToken(refreshToken , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessTokenBase response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - -
Revoke Refresh Token (GET)
- - The Revoke Refresh Access Token API is used to revoke a refresh token or the Provider Access Token, revoking an existing refresh token will invalidate the refresh token but the associated access token will work until the expiry. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/refresh-token/revoke-refresh-token) - -```java - -String refreshToken = ""; //Required - -AccountApi accountApi = new AccountApi(); -accountApi.revokeRefreshToken(refreshToken , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(DeleteResponse response) { - System.out.println(response.getIsDeleted()); - } -}); - -``` - - - - - - -
Account Identities by Email (GET)
- - Note: This is intended for specific workflows where an email may be associated to multiple UIDs. This API is used to retrieve all of the identities (UID and Profiles), associated with a specified email in Cloud Storage. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-identities-by-email) - -```java - -String email = ""; //Required -String fields = null; //Optional - -AccountApi accountApi = new AccountApi(); -accountApi.getAccountIdentitiesByEmail(email, fields , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(ListReturn response) { - System.out.println(response.getData().get(0).getUid()); - } -}); - -``` - - - - - - -
Account Delete (DELETE)
- - This API deletes the Users account and allows them to re-register for a new account. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-delete) - -```java - -String uid = ""; //Required - -AccountApi accountApi = new AccountApi(); -accountApi.deleteAccountByUid(uid , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(DeleteResponse response) { - System.out.println(response.getIsDeleted()); - } -}); - -``` - - - - - - -
Account Remove Email (DELETE)
- - Use this API to Remove emails from a user Account [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-email-delete) - -```java - -String email = ""; //Required -String uid = ""; //Required -String fields = null; //Optional - -AccountApi accountApi = new AccountApi(); -accountApi.removeEmail(email, uid, fields , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(Identity response) { - System.out.println(response.getUid()); - } -}); - -``` - -
Revoke All Refresh Token (DELETE)
- - The Revoke All Refresh Access Token API is used to revoke all refresh tokens for a specific user. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/refresh-token/revoke-all-refresh-token/) - -```Java - -String uid = ""; //Required - -AccountApi accountApi = new AccountApi(); -accountApi.revokeAllRefreshToken(uid , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(DeleteResponse response) { - System.out.println(response.getIsDeleted()); - } -}); - -``` - - - - -
Delete User Profiles By Email (DELETE)
- - This API is used to delete all user profiles associated with an Email. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/account/account-email-delete/) - -```java - -String email = ""; //Required - -AccountApi accountApi = new AccountApi(); -accountApi.accountDeleteByEmail(email , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(DeleteResponse response) { - System.out.println(response.getIsDeleted()); - } -}); - -``` - - - - - - - - - -### Social API - - -List of APIs in this Section:
- -* GET : [Access Token](#ExchangeAccessToken-get-)
-* GET : [Refresh Token](#RefreshAccessToken-get-)
-* GET : [Token Validate](#ValidateAccessToken-get-)
-* GET : [Access Token Invalidate](#InValidateAccessToken-get-)
-* GET : [Get Active Session Details](#GetActiveSession-get-)
-* GET : [Get Active Session By Account Id](#GetActiveSessionByAccountID-get-)
-* GET : [Get Active Session By Profile Id](#GetActiveSessionByProfileID-get-)
- - - - -
Access Token (GET)
- - This API Is used to translate the Request Token returned during authentication into an Access Token that can be used with other API calls. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/access-token) - -```java - -String token = ""; //Required - -SocialApi socialApi = new SocialApi(); -socialApi.exchangeAccessToken(token , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessTokenBase response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - -
Refresh Token (GET)
- - The Refresh Access Token API is used to refresh the provider access token after authentication. It will be valid for up to 60 days on LoginRadius depending on the provider. In order to use the access token in other APIs, always refresh the token using this API.

Supported Providers : Facebook,Yahoo,Google,Twitter, Linkedin.

Contact LoginRadius support team to enable this API. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/refresh-token/refresh-token) - -```java - -String accessToken = ""; //Required -Integer expiresIn = 0; //Optional -Boolean isWeb = true; //Optional - -SocialApi socialApi = new SocialApi(); -socialApi.refreshAccessToken(accessToken, expiresIn, isWeb , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessTokenBase response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - -
Token Validate (GET)
- - This API validates access token, if valid then returns a response with its expiry otherwise error. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/validate-access-token) - -```java - -String accessToken = ""; //Required - -SocialApi socialApi = new SocialApi(); -socialApi.validateAccessToken(accessToken , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessTokenBase response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - -
Access Token Invalidate (GET)
- - This api invalidates the active access token or expires an access token validity. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/invalidate-access-token) - -```java - -String accessToken = ""; //Required - -SocialApi socialApi = new SocialApi(); -socialApi.inValidateAccessToken(accessToken , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostMethodResponseBase response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Get Active Session Details (GET)
- - This api is use to get all active session by Access Token. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/advanced-social-api/get-active-session-details) - -```java - -String token = ""; //Required - -SocialApi socialApi = new SocialApi(); -socialApi.getActiveSession(token , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(UserActiveSession response) { - System.out.println(response.getData().get(0).getAccessToken()); - } -}); - -``` - - - - - - -
Get Active Session By Account Id (GET)
- - This api is used to get all active sessions by AccountID(UID). [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/active-session-by-account-id/) - -```java - -String accountId = ""; //Required - -SocialApi socialApi = new SocialApi(); -socialApi.getActiveSessionByAccountID(accountId , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(UserActiveSession response) { - System.out.println(response.getData().get(0).getAccessToken()); - } -}); - -``` - - - - - - -
Get Active Session By Profile Id (GET)
- - This api is used to get all active sessions by ProfileId. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/active-session-by-profile-id/) - -```java - -String profileId = ""; //Required - -SocialApi socialApi = new SocialApi(); -socialApi.getActiveSessionByProfileID(profileId , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(UserActiveSession response) { - System.out.println(response.getData().get(0).getAccessToken()); - } -}); - -``` - - - -### CustomObject API - - -List of APIs in this Section:
- -* PUT : [Custom Object Update by Access Token](#UpdateCustomObjectByToken-put-)
-* PUT : [Custom Object Update by UID](#UpdateCustomObjectByUid-put-)
-* POST : [Create Custom Object by Token](#CreateCustomObjectByToken-post-)
-* POST : [Create Custom Object by UID](#CreateCustomObjectByUid-post-)
-* GET : [Custom Object by Token](#GetCustomObjectByToken-get-)
-* GET : [Custom Object by ObjectRecordId and Token](#GetCustomObjectByRecordIDAndToken-get-)
-* GET : [Custom Object By UID](#GetCustomObjectByUid-get-)
-* GET : [Custom Object by ObjectRecordId and UID](#GetCustomObjectByRecordID-get-)
-* DELETE : [Custom Object Delete by Record Id And Token](#DeleteCustomObjectByToken-delete-)
-* DELETE : [Account Delete Custom Object by ObjectRecordId](#DeleteCustomObjectByRecordID-delete-)
- - - - -
Custom Object Update by Access Token (PUT)
- - This API is used to update the specified custom object data of the specified account. If the value of updatetype is 'replace' then it will fully replace custom object with the new custom object and if the value of updatetype is 'partialreplace' then it will perform an upsert type operation [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-update-by-objectrecordid-and-token) - -```java - -String accessToken = ""; //Required -String objectName = ""; //Required -String objectRecordId = ""; //Required -JsonObject json = new JsonObject(); //Required -json.addProperty("field1", "Store my field1 value"); -CustomObjectUpdateOperationType updateType = CustomObjectUpdateOperationType.PartialReplace; //Optional - -CustomObjectApi customObjectApi = new CustomObjectApi(); -customObjectApi.updateCustomObjectByToken(accessToken, objectName, objectRecordId, json, updateType , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(UserCustomObjectData response) { - System.out.println(response.getCustomObject()); - } -}); - -``` - - - - - - -
Custom Object Update by UID (PUT)
- - This API is used to update the specified custom object data of a specified account. If the value of updatetype is 'replace' then it will fully replace custom object with new custom object and if the value of updatetype is partialreplace then it will perform an upsert type operation. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-update-by-objectrecordid-and-uid) - -```java - -String objectName = ""; //Required -String objectRecordId = ""; //Required -JsonObject json = new JsonObject(); //Required -json.addProperty("field1", "Store my field1 value"); -String uid = ""; //Required -CustomObjectUpdateOperationType updateType = CustomObjectUpdateOperationType.PartialReplace; //Optional - -CustomObjectApi customObjectApi = new CustomObjectApi(); -customObjectApi.updateCustomObjectByUid(objectName, objectRecordId, json, uid, updateType , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(UserCustomObjectData response) { - System.out.println(response.getCustomObject()); - } -}); - -``` - - - - - - -
Create Custom Object by Token (POST)
- - This API is used to write information in JSON format to the custom object for the specified account. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/create-custom-object-by-token) - -```java - -String accessToken = ""; //Required -String objectName = ""; //Required -JsonObject json = new JsonObject(); //Required -json.addProperty("field1", "Store my field1 value"); - -CustomObjectApi customObjectApi = new CustomObjectApi(); -customObjectApi.createCustomObjectByToken(accessToken, objectName, json , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(UserCustomObjectData response) { - System.out.println(response.getCustomObject()); - } -}); - -``` - - - - - - -
Create Custom Object by UID (POST)
- - This API is used to write information in JSON format to the custom object for the specified account. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/create-custom-object-by-uid) - -```java - -String objectName = ""; //Required -JsonObject json = new JsonObject(); //Required -json.addProperty("field1", "Store my field1 value"); -String uid = ""; //Required - -CustomObjectApi customObjectApi = new CustomObjectApi(); -customObjectApi.createCustomObjectByUid(objectName, json, uid , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(UserCustomObjectData response) { - System.out.println(response.getCustomObject()); - } -}); - -``` - - - - - - -
Custom Object by Token (GET)
- - This API is used to retrieve the specified Custom Object data for the specified account. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-by-token) - -```java - -String accessToken = ""; //Required -String objectName = ""; //Required - -CustomObjectApi customObjectApi = new CustomObjectApi(); -customObjectApi.getCustomObjectByToken(accessToken, objectName , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(ListData response) { - System.out.println(response.getCount()); - } -}); - -``` - - - - - - -
Custom Object by ObjectRecordId and Token (GET)
- - This API is used to retrieve the Custom Object data for the specified account. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-by-objectrecordid-and-token) - -```java - -String accessToken = ""; //Required -String objectName = ""; //Required -String objectRecordId = ""; //Required - -CustomObjectApi customObjectApi = new CustomObjectApi(); -customObjectApi.getCustomObjectByRecordIDAndToken(accessToken, objectName, objectRecordId , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(UserCustomObjectData response) { - System.out.println(response.getCustomObject()); - } -}); - -``` - - - - - - -
Custom Object By UID (GET)
- - This API is used to retrieve all the custom objects by UID from cloud storage. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-by-uid) - -```java - -String objectName = ""; //Required -String uid = ""; //Required - -CustomObjectApi customObjectApi = new CustomObjectApi(); -customObjectApi.getCustomObjectByUid(objectName, uid , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(ListData response) { - System.out.println(response.getCount()); - } -}); - -``` - - - - - - -
Custom Object by ObjectRecordId and UID (GET)
- - This API is used to retrieve the Custom Object data for the specified account. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-by-objectrecordid-and-uid) - -```java - -String objectName = ""; //Required -String objectRecordId = ""; //Required -String uid = ""; //Required - -CustomObjectApi customObjectApi = new CustomObjectApi(); -customObjectApi.getCustomObjectByRecordID(objectName, objectRecordId, uid , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(UserCustomObjectData response) { - System.out.println(response.getCustomObject()); - } -}); - -``` - - - - - - -
Custom Object Delete by Record Id And Token (DELETE)
- - This API is used to remove the specified Custom Object data using ObjectRecordId of a specified account. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-delete-by-objectrecordid-and-token) - -```java - -String accessToken = ""; //Required -String objectName = ""; //Required -String objectRecordId = ""; //Required - -CustomObjectApi customObjectApi = new CustomObjectApi(); -customObjectApi.deleteCustomObjectByToken(accessToken, objectName, objectRecordId , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(DeleteResponse response) { - System.out.println(response.getIsDeleted()); - } -}); - -``` - - - - - - -
Account Delete Custom Object by ObjectRecordId (DELETE)
- - This API is used to remove the specified Custom Object data using ObjectRecordId of specified account. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/custom-object/custom-object-delete-by-objectrecordid-and-uid) - -```java - -String objectName = ""; //Required -String objectRecordId = ""; //Required -String uid = ""; //Required - -CustomObjectApi customObjectApi = new CustomObjectApi(); -customObjectApi.deleteCustomObjectByRecordID(objectName, objectRecordId, uid , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(DeleteResponse response) { - System.out.println(response.getIsDeleted()); - } -}); - -``` - - - - - - - - - -### PhoneAuthentication API - - -List of APIs in this Section:
- -* PUT : [Phone Reset Password by OTP](#ResetPasswordByPhoneOTP-put-)
-* PUT : [Phone Verification OTP](#PhoneVerificationByOTP-put-)
-* PUT : [Phone Verification OTP by Token](#PhoneVerificationOTPByAccessToken-put-)
-* PUT : [Phone Number Update](#UpdatePhoneNumber-put-)
-* POST : [Phone Login](#LoginByPhone-post-)
-* POST : [Phone Forgot Password by OTP](#ForgotPasswordByPhoneOTP-post-)
-* POST : [Phone Resend Verification OTP](#PhoneResendVerificationOTP-post-)
-* POST : [Phone Resend Verification OTP By Token](#PhoneResendVerificationOTPByToken-post-)
-* POST : [Phone User Registration by SMS](#UserRegistrationByPhone-post-)
-* GET : [Phone Number Availability](#CheckPhoneNumberAvailability-get-)
-* DELETE : [Remove Phone ID by Access Token](#RemovePhoneIDByAccessToken-delete-)
- - - - -
Phone Reset Password by OTP (PUT)
- - This API is used to reset the password [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-reset-password-by-otp) - -```java - -ResetPasswordByOTPModel resetPasswordByOTPModel = new ResetPasswordByOTPModel(); //Required -resetPasswordByOTPModel.setOtp("otp"); -resetPasswordByOTPModel.setPassword("password"); -resetPasswordByOTPModel.setPhone("phone"); - -PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi(); -phoneAuthenticationApi.resetPasswordByPhoneOTP( resetPasswordByOTPModel , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Phone Verification OTP (PUT)
- - This API is used to validate the verification code sent to verify a user's phone number [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-verify-otp) - -```Java - -String otp = ""; //Required -String phone = ""; //Required -String fields = null; //Optional -String smsTemplate = ""; //Optional -Boolean isVoiceOtp = false; //Optional - -PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi(); -phoneAuthenticationApi.phoneVerificationByOTP(otp, phone, fields, smsTemplate, isVoiceOtp , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessToken response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - -
Phone Verification OTP by Token (PUT)
- - This API is used to consume the verification code sent to verify a user's phone number. Use this call for front-end purposes in cases where the user is already logged in by passing the user's access token. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-verify-otp-by-token) - -```Java - -String accessToken = ""; //Required -String otp = ""; //Required -String smsTemplate = ""; //Optional -Boolean isVoiceOtp = false; //Optional - -PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi(); -phoneAuthenticationApi.phoneVerificationOTPByAccessToken(accessToken, otp, smsTemplate, isVoiceOtp , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Phone Number Update (PUT)
- - This API is used to update the login Phone Number of users [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-number-update) - -```java - -String accessToken = ""; //Required -String phone = ""; //Required -String smsTemplate = ""; //Optional - -PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi(); -phoneAuthenticationApi.updatePhoneNumber(accessToken, phone, smsTemplate , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(UserProfilePostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Phone Login (POST)
- - This API retrieves a copy of the user data based on the Phone [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-login) - -```java - -PhoneAuthenticationModel phoneAuthenticationModel = new PhoneAuthenticationModel(); //Required -phoneAuthenticationModel.setPassword("password"); -phoneAuthenticationModel.setPhone("phone"); -String fields = null; //Optional -String loginUrl = ""; //Optional -String smsTemplate = ""; //Optional - -PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi(); -phoneAuthenticationApi.loginByPhone( phoneAuthenticationModel, fields, loginUrl, smsTemplate , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessToken response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - -
Phone Forgot Password by OTP (POST)
- - This API is used to send the OTP to reset the account password. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-forgot-password-by-otp) - -```Java - -String phone = ""; //Required -String smsTemplate = ""; //Optional -Boolean isVoiceOtp = false; //Optional - -PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi(); -phoneAuthenticationApi.forgotPasswordByPhoneOTP(phone, smsTemplate, isVoiceOtp , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(UserProfilePostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Phone Resend Verification OTP (POST)
- - This API is used to resend a verification OTP to verify a user's Phone Number. The user will receive a verification code that they will need to input [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-resend-otp) - -```Java - -String phone = ""; //Required -String smsTemplate = ""; //Optional -Boolean isVoiceOtp = false; //Optional - -PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi(); -phoneAuthenticationApi.phoneResendVerificationOTP(phone, smsTemplate, isVoiceOtp , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(UserProfilePostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Phone Resend Verification OTP By Token (POST)
- - This API is used to resend a verification OTP to verify a user's Phone Number in cases in which an active token already exists [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-resend-otp-by-token) - -```java - -String accessToken = ""; //Required -String phone = ""; //Required -String smsTemplate = ""; //Optional - -PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi(); -phoneAuthenticationApi.phoneResendVerificationOTPByToken(accessToken, phone, smsTemplate , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(UserProfilePostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Phone User Registration by SMS (POST)
- - This API registers the new users into your Cloud Storage and triggers the phone verification process. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-user-registration-by-sms) - -```Java - -AuthUserRegistrationModel authUserRegistrationModel = new AuthUserRegistrationModel(); //Required -List email = new ArrayList < EmailModel >(); -EmailModel emailModel = new EmailModel(); -emailModel.setType("type"); -emailModel.setValue("value"); -email.add(emailModel); -authUserRegistrationModel.setEmail(email); -authUserRegistrationModel.setFirstName("firstName"); -authUserRegistrationModel.setLastName("lastName"); -authUserRegistrationModel.setPassword("password"); -authUserRegistrationModel.setPhoneId("phoneId"); -String sott = ""; //Required -String fields = null; //Optional -String options = ""; //Optional -String smsTemplate = ""; //Optional -String verificationUrl = ""; //Optional -String welcomeEmailTemplate = ""; //Optional -String emailTemplate = ""; //Optional -Boolean isVoiceOtp = false; //Optional - -PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi(); -phoneAuthenticationApi.userRegistrationByPhone( authUserRegistrationModel, sott, fields, options, smsTemplate, verificationUrl, welcomeEmailTemplate , emailTemplate , isVoiceOtp, new AsyncHandler>> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(UserProfilePostResponse> response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Phone Number Availability (GET)
- - This API is used to check the Phone Number exists or not on your site. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-number-availability) - -```java - -String phone = ""; //Required - -PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi(); -phoneAuthenticationApi.checkPhoneNumberAvailability(phone , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(ExistResponse response) { - System.out.println(response.getIsExist()); - } -}); - -``` - - - - - - -
Remove Phone ID by Access Token (DELETE)
- - This API is used to delete the Phone ID on a user's account via the access token [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/remove-phone-id-by-access-token) - -```java - -String accessToken = ""; //Required - -PhoneAuthenticationApi phoneAuthenticationApi = new PhoneAuthenticationApi(); -phoneAuthenticationApi.removePhoneIDByAccessToken(accessToken , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(DeleteResponse response) { - System.out.println(response.getIsDeleted()); - } -}); - -``` - - - - - - - - - -### MultiFactorAuthentication API - - -List of APIs in this Section:
- -* PUT : [Update MFA Setting](#MFAUpdateSetting-put-)
-* PUT : [Update MFA by Access Token](#MFAUpdateByAccessToken-put-)
-* PUT : [MFA Update Phone Number by Token](#MFAUpdatePhoneNumberByToken-put-)
-* PUT : [Verify MFA Email OTP by Access Token](#MFAValidateEmailOtpByAccessToken-put-)
-* PUT : [Update MFA Security Question by Access Token](#MFASecurityQuestionAnswerByAccessToken-put-)
-* PUT : [MFA Validate OTP](#MFAValidateOTPByPhone-put-)
-* PUT : [MFA Validate Backup code](#MFAValidateBackupCode-put-)
-* PUT : [MFA Update Phone Number](#MFAUpdatePhoneNumber-put-)
-* PUT : [Verify MFA Email OTP by MFA Token](#MFAValidateEmailOtp-put-)
-* PUT : [Update MFA Security Question by MFA Token](#MFASecurityQuestionAnswer-put-)
-* PUT : [MFA Validate Authenticator Code](#MFAValidateAuthenticatorCode-put-)
-* PUT : [MFA Verify Authenticator Code](#MFAVerifyAuthenticatorCode-put-)
-* POST : [MFA Email Login](#MFALoginByEmail-post-)
-* POST : [MFA UserName Login](#MFALoginByUserName-post-)
-* POST : [MFA Phone Login](#MFALoginByPhone-post-)
-* POST : [Send MFA Email OTP by MFA Token](#MFAEmailOTP-post-)
-* POST : [Verify MFA Security Question by MFA Token](#MFASecurityQuestionAnswerVerification-post-)
-* GET : [MFA Validate Access Token](#MFAConfigureByAccessToken-get-)
-* GET : [MFA Backup Code by Access Token](#MFABackupCodeByAccessToken-get-)
-* GET : [Reset Backup Code by Access Token](#MFAResetBackupCodeByAccessToken-get-)
-* GET : [Send MFA Email OTP by Access Token](#MFAEmailOtpByAccessToken-get-)
-* GET : [MFA Resend Otp](#MFAResendOTP-get-)
-* GET : [MFA Backup Code by UID](#MFABackupCodeByUid-get-)
-* GET : [MFA Reset Backup Code by UID](#MFAResetBackupCodeByUid-get-)
-* DELETE : [MFA Reset Authenticator by Token](#MFAResetAuthenticatorByToken-delete-)
-* DELETE : [MFA Reset SMS Authenticator by Token](#MFAResetSMSAuthByToken-delete-)
-* DELETE : [Reset MFA Email OTP Authenticator By Access Token](#MFAResetEmailOtpAuthenticatorByAccessToken-delete-)
-* DELETE : [MFA Reset Security Question Authenticator By Access Token](#MFAResetSecurityQuestionAuthenticatorByAccessToken-delete-)
-* DELETE : [MFA Reset SMS Authenticator By UID](#MFAResetSMSAuthenticatorByUid-delete-)
-* DELETE : [MFA Reset Authenticator By UID](#MFAResetAuthenticatorByUid-delete-)
-* DELETE : [Reset MFA Email OTP Authenticator Settings by Uid](#MFAResetEmailOtpAuthenticatorByUid-delete-)
-* DELETE : [Reset MFA Security Question Authenticator Settings by Uid](#MFAResetSecurityQuestionAuthenticatorByUid-delete-)
- - - - -
Update MFA Setting (PUT)
- - This API is used to trigger the Multi-factor authentication settings after login for secure actions [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/update-mfa-setting/) - -```java - -String accessToken = ""; //Required -MultiFactorAuthModelWithLockout multiFactorAuthModelWithLockout = new MultiFactorAuthModelWithLockout(); //Required -multiFactorAuthModelWithLockout.setOtp("otp"); -String fields = null; //Optional - -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaUpdateSetting(accessToken, multiFactorAuthModelWithLockout, fields , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(Identity response) { - System.out.println(response.getUid()); - } -}); - -``` - - - - - - -
Update MFA by Access Token (PUT)
- - This API is used to Enable Multi-factor authentication by access token on user login [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/google-authenticator/update-mfa-by-access-token/) - -```java - -String accessToken = ""; //Required -MultiFactorAuthModelByGoogleAuthenticatorCode multiFactorAuthModelByGoogleAuthenticatorCode = new MultiFactorAuthModelByGoogleAuthenticatorCode(); //Required -multiFactorAuthModelByGoogleAuthenticatorCode.setGoogleAuthenticatorCode("googleAuthenticatorCode"); -String fields = null; //Optional -String smsTemplate = ""; //Optional - -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaUpdateByAccessToken(accessToken, multiFactorAuthModelByGoogleAuthenticatorCode, fields, smsTemplate , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(Identity response) { - System.out.println(response.getUid()); - } -}); - -``` - - - - - - -
MFA Update Phone Number by Token (PUT)
- - This API is used to update the Multi-factor authentication phone number by sending the verification OTP to the provided phone number [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/mfa-update-phone-number-by-token/) - -```Java - -String accessToken = ""; //Required -String phoneNo2FA = ""; //Required -String smsTemplate2FA = ""; //Optional -Boolean isVoiceOtp = false; //Optional -String options = ""; //Optional - -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaUpdatePhoneNumberByToken(accessToken, phoneNo2FA, smsTemplate2FA, isVoiceOtp ,options, new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(SmsResponseData response) { - System.out.println(response.getAccountSid()); - } -}); - -``` - - - - - - -
Verify MFA Email OTP by Access Token (PUT)
- - This API is used to set up MFA Email OTP authenticator on profile after login. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/verify-mfa-otp-by-access-token/) - -```java - -String accessToken = ""; //Required -MultiFactorAuthModelByEmailOtpWithLockout multiFactorAuthModelByEmailOtpWithLockout = new MultiFactorAuthModelByEmailOtpWithLockout(); //Required -multiFactorAuthModelByEmailOtpWithLockout.setEmailId(""); -multiFactorAuthModelByEmailOtpWithLockout.setOtp(""); -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaValidateEmailOtpByAccessToken(accessToken, multiFactorAuthModelByEmailOtpWithLockout , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } -@Override - public void onSuccess(Identity response) { - System.out.println(response.getUid()); - } -}); - -``` - - - - - - -
Update MFA Security Question by Access Token (PUT)
- - This API is used to set up MFA Security Question authenticator on profile after login. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/update-mfa-security-question-by-access-token) - -```java - -String accessToken = ""; //Required - -SecurityQuestionAnswerModelByAccessToken securityQuestionAnswerModelByAccessToken = new SecurityQuestionAnswerModelByAccessToken(); //Required -List securityQuestions=new ArrayList(); - -SecurityQuestionOptionalModel securityQuestionOptionalModel=new SecurityQuestionOptionalModel(); - -securityQuestionOptionalModel.setQuestionId("db7****8a73e4******bd9****8c20"); -securityQuestionOptionalModel.setAnswer(""); -securityQuestions.add(securityQuestionOptionalModel); - -securityQuestionAnswerModelByAccessToken.setSecurityQuestionAnswer(securityQuestions); -securityQuestionAnswerModelByAccessToken.setReplaceSecurityQuestionAnswer(true); - -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaSecurityQuestionAnswerByAccessToken(accessToken, securityQuestionAnswerModelByAccessToken , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } -@Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - - -
MFA Validate OTP (PUT)
- - This API is used to login via Multi-factor authentication by passing the One Time Password received via SMS [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/mfa-validate-otp/) - -```java - -MultiFactorAuthModelWithLockout multiFactorAuthModelWithLockout = new MultiFactorAuthModelWithLockout(); //Required -multiFactorAuthModelWithLockout.setOtp("otp"); -String secondFactorAuthenticationToken = ""; //Required -String fields = null; //Optional -String smsTemplate2FA = ""; //Optional -String rbaBrowserEmailTemplate = ""; //Optional -String rbaCityEmailTemplate = ""; //Optional -String rbaCountryEmailTemplate = ""; //Optional -String rbaIpEmailTemplate = ""; //Optional - -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaValidateOTPByPhone( multiFactorAuthModelWithLockout, secondFactorAuthenticationToken, fields,smsTemplate2FA,rbaBrowserEmailTemplate, rbaCityEmailTemplate, rbaCountryEmailTemplate, rbaIpEmailTemplate , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessToken response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - -
MFA Validate Backup code (PUT)
- - This API is used to validate the backup code provided by the user and if valid, we return an access token allowing the user to login incases where Multi-factor authentication (MFA) is enabled and the secondary factor is unavailable. When a user initially downloads the Backup codes, We generate 10 codes, each code can only be consumed once. if any user attempts to go over the number of invalid login attempts configured in the Dashboard then the account gets blocked automatically [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/backup-codes/mfa-validate-backup-code/) - -```java - -MultiFactorAuthModelByBackupCode multiFactorAuthModelByBackupCode = new MultiFactorAuthModelByBackupCode(); //Required -multiFactorAuthModelByBackupCode.setBackupCode("backupCode"); -String secondFactorAuthenticationToken = ""; //Required -String fields = null; //Optional -String rbaBrowserEmailTemplate = ""; //Optional -String rbaCityEmailTemplate = ""; //Optional -String rbaCountryEmailTemplate = ""; //Optional -String rbaIpEmailTemplate = ""; //Optional - -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaValidateBackupCode( multiFactorAuthModelByBackupCode, secondFactorAuthenticationToken, fields, rbaBrowserEmailTemplate, rbaCityEmailTemplate, rbaCountryEmailTemplate, rbaIpEmailTemplate , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessToken response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - -
MFA Update Phone Number (PUT)
- - This API is used to update (if configured) the phone number used for Multi-factor authentication by sending the verification OTP to the provided phone number [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/mfa-update-phone-number/) - -```Java - -String phoneNo2FA = ""; //Required -String secondFactorAuthenticationToken = ""; //Required -String smsTemplate2FA = ""; //Optional -Boolean isVoiceOtp = false; //Optional -String options = ""; //Optional - -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaUpdatePhoneNumber(phoneNo2FA, secondFactorAuthenticationToken, smsTemplate2FA , isVoiceOtp , options, new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(SmsResponseData response) { - System.out.println(response.getAccountSid()); - } -}); - -``` - - - - - - -
Verify MFA Email OTP by MFA Token (PUT)
- - This API is used to Verify MFA Email OTP by MFA Token [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/verify-mfa-email-otp-by-mfa-token/) - -```java - -MultiFactorAuthModelByEmailOtp multiFactorAuthModelByEmailOtp = new MultiFactorAuthModelByEmailOtp(); //Required -multiFactorAuthModelByEmailOtp.setEmailId(""); -multiFactorAuthModelByEmailOtp.setOtp(""); -String secondFactorAuthenticationToken = ""; //Required -String rbaBrowserEmailTemplate = ""; //Optional -String rbaCityEmailTemplate = ""; //Optional -String rbaCountryEmailTemplate = ""; //Optional -String rbaIpEmailTemplate = ""; //Optional - -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaValidateEmailOtp( multiFactorAuthModelByEmailOtp, secondFactorAuthenticationToken, rbaBrowserEmailTemplate, rbaCityEmailTemplate, rbaCountryEmailTemplate, rbaIpEmailTemplate , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } -@Override - public void onSuccess(AccessToken response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - -
Update MFA Security Question by MFA Token (PUT)
- - This API is used to set the security questions on the profile with the MFA token when MFA flow is required. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/update-mfa-security-question-by-mfa-token/) - -```java -SecurityQuestionAnswerUpdateModel securityQuestionAnswerUpdateModel = new SecurityQuestionAnswerUpdateModel(); //Required -List securityQuestions=new ArrayList(); -SecurityQuestionModel securityQuestionModel=new SecurityQuestionModel(); -securityQuestionModel.setQuestionId("db7****8a73e4******bd9****8c20"); -securityQuestionModel.setAnswer(""); -securityQuestions.add(securityQuestionModel); - -securityQuestionAnswerUpdateModel.setSecurityQuestionAnswer(securityQuestions); - -String secondFactorAuthenticationToken = ""; //Required - -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaSecurityQuestionAnswer( securityQuestionAnswerUpdateModel, secondFactorAuthenticationToken , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } -@Override - public void onSuccess(AccessToken response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - -
MFA Validate Authenticator Code (PUT)
- - This API is used to login to a user's account during the second MFA step with an Authenticator Code. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/authenticator/mfa-validate-authenticator-code/) - -```Java - -MultiFactorAuthModelByAuthenticatorCode multiFactorAuthModelByAuthenticatorCode = new MultiFactorAuthModelByAuthenticatorCode(); //Required -multiFactorAuthModelByAuthenticatorCode.setAuthenticatorCode(""); -String secondfactorauthenticationtoken = ""; //Required -String fields = null; //Optional - -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaValidateAuthenticatorCode( multiFactorAuthModelByAuthenticatorCode, secondfactorauthenticationtoken, fields , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(MultiFactorAuthenticationResponse response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - -
MFA Verify Authenticator Code (PUT)
- - This API is used to validate an Authenticator Code as part of the MFA process. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/authenticator/mfa-verify-authenticator-code/) - -```Java - -String accessToken = ""; //Required -MultiFactorAuthModelByAuthenticatorCodeSecurityAnswer multiFactorAuthModelByAuthenticatorCodeSecurityAnswer = new MultiFactorAuthModelByAuthenticatorCodeSecurityAnswer(); //Required -multiFactorAuthModelByAuthenticatorCodeSecurityAnswer.setAuthenticatorCode("authenticatorCode"); -String fields = null; //Optional - -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaVerifyAuthenticatorCode(accessToken, multiFactorAuthModelByAuthenticatorCodeSecurityAnswer, fields , new AsyncHandler (){ - -@Override -public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); -} - -@Override -public void onSuccess(UserProfile response) { - System.out.println(response.getIsActive()); -} -}); - -``` - - - -
MFA Email Login (POST)
- - This API can be used to login by emailid on a Multi-factor authentication enabled LoginRadius site. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/mfa-email-login) - -```Java - -String email = ""; //Required -String password = ""; //Required -String emailTemplate = ""; //Optional -String fields = null; //Optional -String loginUrl = ""; //Optional -String smsTemplate = ""; //Optional -String smsTemplate2FA = ""; //Optional -String verificationUrl = ""; //Optional -String emailTemplate2FA = ""; //Optional -Boolean isVoiceOtp = false; //Optional -String options = ""; //Optional - -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaLoginByEmail(email, password, emailTemplate, fields, loginUrl, smsTemplate, smsTemplate2FA, verificationUrl ,emailTemplate2FA, isVoiceOtp, options , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(MultiFactorAuthenticationResponse response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - -
MFA UserName Login (POST)
- - This API can be used to login by username on a Multi-factor authentication enabled LoginRadius site. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/mfa-user-name-login) - -```Java - -String password = ""; //Required -String username = ""; //Required -String emailTemplate = ""; //Optional -String fields = null; //Optional -String loginUrl = ""; //Optional -String smsTemplate = ""; //Optional -String smsTemplate2FA = ""; //Optional -String verificationUrl = ""; //Optional -String emailTemplate2FA = ""; //Optional - -Boolean isVoiceOtp = false; //Optional - -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaLoginByUserName(password, username, emailTemplate, fields, loginUrl, smsTemplate, smsTemplate2FA, verificationUrl ,emailTemplate2FA, isVoiceOtp, new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(MultiFactorAuthenticationResponse response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - -
MFA Phone Login (POST)
- - This API can be used to login by Phone on a Multi-factor authentication enabled LoginRadius site. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/mfa-phone-login) - -```Java - -String password = ""; //Required -String phone = ""; //Required -String emailTemplate = ""; //Optional -String fields = null; //Optional -String loginUrl = ""; //Optional -String smsTemplate = ""; //Optional -String smsTemplate2FA = ""; //Optional -String verificationUrl = ""; //Optional -String emailTemplate2FA = ""; //Optional -Boolean isVoiceOtp = false; //Optional -String options = ""; //Optional - -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaLoginByPhone(password, phone, emailTemplate, fields, loginUrl, smsTemplate, smsTemplate2FA, verificationUrl ,emailTemplate2FA, isVoiceOtp ,options, new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(MultiFactorAuthenticationResponse response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - -
Send MFA Email OTP by MFA Token (POST)
- - An API designed to send the MFA Email OTP to the email. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/send-mfa-email-otp-by-mfa-token/) - -```java - -EmailIdModel emailIdModel = new EmailIdModel(); //Required -emailIdModel.setEmailId(""); -String secondFactorAuthenticationToken = ""; //Required -String emailTemplate2FA = ""; //Optional - -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaEmailOTP( emailIdModel, secondFactorAuthenticationToken, emailTemplate2FA , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } -@Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Verify MFA Security Question by MFA Token (POST)
- - This API is used to resending the verification OTP to the provided phone number [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/verify-mfa-security-question-by-mfa-token/) - -```java - -SecurityQuestionAnswerUpdateModel securityQuestionAnswerUpdateModel = new SecurityQuestionAnswerUpdateModel(); //Required -List securityQuestions=new ArrayList(); -SecurityQuestionModel securityQuestionModel=new SecurityQuestionModel(); -securityQuestionModel.setQuestionId("db7****8a73e4******bd9****8c20"); -securityQuestionModel.setAnswer(""); -securityQuestions.add(securityQuestionModel); - -securityQuestionAnswerUpdateModel.setSecurityQuestionAnswer(securityQuestions); - -String secondFactorAuthenticationToken = ""; //Required -String rbaBrowserEmailTemplate = ""; //Optional -String rbaCityEmailTemplate = ""; //Optional -String rbaCountryEmailTemplate = ""; //Optional -String rbaIpEmailTemplate = ""; //Optional - -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaSecurityQuestionAnswerVerification( securityQuestionAnswerUpdateModel, secondFactorAuthenticationToken, rbaBrowserEmailTemplate, rbaCityEmailTemplate, rbaCountryEmailTemplate, rbaIpEmailTemplate , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } -@Override - public void onSuccess(AccessToken response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - -
MFA Validate Access Token (GET)
- - This API is used to configure the Multi-factor authentication after login by using the access token when MFA is set as optional on the LoginRadius site. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/mfa-validate-access-token/) - -```Java - -String accessToken = ""; //Required -Boolean isVoiceOtp = false; //Optional - -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaConfigureByAccessToken(accessToken, isVoiceOtp , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(MultiFactorAuthenticationSettingsResponse response) { - System.out.println(response.getEmail()); - } -}); - -``` - -
MFA Reset Authenticator by Token (DELETE)
- - This API Resets the Authenticator configurations on a given account via the access_token. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/authenticator/mfa-reset-authenticator-by-token/) - -```Java - -String accessToken = ""; //Required -Boolean authenticator = true; //Required - -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaResetAuthenticatorByToken(accessToken, authenticator , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(DeleteResponse response) { - System.out.println(response.getIsDeleted()); - } -}); - -``` - - - - - -
MFA Backup Code by Access Token (GET)
- - This API is used to get a set of backup codes via access token to allow the user login on a site that has Multi-factor Authentication enabled in the event that the user does not have a secondary factor available. We generate 10 codes, each code can only be consumed once. If any user attempts to go over the number of invalid login attempts configured in the Dashboard then the account gets blocked automatically [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/backup-codes/mfa-backup-code-by-access-token/) - -```java - -String accessToken = ""; //Required - -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaBackupCodeByAccessToken(accessToken , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(BackupCodeResponse response) { - System.out.println(response.getBackUpCodes()); - } -}); - -``` - - - - - - -
Reset Backup Code by Access Token (GET)
- - API is used to reset the backup codes on a given account via the access token. This API call will generate 10 new codes, each code can only be consumed once [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/backup-codes/mfa-reset-backup-code-by-access-token/) - -```java - -String accessToken = ""; //Required - -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaResetBackupCodeByAccessToken(accessToken , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(BackupCodeResponse response) { - System.out.println(response.getBackUpCodes()); - } -}); - -``` - - - - - - -
Send MFA Email OTP by Access Token (GET)
- - This API is created to send the OTP to the email if email OTP authenticator is enabled in app's MFA configuration. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/send-mfa-email-otp-by-access-token/) - -```java - -String accessToken = ""; //Required -String emailId = ""; //Required -String emailTemplate2FA = ""; //Optional - -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaEmailOtpByAccessToken(accessToken, emailId, emailTemplate2FA , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
MFA Resend Otp (GET)
- - This API is used to resending the verification OTP to the provided phone number [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/resend-twofactorauthentication-otp/) - -```Java - -String secondFactorAuthenticationToken = ""; //Required -String smsTemplate2FA = ""; //Optional -Boolean isVoiceOtp = false; //Optional - -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaResendOTP(secondFactorAuthenticationToken, smsTemplate2FA, isVoiceOtp , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(SmsResponseData response) { - System.out.println(response.getAccountSid()); - } -}); - -``` - - - - - - -
MFA Backup Code by UID (GET)
- - This API is used to reset the backup codes on a given account via the UID. This API call will generate 10 new codes, each code can only be consumed once. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/backup-codes/mfa-backup-code-by-uid/) - -```java - -String uid = ""; //Required - -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaBackupCodeByUid(uid , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(BackupCodeResponse response) { - System.out.println(response.getBackUpCodes()); - } -}); - -``` - - - - - - -
MFA Reset Backup Code by UID (GET)
- - This API is used to reset the backup codes on a given account via the UID. This API call will generate 10 new codes, each code can only be consumed once. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/backup-codes/mfa-reset-backup-code-by-uid/) - -```java - -String uid = ""; //Required - -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaResetBackupCodeByUid(uid , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(BackupCodeResponse response) { - System.out.println(response.getBackUpCodes()); - } -}); - -``` - - - - - - -
MFA Reset SMS Authenticator by Token (DELETE)
- - This API resets the SMS Authenticator configurations on a given account via the access token. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/mfa-reset-sms-authenticator-by-token/) - -```java - -String accessToken = ""; //Required -Boolean otpauthenticator = true; //Required - -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaResetSMSAuthByToken(accessToken, otpauthenticator , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(DeleteResponse response) { - System.out.println(response.getIsDeleted()); - } -}); - -``` - - - - - - -
Reset MFA Email OTP Authenticator By Access Token (DELETE)
- - This API is used to reset the Email OTP Authenticator settings for an MFA-enabled user [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/reset-mfa-email-otp-authenticator-access-token/) - -```java - -String accessToken = ""; //Required - -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaResetEmailOtpAuthenticatorByAccessToken(accessToken , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(DeleteResponse response) { - System.out.println(response.getIsDeleted()); - } -}); - -``` - - - - - - -
MFA Reset Security Question Authenticator By Access Token (DELETE)
- - This API is used to Reset MFA Security Question Authenticator By Access Token [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/reset-mfa-security-question-by-access-token/) - -```java - -String accessToken = ""; //Required - -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaResetSecurityQuestionAuthenticatorByAccessToken(accessToken , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(DeleteResponse response) { - System.out.println(response.getIsDeleted()); - } -}); - -``` - - - - - - -
MFA Reset SMS Authenticator By UID (DELETE)
- - This API resets the SMS Authenticator configurations on a given account via the UID. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/sms-authenticator/mfa-reset-sms-authenticator-by-uid/) - -```java - -Boolean otpauthenticator = true; //Required -String uid = ""; //Required - -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaResetSMSAuthenticatorByUid(otpauthenticator, uid , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(DeleteResponse response) { - System.out.println(response.getIsDeleted()); - } -}); - -``` - - - -
MFA Reset Authenticator By UID (DELETE)
- - This API resets the Authenticator configurations on a given account via the UID. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/authenticator/mfa-reset-authenticator-by-uid/) - -```Java - -Boolean authenticator = true; //Required -String uid = ""; //Required - -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaResetAuthenticatorByUid(authenticator, uid , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(DeleteResponse response) { - System.out.println(response.getIsDeleted()); - } -}); - -``` - - - - - - -
Reset MFA Email OTP Authenticator Settings by Uid (DELETE)
- - This API is used to reset the Email OTP Authenticator settings for an MFA-enabled user. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/backup-codes/reset-mfa-email-otp-authenticator-settings-by-uid/) - -```java - -String uid = ""; //Required - -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaResetEmailOtpAuthenticatorByUid(uid , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(DeleteResponse response) { - System.out.println(response.getIsDeleted()); - } -}); - -``` - - - - - - -
Reset MFA Security Question Authenticator Settings by Uid (DELETE)
- - This API is used to reset the Security Question Authenticator settings for an MFA-enabled user. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/backup-codes/reset-mfa-security-question-authenticator-settings-by-uid/) - -```java - -String uid = ""; //Required - -MultiFactorAuthenticationApi multiFactorAuthenticationApi = new MultiFactorAuthenticationApi(); -multiFactorAuthenticationApi.mfaResetSecurityQuestionAuthenticatorByUid(uid , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(DeleteResponse response) { - System.out.println(response.getIsDeleted()); - } -}); - -``` - -### PINAuthentication API - - -List of APIs in this Section:
- -* PUT : [Reset PIN By ResetToken](#ResetPINByResetToken-put-)
-* PUT : [Reset PIN By SecurityAnswer And Email](#ResetPINByEmailAndSecurityAnswer-put-)
-* PUT : [Reset PIN By SecurityAnswer And Username](#ResetPINByUsernameAndSecurityAnswer-put-)
-* PUT : [Reset PIN By SecurityAnswer And Phone](#ResetPINByPhoneAndSecurityAnswer-put-)
-* PUT : [Change PIN By Token](#ChangePINByAccessToken-put-)
-* PUT : [Reset PIN by Phone and OTP](#ResetPINByPhoneAndOtp-put-)
-* PUT : [Reset PIN by Email and OTP](#ResetPINByEmailAndOtp-put-)
-* PUT : [Reset PIN by Username and OTP](#ResetPINByUsernameAndOtp-put-)
-* POST : [PIN Login](#PINLogin-post-)
-* POST : [Forgot PIN By Email](#SendForgotPINEmailByEmail-post-)
-* POST : [Forgot PIN By UserName](#SendForgotPINEmailByUsername-post-)
-* POST : [Forgot PIN By Phone](#SendForgotPINSMSByPhone-post-)
-* POST : [Set PIN By PinAuthToken](#SetPINByPinAuthToken-post-)
-* GET : [Invalidate PIN Session Token](#InValidatePinSessionToken-get-)
- - - - -
Reset PIN By ResetToken (PUT)
- - This API is used to reset pin using reset token. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-resettoken/) - -```java - -ResetPINByResetToken resetPINByResetToken = new ResetPINByResetToken(); //Required -resetPINByResetToken.setPIN("pin"); -resetPINByResetToken.setResetToken("resetToken"); - -PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi(); -pinAuthenticationApi.resetPINByResetToken( resetPINByResetToken , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Reset PIN By SecurityAnswer And Email (PUT)
- - This API is used to reset pin using security question answer and email. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-securityanswer-and-email/) - -```java - -ResetPINBySecurityQuestionAnswerAndEmailModel resetPINBySecurityQuestionAnswerAndEmailModel = new ResetPINBySecurityQuestionAnswerAndEmailModel(); //Required -resetPINBySecurityQuestionAnswerAndEmailModel.setEmail("email"); -resetPINBySecurityQuestionAnswerAndEmailModel.setPIN("pin"); -Map securityAnswer= new HashMap (); -securityAnswer.put("", "" ); -resetPINBySecurityQuestionAnswerAndEmailModel.setSecurityAnswer(securityAnswer); - -PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi(); -pinAuthenticationApi.resetPINByEmailAndSecurityAnswer( resetPINBySecurityQuestionAnswerAndEmailModel , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Reset PIN By SecurityAnswer And Username (PUT)
- - This API is used to reset pin using security question answer and username. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-securityanswer-and-username/) - -```java - -ResetPINBySecurityQuestionAnswerAndUsernameModel resetPINBySecurityQuestionAnswerAndUsernameModel = new ResetPINBySecurityQuestionAnswerAndUsernameModel(); //Required -resetPINBySecurityQuestionAnswerAndUsernameModel.setPIN("pin"); -Map securityAnswer= new HashMap (); -securityAnswer.put("", "" ); -resetPINBySecurityQuestionAnswerAndUsernameModel.setSecurityAnswer(securityAnswer); -resetPINBySecurityQuestionAnswerAndUsernameModel.setUsername("username"); - -PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi(); -pinAuthenticationApi.resetPINByUsernameAndSecurityAnswer( resetPINBySecurityQuestionAnswerAndUsernameModel , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Reset PIN By SecurityAnswer And Phone (PUT)
- - This API is used to reset pin using security question answer and phone. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-securityanswer-and-phone/) - -```java - -ResetPINBySecurityQuestionAnswerAndPhoneModel resetPINBySecurityQuestionAnswerAndPhoneModel = new ResetPINBySecurityQuestionAnswerAndPhoneModel(); //Required -resetPINBySecurityQuestionAnswerAndPhoneModel.setPhone("phone"); -resetPINBySecurityQuestionAnswerAndPhoneModel.setPIN("pin"); -Map securityAnswer= new HashMap (); -securityAnswer.put("", "" ); -resetPINBySecurityQuestionAnswerAndPhoneModel.setSecurityAnswer(securityAnswer); - -PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi(); -pinAuthenticationApi.resetPINByPhoneAndSecurityAnswer( resetPINBySecurityQuestionAnswerAndPhoneModel , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Change PIN By Token (PUT)
- - This API is used to change a user's PIN using access token. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/change-pin-by-access-token/) - -```java - -String accessToken = ""; //Required -ChangePINModel changePINModel = new ChangePINModel(); //Required -changePINModel.setNewPIN("newPIN"); -changePINModel.setOldPIN("oldPIN"); - -PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi(); -pinAuthenticationApi.changePINByAccessToken(accessToken, changePINModel , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Reset PIN by Phone and OTP (PUT)
- - This API is used to reset pin using phoneId and OTP. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-phone-and-otp/) - -```java - -ResetPINByPhoneAndOTPModel resetPINByPhoneAndOTPModel = new ResetPINByPhoneAndOTPModel(); //Required -resetPINByPhoneAndOTPModel.setOtp("otp"); -resetPINByPhoneAndOTPModel.setPhone("phone"); -resetPINByPhoneAndOTPModel.setPIN("pin"); - -PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi(); -pinAuthenticationApi.resetPINByPhoneAndOtp( resetPINByPhoneAndOTPModel , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Reset PIN by Email and OTP (PUT)
- - This API is used to reset pin using email and OTP. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-email-and-otp/) - -```java - -ResetPINByEmailAndOtpModel resetPINByEmailAndOtpModel = new ResetPINByEmailAndOtpModel(); //Required -resetPINByEmailAndOtpModel.setEmail("email"); -resetPINByEmailAndOtpModel.setOtp("otp"); -resetPINByEmailAndOtpModel.setPIN("pin"); - -PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi(); -pinAuthenticationApi.resetPINByEmailAndOtp( resetPINByEmailAndOtpModel , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Reset PIN by Username and OTP (PUT)
- - This API is used to reset pin using username and OTP. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/reset-pin-by-username-and-otp/) - -```java - -ResetPINByUsernameAndOtpModel resetPINByUsernameAndOtpModel = new ResetPINByUsernameAndOtpModel(); //Required -resetPINByUsernameAndOtpModel.setOtp("otp"); -resetPINByUsernameAndOtpModel.setPIN("pin"); -resetPINByUsernameAndOtpModel.setUsername("username"); - -PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi(); -pinAuthenticationApi.resetPINByUsernameAndOtp( resetPINByUsernameAndOtpModel , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
PIN Login (POST)
- - This API is used to login a user by pin and session token. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/login-by-pin/) - -```java - -LoginByPINModel loginByPINModel = new LoginByPINModel(); //Required -loginByPINModel.setPIN("pin"); -String sessionToken = ""; //Required - -PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi(); -pinAuthenticationApi.pinLogin( loginByPINModel, sessionToken , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessToken response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - -
Forgot PIN By Email (POST)
- - This API sends the reset pin email to specified email address. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/forgot-pin-by-email/) - -```java - -ForgotPINLinkByEmailModel forgotPINLinkByEmailModel = new ForgotPINLinkByEmailModel(); //Required -forgotPINLinkByEmailModel.setEmail("email"); -String emailTemplate = ""; //Optional -String resetPINUrl = ""; //Optional - -PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi(); -pinAuthenticationApi.sendForgotPINEmailByEmail( forgotPINLinkByEmailModel, emailTemplate, resetPINUrl , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Forgot PIN By UserName (POST)
- - This API sends the reset pin email using username. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/forgot-pin-by-username/) - -```java - -ForgotPINLinkByUserNameModel forgotPINLinkByUserNameModel = new ForgotPINLinkByUserNameModel(); //Required -forgotPINLinkByUserNameModel.setUserName("userName"); -String emailTemplate = ""; //Optional -String resetPINUrl = ""; //Optional - -PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi(); -pinAuthenticationApi.sendForgotPINEmailByUsername( forgotPINLinkByUserNameModel, emailTemplate, resetPINUrl , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Forgot PIN By Phone (POST)
- - This API sends the OTP to specified phone number [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/forgot-pin-by-phone/) - -```Java - -ForgotPINOtpByPhoneModel forgotPINOtpByPhoneModel = new ForgotPINOtpByPhoneModel(); //Required -forgotPINOtpByPhoneModel.setPhone("phone"); -String smsTemplate = ""; //Optional -Boolean isVoiceOtp = false; //Optional - -PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi(); -pinAuthenticationApi.sendForgotPINSMSByPhone( forgotPINOtpByPhoneModel, smsTemplate, isVoiceOtp , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(UserProfilePostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Set PIN By PinAuthToken (POST)
- - This API is used to change a user's PIN using Pin Auth token. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/set-pin-by-pinauthtoken/) - -```java - -PINRequiredModel pinRequiredModel = new PINRequiredModel(); //Required -pinRequiredModel.setPIN("pin"); -String pinAuthToken = ""; //Required - -PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi(); -pinAuthenticationApi.setPINByPinAuthToken( pinRequiredModel, pinAuthToken , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessToken response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - -
Invalidate PIN Session Token (GET)
- - This API is used to invalidate pin session token. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/pin-authentication/invalidate-pin-session-token/) - -```java - -String sessionToken = ""; //Required - -PINAuthenticationApi pinAuthenticationApi = new PINAuthenticationApi(); -pinAuthenticationApi.inValidatePinSessionToken(sessionToken , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - - - - -### ReAuthentication API - - -List of APIs in this Section:
- -* PUT : [Validate MFA by OTP](#MFAReAuthenticateByOTP-put-)
-* PUT : [Validate MFA by Backup Code](#MFAReAuthenticateByBackupCode-put-)
-* PUT : [Validate MFA by Password](#MFAReAuthenticateByPassword-put-)
-* PUT : [MFA Re-authentication by PIN](#VerifyPINAuthentication-put-)
-* PUT : [MFA Re-authentication by Email OTP](#ReAuthValidateEmailOtp-put-)
-* PUT : [MFA Step-Up Authentication by Authenticator Code](#MFAReAuthenticateByAuthenticatorCode-put-)
-* POST : [Verify Multifactor OTP Authentication](#VerifyMultiFactorOtpReauthentication-post-)
-* POST : [Verify Multifactor Password Authentication](#VerifyMultiFactorPasswordReauthentication-post-)
-* POST : [Verify Multifactor PIN Authentication](#VerifyMultiFactorPINReauthentication-post-)
-* POST : [MFA Re-authentication by Security Question](#ReAuthBySecurityQuestion-post-)
-* GET : [Multi Factor Re-Authenticate](#MFAReAuthenticate-get-)
-* GET : [Send MFA Re-auth Email OTP by Access Token](#ReAuthSendEmailOtp-get-)
- - - - -
Validate MFA by OTP (PUT)
- - This API is used to re-authenticate via Multi-factor authentication by passing the One Time Password received via SMS [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/re-authentication/mfa/re-auth-by-otp/) - -```java - -String accessToken = ""; //Required -ReauthByOtpModel reauthByOtpModel = new ReauthByOtpModel(); //Required -reauthByOtpModel.setOtp("otp"); - -ReAuthenticationApi reAuthenticationApi = new ReAuthenticationApi(); -reAuthenticationApi.mfaReAuthenticateByOTP(accessToken, reauthByOtpModel , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(EventBasedMultiFactorAuthenticationToken response) { - System.out.println(response.getExpireIn()); - } -}); - -``` - - - - - - -
Validate MFA by Backup Code (PUT)
- - This API is used to re-authenticate by set of backup codes via access token on the site that has Multi-factor authentication enabled in re-authentication for the user that does not have the device [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/re-authentication/mfa/re-auth-by-backup-code/) - -```java - -String accessToken = ""; //Required -ReauthByBackupCodeModel reauthByBackupCodeModel = new ReauthByBackupCodeModel(); //Required -reauthByBackupCodeModel.setBackupCode("backupCode"); - -ReAuthenticationApi reAuthenticationApi = new ReAuthenticationApi(); -reAuthenticationApi.mfaReAuthenticateByBackupCode(accessToken, reauthByBackupCodeModel , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(EventBasedMultiFactorAuthenticationToken response) { - System.out.println(response.getExpireIn()); - } -}); - -``` - - - - - - -
Validate MFA by Password (PUT)
- - This API is used to re-authenticate via Multi-factor-authentication by passing the password [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/re-auth-by-password) - -```java - -String accessToken = ""; //Required -PasswordEventBasedAuthModelWithLockout passwordEventBasedAuthModelWithLockout = new PasswordEventBasedAuthModelWithLockout(); //Required -passwordEventBasedAuthModelWithLockout.setPassword("password"); -String smsTemplate2FA = ""; //Optional - -ReAuthenticationApi reAuthenticationApi = new ReAuthenticationApi(); -reAuthenticationApi.mfaReAuthenticateByPassword(accessToken, passwordEventBasedAuthModelWithLockout, smsTemplate2FA , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(EventBasedMultiFactorAuthenticationToken response) { - System.out.println(response.getExpireIn()); - } -}); - -``` - - - - - - -
MFA Re-authentication by PIN (PUT)
- - This API is used to validate the triggered MFA authentication flow with a password. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/re-authentication/pin/re-auth-by-pin/) - -```java - -String accessToken = ""; //Required -PINAuthEventBasedAuthModelWithLockout pinAuthEventBasedAuthModelWithLockout = new PINAuthEventBasedAuthModelWithLockout(); //Required -pinAuthEventBasedAuthModelWithLockout.setPIN("pin"); -String smsTemplate2FA = ""; //Optional - -ReAuthenticationApi reAuthenticationApi = new ReAuthenticationApi(); -reAuthenticationApi.verifyPINAuthentication(accessToken, pinAuthEventBasedAuthModelWithLockout, smsTemplate2FA , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(EventBasedMultiFactorAuthenticationToken response) { - System.out.println(response.getExpireIn()); - } -}); - -``` - - - - - - -
MFA Re-authentication by Email OTP (PUT)
- - This API is used to validate the triggered MFA authentication flow with an Email OTP. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/mfa-re-auth-by-email-otp/) - -```java - - String accessToken = ""; //Required - ReauthByEmailOtpModel reauthByEmailOtpModel = new ReauthByEmailOtpModel(); //Required - reauthByEmailOtpModel.setEmailId(""); - reauthByEmailOtpModel.setOtp(""); - ReAuthenticationApi reAuthenticationApi = new ReAuthenticationApi(); - reAuthenticationApi.reAuthValidateEmailOtp(accessToken, reauthByEmailOtpModel , new AsyncHandler (){ - - @Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(EventBasedMultiFactorAuthenticationToken response) { - System.out.println(response.getExpireIn()); - } - }); - -``` - - - -
MFA Step-Up Authentication by Authenticator Code (PUT)
- - This API is used to validate the triggered MFA authentication flow with the Authenticator Code. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/re-authentication/mfa/re-auth-by-otp/) - -```Java - -String accessToken = ""; //Required -MultiFactorAuthModelByAuthenticatorCode multiFactorAuthModelByAuthenticatorCode = new MultiFactorAuthModelByAuthenticatorCode(); //Required -multiFactorAuthModelByAuthenticatorCode.setAuthenticatorCode("AuthenticatorCode"); - -ReAuthenticationApi reAuthenticationApi = new ReAuthenticationApi(); -reAuthenticationApi.mfaReAuthenticateByAuthenticatorCode(accessToken, multiFactorAuthModelByAuthenticatorCode , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(EventBasedMultiFactorAuthenticationToken response) { - System.out.println(response.getExpireIn()); - } -}); - -``` - - -
Verify Multifactor OTP Authentication (POST)
- - This API is used on the server-side to validate and verify the re-authentication token created by the MFA re-authentication API. This API checks re-authentications created by OTP. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/re-authentication/mfa/re-auth-validate-mfa/) - -```java - -EventBasedMultiFactorToken eventBasedMultiFactorToken = new EventBasedMultiFactorToken(); //Required -eventBasedMultiFactorToken.setSecondFactorValidationToken("secondFactorValidationToken"); -String uid = ""; //Required - -ReAuthenticationApi reAuthenticationApi = new ReAuthenticationApi(); -reAuthenticationApi.verifyMultiFactorOtpReauthentication( eventBasedMultiFactorToken, uid , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostValidationResponse response) { - System.out.println(response.getIsValid()); - } -}); - -``` - - - - - - -
Verify Multifactor Password Authentication (POST)
- - This API is used on the server-side to validate and verify the re-authentication token created by the MFA re-authentication API. This API checks re-authentications created by password. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/re-authentication/re-auth-validate-password/) - -```java - -EventBasedMultiFactorToken eventBasedMultiFactorToken = new EventBasedMultiFactorToken(); //Required -eventBasedMultiFactorToken.setSecondFactorValidationToken("secondFactorValidationToken"); -String uid = ""; //Required - -ReAuthenticationApi reAuthenticationApi = new ReAuthenticationApi(); -reAuthenticationApi.verifyMultiFactorPasswordReauthentication( eventBasedMultiFactorToken, uid , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostValidationResponse response) { - System.out.println(response.getIsValid()); - } -}); - -``` - - - - - - -
Verify Multifactor PIN Authentication (POST)
- - This API is used on the server-side to validate and verify the re-authentication token created by the MFA re-authentication API. This API checks re-authentications created by PIN. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/re-authentication/pin/re-auth-validate-pin/) - -```java - -EventBasedMultiFactorToken eventBasedMultiFactorToken = new EventBasedMultiFactorToken(); //Required -eventBasedMultiFactorToken.setSecondFactorValidationToken("secondFactorValidationToken"); -String uid = ""; //Required - -ReAuthenticationApi reAuthenticationApi = new ReAuthenticationApi(); -reAuthenticationApi.verifyMultiFactorPINReauthentication( eventBasedMultiFactorToken, uid , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostValidationResponse response) { - System.out.println(response.getIsValid()); - } -}); - -``` - - - - - - -
MFA Re-authentication by Security Question (POST)
- - This API is used to validate the triggered MFA re-authentication flow with security questions answers. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/mfa-re-authentication-by-security-question/) - -```java - -String accessToken = ""; //Required - SecurityQuestionAnswerUpdateModel securityQuestionAnswerUpdateModel = new SecurityQuestionAnswerUpdateModel(); //Required - List securityQuestions=new ArrayList(); - - SecurityQuestionModel securityQuestionModel=new SecurityQuestionModel(); - - securityQuestionModel.setQuestionId("db7****8a73e4******bd9****8c20"); - securityQuestionModel.setAnswer(""); - securityQuestions.add(securityQuestionModel); - - securityQuestionAnswerUpdateModel.setSecurityQuestionAnswer(securityQuestions); - ReAuthenticationApi reAuthenticationApi = new ReAuthenticationApi(); - reAuthenticationApi.reAuthBySecurityQuestion(accessToken, securityQuestionAnswerUpdateModel , new AsyncHandler (){ - - @Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(EventBasedMultiFactorAuthenticationToken response) { - System.out.println(response.getExpireIn()); - } - }); - -``` - - - - - - -
Multi Factor Re-Authenticate (GET)
- - This API is used to trigger the Multi-Factor Autentication workflow for the provided access token [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/re-auth-trigger/) - -```Java - -String accessToken = ""; //Required -String smsTemplate2FA = ""; //Optional -Boolean isVoiceOtp = false; //Optional - -ReAuthenticationApi reAuthenticationApi = new ReAuthenticationApi(); -reAuthenticationApi.mfaReAuthenticate(accessToken, smsTemplate2FA, isVoiceOtp , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(MultiFactorAuthenticationSettingsResponse response) { - System.out.println(response.getEmail()); - } -}); - -``` - - - - - - -
Send MFA Re-auth Email OTP by Access Token (GET)
- - This API is used to send the MFA Email OTP to the email for Re-authentication [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/multi-factor-authentication/re-authentication/send-mfa-re-auth-email-otp-by-access-token/) - -```java - -String accessToken = ""; //Required -String emailId = ""; //Required -String emailTemplate2FA = ""; //Optional - -ReAuthenticationApi reAuthenticationApi = new ReAuthenticationApi(); -reAuthenticationApi.reAuthSendEmailOtp(accessToken, emailId, emailTemplate2FA , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - -### ConsentManagement API - - -List of APIs in this Section:
- -* PUT : [Update Consent By Access Token](#UpdateConsentProfileByAccessToken-put-)
-* POST : [Consent By ConsentToken](#SubmitConsentByConsentToken-post-)
-* POST : [Post Consent By Access Token](#SubmitConsentByAccessToken-post-)
-* GET : [Get Consent Logs By Uid](#GetConsentLogsByUid-get-)
-* GET : [Get Consent Log by Access Token](#GetConsentLogs-get-)
-* GET : [Get Verify Consent By Access Token](#VerifyConsentByAccessToken-get-)
- - - - -
Update Consent By Access Token (PUT)
- - This API is to update consents using access token. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/consent-management/update-consent-by-access-token/) - -```java - -String accessToken = ""; //Required -ConsentUpdateModel consentUpdateModel = new ConsentUpdateModel(); //Required -List consents = new ArrayList < ConsentDataModel >(); -ConsentDataModel consentDataModel = new ConsentDataModel(); -consentDataModel.setConsentOptionId("consentOptionId"); -consentDataModel.setIsAccepted(true); -consents.add(consentDataModel); -consentUpdateModel.setConsents(consents); - -ConsentManagementApi consentManagementApi = new ConsentManagementApi(); -consentManagementApi.updateConsentProfileByAccessToken(accessToken, consentUpdateModel , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(ConsentProfile response) { - System.out.println(response.getAcceptedConsentVersions()); - } -}); - -``` - - - - - - -
Consent By ConsentToken (POST)
- - This API is to submit consent form using consent token. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/consent-management/consent-by-consent-token/) - -```java - -String consentToken = ""; //Required -ConsentSubmitModel consentSubmitModel = new ConsentSubmitModel(); //Required -List data = new ArrayList < ConsentDataModel >(); -ConsentDataModel consentDataModel = new ConsentDataModel(); -consentDataModel.setConsentOptionId("consentOptionId"); -consentDataModel.setIsAccepted(true); -data.add(consentDataModel); -consentSubmitModel.setData(data); -List events = new ArrayList < ConsentEventModel >(); -ConsentEventModel consentEventModel = new ConsentEventModel(); -consentEventModel.setEvent("event"); -consentEventModel.setIsCustom(true); -events.add(consentEventModel); -consentSubmitModel.setEvents(events); - -ConsentManagementApi consentManagementApi = new ConsentManagementApi(); -consentManagementApi.submitConsentByConsentToken(consentToken, consentSubmitModel , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessToken response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - -
Post Consent By Access Token (POST)
- - API to provide a way to end user to submit a consent form for particular event type. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/consent-management/consent-by-access-token/) - -```java - -String accessToken = ""; //Required -ConsentSubmitModel consentSubmitModel = new ConsentSubmitModel(); //Required -List data = new ArrayList < ConsentDataModel >(); -ConsentDataModel consentDataModel = new ConsentDataModel(); -consentDataModel.setConsentOptionId("consentOptionId"); -consentDataModel.setIsAccepted(true); -data.add(consentDataModel); -consentSubmitModel.setData(data); -List events = new ArrayList < ConsentEventModel >(); -ConsentEventModel consentEventModel = new ConsentEventModel(); -consentEventModel.setEvent("event"); -consentEventModel.setIsCustom(true); -events.add(consentEventModel); -consentSubmitModel.setEvents(events); - -ConsentManagementApi consentManagementApi = new ConsentManagementApi(); -consentManagementApi.submitConsentByAccessToken(accessToken, consentSubmitModel , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(Identity response) { - System.out.println(response.getUid()); - } -}); - -``` - - - - - - -
Get Consent Logs By Uid (GET)
- - This API is used to get the Consent logs of the user. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/consent-management/consent-log-by-uid/) - -```java - -String uid = ""; //Required - -ConsentManagementApi consentManagementApi = new ConsentManagementApi(); -consentManagementApi.getConsentLogsByUid(uid , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(ConsentLogsResponseModel response) { - System.out.println(response.getConsentLogs()); - } -}); - -``` - - - - - - -
Get Consent Log by Access Token (GET)
- - This API is used to fetch consent logs. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/consent-management/consent-log-by-access-token/) - -```java - -String accessToken = ""; //Required - -ConsentManagementApi consentManagementApi = new ConsentManagementApi(); -consentManagementApi.getConsentLogs(accessToken , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(ConsentLogsResponseModel response) { - System.out.println(response.getConsentLogs()); - } -}); - -``` - - - - - - -
Get Verify Consent By Access Token (GET)
- - This API is used to check if consent is submitted for a particular event or not. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/consent-management/verify-consent-by-access-token/) - -```java - -String accessToken = ""; //Required -String event = ""; //Required -Boolean isCustom = true; //Required - -ConsentManagementApi consentManagementApi = new ConsentManagementApi(); -consentManagementApi.verifyConsentByAccessToken(accessToken, event, isCustom , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(ConsentProfileValidResponse response) { - System.out.println(response.getConsentProfile()); - } -}); - -``` - - - - - - - - - -### SmartLogin API - - -List of APIs in this Section:
- -* GET : [Smart Login Verify Token](#SmartLoginTokenVerification-get-)
-* GET : [Smart Login By Email](#SmartLoginByEmail-get-)
-* GET : [Smart Login By Username](#SmartLoginByUserName-get-)
-* GET : [Smart Login Ping](#SmartLoginPing-get-)
- - - - -
Smart Login Verify Token (GET)
- - This API verifies the provided token for Smart Login [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/smart-login/smart-login-verify-token/) - -```java - -String verificationToken = ""; //Required -String welcomeEmailTemplate = ""; //Optional - -SmartLoginApi smartLoginApi = new SmartLoginApi(); -smartLoginApi.smartLoginTokenVerification(verificationToken, welcomeEmailTemplate , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(VerifiedResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Smart Login By Email (GET)
- - This API sends a Smart Login link to the user's Email Id. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/smart-login/smart-login-by-email) - -```java - -String clientGuid = ""; //Required -String email = ""; //Required -String redirectUrl = ""; //Optional -String smartLoginEmailTemplate = ""; //Optional -String welcomeEmailTemplate = ""; //Optional - -SmartLoginApi smartLoginApi = new SmartLoginApi(); -smartLoginApi.smartLoginByEmail(clientGuid, email, redirectUrl, smartLoginEmailTemplate, welcomeEmailTemplate , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Smart Login By Username (GET)
- - This API sends a Smart Login link to the user's Email Id. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/smart-login/smart-login-by-username) - -```java - -String clientGuid = ""; //Required -String username = ""; //Required -String redirectUrl = ""; //Optional -String smartLoginEmailTemplate = ""; //Optional -String welcomeEmailTemplate = ""; //Optional - -SmartLoginApi smartLoginApi = new SmartLoginApi(); -smartLoginApi.smartLoginByUserName(clientGuid, username, redirectUrl, smartLoginEmailTemplate, welcomeEmailTemplate , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Smart Login Ping (GET)
- - This API is used to check if the Smart Login link has been clicked or not [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/smart-login/smart-login-ping) - -```java - -String clientGuid = ""; //Required -String fields = null; //Optional - -SmartLoginApi smartLoginApi = new SmartLoginApi(); -smartLoginApi.smartLoginPing(clientGuid, fields , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessToken response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - - - - -### OneTouchLogin API - - -List of APIs in this Section:
- -* PUT : [One Touch OTP Verification](#OneTouchLoginOTPVerification-put-)
-* POST : [One Touch Login by Email](#OneTouchLoginByEmail-post-)
-* POST : [One Touch Login by Phone](#OneTouchLoginByPhone-post-)
-* GET : [One Touch Email Verification](#OneTouchEmailVerification-get-)
-* GET : [One Touch Login Ping](#OneTouchLoginPing-get-)
- - - - -
One Touch OTP Verification (PUT)
- - This API is used to verify the otp for One Touch Login. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/one-touch-login/one-touch-otp-verification/) - -```java - -String otp = ""; //Required -String phone = ""; //Required -String fields = null; //Optional -String smsTemplate = ""; //Optional - -OneTouchLoginApi oneTouchLoginApi = new OneTouchLoginApi(); -oneTouchLoginApi.oneTouchLoginOTPVerification(otp, phone, fields, smsTemplate , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessToken response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - -
One Touch Login by Email (POST)
- - This API is used to send a link to a specified email for a frictionless login/registration [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/one-touch-login/one-touch-login-by-email-captcha/) - -```java - -OneTouchLoginByEmailModel oneTouchLoginByEmailModel = new OneTouchLoginByEmailModel(); //Required -oneTouchLoginByEmailModel.setClientguid("clientguid"); -oneTouchLoginByEmailModel.setEmail("email"); -oneTouchLoginByEmailModel.setG_Recaptcha_Response("g-recaptcha-response"); -String oneTouchLoginEmailTemplate = ""; //Optional -String redirecturl = ""; //Optional -String welcomeemailtemplate = ""; //Optional - -OneTouchLoginApi oneTouchLoginApi = new OneTouchLoginApi(); -oneTouchLoginApi.oneTouchLoginByEmail( oneTouchLoginByEmailModel, oneTouchLoginEmailTemplate, redirecturl, welcomeemailtemplate , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - -
One Touch Login by Phone (POST)
- - This API is used to send one time password to a given phone number for a frictionless login/registration. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/one-touch-login/one-touch-login-by-phone-captcha/) - -```Java - -OneTouchLoginByPhoneModel oneTouchLoginByPhoneModel = new OneTouchLoginByPhoneModel(); //Required -oneTouchLoginByPhoneModel.setG_Recaptcha_Response("g-recaptcha-response"); -oneTouchLoginByPhoneModel.setPhone("phone"); -String smsTemplate = ""; //Optional -Boolean isVoiceOtp = false; //Optional - -OneTouchLoginApi oneTouchLoginApi = new OneTouchLoginApi(); -oneTouchLoginApi.oneTouchLoginByPhone( oneTouchLoginByPhoneModel, smsTemplate, isVoiceOtp , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - -
One Touch Email Verification (GET)
- - This API verifies the provided token for One Touch Login [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/one-touch-login/one-touch-email-verification) - -```java - -String verificationToken = ""; //Required -String welcomeEmailTemplate = ""; //Optional - -OneTouchLoginApi oneTouchLoginApi = new OneTouchLoginApi(); -oneTouchLoginApi.oneTouchEmailVerification(verificationToken, welcomeEmailTemplate , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(VerifiedResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
One Touch Login Ping (GET)
- - This API is used to check if the One Touch Login link has been clicked or not. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/one-touch-login/one-touch-login-ping/) - -```java - -String clientGuid = ""; //Required -String fields = null; //Optional - -OneTouchLoginApi oneTouchLoginApi = new OneTouchLoginApi(); -oneTouchLoginApi.oneTouchLoginPing(clientGuid, fields , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessToken response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - - - - -### PasswordLessLogin API - - -List of APIs in this Section:
- -* PUT : [Passwordless Login Phone Verification](#PasswordlessLoginPhoneVerification-put-)
-* POST : [Passwordless Login Verification By Email And OTP](#PasswordlessLoginVerificationByEmailAndOTP-post-)
-* POST : [Passwordless Login Verification By User Name And OTP](#PasswordlessLoginVerificationByUserNameAndOTP-post-)
-* GET : [Passwordless Login by Phone](#PasswordlessLoginByPhone-get-)
-* GET : [Passwordless Login By Email](#PasswordlessLoginByEmail-get-)
-* GET : [Passwordless Login By UserName](#PasswordlessLoginByUserName-get-)
-* GET : [Passwordless Login Verification](#PasswordlessLoginVerification-get-)
- - - - -
Passwordless Login Phone Verification (PUT)
- - This API verifies an account by OTP and allows the customer to login. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/passwordless-login/passwordless-login-phone-verification) - -```Java - -PasswordLessLoginOtpModel passwordLessLoginOtpModel = new PasswordLessLoginOtpModel(); //Required -passwordLessLoginOtpModel.setOtp("otp"); -passwordLessLoginOtpModel.setPhone("phone"); -String fields = null; //Optional -String smsTemplate = ""; //Optional -Boolean isVoiceOtp = false; //Optional - -PasswordLessLoginApi passwordLessLoginApi = new PasswordLessLoginApi(); -passwordLessLoginApi.passwordlessLoginPhoneVerification( passwordLessLoginOtpModel, fields, smsTemplate, isVoiceOtp , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessToken response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - -
Passwordless Login Verification By Email And OTP (POST)
- -This API is used to verify the otp sent to the email when doing a passwordless login. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/passwordless-login/passwordless-login-verify-by-email-and-otp/) - -```java - -PasswordLessLoginByEmailAndOtpModel passwordLessLoginByEmailAndOtpModel = new PasswordLessLoginByEmailAndOtpModel(); //Required -passwordLessLoginByEmailAndOtpModel.setEmail("email"); -passwordLessLoginByEmailAndOtpModel.setOtp("otp"); -passwordLessLoginByEmailAndOtpModel.setWelcomeEmailTemplate("welcomeEmailTemplate"); -String fields = null; //Optional - -PasswordLessLoginApi passwordLessLoginApi = new PasswordLessLoginApi(); -passwordLessLoginApi.passwordlessLoginVerificationByEmailAndOTP( passwordLessLoginByEmailAndOtpModel, fields , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessToken response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - -
Passwordless Login Verification By User Name And OTP (POST)
- -This API is used to verify the otp sent to the email when doing a passwordless login. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/passwordless-login/passwordless-login-verify-by-username-and-otp/) - -```java - -PasswordLessLoginByUserNameAndOtpModel passwordLessLoginByUserNameAndOtpModel = new PasswordLessLoginByUserNameAndOtpModel(); //Required -passwordLessLoginByUserNameAndOtpModel.setOtp("otp"); -passwordLessLoginByUserNameAndOtpModel.setUserName("userName"); -passwordLessLoginByUserNameAndOtpModel.setWelcomeEmailTemplate("welcomeEmailTemplate"); -String fields = null; //Optional - -PasswordLessLoginApi passwordLessLoginApi = new PasswordLessLoginApi(); -passwordLessLoginApi.passwordlessLoginVerificationByUserNameAndOTP( passwordLessLoginByUserNameAndOtpModel, fields , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessToken response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - -
Passwordless Login by Phone (GET)
- - API can be used to send a One-time Passcode (OTP) provided that the account has a verified PhoneID [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/passwordless-login/passwordless-login-by-phone) - -```Java - -String phone = ""; //Required -String smsTemplate = ""; //Optional -Boolean isVoiceOtp = false; //Optional - -PasswordLessLoginApi passwordLessLoginApi = new PasswordLessLoginApi(); -passwordLessLoginApi.passwordlessLoginByPhone(phone, smsTemplate, isVoiceOtp , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(GetResponse response) { - System.out.println(response.getData().getSid()); - } -}); - -``` - - - - - - -
Passwordless Login By Email (GET)
- - This API is used to send a Passwordless Login verification link to the provided Email ID [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/passwordless-login/passwordless-login-by-email) - -```java - -String email = ""; //Required -String passwordLessLoginTemplate = ""; //Optional -String verificationUrl = ""; //Optional - -PasswordLessLoginApi passwordLessLoginApi = new PasswordLessLoginApi(); -passwordLessLoginApi.passwordlessLoginByEmail(email, passwordLessLoginTemplate, verificationUrl , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Passwordless Login By UserName (GET)
- - This API is used to send a Passwordless Login Verification Link to a customer by providing their UserName [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/passwordless-login/passwordless-login-by-username) - -```java - -String username = ""; //Required -String passwordLessLoginTemplate = ""; //Optional -String verificationUrl = ""; //Optional - -PasswordLessLoginApi passwordLessLoginApi = new PasswordLessLoginApi(); -passwordLessLoginApi.passwordlessLoginByUserName(username, passwordLessLoginTemplate, verificationUrl , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(PostResponse response) { - System.out.println(response.getIsPosted()); - } -}); - -``` - - - - - - -
Passwordless Login Verification (GET)
- - This API is used to verify the Passwordless Login verification link. Note: If you are using Passwordless Login by Phone you will need to use the Passwordless Login Phone Verification API [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/passwordless-login/passwordless-login-verification) - -```java - -String verificationToken = ""; //Required -String fields = null; //Optional -String welcomeEmailTemplate = ""; //Optional - -PasswordLessLoginApi passwordLessLoginApi = new PasswordLessLoginApi(); -passwordLessLoginApi.passwordlessLoginVerification(verificationToken, fields, welcomeEmailTemplate , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessToken response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - - - - -### Configuration API - - -List of APIs in this Section:
- -* GET : [Get Server Time](#GetServerInfo-get-)
-* GET : [Get Configurations](#getConfigurations-get-)
- - - -
Get Server Time (GET)
- - This API allows you to query your LoginRadius account for basic server information and server time information which is useful when generating an SOTT token. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/configuration/get-server-time/) - -```java - -Integer timeDifference = 0; //Optional - -ConfigurationApi configurationApi = new ConfigurationApi(); -configurationApi.getServerInfo(timeDifference , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(ServiceInfoModel response) { - System.out.println(response.getCurrentTime()); - } -}); - -``` -
Get Configuration (GET)
- - This API is used to get the configurations which are set in the LoginRadius Admin Console for a particular LoginRadius site/environment. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/configuration/get-configurations) - - -```java - -ConfigurationApi configurationApi = new ConfigurationApi(); -configurationApi.getConfigurations(new AsyncHandler() { - -@Override -public void onFailure(ErrorResponse errorResponse) { -System.out.println(errorResponse.getDescription()); - -} - -@Override -public void onSuccess(ConfigResponseModel response) { -System.out.println(response.getAppName()); - -} - -}); -``` - - - - - - - -### Role API - - -List of APIs in this Section:
- -* PUT : [Assign Roles by UID](#AssignRolesByUid-put-)
-* PUT : [Upsert Context](#UpdateRoleContextByUid-put-)
-* PUT : [Add Permissions to Role](#AddRolePermissions-put-)
-* POST : [Roles Create](#CreateRoles-post-)
-* GET : [Roles by UID](#GetRolesByUid-get-)
-* GET : [Get Context with Roles and Permissions](#GetRoleContextByUid-get-)
-* GET : [Role Context profile](#GetRoleContextByContextName-get-)
-* GET : [Roles List](#GetRolesList-get-)
-* DELETE : [Unassign Roles by UID](#UnassignRolesByUid-delete-)
-* DELETE : [Delete Role Context](#DeleteRoleContextByUid-delete-)
-* DELETE : [Delete Role from Context](#DeleteRolesFromRoleContextByUid-delete-)
-* DELETE : [Delete Additional Permission from Context](#DeleteAdditionalPermissionFromRoleContextByUid-delete-)
-* DELETE : [Account Delete Role](#DeleteRole-delete-)
-* DELETE : [Remove Permissions](#RemoveRolePermissions-delete-)
- - - - -
Assign Roles by UID (PUT)
- - This API is used to assign your desired roles to a given user. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/assign-roles-by-uid/) - -```java - -AccountRolesModel accountRolesModel = new AccountRolesModel(); //Required -List roles = new ArrayList < String >(); -roles.add("roles"); -accountRolesModel.setRoles(roles); -String uid = ""; //Required - -RoleApi roleApi = new RoleApi(); -roleApi.assignRolesByUid( accountRolesModel, uid , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(com.loginradius.sdk.models.responsemodels.otherobjects.AccountRolesModel response) { - System.out.println(response.getRoles()); - } -}); - -``` - - - - - - -
Upsert Context (PUT)
- - This API creates a Context with a set of Roles [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/upsert-context) - -```java - -AccountRoleContextModel accountRoleContextModel = new AccountRoleContextModel(); //Required -List roleContext = new ArrayList < RoleContextRoleModel >(); -RoleContextRoleModel roleContextRoleModel = new RoleContextRoleModel(); -List additionalPermissions = new ArrayList < String > (); -additionalPermissions.add("additionalPermissions"); -roleContextRoleModel.setAdditionalPermissions(additionalPermissions); -roleContextRoleModel.setContext("context"); -roleContextRoleModel.setExpiration("expiration"); -List roles = new ArrayList < String > (); -roles.add("roles"); -roleContextRoleModel.setRoles(roles); -roleContext.add(roleContextRoleModel); -accountRoleContextModel.setRoleContext(roleContext); -String uid = ""; //Required - -RoleApi roleApi = new RoleApi(); -roleApi.updateRoleContextByUid( accountRoleContextModel, uid , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(ListReturn response) { - System.out.println(response.getData().get(0).getAdditionalPermissions()); - } -}); - -``` - - - - - - -
Add Permissions to Role (PUT)
- - This API is used to add permissions to a given role. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/add-permissions-to-role) - -```java - -PermissionsModel permissionsModel = new PermissionsModel(); //Required -List permissions = new ArrayList < String >(); -permissions.add("permissions"); -permissionsModel.setPermissions(permissions); -String role = ""; //Required - -RoleApi roleApi = new RoleApi(); -roleApi.addRolePermissions( permissionsModel, role , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(com.loginradius.sdk.models.responsemodels.otherobjects.RoleModel response) { - System.out.println(response.getName()); - } -}); - -``` - - - - - - -
Roles Create (POST)
- - This API creates a role with permissions. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/roles-create) - -```java - -RolesModel rolesModel = new RolesModel(); //Required -List roles = new ArrayList < com.loginradius.sdk.models.requestmodels.RoleModel >(); -RoleModel roleModel = new RoleModel(); -roleModel.setName("name"); -Map permissions= new HashMap (); -permissions.put( "Permission Name", true ); -roleModel.setPermissions(permissions); -roles.add(roleModel); -rolesModel.setRoles(roles); - -RoleApi roleApi = new RoleApi(); -roleApi.createRoles( rolesModel , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(ListData response) { - System.out.println(response.getCount()); - } -}); - -``` - - - - - - -
Roles by UID (GET)
- - API is used to retrieve all the assigned roles of a particular User. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/get-roles-by-uid) - -```java - -String uid = ""; //Required - -RoleApi roleApi = new RoleApi(); -roleApi.getRolesByUid(uid , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(com.loginradius.sdk.models.responsemodels.otherobjects.AccountRolesModel response) { - System.out.println(response.getRoles()); - } -}); - -``` - - - - - - -
Get Context with Roles and Permissions (GET)
- - This API Gets the contexts that have been configured and the associated roles and permissions. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/get-context) - -```java - -String uid = ""; //Required - -RoleApi roleApi = new RoleApi(); -roleApi.getRoleContextByUid(uid , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(ListReturn response) { - System.out.println(response.getData().get(0).getAdditionalPermissions()); - } -}); - -``` - - - - - - -
Role Context profile (GET)
- - The API is used to retrieve role context by the context name. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/role-context-profile/) - -```java - -String contextName = ""; //Required - -RoleApi roleApi = new RoleApi(); -roleApi.getRoleContextByContextName(contextName , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(ListReturn response) { - System.out.println(response.getData().get(0).getEmail().get(0).getValue()); - } -}); - -``` - - - - - - -
Roles List (GET)
- - This API retrieves the complete list of created roles with permissions of your app. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/roles-list) - -```java - - -RoleApi roleApi = new RoleApi(); -roleApi.getRolesList( new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(ListData response) { - System.out.println(response.getCount()); - } -}); - -``` - - - - - - -
Unassign Roles by UID (DELETE)
- - This API is used to unassign roles from a user. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/unassign-roles-by-uid) - -```java - -AccountRolesModel accountRolesModel = new AccountRolesModel(); //Required -List roles = new ArrayList < String >(); -roles.add("roles"); -accountRolesModel.setRoles(roles); -String uid = ""; //Required - -RoleApi roleApi = new RoleApi(); -roleApi.unassignRolesByUid( accountRolesModel, uid , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(DeleteResponse response) { - System.out.println(response.getIsDeleted()); - } -}); - -``` - - - - - - -
Delete Role Context (DELETE)
- - This API Deletes the specified Role Context [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/delete-context) - -```java - -String contextName = ""; //Required -String uid = ""; //Required - -RoleApi roleApi = new RoleApi(); -roleApi.deleteRoleContextByUid(contextName, uid , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(DeleteResponse response) { - System.out.println(response.getIsDeleted()); - } -}); - -``` - - - - - - -
Delete Role from Context (DELETE)
- - This API Deletes the specified Role from a Context. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/delete-role-from-context/) - -```java - -String contextName = ""; //Required -RoleContextRemoveRoleModel roleContextRemoveRoleModel = new RoleContextRemoveRoleModel(); //Required -List roles = new ArrayList < String >(); -roles.add("roles"); -roleContextRemoveRoleModel.setRoles(roles); -String uid = ""; //Required - -RoleApi roleApi = new RoleApi(); -roleApi.deleteRolesFromRoleContextByUid(contextName, roleContextRemoveRoleModel, uid , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(DeleteResponse response) { - System.out.println(response.getIsDeleted()); - } -}); - -``` - - - - - - -
Delete Additional Permission from Context (DELETE)
- - This API Deletes Additional Permissions from Context. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/delete-permissions-from-context) - -```java - -String contextName = ""; //Required -RoleContextAdditionalPermissionRemoveRoleModel roleContextAdditionalPermissionRemoveRoleModel = new RoleContextAdditionalPermissionRemoveRoleModel(); //Required -List additionalPermissions = new ArrayList < String >(); -additionalPermissions.add("additionalPermissions"); -roleContextAdditionalPermissionRemoveRoleModel.setAdditionalPermissions(additionalPermissions); -String uid = ""; //Required - -RoleApi roleApi = new RoleApi(); -roleApi.deleteAdditionalPermissionFromRoleContextByUid(contextName, roleContextAdditionalPermissionRemoveRoleModel, uid , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(DeleteResponse response) { - System.out.println(response.getIsDeleted()); - } -}); - -``` - - - - - - -
Account Delete Role (DELETE)
- - This API is used to delete the role. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/delete-role) - -```java - -String role = ""; //Required - -RoleApi roleApi = new RoleApi(); -roleApi.deleteRole(role , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(DeleteResponse response) { - System.out.println(response.getIsDeleted()); - } -}); - -``` - - - - - - -
Remove Permissions (DELETE)
- - API is used to remove permissions from a role. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/roles-management/remove-permissions) - -```java - -PermissionsModel permissionsModel = new PermissionsModel(); //Required -List permissions = new ArrayList < String >(); -permissions.add("permissions"); -permissionsModel.setPermissions(permissions); -String role = ""; //Required - -RoleApi roleApi = new RoleApi(); -roleApi.removeRolePermissions( permissionsModel, role , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(com.loginradius.sdk.models.responsemodels.otherobjects.RoleModel response) { - System.out.println(response.getName()); - } -}); - -``` - - -### RiskBasedAuthentication API - - -List of APIs in this Section:
- -* POST : [Risk Based Authentication Login by Email](#RBALoginByEmail-post-)
-* POST : [Risk Based Authentication Login by Username](#RBALoginByUserName-post-)
-* POST : [Risk Based Authentication Phone Login](#RBALoginByPhone-post-)
- - - - -
Risk Based Authentication Login by Email (POST)
- - This API retrieves a copy of the user data based on the Email [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-login-by-email) - -```java - -EmailAuthenticationModel emailAuthenticationModel = new EmailAuthenticationModel(); //Required -emailAuthenticationModel.setEmail("email"); -emailAuthenticationModel.setPassword("password"); -String emailTemplate = ""; //Optional -String fields = null; //Optional -String loginUrl = ""; //Optional -Boolean passwordDelegation = true; //Optional -String passwordDelegationApp = ""; //Optional -String rbaBrowserEmailTemplate = ""; //Optional -String rbaBrowserSmsTemplate = ""; //Optional -String rbaCityEmailTemplate = ""; //Optional -String rbaCitySmsTemplate = ""; //Optional -String rbaCountryEmailTemplate = ""; //Optional -String rbaCountrySmsTemplate = ""; //Optional -String rbaIpEmailTemplate = ""; //Optional -String rbaIpSmsTemplate = ""; //Optional -String rbaOneclickEmailTemplate = ""; //Optional -String rbaOTPSmsTemplate = ""; //Optional -String smsTemplate = ""; //Optional -String verificationUrl = ""; //Optional - -RiskBasedAuthenticationApi riskBasedAuthenticationApi = new RiskBasedAuthenticationApi(); -riskBasedAuthenticationApi.rbaLoginByEmail( emailAuthenticationModel, emailTemplate, fields, loginUrl, passwordDelegation, passwordDelegationApp, rbaBrowserEmailTemplate, rbaBrowserSmsTemplate, rbaCityEmailTemplate, rbaCitySmsTemplate, rbaCountryEmailTemplate, rbaCountrySmsTemplate, rbaIpEmailTemplate, rbaIpSmsTemplate, rbaOneclickEmailTemplate, rbaOTPSmsTemplate, smsTemplate, verificationUrl , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessToken response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - -
Risk Based Authentication Login by Username (POST)
- - This API retrieves a copy of the user data based on the Username [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/authentication/auth-login-by-username) - -```java - -UserNameAuthenticationModel userNameAuthenticationModel = new UserNameAuthenticationModel(); //Required -userNameAuthenticationModel.setPassword("password"); -userNameAuthenticationModel.setUsername("username"); -String emailTemplate = ""; //Optional -String fields = null; //Optional -String loginUrl = ""; //Optional -Boolean passwordDelegation = true; //Optional -String passwordDelegationApp = ""; //Optional -String rbaBrowserEmailTemplate = ""; //Optional -String rbaBrowserSmsTemplate = ""; //Optional -String rbaCityEmailTemplate = ""; //Optional -String rbaCitySmsTemplate = ""; //Optional -String rbaCountryEmailTemplate = ""; //Optional -String rbaCountrySmsTemplate = ""; //Optional -String rbaIpEmailTemplate = ""; //Optional -String rbaIpSmsTemplate = ""; //Optional -String rbaOneclickEmailTemplate = ""; //Optional -String rbaOTPSmsTemplate = ""; //Optional -String smsTemplate = ""; //Optional -String verificationUrl = ""; //Optional - -RiskBasedAuthenticationApi riskBasedAuthenticationApi = new RiskBasedAuthenticationApi(); -riskBasedAuthenticationApi.rbaLoginByUserName( userNameAuthenticationModel, emailTemplate, fields, loginUrl, passwordDelegation, passwordDelegationApp, rbaBrowserEmailTemplate, rbaBrowserSmsTemplate, rbaCityEmailTemplate, rbaCitySmsTemplate, rbaCountryEmailTemplate, rbaCountrySmsTemplate, rbaIpEmailTemplate, rbaIpSmsTemplate, rbaOneclickEmailTemplate, rbaOTPSmsTemplate, smsTemplate, verificationUrl , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessToken response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - -
Risk Based Authentication Phone Login (POST)
- - This API retrieves a copy of the user data based on the Phone [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/phone-authentication/phone-login) - -```java - -PhoneAuthenticationModel phoneAuthenticationModel = new PhoneAuthenticationModel(); //Required -phoneAuthenticationModel.setPassword("password"); -phoneAuthenticationModel.setPhone("phone"); -String emailTemplate = ""; //Optional -String fields = null; //Optional -String loginUrl = ""; //Optional -Boolean passwordDelegation = true; //Optional -String passwordDelegationApp = ""; //Optional -String rbaBrowserEmailTemplate = ""; //Optional -String rbaBrowserSmsTemplate = ""; //Optional -String rbaCityEmailTemplate = ""; //Optional -String rbaCitySmsTemplate = ""; //Optional -String rbaCountryEmailTemplate = ""; //Optional -String rbaCountrySmsTemplate = ""; //Optional -String rbaIpEmailTemplate = ""; //Optional -String rbaIpSmsTemplate = ""; //Optional -String rbaOneclickEmailTemplate = ""; //Optional -String rbaOTPSmsTemplate = ""; //Optional -String smsTemplate = ""; //Optional -String verificationUrl = ""; //Optional - -RiskBasedAuthenticationApi riskBasedAuthenticationApi = new RiskBasedAuthenticationApi(); -riskBasedAuthenticationApi.rbaLoginByPhone( phoneAuthenticationModel, emailTemplate, fields, loginUrl, passwordDelegation, passwordDelegationApp, rbaBrowserEmailTemplate, rbaBrowserSmsTemplate, rbaCityEmailTemplate, rbaCitySmsTemplate, rbaCountryEmailTemplate, rbaCountrySmsTemplate, rbaIpEmailTemplate, rbaIpSmsTemplate, rbaOneclickEmailTemplate, rbaOTPSmsTemplate, smsTemplate, verificationUrl , new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessToken response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - - - - -### Sott API - - -List of APIs in this Section:
- -* GET : [Generate SOTT](#GenerateSott-get-)
- - - - -
Generate SOTT (GET)
- - This API allows you to generate SOTT with a given expiration time. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/session/generate-sott-token) - -```java - -Integer timeDifference = 0; //Optional - -SottApi sottApi = new SottApi(); -sottApi.generateSott(timeDifference , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(SottResponseData response) { - System.out.println(response.getExpiryTime()); - } -}); - -``` - - - - - - - - - -### NativeSocial API - - -List of APIs in this Section:
- -* GET : [Access Token via Facebook Token](#GetAccessTokenByFacebookAccessToken-get-)
-* GET : [Access Token via Twitter Token](#GetAccessTokenByTwitterAccessToken-get-)
-* GET : [Access Token via Google Token](#GetAccessTokenByGoogleAccessToken-get-)
-* GET : [Access Token using google JWT token for Native Mobile Login](#GetAccessTokenByGoogleJWTAccessToken-get-)
-* GET : [Access Token via Linkedin Token](#GetAccessTokenByLinkedinAccessToken-get-)
-* GET : [Get Access Token By Foursquare Access Token](#GetAccessTokenByFoursquareAccessToken-get-)
-* GET : [Access Token via Apple Id Code](#GetAccessTokenByAppleIdCode-get-)
-* GET : [Access Token via WeChat Code](#GetAccessTokenByWeChatCode-get-)
-* GET : [Access Token via Google AuthCode](#GetAccessTokenByGoogleAuthCode-get-)
-* GET : [Get Access Token via Custom JWT Token](#AccessTokenViaCustomJWTToken-get-)
- - - - -
Access Token via Facebook Token (GET)
- - The API is used to get LoginRadius access token by sending Facebook's access token. It will be valid for the specific duration of time specified in the response. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-facebook-token/) - -```java - -String fbAccessToken = ""; //Required -String socialAppName = ""; //Optional - -NativeSocialApi nativeSocialApi = new NativeSocialApi(); -nativeSocialApi.getAccessTokenByFacebookAccessToken(fbAccessToken, socialAppName , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessTokenBase response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - -
Access Token via Twitter Token (GET)
- - The API is used to get LoginRadius access token by sending Twitter's access token. It will be valid for the specific duration of time specified in the response. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-twitter-token) - -```java - -String twAccessToken = ""; //Required -String twTokenSecret = ""; //Required -String socialAppName = ""; //Optional - -NativeSocialApi nativeSocialApi = new NativeSocialApi(); -nativeSocialApi.getAccessTokenByTwitterAccessToken(twAccessToken, twTokenSecret, socialAppName , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessTokenBase response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - -
Access Token via Google Token (GET)
- - The API is used to get LoginRadius access token by sending Google's access token. It will be valid for the specific duration of time specified in the response. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-google-token) - -```java - -String googleAccessToken = ""; //Required -String clientId = ""; //Optional -String refreshToken = ""; //Optional -String socialAppName = ""; //Optional - -NativeSocialApi nativeSocialApi = new NativeSocialApi(); -nativeSocialApi.getAccessTokenByGoogleAccessToken(googleAccessToken, clientId, refreshToken, socialAppName , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessTokenBase response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - -
Access Token using google JWT token for Native Mobile Login (GET)
- - This API is used to Get LoginRadius Access Token using google jwt id token for google native mobile login/registration. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-googlejwt) - -```java - -String idToken = ""; //Required - -NativeSocialApi nativeSocialApi = new NativeSocialApi(); -nativeSocialApi.getAccessTokenByGoogleJWTAccessToken(idToken , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessTokenBase response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - -
Access Token via Linkedin Token (GET)
- - The API is used to get LoginRadius access token by sending Linkedin's access token. It will be valid for the specific duration of time specified in the response. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-linkedin-token/) - -```java - -String lnAccessToken = ""; //Required -String socialAppName = ""; //Optional - -NativeSocialApi nativeSocialApi = new NativeSocialApi(); -nativeSocialApi.getAccessTokenByLinkedinAccessToken(lnAccessToken, socialAppName , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessTokenBase response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - -
Get Access Token By Foursquare Access Token (GET)
- - The API is used to get LoginRadius access token by sending Foursquare's access token. It will be valid for the specific duration of time specified in the response. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-foursquare-token/) - -```java - -String fsAccessToken = ""; //Required - -NativeSocialApi nativeSocialApi = new NativeSocialApi(); -nativeSocialApi.getAccessTokenByFoursquareAccessToken(fsAccessToken , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessTokenBase response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - -
Access Token via Apple Id Code (GET)
- - The API is used to get LoginRadius access token by sending a valid Apple ID OAuth Code. It will be valid for the specific duration of time specified in the response. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-apple-id-code) - -```java - -String code = ""; //Required -String socialAppName = ""; //Optional - -NativeSocialApi nativeSocialApi = new NativeSocialApi(); -nativeSocialApi.getAccessTokenByAppleIdCode(code, socialAppName , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessTokenBase response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - - -
Access Token via WeChat Code (GET)
- - This API is used to retrieve a LoginRadius access token by passing in a valid WeChat OAuth Code. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-wechat-code) - -```java - -String code = ""; //Required - -NativeSocialApi nativeSocialApi = new NativeSocialApi(); -nativeSocialApi.getAccessTokenByWeChatCode(code , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessTokenBase response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - -
Access Token via Google AuthCode (GET)
- - The API is used to get LoginRadius access token by sending Google's AuthCode. It will be valid for the specific duration of time specified in the response. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-via-google-auth-code) - -```java - -String googleAuthcode = ""; //Required -String socialAppName = ""; //Optional - -NativeSocialApi nativeSocialApi = new NativeSocialApi(); -nativeSocialApi.getAccessTokenByGoogleAuthCode(googleAuthcode, socialAppName , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessTokenBase response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - -
Get Access Token via Custom JWT Token (GET)
- - This API is used to retrieve a LoginRadius access token by passing in a valid custom JWT token. [More info](https://www.loginradius.com/docs/api/v2/customer-identity-api/social-login/native-social-login-api/access-token-by-custom-jwt-token/) - -```Java - -String idToken = ""; //Required -String providername = ""; //Required - -NativeSocialApi nativeSocialApi = new NativeSocialApi(); -nativeSocialApi.accessTokenViaCustomJWTToken(idToken, providername , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessTokenBase response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - - - - - -### WebHook API - - -List of APIs in this Section:
- -* POST : [Create Webhook Subscription](#CreateWebhookSubscription-post-)
-* GET : [Get Webhook Subscription Detail](#GetWebhookSubscriptionDetail-get-)
-* PUT : [Update Webhook Subscription](#UpdateWebhookSubscription-put-)
-* GET : [List All Webhooks](#ListAllWebhooks-get-)
-* GET : [Get Webhook Events](#GetWebhookEvents-get-)
-* DELETE : [Delete Webhook Subscription](#DeleteWebhookSubscription-delete-)
- - - - - -
Create Webhook Subscription (POST)
- - This API is used to create a new webhook subscription on your LoginRadius site. [More info](https://www.loginradius.com/docs/api/v2/integrations/webhooks/create-webhook-subscription/) - -```Java - -WebHookSubscribeModel webHookSubscribeModel = new WebHookSubscribeModel(); //Required -webHookSubscribeModel.setEvent("eventname"); -webHookSubscribeModel.setName("webhookname"); -webHookSubscribeModel.setTargetUrl("webhookurl"); -//Custom Headers -Map headers = new HashMap(); -headers.put("Content-Type", "application/json"); -webHookSubscribeModel.setHeaders(headers); - -//Query Param -Map queryParams = new HashMap(); -queryParams.put("paramname", "value"); -webHookSubscribeModel.setQueryParams(queryParams); - -//Setup Webhook Authentication -WebhookAuthCredentials webhookAuthCredentials=new WebhookAuthCredentials(); -webhookAuthCredentials.setUsername(""); -webhookAuthCredentials.setPassword(""); - -WebhookAuthenticationModel webhookAuthenticationModel=new WebhookAuthenticationModel(); -webhookAuthenticationModel.setAuthType("Basic"); -webhookAuthenticationModel.setBasicAuth(webhookAuthCredentials); - -webHookSubscribeModel.setAuthentication(webhookAuthenticationModel); - -WebHookApi webHookApi = new WebHookApi(); -webHookApi.createWebhookSubscription( webHookSubscribeModel , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(com.loginradius.sdk.models.responsemodels.otherobjects.WebHookSubscribeModel response) { - System.out.println(response.getId()); - } -}); - -``` - - -
Update Webhook Subscription (PUT)
- - This API is used to update a webhook subscription [More info](https://www.loginradius.com/docs/api/v2/integrations/webhooks/update-webhook-subscription/) - -```Java - -String hookId = ""; //Required -WebHookSubscriptionUpdateModel webHookSubscriptionUpdateModel = new WebHookSubscriptionUpdateModel(); //Required - -//Custom Headers -Map headers = new HashMap(); -headers.put("Content-Type", "application/json"); -webHookSubscriptionUpdateModel.setHeaders(headers); - -//Query Param -Map queryParams = new HashMap(); -queryParams.put("paramname", "value"); -webHookSubscriptionUpdateModel.setQueryParams(queryParams); - -//Setup Webhook Authentication - -WebhookAuthenticationModel webhookAuthenticationModel=new WebhookAuthenticationModel(); -webhookAuthenticationModel.setAuthType("Bearer"); -WebhookBearerToken webhookBearerToken=new WebhookBearerToken(); -webhookBearerToken.setToken("tokenValue"); -webhookAuthenticationModel.setBearerToken(webhookBearerToken); - -webHookSubscriptionUpdateModel.setAuthentication(webhookAuthenticationModel); - -WebHookApi webHookApi = new WebHookApi(); -webHookApi.updateWebhookSubscription(hookId, webHookSubscriptionUpdateModel , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(com.loginradius.sdk.models.responsemodels.otherobjects.WebHookSubscribeModel response) { - System.out.println(response.getId()); - } -}); - -``` - - - -
Get Webhook Subscription Detail (GET)
- - This API is used to get details of a webhook subscription by Id [More info](https://www.loginradius.com/docs/api/v2/integrations/webhooks/get-webhook-subscription-details/) - -```Java - -String hookId = ""; //Required - -WebHookApi webHookApi = new WebHookApi(); -webHookApi.getWebhookSubscriptionDetail(hookId , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(com.loginradius.sdk.models.responsemodels.otherobjects.WebHookSubscribeModel response) { - System.out.println(response.getId()); - } -}); - -``` - - - - - - -
List All Webhooks (GET)
- - This API is used to get the list of all the webhooks [More info](https://www.loginradius.com/docs/api/v2/integrations/webhooks/list-all-webhooks/) - -```Java - - -WebHookApi webHookApi = new WebHookApi(); -webHookApi.listAllWebhooks( new AsyncHandler> (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(ListReturn response) { - System.out.println(response.getData().get(0).getId()); - } -}); -``` - - - - - - -
Get Webhook Events (GET)
- - This API is used to retrieve all the webhook events. [More info](https://www.loginradius.com/docs/api/v2/integrations/webhooks/get-webhook-events/) - -```Java - - -WebHookApi webHookApi = new WebHookApi(); -webHookApi.getWebhookEvents( new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(WebHookEventModel response) { - System.out.println(response.getData()); - } -}); - -``` - - - - - - -
Delete Webhook Subscription (DELETE)
- - This API is used to delete webhook subscription [More info](https://www.loginradius.com/docs/api/v2/integrations/webhooks/delete-webhook-subscription/) - -```Java - -String hookId = ""; //Required - -WebHookApi webHookApi = new WebHookApi(); -webHookApi.deleteWebhookSubscription(hookId , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(DeleteResponse response) { - System.out.println(response.getIsDeleted()); - } -}); - -``` - - -### SSO JWT API - - -List of APIs in this Section:
- -* GET : [JWT token by Access Token](#JWTtokenbyAccessToken-post-)
-* POST : [JWT token by Email and Password](#JWTtokenbyEmailandPassword-post-)
-* POST : [JWT token by Username and Password](#JWTtokenbyUsernameandPassword-post-)
-* POST : [JWT token by Phone and Password](#JWTtokenbyPhoneandPassword-post-)
- - -
JWT token by Access Token (POST)
- -This API is used to get the JWT token by access token. [More info](https://www.loginradius.com/docs/api/v2/single-sign-on/federated-sso/jwt-login/jwt-token/) - -```java -SsoJwtApi ssoJwtApi=new SsoJwtApi() ; -String accessToken=""; -String jwtAppName=""; -ssoJwtApi.jwtTokenByAccessToken(accessToken, jwtAppName, new AsyncHandler() { -@Override -public void onSuccess(SsoJwtResponseData response) { -System.out.println(response.getSignature()); -} - -@Override -public void onFailure(ErrorResponse error) { -System.out.println(error.getDescription()); -} -} ); - - -``` - -
JWT token by Email and Password (POST)
- -This API is used to get a JWT token by Email and Password. [More info](https://www.loginradius.com/docs/api/v2/single-sign-on/federated-sso/jwt-login/jwt-token-by-email) - -```java - -SsoJwtApi ssoJwtApi=new SsoJwtApi() ; -SsoAuthenticationModel ssoAuthenticationModel=new SsoAuthenticationModel(); -ssoAuthenticationModel.setEmail(""); -ssoAuthenticationModel.setPassword(""); - -String emailTemplate = ""; //Optional -String loginUrl = ""; //Optional -String verificationUrl = ""; //Optional -String jwtAppName=""; - -ssoJwtApi.jwtTokenByEmail(ssoAuthenticationModel,jwtAppName, emailTemplate, loginUrl,verificationUrl, new AsyncHandler() { - -@Override -public void onSuccess(SsoJwtResponseData response) { -System.out.println(response.getSignature()); -} - -@Override -public void onFailure(ErrorResponse error) { -System.out.println(error.getDescription()); -} -} ); - -``` - -
JWT token by Username and Password (POST)
- - This API is used to get JWT token by Username and password [More info](https://www.loginradius.com/docs/api/v2/single-sign-on/federated-sso/jwt-login/jwt-token-by-username/) - -```java -SsoJwtApi ssoJwtApi=new SsoJwtApi() ; -SsoAuthenticationModel ssoAuthenticationModel=new SsoAuthenticationModel(); -ssoAuthenticationModel.setUserName(""); -ssoAuthenticationModel.setPassword(""); - -String emailTemplate = ""; //Optional -String loginUrl = ""; //Optional -String verificationUrl = ""; //Optional -String jwtAppName=""; - -ssoJwtApi.jwtTokenByUserName(ssoAuthenticationModel,jwtAppName, emailTemplate, loginUrl,verificationUrl, new AsyncHandler() { - -@Override -public void onSuccess(SsoJwtResponseData response) { -System.out.println(response.getSignature()); -} - -@Override -public void onFailure(ErrorResponse error) { -System.out.println(error.getDescription()); -} -} ); - - - - -``` - - -
JWT token by Phone and Password (POST)
- -This API is used to get JWT token by phone and password [More info](https://www.loginradius.com/docs/api/v2/single-sign-on/federated-sso/jwt-login/jwt-token-by-phone) - -```java -SsoJwtApi ssoJwtApi=new SsoJwtApi() ; -SsoAuthenticationModel ssoAuthenticationModel=new SsoAuthenticationModel(); -ssoAuthenticationModel.setPhone(""); -ssoAuthenticationModel.setPassword(""); - -String emailTemplate = ""; //Optional -String loginUrl = ""; //Optional -String verificationUrl = ""; //Optional -String jwtAppName=""; - -ssoJwtApi.jwtTokenByPhone(ssoAuthenticationModel,jwtAppName, emailTemplate, loginUrl,verificationUrl, new AsyncHandler() { - -@Override -public void onSuccess(SsoJwtResponseData response) { -System.out.println(response.getSignature()); -} - -@Override -public void onFailure(ErrorResponse error) { -System.out.println(error.getDescription()); -} -} ); - - - -``` - - - -
- -### Generate SOTT Manually - -SOTT is a secure one-time token that can be created using the API key, API secret, and a timestamp ( start time and end time ). You can manually create a SOTT using the following util function. - -```java -ServiceSottInfo serviceSottInfo=new ServiceSottInfo(); - -// You can pass the start and end time interval and the SOTT will be valid for this time duration. - -serviceSottInfo.setStartTime("2022-05-19 07:10:42"); // Valid Start Date with Date and time - -serviceSottInfo.setEndTime("2022-05-20 07:10:42"); // Valid End Date with Date and time - -//do not pass the time difference if you are passing startTime & endTime. -serviceSottInfo.setTimeDifference(""); // (Optional) The time difference will be used to set the expiration time of SOTT, If you do not pass time difference then the default expiration time of SOTT is 10 minutes. - -ServiceInfoModel service=new ServiceInfoModel(); -service.setSott(serviceSottInfo); - - -//The LoginRadius API key and primary API secret can be passed additionally, If the credentials will not be passed then this SOTT function will pick the API credentials from the SDK configuration. -String apiKey="";//(Optional) LoginRadius Api Key. -String apiSecret="";//(Optional) LoginRadius Api Secret (Only Primary Api Secret is used to generate the SOTT manually). - - -boolean getLrServerTime=false;//(Optional) If true it will call LoginRadius Get Server Time Api and fetch basic server information and server time information which is useful when generating an SOTT token. - - -try { - String sottResponse = Sott.getSott(service,apiKey,apiSecret,getLrServerTime); - System.out.println("sott = " + sottResponse); - -} catch (Exception e) { - e.printStackTrace(); - -} - -``` - -### SlidingToken API - - -List of APIs in this Section:
- -* GET : [Get Sliding Access Token](#SlidingAccessToken-get-)
- - -
(GET)
- -This API is used to get access token and refresh token with the expired/nonexpired access token. [More Info](https://www.loginradius.com/docs/api/v2/customer-identity-api/refresh-token/sliding-access-token) - -```Java - -String accessToken = ""; //Required - -SlidingTokenApi slidingTokenApi = new SlidingTokenApi(); -slidingTokenApi.slidingAccessToken(accessToken , new AsyncHandler (){ - -@Override - public void onFailure(ErrorResponse errorResponse) { - System.out.println(errorResponse.getDescription()); - } - @Override - public void onSuccess(AccessTokenBase response) { - System.out.println(response.getAccess_Token()); - } -}); - -``` - -### Demo -We have a demo web application using the Java SDK, which includes the following features: - -* Traditional email login -* Multi-Factor login -* Passwordless login -* Social login -* Register -* Email verification -* Forgot password -* Reset password -* Change password -* Set password -* Update account -* Account linking -* Custom object management -* Roles management - -You can get a copy of our demo project at [GitHub](https://github.com/LoginRadius/java-sdk). - -
- -#### Configuration - -Terminal/Command Line: - -1. Install Java 8 [here](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html). Ensure `java -version` and `javac -version` runs properly -2. Install Maven -3. Set your LoginRadius credentials on the client and server side: - * Client side: `src/main/resources/static/js/options.js` - * Server side (note: do not set credentials as strings i.e. with quotes): `src/main/resources/application.properties` -4. Navigate to the demo directory, and run: `mvn spring-boot:run` -5. Demo will appear on `http://localhost:8080` - -#### Steps to enable JWT login in the demo - - - JWT login can be enabled in the demo by setting ``app.jwtFlow`` to true under `src/main/resources/static/js/options.js`. - - Configure JWT App from [LoginRadius Admin console](https://adminconsole.loginradius.com/platform-configuration/access-configuration/federated-sso/jwt), to know more about how to configure JWT App you can refer [JWT Documentation](https://www.loginradius.com/docs/single-sign-on/tutorial/federated-sso/jwt-login/jwt-login-overview/#jwt-login-overview). - - Add JWT app name ``app.jwtAppName`` under `src/main/resources/static/js/options.js`. - - - -IDE: +Signature, `exp` and `nbf` are always checked; issuer and audience are checked +when supplied. HS256/384/512 take the shared secret; RS*/ES* take the +PEM-encoded **public** key. Throws `JwtValidationException`, whose `code()` is a +short stable reason. -1. Same steps as above, except run via the main file located in `src/main/java/com/demo/Application.java`. Right click -> Run +> **The algorithm is yours to state, and is never read from the token.** A +> validator that trusts the token's own `alg` header can be attacked: against an +> RS256 app, an attacker signs with HS256 using the public key as the HMAC +> secret. Passing the algorithm your app is configured for is what prevents it. -## Reference Manual +## License -Please find the reference manual [here](http://docs.lrcontent.com/apidocs/ref/java/index.html). +MIT diff --git a/demo/pom.xml b/demo/pom.xml deleted file mode 100644 index ab6dab5..0000000 --- a/demo/pom.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - 4.0.0 - - SpringBootSampleWebApp - 0.0.1-SNAPSHOT - jar - - SpringBootSampleWebApp - Demo project for Spring Boot With JSP View - - - org.springframework.boot - spring-boot-starter-parent - 2.6.3 - - - - - UTF-8 - UTF-8 - 16 - - - - - org.springframework.boot - spring-boot-starter-web - - - - org.springframework.boot - spring-boot-starter-thymeleaf - - - - javax.servlet - jstl - - - - com.google.code.gson - gson - 2.10 - - - commons-codec - commons-codec - 1.15 - - - com.loginradius.sdk - java-sdk - 11.7.0 - - - - - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - diff --git a/demo/src/main/java/com/demo/Application.java b/demo/src/main/java/com/demo/Application.java deleted file mode 100644 index c849a99..0000000 --- a/demo/src/main/java/com/demo/Application.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.demo; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * Created by LoginRadius Development Team on 09/23/2018 - */ -@SpringBootApplication -public class Application { - public static void main(String[] args) { - SpringApplication.run(Application.class, args); - } -} diff --git a/demo/src/main/java/com/demo/LoginController.java b/demo/src/main/java/com/demo/LoginController.java deleted file mode 100644 index ac4e093..0000000 --- a/demo/src/main/java/com/demo/LoginController.java +++ /dev/null @@ -1,125 +0,0 @@ -package com.demo; - -import javax.servlet.http.HttpServletRequest; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.ResponseBody; -/** - * Created by LoginRadius Development Team on 09/23/2018 - */ -@Controller -public class LoginController { - - @Autowired - LoginRadiusService service; - - @RequestMapping(value="/", method=RequestMethod.GET) - public String index(){ - return "redirect:/loginscreen"; - } - - @RequestMapping(value="/minimal", method=RequestMethod.GET) - public String minimal(){ - return "index"; - } - - @RequestMapping(value="/loginscreen", method=RequestMethod.GET) - public String loginScreen(){ - return "loginscreen"; - } - - @RequestMapping(value="/emailverification", method=RequestMethod.GET) - public String emailverification(){ - return "emailverification"; - } - - @RequestMapping(value="/resetpassword", method=RequestMethod.GET) - public String resetpassword(){ - return "resetpassword"; - } - - @RequestMapping(value="/login", method=RequestMethod.GET) - @ResponseBody - public String login(HttpServletRequest request){ - String result = service.login(request); - System.out.println("LoginController.login::" + result); - return result; - } - - @RequestMapping(value="/mfa", method=RequestMethod.POST) - @ResponseBody - public String mfaLogin(HttpServletRequest request){ - - String result = service.mfaLogin(request); - System.out.println("LoginController.mfaLogin::" + result); - return result; - } - - @RequestMapping(value="/mfa/verify", method=RequestMethod.PUT) - @ResponseBody - public String mfaVerify(HttpServletRequest request){ - - String result = service.mfaVerify(request); - System.out.println("LoginController.mfaVerify::" + result); - return result; - } - - @RequestMapping(value="/register", method=RequestMethod.POST) - @ResponseBody - public String register(HttpServletRequest request){ - String result = service.register(request); - System.out.println("LoginController.register::" + result); - return result; - - } - - @RequestMapping(value="/email/verify", method=RequestMethod.GET) - @ResponseBody - public String emailVerify(HttpServletRequest request){ - - String result = service.emailVerify(request); - System.out.println("LoginController.emailVerify::" + result); - return result; - } - - @RequestMapping(value="/passwordless", method=RequestMethod.GET) - @ResponseBody - public String passwordlessLogin(HttpServletRequest request){ - - String result = service.passwordlessLogin(request); - System.out.println("LoginController.passwordlessLogin::" + result); - return result; - } - - @RequestMapping(value="/passwordless/verify", method=RequestMethod.GET) - @ResponseBody - public String passwordlessVerify(HttpServletRequest request){ - - String result = service.passwordlessVerify(request); - System.out.println("LoginController.passwordlessVerify::" + result); - return result; - } - - @RequestMapping(value="/password/forgot", method=RequestMethod.POST) - @ResponseBody - public String forgotPassword(HttpServletRequest request){ - - String result = service.forgotPassword(request); - System.out.println("LoginController.forgotPassword::" + result); - return result; - - } - - @RequestMapping(value="/password/reset", method=RequestMethod.PUT) - @ResponseBody - public String resetPassword(HttpServletRequest request){ - - String result = service.resetPassword(request); - System.out.println("LoginController.resetPassword::" + result); - return result; - - } -} diff --git a/demo/src/main/java/com/demo/LoginRadiusService.java b/demo/src/main/java/com/demo/LoginRadiusService.java deleted file mode 100644 index aed4bd4..0000000 --- a/demo/src/main/java/com/demo/LoginRadiusService.java +++ /dev/null @@ -1,694 +0,0 @@ -package com.demo; - -import java.io.BufferedReader; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import javax.annotation.PostConstruct; -import javax.servlet.http.HttpServletRequest; - -import com.loginradius.sdk.models.requestmodels.*; -import org.apache.commons.codec.binary.Base64; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Service; - -import com.google.gson.Gson; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; -import com.loginradius.sdk.api.account.AccountApi; -import com.loginradius.sdk.api.account.RoleApi; -import com.loginradius.sdk.api.advanced.CustomObjectApi; -import com.loginradius.sdk.api.advanced.MultiFactorAuthenticationApi; -import com.loginradius.sdk.api.authentication.AuthenticationApi; -import com.loginradius.sdk.api.authentication.PasswordLessLoginApi; -import com.loginradius.sdk.api.cloud.SsoJwtApi; -import com.loginradius.sdk.models.enums.CustomObjectUpdateOperationType; -import com.loginradius.sdk.models.responsemodels.AccessToken; -import com.loginradius.sdk.models.responsemodels.AccessTokenBase; -import com.loginradius.sdk.models.responsemodels.ListData; -import com.loginradius.sdk.models.responsemodels.MultiFactorAuthenticationResponse; -import com.loginradius.sdk.models.responsemodels.SsoJwtResponseData; -import com.loginradius.sdk.models.responsemodels.UserCustomObjectData; -import com.loginradius.sdk.models.responsemodels.UserPasswordHash; -import com.loginradius.sdk.models.responsemodels.configobjects.EmailVerificationData; -import com.loginradius.sdk.models.responsemodels.otherobjects.AccountRolesModel; -import com.loginradius.sdk.models.responsemodels.otherobjects.DeleteResponse; -import com.loginradius.sdk.models.responsemodels.otherobjects.PostResponse; -import com.loginradius.sdk.models.responsemodels.otherobjects.RoleModel; -import com.loginradius.sdk.models.responsemodels.otherobjects.ServiceInfoModel; -import com.loginradius.sdk.models.responsemodels.otherobjects.ServiceSottInfo; -import com.loginradius.sdk.models.responsemodels.otherobjects.UserProfilePostResponse; -import com.loginradius.sdk.models.responsemodels.userprofile.Identity; -import com.loginradius.sdk.util.AsyncHandler; -import com.loginradius.sdk.util.ErrorResponse; -import com.loginradius.sdk.util.LoginRadiusSDK; -import com.loginradius.sdk.util.Sott; - -/** - * Created by LoginRadius Development Team on 09/23/2018 - */ -@Service -public class LoginRadiusService { - - @Value("${app.apikey}") - private String apikey; - @Value("${app.apisecret}") - private String apisecret; - @Value("${server.port}") - private String server_port; - @Value("${app.jwtFlow}") - private Boolean jwtFlow; - @Value("${app.jwtAppName}") - private String jwtAppName; - - Gson gson = new Gson(); - private LoginRadiusSDK.Initialize init = new LoginRadiusSDK.Initialize(); - - private String emailverification = ""; - private String resetpassword = ""; - private String resp = ""; - - @PostConstruct - public void init() { - init.setApiKey(apikey); - init.setApiSecret(apisecret); - emailverification = "http://localhost:" + server_port + "/emailverification"; - resetpassword = "http://localhost:" + server_port + "/resetpassword"; - } - - public String login(HttpServletRequest request) { - - - if(jwtFlow && jwtAppName!=null && !jwtAppName.isEmpty()) { - //JWT Flow - SsoJwtApi ssoJwtApi=new SsoJwtApi() ; - SsoAuthenticationModel ssoAuthenticationModel=new SsoAuthenticationModel(); - ssoAuthenticationModel.setEmail(request.getParameter("email")); - ssoAuthenticationModel.setPassword(request.getParameter("password")); - String emailTemplate = ""; //Optional - String loginUrl = ""; //Optional - String verificationUrl = ""; //Optional - - ssoJwtApi.jwtTokenByEmail(ssoAuthenticationModel,jwtAppName, emailTemplate, loginUrl,verificationUrl, new AsyncHandler() { - - @Override - public void onSuccess(SsoJwtResponseData response) { - resp=decodeJWTBody(response.getSignature()); - } - - @Override - public void onFailure(ErrorResponse error) { - resp = error.getDescription(); - } - } ); - - }else { - //Email login flow - AuthenticationApi auth = new AuthenticationApi(); - EmailAuthenticationModel payload = new EmailAuthenticationModel(); - payload.setEmail(request.getParameter("email")); - payload.setPassword(request.getParameter("password")); - - auth.loginByEmail(payload, null, null, null, null, new AsyncHandler>() { - - @Override - public void onSuccess(AccessToken profile) { - // TODO Auto-generated method stub - resp = gson.toJson(profile); - } - - @Override - public void onFailure(ErrorResponse error) { - // TODO Auto-generated method stub - resp = error.getDescription(); - } - - }); - - } - - return resp; - - } - - public String register(HttpServletRequest request) { - AuthenticationApi auth = new AuthenticationApi(); - AuthUserRegistrationModel userprofileModel = new AuthUserRegistrationModel(); - EmailModel email = new EmailModel(); - email.setType("Primary"); - email.setValue(request.getParameter("email")); - userprofileModel.setEmail(new ArrayList(Arrays.asList(email))); - userprofileModel.setPassword(request.getParameter("password")); - - auth.userRegistrationByEmail(userprofileModel, getSott(), null, null, null, emailverification, null, null,new AsyncHandler>>() { - - @Override - public void onSuccess(UserProfilePostResponse> profile) { - // TODO Auto-generated method stub - resp = profile.getIsPosted().toString(); - - } - - @Override - public void onFailure(ErrorResponse error) { - // TODO Auto-generated method stub - resp = error.getDescription(); - } - - }); - return resp; - } - - public String mfaLogin(HttpServletRequest request) { - MultiFactorAuthenticationApi mfa = new MultiFactorAuthenticationApi(); - mfa.mfaLoginByEmail(request.getParameter("email"), request.getParameter("password"), null, null, null, null, - null, null, null,null,null, new AsyncHandler>() { - - @Override - public void onSuccess(MultiFactorAuthenticationResponse arg0) { - // TODO Auto-generated method stub - resp = gson.toJson(arg0); - } - - @Override - public void onFailure(ErrorResponse error) { - // TODO Auto-generated method stub - resp = error.getDescription(); - } - - }); - return resp; - } - - public String mfaVerify(HttpServletRequest request) { - - MultiFactorAuthenticationApi mfa = new MultiFactorAuthenticationApi(); - MultiFactorAuthModelByAuthenticatorCode multiFactorAuthModelByAuthenticatorCode=new MultiFactorAuthModelByAuthenticatorCode(); - multiFactorAuthModelByAuthenticatorCode.setAuthenticatorCode(request.getParameter("code")); - mfa.mfaValidateAuthenticatorCode(multiFactorAuthModelByAuthenticatorCode, request.getParameter("token"), null, new AsyncHandler>() { - - @Override - public void onFailure(ErrorResponse arg0) { - // TODO Auto-generated method stub - - resp = arg0.getDescription(); - } - @Override - public void onSuccess(MultiFactorAuthenticationResponse arg0) { - // TODO Auto-generated method stub - resp = gson.toJson(arg0); - } - }); - - - - return resp; - - } - - public String emailVerify(HttpServletRequest request) { - AuthenticationApi auth = new AuthenticationApi(); - auth.verifyEmail(request.getParameter("token"), null, null,null, null, - new AsyncHandler>>() { - - @Override - public void onFailure(ErrorResponse arg0) { - // TODO Auto-generated method stub - resp = arg0.getDescription(); - } - - @Override - public void onSuccess(UserProfilePostResponse> arg0) { - // TODO Auto-generated method stub - resp = gson.toJson(arg0); - } - }); - - return resp; - - } - - public String passwordlessLogin(HttpServletRequest request) { - PasswordLessLoginApi passwordlessLogin = new PasswordLessLoginApi(); - passwordlessLogin.passwordlessLoginByEmail(request.getParameter("email"), null, emailverification, - new AsyncHandler() { - - @Override - public void onFailure(ErrorResponse arg0) { - // TODO Auto-generated method stub - resp = arg0.getDescription(); - } - - @Override - public void onSuccess(PostResponse arg0) { - // TODO Auto-generated method stub - resp = gson.toJson(arg0); - } - }); - return resp; - } - - public String passwordlessVerify(HttpServletRequest request) { - PasswordLessLoginApi passwordlessLogin = new PasswordLessLoginApi(); - passwordlessLogin.passwordlessLoginVerification(request.getParameter("token"), null, null, - new AsyncHandler>() { - - @Override - public void onFailure(ErrorResponse arg0) { - // TODO Auto-generated method stub - resp = arg0.getDescription(); - } - - @Override - public void onSuccess(AccessToken arg0) { - // TODO Auto-generated method stub - resp = gson.toJson(arg0); - } - }); - return resp; - } - - public String forgotPassword(HttpServletRequest request) { - AuthenticationApi auth = new AuthenticationApi(); - auth.forgotPassword(request.getParameter("email"), resetpassword, null, new AsyncHandler() { - - @Override - public void onFailure(ErrorResponse arg0) { - // TODO Auto-generated method stub - resp = arg0.getDescription(); - } - - @Override - public void onSuccess(PostResponse arg0) { - // TODO Auto-generated method stub - resp = gson.toJson(arg0); - } - }); - return resp; - } - - public String resetPassword(HttpServletRequest request) { - AuthenticationApi auth = new AuthenticationApi(); - ResetPasswordByResetTokenModel payload = new ResetPasswordByResetTokenModel(); - payload.setResetToken(request.getParameter("token")); - payload.setPassword(request.getParameter("password")); - auth.resetPasswordByResetToken(payload, new AsyncHandler>() { - - @Override - public void onFailure(ErrorResponse arg0) { - // TODO Auto-generated method stub - resp = arg0.getDescription(); - } - - @Override - public void onSuccess(UserProfilePostResponse arg0) { - // TODO Auto-generated method stub - resp = gson.toJson(arg0); - } - }); - return resp; - } - - public String getUserProfile(HttpServletRequest request) { - AuthenticationApi auth = new AuthenticationApi(); - auth.getProfileByAccessToken(request.getParameter("token"), null, null, null, null, new AsyncHandler() { - @Override - public void onSuccess(Identity arg0) { - // TODO Auto-generated method stub - resp = gson.toJson(arg0); - } - - @Override - public void onFailure(ErrorResponse error) { - // TODO Auto-generated method stub - resp = error.getDescription(); - } - - }); - return resp; - } - - public String changePassword(HttpServletRequest request) { - AuthenticationApi auth = new AuthenticationApi(); - auth.changePassword(request.getParameter("token"), request.getParameter("newpassword"), - request.getParameter("oldpassword"), new AsyncHandler() { - - @Override - public void onFailure(ErrorResponse arg0) { - // TODO Auto-generated method stub - resp = arg0.getDescription(); - } - - @Override - public void onSuccess(PostResponse arg0) { - // TODO Auto-generated method stub - resp = gson.toJson(arg0); - } - }); - return resp; - } - - public String setPassword(HttpServletRequest request) { - AccountApi api = new AccountApi(); - api.setAccountPasswordByUid(request.getParameter("password"), request.getParameter("uid"), - new AsyncHandler() { - - @Override - public void onFailure(ErrorResponse arg0) { - // TODO Auto-generated method stub - resp = arg0.getDescription(); - } - - @Override - public void onSuccess(UserPasswordHash arg0) { - // TODO Auto-generated method stub - resp = gson.toJson(arg0); - } - - }); - return resp; - } - - public String accountUpdate(HttpServletRequest request) { - AccountApi api = new AccountApi(); - AccountUserProfileUpdateModel userProfileUpdateModel = new AccountUserProfileUpdateModel(); - userProfileUpdateModel.setFirstName(request.getParameter("firstname")); - userProfileUpdateModel.setLastName(request.getParameter("lastname")); - userProfileUpdateModel.setAbout(request.getParameter("about")); - api.updateAccountByUid(userProfileUpdateModel, request.getParameter("uid"), null, new AsyncHandler() { - - @Override - public void onFailure(ErrorResponse arg0) { - // TODO Auto-generated method stub - resp = arg0.getDescription(); - } - - @Override - public void onSuccess(Identity arg0) { - // TODO Auto-generated method stub - resp = gson.toJson(arg0); - } - }); - return resp; - } - - public String createCustomObject(HttpServletRequest request) { - CustomObjectApi obj = new CustomObjectApi(); - JsonObject json = getRequestBody(request); - obj.createCustomObjectByUid(request.getParameter("objectname"), json, request.getParameter("uid"), - new AsyncHandler() { - - @Override - public void onFailure(ErrorResponse arg0) { - // TODO Auto-generated method stub - resp = arg0.getDescription(); - } - - @Override - public void onSuccess(UserCustomObjectData arg0) { - // TODO Auto-generated method stub - resp = gson.toJson(arg0); - } - }); - return resp; - } - - public String updateCustomObject(HttpServletRequest request) { - CustomObjectApi obj = new CustomObjectApi(); - JsonObject json = getRequestBody(request); - CustomObjectUpdateOperationType updateType = CustomObjectUpdateOperationType.PartialReplace; - obj.updateCustomObjectByUid(request.getParameter("objectname"), request.getParameter("objectrecordid"), json, - request.getParameter("uid"), updateType, new AsyncHandler() { - - @Override - public void onFailure(ErrorResponse arg0) { - // TODO Auto-generated method stub - - } - - @Override - public void onSuccess(UserCustomObjectData arg0) { - // TODO Auto-generated method stub - - } - - }); - - return resp; - } - - public String deleteCustomObject(HttpServletRequest request) { - CustomObjectApi obj = new CustomObjectApi(); - obj.deleteCustomObjectByRecordID(request.getParameter("objectname"), request.getParameter("objectrecordid"), - request.getParameter("uid"), new AsyncHandler() { - - @Override - public void onFailure(ErrorResponse arg0) { - // TODO Auto-generated method stub - resp = arg0.getDescription(); - } - - @Override - public void onSuccess(DeleteResponse arg0) { - // TODO Auto-generated method stub - resp = gson.toJson(arg0); - } - }); - return resp; - } - - public String getCustomObject(HttpServletRequest request) { - CustomObjectApi obj = new CustomObjectApi(); - obj.getCustomObjectByUid(request.getParameter("objectname"), request.getParameter("uid"), - new AsyncHandler>() { - - @Override - public void onFailure(ErrorResponse arg0) { - // TODO Auto-generated method stub - resp = arg0.getDescription(); - } - - @Override - public void onSuccess(ListData arg0) { - // TODO Auto-generated method stub - resp = gson.toJson(arg0); - } - }); - return resp; - } - - public String mfaReset(HttpServletRequest request) { - MultiFactorAuthenticationApi api = new MultiFactorAuthenticationApi(); - api.mfaResetAuthenticatorByUid(true, request.getParameter("uid"), new AsyncHandler() { - - @Override - public void onFailure(ErrorResponse arg0) { - // TODO Auto-generated method stub - resp = arg0.getDescription(); - } - - @Override - public void onSuccess(DeleteResponse arg0) { - // TODO Auto-generated method stub - resp = gson.toJson(arg0); - } - }); - - return resp; - - } - - public String getAllRoles(HttpServletRequest request) { - RoleApi api = new RoleApi(); - api.getRolesList(new AsyncHandler>() { - - @Override - public void onFailure(ErrorResponse arg0) { - // TODO Auto-generated method stub - resp = arg0.getDescription(); - } - - @Override - public void onSuccess(ListData arg0) { - // TODO Auto-generated method stub - resp = gson.toJson(arg0); - } - }); - return resp; - } - - public String getUserRoles(HttpServletRequest request) { - RoleApi api = new RoleApi(); - api.getRolesByUid(request.getParameter("uid"), new AsyncHandler() { - - @Override - public void onFailure(ErrorResponse arg0) { - // TODO Auto-generated method stub - resp = arg0.getDescription(); - } - - @Override - public void onSuccess(AccountRolesModel arg0) { - // TODO Auto-generated method stub - resp = gson.toJson(arg0); - } - }); - return resp; - } - - public String createRole(HttpServletRequest request) { - - RoleApi api = new RoleApi(); - RolesModel payload = new RolesModel(); - Map permissions = new HashMap(); - com.loginradius.sdk.models.requestmodels.RoleModel model = new com.loginradius.sdk.models.requestmodels.RoleModel(); - model.setName(request.getParameter("role")); - permissions.put("permission_name1", true); - permissions.put("permission_name2", true); - model.setPermissions(permissions); - payload.setRoles(new ArrayList(Arrays.asList(model))); - api.createRoles(payload, new AsyncHandler>() { - - @Override - public void onFailure(ErrorResponse arg0) { - // TODO Auto-generated method stub - resp = arg0.getDescription(); - } - - @Override - public void onSuccess(ListData arg0) { - // TODO Auto-generated method stub - resp = gson.toJson(arg0); - } - }); - - return resp; - } - - public String deleteRole(HttpServletRequest request) { - RoleApi api = new RoleApi(); - api.deleteRole(request.getParameter("role"), new AsyncHandler() { - - @Override - public void onFailure(ErrorResponse arg0) { - // TODO Auto-generated method stub - resp = arg0.getDescription(); - } - - @Override - public void onSuccess(DeleteResponse arg0) { - // TODO Auto-generated method stub - resp = gson.toJson(arg0); - } - }); - - return resp; - - } - - public String assignRole(HttpServletRequest request) { - RoleApi api = new RoleApi(); - com.loginradius.sdk.models.requestmodels.AccountRolesModel payload = new com.loginradius.sdk.models.requestmodels.AccountRolesModel(); - // Roles - List roles = new ArrayList(); - roles.add(request.getParameter("role")); - - payload.setRoles(roles); - api.assignRolesByUid(payload, request.getParameter("uid"), new AsyncHandler() { - - @Override - public void onFailure(ErrorResponse arg0) { - // TODO Auto-generated method stub - resp = arg0.getDescription(); - } - - @Override - public void onSuccess(AccountRolesModel arg0) { - // TODO Auto-generated method stub - resp = gson.toJson(arg0); - } - }); - return resp; - - } - - public String logout(HttpServletRequest request) { - AuthenticationApi auth = new AuthenticationApi(); - auth.authInValidateAccessToken(request.getParameter("token"), null, new AsyncHandler() { - - @Override - public void onFailure(ErrorResponse arg0) { - // TODO Auto-generated method stub - resp = arg0.getDescription(); - } - - @Override - public void onSuccess(PostResponse arg0) { - // TODO Auto-generated method stub - resp = gson.toJson(arg0); - } - }); - return resp; - } - - - private JsonObject getRequestBody(HttpServletRequest request) { - String line; - StringBuffer buffer = new StringBuffer(); - try { - BufferedReader reader = request.getReader(); - while ((line = reader.readLine()) != null) { - buffer.append(line); - } - String data = buffer.toString(); - return new JsonParser().parse(data).getAsJsonObject(); - } catch (Exception e) { - return null; - } - } - - - private String decodeJWTBody(String jwtToken) - - { - - String[] splitToken = jwtToken.split("\\."); - String encodedBody= splitToken[1]; - Base64 base64Url = new Base64(true); - String body = new String(base64Url.decode(encodedBody)); - return body; - } - - private String getSott() { - ServiceSottInfo serviceSottInfo=new ServiceSottInfo(); - - // You can pass the start and end time interval and the SOTT will be valid for this time duration. - - serviceSottInfo.setStartTime("2023-01-18 07:10:42"); // Valid Start Date with Date and time - - serviceSottInfo.setEndTime("2030-01-18 07:10:42"); // Valid End Date with Date and time - - //do not pass the time difference if you are passing startTime & endTime. - serviceSottInfo.setTimeDifference(""); // (Optional) The time difference will be used to set the expiration time of SOTT, If you do not pass time difference then the default expiration time of SOTT is 10 minutes. - - ServiceInfoModel service=new ServiceInfoModel(); - service.setSott(serviceSottInfo); - - - //The LoginRadius API key and primary API secret can be passed additionally, If the credentials will not be passed then this SOTT function will pick the API credentials from the SDK configuration. - String apiKey="";//(Optional) LoginRadius Api Key. - String apiSecret="";//(Optional) LoginRadius Api Secret (Only Primary Api Secret is used to generate the SOTT manually). - - - boolean getLrServerTime=false;//(Optional) If true it will call LoginRadius Get Server Time Api and fetch basic server information and server time information which is useful when generating an SOTT token. - - try { - return Sott.getSott(service,apiKey,apiSecret,getLrServerTime); - } catch (Exception e) { - return ""; - } - } -} diff --git a/demo/src/main/java/com/demo/UserController.java b/demo/src/main/java/com/demo/UserController.java deleted file mode 100644 index e84dc7f..0000000 --- a/demo/src/main/java/com/demo/UserController.java +++ /dev/null @@ -1,131 +0,0 @@ -package com.demo; - -import javax.servlet.http.HttpServletRequest; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.ResponseBody; - -/** - * Created by LoginRadius Development Team on 09/23/2018 - */ -@Controller -public class UserController { - - @Autowired - LoginRadiusService service; - - @RequestMapping(value="/profile", method={RequestMethod.GET,RequestMethod.POST}) - public String profile(HttpServletRequest request){ - return "profile"; - } - - @RequestMapping(value="/user", method=RequestMethod.GET) - @ResponseBody - public String getUserProfile(HttpServletRequest request){ - String result = service.getUserProfile(request); - System.out.println("UserController.getUserProfile::" + result); - return result; - - } - - @RequestMapping(value="/password/change", method=RequestMethod.PUT) - @ResponseBody - public String changePassword(HttpServletRequest request){ - - String result = service.changePassword(request); - System.out.println("UserController.changePassword::" + result); - return result; - } - - @RequestMapping(value="/password/set", method=RequestMethod.PUT) - @ResponseBody - public String setPassword(HttpServletRequest request){ - - String result = service.setPassword(request); - System.out.println("UserController.setPassword::" + result); - return result; - } - - @RequestMapping(value="/account", method=RequestMethod.PUT) - @ResponseBody - public String accountUpdate(HttpServletRequest request){ - - String result = service.accountUpdate(request); - System.out.println("UserController.accountUpdate::" + result); - return result; - } - - @RequestMapping(value="/customobject", method={RequestMethod.POST,RequestMethod.GET,RequestMethod.PUT,RequestMethod.DELETE}) - @ResponseBody - public String customObject(HttpServletRequest request){ - String result = null; - - if (request.getMethod().equals(RequestMethod.POST.toString())) { - result = service.createCustomObject(request); - } else if (request.getMethod().equals(RequestMethod.GET.toString())) { - result = service.getCustomObject(request); - } else if (request.getMethod().equals(RequestMethod.PUT.toString())) { - result = service.updateCustomObject(request); - } else if (request.getMethod().equals(RequestMethod.DELETE.toString())) { - result = service.deleteCustomObject(request); - } - System.out.println("UserController.customObject::" + result); - return result; - - } - - @RequestMapping(value="/mfa/reset", method=RequestMethod.DELETE) - @ResponseBody - public String mfaReset(HttpServletRequest request){ - - String result = service.mfaReset(request); - System.out.println("UserController.mfaReset::" + result); - return result; - - } - - @RequestMapping(value="/role", method={RequestMethod.POST,RequestMethod.GET,RequestMethod.DELETE}) - @ResponseBody - public String role(HttpServletRequest request){ - String result = null; - - if (request.getMethod().equals(RequestMethod.POST.toString())) { - result = service.createRole(request); - } else if (request.getMethod().equals(RequestMethod.GET.toString())) { - result = service.getAllRoles(request); - } else if (request.getMethod().equals(RequestMethod.DELETE.toString())) { - result = service.deleteRole(request); - } - System.out.println("UserController.role::" + result); - return result; - - } - - @RequestMapping(value="/role/user", method={RequestMethod.GET,RequestMethod.PUT}) - @ResponseBody - public String userRole(HttpServletRequest request){ - String result = null; - - if (request.getMethod().equals(RequestMethod.GET.toString())) { - result = service.getUserRoles(request); - } else if (request.getMethod().equals(RequestMethod.PUT.toString())) { - result = service.assignRole(request); - } - System.out.println("UserController.userRole::" + result); - return result; - - } - - @RequestMapping(value="/logout", method=RequestMethod.GET) - @ResponseBody - public String logout(HttpServletRequest request){ - - String result = service.logout(request); - System.out.println("UserController.logout::" + result); - return result; - - } -} \ No newline at end of file diff --git a/demo/src/main/resources/application.properties b/demo/src/main/resources/application.properties deleted file mode 100644 index 686b888..0000000 --- a/demo/src/main/resources/application.properties +++ /dev/null @@ -1,5 +0,0 @@ -server.port= 8080 -app.apikey= xxxxxxx-xxxxxxx -app.apisecret= xxxxxx-xxxxxxx -app.jwtFlow=false -app.jwtAppName=Jwt-App-Name \ No newline at end of file diff --git a/demo/src/main/resources/static/css/style.css b/demo/src/main/resources/static/css/style.css deleted file mode 100755 index 62e6b5d..0000000 --- a/demo/src/main/resources/static/css/style.css +++ /dev/null @@ -1,209 +0,0 @@ -body { - margin: 0; - background-color: #f9f9f9; - color: #384049; - font-family: "-apple-system", "system-ui", "Helvetica Neue", "Helvetica", "Arial", "sans-serif"; - font-size: 15px; -} - -table { - min-width: 200px; - margin-left: auto; - margin-right: auto; - font-size: 15px; -} - -td { - text-align: left; -} - -input { - width: 170px; - height: 22px; - margin: 2px; -} - -button { - background-color: #35A8FF; - color: white; - border: none; - text-align: center; - text-decoration: none; - padding: 3px 40px; - font-size: 14px; - border-radius: 2px; - margin-top: 5px; -} - -hr { - width: 55%; -} - -.table-style td, .table-style th { - border: 1px solid #dddddd; - text-align: left; - padding: 4px; -} - -.table-style tr:nth-child(even) { - background-color: #dddddd; -} - -.navbar-ul { - list-style-type: none; - margin: 0; - padding: 0; -} - -.section-menu { - position: fixed; - background-color: white; - width: 250px; - min-height: 100%; - border-right-style: solid; - border-right-width: 1px; - border-right-color: #EEEEEE; - text-align: center; - overflow: auto; -} - -.section-menu img { - width: 200px; - margin: 10px 10px 0px 10px; -} - -.button-group a { - float: left; - background-color: white; - color: #384049; - border-top: 1px solid #D3D3D3; - border-bottom: 1px solid #D3D3D3; - padding: 10px 24px; - margin-top: 5px; - cursor: pointer; - text-decoration: none; - width: 77px; - font-size: 13px; - white-space: nowrap; -} - -.button-group a:hover { - background-color: #D3D3D3; -} - -.section-main { - padding: 5vh; - width: 70vw; - min-width: 250px; - margin-left: 250px; - text-align: center; -} - -.right-elem { - display: none; -} - -.visible { - display: block; -} - -.container { - background-color: #eee; - width: 400px; - padding: 20px; - margin: auto; -} - -.customobj-container { - background-color: #eee; - width: 600px; - padding: 20px; - margin: auto; -} - -.vertical-menu { - margin-top: 44px; - width: 100%; - border: 0px solid lightgray; -} - -.vertical-menu a { - background-color: white; - color: #384049; - display: block; - padding: 12px; - text-decoration: none; -} - -.vertical-menu a:hover { - background-color: #ccc; -} - -.vertical-menu a.active { - background-color: #35A8FF; - color: white; - font-style: italic; -} - -.error-message { - color: red; -} - -.success-message { - color: green; -} - -#customobj-container { - background-color: #eee; - height: 650px; - width: 400px; - padding: 30px 20px 0 20px; -} - -#menu-logout:hover { - cursor: pointer; -} - -/*==============================================================*/ - -.lr-ls-icon { - display: inline-block; - width: 43px; - height: 40px; - background-image:url("/img/icon-sprite-32.png"); - border-radius: 5px; - /*default*/ - background-position: 0px 0px; - background-color: lightgray; -} - -.lr-ls-icon-Twitter { - background-position: 0px 9.6%; - background-color: #35A8FF; -} - -.lr-ls-icon-Facebook { - background-position: 0px 2.45%; - background-color: #3b5998; -} - -.lr-ls-icon-LinkedIn { - background-position: 0px 7.2%; - background-color: #007bb6; -} - -.lr-ls-icon-Google { - background-position: 0px 4.8%; - background-color: #dd4b39; -} - -.lr-ls-icon-Instagram { - background-position: 0px 28.65%; - background-color: #406e94; -} - -.lr-ls-icon-Vkontakte { - background-position: 0px 73.9%; - background-color: #5B88BD -} - diff --git a/demo/src/main/resources/static/img/icon-sprite-32.png b/demo/src/main/resources/static/img/icon-sprite-32.png deleted file mode 100644 index 8644f26..0000000 Binary files a/demo/src/main/resources/static/img/icon-sprite-32.png and /dev/null differ diff --git a/demo/src/main/resources/static/img/lr-logo.png b/demo/src/main/resources/static/img/lr-logo.png deleted file mode 100644 index 4361665..0000000 Binary files a/demo/src/main/resources/static/img/lr-logo.png and /dev/null differ diff --git a/demo/src/main/resources/static/img/user-blank.png b/demo/src/main/resources/static/img/user-blank.png deleted file mode 100644 index 29a89fa..0000000 Binary files a/demo/src/main/resources/static/img/user-blank.png and /dev/null differ diff --git a/demo/src/main/resources/static/js/LoginRadiusLoginScreen.1.0.0.min.js b/demo/src/main/resources/static/js/LoginRadiusLoginScreen.1.0.0.min.js deleted file mode 100644 index 25d54c1..0000000 --- a/demo/src/main/resources/static/js/LoginRadiusLoginScreen.1.0.0.min.js +++ /dev/null @@ -1,46 +0,0 @@ -(function(k){function l(e,a,b){b=b||!1;var c=document.getElementById(e);c.classList.add("lr-ls-loginscreencontainer");if(c)b||(c.innerHTML=""),c.appendChild(a);else if((c=document.getElementsByClassName(e))&&0 .lr-ls-loginscreencontainer * { margin: 0; padding: 0; box-sizing: border-box; vertical-align: middle; border-style: hidden; font-family:'+(a.body&&a.body.fontFamily?'"'+a.body.fontFamily+'",':" ")+' "-apple-system", "system-ui", "Helvetica Neue", "Helvetica", "Arial", "sans-serif";}@media only screen and (max-device-width: 959px) { .lr-ls-page { position: relative; width: 100%; height: 100vh; background-color: #FFFFFF; box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.12); } .lr-ls-logobase { height: 22vw; background-color:'+ -(a.logo&&a.logo.color?a.logo.color:" #F5F5F5")+"; } #lr-ls-logo-place { display: block; margin-left: auto; margin-right: auto; width: 50%; padding-top: 5vw; } .lr-ls-tabs { display: block; position: relative; } .lr-ls-tabs .tab { width: 50%; float: left; display: flex; flex-direction: row;"+(a.body&&a.body.backgroundColor?"background-color:"+a.body.backgroundColor+";":"background-color: #FFFFFF;")+' } .lr-ls-tabs .tab>input[type="radio"] { position: absolute; top: -9999px; left: -9999px; } .lr-ls-tabs .tab>label { width: 50vw; flex: 1 1 auto; display: block; cursor: pointer; position: relative; color: #384049; font-size: 4.28vw; line-height: 6.13333rem; text-align: center; vertical-align: middle; border-bottom: 0.5rem solid #EEEEEE; } .lr-ls-tabs .content { z-index: 0; /* or display: none; */ overflow: hidden; width: 100%; position: absolute; top: 6.5rem; /* this field determines the height of the line below the label*/ left: 0; background-color: #FFFFFF; display: none; -webkit-transition: all linear 0.3s; -moz-transition: all linear 0.3s; -o-transition: all linear 0.3s; -ms-transition: all linear 0.3s; transition: all linear 0.3s; -webkit-transform: translateX(-250px); -moz-transform: translateX(-250px); -o-transform: translateX(-250px); -ms-transform: translateX(-250px); transform: translateX(-250px); } .Resetpw-content { display: none;'+ -(a.singlepagestyle?"":"left:360px")+' } .lr-ls-tabs>.tab>[id^="tab"]:checked+label { top: 0; border-bottom: 0.5rem solid #BDBDBD; -webkit-animation: page 0.2s linear; -moz-animation: page 0.2s linear; -ms-animation: page 0.2s linear; -o-animation: page 0.2s linear; animation: page 0.2s linear; } .lr-ls-tabs>.tab>[id^="tab"]:checked~[id^="tab-content"] {'+(a.body&&a.body.backgroundColor?"background-color:"+a.body.backgroundColor+";":"")+ -" z-index: 1; /* or display: block; */ display: block; -webkit-transform: translateX(0px); -moz-transform: translateX(0px); -o-transform: translateX(0px); -ms-transform: translateX(0px); transform: translateX(0px); -webkit-transition: all ease-out 0.8s 0.1s; -moz-transition: all ease-out 0.8s 0.1s; -o-transition: all ease-out 0.8s 0.1s; -ms-transition: all ease-out 0.8s 0.1s; transition: all ease-out 0.8s 0.1s; overflow: hidden; } .greeting { margin-top: 4vh; width: 91vw; font-size: 5vw; margin-bottom: 3rem; line-height: 4rem; color: #424242; } #lr-ls-sectiondivider { margin-top: 3.2rem; display: block; margin-left: auto; margin-right: auto; height: 1.5rem; text-align: center; color: #424242; font-size: 5vw; line-height: 5rem; }"+ -(a.socialsquarestyle?" .social-login-b-options { margin-top: 6vh; width: 91vw; text-align: center; font-size: 5vw; font-weight: 400; -webkit-animation: slide-up 1s ease-out; -moz-animation: slide-up 1s ease-out; } .social-login-b-options .lr-sl-shaded-brick-button { height: 8rem; width: 8rem; border-radius: 0.5rem; overflow: hidden; margin-top: 2.5vw; position: relative; border: 1px solid rgba(0, 0, 0, 0.1); text-align: left; text-decoration: none; color: white; box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.12), 0 1px 1px 0 rgba(0, 0, 0, 0.24), 0 0 8px 0 rgba(0, 0, 0, 0.12), 0 2px 2px 0 rgba(0, 0, 0, 0.24); } .social-login-b-options .lr-sl-shaded-brick-button .lr-sl-icon { top: 0; left: 0; display: inline-block; position: absolute; } .lr-provider-label { margin-top: 8px; display: inline-block; }": -" .social-login-b-options { margin-top: 6vh; width: 91vw; text-align: center; font-size: 5vw; font-weight: 400; -webkit-animation: slide-up 1s ease-out; -moz-animation: slide-up 1s ease-out; } .social-login-b-options .lr-sl-shaded-brick-button { height: 8rem; width: 100%; border-radius: 0.5rem; overflow: hidden; margin-top: 2.5vw; position: relative; border: 1px solid rgba(0, 0, 0, 0.1); text-align: left; text-decoration: none; color: white; padding: 2rem 0 0.8rem 8rem; box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.12), 0 1px 1px 0 rgba(0, 0, 0, 0.24), 0 0 8px 0 rgba(0, 0, 0, 0.12), 0 2px 2px 0 rgba(0, 0, 0, 0.24); } .social-login-b-options .lr-sl-shaded-brick-button .lr-sl-icon { top: 0; left: 0; display: inline-block; position: absolute; } .lr-provider-label { display: block; }")+ -' .lr-sl-icon:before { width: 8rem; height: 8rem; background: url("http://cdn.loginradius.com/hub/prod/v1/hosted-page-default-images/icon-sprite-32.png"); background-image: linear-gradient(transparent, transparent), url("http://cdn.loginradius.com/hub/prod/v1/hosted-page-default-images/icon-sprite.svg"), none; background-size: 100% 3600%; background-position: 0 0; margin-top: -4px; margin-top: -0.4rem; } .lr-ls-status-area { margin-left: auto; margin-right: auto; width: 100vw; display: none; z-index: 2; } .lr-iconsuccess { font-family: arial; -ms-transform: scaleX(-1) rotate(-35deg); /* IE 9 */ -webkit-transform: scaleX(-1) rotate(-35deg); /* Chrome, Safari, Opera */ transform: scaleX(-1) rotate(-35deg); float: left; margin-right: 6px; } .lr-iconerror { text-align: center; font-family: sans-serif; float: left; margin-right: 6px; } .lr-ls-divsuccess { display: none; padding: 0.8rem; border: 1px solid #3EA34D; color: #FFFFFF; font-size: 4vw; line-height: 3rem; font-weight: 600; vertical-align: middle; } .lr-ls-diverror { display: none; padding: 0.8rem; border: 1px solid #FF1744; color: #FFFFFF; font-size: 4vw; line-height: 3rem; font-weight: 600; vertical-align: middle; } ::-webkit-input-placeholder { font-size: 4vw; line-height: 100%; } .loginradius--form-element-content { text-align: left; margin-bottom: 4rem; margin-bottom: 6.5vw; } #login-container .loginradius--form-element-content, #registration-container .loginradius--form-element-content, #forgotpassword-container .loginradius--form-element-content, #resetpassword-container .loginradius--form-element-content { padding-left: 3rem; } .loginradius--form-element-content label { color:'+ -(a.body&&a.body.textColor?a.body.textColor:"#616161")+'; font-size: 5vw; line-height: 4rem; } #login-container, #registration-container, #forgotpassword-container { margin-top: 5rem; width: 91vw; z-index: 0; } #forgotpassword-container { margin-top: 16px; } input .invalid { border: 1px solid #FF1744; background-color: #F5F5F5; } select { height: 5rem; background-color: #F5F5F6; font-size: 5vw; font-weight: 300; padding: 8px; margin-left: 20px; } textarea, input[type="password"], input[type="text"] { margin-top: 4px; height: 5rem; width: 91vw; background-color:'+ -(a.input&&a.input.background?a.input.background:" #F5F5F5")+'; border-style: hidden; font-size: 5vw; font-weight: 300; line-height: 10rem; padding: 8px; -webkit-box-sizing: border-box; box-sizing: border-box; } input[type="submit"] { margin-top: 2.5rem; margin-top: 4.2vw; color: #FFFFFF; font-size: 5vw; text-align: center; letter-spacing: 0.2rem; cursor: pointer; } .content-loginradius-stayLogin { margin-top: 2rem; display: flex; } input[type="checkbox"] { height: 3rem; width: 3rem; border: 1px solid #9E9E9E; vertical-align: middle; } .content-loginradius-stayLogin label { height: 3rem; color:'+ -(a.body&&a.body.textColor?a.body.textColor:"#616161")+"; font-size: 4.5vw; line-height: 3rem; } #lr-forgotpw-btn { color:"+(a.body&&a.body.textColor?a.body.textColor:"#616161")+'; cursor: pointer; font-size: 4.5vw; line-height: 3rem; height: 3rem; right: 4.5vw; bottom: 26.5vw; float: right; } #loginradius-submit-login { margin-right: auto; height: 16vw; width: 91vw; background-color: #35a8ff; box-shadow: 0 2px 5px 0 rgba(0, 0, 0, .16), 0 2px 10px 0 rgba(0, 0, 0, .12); outline: none; border-radius: 1rem 1rem 1rem 1rem; } [id *= "loginradius-submit-"] { margin-left: 3rem; margin-right: auto; height: 16vw; width: 91vw; background-color: #35a8ff; box-shadow: 0 2px 5px 0 rgba(0, 0, 0, .16), 0 2px 10px 0 rgba(0, 0, 0, .12); outline: none; border-radius: 1rem 1rem 1rem 1rem; } [id *= "loginradius-submit-"]:hover, #loginradius-submit-reset-password:hover { filter: brightness(98%); transition: color 400ms; } [id *= "loginradius-submit-"]:active { filter: brightness(85%); transition: color 400ms; } #forgotPW { height: 17px; color: #424242; font-size: 4vw; line-height: 17px; text-align: center; text-decoration: none; position: absolute; } #reset-password { height: 5rem; color: #414141; font-size: 6vw; font-weight: 300; line-height: 37px; } .loginradius-validation-message { color: #FF1744; font-size: 3.28vw; line-height: 2rem; margin-top: 1rem; } @-webkit-keyframes slide-up { 0% { opacity: 0; -webkit-transform: translateY(-100%); } 100% { opacity: 1; -webkit-transform: translateY(0); } } @-moz-keyframes slide-up { 0% { opacity: 0; -moz-transform: translateY(-100%); } 100% { opacity: 1; -moz-transform: translateY(0); } } .lr-ls-pageloader { display: none; z-index: 999; width: 100%; height: 100%; position: fixed; top: 0; right: 0; bottom: 0; left: 0; background-color: rgba(0, 0, 0, .5); } .lr-ls-page-loadwheel { width: 15vw; height: 15vw; margin-top: -7.5vw; margin-left: -7.5vw; position: absolute; top: 50%; left: 50%; border-width: 30px; border-radius: 50%; border: 10px solid #f3f3f3; border-radius: 50%; border-top: 10px solid #3498db; -webkit-animation: spin 2s linear infinite; /* Safari */ animation: spin 2s linear infinite; } @-webkit-keyframes spin { 0% { -webkit-transform: rotate(0deg); } 100% { -webkit-transform: rotate(360deg); } } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }}@media only screen and (min-device-width: 960px) { .lr-ls-page { position: relative; width:'+ -(a.singlepagestyle?"360px;":"720px;")+" border-radius: 6px 6px 0 0; background-color: #FFFFFF; box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.2), 0 1px 1px 0 rgba(0, 0, 0, 0.12); margin: 5% auto; } .lr-ls-logobase {"+(a.singlepagestyle?" height: 90px;":" float: left;")+" width: 360px;"+(a.singlepagestyle?" border-radius: 6px 6px 0 0;":" border-radius: 6px 0 0 6px;")+" background-color:"+(a.logo&&a.logo.color?a.logo.color:" #F5F5F5")+ -"; } #lr-ls-logo-place { display: block; margin-left: auto; margin-right: auto; width: 50%; padding-top: 23.67px; } .lr-ls-tabs { display: block; position: relative; background-color: #FFFFFF; } .lr-ls-tabs .tab { float: left; display: flex; flex-direction: row;"+(a.body&&a.body.backgroundColor?"background-color:"+a.body.backgroundColor+";":"background-color: #FFFFFF;")+' } .lr-ls-tabs .tab>input[type="radio"] { position: absolute; top: -9999px; left: -9999px; } .lr-ls-tabs .tab>label { width: 180px; flex: 1 1 auto; display: block; cursor: pointer; position: relative; color: #384049; font-size: 15px; line-height: 38px; text-align: center; vertical-align: middle; border-bottom: 4px solid #EEEEEE; } .lr-ls-tabs .content { margin-top: 14px; /* this field determines the height of the line below the label*/ z-index: 0; /* or display: none; */ overflow: hidden; width: 360px; position: absolute; top: 27px;'+ -(a.singlepagestyle?"left: 0; border-radius: 0 0 8px 8px;":"left: 360px; border-radius: 0 0 8px 0;")+' background-color: #FFFFFF; display: none; -webkit-transition: all linear 0.3s; -moz-transition: all linear 0.3s; -o-transition: all linear 0.3s; -ms-transition: all linear 0.3s; transition: all linear 0.3s; -webkit-transform: translateX(-250px); -moz-transform: translateX(-250px); -o-transform: translateX(-250px); -ms-transform: translateX(-250px); transform: translateX(-10px); } .Resetpw-content { display: none; } .lr-ls-tabs>.tab>[id^="tab"]:checked+label { top: 0; border-bottom: 4px solid #BDBDBD; -webkit-animation: page 0.2s linear; -moz-animation: page 0.2s linear; -ms-animation: page 0.2s linear; -o-animation: page 0.2s linear; animation: page 0.2s linear; } .lr-ls-tabs>.tab>[id^="tab"]:checked~[id^="tab-content"] {'+ -(a.body&&a.body.backgroundColor?"background-color:"+a.body.backgroundColor+";":"")+" z-index: 1; /* or display: block; */ display: block; -webkit-transform: translateX(0px); -moz-transform: translateX(0px); -o-transform: translateX(0px); -ms-transform: translateX(0px); transform: translateX(0px); -webkit-transition: all ease-out 0.8s 0.1s; -moz-transition: all ease-out 0.8s 0.1s; -o-transition: all ease-out 0.8s 0.1s; -ms-transition: all ease-out 0.8s 0.1s; transition: all ease-out 0.8s 0.1s; overflow: hidden; } .greeting { margin-top: 24px; margin-bottom: 16px;"+ -(a.singlepagestyle?" width: 328px;":"")+" font-size: 14px; line-height: 19px; color: #424242; } #lr-ls-sectiondivider { padding-top: 7px; margin-top: 16px; display: block; margin-left: auto; margin-right: auto; height: 39px; text-align: center; color: #424242; font-size: 18px; line-height: 19px; }"+(a.socialsquarestyle?" .social-login-b-options { margin-top: 6vh; width: 328px; text-align: center; font-size: 16px; font-weight: 200; -webkit-animation: slide-up 1s ease-out; -moz-animation: slide-up 1s ease-out; } .social-login-b-options .lr-sl-shaded-brick-button { height: 3.5rem; width: 3.5rem; border-radius: 4px; overflow: hidden; margin-top: 8px; position: relative; border: 1px solid rgba(0, 0, 0, 0.1); text-align: left; text-decoration: none; color: white; box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.12), 0 1px 1px 0 rgba(0, 0, 0, 0.24), 0 0 8px 0 rgba(0, 0, 0, 0.12), 0 2px 2px 0 rgba(0, 0, 0, 0.24); } .social-login-b-options .lr-sl-shaded-brick-button .lr-sl-icon { top: 0; left: 0; display: inline-block; position: absolute; } .lr-provider-label { margin-top: 8px; display: inline-block; }": -" .social-login-b-options { margin-top: 6vh; width: 328px; text-align: center; font-size: 18px; font-weight: 200; -webkit-animation: slide-up 1s ease-out; -moz-animation: slide-up 1s ease-out; } .social-login-b-options .lr-sl-shaded-brick-button { line-height: normal; height: 3em; width: 100%; border-radius: 4px; overflow: hidden; margin-top: 8px; position: relative; border: 1px solid rgba(0, 0, 0, 0.1); text-align: left; text-decoration: none; color: white; padding: 0.8em 0 0 3em; box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.12), 0 1px 1px 0 rgba(0, 0, 0, 0.24), 0 0 8px 0 rgba(0, 0, 0, 0.12), 0 2px 2px 0 rgba(0, 0, 0, 0.24); } .social-login-b-options .lr-sl-shaded-brick-button .lr-sl-icon { top: 4px; left: 0; display: inline-block; position: absolute; } .lr-provider-label { margin-top: 8px; display: block; }")+ -' .lr-sl-icon:before { width: 3.4rem; height: 3.2rem; background: url("http://cdn.loginradius.com/hub/prod/v1/hosted-page-default-images/icon-sprite-32.png"); background-image: linear-gradient(transparent, transparent), url("http://cdn.loginradius.com/hub/prod/v1/hosted-page-default-images/icon-sprite.svg"), none; background-size: 100% 3600%; background-position: 0 0;'+(a.socialsquarestyle?"":" margin-top: -4px; margin-top: -0.4rem;")+" } .lr-ls-status-area { margin-left: auto; margin-right: auto; height: 34px;"+ -(a.singlepagestyle?" width: 100%;":" width: 360px;")+" display: none; z-index: 2; } .lr-iconsuccess { font-family: arial; -ms-transform: scaleX(-1) rotate(-35deg); /* IE 9 */ -webkit-transform: scaleX(-1) rotate(-35deg); /* Chrome, Safari, Opera */ transform: scaleX(-1) rotate(-35deg); float: left; margin-right: 5px; } .lr-iconerror { text-align: center; font-family: sans-serif; float: left; margin-right: 3px; } .lr-ls-divsuccess { display: none; padding: 5px; height: 34px; border: 1px solid #3EA34D; color: #FFFFFF; font-size: 12px; line-height: 16px; font-weight: 600; vertical-align: middle; } .lr-ls-diverror { display: none; padding: 5px; height: 34px; border: 1px solid #FF1744; color: #FFFFFF; font-size: 12px; line-height: 16px; font-weight: 600; vertical-align: middle; } ::-webkit-input-placeholder { font-size: 12px; line-height: 100%; } .loginradius--form-element-content { text-align: left; margin-bottom: 1.3rem; margin-bottom: 2.67vh; } #login-container .loginradius--form-element-content, #registration-container .loginradius--form-element-content, #forgotpassword-container .loginradius--form-element-content, #resetpassword-container .loginradius--form-element-content { padding-left: 16px; }"+ -(a.singlepagestyle?"":"#resetpassword-container .loginradius--form-element-content {padding-left: 376px;}")+" .loginradius--form-element-content label { color:"+(a.body&&a.body.textColor?a.body.textColor:"#616161")+'; font-size: 14px; line-height: 14px; } #login-container, #registration-container, #forgotpassword-container { width: 329px; z-index: 0; } #forgotpassword-container { margin-top: 16px; } #loginradius-submit-reset-password { width:45% !important; } input .invalid { border: 1px solid #FF1744; background-color: #F5F5F5; } select { height: 32px; background-color: #F5F5F5; font-size: 15px; font-weight: 300; line-height: 16px; box-sizing: border-box; margin-left: 20px; } textarea, input[type="password"], input[type="text"] { margin-top: 4px; height: 32px; width: 326px; background-color:'+ -(a.input&&a.input.background?a.input.background:" #F5F5F5")+'; border-style: hidden; font-size: 16px; font-weight: 300; line-height: 16px; padding: 8px; -webkit-box-sizing: border-box; box-sizing: border-box; } text { height: 16px; width: 151px; color: #424242; font-size: 14px; line-height: 16px; } input[type="submit"] { margin-top: 2.1vh; color: #FFFFFF; font-size: 14px; line-height: 16px; text-align: center; letter-spacing: 2px; cursor: pointer; } .content-loginradius-stayLogin { margin-top: 8px; display: flex; } input[type="checkbox"] { height: 18px; width: 18px; border: 1px solid #9E9E9E; vertical-align: middle; } .content-loginradius-stayLogin label { height: 18px; width: 84px; color:'+ -(a.body&&a.body.textColor?a.body.textColor:"#616161")+"; font-size: 12px; line-height: 17px; } #lr-forgotpw-btn { right: 16px; bottom: 12.77vh; font-size: 12px; line-height: 17px; height: 18px; color:"+(a.body&&a.body.textColor?a.body.textColor:"#616161")+'; cursor: pointer; float: right; } [id *="loginradius-submit-"] { margin-bottom:10px; height: 75px; margin-left: 16px; /*or height:60px; */ width: 100% !important; border-radius: 0 0 6px 6px; background-color:'+ -(a.submitButton&&a.submitButton.color?a.submitButton.color:"#35a8ff")+"; box-shadow: 0 2px 5px 0 rgba(0, 0, 0, .16), 0 2px 10px 0 rgba(0, 0, 0, .12); outline: none; } #loginradius-submit-login {"+(a.singlepagestyle?" border-radius: 6px;":" border-radius: 6px 6px 6px 0;")+' } [id *="loginradius-submit-"]:hover { filter: brightness(98%); transition: color 400ms; } [id *="loginradius-submit-"]:active { filter: brightness(85%); transition: color 400ms; } #forgotPW { height: 17px; color: #424242; font-size: 12px; line-height: 17px; text-align: center; text-decoration: none; position: absolute; } #reset-password { height: 36px; color: #414141; font-size: 32px; font-weight: 300; line-height: 37px; } .Resetpw.greeting { margin-bottom: 1.5rem; } #signUpopt { margin-top: 10px; display: block; height: 17px; width: 240px; color: #FFFFFF; font-size: 12px; line-height: 17px; text-align: center; text-decoration: none; margin-left: auto; margin-right: auto; } .loginradius-validation-message { margin-top: 0.3rem; color: #FF1744; font-size: 10px; line-height: 14px; } @-webkit-keyframes slide-up { 0% { opacity: 0; -webkit-transform: translateY(-100%); } 100% { opacity: 1; -webkit-transform: translateY(0); } } @-moz-keyframes slide-up { 0% { opacity: 0; -moz-transform: translateY(-100%); } 100% { opacity: 1; -moz-transform: translateY(0); } } .lr-ls-pageloader { display: none; z-index: 999; width: 100%; height: 100%; position: fixed; top: 0; right: 0; bottom: 0; left: 0; background-color: rgba(0, 0, 0, .5); } .lr-ls-page-loadwheel { width: 120px; height: 120px; margin-top: -60px; margin-left: -60px; position: absolute; top: 50%; left: 50%; border-width: 30px; border-radius: 50%; border: 10px solid #f3f3f3; border-radius: 50%; border-top: 10px solid #3498db; -webkit-animation: spin 2s linear infinite; /* Safari */ animation: spin 2s linear infinite; } @-webkit-keyframes spin { 0% { -webkit-transform: rotate(0deg); } 100% { -webkit-transform: rotate(360deg); } } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }}#loginradius-linksignin-email-me-a-link-to-sign-in, #lr-forgot-label{ display: none;}#loginradius-button-resendotp { margin-right: 20px; margin-left: 20px;}#loginradius-showQRcode-qrcode { margin: auto; display: block;}.content-loginradius-qrcode { text-align: center;}.lrLogin { margin-right: auto; margin-left: auto;}.lrSignup { margin-right: auto; margin-left: auto; padding-bottom: 20px;}.lrForgotpw { margin-right: auto; margin-left: auto;}.lrResetpw { margin-right: auto; margin-left: auto;}#lr-ls-sectiondivider:after { content: '+ -(a.content&&a.content.socialandloginDivider?'"'+a.content.socialandloginDivider+'"':'"OR"')+';}/** Social Icon Style***/.lr-sl-icon { display: inline-block; text-align: center;}.lr-sl-icon:before,.lr-sl-icon:after { content: ""; display: inline-block; vertical-align: middle;}.lr-sl-icon:after { height: 100%; width: 0;}.lr-sl-icon-pinterest:before { background-position: 0 -0.2%;}.lr-flat-line { background-color: #27c327;}.lr-flat-pinterest { background-color: #cb2128;}.lr-sl-icon-facebook:before { background-position: 0 0;}.lr-sl-icon-facebook:before { background-position: 0px 2.1%;}.lr-sl-icon-googleplus:before { background-position: 0px 5%;}.lr-sl-icon-linkedin:before { background-position: 0px 6.8%;}.lr-sl-icon-twitter:before { background-position: 0px 9.2%;}.lr-sl-icon-yahoo:before { background-position: 0px 11.6%;}.lr-sl-icon-amazon:before { background-position: 0px 13.9%;}.lr-sl-icon-aol:before { background-position: 0px 16.3%;}.lr-sl-icon-disqus:before { background-position: 0px 18.85%;}.lr-sl-icon-foursquare:before { background-position: 0px 21.3%;}.lr-sl-icon-github:before { background-position: 0px 23.55%;}.lr-sl-icon-hyves:before { background-position: 0px 26.1%;}.lr-sl-icon-instagram:before { background-position: 0px 28.35%;}.lr-sl-icon-kaixin:before { background-position: 0px 30.8%;}.lr-sl-icon-live:before { background-position: 0px 33.3%;}.lr-sl-icon-livejournal:before { background-position: 0px 35.5%;}.lr-sl-icon-mixi:before { background-position: 0px 38.1%;}.lr-sl-icon-odnoklassniki:before { background-position: 0px 40.3%;}.lr-sl-icon-orange:before { background-position: 0px 44%;}.lr-sl-icon-openid:before { background-position: 0px 45.3%;}.lr-sl-icon-paypal:before { background-position: 0px 47.5%;}.lr-sl-icon-persona:before { background-position: 0px 51.2%;}.lr-sl-icon-pinterest:before { background-position: 0px 52.2%;}.lr-sl-icon-qq:before { background-position: 0px 54.7%;}.lr-sl-icon-renren:before { background-position: 0px 57.15%;}.lr-sl-icon-salesforce:before { background-position: 0px 59.6%;}.lr-sl-icon-sinaweibo:before { background-position: 0px 61.8%;}.lr-sl-icon-stackexchange:before { background-position: 0px 64.3%;}.lr-sl-icon-steamcommunity:before { background-position: 0px 66.7%;}.lr-sl-icon-verisign:before { background-position: 0px 69.2%;}.lr-sl-icon-virgilio:before { background-position: 0px 71.6%;}.lr-sl-icon-vkontakte:before { background-position: 0px 73.9%;}.lr-sl-icon-wordpress:before { background-position: 0px 76.1%;}.lr-sl-icon-mailru:before { background-position: 0px 78.6%;}.lr-sl-icon-xing:before { background-position: 0px 81.2%;}.lr-sl-icon-delicious:before { background-position: 0px 85.5%;}.lr-sl-icon-digg:before { background-position: 0px 88%;}.lr-sl-icon-email:before { background-position: 0px 92.5%;}.lr-sl-icon-google-bookmark:before { background-position: 0px 92.8%;}.lr-sl-icon-print:before { background-position: 0px 95.1%;}.lr-sl-icon-reddit:before { background-position: 0px 97.7%;}.lr-sl-icon-tumblr:before { background-position: 0px 97.2%;}.lr-sl-icon-myspace:before { background-position: 0px 90.3%;}.lr-sl-icon-google:before { background-position: 0px 4.4%;}.lr-sl-icon-line:before { background-position: 0px 100.1%;}.lr-flat-amazon { background-color: #f90;}.lr-flat-aol { background-color: #066cb1;}.lr-flat-disqus { background-color: #35a8ff;}.lr-flat-facebook { background-color: #3b5998;}.lr-flat-foursquare { background-color: #1cafec;}.lr-flat-github { background-color: #181616;}.lr-flat-google { background-color: #dd4b39;}.lr-flat-googleplus { background-color: #dd4b39;}.lr-flat-hyves { background-color: #f9a539;}.lr-flat-instagram { background-color: #406e94;}.lr-flat-kaixin { background-color: #bb0e0f;}.lr-flat-linkedin { background-color: #007bb6;}.lr-flat-live { background-color: #004c9a;}.lr-flat-livejournal { background-color: #3770a3;}.lr-flat-mixi { background-color: #d1ad5a;}.lr-flat-myspace { background-color: #313131;}.lr-flat-odnoklassniki { background-color: #f69324;}.lr-flat-openid { background-color: #f7921c;}.lr-flat-orange { background-color: #f60;}.lr-flat-paypal { background-color: #13487b;}.lr-flat-persona { background-color: #e0742f;}.lr-flat-qq { background-color: #29d;}.lr-flat-renren { background-color: #005baa;}.lr-flat-salesforce { background-color: #9cd3f2;}.lr-flat-stackexchange { background-color: #4ba1d8;}.lr-flat-steamcommunity { background-color: #666;}.lr-flat-tumblr { background-color: #32506d;}.lr-flat-twitter { background-color: #55acee;}.lr-flat-verisign { background-color: #0261a2;}.lr-flat-virgilio { background-color: #eb6b21;}.lr-flat-vkontakte { background-color: #45668e;}.lr-flat-sinaweibo { background-color: #bb3e3e;}.lr-flat-wordpress { background-color: #21759c;}.lr-flat-yahoo { background-color: #400090;}.lr-flat-xing { background-color: #007072;}.lr-flat-mailru { background-color: #1897e6;}/* not shown google recaptcha.grecaptcha-badge { display: none; }*/
L
Success!
X
  • "+(a.content&&a.content.tabLabels?a.content.tabLabels[2]:"Forgot Password?")+'
  • '+(a.content&&a.content.forgotPWgreet?a.content.forgotPWgreet: -"We'll email you an instruction on resetting your password.")+'

'+(a.content&&a.content.resetpage?a.content.resetpage:"Reset Password")+'

' - ); - - $("#sociallogin").append(social_script); - - let custom_interface_option = {}; - let sl_options = {}; - - sl_options.onSuccess = function(res) { - console.log("Sociallogin success::", res); - getProfile(res.access_token, res.Profile.Uid); - }; - sl_options.onError = function(err) { - console.log("Sociallogin err::", err); - }; - - custom_interface_option.templateName = 'loginradiuscustom_tmpl'; - sl_options.container = "sociallogin-container"; - - LRObject.util.ready(function() { - LRObject.customInterface(".interfacecontainerdiv", custom_interface_option); - LRObject.init('socialLogin', sl_options); - }); -} - -function register() { - $("#btn-minimal-signup").click(function() { - if ($("#minimal-signup-password").val() != $("#minimal-signup-confirmpassword").val()) { - $("#minimal-signup-message").text("Passwords do not match!"); - $("#minimal-signup-message").attr("class", "error-message"); - return; - } - - $.ajax({ - type: "POST", - url: "/register", - dataType: "json", - data: $.param({ - email: $("#minimal-signup-email").val(), - password: $("#minimal-signup-password").val() - }), - success: function(res) { - console.log("Register success::", res); - $("#minimal-signup-message").text("Check your email to verify your account."); - $("#minimal-signup-message").attr("class", "success-message"); - }, - error: function(xhr, status, error) { - console.log("Register err::", xhr.responseText); - $("#minimal-signup-message").text(xhr.responseText); - $("#minimal-signup-message").attr("class", "error-message"); - } - }); - }); -} - -function forgotpassword() { - $("#btn-minimal-forgotpassword").click(function() { - $.ajax({ - type: "POST", - url: "/password/forgot", - dataType: "json", - data: $.param({ - email: $("#minimal-forgotpassword-email").val() - }), - success: function(res) { - console.log("Send success::", res); - $("#minimal-forgotpassword-message").text("Check your email to start the password reset process."); - $("#minimal-forgotpassword-message").attr("class", "success-message"); - }, - error: function(xhr, status, error) { - console.log("Send err::", xhr.responseText); - var strEmail = $('#minimal-forgotpassword-email').val(); - if(strEmail.replace(/\s/g,"") == ""){ - $("#minimal-forgotpassword-message").text("The Email is a Required Paramter So its can not be null or empty"); - }else{ - $("#minimal-forgotpassword-message").text(xhr.responseText); - } - - $("#minimal-forgotpassword-message").attr("class", "error-message"); - } - }); - }); -} - -function getProfile(access_token, profile_uid) { - localStorage.setItem('LRTokenKey', access_token); - localStorage.setItem('lr-user-uid', profile_uid); - window.location.href = "/profile"; -} \ No newline at end of file diff --git a/demo/src/main/resources/static/js/indexView.js b/demo/src/main/resources/static/js/indexView.js deleted file mode 100755 index 966246b..0000000 --- a/demo/src/main/resources/static/js/indexView.js +++ /dev/null @@ -1,82 +0,0 @@ -$(function() { - - $(window).on('hashchange', function() { - // On every hash change the render function is called with the new hash. - // This is how the navigation of our app happens. - render(decodeURI(window.location.hash)); - }).trigger('hashchange'); - - function render(url) { - // This function decides what type of page to show - // depending on the current url hash value. - - // Get the keyword from the url. - let temp = url.split('/')[0]; - temp = temp.split('?')[0]; - // Hide whatever page is currently shown. - $('.right-elem').removeClass('visible'); - $('.menu-options').removeClass('active'); - - let map = { - // The Homepage. - '': function() { - renderLogin(); - }, - // Login page. - '#login': function() { - renderLogin(); - }, - // Register page. - '#signup': function() { - renderSignup(); - }, - // Forgot Password page. - '#forgotpassword': function() { - renderForgotPassword(); - }, - // Reset Password page. - '#resetpassword': function() { - renderResetPassword(); - } - }; - - // Execute the needed function depending on the url keyword (stored in temp). - if (map[temp]) { - map[temp](); - } - // If the keyword isn't listed in the above - render the error page. - else { - renderErrorPage(); - } - } - - function renderLogin() { - let page = $('.login-elem') - let menuOption = $('#menu-login') - page.addClass('visible'); - menuOption.addClass('active'); - // Shows the login page. - } - - function renderSignup() { - let page = $('.signup-elem') - let menuOption = $('#menu-signup') - page.addClass('visible'); - menuOption.addClass('active'); - // Shows the signup page. - } - - function renderForgotPassword() { - let page = $('.forgotpassword-elem') - let menuOption = $('#menu-forgotpassword') - page.addClass('visible'); - menuOption.addClass('active'); - // Shows the forgot password page. - } - - function renderResetPassword() { - let page = $('.resetpassword-elem') - page.addClass('visible'); - // Shows the reset password page. - } -}); \ No newline at end of file diff --git a/demo/src/main/resources/static/js/jquery.min.js b/demo/src/main/resources/static/js/jquery.min.js deleted file mode 100644 index a85e31c..0000000 --- a/demo/src/main/resources/static/js/jquery.min.js +++ /dev/null @@ -1,2 +0,0 @@ -/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */ -!function (e, t) { "use strict"; "object" == typeof module && "object" == typeof module.exports ? module.exports = e.document ? t(e, !0) : function (e) { if (!e.document) throw new Error("jQuery requires a window with a document"); return t(e) } : t(e) }("undefined" != typeof window ? window : this, function (C, e) { "use strict"; var t = [], r = Object.getPrototypeOf, s = t.slice, g = t.flat ? function (e) { return t.flat.call(e) } : function (e) { return t.concat.apply([], e) }, u = t.push, i = t.indexOf, n = {}, o = n.toString, v = n.hasOwnProperty, a = v.toString, l = a.call(Object), y = {}, m = function (e) { return "function" == typeof e && "number" != typeof e.nodeType && "function" != typeof e.item }, x = function (e) { return null != e && e === e.window }, E = C.document, c = { type: !0, src: !0, nonce: !0, noModule: !0 }; function b(e, t, n) { var r, i, o = (n = n || E).createElement("script"); if (o.text = e, t) for (r in c) (i = t[r] || t.getAttribute && t.getAttribute(r)) && o.setAttribute(r, i); n.head.appendChild(o).parentNode.removeChild(o) } function w(e) { return null == e ? e + "" : "object" == typeof e || "function" == typeof e ? n[o.call(e)] || "object" : typeof e } var f = "3.6.0", S = function (e, t) { return new S.fn.init(e, t) }; function p(e) { var t = !!e && "length" in e && e.length, n = w(e); return !m(e) && !x(e) && ("array" === n || 0 === t || "number" == typeof t && 0 < t && t - 1 in e) } S.fn = S.prototype = { jquery: f, constructor: S, length: 0, toArray: function () { return s.call(this) }, get: function (e) { return null == e ? s.call(this) : e < 0 ? this[e + this.length] : this[e] }, pushStack: function (e) { var t = S.merge(this.constructor(), e); return t.prevObject = this, t }, each: function (e) { return S.each(this, e) }, map: function (n) { return this.pushStack(S.map(this, function (e, t) { return n.call(e, t, e) })) }, slice: function () { return this.pushStack(s.apply(this, arguments)) }, first: function () { return this.eq(0) }, last: function () { return this.eq(-1) }, even: function () { return this.pushStack(S.grep(this, function (e, t) { return (t + 1) % 2 })) }, odd: function () { return this.pushStack(S.grep(this, function (e, t) { return t % 2 })) }, eq: function (e) { var t = this.length, n = +e + (e < 0 ? t : 0); return this.pushStack(0 <= n && n < t ? [this[n]] : []) }, end: function () { return this.prevObject || this.constructor() }, push: u, sort: t.sort, splice: t.splice }, S.extend = S.fn.extend = function () { var e, t, n, r, i, o, a = arguments[0] || {}, s = 1, u = arguments.length, l = !1; for ("boolean" == typeof a && (l = a, a = arguments[s] || {}, s++), "object" == typeof a || m(a) || (a = {}), s === u && (a = this, s--); s < u; s++)if (null != (e = arguments[s])) for (t in e) r = e[t], "__proto__" !== t && a !== r && (l && r && (S.isPlainObject(r) || (i = Array.isArray(r))) ? (n = a[t], o = i && !Array.isArray(n) ? [] : i || S.isPlainObject(n) ? n : {}, i = !1, a[t] = S.extend(l, o, r)) : void 0 !== r && (a[t] = r)); return a }, S.extend({ expando: "jQuery" + (f + Math.random()).replace(/\D/g, ""), isReady: !0, error: function (e) { throw new Error(e) }, noop: function () { }, isPlainObject: function (e) { var t, n; return !(!e || "[object Object]" !== o.call(e)) && (!(t = r(e)) || "function" == typeof (n = v.call(t, "constructor") && t.constructor) && a.call(n) === l) }, isEmptyObject: function (e) { var t; for (t in e) return !1; return !0 }, globalEval: function (e, t, n) { b(e, { nonce: t && t.nonce }, n) }, each: function (e, t) { var n, r = 0; if (p(e)) { for (n = e.length; r < n; r++)if (!1 === t.call(e[r], r, e[r])) break } else for (r in e) if (!1 === t.call(e[r], r, e[r])) break; return e }, makeArray: function (e, t) { var n = t || []; return null != e && (p(Object(e)) ? S.merge(n, "string" == typeof e ? [e] : e) : u.call(n, e)), n }, inArray: function (e, t, n) { return null == t ? -1 : i.call(t, e, n) }, merge: function (e, t) { for (var n = +t.length, r = 0, i = e.length; r < n; r++)e[i++] = t[r]; return e.length = i, e }, grep: function (e, t, n) { for (var r = [], i = 0, o = e.length, a = !n; i < o; i++)!t(e[i], i) !== a && r.push(e[i]); return r }, map: function (e, t, n) { var r, i, o = 0, a = []; if (p(e)) for (r = e.length; o < r; o++)null != (i = t(e[o], o, n)) && a.push(i); else for (o in e) null != (i = t(e[o], o, n)) && a.push(i); return g(a) }, guid: 1, support: y }), "function" == typeof Symbol && (S.fn[Symbol.iterator] = t[Symbol.iterator]), S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "), function (e, t) { n["[object " + t + "]"] = t.toLowerCase() }); var d = function (n) { var e, d, b, o, i, h, f, g, w, u, l, T, C, a, E, v, s, c, y, S = "sizzle" + 1 * new Date, p = n.document, k = 0, r = 0, m = ue(), x = ue(), A = ue(), N = ue(), j = function (e, t) { return e === t && (l = !0), 0 }, D = {}.hasOwnProperty, t = [], q = t.pop, L = t.push, H = t.push, O = t.slice, P = function (e, t) { for (var n = 0, r = e.length; n < r; n++)if (e[n] === t) return n; return -1 }, R = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", M = "[\\x20\\t\\r\\n\\f]", I = "(?:\\\\[\\da-fA-F]{1,6}" + M + "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", W = "\\[" + M + "*(" + I + ")(?:" + M + "*([*^$|!~]?=)" + M + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + I + "))|)" + M + "*\\]", F = ":(" + I + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + W + ")*)|.*)\\)|)", B = new RegExp(M + "+", "g"), $ = new RegExp("^" + M + "+|((?:^|[^\\\\])(?:\\\\.)*)" + M + "+$", "g"), _ = new RegExp("^" + M + "*," + M + "*"), z = new RegExp("^" + M + "*([>+~]|" + M + ")" + M + "*"), U = new RegExp(M + "|>"), X = new RegExp(F), V = new RegExp("^" + I + "$"), G = { ID: new RegExp("^#(" + I + ")"), CLASS: new RegExp("^\\.(" + I + ")"), TAG: new RegExp("^(" + I + "|[*])"), ATTR: new RegExp("^" + W), PSEUDO: new RegExp("^" + F), CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + M + "*(even|odd|(([+-]|)(\\d*)n|)" + M + "*(?:([+-]|)" + M + "*(\\d+)|))" + M + "*\\)|)", "i"), bool: new RegExp("^(?:" + R + ")$", "i"), needsContext: new RegExp("^" + M + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + M + "*((?:-\\d)?\\d*)" + M + "*\\)|)(?=[^-]|$)", "i") }, Y = /HTML$/i, Q = /^(?:input|select|textarea|button)$/i, J = /^h\d$/i, K = /^[^{]+\{\s*\[native \w/, Z = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, ee = /[+~]/, te = new RegExp("\\\\[\\da-fA-F]{1,6}" + M + "?|\\\\([^\\r\\n\\f])", "g"), ne = function (e, t) { var n = "0x" + e.slice(1) - 65536; return t || (n < 0 ? String.fromCharCode(n + 65536) : String.fromCharCode(n >> 10 | 55296, 1023 & n | 56320)) }, re = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, ie = function (e, t) { return t ? "\0" === e ? "\ufffd" : e.slice(0, -1) + "\\" + e.charCodeAt(e.length - 1).toString(16) + " " : "\\" + e }, oe = function () { T() }, ae = be(function (e) { return !0 === e.disabled && "fieldset" === e.nodeName.toLowerCase() }, { dir: "parentNode", next: "legend" }); try { H.apply(t = O.call(p.childNodes), p.childNodes), t[p.childNodes.length].nodeType } catch (e) { H = { apply: t.length ? function (e, t) { L.apply(e, O.call(t)) } : function (e, t) { var n = e.length, r = 0; while (e[n++] = t[r++]); e.length = n - 1 } } } function se(t, e, n, r) { var i, o, a, s, u, l, c, f = e && e.ownerDocument, p = e ? e.nodeType : 9; if (n = n || [], "string" != typeof t || !t || 1 !== p && 9 !== p && 11 !== p) return n; if (!r && (T(e), e = e || C, E)) { if (11 !== p && (u = Z.exec(t))) if (i = u[1]) { if (9 === p) { if (!(a = e.getElementById(i))) return n; if (a.id === i) return n.push(a), n } else if (f && (a = f.getElementById(i)) && y(e, a) && a.id === i) return n.push(a), n } else { if (u[2]) return H.apply(n, e.getElementsByTagName(t)), n; if ((i = u[3]) && d.getElementsByClassName && e.getElementsByClassName) return H.apply(n, e.getElementsByClassName(i)), n } if (d.qsa && !N[t + " "] && (!v || !v.test(t)) && (1 !== p || "object" !== e.nodeName.toLowerCase())) { if (c = t, f = e, 1 === p && (U.test(t) || z.test(t))) { (f = ee.test(t) && ye(e.parentNode) || e) === e && d.scope || ((s = e.getAttribute("id")) ? s = s.replace(re, ie) : e.setAttribute("id", s = S)), o = (l = h(t)).length; while (o--) l[o] = (s ? "#" + s : ":scope") + " " + xe(l[o]); c = l.join(",") } try { return H.apply(n, f.querySelectorAll(c)), n } catch (e) { N(t, !0) } finally { s === S && e.removeAttribute("id") } } } return g(t.replace($, "$1"), e, n, r) } function ue() { var r = []; return function e(t, n) { return r.push(t + " ") > b.cacheLength && delete e[r.shift()], e[t + " "] = n } } function le(e) { return e[S] = !0, e } function ce(e) { var t = C.createElement("fieldset"); try { return !!e(t) } catch (e) { return !1 } finally { t.parentNode && t.parentNode.removeChild(t), t = null } } function fe(e, t) { var n = e.split("|"), r = n.length; while (r--) b.attrHandle[n[r]] = t } function pe(e, t) { var n = t && e, r = n && 1 === e.nodeType && 1 === t.nodeType && e.sourceIndex - t.sourceIndex; if (r) return r; if (n) while (n = n.nextSibling) if (n === t) return -1; return e ? 1 : -1 } function de(t) { return function (e) { return "input" === e.nodeName.toLowerCase() && e.type === t } } function he(n) { return function (e) { var t = e.nodeName.toLowerCase(); return ("input" === t || "button" === t) && e.type === n } } function ge(t) { return function (e) { return "form" in e ? e.parentNode && !1 === e.disabled ? "label" in e ? "label" in e.parentNode ? e.parentNode.disabled === t : e.disabled === t : e.isDisabled === t || e.isDisabled !== !t && ae(e) === t : e.disabled === t : "label" in e && e.disabled === t } } function ve(a) { return le(function (o) { return o = +o, le(function (e, t) { var n, r = a([], e.length, o), i = r.length; while (i--) e[n = r[i]] && (e[n] = !(t[n] = e[n])) }) }) } function ye(e) { return e && "undefined" != typeof e.getElementsByTagName && e } for (e in d = se.support = {}, i = se.isXML = function (e) { var t = e && e.namespaceURI, n = e && (e.ownerDocument || e).documentElement; return !Y.test(t || n && n.nodeName || "HTML") }, T = se.setDocument = function (e) { var t, n, r = e ? e.ownerDocument || e : p; return r != C && 9 === r.nodeType && r.documentElement && (a = (C = r).documentElement, E = !i(C), p != C && (n = C.defaultView) && n.top !== n && (n.addEventListener ? n.addEventListener("unload", oe, !1) : n.attachEvent && n.attachEvent("onunload", oe)), d.scope = ce(function (e) { return a.appendChild(e).appendChild(C.createElement("div")), "undefined" != typeof e.querySelectorAll && !e.querySelectorAll(":scope fieldset div").length }), d.attributes = ce(function (e) { return e.className = "i", !e.getAttribute("className") }), d.getElementsByTagName = ce(function (e) { return e.appendChild(C.createComment("")), !e.getElementsByTagName("*").length }), d.getElementsByClassName = K.test(C.getElementsByClassName), d.getById = ce(function (e) { return a.appendChild(e).id = S, !C.getElementsByName || !C.getElementsByName(S).length }), d.getById ? (b.filter.ID = function (e) { var t = e.replace(te, ne); return function (e) { return e.getAttribute("id") === t } }, b.find.ID = function (e, t) { if ("undefined" != typeof t.getElementById && E) { var n = t.getElementById(e); return n ? [n] : [] } }) : (b.filter.ID = function (e) { var n = e.replace(te, ne); return function (e) { var t = "undefined" != typeof e.getAttributeNode && e.getAttributeNode("id"); return t && t.value === n } }, b.find.ID = function (e, t) { if ("undefined" != typeof t.getElementById && E) { var n, r, i, o = t.getElementById(e); if (o) { if ((n = o.getAttributeNode("id")) && n.value === e) return [o]; i = t.getElementsByName(e), r = 0; while (o = i[r++]) if ((n = o.getAttributeNode("id")) && n.value === e) return [o] } return [] } }), b.find.TAG = d.getElementsByTagName ? function (e, t) { return "undefined" != typeof t.getElementsByTagName ? t.getElementsByTagName(e) : d.qsa ? t.querySelectorAll(e) : void 0 } : function (e, t) { var n, r = [], i = 0, o = t.getElementsByTagName(e); if ("*" === e) { while (n = o[i++]) 1 === n.nodeType && r.push(n); return r } return o }, b.find.CLASS = d.getElementsByClassName && function (e, t) { if ("undefined" != typeof t.getElementsByClassName && E) return t.getElementsByClassName(e) }, s = [], v = [], (d.qsa = K.test(C.querySelectorAll)) && (ce(function (e) { var t; a.appendChild(e).innerHTML = "", e.querySelectorAll("[msallowcapture^='']").length && v.push("[*^$]=" + M + "*(?:''|\"\")"), e.querySelectorAll("[selected]").length || v.push("\\[" + M + "*(?:value|" + R + ")"), e.querySelectorAll("[id~=" + S + "-]").length || v.push("~="), (t = C.createElement("input")).setAttribute("name", ""), e.appendChild(t), e.querySelectorAll("[name='']").length || v.push("\\[" + M + "*name" + M + "*=" + M + "*(?:''|\"\")"), e.querySelectorAll(":checked").length || v.push(":checked"), e.querySelectorAll("a#" + S + "+*").length || v.push(".#.+[+~]"), e.querySelectorAll("\\\f"), v.push("[\\r\\n\\f]") }), ce(function (e) { e.innerHTML = ""; var t = C.createElement("input"); t.setAttribute("type", "hidden"), e.appendChild(t).setAttribute("name", "D"), e.querySelectorAll("[name=d]").length && v.push("name" + M + "*[*^$|!~]?="), 2 !== e.querySelectorAll(":enabled").length && v.push(":enabled", ":disabled"), a.appendChild(e).disabled = !0, 2 !== e.querySelectorAll(":disabled").length && v.push(":enabled", ":disabled"), e.querySelectorAll("*,:x"), v.push(",.*:") })), (d.matchesSelector = K.test(c = a.matches || a.webkitMatchesSelector || a.mozMatchesSelector || a.oMatchesSelector || a.msMatchesSelector)) && ce(function (e) { d.disconnectedMatch = c.call(e, "*"), c.call(e, "[s!='']:x"), s.push("!=", F) }), v = v.length && new RegExp(v.join("|")), s = s.length && new RegExp(s.join("|")), t = K.test(a.compareDocumentPosition), y = t || K.test(a.contains) ? function (e, t) { var n = 9 === e.nodeType ? e.documentElement : e, r = t && t.parentNode; return e === r || !(!r || 1 !== r.nodeType || !(n.contains ? n.contains(r) : e.compareDocumentPosition && 16 & e.compareDocumentPosition(r))) } : function (e, t) { if (t) while (t = t.parentNode) if (t === e) return !0; return !1 }, j = t ? function (e, t) { if (e === t) return l = !0, 0; var n = !e.compareDocumentPosition - !t.compareDocumentPosition; return n || (1 & (n = (e.ownerDocument || e) == (t.ownerDocument || t) ? e.compareDocumentPosition(t) : 1) || !d.sortDetached && t.compareDocumentPosition(e) === n ? e == C || e.ownerDocument == p && y(p, e) ? -1 : t == C || t.ownerDocument == p && y(p, t) ? 1 : u ? P(u, e) - P(u, t) : 0 : 4 & n ? -1 : 1) } : function (e, t) { if (e === t) return l = !0, 0; var n, r = 0, i = e.parentNode, o = t.parentNode, a = [e], s = [t]; if (!i || !o) return e == C ? -1 : t == C ? 1 : i ? -1 : o ? 1 : u ? P(u, e) - P(u, t) : 0; if (i === o) return pe(e, t); n = e; while (n = n.parentNode) a.unshift(n); n = t; while (n = n.parentNode) s.unshift(n); while (a[r] === s[r]) r++; return r ? pe(a[r], s[r]) : a[r] == p ? -1 : s[r] == p ? 1 : 0 }), C }, se.matches = function (e, t) { return se(e, null, null, t) }, se.matchesSelector = function (e, t) { if (T(e), d.matchesSelector && E && !N[t + " "] && (!s || !s.test(t)) && (!v || !v.test(t))) try { var n = c.call(e, t); if (n || d.disconnectedMatch || e.document && 11 !== e.document.nodeType) return n } catch (e) { N(t, !0) } return 0 < se(t, C, null, [e]).length }, se.contains = function (e, t) { return (e.ownerDocument || e) != C && T(e), y(e, t) }, se.attr = function (e, t) { (e.ownerDocument || e) != C && T(e); var n = b.attrHandle[t.toLowerCase()], r = n && D.call(b.attrHandle, t.toLowerCase()) ? n(e, t, !E) : void 0; return void 0 !== r ? r : d.attributes || !E ? e.getAttribute(t) : (r = e.getAttributeNode(t)) && r.specified ? r.value : null }, se.escape = function (e) { return (e + "").replace(re, ie) }, se.error = function (e) { throw new Error("Syntax error, unrecognized expression: " + e) }, se.uniqueSort = function (e) { var t, n = [], r = 0, i = 0; if (l = !d.detectDuplicates, u = !d.sortStable && e.slice(0), e.sort(j), l) { while (t = e[i++]) t === e[i] && (r = n.push(i)); while (r--) e.splice(n[r], 1) } return u = null, e }, o = se.getText = function (e) { var t, n = "", r = 0, i = e.nodeType; if (i) { if (1 === i || 9 === i || 11 === i) { if ("string" == typeof e.textContent) return e.textContent; for (e = e.firstChild; e; e = e.nextSibling)n += o(e) } else if (3 === i || 4 === i) return e.nodeValue } else while (t = e[r++]) n += o(t); return n }, (b = se.selectors = { cacheLength: 50, createPseudo: le, match: G, attrHandle: {}, find: {}, relative: { ">": { dir: "parentNode", first: !0 }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: !0 }, "~": { dir: "previousSibling" } }, preFilter: { ATTR: function (e) { return e[1] = e[1].replace(te, ne), e[3] = (e[3] || e[4] || e[5] || "").replace(te, ne), "~=" === e[2] && (e[3] = " " + e[3] + " "), e.slice(0, 4) }, CHILD: function (e) { return e[1] = e[1].toLowerCase(), "nth" === e[1].slice(0, 3) ? (e[3] || se.error(e[0]), e[4] = +(e[4] ? e[5] + (e[6] || 1) : 2 * ("even" === e[3] || "odd" === e[3])), e[5] = +(e[7] + e[8] || "odd" === e[3])) : e[3] && se.error(e[0]), e }, PSEUDO: function (e) { var t, n = !e[6] && e[2]; return G.CHILD.test(e[0]) ? null : (e[3] ? e[2] = e[4] || e[5] || "" : n && X.test(n) && (t = h(n, !0)) && (t = n.indexOf(")", n.length - t) - n.length) && (e[0] = e[0].slice(0, t), e[2] = n.slice(0, t)), e.slice(0, 3)) } }, filter: { TAG: function (e) { var t = e.replace(te, ne).toLowerCase(); return "*" === e ? function () { return !0 } : function (e) { return e.nodeName && e.nodeName.toLowerCase() === t } }, CLASS: function (e) { var t = m[e + " "]; return t || (t = new RegExp("(^|" + M + ")" + e + "(" + M + "|$)")) && m(e, function (e) { return t.test("string" == typeof e.className && e.className || "undefined" != typeof e.getAttribute && e.getAttribute("class") || "") }) }, ATTR: function (n, r, i) { return function (e) { var t = se.attr(e, n); return null == t ? "!=" === r : !r || (t += "", "=" === r ? t === i : "!=" === r ? t !== i : "^=" === r ? i && 0 === t.indexOf(i) : "*=" === r ? i && -1 < t.indexOf(i) : "$=" === r ? i && t.slice(-i.length) === i : "~=" === r ? -1 < (" " + t.replace(B, " ") + " ").indexOf(i) : "|=" === r && (t === i || t.slice(0, i.length + 1) === i + "-")) } }, CHILD: function (h, e, t, g, v) { var y = "nth" !== h.slice(0, 3), m = "last" !== h.slice(-4), x = "of-type" === e; return 1 === g && 0 === v ? function (e) { return !!e.parentNode } : function (e, t, n) { var r, i, o, a, s, u, l = y !== m ? "nextSibling" : "previousSibling", c = e.parentNode, f = x && e.nodeName.toLowerCase(), p = !n && !x, d = !1; if (c) { if (y) { while (l) { a = e; while (a = a[l]) if (x ? a.nodeName.toLowerCase() === f : 1 === a.nodeType) return !1; u = l = "only" === h && !u && "nextSibling" } return !0 } if (u = [m ? c.firstChild : c.lastChild], m && p) { d = (s = (r = (i = (o = (a = c)[S] || (a[S] = {}))[a.uniqueID] || (o[a.uniqueID] = {}))[h] || [])[0] === k && r[1]) && r[2], a = s && c.childNodes[s]; while (a = ++s && a && a[l] || (d = s = 0) || u.pop()) if (1 === a.nodeType && ++d && a === e) { i[h] = [k, s, d]; break } } else if (p && (d = s = (r = (i = (o = (a = e)[S] || (a[S] = {}))[a.uniqueID] || (o[a.uniqueID] = {}))[h] || [])[0] === k && r[1]), !1 === d) while (a = ++s && a && a[l] || (d = s = 0) || u.pop()) if ((x ? a.nodeName.toLowerCase() === f : 1 === a.nodeType) && ++d && (p && ((i = (o = a[S] || (a[S] = {}))[a.uniqueID] || (o[a.uniqueID] = {}))[h] = [k, d]), a === e)) break; return (d -= v) === g || d % g == 0 && 0 <= d / g } } }, PSEUDO: function (e, o) { var t, a = b.pseudos[e] || b.setFilters[e.toLowerCase()] || se.error("unsupported pseudo: " + e); return a[S] ? a(o) : 1 < a.length ? (t = [e, e, "", o], b.setFilters.hasOwnProperty(e.toLowerCase()) ? le(function (e, t) { var n, r = a(e, o), i = r.length; while (i--) e[n = P(e, r[i])] = !(t[n] = r[i]) }) : function (e) { return a(e, 0, t) }) : a } }, pseudos: { not: le(function (e) { var r = [], i = [], s = f(e.replace($, "$1")); return s[S] ? le(function (e, t, n, r) { var i, o = s(e, null, r, []), a = e.length; while (a--) (i = o[a]) && (e[a] = !(t[a] = i)) }) : function (e, t, n) { return r[0] = e, s(r, null, n, i), r[0] = null, !i.pop() } }), has: le(function (t) { return function (e) { return 0 < se(t, e).length } }), contains: le(function (t) { return t = t.replace(te, ne), function (e) { return -1 < (e.textContent || o(e)).indexOf(t) } }), lang: le(function (n) { return V.test(n || "") || se.error("unsupported lang: " + n), n = n.replace(te, ne).toLowerCase(), function (e) { var t; do { if (t = E ? e.lang : e.getAttribute("xml:lang") || e.getAttribute("lang")) return (t = t.toLowerCase()) === n || 0 === t.indexOf(n + "-") } while ((e = e.parentNode) && 1 === e.nodeType); return !1 } }), target: function (e) { var t = n.location && n.location.hash; return t && t.slice(1) === e.id }, root: function (e) { return e === a }, focus: function (e) { return e === C.activeElement && (!C.hasFocus || C.hasFocus()) && !!(e.type || e.href || ~e.tabIndex) }, enabled: ge(!1), disabled: ge(!0), checked: function (e) { var t = e.nodeName.toLowerCase(); return "input" === t && !!e.checked || "option" === t && !!e.selected }, selected: function (e) { return e.parentNode && e.parentNode.selectedIndex, !0 === e.selected }, empty: function (e) { for (e = e.firstChild; e; e = e.nextSibling)if (e.nodeType < 6) return !1; return !0 }, parent: function (e) { return !b.pseudos.empty(e) }, header: function (e) { return J.test(e.nodeName) }, input: function (e) { return Q.test(e.nodeName) }, button: function (e) { var t = e.nodeName.toLowerCase(); return "input" === t && "button" === e.type || "button" === t }, text: function (e) { var t; return "input" === e.nodeName.toLowerCase() && "text" === e.type && (null == (t = e.getAttribute("type")) || "text" === t.toLowerCase()) }, first: ve(function () { return [0] }), last: ve(function (e, t) { return [t - 1] }), eq: ve(function (e, t, n) { return [n < 0 ? n + t : n] }), even: ve(function (e, t) { for (var n = 0; n < t; n += 2)e.push(n); return e }), odd: ve(function (e, t) { for (var n = 1; n < t; n += 2)e.push(n); return e }), lt: ve(function (e, t, n) { for (var r = n < 0 ? n + t : t < n ? t : n; 0 <= --r;)e.push(r); return e }), gt: ve(function (e, t, n) { for (var r = n < 0 ? n + t : n; ++r < t;)e.push(r); return e }) } }).pseudos.nth = b.pseudos.eq, { radio: !0, checkbox: !0, file: !0, password: !0, image: !0 }) b.pseudos[e] = de(e); for (e in { submit: !0, reset: !0 }) b.pseudos[e] = he(e); function me() { } function xe(e) { for (var t = 0, n = e.length, r = ""; t < n; t++)r += e[t].value; return r } function be(s, e, t) { var u = e.dir, l = e.next, c = l || u, f = t && "parentNode" === c, p = r++; return e.first ? function (e, t, n) { while (e = e[u]) if (1 === e.nodeType || f) return s(e, t, n); return !1 } : function (e, t, n) { var r, i, o, a = [k, p]; if (n) { while (e = e[u]) if ((1 === e.nodeType || f) && s(e, t, n)) return !0 } else while (e = e[u]) if (1 === e.nodeType || f) if (i = (o = e[S] || (e[S] = {}))[e.uniqueID] || (o[e.uniqueID] = {}), l && l === e.nodeName.toLowerCase()) e = e[u] || e; else { if ((r = i[c]) && r[0] === k && r[1] === p) return a[2] = r[2]; if ((i[c] = a)[2] = s(e, t, n)) return !0 } return !1 } } function we(i) { return 1 < i.length ? function (e, t, n) { var r = i.length; while (r--) if (!i[r](e, t, n)) return !1; return !0 } : i[0] } function Te(e, t, n, r, i) { for (var o, a = [], s = 0, u = e.length, l = null != t; s < u; s++)(o = e[s]) && (n && !n(o, r, i) || (a.push(o), l && t.push(s))); return a } function Ce(d, h, g, v, y, e) { return v && !v[S] && (v = Ce(v)), y && !y[S] && (y = Ce(y, e)), le(function (e, t, n, r) { var i, o, a, s = [], u = [], l = t.length, c = e || function (e, t, n) { for (var r = 0, i = t.length; r < i; r++)se(e, t[r], n); return n }(h || "*", n.nodeType ? [n] : n, []), f = !d || !e && h ? c : Te(c, s, d, n, r), p = g ? y || (e ? d : l || v) ? [] : t : f; if (g && g(f, p, n, r), v) { i = Te(p, u), v(i, [], n, r), o = i.length; while (o--) (a = i[o]) && (p[u[o]] = !(f[u[o]] = a)) } if (e) { if (y || d) { if (y) { i = [], o = p.length; while (o--) (a = p[o]) && i.push(f[o] = a); y(null, p = [], i, r) } o = p.length; while (o--) (a = p[o]) && -1 < (i = y ? P(e, a) : s[o]) && (e[i] = !(t[i] = a)) } } else p = Te(p === t ? p.splice(l, p.length) : p), y ? y(null, t, p, r) : H.apply(t, p) }) } function Ee(e) { for (var i, t, n, r = e.length, o = b.relative[e[0].type], a = o || b.relative[" "], s = o ? 1 : 0, u = be(function (e) { return e === i }, a, !0), l = be(function (e) { return -1 < P(i, e) }, a, !0), c = [function (e, t, n) { var r = !o && (n || t !== w) || ((i = t).nodeType ? u(e, t, n) : l(e, t, n)); return i = null, r }]; s < r; s++)if (t = b.relative[e[s].type]) c = [be(we(c), t)]; else { if ((t = b.filter[e[s].type].apply(null, e[s].matches))[S]) { for (n = ++s; n < r; n++)if (b.relative[e[n].type]) break; return Ce(1 < s && we(c), 1 < s && xe(e.slice(0, s - 1).concat({ value: " " === e[s - 2].type ? "*" : "" })).replace($, "$1"), t, s < n && Ee(e.slice(s, n)), n < r && Ee(e = e.slice(n)), n < r && xe(e)) } c.push(t) } return we(c) } return me.prototype = b.filters = b.pseudos, b.setFilters = new me, h = se.tokenize = function (e, t) { var n, r, i, o, a, s, u, l = x[e + " "]; if (l) return t ? 0 : l.slice(0); a = e, s = [], u = b.preFilter; while (a) { for (o in n && !(r = _.exec(a)) || (r && (a = a.slice(r[0].length) || a), s.push(i = [])), n = !1, (r = z.exec(a)) && (n = r.shift(), i.push({ value: n, type: r[0].replace($, " ") }), a = a.slice(n.length)), b.filter) !(r = G[o].exec(a)) || u[o] && !(r = u[o](r)) || (n = r.shift(), i.push({ value: n, type: o, matches: r }), a = a.slice(n.length)); if (!n) break } return t ? a.length : a ? se.error(e) : x(e, s).slice(0) }, f = se.compile = function (e, t) { var n, v, y, m, x, r, i = [], o = [], a = A[e + " "]; if (!a) { t || (t = h(e)), n = t.length; while (n--) (a = Ee(t[n]))[S] ? i.push(a) : o.push(a); (a = A(e, (v = o, m = 0 < (y = i).length, x = 0 < v.length, r = function (e, t, n, r, i) { var o, a, s, u = 0, l = "0", c = e && [], f = [], p = w, d = e || x && b.find.TAG("*", i), h = k += null == p ? 1 : Math.random() || .1, g = d.length; for (i && (w = t == C || t || i); l !== g && null != (o = d[l]); l++) { if (x && o) { a = 0, t || o.ownerDocument == C || (T(o), n = !E); while (s = v[a++]) if (s(o, t || C, n)) { r.push(o); break } i && (k = h) } m && ((o = !s && o) && u--, e && c.push(o)) } if (u += l, m && l !== u) { a = 0; while (s = y[a++]) s(c, f, t, n); if (e) { if (0 < u) while (l--) c[l] || f[l] || (f[l] = q.call(r)); f = Te(f) } H.apply(r, f), i && !e && 0 < f.length && 1 < u + y.length && se.uniqueSort(r) } return i && (k = h, w = p), c }, m ? le(r) : r))).selector = e } return a }, g = se.select = function (e, t, n, r) { var i, o, a, s, u, l = "function" == typeof e && e, c = !r && h(e = l.selector || e); if (n = n || [], 1 === c.length) { if (2 < (o = c[0] = c[0].slice(0)).length && "ID" === (a = o[0]).type && 9 === t.nodeType && E && b.relative[o[1].type]) { if (!(t = (b.find.ID(a.matches[0].replace(te, ne), t) || [])[0])) return n; l && (t = t.parentNode), e = e.slice(o.shift().value.length) } i = G.needsContext.test(e) ? 0 : o.length; while (i--) { if (a = o[i], b.relative[s = a.type]) break; if ((u = b.find[s]) && (r = u(a.matches[0].replace(te, ne), ee.test(o[0].type) && ye(t.parentNode) || t))) { if (o.splice(i, 1), !(e = r.length && xe(o))) return H.apply(n, r), n; break } } } return (l || f(e, c))(r, t, !E, n, !t || ee.test(e) && ye(t.parentNode) || t), n }, d.sortStable = S.split("").sort(j).join("") === S, d.detectDuplicates = !!l, T(), d.sortDetached = ce(function (e) { return 1 & e.compareDocumentPosition(C.createElement("fieldset")) }), ce(function (e) { return e.innerHTML = "", "#" === e.firstChild.getAttribute("href") }) || fe("type|href|height|width", function (e, t, n) { if (!n) return e.getAttribute(t, "type" === t.toLowerCase() ? 1 : 2) }), d.attributes && ce(function (e) { return e.innerHTML = "", e.firstChild.setAttribute("value", ""), "" === e.firstChild.getAttribute("value") }) || fe("value", function (e, t, n) { if (!n && "input" === e.nodeName.toLowerCase()) return e.defaultValue }), ce(function (e) { return null == e.getAttribute("disabled") }) || fe(R, function (e, t, n) { var r; if (!n) return !0 === e[t] ? t.toLowerCase() : (r = e.getAttributeNode(t)) && r.specified ? r.value : null }), se }(C); S.find = d, S.expr = d.selectors, S.expr[":"] = S.expr.pseudos, S.uniqueSort = S.unique = d.uniqueSort, S.text = d.getText, S.isXMLDoc = d.isXML, S.contains = d.contains, S.escapeSelector = d.escape; var h = function (e, t, n) { var r = [], i = void 0 !== n; while ((e = e[t]) && 9 !== e.nodeType) if (1 === e.nodeType) { if (i && S(e).is(n)) break; r.push(e) } return r }, T = function (e, t) { for (var n = []; e; e = e.nextSibling)1 === e.nodeType && e !== t && n.push(e); return n }, k = S.expr.match.needsContext; function A(e, t) { return e.nodeName && e.nodeName.toLowerCase() === t.toLowerCase() } var N = /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i; function j(e, n, r) { return m(n) ? S.grep(e, function (e, t) { return !!n.call(e, t, e) !== r }) : n.nodeType ? S.grep(e, function (e) { return e === n !== r }) : "string" != typeof n ? S.grep(e, function (e) { return -1 < i.call(n, e) !== r }) : S.filter(n, e, r) } S.filter = function (e, t, n) { var r = t[0]; return n && (e = ":not(" + e + ")"), 1 === t.length && 1 === r.nodeType ? S.find.matchesSelector(r, e) ? [r] : [] : S.find.matches(e, S.grep(t, function (e) { return 1 === e.nodeType })) }, S.fn.extend({ find: function (e) { var t, n, r = this.length, i = this; if ("string" != typeof e) return this.pushStack(S(e).filter(function () { for (t = 0; t < r; t++)if (S.contains(i[t], this)) return !0 })); for (n = this.pushStack([]), t = 0; t < r; t++)S.find(e, i[t], n); return 1 < r ? S.uniqueSort(n) : n }, filter: function (e) { return this.pushStack(j(this, e || [], !1)) }, not: function (e) { return this.pushStack(j(this, e || [], !0)) }, is: function (e) { return !!j(this, "string" == typeof e && k.test(e) ? S(e) : e || [], !1).length } }); var D, q = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/; (S.fn.init = function (e, t, n) { var r, i; if (!e) return this; if (n = n || D, "string" == typeof e) { if (!(r = "<" === e[0] && ">" === e[e.length - 1] && 3 <= e.length ? [null, e, null] : q.exec(e)) || !r[1] && t) return !t || t.jquery ? (t || n).find(e) : this.constructor(t).find(e); if (r[1]) { if (t = t instanceof S ? t[0] : t, S.merge(this, S.parseHTML(r[1], t && t.nodeType ? t.ownerDocument || t : E, !0)), N.test(r[1]) && S.isPlainObject(t)) for (r in t) m(this[r]) ? this[r](t[r]) : this.attr(r, t[r]); return this } return (i = E.getElementById(r[2])) && (this[0] = i, this.length = 1), this } return e.nodeType ? (this[0] = e, this.length = 1, this) : m(e) ? void 0 !== n.ready ? n.ready(e) : e(S) : S.makeArray(e, this) }).prototype = S.fn, D = S(E); var L = /^(?:parents|prev(?:Until|All))/, H = { children: !0, contents: !0, next: !0, prev: !0 }; function O(e, t) { while ((e = e[t]) && 1 !== e.nodeType); return e } S.fn.extend({ has: function (e) { var t = S(e, this), n = t.length; return this.filter(function () { for (var e = 0; e < n; e++)if (S.contains(this, t[e])) return !0 }) }, closest: function (e, t) { var n, r = 0, i = this.length, o = [], a = "string" != typeof e && S(e); if (!k.test(e)) for (; r < i; r++)for (n = this[r]; n && n !== t; n = n.parentNode)if (n.nodeType < 11 && (a ? -1 < a.index(n) : 1 === n.nodeType && S.find.matchesSelector(n, e))) { o.push(n); break } return this.pushStack(1 < o.length ? S.uniqueSort(o) : o) }, index: function (e) { return e ? "string" == typeof e ? i.call(S(e), this[0]) : i.call(this, e.jquery ? e[0] : e) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1 }, add: function (e, t) { return this.pushStack(S.uniqueSort(S.merge(this.get(), S(e, t)))) }, addBack: function (e) { return this.add(null == e ? this.prevObject : this.prevObject.filter(e)) } }), S.each({ parent: function (e) { var t = e.parentNode; return t && 11 !== t.nodeType ? t : null }, parents: function (e) { return h(e, "parentNode") }, parentsUntil: function (e, t, n) { return h(e, "parentNode", n) }, next: function (e) { return O(e, "nextSibling") }, prev: function (e) { return O(e, "previousSibling") }, nextAll: function (e) { return h(e, "nextSibling") }, prevAll: function (e) { return h(e, "previousSibling") }, nextUntil: function (e, t, n) { return h(e, "nextSibling", n) }, prevUntil: function (e, t, n) { return h(e, "previousSibling", n) }, siblings: function (e) { return T((e.parentNode || {}).firstChild, e) }, children: function (e) { return T(e.firstChild) }, contents: function (e) { return null != e.contentDocument && r(e.contentDocument) ? e.contentDocument : (A(e, "template") && (e = e.content || e), S.merge([], e.childNodes)) } }, function (r, i) { S.fn[r] = function (e, t) { var n = S.map(this, i, e); return "Until" !== r.slice(-5) && (t = e), t && "string" == typeof t && (n = S.filter(t, n)), 1 < this.length && (H[r] || S.uniqueSort(n), L.test(r) && n.reverse()), this.pushStack(n) } }); var P = /[^\x20\t\r\n\f]+/g; function R(e) { return e } function M(e) { throw e } function I(e, t, n, r) { var i; try { e && m(i = e.promise) ? i.call(e).done(t).fail(n) : e && m(i = e.then) ? i.call(e, t, n) : t.apply(void 0, [e].slice(r)) } catch (e) { n.apply(void 0, [e]) } } S.Callbacks = function (r) { var e, n; r = "string" == typeof r ? (e = r, n = {}, S.each(e.match(P) || [], function (e, t) { n[t] = !0 }), n) : S.extend({}, r); var i, t, o, a, s = [], u = [], l = -1, c = function () { for (a = a || r.once, o = i = !0; u.length; l = -1) { t = u.shift(); while (++l < s.length) !1 === s[l].apply(t[0], t[1]) && r.stopOnFalse && (l = s.length, t = !1) } r.memory || (t = !1), i = !1, a && (s = t ? [] : "") }, f = { add: function () { return s && (t && !i && (l = s.length - 1, u.push(t)), function n(e) { S.each(e, function (e, t) { m(t) ? r.unique && f.has(t) || s.push(t) : t && t.length && "string" !== w(t) && n(t) }) }(arguments), t && !i && c()), this }, remove: function () { return S.each(arguments, function (e, t) { var n; while (-1 < (n = S.inArray(t, s, n))) s.splice(n, 1), n <= l && l-- }), this }, has: function (e) { return e ? -1 < S.inArray(e, s) : 0 < s.length }, empty: function () { return s && (s = []), this }, disable: function () { return a = u = [], s = t = "", this }, disabled: function () { return !s }, lock: function () { return a = u = [], t || i || (s = t = ""), this }, locked: function () { return !!a }, fireWith: function (e, t) { return a || (t = [e, (t = t || []).slice ? t.slice() : t], u.push(t), i || c()), this }, fire: function () { return f.fireWith(this, arguments), this }, fired: function () { return !!o } }; return f }, S.extend({ Deferred: function (e) { var o = [["notify", "progress", S.Callbacks("memory"), S.Callbacks("memory"), 2], ["resolve", "done", S.Callbacks("once memory"), S.Callbacks("once memory"), 0, "resolved"], ["reject", "fail", S.Callbacks("once memory"), S.Callbacks("once memory"), 1, "rejected"]], i = "pending", a = { state: function () { return i }, always: function () { return s.done(arguments).fail(arguments), this }, "catch": function (e) { return a.then(null, e) }, pipe: function () { var i = arguments; return S.Deferred(function (r) { S.each(o, function (e, t) { var n = m(i[t[4]]) && i[t[4]]; s[t[1]](function () { var e = n && n.apply(this, arguments); e && m(e.promise) ? e.promise().progress(r.notify).done(r.resolve).fail(r.reject) : r[t[0] + "With"](this, n ? [e] : arguments) }) }), i = null }).promise() }, then: function (t, n, r) { var u = 0; function l(i, o, a, s) { return function () { var n = this, r = arguments, e = function () { var e, t; if (!(i < u)) { if ((e = a.apply(n, r)) === o.promise()) throw new TypeError("Thenable self-resolution"); t = e && ("object" == typeof e || "function" == typeof e) && e.then, m(t) ? s ? t.call(e, l(u, o, R, s), l(u, o, M, s)) : (u++, t.call(e, l(u, o, R, s), l(u, o, M, s), l(u, o, R, o.notifyWith))) : (a !== R && (n = void 0, r = [e]), (s || o.resolveWith)(n, r)) } }, t = s ? e : function () { try { e() } catch (e) { S.Deferred.exceptionHook && S.Deferred.exceptionHook(e, t.stackTrace), u <= i + 1 && (a !== M && (n = void 0, r = [e]), o.rejectWith(n, r)) } }; i ? t() : (S.Deferred.getStackHook && (t.stackTrace = S.Deferred.getStackHook()), C.setTimeout(t)) } } return S.Deferred(function (e) { o[0][3].add(l(0, e, m(r) ? r : R, e.notifyWith)), o[1][3].add(l(0, e, m(t) ? t : R)), o[2][3].add(l(0, e, m(n) ? n : M)) }).promise() }, promise: function (e) { return null != e ? S.extend(e, a) : a } }, s = {}; return S.each(o, function (e, t) { var n = t[2], r = t[5]; a[t[1]] = n.add, r && n.add(function () { i = r }, o[3 - e][2].disable, o[3 - e][3].disable, o[0][2].lock, o[0][3].lock), n.add(t[3].fire), s[t[0]] = function () { return s[t[0] + "With"](this === s ? void 0 : this, arguments), this }, s[t[0] + "With"] = n.fireWith }), a.promise(s), e && e.call(s, s), s }, when: function (e) { var n = arguments.length, t = n, r = Array(t), i = s.call(arguments), o = S.Deferred(), a = function (t) { return function (e) { r[t] = this, i[t] = 1 < arguments.length ? s.call(arguments) : e, --n || o.resolveWith(r, i) } }; if (n <= 1 && (I(e, o.done(a(t)).resolve, o.reject, !n), "pending" === o.state() || m(i[t] && i[t].then))) return o.then(); while (t--) I(i[t], a(t), o.reject); return o.promise() } }); var W = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; S.Deferred.exceptionHook = function (e, t) { C.console && C.console.warn && e && W.test(e.name) && C.console.warn("jQuery.Deferred exception: " + e.message, e.stack, t) }, S.readyException = function (e) { C.setTimeout(function () { throw e }) }; var F = S.Deferred(); function B() { E.removeEventListener("DOMContentLoaded", B), C.removeEventListener("load", B), S.ready() } S.fn.ready = function (e) { return F.then(e)["catch"](function (e) { S.readyException(e) }), this }, S.extend({ isReady: !1, readyWait: 1, ready: function (e) { (!0 === e ? --S.readyWait : S.isReady) || (S.isReady = !0) !== e && 0 < --S.readyWait || F.resolveWith(E, [S]) } }), S.ready.then = F.then, "complete" === E.readyState || "loading" !== E.readyState && !E.documentElement.doScroll ? C.setTimeout(S.ready) : (E.addEventListener("DOMContentLoaded", B), C.addEventListener("load", B)); var $ = function (e, t, n, r, i, o, a) { var s = 0, u = e.length, l = null == n; if ("object" === w(n)) for (s in i = !0, n) $(e, t, s, n[s], !0, o, a); else if (void 0 !== r && (i = !0, m(r) || (a = !0), l && (a ? (t.call(e, r), t = null) : (l = t, t = function (e, t, n) { return l.call(S(e), n) })), t)) for (; s < u; s++)t(e[s], n, a ? r : r.call(e[s], s, t(e[s], n))); return i ? e : l ? t.call(e) : u ? t(e[0], n) : o }, _ = /^-ms-/, z = /-([a-z])/g; function U(e, t) { return t.toUpperCase() } function X(e) { return e.replace(_, "ms-").replace(z, U) } var V = function (e) { return 1 === e.nodeType || 9 === e.nodeType || !+e.nodeType }; function G() { this.expando = S.expando + G.uid++ } G.uid = 1, G.prototype = { cache: function (e) { var t = e[this.expando]; return t || (t = {}, V(e) && (e.nodeType ? e[this.expando] = t : Object.defineProperty(e, this.expando, { value: t, configurable: !0 }))), t }, set: function (e, t, n) { var r, i = this.cache(e); if ("string" == typeof t) i[X(t)] = n; else for (r in t) i[X(r)] = t[r]; return i }, get: function (e, t) { return void 0 === t ? this.cache(e) : e[this.expando] && e[this.expando][X(t)] }, access: function (e, t, n) { return void 0 === t || t && "string" == typeof t && void 0 === n ? this.get(e, t) : (this.set(e, t, n), void 0 !== n ? n : t) }, remove: function (e, t) { var n, r = e[this.expando]; if (void 0 !== r) { if (void 0 !== t) { n = (t = Array.isArray(t) ? t.map(X) : (t = X(t)) in r ? [t] : t.match(P) || []).length; while (n--) delete r[t[n]] } (void 0 === t || S.isEmptyObject(r)) && (e.nodeType ? e[this.expando] = void 0 : delete e[this.expando]) } }, hasData: function (e) { var t = e[this.expando]; return void 0 !== t && !S.isEmptyObject(t) } }; var Y = new G, Q = new G, J = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, K = /[A-Z]/g; function Z(e, t, n) { var r, i; if (void 0 === n && 1 === e.nodeType) if (r = "data-" + t.replace(K, "-$&").toLowerCase(), "string" == typeof (n = e.getAttribute(r))) { try { n = "true" === (i = n) || "false" !== i && ("null" === i ? null : i === +i + "" ? +i : J.test(i) ? JSON.parse(i) : i) } catch (e) { } Q.set(e, t, n) } else n = void 0; return n } S.extend({ hasData: function (e) { return Q.hasData(e) || Y.hasData(e) }, data: function (e, t, n) { return Q.access(e, t, n) }, removeData: function (e, t) { Q.remove(e, t) }, _data: function (e, t, n) { return Y.access(e, t, n) }, _removeData: function (e, t) { Y.remove(e, t) } }), S.fn.extend({ data: function (n, e) { var t, r, i, o = this[0], a = o && o.attributes; if (void 0 === n) { if (this.length && (i = Q.get(o), 1 === o.nodeType && !Y.get(o, "hasDataAttrs"))) { t = a.length; while (t--) a[t] && 0 === (r = a[t].name).indexOf("data-") && (r = X(r.slice(5)), Z(o, r, i[r])); Y.set(o, "hasDataAttrs", !0) } return i } return "object" == typeof n ? this.each(function () { Q.set(this, n) }) : $(this, function (e) { var t; if (o && void 0 === e) return void 0 !== (t = Q.get(o, n)) ? t : void 0 !== (t = Z(o, n)) ? t : void 0; this.each(function () { Q.set(this, n, e) }) }, null, e, 1 < arguments.length, null, !0) }, removeData: function (e) { return this.each(function () { Q.remove(this, e) }) } }), S.extend({ queue: function (e, t, n) { var r; if (e) return t = (t || "fx") + "queue", r = Y.get(e, t), n && (!r || Array.isArray(n) ? r = Y.access(e, t, S.makeArray(n)) : r.push(n)), r || [] }, dequeue: function (e, t) { t = t || "fx"; var n = S.queue(e, t), r = n.length, i = n.shift(), o = S._queueHooks(e, t); "inprogress" === i && (i = n.shift(), r--), i && ("fx" === t && n.unshift("inprogress"), delete o.stop, i.call(e, function () { S.dequeue(e, t) }, o)), !r && o && o.empty.fire() }, _queueHooks: function (e, t) { var n = t + "queueHooks"; return Y.get(e, n) || Y.access(e, n, { empty: S.Callbacks("once memory").add(function () { Y.remove(e, [t + "queue", n]) }) }) } }), S.fn.extend({ queue: function (t, n) { var e = 2; return "string" != typeof t && (n = t, t = "fx", e--), arguments.length < e ? S.queue(this[0], t) : void 0 === n ? this : this.each(function () { var e = S.queue(this, t, n); S._queueHooks(this, t), "fx" === t && "inprogress" !== e[0] && S.dequeue(this, t) }) }, dequeue: function (e) { return this.each(function () { S.dequeue(this, e) }) }, clearQueue: function (e) { return this.queue(e || "fx", []) }, promise: function (e, t) { var n, r = 1, i = S.Deferred(), o = this, a = this.length, s = function () { --r || i.resolveWith(o, [o]) }; "string" != typeof e && (t = e, e = void 0), e = e || "fx"; while (a--) (n = Y.get(o[a], e + "queueHooks")) && n.empty && (r++, n.empty.add(s)); return s(), i.promise(t) } }); var ee = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, te = new RegExp("^(?:([+-])=|)(" + ee + ")([a-z%]*)$", "i"), ne = ["Top", "Right", "Bottom", "Left"], re = E.documentElement, ie = function (e) { return S.contains(e.ownerDocument, e) }, oe = { composed: !0 }; re.getRootNode && (ie = function (e) { return S.contains(e.ownerDocument, e) || e.getRootNode(oe) === e.ownerDocument }); var ae = function (e, t) { return "none" === (e = t || e).style.display || "" === e.style.display && ie(e) && "none" === S.css(e, "display") }; function se(e, t, n, r) { var i, o, a = 20, s = r ? function () { return r.cur() } : function () { return S.css(e, t, "") }, u = s(), l = n && n[3] || (S.cssNumber[t] ? "" : "px"), c = e.nodeType && (S.cssNumber[t] || "px" !== l && +u) && te.exec(S.css(e, t)); if (c && c[3] !== l) { u /= 2, l = l || c[3], c = +u || 1; while (a--) S.style(e, t, c + l), (1 - o) * (1 - (o = s() / u || .5)) <= 0 && (a = 0), c /= o; c *= 2, S.style(e, t, c + l), n = n || [] } return n && (c = +c || +u || 0, i = n[1] ? c + (n[1] + 1) * n[2] : +n[2], r && (r.unit = l, r.start = c, r.end = i)), i } var ue = {}; function le(e, t) { for (var n, r, i, o, a, s, u, l = [], c = 0, f = e.length; c < f; c++)(r = e[c]).style && (n = r.style.display, t ? ("none" === n && (l[c] = Y.get(r, "display") || null, l[c] || (r.style.display = "")), "" === r.style.display && ae(r) && (l[c] = (u = a = o = void 0, a = (i = r).ownerDocument, s = i.nodeName, (u = ue[s]) || (o = a.body.appendChild(a.createElement(s)), u = S.css(o, "display"), o.parentNode.removeChild(o), "none" === u && (u = "block"), ue[s] = u)))) : "none" !== n && (l[c] = "none", Y.set(r, "display", n))); for (c = 0; c < f; c++)null != l[c] && (e[c].style.display = l[c]); return e } S.fn.extend({ show: function () { return le(this, !0) }, hide: function () { return le(this) }, toggle: function (e) { return "boolean" == typeof e ? e ? this.show() : this.hide() : this.each(function () { ae(this) ? S(this).show() : S(this).hide() }) } }); var ce, fe, pe = /^(?:checkbox|radio)$/i, de = /<([a-z][^\/\0>\x20\t\r\n\f]*)/i, he = /^$|^module$|\/(?:java|ecma)script/i; ce = E.createDocumentFragment().appendChild(E.createElement("div")), (fe = E.createElement("input")).setAttribute("type", "radio"), fe.setAttribute("checked", "checked"), fe.setAttribute("name", "t"), ce.appendChild(fe), y.checkClone = ce.cloneNode(!0).cloneNode(!0).lastChild.checked, ce.innerHTML = "", y.noCloneChecked = !!ce.cloneNode(!0).lastChild.defaultValue, ce.innerHTML = "", y.option = !!ce.lastChild; var ge = { thead: [1, "", "
"], col: [2, "", "
"], tr: [2, "", "
"], td: [3, "", "
"], _default: [0, "", ""] }; function ve(e, t) { var n; return n = "undefined" != typeof e.getElementsByTagName ? e.getElementsByTagName(t || "*") : "undefined" != typeof e.querySelectorAll ? e.querySelectorAll(t || "*") : [], void 0 === t || t && A(e, t) ? S.merge([e], n) : n } function ye(e, t) { for (var n = 0, r = e.length; n < r; n++)Y.set(e[n], "globalEval", !t || Y.get(t[n], "globalEval")) } ge.tbody = ge.tfoot = ge.colgroup = ge.caption = ge.thead, ge.th = ge.td, y.option || (ge.optgroup = ge.option = [1, ""]); var me = /<|&#?\w+;/; function xe(e, t, n, r, i) { for (var o, a, s, u, l, c, f = t.createDocumentFragment(), p = [], d = 0, h = e.length; d < h; d++)if ((o = e[d]) || 0 === o) if ("object" === w(o)) S.merge(p, o.nodeType ? [o] : o); else if (me.test(o)) { a = a || f.appendChild(t.createElement("div")), s = (de.exec(o) || ["", ""])[1].toLowerCase(), u = ge[s] || ge._default, a.innerHTML = u[1] + S.htmlPrefilter(o) + u[2], c = u[0]; while (c--) a = a.lastChild; S.merge(p, a.childNodes), (a = f.firstChild).textContent = "" } else p.push(t.createTextNode(o)); f.textContent = "", d = 0; while (o = p[d++]) if (r && -1 < S.inArray(o, r)) i && i.push(o); else if (l = ie(o), a = ve(f.appendChild(o), "script"), l && ye(a), n) { c = 0; while (o = a[c++]) he.test(o.type || "") && n.push(o) } return f } var be = /^([^.]*)(?:\.(.+)|)/; function we() { return !0 } function Te() { return !1 } function Ce(e, t) { return e === function () { try { return E.activeElement } catch (e) { } }() == ("focus" === t) } function Ee(e, t, n, r, i, o) { var a, s; if ("object" == typeof t) { for (s in "string" != typeof n && (r = r || n, n = void 0), t) Ee(e, s, n, r, t[s], o); return e } if (null == r && null == i ? (i = n, r = n = void 0) : null == i && ("string" == typeof n ? (i = r, r = void 0) : (i = r, r = n, n = void 0)), !1 === i) i = Te; else if (!i) return e; return 1 === o && (a = i, (i = function (e) { return S().off(e), a.apply(this, arguments) }).guid = a.guid || (a.guid = S.guid++)), e.each(function () { S.event.add(this, t, i, r, n) }) } function Se(e, i, o) { o ? (Y.set(e, i, !1), S.event.add(e, i, { namespace: !1, handler: function (e) { var t, n, r = Y.get(this, i); if (1 & e.isTrigger && this[i]) { if (r.length) (S.event.special[i] || {}).delegateType && e.stopPropagation(); else if (r = s.call(arguments), Y.set(this, i, r), t = o(this, i), this[i](), r !== (n = Y.get(this, i)) || t ? Y.set(this, i, !1) : n = {}, r !== n) return e.stopImmediatePropagation(), e.preventDefault(), n && n.value } else r.length && (Y.set(this, i, { value: S.event.trigger(S.extend(r[0], S.Event.prototype), r.slice(1), this) }), e.stopImmediatePropagation()) } })) : void 0 === Y.get(e, i) && S.event.add(e, i, we) } S.event = { global: {}, add: function (t, e, n, r, i) { var o, a, s, u, l, c, f, p, d, h, g, v = Y.get(t); if (V(t)) { n.handler && (n = (o = n).handler, i = o.selector), i && S.find.matchesSelector(re, i), n.guid || (n.guid = S.guid++), (u = v.events) || (u = v.events = Object.create(null)), (a = v.handle) || (a = v.handle = function (e) { return "undefined" != typeof S && S.event.triggered !== e.type ? S.event.dispatch.apply(t, arguments) : void 0 }), l = (e = (e || "").match(P) || [""]).length; while (l--) d = g = (s = be.exec(e[l]) || [])[1], h = (s[2] || "").split(".").sort(), d && (f = S.event.special[d] || {}, d = (i ? f.delegateType : f.bindType) || d, f = S.event.special[d] || {}, c = S.extend({ type: d, origType: g, data: r, handler: n, guid: n.guid, selector: i, needsContext: i && S.expr.match.needsContext.test(i), namespace: h.join(".") }, o), (p = u[d]) || ((p = u[d] = []).delegateCount = 0, f.setup && !1 !== f.setup.call(t, r, h, a) || t.addEventListener && t.addEventListener(d, a)), f.add && (f.add.call(t, c), c.handler.guid || (c.handler.guid = n.guid)), i ? p.splice(p.delegateCount++, 0, c) : p.push(c), S.event.global[d] = !0) } }, remove: function (e, t, n, r, i) { var o, a, s, u, l, c, f, p, d, h, g, v = Y.hasData(e) && Y.get(e); if (v && (u = v.events)) { l = (t = (t || "").match(P) || [""]).length; while (l--) if (d = g = (s = be.exec(t[l]) || [])[1], h = (s[2] || "").split(".").sort(), d) { f = S.event.special[d] || {}, p = u[d = (r ? f.delegateType : f.bindType) || d] || [], s = s[2] && new RegExp("(^|\\.)" + h.join("\\.(?:.*\\.|)") + "(\\.|$)"), a = o = p.length; while (o--) c = p[o], !i && g !== c.origType || n && n.guid !== c.guid || s && !s.test(c.namespace) || r && r !== c.selector && ("**" !== r || !c.selector) || (p.splice(o, 1), c.selector && p.delegateCount--, f.remove && f.remove.call(e, c)); a && !p.length && (f.teardown && !1 !== f.teardown.call(e, h, v.handle) || S.removeEvent(e, d, v.handle), delete u[d]) } else for (d in u) S.event.remove(e, d + t[l], n, r, !0); S.isEmptyObject(u) && Y.remove(e, "handle events") } }, dispatch: function (e) { var t, n, r, i, o, a, s = new Array(arguments.length), u = S.event.fix(e), l = (Y.get(this, "events") || Object.create(null))[u.type] || [], c = S.event.special[u.type] || {}; for (s[0] = u, t = 1; t < arguments.length; t++)s[t] = arguments[t]; if (u.delegateTarget = this, !c.preDispatch || !1 !== c.preDispatch.call(this, u)) { a = S.event.handlers.call(this, u, l), t = 0; while ((i = a[t++]) && !u.isPropagationStopped()) { u.currentTarget = i.elem, n = 0; while ((o = i.handlers[n++]) && !u.isImmediatePropagationStopped()) u.rnamespace && !1 !== o.namespace && !u.rnamespace.test(o.namespace) || (u.handleObj = o, u.data = o.data, void 0 !== (r = ((S.event.special[o.origType] || {}).handle || o.handler).apply(i.elem, s)) && !1 === (u.result = r) && (u.preventDefault(), u.stopPropagation())) } return c.postDispatch && c.postDispatch.call(this, u), u.result } }, handlers: function (e, t) { var n, r, i, o, a, s = [], u = t.delegateCount, l = e.target; if (u && l.nodeType && !("click" === e.type && 1 <= e.button)) for (; l !== this; l = l.parentNode || this)if (1 === l.nodeType && ("click" !== e.type || !0 !== l.disabled)) { for (o = [], a = {}, n = 0; n < u; n++)void 0 === a[i = (r = t[n]).selector + " "] && (a[i] = r.needsContext ? -1 < S(i, this).index(l) : S.find(i, this, null, [l]).length), a[i] && o.push(r); o.length && s.push({ elem: l, handlers: o }) } return l = this, u < t.length && s.push({ elem: l, handlers: t.slice(u) }), s }, addProp: function (t, e) { Object.defineProperty(S.Event.prototype, t, { enumerable: !0, configurable: !0, get: m(e) ? function () { if (this.originalEvent) return e(this.originalEvent) } : function () { if (this.originalEvent) return this.originalEvent[t] }, set: function (e) { Object.defineProperty(this, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) } }) }, fix: function (e) { return e[S.expando] ? e : new S.Event(e) }, special: { load: { noBubble: !0 }, click: { setup: function (e) { var t = this || e; return pe.test(t.type) && t.click && A(t, "input") && Se(t, "click", we), !1 }, trigger: function (e) { var t = this || e; return pe.test(t.type) && t.click && A(t, "input") && Se(t, "click"), !0 }, _default: function (e) { var t = e.target; return pe.test(t.type) && t.click && A(t, "input") && Y.get(t, "click") || A(t, "a") } }, beforeunload: { postDispatch: function (e) { void 0 !== e.result && e.originalEvent && (e.originalEvent.returnValue = e.result) } } } }, S.removeEvent = function (e, t, n) { e.removeEventListener && e.removeEventListener(t, n) }, S.Event = function (e, t) { if (!(this instanceof S.Event)) return new S.Event(e, t); e && e.type ? (this.originalEvent = e, this.type = e.type, this.isDefaultPrevented = e.defaultPrevented || void 0 === e.defaultPrevented && !1 === e.returnValue ? we : Te, this.target = e.target && 3 === e.target.nodeType ? e.target.parentNode : e.target, this.currentTarget = e.currentTarget, this.relatedTarget = e.relatedTarget) : this.type = e, t && S.extend(this, t), this.timeStamp = e && e.timeStamp || Date.now(), this[S.expando] = !0 }, S.Event.prototype = { constructor: S.Event, isDefaultPrevented: Te, isPropagationStopped: Te, isImmediatePropagationStopped: Te, isSimulated: !1, preventDefault: function () { var e = this.originalEvent; this.isDefaultPrevented = we, e && !this.isSimulated && e.preventDefault() }, stopPropagation: function () { var e = this.originalEvent; this.isPropagationStopped = we, e && !this.isSimulated && e.stopPropagation() }, stopImmediatePropagation: function () { var e = this.originalEvent; this.isImmediatePropagationStopped = we, e && !this.isSimulated && e.stopImmediatePropagation(), this.stopPropagation() } }, S.each({ altKey: !0, bubbles: !0, cancelable: !0, changedTouches: !0, ctrlKey: !0, detail: !0, eventPhase: !0, metaKey: !0, pageX: !0, pageY: !0, shiftKey: !0, view: !0, "char": !0, code: !0, charCode: !0, key: !0, keyCode: !0, button: !0, buttons: !0, clientX: !0, clientY: !0, offsetX: !0, offsetY: !0, pointerId: !0, pointerType: !0, screenX: !0, screenY: !0, targetTouches: !0, toElement: !0, touches: !0, which: !0 }, S.event.addProp), S.each({ focus: "focusin", blur: "focusout" }, function (e, t) { S.event.special[e] = { setup: function () { return Se(this, e, Ce), !1 }, trigger: function () { return Se(this, e), !0 }, _default: function () { return !0 }, delegateType: t } }), S.each({ mouseenter: "mouseover", mouseleave: "mouseout", pointerenter: "pointerover", pointerleave: "pointerout" }, function (e, i) { S.event.special[e] = { delegateType: i, bindType: i, handle: function (e) { var t, n = e.relatedTarget, r = e.handleObj; return n && (n === this || S.contains(this, n)) || (e.type = r.origType, t = r.handler.apply(this, arguments), e.type = i), t } } }), S.fn.extend({ on: function (e, t, n, r) { return Ee(this, e, t, n, r) }, one: function (e, t, n, r) { return Ee(this, e, t, n, r, 1) }, off: function (e, t, n) { var r, i; if (e && e.preventDefault && e.handleObj) return r = e.handleObj, S(e.delegateTarget).off(r.namespace ? r.origType + "." + r.namespace : r.origType, r.selector, r.handler), this; if ("object" == typeof e) { for (i in e) this.off(i, t, e[i]); return this } return !1 !== t && "function" != typeof t || (n = t, t = void 0), !1 === n && (n = Te), this.each(function () { S.event.remove(this, e, n, t) }) } }); var ke = /\s*$/g; function je(e, t) { return A(e, "table") && A(11 !== t.nodeType ? t : t.firstChild, "tr") && S(e).children("tbody")[0] || e } function De(e) { return e.type = (null !== e.getAttribute("type")) + "/" + e.type, e } function qe(e) { return "true/" === (e.type || "").slice(0, 5) ? e.type = e.type.slice(5) : e.removeAttribute("type"), e } function Le(e, t) { var n, r, i, o, a, s; if (1 === t.nodeType) { if (Y.hasData(e) && (s = Y.get(e).events)) for (i in Y.remove(t, "handle events"), s) for (n = 0, r = s[i].length; n < r; n++)S.event.add(t, i, s[i][n]); Q.hasData(e) && (o = Q.access(e), a = S.extend({}, o), Q.set(t, a)) } } function He(n, r, i, o) { r = g(r); var e, t, a, s, u, l, c = 0, f = n.length, p = f - 1, d = r[0], h = m(d); if (h || 1 < f && "string" == typeof d && !y.checkClone && Ae.test(d)) return n.each(function (e) { var t = n.eq(e); h && (r[0] = d.call(this, e, t.html())), He(t, r, i, o) }); if (f && (t = (e = xe(r, n[0].ownerDocument, !1, n, o)).firstChild, 1 === e.childNodes.length && (e = t), t || o)) { for (s = (a = S.map(ve(e, "script"), De)).length; c < f; c++)u = e, c !== p && (u = S.clone(u, !0, !0), s && S.merge(a, ve(u, "script"))), i.call(n[c], u, c); if (s) for (l = a[a.length - 1].ownerDocument, S.map(a, qe), c = 0; c < s; c++)u = a[c], he.test(u.type || "") && !Y.access(u, "globalEval") && S.contains(l, u) && (u.src && "module" !== (u.type || "").toLowerCase() ? S._evalUrl && !u.noModule && S._evalUrl(u.src, { nonce: u.nonce || u.getAttribute("nonce") }, l) : b(u.textContent.replace(Ne, ""), u, l)) } return n } function Oe(e, t, n) { for (var r, i = t ? S.filter(t, e) : e, o = 0; null != (r = i[o]); o++)n || 1 !== r.nodeType || S.cleanData(ve(r)), r.parentNode && (n && ie(r) && ye(ve(r, "script")), r.parentNode.removeChild(r)); return e } S.extend({ htmlPrefilter: function (e) { return e }, clone: function (e, t, n) { var r, i, o, a, s, u, l, c = e.cloneNode(!0), f = ie(e); if (!(y.noCloneChecked || 1 !== e.nodeType && 11 !== e.nodeType || S.isXMLDoc(e))) for (a = ve(c), r = 0, i = (o = ve(e)).length; r < i; r++)s = o[r], u = a[r], void 0, "input" === (l = u.nodeName.toLowerCase()) && pe.test(s.type) ? u.checked = s.checked : "input" !== l && "textarea" !== l || (u.defaultValue = s.defaultValue); if (t) if (n) for (o = o || ve(e), a = a || ve(c), r = 0, i = o.length; r < i; r++)Le(o[r], a[r]); else Le(e, c); return 0 < (a = ve(c, "script")).length && ye(a, !f && ve(e, "script")), c }, cleanData: function (e) { for (var t, n, r, i = S.event.special, o = 0; void 0 !== (n = e[o]); o++)if (V(n)) { if (t = n[Y.expando]) { if (t.events) for (r in t.events) i[r] ? S.event.remove(n, r) : S.removeEvent(n, r, t.handle); n[Y.expando] = void 0 } n[Q.expando] && (n[Q.expando] = void 0) } } }), S.fn.extend({ detach: function (e) { return Oe(this, e, !0) }, remove: function (e) { return Oe(this, e) }, text: function (e) { return $(this, function (e) { return void 0 === e ? S.text(this) : this.empty().each(function () { 1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || (this.textContent = e) }) }, null, e, arguments.length) }, append: function () { return He(this, arguments, function (e) { 1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || je(this, e).appendChild(e) }) }, prepend: function () { return He(this, arguments, function (e) { if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { var t = je(this, e); t.insertBefore(e, t.firstChild) } }) }, before: function () { return He(this, arguments, function (e) { this.parentNode && this.parentNode.insertBefore(e, this) }) }, after: function () { return He(this, arguments, function (e) { this.parentNode && this.parentNode.insertBefore(e, this.nextSibling) }) }, empty: function () { for (var e, t = 0; null != (e = this[t]); t++)1 === e.nodeType && (S.cleanData(ve(e, !1)), e.textContent = ""); return this }, clone: function (e, t) { return e = null != e && e, t = null == t ? e : t, this.map(function () { return S.clone(this, e, t) }) }, html: function (e) { return $(this, function (e) { var t = this[0] || {}, n = 0, r = this.length; if (void 0 === e && 1 === t.nodeType) return t.innerHTML; if ("string" == typeof e && !ke.test(e) && !ge[(de.exec(e) || ["", ""])[1].toLowerCase()]) { e = S.htmlPrefilter(e); try { for (; n < r; n++)1 === (t = this[n] || {}).nodeType && (S.cleanData(ve(t, !1)), t.innerHTML = e); t = 0 } catch (e) { } } t && this.empty().append(e) }, null, e, arguments.length) }, replaceWith: function () { var n = []; return He(this, arguments, function (e) { var t = this.parentNode; S.inArray(this, n) < 0 && (S.cleanData(ve(this)), t && t.replaceChild(e, this)) }, n) } }), S.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function (e, a) { S.fn[e] = function (e) { for (var t, n = [], r = S(e), i = r.length - 1, o = 0; o <= i; o++)t = o === i ? this : this.clone(!0), S(r[o])[a](t), u.apply(n, t.get()); return this.pushStack(n) } }); var Pe = new RegExp("^(" + ee + ")(?!px)[a-z%]+$", "i"), Re = function (e) { var t = e.ownerDocument.defaultView; return t && t.opener || (t = C), t.getComputedStyle(e) }, Me = function (e, t, n) { var r, i, o = {}; for (i in t) o[i] = e.style[i], e.style[i] = t[i]; for (i in r = n.call(e), t) e.style[i] = o[i]; return r }, Ie = new RegExp(ne.join("|"), "i"); function We(e, t, n) { var r, i, o, a, s = e.style; return (n = n || Re(e)) && ("" !== (a = n.getPropertyValue(t) || n[t]) || ie(e) || (a = S.style(e, t)), !y.pixelBoxStyles() && Pe.test(a) && Ie.test(t) && (r = s.width, i = s.minWidth, o = s.maxWidth, s.minWidth = s.maxWidth = s.width = a, a = n.width, s.width = r, s.minWidth = i, s.maxWidth = o)), void 0 !== a ? a + "" : a } function Fe(e, t) { return { get: function () { if (!e()) return (this.get = t).apply(this, arguments); delete this.get } } } !function () { function e() { if (l) { u.style.cssText = "position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0", l.style.cssText = "position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%", re.appendChild(u).appendChild(l); var e = C.getComputedStyle(l); n = "1%" !== e.top, s = 12 === t(e.marginLeft), l.style.right = "60%", o = 36 === t(e.right), r = 36 === t(e.width), l.style.position = "absolute", i = 12 === t(l.offsetWidth / 3), re.removeChild(u), l = null } } function t(e) { return Math.round(parseFloat(e)) } var n, r, i, o, a, s, u = E.createElement("div"), l = E.createElement("div"); l.style && (l.style.backgroundClip = "content-box", l.cloneNode(!0).style.backgroundClip = "", y.clearCloneStyle = "content-box" === l.style.backgroundClip, S.extend(y, { boxSizingReliable: function () { return e(), r }, pixelBoxStyles: function () { return e(), o }, pixelPosition: function () { return e(), n }, reliableMarginLeft: function () { return e(), s }, scrollboxSize: function () { return e(), i }, reliableTrDimensions: function () { var e, t, n, r; return null == a && (e = E.createElement("table"), t = E.createElement("tr"), n = E.createElement("div"), e.style.cssText = "position:absolute;left:-11111px;border-collapse:separate", t.style.cssText = "border:1px solid", t.style.height = "1px", n.style.height = "9px", n.style.display = "block", re.appendChild(e).appendChild(t).appendChild(n), r = C.getComputedStyle(t), a = parseInt(r.height, 10) + parseInt(r.borderTopWidth, 10) + parseInt(r.borderBottomWidth, 10) === t.offsetHeight, re.removeChild(e)), a } })) }(); var Be = ["Webkit", "Moz", "ms"], $e = E.createElement("div").style, _e = {}; function ze(e) { var t = S.cssProps[e] || _e[e]; return t || (e in $e ? e : _e[e] = function (e) { var t = e[0].toUpperCase() + e.slice(1), n = Be.length; while (n--) if ((e = Be[n] + t) in $e) return e }(e) || e) } var Ue = /^(none|table(?!-c[ea]).+)/, Xe = /^--/, Ve = { position: "absolute", visibility: "hidden", display: "block" }, Ge = { letterSpacing: "0", fontWeight: "400" }; function Ye(e, t, n) { var r = te.exec(t); return r ? Math.max(0, r[2] - (n || 0)) + (r[3] || "px") : t } function Qe(e, t, n, r, i, o) { var a = "width" === t ? 1 : 0, s = 0, u = 0; if (n === (r ? "border" : "content")) return 0; for (; a < 4; a += 2)"margin" === n && (u += S.css(e, n + ne[a], !0, i)), r ? ("content" === n && (u -= S.css(e, "padding" + ne[a], !0, i)), "margin" !== n && (u -= S.css(e, "border" + ne[a] + "Width", !0, i))) : (u += S.css(e, "padding" + ne[a], !0, i), "padding" !== n ? u += S.css(e, "border" + ne[a] + "Width", !0, i) : s += S.css(e, "border" + ne[a] + "Width", !0, i)); return !r && 0 <= o && (u += Math.max(0, Math.ceil(e["offset" + t[0].toUpperCase() + t.slice(1)] - o - u - s - .5)) || 0), u } function Je(e, t, n) { var r = Re(e), i = (!y.boxSizingReliable() || n) && "border-box" === S.css(e, "boxSizing", !1, r), o = i, a = We(e, t, r), s = "offset" + t[0].toUpperCase() + t.slice(1); if (Pe.test(a)) { if (!n) return a; a = "auto" } return (!y.boxSizingReliable() && i || !y.reliableTrDimensions() && A(e, "tr") || "auto" === a || !parseFloat(a) && "inline" === S.css(e, "display", !1, r)) && e.getClientRects().length && (i = "border-box" === S.css(e, "boxSizing", !1, r), (o = s in e) && (a = e[s])), (a = parseFloat(a) || 0) + Qe(e, t, n || (i ? "border" : "content"), o, r, a) + "px" } function Ke(e, t, n, r, i) { return new Ke.prototype.init(e, t, n, r, i) } S.extend({ cssHooks: { opacity: { get: function (e, t) { if (t) { var n = We(e, "opacity"); return "" === n ? "1" : n } } } }, cssNumber: { animationIterationCount: !0, columnCount: !0, fillOpacity: !0, flexGrow: !0, flexShrink: !0, fontWeight: !0, gridArea: !0, gridColumn: !0, gridColumnEnd: !0, gridColumnStart: !0, gridRow: !0, gridRowEnd: !0, gridRowStart: !0, lineHeight: !0, opacity: !0, order: !0, orphans: !0, widows: !0, zIndex: !0, zoom: !0 }, cssProps: {}, style: function (e, t, n, r) { if (e && 3 !== e.nodeType && 8 !== e.nodeType && e.style) { var i, o, a, s = X(t), u = Xe.test(t), l = e.style; if (u || (t = ze(s)), a = S.cssHooks[t] || S.cssHooks[s], void 0 === n) return a && "get" in a && void 0 !== (i = a.get(e, !1, r)) ? i : l[t]; "string" === (o = typeof n) && (i = te.exec(n)) && i[1] && (n = se(e, t, i), o = "number"), null != n && n == n && ("number" !== o || u || (n += i && i[3] || (S.cssNumber[s] ? "" : "px")), y.clearCloneStyle || "" !== n || 0 !== t.indexOf("background") || (l[t] = "inherit"), a && "set" in a && void 0 === (n = a.set(e, n, r)) || (u ? l.setProperty(t, n) : l[t] = n)) } }, css: function (e, t, n, r) { var i, o, a, s = X(t); return Xe.test(t) || (t = ze(s)), (a = S.cssHooks[t] || S.cssHooks[s]) && "get" in a && (i = a.get(e, !0, n)), void 0 === i && (i = We(e, t, r)), "normal" === i && t in Ge && (i = Ge[t]), "" === n || n ? (o = parseFloat(i), !0 === n || isFinite(o) ? o || 0 : i) : i } }), S.each(["height", "width"], function (e, u) { S.cssHooks[u] = { get: function (e, t, n) { if (t) return !Ue.test(S.css(e, "display")) || e.getClientRects().length && e.getBoundingClientRect().width ? Je(e, u, n) : Me(e, Ve, function () { return Je(e, u, n) }) }, set: function (e, t, n) { var r, i = Re(e), o = !y.scrollboxSize() && "absolute" === i.position, a = (o || n) && "border-box" === S.css(e, "boxSizing", !1, i), s = n ? Qe(e, u, n, a, i) : 0; return a && o && (s -= Math.ceil(e["offset" + u[0].toUpperCase() + u.slice(1)] - parseFloat(i[u]) - Qe(e, u, "border", !1, i) - .5)), s && (r = te.exec(t)) && "px" !== (r[3] || "px") && (e.style[u] = t, t = S.css(e, u)), Ye(0, t, s) } } }), S.cssHooks.marginLeft = Fe(y.reliableMarginLeft, function (e, t) { if (t) return (parseFloat(We(e, "marginLeft")) || e.getBoundingClientRect().left - Me(e, { marginLeft: 0 }, function () { return e.getBoundingClientRect().left })) + "px" }), S.each({ margin: "", padding: "", border: "Width" }, function (i, o) { S.cssHooks[i + o] = { expand: function (e) { for (var t = 0, n = {}, r = "string" == typeof e ? e.split(" ") : [e]; t < 4; t++)n[i + ne[t] + o] = r[t] || r[t - 2] || r[0]; return n } }, "margin" !== i && (S.cssHooks[i + o].set = Ye) }), S.fn.extend({ css: function (e, t) { return $(this, function (e, t, n) { var r, i, o = {}, a = 0; if (Array.isArray(t)) { for (r = Re(e), i = t.length; a < i; a++)o[t[a]] = S.css(e, t[a], !1, r); return o } return void 0 !== n ? S.style(e, t, n) : S.css(e, t) }, e, t, 1 < arguments.length) } }), ((S.Tween = Ke).prototype = { constructor: Ke, init: function (e, t, n, r, i, o) { this.elem = e, this.prop = n, this.easing = i || S.easing._default, this.options = t, this.start = this.now = this.cur(), this.end = r, this.unit = o || (S.cssNumber[n] ? "" : "px") }, cur: function () { var e = Ke.propHooks[this.prop]; return e && e.get ? e.get(this) : Ke.propHooks._default.get(this) }, run: function (e) { var t, n = Ke.propHooks[this.prop]; return this.options.duration ? this.pos = t = S.easing[this.easing](e, this.options.duration * e, 0, 1, this.options.duration) : this.pos = t = e, this.now = (this.end - this.start) * t + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), n && n.set ? n.set(this) : Ke.propHooks._default.set(this), this } }).init.prototype = Ke.prototype, (Ke.propHooks = { _default: { get: function (e) { var t; return 1 !== e.elem.nodeType || null != e.elem[e.prop] && null == e.elem.style[e.prop] ? e.elem[e.prop] : (t = S.css(e.elem, e.prop, "")) && "auto" !== t ? t : 0 }, set: function (e) { S.fx.step[e.prop] ? S.fx.step[e.prop](e) : 1 !== e.elem.nodeType || !S.cssHooks[e.prop] && null == e.elem.style[ze(e.prop)] ? e.elem[e.prop] = e.now : S.style(e.elem, e.prop, e.now + e.unit) } } }).scrollTop = Ke.propHooks.scrollLeft = { set: function (e) { e.elem.nodeType && e.elem.parentNode && (e.elem[e.prop] = e.now) } }, S.easing = { linear: function (e) { return e }, swing: function (e) { return .5 - Math.cos(e * Math.PI) / 2 }, _default: "swing" }, S.fx = Ke.prototype.init, S.fx.step = {}; var Ze, et, tt, nt, rt = /^(?:toggle|show|hide)$/, it = /queueHooks$/; function ot() { et && (!1 === E.hidden && C.requestAnimationFrame ? C.requestAnimationFrame(ot) : C.setTimeout(ot, S.fx.interval), S.fx.tick()) } function at() { return C.setTimeout(function () { Ze = void 0 }), Ze = Date.now() } function st(e, t) { var n, r = 0, i = { height: e }; for (t = t ? 1 : 0; r < 4; r += 2 - t)i["margin" + (n = ne[r])] = i["padding" + n] = e; return t && (i.opacity = i.width = e), i } function ut(e, t, n) { for (var r, i = (lt.tweeners[t] || []).concat(lt.tweeners["*"]), o = 0, a = i.length; o < a; o++)if (r = i[o].call(n, t, e)) return r } function lt(o, e, t) { var n, a, r = 0, i = lt.prefilters.length, s = S.Deferred().always(function () { delete u.elem }), u = function () { if (a) return !1; for (var e = Ze || at(), t = Math.max(0, l.startTime + l.duration - e), n = 1 - (t / l.duration || 0), r = 0, i = l.tweens.length; r < i; r++)l.tweens[r].run(n); return s.notifyWith(o, [l, n, t]), n < 1 && i ? t : (i || s.notifyWith(o, [l, 1, 0]), s.resolveWith(o, [l]), !1) }, l = s.promise({ elem: o, props: S.extend({}, e), opts: S.extend(!0, { specialEasing: {}, easing: S.easing._default }, t), originalProperties: e, originalOptions: t, startTime: Ze || at(), duration: t.duration, tweens: [], createTween: function (e, t) { var n = S.Tween(o, l.opts, e, t, l.opts.specialEasing[e] || l.opts.easing); return l.tweens.push(n), n }, stop: function (e) { var t = 0, n = e ? l.tweens.length : 0; if (a) return this; for (a = !0; t < n; t++)l.tweens[t].run(1); return e ? (s.notifyWith(o, [l, 1, 0]), s.resolveWith(o, [l, e])) : s.rejectWith(o, [l, e]), this } }), c = l.props; for (!function (e, t) { var n, r, i, o, a; for (n in e) if (i = t[r = X(n)], o = e[n], Array.isArray(o) && (i = o[1], o = e[n] = o[0]), n !== r && (e[r] = o, delete e[n]), (a = S.cssHooks[r]) && "expand" in a) for (n in o = a.expand(o), delete e[r], o) n in e || (e[n] = o[n], t[n] = i); else t[r] = i }(c, l.opts.specialEasing); r < i; r++)if (n = lt.prefilters[r].call(l, o, c, l.opts)) return m(n.stop) && (S._queueHooks(l.elem, l.opts.queue).stop = n.stop.bind(n)), n; return S.map(c, ut, l), m(l.opts.start) && l.opts.start.call(o, l), l.progress(l.opts.progress).done(l.opts.done, l.opts.complete).fail(l.opts.fail).always(l.opts.always), S.fx.timer(S.extend(u, { elem: o, anim: l, queue: l.opts.queue })), l } S.Animation = S.extend(lt, { tweeners: { "*": [function (e, t) { var n = this.createTween(e, t); return se(n.elem, e, te.exec(t), n), n }] }, tweener: function (e, t) { m(e) ? (t = e, e = ["*"]) : e = e.match(P); for (var n, r = 0, i = e.length; r < i; r++)n = e[r], lt.tweeners[n] = lt.tweeners[n] || [], lt.tweeners[n].unshift(t) }, prefilters: [function (e, t, n) { var r, i, o, a, s, u, l, c, f = "width" in t || "height" in t, p = this, d = {}, h = e.style, g = e.nodeType && ae(e), v = Y.get(e, "fxshow"); for (r in n.queue || (null == (a = S._queueHooks(e, "fx")).unqueued && (a.unqueued = 0, s = a.empty.fire, a.empty.fire = function () { a.unqueued || s() }), a.unqueued++, p.always(function () { p.always(function () { a.unqueued--, S.queue(e, "fx").length || a.empty.fire() }) })), t) if (i = t[r], rt.test(i)) { if (delete t[r], o = o || "toggle" === i, i === (g ? "hide" : "show")) { if ("show" !== i || !v || void 0 === v[r]) continue; g = !0 } d[r] = v && v[r] || S.style(e, r) } if ((u = !S.isEmptyObject(t)) || !S.isEmptyObject(d)) for (r in f && 1 === e.nodeType && (n.overflow = [h.overflow, h.overflowX, h.overflowY], null == (l = v && v.display) && (l = Y.get(e, "display")), "none" === (c = S.css(e, "display")) && (l ? c = l : (le([e], !0), l = e.style.display || l, c = S.css(e, "display"), le([e]))), ("inline" === c || "inline-block" === c && null != l) && "none" === S.css(e, "float") && (u || (p.done(function () { h.display = l }), null == l && (c = h.display, l = "none" === c ? "" : c)), h.display = "inline-block")), n.overflow && (h.overflow = "hidden", p.always(function () { h.overflow = n.overflow[0], h.overflowX = n.overflow[1], h.overflowY = n.overflow[2] })), u = !1, d) u || (v ? "hidden" in v && (g = v.hidden) : v = Y.access(e, "fxshow", { display: l }), o && (v.hidden = !g), g && le([e], !0), p.done(function () { for (r in g || le([e]), Y.remove(e, "fxshow"), d) S.style(e, r, d[r]) })), u = ut(g ? v[r] : 0, r, p), r in v || (v[r] = u.start, g && (u.end = u.start, u.start = 0)) }], prefilter: function (e, t) { t ? lt.prefilters.unshift(e) : lt.prefilters.push(e) } }), S.speed = function (e, t, n) { var r = e && "object" == typeof e ? S.extend({}, e) : { complete: n || !n && t || m(e) && e, duration: e, easing: n && t || t && !m(t) && t }; return S.fx.off ? r.duration = 0 : "number" != typeof r.duration && (r.duration in S.fx.speeds ? r.duration = S.fx.speeds[r.duration] : r.duration = S.fx.speeds._default), null != r.queue && !0 !== r.queue || (r.queue = "fx"), r.old = r.complete, r.complete = function () { m(r.old) && r.old.call(this), r.queue && S.dequeue(this, r.queue) }, r }, S.fn.extend({ fadeTo: function (e, t, n, r) { return this.filter(ae).css("opacity", 0).show().end().animate({ opacity: t }, e, n, r) }, animate: function (t, e, n, r) { var i = S.isEmptyObject(t), o = S.speed(e, n, r), a = function () { var e = lt(this, S.extend({}, t), o); (i || Y.get(this, "finish")) && e.stop(!0) }; return a.finish = a, i || !1 === o.queue ? this.each(a) : this.queue(o.queue, a) }, stop: function (i, e, o) { var a = function (e) { var t = e.stop; delete e.stop, t(o) }; return "string" != typeof i && (o = e, e = i, i = void 0), e && this.queue(i || "fx", []), this.each(function () { var e = !0, t = null != i && i + "queueHooks", n = S.timers, r = Y.get(this); if (t) r[t] && r[t].stop && a(r[t]); else for (t in r) r[t] && r[t].stop && it.test(t) && a(r[t]); for (t = n.length; t--;)n[t].elem !== this || null != i && n[t].queue !== i || (n[t].anim.stop(o), e = !1, n.splice(t, 1)); !e && o || S.dequeue(this, i) }) }, finish: function (a) { return !1 !== a && (a = a || "fx"), this.each(function () { var e, t = Y.get(this), n = t[a + "queue"], r = t[a + "queueHooks"], i = S.timers, o = n ? n.length : 0; for (t.finish = !0, S.queue(this, a, []), r && r.stop && r.stop.call(this, !0), e = i.length; e--;)i[e].elem === this && i[e].queue === a && (i[e].anim.stop(!0), i.splice(e, 1)); for (e = 0; e < o; e++)n[e] && n[e].finish && n[e].finish.call(this); delete t.finish }) } }), S.each(["toggle", "show", "hide"], function (e, r) { var i = S.fn[r]; S.fn[r] = function (e, t, n) { return null == e || "boolean" == typeof e ? i.apply(this, arguments) : this.animate(st(r, !0), e, t, n) } }), S.each({ slideDown: st("show"), slideUp: st("hide"), slideToggle: st("toggle"), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function (e, r) { S.fn[e] = function (e, t, n) { return this.animate(r, e, t, n) } }), S.timers = [], S.fx.tick = function () { var e, t = 0, n = S.timers; for (Ze = Date.now(); t < n.length; t++)(e = n[t])() || n[t] !== e || n.splice(t--, 1); n.length || S.fx.stop(), Ze = void 0 }, S.fx.timer = function (e) { S.timers.push(e), S.fx.start() }, S.fx.interval = 13, S.fx.start = function () { et || (et = !0, ot()) }, S.fx.stop = function () { et = null }, S.fx.speeds = { slow: 600, fast: 200, _default: 400 }, S.fn.delay = function (r, e) { return r = S.fx && S.fx.speeds[r] || r, e = e || "fx", this.queue(e, function (e, t) { var n = C.setTimeout(e, r); t.stop = function () { C.clearTimeout(n) } }) }, tt = E.createElement("input"), nt = E.createElement("select").appendChild(E.createElement("option")), tt.type = "checkbox", y.checkOn = "" !== tt.value, y.optSelected = nt.selected, (tt = E.createElement("input")).value = "t", tt.type = "radio", y.radioValue = "t" === tt.value; var ct, ft = S.expr.attrHandle; S.fn.extend({ attr: function (e, t) { return $(this, S.attr, e, t, 1 < arguments.length) }, removeAttr: function (e) { return this.each(function () { S.removeAttr(this, e) }) } }), S.extend({ attr: function (e, t, n) { var r, i, o = e.nodeType; if (3 !== o && 8 !== o && 2 !== o) return "undefined" == typeof e.getAttribute ? S.prop(e, t, n) : (1 === o && S.isXMLDoc(e) || (i = S.attrHooks[t.toLowerCase()] || (S.expr.match.bool.test(t) ? ct : void 0)), void 0 !== n ? null === n ? void S.removeAttr(e, t) : i && "set" in i && void 0 !== (r = i.set(e, n, t)) ? r : (e.setAttribute(t, n + ""), n) : i && "get" in i && null !== (r = i.get(e, t)) ? r : null == (r = S.find.attr(e, t)) ? void 0 : r) }, attrHooks: { type: { set: function (e, t) { if (!y.radioValue && "radio" === t && A(e, "input")) { var n = e.value; return e.setAttribute("type", t), n && (e.value = n), t } } } }, removeAttr: function (e, t) { var n, r = 0, i = t && t.match(P); if (i && 1 === e.nodeType) while (n = i[r++]) e.removeAttribute(n) } }), ct = { set: function (e, t, n) { return !1 === t ? S.removeAttr(e, n) : e.setAttribute(n, n), n } }, S.each(S.expr.match.bool.source.match(/\w+/g), function (e, t) { var a = ft[t] || S.find.attr; ft[t] = function (e, t, n) { var r, i, o = t.toLowerCase(); return n || (i = ft[o], ft[o] = r, r = null != a(e, t, n) ? o : null, ft[o] = i), r } }); var pt = /^(?:input|select|textarea|button)$/i, dt = /^(?:a|area)$/i; function ht(e) { return (e.match(P) || []).join(" ") } function gt(e) { return e.getAttribute && e.getAttribute("class") || "" } function vt(e) { return Array.isArray(e) ? e : "string" == typeof e && e.match(P) || [] } S.fn.extend({ prop: function (e, t) { return $(this, S.prop, e, t, 1 < arguments.length) }, removeProp: function (e) { return this.each(function () { delete this[S.propFix[e] || e] }) } }), S.extend({ prop: function (e, t, n) { var r, i, o = e.nodeType; if (3 !== o && 8 !== o && 2 !== o) return 1 === o && S.isXMLDoc(e) || (t = S.propFix[t] || t, i = S.propHooks[t]), void 0 !== n ? i && "set" in i && void 0 !== (r = i.set(e, n, t)) ? r : e[t] = n : i && "get" in i && null !== (r = i.get(e, t)) ? r : e[t] }, propHooks: { tabIndex: { get: function (e) { var t = S.find.attr(e, "tabindex"); return t ? parseInt(t, 10) : pt.test(e.nodeName) || dt.test(e.nodeName) && e.href ? 0 : -1 } } }, propFix: { "for": "htmlFor", "class": "className" } }), y.optSelected || (S.propHooks.selected = { get: function (e) { var t = e.parentNode; return t && t.parentNode && t.parentNode.selectedIndex, null }, set: function (e) { var t = e.parentNode; t && (t.selectedIndex, t.parentNode && t.parentNode.selectedIndex) } }), S.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function () { S.propFix[this.toLowerCase()] = this }), S.fn.extend({ addClass: function (t) { var e, n, r, i, o, a, s, u = 0; if (m(t)) return this.each(function (e) { S(this).addClass(t.call(this, e, gt(this))) }); if ((e = vt(t)).length) while (n = this[u++]) if (i = gt(n), r = 1 === n.nodeType && " " + ht(i) + " ") { a = 0; while (o = e[a++]) r.indexOf(" " + o + " ") < 0 && (r += o + " "); i !== (s = ht(r)) && n.setAttribute("class", s) } return this }, removeClass: function (t) { var e, n, r, i, o, a, s, u = 0; if (m(t)) return this.each(function (e) { S(this).removeClass(t.call(this, e, gt(this))) }); if (!arguments.length) return this.attr("class", ""); if ((e = vt(t)).length) while (n = this[u++]) if (i = gt(n), r = 1 === n.nodeType && " " + ht(i) + " ") { a = 0; while (o = e[a++]) while (-1 < r.indexOf(" " + o + " ")) r = r.replace(" " + o + " ", " "); i !== (s = ht(r)) && n.setAttribute("class", s) } return this }, toggleClass: function (i, t) { var o = typeof i, a = "string" === o || Array.isArray(i); return "boolean" == typeof t && a ? t ? this.addClass(i) : this.removeClass(i) : m(i) ? this.each(function (e) { S(this).toggleClass(i.call(this, e, gt(this), t), t) }) : this.each(function () { var e, t, n, r; if (a) { t = 0, n = S(this), r = vt(i); while (e = r[t++]) n.hasClass(e) ? n.removeClass(e) : n.addClass(e) } else void 0 !== i && "boolean" !== o || ((e = gt(this)) && Y.set(this, "__className__", e), this.setAttribute && this.setAttribute("class", e || !1 === i ? "" : Y.get(this, "__className__") || "")) }) }, hasClass: function (e) { var t, n, r = 0; t = " " + e + " "; while (n = this[r++]) if (1 === n.nodeType && -1 < (" " + ht(gt(n)) + " ").indexOf(t)) return !0; return !1 } }); var yt = /\r/g; S.fn.extend({ val: function (n) { var r, e, i, t = this[0]; return arguments.length ? (i = m(n), this.each(function (e) { var t; 1 === this.nodeType && (null == (t = i ? n.call(this, e, S(this).val()) : n) ? t = "" : "number" == typeof t ? t += "" : Array.isArray(t) && (t = S.map(t, function (e) { return null == e ? "" : e + "" })), (r = S.valHooks[this.type] || S.valHooks[this.nodeName.toLowerCase()]) && "set" in r && void 0 !== r.set(this, t, "value") || (this.value = t)) })) : t ? (r = S.valHooks[t.type] || S.valHooks[t.nodeName.toLowerCase()]) && "get" in r && void 0 !== (e = r.get(t, "value")) ? e : "string" == typeof (e = t.value) ? e.replace(yt, "") : null == e ? "" : e : void 0 } }), S.extend({ valHooks: { option: { get: function (e) { var t = S.find.attr(e, "value"); return null != t ? t : ht(S.text(e)) } }, select: { get: function (e) { var t, n, r, i = e.options, o = e.selectedIndex, a = "select-one" === e.type, s = a ? null : [], u = a ? o + 1 : i.length; for (r = o < 0 ? u : a ? o : 0; r < u; r++)if (((n = i[r]).selected || r === o) && !n.disabled && (!n.parentNode.disabled || !A(n.parentNode, "optgroup"))) { if (t = S(n).val(), a) return t; s.push(t) } return s }, set: function (e, t) { var n, r, i = e.options, o = S.makeArray(t), a = i.length; while (a--) ((r = i[a]).selected = -1 < S.inArray(S.valHooks.option.get(r), o)) && (n = !0); return n || (e.selectedIndex = -1), o } } } }), S.each(["radio", "checkbox"], function () { S.valHooks[this] = { set: function (e, t) { if (Array.isArray(t)) return e.checked = -1 < S.inArray(S(e).val(), t) } }, y.checkOn || (S.valHooks[this].get = function (e) { return null === e.getAttribute("value") ? "on" : e.value }) }), y.focusin = "onfocusin" in C; var mt = /^(?:focusinfocus|focusoutblur)$/, xt = function (e) { e.stopPropagation() }; S.extend(S.event, { trigger: function (e, t, n, r) { var i, o, a, s, u, l, c, f, p = [n || E], d = v.call(e, "type") ? e.type : e, h = v.call(e, "namespace") ? e.namespace.split(".") : []; if (o = f = a = n = n || E, 3 !== n.nodeType && 8 !== n.nodeType && !mt.test(d + S.event.triggered) && (-1 < d.indexOf(".") && (d = (h = d.split(".")).shift(), h.sort()), u = d.indexOf(":") < 0 && "on" + d, (e = e[S.expando] ? e : new S.Event(d, "object" == typeof e && e)).isTrigger = r ? 2 : 3, e.namespace = h.join("."), e.rnamespace = e.namespace ? new RegExp("(^|\\.)" + h.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, e.result = void 0, e.target || (e.target = n), t = null == t ? [e] : S.makeArray(t, [e]), c = S.event.special[d] || {}, r || !c.trigger || !1 !== c.trigger.apply(n, t))) { if (!r && !c.noBubble && !x(n)) { for (s = c.delegateType || d, mt.test(s + d) || (o = o.parentNode); o; o = o.parentNode)p.push(o), a = o; a === (n.ownerDocument || E) && p.push(a.defaultView || a.parentWindow || C) } i = 0; while ((o = p[i++]) && !e.isPropagationStopped()) f = o, e.type = 1 < i ? s : c.bindType || d, (l = (Y.get(o, "events") || Object.create(null))[e.type] && Y.get(o, "handle")) && l.apply(o, t), (l = u && o[u]) && l.apply && V(o) && (e.result = l.apply(o, t), !1 === e.result && e.preventDefault()); return e.type = d, r || e.isDefaultPrevented() || c._default && !1 !== c._default.apply(p.pop(), t) || !V(n) || u && m(n[d]) && !x(n) && ((a = n[u]) && (n[u] = null), S.event.triggered = d, e.isPropagationStopped() && f.addEventListener(d, xt), n[d](), e.isPropagationStopped() && f.removeEventListener(d, xt), S.event.triggered = void 0, a && (n[u] = a)), e.result } }, simulate: function (e, t, n) { var r = S.extend(new S.Event, n, { type: e, isSimulated: !0 }); S.event.trigger(r, null, t) } }), S.fn.extend({ trigger: function (e, t) { return this.each(function () { S.event.trigger(e, t, this) }) }, triggerHandler: function (e, t) { var n = this[0]; if (n) return S.event.trigger(e, t, n, !0) } }), y.focusin || S.each({ focus: "focusin", blur: "focusout" }, function (n, r) { var i = function (e) { S.event.simulate(r, e.target, S.event.fix(e)) }; S.event.special[r] = { setup: function () { var e = this.ownerDocument || this.document || this, t = Y.access(e, r); t || e.addEventListener(n, i, !0), Y.access(e, r, (t || 0) + 1) }, teardown: function () { var e = this.ownerDocument || this.document || this, t = Y.access(e, r) - 1; t ? Y.access(e, r, t) : (e.removeEventListener(n, i, !0), Y.remove(e, r)) } } }); var bt = C.location, wt = { guid: Date.now() }, Tt = /\?/; S.parseXML = function (e) { var t, n; if (!e || "string" != typeof e) return null; try { t = (new C.DOMParser).parseFromString(e, "text/xml") } catch (e) { } return n = t && t.getElementsByTagName("parsererror")[0], t && !n || S.error("Invalid XML: " + (n ? S.map(n.childNodes, function (e) { return e.textContent }).join("\n") : e)), t }; var Ct = /\[\]$/, Et = /\r?\n/g, St = /^(?:submit|button|image|reset|file)$/i, kt = /^(?:input|select|textarea|keygen)/i; function At(n, e, r, i) { var t; if (Array.isArray(e)) S.each(e, function (e, t) { r || Ct.test(n) ? i(n, t) : At(n + "[" + ("object" == typeof t && null != t ? e : "") + "]", t, r, i) }); else if (r || "object" !== w(e)) i(n, e); else for (t in e) At(n + "[" + t + "]", e[t], r, i) } S.param = function (e, t) { var n, r = [], i = function (e, t) { var n = m(t) ? t() : t; r[r.length] = encodeURIComponent(e) + "=" + encodeURIComponent(null == n ? "" : n) }; if (null == e) return ""; if (Array.isArray(e) || e.jquery && !S.isPlainObject(e)) S.each(e, function () { i(this.name, this.value) }); else for (n in e) At(n, e[n], t, i); return r.join("&") }, S.fn.extend({ serialize: function () { return S.param(this.serializeArray()) }, serializeArray: function () { return this.map(function () { var e = S.prop(this, "elements"); return e ? S.makeArray(e) : this }).filter(function () { var e = this.type; return this.name && !S(this).is(":disabled") && kt.test(this.nodeName) && !St.test(e) && (this.checked || !pe.test(e)) }).map(function (e, t) { var n = S(this).val(); return null == n ? null : Array.isArray(n) ? S.map(n, function (e) { return { name: t.name, value: e.replace(Et, "\r\n") } }) : { name: t.name, value: n.replace(Et, "\r\n") } }).get() } }); var Nt = /%20/g, jt = /#.*$/, Dt = /([?&])_=[^&]*/, qt = /^(.*?):[ \t]*([^\r\n]*)$/gm, Lt = /^(?:GET|HEAD)$/, Ht = /^\/\//, Ot = {}, Pt = {}, Rt = "*/".concat("*"), Mt = E.createElement("a"); function It(o) { return function (e, t) { "string" != typeof e && (t = e, e = "*"); var n, r = 0, i = e.toLowerCase().match(P) || []; if (m(t)) while (n = i[r++]) "+" === n[0] ? (n = n.slice(1) || "*", (o[n] = o[n] || []).unshift(t)) : (o[n] = o[n] || []).push(t) } } function Wt(t, i, o, a) { var s = {}, u = t === Pt; function l(e) { var r; return s[e] = !0, S.each(t[e] || [], function (e, t) { var n = t(i, o, a); return "string" != typeof n || u || s[n] ? u ? !(r = n) : void 0 : (i.dataTypes.unshift(n), l(n), !1) }), r } return l(i.dataTypes[0]) || !s["*"] && l("*") } function Ft(e, t) { var n, r, i = S.ajaxSettings.flatOptions || {}; for (n in t) void 0 !== t[n] && ((i[n] ? e : r || (r = {}))[n] = t[n]); return r && S.extend(!0, e, r), e } Mt.href = bt.href, S.extend({ active: 0, lastModified: {}, etag: {}, ajaxSettings: { url: bt.href, type: "GET", isLocal: /^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(bt.protocol), global: !0, processData: !0, async: !0, contentType: "application/x-www-form-urlencoded; charset=UTF-8", accepts: { "*": Rt, text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript" }, contents: { xml: /\bxml\b/, html: /\bhtml/, json: /\bjson\b/ }, responseFields: { xml: "responseXML", text: "responseText", json: "responseJSON" }, converters: { "* text": String, "text html": !0, "text json": JSON.parse, "text xml": S.parseXML }, flatOptions: { url: !0, context: !0 } }, ajaxSetup: function (e, t) { return t ? Ft(Ft(e, S.ajaxSettings), t) : Ft(S.ajaxSettings, e) }, ajaxPrefilter: It(Ot), ajaxTransport: It(Pt), ajax: function (e, t) { "object" == typeof e && (t = e, e = void 0), t = t || {}; var c, f, p, n, d, r, h, g, i, o, v = S.ajaxSetup({}, t), y = v.context || v, m = v.context && (y.nodeType || y.jquery) ? S(y) : S.event, x = S.Deferred(), b = S.Callbacks("once memory"), w = v.statusCode || {}, a = {}, s = {}, u = "canceled", T = { readyState: 0, getResponseHeader: function (e) { var t; if (h) { if (!n) { n = {}; while (t = qt.exec(p)) n[t[1].toLowerCase() + " "] = (n[t[1].toLowerCase() + " "] || []).concat(t[2]) } t = n[e.toLowerCase() + " "] } return null == t ? null : t.join(", ") }, getAllResponseHeaders: function () { return h ? p : null }, setRequestHeader: function (e, t) { return null == h && (e = s[e.toLowerCase()] = s[e.toLowerCase()] || e, a[e] = t), this }, overrideMimeType: function (e) { return null == h && (v.mimeType = e), this }, statusCode: function (e) { var t; if (e) if (h) T.always(e[T.status]); else for (t in e) w[t] = [w[t], e[t]]; return this }, abort: function (e) { var t = e || u; return c && c.abort(t), l(0, t), this } }; if (x.promise(T), v.url = ((e || v.url || bt.href) + "").replace(Ht, bt.protocol + "//"), v.type = t.method || t.type || v.method || v.type, v.dataTypes = (v.dataType || "*").toLowerCase().match(P) || [""], null == v.crossDomain) { r = E.createElement("a"); try { r.href = v.url, r.href = r.href, v.crossDomain = Mt.protocol + "//" + Mt.host != r.protocol + "//" + r.host } catch (e) { v.crossDomain = !0 } } if (v.data && v.processData && "string" != typeof v.data && (v.data = S.param(v.data, v.traditional)), Wt(Ot, v, t, T), h) return T; for (i in (g = S.event && v.global) && 0 == S.active++ && S.event.trigger("ajaxStart"), v.type = v.type.toUpperCase(), v.hasContent = !Lt.test(v.type), f = v.url.replace(jt, ""), v.hasContent ? v.data && v.processData && 0 === (v.contentType || "").indexOf("application/x-www-form-urlencoded") && (v.data = v.data.replace(Nt, "+")) : (o = v.url.slice(f.length), v.data && (v.processData || "string" == typeof v.data) && (f += (Tt.test(f) ? "&" : "?") + v.data, delete v.data), !1 === v.cache && (f = f.replace(Dt, "$1"), o = (Tt.test(f) ? "&" : "?") + "_=" + wt.guid++ + o), v.url = f + o), v.ifModified && (S.lastModified[f] && T.setRequestHeader("If-Modified-Since", S.lastModified[f]), S.etag[f] && T.setRequestHeader("If-None-Match", S.etag[f])), (v.data && v.hasContent && !1 !== v.contentType || t.contentType) && T.setRequestHeader("Content-Type", v.contentType), T.setRequestHeader("Accept", v.dataTypes[0] && v.accepts[v.dataTypes[0]] ? v.accepts[v.dataTypes[0]] + ("*" !== v.dataTypes[0] ? ", " + Rt + "; q=0.01" : "") : v.accepts["*"]), v.headers) T.setRequestHeader(i, v.headers[i]); if (v.beforeSend && (!1 === v.beforeSend.call(y, T, v) || h)) return T.abort(); if (u = "abort", b.add(v.complete), T.done(v.success), T.fail(v.error), c = Wt(Pt, v, t, T)) { if (T.readyState = 1, g && m.trigger("ajaxSend", [T, v]), h) return T; v.async && 0 < v.timeout && (d = C.setTimeout(function () { T.abort("timeout") }, v.timeout)); try { h = !1, c.send(a, l) } catch (e) { if (h) throw e; l(-1, e) } } else l(-1, "No Transport"); function l(e, t, n, r) { var i, o, a, s, u, l = t; h || (h = !0, d && C.clearTimeout(d), c = void 0, p = r || "", T.readyState = 0 < e ? 4 : 0, i = 200 <= e && e < 300 || 304 === e, n && (s = function (e, t, n) { var r, i, o, a, s = e.contents, u = e.dataTypes; while ("*" === u[0]) u.shift(), void 0 === r && (r = e.mimeType || t.getResponseHeader("Content-Type")); if (r) for (i in s) if (s[i] && s[i].test(r)) { u.unshift(i); break } if (u[0] in n) o = u[0]; else { for (i in n) { if (!u[0] || e.converters[i + " " + u[0]]) { o = i; break } a || (a = i) } o = o || a } if (o) return o !== u[0] && u.unshift(o), n[o] }(v, T, n)), !i && -1 < S.inArray("script", v.dataTypes) && S.inArray("json", v.dataTypes) < 0 && (v.converters["text script"] = function () { }), s = function (e, t, n, r) { var i, o, a, s, u, l = {}, c = e.dataTypes.slice(); if (c[1]) for (a in e.converters) l[a.toLowerCase()] = e.converters[a]; o = c.shift(); while (o) if (e.responseFields[o] && (n[e.responseFields[o]] = t), !u && r && e.dataFilter && (t = e.dataFilter(t, e.dataType)), u = o, o = c.shift()) if ("*" === o) o = u; else if ("*" !== u && u !== o) { if (!(a = l[u + " " + o] || l["* " + o])) for (i in l) if ((s = i.split(" "))[1] === o && (a = l[u + " " + s[0]] || l["* " + s[0]])) { !0 === a ? a = l[i] : !0 !== l[i] && (o = s[0], c.unshift(s[1])); break } if (!0 !== a) if (a && e["throws"]) t = a(t); else try { t = a(t) } catch (e) { return { state: "parsererror", error: a ? e : "No conversion from " + u + " to " + o } } } return { state: "success", data: t } }(v, s, T, i), i ? (v.ifModified && ((u = T.getResponseHeader("Last-Modified")) && (S.lastModified[f] = u), (u = T.getResponseHeader("etag")) && (S.etag[f] = u)), 204 === e || "HEAD" === v.type ? l = "nocontent" : 304 === e ? l = "notmodified" : (l = s.state, o = s.data, i = !(a = s.error))) : (a = l, !e && l || (l = "error", e < 0 && (e = 0))), T.status = e, T.statusText = (t || l) + "", i ? x.resolveWith(y, [o, l, T]) : x.rejectWith(y, [T, l, a]), T.statusCode(w), w = void 0, g && m.trigger(i ? "ajaxSuccess" : "ajaxError", [T, v, i ? o : a]), b.fireWith(y, [T, l]), g && (m.trigger("ajaxComplete", [T, v]), --S.active || S.event.trigger("ajaxStop"))) } return T }, getJSON: function (e, t, n) { return S.get(e, t, n, "json") }, getScript: function (e, t) { return S.get(e, void 0, t, "script") } }), S.each(["get", "post"], function (e, i) { S[i] = function (e, t, n, r) { return m(t) && (r = r || n, n = t, t = void 0), S.ajax(S.extend({ url: e, type: i, dataType: r, data: t, success: n }, S.isPlainObject(e) && e)) } }), S.ajaxPrefilter(function (e) { var t; for (t in e.headers) "content-type" === t.toLowerCase() && (e.contentType = e.headers[t] || "") }), S._evalUrl = function (e, t, n) { return S.ajax({ url: e, type: "GET", dataType: "script", cache: !0, async: !1, global: !1, converters: { "text script": function () { } }, dataFilter: function (e) { S.globalEval(e, t, n) } }) }, S.fn.extend({ wrapAll: function (e) { var t; return this[0] && (m(e) && (e = e.call(this[0])), t = S(e, this[0].ownerDocument).eq(0).clone(!0), this[0].parentNode && t.insertBefore(this[0]), t.map(function () { var e = this; while (e.firstElementChild) e = e.firstElementChild; return e }).append(this)), this }, wrapInner: function (n) { return m(n) ? this.each(function (e) { S(this).wrapInner(n.call(this, e)) }) : this.each(function () { var e = S(this), t = e.contents(); t.length ? t.wrapAll(n) : e.append(n) }) }, wrap: function (t) { var n = m(t); return this.each(function (e) { S(this).wrapAll(n ? t.call(this, e) : t) }) }, unwrap: function (e) { return this.parent(e).not("body").each(function () { S(this).replaceWith(this.childNodes) }), this } }), S.expr.pseudos.hidden = function (e) { return !S.expr.pseudos.visible(e) }, S.expr.pseudos.visible = function (e) { return !!(e.offsetWidth || e.offsetHeight || e.getClientRects().length) }, S.ajaxSettings.xhr = function () { try { return new C.XMLHttpRequest } catch (e) { } }; var Bt = { 0: 200, 1223: 204 }, $t = S.ajaxSettings.xhr(); y.cors = !!$t && "withCredentials" in $t, y.ajax = $t = !!$t, S.ajaxTransport(function (i) { var o, a; if (y.cors || $t && !i.crossDomain) return { send: function (e, t) { var n, r = i.xhr(); if (r.open(i.type, i.url, i.async, i.username, i.password), i.xhrFields) for (n in i.xhrFields) r[n] = i.xhrFields[n]; for (n in i.mimeType && r.overrideMimeType && r.overrideMimeType(i.mimeType), i.crossDomain || e["X-Requested-With"] || (e["X-Requested-With"] = "XMLHttpRequest"), e) r.setRequestHeader(n, e[n]); o = function (e) { return function () { o && (o = a = r.onload = r.onerror = r.onabort = r.ontimeout = r.onreadystatechange = null, "abort" === e ? r.abort() : "error" === e ? "number" != typeof r.status ? t(0, "error") : t(r.status, r.statusText) : t(Bt[r.status] || r.status, r.statusText, "text" !== (r.responseType || "text") || "string" != typeof r.responseText ? { binary: r.response } : { text: r.responseText }, r.getAllResponseHeaders())) } }, r.onload = o(), a = r.onerror = r.ontimeout = o("error"), void 0 !== r.onabort ? r.onabort = a : r.onreadystatechange = function () { 4 === r.readyState && C.setTimeout(function () { o && a() }) }, o = o("abort"); try { r.send(i.hasContent && i.data || null) } catch (e) { if (o) throw e } }, abort: function () { o && o() } } }), S.ajaxPrefilter(function (e) { e.crossDomain && (e.contents.script = !1) }), S.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /\b(?:java|ecma)script\b/ }, converters: { "text script": function (e) { return S.globalEval(e), e } } }), S.ajaxPrefilter("script", function (e) { void 0 === e.cache && (e.cache = !1), e.crossDomain && (e.type = "GET") }), S.ajaxTransport("script", function (n) { var r, i; if (n.crossDomain || n.scriptAttrs) return { send: function (e, t) { r = S("' - ); - - $("#script-accountlinking").append(script); - - let la_options = {}; - la_options.container = "interfacecontainerdiv"; - la_options.templateName = 'loginradiuscustom_tmpl_link'; - la_options.onSuccess = function() { - $("#interfacecontainerdiv").empty(); - LRObject.util.ready(function() { - LRObject.init("linkAccount", la_options); - }); - }; - la_options.onError = function(errors) { - $("#user-accountlinking-message").text(errors[0].Description); - $("#user-accountlinking-message").attr("class", "error-message"); - }; - - let unlink_options = {}; - unlink_options.onSuccess = function() { - $("#interfacecontainerdiv").empty(); - LRObject.util.ready(function() { - LRObject.init("linkAccount", la_options); - }); - }; - unlink_options.onError = function(errors) { - $("#user-accountlinking-message").text(errors[0].Description); - $("#user-accountlinking-message").attr("class", "error-message"); - }; - - LRObject.util.ready(function() { - LRObject.init("linkAccount", la_options); - LRObject.init("unLinkAccount", unlink_options); - }); -} - -function custom_object() { - create_customobject(); - update_customobject(); - delete_customobject(); - get_customobject(); -} - -function create_customobject() { - $("#btn-user-createcustomobj").click(function() { - var input = $("#user-createcustomobj-data").val(); - if (!IsJsonString(input)) { - $("#user-createcustomobj-message").text("Please input a valid JSON object in the data field."); - $("#user-createcustomobj-message").attr("class", "error-message"); - return; - } - - $.ajax({ - type: "POST", - url: "/customobject?objectname=" + $("#user-createcustomobj-objectname").val() + '&uid=' + localStorage.getItem('lr-user-uid'), - contentType: 'application/json', - dataType: "json", - data: input, - success: function(res) { - console.log("Create customobj success::", res); - $("#user-createcustomobj-message").text("Object successfully created."); - $("#user-createcustomobj-message").attr("class", "success-message"); - }, - error: function(xhr, status, error) { - console.log("Create customobjs err::", xhr.responseText); - $("#user-createcustomobj-message").text(xhr.responseText); - $("#user-createcustomobj-message").attr("class", "error-message"); - } - }); - }); -} - -function update_customobject() { - $("#btn-user-updatecustomobj").click(function() { - var input = $("#user-updatecustomobj-data").val(); - if (!IsJsonString(input)) { - $("#user-updatecustomobj-message").text("Please input a valid JSON object in the data field."); - $("#user-updatecustomobj-message").attr("class", "error-message"); - return; - } - - $.ajax({ - type: "PUT", - url: "/customobject?objectname=" + $("#user-updatecustomobj-objectname").val() + "&objectrecordid=" + $("#user-updatecustomobj-objectrecordid").val() + '&uid=' + localStorage.getItem('lr-user-uid'), - contentType: 'application/json', - dataType: "json", - data: input, - success: function(res) { - console.log("Update customobj success::", res); - $("#user-updatecustomobj-message").text("Object successfully updated."); - $("#user-updatecustomobj-message").attr("class", "success-message"); - }, - error: function(xhr, status, error) { - console.log("Update customobjs err::", xhr.responseText); - $("#user-updatecustomobj-message").text(xhr.responseText); - $("#user-updatecustomobj-message").attr("class", "error-message"); - } - }); - }); -} - -function delete_customobject() { - $("#btn-user-deletecustomobj").click(function() { - $.ajax({ - type: "DELETE", - url: "/customobject?objectname=" + $("#user-deletecustomobj-objectname").val() + "&objectrecordid=" + $("#user-deletecustomobj-objectrecordid").val() + '&uid=' + localStorage.getItem('lr-user-uid'), - dataType: "json", - success: function(res) { - console.log("Delete customobj success::", res); - $("#user-deletecustomobj-message").text("Custom object deleted successfully."); - $("#user-deletecustomobj-message").attr("class", "success-message"); - }, - error: function(xhr, status, error) { - console.log("Delete customobjs err::", xhr.responseText); - var strObjName = $('#user-deletecustomobj-objectname').val(); - var strObjId = $('#user-deletecustomobj-objectrecordid').val(); - if(strObjName.replace(/\s/g,"") == ""){ - $("#user-deletecustomobj-message").text("The ObjectName is a Required Paramter So its can not be null or empty"); - }else if(strObjId.replace(/\s/g,"") == ""){ - $("#user-deletecustomobj-message").text("The ObjectRecordId is a Required Paramter So its can not be null or empty"); - }else{ - $("#user-deletecustomobj-message").text(xhr.responseText); - } - - $("#user-deletecustomobj-message").attr("class", "error-message"); - } - }); - }); -} - -function get_customobject() { - $("#btn-user-getcustomobj").click(function() { - if ($("#user-getcustomobj-objectname").val().trim() == '') { - $("#user-getcustomobj-message").text("The Object Name is a Required Paramter So its can not be null or empty"); - $("#user-getcustomobj-message").attr("class", "error-message"); - return; - }; - - $.ajax({ - type: "GET", - url: "/customobject?objectname=" + $("#user-getcustomobj-objectname").val() + '&uid=' + localStorage.getItem('lr-user-uid'), - dataType: "json", - success: function(res) { - console.log("Get customobjs success::", res); - $('#table-customobj tr').remove(); - $("#user-getcustomobj-message").text(""); - $("#user-getcustomobj-message").attr("class", "success-message"); - $('' + - 'Object IDCustom Object' + - '').appendTo("#table-customobj > tbody:last-child"); - - for (let i = 0; i < res.data.length; i++) { - $("" + res.data[i].Id + "").appendTo("#table-customobj > tbody:last-child"); - $("", { - text: JSON.stringify(res.data[i].CustomObject) - }).appendTo("#table-customobj > tbody:last-child > tr:last-child"); - } - }, - error: function(xhr) { - console.log("Get customobjs err::", xhr.responseText); - $('#table-customobj tr').remove(); - $("#user-getcustomobj-message").text(xhr.responseText); - $("#user-getcustomobj-message").attr("class", "error-message"); - } - }); - }); -} - -function reset_mfa() { - $("#btn-user-mfa-resetgoogle").click(function() { - $.ajax({ - type: "DELETE", - url: "/mfa/reset?uid=" + localStorage.getItem('lr-user-uid'), - dataType: "json", - success: function(res) { - console.log("Reset success::", res); - $("#user-mfa-message").text("Authenticator settings reset."); - $("#user-mfa-message").attr("class", "success-message"); - }, - error: function(xhr) { - console.log("Reset err::", xhr.responseText); - $("#user-mfa-message").text(xhr.responseText); - $("#user-mfa-message").attr("class", "error-message"); - } - }); - }); -} - -function roles() { - create_role(); - delete_role(); - assign_role(); - get_all_roles(); - get_user_roles(); -} - -function create_role() { - $("#btn-user-createrole").click(function() { - $.ajax({ - type: "POST", - url: "/role", - dataType: "json", - data: $.param({ - role: $("#user-roles-createrole").val() - }), - success: function(res) { - console.log("Create role success::", res); - $("#user-createrole-message").text("Role created successfully."); - $("#user-createrole-message").attr("class", "success-message"); - get_all_roles(); - get_user_roles(); - }, - error: function(xhr, status, error) { - console.log("Create role err::", xhr.responseText); - $("#user-createrole-message").text(xhr.responseText); - $("#user-createrole-message").attr("class", "error-message"); - } - }); - }); -} - -function delete_role() { - $("#btn-user-deleterole").click(function() { - $.ajax({ - type: "DELETE", - url: "/role?role=" + $("#user-roles-deleterole").val(), - dataType: "json", - success: function(res) { - console.log("Delete role success::", res); - $("#user-deleterole-message").text("Role deleted successfully."); - $("#user-deleterole-message").attr("class", "success-message"); - get_all_roles(); - get_user_roles(); - }, - error: function(xhr, status, error) { - console.log("Delete role err::", xhr.responseText); - $("#user-deleterole-message").text(xhr.responseText); - $("#user-deleterole-message").attr("class", "error-message"); - } - }); - }); -} - -function assign_role() { - $("#btn-user-assignrole").click(function() { - $.ajax({ - type: "PUT", - url: "/role/user", - dataType: "json", - data: $.param({ - uid: localStorage.getItem('lr-user-uid'), - role: $("#user-roles-assignrole").val() - }), - success: function(res) { - console.log("Assign role success::", res); - $("#user-assignrole-message").text("Role added to current user successfully."); - $("#user-assignrole-message").attr("class", "success-message"); - get_user_roles(); - }, - error: function(xhr) { - console.log("Assign role err::", xhr.responseText); - $("#user-assignrole-message").text(xhr.responseText); - $("#user-assignrole-message").attr("class", "error-message"); - } - }); - }); -} - -function get_all_roles() { - $.ajax({ - type: "GET", - url: "/role", - dataType: "json", - success: function(res) { - console.log("Get All Roles success::", res); - $('#table-allroles tr:not(:first)').remove(); - if (res.data) { - for (let i = 0; i < res.data.length; i++) { - $("").appendTo("#table-allroles > tbody:last-child"); - $("", { - text: res.data[i].Name - }).appendTo('#table-allroles > tbody:last-child > tr:last-child'); - } - } - }, - error: function(xhr) { - console.log("Get All Roles err::", xhr.responseText); - } - }); -} - -function get_user_roles() { - $.ajax({ - type: "GET", - url: "/role/user?" + 'uid=' + localStorage.getItem('lr-user-uid'), - dataType: "json", - success: function(res) { - console.log("Get User Roles success::", res); - $('#table-userroles tr:not(:first)').remove(); - if (res.Roles) { - for (let i = 0; i < res.Roles.length; i++) { - $("").appendTo("#table-userroles > tbody:last-child"); - $("", { - text: res.Roles[i] - }).appendTo('#table-userroles > tbody:last-child > tr:last-child'); - } - } - }, - error: function(xhr) { - console.log("Get User Roles err::", xhr.responseText); - } - }); -} - -function logout() { - $("#menu-logout").click(function() { - $.ajax({ - type: "GET", - url: "/logout", - dataType: "json", - data: $.param({ - token: localStorage.getItem("LRTokenKey") - }), - success: function(res) { - localStorage.removeItem("LRTokenKey"); - localStorage.removeItem("lr-user-uid"); - window.location.href = "/minimal"; - }, - error: function(xhr, status, error) { - console.log("Logout err::", xhr.responseText); - } - }); - }); -} - -function IsJsonString(str) { - try { - JSON.parse(str); - } catch (e) { - return false; - } - return true; -} \ No newline at end of file diff --git a/demo/src/main/resources/static/js/profileView.js b/demo/src/main/resources/static/js/profileView.js deleted file mode 100755 index 7878af7..0000000 --- a/demo/src/main/resources/static/js/profileView.js +++ /dev/null @@ -1,153 +0,0 @@ -$(function() { - - $(window).on('hashchange', function() { - // On every hash change the render function is called with the new hash. - // This is how the navigation of our app happens. - render(decodeURI(window.location.hash)); - }).trigger('hashchange'); - - function render(url) { - // This function decides what type of page to show - // depending on the current url hash value. - - // Get the keyword from the url. - let temp = url.split('/')[0]; - - // Hide whatever page is currently shown. - $('.right-elem').removeClass('visible'); - $('.menu-options').removeClass('active'); - - let map = { - // The Homepage. - '': function() { - renderProfile(); - }, - // Profile page. - '#profile': function() { - renderProfile(); - }, - // Reset Password page. - '#resetpassword': function() { - renderResetPassword(); - }, - // Change Password page. - '#changepassword': function() { - renderChangePassword(); - }, - // Set Password page. - '#setpassword': function() { - renderSetPassword(); - }, - // Update Account page. - '#account': function() { - renderUpdateAccount(); - }, - // Account Linking page. - '#accountlinking': function() { - renderAccountLinking(); - }, - // Account Linking page. - '#accountlinking': function() { - renderAccountLinking(); - }, - // Custom Objects page. - '#customobjects': function() { - renderCustomObjects(); - }, - // Multifactor page. - '#multifactor': function() { - renderMultifactor(); - }, - // Roles page. - '#roles': function() { - renderRoles(); - } - }; - - // Execute the needed function depending on the url keyword (stored in temp). - if (map[temp]) { - map[temp](); - } - // If the keyword isn't listed in the above - render the error page. - else { - renderErrorPage(); - } - } - - function renderProfile() { - let page = $('.profile-elem') - let menuOption = $('#menu-profile') - page.addClass('visible'); - menuOption.addClass('active'); - // Shows the profile page. - } - - function renderResetPassword() { - let page = $('.resetpassword-elem') - let menuOption = $('#menu-resetpassword') - page.addClass('visible'); - menuOption.addClass('active'); - // Shows the forgot password page. - } - - function renderChangePassword() { - let page = $('.changepassword-elem') - let menuOption = $('#menu-changepassword') - page.addClass('visible'); - menuOption.addClass('active'); - // Shows the forgot password page. - } - - function renderSetPassword() { - let page = $('.setpassword-elem') - let menuOption = $('#menu-setpassword') - page.addClass('visible'); - menuOption.addClass('active'); - // Shows the forgot password page. - } - - function renderUpdateAccount() { - let page = $('.updateaccount-elem') - let menuOption = $('#menu-account') - page.addClass('visible'); - menuOption.addClass('active'); - // Shows the forgot password page. - } - - function renderAccountLinking() { - let page = $('.accountlinking-elem') - let menuOption = $('#menu-accountlinking') - page.addClass('visible'); - menuOption.addClass('active'); - // Shows the forgot password page. - } - - function renderCustomObjects() { - let page = $('.customobj-elem') - let menuOption = $('#menu-customobjects') - page.addClass('visible'); - menuOption.addClass('active'); - // Shows the forgot password page. - } - - function renderMultifactor() { - let page = $('.multifactor-elem') - let menuOption = $('#menu-multifactor') - page.addClass('visible'); - menuOption.addClass('active'); - // Shows the forgot password page. - } - - function renderRoles() { - let page = $('.roles-elem') - let menuOption = $('#menu-roles') - page.addClass('visible'); - menuOption.addClass('active'); - // Shows the forgot password page. - } - - function renderErrorPage() { - // Shows the error page. - } - -}); \ No newline at end of file diff --git a/demo/src/main/resources/static/js/resetPassword.js b/demo/src/main/resources/static/js/resetPassword.js deleted file mode 100755 index 7dead23..0000000 --- a/demo/src/main/resources/static/js/resetPassword.js +++ /dev/null @@ -1,50 +0,0 @@ -$(function() { - resetPasswordHandler(); -}); - -function resetPasswordHandler() { - if (getUrlParameter("vtype") === 'reset') { - $('#btn-minimal-resetpassword').on('click', function() { - if ($("#minimal-resetpassword-password").val() !== $("#minimal-resetpassword-confirmpassword").val()) { - $("#minimal-resetpassword-message").text("Passwords do not match!"); - $("#minimal-resetpassword-message").attr("class", "error-message"); - return; - } - - $.ajax({ - type: "PUT", - url: "/password/reset", - dataType: "json", - data: $.param({ - password: $("#minimal-resetpassword-password").val(), - token: getUrlParameter("vtoken") - }), - success: function(res) { - console.log("Reset success::", res); - $("#minimal-resetpassword-message").text("Password reset successful."); - $("#minimal-resetpassword-message").attr("class", "success-message"); - }, - error: function(xhr, status, error) { - console.log("Reset err::", xhr.responseText); - $("#minimal-resetpassword-message").text(xhr.responseText); - $("#minimal-resetpassword-message").attr("class", "error-message"); - } - }); - }); - } -} - -function getUrlParameter(sParam) { - var sPageURL = decodeURIComponent(window.location.search.substring(1)), - sURLVariables = sPageURL.split('&'), - sParameterName, - i; - - for (i = 0; i < sURLVariables.length; i++) { - sParameterName = sURLVariables[i].split('='); - - if (sParameterName[0] === sParam) { - return sParameterName[1] === undefined ? true : sParameterName[1]; - } - } -} \ No newline at end of file diff --git a/demo/src/main/resources/templates/emailverification.html b/demo/src/main/resources/templates/emailverification.html deleted file mode 100755 index 1e871d7..0000000 --- a/demo/src/main/resources/templates/emailverification.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - SDK Demo Verification Page - - - - - - - -
- -
-
-

Email Verification

-
- -
-
- - - - diff --git a/demo/src/main/resources/templates/index.html b/demo/src/main/resources/templates/index.html deleted file mode 100755 index 3fe31cd..0000000 --- a/demo/src/main/resources/templates/index.html +++ /dev/null @@ -1,98 +0,0 @@ - - - - - SDK Demo Index Page - - - - - - - - - -
- - -
-
- - -
-

Forgot Password

-
- - -
Email Address:
-
- -
-
-
- - - - - diff --git a/demo/src/main/resources/templates/loginscreen.html b/demo/src/main/resources/templates/loginscreen.html deleted file mode 100755 index e334c1c..0000000 --- a/demo/src/main/resources/templates/loginscreen.html +++ /dev/null @@ -1,34 +0,0 @@ - - - - - SDK Demo Index Page - - - - - - - - - - -
- -
-
-
-
- - - - diff --git a/demo/src/main/resources/templates/profile.html b/demo/src/main/resources/templates/profile.html deleted file mode 100755 index e4d927b..0000000 --- a/demo/src/main/resources/templates/profile.html +++ /dev/null @@ -1,188 +0,0 @@ - - - - - SDK Demo Account Page - - - - - - - - - - -
-
-

Profile

-
-
- -
-
-
-
- -
-
-
-

Change Password

-
- - - -
Old Password:
New Password:
-
- -
-
-
-

Set Password

-
- Password:
-
- -
-
-
-

Account Linking

-
-
-
- -
-
-
-

Update Account

-
- - - - -
First Name:
Last Name:
About:
-
- -
-
-
-

Custom Object Management

-
- - - - -
Create
Object Name:
Data:
-
- -
- - - - - - -
Update
Object Name:
Object ID:
Data:
-
- -
- - - - - -
Delete
Object Name:
Object ID:
-
- -
- - - -
- - Read
- Object Name:
-
- -

-
-
-
-

Configure MultiFactor

-
- Reset Authenticator
-
- - -
-
-
-

Roles Management

-
- All Roles
- - - - - - -
Role
-
- - Create Role
- Role:
-
- -
- - Delete Role
- Role:
-
- -
- - Current User Role(s)
- - - - - - -
Role
-
- - Assign Role to User
- Role:
-
- -
-
-
-
- - - - - diff --git a/demo/src/main/resources/templates/resetpassword.html b/demo/src/main/resources/templates/resetpassword.html deleted file mode 100755 index 754e876..0000000 --- a/demo/src/main/resources/templates/resetpassword.html +++ /dev/null @@ -1,41 +0,0 @@ - - - - - SDK Demo Reset Password Page - - - - - - - -
- -
-
-
-

Reset Password

-
- - - -
Password:
Confirm Password:
-
- -
-
-
- - - - diff --git a/docs/API.md b/docs/API.md new file mode 100644 index 0000000..3fcc770 --- /dev/null +++ b/docs/API.md @@ -0,0 +1,866 @@ + + +# API index + +Every operation the LoginRadius API exposes — 392 across +57 services — with the method name this SDK gives it and the +endpoint it calls. + +This is the SDK's API reference. No `-javadoc.jar` is attached to releases, so +there is nothing on javadoc.io to consult; `mvn javadoc:javadoc` builds the +Javadoc locally if you want signatures and parameter docs. Javadoc would not +carry the HTTP verb and path in any case — that fact lives in the OpenAPI spec, +not in the code — so this index is generated from the spec and cannot drift. + +Call any of these as `client..(...)`, e.g. +`client.login.checkUserNameAvailability(...)`. The README's service list gives +the field name for each service. + +## [Account Custom Object](./apis/account-custom-object.md) + +5 operation(s). Parameters, request bodies and return types are +on the [Account Custom Object](./apis/account-custom-object.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `createCustomObject` | **POST** `/identity/v2/manage/account/{uid}/customobject` | Create Custom Object | +| `deleteCustomObjectByUidAndRecordId` | **DELETE** `/identity/v2/manage/account/{uid}/customobject/{objectrecordid}` | Delete Custom Object | +| `getCustomObjectByUid` | **GET** `/identity/v2/manage/account/{uid}/customobject` | List Custom Objects | +| `getCustomObjectByUidAndRecordId` | **GET** `/identity/v2/manage/account/{uid}/customobject/{objectrecordid}` | Retrieve Custom Object | +| `updateCustomObjectByUidAndRecordId` | **PUT** `/identity/v2/manage/account/{uid}/customobject/{objectrecordid}` | Update Custom Object | + +## [Account Security](./apis/account-security.md) + +10 operation(s). Parameters, request bodies and return types are +on the [Account Security](./apis/account-security.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `mfaGenerateBackupCodesByUid` | **GET** `/identity/v2/manage/account/2fa/backupcode` | Generate Backup Codes | +| `mfaResetBackupCodesByUid` | **GET** `/identity/v2/manage/account/2fa/backupcode/reset` | Reset Backup Codes | +| `mFAResetSMSAuthByUid` | **DELETE** `/identity/v2/manage/account/2fa/sms` | Reset SMS Authenticator | +| `mFAResetTotpByUid` | **DELETE** `/identity/v2/manage/account/2fa/totp` | Reset TOTP | +| `resetDuoAuthByUid` | **DELETE** `/identity/v2/manage/account/2fa/duo` | Reset Duo | +| `resetEmailAuthenticatorByUid` | **DELETE** `/identity/v2/manage/account/2fa/email` | Reset Email OTP | +| `resetMfaPasskeyByUid` | **DELETE** `/identity/v2/manage/account/2fa/passkey` | Reset MFA Passkey | +| `resetMfaPushByUid` | **DELETE** `/identity/v2/manage/account/2fa/push` | Reset MFA Push Notification | +| `validateSecondFactorTokenForPassword` | **POST** `/identity/v2/manage/account/{uid}/reauth/password` | Verify Password MFA Token | +| `validateSecondFactorTokenForPin` | **POST** `/identity/v2/manage/account/{uid}/reauth/pin` | Verify PIN MFA Token | + +## [Account Session](./apis/account-session.md) + +8 operation(s). Parameters, request bodies and return types are +on the [Account Session](./apis/account-session.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `getAccessToken` | **GET** `/api/v2/access_token` | Retrieve Access Token | +| `getActiveSession` | **GET** `/api/v2/access_token/activesession` | Retrieve active session | +| `nativeInvalidateAccessToken` | **GET** `/api/v2/access_token/invalidate` | Invalidate Access Token | +| `nativeRefreshAccessToken` | **GET** `/api/v2/access_token/refresh` | Refresh Access Token | +| `refreshAccessToken` | **GET** `/identity/v2/manage/account/access_token/refresh` | Refresh Access Token | +| `revokeAllRefreshToken` | **DELETE** `/identity/v2/manage/account/{uid}/access_token/refresh/revoke` | Revoke refresh tokens | +| `revokeRefreshToken` | **GET** `/identity/v2/manage/account/access_token/refresh/revoke` | Revoke Refresh Token | +| `validateAccessToken` | **GET** `/api/v2/access_token/validate` | Validate Access Token | + +## [Accounts](./apis/accounts.md) + +20 operation(s). Parameters, request bodies and return types are +on the [Accounts](./apis/accounts.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `createUser` | **POST** `/identity/v2/manage/account` | Create Account | +| `deleteAccountByEmail` | **DELETE** `/identity/v2/manage/account` | Delete Account by Email | +| `deleteAccountByUID` | **DELETE** `/identity/v2/manage/account/{uid}` | Delete Account by UID | +| `deleteEmailFromAccount` | **DELETE** `/identity/v2/manage/account/{uid}/email` | Delete Email | +| `deletePasskeyByUid` | **DELETE** `/identity/v2/manage/account/passkey/{passkeyId}` | Delete Passkey | +| `generateSott` | **GET** `/identity/v2/manage/account/sott` | Generate SOTT | +| `getAccountIdentity` | **GET** `/identity/v2/manage/account` | Retrieve Account | +| `getAccountIdentityByUID` | **GET** `/identity/v2/manage/account/{uid}` | Retrieve Account by UID | +| `getConsentLogsByUid` | **GET** `/identity/v2/manage/account/{uid}/consent/logs` | Retrieve Consent Logs | +| `getIdentities` | **GET** `/identity/v2/manage/account/identities` | Retrieve Account by Email | +| `getImpersonationToken` | **GET** `/identity/v2/manage/account/access_token` | Retrieve Impersonation Token | +| `getPrivacyPolicyHistoryByUid` | **GET** `/identity/v2/manage/account/{uid}/privacypolicy/history` | Retrieve Privacy Policy History | +| `getProfilePassword` | **GET** `/identity/v2/manage/account/{uid}/password` | Retrieve Password | +| `invalidateEmailVerification` | **PUT** `/identity/v2/manage/account/{uid}/invalidateemail` | Invalidate Email Verification | +| `listPasskeyUser` | **GET** `/identity/v2/manage/account/passkey` | List Passkeys | +| `resetPhoneVerification` | **PUT** `/identity/v2/manage/account/{uid}/invalidatephone` | Invalidate Phone verification | +| `setProfilePassword` | **PUT** `/identity/v2/manage/account/{uid}/password` | Update Password | +| `updateAccountProfileByUID` | **PUT** `/identity/v2/manage/account/{uid}` | Update Account by UID | +| `updatePhoneNumber` | **PUT** `/identity/v2/manage/account/{uid}/phoneid` | Update Phone | +| `upsertEmailForAccount` | **PUT** `/identity/v2/manage/account/{uid}/email` | Upsert Email | + +## [BigCommerce SSO](./apis/bigcommerce-sso.md) + +4 operation(s). Parameters, request bodies and return types are +on the [BigCommerce SSO](./apis/bigcommerce-sso.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `bigCommerceAuth` | **GET** `/sso/bigcommerce/auth` | BigCommerce OAuth Authorization | +| `getBigCommerceLoginUrl` | **GET** `/sso/bigcommerce/api/token` | Generate BigCommerce Login URL (GET) | +| `postBigCommerceLoginUrl` | **POST** `/sso/bigcommerce/api/token` | Generate BigCommerce Login URL (POST) | +| `validateBigCommercePassword` | **POST** `/sso/bigcommerce/api/validatepassword` | Validate BigCommerce Customer Password | + +## [Captcha Configuration](./apis/captcha-configuration.md) + +2 operation(s). Parameters, request bodies and return types are +on the [Captcha Configuration](./apis/captcha-configuration.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `getCaptchaConfiguration` | **GET** `/v2/manage/captcha` | Retrieve captcha configuration | +| `updateCaptchaConfiguration` | **PUT** `/v2/manage/captcha` | Update captcha configuration | + +## [Consent](./apis/consent.md) + +7 operation(s). Parameters, request bodies and return types are +on the [Consent](./apis/consent.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `addConsentForm` | **POST** `/consent/forms` | Add Consent Form | +| `createConsentOption` | **POST** `/consent/options` | Create Consent Option | +| `deleteConsentForm` | **DELETE** `/consent/forms/{version}` | Delete Consent Form | +| `deleteConsentOption` | **DELETE** `/consent/options/{optionId}` | Delete Consent Option | +| `getActiveConsentForms` | **GET** `/consent/forms/active` | Retrieve Active Consent Forms | +| `getConsentForms` | **GET** `/consent/forms` | Retrieve Consent Forms | +| `getConsentOptions` | **GET** `/consent/options` | Retrieve Consent Options | + +## [Cross Device SSO](./apis/cross-device-sso.md) + +3 operation(s). Parameters, request bodies and return types are +on the [Cross Device SSO](./apis/cross-device-sso.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `generateQRCode` | **GET** `/sso/mobile/generate` | Retrieve QR code | +| `getAccessTokenByPing` | **GET** `/sso/mobile/token` | Retrieve Access Token by ping | +| `mapQRCodeToAccessToken` | **POST** `/sso/mobile/token` | Map QR code to Access Token | + +## [Custom Fields](./apis/custom-fields.md) + +7 operation(s). Parameters, request bodies and return types are +on the [Custom Fields](./apis/custom-fields.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `createCustomField` | **POST** `/v2/manage/custom-fields` | Create custom field | +| `deleteCustomField` | **DELETE** `/v2/manage/custom-fields/{cfname}` | Delete custom field | +| `getActiveCustomFields` | **GET** `/v2/manage/custom-fields/active` | List active custom fields | +| `getAllCustomFields` | **GET** `/v2/manage/custom-fields` | List custom fields | +| `getCustomFieldLimit` | **GET** `/v2/manage/custom-fields/limit` | Retrieve custom field limit | +| `listCustomFields` | **GET** `/v2/manage/custom-fields/list` | List custom fields | +| `setCustomField` | **PUT** `/v2/manage/custom-fields` | Set custom field | + +## [Custom Object](./apis/custom-object.md) + +5 operation(s). Parameters, request bodies and return types are +on the [Custom Object](./apis/custom-object.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `createCustomObjectByToken` | **POST** `/identity/v2/auth/customobject` | Create Custom Object | +| `deleteCustomObjectByTokenAndRecordId` | **DELETE** `/identity/v2/auth/customobject/{objectrecordid}` | Delete Custom Object by ID | +| `getCustomObjectByToken` | **GET** `/identity/v2/auth/customobject` | Retrieve Custom Objects | +| `getCustomObjectByTokenAndRecordId` | **GET** `/identity/v2/auth/customobject/{objectrecordid}` | Retrieve Custom Object by ID | +| `updateCustomObjectByTokenAndRecordId` | **PUT** `/identity/v2/auth/customobject/{objectrecordid}` | Update Custom Object by ID | + +## [Custom Objects](./apis/custom-objects.md) + +4 operation(s). Parameters, request bodies and return types are +on the [Custom Objects](./apis/custom-objects.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `getAllCustomObjectsByQuery` | **GET** `/customobject` | Retrieve Custom Object data by pagination | +| `getCustomObjectByQuery` | **GET** `/identity/customobject` | Retrieve User's and Custom Object data by pagination | +| `postAllCustomObjectsByQuery` | **POST** `/customobject` | Retrieve Custom Object data by query | +| `postCustomObjectByQuery` | **POST** `/identity/customobject` | Retrieve User's and Custom Object data by query | + +## [Domain Access Restrictions](./apis/domain-access-restrictions.md) + +2 operation(s). Parameters, request bodies and return types are +on the [Domain Access Restrictions](./apis/domain-access-restrictions.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `getDomainAccessRestrictionsByAppID` | **GET** `/v2/manage/restrictions/domain-access` | Retrieve Domain Access Restrictions | +| `updateDomainAccessRestrictionsByAppID` | **PUT** `/v2/manage/restrictions/domain-access` | Update Domain Access Restrictions | + +## [Email Templates](./apis/email-templates.md) + +4 operation(s). Parameters, request bodies and return types are +on the [Email Templates](./apis/email-templates.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `addEmailTemplate` | **POST** `/v2/manage/email-templates` | Create Email template | +| `deleteEmailTemplate` | **DELETE** `/v2/manage/email-templates/{templateType}` | Delete Email Template | +| `getEmailTemplates` | **GET** `/v2/manage/email-templates` | List Email templates | +| `updateEmailTemplate` | **PUT** `/v2/manage/email-templates/{templateType}` | Update Email Template | + +## [Identity](./apis/identity.md) + +2 operation(s). Parameters, request bodies and return types are +on the [Identity](./apis/identity.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `getUserProfilesByPageId` | **GET** `/identity` | Retrieve User's by pagination | +| `queryUserProfiles` | **POST** `/identity` | Retrieve User's by query | + +## [Insights](./apis/insights.md) + +1 operation(s). Parameters, request bodies and return types are +on the [Insights](./apis/insights.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `queryUserProfilesInsights` | **POST** `/insights/userprofiles` | Retrieve User's data by filters | + +## [IP Access Restrictions](./apis/ip-access-restrictions.md) + +3 operation(s). Parameters, request bodies and return types are +on the [IP Access Restrictions](./apis/ip-access-restrictions.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `getIPAccessRestrictions` | **GET** `/v2/manage/restrictions/ip-access` | Retrieve IP Access Restrictions | +| `resetIPAccessRestrictions` | **DELETE** `/v2/manage/restrictions/ip-access` | Reset IP Access Restrictions | +| `updateIPAccessRestrictions` | **PUT** `/v2/manage/restrictions/ip-access` | Update IP Access Restrictions | + +## [JWT](./apis/jwt.md) + +2 operation(s). Parameters, request bodies and return types are +on the [JWT](./apis/jwt.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `getJWTTokenByAccessToken` | **GET** `/api/jwt/{JwtAppName}/token` | Retrieve JWT token by Access Token | +| `getJWTTokenByLoginCredentials` | **POST** `/api/jwt/{JwtAppName}/login` | Retrieve JWT token | + +## [JWT Custom Providers](./apis/jwt-custom-providers.md) + +5 operation(s). Parameters, request bodies and return types are +on the [JWT Custom Providers](./apis/jwt-custom-providers.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `createJwtSPClientConfiguration` | **POST** `/v2/manage/custom-providers/jwt` | Create JWT SP configuration | +| `deleteJwtSPClientConfigurationByAppName` | **DELETE** `/v2/manage/custom-providers/jwt/{jwtApp}` | Delete JWT SP configuration | +| `getAllJwtConfigSPConfigurations` | **GET** `/v2/manage/custom-providers/jwt` | List JWT SP configurations | +| `getJwtSPClientConfigurationByAppName` | **GET** `/v2/manage/custom-providers/jwt/{jwtApp}` | Retrieve JWT SP configuration | +| `updateJwtSPClientConfigurationByAppName` | **PUT** `/v2/manage/custom-providers/jwt/{jwtApp}` | Update JWT SP configuration | + +## [JWT Integrations](./apis/jwt-integrations.md) + +7 operation(s). Parameters, request bodies and return types are +on the [JWT Integrations](./apis/jwt-integrations.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `createJwtIntegration` | **POST** `/v2/manage/integrations/jwt` | Create JWT Integration | +| `deleteJwtIntegration` | **DELETE** `/v2/manage/integrations/jwt/{jwtApp}` | Delete JWT Integration configuration | +| `getAllJwtIntegrations` | **GET** `/v2/manage/integrations/jwt` | List JWT Integrations | +| `getJwtIntegrationByAppName` | **GET** `/v2/manage/integrations/jwt/{jwtApp}` | Retrieve JWT Integration configuration | +| `getJwtIntegrationDataMappingFieldsList` | **GET** `/v2/manage/integrations/jwt/data-mapping` | List JWT data mapping fields | +| `getJwtIntegrationSupportedAlgoList` | **GET** `/v2/manage/integrations/jwt/algo` | List supported JWT algorithms | +| `updateJwtIntegrationByAppName` | **PUT** `/v2/manage/integrations/jwt/{jwtApp}` | Update JWT Integration configuration | + +## [Login](./apis/login.md) + +28 operation(s). Parameters, request bodies and return types are +on the [Login](./apis/login.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `accountRegisterPasskeyBegin` | **GET** `/identity/v2/auth/account/register/passkey/begin` | Begin Passkey registration | +| `accountRegisterPasskeyFinish` | **POST** `/identity/v2/auth/account/register/passkey/finish` | Complete Passkey registration | +| `beginAutofillPasskeyLogin` | **GET** `/identity/v2/auth/login/passkey/autofill/begin` | Initiate Login with Autofill Passkey | +| `beginPasskeyLogin` | **GET** `/identity/v2/auth/login/passkey/begin` | Initiate Login with Passkey | +| `beginPasskeyReset` | **GET** `/identity/v2/auth/passkey/reset/begin` | Begin Passkey Reset | +| `checkUserNameAvailability` | **GET** `/identity/v2/auth/username` | Check Username availability | +| `emailByLoginUserNamePhone` | **POST** `/identity/v2/auth/login` | Login with credentials | +| `finishAutofillPasskeyLogin` | **POST** `/identity/v2/auth/login/passkey/autofill/finish` | Complete Login with Autofill Passkey | +| `finishPasskeyLogin` | **POST** `/identity/v2/auth/login/passkey/finish` | Complete Login with Passkey | +| `finishPasskeyReset` | **POST** `/identity/v2/auth/passkey/reset/finish` | Complete Passkey Reset | +| `getPhoneNumberAvailability` | **GET** `/identity/v2/auth/phone` | Check Phone availability | +| `getSmartLogin` | **GET** `/identity/v2/auth/login/smartlogin` | Retrieve OTP or Link for Smart Login | +| `loginByNoRegistrationPassCode` | **POST** `/identity/v2/auth/onetouchlogin/phone/verify` | Verify one-touch login | +| `nativeProviderAccessToken` | **GET** `/api/v2/access_token/{nativeProvider}` | Login via social provider | +| `oneTouchLoginByEmail` | **POST** `/identity/v2/auth/onetouchlogin/email` | Retrieve link or OTP for one-touch login | +| `oneTouchLoginByPhone` | **POST** `/identity/v2/auth/onetouchlogin/phone` | Retrieve OTP for one-touch login | +| `passkeyForgot` | **POST** `/identity/v2/auth/passkey/forgot` | Initiate Forgot Passkey | +| `passwordlessEmailVerification` | **GET** `/identity/v2/auth/login/passwordlesslogin/email/verify` | Verify Email for passwordless login | +| `passwordlessLoginByEmail` | **GET** `/identity/v2/auth/login/passwordlesslogin/email` | Initiate passwordless login by Email | +| `passwordlessLoginByEmailAndOTP` | **POST** `/identity/v2/auth/login/passwordlesslogin/email/verifyotp` | Verify Email and OTP for passwordless login | +| `passwordlessLoginByEmailWithProfile` | **POST** `/identity/v2/auth/login/passwordlesslogin/email` | Initiate passwordless login by Email with a registration profile | +| `passwordlessLoginByPhone` | **GET** `/identity/v2/auth/login/passwordlesslogin/otp` | Initiate passwordless login by Phone | +| `passwordlessLoginByPhoneWithProfile` | **POST** `/identity/v2/auth/login/passwordlesslogin/otp` | Initiate passwordless login by Phone with a registration profile | +| `passwordlessLoginByUsernameAndOTP` | **POST** `/identity/v2/auth/login/passwordlesslogin/username/verifyotp` | Verify Username for passwordless login | +| `passwordlessLoginPhoneVerification` | **PUT** `/identity/v2/auth/login/passwordlesslogin/otp/verify` | Verify Phone for passwordless login | +| `pingSmartLogin` | **GET** `/identity/v2/auth/login/smartlogin/ping` | Ping Smart Login | +| `verifyAutoLoginEmailOneTouch` | **GET** `/identity/v2/auth/email/onetouchlogin` | Verify one-touch login by Email | +| `verifyAutoLoginEmailSmartLogin` | **GET** `/identity/v2/auth/email/smartlogin` | Verify smart login by Email | + +## [Multipurpose Tokens](./apis/multipurpose-tokens.md) + +4 operation(s). Parameters, request bodies and return types are +on the [Multipurpose Tokens](./apis/multipurpose-tokens.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `forgotPasswordTokenAndEmail` | **POST** `/identity/v2/manage/account/forgot/token` | Retrieve Forgot Password Token | +| `getVerificationToken` | **GET** `/identity/v2/manage/account/vtoken` | Retrieve Email Verification Token | +| `multipurposeEmailTokenAPI` | **POST** `/identity/v2/manage/account/emailtoken/{tokentype}` | Retrieve Multipurpose Email Token | +| `multipurposeSmsOtpAPI` | **POST** `/identity/v2/manage/account/smsotp/{smsotptype}` | Multipurpose SMS OTP | + +## [OAuth](./apis/oauth.md) + +6 operation(s). Parameters, request bodies and return types are +on the [OAuth](./apis/oauth.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `getOAuthAuthorizationServerMetadataOAuth` | **GET** `/service/oauth/{OAuthAppName}/.well-known/oauth-authorization-server` | OAuth Authorization Server Metadata (OAuth app) | +| `getOAuthDeviceCode` | **POST** `/api/oauth/{OAuthAppName}/device` | Retrieve OAuth device code | +| `getOAuthTokens` | **POST** `/api/oauth/{OAuthAppName}/token` | Retrieve OAuth tokens | +| `introspectOAuthToken` | **POST** `/api/oauth/{OAuthAppName}/introspect` | Introspect OAuth token | +| `oAuthPushedAuthorizationRequest` | **POST** `/api/oauth/{OAuthAppName}/par` | OAuth 2.0 Pushed Authorization Request (PAR) | +| `revokeOAuthRefreshToken` | **POST** `/api/oauth/{OAuthAppName}/revoke` | Revoke OAuth refresh token | + +## [OAuth Clients](./apis/oauth-clients.md) + +7 operation(s). Parameters, request bodies and return types are +on the [OAuth Clients](./apis/oauth-clients.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `createOAuthClientConfiguration` | **POST** `/v2/manage/oauth-clients` | Create OAuth client | +| `deleteOAuthClient` | **DELETE** `/v2/manage/oauth-clients/{oAuthClientName}` | Delete OAuth Client Configuration | +| `getAllOAuthClientsConfigurations` | **GET** `/v2/manage/oauth-clients` | List OAuth clients | +| `getOAuthClientConfigurationByAppName` | **GET** `/v2/manage/oauth-clients/{oAuthClientName}` | Retrieve OAuth Client Configuration | +| `getOAuthClientConnectionsMetadata` | **GET** `/v2/manage/oauth-clients/connections-metadata` | Retrieve OAuth Client Metadata | +| `resetOAuthClientConfigurationSecretByAppName` | **PUT** `/v2/manage/oauth-clients/credentials/{oAuthClientName}` | Reset OAuth client secret | +| `updateOAuthClientConfigurationByAppName` | **PUT** `/v2/manage/oauth-clients/{oAuthClientName}` | Update OAuth Client Configuration | + +## [OAuth Custom Providers](./apis/oauth-custom-providers.md) + +5 operation(s). Parameters, request bodies and return types are +on the [OAuth Custom Providers](./apis/oauth-custom-providers.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `createCustomProvider` | **POST** `/v2/manage/custom-providers/oauth` | Create custom OAuth provider | +| `deleteCustomProvider` | **DELETE** `/v2/manage/custom-providers/oauth` | Delete custom OAuth provider | +| `getAllCustomOAuthProviders` | **GET** `/v2/manage/custom-providers/oauth` | List custom OAuth providers | +| `getCustomProviderKeys` | **GET** `/v2/manage/custom-providers/oauth/keys` | Retrieve custom OAuth provider keys | +| `updateCustomProvider` | **PUT** `/v2/manage/custom-providers/oauth` | Update custom OAuth provider | + +## [OAuth Integrations](./apis/oauth-integrations.md) + +6 operation(s). Parameters, request bodies and return types are +on the [OAuth Integrations](./apis/oauth-integrations.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `createOAuthIntegration` | **POST** `/v2/manage/integrations/oauth` | Create OAuth Integration | +| `deleteOAuthIntegration` | **DELETE** `/v2/manage/integrations/oauth/{integrationId}` | Delete OAuth Integration configuration | +| `getAllOAuthIntegrations` | **GET** `/v2/manage/integrations/oauth` | List OAuth Integrations | +| `getOAuthIntegrationById` | **GET** `/v2/manage/integrations/oauth/{integrationId}` | Retrieve OAuth Integration configuration | +| `rotateOAuthIntegrationCredentials` | **PUT** `/v2/manage/integrations/oauth/{integrationId}/credentials` | Rotate OAuth Integration client secret | +| `updateOAuthIntegrationById` | **PUT** `/v2/manage/integrations/oauth/{integrationId}` | Update OAuth Integration configuration | + +## [OAuth M2M](./apis/oauth-m2m.md) + +4 operation(s). Parameters, request bodies and return types are +on the [OAuth M2M](./apis/oauth-m2m.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `generateM2MToken` | **POST** `/service/oauth/token` | Generate M2M token | +| `getM2MJWKSConfig` | **GET** `/service/oauth/jwks` | Retrieve JSON Web Key Set | +| `getM2MTokenInfo` | **POST** `/service/oauth/introspect` | Retrieve M2M token info | +| `revokeM2MToken` | **POST** `/service/oauth/revoke` | Revoke M2M token | + +## [OIDC](./apis/oidc.md) + +14 operation(s). Parameters, request bodies and return types are +on the [OIDC](./apis/oidc.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `deleteDynamicClient` | **DELETE** `/api/oidc/{OIDCAppName}/register/{clientID}` | Delete a Dynamic Client | +| `getDynamicClient` | **GET** `/api/oidc/{OIDCAppName}/register/{clientID}` | Get a Dynamic Client | +| `getOAuthAuthorizationServerMetadataOIDC` | **GET** `/service/oidc/{OIDCAppName}/.well-known/oauth-authorization-server` | OAuth Authorization Server Metadata (OIDC app) | +| `getOIDCDeviceCode` | **POST** `/api/oidc/{OIDCAppName}/device` | Retrieve OIDC device code | +| `getOIDCDiscoveryConfig` | **GET** `/service/oidc/{OIDCAppName}/.well-known/openid-configuration` | OpenID Connect Discovery endpoint | +| `getOIDCJWKSConfig` | **GET** `/service/oidc/{OIDCAppName}/jwks` | Retrieve JSON Web Key Set | +| `getOIDCTokens` | **POST** `/api/oidc/{OIDCAppName}/token` | Retrieve OIDC tokens | +| `getOIDCUserinfo` | **GET** `/service/oidc/{OIDCAppName}/userinfo` | Retrieve OIDC User info | +| `getOIDCUserinfoByPost` | **POST** `/service/oidc/{OIDCAppName}/userinfo` | Retrieve OIDC User info via POST | +| `introspectOIDCToken` | **POST** `/api/oidc/{OIDCAppName}/introspect` | Introspect OIDC token | +| `oIDCDynamicClientRegistration` | **POST** `/api/oidc/{OIDCAppName}/register` | OIDC dynamic client registration | +| `oIDCPushedAuthorizationRequest` | **POST** `/api/oidc/{OIDCAppName}/par` | OIDC Pushed Authorization Request (PAR) | +| `revokeOIDCRefreshToken` | **POST** `/api/oidc/{OIDCAppName}/revoke` | Revoke OIDC refresh token | +| `updateDynamicClient` | **PUT** `/api/oidc/{OIDCAppName}/register/{clientID}` | Update a Dynamic Client | + +## [Organization](./apis/organization.md) + +8 operation(s). Parameters, request bodies and return types are +on the [Organization](./apis/organization.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `createOrganization` | **POST** `/v2/manage/organizations` | Create Organization | +| `createOrgTenantRole` | **POST** `/v2/manage/organizations/{orgId}/roles` | Create Role in Organization | +| `deleteOrganization` | **DELETE** `/v2/manage/organizations/{orgId}` | Delete Organization | +| `getAllOrganizations` | **GET** `/v2/manage/organizations` | List Organizations | +| `getOrganization` | **GET** `/v2/manage/organizations/{orgId}` | Retrieve Organization details | +| `getOrgContextByOrgId` | **GET** `/v2/manage/organizations/{orgId}/orgcontext` | Retrieve Organization context | +| `getOrgRolesByOrgId` | **GET** `/v2/manage/organizations/{orgId}/roles` | List Organization Roles | +| `updateOrganization` | **PUT** `/v2/manage/organizations/{orgId}` | Update Organization | + +## [Organization Connection Group Roles](./apis/organization-connection-group-roles.md) + +4 operation(s). Parameters, request bodies and return types are +on the [Organization Connection Group Roles](./apis/organization-connection-group-roles.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `createConnectionGroupRole` | **POST** `/v2/manage/organizations/{orgId}/connections/{connId}/grouproles` | Create Organization connection group Role | +| `deleteConnectionGroupRole` | **DELETE** `/v2/manage/organizations/{orgId}/connections/{connId}/grouproles/{groupRoleId}` | Delete Organization connection group Role | +| `getAllConnectionGroupRoles` | **GET** `/v2/manage/organizations/{orgId}/connections/{connId}/grouproles` | List Organization connection group Roles | +| `updateConnectionGroupRole` | **PUT** `/v2/manage/organizations/{orgId}/connections/{connId}/grouproles/{groupRoleId}` | Update Organization connection group Role | + +## [Organization Connections](./apis/organization-connections.md) + +6 operation(s). Parameters, request bodies and return types are +on the [Organization Connections](./apis/organization-connections.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `createOrganizationConnection` | **POST** `/v2/manage/organizations/{orgId}/connections` | Create Organization connection | +| `deleteOrganizationConnection` | **DELETE** `/v2/manage/organizations/{orgId}/connections/{connId}` | Delete Organization connection | +| `getAllOrganizationConnections` | **GET** `/v2/manage/organizations/{orgId}/connections` | List Organization connections | +| `getOrganizationConnection` | **GET** `/v2/manage/organizations/{orgId}/connections/{connId}` | Retrieve Organization connection | +| `updateConnectionStatus` | **PUT** `/v2/manage/organizations/{orgId}/connections/{connId}/status` | Update Organization connection status | +| `updateOrganizationConnection` | **PUT** `/v2/manage/organizations/{orgId}/connections/{connId}` | Update Organization connection | + +## [Organization Domains](./apis/organization-domains.md) + +5 operation(s). Parameters, request bodies and return types are +on the [Organization Domains](./apis/organization-domains.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `addOrganizationDomain` | **POST** `/v2/manage/organizations/{orgId}/domains` | Add Organization domain | +| `deleteOrganizationDomain` | **DELETE** `/v2/manage/organizations/{orgId}/domains/{domainId}` | Delete Organization domain | +| `getAllOrganizationDomains` | **GET** `/v2/manage/organizations/{orgId}/domains` | List Organization domains | +| `getOrganizationDomain` | **GET** `/v2/manage/organizations/{orgId}/domains/{domainId}` | Retrieve Organization domain | +| `verifyOrganizationDomain` | **POST** `/v2/manage/organizations/{orgId}/domains/{domainId}` | Verify Organization domain | + +## [Organization Invitations](./apis/organization-invitations.md) + +5 operation(s). Parameters, request bodies and return types are +on the [Organization Invitations](./apis/organization-invitations.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `deleteInvitationByInvitationId` | **DELETE** `/v2/manage/invitations/{invitationid}` | Delete invitation by ID | +| `getInvitationsByOrgId` | **GET** `/v2/manage/invitations` | List invitations by Organization ID | +| `resendInvitationByInvitationId` | **POST** `/v2/manage/invitations/{invitationid}/resend` | Resend invitation by ID | +| `sendInvitation` | **POST** `/v2/manage/invitations` | Send invitation | +| `updateInvitationByInvitationId` | **PUT** `/v2/manage/invitations/{invitationid}` | Update invitation by ID | + +## [Organization User Roles](./apis/organization-user-roles.md) + +6 operation(s). Parameters, request bodies and return types are +on the [Organization User Roles](./apis/organization-user-roles.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `assignRolesToUser` | **PUT** `/v2/manage/account/{uid}/orgcontext/{orgId}/roles` | Assign Roles in Organization | +| `assignRolesToUserInAllOrgs` | **PUT** `/v2/manage/account/{uid}/orgcontext/roles` | Assign Roles in Tenant | +| `deleteOrgContextByUid` | **DELETE** `/v2/manage/account/{uid}/orgcontext` | Delete Organization context by UID | +| `deleteOrgContextByUidAndOrgId` | **DELETE** `/v2/manage/account/{uid}/orgcontext/{orgId}` | Delete Organization Roles by OrgID and UID | +| `getOrgContextByUid` | **GET** `/v2/manage/account/{uid}/orgcontext` | Retrieve Organization context by UID | +| `getOrgContextByUidAndOrgId` | **GET** `/v2/manage/account/{uid}/orgcontext/{orgId}` | Retrieve Organization Roles by OrgID and UID | + +## [Passkey Configuration](./apis/passkey-configuration.md) + +2 operation(s). Parameters, request bodies and return types are +on the [Passkey Configuration](./apis/passkey-configuration.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `getPassKeyConfig` | **GET** `/v2/manage/passkey` | Retrieve Passkey configuration | +| `upsertPassKeyConfig` | **PUT** `/v2/manage/passkey` | Update Passkey configuration | + +## [Password](./apis/password.md) + +7 operation(s). Parameters, request bodies and return types are +on the [Password](./apis/password.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `changePassword` | **PUT** `/identity/v2/auth/password/change` | Update Password | +| `forgotPassword` | **POST** `/identity/v2/auth/password` | Forgot Password | +| `requestOTPForPasswordReset` | **POST** `/identity/v2/auth/password/otp` | Retrieve Password reset OTP | +| `resetPassword` | **PUT** `/identity/v2/auth/password/reset` | Reset Password with token and OTP | +| `resetPasswordByResetToken` | **PUT** `/identity/v2/auth/password` | Reset Password with token and OTP | +| `resetPasswordSecurityAnswer` | **PUT** `/identity/v2/auth/password/securityanswer` | Reset Password with security question | +| `resetPasswordWithOTP` | **PUT** `/identity/v2/auth/password/otp` | Reset Password with Phone and OTP | + +## [Password Policy](./apis/password-policy.md) + +2 operation(s). Parameters, request bodies and return types are +on the [Password Policy](./apis/password-policy.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `getPasswordPolicy` | **GET** `/v2/manage/password-policies` | Retrieve Password policy | +| `updatePasswordPolicy` | **PUT** `/v2/manage/password-policies` | Update Password policy | + +## [PerfectMind SSO](./apis/perfectmind-sso.md) + +2 operation(s). Parameters, request bodies and return types are +on the [PerfectMind SSO](./apis/perfectmind-sso.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `getPerfectMindContact` | **GET** `/sso/perfectmind/contact` | Get PerfectMind Contact IDs | +| `getPerfectMindSession` | **GET** `/sso/perfectmind/session` | Generate PerfectMind Login Session | + +## [Permissions](./apis/permissions.md) + +5 operation(s). Parameters, request bodies and return types are +on the [Permissions](./apis/permissions.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `addPermission` | **POST** `/v2/manage/permissions` | Create Permission | +| `deleteTenantPermission` | **DELETE** `/v2/manage/permissions/{id}` | Delete Permission | +| `getPermissionById` | **GET** `/v2/manage/permissions/{id}` | Retrieve Permission by ID | +| `permissions` | **GET** `/v2/manage/permissions` | List Permissions | +| `updateTenantPermission` | **PUT** `/v2/manage/permissions/{id}` | Update Permission | + +## [Push Notification Configuration](./apis/push-notification-configuration.md) + +3 operation(s). Parameters, request bodies and return types are +on the [Push Notification Configuration](./apis/push-notification-configuration.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `createPushSettings` | **POST** `/v2/manage/2fa/push-notification-settings` | Create Push Notification settings | +| `getPushSettings` | **GET** `/v2/manage/2fa/push-notification-settings` | Retrieve Push Notification settings | +| `updatePushSettings` | **PUT** `/v2/manage/2fa/push-notification-settings` | Update Push Notification settings | + +## [Registration](./apis/registration.md) + +4 operation(s). Parameters, request bodies and return types are +on the [Registration](./apis/registration.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `beginPasskeyRegistration` | **GET** `/identity/v2/auth/register/passkey/begin` | Initiate Registration with Passkey | +| `finishPasskeyRegistration` | **POST** `/identity/v2/auth/register/passkey/finish` | Complete Registration with Passkey | +| `userRegistrationByReCaptchaEmailPhoneUserName` | **POST** `/identity/v2/auth/register/captcha` | Registration by Email/Phone/Username via Captcha | +| `userRegistrationBySottEmailPhoneUserName` | **POST** `/identity/v2/auth/register` | Registration by Email/Phone/Username via SOTT | + +## [Roles](./apis/roles.md) + +7 operation(s). Parameters, request bodies and return types are +on the [Roles](./apis/roles.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `createTenantRole` | **POST** `/v2/manage/roles` | Create Tenant Role | +| `deleteTenantRole` | **DELETE** `/v2/manage/roles/{id}` | Delete Role | +| `getAllTenantRoles` | **GET** `/v2/manage/roles` | List Tenant Roles | +| `getRoleById` | **GET** `/v2/manage/roles/{id}` | Retrieve Role by ID | +| `roleByName` | **GET** `/v2/manage/roles/{name}/name` | Retrieve Role by name | +| `setDefaultRole` | **PUT** `/v2/manage/roles/{id}/default` | Set default Role | +| `updateRole` | **PUT** `/v2/manage/roles/{id}` | Update Role | + +## [Roles Management](./apis/roles-management.md) + +9 operation(s). Parameters, request bodies and return types are +on the [Roles Management](./apis/roles-management.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `deleteContextRoleByUid` | **DELETE** `/identity/v2/manage/account/{uid}/rolecontext/{contextName}/role` | Delete Role from Context | +| `deleteRoleContextAdditionalPermissionsByUid` | **DELETE** `/identity/v2/manage/account/{uid}/rolecontext/{contextName}/additionalpermission` | Delete Additional Permissions from Context | +| `deleteRoleContextByUid` | **DELETE** `/identity/v2/manage/account/{uid}/rolecontext/{contextName}` | Delete Role Context | +| `deleteRolesByUid` | **DELETE** `/identity/v2/manage/account/{uid}/role` | Unassign Roles by UID | +| `getRoleContextByContextName` | **GET** `/identity/v2/manage/account/roleContext/{contextName}` | Retrieve Role Context | +| `getRoleContextByUid` | **GET** `/identity/v2/manage/account/{uid}/rolecontext` | Retrieve Context by UID | +| `getRolesByUid` | **GET** `/identity/v2/manage/account/{uid}/role` | Retrieve Roles by UID | +| `saveRolesByUid` | **PUT** `/identity/v2/manage/account/{uid}/role` | Assign Roles by UID | +| `upsertRoleContextByUid` | **PUT** `/identity/v2/manage/account/{uid}/rolecontext` | Upsert Context by UID | + +## [SAML](./apis/saml.md) + +1 operation(s). Parameters, request bodies and return types are +on the [SAML](./apis/saml.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `getSAMLIDPMetadata` | **GET** `/service/saml/idp/metadata` | Retrieve SAML IDP metadata | + +## [SAML Custom Providers](./apis/saml-custom-providers.md) + +7 operation(s). Parameters, request bodies and return types are +on the [SAML Custom Providers](./apis/saml-custom-providers.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `createSAMLSPClientConfiguration` | **POST** `/v2/manage/custom-providers/saml` | Create SAML SP Configuration | +| `deleteSAMLSPClientConfigurationByAppName` | **DELETE** `/v2/manage/custom-providers/saml/{samlApp}` | Delete SAML SP Configuration | +| `getAllSAMLSPClientConfigurations` | **GET** `/v2/manage/custom-providers/saml` | List SAML SP Configurations | +| `getSAMLSPClientConfigurationByAppName` | **GET** `/v2/manage/custom-providers/saml/{samlApp}` | Retrieve SAML SP Configuration | +| `getSamlSPClientMappingKeys` | **GET** `/v2/manage/custom-providers/saml/keys` | Retrieve SAML SP Mapping Keys | +| `renewSAMLSppCertificate` | **POST** `/v2/manage/custom-providers/saml/{samlApp}/renew-certificate` | Renew SAML SP Certificate | +| `updateSAMLSPClientConfigurationByAppName` | **PUT** `/v2/manage/custom-providers/saml/{samlApp}` | Update SAML SP Configuration | + +## [SAML Integrations](./apis/saml-integrations.md) + +6 operation(s). Parameters, request bodies and return types are +on the [SAML Integrations](./apis/saml-integrations.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `createSamlIntegration` | **POST** `/v2/manage/integrations/saml` | Create SAML IdP Configuration | +| `deleteSamlIntegrationByAppName` | **DELETE** `/v2/manage/integrations/saml/{samlApp}` | Delete SAML IdP Configuration | +| `getAllSamlIntegrations` | **GET** `/v2/manage/integrations/saml` | List SAML Integrations | +| `getSamlIntegrationByAppName` | **GET** `/v2/manage/integrations/saml/{samlApp}` | Retrieve SAML IdP client configuration by app name | +| `renewSamlIntegrationCertificate` | **POST** `/v2/manage/integrations/saml/{samlApp}/renew-certificate` | Renew SAML IdP Certificate | +| `updateSamlIntegrationByAppName` | **PUT** `/v2/manage/integrations/saml/{samlApp}` | Update SAML IdP client configuration by app name | + +## [Second Factor Configuration](./apis/second-factor-configuration.md) + +6 operation(s). Parameters, request bodies and return types are +on the [Second Factor Configuration](./apis/second-factor-configuration.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `getDuoAuthenticatorConfiguration` | **GET** `/v2/manage/2fa/duo-authenticator-settings` | Retrieve Duo configuration | +| `getSecondFactorConfiguration` | **GET** `/v2/manage/2fa/config` | Retrieve second factor configuration | +| `getTOTPConfiguration` | **GET** `/v2/manage/2fa/totp-authenticator-settings` | Retrieve TOTP configuration | +| `updateDuoAuthenticatorConfiguration` | **PUT** `/v2/manage/2fa/duo-authenticator-settings` | Update Duo configuration | +| `updateSecondFactorConfiguration` | **PUT** `/v2/manage/2fa/config` | Update second factor configuration | +| `updateTOTPConfiguration` | **PUT** `/v2/manage/2fa/totp-authenticator-settings` | Update TOTP configuration | + +## [Security](./apis/security.md) + +51 operation(s). Parameters, request bodies and return types are +on the [Security](./apis/security.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `accountRegisterMFAPasskeyBegin` | **GET** `/identity/v2/auth/account/2fa/register/passkey/begin` | Begin MFA Passkey registration | +| `accountRegisterMFAPasskeyFinish` | **POST** `/identity/v2/auth/account/2fa/register/passkey/finish` | Complete MFA Passkey registration | +| `beginMFAPasskeyRegistration` | **GET** `/identity/v2/auth/login/2fa/register/passkey/begin` | Begin Passkey Registration with MFA Token | +| `beginPasskeyMFAVerification` | **GET** `/identity/v2/auth/login/2fa/passkey/begin` | Begin Passkey Login with MFA Token | +| `changePinByAccessToken` | **PUT** `/identity/v2/auth/pin/change` | Update PIN with Access Token | +| `duoAuthenticationReAuthVerificationByAccessToken` | **PUT** `/identity/v2/auth/account/reauth/2fa/duo` | Verify Duo | +| `duoAuthenticationVerificationByAccessToken` | **PUT** `/identity/v2/auth/account/2fa/duo` | Verify Duo authentication | +| `duoAuthVerificationByMFASecondFactorToken` | **PUT** `/identity/v2/auth/login/2fa/duo` | Verify Duo with MFA Token | +| `emailOTPAuthVerificationByAccessToken` | **PUT** `/identity/v2/auth/account/2fa/email` | Verify Email OTP | +| `finishMFAPasskeyRegistration` | **POST** `/identity/v2/auth/login/2fa/register/passkey/finish` | Complete Passkey registration | +| `finishPasskeyMFAVerification` | **POST** `/identity/v2/auth/login/2fa/passkey/finish` | Complete Passkey Login with MFA Token | +| `forgotPinByEmail` | **POST** `/identity/v2/auth/pin/forgot/email` | Send PIN Reset Email | +| `forgotPinByPhone` | **POST** `/identity/v2/auth/pin/forgot/otp` | Send OTP for PIN Reset | +| `forgotPinByUsername` | **POST** `/identity/v2/auth/pin/forgot/username` | Send PIN Reset Email by Username | +| `getMfaPushDeviceStatus` | **GET** `/identity/v2/auth/account/2fa/push/ping` | Check push device registration status | +| `getMFASettings` | **GET** `/identity/v2/auth/account/2fa` | Retrieve MFA settings | +| `mfaGenerateBackupCodes` | **GET** `/identity/v2/auth/account/2fa/backupcode` | Generate backup codes | +| `mfaResendPushNotification` | **POST** `/identity/v2/auth/login/2fa/push` | Resend Push Notification | +| `mfaResetBackupCodes` | **GET** `/identity/v2/auth/account/2fa/backupcode/reset` | Reset backup codes | +| `mFAResetSMSAuthByToken` | **DELETE** `/identity/v2/auth/account/2fa/sms` | Reset SMS Authenticator | +| `mFAResetTotpByToken` | **DELETE** `/identity/v2/auth/account/2fa/totp` | Reset TOTP | +| `mFAUpdatePhoneNumberByMfaToken` | **PUT** `/identity/v2/auth/login/2fa/sms/phone` | Update Phone with MFA Token | +| `mFAUpdatePhoneNumberByToken` | **PUT** `/identity/v2/auth/account/2fa/sms/phone` | Update Phone by token | +| `mFAVerifyPhoneNumberByAccessToken` | **PUT** `/identity/v2/auth/account/2fa/sms` | Verify Phone MFA | +| `pingPushVerificationStatus` | **GET** `/identity/v2/auth/login/2fa/push/ping` | Check Push Notification Verification Status | +| `pINLogin` | **POST** `/identity/v2/auth/login/pin` | Login with PIN | +| `reauthPassword` | **PUT** `/identity/v2/auth/account/reauth/password` | Verify Password | +| `reauthPin` | **PUT** `/identity/v2/auth/account/reauth/pin` | Verify PIN | +| `reauthTrigger` | **GET** `/identity/v2/auth/account/reauth/2fa` | Retrieve Step-Up Authentication settings | +| `resend2FAOTP` | **GET** `/identity/v2/auth/login/2fa/resend` | Resend SMS OTP with MFA Token | +| `resend2faSMSOtp` | **GET** `/identity/v2/auth/login/2fa/sms/resend` | Resend SMS OTP with MFA Token | +| `resendEmailOTPMFAToken` | **POST** `/identity/v2/auth/login/2fa/email` | Resend Email OTP with MFA Token | +| `resendTwoFactorEmailOtp` | **GET** `/identity/v2/auth/account/2fa/email` | Resend Email OTP | +| `resetDuoAuthViaAccessToken` | **DELETE** `/identity/v2/auth/account/2fa/duo` | Reset Duo Authenticator | +| `resetMFAEmailAuthByAccessToken` | **DELETE** `/identity/v2/auth/account/2fa/email` | Reset Email OTP Authenticator | +| `resetMFAPasskeyByAccessToken` | **DELETE** `/identity/v2/auth/account/2fa/passkey` | Reset Passkey Authenticator | +| `resetMfaPushAuthSettings` | **DELETE** `/identity/v2/auth/account/2fa/push` | Reset MFA Push Notification | +| `resetPinByOTP` | **PUT** `/identity/v2/auth/pin/reset/otp/{type}` | Reset PIN with OTP | +| `resetPinByResetToken` | **PUT** `/identity/v2/auth/pin/reset/token` | Reset PIN with Reset Token | +| `sendEmailOtpForReauthMFA` | **GET** `/identity/v2/auth/account/reauth/2fa/email` | Send Email OTP | +| `sendReAuthEmailOtp` | **GET** `/identity/v2/auth/account/reauth/otp/email` | Send Email OTP | +| `setPinByPinAuthToken` | **POST** `/identity/v2/auth/pin/set/pinauthtoken` | Set PIN with Authentication Token | +| `validateEmailOtpForReauth` | **PUT** `/identity/v2/auth/account/reauth/otp/email` | Verify Email OTP | +| `validateEmailOtpForReauthMFA` | **PUT** `/identity/v2/auth/account/reauth/2fa/otp/email/verify` | Verify Email OTP | +| `validateMfaOTPByEmail` | **PUT** `/identity/v2/auth/login/2fa/email` | Verify Email OTP with MFA Token | +| `validateMfaOTPByPhone` | **PUT** `/identity/v2/auth/login/2fa/sms` | Verify SMS OTP | +| `validateReauthMFA` | **PUT** `/identity/v2/auth/account/reauth/2fa/{type}` | Verify backup code or OTP | +| `validateSecurityQuestionReauthMFA` | **POST** `/identity/v2/auth/account/reauth/2fa/securityquestionanswer/verify` | Verify security question answer | +| `verify2faTOTPAuth` | **PUT** `/identity/v2/auth/account/2fa/totp` | Verify TOTP code | +| `verifyBackupCodeForMFALogin` | **PUT** `/identity/v2/auth/login/2fa/backupcode` | Verify Backup Code with MFA Token | +| `verifyTotpByMfaToken` | **PUT** `/identity/v2/auth/login/2fa/totp` | Verify TOTP Code with MFA Token | + +## [Security Questions](./apis/security-questions.md) + +6 operation(s). Parameters, request bodies and return types are +on the [Security Questions](./apis/security-questions.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `addSecurityQuestion` | **POST** `/v2/manage/security-questions` | Add security question | +| `deleteSecurityQuestion` | **DELETE** `/v2/manage/security-questions/{securityQuestionID}` | Delete security question | +| `getSecurityQuestionRenderCount` | **GET** `/v2/manage/security-questions/count` | Retrieve security question count | +| `getSecurityQuestions` | **GET** `/v2/manage/security-questions` | Retrieve security questions | +| `updateSecurityQuestion` | **PUT** `/v2/manage/security-questions/{securityQuestionID}` | Update security question | +| `updateSecurityQuestionRenderCount` | **PUT** `/v2/manage/security-questions/count` | Update security question count | + +## [Session](./apis/session.md) + +3 operation(s). Parameters, request bodies and return types are +on the [Session](./apis/session.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `authValidateAccessToken` | **GET** `/identity/v2/auth/access_token/validate` | Validate Access Token | +| `getAccessTokenInfo` | **GET** `/identity/v2/auth/access_token` | Retrieve Access Token information | +| `invalidateAccessToken` | **GET** `/identity/v2/auth/access_token/invalidate` | Invalidate Access Token | + +## [Shopify SSO](./apis/shopify-sso.md) + +1 operation(s). Parameters, request bodies and return types are +on the [Shopify SSO](./apis/shopify-sso.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `getShopifyLoginUrl` | **GET** `/sso/shopify/api/token` | Generate Shopify Multipass Login URL | + +## [SMS Templates](./apis/sms-templates.md) + +4 operation(s). Parameters, request bodies and return types are +on the [SMS Templates](./apis/sms-templates.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `createSmsTemplate` | **POST** `/v2/manage/smstemplates` | Create SMS template | +| `deleteSmsTemplate` | **DELETE** `/v2/manage/sms-templates/{templateType}` | Delete SMS template | +| `getSmsTemplates` | **GET** `/v2/manage/smstemplates` | List SMS templates | +| `updateSmsTemplate` | **PUT** `/v2/manage/sms-templates/{templateType}` | Update SMS template | + +## [Social Providers](./apis/social-providers.md) + +7 operation(s). Parameters, request bodies and return types are +on the [Social Providers](./apis/social-providers.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `deleteSocialProviderByName` | **DELETE** `/v2/manage/providers/{provider}` | Delete social provider configuration | +| `getAllProviderConfigurations` | **GET** `/v2/manage/providers` | List social provider configurations | +| `getEnabledProviders` | **GET** `/v2/manage/providers/active` | Retrieve enabled social providers | +| `getSocialProviderByName` | **GET** `/v2/manage/providers/{provider}` | Retrieve social provider configuration | +| `setProvidersOrder` | **PUT** `/v2/manage/providers/setorder` | Set social provider order | +| `setProvidersStatus` | **PUT** `/v2/manage/providers` | Set social provider status | +| `updateSocialProviderByName` | **PUT** `/v2/manage/providers/{provider}` | Update social provider configuration | + +## [SOTT](./apis/sott.md) + +2 operation(s). Parameters, request bodies and return types are +on the [SOTT](./apis/sott.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `addSott` | **POST** `/v2/manage/sott` | Generate SOTT | +| `getAllSOTT` | **GET** `/v2/manage/sott` | List SOTTs | + +## [User](./apis/user.md) + +33 operation(s). Parameters, request bodies and return types are +on the [User](./apis/user.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `accountListPasskey` | **GET** `/identity/v2/auth/account/passkey` | List registered Passkeys | +| `accountRemovePasskey` | **DELETE** `/identity/v2/auth/account/passkey/{passkeyId}` | Remove Passkey | +| `addEmail` | **POST** `/identity/v2/auth/email` | Add Email | +| `changePhoneNumber` | **PUT** `/identity/v2/auth/phone` | Change Phone number | +| `checkEmailAvailability` | **GET** `/identity/v2/auth/email` | Check Email availability | +| `deleteAccByPhoneOTP` | **POST** `/identity/v2/auth/account/delete` | Delete Account by Phone OTP | +| `deleteAccount` | **GET** `/identity/v2/auth/account/delete` | Delete Account by Email token or OTP | +| `deleteAccountByAccessToken` | **DELETE** `/identity/v2/auth/account` | Send User deletion Email | +| `deleteemailbyaccesstoken` | **DELETE** `/identity/v2/auth/email` | Remove Email | +| `getAccountDetails` | **GET** `/identity/v2/auth/account` | Retrieve User | +| `getConsentLogs` | **GET** `/identity/v2/auth/consent/logs` | Retrieve Consent Logs | +| `getInvitation` | **GET** `/identity/v2/auth/invitations/{invitation_token}` | Retrieve invitation details | +| `getInvitationByInvitationId` | **GET** `/v2/manage/invitations/{invitationid}` | Retrieve invitation by ID | +| `getPrivacyPolicyAcceptance` | **GET** `/identity/v2/auth/privacypolicy/accept` | Accept Privacy Policy | +| `getPrivacyPolicyHistory` | **GET** `/identity/v2/auth/privacypolicy/history` | Retrieve Privacy Policy History | +| `getVerifiedConsentWithAccessToken` | **GET** `/identity/v2/auth/consent/verify` | Retrieve Consent Status | +| `linkSocialIdentitiesByAccessToken` | **POST** `/identity/v2/auth/socialidentity` | Link social identities | +| `linkSocialIdentitiesByPing` | **POST** `/identity/v2/auth/socialidentity/ping` | Link social identities via PING | +| `removePhoneIdByToken` | **DELETE** `/identity/v2/auth/phone` | Remove Phone number | +| `resendEmailVerification` | **PUT** `/identity/v2/auth/register` | Resend verification Email | +| `resendPhoneOtp` | **POST** `/identity/v2/auth/phone/otp` | Resend Phone OTP | +| `sendDeleteOtp` | **GET** `/identity/v2/auth/account/otp` | Retrieve delete Account OTP | +| `sendEmailVerification` | **GET** `/identity/v2/auth/email/sendverificationemail` | Send verification Email for social profile linking | +| `sendWelcomeEmail` | **GET** `/identity/v2/auth/account/sendwelcomeemail` | Send Welcome Email | +| `setorchangeusernamebyaccesstoken` | **PUT** `/identity/v2/auth/username` | Update Username | +| `submitConsentByAccessToken` | **POST** `/identity/v2/auth/consent/profile` | Submit Consent | +| `submitConsentByConsentToken` | **POST** `/identity/v2/auth/consent` | Submit Consent with Token | +| `unlinkSocialIdentitiesByAccessToken` | **DELETE** `/identity/v2/auth/socialidentity` | Unlink social identities | +| `unlockaccountbyaccesstoken` | **PUT** `/identity/v2/auth/account/unlock` | Unlock User | +| `updateAccountByAccessToken` | **PUT** `/identity/v2/auth/account` | Update User | +| `updateConsentByAccessToken` | **PUT** `/identity/v2/auth/consent` | Update Consent Profile | +| `updateEmail` | **PUT** `/identity/v2/auth/email` | Verify Email | +| `verifyPhoneOtp` | **PUT** `/identity/v2/auth/phone/otp` | Verify Phone | + +## [User Migration](./apis/user-migration.md) + +1 operation(s). Parameters, request bodies and return types are +on the [User Migration](./apis/user-migration.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `batchUpload` | **POST** `/bulk/upsert` | Batch upload Users | + +## [Webhooks](./apis/webhooks.md) + +6 operation(s). Parameters, request bodies and return types are +on the [Webhooks](./apis/webhooks.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `createWebhookConfiguration` | **POST** `/v2/manage/webhooks` | Create webhook configuration | +| `deleteWebhookConfigurationById` | **DELETE** `/v2/manage/webhooks/{hookId}` | Delete webhook configuration | +| `getAllEvents` | **GET** `/v2/manage/webhooks/events` | List webhook events | +| `getAllWebhooksConfigurations` | **GET** `/v2/manage/webhooks` | List webhook configurations | +| `getWebhookConfigurationById` | **GET** `/v2/manage/webhooks/{hookId}` | Retrieve webhook configuration | +| `updateWebhookConfigurationById` | **PUT** `/v2/manage/webhooks/{hookId}` | Update webhook configuration | + +## [Workflows](./apis/workflows.md) + +8 operation(s). Parameters, request bodies and return types are +on the [Workflows](./apis/workflows.md) page. + +| Method | HTTP request | Description | +| --- | --- | --- | +| `addWorkflow` | **POST** `/v2/manage/workflows` | Add workflow | +| `deleteWorkflow` | **DELETE** `/v2/manage/workflows/{workflowId}` | Delete Workflow | +| `deleteWorkflowVersion` | **DELETE** `/v2/manage/workflows/{workflowId}/versions/{version}` | Delete Workflow Version | +| `getAllWorkflows` | **GET** `/v2/manage/workflows` | List workflows | +| `getAllWorkflowVersionList` | **GET** `/v2/manage/workflows/{workflowId}/versions` | List Workflow Versions | +| `getWorkflowById` | **GET** `/v2/manage/workflows/{workflowId}` | Retrieve Workflow | +| `restoreWorkflowVersion` | **PUT** `/v2/manage/workflows/{workflowId}/versions/{version}` | Restore Workflow Version | +| `updateWorkflow` | **PUT** `/v2/manage/workflows/{workflowId}` | Update Workflow | + diff --git a/docs/apis/account-custom-object.md b/docs/apis/account-custom-object.md new file mode 100644 index 0000000..379a2d7 --- /dev/null +++ b/docs/apis/account-custom-object.md @@ -0,0 +1,229 @@ + + +# Account Custom Object + +5 operation(s). Part of the [API index](../API.md). + +Call these as `client..(...)`. `` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `createCustomObject` + +**POST** `/identity/v2/manage/account/{uid}/customobject` + +Create Custom Object + +Creates a new Custom Object for the User. + +### Example + +```java +public static void callCreateCustomObject(LoginRadiusClient client) { + String uid = ""; //Required + Map requestBody = new HashMap<>(); //Required + String objectname = ""; //Optional + String customobjectid = ""; //Optional + + try { + var response = client.accountCustomObject.createCustomObject(uid, requestBody, objectname, customobjectid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | path | string | yes | The UID associated with the User | +| `objectname` | query | string | no | Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. | +| `customobjectid` | query | string | no | Unique identifier for the Custom Object record | + +### Request body + +`CustomObjectRequest` as `application/json`. + +### Returns + +`CustomObjectResponseModel` + +--- + +## `deleteCustomObjectByUidAndRecordId` + +**DELETE** `/identity/v2/manage/account/{uid}/customobject/{objectrecordid}` + +Delete Custom Object + +Deletes the Custom Object associated with the specified User using the UID and record ID. + +### Example + +```java +public static void callDeleteCustomObjectByUidAndRecordId(LoginRadiusClient client) { + String objectrecordid = ""; //Required + String uid = ""; //Required + String objectname = ""; //Optional + String customobjectid = ""; //Optional + + try { + var response = client.accountCustomObject.deleteCustomObjectByUidAndRecordId(objectrecordid, uid, objectname, customobjectid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `objectrecordid` | path | string (uuid) | yes | Unique identifier for the Custom Object record. The ID is used to target a specific Custom Object. | +| `uid` | path | string | yes | The UID associated with the User | +| `objectname` | query | string | no | Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. | +| `customobjectid` | query | string | no | Unique identifier for the Custom Object record | + +### Returns + +`IsDeleted` + +--- + +## `getCustomObjectByUid` + +**GET** `/identity/v2/manage/account/{uid}/customobject` + +List Custom Objects + +Retrieves all Custom Objects associated with the UID. + +### Example + +```java +public static void callGetCustomObjectByUid(LoginRadiusClient client) { + String uid = ""; //Required + String objectname = ""; //Optional + String customobjectid = ""; //Optional + + try { + var response = client.accountCustomObject.getCustomObjectByUid(uid, objectname, customobjectid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | path | string | yes | The UID associated with the User | +| `objectname` | query | string | no | Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. | +| `customobjectid` | query | string | no | Unique identifier for the Custom Object record | + +### Returns + +`CustomObjectsResponseModel` + +--- + +## `getCustomObjectByUidAndRecordId` + +**GET** `/identity/v2/manage/account/{uid}/customobject/{objectrecordid}` + +Retrieve Custom Object + +Retrieves the Custom Object associated with the specified User using the UID and record ID. + +### Example + +```java +public static void callGetCustomObjectByUidAndRecordId(LoginRadiusClient client) { + String objectrecordid = ""; //Required + String uid = ""; //Required + String objectname = ""; //Optional + String customobjectid = ""; //Optional + + try { + var response = client.accountCustomObject.getCustomObjectByUidAndRecordId(objectrecordid, uid, objectname, customobjectid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `objectrecordid` | path | string (uuid) | yes | Unique identifier for the Custom Object record. The ID is used to target a specific Custom Object. | +| `uid` | path | string | yes | The UID associated with the User | +| `objectname` | query | string | no | Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. | +| `customobjectid` | query | string | no | Unique identifier for the Custom Object record | + +### Returns + +`CustomObjectResponseModel` + +--- + +## `updateCustomObjectByUidAndRecordId` + +**PUT** `/identity/v2/manage/account/{uid}/customobject/{objectrecordid}` + +Update Custom Object + +Updates a Custom Object associated with the authenticated User using the UID and record ID. + +### Example + +```java +public static void callUpdateCustomObjectByUidAndRecordId(LoginRadiusClient client) { + String objectrecordid = ""; //Required + String uid = ""; //Required + String updateType = ""; //Required + Map requestBody = new HashMap<>(); //Required + String objectname = ""; //Optional + String customobjectid = ""; //Optional + + try { + var response = client.accountCustomObject.updateCustomObjectByUidAndRecordId(objectrecordid, uid, updateType, requestBody, objectname, customobjectid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `objectrecordid` | path | string (uuid) | yes | Unique identifier for the Custom Object record. The ID is used to target a specific Custom Object. | +| `uid` | path | string | yes | The UID associated with the User | +| `updateType` | query | string | yes | The type of update to be performed on the Custom Object. This parameter is used to specify whether the update should be a full update or a partial update. | +| `objectname` | query | string | no | Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. | +| `customobjectid` | query | string | no | Unique identifier for the Custom Object record | + +### Request body + +`CustomObjectRequest` as `application/json`. + +### Returns + +`CustomObjectResponseModel` + diff --git a/docs/apis/account-security.md b/docs/apis/account-security.md new file mode 100644 index 0000000..67ed538 --- /dev/null +++ b/docs/apis/account-security.md @@ -0,0 +1,381 @@ + + +# Account Security + +10 operation(s). Part of the [API index](../API.md). + +Call these as `client..(...)`. `` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `mfaGenerateBackupCodesByUid` + +**GET** `/identity/v2/manage/account/2fa/backupcode` + +Generate Backup Codes + +Generates a set of backup codes for the specified User. + +### Example + +```java +public static void callMfaGenerateBackupCodesByUid(LoginRadiusClient client) { + String uid = ""; //Required + + try { + var response = client.accountSecurity.mfaGenerateBackupCodesByUid(uid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | query | string | yes | The UID associated with the User | + +### Returns + +`MFABackUpCodeResponse` + +--- + +## `mfaResetBackupCodesByUid` + +**GET** `/identity/v2/manage/account/2fa/backupcode/reset` + +Reset Backup Codes + +Resets and generates a new set of backup codes for the specified User. + +### Example + +```java +public static void callMfaResetBackupCodesByUid(LoginRadiusClient client) { + String uid = ""; //Required + + try { + var response = client.accountSecurity.mfaResetBackupCodesByUid(uid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | query | string | yes | The UID associated with the User | + +### Returns + +`MFABackUpCodeResponse` + +--- + +## `mFAResetSMSAuthByUid` + +**DELETE** `/identity/v2/manage/account/2fa/sms` + +Reset SMS Authenticator + +Resets MFA settings for the specified User. + +### Example + +```java +public static void callMFAResetSMSAuthByUid(LoginRadiusClient client) { + String uid = ""; //Required + + try { + var response = client.accountSecurity.mFAResetSMSAuthByUid(uid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | query | string | yes | The UID associated with the User | + +### Returns + +`IsDeleted` + +--- + +## `mFAResetTotpByUid` + +**DELETE** `/identity/v2/manage/account/2fa/totp` + +Reset TOTP + +Resets MFA settings for the specified User. + +### Example + +```java +public static void callMFAResetTotpByUid(LoginRadiusClient client) { + String uid = ""; //Required + + try { + var response = client.accountSecurity.mFAResetTotpByUid(uid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | query | string | yes | The UID associated with the User | + +### Returns + +`IsDeleted` + +--- + +## `resetDuoAuthByUid` + +**DELETE** `/identity/v2/manage/account/2fa/duo` + +Reset Duo + +Resets the Duo Authenticator for the specified User. + +### Example + +```java +public static void callResetDuoAuthByUid(LoginRadiusClient client) { + String uid = ""; //Required + + try { + var response = client.accountSecurity.resetDuoAuthByUid(uid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | query | string | yes | The UID associated with the User | + +### Returns + +`IsDeleted` + +--- + +## `resetEmailAuthenticatorByUid` + +**DELETE** `/identity/v2/manage/account/2fa/email` + +Reset Email OTP + +Resets the Email OTP Authenticator for the specified User. + +### Example + +```java +public static void callResetEmailAuthenticatorByUid(LoginRadiusClient client) { + String uid = ""; //Required + + try { + var response = client.accountSecurity.resetEmailAuthenticatorByUid(uid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | query | string | yes | The UID associated with the User | + +### Returns + +`IsDeleted` + +--- + +## `resetMfaPasskeyByUid` + +**DELETE** `/identity/v2/manage/account/2fa/passkey` + +Reset MFA Passkey + +Resets the MFA Passkey for the specified User. + +### Example + +```java +public static void callResetMfaPasskeyByUid(LoginRadiusClient client) { + String uid = ""; //Required + + try { + var response = client.accountSecurity.resetMfaPasskeyByUid(uid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | query | string | yes | The UID associated with the User | + +### Returns + +`IsDeleted` + +--- + +## `resetMfaPushByUid` + +**DELETE** `/identity/v2/manage/account/2fa/push` + +Reset MFA Push Notification + +Resets the Push Notification Authenticator for the specified User. + +### Example + +```java +public static void callResetMfaPushByUid(LoginRadiusClient client) { + String uid = ""; //Required + + try { + var response = client.accountSecurity.resetMfaPushByUid(uid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | query | string | yes | The UID associated with the User | + +### Returns + +`IsDeleted` + +--- + +## `validateSecondFactorTokenForPassword` + +**POST** `/identity/v2/manage/account/{uid}/reauth/password` + +Verify Password MFA Token + +Validates and verifies the 'SecondFactorValidationToken' generated by the Step-Up Authenticate By Password API. + +### Example + +```java +public static void callValidateSecondFactorTokenForPassword(LoginRadiusClient client) { + String uid = ""; //Required + EventBasedSecondFactorToken eventBasedSecondFactorToken = new EventBasedSecondFactorToken().secondfactorvalidationtoken(""); //Required + + try { + var response = client.accountSecurity.validateSecondFactorTokenForPassword(uid, eventBasedSecondFactorToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | path | string | yes | The UID associated with the User | + +### Request body + +`EventBasedSecondFactorToken` as `application/json`. + +### Returns + +`IsValid` + +--- + +## `validateSecondFactorTokenForPin` + +**POST** `/identity/v2/manage/account/{uid}/reauth/pin` + +Verify PIN MFA Token + +Validates and verifies the 'SecondFactorValidationToken' generated by the Step-Up Authenticate By PIN API. + +### Example + +```java +public static void callValidateSecondFactorTokenForPin(LoginRadiusClient client) { + String uid = ""; //Required + EventBasedSecondFactorToken eventBasedSecondFactorToken = new EventBasedSecondFactorToken().secondfactorvalidationtoken(""); //Required + + try { + var response = client.accountSecurity.validateSecondFactorTokenForPin(uid, eventBasedSecondFactorToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | path | string | yes | The UID associated with the User | + +### Request body + +`EventBasedSecondFactorToken` as `application/json`. + +### Returns + +`IsValid` + diff --git a/docs/apis/account-session.md b/docs/apis/account-session.md new file mode 100644 index 0000000..9d30a50 --- /dev/null +++ b/docs/apis/account-session.md @@ -0,0 +1,309 @@ + + +# Account Session + +8 operation(s). Part of the [API index](../API.md). + +Call these as `client..(...)`. `` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `getAccessToken` + +**GET** `/api/v2/access_token` + +Retrieve Access Token + +Translates the Request Token obtained during authentication into an Access Token for use with other API calls. + +### Example + +```java +public static void callGetAccessToken(LoginRadiusClient client) { + String token = ""; //Required + + try { + var response = client.accountSession.getAccessToken(token); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `token` | query | string | yes | | + +### Returns + +`AccessTokenResponse` + +--- + +## `getActiveSession` + +**GET** `/api/v2/access_token/activesession` + +Retrieve active session + +Retrieves details of the current active session for the authenticated User. + +### Example + +```java +public static void callGetActiveSession(LoginRadiusClient client) { + String token = ""; //Optional + String profileid = ""; //Optional + String accountid = ""; //Optional + + try { + var response = client.accountSession.getActiveSession(token, profileid, accountid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `token` | query | string | no | | +| `profileid` | query | string | no | Account ID of the User | +| `accountid` | query | string | no | Account ID of the User | + +### Returns + +`ActiveSessionResponse` + +--- + +## `nativeInvalidateAccessToken` + +**GET** `/api/v2/access_token/invalidate` + +Invalidate Access Token + +Invalidates the specified Access Token, terminating its validity. + +### Example + +```java +public static void callNativeInvalidateAccessToken(LoginRadiusClient client) { + String accessToken = ""; //Optional + Boolean preventRefresh = true; //Optional + + try { + var response = client.accountSession.nativeInvalidateAccessToken(accessToken, preventRefresh); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | +| `preventRefresh` | query | boolean | no | Whether to prevent the token from being refreshed (true/false). | + +### Returns + +`IsPostedResponse` + +--- + +## `nativeRefreshAccessToken` + +**GET** `/api/v2/access_token/refresh` + +Refresh Access Token + +Refreshes the Access Token using a valid Refresh Token to extend session validity. The resulting token lifetime depends on the `expiresin` parameter and the User's registration profile (see the `expiresin` parameter). + +### Example + +```java +public static void callNativeRefreshAccessToken(LoginRadiusClient client) { + String accessToken = ""; //Optional + String isweb = ""; //Optional + Integer expiresin = 0; //Optional + + try { + var response = client.accountSession.nativeRefreshAccessToken(accessToken, isweb, expiresin); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | +| `isweb` | query | string | no | Indicates if the request is from a web client | +| `expiresin` | query | integer (int32) | no | Overrides the default lifetime of the Access Token. The unit and the default applied when this parameter is omitted depend on the User's registration profile: * Email profiles: the value is interpreted in minutes. When omitted, the Access Token uses the application's configured token expiry. * Social login profiles: the value is interpreted in seconds. When omitted, the Access Token adopts the expiry returned by the social provider, falling back to the application's configured token expiry if the provider returns none. | + +### Returns + +`AccessTokenResponse` + +--- + +## `refreshAccessToken` + +**GET** `/identity/v2/manage/account/access_token/refresh` + +Refresh Access Token + +Refreshes the Access Token using a Refresh Token. + +### Example + +```java +public static void callRefreshAccessToken(LoginRadiusClient client) { + String refreshToken = ""; //Required + + try { + var response = client.accountSession.refreshAccessToken(refreshToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `refresh_token` | query | string | yes | Refresh Token | + +### Returns + +`AccessTokenResponse` + +--- + +## `revokeAllRefreshToken` + +**DELETE** `/identity/v2/manage/account/{uid}/access_token/refresh/revoke` + +Revoke refresh tokens + +Revokes all active refresh tokens for a specified User. + +### Example + +```java +public static void callRevokeAllRefreshToken(LoginRadiusClient client) { + String uid = ""; //Required + + try { + var response = client.accountSession.revokeAllRefreshToken(uid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | path | string | yes | The UID associated with the User | + +### Returns + +`IsDeleted` + +--- + +## `revokeRefreshToken` + +**GET** `/identity/v2/manage/account/access_token/refresh/revoke` + +Revoke Refresh Token + +Revokes the specified Refresh Token. + +### Example + +```java +public static void callRevokeRefreshToken(LoginRadiusClient client) { + String refreshToken = ""; //Required + + try { + var response = client.accountSession.revokeRefreshToken(refreshToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `refresh_token` | query | string | yes | Refresh Token | + +### Returns + +`IsDeleted` + +--- + +## `validateAccessToken` + +**GET** `/api/v2/access_token/validate` + +Validate Access Token + +Validates the provided Access Token to ensure its authenticity and validity. + +### Example + +```java +public static void callValidateAccessToken(LoginRadiusClient client) { + String accessToken = ""; //Required + + try { + var response = client.accountSession.validateAccessToken(accessToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | yes | Access Token of the User | + +### Returns + +`AccessTokenResponse` + diff --git a/docs/apis/accounts.md b/docs/apis/accounts.md new file mode 100644 index 0000000..c92f7d8 --- /dev/null +++ b/docs/apis/accounts.md @@ -0,0 +1,827 @@ + + +# Accounts + +20 operation(s). Part of the [API index](../API.md). + +Call these as `client..(...)`. `` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `createUser` + +**POST** `/identity/v2/manage/account` + +Create Account + +Creates a new Account with the provided details. + +### Example + +```java +public static void callCreateUser(LoginRadiusClient client) { + ManageRegisterModel manageRegisterModel = new ManageRegisterModel().uid("").userName("").phoneId(""); //Required + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + + try { + var response = client.accounts.createUser(manageRegisterModel, xPreventWebhook, preventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | + +### Request body + +`ManageRegisterModel` as `application/json`. + +### Returns + +`IdentityResponseWithSocialWithoutLogins` + +--- + +## `deleteAccountByEmail` + +**DELETE** `/identity/v2/manage/account` + +Delete Account by Email + +Deletes an Account based on the specified Email. + +### Example + +```java +public static void callDeleteAccountByEmail(LoginRadiusClient client) { + String email = ""; //Optional + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + + try { + var response = client.accounts.deleteAccountByEmail(email, xPreventWebhook, preventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `email` | query | string (email) | no | Email address of the associated Account. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | + +### Returns + +`IsDeletedResponseWithCount` + +--- + +## `deleteAccountByUID` + +**DELETE** `/identity/v2/manage/account/{uid}` + +Delete Account by UID + +Deletes an Account based on the specified UID. + +### Example + +```java +public static void callDeleteAccountByUID(LoginRadiusClient client) { + String uid = ""; //Required + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + + try { + var response = client.accounts.deleteAccountByUID(uid, xPreventWebhook, preventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | path | string | yes | The UID associated with the User | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | + +### Returns + +`IsDeletedResponseWithCount` + +--- + +## `deleteEmailFromAccount` + +**DELETE** `/identity/v2/manage/account/{uid}/email` + +Delete Email + +Removes an Email from an Account. + +### Example + +```java +public static void callDeleteEmailFromAccount(LoginRadiusClient client) { + String uid = ""; //Required + EmailModelManage emailModelManage = new EmailModelManage().email(""); //Required + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + + try { + var response = client.accounts.deleteEmailFromAccount(uid, emailModelManage, xPreventWebhook, preventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | path | string | yes | The UID associated with the User | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | + +### Request body + +`EmailModelManage` as `application/json`. + +### Returns + +`Identity` + +--- + +## `deletePasskeyByUid` + +**DELETE** `/identity/v2/manage/account/passkey/{passkeyId}` + +Delete Passkey + +Removes configured Passkey for specified User. + +### Example + +```java +public static void callDeletePasskeyByUid(LoginRadiusClient client) { + String uid = ""; //Required + String passkeyId = ""; //Required + + try { + var response = client.accounts.deletePasskeyByUid(uid, passkeyId); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | query | string | yes | The UID associated with the User | +| `passkeyId` | path | string | yes | Id asscociated with the Passkey | + +### Returns + +`IsDeleted` + +--- + +## `generateSott` + +**GET** `/identity/v2/manage/account/sott` + +Generate SOTT + +Generates a Secure One Time Token (SOTT) with a given expiration time. + +### Example + +```java +public static void callGenerateSott(LoginRadiusClient client) { + String timedifference = ""; //Optional + + try { + var response = client.accounts.generateSott(timedifference); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `timedifference` | query | string | no | The time difference you would like to pass. If no value is passed, the default value is 10 minutes. | + +### Returns + +`GenerateSottResponse` + +--- + +## `getAccountIdentity` + +**GET** `/identity/v2/manage/account` + +Retrieve Account + +Retrieves Account Identity details using Email, Username, Phone, or Query parameter. + +### Example + +```java +public static void callGetAccountIdentity(LoginRadiusClient client) { + String email = ""; //Optional + String username = ""; //Optional + String phone = ""; //Optional + String q = ""; //Optional + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + + try { + var response = client.accounts.getAccountIdentity(email, username, phone, q, xPreventWebhook, preventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `email` | query | string (email) | no | Email address of the associated Account. | +| `username` | query | string | no | Username of the associated Account. | +| `phone` | query | string (phone) | no | Phone ID of the associated Account. | +| `q` | query | string | no | Query filter in `key:value` format. The key must be an indexed profile field. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | + +### Returns + +`IdentityResponseWithSocialWithoutLogins` + +--- + +## `getAccountIdentityByUID` + +**GET** `/identity/v2/manage/account/{uid}` + +Retrieve Account by UID + +Retrieves Account Identity details using the UID. + +### Example + +```java +public static void callGetAccountIdentityByUID(LoginRadiusClient client) { + String uid = ""; //Required + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + + try { + var response = client.accounts.getAccountIdentityByUID(uid, xPreventWebhook, preventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | path | string | yes | The UID associated with the User | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | + +### Returns + +`IdentityResponseWithSocialWithoutLogins` + +--- + +## `getConsentLogsByUid` + +**GET** `/identity/v2/manage/account/{uid}/consent/logs` + +Retrieve Consent Logs + +Retrieves Consent Management logs for the specified User. + +### Example + +```java +public static void callGetConsentLogsByUid(LoginRadiusClient client) { + String uid = ""; //Required + + try { + var response = client.accounts.getConsentLogsByUid(uid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | path | string | yes | The UID associated with the User | + +### Returns + +`ConsentLogsResponse` + +--- + +## `getIdentities` + +**GET** `/identity/v2/manage/account/identities` + +Retrieve Account by Email + +Retrieves Account associated with a specified Email. + +### Example + +```java +public static void callGetIdentities(LoginRadiusClient client) { + String email = ""; //Optional + String fields = ""; //Optional + + try { + var response = client.accounts.getIdentities(email, fields); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `email` | query | string (email) | no | Email address of the associated Account. | +| `fields` | query | string | no | Comma-separated list of profile fields to include in the response. | + +### Returns + +`IdentitiesResponse` + +--- + +## `getImpersonationToken` + +**GET** `/identity/v2/manage/account/access_token` + +Retrieve Impersonation Token + +Retrieves an Impersonation Token for an Account using the UID. + +### Example + +```java +public static void callGetImpersonationToken(LoginRadiusClient client) { + String uid = ""; //Required + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + + try { + var response = client.accounts.getImpersonationToken(uid, xPreventWebhook, preventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | query | string | yes | The UID associated with the User | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | + +### Returns + +`AccessToken` + +--- + +## `getPrivacyPolicyHistoryByUid` + +**GET** `/identity/v2/manage/account/{uid}/privacypolicy/history` + +Retrieve Privacy Policy History + +Retrieves the Privacy Policy acceptance history for an Account by UID. + +### Example + +```java +public static void callGetPrivacyPolicyHistoryByUid(LoginRadiusClient client) { + String uid = ""; //Required + + try { + var response = client.accounts.getPrivacyPolicyHistoryByUid(uid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | path | string | yes | The UID associated with the User | + +### Returns + +`PrivacyPolicyHistoryResponse` + +--- + +## `getProfilePassword` + +**GET** `/identity/v2/manage/account/{uid}/password` + +Retrieve Password + +Retrieves the Password details for an Account using the UID. + +### Example + +```java +public static void callGetProfilePassword(LoginRadiusClient client) { + String uid = ""; //Required + + try { + var response = client.accounts.getProfilePassword(uid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | path | string | yes | The UID associated with the User | + +### Returns + +`PasswordResponse` + +--- + +## `invalidateEmailVerification` + +**PUT** `/identity/v2/manage/account/{uid}/invalidateemail` + +Invalidate Email Verification + +Invalidates the Email Verification status for an Account using the UID. + +### Example + +```java +public static void callInvalidateEmailVerification(LoginRadiusClient client) { + String uid = ""; //Required + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + String emailtemplate = ""; //Optional + String verificationurl = ""; //Optional + + try { + var response = client.accounts.invalidateEmailVerification(uid, xPreventWebhook, preventWebhook, emailtemplate, verificationurl); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | path | string | yes | The UID associated with the User | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `emailtemplate` | query | string | no | Name of the Email template to use for this notification. | +| `verificationurl` | query | string | no | Verification URL for the User which will be included in the Email template.. | + +### Returns + +`IsPostedResponse` + +--- + +## `listPasskeyUser` + +**GET** `/identity/v2/manage/account/passkey` + +List Passkeys + +Retrieves a list of Passkeys configured for a specified User. + +### Example + +```java +public static void callListPasskeyUser(LoginRadiusClient client) { + String uid = ""; //Required + + try { + var response = client.accounts.listPasskeyUser(uid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | query | string | yes | The UID associated with the User | + +### Returns + +`PasskeyListResponse` + +--- + +## `resetPhoneVerification` + +**PUT** `/identity/v2/manage/account/{uid}/invalidatephone` + +Invalidate Phone verification + +Resets the Phone verification status for an Account using the UID. + +### Example + +```java +public static void callResetPhoneVerification(LoginRadiusClient client) { + String uid = ""; //Required + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + String smstemplate = ""; //Optional + Boolean isvoiceotp = true; //Optional + + try { + var response = client.accounts.resetPhoneVerification(uid, xPreventWebhook, preventWebhook, smstemplate, isvoiceotp); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | path | string | yes | The UID associated with the User | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `smstemplate` | query | string | no | SMS Template | +| `isvoiceotp` | query | boolean | no | Boolean flag to enforce sending SMS content via Voice. | + +### Returns + +`IsPostedResponse` + +--- + +## `setProfilePassword` + +**PUT** `/identity/v2/manage/account/{uid}/password` + +Update Password + +Sets or updates the Password for an Account using the UID. + +### Example + +```java +public static void callSetProfilePassword(LoginRadiusClient client) { + String uid = ""; //Required + PasswordModel passwordModel = new PasswordModel().password(""); //Required + + try { + var response = client.accounts.setProfilePassword(uid, passwordModel); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | path | string | yes | The UID associated with the User | + +### Request body + +`PasswordModel` as `application/json`. + +### Returns + +`PasswordResponse` + +--- + +## `updateAccountProfileByUID` + +**PUT** `/identity/v2/manage/account/{uid}` + +Update Account by UID + +Updates Account details using the UID. + +### Example + +```java +public static void callUpdateAccountProfileByUID(LoginRadiusClient client) { + String uid = ""; //Required + ManageRegisterModel manageRegisterModel = new ManageRegisterModel().uid("").userName("").phoneId(""); //Required + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + Boolean nullsupport = true; //Optional + + try { + var response = client.accounts.updateAccountProfileByUID(uid, manageRegisterModel, xPreventWebhook, preventWebhook, nullsupport); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | path | string | yes | The UID associated with the User | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `nullsupport` | query | boolean | no | Bool flag, if this flag is sent as true then the fields which are send in payload as null then in the profile as well that will be saved as null only | + +### Request body + +`ManageRegisterModel` as `application/json`. + +### Returns + +`IdentityResponseWithSocialWithoutLogins` + +--- + +## `updatePhoneNumber` + +**PUT** `/identity/v2/manage/account/{uid}/phoneid` + +Update Phone + +Updates the PhoneID associated with an Account using the UID. + +### Example + +```java +public static void callUpdatePhoneNumber(LoginRadiusClient client) { + String uid = ""; //Required + PhoneModel phoneModel = new PhoneModel().phone(""); //Required + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + + try { + var response = client.accounts.updatePhoneNumber(uid, phoneModel, xPreventWebhook, preventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | path | string | yes | The UID associated with the User | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | + +### Request body + +`PhoneModel` as `application/json`. + +### Returns + +`IdentityResponseWithSocialWithoutLogins` + +--- + +## `upsertEmailForAccount` + +**PUT** `/identity/v2/manage/account/{uid}/email` + +Upsert Email + +Adds or updates an Email associated with an Account using the UID. + +### Example + +```java +public static void callUpsertEmailForAccount(LoginRadiusClient client) { + String uid = ""; //Required + UpsertEmailModel upsertEmailModel = new UpsertEmailModel().email(""); //Required + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + + try { + var response = client.accounts.upsertEmailForAccount(uid, upsertEmailModel, xPreventWebhook, preventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | path | string | yes | The UID associated with the User | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | + +### Request body + +`UpsertEmailModel` as `application/json`. + +### Returns + +`IdentityResponseWithSocialWithoutLogins` + diff --git a/docs/apis/bigcommerce-sso.md b/docs/apis/bigcommerce-sso.md new file mode 100644 index 0000000..8c523b1 --- /dev/null +++ b/docs/apis/bigcommerce-sso.md @@ -0,0 +1,169 @@ + + +# BigCommerce SSO + +4 operation(s). Part of the [API index](../API.md). + +Call these as `client..(...)`. `` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `bigCommerceAuth` + +**GET** `/sso/bigcommerce/auth` + +BigCommerce OAuth Authorization + +Handles BigCommerce OAuth authorization callbacks. Accepts either an authorization code (for install flow) or a signed_payload (for load/uninstall callbacks). Returns an HTML page on success. + +### Example + +```java +public static void callBigCommerceAuth(LoginRadiusClient client) { + String code = ""; //Optional + String signedPayload = ""; //Optional + + try { + var response = client.bigCommerceSso.bigCommerceAuth(code, signedPayload); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `code` | query | string | no | BigCommerce OAuth authorization code | +| `signed_payload` | query | string | no | BigCommerce signed payload for load/uninstall callbacks | + +--- + +## `getBigCommerceLoginUrl` + +**GET** `/sso/bigcommerce/api/token` + +Generate BigCommerce Login URL (GET) + +Generates a BigCommerce customer login URL using the provided LoginRadius access token. If the customer does not exist in BigCommerce, it creates one. Returns a login URL that can be used to authenticate the user into BigCommerce. + +### Example + +```java +public static void callGetBigCommerceLoginUrl(LoginRadiusClient client) { + String accessToken = ""; //Required + String store = ""; //Required + String password = ""; //Optional + String returnUrl = ""; //Optional + + try { + var response = client.bigCommerceSso.getBigCommerceLoginUrl(accessToken, store, password, returnUrl); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | yes | Access Token of the User | +| `store` | query | string | yes | BigCommerce store hash identifier | +| `password` | query | string | no | User's password | +| `return_url` | query | string | no | URL to redirect the user to after login | + +### Returns + +`BigCommerceLoginUrlResponse` + +--- + +## `postBigCommerceLoginUrl` + +**POST** `/sso/bigcommerce/api/token` + +Generate BigCommerce Login URL (POST) + +Generates a BigCommerce customer login URL using the provided LoginRadius access token sent in the request body. If the customer does not exist in BigCommerce, it creates one. Returns a login URL that can be used to authenticate the user into BigCommerce. + +### Example + +```java +public static void callPostBigCommerceLoginUrl(LoginRadiusClient client) { + String store = ""; //Required + BigCommerceTokenPostRequest bigCommerceTokenPostRequest = new BigCommerceTokenPostRequest().access_token(""); //Required + + try { + var response = client.bigCommerceSso.postBigCommerceLoginUrl(store, bigCommerceTokenPostRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `store` | query | string | yes | BigCommerce store hash identifier | + +### Request body + +`BigCommerceTokenPostRequest` as `application/json`. + +### Returns + +`BigCommerceLoginUrlResponse` + +--- + +## `validateBigCommercePassword` + +**POST** `/sso/bigcommerce/api/validatepassword` + +Validate BigCommerce Customer Password + +Validates a BigCommerce customer's password by checking the provided email and password against the BigCommerce store's customer records. + +### Example + +```java +public static void callValidateBigCommercePassword(LoginRadiusClient client) { + String store = ""; //Required + BigCommerceValidatePasswordRequest bigCommerceValidatePasswordRequest = new BigCommerceValidatePasswordRequest().emailid("").password(""); //Required + + try { + var response = client.bigCommerceSso.validateBigCommercePassword(store, bigCommerceValidatePasswordRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `store` | query | string | yes | BigCommerce store hash identifier | + +### Request body + +`BigCommerceValidatePasswordRequest` as `application/json`. + +### Returns + +`BigCommerceValidatePasswordResponse` + diff --git a/docs/apis/captcha-configuration.md b/docs/apis/captcha-configuration.md new file mode 100644 index 0000000..7d8b0fe --- /dev/null +++ b/docs/apis/captcha-configuration.md @@ -0,0 +1,73 @@ + + +# Captcha Configuration + +2 operation(s). Part of the [API index](../API.md). + +Call these as `client..(...)`. `` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `getCaptchaConfiguration` + +**GET** `/v2/manage/captcha` + +Retrieve captcha configuration + +Retrieves the captcha configuration settings for a specific Tenant. + +### Example + +```java +public static void callGetCaptchaConfiguration(LoginRadiusClient client) { + try { + var response = client.captchaConfiguration.getCaptchaConfiguration(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`CaptchaConfig` + +--- + +## `updateCaptchaConfiguration` + +**PUT** `/v2/manage/captcha` + +Update captcha configuration + +Updates the captcha configuration settings for a specific Tenant. + +### Example + +```java +public static void callUpdateCaptchaConfiguration(LoginRadiusClient client) { + CaptchaConfig captchaConfig = new CaptchaConfig().isEnabled(true).QQTencentCaptcha("").googleRecaptchaV2(""); //Required + + try { + var response = client.captchaConfiguration.updateCaptchaConfiguration(captchaConfig); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`CaptchaConfig` as `application/json`. + +### Returns + +`CaptchaConfig` + diff --git a/docs/apis/consent.md b/docs/apis/consent.md new file mode 100644 index 0000000..1439cc9 --- /dev/null +++ b/docs/apis/consent.md @@ -0,0 +1,243 @@ + + +# Consent + +7 operation(s). Part of the [API index](../API.md). + +Call these as `client..(...)`. `` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `addConsentForm` + +**POST** `/consent/forms` + +Add Consent Form + +Adds a new Consent Form for the Tenant. + +### Example + +```java +public static void callAddConsentForm(LoginRadiusClient client) { + ConsentFormModel consentFormModel = new ConsentFormModel().events("").startFromDate("").consentOptions(""); //Required + + try { + var response = client.consent.addConsentForm(consentFormModel); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`ConsentFormModel` as `application/json`. + +### Returns + +`ConsentForm` + +--- + +## `createConsentOption` + +**POST** `/consent/options` + +Create Consent Option + +Creates a new consent option for a specific Tenant. + +### Example + +```java +public static void callCreateConsentOption(LoginRadiusClient client) { + ConsentOptionModel consentOptionModel = new ConsentOptionModel().title("").description("<description>"); //Required + + try { + var response = client.consent.createConsentOption(consentOptionModel); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`ConsentOptionModel` as `application/json`. + +### Returns + +`ConsentOptions` + +--- + +## `deleteConsentForm` + +**DELETE** `/consent/forms/{version}` + +Delete Consent Form + +Deletes the Consent Form identified by the form version for the Tenant. + +### Example + +```java +public static void callDeleteConsentForm(LoginRadiusClient client) { + String version = "<version>"; //Required + + try { + var response = client.consent.deleteConsentForm(version); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `version` | path | string | yes | The version of the Consent form to delete. | + +### Returns + +`IsDeleted` + +--- + +## `deleteConsentOption` + +**DELETE** `/consent/options/{optionId}` + +Delete Consent Option + +Deletes the consent option identified by the option ID for the Tenant. + +### Example + +```java +public static void callDeleteConsentOption(LoginRadiusClient client) { + String optionId = "<optionId>"; //Required + + try { + var response = client.consent.deleteConsentOption(optionId); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `optionId` | path | string | yes | The ID of the Consent option to delete. | + +### Returns + +`IsDeleted` + +--- + +## `getActiveConsentForms` + +**GET** `/consent/forms/active` + +Retrieve Active Consent Forms + +Retrieves a list of active Consent Forms configured for the Tenant. + +### Example + +```java +public static void callGetActiveConsentForms(LoginRadiusClient client) { + String event = "<event>"; //Required + + try { + var response = client.consent.getActiveConsentForms(event); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `event` | query | string | yes | Event type to filter consent verification (e.g., `login`). | + +### Returns + +`object` + +--- + +## `getConsentForms` + +**GET** `/consent/forms` + +Retrieve Consent Forms + +Retrieves all Consent Forms configured for the Tenant. + +### Example + +```java +public static void callGetConsentForms(LoginRadiusClient client) { + try { + var response = client.consent.getConsentForms(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`object` + +--- + +## `getConsentOptions` + +**GET** `/consent/options` + +Retrieve Consent Options + +Lists all consent options available for a specific Tenant. + +### Example + +```java +public static void callGetConsentOptions(LoginRadiusClient client) { + try { + var response = client.consent.getConsentOptions(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`object` + diff --git a/docs/apis/cross-device-sso.md b/docs/apis/cross-device-sso.md new file mode 100644 index 0000000..5c479c8 --- /dev/null +++ b/docs/apis/cross-device-sso.md @@ -0,0 +1,117 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Cross Device SSO + +3 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `generateQRCode` + +**GET** `/sso/mobile/generate` + +Retrieve QR code + +Retrieves a QR code for Cross Device SSO. + +### Example + +```java +public static void callGenerateQRCode(LoginRadiusClient client) { + String expiry = "<expiry>"; //Optional + + try { + var response = client.crossDeviceSso.generateQRCode(expiry); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `expiry` | query | string | no | Code Expiry time (in second) in second, Min:0, Max:300 | + +### Returns + +`QRCodeResponse` + +--- + +## `getAccessTokenByPing` + +**GET** `/sso/mobile/token` + +Retrieve Access Token by ping + +Retrieves an Access Token by ping after a User scans a QR code during mobile login. + +### Example + +```java +public static void callGetAccessTokenByPing(LoginRadiusClient client) { + String code = "<code>"; //Optional + + try { + var response = client.crossDeviceSso.getAccessTokenByPing(code); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `code` | query | string | no | QR Code By Generate QR Code API | + +### Returns + +`AccessTokenByPingQRCodeResponse` + +--- + +## `mapQRCodeToAccessToken` + +**POST** `/sso/mobile/token` + +Map QR code to Access Token + +Maps a scanned QR code to an Access Token during mobile login. + +### Example + +```java +public static void callMapQRCodeToAccessToken(LoginRadiusClient client) { + QRCodeMapToToken qrCodeMapToToken = new QRCodeMapToToken().access_token("<access_token>").code("<code>"); //Required + + try { + var response = client.crossDeviceSso.mapQRCodeToAccessToken(qrCodeMapToToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`QRCodeMapToToken` as `application/json`. + +### Returns + +`QRCodeMapToTokenResponse` + diff --git a/docs/apis/custom-fields.md b/docs/apis/custom-fields.md new file mode 100644 index 0000000..0a491b3 --- /dev/null +++ b/docs/apis/custom-fields.md @@ -0,0 +1,227 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Custom Fields + +7 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `createCustomField` + +**POST** `/v2/manage/custom-fields` + +Create custom field + +Creates a new Custom Field for the Tenant. + +### Example + +```java +public static void callCreateCustomField(LoginRadiusClient client) { + RaasCustomFieldModel raasCustomFieldModel = new RaasCustomFieldModel().customField("<customField>"); //Required + + try { + var response = client.customFields.createCustomField(raasCustomFieldModel); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`RaasCustomFieldModel` as `application/json`. + +### Returns + +`RaasCustomField` + +--- + +## `deleteCustomField` + +**DELETE** `/v2/manage/custom-fields/{cfname}` + +Delete custom field + +Deletes a Custom Field by name for the Tenant. + +### Example + +```java +public static void callDeleteCustomField(LoginRadiusClient client) { + String cfname = "<cfname>"; //Required + + try { + var response = client.customFields.deleteCustomField(cfname); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `cfname` | path | string | yes | Custom Fields Name | + +### Returns + +`DeleteResponse` + +--- + +## `getActiveCustomFields` + +**GET** `/v2/manage/custom-fields/active` + +List active custom fields + +Retrieves all custom fields currently active in the registration form for the Tenant. + +### Example + +```java +public static void callGetActiveCustomFields(LoginRadiusClient client) { + try { + var response = client.customFields.getActiveCustomFields(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`object` + +--- + +## `getAllCustomFields` + +**GET** `/v2/manage/custom-fields` + +List custom fields + +Retrieves all Custom Fields created for the Tenant. + +### Example + +```java +public static void callGetAllCustomFields(LoginRadiusClient client) { + try { + var response = client.customFields.getAllCustomFields(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`object` + +--- + +## `getCustomFieldLimit` + +**GET** `/v2/manage/custom-fields/limit` + +Retrieve custom field limit + +Retrieves the Custom Field Limit configured for the Tenant. + +### Example + +```java +public static void callGetCustomFieldLimit(LoginRadiusClient client) { + try { + var response = client.customFields.getCustomFieldLimit(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`CustomFieldLimitResponse` + +--- + +## `listCustomFields` + +**GET** `/v2/manage/custom-fields/list` + +List custom fields + +Retrieves all custom fields for the Tenant, returned as an array of strings. + +### Example + +```java +public static void callListCustomFields(LoginRadiusClient client) { + try { + var response = client.customFields.listCustomFields(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`object` + +--- + +## `setCustomField` + +**PUT** `/v2/manage/custom-fields` + +Set custom field + +Updates or sets a Custom Field instance in RAAS to be displayed on forms for the Tenant. + +### Example + +```java +public static void callSetCustomField(LoginRadiusClient client) { + SetCustomFieldRequest setCustomFieldRequest = new SetCustomFieldRequest().data("<data>"); //Required + + try { + var response = client.customFields.setCustomField(setCustomFieldRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`object` as `application/json`. + +### Returns + +`object` + diff --git a/docs/apis/custom-object.md b/docs/apis/custom-object.md new file mode 100644 index 0000000..384d7e9 --- /dev/null +++ b/docs/apis/custom-object.md @@ -0,0 +1,241 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Custom Object + +5 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `createCustomObjectByToken` + +**POST** `/identity/v2/auth/customobject` + +Create Custom Object + +Creates a Custom Object associated with the authenticated User using an Access Token. + +### Example + +```java +public static void callCreateCustomObjectByToken(LoginRadiusClient client) { + Map<String, Object> requestBody = new HashMap<>(); //Required + String customobjectid = "<customobjectid>"; //Optional + String objectname = "<objectname>"; //Optional + String accessToken = "<accessToken>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + + try { + var response = client.customObject.createCustomObjectByToken(requestBody, customobjectid, objectname, accessToken, preventWebhook, xPreventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `customobjectid` | query | string | no | Unique identifier for the Custom Object record | +| `objectname` | query | string | no | Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. | +| `access_token` | query | string | no | Access Token of the User | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | + +### Request body + +`CustomObjectRequest` as `application/json`. + +### Returns + +`CustomObjectResponseModel` + +--- + +## `deleteCustomObjectByTokenAndRecordId` + +**DELETE** `/identity/v2/auth/customobject/{objectrecordid}` + +Delete Custom Object by ID + +Deletes the Custom Object associated with the specified User using an Access Token and record ID. + +### Example + +```java +public static void callDeleteCustomObjectByTokenAndRecordId(LoginRadiusClient client) { + String objectrecordid = "<objectrecordid>"; //Required + String accessToken = "<accessToken>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + String objectname = "<objectname>"; //Optional + String customobjectid = "<customobjectid>"; //Optional + + try { + var response = client.customObject.deleteCustomObjectByTokenAndRecordId(objectrecordid, accessToken, preventWebhook, xPreventWebhook, objectname, customobjectid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `objectrecordid` | path | string (uuid) | yes | Unique identifier for the Custom Object record. The ID is used to target a specific Custom Object. | +| `access_token` | query | string | no | Access Token of the User | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `objectname` | query | string | no | Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. | +| `customobjectid` | query | string | no | Unique identifier for the Custom Object record | + +### Returns + +`IsDeleted` + +--- + +## `getCustomObjectByToken` + +**GET** `/identity/v2/auth/customobject` + +Retrieve Custom Objects + +Retrieves Custom Objects associated with the authenticated User using an Access Token. + +### Example + +```java +public static void callGetCustomObjectByToken(LoginRadiusClient client) { + String customobjectid = "<customobjectid>"; //Optional + String objectname = "<objectname>"; //Optional + String accessToken = "<accessToken>"; //Optional + + try { + var response = client.customObject.getCustomObjectByToken(customobjectid, objectname, accessToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `customobjectid` | query | string | no | Unique identifier for the Custom Object record | +| `objectname` | query | string | no | Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. | +| `access_token` | query | string | no | Access Token of the User | + +### Returns + +`CustomObjectsResponseModel` + +--- + +## `getCustomObjectByTokenAndRecordId` + +**GET** `/identity/v2/auth/customobject/{objectrecordid}` + +Retrieve Custom Object by ID + +Retrieves the Custom Object associated with the specified User using an Access Token and record ID. + +### Example + +```java +public static void callGetCustomObjectByTokenAndRecordId(LoginRadiusClient client) { + String objectrecordid = "<objectrecordid>"; //Required + String accessToken = "<accessToken>"; //Optional + String objectname = "<objectname>"; //Optional + String customobjectid = "<customobjectid>"; //Optional + + try { + var response = client.customObject.getCustomObjectByTokenAndRecordId(objectrecordid, accessToken, objectname, customobjectid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `objectrecordid` | path | string (uuid) | yes | Unique identifier for the Custom Object record. The ID is used to target a specific Custom Object. | +| `access_token` | query | string | no | Access Token of the User | +| `objectname` | query | string | no | Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. | +| `customobjectid` | query | string | no | Unique identifier for the Custom Object record | + +### Returns + +`CustomObjectResponseModel` + +--- + +## `updateCustomObjectByTokenAndRecordId` + +**PUT** `/identity/v2/auth/customobject/{objectrecordid}` + +Update Custom Object by ID + +Updates a Custom Object associated with the authenticated User using an Access Token and record ID. + +### Example + +```java +public static void callUpdateCustomObjectByTokenAndRecordId(LoginRadiusClient client) { + String objectrecordid = "<objectrecordid>"; //Required + String updateType = "<updateType>"; //Required + Map<String, Object> requestBody = new HashMap<>(); //Required + String objectname = "<objectname>"; //Optional + String accessToken = "<accessToken>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + String customobjectid = "<customobjectid>"; //Optional + + try { + var response = client.customObject.updateCustomObjectByTokenAndRecordId(objectrecordid, updateType, requestBody, objectname, accessToken, preventWebhook, xPreventWebhook, customobjectid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `objectrecordid` | path | string (uuid) | yes | Unique identifier for the Custom Object record. The ID is used to target a specific Custom Object. | +| `objectname` | query | string | no | Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. | +| `updateType` | query | string | yes | The type of update to be performed on the Custom Object. This parameter is used to specify whether the update should be a full update or a partial update. | +| `access_token` | query | string | no | Access Token of the User | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `customobjectid` | query | string | no | Unique identifier for the Custom Object record | + +### Request body + +`CustomObjectRequest` as `application/json`. + +### Returns + +`CustomObjectResponseModel` + diff --git a/docs/apis/custom-objects.md b/docs/apis/custom-objects.md new file mode 100644 index 0000000..3e7148a --- /dev/null +++ b/docs/apis/custom-objects.md @@ -0,0 +1,177 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Custom Objects + +4 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `getAllCustomObjectsByQuery` + +**GET** `/customobject` + +Retrieve Custom Object data by pagination + +Retrieves Custom Object data based on specified pagination parameters. + +### Example + +```java +public static void callGetAllCustomObjectsByQuery(LoginRadiusClient client) { + String customobject = "<customobject>"; //Optional + String region = "<region>"; //Optional + String next = "<next>"; //Optional + + try { + var response = client.customObjects.getAllCustomObjectsByQuery(customobject, region, next); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `customobject` | query | string | no | Custom Object identifier for filtering results. This parameter allows you to specify a Custom Object to filter the results returned by the API. | +| `region` | query | string | no | The region to filter results by. | +| `next` | query | string | no | Scroll or pagination token for fetching the next set of results. This token is used to retrieve the next page of results in a paginated response. If not provided, the API will return the first page of results. | + +### Returns + +`UserProfileNextResponse` + +--- + +## `getCustomObjectByQuery` + +**GET** `/identity/customobject` + +Retrieve User's and Custom Object data by pagination + +Retrieves User's and Custom Object data per User based on the pagination parameters. + +### Example + +```java +public static void callGetCustomObjectByQuery(LoginRadiusClient client) { + String region = "<region>"; //Optional + String customobject = "<customobject>"; //Optional + String next = "<next>"; //Optional + + try { + var response = client.customObjects.getCustomObjectByQuery(region, customobject, next); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `region` | query | string | no | The region to filter results by. | +| `customobject` | query | string | no | Custom Object identifier for filtering results. This parameter allows you to specify a Custom Object to filter the results returned by the API. | +| `next` | query | string | no | Scroll or pagination token for fetching the next set of results. This token is used to retrieve the next page of results in a paginated response. If not provided, the API will return the first page of results. | + +### Returns + +`userProfileNextResponseWithCustomObject` + +--- + +## `postAllCustomObjectsByQuery` + +**POST** `/customobject` + +Retrieve Custom Object data by query + +Retrieves Custom Object data based on specified query filters. + +### Example + +```java +public static void callPostAllCustomObjectsByQuery(LoginRadiusClient client) { + UserProfileRequestBody userProfileRequestBody = new UserProfileRequestBody().from("<from>").to("<to>").size(0); //Required + String customobject = "<customobject>"; //Optional + String region = "<region>"; //Optional + + try { + var response = client.customObjects.postAllCustomObjectsByQuery(userProfileRequestBody, customobject, region); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `customobject` | query | string | no | Custom Object identifier for filtering results. This parameter allows you to specify a Custom Object to filter the results returned by the API. | +| `region` | query | string | no | The region to filter results by. | + +### Request body + +`UserProfileRequestBody` as `application/json`. + +### Returns + +`UserProfileScrollResponse` + +--- + +## `postCustomObjectByQuery` + +**POST** `/identity/customobject` + +Retrieve User's and Custom Object data by query + +Retrieves User's and Custom Objects data per User based on the query. + +### Example + +```java +public static void callPostCustomObjectByQuery(LoginRadiusClient client) { + UserProfileRequestBody userProfileRequestBody = new UserProfileRequestBody().from("<from>").to("<to>").size(0); //Required + String region = "<region>"; //Optional + String customobject = "<customobject>"; //Optional + + try { + var response = client.customObjects.postCustomObjectByQuery(userProfileRequestBody, region, customobject); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `region` | query | string | no | The region to filter results by. | +| `customobject` | query | string | no | Custom Object identifier for filtering results. This parameter allows you to specify a Custom Object to filter the results returned by the API. | + +### Request body + +`UserProfileRequestBody` as `application/json`. + +### Returns + +`userProfileScrollResponseWithCustomObject` + diff --git a/docs/apis/domain-access-restrictions.md b/docs/apis/domain-access-restrictions.md new file mode 100644 index 0000000..fbec4f9 --- /dev/null +++ b/docs/apis/domain-access-restrictions.md @@ -0,0 +1,73 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Domain Access Restrictions + +2 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `getDomainAccessRestrictionsByAppID` + +**GET** `/v2/manage/restrictions/domain-access` + +Retrieve Domain Access Restrictions + +Retrieves the domain access restrictions configured for the Tenant. + +### Example + +```java +public static void callGetDomainAccessRestrictionsByAppID(LoginRadiusClient client) { + try { + var response = client.domainAccessRestrictions.getDomainAccessRestrictionsByAppID(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`DomainAccessRestrictions` + +--- + +## `updateDomainAccessRestrictionsByAppID` + +**PUT** `/v2/manage/restrictions/domain-access` + +Update Domain Access Restrictions + +Updates the domain access restrictions for the Tenant. + +### Example + +```java +public static void callUpdateDomainAccessRestrictionsByAppID(LoginRadiusClient client) { + DomainAccessRestrictions domainAccessRestrictions = new DomainAccessRestrictions().allowlist("<allowlist>").blocklist("<blocklist>"); //Optional + + try { + var response = client.domainAccessRestrictions.updateDomainAccessRestrictionsByAppID(domainAccessRestrictions); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`DomainAccessRestrictions` as `application/json`. + +### Returns + +`DomainAccessRestrictions` + diff --git a/docs/apis/email-templates.md b/docs/apis/email-templates.md new file mode 100644 index 0000000..c1deebb --- /dev/null +++ b/docs/apis/email-templates.md @@ -0,0 +1,155 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Email Templates + +4 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `addEmailTemplate` + +**POST** `/v2/manage/email-templates` + +Create Email template + +Adds a new Email template to the Tenant's configuration. + +### Example + +```java +public static void callAddEmailTemplate(LoginRadiusClient client) { + EmailTemplateModel emailTemplateModel = new EmailTemplateModel().templateType("<templateType>").template("<template>").subject("<subject>"); //Required + + try { + var response = client.emailTemplates.addEmailTemplate(emailTemplateModel); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`EmailTemplateModel` as `application/json`. + +### Returns + +`EmailTemplateResponse` + +--- + +## `deleteEmailTemplate` + +**DELETE** `/v2/manage/email-templates/{templateType}` + +Delete Email Template + +Deletes the Email template for a specified Email template type within a specific Tenant. + +### Example + +```java +public static void callDeleteEmailTemplate(LoginRadiusClient client) { + String templateType = "<templateType>"; //Required + DeleteEmailTemplate deleteEmailTemplate = new DeleteEmailTemplate().templateName("<templateName>"); //Optional + + try { + var response = client.emailTemplates.deleteEmailTemplate(templateType, deleteEmailTemplate); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `templateType` | path | string | yes | The type of Email template to delete. | + +### Request body + +`DeleteEmailTemplate` as `application/json`. + +### Returns + +`DeleteResponse` + +--- + +## `getEmailTemplates` + +**GET** `/v2/manage/email-templates` + +List Email templates + +Retrieves all Email templates configured for the Tenant. + +### Example + +```java +public static void callGetEmailTemplates(LoginRadiusClient client) { + try { + var response = client.emailTemplates.getEmailTemplates(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`object` + +--- + +## `updateEmailTemplate` + +**PUT** `/v2/manage/email-templates/{templateType}` + +Update Email Template + +Updates the Email template for a specified Email template type within a specific Tenant. + +### Example + +```java +public static void callUpdateEmailTemplate(LoginRadiusClient client) { + String templateType = "<templateType>"; //Required + UpdateEmailTemplate updateEmailTemplate = new UpdateEmailTemplate().template("<template>").subject("<subject>"); //Required + + try { + var response = client.emailTemplates.updateEmailTemplate(templateType, updateEmailTemplate); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `templateType` | path | string | yes | The type of Email template to delete. | + +### Request body + +`UpdateEmailTemplate` as `application/json`. + +### Returns + +`EmailTemplateResponse` + diff --git a/docs/apis/identity.md b/docs/apis/identity.md new file mode 100644 index 0000000..2112c4c --- /dev/null +++ b/docs/apis/identity.md @@ -0,0 +1,90 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Identity + +2 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `getUserProfilesByPageId` + +**GET** `/identity` + +Retrieve User's by pagination + +Retrieves User's data using the specified pagination parameters. + +### Example + +```java +public static void callGetUserProfilesByPageId(LoginRadiusClient client) { + String next = "<next>"; //Optional + String region = "<region>"; //Optional + + try { + var response = client.identity.getUserProfilesByPageId(next, region); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `next` | query | string | no | Scroll or pagination token for fetching the next set of results. This token is used to retrieve the next page of results in a paginated response. If not provided, the API will return the first page of results. | +| `region` | query | string | no | The region to filter results by. | + +### Returns + +`UserProfileResponse` + +--- + +## `queryUserProfiles` + +**POST** `/identity` + +Retrieve User's by query + +Retrieves User's data based on specified query filters. + +### Example + +```java +public static void callQueryUserProfiles(LoginRadiusClient client) { + UserProfileRequestBody userProfileRequestBody = new UserProfileRequestBody().from("<from>").to("<to>").size(0); //Required + String region = "<region>"; //Optional + + try { + var response = client.identity.queryUserProfiles(userProfileRequestBody, region); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `region` | query | string | no | The region to filter results by. | + +### Request body + +`UserProfileRequestBody` as `application/json`. + +### Returns + +`UserProfileScrollResponse` + diff --git a/docs/apis/insights.md b/docs/apis/insights.md new file mode 100644 index 0000000..7f6359d --- /dev/null +++ b/docs/apis/insights.md @@ -0,0 +1,52 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Insights + +1 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `queryUserProfilesInsights` + +**POST** `/insights/userprofiles` + +Retrieve User's data by filters + +Retrieves users based on specified query parameters. + +### Example + +```java +public static void callQueryUserProfilesInsights(LoginRadiusClient client) { + RequestPayload requestPayload = new RequestPayload().from("<from>").to("<to>").q("<q>"); //Required + String region = "<region>"; //Optional + + try { + var response = client.insights.queryUserProfilesInsights(requestPayload, region); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `region` | query | string | no | The region to filter results by. | + +### Request body + +`requestPayload` as `application/json`. + +### Returns + +`InsightsResponse` + diff --git a/docs/apis/ip-access-restrictions.md b/docs/apis/ip-access-restrictions.md new file mode 100644 index 0000000..07675aa --- /dev/null +++ b/docs/apis/ip-access-restrictions.md @@ -0,0 +1,101 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# IP Access Restrictions + +3 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `getIPAccessRestrictions` + +**GET** `/v2/manage/restrictions/ip-access` + +Retrieve IP Access Restrictions + +Retrieves the IP access restrictions configured for a specific Tenant. + +### Example + +```java +public static void callGetIPAccessRestrictions(LoginRadiusClient client) { + try { + var response = client.ipAccessRestrictions.getIPAccessRestrictions(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`IPAccessRestrictions` + +--- + +## `resetIPAccessRestrictions` + +**DELETE** `/v2/manage/restrictions/ip-access` + +Reset IP Access Restrictions + +Resets the IP access restrictions to their default state. + +### Example + +```java +public static void callResetIPAccessRestrictions(LoginRadiusClient client) { + try { + var response = client.ipAccessRestrictions.resetIPAccessRestrictions(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`DeleteResponse` + +--- + +## `updateIPAccessRestrictions` + +**PUT** `/v2/manage/restrictions/ip-access` + +Update IP Access Restrictions + +Updates the IP access restrictions for a specific Tenant. + +### Example + +```java +public static void callUpdateIPAccessRestrictions(LoginRadiusClient client) { + IPAccessRestrictions ipAccessRestrictions = new IPAccessRestrictions().allowedIPs("<allowedIPs>").deniedIPs("<deniedIPs>"); //Required + + try { + var response = client.ipAccessRestrictions.updateIPAccessRestrictions(ipAccessRestrictions); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`IPAccessRestrictions` as `application/json`. + +### Returns + +`IPAccessRestrictions` + diff --git a/docs/apis/jwt-custom-providers.md b/docs/apis/jwt-custom-providers.md new file mode 100644 index 0000000..e07f4c1 --- /dev/null +++ b/docs/apis/jwt-custom-providers.md @@ -0,0 +1,186 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# JWT Custom Providers + +5 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `createJwtSPClientConfiguration` + +**POST** `/v2/manage/custom-providers/jwt` + +Create JWT SP configuration + +Creates a new Service Provider (SP) configuration for a JWT client in the Tenant, defining details such as endpoints, mapping, and other required settings. + +### Example + +```java +public static void callCreateJwtSPClientConfiguration(LoginRadiusClient client) { + CreateJwtSPClientConfigurationRequest createJwtSPClientConfigurationRequest = new CreateJwtSPClientConfigurationRequest().appName("<appName>").algo("<algo>").mapping("<mapping>"); //Required + + try { + var response = client.jwtCustomProviders.createJwtSPClientConfiguration(createJwtSPClientConfigurationRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`object` as `application/json`. + +### Returns + +`JwtSpConfig` + +--- + +## `deleteJwtSPClientConfigurationByAppName` + +**DELETE** `/v2/manage/custom-providers/jwt/{jwtApp}` + +Delete JWT SP configuration + +Deletes the Service Provider (SP) configuration for a JWT client in the Tenant identified by the AppName, permanently disabling the application's service provider integration. + +### Example + +```java +public static void callDeleteJwtSPClientConfigurationByAppName(LoginRadiusClient client) { + String jwtApp = "<jwtApp>"; //Required + + try { + var response = client.jwtCustomProviders.deleteJwtSPClientConfigurationByAppName(jwtApp); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `jwtApp` | path | string | yes | The jwt App identifier | + +### Returns + +`DeleteResponse` + +--- + +## `getAllJwtConfigSPConfigurations` + +**GET** `/v2/manage/custom-providers/jwt` + +List JWT SP configurations + +Retrieves a list of all Service Provider (SP) configurations associated with JWT clients for the Tenant, including endpoints, mapping, and other settings for each SP setup. + +### Example + +```java +public static void callGetAllJwtConfigSPConfigurations(LoginRadiusClient client) { + try { + var response = client.jwtCustomProviders.getAllJwtConfigSPConfigurations(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`object` + +--- + +## `getJwtSPClientConfigurationByAppName` + +**GET** `/v2/manage/custom-providers/jwt/{jwtApp}` + +Retrieve JWT SP configuration + +Retrieves the Service Provider (SP) configuration details for a JWT client in the Tenant using the AppName, including endpoints, mapping, and other configured settings. + +### Example + +```java +public static void callGetJwtSPClientConfigurationByAppName(LoginRadiusClient client) { + String jwtApp = "<jwtApp>"; //Required + + try { + var response = client.jwtCustomProviders.getJwtSPClientConfigurationByAppName(jwtApp); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `jwtApp` | path | string | yes | The jwt App identifier | + +### Returns + +`JwtSpConfig` + +--- + +## `updateJwtSPClientConfigurationByAppName` + +**PUT** `/v2/manage/custom-providers/jwt/{jwtApp}` + +Update JWT SP configuration + +Updates an existing Service Provider (SP) configuration for a JWT client in the Tenant identified by the AppName, modifying settings such as endpoints, mapping, or other configuration details. + +### Example + +```java +public static void callUpdateJwtSPClientConfigurationByAppName(LoginRadiusClient client) { + String jwtApp = "<jwtApp>"; //Required + JwtSpConfigBaseModel jwtSpConfigBaseModel = new JwtSpConfigBaseModel().algo("<algo>").mapping("<mapping>").key("<key>"); //Required + + try { + var response = client.jwtCustomProviders.updateJwtSPClientConfigurationByAppName(jwtApp, jwtSpConfigBaseModel); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `jwtApp` | path | string | yes | The jwt App identifier | + +### Request body + +`JwtSpConfigBaseModel` as `application/json`. + +### Returns + +`JwtSpConfig` + diff --git a/docs/apis/jwt-integrations.md b/docs/apis/jwt-integrations.md new file mode 100644 index 0000000..f10cb3a --- /dev/null +++ b/docs/apis/jwt-integrations.md @@ -0,0 +1,242 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# JWT Integrations + +7 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `createJwtIntegration` + +**POST** `/v2/manage/integrations/jwt` + +Create JWT Integration + +Creates a new JWT-based Integration configuration for the Tenant by specifying algorithms, mapping, and endpoint information, enabling authentication and federation with the specified IdP. + +### Example + +```java +public static void callCreateJwtIntegration(LoginRadiusClient client) { + CreateJwtIntegrationRequest createJwtIntegrationRequest = new CreateJwtIntegrationRequest().appName("<appName>").algo("<algo>").secret("<secret>"); //Required + + try { + var response = client.jwtIntegrations.createJwtIntegration(createJwtIntegrationRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`object` as `application/json`. + +### Returns + +`JwtIntegrationResponse` + +--- + +## `deleteJwtIntegration` + +**DELETE** `/v2/manage/integrations/jwt/{jwtApp}` + +Delete JWT Integration configuration + +Deletes an existing JWT-based integration configuration for the Tenant using its AppName, permanently disabling authentication and federation with that IdP. + +### Example + +```java +public static void callDeleteJwtIntegration(LoginRadiusClient client) { + String jwtApp = "<jwtApp>"; //Required + + try { + var response = client.jwtIntegrations.deleteJwtIntegration(jwtApp); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `jwtApp` | path | string | yes | The jwt App identifier | + +### Returns + +`DeleteResponse` + +--- + +## `getAllJwtIntegrations` + +**GET** `/v2/manage/integrations/jwt` + +List JWT Integrations + +Retrieves a list of all configured JWT-based integrations for the Tenant, including algorithms, mapping, endpoints, and settings used for authentication and federation. + +### Example + +```java +public static void callGetAllJwtIntegrations(LoginRadiusClient client) { + try { + var response = client.jwtIntegrations.getAllJwtIntegrations(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`object` + +--- + +## `getJwtIntegrationByAppName` + +**GET** `/v2/manage/integrations/jwt/{jwtApp}` + +Retrieve JWT Integration configuration + +Retrieves the details of a specific JWT-based integration configuration for the Tenant using the AppName, including algorithms, mapping, and endpoints associated with the application. + +### Example + +```java +public static void callGetJwtIntegrationByAppName(LoginRadiusClient client) { + String jwtApp = "<jwtApp>"; //Required + + try { + var response = client.jwtIntegrations.getJwtIntegrationByAppName(jwtApp); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `jwtApp` | path | string | yes | The jwt App identifier | + +### Returns + +`JwtIntegrationResponse` + +--- + +## `getJwtIntegrationDataMappingFieldsList` + +**GET** `/v2/manage/integrations/jwt/data-mapping` + +List JWT data mapping fields + +Retrieves a list of available data mapping fields that can be used when configuring JWT-based Identity Provider (IdP) integrations for the Tenant, including all supported fields for mapping JWT claims to User profile attributes. + +### Example + +```java +public static void callGetJwtIntegrationDataMappingFieldsList(LoginRadiusClient client) { + try { + var response = client.jwtIntegrations.getJwtIntegrationDataMappingFieldsList(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`object` + +--- + +## `getJwtIntegrationSupportedAlgoList` + +**GET** `/v2/manage/integrations/jwt/algo` + +List supported JWT algorithms + +Retrieves a list of all supported cryptographic algorithms that can be used by JWT clients for signing and verification when configuring a JWT-based Identity Provider (IdP) for the Tenant. + +### Example + +```java +public static void callGetJwtIntegrationSupportedAlgoList(LoginRadiusClient client) { + try { + var response = client.jwtIntegrations.getJwtIntegrationSupportedAlgoList(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`object` + +--- + +## `updateJwtIntegrationByAppName` + +**PUT** `/v2/manage/integrations/jwt/{jwtApp}` + +Update JWT Integration configuration + +Updates an existing JWT-based integration configuration for the Tenant identified by the AppName, modifying details such as algorithms, mapping, or endpoint information. + +### Example + +```java +public static void callUpdateJwtIntegrationByAppName(LoginRadiusClient client) { + String jwtApp = "<jwtApp>"; //Required + JwtIntegrationBaseModel jwtIntegrationBaseModel = new JwtIntegrationBaseModel().algo("<algo>").secret("<secret>").mappingTemplate("<mappingTemplate>"); //Required + + try { + var response = client.jwtIntegrations.updateJwtIntegrationByAppName(jwtApp, jwtIntegrationBaseModel); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `jwtApp` | path | string | yes | The jwt App identifier | + +### Request body + +`JwtIntegrationBaseModel` as `application/json`. + +### Returns + +`JwtIntegrationResponse` + diff --git a/docs/apis/jwt.md b/docs/apis/jwt.md new file mode 100644 index 0000000..ea177c6 --- /dev/null +++ b/docs/apis/jwt.md @@ -0,0 +1,92 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# JWT + +2 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `getJWTTokenByAccessToken` + +**GET** `/api/jwt/{JwtAppName}/token` + +Retrieve JWT token by Access Token + +Retrieves a JWT token using an Access Token obtained after successful login. + +### Example + +```java +public static void callGetJWTTokenByAccessToken(LoginRadiusClient client) { + String jwtAppName = "<jwtAppName>"; //Required + String nonce = "<nonce>"; //Optional + + try { + var response = client.jwt.getJWTTokenByAccessToken(jwtAppName, nonce); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `JwtAppName` | path | string | yes | JWT App Name | +| `Nonce` | query | string | no | random nonce claim | + +### Returns + +`JWTSignature` + +--- + +## `getJWTTokenByLoginCredentials` + +**POST** `/api/jwt/{JwtAppName}/login` + +Retrieve JWT token + +Retrieves a JWT token using login credentials such as Email, Phone, Username, and Password. + +### Example + +```java +public static void callGetJWTTokenByLoginCredentials(LoginRadiusClient client) { + String jwtAppName = "<jwtAppName>"; //Required + GetJWTTokenByLoginCredentialsRequest getJWTTokenByLoginCredentialsRequest = new GetJWTTokenByLoginCredentialsRequest(); //Required + String nonce = "<nonce>"; //Optional + + try { + var response = client.jwt.getJWTTokenByLoginCredentials(jwtAppName, getJWTTokenByLoginCredentialsRequest, nonce); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `JwtAppName` | path | string | yes | JWT App Name | +| `Nonce` | query | string | no | random nonce claim | + +### Request body + +`object` as `application/json`. + +### Returns + +`JWTSignature` + diff --git a/docs/apis/login.md b/docs/apis/login.md new file mode 100644 index 0000000..9e4ba41 --- /dev/null +++ b/docs/apis/login.md @@ -0,0 +1,1531 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Login + +28 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `accountRegisterPasskeyBegin` + +**GET** `/identity/v2/auth/account/register/passkey/begin` + +Begin Passkey registration + +Initiates the Passkey registration process for an Account using an Access Token. + +### Example + +```java +public static void callAccountRegisterPasskeyBegin(LoginRadiusClient client) { + String accessToken = "<accessToken>"; //Optional + + try { + var response = client.login.accountRegisterPasskeyBegin(accessToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | + +### Returns + +`object` + +--- + +## `accountRegisterPasskeyFinish` + +**POST** `/identity/v2/auth/account/register/passkey/finish` + +Complete Passkey registration + +Completes the Passkey registration process for an Account using an Access Token. + +### Example + +```java +public static void callAccountRegisterPasskeyFinish(LoginRadiusClient client) { + FinishMFAPasskeyRegistrationRequest finishMFAPasskeyRegistrationRequest = new FinishMFAPasskeyRegistrationRequest().passkeyCredential("<passkeyCredential>"); //Required + String accessToken = "<accessToken>"; //Optional + + try { + var response = client.login.accountRegisterPasskeyFinish(finishMFAPasskeyRegistrationRequest, accessToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | + +### Request body + +`object` as `application/json`. + +### Returns + +`PasskeyListResponse` + +--- + +## `beginAutofillPasskeyLogin` + +**GET** `/identity/v2/auth/login/passkey/autofill/begin` + +Initiate Login with Autofill Passkey + +Begins the login process using an Autofill Passkey. + +### Example + +```java +public static void callBeginAutofillPasskeyLogin(LoginRadiusClient client) { + try { + var response = client.login.beginAutofillPasskeyLogin(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`object` + +--- + +## `beginPasskeyLogin` + +**GET** `/identity/v2/auth/login/passkey/begin` + +Initiate Login with Passkey + +Begins the login process using a Passkey. + +### Example + +```java +public static void callBeginPasskeyLogin(LoginRadiusClient client) { + String identifier = "<identifier>"; //Required + String verificationurl = "<verificationurl>"; //Optional + String emailtemplate = "<emailtemplate>"; //Optional + + try { + var response = client.login.beginPasskeyLogin(identifier, verificationurl, emailtemplate); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `identifier` | query | string | yes | Email of the User | +| `verificationurl` | query | string | no | Verification URL for the User which will be included in the Email template.. | +| `emailtemplate` | query | string | no | Name of the Email template to use for this notification. | + +### Returns + +`object` + +--- + +## `beginPasskeyReset` + +**GET** `/identity/v2/auth/passkey/reset/begin` + +Begin Passkey Reset + +Begins the reset Passkey process for a User. + +### Example + +```java +public static void callBeginPasskeyReset(LoginRadiusClient client) { + String vtoken = "<vtoken>"; //Optional + + try { + var response = client.login.beginPasskeyReset(vtoken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `vtoken` | query | string | no | Verification token received in the Email. | + +### Returns + +`object` + +--- + +## `checkUserNameAvailability` + +**GET** `/identity/v2/auth/username` + +Check Username availability + +Checks if a Username is available for registration on the platform. + +### Example + +```java +public static void callCheckUserNameAvailability(LoginRadiusClient client) { + String username = "<username>"; //Optional + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String gRecaptchaResponse2 = "<gRecaptchaResponse2>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Optional + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Optional + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + + try { + var response = client.login.checkUserNameAvailability(username, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `username` | query | string | no | Username of the associated Account. | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `g_recaptcha_response` | query | string | no | Google reCAPTCHA Response | +| `qq_captcha_ticket` | query | string | no | QQ reCAPTCHA Response | +| `qq_captcha_randstr` | query | string | no | QQ reCAPTCHA Response | +| `h-captcha-response` | query | string | no | hCaptcha Response | + +### Returns + +`object` + +--- + +## `emailByLoginUserNamePhone` + +**POST** `/identity/v2/auth/login` + +Login with credentials + +Authenticates a User using Email, Username, or Phone, providing an Access Token for further API interactions. + +### Example + +```java +public static void callEmailByLoginUserNamePhone(LoginRadiusClient client) { + EmailByLoginUserNamePhoneRequest emailByLoginUserNamePhoneRequest = new EmailByLoginUserNamePhoneRequest(); //Required + String emailtemplate = "<emailtemplate>"; //Optional + String loginurl = "<loginurl>"; //Optional + String verificationurl = "<verificationurl>"; //Optional + String smstemplate = "<smstemplate>"; //Optional + Boolean isvoiceotp = true; //Optional + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String breachedpasswordemailtemplate = "<breachedpasswordemailtemplate>"; //Optional + String breachedpasswordsmstemplate = "<breachedpasswordsmstemplate>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + String fields = "<fields>"; //Optional + String options = "<options>"; //Optional + String rbabrowseremailtemplate = "<rbabrowseremailtemplate>"; //Optional + String rbaoneclickemailtemplate = "<rbaoneclickemailtemplate>"; //Optional + String rbacityemailtemplate = "<rbacityemailtemplate>"; //Optional + String rbacountryemailtemplate = "<rbacountryemailtemplate>"; //Optional + String rbaipemailtemplate = "<rbaipemailtemplate>"; //Optional + String rbadeviceemailtemplate = "<rbadeviceemailtemplate>"; //Optional + String rbaotpsmstemplate = "<rbaotpsmstemplate>"; //Optional + String rbabrowsersmstemplate = "<rbabrowsersmstemplate>"; //Optional + String rbacitysmstemplate = "<rbacitysmstemplate>"; //Optional + String rbacountrysmstemplate = "<rbacountrysmstemplate>"; //Optional + String rbaipsmstemplate = "<rbaipsmstemplate>"; //Optional + String rbadevicesmstemplate = "<rbadevicesmstemplate>"; //Optional + String invitationToken = "<invitationToken>"; //Optional + String emailtemplate2fa = "<emailtemplate2fa>"; //Optional + String duoredirecturi = "<duoredirecturi>"; //Optional + + try { + var response = client.login.emailByLoginUserNamePhone(emailByLoginUserNamePhoneRequest, emailtemplate, loginurl, verificationurl, smstemplate, isvoiceotp, gRecaptchaResponse, breachedpasswordemailtemplate, breachedpasswordsmstemplate, preventWebhook, xPreventWebhook, fields, options, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, invitationToken, emailtemplate2fa, duoredirecturi); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `emailtemplate` | query | string | no | Name of the Email template to use for this notification. | +| `loginurl` | query | string | no | Login URL for the User which will come in the login logs from where the User logged in. | +| `verificationurl` | query | string | no | Verification URL for the User which will be included in the Email template.. | +| `smstemplate` | query | string | no | SMS Template | +| `isvoiceotp` | query | boolean | no | Boolean flag to enforce sending SMS content via Voice. | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `breachedpasswordemailtemplate` | query | string | no | Email template name for breached Password notifications. | +| `breachedpasswordsmstemplate` | query | string | no | SMS template name for breached Password notifications. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `fields` | query | string | no | Comma-separated list of profile fields to include in the response. | +| `options` | query | string | no | Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail | +| `rbabrowseremailtemplate` | query | string | no | RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. | +| `rbaoneclickemailtemplate` | query | string | no | RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. | +| `rbacityemailtemplate` | query | string | no | RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. | +| `rbacountryemailtemplate` | query | string | no | RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. | +| `rbaipemailtemplate` | query | string | no | RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. | +| `rbadeviceemailtemplate` | query | string | no | RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. | +| `rbaotpsmstemplate` | query | string | no | RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbabrowsersmstemplate` | query | string | no | RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbacitysmstemplate` | query | string | no | RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbacountrysmstemplate` | query | string | no | RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbaipsmstemplate` | query | string | no | RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbadevicesmstemplate` | query | string | no | RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `invitation_token` | query | string | no | Invitation token of an organization | +| `emailtemplate2fa` | query | string | no | Name of the 2FA Email template to use for this notification. | +| `duoredirecturi` | query | string | no | Duo auth redirection url. | + +### Request body + +`object` as `application/json`. + +### Returns + +`object` + +--- + +## `finishAutofillPasskeyLogin` + +**POST** `/identity/v2/auth/login/passkey/autofill/finish` + +Complete Login with Autofill Passkey + +Completes the login process using an Autofill Passkey. + +### Example + +```java +public static void callFinishAutofillPasskeyLogin(LoginRadiusClient client) { + PasskeyLoginAutofillRequest passkeyLoginAutofillRequest = new PasskeyLoginAutofillRequest().g-recaptcha-response("<g-recaptcha-response>").qq_captcha_ticket("<qq_captcha_ticket>").qq_captcha_randstr("<qq_captcha_randstr>"); //Required + String loginurl = "<loginurl>"; //Optional + String verificationurl = "<verificationurl>"; //Optional + String emailtemplate = "<emailtemplate>"; //Optional + String invitationToken = "<invitationToken>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + String fields = "<fields>"; //Optional + String options = "<options>"; //Optional + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String gRecaptchaResponse2 = "<gRecaptchaResponse2>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Optional + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Optional + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + String rbabrowseremailtemplate = "<rbabrowseremailtemplate>"; //Optional + String rbaoneclickemailtemplate = "<rbaoneclickemailtemplate>"; //Optional + String rbacityemailtemplate = "<rbacityemailtemplate>"; //Optional + String rbacountryemailtemplate = "<rbacountryemailtemplate>"; //Optional + String rbaipemailtemplate = "<rbaipemailtemplate>"; //Optional + String rbadeviceemailtemplate = "<rbadeviceemailtemplate>"; //Optional + String rbaotpsmstemplate = "<rbaotpsmstemplate>"; //Optional + String rbabrowsersmstemplate = "<rbabrowsersmstemplate>"; //Optional + String rbacitysmstemplate = "<rbacitysmstemplate>"; //Optional + String rbacountrysmstemplate = "<rbacountrysmstemplate>"; //Optional + String rbaipsmstemplate = "<rbaipsmstemplate>"; //Optional + String rbadevicesmstemplate = "<rbadevicesmstemplate>"; //Optional + + try { + var response = client.login.finishAutofillPasskeyLogin(passkeyLoginAutofillRequest, loginurl, verificationurl, emailtemplate, invitationToken, preventWebhook, xPreventWebhook, fields, options, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `loginurl` | query | string | no | Login URL for the User which will come in the login logs from where the User logged in. | +| `verificationurl` | query | string | no | Verification URL for the User which will be included in the Email template.. | +| `emailtemplate` | query | string | no | Name of the Email template to use for this notification. | +| `invitation_token` | query | string | no | Invitation token of an organization | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `fields` | query | string | no | Comma-separated list of profile fields to include in the response. | +| `options` | query | string | no | Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `g_recaptcha_response` | query | string | no | Google reCAPTCHA Response | +| `qq_captcha_ticket` | query | string | no | QQ reCAPTCHA Response | +| `qq_captcha_randstr` | query | string | no | QQ reCAPTCHA Response | +| `h-captcha-response` | query | string | no | hCaptcha Response | +| `rbabrowseremailtemplate` | query | string | no | RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. | +| `rbaoneclickemailtemplate` | query | string | no | RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. | +| `rbacityemailtemplate` | query | string | no | RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. | +| `rbacountryemailtemplate` | query | string | no | RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. | +| `rbaipemailtemplate` | query | string | no | RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. | +| `rbadeviceemailtemplate` | query | string | no | RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. | +| `rbaotpsmstemplate` | query | string | no | RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbabrowsersmstemplate` | query | string | no | RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbacitysmstemplate` | query | string | no | RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbacountrysmstemplate` | query | string | no | RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbaipsmstemplate` | query | string | no | RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbadevicesmstemplate` | query | string | no | RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | + +### Request body + +`PasskeyLoginAutofillRequest` as `application/json`. + +### Returns + +`AuthResponse` + +--- + +## `finishPasskeyLogin` + +**POST** `/identity/v2/auth/login/passkey/finish` + +Complete Login with Passkey + +Completes the login process using a Passkey. + +### Example + +```java +public static void callFinishPasskeyLogin(LoginRadiusClient client) { + PasskeyLoginFinish passkeyLoginFinish = new PasskeyLoginFinish().securityAnswer("<securityAnswer>").email("<email>").passkeyCredential("<passkeyCredential>"); //Required + String loginurl = "<loginurl>"; //Optional + String verificationurl = "<verificationurl>"; //Optional + String emailtemplate = "<emailtemplate>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + String fields = "<fields>"; //Optional + String options = "<options>"; //Optional + String invitationToken = "<invitationToken>"; //Optional + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String gRecaptchaResponse2 = "<gRecaptchaResponse2>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Optional + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Optional + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + String rbabrowseremailtemplate = "<rbabrowseremailtemplate>"; //Optional + String rbaoneclickemailtemplate = "<rbaoneclickemailtemplate>"; //Optional + String rbacityemailtemplate = "<rbacityemailtemplate>"; //Optional + String rbacountryemailtemplate = "<rbacountryemailtemplate>"; //Optional + String rbaipemailtemplate = "<rbaipemailtemplate>"; //Optional + String rbadeviceemailtemplate = "<rbadeviceemailtemplate>"; //Optional + String rbaotpsmstemplate = "<rbaotpsmstemplate>"; //Optional + String rbabrowsersmstemplate = "<rbabrowsersmstemplate>"; //Optional + String rbacitysmstemplate = "<rbacitysmstemplate>"; //Optional + String rbacountrysmstemplate = "<rbacountrysmstemplate>"; //Optional + String rbaipsmstemplate = "<rbaipsmstemplate>"; //Optional + String rbadevicesmstemplate = "<rbadevicesmstemplate>"; //Optional + + try { + var response = client.login.finishPasskeyLogin(passkeyLoginFinish, loginurl, verificationurl, emailtemplate, preventWebhook, xPreventWebhook, fields, options, invitationToken, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `loginurl` | query | string | no | Login URL for the User which will come in the login logs from where the User logged in. | +| `verificationurl` | query | string | no | Verification URL for the User which will be included in the Email template.. | +| `emailtemplate` | query | string | no | Name of the Email template to use for this notification. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `fields` | query | string | no | Comma-separated list of profile fields to include in the response. | +| `options` | query | string | no | Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail | +| `invitation_token` | query | string | no | Invitation token of an organization | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `g_recaptcha_response` | query | string | no | Google reCAPTCHA Response | +| `qq_captcha_ticket` | query | string | no | QQ reCAPTCHA Response | +| `qq_captcha_randstr` | query | string | no | QQ reCAPTCHA Response | +| `h-captcha-response` | query | string | no | hCaptcha Response | +| `rbabrowseremailtemplate` | query | string | no | RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. | +| `rbaoneclickemailtemplate` | query | string | no | RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. | +| `rbacityemailtemplate` | query | string | no | RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. | +| `rbacountryemailtemplate` | query | string | no | RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. | +| `rbaipemailtemplate` | query | string | no | RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. | +| `rbadeviceemailtemplate` | query | string | no | RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. | +| `rbaotpsmstemplate` | query | string | no | RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbabrowsersmstemplate` | query | string | no | RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbacitysmstemplate` | query | string | no | RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbacountrysmstemplate` | query | string | no | RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbaipsmstemplate` | query | string | no | RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbadevicesmstemplate` | query | string | no | RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | + +### Request body + +`PasskeyLoginFinish` as `application/json`. + +### Returns + +`AuthResponse` + +--- + +## `finishPasskeyReset` + +**POST** `/identity/v2/auth/passkey/reset/finish` + +Complete Passkey Reset + +Completes the reset Passkey process for a User. + +### Example + +```java +public static void callFinishPasskeyReset(LoginRadiusClient client) { + FinishMFAPasskeyRegistrationRequest finishMFAPasskeyRegistrationRequest = new FinishMFAPasskeyRegistrationRequest().passkeyCredential("<passkeyCredential>"); //Required + String vtoken = "<vtoken>"; //Optional + + try { + var response = client.login.finishPasskeyReset(finishMFAPasskeyRegistrationRequest, vtoken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `vtoken` | query | string | no | Verification token received in the Email. | + +### Request body + +`object` as `application/json`. + +### Returns + +`IsPostedResponse` + +--- + +## `getPhoneNumberAvailability` + +**GET** `/identity/v2/auth/phone` + +Check Phone availability + +Verifies if a Phone number is available for registration. + +### Example + +```java +public static void callGetPhoneNumberAvailability(LoginRadiusClient client) { + String phone = "<phone>"; //Optional + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String gRecaptchaResponse2 = "<gRecaptchaResponse2>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Optional + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Optional + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + + try { + var response = client.login.getPhoneNumberAvailability(phone, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `phone` | query | string (phone) | no | Phone ID of the associated Account. | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `g_recaptcha_response` | query | string | no | Google reCAPTCHA Response | +| `qq_captcha_ticket` | query | string | no | QQ reCAPTCHA Response | +| `qq_captcha_randstr` | query | string | no | QQ reCAPTCHA Response | +| `h-captcha-response` | query | string | no | hCaptcha Response | + +### Returns + +`IsExist` + +--- + +## `getSmartLogin` + +**GET** `/identity/v2/auth/login/smartlogin` + +Retrieve OTP or Link for Smart Login + +Initiates a smart login process using Email, Username, or Phone, allowing flexibility based on the User's input. + +### Example + +```java +public static void callGetSmartLogin(LoginRadiusClient client) { + String email = "<email>"; //Optional + String username = "<username>"; //Optional + String phone = "<phone>"; //Optional + String clientguid = "<clientguid>"; //Optional + String welcomeemailtemplate = "<welcomeemailtemplate>"; //Optional + String redirecturl = "<redirecturl>"; //Optional + String smstemplate = "<smstemplate>"; //Optional + Boolean isvoiceotp = true; //Optional + String smartloginemailtemplate = "<smartloginemailtemplate>"; //Optional + + try { + var response = client.login.getSmartLogin(email, username, phone, clientguid, welcomeemailtemplate, redirecturl, smstemplate, isvoiceotp, smartloginemailtemplate); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `email` | query | string (email) | no | Email address of the associated Account. | +| `username` | query | string | no | Username of the associated Account. | +| `phone` | query | string (phone) | no | Phone ID of the associated Account. | +| `clientguid` | query | string | no | Client GUID for the request. | +| `welcomeemailtemplate` | query | string | no | Welcome Email Template | +| `redirecturl` | query | string | no | The URL to which the User will be redirected after completing the operation, such as login or verification. | +| `smstemplate` | query | string | no | SMS Template | +| `isvoiceotp` | query | boolean | no | Boolean flag to enforce sending SMS content via Voice. | +| `smartloginemailtemplate` | query | string | no | The template name for the smart login Email. | + +### Returns + +`IsPostedResponse` + +--- + +## `loginByNoRegistrationPassCode` + +**POST** `/identity/v2/auth/onetouchlogin/phone/verify` + +Verify one-touch login + +Verifies a one-time passcode (OTP) for login without requiring User registration, including captcha validation and optional security answers. + +### Example + +```java +public static void callLoginByNoRegistrationPassCode(LoginRadiusClient client) { + VerifyOtpPhoneModel verifyOtpPhoneModel = new VerifyOtpPhoneModel().phone("<phone>"); //Required + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + String otp = "<otp>"; //Optional + String smstemplate = "<smstemplate>"; //Optional + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String gRecaptchaResponse2 = "<gRecaptchaResponse2>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Optional + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Optional + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + + try { + var response = client.login.loginByNoRegistrationPassCode(verifyOtpPhoneModel, xPreventWebhook, preventWebhook, otp, smstemplate, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `otp` | query | string | no | One-time passcode sent to the User's Email. | +| `smstemplate` | query | string | no | SMS Template | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `g_recaptcha_response` | query | string | no | Google reCAPTCHA Response | +| `qq_captcha_ticket` | query | string | no | QQ reCAPTCHA Response | +| `qq_captcha_randstr` | query | string | no | QQ reCAPTCHA Response | +| `h-captcha-response` | query | string | no | hCaptcha Response | + +### Request body + +`VerifyOtpPhoneModel` as `application/json`. + +### Returns + +`IsPostedResponse` + +--- + +## `nativeProviderAccessToken` + +**GET** `/api/v2/access_token/{nativeProvider}` + +Login via social provider + +Retrieves an Access Token for authentication through a native social provider. + +### Example + +```java +public static void callNativeProviderAccessToken(LoginRadiusClient client) { + String nativeProvider = "<nativeProvider>"; //Required + String refreshToken = "<refreshToken>"; //Required + String socialappname = "<socialappname>"; //Optional + URI redirectUri = URI.create("https://example.com"); //Optional + String providername = "<providername>"; //Optional + String code = "<code>"; //Optional + String twAccessToken = "<twAccessToken>"; //Optional + String twTokenSecret = "<twTokenSecret>"; //Optional + String googleAuthcode = "<googleAuthcode>"; //Optional + String clientId = "<clientId>"; //Optional + String googleAccessToken = "<googleAccessToken>"; //Optional + String idToken = "<idToken>"; //Optional + String fsAccessToken = "<fsAccessToken>"; //Optional + String lnAccessToken = "<lnAccessToken>"; //Optional + String fbAccessToken = "<fbAccessToken>"; //Optional + String invitationToken = "<invitationToken>"; //Optional + + try { + var response = client.login.nativeProviderAccessToken(nativeProvider, refreshToken, socialappname, redirectUri, providername, code, twAccessToken, twTokenSecret, googleAuthcode, clientId, googleAccessToken, idToken, fsAccessToken, lnAccessToken, fbAccessToken, invitationToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `nativeProvider` | path | string | yes | Indicates the provider for the native application. This parameter is used to specify the authentication provider for the native app. | +| `socialappname` | query | string | no | Indicates the name of the social application. This parameter is used to specify the social app for which the Access Token is being requested. | +| `redirect_uri` | query | string (uri) | no | Redirect URI for the OAuth/OIDC callback | +| `refresh_token` | query | string | yes | Refresh Token | +| `providername` | query | string | no | The name of the provider. This parameter is used to specify the provider for authentication. | +| `code` | query | string (uuid) | no | The authorization code received from the apple, wechat, qq provider. The parameter is used to exchange the authorization code for an Access Token. | +| `tw_access_token` | query | string (uuid) | no | The Access Token used for Twitter authentication. The parameter is used to authenticate the User with Twitter. | +| `tw_token_secret` | query | string (uuid) | no | The secret token used for Twitter authentication. The parameter is used to authenticate the User with Twitter. | +| `google_authcode` | query | string (uuid) | no | The authorization code received from Google. This parameter is used to exchange the authorization code for an Access Token. | +| `client_id` | query | string | no | OIDC application Client ID for request authentication. | +| `google_access_token` | query | string (uuid) | no | The Access Token received from Google. The parameter is used to authenticate the User with Google services. | +| `id_token` | query | string (uuid) | no | The ID token used for googlejwt, facebookjwt, applejwt authentication. The parameter is used to verify the User's identity. | +| `fs_access_token` | query | string (uuid) | no | The Access Token used for Foursquare authentication. The parameter is used to authenticate the User with Foursquare. | +| `ln_access_token` | query | string (uuid) | no | The Access Token used for LinkedIn authentication. The parameter is used to authenticate the User with LinkedIn. | +| `fb_access_token` | query | string (uuid) | no | The Access Token used for Facebook authentication. The parameter is used to authenticate the User with Facebook. | +| `invitation_token` | query | string | no | Invitation token of an organization | + +### Returns + +`AccessTokenResponse` + +--- + +## `oneTouchLoginByEmail` + +**POST** `/identity/v2/auth/onetouchlogin/email` + +Retrieve link or OTP for one-touch login + +Initiates a one-touch login process using an Email. + +### Example + +```java +public static void callOneTouchLoginByEmail(LoginRadiusClient client) { + OneTouchLoginByEmail oneTouchLoginByEmail = new OneTouchLoginByEmail().email("<email>").clientGuid("<clientGuid>"); //Required + String redirecturl = "<redirecturl>"; //Optional + String onetouchloginemailtemplate = "<onetouchloginemailtemplate>"; //Optional + String welcomeemailtemplate = "<welcomeemailtemplate>"; //Optional + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String gRecaptchaResponse2 = "<gRecaptchaResponse2>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Optional + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Optional + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + + try { + var response = client.login.oneTouchLoginByEmail(oneTouchLoginByEmail, redirecturl, onetouchloginemailtemplate, welcomeemailtemplate, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `redirecturl` | query | string | no | The URL to which the User will be redirected after completing the operation, such as login or verification. | +| `onetouchloginemailtemplate` | query | string | no | One Touch Login Email Template | +| `welcomeemailtemplate` | query | string | no | Welcome Email Template | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `g_recaptcha_response` | query | string | no | Google reCAPTCHA Response | +| `qq_captcha_ticket` | query | string | no | QQ reCAPTCHA Response | +| `qq_captcha_randstr` | query | string | no | QQ reCAPTCHA Response | +| `h-captcha-response` | query | string | no | hCaptcha Response | + +### Request body + +`OneTouchLoginByEmail` as `application/json`. + +### Returns + +`IsPostedResponse` + +--- + +## `oneTouchLoginByPhone` + +**POST** `/identity/v2/auth/onetouchlogin/phone` + +Retrieve OTP for one-touch login + +Initiates a one-touch login process using a Phone number. + +### Example + +```java +public static void callOneTouchLoginByPhone(LoginRadiusClient client) { + OneTouchLoginByPhone oneTouchLoginByPhone = new OneTouchLoginByPhone().phone("<phone>"); //Required + String smstemplate = "<smstemplate>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + Boolean isvoiceotp = true; //Optional + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String gRecaptchaResponse2 = "<gRecaptchaResponse2>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Optional + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Optional + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + + try { + var response = client.login.oneTouchLoginByPhone(oneTouchLoginByPhone, smstemplate, preventWebhook, xPreventWebhook, isvoiceotp, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `smstemplate` | query | string | no | SMS Template | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `isvoiceotp` | query | boolean | no | Boolean flag to enforce sending SMS content via Voice. | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `g_recaptcha_response` | query | string | no | Google reCAPTCHA Response | +| `qq_captcha_ticket` | query | string | no | QQ reCAPTCHA Response | +| `qq_captcha_randstr` | query | string | no | QQ reCAPTCHA Response | +| `h-captcha-response` | query | string | no | hCaptcha Response | + +### Request body + +`OneTouchLoginByPhone` as `application/json`. + +### Returns + +`IsPostedResponse` + +--- + +## `passkeyForgot` + +**POST** `/identity/v2/auth/passkey/forgot` + +Initiate Forgot Passkey + +Initiates the forgot Passkey process for a User. + +### Example + +```java +public static void callPasskeyForgot(LoginRadiusClient client) { + PasskeyForgot passkeyForgot = new PasskeyForgot().g-recaptcha-response("<g-recaptcha-response>").qq_captcha_ticket("<qq_captcha_ticket>").qq_captcha_randstr("<qq_captcha_randstr>"); //Required + String resetpasskeyurl = "<resetpasskeyurl>"; //Optional + String emailtemplate = "<emailtemplate>"; //Optional + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String gRecaptchaResponse2 = "<gRecaptchaResponse2>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Optional + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Optional + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + + try { + var response = client.login.passkeyForgot(passkeyForgot, resetpasskeyurl, emailtemplate, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `resetpasskeyurl` | query | string | no | Reset Passkey URL | +| `emailtemplate` | query | string | no | Name of the Email template to use for this notification. | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `g_recaptcha_response` | query | string | no | Google reCAPTCHA Response | +| `qq_captcha_ticket` | query | string | no | QQ reCAPTCHA Response | +| `qq_captcha_randstr` | query | string | no | QQ reCAPTCHA Response | +| `h-captcha-response` | query | string | no | hCaptcha Response | + +### Request body + +`PasskeyForgot` as `application/json`. + +### Returns + +`object` + +--- + +## `passwordlessEmailVerification` + +**GET** `/identity/v2/auth/login/passwordlesslogin/email/verify` + +Verify Email for passwordless login + +Verifies the Email using the provided Verification Token for passwordless login. + +### Example + +```java +public static void callPasswordlessEmailVerification(LoginRadiusClient client) { + String verificationtoken = "<verificationtoken>"; //Optional + String welcomeemailtemplate = "<welcomeemailtemplate>"; //Optional + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + String smstemplate2fa = "<smstemplate2fa>"; //Optional + String duoredirecturi = "<duoredirecturi>"; //Optional + + try { + var response = client.login.passwordlessEmailVerification(verificationtoken, welcomeemailtemplate, xPreventWebhook, preventWebhook, smstemplate2fa, duoredirecturi); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `verificationtoken` | query | string | no | Verification token received in the Email. | +| `welcomeemailtemplate` | query | string | no | Welcome Email Template | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `smstemplate2fa` | query | string | no | SMS template name to be used for sending the 2FA code to the User. | +| `duoredirecturi` | query | string | no | Duo auth redirection url. | + +### Returns + +`object` + +--- + +## `passwordlessLoginByEmail` + +**GET** `/identity/v2/auth/login/passwordlesslogin/email` + +Initiate passwordless login by Email + +Initiates a Passwordless login process using an Email or Username. This variant is login-only — the identifier must already belong to an existing User, and CAPTCHA is only required when the App configures optional CAPTCHA for this endpoint. Use the POST variant to auto-register an unknown Email with a registration profile. + +### Example + +```java +public static void callPasswordlessLoginByEmail(LoginRadiusClient client) { + String email = "<email>"; //Optional + String username = "<username>"; //Optional + String passwordlesslogintemplate = "<passwordlesslogintemplate>"; //Optional + String verificationurl = "<verificationurl>"; //Optional + String invitationToken = "<invitationToken>"; //Optional + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String gRecaptchaResponse2 = "<gRecaptchaResponse2>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Optional + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Optional + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + + try { + var response = client.login.passwordlessLoginByEmail(email, username, passwordlesslogintemplate, verificationurl, invitationToken, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `email` | query | string (email) | no | Email address of the associated Account. | +| `username` | query | string | no | Username of the associated Account. | +| `passwordlesslogintemplate` | query | string | no | Passwordless Login Template | +| `verificationurl` | query | string | no | Verification URL for the User which will be included in the Email template.. | +| `invitation_token` | query | string | no | Invitation token of an organization | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `g_recaptcha_response` | query | string | no | Google reCAPTCHA Response | +| `qq_captcha_ticket` | query | string | no | QQ reCAPTCHA Response | +| `qq_captcha_randstr` | query | string | no | QQ reCAPTCHA Response | +| `h-captcha-response` | query | string | no | hCaptcha Response | + +### Returns + +`IsPostedResponse` + +--- + +## `passwordlessLoginByEmailAndOTP` + +**POST** `/identity/v2/auth/login/passwordlesslogin/email/verifyotp` + +Verify Email and OTP for passwordless login + +Verifies the OTP sent to the Email for passwordless login. + +### Example + +```java +public static void callPasswordlessLoginByEmailAndOTP(LoginRadiusClient client) { + PasswordLessEmailOTPModel passwordLessEmailOTPModel = new PasswordLessEmailOTPModel().otp("<otp>").email("<email>"); //Required + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + String smstemplate2fa = "<smstemplate2fa>"; //Optional + String duoredirecturi = "<duoredirecturi>"; //Optional + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String gRecaptchaResponse2 = "<gRecaptchaResponse2>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Optional + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Optional + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + + try { + var response = client.login.passwordlessLoginByEmailAndOTP(passwordLessEmailOTPModel, xPreventWebhook, preventWebhook, smstemplate2fa, duoredirecturi, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `smstemplate2fa` | query | string | no | SMS template name to be used for sending the 2FA code to the User. | +| `duoredirecturi` | query | string | no | Duo auth redirection url. | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `g_recaptcha_response` | query | string | no | Google reCAPTCHA Response | +| `qq_captcha_ticket` | query | string | no | QQ reCAPTCHA Response | +| `qq_captcha_randstr` | query | string | no | QQ reCAPTCHA Response | +| `h-captcha-response` | query | string | no | hCaptcha Response | + +### Request body + +`PasswordLessEmailOTPModel` as `application/json`. + +### Returns + +`object` + +--- + +## `passwordlessLoginByEmailWithProfile` + +**POST** `/identity/v2/auth/login/passwordlesslogin/email` + +Initiate passwordless login by Email with a registration profile + +POST variant of passwordless login by Email. The email identifier and the full registration profile are supplied in the JSON body (same schema as /auth/register). When passwordless email auto-registration is enabled, a previously-unknown email is auto-registered with the supplied profile fields, and the request must carry a valid SOTT or CAPTCHA. This endpoint registers by email only — any PhoneId or UserName supplied in the body is ignored (not validated and not stored), and Password is not required. Sending the profile in the body (instead of query parameters) keeps PII out of URLs and logs. + +### Example + +```java +public static void callPasswordlessLoginByEmailWithProfile(LoginRadiusClient client) { + ProfileRequestModel profileRequestModel = new ProfileRequestModel().userName("<userName>").phoneId("<phoneId>").gender("<gender>"); //Required + String emailtemplate = "<emailtemplate>"; //Optional + String verificationurl = "<verificationurl>"; //Optional + String invitationToken = "<invitationToken>"; //Optional + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String gRecaptchaResponse2 = "<gRecaptchaResponse2>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Optional + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Optional + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + String xLoginRadiusSott = "<xLoginRadiusSott>"; //Optional + String sott = "<sott>"; //Optional + + try { + var response = client.login.passwordlessLoginByEmailWithProfile(profileRequestModel, emailtemplate, verificationurl, invitationToken, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, xLoginRadiusSott, sott); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `emailtemplate` | query | string | no | Name of the Email template to use for this notification. | +| `verificationurl` | query | string | no | Verification URL for the User which will be included in the Email template.. | +| `invitation_token` | query | string | no | Invitation token of an organization | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `g_recaptcha_response` | query | string | no | Google reCAPTCHA Response | +| `qq_captcha_ticket` | query | string | no | QQ reCAPTCHA Response | +| `qq_captcha_randstr` | query | string | no | QQ reCAPTCHA Response | +| `h-captcha-response` | query | string | no | hCaptcha Response | +| `X-LoginRadius-Sott` | header | string | no | SOTT should be generated from the server side and passed here or in sott query parameter. | +| `sott` | query | string | no | SOTT should be generated from the server side and passed here or in the X-LoginRadius-Sott header. | + +### Request body + +`ProfileRequestModel` as `application/json`. + +### Returns + +`IsPostedResponse` + +--- + +## `passwordlessLoginByPhone` + +**GET** `/identity/v2/auth/login/passwordlesslogin/otp` + +Initiate passwordless login by Phone + +Initiates a Passwordless login process using a Phone number — an OTP is sent to the supplied Phone number. This variant is login-only: the Phone number must already belong to an existing User, and CAPTCHA is only required when the App configures optional CAPTCHA for this endpoint. Use the POST variant to auto-register an unknown Phone number with a registration profile. + +### Example + +```java +public static void callPasswordlessLoginByPhone(LoginRadiusClient client) { + String phone = "<phone>"; //Optional + String smstemplate = "<smstemplate>"; //Optional + Boolean isvoiceotp = true; //Optional + String options = "<options>"; //Optional + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String gRecaptchaResponse2 = "<gRecaptchaResponse2>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Optional + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Optional + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + + try { + var response = client.login.passwordlessLoginByPhone(phone, smstemplate, isvoiceotp, options, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `phone` | query | string (phone) | no | Phone ID of the associated Account. | +| `smstemplate` | query | string | no | SMS Template | +| `isvoiceotp` | query | boolean | no | Boolean flag to enforce sending SMS content via Voice. | +| `options` | query | string | no | Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `g_recaptcha_response` | query | string | no | Google reCAPTCHA Response | +| `qq_captcha_ticket` | query | string | no | QQ reCAPTCHA Response | +| `qq_captcha_randstr` | query | string | no | QQ reCAPTCHA Response | +| `h-captcha-response` | query | string | no | hCaptcha Response | + +### Returns + +`SMSResponse` + +--- + +## `passwordlessLoginByPhoneWithProfile` + +**POST** `/identity/v2/auth/login/passwordlesslogin/otp` + +Initiate passwordless login by Phone with a registration profile + +POST variant of passwordless login by Phone. The phone identifier (PhoneId) and the full registration profile are supplied in the JSON body (same schema as /auth/register). When passwordless phone auto-registration is enabled, a previously-unknown phone number is auto-registered with the supplied profile fields, and the request must carry a valid SOTT or CAPTCHA. This endpoint registers by phone only — any Email or UserName supplied in the body is ignored (not validated and not stored), and Password is not required. Sending the profile in the body (instead of query parameters) keeps PII out of URLs and logs. + +### Example + +```java +public static void callPasswordlessLoginByPhoneWithProfile(LoginRadiusClient client) { + ProfileRequestModel profileRequestModel = new ProfileRequestModel().userName("<userName>").phoneId("<phoneId>").gender("<gender>"); //Required + String smstemplate = "<smstemplate>"; //Optional + Boolean isvoiceotp = true; //Optional + String options = "<options>"; //Optional + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String gRecaptchaResponse2 = "<gRecaptchaResponse2>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Optional + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Optional + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + String xLoginRadiusSott = "<xLoginRadiusSott>"; //Optional + String sott = "<sott>"; //Optional + + try { + var response = client.login.passwordlessLoginByPhoneWithProfile(profileRequestModel, smstemplate, isvoiceotp, options, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, xLoginRadiusSott, sott); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `smstemplate` | query | string | no | SMS Template | +| `isvoiceotp` | query | boolean | no | Boolean flag to enforce sending SMS content via Voice. | +| `options` | query | string | no | Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `g_recaptcha_response` | query | string | no | Google reCAPTCHA Response | +| `qq_captcha_ticket` | query | string | no | QQ reCAPTCHA Response | +| `qq_captcha_randstr` | query | string | no | QQ reCAPTCHA Response | +| `h-captcha-response` | query | string | no | hCaptcha Response | +| `X-LoginRadius-Sott` | header | string | no | SOTT should be generated from the server side and passed here or in sott query parameter. | +| `sott` | query | string | no | SOTT should be generated from the server side and passed here or in the X-LoginRadius-Sott header. | + +### Request body + +`ProfileRequestModel` as `application/json`. + +### Returns + +`SMSResponse` + +--- + +## `passwordlessLoginByUsernameAndOTP` + +**POST** `/identity/v2/auth/login/passwordlesslogin/username/verifyotp` + +Verify Username for passwordless login + +Verifies the OTP sent to the Username for passwordless login. + +### Example + +```java +public static void callPasswordlessLoginByUsernameAndOTP(LoginRadiusClient client) { + PasswordLessUserNameOTPModel passwordLessUserNameOTPModel = new PasswordLessUserNameOTPModel().otp("<otp>").userName("<userName>"); //Required + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + String smstemplate2fa = "<smstemplate2fa>"; //Optional + String duoredirecturi = "<duoredirecturi>"; //Optional + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String gRecaptchaResponse2 = "<gRecaptchaResponse2>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Optional + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Optional + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + + try { + var response = client.login.passwordlessLoginByUsernameAndOTP(passwordLessUserNameOTPModel, xPreventWebhook, preventWebhook, smstemplate2fa, duoredirecturi, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `smstemplate2fa` | query | string | no | SMS template name to be used for sending the 2FA code to the User. | +| `duoredirecturi` | query | string | no | Duo auth redirection url. | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `g_recaptcha_response` | query | string | no | Google reCAPTCHA Response | +| `qq_captcha_ticket` | query | string | no | QQ reCAPTCHA Response | +| `qq_captcha_randstr` | query | string | no | QQ reCAPTCHA Response | +| `h-captcha-response` | query | string | no | hCaptcha Response | + +### Request body + +`PasswordLessUserNameOTPModel` as `application/json`. + +### Returns + +`object` + +--- + +## `passwordlessLoginPhoneVerification` + +**PUT** `/identity/v2/auth/login/passwordlesslogin/otp/verify` + +Verify Phone for passwordless login + +Verifies the OTP sent to the Phone number for passwordless login. + +### Example + +```java +public static void callPasswordlessLoginPhoneVerification(LoginRadiusClient client) { + PhoneOTPModel phoneOTPModel = new PhoneOTPModel().OTP("<OTP>").phone("<phone>"); //Required + String smstemplate = "<smstemplate>"; //Optional + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String gRecaptchaResponse2 = "<gRecaptchaResponse2>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Optional + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Optional + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + String emailtemplate2fa = "<emailtemplate2fa>"; //Optional + String duoredirecturi = "<duoredirecturi>"; //Optional + + try { + var response = client.login.passwordlessLoginPhoneVerification(phoneOTPModel, smstemplate, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, emailtemplate2fa, duoredirecturi); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `smstemplate` | query | string | no | SMS Template | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `g_recaptcha_response` | query | string | no | Google reCAPTCHA Response | +| `qq_captcha_ticket` | query | string | no | QQ reCAPTCHA Response | +| `qq_captcha_randstr` | query | string | no | QQ reCAPTCHA Response | +| `h-captcha-response` | query | string | no | hCaptcha Response | +| `emailtemplate2fa` | query | string | no | Name of the 2FA Email template to use for this notification. | +| `duoredirecturi` | query | string | no | Duo auth redirection url. | + +### Request body + +`PhoneOTPModel` as `application/json`. + +### Returns + +`object` + +--- + +## `pingSmartLogin` + +**GET** `/identity/v2/auth/login/smartlogin/ping` + +Ping Smart Login + +Checks in the background if the smart login is verified successfully. + +### Example + +```java +public static void callPingSmartLogin(LoginRadiusClient client) { + String clientguid = "<clientguid>"; //Required + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + + try { + var response = client.login.pingSmartLogin(clientguid, xPreventWebhook, preventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `clientguid` | query | string | yes | Client GUID for the request. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | + +### Returns + +`AuthResponse` + +--- + +## `verifyAutoLoginEmailOneTouch` + +**GET** `/identity/v2/auth/email/onetouchlogin` + +Verify one-touch login by Email + +Verifies the auto-login Email using a Verification Token. + +### Example + +```java +public static void callVerifyAutoLoginEmailOneTouch(LoginRadiusClient client) { + String email = "<email>"; //Optional + String welcomeemailtemplate = "<welcomeemailtemplate>"; //Optional + String verificationtoken = "<verificationtoken>"; //Optional + String vtoken = "<vtoken>"; //Optional + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + + try { + var response = client.login.verifyAutoLoginEmailOneTouch(email, welcomeemailtemplate, verificationtoken, vtoken, xPreventWebhook, preventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `email` | query | string (email) | no | Email address of the associated Account. | +| `welcomeemailtemplate` | query | string | no | Welcome Email Template | +| `verificationtoken` | query | string | no | Verification token received in the Email. | +| `vtoken` | query | string | no | Verification token received in the Email. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | + +### Returns + +`IsPostedVerified` + +--- + +## `verifyAutoLoginEmailSmartLogin` + +**GET** `/identity/v2/auth/email/smartlogin` + +Verify smart login by Email + +Verifies the auto-login Email using a Verification Token. + +### Example + +```java +public static void callVerifyAutoLoginEmailSmartLogin(LoginRadiusClient client) { + String verificationtoken = "<verificationtoken>"; //Optional + String vtoken = "<vtoken>"; //Optional + String welcomeemailtemplate = "<welcomeemailtemplate>"; //Optional + String email = "<email>"; //Optional + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + + try { + var response = client.login.verifyAutoLoginEmailSmartLogin(verificationtoken, vtoken, welcomeemailtemplate, email, xPreventWebhook, preventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `verificationtoken` | query | string | no | Verification token received in the Email. | +| `vtoken` | query | string | no | Verification token received in the Email. | +| `welcomeemailtemplate` | query | string | no | Welcome Email Template | +| `email` | query | string (email) | no | Email address of the associated Account. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | + +### Returns + +`IsPostedVerified` + diff --git a/docs/apis/multipurpose-tokens.md b/docs/apis/multipurpose-tokens.md new file mode 100644 index 0000000..88b2769 --- /dev/null +++ b/docs/apis/multipurpose-tokens.md @@ -0,0 +1,188 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Multipurpose Tokens + +4 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `forgotPasswordTokenAndEmail` + +**POST** `/identity/v2/manage/account/forgot/token` + +Retrieve Forgot Password Token + +Generates a Forgot Password Token for the User and optionally sends an Email with the token. + +### Example + +```java +public static void callForgotPasswordTokenAndEmail(LoginRadiusClient client) { + ForgotPasswordTokenAndEmailRequest forgotPasswordTokenAndEmailRequest = new ForgotPasswordTokenAndEmailRequest(); //Required + String sendemail = "<sendemail>"; //Optional + String resetpasswordurl = "<resetpasswordurl>"; //Optional + String emailtemplate = "<emailtemplate>"; //Optional + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + + try { + var response = client.multipurposeTokens.forgotPasswordTokenAndEmail(forgotPasswordTokenAndEmailRequest, sendemail, resetpasswordurl, emailtemplate, xPreventWebhook, preventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `sendemail` | query | string | no | Indicates whether to send an Email with the forgot Password token. | +| `resetpasswordurl` | query | string | no | Callback URL for the Password Reset link in the Email. | +| `emailtemplate` | query | string | no | Name of the Email template to use for this notification. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | + +### Request body + +`object` as `application/json`. + +### Returns + +`ForgotPasswordTokenModel` + +--- + +## `getVerificationToken` + +**GET** `/identity/v2/manage/account/vtoken` + +Retrieve Email Verification Token + +Retrieves an Email Verification Token for a specified Email. Optionally sends the verification Email to the User when sendemail is set to true. + +### Example + +```java +public static void callGetVerificationToken(LoginRadiusClient client) { + String vtype = "<vtype>"; //Required + String email = "<email>"; //Optional + String expiresIn = "<expiresIn>"; //Optional + String sendemail = "<sendemail>"; //Optional + String verificationurl = "<verificationurl>"; //Optional + String emailtemplate = "<emailtemplate>"; //Optional + + try { + var response = client.multipurposeTokens.getVerificationToken(vtype, email, expiresIn, sendemail, verificationurl, emailtemplate); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `email` | query | string (email) | no | Email address of the associated Account. | +| `vtype` | query | string | yes | The type of verification. Currently, only "Email" is supported. | +| `expires_in` | query | string | no | | +| `sendemail` | query | string | no | Indicates whether to send an Email with the forgot Password token. | +| `verificationurl` | query | string | no | Verification URL for the User which will be included in the Email template.. | +| `emailtemplate` | query | string | no | Name of the Email template to use for this notification. | + +### Returns + +`VerificationLinkResponse` + +--- + +## `multipurposeEmailTokenAPI` + +**POST** `/identity/v2/manage/account/emailtoken/{tokentype}` + +Retrieve Multipurpose Email Token + +Retrieves a multi-purpose Email token for verification, Password reset, and other Email-related actions. + +### Example + +```java +public static void callMultipurposeEmailTokenAPI(LoginRadiusClient client) { + String tokentype = "<tokentype>"; //Required + MultipurposeEmailTokenAPIRequest multipurposeEmailTokenAPIRequest = new MultipurposeEmailTokenAPIRequest(); //Required + + try { + var response = client.multipurposeTokens.multipurposeEmailTokenAPI(tokentype, multipurposeEmailTokenAPIRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `tokentype` | path | string | yes | Token purpose: `emailverification`, `forgotpin`, `addemail`, `deleteuser`, `onetouchlogin`, or `autologin`. | + +### Request body + +`object` as `application/json`. + +### Returns + +`GenerateTokenResponse` + +--- + +## `multipurposeSmsOtpAPI` + +**POST** `/identity/v2/manage/account/smsotp/{smsotptype}` + +Multipurpose SMS OTP + +Generates an OTP for the User, applicable for adding a Phone, Phone ID verification, and other SMS-related actions. + +### Example + +```java +public static void callMultipurposeSmsOtpAPI(LoginRadiusClient client) { + String smsotptype = "<smsotptype>"; //Required + MultipurposeSmsOtpAPIRequest multipurposeSmsOtpAPIRequest = new MultipurposeSmsOtpAPIRequest(); //Required + + try { + var response = client.multipurposeTokens.multipurposeSmsOtpAPI(smsotptype, multipurposeSmsOtpAPIRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `smsotptype` | path | string | yes | OTP purpose: `addphone`, `phoneidverification`, `forgotpassword`, `forgotpin`, `onetouchlogin`, `smartlogin`, `passwordlesslogin`, or `deleteuser`. | + +### Request body + +`object` as `application/json`. + +### Returns + +`GenerateTokenResponse` + diff --git a/docs/apis/oauth-clients.md b/docs/apis/oauth-clients.md new file mode 100644 index 0000000..7f8d0e0 --- /dev/null +++ b/docs/apis/oauth-clients.md @@ -0,0 +1,250 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# OAuth Clients + +7 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `createOAuthClientConfiguration` + +**POST** `/v2/manage/oauth-clients` + +Create OAuth client + +Creates a new OAuth client configuration for the Tenant by specifying redirect URIs, scopes, and other necessary settings to enable OAuth authentication and authorization. + +### Example + +```java +public static void callCreateOAuthClientConfiguration(LoginRadiusClient client) { + CreateOAuthClientConfigurationRequest createOAuthClientConfigurationRequest = new CreateOAuthClientConfigurationRequest().appName("<appName>").tokenAuthMethod("<tokenAuthMethod>"); //Required + + try { + var response = client.oauthClients.createOAuthClientConfiguration(createOAuthClientConfigurationRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`object` as `application/json`. + +### Returns + +`OAuthClientResponse` + +--- + +## `deleteOAuthClient` + +**DELETE** `/v2/manage/oauth-clients/{oAuthClientName}` + +Delete OAuth Client Configuration + +Deletes the OAuth client configuration for the Tenant identified by the application name. + +### Example + +```java +public static void callDeleteOAuthClient(LoginRadiusClient client) { + String oAuthClientName = "<oAuthClientName>"; //Required + + try { + var response = client.oauthClients.deleteOAuthClient(oAuthClientName); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `oAuthClientName` | path | string | yes | Name of the OAuth Client | + +### Returns + +`DeleteResponse` + +--- + +## `getAllOAuthClientsConfigurations` + +**GET** `/v2/manage/oauth-clients` + +List OAuth clients + +Retrieves a comprehensive list of OAuth client configurations for the Tenant, including client IDs, redirect URIs, scopes, and other relevant settings. + +### Example + +```java +public static void callGetAllOAuthClientsConfigurations(LoginRadiusClient client) { + try { + var response = client.oauthClients.getAllOAuthClientsConfigurations(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`object` + +--- + +## `getOAuthClientConfigurationByAppName` + +**GET** `/v2/manage/oauth-clients/{oAuthClientName}` + +Retrieve OAuth Client Configuration + +Retrieves the OAuth client configuration details for the Tenant using the application name. + +### Example + +```java +public static void callGetOAuthClientConfigurationByAppName(LoginRadiusClient client) { + String oAuthClientName = "<oAuthClientName>"; //Required + + try { + var response = client.oauthClients.getOAuthClientConfigurationByAppName(oAuthClientName); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `oAuthClientName` | path | string | yes | Name of the OAuth Client | + +### Returns + +`OAuthClientResponse` + +--- + +## `getOAuthClientConnectionsMetadata` + +**GET** `/v2/manage/oauth-clients/connections-metadata` + +Retrieve OAuth Client Metadata + +Retrieves metadata for OAuth client connections within the Tenant. + +### Example + +```java +public static void callGetOAuthClientConnectionsMetadata(LoginRadiusClient client) { + try { + var response = client.oauthClients.getOAuthClientConnectionsMetadata(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`object` + +--- + +## `resetOAuthClientConfigurationSecretByAppName` + +**PUT** `/v2/manage/oauth-clients/credentials/{oAuthClientName}` + +Reset OAuth client secret + +Resets the client secret for the OAuth client configuration identified by the AppName within the Tenant, generating a new client secret and invalidating the previous one to enhance security. + +### Example + +```java +public static void callResetOAuthClientConfigurationSecretByAppName(LoginRadiusClient client) { + String oAuthClientName = "<oAuthClientName>"; //Required + + try { + var response = client.oauthClients.resetOAuthClientConfigurationSecretByAppName(oAuthClientName); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `oAuthClientName` | path | string | yes | Name of the OAuth Client | + +### Returns + +`OAuthClientSecretResetResponse` + +--- + +## `updateOAuthClientConfigurationByAppName` + +**PUT** `/v2/manage/oauth-clients/{oAuthClientName}` + +Update OAuth Client Configuration + +Updates the OAuth client configuration for the Tenant identified by the application name. + +### Example + +```java +public static void callUpdateOAuthClientConfigurationByAppName(LoginRadiusClient client) { + String oAuthClientName = "<oAuthClientName>"; //Required + OAuthClientRequest oauthClientRequest = new OAuthClientRequest().allowedCorsOrigin("<allowedCorsOrigin>").allowedScopes("<allowedScopes>").audienceScopes("<audienceScopes>"); //Required + + try { + var response = client.oauthClients.updateOAuthClientConfigurationByAppName(oAuthClientName, oauthClientRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `oAuthClientName` | path | string | yes | Name of the OAuth Client | + +### Request body + +`OAuthClientRequest` as `application/json`. + +### Returns + +`OAuthClientResponse` + diff --git a/docs/apis/oauth-custom-providers.md b/docs/apis/oauth-custom-providers.md new file mode 100644 index 0000000..c8dad53 --- /dev/null +++ b/docs/apis/oauth-custom-providers.md @@ -0,0 +1,169 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# OAuth Custom Providers + +5 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `createCustomProvider` + +**POST** `/v2/manage/custom-providers/oauth` + +Create custom OAuth provider + +Creates a new Custom OAuth provider for the Tenant. + +### Example + +```java +public static void callCreateCustomProvider(LoginRadiusClient client) { + CustomOAuth2Model customOAuth2Model = new CustomOAuth2Model().providerName("<providerName>").userLoginEndpoint("<userLoginEndpoint>").accessTokenEndpoint("<accessTokenEndpoint>").applicationKey("<applicationKey>").applicationSecret("<applicationSecret>").scope("<scope>").responseType("<responseType>").dataMap("<dataMap>").requestTokenHttpMethod("<requestTokenHttpMethod>"); //Required + + try { + var response = client.oauthCustomProviders.createCustomProvider(customOAuth2Model); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`CustomOAuth2Model` as `application/json`. + +### Returns + +`OAuth2Provider` + +--- + +## `deleteCustomProvider` + +**DELETE** `/v2/manage/custom-providers/oauth` + +Delete custom OAuth provider + +Deletes an existing Custom OAuth provider for the Tenant using the provider name specified in the request body. + +### Example + +```java +public static void callDeleteCustomProvider(LoginRadiusClient client) { + CustomOAuth2DeleteModel customOAuth2DeleteModel = new CustomOAuth2DeleteModel().providerName("<providerName>"); //Required + + try { + var response = client.oauthCustomProviders.deleteCustomProvider(customOAuth2DeleteModel); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`CustomOAuth2DeleteModel` as `application/json`. + +### Returns + +`DeleteResponse` + +--- + +## `getAllCustomOAuthProviders` + +**GET** `/v2/manage/custom-providers/oauth` + +List custom OAuth providers + +Retrieves all custom OAuth providers configured for the Tenant. + +### Example + +```java +public static void callGetAllCustomOAuthProviders(LoginRadiusClient client) { + try { + var response = client.oauthCustomProviders.getAllCustomOAuthProviders(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`object` + +--- + +## `getCustomProviderKeys` + +**GET** `/v2/manage/custom-providers/oauth/keys` + +Retrieve custom OAuth provider keys + +Retrieves all custom OAuth provider keys for the Tenant. + +### Example + +```java +public static void callGetCustomProviderKeys(LoginRadiusClient client) { + try { + var response = client.oauthCustomProviders.getCustomProviderKeys(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`object` + +--- + +## `updateCustomProvider` + +**PUT** `/v2/manage/custom-providers/oauth` + +Update custom OAuth provider + +Updates an existing Custom OAuth provider for the Tenant using the provider name specified in the request body. + +### Example + +```java +public static void callUpdateCustomProvider(LoginRadiusClient client) { + CustomOAuth2UpdateModel customOAuth2UpdateModel = new CustomOAuth2UpdateModel().providerName("<providerName>"); //Required + + try { + var response = client.oauthCustomProviders.updateCustomProvider(customOAuth2UpdateModel); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`CustomOAuth2UpdateModel` as `application/json`. + +### Returns + +`OAuth2Provider` + diff --git a/docs/apis/oauth-integrations.md b/docs/apis/oauth-integrations.md new file mode 100644 index 0000000..acf28c4 --- /dev/null +++ b/docs/apis/oauth-integrations.md @@ -0,0 +1,222 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# OAuth Integrations + +6 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `createOAuthIntegration` + +**POST** `/v2/manage/integrations/oauth` + +Create OAuth Integration + +Creates a new OAuth/OIDC integration configuration for the Tenant. The response returns the integration's identifier (Id), which is also the {oAuthApp} segment of the runtime OAuth/OIDC endpoints. Only the authorization_code and refresh_token grant types are permitted. + +### Example + +```java +public static void callCreateOAuthIntegration(LoginRadiusClient client) { + CreateOAuthIntegrationRequest createOAuthIntegrationRequest = new CreateOAuthIntegrationRequest().displayName("<displayName>").redirectURIs("<redirectURIs>").grantTypes("<grantTypes>"); //Required + + try { + var response = client.oauthIntegrations.createOAuthIntegration(createOAuthIntegrationRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`object` as `application/json`. + +### Returns + +`OAuthIntegrationResponse` + +--- + +## `deleteOAuthIntegration` + +**DELETE** `/v2/manage/integrations/oauth/{integrationId}` + +Delete OAuth Integration configuration + +Deletes an existing OAuth/OIDC integration configuration for the Tenant using its Id, permanently removing it. + +### Example + +```java +public static void callDeleteOAuthIntegration(LoginRadiusClient client) { + String integrationId = "<integrationId>"; //Required + + try { + var response = client.oauthIntegrations.deleteOAuthIntegration(integrationId); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `integrationId` | path | string | yes | The OAuth integration identifier. It is the integration's OAuth application name, so the same value is the {oAuthApp} path segment of the runtime OAuth/OIDC endpoints (e.g. /api/oidc/{integrationId}/token). | + +### Returns + +`DeleteResponse` + +--- + +## `getAllOAuthIntegrations` + +**GET** `/v2/manage/integrations/oauth` + +List OAuth Integrations + +Retrieves a list of all configured OAuth/OIDC integrations for the Tenant, including redirect URIs, allowed scopes, grant types, claim mappings, and token settings. + +### Example + +```java +public static void callGetAllOAuthIntegrations(LoginRadiusClient client) { + try { + var response = client.oauthIntegrations.getAllOAuthIntegrations(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`object` + +--- + +## `getOAuthIntegrationById` + +**GET** `/v2/manage/integrations/oauth/{integrationId}` + +Retrieve OAuth Integration configuration + +Retrieves the details of a specific OAuth/OIDC integration configuration for the Tenant using its Id, including redirect URIs, scopes, grant types, claim mappings, and token settings. + +### Example + +```java +public static void callGetOAuthIntegrationById(LoginRadiusClient client) { + String integrationId = "<integrationId>"; //Required + + try { + var response = client.oauthIntegrations.getOAuthIntegrationById(integrationId); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `integrationId` | path | string | yes | The OAuth integration identifier. It is the integration's OAuth application name, so the same value is the {oAuthApp} path segment of the runtime OAuth/OIDC endpoints (e.g. /api/oidc/{integrationId}/token). | + +### Returns + +`OAuthIntegrationResponse` + +--- + +## `rotateOAuthIntegrationCredentials` + +**PUT** `/v2/manage/integrations/oauth/{integrationId}/credentials` + +Rotate OAuth Integration client secret + +Regenerates the client secret for an existing OAuth/OIDC integration identified by its Id. The ClientId and Id are unchanged; only the secret is rotated. The new plaintext ClientSecret is returned once in this response, and only its hash is persisted server-side. + +### Example + +```java +public static void callRotateOAuthIntegrationCredentials(LoginRadiusClient client) { + String integrationId = "<integrationId>"; //Required + + try { + var response = client.oauthIntegrations.rotateOAuthIntegrationCredentials(integrationId); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `integrationId` | path | string | yes | The OAuth integration identifier. It is the integration's OAuth application name, so the same value is the {oAuthApp} path segment of the runtime OAuth/OIDC endpoints (e.g. /api/oidc/{integrationId}/token). | + +### Returns + +`OAuthIntegrationCredentialsResponse` + +--- + +## `updateOAuthIntegrationById` + +**PUT** `/v2/manage/integrations/oauth/{integrationId}` + +Update OAuth Integration configuration + +Updates an existing OAuth/OIDC integration configuration for the Tenant identified by its Id. Id and DisplayName are immutable; only configuration fields are updated. Omitting a field leaves its stored value unchanged, as does a token lifetime of 0; passing an explicit empty AllowedScopes array removes all scopes from the integration. + +### Example + +```java +public static void callUpdateOAuthIntegrationById(LoginRadiusClient client) { + String integrationId = "<integrationId>"; //Required + OAuthIntegrationBaseModel oauthIntegrationBaseModel = new OAuthIntegrationBaseModel().redirectURIs("<redirectURIs>").allowedScopes("<allowedScopes>").grantTypes("<grantTypes>"); //Required + + try { + var response = client.oauthIntegrations.updateOAuthIntegrationById(integrationId, oauthIntegrationBaseModel); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `integrationId` | path | string | yes | The OAuth integration identifier. It is the integration's OAuth application name, so the same value is the {oAuthApp} path segment of the runtime OAuth/OIDC endpoints (e.g. /api/oidc/{integrationId}/token). | + +### Request body + +`OAuthIntegrationBaseModel` as `application/json`. + +### Returns + +`OAuthIntegrationResponse` + diff --git a/docs/apis/oauth-m2m.md b/docs/apis/oauth-m2m.md new file mode 100644 index 0000000..f313d2f --- /dev/null +++ b/docs/apis/oauth-m2m.md @@ -0,0 +1,137 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# OAuth M2M + +4 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `generateM2MToken` + +**POST** `/service/oauth/token` + +Generate M2M token + +Generates a Machine-to-Machine (M2M) token for application authentication. + +### Example + +```java +public static void callGenerateM2MToken(LoginRadiusClient client) { + OAuthM2MTokenGenerate oauthM2MTokenGenerate = new OAuthM2MTokenGenerate().audience("<audience>").client_id("<client_id>").client_secret("<client_secret>").grant_type("<grant_type>"); //Required + + try { + var response = client.oauthM2M.generateM2MToken(oauthM2MTokenGenerate); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`OAuthM2MTokenGenerate` as `application/json`. + +### Returns + +`OAuthM2MTokenResponse` + +--- + +## `getM2MJWKSConfig` + +**GET** `/service/oauth/jwks` + +Retrieve JSON Web Key Set + +Retrieves the JSON Web Key Set (JWKS) for verifying token signatures. + +### Example + +```java +public static void callGetM2MJWKSConfig(LoginRadiusClient client) { + try { + var response = client.oauthM2M.getM2MJWKSConfig(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`JWKSResponse` + +--- + +## `getM2MTokenInfo` + +**POST** `/service/oauth/introspect` + +Retrieve M2M token info + +Retrieves information about a Machine-to-Machine (M2M) token. + +### Example + +```java +public static void callGetM2MTokenInfo(LoginRadiusClient client) { + OAuthM2MTokenIntrospect oauthM2MTokenIntrospect = new OAuthM2MTokenIntrospect().client_id("<client_id>").client_secret("<client_secret>").token("<token>").token_type_hint("<token_type_hint>"); //Required + + try { + var response = client.oauthM2M.getM2MTokenInfo(oauthM2MTokenIntrospect); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`OAuthM2MTokenIntrospect` as `application/json`. + +### Returns + +`OAuthM2MIntrospectResponse` + +--- + +## `revokeM2MToken` + +**POST** `/service/oauth/revoke` + +Revoke M2M token + +Revokes a Machine-to-Machine (M2M) token to invalidate it. + +### Example + +```java +public static void callRevokeM2MToken(LoginRadiusClient client) { + OAuthM2MTokenRevoke oauthM2MTokenRevoke = new OAuthM2MTokenRevoke().client_id("<client_id>").client_secret("<client_secret>").token("<token>").token_type_hint("<token_type_hint>"); //Required + + try { + var response = client.oauthM2M.revokeM2MToken(oauthM2MTokenRevoke); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`OAuthM2MTokenRevoke` as `application/json`. + diff --git a/docs/apis/oauth.md b/docs/apis/oauth.md new file mode 100644 index 0000000..f4bcfe7 --- /dev/null +++ b/docs/apis/oauth.md @@ -0,0 +1,249 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# OAuth + +6 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `getOAuthAuthorizationServerMetadataOAuth` + +**GET** `/service/oauth/{OAuthAppName}/.well-known/oauth-authorization-server` + +OAuth Authorization Server Metadata (OAuth app) + +Returns OAuth 2.0 Authorization Server Metadata (RFC 8414) for the given OAuth app. +Use this endpoint for OAuth 2.0 client discovery when using the OAuth flow path. + +### Example + +```java +public static void callGetOAuthAuthorizationServerMetadataOAuth(LoginRadiusClient client) { + String oauthAppName = "<oauthAppName>"; //Required + + try { + var response = client.oauth.getOAuthAuthorizationServerMetadataOAuth(oauthAppName); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `OAuthAppName` | path | string | yes | OAuth App Name | + +### Returns + +`OAuthAuthorizationServerMetadata` + +--- + +## `getOAuthDeviceCode` + +**POST** `/api/oauth/{OAuthAppName}/device` + +Retrieve OAuth device code + +Initiates the OAuth 2.0 Device Authorization Grant per RFC 8628. Returns a device_code and user_code that the client displays to the end-user for out-of-band authorization on a secondary device. The client then polls the token endpoint with the device_code until the user completes authorization. + +### Example + +```java +public static void callGetOAuthDeviceCode(LoginRadiusClient client) { + String oauthAppName = "<oauthAppName>"; //Required + OAuthDeviceCode oauthDeviceCode = new OAuthDeviceCode().client_id("<client_id>"); //Required + + try { + var response = client.oauth.getOAuthDeviceCode(oauthAppName, oauthDeviceCode); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `OAuthAppName` | path | string | yes | OAuth App Name | + +### Request body + +`OAuthDeviceCode` as `application/json`. + +### Returns + +`OAuthDeviceCodeResponse` + +--- + +## `getOAuthTokens` + +**POST** `/api/oauth/{OAuthAppName}/token` + +Retrieve OAuth tokens + +Retrieves OAuth tokens for authentication and authorization purposes. + +### Example + +```java +public static void callGetOAuthTokens(LoginRadiusClient client) { + String oauthAppName = "<oauthAppName>"; //Required + GetOAuthTokensRequest getOAuthTokensRequest = new GetOAuthTokensRequest(); //Required + + try { + var response = client.oauth.getOAuthTokens(oauthAppName, getOAuthTokensRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `OAuthAppName` | path | string | yes | OAuth App Name | + +### Request body + +`object` as `application/json`. + +### Returns + +`OAuthTokenResponse` + +--- + +## `introspectOAuthToken` + +**POST** `/api/oauth/{OAuthAppName}/introspect` + +Introspect OAuth token + +Returns the active state and metadata of an OAuth access or refresh token per RFC 7662 (OAuth 2.0 Token Introspection). The client must authenticate using either HTTP Basic authentication (Authorization: Basic base64(client_id:client_secret)) or by including client_id and client_secret in the POST body, depending on the token_endpoint_auth_method configured for the OAuth application. Returns active: true with associated claims for valid tokens, or active: false for invalid, expired, or revoked tokens. + +### Example + +```java +public static void callIntrospectOAuthToken(LoginRadiusClient client) { + String oauthAppName = "<oauthAppName>"; //Required + OAuthRevokeRefreshToken oauthRevokeRefreshToken = new OAuthRevokeRefreshToken().client_id("<client_id>").client_secret("<client_secret>").token("<token>"); //Required + + try { + var response = client.oauth.introspectOAuthToken(oauthAppName, oauthRevokeRefreshToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `OAuthAppName` | path | string | yes | OAuth App Name | + +### Request body + +`OAuthRevokeRefreshToken` as `application/json`. + +### Returns + +`OIDCTokenIntrospectResponse` + +--- + +## `oAuthPushedAuthorizationRequest` + +**POST** `/api/oauth/{OAuthAppName}/par` + +OAuth 2.0 Pushed Authorization Request (PAR) + +Accepts an OAuth 2.0 authorization request and stores it server-side per RFC 9126 (OAuth 2.0 Pushed Authorization Requests). Returns a short-lived request_uri that the client passes as the sole parameter to the authorization endpoint, keeping all sensitive request parameters out of the browser URL. This feature must be explicitly enabled on the OAuth application configuration. + +### Example + +```java +public static void callOAuthPushedAuthorizationRequest(LoginRadiusClient client) { + String oauthAppName = "<oauthAppName>"; //Required + PARRequest paRRequest = new PARRequest().client_id("<client_id>").redirect_uri("<redirect_uri>").response_type("<response_type>").scope("<scope>"); //Required + + try { + var response = client.oauth.oAuthPushedAuthorizationRequest(oauthAppName, paRRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `OAuthAppName` | path | string | yes | OAuth App Name | + +### Request body + +`PARRequest` as `application/json`. + +### Returns + +`PARResponse` + +--- + +## `revokeOAuthRefreshToken` + +**POST** `/api/oauth/{OAuthAppName}/revoke` + +Revoke OAuth refresh token + +Revokes an OAuth refresh token per RFC 7009 (OAuth 2.0 Token Revocation), invalidating it and preventing any further use. The client must authenticate using client_id and client_secret via HTTP Basic or POST body. + +### Example + +```java +public static void callRevokeOAuthRefreshToken(LoginRadiusClient client) { + String oauthAppName = "<oauthAppName>"; //Required + OAuthRevokeRefreshToken oauthRevokeRefreshToken = new OAuthRevokeRefreshToken().client_id("<client_id>").client_secret("<client_secret>").token("<token>"); //Required + + try { + var response = client.oauth.revokeOAuthRefreshToken(oauthAppName, oauthRevokeRefreshToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `OAuthAppName` | path | string | yes | OAuth App Name | + +### Request body + +`OAuthRevokeRefreshToken` as `application/json`. + diff --git a/docs/apis/oidc.md b/docs/apis/oidc.md new file mode 100644 index 0000000..4b01841 --- /dev/null +++ b/docs/apis/oidc.md @@ -0,0 +1,555 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# OIDC + +14 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `deleteDynamicClient` + +**DELETE** `/api/oidc/{OIDCAppName}/register/{clientID}` + +Delete a Dynamic Client + +Deletes a dynamically registered OAuth 2.0/OIDC client per RFC 7592. Requires the registration_access_token issued at registration time. Returns 204 No Content on success. + +### Example + +```java +public static void callDeleteDynamicClient(LoginRadiusClient client) { + String oiDCAppName = "<oiDCAppName>"; //Required + String clientID = "<clientID>"; //Required + + try { + var response = client.oidc.deleteDynamicClient(oiDCAppName, clientID); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `OIDCAppName` | path | string | yes | OIDC App Name | +| `clientID` | path | string | yes | The client_id of the dynamically registered OAuth client. | + +--- + +## `getDynamicClient` + +**GET** `/api/oidc/{OIDCAppName}/register/{clientID}` + +Get a Dynamic Client + +Retrieves the metadata of a dynamically registered OAuth 2.0/OIDC client per RFC 7592 (OAuth 2.0 Dynamic Client Registration Management Protocol). Requires the registration_access_token issued at registration time. + +### Example + +```java +public static void callGetDynamicClient(LoginRadiusClient client) { + String oiDCAppName = "<oiDCAppName>"; //Required + String clientID = "<clientID>"; //Required + + try { + var response = client.oidc.getDynamicClient(oiDCAppName, clientID); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `OIDCAppName` | path | string | yes | OIDC App Name | +| `clientID` | path | string | yes | The client_id of the dynamically registered OAuth client. | + +### Returns + +`OAuthDynamicClientResponse` + +--- + +## `getOAuthAuthorizationServerMetadataOIDC` + +**GET** `/service/oidc/{OIDCAppName}/.well-known/oauth-authorization-server` + +OAuth Authorization Server Metadata (OIDC app) + +Returns OAuth 2.0 Authorization Server Metadata (RFC 8414) for the given OIDC app. +Use this endpoint for OAuth 2.0 client discovery when using the OIDC flow path. +Response does not include OpenID Connect-specific fields (e.g. userinfo_endpoint, claims_supported). + +### Example + +```java +public static void callGetOAuthAuthorizationServerMetadataOIDC(LoginRadiusClient client) { + String oiDCAppName = "<oiDCAppName>"; //Required + + try { + var response = client.oidc.getOAuthAuthorizationServerMetadataOIDC(oiDCAppName); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `OIDCAppName` | path | string | yes | OIDC App Name | + +### Returns + +`OAuthAuthorizationServerMetadata` + +--- + +## `getOIDCDeviceCode` + +**POST** `/api/oidc/{OIDCAppName}/device` + +Retrieve OIDC device code + +Initiates the OAuth 2.0 Device Authorization Grant per RFC 8628. Returns a device_code and user_code that the client displays to the end-user for out-of-band authorization on a secondary device. The client then polls the token endpoint with the device_code until the user completes authorization. + +### Example + +```java +public static void callGetOIDCDeviceCode(LoginRadiusClient client) { + String oiDCAppName = "<oiDCAppName>"; //Required + OIDCDeviceCode oiDCDeviceCode = new OIDCDeviceCode().client_id("<client_id>"); //Required + + try { + var response = client.oidc.getOIDCDeviceCode(oiDCAppName, oiDCDeviceCode); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `OIDCAppName` | path | string | yes | OIDC App Name | + +### Request body + +`OIDCDeviceCode` as `application/json`. + +### Returns + +`OIDCDeviceCodeResponse` + +--- + +## `getOIDCDiscoveryConfig` + +**GET** `/service/oidc/{OIDCAppName}/.well-known/openid-configuration` + +OpenID Connect Discovery endpoint + +Returns the OpenID Provider Configuration Information per OpenID Connect Discovery 1.0 (Section 4). Clients use this endpoint to dynamically discover the issuer, supported endpoints, scopes, response types, claims, and signing algorithms. The response includes the authorization_endpoint, token_endpoint, userinfo_endpoint, jwks_uri, and other metadata needed to configure an OIDC Relying Party. + +### Example + +```java +public static void callGetOIDCDiscoveryConfig(LoginRadiusClient client) { + String oiDCAppName = "<oiDCAppName>"; //Required + + try { + var response = client.oidc.getOIDCDiscoveryConfig(oiDCAppName); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `OIDCAppName` | path | string | yes | OIDC App Name | + +### Returns + +`OIDCDiscoveryResponse` + +--- + +## `getOIDCJWKSConfig` + +**GET** `/service/oidc/{OIDCAppName}/jwks` + +Retrieve JSON Web Key Set + +Retrieves the JSON Web Key Set (JWKS) for verifying token signatures. + +### Example + +```java +public static void callGetOIDCJWKSConfig(LoginRadiusClient client) { + String oiDCAppName = "<oiDCAppName>"; //Required + + try { + var response = client.oidc.getOIDCJWKSConfig(oiDCAppName); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `OIDCAppName` | path | string | yes | OIDC App Name | + +### Returns + +`JWKSResponse` + +--- + +## `getOIDCTokens` + +**POST** `/api/oidc/{OIDCAppName}/token` + +Retrieve OIDC tokens + +Retrieves OpenID Connect (OIDC) tokens for User authentication. + +### Example + +```java +public static void callGetOIDCTokens(LoginRadiusClient client) { + String oiDCAppName = "<oiDCAppName>"; //Required + GetOAuthTokensRequest getOAuthTokensRequest = new GetOAuthTokensRequest(); //Required + + try { + var response = client.oidc.getOIDCTokens(oiDCAppName, getOAuthTokensRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `OIDCAppName` | path | string | yes | OIDC App Name | + +### Request body + +`object` as `application/json`. + +### Returns + +`OIDCTokenResponse` + +--- + +## `getOIDCUserinfo` + +**GET** `/service/oidc/{OIDCAppName}/userinfo` + +Retrieve OIDC User info + +Retrieves User information using OpenID Connect (OIDC) standards. + +### Example + +```java +public static void callGetOIDCUserinfo(LoginRadiusClient client) { + String oiDCAppName = "<oiDCAppName>"; //Required + + try { + var response = client.oidc.getOIDCUserinfo(oiDCAppName); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `OIDCAppName` | path | string | yes | OIDC App Name | + +### Returns + +`OIDCUserinfoResponse` + +--- + +## `getOIDCUserinfoByPost` + +**POST** `/service/oidc/{OIDCAppName}/userinfo` + +Retrieve OIDC User info via POST + +Retrieves User information using OpenID Connect (OIDC) standards via the POST method. + +### Example + +```java +public static void callGetOIDCUserinfoByPost(LoginRadiusClient client) { + String oiDCAppName = "<oiDCAppName>"; //Required + OIDCUserinfo oiDCUserinfo = new OIDCUserinfo().access_token("<access_token>"); //Required + + try { + var response = client.oidc.getOIDCUserinfoByPost(oiDCAppName, oiDCUserinfo); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `OIDCAppName` | path | string | yes | OIDC App Name | + +### Request body + +`OIDCUserinfo` as `application/json`. + +### Returns + +`OIDCUserinfoResponse` + +--- + +## `introspectOIDCToken` + +**POST** `/api/oidc/{OIDCAppName}/introspect` + +Introspect OIDC token + +Returns the active state and metadata of an OIDC access or refresh token per RFC 7662 (OAuth 2.0 Token Introspection). The client must authenticate using either HTTP Basic authentication (Authorization: Basic base64(client_id:client_secret)) or by including client_id and client_secret in the POST body, depending on the token_endpoint_auth_method configured for the OIDC application. Returns active: true with associated claims for valid tokens, or active: false for invalid, expired, or revoked tokens. + +### Example + +```java +public static void callIntrospectOIDCToken(LoginRadiusClient client) { + String oiDCAppName = "<oiDCAppName>"; //Required + OAuthRevokeRefreshToken oauthRevokeRefreshToken = new OAuthRevokeRefreshToken().client_id("<client_id>").client_secret("<client_secret>").token("<token>"); //Required + + try { + var response = client.oidc.introspectOIDCToken(oiDCAppName, oauthRevokeRefreshToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `OIDCAppName` | path | string | yes | OIDC App Name | + +### Request body + +`OAuthRevokeRefreshToken` as `application/json`. + +### Returns + +`OIDCTokenIntrospectResponse` + +--- + +## `oIDCDynamicClientRegistration` + +**POST** `/api/oidc/{OIDCAppName}/register` + +OIDC dynamic client registration + +Registers a new OAuth 2.0/OIDC client dynamically per RFC 7591 (OAuth 2.0 Dynamic Client Registration Protocol). The client submits desired metadata (redirect_uris, client_name, grant_types, etc.) and receives the registered client metadata including the assigned client_id and client_secret. This feature must be explicitly enabled on the OIDC application configuration. + +### Example + +```java +public static void callOIDCDynamicClientRegistration(LoginRadiusClient client) { + String oiDCAppName = "<oiDCAppName>"; //Required + DynamicClientRegistrationRequest dynamicClientRegistrationRequest = new DynamicClientRegistrationRequest().redirect_uris("<redirect_uris>").client_name("<client_name>").client_uri("<client_uri>"); //Required + + try { + var response = client.oidc.oIDCDynamicClientRegistration(oiDCAppName, dynamicClientRegistrationRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `OIDCAppName` | path | string | yes | OIDC App Name | + +### Request body + +`DynamicClientRegistrationRequest` as `application/json`. + +### Returns + +`DynamicClientRegistrationResponse` + +--- + +## `oIDCPushedAuthorizationRequest` + +**POST** `/api/oidc/{OIDCAppName}/par` + +OIDC Pushed Authorization Request (PAR) + +Accepts an OIDC authorization request and stores it server-side per RFC 9126 (OAuth 2.0 Pushed Authorization Requests). Returns a short-lived request_uri that the client passes as the sole parameter to the authorization endpoint, keeping all sensitive request parameters out of the browser URL. This feature must be explicitly enabled on the OIDC application configuration. + +### Example + +```java +public static void callOIDCPushedAuthorizationRequest(LoginRadiusClient client) { + String oiDCAppName = "<oiDCAppName>"; //Required + PARRequest paRRequest = new PARRequest().client_id("<client_id>").redirect_uri("<redirect_uri>").response_type("<response_type>").scope("<scope>"); //Required + + try { + var response = client.oidc.oIDCPushedAuthorizationRequest(oiDCAppName, paRRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `OIDCAppName` | path | string | yes | OIDC App Name | + +### Request body + +`PARRequest` as `application/json`. + +### Returns + +`PARResponse` + +--- + +## `revokeOIDCRefreshToken` + +**POST** `/api/oidc/{OIDCAppName}/revoke` + +Revoke OIDC refresh token + +Revokes an OIDC refresh token per RFC 7009 (OAuth 2.0 Token Revocation), invalidating it and preventing any further use. The client must authenticate using client_id and client_secret via HTTP Basic or POST body. + +### Example + +```java +public static void callRevokeOIDCRefreshToken(LoginRadiusClient client) { + String oiDCAppName = "<oiDCAppName>"; //Required + OAuthRevokeRefreshToken oauthRevokeRefreshToken = new OAuthRevokeRefreshToken().client_id("<client_id>").client_secret("<client_secret>").token("<token>"); //Required + + try { + var response = client.oidc.revokeOIDCRefreshToken(oiDCAppName, oauthRevokeRefreshToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `OIDCAppName` | path | string | yes | OIDC App Name | + +### Request body + +`OAuthRevokeRefreshToken` as `application/json`. + +--- + +## `updateDynamicClient` + +**PUT** `/api/oidc/{OIDCAppName}/register/{clientID}` + +Update a Dynamic Client + +Updates the metadata of a dynamically registered OAuth 2.0/OIDC client per RFC 7592. Requires the registration_access_token issued at registration time. + +### Example + +```java +public static void callUpdateDynamicClient(LoginRadiusClient client) { + String oiDCAppName = "<oiDCAppName>"; //Required + String clientID = "<clientID>"; //Required + OAuthDynamicClientRequest oauthDynamicClientRequest = new OAuthDynamicClientRequest().client_name("<client_name>").redirect_uris("<redirect_uris>"); //Required + + try { + var response = client.oidc.updateDynamicClient(oiDCAppName, clientID, oauthDynamicClientRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `OIDCAppName` | path | string | yes | OIDC App Name | +| `clientID` | path | string | yes | The client_id of the dynamically registered OAuth client. | + +### Request body + +`OAuthDynamicClientRequest` as `application/json`. + +### Returns + +`OAuthDynamicClientResponse` + diff --git a/docs/apis/organization-connection-group-roles.md b/docs/apis/organization-connection-group-roles.md new file mode 100644 index 0000000..ddb84fa --- /dev/null +++ b/docs/apis/organization-connection-group-roles.md @@ -0,0 +1,177 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Organization Connection Group Roles + +4 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `createConnectionGroupRole` + +**POST** `/v2/manage/organizations/{orgId}/connections/{connId}/grouproles` + +Create Organization connection group Role + +Creates a new group-to-role mapping for an Identity Provider connection. + +### Example + +```java +public static void callCreateConnectionGroupRole(LoginRadiusClient client) { + String connId = "<connId>"; //Required + String orgId = "<orgId>"; //Required + CreateConnectionGroupRoleRequest createConnectionGroupRoleRequest = new CreateConnectionGroupRoleRequest().groupId("<groupId>").name("<name>").roleId("<roleId>"); //Required + + try { + var response = client.organizationConnectionGroupRoles.createConnectionGroupRole(connId, orgId, createConnectionGroupRoleRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `connId` | path | string | yes | Organization Connection ID | +| `orgId` | path | string | yes | Organization ID | + +### Request body + +`object` as `application/json`. + +### Returns + +`ConnectionGroupRoleResponse` + +--- + +## `deleteConnectionGroupRole` + +**DELETE** `/v2/manage/organizations/{orgId}/connections/{connId}/grouproles/{groupRoleId}` + +Delete Organization connection group Role + +Deletes a specific group-to-role mapping. + +### Example + +```java +public static void callDeleteConnectionGroupRole(LoginRadiusClient client) { + String orgId = "<orgId>"; //Required + String connId = "<connId>"; //Required + String groupRoleId = "<groupRoleId>"; //Required + + try { + var response = client.organizationConnectionGroupRoles.deleteConnectionGroupRole(orgId, connId, groupRoleId); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `orgId` | path | string | yes | Organization ID | +| `connId` | path | string | yes | Organization Connection ID | +| `groupRoleId` | path | string | yes | Organization Connection Group Role ID | + +### Returns + +`DeleteResponse` + +--- + +## `getAllConnectionGroupRoles` + +**GET** `/v2/manage/organizations/{orgId}/connections/{connId}/grouproles` + +List Organization connection group Roles + +Lists all group-to-role mappings for an Identity Provider connection. + +### Example + +```java +public static void callGetAllConnectionGroupRoles(LoginRadiusClient client) { + String orgId = "<orgId>"; //Required + String connId = "<connId>"; //Required + + try { + var response = client.organizationConnectionGroupRoles.getAllConnectionGroupRoles(orgId, connId); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `orgId` | path | string | yes | Organization ID | +| `connId` | path | string | yes | Organization Connection ID | + +### Returns + +`object` + +--- + +## `updateConnectionGroupRole` + +**PUT** `/v2/manage/organizations/{orgId}/connections/{connId}/grouproles/{groupRoleId}` + +Update Organization connection group Role + +Updates a specific group-to-role mapping. + +### Example + +```java +public static void callUpdateConnectionGroupRole(LoginRadiusClient client) { + String connId = "<connId>"; //Required + String groupRoleId = "<groupRoleId>"; //Required + String orgId = "<orgId>"; //Required + ConnectionGroupRoleRequest connectionGroupRoleRequest = new ConnectionGroupRoleRequest().groupId("<groupId>").name("<name>").roleId("<roleId>"); //Required + + try { + var response = client.organizationConnectionGroupRoles.updateConnectionGroupRole(connId, groupRoleId, orgId, connectionGroupRoleRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `connId` | path | string | yes | Organization Connection ID | +| `groupRoleId` | path | string | yes | Organization Connection Group Role ID | +| `orgId` | path | string | yes | Organization ID | + +### Request body + +`ConnectionGroupRoleRequest` as `application/json`. + +### Returns + +`ConnectionGroupRoleResponse` + diff --git a/docs/apis/organization-connections.md b/docs/apis/organization-connections.md new file mode 100644 index 0000000..c1940e1 --- /dev/null +++ b/docs/apis/organization-connections.md @@ -0,0 +1,250 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Organization Connections + +6 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `createOrganizationConnection` + +**POST** `/v2/manage/organizations/{orgId}/connections` + +Create Organization connection + +Creates a new Identity Provider connection for an Organization. + +### Example + +```java +public static void callCreateOrganizationConnection(LoginRadiusClient client) { + String orgId = "<orgId>"; //Required + OrganizationConnectionCreateRequest organizationConnectionCreateRequest = new OrganizationConnectionCreateRequest(); //Required + + try { + var response = client.organizationConnections.createOrganizationConnection(orgId, organizationConnectionCreateRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `orgId` | path | string | yes | Organization ID | + +### Request body + +`OrganizationConnectionCreateRequest` as `application/json`. + +### Returns + +`ConnectionResponse` + +--- + +## `deleteOrganizationConnection` + +**DELETE** `/v2/manage/organizations/{orgId}/connections/{connId}` + +Delete Organization connection + +Deletes an Identity Provider connection from an Organization. + +### Example + +```java +public static void callDeleteOrganizationConnection(LoginRadiusClient client) { + String orgId = "<orgId>"; //Required + String connId = "<connId>"; //Required + + try { + var response = client.organizationConnections.deleteOrganizationConnection(orgId, connId); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `orgId` | path | string | yes | Organization ID | +| `connId` | path | string | yes | Organization Connection ID | + +### Returns + +`DeleteResponse` + +--- + +## `getAllOrganizationConnections` + +**GET** `/v2/manage/organizations/{orgId}/connections` + +List Organization connections + +Lists all Identity Provider connections for an Organization. + +### Example + +```java +public static void callGetAllOrganizationConnections(LoginRadiusClient client) { + String orgId = "<orgId>"; //Required + + try { + var response = client.organizationConnections.getAllOrganizationConnections(orgId); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `orgId` | path | string | yes | Organization ID | + +### Returns + +`object` + +--- + +## `getOrganizationConnection` + +**GET** `/v2/manage/organizations/{orgId}/connections/{connId}` + +Retrieve Organization connection + +Retrieves details of a specific Identity Provider connection. + +### Example + +```java +public static void callGetOrganizationConnection(LoginRadiusClient client) { + String orgId = "<orgId>"; //Required + String connId = "<connId>"; //Required + + try { + var response = client.organizationConnections.getOrganizationConnection(orgId, connId); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `orgId` | path | string | yes | Organization ID | +| `connId` | path | string | yes | Organization Connection ID | + +### Returns + +`ConnectionResponse` + +--- + +## `updateConnectionStatus` + +**PUT** `/v2/manage/organizations/{orgId}/connections/{connId}/status` + +Update Organization connection status + +Updates the active status of an Identity Provider connection. + +### Example + +```java +public static void callUpdateConnectionStatus(LoginRadiusClient client) { + String orgId = "<orgId>"; //Required + String connId = "<connId>"; //Required + ConnectionStatusRequest connectionStatusRequest = new ConnectionStatusRequest().active(true); //Required + + try { + var response = client.organizationConnections.updateConnectionStatus(orgId, connId, connectionStatusRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `orgId` | path | string | yes | Organization ID | +| `connId` | path | string | yes | Organization Connection ID | + +### Request body + +`ConnectionStatusRequest` as `application/json`. + +### Returns + +`ConnectionStatusResponse` + +--- + +## `updateOrganizationConnection` + +**PUT** `/v2/manage/organizations/{orgId}/connections/{connId}` + +Update Organization connection + +Updates the configuration of an Identity Provider connection. + +### Example + +```java +public static void callUpdateOrganizationConnection(LoginRadiusClient client) { + String orgId = "<orgId>"; //Required + String connId = "<connId>"; //Required + OrganizationConnectionRequest organizationConnectionRequest = new OrganizationConnectionRequest(); //Required + + try { + var response = client.organizationConnections.updateOrganizationConnection(orgId, connId, organizationConnectionRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `orgId` | path | string | yes | Organization ID | +| `connId` | path | string | yes | Organization Connection ID | + +### Request body + +`OrganizationConnectionRequest` as `application/json`. + +### Returns + +`ConnectionResponse` + diff --git a/docs/apis/organization-domains.md b/docs/apis/organization-domains.md new file mode 100644 index 0000000..24d3715 --- /dev/null +++ b/docs/apis/organization-domains.md @@ -0,0 +1,202 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Organization Domains + +5 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `addOrganizationDomain` + +**POST** `/v2/manage/organizations/{orgId}/domains` + +Add Organization domain + +Adds a new domain to an Organization. + +### Example + +```java +public static void callAddOrganizationDomain(LoginRadiusClient client) { + String orgId = "<orgId>"; //Required + AddOrganizationDomainRequest addOrganizationDomainRequest = new AddOrganizationDomainRequest().domainName("<domainName>"); //Required + + try { + var response = client.organizationDomains.addOrganizationDomain(orgId, addOrganizationDomainRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `orgId` | path | string | yes | Organization ID | + +### Request body + +`object` as `application/json`. + +### Returns + +`OrganizationsDomainsResponse` + +--- + +## `deleteOrganizationDomain` + +**DELETE** `/v2/manage/organizations/{orgId}/domains/{domainId}` + +Delete Organization domain + +Deletes a domain from an Organization. + +### Example + +```java +public static void callDeleteOrganizationDomain(LoginRadiusClient client) { + String orgId = "<orgId>"; //Required + String domainId = "<domainId>"; //Required + + try { + var response = client.organizationDomains.deleteOrganizationDomain(orgId, domainId); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `orgId` | path | string | yes | Organization ID | +| `domainId` | path | string | yes | Organization Domain ID | + +### Returns + +`DeleteResponse` + +--- + +## `getAllOrganizationDomains` + +**GET** `/v2/manage/organizations/{orgId}/domains` + +List Organization domains + +Lists all domains associated with an Organization. + +### Example + +```java +public static void callGetAllOrganizationDomains(LoginRadiusClient client) { + String orgId = "<orgId>"; //Required + + try { + var response = client.organizationDomains.getAllOrganizationDomains(orgId); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `orgId` | path | string | yes | Organization ID | + +### Returns + +`object` + +--- + +## `getOrganizationDomain` + +**GET** `/v2/manage/organizations/{orgId}/domains/{domainId}` + +Retrieve Organization domain + +Retrieves details of a specific Organization domain. + +### Example + +```java +public static void callGetOrganizationDomain(LoginRadiusClient client) { + String orgId = "<orgId>"; //Required + String domainId = "<domainId>"; //Required + + try { + var response = client.organizationDomains.getOrganizationDomain(orgId, domainId); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `orgId` | path | string | yes | Organization ID | +| `domainId` | path | string | yes | Organization Domain ID | + +### Returns + +`OrganizationsDomainsResponse` + +--- + +## `verifyOrganizationDomain` + +**POST** `/v2/manage/organizations/{orgId}/domains/{domainId}` + +Verify Organization domain + +Verifies the ownership of an Organization domain. + +### Example + +```java +public static void callVerifyOrganizationDomain(LoginRadiusClient client) { + String domainId = "<domainId>"; //Required + String orgId = "<orgId>"; //Required + + try { + var response = client.organizationDomains.verifyOrganizationDomain(domainId, orgId); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `domainId` | path | string | yes | Organization Domain ID | +| `orgId` | path | string | yes | Organization ID | + +### Returns + +`OrganizationsDomainsResponse` + diff --git a/docs/apis/organization-invitations.md b/docs/apis/organization-invitations.md new file mode 100644 index 0000000..0d6dc6f --- /dev/null +++ b/docs/apis/organization-invitations.md @@ -0,0 +1,203 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Organization Invitations + +5 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `deleteInvitationByInvitationId` + +**DELETE** `/v2/manage/invitations/{invitationid}` + +Delete invitation by ID + +Deletes or revokes an invitation by invitation ID. + +### Example + +```java +public static void callDeleteInvitationByInvitationId(LoginRadiusClient client) { + String invitationid = "<invitationid>"; //Required + + try { + var response = client.organizationInvitations.deleteInvitationByInvitationId(invitationid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `invitationid` | path | string | yes | The ID of the invitation. The ID is typically in the format *inv_<unique_id>*, where *<unique_id>* is a string of alphanumeric characters. | + +### Returns + +`Invitation` + +--- + +## `getInvitationsByOrgId` + +**GET** `/v2/manage/invitations` + +List invitations by Organization ID + +Lists all invitations by Organization ID. + +### Example + +```java +public static void callGetInvitationsByOrgId(LoginRadiusClient client) { + String orgid = "<orgid>"; //Required + + try { + var response = client.organizationInvitations.getInvitationsByOrgId(orgid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `orgid` | query | string | yes | | + +### Returns + +`object` + +--- + +## `resendInvitationByInvitationId` + +**POST** `/v2/manage/invitations/{invitationid}/resend` + +Resend invitation by ID + +Resends an invitation by invitation ID. + +### Example + +```java +public static void callResendInvitationByInvitationId(LoginRadiusClient client) { + String invitationid = "<invitationid>"; //Required + + try { + var response = client.organizationInvitations.resendInvitationByInvitationId(invitationid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `invitationid` | path | string | yes | The ID of the invitation. The ID is typically in the format *inv_<unique_id>*, where *<unique_id>* is a string of alphanumeric characters. | + +### Returns + +`ResendInvitation` + +--- + +## `sendInvitation` + +**POST** `/v2/manage/invitations` + +Send invitation + +Sends a new invitation. + +### Example + +```java +public static void callSendInvitation(LoginRadiusClient client) { + SendInvitation sendInvitation = new SendInvitation().email("<email>").roleIds("<roleIds>").orgId("<orgId>").inviterUid("<inviterUid>"); //Required + String invitationUrl = "<invitationUrl>"; //Optional + + try { + var response = client.organizationInvitations.sendInvitation(sendInvitation, invitationUrl); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `invitation_url` | query | string | no | The URL to which the User will be redirected after accepting the invitation. This URL should be a valid URL and can include query parameters if needed. | + +### Request body + +`SendInvitation` as `application/json`. + +### Returns + +`Invitation` + +--- + +## `updateInvitationByInvitationId` + +**PUT** `/v2/manage/invitations/{invitationid}` + +Update invitation by ID + +Updates invitation details by invitation ID. + +### Example + +```java +public static void callUpdateInvitationByInvitationId(LoginRadiusClient client) { + String invitationid = "<invitationid>"; //Required + UpdateInvitationByInvitationIdRequest updateInvitationByInvitationIdRequest = new UpdateInvitationByInvitationIdRequest().rolesIds("<rolesIds>").resendEmail(true); //Required + String invitationUrl = "<invitationUrl>"; //Optional + + try { + var response = client.organizationInvitations.updateInvitationByInvitationId(invitationid, updateInvitationByInvitationIdRequest, invitationUrl); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `invitationid` | path | string | yes | The ID of the invitation. The ID is typically in the format *inv_<unique_id>*, where *<unique_id>* is a string of alphanumeric characters. | +| `invitation_url` | query | string | no | The URL to which the User will be redirected after accepting the invitation. This URL should be a valid URL and can include query parameters if needed. | + +### Request body + +`object` as `application/json`. + +### Returns + +`Invitation` + diff --git a/docs/apis/organization-user-roles.md b/docs/apis/organization-user-roles.md new file mode 100644 index 0000000..fbb1ebc --- /dev/null +++ b/docs/apis/organization-user-roles.md @@ -0,0 +1,238 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Organization User Roles + +6 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `assignRolesToUser` + +**PUT** `/v2/manage/account/{uid}/orgcontext/{orgId}/roles` + +Assign Roles in Organization + +Assigns Roles to a User within a specific Organization. + +### Example + +```java +public static void callAssignRolesToUser(LoginRadiusClient client) { + String uid = "<uid>"; //Required + String orgId = "<orgId>"; //Required + UserRolePutRequest userRolePutRequest = new UserRolePutRequest().roleIds("<roleIds>"); //Required + + try { + var response = client.organizationUserRoles.assignRolesToUser(uid, orgId, userRolePutRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | path | string | yes | UID of the User | +| `orgId` | path | string | yes | Organization ID | + +### Request body + +`UserRolePutRequest` as `application/json`. + +### Returns + +`object` + +--- + +## `assignRolesToUserInAllOrgs` + +**PUT** `/v2/manage/account/{uid}/orgcontext/roles` + +Assign Roles in Tenant + +Assigns Roles to a User within a Tenant. + +### Example + +```java +public static void callAssignRolesToUserInAllOrgs(LoginRadiusClient client) { + String uid = "<uid>"; //Required + + try { + var response = client.organizationUserRoles.assignRolesToUserInAllOrgs(uid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | path | string | yes | UID of the User | + +### Returns + +`object` + +--- + +## `deleteOrgContextByUid` + +**DELETE** `/v2/manage/account/{uid}/orgcontext` + +Delete Organization context by UID + +Deletes User Roles for all Organizations by UID. + +### Example + +```java +public static void callDeleteOrgContextByUid(LoginRadiusClient client) { + String uid = "<uid>"; //Required + + try { + var response = client.organizationUserRoles.deleteOrgContextByUid(uid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | path | string | yes | UID of the User | + +### Returns + +`DeleteResponse` + +--- + +## `deleteOrgContextByUidAndOrgId` + +**DELETE** `/v2/manage/account/{uid}/orgcontext/{orgId}` + +Delete Organization Roles by OrgID and UID + +Deletes User Roles of an Organization by UID and OrgID. + +### Example + +```java +public static void callDeleteOrgContextByUidAndOrgId(LoginRadiusClient client) { + String uid = "<uid>"; //Required + String orgId = "<orgId>"; //Required + + try { + var response = client.organizationUserRoles.deleteOrgContextByUidAndOrgId(uid, orgId); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | path | string | yes | UID of the User | +| `orgId` | path | string | yes | Organization ID | + +### Returns + +`DeleteResponse` + +--- + +## `getOrgContextByUid` + +**GET** `/v2/manage/account/{uid}/orgcontext` + +Retrieve Organization context by UID + +Retrieves User Roles for all Organizations by UID. + +### Example + +```java +public static void callGetOrgContextByUid(LoginRadiusClient client) { + String uid = "<uid>"; //Required + + try { + var response = client.organizationUserRoles.getOrgContextByUid(uid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | path | string | yes | UID of the User | + +### Returns + +`object` + +--- + +## `getOrgContextByUidAndOrgId` + +**GET** `/v2/manage/account/{uid}/orgcontext/{orgId}` + +Retrieve Organization Roles by OrgID and UID + +Retrieves User Roles of an Organization by UID and OrgID. + +### Example + +```java +public static void callGetOrgContextByUidAndOrgId(LoginRadiusClient client) { + String uid = "<uid>"; //Required + String orgId = "<orgId>"; //Required + + try { + var response = client.organizationUserRoles.getOrgContextByUidAndOrgId(uid, orgId); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | path | string | yes | UID of the User | +| `orgId` | path | string | yes | Organization ID | + +### Returns + +`object` + diff --git a/docs/apis/organization.md b/docs/apis/organization.md new file mode 100644 index 0000000..31b9055 --- /dev/null +++ b/docs/apis/organization.md @@ -0,0 +1,299 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Organization + +8 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `createOrganization` + +**POST** `/v2/manage/organizations` + +Create Organization + +Creates a new Organization in the Tenant. + +### Example + +```java +public static void callCreateOrganization(LoginRadiusClient client) { + CreateOrganizationRequest createOrganizationRequest = new CreateOrganizationRequest().name("<name>"); //Required + + try { + var response = client.organization.createOrganization(createOrganizationRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`object` as `application/json`. + +### Returns + +`OrganizationsResponse` + +--- + +## `createOrgTenantRole` + +**POST** `/v2/manage/organizations/{orgId}/roles` + +Create Role in Organization + +Creates a Role within an Organization. + +### Example + +```java +public static void callCreateOrgTenantRole(LoginRadiusClient client) { + String orgId = "<orgId>"; //Required + RolePostRequest rolePostRequest = new RolePostRequest().name("<name>"); //Required + + try { + var response = client.organization.createOrgTenantRole(orgId, rolePostRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `orgId` | path | string | yes | Organization ID | + +### Request body + +`RolePostRequest` as `application/json`. + +### Returns + +`Role` + +--- + +## `deleteOrganization` + +**DELETE** `/v2/manage/organizations/{orgId}` + +Delete Organization + +Deletes an Organization by its ID. + +### Example + +```java +public static void callDeleteOrganization(LoginRadiusClient client) { + String orgId = "<orgId>"; //Required + + try { + var response = client.organization.deleteOrganization(orgId); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `orgId` | path | string | yes | Organization ID | + +### Returns + +`DeleteResponse` + +--- + +## `getAllOrganizations` + +**GET** `/v2/manage/organizations` + +List Organizations + +Retrieves a list of all Organizations in the Tenant. + +### Example + +```java +public static void callGetAllOrganizations(LoginRadiusClient client) { + try { + var response = client.organization.getAllOrganizations(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`object` + +--- + +## `getOrganization` + +**GET** `/v2/manage/organizations/{orgId}` + +Retrieve Organization details + +Retrieves details of a specific Organization by its ID. + +### Example + +```java +public static void callGetOrganization(LoginRadiusClient client) { + String orgId = "<orgId>"; //Required + + try { + var response = client.organization.getOrganization(orgId); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `orgId` | path | string | yes | Organization ID | + +### Returns + +`OrganizationsResponse` + +--- + +## `getOrgContextByOrgId` + +**GET** `/v2/manage/organizations/{orgId}/orgcontext` + +Retrieve Organization context + +Retrieves User Roles for all Organizations by OrgID. + +### Example + +```java +public static void callGetOrgContextByOrgId(LoginRadiusClient client) { + String orgId = "<orgId>"; //Required + + try { + var response = client.organization.getOrgContextByOrgId(orgId); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `orgId` | path | string | yes | Unique identifier of the Organization. | + +### Returns + +`object` + +--- + +## `getOrgRolesByOrgId` + +**GET** `/v2/manage/organizations/{orgId}/roles` + +List Organization Roles + +Lists all Roles defined within an Organization. + +### Example + +```java +public static void callGetOrgRolesByOrgId(LoginRadiusClient client) { + String orgId = "<orgId>"; //Required + + try { + var response = client.organization.getOrgRolesByOrgId(orgId); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `orgId` | path | string | yes | Organization ID | + +### Returns + +`object` + +--- + +## `updateOrganization` + +**PUT** `/v2/manage/organizations/{orgId}` + +Update Organization + +Updates an Organization by its ID. Supports updating org fields, policies, and status in a single request. + +### Example + +```java +public static void callUpdateOrganization(LoginRadiusClient client) { + String orgId = "<orgId>"; //Required + OrganizationUpdateRequest organizationUpdateRequest = new OrganizationUpdateRequest().name("<name>").display("<display>").metadata("<metadata>"); //Required + + try { + var response = client.organization.updateOrganization(orgId, organizationUpdateRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `orgId` | path | string | yes | Organization ID | + +### Request body + +`OrganizationUpdateRequest` as `application/json`. + +### Returns + +`OrganizationsResponse` + diff --git a/docs/apis/passkey-configuration.md b/docs/apis/passkey-configuration.md new file mode 100644 index 0000000..bee750e --- /dev/null +++ b/docs/apis/passkey-configuration.md @@ -0,0 +1,73 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Passkey Configuration + +2 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `getPassKeyConfig` + +**GET** `/v2/manage/passkey` + +Retrieve Passkey configuration + +Retrieves the current Passkey configuration settings for the Tenant. + +### Example + +```java +public static void callGetPassKeyConfig(LoginRadiusClient client) { + try { + var response = client.passkeyConfiguration.getPassKeyConfig(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`PassKeyConfig` + +--- + +## `upsertPassKeyConfig` + +**PUT** `/v2/manage/passkey` + +Update Passkey configuration + +Creates or updates the Passkey configuration settings for the Tenant. + +### Example + +```java +public static void callUpsertPassKeyConfig(LoginRadiusClient client) { + PassKeyConfig passKeyConfig = new PassKeyConfig().isEnabled(true).passkeySelection("<passkeySelection>").localEnrollment(true).RPDisplayName("<RPDisplayName>").RPID("<RPID>").RPOrigins("<RPOrigins>"); //Required + + try { + var response = client.passkeyConfiguration.upsertPassKeyConfig(passKeyConfig); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`PassKeyConfig` as `application/json`. + +### Returns + +`PassKeyConfig` + diff --git a/docs/apis/password-policy.md b/docs/apis/password-policy.md new file mode 100644 index 0000000..2e0acda --- /dev/null +++ b/docs/apis/password-policy.md @@ -0,0 +1,73 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Password Policy + +2 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `getPasswordPolicy` + +**GET** `/v2/manage/password-policies` + +Retrieve Password policy + +Retrieves the Password policy settings for a specific Tenant. + +### Example + +```java +public static void callGetPasswordPolicy(LoginRadiusClient client) { + try { + var response = client.passwordPolicy.getPasswordPolicy(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`PasswordPolicy` + +--- + +## `updatePasswordPolicy` + +**PUT** `/v2/manage/password-policies` + +Update Password policy + +Updates the Password policy settings for a specific Tenant. + +### Example + +```java +public static void callUpdatePasswordPolicy(LoginRadiusClient client) { + PasswordPolicy passwordPolicy = new PasswordPolicy().dictionaryPasswordValidation(true).profileDataPasswordValidation(true).profileDataPasswordExactMatch(true); //Required + + try { + var response = client.passwordPolicy.updatePasswordPolicy(passwordPolicy); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`PasswordPolicy` as `application/json`. + +### Returns + +`PasswordPolicy` + diff --git a/docs/apis/password.md b/docs/apis/password.md new file mode 100644 index 0000000..fb2fe4d --- /dev/null +++ b/docs/apis/password.md @@ -0,0 +1,378 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Password + +7 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `changePassword` + +**PUT** `/identity/v2/auth/password/change` + +Update Password + +Updates the Account Password using the current Password for verification. + +### Example + +```java +public static void callChangePassword(LoginRadiusClient client) { + ChangePassword changePassword = new ChangePassword().oldPassword("<oldPassword>").newPassword("<newPassword>"); //Required + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String gRecaptchaResponse2 = "<gRecaptchaResponse2>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Required + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Required + String accessToken = "<accessToken>"; //Optional + + try { + var response = client.password.changePassword(changePassword, gRecaptchaResponse, gRecaptchaResponse2, preventWebhook, xPreventWebhook, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, accessToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `g_recaptcha_response` | query | string | no | Google reCAPTCHA Response | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `h-captcha-response` | query | string | no | hCaptcha Response | +| `qq_captcha_ticket` | query | string | no | QQ Captcha ticket (required if Bot Protection is enabled) | +| `qq_captcha_randstr` | query | string | no | QQ Captcha rand string (required if Bot Protection is enabled) | +| `access_token` | query | string | no | Access Token of the User | + +### Request body + +`changePassword` as `application/json`. + +### Returns + +`IsPostedResponse` + +--- + +## `forgotPassword` + +**POST** `/identity/v2/auth/password` + +Forgot Password + +Initiates the Password recovery process using Username or Email. + +### Example + +```java +public static void callForgotPassword(LoginRadiusClient client) { + String emailtemplate = "<emailtemplate>"; //Optional + String resetpasswordurl = "<resetpasswordurl>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String gRecaptchaResponse2 = "<gRecaptchaResponse2>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Optional + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Optional + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + ForgotPasswordRequest forgotPasswordRequest = new ForgotPasswordRequest().email("<email>").userName("<userName>").g-recaptcha-response("<g-recaptcha-response>"); //Optional + + try { + var response = client.password.forgotPassword(emailtemplate, resetpasswordurl, preventWebhook, xPreventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, forgotPasswordRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `emailtemplate` | query | string | no | Name of the Email template to use for this notification. | +| `resetpasswordurl` | query | string | no | Callback URL for the Password Reset link in the Email. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `g_recaptcha_response` | query | string | no | Google reCAPTCHA Response | +| `qq_captcha_ticket` | query | string | no | QQ reCAPTCHA Response | +| `qq_captcha_randstr` | query | string | no | QQ reCAPTCHA Response | +| `h-captcha-response` | query | string | no | hCaptcha Response | + +### Request body + +`object` as `application/json`. + +### Returns + +`IsPostedResponse` + +--- + +## `requestOTPForPasswordReset` + +**POST** `/identity/v2/auth/password/otp` + +Retrieve Password reset OTP + +Requests an OTP for resetting the Password using the User's Phone number. + +### Example + +```java +public static void callRequestOTPForPasswordReset(LoginRadiusClient client) { + ForgotPasswordPhoneModel forgotPasswordPhoneModel = new ForgotPasswordPhoneModel().phone("<phone>"); //Required + String smstemplate = "<smstemplate>"; //Optional + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String gRecaptchaResponse2 = "<gRecaptchaResponse2>"; //Optional + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Required + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Required + Boolean isvoiceotp = true; //Optional + + try { + var response = client.password.requestOTPForPasswordReset(forgotPasswordPhoneModel, smstemplate, gRecaptchaResponse, gRecaptchaResponse2, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, isvoiceotp); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `smstemplate` | query | string | no | SMS Template | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `g_recaptcha_response` | query | string | no | Google reCAPTCHA Response | +| `h-captcha-response` | query | string | no | hCaptcha Response | +| `qq_captcha_ticket` | query | string | no | QQ Captcha ticket (required if Bot Protection is enabled) | +| `qq_captcha_randstr` | query | string | no | QQ Captcha rand string (required if Bot Protection is enabled) | +| `isvoiceotp` | query | boolean | no | Boolean flag to enforce sending SMS content via Voice. | + +### Request body + +`ForgotPasswordPhoneModel` as `application/json`. + +### Returns + +`SMSResponse` + +--- + +## `resetPassword` + +**PUT** `/identity/v2/auth/password/reset` + +Reset Password with token and OTP + +Sets a new Password for the specified Account using a reset token and OTP. + +### Example + +```java +public static void callResetPassword(LoginRadiusClient client) { + ResetPassword resetPassword = new ResetPassword(); //Required + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String gRecaptchaResponse2 = "<gRecaptchaResponse2>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Required + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Required + + try { + var response = client.password.resetPassword(resetPassword, gRecaptchaResponse, gRecaptchaResponse2, preventWebhook, xPreventWebhook, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `g_recaptcha_response` | query | string | no | Google reCAPTCHA Response | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `h-captcha-response` | query | string | no | hCaptcha Response | +| `qq_captcha_ticket` | query | string | no | QQ Captcha ticket (required if Bot Protection is enabled) | +| `qq_captcha_randstr` | query | string | no | QQ Captcha rand string (required if Bot Protection is enabled) | + +### Request body + +`ResetPassword` as `application/json`. + +### Returns + +`ResetPasswordResponse` + +--- + +## `resetPasswordByResetToken` + +**PUT** `/identity/v2/auth/password` + +Reset Password with token and OTP + +Sets a new Password for the specified Account using a reset token and OTP. + +### Example + +```java +public static void callResetPasswordByResetToken(LoginRadiusClient client) { + ResetPassword resetPassword = new ResetPassword(); //Required + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String gRecaptchaResponse2 = "<gRecaptchaResponse2>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Required + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Required + + try { + var response = client.password.resetPasswordByResetToken(resetPassword, gRecaptchaResponse, gRecaptchaResponse2, preventWebhook, xPreventWebhook, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `g_recaptcha_response` | query | string | no | Google reCAPTCHA Response | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `h-captcha-response` | query | string | no | hCaptcha Response | +| `qq_captcha_ticket` | query | string | no | QQ Captcha ticket (required if Bot Protection is enabled) | +| `qq_captcha_randstr` | query | string | no | QQ Captcha rand string (required if Bot Protection is enabled) | + +### Request body + +`ResetPassword` as `application/json`. + +### Returns + +`ResetPasswordResponse` + +--- + +## `resetPasswordSecurityAnswer` + +**PUT** `/identity/v2/auth/password/securityanswer` + +Reset Password with security question + +Resets the Password using a security question and Email, Username, or Phone. + +### Example + +```java +public static void callResetPasswordSecurityAnswer(LoginRadiusClient client) { + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + ResetPasswordBySecurityAnswer resetPasswordBySecurityAnswer = new ResetPasswordBySecurityAnswer().securityAnswer("<securityAnswer>").password("<password>"); //Optional + + try { + var response = client.password.resetPasswordSecurityAnswer(preventWebhook, xPreventWebhook, resetPasswordBySecurityAnswer); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | + +### Request body + +`ResetPasswordBySecurityAnswer` as `application/json`. + +### Returns + +`ResetPasswordResponse` + +--- + +## `resetPasswordWithOTP` + +**PUT** `/identity/v2/auth/password/otp` + +Reset Password with Phone and OTP + +Resets the Password using OTP and Phone number verification. + +### Example + +```java +public static void callResetPasswordWithOTP(LoginRadiusClient client) { + ResetPasswordWithOTP resetPasswordWithOTP = new ResetPasswordWithOTP().password("<password>").otp("<otp>").phone("<phone>"); //Required + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String gRecaptchaResponse2 = "<gRecaptchaResponse2>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Required + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Required + + try { + var response = client.password.resetPasswordWithOTP(resetPasswordWithOTP, gRecaptchaResponse, gRecaptchaResponse2, preventWebhook, xPreventWebhook, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `g_recaptcha_response` | query | string | no | Google reCAPTCHA Response | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `h-captcha-response` | query | string | no | hCaptcha Response | +| `qq_captcha_ticket` | query | string | no | QQ Captcha ticket (required if Bot Protection is enabled) | +| `qq_captcha_randstr` | query | string | no | QQ Captcha rand string (required if Bot Protection is enabled) | + +### Request body + +`ResetPasswordWithOTP` as `application/json`. + +### Returns + +`ResetPasswordResponse` + diff --git a/docs/apis/perfectmind-sso.md b/docs/apis/perfectmind-sso.md new file mode 100644 index 0000000..cd18a45 --- /dev/null +++ b/docs/apis/perfectmind-sso.md @@ -0,0 +1,91 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# PerfectMind SSO + +2 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `getPerfectMindContact` + +**GET** `/sso/perfectmind/contact` + +Get PerfectMind Contact IDs + +Retrieves PerfectMind contact IDs associated with the user's email address. Uses the LoginRadius access token to look up the user and match them against PerfectMind contacts using email and birth date. + +### Example + +```java +public static void callGetPerfectMindContact(LoginRadiusClient client) { + String accessToken = "<accessToken>"; //Required + String perfectmindsitename = "<perfectmindsitename>"; //Required + String birthdate = "<birthdate>"; //Optional + String perfectScanID = "<perfectScanID>"; //Optional + + try { + var response = client.perfectMindSso.getPerfectMindContact(accessToken, perfectmindsitename, birthdate, perfectScanID); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | yes | Access Token of the User | +| `perfectmindsitename` | query | string | yes | PerfectMind site name identifier | +| `birthdate` | query | string | no | User's birth date for PerfectMind contact lookup | +| `perfectScanID` | query | string | no | PerfectMind scan ID for contact lookup | + +### Returns + +`PerfectMindContactResponse` + +--- + +## `getPerfectMindSession` + +**GET** `/sso/perfectmind/session` + +Generate PerfectMind Login Session + +Generates a PerfectMind login session using the provided LoginRadius access token. Returns a session ID and URL that can be used to authenticate the user into the PerfectMind platform. + +### Example + +```java +public static void callGetPerfectMindSession(LoginRadiusClient client) { + String accessToken = "<accessToken>"; //Required + String perfectmindsitename = "<perfectmindsitename>"; //Required + + try { + var response = client.perfectMindSso.getPerfectMindSession(accessToken, perfectmindsitename); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | yes | Access Token of the User | +| `perfectmindsitename` | query | string | yes | PerfectMind site name identifier | + +### Returns + +`PerfectMindSessionResponse` + diff --git a/docs/apis/permissions.md b/docs/apis/permissions.md new file mode 100644 index 0000000..ceeca00 --- /dev/null +++ b/docs/apis/permissions.md @@ -0,0 +1,186 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Permissions + +5 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `addPermission` + +**POST** `/v2/manage/permissions` + +Create Permission + +Adds a new Permission. + +### Example + +```java +public static void callAddPermission(LoginRadiusClient client) { + PermissionsPostRequest permissionsPostRequest = new PermissionsPostRequest().name("<name>"); //Optional + + try { + var response = client.permissions.addPermission(permissionsPostRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`PermissionsPostRequest` as `application/json`. + +### Returns + +`Permissions` + +--- + +## `deleteTenantPermission` + +**DELETE** `/v2/manage/permissions/{id}` + +Delete Permission + +Deletes a specific Permission. + +### Example + +```java +public static void callDeleteTenantPermission(LoginRadiusClient client) { + String id = "<id>"; //Required + + try { + var response = client.permissions.deleteTenantPermission(id); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `id` | path | string | yes | The unique identifier for the Permission | + +### Returns + +`DeleteResponse` + +--- + +## `getPermissionById` + +**GET** `/v2/manage/permissions/{id}` + +Retrieve Permission by ID + +Retrieves a Permission by its ID. + +### Example + +```java +public static void callGetPermissionById(LoginRadiusClient client) { + String id = "<id>"; //Required + + try { + var response = client.permissions.getPermissionById(id); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `id` | path | string | yes | The unique identifier for the Permission | + +### Returns + +`Permissions` + +--- + +## `permissions` + +**GET** `/v2/manage/permissions` + +List Permissions + +Retrieves a list of all Permissions. + +### Example + +```java +public static void callPermissions(LoginRadiusClient client) { + try { + var response = client.permissions.permissions(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`object` + +--- + +## `updateTenantPermission` + +**PUT** `/v2/manage/permissions/{id}` + +Update Permission + +Updates a specific Permission. Note: The Name field cannot be modified for non-B2B apps. If a different Name value is provided, the API will return an error. + +### Example + +```java +public static void callUpdateTenantPermission(LoginRadiusClient client) { + String id = "<id>"; //Required + PermissionPutRequest permissionPutRequest = new PermissionPutRequest().name("<name>").description("<description>"); //Optional + + try { + var response = client.permissions.updateTenantPermission(id, permissionPutRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `id` | path | string | yes | The unique identifier for the Permission | + +### Request body + +`PermissionPutRequest` as `application/json`. + +### Returns + +`Permissions` + diff --git a/docs/apis/push-notification-configuration.md b/docs/apis/push-notification-configuration.md new file mode 100644 index 0000000..1ea881b --- /dev/null +++ b/docs/apis/push-notification-configuration.md @@ -0,0 +1,107 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Push Notification Configuration + +3 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `createPushSettings` + +**POST** `/v2/manage/2fa/push-notification-settings` + +Create Push Notification settings + +Creates new Push Notification settings for second factor authentication. + +### Example + +```java +public static void callCreatePushSettings(LoginRadiusClient client) { + PushAuthenticator pushAuthenticator = new PushAuthenticator().isEnabled(true).notificationService("<notificationService>").customAppName("<customAppName>"); //Required + + try { + var response = client.pushNotificationConfiguration.createPushSettings(pushAuthenticator); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`PushAuthenticator` as `application/json`. + +### Returns + +`PushAuthenticator` + +--- + +## `getPushSettings` + +**GET** `/v2/manage/2fa/push-notification-settings` + +Retrieve Push Notification settings + +Retrieves the current Push Notification settings for second factor authentication. + +### Example + +```java +public static void callGetPushSettings(LoginRadiusClient client) { + try { + var response = client.pushNotificationConfiguration.getPushSettings(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`PushAuthenticator` + +--- + +## `updatePushSettings` + +**PUT** `/v2/manage/2fa/push-notification-settings` + +Update Push Notification settings + +Updates existing Push Notification settings for second factor authentication. + +### Example + +```java +public static void callUpdatePushSettings(LoginRadiusClient client) { + PushAuthenticator pushAuthenticator = new PushAuthenticator().isEnabled(true).notificationService("<notificationService>").customAppName("<customAppName>"); //Required + + try { + var response = client.pushNotificationConfiguration.updatePushSettings(pushAuthenticator); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`PushAuthenticator` as `application/json`. + +### Returns + +`PushAuthenticator` + diff --git a/docs/apis/registration.md b/docs/apis/registration.md new file mode 100644 index 0000000..aa5f199 --- /dev/null +++ b/docs/apis/registration.md @@ -0,0 +1,234 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Registration + +4 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `beginPasskeyRegistration` + +**GET** `/identity/v2/auth/register/passkey/begin` + +Initiate Registration with Passkey + +Begins the registration process using a Passkey. + +### Example + +```java +public static void callBeginPasskeyRegistration(LoginRadiusClient client) { + String identifier = "<identifier>"; //Required + + try { + var response = client.registration.beginPasskeyRegistration(identifier); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `identifier` | query | string | yes | Email of the User | + +### Returns + +`object` + +--- + +## `finishPasskeyRegistration` + +**POST** `/identity/v2/auth/register/passkey/finish` + +Complete Registration with Passkey + +Completes the registration process using a Passkey. + +### Example + +```java +public static void callFinishPasskeyRegistration(LoginRadiusClient client) { + PasskeyRegisterFinish passkeyRegisterFinish = new PasskeyRegisterFinish().passkeyCredential("<passkeyCredential>").gender("<gender>").birthDate("<birthDate>"); //Required + String verificationurl = "<verificationurl>"; //Optional + String emailtemplate = "<emailtemplate>"; //Optional + String welcomeemailtemplate = "<welcomeemailtemplate>"; //Optional + String fields = "<fields>"; //Optional + String options = "<options>"; //Optional + String invitationToken = "<invitationToken>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + + try { + var response = client.registration.finishPasskeyRegistration(passkeyRegisterFinish, verificationurl, emailtemplate, welcomeemailtemplate, fields, options, invitationToken, preventWebhook, xPreventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `verificationurl` | query | string | no | Verification URL for the User which will be included in the Email template.. | +| `emailtemplate` | query | string | no | Name of the Email template to use for this notification. | +| `welcomeemailtemplate` | query | string | no | Welcome Email Template | +| `fields` | query | string | no | Comma-separated list of profile fields to include in the response. | +| `options` | query | string | no | Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail | +| `invitation_token` | query | string | no | Invitation token of an organization | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | + +### Request body + +`PasskeyRegisterFinish` as `application/json`. + +### Returns + +`RegistrationResponse` + +--- + +## `userRegistrationByReCaptchaEmailPhoneUserName` + +**POST** `/identity/v2/auth/register/captcha` + +Registration by Email/Phone/Username via Captcha + +Registers a new User using Email, Phone, or Username with Captcha verification. + +### Example + +```java +public static void callUserRegistrationByReCaptchaEmailPhoneUserName(LoginRadiusClient client) { + UserRegistrationByReCaptchaEmailPhoneUserNameRequest userRegistrationByReCaptchaEmailPhoneUserNameRequest = new UserRegistrationByReCaptchaEmailPhoneUserNameRequest().g-recaptcha-response("<g-recaptcha-response>").qq_captcha_ticket("<qq_captcha_ticket>").qq_captcha_randstr("<qq_captcha_randstr>"); //Required + String verificationurl = "<verificationurl>"; //Optional + String emailtemplate = "<emailtemplate>"; //Optional + String smstemplate = "<smstemplate>"; //Optional + String welcomeemailtemplate = "<welcomeemailtemplate>"; //Optional + String options = "<options>"; //Optional + Boolean isvoiceotp = true; //Optional + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String gRecaptchaResponse2 = "<gRecaptchaResponse2>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Optional + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Optional + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + String fields = "<fields>"; //Optional + String invitationToken = "<invitationToken>"; //Optional + + try { + var response = client.registration.userRegistrationByReCaptchaEmailPhoneUserName(userRegistrationByReCaptchaEmailPhoneUserNameRequest, verificationurl, emailtemplate, smstemplate, welcomeemailtemplate, options, isvoiceotp, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, preventWebhook, xPreventWebhook, fields, invitationToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `verificationurl` | query | string | no | Verification URL for the User which will be included in the Email template.. | +| `emailtemplate` | query | string | no | Name of the Email template to use for this notification. | +| `smstemplate` | query | string | no | SMS Template | +| `welcomeemailtemplate` | query | string | no | Welcome Email Template | +| `options` | query | string | no | Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail | +| `isvoiceotp` | query | boolean | no | Boolean flag to enforce sending SMS content via Voice. | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `g_recaptcha_response` | query | string | no | Google reCAPTCHA Response | +| `qq_captcha_ticket` | query | string | no | QQ reCAPTCHA Response | +| `qq_captcha_randstr` | query | string | no | QQ reCAPTCHA Response | +| `h-captcha-response` | query | string | no | hCaptcha Response | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `fields` | query | string | no | Comma-separated list of profile fields to include in the response. | +| `invitation_token` | query | string | no | Invitation token of an organization | + +### Request body + +`object` as `application/json`. + +### Returns + +`RegistrationResponse` + +--- + +## `userRegistrationBySottEmailPhoneUserName` + +**POST** `/identity/v2/auth/register` + +Registration by Email/Phone/Username via SOTT + +Registers a new User using Email, Phone, or Username via a Secure One Time Token (SOTT). + +### Example + +```java +public static void callUserRegistrationBySottEmailPhoneUserName(LoginRadiusClient client) { + ProfileRequestModel profileRequestModel = new ProfileRequestModel().userName("<userName>").phoneId("<phoneId>").gender("<gender>"); //Required + String emailtemplate = "<emailtemplate>"; //Optional + String sott = "<sott>"; //Optional + String welcomeemailtemplate = "<welcomeemailtemplate>"; //Optional + String verificationurl = "<verificationurl>"; //Optional + String smstemplate = "<smstemplate>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + String fields = "<fields>"; //Optional + String xLoginRadiusSott = "<xLoginRadiusSott>"; //Optional + String options = "<options>"; //Optional + String invitationToken = "<invitationToken>"; //Optional + Boolean isvoiceotp = true; //Optional + + try { + var response = client.registration.userRegistrationBySottEmailPhoneUserName(profileRequestModel, emailtemplate, sott, welcomeemailtemplate, verificationurl, smstemplate, preventWebhook, xPreventWebhook, fields, xLoginRadiusSott, options, invitationToken, isvoiceotp); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `emailtemplate` | query | string | no | Name of the Email template to use for this notification. | +| `sott` | query | string | no | SOTT should be generated from the server side and passed here or in the X-LoginRadius-Sott header. | +| `welcomeemailtemplate` | query | string | no | Welcome Email Template | +| `verificationurl` | query | string | no | Verification URL for the User which will be included in the Email template.. | +| `smstemplate` | query | string | no | SMS Template | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `fields` | query | string | no | Comma-separated list of profile fields to include in the response. | +| `X-LoginRadius-Sott` | header | string | no | SOTT should be generated from the server side and passed here or in sott query parameter. | +| `options` | query | string | no | Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail | +| `invitation_token` | query | string | no | Invitation token of an organization | +| `isvoiceotp` | query | boolean | no | Boolean flag to enforce sending SMS content via Voice. | + +### Request body + +`ProfileRequestModel` as `application/json`. + +### Returns + +`RegistrationResponse` + diff --git a/docs/apis/roles-management.md b/docs/apis/roles-management.md new file mode 100644 index 0000000..bc627a6 --- /dev/null +++ b/docs/apis/roles-management.md @@ -0,0 +1,398 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Roles Management + +9 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `deleteContextRoleByUid` + +**DELETE** `/identity/v2/manage/account/{uid}/rolecontext/{contextName}/role` + +Delete Role from Context + +Deletes the specified Role from a Context. + +This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + +### Example + +```java +public static void callDeleteContextRoleByUid(LoginRadiusClient client) { + String uid = "<uid>"; //Required + String contextName = "<contextName>"; //Required + Boolean preventWebhook = true; //Optional + RemoveRoleContextRoleModel removeRoleContextRoleModel = new RemoveRoleContextRoleModel().roles("<roles>"); //Optional + + try { + var response = client.rolesManagement.deleteContextRoleByUid(uid, contextName, preventWebhook, removeRoleContextRoleModel); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | path | string | yes | UID of the User | +| `contextName` | path | string | yes | Name of the Role Context | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | + +### Request body + +`RemoveRoleContextRoleModel` as `application/json`. + +### Returns + +`DeleteResponse` + +--- + +## `deleteRoleContextAdditionalPermissionsByUid` + +**DELETE** `/identity/v2/manage/account/{uid}/rolecontext/{contextName}/additionalpermission` + +Delete Additional Permissions from Context + +Removes specified additional Permissions from a Context. + +This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + +### Example + +```java +public static void callDeleteRoleContextAdditionalPermissionsByUid(LoginRadiusClient client) { + String uid = "<uid>"; //Required + String contextName = "<contextName>"; //Required + Boolean preventWebhook = true; //Optional + RemoveRoleContextAdditionalPermissionsModel removeRoleContextAdditionalPermissionsModel = new RemoveRoleContextAdditionalPermissionsModel().additionalpermissions("<additionalpermissions>"); //Optional + + try { + var response = client.rolesManagement.deleteRoleContextAdditionalPermissionsByUid(uid, contextName, preventWebhook, removeRoleContextAdditionalPermissionsModel); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | path | string | yes | UID of the User | +| `contextName` | path | string | yes | Name of the Role Context | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | + +### Request body + +`RemoveRoleContextAdditionalPermissionsModel` as `application/json`. + +### Returns + +`DeleteResponse` + +--- + +## `deleteRoleContextByUid` + +**DELETE** `/identity/v2/manage/account/{uid}/rolecontext/{contextName}` + +Delete Role Context + +Deletes the specified Role Context. + +This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + +### Example + +```java +public static void callDeleteRoleContextByUid(LoginRadiusClient client) { + String contextName = "<contextName>"; //Required + String uid = "<uid>"; //Required + Boolean preventWebhook = true; //Optional + + try { + var response = client.rolesManagement.deleteRoleContextByUid(contextName, uid, preventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `contextName` | path | string | yes | Name of the Role Context | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `uid` | path | string | yes | UID of the User | + +### Returns + +`DeleteResponse` + +--- + +## `deleteRolesByUid` + +**DELETE** `/identity/v2/manage/account/{uid}/role` + +Unassign Roles by UID + +Removes specified Roles from a User using the UID. + +This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + +### Example + +```java +public static void callDeleteRolesByUid(LoginRadiusClient client) { + String uid = "<uid>"; //Required + Boolean preventWebhook = true; //Optional + UserRolesModel userRolesModel = new UserRolesModel().roles("<roles>"); //Optional + + try { + var response = client.rolesManagement.deleteRolesByUid(uid, preventWebhook, userRolesModel); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | path | string | yes | UID of the User | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | + +### Request body + +`UserRolesModel` as `application/json`. + +### Returns + +`DeleteResponse` + +--- + +## `getRoleContextByContextName` + +**GET** `/identity/v2/manage/account/roleContext/{contextName}` + +Retrieve Role Context + +Retrieves the Role Context for a specified Role. + +This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + +### Example + +```java +public static void callGetRoleContextByContextName(LoginRadiusClient client) { + String contextName = "<contextName>"; //Required + + try { + var response = client.rolesManagement.getRoleContextByContextName(contextName); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `contextName` | path | string | yes | Name of the Role Context | + +### Returns + +`RoleContextProfileResponseModel` + +--- + +## `getRoleContextByUid` + +**GET** `/identity/v2/manage/account/{uid}/rolecontext` + +Retrieve Context by UID + +Retrieves User Roles for all Contexts using the UID. + +This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + +### Example + +```java +public static void callGetRoleContextByUid(LoginRadiusClient client) { + String uid = "<uid>"; //Required + + try { + var response = client.rolesManagement.getRoleContextByUid(uid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | path | string | yes | UID of the User | + +### Returns + +`RoleContextResponseModal` + +--- + +## `getRolesByUid` + +**GET** `/identity/v2/manage/account/{uid}/role` + +Retrieve Roles by UID + +Retrieves Roles associated with a specified UID. + +This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + +### Example + +```java +public static void callGetRolesByUid(LoginRadiusClient client) { + String uid = "<uid>"; //Required + + try { + var response = client.rolesManagement.getRolesByUid(uid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | path | string | yes | UID of the User | + +### Returns + +`UserRolesModel` + +--- + +## `saveRolesByUid` + +**PUT** `/identity/v2/manage/account/{uid}/role` + +Assign Roles by UID + +Updates and assigns Roles to a User using the UID. + +This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + +### Example + +```java +public static void callSaveRolesByUid(LoginRadiusClient client) { + String uid = "<uid>"; //Required + Boolean preventWebhook = true; //Optional + UserRolesModel userRolesModel = new UserRolesModel().roles("<roles>"); //Optional + + try { + var response = client.rolesManagement.saveRolesByUid(uid, preventWebhook, userRolesModel); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | path | string | yes | UID of the User | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | + +### Request body + +`UserRolesModel` as `application/json`. + +### Returns + +`UserRolesModel` + +--- + +## `upsertRoleContextByUid` + +**PUT** `/identity/v2/manage/account/{uid}/rolecontext` + +Upsert Context by UID + +Creates or updates a Context with a set of Roles using the UID. + +This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + +### Example + +```java +public static void callUpsertRoleContextByUid(LoginRadiusClient client) { + String uid = "<uid>"; //Required + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + UpdateRoleContextBodyModel updateRoleContextBodyModel = new UpdateRoleContextBodyModel().rolecontext("<rolecontext>"); //Optional + + try { + var response = client.rolesManagement.upsertRoleContextByUid(uid, preventWebhook, xPreventWebhook, updateRoleContextBodyModel); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `uid` | path | string | yes | UID of the User | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | + +### Request body + +`UpdateRoleContextBodyModel` as `application/json`. + +### Returns + +`RoleContextResponseModal` + diff --git a/docs/apis/roles.md b/docs/apis/roles.md new file mode 100644 index 0000000..dba0d88 --- /dev/null +++ b/docs/apis/roles.md @@ -0,0 +1,260 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Roles + +7 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `createTenantRole` + +**POST** `/v2/manage/roles` + +Create Tenant Role + +Creates a Role within the Tenant. + +### Example + +```java +public static void callCreateTenantRole(LoginRadiusClient client) { + RolePostRequest rolePostRequest = new RolePostRequest().name("<name>"); //Required + + try { + var response = client.roles.createTenantRole(rolePostRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`RolePostRequest` as `application/json`. + +### Returns + +`TenantRole` + +--- + +## `deleteTenantRole` + +**DELETE** `/v2/manage/roles/{id}` + +Delete Role + +Deletes a Role by its ID. + +### Example + +```java +public static void callDeleteTenantRole(LoginRadiusClient client) { + String id = "<id>"; //Required + + try { + var response = client.roles.deleteTenantRole(id); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `id` | path | string | yes | Role ID | + +### Returns + +`DeleteResponse` + +--- + +## `getAllTenantRoles` + +**GET** `/v2/manage/roles` + +List Tenant Roles + +Lists all Roles within the Tenant. + +### Example + +```java +public static void callGetAllTenantRoles(LoginRadiusClient client) { + try { + var response = client.roles.getAllTenantRoles(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`object` + +--- + +## `getRoleById` + +**GET** `/v2/manage/roles/{id}` + +Retrieve Role by ID + +Retrieves details of a Role by its ID. + +### Example + +```java +public static void callGetRoleById(LoginRadiusClient client) { + String id = "<id>"; //Required + + try { + var response = client.roles.getRoleById(id); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `id` | path | string | yes | Role ID | + +### Returns + +`Role` + +--- + +## `roleByName` + +**GET** `/v2/manage/roles/{name}/name` + +Retrieve Role by name + +Retrieves details of a Role by its name. + +### Example + +```java +public static void callRoleByName(LoginRadiusClient client) { + String name = "<name>"; //Required + String orgid = "<orgid>"; //Optional + + try { + var response = client.roles.roleByName(name, orgid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `name` | path | string | yes | Role Name | +| `orgid` | query | string | no | Organization ID | + +### Returns + +`object` + +--- + +## `setDefaultRole` + +**PUT** `/v2/manage/roles/{id}/default` + +Set default Role + +Sets a Role as the default for new Users. This API is supported only for B2B tenants. + +### Example + +```java +public static void callSetDefaultRole(LoginRadiusClient client) { + String id = "<id>"; //Required + + try { + var response = client.roles.setDefaultRole(id); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `id` | path | string | yes | Role ID | + +### Returns + +`DefaultResponse` + +--- + +## `updateRole` + +**PUT** `/v2/manage/roles/{id}` + +Update Role + +Updates a Role by its ID. + +### Example + +```java +public static void callUpdateRole(LoginRadiusClient client) { + String id = "<id>"; //Required + RolesPutRequest rolesPutRequest = new RolesPutRequest().name("<name>").description("<description>").permissions("<permissions>"); //Required + + try { + var response = client.roles.updateRole(id, rolesPutRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `id` | path | string | yes | Role ID | + +### Request body + +`RolesPutRequest` as `application/json`. + +### Returns + +`Role` + diff --git a/docs/apis/saml-custom-providers.md b/docs/apis/saml-custom-providers.md new file mode 100644 index 0000000..7d72798 --- /dev/null +++ b/docs/apis/saml-custom-providers.md @@ -0,0 +1,250 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# SAML Custom Providers + +7 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `createSAMLSPClientConfiguration` + +**POST** `/v2/manage/custom-providers/saml` + +Create SAML SP Configuration + +Creates a new Service Provider configuration for a SAML client within the Tenant, defining necessary settings for SAML authentication flows. + +### Example + +```java +public static void callCreateSAMLSPClientConfiguration(LoginRadiusClient client) { + SamlSpConfigModel samlSpConfigModel = new SamlSpConfigModel().provider("<provider>").dataMap("<dataMap>"); //Required + + try { + var response = client.samlCustomProviders.createSAMLSPClientConfiguration(samlSpConfigModel); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`SamlSpConfigModel` as `application/json`. + +### Returns + +`SamlSpConfig` + +--- + +## `deleteSAMLSPClientConfigurationByAppName` + +**DELETE** `/v2/manage/custom-providers/saml/{samlApp}` + +Delete SAML SP Configuration + +Deletes the Service Provider configuration for a SAML client within the Tenant, identified by the application name. + +### Example + +```java +public static void callDeleteSAMLSPClientConfigurationByAppName(LoginRadiusClient client) { + String samlApp = "<samlApp>"; //Required + + try { + var response = client.samlCustomProviders.deleteSAMLSPClientConfigurationByAppName(samlApp); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `samlApp` | path | string | yes | The SAML App identifier | + +### Returns + +`DeleteResponse` + +--- + +## `getAllSAMLSPClientConfigurations` + +**GET** `/v2/manage/custom-providers/saml` + +List SAML SP Configurations + +Retrieves a list of all Service Provider configurations for SAML clients within the Tenant, including details such as datamap, endpoints, and certificates. + +### Example + +```java +public static void callGetAllSAMLSPClientConfigurations(LoginRadiusClient client) { + try { + var response = client.samlCustomProviders.getAllSAMLSPClientConfigurations(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`object` + +--- + +## `getSAMLSPClientConfigurationByAppName` + +**GET** `/v2/manage/custom-providers/saml/{samlApp}` + +Retrieve SAML SP Configuration + +Retrieves the Service Provider configuration details for a SAML client within the Tenant, identified by the application name. + +### Example + +```java +public static void callGetSAMLSPClientConfigurationByAppName(LoginRadiusClient client) { + String samlApp = "<samlApp>"; //Required + + try { + var response = client.samlCustomProviders.getSAMLSPClientConfigurationByAppName(samlApp); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `samlApp` | path | string | yes | The SAML App identifier | + +### Returns + +`SamlSpConfig` + +--- + +## `getSamlSPClientMappingKeys` + +**GET** `/v2/manage/custom-providers/saml/keys` + +Retrieve SAML SP Mapping Keys + +Retrieves a list of mapping keys available for configuring attribute mappings in SAML Service Provider clients within the Tenant. + +### Example + +```java +public static void callGetSamlSPClientMappingKeys(LoginRadiusClient client) { + try { + var response = client.samlCustomProviders.getSamlSPClientMappingKeys(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`object` + +--- + +## `renewSAMLSppCertificate` + +**POST** `/v2/manage/custom-providers/saml/{samlApp}/renew-certificate` + +Renew SAML SP Certificate + +Renews the SAML Service Provider certificate to replace an expiring or compromised certificate. + +### Example + +```java +public static void callRenewSAMLSppCertificate(LoginRadiusClient client) { + String samlApp = "<samlApp>"; //Required + + try { + var response = client.samlCustomProviders.renewSAMLSppCertificate(samlApp); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `samlApp` | path | string | yes | The SAML App identifier | + +### Returns + +`SamlSpConfig` + +--- + +## `updateSAMLSPClientConfigurationByAppName` + +**PUT** `/v2/manage/custom-providers/saml/{samlApp}` + +Update SAML SP Configuration + +Updates an existing Service Provider configuration for a SAML client within the Tenant, identified by the application name. + +### Example + +```java +public static void callUpdateSAMLSPClientConfigurationByAppName(LoginRadiusClient client) { + String samlApp = "<samlApp>"; //Required + SamlSpConfigModel samlSpConfigModel = new SamlSpConfigModel().provider("<provider>").dataMap("<dataMap>"); //Required + + try { + var response = client.samlCustomProviders.updateSAMLSPClientConfigurationByAppName(samlApp, samlSpConfigModel); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `samlApp` | path | string | yes | The SAML App identifier | + +### Request body + +`SamlSpConfigModel` as `application/json`. + +### Returns + +`SamlSpConfig` + diff --git a/docs/apis/saml-integrations.md b/docs/apis/saml-integrations.md new file mode 100644 index 0000000..362157b --- /dev/null +++ b/docs/apis/saml-integrations.md @@ -0,0 +1,222 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# SAML Integrations + +6 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `createSamlIntegration` + +**POST** `/v2/manage/integrations/saml` + +Create SAML IdP Configuration + +Creates a new SAML-based Identity Provider integration for the Tenant, enabling authentication and federation with the specified IdP. + +### Example + +```java +public static void callCreateSamlIntegration(LoginRadiusClient client) { + CreateSamlIntegrationRequest createSamlIntegrationRequest = new CreateSamlIntegrationRequest().appName("<appName>"); //Required + + try { + var response = client.samlIntegrations.createSamlIntegration(createSamlIntegrationRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`object` as `application/json`. + +### Returns + +`SamlIntegrationResponse` + +--- + +## `deleteSamlIntegrationByAppName` + +**DELETE** `/v2/manage/integrations/saml/{samlApp}` + +Delete SAML IdP Configuration + +Deletes the SAML-based Identity Provider configuration for the Tenant identified by the application name, disabling authentication for the specified application. + +### Example + +```java +public static void callDeleteSamlIntegrationByAppName(LoginRadiusClient client) { + String samlApp = "<samlApp>"; //Required + + try { + var response = client.samlIntegrations.deleteSamlIntegrationByAppName(samlApp); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `samlApp` | path | string | yes | The SAML App identifier | + +### Returns + +`DeleteResponse` + +--- + +## `getAllSamlIntegrations` + +**GET** `/v2/manage/integrations/saml` + +List SAML Integrations + +Retrieves a list of all configured SAML-based Identity Provider integrations for the Tenant, including metadata and settings for authentication. + +### Example + +```java +public static void callGetAllSamlIntegrations(LoginRadiusClient client) { + try { + var response = client.samlIntegrations.getAllSamlIntegrations(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`object` + +--- + +## `getSamlIntegrationByAppName` + +**GET** `/v2/manage/integrations/saml/{samlApp}` + +Retrieve SAML IdP client configuration by app name + +Retrieves the SAML-based Identity Provider configuration details for the Tenant using the application name, including metadata and settings. + +### Example + +```java +public static void callGetSamlIntegrationByAppName(LoginRadiusClient client) { + String samlApp = "<samlApp>"; //Required + + try { + var response = client.samlIntegrations.getSamlIntegrationByAppName(samlApp); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `samlApp` | path | string | yes | The SAML App identifier | + +### Returns + +`SamlIntegrationResponse` + +--- + +## `renewSamlIntegrationCertificate` + +**POST** `/v2/manage/integrations/saml/{samlApp}/renew-certificate` + +Renew SAML IdP Certificate + +Renews the SAML Identity Provider certificate to replace an expiring or compromised signing certificate. + +### Example + +```java +public static void callRenewSamlIntegrationCertificate(LoginRadiusClient client) { + String samlApp = "<samlApp>"; //Required + + try { + var response = client.samlIntegrations.renewSamlIntegrationCertificate(samlApp); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `samlApp` | path | string | yes | The SAML App identifier | + +### Returns + +`SamlIntegrationResponse` + +--- + +## `updateSamlIntegrationByAppName` + +**PUT** `/v2/manage/integrations/saml/{samlApp}` + +Update SAML IdP client configuration by app name + +Updates an existing SAML-based Identity Provider configuration for the Tenant identified by the application name, modifying necessary settings. + +### Example + +```java +public static void callUpdateSamlIntegrationByAppName(LoginRadiusClient client) { + String samlApp = "<samlApp>"; //Required + SamlIntegrationRequest samlIntegrationRequest = new SamlIntegrationRequest().afterLogoutUrl("<afterLogoutUrl>").assertionConsumerService("<assertionConsumerService>").attributes("<attributes>"); //Required + + try { + var response = client.samlIntegrations.updateSamlIntegrationByAppName(samlApp, samlIntegrationRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `samlApp` | path | string | yes | The SAML App identifier | + +### Request body + +`SamlIntegrationRequest` as `application/json`. + +### Returns + +`SamlIntegrationResponse` + diff --git a/docs/apis/saml.md b/docs/apis/saml.md new file mode 100644 index 0000000..9459974 --- /dev/null +++ b/docs/apis/saml.md @@ -0,0 +1,43 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# SAML + +1 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `getSAMLIDPMetadata` + +**GET** `/service/saml/idp/metadata` + +Retrieve SAML IDP metadata + +Retrieves metadata for a SAML Identity Provider (IDP). + +### Example + +```java +public static void callGetSAMLIDPMetadata(LoginRadiusClient client) { + String appName = "<appName>"; //Required + + try { + var response = client.saml.getSAMLIDPMetadata(appName); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `appName` | query | string | yes | Saml App Name | + diff --git a/docs/apis/second-factor-configuration.md b/docs/apis/second-factor-configuration.md new file mode 100644 index 0000000..1d5f697 --- /dev/null +++ b/docs/apis/second-factor-configuration.md @@ -0,0 +1,197 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Second Factor Configuration + +6 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `getDuoAuthenticatorConfiguration` + +**GET** `/v2/manage/2fa/duo-authenticator-settings` + +Retrieve Duo configuration + +Retrieves the Duo Authentication configuration for a specific Tenant. + +### Example + +```java +public static void callGetDuoAuthenticatorConfiguration(LoginRadiusClient client) { + try { + var response = client.secondFactorConfiguration.getDuoAuthenticatorConfiguration(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`DuoSecurityAuthenticator` + +--- + +## `getSecondFactorConfiguration` + +**GET** `/v2/manage/2fa/config` + +Retrieve second factor configuration + +Retrieves the second factor authentication configuration for the Tenant. + +### Example + +```java +public static void callGetSecondFactorConfiguration(LoginRadiusClient client) { + try { + var response = client.secondFactorConfiguration.getSecondFactorConfiguration(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`MFASettings` + +--- + +## `getTOTPConfiguration` + +**GET** `/v2/manage/2fa/totp-authenticator-settings` + +Retrieve TOTP configuration + +Retrieves the Time-based One Time Password (TOTP) configuration for a specific Tenant. + +### Example + +```java +public static void callGetTOTPConfiguration(LoginRadiusClient client) { + try { + var response = client.secondFactorConfiguration.getTOTPConfiguration(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`GoogleAuthenticator` + +--- + +## `updateDuoAuthenticatorConfiguration` + +**PUT** `/v2/manage/2fa/duo-authenticator-settings` + +Update Duo configuration + +Updates the Duo Authentication configuration for a specific Tenant. + +### Example + +```java +public static void callUpdateDuoAuthenticatorConfiguration(LoginRadiusClient client) { + DuoSecurityAuthenticator duoSecurityAuthenticator = new DuoSecurityAuthenticator().isEnabled(true).clientId("<clientId>").clientSecret("<clientSecret>"); //Required + + try { + var response = client.secondFactorConfiguration.updateDuoAuthenticatorConfiguration(duoSecurityAuthenticator); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`DuoSecurityAuthenticator` as `application/json`. + +### Returns + +`DuoSecurityAuthenticator` + +--- + +## `updateSecondFactorConfiguration` + +**PUT** `/v2/manage/2fa/config` + +Update second factor configuration + +Updates the second factor authentication configuration for the Tenant. + +### Example + +```java +public static void callUpdateSecondFactorConfiguration(LoginRadiusClient client) { + MFASettings mfASettings = new MFASettings().isSecondFactorAuthenticatorEnabled(true).isRequired(true).isAuthenticatorEnabled(true); //Required + + try { + var response = client.secondFactorConfiguration.updateSecondFactorConfiguration(mfASettings); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`MFASettings` as `application/json`. + +### Returns + +`MFASettings` + +--- + +## `updateTOTPConfiguration` + +**PUT** `/v2/manage/2fa/totp-authenticator-settings` + +Update TOTP configuration + +Updates the Time-based One Time Password (TOTP) configuration for a specific Tenant. + +### Example + +```java +public static void callUpdateTOTPConfiguration(LoginRadiusClient client) { + GoogleAuthenticator googleAuthenticator = new GoogleAuthenticator().issuerId("<issuerId>"); //Required + + try { + var response = client.secondFactorConfiguration.updateTOTPConfiguration(googleAuthenticator); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`GoogleAuthenticator` as `application/json`. + +### Returns + +`GoogleAuthenticator` + diff --git a/docs/apis/security-questions.md b/docs/apis/security-questions.md new file mode 100644 index 0000000..f049b61 --- /dev/null +++ b/docs/apis/security-questions.md @@ -0,0 +1,212 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Security Questions + +6 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `addSecurityQuestion` + +**POST** `/v2/manage/security-questions` + +Add security question + +Adds a new security question to the Tenant's configuration. + +### Example + +```java +public static void callAddSecurityQuestion(LoginRadiusClient client) { + SecurityQuestionInput securityQuestionInput = new SecurityQuestionInput().question("<question>"); //Required + + try { + var response = client.securityQuestions.addSecurityQuestion(securityQuestionInput); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`SecurityQuestionInput` as `application/json`. + +### Returns + +`SecurityQuestion` + +--- + +## `deleteSecurityQuestion` + +**DELETE** `/v2/manage/security-questions/{securityQuestionID}` + +Delete security question + +Deletes a security question by its ID. + +### Example + +```java +public static void callDeleteSecurityQuestion(LoginRadiusClient client) { + String securityQuestionID = "<securityQuestionID>"; //Required + + try { + var response = client.securityQuestions.deleteSecurityQuestion(securityQuestionID); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `securityQuestionID` | path | string | yes | | + +### Returns + +`DeleteResponse` + +--- + +## `getSecurityQuestionRenderCount` + +**GET** `/v2/manage/security-questions/count` + +Retrieve security question count + +Retrieves the number of security questions to render for a User. + +### Example + +```java +public static void callGetSecurityQuestionRenderCount(LoginRadiusClient client) { + try { + var response = client.securityQuestions.getSecurityQuestionRenderCount(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`SecurityQuestionsRender` + +--- + +## `getSecurityQuestions` + +**GET** `/v2/manage/security-questions` + +Retrieve security questions + +Retrieves a list of all available security questions for the Tenant. + +### Example + +```java +public static void callGetSecurityQuestions(LoginRadiusClient client) { + try { + var response = client.securityQuestions.getSecurityQuestions(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`object` + +--- + +## `updateSecurityQuestion` + +**PUT** `/v2/manage/security-questions/{securityQuestionID}` + +Update security question + +Updates an existing security question by its ID. + +### Example + +```java +public static void callUpdateSecurityQuestion(LoginRadiusClient client) { + String securityQuestionID = "<securityQuestionID>"; //Required + SecurityQuestionInput securityQuestionInput = new SecurityQuestionInput().question("<question>"); //Required + + try { + var response = client.securityQuestions.updateSecurityQuestion(securityQuestionID, securityQuestionInput); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `securityQuestionID` | path | string | yes | | + +### Request body + +`SecurityQuestionInput` as `application/json`. + +### Returns + +`SecurityQuestion` + +--- + +## `updateSecurityQuestionRenderCount` + +**PUT** `/v2/manage/security-questions/count` + +Update security question count + +Updates the number of security questions to render for a User. + +### Example + +```java +public static void callUpdateSecurityQuestionRenderCount(LoginRadiusClient client) { + SecurityQuestionsRender securityQuestionsRender = new SecurityQuestionsRender().renderQuestionCount(0); //Required + + try { + var response = client.securityQuestions.updateSecurityQuestionRenderCount(securityQuestionsRender); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`SecurityQuestionsRender` as `application/json`. + +### Returns + +`SecurityQuestionsRender` + diff --git a/docs/apis/security.md b/docs/apis/security.md new file mode 100644 index 0000000..3f38303 --- /dev/null +++ b/docs/apis/security.md @@ -0,0 +1,2377 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Security + +51 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `accountRegisterMFAPasskeyBegin` + +**GET** `/identity/v2/auth/account/2fa/register/passkey/begin` + +Begin MFA Passkey registration + +Initiates the MFA Passkey registration flow for an Account. + +### Example + +```java +public static void callAccountRegisterMFAPasskeyBegin(LoginRadiusClient client) { + String accessToken = "<accessToken>"; //Optional + + try { + var response = client.security.accountRegisterMFAPasskeyBegin(accessToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | + +### Returns + +`object` + +--- + +## `accountRegisterMFAPasskeyFinish` + +**POST** `/identity/v2/auth/account/2fa/register/passkey/finish` + +Complete MFA Passkey registration + +Completes the MFA Passkey registration flow for an Account. + +### Example + +```java +public static void callAccountRegisterMFAPasskeyFinish(LoginRadiusClient client) { + AccountRegisterMFAPasskeyFinishRequest accountRegisterMFAPasskeyFinishRequest = new AccountRegisterMFAPasskeyFinishRequest().passkeyCredential("<passkeyCredential>"); //Required + String accessToken = "<accessToken>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + + try { + var response = client.security.accountRegisterMFAPasskeyFinish(accountRegisterMFAPasskeyFinishRequest, accessToken, preventWebhook, xPreventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | + +### Request body + +`object` as `application/json`. + +### Returns + +`PasskeyCredentialObject` + +--- + +## `beginMFAPasskeyRegistration` + +**GET** `/identity/v2/auth/login/2fa/register/passkey/begin` + +Begin Passkey Registration with MFA Token + +Begins the MFA Passkey registration flow. + +### Example + +```java +public static void callBeginMFAPasskeyRegistration(LoginRadiusClient client) { + String secondfactorauthenticationtoken = "<secondfactorauthenticationtoken>"; //Required + + try { + var response = client.security.beginMFAPasskeyRegistration(secondfactorauthenticationtoken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `secondfactorauthenticationtoken` | query | string | yes | Second factor token | + +### Returns + +`object` + +--- + +## `beginPasskeyMFAVerification` + +**GET** `/identity/v2/auth/login/2fa/passkey/begin` + +Begin Passkey Login with MFA Token + +Begins the MFA Passkey verification flow. + +### Example + +```java +public static void callBeginPasskeyMFAVerification(LoginRadiusClient client) { + String secondfactorauthenticationtoken = "<secondfactorauthenticationtoken>"; //Required + + try { + var response = client.security.beginPasskeyMFAVerification(secondfactorauthenticationtoken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `secondfactorauthenticationtoken` | query | string | yes | Second factor token | + +### Returns + +`object` + +--- + +## `changePinByAccessToken` + +**PUT** `/identity/v2/auth/pin/change` + +Update PIN with Access Token + +Updates an existing PIN by providing the current PIN and a valid Access Token for authentication, allowing a User to change their PIN while logged in. + +### Example + +```java +public static void callChangePinByAccessToken(LoginRadiusClient client) { + ChangePin changePin = new ChangePin().oldpin("<oldpin>").newpin("<newpin>"); //Required + String accessToken = "<accessToken>"; //Optional + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String gRecaptchaResponse2 = "<gRecaptchaResponse2>"; //Optional + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Required + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Required + + try { + var response = client.security.changePinByAccessToken(changePin, accessToken, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `g_recaptcha_response` | query | string | no | Google reCAPTCHA Response | +| `h-captcha-response` | query | string | no | hCaptcha Response | +| `qq_captcha_ticket` | query | string | no | QQ Captcha ticket (required if Bot Protection is enabled) | +| `qq_captcha_randstr` | query | string | no | QQ Captcha rand string (required if Bot Protection is enabled) | + +### Request body + +`ChangePin` as `application/json`. + +### Returns + +`IsPostedResponse` + +--- + +## `duoAuthenticationReAuthVerificationByAccessToken` + +**PUT** `/identity/v2/auth/account/reauth/2fa/duo` + +Verify Duo + +Verifies Duo authentication for a User using an Access Token, typically used when re-verification is required. + +### Example + +```java +public static void callDuoAuthenticationReAuthVerificationByAccessToken(LoginRadiusClient client) { + DuoVerifyRequest duoVerifyRequest = new DuoVerifyRequest().state("<state>").code("<code>"); //Required + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + String accessToken = "<accessToken>"; //Optional + + try { + var response = client.security.duoAuthenticationReAuthVerificationByAccessToken(duoVerifyRequest, preventWebhook, xPreventWebhook, accessToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `access_token` | query | string | no | Access Token of the User | + +### Request body + +`DuoVerifyRequest` as `application/json`. + +### Returns + +`ReAuthResponse` + +--- + +## `duoAuthenticationVerificationByAccessToken` + +**PUT** `/identity/v2/auth/account/2fa/duo` + +Verify Duo authentication + +Verifies Duo authentication for a User using an Access Token, typically after initial authentication. + +### Example + +```java +public static void callDuoAuthenticationVerificationByAccessToken(LoginRadiusClient client) { + DuoVerifyRequest duoVerifyRequest = new DuoVerifyRequest().state("<state>").code("<code>"); //Required + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + String accessToken = "<accessToken>"; //Optional + String fields = "<fields>"; //Optional + + try { + var response = client.security.duoAuthenticationVerificationByAccessToken(duoVerifyRequest, preventWebhook, xPreventWebhook, accessToken, fields); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `access_token` | query | string | no | Access Token of the User | +| `fields` | query | string | no | Comma-separated list of profile fields to include in the response. | + +### Request body + +`DuoVerifyRequest` as `application/json`. + +### Returns + +`Profile` + +--- + +## `duoAuthVerificationByMFASecondFactorToken` + +**PUT** `/identity/v2/auth/login/2fa/duo` + +Verify Duo with MFA Token + +Verifies Duo authentication for a User using a second factor token. + +### Example + +```java +public static void callDuoAuthVerificationByMFASecondFactorToken(LoginRadiusClient client) { + String secondfactorauthenticationtoken = "<secondfactorauthenticationtoken>"; //Required + DuoVerifyRequest duoVerifyRequest = new DuoVerifyRequest().state("<state>").code("<code>"); //Required + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + String fields = "<fields>"; //Optional + String rbabrowseremailtemplate = "<rbabrowseremailtemplate>"; //Optional + String rbaoneclickemailtemplate = "<rbaoneclickemailtemplate>"; //Optional + String rbacityemailtemplate = "<rbacityemailtemplate>"; //Optional + String rbacountryemailtemplate = "<rbacountryemailtemplate>"; //Optional + String rbaipemailtemplate = "<rbaipemailtemplate>"; //Optional + String rbadeviceemailtemplate = "<rbadeviceemailtemplate>"; //Optional + String rbaotpsmstemplate = "<rbaotpsmstemplate>"; //Optional + String rbabrowsersmstemplate = "<rbabrowsersmstemplate>"; //Optional + String rbacitysmstemplate = "<rbacitysmstemplate>"; //Optional + String rbacountrysmstemplate = "<rbacountrysmstemplate>"; //Optional + String rbaipsmstemplate = "<rbaipsmstemplate>"; //Optional + String rbadevicesmstemplate = "<rbadevicesmstemplate>"; //Optional + + try { + var response = client.security.duoAuthVerificationByMFASecondFactorToken(secondfactorauthenticationtoken, duoVerifyRequest, preventWebhook, xPreventWebhook, fields, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `secondfactorauthenticationtoken` | query | string | yes | Second factor token | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `fields` | query | string | no | Comma-separated list of profile fields to include in the response. | +| `rbabrowseremailtemplate` | query | string | no | RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. | +| `rbaoneclickemailtemplate` | query | string | no | RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. | +| `rbacityemailtemplate` | query | string | no | RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. | +| `rbacountryemailtemplate` | query | string | no | RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. | +| `rbaipemailtemplate` | query | string | no | RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. | +| `rbadeviceemailtemplate` | query | string | no | RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. | +| `rbaotpsmstemplate` | query | string | no | RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbabrowsersmstemplate` | query | string | no | RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbacitysmstemplate` | query | string | no | RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbacountrysmstemplate` | query | string | no | RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbaipsmstemplate` | query | string | no | RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbadevicesmstemplate` | query | string | no | RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | + +### Request body + +`DuoVerifyRequest` as `application/json`. + +### Returns + +`AuthResponse` + +--- + +## `emailOTPAuthVerificationByAccessToken` + +**PUT** `/identity/v2/auth/account/2fa/email` + +Verify Email OTP + +Verifies Email OTP authentication for a User using an Access Token. + +### Example + +```java +public static void callEmailOTPAuthVerificationByAccessToken(LoginRadiusClient client) { + ReAuthModelByEmailOtp reAuthModelByEmailOtp = new ReAuthModelByEmailOtp().emailid("<emailid>").otp("<otp>"); //Required + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + String accessToken = "<accessToken>"; //Optional + String fields = "<fields>"; //Optional + + try { + var response = client.security.emailOTPAuthVerificationByAccessToken(reAuthModelByEmailOtp, preventWebhook, xPreventWebhook, accessToken, fields); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `access_token` | query | string | no | Access Token of the User | +| `fields` | query | string | no | Comma-separated list of profile fields to include in the response. | + +### Request body + +`ReAuthModelByEmailOtp` as `application/json`. + +### Returns + +`Profile` + +--- + +## `finishMFAPasskeyRegistration` + +**POST** `/identity/v2/auth/login/2fa/register/passkey/finish` + +Complete Passkey registration + +Completes the MFA Passkey registration process using the provided MFA token. + +### Example + +```java +public static void callFinishMFAPasskeyRegistration(LoginRadiusClient client) { + String secondfactorauthenticationtoken = "<secondfactorauthenticationtoken>"; //Required + FinishMFAPasskeyRegistrationRequest finishMFAPasskeyRegistrationRequest = new FinishMFAPasskeyRegistrationRequest().passkeyCredential("<passkeyCredential>"); //Required + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + String fields = "<fields>"; //Optional + String rbabrowseremailtemplate = "<rbabrowseremailtemplate>"; //Optional + String rbaoneclickemailtemplate = "<rbaoneclickemailtemplate>"; //Optional + String rbacityemailtemplate = "<rbacityemailtemplate>"; //Optional + String rbacountryemailtemplate = "<rbacountryemailtemplate>"; //Optional + String rbaipemailtemplate = "<rbaipemailtemplate>"; //Optional + String rbadeviceemailtemplate = "<rbadeviceemailtemplate>"; //Optional + String rbaotpsmstemplate = "<rbaotpsmstemplate>"; //Optional + String rbabrowsersmstemplate = "<rbabrowsersmstemplate>"; //Optional + String rbacitysmstemplate = "<rbacitysmstemplate>"; //Optional + String rbacountrysmstemplate = "<rbacountrysmstemplate>"; //Optional + String rbaipsmstemplate = "<rbaipsmstemplate>"; //Optional + String rbadevicesmstemplate = "<rbadevicesmstemplate>"; //Optional + + try { + var response = client.security.finishMFAPasskeyRegistration(secondfactorauthenticationtoken, finishMFAPasskeyRegistrationRequest, preventWebhook, xPreventWebhook, fields, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `secondfactorauthenticationtoken` | query | string | yes | Second factor token | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `fields` | query | string | no | Comma-separated list of profile fields to include in the response. | +| `rbabrowseremailtemplate` | query | string | no | RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. | +| `rbaoneclickemailtemplate` | query | string | no | RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. | +| `rbacityemailtemplate` | query | string | no | RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. | +| `rbacountryemailtemplate` | query | string | no | RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. | +| `rbaipemailtemplate` | query | string | no | RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. | +| `rbadeviceemailtemplate` | query | string | no | RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. | +| `rbaotpsmstemplate` | query | string | no | RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbabrowsersmstemplate` | query | string | no | RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbacitysmstemplate` | query | string | no | RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbacountrysmstemplate` | query | string | no | RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbaipsmstemplate` | query | string | no | RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbadevicesmstemplate` | query | string | no | RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | + +### Request body + +`object` as `application/json`. + +### Returns + +`AuthResponse` + +--- + +## `finishPasskeyMFAVerification` + +**POST** `/identity/v2/auth/login/2fa/passkey/finish` + +Complete Passkey Login with MFA Token + +Completes the MFA Passkey verification flow. + +### Example + +```java +public static void callFinishPasskeyMFAVerification(LoginRadiusClient client) { + String secondfactorauthenticationtoken = "<secondfactorauthenticationtoken>"; //Required + FinishPasskeyMFAVerificationRequest finishPasskeyMFAVerificationRequest = new FinishPasskeyMFAVerificationRequest().passkeyCredential("<passkeyCredential>"); //Required + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + String fields = "<fields>"; //Optional + String rbabrowseremailtemplate = "<rbabrowseremailtemplate>"; //Optional + String rbaoneclickemailtemplate = "<rbaoneclickemailtemplate>"; //Optional + String rbacityemailtemplate = "<rbacityemailtemplate>"; //Optional + String rbacountryemailtemplate = "<rbacountryemailtemplate>"; //Optional + String rbaipemailtemplate = "<rbaipemailtemplate>"; //Optional + String rbadeviceemailtemplate = "<rbadeviceemailtemplate>"; //Optional + String rbaotpsmstemplate = "<rbaotpsmstemplate>"; //Optional + String rbabrowsersmstemplate = "<rbabrowsersmstemplate>"; //Optional + String rbacitysmstemplate = "<rbacitysmstemplate>"; //Optional + String rbacountrysmstemplate = "<rbacountrysmstemplate>"; //Optional + String rbaipsmstemplate = "<rbaipsmstemplate>"; //Optional + String rbadevicesmstemplate = "<rbadevicesmstemplate>"; //Optional + + try { + var response = client.security.finishPasskeyMFAVerification(secondfactorauthenticationtoken, finishPasskeyMFAVerificationRequest, preventWebhook, xPreventWebhook, fields, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `secondfactorauthenticationtoken` | query | string | yes | Second factor token | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `fields` | query | string | no | Comma-separated list of profile fields to include in the response. | +| `rbabrowseremailtemplate` | query | string | no | RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. | +| `rbaoneclickemailtemplate` | query | string | no | RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. | +| `rbacityemailtemplate` | query | string | no | RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. | +| `rbacountryemailtemplate` | query | string | no | RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. | +| `rbaipemailtemplate` | query | string | no | RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. | +| `rbadeviceemailtemplate` | query | string | no | RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. | +| `rbaotpsmstemplate` | query | string | no | RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbabrowsersmstemplate` | query | string | no | RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbacitysmstemplate` | query | string | no | RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbacountrysmstemplate` | query | string | no | RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbaipsmstemplate` | query | string | no | RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbadevicesmstemplate` | query | string | no | RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | + +### Request body + +`object` as `application/json`. + +### Returns + +`AuthResponse` + +--- + +## `forgotPinByEmail` + +**POST** `/identity/v2/auth/pin/forgot/email` + +Send PIN Reset Email + +Sends a PIN reset Email to the User's registered Email, enabling them to reset their PIN if forgotten. + +### Example + +```java +public static void callForgotPinByEmail(LoginRadiusClient client) { + ForgotPinByEmail forgotPinByEmail = new ForgotPinByEmail().email("<email>"); //Required + String emailtemplate = "<emailtemplate>"; //Optional + String resetpinurl = "<resetpinurl>"; //Optional + + try { + var response = client.security.forgotPinByEmail(forgotPinByEmail, emailtemplate, resetpinurl); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `emailtemplate` | query | string | no | Name of the Email template to use for this notification. | +| `resetpinurl` | query | string | no | Reset PIN URL | + +### Request body + +`ForgotPinByEmail` as `application/json`. + +### Returns + +`IsPostedResponse` + +--- + +## `forgotPinByPhone` + +**POST** `/identity/v2/auth/pin/forgot/otp` + +Send OTP for PIN Reset + +Sends a One-Time Password (OTP) to the User's registered Phone number, enabling them to reset their PIN if forgotten. + +### Example + +```java +public static void callForgotPinByPhone(LoginRadiusClient client) { + ForgotPinByPhone forgotPinByPhone = new ForgotPinByPhone().phone("<phone>"); //Required + String smstemplate = "<smstemplate>"; //Optional + Boolean isvoiceotp = true; //Optional + + try { + var response = client.security.forgotPinByPhone(forgotPinByPhone, smstemplate, isvoiceotp); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `smstemplate` | query | string | no | SMS Template | +| `isvoiceotp` | query | boolean | no | Boolean flag to enforce sending SMS content via Voice. | + +### Request body + +`ForgotPinByPhone` as `application/json`. + +### Returns + +`SMSResponse` + +--- + +## `forgotPinByUsername` + +**POST** `/identity/v2/auth/pin/forgot/username` + +Send PIN Reset Email by Username + +Sends a PIN reset Email to the User IDentified by their Username, enabling them to reset their PIN if forgotten. + +### Example + +```java +public static void callForgotPinByUsername(LoginRadiusClient client) { + ForgotPinByUsername forgotPinByUsername = new ForgotPinByUsername().username("<username>"); //Required + String emailtemplate = "<emailtemplate>"; //Optional + String resetpinurl = "<resetpinurl>"; //Optional + + try { + var response = client.security.forgotPinByUsername(forgotPinByUsername, emailtemplate, resetpinurl); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `emailtemplate` | query | string | no | Name of the Email template to use for this notification. | +| `resetpinurl` | query | string | no | Reset PIN URL | + +### Request body + +`ForgotPinByUsername` as `application/json`. + +### Returns + +`IsPostedResponse` + +--- + +## `getMfaPushDeviceStatus` + +**GET** `/identity/v2/auth/account/2fa/push/ping` + +Check push device registration status + +Checks whether a Push Notification device is registered on the User's profile for MFA, using an Access Token. + +### Example + +```java +public static void callGetMfaPushDeviceStatus(LoginRadiusClient client) { + String accessToken = "<accessToken>"; //Optional + + try { + var response = client.security.getMfaPushDeviceStatus(accessToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | + +### Returns + +`IsRegistered` + +--- + +## `getMFASettings` + +**GET** `/identity/v2/auth/account/2fa` + +Retrieve MFA settings + +Retrieves all MFA settings configured for the User, including the status of each authenticator type and available configuration details. + +### Example + +```java +public static void callGetMFASettings(LoginRadiusClient client) { + String duoredirecturi = "<duoredirecturi>"; //Optional + String accessToken = "<accessToken>"; //Optional + + try { + var response = client.security.getMFASettings(duoredirecturi, accessToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `duoredirecturi` | query | string | no | Duo auth redirection url. | +| `access_token` | query | string | no | Access Token of the User | + +### Returns + +`TwoFactorAuthenticationSettings` + +--- + +## `mfaGenerateBackupCodes` + +**GET** `/identity/v2/auth/account/2fa/backupcode` + +Generate backup codes + +Generates a set of backup codes for a User with MFA enabled. Returns an error if backup codes already exist. + +### Example + +```java +public static void callMfaGenerateBackupCodes(LoginRadiusClient client) { + String accessToken = "<accessToken>"; //Optional + + try { + var response = client.security.mfaGenerateBackupCodes(accessToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | + +### Returns + +`MFABackUpCodeResponse` + +--- + +## `mfaResendPushNotification` + +**POST** `/identity/v2/auth/login/2fa/push` + +Resend Push Notification + +Resends a Push Notification for Multi-Factor Authentication. + +### Example + +```java +public static void callMfaResendPushNotification(LoginRadiusClient client) { + String secondfactorauthenticationtoken = "<secondfactorauthenticationtoken>"; //Required + + try { + var response = client.security.mfaResendPushNotification(secondfactorauthenticationtoken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `secondfactorauthenticationtoken` | query | string | yes | Second factor token | + +### Returns + +`IsPostedResponse` + +--- + +## `mfaResetBackupCodes` + +**GET** `/identity/v2/auth/account/2fa/backupcode/reset` + +Reset backup codes + +Resets backup codes for a User with MFA enabled, allowing regeneration of backup codes. + +### Example + +```java +public static void callMfaResetBackupCodes(LoginRadiusClient client) { + String accessToken = "<accessToken>"; //Optional + + try { + var response = client.security.mfaResetBackupCodes(accessToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | + +### Returns + +`MFABackUpCodeResponse` + +--- + +## `mFAResetSMSAuthByToken` + +**DELETE** `/identity/v2/auth/account/2fa/sms` + +Reset SMS Authenticator + +Resets SMS Authenticator configurations for an Account using an Access Token. + +### Example + +```java +public static void callMFAResetSMSAuthByToken(LoginRadiusClient client) { + String accessToken = "<accessToken>"; //Optional + + try { + var response = client.security.mFAResetSMSAuthByToken(accessToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | + +### Returns + +`IsDeleted` + +--- + +## `mFAResetTotpByToken` + +**DELETE** `/identity/v2/auth/account/2fa/totp` + +Reset TOTP + +Resets TOTP Authenticator configurations for an Account using an Access Token. + +### Example + +```java +public static void callMFAResetTotpByToken(LoginRadiusClient client) { + String accessToken = "<accessToken>"; //Optional + + try { + var response = client.security.mFAResetTotpByToken(accessToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | + +### Returns + +`IsDeleted` + +--- + +## `mFAUpdatePhoneNumberByMfaToken` + +**PUT** `/identity/v2/auth/login/2fa/sms/phone` + +Update Phone with MFA Token + +Sends a verification OTP to the provided Phone number as part of the process to update the Phone number used for Multi-Factor Authentication. + +### Example + +```java +public static void callMFAUpdatePhoneNumberByMfaToken(LoginRadiusClient client) { + String secondfactorauthenticationtoken = new String(); //Required + MFAPhoneUpdateModel mfAPhoneUpdateModel = "<mfAPhoneUpdateModel>"; //Required + String smstemplate2fa = "<smstemplate2fa>"; //Optional + Boolean isvoiceotp = true; //Optional + + try { + var response = client.security.mFAUpdatePhoneNumberByMfaToken(secondfactorauthenticationtoken, mfAPhoneUpdateModel, smstemplate2fa, isvoiceotp); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `secondfactorauthenticationtoken` | query | string | yes | Second factor token | +| `smstemplate2fa` | query | string | no | SMS template name to be used for sending the 2FA code to the User. | +| `isvoiceotp` | query | boolean | no | Boolean flag to enforce sending SMS content via Voice. | + +### Request body + +`MFAPhoneUpdateModel` as `application/json`. + +### Returns + +`SMSResponseData` + +--- + +## `mFAUpdatePhoneNumberByToken` + +**PUT** `/identity/v2/auth/account/2fa/sms/phone` + +Update Phone by token + +Sends a verification OTP to the provided Phone number as part of the process to update the Phone number used for MFA. + +### Example + +```java +public static void callMFAUpdatePhoneNumberByToken(LoginRadiusClient client) { + MFAPhoneUpdateModel mfAPhoneUpdateModel = new MFAPhoneUpdateModel().phoneno2fa("<phoneno2fa>"); //Required + String smstemplate2fa = "<smstemplate2fa>"; //Optional + Boolean isvoiceotp = true; //Optional + String accessToken = "<accessToken>"; //Optional + + try { + var response = client.security.mFAUpdatePhoneNumberByToken(mfAPhoneUpdateModel, smstemplate2fa, isvoiceotp, accessToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `smstemplate2fa` | query | string | no | SMS template name to be used for sending the 2FA code to the User. | +| `isvoiceotp` | query | boolean | no | Boolean flag to enforce sending SMS content via Voice. | +| `access_token` | query | string | no | Access Token of the User | + +### Request body + +`MFAPhoneUpdateModel` as `application/json`. + +### Returns + +`SMSResponseData` + +--- + +## `mFAVerifyPhoneNumberByAccessToken` + +**PUT** `/identity/v2/auth/account/2fa/sms` + +Verify Phone MFA + +Updates Phone-based MFA settings after a successful login, managing or verifying Phone MFA configurations for secure operations. + +### Example + +```java +public static void callMFAVerifyPhoneNumberByAccessToken(LoginRadiusClient client) { + MFAVerifyPhoneOtpModel mfAVerifyPhoneOtpModel = new MFAVerifyPhoneOtpModel().otp("<otp>"); //Required + String accessToken = "<accessToken>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + String fields = "<fields>"; //Optional + + try { + var response = client.security.mFAVerifyPhoneNumberByAccessToken(mfAVerifyPhoneOtpModel, accessToken, preventWebhook, xPreventWebhook, fields); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `fields` | query | string | no | Comma-separated list of profile fields to include in the response. | + +### Request body + +`MFAVerifyPhoneOtpModel` as `application/json`. + +### Returns + +`Profile` + +--- + +## `pingPushVerificationStatus` + +**GET** `/identity/v2/auth/login/2fa/push/ping` + +Check Push Notification Verification Status + +Checks the status of Push Notification verification and returns the login response when verified. + +### Example + +```java +public static void callPingPushVerificationStatus(LoginRadiusClient client) { + String secondfactorauthenticationtoken = "<secondfactorauthenticationtoken>"; //Required + String rbabrowseremailtemplate = "<rbabrowseremailtemplate>"; //Optional + String rbaoneclickemailtemplate = "<rbaoneclickemailtemplate>"; //Optional + String rbacityemailtemplate = "<rbacityemailtemplate>"; //Optional + String rbacountryemailtemplate = "<rbacountryemailtemplate>"; //Optional + String rbaipemailtemplate = "<rbaipemailtemplate>"; //Optional + String rbadeviceemailtemplate = "<rbadeviceemailtemplate>"; //Optional + String rbaotpsmstemplate = "<rbaotpsmstemplate>"; //Optional + String rbabrowsersmstemplate = "<rbabrowsersmstemplate>"; //Optional + String rbacitysmstemplate = "<rbacitysmstemplate>"; //Optional + String rbacountrysmstemplate = "<rbacountrysmstemplate>"; //Optional + String rbaipsmstemplate = "<rbaipsmstemplate>"; //Optional + String rbadevicesmstemplate = "<rbadevicesmstemplate>"; //Optional + + try { + var response = client.security.pingPushVerificationStatus(secondfactorauthenticationtoken, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `secondfactorauthenticationtoken` | query | string | yes | Second factor token | +| `rbabrowseremailtemplate` | query | string | no | RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. | +| `rbaoneclickemailtemplate` | query | string | no | RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. | +| `rbacityemailtemplate` | query | string | no | RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. | +| `rbacountryemailtemplate` | query | string | no | RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. | +| `rbaipemailtemplate` | query | string | no | RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. | +| `rbadeviceemailtemplate` | query | string | no | RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. | +| `rbaotpsmstemplate` | query | string | no | RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbabrowsersmstemplate` | query | string | no | RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbacitysmstemplate` | query | string | no | RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbacountrysmstemplate` | query | string | no | RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbaipsmstemplate` | query | string | no | RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbadevicesmstemplate` | query | string | no | RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | + +### Returns + +`AuthResponse` + +--- + +## `pINLogin` + +**POST** `/identity/v2/auth/login/pin` + +Login with PIN + +Allows Users to log in using their previously set PIN along with a valid session token. + +### Example + +```java +public static void callPINLogin(LoginRadiusClient client) { + String sessionToken = new String(); //Required + PINLoginModel piNLoginModel = "<piNLoginModel>"; //Required + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String gRecaptchaResponse2 = "<gRecaptchaResponse2>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Required + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Required + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + + try { + var response = client.security.pINLogin(sessionToken, piNLoginModel, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `session_token` | query | string | yes | Session Token for PIN Auth | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `g_recaptcha_response` | query | string | no | Google reCAPTCHA Response | +| `qq_captcha_ticket` | query | string | no | QQ Captcha ticket (required if Bot Protection is enabled) | +| `qq_captcha_randstr` | query | string | no | QQ Captcha rand string (required if Bot Protection is enabled) | +| `h-captcha-response` | query | string | no | hCaptcha Response | + +### Request body + +`PINLoginModel` as `application/json`. + +### Returns + +`AuthResponse` + +--- + +## `reauthPassword` + +**PUT** `/identity/v2/auth/account/reauth/password` + +Verify Password + +Verifies the Password for a User using an Access Token, typically used when re-verification is required. + +### Example + +```java +public static void callReauthPassword(LoginRadiusClient client) { + PasswordReauthRequest passwordReauthRequest = new PasswordReauthRequest().g-recaptcha-response("<g-recaptcha-response>").qq_captcha_ticket("<qq_captcha_ticket>").qq_captcha_randstr("<qq_captcha_randstr>"); //Required + String accessToken = "<accessToken>"; //Optional + String smstemplate = "<smstemplate>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String gRecaptchaResponse2 = "<gRecaptchaResponse2>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Optional + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Optional + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + + try { + var response = client.security.reauthPassword(passwordReauthRequest, accessToken, smstemplate, preventWebhook, xPreventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | +| `smstemplate` | query | string | no | SMS Template | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `g_recaptcha_response` | query | string | no | Google reCAPTCHA Response | +| `qq_captcha_ticket` | query | string | no | QQ reCAPTCHA Response | +| `qq_captcha_randstr` | query | string | no | QQ reCAPTCHA Response | +| `h-captcha-response` | query | string | no | hCaptcha Response | + +### Request body + +`PasswordReauthRequest` as `application/json`. + +### Returns + +`ReAuthResponse` + +--- + +## `reauthPin` + +**PUT** `/identity/v2/auth/account/reauth/pin` + +Verify PIN + +Verifies the PIN for a User using an Access Token, typically used when re-verification is required. + +### Example + +```java +public static void callReauthPin(LoginRadiusClient client) { + PinReauthRequest pinReauthRequest = new PinReauthRequest().pin("<pin>"); //Required + String smstemplate = "<smstemplate>"; //Optional + String accessToken = "<accessToken>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + + try { + var response = client.security.reauthPin(pinReauthRequest, smstemplate, accessToken, preventWebhook, xPreventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `smstemplate` | query | string | no | SMS Template | +| `access_token` | query | string | no | Access Token of the User | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | + +### Request body + +`PinReauthRequest` as `application/json`. + +### Returns + +`ReAuthResponse` + +--- + +## `reauthTrigger` + +**GET** `/identity/v2/auth/account/reauth/2fa` + +Retrieve Step-Up Authentication settings + +Triggers Step-Up Authentication for Multi-Factor Authentication (MFA) settings, allowing Users to verify their MFA methods. + +### Example + +```java +public static void callReauthTrigger(LoginRadiusClient client) { + String accessToken = "<accessToken>"; //Optional + String smstemplate2fa = "<smstemplate2fa>"; //Optional + String duoredirecturi = "<duoredirecturi>"; //Optional + + try { + var response = client.security.reauthTrigger(accessToken, smstemplate2fa, duoredirecturi); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | +| `smstemplate2fa` | query | string | no | SMS template name to be used for sending the 2FA code to the User. | +| `duoredirecturi` | query | string | no | Duo auth redirection url. | + +### Returns + +`TwoFactorAuthenticationSettings` + +--- + +## `resend2FAOTP` + +**GET** `/identity/v2/auth/login/2fa/resend` + +Resend SMS OTP with MFA Token + +Resends the Multi-Factor Authentication OTP via SMS for login. + +### Example + +```java +public static void callResend2FAOTP(LoginRadiusClient client) { + String secondfactorauthenticationtoken = "<secondfactorauthenticationtoken>"; //Required + Boolean isvoiceotp = true; //Optional + + try { + var response = client.security.resend2FAOTP(secondfactorauthenticationtoken, isvoiceotp); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `secondfactorauthenticationtoken` | query | string | yes | Second factor token | +| `isvoiceotp` | query | boolean | no | Boolean flag to enforce sending SMS content via Voice. | + +### Returns + +`SMSResponseData` + +--- + +## `resend2faSMSOtp` + +**GET** `/identity/v2/auth/login/2fa/sms/resend` + +Resend SMS OTP with MFA Token + +Resends the Multi-Factor Authentication OTP via SMS for login. + +### Example + +```java +public static void callResend2faSMSOtp(LoginRadiusClient client) { + String secondfactorauthenticationtoken = "<secondfactorauthenticationtoken>"; //Required + Boolean isvoiceotp = true; //Optional + + try { + var response = client.security.resend2faSMSOtp(secondfactorauthenticationtoken, isvoiceotp); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `secondfactorauthenticationtoken` | query | string | yes | Second factor token | +| `isvoiceotp` | query | boolean | no | Boolean flag to enforce sending SMS content via Voice. | + +### Returns + +`SMSResponseData` + +--- + +## `resendEmailOTPMFAToken` + +**POST** `/identity/v2/auth/login/2fa/email` + +Resend Email OTP with MFA Token + +Sends the OTP to the Email if the Email OTP authenticator is enabled in the Tenant's MFA configuration. + +### Example + +```java +public static void callResendEmailOTPMFAToken(LoginRadiusClient client) { + String secondfactorauthenticationtoken = "<secondfactorauthenticationtoken>"; //Required + EmailModel emailModel = new EmailModel().email("<email>"); //Required + Boolean isvoiceotp = true; //Optional + String emailtemplate2fa = "<emailtemplate2fa>"; //Optional + + try { + var response = client.security.resendEmailOTPMFAToken(secondfactorauthenticationtoken, emailModel, isvoiceotp, emailtemplate2fa); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `secondfactorauthenticationtoken` | query | string | yes | Second factor token | +| `isvoiceotp` | query | boolean | no | Boolean flag to enforce sending SMS content via Voice. | +| `emailtemplate2fa` | query | string | no | Name of the 2FA Email template to use for this notification. | + +### Request body + +`EmailModel` as `application/json`. + +### Returns + +`IsPostedResponse` + +--- + +## `resendTwoFactorEmailOtp` + +**GET** `/identity/v2/auth/account/2fa/email` + +Resend Email OTP + +Sends the OTP to the Email if the Email OTP Authenticator is enabled in the Tenant's MFA configuration. + +### Example + +```java +public static void callResendTwoFactorEmailOtp(LoginRadiusClient client) { + String emailid = "<emailid>"; //Optional + String emailtemplate2fa = "<emailtemplate2fa>"; //Optional + String accessToken = "<accessToken>"; //Optional + + try { + var response = client.security.resendTwoFactorEmailOtp(emailid, emailtemplate2fa, accessToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `emailid` | query | string (email) | no | The Email address of User | +| `emailtemplate2fa` | query | string | no | Name of the 2FA Email template to use for this notification. | +| `access_token` | query | string | no | Access Token of the User | + +### Returns + +`IsPostedResponse` + +--- + +## `resetDuoAuthViaAccessToken` + +**DELETE** `/identity/v2/auth/account/2fa/duo` + +Reset Duo Authenticator + +Resets the Duo Authenticator settings for a User with MFA enabled, allowing reconfiguration or recovery of Duo access. + +### Example + +```java +public static void callResetDuoAuthViaAccessToken(LoginRadiusClient client) { + String accessToken = "<accessToken>"; //Optional + + try { + var response = client.security.resetDuoAuthViaAccessToken(accessToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | + +### Returns + +`IsDeleted` + +--- + +## `resetMFAEmailAuthByAccessToken` + +**DELETE** `/identity/v2/auth/account/2fa/email` + +Reset Email OTP Authenticator + +Resets the Email OTP Authenticator settings for a User with MFA enabled, allowing reconfiguration. + +### Example + +```java +public static void callResetMFAEmailAuthByAccessToken(LoginRadiusClient client) { + String accessToken = "<accessToken>"; //Optional + + try { + var response = client.security.resetMFAEmailAuthByAccessToken(accessToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | + +### Returns + +`IsDeleted` + +--- + +## `resetMFAPasskeyByAccessToken` + +**DELETE** `/identity/v2/auth/account/2fa/passkey` + +Reset Passkey Authenticator + +Resets the Passkey Authenticator settings for the specified User. + +### Example + +```java +public static void callResetMFAPasskeyByAccessToken(LoginRadiusClient client) { + String accessToken = "<accessToken>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + + try { + var response = client.security.resetMFAPasskeyByAccessToken(accessToken, preventWebhook, xPreventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | + +### Returns + +`IsDeleted` + +--- + +## `resetMfaPushAuthSettings` + +**DELETE** `/identity/v2/auth/account/2fa/push` + +Reset MFA Push Notification + +Resets the MFA Push Authenticator settings for a User. + +### Example + +```java +public static void callResetMfaPushAuthSettings(LoginRadiusClient client) { + try { + var response = client.security.resetMfaPushAuthSettings(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`IsDeleted` + +--- + +## `resetPinByOTP` + +**PUT** `/identity/v2/auth/pin/reset/otp/{type}` + +Reset PIN with OTP + +Allows a User to reset their PIN by verifying a One-Time Password (OTP). The User must provide the OTP, a new PIN, and one identifier (Phone, Email, or Username), enabling secure PIN recovery when the User forgets their PIN. + +### Example + +```java +public static void callResetPinByOTP(LoginRadiusClient client) { + String type = "<type>"; //Required + ResetPINByOTP resetPINByOTP = new ResetPINByOTP().otp("<otp>").pin("<pin>"); //Required + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String gRecaptchaResponse2 = "<gRecaptchaResponse2>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Required + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Required + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + + try { + var response = client.security.resetPinByOTP(type, resetPINByOTP, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `type` | path | string | yes | The method of ReAuth MFA verification to use. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `g_recaptcha_response` | query | string | no | Google reCAPTCHA Response | +| `qq_captcha_ticket` | query | string | no | QQ Captcha ticket (required if Bot Protection is enabled) | +| `qq_captcha_randstr` | query | string | no | QQ Captcha rand string (required if Bot Protection is enabled) | +| `h-captcha-response` | query | string | no | hCaptcha Response | + +### Request body + +`ResetPINByOTP` as `application/json`. + +### Returns + +`IsPostedResponse` + +--- + +## `resetPinByResetToken` + +**PUT** `/identity/v2/auth/pin/reset/token` + +Reset PIN with Reset Token + +Allows a User to reset their PIN by providing a reset token received via Email and a new PIN, enabling secure PIN recovery when the User forgets their PIN. + +### Example + +```java +public static void callResetPinByResetToken(LoginRadiusClient client) { + ResetPINByToken resetPINByToken = new ResetPINByToken().resettoken("<resettoken>").pin("<pin>"); //Required + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + + try { + var response = client.security.resetPinByResetToken(resetPINByToken, xPreventWebhook, preventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | + +### Request body + +`ResetPINByToken` as `application/json`. + +### Returns + +`IsPostedResponse` + +--- + +## `sendEmailOtpForReauthMFA` + +**GET** `/identity/v2/auth/account/reauth/2fa/email` + +Send Email OTP + +Sends a One-Time Password (OTP) to the User's Email for re-authentication. + +### Example + +```java +public static void callSendEmailOtpForReauthMFA(LoginRadiusClient client) { + String emailid = "<emailid>"; //Optional + String emailtemplate = "<emailtemplate>"; //Optional + String accessToken = "<accessToken>"; //Optional + + try { + var response = client.security.sendEmailOtpForReauthMFA(emailid, emailtemplate, accessToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `emailid` | query | string (email) | no | The Email address of User | +| `emailtemplate` | query | string | no | Name of the Email template to use for this notification. | +| `access_token` | query | string | no | Access Token of the User | + +### Returns + +`IsPostedResponse` + +--- + +## `sendReAuthEmailOtp` + +**GET** `/identity/v2/auth/account/reauth/otp/email` + +Send Email OTP + +Sends a One-Time Password (OTP) to the User's Email for re-authentication. + +### Example + +```java +public static void callSendReAuthEmailOtp(LoginRadiusClient client) { + String emailid = "<emailid>"; //Optional + String emailtemplate = "<emailtemplate>"; //Optional + String accessToken = "<accessToken>"; //Optional + + try { + var response = client.security.sendReAuthEmailOtp(emailid, emailtemplate, accessToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `emailid` | query | string (email) | no | The Email address of User | +| `emailtemplate` | query | string | no | Name of the Email template to use for this notification. | +| `access_token` | query | string | no | Access Token of the User | + +### Returns + +`IsPostedResponse` + +--- + +## `setPinByPinAuthToken` + +**POST** `/identity/v2/auth/pin/set/pinauthtoken` + +Set PIN with Authentication Token + +Sets a PIN for Users logging in or registering for the first time. Requires a valid PIN authentication token and is typically part of the onboarding or initial setup process. + +### Example + +```java +public static void callSetPinByPinAuthToken(LoginRadiusClient client) { + String pinauthtoken = new String(); //Required + PINModel piNModel = "<piNModel>"; //Required + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + + try { + var response = client.security.setPinByPinAuthToken(pinauthtoken, piNModel, xPreventWebhook, preventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `pinauthtoken` | query | string | yes | Pin auth token to set the PIN on account | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | + +### Request body + +`PINModel` as `application/json`. + +### Returns + +`AuthResponse` + +--- + +## `validateEmailOtpForReauth` + +**PUT** `/identity/v2/auth/account/reauth/otp/email` + +Verify Email OTP + +Validates the One-Time Password (OTP) sent to the User's Email during re-authentication. + +### Example + +```java +public static void callValidateEmailOtpForReauth(LoginRadiusClient client) { + ReAuthModelByEmailOtp reAuthModelByEmailOtp = new ReAuthModelByEmailOtp().emailid("<emailid>").otp("<otp>"); //Required + String accessToken = "<accessToken>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + + try { + var response = client.security.validateEmailOtpForReauth(reAuthModelByEmailOtp, accessToken, preventWebhook, xPreventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | + +### Request body + +`ReAuthModelByEmailOtp` as `application/json`. + +### Returns + +`ReAuthResponse` + +--- + +## `validateEmailOtpForReauthMFA` + +**PUT** `/identity/v2/auth/account/reauth/2fa/otp/email/verify` + +Verify Email OTP + +Verifies the User with Email OTP and Access Token, typically used when re-authentication via Email OTP is required. + +### Example + +```java +public static void callValidateEmailOtpForReauthMFA(LoginRadiusClient client) { + ReAuthModelByEmailOtp reAuthModelByEmailOtp = new ReAuthModelByEmailOtp().emailid("<emailid>").otp("<otp>"); //Required + String accessToken = "<accessToken>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + + try { + var response = client.security.validateEmailOtpForReauthMFA(reAuthModelByEmailOtp, accessToken, preventWebhook, xPreventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | + +### Request body + +`ReAuthModelByEmailOtp` as `application/json`. + +### Returns + +`ReAuthResponse` + +--- + +## `validateMfaOTPByEmail` + +**PUT** `/identity/v2/auth/login/2fa/email` + +Verify Email OTP with MFA Token + +Logs in to a User's account during the second MFA step with an OTP sent to the Email. + +### Example + +```java +public static void callValidateMfaOTPByEmail(LoginRadiusClient client) { + String secondfactorauthenticationtoken = "<secondfactorauthenticationtoken>"; //Required + ReAuthModelByEmailOtp reAuthModelByEmailOtp = new ReAuthModelByEmailOtp().emailid("<emailid>").otp("<otp>"); //Required + String rbabrowseremailtemplate = "<rbabrowseremailtemplate>"; //Optional + String rbacityemailtemplate = "<rbacityemailtemplate>"; //Optional + String rbacountryemailtemplate = "<rbacountryemailtemplate>"; //Optional + String rbaipemailtemplate = "<rbaipemailtemplate>"; //Optional + String rbadeviceemailtemplate = "<rbadeviceemailtemplate>"; //Optional + String rbabrowsersmstemplate = "<rbabrowsersmstemplate>"; //Optional + String rbacitysmstemplate = "<rbacitysmstemplate>"; //Optional + String rbacountrysmstemplate = "<rbacountrysmstemplate>"; //Optional + String rbaipsmstemplate = "<rbaipsmstemplate>"; //Optional + String rbadevicesmstemplate = "<rbadevicesmstemplate>"; //Optional + + try { + var response = client.security.validateMfaOTPByEmail(secondfactorauthenticationtoken, reAuthModelByEmailOtp, rbabrowseremailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `secondfactorauthenticationtoken` | query | string | yes | Second factor token | +| `rbabrowseremailtemplate` | query | string | no | RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. | +| `rbacityemailtemplate` | query | string | no | RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. | +| `rbacountryemailtemplate` | query | string | no | RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. | +| `rbaipemailtemplate` | query | string | no | RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. | +| `rbadeviceemailtemplate` | query | string | no | RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. | +| `rbabrowsersmstemplate` | query | string | no | RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbacitysmstemplate` | query | string | no | RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbacountrysmstemplate` | query | string | no | RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbaipsmstemplate` | query | string | no | RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbadevicesmstemplate` | query | string | no | RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | + +### Request body + +`ReAuthModelByEmailOtp` as `application/json`. + +### Returns + +`AuthResponse` + +--- + +## `validateMfaOTPByPhone` + +**PUT** `/identity/v2/auth/login/2fa/sms` + +Verify SMS OTP + +Allows Users to log in with Multi-Factor Authentication using the OTP sent via SMS or Voice OTP. + +### Example + +```java +public static void callValidateMfaOTPByPhone(LoginRadiusClient client) { + String secondfactorauthenticationtoken = new String(); //Required + MFAVerifyPhoneOtpModel mfAVerifyPhoneOtpModel = "<mfAVerifyPhoneOtpModel>"; //Required + String smstemplate2fa = "<smstemplate2fa>"; //Optional + String fields = "<fields>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + Boolean isvoiceotp = true; //Optional + String rbabrowseremailtemplate = "<rbabrowseremailtemplate>"; //Optional + String rbacityemailtemplate = "<rbacityemailtemplate>"; //Optional + String rbacountryemailtemplate = "<rbacountryemailtemplate>"; //Optional + String rbaipemailtemplate = "<rbaipemailtemplate>"; //Optional + String rbadeviceemailtemplate = "<rbadeviceemailtemplate>"; //Optional + String rbaotpsmstemplate = "<rbaotpsmstemplate>"; //Optional + String rbabrowsersmstemplate = "<rbabrowsersmstemplate>"; //Optional + String rbacitysmstemplate = "<rbacitysmstemplate>"; //Optional + String rbacountrysmstemplate = "<rbacountrysmstemplate>"; //Optional + String rbaipsmstemplate = "<rbaipsmstemplate>"; //Optional + String rbadevicesmstemplate = "<rbadevicesmstemplate>"; //Optional + + try { + var response = client.security.validateMfaOTPByPhone(secondfactorauthenticationtoken, mfAVerifyPhoneOtpModel, smstemplate2fa, fields, preventWebhook, xPreventWebhook, isvoiceotp, rbabrowseremailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `secondfactorauthenticationtoken` | query | string | yes | Second factor token | +| `smstemplate2fa` | query | string | no | SMS template name to be used for sending the 2FA code to the User. | +| `fields` | query | string | no | Comma-separated list of profile fields to include in the response. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `isvoiceotp` | query | boolean | no | Boolean flag to enforce sending SMS content via Voice. | +| `rbabrowseremailtemplate` | query | string | no | RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. | +| `rbacityemailtemplate` | query | string | no | RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. | +| `rbacountryemailtemplate` | query | string | no | RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. | +| `rbaipemailtemplate` | query | string | no | RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. | +| `rbadeviceemailtemplate` | query | string | no | RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. | +| `rbaotpsmstemplate` | query | string | no | RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbabrowsersmstemplate` | query | string | no | RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbacitysmstemplate` | query | string | no | RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbacountrysmstemplate` | query | string | no | RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbaipsmstemplate` | query | string | no | RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbadevicesmstemplate` | query | string | no | RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | + +### Request body + +`MFAVerifyPhoneOtpModel` as `application/json`. + +### Returns + +`AuthResponse` + +--- + +## `validateReauthMFA` + +**PUT** `/identity/v2/auth/account/reauth/2fa/{type}` + +Verify backup code or OTP + +Validates the triggered MFA authentication flow using a backup code, OTP, or authenticator code. + +### Example + +```java +public static void callValidateReauthMFA(LoginRadiusClient client) { + String type = "<type>"; //Required + ReAuthTwoFAModel reAuthTwoFAModel = new ReAuthTwoFAModel().g-recaptcha-response("<g-recaptcha-response>").qq_captcha_ticket("<qq_captcha_ticket>").qq_captcha_randstr("<qq_captcha_randstr>"); //Required + String accessToken = "<accessToken>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String gRecaptchaResponse2 = "<gRecaptchaResponse2>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Optional + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Optional + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + + try { + var response = client.security.validateReauthMFA(type, reAuthTwoFAModel, accessToken, preventWebhook, xPreventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `type` | path | string | yes | The method of ReAuth MFA verification to use. | +| `access_token` | query | string | no | Access Token of the User | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `g_recaptcha_response` | query | string | no | Google reCAPTCHA Response | +| `qq_captcha_ticket` | query | string | no | QQ reCAPTCHA Response | +| `qq_captcha_randstr` | query | string | no | QQ reCAPTCHA Response | +| `h-captcha-response` | query | string | no | hCaptcha Response | + +### Request body + +`ReAuthTwoFAModel` as `application/json`. + +### Returns + +`ReAuthResponse` + +--- + +## `validateSecurityQuestionReauthMFA` + +**POST** `/identity/v2/auth/account/reauth/2fa/securityquestionanswer/verify` + +Verify security question answer + +Validates the triggered MFA authentication flow using a security question answer. + +### Example + +```java +public static void callValidateSecurityQuestionReauthMFA(LoginRadiusClient client) { + TwoFAAuthBySecQuesAuthModel twoFAAuthBySecQuesAuthModel = new TwoFAAuthBySecQuesAuthModel().securityquestionanswer("<securityquestionanswer>"); //Required + String accessToken = "<accessToken>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + + try { + var response = client.security.validateSecurityQuestionReauthMFA(twoFAAuthBySecQuesAuthModel, accessToken, preventWebhook, xPreventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | + +### Request body + +`TwoFAAuthBySecQuesAuthModel` as `application/json`. + +### Returns + +`ReAuthResponse` + +--- + +## `verify2faTOTPAuth` + +**PUT** `/identity/v2/auth/account/2fa/totp` + +Verify TOTP code + +Validates an Authenticator Code as part of the MFA process. + +### Example + +```java +public static void callVerify2faTOTPAuth(LoginRadiusClient client) { + AuthenticatorCodeRequest authenticatorCodeRequest = new AuthenticatorCodeRequest().googleauthenticatorcode("<googleauthenticatorcode>").authenticatorcode("<authenticatorcode>"); //Required + String accessToken = "<accessToken>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + + try { + var response = client.security.verify2faTOTPAuth(authenticatorCodeRequest, accessToken, preventWebhook, xPreventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | + +### Request body + +`AuthenticatorCodeRequest` as `application/json`. + +### Returns + +`IdentityResponseWithSocialWithoutLogins` + +--- + +## `verifyBackupCodeForMFALogin` + +**PUT** `/identity/v2/auth/login/2fa/backupcode` + +Verify Backup Code with MFA Token + +Verifies a User's MFA backup code as a second factor during the login process, typically used when the primary MFA method is unavailable. + +### Example + +```java +public static void callVerifyBackupCodeForMFALogin(LoginRadiusClient client) { + String secondfactorauthenticationtoken = "<secondfactorauthenticationtoken>"; //Required + TwoFAAuthByBackupCode twoFAAuthByBackupCode = new TwoFAAuthByBackupCode().backupcode("<backupcode>"); //Required + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + String rbabrowseremailtemplate = "<rbabrowseremailtemplate>"; //Optional + String rbacityemailtemplate = "<rbacityemailtemplate>"; //Optional + String rbacountryemailtemplate = "<rbacountryemailtemplate>"; //Optional + String rbaipemailtemplate = "<rbaipemailtemplate>"; //Optional + String rbadeviceemailtemplate = "<rbadeviceemailtemplate>"; //Optional + String rbabrowsersmstemplate = "<rbabrowsersmstemplate>"; //Optional + String rbacitysmstemplate = "<rbacitysmstemplate>"; //Optional + String rbacountrysmstemplate = "<rbacountrysmstemplate>"; //Optional + String rbaipsmstemplate = "<rbaipsmstemplate>"; //Optional + String rbadevicesmstemplate = "<rbadevicesmstemplate>"; //Optional + + try { + var response = client.security.verifyBackupCodeForMFALogin(secondfactorauthenticationtoken, twoFAAuthByBackupCode, preventWebhook, xPreventWebhook, rbabrowseremailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `secondfactorauthenticationtoken` | query | string | yes | Second factor token | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `rbabrowseremailtemplate` | query | string | no | RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. | +| `rbacityemailtemplate` | query | string | no | RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. | +| `rbacountryemailtemplate` | query | string | no | RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. | +| `rbaipemailtemplate` | query | string | no | RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. | +| `rbadeviceemailtemplate` | query | string | no | RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. | +| `rbabrowsersmstemplate` | query | string | no | RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbacitysmstemplate` | query | string | no | RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbacountrysmstemplate` | query | string | no | RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbaipsmstemplate` | query | string | no | RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbadevicesmstemplate` | query | string | no | RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | + +### Request body + +`TwoFAAuthByBackupCode` as `application/json`. + +### Returns + +`AuthResponse` + +--- + +## `verifyTotpByMfaToken` + +**PUT** `/identity/v2/auth/login/2fa/totp` + +Verify TOTP Code with MFA Token + +Validates the TOTP Authenticator code provided by the User as part of the Multi-Factor Authentication login process. + +### Example + +```java +public static void callVerifyTotpByMfaToken(LoginRadiusClient client) { + String secondfactorauthenticationtoken = "<secondfactorauthenticationtoken>"; //Required + AuthenticatorCodeRequest authenticatorCodeRequest = new AuthenticatorCodeRequest().googleauthenticatorcode("<googleauthenticatorcode>").authenticatorcode("<authenticatorcode>"); //Required + String fields = "<fields>"; //Optional + String rbabrowseremailtemplate = "<rbabrowseremailtemplate>"; //Optional + String rbacityemailtemplate = "<rbacityemailtemplate>"; //Optional + String rbacountryemailtemplate = "<rbacountryemailtemplate>"; //Optional + String rbaipemailtemplate = "<rbaipemailtemplate>"; //Optional + String rbadeviceemailtemplate = "<rbadeviceemailtemplate>"; //Optional + String rbabrowsersmstemplate = "<rbabrowsersmstemplate>"; //Optional + String rbacitysmstemplate = "<rbacitysmstemplate>"; //Optional + String rbacountrysmstemplate = "<rbacountrysmstemplate>"; //Optional + String rbaipsmstemplate = "<rbaipsmstemplate>"; //Optional + String rbadevicesmstemplate = "<rbadevicesmstemplate>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + + try { + var response = client.security.verifyTotpByMfaToken(secondfactorauthenticationtoken, authenticatorCodeRequest, fields, rbabrowseremailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, preventWebhook, xPreventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `secondfactorauthenticationtoken` | query | string | yes | Second factor token | +| `fields` | query | string | no | Comma-separated list of profile fields to include in the response. | +| `rbabrowseremailtemplate` | query | string | no | RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. | +| `rbacityemailtemplate` | query | string | no | RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. | +| `rbacountryemailtemplate` | query | string | no | RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. | +| `rbaipemailtemplate` | query | string | no | RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. | +| `rbadeviceemailtemplate` | query | string | no | RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. | +| `rbabrowsersmstemplate` | query | string | no | RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbacitysmstemplate` | query | string | no | RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbacountrysmstemplate` | query | string | no | RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbaipsmstemplate` | query | string | no | RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `rbadevicesmstemplate` | query | string | no | RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | + +### Request body + +`AuthenticatorCodeRequest` as `application/json`. + +### Returns + +`AuthResponse` + diff --git a/docs/apis/session.md b/docs/apis/session.md new file mode 100644 index 0000000..3bae638 --- /dev/null +++ b/docs/apis/session.md @@ -0,0 +1,111 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Session + +3 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `authValidateAccessToken` + +**GET** `/identity/v2/auth/access_token/validate` + +Validate Access Token + +Validates an Access Token, returning its expiry if valid, or an error if invalid. + +### Example + +```java +public static void callAuthValidateAccessToken(LoginRadiusClient client) { + String accessToken = "<accessToken>"; //Optional + + try { + var response = client.session.authValidateAccessToken(accessToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | + +### Returns + +`AccessTokenResponse` + +--- + +## `getAccessTokenInfo` + +**GET** `/identity/v2/auth/access_token` + +Retrieve Access Token information + +Obtains detailed information about the provided Access Token. + +### Example + +```java +public static void callGetAccessTokenInfo(LoginRadiusClient client) { + try { + var response = client.session.getAccessTokenInfo(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`AccessTokenInfo` + +--- + +## `invalidateAccessToken` + +**GET** `/identity/v2/auth/access_token/invalidate` + +Invalidate Access Token + +Invalidates an active Access Token, expiring its validity. + +### Example + +```java +public static void callInvalidateAccessToken(LoginRadiusClient client) { + Boolean preventRefresh = true; //Optional + + try { + var response = client.session.invalidateAccessToken(preventRefresh); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `preventRefresh` | query | boolean | no | Whether to prevent the token from being refreshed (true/false). | + +### Returns + +`IsPostedResponse` + diff --git a/docs/apis/shopify-sso.md b/docs/apis/shopify-sso.md new file mode 100644 index 0000000..b9054e5 --- /dev/null +++ b/docs/apis/shopify-sso.md @@ -0,0 +1,51 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Shopify SSO + +1 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `getShopifyLoginUrl` + +**GET** `/sso/shopify/api/token` + +Generate Shopify Multipass Login URL + +Generates a Shopify Multipass login URL using the provided LoginRadius access token. Uses Shopify's Multipass feature to create a single sign-on URL that authenticates the user into the Shopify store. + +### Example + +```java +public static void callGetShopifyLoginUrl(LoginRadiusClient client) { + String accessToken = "<accessToken>"; //Required + String store = "<store>"; //Required + String returnUrl = "<returnUrl>"; //Optional + + try { + var response = client.shopifySso.getShopifyLoginUrl(accessToken, store, returnUrl); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | yes | Access Token of the User | +| `store` | query | string | yes | Shopify store domain (e.g., mystore.myshopify.com) | +| `return_url` | query | string | no | URL to redirect the user to after login | + +### Returns + +`ShopifyLoginUrlResponse` + diff --git a/docs/apis/sms-templates.md b/docs/apis/sms-templates.md new file mode 100644 index 0000000..aec6b7e --- /dev/null +++ b/docs/apis/sms-templates.md @@ -0,0 +1,155 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# SMS Templates + +4 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `createSmsTemplate` + +**POST** `/v2/manage/smstemplates` + +Create SMS template + +Creates a new SMS template for a specified customer and Tenant. + +### Example + +```java +public static void callCreateSmsTemplate(LoginRadiusClient client) { + SmsTemplate smsTemplate = new SmsTemplate().smsTemplateType("<smsTemplateType>").name("<name>").template("<template>"); //Required + + try { + var response = client.smsTemplates.createSmsTemplate(smsTemplate); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`SmsTemplate` as `application/json`. + +### Returns + +`SmsTemplate` + +--- + +## `deleteSmsTemplate` + +**DELETE** `/v2/manage/sms-templates/{templateType}` + +Delete SMS template + +Deletes an SMS template by its type for a specified customer and Tenant. + +### Example + +```java +public static void callDeleteSmsTemplate(LoginRadiusClient client) { + String templateType = "<templateType>"; //Required + DeleteSmsTemplateModel deleteSmsTemplateModel = new DeleteSmsTemplateModel().name("<name>"); //Required + + try { + var response = client.smsTemplates.deleteSmsTemplate(templateType, deleteSmsTemplateModel); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `templateType` | path | string | yes | The type of SMS template to delete. | + +### Request body + +`DeleteSmsTemplateModel` as `application/json`. + +### Returns + +`DeleteResponse` + +--- + +## `getSmsTemplates` + +**GET** `/v2/manage/smstemplates` + +List SMS templates + +Retrieves a list of SMS templates for a specified customer and Tenant. + +### Example + +```java +public static void callGetSmsTemplates(LoginRadiusClient client) { + try { + var response = client.smsTemplates.getSmsTemplates(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`object` + +--- + +## `updateSmsTemplate` + +**PUT** `/v2/manage/sms-templates/{templateType}` + +Update SMS template + +Updates an existing SMS template by its type for a specified customer and Tenant. + +### Example + +```java +public static void callUpdateSmsTemplate(LoginRadiusClient client) { + String templateType = "<templateType>"; //Required + UpdateSmsTemplateModel updateSmsTemplateModel = new UpdateSmsTemplateModel().name("<name>").template("<template>").isActive(true); //Required + + try { + var response = client.smsTemplates.updateSmsTemplate(templateType, updateSmsTemplateModel); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `templateType` | path | string | yes | The type of SMS template to delete. | + +### Request body + +`UpdateSmsTemplateModel` as `application/json`. + +### Returns + +`SmsTemplate` + diff --git a/docs/apis/social-providers.md b/docs/apis/social-providers.md new file mode 100644 index 0000000..3e31b03 --- /dev/null +++ b/docs/apis/social-providers.md @@ -0,0 +1,248 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Social Providers + +7 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `deleteSocialProviderByName` + +**DELETE** `/v2/manage/providers/{provider}` + +Delete social provider configuration + +Deletes the social provider configuration for a specified provider name for the Tenant. + +### Example + +```java +public static void callDeleteSocialProviderByName(LoginRadiusClient client) { + String provider = "<provider>"; //Required + + try { + var response = client.socialProviders.deleteSocialProviderByName(provider); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `provider` | path | string | yes | Provider Name | + +### Returns + +`DeleteResponse` + +--- + +## `getAllProviderConfigurations` + +**GET** `/v2/manage/providers` + +List social provider configurations + +Retrieves all social provider configurations available for the Tenant. + +### Example + +```java +public static void callGetAllProviderConfigurations(LoginRadiusClient client) { + try { + var response = client.socialProviders.getAllProviderConfigurations(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`object` + +--- + +## `getEnabledProviders` + +**GET** `/v2/manage/providers/active` + +Retrieve enabled social providers + +Retrieves a list of all enabled social providers for the Tenant. + +### Example + +```java +public static void callGetEnabledProviders(LoginRadiusClient client) { + try { + var response = client.socialProviders.getEnabledProviders(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`object` + +--- + +## `getSocialProviderByName` + +**GET** `/v2/manage/providers/{provider}` + +Retrieve social provider configuration + +Retrieves the social provider configuration for a specified provider name for the Tenant. + +### Example + +```java +public static void callGetSocialProviderByName(LoginRadiusClient client) { + String provider = "<provider>"; //Required + + try { + var response = client.socialProviders.getSocialProviderByName(provider); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `provider` | path | string | yes | Provider Name | + +### Returns + +`AppProvider` + +--- + +## `setProvidersOrder` + +**PUT** `/v2/manage/providers/setorder` + +Set social provider order + +Sets the order of social providers for the Tenant to be listed in the UI. + +### Example + +```java +public static void callSetProvidersOrder(LoginRadiusClient client) { + SetProvidersOrderRequest setProvidersOrderRequest = new SetProvidersOrderRequest().data("<data>"); //Optional + + try { + var response = client.socialProviders.setProvidersOrder(setProvidersOrderRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`object` as `application/json`. + +### Returns + +`object` + +--- + +## `setProvidersStatus` + +**PUT** `/v2/manage/providers` + +Set social provider status + +Sets the status of social providers for the Tenant. + +### Example + +```java +public static void callSetProvidersStatus(LoginRadiusClient client) { + ProviderStatusList providerStatusList = new ProviderStatusList().data("<data>"); //Optional + + try { + var response = client.socialProviders.setProvidersStatus(providerStatusList); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`ProviderStatusList` as `application/json`. + +### Returns + +`object` + +--- + +## `updateSocialProviderByName` + +**PUT** `/v2/manage/providers/{provider}` + +Update social provider configuration + +Updates the social provider configuration for a specified provider name for the Tenant. + +### Example + +```java +public static void callUpdateSocialProviderByName(LoginRadiusClient client) { + String provider = "<provider>"; //Required + AppProvider appProvider = new AppProvider().isActive(true).key("<key>").secret("<secret>"); //Optional + + try { + var response = client.socialProviders.updateSocialProviderByName(provider, appProvider); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `provider` | path | string | yes | Provider Name | + +### Request body + +`AppProvider` as `application/json`. + +### Returns + +`AppProvider` + diff --git a/docs/apis/sott.md b/docs/apis/sott.md new file mode 100644 index 0000000..3241d97 --- /dev/null +++ b/docs/apis/sott.md @@ -0,0 +1,73 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# SOTT + +2 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `addSott` + +**POST** `/v2/manage/sott` + +Generate SOTT + +Generates a new Secure One Time Token (SOTT) for the Tenant based on specified technology and parameters. + +### Example + +```java +public static void callAddSott(LoginRadiusClient client) { + SottGenerateTechnology sottGenerateTechnology = new SottGenerateTechnology().expiresInMinutes(0).technology("<technology>"); //Optional + + try { + var response = client.sott.addSott(sottGenerateTechnology); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`SottGenerateTechnology` as `application/json`. + +### Returns + +`SottResponse` + +--- + +## `getAllSOTT` + +**GET** `/v2/manage/sott` + +List SOTTs + +Retrieves a list of all Secure One Time Token (SOTT) entries associated with the Tenant. + +### Example + +```java +public static void callGetAllSOTT(LoginRadiusClient client) { + try { + var response = client.sott.getAllSOTT(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`object` + diff --git a/docs/apis/user-migration.md b/docs/apis/user-migration.md new file mode 100644 index 0000000..5ecf39c --- /dev/null +++ b/docs/apis/user-migration.md @@ -0,0 +1,45 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# User Migration + +1 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `batchUpload` + +**POST** `/bulk/upsert` + +Batch upload Users + +Uploads an array of Users with optional Password and migration configuration. + +### Example + +```java +public static void callBatchUpload(LoginRadiusClient client) { + BatchUpload batchUpload = new BatchUpload().profiles("<profiles>"); //Required + + try { + var response = client.userMigration.batchUpload(batchUpload); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`BatchUpload` as `application/json`. + +### Returns + +`BatchUploadResponse` + diff --git a/docs/apis/user.md b/docs/apis/user.md new file mode 100644 index 0000000..28d92fa --- /dev/null +++ b/docs/apis/user.md @@ -0,0 +1,1486 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# User + +33 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `accountListPasskey` + +**GET** `/identity/v2/auth/account/passkey` + +List registered Passkeys + +Lists all registered Passkeys for a User with a valid Access Token. + +### Example + +```java +public static void callAccountListPasskey(LoginRadiusClient client) { + String accessToken = "<accessToken>"; //Optional + + try { + var response = client.user.accountListPasskey(accessToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | + +### Returns + +`PasskeyListResponse` + +--- + +## `accountRemovePasskey` + +**DELETE** `/identity/v2/auth/account/passkey/{passkeyId}` + +Remove Passkey + +Removes a specific Passkey from the User's Account. + +### Example + +```java +public static void callAccountRemovePasskey(LoginRadiusClient client) { + String passkeyId = "<passkeyId>"; //Required + String accessToken = "<accessToken>"; //Optional + + try { + var response = client.user.accountRemovePasskey(passkeyId, accessToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `passkeyId` | path | string | yes | Id asscociated with the Passkey | +| `access_token` | query | string | no | Access Token of the User | + +### Returns + +`IsDeleted` + +--- + +## `addEmail` + +**POST** `/identity/v2/auth/email` + +Add Email + +Adds an Email to a User's account, either as a primary or additional Email. + +### Example + +```java +public static void callAddEmail(LoginRadiusClient client) { + AddEmailModel addEmailModel = new AddEmailModel().email("<email>"); //Required + String accessToken = "<accessToken>"; //Optional + String emailtemplate = "<emailtemplate>"; //Optional + String verificationurl = "<verificationurl>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + + try { + var response = client.user.addEmail(addEmailModel, accessToken, emailtemplate, verificationurl, preventWebhook, xPreventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | +| `emailtemplate` | query | string | no | Name of the Email template to use for this notification. | +| `verificationurl` | query | string | no | Verification URL for the User which will be included in the Email template.. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | + +### Request body + +`AddEmailModel` as `application/json`. + +### Returns + +`IsPostedResponse` + +--- + +## `changePhoneNumber` + +**PUT** `/identity/v2/auth/phone` + +Change Phone number + +Updates the User's Phone number using the Access Token. + +### Example + +```java +public static void callChangePhoneNumber(LoginRadiusClient client) { + String smstemplate = "<smstemplate>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + String accessToken = "<accessToken>"; //Optional + Boolean isvoiceotp = true; //Optional + PhoneIdModel phoneIdModel = new PhoneIdModel().phone("<phone>"); //Optional + + try { + var response = client.user.changePhoneNumber(smstemplate, preventWebhook, xPreventWebhook, accessToken, isvoiceotp, phoneIdModel); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `smstemplate` | query | string | no | SMS Template | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `access_token` | query | string | no | Access Token of the User | +| `isvoiceotp` | query | boolean | no | Boolean flag to enforce sending SMS content via Voice. | + +### Request body + +`PhoneIdModel` as `application/json`. + +### Returns + +`SMSResponse` + +--- + +## `checkEmailAvailability` + +**GET** `/identity/v2/auth/email` + +Check Email availability + +Verifies Email availability or checks Email using a Verification Token or OTP. + +### Example + +```java +public static void callCheckEmailAvailability(LoginRadiusClient client) { + String email = "<email>"; //Optional + String username = "<username>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + String verificationtoken = "<verificationtoken>"; //Optional + String otp = "<otp>"; //Optional + String uuid = "<uuid>"; //Optional + String url = "<url>"; //Optional + String welcomeemailtemplate = "<welcomeemailtemplate>"; //Optional + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String gRecaptchaResponse2 = "<gRecaptchaResponse2>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Optional + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Optional + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + + try { + var response = client.user.checkEmailAvailability(email, username, preventWebhook, xPreventWebhook, verificationtoken, otp, uuid, url, welcomeemailtemplate, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `email` | query | string (email) | no | Email address of the associated Account. | +| `username` | query | string | no | Username of the associated Account. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `verificationtoken` | query | string | no | Verification token received in the Email. | +| `otp` | query | string | no | One-time passcode sent to the User's Email. | +| `uuid` | query | string | no | Email template for the welcome Email. | +| `url` | query | string | no | URL to log the main domain in the database. | +| `welcomeemailtemplate` | query | string | no | Welcome Email Template | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `g_recaptcha_response` | query | string | no | Google reCAPTCHA Response | +| `qq_captcha_ticket` | query | string | no | QQ reCAPTCHA Response | +| `qq_captcha_randstr` | query | string | no | QQ reCAPTCHA Response | +| `h-captcha-response` | query | string | no | hCaptcha Response | + +### Returns + +`object` + +--- + +## `deleteAccByPhoneOTP` + +**POST** `/identity/v2/auth/account/delete` + +Delete Account by Phone OTP + +Deletes an Account using a Phone OTP. + +### Example + +```java +public static void callDeleteAccByPhoneOTP(LoginRadiusClient client) { + String accessToken = "<accessToken>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String gRecaptchaResponse2 = "<gRecaptchaResponse2>"; //Optional + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Required + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Required + VerifyDeleteAccountOtp verifyDeleteAccountOtp = new VerifyDeleteAccountOtp().otp("<otp>"); //Optional + + try { + var response = client.user.deleteAccByPhoneOTP(accessToken, preventWebhook, xPreventWebhook, gRecaptchaResponse, gRecaptchaResponse2, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, verifyDeleteAccountOtp); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `g_recaptcha_response` | query | string | no | Google reCAPTCHA Response | +| `h-captcha-response` | query | string | no | hCaptcha Response | +| `qq_captcha_ticket` | query | string | no | QQ Captcha ticket (required if Bot Protection is enabled) | +| `qq_captcha_randstr` | query | string | no | QQ Captcha rand string (required if Bot Protection is enabled) | + +### Request body + +`VerifyDeleteAccountOtp` as `application/json`. + +### Returns + +`IsDeleted` + +--- + +## `deleteAccount` + +**GET** `/identity/v2/auth/account/delete` + +Delete Account by Email token or OTP + +Deletes an Account using a delete token or OTP. + +### Example + +```java +public static void callDeleteAccount(LoginRadiusClient client) { + Boolean preventWebhook = true; //Optional + String deletetoken = "<deletetoken>"; //Optional + Boolean xPreventWebhook = true; //Optional + String email = "<email>"; //Optional + String otp = "<otp>"; //Optional + + try { + var response = client.user.deleteAccount(preventWebhook, deletetoken, xPreventWebhook, email, otp); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `deletetoken` | query | string | no | This is required if the OTP is not passed in the query parameter. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `email` | query | string (email) | no | Email address of the associated Account. | +| `otp` | query | string | no | One-time passcode sent to the User's Email. | + +### Returns + +`IsPostedResponse` + +--- + +## `deleteAccountByAccessToken` + +**DELETE** `/identity/v2/auth/account` + +Send User deletion Email + +Sends a confirmation Email for User deletion to the User's Email using their Access Token. + +### Example + +```java +public static void callDeleteAccountByAccessToken(LoginRadiusClient client) { + String emailtemplate = "<emailtemplate>"; //Optional + String deleteurl = "<deleteurl>"; //Optional + String accessToken = "<accessToken>"; //Optional + + try { + var response = client.user.deleteAccountByAccessToken(emailtemplate, deleteurl, accessToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `emailtemplate` | query | string | no | Name of the Email template to use for this notification. | +| `deleteurl` | query | string | no | DeleteUrl URL which is being sent in the Email | +| `access_token` | query | string | no | Access Token of the User | + +### Returns + +`IsDeleteRequestAccepted` + +--- + +## `deleteemailbyaccesstoken` + +**DELETE** `/identity/v2/auth/email` + +Remove Email + +Removes additional Emails from a User's account. + +### Example + +```java +public static void callDeleteemailbyaccesstoken(LoginRadiusClient client) { + DeleteemailbyaccesstokenRequest deleteemailbyaccesstokenRequest = new DeleteemailbyaccesstokenRequest().email("<email>"); //Required + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + + try { + var response = client.user.deleteemailbyaccesstoken(deleteemailbyaccesstokenRequest, preventWebhook, xPreventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | + +### Request body + +`object` as `application/json`. + +### Returns + +`IsDeleted` + +--- + +## `getAccountDetails` + +**GET** `/identity/v2/auth/account` + +Retrieve User + +Retrieves User details based on the Access Token. + +### Example + +```java +public static void callGetAccountDetails(LoginRadiusClient client) { + String welcomeemailtemplate = "<welcomeemailtemplate>"; //Optional + String accessToken = "<accessToken>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + + try { + var response = client.user.getAccountDetails(welcomeemailtemplate, accessToken, preventWebhook, xPreventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `welcomeemailtemplate` | query | string | no | Welcome Email Template | +| `access_token` | query | string | no | Access Token of the User | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | + +### Returns + +`IdentityResponseWithSocialWithoutLogins` + +--- + +## `getConsentLogs` + +**GET** `/identity/v2/auth/consent/logs` + +Retrieve Consent Logs + +Retrieves consent logs for a User based on the provided Access Token. + +### Example + +```java +public static void callGetConsentLogs(LoginRadiusClient client) { + String accessToken = "<accessToken>"; //Optional + + try { + var response = client.user.getConsentLogs(accessToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | + +### Returns + +`ConsentLogsResponse` + +--- + +## `getInvitation` + +**GET** `/identity/v2/auth/invitations/{invitation_token}` + +Retrieve invitation details + +Retrieves details about a specific invitation using the invitation token. + +### Example + +```java +public static void callGetInvitation(LoginRadiusClient client) { + String invitationToken = "<invitationToken>"; //Required + + try { + var response = client.user.getInvitation(invitationToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `invitation_token` | path | string | yes | The token of the invitation to retrieve. | + +### Returns + +`InvitationToken` + +--- + +## `getInvitationByInvitationId` + +**GET** `/v2/manage/invitations/{invitationid}` + +Retrieve invitation by ID + +Retrieves invitation details by invitation ID. + +### Example + +```java +public static void callGetInvitationByInvitationId(LoginRadiusClient client) { + String invitationid = "<invitationid>"; //Required + + try { + var response = client.user.getInvitationByInvitationId(invitationid); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `invitationid` | path | string | yes | The ID of the invitation. The ID is typically in the format *inv_<unique_id>*, where *<unique_id>* is a string of alphanumeric characters. | + +### Returns + +`Invitation` + +--- + +## `getPrivacyPolicyAcceptance` + +**GET** `/identity/v2/auth/privacypolicy/accept` + +Accept Privacy Policy + +Updates the Privacy Policy stored in a User's profile using their Access Token. + +### Example + +```java +public static void callGetPrivacyPolicyAcceptance(LoginRadiusClient client) { + String accessToken = "<accessToken>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + + try { + var response = client.user.getPrivacyPolicyAcceptance(accessToken, preventWebhook, xPreventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | + +### Returns + +`IdentityResponseWithSocialWithoutLogins` + +--- + +## `getPrivacyPolicyHistory` + +**GET** `/identity/v2/auth/privacypolicy/history` + +Retrieve Privacy Policy History + +Returns all accepted Privacy Policies for a User using their Access Token. + +### Example + +```java +public static void callGetPrivacyPolicyHistory(LoginRadiusClient client) { + String accessToken = "<accessToken>"; //Optional + + try { + var response = client.user.getPrivacyPolicyHistory(accessToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | + +### Returns + +`PrivacyPolicyHistoryResponse` + +--- + +## `getVerifiedConsentWithAccessToken` + +**GET** `/identity/v2/auth/consent/verify` + +Retrieve Consent Status + +Retrieves the consent verification status for a User based on the provided Access Token and event. + +### Example + +```java +public static void callGetVerifiedConsentWithAccessToken(LoginRadiusClient client) { + String event = "<event>"; //Required + Boolean iscustom = true; //Required + String accessToken = "<accessToken>"; //Optional + + try { + var response = client.user.getVerifiedConsentWithAccessToken(event, iscustom, accessToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | +| `event` | query | string | yes | Event type to filter consent verification (e.g., `login`). | +| `iscustom` | query | boolean | yes | This field value is used to filter the consent verification by custom events. The iscustom value should be a boolean. If true, it filters for custom events; if false, it filters for standard events. | + +### Returns + +`VerifyConsent` + +--- + +## `linkSocialIdentitiesByAccessToken` + +**POST** `/identity/v2/auth/socialidentity` + +Link social identities + +Links a social provider account to an existing Account using Access Tokens. + +### Example + +```java +public static void callLinkSocialIdentitiesByAccessToken(LoginRadiusClient client) { + String accessToken = "<accessToken>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + CandidateTokenModel candidateTokenModel = new CandidateTokenModel().candidatetoken("<candidatetoken>"); //Optional + + try { + var response = client.user.linkSocialIdentitiesByAccessToken(accessToken, preventWebhook, xPreventWebhook, candidateTokenModel); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | + +### Request body + +`CandidateTokenModel` as `application/json`. + +### Returns + +`IsPostedResponse` + +--- + +## `linkSocialIdentitiesByPing` + +**POST** `/identity/v2/auth/socialidentity/ping` + +Link social identities via PING + +Links a social provider account with an existing Account using the Access Token and the social provider's User Access Token. + +### Example + +```java +public static void callLinkSocialIdentitiesByPing(LoginRadiusClient client) { + String accessToken = "<accessToken>"; //Optional + ClientGuidBodyModel clientGuidBodyModel = new ClientGuidBodyModel().clientgUID("<clientgUID>").access_token("<access_token>"); //Optional + + try { + var response = client.user.linkSocialIdentitiesByPing(accessToken, clientGuidBodyModel); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | + +### Request body + +`ClientGuidBodyModel` as `application/json`. + +### Returns + +`IsPostedResponse` + +--- + +## `removePhoneIdByToken` + +**DELETE** `/identity/v2/auth/phone` + +Remove Phone number + +Removes the User's Phone number using the Access Token. + +### Example + +```java +public static void callRemovePhoneIdByToken(LoginRadiusClient client) { + String accessToken = "<accessToken>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + + try { + var response = client.user.removePhoneIdByToken(accessToken, preventWebhook, xPreventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | + +### Returns + +`IsDeleted` + +--- + +## `resendEmailVerification` + +**PUT** `/identity/v2/auth/register` + +Resend verification Email + +Resends the verification Email to the User to confirm their Email address. + +### Example + +```java +public static void callResendEmailVerification(LoginRadiusClient client) { + EmailModel emailModel = new EmailModel().email("<email>"); //Required + String verificationurl = "<verificationurl>"; //Optional + String emailtemplate = "<emailtemplate>"; //Optional + + try { + var response = client.user.resendEmailVerification(emailModel, verificationurl, emailtemplate); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `verificationurl` | query | string | no | Verification URL for the User which will be included in the Email template.. | +| `emailtemplate` | query | string | no | Name of the Email template to use for this notification. | + +### Request body + +`EmailModel` as `application/json`. + +### Returns + +`IsPostedResponse` + +--- + +## `resendPhoneOtp` + +**POST** `/identity/v2/auth/phone/otp` + +Resend Phone OTP + +Resends the Phone OTP using either the Access Token or Phone number. + +### Example + +```java +public static void callResendPhoneOtp(LoginRadiusClient client) { + String smstemplate = "<smstemplate>"; //Optional + String accessToken = "<accessToken>"; //Optional + Boolean isvoiceotp = true; //Optional + PhoneIdModelOptional phoneIdModelOptional = new PhoneIdModelOptional().phone("<phone>"); //Optional + + try { + var response = client.user.resendPhoneOtp(smstemplate, accessToken, isvoiceotp, phoneIdModelOptional); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `smstemplate` | query | string | no | SMS Template | +| `access_token` | query | string | no | Access Token of the User | +| `isvoiceotp` | query | boolean | no | Boolean flag to enforce sending SMS content via Voice. | + +### Request body + +`PhoneIdModelOptional` as `application/json`. + +### Returns + +`SMSResponse` + +--- + +## `sendDeleteOtp` + +**GET** `/identity/v2/auth/account/otp` + +Retrieve delete Account OTP + +Retrieves the OTP for the specified Account to facilitate account deletion. + +### Example + +```java +public static void callSendDeleteOtp(LoginRadiusClient client) { + String accessToken = "<accessToken>"; //Optional + String smstemplate = "<smstemplate>"; //Optional + Boolean isvoiceotp = true; //Optional + + try { + var response = client.user.sendDeleteOtp(accessToken, smstemplate, isvoiceotp); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | +| `smstemplate` | query | string | no | SMS Template | +| `isvoiceotp` | query | boolean | no | Boolean flag to enforce sending SMS content via Voice. | + +### Returns + +`SMSResponse` + +--- + +## `sendEmailVerification` + +**GET** `/identity/v2/auth/email/sendverificationemail` + +Send verification Email for social profile linking + +Sends a verification Email to the unverified Email of the social profile. This is applicable only in optional verification workflows. + +### Example + +```java +public static void callSendEmailVerification(LoginRadiusClient client) { + String emailtemplate = "<emailtemplate>"; //Optional + String verificationurl = "<verificationurl>"; //Optional + String clientguid = "<clientguid>"; //Optional + String accessToken = "<accessToken>"; //Optional + + try { + var response = client.user.sendEmailVerification(emailtemplate, verificationurl, clientguid, accessToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `emailtemplate` | query | string | no | Name of the Email template to use for this notification. | +| `verificationurl` | query | string | no | Verification URL for the User which will be included in the Email template.. | +| `clientguid` | query | string | no | Client GUID for the request. | +| `access_token` | query | string | no | Access Token of the User | + +### Returns + +`SendEmailVerificationResponse` + +--- + +## `sendWelcomeEmail` + +**GET** `/identity/v2/auth/account/sendwelcomeemail` + +Send Welcome Email + +Sends a welcome Email to the User. + +### Example + +```java +public static void callSendWelcomeEmail(LoginRadiusClient client) { + String welcomeemailtemplate = "<welcomeemailtemplate>"; //Optional + String accessToken = "<accessToken>"; //Optional + + try { + var response = client.user.sendWelcomeEmail(welcomeemailtemplate, accessToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `welcomeemailtemplate` | query | string | no | Welcome Email Template | +| `access_token` | query | string | no | Access Token of the User | + +### Returns + +`IsPostedResponse` + +--- + +## `setorchangeusernamebyaccesstoken` + +**PUT** `/identity/v2/auth/username` + +Update Username + +Sets or changes the User's Username using the Access Token. + +### Example + +```java +public static void callSetorchangeusernamebyaccesstoken(LoginRadiusClient client) { + String accessToken = "<accessToken>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + SetUserNameRequest setUserNameRequest = new SetUserNameRequest().username("<username>"); //Optional + + try { + var response = client.user.setorchangeusernamebyaccesstoken(accessToken, preventWebhook, xPreventWebhook, setUserNameRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | + +### Request body + +`SetUserNameRequest` as `application/json`. + +### Returns + +`IsPostedResponse` + +--- + +## `submitConsentByAccessToken` + +**POST** `/identity/v2/auth/consent/profile` + +Submit Consent + +Submits User consent information using an Access Token. + +### Example + +```java +public static void callSubmitConsentByAccessToken(LoginRadiusClient client) { + ConsentSubmit consentSubmit = new ConsentSubmit().events("<events>").data("<data>"); //Required + String accessToken = "<accessToken>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + + try { + var response = client.user.submitConsentByAccessToken(consentSubmit, accessToken, preventWebhook, xPreventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | + +### Request body + +`ConsentSubmit` as `application/json`. + +### Returns + +`Profile` + +--- + +## `submitConsentByConsentToken` + +**POST** `/identity/v2/auth/consent` + +Submit Consent with Token + +Submits User consent information using a consent token. + +### Example + +```java +public static void callSubmitConsentByConsentToken(LoginRadiusClient client) { + String consenttoken = "<consenttoken>"; //Required + ConsentSubmit consentSubmit = new ConsentSubmit().events("<events>").data("<data>"); //Required + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + + try { + var response = client.user.submitConsentByConsentToken(consenttoken, consentSubmit, preventWebhook, xPreventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `consenttoken` | query | string | yes | The consent token for the User. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | + +### Request body + +`ConsentSubmit` as `application/json`. + +### Returns + +`ConsentResponse` + +--- + +## `unlinkSocialIdentitiesByAccessToken` + +**DELETE** `/identity/v2/auth/socialidentity` + +Unlink social identities + +Unlinks a social provider account from the specified Account using Access Tokens, removing it from the database. + +### Example + +```java +public static void callUnlinkSocialIdentitiesByAccessToken(LoginRadiusClient client) { + String accessToken = "<accessToken>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + UnlinkSocialIdentityRequest unlinkSocialIdentityRequest = new UnlinkSocialIdentityRequest().provider("<provider>").providerid("<providerid>"); //Optional + + try { + var response = client.user.unlinkSocialIdentitiesByAccessToken(accessToken, preventWebhook, xPreventWebhook, unlinkSocialIdentityRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | + +### Request body + +`UnlinkSocialIdentityRequest` as `application/json`. + +### Returns + +`IsDeleted` + +--- + +## `unlockaccountbyaccesstoken` + +**PUT** `/identity/v2/auth/account/unlock` + +Unlock User + +Unlocks a User's Account with a valid Access Token after successfully passing Bot Protection challenges. + +### Example + +```java +public static void callUnlockaccountbyaccesstoken(LoginRadiusClient client) { + UnlockaccountbyaccesstokenRequest unlockaccountbyaccesstokenRequest = new UnlockaccountbyaccesstokenRequest().securityAnswer("<securityAnswer>"); //Required + String accessToken = "<accessToken>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Optional + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Optional + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + + try { + var response = client.user.unlockaccountbyaccesstoken(unlockaccountbyaccesstokenRequest, accessToken, preventWebhook, xPreventWebhook, gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `qq_captcha_ticket` | query | string | no | QQ reCAPTCHA Response | +| `qq_captcha_randstr` | query | string | no | QQ reCAPTCHA Response | +| `h-captcha-response` | query | string | no | hCaptcha Response | + +### Request body + +`object` as `application/json`. + +### Returns + +`IsPostedResponse` + +--- + +## `updateAccountByAccessToken` + +**PUT** `/identity/v2/auth/account` + +Update User + +Updates the User's account information using a valid Access Token. + +### Example + +```java +public static void callUpdateAccountByAccessToken(LoginRadiusClient client) { + UpdateAccountByAccessTokenRequest updateAccountByAccessTokenRequest = new UpdateAccountByAccessTokenRequest().access_token("<access_token>").userName("<userName>").phoneId("<phoneId>"); //Required + String verificationurl = "<verificationurl>"; //Optional + String emailtemplate = "<emailtemplate>"; //Optional + String smstemplate = "<smstemplate>"; //Optional + Boolean nullsupport = true; //Optional + Boolean isvoiceotp = true; //Optional + String fields = "<fields>"; //Optional + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Optional + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Optional + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + String accessToken = "<accessToken>"; //Optional + + try { + var response = client.user.updateAccountByAccessToken(updateAccountByAccessTokenRequest, verificationurl, emailtemplate, smstemplate, nullsupport, isvoiceotp, fields, gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, preventWebhook, xPreventWebhook, accessToken); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `verificationurl` | query | string | no | Verification URL for the User which will be included in the Email template.. | +| `emailtemplate` | query | string | no | Name of the Email template to use for this notification. | +| `smstemplate` | query | string | no | SMS Template | +| `nullsupport` | query | boolean | no | Bool flag, if this flag is sent as true then the fields which are send in payload as null then in the profile as well that will be saved as null only | +| `isvoiceotp` | query | boolean | no | Boolean flag to enforce sending SMS content via Voice. | +| `fields` | query | string | no | Comma-separated list of profile fields to include in the response. | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `qq_captcha_ticket` | query | string | no | QQ reCAPTCHA Response | +| `qq_captcha_randstr` | query | string | no | QQ reCAPTCHA Response | +| `h-captcha-response` | query | string | no | hCaptcha Response | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `access_token` | query | string | no | Access Token of the User | + +### Request body + +`object` as `application/json`. + +### Returns + +`UpdateByTokenResponse` + +--- + +## `updateConsentByAccessToken` + +**PUT** `/identity/v2/auth/consent` + +Update Consent Profile + +Updates the consent profile using an Access Token. + +### Example + +```java +public static void callUpdateConsentByAccessToken(LoginRadiusClient client) { + ConsentUpdate consentUpdate = new ConsentUpdate().consents("<consents>"); //Required + String accessToken = "<accessToken>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + + try { + var response = client.user.updateConsentByAccessToken(consentUpdate, accessToken, preventWebhook, xPreventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `access_token` | query | string | no | Access Token of the User | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | + +### Request body + +`ConsentUpdate` as `application/json`. + +### Returns + +`ConsentProfile` + +--- + +## `updateEmail` + +**PUT** `/identity/v2/auth/email` + +Verify Email + +Verifies the User's Email when OTP Email Verification is enabled, requiring LoginRadius activation. + +### Example + +```java +public static void callUpdateEmail(LoginRadiusClient client) { + String url = "<url>"; //Optional + String welcomeemailtemplate = "<welcomeemailtemplate>"; //Optional + Boolean preventWebhook = true; //Optional + Boolean xPreventWebhook = true; //Optional + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String gRecaptchaResponse2 = "<gRecaptchaResponse2>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Optional + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Optional + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + UpdateEmailRequest updateEmailRequest = new UpdateEmailRequest().otp("<otp>"); //Optional + + try { + var response = client.user.updateEmail(url, welcomeemailtemplate, preventWebhook, xPreventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, updateEmailRequest); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `url` | query | string | no | URL to log the main domain in the database. | +| `welcomeemailtemplate` | query | string | no | Welcome Email Template | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `g_recaptcha_response` | query | string | no | Google reCAPTCHA Response | +| `qq_captcha_ticket` | query | string | no | QQ reCAPTCHA Response | +| `qq_captcha_randstr` | query | string | no | QQ reCAPTCHA Response | +| `h-captcha-response` | query | string | no | hCaptcha Response | + +### Request body + +`object` as `application/json`. + +### Returns + +`object` + +--- + +## `verifyPhoneOtp` + +**PUT** `/identity/v2/auth/phone/otp` + +Verify Phone + +Validates the verification code sent to confirm a User's Phone number when the User is logged in and provides an Access Token. + +### Example + +```java +public static void callVerifyPhoneOtp(LoginRadiusClient client) { + VerifyOtpPhoneModel verifyOtpPhoneModel = new VerifyOtpPhoneModel().phone("<phone>"); //Required + String otp = "<otp>"; //Optional + String smstemplate = "<smstemplate>"; //Optional + String gRecaptchaResponse = "<gRecaptchaResponse>"; //Optional + String gRecaptchaResponse2 = "<gRecaptchaResponse2>"; //Optional + String qqCaptchaTicket = "<qqCaptchaTicket>"; //Optional + String qqCaptchaRandstr = "<qqCaptchaRandstr>"; //Optional + String hCaptchaResponse = "<hCaptchaResponse>"; //Optional + String accessToken = "<accessToken>"; //Optional + Boolean xPreventWebhook = true; //Optional + Boolean preventWebhook = true; //Optional + + try { + var response = client.user.verifyPhoneOtp(verifyOtpPhoneModel, otp, smstemplate, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, accessToken, xPreventWebhook, preventWebhook); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `otp` | query | string | no | One-time passcode sent to the User's Email. | +| `smstemplate` | query | string | no | SMS Template | +| `g-recaptcha-response` | query | string | no | Google reCAPTCHA response parameter which will be sent to the server for verification. | +| `g_recaptcha_response` | query | string | no | Google reCAPTCHA Response | +| `qq_captcha_ticket` | query | string | no | QQ reCAPTCHA Response | +| `qq_captcha_randstr` | query | string | no | QQ reCAPTCHA Response | +| `h-captcha-response` | query | string | no | hCaptcha Response | +| `access_token` | query | string | no | Access Token of the User | +| `X-PreventWebhook` | header | boolean | no | When true, suppresses webhook events for this operation. | +| `prevent_webhook` | query | boolean | no | When true, suppresses webhook events for this operation. | + +### Request body + +`VerifyOtpPhoneModel` as `application/json`. + +### Returns + +`object` + diff --git a/docs/apis/webhooks.md b/docs/apis/webhooks.md new file mode 100644 index 0000000..19a5804 --- /dev/null +++ b/docs/apis/webhooks.md @@ -0,0 +1,214 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Webhooks + +6 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `createWebhookConfiguration` + +**POST** `/v2/manage/webhooks` + +Create webhook configuration + +Creates a new webhook configuration for the Tenant, allowing registration of a webhook with details such as the Target URL and subscribed events. + +### Example + +```java +public static void callCreateWebhookConfiguration(LoginRadiusClient client) { + WebhookSubscriptionCreateModel webhookSubscriptionCreateModel = new WebhookSubscriptionCreateModel().event("<event>").targetUrl("<targetUrl>"); //Optional + + try { + var response = client.webhooks.createWebhookConfiguration(webhookSubscriptionCreateModel); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`WebhookSubscriptionCreateModel` as `application/json`. + +### Returns + +`WebhookSubscription` + +--- + +## `deleteWebhookConfigurationById` + +**DELETE** `/v2/manage/webhooks/{hookId}` + +Delete webhook configuration + +Deletes a specific webhook configuration for the Tenant using its unique ID, permanently removing the webhook from receiving further event notifications. + +### Example + +```java +public static void callDeleteWebhookConfigurationById(LoginRadiusClient client) { + String hookId = "<hookId>"; //Required + + try { + var response = client.webhooks.deleteWebhookConfigurationById(hookId); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `hookId` | path | string | yes | Webhook ID | + +### Returns + +`DeleteResponse` + +--- + +## `getAllEvents` + +**GET** `/v2/manage/webhooks/events` + +List webhook events + +Retrieves a list of all available webhook events that can be subscribed to by the Tenant for configuring webhooks to receive notifications for specific activities. + +### Example + +```java +public static void callGetAllEvents(LoginRadiusClient client) { + try { + var response = client.webhooks.getAllEvents(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`WebhookEvents` + +--- + +## `getAllWebhooksConfigurations` + +**GET** `/v2/manage/webhooks` + +List webhook configurations + +Retrieves a list of all configured webhooks for the Tenant, including detailed information about each webhook and its subscribed events. + +### Example + +```java +public static void callGetAllWebhooksConfigurations(LoginRadiusClient client) { + try { + var response = client.webhooks.getAllWebhooksConfigurations(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`WebhookSubscriptionResponse` + +--- + +## `getWebhookConfigurationById` + +**GET** `/v2/manage/webhooks/{hookId}` + +Retrieve webhook configuration + +Retrieves the details of a specific webhook configuration for the Tenant by its unique ID, including the Target URL, subscribed events, and other settings. + +### Example + +```java +public static void callGetWebhookConfigurationById(LoginRadiusClient client) { + String hookId = "<hookId>"; //Required + + try { + var response = client.webhooks.getWebhookConfigurationById(hookId); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `hookId` | path | string | yes | Webhook ID | + +### Returns + +`WebhookSubscription` + +--- + +## `updateWebhookConfigurationById` + +**PUT** `/v2/manage/webhooks/{hookId}` + +Update webhook configuration + +Updates an existing webhook configuration for the Tenant by its unique ID, modifying details such as the Target URL, subscribed events, or other settings. + +### Example + +```java +public static void callUpdateWebhookConfigurationById(LoginRadiusClient client) { + String hookId = "<hookId>"; //Required + WebhookSubscriptionUpdateModel webhookSubscriptionUpdateModel = new WebhookSubscriptionUpdateModel().targetUrl("<targetUrl>"); //Optional + + try { + var response = client.webhooks.updateWebhookConfigurationById(hookId, webhookSubscriptionUpdateModel); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `hookId` | path | string | yes | Webhook ID | + +### Request body + +`WebhookSubscriptionUpdateModel` as `application/json`. + +### Returns + +`WebhookSubscription` + diff --git a/docs/apis/workflows.md b/docs/apis/workflows.md new file mode 100644 index 0000000..2dfb970 --- /dev/null +++ b/docs/apis/workflows.md @@ -0,0 +1,298 @@ +<!-- Generated by the LoginRadius SDK generator; DO NOT EDIT. --> + +# Workflows + +8 operation(s). Part of the [API index](../API.md). + +Call these as `client.<service>.<method>(...)`. `<service>` is the client field for this +group — the [README](../../README.md) lists the field name for every service. +These pages group operations the way the OpenAPI specification tags them, which +is not always one field per page. + +--- + +## `addWorkflow` + +**POST** `/v2/manage/workflows` + +Add workflow + +Adds a new workflow configuration to the Tenant. + +### Example + +```java +public static void callAddWorkflow(LoginRadiusClient client) { + AddWorkflowConfig addWorkflowConfig = new AddWorkflowConfig().name("<name>").data("<data>"); //Required + + try { + var response = client.workflows.addWorkflow(addWorkflowConfig); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Request body + +`AddWorkflowConfig` as `application/json`. + +### Returns + +`WorkflowConfig` + +--- + +## `deleteWorkflow` + +**DELETE** `/v2/manage/workflows/{workflowId}` + +Delete Workflow + +Deletes an existing Workflow from the system. + +### Example + +```java +public static void callDeleteWorkflow(LoginRadiusClient client) { + String workflowId = "<workflowId>"; //Required + + try { + var response = client.workflows.deleteWorkflow(workflowId); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `workflowId` | path | string | yes | The ID of the workflow. | + +### Returns + +`DeleteResponse` + +--- + +## `deleteWorkflowVersion` + +**DELETE** `/v2/manage/workflows/{workflowId}/versions/{version}` + +Delete Workflow Version + +Deletes a specific version of a Workflow from the system. + +### Example + +```java +public static void callDeleteWorkflowVersion(LoginRadiusClient client) { + String workflowId = "<workflowId>"; //Required + String version = "<version>"; //Required + + try { + var response = client.workflows.deleteWorkflowVersion(workflowId, version); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `workflowId` | path | string | yes | The ID of the workflow. | +| `version` | path | string | yes | The version identifier to delete. | + +### Returns + +`IsDeleted` + +--- + +## `getAllWorkflows` + +**GET** `/v2/manage/workflows` + +List workflows + +Retrieves a list of all workflows configured for the Tenant. + +### Example + +```java +public static void callGetAllWorkflows(LoginRadiusClient client) { + try { + var response = client.workflows.getAllWorkflows(); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Returns + +`object` + +--- + +## `getAllWorkflowVersionList` + +**GET** `/v2/manage/workflows/{workflowId}/versions` + +List Workflow Versions + +Returns a list of all available versions for a specified Workflow. + +### Example + +```java +public static void callGetAllWorkflowVersionList(LoginRadiusClient client) { + String workflowId = "<workflowId>"; //Required + + try { + var response = client.workflows.getAllWorkflowVersionList(workflowId); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `workflowId` | path | string | yes | The ID of the workflow. | + +### Returns + +`VersionListResponse` + +--- + +## `getWorkflowById` + +**GET** `/v2/manage/workflows/{workflowId}` + +Retrieve Workflow + +Retrieves details of a specific Workflow using its unique identifier. + +### Example + +```java +public static void callGetWorkflowById(LoginRadiusClient client) { + String workflowId = "<workflowId>"; //Required + + try { + var response = client.workflows.getWorkflowById(workflowId); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `workflowId` | path | string | yes | The ID of the workflow. | + +### Returns + +`WorkflowConfig` + +--- + +## `restoreWorkflowVersion` + +**PUT** `/v2/manage/workflows/{workflowId}/versions/{version}` + +Restore Workflow Version + +Restores a specific version of a Workflow to its active state. + +### Example + +```java +public static void callRestoreWorkflowVersion(LoginRadiusClient client) { + String workflowId = "<workflowId>"; //Required + String version = "<version>"; //Required + + try { + var response = client.workflows.restoreWorkflowVersion(workflowId, version); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `workflowId` | path | string | yes | The ID of the workflow. | +| `version` | path | string | yes | The version identifier to delete. | + +### Returns + +`object` + +--- + +## `updateWorkflow` + +**PUT** `/v2/manage/workflows/{workflowId}` + +Update Workflow + +Updates the configuration of an existing Workflow. + +### Example + +```java +public static void callUpdateWorkflow(LoginRadiusClient client) { + String workflowId = "<workflowId>"; //Required + UpdateWorkflowConfig updateWorkflowConfig = new UpdateWorkflowConfig().name("<name>").themeName("<themeName>").description("<description>"); //Required + + try { + var response = client.workflows.updateWorkflow(workflowId, updateWorkflowConfig); + System.out.println(response); + } catch (ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.println(lr.description()); + } +} +``` + +### Parameters + +| Name | In | Type | Required | Description | +| --- | --- | --- | --- | --- | +| `workflowId` | path | string | yes | The ID of the workflow. | + +### Request body + +`UpdateWorkflowConfig` as `application/json`. + +### Returns + +`WorkflowConfig` + diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..ca756bf --- /dev/null +++ b/pom.xml @@ -0,0 +1,375 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>com.loginradius.sdk</groupId> + <artifactId>java-sdk</artifactId> + <packaging>jar</packaging> + <name>LoginRadius-CustomerIdentity-JavaSDK</name> + <version>12.0.0-rc.1</version> + <url>https://github.com/LoginRadius/java-sdk</url> + <description>LoginRadius Java SDK</description> + <scm> + <connection>scm:git:git@github.com:LoginRadius/java-sdk.git</connection> + <developerConnection>scm:git:git@github.com:LoginRadius/java-sdk.git</developerConnection> + <url>git@github.com:LoginRadius/java-sdk.git</url> + </scm> + + <licenses> + <license> + <name>MIT License</name> + <url>http://www.opensource.org/licenses/mit-license.php</url> + <distribution>repo</distribution> + </license> + </licenses> + + <developers> + <developer> + <id>support</id> + <name>LoginRadius Support</name> + <email>support@loginradius.com</email> + <organization>LoginRadius</organization> + <organizationUrl>https://www.loginradius.com</organizationUrl> + </developer> + </developers> + + + <distributionManagement> + <snapshotRepository> + <id>ossrh</id> + <url>https://oss.sonatype.org/content/repositories/snapshots</url> + </snapshotRepository> + </distributionManagement> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>3.8.1</version> + <configuration> + <fork>true</fork> + <meminitial>128m</meminitial> + <maxmem>512m</maxmem> + <compilerArgs> + <arg>-Xlint:all</arg> + <arg>-J-Xss4m</arg><!-- Compiling the generated JSON.java file may require larger stack size. --> + </compilerArgs> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-enforcer-plugin</artifactId> + <version>3.4.1</version> + <executions> + <execution> + <id>enforce-maven</id> + <goals> + <goal>enforce</goal> + </goals> + <configuration> + <rules> + <requireMavenVersion> + <version>2.2.0</version> + </requireMavenVersion> + </rules> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-surefire-plugin</artifactId> + <version>2.22.2</version> + <configuration> + <systemPropertyVariables> + <property> + <name>loggerPath</name> + <value>conf/log4j.properties</value> + </property> + </systemPropertyVariables> + <argLine>-Xms512m -Xmx1500m</argLine> + <parallel>methods</parallel> + <threadCount>10</threadCount> + </configuration> + <dependencies> + <!--Custom provider and engine for Junit 5 to surefire--> + <dependency> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter-engine</artifactId> + <version>${junit-version}</version> + </dependency> + </dependencies> + </plugin> + <plugin> + <artifactId>maven-dependency-plugin</artifactId> + <version>3.6.1</version> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>copy-dependencies</goal> + </goals> + <configuration> + <outputDirectory>${project.build.directory}/lib</outputDirectory> + </configuration> + </execution> + </executions> + </plugin> + <!-- attach test jar --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>3.3.0</version> + <executions> + <execution> + <goals> + <goal>test-jar</goal> + </goals> + </execution> + </executions> + <configuration> + <excludes> + <!-- Demo sources compile with the SDK for verification, + but are never published. --> + <exclude>com/loginradius/sdk/demo/**</exclude> + <exclude>demo/**</exclude> + <exclude>com/loginradius/sdk/examples/**</exclude> + </excludes> + </configuration> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <version>3.5.0</version> + <executions> + <execution> + <id>add_sources</id> + <phase>generate-sources</phase> + <goals> + <goal>add-source</goal> + </goals> + <configuration> + <sources> + <source>src/main/java</source> + </sources> + </configuration> + </execution> + <execution> + <id>add_test_sources</id> + <phase>generate-test-sources</phase> + <goals> + <goal>add-test-source</goal> + </goals> + <configuration> + <sources> + <source>src/test/java</source> + </sources> + </configuration> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-javadoc-plugin</artifactId> + <version>3.6.3</version> + <configuration> + <doclint>none</doclint> + <windowtitle>LoginRadius Java</windowtitle> + <doctitle><![CDATA[<h1>LoginRadius Java</h1>]]></doctitle> + <bottom><![CDATA[<i>Copyright © 2026 LoginRadius, Inc. All Rights Reserved.</i>]]></bottom> + <tags> + <tag> + <name>http.response.details</name> + <placement>a</placement> + <head>Http Response Details:</head> + </tag> + </tags> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-source-plugin</artifactId> + <version>3.3.0</version> + <executions> + <execution> + <id>attach-sources</id> + <goals> + <goal>jar-no-fork</goal> + </goals> + </execution> + </executions> + </plugin> + <!-- Use spotless plugin to automatically format code, remove unused import, etc + To apply changes directly to the file, run `mvn spotless:apply` + Ref: https://github.com/diffplug/spotless/tree/main/plugin-maven + --> + <plugin> + <groupId>com.diffplug.spotless</groupId> + <artifactId>spotless-maven-plugin</artifactId> + <version>${spotless.version}</version> + <configuration> + <formats> + <!-- you can define as many formats as you want, each is independent --> + <format> + <!-- define the files to apply to --> + <includes> + <include>.gitignore</include> + </includes> + <!-- define the steps to apply to those files --> + <trimTrailingWhitespace/> + <endWithNewline/> + <indent> + <spaces>true</spaces> <!-- or <tabs>true</tabs> --> + <spacesPerTab>4</spacesPerTab> <!-- optional, default is 4 --> + </indent> + </format> + </formats> + <!-- define a language-specific format --> + <java> + <!-- no need to specify files, inferred automatically, but you can if you want --> + + <!-- apply a specific flavor of google-java-format and reflow long strings --> + <googleJavaFormat> + <version>1.8</version> + <style>AOSP</style> + <reflowLongStrings>true</reflowLongStrings> + </googleJavaFormat> + + <removeUnusedImports/> + <importOrder/> + + </java> + </configuration> + </plugin> + </plugins> + </build> + + <profiles> + <profile> + <id>sign-artifacts</id> + <build> + <plugins> + <plugin> + <groupId>org.sonatype.central</groupId> + <artifactId>central-publishing-maven-plugin</artifactId> + <version>0.7.0</version> + <extensions>true</extensions> + <configuration> + <publishingServerId>central</publishingServerId> + <autoPublish>false</autoPublish> + <waitUntil>validated</waitUntil> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-deploy-plugin</artifactId> + <version>3.1.2</version> + <configuration> + <skip>true</skip> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-gpg-plugin</artifactId> + <version>3.2.1</version> + <executions> + <execution> + <id>sign-artifacts</id> + <phase>verify</phase> + <goals> + <goal>sign</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> + + <dependencies> + <dependency> + <groupId>com.nimbusds</groupId> + <artifactId>nimbus-jose-jwt</artifactId> + <version>10.3</version> + </dependency> + <!-- @Nullable annotation --> + <dependency> + <groupId>com.google.code.findbugs</groupId> + <artifactId>jsr305</artifactId> + <version>3.0.2</version> + </dependency> + <dependency> + <groupId>com.squareup.okhttp3</groupId> + <artifactId>okhttp</artifactId> + <version>${okhttp-version}</version> + </dependency> + <dependency> + <groupId>com.squareup.okhttp3</groupId> + <artifactId>logging-interceptor</artifactId> + <version>${okhttp-version}</version> + </dependency> + <dependency> + <groupId>com.google.code.gson</groupId> + <artifactId>gson</artifactId> + <version>${gson-version}</version> + </dependency> + <dependency> + <groupId>io.gsonfire</groupId> + <artifactId>gson-fire</artifactId> + <version>${gson-fire-version}</version> + </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-lang3</artifactId> + <version>${commons-lang3-version}</version> + </dependency> + <dependency> + <groupId>jakarta.annotation</groupId> + <artifactId>jakarta.annotation-api</artifactId> + <version>${jakarta-annotation-version}</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>org.openapitools</groupId> + <artifactId>jackson-databind-nullable</artifactId> + <version>${jackson-databind-nullable-version}</version> + </dependency> + <dependency> + <groupId>jakarta.ws.rs</groupId> + <artifactId>jakarta.ws.rs-api</artifactId> + <version>${jakarta.ws.rs-api-version}</version> + </dependency> + <!-- test dependencies --> + <dependency> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter-engine</artifactId> + <version>${junit-version}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.junit.platform</groupId> + <artifactId>junit-platform-runner</artifactId> + <version>${junit-platform-runner.version}</version> + <scope>test</scope> + </dependency> + </dependencies> + <properties> + <java.version>17</java.version> + <maven.compiler.source>${java.version}</maven.compiler.source> + <maven.compiler.target>${java.version}</maven.compiler.target> + <gson-fire-version>1.9.0</gson-fire-version> + <okhttp-version>4.12.0</okhttp-version> + <gson-version>2.10.1</gson-version> + <commons-lang3-version>3.20.0</commons-lang3-version> + <jackson-databind-nullable-version>0.2.6</jackson-databind-nullable-version> + <jakarta-annotation-version>1.3.5</jakarta-annotation-version> + <beanvalidation-version>2.0.2</beanvalidation-version> + <junit-version>5.10.3</junit-version> + <junit-platform-runner.version>1.10.0</junit-platform-runner.version> + <jakarta.ws.rs-api-version>2.1.6</jakarta.ws.rs-api-version> + <jsr311-api-version>1.1.1</jsr311-api-version> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <spotless.version>2.43.0</spotless.version> + </properties> +</project> diff --git a/src/main/java/com/loginradius/sdk/AuthInterceptor.java b/src/main/java/com/loginradius/sdk/AuthInterceptor.java new file mode 100644 index 0000000..2483ff3 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/AuthInterceptor.java @@ -0,0 +1,185 @@ +// Code generated by the LoginRadius SDK generator; DO NOT EDIT. +// +// Which credential goes in which header or query parameter is declared in +// the shared SDK manifest. Edit the manifest and regenerate so every LoginRadius SDK +// injects credentials identically. + +package com.loginradius.sdk; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Date; +import java.util.HashSet; +import java.util.Locale; +import java.util.Map; +import java.util.Set; +import okhttp3.HttpUrl; +import okhttp3.Interceptor; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okio.Buffer; + +/** + * Applies credentials and cross-cutting request options to every outgoing + * request. + * + * <p>Centralising this in one interceptor gives a single audit point for + * credential handling and keeps secrets out of application logs. + */ +final class AuthInterceptor implements Interceptor { + + private final LoginRadiusConfig cfg; + + AuthInterceptor(LoginRadiusConfig cfg) { + this.cfg = cfg; + } + + @Override + public Response intercept(Chain chain) throws IOException { + Request original = chain.request(); + Request.Builder req = original.newBuilder(); + + // Caller-supplied defaults go on FIRST so everything the SDK sets below — + // credentials, User-Agent, signing — overwrites them. A default header can + // never mask a credential. + for (Map.Entry<String, String> e : cfg.defaultHeaders().entrySet()) { + req.header(e.getKey(), e.getValue()); + } + + if (notEmpty(cfg.userAgent())) { + req.header("User-Agent", cfg.userAgent()); + } + + // Header credentials. Sending via header keeps the credential out of + // access logs, browser history, and proxy URL caches. + String apiKeyHeader = firstNonEmpty(cfg.xLoginRadiusApiKey(), cfg.apiKey()); + if (notEmpty(apiKeyHeader)) { + req.header("X-LoginRadius-ApiKey", apiKeyHeader); + } + String apiSecretHeader = firstNonEmpty(cfg.xLoginRadiusApiSecret(), cfg.apiSecret()); + if (notEmpty(apiSecretHeader)) { + req.header("X-LoginRadius-ApiSecret", apiSecretHeader); + } + + // Authorization: these candidates share one header, so the first one set + // wins (the manifest declares the precedence). + if (notEmpty(cfg.bearerToken())) { + req.header("Authorization", "Bearer " + cfg.bearerToken()); + } + else if (notEmpty(cfg.m2mBearerToken())) { + req.header("Authorization", "Bearer " + cfg.m2mBearerToken()); + } + + // Cross-cutting header options, applied to every request. + if (notEmpty(cfg.originIp())) { + req.header("X-Origin-IP", cfg.originIp()); + } + if (cfg.preventWebhook()) { + req.header("X-PreventWebhook", "true"); + } + + // Query-string credentials. The spec declares operations that accept ONLY + // the query schemes, so these are always populated as a fallback. We add + // one only when the caller did not already set the key, so a per-call + // value always wins. + HttpUrl.Builder url = original.url().newBuilder(); + setIfAbsent(original.url(), url, "apikey", cfg.apiKey()); + setIfAbsent(original.url(), url, "apisecret", cfg.apiSecret()); + setIfAbsent(original.url(), url, "client_id", cfg.clientId()); + setIfAbsent(original.url(), url, "client_secret", cfg.clientSecret()); + setIfAbsent(original.url(), url, "access_token", cfg.accessToken()); + setIfAbsent(original.url(), url, "region", cfg.serverRegion()); + setIfAbsent(original.url(), url, "fields", cfg.fields()); + HttpUrl finalUrl = url.build(); + + // Signing runs LAST: it hashes the final URL, so every query parameter + // above must already be in place. The secret is stripped from the URL + // first — it must not be signed, nor travel on a signed request. + if (cfg.apiRequestSigning() && notEmpty(cfg.apiSecret()) && Signing.shouldSign(finalUrl.encodedPath())) { + HttpUrl.Builder stripped = finalUrl.newBuilder(); + stripped.removeAllQueryParameters(Signing.STRIP_PARAM); + finalUrl = stripped.build(); + + Signing.Headers h = + Signing.sign(cfg.apiSecret(), finalUrl.toString(), bodyOf(original), new Date()); + req.header(Signing.DIGEST_HEADER, h.digest); + req.header(Signing.EXPIRES_HEADER, h.expires); + } + + req.url(finalUrl); + Request out = req.build(); + + log(out); + return chain.proceed(out); + } + + /** Adds a query parameter only when the request does not already carry it. */ + private static void setIfAbsent(HttpUrl original, HttpUrl.Builder b, String key, String value) { + if (!notEmpty(value)) { + return; + } + if (original.queryParameter(key) != null) { + return; // per-call value wins + } + b.setQueryParameter(key, value); + } + + /** Reads a request body without consuming it. */ + private static String bodyOf(Request request) { + RequestBody body = request.body(); + if (body == null) { + return null; + } + try (Buffer buffer = new Buffer()) { + body.writeTo(buffer); + return buffer.readString(StandardCharsets.UTF_8); + } catch (IOException e) { + return null; + } + } + + // Logged by NAME only. Writing a tenant secret to a log would be a + // disclosure, so these values never reach the stream. + private static final Set<String> REDACTED = + new HashSet<>( + Arrays.asList( + "x-loginradius-apikey", + "x-loginradius-apisecret", + "authorization", + "digest")); + + /** Writes a one-line summary of the outgoing request. */ + private void log(Request out) { + if (cfg.debug() == null) { + return; + } + StringBuilder headers = new StringBuilder(); + for (String name : out.headers().names()) { + if (headers.length() > 0) { + headers.append(','); + } + headers.append(name).append('='); + headers.append( + REDACTED.contains(name.toLowerCase(Locale.ROOT)) ? "[REDACTED]" : out.header(name)); + } + // Query VALUES can carry credentials, so only the keys are listed. + cfg.debug() + .printf( + "loginradius: %s %s%s query=%s headers=[%s]%n", + out.method(), + out.url().host(), + out.url().encodedPath(), + out.url().queryParameterNames(), + headers); + } + + private static boolean notEmpty(String s) { + return s != null && !s.isEmpty(); + } + + private static String firstNonEmpty(String a, String b) { + return notEmpty(a) ? a : b; + } +} diff --git a/src/main/java/com/loginradius/sdk/JwtValidation.java b/src/main/java/com/loginradius/sdk/JwtValidation.java new file mode 100644 index 0000000..3ebc3e4 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/JwtValidation.java @@ -0,0 +1,271 @@ +// Code generated by the LoginRadius SDK generator; DO NOT EDIT. +// +// Local JWT validation. Contract lives in the shared SDK manifest `jwtValidation`. + +package com.loginradius.sdk; + +import com.nimbusds.jose.JWSAlgorithm; +import com.nimbusds.jose.JWSHeader; +import com.nimbusds.jose.JWSVerifier; +import com.nimbusds.jose.crypto.ECDSAVerifier; +import com.nimbusds.jose.crypto.MACVerifier; +import com.nimbusds.jose.crypto.RSASSAVerifier; +import com.nimbusds.jwt.JWTClaimsSet; +import com.nimbusds.jwt.SignedJWT; +import java.io.ByteArrayInputStream; +import java.nio.charset.StandardCharsets; +import java.security.KeyFactory; +import java.security.PublicKey; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.security.interfaces.ECPublicKey; +import java.security.interfaces.RSAPublicKey; +import java.security.spec.X509EncodedKeySpec; +import java.util.Base64; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * Verifies a LoginRadius-issued JWT locally. + * + * <p>No network call, no credentials, no client. Signature, {@code exp} and {@code nbf} are always + * checked; issuer and audience are checked when supplied. Clock drift of up to + * 60s is tolerated. + */ +public final class JwtValidation { + + private JwtValidation() {} + + /** Clock drift tolerated on {@code exp} and {@code nbf}, in seconds. */ + private static final long CLOCK_SKEW_SECONDS = 60; + + /** Algorithms a LoginRadius JWT app can be configured with. */ + public enum Algorithm { + HS256, + HS384, + HS512, + RS256, + RS384, + RS512, + ES256, + ES384, + ES512 + ; + + JWSAlgorithm toJwsAlgorithm() { + return JWSAlgorithm.parse(name()); + } + } + + private static final Set<String> HMAC = Set.of("HS256", "HS384", "HS512"); + private static final Set<String> RSA = Set.of("RS256", "RS384", "RS512"); + private static final Set<String> ECDSA = Set.of("ES256", "ES384", "ES512"); + + /** Raised when a token fails validation for any reason. */ + public static final class JwtValidationException extends Exception { + private static final long serialVersionUID = 1L; + private final String code; + + JwtValidationException(String code, String message) { + super(message); + this.code = code; + } + + JwtValidationException(String code, String message, Throwable cause) { + super(message, cause); + this.code = code; + } + + /** Short, stable reason: {@code algorithm_mismatch}, {@code expired}, {@code signature}, … */ + public String code() { + return code; + } + } + + /** Describes the token to verify and what to verify it against. */ + public static final class Params { + private final Algorithm algorithm; + private final byte[] key; + private String issuer; + private String audience; + + /** + * @param algorithm the algorithm your LoginRadius JWT app is configured for. Pinned + * deliberately: a validator that takes the algorithm from the token's own header can be + * attacked. Against an RS256 app, an attacker signs a token with HS256 using the PUBLIC key + * as the HMAC secret, and a trusting validator accepts it. {@code alg: none} is the same + * class of attack. + * @param key the shared secret for {@code HS*}, or the PEM-encoded PUBLIC key for {@code RS*} + * and {@code ES*} — never a private key. + */ + public Params(Algorithm algorithm, byte[] key) { + this.algorithm = algorithm; + this.key = key == null ? null : key.clone(); + } + + /** When set, must equal the token's {@code iss}. */ + public Params issuer(String value) { + this.issuer = value; + return this; + } + + /** When set, must appear in the token's {@code aud}. */ + public Params audience(String value) { + this.audience = value; + return this; + } + } + + /** + * Verifies {@code token} against {@code params} and returns its claims. + * + * <pre>{@code + * Map<String, Object> claims = + * JwtValidation.validate(token, + * new JwtValidation.Params(JwtValidation.Algorithm.HS256, secret.getBytes(UTF_8)) + * .issuer("LoginRadius")); + * }</pre> + * + * @throws JwtValidationException if the token is malformed, unsigned, signed with the wrong key + * or algorithm, expired, not yet valid, or fails an issuer/audience check. + */ + public static Map<String, Object> validate(String token, Params params) + throws JwtValidationException { + if (params == null || params.algorithm == null) { + throw new JwtValidationException("unsupported_algorithm", "no algorithm supplied"); + } + if (params.key == null || params.key.length == 0) { + throw new JwtValidationException("invalid_key", "no key supplied"); + } + + SignedJWT jwt; + try { + jwt = SignedJWT.parse(token); + } catch (Exception e) { + throw new JwtValidationException("malformed", "token is not a signed JWT", e); + } + + // THE PIN. Checked before any signature work, so a token announcing another + // algorithm — including "none" — never reaches verification. + JWSHeader header = jwt.getHeader(); + String announced = header.getAlgorithm() == null ? "" : header.getAlgorithm().getName(); + String expected = params.algorithm.name(); + if (!expected.equals(announced)) { + throw new JwtValidationException( + "algorithm_mismatch", + "token algorithm " + announced + " does not match the expected " + expected); + } + + try { + if (!jwt.verify(verifierFor(expected, params.key))) { + throw new JwtValidationException("signature", "signature verification failed"); + } + } catch (JwtValidationException e) { + throw e; + } catch (Exception e) { + throw new JwtValidationException("signature", "signature verification failed", e); + } + + JWTClaimsSet claims; + try { + claims = jwt.getJWTClaimsSet(); + } catch (Exception e) { + throw new JwtValidationException("malformed", "token payload is not a JSON object", e); + } + + long now = System.currentTimeMillis() / 1000L; + + Date exp = claims.getExpirationTime(); + if (exp == null) { + // A JWT with no expiry never stops being valid. + throw new JwtValidationException("missing_exp", "token has no exp claim"); + } + if (now > (exp.getTime() / 1000L) + CLOCK_SKEW_SECONDS) { + throw new JwtValidationException("expired", "token has expired"); + } + + Date nbf = claims.getNotBeforeTime(); + if (nbf != null && now + CLOCK_SKEW_SECONDS < nbf.getTime() / 1000L) { + throw new JwtValidationException("not_yet_valid", "token is not valid yet"); + } + + if (params.issuer != null && !params.issuer.equals(claims.getIssuer())) { + throw new JwtValidationException( + "issuer", "issuer " + claims.getIssuer() + " does not match the expected " + params.issuer); + } + + if (params.audience != null) { + List<String> aud = claims.getAudience(); + if (aud == null || !aud.contains(params.audience)) { + throw new JwtValidationException( + "audience", "audience does not include the expected " + params.audience); + } + } + + return claims.getClaims(); + } + + private static JWSVerifier verifierFor(String algorithm, byte[] key) + throws JwtValidationException { + try { + if (HMAC.contains(algorithm)) { + return new MACVerifier(key); + } + PublicKey pub = parsePublicKey(key); + if (RSA.contains(algorithm)) { + if (!(pub instanceof RSAPublicKey)) { + throw new JwtValidationException("invalid_key", "expected an RSA public key"); + } + return new RSASSAVerifier((RSAPublicKey) pub); + } + if (ECDSA.contains(algorithm)) { + if (!(pub instanceof ECPublicKey)) { + throw new JwtValidationException("invalid_key", "expected an ECDSA public key"); + } + return new ECDSAVerifier((ECPublicKey) pub); + } + throw new JwtValidationException("unsupported_algorithm", "unsupported algorithm " + algorithm); + } catch (JwtValidationException e) { + throw e; + } catch (Exception e) { + throw new JwtValidationException("invalid_key", "key is not usable: " + e.getMessage(), e); + } + } + + /** + * Accepts a PEM-encoded public key or certificate. A PRIVATE key is refused explicitly: passing + * one is a serious mistake worth naming rather than failing with a vague parse error. + */ + private static PublicKey parsePublicKey(byte[] key) throws Exception { + String pem = new String(key, StandardCharsets.UTF_8); + if (pem.contains("PRIVATE KEY")) { + throw new JwtValidationException( + "invalid_key", "a PRIVATE key was supplied; verification needs the PUBLIC key"); + } + if (pem.contains("BEGIN CERTIFICATE")) { + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + X509Certificate cert = + (X509Certificate) + cf.generateCertificate(new ByteArrayInputStream(key)); + return cert.getPublicKey(); + } + String body = + pem.replaceAll("-----BEGIN [A-Z ]+-----", "") + .replaceAll("-----END [A-Z ]+-----", "") + .replaceAll("\\s", ""); + if (body.isEmpty()) { + throw new JwtValidationException("invalid_key", "key is not PEM-encoded"); + } + byte[] der = Base64.getDecoder().decode(body); + X509EncodedKeySpec spec = new X509EncodedKeySpec(der); + // The key's own algorithm decides the factory; trying RSA then EC avoids + // asking the caller to tell us something the key already states. + try { + return KeyFactory.getInstance("RSA").generatePublic(spec); + } catch (Exception ignored) { + return KeyFactory.getInstance("EC").generatePublic(spec); + } + } +} diff --git a/src/main/java/com/loginradius/sdk/LoginRadiusClient.java b/src/main/java/com/loginradius/sdk/LoginRadiusClient.java new file mode 100644 index 0000000..d975b6b --- /dev/null +++ b/src/main/java/com/loginradius/sdk/LoginRadiusClient.java @@ -0,0 +1,394 @@ +// Code generated by the LoginRadius SDK generator; DO NOT EDIT. +// +// The service fields below are derived from the generated client in +// src/main/java/com/loginradius/sdk/internal/openapi, so a service added by a spec change appears here +// automatically. Base-URL precedence comes from the shared SDK manifest. + +package com.loginradius.sdk; + +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.api.AccountCustomObjectApi; +import com.loginradius.sdk.internal.openapi.api.AccountSecurityApi; +import com.loginradius.sdk.internal.openapi.api.AccountSessionApi; +import com.loginradius.sdk.internal.openapi.api.AccountsApi; +import com.loginradius.sdk.internal.openapi.api.BigCommerceSsoApi; +import com.loginradius.sdk.internal.openapi.api.CaptchaConfigurationApi; +import com.loginradius.sdk.internal.openapi.api.ConsentApi; +import com.loginradius.sdk.internal.openapi.api.CrossDeviceSsoApi; +import com.loginradius.sdk.internal.openapi.api.CustomFieldsApi; +import com.loginradius.sdk.internal.openapi.api.CustomObjectApi; +import com.loginradius.sdk.internal.openapi.api.CustomObjectsApi; +import com.loginradius.sdk.internal.openapi.api.DomainAccessRestrictionsApi; +import com.loginradius.sdk.internal.openapi.api.EmailTemplatesApi; +import com.loginradius.sdk.internal.openapi.api.IdentityApi; +import com.loginradius.sdk.internal.openapi.api.InsightsApi; +import com.loginradius.sdk.internal.openapi.api.IpAccessRestrictionsApi; +import com.loginradius.sdk.internal.openapi.api.JwtApi; +import com.loginradius.sdk.internal.openapi.api.JwtCustomProvidersApi; +import com.loginradius.sdk.internal.openapi.api.JwtIntegrationsApi; +import com.loginradius.sdk.internal.openapi.api.LoginApi; +import com.loginradius.sdk.internal.openapi.api.MultipurposeTokensApi; +import com.loginradius.sdk.internal.openapi.api.OAuthApi; +import com.loginradius.sdk.internal.openapi.api.OAuthClientsApi; +import com.loginradius.sdk.internal.openapi.api.OAuthCustomProvidersApi; +import com.loginradius.sdk.internal.openapi.api.OAuthIntegrationsApi; +import com.loginradius.sdk.internal.openapi.api.OAuthM2MApi; +import com.loginradius.sdk.internal.openapi.api.OidcApi; +import com.loginradius.sdk.internal.openapi.api.OrganizationApi; +import com.loginradius.sdk.internal.openapi.api.OrganizationConnectionGroupRolesApi; +import com.loginradius.sdk.internal.openapi.api.OrganizationConnectionsApi; +import com.loginradius.sdk.internal.openapi.api.OrganizationDomainsApi; +import com.loginradius.sdk.internal.openapi.api.OrganizationInvitationsApi; +import com.loginradius.sdk.internal.openapi.api.OrganizationUserRolesApi; +import com.loginradius.sdk.internal.openapi.api.PasskeyConfigurationApi; +import com.loginradius.sdk.internal.openapi.api.PasswordApi; +import com.loginradius.sdk.internal.openapi.api.PasswordPolicyApi; +import com.loginradius.sdk.internal.openapi.api.PerfectMindSsoApi; +import com.loginradius.sdk.internal.openapi.api.PermissionsApi; +import com.loginradius.sdk.internal.openapi.api.PushNotificationConfigurationApi; +import com.loginradius.sdk.internal.openapi.api.RegistrationApi; +import com.loginradius.sdk.internal.openapi.api.RolesApi; +import com.loginradius.sdk.internal.openapi.api.RolesManagementApi; +import com.loginradius.sdk.internal.openapi.api.SamlApi; +import com.loginradius.sdk.internal.openapi.api.SamlCustomProvidersApi; +import com.loginradius.sdk.internal.openapi.api.SamlIntegrationsApi; +import com.loginradius.sdk.internal.openapi.api.SecondFactorConfigurationApi; +import com.loginradius.sdk.internal.openapi.api.SecurityApi; +import com.loginradius.sdk.internal.openapi.api.SecurityQuestionsApi; +import com.loginradius.sdk.internal.openapi.api.SessionApi; +import com.loginradius.sdk.internal.openapi.api.ShopifySsoApi; +import com.loginradius.sdk.internal.openapi.api.SmsTemplatesApi; +import com.loginradius.sdk.internal.openapi.api.SocialProvidersApi; +import com.loginradius.sdk.internal.openapi.api.SottApi; +import com.loginradius.sdk.internal.openapi.api.UserApi; +import com.loginradius.sdk.internal.openapi.api.UserMigrationApi; +import com.loginradius.sdk.internal.openapi.api.WebhooksApi; +import com.loginradius.sdk.internal.openapi.api.WorkflowsApi; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import okhttp3.OkHttpClient; + +/** + * Entry point for all LoginRadius API calls. + * + * <p>Construct once per tenant / credential set and reuse — every service + * field shares the underlying HTTP client, interceptors, and configuration. + * + * <pre>{@code + * LoginRadiusClient client = LoginRadiusClient.create( + * LoginRadiusConfig.builder().apiKey(System.getenv("LR_API_KEY")).build()); + * }</pre> + * + * <p>The client exposes 57 services, one per tag in the OpenAPI + * specification. Customers must not reach into + * {@code com.loginradius.sdk.internal.openapi} — the supported surface is this package. + */ +public final class LoginRadiusClient { + + private final LoginRadiusConfig config; + private final ApiClient apiClient; + + // Service handles, one per OpenAPI tag (57 total). Names drop + // the "Api" suffix for cleaner call sites. + public final AccountCustomObjectApi accountCustomObject; + public final AccountSecurityApi accountSecurity; + public final AccountSessionApi accountSession; + public final AccountsApi accounts; + public final BigCommerceSsoApi bigCommerceSso; + public final CaptchaConfigurationApi captchaConfiguration; + public final ConsentApi consent; + public final CrossDeviceSsoApi crossDeviceSso; + public final CustomFieldsApi customFields; + public final CustomObjectApi customObject; + public final CustomObjectsApi customObjects; + public final DomainAccessRestrictionsApi domainAccessRestrictions; + public final EmailTemplatesApi emailTemplates; + public final IdentityApi identity; + public final InsightsApi insights; + public final IpAccessRestrictionsApi ipAccessRestrictions; + public final JwtApi jwt; + public final JwtCustomProvidersApi jwtCustomProviders; + public final JwtIntegrationsApi jwtIntegrations; + public final LoginApi login; + public final MultipurposeTokensApi multipurposeTokens; + public final OAuthApi oauth; + public final OAuthClientsApi oauthClients; + public final OAuthCustomProvidersApi oauthCustomProviders; + public final OAuthIntegrationsApi oauthIntegrations; + public final OAuthM2MApi oauthM2M; + public final OidcApi oidc; + public final OrganizationApi organization; + public final OrganizationConnectionGroupRolesApi organizationConnectionGroupRoles; + public final OrganizationConnectionsApi organizationConnections; + public final OrganizationDomainsApi organizationDomains; + public final OrganizationInvitationsApi organizationInvitations; + public final OrganizationUserRolesApi organizationUserRoles; + public final PasskeyConfigurationApi passkeyConfiguration; + public final PasswordApi password; + public final PasswordPolicyApi passwordPolicy; + public final PerfectMindSsoApi perfectMindSso; + public final PermissionsApi permissions; + public final PushNotificationConfigurationApi pushNotificationConfiguration; + public final RegistrationApi registration; + public final RolesApi roles; + public final RolesManagementApi rolesManagement; + public final SamlApi saml; + public final SamlCustomProvidersApi samlCustomProviders; + public final SamlIntegrationsApi samlIntegrations; + public final SecondFactorConfigurationApi secondFactorConfiguration; + public final SecurityApi security; + public final SecurityQuestionsApi securityQuestions; + public final SessionApi session; + public final ShopifySsoApi shopifySso; + public final SmsTemplatesApi smsTemplates; + public final SocialProvidersApi socialProviders; + public final SottApi sott; + public final UserApi user; + public final UserMigrationApi userMigration; + public final WebhooksApi webhooks; + public final WorkflowsApi workflows; + + private LoginRadiusClient(LoginRadiusConfig config) { + this.config = config; + + // A caller-supplied client is extended, never replaced: their proxy, TLS, + // dispatcher, and interceptors keep applying, and the SDK only adds its + // own credential-injection interceptor on top. The timeout is applied + // only when set explicitly, so we never override a timeout the caller + // configured on a client they own. + OkHttpClient.Builder builder = + config.httpClient() != null + ? config.httpClient().newBuilder() + : new OkHttpClient.Builder() + .connectTimeout(config.timeout().toMillis(), TimeUnit.MILLISECONDS) + .readTimeout(config.timeout().toMillis(), TimeUnit.MILLISECONDS) + .writeTimeout(config.timeout().toMillis(), TimeUnit.MILLISECONDS); + + if (config.httpClient() != null && config.timeoutSet()) { + builder + .connectTimeout(config.timeout().toMillis(), TimeUnit.MILLISECONDS) + .readTimeout(config.timeout().toMillis(), TimeUnit.MILLISECONDS) + .writeTimeout(config.timeout().toMillis(), TimeUnit.MILLISECONDS); + } + + // Network interceptor, not application: see SottEncodingInterceptor's own + // doc comment for why the fix has to run this late. + OkHttpClient http = builder + .addInterceptor(new AuthInterceptor(config)) + .addNetworkInterceptor(new SottEncodingInterceptor()) + .build(); + + this.apiClient = new ApiClient(http); + this.apiClient.setBasePath(config.resolveBaseUrl()); + applyServerSelection(this.apiClient, config); + + this.accountCustomObject = new AccountCustomObjectApi(apiClient); + this.accountSecurity = new AccountSecurityApi(apiClient); + this.accountSession = new AccountSessionApi(apiClient); + this.accounts = new AccountsApi(apiClient); + this.bigCommerceSso = new BigCommerceSsoApi(apiClient); + this.captchaConfiguration = new CaptchaConfigurationApi(apiClient); + this.consent = new ConsentApi(apiClient); + this.crossDeviceSso = new CrossDeviceSsoApi(apiClient); + this.customFields = new CustomFieldsApi(apiClient); + this.customObject = new CustomObjectApi(apiClient); + this.customObjects = new CustomObjectsApi(apiClient); + this.domainAccessRestrictions = new DomainAccessRestrictionsApi(apiClient); + this.emailTemplates = new EmailTemplatesApi(apiClient); + this.identity = new IdentityApi(apiClient); + this.insights = new InsightsApi(apiClient); + this.ipAccessRestrictions = new IpAccessRestrictionsApi(apiClient); + this.jwt = new JwtApi(apiClient); + this.jwtCustomProviders = new JwtCustomProvidersApi(apiClient); + this.jwtIntegrations = new JwtIntegrationsApi(apiClient); + this.login = new LoginApi(apiClient); + this.multipurposeTokens = new MultipurposeTokensApi(apiClient); + this.oauth = new OAuthApi(apiClient); + this.oauthClients = new OAuthClientsApi(apiClient); + this.oauthCustomProviders = new OAuthCustomProvidersApi(apiClient); + this.oauthIntegrations = new OAuthIntegrationsApi(apiClient); + this.oauthM2M = new OAuthM2MApi(apiClient); + this.oidc = new OidcApi(apiClient); + this.organization = new OrganizationApi(apiClient); + this.organizationConnectionGroupRoles = new OrganizationConnectionGroupRolesApi(apiClient); + this.organizationConnections = new OrganizationConnectionsApi(apiClient); + this.organizationDomains = new OrganizationDomainsApi(apiClient); + this.organizationInvitations = new OrganizationInvitationsApi(apiClient); + this.organizationUserRoles = new OrganizationUserRolesApi(apiClient); + this.passkeyConfiguration = new PasskeyConfigurationApi(apiClient); + this.password = new PasswordApi(apiClient); + this.passwordPolicy = new PasswordPolicyApi(apiClient); + this.perfectMindSso = new PerfectMindSsoApi(apiClient); + this.permissions = new PermissionsApi(apiClient); + this.pushNotificationConfiguration = new PushNotificationConfigurationApi(apiClient); + this.registration = new RegistrationApi(apiClient); + this.roles = new RolesApi(apiClient); + this.rolesManagement = new RolesManagementApi(apiClient); + this.saml = new SamlApi(apiClient); + this.samlCustomProviders = new SamlCustomProvidersApi(apiClient); + this.samlIntegrations = new SamlIntegrationsApi(apiClient); + this.secondFactorConfiguration = new SecondFactorConfigurationApi(apiClient); + this.security = new SecurityApi(apiClient); + this.securityQuestions = new SecurityQuestionsApi(apiClient); + this.session = new SessionApi(apiClient); + this.shopifySso = new ShopifySsoApi(apiClient); + this.smsTemplates = new SmsTemplatesApi(apiClient); + this.socialProviders = new SocialProvidersApi(apiClient); + this.sott = new SottApi(apiClient); + this.user = new UserApi(apiClient); + this.userMigration = new UserMigrationApi(apiClient); + this.webhooks = new WebhooksApi(apiClient); + this.workflows = new WorkflowsApi(apiClient); + + // Must run after the service fields exist: the override is per-service. + if (config.baseURL() != null && !config.baseURL().isEmpty()) { + pinEveryOperationTo(config.baseURL()); + } + } + + /** Creates a client from the supplied configuration. */ + public static LoginRadiusClient create(LoginRadiusConfig config) { + if (config == null) { + throw new IllegalArgumentException("loginradius: config is required"); + } + return new LoginRadiusClient(config); + } + + /** The configuration this client was built from. */ + public LoginRadiusConfig config() { + return config; + } + + /** + * The underlying generated client. Exposed for tests that need to swap the + * transport; production code should configure via {@link LoginRadiusConfig}. + */ + public ApiClient apiClient() { + return apiClient; + } + + /** + * Converts a generated {@link ApiException} into the facade's typed + * exception, so callers branch on {@code isAuth()} / {@code isRateLimit()} + * rather than on status codes. + */ + public static LoginRadiusException toLoginRadiusException(ApiException e) { + return LoginRadiusException.from(e); + } + + /** + * Reconciles the per-operation server lists the spec pins with the client's + * configuration. + * + * <p>The spec pins 42 operations to their own host — + * cloud-api, migration, and the tenant-hub / custom-domain templates. The + * generator inlines each pin into the operation itself, so neither + * {@code setBasePath} nor the client-level server list reaches them. + * + * <p>Every template variable is given a value here, falling back to the + * spec's own placeholder when the caller configured no tenant. Leaving one + * unset would put a literal {@code {TenantName}} in the request + * host: okhttp accepts that URL and lowercases it, so the call fails as a + * DNS error rather than as anything actionable. + */ + private static void applyServerSelection(ApiClient client, LoginRadiusConfig cfg) { + Map<String, String> vars = new HashMap<>(); + vars.put( + "TenantName", + cfg.domain() != null && !cfg.domain().isEmpty() + ? cfg.domain() + : "TenantName"); + vars.put( + "CustomDomain", + cfg.customDomain() != null && !cfg.customDomain().isEmpty() + ? cfg.customDomain() + : "auth.example.com"); + vars.put( + "domain", + cfg.domain() != null && !cfg.domain().isEmpty() + ? cfg.domain() + : "example"); + client.setServerVariables(vars); + + // Escape hatch: selects from the spec's own server list for operations the + // spec does not pin. Applied after setBasePath, which clears the index. + if (cfg.serverIndex() != null) { + client.setServerIndex(cfg.serverIndex()); + } + } + + /** + * Points every operation at {@code baseUrl}, including the + * 42 the spec pins elsewhere. + * + * <p>An explicit base URL means "send everything here" — a proxy, a mock, or + * a staging environment. Without this a caller who set one would still see + * their migration, cloud-api, and OIDC traffic go to production. + * + * <p>{@code setCustomBaseUrl} is the only per-operation override the + * generated layer offers, and it is declared on each service rather than on + * the shared {@link ApiClient}, so it has to be set once per service. + */ + private void pinEveryOperationTo(String baseUrl) { + this.accountCustomObject.setCustomBaseUrl(baseUrl); + this.accountSecurity.setCustomBaseUrl(baseUrl); + this.accountSession.setCustomBaseUrl(baseUrl); + this.accounts.setCustomBaseUrl(baseUrl); + this.bigCommerceSso.setCustomBaseUrl(baseUrl); + this.captchaConfiguration.setCustomBaseUrl(baseUrl); + this.consent.setCustomBaseUrl(baseUrl); + this.crossDeviceSso.setCustomBaseUrl(baseUrl); + this.customFields.setCustomBaseUrl(baseUrl); + this.customObject.setCustomBaseUrl(baseUrl); + this.customObjects.setCustomBaseUrl(baseUrl); + this.domainAccessRestrictions.setCustomBaseUrl(baseUrl); + this.emailTemplates.setCustomBaseUrl(baseUrl); + this.identity.setCustomBaseUrl(baseUrl); + this.insights.setCustomBaseUrl(baseUrl); + this.ipAccessRestrictions.setCustomBaseUrl(baseUrl); + this.jwt.setCustomBaseUrl(baseUrl); + this.jwtCustomProviders.setCustomBaseUrl(baseUrl); + this.jwtIntegrations.setCustomBaseUrl(baseUrl); + this.login.setCustomBaseUrl(baseUrl); + this.multipurposeTokens.setCustomBaseUrl(baseUrl); + this.oauth.setCustomBaseUrl(baseUrl); + this.oauthClients.setCustomBaseUrl(baseUrl); + this.oauthCustomProviders.setCustomBaseUrl(baseUrl); + this.oauthIntegrations.setCustomBaseUrl(baseUrl); + this.oauthM2M.setCustomBaseUrl(baseUrl); + this.oidc.setCustomBaseUrl(baseUrl); + this.organization.setCustomBaseUrl(baseUrl); + this.organizationConnectionGroupRoles.setCustomBaseUrl(baseUrl); + this.organizationConnections.setCustomBaseUrl(baseUrl); + this.organizationDomains.setCustomBaseUrl(baseUrl); + this.organizationInvitations.setCustomBaseUrl(baseUrl); + this.organizationUserRoles.setCustomBaseUrl(baseUrl); + this.passkeyConfiguration.setCustomBaseUrl(baseUrl); + this.password.setCustomBaseUrl(baseUrl); + this.passwordPolicy.setCustomBaseUrl(baseUrl); + this.perfectMindSso.setCustomBaseUrl(baseUrl); + this.permissions.setCustomBaseUrl(baseUrl); + this.pushNotificationConfiguration.setCustomBaseUrl(baseUrl); + this.registration.setCustomBaseUrl(baseUrl); + this.roles.setCustomBaseUrl(baseUrl); + this.rolesManagement.setCustomBaseUrl(baseUrl); + this.saml.setCustomBaseUrl(baseUrl); + this.samlCustomProviders.setCustomBaseUrl(baseUrl); + this.samlIntegrations.setCustomBaseUrl(baseUrl); + this.secondFactorConfiguration.setCustomBaseUrl(baseUrl); + this.security.setCustomBaseUrl(baseUrl); + this.securityQuestions.setCustomBaseUrl(baseUrl); + this.session.setCustomBaseUrl(baseUrl); + this.shopifySso.setCustomBaseUrl(baseUrl); + this.smsTemplates.setCustomBaseUrl(baseUrl); + this.socialProviders.setCustomBaseUrl(baseUrl); + this.sott.setCustomBaseUrl(baseUrl); + this.user.setCustomBaseUrl(baseUrl); + this.userMigration.setCustomBaseUrl(baseUrl); + this.webhooks.setCustomBaseUrl(baseUrl); + this.workflows.setCustomBaseUrl(baseUrl); + } + +} diff --git a/src/main/java/com/loginradius/sdk/LoginRadiusConfig.java b/src/main/java/com/loginradius/sdk/LoginRadiusConfig.java new file mode 100644 index 0000000..2ed34a1 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/LoginRadiusConfig.java @@ -0,0 +1,500 @@ +// Code generated by the LoginRadius SDK generator; DO NOT EDIT. +// +// Credentials, defaults, base-URL precedence, and the cross-cutting request +// options come from the shared SDK manifest. Edit the manifest and regenerate so the +// change lands in every LoginRadius SDK at once. + +package com.loginradius.sdk; + +import java.io.PrintStream; +import java.time.Duration; +import java.util.LinkedHashMap; +import java.util.Map; +import okhttp3.OkHttpClient; + +/** + * Configuration for {@link LoginRadiusClient}. Build with {@link #builder()}. + * + * <p>Supply only the credentials your endpoints require — at least one is + * required, and the builder fails fast if none is set. + */ +public final class LoginRadiusConfig { + + /** Default request timeout. */ + public static final Duration DEFAULT_TIMEOUT = Duration.ofMillis(30000L); + + /** Default API server when no server option is set. */ + public static final String DEFAULT_BASE_URL = "https://api.loginradius.com"; + + /** Default User-Agent. */ + public static final String DEFAULT_USER_AGENT = "loginradius-java/" + Version.VERSION; + + private final String apiKey; + private final String apiSecret; + private final String clientId; + private final String clientSecret; + private final String xLoginRadiusApiKey; + private final String xLoginRadiusApiSecret; + private final String accessToken; + private final String bearerToken; + private final String m2mBearerToken; + private final String baseURL; + private final String customDomain; + private final String domain; + private final String originIp; + private final String serverRegion; + private final String fields; + private final boolean preventWebhook; + private final Map<String, String> defaultHeaders; + private final boolean apiRequestSigning; + private final PrintStream debug; + private final Integer serverIndex; + private final Duration timeout; + private final boolean timeoutSet; + private final OkHttpClient httpClient; + private final String userAgent; + + private LoginRadiusConfig(Builder b) { + this.apiKey = b.apiKey; + this.apiSecret = b.apiSecret; + this.clientId = b.clientId; + this.clientSecret = b.clientSecret; + this.xLoginRadiusApiKey = b.xLoginRadiusApiKey; + this.xLoginRadiusApiSecret = b.xLoginRadiusApiSecret; + this.accessToken = b.accessToken; + this.bearerToken = b.bearerToken; + this.m2mBearerToken = b.m2mBearerToken; + this.baseURL = b.baseURL; + this.customDomain = b.customDomain; + this.domain = b.domain; + this.originIp = b.originIp; + this.serverRegion = b.serverRegion; + this.fields = b.fields; + this.preventWebhook = b.preventWebhook; + this.defaultHeaders = b.defaultHeaders; + this.apiRequestSigning = b.apiRequestSigning; + this.debug = b.debug; + this.serverIndex = b.serverIndex; + this.timeout = b.timeout; + this.timeoutSet = b.timeoutSet; + this.httpClient = b.httpClient; + this.userAgent = b.userAgent; + } + + public static Builder builder() { + return new Builder(); + } + + public String apiKey() { + return apiKey; + } + + public String apiSecret() { + return apiSecret; + } + + public String clientId() { + return clientId; + } + + public String clientSecret() { + return clientSecret; + } + + public String xLoginRadiusApiKey() { + return xLoginRadiusApiKey; + } + + public String xLoginRadiusApiSecret() { + return xLoginRadiusApiSecret; + } + + public String accessToken() { + return accessToken; + } + + public String bearerToken() { + return bearerToken; + } + + public String m2mBearerToken() { + return m2mBearerToken; + } + + public String baseURL() { + return baseURL; + } + + public String customDomain() { + return customDomain; + } + + public String domain() { + return domain; + } + + public String originIp() { + return originIp; + } + + public String serverRegion() { + return serverRegion; + } + + public String fields() { + return fields; + } + + public boolean preventWebhook() { + return preventWebhook; + } + + public Map<String, String> defaultHeaders() { + return defaultHeaders; + } + + public boolean apiRequestSigning() { + return apiRequestSigning; + } + + public PrintStream debug() { + return debug; + } + + public Integer serverIndex() { + return serverIndex; + } + + public Duration timeout() { + return timeout; + } + + /** The caller-supplied HTTP client, or {@code null} to build a default one. */ + public OkHttpClient httpClient() { + return httpClient; + } + + public boolean timeoutSet() { + return timeoutSet; + } + + public String userAgent() { + return userAgent; + } + + /** + * Resolves the API base URL. Precedence, highest first: + * + * <ul> + * <li>{@code baseURL} → {@code <baseURL>}</li> + * <li>{@code customDomain} → {@code https://<customDomain>}</li> + * <li>{@code domain} → {@code https://<domain>.hub.loginradius.com}</li> + * <li>fallback → {@code https://api.loginradius.com}</li> + * </ul> + */ + public String resolveBaseUrl() { + if (baseURL != null && !baseURL.isEmpty()) { + return baseURL; + } + if (customDomain != null && !customDomain.isEmpty()) { + return "https://" + customDomain; + } + if (domain != null && !domain.isEmpty()) { + return "https://" + domain + ".hub.loginradius.com"; + } + return DEFAULT_BASE_URL; + } + + /** Builder for {@link LoginRadiusConfig}. */ + public static final class Builder { + private String apiKey; + private String apiSecret; + private String clientId; + private String clientSecret; + private String xLoginRadiusApiKey; + private String xLoginRadiusApiSecret; + private String accessToken; + private String bearerToken; + private String m2mBearerToken; + private String baseURL; + private String customDomain; + private String domain; + private String originIp; + private String serverRegion; + private String fields; + private boolean preventWebhook; + private Map<String, String> defaultHeaders = new LinkedHashMap<>(); + private boolean apiRequestSigning; + private PrintStream debug; + private Integer serverIndex; + private Duration timeout = DEFAULT_TIMEOUT; + private boolean timeoutSet; + private OkHttpClient httpClient; + private String userAgent = DEFAULT_USER_AGENT; + + /** + * Tenant API key. Sent as the `X-LoginRadius-ApiKey` header (preferred) + * with the legacy `apikey=` query parameter as a compatibility fallback. + */ + public Builder apiKey(String v) { + this.apiKey = v; + return this; + } + + /** + * Tenant API secret. Sent as the `X-LoginRadius-ApiSecret` header + * (preferred) with the legacy `apisecret=` query parameter as a + * compatibility fallback. + * + * <p><b>Server-side only</b> — never expose this in a browser or mobile + * context. + */ + public Builder apiSecret(String v) { + this.apiSecret = v; + return this; + } + + /** + * The application client_id used by OAuth-style endpoints. + */ + public Builder clientId(String v) { + this.clientId = v; + return this; + } + + /** + * The application client_secret used by OAuth-style endpoints. + * + * <p><b>Server-side only</b> — never expose this in a browser or mobile + * context. + */ + public Builder clientSecret(String v) { + this.clientSecret = v; + return this; + } + + /** + * Overrides the value sent in the `X-LoginRadius-ApiKey` header. Normally + * unnecessary — `apiKey` already populates the header. Use this only when + * the header credential must differ from the query-param credential (e.g. + * routing through an internal gateway that rewrites one but not the + * other). + */ + public Builder xLoginRadiusApiKey(String v) { + this.xLoginRadiusApiKey = v; + return this; + } + + /** + * Overrides the value sent in the `X-LoginRadius-ApiSecret` header. See + * `xLoginRadiusApiKey` for when this is useful. + */ + public Builder xLoginRadiusApiSecret(String v) { + this.xLoginRadiusApiSecret = v; + return this; + } + + /** + * The user-context access_token. Required for endpoints that operate on + * the signed-in user's own profile or sessions. + */ + public Builder accessToken(String v) { + this.accessToken = v; + return this; + } + + /** + * The token used by endpoints secured with the BearerToken scheme, sent as + * `Authorization: Bearer <token>`. Wins over m2mBearerToken when both are + * set. + */ + public Builder bearerToken(String v) { + this.bearerToken = v; + return this; + } + + /** + * The JWT used for machine-to-machine endpoints. + */ + public Builder m2mBearerToken(String v) { + this.m2mBearerToken = v; + return this; + } + + /** + * Explicit base URL override. Use only for staging or proxy environments — + * production traffic should rely on `domain`. + * + * <p>Resolves to {@code <baseURL>}. + */ + public Builder baseURL(String v) { + this.baseURL = v; + return this; + } + + /** + * Customer-hosted base URL. + * + * <p>Resolves to {@code https://<customDomain>}. + */ + public Builder customDomain(String v) { + this.customDomain = v; + return this; + } + + /** + * Multi-tenant hosted-page server. + * + * <p>Resolves to {@code https://<domain>.hub.loginradius.com}. + */ + public Builder domain(String v) { + this.domain = v; + return this; + } + + /** + * The end user's IP address, forwarded for risk-based authentication and + * audit trails. Deliberately NOT in the OpenAPI spec — v11 sent it as a + * client-wide header, so the facade does the same. + */ + public Builder originIp(String v) { + this.originIp = v; + return this; + } + + /** + * Routes requests to a regional API host. Distinct from domain and + * customDomain, which select a tenant rather than a region. + */ + public Builder serverRegion(String v) { + this.serverRegion = v; + return this; + } + + /** + * Global response-field selector applied to every request. Replaces v11's + * fieldsParam/fieldsValue pair, which required the caller to supply the + * query separator; pass only the value here. + */ + public Builder fields(String v) { + this.fields = v; + return this; + } + + /** + * Suppresses webhook delivery for every request from this client. + * Individual operations also accept a per-call parameter. + */ + public Builder preventWebhook(boolean v) { + this.preventWebhook = v; + return this; + } + + /** + * Merges headers into every outgoing request. + * + * <p>Applied at the LOWEST precedence: the SDK's own credential, + * User-Agent, and signing headers always win, so a default header can + * never mask a credential. + */ + public Builder defaultHeaders(Map<String, String> headers) { + if (headers != null) { + this.defaultHeaders.putAll(headers); + } + return this; + } + + /** + * Enables request signing (the {@code digest} and + * {@code x-Request-Expires} headers) for management endpoints. + * + * <p>Off by default. Requires {@code apiSecret} — the signature is an HMAC + * over the tenant secret. Server-side only. + */ + public Builder apiRequestSigning(boolean enabled) { + this.apiRequestSigning = enabled; + return this; + } + + /** + * Writes a one-line summary of every request to {@code out}. + * + * <p>Credential and signing header VALUES are replaced with + * {@code [REDACTED]} — the stream only ever sees header names. + */ + public Builder debug(PrintStream out) { + this.debug = out; + return this; + } + + /** + * Selects which server entry to use for the operations the spec pins to + * their own host list. + * + * <p>You rarely need this: an explicit {@code baseUrl} already overrides + * those pins, and {@code domain} / {@code customDomain} fill their + * template variables. + */ + public Builder serverIndex(Integer i) { + this.serverIndex = i; + return this; + } + + /** + * Request timeout. Default 30000 ms. + * + * <p>When {@link #httpClient(OkHttpClient)} is also supplied, this is + * applied to a copy of that client — an explicit timeout is honoured + * because you asked for it, while an unset one leaves your client's own + * configuration alone. + */ + public Builder timeout(Duration d) { + this.timeout = d; + this.timeoutSet = true; + return this; + } + + /** + * Supplies a pre-configured {@link OkHttpClient}. + * + * <p>The SDK derives a client from it and adds its own interceptor for + * credential injection, so your proxy, TLS, dispatcher, and any + * interceptors you installed continue to apply. + */ + public Builder httpClient(OkHttpClient client) { + this.httpClient = client; + return this; + } + + /** Overrides the User-Agent. Default {@code loginradius-java/12.0.0-rc.1}. */ + public Builder userAgent(String ua) { + this.userAgent = ua; + return this; + } + + /** + * Validates and builds. + * + * @throws IllegalArgumentException when no credential is supplied + */ + public LoginRadiusConfig build() { + boolean hasCredential = + (apiKey != null && !apiKey.isEmpty()) + || + (clientId != null && !clientId.isEmpty()) + || + (xLoginRadiusApiKey != null && !xLoginRadiusApiKey.isEmpty()) + || + (accessToken != null && !accessToken.isEmpty()) + || + (bearerToken != null && !bearerToken.isEmpty()) + || + (m2mBearerToken != null && !m2mBearerToken.isEmpty()); + if (!hasCredential) { + throw new IllegalArgumentException( + "loginradius: at least one credential is required (apiKey, clientId, xLoginRadiusApiKey, accessToken, bearerToken, m2mBearerToken)"); + } + return new LoginRadiusConfig(this); + } + } +} diff --git a/src/main/java/com/loginradius/sdk/LoginRadiusException.java b/src/main/java/com/loginradius/sdk/LoginRadiusException.java new file mode 100644 index 0000000..5aa581e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/LoginRadiusException.java @@ -0,0 +1,223 @@ +// Code generated by the LoginRadius SDK generator; DO NOT EDIT. +// +// The predicates, the error-envelope shapes, the field-alias probing order, +// and the status hints all come from the shared SDK manifest, so every LoginRadius +// SDK classifies and describes the same failure the same way. + +package com.loginradius.sdk; + +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import com.loginradius.sdk.internal.openapi.ApiException; +import java.util.Arrays; +import java.util.List; +import java.util.Locale; + +/** + * The typed exception thrown by every client method on a non-2xx response or + * transport failure. + * + * <p>Branch on the predicates for the common cases, or inspect + * {@link #code()}, {@link #description()} and {@link #rawBody()} for + * diagnostics. + */ +public class LoginRadiusException extends RuntimeException { + + private static final long serialVersionUID = 1L; + + private final int statusCode; + private final String code; + private final String description; + private final String rawBody; + + LoginRadiusException(String message, int statusCode, String code, String description, + String rawBody, Throwable cause) { + super(message, cause); + this.statusCode = statusCode; + this.code = code == null ? "" : code; + this.description = description == null ? "" : description; + this.rawBody = rawBody == null ? "" : rawBody; + } + + /** HTTP status from the API; 0 when the request never reached the server. */ + public int statusCode() { + return statusCode; + } + + /** LoginRadius error code from the envelope; empty for transport errors. */ + public String code() { + return code; + } + + /** Long-form description from the envelope, or a status-based hint. */ + public String description() { + return description; + } + + /** The response body verbatim. */ + public String rawBody() { + return rawBody; + } + + /** + * Authentication failed — missing or invalid credentials. Distinct from + * isForbidden: a 403 means the request authenticated but the principal + * isn't allowed to perform the operation. + */ + public boolean isAuth() { + return statusCode == 401; + } + + /** + * Authenticated but not allowed. In LoginRadius this commonly indicates + * IP/domain access restrictions or a feature that isn't enabled on the + * tenant's plan, rather than a credential problem. + */ + public boolean isForbidden() { + return statusCode == 403; + } + + /** + * Rate limited by the API. + */ + public boolean isRateLimit() { + return statusCode == 429; + } + + /** + * A 5xx from the API. + */ + public boolean isServer() { + return statusCode >= 500 && statusCode <= 599; + } + + /** + * Converts a generated {@link ApiException} into a typed exception. + * + * <p>Wire shapes currently modelled: + * + * <ul> + * <li>{@code ApiError} — The original LoginRadius shape, used by most endpoints.</li> + * <li>{@code ErrorResponse} — Variant with an extra HTTP Code field.</li> + * <li>{@code ErrorResponseNative} — camelCase fields used by /api/v2/access_token/*.</li> + * <li>{@code OAuthErrorResponse} — { error, error_description } from OAuth token endpoints.</li> + * </ul> + */ + static LoginRadiusException from(ApiException e) { + int status = e.getCode(); + String body = e.getResponseBody(); + + String code = ""; + String message = ""; + String description = ""; + + JsonObject envelope = parse(body); + if (envelope != null) { + code = firstNonEmpty(envelope, "ErrorCode", "errorCode", "error_code", "Error", "error"); + message = firstNonEmpty(envelope, "Message", "message"); + description = firstNonEmpty(envelope, "Description", "description", "error_description", "ErrorDescription"); + } + + if (message.isEmpty()) { + message = !description.isEmpty() ? description : e.getMessage(); + } + // An empty body is common when an upstream gateway, WAF, or IP + // restriction blocks the request before the API layer responds, so a + // status-based hint gives the caller something actionable. + if (description.isEmpty() && status != 0) { + description = defaultDescriptionForStatus(status, body); + } + + String rendered = !code.isEmpty() && !message.isEmpty() + ? String.format(Locale.ROOT, "loginradius: %d %s (%s)", status, message, code) + : String.format(Locale.ROOT, "loginradius: %d %s", status, message); + + return new LoginRadiusException(rendered, status, code, description, body, e); + } + + private static JsonObject parse(String body) { + if (body == null || body.isEmpty()) { + return null; + } + try { + JsonElement el = JsonParser.parseString(body); + return el.isJsonObject() ? el.getAsJsonObject() : null; + } catch (RuntimeException ex) { + return null; // non-JSON body + } + } + + /** + * Returns the first non-empty value among the candidate keys, matched + * case-insensitively so every casing the API uses is handled by one lookup. + * + * <p>Only strings and numbers are accepted: LoginRadius sends error codes as + * numbers and the text fields as strings. A nested object under one of these + * keys is skipped rather than stringified. + */ + private static String firstNonEmpty(JsonObject obj, String... candidates) { + List<String> wanted = Arrays.asList(candidates); + for (String key : obj.keySet()) { + for (String candidate : wanted) { + if (!key.equalsIgnoreCase(candidate)) { + continue; + } + JsonElement v = obj.get(key); + if (v == null || !v.isJsonPrimitive()) { + continue; + } + String s = v.getAsJsonPrimitive().isNumber() + ? v.getAsJsonPrimitive().getAsNumber().toString() + : v.getAsString(); + if (s != null && !s.isEmpty() && !"0".equals(s)) { + return s; + } + } + } + return ""; + } + + /** Operator-facing hints for statuses whose bodies commonly arrive empty. */ + private static String defaultDescriptionForStatus(int status, String body) { + String hint = ""; + switch (status) { + case 401: + hint = "authentication failed — verify API key / API secret / access token"; + break; + case 403: + hint = "forbidden — typically an IP-access restriction, domain-access restriction, or a plan-level feature gate. Check the LoginRadius dashboard's security settings."; + break; + case 404: + hint = "not found — verify the path and any IDs in the request"; + break; + case 429: + hint = "rate limited — back off and retry"; + break; + case 502: + case 503: + case 504: + hint = "transient upstream failure — retry with backoff"; + break; + default: + break; + } + String excerpt = bodyExcerpt(body, 240); + if (excerpt.isEmpty()) { + return hint; + } + return hint.isEmpty() ? excerpt : hint + " — body: " + excerpt; + } + + /** Single-line snippet of a body, for embedding in a description. */ + private static String bodyExcerpt(String body, int max) { + if (body == null || body.isEmpty()) { + return ""; + } + String collapsed = body.trim().replaceAll("\\s+", " "); + if (collapsed.isEmpty()) { + return ""; + } + return collapsed.length() > max ? collapsed.substring(0, max) + "…" : collapsed; + } +} diff --git a/src/main/java/com/loginradius/sdk/Signing.java b/src/main/java/com/loginradius/sdk/Signing.java new file mode 100644 index 0000000..14a978a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/Signing.java @@ -0,0 +1,144 @@ +// Code generated by the LoginRadius SDK generator; DO NOT EDIT. +// +// The algorithm parameters come from the shared SDK manifest, which every +// LoginRadius SDK renders from, so the implementations cannot drift. + +package com.loginradius.sdk; + +import java.nio.charset.StandardCharsets; +import java.text.SimpleDateFormat; +import java.util.Base64; +import java.util.Date; +import java.util.TimeZone; +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; + +/** + * Request signing: the {@code digest} and + * {@code x-Request-Expires} headers the LoginRadius API accepts on + * management endpoints. + * + * <p><b>Server-side only</b> — signing requires the tenant API secret. + */ +public final class Signing { + + /** How far ahead the expiry stamp is set. */ + public static final long EXPIRY_MILLIS = 1200L * 1000L; + + public static final String DIGEST_HEADER = "digest"; + public static final String EXPIRES_HEADER = "x-Request-Expires"; + + private static final String DIGEST_PREFIX = "SHA-256="; + // Removed from the URL before signing: the tenant secret must never appear + // in the string that is signed, nor on the wire for a signed request. + static final String STRIP_PARAM = "apisecret"; + + private Signing() {} + + /** The digest and expiry stamp for one request. */ + public static final class Headers { + public final String digest; + public final String expires; + + Headers(String digest, String expires) { + this.digest = digest; + this.expires = expires; + } + } + + /** + * Whether a request path is in scope for signing. + * + * <p>Management endpoints are signed, except the access-token exchange. + * Signing anything else produces a digest the API does not expect. + */ + public static boolean shouldSign(String path) { + return path != null + && path.contains("/manage/") + && !path.contains("/account/access_token"); + } + + /** + * Computes the digest and expiry stamp for one request. + * + * <p>The signed string is + * {@code expiry + ":" + encodeURIComponent(decodeURIComponent(uri)).toLowerCase()} + * plus {@code ":" + body} when a body is present. + * + * <p>{@code uri} must already have the strip parameter removed. + */ + public static Headers sign(String apiSecret, String uri, String body, Date now) { + String expires = formatExpiry(new Date(now.getTime() + EXPIRY_MILLIS)); + + // decode-then-encode normalises whatever escaping the caller used, so the + // same logical URL always signs identically. + String decoded; + try { + decoded = java.net.URLDecoder.decode(uri, StandardCharsets.UTF_8); + } catch (IllegalArgumentException e) { + // Not decodable means it was never encoded; sign it as-is rather than + // failing the request. + decoded = uri; + } + String encoded = encodeUriComponent(decoded).toLowerCase(java.util.Locale.ROOT); + + String text = (body != null && !body.isEmpty()) + ? expires + ":" + encoded + ":" + body + : expires + ":" + encoded; + + try { + Mac mac = Mac.getInstance("HmacSHA256"); + mac.init(new SecretKeySpec(apiSecret.getBytes(StandardCharsets.UTF_8), "HmacSHA256")); + String digest = + DIGEST_PREFIX + + Base64.getEncoder().encodeToString(mac.doFinal(text.getBytes(StandardCharsets.UTF_8))); + return new Headers(digest, expires); + } catch (Exception e) { + throw new IllegalStateException("loginradius: request signing failed", e); + } + } + + /** + * Formats the expiry stamp: UTC, fully zero-padded. + * + * <p>Note this is NOT the same shape as the SOTT timestamp, which pads the + * hour only — the two formats must not share a formatter. + */ + private static String formatExpiry(Date d) { + SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + fmt.setTimeZone(TimeZone.getTimeZone("UTC")); + return fmt.format(d); + } + + /** + * Reproduces JavaScript's {@code encodeURIComponent} exactly. + * + * <p>{@code URLEncoder.encode} is NOT equivalent: it renders a space as + * {@code +} and escapes {@code !'()*~}, while encodeURIComponent leaves + * those alone and renders a space as {@code %20}. Signing a URL containing + * an email address (which may legally contain {@code ! ' *}) with the wrong + * escaper produces a digest the API rejects, so the rule is spelled out here + * rather than inherited from the JDK. + * + * <p>Unreserved per encodeURIComponent: {@code A-Z a-z 0-9 - _ . ! ~ * ' ( )} + */ + static String encodeUriComponent(String s) { + final String hex = "0123456789ABCDEF"; + StringBuilder out = new StringBuilder(s.length() * 2); + for (byte b : s.getBytes(StandardCharsets.UTF_8)) { + int c = b & 0xFF; + boolean unreserved = + (c >= 'A' && c <= 'Z') + || (c >= 'a' && c <= 'z') + || (c >= '0' && c <= '9') + || c == '-' || c == '_' || c == '.' || c == '!' + || c == '~' || c == '*' || c == '\'' || c == '(' || c == ')'; + if (unreserved) { + out.append((char) c); + } else { + out.append('%').append(hex.charAt(c >> 4)).append(hex.charAt(c & 0xF)); + } + } + return out.toString(); + } +} diff --git a/src/main/java/com/loginradius/sdk/Sott.java b/src/main/java/com/loginradius/sdk/Sott.java new file mode 100644 index 0000000..a4cf173 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/Sott.java @@ -0,0 +1,129 @@ +// Code generated by the LoginRadius SDK generator; DO NOT EDIT. +// +// The algorithm parameters below come from the shared SDK manifest, which every +// LoginRadius SDK renders from — so the Go, Node, Java and .NET +// implementations cannot drift. A mismatched IV or iteration count produces a +// token the API rejects with no useful diagnostic, which is exactly why these +// are not hand-written per language. + +package com.loginradius.sdk; + +import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.security.spec.InvalidKeySpecException; +import java.text.SimpleDateFormat; +import java.util.Base64; +import java.util.Date; +import java.util.TimeZone; +import javax.crypto.Cipher; +import javax.crypto.SecretKeyFactory; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.PBEKeySpec; +import javax.crypto.spec.SecretKeySpec; + +/** + * SOTT (Secure One-Time Token) generation. + * + * <p>A SOTT proves to the LoginRadius API that a request originated from a + * trusted server holding the tenant's API key AND secret. Registration + * endpoints require one because there is no user access token yet. + * + * <p>The token is {@code base64(AES-256-CBC("start#apiKey#end"))*md5hex(base64)}. + * + * <p><b>Server-side only.</b> Generating a SOTT requires the API secret, so + * this must never run in a browser, a mobile client, or anything else a user + * controls — doing so would expose the tenant secret to every user. Mint the + * token on your server and hand only the token to the client. + */ +public final class Sott { + + /** Validity window applied by {@link #generate(String, String)}. */ + public static final long DEFAULT_WINDOW_MILLIS = 600000L; + + // Shared constant IV, not a per-message nonce — every LoginRadius SDK uses it. + private static final byte[] IV = "tu89geji340t89u2".getBytes(StandardCharsets.UTF_8); + private static final int PBKDF2_ITERATIONS = 10000; + private static final int PBKDF2_KEY_BITS = 32 * 8; + // Empty salt — matches the other LoginRadius SDKs. Do not change. + private static final byte[] PBKDF2_SALT = new byte[8]; + + private Sott() {} + + /** + * Returns a SOTT valid from now until now + 10 + * minutes. + * + * @param apiKey tenant API key + * @param apiSecret tenant API secret; server-side only + * @return the SOTT + */ + public static String generate(String apiKey, String apiSecret) { + long now = System.currentTimeMillis(); + return generateWithWindow(apiKey, apiSecret, new Date(now), new Date(now + DEFAULT_WINDOW_MILLIS)); + } + + /** + * Mints a SOTT bound to an explicit {@code [start, end]} validity window. + * Use when you have reconciled against a server-time fetch, or need to + * reproduce a specific timestamp. + */ + public static String generateWithWindow(String apiKey, String apiSecret, Date start, Date end) { + if (apiKey == null || apiKey.isEmpty()) { + throw new IllegalArgumentException("loginradius: generateSOTT requires apiKey"); + } + if (apiSecret == null || apiSecret.isEmpty()) { + throw new IllegalArgumentException("loginradius: generateSOTT requires apiSecret"); + } + + String plaintext = formatTime(start) + "#" + apiKey + "#" + formatTime(end); + + try { + SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1"); + byte[] key = + factory + .generateSecret( + new PBEKeySpec( + apiSecret.toCharArray(), PBKDF2_SALT, PBKDF2_ITERATIONS, PBKDF2_KEY_BITS)) + .getEncoded(); + + // PKCS5Padding is PKCS7 for a 16-byte block, which is what AES uses. + Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); + cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(key, "AES"), new IvParameterSpec(IV)); + String token = + Base64.getEncoder() + .encodeToString(cipher.doFinal(plaintext.getBytes(StandardCharsets.UTF_8))); + + MessageDigest md5 = MessageDigest.getInstance("md5"); + return token + "*" + toHex(md5.digest(token.getBytes(StandardCharsets.UTF_8))); + } catch (NoSuchAlgorithmException | InvalidKeySpecException e) { + throw new IllegalStateException("loginradius: SOTT algorithm unavailable", e); + } catch (Exception e) { + throw new IllegalStateException("loginradius: SOTT encryption failed", e); + } + } + + /** + * Formats a timestamp as {@code YYYY/M/D HH:M:S} in UTC. + * + * <p>The padding is deliberately ASYMMETRIC and the API is strict about it: + * the hour is zero-padded to two digits, while month, day, minute and second + * are not. {@code HH} pads; {@code M}, {@code d}, {@code m} and {@code s} do + * not. + * + * <p>2026-01-02T03:04:05Z becomes {@code 2026/1/2 03:4:5}. + */ + private static String formatTime(Date d) { + SimpleDateFormat fmt = new SimpleDateFormat("yyyy/M/d HH:m:s"); + fmt.setTimeZone(TimeZone.getTimeZone("UTC")); + return fmt.format(d); + } + + private static String toHex(byte[] bytes) { + StringBuilder sb = new StringBuilder(bytes.length * 2); + for (byte b : bytes) { + sb.append(Character.forDigit((b >> 4) & 0xF, 16)).append(Character.forDigit(b & 0xF, 16)); + } + return sb.toString(); + } +} diff --git a/src/main/java/com/loginradius/sdk/SottEncodingInterceptor.java b/src/main/java/com/loginradius/sdk/SottEncodingInterceptor.java new file mode 100644 index 0000000..0795a4d --- /dev/null +++ b/src/main/java/com/loginradius/sdk/SottEncodingInterceptor.java @@ -0,0 +1,45 @@ +// Code generated by the LoginRadius SDK generator; DO NOT EDIT. + +package com.loginradius.sdk; + +import java.io.IOException; +import okhttp3.HttpUrl; +import okhttp3.Interceptor; +import okhttp3.Request; +import okhttp3.Response; + +/** + * Network interceptor that re-encodes the {@code sott} query parameter so + * that {@code +} characters in the base64 value survive as {@code %2B} on + * the wire. + * + * <p>OkHttp's {@link HttpUrl#parse} decodes {@code %2B} to {@code +} when it + * ingests the URL string produced by {@code ApiClient.buildUrl()}. OkHttp + * does not re-encode {@code +} when it serialises the URL for transmission, + * so the server receives a space instead of a plus — every SOTT whose + * base64 happens to contain {@code +} fails registration with no useful + * diagnostic. Re-adding the parameter via + * {@link HttpUrl.Builder#addQueryParameter} applies OkHttp's own + * percent-encoder, which correctly maps {@code +} to {@code %2B}. + * + * <p>Registered as a NETWORK interceptor (not an application interceptor + * like {@link AuthInterceptor}) because the mis-decoding already happened by + * the time an application interceptor sees the request — this has to run + * immediately before the request goes over the wire. + */ +final class SottEncodingInterceptor implements Interceptor { + + @Override + public Response intercept(Chain chain) throws IOException { + Request original = chain.request(); + String sott = original.url().queryParameter("sott"); + if (sott == null) { + return chain.proceed(original); + } + HttpUrl fixed = original.url().newBuilder() + .removeAllQueryParameters("sott") + .addQueryParameter("sott", sott) + .build(); + return chain.proceed(original.newBuilder().url(fixed).build()); + } +} diff --git a/src/main/java/com/loginradius/sdk/Version.java b/src/main/java/com/loginradius/sdk/Version.java new file mode 100644 index 0000000..33d1927 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/Version.java @@ -0,0 +1,20 @@ +// Code generated by the LoginRadius SDK generator; DO NOT EDIT. +// +// Behaviour is declared in the shared SDK manifest and rendered through +// the SDK generator templates Edit those and regenerate — +// changes made here are lost on the next run and never reach the other SDKs. + +package com.loginradius.sdk; + +/** SDK version metadata. */ +public final class Version { + + /** + * The semver of the v12 SDK release, stamped into the User-Agent header on + * every outgoing request. Comes from the shared SDK manifest {@code sdkVersion}, + * so every LoginRadius SDK reports the same number. + */ + public static final String VERSION = "12.0.0-rc.1"; + + private Version() {} +} diff --git a/src/main/java/com/loginradius/sdk/demo/Demo.java b/src/main/java/com/loginradius/sdk/demo/Demo.java new file mode 100644 index 0000000..ae55069 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/demo/Demo.java @@ -0,0 +1,202 @@ +package com.loginradius.sdk.demo; + +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonSyntaxException; +import com.google.gson.reflect.TypeToken; +import com.loginradius.sdk.LoginRadiusClient; +import com.loginradius.sdk.LoginRadiusException; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.sun.net.httpserver.HttpExchange; +import java.io.IOException; +import java.net.URLDecoder; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** Small HTTP helpers shared by the demo handlers. DEMO ONLY. */ +final class Demo { + + private static final Gson GSON = new Gson(); + private static final String COOKIE = "lr_session"; + private static final String MFA_COOKIE = "lr_mfa"; + + private Demo() {} + + static boolean isBlank(String s) { + return s == null || s.isEmpty(); + } + + /** Reads a JSON object body into a flat string map. Never throws. */ + static Map<String, String> readJson(HttpExchange ex) throws IOException { + String body = new String(ex.getRequestBody().readAllBytes(), StandardCharsets.UTF_8); + if (body.isEmpty()) { + return Map.of(); + } + try { + Map<String, Object> raw = + GSON.fromJson(body, new TypeToken<Map<String, Object>>() {}.getType()); + Map<String, String> out = new HashMap<>(); + if (raw != null) { + raw.forEach((k, v) -> out.put(k, v == null ? null : String.valueOf(v))); + } + return out; + } catch (JsonSyntaxException e) { + return Map.of(); + } + } + + static void writeJson(HttpExchange ex, int status, Map<String, ?> body) throws IOException { + byte[] out = GSON.toJson(body).getBytes(StandardCharsets.UTF_8); + ex.getResponseHeaders().add("Content-Type", "application/json"); + ex.sendResponseHeaders(status, out.length); + ex.getResponseBody().write(out); + ex.close(); + } + + /** + * Writes an SDK response verbatim as the top-level JSON body, rather than + * wrapping it under an {@code {ok, result}} envelope. Used where the browser + * needs the SDK's own field names unwrapped — the WebAuthn challenge + * endpoints, whose {@code RegisterBeginCredential}/{@code + * LoginBeginCredential} shape the passkey ceremony reads directly. + */ + static void writeJson(HttpExchange ex, int status, JsonElement body) throws IOException { + byte[] out = GSON.toJson(body).getBytes(StandardCharsets.UTF_8); + ex.getResponseHeaders().add("Content-Type", "application/json"); + ex.sendResponseHeaders(status, out.length); + ex.getResponseBody().write(out); + ex.close(); + } + + /** Maps a generated ApiException onto the facade's typed error for the UI. */ + static void writeSdkError(HttpExchange ex, ApiException e) throws IOException { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + int status = lr.statusCode() == 0 ? 502 : lr.statusCode(); + Map<String, Object> body = new HashMap<>(); + body.put("error", lr.code().isEmpty() ? "loginradius_error" : lr.code()); + body.put("message", lr.description().isEmpty() ? lr.getMessage() : lr.description()); + body.put("auth", lr.isAuth()); + body.put("forbidden", lr.isForbidden()); + body.put("rateLimited", lr.isRateLimit()); + body.put("server", lr.isServer()); + writeJson(ex, status, body); + } + + static String describe(ApiException e) { + return DemoHandlers.describeError(e); + } + + static void redirect(HttpExchange ex, String location) throws IOException { + ex.getResponseHeaders().add("Location", location); + ex.sendResponseHeaders(302, -1); + ex.close(); + } + + static Map<String, String> query(HttpExchange ex) { + Map<String, String> out = new HashMap<>(); + String raw = ex.getRequestURI().getRawQuery(); + if (raw == null) { + return out; + } + for (String pair : raw.split("&")) { + int eq = pair.indexOf('='); + if (eq <= 0) { + continue; + } + out.put( + URLDecoder.decode(pair.substring(0, eq), StandardCharsets.UTF_8), + URLDecoder.decode(pair.substring(eq + 1), StandardCharsets.UTF_8)); + } + return out; + } + + static String urlEncode(String s) { + return URLEncoder.encode(s == null ? "" : s, StandardCharsets.UTF_8); + } + + static String sessionId(HttpExchange ex) { + List<String> cookies = ex.getRequestHeaders().get("Cookie"); + if (cookies == null) { + return null; + } + for (String header : cookies) { + for (String part : header.split(";")) { + String p = part.trim(); + if (p.startsWith(COOKIE + "=")) { + return p.substring(COOKIE.length() + 1); + } + } + } + return null; + } + + /** + * Issues the demo session cookie. + * + * <p>HttpOnly keeps the access token out of reach of page scripts, and + * SameSite=Lax is what lets the email-verification redirect arrive with the + * cookie still attached. The demo serves plain HTTP on localhost, so Secure + * is deliberately absent — add it before running this anywhere real. + */ + static void setSessionCookie(HttpExchange ex, String sessionId) { + ex.getResponseHeaders() + .add("Set-Cookie", COOKIE + "=" + sessionId + "; Path=/; HttpOnly; SameSite=Lax"); + } + + static void clearSessionCookie(HttpExchange ex) { + ex.getResponseHeaders() + .add("Set-Cookie", COOKIE + "=; Path=/; Max-Age=0; HttpOnly; SameSite=Lax"); + } + + /** + * The access token for an authenticated route. Safe to call only from a + * handler whose route sets requiresSession — DemoServer validated it already. + */ + static String accessToken(HttpExchange ex, DemoSessions sessions) { + return sessions.lookup(sessionId(ex)); + } + + /** + * The second-factor token from an in-progress MFA login challenge, held in a + * cookie separate from the session — a half-authenticated user must never + * hold anything the session middleware accepts. Safe to call only from a + * handler whose route requires the mfaToken auth mode. + */ + static String mfaToken(HttpExchange ex) { + List<String> cookies = ex.getRequestHeaders().get("Cookie"); + if (cookies == null) { + return null; + } + for (String header : cookies) { + for (String part : header.split(";")) { + String p = part.trim(); + if (p.startsWith(MFA_COOKIE + "=")) { + return p.substring(MFA_COOKIE.length() + 1); + } + } + } + return null; + } + + /** Issues the MFA-challenge cookie, carrying the second-factor token directly. */ + static void setMfaCookie(HttpExchange ex, String token) { + ex.getResponseHeaders() + .add("Set-Cookie", MFA_COOKIE + "=" + token + "; Path=/; HttpOnly; SameSite=Lax; Max-Age=900"); + } + + static void clearMfaCookie(HttpExchange ex) { + ex.getResponseHeaders() + .add("Set-Cookie", MFA_COOKIE + "=; Path=/; Max-Age=0; HttpOnly; SameSite=Lax"); + } + + static String verificationUrl() { + return DemoEnv.get("LR_VERIFICATION_URL", "http://localhost:8080/api/auth/verify"); + } + + static String resetUrl() { + return DemoEnv.get("LR_RESET_PASSWORD_URL", "http://localhost:8080/?reset=1"); + } +} diff --git a/src/main/java/com/loginradius/sdk/demo/DemoEnv.java b/src/main/java/com/loginradius/sdk/demo/DemoEnv.java new file mode 100644 index 0000000..dea3cf8 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/demo/DemoEnv.java @@ -0,0 +1,73 @@ +package com.loginradius.sdk.demo; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.HashMap; +import java.util.Map; + +/** + * Loads {@code .env} for the demo. DEMO ONLY. + * + * <p>Unlike Node's {@code dotenv} or a shell, plain Java has no supported way to + * mutate {@link System#getenv()} at runtime — so this does not attempt to; it + * loads {@code .env} into its own map and {@link #get} checks both. A real, + * non-blank {@code System.getenv(key)} always wins over the {@code .env} value, + * matching Node's {@code dotenv} and the PHP demo's loader (PHP: + * {@code if (getenv($key) === false) putenv(...)}), and deliberately not the + * .NET demo's loader, which overwrites an already-set shell variable. + * + * <p>{@code mvn -q compile exec:java} runs from the project root, so + * {@code .env} is read from the current working directory — the same + * directory as {@code .env.example}. Java's demo has no separate {@code demo/} + * subdirectory the way Go/Node/.NET/PHP's do. + */ +final class DemoEnv { + + private static final Map<String, String> FILE_VALUES = load(); + + private DemoEnv() {} + + static String get(String key) { + return get(key, null); + } + + static String get(String key, String fallback) { + String shell = System.getenv(key); + if (shell != null && !shell.isEmpty()) { + return shell; + } + String fromFile = FILE_VALUES.get(key); + return fromFile != null ? fromFile : fallback; + } + + private static Map<String, String> load() { + Map<String, String> out = new HashMap<>(); + Path path = Path.of(".env"); + if (!Files.isRegularFile(path)) { + return out; + } + try { + boolean first = true; + for (String rawLine : Files.readAllLines(path, StandardCharsets.UTF_8)) { + String line = rawLine.trim(); + if (first) { + // Strip a UTF-8 BOM on the very first line, if present. + line = line.replaceFirst("^", ""); + first = false; + } + if (line.isEmpty() || line.startsWith("#") || !line.contains("=")) { + continue; + } + int eq = line.indexOf('='); + String key = line.substring(0, eq).trim(); + String value = line.substring(eq + 1).trim(); + out.put(key, value); + } + } catch (IOException e) { + // No .env is a normal, supported configuration (real shell env only). + } + return out; + } +} diff --git a/src/main/java/com/loginradius/sdk/demo/DemoHandlers.java b/src/main/java/com/loginradius/sdk/demo/DemoHandlers.java new file mode 100644 index 0000000..095451c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/demo/DemoHandlers.java @@ -0,0 +1,1258 @@ +package com.loginradius.sdk.demo; + +import com.loginradius.sdk.LoginRadiusClient; +import com.loginradius.sdk.LoginRadiusConfig; +import com.loginradius.sdk.LoginRadiusException; +import com.loginradius.sdk.Sott; +import com.google.gson.Gson; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import com.google.gson.reflect.TypeToken; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.JSON; +import com.loginradius.sdk.internal.openapi.model.AccessTokenResponse; +import com.loginradius.sdk.internal.openapi.model.AddEmailModel; +import com.loginradius.sdk.internal.openapi.model.AuthResponse; +import com.loginradius.sdk.internal.openapi.model.AuthenticatorCodeRequest; +import com.loginradius.sdk.internal.openapi.model.ChangePassword; +import com.loginradius.sdk.internal.openapi.model.DeleteemailbyaccesstokenRequest; +import com.loginradius.sdk.internal.openapi.model.EmailByLoginUserNamePhoneRequest; +import com.loginradius.sdk.internal.openapi.model.EmailModel; +import com.loginradius.sdk.internal.openapi.model.ForgotPasswordPhoneModel; +import com.loginradius.sdk.internal.openapi.model.ForgotPasswordRequest; +import com.loginradius.sdk.internal.openapi.model.LoginByEmailRequest; +import com.loginradius.sdk.internal.openapi.model.PasskeyCredentialAssertionResponse; +import com.loginradius.sdk.internal.openapi.model.PasskeyCredentialCreationResponse; +import com.loginradius.sdk.internal.openapi.model.PasskeyLoginFinish; +import com.loginradius.sdk.internal.openapi.model.PasskeyRegisterFinish; +import com.loginradius.sdk.internal.openapi.model.PasswordLessEmailOTPModel; +import com.loginradius.sdk.internal.openapi.model.PhoneIdModel; +import com.loginradius.sdk.internal.openapi.model.PhoneOTPModel; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModel; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelEmailInner; +import com.loginradius.sdk.internal.openapi.model.ReAuthModelByEmailOtp; +import com.loginradius.sdk.internal.openapi.model.ResetPassword; +import com.loginradius.sdk.internal.openapi.model.ResetPasswordOneOf; +import com.loginradius.sdk.internal.openapi.model.ResetPasswordOneOf1; +import com.loginradius.sdk.internal.openapi.model.ResetPasswordOneOf2; +import com.loginradius.sdk.internal.openapi.model.ResetPasswordWithOTP; +import com.loginradius.sdk.internal.openapi.model.UpdateAccountByAccessTokenRequest; +import com.sun.net.httpserver.HttpExchange; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * The demo's handlers, one per route in {@link DemoRoutes} — the nine {@code + * core} routes plus the four {@code passwordless} ones Java has adopted — + * plus extended handlers for email, phone, custom objects, token management, + * and passkeys. + * + * <p>{@code DemoRoutes.all()} references every method below by name, so this + * class stops compiling the moment the manifest gains a route nobody has + * implemented. HTTP-method checking and session enforcement live in + * {@link DemoServer} — each handler here is only the interesting part: the SDK + * call. + */ +public final class DemoHandlers { + + /** One demo endpoint. Throws to signal an error; the server maps it. */ + @FunctionalInterface + public interface Handler { + void handle(HttpExchange exchange) throws IOException; + } + + /** + * A Gson for echoing an already-deserialized SDK response back to the + * browser — deliberately NOT {@code JSON.getGson()} (the SDK's own, used + * for talking to the API): that instance registers a custom serializer for + * every generated model, which crashes the moment any "additional + * property" (a live field the spec doesn't declare — + * disallowAdditionalPropertiesIfNotPresent: false is why the demo can even + * receive one instead of the call failing outright) has a JSON null value + * — confirmed live on GetAccountDetails, "Not a JSON Object: null". + * + * <p>A bare {@code new Gson()} avoids that, but breaks in a different way: + * plain reflection can't reach {@code java.time.OffsetDateTime}'s private + * fields under the module system, so any date field throws "Failed making + * field ... accessible" instead — confirmed live, same GetAccountDetails + * call. This registers the SDK's own date/time adapters (the same classes + * {@code JSON.createGson()} uses) without any of the ~800 per-model + * factories, avoiding both failure modes. The one visible difference from + * {@code JSON.getGson()}: additional properties appear here as a nested + * {@code "additionalProperties": {...}} object rather than flattened onto + * the response, since that flattening is exactly the code that crashes. + */ + private static final Gson PLAIN_GSON = new com.google.gson.GsonBuilder() + .registerTypeAdapter(java.util.Date.class, new JSON.DateTypeAdapter()) + .registerTypeAdapter(java.sql.Date.class, new JSON.SqlDateTypeAdapter()) + .registerTypeAdapter(java.time.OffsetDateTime.class, new JSON.OffsetDateTimeTypeAdapter()) + .registerTypeAdapter(java.time.LocalDate.class, new JSON.LocalDateTypeAdapter()) + .registerTypeAdapter(byte[].class, new JSON.ByteArrayAdapter()) + .create(); + + private final LoginRadiusClient client; + private final LoginRadiusConfig config; + private final DemoSessions sessions; + + DemoHandlers(LoginRadiusClient client, LoginRadiusConfig config, DemoSessions sessions) { + this.client = client; + this.config = config; + this.sessions = sessions; + } + + /** + * Builds the JSON body for an in-progress MFA challenge (a login response + * that carries a {@code SecondFactorAuthenticationToken} instead of an + * access token), shared by {@link #login} and both passwordless OTP + * handlers. Field set mirrors Node's and PHP's demos exactly. + */ + private static Map<String, Object> mfaChallengeBody(JsonObject resp) { + Map<String, Object> body = new HashMap<>(); + body.put("mfa_required", true); + body.put("totp_enrolled", jsonBool(resp, "IsGoogleAuthenticatorVerified") + || jsonBool(resp, "IsAuthenticatorVerified")); + body.put("manual_entry_code", jsonString(resp, "ManualEntryCode")); + body.put("qr_code", jsonString(resp, "QRCode")); + body.put("response", resp.toString()); + return body; + } + + private static boolean jsonBool(JsonObject obj, String field) { + return obj.has(field) && !obj.get(field).isJsonNull() && obj.get(field).getAsBoolean(); + } + + private static String jsonString(JsonObject obj, String field) { + return obj.has(field) && !obj.get(field).isJsonNull() ? obj.get(field).getAsString() : null; + } + + // ----------------------------------------------------------------- sott --- + + /** Generates and returns a fresh SOTT. Called on every page load. */ + public void freshSott(HttpExchange ex) throws IOException { + if (Demo.isBlank(config.apiSecret())) { + Demo.writeJson(ex, 500, Map.of("error", "LR_API_SECRET is required to generate a SOTT")); + return; + } + String sott = Sott.generate(config.apiKey(), config.apiSecret()); + Demo.writeJson(ex, 200, Map.of("sott", sott)); + } + + // ------------------------------------------------------------------ auth -- + + /** Registers a new user. Mints a SOTT server-side; never accepts one from the client. */ + public void register(HttpExchange ex) throws IOException { + Map<String, String> in = Demo.readJson(ex); + String email = in.get("email"); + String password = in.get("password"); + if (Demo.isBlank(email) || Demo.isBlank(password)) { + Demo.writeJson(ex, 400, Map.of("error", "expected JSON {email, password}")); + return; + } + if (Demo.isBlank(config.apiSecret())) { + Demo.writeJson(ex, 500, Map.of("error", "LR_API_SECRET is required for registration")); + return; + } + + // Minted per request: a SOTT is valid for ten minutes, so it must never + // come from configuration — and never from the client. + String sott = Sott.generate(config.apiKey(), config.apiSecret()); + + ProfileRequestModel body = new ProfileRequestModel(); + body.setEmail(List.of(new ProfileRequestModelEmailInner().type("Primary").value(email))); + body.setPassword(password); + if (!Demo.isBlank(in.get("firstName"))) { + body.setFirstName(in.get("firstName")); + } + if (!Demo.isBlank(in.get("lastName"))) { + body.setLastName(in.get("lastName")); + } + + try { + Object profile = + client.registration.userRegistrationBySottEmailPhoneUserName( + body, null, sott, null, Demo.verificationUrl(), + null, null, null, null, null, null, null, null); + Demo.writeJson(ex, 200, Map.of("ok", true, "profile", PLAIN_GSON.toJsonTree(profile))); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + /** Email + password login. Stores the returned access token in the demo session. */ + public void login(HttpExchange ex) throws IOException { + Map<String, String> in = Demo.readJson(ex); + if (Demo.isBlank(in.get("email")) || Demo.isBlank(in.get("password"))) { + Demo.writeJson(ex, 400, Map.of("error", "expected JSON {email, password}")); + return; + } + try { + EmailByLoginUserNamePhoneRequest body = + new EmailByLoginUserNamePhoneRequest( + new LoginByEmailRequest().email(in.get("email")).password(in.get("password"))); + + // Bypass the generated oneOf type adapter: both AuthResponseOptionalMfa + // and AuthResponseRequiredMfa have no required fields, so the discriminator + // always matches both (match=2) and throws JsonIOException. Deserialising + // as a raw JsonObject sidesteps this and still lets us extract access_token. + JsonObject resp = (JsonObject) client.apiClient().execute( + client.login.emailByLoginUserNamePhoneCall( + body, null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null, null, null, null, null, null, null, null, null, null, null, + null, null, null), + new TypeToken<JsonObject>(){}.getType()) + .getData(); + + if (resp.has("SecondFactorAuthenticationToken") + && !resp.get("SecondFactorAuthenticationToken").isJsonNull()) { + Demo.setMfaCookie(ex, resp.get("SecondFactorAuthenticationToken").getAsString()); + Demo.writeJson(ex, 200, mfaChallengeBody(resp)); + return; + } + + String accessToken = + resp.has("access_token") && !resp.get("access_token").isJsonNull() + ? resp.get("access_token").getAsString() + : null; + + if (Demo.isBlank(accessToken)) { + Demo.writeJson( + ex, 502, Map.of("error", "login succeeded but no access_token was returned")); + return; + } + + String refreshToken = + resp.has("refresh_token") && !resp.get("refresh_token").isJsonNull() + ? resp.get("refresh_token").getAsString() + : ""; + String sessionId = sessions.create(accessToken, refreshToken); + Demo.setSessionCookie(ex, sessionId); + Demo.writeJson(ex, 200, Map.of("ok", true, "response", resp.toString())); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + /** Invalidates the access token upstream, then clears the demo session. */ + public void logout(HttpExchange ex) throws IOException { + // The local session is cleared even if the upstream call fails — otherwise + // a transient API error would leave the user unable to sign out. + sessions.delete(Demo.sessionId(ex)); + Demo.clearSessionCookie(ex); + Demo.writeJson(ex, 200, Map.of("ok", true)); + } + + // ------------------------------------------------------- passwordless -- + + /** Emails a one-time code to an existing user; no password involved. */ + public void passwordlessLoginByEmail(HttpExchange ex) throws IOException { + String email = Demo.query(ex).get("email"); + if (Demo.isBlank(email)) { + Demo.writeJson(ex, 400, Map.of("error", "expected query param ?email=")); + return; + } + try { + Object result = + client.login.passwordlessLoginByEmail( + email, null, null, null, null, null, null, null, null, null, null, null); + Demo.writeJson(ex, 200, Map.of("ok", true, "result", PLAIN_GSON.toJsonTree(result))); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + /** + * Completes an email passwordless login. Same response shape as {@link + * #login}, including the MFA-challenge branch — a tenant with MFA enabled + * still enforces its second factor after the emailed code. + */ + public void passwordlessLoginByEmailOtp(HttpExchange ex) throws IOException { + Map<String, String> in = Demo.readJson(ex); + String email = in.get("email"); + String otp = in.get("otp"); + if (Demo.isBlank(email) || Demo.isBlank(otp)) { + Demo.writeJson(ex, 400, Map.of("error", "expected JSON {email, otp}")); + return; + } + try { + PasswordLessEmailOTPModel body = new PasswordLessEmailOTPModel().otp(otp).email(email); + + // Same generated-oneOf-adapter bypass as login(): both response branches + // have no required fields, so the discriminator always matches both and + // throws JsonIOException. Deserialising as a raw JsonObject sidesteps it. + JsonObject resp = + (JsonObject) + client + .apiClient() + .execute( + client.login.passwordlessLoginByEmailAndOTPCall( + body, null, null, null, null, null, null, null, null, null, null), + new TypeToken<JsonObject>() {}.getType()) + .getData(); + + if (resp.has("SecondFactorAuthenticationToken") + && !resp.get("SecondFactorAuthenticationToken").isJsonNull()) { + Demo.setMfaCookie(ex, resp.get("SecondFactorAuthenticationToken").getAsString()); + Demo.writeJson(ex, 200, mfaChallengeBody(resp)); + return; + } + + String accessToken = + resp.has("access_token") && !resp.get("access_token").isJsonNull() + ? resp.get("access_token").getAsString() + : null; + + if (Demo.isBlank(accessToken)) { + Demo.writeJson( + ex, 502, Map.of("error", "login succeeded but no access_token was returned")); + return; + } + + String refreshToken = + resp.has("refresh_token") && !resp.get("refresh_token").isJsonNull() + ? resp.get("refresh_token").getAsString() + : ""; + String sessionId = sessions.create(accessToken, refreshToken); + Demo.setSessionCookie(ex, sessionId); + Demo.writeJson(ex, 200, Map.of("ok", true, "response", resp.toString())); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + /** Texts a one-time code to an existing user; no password involved. */ + public void passwordlessLoginByPhone(HttpExchange ex) throws IOException { + String phone = Demo.query(ex).get("phone"); + if (Demo.isBlank(phone)) { + Demo.writeJson(ex, 400, Map.of("error", "expected query param ?phone=")); + return; + } + try { + Object result = + client.login.passwordlessLoginByPhone( + phone, null, null, null, null, null, null, null, null, null, null); + Demo.writeJson(ex, 200, Map.of("ok", true, "result", PLAIN_GSON.toJsonTree(result))); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + /** + * Completes a phone passwordless login. Same response shape as {@link + * #login}, including the MFA-challenge branch. + */ + public void passwordlessLoginByPhoneOtp(HttpExchange ex) throws IOException { + Map<String, String> in = Demo.readJson(ex); + String phone = in.get("phone"); + String otp = in.get("otp"); + if (Demo.isBlank(phone) || Demo.isBlank(otp)) { + Demo.writeJson(ex, 400, Map.of("error", "expected JSON {phone, otp}")); + return; + } + try { + PhoneOTPModel body = new PhoneOTPModel().OTP(otp).phone(phone); + + JsonObject resp = + (JsonObject) + client + .apiClient() + .execute( + client.login.passwordlessLoginPhoneVerificationCall( + body, null, null, null, null, null, null, null, null, null, null, null), + new TypeToken<JsonObject>() {}.getType()) + .getData(); + + if (resp.has("SecondFactorAuthenticationToken") + && !resp.get("SecondFactorAuthenticationToken").isJsonNull()) { + Demo.setMfaCookie(ex, resp.get("SecondFactorAuthenticationToken").getAsString()); + Demo.writeJson(ex, 200, mfaChallengeBody(resp)); + return; + } + + String accessToken = + resp.has("access_token") && !resp.get("access_token").isJsonNull() + ? resp.get("access_token").getAsString() + : null; + + if (Demo.isBlank(accessToken)) { + Demo.writeJson( + ex, 502, Map.of("error", "login succeeded but no access_token was returned")); + return; + } + + String refreshToken = + resp.has("refresh_token") && !resp.get("refresh_token").isJsonNull() + ? resp.get("refresh_token").getAsString() + : ""; + String sessionId = sessions.create(accessToken, refreshToken); + Demo.setSessionCookie(ex, sessionId); + Demo.writeJson(ex, 200, Map.of("ok", true, "response", resp.toString())); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + /** + * Landing point for the link in the verification email. Redirects back to the + * UI with a status banner rather than returning JSON, because a browser lands + * here directly. + */ + public void verifyEmail(HttpExchange ex) throws IOException { + String token = Demo.query(ex).get("vtoken"); + if (Demo.isBlank(token)) { + Demo.redirect(ex, "/?verify=missing"); + return; + } + try { + // The verification endpoint shares its path with the availability check, + // so the SDK exposes one operation; passing verificationtoken performs + // the verification. + client.user.checkEmailAvailability( + null, null, null, null, token, null, null, null, null, null, null, null, null, null); + Demo.redirect(ex, "/?verify=success"); + } catch (ApiException e) { + Demo.redirect(ex, "/?verify=error&message=" + Demo.urlEncode(Demo.describe(e))); + } + } + + // -------------------------------------------------------------- password -- + + /** Sends a password-reset email containing a reset token. */ + public void forgotPassword(HttpExchange ex) throws IOException { + Map<String, String> in = Demo.readJson(ex); + if (Demo.isBlank(in.get("email"))) { + Demo.writeJson(ex, 400, Map.of("error", "expected JSON {email}")); + return; + } + ForgotPasswordRequest body = new ForgotPasswordRequest(); + body.setEmail(in.get("email")); + try { + Object r = + client.password.forgotPassword( + null, Demo.resetUrl(), null, null, null, null, null, null, null, body); + Demo.writeJson(ex, 200, Map.of("ok", true, "result", PLAIN_GSON.toJsonTree(r))); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + /** Completes a reset using the token from the email. */ + public void resetPassword(HttpExchange ex) throws IOException { + Map<String, String> in = Demo.readJson(ex); + if (Demo.isBlank(in.get("resetToken")) || Demo.isBlank(in.get("password"))) { + Demo.writeJson(ex, 400, Map.of("error", "expected JSON {resetToken, password}")); + return; + } + ResetPasswordOneOf branch = new ResetPasswordOneOf(); + branch.setResetToken(in.get("resetToken")); + branch.setPassword(in.get("password")); + try { + ResetPassword payload = new ResetPassword(branch); + Object r = + client.password.resetPasswordByResetToken( + payload, null, null, null, null, null, null, null); + Demo.writeJson(ex, 200, Map.of("ok", true, "result", PLAIN_GSON.toJsonTree(r))); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + /** + * Completes a reset using an OTP instead of an emailed token: {@code + * {password, resetToken}} (token-based, same as {@link #resetPassword}), + * {@code {password, otp, email}}, or {@code {password, otp, username}}. + * Same underlying endpoint as {@link #resetPassword} — its request body is a + * three-way {@code oneOf} and this route exists to exercise the OTP + * branches, which {@link #resetPassword} never does. + */ + public void resetPasswordWithToken(HttpExchange ex) throws IOException { + Map<String, String> in = Demo.readJson(ex); + String password = in.get("password"); + String resetToken = in.get("resetToken"); + String otp = in.get("otp"); + String email = in.get("email"); + String username = in.get("username"); + + String usage = "expected JSON {password, resetToken} or {password, otp, email} or {password, otp, username}"; + if (Demo.isBlank(password)) { + Demo.writeJson(ex, 400, Map.of("error", usage)); + return; + } + + ResetPassword payload; + if (!Demo.isBlank(resetToken)) { + ResetPasswordOneOf branch = new ResetPasswordOneOf(); + branch.setResetToken(resetToken); + branch.setPassword(password); + payload = new ResetPassword(branch); + } else if (!Demo.isBlank(otp) && !Demo.isBlank(email)) { + ResetPasswordOneOf1 branch = new ResetPasswordOneOf1(); + branch.setOtp(otp); + branch.setEmail(email); + branch.setPassword(password); + payload = new ResetPassword(branch); + } else if (!Demo.isBlank(otp) && !Demo.isBlank(username)) { + ResetPasswordOneOf2 branch = new ResetPasswordOneOf2(); + branch.setOtp(otp); + branch.setUsername(username); + branch.setPassword(password); + payload = new ResetPassword(branch); + } else { + Demo.writeJson(ex, 400, Map.of("error", usage)); + return; + } + + try { + Object r = client.password.resetPasswordByResetToken( + payload, null, null, null, null, null, null, null); + Demo.writeJson(ex, 200, Map.of("ok", true, "result", PLAIN_GSON.toJsonTree(r))); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + /** + * Sends a password-reset OTP by SMS to the phone number on the account. + * Matches the manifest's {@code requestResetOtp} operation exactly, same as + * Node's demo. + */ + public void requestResetOtp(HttpExchange ex) throws IOException { + Map<String, String> in = Demo.readJson(ex); + String phone = in.get("phone"); + if (Demo.isBlank(phone)) { + Demo.writeJson(ex, 400, Map.of("error", "expected JSON {phone}")); + return; + } + try { + Object r = client.password.requestOTPForPasswordReset( + new ForgotPasswordPhoneModel().phone(phone), null, null, null, null, null, null, null); + Demo.writeJson(ex, 200, Map.of("ok", true, "result", PLAIN_GSON.toJsonTree(r))); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + /** + * Completes a password reset using the OTP delivered by SMS. Matches the + * manifest's {@code resetPasswordWithOtp} operation exactly, same as Node's + * demo — distinct from {@link #resetPasswordWithToken}, this demo's own + * additional email/username-based OTP reset, which uses a different + * endpoint ({@code /api/password/reset-otp}) not present in Node's demo. + */ + public void resetPasswordWithOtp(HttpExchange ex) throws IOException { + Map<String, String> in = Demo.readJson(ex); + String phone = in.get("phone"); + String otp = in.get("otp"); + String password = in.get("password"); + if (Demo.isBlank(phone) || Demo.isBlank(otp) || Demo.isBlank(password)) { + Demo.writeJson(ex, 400, Map.of("error", "expected JSON {phone, otp, password}")); + return; + } + try { + Object r = client.password.resetPasswordWithOTP( + new ResetPasswordWithOTP().phone(phone).otp(otp).password(password), + null, null, null, null, null, null, null); + Demo.writeJson(ex, 200, Map.of("ok", true, "result", PLAIN_GSON.toJsonTree(r))); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + /** Changes the signed-in user's password. */ + public void changePassword(HttpExchange ex) throws IOException { + Map<String, String> in = Demo.readJson(ex); + if (Demo.isBlank(in.get("oldPassword")) || Demo.isBlank(in.get("newPassword"))) { + Demo.writeJson(ex, 400, Map.of("error", "expected JSON {oldPassword, newPassword}")); + return; + } + ChangePassword body = new ChangePassword(); + body.setOldPassword(in.get("oldPassword")); + body.setNewPassword(in.get("newPassword")); + try { + Object r = + client.password.changePassword( + body, null, null, null, null, null, null, null, Demo.accessToken(ex, sessions)); + Demo.writeJson(ex, 200, Map.of("ok", true, "result", PLAIN_GSON.toJsonTree(r))); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + // --------------------------------------------------------------- profile -- + + /** Returns the signed-in user's profile. */ + public void getProfile(HttpExchange ex) throws IOException { + try { + Object profile = + client.user.getAccountDetails(null, Demo.accessToken(ex, sessions), null, null); + Demo.writeJson(ex, 200, Map.of("profile", PLAIN_GSON.toJsonTree(profile))); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + /** Updates editable fields on the signed-in user's profile. */ + public void updateProfile(HttpExchange ex) throws IOException { + Map<String, String> in = Demo.readJson(ex); + UpdateAccountByAccessTokenRequest body = new UpdateAccountByAccessTokenRequest(); + if (!Demo.isBlank(in.get("firstName"))) { + body.setFirstName(in.get("firstName")); + } + if (!Demo.isBlank(in.get("lastName"))) { + body.setLastName(in.get("lastName")); + } + if (!Demo.isBlank(in.get("about"))) { + body.setAbout(in.get("about")); + } + try { + Object r = + client.user.updateAccountByAccessToken( + body, null, null, null, null, null, null, null, null, null, null, null, null, + Demo.accessToken(ex, sessions)); + Demo.writeJson(ex, 200, Map.of("ok", true, "result", PLAIN_GSON.toJsonTree(r))); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + // --------------------------------------------------------------- email -- + + /** + * Adds a secondary email to the signed-in user's account. + * The access token is sent as the {@code access_token} query parameter, not + * the Authorization header — the live API rejects the Bearer form here. + */ + public void addEmail(HttpExchange ex) throws IOException { + Map<String, String> in = Demo.readJson(ex); + String email = in.get("email"); + if (Demo.isBlank(email)) { + Demo.writeJson(ex, 400, Map.of("error", "expected JSON {email, type}")); + return; + } + AddEmailModel body = new AddEmailModel(); + body.setEmail(email); + body.setType(Demo.isBlank(in.get("type")) ? "Secondary" : in.get("type")); + try { + Object r = client.user.addEmail( + body, Demo.accessToken(ex, sessions), null, Demo.verificationUrl(), null, null); + Demo.writeJson(ex, 200, Map.of("ok", true, "result", PLAIN_GSON.toJsonTree(r))); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + /** Removes an email address from the signed-in user's account. */ + public void deleteEmail(HttpExchange ex) throws IOException { + Map<String, String> in = Demo.readJson(ex); + String email = in.get("email"); + if (Demo.isBlank(email)) { + Demo.writeJson(ex, 400, Map.of("error", "expected JSON {email}")); + return; + } + DeleteemailbyaccesstokenRequest body = new DeleteemailbyaccesstokenRequest(); + body.setEmail(email); + body.setAccessToken(Demo.accessToken(ex, sessions)); + // Also set as bearer token so both auth paths are covered. + client.apiClient().setBearerToken(Demo.accessToken(ex, sessions)); + try { + Object r = client.user.deleteemailbyaccesstoken(body, null, null); + Demo.writeJson(ex, 200, Map.of("ok", true, "result", PLAIN_GSON.toJsonTree(r))); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } finally { + client.apiClient().setBearerToken((String) null); + } + } + + /** + * Deletes the signed-in user's own account. + * + * <p>The underlying operation is admin-scoped: it authenticates with the + * API secret and would delete any address in the tenant, so the handler + * reads the signed-in profile first and refuses a mismatch — that guard is + * demo policy, not an SDK limitation, matching Node's demo exactly. + */ + public void deleteAccount(HttpExchange ex) throws IOException { + Map<String, String> in = Demo.readJson(ex); + String email = in.get("email"); + if (Demo.isBlank(email)) { + Demo.writeJson(ex, 400, Map.of("error", "expected JSON {email}")); + return; + } + try { + Object profile = client.user.getAccountDetails(null, Demo.accessToken(ex, sessions), null, null); + JsonElement profileJson = PLAIN_GSON.toJsonTree(profile); + boolean owned = false; + if (profileJson.isJsonObject() && profileJson.getAsJsonObject().has("Email") + && profileJson.getAsJsonObject().get("Email").isJsonArray()) { + for (JsonElement entry : profileJson.getAsJsonObject().getAsJsonArray("Email")) { + if (entry.isJsonObject() && entry.getAsJsonObject().has("Value") + && !entry.getAsJsonObject().get("Value").isJsonNull()) { + String value = entry.getAsJsonObject().get("Value").getAsString(); + if (value.trim().equalsIgnoreCase(email.trim())) { + owned = true; + break; + } + } + } + } + if (!owned) { + Demo.writeJson(ex, 403, Map.of( + "error", "refusing to delete an account you are not signed in as", + "hint", "the demo only deletes the signed-in account; the underlying API would delete any address")); + return; + } + Object r = client.accounts.deleteAccountByEmail(email, null, null); + sessions.delete(Demo.sessionId(ex)); + Demo.clearMfaCookie(ex); + Demo.clearSessionCookie(ex); + Demo.writeJson(ex, 200, Map.of("ok", true, "deleted", PLAIN_GSON.toJsonTree(r))); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + // --------------------------------------------------------------- phone -- + + /** Updates the phone number on the signed-in user's account. */ + public void updatePhone(HttpExchange ex) throws IOException { + Map<String, String> in = Demo.readJson(ex); + String phone = in.get("phone"); + if (Demo.isBlank(phone)) { + Demo.writeJson(ex, 400, Map.of("error", "expected JSON {phone}")); + return; + } + PhoneIdModel body = new PhoneIdModel(); + body.setPhone(phone); + try { + Object r = client.user.changePhoneNumber( + null, null, null, Demo.accessToken(ex, sessions), null, body); + Demo.writeJson(ex, 200, Map.of("ok", true, "result", PLAIN_GSON.toJsonTree(r))); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + // --------------------------------------------------------- custom objects -- + + private static final String CUSTOM_OBJECT_PATH_PREFIX = "/api/customobject/"; + + /** + * Resolves the custom-object schema name. An explicit value from the caller + * (this demo's UI always sends one) wins; the manifest's generated routes + * declare this via {@code configQuery} instead — no client value at all — + * so LR_CUSTOM_OBJECT_NAME is the fallback for that caller shape. + */ + private static String resolveObjectName(Map<String, String> body, Map<String, String> query) { + String fromBody = body.get("objectname"); + if (!Demo.isBlank(fromBody)) { + return fromBody; + } + String fromQuery = query.get("objectname"); + if (!Demo.isBlank(fromQuery)) { + return fromQuery; + } + return DemoEnv.get("LR_CUSTOM_OBJECT_NAME"); + } + + /** + * Resolves the record id an update/delete targets. The manifest's generated + * routes carry it as a URL path segment ({@code PUT}/{@code DELETE + * /api/customobject/{objectRecordId}}); this demo's UI and the old + * hand-written routes ({@code POST /api/customobject/update|delete}) send + * it as a body field instead. + * + * <p>Disambiguated by HTTP method, not path prefix alone: both shapes share + * the literal prefix {@code /api/customobject/}, so a prefix-only check + * misreads the old routes' own fixed suffix ("update", "delete") as if it + * were a record id — confirmed by {@code RecordIdTest}, caught before it + * reached a real caller. The manifest declares this path PUT/DELETE only, + * so method is a reliable signal; the old routes are always POST. + */ + private static String resolveRecordId(HttpExchange ex, Map<String, String> body) { + String method = ex.getRequestMethod(); + String path = ex.getRequestURI().getPath(); + if (("PUT".equalsIgnoreCase(method) || "DELETE".equalsIgnoreCase(method)) + && path.startsWith(CUSTOM_OBJECT_PATH_PREFIX) + && path.length() > CUSTOM_OBJECT_PATH_PREFIX.length()) { + return path.substring(CUSTOM_OBJECT_PATH_PREFIX.length()); + } + return body.get("objectrecordid"); + } + + /** Creates a new custom object entry for the signed-in user. */ + public void createCustomObject(HttpExchange ex) throws IOException { + Map<String, String> in = Demo.readJson(ex); + String objectname = resolveObjectName(in, Demo.query(ex)); + if (Demo.isBlank(objectname)) { + Demo.writeJson(ex, 400, Map.of("error", + "expected JSON {objectname, ...fields}, or configure LR_CUSTOM_OBJECT_NAME")); + return; + } + Map<String, Object> data = new HashMap<>(in); + data.remove("objectname"); + try { + Object r = client.customObject.createCustomObjectByToken( + data, null, objectname, Demo.accessToken(ex, sessions), null, null); + Demo.writeJson(ex, 200, Map.of("ok", true, "result", PLAIN_GSON.toJsonTree(r))); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + /** Lists all custom object records for the signed-in user. */ + public void listCustomObjects(HttpExchange ex) throws IOException { + Map<String, String> in = Demo.readJson(ex); + String objectname = resolveObjectName(in, Demo.query(ex)); + if (Demo.isBlank(objectname)) { + Demo.writeJson(ex, 400, Map.of("error", + "expected JSON {objectname}, or configure LR_CUSTOM_OBJECT_NAME")); + return; + } + try { + Object r = client.customObject.getCustomObjectByToken( + null, objectname, Demo.accessToken(ex, sessions)); + Demo.writeJson(ex, 200, Map.of("ok", true, "result", PLAIN_GSON.toJsonTree(r))); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + /** Partially updates a custom object record identified by its record ID. */ + public void updateCustomObject(HttpExchange ex) throws IOException { + Map<String, String> in = Demo.readJson(ex); + String objectname = resolveObjectName(in, Demo.query(ex)); + String recordId = resolveRecordId(ex, in); + if (Demo.isBlank(objectname) || Demo.isBlank(recordId)) { + Demo.writeJson(ex, 400, Map.of("error", + "expected JSON {objectname, objectrecordid, ...fields} " + + "(or a record id in the URL, and LR_CUSTOM_OBJECT_NAME configured)")); + return; + } + Map<String, Object> data = new HashMap<>(in); + data.remove("objectname"); + data.remove("objectrecordid"); + try { + Object r = client.customObject.updateCustomObjectByTokenAndRecordId( + recordId, "PartialReplace", data, + objectname, Demo.accessToken(ex, sessions), null, null, null); + Demo.writeJson(ex, 200, Map.of("ok", true, "result", PLAIN_GSON.toJsonTree(r))); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + /** Deletes a custom object record identified by its record ID. */ + public void deleteCustomObject(HttpExchange ex) throws IOException { + Map<String, String> in = Demo.readJson(ex); + String objectname = resolveObjectName(in, Demo.query(ex)); + String recordId = resolveRecordId(ex, in); + if (Demo.isBlank(objectname) || Demo.isBlank(recordId)) { + Demo.writeJson(ex, 400, Map.of("error", + "expected JSON {objectname, objectrecordid} " + + "(or a record id in the URL, and LR_CUSTOM_OBJECT_NAME configured)")); + return; + } + try { + Object r = client.customObject.deleteCustomObjectByTokenAndRecordId( + recordId, Demo.accessToken(ex, sessions), null, null, objectname, null); + Demo.writeJson(ex, 200, Map.of("ok", true, "result", PLAIN_GSON.toJsonTree(r))); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + // --------------------------------------------------------------- token -- + + /** + * Exchanges the signed-in session's refresh token for a new access token. + * Uses the {@code /manage/} operation deliberately: the native variant takes + * the access token as a query parameter, which would put a bearer + * credential into access and proxy logs. Refreshing rotates the session's + * tokens server-side, so the cookie does not change — matches Node's demo + * exactly, including reading the refresh token from the session rather than + * the request body. + */ + public void refreshToken(HttpExchange ex) throws IOException { + String sessionId = Demo.sessionId(ex); + String refreshToken = sessions.lookupRefresh(sessionId); + if (Demo.isBlank(refreshToken)) { + Demo.writeJson(ex, 400, Map.of("error", + "this session has no refresh token; the tenant did not return one at login")); + return; + } + try { + AccessTokenResponse r = client.accountSession.refreshAccessToken(refreshToken); + if (Demo.isBlank(r.getAccessToken())) { + Demo.writeJson(ex, 502, Map.of("error", "refresh succeeded but returned no access_token")); + return; + } + sessions.replace(sessionId, r.getAccessToken(), r.getRefreshToken()); + Demo.writeJson(ex, 200, Map.of( + "ok", true, + "refreshed", true, + "rotated", !Demo.isBlank(r.getRefreshToken()), + "expires_in", r.getExpiresIn() == null ? "" : r.getExpiresIn())); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + /** + * Validates an access token. Uses the token from the request body if provided; + * falls back to the current session's token. + */ + public void validateToken(HttpExchange ex) throws IOException { + Map<String, String> in = Demo.readJson(ex); + String token = in.get("accessToken"); + if (Demo.isBlank(token)) { + token = Demo.accessToken(ex, sessions); + } + if (Demo.isBlank(token)) { + Demo.writeJson(ex, 400, Map.of("error", "expected JSON {accessToken} or an active session")); + return; + } + try { + Object r = client.accountSession.validateAccessToken(token); + Demo.writeJson(ex, 200, Map.of("ok", true, "result", PLAIN_GSON.toJsonTree(r))); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + /** Returns active session details for the currently signed-in user. */ + public void activeSession(HttpExchange ex) throws IOException { + try { + Object r = client.accountSession.getActiveSession( + Demo.accessToken(ex, sessions), null, null); + Demo.writeJson(ex, 200, Map.of("ok", true, "result", PLAIN_GSON.toJsonTree(r))); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + /** + * Invalidates the access token on the LoginRadius API, then clears the local + * session. Unlike logout (which only clears the local session), this call + * revokes the token server-side so it cannot be reused. + */ + public void invalidateToken(HttpExchange ex) throws IOException { + String accessToken = Demo.accessToken(ex, sessions); + try { + Object r = client.accountSession.nativeInvalidateAccessToken(accessToken, null); + sessions.delete(Demo.sessionId(ex)); + Demo.clearSessionCookie(ex); + Demo.writeJson(ex, 200, Map.of("ok", true, "result", PLAIN_GSON.toJsonTree(r))); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + // --------------------------------------------------------------- passkey -- + + /** Begins the Passkey login flow — returns the WebAuthn assertion challenge. */ + public void beginPasskeyLogin(HttpExchange ex) throws IOException { + Map<String, String> in = Demo.readJson(ex); + String identifier = in.get("identifier"); + if (Demo.isBlank(identifier)) { + Demo.writeJson(ex, 400, Map.of("error", "expected JSON {identifier}")); + return; + } + try { + // Unwrapped, not {ok, result} — the browser's passkeyLogin() reads + // LoginBeginCredential.publicKey directly off the top-level response, + // matching every other language's demo and the SDK's own field names. + Object r = client.login.beginPasskeyLogin(identifier, null, null); + Demo.writeJson(ex, 200, PLAIN_GSON.toJsonTree(r)); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + /** Begins the Passkey registration flow — returns the WebAuthn creation challenge. */ + public void beginPasskeyRegistration(HttpExchange ex) throws IOException { + Map<String, String> in = Demo.readJson(ex); + String identifier = in.get("identifier"); + if (Demo.isBlank(identifier)) { + Demo.writeJson(ex, 400, Map.of("error", "expected JSON {identifier}")); + return; + } + try { + // Unwrapped, not {ok, result} — the browser's passkeyRegister() reads + // RegisterBeginCredential.publicKey directly off the top-level response, + // matching every other language's demo and the SDK's own field names. + Object r = client.registration.beginPasskeyRegistration(identifier); + Demo.writeJson(ex, 200, PLAIN_GSON.toJsonTree(r)); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + /** + * Completes the Passkey registration flow with the attestation response from + * the browser's {@code navigator.credentials.create()} call. The raw JSON + * body is {@code {credential, email}}, matching Node's browser-side + * contract exactly (same shape {@code app.js}'s {@code passkeyRegister()} + * sends) — the richer {@code PasskeyRegisterFinish} schema is constructed + * server-side from those two fields. + */ + public void finishPasskeyRegistration(HttpExchange ex) throws IOException { + String rawBody = new String(ex.getRequestBody().readAllBytes(), StandardCharsets.UTF_8); + JsonObject in; + try { + in = JsonParser.parseString(rawBody).getAsJsonObject(); + } catch (RuntimeException e) { + Demo.writeJson(ex, 400, Map.of("error", "expected JSON {credential, email}")); + return; + } + if (!in.has("credential") || in.get("credential").isJsonNull()) { + Demo.writeJson(ex, 400, Map.of("error", "expected JSON {credential, email}")); + return; + } + // Enrolment creates the account, so there is no existing profile to take + // an address from and the API rejects the call without one. Note this + // model takes the profile's array-of-{Type,Value} email shape, not the + // plain string the passkey LOGIN finish model uses — built from the + // browser's single identifier string here, same as every other language. + String email = in.has("email") && !in.get("email").isJsonNull() ? in.get("email").getAsString() : null; + if (Demo.isBlank(email)) { + Demo.writeJson(ex, 400, Map.of("error", "expected JSON {credential, email}")); + return; + } + PasskeyCredentialCreationResponse credential; + try { + credential = JSON.getGson().fromJson(in.get("credential"), PasskeyCredentialCreationResponse.class); + } catch (RuntimeException e) { + Demo.writeJson(ex, 400, Map.of("error", "credential does not match the expected WebAuthn attestation shape")); + return; + } + PasskeyRegisterFinish body = new PasskeyRegisterFinish() + .passkeyCredential(credential) + .email(List.of(new ProfileRequestModelEmailInner().type("Primary").value(email))); + try { + Object r = client.registration.finishPasskeyRegistration( + body, Demo.verificationUrl(), null, null, null, null, null, null, null); + Demo.writeJson(ex, 200, Map.of("ok", true, "result", PLAIN_GSON.toJsonTree(r))); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + /** + * Completes the Passkey login flow with the browser's assertion response. + * The raw JSON body is {@code {credential, email}} — credential is + * required and must match the {@code PasskeyCredentialAssertionResponse} + * schema, matching Node's browser-side contract exactly (same shape + * {@code app.js}'s {@code passkeyLogin()} sends) — passed through to the + * SDK once wrapped, same as {@link #beginPasskeyLogin}/{@link + * #finishPasskeyRegistration}. On success this is a login: mints the demo + * session exactly like {@link #login}. + */ + public void finishPasskeyLogin(HttpExchange ex) throws IOException { + String rawBody = new String(ex.getRequestBody().readAllBytes(), StandardCharsets.UTF_8); + JsonObject in; + try { + in = JsonParser.parseString(rawBody).getAsJsonObject(); + } catch (RuntimeException e) { + Demo.writeJson(ex, 400, Map.of("error", "expected JSON {credential, email}")); + return; + } + if (!in.has("credential") || in.get("credential").isJsonNull()) { + Demo.writeJson(ex, 400, Map.of("error", "expected JSON {credential, email}")); + return; + } + PasskeyCredentialAssertionResponse credential; + try { + credential = JSON.getGson().fromJson(in.get("credential"), PasskeyCredentialAssertionResponse.class); + } catch (RuntimeException e) { + Demo.writeJson(ex, 400, Map.of("error", "credential does not match the expected WebAuthn assertion shape")); + return; + } + String email = in.has("email") && !in.get("email").isJsonNull() ? in.get("email").getAsString() : null; + PasskeyLoginFinish body = new PasskeyLoginFinish().passkeyCredential(credential).email(email); + try { + // loginurl, verificationurl, then 23 more optional trailing params + // (emailtemplate ... rbadevicesmstemplate) this demo leaves unset. + AuthResponse r = client.login.finishPasskeyLogin( + body, null, Demo.verificationUrl(), + null, null, null, null, null, + null, null, null, null, null, + null, null, null, null, null, + null, null, null, null, null, + null, null, null); + if (!signIn(ex, r)) { + Demo.writeJson(ex, 502, Map.of("error", "authentication succeeded but no access_token returned")); + return; + } + Demo.writeJson(ex, 200, Map.of("ok", true, "profile", PLAIN_GSON.toJsonTree(r.getProfile()))); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + // ----------------------------------------------------------------- mfa -- + + /** Returns which second factors are configured on the signed-in account. */ + public void mfaSettings(HttpExchange ex) throws IOException { + // Duo returns the user to this URL after its own challenge; only sent + // when supplied, so a tenant without Duo configured never puts + // duoredirecturi= on the wire. + String duoRedirectUri = Demo.query(ex).get("duoRedirectUri"); + try { + Object r = client.security.getMFASettings( + Demo.isBlank(duoRedirectUri) ? null : duoRedirectUri, Demo.accessToken(ex, sessions)); + Demo.writeJson(ex, 200, Map.of("ok", true, "result", PLAIN_GSON.toJsonTree(r))); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + /** Confirms a TOTP code and enrols the authenticator on the signed-in account. */ + public void mfaEnrolTotp(HttpExchange ex) throws IOException { + Map<String, String> in = Demo.readJson(ex); + String totp = in.get("totp"); + if (Demo.isBlank(totp)) { + Demo.writeJson(ex, 400, Map.of("error", "expected JSON {totp}")); + return; + } + try { + Object r = client.security.verify2faTOTPAuth( + totpBody(totp), Demo.accessToken(ex, sessions), null, null); + Demo.writeJson(ex, 200, Map.of("ok", true, "result", PLAIN_GSON.toJsonTree(r))); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + /** Issues a fresh set of single-use MFA backup codes for the signed-in account. */ + public void mfaBackupCodes(HttpExchange ex) throws IOException { + try { + Object r = client.security.mfaGenerateBackupCodes(Demo.accessToken(ex, sessions)); + Demo.writeJson(ex, 200, Map.of("ok", true, "result", PLAIN_GSON.toJsonTree(r))); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + /** + * Sends an email OTP for an in-progress MFA login challenge. Authenticated + * by the mfaToken cookie {@link DemoServer} validated already, not a + * session. + */ + public void mfaSendEmailOtp(HttpExchange ex) throws IOException { + Map<String, String> in = Demo.readJson(ex); + String email = in.get("email"); + if (Demo.isBlank(email)) { + Demo.writeJson(ex, 400, Map.of("error", "expected JSON {email}")); + return; + } + try { + Object r = client.security.resendEmailOTPMFAToken( + Demo.mfaToken(ex), new EmailModel().email(email), null, null); + Demo.writeJson(ex, 200, Map.of("ok", true, "result", PLAIN_GSON.toJsonTree(r))); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + /** + * Completes an in-progress MFA login challenge with an email OTP. Clears the + * mfaToken cookie and mints a real session on success, same as {@link + * #login}. + */ + public void mfaVerifyEmailOtp(HttpExchange ex) throws IOException { + Map<String, String> in = Demo.readJson(ex); + String email = in.get("email"); + String otp = in.get("otp"); + if (Demo.isBlank(email)) { + Demo.writeJson(ex, 400, Map.of("error", "expected JSON {email, otp}")); + return; + } + if (Demo.isBlank(otp)) { + Demo.writeJson(ex, 400, Map.of("error", "expected JSON {email, otp}")); + return; + } + ReAuthModelByEmailOtp body = new ReAuthModelByEmailOtp(); + body.setEmailid(email); + body.setOtp(otp); + try { + AuthResponse r = client.security.validateMfaOTPByEmail( + Demo.mfaToken(ex), body, null, null, null, null, null, null, null, null, null, null); + Demo.clearMfaCookie(ex); + if (!signIn(ex, r)) { + Demo.writeJson(ex, 502, Map.of("error", "authentication succeeded but no access_token returned")); + return; + } + Demo.writeJson(ex, 200, Map.of("ok", true, "profile", PLAIN_GSON.toJsonTree(r.getProfile()))); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + /** + * Completes an in-progress MFA login challenge with a TOTP code. Clears the + * mfaToken cookie and mints a real session on success, same as {@link + * #login}. + */ + public void mfaVerifyTotp(HttpExchange ex) throws IOException { + Map<String, String> in = Demo.readJson(ex); + String totp = in.get("totp"); + if (Demo.isBlank(totp)) { + Demo.writeJson(ex, 400, Map.of("error", "expected JSON {totp}")); + return; + } + try { + // fields, then 10 rba*template params, then preventWebhook/xPreventWebhook + // — 13 optional trailing params this demo leaves unset. + AuthResponse r = client.security.verifyTotpByMfaToken( + Demo.mfaToken(ex), totpBody(totp), + null, null, null, null, null, + null, null, null, null, null, + null, null, null); + Demo.clearMfaCookie(ex); + if (!signIn(ex, r)) { + Demo.writeJson(ex, 502, Map.of("error", "authentication succeeded but no access_token returned")); + return; + } + Demo.writeJson(ex, 200, Map.of("ok", true, "profile", PLAIN_GSON.toJsonTree(r.getProfile()))); + } catch (ApiException e) { + Demo.writeSdkError(ex, e); + } + } + + /** + * A TOTP code, addressed to whichever field the tenant's authenticator + * generation needs. A tenant on Google Authenticator requires {@code + * googleauthenticatorcode}; the newer generic authenticator uses {@code + * authenticatorcode}, sending only {@code googleauthenticatorcode} returns + * ErrorCode 908. Only one field is populated, deliberately: the sibling + * reauth schema declares its equivalent code fields under {@code oneOf} with + * each required, so sending both risks a validation rejection rather than a + * helpful fallback. A tenant on the newer generic authenticator needs {@code + * authenticatorcode} here instead. + */ + private static AuthenticatorCodeRequest totpBody(String code) { + return new AuthenticatorCodeRequest().googleauthenticatorcode(code); + } + + /** Mints the demo session from an {@link AuthResponse}. False if it carried no access token. */ + private boolean signIn(HttpExchange ex, AuthResponse response) { + String accessToken = response == null ? null : response.getAccessToken(); + if (Demo.isBlank(accessToken)) { + return false; + } + String refreshToken = response.getRefreshToken(); + String sessionId = sessions.create(accessToken, refreshToken == null ? "" : refreshToken); + Demo.setSessionCookie(ex, sessionId); + return true; + } + + /** Renders a LoginRadius failure for the UI. */ + static String describeError(ApiException e) { + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + return lr.description().isEmpty() ? lr.getMessage() : lr.description(); + } +} diff --git a/src/main/java/com/loginradius/sdk/demo/DemoRoutes.java b/src/main/java/com/loginradius/sdk/demo/DemoRoutes.java new file mode 100644 index 0000000..9ca7dd5 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/demo/DemoRoutes.java @@ -0,0 +1,116 @@ +// Code generated by the LoginRadius SDK generator; DO NOT EDIT. +// +// The demo's endpoint surface, generated from the shared SDK manifest `demo.routes` +// so every LoginRadius SDK's demo exposes the same 36 routes. +// The UI is deliberately per-language; this contract is not. +// +// Each entry names a handler that DemoHandlers must implement. Add a route to +// the manifest and this file stops compiling until the handler exists — a +// missing flow is a build failure, not a 404 someone finds later. + +package com.loginradius.sdk.demo; + +import java.util.List; + +/** The demo's endpoint contract. */ +public final class DemoRoutes { + + /** One endpoint the demo must expose. */ + public static final class Route { + /** The single HTTP verb this route accepts. */ + public final String method; + /** URL path, identical across every language's demo. */ + public final String path; + /** True when the route needs a signed-in demo session. */ + public final boolean requiresSession; + /** The implementation on {@link DemoHandlers}. */ + public final DemoHandlers.Handler handler; + + Route(String method, String path, boolean requiresSession, DemoHandlers.Handler handler) { + this.method = method; + this.path = path; + this.requiresSession = requiresSession; + this.handler = handler; + } + } + + private DemoRoutes() {} + + /** Returns the full contract. Registered by {@link DemoServer}. */ + public static List<Route> all(DemoHandlers h) { + return List.of( + // Register a new user. Mints a SOTT server-side; never accepts one from the client. + new Route("POST", "/api/auth/register", false, h::register), + // Email + password login. Stores the returned access token in the demo session. + new Route("POST", "/api/auth/login", false, h::login), + // Invalidates the access token upstream, then clears the demo session cookie. + new Route("POST", "/api/auth/logout", true, h::logout), + // Landing point for the link in the verification email. Redirects back to the UI with a status banner rather than returning JSON. + new Route("GET", "/api/auth/verify", false, h::verifyEmail), + // Sends a password-reset email containing a reset token. + new Route("POST", "/api/password/forgot", false, h::forgotPassword), + // Completes a reset using the token from the email. + new Route("POST", "/api/password/reset", false, h::resetPassword), + // Changes the signed-in user's password. + new Route("POST", "/api/password/change", true, h::changePassword), + // Returns the signed-in user's profile. + new Route("GET", "/api/profile", true, h::getProfile), + // Updates editable fields on the signed-in user's profile. + new Route("POST", "/api/profile/update", true, h::updateProfile), + // Emails a one-time code to start a passwordless login. + new Route("GET", "/api/auth/passwordless/email", false, h::passwordlessLoginByEmail), + // Completes a passwordless login with the code emailed to the user. + new Route("POST", "/api/auth/passwordless/email/verify", false, h::passwordlessLoginByEmailOtp), + // Texts a one-time code to start a passwordless login. + new Route("GET", "/api/auth/passwordless/phone", false, h::passwordlessLoginByPhone), + // Completes a passwordless login with the code texted to the user. + new Route("PUT", "/api/auth/passwordless/phone/verify", false, h::passwordlessLoginByPhoneOtp), + // Adds a secondary email to the signed-in account and sends verification. + new Route("POST", "/api/email/add", true, h::addEmail), + // Removes a secondary email from the signed-in account. + new Route("DELETE", "/api/email", true, h::deleteEmail), + // Changes the signed-in user's phone number and sends a verification OTP. + new Route("PUT", "/api/phone", true, h::updatePhone), + // Deletes the signed-in user's own account. Refuses any other address. + new Route("DELETE", "/api/account", true, h::deleteAccount), + // Sends a password-reset OTP to the phone number on the account. + new Route("POST", "/api/password/otp", false, h::requestResetOtp), + // Completes a password reset using the OTP delivered by SMS. + new Route("PUT", "/api/password/otp", false, h::resetPasswordWithOtp), + // Stores a new custom object against the signed-in user. + new Route("POST", "/api/customobject", true, h::createCustomObject), + // Lists the signed-in user's custom objects for the configured schema. + new Route("GET", "/api/customobject", true, h::listCustomObjects), + // Replaces one custom object record by id. + new Route("PUT", "/api/customobject/{objectRecordId}", true, h::updateCustomObject), + // Deletes one custom object record by id. + new Route("DELETE", "/api/customobject/{objectRecordId}", true, h::deleteCustomObject), + // Exchanges the stored refresh token for a fresh access token. + new Route("POST", "/api/token/refresh", true, h::refreshToken), + // Confirms the session's access token is still valid upstream. + new Route("GET", "/api/token/validate", true, h::validateToken), + // Returns the active session records bound to the access token. + new Route("GET", "/api/token/session", true, h::activeSession), + // Starts passkey enrolment and returns the WebAuthn creation options. + new Route("GET", "/api/passkey/register/begin", false, h::beginPasskeyRegistration), + // Completes passkey enrolment with the browser's attestation response. + new Route("POST", "/api/passkey/register/finish", false, h::finishPasskeyRegistration), + // Starts passkey login and returns the WebAuthn request options. + new Route("GET", "/api/passkey/login/begin", false, h::beginPasskeyLogin), + // Completes passkey login with the browser's assertion response. + new Route("POST", "/api/passkey/login/finish", false, h::finishPasskeyLogin), + // Returns which second factors are configured on the signed-in account. + new Route("GET", "/api/mfa/settings", true, h::mfaSettings), + // Confirms a TOTP code and enrols the authenticator on the account. + new Route("PUT", "/api/mfa/totp", true, h::mfaEnrolTotp), + // Issues a fresh set of single-use MFA backup codes. + new Route("GET", "/api/mfa/backupcodes", true, h::mfaBackupCodes), + // Sends an email OTP for an in-progress MFA login challenge. + new Route("POST", "/api/mfa/login/email", false, h::mfaSendEmailOtp), + // Completes an MFA login challenge with an email OTP. + new Route("PUT", "/api/mfa/login/email", false, h::mfaVerifyEmailOtp), + // Completes an MFA login challenge with a TOTP code. + new Route("PUT", "/api/mfa/login/totp", false, h::mfaVerifyTotp) + ); + } +} diff --git a/src/main/java/com/loginradius/sdk/demo/DemoServer.java b/src/main/java/com/loginradius/sdk/demo/DemoServer.java new file mode 100644 index 0000000..94cd23d --- /dev/null +++ b/src/main/java/com/loginradius/sdk/demo/DemoServer.java @@ -0,0 +1,315 @@ +package com.loginradius.sdk.demo; + +import com.loginradius.sdk.LoginRadiusClient; +import com.loginradius.sdk.LoginRadiusConfig; +import com.sun.net.httpserver.HttpExchange; +import com.sun.net.httpserver.HttpServer; +import java.io.IOException; +import java.io.InputStream; +import java.net.InetSocketAddress; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Pattern; + +/** + * A runnable demo of the LoginRadius Java SDK. + * + * <p>Uses the JDK's built-in {@code HttpServer} rather than a web framework, so + * the demo adds no dependency beyond the SDK itself — the same reasoning as the + * Go demo using {@code net/http}. + * + * <pre> + * cp .env.example .env # fill in your tenant credentials + * mvn -q compile exec:java -Dexec.mainClass=com.loginradius.sdk.demo.DemoServer + * </pre> + * + * <p>Reads {@code .env} from the current working directory via {@link DemoEnv} + * (a real, non-blank shell environment variable always takes precedence — set + * one instead of {@code .env} if you prefer: {@code export LR_API_KEY=...}). + * Reads the same variables as every other language's demo: {@code LR_API_KEY}, + * {@code LR_API_SECRET}, and the optional server-selection trio + * {@code LR_DOMAIN} / {@code LR_CUSTOM_DOMAIN} / {@code LR_BASE_URL}. + */ +public final class DemoServer { + + private DemoServer() {} + + public static void main(String[] args) throws IOException { + String apiKey = DemoEnv.get("LR_API_KEY"); + if (Demo.isBlank(apiKey)) { + System.err.println("LR_API_KEY is required"); + System.exit(1); + } + + // The SOTT query-parameter encoding fix (see the facade's own + // SottEncodingInterceptor) is applied by LoginRadiusClient itself now — + // the demo needs no OkHttpClient of its own for it. + LoginRadiusConfig.Builder b = + LoginRadiusConfig.builder().apiKey(apiKey).userAgent("loginradius-java-demo/0.1"); + if (!Demo.isBlank(DemoEnv.get("LR_API_SECRET"))) { + b.apiSecret(DemoEnv.get("LR_API_SECRET")); + } + // Server selection, same precedence as every other SDK. + if (!Demo.isBlank(DemoEnv.get("LR_DOMAIN"))) { + b.domain(DemoEnv.get("LR_DOMAIN")); + } + if (!Demo.isBlank(DemoEnv.get("LR_CUSTOM_DOMAIN"))) { + b.customDomain(DemoEnv.get("LR_CUSTOM_DOMAIN")); + } + if (!Demo.isBlank(DemoEnv.get("LR_BASE_URL"))) { + b.baseURL(DemoEnv.get("LR_BASE_URL")); + } + + LoginRadiusConfig config = b.build(); + LoginRadiusClient client = LoginRadiusClient.create(config); + DemoSessions sessions = new DemoSessions(); + DemoHandlers handlers = new DemoHandlers(client, config, sessions); + + int port = Integer.parseInt(DemoEnv.get("LR_DEMO_PORT", "8080")); + HttpServer server = HttpServer.create(new InetSocketAddress(port), 0); + + // The UI and its assets. Not part of the shared contract — each language's + // demo ships its own markup, which is deliberate; only the stylesheet is + // shared. This is a prefix context, so it also catches /demo.css. + server.createContext("/", DemoServer::serveUi); + + // The API surface comes from DemoRoutes, generated from the shared SDK manifest. + // Registering from the table (rather than by hand) is what keeps every + // language's demo on the same endpoints: method checking and session + // enforcement are applied uniformly here instead of being re-implemented, + // slightly differently, in each handler. + // + // Grouped by path for the same reason the hand-written extra routes below + // are: the JDK's HttpServer allows only one context per exact path, and + // the manifest itself declares more than one method at some paths (e.g. + // POST+PUT /api/password/otp, GET+POST /api/customobject). Registering + // one createContext per route, naively, let the last registration at a + // shared path silently shadow the others — confirmed live: PUT + // /api/password/otp and GET /api/customobject were both unreachable + // (405) until this grouped dispatch. + // + // A path containing a manifest path parameter (e.g. + // /api/customobject/{objectRecordId}) is grouped by its literal prefix + // instead — the JDK's HttpServer has no template syntax of its own, only + // longest-prefix matching, so "/api/customobject/" is registered as a + // context and the segment after it is read directly from the request URI + // by whichever handler needs it (see DemoHandlers.resolveRecordId). + // Confirmed live: without this, PUT/DELETE with a real id in the URL + // matched the unrelated GET/POST /api/customobject context instead. + Map<String, List<DemoRoutes.Route>> generated = new LinkedHashMap<>(); + for (DemoRoutes.Route route : DemoRoutes.all(handlers)) { + int brace = route.path.indexOf('{'); + String key = brace < 0 ? route.path : route.path.substring(0, brace); + generated.computeIfAbsent(key, p -> new ArrayList<>()).add(route); + } + for (Map.Entry<String, List<DemoRoutes.Route>> e : generated.entrySet()) { + List<DemoRoutes.Route> routes = e.getValue(); + server.createContext(e.getKey(), ex -> dispatch(ex, routes, sessions)); + } + + // Non-contract endpoint: returns a fresh SOTT on every GET request. + server.createContext("/api/sott", ex -> { + if (!"GET".equalsIgnoreCase(ex.getRequestMethod())) { + ex.getResponseHeaders().add("Allow", "GET"); + Demo.writeJson(ex, 405, Map.of("error", "method not allowed")); + return; + } + handlers.freshSott(ex); + }); + + // Extended API routes — not part of the shared manifest contract. + // + // Grouped by path rather than registered one createContext per call: the + // JDK's HttpServer allows only one context per exact path, and a future + // hand-written route could share a path with another method (as the + // generated table's own routes do, e.g. /api/mfa/login/email). + Map<String, List<ExtraRoute>> extra = new LinkedHashMap<>(); + addRoute(extra, "POST", "/api/email/delete", AuthMode.SESSION, handlers::deleteEmail); + addRoute(extra, "POST", "/api/account/delete", AuthMode.SESSION, handlers::deleteAccount); + addRoute(extra, "POST", "/api/phone/update", AuthMode.SESSION, handlers::updatePhone); + addRoute(extra, "POST", "/api/password/reset-otp", AuthMode.NONE, handlers::resetPasswordWithToken); + addRoute(extra, "POST", "/api/customobject/create", AuthMode.SESSION, handlers::createCustomObject); + addRoute(extra, "POST", "/api/customobject/list", AuthMode.SESSION, handlers::listCustomObjects); + addRoute(extra, "POST", "/api/customobject/update", AuthMode.SESSION, handlers::updateCustomObject); + addRoute(extra, "POST", "/api/customobject/delete", AuthMode.SESSION, handlers::deleteCustomObject); + addRoute(extra, "POST", "/api/token/validate", AuthMode.NONE, handlers::validateToken); + addRoute(extra, "GET", "/api/session/active", AuthMode.SESSION, handlers::activeSession); + addRoute(extra, "POST", "/api/token/invalidate", AuthMode.SESSION, handlers::invalidateToken); + addRoute(extra, "POST", "/api/passkey/login/begin", AuthMode.NONE, handlers::beginPasskeyLogin); + addRoute(extra, "POST", "/api/passkey/register/begin", AuthMode.NONE, handlers::beginPasskeyRegistration); + + for (Map.Entry<String, List<ExtraRoute>> e : extra.entrySet()) { + List<ExtraRoute> routes = e.getValue(); + server.createContext(e.getKey(), ex -> dispatchExtra(ex, routes, sessions)); + } + + server.setExecutor(null); + System.out.printf("demo listening on http://localhost:%d/%n", port); + server.start(); + } + + /** + * How a hand-written extra route authenticates. {@code MFA_TOKEN} is + * distinct from {@code SESSION}: it is satisfied by the second-factor token + * a challenge login returned, held in its own cookie, and a session cookie + * must never open one of these routes — a half-authenticated user must never + * hold anything the session middleware accepts. + */ + private enum AuthMode { + NONE, + SESSION, + MFA_TOKEN + } + + private record ExtraRoute(String method, AuthMode auth, DemoHandlers.Handler handler) {} + + /** + * Declares one hand-written extra route, outside the generated manifest + * contract. Several methods can share one path (see {@code extra} in + * {@link #main}) — {@link #dispatchExtra} picks the matching one. + */ + private static void addRoute( + Map<String, List<ExtraRoute>> table, + String method, + String path, + AuthMode auth, + DemoHandlers.Handler handler) { + table.computeIfAbsent(path, p -> new ArrayList<>()).add(new ExtraRoute(method, auth, handler)); + } + + /** + * Applies the cross-cutting rules for a hand-written extra route: HTTP-method + * matching (aggregating every method registered at this path into one + * {@code Allow} header when none match) and the route's auth mode. + */ + private static void dispatchExtra(HttpExchange ex, List<ExtraRoute> routes, DemoSessions sessions) + throws IOException { + for (ExtraRoute route : routes) { + if (!route.method().equalsIgnoreCase(ex.getRequestMethod())) { + continue; + } + switch (route.auth()) { + case SESSION -> { + if (sessions.lookup(Demo.sessionId(ex)) == null) { + Demo.writeJson(ex, 401, Map.of("error", "not signed in")); + return; + } + } + case MFA_TOKEN -> { + if (Demo.mfaToken(ex) == null) { + Demo.writeJson(ex, 401, Map.of( + "error", "no MFA challenge in progress", + "hint", "sign in first; a login that requires a second factor starts the challenge")); + return; + } + } + case NONE -> { + // No credential required. + } + } + try { + route.handler().handle(ex); + } catch (RuntimeException e) { + Demo.writeJson(ex, 500, Map.of("error", String.valueOf(e.getMessage()))); + } + return; + } + String allow = String.join(", ", routes.stream().map(ExtraRoute::method).distinct().toList()); + ex.getResponseHeaders().add("Allow", allow); + Demo.writeJson(ex, 405, Map.of("error", "method not allowed")); + } + + /** + * Applies the cross-cutting rules the generated table declares: HTTP-method + * matching (aggregating every method registered at this path into one + * {@code Allow} header when none match, same as {@link #dispatchExtra}) and + * the route's session requirement. + */ + private static void dispatch(HttpExchange ex, List<DemoRoutes.Route> routes, DemoSessions sessions) + throws IOException { + for (DemoRoutes.Route route : routes) { + if (!route.method.equalsIgnoreCase(ex.getRequestMethod())) { + continue; + } + if (route.requiresSession && sessions.lookup(Demo.sessionId(ex)) == null) { + Demo.writeJson(ex, 401, Map.of("error", "not signed in")); + return; + } + try { + route.handler.handle(ex); + } catch (RuntimeException e) { + Demo.writeJson(ex, 500, Map.of("error", String.valueOf(e.getMessage()))); + } + return; + } + String allow = String.join(", ", routes.stream().map(r -> r.method).distinct().toList()); + ex.getResponseHeaders().add("Allow", allow); + Demo.writeJson(ex, 405, Map.of("error", "method not allowed")); + } + + /** + * A flat asset name. The demo's web root has no subdirectories, so a + * legitimate asset name contains no separator — refusing anything else, + * rather than resolving it, is what keeps a crafted request path from + * reaching a classpath resource outside {@code /demo/}. + */ + private static final Pattern SAFE_ASSET = Pattern.compile("[A-Za-z0-9._-]+"); + + /** + * Serves the demo's static assets from the classpath: {@code index.html} at + * "/", and anything else under {@code /demo/} by name — {@code demo.css} + * among them, which is rendered from the factory's shared template so every + * SDK's demo looks the same. + * + * <p>Serving the whole directory rather than only index.html: a page that + * links a stylesheet the server will not hand out renders unstyled, and it + * does so silently, behind a 404 nobody sees without opening devtools. + */ + private static void serveUi(HttpExchange ex) throws IOException { + String path = ex.getRequestURI().getPath(); + String name = "/".equals(path) ? "index.html" : path.substring(1); + if (!SAFE_ASSET.matcher(name).matches()) { + Demo.writeJson(ex, 404, Map.of("error", "not found")); + return; + } + try (InputStream in = DemoServer.class.getResourceAsStream("/demo/" + name)) { + if (in == null) { + // index.html missing means the resource overlay did not ship; say so in + // the browser rather than as a 404 that looks like a bad URL. + if (!"index.html".equals(name)) { + Demo.writeJson(ex, 404, Map.of("error", "not found")); + return; + } + write(ex, "text/html; charset=utf-8", "<h1>demo UI missing</h1>".getBytes(StandardCharsets.UTF_8)); + return; + } + write(ex, contentType(name), in.readAllBytes()); + } + } + + /** + * The Content-Type for an asset name. Spelled out rather than taken from + * {@code URLConnection.guessContentTypeFromName}, which returns null for + * {@code .css} on some JDKs — and a stylesheet served without + * {@code text/css} is ignored by every browser. + */ + private static String contentType(String name) { + if (name.endsWith(".html")) return "text/html; charset=utf-8"; + if (name.endsWith(".css")) return "text/css; charset=utf-8"; + if (name.endsWith(".js")) return "text/javascript; charset=utf-8"; + if (name.endsWith(".svg")) return "image/svg+xml"; + if (name.endsWith(".png")) return "image/png"; + if (name.endsWith(".ico")) return "image/x-icon"; + return "application/octet-stream"; + } + + private static void write(HttpExchange ex, String contentType, byte[] body) throws IOException { + ex.getResponseHeaders().add("Content-Type", contentType); + ex.sendResponseHeaders(200, body.length); + ex.getResponseBody().write(body); + ex.close(); + } +} diff --git a/src/main/java/com/loginradius/sdk/demo/DemoSessions.java b/src/main/java/com/loginradius/sdk/demo/DemoSessions.java new file mode 100644 index 0000000..7045f41 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/demo/DemoSessions.java @@ -0,0 +1,75 @@ +package com.loginradius.sdk.demo; + +import java.security.SecureRandom; +import java.util.HexFormat; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * In-memory session store mapping an opaque cookie value to the tokens + * LoginRadius returned. + * + * <p>The cookie deliberately carries an opaque id rather than the access + * token itself. Refreshing rotates the access token, and a cookie holding the + * old one would keep sending an invalidated credential; an id lets the + * rotation happen server-side without touching the browser — same reasoning + * as Node's demo. + * + * <p>DEMO ONLY. A real application would use a signed cookie or a session + * store; keeping tokens in a process map loses them on restart and does not + * survive more than one instance. + */ +final class DemoSessions { + + private record Entry(String accessToken, String refreshToken) {} + + private final Map<String, Entry> sessions = new ConcurrentHashMap<>(); + private final SecureRandom random = new SecureRandom(); + + /** Mints a session id for an access token, with an optional refresh token. */ + String create(String accessToken, String refreshToken) { + byte[] buf = new byte[16]; + random.nextBytes(buf); + String id = HexFormat.of().formatHex(buf); + sessions.put(id, new Entry(accessToken, refreshToken == null ? "" : refreshToken)); + return id; + } + + /** Mints a session id for an access token with no refresh token. */ + String create(String accessToken) { + return create(accessToken, ""); + } + + /** Returns the access token for a session id, or null. */ + String lookup(String id) { + Entry e = id == null ? null : sessions.get(id); + return e == null ? null : e.accessToken(); + } + + /** Returns the refresh token for a session id, or an empty string if the tenant returned none. */ + String lookupRefresh(String id) { + Entry e = id == null ? null : sessions.get(id); + return e == null || e.refreshToken() == null ? "" : e.refreshToken(); + } + + /** + * Swaps the tokens held under an existing id, used after a successful + * refresh so the rotated tokens take effect without forcing the user to + * sign in again. A blank refreshToken leaves the stored one alone — some + * tenants rotate only the access token. + */ + void replace(String id, String accessToken, String refreshToken) { + Entry existing = sessions.get(id); + if (existing == null) { + return; + } + String next = (refreshToken == null || refreshToken.isEmpty()) ? existing.refreshToken() : refreshToken; + sessions.put(id, new Entry(accessToken, next)); + } + + void delete(String id) { + if (id != null) { + sessions.remove(id); + } + } +} diff --git a/src/main/java/com/loginradius/sdk/examples/AccessToken.java b/src/main/java/com/loginradius/sdk/examples/AccessToken.java new file mode 100644 index 0000000..8e6a29f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/examples/AccessToken.java @@ -0,0 +1,29 @@ +package com.loginradius.sdk.examples; + +import com.loginradius.sdk.LoginRadiusConfig; + +/** + * Auth scheme: AccessToken (query {@code access_token}). + * + * <p>User-context endpoints operate on the signed-in user's own profile and sessions. The token comes from a login response and identifies that user. + * + * <p>RUNS OFFLINE — see {@link Examples}. + */ +public final class AccessToken { + + private AccessToken() {} + + /** Entry point. */ + public static void main(String[] args) { + Examples.heading("What goes on the wire"); + + Examples.Captured request = Examples.capture(LoginRadiusConfig.builder().apiKey("demo-api-key").accessToken("demo-access-token")); + + Examples.showHeaders(request, "X-LoginRadius-ApiKey"); + Examples.showQuery(request, "apikey", "access_token"); + + System.out.println(); + System.out.println("The access token identifies the user; the API key identifies your app.\n" + + "Both are sent — the endpoint needs to know who is calling and on whose behalf."); + } +} diff --git a/src/main/java/com/loginradius/sdk/examples/ApiKeySecret.java b/src/main/java/com/loginradius/sdk/examples/ApiKeySecret.java new file mode 100644 index 0000000..a195c40 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/examples/ApiKeySecret.java @@ -0,0 +1,29 @@ +package com.loginradius.sdk.examples; + +import com.loginradius.sdk.LoginRadiusConfig; + +/** + * Auth scheme: APIKey + APISecret. + * + * <p>Server-side-only operations — token exchange, account lookup, and management endpoints. The secret must never reach a browser or a mobile app; it is the credential that authorises acting on any user's behalf. + * + * <p>RUNS OFFLINE — see {@link Examples}. + */ +public final class ApiKeySecret { + + private ApiKeySecret() {} + + /** Entry point. */ + public static void main(String[] args) { + Examples.heading("What goes on the wire"); + + Examples.Captured request = Examples.capture(LoginRadiusConfig.builder().apiKey("demo-api-key").apiSecret("demo-api-secret")); + + Examples.showHeaders(request, "X-LoginRadius-ApiKey", "X-LoginRadius-ApiSecret"); + Examples.showQuery(request, "apikey", "apisecret"); + + System.out.println(); + System.out.println("Both credentials are sent as headers AND query parameters: some LoginRadius\n" + + "operations accept nothing else. Keep the secret server-side."); + } +} diff --git a/src/main/java/com/loginradius/sdk/examples/BearerTokenExample.java b/src/main/java/com/loginradius/sdk/examples/BearerTokenExample.java new file mode 100644 index 0000000..95fac6c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/examples/BearerTokenExample.java @@ -0,0 +1,28 @@ +package com.loginradius.sdk.examples; + +import com.loginradius.sdk.LoginRadiusConfig; + +/** + * Auth scheme: BearerToken ({@code Authorization: Bearer <token>}). + * + * <p>Endpoints protected with the HTTP bearer scheme accept a bearer token in the standard Authorization header. + * + * <p>RUNS OFFLINE — see {@link Examples}. + */ +public final class BearerTokenExample { + + private BearerTokenExample() {} + + /** Entry point. */ + public static void main(String[] args) { + Examples.heading("What goes on the wire"); + + Examples.Captured request = Examples.capture(LoginRadiusConfig.builder().apiKey("demo-api-key").bearerToken("demo-bearer-token")); + + Examples.showHeaders(request, "Authorization", "X-LoginRadius-ApiKey"); + Examples.showQuery(request, "apikey"); + + System.out.println(); + System.out.println("The bearer token goes in the standard Authorization header, not the query."); + } +} diff --git a/src/main/java/com/loginradius/sdk/examples/ClientIdSecret.java b/src/main/java/com/loginradius/sdk/examples/ClientIdSecret.java new file mode 100644 index 0000000..7936daf --- /dev/null +++ b/src/main/java/com/loginradius/sdk/examples/ClientIdSecret.java @@ -0,0 +1,28 @@ +package com.loginradius.sdk.examples; + +import com.loginradius.sdk.LoginRadiusConfig; + +/** + * Auth scheme: ClientId + ClientSecret (query parameters). + * + * <p>OAuth-style endpoints — typically multipurpose token operations and account linking. These identify an OAuth client rather than your LoginRadius app. + * + * <p>RUNS OFFLINE — see {@link Examples}. + */ +public final class ClientIdSecret { + + private ClientIdSecret() {} + + /** Entry point. */ + public static void main(String[] args) { + Examples.heading("What goes on the wire"); + + Examples.Captured request = Examples.capture(LoginRadiusConfig.builder().clientId("demo-client-id").clientSecret("demo-client-secret")); + + Examples.showHeaders(request, "X-LoginRadius-ApiKey"); + Examples.showQuery(request, "client_id", "client_secret"); + + System.out.println(); + System.out.println("The client secret is server-side-only, exactly like the API secret."); + } +} diff --git a/src/main/java/com/loginradius/sdk/examples/CustomHttp.java b/src/main/java/com/loginradius/sdk/examples/CustomHttp.java new file mode 100644 index 0000000..2376511 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/examples/CustomHttp.java @@ -0,0 +1,53 @@ +package com.loginradius.sdk.examples; + +import com.loginradius.sdk.LoginRadiusConfig; +import java.io.IOException; +import okhttp3.Interceptor; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; + +/** + * Plugging a custom {@link OkHttpClient} into the SDK — for a proxy, custom + * TLS, request logging, metrics, or connection-pool tuning. + * + * <p>Your client is extended, never replaced: the SDK adds its credential + * interceptor on top of whatever you configured. Note the ordering — your + * application interceptors run BEFORE the SDK's, so an interceptor of yours + * observes the request before credentials are applied. Use a network + * interceptor if you need to see the finished request. + * + * <p>RUNS OFFLINE — see {@link Examples}. + */ +public final class CustomHttp { + + private CustomHttp() {} + + /** Entry point. */ + public static void main(String[] args) { + Examples.heading("A client with your own interceptor"); + + OkHttpClient yours = + new OkHttpClient.Builder() + // A network interceptor sees the request as it goes out, after the + // SDK's credential interceptor has run. + .addNetworkInterceptor(new Logging()) + .build(); + + Examples.capture(LoginRadiusConfig.builder().apiKey("demo-api-key").httpClient(yours)); + + System.out.println(); + System.out.println("For a proxy, set it on your OkHttpClient.Builder with .proxy(...)."); + System.out.println("For custom TLS, use .sslSocketFactory(...). The SDK touches neither."); + } + + private static final class Logging implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request request = chain.request(); + System.out.printf(" -> %s %s%n", request.method(), request.url().encodedPath()); + System.out.printf(" credentials present: %s%n", request.header("X-LoginRadius-ApiKey") != null); + return chain.proceed(request); + } + } +} diff --git a/src/main/java/com/loginradius/sdk/examples/DebugLogging.java b/src/main/java/com/loginradius/sdk/examples/DebugLogging.java new file mode 100644 index 0000000..3a31b6a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/examples/DebugLogging.java @@ -0,0 +1,34 @@ +package com.loginradius.sdk.examples; + +import com.loginradius.sdk.LoginRadiusConfig; + +/** + * {@code debug} — a one-line summary of every request. + * + * <p>The property worth verifying here is REDACTION: credential header values + * are replaced before anything is written, so a debug log can be pasted into a + * ticket without leaking an API secret or an access token. The header NAME is + * kept, because knowing which credential was sent is the point of the log. + * + * <p>RUNS OFFLINE — see {@link Examples}. + */ +public final class DebugLogging { + + private DebugLogging() {} + + /** Entry point. */ + public static void main(String[] args) { + Examples.heading("Debug output"); + + Examples.capture( + LoginRadiusConfig.builder() + .apiKey("SUPER-SECRET-KEY") + .apiSecret("SUPER-SECRET-VALUE") + .bearerToken("SUPER-SECRET-TOKEN") + .debug(System.out)); + + System.out.println(); + System.out.println("Every credential above appears by header name with its value replaced."); + System.out.println("Pass any PrintStream — a file, a rotating logger, or System.err."); + } +} diff --git a/src/main/java/com/loginradius/sdk/examples/DefaultHeaders.java b/src/main/java/com/loginradius/sdk/examples/DefaultHeaders.java new file mode 100644 index 0000000..7cf74d7 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/examples/DefaultHeaders.java @@ -0,0 +1,44 @@ +package com.loginradius.sdk.examples; + +import com.loginradius.sdk.LoginRadiusConfig; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * {@code defaultHeaders} — headers merged into every outgoing request. + * + * <p>Useful for correlation IDs, tenant traces, or anything your gateway needs. + * The property worth understanding is PRECEDENCE: default headers are applied + * first, so the SDK's own credential and User-Agent headers always win. A + * default header cannot silently replace a credential. + * + * <p>RUNS OFFLINE — see {@link Examples}. + */ +public final class DefaultHeaders { + + private DefaultHeaders() {} + + /** Entry point. */ + public static void main(String[] args) { + Map<String, String> headers = new LinkedHashMap<>(); + headers.put("X-Tenant-Trace", "trace-abc123"); + headers.put("X-Correlation-Id", "req-42"); + // Deliberately attempts to hijack two headers the SDK owns. + headers.put("X-LoginRadius-ApiKey", "HIJACKED"); + headers.put("User-Agent", "HIJACKED"); + + Examples.Captured request = + Examples.capture( + LoginRadiusConfig.builder().apiKey("REAL-API-KEY").defaultHeaders(headers)); + + Examples.heading("Merged in"); + Examples.showHeaders(request, "X-Tenant-Trace", "X-Correlation-Id"); + + Examples.heading("Attempted overrides — the SDK's values stand"); + Examples.showHeaders(request, "X-LoginRadius-ApiKey", "User-Agent"); + + System.out.println(); + System.out.println("Both show the SDK's own value, not HIJACKED. Letting a default header"); + System.out.println("override a credential would mean silently sending the wrong one."); + } +} diff --git a/src/main/java/com/loginradius/sdk/examples/Examples.java b/src/main/java/com/loginradius/sdk/examples/Examples.java new file mode 100644 index 0000000..4fcd503 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/examples/Examples.java @@ -0,0 +1,258 @@ +package com.loginradius.sdk.examples; + +import com.loginradius.sdk.LoginRadiusClient; +import com.loginradius.sdk.LoginRadiusConfig; +import com.sun.net.httpserver.HttpExchange; +import com.sun.net.httpserver.HttpServer; +import java.io.IOException; +import java.io.UncheckedIOException; +import java.net.InetSocketAddress; +import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.function.Consumer; +import okhttp3.HttpUrl; +import okhttp3.Interceptor; +import okhttp3.MediaType; +import okhttp3.OkHttpClient; +import okhttp3.Protocol; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +/** + * Shared plumbing for the runnable examples. + * + * <p>Every example in this package RUNS OFFLINE. Each calls a real SDK + * operation against a throwaway HTTP server on localhost, so the output is + * exactly what the SDK put on the wire — no tenant, no credentials, no + * outbound network. Run one with: + * + * <pre>{@code + * mvn -q package -DskipTests + * java -cp target/classes com.loginradius.sdk.examples.RequestOptions + * }</pre> + * + * <p>A local server rather than an interceptor is deliberate. OkHttp runs + * application interceptors in the order they were added, and the SDK adds its + * credential interceptor <em>after</em> the ones on a client you supplied — so + * an interceptor of yours that short-circuits the chain observes the request + * before any credential is applied, and would show nothing. Letting the request + * complete against localhost is the only way to see the finished article. + * + * <p>This package is excluded from the published jar — see the + * {@code maven-jar-plugin} configuration in {@code pom.xml}. It compiles with + * the SDK so the examples cannot rot, but customers never receive it. + */ +public final class Examples { + + private Examples() {} + + /** One request, as it arrived at the server. */ + public static final class Captured { + private final String method; + private final URI uri; + private final Map<String, String> headers; + + Captured(String method, URI uri, Map<String, String> headers) { + this.method = method; + this.uri = uri; + this.headers = headers; + } + + /** The request method. */ + public String method() { + return method; + } + + /** The path and query, as received. */ + public URI uri() { + return uri; + } + + /** A header value, or null when absent. Names match case-insensitively. */ + public String header(String name) { + return headers.get(name.toLowerCase(java.util.Locale.ROOT)); + } + + /** A query-parameter value, or null when absent. */ + public String query(String name) { + HttpUrl url = HttpUrl.parse("http://localhost" + uri); + return url == null ? null : url.queryParameter(name); + } + } + + /** + * Runs one operation against a throwaway local server and returns the request + * that arrived. + * + * <p>Any operation would do: the options these examples demonstrate apply to + * every request, which is the whole point of them living in the transport. + */ + public static Captured capture(LoginRadiusConfig.Builder builder) { + return capture(builder, Examples::anyAuthOperation); + } + + /** + * Runs {@code call} against a throwaway local server and returns the request + * that arrived. Use this when the example needs a particular endpoint — + * signing, for instance, applies only to management paths. + */ + public static Captured capture( + LoginRadiusConfig.Builder builder, Consumer<LoginRadiusClient> call) { + List<Captured> seen = new ArrayList<>(); + HttpServer server; + try { + server = HttpServer.create(new InetSocketAddress("127.0.0.1", 0), 0); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + + server.createContext( + "/", + (HttpExchange exchange) -> { + Map<String, String> headers = new LinkedHashMap<>(); + exchange + .getRequestHeaders() + .forEach( + (name, values) -> + headers.put( + name.toLowerCase(java.util.Locale.ROOT), String.join(",", values))); + seen.add(new Captured(exchange.getRequestMethod(), exchange.getRequestURI(), headers)); + + byte[] body = "{}".getBytes(StandardCharsets.UTF_8); + exchange.getResponseHeaders().add("Content-Type", "application/json"); + exchange.sendResponseHeaders(200, body.length); + exchange.getResponseBody().write(body); + exchange.close(); + }); + server.start(); + + try { + int port = server.getAddress().getPort(); + LoginRadiusClient client = + LoginRadiusClient.create(builder.baseURL("http://127.0.0.1:" + port).build()); + try { + call.accept(client); + } catch (Exception expected) { + // The canned response does not deserialise into the operation's model; + // the request is what matters. + } + } finally { + server.stop(0); + } + + if (seen.isEmpty()) { + throw new IllegalStateException("no request reached the local server"); + } + return seen.get(seen.size() - 1); + } + + /** + * Captures only the URL an operation would address, without sending anything. + * + * <p>Used by the operation-servers example, which is about hosts the SDK + * chooses — pointing it at localhost would defeat the point. + */ + public static Request captureUrlOnly( + LoginRadiusConfig.Builder builder, Consumer<LoginRadiusClient> call) { + UrlRecorder recorder = new UrlRecorder(); + LoginRadiusClient client = + LoginRadiusClient.create( + builder + .httpClient(new OkHttpClient.Builder().addInterceptor(recorder).build()) + .build()); + try { + call.accept(client); + } catch (Exception expected) { + // See capture(). + } + if (recorder.captured == null) { + throw new IllegalStateException("no request was built"); + } + return recorder.captured; + } + + private static final class UrlRecorder implements Interceptor { + private Request captured; + + @Override + public Response intercept(Chain chain) { + captured = chain.request(); + return new Response.Builder() + .request(captured) + .protocol(Protocol.HTTP_1_1) + .code(200) + .message("OK") + .body(ResponseBody.create("{}", MediaType.get("application/json"))) + .build(); + } + } + + /** GET /identity/v2/auth/login/... — an ordinary, unsigned endpoint. */ + public static void anyAuthOperation(LoginRadiusClient client) { + try { + client.login.checkUserNameAvailability("alice", null, null, null, null, null); + } catch (Exception expected) { + // See capture(). + } + } + + /** GET /identity/v2/manage/account/{uid} — a management endpoint. */ + public static void anyManagementOperation(LoginRadiusClient client) { + try { + client.accounts.getAccountIdentityByUID("demo-uid", null, null); + } catch (Exception expected) { + // See capture(). + } + } + + /** + * GET /identity/v2/manage/account/access_token — a management endpoint that + * signing deliberately excludes, because it is how you obtain the credential + * you would sign with. + */ + public static void accessTokenExchange(LoginRadiusClient client) { + try { + client.accounts.getImpersonationToken("demo-uid", null, null); + } catch (Exception expected) { + // See capture(). + } + } + + /** Prints headers, or a placeholder when absent. */ + public static void showHeaders(Captured request, String... names) { + for (String name : names) { + String value = request.header(name); + System.out.printf(" %-28s %s%n", name + ":", value == null ? "(not sent)" : value); + } + } + + /** Prints query parameters, or a placeholder when absent. */ + public static void showQuery(Captured request, String... names) { + for (String name : names) { + String value = request.query(name); + System.out.printf(" %-28s %s%n", "?" + name + "=", value == null ? "(not sent)" : value); + } + } + + /** Prints the request line as received. */ + public static void showUrl(String label, Captured request) { + System.out.printf(" %-28s %s %s%n", label, request.method(), request.uri()); + } + + /** Prints a URL the SDK built. */ + public static void showUrl(String label, Request request) { + System.out.printf(" %-28s %s%n", label, request.url()); + } + + /** Section heading. */ + public static void heading(String title) { + System.out.println(); + System.out.println(title); + System.out.println("-".repeat(title.length())); + } +} diff --git a/src/main/java/com/loginradius/sdk/examples/Login.java b/src/main/java/com/loginradius/sdk/examples/Login.java new file mode 100644 index 0000000..f83aa0e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/examples/Login.java @@ -0,0 +1,61 @@ +package com.loginradius.sdk.examples; + +import com.loginradius.sdk.LoginRadiusClient; +import com.loginradius.sdk.LoginRadiusConfig; +import com.loginradius.sdk.LoginRadiusException; +import com.loginradius.sdk.internal.openapi.ApiException; + +/** + * A passwordless login flow: the user receives a one-time email link which, on + * click, delivers an access token. + * + * <p>This example covers the first half — initiating the email. Completing the + * flow happens in the browser via the verification endpoint; the demo server in + * {@code com.loginradius.sdk.demo} shows that half. + * + * <p>Unlike the rest of this package this example really does call the API: + * + * <pre>{@code + * LR_API_KEY=... java -cp target/classes \ + * com.loginradius.sdk.examples.Login user@example.com + * }</pre> + */ +public final class Login { + + private Login() {} + + /** Entry point. */ + public static void main(String[] args) { + if (args.length != 1) { + System.err.println("usage: Login <email>"); + System.exit(2); + } + String email = args[0]; + + String apiKey = System.getenv("LR_API_KEY"); + if (apiKey == null || apiKey.isEmpty()) { + System.err.println("LR_API_KEY is required"); + System.exit(2); + } + + LoginRadiusClient client = + LoginRadiusClient.create(LoginRadiusConfig.builder().apiKey(apiKey).build()); + + try { + var response = + client.login.passwordlessLoginByEmail( + email, null, null, null, null, null, null, null, null, null, null, null); + System.out.println("login email sent: " + response); + } catch (ApiException e) { + // The typed exception carries the HTTP status, the LoginRadius error + // code, and the raw body — branch on intent, not on status codes. + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + if (lr.isAuth()) { + System.err.println("authentication rejected: " + lr.description()); + } else { + System.err.printf("failed: %s (code %s)%n", lr.description(), lr.code()); + } + System.exit(1); + } + } +} diff --git a/src/main/java/com/loginradius/sdk/examples/M2mBearerToken.java b/src/main/java/com/loginradius/sdk/examples/M2mBearerToken.java new file mode 100644 index 0000000..423201f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/examples/M2mBearerToken.java @@ -0,0 +1,29 @@ +package com.loginradius.sdk.examples; + +import com.loginradius.sdk.LoginRadiusConfig; + +/** + * Auth scheme: M2MBearerToken ({@code Authorization: Bearer <JWT>}). + * + * <p>Machine-to-machine endpoints require an M2M JWT, obtained from the OAuth M2M token endpoint rather than from a user login. + * + * <p>RUNS OFFLINE — see {@link Examples}. + */ +public final class M2mBearerToken { + + private M2mBearerToken() {} + + /** Entry point. */ + public static void main(String[] args) { + Examples.heading("What goes on the wire"); + + Examples.Captured request = Examples.capture(LoginRadiusConfig.builder().apiKey("demo-api-key").m2mBearerToken("demo-m2m-jwt")); + + Examples.showHeaders(request, "Authorization", "X-LoginRadius-ApiKey"); + Examples.showQuery(request, "apikey"); + + System.out.println(); + System.out.println("An M2M token represents a service, not a user, so there is no access_token\n" + + "and no signed-in identity behind the call."); + } +} diff --git a/src/main/java/com/loginradius/sdk/examples/OperationServers.java b/src/main/java/com/loginradius/sdk/examples/OperationServers.java new file mode 100644 index 0000000..8374b57 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/examples/OperationServers.java @@ -0,0 +1,68 @@ +package com.loginradius.sdk.examples; + +import com.loginradius.sdk.LoginRadiusClient; +import com.loginradius.sdk.LoginRadiusConfig; +import okhttp3.Request; + +/** + * The fix for a defect that silently ignored your server configuration. + * + * <p>The OpenAPI specification pins 42 operations to their own host — the + * migration and cloud-api services, plus the tenant-hub and custom-domain + * templates. The generator inlines each pin into the operation itself, so + * neither {@code baseURL} nor the client-level server list reached them. + * + * <p>Two consequences, both fixed: + * + * <ul> + * <li>A caller who set {@code baseURL} to a proxy or staging host still had + * those 42 operations go to production.</li> + * <li>A pin carrying a template variable was used verbatim, so the request + * went to a host with the braces still in it.</li> + * </ul> + * + * <p>RUNS OFFLINE — see {@link Examples}. + */ +public final class OperationServers { + + private OperationServers() {} + + /** Entry point. */ + public static void main(String[] args) { + Examples.heading("Nothing configured — the spec's placeholder stands"); + show(LoginRadiusConfig.builder().apiKey("demo-api-key")); + System.out.println(" (that is the specification's own default, not a real tenant)"); + + Examples.heading("domain(\"acme\") — fills the {domain} template variable"); + show(LoginRadiusConfig.builder().apiKey("demo-api-key").domain("acme")); + + Examples.heading("baseURL(...) — means \"send everything here\", pins included"); + show( + LoginRadiusConfig.builder() + .apiKey("demo-api-key") + .baseURL("https://staging.internal")); + + Examples.heading("An ordinary, unpinned operation for comparison"); + Request unpinned = + Examples.captureUrlOnly( + LoginRadiusConfig.builder().apiKey("demo-api-key").baseURL("https://staging.internal"), + Examples::anyAuthOperation); + Examples.showUrl("URL sent:", unpinned); + } + + private static void show(LoginRadiusConfig.Builder builder) { + // GetBigCommerceLoginUrl is pinned to https://{domain}.hub.loginradius.com. + // captureUrlOnly, not capture: this example is about which host the SDK + // picks, so pointing it at localhost would defeat the point. + Request request = Examples.captureUrlOnly(builder, OperationServers::pinnedOperation); + Examples.showUrl("URL sent:", request); + } + + private static void pinnedOperation(LoginRadiusClient client) { + try { + client.bigCommerceSso.getBigCommerceLoginUrl("demo-token", "mystore", null, null); + } catch (Exception expected) { + // See Examples.capture. + } + } +} diff --git a/src/main/java/com/loginradius/sdk/examples/Quickstart.java b/src/main/java/com/loginradius/sdk/examples/Quickstart.java new file mode 100644 index 0000000..a552033 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/examples/Quickstart.java @@ -0,0 +1,51 @@ +package com.loginradius.sdk.examples; + +import com.loginradius.sdk.LoginRadiusClient; +import com.loginradius.sdk.LoginRadiusConfig; +import com.loginradius.sdk.LoginRadiusException; +import com.loginradius.sdk.internal.openapi.ApiException; + +/** + * The minimum needed to call a LoginRadius endpoint with the v12 SDK: + * construct a client with an API key, then call an operation through a service + * handle. + * + * <p>Unlike the rest of this package this example really does call the API, so + * it needs {@code LR_API_KEY} in the environment. + * + * <pre>{@code + * LR_API_KEY=... java -cp target/classes com.loginradius.sdk.examples.Quickstart + * }</pre> + */ +public final class Quickstart { + + private Quickstart() {} + + /** Entry point. */ + public static void main(String[] args) { + String apiKey = System.getenv("LR_API_KEY"); + if (apiKey == null || apiKey.isEmpty()) { + System.err.println("set LR_API_KEY to run this example"); + System.exit(1); + } + + // One client per tenant, reused for the life of the process: every service + // handle shares its HTTP client, interceptors, and configuration. + LoginRadiusClient client = + LoginRadiusClient.create(LoginRadiusConfig.builder().apiKey(apiKey).build()); + + try { + var result = client.login.checkUserNameAvailability("alice", null, null, null, null, null); + System.out.println("username available: " + result); + } catch (ApiException e) { + // Convert to the facade's typed exception so you branch on intent rather + // than on status codes. + LoginRadiusException lr = LoginRadiusClient.toLoginRadiusException(e); + System.err.printf("failed: %s (code %s)%n", lr.description(), lr.code()); + if (lr.isAuth()) { + System.err.println("the API key was rejected"); + } + System.exit(1); + } + } +} diff --git a/src/main/java/com/loginradius/sdk/examples/README.md b/src/main/java/com/loginradius/sdk/examples/README.md new file mode 100644 index 0000000..b0ab15e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/examples/README.md @@ -0,0 +1,34 @@ +# Examples + +One runnable class per topic. Build once, then run any of them: + +```bash +mvn -q package -DskipTests +java -cp target/classes com.loginradius.sdk.examples.RequestOptions +``` + +Most **run offline**: they call a real SDK operation but capture the request at +the transport instead of sending it, so you see exactly what would go on the +wire without a tenant, credentials, or a network. The two that do reach the API +say so and read `LR_API_KEY` from the environment. + +| Class | Shows | +|---|---| +| `Quickstart` | The minimum: construct a client, call an operation. **Needs `LR_API_KEY`.** | +| `Login` | Passwordless email login. **Needs `LR_API_KEY`.** | +| `ApiKeySecret` | API key + secret — server-side operations | +| `AccessToken` | Access token — user-context operations | +| `BearerTokenExample` | `Authorization: Bearer <token>` | +| `M2mBearerToken` | Machine-to-machine JWT | +| `ClientIdSecret` | OAuth client id + secret | +| `XLoginRadiusHeaders` | Header-only credentials, separate from the query form | +| `RequestOptions` | `originIp`, `serverRegion`, `fields`, `preventWebhook` | +| `DefaultHeaders` | Headers merged into every request, and why they cannot mask a credential | +| `RequestSigning` | `digest` / `x-Request-Expires`, and exactly which paths get signed | +| `DebugLogging` | Request logging, and the redaction that makes it safe to paste | +| `OperationServers` | The 42 operations the spec pins elsewhere, and how to redirect them | +| `TimeoutHttpClient` | How `timeout` interacts with an injected `OkHttpClient` | +| `CustomHttp` | Proxies, TLS, metrics — plugging in your own client | + +This package is excluded from the published jar. It compiles with the SDK so the +examples cannot rot, but customers never receive it. diff --git a/src/main/java/com/loginradius/sdk/examples/RequestOptions.java b/src/main/java/com/loginradius/sdk/examples/RequestOptions.java new file mode 100644 index 0000000..1a0c59c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/examples/RequestOptions.java @@ -0,0 +1,43 @@ +package com.loginradius.sdk.examples; + +import com.loginradius.sdk.LoginRadiusConfig; + +/** + * The four client-wide request options the legacy v11 SDK had and v12 was + * missing: {@code originIp}, {@code serverRegion}, {@code fields}, and + * {@code preventWebhook}. + * + * <p>Each is applied to EVERY outgoing request by the same interceptor that + * injects credentials, so there is one place to audit rather than 210 + * hand-written call sites. + * + * <p>RUNS OFFLINE — see {@link Examples}. + */ +public final class RequestOptions { + + private RequestOptions() {} + + /** Entry point. */ + public static void main(String[] args) { + Examples.heading("With every option set"); + Examples.Captured configured = + Examples.capture( + LoginRadiusConfig.builder() + .apiKey("demo-api-key") + .originIp("203.0.113.7") + .serverRegion("eu") + .fields("Email,Uid") + .preventWebhook(true)); + Examples.showHeaders(configured, "X-Origin-IP", "X-PreventWebhook"); + Examples.showQuery(configured, "region", "fields"); + + Examples.heading("With none set — nothing is added"); + Examples.Captured bare = Examples.capture(LoginRadiusConfig.builder().apiKey("demo-api-key")); + Examples.showHeaders(bare, "X-Origin-IP", "X-PreventWebhook"); + Examples.showQuery(bare, "region", "fields"); + + System.out.println(); + System.out.println("An unset option sends nothing at all — it never sends an empty value,"); + System.out.println("which the API would treat as a real (and wrong) filter."); + } +} diff --git a/src/main/java/com/loginradius/sdk/examples/RequestSigning.java b/src/main/java/com/loginradius/sdk/examples/RequestSigning.java new file mode 100644 index 0000000..6fcad5e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/examples/RequestSigning.java @@ -0,0 +1,52 @@ +package com.loginradius.sdk.examples; + +import com.loginradius.sdk.LoginRadiusClient; +import com.loginradius.sdk.LoginRadiusConfig; +import com.loginradius.sdk.Signing; +import java.util.function.Consumer; + +/** + * {@code apiRequestSigning} — the {@code digest} and {@code x-Request-Expires} + * headers the LoginRadius API accepts on management endpoints. + * + * <p>Signing is opt-in and off by default. When enabled it applies only to + * {@code /manage/} paths, and never to {@code /manage/account/access_token} — + * that call is how you obtain the credential you would sign with. + * + * <p>The API secret is stripped from the URL before the signature is computed, + * so the secret never appears in a signed URL nor on the wire. + * + * <p>RUNS OFFLINE — see {@link Examples}. + */ +public final class RequestSigning { + + private RequestSigning() {} + + /** Entry point. */ + public static void main(String[] args) { + show("A management endpoint — signed", Examples::anyManagementOperation); + show("An auth endpoint — not signed", Examples::anyAuthOperation); + show("The access-token exchange — excluded", Examples::accessTokenExchange); + + System.out.println(); + System.out.println("Signing cannot be validated offline: these prove the headers are applied"); + System.out.println("where they should be, not that the API accepts the signature. Make one"); + System.out.println("real /manage/ call against your tenant before relying on it."); + } + + private static void show(String label, Consumer<LoginRadiusClient> call) { + Examples.heading(label); + + Examples.Captured request = + Examples.capture( + LoginRadiusConfig.builder() + .apiKey("demo-api-key") + .apiSecret("demo-api-secret") + .apiRequestSigning(true), + call); + + Examples.showUrl("URL sent:", request); + Examples.showHeaders(request, Signing.DIGEST_HEADER, Signing.EXPIRES_HEADER); + Examples.showQuery(request, "apisecret"); + } +} diff --git a/src/main/java/com/loginradius/sdk/examples/TimeoutHttpClient.java b/src/main/java/com/loginradius/sdk/examples/TimeoutHttpClient.java new file mode 100644 index 0000000..a1d7f21 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/examples/TimeoutHttpClient.java @@ -0,0 +1,58 @@ +package com.loginradius.sdk.examples; + +import com.loginradius.sdk.LoginRadiusClient; +import com.loginradius.sdk.LoginRadiusConfig; +import java.time.Duration; +import java.util.concurrent.TimeUnit; +import okhttp3.OkHttpClient; + +/** + * How {@code timeout} interacts with an injected {@link OkHttpClient}. + * + * <p>The rule: the SDK never imposes its default on a client you own. A timeout + * you set on your own {@code OkHttpClient} survives; the SDK's 30-second + * default is applied only to the client it builds itself. Set {@code timeout} + * explicitly and it wins, because you asked for it. + * + * <p>Any other rule would silently retune a client you had already configured + * for your own workload. + */ +public final class TimeoutHttpClient { + + private TimeoutHttpClient() {} + + /** Entry point. */ + public static void main(String[] args) { + Examples.heading("The SDK's own client — the default applies"); + LoginRadiusClient a = + LoginRadiusClient.create(LoginRadiusConfig.builder().apiKey("demo-api-key").build()); + System.out.printf(" configured timeout %s%n", a.config().timeout()); + + Examples.heading("Your client, no timeout option — yours is left alone"); + OkHttpClient yours = + new OkHttpClient.Builder() + .connectTimeout(90, TimeUnit.SECONDS) + .readTimeout(90, TimeUnit.SECONDS) + .build(); + LoginRadiusClient b = + LoginRadiusClient.create( + LoginRadiusConfig.builder().apiKey("demo-api-key").httpClient(yours).build()); + System.out.printf(" your read timeout %d ms%n", yours.readTimeoutMillis()); + System.out.printf(" SDK overrode it? %s%n", b.config().timeoutSet() ? "yes" : "no"); + + Examples.heading("Your client AND an explicit timeout — the explicit one wins"); + LoginRadiusClient c = + LoginRadiusClient.create( + LoginRadiusConfig.builder() + .apiKey("demo-api-key") + .httpClient(yours) + .timeout(Duration.ofSeconds(5)) + .build()); + System.out.printf(" configured timeout %s%n", c.config().timeout()); + System.out.printf(" applied to your client? %s%n", c.config().timeoutSet() ? "yes" : "no"); + + System.out.println(); + System.out.println("Injecting a client keeps your proxy, TLS, dispatcher, and interceptors."); + System.out.println("The SDK only adds its own credential interceptor on top."); + } +} diff --git a/src/main/java/com/loginradius/sdk/examples/XLoginRadiusHeaders.java b/src/main/java/com/loginradius/sdk/examples/XLoginRadiusHeaders.java new file mode 100644 index 0000000..545744b --- /dev/null +++ b/src/main/java/com/loginradius/sdk/examples/XLoginRadiusHeaders.java @@ -0,0 +1,29 @@ +package com.loginradius.sdk.examples; + +import com.loginradius.sdk.LoginRadiusConfig; + +/** + * Auth scheme: XLoginRadiusAPIKey + XLoginRadiusAPISecret (header-only). + * + * <p>Use these when the header credentials must differ from the query-parameter ones — for example when a gateway in front of the API rewrites or consumes the query form. + * + * <p>RUNS OFFLINE — see {@link Examples}. + */ +public final class XLoginRadiusHeaders { + + private XLoginRadiusHeaders() {} + + /** Entry point. */ + public static void main(String[] args) { + Examples.heading("What goes on the wire"); + + Examples.Captured request = Examples.capture(LoginRadiusConfig.builder().apiKey("query-api-key").xLoginRadiusApiKey("header-api-key").xLoginRadiusApiSecret("header-api-secret")); + + Examples.showHeaders(request, "X-LoginRadius-ApiKey", "X-LoginRadius-ApiSecret"); + Examples.showQuery(request, "apikey"); + + System.out.println(); + System.out.println("The header credentials override the header form only; the query form still\n" + + "carries whatever apiKey was set. That separation is the point of these options."); + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/ApiCallback.java b/src/main/java/com/loginradius/sdk/internal/openapi/ApiCallback.java new file mode 100644 index 0000000..0554517 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/ApiCallback.java @@ -0,0 +1,62 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi; + +import java.io.IOException; + +import java.util.Map; +import java.util.List; + +/** + * Callback for asynchronous API call. + * + * @param <T> The return type + */ +public interface ApiCallback<T> { + /** + * This is called when the API call fails. + * + * @param e The exception causing the failure + * @param statusCode Status code of the response if available, otherwise it would be 0 + * @param responseHeaders Headers of the response if available, otherwise it would be null + */ + void onFailure(ApiException e, int statusCode, Map<String, List<String>> responseHeaders); + + /** + * This is called when the API call succeeded. + * + * @param result The result deserialized from response + * @param statusCode Status code of the response + * @param responseHeaders Headers of the response + */ + void onSuccess(T result, int statusCode, Map<String, List<String>> responseHeaders); + + /** + * This is called when the API upload processing. + * + * @param bytesWritten bytes Written + * @param contentLength content length of request body + * @param done write end + */ + void onUploadProgress(long bytesWritten, long contentLength, boolean done); + + /** + * This is called when the API download processing. + * + * @param bytesRead bytes Read + * @param contentLength content length of the response + * @param done Read end + */ + void onDownloadProgress(long bytesRead, long contentLength, boolean done); +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/ApiClient.java b/src/main/java/com/loginradius/sdk/internal/openapi/ApiClient.java new file mode 100644 index 0000000..27570f5 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/ApiClient.java @@ -0,0 +1,1684 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi; + +import okhttp3.*; +import okhttp3.internal.http.HttpMethod; +import okhttp3.internal.tls.OkHostnameVerifier; +import okhttp3.logging.HttpLoggingInterceptor; +import okhttp3.logging.HttpLoggingInterceptor.Level; +import okio.Buffer; +import okio.BufferedSink; +import okio.Okio; + +import javax.net.ssl.*; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.lang.reflect.Type; +import java.net.URI; +import java.net.URLConnection; +import java.net.URLEncoder; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.security.GeneralSecurityException; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.security.cert.Certificate; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.*; +import java.util.Map.Entry; +import java.util.concurrent.TimeUnit; +import java.util.function.Supplier; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import com.loginradius.sdk.internal.openapi.auth.Authentication; +import com.loginradius.sdk.internal.openapi.auth.HttpBasicAuth; +import com.loginradius.sdk.internal.openapi.auth.HttpBearerAuth; +import com.loginradius.sdk.internal.openapi.auth.ApiKeyAuth; + +/** + * <p>ApiClient class.</p> + */ +public class ApiClient { + + private String basePath = "https://api.loginradius.com"; + protected List<ServerConfiguration> servers = new ArrayList<ServerConfiguration>(Arrays.asList( + new ServerConfiguration( + "https://api.loginradius.com", + "LoginRadius Prod Server", + new HashMap<String, ServerVariable>() + ), + new ServerConfiguration( + "https://{domain}.hub.loginradius.com", + "LoginRadius Default HostedPage Server", + new HashMap<String, ServerVariable>() {{ + put("domain", new ServerVariable( + "LoginRadius Tenant Name", + "example", + new HashSet<String>( + ) + )); + }} + ), + new ServerConfiguration( + "https://{customDomain}", + "Custom Domain Hosted By LoginRadius", + new HashMap<String, ServerVariable>() {{ + put("customDomain", new ServerVariable( + "Custom domain", + "example.com", + new HashSet<String>( + ) + )); + }} + ) + )); + protected Integer serverIndex = 0; + protected Map<String, String> serverVariables = null; + private boolean debugging = false; + private Map<String, String> defaultHeaderMap = new HashMap<String, String>(); + private Map<String, String> defaultCookieMap = new HashMap<String, String>(); + private String tempFolderPath = null; + + private Map<String, Authentication> authentications; + + private DateFormat dateFormat; + private DateFormat datetimeFormat; + private boolean lenientDatetimeFormat; + private int dateLength; + + private InputStream sslCaCert; + private boolean verifyingSsl; + private KeyManager[] keyManagers; + + private OkHttpClient httpClient; + private JSON json; + + private HttpLoggingInterceptor loggingInterceptor; + + /** + * Basic constructor for ApiClient + */ + public ApiClient() { + init(); + initHttpClient(); + + // Setup authentications (key: authentication name, value: authentication). + authentications.put("AccessToken", new ApiKeyAuth("query", "access_token")); + authentications.put("BearerToken", new HttpBearerAuth("bearer")); + authentications.put("APIKey", new ApiKeyAuth("query", "apikey")); + authentications.put("APISecret", new ApiKeyAuth("query", "apisecret")); + authentications.put("ClientId", new ApiKeyAuth("query", "client_id")); + authentications.put("ClientSecret", new ApiKeyAuth("query", "client_secret")); + authentications.put("M2MBearerToken", new HttpBearerAuth("bearer")); + authentications.put("Digest", new ApiKeyAuth("header", "digest")); + authentications.put("XRequestExpiresTime", new ApiKeyAuth("header", "X-Request-Expires")); + authentications.put("ApiSecret", new ApiKeyAuth("query", "secret")); + authentications.put("XLoginRadiusAPISecret", new ApiKeyAuth("header", "X-LoginRadius-ApiSecret")); + authentications.put("XLoginRadiusAPIKey", new ApiKeyAuth("header", "X-LoginRadius-ApiKey")); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + /** + * Basic constructor with custom OkHttpClient + * + * @param client a {@link okhttp3.OkHttpClient} object + */ + public ApiClient(OkHttpClient client) { + init(); + + httpClient = client; + + // Setup authentications (key: authentication name, value: authentication). + authentications.put("AccessToken", new ApiKeyAuth("query", "access_token")); + authentications.put("BearerToken", new HttpBearerAuth("bearer")); + authentications.put("APIKey", new ApiKeyAuth("query", "apikey")); + authentications.put("APISecret", new ApiKeyAuth("query", "apisecret")); + authentications.put("ClientId", new ApiKeyAuth("query", "client_id")); + authentications.put("ClientSecret", new ApiKeyAuth("query", "client_secret")); + authentications.put("M2MBearerToken", new HttpBearerAuth("bearer")); + authentications.put("Digest", new ApiKeyAuth("header", "digest")); + authentications.put("XRequestExpiresTime", new ApiKeyAuth("header", "X-Request-Expires")); + authentications.put("ApiSecret", new ApiKeyAuth("query", "secret")); + authentications.put("XLoginRadiusAPISecret", new ApiKeyAuth("header", "X-LoginRadius-ApiSecret")); + authentications.put("XLoginRadiusAPIKey", new ApiKeyAuth("header", "X-LoginRadius-ApiKey")); + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + } + + private void initHttpClient() { + initHttpClient(Collections.<Interceptor>emptyList()); + } + + private void initHttpClient(List<Interceptor> interceptors) { + OkHttpClient.Builder builder = new OkHttpClient.Builder(); + builder.addNetworkInterceptor(getProgressInterceptor()); + for (Interceptor interceptor: interceptors) { + builder.addInterceptor(interceptor); + } + + httpClient = builder.build(); + } + + private void init() { + verifyingSsl = true; + + json = new JSON(); + + // Set default User-Agent. + setUserAgent("OpenAPI-Generator/1.0.0/java"); + + authentications = new HashMap<String, Authentication>(); + } + + /** + * Get base path + * + * @return Base path + */ + public String getBasePath() { + return basePath; + } + + /** + * Set base path + * + * @param basePath Base path of the URL (e.g https://api.loginradius.com + * @return An instance of OkHttpClient + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + this.serverIndex = null; + return this; + } + + public List<ServerConfiguration> getServers() { + return servers; + } + + public ApiClient setServers(List<ServerConfiguration> servers) { + this.servers = servers; + return this; + } + + public Integer getServerIndex() { + return serverIndex; + } + + public ApiClient setServerIndex(Integer serverIndex) { + this.serverIndex = serverIndex; + return this; + } + + public Map<String, String> getServerVariables() { + return serverVariables; + } + + public ApiClient setServerVariables(Map<String, String> serverVariables) { + this.serverVariables = serverVariables; + return this; + } + + /** + * Get HTTP client + * + * @return An instance of OkHttpClient + */ + public OkHttpClient getHttpClient() { + return httpClient; + } + + /** + * Set HTTP client, which must never be null. + * + * @param newHttpClient An instance of OkHttpClient + * @return Api Client + * @throws java.lang.NullPointerException when newHttpClient is null + */ + public ApiClient setHttpClient(OkHttpClient newHttpClient) { + this.httpClient = Objects.requireNonNull(newHttpClient, "HttpClient must not be null!"); + return this; + } + + /** + * Get JSON + * + * @return JSON object + */ + public JSON getJSON() { + return json; + } + + /** + * Set JSON + * + * @param json JSON object + * @return Api client + */ + public ApiClient setJSON(JSON json) { + this.json = json; + return this; + } + + /** + * True if isVerifyingSsl flag is on + * + * @return True if isVerifySsl flag is on + */ + public boolean isVerifyingSsl() { + return verifyingSsl; + } + + /** + * Configure whether to verify certificate and hostname when making https requests. + * Default to true. + * NOTE: Do NOT set to false in production code, otherwise you would face multiple types of cryptographic attacks. + * + * @param verifyingSsl True to verify TLS/SSL connection + * @return ApiClient + */ + public ApiClient setVerifyingSsl(boolean verifyingSsl) { + this.verifyingSsl = verifyingSsl; + applySslSettings(); + return this; + } + + /** + * Get SSL CA cert. + * + * @return Input stream to the SSL CA cert + */ + public InputStream getSslCaCert() { + return sslCaCert; + } + + /** + * Configure the CA certificate to be trusted when making https requests. + * Use null to reset to default. + * + * @param sslCaCert input stream for SSL CA cert + * @return ApiClient + */ + public ApiClient setSslCaCert(InputStream sslCaCert) { + this.sslCaCert = sslCaCert; + applySslSettings(); + return this; + } + + /** + * <p>Getter for the field <code>keyManagers</code>.</p> + * + * @return an array of {@link javax.net.ssl.KeyManager} objects + */ + public KeyManager[] getKeyManagers() { + return keyManagers; + } + + /** + * Configure client keys to use for authorization in an SSL session. + * Use null to reset to default. + * + * @param managers The KeyManagers to use + * @return ApiClient + */ + public ApiClient setKeyManagers(KeyManager[] managers) { + this.keyManagers = managers; + applySslSettings(); + return this; + } + + /** + * <p>Getter for the field <code>dateFormat</code>.</p> + * + * @return a {@link java.text.DateFormat} object + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + * <p>Setter for the field <code>dateFormat</code>.</p> + * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link com.loginradius.sdk.internal.openapi.ApiClient} object + */ + public ApiClient setDateFormat(DateFormat dateFormat) { + JSON.setDateFormat(dateFormat); + return this; + } + + /** + * <p>Set SqlDateFormat.</p> + * + * @param dateFormat a {@link java.text.DateFormat} object + * @return a {@link com.loginradius.sdk.internal.openapi.ApiClient} object + */ + public ApiClient setSqlDateFormat(DateFormat dateFormat) { + JSON.setSqlDateFormat(dateFormat); + return this; + } + + /** + * <p>Set OffsetDateTimeFormat.</p> + * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link com.loginradius.sdk.internal.openapi.ApiClient} object + */ + public ApiClient setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + JSON.setOffsetDateTimeFormat(dateFormat); + return this; + } + + /** + * <p>Set LocalDateFormat.</p> + * + * @param dateFormat a {@link java.time.format.DateTimeFormatter} object + * @return a {@link com.loginradius.sdk.internal.openapi.ApiClient} object + */ + public ApiClient setLocalDateFormat(DateTimeFormatter dateFormat) { + JSON.setLocalDateFormat(dateFormat); + return this; + } + + /** + * <p>Set LenientOnJson.</p> + * + * @param lenientOnJson a boolean + * @return a {@link com.loginradius.sdk.internal.openapi.ApiClient} object + */ + public ApiClient setLenientOnJson(boolean lenientOnJson) { + JSON.setLenientOnJson(lenientOnJson); + return this; + } + + /** + * Get authentications (key: authentication name, value: authentication). + * + * @return Map of authentication objects + */ + public Map<String, Authentication> getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + /** + * Helper method to set access token for the first Bearer authentication. + * @param bearerToken Bearer token + */ + public void setBearerToken(String bearerToken) { + setBearerToken(() -> bearerToken); + } + + /** + * Helper method to set the supplier of access tokens for Bearer authentication. + * + * @param tokenSupplier The supplier of bearer tokens + */ + public void setBearerToken(Supplier<String> tokenSupplier) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBearerAuth) { + ((HttpBearerAuth) auth).setBearerToken(tokenSupplier); + return; + } + } + throw new RuntimeException("No Bearer authentication configured!"); + } + + /** + * Helper method to set username for the first HTTP basic authentication. + * + * @param username Username + */ + public void setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * + * @param password Password + */ + public void setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * + * @param apiKey API key + */ + public void setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * + * @param apiKeyPrefix API key prefix + */ + public void setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set access token for the first OAuth2 authentication. + * + * @param accessToken Access token + */ + public void setAccessToken(String accessToken) { + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration(String accessKey, String secretKey, String region, String service) { + throw new RuntimeException("No AWS4 authentication configured!"); + } + + /** + * Helper method to set credentials for AWSV4 Signature + * + * @param accessKey Access Key + * @param secretKey Secret Key + * @param sessionToken Session Token + * @param region Region + * @param service Service to access to + */ + public void setAWS4Configuration(String accessKey, String secretKey, String sessionToken, String region, String service) { + throw new RuntimeException("No AWS4 authentication configured!"); + } + + /** + * Set the User-Agent header's value (by adding to the default header map). + * + * @param userAgent HTTP request's user agent + * @return ApiClient + */ + public ApiClient setUserAgent(String userAgent) { + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Add a default header. + * + * @param key The header's key + * @param value The header's value + * @return ApiClient + */ + public ApiClient addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + return this; + } + + /** + * Add a default cookie. + * + * @param key The cookie's key + * @param value The cookie's value + * @return ApiClient + */ + public ApiClient addDefaultCookie(String key, String value) { + defaultCookieMap.put(key, value); + return this; + } + + /** + * Check that whether debugging is enabled for this API client. + * + * @return True if debugging is enabled, false otherwise. + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + * @return ApiClient + */ + public ApiClient setDebugging(boolean debugging) { + if (debugging != this.debugging) { + if (debugging) { + loggingInterceptor = new HttpLoggingInterceptor(); + loggingInterceptor.setLevel(Level.BODY); + httpClient = httpClient.newBuilder().addInterceptor(loggingInterceptor).build(); + } else { + final OkHttpClient.Builder builder = httpClient.newBuilder(); + builder.interceptors().remove(loggingInterceptor); + httpClient = builder.build(); + loggingInterceptor = null; + } + } + this.debugging = debugging; + return this; + } + + /** + * The path of temporary folder used to store downloaded files from endpoints + * with file response. The default value is <code>null</code>, i.e. using + * the system's default temporary folder. + * + * @see <a href="https://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#createTempFile(java.lang.String,%20java.lang.String,%20java.nio.file.attribute.FileAttribute...)">createTempFile</a> + * @return Temporary folder path + */ + public String getTempFolderPath() { + return tempFolderPath; + } + + /** + * Set the temporary folder path (for downloading files) + * + * @param tempFolderPath Temporary folder path + * @return ApiClient + */ + public ApiClient setTempFolderPath(String tempFolderPath) { + this.tempFolderPath = tempFolderPath; + return this; + } + + /** + * Get connection timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getConnectTimeout() { + return httpClient.connectTimeoutMillis(); + } + + /** + * Sets the connect timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param connectionTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setConnectTimeout(int connectionTimeout) { + httpClient = httpClient.newBuilder().connectTimeout(connectionTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Get read timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getReadTimeout() { + return httpClient.readTimeoutMillis(); + } + + /** + * Sets the read timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param readTimeout read timeout in milliseconds + * @return Api client + */ + public ApiClient setReadTimeout(int readTimeout) { + httpClient = httpClient.newBuilder().readTimeout(readTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + /** + * Get write timeout (in milliseconds). + * + * @return Timeout in milliseconds + */ + public int getWriteTimeout() { + return httpClient.writeTimeoutMillis(); + } + + /** + * Sets the write timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link java.lang.Integer#MAX_VALUE}. + * + * @param writeTimeout connection timeout in milliseconds + * @return Api client + */ + public ApiClient setWriteTimeout(int writeTimeout) { + httpClient = httpClient.newBuilder().writeTimeout(writeTimeout, TimeUnit.MILLISECONDS).build(); + return this; + } + + + /** + * Format the given parameter object into string. + * + * @param param Parameter + * @return String representation of the parameter + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date || param instanceof OffsetDateTime || param instanceof LocalDate) { + //Serialize to json string and remove the " enclosing characters + String jsonStr = JSON.serialize(param); + return jsonStr.substring(1, jsonStr.length() - 1); + } else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for (Object o : (Collection) param) { + if (b.length() > 0) { + b.append(","); + } + b.append(o); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /** + * Formats the specified query parameter to a list containing a single {@code Pair} object. + * + * Note that {@code value} must not be a collection. + * + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list containing a single {@code Pair} object. + */ + public List<Pair> parameterToPair(String name, Object value) { + List<Pair> params = new ArrayList<Pair>(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value instanceof Collection) { + return params; + } + + params.add(new Pair(name, parameterToString(value))); + return params; + } + + /** + * Formats the specified collection query parameters to a list of {@code Pair} objects. + * + * Note that the values of each of the returned Pair objects are percent-encoded. + * + * @param collectionFormat The collection format of the parameter. + * @param name The name of the parameter. + * @param value The value of the parameter. + * @return A list of {@code Pair} objects. + */ + public List<Pair> parameterToPairs(String collectionFormat, String name, Collection value) { + List<Pair> params = new ArrayList<Pair>(); + + // preconditions + if (name == null || name.isEmpty() || value == null || value.isEmpty()) { + return params; + } + + // create the params based on the collection format + if ("multi".equals(collectionFormat)) { + for (Object item : value) { + params.add(new Pair(name, escapeString(parameterToString(item)))); + } + return params; + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + // escape all delimiters except commas, which are URI reserved + // characters + if ("ssv".equals(collectionFormat)) { + delimiter = escapeString(" "); + } else if ("tsv".equals(collectionFormat)) { + delimiter = escapeString("\t"); + } else if ("pipes".equals(collectionFormat)) { + delimiter = escapeString("|"); + } + + StringBuilder sb = new StringBuilder(); + for (Object item : value) { + sb.append(delimiter); + sb.append(escapeString(parameterToString(item))); + } + + params.add(new Pair(name, sb.substring(delimiter.length()))); + + 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<Pair> freeFormParameterToPairs(Object value) { + List<Pair> params = new ArrayList<>(); + + // preconditions + if (value == null || !(value instanceof Map )) { + return params; + } + + @SuppressWarnings("unchecked") + final Map<String, Object> valuesMap = (Map<String, Object>) value; + + for (Map.Entry<String, Object> entry : valuesMap.entrySet()) { + params.add(new Pair(entry.getKey(), parameterToString(entry.getValue()))); + } + + return params; + } + + + /** + * Formats the specified collection path parameter to a string value. + * + * @param collectionFormat The collection format of the parameter. + * @param value The value of the parameter. + * @return String representation of the parameter + */ + public String collectionPathParameterToString(String collectionFormat, Collection value) { + // create the value based on the collection format + if ("multi".equals(collectionFormat)) { + // not valid for path params + return parameterToString(value); + } + + // collectionFormat is assumed to be "csv" by default + String delimiter = ","; + + if ("ssv".equals(collectionFormat)) { + delimiter = " "; + } else if ("tsv".equals(collectionFormat)) { + delimiter = "\t"; + } else if ("pipes".equals(collectionFormat)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : value) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + return sb.substring(delimiter.length()); + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param filename The filename to be sanitized + * @return The sanitized filename + */ + public String sanitizeFilename(String filename) { + return filename.replaceAll(".*[/\\\\]", ""); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "* / *" is also default to JSON + * @param mime MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + public boolean isJsonMime(String mime) { + String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; + return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String[] accepts) { + if (accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * returns null. If it matches "any", JSON will be used. + */ + public String selectHeaderContentType(String[] contentTypes) { + if (contentTypes.length == 0) { + return null; + } + + if (contentTypes[0].equals("*/*")) { + return "application/json"; + } + + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String to be escaped + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Deserialize response body to Java object, according to the return type and + * the Content-Type response header. + * + * @param <T> Type + * @param response HTTP response + * @param returnType The type of the Java object + * @return The deserialized Java object + * @throws com.loginradius.sdk.internal.openapi.ApiException If fail to deserialize response body, i.e. cannot read response body + * or the Content-Type of the response is not supported. + */ + @SuppressWarnings("unchecked") + public <T> T deserialize(Response response, Type returnType) throws ApiException { + if (response == null || returnType == null) { + return null; + } + + if ("byte[]".equals(returnType.toString())) { + // Handle binary response (byte array). + try { + return (T) response.body().bytes(); + } catch (IOException e) { + throw new ApiException(e); + } + } else if (returnType.equals(File.class)) { + // Handle file downloading. + return (T) downloadFileFromResponse(response); + } + + String respBody; + try { + if (response.body() != null) + respBody = response.body().string(); + else + respBody = null; + } catch (IOException e) { + throw new ApiException(e); + } + + if (respBody == null || "".equals(respBody)) { + return null; + } + + String contentType = response.headers().get("Content-Type"); + if (contentType == null) { + // ensuring a default content type + contentType = "application/json"; + } + if (isJsonMime(contentType)) { + return JSON.deserialize(respBody, returnType); + } else if (returnType.equals(String.class)) { + // Expecting string, return the raw response body. + return (T) respBody; + } else { + throw new ApiException( + "Content type \"" + contentType + "\" is not supported for type: " + returnType, + response.code(), + response.headers().toMultimap(), + respBody); + } + } + + /** + * Serialize the given Java object into request body according to the object's + * class and the request Content-Type. + * + * @param obj The Java object + * @param contentType The request Content-Type + * @return The serialized request body + * @throws com.loginradius.sdk.internal.openapi.ApiException If fail to serialize the given object + */ + public RequestBody serialize(Object obj, String contentType) throws ApiException { + if (obj instanceof byte[]) { + // Binary (byte array) body parameter support. + return RequestBody.create((byte[]) obj, MediaType.parse(contentType)); + } else if (obj instanceof File) { + // File body parameter support. + return RequestBody.create((File) obj, MediaType.parse(contentType)); + } else if ("text/plain".equals(contentType) && obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); + } else if (isJsonMime(contentType)) { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + return RequestBody.create(content, MediaType.parse(contentType)); + } else if (obj instanceof String) { + return RequestBody.create((String) obj, MediaType.parse(contentType)); + } else { + throw new ApiException("Content type \"" + contentType + "\" is not supported"); + } + } + + /** + * Download file from the given response. + * + * @param response An instance of the Response object + * @throws com.loginradius.sdk.internal.openapi.ApiException If fail to read file content from response and write to disk + * @return Downloaded file + */ + public File downloadFileFromResponse(Response response) throws ApiException { + try { + File file = prepareDownloadFile(response); + BufferedSink sink = Okio.buffer(Okio.sink(file)); + sink.writeAll(response.body().source()); + sink.close(); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * Prepare file for download + * + * @param response An instance of the Response object + * @return Prepared file for the download + * @throws java.io.IOException If fail to prepare file for download + */ + public File prepareDownloadFile(Response response) throws IOException { + String filename = null; + String contentDisposition = response.header("Content-Disposition"); + if (contentDisposition != null && !"".equals(contentDisposition)) { + // Get filename from the Content-Disposition header. + Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + Matcher matcher = pattern.matcher(contentDisposition); + if (matcher.find()) { + filename = sanitizeFilename(matcher.group(1)); + } + } + + String prefix = null; + String suffix = null; + if (filename == null) { + prefix = "download-"; + suffix = ""; + } else { + int pos = filename.lastIndexOf("."); + if (pos == -1) { + prefix = filename + "-"; + } else { + prefix = filename.substring(0, pos) + "-"; + suffix = filename.substring(pos); + } + // Files.createTempFile requires the prefix to be at least three characters long + if (prefix.length() < 3) + prefix = "download-"; + } + + if (tempFolderPath == null) + return Files.createTempFile(prefix, suffix).toFile(); + else + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); + } + + /** + * {@link #execute(Call, Type)} + * + * @param <T> Type + * @param call An instance of the Call object + * @return ApiResponse<T> + * @throws com.loginradius.sdk.internal.openapi.ApiException If fail to execute the call + */ + public <T> ApiResponse<T> execute(Call call) throws ApiException { + return execute(call, null); + } + + /** + * Execute HTTP call and deserialize the HTTP response body into the given return type. + * + * @param returnType The return type used to deserialize HTTP response body + * @param <T> The return type corresponding to (same with) returnType + * @param call Call + * @return ApiResponse object containing response status, headers and + * data, which is a Java object deserialized from response body and would be null + * when returnType is null. + * @throws com.loginradius.sdk.internal.openapi.ApiException If fail to execute the call + */ + public <T> ApiResponse<T> execute(Call call, Type returnType) throws ApiException { + try { + Response response = call.execute(); + T data = handleResponse(response, returnType); + return new ApiResponse<T>(response.code(), response.headers().toMultimap(), data); + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + * {@link #executeAsync(Call, Type, ApiCallback)} + * + * @param <T> Type + * @param call An instance of the Call object + * @param callback ApiCallback<T> + */ + public <T> void executeAsync(Call call, ApiCallback<T> callback) { + executeAsync(call, null, callback); + } + + /** + * Execute HTTP call asynchronously. + * + * @param <T> Type + * @param call The callback to be executed when the API call finishes + * @param returnType Return type + * @param callback ApiCallback + * @see #execute(Call, Type) + */ + @SuppressWarnings("unchecked") + public <T> void executeAsync(Call call, final Type returnType, final ApiCallback<T> callback) { + call.enqueue(new Callback() { + @Override + public void onFailure(Call call, IOException e) { + callback.onFailure(new ApiException(e), 0, null); + } + + @Override + public void onResponse(Call call, Response response) throws IOException { + T result; + try { + result = (T) handleResponse(response, returnType); + } catch (ApiException e) { + callback.onFailure(e, response.code(), response.headers().toMultimap()); + return; + } catch (Exception e) { + callback.onFailure(new ApiException(e), response.code(), response.headers().toMultimap()); + return; + } + callback.onSuccess(result, response.code(), response.headers().toMultimap()); + } + }); + } + + /** + * Handle the given response, return the deserialized object when the response is successful. + * + * @param <T> Type + * @param response Response + * @param returnType Return type + * @return Type + * @throws com.loginradius.sdk.internal.openapi.ApiException If the response has an unsuccessful status code or + * fail to deserialize the response body + */ + public <T> T handleResponse(Response response, Type returnType) throws ApiException { + if (response.isSuccessful()) { + if (returnType == null || response.code() == 204) { + // returning null if the returnType is not defined, + // or the status code is 204 (No Content) + if (response.body() != null) { + try { + response.body().close(); + } catch (Exception e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + return null; + } else { + return deserialize(response, returnType); + } + } else { + String respBody = null; + if (response.body() != null) { + try { + respBody = response.body().string(); + } catch (IOException e) { + throw new ApiException(response.message(), e, response.code(), response.headers().toMultimap()); + } + } + throw new ApiException(response.message(), response.code(), response.headers().toMultimap(), respBody); + } + } + + /** + * Build HTTP call with the given options. + * + * @param baseUrl The base URL + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP call + * @throws com.loginradius.sdk.internal.openapi.ApiException If fail to serialize the request body object + */ + public Call buildCall(String baseUrl, String path, String method, List<Pair> queryParams, List<Pair> collectionQueryParams, Object body, Map<String, String> headerParams, Map<String, String> cookieParams, Map<String, Object> formParams, String[] authNames, ApiCallback callback) throws ApiException { + Request request = buildRequest(baseUrl, path, method, queryParams, collectionQueryParams, body, headerParams, cookieParams, formParams, authNames, callback); + + return httpClient.newCall(request); + } + + /** + * Build an HTTP request with the given options. + * + * @param baseUrl The base URL + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE" + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param authNames The authentications to apply + * @param callback Callback for upload/download progress + * @return The HTTP request + * @throws com.loginradius.sdk.internal.openapi.ApiException If fail to serialize the request body object + */ + public Request buildRequest(String baseUrl, String path, String method, List<Pair> queryParams, List<Pair> collectionQueryParams, Object body, Map<String, String> headerParams, Map<String, String> cookieParams, Map<String, Object> formParams, String[] authNames, ApiCallback callback) throws ApiException { + final String url = buildUrl(baseUrl, path, queryParams, collectionQueryParams); + + // prepare HTTP request body + RequestBody reqBody; + String contentType = headerParams.get("Content-Type"); + String contentTypePure = contentType; + if (contentTypePure != null && contentTypePure.contains(";")) { + contentTypePure = contentType.substring(0, contentType.indexOf(";")); + } + if (!HttpMethod.permitsRequestBody(method)) { + reqBody = null; + } else if ("application/x-www-form-urlencoded".equals(contentTypePure)) { + reqBody = buildRequestBodyFormEncoding(formParams); + } else if ("multipart/form-data".equals(contentTypePure)) { + reqBody = buildRequestBodyMultipart(formParams); + } else if (body == null) { + if ("DELETE".equals(method)) { + // allow calling DELETE without sending a request body + reqBody = null; + } else { + // use an empty request body (for POST, PUT and PATCH) + reqBody = RequestBody.create("", contentType == null ? null : MediaType.parse(contentType)); + } + } else { + reqBody = serialize(body, contentType); + } + + List<Pair> updatedQueryParams = new ArrayList<>(queryParams); + + // update parameters with authentication settings + updateParamsForAuth(authNames, updatedQueryParams, headerParams, cookieParams, requestBodyToString(reqBody), method, URI.create(url)); + + final Request.Builder reqBuilder = new Request.Builder().url(buildUrl(baseUrl, path, updatedQueryParams, collectionQueryParams)); + processHeaderParams(headerParams, reqBuilder); + processCookieParams(cookieParams, reqBuilder); + + // Associate callback with request (if not null) so interceptor can + // access it when creating ProgressResponseBody + reqBuilder.tag(callback); + + Request request = null; + + if (callback != null && reqBody != null) { + ProgressRequestBody progressRequestBody = new ProgressRequestBody(reqBody, callback); + request = reqBuilder.method(method, progressRequestBody).build(); + } else { + request = reqBuilder.method(method, reqBody).build(); + } + + return request; + } + + /** + * Build full URL by concatenating base path, the given sub path and query parameters. + * + * @param baseUrl The base URL + * @param path The sub path + * @param queryParams The query parameters + * @param collectionQueryParams The collection query parameters + * @return The full URL + */ + + /** + * Substitutes {@code {variable}} placeholders in an operation-level base + * path from {@link #getServerVariables()}. + * + * <p>The generator inlines the spec's pinned server template into each + * operation and then uses it verbatim, so without this the SDK would issue + * requests against a host that still had the braces in it. Placeholders + * with no configured value are left alone rather than blanked, so the + * resulting URL still names the variable that was not set. + * + * <p>Added by the LoginRadius SDK generator, not by openapi-generator. + */ + protected String resolveServerVariables(String baseUrl) { + if (baseUrl == null || baseUrl.indexOf('{') < 0 || serverVariables == null) { + return baseUrl; + } + String resolved = baseUrl; + for (java.util.Map.Entry<String, String> e : serverVariables.entrySet()) { + if (e.getValue() == null || e.getValue().isEmpty()) { + continue; + } + resolved = resolved.replace("{" + e.getKey() + "}", e.getValue()); + } + return resolved; + } + + public String buildUrl(String baseUrl, String path, List<Pair> queryParams, List<Pair> collectionQueryParams) { + final StringBuilder url = new StringBuilder(); + if (baseUrl != null) { + url.append(resolveServerVariables(baseUrl)).append(path); + } else { + String baseURL; + if (serverIndex != null) { + if (serverIndex < 0 || serverIndex >= servers.size()) { + throw new ArrayIndexOutOfBoundsException(String.format( + "Invalid index %d when selecting the host settings. Must be less than %d", serverIndex, servers.size() + )); + } + baseURL = servers.get(serverIndex).URL(serverVariables); + } else { + baseURL = basePath; + } + url.append(baseURL).append(path); + } + + if (queryParams != null && !queryParams.isEmpty()) { + // support (constant) query string in `path`, e.g. "/posts?draft=1" + String prefix = path.contains("?") ? "&" : "?"; + for (Pair param : queryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + url.append(escapeString(param.getName())).append("=").append(escapeString(value)); + } + } + } + + if (collectionQueryParams != null && !collectionQueryParams.isEmpty()) { + String prefix = url.toString().contains("?") ? "&" : "?"; + for (Pair param : collectionQueryParams) { + if (param.getValue() != null) { + if (prefix != null) { + url.append(prefix); + prefix = null; + } else { + url.append("&"); + } + String value = parameterToString(param.getValue()); + // collection query parameter value already escaped as part of parameterToPairs + url.append(escapeString(param.getName())).append("=").append(value); + } + } + } + + return url.toString(); + } + + /** + * Set header parameters to the request builder, including default headers. + * + * @param headerParams Header parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processHeaderParams(Map<String, String> headerParams, Request.Builder reqBuilder) { + for (Entry<String, String> param : headerParams.entrySet()) { + reqBuilder.header(param.getKey(), parameterToString(param.getValue())); + } + for (Entry<String, String> header : defaultHeaderMap.entrySet()) { + if (!headerParams.containsKey(header.getKey())) { + reqBuilder.header(header.getKey(), parameterToString(header.getValue())); + } + } + } + + /** + * Set cookie parameters to the request builder, including default cookies. + * + * @param cookieParams Cookie parameters in the form of Map + * @param reqBuilder Request.Builder + */ + public void processCookieParams(Map<String, String> cookieParams, Request.Builder reqBuilder) { + for (Entry<String, String> param : cookieParams.entrySet()) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + for (Entry<String, String> param : defaultCookieMap.entrySet()) { + if (!cookieParams.containsKey(param.getKey())) { + reqBuilder.addHeader("Cookie", String.format("%s=%s", param.getKey(), param.getValue())); + } + } + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws com.loginradius.sdk.internal.openapi.ApiException If fails to update the parameters + */ + public void updateParamsForAuth(String[] authNames, List<Pair> queryParams, Map<String, String> headerParams, + Map<String, String> cookieParams, String payload, String method, URI uri) throws ApiException { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) { + throw new RuntimeException("Authentication undefined: " + authName); + } + auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); + } + } + + /** + * Build a form-encoding request body with the given form parameters. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyFormEncoding(Map<String, Object> formParams) { + okhttp3.FormBody.Builder formBuilder = new okhttp3.FormBody.Builder(); + for (Entry<String, Object> param : formParams.entrySet()) { + formBuilder.add(param.getKey(), parameterToString(param.getValue())); + } + return formBuilder.build(); + } + + /** + * Build a multipart (file uploading) request body with the given form parameters, + * which could contain text fields and file fields. + * + * @param formParams Form parameters in the form of Map + * @return RequestBody + */ + public RequestBody buildRequestBodyMultipart(Map<String, Object> formParams) { + MultipartBody.Builder mpBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM); + for (Entry<String, Object> param : formParams.entrySet()) { + if (param.getValue() instanceof File) { + File file = (File) param.getValue(); + addPartToMultiPartBuilder(mpBuilder, param.getKey(), file); + } else if (param.getValue() instanceof List) { + List list = (List) param.getValue(); + for (Object item: list) { + if (item instanceof File) { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), (File) item); + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } + } + } else { + addPartToMultiPartBuilder(mpBuilder, param.getKey(), param.getValue()); + } + } + return mpBuilder.build(); + } + + /** + * Guess Content-Type header from the given file (defaults to "application/octet-stream"). + * + * @param file The given file + * @return The guessed Content-Type + */ + public String guessContentTypeFromFile(File file) { + String contentType = URLConnection.guessContentTypeFromName(file.getName()); + if (contentType == null) { + return "application/octet-stream"; + } else { + return contentType; + } + } + + /** + * Add a Content-Disposition Header for the given key and file to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param file The file to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, File file) { + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\"; filename=\"" + file.getName() + "\""); + MediaType mediaType = MediaType.parse(guessContentTypeFromFile(file)); + mpBuilder.addPart(partHeaders, RequestBody.create(file, mediaType)); + } + + /** + * Add a Content-Disposition Header for the given key and complex object to the MultipartBody Builder. + * + * @param mpBuilder MultipartBody.Builder + * @param key The key of the Header element + * @param obj The complex object to add to the Header + */ + private void addPartToMultiPartBuilder(MultipartBody.Builder mpBuilder, String key, Object obj) { + RequestBody requestBody; + if (obj instanceof String) { + requestBody = RequestBody.create((String) obj, MediaType.parse("text/plain")); + } else { + String content; + if (obj != null) { + content = JSON.serialize(obj); + } else { + content = null; + } + requestBody = RequestBody.create(content, MediaType.parse("application/json")); + } + + Headers partHeaders = Headers.of("Content-Disposition", "form-data; name=\"" + key + "\""); + mpBuilder.addPart(partHeaders, requestBody); + } + + /** + * Get network interceptor to add it to the httpClient to track download progress for + * async requests. + */ + private Interceptor getProgressInterceptor() { + return new Interceptor() { + @Override + public Response intercept(Interceptor.Chain chain) throws IOException { + final Request request = chain.request(); + final Response originalResponse = chain.proceed(request); + if (request.tag() instanceof ApiCallback) { + final ApiCallback callback = (ApiCallback) request.tag(); + return originalResponse.newBuilder() + .body(new ProgressResponseBody(originalResponse.body(), callback)) + .build(); + } + return originalResponse; + } + }; + } + + /** + * Apply SSL related settings to httpClient according to the current values of + * verifyingSsl and sslCaCert. + */ + private void applySslSettings() { + try { + TrustManager[] trustManagers; + HostnameVerifier hostnameVerifier; + if (!verifyingSsl) { + trustManagers = new TrustManager[]{ + new X509TrustManager() { + @Override + public void checkClientTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public void checkServerTrusted(java.security.cert.X509Certificate[] chain, String authType) throws CertificateException { + } + + @Override + public java.security.cert.X509Certificate[] getAcceptedIssuers() { + return new java.security.cert.X509Certificate[]{}; + } + } + }; + hostnameVerifier = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + } else { + TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + + if (sslCaCert == null) { + trustManagerFactory.init((KeyStore) null); + } else { + char[] password = null; // Any password will work. + CertificateFactory certificateFactory = CertificateFactory.getInstance("X.509"); + Collection<? extends Certificate> certificates = certificateFactory.generateCertificates(sslCaCert); + if (certificates.isEmpty()) { + throw new IllegalArgumentException("expected non-empty set of trusted certificates"); + } + KeyStore caKeyStore = newEmptyKeyStore(password); + int index = 0; + for (Certificate certificate : certificates) { + String certificateAlias = "ca" + (index++); + caKeyStore.setCertificateEntry(certificateAlias, certificate); + } + trustManagerFactory.init(caKeyStore); + } + trustManagers = trustManagerFactory.getTrustManagers(); + hostnameVerifier = OkHostnameVerifier.INSTANCE; + } + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(keyManagers, trustManagers, new SecureRandom()); + httpClient = httpClient.newBuilder() + .sslSocketFactory(sslContext.getSocketFactory(), (X509TrustManager) trustManagers[0]) + .hostnameVerifier(hostnameVerifier) + .build(); + } catch (GeneralSecurityException e) { + throw new RuntimeException(e); + } + } + + private KeyStore newEmptyKeyStore(char[] password) throws GeneralSecurityException { + try { + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + keyStore.load(null, password); + return keyStore; + } catch (IOException e) { + throw new AssertionError(e); + } + } + + /** + * Convert the HTTP request body to a string. + * + * @param requestBody The HTTP request object + * @return The string representation of the HTTP request body + * @throws com.loginradius.sdk.internal.openapi.ApiException If fail to serialize the request body object into a string + */ + private String requestBodyToString(RequestBody requestBody) throws ApiException { + if (requestBody != null) { + try { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return buffer.readUtf8(); + } catch (final IOException e) { + throw new ApiException(e); + } + } + + // empty http request body + return ""; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/ApiException.java b/src/main/java/com/loginradius/sdk/internal/openapi/ApiException.java new file mode 100644 index 0000000..94ec0c9 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/ApiException.java @@ -0,0 +1,167 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi; + +import java.util.Map; +import java.util.List; + + +/** + * <p>ApiException class.</p> + */ +@SuppressWarnings("serial") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ApiException extends Exception { + private static final long serialVersionUID = 1L; + + private int code = 0; + private Map<String, List<String>> responseHeaders = null; + private String responseBody = null; + + /** + * <p>Constructor for ApiException.</p> + */ + public ApiException() {} + + /** + * <p>Constructor for ApiException.</p> + * + * @param throwable a {@link java.lang.Throwable} object + */ + public ApiException(Throwable throwable) { + super(throwable); + } + + /** + * <p>Constructor for ApiException.</p> + * + * @param message the error message + */ + public ApiException(String message) { + super(message); + } + + /** + * <p>Constructor for ApiException.</p> + * + * @param message the error message + * @param throwable a {@link java.lang.Throwable} object + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(String message, Throwable throwable, int code, Map<String, List<String>> responseHeaders, String responseBody) { + super(message, throwable); + this.code = code; + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * <p>Constructor for ApiException.</p> + * + * @param message the error message + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(String message, int code, Map<String, List<String>> responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + /** + * <p>Constructor for ApiException.</p> + * + * @param message the error message + * @param throwable a {@link java.lang.Throwable} object + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + */ + public ApiException(String message, Throwable throwable, int code, Map<String, List<String>> responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + /** + * <p>Constructor for ApiException.</p> + * + * @param code HTTP status code + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, Map<String, List<String>> responseHeaders, String responseBody) { + this("Response Code: " + code + " Response Body: " + responseBody, (Throwable) null, code, responseHeaders, responseBody); + } + + /** + * <p>Constructor for ApiException.</p> + * + * @param code HTTP status code + * @param message a {@link java.lang.String} object + */ + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + /** + * <p>Constructor for ApiException.</p> + * + * @param code HTTP status code + * @param message the error message + * @param responseHeaders a {@link java.util.Map} of HTTP response headers + * @param responseBody the response body + */ + public ApiException(int code, String message, Map<String, List<String>> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map<String, List<String>> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } + + /** + * Get the exception message including HTTP response data. + * + * @return The exception message + */ + public String getMessage() { + return String.format("Message: %s%nHTTP response code: %s%nHTTP response body: %s%nHTTP response headers: %s", + super.getMessage(), this.getCode(), this.getResponseBody(), this.getResponseHeaders()); + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/ApiResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/ApiResponse.java new file mode 100644 index 0000000..65bfd33 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/ApiResponse.java @@ -0,0 +1,76 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi; + +import java.util.List; +import java.util.Map; + +/** + * API response returned by API call. + */ +public class ApiResponse<T> { + final private int statusCode; + final private Map<String, List<String>> headers; + final private T data; + + /** + * <p>Constructor for ApiResponse.</p> + * + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map<String, List<String>> headers) { + this(statusCode, headers, null); + } + + /** + * <p>Constructor for ApiResponse.</p> + * + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map<String, List<String>> headers, T data) { + this.statusCode = statusCode; + this.headers = headers; + this.data = data; + } + + /** + * <p>Get the <code>status code</code>.</p> + * + * @return the status code + */ + public int getStatusCode() { + return statusCode; + } + + /** + * <p>Get the <code>headers</code>.</p> + * + * @return a {@link java.util.Map} of headers + */ + public Map<String, List<String>> getHeaders() { + return headers; + } + + /** + * <p>Get the <code>data</code>.</p> + * + * @return the data + */ + public T getData() { + return data; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/Configuration.java b/src/main/java/com/loginradius/sdk/internal/openapi/Configuration.java new file mode 100644 index 0000000..db2e056 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/Configuration.java @@ -0,0 +1,41 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class Configuration { + public static final String VERSION = "1.0.0"; + + private static ApiClient defaultApiClient = new ApiClient(); + + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + return defaultApiClient; + } + + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient = apiClient; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/GzipRequestInterceptor.java b/src/main/java/com/loginradius/sdk/internal/openapi/GzipRequestInterceptor.java new file mode 100644 index 0000000..6c95756 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/GzipRequestInterceptor.java @@ -0,0 +1,85 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi; + +import okhttp3.*; +import okio.Buffer; +import okio.BufferedSink; +import okio.GzipSink; +import okio.Okio; + +import java.io.IOException; + +/** + * Encodes request bodies using gzip. + * + * Taken from https://github.com/square/okhttp/issues/350 + */ +class GzipRequestInterceptor implements Interceptor { + @Override + public Response intercept(Chain chain) throws IOException { + Request originalRequest = chain.request(); + if (originalRequest.body() == null || originalRequest.header("Content-Encoding") != null) { + return chain.proceed(originalRequest); + } + + Request compressedRequest = originalRequest.newBuilder() + .header("Content-Encoding", "gzip") + .method(originalRequest.method(), forceContentLength(gzip(originalRequest.body()))) + .build(); + return chain.proceed(compressedRequest); + } + + private RequestBody forceContentLength(final RequestBody requestBody) throws IOException { + final Buffer buffer = new Buffer(); + requestBody.writeTo(buffer); + return new RequestBody() { + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() { + return buffer.size(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + sink.write(buffer.snapshot()); + } + }; + } + + private RequestBody gzip(final RequestBody body) { + return new RequestBody() { + @Override + public MediaType contentType() { + return body.contentType(); + } + + @Override + public long contentLength() { + return -1; // We don't know the compressed length in advance! + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink gzipSink = Okio.buffer(new GzipSink(sink)); + body.writeTo(gzipSink); + gzipSink.close(); + } + }; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/JSON.java b/src/main/java/com/loginradius/sdk/internal/openapi/JSON.java new file mode 100644 index 0000000..391709f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/JSON.java @@ -0,0 +1,1248 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.internal.bind.util.ISO8601Utils; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; +import com.google.gson.JsonElement; +import io.gsonfire.GsonFireBuilder; +import io.gsonfire.TypeSelector; + +import okio.ByteString; + +import java.io.IOException; +import java.io.StringReader; +import java.lang.reflect.Type; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.ParsePosition; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.HashMap; + +/* + * A JSON utility class + * + * NOTE: in the future, this class may be converted to static, which may break + * backward-compatibility + */ +public class JSON { + private static Gson gson; + private static boolean isLenientOnJson = false; + private static DateTypeAdapter dateTypeAdapter = new DateTypeAdapter(); + private static SqlDateTypeAdapter sqlDateTypeAdapter = new SqlDateTypeAdapter(); + private static OffsetDateTimeTypeAdapter offsetDateTimeTypeAdapter = new OffsetDateTimeTypeAdapter(); + private static LocalDateTypeAdapter localDateTypeAdapter = new LocalDateTypeAdapter(); + private static ByteArrayAdapter byteArrayAdapter = new ByteArrayAdapter(); + + @SuppressWarnings("unchecked") + public static GsonBuilder createGson() { + GsonFireBuilder fireBuilder = new GsonFireBuilder() + ; + GsonBuilder builder = fireBuilder.createGsonBuilder(); + return builder; + } + + private static String getDiscriminatorValue(JsonElement readElement, String discriminatorField) { + JsonElement element = readElement.getAsJsonObject().get(discriminatorField); + if (null == element) { + throw new IllegalArgumentException("missing discriminator field: <" + discriminatorField + ">"); + } + return element.getAsString(); + } + + /** + * Returns the Java class that implements the OpenAPI schema for the specified discriminator value. + * + * @param classByDiscriminatorValue The map of discriminator values to Java classes. + * @param discriminatorValue The value of the OpenAPI discriminator in the input data. + * @return The Java class that implements the OpenAPI schema + */ + private static Class getClassByDiscriminator(Map classByDiscriminatorValue, String discriminatorValue) { + Class clazz = (Class) classByDiscriminatorValue.get(discriminatorValue); + if (null == clazz) { + throw new IllegalArgumentException("cannot determine model class of name: <" + discriminatorValue + ">"); + } + return clazz; + } + + static { + GsonBuilder gsonBuilder = createGson(); + gsonBuilder.registerTypeAdapter(Date.class, dateTypeAdapter); + gsonBuilder.registerTypeAdapter(java.sql.Date.class, sqlDateTypeAdapter); + gsonBuilder.registerTypeAdapter(OffsetDateTime.class, offsetDateTimeTypeAdapter); + gsonBuilder.registerTypeAdapter(LocalDate.class, localDateTypeAdapter); + gsonBuilder.registerTypeAdapter(byte[].class, byteArrayAdapter); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.AWSPushConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.AccessToken.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.AccessTokenByPingQRCodeResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.AccessTokenInBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.AccessTokenInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.AccessTokenResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.AccessTokenSessionToken.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.AccountRegisterMFAPasskeyFinishRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ActiveSession.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ActiveSessionResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.AddEmailModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.AddEmailModelManage.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.AddOrganizationDomainRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.AddPhoneModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.AddWorkflowConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.Aggregation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.AggregationObj.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.AggregationObjInterval.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.AndroidPushConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ApiError.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.AppProvider.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.AppleSecretConfiguration.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.AuthResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.AuthResponseEmailVerification.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.AuthResponseEmailVerificationData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.AuthResponseForgotReset.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.AuthResponseOptionalMfa.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.AuthResponseRequiredMfa.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.AuthResponseRequiredMfaCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.AuthResponseWithoutIdentites.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.AuthenticatorCodeRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.BasicAuthWebhook.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.BatchUpload.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.BatchUploadErrorResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.BatchUploadErrorResponseErrorsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.BatchUploadResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.Bearertoken.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.BeginMFAPasskeyRegistration200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.BeginPasskeyLogin200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.BeginPasskeyLogin200ResponseLoginBeginCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.BeginPasskeyMFAVerification200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.BeginPasskeyMFAVerification200ResponseLoginBeginCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.BeginPasskeyRegistration200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.BeginPasskeyRegistration200ResponseRegisterBeginCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.BeginPasskeyReset200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.BigCommerceLoginUrlResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.BigCommerceTokenPostRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.BigCommerceValidatePasswordRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.BigCommerceValidatePasswordResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.BulkInsertErrorReport.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.BulkInsertReport.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.CandidateTokenModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.CaptchaConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.CaptchaKeys.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.CaptchaModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.CertificateWithoutKey.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.Certificates.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ChangePassword.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ChangePasswordCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ChangePin.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ChangePinCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.CheckEmailAvailability200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.CheckUserNameAvailability200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ClientGuidBodyModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ConnectionGroupRoleRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ConnectionGroupRoleResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ConnectionGroupRoleResponseCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ConnectionResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ConnectionResponseCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ConnectionResponseVariant.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ConnectionStatusRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ConnectionStatusResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ConsentData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ConsentEvent.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ConsentForm.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ConsentFormEvent.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ConsentFormModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ConsentFormOption.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ConsentFormOptions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ConsentLog.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ConsentLogsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ConsentOption.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ConsentOptionModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ConsentOptions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ConsentProfile.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ConsentProfileLog.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ConsentResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ConsentSubmit.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ConsentUpdate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ConsentVersion.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.CreateConnectionGroupRoleRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.CreateJwtIntegrationRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.CreateJwtSPClientConfigurationRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.CreateOAuthClientConfigurationRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.CreateOAuthIntegrationRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.CreateOrganizationRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.CreateSamlIntegrationRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.CredentialObj.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.CustomFieldLimitResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.CustomOAuth2DeleteModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.CustomOAuth2Model.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.CustomOAuth2UpdateModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.CustomObjectResponseModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.CustomObjectsResponseModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.CustomProviderKeys.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.DefaultResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.DeleteEmailRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.DeleteEmailTemplate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.DeleteResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.DeleteSmsTemplateModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.DeleteUserModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.DeleteemailbyaccesstokenRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.DeltaMigrationModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.DomainAccessRestrictions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.DuoSecurityAuthenticator.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.DuoVerifyRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.DynamicClientRegistrationRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.DynamicClientRegistrationResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.Email.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.EmailByLoginUserNamePhone200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.EmailByLoginUserNamePhoneRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.EmailModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.EmailModelManage.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.EmailOTPStatus.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.EmailTemplateModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.EmailTemplateResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.EmailToValidateServerSide.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.EmailUserNameModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.EmailVerificationOrForgotPINModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ErrorResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ErrorResponseNative.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.EventBasedSecondFactorToken.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ExtendUserProfileWithCustomObject.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ExtendUserProfileWithCustomObjectCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.FinishMFAPasskeyRegistrationRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.FinishPasskeyMFAVerificationRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ForgotPasswordOrPasswordLessLoginOrAutoLoginModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ForgotPasswordPhoneModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ForgotPasswordRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ForgotPasswordTokenAndEmailRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ForgotPasswordTokenModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ForgotPinByEmail.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ForgotPinByPhone.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ForgotPinByUsername.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GenerateSottResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GenerateTokenResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GenericSecondFactorAuthentication.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GetAllConnectionGroupRoles200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GetAllCustomFields200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GetAllCustomOAuthProviders200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GetAllJwtConfigSPConfigurations200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GetAllJwtIntegrations200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GetAllOAuthClientsConfigurations200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GetAllOAuthIntegrations200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GetAllOrganizationConnections200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GetAllOrganizationDomains200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GetAllOrganizations200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GetAllProviderConfigurations200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GetAllSAMLSPClientConfigurations200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GetAllSOTT200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GetAllSamlIntegrations200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GetAllTenantRoles200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GetAllWorkflows200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GetConsentForms200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GetConsentOptions200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GetCustomProviderKeys200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GetEmailTemplates200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GetInvitationsByOrgId200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GetJWTTokenByLoginCredentialsRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GetJwtIntegrationSupportedAlgoList200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GetOAuthClientConnectionsMetadata200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GetOAuthTokensRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GetOrgContextByUid200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GetSamlSPClientMappingKeys200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GetSecurityQuestions200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GetSmsTemplates200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GoogleAuthenticator.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GoogleRecaptchaV3.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.GoogleRecaptchaV3Core.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.HCaptcha.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.HCaptchaCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.IOSPushConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.IPAccessRestrictions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.IdentitiesResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.Identity.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.IdentityPasskeyLogin.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.IdentityProvider.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.IdentityQuery.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.IdentityResponseWithSocialWithoutLogins.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.IdentityResponseWithSocialWithoutLoginsCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.InsightsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.Invitation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.InvitationToken.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.IsDeleteRequestAccepted.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.IsDeleted.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.IsDeletedResponseWithCount.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.IsExist.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.IsPostedResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.IsPostedVerified.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.IsRegistered.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.IsValid.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.JWKSResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.JWKSResponseKeysInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.JWTSignature.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.JwtAudienceValidation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.JwtClaimAudienceProperty.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.JwtClaimMandatory.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.JwtClaimSubjectProperty.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.JwtIntegrationBaseModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.JwtIntegrationCreateCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.JwtIntegrationRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.JwtIntegrationRequestCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.JwtIntegrationResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.JwtIntegrationResponseCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.JwtIssuerValidation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.JwtSpConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.JwtSpConfigBaseModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.JwtSpConfigCreateCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.JwtValidation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.LoginByEmail.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.LoginByEmailRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.LoginByEmailRequestCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.LoginByPhone.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.LoginByPhoneCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.LoginByUserName.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.LoginByUsernameRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.LoginByUsernameRequestCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.MFABackUpCodeResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.MFAPhoneUpdateModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.MFASettings.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.MFAVerifyPhoneOtpModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.MFAVerifyPhoneOtpModelCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelAddressesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelAgeRange.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelBadgesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelBooksInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelCertificationsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelConsents.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelConsentsDataInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelConsentsEventsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelCountry.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelCoursesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelEducationsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelEmailInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelFamilyInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelFavoriteThingsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelGamesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelJobBookmarksInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelJobBookmarksInnerJob.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelLanguagesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelMemberUrlResourcesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelMoviesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelMutualFriendsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelPINInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelPatentsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelPlacesLivedInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelPositionsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelPrivacyPolicy.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelProjectsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelProviderAccessCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelPublicationsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelPublicationsInnerAuthorsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelRecommendationsReceivedInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelRelatedProfileViewsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelSubscription.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelSuggestions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelSuggestionsCompaniesToFollowInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelSuggestionsIndustriesToFollowInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelSuggestionsNewssourceToFollowInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelSuggestionsPeopleToFollowInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelTelevisionShowInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ManageRegisterModelVolunteerInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.MultipurposeEmailTokenAPIRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.MultipurposeSmsOtpAPIRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuth2Provider.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthAuthorizationCodeFlow.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthAuthorizationCodePKCEFlow.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthAuthorizationServerMetadata.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthClientCreateCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthClientRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthClientRequestBackChannelLogout.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthClientRequestConnections.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthClientRequestConnectionsCustomIdpInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthClientRequestDeviceCodeConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthClientRequestJwtTokenConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthClientResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthClientResponseBackChannelLogout.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthClientResponseBackChannelLogoutLogoutInitiator.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthClientResponseConnections.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthClientResponseDeviceCodeConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthClientResponseJwtTokenConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthClientResponseRefreshTokenRotation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthClientSecretResetResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthDeviceCode.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthDeviceCodeFlow.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthDeviceCodeResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthDynamicClientRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthDynamicClientResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthDynamicClientResponseCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthErrorResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthIntegrationBaseModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthIntegrationBaseModelConnections.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthIntegrationBaseModelConnectionsCustomIdpInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthIntegrationBaseModelConnectionsEnterpriseInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthIntegrationBaseModelConnectionsPasswordLessLogin.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthIntegrationBaseModelConnectionsSocialLoginsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthIntegrationCreateCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthIntegrationCredentialsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthIntegrationResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthIntegrationResponseCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthLoginRadiusTokenExchangeFlow.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthM2MIntrospectResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthM2MTokenGenerate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthM2MTokenIntrospect.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthM2MTokenResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthM2MTokenRevoke.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthPasswordCredentialFlow.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthRefreshTokenFlow.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthRevokeRefreshToken.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OAuthTokenResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OIDCConnectionCreateRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OIDCDeviceCode.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OIDCDeviceCodeResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OIDCDiscoveryResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OIDCTokenIntrospectResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OIDCTokenResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OIDCUserinfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OidcConnectionBase.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OidcConnectionRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OidcConnectionRequestCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OidcConnectionResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OidcConnectionResponseCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OneTouchLoginByEmail.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OneTouchLoginByPhone.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OneTouchLoginPhoneModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OrganizationBase.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OrganizationBaseDisplay.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OrganizationConnectionCreateRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OrganizationConnectionRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OrganizationDomainRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OrganizationUpdateRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OrganizationsConnectionBase.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OrganizationsConnectionBaseAttributes.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OrganizationsConnectionSamlBase.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OrganizationsConnectionSamlBaseIDPCertificate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OrganizationsDomainsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OrganizationsDomainsResponseCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OrganizationsPolicyBase.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OrganizationsPolicyBaseJITPolicy.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OrganizationsPolicyBaseMFAPolicy.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OrganizationsPolicyBaseMemberPolicy.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OrganizationsPolicyBasePasswordPolicy.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OrganizationsPolicyBaseSessionPolicy.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OrganizationsResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.OrganizationsResponseCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PARRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PARResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PINLoginModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PINModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PassKeyConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PasskeyCredentialAssertionResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PasskeyCredentialAssertionResponseResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PasskeyCredentialCreationResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PasskeyCredentialCreationResponseClientExtensionResults.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PasskeyCredentialCreationResponseClientExtensionResultsCredProps.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PasskeyCredentialCreationResponseResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PasskeyCredentialObject.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PasskeyForgot.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PasskeyForgot200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PasskeyForgotCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PasskeyListResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PasskeyLoginAutofillRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PasskeyLoginAutofillRequestCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PasskeyLoginFinish.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PasskeyLoginFinishCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PasskeyRegisterFinish.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PasskeyRegisterFinishCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PasswordEncryptionModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PasswordLessEmailOTPModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PasswordLessEmailOTPModelCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PasswordLessUserNameOTPModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PasswordLessUserNameOTPModelCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PasswordModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PasswordPolicy.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PasswordReauthRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PasswordReauthRequestCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PasswordResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PasswordlessEmailVerification200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PerfectMindContactResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PerfectMindSessionResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.Permission.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PermissionPutRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.Permissions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.Permissions200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PermissionsPostRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PhoneIdModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PhoneIdModelOptional.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PhoneModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PhoneOTPModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PhoneOTPModelCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PinReauthRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PrivacyPolicyHistoryResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PrivacyPolicyHistoryResponseCurrent.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PrivacyPolicyHistoryResponseHistoryInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.Profile.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileAddressesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileAgeRange.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileAwardsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileBadgesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileBooksInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileCertificationsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileConsentProfile.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileConsentProfileAcceptedConsentVersionsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileConsentProfileConsentsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileCountry.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileCoursesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileCurrentStatusInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileEducationsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileEmailInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileExternalIdsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileFamilyInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileFavoriteThingsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileGamesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileIMAccountsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileInspirationalPeopleInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileInterestsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileJobBookmarksInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileJobBookmarksInnerJob.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileKloutScore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileLanguagesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileMemberUrlResourcesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileMoviesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileMutualFriendsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileOrganizationsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfilePIN.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfilePasskeyLogin.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfilePatentsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfilePhoneNumbersInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfilePlacesLivedInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfilePositionsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfilePositionsInnerCompany.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfilePrivacyPolicy.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileProjectsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileProviderAccessCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfilePublicationsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfilePublicationsInnerAuthorsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRecommendationsReceivedInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRegistrationData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRegistrationDataDataInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRegistrationDataDataInnerValue.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRelatedProfileViewsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestEmailOnly.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelAddressesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelAwardsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelBadgesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelBooksInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelCaptchaModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelCertificationsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelConsents.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelConsentsDataInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelConsentsEventsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelCountry.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelCoursesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelCurrentStatusInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelEducationsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelEmailInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelExternalIdsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelFamilyInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelFavoriteThingsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelGamesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelIMAccountsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelInspirationalPeopleInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelInterestsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelJobBookmarksInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelJobBookmarksInnerJob.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelJobBookmarksInnerJobCompony.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelJobBookmarksInnerJobPosition.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelLanguagesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelMemberUrlResourcesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelMoviesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelMutualFriendsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPINInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPatentsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPhoneNumbersInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPlacesLivedInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPositionsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPositionsInnerCompany.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPrivacyPolicy.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelProjectsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelProjectsInnerWithInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelProviderAccessCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPublicationsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPublicationsInnerAuthorsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelRecommendationsReceivedInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelRelatedProfileViewsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSkillsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSportsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSubscription.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSubscriptionAgeRange.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSuggestions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSuggestionsCompaniesToFollowInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSuggestionsIndustriesToFollowInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSuggestionsNewssourceToFollowInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSuggestionsPeopleToFollowInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelTeleVisionShowInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileRequestModelVolunteerInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileSkillsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileSportsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileSubscription.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileSuggestions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileSuggestionsCompaniesToFollowInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileSuggestionsIndustriesToFollowInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileSuggestionsNewssourceToFollowInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileSuggestionsPeopleToFollowInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileTelevisionShowInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileUnverifiedEmailInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileVolunteerInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentities.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesAddressesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesAwardsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesBadgesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesBooksInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesCertificationsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesConsentProfile.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesConsentProfileConsentsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesCoursesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesCurrentStatusInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesEducationsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesExternalIdsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesFavoriteThingsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesGamesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesIMAccountsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesInspirationalPeopleInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesInterestsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesJobBookmarksInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesJobBookmarksInnerJob.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesJobBookmarksInnerJobCompony.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesJobBookmarksInnerJobPosition.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesKloutScore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesLanguagesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesMemberUrlResourcesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesMoviesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesMutualFriendsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesOrganizationsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesPIN.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesPasskeyLogin.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesPatentsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesPhoneNumbersInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesPlacesLivedInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesPositionsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesPositionsInnerCompany.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesPrivacyPolicy.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesProjectsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesProjectsInnerWithInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesProviderAccessCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesPublicationsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesPublicationsInnerAuthorsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesRecommendationsReceivedInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesRegistrationData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesRegistrationDataDataInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesRegistrationDataDataInnerValue.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesRelatedProfileViewsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesSkillsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesSubscription.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesSuggestions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesTelevisionShowInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesUnverifiedEmailInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.Provider.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProviderConfigOptions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProviderStatusList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ProviderStatusModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PublicKeyCredentialCreationOptions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PublicKeyCredentialCreationOptionsAuthenticatorSelection.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PublicKeyCredentialCreationOptionsExcludeCredentialsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PublicKeyCredentialCreationOptionsExtensions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PublicKeyCredentialCreationOptionsPubKeyCredParamsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PublicKeyCredentialCreationOptionsRp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PublicKeyCredentialCreationOptionsUser.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PublicKeyCredentialRequestOptions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PublicKeyCredentialRequestOptionsAllowCredentialsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PublicKeyCredentialRequestOptionsExtensions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PushAuthenticator.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.PushDevice.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.QRCodeMapToToken.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.QRCodeMapToTokenResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.QRCodeResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.QueryGroup.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.QueryRule.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.RaasConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.RaasConfigData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.RaasCustomField.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.RaasCustomFieldModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.RaasOptions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.RangeObj.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.RangeObjFrom.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.RangeObjTo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ReAuthModelByEmailOtp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ReAuthResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ReAuthTwoFAModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ReAuthTwoFAModelCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.RegistrationResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.RemoveRoleContextAdditionalPermissionsModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.RemoveRoleContextRoleModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.RequestPayload.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ResendInvitation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ResetPINByOTP.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ResetPINByToken.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ResetPassword.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ResetPasswordByEmailOtpCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ResetPasswordByResetTokenCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ResetPasswordBySecurityAnswer.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ResetPasswordByUsernameOtpCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ResetPasswordOneOf.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ResetPasswordOneOf1.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ResetPasswordOneOf2.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ResetPasswordResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ResetPasswordWithOTP.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ResetPasswordWithOTPCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.RestoreWorkflowVersion200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.Role.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.RoleByName200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.RoleContext.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.RoleContextBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.RoleContextBodyModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.RoleContextProfileModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.RoleContextProfileResponseModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.RoleContextResponseModal.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.RolePostRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.RolesPutRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SAMLConnectionCreateRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SMSResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SMSResponseData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SamlConnectionRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SamlConnectionRequestCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SamlConnectionResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SamlConnectionResponseCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SamlConnectionResponseCoreSPCertificate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SamlIdpMetadataResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SamlIdpMetadataResponseIDPSSODescriptor.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SamlIntegrationCreateCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SamlIntegrationRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SamlIntegrationResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SamlIntegrationResponseAssertionConsumerService.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SamlIntegrationResponseAttributesValue.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SamlIntegrationResponseIdpCertificate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SamlIntegrationResponseIntegrationConfigs.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SamlIntegrationResponseSpCertificate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SamlSpConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SamlSpConfigModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SecondFactorAuthentication.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SecondFactorAuthenticationCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SecondFactorAuthenticationPasskeyCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SecondFactorAuthenticationPushDevice.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SecondFactorAuthenticator.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SecurityQuestion.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SecurityQuestionInput.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SecurityQuestions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SecurityQuestionsRender.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SendEmailVerificationResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SendInvitation.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SetCustomField200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SetCustomFieldRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SetProvidersOrderRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SetProvidersStatus200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SetUserNameRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.ShopifyLoginUrlResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SimpleUserProfileResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SmsTemplate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentity.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityAddressesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityAgeRange.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityAwardsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityBadgesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityBooksInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityCertificationsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityCountry.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityCoursesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityCurrentStatusInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityEducationsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityEmailInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityFamilyInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityFavoriteThingsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityGamesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityIMAccountsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityInspirationalPeopleInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityInterestsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityJobBookmarksInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityJobBookmarksInnerJob.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityJobBookmarksInnerJobCompony.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityJobBookmarksInnerJobPosition.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityKloutScore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityLanguagesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityMemberUrlResourcesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityMoviesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityMutualFriendsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityPatentsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityPhoneNumbersInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityPlacesLivedInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityPositionsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityPositionsInnerCompany.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityProjectsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityProjectsInnerWithInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityProviderAccessCredential.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityPublicationsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityPublicationsInnerAuthorsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityRecommendationsReceivedInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityRelatedProfileViewsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentitySkillsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentitySportsInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentitySubscription.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentitySuggestions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityTelevisionShowInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SocialIdentityVolunteerInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SottGenerate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SottGenerateTechnology.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SottGenerateTechnologyCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SottList.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.SottResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.TenantRole.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.TwoFAAuthByBackupCode.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.TwoFAAuthBySecQuesAuthModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.TwoFactorAuthenticationSettings.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.TwoFactorAuthenticationTokenObject.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.TwoFactorAuthenticationTokenObjectCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UnlinkSocialIdentityRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UnlockAccountRequestCore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UnlockaccountbyaccesstokenRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UpdateAccountByAccessTokenRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UpdateByTokenResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UpdateEmail200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UpdateEmailRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UpdateEmailTemplate.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UpdateInvitationByInvitationIdRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UpdateRoleContextBodyModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UpdateSmsTemplateModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UpdateWorkflowConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UpsertEmailModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UpsertEmailModelEmailInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfile.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileAddresses.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileAgeRange.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileAwards.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileBadges.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileBooks.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileCertifications.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileCountry.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileCourses.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileCoverPhoto.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileCurrentStatus.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileCustomFields.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileEducations.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileEmail.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileExternalIds.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileFamily.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileFavicon.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileFavoriteThings.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileGames.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileGistsUrl.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileGravatarImageUrl.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileHttpsImageUrl.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileIMAccounts.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileImageUrl.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileInspirationalPeople.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileInterests.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileJobBookmarks.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileKloutScore.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileKnownLoginVariables.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileLanguages.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileMemberUrlResources.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileMovies.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileMutualFriends.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileNextResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileNextResponseWithCustomObject.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfilePatents.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfilePhoneNumbers.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfilePlacesLived.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfilePositions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfilePrivacyPolicy.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileProfileImageUrls.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileProfileUrl.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileProjects.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfilePublicRepository.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfilePublications.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileRecommendationsReceived.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileRelatedProfileViews.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileRepositoryUrl.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileRequestBody.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileRoleContext.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileScrollResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileScrollResponseWithCustomObject.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileSignupLog.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileSkills.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileSports.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileStarredUrl.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileSubscription.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileSuggestions.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileTeleVisionShow.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileUnverifiedEmail.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileUserAgent.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileVolunteer.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserProfileWebProfiles.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserRegistrationByReCaptchaEmailPhoneUserNameRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserRole.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserRolePutRequest.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UserRolesModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.UsernameModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.VerificationLinkResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.VerifyConsent.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.VerifyDeleteAccountOtp.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.VerifyEmailModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.VerifyOtpPhoneModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.VerifyPhoneOtp200Response.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.VersionListResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.VersionListResponseDataInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.WebhookAuthentication.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.WebhookSubscription.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.WebhookSubscriptionCreateModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.WebhookSubscriptionResponse.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.WebhookSubscriptionUpdateModel.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.WorkflowConfig.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.WorkflowConfigWithoutData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.WorkflowData.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.WorkflowDataInnerNodesValue.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.WorkflowDataInnerNodesValueFormnodeprops.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.WorkflowDataInnerNodesValueFormnodepropsChoicesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.WorkflowDataNodesValue.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.WorkflowDataNodesValueNodesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.WorkflowDataNodesValueNodesInnerFormnodeprops.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.WorkflowDataTree.CustomTypeAdapterFactory()); + gsonBuilder.registerTypeAdapterFactory(new com.loginradius.sdk.internal.openapi.model.WorkflowDataTreeNodesValue.CustomTypeAdapterFactory()); + gson = gsonBuilder.create(); + } + + /** + * Get Gson. + * + * @return Gson + */ + public static Gson getGson() { + return gson; + } + + /** + * Set Gson. + * + * @param gson Gson + */ + public static void setGson(Gson gson) { + JSON.gson = gson; + } + + public static void setLenientOnJson(boolean lenientOnJson) { + isLenientOnJson = lenientOnJson; + } + + /** + * Serialize the given Java object into JSON string. + * + * @param obj Object + * @return String representation of the JSON + */ + public static String serialize(Object obj) { + return gson.toJson(obj); + } + + /** + * Deserialize the given JSON string to Java object. + * + * @param <T> Type + * @param body The JSON string + * @param returnType The type to deserialize into + * @return The deserialized Java object + */ + @SuppressWarnings("unchecked") + public static <T> T deserialize(String body, Type returnType) { + try { + if (isLenientOnJson) { + JsonReader jsonReader = new JsonReader(new StringReader(body)); + // see https://google-gson.googlecode.com/svn/trunk/gson/docs/javadocs/com/google/gson/stream/JsonReader.html#setLenient(boolean) + jsonReader.setLenient(true); + return gson.fromJson(jsonReader, returnType); + } else { + return gson.fromJson(body, returnType); + } + } catch (JsonParseException e) { + // Fallback processing when failed to parse JSON form response body: + // return the response body string directly for the String return type; + if (returnType.equals(String.class)) { + return (T) body; + } else { + throw (e); + } + } + } + + /** + * Gson TypeAdapter for Byte Array type + */ + public static class ByteArrayAdapter extends TypeAdapter<byte[]> { + + @Override + public void write(JsonWriter out, byte[] value) throws IOException { + if (value == null) { + out.nullValue(); + } else { + out.value(ByteString.of(value).base64()); + } + } + + @Override + public byte[] read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String bytesAsBase64 = in.nextString(); + ByteString byteString = ByteString.decodeBase64(bytesAsBase64); + return byteString.toByteArray(); + } + } + } + + /** + * Gson TypeAdapter for JSR310 OffsetDateTime type + */ + public static class OffsetDateTimeTypeAdapter extends TypeAdapter<OffsetDateTime> { + + private DateTimeFormatter formatter; + + public OffsetDateTimeTypeAdapter() { + this(DateTimeFormatter.ISO_OFFSET_DATE_TIME); + } + + public OffsetDateTimeTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, OffsetDateTime date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public OffsetDateTime read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + if (date.endsWith("+0000")) { + date = date.substring(0, date.length()-5) + "Z"; + } + return OffsetDateTime.parse(date, formatter); + } + } + } + + /** + * Gson TypeAdapter for JSR310 LocalDate type + */ + public static class LocalDateTypeAdapter extends TypeAdapter<LocalDate> { + + private DateTimeFormatter formatter; + + public LocalDateTypeAdapter() { + this(DateTimeFormatter.ISO_LOCAL_DATE); + } + + public LocalDateTypeAdapter(DateTimeFormatter formatter) { + this.formatter = formatter; + } + + public void setFormat(DateTimeFormatter dateFormat) { + this.formatter = dateFormat; + } + + @Override + public void write(JsonWriter out, LocalDate date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + out.value(formatter.format(date)); + } + } + + @Override + public LocalDate read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + return LocalDate.parse(date, formatter); + } + } + } + + public static void setOffsetDateTimeFormat(DateTimeFormatter dateFormat) { + offsetDateTimeTypeAdapter.setFormat(dateFormat); + } + + public static void setLocalDateFormat(DateTimeFormatter dateFormat) { + localDateTypeAdapter.setFormat(dateFormat); + } + + /** + * Gson TypeAdapter for java.sql.Date type + * If the dateFormat is null, a simple "yyyy-MM-dd" format will be used + * (more efficient than SimpleDateFormat). + */ + public static class SqlDateTypeAdapter extends TypeAdapter<java.sql.Date> { + + private DateFormat dateFormat; + + public SqlDateTypeAdapter() {} + + public SqlDateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, java.sql.Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = date.toString(); + } + out.value(value); + } + } + + @Override + public java.sql.Date read(JsonReader in) throws IOException { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return new java.sql.Date(dateFormat.parse(date).getTime()); + } + return new java.sql.Date(ISO8601Utils.parse(date, new ParsePosition(0)).getTime()); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } + } + + /** + * Gson TypeAdapter for java.util.Date type + * If the dateFormat is null, ISO8601Utils will be used. + */ + public static class DateTypeAdapter extends TypeAdapter<Date> { + + private DateFormat dateFormat; + + public DateTypeAdapter() {} + + public DateTypeAdapter(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + public void setFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + } + + @Override + public void write(JsonWriter out, Date date) throws IOException { + if (date == null) { + out.nullValue(); + } else { + String value; + if (dateFormat != null) { + value = dateFormat.format(date); + } else { + value = ISO8601Utils.format(date, true); + } + out.value(value); + } + } + + @Override + public Date read(JsonReader in) throws IOException { + try { + switch (in.peek()) { + case NULL: + in.nextNull(); + return null; + default: + String date = in.nextString(); + try { + if (dateFormat != null) { + return dateFormat.parse(date); + } + return ISO8601Utils.parse(date, new ParsePosition(0)); + } catch (ParseException e) { + throw new JsonParseException(e); + } + } + } catch (IllegalArgumentException e) { + throw new JsonParseException(e); + } + } + } + + public static void setDateFormat(DateFormat dateFormat) { + dateTypeAdapter.setFormat(dateFormat); + } + + public static void setSqlDateFormat(DateFormat dateFormat) { + sqlDateTypeAdapter.setFormat(dateFormat); + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/Pair.java b/src/main/java/com/loginradius/sdk/internal/openapi/Pair.java new file mode 100644 index 0000000..8510ca4 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/Pair.java @@ -0,0 +1,57 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class Pair { + private String name = ""; + private String value = ""; + + public Pair (String name, String value) { + setName(name); + setValue(value); + } + + private void setName(String name) { + if (!isValidString(name)) { + return; + } + + this.name = name; + } + + private void setValue(String value) { + if (!isValidString(value)) { + return; + } + + this.value = value; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + private boolean isValidString(String arg) { + if (arg == null) { + return false; + } + + return true; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/ProgressRequestBody.java b/src/main/java/com/loginradius/sdk/internal/openapi/ProgressRequestBody.java new file mode 100644 index 0000000..a68204d --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/ProgressRequestBody.java @@ -0,0 +1,73 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi; + +import okhttp3.MediaType; +import okhttp3.RequestBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSink; +import okio.ForwardingSink; +import okio.Okio; +import okio.Sink; + +public class ProgressRequestBody extends RequestBody { + + private final RequestBody requestBody; + + private final ApiCallback callback; + + public ProgressRequestBody(RequestBody requestBody, ApiCallback callback) { + this.requestBody = requestBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return requestBody.contentType(); + } + + @Override + public long contentLength() throws IOException { + return requestBody.contentLength(); + } + + @Override + public void writeTo(BufferedSink sink) throws IOException { + BufferedSink bufferedSink = Okio.buffer(sink(sink)); + requestBody.writeTo(bufferedSink); + bufferedSink.flush(); + } + + private Sink sink(Sink sink) { + return new ForwardingSink(sink) { + + long bytesWritten = 0L; + long contentLength = 0L; + + @Override + public void write(Buffer source, long byteCount) throws IOException { + super.write(source, byteCount); + if (contentLength == 0) { + contentLength = contentLength(); + } + + bytesWritten += byteCount; + callback.onUploadProgress(bytesWritten, contentLength, bytesWritten == contentLength); + } + }; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/ProgressResponseBody.java b/src/main/java/com/loginradius/sdk/internal/openapi/ProgressResponseBody.java new file mode 100644 index 0000000..fb04030 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/ProgressResponseBody.java @@ -0,0 +1,70 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi; + +import okhttp3.MediaType; +import okhttp3.ResponseBody; + +import java.io.IOException; + +import okio.Buffer; +import okio.BufferedSource; +import okio.ForwardingSource; +import okio.Okio; +import okio.Source; + +public class ProgressResponseBody extends ResponseBody { + + private final ResponseBody responseBody; + private final ApiCallback callback; + private BufferedSource bufferedSource; + + public ProgressResponseBody(ResponseBody responseBody, ApiCallback callback) { + this.responseBody = responseBody; + this.callback = callback; + } + + @Override + public MediaType contentType() { + return responseBody.contentType(); + } + + @Override + public long contentLength() { + return responseBody.contentLength(); + } + + @Override + public BufferedSource source() { + if (bufferedSource == null) { + bufferedSource = Okio.buffer(source(responseBody.source())); + } + return bufferedSource; + } + + private Source source(Source source) { + return new ForwardingSource(source) { + long totalBytesRead = 0L; + + @Override + public long read(Buffer sink, long byteCount) throws IOException { + long bytesRead = super.read(sink, byteCount); + // read() returns the number of bytes read, or -1 if this source is exhausted. + totalBytesRead += bytesRead != -1 ? bytesRead : 0; + callback.onDownloadProgress(totalBytesRead, responseBody.contentLength(), bytesRead == -1); + return bytesRead; + } + }; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/README.md b/src/main/java/com/loginradius/sdk/internal/openapi/README.md new file mode 100644 index 0000000..8d3d0dd --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/README.md @@ -0,0 +1,6 @@ +# Generated client — DO NOT EDIT + +Produced by the LoginRadius SDK generator from the OpenAPI specification. +The customer-facing facade lives in the parent package and is also generated. +To change anything here, edit the spec, the manifest, or the templates in +the SDK generator and regenerate. diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/ServerConfiguration.java b/src/main/java/com/loginradius/sdk/internal/openapi/ServerConfiguration.java new file mode 100644 index 0000000..ba28326 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/ServerConfiguration.java @@ -0,0 +1,72 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi; + +import java.util.Map; + +/** + * Representing a Server configuration. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ServerConfiguration { + public String URL; + public String description; + public Map<String, ServerVariable> variables; + + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration(String URL, String description, Map<String, ServerVariable> variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } + + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map<String, String> variables) { + String url = this.URL; + + // go through variables and replace placeholders + for (Map.Entry<String, ServerVariable> variable: this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; + + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); + } + } + url = url.replace("{" + name + "}", value); + } + return url; + } + + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/ServerVariable.java b/src/main/java/com/loginradius/sdk/internal/openapi/ServerVariable.java new file mode 100644 index 0000000..dd8801a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/ServerVariable.java @@ -0,0 +1,37 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi; + +import java.util.HashSet; + +/** + * Representing a Server Variable for server URL template substitution. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ServerVariable { + public String description; + public String defaultValue; + public HashSet<String> enumValues = null; + + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet<String> enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/StringUtil.java b/src/main/java/com/loginradius/sdk/internal/openapi/StringUtil.java new file mode 100644 index 0000000..a542ef3 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/StringUtil.java @@ -0,0 +1,83 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi; + +import java.util.Collection; +import java.util.Iterator; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class StringUtil { + /** + * Check if the given array contains the given value (with case-insensitive comparison). + * + * @param array The array + * @param value The value to search + * @return true if the array contains the value + */ + public static boolean containsIgnoreCase(String[] array, String value) { + for (String str : array) { + if (value == null && str == null) { + return true; + } + if (value != null && value.equalsIgnoreCase(str)) { + return true; + } + } + return false; + } + + /** + * Join an array of strings with the given separator. + * <p> + * Note: This might be replaced by utility method from commons-lang or guava someday + * if one of those libraries is added as dependency. + * </p> + * + * @param array The array of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(String[] array, String separator) { + int len = array.length; + if (len == 0) { + return ""; + } + + StringBuilder out = new StringBuilder(); + out.append(array[0]); + for (int i = 1; i < len; i++) { + out.append(separator).append(array[i]); + } + return out.toString(); + } + + /** + * Join a list of strings with the given separator. + * + * @param list The list of strings + * @param separator The separator + * @return the resulting string + */ + public static String join(Collection<String> list, String separator) { + Iterator<String> iterator = list.iterator(); + StringBuilder out = new StringBuilder(); + if (iterator.hasNext()) { + out.append(iterator.next()); + } + while (iterator.hasNext()) { + out.append(separator).append(iterator.next()); + } + return out.toString(); + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/AccountCustomObjectApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/AccountCustomObjectApi.java new file mode 100644 index 0000000..12d2ff4 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/AccountCustomObjectApi.java @@ -0,0 +1,916 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.CustomObjectResponseModel; +import com.loginradius.sdk.internal.openapi.model.CustomObjectsResponseModel; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.IsDeleted; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class AccountCustomObjectApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public AccountCustomObjectApi() { + this(Configuration.getDefaultApiClient()); + } + + public AccountCustomObjectApi(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 createCustomObject + * @param uid The UID associated with the User (required) + * @param requestBody (required) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createCustomObjectCall(String uid, Map<String, Object> requestBody, String objectname, String customobjectid, 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 = requestBody; + + // create path and map variables + String localVarPath = "/identity/v2/manage/account/{uid}/customobject" + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (objectname != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("objectname", objectname)); + } + + if (customobjectid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("customobjectid", customobjectid)); + } + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createCustomObjectValidateBeforeCall(String uid, Map<String, Object> requestBody, String objectname, String customobjectid, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling createCustomObject(Async)"); + } + + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new ApiException("Missing the required parameter 'requestBody' when calling createCustomObject(Async)"); + } + + return createCustomObjectCall(uid, requestBody, objectname, customobjectid, _callback); + + } + + /** + * Create Custom Object + * Creates a new Custom Object for the User. + * @param uid The UID associated with the User (required) + * @param requestBody (required) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @return CustomObjectResponseModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public CustomObjectResponseModel createCustomObject(String uid, Map<String, Object> requestBody, String objectname, String customobjectid) throws ApiException { + ApiResponse<CustomObjectResponseModel> localVarResp = createCustomObjectWithHttpInfo(uid, requestBody, objectname, customobjectid); + return localVarResp.getData(); + } + + /** + * Create Custom Object + * Creates a new Custom Object for the User. + * @param uid The UID associated with the User (required) + * @param requestBody (required) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @return ApiResponse<CustomObjectResponseModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<CustomObjectResponseModel> createCustomObjectWithHttpInfo(String uid, Map<String, Object> requestBody, String objectname, String customobjectid) throws ApiException { + okhttp3.Call localVarCall = createCustomObjectValidateBeforeCall(uid, requestBody, objectname, customobjectid, null); + Type localVarReturnType = new TypeToken<CustomObjectResponseModel>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Custom Object (asynchronously) + * Creates a new Custom Object for the User. + * @param uid The UID associated with the User (required) + * @param requestBody (required) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createCustomObjectAsync(String uid, Map<String, Object> requestBody, String objectname, String customobjectid, final ApiCallback<CustomObjectResponseModel> _callback) throws ApiException { + + okhttp3.Call localVarCall = createCustomObjectValidateBeforeCall(uid, requestBody, objectname, customobjectid, _callback); + Type localVarReturnType = new TypeToken<CustomObjectResponseModel>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteCustomObjectByUidAndRecordId + * @param objectrecordid Unique identifier for the Custom Object record. The ID is used to target a specific Custom Object. (required) + * @param uid The UID associated with the User (required) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteCustomObjectByUidAndRecordIdCall(String objectrecordid, String uid, String objectname, String customobjectid, 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 = "/identity/v2/manage/account/{uid}/customobject/{objectrecordid}" + .replace("{" + "objectrecordid" + "}", localVarApiClient.escapeString(objectrecordid.toString())) + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (objectname != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("objectname", objectname)); + } + + if (customobjectid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("customobjectid", customobjectid)); + } + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteCustomObjectByUidAndRecordIdValidateBeforeCall(String objectrecordid, String uid, String objectname, String customobjectid, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'objectrecordid' is set + if (objectrecordid == null) { + throw new ApiException("Missing the required parameter 'objectrecordid' when calling deleteCustomObjectByUidAndRecordId(Async)"); + } + + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling deleteCustomObjectByUidAndRecordId(Async)"); + } + + return deleteCustomObjectByUidAndRecordIdCall(objectrecordid, uid, objectname, customobjectid, _callback); + + } + + /** + * Delete Custom Object + * Deletes the Custom Object associated with the specified User using the UID and record ID. + * @param objectrecordid Unique identifier for the Custom Object record. The ID is used to target a specific Custom Object. (required) + * @param uid The UID associated with the User (required) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @return IsDeleted + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public IsDeleted deleteCustomObjectByUidAndRecordId(String objectrecordid, String uid, String objectname, String customobjectid) throws ApiException { + ApiResponse<IsDeleted> localVarResp = deleteCustomObjectByUidAndRecordIdWithHttpInfo(objectrecordid, uid, objectname, customobjectid); + return localVarResp.getData(); + } + + /** + * Delete Custom Object + * Deletes the Custom Object associated with the specified User using the UID and record ID. + * @param objectrecordid Unique identifier for the Custom Object record. The ID is used to target a specific Custom Object. (required) + * @param uid The UID associated with the User (required) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @return ApiResponse<IsDeleted> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsDeleted> deleteCustomObjectByUidAndRecordIdWithHttpInfo(String objectrecordid, String uid, String objectname, String customobjectid) throws ApiException { + okhttp3.Call localVarCall = deleteCustomObjectByUidAndRecordIdValidateBeforeCall(objectrecordid, uid, objectname, customobjectid, null); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Custom Object (asynchronously) + * Deletes the Custom Object associated with the specified User using the UID and record ID. + * @param objectrecordid Unique identifier for the Custom Object record. The ID is used to target a specific Custom Object. (required) + * @param uid The UID associated with the User (required) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteCustomObjectByUidAndRecordIdAsync(String objectrecordid, String uid, String objectname, String customobjectid, final ApiCallback<IsDeleted> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteCustomObjectByUidAndRecordIdValidateBeforeCall(objectrecordid, uid, objectname, customobjectid, _callback); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getCustomObjectByUid + * @param uid The UID associated with the User (required) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getCustomObjectByUidCall(String uid, String objectname, String customobjectid, 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 = "/identity/v2/manage/account/{uid}/customobject" + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (objectname != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("objectname", objectname)); + } + + if (customobjectid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("customobjectid", customobjectid)); + } + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getCustomObjectByUidValidateBeforeCall(String uid, String objectname, String customobjectid, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling getCustomObjectByUid(Async)"); + } + + return getCustomObjectByUidCall(uid, objectname, customobjectid, _callback); + + } + + /** + * List Custom Objects + * Retrieves all Custom Objects associated with the UID. + * @param uid The UID associated with the User (required) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @return CustomObjectsResponseModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public CustomObjectsResponseModel getCustomObjectByUid(String uid, String objectname, String customobjectid) throws ApiException { + ApiResponse<CustomObjectsResponseModel> localVarResp = getCustomObjectByUidWithHttpInfo(uid, objectname, customobjectid); + return localVarResp.getData(); + } + + /** + * List Custom Objects + * Retrieves all Custom Objects associated with the UID. + * @param uid The UID associated with the User (required) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @return ApiResponse<CustomObjectsResponseModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<CustomObjectsResponseModel> getCustomObjectByUidWithHttpInfo(String uid, String objectname, String customobjectid) throws ApiException { + okhttp3.Call localVarCall = getCustomObjectByUidValidateBeforeCall(uid, objectname, customobjectid, null); + Type localVarReturnType = new TypeToken<CustomObjectsResponseModel>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Custom Objects (asynchronously) + * Retrieves all Custom Objects associated with the UID. + * @param uid The UID associated with the User (required) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getCustomObjectByUidAsync(String uid, String objectname, String customobjectid, final ApiCallback<CustomObjectsResponseModel> _callback) throws ApiException { + + okhttp3.Call localVarCall = getCustomObjectByUidValidateBeforeCall(uid, objectname, customobjectid, _callback); + Type localVarReturnType = new TypeToken<CustomObjectsResponseModel>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getCustomObjectByUidAndRecordId + * @param objectrecordid Unique identifier for the Custom Object record. The ID is used to target a specific Custom Object. (required) + * @param uid The UID associated with the User (required) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getCustomObjectByUidAndRecordIdCall(String objectrecordid, String uid, String objectname, String customobjectid, 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 = "/identity/v2/manage/account/{uid}/customobject/{objectrecordid}" + .replace("{" + "objectrecordid" + "}", localVarApiClient.escapeString(objectrecordid.toString())) + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (objectname != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("objectname", objectname)); + } + + if (customobjectid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("customobjectid", customobjectid)); + } + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getCustomObjectByUidAndRecordIdValidateBeforeCall(String objectrecordid, String uid, String objectname, String customobjectid, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'objectrecordid' is set + if (objectrecordid == null) { + throw new ApiException("Missing the required parameter 'objectrecordid' when calling getCustomObjectByUidAndRecordId(Async)"); + } + + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling getCustomObjectByUidAndRecordId(Async)"); + } + + return getCustomObjectByUidAndRecordIdCall(objectrecordid, uid, objectname, customobjectid, _callback); + + } + + /** + * Retrieve Custom Object + * Retrieves the Custom Object associated with the specified User using the UID and record ID. + * @param objectrecordid Unique identifier for the Custom Object record. The ID is used to target a specific Custom Object. (required) + * @param uid The UID associated with the User (required) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @return CustomObjectResponseModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public CustomObjectResponseModel getCustomObjectByUidAndRecordId(String objectrecordid, String uid, String objectname, String customobjectid) throws ApiException { + ApiResponse<CustomObjectResponseModel> localVarResp = getCustomObjectByUidAndRecordIdWithHttpInfo(objectrecordid, uid, objectname, customobjectid); + return localVarResp.getData(); + } + + /** + * Retrieve Custom Object + * Retrieves the Custom Object associated with the specified User using the UID and record ID. + * @param objectrecordid Unique identifier for the Custom Object record. The ID is used to target a specific Custom Object. (required) + * @param uid The UID associated with the User (required) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @return ApiResponse<CustomObjectResponseModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<CustomObjectResponseModel> getCustomObjectByUidAndRecordIdWithHttpInfo(String objectrecordid, String uid, String objectname, String customobjectid) throws ApiException { + okhttp3.Call localVarCall = getCustomObjectByUidAndRecordIdValidateBeforeCall(objectrecordid, uid, objectname, customobjectid, null); + Type localVarReturnType = new TypeToken<CustomObjectResponseModel>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Custom Object (asynchronously) + * Retrieves the Custom Object associated with the specified User using the UID and record ID. + * @param objectrecordid Unique identifier for the Custom Object record. The ID is used to target a specific Custom Object. (required) + * @param uid The UID associated with the User (required) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getCustomObjectByUidAndRecordIdAsync(String objectrecordid, String uid, String objectname, String customobjectid, final ApiCallback<CustomObjectResponseModel> _callback) throws ApiException { + + okhttp3.Call localVarCall = getCustomObjectByUidAndRecordIdValidateBeforeCall(objectrecordid, uid, objectname, customobjectid, _callback); + Type localVarReturnType = new TypeToken<CustomObjectResponseModel>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateCustomObjectByUidAndRecordId + * @param objectrecordid Unique identifier for the Custom Object record. The ID is used to target a specific Custom Object. (required) + * @param uid The UID associated with the User (required) + * @param updateType The type of update to be performed on the Custom Object. This parameter is used to specify whether the update should be a full update or a partial update. (required) + * @param requestBody (required) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateCustomObjectByUidAndRecordIdCall(String objectrecordid, String uid, String updateType, Map<String, Object> requestBody, String objectname, String customobjectid, 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 = requestBody; + + // create path and map variables + String localVarPath = "/identity/v2/manage/account/{uid}/customobject/{objectrecordid}" + .replace("{" + "objectrecordid" + "}", localVarApiClient.escapeString(objectrecordid.toString())) + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (updateType != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("updateType", updateType)); + } + + if (objectname != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("objectname", objectname)); + } + + if (customobjectid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("customobjectid", customobjectid)); + } + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateCustomObjectByUidAndRecordIdValidateBeforeCall(String objectrecordid, String uid, String updateType, Map<String, Object> requestBody, String objectname, String customobjectid, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'objectrecordid' is set + if (objectrecordid == null) { + throw new ApiException("Missing the required parameter 'objectrecordid' when calling updateCustomObjectByUidAndRecordId(Async)"); + } + + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling updateCustomObjectByUidAndRecordId(Async)"); + } + + // verify the required parameter 'updateType' is set + if (updateType == null) { + throw new ApiException("Missing the required parameter 'updateType' when calling updateCustomObjectByUidAndRecordId(Async)"); + } + + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new ApiException("Missing the required parameter 'requestBody' when calling updateCustomObjectByUidAndRecordId(Async)"); + } + + return updateCustomObjectByUidAndRecordIdCall(objectrecordid, uid, updateType, requestBody, objectname, customobjectid, _callback); + + } + + /** + * Update Custom Object + * Updates a Custom Object associated with the authenticated User using the UID and record ID. + * @param objectrecordid Unique identifier for the Custom Object record. The ID is used to target a specific Custom Object. (required) + * @param uid The UID associated with the User (required) + * @param updateType The type of update to be performed on the Custom Object. This parameter is used to specify whether the update should be a full update or a partial update. (required) + * @param requestBody (required) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @return CustomObjectResponseModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public CustomObjectResponseModel updateCustomObjectByUidAndRecordId(String objectrecordid, String uid, String updateType, Map<String, Object> requestBody, String objectname, String customobjectid) throws ApiException { + ApiResponse<CustomObjectResponseModel> localVarResp = updateCustomObjectByUidAndRecordIdWithHttpInfo(objectrecordid, uid, updateType, requestBody, objectname, customobjectid); + return localVarResp.getData(); + } + + /** + * Update Custom Object + * Updates a Custom Object associated with the authenticated User using the UID and record ID. + * @param objectrecordid Unique identifier for the Custom Object record. The ID is used to target a specific Custom Object. (required) + * @param uid The UID associated with the User (required) + * @param updateType The type of update to be performed on the Custom Object. This parameter is used to specify whether the update should be a full update or a partial update. (required) + * @param requestBody (required) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @return ApiResponse<CustomObjectResponseModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<CustomObjectResponseModel> updateCustomObjectByUidAndRecordIdWithHttpInfo(String objectrecordid, String uid, String updateType, Map<String, Object> requestBody, String objectname, String customobjectid) throws ApiException { + okhttp3.Call localVarCall = updateCustomObjectByUidAndRecordIdValidateBeforeCall(objectrecordid, uid, updateType, requestBody, objectname, customobjectid, null); + Type localVarReturnType = new TypeToken<CustomObjectResponseModel>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Custom Object (asynchronously) + * Updates a Custom Object associated with the authenticated User using the UID and record ID. + * @param objectrecordid Unique identifier for the Custom Object record. The ID is used to target a specific Custom Object. (required) + * @param uid The UID associated with the User (required) + * @param updateType The type of update to be performed on the Custom Object. This parameter is used to specify whether the update should be a full update or a partial update. (required) + * @param requestBody (required) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateCustomObjectByUidAndRecordIdAsync(String objectrecordid, String uid, String updateType, Map<String, Object> requestBody, String objectname, String customobjectid, final ApiCallback<CustomObjectResponseModel> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateCustomObjectByUidAndRecordIdValidateBeforeCall(objectrecordid, uid, updateType, requestBody, objectname, customobjectid, _callback); + Type localVarReturnType = new TypeToken<CustomObjectResponseModel>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/AccountSecurityApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/AccountSecurityApi.java new file mode 100644 index 0000000..df2bd45 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/AccountSecurityApi.java @@ -0,0 +1,1513 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.EventBasedSecondFactorToken; +import com.loginradius.sdk.internal.openapi.model.IsDeleted; +import com.loginradius.sdk.internal.openapi.model.IsValid; +import com.loginradius.sdk.internal.openapi.model.MFABackUpCodeResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class AccountSecurityApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public AccountSecurityApi() { + this(Configuration.getDefaultApiClient()); + } + + public AccountSecurityApi(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 mFAResetSMSAuthByUid + * @param uid The UID associated with the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call mFAResetSMSAuthByUidCall(String uid, 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 = "/identity/v2/manage/account/2fa/sms"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (uid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("uid", uid)); + } + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call mFAResetSMSAuthByUidValidateBeforeCall(String uid, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling mFAResetSMSAuthByUid(Async)"); + } + + return mFAResetSMSAuthByUidCall(uid, _callback); + + } + + /** + * Reset SMS Authenticator + * Resets MFA settings for the specified User. + * @param uid The UID associated with the User (required) + * @return IsDeleted + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public IsDeleted mFAResetSMSAuthByUid(String uid) throws ApiException { + ApiResponse<IsDeleted> localVarResp = mFAResetSMSAuthByUidWithHttpInfo(uid); + return localVarResp.getData(); + } + + /** + * Reset SMS Authenticator + * Resets MFA settings for the specified User. + * @param uid The UID associated with the User (required) + * @return ApiResponse<IsDeleted> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsDeleted> mFAResetSMSAuthByUidWithHttpInfo(String uid) throws ApiException { + okhttp3.Call localVarCall = mFAResetSMSAuthByUidValidateBeforeCall(uid, null); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Reset SMS Authenticator (asynchronously) + * Resets MFA settings for the specified User. + * @param uid The UID associated with the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call mFAResetSMSAuthByUidAsync(String uid, final ApiCallback<IsDeleted> _callback) throws ApiException { + + okhttp3.Call localVarCall = mFAResetSMSAuthByUidValidateBeforeCall(uid, _callback); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for mFAResetTotpByUid + * @param uid The UID associated with the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call mFAResetTotpByUidCall(String uid, 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 = "/identity/v2/manage/account/2fa/totp"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (uid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("uid", uid)); + } + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call mFAResetTotpByUidValidateBeforeCall(String uid, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling mFAResetTotpByUid(Async)"); + } + + return mFAResetTotpByUidCall(uid, _callback); + + } + + /** + * Reset TOTP + * Resets MFA settings for the specified User. + * @param uid The UID associated with the User (required) + * @return IsDeleted + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public IsDeleted mFAResetTotpByUid(String uid) throws ApiException { + ApiResponse<IsDeleted> localVarResp = mFAResetTotpByUidWithHttpInfo(uid); + return localVarResp.getData(); + } + + /** + * Reset TOTP + * Resets MFA settings for the specified User. + * @param uid The UID associated with the User (required) + * @return ApiResponse<IsDeleted> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsDeleted> mFAResetTotpByUidWithHttpInfo(String uid) throws ApiException { + okhttp3.Call localVarCall = mFAResetTotpByUidValidateBeforeCall(uid, null); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Reset TOTP (asynchronously) + * Resets MFA settings for the specified User. + * @param uid The UID associated with the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call mFAResetTotpByUidAsync(String uid, final ApiCallback<IsDeleted> _callback) throws ApiException { + + okhttp3.Call localVarCall = mFAResetTotpByUidValidateBeforeCall(uid, _callback); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for mfaGenerateBackupCodesByUid + * @param uid The UID associated with the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call mfaGenerateBackupCodesByUidCall(String uid, 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 = "/identity/v2/manage/account/2fa/backupcode"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (uid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("uid", uid)); + } + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call mfaGenerateBackupCodesByUidValidateBeforeCall(String uid, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling mfaGenerateBackupCodesByUid(Async)"); + } + + return mfaGenerateBackupCodesByUidCall(uid, _callback); + + } + + /** + * Generate Backup Codes + * Generates a set of backup codes for the specified User. + * @param uid The UID associated with the User (required) + * @return MFABackUpCodeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public MFABackUpCodeResponse mfaGenerateBackupCodesByUid(String uid) throws ApiException { + ApiResponse<MFABackUpCodeResponse> localVarResp = mfaGenerateBackupCodesByUidWithHttpInfo(uid); + return localVarResp.getData(); + } + + /** + * Generate Backup Codes + * Generates a set of backup codes for the specified User. + * @param uid The UID associated with the User (required) + * @return ApiResponse<MFABackUpCodeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<MFABackUpCodeResponse> mfaGenerateBackupCodesByUidWithHttpInfo(String uid) throws ApiException { + okhttp3.Call localVarCall = mfaGenerateBackupCodesByUidValidateBeforeCall(uid, null); + Type localVarReturnType = new TypeToken<MFABackUpCodeResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Generate Backup Codes (asynchronously) + * Generates a set of backup codes for the specified User. + * @param uid The UID associated with the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call mfaGenerateBackupCodesByUidAsync(String uid, final ApiCallback<MFABackUpCodeResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = mfaGenerateBackupCodesByUidValidateBeforeCall(uid, _callback); + Type localVarReturnType = new TypeToken<MFABackUpCodeResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for mfaResetBackupCodesByUid + * @param uid The UID associated with the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call mfaResetBackupCodesByUidCall(String uid, 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 = "/identity/v2/manage/account/2fa/backupcode/reset"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (uid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("uid", uid)); + } + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call mfaResetBackupCodesByUidValidateBeforeCall(String uid, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling mfaResetBackupCodesByUid(Async)"); + } + + return mfaResetBackupCodesByUidCall(uid, _callback); + + } + + /** + * Reset Backup Codes + * Resets and generates a new set of backup codes for the specified User. + * @param uid The UID associated with the User (required) + * @return MFABackUpCodeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public MFABackUpCodeResponse mfaResetBackupCodesByUid(String uid) throws ApiException { + ApiResponse<MFABackUpCodeResponse> localVarResp = mfaResetBackupCodesByUidWithHttpInfo(uid); + return localVarResp.getData(); + } + + /** + * Reset Backup Codes + * Resets and generates a new set of backup codes for the specified User. + * @param uid The UID associated with the User (required) + * @return ApiResponse<MFABackUpCodeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<MFABackUpCodeResponse> mfaResetBackupCodesByUidWithHttpInfo(String uid) throws ApiException { + okhttp3.Call localVarCall = mfaResetBackupCodesByUidValidateBeforeCall(uid, null); + Type localVarReturnType = new TypeToken<MFABackUpCodeResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Reset Backup Codes (asynchronously) + * Resets and generates a new set of backup codes for the specified User. + * @param uid The UID associated with the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call mfaResetBackupCodesByUidAsync(String uid, final ApiCallback<MFABackUpCodeResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = mfaResetBackupCodesByUidValidateBeforeCall(uid, _callback); + Type localVarReturnType = new TypeToken<MFABackUpCodeResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for resetDuoAuthByUid + * @param uid The UID associated with the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetDuoAuthByUidCall(String uid, 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 = "/identity/v2/manage/account/2fa/duo"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (uid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("uid", uid)); + } + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call resetDuoAuthByUidValidateBeforeCall(String uid, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling resetDuoAuthByUid(Async)"); + } + + return resetDuoAuthByUidCall(uid, _callback); + + } + + /** + * Reset Duo + * Resets the Duo Authenticator for the specified User. + * @param uid The UID associated with the User (required) + * @return IsDeleted + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + </table> + */ + public IsDeleted resetDuoAuthByUid(String uid) throws ApiException { + ApiResponse<IsDeleted> localVarResp = resetDuoAuthByUidWithHttpInfo(uid); + return localVarResp.getData(); + } + + /** + * Reset Duo + * Resets the Duo Authenticator for the specified User. + * @param uid The UID associated with the User (required) + * @return ApiResponse<IsDeleted> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsDeleted> resetDuoAuthByUidWithHttpInfo(String uid) throws ApiException { + okhttp3.Call localVarCall = resetDuoAuthByUidValidateBeforeCall(uid, null); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Reset Duo (asynchronously) + * Resets the Duo Authenticator for the specified User. + * @param uid The UID associated with the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetDuoAuthByUidAsync(String uid, final ApiCallback<IsDeleted> _callback) throws ApiException { + + okhttp3.Call localVarCall = resetDuoAuthByUidValidateBeforeCall(uid, _callback); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for resetEmailAuthenticatorByUid + * @param uid The UID associated with the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetEmailAuthenticatorByUidCall(String uid, 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 = "/identity/v2/manage/account/2fa/email"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (uid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("uid", uid)); + } + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call resetEmailAuthenticatorByUidValidateBeforeCall(String uid, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling resetEmailAuthenticatorByUid(Async)"); + } + + return resetEmailAuthenticatorByUidCall(uid, _callback); + + } + + /** + * Reset Email OTP + * Resets the Email OTP Authenticator for the specified User. + * @param uid The UID associated with the User (required) + * @return IsDeleted + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + </table> + */ + public IsDeleted resetEmailAuthenticatorByUid(String uid) throws ApiException { + ApiResponse<IsDeleted> localVarResp = resetEmailAuthenticatorByUidWithHttpInfo(uid); + return localVarResp.getData(); + } + + /** + * Reset Email OTP + * Resets the Email OTP Authenticator for the specified User. + * @param uid The UID associated with the User (required) + * @return ApiResponse<IsDeleted> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsDeleted> resetEmailAuthenticatorByUidWithHttpInfo(String uid) throws ApiException { + okhttp3.Call localVarCall = resetEmailAuthenticatorByUidValidateBeforeCall(uid, null); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Reset Email OTP (asynchronously) + * Resets the Email OTP Authenticator for the specified User. + * @param uid The UID associated with the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetEmailAuthenticatorByUidAsync(String uid, final ApiCallback<IsDeleted> _callback) throws ApiException { + + okhttp3.Call localVarCall = resetEmailAuthenticatorByUidValidateBeforeCall(uid, _callback); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for resetMfaPasskeyByUid + * @param uid The UID associated with the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetMfaPasskeyByUidCall(String uid, 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 = "/identity/v2/manage/account/2fa/passkey"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (uid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("uid", uid)); + } + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call resetMfaPasskeyByUidValidateBeforeCall(String uid, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling resetMfaPasskeyByUid(Async)"); + } + + return resetMfaPasskeyByUidCall(uid, _callback); + + } + + /** + * Reset MFA Passkey + * Resets the MFA Passkey for the specified User. + * @param uid The UID associated with the User (required) + * @return IsDeleted + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public IsDeleted resetMfaPasskeyByUid(String uid) throws ApiException { + ApiResponse<IsDeleted> localVarResp = resetMfaPasskeyByUidWithHttpInfo(uid); + return localVarResp.getData(); + } + + /** + * Reset MFA Passkey + * Resets the MFA Passkey for the specified User. + * @param uid The UID associated with the User (required) + * @return ApiResponse<IsDeleted> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsDeleted> resetMfaPasskeyByUidWithHttpInfo(String uid) throws ApiException { + okhttp3.Call localVarCall = resetMfaPasskeyByUidValidateBeforeCall(uid, null); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Reset MFA Passkey (asynchronously) + * Resets the MFA Passkey for the specified User. + * @param uid The UID associated with the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetMfaPasskeyByUidAsync(String uid, final ApiCallback<IsDeleted> _callback) throws ApiException { + + okhttp3.Call localVarCall = resetMfaPasskeyByUidValidateBeforeCall(uid, _callback); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for resetMfaPushByUid + * @param uid The UID associated with the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetMfaPushByUidCall(String uid, 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 = "/identity/v2/manage/account/2fa/push"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (uid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("uid", uid)); + } + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call resetMfaPushByUidValidateBeforeCall(String uid, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling resetMfaPushByUid(Async)"); + } + + return resetMfaPushByUidCall(uid, _callback); + + } + + /** + * Reset MFA Push Notification + * Resets the Push Notification Authenticator for the specified User. + * @param uid The UID associated with the User (required) + * @return IsDeleted + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + </table> + */ + public IsDeleted resetMfaPushByUid(String uid) throws ApiException { + ApiResponse<IsDeleted> localVarResp = resetMfaPushByUidWithHttpInfo(uid); + return localVarResp.getData(); + } + + /** + * Reset MFA Push Notification + * Resets the Push Notification Authenticator for the specified User. + * @param uid The UID associated with the User (required) + * @return ApiResponse<IsDeleted> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsDeleted> resetMfaPushByUidWithHttpInfo(String uid) throws ApiException { + okhttp3.Call localVarCall = resetMfaPushByUidValidateBeforeCall(uid, null); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Reset MFA Push Notification (asynchronously) + * Resets the Push Notification Authenticator for the specified User. + * @param uid The UID associated with the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetMfaPushByUidAsync(String uid, final ApiCallback<IsDeleted> _callback) throws ApiException { + + okhttp3.Call localVarCall = resetMfaPushByUidValidateBeforeCall(uid, _callback); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for validateSecondFactorTokenForPassword + * @param uid The UID associated with the User (required) + * @param eventBasedSecondFactorToken (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Second factor token successfully validated for step-up by Password </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call validateSecondFactorTokenForPasswordCall(String uid, EventBasedSecondFactorToken eventBasedSecondFactorToken, 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 = eventBasedSecondFactorToken; + + // create path and map variables + String localVarPath = "/identity/v2/manage/account/{uid}/reauth/password" + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call validateSecondFactorTokenForPasswordValidateBeforeCall(String uid, EventBasedSecondFactorToken eventBasedSecondFactorToken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling validateSecondFactorTokenForPassword(Async)"); + } + + // verify the required parameter 'eventBasedSecondFactorToken' is set + if (eventBasedSecondFactorToken == null) { + throw new ApiException("Missing the required parameter 'eventBasedSecondFactorToken' when calling validateSecondFactorTokenForPassword(Async)"); + } + + return validateSecondFactorTokenForPasswordCall(uid, eventBasedSecondFactorToken, _callback); + + } + + /** + * Verify Password MFA Token + * Validates and verifies the 'SecondFactorValidationToken' generated by the Step-Up Authenticate By Password API. + * @param uid The UID associated with the User (required) + * @param eventBasedSecondFactorToken (required) + * @return IsValid + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Second factor token successfully validated for step-up by Password </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public IsValid validateSecondFactorTokenForPassword(String uid, EventBasedSecondFactorToken eventBasedSecondFactorToken) throws ApiException { + ApiResponse<IsValid> localVarResp = validateSecondFactorTokenForPasswordWithHttpInfo(uid, eventBasedSecondFactorToken); + return localVarResp.getData(); + } + + /** + * Verify Password MFA Token + * Validates and verifies the 'SecondFactorValidationToken' generated by the Step-Up Authenticate By Password API. + * @param uid The UID associated with the User (required) + * @param eventBasedSecondFactorToken (required) + * @return ApiResponse<IsValid> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Second factor token successfully validated for step-up by Password </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsValid> validateSecondFactorTokenForPasswordWithHttpInfo(String uid, EventBasedSecondFactorToken eventBasedSecondFactorToken) throws ApiException { + okhttp3.Call localVarCall = validateSecondFactorTokenForPasswordValidateBeforeCall(uid, eventBasedSecondFactorToken, null); + Type localVarReturnType = new TypeToken<IsValid>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Verify Password MFA Token (asynchronously) + * Validates and verifies the 'SecondFactorValidationToken' generated by the Step-Up Authenticate By Password API. + * @param uid The UID associated with the User (required) + * @param eventBasedSecondFactorToken (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Second factor token successfully validated for step-up by Password </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call validateSecondFactorTokenForPasswordAsync(String uid, EventBasedSecondFactorToken eventBasedSecondFactorToken, final ApiCallback<IsValid> _callback) throws ApiException { + + okhttp3.Call localVarCall = validateSecondFactorTokenForPasswordValidateBeforeCall(uid, eventBasedSecondFactorToken, _callback); + Type localVarReturnType = new TypeToken<IsValid>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for validateSecondFactorTokenForPin + * @param uid The UID associated with the User (required) + * @param eventBasedSecondFactorToken (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Second factor token successfully validated for step-up by PIN </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call validateSecondFactorTokenForPinCall(String uid, EventBasedSecondFactorToken eventBasedSecondFactorToken, 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 = eventBasedSecondFactorToken; + + // create path and map variables + String localVarPath = "/identity/v2/manage/account/{uid}/reauth/pin" + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call validateSecondFactorTokenForPinValidateBeforeCall(String uid, EventBasedSecondFactorToken eventBasedSecondFactorToken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling validateSecondFactorTokenForPin(Async)"); + } + + // verify the required parameter 'eventBasedSecondFactorToken' is set + if (eventBasedSecondFactorToken == null) { + throw new ApiException("Missing the required parameter 'eventBasedSecondFactorToken' when calling validateSecondFactorTokenForPin(Async)"); + } + + return validateSecondFactorTokenForPinCall(uid, eventBasedSecondFactorToken, _callback); + + } + + /** + * Verify PIN MFA Token + * Validates and verifies the 'SecondFactorValidationToken' generated by the Step-Up Authenticate By PIN API. + * @param uid The UID associated with the User (required) + * @param eventBasedSecondFactorToken (required) + * @return IsValid + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Second factor token successfully validated for step-up by PIN </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public IsValid validateSecondFactorTokenForPin(String uid, EventBasedSecondFactorToken eventBasedSecondFactorToken) throws ApiException { + ApiResponse<IsValid> localVarResp = validateSecondFactorTokenForPinWithHttpInfo(uid, eventBasedSecondFactorToken); + return localVarResp.getData(); + } + + /** + * Verify PIN MFA Token + * Validates and verifies the 'SecondFactorValidationToken' generated by the Step-Up Authenticate By PIN API. + * @param uid The UID associated with the User (required) + * @param eventBasedSecondFactorToken (required) + * @return ApiResponse<IsValid> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Second factor token successfully validated for step-up by PIN </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsValid> validateSecondFactorTokenForPinWithHttpInfo(String uid, EventBasedSecondFactorToken eventBasedSecondFactorToken) throws ApiException { + okhttp3.Call localVarCall = validateSecondFactorTokenForPinValidateBeforeCall(uid, eventBasedSecondFactorToken, null); + Type localVarReturnType = new TypeToken<IsValid>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Verify PIN MFA Token (asynchronously) + * Validates and verifies the 'SecondFactorValidationToken' generated by the Step-Up Authenticate By PIN API. + * @param uid The UID associated with the User (required) + * @param eventBasedSecondFactorToken (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Second factor token successfully validated for step-up by PIN </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call validateSecondFactorTokenForPinAsync(String uid, EventBasedSecondFactorToken eventBasedSecondFactorToken, final ApiCallback<IsValid> _callback) throws ApiException { + + okhttp3.Call localVarCall = validateSecondFactorTokenForPinValidateBeforeCall(uid, eventBasedSecondFactorToken, _callback); + Type localVarReturnType = new TypeToken<IsValid>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/AccountSessionApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/AccountSessionApi.java new file mode 100644 index 0000000..a246b77 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/AccountSessionApi.java @@ -0,0 +1,1238 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.AccessTokenResponse; +import com.loginradius.sdk.internal.openapi.model.ActiveSessionResponse; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.ErrorResponseNative; +import com.loginradius.sdk.internal.openapi.model.IsDeleted; +import com.loginradius.sdk.internal.openapi.model.IsPostedResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class AccountSessionApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public AccountSessionApi() { + this(Configuration.getDefaultApiClient()); + } + + public AccountSessionApi(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 getAccessToken + * @param token (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok: The request was successful </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request was invalid or cannot be otherwise served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication or the provided credentials are invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAccessTokenCall(String token, 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 = "/api/v2/access_token"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (token != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("token", token)); + } + + 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[] { "XLoginRadiusAPISecret", "ApiSecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAccessTokenValidateBeforeCall(String token, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'token' is set + if (token == null) { + throw new ApiException("Missing the required parameter 'token' when calling getAccessToken(Async)"); + } + + return getAccessTokenCall(token, _callback); + + } + + /** + * Retrieve Access Token + * Translates the Request Token obtained during authentication into an Access Token for use with other API calls. + * @param token (required) + * @return AccessTokenResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok: The request was successful </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request was invalid or cannot be otherwise served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication or the provided credentials are invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public AccessTokenResponse getAccessToken(String token) throws ApiException { + ApiResponse<AccessTokenResponse> localVarResp = getAccessTokenWithHttpInfo(token); + return localVarResp.getData(); + } + + /** + * Retrieve Access Token + * Translates the Request Token obtained during authentication into an Access Token for use with other API calls. + * @param token (required) + * @return ApiResponse<AccessTokenResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok: The request was successful </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request was invalid or cannot be otherwise served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication or the provided credentials are invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<AccessTokenResponse> getAccessTokenWithHttpInfo(String token) throws ApiException { + okhttp3.Call localVarCall = getAccessTokenValidateBeforeCall(token, null); + Type localVarReturnType = new TypeToken<AccessTokenResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Access Token (asynchronously) + * Translates the Request Token obtained during authentication into an Access Token for use with other API calls. + * @param token (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok: The request was successful </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request was invalid or cannot be otherwise served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication or the provided credentials are invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAccessTokenAsync(String token, final ApiCallback<AccessTokenResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getAccessTokenValidateBeforeCall(token, _callback); + Type localVarReturnType = new TypeToken<AccessTokenResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getActiveSession + * @param token (optional) + * @param profileid Account ID of the User (optional) + * @param accountid Account ID of the User (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getActiveSessionCall(String token, String profileid, String accountid, 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 = "/api/v2/access_token/activesession"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (token != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("token", token)); + } + + if (profileid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("profileid", profileid)); + } + + if (accountid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("accountid", accountid)); + } + + 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[] { "APIKey", "XLoginRadiusAPIKey", "XLoginRadiusAPISecret", "ApiSecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getActiveSessionValidateBeforeCall(String token, String profileid, String accountid, final ApiCallback _callback) throws ApiException { + return getActiveSessionCall(token, profileid, accountid, _callback); + + } + + /** + * Retrieve active session + * Retrieves details of the current active session for the authenticated User. + * @param token (optional) + * @param profileid Account ID of the User (optional) + * @param accountid Account ID of the User (optional) + * @return ActiveSessionResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ActiveSessionResponse getActiveSession(String token, String profileid, String accountid) throws ApiException { + ApiResponse<ActiveSessionResponse> localVarResp = getActiveSessionWithHttpInfo(token, profileid, accountid); + return localVarResp.getData(); + } + + /** + * Retrieve active session + * Retrieves details of the current active session for the authenticated User. + * @param token (optional) + * @param profileid Account ID of the User (optional) + * @param accountid Account ID of the User (optional) + * @return ApiResponse<ActiveSessionResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<ActiveSessionResponse> getActiveSessionWithHttpInfo(String token, String profileid, String accountid) throws ApiException { + okhttp3.Call localVarCall = getActiveSessionValidateBeforeCall(token, profileid, accountid, null); + Type localVarReturnType = new TypeToken<ActiveSessionResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve active session (asynchronously) + * Retrieves details of the current active session for the authenticated User. + * @param token (optional) + * @param profileid Account ID of the User (optional) + * @param accountid Account ID of the User (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getActiveSessionAsync(String token, String profileid, String accountid, final ApiCallback<ActiveSessionResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getActiveSessionValidateBeforeCall(token, profileid, accountid, _callback); + Type localVarReturnType = new TypeToken<ActiveSessionResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for nativeInvalidateAccessToken + * @param accessToken Access Token of the User (optional) + * @param preventRefresh Whether to prevent the token from being refreshed (true/false). (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok: The request was successful </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call nativeInvalidateAccessTokenCall(String accessToken, Boolean preventRefresh, 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 = "/api/v2/access_token/invalidate"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (preventRefresh != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("preventRefresh", preventRefresh)); + } + + 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[] { "APIKey", "XLoginRadiusAPIKey", "XLoginRadiusAPISecret", "ApiSecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call nativeInvalidateAccessTokenValidateBeforeCall(String accessToken, Boolean preventRefresh, final ApiCallback _callback) throws ApiException { + return nativeInvalidateAccessTokenCall(accessToken, preventRefresh, _callback); + + } + + /** + * Invalidate Access Token + * Invalidates the specified Access Token, terminating its validity. + * @param accessToken Access Token of the User (optional) + * @param preventRefresh Whether to prevent the token from being refreshed (true/false). (optional) + * @return IsPostedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok: The request was successful </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public IsPostedResponse nativeInvalidateAccessToken(String accessToken, Boolean preventRefresh) throws ApiException { + ApiResponse<IsPostedResponse> localVarResp = nativeInvalidateAccessTokenWithHttpInfo(accessToken, preventRefresh); + return localVarResp.getData(); + } + + /** + * Invalidate Access Token + * Invalidates the specified Access Token, terminating its validity. + * @param accessToken Access Token of the User (optional) + * @param preventRefresh Whether to prevent the token from being refreshed (true/false). (optional) + * @return ApiResponse<IsPostedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok: The request was successful </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedResponse> nativeInvalidateAccessTokenWithHttpInfo(String accessToken, Boolean preventRefresh) throws ApiException { + okhttp3.Call localVarCall = nativeInvalidateAccessTokenValidateBeforeCall(accessToken, preventRefresh, null); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Invalidate Access Token (asynchronously) + * Invalidates the specified Access Token, terminating its validity. + * @param accessToken Access Token of the User (optional) + * @param preventRefresh Whether to prevent the token from being refreshed (true/false). (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok: The request was successful </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call nativeInvalidateAccessTokenAsync(String accessToken, Boolean preventRefresh, final ApiCallback<IsPostedResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = nativeInvalidateAccessTokenValidateBeforeCall(accessToken, preventRefresh, _callback); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for nativeRefreshAccessToken + * @param accessToken Access Token of the User (optional) + * @param isweb Indicates if the request is from a web client (optional) + * @param expiresin Overrides the default lifetime of the Access Token. The unit and the default applied when this parameter is omitted depend on the User's registration profile: * Email profiles: the value is interpreted in minutes. When omitted, the Access Token uses the application's configured token expiry. * Social login profiles: the value is interpreted in seconds. When omitted, the Access Token adopts the expiry returned by the social provider, falling back to the application's configured token expiry if the provider returns none. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call nativeRefreshAccessTokenCall(String accessToken, String isweb, Integer expiresin, 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 = "/api/v2/access_token/refresh"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (isweb != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("isweb", isweb)); + } + + if (expiresin != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("expiresin", expiresin)); + } + + 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[] { "XLoginRadiusAPISecret", "ApiSecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call nativeRefreshAccessTokenValidateBeforeCall(String accessToken, String isweb, Integer expiresin, final ApiCallback _callback) throws ApiException { + return nativeRefreshAccessTokenCall(accessToken, isweb, expiresin, _callback); + + } + + /** + * Refresh Access Token + * Refreshes the Access Token using a valid Refresh Token to extend session validity. The resulting token lifetime depends on the `expiresin` parameter and the User's registration profile (see the `expiresin` parameter). + * @param accessToken Access Token of the User (optional) + * @param isweb Indicates if the request is from a web client (optional) + * @param expiresin Overrides the default lifetime of the Access Token. The unit and the default applied when this parameter is omitted depend on the User's registration profile: * Email profiles: the value is interpreted in minutes. When omitted, the Access Token uses the application's configured token expiry. * Social login profiles: the value is interpreted in seconds. When omitted, the Access Token adopts the expiry returned by the social provider, falling back to the application's configured token expiry if the provider returns none. (optional) + * @return AccessTokenResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public AccessTokenResponse nativeRefreshAccessToken(String accessToken, String isweb, Integer expiresin) throws ApiException { + ApiResponse<AccessTokenResponse> localVarResp = nativeRefreshAccessTokenWithHttpInfo(accessToken, isweb, expiresin); + return localVarResp.getData(); + } + + /** + * Refresh Access Token + * Refreshes the Access Token using a valid Refresh Token to extend session validity. The resulting token lifetime depends on the `expiresin` parameter and the User's registration profile (see the `expiresin` parameter). + * @param accessToken Access Token of the User (optional) + * @param isweb Indicates if the request is from a web client (optional) + * @param expiresin Overrides the default lifetime of the Access Token. The unit and the default applied when this parameter is omitted depend on the User's registration profile: * Email profiles: the value is interpreted in minutes. When omitted, the Access Token uses the application's configured token expiry. * Social login profiles: the value is interpreted in seconds. When omitted, the Access Token adopts the expiry returned by the social provider, falling back to the application's configured token expiry if the provider returns none. (optional) + * @return ApiResponse<AccessTokenResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<AccessTokenResponse> nativeRefreshAccessTokenWithHttpInfo(String accessToken, String isweb, Integer expiresin) throws ApiException { + okhttp3.Call localVarCall = nativeRefreshAccessTokenValidateBeforeCall(accessToken, isweb, expiresin, null); + Type localVarReturnType = new TypeToken<AccessTokenResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Refresh Access Token (asynchronously) + * Refreshes the Access Token using a valid Refresh Token to extend session validity. The resulting token lifetime depends on the `expiresin` parameter and the User's registration profile (see the `expiresin` parameter). + * @param accessToken Access Token of the User (optional) + * @param isweb Indicates if the request is from a web client (optional) + * @param expiresin Overrides the default lifetime of the Access Token. The unit and the default applied when this parameter is omitted depend on the User's registration profile: * Email profiles: the value is interpreted in minutes. When omitted, the Access Token uses the application's configured token expiry. * Social login profiles: the value is interpreted in seconds. When omitted, the Access Token adopts the expiry returned by the social provider, falling back to the application's configured token expiry if the provider returns none. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call nativeRefreshAccessTokenAsync(String accessToken, String isweb, Integer expiresin, final ApiCallback<AccessTokenResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = nativeRefreshAccessTokenValidateBeforeCall(accessToken, isweb, expiresin, _callback); + Type localVarReturnType = new TypeToken<AccessTokenResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for refreshAccessToken + * @param refreshToken Refresh Token (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call refreshAccessTokenCall(String refreshToken, 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 = "/identity/v2/manage/account/access_token/refresh"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (refreshToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("refresh_token", refreshToken)); + } + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call refreshAccessTokenValidateBeforeCall(String refreshToken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'refreshToken' is set + if (refreshToken == null) { + throw new ApiException("Missing the required parameter 'refreshToken' when calling refreshAccessToken(Async)"); + } + + return refreshAccessTokenCall(refreshToken, _callback); + + } + + /** + * Refresh Access Token + * Refreshes the Access Token using a Refresh Token. + * @param refreshToken Refresh Token (required) + * @return AccessTokenResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public AccessTokenResponse refreshAccessToken(String refreshToken) throws ApiException { + ApiResponse<AccessTokenResponse> localVarResp = refreshAccessTokenWithHttpInfo(refreshToken); + return localVarResp.getData(); + } + + /** + * Refresh Access Token + * Refreshes the Access Token using a Refresh Token. + * @param refreshToken Refresh Token (required) + * @return ApiResponse<AccessTokenResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<AccessTokenResponse> refreshAccessTokenWithHttpInfo(String refreshToken) throws ApiException { + okhttp3.Call localVarCall = refreshAccessTokenValidateBeforeCall(refreshToken, null); + Type localVarReturnType = new TypeToken<AccessTokenResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Refresh Access Token (asynchronously) + * Refreshes the Access Token using a Refresh Token. + * @param refreshToken Refresh Token (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call refreshAccessTokenAsync(String refreshToken, final ApiCallback<AccessTokenResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = refreshAccessTokenValidateBeforeCall(refreshToken, _callback); + Type localVarReturnType = new TypeToken<AccessTokenResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for revokeAllRefreshToken + * @param uid The UID associated with the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call revokeAllRefreshTokenCall(String uid, 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 = "/identity/v2/manage/account/{uid}/access_token/refresh/revoke" + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call revokeAllRefreshTokenValidateBeforeCall(String uid, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling revokeAllRefreshToken(Async)"); + } + + return revokeAllRefreshTokenCall(uid, _callback); + + } + + /** + * Revoke refresh tokens + * Revokes all active refresh tokens for a specified User. + * @param uid The UID associated with the User (required) + * @return IsDeleted + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public IsDeleted revokeAllRefreshToken(String uid) throws ApiException { + ApiResponse<IsDeleted> localVarResp = revokeAllRefreshTokenWithHttpInfo(uid); + return localVarResp.getData(); + } + + /** + * Revoke refresh tokens + * Revokes all active refresh tokens for a specified User. + * @param uid The UID associated with the User (required) + * @return ApiResponse<IsDeleted> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsDeleted> revokeAllRefreshTokenWithHttpInfo(String uid) throws ApiException { + okhttp3.Call localVarCall = revokeAllRefreshTokenValidateBeforeCall(uid, null); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Revoke refresh tokens (asynchronously) + * Revokes all active refresh tokens for a specified User. + * @param uid The UID associated with the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call revokeAllRefreshTokenAsync(String uid, final ApiCallback<IsDeleted> _callback) throws ApiException { + + okhttp3.Call localVarCall = revokeAllRefreshTokenValidateBeforeCall(uid, _callback); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for revokeRefreshToken + * @param refreshToken Refresh Token (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call revokeRefreshTokenCall(String refreshToken, 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 = "/identity/v2/manage/account/access_token/refresh/revoke"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (refreshToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("refresh_token", refreshToken)); + } + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call revokeRefreshTokenValidateBeforeCall(String refreshToken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'refreshToken' is set + if (refreshToken == null) { + throw new ApiException("Missing the required parameter 'refreshToken' when calling revokeRefreshToken(Async)"); + } + + return revokeRefreshTokenCall(refreshToken, _callback); + + } + + /** + * Revoke Refresh Token + * Revokes the specified Refresh Token. + * @param refreshToken Refresh Token (required) + * @return IsDeleted + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public IsDeleted revokeRefreshToken(String refreshToken) throws ApiException { + ApiResponse<IsDeleted> localVarResp = revokeRefreshTokenWithHttpInfo(refreshToken); + return localVarResp.getData(); + } + + /** + * Revoke Refresh Token + * Revokes the specified Refresh Token. + * @param refreshToken Refresh Token (required) + * @return ApiResponse<IsDeleted> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsDeleted> revokeRefreshTokenWithHttpInfo(String refreshToken) throws ApiException { + okhttp3.Call localVarCall = revokeRefreshTokenValidateBeforeCall(refreshToken, null); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Revoke Refresh Token (asynchronously) + * Revokes the specified Refresh Token. + * @param refreshToken Refresh Token (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call revokeRefreshTokenAsync(String refreshToken, final ApiCallback<IsDeleted> _callback) throws ApiException { + + okhttp3.Call localVarCall = revokeRefreshTokenValidateBeforeCall(refreshToken, _callback); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for validateAccessToken + * @param accessToken Access Token of the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call validateAccessTokenCall(String accessToken, 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 = "/api/v2/access_token/validate"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + 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[] { "APIKey", "XLoginRadiusAPIKey", "XLoginRadiusAPISecret", "ApiSecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call validateAccessTokenValidateBeforeCall(String accessToken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'accessToken' is set + if (accessToken == null) { + throw new ApiException("Missing the required parameter 'accessToken' when calling validateAccessToken(Async)"); + } + + return validateAccessTokenCall(accessToken, _callback); + + } + + /** + * Validate Access Token + * Validates the provided Access Token to ensure its authenticity and validity. + * @param accessToken Access Token of the User (required) + * @return AccessTokenResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public AccessTokenResponse validateAccessToken(String accessToken) throws ApiException { + ApiResponse<AccessTokenResponse> localVarResp = validateAccessTokenWithHttpInfo(accessToken); + return localVarResp.getData(); + } + + /** + * Validate Access Token + * Validates the provided Access Token to ensure its authenticity and validity. + * @param accessToken Access Token of the User (required) + * @return ApiResponse<AccessTokenResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<AccessTokenResponse> validateAccessTokenWithHttpInfo(String accessToken) throws ApiException { + okhttp3.Call localVarCall = validateAccessTokenValidateBeforeCall(accessToken, null); + Type localVarReturnType = new TypeToken<AccessTokenResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Validate Access Token (asynchronously) + * Validates the provided Access Token to ensure its authenticity and validity. + * @param accessToken Access Token of the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call validateAccessTokenAsync(String accessToken, final ApiCallback<AccessTokenResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = validateAccessTokenValidateBeforeCall(accessToken, _callback); + Type localVarReturnType = new TypeToken<AccessTokenResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/AccountsApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/AccountsApi.java new file mode 100644 index 0000000..1820b71 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/AccountsApi.java @@ -0,0 +1,3213 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.AccessToken; +import com.loginradius.sdk.internal.openapi.model.ConsentLogsResponse; +import com.loginradius.sdk.internal.openapi.model.EmailModelManage; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.GenerateSottResponse; +import com.loginradius.sdk.internal.openapi.model.IdentitiesResponse; +import com.loginradius.sdk.internal.openapi.model.Identity; +import com.loginradius.sdk.internal.openapi.model.IdentityResponseWithSocialWithoutLogins; +import com.loginradius.sdk.internal.openapi.model.IsDeleted; +import com.loginradius.sdk.internal.openapi.model.IsDeletedResponseWithCount; +import com.loginradius.sdk.internal.openapi.model.IsPostedResponse; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModel; +import com.loginradius.sdk.internal.openapi.model.PasskeyListResponse; +import com.loginradius.sdk.internal.openapi.model.PasswordModel; +import com.loginradius.sdk.internal.openapi.model.PasswordResponse; +import com.loginradius.sdk.internal.openapi.model.PhoneModel; +import com.loginradius.sdk.internal.openapi.model.PrivacyPolicyHistoryResponse; +import com.loginradius.sdk.internal.openapi.model.UpsertEmailModel; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class AccountsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public AccountsApi() { + this(Configuration.getDefaultApiClient()); + } + + public AccountsApi(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 createUser + * @param manageRegisterModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> User account successfully created. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createUserCall(ManageRegisterModel manageRegisterModel, Boolean xPreventWebhook, Boolean preventWebhook, 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 = manageRegisterModel; + + // create path and map variables + String localVarPath = "/identity/v2/manage/account"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createUserValidateBeforeCall(ManageRegisterModel manageRegisterModel, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'manageRegisterModel' is set + if (manageRegisterModel == null) { + throw new ApiException("Missing the required parameter 'manageRegisterModel' when calling createUser(Async)"); + } + + return createUserCall(manageRegisterModel, xPreventWebhook, preventWebhook, _callback); + + } + + /** + * Create Account + * Creates a new Account with the provided details. + * @param manageRegisterModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return IdentityResponseWithSocialWithoutLogins + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> User account successfully created. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public IdentityResponseWithSocialWithoutLogins createUser(ManageRegisterModel manageRegisterModel, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + ApiResponse<IdentityResponseWithSocialWithoutLogins> localVarResp = createUserWithHttpInfo(manageRegisterModel, xPreventWebhook, preventWebhook); + return localVarResp.getData(); + } + + /** + * Create Account + * Creates a new Account with the provided details. + * @param manageRegisterModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<IdentityResponseWithSocialWithoutLogins> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> User account successfully created. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IdentityResponseWithSocialWithoutLogins> createUserWithHttpInfo(ManageRegisterModel manageRegisterModel, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + okhttp3.Call localVarCall = createUserValidateBeforeCall(manageRegisterModel, xPreventWebhook, preventWebhook, null); + Type localVarReturnType = new TypeToken<IdentityResponseWithSocialWithoutLogins>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Account (asynchronously) + * Creates a new Account with the provided details. + * @param manageRegisterModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> User account successfully created. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createUserAsync(ManageRegisterModel manageRegisterModel, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback<IdentityResponseWithSocialWithoutLogins> _callback) throws ApiException { + + okhttp3.Call localVarCall = createUserValidateBeforeCall(manageRegisterModel, xPreventWebhook, preventWebhook, _callback); + Type localVarReturnType = new TypeToken<IdentityResponseWithSocialWithoutLogins>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteAccountByEmail + * @param email Email address of the associated Account. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Account successfully deleted. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteAccountByEmailCall(String email, Boolean xPreventWebhook, Boolean preventWebhook, 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 = "/identity/v2/manage/account"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (email != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("email", email)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteAccountByEmailValidateBeforeCall(String email, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback _callback) throws ApiException { + return deleteAccountByEmailCall(email, xPreventWebhook, preventWebhook, _callback); + + } + + /** + * Delete Account by Email + * Deletes an Account based on the specified Email. + * @param email Email address of the associated Account. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return IsDeletedResponseWithCount + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Account successfully deleted. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public IsDeletedResponseWithCount deleteAccountByEmail(String email, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + ApiResponse<IsDeletedResponseWithCount> localVarResp = deleteAccountByEmailWithHttpInfo(email, xPreventWebhook, preventWebhook); + return localVarResp.getData(); + } + + /** + * Delete Account by Email + * Deletes an Account based on the specified Email. + * @param email Email address of the associated Account. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<IsDeletedResponseWithCount> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Account successfully deleted. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsDeletedResponseWithCount> deleteAccountByEmailWithHttpInfo(String email, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + okhttp3.Call localVarCall = deleteAccountByEmailValidateBeforeCall(email, xPreventWebhook, preventWebhook, null); + Type localVarReturnType = new TypeToken<IsDeletedResponseWithCount>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Account by Email (asynchronously) + * Deletes an Account based on the specified Email. + * @param email Email address of the associated Account. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Account successfully deleted. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteAccountByEmailAsync(String email, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback<IsDeletedResponseWithCount> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteAccountByEmailValidateBeforeCall(email, xPreventWebhook, preventWebhook, _callback); + Type localVarReturnType = new TypeToken<IsDeletedResponseWithCount>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteAccountByUID + * @param uid The UID associated with the User (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Account successfully deleted. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteAccountByUIDCall(String uid, Boolean xPreventWebhook, Boolean preventWebhook, 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 = "/identity/v2/manage/account/{uid}" + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteAccountByUIDValidateBeforeCall(String uid, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling deleteAccountByUID(Async)"); + } + + return deleteAccountByUIDCall(uid, xPreventWebhook, preventWebhook, _callback); + + } + + /** + * Delete Account by UID + * Deletes an Account based on the specified UID. + * @param uid The UID associated with the User (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return IsDeletedResponseWithCount + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Account successfully deleted. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public IsDeletedResponseWithCount deleteAccountByUID(String uid, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + ApiResponse<IsDeletedResponseWithCount> localVarResp = deleteAccountByUIDWithHttpInfo(uid, xPreventWebhook, preventWebhook); + return localVarResp.getData(); + } + + /** + * Delete Account by UID + * Deletes an Account based on the specified UID. + * @param uid The UID associated with the User (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<IsDeletedResponseWithCount> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Account successfully deleted. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsDeletedResponseWithCount> deleteAccountByUIDWithHttpInfo(String uid, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + okhttp3.Call localVarCall = deleteAccountByUIDValidateBeforeCall(uid, xPreventWebhook, preventWebhook, null); + Type localVarReturnType = new TypeToken<IsDeletedResponseWithCount>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Account by UID (asynchronously) + * Deletes an Account based on the specified UID. + * @param uid The UID associated with the User (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Account successfully deleted. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteAccountByUIDAsync(String uid, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback<IsDeletedResponseWithCount> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteAccountByUIDValidateBeforeCall(uid, xPreventWebhook, preventWebhook, _callback); + Type localVarReturnType = new TypeToken<IsDeletedResponseWithCount>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteEmailFromAccount + * @param uid The UID associated with the User (required) + * @param emailModelManage (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Email successfully deleted from the Account. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteEmailFromAccountCall(String uid, EmailModelManage emailModelManage, Boolean xPreventWebhook, Boolean preventWebhook, 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 = emailModelManage; + + // create path and map variables + String localVarPath = "/identity/v2/manage/account/{uid}/email" + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteEmailFromAccountValidateBeforeCall(String uid, EmailModelManage emailModelManage, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling deleteEmailFromAccount(Async)"); + } + + // verify the required parameter 'emailModelManage' is set + if (emailModelManage == null) { + throw new ApiException("Missing the required parameter 'emailModelManage' when calling deleteEmailFromAccount(Async)"); + } + + return deleteEmailFromAccountCall(uid, emailModelManage, xPreventWebhook, preventWebhook, _callback); + + } + + /** + * Delete Email + * Removes an Email from an Account. + * @param uid The UID associated with the User (required) + * @param emailModelManage (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return Identity + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Email successfully deleted from the Account. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public Identity deleteEmailFromAccount(String uid, EmailModelManage emailModelManage, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + ApiResponse<Identity> localVarResp = deleteEmailFromAccountWithHttpInfo(uid, emailModelManage, xPreventWebhook, preventWebhook); + return localVarResp.getData(); + } + + /** + * Delete Email + * Removes an Email from an Account. + * @param uid The UID associated with the User (required) + * @param emailModelManage (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<Identity> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Email successfully deleted from the Account. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public ApiResponse<Identity> deleteEmailFromAccountWithHttpInfo(String uid, EmailModelManage emailModelManage, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + okhttp3.Call localVarCall = deleteEmailFromAccountValidateBeforeCall(uid, emailModelManage, xPreventWebhook, preventWebhook, null); + Type localVarReturnType = new TypeToken<Identity>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Email (asynchronously) + * Removes an Email from an Account. + * @param uid The UID associated with the User (required) + * @param emailModelManage (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Email successfully deleted from the Account. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteEmailFromAccountAsync(String uid, EmailModelManage emailModelManage, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback<Identity> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteEmailFromAccountValidateBeforeCall(uid, emailModelManage, xPreventWebhook, preventWebhook, _callback); + Type localVarReturnType = new TypeToken<Identity>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deletePasskeyByUid + * @param uid The UID associated with the User (required) + * @param passkeyId Id asscociated with the Passkey (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deletePasskeyByUidCall(String uid, String passkeyId, 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 = "/identity/v2/manage/account/passkey/{passkeyId}" + .replace("{" + "passkeyId" + "}", localVarApiClient.escapeString(passkeyId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (uid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("uid", uid)); + } + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deletePasskeyByUidValidateBeforeCall(String uid, String passkeyId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling deletePasskeyByUid(Async)"); + } + + // verify the required parameter 'passkeyId' is set + if (passkeyId == null) { + throw new ApiException("Missing the required parameter 'passkeyId' when calling deletePasskeyByUid(Async)"); + } + + return deletePasskeyByUidCall(uid, passkeyId, _callback); + + } + + /** + * Delete Passkey + * Removes configured Passkey for specified User. + * @param uid The UID associated with the User (required) + * @param passkeyId Id asscociated with the Passkey (required) + * @return IsDeleted + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public IsDeleted deletePasskeyByUid(String uid, String passkeyId) throws ApiException { + ApiResponse<IsDeleted> localVarResp = deletePasskeyByUidWithHttpInfo(uid, passkeyId); + return localVarResp.getData(); + } + + /** + * Delete Passkey + * Removes configured Passkey for specified User. + * @param uid The UID associated with the User (required) + * @param passkeyId Id asscociated with the Passkey (required) + * @return ApiResponse<IsDeleted> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsDeleted> deletePasskeyByUidWithHttpInfo(String uid, String passkeyId) throws ApiException { + okhttp3.Call localVarCall = deletePasskeyByUidValidateBeforeCall(uid, passkeyId, null); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Passkey (asynchronously) + * Removes configured Passkey for specified User. + * @param uid The UID associated with the User (required) + * @param passkeyId Id asscociated with the Passkey (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deletePasskeyByUidAsync(String uid, String passkeyId, final ApiCallback<IsDeleted> _callback) throws ApiException { + + okhttp3.Call localVarCall = deletePasskeyByUidValidateBeforeCall(uid, passkeyId, _callback); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for generateSott + * @param timedifference The time difference you would like to pass. If no value is passed, the default value is 10 minutes. (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> SOTT generated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires application authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call generateSottCall(String timedifference, 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 = "/identity/v2/manage/account/sott"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (timedifference != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("timedifference", timedifference)); + } + + 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[] { "APIKey", "XLoginRadiusAPIKey", "XLoginRadiusAPISecret", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call generateSottValidateBeforeCall(String timedifference, final ApiCallback _callback) throws ApiException { + return generateSottCall(timedifference, _callback); + + } + + /** + * Generate SOTT + * Generates a Secure One Time Token (SOTT) with a given expiration time. + * @param timedifference The time difference you would like to pass. If no value is passed, the default value is 10 minutes. (optional, default to 10) + * @return GenerateSottResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> SOTT generated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires application authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public GenerateSottResponse generateSott(String timedifference) throws ApiException { + ApiResponse<GenerateSottResponse> localVarResp = generateSottWithHttpInfo(timedifference); + return localVarResp.getData(); + } + + /** + * Generate SOTT + * Generates a Secure One Time Token (SOTT) with a given expiration time. + * @param timedifference The time difference you would like to pass. If no value is passed, the default value is 10 minutes. (optional, default to 10) + * @return ApiResponse<GenerateSottResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> SOTT generated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires application authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GenerateSottResponse> generateSottWithHttpInfo(String timedifference) throws ApiException { + okhttp3.Call localVarCall = generateSottValidateBeforeCall(timedifference, null); + Type localVarReturnType = new TypeToken<GenerateSottResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Generate SOTT (asynchronously) + * Generates a Secure One Time Token (SOTT) with a given expiration time. + * @param timedifference The time difference you would like to pass. If no value is passed, the default value is 10 minutes. (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> SOTT generated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires application authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call generateSottAsync(String timedifference, final ApiCallback<GenerateSottResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = generateSottValidateBeforeCall(timedifference, _callback); + Type localVarReturnType = new TypeToken<GenerateSottResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAccountIdentity + * @param email Email address of the associated Account. (optional) + * @param username Username of the associated Account. (optional) + * @param phone Phone ID of the associated Account. (optional) + * @param q Query filter in `key:value` format. The key must be an indexed profile field. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Account Identity retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAccountIdentityCall(String email, String username, String phone, String q, Boolean xPreventWebhook, Boolean preventWebhook, 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 = "/identity/v2/manage/account"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (email != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("email", email)); + } + + if (username != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("username", username)); + } + + if (phone != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("phone", phone)); + } + + if (q != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("q", q)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAccountIdentityValidateBeforeCall(String email, String username, String phone, String q, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback _callback) throws ApiException { + return getAccountIdentityCall(email, username, phone, q, xPreventWebhook, preventWebhook, _callback); + + } + + /** + * Retrieve Account + * Retrieves Account Identity details using Email, Username, Phone, or Query parameter. + * @param email Email address of the associated Account. (optional) + * @param username Username of the associated Account. (optional) + * @param phone Phone ID of the associated Account. (optional) + * @param q Query filter in `key:value` format. The key must be an indexed profile field. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return IdentityResponseWithSocialWithoutLogins + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Account Identity retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public IdentityResponseWithSocialWithoutLogins getAccountIdentity(String email, String username, String phone, String q, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + ApiResponse<IdentityResponseWithSocialWithoutLogins> localVarResp = getAccountIdentityWithHttpInfo(email, username, phone, q, xPreventWebhook, preventWebhook); + return localVarResp.getData(); + } + + /** + * Retrieve Account + * Retrieves Account Identity details using Email, Username, Phone, or Query parameter. + * @param email Email address of the associated Account. (optional) + * @param username Username of the associated Account. (optional) + * @param phone Phone ID of the associated Account. (optional) + * @param q Query filter in `key:value` format. The key must be an indexed profile field. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<IdentityResponseWithSocialWithoutLogins> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Account Identity retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IdentityResponseWithSocialWithoutLogins> getAccountIdentityWithHttpInfo(String email, String username, String phone, String q, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + okhttp3.Call localVarCall = getAccountIdentityValidateBeforeCall(email, username, phone, q, xPreventWebhook, preventWebhook, null); + Type localVarReturnType = new TypeToken<IdentityResponseWithSocialWithoutLogins>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Account (asynchronously) + * Retrieves Account Identity details using Email, Username, Phone, or Query parameter. + * @param email Email address of the associated Account. (optional) + * @param username Username of the associated Account. (optional) + * @param phone Phone ID of the associated Account. (optional) + * @param q Query filter in `key:value` format. The key must be an indexed profile field. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Account Identity retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAccountIdentityAsync(String email, String username, String phone, String q, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback<IdentityResponseWithSocialWithoutLogins> _callback) throws ApiException { + + okhttp3.Call localVarCall = getAccountIdentityValidateBeforeCall(email, username, phone, q, xPreventWebhook, preventWebhook, _callback); + Type localVarReturnType = new TypeToken<IdentityResponseWithSocialWithoutLogins>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAccountIdentityByUID + * @param uid The UID associated with the User (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Account Identity retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAccountIdentityByUIDCall(String uid, Boolean xPreventWebhook, Boolean preventWebhook, 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 = "/identity/v2/manage/account/{uid}" + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAccountIdentityByUIDValidateBeforeCall(String uid, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling getAccountIdentityByUID(Async)"); + } + + return getAccountIdentityByUIDCall(uid, xPreventWebhook, preventWebhook, _callback); + + } + + /** + * Retrieve Account by UID + * Retrieves Account Identity details using the UID. + * @param uid The UID associated with the User (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return IdentityResponseWithSocialWithoutLogins + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Account Identity retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public IdentityResponseWithSocialWithoutLogins getAccountIdentityByUID(String uid, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + ApiResponse<IdentityResponseWithSocialWithoutLogins> localVarResp = getAccountIdentityByUIDWithHttpInfo(uid, xPreventWebhook, preventWebhook); + return localVarResp.getData(); + } + + /** + * Retrieve Account by UID + * Retrieves Account Identity details using the UID. + * @param uid The UID associated with the User (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<IdentityResponseWithSocialWithoutLogins> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Account Identity retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IdentityResponseWithSocialWithoutLogins> getAccountIdentityByUIDWithHttpInfo(String uid, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + okhttp3.Call localVarCall = getAccountIdentityByUIDValidateBeforeCall(uid, xPreventWebhook, preventWebhook, null); + Type localVarReturnType = new TypeToken<IdentityResponseWithSocialWithoutLogins>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Account by UID (asynchronously) + * Retrieves Account Identity details using the UID. + * @param uid The UID associated with the User (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Account Identity retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAccountIdentityByUIDAsync(String uid, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback<IdentityResponseWithSocialWithoutLogins> _callback) throws ApiException { + + okhttp3.Call localVarCall = getAccountIdentityByUIDValidateBeforeCall(uid, xPreventWebhook, preventWebhook, _callback); + Type localVarReturnType = new TypeToken<IdentityResponseWithSocialWithoutLogins>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getConsentLogsByUid + * @param uid The UID associated with the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getConsentLogsByUidCall(String uid, 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 = "/identity/v2/manage/account/{uid}/consent/logs" + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getConsentLogsByUidValidateBeforeCall(String uid, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling getConsentLogsByUid(Async)"); + } + + return getConsentLogsByUidCall(uid, _callback); + + } + + /** + * Retrieve Consent Logs + * Retrieves Consent Management logs for the specified User. + * @param uid The UID associated with the User (required) + * @return ConsentLogsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ConsentLogsResponse getConsentLogsByUid(String uid) throws ApiException { + ApiResponse<ConsentLogsResponse> localVarResp = getConsentLogsByUidWithHttpInfo(uid); + return localVarResp.getData(); + } + + /** + * Retrieve Consent Logs + * Retrieves Consent Management logs for the specified User. + * @param uid The UID associated with the User (required) + * @return ApiResponse<ConsentLogsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<ConsentLogsResponse> getConsentLogsByUidWithHttpInfo(String uid) throws ApiException { + okhttp3.Call localVarCall = getConsentLogsByUidValidateBeforeCall(uid, null); + Type localVarReturnType = new TypeToken<ConsentLogsResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Consent Logs (asynchronously) + * Retrieves Consent Management logs for the specified User. + * @param uid The UID associated with the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getConsentLogsByUidAsync(String uid, final ApiCallback<ConsentLogsResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getConsentLogsByUidValidateBeforeCall(uid, _callback); + Type localVarReturnType = new TypeToken<ConsentLogsResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getIdentities + * @param email Email address of the associated Account. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> User Identities retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getIdentitiesCall(String email, String fields, 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 = "/identity/v2/manage/account/identities"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (email != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("email", email)); + } + + if (fields != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fields", fields)); + } + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getIdentitiesValidateBeforeCall(String email, String fields, final ApiCallback _callback) throws ApiException { + return getIdentitiesCall(email, fields, _callback); + + } + + /** + * Retrieve Account by Email + * Retrieves Account associated with a specified Email. + * @param email Email address of the associated Account. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @return IdentitiesResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> User Identities retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public IdentitiesResponse getIdentities(String email, String fields) throws ApiException { + ApiResponse<IdentitiesResponse> localVarResp = getIdentitiesWithHttpInfo(email, fields); + return localVarResp.getData(); + } + + /** + * Retrieve Account by Email + * Retrieves Account associated with a specified Email. + * @param email Email address of the associated Account. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @return ApiResponse<IdentitiesResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> User Identities retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IdentitiesResponse> getIdentitiesWithHttpInfo(String email, String fields) throws ApiException { + okhttp3.Call localVarCall = getIdentitiesValidateBeforeCall(email, fields, null); + Type localVarReturnType = new TypeToken<IdentitiesResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Account by Email (asynchronously) + * Retrieves Account associated with a specified Email. + * @param email Email address of the associated Account. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> User Identities retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getIdentitiesAsync(String email, String fields, final ApiCallback<IdentitiesResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getIdentitiesValidateBeforeCall(email, fields, _callback); + Type localVarReturnType = new TypeToken<IdentitiesResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getImpersonationToken + * @param uid The UID associated with the User (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Impersonation token retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getImpersonationTokenCall(String uid, Boolean xPreventWebhook, Boolean preventWebhook, 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 = "/identity/v2/manage/account/access_token"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (uid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("uid", uid)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getImpersonationTokenValidateBeforeCall(String uid, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling getImpersonationToken(Async)"); + } + + return getImpersonationTokenCall(uid, xPreventWebhook, preventWebhook, _callback); + + } + + /** + * Retrieve Impersonation Token + * Retrieves an Impersonation Token for an Account using the UID. + * @param uid The UID associated with the User (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return AccessToken + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Impersonation token retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public AccessToken getImpersonationToken(String uid, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + ApiResponse<AccessToken> localVarResp = getImpersonationTokenWithHttpInfo(uid, xPreventWebhook, preventWebhook); + return localVarResp.getData(); + } + + /** + * Retrieve Impersonation Token + * Retrieves an Impersonation Token for an Account using the UID. + * @param uid The UID associated with the User (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<AccessToken> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Impersonation token retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public ApiResponse<AccessToken> getImpersonationTokenWithHttpInfo(String uid, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + okhttp3.Call localVarCall = getImpersonationTokenValidateBeforeCall(uid, xPreventWebhook, preventWebhook, null); + Type localVarReturnType = new TypeToken<AccessToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Impersonation Token (asynchronously) + * Retrieves an Impersonation Token for an Account using the UID. + * @param uid The UID associated with the User (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Impersonation token retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getImpersonationTokenAsync(String uid, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback<AccessToken> _callback) throws ApiException { + + okhttp3.Call localVarCall = getImpersonationTokenValidateBeforeCall(uid, xPreventWebhook, preventWebhook, _callback); + Type localVarReturnType = new TypeToken<AccessToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPrivacyPolicyHistoryByUid + * @param uid The UID associated with the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Privacy Policy History retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getPrivacyPolicyHistoryByUidCall(String uid, 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 = "/identity/v2/manage/account/{uid}/privacypolicy/history" + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPrivacyPolicyHistoryByUidValidateBeforeCall(String uid, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling getPrivacyPolicyHistoryByUid(Async)"); + } + + return getPrivacyPolicyHistoryByUidCall(uid, _callback); + + } + + /** + * Retrieve Privacy Policy History + * Retrieves the Privacy Policy acceptance history for an Account by UID. + * @param uid The UID associated with the User (required) + * @return PrivacyPolicyHistoryResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Privacy Policy History retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public PrivacyPolicyHistoryResponse getPrivacyPolicyHistoryByUid(String uid) throws ApiException { + ApiResponse<PrivacyPolicyHistoryResponse> localVarResp = getPrivacyPolicyHistoryByUidWithHttpInfo(uid); + return localVarResp.getData(); + } + + /** + * Retrieve Privacy Policy History + * Retrieves the Privacy Policy acceptance history for an Account by UID. + * @param uid The UID associated with the User (required) + * @return ApiResponse<PrivacyPolicyHistoryResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Privacy Policy History retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public ApiResponse<PrivacyPolicyHistoryResponse> getPrivacyPolicyHistoryByUidWithHttpInfo(String uid) throws ApiException { + okhttp3.Call localVarCall = getPrivacyPolicyHistoryByUidValidateBeforeCall(uid, null); + Type localVarReturnType = new TypeToken<PrivacyPolicyHistoryResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Privacy Policy History (asynchronously) + * Retrieves the Privacy Policy acceptance history for an Account by UID. + * @param uid The UID associated with the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Privacy Policy History retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getPrivacyPolicyHistoryByUidAsync(String uid, final ApiCallback<PrivacyPolicyHistoryResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getPrivacyPolicyHistoryByUidValidateBeforeCall(uid, _callback); + Type localVarReturnType = new TypeToken<PrivacyPolicyHistoryResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getProfilePassword + * @param uid The UID associated with the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Password details retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getProfilePasswordCall(String uid, 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 = "/identity/v2/manage/account/{uid}/password" + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getProfilePasswordValidateBeforeCall(String uid, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling getProfilePassword(Async)"); + } + + return getProfilePasswordCall(uid, _callback); + + } + + /** + * Retrieve Password + * Retrieves the Password details for an Account using the UID. + * @param uid The UID associated with the User (required) + * @return PasswordResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Password details retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public PasswordResponse getProfilePassword(String uid) throws ApiException { + ApiResponse<PasswordResponse> localVarResp = getProfilePasswordWithHttpInfo(uid); + return localVarResp.getData(); + } + + /** + * Retrieve Password + * Retrieves the Password details for an Account using the UID. + * @param uid The UID associated with the User (required) + * @return ApiResponse<PasswordResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Password details retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public ApiResponse<PasswordResponse> getProfilePasswordWithHttpInfo(String uid) throws ApiException { + okhttp3.Call localVarCall = getProfilePasswordValidateBeforeCall(uid, null); + Type localVarReturnType = new TypeToken<PasswordResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Password (asynchronously) + * Retrieves the Password details for an Account using the UID. + * @param uid The UID associated with the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Password details retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getProfilePasswordAsync(String uid, final ApiCallback<PasswordResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getProfilePasswordValidateBeforeCall(uid, _callback); + Type localVarReturnType = new TypeToken<PasswordResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for invalidateEmailVerification + * @param uid The UID associated with the User (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Email Verification status invalidated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call invalidateEmailVerificationCall(String uid, Boolean xPreventWebhook, Boolean preventWebhook, String emailtemplate, String verificationurl, 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 = "/identity/v2/manage/account/{uid}/invalidateemail" + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (emailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailtemplate", emailtemplate)); + } + + if (verificationurl != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("verificationurl", verificationurl)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call invalidateEmailVerificationValidateBeforeCall(String uid, Boolean xPreventWebhook, Boolean preventWebhook, String emailtemplate, String verificationurl, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling invalidateEmailVerification(Async)"); + } + + return invalidateEmailVerificationCall(uid, xPreventWebhook, preventWebhook, emailtemplate, verificationurl, _callback); + + } + + /** + * Invalidate Email Verification + * Invalidates the Email Verification status for an Account using the UID. + * @param uid The UID associated with the User (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @return IsPostedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Email Verification status invalidated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public IsPostedResponse invalidateEmailVerification(String uid, Boolean xPreventWebhook, Boolean preventWebhook, String emailtemplate, String verificationurl) throws ApiException { + ApiResponse<IsPostedResponse> localVarResp = invalidateEmailVerificationWithHttpInfo(uid, xPreventWebhook, preventWebhook, emailtemplate, verificationurl); + return localVarResp.getData(); + } + + /** + * Invalidate Email Verification + * Invalidates the Email Verification status for an Account using the UID. + * @param uid The UID associated with the User (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @return ApiResponse<IsPostedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Email Verification status invalidated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedResponse> invalidateEmailVerificationWithHttpInfo(String uid, Boolean xPreventWebhook, Boolean preventWebhook, String emailtemplate, String verificationurl) throws ApiException { + okhttp3.Call localVarCall = invalidateEmailVerificationValidateBeforeCall(uid, xPreventWebhook, preventWebhook, emailtemplate, verificationurl, null); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Invalidate Email Verification (asynchronously) + * Invalidates the Email Verification status for an Account using the UID. + * @param uid The UID associated with the User (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Email Verification status invalidated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call invalidateEmailVerificationAsync(String uid, Boolean xPreventWebhook, Boolean preventWebhook, String emailtemplate, String verificationurl, final ApiCallback<IsPostedResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = invalidateEmailVerificationValidateBeforeCall(uid, xPreventWebhook, preventWebhook, emailtemplate, verificationurl, _callback); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listPasskeyUser + * @param uid The UID associated with the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call listPasskeyUserCall(String uid, 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 = "/identity/v2/manage/account/passkey"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (uid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("uid", uid)); + } + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listPasskeyUserValidateBeforeCall(String uid, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling listPasskeyUser(Async)"); + } + + return listPasskeyUserCall(uid, _callback); + + } + + /** + * List Passkeys + * Retrieves a list of Passkeys configured for a specified User. + * @param uid The UID associated with the User (required) + * @return PasskeyListResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public PasskeyListResponse listPasskeyUser(String uid) throws ApiException { + ApiResponse<PasskeyListResponse> localVarResp = listPasskeyUserWithHttpInfo(uid); + return localVarResp.getData(); + } + + /** + * List Passkeys + * Retrieves a list of Passkeys configured for a specified User. + * @param uid The UID associated with the User (required) + * @return ApiResponse<PasskeyListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<PasskeyListResponse> listPasskeyUserWithHttpInfo(String uid) throws ApiException { + okhttp3.Call localVarCall = listPasskeyUserValidateBeforeCall(uid, null); + Type localVarReturnType = new TypeToken<PasskeyListResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Passkeys (asynchronously) + * Retrieves a list of Passkeys configured for a specified User. + * @param uid The UID associated with the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call listPasskeyUserAsync(String uid, final ApiCallback<PasskeyListResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = listPasskeyUserValidateBeforeCall(uid, _callback); + Type localVarReturnType = new TypeToken<PasskeyListResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for resetPhoneVerification + * @param uid The UID associated with the User (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param smstemplate SMS Template (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Phone verification status reset successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetPhoneVerificationCall(String uid, Boolean xPreventWebhook, Boolean preventWebhook, String smstemplate, Boolean isvoiceotp, 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 = "/identity/v2/manage/account/{uid}/invalidatephone" + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (smstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("smstemplate", smstemplate)); + } + + if (isvoiceotp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("isvoiceotp", isvoiceotp)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call resetPhoneVerificationValidateBeforeCall(String uid, Boolean xPreventWebhook, Boolean preventWebhook, String smstemplate, Boolean isvoiceotp, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling resetPhoneVerification(Async)"); + } + + return resetPhoneVerificationCall(uid, xPreventWebhook, preventWebhook, smstemplate, isvoiceotp, _callback); + + } + + /** + * Invalidate Phone verification + * Resets the Phone verification status for an Account using the UID. + * @param uid The UID associated with the User (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param smstemplate SMS Template (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @return IsPostedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Phone verification status reset successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public IsPostedResponse resetPhoneVerification(String uid, Boolean xPreventWebhook, Boolean preventWebhook, String smstemplate, Boolean isvoiceotp) throws ApiException { + ApiResponse<IsPostedResponse> localVarResp = resetPhoneVerificationWithHttpInfo(uid, xPreventWebhook, preventWebhook, smstemplate, isvoiceotp); + return localVarResp.getData(); + } + + /** + * Invalidate Phone verification + * Resets the Phone verification status for an Account using the UID. + * @param uid The UID associated with the User (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param smstemplate SMS Template (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @return ApiResponse<IsPostedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Phone verification status reset successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedResponse> resetPhoneVerificationWithHttpInfo(String uid, Boolean xPreventWebhook, Boolean preventWebhook, String smstemplate, Boolean isvoiceotp) throws ApiException { + okhttp3.Call localVarCall = resetPhoneVerificationValidateBeforeCall(uid, xPreventWebhook, preventWebhook, smstemplate, isvoiceotp, null); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Invalidate Phone verification (asynchronously) + * Resets the Phone verification status for an Account using the UID. + * @param uid The UID associated with the User (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param smstemplate SMS Template (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Phone verification status reset successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetPhoneVerificationAsync(String uid, Boolean xPreventWebhook, Boolean preventWebhook, String smstemplate, Boolean isvoiceotp, final ApiCallback<IsPostedResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = resetPhoneVerificationValidateBeforeCall(uid, xPreventWebhook, preventWebhook, smstemplate, isvoiceotp, _callback); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for setProfilePassword + * @param uid The UID associated with the User (required) + * @param passwordModel (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Password successfully set for the Account. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call setProfilePasswordCall(String uid, PasswordModel passwordModel, 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 = passwordModel; + + // create path and map variables + String localVarPath = "/identity/v2/manage/account/{uid}/password" + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call setProfilePasswordValidateBeforeCall(String uid, PasswordModel passwordModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling setProfilePassword(Async)"); + } + + // verify the required parameter 'passwordModel' is set + if (passwordModel == null) { + throw new ApiException("Missing the required parameter 'passwordModel' when calling setProfilePassword(Async)"); + } + + return setProfilePasswordCall(uid, passwordModel, _callback); + + } + + /** + * Update Password + * Sets or updates the Password for an Account using the UID. + * @param uid The UID associated with the User (required) + * @param passwordModel (required) + * @return PasswordResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Password successfully set for the Account. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public PasswordResponse setProfilePassword(String uid, PasswordModel passwordModel) throws ApiException { + ApiResponse<PasswordResponse> localVarResp = setProfilePasswordWithHttpInfo(uid, passwordModel); + return localVarResp.getData(); + } + + /** + * Update Password + * Sets or updates the Password for an Account using the UID. + * @param uid The UID associated with the User (required) + * @param passwordModel (required) + * @return ApiResponse<PasswordResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Password successfully set for the Account. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public ApiResponse<PasswordResponse> setProfilePasswordWithHttpInfo(String uid, PasswordModel passwordModel) throws ApiException { + okhttp3.Call localVarCall = setProfilePasswordValidateBeforeCall(uid, passwordModel, null); + Type localVarReturnType = new TypeToken<PasswordResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Password (asynchronously) + * Sets or updates the Password for an Account using the UID. + * @param uid The UID associated with the User (required) + * @param passwordModel (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Password successfully set for the Account. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call setProfilePasswordAsync(String uid, PasswordModel passwordModel, final ApiCallback<PasswordResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = setProfilePasswordValidateBeforeCall(uid, passwordModel, _callback); + Type localVarReturnType = new TypeToken<PasswordResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateAccountProfileByUID + * @param uid The UID associated with the User (required) + * @param manageRegisterModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param nullsupport Bool flag, if this flag is sent as true then the fields which are send in payload as null then in the profile as well that will be saved as null only (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Account profile updated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateAccountProfileByUIDCall(String uid, ManageRegisterModel manageRegisterModel, Boolean xPreventWebhook, Boolean preventWebhook, Boolean nullsupport, 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 = manageRegisterModel; + + // create path and map variables + String localVarPath = "/identity/v2/manage/account/{uid}" + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (nullsupport != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("nullsupport", nullsupport)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateAccountProfileByUIDValidateBeforeCall(String uid, ManageRegisterModel manageRegisterModel, Boolean xPreventWebhook, Boolean preventWebhook, Boolean nullsupport, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling updateAccountProfileByUID(Async)"); + } + + // verify the required parameter 'manageRegisterModel' is set + if (manageRegisterModel == null) { + throw new ApiException("Missing the required parameter 'manageRegisterModel' when calling updateAccountProfileByUID(Async)"); + } + + return updateAccountProfileByUIDCall(uid, manageRegisterModel, xPreventWebhook, preventWebhook, nullsupport, _callback); + + } + + /** + * Update Account by UID + * Updates Account details using the UID. + * @param uid The UID associated with the User (required) + * @param manageRegisterModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param nullsupport Bool flag, if this flag is sent as true then the fields which are send in payload as null then in the profile as well that will be saved as null only (optional) + * @return IdentityResponseWithSocialWithoutLogins + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Account profile updated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public IdentityResponseWithSocialWithoutLogins updateAccountProfileByUID(String uid, ManageRegisterModel manageRegisterModel, Boolean xPreventWebhook, Boolean preventWebhook, Boolean nullsupport) throws ApiException { + ApiResponse<IdentityResponseWithSocialWithoutLogins> localVarResp = updateAccountProfileByUIDWithHttpInfo(uid, manageRegisterModel, xPreventWebhook, preventWebhook, nullsupport); + return localVarResp.getData(); + } + + /** + * Update Account by UID + * Updates Account details using the UID. + * @param uid The UID associated with the User (required) + * @param manageRegisterModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param nullsupport Bool flag, if this flag is sent as true then the fields which are send in payload as null then in the profile as well that will be saved as null only (optional) + * @return ApiResponse<IdentityResponseWithSocialWithoutLogins> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Account profile updated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IdentityResponseWithSocialWithoutLogins> updateAccountProfileByUIDWithHttpInfo(String uid, ManageRegisterModel manageRegisterModel, Boolean xPreventWebhook, Boolean preventWebhook, Boolean nullsupport) throws ApiException { + okhttp3.Call localVarCall = updateAccountProfileByUIDValidateBeforeCall(uid, manageRegisterModel, xPreventWebhook, preventWebhook, nullsupport, null); + Type localVarReturnType = new TypeToken<IdentityResponseWithSocialWithoutLogins>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Account by UID (asynchronously) + * Updates Account details using the UID. + * @param uid The UID associated with the User (required) + * @param manageRegisterModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param nullsupport Bool flag, if this flag is sent as true then the fields which are send in payload as null then in the profile as well that will be saved as null only (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Account profile updated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateAccountProfileByUIDAsync(String uid, ManageRegisterModel manageRegisterModel, Boolean xPreventWebhook, Boolean preventWebhook, Boolean nullsupport, final ApiCallback<IdentityResponseWithSocialWithoutLogins> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateAccountProfileByUIDValidateBeforeCall(uid, manageRegisterModel, xPreventWebhook, preventWebhook, nullsupport, _callback); + Type localVarReturnType = new TypeToken<IdentityResponseWithSocialWithoutLogins>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updatePhoneNumber + * @param uid The UID associated with the User (required) + * @param phoneModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Phone number successfully updated for the Account. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updatePhoneNumberCall(String uid, PhoneModel phoneModel, Boolean xPreventWebhook, Boolean preventWebhook, 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 = phoneModel; + + // create path and map variables + String localVarPath = "/identity/v2/manage/account/{uid}/phoneid" + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updatePhoneNumberValidateBeforeCall(String uid, PhoneModel phoneModel, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling updatePhoneNumber(Async)"); + } + + // verify the required parameter 'phoneModel' is set + if (phoneModel == null) { + throw new ApiException("Missing the required parameter 'phoneModel' when calling updatePhoneNumber(Async)"); + } + + return updatePhoneNumberCall(uid, phoneModel, xPreventWebhook, preventWebhook, _callback); + + } + + /** + * Update Phone + * Updates the PhoneID associated with an Account using the UID. + * @param uid The UID associated with the User (required) + * @param phoneModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return IdentityResponseWithSocialWithoutLogins + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Phone number successfully updated for the Account. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public IdentityResponseWithSocialWithoutLogins updatePhoneNumber(String uid, PhoneModel phoneModel, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + ApiResponse<IdentityResponseWithSocialWithoutLogins> localVarResp = updatePhoneNumberWithHttpInfo(uid, phoneModel, xPreventWebhook, preventWebhook); + return localVarResp.getData(); + } + + /** + * Update Phone + * Updates the PhoneID associated with an Account using the UID. + * @param uid The UID associated with the User (required) + * @param phoneModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<IdentityResponseWithSocialWithoutLogins> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Phone number successfully updated for the Account. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IdentityResponseWithSocialWithoutLogins> updatePhoneNumberWithHttpInfo(String uid, PhoneModel phoneModel, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + okhttp3.Call localVarCall = updatePhoneNumberValidateBeforeCall(uid, phoneModel, xPreventWebhook, preventWebhook, null); + Type localVarReturnType = new TypeToken<IdentityResponseWithSocialWithoutLogins>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Phone (asynchronously) + * Updates the PhoneID associated with an Account using the UID. + * @param uid The UID associated with the User (required) + * @param phoneModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Phone number successfully updated for the Account. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updatePhoneNumberAsync(String uid, PhoneModel phoneModel, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback<IdentityResponseWithSocialWithoutLogins> _callback) throws ApiException { + + okhttp3.Call localVarCall = updatePhoneNumberValidateBeforeCall(uid, phoneModel, xPreventWebhook, preventWebhook, _callback); + Type localVarReturnType = new TypeToken<IdentityResponseWithSocialWithoutLogins>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for upsertEmailForAccount + * @param uid The UID associated with the User (required) + * @param upsertEmailModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Email successfully upserted for the Account. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call upsertEmailForAccountCall(String uid, UpsertEmailModel upsertEmailModel, Boolean xPreventWebhook, Boolean preventWebhook, 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 = upsertEmailModel; + + // create path and map variables + String localVarPath = "/identity/v2/manage/account/{uid}/email" + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call upsertEmailForAccountValidateBeforeCall(String uid, UpsertEmailModel upsertEmailModel, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling upsertEmailForAccount(Async)"); + } + + // verify the required parameter 'upsertEmailModel' is set + if (upsertEmailModel == null) { + throw new ApiException("Missing the required parameter 'upsertEmailModel' when calling upsertEmailForAccount(Async)"); + } + + return upsertEmailForAccountCall(uid, upsertEmailModel, xPreventWebhook, preventWebhook, _callback); + + } + + /** + * Upsert Email + * Adds or updates an Email associated with an Account using the UID. + * @param uid The UID associated with the User (required) + * @param upsertEmailModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return IdentityResponseWithSocialWithoutLogins + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Email successfully upserted for the Account. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public IdentityResponseWithSocialWithoutLogins upsertEmailForAccount(String uid, UpsertEmailModel upsertEmailModel, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + ApiResponse<IdentityResponseWithSocialWithoutLogins> localVarResp = upsertEmailForAccountWithHttpInfo(uid, upsertEmailModel, xPreventWebhook, preventWebhook); + return localVarResp.getData(); + } + + /** + * Upsert Email + * Adds or updates an Email associated with an Account using the UID. + * @param uid The UID associated with the User (required) + * @param upsertEmailModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<IdentityResponseWithSocialWithoutLogins> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Email successfully upserted for the Account. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IdentityResponseWithSocialWithoutLogins> upsertEmailForAccountWithHttpInfo(String uid, UpsertEmailModel upsertEmailModel, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + okhttp3.Call localVarCall = upsertEmailForAccountValidateBeforeCall(uid, upsertEmailModel, xPreventWebhook, preventWebhook, null); + Type localVarReturnType = new TypeToken<IdentityResponseWithSocialWithoutLogins>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Upsert Email (asynchronously) + * Adds or updates an Email associated with an Account using the UID. + * @param uid The UID associated with the User (required) + * @param upsertEmailModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Email successfully upserted for the Account. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call upsertEmailForAccountAsync(String uid, UpsertEmailModel upsertEmailModel, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback<IdentityResponseWithSocialWithoutLogins> _callback) throws ApiException { + + okhttp3.Call localVarCall = upsertEmailForAccountValidateBeforeCall(uid, upsertEmailModel, xPreventWebhook, preventWebhook, _callback); + Type localVarReturnType = new TypeToken<IdentityResponseWithSocialWithoutLogins>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/BigCommerceSsoApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/BigCommerceSsoApi.java new file mode 100644 index 0000000..479e33c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/BigCommerceSsoApi.java @@ -0,0 +1,692 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.BigCommerceLoginUrlResponse; +import com.loginradius.sdk.internal.openapi.model.BigCommerceTokenPostRequest; +import com.loginradius.sdk.internal.openapi.model.BigCommerceValidatePasswordRequest; +import com.loginradius.sdk.internal.openapi.model.BigCommerceValidatePasswordResponse; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class BigCommerceSsoApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public BigCommerceSsoApi() { + this(Configuration.getDefaultApiClient()); + } + + public BigCommerceSsoApi(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 bigCommerceAuth + * @param code BigCommerce OAuth authorization code (optional) + * @param signedPayload BigCommerce signed payload for load/uninstall callbacks (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: Authorization successful, returns HTML page. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call bigCommerceAuthCall(String code, String signedPayload, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://{domain}.hub.loginradius.com" }; + + // 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 = "/sso/bigcommerce/auth"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (code != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("code", code)); + } + + if (signedPayload != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("signed_payload", signedPayload)); + } + + final String[] localVarAccepts = { + "text/html", + "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[] { }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call bigCommerceAuthValidateBeforeCall(String code, String signedPayload, final ApiCallback _callback) throws ApiException { + return bigCommerceAuthCall(code, signedPayload, _callback); + + } + + /** + * BigCommerce OAuth Authorization + * Handles BigCommerce OAuth authorization callbacks. Accepts either an authorization code (for install flow) or a signed_payload (for load/uninstall callbacks). Returns an HTML page on success. + * @param code BigCommerce OAuth authorization code (optional) + * @param signedPayload BigCommerce signed payload for load/uninstall callbacks (optional) + * @return String + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: Authorization successful, returns HTML page. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + </table> + */ + public String bigCommerceAuth(String code, String signedPayload) throws ApiException { + ApiResponse<String> localVarResp = bigCommerceAuthWithHttpInfo(code, signedPayload); + return localVarResp.getData(); + } + + /** + * BigCommerce OAuth Authorization + * Handles BigCommerce OAuth authorization callbacks. Accepts either an authorization code (for install flow) or a signed_payload (for load/uninstall callbacks). Returns an HTML page on success. + * @param code BigCommerce OAuth authorization code (optional) + * @param signedPayload BigCommerce signed payload for load/uninstall callbacks (optional) + * @return ApiResponse<String> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: Authorization successful, returns HTML page. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + </table> + */ + public ApiResponse<String> bigCommerceAuthWithHttpInfo(String code, String signedPayload) throws ApiException { + okhttp3.Call localVarCall = bigCommerceAuthValidateBeforeCall(code, signedPayload, null); + Type localVarReturnType = new TypeToken<String>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * BigCommerce OAuth Authorization (asynchronously) + * Handles BigCommerce OAuth authorization callbacks. Accepts either an authorization code (for install flow) or a signed_payload (for load/uninstall callbacks). Returns an HTML page on success. + * @param code BigCommerce OAuth authorization code (optional) + * @param signedPayload BigCommerce signed payload for load/uninstall callbacks (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: Authorization successful, returns HTML page. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call bigCommerceAuthAsync(String code, String signedPayload, final ApiCallback<String> _callback) throws ApiException { + + okhttp3.Call localVarCall = bigCommerceAuthValidateBeforeCall(code, signedPayload, _callback); + Type localVarReturnType = new TypeToken<String>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getBigCommerceLoginUrl + * @param accessToken Access Token of the User (required) + * @param store BigCommerce store hash identifier (required) + * @param password User's password (optional) + * @param returnUrl URL to redirect the user to after login (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: BigCommerce login URL generated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The API key or access token is missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The request is not allowed. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getBigCommerceLoginUrlCall(String accessToken, String store, String password, String returnUrl, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://{domain}.hub.loginradius.com" }; + + // 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 = "/sso/bigcommerce/api/token"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (store != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("store", store)); + } + + if (password != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("password", password)); + } + + if (returnUrl != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("return_url", returnUrl)); + } + + 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[] { "APIKey", "XLoginRadiusAPIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getBigCommerceLoginUrlValidateBeforeCall(String accessToken, String store, String password, String returnUrl, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'accessToken' is set + if (accessToken == null) { + throw new ApiException("Missing the required parameter 'accessToken' when calling getBigCommerceLoginUrl(Async)"); + } + + // verify the required parameter 'store' is set + if (store == null) { + throw new ApiException("Missing the required parameter 'store' when calling getBigCommerceLoginUrl(Async)"); + } + + return getBigCommerceLoginUrlCall(accessToken, store, password, returnUrl, _callback); + + } + + /** + * Generate BigCommerce Login URL (GET) + * Generates a BigCommerce customer login URL using the provided LoginRadius access token. If the customer does not exist in BigCommerce, it creates one. Returns a login URL that can be used to authenticate the user into BigCommerce. + * @param accessToken Access Token of the User (required) + * @param store BigCommerce store hash identifier (required) + * @param password User's password (optional) + * @param returnUrl URL to redirect the user to after login (optional) + * @return BigCommerceLoginUrlResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: BigCommerce login URL generated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The API key or access token is missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The request is not allowed. </td><td> - </td></tr> + </table> + */ + public BigCommerceLoginUrlResponse getBigCommerceLoginUrl(String accessToken, String store, String password, String returnUrl) throws ApiException { + ApiResponse<BigCommerceLoginUrlResponse> localVarResp = getBigCommerceLoginUrlWithHttpInfo(accessToken, store, password, returnUrl); + return localVarResp.getData(); + } + + /** + * Generate BigCommerce Login URL (GET) + * Generates a BigCommerce customer login URL using the provided LoginRadius access token. If the customer does not exist in BigCommerce, it creates one. Returns a login URL that can be used to authenticate the user into BigCommerce. + * @param accessToken Access Token of the User (required) + * @param store BigCommerce store hash identifier (required) + * @param password User's password (optional) + * @param returnUrl URL to redirect the user to after login (optional) + * @return ApiResponse<BigCommerceLoginUrlResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: BigCommerce login URL generated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The API key or access token is missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The request is not allowed. </td><td> - </td></tr> + </table> + */ + public ApiResponse<BigCommerceLoginUrlResponse> getBigCommerceLoginUrlWithHttpInfo(String accessToken, String store, String password, String returnUrl) throws ApiException { + okhttp3.Call localVarCall = getBigCommerceLoginUrlValidateBeforeCall(accessToken, store, password, returnUrl, null); + Type localVarReturnType = new TypeToken<BigCommerceLoginUrlResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Generate BigCommerce Login URL (GET) (asynchronously) + * Generates a BigCommerce customer login URL using the provided LoginRadius access token. If the customer does not exist in BigCommerce, it creates one. Returns a login URL that can be used to authenticate the user into BigCommerce. + * @param accessToken Access Token of the User (required) + * @param store BigCommerce store hash identifier (required) + * @param password User's password (optional) + * @param returnUrl URL to redirect the user to after login (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: BigCommerce login URL generated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The API key or access token is missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The request is not allowed. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getBigCommerceLoginUrlAsync(String accessToken, String store, String password, String returnUrl, final ApiCallback<BigCommerceLoginUrlResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getBigCommerceLoginUrlValidateBeforeCall(accessToken, store, password, returnUrl, _callback); + Type localVarReturnType = new TypeToken<BigCommerceLoginUrlResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for postBigCommerceLoginUrl + * @param store BigCommerce store hash identifier (required) + * @param bigCommerceTokenPostRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: BigCommerce login URL generated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The API key or access token is missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The request is not allowed. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call postBigCommerceLoginUrlCall(String store, BigCommerceTokenPostRequest bigCommerceTokenPostRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://{domain}.hub.loginradius.com" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = bigCommerceTokenPostRequest; + + // create path and map variables + String localVarPath = "/sso/bigcommerce/api/token"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (store != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("store", store)); + } + + 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[] { "APIKey", "XLoginRadiusAPIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call postBigCommerceLoginUrlValidateBeforeCall(String store, BigCommerceTokenPostRequest bigCommerceTokenPostRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'store' is set + if (store == null) { + throw new ApiException("Missing the required parameter 'store' when calling postBigCommerceLoginUrl(Async)"); + } + + // verify the required parameter 'bigCommerceTokenPostRequest' is set + if (bigCommerceTokenPostRequest == null) { + throw new ApiException("Missing the required parameter 'bigCommerceTokenPostRequest' when calling postBigCommerceLoginUrl(Async)"); + } + + return postBigCommerceLoginUrlCall(store, bigCommerceTokenPostRequest, _callback); + + } + + /** + * Generate BigCommerce Login URL (POST) + * Generates a BigCommerce customer login URL using the provided LoginRadius access token sent in the request body. If the customer does not exist in BigCommerce, it creates one. Returns a login URL that can be used to authenticate the user into BigCommerce. + * @param store BigCommerce store hash identifier (required) + * @param bigCommerceTokenPostRequest (required) + * @return BigCommerceLoginUrlResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: BigCommerce login URL generated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The API key or access token is missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The request is not allowed. </td><td> - </td></tr> + </table> + */ + public BigCommerceLoginUrlResponse postBigCommerceLoginUrl(String store, BigCommerceTokenPostRequest bigCommerceTokenPostRequest) throws ApiException { + ApiResponse<BigCommerceLoginUrlResponse> localVarResp = postBigCommerceLoginUrlWithHttpInfo(store, bigCommerceTokenPostRequest); + return localVarResp.getData(); + } + + /** + * Generate BigCommerce Login URL (POST) + * Generates a BigCommerce customer login URL using the provided LoginRadius access token sent in the request body. If the customer does not exist in BigCommerce, it creates one. Returns a login URL that can be used to authenticate the user into BigCommerce. + * @param store BigCommerce store hash identifier (required) + * @param bigCommerceTokenPostRequest (required) + * @return ApiResponse<BigCommerceLoginUrlResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: BigCommerce login URL generated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The API key or access token is missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The request is not allowed. </td><td> - </td></tr> + </table> + */ + public ApiResponse<BigCommerceLoginUrlResponse> postBigCommerceLoginUrlWithHttpInfo(String store, BigCommerceTokenPostRequest bigCommerceTokenPostRequest) throws ApiException { + okhttp3.Call localVarCall = postBigCommerceLoginUrlValidateBeforeCall(store, bigCommerceTokenPostRequest, null); + Type localVarReturnType = new TypeToken<BigCommerceLoginUrlResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Generate BigCommerce Login URL (POST) (asynchronously) + * Generates a BigCommerce customer login URL using the provided LoginRadius access token sent in the request body. If the customer does not exist in BigCommerce, it creates one. Returns a login URL that can be used to authenticate the user into BigCommerce. + * @param store BigCommerce store hash identifier (required) + * @param bigCommerceTokenPostRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: BigCommerce login URL generated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The API key or access token is missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The request is not allowed. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call postBigCommerceLoginUrlAsync(String store, BigCommerceTokenPostRequest bigCommerceTokenPostRequest, final ApiCallback<BigCommerceLoginUrlResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = postBigCommerceLoginUrlValidateBeforeCall(store, bigCommerceTokenPostRequest, _callback); + Type localVarReturnType = new TypeToken<BigCommerceLoginUrlResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for validateBigCommercePassword + * @param store BigCommerce store hash identifier (required) + * @param bigCommerceValidatePasswordRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: Password validation result returned. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The API key is missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The request is not allowed. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call validateBigCommercePasswordCall(String store, BigCommerceValidatePasswordRequest bigCommerceValidatePasswordRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://{domain}.hub.loginradius.com" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = bigCommerceValidatePasswordRequest; + + // create path and map variables + String localVarPath = "/sso/bigcommerce/api/validatepassword"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (store != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("store", store)); + } + + 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[] { "APIKey", "XLoginRadiusAPIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call validateBigCommercePasswordValidateBeforeCall(String store, BigCommerceValidatePasswordRequest bigCommerceValidatePasswordRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'store' is set + if (store == null) { + throw new ApiException("Missing the required parameter 'store' when calling validateBigCommercePassword(Async)"); + } + + // verify the required parameter 'bigCommerceValidatePasswordRequest' is set + if (bigCommerceValidatePasswordRequest == null) { + throw new ApiException("Missing the required parameter 'bigCommerceValidatePasswordRequest' when calling validateBigCommercePassword(Async)"); + } + + return validateBigCommercePasswordCall(store, bigCommerceValidatePasswordRequest, _callback); + + } + + /** + * Validate BigCommerce Customer Password + * Validates a BigCommerce customer's password by checking the provided email and password against the BigCommerce store's customer records. + * @param store BigCommerce store hash identifier (required) + * @param bigCommerceValidatePasswordRequest (required) + * @return BigCommerceValidatePasswordResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: Password validation result returned. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The API key is missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The request is not allowed. </td><td> - </td></tr> + </table> + */ + public BigCommerceValidatePasswordResponse validateBigCommercePassword(String store, BigCommerceValidatePasswordRequest bigCommerceValidatePasswordRequest) throws ApiException { + ApiResponse<BigCommerceValidatePasswordResponse> localVarResp = validateBigCommercePasswordWithHttpInfo(store, bigCommerceValidatePasswordRequest); + return localVarResp.getData(); + } + + /** + * Validate BigCommerce Customer Password + * Validates a BigCommerce customer's password by checking the provided email and password against the BigCommerce store's customer records. + * @param store BigCommerce store hash identifier (required) + * @param bigCommerceValidatePasswordRequest (required) + * @return ApiResponse<BigCommerceValidatePasswordResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: Password validation result returned. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The API key is missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The request is not allowed. </td><td> - </td></tr> + </table> + */ + public ApiResponse<BigCommerceValidatePasswordResponse> validateBigCommercePasswordWithHttpInfo(String store, BigCommerceValidatePasswordRequest bigCommerceValidatePasswordRequest) throws ApiException { + okhttp3.Call localVarCall = validateBigCommercePasswordValidateBeforeCall(store, bigCommerceValidatePasswordRequest, null); + Type localVarReturnType = new TypeToken<BigCommerceValidatePasswordResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Validate BigCommerce Customer Password (asynchronously) + * Validates a BigCommerce customer's password by checking the provided email and password against the BigCommerce store's customer records. + * @param store BigCommerce store hash identifier (required) + * @param bigCommerceValidatePasswordRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: Password validation result returned. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The API key is missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The request is not allowed. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call validateBigCommercePasswordAsync(String store, BigCommerceValidatePasswordRequest bigCommerceValidatePasswordRequest, final ApiCallback<BigCommerceValidatePasswordResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = validateBigCommercePasswordValidateBeforeCall(store, bigCommerceValidatePasswordRequest, _callback); + Type localVarReturnType = new TypeToken<BigCommerceValidatePasswordResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/CaptchaConfigurationApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/CaptchaConfigurationApi.java new file mode 100644 index 0000000..50bdd6c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/CaptchaConfigurationApi.java @@ -0,0 +1,336 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.CaptchaConfig; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class CaptchaConfigurationApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public CaptchaConfigurationApi() { + this(Configuration.getDefaultApiClient()); + } + + public CaptchaConfigurationApi(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 getCaptchaConfiguration + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getCaptchaConfigurationCall(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 = "/v2/manage/captcha"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getCaptchaConfigurationValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getCaptchaConfigurationCall(_callback); + + } + + /** + * Retrieve captcha configuration + * Retrieves the captcha configuration settings for a specific Tenant. + * @return CaptchaConfig + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public CaptchaConfig getCaptchaConfiguration() throws ApiException { + ApiResponse<CaptchaConfig> localVarResp = getCaptchaConfigurationWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Retrieve captcha configuration + * Retrieves the captcha configuration settings for a specific Tenant. + * @return ApiResponse<CaptchaConfig> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<CaptchaConfig> getCaptchaConfigurationWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getCaptchaConfigurationValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<CaptchaConfig>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve captcha configuration (asynchronously) + * Retrieves the captcha configuration settings for a specific Tenant. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getCaptchaConfigurationAsync(final ApiCallback<CaptchaConfig> _callback) throws ApiException { + + okhttp3.Call localVarCall = getCaptchaConfigurationValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<CaptchaConfig>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateCaptchaConfiguration + * @param captchaConfig (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateCaptchaConfigurationCall(CaptchaConfig captchaConfig, 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 = captchaConfig; + + // create path and map variables + String localVarPath = "/v2/manage/captcha"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateCaptchaConfigurationValidateBeforeCall(CaptchaConfig captchaConfig, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'captchaConfig' is set + if (captchaConfig == null) { + throw new ApiException("Missing the required parameter 'captchaConfig' when calling updateCaptchaConfiguration(Async)"); + } + + return updateCaptchaConfigurationCall(captchaConfig, _callback); + + } + + /** + * Update captcha configuration + * Updates the captcha configuration settings for a specific Tenant. + * @param captchaConfig (required) + * @return CaptchaConfig + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public CaptchaConfig updateCaptchaConfiguration(CaptchaConfig captchaConfig) throws ApiException { + ApiResponse<CaptchaConfig> localVarResp = updateCaptchaConfigurationWithHttpInfo(captchaConfig); + return localVarResp.getData(); + } + + /** + * Update captcha configuration + * Updates the captcha configuration settings for a specific Tenant. + * @param captchaConfig (required) + * @return ApiResponse<CaptchaConfig> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<CaptchaConfig> updateCaptchaConfigurationWithHttpInfo(CaptchaConfig captchaConfig) throws ApiException { + okhttp3.Call localVarCall = updateCaptchaConfigurationValidateBeforeCall(captchaConfig, null); + Type localVarReturnType = new TypeToken<CaptchaConfig>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update captcha configuration (asynchronously) + * Updates the captcha configuration settings for a specific Tenant. + * @param captchaConfig (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateCaptchaConfigurationAsync(CaptchaConfig captchaConfig, final ApiCallback<CaptchaConfig> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateCaptchaConfigurationValidateBeforeCall(captchaConfig, _callback); + Type localVarReturnType = new TypeToken<CaptchaConfig>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/ConsentApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/ConsentApi.java new file mode 100644 index 0000000..8c14c41 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/ConsentApi.java @@ -0,0 +1,1050 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.ConsentForm; +import com.loginradius.sdk.internal.openapi.model.ConsentFormModel; +import com.loginradius.sdk.internal.openapi.model.ConsentOptionModel; +import com.loginradius.sdk.internal.openapi.model.ConsentOptions; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.GetConsentForms200Response; +import com.loginradius.sdk.internal.openapi.model.GetConsentOptions200Response; +import com.loginradius.sdk.internal.openapi.model.IsDeleted; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ConsentApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public ConsentApi() { + this(Configuration.getDefaultApiClient()); + } + + public ConsentApi(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 addConsentForm + * @param consentFormModel (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Created: The Consent Form was successfully created. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The Consent Form already exists. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: An unexpected error occurred. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call addConsentFormCall(ConsentFormModel consentFormModel, 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 = consentFormModel; + + // create path and map variables + String localVarPath = "/consent/forms"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call addConsentFormValidateBeforeCall(ConsentFormModel consentFormModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'consentFormModel' is set + if (consentFormModel == null) { + throw new ApiException("Missing the required parameter 'consentFormModel' when calling addConsentForm(Async)"); + } + + return addConsentFormCall(consentFormModel, _callback); + + } + + /** + * Add Consent Form + * Adds a new Consent Form for the Tenant. + * @param consentFormModel (required) + * @return ConsentForm + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Created: The Consent Form was successfully created. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The Consent Form already exists. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: An unexpected error occurred. </td><td> - </td></tr> + </table> + */ + public ConsentForm addConsentForm(ConsentFormModel consentFormModel) throws ApiException { + ApiResponse<ConsentForm> localVarResp = addConsentFormWithHttpInfo(consentFormModel); + return localVarResp.getData(); + } + + /** + * Add Consent Form + * Adds a new Consent Form for the Tenant. + * @param consentFormModel (required) + * @return ApiResponse<ConsentForm> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Created: The Consent Form was successfully created. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The Consent Form already exists. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: An unexpected error occurred. </td><td> - </td></tr> + </table> + */ + public ApiResponse<ConsentForm> addConsentFormWithHttpInfo(ConsentFormModel consentFormModel) throws ApiException { + okhttp3.Call localVarCall = addConsentFormValidateBeforeCall(consentFormModel, null); + Type localVarReturnType = new TypeToken<ConsentForm>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Add Consent Form (asynchronously) + * Adds a new Consent Form for the Tenant. + * @param consentFormModel (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Created: The Consent Form was successfully created. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The Consent Form already exists. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: An unexpected error occurred. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call addConsentFormAsync(ConsentFormModel consentFormModel, final ApiCallback<ConsentForm> _callback) throws ApiException { + + okhttp3.Call localVarCall = addConsentFormValidateBeforeCall(consentFormModel, _callback); + Type localVarReturnType = new TypeToken<ConsentForm>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for createConsentOption + * @param consentOptionModel (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createConsentOptionCall(ConsentOptionModel consentOptionModel, 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 = consentOptionModel; + + // create path and map variables + String localVarPath = "/consent/options"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createConsentOptionValidateBeforeCall(ConsentOptionModel consentOptionModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'consentOptionModel' is set + if (consentOptionModel == null) { + throw new ApiException("Missing the required parameter 'consentOptionModel' when calling createConsentOption(Async)"); + } + + return createConsentOptionCall(consentOptionModel, _callback); + + } + + /** + * Create Consent Option + * Creates a new consent option for a specific Tenant. + * @param consentOptionModel (required) + * @return ConsentOptions + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ConsentOptions createConsentOption(ConsentOptionModel consentOptionModel) throws ApiException { + ApiResponse<ConsentOptions> localVarResp = createConsentOptionWithHttpInfo(consentOptionModel); + return localVarResp.getData(); + } + + /** + * Create Consent Option + * Creates a new consent option for a specific Tenant. + * @param consentOptionModel (required) + * @return ApiResponse<ConsentOptions> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<ConsentOptions> createConsentOptionWithHttpInfo(ConsentOptionModel consentOptionModel) throws ApiException { + okhttp3.Call localVarCall = createConsentOptionValidateBeforeCall(consentOptionModel, null); + Type localVarReturnType = new TypeToken<ConsentOptions>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Consent Option (asynchronously) + * Creates a new consent option for a specific Tenant. + * @param consentOptionModel (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createConsentOptionAsync(ConsentOptionModel consentOptionModel, final ApiCallback<ConsentOptions> _callback) throws ApiException { + + okhttp3.Call localVarCall = createConsentOptionValidateBeforeCall(consentOptionModel, _callback); + Type localVarReturnType = new TypeToken<ConsentOptions>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteConsentForm + * @param version The version of the Consent form to delete. (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 410 </td><td> Gone: The resource requested is no longer available and will not be available again. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteConsentFormCall(String version, 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 = "/consent/forms/{version}" + .replace("{" + "version" + "}", localVarApiClient.escapeString(version.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteConsentFormValidateBeforeCall(String version, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'version' is set + if (version == null) { + throw new ApiException("Missing the required parameter 'version' when calling deleteConsentForm(Async)"); + } + + return deleteConsentFormCall(version, _callback); + + } + + /** + * Delete Consent Form + * Deletes the Consent Form identified by the form version for the Tenant. + * @param version The version of the Consent form to delete. (required) + * @return IsDeleted + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 410 </td><td> Gone: The resource requested is no longer available and will not be available again. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public IsDeleted deleteConsentForm(String version) throws ApiException { + ApiResponse<IsDeleted> localVarResp = deleteConsentFormWithHttpInfo(version); + return localVarResp.getData(); + } + + /** + * Delete Consent Form + * Deletes the Consent Form identified by the form version for the Tenant. + * @param version The version of the Consent form to delete. (required) + * @return ApiResponse<IsDeleted> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 410 </td><td> Gone: The resource requested is no longer available and will not be available again. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsDeleted> deleteConsentFormWithHttpInfo(String version) throws ApiException { + okhttp3.Call localVarCall = deleteConsentFormValidateBeforeCall(version, null); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Consent Form (asynchronously) + * Deletes the Consent Form identified by the form version for the Tenant. + * @param version The version of the Consent form to delete. (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 410 </td><td> Gone: The resource requested is no longer available and will not be available again. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteConsentFormAsync(String version, final ApiCallback<IsDeleted> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteConsentFormValidateBeforeCall(version, _callback); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteConsentOption + * @param optionId The ID of the Consent option to delete. (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteConsentOptionCall(String optionId, 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 = "/consent/options/{optionId}" + .replace("{" + "optionId" + "}", localVarApiClient.escapeString(optionId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteConsentOptionValidateBeforeCall(String optionId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'optionId' is set + if (optionId == null) { + throw new ApiException("Missing the required parameter 'optionId' when calling deleteConsentOption(Async)"); + } + + return deleteConsentOptionCall(optionId, _callback); + + } + + /** + * Delete Consent Option + * Deletes the consent option identified by the option ID for the Tenant. + * @param optionId The ID of the Consent option to delete. (required) + * @return IsDeleted + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public IsDeleted deleteConsentOption(String optionId) throws ApiException { + ApiResponse<IsDeleted> localVarResp = deleteConsentOptionWithHttpInfo(optionId); + return localVarResp.getData(); + } + + /** + * Delete Consent Option + * Deletes the consent option identified by the option ID for the Tenant. + * @param optionId The ID of the Consent option to delete. (required) + * @return ApiResponse<IsDeleted> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsDeleted> deleteConsentOptionWithHttpInfo(String optionId) throws ApiException { + okhttp3.Call localVarCall = deleteConsentOptionValidateBeforeCall(optionId, null); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Consent Option (asynchronously) + * Deletes the consent option identified by the option ID for the Tenant. + * @param optionId The ID of the Consent option to delete. (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteConsentOptionAsync(String optionId, final ApiCallback<IsDeleted> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteConsentOptionValidateBeforeCall(optionId, _callback); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getActiveConsentForms + * @param event Event type to filter consent verification (e.g., `login`). (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getActiveConsentFormsCall(String event, 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 = "/consent/forms/active"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (event != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("event", event)); + } + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getActiveConsentFormsValidateBeforeCall(String event, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'event' is set + if (event == null) { + throw new ApiException("Missing the required parameter 'event' when calling getActiveConsentForms(Async)"); + } + + return getActiveConsentFormsCall(event, _callback); + + } + + /** + * Retrieve Active Consent Forms + * Retrieves a list of active Consent Forms configured for the Tenant. + * @param event Event type to filter consent verification (e.g., `login`). (required) + * @return GetConsentForms200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public GetConsentForms200Response getActiveConsentForms(String event) throws ApiException { + ApiResponse<GetConsentForms200Response> localVarResp = getActiveConsentFormsWithHttpInfo(event); + return localVarResp.getData(); + } + + /** + * Retrieve Active Consent Forms + * Retrieves a list of active Consent Forms configured for the Tenant. + * @param event Event type to filter consent verification (e.g., `login`). (required) + * @return ApiResponse<GetConsentForms200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetConsentForms200Response> getActiveConsentFormsWithHttpInfo(String event) throws ApiException { + okhttp3.Call localVarCall = getActiveConsentFormsValidateBeforeCall(event, null); + Type localVarReturnType = new TypeToken<GetConsentForms200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Active Consent Forms (asynchronously) + * Retrieves a list of active Consent Forms configured for the Tenant. + * @param event Event type to filter consent verification (e.g., `login`). (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getActiveConsentFormsAsync(String event, final ApiCallback<GetConsentForms200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getActiveConsentFormsValidateBeforeCall(event, _callback); + Type localVarReturnType = new TypeToken<GetConsentForms200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getConsentForms + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: An unexpected error occurred. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getConsentFormsCall(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 = "/consent/forms"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getConsentFormsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getConsentFormsCall(_callback); + + } + + /** + * Retrieve Consent Forms + * Retrieves all Consent Forms configured for the Tenant. + * @return GetConsentForms200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: An unexpected error occurred. </td><td> - </td></tr> + </table> + */ + public GetConsentForms200Response getConsentForms() throws ApiException { + ApiResponse<GetConsentForms200Response> localVarResp = getConsentFormsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Retrieve Consent Forms + * Retrieves all Consent Forms configured for the Tenant. + * @return ApiResponse<GetConsentForms200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: An unexpected error occurred. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetConsentForms200Response> getConsentFormsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getConsentFormsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<GetConsentForms200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Consent Forms (asynchronously) + * Retrieves all Consent Forms configured for the Tenant. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: An unexpected error occurred. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getConsentFormsAsync(final ApiCallback<GetConsentForms200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getConsentFormsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<GetConsentForms200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getConsentOptions + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getConsentOptionsCall(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 = "/consent/options"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getConsentOptionsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getConsentOptionsCall(_callback); + + } + + /** + * Retrieve Consent Options + * Lists all consent options available for a specific Tenant. + * @return GetConsentOptions200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public GetConsentOptions200Response getConsentOptions() throws ApiException { + ApiResponse<GetConsentOptions200Response> localVarResp = getConsentOptionsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Retrieve Consent Options + * Lists all consent options available for a specific Tenant. + * @return ApiResponse<GetConsentOptions200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetConsentOptions200Response> getConsentOptionsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getConsentOptionsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<GetConsentOptions200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Consent Options (asynchronously) + * Lists all consent options available for a specific Tenant. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getConsentOptionsAsync(final ApiCallback<GetConsentOptions200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getConsentOptionsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<GetConsentOptions200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/CrossDeviceSsoApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/CrossDeviceSsoApi.java new file mode 100644 index 0000000..983e0a3 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/CrossDeviceSsoApi.java @@ -0,0 +1,480 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.AccessTokenByPingQRCodeResponse; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.QRCodeMapToToken; +import com.loginradius.sdk.internal.openapi.model.QRCodeMapToTokenResponse; +import com.loginradius.sdk.internal.openapi.model.QRCodeResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class CrossDeviceSsoApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public CrossDeviceSsoApi() { + this(Configuration.getDefaultApiClient()); + } + + public CrossDeviceSsoApi(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 generateQRCode + * @param expiry Code Expiry time (in second) in second, Min:0, Max:300 (optional, default to 60) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call generateQRCodeCall(String expiry, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://cloud-api.loginradius.com" }; + + // 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 = "/sso/mobile/generate"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (expiry != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("expiry", expiry)); + } + + 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[] { "APIKey", "XLoginRadiusAPIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call generateQRCodeValidateBeforeCall(String expiry, final ApiCallback _callback) throws ApiException { + return generateQRCodeCall(expiry, _callback); + + } + + /** + * Retrieve QR code + * Retrieves a QR code for Cross Device SSO. + * @param expiry Code Expiry time (in second) in second, Min:0, Max:300 (optional, default to 60) + * @return QRCodeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public QRCodeResponse generateQRCode(String expiry) throws ApiException { + ApiResponse<QRCodeResponse> localVarResp = generateQRCodeWithHttpInfo(expiry); + return localVarResp.getData(); + } + + /** + * Retrieve QR code + * Retrieves a QR code for Cross Device SSO. + * @param expiry Code Expiry time (in second) in second, Min:0, Max:300 (optional, default to 60) + * @return ApiResponse<QRCodeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<QRCodeResponse> generateQRCodeWithHttpInfo(String expiry) throws ApiException { + okhttp3.Call localVarCall = generateQRCodeValidateBeforeCall(expiry, null); + Type localVarReturnType = new TypeToken<QRCodeResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve QR code (asynchronously) + * Retrieves a QR code for Cross Device SSO. + * @param expiry Code Expiry time (in second) in second, Min:0, Max:300 (optional, default to 60) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call generateQRCodeAsync(String expiry, final ApiCallback<QRCodeResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = generateQRCodeValidateBeforeCall(expiry, _callback); + Type localVarReturnType = new TypeToken<QRCodeResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAccessTokenByPing + * @param code QR Code By Generate QR Code API (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAccessTokenByPingCall(String code, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://cloud-api.loginradius.com" }; + + // 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 = "/sso/mobile/token"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (code != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("code", code)); + } + + 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[] { "APIKey", "XLoginRadiusAPIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAccessTokenByPingValidateBeforeCall(String code, final ApiCallback _callback) throws ApiException { + return getAccessTokenByPingCall(code, _callback); + + } + + /** + * Retrieve Access Token by ping + * Retrieves an Access Token by ping after a User scans a QR code during mobile login. + * @param code QR Code By Generate QR Code API (optional) + * @return AccessTokenByPingQRCodeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public AccessTokenByPingQRCodeResponse getAccessTokenByPing(String code) throws ApiException { + ApiResponse<AccessTokenByPingQRCodeResponse> localVarResp = getAccessTokenByPingWithHttpInfo(code); + return localVarResp.getData(); + } + + /** + * Retrieve Access Token by ping + * Retrieves an Access Token by ping after a User scans a QR code during mobile login. + * @param code QR Code By Generate QR Code API (optional) + * @return ApiResponse<AccessTokenByPingQRCodeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<AccessTokenByPingQRCodeResponse> getAccessTokenByPingWithHttpInfo(String code) throws ApiException { + okhttp3.Call localVarCall = getAccessTokenByPingValidateBeforeCall(code, null); + Type localVarReturnType = new TypeToken<AccessTokenByPingQRCodeResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Access Token by ping (asynchronously) + * Retrieves an Access Token by ping after a User scans a QR code during mobile login. + * @param code QR Code By Generate QR Code API (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAccessTokenByPingAsync(String code, final ApiCallback<AccessTokenByPingQRCodeResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getAccessTokenByPingValidateBeforeCall(code, _callback); + Type localVarReturnType = new TypeToken<AccessTokenByPingQRCodeResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for mapQRCodeToAccessToken + * @param qrCodeMapToToken (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call mapQRCodeToAccessTokenCall(QRCodeMapToToken qrCodeMapToToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://cloud-api.loginradius.com" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = qrCodeMapToToken; + + // create path and map variables + String localVarPath = "/sso/mobile/token"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "XLoginRadiusAPIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call mapQRCodeToAccessTokenValidateBeforeCall(QRCodeMapToToken qrCodeMapToToken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'qrCodeMapToToken' is set + if (qrCodeMapToToken == null) { + throw new ApiException("Missing the required parameter 'qrCodeMapToToken' when calling mapQRCodeToAccessToken(Async)"); + } + + return mapQRCodeToAccessTokenCall(qrCodeMapToToken, _callback); + + } + + /** + * Map QR code to Access Token + * Maps a scanned QR code to an Access Token during mobile login. + * @param qrCodeMapToToken (required) + * @return QRCodeMapToTokenResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public QRCodeMapToTokenResponse mapQRCodeToAccessToken(QRCodeMapToToken qrCodeMapToToken) throws ApiException { + ApiResponse<QRCodeMapToTokenResponse> localVarResp = mapQRCodeToAccessTokenWithHttpInfo(qrCodeMapToToken); + return localVarResp.getData(); + } + + /** + * Map QR code to Access Token + * Maps a scanned QR code to an Access Token during mobile login. + * @param qrCodeMapToToken (required) + * @return ApiResponse<QRCodeMapToTokenResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<QRCodeMapToTokenResponse> mapQRCodeToAccessTokenWithHttpInfo(QRCodeMapToToken qrCodeMapToToken) throws ApiException { + okhttp3.Call localVarCall = mapQRCodeToAccessTokenValidateBeforeCall(qrCodeMapToToken, null); + Type localVarReturnType = new TypeToken<QRCodeMapToTokenResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Map QR code to Access Token (asynchronously) + * Maps a scanned QR code to an Access Token during mobile login. + * @param qrCodeMapToToken (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call mapQRCodeToAccessTokenAsync(QRCodeMapToToken qrCodeMapToToken, final ApiCallback<QRCodeMapToTokenResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = mapQRCodeToAccessTokenValidateBeforeCall(qrCodeMapToToken, _callback); + Type localVarReturnType = new TypeToken<QRCodeMapToTokenResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/CustomFieldsApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/CustomFieldsApi.java new file mode 100644 index 0000000..851da56 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/CustomFieldsApi.java @@ -0,0 +1,1004 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.CustomFieldLimitResponse; +import com.loginradius.sdk.internal.openapi.model.DeleteResponse; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.GetAllCustomFields200Response; +import com.loginradius.sdk.internal.openapi.model.RaasCustomField; +import com.loginradius.sdk.internal.openapi.model.RaasCustomFieldModel; +import com.loginradius.sdk.internal.openapi.model.SetCustomField200Response; +import com.loginradius.sdk.internal.openapi.model.SetCustomFieldRequest; +import com.loginradius.sdk.internal.openapi.model.SetProvidersOrderRequest; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class CustomFieldsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public CustomFieldsApi() { + this(Configuration.getDefaultApiClient()); + } + + public CustomFieldsApi(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 createCustomField + * @param raasCustomFieldModel (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createCustomFieldCall(RaasCustomFieldModel raasCustomFieldModel, 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 = raasCustomFieldModel; + + // create path and map variables + String localVarPath = "/v2/manage/custom-fields"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createCustomFieldValidateBeforeCall(RaasCustomFieldModel raasCustomFieldModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'raasCustomFieldModel' is set + if (raasCustomFieldModel == null) { + throw new ApiException("Missing the required parameter 'raasCustomFieldModel' when calling createCustomField(Async)"); + } + + return createCustomFieldCall(raasCustomFieldModel, _callback); + + } + + /** + * Create custom field + * Creates a new Custom Field for the Tenant. + * @param raasCustomFieldModel (required) + * @return RaasCustomField + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public RaasCustomField createCustomField(RaasCustomFieldModel raasCustomFieldModel) throws ApiException { + ApiResponse<RaasCustomField> localVarResp = createCustomFieldWithHttpInfo(raasCustomFieldModel); + return localVarResp.getData(); + } + + /** + * Create custom field + * Creates a new Custom Field for the Tenant. + * @param raasCustomFieldModel (required) + * @return ApiResponse<RaasCustomField> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<RaasCustomField> createCustomFieldWithHttpInfo(RaasCustomFieldModel raasCustomFieldModel) throws ApiException { + okhttp3.Call localVarCall = createCustomFieldValidateBeforeCall(raasCustomFieldModel, null); + Type localVarReturnType = new TypeToken<RaasCustomField>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create custom field (asynchronously) + * Creates a new Custom Field for the Tenant. + * @param raasCustomFieldModel (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createCustomFieldAsync(RaasCustomFieldModel raasCustomFieldModel, final ApiCallback<RaasCustomField> _callback) throws ApiException { + + okhttp3.Call localVarCall = createCustomFieldValidateBeforeCall(raasCustomFieldModel, _callback); + Type localVarReturnType = new TypeToken<RaasCustomField>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteCustomField + * @param cfname Custom Fields Name (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteCustomFieldCall(String cfname, 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 = "/v2/manage/custom-fields/{cfname}" + .replace("{" + "cfname" + "}", localVarApiClient.escapeString(cfname.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteCustomFieldValidateBeforeCall(String cfname, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'cfname' is set + if (cfname == null) { + throw new ApiException("Missing the required parameter 'cfname' when calling deleteCustomField(Async)"); + } + + return deleteCustomFieldCall(cfname, _callback); + + } + + /** + * Delete custom field + * Deletes a Custom Field by name for the Tenant. + * @param cfname Custom Fields Name (required) + * @return DeleteResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public DeleteResponse deleteCustomField(String cfname) throws ApiException { + ApiResponse<DeleteResponse> localVarResp = deleteCustomFieldWithHttpInfo(cfname); + return localVarResp.getData(); + } + + /** + * Delete custom field + * Deletes a Custom Field by name for the Tenant. + * @param cfname Custom Fields Name (required) + * @return ApiResponse<DeleteResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DeleteResponse> deleteCustomFieldWithHttpInfo(String cfname) throws ApiException { + okhttp3.Call localVarCall = deleteCustomFieldValidateBeforeCall(cfname, null); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete custom field (asynchronously) + * Deletes a Custom Field by name for the Tenant. + * @param cfname Custom Fields Name (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteCustomFieldAsync(String cfname, final ApiCallback<DeleteResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteCustomFieldValidateBeforeCall(cfname, _callback); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getActiveCustomFields + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getActiveCustomFieldsCall(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 = "/v2/manage/custom-fields/active"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getActiveCustomFieldsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getActiveCustomFieldsCall(_callback); + + } + + /** + * List active custom fields + * Retrieves all custom fields currently active in the registration form for the Tenant. + * @return SetCustomField200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public SetCustomField200Response getActiveCustomFields() throws ApiException { + ApiResponse<SetCustomField200Response> localVarResp = getActiveCustomFieldsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List active custom fields + * Retrieves all custom fields currently active in the registration form for the Tenant. + * @return ApiResponse<SetCustomField200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SetCustomField200Response> getActiveCustomFieldsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getActiveCustomFieldsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<SetCustomField200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List active custom fields (asynchronously) + * Retrieves all custom fields currently active in the registration form for the Tenant. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getActiveCustomFieldsAsync(final ApiCallback<SetCustomField200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getActiveCustomFieldsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<SetCustomField200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAllCustomFields + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllCustomFieldsCall(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 = "/v2/manage/custom-fields"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAllCustomFieldsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getAllCustomFieldsCall(_callback); + + } + + /** + * List custom fields + * Retrieves all Custom Fields created for the Tenant. + * @return GetAllCustomFields200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public GetAllCustomFields200Response getAllCustomFields() throws ApiException { + ApiResponse<GetAllCustomFields200Response> localVarResp = getAllCustomFieldsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List custom fields + * Retrieves all Custom Fields created for the Tenant. + * @return ApiResponse<GetAllCustomFields200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetAllCustomFields200Response> getAllCustomFieldsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getAllCustomFieldsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<GetAllCustomFields200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List custom fields (asynchronously) + * Retrieves all Custom Fields created for the Tenant. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllCustomFieldsAsync(final ApiCallback<GetAllCustomFields200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getAllCustomFieldsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<GetAllCustomFields200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getCustomFieldLimit + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getCustomFieldLimitCall(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 = "/v2/manage/custom-fields/limit"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getCustomFieldLimitValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getCustomFieldLimitCall(_callback); + + } + + /** + * Retrieve custom field limit + * Retrieves the Custom Field Limit configured for the Tenant. + * @return CustomFieldLimitResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public CustomFieldLimitResponse getCustomFieldLimit() throws ApiException { + ApiResponse<CustomFieldLimitResponse> localVarResp = getCustomFieldLimitWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Retrieve custom field limit + * Retrieves the Custom Field Limit configured for the Tenant. + * @return ApiResponse<CustomFieldLimitResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<CustomFieldLimitResponse> getCustomFieldLimitWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getCustomFieldLimitValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<CustomFieldLimitResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve custom field limit (asynchronously) + * Retrieves the Custom Field Limit configured for the Tenant. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getCustomFieldLimitAsync(final ApiCallback<CustomFieldLimitResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getCustomFieldLimitValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<CustomFieldLimitResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for listCustomFields + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call listCustomFieldsCall(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 = "/v2/manage/custom-fields/list"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call listCustomFieldsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return listCustomFieldsCall(_callback); + + } + + /** + * List custom fields + * Retrieves all custom fields for the Tenant, returned as an array of strings. + * @return SetProvidersOrderRequest + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public SetProvidersOrderRequest listCustomFields() throws ApiException { + ApiResponse<SetProvidersOrderRequest> localVarResp = listCustomFieldsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List custom fields + * Retrieves all custom fields for the Tenant, returned as an array of strings. + * @return ApiResponse<SetProvidersOrderRequest> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SetProvidersOrderRequest> listCustomFieldsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = listCustomFieldsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<SetProvidersOrderRequest>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List custom fields (asynchronously) + * Retrieves all custom fields for the Tenant, returned as an array of strings. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call listCustomFieldsAsync(final ApiCallback<SetProvidersOrderRequest> _callback) throws ApiException { + + okhttp3.Call localVarCall = listCustomFieldsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<SetProvidersOrderRequest>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for setCustomField + * @param setCustomFieldRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call setCustomFieldCall(SetCustomFieldRequest setCustomFieldRequest, 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 = setCustomFieldRequest; + + // create path and map variables + String localVarPath = "/v2/manage/custom-fields"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call setCustomFieldValidateBeforeCall(SetCustomFieldRequest setCustomFieldRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'setCustomFieldRequest' is set + if (setCustomFieldRequest == null) { + throw new ApiException("Missing the required parameter 'setCustomFieldRequest' when calling setCustomField(Async)"); + } + + return setCustomFieldCall(setCustomFieldRequest, _callback); + + } + + /** + * Set custom field + * Updates or sets a Custom Field instance in RAAS to be displayed on forms for the Tenant. + * @param setCustomFieldRequest (required) + * @return SetCustomField200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public SetCustomField200Response setCustomField(SetCustomFieldRequest setCustomFieldRequest) throws ApiException { + ApiResponse<SetCustomField200Response> localVarResp = setCustomFieldWithHttpInfo(setCustomFieldRequest); + return localVarResp.getData(); + } + + /** + * Set custom field + * Updates or sets a Custom Field instance in RAAS to be displayed on forms for the Tenant. + * @param setCustomFieldRequest (required) + * @return ApiResponse<SetCustomField200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SetCustomField200Response> setCustomFieldWithHttpInfo(SetCustomFieldRequest setCustomFieldRequest) throws ApiException { + okhttp3.Call localVarCall = setCustomFieldValidateBeforeCall(setCustomFieldRequest, null); + Type localVarReturnType = new TypeToken<SetCustomField200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Set custom field (asynchronously) + * Updates or sets a Custom Field instance in RAAS to be displayed on forms for the Tenant. + * @param setCustomFieldRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call setCustomFieldAsync(SetCustomFieldRequest setCustomFieldRequest, final ApiCallback<SetCustomField200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = setCustomFieldValidateBeforeCall(setCustomFieldRequest, _callback); + Type localVarReturnType = new TypeToken<SetCustomField200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/CustomObjectApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/CustomObjectApi.java new file mode 100644 index 0000000..3a4e3d1 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/CustomObjectApi.java @@ -0,0 +1,962 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.ApiError; +import com.loginradius.sdk.internal.openapi.model.CustomObjectResponseModel; +import com.loginradius.sdk.internal.openapi.model.CustomObjectsResponseModel; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.IsDeleted; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class CustomObjectApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public CustomObjectApi() { + this(Configuration.getDefaultApiClient()); + } + + public CustomObjectApi(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 createCustomObjectByToken + * @param requestBody (required) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully created the Custom Object </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createCustomObjectByTokenCall(Map<String, Object> requestBody, String customobjectid, String objectname, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, 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 = requestBody; + + // create path and map variables + String localVarPath = "/identity/v2/auth/customobject"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (customobjectid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("customobjectid", customobjectid)); + } + + if (objectname != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("objectname", objectname)); + } + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createCustomObjectByTokenValidateBeforeCall(Map<String, Object> requestBody, String customobjectid, String objectname, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new ApiException("Missing the required parameter 'requestBody' when calling createCustomObjectByToken(Async)"); + } + + return createCustomObjectByTokenCall(requestBody, customobjectid, objectname, accessToken, preventWebhook, xPreventWebhook, _callback); + + } + + /** + * Create Custom Object + * Creates a Custom Object associated with the authenticated User using an Access Token. + * @param requestBody (required) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return CustomObjectResponseModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully created the Custom Object </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public CustomObjectResponseModel createCustomObjectByToken(Map<String, Object> requestBody, String customobjectid, String objectname, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + ApiResponse<CustomObjectResponseModel> localVarResp = createCustomObjectByTokenWithHttpInfo(requestBody, customobjectid, objectname, accessToken, preventWebhook, xPreventWebhook); + return localVarResp.getData(); + } + + /** + * Create Custom Object + * Creates a Custom Object associated with the authenticated User using an Access Token. + * @param requestBody (required) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<CustomObjectResponseModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully created the Custom Object </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<CustomObjectResponseModel> createCustomObjectByTokenWithHttpInfo(Map<String, Object> requestBody, String customobjectid, String objectname, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + okhttp3.Call localVarCall = createCustomObjectByTokenValidateBeforeCall(requestBody, customobjectid, objectname, accessToken, preventWebhook, xPreventWebhook, null); + Type localVarReturnType = new TypeToken<CustomObjectResponseModel>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Custom Object (asynchronously) + * Creates a Custom Object associated with the authenticated User using an Access Token. + * @param requestBody (required) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully created the Custom Object </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createCustomObjectByTokenAsync(Map<String, Object> requestBody, String customobjectid, String objectname, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback<CustomObjectResponseModel> _callback) throws ApiException { + + okhttp3.Call localVarCall = createCustomObjectByTokenValidateBeforeCall(requestBody, customobjectid, objectname, accessToken, preventWebhook, xPreventWebhook, _callback); + Type localVarReturnType = new TypeToken<CustomObjectResponseModel>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteCustomObjectByTokenAndRecordId + * @param objectrecordid Unique identifier for the Custom Object record. The ID is used to target a specific Custom Object. (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully deleted the Custom Object </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteCustomObjectByTokenAndRecordIdCall(String objectrecordid, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, String objectname, String customobjectid, 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 = "/identity/v2/auth/customobject/{objectrecordid}" + .replace("{" + "objectrecordid" + "}", localVarApiClient.escapeString(objectrecordid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (objectname != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("objectname", objectname)); + } + + if (customobjectid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("customobjectid", customobjectid)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteCustomObjectByTokenAndRecordIdValidateBeforeCall(String objectrecordid, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, String objectname, String customobjectid, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'objectrecordid' is set + if (objectrecordid == null) { + throw new ApiException("Missing the required parameter 'objectrecordid' when calling deleteCustomObjectByTokenAndRecordId(Async)"); + } + + return deleteCustomObjectByTokenAndRecordIdCall(objectrecordid, accessToken, preventWebhook, xPreventWebhook, objectname, customobjectid, _callback); + + } + + /** + * Delete Custom Object by ID + * Deletes the Custom Object associated with the specified User using an Access Token and record ID. + * @param objectrecordid Unique identifier for the Custom Object record. The ID is used to target a specific Custom Object. (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @return IsDeleted + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully deleted the Custom Object </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public IsDeleted deleteCustomObjectByTokenAndRecordId(String objectrecordid, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, String objectname, String customobjectid) throws ApiException { + ApiResponse<IsDeleted> localVarResp = deleteCustomObjectByTokenAndRecordIdWithHttpInfo(objectrecordid, accessToken, preventWebhook, xPreventWebhook, objectname, customobjectid); + return localVarResp.getData(); + } + + /** + * Delete Custom Object by ID + * Deletes the Custom Object associated with the specified User using an Access Token and record ID. + * @param objectrecordid Unique identifier for the Custom Object record. The ID is used to target a specific Custom Object. (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @return ApiResponse<IsDeleted> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully deleted the Custom Object </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsDeleted> deleteCustomObjectByTokenAndRecordIdWithHttpInfo(String objectrecordid, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, String objectname, String customobjectid) throws ApiException { + okhttp3.Call localVarCall = deleteCustomObjectByTokenAndRecordIdValidateBeforeCall(objectrecordid, accessToken, preventWebhook, xPreventWebhook, objectname, customobjectid, null); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Custom Object by ID (asynchronously) + * Deletes the Custom Object associated with the specified User using an Access Token and record ID. + * @param objectrecordid Unique identifier for the Custom Object record. The ID is used to target a specific Custom Object. (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully deleted the Custom Object </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteCustomObjectByTokenAndRecordIdAsync(String objectrecordid, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, String objectname, String customobjectid, final ApiCallback<IsDeleted> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteCustomObjectByTokenAndRecordIdValidateBeforeCall(objectrecordid, accessToken, preventWebhook, xPreventWebhook, objectname, customobjectid, _callback); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getCustomObjectByToken + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param accessToken Access Token of the User (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully retrieved Custom Objects </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getCustomObjectByTokenCall(String customobjectid, String objectname, String accessToken, 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 = "/identity/v2/auth/customobject"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (customobjectid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("customobjectid", customobjectid)); + } + + if (objectname != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("objectname", objectname)); + } + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + 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[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getCustomObjectByTokenValidateBeforeCall(String customobjectid, String objectname, String accessToken, final ApiCallback _callback) throws ApiException { + return getCustomObjectByTokenCall(customobjectid, objectname, accessToken, _callback); + + } + + /** + * Retrieve Custom Objects + * Retrieves Custom Objects associated with the authenticated User using an Access Token. + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param accessToken Access Token of the User (optional) + * @return CustomObjectsResponseModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully retrieved Custom Objects </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public CustomObjectsResponseModel getCustomObjectByToken(String customobjectid, String objectname, String accessToken) throws ApiException { + ApiResponse<CustomObjectsResponseModel> localVarResp = getCustomObjectByTokenWithHttpInfo(customobjectid, objectname, accessToken); + return localVarResp.getData(); + } + + /** + * Retrieve Custom Objects + * Retrieves Custom Objects associated with the authenticated User using an Access Token. + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param accessToken Access Token of the User (optional) + * @return ApiResponse<CustomObjectsResponseModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully retrieved Custom Objects </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<CustomObjectsResponseModel> getCustomObjectByTokenWithHttpInfo(String customobjectid, String objectname, String accessToken) throws ApiException { + okhttp3.Call localVarCall = getCustomObjectByTokenValidateBeforeCall(customobjectid, objectname, accessToken, null); + Type localVarReturnType = new TypeToken<CustomObjectsResponseModel>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Custom Objects (asynchronously) + * Retrieves Custom Objects associated with the authenticated User using an Access Token. + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param accessToken Access Token of the User (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully retrieved Custom Objects </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getCustomObjectByTokenAsync(String customobjectid, String objectname, String accessToken, final ApiCallback<CustomObjectsResponseModel> _callback) throws ApiException { + + okhttp3.Call localVarCall = getCustomObjectByTokenValidateBeforeCall(customobjectid, objectname, accessToken, _callback); + Type localVarReturnType = new TypeToken<CustomObjectsResponseModel>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getCustomObjectByTokenAndRecordId + * @param objectrecordid Unique identifier for the Custom Object record. The ID is used to target a specific Custom Object. (required) + * @param accessToken Access Token of the User (optional) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully retrieved the Custom Object </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getCustomObjectByTokenAndRecordIdCall(String objectrecordid, String accessToken, String objectname, String customobjectid, 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 = "/identity/v2/auth/customobject/{objectrecordid}" + .replace("{" + "objectrecordid" + "}", localVarApiClient.escapeString(objectrecordid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (objectname != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("objectname", objectname)); + } + + if (customobjectid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("customobjectid", customobjectid)); + } + + 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[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getCustomObjectByTokenAndRecordIdValidateBeforeCall(String objectrecordid, String accessToken, String objectname, String customobjectid, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'objectrecordid' is set + if (objectrecordid == null) { + throw new ApiException("Missing the required parameter 'objectrecordid' when calling getCustomObjectByTokenAndRecordId(Async)"); + } + + return getCustomObjectByTokenAndRecordIdCall(objectrecordid, accessToken, objectname, customobjectid, _callback); + + } + + /** + * Retrieve Custom Object by ID + * Retrieves the Custom Object associated with the specified User using an Access Token and record ID. + * @param objectrecordid Unique identifier for the Custom Object record. The ID is used to target a specific Custom Object. (required) + * @param accessToken Access Token of the User (optional) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @return CustomObjectResponseModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully retrieved the Custom Object </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public CustomObjectResponseModel getCustomObjectByTokenAndRecordId(String objectrecordid, String accessToken, String objectname, String customobjectid) throws ApiException { + ApiResponse<CustomObjectResponseModel> localVarResp = getCustomObjectByTokenAndRecordIdWithHttpInfo(objectrecordid, accessToken, objectname, customobjectid); + return localVarResp.getData(); + } + + /** + * Retrieve Custom Object by ID + * Retrieves the Custom Object associated with the specified User using an Access Token and record ID. + * @param objectrecordid Unique identifier for the Custom Object record. The ID is used to target a specific Custom Object. (required) + * @param accessToken Access Token of the User (optional) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @return ApiResponse<CustomObjectResponseModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully retrieved the Custom Object </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<CustomObjectResponseModel> getCustomObjectByTokenAndRecordIdWithHttpInfo(String objectrecordid, String accessToken, String objectname, String customobjectid) throws ApiException { + okhttp3.Call localVarCall = getCustomObjectByTokenAndRecordIdValidateBeforeCall(objectrecordid, accessToken, objectname, customobjectid, null); + Type localVarReturnType = new TypeToken<CustomObjectResponseModel>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Custom Object by ID (asynchronously) + * Retrieves the Custom Object associated with the specified User using an Access Token and record ID. + * @param objectrecordid Unique identifier for the Custom Object record. The ID is used to target a specific Custom Object. (required) + * @param accessToken Access Token of the User (optional) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully retrieved the Custom Object </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getCustomObjectByTokenAndRecordIdAsync(String objectrecordid, String accessToken, String objectname, String customobjectid, final ApiCallback<CustomObjectResponseModel> _callback) throws ApiException { + + okhttp3.Call localVarCall = getCustomObjectByTokenAndRecordIdValidateBeforeCall(objectrecordid, accessToken, objectname, customobjectid, _callback); + Type localVarReturnType = new TypeToken<CustomObjectResponseModel>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateCustomObjectByTokenAndRecordId + * @param objectrecordid Unique identifier for the Custom Object record. The ID is used to target a specific Custom Object. (required) + * @param updateType The type of update to be performed on the Custom Object. This parameter is used to specify whether the update should be a full update or a partial update. (required) + * @param requestBody JSON payload representing the Custom Object to be updated. (required) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully updated the Custom Object </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateCustomObjectByTokenAndRecordIdCall(String objectrecordid, String updateType, Map<String, Object> requestBody, String objectname, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, String customobjectid, 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 = requestBody; + + // create path and map variables + String localVarPath = "/identity/v2/auth/customobject/{objectrecordid}" + .replace("{" + "objectrecordid" + "}", localVarApiClient.escapeString(objectrecordid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (objectname != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("objectname", objectname)); + } + + if (updateType != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("updateType", updateType)); + } + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (customobjectid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("customobjectid", customobjectid)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateCustomObjectByTokenAndRecordIdValidateBeforeCall(String objectrecordid, String updateType, Map<String, Object> requestBody, String objectname, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, String customobjectid, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'objectrecordid' is set + if (objectrecordid == null) { + throw new ApiException("Missing the required parameter 'objectrecordid' when calling updateCustomObjectByTokenAndRecordId(Async)"); + } + + // verify the required parameter 'updateType' is set + if (updateType == null) { + throw new ApiException("Missing the required parameter 'updateType' when calling updateCustomObjectByTokenAndRecordId(Async)"); + } + + // verify the required parameter 'requestBody' is set + if (requestBody == null) { + throw new ApiException("Missing the required parameter 'requestBody' when calling updateCustomObjectByTokenAndRecordId(Async)"); + } + + return updateCustomObjectByTokenAndRecordIdCall(objectrecordid, updateType, requestBody, objectname, accessToken, preventWebhook, xPreventWebhook, customobjectid, _callback); + + } + + /** + * Update Custom Object by ID + * Updates a Custom Object associated with the authenticated User using an Access Token and record ID. + * @param objectrecordid Unique identifier for the Custom Object record. The ID is used to target a specific Custom Object. (required) + * @param updateType The type of update to be performed on the Custom Object. This parameter is used to specify whether the update should be a full update or a partial update. (required) + * @param requestBody JSON payload representing the Custom Object to be updated. (required) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @return CustomObjectResponseModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully updated the Custom Object </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public CustomObjectResponseModel updateCustomObjectByTokenAndRecordId(String objectrecordid, String updateType, Map<String, Object> requestBody, String objectname, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, String customobjectid) throws ApiException { + ApiResponse<CustomObjectResponseModel> localVarResp = updateCustomObjectByTokenAndRecordIdWithHttpInfo(objectrecordid, updateType, requestBody, objectname, accessToken, preventWebhook, xPreventWebhook, customobjectid); + return localVarResp.getData(); + } + + /** + * Update Custom Object by ID + * Updates a Custom Object associated with the authenticated User using an Access Token and record ID. + * @param objectrecordid Unique identifier for the Custom Object record. The ID is used to target a specific Custom Object. (required) + * @param updateType The type of update to be performed on the Custom Object. This parameter is used to specify whether the update should be a full update or a partial update. (required) + * @param requestBody JSON payload representing the Custom Object to be updated. (required) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @return ApiResponse<CustomObjectResponseModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully updated the Custom Object </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<CustomObjectResponseModel> updateCustomObjectByTokenAndRecordIdWithHttpInfo(String objectrecordid, String updateType, Map<String, Object> requestBody, String objectname, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, String customobjectid) throws ApiException { + okhttp3.Call localVarCall = updateCustomObjectByTokenAndRecordIdValidateBeforeCall(objectrecordid, updateType, requestBody, objectname, accessToken, preventWebhook, xPreventWebhook, customobjectid, null); + Type localVarReturnType = new TypeToken<CustomObjectResponseModel>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Custom Object by ID (asynchronously) + * Updates a Custom Object associated with the authenticated User using an Access Token and record ID. + * @param objectrecordid Unique identifier for the Custom Object record. The ID is used to target a specific Custom Object. (required) + * @param updateType The type of update to be performed on the Custom Object. This parameter is used to specify whether the update should be a full update or a partial update. (required) + * @param requestBody JSON payload representing the Custom Object to be updated. (required) + * @param objectname Name of the Custom Object to be used in the request. The name should match the Custom Object configured in your LoginRadius account. (optional) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param customobjectid Unique identifier for the Custom Object record (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully updated the Custom Object </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateCustomObjectByTokenAndRecordIdAsync(String objectrecordid, String updateType, Map<String, Object> requestBody, String objectname, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, String customobjectid, final ApiCallback<CustomObjectResponseModel> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateCustomObjectByTokenAndRecordIdValidateBeforeCall(objectrecordid, updateType, requestBody, objectname, accessToken, preventWebhook, xPreventWebhook, customobjectid, _callback); + Type localVarReturnType = new TypeToken<CustomObjectResponseModel>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/CustomObjectsApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/CustomObjectsApi.java new file mode 100644 index 0000000..9089ac5 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/CustomObjectsApi.java @@ -0,0 +1,692 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.ApiError; +import com.loginradius.sdk.internal.openapi.model.UserProfileNextResponse; +import com.loginradius.sdk.internal.openapi.model.UserProfileNextResponseWithCustomObject; +import com.loginradius.sdk.internal.openapi.model.UserProfileRequestBody; +import com.loginradius.sdk.internal.openapi.model.UserProfileScrollResponse; +import com.loginradius.sdk.internal.openapi.model.UserProfileScrollResponseWithCustomObject; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class CustomObjectsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public CustomObjectsApi() { + this(Configuration.getDefaultApiClient()); + } + + public CustomObjectsApi(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 getAllCustomObjectsByQuery + * @param customobject Custom Object identifier for filtering results. This parameter allows you to specify a Custom Object to filter the results returned by the API. (optional) + * @param region The region to filter results by. (optional) + * @param next Scroll or pagination token for fetching the next set of results. This token is used to retrieve the next page of results in a paginated response. If not provided, the API will return the first page of results. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok - The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid query parameters. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The request was valid, but the server is refusing to respond to it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllCustomObjectsByQueryCall(String customobject, String region, String next, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://cloud-api.loginradius.com" }; + + // 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 = "/customobject"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (customobject != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("customobject", customobject)); + } + + if (region != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("region", region)); + } + + if (next != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("next", next)); + } + + 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[] { "APIKey", "XLoginRadiusAPIKey", "XLoginRadiusAPISecret", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAllCustomObjectsByQueryValidateBeforeCall(String customobject, String region, String next, final ApiCallback _callback) throws ApiException { + return getAllCustomObjectsByQueryCall(customobject, region, next, _callback); + + } + + /** + * Retrieve Custom Object data by pagination + * Retrieves Custom Object data based on specified pagination parameters. + * @param customobject Custom Object identifier for filtering results. This parameter allows you to specify a Custom Object to filter the results returned by the API. (optional) + * @param region The region to filter results by. (optional) + * @param next Scroll or pagination token for fetching the next set of results. This token is used to retrieve the next page of results in a paginated response. If not provided, the API will return the first page of results. (optional) + * @return UserProfileNextResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok - The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid query parameters. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The request was valid, but the server is refusing to respond to it. </td><td> - </td></tr> + </table> + */ + public UserProfileNextResponse getAllCustomObjectsByQuery(String customobject, String region, String next) throws ApiException { + ApiResponse<UserProfileNextResponse> localVarResp = getAllCustomObjectsByQueryWithHttpInfo(customobject, region, next); + return localVarResp.getData(); + } + + /** + * Retrieve Custom Object data by pagination + * Retrieves Custom Object data based on specified pagination parameters. + * @param customobject Custom Object identifier for filtering results. This parameter allows you to specify a Custom Object to filter the results returned by the API. (optional) + * @param region The region to filter results by. (optional) + * @param next Scroll or pagination token for fetching the next set of results. This token is used to retrieve the next page of results in a paginated response. If not provided, the API will return the first page of results. (optional) + * @return ApiResponse<UserProfileNextResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok - The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid query parameters. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The request was valid, but the server is refusing to respond to it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<UserProfileNextResponse> getAllCustomObjectsByQueryWithHttpInfo(String customobject, String region, String next) throws ApiException { + okhttp3.Call localVarCall = getAllCustomObjectsByQueryValidateBeforeCall(customobject, region, next, null); + Type localVarReturnType = new TypeToken<UserProfileNextResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Custom Object data by pagination (asynchronously) + * Retrieves Custom Object data based on specified pagination parameters. + * @param customobject Custom Object identifier for filtering results. This parameter allows you to specify a Custom Object to filter the results returned by the API. (optional) + * @param region The region to filter results by. (optional) + * @param next Scroll or pagination token for fetching the next set of results. This token is used to retrieve the next page of results in a paginated response. If not provided, the API will return the first page of results. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok - The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid query parameters. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The request was valid, but the server is refusing to respond to it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllCustomObjectsByQueryAsync(String customobject, String region, String next, final ApiCallback<UserProfileNextResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getAllCustomObjectsByQueryValidateBeforeCall(customobject, region, next, _callback); + Type localVarReturnType = new TypeToken<UserProfileNextResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getCustomObjectByQuery + * @param region The region to filter results by. (optional) + * @param customobject Custom Object identifier for filtering results. This parameter allows you to specify a Custom Object to filter the results returned by the API. (optional) + * @param next Scroll or pagination token for fetching the next set of results. This token is used to retrieve the next page of results in a paginated response. If not provided, the API will return the first page of results. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok - The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid query parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The request was valid, but the server is refusing to respond to it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getCustomObjectByQueryCall(String region, String customobject, String next, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://cloud-api.loginradius.com" }; + + // 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 = "/identity/customobject"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (region != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("region", region)); + } + + if (customobject != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("customobject", customobject)); + } + + if (next != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("next", next)); + } + + 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[] { "APIKey", "XLoginRadiusAPIKey", "XLoginRadiusAPISecret", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getCustomObjectByQueryValidateBeforeCall(String region, String customobject, String next, final ApiCallback _callback) throws ApiException { + return getCustomObjectByQueryCall(region, customobject, next, _callback); + + } + + /** + * Retrieve User's and Custom Object data by pagination + * Retrieves User's and Custom Object data per User based on the pagination parameters. + * @param region The region to filter results by. (optional) + * @param customobject Custom Object identifier for filtering results. This parameter allows you to specify a Custom Object to filter the results returned by the API. (optional) + * @param next Scroll or pagination token for fetching the next set of results. This token is used to retrieve the next page of results in a paginated response. If not provided, the API will return the first page of results. (optional) + * @return UserProfileNextResponseWithCustomObject + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok - The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid query parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The request was valid, but the server is refusing to respond to it. </td><td> - </td></tr> + </table> + */ + public UserProfileNextResponseWithCustomObject getCustomObjectByQuery(String region, String customobject, String next) throws ApiException { + ApiResponse<UserProfileNextResponseWithCustomObject> localVarResp = getCustomObjectByQueryWithHttpInfo(region, customobject, next); + return localVarResp.getData(); + } + + /** + * Retrieve User's and Custom Object data by pagination + * Retrieves User's and Custom Object data per User based on the pagination parameters. + * @param region The region to filter results by. (optional) + * @param customobject Custom Object identifier for filtering results. This parameter allows you to specify a Custom Object to filter the results returned by the API. (optional) + * @param next Scroll or pagination token for fetching the next set of results. This token is used to retrieve the next page of results in a paginated response. If not provided, the API will return the first page of results. (optional) + * @return ApiResponse<UserProfileNextResponseWithCustomObject> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok - The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid query parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The request was valid, but the server is refusing to respond to it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<UserProfileNextResponseWithCustomObject> getCustomObjectByQueryWithHttpInfo(String region, String customobject, String next) throws ApiException { + okhttp3.Call localVarCall = getCustomObjectByQueryValidateBeforeCall(region, customobject, next, null); + Type localVarReturnType = new TypeToken<UserProfileNextResponseWithCustomObject>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve User's and Custom Object data by pagination (asynchronously) + * Retrieves User's and Custom Object data per User based on the pagination parameters. + * @param region The region to filter results by. (optional) + * @param customobject Custom Object identifier for filtering results. This parameter allows you to specify a Custom Object to filter the results returned by the API. (optional) + * @param next Scroll or pagination token for fetching the next set of results. This token is used to retrieve the next page of results in a paginated response. If not provided, the API will return the first page of results. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok - The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid query parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The request was valid, but the server is refusing to respond to it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getCustomObjectByQueryAsync(String region, String customobject, String next, final ApiCallback<UserProfileNextResponseWithCustomObject> _callback) throws ApiException { + + okhttp3.Call localVarCall = getCustomObjectByQueryValidateBeforeCall(region, customobject, next, _callback); + Type localVarReturnType = new TypeToken<UserProfileNextResponseWithCustomObject>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for postAllCustomObjectsByQuery + * @param userProfileRequestBody (required) + * @param customobject Custom Object identifier for filtering results. This parameter allows you to specify a Custom Object to filter the results returned by the API. (optional) + * @param region The region to filter results by. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok - The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid query parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The request was valid, but the server is refusing to respond to it due to access restrictions. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call postAllCustomObjectsByQueryCall(UserProfileRequestBody userProfileRequestBody, String customobject, String region, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://cloud-api.loginradius.com" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = userProfileRequestBody; + + // create path and map variables + String localVarPath = "/customobject"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (customobject != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("customobject", customobject)); + } + + if (region != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("region", region)); + } + + 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[] { "APIKey", "XLoginRadiusAPIKey", "XLoginRadiusAPISecret", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call postAllCustomObjectsByQueryValidateBeforeCall(UserProfileRequestBody userProfileRequestBody, String customobject, String region, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userProfileRequestBody' is set + if (userProfileRequestBody == null) { + throw new ApiException("Missing the required parameter 'userProfileRequestBody' when calling postAllCustomObjectsByQuery(Async)"); + } + + return postAllCustomObjectsByQueryCall(userProfileRequestBody, customobject, region, _callback); + + } + + /** + * Retrieve Custom Object data by query + * Retrieves Custom Object data based on specified query filters. + * @param userProfileRequestBody (required) + * @param customobject Custom Object identifier for filtering results. This parameter allows you to specify a Custom Object to filter the results returned by the API. (optional) + * @param region The region to filter results by. (optional) + * @return UserProfileScrollResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok - The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid query parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The request was valid, but the server is refusing to respond to it due to access restrictions. </td><td> - </td></tr> + </table> + */ + public UserProfileScrollResponse postAllCustomObjectsByQuery(UserProfileRequestBody userProfileRequestBody, String customobject, String region) throws ApiException { + ApiResponse<UserProfileScrollResponse> localVarResp = postAllCustomObjectsByQueryWithHttpInfo(userProfileRequestBody, customobject, region); + return localVarResp.getData(); + } + + /** + * Retrieve Custom Object data by query + * Retrieves Custom Object data based on specified query filters. + * @param userProfileRequestBody (required) + * @param customobject Custom Object identifier for filtering results. This parameter allows you to specify a Custom Object to filter the results returned by the API. (optional) + * @param region The region to filter results by. (optional) + * @return ApiResponse<UserProfileScrollResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok - The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid query parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The request was valid, but the server is refusing to respond to it due to access restrictions. </td><td> - </td></tr> + </table> + */ + public ApiResponse<UserProfileScrollResponse> postAllCustomObjectsByQueryWithHttpInfo(UserProfileRequestBody userProfileRequestBody, String customobject, String region) throws ApiException { + okhttp3.Call localVarCall = postAllCustomObjectsByQueryValidateBeforeCall(userProfileRequestBody, customobject, region, null); + Type localVarReturnType = new TypeToken<UserProfileScrollResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Custom Object data by query (asynchronously) + * Retrieves Custom Object data based on specified query filters. + * @param userProfileRequestBody (required) + * @param customobject Custom Object identifier for filtering results. This parameter allows you to specify a Custom Object to filter the results returned by the API. (optional) + * @param region The region to filter results by. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok - The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid query parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The request was valid, but the server is refusing to respond to it due to access restrictions. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call postAllCustomObjectsByQueryAsync(UserProfileRequestBody userProfileRequestBody, String customobject, String region, final ApiCallback<UserProfileScrollResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = postAllCustomObjectsByQueryValidateBeforeCall(userProfileRequestBody, customobject, region, _callback); + Type localVarReturnType = new TypeToken<UserProfileScrollResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for postCustomObjectByQuery + * @param userProfileRequestBody (required) + * @param region The region to filter results by. (optional) + * @param customobject Custom Object identifier for filtering results. This parameter allows you to specify a Custom Object to filter the results returned by the API. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok - The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid query parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The request was valid, but the server is refusing to respond to it </td><td> - </td></tr> + </table> + */ + public okhttp3.Call postCustomObjectByQueryCall(UserProfileRequestBody userProfileRequestBody, String region, String customobject, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://cloud-api.loginradius.com" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = userProfileRequestBody; + + // create path and map variables + String localVarPath = "/identity/customobject"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (region != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("region", region)); + } + + if (customobject != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("customobject", customobject)); + } + + 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[] { "APIKey", "XLoginRadiusAPIKey", "XLoginRadiusAPISecret", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call postCustomObjectByQueryValidateBeforeCall(UserProfileRequestBody userProfileRequestBody, String region, String customobject, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userProfileRequestBody' is set + if (userProfileRequestBody == null) { + throw new ApiException("Missing the required parameter 'userProfileRequestBody' when calling postCustomObjectByQuery(Async)"); + } + + return postCustomObjectByQueryCall(userProfileRequestBody, region, customobject, _callback); + + } + + /** + * Retrieve User's and Custom Object data by query + * Retrieves User's and Custom Objects data per User based on the query. + * @param userProfileRequestBody (required) + * @param region The region to filter results by. (optional) + * @param customobject Custom Object identifier for filtering results. This parameter allows you to specify a Custom Object to filter the results returned by the API. (optional) + * @return UserProfileScrollResponseWithCustomObject + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok - The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid query parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The request was valid, but the server is refusing to respond to it </td><td> - </td></tr> + </table> + */ + public UserProfileScrollResponseWithCustomObject postCustomObjectByQuery(UserProfileRequestBody userProfileRequestBody, String region, String customobject) throws ApiException { + ApiResponse<UserProfileScrollResponseWithCustomObject> localVarResp = postCustomObjectByQueryWithHttpInfo(userProfileRequestBody, region, customobject); + return localVarResp.getData(); + } + + /** + * Retrieve User's and Custom Object data by query + * Retrieves User's and Custom Objects data per User based on the query. + * @param userProfileRequestBody (required) + * @param region The region to filter results by. (optional) + * @param customobject Custom Object identifier for filtering results. This parameter allows you to specify a Custom Object to filter the results returned by the API. (optional) + * @return ApiResponse<UserProfileScrollResponseWithCustomObject> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok - The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid query parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The request was valid, but the server is refusing to respond to it </td><td> - </td></tr> + </table> + */ + public ApiResponse<UserProfileScrollResponseWithCustomObject> postCustomObjectByQueryWithHttpInfo(UserProfileRequestBody userProfileRequestBody, String region, String customobject) throws ApiException { + okhttp3.Call localVarCall = postCustomObjectByQueryValidateBeforeCall(userProfileRequestBody, region, customobject, null); + Type localVarReturnType = new TypeToken<UserProfileScrollResponseWithCustomObject>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve User's and Custom Object data by query (asynchronously) + * Retrieves User's and Custom Objects data per User based on the query. + * @param userProfileRequestBody (required) + * @param region The region to filter results by. (optional) + * @param customobject Custom Object identifier for filtering results. This parameter allows you to specify a Custom Object to filter the results returned by the API. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok - The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid query parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The request was valid, but the server is refusing to respond to it </td><td> - </td></tr> + </table> + */ + public okhttp3.Call postCustomObjectByQueryAsync(UserProfileRequestBody userProfileRequestBody, String region, String customobject, final ApiCallback<UserProfileScrollResponseWithCustomObject> _callback) throws ApiException { + + okhttp3.Call localVarCall = postCustomObjectByQueryValidateBeforeCall(userProfileRequestBody, region, customobject, _callback); + Type localVarReturnType = new TypeToken<UserProfileScrollResponseWithCustomObject>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/DomainAccessRestrictionsApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/DomainAccessRestrictionsApi.java new file mode 100644 index 0000000..4f0c648 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/DomainAccessRestrictionsApi.java @@ -0,0 +1,339 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.DomainAccessRestrictions; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class DomainAccessRestrictionsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public DomainAccessRestrictionsApi() { + this(Configuration.getDefaultApiClient()); + } + + public DomainAccessRestrictionsApi(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 getDomainAccessRestrictionsByAppID + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getDomainAccessRestrictionsByAppIDCall(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 = "/v2/manage/restrictions/domain-access"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getDomainAccessRestrictionsByAppIDValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getDomainAccessRestrictionsByAppIDCall(_callback); + + } + + /** + * Retrieve Domain Access Restrictions + * Retrieves the domain access restrictions configured for the Tenant. + * @return DomainAccessRestrictions + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public DomainAccessRestrictions getDomainAccessRestrictionsByAppID() throws ApiException { + ApiResponse<DomainAccessRestrictions> localVarResp = getDomainAccessRestrictionsByAppIDWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Retrieve Domain Access Restrictions + * Retrieves the domain access restrictions configured for the Tenant. + * @return ApiResponse<DomainAccessRestrictions> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DomainAccessRestrictions> getDomainAccessRestrictionsByAppIDWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getDomainAccessRestrictionsByAppIDValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<DomainAccessRestrictions>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Domain Access Restrictions (asynchronously) + * Retrieves the domain access restrictions configured for the Tenant. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getDomainAccessRestrictionsByAppIDAsync(final ApiCallback<DomainAccessRestrictions> _callback) throws ApiException { + + okhttp3.Call localVarCall = getDomainAccessRestrictionsByAppIDValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<DomainAccessRestrictions>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateDomainAccessRestrictionsByAppID + * @param domainAccessRestrictions (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateDomainAccessRestrictionsByAppIDCall(DomainAccessRestrictions domainAccessRestrictions, 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 = domainAccessRestrictions; + + // create path and map variables + String localVarPath = "/v2/manage/restrictions/domain-access"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateDomainAccessRestrictionsByAppIDValidateBeforeCall(DomainAccessRestrictions domainAccessRestrictions, final ApiCallback _callback) throws ApiException { + return updateDomainAccessRestrictionsByAppIDCall(domainAccessRestrictions, _callback); + + } + + /** + * Update Domain Access Restrictions + * Updates the domain access restrictions for the Tenant. + * @param domainAccessRestrictions (optional) + * @return DomainAccessRestrictions + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public DomainAccessRestrictions updateDomainAccessRestrictionsByAppID(DomainAccessRestrictions domainAccessRestrictions) throws ApiException { + ApiResponse<DomainAccessRestrictions> localVarResp = updateDomainAccessRestrictionsByAppIDWithHttpInfo(domainAccessRestrictions); + return localVarResp.getData(); + } + + /** + * Update Domain Access Restrictions + * Updates the domain access restrictions for the Tenant. + * @param domainAccessRestrictions (optional) + * @return ApiResponse<DomainAccessRestrictions> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DomainAccessRestrictions> updateDomainAccessRestrictionsByAppIDWithHttpInfo(DomainAccessRestrictions domainAccessRestrictions) throws ApiException { + okhttp3.Call localVarCall = updateDomainAccessRestrictionsByAppIDValidateBeforeCall(domainAccessRestrictions, null); + Type localVarReturnType = new TypeToken<DomainAccessRestrictions>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Domain Access Restrictions (asynchronously) + * Updates the domain access restrictions for the Tenant. + * @param domainAccessRestrictions (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateDomainAccessRestrictionsByAppIDAsync(DomainAccessRestrictions domainAccessRestrictions, final ApiCallback<DomainAccessRestrictions> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateDomainAccessRestrictionsByAppIDValidateBeforeCall(domainAccessRestrictions, _callback); + Type localVarReturnType = new TypeToken<DomainAccessRestrictions>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/EmailTemplatesApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/EmailTemplatesApi.java new file mode 100644 index 0000000..95622dc --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/EmailTemplatesApi.java @@ -0,0 +1,654 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.DeleteEmailTemplate; +import com.loginradius.sdk.internal.openapi.model.DeleteResponse; +import com.loginradius.sdk.internal.openapi.model.EmailTemplateModel; +import com.loginradius.sdk.internal.openapi.model.EmailTemplateResponse; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.GetEmailTemplates200Response; +import com.loginradius.sdk.internal.openapi.model.UpdateEmailTemplate; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class EmailTemplatesApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public EmailTemplatesApi() { + this(Configuration.getDefaultApiClient()); + } + + public EmailTemplatesApi(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 addEmailTemplate + * @param emailTemplateModel (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call addEmailTemplateCall(EmailTemplateModel emailTemplateModel, 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 = emailTemplateModel; + + // create path and map variables + String localVarPath = "/v2/manage/email-templates"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call addEmailTemplateValidateBeforeCall(EmailTemplateModel emailTemplateModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'emailTemplateModel' is set + if (emailTemplateModel == null) { + throw new ApiException("Missing the required parameter 'emailTemplateModel' when calling addEmailTemplate(Async)"); + } + + return addEmailTemplateCall(emailTemplateModel, _callback); + + } + + /** + * Create Email template + * Adds a new Email template to the Tenant's configuration. + * @param emailTemplateModel (required) + * @return EmailTemplateResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public EmailTemplateResponse addEmailTemplate(EmailTemplateModel emailTemplateModel) throws ApiException { + ApiResponse<EmailTemplateResponse> localVarResp = addEmailTemplateWithHttpInfo(emailTemplateModel); + return localVarResp.getData(); + } + + /** + * Create Email template + * Adds a new Email template to the Tenant's configuration. + * @param emailTemplateModel (required) + * @return ApiResponse<EmailTemplateResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<EmailTemplateResponse> addEmailTemplateWithHttpInfo(EmailTemplateModel emailTemplateModel) throws ApiException { + okhttp3.Call localVarCall = addEmailTemplateValidateBeforeCall(emailTemplateModel, null); + Type localVarReturnType = new TypeToken<EmailTemplateResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Email template (asynchronously) + * Adds a new Email template to the Tenant's configuration. + * @param emailTemplateModel (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call addEmailTemplateAsync(EmailTemplateModel emailTemplateModel, final ApiCallback<EmailTemplateResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = addEmailTemplateValidateBeforeCall(emailTemplateModel, _callback); + Type localVarReturnType = new TypeToken<EmailTemplateResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteEmailTemplate + * @param templateType The type of Email template to delete. (required) + * @param deleteEmailTemplate (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteEmailTemplateCall(String templateType, DeleteEmailTemplate deleteEmailTemplate, 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 = deleteEmailTemplate; + + // create path and map variables + String localVarPath = "/v2/manage/email-templates/{templateType}" + .replace("{" + "templateType" + "}", localVarApiClient.escapeString(templateType.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteEmailTemplateValidateBeforeCall(String templateType, DeleteEmailTemplate deleteEmailTemplate, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'templateType' is set + if (templateType == null) { + throw new ApiException("Missing the required parameter 'templateType' when calling deleteEmailTemplate(Async)"); + } + + return deleteEmailTemplateCall(templateType, deleteEmailTemplate, _callback); + + } + + /** + * Delete Email Template + * Deletes the Email template for a specified Email template type within a specific Tenant. + * @param templateType The type of Email template to delete. (required) + * @param deleteEmailTemplate (optional) + * @return DeleteResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public DeleteResponse deleteEmailTemplate(String templateType, DeleteEmailTemplate deleteEmailTemplate) throws ApiException { + ApiResponse<DeleteResponse> localVarResp = deleteEmailTemplateWithHttpInfo(templateType, deleteEmailTemplate); + return localVarResp.getData(); + } + + /** + * Delete Email Template + * Deletes the Email template for a specified Email template type within a specific Tenant. + * @param templateType The type of Email template to delete. (required) + * @param deleteEmailTemplate (optional) + * @return ApiResponse<DeleteResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DeleteResponse> deleteEmailTemplateWithHttpInfo(String templateType, DeleteEmailTemplate deleteEmailTemplate) throws ApiException { + okhttp3.Call localVarCall = deleteEmailTemplateValidateBeforeCall(templateType, deleteEmailTemplate, null); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Email Template (asynchronously) + * Deletes the Email template for a specified Email template type within a specific Tenant. + * @param templateType The type of Email template to delete. (required) + * @param deleteEmailTemplate (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteEmailTemplateAsync(String templateType, DeleteEmailTemplate deleteEmailTemplate, final ApiCallback<DeleteResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteEmailTemplateValidateBeforeCall(templateType, deleteEmailTemplate, _callback); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getEmailTemplates + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getEmailTemplatesCall(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 = "/v2/manage/email-templates"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getEmailTemplatesValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getEmailTemplatesCall(_callback); + + } + + /** + * List Email templates + * Retrieves all Email templates configured for the Tenant. + * @return GetEmailTemplates200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public GetEmailTemplates200Response getEmailTemplates() throws ApiException { + ApiResponse<GetEmailTemplates200Response> localVarResp = getEmailTemplatesWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List Email templates + * Retrieves all Email templates configured for the Tenant. + * @return ApiResponse<GetEmailTemplates200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetEmailTemplates200Response> getEmailTemplatesWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getEmailTemplatesValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<GetEmailTemplates200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Email templates (asynchronously) + * Retrieves all Email templates configured for the Tenant. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getEmailTemplatesAsync(final ApiCallback<GetEmailTemplates200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getEmailTemplatesValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<GetEmailTemplates200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateEmailTemplate + * @param templateType The type of Email template to delete. (required) + * @param updateEmailTemplate (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateEmailTemplateCall(String templateType, UpdateEmailTemplate updateEmailTemplate, 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 = updateEmailTemplate; + + // create path and map variables + String localVarPath = "/v2/manage/email-templates/{templateType}" + .replace("{" + "templateType" + "}", localVarApiClient.escapeString(templateType.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateEmailTemplateValidateBeforeCall(String templateType, UpdateEmailTemplate updateEmailTemplate, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'templateType' is set + if (templateType == null) { + throw new ApiException("Missing the required parameter 'templateType' when calling updateEmailTemplate(Async)"); + } + + // verify the required parameter 'updateEmailTemplate' is set + if (updateEmailTemplate == null) { + throw new ApiException("Missing the required parameter 'updateEmailTemplate' when calling updateEmailTemplate(Async)"); + } + + return updateEmailTemplateCall(templateType, updateEmailTemplate, _callback); + + } + + /** + * Update Email Template + * Updates the Email template for a specified Email template type within a specific Tenant. + * @param templateType The type of Email template to delete. (required) + * @param updateEmailTemplate (required) + * @return EmailTemplateResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public EmailTemplateResponse updateEmailTemplate(String templateType, UpdateEmailTemplate updateEmailTemplate) throws ApiException { + ApiResponse<EmailTemplateResponse> localVarResp = updateEmailTemplateWithHttpInfo(templateType, updateEmailTemplate); + return localVarResp.getData(); + } + + /** + * Update Email Template + * Updates the Email template for a specified Email template type within a specific Tenant. + * @param templateType The type of Email template to delete. (required) + * @param updateEmailTemplate (required) + * @return ApiResponse<EmailTemplateResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<EmailTemplateResponse> updateEmailTemplateWithHttpInfo(String templateType, UpdateEmailTemplate updateEmailTemplate) throws ApiException { + okhttp3.Call localVarCall = updateEmailTemplateValidateBeforeCall(templateType, updateEmailTemplate, null); + Type localVarReturnType = new TypeToken<EmailTemplateResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Email Template (asynchronously) + * Updates the Email template for a specified Email template type within a specific Tenant. + * @param templateType The type of Email template to delete. (required) + * @param updateEmailTemplate (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateEmailTemplateAsync(String templateType, UpdateEmailTemplate updateEmailTemplate, final ApiCallback<EmailTemplateResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateEmailTemplateValidateBeforeCall(templateType, updateEmailTemplate, _callback); + Type localVarReturnType = new TypeToken<EmailTemplateResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/IdentityApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/IdentityApi.java new file mode 100644 index 0000000..9660b7f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/IdentityApi.java @@ -0,0 +1,370 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.ApiError; +import com.loginradius.sdk.internal.openapi.model.UserProfileRequestBody; +import com.loginradius.sdk.internal.openapi.model.UserProfileResponse; +import com.loginradius.sdk.internal.openapi.model.UserProfileScrollResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class IdentityApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public IdentityApi() { + this(Configuration.getDefaultApiClient()); + } + + public IdentityApi(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 getUserProfilesByPageId + * @param next Scroll or pagination token for fetching the next set of results. This token is used to retrieve the next page of results in a paginated response. If not provided, the API will return the first page of results. (optional) + * @param region The region to filter results by. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok - The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid query parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - Access to the resource is denied. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getUserProfilesByPageIdCall(String next, String region, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://cloud-api.loginradius.com" }; + + // 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 = "/identity"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (next != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("next", next)); + } + + if (region != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("region", region)); + } + + 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[] { "APIKey", "XLoginRadiusAPIKey", "XLoginRadiusAPISecret", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getUserProfilesByPageIdValidateBeforeCall(String next, String region, final ApiCallback _callback) throws ApiException { + return getUserProfilesByPageIdCall(next, region, _callback); + + } + + /** + * Retrieve User's by pagination + * Retrieves User's data using the specified pagination parameters. + * @param next Scroll or pagination token for fetching the next set of results. This token is used to retrieve the next page of results in a paginated response. If not provided, the API will return the first page of results. (optional) + * @param region The region to filter results by. (optional) + * @return UserProfileResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok - The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid query parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - Access to the resource is denied. </td><td> - </td></tr> + </table> + */ + public UserProfileResponse getUserProfilesByPageId(String next, String region) throws ApiException { + ApiResponse<UserProfileResponse> localVarResp = getUserProfilesByPageIdWithHttpInfo(next, region); + return localVarResp.getData(); + } + + /** + * Retrieve User's by pagination + * Retrieves User's data using the specified pagination parameters. + * @param next Scroll or pagination token for fetching the next set of results. This token is used to retrieve the next page of results in a paginated response. If not provided, the API will return the first page of results. (optional) + * @param region The region to filter results by. (optional) + * @return ApiResponse<UserProfileResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok - The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid query parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - Access to the resource is denied. </td><td> - </td></tr> + </table> + */ + public ApiResponse<UserProfileResponse> getUserProfilesByPageIdWithHttpInfo(String next, String region) throws ApiException { + okhttp3.Call localVarCall = getUserProfilesByPageIdValidateBeforeCall(next, region, null); + Type localVarReturnType = new TypeToken<UserProfileResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve User's by pagination (asynchronously) + * Retrieves User's data using the specified pagination parameters. + * @param next Scroll or pagination token for fetching the next set of results. This token is used to retrieve the next page of results in a paginated response. If not provided, the API will return the first page of results. (optional) + * @param region The region to filter results by. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok - The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid query parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - Access to the resource is denied. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getUserProfilesByPageIdAsync(String next, String region, final ApiCallback<UserProfileResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getUserProfilesByPageIdValidateBeforeCall(next, region, _callback); + Type localVarReturnType = new TypeToken<UserProfileResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for queryUserProfiles + * @param userProfileRequestBody (required) + * @param region The region to filter results by. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok -The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid query parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - Access to the resource is denied. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call queryUserProfilesCall(UserProfileRequestBody userProfileRequestBody, String region, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://cloud-api.loginradius.com" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = userProfileRequestBody; + + // create path and map variables + String localVarPath = "/identity"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (region != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("region", region)); + } + + 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[] { "APIKey", "XLoginRadiusAPIKey", "XLoginRadiusAPISecret", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call queryUserProfilesValidateBeforeCall(UserProfileRequestBody userProfileRequestBody, String region, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userProfileRequestBody' is set + if (userProfileRequestBody == null) { + throw new ApiException("Missing the required parameter 'userProfileRequestBody' when calling queryUserProfiles(Async)"); + } + + return queryUserProfilesCall(userProfileRequestBody, region, _callback); + + } + + /** + * Retrieve User's by query + * Retrieves User's data based on specified query filters. + * @param userProfileRequestBody (required) + * @param region The region to filter results by. (optional) + * @return UserProfileScrollResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok -The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid query parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - Access to the resource is denied. </td><td> - </td></tr> + </table> + */ + public UserProfileScrollResponse queryUserProfiles(UserProfileRequestBody userProfileRequestBody, String region) throws ApiException { + ApiResponse<UserProfileScrollResponse> localVarResp = queryUserProfilesWithHttpInfo(userProfileRequestBody, region); + return localVarResp.getData(); + } + + /** + * Retrieve User's by query + * Retrieves User's data based on specified query filters. + * @param userProfileRequestBody (required) + * @param region The region to filter results by. (optional) + * @return ApiResponse<UserProfileScrollResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok -The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid query parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - Access to the resource is denied. </td><td> - </td></tr> + </table> + */ + public ApiResponse<UserProfileScrollResponse> queryUserProfilesWithHttpInfo(UserProfileRequestBody userProfileRequestBody, String region) throws ApiException { + okhttp3.Call localVarCall = queryUserProfilesValidateBeforeCall(userProfileRequestBody, region, null); + Type localVarReturnType = new TypeToken<UserProfileScrollResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve User's by query (asynchronously) + * Retrieves User's data based on specified query filters. + * @param userProfileRequestBody (required) + * @param region The region to filter results by. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok -The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid query parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - Access to the resource is denied. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call queryUserProfilesAsync(UserProfileRequestBody userProfileRequestBody, String region, final ApiCallback<UserProfileScrollResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = queryUserProfilesValidateBeforeCall(userProfileRequestBody, region, _callback); + Type localVarReturnType = new TypeToken<UserProfileScrollResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/InsightsApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/InsightsApi.java new file mode 100644 index 0000000..c4fedb4 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/InsightsApi.java @@ -0,0 +1,224 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.ApiError; +import com.loginradius.sdk.internal.openapi.model.InsightsResponse; +import com.loginradius.sdk.internal.openapi.model.RequestPayload; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class InsightsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public InsightsApi() { + this(Configuration.getDefaultApiClient()); + } + + public InsightsApi(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 queryUserProfilesInsights + * @param requestPayload (required) + * @param region The region to filter results by. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successful response with User data. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The request was valid, but the server is refusing to respond to it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call queryUserProfilesInsightsCall(RequestPayload requestPayload, String region, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://cloud-api.loginradius.com" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = requestPayload; + + // create path and map variables + String localVarPath = "/insights/userprofiles"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (region != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("region", region)); + } + + 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[] { "APIKey", "XLoginRadiusAPIKey", "XLoginRadiusAPISecret", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call queryUserProfilesInsightsValidateBeforeCall(RequestPayload requestPayload, String region, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'requestPayload' is set + if (requestPayload == null) { + throw new ApiException("Missing the required parameter 'requestPayload' when calling queryUserProfilesInsights(Async)"); + } + + return queryUserProfilesInsightsCall(requestPayload, region, _callback); + + } + + /** + * Retrieve User's data by filters + * Retrieves users based on specified query parameters. + * @param requestPayload (required) + * @param region The region to filter results by. (optional) + * @return InsightsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successful response with User data. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The request was valid, but the server is refusing to respond to it. </td><td> - </td></tr> + </table> + */ + public InsightsResponse queryUserProfilesInsights(RequestPayload requestPayload, String region) throws ApiException { + ApiResponse<InsightsResponse> localVarResp = queryUserProfilesInsightsWithHttpInfo(requestPayload, region); + return localVarResp.getData(); + } + + /** + * Retrieve User's data by filters + * Retrieves users based on specified query parameters. + * @param requestPayload (required) + * @param region The region to filter results by. (optional) + * @return ApiResponse<InsightsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successful response with User data. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The request was valid, but the server is refusing to respond to it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<InsightsResponse> queryUserProfilesInsightsWithHttpInfo(RequestPayload requestPayload, String region) throws ApiException { + okhttp3.Call localVarCall = queryUserProfilesInsightsValidateBeforeCall(requestPayload, region, null); + Type localVarReturnType = new TypeToken<InsightsResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve User's data by filters (asynchronously) + * Retrieves users based on specified query parameters. + * @param requestPayload (required) + * @param region The region to filter results by. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successful response with User data. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The request was valid, but the server is refusing to respond to it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call queryUserProfilesInsightsAsync(RequestPayload requestPayload, String region, final ApiCallback<InsightsResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = queryUserProfilesInsightsValidateBeforeCall(requestPayload, region, _callback); + Type localVarReturnType = new TypeToken<InsightsResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/IpAccessRestrictionsApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/IpAccessRestrictionsApi.java new file mode 100644 index 0000000..69454b9 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/IpAccessRestrictionsApi.java @@ -0,0 +1,462 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.DeleteResponse; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.IPAccessRestrictions; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class IpAccessRestrictionsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public IpAccessRestrictionsApi() { + this(Configuration.getDefaultApiClient()); + } + + public IpAccessRestrictionsApi(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 getIPAccessRestrictions + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getIPAccessRestrictionsCall(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 = "/v2/manage/restrictions/ip-access"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getIPAccessRestrictionsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getIPAccessRestrictionsCall(_callback); + + } + + /** + * Retrieve IP Access Restrictions + * Retrieves the IP access restrictions configured for a specific Tenant. + * @return IPAccessRestrictions + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public IPAccessRestrictions getIPAccessRestrictions() throws ApiException { + ApiResponse<IPAccessRestrictions> localVarResp = getIPAccessRestrictionsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Retrieve IP Access Restrictions + * Retrieves the IP access restrictions configured for a specific Tenant. + * @return ApiResponse<IPAccessRestrictions> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IPAccessRestrictions> getIPAccessRestrictionsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getIPAccessRestrictionsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<IPAccessRestrictions>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve IP Access Restrictions (asynchronously) + * Retrieves the IP access restrictions configured for a specific Tenant. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getIPAccessRestrictionsAsync(final ApiCallback<IPAccessRestrictions> _callback) throws ApiException { + + okhttp3.Call localVarCall = getIPAccessRestrictionsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<IPAccessRestrictions>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for resetIPAccessRestrictions + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetIPAccessRestrictionsCall(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 = "/v2/manage/restrictions/ip-access"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call resetIPAccessRestrictionsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return resetIPAccessRestrictionsCall(_callback); + + } + + /** + * Reset IP Access Restrictions + * Resets the IP access restrictions to their default state. + * @return DeleteResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public DeleteResponse resetIPAccessRestrictions() throws ApiException { + ApiResponse<DeleteResponse> localVarResp = resetIPAccessRestrictionsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Reset IP Access Restrictions + * Resets the IP access restrictions to their default state. + * @return ApiResponse<DeleteResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DeleteResponse> resetIPAccessRestrictionsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = resetIPAccessRestrictionsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Reset IP Access Restrictions (asynchronously) + * Resets the IP access restrictions to their default state. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetIPAccessRestrictionsAsync(final ApiCallback<DeleteResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = resetIPAccessRestrictionsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateIPAccessRestrictions + * @param ipAccessRestrictions (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateIPAccessRestrictionsCall(IPAccessRestrictions ipAccessRestrictions, 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 = ipAccessRestrictions; + + // create path and map variables + String localVarPath = "/v2/manage/restrictions/ip-access"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateIPAccessRestrictionsValidateBeforeCall(IPAccessRestrictions ipAccessRestrictions, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'ipAccessRestrictions' is set + if (ipAccessRestrictions == null) { + throw new ApiException("Missing the required parameter 'ipAccessRestrictions' when calling updateIPAccessRestrictions(Async)"); + } + + return updateIPAccessRestrictionsCall(ipAccessRestrictions, _callback); + + } + + /** + * Update IP Access Restrictions + * Updates the IP access restrictions for a specific Tenant. + * @param ipAccessRestrictions (required) + * @return IPAccessRestrictions + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public IPAccessRestrictions updateIPAccessRestrictions(IPAccessRestrictions ipAccessRestrictions) throws ApiException { + ApiResponse<IPAccessRestrictions> localVarResp = updateIPAccessRestrictionsWithHttpInfo(ipAccessRestrictions); + return localVarResp.getData(); + } + + /** + * Update IP Access Restrictions + * Updates the IP access restrictions for a specific Tenant. + * @param ipAccessRestrictions (required) + * @return ApiResponse<IPAccessRestrictions> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IPAccessRestrictions> updateIPAccessRestrictionsWithHttpInfo(IPAccessRestrictions ipAccessRestrictions) throws ApiException { + okhttp3.Call localVarCall = updateIPAccessRestrictionsValidateBeforeCall(ipAccessRestrictions, null); + Type localVarReturnType = new TypeToken<IPAccessRestrictions>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update IP Access Restrictions (asynchronously) + * Updates the IP access restrictions for a specific Tenant. + * @param ipAccessRestrictions (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateIPAccessRestrictionsAsync(IPAccessRestrictions ipAccessRestrictions, final ApiCallback<IPAccessRestrictions> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateIPAccessRestrictionsValidateBeforeCall(ipAccessRestrictions, _callback); + Type localVarReturnType = new TypeToken<IPAccessRestrictions>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/JwtApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/JwtApi.java new file mode 100644 index 0000000..b6b88de --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/JwtApi.java @@ -0,0 +1,382 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.GetJWTTokenByLoginCredentialsRequest; +import com.loginradius.sdk.internal.openapi.model.JWTSignature; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class JwtApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public JwtApi() { + this(Configuration.getDefaultApiClient()); + } + + public JwtApi(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 getJWTTokenByAccessToken + * @param jwtAppName JWT App Name (required) + * @param nonce random nonce claim (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getJWTTokenByAccessTokenCall(String jwtAppName, String nonce, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://{TenantName}.hub.loginradius.com", "https://{CustomDomain}" }; + + // 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 = "/api/jwt/{JwtAppName}/token" + .replace("{" + "JwtAppName" + "}", localVarApiClient.escapeString(jwtAppName.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (nonce != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("Nonce", nonce)); + } + + 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[] { "APIKey", "XLoginRadiusAPIKey", "AccessToken", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getJWTTokenByAccessTokenValidateBeforeCall(String jwtAppName, String nonce, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'jwtAppName' is set + if (jwtAppName == null) { + throw new ApiException("Missing the required parameter 'jwtAppName' when calling getJWTTokenByAccessToken(Async)"); + } + + return getJWTTokenByAccessTokenCall(jwtAppName, nonce, _callback); + + } + + /** + * Retrieve JWT token by Access Token + * Retrieves a JWT token using an Access Token obtained after successful login. + * @param jwtAppName JWT App Name (required) + * @param nonce random nonce claim (optional) + * @return JWTSignature + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public JWTSignature getJWTTokenByAccessToken(String jwtAppName, String nonce) throws ApiException { + ApiResponse<JWTSignature> localVarResp = getJWTTokenByAccessTokenWithHttpInfo(jwtAppName, nonce); + return localVarResp.getData(); + } + + /** + * Retrieve JWT token by Access Token + * Retrieves a JWT token using an Access Token obtained after successful login. + * @param jwtAppName JWT App Name (required) + * @param nonce random nonce claim (optional) + * @return ApiResponse<JWTSignature> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<JWTSignature> getJWTTokenByAccessTokenWithHttpInfo(String jwtAppName, String nonce) throws ApiException { + okhttp3.Call localVarCall = getJWTTokenByAccessTokenValidateBeforeCall(jwtAppName, nonce, null); + Type localVarReturnType = new TypeToken<JWTSignature>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve JWT token by Access Token (asynchronously) + * Retrieves a JWT token using an Access Token obtained after successful login. + * @param jwtAppName JWT App Name (required) + * @param nonce random nonce claim (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getJWTTokenByAccessTokenAsync(String jwtAppName, String nonce, final ApiCallback<JWTSignature> _callback) throws ApiException { + + okhttp3.Call localVarCall = getJWTTokenByAccessTokenValidateBeforeCall(jwtAppName, nonce, _callback); + Type localVarReturnType = new TypeToken<JWTSignature>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getJWTTokenByLoginCredentials + * @param jwtAppName JWT App Name (required) + * @param getJWTTokenByLoginCredentialsRequest (required) + * @param nonce random nonce claim (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getJWTTokenByLoginCredentialsCall(String jwtAppName, GetJWTTokenByLoginCredentialsRequest getJWTTokenByLoginCredentialsRequest, String nonce, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://{TenantName}.hub.loginradius.com", "https://{CustomDomain}" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getJWTTokenByLoginCredentialsRequest; + + // create path and map variables + String localVarPath = "/api/jwt/{JwtAppName}/login" + .replace("{" + "JwtAppName" + "}", localVarApiClient.escapeString(jwtAppName.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (nonce != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("Nonce", nonce)); + } + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "application/x-www-form-urlencoded" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey", "XLoginRadiusAPIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getJWTTokenByLoginCredentialsValidateBeforeCall(String jwtAppName, GetJWTTokenByLoginCredentialsRequest getJWTTokenByLoginCredentialsRequest, String nonce, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'jwtAppName' is set + if (jwtAppName == null) { + throw new ApiException("Missing the required parameter 'jwtAppName' when calling getJWTTokenByLoginCredentials(Async)"); + } + + // verify the required parameter 'getJWTTokenByLoginCredentialsRequest' is set + if (getJWTTokenByLoginCredentialsRequest == null) { + throw new ApiException("Missing the required parameter 'getJWTTokenByLoginCredentialsRequest' when calling getJWTTokenByLoginCredentials(Async)"); + } + + return getJWTTokenByLoginCredentialsCall(jwtAppName, getJWTTokenByLoginCredentialsRequest, nonce, _callback); + + } + + /** + * Retrieve JWT token + * Retrieves a JWT token using login credentials such as Email, Phone, Username, and Password. + * @param jwtAppName JWT App Name (required) + * @param getJWTTokenByLoginCredentialsRequest (required) + * @param nonce random nonce claim (optional) + * @return JWTSignature + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public JWTSignature getJWTTokenByLoginCredentials(String jwtAppName, GetJWTTokenByLoginCredentialsRequest getJWTTokenByLoginCredentialsRequest, String nonce) throws ApiException { + ApiResponse<JWTSignature> localVarResp = getJWTTokenByLoginCredentialsWithHttpInfo(jwtAppName, getJWTTokenByLoginCredentialsRequest, nonce); + return localVarResp.getData(); + } + + /** + * Retrieve JWT token + * Retrieves a JWT token using login credentials such as Email, Phone, Username, and Password. + * @param jwtAppName JWT App Name (required) + * @param getJWTTokenByLoginCredentialsRequest (required) + * @param nonce random nonce claim (optional) + * @return ApiResponse<JWTSignature> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<JWTSignature> getJWTTokenByLoginCredentialsWithHttpInfo(String jwtAppName, GetJWTTokenByLoginCredentialsRequest getJWTTokenByLoginCredentialsRequest, String nonce) throws ApiException { + okhttp3.Call localVarCall = getJWTTokenByLoginCredentialsValidateBeforeCall(jwtAppName, getJWTTokenByLoginCredentialsRequest, nonce, null); + Type localVarReturnType = new TypeToken<JWTSignature>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve JWT token (asynchronously) + * Retrieves a JWT token using login credentials such as Email, Phone, Username, and Password. + * @param jwtAppName JWT App Name (required) + * @param getJWTTokenByLoginCredentialsRequest (required) + * @param nonce random nonce claim (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getJWTTokenByLoginCredentialsAsync(String jwtAppName, GetJWTTokenByLoginCredentialsRequest getJWTTokenByLoginCredentialsRequest, String nonce, final ApiCallback<JWTSignature> _callback) throws ApiException { + + okhttp3.Call localVarCall = getJWTTokenByLoginCredentialsValidateBeforeCall(jwtAppName, getJWTTokenByLoginCredentialsRequest, nonce, _callback); + Type localVarReturnType = new TypeToken<JWTSignature>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/JwtCustomProvidersApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/JwtCustomProvidersApi.java new file mode 100644 index 0000000..6682cdd --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/JwtCustomProvidersApi.java @@ -0,0 +1,787 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.CreateJwtSPClientConfigurationRequest; +import com.loginradius.sdk.internal.openapi.model.DeleteResponse; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.GetAllJwtConfigSPConfigurations200Response; +import com.loginradius.sdk.internal.openapi.model.JwtSpConfig; +import com.loginradius.sdk.internal.openapi.model.JwtSpConfigBaseModel; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class JwtCustomProvidersApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public JwtCustomProvidersApi() { + this(Configuration.getDefaultApiClient()); + } + + public JwtCustomProvidersApi(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 createJwtSPClientConfiguration + * @param createJwtSPClientConfigurationRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createJwtSPClientConfigurationCall(CreateJwtSPClientConfigurationRequest createJwtSPClientConfigurationRequest, 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 = createJwtSPClientConfigurationRequest; + + // create path and map variables + String localVarPath = "/v2/manage/custom-providers/jwt"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createJwtSPClientConfigurationValidateBeforeCall(CreateJwtSPClientConfigurationRequest createJwtSPClientConfigurationRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'createJwtSPClientConfigurationRequest' is set + if (createJwtSPClientConfigurationRequest == null) { + throw new ApiException("Missing the required parameter 'createJwtSPClientConfigurationRequest' when calling createJwtSPClientConfiguration(Async)"); + } + + return createJwtSPClientConfigurationCall(createJwtSPClientConfigurationRequest, _callback); + + } + + /** + * Create JWT SP configuration + * Creates a new Service Provider (SP) configuration for a JWT client in the Tenant, defining details such as endpoints, mapping, and other required settings. + * @param createJwtSPClientConfigurationRequest (required) + * @return JwtSpConfig + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public JwtSpConfig createJwtSPClientConfiguration(CreateJwtSPClientConfigurationRequest createJwtSPClientConfigurationRequest) throws ApiException { + ApiResponse<JwtSpConfig> localVarResp = createJwtSPClientConfigurationWithHttpInfo(createJwtSPClientConfigurationRequest); + return localVarResp.getData(); + } + + /** + * Create JWT SP configuration + * Creates a new Service Provider (SP) configuration for a JWT client in the Tenant, defining details such as endpoints, mapping, and other required settings. + * @param createJwtSPClientConfigurationRequest (required) + * @return ApiResponse<JwtSpConfig> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<JwtSpConfig> createJwtSPClientConfigurationWithHttpInfo(CreateJwtSPClientConfigurationRequest createJwtSPClientConfigurationRequest) throws ApiException { + okhttp3.Call localVarCall = createJwtSPClientConfigurationValidateBeforeCall(createJwtSPClientConfigurationRequest, null); + Type localVarReturnType = new TypeToken<JwtSpConfig>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create JWT SP configuration (asynchronously) + * Creates a new Service Provider (SP) configuration for a JWT client in the Tenant, defining details such as endpoints, mapping, and other required settings. + * @param createJwtSPClientConfigurationRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createJwtSPClientConfigurationAsync(CreateJwtSPClientConfigurationRequest createJwtSPClientConfigurationRequest, final ApiCallback<JwtSpConfig> _callback) throws ApiException { + + okhttp3.Call localVarCall = createJwtSPClientConfigurationValidateBeforeCall(createJwtSPClientConfigurationRequest, _callback); + Type localVarReturnType = new TypeToken<JwtSpConfig>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteJwtSPClientConfigurationByAppName + * @param jwtApp The jwt App identifier (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteJwtSPClientConfigurationByAppNameCall(String jwtApp, 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 = "/v2/manage/custom-providers/jwt/{jwtApp}" + .replace("{" + "jwtApp" + "}", localVarApiClient.escapeString(jwtApp.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteJwtSPClientConfigurationByAppNameValidateBeforeCall(String jwtApp, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'jwtApp' is set + if (jwtApp == null) { + throw new ApiException("Missing the required parameter 'jwtApp' when calling deleteJwtSPClientConfigurationByAppName(Async)"); + } + + return deleteJwtSPClientConfigurationByAppNameCall(jwtApp, _callback); + + } + + /** + * Delete JWT SP configuration + * Deletes the Service Provider (SP) configuration for a JWT client in the Tenant identified by the AppName, permanently disabling the application's service provider integration. + * @param jwtApp The jwt App identifier (required) + * @return DeleteResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public DeleteResponse deleteJwtSPClientConfigurationByAppName(String jwtApp) throws ApiException { + ApiResponse<DeleteResponse> localVarResp = deleteJwtSPClientConfigurationByAppNameWithHttpInfo(jwtApp); + return localVarResp.getData(); + } + + /** + * Delete JWT SP configuration + * Deletes the Service Provider (SP) configuration for a JWT client in the Tenant identified by the AppName, permanently disabling the application's service provider integration. + * @param jwtApp The jwt App identifier (required) + * @return ApiResponse<DeleteResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DeleteResponse> deleteJwtSPClientConfigurationByAppNameWithHttpInfo(String jwtApp) throws ApiException { + okhttp3.Call localVarCall = deleteJwtSPClientConfigurationByAppNameValidateBeforeCall(jwtApp, null); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete JWT SP configuration (asynchronously) + * Deletes the Service Provider (SP) configuration for a JWT client in the Tenant identified by the AppName, permanently disabling the application's service provider integration. + * @param jwtApp The jwt App identifier (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteJwtSPClientConfigurationByAppNameAsync(String jwtApp, final ApiCallback<DeleteResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteJwtSPClientConfigurationByAppNameValidateBeforeCall(jwtApp, _callback); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAllJwtConfigSPConfigurations + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllJwtConfigSPConfigurationsCall(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 = "/v2/manage/custom-providers/jwt"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAllJwtConfigSPConfigurationsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getAllJwtConfigSPConfigurationsCall(_callback); + + } + + /** + * List JWT SP configurations + * Retrieves a list of all Service Provider (SP) configurations associated with JWT clients for the Tenant, including endpoints, mapping, and other settings for each SP setup. + * @return GetAllJwtConfigSPConfigurations200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public GetAllJwtConfigSPConfigurations200Response getAllJwtConfigSPConfigurations() throws ApiException { + ApiResponse<GetAllJwtConfigSPConfigurations200Response> localVarResp = getAllJwtConfigSPConfigurationsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List JWT SP configurations + * Retrieves a list of all Service Provider (SP) configurations associated with JWT clients for the Tenant, including endpoints, mapping, and other settings for each SP setup. + * @return ApiResponse<GetAllJwtConfigSPConfigurations200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetAllJwtConfigSPConfigurations200Response> getAllJwtConfigSPConfigurationsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getAllJwtConfigSPConfigurationsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<GetAllJwtConfigSPConfigurations200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List JWT SP configurations (asynchronously) + * Retrieves a list of all Service Provider (SP) configurations associated with JWT clients for the Tenant, including endpoints, mapping, and other settings for each SP setup. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllJwtConfigSPConfigurationsAsync(final ApiCallback<GetAllJwtConfigSPConfigurations200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getAllJwtConfigSPConfigurationsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<GetAllJwtConfigSPConfigurations200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getJwtSPClientConfigurationByAppName + * @param jwtApp The jwt App identifier (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getJwtSPClientConfigurationByAppNameCall(String jwtApp, 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 = "/v2/manage/custom-providers/jwt/{jwtApp}" + .replace("{" + "jwtApp" + "}", localVarApiClient.escapeString(jwtApp.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getJwtSPClientConfigurationByAppNameValidateBeforeCall(String jwtApp, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'jwtApp' is set + if (jwtApp == null) { + throw new ApiException("Missing the required parameter 'jwtApp' when calling getJwtSPClientConfigurationByAppName(Async)"); + } + + return getJwtSPClientConfigurationByAppNameCall(jwtApp, _callback); + + } + + /** + * Retrieve JWT SP configuration + * Retrieves the Service Provider (SP) configuration details for a JWT client in the Tenant using the AppName, including endpoints, mapping, and other configured settings. + * @param jwtApp The jwt App identifier (required) + * @return JwtSpConfig + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public JwtSpConfig getJwtSPClientConfigurationByAppName(String jwtApp) throws ApiException { + ApiResponse<JwtSpConfig> localVarResp = getJwtSPClientConfigurationByAppNameWithHttpInfo(jwtApp); + return localVarResp.getData(); + } + + /** + * Retrieve JWT SP configuration + * Retrieves the Service Provider (SP) configuration details for a JWT client in the Tenant using the AppName, including endpoints, mapping, and other configured settings. + * @param jwtApp The jwt App identifier (required) + * @return ApiResponse<JwtSpConfig> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<JwtSpConfig> getJwtSPClientConfigurationByAppNameWithHttpInfo(String jwtApp) throws ApiException { + okhttp3.Call localVarCall = getJwtSPClientConfigurationByAppNameValidateBeforeCall(jwtApp, null); + Type localVarReturnType = new TypeToken<JwtSpConfig>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve JWT SP configuration (asynchronously) + * Retrieves the Service Provider (SP) configuration details for a JWT client in the Tenant using the AppName, including endpoints, mapping, and other configured settings. + * @param jwtApp The jwt App identifier (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getJwtSPClientConfigurationByAppNameAsync(String jwtApp, final ApiCallback<JwtSpConfig> _callback) throws ApiException { + + okhttp3.Call localVarCall = getJwtSPClientConfigurationByAppNameValidateBeforeCall(jwtApp, _callback); + Type localVarReturnType = new TypeToken<JwtSpConfig>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateJwtSPClientConfigurationByAppName + * @param jwtApp The jwt App identifier (required) + * @param jwtSpConfigBaseModel (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateJwtSPClientConfigurationByAppNameCall(String jwtApp, JwtSpConfigBaseModel jwtSpConfigBaseModel, 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 = jwtSpConfigBaseModel; + + // create path and map variables + String localVarPath = "/v2/manage/custom-providers/jwt/{jwtApp}" + .replace("{" + "jwtApp" + "}", localVarApiClient.escapeString(jwtApp.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateJwtSPClientConfigurationByAppNameValidateBeforeCall(String jwtApp, JwtSpConfigBaseModel jwtSpConfigBaseModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'jwtApp' is set + if (jwtApp == null) { + throw new ApiException("Missing the required parameter 'jwtApp' when calling updateJwtSPClientConfigurationByAppName(Async)"); + } + + // verify the required parameter 'jwtSpConfigBaseModel' is set + if (jwtSpConfigBaseModel == null) { + throw new ApiException("Missing the required parameter 'jwtSpConfigBaseModel' when calling updateJwtSPClientConfigurationByAppName(Async)"); + } + + return updateJwtSPClientConfigurationByAppNameCall(jwtApp, jwtSpConfigBaseModel, _callback); + + } + + /** + * Update JWT SP configuration + * Updates an existing Service Provider (SP) configuration for a JWT client in the Tenant identified by the AppName, modifying settings such as endpoints, mapping, or other configuration details. + * @param jwtApp The jwt App identifier (required) + * @param jwtSpConfigBaseModel (required) + * @return JwtSpConfig + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public JwtSpConfig updateJwtSPClientConfigurationByAppName(String jwtApp, JwtSpConfigBaseModel jwtSpConfigBaseModel) throws ApiException { + ApiResponse<JwtSpConfig> localVarResp = updateJwtSPClientConfigurationByAppNameWithHttpInfo(jwtApp, jwtSpConfigBaseModel); + return localVarResp.getData(); + } + + /** + * Update JWT SP configuration + * Updates an existing Service Provider (SP) configuration for a JWT client in the Tenant identified by the AppName, modifying settings such as endpoints, mapping, or other configuration details. + * @param jwtApp The jwt App identifier (required) + * @param jwtSpConfigBaseModel (required) + * @return ApiResponse<JwtSpConfig> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<JwtSpConfig> updateJwtSPClientConfigurationByAppNameWithHttpInfo(String jwtApp, JwtSpConfigBaseModel jwtSpConfigBaseModel) throws ApiException { + okhttp3.Call localVarCall = updateJwtSPClientConfigurationByAppNameValidateBeforeCall(jwtApp, jwtSpConfigBaseModel, null); + Type localVarReturnType = new TypeToken<JwtSpConfig>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update JWT SP configuration (asynchronously) + * Updates an existing Service Provider (SP) configuration for a JWT client in the Tenant identified by the AppName, modifying settings such as endpoints, mapping, or other configuration details. + * @param jwtApp The jwt App identifier (required) + * @param jwtSpConfigBaseModel (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateJwtSPClientConfigurationByAppNameAsync(String jwtApp, JwtSpConfigBaseModel jwtSpConfigBaseModel, final ApiCallback<JwtSpConfig> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateJwtSPClientConfigurationByAppNameValidateBeforeCall(jwtApp, jwtSpConfigBaseModel, _callback); + Type localVarReturnType = new TypeToken<JwtSpConfig>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/JwtIntegrationsApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/JwtIntegrationsApi.java new file mode 100644 index 0000000..5316fbd --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/JwtIntegrationsApi.java @@ -0,0 +1,1018 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.CreateJwtIntegrationRequest; +import com.loginradius.sdk.internal.openapi.model.DeleteResponse; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.GetAllJwtIntegrations200Response; +import com.loginradius.sdk.internal.openapi.model.GetJwtIntegrationSupportedAlgoList200Response; +import com.loginradius.sdk.internal.openapi.model.JwtIntegrationBaseModel; +import com.loginradius.sdk.internal.openapi.model.JwtIntegrationResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class JwtIntegrationsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public JwtIntegrationsApi() { + this(Configuration.getDefaultApiClient()); + } + + public JwtIntegrationsApi(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 createJwtIntegration + * @param createJwtIntegrationRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createJwtIntegrationCall(CreateJwtIntegrationRequest createJwtIntegrationRequest, 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 = createJwtIntegrationRequest; + + // create path and map variables + String localVarPath = "/v2/manage/integrations/jwt"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createJwtIntegrationValidateBeforeCall(CreateJwtIntegrationRequest createJwtIntegrationRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'createJwtIntegrationRequest' is set + if (createJwtIntegrationRequest == null) { + throw new ApiException("Missing the required parameter 'createJwtIntegrationRequest' when calling createJwtIntegration(Async)"); + } + + return createJwtIntegrationCall(createJwtIntegrationRequest, _callback); + + } + + /** + * Create JWT Integration + * Creates a new JWT-based Integration configuration for the Tenant by specifying algorithms, mapping, and endpoint information, enabling authentication and federation with the specified IdP. + * @param createJwtIntegrationRequest (required) + * @return JwtIntegrationResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public JwtIntegrationResponse createJwtIntegration(CreateJwtIntegrationRequest createJwtIntegrationRequest) throws ApiException { + ApiResponse<JwtIntegrationResponse> localVarResp = createJwtIntegrationWithHttpInfo(createJwtIntegrationRequest); + return localVarResp.getData(); + } + + /** + * Create JWT Integration + * Creates a new JWT-based Integration configuration for the Tenant by specifying algorithms, mapping, and endpoint information, enabling authentication and federation with the specified IdP. + * @param createJwtIntegrationRequest (required) + * @return ApiResponse<JwtIntegrationResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<JwtIntegrationResponse> createJwtIntegrationWithHttpInfo(CreateJwtIntegrationRequest createJwtIntegrationRequest) throws ApiException { + okhttp3.Call localVarCall = createJwtIntegrationValidateBeforeCall(createJwtIntegrationRequest, null); + Type localVarReturnType = new TypeToken<JwtIntegrationResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create JWT Integration (asynchronously) + * Creates a new JWT-based Integration configuration for the Tenant by specifying algorithms, mapping, and endpoint information, enabling authentication and federation with the specified IdP. + * @param createJwtIntegrationRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createJwtIntegrationAsync(CreateJwtIntegrationRequest createJwtIntegrationRequest, final ApiCallback<JwtIntegrationResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = createJwtIntegrationValidateBeforeCall(createJwtIntegrationRequest, _callback); + Type localVarReturnType = new TypeToken<JwtIntegrationResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteJwtIntegration + * @param jwtApp The jwt App identifier (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteJwtIntegrationCall(String jwtApp, 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 = "/v2/manage/integrations/jwt/{jwtApp}" + .replace("{" + "jwtApp" + "}", localVarApiClient.escapeString(jwtApp.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteJwtIntegrationValidateBeforeCall(String jwtApp, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'jwtApp' is set + if (jwtApp == null) { + throw new ApiException("Missing the required parameter 'jwtApp' when calling deleteJwtIntegration(Async)"); + } + + return deleteJwtIntegrationCall(jwtApp, _callback); + + } + + /** + * Delete JWT Integration configuration + * Deletes an existing JWT-based integration configuration for the Tenant using its AppName, permanently disabling authentication and federation with that IdP. + * @param jwtApp The jwt App identifier (required) + * @return DeleteResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public DeleteResponse deleteJwtIntegration(String jwtApp) throws ApiException { + ApiResponse<DeleteResponse> localVarResp = deleteJwtIntegrationWithHttpInfo(jwtApp); + return localVarResp.getData(); + } + + /** + * Delete JWT Integration configuration + * Deletes an existing JWT-based integration configuration for the Tenant using its AppName, permanently disabling authentication and federation with that IdP. + * @param jwtApp The jwt App identifier (required) + * @return ApiResponse<DeleteResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DeleteResponse> deleteJwtIntegrationWithHttpInfo(String jwtApp) throws ApiException { + okhttp3.Call localVarCall = deleteJwtIntegrationValidateBeforeCall(jwtApp, null); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete JWT Integration configuration (asynchronously) + * Deletes an existing JWT-based integration configuration for the Tenant using its AppName, permanently disabling authentication and federation with that IdP. + * @param jwtApp The jwt App identifier (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteJwtIntegrationAsync(String jwtApp, final ApiCallback<DeleteResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteJwtIntegrationValidateBeforeCall(jwtApp, _callback); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAllJwtIntegrations + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllJwtIntegrationsCall(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 = "/v2/manage/integrations/jwt"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAllJwtIntegrationsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getAllJwtIntegrationsCall(_callback); + + } + + /** + * List JWT Integrations + * Retrieves a list of all configured JWT-based integrations for the Tenant, including algorithms, mapping, endpoints, and settings used for authentication and federation. + * @return GetAllJwtIntegrations200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public GetAllJwtIntegrations200Response getAllJwtIntegrations() throws ApiException { + ApiResponse<GetAllJwtIntegrations200Response> localVarResp = getAllJwtIntegrationsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List JWT Integrations + * Retrieves a list of all configured JWT-based integrations for the Tenant, including algorithms, mapping, endpoints, and settings used for authentication and federation. + * @return ApiResponse<GetAllJwtIntegrations200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetAllJwtIntegrations200Response> getAllJwtIntegrationsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getAllJwtIntegrationsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<GetAllJwtIntegrations200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List JWT Integrations (asynchronously) + * Retrieves a list of all configured JWT-based integrations for the Tenant, including algorithms, mapping, endpoints, and settings used for authentication and federation. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllJwtIntegrationsAsync(final ApiCallback<GetAllJwtIntegrations200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getAllJwtIntegrationsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<GetAllJwtIntegrations200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getJwtIntegrationByAppName + * @param jwtApp The jwt App identifier (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getJwtIntegrationByAppNameCall(String jwtApp, 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 = "/v2/manage/integrations/jwt/{jwtApp}" + .replace("{" + "jwtApp" + "}", localVarApiClient.escapeString(jwtApp.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getJwtIntegrationByAppNameValidateBeforeCall(String jwtApp, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'jwtApp' is set + if (jwtApp == null) { + throw new ApiException("Missing the required parameter 'jwtApp' when calling getJwtIntegrationByAppName(Async)"); + } + + return getJwtIntegrationByAppNameCall(jwtApp, _callback); + + } + + /** + * Retrieve JWT Integration configuration + * Retrieves the details of a specific JWT-based integration configuration for the Tenant using the AppName, including algorithms, mapping, and endpoints associated with the application. + * @param jwtApp The jwt App identifier (required) + * @return JwtIntegrationResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public JwtIntegrationResponse getJwtIntegrationByAppName(String jwtApp) throws ApiException { + ApiResponse<JwtIntegrationResponse> localVarResp = getJwtIntegrationByAppNameWithHttpInfo(jwtApp); + return localVarResp.getData(); + } + + /** + * Retrieve JWT Integration configuration + * Retrieves the details of a specific JWT-based integration configuration for the Tenant using the AppName, including algorithms, mapping, and endpoints associated with the application. + * @param jwtApp The jwt App identifier (required) + * @return ApiResponse<JwtIntegrationResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<JwtIntegrationResponse> getJwtIntegrationByAppNameWithHttpInfo(String jwtApp) throws ApiException { + okhttp3.Call localVarCall = getJwtIntegrationByAppNameValidateBeforeCall(jwtApp, null); + Type localVarReturnType = new TypeToken<JwtIntegrationResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve JWT Integration configuration (asynchronously) + * Retrieves the details of a specific JWT-based integration configuration for the Tenant using the AppName, including algorithms, mapping, and endpoints associated with the application. + * @param jwtApp The jwt App identifier (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getJwtIntegrationByAppNameAsync(String jwtApp, final ApiCallback<JwtIntegrationResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getJwtIntegrationByAppNameValidateBeforeCall(jwtApp, _callback); + Type localVarReturnType = new TypeToken<JwtIntegrationResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getJwtIntegrationDataMappingFieldsList + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getJwtIntegrationDataMappingFieldsListCall(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 = "/v2/manage/integrations/jwt/data-mapping"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getJwtIntegrationDataMappingFieldsListValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getJwtIntegrationDataMappingFieldsListCall(_callback); + + } + + /** + * List JWT data mapping fields + * Retrieves a list of available data mapping fields that can be used when configuring JWT-based Identity Provider (IdP) integrations for the Tenant, including all supported fields for mapping JWT claims to User profile attributes. + * @return GetJwtIntegrationSupportedAlgoList200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + </table> + */ + public GetJwtIntegrationSupportedAlgoList200Response getJwtIntegrationDataMappingFieldsList() throws ApiException { + ApiResponse<GetJwtIntegrationSupportedAlgoList200Response> localVarResp = getJwtIntegrationDataMappingFieldsListWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List JWT data mapping fields + * Retrieves a list of available data mapping fields that can be used when configuring JWT-based Identity Provider (IdP) integrations for the Tenant, including all supported fields for mapping JWT claims to User profile attributes. + * @return ApiResponse<GetJwtIntegrationSupportedAlgoList200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetJwtIntegrationSupportedAlgoList200Response> getJwtIntegrationDataMappingFieldsListWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getJwtIntegrationDataMappingFieldsListValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<GetJwtIntegrationSupportedAlgoList200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List JWT data mapping fields (asynchronously) + * Retrieves a list of available data mapping fields that can be used when configuring JWT-based Identity Provider (IdP) integrations for the Tenant, including all supported fields for mapping JWT claims to User profile attributes. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getJwtIntegrationDataMappingFieldsListAsync(final ApiCallback<GetJwtIntegrationSupportedAlgoList200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getJwtIntegrationDataMappingFieldsListValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<GetJwtIntegrationSupportedAlgoList200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getJwtIntegrationSupportedAlgoList + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getJwtIntegrationSupportedAlgoListCall(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 = "/v2/manage/integrations/jwt/algo"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getJwtIntegrationSupportedAlgoListValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getJwtIntegrationSupportedAlgoListCall(_callback); + + } + + /** + * List supported JWT algorithms + * Retrieves a list of all supported cryptographic algorithms that can be used by JWT clients for signing and verification when configuring a JWT-based Identity Provider (IdP) for the Tenant. + * @return GetJwtIntegrationSupportedAlgoList200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + </table> + */ + public GetJwtIntegrationSupportedAlgoList200Response getJwtIntegrationSupportedAlgoList() throws ApiException { + ApiResponse<GetJwtIntegrationSupportedAlgoList200Response> localVarResp = getJwtIntegrationSupportedAlgoListWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List supported JWT algorithms + * Retrieves a list of all supported cryptographic algorithms that can be used by JWT clients for signing and verification when configuring a JWT-based Identity Provider (IdP) for the Tenant. + * @return ApiResponse<GetJwtIntegrationSupportedAlgoList200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetJwtIntegrationSupportedAlgoList200Response> getJwtIntegrationSupportedAlgoListWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getJwtIntegrationSupportedAlgoListValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<GetJwtIntegrationSupportedAlgoList200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List supported JWT algorithms (asynchronously) + * Retrieves a list of all supported cryptographic algorithms that can be used by JWT clients for signing and verification when configuring a JWT-based Identity Provider (IdP) for the Tenant. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getJwtIntegrationSupportedAlgoListAsync(final ApiCallback<GetJwtIntegrationSupportedAlgoList200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getJwtIntegrationSupportedAlgoListValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<GetJwtIntegrationSupportedAlgoList200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateJwtIntegrationByAppName + * @param jwtApp The jwt App identifier (required) + * @param jwtIntegrationBaseModel (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateJwtIntegrationByAppNameCall(String jwtApp, JwtIntegrationBaseModel jwtIntegrationBaseModel, 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 = jwtIntegrationBaseModel; + + // create path and map variables + String localVarPath = "/v2/manage/integrations/jwt/{jwtApp}" + .replace("{" + "jwtApp" + "}", localVarApiClient.escapeString(jwtApp.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateJwtIntegrationByAppNameValidateBeforeCall(String jwtApp, JwtIntegrationBaseModel jwtIntegrationBaseModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'jwtApp' is set + if (jwtApp == null) { + throw new ApiException("Missing the required parameter 'jwtApp' when calling updateJwtIntegrationByAppName(Async)"); + } + + // verify the required parameter 'jwtIntegrationBaseModel' is set + if (jwtIntegrationBaseModel == null) { + throw new ApiException("Missing the required parameter 'jwtIntegrationBaseModel' when calling updateJwtIntegrationByAppName(Async)"); + } + + return updateJwtIntegrationByAppNameCall(jwtApp, jwtIntegrationBaseModel, _callback); + + } + + /** + * Update JWT Integration configuration + * Updates an existing JWT-based integration configuration for the Tenant identified by the AppName, modifying details such as algorithms, mapping, or endpoint information. + * @param jwtApp The jwt App identifier (required) + * @param jwtIntegrationBaseModel (required) + * @return JwtIntegrationResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public JwtIntegrationResponse updateJwtIntegrationByAppName(String jwtApp, JwtIntegrationBaseModel jwtIntegrationBaseModel) throws ApiException { + ApiResponse<JwtIntegrationResponse> localVarResp = updateJwtIntegrationByAppNameWithHttpInfo(jwtApp, jwtIntegrationBaseModel); + return localVarResp.getData(); + } + + /** + * Update JWT Integration configuration + * Updates an existing JWT-based integration configuration for the Tenant identified by the AppName, modifying details such as algorithms, mapping, or endpoint information. + * @param jwtApp The jwt App identifier (required) + * @param jwtIntegrationBaseModel (required) + * @return ApiResponse<JwtIntegrationResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<JwtIntegrationResponse> updateJwtIntegrationByAppNameWithHttpInfo(String jwtApp, JwtIntegrationBaseModel jwtIntegrationBaseModel) throws ApiException { + okhttp3.Call localVarCall = updateJwtIntegrationByAppNameValidateBeforeCall(jwtApp, jwtIntegrationBaseModel, null); + Type localVarReturnType = new TypeToken<JwtIntegrationResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update JWT Integration configuration (asynchronously) + * Updates an existing JWT-based integration configuration for the Tenant identified by the AppName, modifying details such as algorithms, mapping, or endpoint information. + * @param jwtApp The jwt App identifier (required) + * @param jwtIntegrationBaseModel (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateJwtIntegrationByAppNameAsync(String jwtApp, JwtIntegrationBaseModel jwtIntegrationBaseModel, final ApiCallback<JwtIntegrationResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateJwtIntegrationByAppNameValidateBeforeCall(jwtApp, jwtIntegrationBaseModel, _callback); + Type localVarReturnType = new TypeToken<JwtIntegrationResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/LoginApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/LoginApi.java new file mode 100644 index 0000000..b4e9532 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/LoginApi.java @@ -0,0 +1,5956 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.AccessTokenResponse; +import com.loginradius.sdk.internal.openapi.model.ApiError; +import com.loginradius.sdk.internal.openapi.model.AuthResponse; +import com.loginradius.sdk.internal.openapi.model.BeginMFAPasskeyRegistration200Response; +import com.loginradius.sdk.internal.openapi.model.BeginPasskeyLogin200Response; +import com.loginradius.sdk.internal.openapi.model.BeginPasskeyReset200Response; +import com.loginradius.sdk.internal.openapi.model.CheckUserNameAvailability200Response; +import com.loginradius.sdk.internal.openapi.model.EmailByLoginUserNamePhone200Response; +import com.loginradius.sdk.internal.openapi.model.EmailByLoginUserNamePhoneRequest; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.ErrorResponseNative; +import com.loginradius.sdk.internal.openapi.model.FinishMFAPasskeyRegistrationRequest; +import com.loginradius.sdk.internal.openapi.model.IsExist; +import com.loginradius.sdk.internal.openapi.model.IsPostedResponse; +import com.loginradius.sdk.internal.openapi.model.IsPostedVerified; +import com.loginradius.sdk.internal.openapi.model.OneTouchLoginByEmail; +import com.loginradius.sdk.internal.openapi.model.OneTouchLoginByPhone; +import com.loginradius.sdk.internal.openapi.model.PasskeyForgot; +import com.loginradius.sdk.internal.openapi.model.PasskeyForgot200Response; +import com.loginradius.sdk.internal.openapi.model.PasskeyListResponse; +import com.loginradius.sdk.internal.openapi.model.PasskeyLoginAutofillRequest; +import com.loginradius.sdk.internal.openapi.model.PasskeyLoginFinish; +import com.loginradius.sdk.internal.openapi.model.PasswordLessEmailOTPModel; +import com.loginradius.sdk.internal.openapi.model.PasswordLessUserNameOTPModel; +import com.loginradius.sdk.internal.openapi.model.PasswordlessEmailVerification200Response; +import com.loginradius.sdk.internal.openapi.model.PhoneOTPModel; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModel; +import com.loginradius.sdk.internal.openapi.model.SMSResponse; +import java.net.URI; +import com.loginradius.sdk.internal.openapi.model.VerifyOtpPhoneModel; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class LoginApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public LoginApi() { + this(Configuration.getDefaultApiClient()); + } + + public LoginApi(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 accountRegisterPasskeyBegin + * @param accessToken Access Token of the User (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated credential registration </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call accountRegisterPasskeyBeginCall(String accessToken, 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 = "/identity/v2/auth/account/register/passkey/begin"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + 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[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call accountRegisterPasskeyBeginValidateBeforeCall(String accessToken, final ApiCallback _callback) throws ApiException { + return accountRegisterPasskeyBeginCall(accessToken, _callback); + + } + + /** + * Begin Passkey registration + * Initiates the Passkey registration process for an Account using an Access Token. + * @param accessToken Access Token of the User (optional) + * @return BeginMFAPasskeyRegistration200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated credential registration </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public BeginMFAPasskeyRegistration200Response accountRegisterPasskeyBegin(String accessToken) throws ApiException { + ApiResponse<BeginMFAPasskeyRegistration200Response> localVarResp = accountRegisterPasskeyBeginWithHttpInfo(accessToken); + return localVarResp.getData(); + } + + /** + * Begin Passkey registration + * Initiates the Passkey registration process for an Account using an Access Token. + * @param accessToken Access Token of the User (optional) + * @return ApiResponse<BeginMFAPasskeyRegistration200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated credential registration </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<BeginMFAPasskeyRegistration200Response> accountRegisterPasskeyBeginWithHttpInfo(String accessToken) throws ApiException { + okhttp3.Call localVarCall = accountRegisterPasskeyBeginValidateBeforeCall(accessToken, null); + Type localVarReturnType = new TypeToken<BeginMFAPasskeyRegistration200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Begin Passkey registration (asynchronously) + * Initiates the Passkey registration process for an Account using an Access Token. + * @param accessToken Access Token of the User (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated credential registration </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call accountRegisterPasskeyBeginAsync(String accessToken, final ApiCallback<BeginMFAPasskeyRegistration200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = accountRegisterPasskeyBeginValidateBeforeCall(accessToken, _callback); + Type localVarReturnType = new TypeToken<BeginMFAPasskeyRegistration200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for accountRegisterPasskeyFinish + * @param finishMFAPasskeyRegistrationRequest (required) + * @param accessToken Access Token of the User (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully finished credential registration </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call accountRegisterPasskeyFinishCall(FinishMFAPasskeyRegistrationRequest finishMFAPasskeyRegistrationRequest, String accessToken, 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 = finishMFAPasskeyRegistrationRequest; + + // create path and map variables + String localVarPath = "/identity/v2/auth/account/register/passkey/finish"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + 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[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call accountRegisterPasskeyFinishValidateBeforeCall(FinishMFAPasskeyRegistrationRequest finishMFAPasskeyRegistrationRequest, String accessToken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'finishMFAPasskeyRegistrationRequest' is set + if (finishMFAPasskeyRegistrationRequest == null) { + throw new ApiException("Missing the required parameter 'finishMFAPasskeyRegistrationRequest' when calling accountRegisterPasskeyFinish(Async)"); + } + + return accountRegisterPasskeyFinishCall(finishMFAPasskeyRegistrationRequest, accessToken, _callback); + + } + + /** + * Complete Passkey registration + * Completes the Passkey registration process for an Account using an Access Token. + * @param finishMFAPasskeyRegistrationRequest (required) + * @param accessToken Access Token of the User (optional) + * @return PasskeyListResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully finished credential registration </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public PasskeyListResponse accountRegisterPasskeyFinish(FinishMFAPasskeyRegistrationRequest finishMFAPasskeyRegistrationRequest, String accessToken) throws ApiException { + ApiResponse<PasskeyListResponse> localVarResp = accountRegisterPasskeyFinishWithHttpInfo(finishMFAPasskeyRegistrationRequest, accessToken); + return localVarResp.getData(); + } + + /** + * Complete Passkey registration + * Completes the Passkey registration process for an Account using an Access Token. + * @param finishMFAPasskeyRegistrationRequest (required) + * @param accessToken Access Token of the User (optional) + * @return ApiResponse<PasskeyListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully finished credential registration </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<PasskeyListResponse> accountRegisterPasskeyFinishWithHttpInfo(FinishMFAPasskeyRegistrationRequest finishMFAPasskeyRegistrationRequest, String accessToken) throws ApiException { + okhttp3.Call localVarCall = accountRegisterPasskeyFinishValidateBeforeCall(finishMFAPasskeyRegistrationRequest, accessToken, null); + Type localVarReturnType = new TypeToken<PasskeyListResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Complete Passkey registration (asynchronously) + * Completes the Passkey registration process for an Account using an Access Token. + * @param finishMFAPasskeyRegistrationRequest (required) + * @param accessToken Access Token of the User (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully finished credential registration </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call accountRegisterPasskeyFinishAsync(FinishMFAPasskeyRegistrationRequest finishMFAPasskeyRegistrationRequest, String accessToken, final ApiCallback<PasskeyListResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = accountRegisterPasskeyFinishValidateBeforeCall(finishMFAPasskeyRegistrationRequest, accessToken, _callback); + Type localVarReturnType = new TypeToken<PasskeyListResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for beginAutofillPasskeyLogin + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated login </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call beginAutofillPasskeyLoginCall(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 = "/identity/v2/auth/login/passkey/autofill/begin"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call beginAutofillPasskeyLoginValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return beginAutofillPasskeyLoginCall(_callback); + + } + + /** + * Initiate Login with Autofill Passkey + * Begins the login process using an Autofill Passkey. + * @return BeginPasskeyLogin200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated login </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public BeginPasskeyLogin200Response beginAutofillPasskeyLogin() throws ApiException { + ApiResponse<BeginPasskeyLogin200Response> localVarResp = beginAutofillPasskeyLoginWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Initiate Login with Autofill Passkey + * Begins the login process using an Autofill Passkey. + * @return ApiResponse<BeginPasskeyLogin200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated login </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<BeginPasskeyLogin200Response> beginAutofillPasskeyLoginWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = beginAutofillPasskeyLoginValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<BeginPasskeyLogin200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Initiate Login with Autofill Passkey (asynchronously) + * Begins the login process using an Autofill Passkey. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated login </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call beginAutofillPasskeyLoginAsync(final ApiCallback<BeginPasskeyLogin200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = beginAutofillPasskeyLoginValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<BeginPasskeyLogin200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for beginPasskeyLogin + * @param identifier Email of the User (required) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated login </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call beginPasskeyLoginCall(String identifier, String verificationurl, String emailtemplate, 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 = "/identity/v2/auth/login/passkey/begin"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (identifier != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("identifier", identifier)); + } + + if (verificationurl != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("verificationurl", verificationurl)); + } + + if (emailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailtemplate", emailtemplate)); + } + + 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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call beginPasskeyLoginValidateBeforeCall(String identifier, String verificationurl, String emailtemplate, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'identifier' is set + if (identifier == null) { + throw new ApiException("Missing the required parameter 'identifier' when calling beginPasskeyLogin(Async)"); + } + + return beginPasskeyLoginCall(identifier, verificationurl, emailtemplate, _callback); + + } + + /** + * Initiate Login with Passkey + * Begins the login process using a Passkey. + * @param identifier Email of the User (required) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @return BeginPasskeyLogin200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated login </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public BeginPasskeyLogin200Response beginPasskeyLogin(String identifier, String verificationurl, String emailtemplate) throws ApiException { + ApiResponse<BeginPasskeyLogin200Response> localVarResp = beginPasskeyLoginWithHttpInfo(identifier, verificationurl, emailtemplate); + return localVarResp.getData(); + } + + /** + * Initiate Login with Passkey + * Begins the login process using a Passkey. + * @param identifier Email of the User (required) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @return ApiResponse<BeginPasskeyLogin200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated login </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<BeginPasskeyLogin200Response> beginPasskeyLoginWithHttpInfo(String identifier, String verificationurl, String emailtemplate) throws ApiException { + okhttp3.Call localVarCall = beginPasskeyLoginValidateBeforeCall(identifier, verificationurl, emailtemplate, null); + Type localVarReturnType = new TypeToken<BeginPasskeyLogin200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Initiate Login with Passkey (asynchronously) + * Begins the login process using a Passkey. + * @param identifier Email of the User (required) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated login </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call beginPasskeyLoginAsync(String identifier, String verificationurl, String emailtemplate, final ApiCallback<BeginPasskeyLogin200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = beginPasskeyLoginValidateBeforeCall(identifier, verificationurl, emailtemplate, _callback); + Type localVarReturnType = new TypeToken<BeginPasskeyLogin200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for beginPasskeyReset + * @param vtoken Verification token received in the Email. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated Passkey reset </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call beginPasskeyResetCall(String vtoken, 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 = "/identity/v2/auth/passkey/reset/begin"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (vtoken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("vtoken", vtoken)); + } + + 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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call beginPasskeyResetValidateBeforeCall(String vtoken, final ApiCallback _callback) throws ApiException { + return beginPasskeyResetCall(vtoken, _callback); + + } + + /** + * Begin Passkey Reset + * Begins the reset Passkey process for a User. + * @param vtoken Verification token received in the Email. (optional) + * @return BeginPasskeyReset200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated Passkey reset </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public BeginPasskeyReset200Response beginPasskeyReset(String vtoken) throws ApiException { + ApiResponse<BeginPasskeyReset200Response> localVarResp = beginPasskeyResetWithHttpInfo(vtoken); + return localVarResp.getData(); + } + + /** + * Begin Passkey Reset + * Begins the reset Passkey process for a User. + * @param vtoken Verification token received in the Email. (optional) + * @return ApiResponse<BeginPasskeyReset200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated Passkey reset </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<BeginPasskeyReset200Response> beginPasskeyResetWithHttpInfo(String vtoken) throws ApiException { + okhttp3.Call localVarCall = beginPasskeyResetValidateBeforeCall(vtoken, null); + Type localVarReturnType = new TypeToken<BeginPasskeyReset200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Begin Passkey Reset (asynchronously) + * Begins the reset Passkey process for a User. + * @param vtoken Verification token received in the Email. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated Passkey reset </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call beginPasskeyResetAsync(String vtoken, final ApiCallback<BeginPasskeyReset200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = beginPasskeyResetValidateBeforeCall(vtoken, _callback); + Type localVarReturnType = new TypeToken<BeginPasskeyReset200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for checkUserNameAvailability + * @param username Username of the associated Account. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Username existence check response </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call checkUserNameAvailabilityCall(String username, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, 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 = "/identity/v2/auth/username"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (username != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("username", username)); + } + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (gRecaptchaResponse2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g_recaptcha_response", gRecaptchaResponse2)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + 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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call checkUserNameAvailabilityValidateBeforeCall(String username, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback _callback) throws ApiException { + return checkUserNameAvailabilityCall(username, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + + } + + /** + * Check Username availability + * Checks if a Username is available for registration on the platform. + * @param username Username of the associated Account. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return CheckUserNameAvailability200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Username existence check response </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public CheckUserNameAvailability200Response checkUserNameAvailability(String username, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + ApiResponse<CheckUserNameAvailability200Response> localVarResp = checkUserNameAvailabilityWithHttpInfo(username, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + return localVarResp.getData(); + } + + /** + * Check Username availability + * Checks if a Username is available for registration on the platform. + * @param username Username of the associated Account. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return ApiResponse<CheckUserNameAvailability200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Username existence check response </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<CheckUserNameAvailability200Response> checkUserNameAvailabilityWithHttpInfo(String username, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + okhttp3.Call localVarCall = checkUserNameAvailabilityValidateBeforeCall(username, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, null); + Type localVarReturnType = new TypeToken<CheckUserNameAvailability200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Check Username availability (asynchronously) + * Checks if a Username is available for registration on the platform. + * @param username Username of the associated Account. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Username existence check response </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call checkUserNameAvailabilityAsync(String username, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback<CheckUserNameAvailability200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = checkUserNameAvailabilityValidateBeforeCall(username, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + Type localVarReturnType = new TypeToken<CheckUserNameAvailability200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for emailByLoginUserNamePhone + * @param emailByLoginUserNamePhoneRequest (required) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param loginurl Login URL for the User which will come in the login logs from where the User logged in. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param smstemplate SMS Template (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param breachedpasswordemailtemplate Email template name for breached Password notifications. (optional) + * @param breachedpasswordsmstemplate SMS template name for breached Password notifications. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbaoneclickemailtemplate RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param invitationToken Invitation token of an organization (optional) + * @param emailtemplate2fa Name of the 2FA Email template to use for this notification. (optional) + * @param duoredirecturi Duo auth redirection url. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call emailByLoginUserNamePhoneCall(EmailByLoginUserNamePhoneRequest emailByLoginUserNamePhoneRequest, String emailtemplate, String loginurl, String verificationurl, String smstemplate, Boolean isvoiceotp, String gRecaptchaResponse, String breachedpasswordemailtemplate, String breachedpasswordsmstemplate, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String options, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, String invitationToken, String emailtemplate2fa, String duoredirecturi, 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 = emailByLoginUserNamePhoneRequest; + + // create path and map variables + String localVarPath = "/identity/v2/auth/login"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (emailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailtemplate", emailtemplate)); + } + + if (loginurl != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("loginurl", loginurl)); + } + + if (verificationurl != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("verificationurl", verificationurl)); + } + + if (smstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("smstemplate", smstemplate)); + } + + if (isvoiceotp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("isvoiceotp", isvoiceotp)); + } + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (breachedpasswordemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("breachedpasswordemailtemplate", breachedpasswordemailtemplate)); + } + + if (breachedpasswordsmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("breachedpasswordsmstemplate", breachedpasswordsmstemplate)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (fields != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fields", fields)); + } + + if (options != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("options", options)); + } + + if (rbabrowseremailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbabrowseremailtemplate", rbabrowseremailtemplate)); + } + + if (rbaoneclickemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaoneclickemailtemplate", rbaoneclickemailtemplate)); + } + + if (rbacityemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacityemailtemplate", rbacityemailtemplate)); + } + + if (rbacountryemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacountryemailtemplate", rbacountryemailtemplate)); + } + + if (rbaipemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaipemailtemplate", rbaipemailtemplate)); + } + + if (rbadeviceemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbadeviceemailtemplate", rbadeviceemailtemplate)); + } + + if (rbaotpsmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaotpsmstemplate", rbaotpsmstemplate)); + } + + if (rbabrowsersmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbabrowsersmstemplate", rbabrowsersmstemplate)); + } + + if (rbacitysmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacitysmstemplate", rbacitysmstemplate)); + } + + if (rbacountrysmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacountrysmstemplate", rbacountrysmstemplate)); + } + + if (rbaipsmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaipsmstemplate", rbaipsmstemplate)); + } + + if (rbadevicesmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbadevicesmstemplate", rbadevicesmstemplate)); + } + + if (invitationToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("invitation_token", invitationToken)); + } + + if (emailtemplate2fa != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailtemplate2fa", emailtemplate2fa)); + } + + if (duoredirecturi != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("duoredirecturi", duoredirecturi)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call emailByLoginUserNamePhoneValidateBeforeCall(EmailByLoginUserNamePhoneRequest emailByLoginUserNamePhoneRequest, String emailtemplate, String loginurl, String verificationurl, String smstemplate, Boolean isvoiceotp, String gRecaptchaResponse, String breachedpasswordemailtemplate, String breachedpasswordsmstemplate, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String options, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, String invitationToken, String emailtemplate2fa, String duoredirecturi, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'emailByLoginUserNamePhoneRequest' is set + if (emailByLoginUserNamePhoneRequest == null) { + throw new ApiException("Missing the required parameter 'emailByLoginUserNamePhoneRequest' when calling emailByLoginUserNamePhone(Async)"); + } + + return emailByLoginUserNamePhoneCall(emailByLoginUserNamePhoneRequest, emailtemplate, loginurl, verificationurl, smstemplate, isvoiceotp, gRecaptchaResponse, breachedpasswordemailtemplate, breachedpasswordsmstemplate, preventWebhook, xPreventWebhook, fields, options, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, invitationToken, emailtemplate2fa, duoredirecturi, _callback); + + } + + /** + * Login with credentials + * Authenticates a User using Email, Username, or Phone, providing an Access Token for further API interactions. + * @param emailByLoginUserNamePhoneRequest (required) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param loginurl Login URL for the User which will come in the login logs from where the User logged in. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param smstemplate SMS Template (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param breachedpasswordemailtemplate Email template name for breached Password notifications. (optional) + * @param breachedpasswordsmstemplate SMS template name for breached Password notifications. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbaoneclickemailtemplate RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param invitationToken Invitation token of an organization (optional) + * @param emailtemplate2fa Name of the 2FA Email template to use for this notification. (optional) + * @param duoredirecturi Duo auth redirection url. (optional) + * @return EmailByLoginUserNamePhone200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public EmailByLoginUserNamePhone200Response emailByLoginUserNamePhone(EmailByLoginUserNamePhoneRequest emailByLoginUserNamePhoneRequest, String emailtemplate, String loginurl, String verificationurl, String smstemplate, Boolean isvoiceotp, String gRecaptchaResponse, String breachedpasswordemailtemplate, String breachedpasswordsmstemplate, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String options, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, String invitationToken, String emailtemplate2fa, String duoredirecturi) throws ApiException { + ApiResponse<EmailByLoginUserNamePhone200Response> localVarResp = emailByLoginUserNamePhoneWithHttpInfo(emailByLoginUserNamePhoneRequest, emailtemplate, loginurl, verificationurl, smstemplate, isvoiceotp, gRecaptchaResponse, breachedpasswordemailtemplate, breachedpasswordsmstemplate, preventWebhook, xPreventWebhook, fields, options, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, invitationToken, emailtemplate2fa, duoredirecturi); + return localVarResp.getData(); + } + + /** + * Login with credentials + * Authenticates a User using Email, Username, or Phone, providing an Access Token for further API interactions. + * @param emailByLoginUserNamePhoneRequest (required) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param loginurl Login URL for the User which will come in the login logs from where the User logged in. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param smstemplate SMS Template (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param breachedpasswordemailtemplate Email template name for breached Password notifications. (optional) + * @param breachedpasswordsmstemplate SMS template name for breached Password notifications. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbaoneclickemailtemplate RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param invitationToken Invitation token of an organization (optional) + * @param emailtemplate2fa Name of the 2FA Email template to use for this notification. (optional) + * @param duoredirecturi Duo auth redirection url. (optional) + * @return ApiResponse<EmailByLoginUserNamePhone200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public ApiResponse<EmailByLoginUserNamePhone200Response> emailByLoginUserNamePhoneWithHttpInfo(EmailByLoginUserNamePhoneRequest emailByLoginUserNamePhoneRequest, String emailtemplate, String loginurl, String verificationurl, String smstemplate, Boolean isvoiceotp, String gRecaptchaResponse, String breachedpasswordemailtemplate, String breachedpasswordsmstemplate, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String options, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, String invitationToken, String emailtemplate2fa, String duoredirecturi) throws ApiException { + okhttp3.Call localVarCall = emailByLoginUserNamePhoneValidateBeforeCall(emailByLoginUserNamePhoneRequest, emailtemplate, loginurl, verificationurl, smstemplate, isvoiceotp, gRecaptchaResponse, breachedpasswordemailtemplate, breachedpasswordsmstemplate, preventWebhook, xPreventWebhook, fields, options, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, invitationToken, emailtemplate2fa, duoredirecturi, null); + Type localVarReturnType = new TypeToken<EmailByLoginUserNamePhone200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Login with credentials (asynchronously) + * Authenticates a User using Email, Username, or Phone, providing an Access Token for further API interactions. + * @param emailByLoginUserNamePhoneRequest (required) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param loginurl Login URL for the User which will come in the login logs from where the User logged in. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param smstemplate SMS Template (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param breachedpasswordemailtemplate Email template name for breached Password notifications. (optional) + * @param breachedpasswordsmstemplate SMS template name for breached Password notifications. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbaoneclickemailtemplate RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param invitationToken Invitation token of an organization (optional) + * @param emailtemplate2fa Name of the 2FA Email template to use for this notification. (optional) + * @param duoredirecturi Duo auth redirection url. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call emailByLoginUserNamePhoneAsync(EmailByLoginUserNamePhoneRequest emailByLoginUserNamePhoneRequest, String emailtemplate, String loginurl, String verificationurl, String smstemplate, Boolean isvoiceotp, String gRecaptchaResponse, String breachedpasswordemailtemplate, String breachedpasswordsmstemplate, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String options, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, String invitationToken, String emailtemplate2fa, String duoredirecturi, final ApiCallback<EmailByLoginUserNamePhone200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = emailByLoginUserNamePhoneValidateBeforeCall(emailByLoginUserNamePhoneRequest, emailtemplate, loginurl, verificationurl, smstemplate, isvoiceotp, gRecaptchaResponse, breachedpasswordemailtemplate, breachedpasswordsmstemplate, preventWebhook, xPreventWebhook, fields, options, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, invitationToken, emailtemplate2fa, duoredirecturi, _callback); + Type localVarReturnType = new TypeToken<EmailByLoginUserNamePhone200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for finishAutofillPasskeyLogin + * @param passkeyLoginAutofillRequest (required) + * @param loginurl Login URL for the User which will come in the login logs from where the User logged in. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param invitationToken Invitation token of an organization (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbaoneclickemailtemplate RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully finish login </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call finishAutofillPasskeyLoginCall(PasskeyLoginAutofillRequest passkeyLoginAutofillRequest, String loginurl, String verificationurl, String emailtemplate, String invitationToken, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String options, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, 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 = passkeyLoginAutofillRequest; + + // create path and map variables + String localVarPath = "/identity/v2/auth/login/passkey/autofill/finish"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (loginurl != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("loginurl", loginurl)); + } + + if (verificationurl != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("verificationurl", verificationurl)); + } + + if (emailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailtemplate", emailtemplate)); + } + + if (invitationToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("invitation_token", invitationToken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (fields != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fields", fields)); + } + + if (options != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("options", options)); + } + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (gRecaptchaResponse2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g_recaptcha_response", gRecaptchaResponse2)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + if (rbabrowseremailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbabrowseremailtemplate", rbabrowseremailtemplate)); + } + + if (rbaoneclickemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaoneclickemailtemplate", rbaoneclickemailtemplate)); + } + + if (rbacityemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacityemailtemplate", rbacityemailtemplate)); + } + + if (rbacountryemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacountryemailtemplate", rbacountryemailtemplate)); + } + + if (rbaipemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaipemailtemplate", rbaipemailtemplate)); + } + + if (rbadeviceemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbadeviceemailtemplate", rbadeviceemailtemplate)); + } + + if (rbaotpsmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaotpsmstemplate", rbaotpsmstemplate)); + } + + if (rbabrowsersmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbabrowsersmstemplate", rbabrowsersmstemplate)); + } + + if (rbacitysmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacitysmstemplate", rbacitysmstemplate)); + } + + if (rbacountrysmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacountrysmstemplate", rbacountrysmstemplate)); + } + + if (rbaipsmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaipsmstemplate", rbaipsmstemplate)); + } + + if (rbadevicesmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbadevicesmstemplate", rbadevicesmstemplate)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call finishAutofillPasskeyLoginValidateBeforeCall(PasskeyLoginAutofillRequest passkeyLoginAutofillRequest, String loginurl, String verificationurl, String emailtemplate, String invitationToken, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String options, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'passkeyLoginAutofillRequest' is set + if (passkeyLoginAutofillRequest == null) { + throw new ApiException("Missing the required parameter 'passkeyLoginAutofillRequest' when calling finishAutofillPasskeyLogin(Async)"); + } + + return finishAutofillPasskeyLoginCall(passkeyLoginAutofillRequest, loginurl, verificationurl, emailtemplate, invitationToken, preventWebhook, xPreventWebhook, fields, options, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, _callback); + + } + + /** + * Complete Login with Autofill Passkey + * Completes the login process using an Autofill Passkey. + * @param passkeyLoginAutofillRequest (required) + * @param loginurl Login URL for the User which will come in the login logs from where the User logged in. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param invitationToken Invitation token of an organization (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbaoneclickemailtemplate RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @return AuthResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully finish login </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public AuthResponse finishAutofillPasskeyLogin(PasskeyLoginAutofillRequest passkeyLoginAutofillRequest, String loginurl, String verificationurl, String emailtemplate, String invitationToken, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String options, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate) throws ApiException { + ApiResponse<AuthResponse> localVarResp = finishAutofillPasskeyLoginWithHttpInfo(passkeyLoginAutofillRequest, loginurl, verificationurl, emailtemplate, invitationToken, preventWebhook, xPreventWebhook, fields, options, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate); + return localVarResp.getData(); + } + + /** + * Complete Login with Autofill Passkey + * Completes the login process using an Autofill Passkey. + * @param passkeyLoginAutofillRequest (required) + * @param loginurl Login URL for the User which will come in the login logs from where the User logged in. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param invitationToken Invitation token of an organization (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbaoneclickemailtemplate RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @return ApiResponse<AuthResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully finish login </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public ApiResponse<AuthResponse> finishAutofillPasskeyLoginWithHttpInfo(PasskeyLoginAutofillRequest passkeyLoginAutofillRequest, String loginurl, String verificationurl, String emailtemplate, String invitationToken, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String options, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate) throws ApiException { + okhttp3.Call localVarCall = finishAutofillPasskeyLoginValidateBeforeCall(passkeyLoginAutofillRequest, loginurl, verificationurl, emailtemplate, invitationToken, preventWebhook, xPreventWebhook, fields, options, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, null); + Type localVarReturnType = new TypeToken<AuthResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Complete Login with Autofill Passkey (asynchronously) + * Completes the login process using an Autofill Passkey. + * @param passkeyLoginAutofillRequest (required) + * @param loginurl Login URL for the User which will come in the login logs from where the User logged in. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param invitationToken Invitation token of an organization (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbaoneclickemailtemplate RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully finish login </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call finishAutofillPasskeyLoginAsync(PasskeyLoginAutofillRequest passkeyLoginAutofillRequest, String loginurl, String verificationurl, String emailtemplate, String invitationToken, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String options, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, final ApiCallback<AuthResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = finishAutofillPasskeyLoginValidateBeforeCall(passkeyLoginAutofillRequest, loginurl, verificationurl, emailtemplate, invitationToken, preventWebhook, xPreventWebhook, fields, options, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, _callback); + Type localVarReturnType = new TypeToken<AuthResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for finishPasskeyLogin + * @param passkeyLoginFinish (required) + * @param loginurl Login URL for the User which will come in the login logs from where the User logged in. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param invitationToken Invitation token of an organization (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbaoneclickemailtemplate RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully finish login </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call finishPasskeyLoginCall(PasskeyLoginFinish passkeyLoginFinish, String loginurl, String verificationurl, String emailtemplate, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String options, String invitationToken, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, 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 = passkeyLoginFinish; + + // create path and map variables + String localVarPath = "/identity/v2/auth/login/passkey/finish"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (loginurl != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("loginurl", loginurl)); + } + + if (verificationurl != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("verificationurl", verificationurl)); + } + + if (emailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailtemplate", emailtemplate)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (fields != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fields", fields)); + } + + if (options != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("options", options)); + } + + if (invitationToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("invitation_token", invitationToken)); + } + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (gRecaptchaResponse2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g_recaptcha_response", gRecaptchaResponse2)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + if (rbabrowseremailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbabrowseremailtemplate", rbabrowseremailtemplate)); + } + + if (rbaoneclickemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaoneclickemailtemplate", rbaoneclickemailtemplate)); + } + + if (rbacityemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacityemailtemplate", rbacityemailtemplate)); + } + + if (rbacountryemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacountryemailtemplate", rbacountryemailtemplate)); + } + + if (rbaipemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaipemailtemplate", rbaipemailtemplate)); + } + + if (rbadeviceemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbadeviceemailtemplate", rbadeviceemailtemplate)); + } + + if (rbaotpsmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaotpsmstemplate", rbaotpsmstemplate)); + } + + if (rbabrowsersmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbabrowsersmstemplate", rbabrowsersmstemplate)); + } + + if (rbacitysmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacitysmstemplate", rbacitysmstemplate)); + } + + if (rbacountrysmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacountrysmstemplate", rbacountrysmstemplate)); + } + + if (rbaipsmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaipsmstemplate", rbaipsmstemplate)); + } + + if (rbadevicesmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbadevicesmstemplate", rbadevicesmstemplate)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call finishPasskeyLoginValidateBeforeCall(PasskeyLoginFinish passkeyLoginFinish, String loginurl, String verificationurl, String emailtemplate, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String options, String invitationToken, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'passkeyLoginFinish' is set + if (passkeyLoginFinish == null) { + throw new ApiException("Missing the required parameter 'passkeyLoginFinish' when calling finishPasskeyLogin(Async)"); + } + + return finishPasskeyLoginCall(passkeyLoginFinish, loginurl, verificationurl, emailtemplate, preventWebhook, xPreventWebhook, fields, options, invitationToken, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, _callback); + + } + + /** + * Complete Login with Passkey + * Completes the login process using a Passkey. + * @param passkeyLoginFinish (required) + * @param loginurl Login URL for the User which will come in the login logs from where the User logged in. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param invitationToken Invitation token of an organization (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbaoneclickemailtemplate RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @return AuthResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully finish login </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public AuthResponse finishPasskeyLogin(PasskeyLoginFinish passkeyLoginFinish, String loginurl, String verificationurl, String emailtemplate, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String options, String invitationToken, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate) throws ApiException { + ApiResponse<AuthResponse> localVarResp = finishPasskeyLoginWithHttpInfo(passkeyLoginFinish, loginurl, verificationurl, emailtemplate, preventWebhook, xPreventWebhook, fields, options, invitationToken, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate); + return localVarResp.getData(); + } + + /** + * Complete Login with Passkey + * Completes the login process using a Passkey. + * @param passkeyLoginFinish (required) + * @param loginurl Login URL for the User which will come in the login logs from where the User logged in. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param invitationToken Invitation token of an organization (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbaoneclickemailtemplate RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @return ApiResponse<AuthResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully finish login </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public ApiResponse<AuthResponse> finishPasskeyLoginWithHttpInfo(PasskeyLoginFinish passkeyLoginFinish, String loginurl, String verificationurl, String emailtemplate, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String options, String invitationToken, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate) throws ApiException { + okhttp3.Call localVarCall = finishPasskeyLoginValidateBeforeCall(passkeyLoginFinish, loginurl, verificationurl, emailtemplate, preventWebhook, xPreventWebhook, fields, options, invitationToken, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, null); + Type localVarReturnType = new TypeToken<AuthResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Complete Login with Passkey (asynchronously) + * Completes the login process using a Passkey. + * @param passkeyLoginFinish (required) + * @param loginurl Login URL for the User which will come in the login logs from where the User logged in. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param invitationToken Invitation token of an organization (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbaoneclickemailtemplate RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully finish login </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call finishPasskeyLoginAsync(PasskeyLoginFinish passkeyLoginFinish, String loginurl, String verificationurl, String emailtemplate, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String options, String invitationToken, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, final ApiCallback<AuthResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = finishPasskeyLoginValidateBeforeCall(passkeyLoginFinish, loginurl, verificationurl, emailtemplate, preventWebhook, xPreventWebhook, fields, options, invitationToken, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, _callback); + Type localVarReturnType = new TypeToken<AuthResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for finishPasskeyReset + * @param finishMFAPasskeyRegistrationRequest (required) + * @param vtoken Verification token received in the Email. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully finish reset Passkey process </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call finishPasskeyResetCall(FinishMFAPasskeyRegistrationRequest finishMFAPasskeyRegistrationRequest, String vtoken, 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 = finishMFAPasskeyRegistrationRequest; + + // create path and map variables + String localVarPath = "/identity/v2/auth/passkey/reset/finish"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (vtoken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("vtoken", vtoken)); + } + + 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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call finishPasskeyResetValidateBeforeCall(FinishMFAPasskeyRegistrationRequest finishMFAPasskeyRegistrationRequest, String vtoken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'finishMFAPasskeyRegistrationRequest' is set + if (finishMFAPasskeyRegistrationRequest == null) { + throw new ApiException("Missing the required parameter 'finishMFAPasskeyRegistrationRequest' when calling finishPasskeyReset(Async)"); + } + + return finishPasskeyResetCall(finishMFAPasskeyRegistrationRequest, vtoken, _callback); + + } + + /** + * Complete Passkey Reset + * Completes the reset Passkey process for a User. + * @param finishMFAPasskeyRegistrationRequest (required) + * @param vtoken Verification token received in the Email. (optional) + * @return IsPostedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully finish reset Passkey process </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public IsPostedResponse finishPasskeyReset(FinishMFAPasskeyRegistrationRequest finishMFAPasskeyRegistrationRequest, String vtoken) throws ApiException { + ApiResponse<IsPostedResponse> localVarResp = finishPasskeyResetWithHttpInfo(finishMFAPasskeyRegistrationRequest, vtoken); + return localVarResp.getData(); + } + + /** + * Complete Passkey Reset + * Completes the reset Passkey process for a User. + * @param finishMFAPasskeyRegistrationRequest (required) + * @param vtoken Verification token received in the Email. (optional) + * @return ApiResponse<IsPostedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully finish reset Passkey process </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedResponse> finishPasskeyResetWithHttpInfo(FinishMFAPasskeyRegistrationRequest finishMFAPasskeyRegistrationRequest, String vtoken) throws ApiException { + okhttp3.Call localVarCall = finishPasskeyResetValidateBeforeCall(finishMFAPasskeyRegistrationRequest, vtoken, null); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Complete Passkey Reset (asynchronously) + * Completes the reset Passkey process for a User. + * @param finishMFAPasskeyRegistrationRequest (required) + * @param vtoken Verification token received in the Email. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully finish reset Passkey process </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call finishPasskeyResetAsync(FinishMFAPasskeyRegistrationRequest finishMFAPasskeyRegistrationRequest, String vtoken, final ApiCallback<IsPostedResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = finishPasskeyResetValidateBeforeCall(finishMFAPasskeyRegistrationRequest, vtoken, _callback); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPhoneNumberAvailability + * @param phone Phone ID of the associated Account. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getPhoneNumberAvailabilityCall(String phone, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, 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 = "/identity/v2/auth/phone"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (phone != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("phone", phone)); + } + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (gRecaptchaResponse2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g_recaptcha_response", gRecaptchaResponse2)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + 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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPhoneNumberAvailabilityValidateBeforeCall(String phone, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback _callback) throws ApiException { + return getPhoneNumberAvailabilityCall(phone, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + + } + + /** + * Check Phone availability + * Verifies if a Phone number is available for registration. + * @param phone Phone ID of the associated Account. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return IsExist + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public IsExist getPhoneNumberAvailability(String phone, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + ApiResponse<IsExist> localVarResp = getPhoneNumberAvailabilityWithHttpInfo(phone, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + return localVarResp.getData(); + } + + /** + * Check Phone availability + * Verifies if a Phone number is available for registration. + * @param phone Phone ID of the associated Account. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return ApiResponse<IsExist> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsExist> getPhoneNumberAvailabilityWithHttpInfo(String phone, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + okhttp3.Call localVarCall = getPhoneNumberAvailabilityValidateBeforeCall(phone, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, null); + Type localVarReturnType = new TypeToken<IsExist>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Check Phone availability (asynchronously) + * Verifies if a Phone number is available for registration. + * @param phone Phone ID of the associated Account. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getPhoneNumberAvailabilityAsync(String phone, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback<IsExist> _callback) throws ApiException { + + okhttp3.Call localVarCall = getPhoneNumberAvailabilityValidateBeforeCall(phone, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + Type localVarReturnType = new TypeToken<IsExist>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getSmartLogin + * @param email Email address of the associated Account. (optional) + * @param username Username of the associated Account. (optional) + * @param phone Phone ID of the associated Account. (optional) + * @param clientguid Client GUID for the request. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param redirecturl The URL to which the User will be redirected after completing the operation, such as login or verification. (optional) + * @param smstemplate SMS Template (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param smartloginemailtemplate The template name for the smart login Email. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getSmartLoginCall(String email, String username, String phone, String clientguid, String welcomeemailtemplate, String redirecturl, String smstemplate, Boolean isvoiceotp, String smartloginemailtemplate, 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 = "/identity/v2/auth/login/smartlogin"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (email != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("email", email)); + } + + if (username != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("username", username)); + } + + if (phone != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("phone", phone)); + } + + if (clientguid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("clientguid", clientguid)); + } + + if (welcomeemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("welcomeemailtemplate", welcomeemailtemplate)); + } + + if (redirecturl != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("redirecturl", redirecturl)); + } + + if (smstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("smstemplate", smstemplate)); + } + + if (isvoiceotp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("isvoiceotp", isvoiceotp)); + } + + if (smartloginemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("smartloginemailtemplate", smartloginemailtemplate)); + } + + 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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSmartLoginValidateBeforeCall(String email, String username, String phone, String clientguid, String welcomeemailtemplate, String redirecturl, String smstemplate, Boolean isvoiceotp, String smartloginemailtemplate, final ApiCallback _callback) throws ApiException { + return getSmartLoginCall(email, username, phone, clientguid, welcomeemailtemplate, redirecturl, smstemplate, isvoiceotp, smartloginemailtemplate, _callback); + + } + + /** + * Retrieve OTP or Link for Smart Login + * Initiates a smart login process using Email, Username, or Phone, allowing flexibility based on the User's input. + * @param email Email address of the associated Account. (optional) + * @param username Username of the associated Account. (optional) + * @param phone Phone ID of the associated Account. (optional) + * @param clientguid Client GUID for the request. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param redirecturl The URL to which the User will be redirected after completing the operation, such as login or verification. (optional) + * @param smstemplate SMS Template (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param smartloginemailtemplate The template name for the smart login Email. (optional) + * @return IsPostedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public IsPostedResponse getSmartLogin(String email, String username, String phone, String clientguid, String welcomeemailtemplate, String redirecturl, String smstemplate, Boolean isvoiceotp, String smartloginemailtemplate) throws ApiException { + ApiResponse<IsPostedResponse> localVarResp = getSmartLoginWithHttpInfo(email, username, phone, clientguid, welcomeemailtemplate, redirecturl, smstemplate, isvoiceotp, smartloginemailtemplate); + return localVarResp.getData(); + } + + /** + * Retrieve OTP or Link for Smart Login + * Initiates a smart login process using Email, Username, or Phone, allowing flexibility based on the User's input. + * @param email Email address of the associated Account. (optional) + * @param username Username of the associated Account. (optional) + * @param phone Phone ID of the associated Account. (optional) + * @param clientguid Client GUID for the request. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param redirecturl The URL to which the User will be redirected after completing the operation, such as login or verification. (optional) + * @param smstemplate SMS Template (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param smartloginemailtemplate The template name for the smart login Email. (optional) + * @return ApiResponse<IsPostedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedResponse> getSmartLoginWithHttpInfo(String email, String username, String phone, String clientguid, String welcomeemailtemplate, String redirecturl, String smstemplate, Boolean isvoiceotp, String smartloginemailtemplate) throws ApiException { + okhttp3.Call localVarCall = getSmartLoginValidateBeforeCall(email, username, phone, clientguid, welcomeemailtemplate, redirecturl, smstemplate, isvoiceotp, smartloginemailtemplate, null); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve OTP or Link for Smart Login (asynchronously) + * Initiates a smart login process using Email, Username, or Phone, allowing flexibility based on the User's input. + * @param email Email address of the associated Account. (optional) + * @param username Username of the associated Account. (optional) + * @param phone Phone ID of the associated Account. (optional) + * @param clientguid Client GUID for the request. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param redirecturl The URL to which the User will be redirected after completing the operation, such as login or verification. (optional) + * @param smstemplate SMS Template (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param smartloginemailtemplate The template name for the smart login Email. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getSmartLoginAsync(String email, String username, String phone, String clientguid, String welcomeemailtemplate, String redirecturl, String smstemplate, Boolean isvoiceotp, String smartloginemailtemplate, final ApiCallback<IsPostedResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getSmartLoginValidateBeforeCall(email, username, phone, clientguid, welcomeemailtemplate, redirecturl, smstemplate, isvoiceotp, smartloginemailtemplate, _callback); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for loginByNoRegistrationPassCode + * @param verifyOtpPhoneModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param otp One-time passcode sent to the User's Email. (optional) + * @param smstemplate SMS Template (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call loginByNoRegistrationPassCodeCall(VerifyOtpPhoneModel verifyOtpPhoneModel, Boolean xPreventWebhook, Boolean preventWebhook, String otp, String smstemplate, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, 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 = verifyOtpPhoneModel; + + // create path and map variables + String localVarPath = "/identity/v2/auth/onetouchlogin/phone/verify"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (otp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("otp", otp)); + } + + if (smstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("smstemplate", smstemplate)); + } + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (gRecaptchaResponse2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g_recaptcha_response", gRecaptchaResponse2)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call loginByNoRegistrationPassCodeValidateBeforeCall(VerifyOtpPhoneModel verifyOtpPhoneModel, Boolean xPreventWebhook, Boolean preventWebhook, String otp, String smstemplate, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'verifyOtpPhoneModel' is set + if (verifyOtpPhoneModel == null) { + throw new ApiException("Missing the required parameter 'verifyOtpPhoneModel' when calling loginByNoRegistrationPassCode(Async)"); + } + + return loginByNoRegistrationPassCodeCall(verifyOtpPhoneModel, xPreventWebhook, preventWebhook, otp, smstemplate, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + + } + + /** + * Verify one-touch login + * Verifies a one-time passcode (OTP) for login without requiring User registration, including captcha validation and optional security answers. + * @param verifyOtpPhoneModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param otp One-time passcode sent to the User's Email. (optional) + * @param smstemplate SMS Template (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return IsPostedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public IsPostedResponse loginByNoRegistrationPassCode(VerifyOtpPhoneModel verifyOtpPhoneModel, Boolean xPreventWebhook, Boolean preventWebhook, String otp, String smstemplate, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + ApiResponse<IsPostedResponse> localVarResp = loginByNoRegistrationPassCodeWithHttpInfo(verifyOtpPhoneModel, xPreventWebhook, preventWebhook, otp, smstemplate, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + return localVarResp.getData(); + } + + /** + * Verify one-touch login + * Verifies a one-time passcode (OTP) for login without requiring User registration, including captcha validation and optional security answers. + * @param verifyOtpPhoneModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param otp One-time passcode sent to the User's Email. (optional) + * @param smstemplate SMS Template (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return ApiResponse<IsPostedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedResponse> loginByNoRegistrationPassCodeWithHttpInfo(VerifyOtpPhoneModel verifyOtpPhoneModel, Boolean xPreventWebhook, Boolean preventWebhook, String otp, String smstemplate, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + okhttp3.Call localVarCall = loginByNoRegistrationPassCodeValidateBeforeCall(verifyOtpPhoneModel, xPreventWebhook, preventWebhook, otp, smstemplate, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, null); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Verify one-touch login (asynchronously) + * Verifies a one-time passcode (OTP) for login without requiring User registration, including captcha validation and optional security answers. + * @param verifyOtpPhoneModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param otp One-time passcode sent to the User's Email. (optional) + * @param smstemplate SMS Template (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call loginByNoRegistrationPassCodeAsync(VerifyOtpPhoneModel verifyOtpPhoneModel, Boolean xPreventWebhook, Boolean preventWebhook, String otp, String smstemplate, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback<IsPostedResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = loginByNoRegistrationPassCodeValidateBeforeCall(verifyOtpPhoneModel, xPreventWebhook, preventWebhook, otp, smstemplate, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for nativeProviderAccessToken + * @param nativeProvider Indicates the provider for the native application. This parameter is used to specify the authentication provider for the native app. (required) + * @param refreshToken Refresh Token (required) + * @param socialappname Indicates the name of the social application. This parameter is used to specify the social app for which the Access Token is being requested. (optional) + * @param redirectUri Redirect URI for the OAuth/OIDC callback (optional) + * @param providername The name of the provider. This parameter is used to specify the provider for authentication. (optional) + * @param code The authorization code received from the apple, wechat, qq provider. The parameter is used to exchange the authorization code for an Access Token. (optional) + * @param twAccessToken The Access Token used for Twitter authentication. The parameter is used to authenticate the User with Twitter. (optional) + * @param twTokenSecret The secret token used for Twitter authentication. The parameter is used to authenticate the User with Twitter. (optional) + * @param googleAuthcode The authorization code received from Google. This parameter is used to exchange the authorization code for an Access Token. (optional) + * @param clientId OIDC application Client ID for request authentication. (optional) + * @param googleAccessToken The Access Token received from Google. The parameter is used to authenticate the User with Google services. (optional) + * @param idToken The ID token used for googlejwt, facebookjwt, applejwt authentication. The parameter is used to verify the User's identity. (optional) + * @param fsAccessToken The Access Token used for Foursquare authentication. The parameter is used to authenticate the User with Foursquare. (optional) + * @param lnAccessToken The Access Token used for LinkedIn authentication. The parameter is used to authenticate the User with LinkedIn. (optional) + * @param fbAccessToken The Access Token used for Facebook authentication. The parameter is used to authenticate the User with Facebook. (optional) + * @param invitationToken Invitation token of an organization (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected condition that prevented it from fulfilling the request. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call nativeProviderAccessTokenCall(String nativeProvider, String refreshToken, String socialappname, URI redirectUri, String providername, String code, String twAccessToken, String twTokenSecret, String googleAuthcode, String clientId, String googleAccessToken, String idToken, String fsAccessToken, String lnAccessToken, String fbAccessToken, String invitationToken, 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 = "/api/v2/access_token/{nativeProvider}" + .replace("{" + "nativeProvider" + "}", localVarApiClient.escapeString(nativeProvider.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (socialappname != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("socialappname", socialappname)); + } + + if (redirectUri != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("redirect_uri", redirectUri)); + } + + if (refreshToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("refresh_token", refreshToken)); + } + + if (providername != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("providername", providername)); + } + + if (code != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("code", code)); + } + + if (twAccessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("tw_access_token", twAccessToken)); + } + + if (twTokenSecret != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("tw_token_secret", twTokenSecret)); + } + + if (googleAuthcode != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("google_authcode", googleAuthcode)); + } + + if (clientId != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("client_id", clientId)); + } + + if (googleAccessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("google_access_token", googleAccessToken)); + } + + if (idToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("id_token", idToken)); + } + + if (fsAccessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fs_access_token", fsAccessToken)); + } + + if (lnAccessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("ln_access_token", lnAccessToken)); + } + + if (fbAccessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fb_access_token", fbAccessToken)); + } + + if (invitationToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("invitation_token", invitationToken)); + } + + 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[] { "APIKey", "XLoginRadiusAPIKey", "XLoginRadiusAPISecret", "ApiSecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call nativeProviderAccessTokenValidateBeforeCall(String nativeProvider, String refreshToken, String socialappname, URI redirectUri, String providername, String code, String twAccessToken, String twTokenSecret, String googleAuthcode, String clientId, String googleAccessToken, String idToken, String fsAccessToken, String lnAccessToken, String fbAccessToken, String invitationToken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'nativeProvider' is set + if (nativeProvider == null) { + throw new ApiException("Missing the required parameter 'nativeProvider' when calling nativeProviderAccessToken(Async)"); + } + + // verify the required parameter 'refreshToken' is set + if (refreshToken == null) { + throw new ApiException("Missing the required parameter 'refreshToken' when calling nativeProviderAccessToken(Async)"); + } + + return nativeProviderAccessTokenCall(nativeProvider, refreshToken, socialappname, redirectUri, providername, code, twAccessToken, twTokenSecret, googleAuthcode, clientId, googleAccessToken, idToken, fsAccessToken, lnAccessToken, fbAccessToken, invitationToken, _callback); + + } + + /** + * Login via social provider + * Retrieves an Access Token for authentication through a native social provider. + * @param nativeProvider Indicates the provider for the native application. This parameter is used to specify the authentication provider for the native app. (required) + * @param refreshToken Refresh Token (required) + * @param socialappname Indicates the name of the social application. This parameter is used to specify the social app for which the Access Token is being requested. (optional) + * @param redirectUri Redirect URI for the OAuth/OIDC callback (optional) + * @param providername The name of the provider. This parameter is used to specify the provider for authentication. (optional) + * @param code The authorization code received from the apple, wechat, qq provider. The parameter is used to exchange the authorization code for an Access Token. (optional) + * @param twAccessToken The Access Token used for Twitter authentication. The parameter is used to authenticate the User with Twitter. (optional) + * @param twTokenSecret The secret token used for Twitter authentication. The parameter is used to authenticate the User with Twitter. (optional) + * @param googleAuthcode The authorization code received from Google. This parameter is used to exchange the authorization code for an Access Token. (optional) + * @param clientId OIDC application Client ID for request authentication. (optional) + * @param googleAccessToken The Access Token received from Google. The parameter is used to authenticate the User with Google services. (optional) + * @param idToken The ID token used for googlejwt, facebookjwt, applejwt authentication. The parameter is used to verify the User's identity. (optional) + * @param fsAccessToken The Access Token used for Foursquare authentication. The parameter is used to authenticate the User with Foursquare. (optional) + * @param lnAccessToken The Access Token used for LinkedIn authentication. The parameter is used to authenticate the User with LinkedIn. (optional) + * @param fbAccessToken The Access Token used for Facebook authentication. The parameter is used to authenticate the User with Facebook. (optional) + * @param invitationToken Invitation token of an organization (optional) + * @return AccessTokenResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected condition that prevented it from fulfilling the request. </td><td> - </td></tr> + </table> + */ + public AccessTokenResponse nativeProviderAccessToken(String nativeProvider, String refreshToken, String socialappname, URI redirectUri, String providername, String code, String twAccessToken, String twTokenSecret, String googleAuthcode, String clientId, String googleAccessToken, String idToken, String fsAccessToken, String lnAccessToken, String fbAccessToken, String invitationToken) throws ApiException { + ApiResponse<AccessTokenResponse> localVarResp = nativeProviderAccessTokenWithHttpInfo(nativeProvider, refreshToken, socialappname, redirectUri, providername, code, twAccessToken, twTokenSecret, googleAuthcode, clientId, googleAccessToken, idToken, fsAccessToken, lnAccessToken, fbAccessToken, invitationToken); + return localVarResp.getData(); + } + + /** + * Login via social provider + * Retrieves an Access Token for authentication through a native social provider. + * @param nativeProvider Indicates the provider for the native application. This parameter is used to specify the authentication provider for the native app. (required) + * @param refreshToken Refresh Token (required) + * @param socialappname Indicates the name of the social application. This parameter is used to specify the social app for which the Access Token is being requested. (optional) + * @param redirectUri Redirect URI for the OAuth/OIDC callback (optional) + * @param providername The name of the provider. This parameter is used to specify the provider for authentication. (optional) + * @param code The authorization code received from the apple, wechat, qq provider. The parameter is used to exchange the authorization code for an Access Token. (optional) + * @param twAccessToken The Access Token used for Twitter authentication. The parameter is used to authenticate the User with Twitter. (optional) + * @param twTokenSecret The secret token used for Twitter authentication. The parameter is used to authenticate the User with Twitter. (optional) + * @param googleAuthcode The authorization code received from Google. This parameter is used to exchange the authorization code for an Access Token. (optional) + * @param clientId OIDC application Client ID for request authentication. (optional) + * @param googleAccessToken The Access Token received from Google. The parameter is used to authenticate the User with Google services. (optional) + * @param idToken The ID token used for googlejwt, facebookjwt, applejwt authentication. The parameter is used to verify the User's identity. (optional) + * @param fsAccessToken The Access Token used for Foursquare authentication. The parameter is used to authenticate the User with Foursquare. (optional) + * @param lnAccessToken The Access Token used for LinkedIn authentication. The parameter is used to authenticate the User with LinkedIn. (optional) + * @param fbAccessToken The Access Token used for Facebook authentication. The parameter is used to authenticate the User with Facebook. (optional) + * @param invitationToken Invitation token of an organization (optional) + * @return ApiResponse<AccessTokenResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected condition that prevented it from fulfilling the request. </td><td> - </td></tr> + </table> + */ + public ApiResponse<AccessTokenResponse> nativeProviderAccessTokenWithHttpInfo(String nativeProvider, String refreshToken, String socialappname, URI redirectUri, String providername, String code, String twAccessToken, String twTokenSecret, String googleAuthcode, String clientId, String googleAccessToken, String idToken, String fsAccessToken, String lnAccessToken, String fbAccessToken, String invitationToken) throws ApiException { + okhttp3.Call localVarCall = nativeProviderAccessTokenValidateBeforeCall(nativeProvider, refreshToken, socialappname, redirectUri, providername, code, twAccessToken, twTokenSecret, googleAuthcode, clientId, googleAccessToken, idToken, fsAccessToken, lnAccessToken, fbAccessToken, invitationToken, null); + Type localVarReturnType = new TypeToken<AccessTokenResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Login via social provider (asynchronously) + * Retrieves an Access Token for authentication through a native social provider. + * @param nativeProvider Indicates the provider for the native application. This parameter is used to specify the authentication provider for the native app. (required) + * @param refreshToken Refresh Token (required) + * @param socialappname Indicates the name of the social application. This parameter is used to specify the social app for which the Access Token is being requested. (optional) + * @param redirectUri Redirect URI for the OAuth/OIDC callback (optional) + * @param providername The name of the provider. This parameter is used to specify the provider for authentication. (optional) + * @param code The authorization code received from the apple, wechat, qq provider. The parameter is used to exchange the authorization code for an Access Token. (optional) + * @param twAccessToken The Access Token used for Twitter authentication. The parameter is used to authenticate the User with Twitter. (optional) + * @param twTokenSecret The secret token used for Twitter authentication. The parameter is used to authenticate the User with Twitter. (optional) + * @param googleAuthcode The authorization code received from Google. This parameter is used to exchange the authorization code for an Access Token. (optional) + * @param clientId OIDC application Client ID for request authentication. (optional) + * @param googleAccessToken The Access Token received from Google. The parameter is used to authenticate the User with Google services. (optional) + * @param idToken The ID token used for googlejwt, facebookjwt, applejwt authentication. The parameter is used to verify the User's identity. (optional) + * @param fsAccessToken The Access Token used for Foursquare authentication. The parameter is used to authenticate the User with Foursquare. (optional) + * @param lnAccessToken The Access Token used for LinkedIn authentication. The parameter is used to authenticate the User with LinkedIn. (optional) + * @param fbAccessToken The Access Token used for Facebook authentication. The parameter is used to authenticate the User with Facebook. (optional) + * @param invitationToken Invitation token of an organization (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected condition that prevented it from fulfilling the request. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call nativeProviderAccessTokenAsync(String nativeProvider, String refreshToken, String socialappname, URI redirectUri, String providername, String code, String twAccessToken, String twTokenSecret, String googleAuthcode, String clientId, String googleAccessToken, String idToken, String fsAccessToken, String lnAccessToken, String fbAccessToken, String invitationToken, final ApiCallback<AccessTokenResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = nativeProviderAccessTokenValidateBeforeCall(nativeProvider, refreshToken, socialappname, redirectUri, providername, code, twAccessToken, twTokenSecret, googleAuthcode, clientId, googleAccessToken, idToken, fsAccessToken, lnAccessToken, fbAccessToken, invitationToken, _callback); + Type localVarReturnType = new TypeToken<AccessTokenResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for oneTouchLoginByEmail + * @param oneTouchLoginByEmail (required) + * @param redirecturl The URL to which the User will be redirected after completing the operation, such as login or verification. (optional) + * @param onetouchloginemailtemplate One Touch Login Email Template (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call oneTouchLoginByEmailCall(OneTouchLoginByEmail oneTouchLoginByEmail, String redirecturl, String onetouchloginemailtemplate, String welcomeemailtemplate, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, 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 = oneTouchLoginByEmail; + + // create path and map variables + String localVarPath = "/identity/v2/auth/onetouchlogin/email"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (redirecturl != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("redirecturl", redirecturl)); + } + + if (onetouchloginemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("onetouchloginemailtemplate", onetouchloginemailtemplate)); + } + + if (welcomeemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("welcomeemailtemplate", welcomeemailtemplate)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (gRecaptchaResponse2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g_recaptcha_response", gRecaptchaResponse2)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call oneTouchLoginByEmailValidateBeforeCall(OneTouchLoginByEmail oneTouchLoginByEmail, String redirecturl, String onetouchloginemailtemplate, String welcomeemailtemplate, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'oneTouchLoginByEmail' is set + if (oneTouchLoginByEmail == null) { + throw new ApiException("Missing the required parameter 'oneTouchLoginByEmail' when calling oneTouchLoginByEmail(Async)"); + } + + return oneTouchLoginByEmailCall(oneTouchLoginByEmail, redirecturl, onetouchloginemailtemplate, welcomeemailtemplate, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + + } + + /** + * Retrieve link or OTP for one-touch login + * Initiates a one-touch login process using an Email. + * @param oneTouchLoginByEmail (required) + * @param redirecturl The URL to which the User will be redirected after completing the operation, such as login or verification. (optional) + * @param onetouchloginemailtemplate One Touch Login Email Template (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return IsPostedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public IsPostedResponse oneTouchLoginByEmail(OneTouchLoginByEmail oneTouchLoginByEmail, String redirecturl, String onetouchloginemailtemplate, String welcomeemailtemplate, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + ApiResponse<IsPostedResponse> localVarResp = oneTouchLoginByEmailWithHttpInfo(oneTouchLoginByEmail, redirecturl, onetouchloginemailtemplate, welcomeemailtemplate, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + return localVarResp.getData(); + } + + /** + * Retrieve link or OTP for one-touch login + * Initiates a one-touch login process using an Email. + * @param oneTouchLoginByEmail (required) + * @param redirecturl The URL to which the User will be redirected after completing the operation, such as login or verification. (optional) + * @param onetouchloginemailtemplate One Touch Login Email Template (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return ApiResponse<IsPostedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedResponse> oneTouchLoginByEmailWithHttpInfo(OneTouchLoginByEmail oneTouchLoginByEmail, String redirecturl, String onetouchloginemailtemplate, String welcomeemailtemplate, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + okhttp3.Call localVarCall = oneTouchLoginByEmailValidateBeforeCall(oneTouchLoginByEmail, redirecturl, onetouchloginemailtemplate, welcomeemailtemplate, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, null); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve link or OTP for one-touch login (asynchronously) + * Initiates a one-touch login process using an Email. + * @param oneTouchLoginByEmail (required) + * @param redirecturl The URL to which the User will be redirected after completing the operation, such as login or verification. (optional) + * @param onetouchloginemailtemplate One Touch Login Email Template (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call oneTouchLoginByEmailAsync(OneTouchLoginByEmail oneTouchLoginByEmail, String redirecturl, String onetouchloginemailtemplate, String welcomeemailtemplate, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback<IsPostedResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = oneTouchLoginByEmailValidateBeforeCall(oneTouchLoginByEmail, redirecturl, onetouchloginemailtemplate, welcomeemailtemplate, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for oneTouchLoginByPhone + * @param oneTouchLoginByPhone (required) + * @param smstemplate SMS Template (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call oneTouchLoginByPhoneCall(OneTouchLoginByPhone oneTouchLoginByPhone, String smstemplate, Boolean preventWebhook, Boolean xPreventWebhook, Boolean isvoiceotp, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, 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 = oneTouchLoginByPhone; + + // create path and map variables + String localVarPath = "/identity/v2/auth/onetouchlogin/phone"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (smstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("smstemplate", smstemplate)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (isvoiceotp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("isvoiceotp", isvoiceotp)); + } + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (gRecaptchaResponse2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g_recaptcha_response", gRecaptchaResponse2)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call oneTouchLoginByPhoneValidateBeforeCall(OneTouchLoginByPhone oneTouchLoginByPhone, String smstemplate, Boolean preventWebhook, Boolean xPreventWebhook, Boolean isvoiceotp, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'oneTouchLoginByPhone' is set + if (oneTouchLoginByPhone == null) { + throw new ApiException("Missing the required parameter 'oneTouchLoginByPhone' when calling oneTouchLoginByPhone(Async)"); + } + + return oneTouchLoginByPhoneCall(oneTouchLoginByPhone, smstemplate, preventWebhook, xPreventWebhook, isvoiceotp, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + + } + + /** + * Retrieve OTP for one-touch login + * Initiates a one-touch login process using a Phone number. + * @param oneTouchLoginByPhone (required) + * @param smstemplate SMS Template (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return IsPostedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public IsPostedResponse oneTouchLoginByPhone(OneTouchLoginByPhone oneTouchLoginByPhone, String smstemplate, Boolean preventWebhook, Boolean xPreventWebhook, Boolean isvoiceotp, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + ApiResponse<IsPostedResponse> localVarResp = oneTouchLoginByPhoneWithHttpInfo(oneTouchLoginByPhone, smstemplate, preventWebhook, xPreventWebhook, isvoiceotp, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + return localVarResp.getData(); + } + + /** + * Retrieve OTP for one-touch login + * Initiates a one-touch login process using a Phone number. + * @param oneTouchLoginByPhone (required) + * @param smstemplate SMS Template (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return ApiResponse<IsPostedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedResponse> oneTouchLoginByPhoneWithHttpInfo(OneTouchLoginByPhone oneTouchLoginByPhone, String smstemplate, Boolean preventWebhook, Boolean xPreventWebhook, Boolean isvoiceotp, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + okhttp3.Call localVarCall = oneTouchLoginByPhoneValidateBeforeCall(oneTouchLoginByPhone, smstemplate, preventWebhook, xPreventWebhook, isvoiceotp, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, null); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve OTP for one-touch login (asynchronously) + * Initiates a one-touch login process using a Phone number. + * @param oneTouchLoginByPhone (required) + * @param smstemplate SMS Template (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call oneTouchLoginByPhoneAsync(OneTouchLoginByPhone oneTouchLoginByPhone, String smstemplate, Boolean preventWebhook, Boolean xPreventWebhook, Boolean isvoiceotp, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback<IsPostedResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = oneTouchLoginByPhoneValidateBeforeCall(oneTouchLoginByPhone, smstemplate, preventWebhook, xPreventWebhook, isvoiceotp, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for passkeyForgot + * @param passkeyForgot (required) + * @param resetpasskeyurl Reset Passkey URL (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully submit request to reset the Passkey </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call passkeyForgotCall(PasskeyForgot passkeyForgot, String resetpasskeyurl, String emailtemplate, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, 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 = passkeyForgot; + + // create path and map variables + String localVarPath = "/identity/v2/auth/passkey/forgot"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (resetpasskeyurl != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("resetpasskeyurl", resetpasskeyurl)); + } + + if (emailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailtemplate", emailtemplate)); + } + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (gRecaptchaResponse2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g_recaptcha_response", gRecaptchaResponse2)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + 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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call passkeyForgotValidateBeforeCall(PasskeyForgot passkeyForgot, String resetpasskeyurl, String emailtemplate, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'passkeyForgot' is set + if (passkeyForgot == null) { + throw new ApiException("Missing the required parameter 'passkeyForgot' when calling passkeyForgot(Async)"); + } + + return passkeyForgotCall(passkeyForgot, resetpasskeyurl, emailtemplate, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + + } + + /** + * Initiate Forgot Passkey + * Initiates the forgot Passkey process for a User. + * @param passkeyForgot (required) + * @param resetpasskeyurl Reset Passkey URL (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return PasskeyForgot200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully submit request to reset the Passkey </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public PasskeyForgot200Response passkeyForgot(PasskeyForgot passkeyForgot, String resetpasskeyurl, String emailtemplate, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + ApiResponse<PasskeyForgot200Response> localVarResp = passkeyForgotWithHttpInfo(passkeyForgot, resetpasskeyurl, emailtemplate, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + return localVarResp.getData(); + } + + /** + * Initiate Forgot Passkey + * Initiates the forgot Passkey process for a User. + * @param passkeyForgot (required) + * @param resetpasskeyurl Reset Passkey URL (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return ApiResponse<PasskeyForgot200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully submit request to reset the Passkey </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<PasskeyForgot200Response> passkeyForgotWithHttpInfo(PasskeyForgot passkeyForgot, String resetpasskeyurl, String emailtemplate, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + okhttp3.Call localVarCall = passkeyForgotValidateBeforeCall(passkeyForgot, resetpasskeyurl, emailtemplate, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, null); + Type localVarReturnType = new TypeToken<PasskeyForgot200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Initiate Forgot Passkey (asynchronously) + * Initiates the forgot Passkey process for a User. + * @param passkeyForgot (required) + * @param resetpasskeyurl Reset Passkey URL (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully submit request to reset the Passkey </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call passkeyForgotAsync(PasskeyForgot passkeyForgot, String resetpasskeyurl, String emailtemplate, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback<PasskeyForgot200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = passkeyForgotValidateBeforeCall(passkeyForgot, resetpasskeyurl, emailtemplate, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + Type localVarReturnType = new TypeToken<PasskeyForgot200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for passwordlessEmailVerification + * @param verificationtoken Verification token received in the Email. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param smstemplate2fa SMS template name to be used for sending the 2FA code to the User. (optional) + * @param duoredirecturi Duo auth redirection url. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call passwordlessEmailVerificationCall(String verificationtoken, String welcomeemailtemplate, Boolean xPreventWebhook, Boolean preventWebhook, String smstemplate2fa, String duoredirecturi, 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 = "/identity/v2/auth/login/passwordlesslogin/email/verify"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (verificationtoken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("verificationtoken", verificationtoken)); + } + + if (welcomeemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("welcomeemailtemplate", welcomeemailtemplate)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (smstemplate2fa != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("smstemplate2fa", smstemplate2fa)); + } + + if (duoredirecturi != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("duoredirecturi", duoredirecturi)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call passwordlessEmailVerificationValidateBeforeCall(String verificationtoken, String welcomeemailtemplate, Boolean xPreventWebhook, Boolean preventWebhook, String smstemplate2fa, String duoredirecturi, final ApiCallback _callback) throws ApiException { + return passwordlessEmailVerificationCall(verificationtoken, welcomeemailtemplate, xPreventWebhook, preventWebhook, smstemplate2fa, duoredirecturi, _callback); + + } + + /** + * Verify Email for passwordless login + * Verifies the Email using the provided Verification Token for passwordless login. + * @param verificationtoken Verification token received in the Email. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param smstemplate2fa SMS template name to be used for sending the 2FA code to the User. (optional) + * @param duoredirecturi Duo auth redirection url. (optional) + * @return PasswordlessEmailVerification200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public PasswordlessEmailVerification200Response passwordlessEmailVerification(String verificationtoken, String welcomeemailtemplate, Boolean xPreventWebhook, Boolean preventWebhook, String smstemplate2fa, String duoredirecturi) throws ApiException { + ApiResponse<PasswordlessEmailVerification200Response> localVarResp = passwordlessEmailVerificationWithHttpInfo(verificationtoken, welcomeemailtemplate, xPreventWebhook, preventWebhook, smstemplate2fa, duoredirecturi); + return localVarResp.getData(); + } + + /** + * Verify Email for passwordless login + * Verifies the Email using the provided Verification Token for passwordless login. + * @param verificationtoken Verification token received in the Email. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param smstemplate2fa SMS template name to be used for sending the 2FA code to the User. (optional) + * @param duoredirecturi Duo auth redirection url. (optional) + * @return ApiResponse<PasswordlessEmailVerification200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public ApiResponse<PasswordlessEmailVerification200Response> passwordlessEmailVerificationWithHttpInfo(String verificationtoken, String welcomeemailtemplate, Boolean xPreventWebhook, Boolean preventWebhook, String smstemplate2fa, String duoredirecturi) throws ApiException { + okhttp3.Call localVarCall = passwordlessEmailVerificationValidateBeforeCall(verificationtoken, welcomeemailtemplate, xPreventWebhook, preventWebhook, smstemplate2fa, duoredirecturi, null); + Type localVarReturnType = new TypeToken<PasswordlessEmailVerification200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Verify Email for passwordless login (asynchronously) + * Verifies the Email using the provided Verification Token for passwordless login. + * @param verificationtoken Verification token received in the Email. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param smstemplate2fa SMS template name to be used for sending the 2FA code to the User. (optional) + * @param duoredirecturi Duo auth redirection url. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call passwordlessEmailVerificationAsync(String verificationtoken, String welcomeemailtemplate, Boolean xPreventWebhook, Boolean preventWebhook, String smstemplate2fa, String duoredirecturi, final ApiCallback<PasswordlessEmailVerification200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = passwordlessEmailVerificationValidateBeforeCall(verificationtoken, welcomeemailtemplate, xPreventWebhook, preventWebhook, smstemplate2fa, duoredirecturi, _callback); + Type localVarReturnType = new TypeToken<PasswordlessEmailVerification200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for passwordlessLoginByEmail + * @param email Email address of the associated Account. (optional) + * @param username Username of the associated Account. (optional) + * @param passwordlesslogintemplate Passwordless Login Template (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param invitationToken Invitation token of an organization (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call passwordlessLoginByEmailCall(String email, String username, String passwordlesslogintemplate, String verificationurl, String invitationToken, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, 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 = "/identity/v2/auth/login/passwordlesslogin/email"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (email != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("email", email)); + } + + if (username != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("username", username)); + } + + if (passwordlesslogintemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("passwordlesslogintemplate", passwordlesslogintemplate)); + } + + if (verificationurl != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("verificationurl", verificationurl)); + } + + if (invitationToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("invitation_token", invitationToken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (gRecaptchaResponse2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g_recaptcha_response", gRecaptchaResponse2)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call passwordlessLoginByEmailValidateBeforeCall(String email, String username, String passwordlesslogintemplate, String verificationurl, String invitationToken, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback _callback) throws ApiException { + return passwordlessLoginByEmailCall(email, username, passwordlesslogintemplate, verificationurl, invitationToken, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + + } + + /** + * Initiate passwordless login by Email + * Initiates a Passwordless login process using an Email or Username. This variant is login-only — the identifier must already belong to an existing User, and CAPTCHA is only required when the App configures optional CAPTCHA for this endpoint. Use the POST variant to auto-register an unknown Email with a registration profile. + * @param email Email address of the associated Account. (optional) + * @param username Username of the associated Account. (optional) + * @param passwordlesslogintemplate Passwordless Login Template (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param invitationToken Invitation token of an organization (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return IsPostedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public IsPostedResponse passwordlessLoginByEmail(String email, String username, String passwordlesslogintemplate, String verificationurl, String invitationToken, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + ApiResponse<IsPostedResponse> localVarResp = passwordlessLoginByEmailWithHttpInfo(email, username, passwordlesslogintemplate, verificationurl, invitationToken, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + return localVarResp.getData(); + } + + /** + * Initiate passwordless login by Email + * Initiates a Passwordless login process using an Email or Username. This variant is login-only — the identifier must already belong to an existing User, and CAPTCHA is only required when the App configures optional CAPTCHA for this endpoint. Use the POST variant to auto-register an unknown Email with a registration profile. + * @param email Email address of the associated Account. (optional) + * @param username Username of the associated Account. (optional) + * @param passwordlesslogintemplate Passwordless Login Template (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param invitationToken Invitation token of an organization (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return ApiResponse<IsPostedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedResponse> passwordlessLoginByEmailWithHttpInfo(String email, String username, String passwordlesslogintemplate, String verificationurl, String invitationToken, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + okhttp3.Call localVarCall = passwordlessLoginByEmailValidateBeforeCall(email, username, passwordlesslogintemplate, verificationurl, invitationToken, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, null); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Initiate passwordless login by Email (asynchronously) + * Initiates a Passwordless login process using an Email or Username. This variant is login-only — the identifier must already belong to an existing User, and CAPTCHA is only required when the App configures optional CAPTCHA for this endpoint. Use the POST variant to auto-register an unknown Email with a registration profile. + * @param email Email address of the associated Account. (optional) + * @param username Username of the associated Account. (optional) + * @param passwordlesslogintemplate Passwordless Login Template (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param invitationToken Invitation token of an organization (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call passwordlessLoginByEmailAsync(String email, String username, String passwordlesslogintemplate, String verificationurl, String invitationToken, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback<IsPostedResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = passwordlessLoginByEmailValidateBeforeCall(email, username, passwordlesslogintemplate, verificationurl, invitationToken, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for passwordlessLoginByEmailAndOTP + * @param passwordLessEmailOTPModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param smstemplate2fa SMS template name to be used for sending the 2FA code to the User. (optional) + * @param duoredirecturi Duo auth redirection url. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call passwordlessLoginByEmailAndOTPCall(PasswordLessEmailOTPModel passwordLessEmailOTPModel, Boolean xPreventWebhook, Boolean preventWebhook, String smstemplate2fa, String duoredirecturi, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, 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 = passwordLessEmailOTPModel; + + // create path and map variables + String localVarPath = "/identity/v2/auth/login/passwordlesslogin/email/verifyotp"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (smstemplate2fa != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("smstemplate2fa", smstemplate2fa)); + } + + if (duoredirecturi != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("duoredirecturi", duoredirecturi)); + } + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (gRecaptchaResponse2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g_recaptcha_response", gRecaptchaResponse2)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call passwordlessLoginByEmailAndOTPValidateBeforeCall(PasswordLessEmailOTPModel passwordLessEmailOTPModel, Boolean xPreventWebhook, Boolean preventWebhook, String smstemplate2fa, String duoredirecturi, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'passwordLessEmailOTPModel' is set + if (passwordLessEmailOTPModel == null) { + throw new ApiException("Missing the required parameter 'passwordLessEmailOTPModel' when calling passwordlessLoginByEmailAndOTP(Async)"); + } + + return passwordlessLoginByEmailAndOTPCall(passwordLessEmailOTPModel, xPreventWebhook, preventWebhook, smstemplate2fa, duoredirecturi, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + + } + + /** + * Verify Email and OTP for passwordless login + * Verifies the OTP sent to the Email for passwordless login. + * @param passwordLessEmailOTPModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param smstemplate2fa SMS template name to be used for sending the 2FA code to the User. (optional) + * @param duoredirecturi Duo auth redirection url. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return PasswordlessEmailVerification200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public PasswordlessEmailVerification200Response passwordlessLoginByEmailAndOTP(PasswordLessEmailOTPModel passwordLessEmailOTPModel, Boolean xPreventWebhook, Boolean preventWebhook, String smstemplate2fa, String duoredirecturi, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + ApiResponse<PasswordlessEmailVerification200Response> localVarResp = passwordlessLoginByEmailAndOTPWithHttpInfo(passwordLessEmailOTPModel, xPreventWebhook, preventWebhook, smstemplate2fa, duoredirecturi, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + return localVarResp.getData(); + } + + /** + * Verify Email and OTP for passwordless login + * Verifies the OTP sent to the Email for passwordless login. + * @param passwordLessEmailOTPModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param smstemplate2fa SMS template name to be used for sending the 2FA code to the User. (optional) + * @param duoredirecturi Duo auth redirection url. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return ApiResponse<PasswordlessEmailVerification200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public ApiResponse<PasswordlessEmailVerification200Response> passwordlessLoginByEmailAndOTPWithHttpInfo(PasswordLessEmailOTPModel passwordLessEmailOTPModel, Boolean xPreventWebhook, Boolean preventWebhook, String smstemplate2fa, String duoredirecturi, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + okhttp3.Call localVarCall = passwordlessLoginByEmailAndOTPValidateBeforeCall(passwordLessEmailOTPModel, xPreventWebhook, preventWebhook, smstemplate2fa, duoredirecturi, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, null); + Type localVarReturnType = new TypeToken<PasswordlessEmailVerification200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Verify Email and OTP for passwordless login (asynchronously) + * Verifies the OTP sent to the Email for passwordless login. + * @param passwordLessEmailOTPModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param smstemplate2fa SMS template name to be used for sending the 2FA code to the User. (optional) + * @param duoredirecturi Duo auth redirection url. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call passwordlessLoginByEmailAndOTPAsync(PasswordLessEmailOTPModel passwordLessEmailOTPModel, Boolean xPreventWebhook, Boolean preventWebhook, String smstemplate2fa, String duoredirecturi, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback<PasswordlessEmailVerification200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = passwordlessLoginByEmailAndOTPValidateBeforeCall(passwordLessEmailOTPModel, xPreventWebhook, preventWebhook, smstemplate2fa, duoredirecturi, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + Type localVarReturnType = new TypeToken<PasswordlessEmailVerification200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for passwordlessLoginByEmailWithProfile + * @param profileRequestModel (required) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param invitationToken Invitation token of an organization (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param xLoginRadiusSott SOTT should be generated from the server side and passed here or in sott query parameter. (optional) + * @param sott SOTT should be generated from the server side and passed here or in the X-LoginRadius-Sott header. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call passwordlessLoginByEmailWithProfileCall(ProfileRequestModel profileRequestModel, String emailtemplate, String verificationurl, String invitationToken, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, String xLoginRadiusSott, String sott, 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 = profileRequestModel; + + // create path and map variables + String localVarPath = "/identity/v2/auth/login/passwordlesslogin/email"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (emailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailtemplate", emailtemplate)); + } + + if (verificationurl != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("verificationurl", verificationurl)); + } + + if (invitationToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("invitation_token", invitationToken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (gRecaptchaResponse2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g_recaptcha_response", gRecaptchaResponse2)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + if (sott != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sott", sott)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + if (xLoginRadiusSott != null) { + localVarHeaderParams.put("X-LoginRadius-Sott", localVarApiClient.parameterToString(xLoginRadiusSott)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call passwordlessLoginByEmailWithProfileValidateBeforeCall(ProfileRequestModel profileRequestModel, String emailtemplate, String verificationurl, String invitationToken, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, String xLoginRadiusSott, String sott, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'profileRequestModel' is set + if (profileRequestModel == null) { + throw new ApiException("Missing the required parameter 'profileRequestModel' when calling passwordlessLoginByEmailWithProfile(Async)"); + } + + return passwordlessLoginByEmailWithProfileCall(profileRequestModel, emailtemplate, verificationurl, invitationToken, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, xLoginRadiusSott, sott, _callback); + + } + + /** + * Initiate passwordless login by Email with a registration profile + * POST variant of passwordless login by Email. The email identifier and the full registration profile are supplied in the JSON body (same schema as /auth/register). When passwordless email auto-registration is enabled, a previously-unknown email is auto-registered with the supplied profile fields, and the request must carry a valid SOTT or CAPTCHA. This endpoint registers by email only — any PhoneId or UserName supplied in the body is ignored (not validated and not stored), and Password is not required. Sending the profile in the body (instead of query parameters) keeps PII out of URLs and logs. + * @param profileRequestModel (required) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param invitationToken Invitation token of an organization (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param xLoginRadiusSott SOTT should be generated from the server side and passed here or in sott query parameter. (optional) + * @param sott SOTT should be generated from the server side and passed here or in the X-LoginRadius-Sott header. (optional) + * @return IsPostedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public IsPostedResponse passwordlessLoginByEmailWithProfile(ProfileRequestModel profileRequestModel, String emailtemplate, String verificationurl, String invitationToken, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, String xLoginRadiusSott, String sott) throws ApiException { + ApiResponse<IsPostedResponse> localVarResp = passwordlessLoginByEmailWithProfileWithHttpInfo(profileRequestModel, emailtemplate, verificationurl, invitationToken, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, xLoginRadiusSott, sott); + return localVarResp.getData(); + } + + /** + * Initiate passwordless login by Email with a registration profile + * POST variant of passwordless login by Email. The email identifier and the full registration profile are supplied in the JSON body (same schema as /auth/register). When passwordless email auto-registration is enabled, a previously-unknown email is auto-registered with the supplied profile fields, and the request must carry a valid SOTT or CAPTCHA. This endpoint registers by email only — any PhoneId or UserName supplied in the body is ignored (not validated and not stored), and Password is not required. Sending the profile in the body (instead of query parameters) keeps PII out of URLs and logs. + * @param profileRequestModel (required) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param invitationToken Invitation token of an organization (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param xLoginRadiusSott SOTT should be generated from the server side and passed here or in sott query parameter. (optional) + * @param sott SOTT should be generated from the server side and passed here or in the X-LoginRadius-Sott header. (optional) + * @return ApiResponse<IsPostedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedResponse> passwordlessLoginByEmailWithProfileWithHttpInfo(ProfileRequestModel profileRequestModel, String emailtemplate, String verificationurl, String invitationToken, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, String xLoginRadiusSott, String sott) throws ApiException { + okhttp3.Call localVarCall = passwordlessLoginByEmailWithProfileValidateBeforeCall(profileRequestModel, emailtemplate, verificationurl, invitationToken, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, xLoginRadiusSott, sott, null); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Initiate passwordless login by Email with a registration profile (asynchronously) + * POST variant of passwordless login by Email. The email identifier and the full registration profile are supplied in the JSON body (same schema as /auth/register). When passwordless email auto-registration is enabled, a previously-unknown email is auto-registered with the supplied profile fields, and the request must carry a valid SOTT or CAPTCHA. This endpoint registers by email only — any PhoneId or UserName supplied in the body is ignored (not validated and not stored), and Password is not required. Sending the profile in the body (instead of query parameters) keeps PII out of URLs and logs. + * @param profileRequestModel (required) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param invitationToken Invitation token of an organization (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param xLoginRadiusSott SOTT should be generated from the server side and passed here or in sott query parameter. (optional) + * @param sott SOTT should be generated from the server side and passed here or in the X-LoginRadius-Sott header. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call passwordlessLoginByEmailWithProfileAsync(ProfileRequestModel profileRequestModel, String emailtemplate, String verificationurl, String invitationToken, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, String xLoginRadiusSott, String sott, final ApiCallback<IsPostedResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = passwordlessLoginByEmailWithProfileValidateBeforeCall(profileRequestModel, emailtemplate, verificationurl, invitationToken, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, xLoginRadiusSott, sott, _callback); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for passwordlessLoginByPhone + * @param phone Phone ID of the associated Account. (optional) + * @param smstemplate SMS Template (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call passwordlessLoginByPhoneCall(String phone, String smstemplate, Boolean isvoiceotp, String options, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, 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 = "/identity/v2/auth/login/passwordlesslogin/otp"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (phone != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("phone", phone)); + } + + if (smstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("smstemplate", smstemplate)); + } + + if (isvoiceotp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("isvoiceotp", isvoiceotp)); + } + + if (options != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("options", options)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (gRecaptchaResponse2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g_recaptcha_response", gRecaptchaResponse2)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call passwordlessLoginByPhoneValidateBeforeCall(String phone, String smstemplate, Boolean isvoiceotp, String options, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback _callback) throws ApiException { + return passwordlessLoginByPhoneCall(phone, smstemplate, isvoiceotp, options, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + + } + + /** + * Initiate passwordless login by Phone + * Initiates a Passwordless login process using a Phone number — an OTP is sent to the supplied Phone number. This variant is login-only: the Phone number must already belong to an existing User, and CAPTCHA is only required when the App configures optional CAPTCHA for this endpoint. Use the POST variant to auto-register an unknown Phone number with a registration profile. + * @param phone Phone ID of the associated Account. (optional) + * @param smstemplate SMS Template (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return SMSResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public SMSResponse passwordlessLoginByPhone(String phone, String smstemplate, Boolean isvoiceotp, String options, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + ApiResponse<SMSResponse> localVarResp = passwordlessLoginByPhoneWithHttpInfo(phone, smstemplate, isvoiceotp, options, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + return localVarResp.getData(); + } + + /** + * Initiate passwordless login by Phone + * Initiates a Passwordless login process using a Phone number — an OTP is sent to the supplied Phone number. This variant is login-only: the Phone number must already belong to an existing User, and CAPTCHA is only required when the App configures optional CAPTCHA for this endpoint. Use the POST variant to auto-register an unknown Phone number with a registration profile. + * @param phone Phone ID of the associated Account. (optional) + * @param smstemplate SMS Template (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return ApiResponse<SMSResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SMSResponse> passwordlessLoginByPhoneWithHttpInfo(String phone, String smstemplate, Boolean isvoiceotp, String options, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + okhttp3.Call localVarCall = passwordlessLoginByPhoneValidateBeforeCall(phone, smstemplate, isvoiceotp, options, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, null); + Type localVarReturnType = new TypeToken<SMSResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Initiate passwordless login by Phone (asynchronously) + * Initiates a Passwordless login process using a Phone number — an OTP is sent to the supplied Phone number. This variant is login-only: the Phone number must already belong to an existing User, and CAPTCHA is only required when the App configures optional CAPTCHA for this endpoint. Use the POST variant to auto-register an unknown Phone number with a registration profile. + * @param phone Phone ID of the associated Account. (optional) + * @param smstemplate SMS Template (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call passwordlessLoginByPhoneAsync(String phone, String smstemplate, Boolean isvoiceotp, String options, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback<SMSResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = passwordlessLoginByPhoneValidateBeforeCall(phone, smstemplate, isvoiceotp, options, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + Type localVarReturnType = new TypeToken<SMSResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for passwordlessLoginByPhoneWithProfile + * @param profileRequestModel (required) + * @param smstemplate SMS Template (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param xLoginRadiusSott SOTT should be generated from the server side and passed here or in sott query parameter. (optional) + * @param sott SOTT should be generated from the server side and passed here or in the X-LoginRadius-Sott header. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call passwordlessLoginByPhoneWithProfileCall(ProfileRequestModel profileRequestModel, String smstemplate, Boolean isvoiceotp, String options, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, String xLoginRadiusSott, String sott, 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 = profileRequestModel; + + // create path and map variables + String localVarPath = "/identity/v2/auth/login/passwordlesslogin/otp"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (smstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("smstemplate", smstemplate)); + } + + if (isvoiceotp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("isvoiceotp", isvoiceotp)); + } + + if (options != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("options", options)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (gRecaptchaResponse2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g_recaptcha_response", gRecaptchaResponse2)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + if (sott != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sott", sott)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + if (xLoginRadiusSott != null) { + localVarHeaderParams.put("X-LoginRadius-Sott", localVarApiClient.parameterToString(xLoginRadiusSott)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call passwordlessLoginByPhoneWithProfileValidateBeforeCall(ProfileRequestModel profileRequestModel, String smstemplate, Boolean isvoiceotp, String options, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, String xLoginRadiusSott, String sott, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'profileRequestModel' is set + if (profileRequestModel == null) { + throw new ApiException("Missing the required parameter 'profileRequestModel' when calling passwordlessLoginByPhoneWithProfile(Async)"); + } + + return passwordlessLoginByPhoneWithProfileCall(profileRequestModel, smstemplate, isvoiceotp, options, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, xLoginRadiusSott, sott, _callback); + + } + + /** + * Initiate passwordless login by Phone with a registration profile + * POST variant of passwordless login by Phone. The phone identifier (PhoneId) and the full registration profile are supplied in the JSON body (same schema as /auth/register). When passwordless phone auto-registration is enabled, a previously-unknown phone number is auto-registered with the supplied profile fields, and the request must carry a valid SOTT or CAPTCHA. This endpoint registers by phone only — any Email or UserName supplied in the body is ignored (not validated and not stored), and Password is not required. Sending the profile in the body (instead of query parameters) keeps PII out of URLs and logs. + * @param profileRequestModel (required) + * @param smstemplate SMS Template (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param xLoginRadiusSott SOTT should be generated from the server side and passed here or in sott query parameter. (optional) + * @param sott SOTT should be generated from the server side and passed here or in the X-LoginRadius-Sott header. (optional) + * @return SMSResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public SMSResponse passwordlessLoginByPhoneWithProfile(ProfileRequestModel profileRequestModel, String smstemplate, Boolean isvoiceotp, String options, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, String xLoginRadiusSott, String sott) throws ApiException { + ApiResponse<SMSResponse> localVarResp = passwordlessLoginByPhoneWithProfileWithHttpInfo(profileRequestModel, smstemplate, isvoiceotp, options, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, xLoginRadiusSott, sott); + return localVarResp.getData(); + } + + /** + * Initiate passwordless login by Phone with a registration profile + * POST variant of passwordless login by Phone. The phone identifier (PhoneId) and the full registration profile are supplied in the JSON body (same schema as /auth/register). When passwordless phone auto-registration is enabled, a previously-unknown phone number is auto-registered with the supplied profile fields, and the request must carry a valid SOTT or CAPTCHA. This endpoint registers by phone only — any Email or UserName supplied in the body is ignored (not validated and not stored), and Password is not required. Sending the profile in the body (instead of query parameters) keeps PII out of URLs and logs. + * @param profileRequestModel (required) + * @param smstemplate SMS Template (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param xLoginRadiusSott SOTT should be generated from the server side and passed here or in sott query parameter. (optional) + * @param sott SOTT should be generated from the server side and passed here or in the X-LoginRadius-Sott header. (optional) + * @return ApiResponse<SMSResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SMSResponse> passwordlessLoginByPhoneWithProfileWithHttpInfo(ProfileRequestModel profileRequestModel, String smstemplate, Boolean isvoiceotp, String options, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, String xLoginRadiusSott, String sott) throws ApiException { + okhttp3.Call localVarCall = passwordlessLoginByPhoneWithProfileValidateBeforeCall(profileRequestModel, smstemplate, isvoiceotp, options, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, xLoginRadiusSott, sott, null); + Type localVarReturnType = new TypeToken<SMSResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Initiate passwordless login by Phone with a registration profile (asynchronously) + * POST variant of passwordless login by Phone. The phone identifier (PhoneId) and the full registration profile are supplied in the JSON body (same schema as /auth/register). When passwordless phone auto-registration is enabled, a previously-unknown phone number is auto-registered with the supplied profile fields, and the request must carry a valid SOTT or CAPTCHA. This endpoint registers by phone only — any Email or UserName supplied in the body is ignored (not validated and not stored), and Password is not required. Sending the profile in the body (instead of query parameters) keeps PII out of URLs and logs. + * @param profileRequestModel (required) + * @param smstemplate SMS Template (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param xLoginRadiusSott SOTT should be generated from the server side and passed here or in sott query parameter. (optional) + * @param sott SOTT should be generated from the server side and passed here or in the X-LoginRadius-Sott header. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call passwordlessLoginByPhoneWithProfileAsync(ProfileRequestModel profileRequestModel, String smstemplate, Boolean isvoiceotp, String options, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, String xLoginRadiusSott, String sott, final ApiCallback<SMSResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = passwordlessLoginByPhoneWithProfileValidateBeforeCall(profileRequestModel, smstemplate, isvoiceotp, options, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, xLoginRadiusSott, sott, _callback); + Type localVarReturnType = new TypeToken<SMSResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for passwordlessLoginByUsernameAndOTP + * @param passwordLessUserNameOTPModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param smstemplate2fa SMS template name to be used for sending the 2FA code to the User. (optional) + * @param duoredirecturi Duo auth redirection url. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call passwordlessLoginByUsernameAndOTPCall(PasswordLessUserNameOTPModel passwordLessUserNameOTPModel, Boolean xPreventWebhook, Boolean preventWebhook, String smstemplate2fa, String duoredirecturi, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, 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 = passwordLessUserNameOTPModel; + + // create path and map variables + String localVarPath = "/identity/v2/auth/login/passwordlesslogin/username/verifyotp"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (smstemplate2fa != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("smstemplate2fa", smstemplate2fa)); + } + + if (duoredirecturi != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("duoredirecturi", duoredirecturi)); + } + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (gRecaptchaResponse2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g_recaptcha_response", gRecaptchaResponse2)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call passwordlessLoginByUsernameAndOTPValidateBeforeCall(PasswordLessUserNameOTPModel passwordLessUserNameOTPModel, Boolean xPreventWebhook, Boolean preventWebhook, String smstemplate2fa, String duoredirecturi, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'passwordLessUserNameOTPModel' is set + if (passwordLessUserNameOTPModel == null) { + throw new ApiException("Missing the required parameter 'passwordLessUserNameOTPModel' when calling passwordlessLoginByUsernameAndOTP(Async)"); + } + + return passwordlessLoginByUsernameAndOTPCall(passwordLessUserNameOTPModel, xPreventWebhook, preventWebhook, smstemplate2fa, duoredirecturi, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + + } + + /** + * Verify Username for passwordless login + * Verifies the OTP sent to the Username for passwordless login. + * @param passwordLessUserNameOTPModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param smstemplate2fa SMS template name to be used for sending the 2FA code to the User. (optional) + * @param duoredirecturi Duo auth redirection url. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return PasswordlessEmailVerification200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public PasswordlessEmailVerification200Response passwordlessLoginByUsernameAndOTP(PasswordLessUserNameOTPModel passwordLessUserNameOTPModel, Boolean xPreventWebhook, Boolean preventWebhook, String smstemplate2fa, String duoredirecturi, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + ApiResponse<PasswordlessEmailVerification200Response> localVarResp = passwordlessLoginByUsernameAndOTPWithHttpInfo(passwordLessUserNameOTPModel, xPreventWebhook, preventWebhook, smstemplate2fa, duoredirecturi, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + return localVarResp.getData(); + } + + /** + * Verify Username for passwordless login + * Verifies the OTP sent to the Username for passwordless login. + * @param passwordLessUserNameOTPModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param smstemplate2fa SMS template name to be used for sending the 2FA code to the User. (optional) + * @param duoredirecturi Duo auth redirection url. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return ApiResponse<PasswordlessEmailVerification200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public ApiResponse<PasswordlessEmailVerification200Response> passwordlessLoginByUsernameAndOTPWithHttpInfo(PasswordLessUserNameOTPModel passwordLessUserNameOTPModel, Boolean xPreventWebhook, Boolean preventWebhook, String smstemplate2fa, String duoredirecturi, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + okhttp3.Call localVarCall = passwordlessLoginByUsernameAndOTPValidateBeforeCall(passwordLessUserNameOTPModel, xPreventWebhook, preventWebhook, smstemplate2fa, duoredirecturi, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, null); + Type localVarReturnType = new TypeToken<PasswordlessEmailVerification200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Verify Username for passwordless login (asynchronously) + * Verifies the OTP sent to the Username for passwordless login. + * @param passwordLessUserNameOTPModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param smstemplate2fa SMS template name to be used for sending the 2FA code to the User. (optional) + * @param duoredirecturi Duo auth redirection url. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call passwordlessLoginByUsernameAndOTPAsync(PasswordLessUserNameOTPModel passwordLessUserNameOTPModel, Boolean xPreventWebhook, Boolean preventWebhook, String smstemplate2fa, String duoredirecturi, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback<PasswordlessEmailVerification200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = passwordlessLoginByUsernameAndOTPValidateBeforeCall(passwordLessUserNameOTPModel, xPreventWebhook, preventWebhook, smstemplate2fa, duoredirecturi, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + Type localVarReturnType = new TypeToken<PasswordlessEmailVerification200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for passwordlessLoginPhoneVerification + * @param phoneOTPModel (required) + * @param smstemplate SMS Template (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param emailtemplate2fa Name of the 2FA Email template to use for this notification. (optional) + * @param duoredirecturi Duo auth redirection url. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call passwordlessLoginPhoneVerificationCall(PhoneOTPModel phoneOTPModel, String smstemplate, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, String emailtemplate2fa, String duoredirecturi, 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 = phoneOTPModel; + + // create path and map variables + String localVarPath = "/identity/v2/auth/login/passwordlesslogin/otp/verify"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (smstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("smstemplate", smstemplate)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (gRecaptchaResponse2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g_recaptcha_response", gRecaptchaResponse2)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + if (emailtemplate2fa != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailtemplate2fa", emailtemplate2fa)); + } + + if (duoredirecturi != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("duoredirecturi", duoredirecturi)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call passwordlessLoginPhoneVerificationValidateBeforeCall(PhoneOTPModel phoneOTPModel, String smstemplate, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, String emailtemplate2fa, String duoredirecturi, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'phoneOTPModel' is set + if (phoneOTPModel == null) { + throw new ApiException("Missing the required parameter 'phoneOTPModel' when calling passwordlessLoginPhoneVerification(Async)"); + } + + return passwordlessLoginPhoneVerificationCall(phoneOTPModel, smstemplate, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, emailtemplate2fa, duoredirecturi, _callback); + + } + + /** + * Verify Phone for passwordless login + * Verifies the OTP sent to the Phone number for passwordless login. + * @param phoneOTPModel (required) + * @param smstemplate SMS Template (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param emailtemplate2fa Name of the 2FA Email template to use for this notification. (optional) + * @param duoredirecturi Duo auth redirection url. (optional) + * @return PasswordlessEmailVerification200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public PasswordlessEmailVerification200Response passwordlessLoginPhoneVerification(PhoneOTPModel phoneOTPModel, String smstemplate, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, String emailtemplate2fa, String duoredirecturi) throws ApiException { + ApiResponse<PasswordlessEmailVerification200Response> localVarResp = passwordlessLoginPhoneVerificationWithHttpInfo(phoneOTPModel, smstemplate, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, emailtemplate2fa, duoredirecturi); + return localVarResp.getData(); + } + + /** + * Verify Phone for passwordless login + * Verifies the OTP sent to the Phone number for passwordless login. + * @param phoneOTPModel (required) + * @param smstemplate SMS Template (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param emailtemplate2fa Name of the 2FA Email template to use for this notification. (optional) + * @param duoredirecturi Duo auth redirection url. (optional) + * @return ApiResponse<PasswordlessEmailVerification200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public ApiResponse<PasswordlessEmailVerification200Response> passwordlessLoginPhoneVerificationWithHttpInfo(PhoneOTPModel phoneOTPModel, String smstemplate, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, String emailtemplate2fa, String duoredirecturi) throws ApiException { + okhttp3.Call localVarCall = passwordlessLoginPhoneVerificationValidateBeforeCall(phoneOTPModel, smstemplate, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, emailtemplate2fa, duoredirecturi, null); + Type localVarReturnType = new TypeToken<PasswordlessEmailVerification200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Verify Phone for passwordless login (asynchronously) + * Verifies the OTP sent to the Phone number for passwordless login. + * @param phoneOTPModel (required) + * @param smstemplate SMS Template (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param emailtemplate2fa Name of the 2FA Email template to use for this notification. (optional) + * @param duoredirecturi Duo auth redirection url. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call passwordlessLoginPhoneVerificationAsync(PhoneOTPModel phoneOTPModel, String smstemplate, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, String emailtemplate2fa, String duoredirecturi, final ApiCallback<PasswordlessEmailVerification200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = passwordlessLoginPhoneVerificationValidateBeforeCall(phoneOTPModel, smstemplate, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, emailtemplate2fa, duoredirecturi, _callback); + Type localVarReturnType = new TypeToken<PasswordlessEmailVerification200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for pingSmartLogin + * @param clientguid Client GUID for the request. (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call pingSmartLoginCall(String clientguid, Boolean xPreventWebhook, Boolean preventWebhook, 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 = "/identity/v2/auth/login/smartlogin/ping"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (clientguid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("clientguid", clientguid)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call pingSmartLoginValidateBeforeCall(String clientguid, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'clientguid' is set + if (clientguid == null) { + throw new ApiException("Missing the required parameter 'clientguid' when calling pingSmartLogin(Async)"); + } + + return pingSmartLoginCall(clientguid, xPreventWebhook, preventWebhook, _callback); + + } + + /** + * Ping Smart Login + * Checks in the background if the smart login is verified successfully. + * @param clientguid Client GUID for the request. (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return AuthResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public AuthResponse pingSmartLogin(String clientguid, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + ApiResponse<AuthResponse> localVarResp = pingSmartLoginWithHttpInfo(clientguid, xPreventWebhook, preventWebhook); + return localVarResp.getData(); + } + + /** + * Ping Smart Login + * Checks in the background if the smart login is verified successfully. + * @param clientguid Client GUID for the request. (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<AuthResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<AuthResponse> pingSmartLoginWithHttpInfo(String clientguid, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + okhttp3.Call localVarCall = pingSmartLoginValidateBeforeCall(clientguid, xPreventWebhook, preventWebhook, null); + Type localVarReturnType = new TypeToken<AuthResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Ping Smart Login (asynchronously) + * Checks in the background if the smart login is verified successfully. + * @param clientguid Client GUID for the request. (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call pingSmartLoginAsync(String clientguid, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback<AuthResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = pingSmartLoginValidateBeforeCall(clientguid, xPreventWebhook, preventWebhook, _callback); + Type localVarReturnType = new TypeToken<AuthResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for verifyAutoLoginEmailOneTouch + * @param email Email address of the associated Account. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param verificationtoken Verification token received in the Email. (optional) + * @param vtoken Verification token received in the Email. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call verifyAutoLoginEmailOneTouchCall(String email, String welcomeemailtemplate, String verificationtoken, String vtoken, Boolean xPreventWebhook, Boolean preventWebhook, 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 = "/identity/v2/auth/email/onetouchlogin"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (email != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("email", email)); + } + + if (welcomeemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("welcomeemailtemplate", welcomeemailtemplate)); + } + + if (verificationtoken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("verificationtoken", verificationtoken)); + } + + if (vtoken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("vtoken", vtoken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call verifyAutoLoginEmailOneTouchValidateBeforeCall(String email, String welcomeemailtemplate, String verificationtoken, String vtoken, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback _callback) throws ApiException { + return verifyAutoLoginEmailOneTouchCall(email, welcomeemailtemplate, verificationtoken, vtoken, xPreventWebhook, preventWebhook, _callback); + + } + + /** + * Verify one-touch login by Email + * Verifies the auto-login Email using a Verification Token. + * @param email Email address of the associated Account. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param verificationtoken Verification token received in the Email. (optional) + * @param vtoken Verification token received in the Email. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return IsPostedVerified + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public IsPostedVerified verifyAutoLoginEmailOneTouch(String email, String welcomeemailtemplate, String verificationtoken, String vtoken, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + ApiResponse<IsPostedVerified> localVarResp = verifyAutoLoginEmailOneTouchWithHttpInfo(email, welcomeemailtemplate, verificationtoken, vtoken, xPreventWebhook, preventWebhook); + return localVarResp.getData(); + } + + /** + * Verify one-touch login by Email + * Verifies the auto-login Email using a Verification Token. + * @param email Email address of the associated Account. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param verificationtoken Verification token received in the Email. (optional) + * @param vtoken Verification token received in the Email. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<IsPostedVerified> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedVerified> verifyAutoLoginEmailOneTouchWithHttpInfo(String email, String welcomeemailtemplate, String verificationtoken, String vtoken, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + okhttp3.Call localVarCall = verifyAutoLoginEmailOneTouchValidateBeforeCall(email, welcomeemailtemplate, verificationtoken, vtoken, xPreventWebhook, preventWebhook, null); + Type localVarReturnType = new TypeToken<IsPostedVerified>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Verify one-touch login by Email (asynchronously) + * Verifies the auto-login Email using a Verification Token. + * @param email Email address of the associated Account. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param verificationtoken Verification token received in the Email. (optional) + * @param vtoken Verification token received in the Email. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call verifyAutoLoginEmailOneTouchAsync(String email, String welcomeemailtemplate, String verificationtoken, String vtoken, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback<IsPostedVerified> _callback) throws ApiException { + + okhttp3.Call localVarCall = verifyAutoLoginEmailOneTouchValidateBeforeCall(email, welcomeemailtemplate, verificationtoken, vtoken, xPreventWebhook, preventWebhook, _callback); + Type localVarReturnType = new TypeToken<IsPostedVerified>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for verifyAutoLoginEmailSmartLogin + * @param verificationtoken Verification token received in the Email. (optional) + * @param vtoken Verification token received in the Email. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param email Email address of the associated Account. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call verifyAutoLoginEmailSmartLoginCall(String verificationtoken, String vtoken, String welcomeemailtemplate, String email, Boolean xPreventWebhook, Boolean preventWebhook, 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 = "/identity/v2/auth/email/smartlogin"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (verificationtoken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("verificationtoken", verificationtoken)); + } + + if (vtoken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("vtoken", vtoken)); + } + + if (welcomeemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("welcomeemailtemplate", welcomeemailtemplate)); + } + + if (email != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("email", email)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call verifyAutoLoginEmailSmartLoginValidateBeforeCall(String verificationtoken, String vtoken, String welcomeemailtemplate, String email, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback _callback) throws ApiException { + return verifyAutoLoginEmailSmartLoginCall(verificationtoken, vtoken, welcomeemailtemplate, email, xPreventWebhook, preventWebhook, _callback); + + } + + /** + * Verify smart login by Email + * Verifies the auto-login Email using a Verification Token. + * @param verificationtoken Verification token received in the Email. (optional) + * @param vtoken Verification token received in the Email. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param email Email address of the associated Account. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return IsPostedVerified + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public IsPostedVerified verifyAutoLoginEmailSmartLogin(String verificationtoken, String vtoken, String welcomeemailtemplate, String email, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + ApiResponse<IsPostedVerified> localVarResp = verifyAutoLoginEmailSmartLoginWithHttpInfo(verificationtoken, vtoken, welcomeemailtemplate, email, xPreventWebhook, preventWebhook); + return localVarResp.getData(); + } + + /** + * Verify smart login by Email + * Verifies the auto-login Email using a Verification Token. + * @param verificationtoken Verification token received in the Email. (optional) + * @param vtoken Verification token received in the Email. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param email Email address of the associated Account. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<IsPostedVerified> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedVerified> verifyAutoLoginEmailSmartLoginWithHttpInfo(String verificationtoken, String vtoken, String welcomeemailtemplate, String email, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + okhttp3.Call localVarCall = verifyAutoLoginEmailSmartLoginValidateBeforeCall(verificationtoken, vtoken, welcomeemailtemplate, email, xPreventWebhook, preventWebhook, null); + Type localVarReturnType = new TypeToken<IsPostedVerified>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Verify smart login by Email (asynchronously) + * Verifies the auto-login Email using a Verification Token. + * @param verificationtoken Verification token received in the Email. (optional) + * @param vtoken Verification token received in the Email. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param email Email address of the associated Account. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call verifyAutoLoginEmailSmartLoginAsync(String verificationtoken, String vtoken, String welcomeemailtemplate, String email, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback<IsPostedVerified> _callback) throws ApiException { + + okhttp3.Call localVarCall = verifyAutoLoginEmailSmartLoginValidateBeforeCall(verificationtoken, vtoken, welcomeemailtemplate, email, xPreventWebhook, preventWebhook, _callback); + Type localVarReturnType = new TypeToken<IsPostedVerified>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/MultipurposeTokensApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/MultipurposeTokensApi.java new file mode 100644 index 0000000..ab9e4e3 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/MultipurposeTokensApi.java @@ -0,0 +1,741 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.ForgotPasswordTokenAndEmailRequest; +import com.loginradius.sdk.internal.openapi.model.ForgotPasswordTokenModel; +import com.loginradius.sdk.internal.openapi.model.GenerateTokenResponse; +import com.loginradius.sdk.internal.openapi.model.MultipurposeEmailTokenAPIRequest; +import com.loginradius.sdk.internal.openapi.model.MultipurposeSmsOtpAPIRequest; +import com.loginradius.sdk.internal.openapi.model.VerificationLinkResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class MultipurposeTokensApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public MultipurposeTokensApi() { + this(Configuration.getDefaultApiClient()); + } + + public MultipurposeTokensApi(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 forgotPasswordTokenAndEmail + * @param forgotPasswordTokenAndEmailRequest (required) + * @param sendemail Indicates whether to send an Email with the forgot Password token. (optional) + * @param resetpasswordurl Callback URL for the Password Reset link in the Email. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Forgot Password token generated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call forgotPasswordTokenAndEmailCall(ForgotPasswordTokenAndEmailRequest forgotPasswordTokenAndEmailRequest, String sendemail, String resetpasswordurl, String emailtemplate, Boolean xPreventWebhook, Boolean preventWebhook, 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 = forgotPasswordTokenAndEmailRequest; + + // create path and map variables + String localVarPath = "/identity/v2/manage/account/forgot/token"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (sendemail != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sendemail", sendemail)); + } + + if (resetpasswordurl != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("resetpasswordurl", resetpasswordurl)); + } + + if (emailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailtemplate", emailtemplate)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call forgotPasswordTokenAndEmailValidateBeforeCall(ForgotPasswordTokenAndEmailRequest forgotPasswordTokenAndEmailRequest, String sendemail, String resetpasswordurl, String emailtemplate, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'forgotPasswordTokenAndEmailRequest' is set + if (forgotPasswordTokenAndEmailRequest == null) { + throw new ApiException("Missing the required parameter 'forgotPasswordTokenAndEmailRequest' when calling forgotPasswordTokenAndEmail(Async)"); + } + + return forgotPasswordTokenAndEmailCall(forgotPasswordTokenAndEmailRequest, sendemail, resetpasswordurl, emailtemplate, xPreventWebhook, preventWebhook, _callback); + + } + + /** + * Retrieve Forgot Password Token + * Generates a Forgot Password Token for the User and optionally sends an Email with the token. + * @param forgotPasswordTokenAndEmailRequest (required) + * @param sendemail Indicates whether to send an Email with the forgot Password token. (optional) + * @param resetpasswordurl Callback URL for the Password Reset link in the Email. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ForgotPasswordTokenModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Forgot Password token generated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public ForgotPasswordTokenModel forgotPasswordTokenAndEmail(ForgotPasswordTokenAndEmailRequest forgotPasswordTokenAndEmailRequest, String sendemail, String resetpasswordurl, String emailtemplate, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + ApiResponse<ForgotPasswordTokenModel> localVarResp = forgotPasswordTokenAndEmailWithHttpInfo(forgotPasswordTokenAndEmailRequest, sendemail, resetpasswordurl, emailtemplate, xPreventWebhook, preventWebhook); + return localVarResp.getData(); + } + + /** + * Retrieve Forgot Password Token + * Generates a Forgot Password Token for the User and optionally sends an Email with the token. + * @param forgotPasswordTokenAndEmailRequest (required) + * @param sendemail Indicates whether to send an Email with the forgot Password token. (optional) + * @param resetpasswordurl Callback URL for the Password Reset link in the Email. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<ForgotPasswordTokenModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Forgot Password token generated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public ApiResponse<ForgotPasswordTokenModel> forgotPasswordTokenAndEmailWithHttpInfo(ForgotPasswordTokenAndEmailRequest forgotPasswordTokenAndEmailRequest, String sendemail, String resetpasswordurl, String emailtemplate, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + okhttp3.Call localVarCall = forgotPasswordTokenAndEmailValidateBeforeCall(forgotPasswordTokenAndEmailRequest, sendemail, resetpasswordurl, emailtemplate, xPreventWebhook, preventWebhook, null); + Type localVarReturnType = new TypeToken<ForgotPasswordTokenModel>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Forgot Password Token (asynchronously) + * Generates a Forgot Password Token for the User and optionally sends an Email with the token. + * @param forgotPasswordTokenAndEmailRequest (required) + * @param sendemail Indicates whether to send an Email with the forgot Password token. (optional) + * @param resetpasswordurl Callback URL for the Password Reset link in the Email. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Forgot Password token generated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid or missing parameters. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized - The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call forgotPasswordTokenAndEmailAsync(ForgotPasswordTokenAndEmailRequest forgotPasswordTokenAndEmailRequest, String sendemail, String resetpasswordurl, String emailtemplate, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback<ForgotPasswordTokenModel> _callback) throws ApiException { + + okhttp3.Call localVarCall = forgotPasswordTokenAndEmailValidateBeforeCall(forgotPasswordTokenAndEmailRequest, sendemail, resetpasswordurl, emailtemplate, xPreventWebhook, preventWebhook, _callback); + Type localVarReturnType = new TypeToken<ForgotPasswordTokenModel>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getVerificationToken + * @param vtype The type of verification. Currently, only \"Email\" is supported. (required) + * @param email Email address of the associated Account. (optional) + * @param expiresIn (optional) + * @param sendemail Indicates whether to send an Email with the forgot Password token. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Verification token retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getVerificationTokenCall(String vtype, String email, String expiresIn, String sendemail, String verificationurl, String emailtemplate, 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 = "/identity/v2/manage/account/vtoken"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (email != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("email", email)); + } + + if (vtype != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("vtype", vtype)); + } + + if (expiresIn != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("expires_in", expiresIn)); + } + + if (sendemail != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sendemail", sendemail)); + } + + if (verificationurl != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("verificationurl", verificationurl)); + } + + if (emailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailtemplate", emailtemplate)); + } + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getVerificationTokenValidateBeforeCall(String vtype, String email, String expiresIn, String sendemail, String verificationurl, String emailtemplate, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'vtype' is set + if (vtype == null) { + throw new ApiException("Missing the required parameter 'vtype' when calling getVerificationToken(Async)"); + } + + return getVerificationTokenCall(vtype, email, expiresIn, sendemail, verificationurl, emailtemplate, _callback); + + } + + /** + * Retrieve Email Verification Token + * Retrieves an Email Verification Token for a specified Email. Optionally sends the verification Email to the User when sendemail is set to true. + * @param vtype The type of verification. Currently, only \"Email\" is supported. (required) + * @param email Email address of the associated Account. (optional) + * @param expiresIn (optional) + * @param sendemail Indicates whether to send an Email with the forgot Password token. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @return VerificationLinkResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Verification token retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public VerificationLinkResponse getVerificationToken(String vtype, String email, String expiresIn, String sendemail, String verificationurl, String emailtemplate) throws ApiException { + ApiResponse<VerificationLinkResponse> localVarResp = getVerificationTokenWithHttpInfo(vtype, email, expiresIn, sendemail, verificationurl, emailtemplate); + return localVarResp.getData(); + } + + /** + * Retrieve Email Verification Token + * Retrieves an Email Verification Token for a specified Email. Optionally sends the verification Email to the User when sendemail is set to true. + * @param vtype The type of verification. Currently, only \"Email\" is supported. (required) + * @param email Email address of the associated Account. (optional) + * @param expiresIn (optional) + * @param sendemail Indicates whether to send an Email with the forgot Password token. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @return ApiResponse<VerificationLinkResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Verification token retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<VerificationLinkResponse> getVerificationTokenWithHttpInfo(String vtype, String email, String expiresIn, String sendemail, String verificationurl, String emailtemplate) throws ApiException { + okhttp3.Call localVarCall = getVerificationTokenValidateBeforeCall(vtype, email, expiresIn, sendemail, verificationurl, emailtemplate, null); + Type localVarReturnType = new TypeToken<VerificationLinkResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Email Verification Token (asynchronously) + * Retrieves an Email Verification Token for a specified Email. Optionally sends the verification Email to the User when sendemail is set to true. + * @param vtype The type of verification. Currently, only \"Email\" is supported. (required) + * @param email Email address of the associated Account. (optional) + * @param expiresIn (optional) + * @param sendemail Indicates whether to send an Email with the forgot Password token. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Verification token retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getVerificationTokenAsync(String vtype, String email, String expiresIn, String sendemail, String verificationurl, String emailtemplate, final ApiCallback<VerificationLinkResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getVerificationTokenValidateBeforeCall(vtype, email, expiresIn, sendemail, verificationurl, emailtemplate, _callback); + Type localVarReturnType = new TypeToken<VerificationLinkResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for multipurposeEmailTokenAPI + * @param tokentype Token purpose: `emailverification`, `forgotpin`, `addemail`, `deleteuser`, `onetouchlogin`, or `autologin`. (required) + * @param multipurposeEmailTokenAPIRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call multipurposeEmailTokenAPICall(String tokentype, MultipurposeEmailTokenAPIRequest multipurposeEmailTokenAPIRequest, 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 = multipurposeEmailTokenAPIRequest; + + // create path and map variables + String localVarPath = "/identity/v2/manage/account/emailtoken/{tokentype}" + .replace("{" + "tokentype" + "}", localVarApiClient.escapeString(tokentype.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call multipurposeEmailTokenAPIValidateBeforeCall(String tokentype, MultipurposeEmailTokenAPIRequest multipurposeEmailTokenAPIRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'tokentype' is set + if (tokentype == null) { + throw new ApiException("Missing the required parameter 'tokentype' when calling multipurposeEmailTokenAPI(Async)"); + } + + // verify the required parameter 'multipurposeEmailTokenAPIRequest' is set + if (multipurposeEmailTokenAPIRequest == null) { + throw new ApiException("Missing the required parameter 'multipurposeEmailTokenAPIRequest' when calling multipurposeEmailTokenAPI(Async)"); + } + + return multipurposeEmailTokenAPICall(tokentype, multipurposeEmailTokenAPIRequest, _callback); + + } + + /** + * Retrieve Multipurpose Email Token + * Retrieves a multi-purpose Email token for verification, Password reset, and other Email-related actions. + * @param tokentype Token purpose: `emailverification`, `forgotpin`, `addemail`, `deleteuser`, `onetouchlogin`, or `autologin`. (required) + * @param multipurposeEmailTokenAPIRequest (required) + * @return GenerateTokenResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public GenerateTokenResponse multipurposeEmailTokenAPI(String tokentype, MultipurposeEmailTokenAPIRequest multipurposeEmailTokenAPIRequest) throws ApiException { + ApiResponse<GenerateTokenResponse> localVarResp = multipurposeEmailTokenAPIWithHttpInfo(tokentype, multipurposeEmailTokenAPIRequest); + return localVarResp.getData(); + } + + /** + * Retrieve Multipurpose Email Token + * Retrieves a multi-purpose Email token for verification, Password reset, and other Email-related actions. + * @param tokentype Token purpose: `emailverification`, `forgotpin`, `addemail`, `deleteuser`, `onetouchlogin`, or `autologin`. (required) + * @param multipurposeEmailTokenAPIRequest (required) + * @return ApiResponse<GenerateTokenResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GenerateTokenResponse> multipurposeEmailTokenAPIWithHttpInfo(String tokentype, MultipurposeEmailTokenAPIRequest multipurposeEmailTokenAPIRequest) throws ApiException { + okhttp3.Call localVarCall = multipurposeEmailTokenAPIValidateBeforeCall(tokentype, multipurposeEmailTokenAPIRequest, null); + Type localVarReturnType = new TypeToken<GenerateTokenResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Multipurpose Email Token (asynchronously) + * Retrieves a multi-purpose Email token for verification, Password reset, and other Email-related actions. + * @param tokentype Token purpose: `emailverification`, `forgotpin`, `addemail`, `deleteuser`, `onetouchlogin`, or `autologin`. (required) + * @param multipurposeEmailTokenAPIRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call multipurposeEmailTokenAPIAsync(String tokentype, MultipurposeEmailTokenAPIRequest multipurposeEmailTokenAPIRequest, final ApiCallback<GenerateTokenResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = multipurposeEmailTokenAPIValidateBeforeCall(tokentype, multipurposeEmailTokenAPIRequest, _callback); + Type localVarReturnType = new TypeToken<GenerateTokenResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for multipurposeSmsOtpAPI + * @param smsotptype OTP purpose: `addphone`, `phoneidverification`, `forgotpassword`, `forgotpin`, `onetouchlogin`, `smartlogin`, `passwordlesslogin`, or `deleteuser`. (required) + * @param multipurposeSmsOtpAPIRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call multipurposeSmsOtpAPICall(String smsotptype, MultipurposeSmsOtpAPIRequest multipurposeSmsOtpAPIRequest, 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 = multipurposeSmsOtpAPIRequest; + + // create path and map variables + String localVarPath = "/identity/v2/manage/account/smsotp/{smsotptype}" + .replace("{" + "smsotptype" + "}", localVarApiClient.escapeString(smsotptype.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call multipurposeSmsOtpAPIValidateBeforeCall(String smsotptype, MultipurposeSmsOtpAPIRequest multipurposeSmsOtpAPIRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'smsotptype' is set + if (smsotptype == null) { + throw new ApiException("Missing the required parameter 'smsotptype' when calling multipurposeSmsOtpAPI(Async)"); + } + + // verify the required parameter 'multipurposeSmsOtpAPIRequest' is set + if (multipurposeSmsOtpAPIRequest == null) { + throw new ApiException("Missing the required parameter 'multipurposeSmsOtpAPIRequest' when calling multipurposeSmsOtpAPI(Async)"); + } + + return multipurposeSmsOtpAPICall(smsotptype, multipurposeSmsOtpAPIRequest, _callback); + + } + + /** + * Multipurpose SMS OTP + * Generates an OTP for the User, applicable for adding a Phone, Phone ID verification, and other SMS-related actions. + * @param smsotptype OTP purpose: `addphone`, `phoneidverification`, `forgotpassword`, `forgotpin`, `onetouchlogin`, `smartlogin`, `passwordlesslogin`, or `deleteuser`. (required) + * @param multipurposeSmsOtpAPIRequest (required) + * @return GenerateTokenResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public GenerateTokenResponse multipurposeSmsOtpAPI(String smsotptype, MultipurposeSmsOtpAPIRequest multipurposeSmsOtpAPIRequest) throws ApiException { + ApiResponse<GenerateTokenResponse> localVarResp = multipurposeSmsOtpAPIWithHttpInfo(smsotptype, multipurposeSmsOtpAPIRequest); + return localVarResp.getData(); + } + + /** + * Multipurpose SMS OTP + * Generates an OTP for the User, applicable for adding a Phone, Phone ID verification, and other SMS-related actions. + * @param smsotptype OTP purpose: `addphone`, `phoneidverification`, `forgotpassword`, `forgotpin`, `onetouchlogin`, `smartlogin`, `passwordlesslogin`, or `deleteuser`. (required) + * @param multipurposeSmsOtpAPIRequest (required) + * @return ApiResponse<GenerateTokenResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GenerateTokenResponse> multipurposeSmsOtpAPIWithHttpInfo(String smsotptype, MultipurposeSmsOtpAPIRequest multipurposeSmsOtpAPIRequest) throws ApiException { + okhttp3.Call localVarCall = multipurposeSmsOtpAPIValidateBeforeCall(smsotptype, multipurposeSmsOtpAPIRequest, null); + Type localVarReturnType = new TypeToken<GenerateTokenResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Multipurpose SMS OTP (asynchronously) + * Generates an OTP for the User, applicable for adding a Phone, Phone ID verification, and other SMS-related actions. + * @param smsotptype OTP purpose: `addphone`, `phoneidverification`, `forgotpassword`, `forgotpin`, `onetouchlogin`, `smartlogin`, `passwordlesslogin`, or `deleteuser`. (required) + * @param multipurposeSmsOtpAPIRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call multipurposeSmsOtpAPIAsync(String smsotptype, MultipurposeSmsOtpAPIRequest multipurposeSmsOtpAPIRequest, final ApiCallback<GenerateTokenResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = multipurposeSmsOtpAPIValidateBeforeCall(smsotptype, multipurposeSmsOtpAPIRequest, _callback); + Type localVarReturnType = new TypeToken<GenerateTokenResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/OAuthApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/OAuthApi.java new file mode 100644 index 0000000..981e6aa --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/OAuthApi.java @@ -0,0 +1,961 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.GetOAuthTokensRequest; +import com.loginradius.sdk.internal.openapi.model.OAuthAuthorizationServerMetadata; +import com.loginradius.sdk.internal.openapi.model.OAuthDeviceCode; +import com.loginradius.sdk.internal.openapi.model.OAuthDeviceCodeResponse; +import com.loginradius.sdk.internal.openapi.model.OAuthErrorResponse; +import com.loginradius.sdk.internal.openapi.model.OAuthRevokeRefreshToken; +import com.loginradius.sdk.internal.openapi.model.OAuthTokenResponse; +import com.loginradius.sdk.internal.openapi.model.OIDCTokenIntrospectResponse; +import com.loginradius.sdk.internal.openapi.model.PARRequest; +import com.loginradius.sdk.internal.openapi.model.PARResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class OAuthApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public OAuthApi() { + this(Configuration.getDefaultApiClient()); + } + + public OAuthApi(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 getOAuthAuthorizationServerMetadataOAuth + * @param oauthAppName OAuth App Name (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOAuthAuthorizationServerMetadataOAuthCall(String oauthAppName, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://{TenantName}.hub.loginradius.com", "https://{CustomDomain}" }; + + // 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 = "/service/oauth/{OAuthAppName}/.well-known/oauth-authorization-server" + .replace("{" + "OAuthAppName" + "}", localVarApiClient.escapeString(oauthAppName.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOAuthAuthorizationServerMetadataOAuthValidateBeforeCall(String oauthAppName, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'oauthAppName' is set + if (oauthAppName == null) { + throw new ApiException("Missing the required parameter 'oauthAppName' when calling getOAuthAuthorizationServerMetadataOAuth(Async)"); + } + + return getOAuthAuthorizationServerMetadataOAuthCall(oauthAppName, _callback); + + } + + /** + * OAuth Authorization Server Metadata (OAuth app) + * Returns OAuth 2.0 Authorization Server Metadata (RFC 8414) for the given OAuth app. Use this endpoint for OAuth 2.0 client discovery when using the OAuth flow path. + * @param oauthAppName OAuth App Name (required) + * @return OAuthAuthorizationServerMetadata + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + </table> + */ + public OAuthAuthorizationServerMetadata getOAuthAuthorizationServerMetadataOAuth(String oauthAppName) throws ApiException { + ApiResponse<OAuthAuthorizationServerMetadata> localVarResp = getOAuthAuthorizationServerMetadataOAuthWithHttpInfo(oauthAppName); + return localVarResp.getData(); + } + + /** + * OAuth Authorization Server Metadata (OAuth app) + * Returns OAuth 2.0 Authorization Server Metadata (RFC 8414) for the given OAuth app. Use this endpoint for OAuth 2.0 client discovery when using the OAuth flow path. + * @param oauthAppName OAuth App Name (required) + * @return ApiResponse<OAuthAuthorizationServerMetadata> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + </table> + */ + public ApiResponse<OAuthAuthorizationServerMetadata> getOAuthAuthorizationServerMetadataOAuthWithHttpInfo(String oauthAppName) throws ApiException { + okhttp3.Call localVarCall = getOAuthAuthorizationServerMetadataOAuthValidateBeforeCall(oauthAppName, null); + Type localVarReturnType = new TypeToken<OAuthAuthorizationServerMetadata>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * OAuth Authorization Server Metadata (OAuth app) (asynchronously) + * Returns OAuth 2.0 Authorization Server Metadata (RFC 8414) for the given OAuth app. Use this endpoint for OAuth 2.0 client discovery when using the OAuth flow path. + * @param oauthAppName OAuth App Name (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOAuthAuthorizationServerMetadataOAuthAsync(String oauthAppName, final ApiCallback<OAuthAuthorizationServerMetadata> _callback) throws ApiException { + + okhttp3.Call localVarCall = getOAuthAuthorizationServerMetadataOAuthValidateBeforeCall(oauthAppName, _callback); + Type localVarReturnType = new TypeToken<OAuthAuthorizationServerMetadata>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getOAuthDeviceCode + * @param oauthAppName OAuth App Name (required) + * @param oauthDeviceCode (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOAuthDeviceCodeCall(String oauthAppName, OAuthDeviceCode oauthDeviceCode, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://{TenantName}.hub.loginradius.com", "https://{CustomDomain}" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = oauthDeviceCode; + + // create path and map variables + String localVarPath = "/api/oauth/{OAuthAppName}/device" + .replace("{" + "OAuthAppName" + "}", localVarApiClient.escapeString(oauthAppName.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "application/x-www-form-urlencoded" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOAuthDeviceCodeValidateBeforeCall(String oauthAppName, OAuthDeviceCode oauthDeviceCode, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'oauthAppName' is set + if (oauthAppName == null) { + throw new ApiException("Missing the required parameter 'oauthAppName' when calling getOAuthDeviceCode(Async)"); + } + + // verify the required parameter 'oauthDeviceCode' is set + if (oauthDeviceCode == null) { + throw new ApiException("Missing the required parameter 'oauthDeviceCode' when calling getOAuthDeviceCode(Async)"); + } + + return getOAuthDeviceCodeCall(oauthAppName, oauthDeviceCode, _callback); + + } + + /** + * Retrieve OAuth device code + * Initiates the OAuth 2.0 Device Authorization Grant per RFC 8628. Returns a device_code and user_code that the client displays to the end-user for out-of-band authorization on a secondary device. The client then polls the token endpoint with the device_code until the user completes authorization. + * @param oauthAppName OAuth App Name (required) + * @param oauthDeviceCode (required) + * @return OAuthDeviceCodeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public OAuthDeviceCodeResponse getOAuthDeviceCode(String oauthAppName, OAuthDeviceCode oauthDeviceCode) throws ApiException { + ApiResponse<OAuthDeviceCodeResponse> localVarResp = getOAuthDeviceCodeWithHttpInfo(oauthAppName, oauthDeviceCode); + return localVarResp.getData(); + } + + /** + * Retrieve OAuth device code + * Initiates the OAuth 2.0 Device Authorization Grant per RFC 8628. Returns a device_code and user_code that the client displays to the end-user for out-of-band authorization on a secondary device. The client then polls the token endpoint with the device_code until the user completes authorization. + * @param oauthAppName OAuth App Name (required) + * @param oauthDeviceCode (required) + * @return ApiResponse<OAuthDeviceCodeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<OAuthDeviceCodeResponse> getOAuthDeviceCodeWithHttpInfo(String oauthAppName, OAuthDeviceCode oauthDeviceCode) throws ApiException { + okhttp3.Call localVarCall = getOAuthDeviceCodeValidateBeforeCall(oauthAppName, oauthDeviceCode, null); + Type localVarReturnType = new TypeToken<OAuthDeviceCodeResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve OAuth device code (asynchronously) + * Initiates the OAuth 2.0 Device Authorization Grant per RFC 8628. Returns a device_code and user_code that the client displays to the end-user for out-of-band authorization on a secondary device. The client then polls the token endpoint with the device_code until the user completes authorization. + * @param oauthAppName OAuth App Name (required) + * @param oauthDeviceCode (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOAuthDeviceCodeAsync(String oauthAppName, OAuthDeviceCode oauthDeviceCode, final ApiCallback<OAuthDeviceCodeResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getOAuthDeviceCodeValidateBeforeCall(oauthAppName, oauthDeviceCode, _callback); + Type localVarReturnType = new TypeToken<OAuthDeviceCodeResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getOAuthTokens + * @param oauthAppName OAuth App Name (required) + * @param getOAuthTokensRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOAuthTokensCall(String oauthAppName, GetOAuthTokensRequest getOAuthTokensRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://{TenantName}.hub.loginradius.com", "https://{CustomDomain}" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getOAuthTokensRequest; + + // create path and map variables + String localVarPath = "/api/oauth/{OAuthAppName}/token" + .replace("{" + "OAuthAppName" + "}", localVarApiClient.escapeString(oauthAppName.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "application/x-www-form-urlencoded" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOAuthTokensValidateBeforeCall(String oauthAppName, GetOAuthTokensRequest getOAuthTokensRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'oauthAppName' is set + if (oauthAppName == null) { + throw new ApiException("Missing the required parameter 'oauthAppName' when calling getOAuthTokens(Async)"); + } + + // verify the required parameter 'getOAuthTokensRequest' is set + if (getOAuthTokensRequest == null) { + throw new ApiException("Missing the required parameter 'getOAuthTokensRequest' when calling getOAuthTokens(Async)"); + } + + return getOAuthTokensCall(oauthAppName, getOAuthTokensRequest, _callback); + + } + + /** + * Retrieve OAuth tokens + * Retrieves OAuth tokens for authentication and authorization purposes. + * @param oauthAppName OAuth App Name (required) + * @param getOAuthTokensRequest (required) + * @return OAuthTokenResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public OAuthTokenResponse getOAuthTokens(String oauthAppName, GetOAuthTokensRequest getOAuthTokensRequest) throws ApiException { + ApiResponse<OAuthTokenResponse> localVarResp = getOAuthTokensWithHttpInfo(oauthAppName, getOAuthTokensRequest); + return localVarResp.getData(); + } + + /** + * Retrieve OAuth tokens + * Retrieves OAuth tokens for authentication and authorization purposes. + * @param oauthAppName OAuth App Name (required) + * @param getOAuthTokensRequest (required) + * @return ApiResponse<OAuthTokenResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<OAuthTokenResponse> getOAuthTokensWithHttpInfo(String oauthAppName, GetOAuthTokensRequest getOAuthTokensRequest) throws ApiException { + okhttp3.Call localVarCall = getOAuthTokensValidateBeforeCall(oauthAppName, getOAuthTokensRequest, null); + Type localVarReturnType = new TypeToken<OAuthTokenResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve OAuth tokens (asynchronously) + * Retrieves OAuth tokens for authentication and authorization purposes. + * @param oauthAppName OAuth App Name (required) + * @param getOAuthTokensRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOAuthTokensAsync(String oauthAppName, GetOAuthTokensRequest getOAuthTokensRequest, final ApiCallback<OAuthTokenResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getOAuthTokensValidateBeforeCall(oauthAppName, getOAuthTokensRequest, _callback); + Type localVarReturnType = new TypeToken<OAuthTokenResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for introspectOAuthToken + * @param oauthAppName OAuth App Name (required) + * @param oauthRevokeRefreshToken (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: Introspection result (active true with claims, or active false). </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call introspectOAuthTokenCall(String oauthAppName, OAuthRevokeRefreshToken oauthRevokeRefreshToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://{TenantName}.hub.loginradius.com", "https://{CustomDomain}" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = oauthRevokeRefreshToken; + + // create path and map variables + String localVarPath = "/api/oauth/{OAuthAppName}/introspect" + .replace("{" + "OAuthAppName" + "}", localVarApiClient.escapeString(oauthAppName.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "application/x-www-form-urlencoded" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call introspectOAuthTokenValidateBeforeCall(String oauthAppName, OAuthRevokeRefreshToken oauthRevokeRefreshToken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'oauthAppName' is set + if (oauthAppName == null) { + throw new ApiException("Missing the required parameter 'oauthAppName' when calling introspectOAuthToken(Async)"); + } + + // verify the required parameter 'oauthRevokeRefreshToken' is set + if (oauthRevokeRefreshToken == null) { + throw new ApiException("Missing the required parameter 'oauthRevokeRefreshToken' when calling introspectOAuthToken(Async)"); + } + + return introspectOAuthTokenCall(oauthAppName, oauthRevokeRefreshToken, _callback); + + } + + /** + * Introspect OAuth token + * Returns the active state and metadata of an OAuth access or refresh token per RFC 7662 (OAuth 2.0 Token Introspection). The client must authenticate using either HTTP Basic authentication (Authorization: Basic base64(client_id:client_secret)) or by including client_id and client_secret in the POST body, depending on the token_endpoint_auth_method configured for the OAuth application. Returns active: true with associated claims for valid tokens, or active: false for invalid, expired, or revoked tokens. + * @param oauthAppName OAuth App Name (required) + * @param oauthRevokeRefreshToken (required) + * @return OIDCTokenIntrospectResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: Introspection result (active true with claims, or active false). </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public OIDCTokenIntrospectResponse introspectOAuthToken(String oauthAppName, OAuthRevokeRefreshToken oauthRevokeRefreshToken) throws ApiException { + ApiResponse<OIDCTokenIntrospectResponse> localVarResp = introspectOAuthTokenWithHttpInfo(oauthAppName, oauthRevokeRefreshToken); + return localVarResp.getData(); + } + + /** + * Introspect OAuth token + * Returns the active state and metadata of an OAuth access or refresh token per RFC 7662 (OAuth 2.0 Token Introspection). The client must authenticate using either HTTP Basic authentication (Authorization: Basic base64(client_id:client_secret)) or by including client_id and client_secret in the POST body, depending on the token_endpoint_auth_method configured for the OAuth application. Returns active: true with associated claims for valid tokens, or active: false for invalid, expired, or revoked tokens. + * @param oauthAppName OAuth App Name (required) + * @param oauthRevokeRefreshToken (required) + * @return ApiResponse<OIDCTokenIntrospectResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: Introspection result (active true with claims, or active false). </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<OIDCTokenIntrospectResponse> introspectOAuthTokenWithHttpInfo(String oauthAppName, OAuthRevokeRefreshToken oauthRevokeRefreshToken) throws ApiException { + okhttp3.Call localVarCall = introspectOAuthTokenValidateBeforeCall(oauthAppName, oauthRevokeRefreshToken, null); + Type localVarReturnType = new TypeToken<OIDCTokenIntrospectResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Introspect OAuth token (asynchronously) + * Returns the active state and metadata of an OAuth access or refresh token per RFC 7662 (OAuth 2.0 Token Introspection). The client must authenticate using either HTTP Basic authentication (Authorization: Basic base64(client_id:client_secret)) or by including client_id and client_secret in the POST body, depending on the token_endpoint_auth_method configured for the OAuth application. Returns active: true with associated claims for valid tokens, or active: false for invalid, expired, or revoked tokens. + * @param oauthAppName OAuth App Name (required) + * @param oauthRevokeRefreshToken (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: Introspection result (active true with claims, or active false). </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call introspectOAuthTokenAsync(String oauthAppName, OAuthRevokeRefreshToken oauthRevokeRefreshToken, final ApiCallback<OIDCTokenIntrospectResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = introspectOAuthTokenValidateBeforeCall(oauthAppName, oauthRevokeRefreshToken, _callback); + Type localVarReturnType = new TypeToken<OIDCTokenIntrospectResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for oAuthPushedAuthorizationRequest + * @param oauthAppName OAuth App Name (required) + * @param paRRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 201 </td><td> Created: PAR accepted. Use the returned request_uri as the sole parameter to the authorization endpoint within expires_in seconds. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: One or more request parameters are missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The application or client is not permitted to use this endpoint. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call oAuthPushedAuthorizationRequestCall(String oauthAppName, PARRequest paRRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://{TenantName}.hub.loginradius.com", "https://{CustomDomain}" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = paRRequest; + + // create path and map variables + String localVarPath = "/api/oauth/{OAuthAppName}/par" + .replace("{" + "OAuthAppName" + "}", localVarApiClient.escapeString(oauthAppName.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "application/x-www-form-urlencoded" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call oAuthPushedAuthorizationRequestValidateBeforeCall(String oauthAppName, PARRequest paRRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'oauthAppName' is set + if (oauthAppName == null) { + throw new ApiException("Missing the required parameter 'oauthAppName' when calling oAuthPushedAuthorizationRequest(Async)"); + } + + // verify the required parameter 'paRRequest' is set + if (paRRequest == null) { + throw new ApiException("Missing the required parameter 'paRRequest' when calling oAuthPushedAuthorizationRequest(Async)"); + } + + return oAuthPushedAuthorizationRequestCall(oauthAppName, paRRequest, _callback); + + } + + /** + * OAuth 2.0 Pushed Authorization Request (PAR) + * Accepts an OAuth 2.0 authorization request and stores it server-side per RFC 9126 (OAuth 2.0 Pushed Authorization Requests). Returns a short-lived request_uri that the client passes as the sole parameter to the authorization endpoint, keeping all sensitive request parameters out of the browser URL. This feature must be explicitly enabled on the OAuth application configuration. + * @param oauthAppName OAuth App Name (required) + * @param paRRequest (required) + * @return PARResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 201 </td><td> Created: PAR accepted. Use the returned request_uri as the sole parameter to the authorization endpoint within expires_in seconds. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: One or more request parameters are missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The application or client is not permitted to use this endpoint. </td><td> - </td></tr> + </table> + */ + public PARResponse oAuthPushedAuthorizationRequest(String oauthAppName, PARRequest paRRequest) throws ApiException { + ApiResponse<PARResponse> localVarResp = oAuthPushedAuthorizationRequestWithHttpInfo(oauthAppName, paRRequest); + return localVarResp.getData(); + } + + /** + * OAuth 2.0 Pushed Authorization Request (PAR) + * Accepts an OAuth 2.0 authorization request and stores it server-side per RFC 9126 (OAuth 2.0 Pushed Authorization Requests). Returns a short-lived request_uri that the client passes as the sole parameter to the authorization endpoint, keeping all sensitive request parameters out of the browser URL. This feature must be explicitly enabled on the OAuth application configuration. + * @param oauthAppName OAuth App Name (required) + * @param paRRequest (required) + * @return ApiResponse<PARResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 201 </td><td> Created: PAR accepted. Use the returned request_uri as the sole parameter to the authorization endpoint within expires_in seconds. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: One or more request parameters are missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The application or client is not permitted to use this endpoint. </td><td> - </td></tr> + </table> + */ + public ApiResponse<PARResponse> oAuthPushedAuthorizationRequestWithHttpInfo(String oauthAppName, PARRequest paRRequest) throws ApiException { + okhttp3.Call localVarCall = oAuthPushedAuthorizationRequestValidateBeforeCall(oauthAppName, paRRequest, null); + Type localVarReturnType = new TypeToken<PARResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * OAuth 2.0 Pushed Authorization Request (PAR) (asynchronously) + * Accepts an OAuth 2.0 authorization request and stores it server-side per RFC 9126 (OAuth 2.0 Pushed Authorization Requests). Returns a short-lived request_uri that the client passes as the sole parameter to the authorization endpoint, keeping all sensitive request parameters out of the browser URL. This feature must be explicitly enabled on the OAuth application configuration. + * @param oauthAppName OAuth App Name (required) + * @param paRRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 201 </td><td> Created: PAR accepted. Use the returned request_uri as the sole parameter to the authorization endpoint within expires_in seconds. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: One or more request parameters are missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The application or client is not permitted to use this endpoint. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call oAuthPushedAuthorizationRequestAsync(String oauthAppName, PARRequest paRRequest, final ApiCallback<PARResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = oAuthPushedAuthorizationRequestValidateBeforeCall(oauthAppName, paRRequest, _callback); + Type localVarReturnType = new TypeToken<PARResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for revokeOAuthRefreshToken + * @param oauthAppName OAuth App Name (required) + * @param oauthRevokeRefreshToken (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call revokeOAuthRefreshTokenCall(String oauthAppName, OAuthRevokeRefreshToken oauthRevokeRefreshToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://{TenantName}.hub.loginradius.com", "https://{CustomDomain}" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = oauthRevokeRefreshToken; + + // create path and map variables + String localVarPath = "/api/oauth/{OAuthAppName}/revoke" + .replace("{" + "OAuthAppName" + "}", localVarApiClient.escapeString(oauthAppName.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "application/x-www-form-urlencoded" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call revokeOAuthRefreshTokenValidateBeforeCall(String oauthAppName, OAuthRevokeRefreshToken oauthRevokeRefreshToken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'oauthAppName' is set + if (oauthAppName == null) { + throw new ApiException("Missing the required parameter 'oauthAppName' when calling revokeOAuthRefreshToken(Async)"); + } + + // verify the required parameter 'oauthRevokeRefreshToken' is set + if (oauthRevokeRefreshToken == null) { + throw new ApiException("Missing the required parameter 'oauthRevokeRefreshToken' when calling revokeOAuthRefreshToken(Async)"); + } + + return revokeOAuthRefreshTokenCall(oauthAppName, oauthRevokeRefreshToken, _callback); + + } + + /** + * Revoke OAuth refresh token + * Revokes an OAuth refresh token per RFC 7009 (OAuth 2.0 Token Revocation), invalidating it and preventing any further use. The client must authenticate using client_id and client_secret via HTTP Basic or POST body. + * @param oauthAppName OAuth App Name (required) + * @param oauthRevokeRefreshToken (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public void revokeOAuthRefreshToken(String oauthAppName, OAuthRevokeRefreshToken oauthRevokeRefreshToken) throws ApiException { + revokeOAuthRefreshTokenWithHttpInfo(oauthAppName, oauthRevokeRefreshToken); + } + + /** + * Revoke OAuth refresh token + * Revokes an OAuth refresh token per RFC 7009 (OAuth 2.0 Token Revocation), invalidating it and preventing any further use. The client must authenticate using client_id and client_secret via HTTP Basic or POST body. + * @param oauthAppName OAuth App Name (required) + * @param oauthRevokeRefreshToken (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<Void> revokeOAuthRefreshTokenWithHttpInfo(String oauthAppName, OAuthRevokeRefreshToken oauthRevokeRefreshToken) throws ApiException { + okhttp3.Call localVarCall = revokeOAuthRefreshTokenValidateBeforeCall(oauthAppName, oauthRevokeRefreshToken, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Revoke OAuth refresh token (asynchronously) + * Revokes an OAuth refresh token per RFC 7009 (OAuth 2.0 Token Revocation), invalidating it and preventing any further use. The client must authenticate using client_id and client_secret via HTTP Basic or POST body. + * @param oauthAppName OAuth App Name (required) + * @param oauthRevokeRefreshToken (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call revokeOAuthRefreshTokenAsync(String oauthAppName, OAuthRevokeRefreshToken oauthRevokeRefreshToken, final ApiCallback<Void> _callback) throws ApiException { + + okhttp3.Call localVarCall = revokeOAuthRefreshTokenValidateBeforeCall(oauthAppName, oauthRevokeRefreshToken, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/OAuthClientsApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/OAuthClientsApi.java new file mode 100644 index 0000000..686491e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/OAuthClientsApi.java @@ -0,0 +1,1045 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.CreateOAuthClientConfigurationRequest; +import com.loginradius.sdk.internal.openapi.model.DeleteResponse; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.GetAllOAuthClientsConfigurations200Response; +import com.loginradius.sdk.internal.openapi.model.GetOAuthClientConnectionsMetadata200Response; +import com.loginradius.sdk.internal.openapi.model.OAuthClientRequest; +import com.loginradius.sdk.internal.openapi.model.OAuthClientResponse; +import com.loginradius.sdk.internal.openapi.model.OAuthClientSecretResetResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class OAuthClientsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public OAuthClientsApi() { + this(Configuration.getDefaultApiClient()); + } + + public OAuthClientsApi(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 createOAuthClientConfiguration + * @param createOAuthClientConfigurationRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Status Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createOAuthClientConfigurationCall(CreateOAuthClientConfigurationRequest createOAuthClientConfigurationRequest, 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 = createOAuthClientConfigurationRequest; + + // create path and map variables + String localVarPath = "/v2/manage/oauth-clients"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createOAuthClientConfigurationValidateBeforeCall(CreateOAuthClientConfigurationRequest createOAuthClientConfigurationRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'createOAuthClientConfigurationRequest' is set + if (createOAuthClientConfigurationRequest == null) { + throw new ApiException("Missing the required parameter 'createOAuthClientConfigurationRequest' when calling createOAuthClientConfiguration(Async)"); + } + + return createOAuthClientConfigurationCall(createOAuthClientConfigurationRequest, _callback); + + } + + /** + * Create OAuth client + * Creates a new OAuth client configuration for the Tenant by specifying redirect URIs, scopes, and other necessary settings to enable OAuth authentication and authorization. + * @param createOAuthClientConfigurationRequest (required) + * @return OAuthClientResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Status Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public OAuthClientResponse createOAuthClientConfiguration(CreateOAuthClientConfigurationRequest createOAuthClientConfigurationRequest) throws ApiException { + ApiResponse<OAuthClientResponse> localVarResp = createOAuthClientConfigurationWithHttpInfo(createOAuthClientConfigurationRequest); + return localVarResp.getData(); + } + + /** + * Create OAuth client + * Creates a new OAuth client configuration for the Tenant by specifying redirect URIs, scopes, and other necessary settings to enable OAuth authentication and authorization. + * @param createOAuthClientConfigurationRequest (required) + * @return ApiResponse<OAuthClientResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Status Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<OAuthClientResponse> createOAuthClientConfigurationWithHttpInfo(CreateOAuthClientConfigurationRequest createOAuthClientConfigurationRequest) throws ApiException { + okhttp3.Call localVarCall = createOAuthClientConfigurationValidateBeforeCall(createOAuthClientConfigurationRequest, null); + Type localVarReturnType = new TypeToken<OAuthClientResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create OAuth client (asynchronously) + * Creates a new OAuth client configuration for the Tenant by specifying redirect URIs, scopes, and other necessary settings to enable OAuth authentication and authorization. + * @param createOAuthClientConfigurationRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Status Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createOAuthClientConfigurationAsync(CreateOAuthClientConfigurationRequest createOAuthClientConfigurationRequest, final ApiCallback<OAuthClientResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = createOAuthClientConfigurationValidateBeforeCall(createOAuthClientConfigurationRequest, _callback); + Type localVarReturnType = new TypeToken<OAuthClientResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteOAuthClient + * @param oAuthClientName Name of the OAuth Client (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteOAuthClientCall(String oAuthClientName, 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 = "/v2/manage/oauth-clients/{oAuthClientName}" + .replace("{" + "oAuthClientName" + "}", localVarApiClient.escapeString(oAuthClientName.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteOAuthClientValidateBeforeCall(String oAuthClientName, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'oAuthClientName' is set + if (oAuthClientName == null) { + throw new ApiException("Missing the required parameter 'oAuthClientName' when calling deleteOAuthClient(Async)"); + } + + return deleteOAuthClientCall(oAuthClientName, _callback); + + } + + /** + * Delete OAuth Client Configuration + * Deletes the OAuth client configuration for the Tenant identified by the application name. + * @param oAuthClientName Name of the OAuth Client (required) + * @return DeleteResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public DeleteResponse deleteOAuthClient(String oAuthClientName) throws ApiException { + ApiResponse<DeleteResponse> localVarResp = deleteOAuthClientWithHttpInfo(oAuthClientName); + return localVarResp.getData(); + } + + /** + * Delete OAuth Client Configuration + * Deletes the OAuth client configuration for the Tenant identified by the application name. + * @param oAuthClientName Name of the OAuth Client (required) + * @return ApiResponse<DeleteResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DeleteResponse> deleteOAuthClientWithHttpInfo(String oAuthClientName) throws ApiException { + okhttp3.Call localVarCall = deleteOAuthClientValidateBeforeCall(oAuthClientName, null); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete OAuth Client Configuration (asynchronously) + * Deletes the OAuth client configuration for the Tenant identified by the application name. + * @param oAuthClientName Name of the OAuth Client (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteOAuthClientAsync(String oAuthClientName, final ApiCallback<DeleteResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteOAuthClientValidateBeforeCall(oAuthClientName, _callback); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAllOAuthClientsConfigurations + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllOAuthClientsConfigurationsCall(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 = "/v2/manage/oauth-clients"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAllOAuthClientsConfigurationsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getAllOAuthClientsConfigurationsCall(_callback); + + } + + /** + * List OAuth clients + * Retrieves a comprehensive list of OAuth client configurations for the Tenant, including client IDs, redirect URIs, scopes, and other relevant settings. + * @return GetAllOAuthClientsConfigurations200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public GetAllOAuthClientsConfigurations200Response getAllOAuthClientsConfigurations() throws ApiException { + ApiResponse<GetAllOAuthClientsConfigurations200Response> localVarResp = getAllOAuthClientsConfigurationsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List OAuth clients + * Retrieves a comprehensive list of OAuth client configurations for the Tenant, including client IDs, redirect URIs, scopes, and other relevant settings. + * @return ApiResponse<GetAllOAuthClientsConfigurations200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetAllOAuthClientsConfigurations200Response> getAllOAuthClientsConfigurationsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getAllOAuthClientsConfigurationsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<GetAllOAuthClientsConfigurations200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List OAuth clients (asynchronously) + * Retrieves a comprehensive list of OAuth client configurations for the Tenant, including client IDs, redirect URIs, scopes, and other relevant settings. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllOAuthClientsConfigurationsAsync(final ApiCallback<GetAllOAuthClientsConfigurations200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getAllOAuthClientsConfigurationsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<GetAllOAuthClientsConfigurations200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getOAuthClientConfigurationByAppName + * @param oAuthClientName Name of the OAuth Client (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOAuthClientConfigurationByAppNameCall(String oAuthClientName, 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 = "/v2/manage/oauth-clients/{oAuthClientName}" + .replace("{" + "oAuthClientName" + "}", localVarApiClient.escapeString(oAuthClientName.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOAuthClientConfigurationByAppNameValidateBeforeCall(String oAuthClientName, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'oAuthClientName' is set + if (oAuthClientName == null) { + throw new ApiException("Missing the required parameter 'oAuthClientName' when calling getOAuthClientConfigurationByAppName(Async)"); + } + + return getOAuthClientConfigurationByAppNameCall(oAuthClientName, _callback); + + } + + /** + * Retrieve OAuth Client Configuration + * Retrieves the OAuth client configuration details for the Tenant using the application name. + * @param oAuthClientName Name of the OAuth Client (required) + * @return OAuthClientResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public OAuthClientResponse getOAuthClientConfigurationByAppName(String oAuthClientName) throws ApiException { + ApiResponse<OAuthClientResponse> localVarResp = getOAuthClientConfigurationByAppNameWithHttpInfo(oAuthClientName); + return localVarResp.getData(); + } + + /** + * Retrieve OAuth Client Configuration + * Retrieves the OAuth client configuration details for the Tenant using the application name. + * @param oAuthClientName Name of the OAuth Client (required) + * @return ApiResponse<OAuthClientResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<OAuthClientResponse> getOAuthClientConfigurationByAppNameWithHttpInfo(String oAuthClientName) throws ApiException { + okhttp3.Call localVarCall = getOAuthClientConfigurationByAppNameValidateBeforeCall(oAuthClientName, null); + Type localVarReturnType = new TypeToken<OAuthClientResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve OAuth Client Configuration (asynchronously) + * Retrieves the OAuth client configuration details for the Tenant using the application name. + * @param oAuthClientName Name of the OAuth Client (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOAuthClientConfigurationByAppNameAsync(String oAuthClientName, final ApiCallback<OAuthClientResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getOAuthClientConfigurationByAppNameValidateBeforeCall(oAuthClientName, _callback); + Type localVarReturnType = new TypeToken<OAuthClientResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getOAuthClientConnectionsMetadata + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOAuthClientConnectionsMetadataCall(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 = "/v2/manage/oauth-clients/connections-metadata"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOAuthClientConnectionsMetadataValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getOAuthClientConnectionsMetadataCall(_callback); + + } + + /** + * Retrieve OAuth Client Metadata + * Retrieves metadata for OAuth client connections within the Tenant. + * @return GetOAuthClientConnectionsMetadata200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public GetOAuthClientConnectionsMetadata200Response getOAuthClientConnectionsMetadata() throws ApiException { + ApiResponse<GetOAuthClientConnectionsMetadata200Response> localVarResp = getOAuthClientConnectionsMetadataWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Retrieve OAuth Client Metadata + * Retrieves metadata for OAuth client connections within the Tenant. + * @return ApiResponse<GetOAuthClientConnectionsMetadata200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetOAuthClientConnectionsMetadata200Response> getOAuthClientConnectionsMetadataWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getOAuthClientConnectionsMetadataValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<GetOAuthClientConnectionsMetadata200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve OAuth Client Metadata (asynchronously) + * Retrieves metadata for OAuth client connections within the Tenant. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOAuthClientConnectionsMetadataAsync(final ApiCallback<GetOAuthClientConnectionsMetadata200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getOAuthClientConnectionsMetadataValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<GetOAuthClientConnectionsMetadata200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for resetOAuthClientConfigurationSecretByAppName + * @param oAuthClientName Name of the OAuth Client (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetOAuthClientConfigurationSecretByAppNameCall(String oAuthClientName, 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 = "/v2/manage/oauth-clients/credentials/{oAuthClientName}" + .replace("{" + "oAuthClientName" + "}", localVarApiClient.escapeString(oAuthClientName.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call resetOAuthClientConfigurationSecretByAppNameValidateBeforeCall(String oAuthClientName, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'oAuthClientName' is set + if (oAuthClientName == null) { + throw new ApiException("Missing the required parameter 'oAuthClientName' when calling resetOAuthClientConfigurationSecretByAppName(Async)"); + } + + return resetOAuthClientConfigurationSecretByAppNameCall(oAuthClientName, _callback); + + } + + /** + * Reset OAuth client secret + * Resets the client secret for the OAuth client configuration identified by the AppName within the Tenant, generating a new client secret and invalidating the previous one to enhance security. + * @param oAuthClientName Name of the OAuth Client (required) + * @return OAuthClientSecretResetResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public OAuthClientSecretResetResponse resetOAuthClientConfigurationSecretByAppName(String oAuthClientName) throws ApiException { + ApiResponse<OAuthClientSecretResetResponse> localVarResp = resetOAuthClientConfigurationSecretByAppNameWithHttpInfo(oAuthClientName); + return localVarResp.getData(); + } + + /** + * Reset OAuth client secret + * Resets the client secret for the OAuth client configuration identified by the AppName within the Tenant, generating a new client secret and invalidating the previous one to enhance security. + * @param oAuthClientName Name of the OAuth Client (required) + * @return ApiResponse<OAuthClientSecretResetResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<OAuthClientSecretResetResponse> resetOAuthClientConfigurationSecretByAppNameWithHttpInfo(String oAuthClientName) throws ApiException { + okhttp3.Call localVarCall = resetOAuthClientConfigurationSecretByAppNameValidateBeforeCall(oAuthClientName, null); + Type localVarReturnType = new TypeToken<OAuthClientSecretResetResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Reset OAuth client secret (asynchronously) + * Resets the client secret for the OAuth client configuration identified by the AppName within the Tenant, generating a new client secret and invalidating the previous one to enhance security. + * @param oAuthClientName Name of the OAuth Client (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetOAuthClientConfigurationSecretByAppNameAsync(String oAuthClientName, final ApiCallback<OAuthClientSecretResetResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = resetOAuthClientConfigurationSecretByAppNameValidateBeforeCall(oAuthClientName, _callback); + Type localVarReturnType = new TypeToken<OAuthClientSecretResetResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateOAuthClientConfigurationByAppName + * @param oAuthClientName Name of the OAuth Client (required) + * @param oauthClientRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateOAuthClientConfigurationByAppNameCall(String oAuthClientName, OAuthClientRequest oauthClientRequest, 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 = oauthClientRequest; + + // create path and map variables + String localVarPath = "/v2/manage/oauth-clients/{oAuthClientName}" + .replace("{" + "oAuthClientName" + "}", localVarApiClient.escapeString(oAuthClientName.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateOAuthClientConfigurationByAppNameValidateBeforeCall(String oAuthClientName, OAuthClientRequest oauthClientRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'oAuthClientName' is set + if (oAuthClientName == null) { + throw new ApiException("Missing the required parameter 'oAuthClientName' when calling updateOAuthClientConfigurationByAppName(Async)"); + } + + // verify the required parameter 'oauthClientRequest' is set + if (oauthClientRequest == null) { + throw new ApiException("Missing the required parameter 'oauthClientRequest' when calling updateOAuthClientConfigurationByAppName(Async)"); + } + + return updateOAuthClientConfigurationByAppNameCall(oAuthClientName, oauthClientRequest, _callback); + + } + + /** + * Update OAuth Client Configuration + * Updates the OAuth client configuration for the Tenant identified by the application name. + * @param oAuthClientName Name of the OAuth Client (required) + * @param oauthClientRequest (required) + * @return OAuthClientResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public OAuthClientResponse updateOAuthClientConfigurationByAppName(String oAuthClientName, OAuthClientRequest oauthClientRequest) throws ApiException { + ApiResponse<OAuthClientResponse> localVarResp = updateOAuthClientConfigurationByAppNameWithHttpInfo(oAuthClientName, oauthClientRequest); + return localVarResp.getData(); + } + + /** + * Update OAuth Client Configuration + * Updates the OAuth client configuration for the Tenant identified by the application name. + * @param oAuthClientName Name of the OAuth Client (required) + * @param oauthClientRequest (required) + * @return ApiResponse<OAuthClientResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<OAuthClientResponse> updateOAuthClientConfigurationByAppNameWithHttpInfo(String oAuthClientName, OAuthClientRequest oauthClientRequest) throws ApiException { + okhttp3.Call localVarCall = updateOAuthClientConfigurationByAppNameValidateBeforeCall(oAuthClientName, oauthClientRequest, null); + Type localVarReturnType = new TypeToken<OAuthClientResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update OAuth Client Configuration (asynchronously) + * Updates the OAuth client configuration for the Tenant identified by the application name. + * @param oAuthClientName Name of the OAuth Client (required) + * @param oauthClientRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateOAuthClientConfigurationByAppNameAsync(String oAuthClientName, OAuthClientRequest oauthClientRequest, final ApiCallback<OAuthClientResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateOAuthClientConfigurationByAppNameValidateBeforeCall(oAuthClientName, oauthClientRequest, _callback); + Type localVarReturnType = new TypeToken<OAuthClientResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/OAuthCustomProvidersApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/OAuthCustomProvidersApi.java new file mode 100644 index 0000000..32f5027 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/OAuthCustomProvidersApi.java @@ -0,0 +1,773 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.CustomOAuth2DeleteModel; +import com.loginradius.sdk.internal.openapi.model.CustomOAuth2Model; +import com.loginradius.sdk.internal.openapi.model.CustomOAuth2UpdateModel; +import com.loginradius.sdk.internal.openapi.model.DeleteResponse; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.GetAllCustomOAuthProviders200Response; +import com.loginradius.sdk.internal.openapi.model.GetCustomProviderKeys200Response; +import com.loginradius.sdk.internal.openapi.model.OAuth2Provider; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class OAuthCustomProvidersApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public OAuthCustomProvidersApi() { + this(Configuration.getDefaultApiClient()); + } + + public OAuthCustomProvidersApi(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 createCustomProvider + * @param customOAuth2Model (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createCustomProviderCall(CustomOAuth2Model customOAuth2Model, 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 = customOAuth2Model; + + // create path and map variables + String localVarPath = "/v2/manage/custom-providers/oauth"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createCustomProviderValidateBeforeCall(CustomOAuth2Model customOAuth2Model, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'customOAuth2Model' is set + if (customOAuth2Model == null) { + throw new ApiException("Missing the required parameter 'customOAuth2Model' when calling createCustomProvider(Async)"); + } + + return createCustomProviderCall(customOAuth2Model, _callback); + + } + + /** + * Create custom OAuth provider + * Creates a new Custom OAuth provider for the Tenant. + * @param customOAuth2Model (required) + * @return OAuth2Provider + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public OAuth2Provider createCustomProvider(CustomOAuth2Model customOAuth2Model) throws ApiException { + ApiResponse<OAuth2Provider> localVarResp = createCustomProviderWithHttpInfo(customOAuth2Model); + return localVarResp.getData(); + } + + /** + * Create custom OAuth provider + * Creates a new Custom OAuth provider for the Tenant. + * @param customOAuth2Model (required) + * @return ApiResponse<OAuth2Provider> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<OAuth2Provider> createCustomProviderWithHttpInfo(CustomOAuth2Model customOAuth2Model) throws ApiException { + okhttp3.Call localVarCall = createCustomProviderValidateBeforeCall(customOAuth2Model, null); + Type localVarReturnType = new TypeToken<OAuth2Provider>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create custom OAuth provider (asynchronously) + * Creates a new Custom OAuth provider for the Tenant. + * @param customOAuth2Model (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createCustomProviderAsync(CustomOAuth2Model customOAuth2Model, final ApiCallback<OAuth2Provider> _callback) throws ApiException { + + okhttp3.Call localVarCall = createCustomProviderValidateBeforeCall(customOAuth2Model, _callback); + Type localVarReturnType = new TypeToken<OAuth2Provider>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteCustomProvider + * @param customOAuth2DeleteModel (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteCustomProviderCall(CustomOAuth2DeleteModel customOAuth2DeleteModel, 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 = customOAuth2DeleteModel; + + // create path and map variables + String localVarPath = "/v2/manage/custom-providers/oauth"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteCustomProviderValidateBeforeCall(CustomOAuth2DeleteModel customOAuth2DeleteModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'customOAuth2DeleteModel' is set + if (customOAuth2DeleteModel == null) { + throw new ApiException("Missing the required parameter 'customOAuth2DeleteModel' when calling deleteCustomProvider(Async)"); + } + + return deleteCustomProviderCall(customOAuth2DeleteModel, _callback); + + } + + /** + * Delete custom OAuth provider + * Deletes an existing Custom OAuth provider for the Tenant using the provider name specified in the request body. + * @param customOAuth2DeleteModel (required) + * @return DeleteResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public DeleteResponse deleteCustomProvider(CustomOAuth2DeleteModel customOAuth2DeleteModel) throws ApiException { + ApiResponse<DeleteResponse> localVarResp = deleteCustomProviderWithHttpInfo(customOAuth2DeleteModel); + return localVarResp.getData(); + } + + /** + * Delete custom OAuth provider + * Deletes an existing Custom OAuth provider for the Tenant using the provider name specified in the request body. + * @param customOAuth2DeleteModel (required) + * @return ApiResponse<DeleteResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DeleteResponse> deleteCustomProviderWithHttpInfo(CustomOAuth2DeleteModel customOAuth2DeleteModel) throws ApiException { + okhttp3.Call localVarCall = deleteCustomProviderValidateBeforeCall(customOAuth2DeleteModel, null); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete custom OAuth provider (asynchronously) + * Deletes an existing Custom OAuth provider for the Tenant using the provider name specified in the request body. + * @param customOAuth2DeleteModel (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteCustomProviderAsync(CustomOAuth2DeleteModel customOAuth2DeleteModel, final ApiCallback<DeleteResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteCustomProviderValidateBeforeCall(customOAuth2DeleteModel, _callback); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAllCustomOAuthProviders + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllCustomOAuthProvidersCall(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 = "/v2/manage/custom-providers/oauth"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAllCustomOAuthProvidersValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getAllCustomOAuthProvidersCall(_callback); + + } + + /** + * List custom OAuth providers + * Retrieves all custom OAuth providers configured for the Tenant. + * @return GetAllCustomOAuthProviders200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public GetAllCustomOAuthProviders200Response getAllCustomOAuthProviders() throws ApiException { + ApiResponse<GetAllCustomOAuthProviders200Response> localVarResp = getAllCustomOAuthProvidersWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List custom OAuth providers + * Retrieves all custom OAuth providers configured for the Tenant. + * @return ApiResponse<GetAllCustomOAuthProviders200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetAllCustomOAuthProviders200Response> getAllCustomOAuthProvidersWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getAllCustomOAuthProvidersValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<GetAllCustomOAuthProviders200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List custom OAuth providers (asynchronously) + * Retrieves all custom OAuth providers configured for the Tenant. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllCustomOAuthProvidersAsync(final ApiCallback<GetAllCustomOAuthProviders200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getAllCustomOAuthProvidersValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<GetAllCustomOAuthProviders200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getCustomProviderKeys + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getCustomProviderKeysCall(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 = "/v2/manage/custom-providers/oauth/keys"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getCustomProviderKeysValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getCustomProviderKeysCall(_callback); + + } + + /** + * Retrieve custom OAuth provider keys + * Retrieves all custom OAuth provider keys for the Tenant. + * @return GetCustomProviderKeys200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public GetCustomProviderKeys200Response getCustomProviderKeys() throws ApiException { + ApiResponse<GetCustomProviderKeys200Response> localVarResp = getCustomProviderKeysWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Retrieve custom OAuth provider keys + * Retrieves all custom OAuth provider keys for the Tenant. + * @return ApiResponse<GetCustomProviderKeys200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetCustomProviderKeys200Response> getCustomProviderKeysWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getCustomProviderKeysValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<GetCustomProviderKeys200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve custom OAuth provider keys (asynchronously) + * Retrieves all custom OAuth provider keys for the Tenant. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getCustomProviderKeysAsync(final ApiCallback<GetCustomProviderKeys200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getCustomProviderKeysValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<GetCustomProviderKeys200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateCustomProvider + * @param customOAuth2UpdateModel (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateCustomProviderCall(CustomOAuth2UpdateModel customOAuth2UpdateModel, 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 = customOAuth2UpdateModel; + + // create path and map variables + String localVarPath = "/v2/manage/custom-providers/oauth"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateCustomProviderValidateBeforeCall(CustomOAuth2UpdateModel customOAuth2UpdateModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'customOAuth2UpdateModel' is set + if (customOAuth2UpdateModel == null) { + throw new ApiException("Missing the required parameter 'customOAuth2UpdateModel' when calling updateCustomProvider(Async)"); + } + + return updateCustomProviderCall(customOAuth2UpdateModel, _callback); + + } + + /** + * Update custom OAuth provider + * Updates an existing Custom OAuth provider for the Tenant using the provider name specified in the request body. + * @param customOAuth2UpdateModel (required) + * @return OAuth2Provider + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public OAuth2Provider updateCustomProvider(CustomOAuth2UpdateModel customOAuth2UpdateModel) throws ApiException { + ApiResponse<OAuth2Provider> localVarResp = updateCustomProviderWithHttpInfo(customOAuth2UpdateModel); + return localVarResp.getData(); + } + + /** + * Update custom OAuth provider + * Updates an existing Custom OAuth provider for the Tenant using the provider name specified in the request body. + * @param customOAuth2UpdateModel (required) + * @return ApiResponse<OAuth2Provider> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<OAuth2Provider> updateCustomProviderWithHttpInfo(CustomOAuth2UpdateModel customOAuth2UpdateModel) throws ApiException { + okhttp3.Call localVarCall = updateCustomProviderValidateBeforeCall(customOAuth2UpdateModel, null); + Type localVarReturnType = new TypeToken<OAuth2Provider>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update custom OAuth provider (asynchronously) + * Updates an existing Custom OAuth provider for the Tenant using the provider name specified in the request body. + * @param customOAuth2UpdateModel (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateCustomProviderAsync(CustomOAuth2UpdateModel customOAuth2UpdateModel, final ApiCallback<OAuth2Provider> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateCustomProviderValidateBeforeCall(customOAuth2UpdateModel, _callback); + Type localVarReturnType = new TypeToken<OAuth2Provider>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/OAuthIntegrationsApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/OAuthIntegrationsApi.java new file mode 100644 index 0000000..624f097 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/OAuthIntegrationsApi.java @@ -0,0 +1,915 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.CreateOAuthIntegrationRequest; +import com.loginradius.sdk.internal.openapi.model.DeleteResponse; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.GetAllOAuthIntegrations200Response; +import com.loginradius.sdk.internal.openapi.model.OAuthIntegrationBaseModel; +import com.loginradius.sdk.internal.openapi.model.OAuthIntegrationCredentialsResponse; +import com.loginradius.sdk.internal.openapi.model.OAuthIntegrationResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class OAuthIntegrationsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public OAuthIntegrationsApi() { + this(Configuration.getDefaultApiClient()); + } + + public OAuthIntegrationsApi(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 createOAuthIntegration + * @param createOAuthIntegrationRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createOAuthIntegrationCall(CreateOAuthIntegrationRequest createOAuthIntegrationRequest, 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 = createOAuthIntegrationRequest; + + // create path and map variables + String localVarPath = "/v2/manage/integrations/oauth"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createOAuthIntegrationValidateBeforeCall(CreateOAuthIntegrationRequest createOAuthIntegrationRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'createOAuthIntegrationRequest' is set + if (createOAuthIntegrationRequest == null) { + throw new ApiException("Missing the required parameter 'createOAuthIntegrationRequest' when calling createOAuthIntegration(Async)"); + } + + return createOAuthIntegrationCall(createOAuthIntegrationRequest, _callback); + + } + + /** + * Create OAuth Integration + * Creates a new OAuth/OIDC integration configuration for the Tenant. The response returns the integration's identifier (Id), which is also the {oAuthApp} segment of the runtime OAuth/OIDC endpoints. Only the authorization_code and refresh_token grant types are permitted. + * @param createOAuthIntegrationRequest (required) + * @return OAuthIntegrationResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public OAuthIntegrationResponse createOAuthIntegration(CreateOAuthIntegrationRequest createOAuthIntegrationRequest) throws ApiException { + ApiResponse<OAuthIntegrationResponse> localVarResp = createOAuthIntegrationWithHttpInfo(createOAuthIntegrationRequest); + return localVarResp.getData(); + } + + /** + * Create OAuth Integration + * Creates a new OAuth/OIDC integration configuration for the Tenant. The response returns the integration's identifier (Id), which is also the {oAuthApp} segment of the runtime OAuth/OIDC endpoints. Only the authorization_code and refresh_token grant types are permitted. + * @param createOAuthIntegrationRequest (required) + * @return ApiResponse<OAuthIntegrationResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<OAuthIntegrationResponse> createOAuthIntegrationWithHttpInfo(CreateOAuthIntegrationRequest createOAuthIntegrationRequest) throws ApiException { + okhttp3.Call localVarCall = createOAuthIntegrationValidateBeforeCall(createOAuthIntegrationRequest, null); + Type localVarReturnType = new TypeToken<OAuthIntegrationResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create OAuth Integration (asynchronously) + * Creates a new OAuth/OIDC integration configuration for the Tenant. The response returns the integration's identifier (Id), which is also the {oAuthApp} segment of the runtime OAuth/OIDC endpoints. Only the authorization_code and refresh_token grant types are permitted. + * @param createOAuthIntegrationRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createOAuthIntegrationAsync(CreateOAuthIntegrationRequest createOAuthIntegrationRequest, final ApiCallback<OAuthIntegrationResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = createOAuthIntegrationValidateBeforeCall(createOAuthIntegrationRequest, _callback); + Type localVarReturnType = new TypeToken<OAuthIntegrationResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteOAuthIntegration + * @param integrationId The OAuth integration identifier. It is the integration's OAuth application name, so the same value is the {oAuthApp} path segment of the runtime OAuth/OIDC endpoints (e.g. /api/oidc/{integrationId}/token). (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteOAuthIntegrationCall(String integrationId, 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 = "/v2/manage/integrations/oauth/{integrationId}" + .replace("{" + "integrationId" + "}", localVarApiClient.escapeString(integrationId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteOAuthIntegrationValidateBeforeCall(String integrationId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'integrationId' is set + if (integrationId == null) { + throw new ApiException("Missing the required parameter 'integrationId' when calling deleteOAuthIntegration(Async)"); + } + + return deleteOAuthIntegrationCall(integrationId, _callback); + + } + + /** + * Delete OAuth Integration configuration + * Deletes an existing OAuth/OIDC integration configuration for the Tenant using its Id, permanently removing it. + * @param integrationId The OAuth integration identifier. It is the integration's OAuth application name, so the same value is the {oAuthApp} path segment of the runtime OAuth/OIDC endpoints (e.g. /api/oidc/{integrationId}/token). (required) + * @return DeleteResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public DeleteResponse deleteOAuthIntegration(String integrationId) throws ApiException { + ApiResponse<DeleteResponse> localVarResp = deleteOAuthIntegrationWithHttpInfo(integrationId); + return localVarResp.getData(); + } + + /** + * Delete OAuth Integration configuration + * Deletes an existing OAuth/OIDC integration configuration for the Tenant using its Id, permanently removing it. + * @param integrationId The OAuth integration identifier. It is the integration's OAuth application name, so the same value is the {oAuthApp} path segment of the runtime OAuth/OIDC endpoints (e.g. /api/oidc/{integrationId}/token). (required) + * @return ApiResponse<DeleteResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DeleteResponse> deleteOAuthIntegrationWithHttpInfo(String integrationId) throws ApiException { + okhttp3.Call localVarCall = deleteOAuthIntegrationValidateBeforeCall(integrationId, null); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete OAuth Integration configuration (asynchronously) + * Deletes an existing OAuth/OIDC integration configuration for the Tenant using its Id, permanently removing it. + * @param integrationId The OAuth integration identifier. It is the integration's OAuth application name, so the same value is the {oAuthApp} path segment of the runtime OAuth/OIDC endpoints (e.g. /api/oidc/{integrationId}/token). (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteOAuthIntegrationAsync(String integrationId, final ApiCallback<DeleteResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteOAuthIntegrationValidateBeforeCall(integrationId, _callback); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAllOAuthIntegrations + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllOAuthIntegrationsCall(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 = "/v2/manage/integrations/oauth"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAllOAuthIntegrationsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getAllOAuthIntegrationsCall(_callback); + + } + + /** + * List OAuth Integrations + * Retrieves a list of all configured OAuth/OIDC integrations for the Tenant, including redirect URIs, allowed scopes, grant types, claim mappings, and token settings. + * @return GetAllOAuthIntegrations200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public GetAllOAuthIntegrations200Response getAllOAuthIntegrations() throws ApiException { + ApiResponse<GetAllOAuthIntegrations200Response> localVarResp = getAllOAuthIntegrationsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List OAuth Integrations + * Retrieves a list of all configured OAuth/OIDC integrations for the Tenant, including redirect URIs, allowed scopes, grant types, claim mappings, and token settings. + * @return ApiResponse<GetAllOAuthIntegrations200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetAllOAuthIntegrations200Response> getAllOAuthIntegrationsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getAllOAuthIntegrationsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<GetAllOAuthIntegrations200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List OAuth Integrations (asynchronously) + * Retrieves a list of all configured OAuth/OIDC integrations for the Tenant, including redirect URIs, allowed scopes, grant types, claim mappings, and token settings. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllOAuthIntegrationsAsync(final ApiCallback<GetAllOAuthIntegrations200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getAllOAuthIntegrationsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<GetAllOAuthIntegrations200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getOAuthIntegrationById + * @param integrationId The OAuth integration identifier. It is the integration's OAuth application name, so the same value is the {oAuthApp} path segment of the runtime OAuth/OIDC endpoints (e.g. /api/oidc/{integrationId}/token). (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOAuthIntegrationByIdCall(String integrationId, 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 = "/v2/manage/integrations/oauth/{integrationId}" + .replace("{" + "integrationId" + "}", localVarApiClient.escapeString(integrationId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOAuthIntegrationByIdValidateBeforeCall(String integrationId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'integrationId' is set + if (integrationId == null) { + throw new ApiException("Missing the required parameter 'integrationId' when calling getOAuthIntegrationById(Async)"); + } + + return getOAuthIntegrationByIdCall(integrationId, _callback); + + } + + /** + * Retrieve OAuth Integration configuration + * Retrieves the details of a specific OAuth/OIDC integration configuration for the Tenant using its Id, including redirect URIs, scopes, grant types, claim mappings, and token settings. + * @param integrationId The OAuth integration identifier. It is the integration's OAuth application name, so the same value is the {oAuthApp} path segment of the runtime OAuth/OIDC endpoints (e.g. /api/oidc/{integrationId}/token). (required) + * @return OAuthIntegrationResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public OAuthIntegrationResponse getOAuthIntegrationById(String integrationId) throws ApiException { + ApiResponse<OAuthIntegrationResponse> localVarResp = getOAuthIntegrationByIdWithHttpInfo(integrationId); + return localVarResp.getData(); + } + + /** + * Retrieve OAuth Integration configuration + * Retrieves the details of a specific OAuth/OIDC integration configuration for the Tenant using its Id, including redirect URIs, scopes, grant types, claim mappings, and token settings. + * @param integrationId The OAuth integration identifier. It is the integration's OAuth application name, so the same value is the {oAuthApp} path segment of the runtime OAuth/OIDC endpoints (e.g. /api/oidc/{integrationId}/token). (required) + * @return ApiResponse<OAuthIntegrationResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<OAuthIntegrationResponse> getOAuthIntegrationByIdWithHttpInfo(String integrationId) throws ApiException { + okhttp3.Call localVarCall = getOAuthIntegrationByIdValidateBeforeCall(integrationId, null); + Type localVarReturnType = new TypeToken<OAuthIntegrationResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve OAuth Integration configuration (asynchronously) + * Retrieves the details of a specific OAuth/OIDC integration configuration for the Tenant using its Id, including redirect URIs, scopes, grant types, claim mappings, and token settings. + * @param integrationId The OAuth integration identifier. It is the integration's OAuth application name, so the same value is the {oAuthApp} path segment of the runtime OAuth/OIDC endpoints (e.g. /api/oidc/{integrationId}/token). (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOAuthIntegrationByIdAsync(String integrationId, final ApiCallback<OAuthIntegrationResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getOAuthIntegrationByIdValidateBeforeCall(integrationId, _callback); + Type localVarReturnType = new TypeToken<OAuthIntegrationResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for rotateOAuthIntegrationCredentials + * @param integrationId The OAuth integration identifier. It is the integration's OAuth application name, so the same value is the {oAuthApp} path segment of the runtime OAuth/OIDC endpoints (e.g. /api/oidc/{integrationId}/token). (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call rotateOAuthIntegrationCredentialsCall(String integrationId, 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 = "/v2/manage/integrations/oauth/{integrationId}/credentials" + .replace("{" + "integrationId" + "}", localVarApiClient.escapeString(integrationId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call rotateOAuthIntegrationCredentialsValidateBeforeCall(String integrationId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'integrationId' is set + if (integrationId == null) { + throw new ApiException("Missing the required parameter 'integrationId' when calling rotateOAuthIntegrationCredentials(Async)"); + } + + return rotateOAuthIntegrationCredentialsCall(integrationId, _callback); + + } + + /** + * Rotate OAuth Integration client secret + * Regenerates the client secret for an existing OAuth/OIDC integration identified by its Id. The ClientId and Id are unchanged; only the secret is rotated. The new plaintext ClientSecret is returned once in this response, and only its hash is persisted server-side. + * @param integrationId The OAuth integration identifier. It is the integration's OAuth application name, so the same value is the {oAuthApp} path segment of the runtime OAuth/OIDC endpoints (e.g. /api/oidc/{integrationId}/token). (required) + * @return OAuthIntegrationCredentialsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public OAuthIntegrationCredentialsResponse rotateOAuthIntegrationCredentials(String integrationId) throws ApiException { + ApiResponse<OAuthIntegrationCredentialsResponse> localVarResp = rotateOAuthIntegrationCredentialsWithHttpInfo(integrationId); + return localVarResp.getData(); + } + + /** + * Rotate OAuth Integration client secret + * Regenerates the client secret for an existing OAuth/OIDC integration identified by its Id. The ClientId and Id are unchanged; only the secret is rotated. The new plaintext ClientSecret is returned once in this response, and only its hash is persisted server-side. + * @param integrationId The OAuth integration identifier. It is the integration's OAuth application name, so the same value is the {oAuthApp} path segment of the runtime OAuth/OIDC endpoints (e.g. /api/oidc/{integrationId}/token). (required) + * @return ApiResponse<OAuthIntegrationCredentialsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<OAuthIntegrationCredentialsResponse> rotateOAuthIntegrationCredentialsWithHttpInfo(String integrationId) throws ApiException { + okhttp3.Call localVarCall = rotateOAuthIntegrationCredentialsValidateBeforeCall(integrationId, null); + Type localVarReturnType = new TypeToken<OAuthIntegrationCredentialsResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Rotate OAuth Integration client secret (asynchronously) + * Regenerates the client secret for an existing OAuth/OIDC integration identified by its Id. The ClientId and Id are unchanged; only the secret is rotated. The new plaintext ClientSecret is returned once in this response, and only its hash is persisted server-side. + * @param integrationId The OAuth integration identifier. It is the integration's OAuth application name, so the same value is the {oAuthApp} path segment of the runtime OAuth/OIDC endpoints (e.g. /api/oidc/{integrationId}/token). (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call rotateOAuthIntegrationCredentialsAsync(String integrationId, final ApiCallback<OAuthIntegrationCredentialsResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = rotateOAuthIntegrationCredentialsValidateBeforeCall(integrationId, _callback); + Type localVarReturnType = new TypeToken<OAuthIntegrationCredentialsResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateOAuthIntegrationById + * @param integrationId The OAuth integration identifier. It is the integration's OAuth application name, so the same value is the {oAuthApp} path segment of the runtime OAuth/OIDC endpoints (e.g. /api/oidc/{integrationId}/token). (required) + * @param oauthIntegrationBaseModel (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateOAuthIntegrationByIdCall(String integrationId, OAuthIntegrationBaseModel oauthIntegrationBaseModel, 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 = oauthIntegrationBaseModel; + + // create path and map variables + String localVarPath = "/v2/manage/integrations/oauth/{integrationId}" + .replace("{" + "integrationId" + "}", localVarApiClient.escapeString(integrationId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateOAuthIntegrationByIdValidateBeforeCall(String integrationId, OAuthIntegrationBaseModel oauthIntegrationBaseModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'integrationId' is set + if (integrationId == null) { + throw new ApiException("Missing the required parameter 'integrationId' when calling updateOAuthIntegrationById(Async)"); + } + + // verify the required parameter 'oauthIntegrationBaseModel' is set + if (oauthIntegrationBaseModel == null) { + throw new ApiException("Missing the required parameter 'oauthIntegrationBaseModel' when calling updateOAuthIntegrationById(Async)"); + } + + return updateOAuthIntegrationByIdCall(integrationId, oauthIntegrationBaseModel, _callback); + + } + + /** + * Update OAuth Integration configuration + * Updates an existing OAuth/OIDC integration configuration for the Tenant identified by its Id. Id and DisplayName are immutable; only configuration fields are updated. Omitting a field leaves its stored value unchanged, as does a token lifetime of 0; passing an explicit empty AllowedScopes array removes all scopes from the integration. + * @param integrationId The OAuth integration identifier. It is the integration's OAuth application name, so the same value is the {oAuthApp} path segment of the runtime OAuth/OIDC endpoints (e.g. /api/oidc/{integrationId}/token). (required) + * @param oauthIntegrationBaseModel (required) + * @return OAuthIntegrationResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public OAuthIntegrationResponse updateOAuthIntegrationById(String integrationId, OAuthIntegrationBaseModel oauthIntegrationBaseModel) throws ApiException { + ApiResponse<OAuthIntegrationResponse> localVarResp = updateOAuthIntegrationByIdWithHttpInfo(integrationId, oauthIntegrationBaseModel); + return localVarResp.getData(); + } + + /** + * Update OAuth Integration configuration + * Updates an existing OAuth/OIDC integration configuration for the Tenant identified by its Id. Id and DisplayName are immutable; only configuration fields are updated. Omitting a field leaves its stored value unchanged, as does a token lifetime of 0; passing an explicit empty AllowedScopes array removes all scopes from the integration. + * @param integrationId The OAuth integration identifier. It is the integration's OAuth application name, so the same value is the {oAuthApp} path segment of the runtime OAuth/OIDC endpoints (e.g. /api/oidc/{integrationId}/token). (required) + * @param oauthIntegrationBaseModel (required) + * @return ApiResponse<OAuthIntegrationResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<OAuthIntegrationResponse> updateOAuthIntegrationByIdWithHttpInfo(String integrationId, OAuthIntegrationBaseModel oauthIntegrationBaseModel) throws ApiException { + okhttp3.Call localVarCall = updateOAuthIntegrationByIdValidateBeforeCall(integrationId, oauthIntegrationBaseModel, null); + Type localVarReturnType = new TypeToken<OAuthIntegrationResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update OAuth Integration configuration (asynchronously) + * Updates an existing OAuth/OIDC integration configuration for the Tenant identified by its Id. Id and DisplayName are immutable; only configuration fields are updated. Omitting a field leaves its stored value unchanged, as does a token lifetime of 0; passing an explicit empty AllowedScopes array removes all scopes from the integration. + * @param integrationId The OAuth integration identifier. It is the integration's OAuth application name, so the same value is the {oAuthApp} path segment of the runtime OAuth/OIDC endpoints (e.g. /api/oidc/{integrationId}/token). (required) + * @param oauthIntegrationBaseModel (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateOAuthIntegrationByIdAsync(String integrationId, OAuthIntegrationBaseModel oauthIntegrationBaseModel, final ApiCallback<OAuthIntegrationResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateOAuthIntegrationByIdValidateBeforeCall(integrationId, oauthIntegrationBaseModel, _callback); + Type localVarReturnType = new TypeToken<OAuthIntegrationResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/OAuthM2MApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/OAuthM2MApi.java new file mode 100644 index 0000000..47e800a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/OAuthM2MApi.java @@ -0,0 +1,622 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.JWKSResponse; +import com.loginradius.sdk.internal.openapi.model.OAuthErrorResponse; +import com.loginradius.sdk.internal.openapi.model.OAuthM2MIntrospectResponse; +import com.loginradius.sdk.internal.openapi.model.OAuthM2MTokenGenerate; +import com.loginradius.sdk.internal.openapi.model.OAuthM2MTokenIntrospect; +import com.loginradius.sdk.internal.openapi.model.OAuthM2MTokenResponse; +import com.loginradius.sdk.internal.openapi.model.OAuthM2MTokenRevoke; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class OAuthM2MApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public OAuthM2MApi() { + this(Configuration.getDefaultApiClient()); + } + + public OAuthM2MApi(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 generateM2MToken + * @param oauthM2MTokenGenerate (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call generateM2MTokenCall(OAuthM2MTokenGenerate oauthM2MTokenGenerate, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://{TenantName}.hub.loginradius.com", "https://{CustomDomain}" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = oauthM2MTokenGenerate; + + // create path and map variables + String localVarPath = "/service/oauth/token"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "application/x-www-form-urlencoded" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call generateM2MTokenValidateBeforeCall(OAuthM2MTokenGenerate oauthM2MTokenGenerate, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'oauthM2MTokenGenerate' is set + if (oauthM2MTokenGenerate == null) { + throw new ApiException("Missing the required parameter 'oauthM2MTokenGenerate' when calling generateM2MToken(Async)"); + } + + return generateM2MTokenCall(oauthM2MTokenGenerate, _callback); + + } + + /** + * Generate M2M token + * Generates a Machine-to-Machine (M2M) token for application authentication. + * @param oauthM2MTokenGenerate (required) + * @return OAuthM2MTokenResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public OAuthM2MTokenResponse generateM2MToken(OAuthM2MTokenGenerate oauthM2MTokenGenerate) throws ApiException { + ApiResponse<OAuthM2MTokenResponse> localVarResp = generateM2MTokenWithHttpInfo(oauthM2MTokenGenerate); + return localVarResp.getData(); + } + + /** + * Generate M2M token + * Generates a Machine-to-Machine (M2M) token for application authentication. + * @param oauthM2MTokenGenerate (required) + * @return ApiResponse<OAuthM2MTokenResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<OAuthM2MTokenResponse> generateM2MTokenWithHttpInfo(OAuthM2MTokenGenerate oauthM2MTokenGenerate) throws ApiException { + okhttp3.Call localVarCall = generateM2MTokenValidateBeforeCall(oauthM2MTokenGenerate, null); + Type localVarReturnType = new TypeToken<OAuthM2MTokenResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Generate M2M token (asynchronously) + * Generates a Machine-to-Machine (M2M) token for application authentication. + * @param oauthM2MTokenGenerate (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call generateM2MTokenAsync(OAuthM2MTokenGenerate oauthM2MTokenGenerate, final ApiCallback<OAuthM2MTokenResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = generateM2MTokenValidateBeforeCall(oauthM2MTokenGenerate, _callback); + Type localVarReturnType = new TypeToken<OAuthM2MTokenResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getM2MJWKSConfig + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getM2MJWKSConfigCall(final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://{TenantName}.hub.loginradius.com", "https://{CustomDomain}" }; + + // 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 = "/service/oauth/jwks"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getM2MJWKSConfigValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getM2MJWKSConfigCall(_callback); + + } + + /** + * Retrieve JSON Web Key Set + * Retrieves the JSON Web Key Set (JWKS) for verifying token signatures. + * @return JWKSResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public JWKSResponse getM2MJWKSConfig() throws ApiException { + ApiResponse<JWKSResponse> localVarResp = getM2MJWKSConfigWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Retrieve JSON Web Key Set + * Retrieves the JSON Web Key Set (JWKS) for verifying token signatures. + * @return ApiResponse<JWKSResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<JWKSResponse> getM2MJWKSConfigWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getM2MJWKSConfigValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<JWKSResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve JSON Web Key Set (asynchronously) + * Retrieves the JSON Web Key Set (JWKS) for verifying token signatures. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getM2MJWKSConfigAsync(final ApiCallback<JWKSResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getM2MJWKSConfigValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<JWKSResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getM2MTokenInfo + * @param oauthM2MTokenIntrospect (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getM2MTokenInfoCall(OAuthM2MTokenIntrospect oauthM2MTokenIntrospect, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://{TenantName}.hub.loginradius.com", "https://{CustomDomain}" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = oauthM2MTokenIntrospect; + + // create path and map variables + String localVarPath = "/service/oauth/introspect"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "application/x-www-form-urlencoded" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getM2MTokenInfoValidateBeforeCall(OAuthM2MTokenIntrospect oauthM2MTokenIntrospect, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'oauthM2MTokenIntrospect' is set + if (oauthM2MTokenIntrospect == null) { + throw new ApiException("Missing the required parameter 'oauthM2MTokenIntrospect' when calling getM2MTokenInfo(Async)"); + } + + return getM2MTokenInfoCall(oauthM2MTokenIntrospect, _callback); + + } + + /** + * Retrieve M2M token info + * Retrieves information about a Machine-to-Machine (M2M) token. + * @param oauthM2MTokenIntrospect (required) + * @return OAuthM2MIntrospectResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public OAuthM2MIntrospectResponse getM2MTokenInfo(OAuthM2MTokenIntrospect oauthM2MTokenIntrospect) throws ApiException { + ApiResponse<OAuthM2MIntrospectResponse> localVarResp = getM2MTokenInfoWithHttpInfo(oauthM2MTokenIntrospect); + return localVarResp.getData(); + } + + /** + * Retrieve M2M token info + * Retrieves information about a Machine-to-Machine (M2M) token. + * @param oauthM2MTokenIntrospect (required) + * @return ApiResponse<OAuthM2MIntrospectResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<OAuthM2MIntrospectResponse> getM2MTokenInfoWithHttpInfo(OAuthM2MTokenIntrospect oauthM2MTokenIntrospect) throws ApiException { + okhttp3.Call localVarCall = getM2MTokenInfoValidateBeforeCall(oauthM2MTokenIntrospect, null); + Type localVarReturnType = new TypeToken<OAuthM2MIntrospectResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve M2M token info (asynchronously) + * Retrieves information about a Machine-to-Machine (M2M) token. + * @param oauthM2MTokenIntrospect (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getM2MTokenInfoAsync(OAuthM2MTokenIntrospect oauthM2MTokenIntrospect, final ApiCallback<OAuthM2MIntrospectResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getM2MTokenInfoValidateBeforeCall(oauthM2MTokenIntrospect, _callback); + Type localVarReturnType = new TypeToken<OAuthM2MIntrospectResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for revokeM2MToken + * @param oauthM2MTokenRevoke (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call revokeM2MTokenCall(OAuthM2MTokenRevoke oauthM2MTokenRevoke, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://{TenantName}.hub.loginradius.com", "https://{CustomDomain}" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = oauthM2MTokenRevoke; + + // create path and map variables + String localVarPath = "/service/oauth/revoke"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "application/x-www-form-urlencoded" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call revokeM2MTokenValidateBeforeCall(OAuthM2MTokenRevoke oauthM2MTokenRevoke, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'oauthM2MTokenRevoke' is set + if (oauthM2MTokenRevoke == null) { + throw new ApiException("Missing the required parameter 'oauthM2MTokenRevoke' when calling revokeM2MToken(Async)"); + } + + return revokeM2MTokenCall(oauthM2MTokenRevoke, _callback); + + } + + /** + * Revoke M2M token + * Revokes a Machine-to-Machine (M2M) token to invalidate it. + * @param oauthM2MTokenRevoke (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public void revokeM2MToken(OAuthM2MTokenRevoke oauthM2MTokenRevoke) throws ApiException { + revokeM2MTokenWithHttpInfo(oauthM2MTokenRevoke); + } + + /** + * Revoke M2M token + * Revokes a Machine-to-Machine (M2M) token to invalidate it. + * @param oauthM2MTokenRevoke (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<Void> revokeM2MTokenWithHttpInfo(OAuthM2MTokenRevoke oauthM2MTokenRevoke) throws ApiException { + okhttp3.Call localVarCall = revokeM2MTokenValidateBeforeCall(oauthM2MTokenRevoke, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Revoke M2M token (asynchronously) + * Revokes a Machine-to-Machine (M2M) token to invalidate it. + * @param oauthM2MTokenRevoke (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call revokeM2MTokenAsync(OAuthM2MTokenRevoke oauthM2MTokenRevoke, final ApiCallback<Void> _callback) throws ApiException { + + okhttp3.Call localVarCall = revokeM2MTokenValidateBeforeCall(oauthM2MTokenRevoke, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/OidcApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/OidcApi.java new file mode 100644 index 0000000..c62fb92 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/OidcApi.java @@ -0,0 +1,2120 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.DynamicClientRegistrationRequest; +import com.loginradius.sdk.internal.openapi.model.DynamicClientRegistrationResponse; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.GetOAuthTokensRequest; +import com.loginradius.sdk.internal.openapi.model.JWKSResponse; +import com.loginradius.sdk.internal.openapi.model.OAuthAuthorizationServerMetadata; +import com.loginradius.sdk.internal.openapi.model.OAuthDynamicClientRequest; +import com.loginradius.sdk.internal.openapi.model.OAuthDynamicClientResponse; +import com.loginradius.sdk.internal.openapi.model.OAuthErrorResponse; +import com.loginradius.sdk.internal.openapi.model.OAuthRevokeRefreshToken; +import com.loginradius.sdk.internal.openapi.model.OIDCDeviceCode; +import com.loginradius.sdk.internal.openapi.model.OIDCDeviceCodeResponse; +import com.loginradius.sdk.internal.openapi.model.OIDCDiscoveryResponse; +import com.loginradius.sdk.internal.openapi.model.OIDCTokenIntrospectResponse; +import com.loginradius.sdk.internal.openapi.model.OIDCTokenResponse; +import com.loginradius.sdk.internal.openapi.model.OIDCUserinfo; +import com.loginradius.sdk.internal.openapi.model.PARRequest; +import com.loginradius.sdk.internal.openapi.model.PARResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class OidcApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public OidcApi() { + this(Configuration.getDefaultApiClient()); + } + + public OidcApi(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 deleteDynamicClient + * @param oiDCAppName OIDC App Name (required) + * @param clientID The client_id of the dynamically registered OAuth client. (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 204 </td><td> No Content: The client was successfully deleted. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The registration_access_token is missing. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The registration_access_token is invalid or the client was not found. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: Dynamic client registration is not enabled on this authorization server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteDynamicClientCall(String oiDCAppName, String clientID, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://{TenantName}.hub.loginradius.com", "https://{CustomDomain}" }; + + // 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 = "/api/oidc/{OIDCAppName}/register/{clientID}" + .replace("{" + "OIDCAppName" + "}", localVarApiClient.escapeString(oiDCAppName.toString())) + .replace("{" + "clientID" + "}", localVarApiClient.escapeString(clientID.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteDynamicClientValidateBeforeCall(String oiDCAppName, String clientID, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'oiDCAppName' is set + if (oiDCAppName == null) { + throw new ApiException("Missing the required parameter 'oiDCAppName' when calling deleteDynamicClient(Async)"); + } + + // verify the required parameter 'clientID' is set + if (clientID == null) { + throw new ApiException("Missing the required parameter 'clientID' when calling deleteDynamicClient(Async)"); + } + + return deleteDynamicClientCall(oiDCAppName, clientID, _callback); + + } + + /** + * Delete a Dynamic Client + * Deletes a dynamically registered OAuth 2.0/OIDC client per RFC 7592. Requires the registration_access_token issued at registration time. Returns 204 No Content on success. + * @param oiDCAppName OIDC App Name (required) + * @param clientID The client_id of the dynamically registered OAuth client. (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 204 </td><td> No Content: The client was successfully deleted. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The registration_access_token is missing. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The registration_access_token is invalid or the client was not found. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: Dynamic client registration is not enabled on this authorization server. </td><td> - </td></tr> + </table> + */ + public void deleteDynamicClient(String oiDCAppName, String clientID) throws ApiException { + deleteDynamicClientWithHttpInfo(oiDCAppName, clientID); + } + + /** + * Delete a Dynamic Client + * Deletes a dynamically registered OAuth 2.0/OIDC client per RFC 7592. Requires the registration_access_token issued at registration time. Returns 204 No Content on success. + * @param oiDCAppName OIDC App Name (required) + * @param clientID The client_id of the dynamically registered OAuth client. (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 204 </td><td> No Content: The client was successfully deleted. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The registration_access_token is missing. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The registration_access_token is invalid or the client was not found. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: Dynamic client registration is not enabled on this authorization server. </td><td> - </td></tr> + </table> + */ + public ApiResponse<Void> deleteDynamicClientWithHttpInfo(String oiDCAppName, String clientID) throws ApiException { + okhttp3.Call localVarCall = deleteDynamicClientValidateBeforeCall(oiDCAppName, clientID, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Delete a Dynamic Client (asynchronously) + * Deletes a dynamically registered OAuth 2.0/OIDC client per RFC 7592. Requires the registration_access_token issued at registration time. Returns 204 No Content on success. + * @param oiDCAppName OIDC App Name (required) + * @param clientID The client_id of the dynamically registered OAuth client. (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 204 </td><td> No Content: The client was successfully deleted. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The registration_access_token is missing. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The registration_access_token is invalid or the client was not found. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: Dynamic client registration is not enabled on this authorization server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteDynamicClientAsync(String oiDCAppName, String clientID, final ApiCallback<Void> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteDynamicClientValidateBeforeCall(oiDCAppName, clientID, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for getDynamicClient + * @param oiDCAppName OIDC App Name (required) + * @param clientID The client_id of the dynamically registered OAuth client. (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The registration_access_token is missing. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The registration_access_token is invalid or the client was not found. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: Dynamic client registration is not enabled on this authorization server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getDynamicClientCall(String oiDCAppName, String clientID, 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 = "/api/oidc/{OIDCAppName}/register/{clientID}" + .replace("{" + "OIDCAppName" + "}", localVarApiClient.escapeString(oiDCAppName.toString())) + .replace("{" + "clientID" + "}", localVarApiClient.escapeString(clientID.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getDynamicClientValidateBeforeCall(String oiDCAppName, String clientID, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'oiDCAppName' is set + if (oiDCAppName == null) { + throw new ApiException("Missing the required parameter 'oiDCAppName' when calling getDynamicClient(Async)"); + } + + // verify the required parameter 'clientID' is set + if (clientID == null) { + throw new ApiException("Missing the required parameter 'clientID' when calling getDynamicClient(Async)"); + } + + return getDynamicClientCall(oiDCAppName, clientID, _callback); + + } + + /** + * Get a Dynamic Client + * Retrieves the metadata of a dynamically registered OAuth 2.0/OIDC client per RFC 7592 (OAuth 2.0 Dynamic Client Registration Management Protocol). Requires the registration_access_token issued at registration time. + * @param oiDCAppName OIDC App Name (required) + * @param clientID The client_id of the dynamically registered OAuth client. (required) + * @return OAuthDynamicClientResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The registration_access_token is missing. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The registration_access_token is invalid or the client was not found. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: Dynamic client registration is not enabled on this authorization server. </td><td> - </td></tr> + </table> + */ + public OAuthDynamicClientResponse getDynamicClient(String oiDCAppName, String clientID) throws ApiException { + ApiResponse<OAuthDynamicClientResponse> localVarResp = getDynamicClientWithHttpInfo(oiDCAppName, clientID); + return localVarResp.getData(); + } + + /** + * Get a Dynamic Client + * Retrieves the metadata of a dynamically registered OAuth 2.0/OIDC client per RFC 7592 (OAuth 2.0 Dynamic Client Registration Management Protocol). Requires the registration_access_token issued at registration time. + * @param oiDCAppName OIDC App Name (required) + * @param clientID The client_id of the dynamically registered OAuth client. (required) + * @return ApiResponse<OAuthDynamicClientResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The registration_access_token is missing. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The registration_access_token is invalid or the client was not found. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: Dynamic client registration is not enabled on this authorization server. </td><td> - </td></tr> + </table> + */ + public ApiResponse<OAuthDynamicClientResponse> getDynamicClientWithHttpInfo(String oiDCAppName, String clientID) throws ApiException { + okhttp3.Call localVarCall = getDynamicClientValidateBeforeCall(oiDCAppName, clientID, null); + Type localVarReturnType = new TypeToken<OAuthDynamicClientResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get a Dynamic Client (asynchronously) + * Retrieves the metadata of a dynamically registered OAuth 2.0/OIDC client per RFC 7592 (OAuth 2.0 Dynamic Client Registration Management Protocol). Requires the registration_access_token issued at registration time. + * @param oiDCAppName OIDC App Name (required) + * @param clientID The client_id of the dynamically registered OAuth client. (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The registration_access_token is missing. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The registration_access_token is invalid or the client was not found. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: Dynamic client registration is not enabled on this authorization server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getDynamicClientAsync(String oiDCAppName, String clientID, final ApiCallback<OAuthDynamicClientResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getDynamicClientValidateBeforeCall(oiDCAppName, clientID, _callback); + Type localVarReturnType = new TypeToken<OAuthDynamicClientResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getOAuthAuthorizationServerMetadataOIDC + * @param oiDCAppName OIDC App Name (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOAuthAuthorizationServerMetadataOIDCCall(String oiDCAppName, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://{TenantName}.hub.loginradius.com", "https://{CustomDomain}" }; + + // 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 = "/service/oidc/{OIDCAppName}/.well-known/oauth-authorization-server" + .replace("{" + "OIDCAppName" + "}", localVarApiClient.escapeString(oiDCAppName.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOAuthAuthorizationServerMetadataOIDCValidateBeforeCall(String oiDCAppName, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'oiDCAppName' is set + if (oiDCAppName == null) { + throw new ApiException("Missing the required parameter 'oiDCAppName' when calling getOAuthAuthorizationServerMetadataOIDC(Async)"); + } + + return getOAuthAuthorizationServerMetadataOIDCCall(oiDCAppName, _callback); + + } + + /** + * OAuth Authorization Server Metadata (OIDC app) + * Returns OAuth 2.0 Authorization Server Metadata (RFC 8414) for the given OIDC app. Use this endpoint for OAuth 2.0 client discovery when using the OIDC flow path. Response does not include OpenID Connect-specific fields (e.g. userinfo_endpoint, claims_supported). + * @param oiDCAppName OIDC App Name (required) + * @return OAuthAuthorizationServerMetadata + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + </table> + */ + public OAuthAuthorizationServerMetadata getOAuthAuthorizationServerMetadataOIDC(String oiDCAppName) throws ApiException { + ApiResponse<OAuthAuthorizationServerMetadata> localVarResp = getOAuthAuthorizationServerMetadataOIDCWithHttpInfo(oiDCAppName); + return localVarResp.getData(); + } + + /** + * OAuth Authorization Server Metadata (OIDC app) + * Returns OAuth 2.0 Authorization Server Metadata (RFC 8414) for the given OIDC app. Use this endpoint for OAuth 2.0 client discovery when using the OIDC flow path. Response does not include OpenID Connect-specific fields (e.g. userinfo_endpoint, claims_supported). + * @param oiDCAppName OIDC App Name (required) + * @return ApiResponse<OAuthAuthorizationServerMetadata> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + </table> + */ + public ApiResponse<OAuthAuthorizationServerMetadata> getOAuthAuthorizationServerMetadataOIDCWithHttpInfo(String oiDCAppName) throws ApiException { + okhttp3.Call localVarCall = getOAuthAuthorizationServerMetadataOIDCValidateBeforeCall(oiDCAppName, null); + Type localVarReturnType = new TypeToken<OAuthAuthorizationServerMetadata>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * OAuth Authorization Server Metadata (OIDC app) (asynchronously) + * Returns OAuth 2.0 Authorization Server Metadata (RFC 8414) for the given OIDC app. Use this endpoint for OAuth 2.0 client discovery when using the OIDC flow path. Response does not include OpenID Connect-specific fields (e.g. userinfo_endpoint, claims_supported). + * @param oiDCAppName OIDC App Name (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOAuthAuthorizationServerMetadataOIDCAsync(String oiDCAppName, final ApiCallback<OAuthAuthorizationServerMetadata> _callback) throws ApiException { + + okhttp3.Call localVarCall = getOAuthAuthorizationServerMetadataOIDCValidateBeforeCall(oiDCAppName, _callback); + Type localVarReturnType = new TypeToken<OAuthAuthorizationServerMetadata>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getOIDCDeviceCode + * @param oiDCAppName OIDC App Name (required) + * @param oiDCDeviceCode (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOIDCDeviceCodeCall(String oiDCAppName, OIDCDeviceCode oiDCDeviceCode, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://{TenantName}.hub.loginradius.com", "https://{CustomDomain}" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = oiDCDeviceCode; + + // create path and map variables + String localVarPath = "/api/oidc/{OIDCAppName}/device" + .replace("{" + "OIDCAppName" + "}", localVarApiClient.escapeString(oiDCAppName.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "application/x-www-form-urlencoded" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOIDCDeviceCodeValidateBeforeCall(String oiDCAppName, OIDCDeviceCode oiDCDeviceCode, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'oiDCAppName' is set + if (oiDCAppName == null) { + throw new ApiException("Missing the required parameter 'oiDCAppName' when calling getOIDCDeviceCode(Async)"); + } + + // verify the required parameter 'oiDCDeviceCode' is set + if (oiDCDeviceCode == null) { + throw new ApiException("Missing the required parameter 'oiDCDeviceCode' when calling getOIDCDeviceCode(Async)"); + } + + return getOIDCDeviceCodeCall(oiDCAppName, oiDCDeviceCode, _callback); + + } + + /** + * Retrieve OIDC device code + * Initiates the OAuth 2.0 Device Authorization Grant per RFC 8628. Returns a device_code and user_code that the client displays to the end-user for out-of-band authorization on a secondary device. The client then polls the token endpoint with the device_code until the user completes authorization. + * @param oiDCAppName OIDC App Name (required) + * @param oiDCDeviceCode (required) + * @return OIDCDeviceCodeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public OIDCDeviceCodeResponse getOIDCDeviceCode(String oiDCAppName, OIDCDeviceCode oiDCDeviceCode) throws ApiException { + ApiResponse<OIDCDeviceCodeResponse> localVarResp = getOIDCDeviceCodeWithHttpInfo(oiDCAppName, oiDCDeviceCode); + return localVarResp.getData(); + } + + /** + * Retrieve OIDC device code + * Initiates the OAuth 2.0 Device Authorization Grant per RFC 8628. Returns a device_code and user_code that the client displays to the end-user for out-of-band authorization on a secondary device. The client then polls the token endpoint with the device_code until the user completes authorization. + * @param oiDCAppName OIDC App Name (required) + * @param oiDCDeviceCode (required) + * @return ApiResponse<OIDCDeviceCodeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<OIDCDeviceCodeResponse> getOIDCDeviceCodeWithHttpInfo(String oiDCAppName, OIDCDeviceCode oiDCDeviceCode) throws ApiException { + okhttp3.Call localVarCall = getOIDCDeviceCodeValidateBeforeCall(oiDCAppName, oiDCDeviceCode, null); + Type localVarReturnType = new TypeToken<OIDCDeviceCodeResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve OIDC device code (asynchronously) + * Initiates the OAuth 2.0 Device Authorization Grant per RFC 8628. Returns a device_code and user_code that the client displays to the end-user for out-of-band authorization on a secondary device. The client then polls the token endpoint with the device_code until the user completes authorization. + * @param oiDCAppName OIDC App Name (required) + * @param oiDCDeviceCode (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOIDCDeviceCodeAsync(String oiDCAppName, OIDCDeviceCode oiDCDeviceCode, final ApiCallback<OIDCDeviceCodeResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getOIDCDeviceCodeValidateBeforeCall(oiDCAppName, oiDCDeviceCode, _callback); + Type localVarReturnType = new TypeToken<OIDCDeviceCodeResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getOIDCDiscoveryConfig + * @param oiDCAppName OIDC App Name (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOIDCDiscoveryConfigCall(String oiDCAppName, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://{TenantName}.hub.loginradius.com", "https://{CustomDomain}" }; + + // 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 = "/service/oidc/{OIDCAppName}/.well-known/openid-configuration" + .replace("{" + "OIDCAppName" + "}", localVarApiClient.escapeString(oiDCAppName.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOIDCDiscoveryConfigValidateBeforeCall(String oiDCAppName, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'oiDCAppName' is set + if (oiDCAppName == null) { + throw new ApiException("Missing the required parameter 'oiDCAppName' when calling getOIDCDiscoveryConfig(Async)"); + } + + return getOIDCDiscoveryConfigCall(oiDCAppName, _callback); + + } + + /** + * OpenID Connect Discovery endpoint + * Returns the OpenID Provider Configuration Information per OpenID Connect Discovery 1.0 (Section 4). Clients use this endpoint to dynamically discover the issuer, supported endpoints, scopes, response types, claims, and signing algorithms. The response includes the authorization_endpoint, token_endpoint, userinfo_endpoint, jwks_uri, and other metadata needed to configure an OIDC Relying Party. + * @param oiDCAppName OIDC App Name (required) + * @return OIDCDiscoveryResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public OIDCDiscoveryResponse getOIDCDiscoveryConfig(String oiDCAppName) throws ApiException { + ApiResponse<OIDCDiscoveryResponse> localVarResp = getOIDCDiscoveryConfigWithHttpInfo(oiDCAppName); + return localVarResp.getData(); + } + + /** + * OpenID Connect Discovery endpoint + * Returns the OpenID Provider Configuration Information per OpenID Connect Discovery 1.0 (Section 4). Clients use this endpoint to dynamically discover the issuer, supported endpoints, scopes, response types, claims, and signing algorithms. The response includes the authorization_endpoint, token_endpoint, userinfo_endpoint, jwks_uri, and other metadata needed to configure an OIDC Relying Party. + * @param oiDCAppName OIDC App Name (required) + * @return ApiResponse<OIDCDiscoveryResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<OIDCDiscoveryResponse> getOIDCDiscoveryConfigWithHttpInfo(String oiDCAppName) throws ApiException { + okhttp3.Call localVarCall = getOIDCDiscoveryConfigValidateBeforeCall(oiDCAppName, null); + Type localVarReturnType = new TypeToken<OIDCDiscoveryResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * OpenID Connect Discovery endpoint (asynchronously) + * Returns the OpenID Provider Configuration Information per OpenID Connect Discovery 1.0 (Section 4). Clients use this endpoint to dynamically discover the issuer, supported endpoints, scopes, response types, claims, and signing algorithms. The response includes the authorization_endpoint, token_endpoint, userinfo_endpoint, jwks_uri, and other metadata needed to configure an OIDC Relying Party. + * @param oiDCAppName OIDC App Name (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOIDCDiscoveryConfigAsync(String oiDCAppName, final ApiCallback<OIDCDiscoveryResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getOIDCDiscoveryConfigValidateBeforeCall(oiDCAppName, _callback); + Type localVarReturnType = new TypeToken<OIDCDiscoveryResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getOIDCJWKSConfig + * @param oiDCAppName OIDC App Name (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOIDCJWKSConfigCall(String oiDCAppName, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://{TenantName}.hub.loginradius.com", "https://{CustomDomain}" }; + + // 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 = "/service/oidc/{OIDCAppName}/jwks" + .replace("{" + "OIDCAppName" + "}", localVarApiClient.escapeString(oiDCAppName.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOIDCJWKSConfigValidateBeforeCall(String oiDCAppName, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'oiDCAppName' is set + if (oiDCAppName == null) { + throw new ApiException("Missing the required parameter 'oiDCAppName' when calling getOIDCJWKSConfig(Async)"); + } + + return getOIDCJWKSConfigCall(oiDCAppName, _callback); + + } + + /** + * Retrieve JSON Web Key Set + * Retrieves the JSON Web Key Set (JWKS) for verifying token signatures. + * @param oiDCAppName OIDC App Name (required) + * @return JWKSResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public JWKSResponse getOIDCJWKSConfig(String oiDCAppName) throws ApiException { + ApiResponse<JWKSResponse> localVarResp = getOIDCJWKSConfigWithHttpInfo(oiDCAppName); + return localVarResp.getData(); + } + + /** + * Retrieve JSON Web Key Set + * Retrieves the JSON Web Key Set (JWKS) for verifying token signatures. + * @param oiDCAppName OIDC App Name (required) + * @return ApiResponse<JWKSResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<JWKSResponse> getOIDCJWKSConfigWithHttpInfo(String oiDCAppName) throws ApiException { + okhttp3.Call localVarCall = getOIDCJWKSConfigValidateBeforeCall(oiDCAppName, null); + Type localVarReturnType = new TypeToken<JWKSResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve JSON Web Key Set (asynchronously) + * Retrieves the JSON Web Key Set (JWKS) for verifying token signatures. + * @param oiDCAppName OIDC App Name (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOIDCJWKSConfigAsync(String oiDCAppName, final ApiCallback<JWKSResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getOIDCJWKSConfigValidateBeforeCall(oiDCAppName, _callback); + Type localVarReturnType = new TypeToken<JWKSResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getOIDCTokens + * @param oiDCAppName OIDC App Name (required) + * @param getOAuthTokensRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOIDCTokensCall(String oiDCAppName, GetOAuthTokensRequest getOAuthTokensRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://{TenantName}.hub.loginradius.com", "https://{CustomDomain}" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = getOAuthTokensRequest; + + // create path and map variables + String localVarPath = "/api/oidc/{OIDCAppName}/token" + .replace("{" + "OIDCAppName" + "}", localVarApiClient.escapeString(oiDCAppName.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "application/x-www-form-urlencoded" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOIDCTokensValidateBeforeCall(String oiDCAppName, GetOAuthTokensRequest getOAuthTokensRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'oiDCAppName' is set + if (oiDCAppName == null) { + throw new ApiException("Missing the required parameter 'oiDCAppName' when calling getOIDCTokens(Async)"); + } + + // verify the required parameter 'getOAuthTokensRequest' is set + if (getOAuthTokensRequest == null) { + throw new ApiException("Missing the required parameter 'getOAuthTokensRequest' when calling getOIDCTokens(Async)"); + } + + return getOIDCTokensCall(oiDCAppName, getOAuthTokensRequest, _callback); + + } + + /** + * Retrieve OIDC tokens + * Retrieves OpenID Connect (OIDC) tokens for User authentication. + * @param oiDCAppName OIDC App Name (required) + * @param getOAuthTokensRequest (required) + * @return OIDCTokenResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public OIDCTokenResponse getOIDCTokens(String oiDCAppName, GetOAuthTokensRequest getOAuthTokensRequest) throws ApiException { + ApiResponse<OIDCTokenResponse> localVarResp = getOIDCTokensWithHttpInfo(oiDCAppName, getOAuthTokensRequest); + return localVarResp.getData(); + } + + /** + * Retrieve OIDC tokens + * Retrieves OpenID Connect (OIDC) tokens for User authentication. + * @param oiDCAppName OIDC App Name (required) + * @param getOAuthTokensRequest (required) + * @return ApiResponse<OIDCTokenResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<OIDCTokenResponse> getOIDCTokensWithHttpInfo(String oiDCAppName, GetOAuthTokensRequest getOAuthTokensRequest) throws ApiException { + okhttp3.Call localVarCall = getOIDCTokensValidateBeforeCall(oiDCAppName, getOAuthTokensRequest, null); + Type localVarReturnType = new TypeToken<OIDCTokenResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve OIDC tokens (asynchronously) + * Retrieves OpenID Connect (OIDC) tokens for User authentication. + * @param oiDCAppName OIDC App Name (required) + * @param getOAuthTokensRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOIDCTokensAsync(String oiDCAppName, GetOAuthTokensRequest getOAuthTokensRequest, final ApiCallback<OIDCTokenResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getOIDCTokensValidateBeforeCall(oiDCAppName, getOAuthTokensRequest, _callback); + Type localVarReturnType = new TypeToken<OIDCTokenResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getOIDCUserinfo + * @param oiDCAppName OIDC App Name (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOIDCUserinfoCall(String oiDCAppName, 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 = "/service/oidc/{OIDCAppName}/userinfo" + .replace("{" + "OIDCAppName" + "}", localVarApiClient.escapeString(oiDCAppName.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + final String[] localVarAccepts = { + "application/json", + "application/jwt" + }; + 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[] { "AccessToken", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOIDCUserinfoValidateBeforeCall(String oiDCAppName, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'oiDCAppName' is set + if (oiDCAppName == null) { + throw new ApiException("Missing the required parameter 'oiDCAppName' when calling getOIDCUserinfo(Async)"); + } + + return getOIDCUserinfoCall(oiDCAppName, _callback); + + } + + /** + * Retrieve OIDC User info + * Retrieves User information using OpenID Connect (OIDC) standards. + * @param oiDCAppName OIDC App Name (required) + * @return Map<String, Object> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public Map<String, Object> getOIDCUserinfo(String oiDCAppName) throws ApiException { + ApiResponse<Map<String, Object>> localVarResp = getOIDCUserinfoWithHttpInfo(oiDCAppName); + return localVarResp.getData(); + } + + /** + * Retrieve OIDC User info + * Retrieves User information using OpenID Connect (OIDC) standards. + * @param oiDCAppName OIDC App Name (required) + * @return ApiResponse<Map<String, Object>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<Map<String, Object>> getOIDCUserinfoWithHttpInfo(String oiDCAppName) throws ApiException { + okhttp3.Call localVarCall = getOIDCUserinfoValidateBeforeCall(oiDCAppName, null); + Type localVarReturnType = new TypeToken<Map<String, Object>>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve OIDC User info (asynchronously) + * Retrieves User information using OpenID Connect (OIDC) standards. + * @param oiDCAppName OIDC App Name (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOIDCUserinfoAsync(String oiDCAppName, final ApiCallback<Map<String, Object>> _callback) throws ApiException { + + okhttp3.Call localVarCall = getOIDCUserinfoValidateBeforeCall(oiDCAppName, _callback); + Type localVarReturnType = new TypeToken<Map<String, Object>>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getOIDCUserinfoByPost + * @param oiDCAppName OIDC App Name (required) + * @param oiDCUserinfo (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOIDCUserinfoByPostCall(String oiDCAppName, OIDCUserinfo oiDCUserinfo, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://{TenantName}.hub.loginradius.com", "https://{CustomDomain}" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = oiDCUserinfo; + + // create path and map variables + String localVarPath = "/service/oidc/{OIDCAppName}/userinfo" + .replace("{" + "OIDCAppName" + "}", localVarApiClient.escapeString(oiDCAppName.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + final String[] localVarAccepts = { + "application/json", + "application/jwt" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "application/x-www-form-urlencoded" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOIDCUserinfoByPostValidateBeforeCall(String oiDCAppName, OIDCUserinfo oiDCUserinfo, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'oiDCAppName' is set + if (oiDCAppName == null) { + throw new ApiException("Missing the required parameter 'oiDCAppName' when calling getOIDCUserinfoByPost(Async)"); + } + + // verify the required parameter 'oiDCUserinfo' is set + if (oiDCUserinfo == null) { + throw new ApiException("Missing the required parameter 'oiDCUserinfo' when calling getOIDCUserinfoByPost(Async)"); + } + + return getOIDCUserinfoByPostCall(oiDCAppName, oiDCUserinfo, _callback); + + } + + /** + * Retrieve OIDC User info via POST + * Retrieves User information using OpenID Connect (OIDC) standards via the POST method. + * @param oiDCAppName OIDC App Name (required) + * @param oiDCUserinfo (required) + * @return Map<String, Object> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public Map<String, Object> getOIDCUserinfoByPost(String oiDCAppName, OIDCUserinfo oiDCUserinfo) throws ApiException { + ApiResponse<Map<String, Object>> localVarResp = getOIDCUserinfoByPostWithHttpInfo(oiDCAppName, oiDCUserinfo); + return localVarResp.getData(); + } + + /** + * Retrieve OIDC User info via POST + * Retrieves User information using OpenID Connect (OIDC) standards via the POST method. + * @param oiDCAppName OIDC App Name (required) + * @param oiDCUserinfo (required) + * @return ApiResponse<Map<String, Object>> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<Map<String, Object>> getOIDCUserinfoByPostWithHttpInfo(String oiDCAppName, OIDCUserinfo oiDCUserinfo) throws ApiException { + okhttp3.Call localVarCall = getOIDCUserinfoByPostValidateBeforeCall(oiDCAppName, oiDCUserinfo, null); + Type localVarReturnType = new TypeToken<Map<String, Object>>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve OIDC User info via POST (asynchronously) + * Retrieves User information using OpenID Connect (OIDC) standards via the POST method. + * @param oiDCAppName OIDC App Name (required) + * @param oiDCUserinfo (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOIDCUserinfoByPostAsync(String oiDCAppName, OIDCUserinfo oiDCUserinfo, final ApiCallback<Map<String, Object>> _callback) throws ApiException { + + okhttp3.Call localVarCall = getOIDCUserinfoByPostValidateBeforeCall(oiDCAppName, oiDCUserinfo, _callback); + Type localVarReturnType = new TypeToken<Map<String, Object>>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for introspectOIDCToken + * @param oiDCAppName OIDC App Name (required) + * @param oauthRevokeRefreshToken (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: Introspection result (active true with claims, or active false). </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call introspectOIDCTokenCall(String oiDCAppName, OAuthRevokeRefreshToken oauthRevokeRefreshToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://{TenantName}.hub.loginradius.com", "https://{CustomDomain}" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = oauthRevokeRefreshToken; + + // create path and map variables + String localVarPath = "/api/oidc/{OIDCAppName}/introspect" + .replace("{" + "OIDCAppName" + "}", localVarApiClient.escapeString(oiDCAppName.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "application/x-www-form-urlencoded" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call introspectOIDCTokenValidateBeforeCall(String oiDCAppName, OAuthRevokeRefreshToken oauthRevokeRefreshToken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'oiDCAppName' is set + if (oiDCAppName == null) { + throw new ApiException("Missing the required parameter 'oiDCAppName' when calling introspectOIDCToken(Async)"); + } + + // verify the required parameter 'oauthRevokeRefreshToken' is set + if (oauthRevokeRefreshToken == null) { + throw new ApiException("Missing the required parameter 'oauthRevokeRefreshToken' when calling introspectOIDCToken(Async)"); + } + + return introspectOIDCTokenCall(oiDCAppName, oauthRevokeRefreshToken, _callback); + + } + + /** + * Introspect OIDC token + * Returns the active state and metadata of an OIDC access or refresh token per RFC 7662 (OAuth 2.0 Token Introspection). The client must authenticate using either HTTP Basic authentication (Authorization: Basic base64(client_id:client_secret)) or by including client_id and client_secret in the POST body, depending on the token_endpoint_auth_method configured for the OIDC application. Returns active: true with associated claims for valid tokens, or active: false for invalid, expired, or revoked tokens. + * @param oiDCAppName OIDC App Name (required) + * @param oauthRevokeRefreshToken (required) + * @return OIDCTokenIntrospectResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: Introspection result (active true with claims, or active false). </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public OIDCTokenIntrospectResponse introspectOIDCToken(String oiDCAppName, OAuthRevokeRefreshToken oauthRevokeRefreshToken) throws ApiException { + ApiResponse<OIDCTokenIntrospectResponse> localVarResp = introspectOIDCTokenWithHttpInfo(oiDCAppName, oauthRevokeRefreshToken); + return localVarResp.getData(); + } + + /** + * Introspect OIDC token + * Returns the active state and metadata of an OIDC access or refresh token per RFC 7662 (OAuth 2.0 Token Introspection). The client must authenticate using either HTTP Basic authentication (Authorization: Basic base64(client_id:client_secret)) or by including client_id and client_secret in the POST body, depending on the token_endpoint_auth_method configured for the OIDC application. Returns active: true with associated claims for valid tokens, or active: false for invalid, expired, or revoked tokens. + * @param oiDCAppName OIDC App Name (required) + * @param oauthRevokeRefreshToken (required) + * @return ApiResponse<OIDCTokenIntrospectResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: Introspection result (active true with claims, or active false). </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<OIDCTokenIntrospectResponse> introspectOIDCTokenWithHttpInfo(String oiDCAppName, OAuthRevokeRefreshToken oauthRevokeRefreshToken) throws ApiException { + okhttp3.Call localVarCall = introspectOIDCTokenValidateBeforeCall(oiDCAppName, oauthRevokeRefreshToken, null); + Type localVarReturnType = new TypeToken<OIDCTokenIntrospectResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Introspect OIDC token (asynchronously) + * Returns the active state and metadata of an OIDC access or refresh token per RFC 7662 (OAuth 2.0 Token Introspection). The client must authenticate using either HTTP Basic authentication (Authorization: Basic base64(client_id:client_secret)) or by including client_id and client_secret in the POST body, depending on the token_endpoint_auth_method configured for the OIDC application. Returns active: true with associated claims for valid tokens, or active: false for invalid, expired, or revoked tokens. + * @param oiDCAppName OIDC App Name (required) + * @param oauthRevokeRefreshToken (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: Introspection result (active true with claims, or active false). </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call introspectOIDCTokenAsync(String oiDCAppName, OAuthRevokeRefreshToken oauthRevokeRefreshToken, final ApiCallback<OIDCTokenIntrospectResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = introspectOIDCTokenValidateBeforeCall(oiDCAppName, oauthRevokeRefreshToken, _callback); + Type localVarReturnType = new TypeToken<OIDCTokenIntrospectResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for oIDCDynamicClientRegistration + * @param oiDCAppName OIDC App Name (required) + * @param dynamicClientRegistrationRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: Returns the registered client metadata. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: Invalid registration request. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: Dynamic client registration is not enabled. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call oIDCDynamicClientRegistrationCall(String oiDCAppName, DynamicClientRegistrationRequest dynamicClientRegistrationRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://{TenantName}.hub.loginradius.com", "https://{CustomDomain}" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = dynamicClientRegistrationRequest; + + // create path and map variables + String localVarPath = "/api/oidc/{OIDCAppName}/register" + .replace("{" + "OIDCAppName" + "}", localVarApiClient.escapeString(oiDCAppName.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call oIDCDynamicClientRegistrationValidateBeforeCall(String oiDCAppName, DynamicClientRegistrationRequest dynamicClientRegistrationRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'oiDCAppName' is set + if (oiDCAppName == null) { + throw new ApiException("Missing the required parameter 'oiDCAppName' when calling oIDCDynamicClientRegistration(Async)"); + } + + // verify the required parameter 'dynamicClientRegistrationRequest' is set + if (dynamicClientRegistrationRequest == null) { + throw new ApiException("Missing the required parameter 'dynamicClientRegistrationRequest' when calling oIDCDynamicClientRegistration(Async)"); + } + + return oIDCDynamicClientRegistrationCall(oiDCAppName, dynamicClientRegistrationRequest, _callback); + + } + + /** + * OIDC dynamic client registration + * Registers a new OAuth 2.0/OIDC client dynamically per RFC 7591 (OAuth 2.0 Dynamic Client Registration Protocol). The client submits desired metadata (redirect_uris, client_name, grant_types, etc.) and receives the registered client metadata including the assigned client_id and client_secret. This feature must be explicitly enabled on the OIDC application configuration. + * @param oiDCAppName OIDC App Name (required) + * @param dynamicClientRegistrationRequest (required) + * @return DynamicClientRegistrationResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: Returns the registered client metadata. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: Invalid registration request. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: Dynamic client registration is not enabled. </td><td> - </td></tr> + </table> + */ + public DynamicClientRegistrationResponse oIDCDynamicClientRegistration(String oiDCAppName, DynamicClientRegistrationRequest dynamicClientRegistrationRequest) throws ApiException { + ApiResponse<DynamicClientRegistrationResponse> localVarResp = oIDCDynamicClientRegistrationWithHttpInfo(oiDCAppName, dynamicClientRegistrationRequest); + return localVarResp.getData(); + } + + /** + * OIDC dynamic client registration + * Registers a new OAuth 2.0/OIDC client dynamically per RFC 7591 (OAuth 2.0 Dynamic Client Registration Protocol). The client submits desired metadata (redirect_uris, client_name, grant_types, etc.) and receives the registered client metadata including the assigned client_id and client_secret. This feature must be explicitly enabled on the OIDC application configuration. + * @param oiDCAppName OIDC App Name (required) + * @param dynamicClientRegistrationRequest (required) + * @return ApiResponse<DynamicClientRegistrationResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: Returns the registered client metadata. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: Invalid registration request. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: Dynamic client registration is not enabled. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DynamicClientRegistrationResponse> oIDCDynamicClientRegistrationWithHttpInfo(String oiDCAppName, DynamicClientRegistrationRequest dynamicClientRegistrationRequest) throws ApiException { + okhttp3.Call localVarCall = oIDCDynamicClientRegistrationValidateBeforeCall(oiDCAppName, dynamicClientRegistrationRequest, null); + Type localVarReturnType = new TypeToken<DynamicClientRegistrationResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * OIDC dynamic client registration (asynchronously) + * Registers a new OAuth 2.0/OIDC client dynamically per RFC 7591 (OAuth 2.0 Dynamic Client Registration Protocol). The client submits desired metadata (redirect_uris, client_name, grant_types, etc.) and receives the registered client metadata including the assigned client_id and client_secret. This feature must be explicitly enabled on the OIDC application configuration. + * @param oiDCAppName OIDC App Name (required) + * @param dynamicClientRegistrationRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: Returns the registered client metadata. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: Invalid registration request. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: Dynamic client registration is not enabled. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call oIDCDynamicClientRegistrationAsync(String oiDCAppName, DynamicClientRegistrationRequest dynamicClientRegistrationRequest, final ApiCallback<DynamicClientRegistrationResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = oIDCDynamicClientRegistrationValidateBeforeCall(oiDCAppName, dynamicClientRegistrationRequest, _callback); + Type localVarReturnType = new TypeToken<DynamicClientRegistrationResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for oIDCPushedAuthorizationRequest + * @param oiDCAppName OIDC App Name (required) + * @param paRRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 201 </td><td> Created: PAR accepted. Use the returned request_uri as the sole parameter to the authorization endpoint within expires_in seconds. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: One or more request parameters are missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The application or client is not permitted to use this endpoint. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call oIDCPushedAuthorizationRequestCall(String oiDCAppName, PARRequest paRRequest, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://{TenantName}.hub.loginradius.com", "https://{CustomDomain}" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = paRRequest; + + // create path and map variables + String localVarPath = "/api/oidc/{OIDCAppName}/par" + .replace("{" + "OIDCAppName" + "}", localVarApiClient.escapeString(oiDCAppName.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "application/x-www-form-urlencoded" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call oIDCPushedAuthorizationRequestValidateBeforeCall(String oiDCAppName, PARRequest paRRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'oiDCAppName' is set + if (oiDCAppName == null) { + throw new ApiException("Missing the required parameter 'oiDCAppName' when calling oIDCPushedAuthorizationRequest(Async)"); + } + + // verify the required parameter 'paRRequest' is set + if (paRRequest == null) { + throw new ApiException("Missing the required parameter 'paRRequest' when calling oIDCPushedAuthorizationRequest(Async)"); + } + + return oIDCPushedAuthorizationRequestCall(oiDCAppName, paRRequest, _callback); + + } + + /** + * OIDC Pushed Authorization Request (PAR) + * Accepts an OIDC authorization request and stores it server-side per RFC 9126 (OAuth 2.0 Pushed Authorization Requests). Returns a short-lived request_uri that the client passes as the sole parameter to the authorization endpoint, keeping all sensitive request parameters out of the browser URL. This feature must be explicitly enabled on the OIDC application configuration. + * @param oiDCAppName OIDC App Name (required) + * @param paRRequest (required) + * @return PARResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 201 </td><td> Created: PAR accepted. Use the returned request_uri as the sole parameter to the authorization endpoint within expires_in seconds. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: One or more request parameters are missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The application or client is not permitted to use this endpoint. </td><td> - </td></tr> + </table> + */ + public PARResponse oIDCPushedAuthorizationRequest(String oiDCAppName, PARRequest paRRequest) throws ApiException { + ApiResponse<PARResponse> localVarResp = oIDCPushedAuthorizationRequestWithHttpInfo(oiDCAppName, paRRequest); + return localVarResp.getData(); + } + + /** + * OIDC Pushed Authorization Request (PAR) + * Accepts an OIDC authorization request and stores it server-side per RFC 9126 (OAuth 2.0 Pushed Authorization Requests). Returns a short-lived request_uri that the client passes as the sole parameter to the authorization endpoint, keeping all sensitive request parameters out of the browser URL. This feature must be explicitly enabled on the OIDC application configuration. + * @param oiDCAppName OIDC App Name (required) + * @param paRRequest (required) + * @return ApiResponse<PARResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 201 </td><td> Created: PAR accepted. Use the returned request_uri as the sole parameter to the authorization endpoint within expires_in seconds. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: One or more request parameters are missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The application or client is not permitted to use this endpoint. </td><td> - </td></tr> + </table> + */ + public ApiResponse<PARResponse> oIDCPushedAuthorizationRequestWithHttpInfo(String oiDCAppName, PARRequest paRRequest) throws ApiException { + okhttp3.Call localVarCall = oIDCPushedAuthorizationRequestValidateBeforeCall(oiDCAppName, paRRequest, null); + Type localVarReturnType = new TypeToken<PARResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * OIDC Pushed Authorization Request (PAR) (asynchronously) + * Accepts an OIDC authorization request and stores it server-side per RFC 9126 (OAuth 2.0 Pushed Authorization Requests). Returns a short-lived request_uri that the client passes as the sole parameter to the authorization endpoint, keeping all sensitive request parameters out of the browser URL. This feature must be explicitly enabled on the OIDC application configuration. + * @param oiDCAppName OIDC App Name (required) + * @param paRRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 201 </td><td> Created: PAR accepted. Use the returned request_uri as the sole parameter to the authorization endpoint within expires_in seconds. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: One or more request parameters are missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The application or client is not permitted to use this endpoint. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call oIDCPushedAuthorizationRequestAsync(String oiDCAppName, PARRequest paRRequest, final ApiCallback<PARResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = oIDCPushedAuthorizationRequestValidateBeforeCall(oiDCAppName, paRRequest, _callback); + Type localVarReturnType = new TypeToken<PARResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for revokeOIDCRefreshToken + * @param oiDCAppName OIDC App Name (required) + * @param oauthRevokeRefreshToken (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call revokeOIDCRefreshTokenCall(String oiDCAppName, OAuthRevokeRefreshToken oauthRevokeRefreshToken, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://{TenantName}.hub.loginradius.com", "https://{CustomDomain}" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = oauthRevokeRefreshToken; + + // create path and map variables + String localVarPath = "/api/oidc/{OIDCAppName}/revoke" + .replace("{" + "OIDCAppName" + "}", localVarApiClient.escapeString(oiDCAppName.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); + if (localVarAccept != null) { + localVarHeaderParams.put("Accept", localVarAccept); + } + + final String[] localVarContentTypes = { + "application/json", + "application/x-www-form-urlencoded" + }; + final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); + if (localVarContentType != null) { + localVarHeaderParams.put("Content-Type", localVarContentType); + } + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call revokeOIDCRefreshTokenValidateBeforeCall(String oiDCAppName, OAuthRevokeRefreshToken oauthRevokeRefreshToken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'oiDCAppName' is set + if (oiDCAppName == null) { + throw new ApiException("Missing the required parameter 'oiDCAppName' when calling revokeOIDCRefreshToken(Async)"); + } + + // verify the required parameter 'oauthRevokeRefreshToken' is set + if (oauthRevokeRefreshToken == null) { + throw new ApiException("Missing the required parameter 'oauthRevokeRefreshToken' when calling revokeOIDCRefreshToken(Async)"); + } + + return revokeOIDCRefreshTokenCall(oiDCAppName, oauthRevokeRefreshToken, _callback); + + } + + /** + * Revoke OIDC refresh token + * Revokes an OIDC refresh token per RFC 7009 (OAuth 2.0 Token Revocation), invalidating it and preventing any further use. The client must authenticate using client_id and client_secret via HTTP Basic or POST body. + * @param oiDCAppName OIDC App Name (required) + * @param oauthRevokeRefreshToken (required) + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public void revokeOIDCRefreshToken(String oiDCAppName, OAuthRevokeRefreshToken oauthRevokeRefreshToken) throws ApiException { + revokeOIDCRefreshTokenWithHttpInfo(oiDCAppName, oauthRevokeRefreshToken); + } + + /** + * Revoke OIDC refresh token + * Revokes an OIDC refresh token per RFC 7009 (OAuth 2.0 Token Revocation), invalidating it and preventing any further use. The client must authenticate using client_id and client_secret via HTTP Basic or POST body. + * @param oiDCAppName OIDC App Name (required) + * @param oauthRevokeRefreshToken (required) + * @return ApiResponse<Void> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<Void> revokeOIDCRefreshTokenWithHttpInfo(String oiDCAppName, OAuthRevokeRefreshToken oauthRevokeRefreshToken) throws ApiException { + okhttp3.Call localVarCall = revokeOIDCRefreshTokenValidateBeforeCall(oiDCAppName, oauthRevokeRefreshToken, null); + return localVarApiClient.execute(localVarCall); + } + + /** + * Revoke OIDC refresh token (asynchronously) + * Revokes an OIDC refresh token per RFC 7009 (OAuth 2.0 Token Revocation), invalidating it and preventing any further use. The client must authenticate using client_id and client_secret via HTTP Basic or POST body. + * @param oiDCAppName OIDC App Name (required) + * @param oauthRevokeRefreshToken (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The client must authenticate itself to get the requested response. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call revokeOIDCRefreshTokenAsync(String oiDCAppName, OAuthRevokeRefreshToken oauthRevokeRefreshToken, final ApiCallback<Void> _callback) throws ApiException { + + okhttp3.Call localVarCall = revokeOIDCRefreshTokenValidateBeforeCall(oiDCAppName, oauthRevokeRefreshToken, _callback); + localVarApiClient.executeAsync(localVarCall, _callback); + return localVarCall; + } + /** + * Build call for updateDynamicClient + * @param oiDCAppName OIDC App Name (required) + * @param clientID The client_id of the dynamically registered OAuth client. (required) + * @param oauthDynamicClientRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The client was successfully updated. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The client metadata is invalid or the registration_access_token is missing. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The registration_access_token is invalid or the client was not found. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: Dynamic client registration is not enabled on this authorization server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateDynamicClientCall(String oiDCAppName, String clientID, OAuthDynamicClientRequest oauthDynamicClientRequest, 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 = oauthDynamicClientRequest; + + // create path and map variables + String localVarPath = "/api/oidc/{OIDCAppName}/register/{clientID}" + .replace("{" + "OIDCAppName" + "}", localVarApiClient.escapeString(oiDCAppName.toString())) + .replace("{" + "clientID" + "}", localVarApiClient.escapeString(clientID.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateDynamicClientValidateBeforeCall(String oiDCAppName, String clientID, OAuthDynamicClientRequest oauthDynamicClientRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'oiDCAppName' is set + if (oiDCAppName == null) { + throw new ApiException("Missing the required parameter 'oiDCAppName' when calling updateDynamicClient(Async)"); + } + + // verify the required parameter 'clientID' is set + if (clientID == null) { + throw new ApiException("Missing the required parameter 'clientID' when calling updateDynamicClient(Async)"); + } + + // verify the required parameter 'oauthDynamicClientRequest' is set + if (oauthDynamicClientRequest == null) { + throw new ApiException("Missing the required parameter 'oauthDynamicClientRequest' when calling updateDynamicClient(Async)"); + } + + return updateDynamicClientCall(oiDCAppName, clientID, oauthDynamicClientRequest, _callback); + + } + + /** + * Update a Dynamic Client + * Updates the metadata of a dynamically registered OAuth 2.0/OIDC client per RFC 7592. Requires the registration_access_token issued at registration time. + * @param oiDCAppName OIDC App Name (required) + * @param clientID The client_id of the dynamically registered OAuth client. (required) + * @param oauthDynamicClientRequest (required) + * @return OAuthDynamicClientResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The client was successfully updated. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The client metadata is invalid or the registration_access_token is missing. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The registration_access_token is invalid or the client was not found. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: Dynamic client registration is not enabled on this authorization server. </td><td> - </td></tr> + </table> + */ + public OAuthDynamicClientResponse updateDynamicClient(String oiDCAppName, String clientID, OAuthDynamicClientRequest oauthDynamicClientRequest) throws ApiException { + ApiResponse<OAuthDynamicClientResponse> localVarResp = updateDynamicClientWithHttpInfo(oiDCAppName, clientID, oauthDynamicClientRequest); + return localVarResp.getData(); + } + + /** + * Update a Dynamic Client + * Updates the metadata of a dynamically registered OAuth 2.0/OIDC client per RFC 7592. Requires the registration_access_token issued at registration time. + * @param oiDCAppName OIDC App Name (required) + * @param clientID The client_id of the dynamically registered OAuth client. (required) + * @param oauthDynamicClientRequest (required) + * @return ApiResponse<OAuthDynamicClientResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The client was successfully updated. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The client metadata is invalid or the registration_access_token is missing. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The registration_access_token is invalid or the client was not found. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: Dynamic client registration is not enabled on this authorization server. </td><td> - </td></tr> + </table> + */ + public ApiResponse<OAuthDynamicClientResponse> updateDynamicClientWithHttpInfo(String oiDCAppName, String clientID, OAuthDynamicClientRequest oauthDynamicClientRequest) throws ApiException { + okhttp3.Call localVarCall = updateDynamicClientValidateBeforeCall(oiDCAppName, clientID, oauthDynamicClientRequest, null); + Type localVarReturnType = new TypeToken<OAuthDynamicClientResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update a Dynamic Client (asynchronously) + * Updates the metadata of a dynamically registered OAuth 2.0/OIDC client per RFC 7592. Requires the registration_access_token issued at registration time. + * @param oiDCAppName OIDC App Name (required) + * @param clientID The client_id of the dynamically registered OAuth client. (required) + * @param oauthDynamicClientRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The client was successfully updated. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The client metadata is invalid or the registration_access_token is missing. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The registration_access_token is invalid or the client was not found. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: Dynamic client registration is not enabled on this authorization server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateDynamicClientAsync(String oiDCAppName, String clientID, OAuthDynamicClientRequest oauthDynamicClientRequest, final ApiCallback<OAuthDynamicClientResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateDynamicClientValidateBeforeCall(oiDCAppName, clientID, oauthDynamicClientRequest, _callback); + Type localVarReturnType = new TypeToken<OAuthDynamicClientResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/OrganizationApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/OrganizationApi.java new file mode 100644 index 0000000..cb8acf9 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/OrganizationApi.java @@ -0,0 +1,1238 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.CreateOrganizationRequest; +import com.loginradius.sdk.internal.openapi.model.DeleteResponse; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.GetAllOrganizations200Response; +import com.loginradius.sdk.internal.openapi.model.GetOrgContextByUid200Response; +import com.loginradius.sdk.internal.openapi.model.OrganizationUpdateRequest; +import com.loginradius.sdk.internal.openapi.model.OrganizationsResponse; +import com.loginradius.sdk.internal.openapi.model.Role; +import com.loginradius.sdk.internal.openapi.model.RoleByName200Response; +import com.loginradius.sdk.internal.openapi.model.RolePostRequest; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class OrganizationApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public OrganizationApi() { + this(Configuration.getDefaultApiClient()); + } + + public OrganizationApi(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 createOrgTenantRole + * @param orgId Organization ID (required) + * @param rolePostRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createOrgTenantRoleCall(String orgId, RolePostRequest rolePostRequest, 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 = rolePostRequest; + + // create path and map variables + String localVarPath = "/v2/manage/organizations/{orgId}/roles" + .replace("{" + "orgId" + "}", localVarApiClient.escapeString(orgId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createOrgTenantRoleValidateBeforeCall(String orgId, RolePostRequest rolePostRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'orgId' is set + if (orgId == null) { + throw new ApiException("Missing the required parameter 'orgId' when calling createOrgTenantRole(Async)"); + } + + // verify the required parameter 'rolePostRequest' is set + if (rolePostRequest == null) { + throw new ApiException("Missing the required parameter 'rolePostRequest' when calling createOrgTenantRole(Async)"); + } + + return createOrgTenantRoleCall(orgId, rolePostRequest, _callback); + + } + + /** + * Create Role in Organization + * Creates a Role within an Organization. + * @param orgId Organization ID (required) + * @param rolePostRequest (required) + * @return Role + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public Role createOrgTenantRole(String orgId, RolePostRequest rolePostRequest) throws ApiException { + ApiResponse<Role> localVarResp = createOrgTenantRoleWithHttpInfo(orgId, rolePostRequest); + return localVarResp.getData(); + } + + /** + * Create Role in Organization + * Creates a Role within an Organization. + * @param orgId Organization ID (required) + * @param rolePostRequest (required) + * @return ApiResponse<Role> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<Role> createOrgTenantRoleWithHttpInfo(String orgId, RolePostRequest rolePostRequest) throws ApiException { + okhttp3.Call localVarCall = createOrgTenantRoleValidateBeforeCall(orgId, rolePostRequest, null); + Type localVarReturnType = new TypeToken<Role>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Role in Organization (asynchronously) + * Creates a Role within an Organization. + * @param orgId Organization ID (required) + * @param rolePostRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createOrgTenantRoleAsync(String orgId, RolePostRequest rolePostRequest, final ApiCallback<Role> _callback) throws ApiException { + + okhttp3.Call localVarCall = createOrgTenantRoleValidateBeforeCall(orgId, rolePostRequest, _callback); + Type localVarReturnType = new TypeToken<Role>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for createOrganization + * @param createOrganizationRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createOrganizationCall(CreateOrganizationRequest createOrganizationRequest, 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 = createOrganizationRequest; + + // create path and map variables + String localVarPath = "/v2/manage/organizations"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createOrganizationValidateBeforeCall(CreateOrganizationRequest createOrganizationRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'createOrganizationRequest' is set + if (createOrganizationRequest == null) { + throw new ApiException("Missing the required parameter 'createOrganizationRequest' when calling createOrganization(Async)"); + } + + return createOrganizationCall(createOrganizationRequest, _callback); + + } + + /** + * Create Organization + * Creates a new Organization in the Tenant. + * @param createOrganizationRequest (required) + * @return OrganizationsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public OrganizationsResponse createOrganization(CreateOrganizationRequest createOrganizationRequest) throws ApiException { + ApiResponse<OrganizationsResponse> localVarResp = createOrganizationWithHttpInfo(createOrganizationRequest); + return localVarResp.getData(); + } + + /** + * Create Organization + * Creates a new Organization in the Tenant. + * @param createOrganizationRequest (required) + * @return ApiResponse<OrganizationsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<OrganizationsResponse> createOrganizationWithHttpInfo(CreateOrganizationRequest createOrganizationRequest) throws ApiException { + okhttp3.Call localVarCall = createOrganizationValidateBeforeCall(createOrganizationRequest, null); + Type localVarReturnType = new TypeToken<OrganizationsResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Organization (asynchronously) + * Creates a new Organization in the Tenant. + * @param createOrganizationRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createOrganizationAsync(CreateOrganizationRequest createOrganizationRequest, final ApiCallback<OrganizationsResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = createOrganizationValidateBeforeCall(createOrganizationRequest, _callback); + Type localVarReturnType = new TypeToken<OrganizationsResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteOrganization + * @param orgId Organization ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteOrganizationCall(String orgId, 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 = "/v2/manage/organizations/{orgId}" + .replace("{" + "orgId" + "}", localVarApiClient.escapeString(orgId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteOrganizationValidateBeforeCall(String orgId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'orgId' is set + if (orgId == null) { + throw new ApiException("Missing the required parameter 'orgId' when calling deleteOrganization(Async)"); + } + + return deleteOrganizationCall(orgId, _callback); + + } + + /** + * Delete Organization + * Deletes an Organization by its ID. + * @param orgId Organization ID (required) + * @return DeleteResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public DeleteResponse deleteOrganization(String orgId) throws ApiException { + ApiResponse<DeleteResponse> localVarResp = deleteOrganizationWithHttpInfo(orgId); + return localVarResp.getData(); + } + + /** + * Delete Organization + * Deletes an Organization by its ID. + * @param orgId Organization ID (required) + * @return ApiResponse<DeleteResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DeleteResponse> deleteOrganizationWithHttpInfo(String orgId) throws ApiException { + okhttp3.Call localVarCall = deleteOrganizationValidateBeforeCall(orgId, null); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Organization (asynchronously) + * Deletes an Organization by its ID. + * @param orgId Organization ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteOrganizationAsync(String orgId, final ApiCallback<DeleteResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteOrganizationValidateBeforeCall(orgId, _callback); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAllOrganizations + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllOrganizationsCall(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 = "/v2/manage/organizations"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAllOrganizationsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getAllOrganizationsCall(_callback); + + } + + /** + * List Organizations + * Retrieves a list of all Organizations in the Tenant. + * @return GetAllOrganizations200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public GetAllOrganizations200Response getAllOrganizations() throws ApiException { + ApiResponse<GetAllOrganizations200Response> localVarResp = getAllOrganizationsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List Organizations + * Retrieves a list of all Organizations in the Tenant. + * @return ApiResponse<GetAllOrganizations200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetAllOrganizations200Response> getAllOrganizationsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getAllOrganizationsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<GetAllOrganizations200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Organizations (asynchronously) + * Retrieves a list of all Organizations in the Tenant. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllOrganizationsAsync(final ApiCallback<GetAllOrganizations200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getAllOrganizationsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<GetAllOrganizations200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getOrgContextByOrgId + * @param orgId Unique identifier of the Organization. (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOrgContextByOrgIdCall(String orgId, 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 = "/v2/manage/organizations/{orgId}/orgcontext" + .replace("{" + "orgId" + "}", localVarApiClient.escapeString(orgId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOrgContextByOrgIdValidateBeforeCall(String orgId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'orgId' is set + if (orgId == null) { + throw new ApiException("Missing the required parameter 'orgId' when calling getOrgContextByOrgId(Async)"); + } + + return getOrgContextByOrgIdCall(orgId, _callback); + + } + + /** + * Retrieve Organization context + * Retrieves User Roles for all Organizations by OrgID. + * @param orgId Unique identifier of the Organization. (required) + * @return GetOrgContextByUid200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public GetOrgContextByUid200Response getOrgContextByOrgId(String orgId) throws ApiException { + ApiResponse<GetOrgContextByUid200Response> localVarResp = getOrgContextByOrgIdWithHttpInfo(orgId); + return localVarResp.getData(); + } + + /** + * Retrieve Organization context + * Retrieves User Roles for all Organizations by OrgID. + * @param orgId Unique identifier of the Organization. (required) + * @return ApiResponse<GetOrgContextByUid200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetOrgContextByUid200Response> getOrgContextByOrgIdWithHttpInfo(String orgId) throws ApiException { + okhttp3.Call localVarCall = getOrgContextByOrgIdValidateBeforeCall(orgId, null); + Type localVarReturnType = new TypeToken<GetOrgContextByUid200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Organization context (asynchronously) + * Retrieves User Roles for all Organizations by OrgID. + * @param orgId Unique identifier of the Organization. (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOrgContextByOrgIdAsync(String orgId, final ApiCallback<GetOrgContextByUid200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getOrgContextByOrgIdValidateBeforeCall(orgId, _callback); + Type localVarReturnType = new TypeToken<GetOrgContextByUid200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getOrgRolesByOrgId + * @param orgId Organization ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOrgRolesByOrgIdCall(String orgId, 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 = "/v2/manage/organizations/{orgId}/roles" + .replace("{" + "orgId" + "}", localVarApiClient.escapeString(orgId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOrgRolesByOrgIdValidateBeforeCall(String orgId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'orgId' is set + if (orgId == null) { + throw new ApiException("Missing the required parameter 'orgId' when calling getOrgRolesByOrgId(Async)"); + } + + return getOrgRolesByOrgIdCall(orgId, _callback); + + } + + /** + * List Organization Roles + * Lists all Roles defined within an Organization. + * @param orgId Organization ID (required) + * @return RoleByName200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public RoleByName200Response getOrgRolesByOrgId(String orgId) throws ApiException { + ApiResponse<RoleByName200Response> localVarResp = getOrgRolesByOrgIdWithHttpInfo(orgId); + return localVarResp.getData(); + } + + /** + * List Organization Roles + * Lists all Roles defined within an Organization. + * @param orgId Organization ID (required) + * @return ApiResponse<RoleByName200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<RoleByName200Response> getOrgRolesByOrgIdWithHttpInfo(String orgId) throws ApiException { + okhttp3.Call localVarCall = getOrgRolesByOrgIdValidateBeforeCall(orgId, null); + Type localVarReturnType = new TypeToken<RoleByName200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Organization Roles (asynchronously) + * Lists all Roles defined within an Organization. + * @param orgId Organization ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOrgRolesByOrgIdAsync(String orgId, final ApiCallback<RoleByName200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getOrgRolesByOrgIdValidateBeforeCall(orgId, _callback); + Type localVarReturnType = new TypeToken<RoleByName200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getOrganization + * @param orgId Organization ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOrganizationCall(String orgId, 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 = "/v2/manage/organizations/{orgId}" + .replace("{" + "orgId" + "}", localVarApiClient.escapeString(orgId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOrganizationValidateBeforeCall(String orgId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'orgId' is set + if (orgId == null) { + throw new ApiException("Missing the required parameter 'orgId' when calling getOrganization(Async)"); + } + + return getOrganizationCall(orgId, _callback); + + } + + /** + * Retrieve Organization details + * Retrieves details of a specific Organization by its ID. + * @param orgId Organization ID (required) + * @return OrganizationsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public OrganizationsResponse getOrganization(String orgId) throws ApiException { + ApiResponse<OrganizationsResponse> localVarResp = getOrganizationWithHttpInfo(orgId); + return localVarResp.getData(); + } + + /** + * Retrieve Organization details + * Retrieves details of a specific Organization by its ID. + * @param orgId Organization ID (required) + * @return ApiResponse<OrganizationsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<OrganizationsResponse> getOrganizationWithHttpInfo(String orgId) throws ApiException { + okhttp3.Call localVarCall = getOrganizationValidateBeforeCall(orgId, null); + Type localVarReturnType = new TypeToken<OrganizationsResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Organization details (asynchronously) + * Retrieves details of a specific Organization by its ID. + * @param orgId Organization ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOrganizationAsync(String orgId, final ApiCallback<OrganizationsResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getOrganizationValidateBeforeCall(orgId, _callback); + Type localVarReturnType = new TypeToken<OrganizationsResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateOrganization + * @param orgId Organization ID (required) + * @param organizationUpdateRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateOrganizationCall(String orgId, OrganizationUpdateRequest organizationUpdateRequest, 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 = organizationUpdateRequest; + + // create path and map variables + String localVarPath = "/v2/manage/organizations/{orgId}" + .replace("{" + "orgId" + "}", localVarApiClient.escapeString(orgId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateOrganizationValidateBeforeCall(String orgId, OrganizationUpdateRequest organizationUpdateRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'orgId' is set + if (orgId == null) { + throw new ApiException("Missing the required parameter 'orgId' when calling updateOrganization(Async)"); + } + + // verify the required parameter 'organizationUpdateRequest' is set + if (organizationUpdateRequest == null) { + throw new ApiException("Missing the required parameter 'organizationUpdateRequest' when calling updateOrganization(Async)"); + } + + return updateOrganizationCall(orgId, organizationUpdateRequest, _callback); + + } + + /** + * Update Organization + * Updates an Organization by its ID. Supports updating org fields, policies, and status in a single request. + * @param orgId Organization ID (required) + * @param organizationUpdateRequest (required) + * @return OrganizationsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public OrganizationsResponse updateOrganization(String orgId, OrganizationUpdateRequest organizationUpdateRequest) throws ApiException { + ApiResponse<OrganizationsResponse> localVarResp = updateOrganizationWithHttpInfo(orgId, organizationUpdateRequest); + return localVarResp.getData(); + } + + /** + * Update Organization + * Updates an Organization by its ID. Supports updating org fields, policies, and status in a single request. + * @param orgId Organization ID (required) + * @param organizationUpdateRequest (required) + * @return ApiResponse<OrganizationsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<OrganizationsResponse> updateOrganizationWithHttpInfo(String orgId, OrganizationUpdateRequest organizationUpdateRequest) throws ApiException { + okhttp3.Call localVarCall = updateOrganizationValidateBeforeCall(orgId, organizationUpdateRequest, null); + Type localVarReturnType = new TypeToken<OrganizationsResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Organization (asynchronously) + * Updates an Organization by its ID. Supports updating org fields, policies, and status in a single request. + * @param orgId Organization ID (required) + * @param organizationUpdateRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateOrganizationAsync(String orgId, OrganizationUpdateRequest organizationUpdateRequest, final ApiCallback<OrganizationsResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateOrganizationValidateBeforeCall(orgId, organizationUpdateRequest, _callback); + Type localVarReturnType = new TypeToken<OrganizationsResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/OrganizationConnectionGroupRolesApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/OrganizationConnectionGroupRolesApi.java new file mode 100644 index 0000000..9f02020 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/OrganizationConnectionGroupRolesApi.java @@ -0,0 +1,744 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.ConnectionGroupRoleRequest; +import com.loginradius.sdk.internal.openapi.model.ConnectionGroupRoleResponse; +import com.loginradius.sdk.internal.openapi.model.CreateConnectionGroupRoleRequest; +import com.loginradius.sdk.internal.openapi.model.DeleteResponse; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.GetAllConnectionGroupRoles200Response; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class OrganizationConnectionGroupRolesApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public OrganizationConnectionGroupRolesApi() { + this(Configuration.getDefaultApiClient()); + } + + public OrganizationConnectionGroupRolesApi(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 createConnectionGroupRole + * @param connId Organization Connection ID (required) + * @param orgId Organization ID (required) + * @param createConnectionGroupRoleRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createConnectionGroupRoleCall(String connId, String orgId, CreateConnectionGroupRoleRequest createConnectionGroupRoleRequest, 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 = createConnectionGroupRoleRequest; + + // create path and map variables + String localVarPath = "/v2/manage/organizations/{orgId}/connections/{connId}/grouproles" + .replace("{" + "connId" + "}", localVarApiClient.escapeString(connId.toString())) + .replace("{" + "orgId" + "}", localVarApiClient.escapeString(orgId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createConnectionGroupRoleValidateBeforeCall(String connId, String orgId, CreateConnectionGroupRoleRequest createConnectionGroupRoleRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'connId' is set + if (connId == null) { + throw new ApiException("Missing the required parameter 'connId' when calling createConnectionGroupRole(Async)"); + } + + // verify the required parameter 'orgId' is set + if (orgId == null) { + throw new ApiException("Missing the required parameter 'orgId' when calling createConnectionGroupRole(Async)"); + } + + // verify the required parameter 'createConnectionGroupRoleRequest' is set + if (createConnectionGroupRoleRequest == null) { + throw new ApiException("Missing the required parameter 'createConnectionGroupRoleRequest' when calling createConnectionGroupRole(Async)"); + } + + return createConnectionGroupRoleCall(connId, orgId, createConnectionGroupRoleRequest, _callback); + + } + + /** + * Create Organization connection group Role + * Creates a new group-to-role mapping for an Identity Provider connection. + * @param connId Organization Connection ID (required) + * @param orgId Organization ID (required) + * @param createConnectionGroupRoleRequest (required) + * @return ConnectionGroupRoleResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ConnectionGroupRoleResponse createConnectionGroupRole(String connId, String orgId, CreateConnectionGroupRoleRequest createConnectionGroupRoleRequest) throws ApiException { + ApiResponse<ConnectionGroupRoleResponse> localVarResp = createConnectionGroupRoleWithHttpInfo(connId, orgId, createConnectionGroupRoleRequest); + return localVarResp.getData(); + } + + /** + * Create Organization connection group Role + * Creates a new group-to-role mapping for an Identity Provider connection. + * @param connId Organization Connection ID (required) + * @param orgId Organization ID (required) + * @param createConnectionGroupRoleRequest (required) + * @return ApiResponse<ConnectionGroupRoleResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<ConnectionGroupRoleResponse> createConnectionGroupRoleWithHttpInfo(String connId, String orgId, CreateConnectionGroupRoleRequest createConnectionGroupRoleRequest) throws ApiException { + okhttp3.Call localVarCall = createConnectionGroupRoleValidateBeforeCall(connId, orgId, createConnectionGroupRoleRequest, null); + Type localVarReturnType = new TypeToken<ConnectionGroupRoleResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Organization connection group Role (asynchronously) + * Creates a new group-to-role mapping for an Identity Provider connection. + * @param connId Organization Connection ID (required) + * @param orgId Organization ID (required) + * @param createConnectionGroupRoleRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createConnectionGroupRoleAsync(String connId, String orgId, CreateConnectionGroupRoleRequest createConnectionGroupRoleRequest, final ApiCallback<ConnectionGroupRoleResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = createConnectionGroupRoleValidateBeforeCall(connId, orgId, createConnectionGroupRoleRequest, _callback); + Type localVarReturnType = new TypeToken<ConnectionGroupRoleResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteConnectionGroupRole + * @param orgId Organization ID (required) + * @param connId Organization Connection ID (required) + * @param groupRoleId Organization Connection Group Role ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteConnectionGroupRoleCall(String orgId, String connId, String groupRoleId, 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 = "/v2/manage/organizations/{orgId}/connections/{connId}/grouproles/{groupRoleId}" + .replace("{" + "orgId" + "}", localVarApiClient.escapeString(orgId.toString())) + .replace("{" + "connId" + "}", localVarApiClient.escapeString(connId.toString())) + .replace("{" + "groupRoleId" + "}", localVarApiClient.escapeString(groupRoleId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteConnectionGroupRoleValidateBeforeCall(String orgId, String connId, String groupRoleId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'orgId' is set + if (orgId == null) { + throw new ApiException("Missing the required parameter 'orgId' when calling deleteConnectionGroupRole(Async)"); + } + + // verify the required parameter 'connId' is set + if (connId == null) { + throw new ApiException("Missing the required parameter 'connId' when calling deleteConnectionGroupRole(Async)"); + } + + // verify the required parameter 'groupRoleId' is set + if (groupRoleId == null) { + throw new ApiException("Missing the required parameter 'groupRoleId' when calling deleteConnectionGroupRole(Async)"); + } + + return deleteConnectionGroupRoleCall(orgId, connId, groupRoleId, _callback); + + } + + /** + * Delete Organization connection group Role + * Deletes a specific group-to-role mapping. + * @param orgId Organization ID (required) + * @param connId Organization Connection ID (required) + * @param groupRoleId Organization Connection Group Role ID (required) + * @return DeleteResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public DeleteResponse deleteConnectionGroupRole(String orgId, String connId, String groupRoleId) throws ApiException { + ApiResponse<DeleteResponse> localVarResp = deleteConnectionGroupRoleWithHttpInfo(orgId, connId, groupRoleId); + return localVarResp.getData(); + } + + /** + * Delete Organization connection group Role + * Deletes a specific group-to-role mapping. + * @param orgId Organization ID (required) + * @param connId Organization Connection ID (required) + * @param groupRoleId Organization Connection Group Role ID (required) + * @return ApiResponse<DeleteResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DeleteResponse> deleteConnectionGroupRoleWithHttpInfo(String orgId, String connId, String groupRoleId) throws ApiException { + okhttp3.Call localVarCall = deleteConnectionGroupRoleValidateBeforeCall(orgId, connId, groupRoleId, null); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Organization connection group Role (asynchronously) + * Deletes a specific group-to-role mapping. + * @param orgId Organization ID (required) + * @param connId Organization Connection ID (required) + * @param groupRoleId Organization Connection Group Role ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteConnectionGroupRoleAsync(String orgId, String connId, String groupRoleId, final ApiCallback<DeleteResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteConnectionGroupRoleValidateBeforeCall(orgId, connId, groupRoleId, _callback); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAllConnectionGroupRoles + * @param orgId Organization ID (required) + * @param connId Organization Connection ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllConnectionGroupRolesCall(String orgId, String connId, 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 = "/v2/manage/organizations/{orgId}/connections/{connId}/grouproles" + .replace("{" + "orgId" + "}", localVarApiClient.escapeString(orgId.toString())) + .replace("{" + "connId" + "}", localVarApiClient.escapeString(connId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAllConnectionGroupRolesValidateBeforeCall(String orgId, String connId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'orgId' is set + if (orgId == null) { + throw new ApiException("Missing the required parameter 'orgId' when calling getAllConnectionGroupRoles(Async)"); + } + + // verify the required parameter 'connId' is set + if (connId == null) { + throw new ApiException("Missing the required parameter 'connId' when calling getAllConnectionGroupRoles(Async)"); + } + + return getAllConnectionGroupRolesCall(orgId, connId, _callback); + + } + + /** + * List Organization connection group Roles + * Lists all group-to-role mappings for an Identity Provider connection. + * @param orgId Organization ID (required) + * @param connId Organization Connection ID (required) + * @return GetAllConnectionGroupRoles200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public GetAllConnectionGroupRoles200Response getAllConnectionGroupRoles(String orgId, String connId) throws ApiException { + ApiResponse<GetAllConnectionGroupRoles200Response> localVarResp = getAllConnectionGroupRolesWithHttpInfo(orgId, connId); + return localVarResp.getData(); + } + + /** + * List Organization connection group Roles + * Lists all group-to-role mappings for an Identity Provider connection. + * @param orgId Organization ID (required) + * @param connId Organization Connection ID (required) + * @return ApiResponse<GetAllConnectionGroupRoles200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetAllConnectionGroupRoles200Response> getAllConnectionGroupRolesWithHttpInfo(String orgId, String connId) throws ApiException { + okhttp3.Call localVarCall = getAllConnectionGroupRolesValidateBeforeCall(orgId, connId, null); + Type localVarReturnType = new TypeToken<GetAllConnectionGroupRoles200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Organization connection group Roles (asynchronously) + * Lists all group-to-role mappings for an Identity Provider connection. + * @param orgId Organization ID (required) + * @param connId Organization Connection ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllConnectionGroupRolesAsync(String orgId, String connId, final ApiCallback<GetAllConnectionGroupRoles200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getAllConnectionGroupRolesValidateBeforeCall(orgId, connId, _callback); + Type localVarReturnType = new TypeToken<GetAllConnectionGroupRoles200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateConnectionGroupRole + * @param connId Organization Connection ID (required) + * @param groupRoleId Organization Connection Group Role ID (required) + * @param orgId Organization ID (required) + * @param connectionGroupRoleRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateConnectionGroupRoleCall(String connId, String groupRoleId, String orgId, ConnectionGroupRoleRequest connectionGroupRoleRequest, 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 = connectionGroupRoleRequest; + + // create path and map variables + String localVarPath = "/v2/manage/organizations/{orgId}/connections/{connId}/grouproles/{groupRoleId}" + .replace("{" + "connId" + "}", localVarApiClient.escapeString(connId.toString())) + .replace("{" + "groupRoleId" + "}", localVarApiClient.escapeString(groupRoleId.toString())) + .replace("{" + "orgId" + "}", localVarApiClient.escapeString(orgId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateConnectionGroupRoleValidateBeforeCall(String connId, String groupRoleId, String orgId, ConnectionGroupRoleRequest connectionGroupRoleRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'connId' is set + if (connId == null) { + throw new ApiException("Missing the required parameter 'connId' when calling updateConnectionGroupRole(Async)"); + } + + // verify the required parameter 'groupRoleId' is set + if (groupRoleId == null) { + throw new ApiException("Missing the required parameter 'groupRoleId' when calling updateConnectionGroupRole(Async)"); + } + + // verify the required parameter 'orgId' is set + if (orgId == null) { + throw new ApiException("Missing the required parameter 'orgId' when calling updateConnectionGroupRole(Async)"); + } + + // verify the required parameter 'connectionGroupRoleRequest' is set + if (connectionGroupRoleRequest == null) { + throw new ApiException("Missing the required parameter 'connectionGroupRoleRequest' when calling updateConnectionGroupRole(Async)"); + } + + return updateConnectionGroupRoleCall(connId, groupRoleId, orgId, connectionGroupRoleRequest, _callback); + + } + + /** + * Update Organization connection group Role + * Updates a specific group-to-role mapping. + * @param connId Organization Connection ID (required) + * @param groupRoleId Organization Connection Group Role ID (required) + * @param orgId Organization ID (required) + * @param connectionGroupRoleRequest (required) + * @return ConnectionGroupRoleResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ConnectionGroupRoleResponse updateConnectionGroupRole(String connId, String groupRoleId, String orgId, ConnectionGroupRoleRequest connectionGroupRoleRequest) throws ApiException { + ApiResponse<ConnectionGroupRoleResponse> localVarResp = updateConnectionGroupRoleWithHttpInfo(connId, groupRoleId, orgId, connectionGroupRoleRequest); + return localVarResp.getData(); + } + + /** + * Update Organization connection group Role + * Updates a specific group-to-role mapping. + * @param connId Organization Connection ID (required) + * @param groupRoleId Organization Connection Group Role ID (required) + * @param orgId Organization ID (required) + * @param connectionGroupRoleRequest (required) + * @return ApiResponse<ConnectionGroupRoleResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<ConnectionGroupRoleResponse> updateConnectionGroupRoleWithHttpInfo(String connId, String groupRoleId, String orgId, ConnectionGroupRoleRequest connectionGroupRoleRequest) throws ApiException { + okhttp3.Call localVarCall = updateConnectionGroupRoleValidateBeforeCall(connId, groupRoleId, orgId, connectionGroupRoleRequest, null); + Type localVarReturnType = new TypeToken<ConnectionGroupRoleResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Organization connection group Role (asynchronously) + * Updates a specific group-to-role mapping. + * @param connId Organization Connection ID (required) + * @param groupRoleId Organization Connection Group Role ID (required) + * @param orgId Organization ID (required) + * @param connectionGroupRoleRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateConnectionGroupRoleAsync(String connId, String groupRoleId, String orgId, ConnectionGroupRoleRequest connectionGroupRoleRequest, final ApiCallback<ConnectionGroupRoleResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateConnectionGroupRoleValidateBeforeCall(connId, groupRoleId, orgId, connectionGroupRoleRequest, _callback); + Type localVarReturnType = new TypeToken<ConnectionGroupRoleResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/OrganizationConnectionsApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/OrganizationConnectionsApi.java new file mode 100644 index 0000000..0e7ae89 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/OrganizationConnectionsApi.java @@ -0,0 +1,1022 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.ConnectionResponse; +import com.loginradius.sdk.internal.openapi.model.ConnectionStatusRequest; +import com.loginradius.sdk.internal.openapi.model.ConnectionStatusResponse; +import com.loginradius.sdk.internal.openapi.model.DeleteResponse; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.GetAllOrganizationConnections200Response; +import com.loginradius.sdk.internal.openapi.model.OrganizationConnectionCreateRequest; +import com.loginradius.sdk.internal.openapi.model.OrganizationConnectionRequest; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class OrganizationConnectionsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public OrganizationConnectionsApi() { + this(Configuration.getDefaultApiClient()); + } + + public OrganizationConnectionsApi(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 createOrganizationConnection + * @param orgId Organization ID (required) + * @param organizationConnectionCreateRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createOrganizationConnectionCall(String orgId, OrganizationConnectionCreateRequest organizationConnectionCreateRequest, 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 = organizationConnectionCreateRequest; + + // create path and map variables + String localVarPath = "/v2/manage/organizations/{orgId}/connections" + .replace("{" + "orgId" + "}", localVarApiClient.escapeString(orgId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createOrganizationConnectionValidateBeforeCall(String orgId, OrganizationConnectionCreateRequest organizationConnectionCreateRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'orgId' is set + if (orgId == null) { + throw new ApiException("Missing the required parameter 'orgId' when calling createOrganizationConnection(Async)"); + } + + // verify the required parameter 'organizationConnectionCreateRequest' is set + if (organizationConnectionCreateRequest == null) { + throw new ApiException("Missing the required parameter 'organizationConnectionCreateRequest' when calling createOrganizationConnection(Async)"); + } + + return createOrganizationConnectionCall(orgId, organizationConnectionCreateRequest, _callback); + + } + + /** + * Create Organization connection + * Creates a new Identity Provider connection for an Organization. + * @param orgId Organization ID (required) + * @param organizationConnectionCreateRequest (required) + * @return ConnectionResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ConnectionResponse createOrganizationConnection(String orgId, OrganizationConnectionCreateRequest organizationConnectionCreateRequest) throws ApiException { + ApiResponse<ConnectionResponse> localVarResp = createOrganizationConnectionWithHttpInfo(orgId, organizationConnectionCreateRequest); + return localVarResp.getData(); + } + + /** + * Create Organization connection + * Creates a new Identity Provider connection for an Organization. + * @param orgId Organization ID (required) + * @param organizationConnectionCreateRequest (required) + * @return ApiResponse<ConnectionResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<ConnectionResponse> createOrganizationConnectionWithHttpInfo(String orgId, OrganizationConnectionCreateRequest organizationConnectionCreateRequest) throws ApiException { + okhttp3.Call localVarCall = createOrganizationConnectionValidateBeforeCall(orgId, organizationConnectionCreateRequest, null); + Type localVarReturnType = new TypeToken<ConnectionResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Organization connection (asynchronously) + * Creates a new Identity Provider connection for an Organization. + * @param orgId Organization ID (required) + * @param organizationConnectionCreateRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createOrganizationConnectionAsync(String orgId, OrganizationConnectionCreateRequest organizationConnectionCreateRequest, final ApiCallback<ConnectionResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = createOrganizationConnectionValidateBeforeCall(orgId, organizationConnectionCreateRequest, _callback); + Type localVarReturnType = new TypeToken<ConnectionResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteOrganizationConnection + * @param orgId Organization ID (required) + * @param connId Organization Connection ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteOrganizationConnectionCall(String orgId, String connId, 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 = "/v2/manage/organizations/{orgId}/connections/{connId}" + .replace("{" + "orgId" + "}", localVarApiClient.escapeString(orgId.toString())) + .replace("{" + "connId" + "}", localVarApiClient.escapeString(connId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteOrganizationConnectionValidateBeforeCall(String orgId, String connId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'orgId' is set + if (orgId == null) { + throw new ApiException("Missing the required parameter 'orgId' when calling deleteOrganizationConnection(Async)"); + } + + // verify the required parameter 'connId' is set + if (connId == null) { + throw new ApiException("Missing the required parameter 'connId' when calling deleteOrganizationConnection(Async)"); + } + + return deleteOrganizationConnectionCall(orgId, connId, _callback); + + } + + /** + * Delete Organization connection + * Deletes an Identity Provider connection from an Organization. + * @param orgId Organization ID (required) + * @param connId Organization Connection ID (required) + * @return DeleteResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public DeleteResponse deleteOrganizationConnection(String orgId, String connId) throws ApiException { + ApiResponse<DeleteResponse> localVarResp = deleteOrganizationConnectionWithHttpInfo(orgId, connId); + return localVarResp.getData(); + } + + /** + * Delete Organization connection + * Deletes an Identity Provider connection from an Organization. + * @param orgId Organization ID (required) + * @param connId Organization Connection ID (required) + * @return ApiResponse<DeleteResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DeleteResponse> deleteOrganizationConnectionWithHttpInfo(String orgId, String connId) throws ApiException { + okhttp3.Call localVarCall = deleteOrganizationConnectionValidateBeforeCall(orgId, connId, null); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Organization connection (asynchronously) + * Deletes an Identity Provider connection from an Organization. + * @param orgId Organization ID (required) + * @param connId Organization Connection ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteOrganizationConnectionAsync(String orgId, String connId, final ApiCallback<DeleteResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteOrganizationConnectionValidateBeforeCall(orgId, connId, _callback); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAllOrganizationConnections + * @param orgId Organization ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllOrganizationConnectionsCall(String orgId, 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 = "/v2/manage/organizations/{orgId}/connections" + .replace("{" + "orgId" + "}", localVarApiClient.escapeString(orgId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAllOrganizationConnectionsValidateBeforeCall(String orgId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'orgId' is set + if (orgId == null) { + throw new ApiException("Missing the required parameter 'orgId' when calling getAllOrganizationConnections(Async)"); + } + + return getAllOrganizationConnectionsCall(orgId, _callback); + + } + + /** + * List Organization connections + * Lists all Identity Provider connections for an Organization. + * @param orgId Organization ID (required) + * @return GetAllOrganizationConnections200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public GetAllOrganizationConnections200Response getAllOrganizationConnections(String orgId) throws ApiException { + ApiResponse<GetAllOrganizationConnections200Response> localVarResp = getAllOrganizationConnectionsWithHttpInfo(orgId); + return localVarResp.getData(); + } + + /** + * List Organization connections + * Lists all Identity Provider connections for an Organization. + * @param orgId Organization ID (required) + * @return ApiResponse<GetAllOrganizationConnections200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetAllOrganizationConnections200Response> getAllOrganizationConnectionsWithHttpInfo(String orgId) throws ApiException { + okhttp3.Call localVarCall = getAllOrganizationConnectionsValidateBeforeCall(orgId, null); + Type localVarReturnType = new TypeToken<GetAllOrganizationConnections200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Organization connections (asynchronously) + * Lists all Identity Provider connections for an Organization. + * @param orgId Organization ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllOrganizationConnectionsAsync(String orgId, final ApiCallback<GetAllOrganizationConnections200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getAllOrganizationConnectionsValidateBeforeCall(orgId, _callback); + Type localVarReturnType = new TypeToken<GetAllOrganizationConnections200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getOrganizationConnection + * @param orgId Organization ID (required) + * @param connId Organization Connection ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOrganizationConnectionCall(String orgId, String connId, 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 = "/v2/manage/organizations/{orgId}/connections/{connId}" + .replace("{" + "orgId" + "}", localVarApiClient.escapeString(orgId.toString())) + .replace("{" + "connId" + "}", localVarApiClient.escapeString(connId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOrganizationConnectionValidateBeforeCall(String orgId, String connId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'orgId' is set + if (orgId == null) { + throw new ApiException("Missing the required parameter 'orgId' when calling getOrganizationConnection(Async)"); + } + + // verify the required parameter 'connId' is set + if (connId == null) { + throw new ApiException("Missing the required parameter 'connId' when calling getOrganizationConnection(Async)"); + } + + return getOrganizationConnectionCall(orgId, connId, _callback); + + } + + /** + * Retrieve Organization connection + * Retrieves details of a specific Identity Provider connection. + * @param orgId Organization ID (required) + * @param connId Organization Connection ID (required) + * @return ConnectionResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ConnectionResponse getOrganizationConnection(String orgId, String connId) throws ApiException { + ApiResponse<ConnectionResponse> localVarResp = getOrganizationConnectionWithHttpInfo(orgId, connId); + return localVarResp.getData(); + } + + /** + * Retrieve Organization connection + * Retrieves details of a specific Identity Provider connection. + * @param orgId Organization ID (required) + * @param connId Organization Connection ID (required) + * @return ApiResponse<ConnectionResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<ConnectionResponse> getOrganizationConnectionWithHttpInfo(String orgId, String connId) throws ApiException { + okhttp3.Call localVarCall = getOrganizationConnectionValidateBeforeCall(orgId, connId, null); + Type localVarReturnType = new TypeToken<ConnectionResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Organization connection (asynchronously) + * Retrieves details of a specific Identity Provider connection. + * @param orgId Organization ID (required) + * @param connId Organization Connection ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOrganizationConnectionAsync(String orgId, String connId, final ApiCallback<ConnectionResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getOrganizationConnectionValidateBeforeCall(orgId, connId, _callback); + Type localVarReturnType = new TypeToken<ConnectionResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateConnectionStatus + * @param orgId Organization ID (required) + * @param connId Organization Connection ID (required) + * @param connectionStatusRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateConnectionStatusCall(String orgId, String connId, ConnectionStatusRequest connectionStatusRequest, 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 = connectionStatusRequest; + + // create path and map variables + String localVarPath = "/v2/manage/organizations/{orgId}/connections/{connId}/status" + .replace("{" + "orgId" + "}", localVarApiClient.escapeString(orgId.toString())) + .replace("{" + "connId" + "}", localVarApiClient.escapeString(connId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateConnectionStatusValidateBeforeCall(String orgId, String connId, ConnectionStatusRequest connectionStatusRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'orgId' is set + if (orgId == null) { + throw new ApiException("Missing the required parameter 'orgId' when calling updateConnectionStatus(Async)"); + } + + // verify the required parameter 'connId' is set + if (connId == null) { + throw new ApiException("Missing the required parameter 'connId' when calling updateConnectionStatus(Async)"); + } + + // verify the required parameter 'connectionStatusRequest' is set + if (connectionStatusRequest == null) { + throw new ApiException("Missing the required parameter 'connectionStatusRequest' when calling updateConnectionStatus(Async)"); + } + + return updateConnectionStatusCall(orgId, connId, connectionStatusRequest, _callback); + + } + + /** + * Update Organization connection status + * Updates the active status of an Identity Provider connection. + * @param orgId Organization ID (required) + * @param connId Organization Connection ID (required) + * @param connectionStatusRequest (required) + * @return ConnectionStatusResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ConnectionStatusResponse updateConnectionStatus(String orgId, String connId, ConnectionStatusRequest connectionStatusRequest) throws ApiException { + ApiResponse<ConnectionStatusResponse> localVarResp = updateConnectionStatusWithHttpInfo(orgId, connId, connectionStatusRequest); + return localVarResp.getData(); + } + + /** + * Update Organization connection status + * Updates the active status of an Identity Provider connection. + * @param orgId Organization ID (required) + * @param connId Organization Connection ID (required) + * @param connectionStatusRequest (required) + * @return ApiResponse<ConnectionStatusResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<ConnectionStatusResponse> updateConnectionStatusWithHttpInfo(String orgId, String connId, ConnectionStatusRequest connectionStatusRequest) throws ApiException { + okhttp3.Call localVarCall = updateConnectionStatusValidateBeforeCall(orgId, connId, connectionStatusRequest, null); + Type localVarReturnType = new TypeToken<ConnectionStatusResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Organization connection status (asynchronously) + * Updates the active status of an Identity Provider connection. + * @param orgId Organization ID (required) + * @param connId Organization Connection ID (required) + * @param connectionStatusRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateConnectionStatusAsync(String orgId, String connId, ConnectionStatusRequest connectionStatusRequest, final ApiCallback<ConnectionStatusResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateConnectionStatusValidateBeforeCall(orgId, connId, connectionStatusRequest, _callback); + Type localVarReturnType = new TypeToken<ConnectionStatusResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateOrganizationConnection + * @param orgId Organization ID (required) + * @param connId Organization Connection ID (required) + * @param organizationConnectionRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateOrganizationConnectionCall(String orgId, String connId, OrganizationConnectionRequest organizationConnectionRequest, 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 = organizationConnectionRequest; + + // create path and map variables + String localVarPath = "/v2/manage/organizations/{orgId}/connections/{connId}" + .replace("{" + "orgId" + "}", localVarApiClient.escapeString(orgId.toString())) + .replace("{" + "connId" + "}", localVarApiClient.escapeString(connId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateOrganizationConnectionValidateBeforeCall(String orgId, String connId, OrganizationConnectionRequest organizationConnectionRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'orgId' is set + if (orgId == null) { + throw new ApiException("Missing the required parameter 'orgId' when calling updateOrganizationConnection(Async)"); + } + + // verify the required parameter 'connId' is set + if (connId == null) { + throw new ApiException("Missing the required parameter 'connId' when calling updateOrganizationConnection(Async)"); + } + + // verify the required parameter 'organizationConnectionRequest' is set + if (organizationConnectionRequest == null) { + throw new ApiException("Missing the required parameter 'organizationConnectionRequest' when calling updateOrganizationConnection(Async)"); + } + + return updateOrganizationConnectionCall(orgId, connId, organizationConnectionRequest, _callback); + + } + + /** + * Update Organization connection + * Updates the configuration of an Identity Provider connection. + * @param orgId Organization ID (required) + * @param connId Organization Connection ID (required) + * @param organizationConnectionRequest (required) + * @return ConnectionResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ConnectionResponse updateOrganizationConnection(String orgId, String connId, OrganizationConnectionRequest organizationConnectionRequest) throws ApiException { + ApiResponse<ConnectionResponse> localVarResp = updateOrganizationConnectionWithHttpInfo(orgId, connId, organizationConnectionRequest); + return localVarResp.getData(); + } + + /** + * Update Organization connection + * Updates the configuration of an Identity Provider connection. + * @param orgId Organization ID (required) + * @param connId Organization Connection ID (required) + * @param organizationConnectionRequest (required) + * @return ApiResponse<ConnectionResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<ConnectionResponse> updateOrganizationConnectionWithHttpInfo(String orgId, String connId, OrganizationConnectionRequest organizationConnectionRequest) throws ApiException { + okhttp3.Call localVarCall = updateOrganizationConnectionValidateBeforeCall(orgId, connId, organizationConnectionRequest, null); + Type localVarReturnType = new TypeToken<ConnectionResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Organization connection (asynchronously) + * Updates the configuration of an Identity Provider connection. + * @param orgId Organization ID (required) + * @param connId Organization Connection ID (required) + * @param organizationConnectionRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateOrganizationConnectionAsync(String orgId, String connId, OrganizationConnectionRequest organizationConnectionRequest, final ApiCallback<ConnectionResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateOrganizationConnectionValidateBeforeCall(orgId, connId, organizationConnectionRequest, _callback); + Type localVarReturnType = new TypeToken<ConnectionResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/OrganizationDomainsApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/OrganizationDomainsApi.java new file mode 100644 index 0000000..89f4cb3 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/OrganizationDomainsApi.java @@ -0,0 +1,834 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.AddOrganizationDomainRequest; +import com.loginradius.sdk.internal.openapi.model.DeleteResponse; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.GetAllOrganizationDomains200Response; +import com.loginradius.sdk.internal.openapi.model.OrganizationsDomainsResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class OrganizationDomainsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public OrganizationDomainsApi() { + this(Configuration.getDefaultApiClient()); + } + + public OrganizationDomainsApi(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 addOrganizationDomain + * @param orgId Organization ID (required) + * @param addOrganizationDomainRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call addOrganizationDomainCall(String orgId, AddOrganizationDomainRequest addOrganizationDomainRequest, 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 = addOrganizationDomainRequest; + + // create path and map variables + String localVarPath = "/v2/manage/organizations/{orgId}/domains" + .replace("{" + "orgId" + "}", localVarApiClient.escapeString(orgId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call addOrganizationDomainValidateBeforeCall(String orgId, AddOrganizationDomainRequest addOrganizationDomainRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'orgId' is set + if (orgId == null) { + throw new ApiException("Missing the required parameter 'orgId' when calling addOrganizationDomain(Async)"); + } + + // verify the required parameter 'addOrganizationDomainRequest' is set + if (addOrganizationDomainRequest == null) { + throw new ApiException("Missing the required parameter 'addOrganizationDomainRequest' when calling addOrganizationDomain(Async)"); + } + + return addOrganizationDomainCall(orgId, addOrganizationDomainRequest, _callback); + + } + + /** + * Add Organization domain + * Adds a new domain to an Organization. + * @param orgId Organization ID (required) + * @param addOrganizationDomainRequest (required) + * @return OrganizationsDomainsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public OrganizationsDomainsResponse addOrganizationDomain(String orgId, AddOrganizationDomainRequest addOrganizationDomainRequest) throws ApiException { + ApiResponse<OrganizationsDomainsResponse> localVarResp = addOrganizationDomainWithHttpInfo(orgId, addOrganizationDomainRequest); + return localVarResp.getData(); + } + + /** + * Add Organization domain + * Adds a new domain to an Organization. + * @param orgId Organization ID (required) + * @param addOrganizationDomainRequest (required) + * @return ApiResponse<OrganizationsDomainsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<OrganizationsDomainsResponse> addOrganizationDomainWithHttpInfo(String orgId, AddOrganizationDomainRequest addOrganizationDomainRequest) throws ApiException { + okhttp3.Call localVarCall = addOrganizationDomainValidateBeforeCall(orgId, addOrganizationDomainRequest, null); + Type localVarReturnType = new TypeToken<OrganizationsDomainsResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Add Organization domain (asynchronously) + * Adds a new domain to an Organization. + * @param orgId Organization ID (required) + * @param addOrganizationDomainRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call addOrganizationDomainAsync(String orgId, AddOrganizationDomainRequest addOrganizationDomainRequest, final ApiCallback<OrganizationsDomainsResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = addOrganizationDomainValidateBeforeCall(orgId, addOrganizationDomainRequest, _callback); + Type localVarReturnType = new TypeToken<OrganizationsDomainsResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteOrganizationDomain + * @param orgId Organization ID (required) + * @param domainId Organization Domain ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteOrganizationDomainCall(String orgId, String domainId, 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 = "/v2/manage/organizations/{orgId}/domains/{domainId}" + .replace("{" + "orgId" + "}", localVarApiClient.escapeString(orgId.toString())) + .replace("{" + "domainId" + "}", localVarApiClient.escapeString(domainId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteOrganizationDomainValidateBeforeCall(String orgId, String domainId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'orgId' is set + if (orgId == null) { + throw new ApiException("Missing the required parameter 'orgId' when calling deleteOrganizationDomain(Async)"); + } + + // verify the required parameter 'domainId' is set + if (domainId == null) { + throw new ApiException("Missing the required parameter 'domainId' when calling deleteOrganizationDomain(Async)"); + } + + return deleteOrganizationDomainCall(orgId, domainId, _callback); + + } + + /** + * Delete Organization domain + * Deletes a domain from an Organization. + * @param orgId Organization ID (required) + * @param domainId Organization Domain ID (required) + * @return DeleteResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public DeleteResponse deleteOrganizationDomain(String orgId, String domainId) throws ApiException { + ApiResponse<DeleteResponse> localVarResp = deleteOrganizationDomainWithHttpInfo(orgId, domainId); + return localVarResp.getData(); + } + + /** + * Delete Organization domain + * Deletes a domain from an Organization. + * @param orgId Organization ID (required) + * @param domainId Organization Domain ID (required) + * @return ApiResponse<DeleteResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DeleteResponse> deleteOrganizationDomainWithHttpInfo(String orgId, String domainId) throws ApiException { + okhttp3.Call localVarCall = deleteOrganizationDomainValidateBeforeCall(orgId, domainId, null); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Organization domain (asynchronously) + * Deletes a domain from an Organization. + * @param orgId Organization ID (required) + * @param domainId Organization Domain ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteOrganizationDomainAsync(String orgId, String domainId, final ApiCallback<DeleteResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteOrganizationDomainValidateBeforeCall(orgId, domainId, _callback); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAllOrganizationDomains + * @param orgId Organization ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllOrganizationDomainsCall(String orgId, 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 = "/v2/manage/organizations/{orgId}/domains" + .replace("{" + "orgId" + "}", localVarApiClient.escapeString(orgId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAllOrganizationDomainsValidateBeforeCall(String orgId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'orgId' is set + if (orgId == null) { + throw new ApiException("Missing the required parameter 'orgId' when calling getAllOrganizationDomains(Async)"); + } + + return getAllOrganizationDomainsCall(orgId, _callback); + + } + + /** + * List Organization domains + * Lists all domains associated with an Organization. + * @param orgId Organization ID (required) + * @return GetAllOrganizationDomains200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public GetAllOrganizationDomains200Response getAllOrganizationDomains(String orgId) throws ApiException { + ApiResponse<GetAllOrganizationDomains200Response> localVarResp = getAllOrganizationDomainsWithHttpInfo(orgId); + return localVarResp.getData(); + } + + /** + * List Organization domains + * Lists all domains associated with an Organization. + * @param orgId Organization ID (required) + * @return ApiResponse<GetAllOrganizationDomains200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetAllOrganizationDomains200Response> getAllOrganizationDomainsWithHttpInfo(String orgId) throws ApiException { + okhttp3.Call localVarCall = getAllOrganizationDomainsValidateBeforeCall(orgId, null); + Type localVarReturnType = new TypeToken<GetAllOrganizationDomains200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Organization domains (asynchronously) + * Lists all domains associated with an Organization. + * @param orgId Organization ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllOrganizationDomainsAsync(String orgId, final ApiCallback<GetAllOrganizationDomains200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getAllOrganizationDomainsValidateBeforeCall(orgId, _callback); + Type localVarReturnType = new TypeToken<GetAllOrganizationDomains200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getOrganizationDomain + * @param orgId Organization ID (required) + * @param domainId Organization Domain ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOrganizationDomainCall(String orgId, String domainId, 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 = "/v2/manage/organizations/{orgId}/domains/{domainId}" + .replace("{" + "orgId" + "}", localVarApiClient.escapeString(orgId.toString())) + .replace("{" + "domainId" + "}", localVarApiClient.escapeString(domainId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOrganizationDomainValidateBeforeCall(String orgId, String domainId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'orgId' is set + if (orgId == null) { + throw new ApiException("Missing the required parameter 'orgId' when calling getOrganizationDomain(Async)"); + } + + // verify the required parameter 'domainId' is set + if (domainId == null) { + throw new ApiException("Missing the required parameter 'domainId' when calling getOrganizationDomain(Async)"); + } + + return getOrganizationDomainCall(orgId, domainId, _callback); + + } + + /** + * Retrieve Organization domain + * Retrieves details of a specific Organization domain. + * @param orgId Organization ID (required) + * @param domainId Organization Domain ID (required) + * @return OrganizationsDomainsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public OrganizationsDomainsResponse getOrganizationDomain(String orgId, String domainId) throws ApiException { + ApiResponse<OrganizationsDomainsResponse> localVarResp = getOrganizationDomainWithHttpInfo(orgId, domainId); + return localVarResp.getData(); + } + + /** + * Retrieve Organization domain + * Retrieves details of a specific Organization domain. + * @param orgId Organization ID (required) + * @param domainId Organization Domain ID (required) + * @return ApiResponse<OrganizationsDomainsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<OrganizationsDomainsResponse> getOrganizationDomainWithHttpInfo(String orgId, String domainId) throws ApiException { + okhttp3.Call localVarCall = getOrganizationDomainValidateBeforeCall(orgId, domainId, null); + Type localVarReturnType = new TypeToken<OrganizationsDomainsResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Organization domain (asynchronously) + * Retrieves details of a specific Organization domain. + * @param orgId Organization ID (required) + * @param domainId Organization Domain ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOrganizationDomainAsync(String orgId, String domainId, final ApiCallback<OrganizationsDomainsResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getOrganizationDomainValidateBeforeCall(orgId, domainId, _callback); + Type localVarReturnType = new TypeToken<OrganizationsDomainsResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for verifyOrganizationDomain + * @param domainId Organization Domain ID (required) + * @param orgId Organization ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call verifyOrganizationDomainCall(String domainId, String orgId, 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 = "/v2/manage/organizations/{orgId}/domains/{domainId}" + .replace("{" + "domainId" + "}", localVarApiClient.escapeString(domainId.toString())) + .replace("{" + "orgId" + "}", localVarApiClient.escapeString(orgId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call verifyOrganizationDomainValidateBeforeCall(String domainId, String orgId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'domainId' is set + if (domainId == null) { + throw new ApiException("Missing the required parameter 'domainId' when calling verifyOrganizationDomain(Async)"); + } + + // verify the required parameter 'orgId' is set + if (orgId == null) { + throw new ApiException("Missing the required parameter 'orgId' when calling verifyOrganizationDomain(Async)"); + } + + return verifyOrganizationDomainCall(domainId, orgId, _callback); + + } + + /** + * Verify Organization domain + * Verifies the ownership of an Organization domain. + * @param domainId Organization Domain ID (required) + * @param orgId Organization ID (required) + * @return OrganizationsDomainsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public OrganizationsDomainsResponse verifyOrganizationDomain(String domainId, String orgId) throws ApiException { + ApiResponse<OrganizationsDomainsResponse> localVarResp = verifyOrganizationDomainWithHttpInfo(domainId, orgId); + return localVarResp.getData(); + } + + /** + * Verify Organization domain + * Verifies the ownership of an Organization domain. + * @param domainId Organization Domain ID (required) + * @param orgId Organization ID (required) + * @return ApiResponse<OrganizationsDomainsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<OrganizationsDomainsResponse> verifyOrganizationDomainWithHttpInfo(String domainId, String orgId) throws ApiException { + okhttp3.Call localVarCall = verifyOrganizationDomainValidateBeforeCall(domainId, orgId, null); + Type localVarReturnType = new TypeToken<OrganizationsDomainsResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Verify Organization domain (asynchronously) + * Verifies the ownership of an Organization domain. + * @param domainId Organization Domain ID (required) + * @param orgId Organization ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call verifyOrganizationDomainAsync(String domainId, String orgId, final ApiCallback<OrganizationsDomainsResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = verifyOrganizationDomainValidateBeforeCall(domainId, orgId, _callback); + Type localVarReturnType = new TypeToken<OrganizationsDomainsResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/OrganizationInvitationsApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/OrganizationInvitationsApi.java new file mode 100644 index 0000000..55eeac4 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/OrganizationInvitationsApi.java @@ -0,0 +1,828 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.GetInvitationsByOrgId200Response; +import com.loginradius.sdk.internal.openapi.model.Invitation; +import com.loginradius.sdk.internal.openapi.model.ResendInvitation; +import com.loginradius.sdk.internal.openapi.model.SendInvitation; +import com.loginradius.sdk.internal.openapi.model.UpdateInvitationByInvitationIdRequest; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class OrganizationInvitationsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public OrganizationInvitationsApi() { + this(Configuration.getDefaultApiClient()); + } + + public OrganizationInvitationsApi(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 deleteInvitationByInvitationId + * @param invitationid The ID of the invitation. The ID is typically in the format *inv_<unique_id>*, where *<unique_id>* is a string of alphanumeric characters. (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteInvitationByInvitationIdCall(String invitationid, 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 = "/v2/manage/invitations/{invitationid}" + .replace("{" + "invitationid" + "}", localVarApiClient.escapeString(invitationid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteInvitationByInvitationIdValidateBeforeCall(String invitationid, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'invitationid' is set + if (invitationid == null) { + throw new ApiException("Missing the required parameter 'invitationid' when calling deleteInvitationByInvitationId(Async)"); + } + + return deleteInvitationByInvitationIdCall(invitationid, _callback); + + } + + /** + * Delete invitation by ID + * Deletes or revokes an invitation by invitation ID. + * @param invitationid The ID of the invitation. The ID is typically in the format *inv_<unique_id>*, where *<unique_id>* is a string of alphanumeric characters. (required) + * @return Invitation + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public Invitation deleteInvitationByInvitationId(String invitationid) throws ApiException { + ApiResponse<Invitation> localVarResp = deleteInvitationByInvitationIdWithHttpInfo(invitationid); + return localVarResp.getData(); + } + + /** + * Delete invitation by ID + * Deletes or revokes an invitation by invitation ID. + * @param invitationid The ID of the invitation. The ID is typically in the format *inv_<unique_id>*, where *<unique_id>* is a string of alphanumeric characters. (required) + * @return ApiResponse<Invitation> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<Invitation> deleteInvitationByInvitationIdWithHttpInfo(String invitationid) throws ApiException { + okhttp3.Call localVarCall = deleteInvitationByInvitationIdValidateBeforeCall(invitationid, null); + Type localVarReturnType = new TypeToken<Invitation>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete invitation by ID (asynchronously) + * Deletes or revokes an invitation by invitation ID. + * @param invitationid The ID of the invitation. The ID is typically in the format *inv_<unique_id>*, where *<unique_id>* is a string of alphanumeric characters. (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteInvitationByInvitationIdAsync(String invitationid, final ApiCallback<Invitation> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteInvitationByInvitationIdValidateBeforeCall(invitationid, _callback); + Type localVarReturnType = new TypeToken<Invitation>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getInvitationsByOrgId + * @param orgid (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getInvitationsByOrgIdCall(String orgid, 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 = "/v2/manage/invitations"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (orgid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("orgid", orgid)); + } + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getInvitationsByOrgIdValidateBeforeCall(String orgid, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'orgid' is set + if (orgid == null) { + throw new ApiException("Missing the required parameter 'orgid' when calling getInvitationsByOrgId(Async)"); + } + + return getInvitationsByOrgIdCall(orgid, _callback); + + } + + /** + * List invitations by Organization ID + * Lists all invitations by Organization ID. + * @param orgid (required) + * @return GetInvitationsByOrgId200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public GetInvitationsByOrgId200Response getInvitationsByOrgId(String orgid) throws ApiException { + ApiResponse<GetInvitationsByOrgId200Response> localVarResp = getInvitationsByOrgIdWithHttpInfo(orgid); + return localVarResp.getData(); + } + + /** + * List invitations by Organization ID + * Lists all invitations by Organization ID. + * @param orgid (required) + * @return ApiResponse<GetInvitationsByOrgId200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetInvitationsByOrgId200Response> getInvitationsByOrgIdWithHttpInfo(String orgid) throws ApiException { + okhttp3.Call localVarCall = getInvitationsByOrgIdValidateBeforeCall(orgid, null); + Type localVarReturnType = new TypeToken<GetInvitationsByOrgId200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List invitations by Organization ID (asynchronously) + * Lists all invitations by Organization ID. + * @param orgid (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getInvitationsByOrgIdAsync(String orgid, final ApiCallback<GetInvitationsByOrgId200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getInvitationsByOrgIdValidateBeforeCall(orgid, _callback); + Type localVarReturnType = new TypeToken<GetInvitationsByOrgId200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for resendInvitationByInvitationId + * @param invitationid The ID of the invitation. The ID is typically in the format *inv_<unique_id>*, where *<unique_id>* is a string of alphanumeric characters. (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resendInvitationByInvitationIdCall(String invitationid, 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 = "/v2/manage/invitations/{invitationid}/resend" + .replace("{" + "invitationid" + "}", localVarApiClient.escapeString(invitationid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call resendInvitationByInvitationIdValidateBeforeCall(String invitationid, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'invitationid' is set + if (invitationid == null) { + throw new ApiException("Missing the required parameter 'invitationid' when calling resendInvitationByInvitationId(Async)"); + } + + return resendInvitationByInvitationIdCall(invitationid, _callback); + + } + + /** + * Resend invitation by ID + * Resends an invitation by invitation ID. + * @param invitationid The ID of the invitation. The ID is typically in the format *inv_<unique_id>*, where *<unique_id>* is a string of alphanumeric characters. (required) + * @return ResendInvitation + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ResendInvitation resendInvitationByInvitationId(String invitationid) throws ApiException { + ApiResponse<ResendInvitation> localVarResp = resendInvitationByInvitationIdWithHttpInfo(invitationid); + return localVarResp.getData(); + } + + /** + * Resend invitation by ID + * Resends an invitation by invitation ID. + * @param invitationid The ID of the invitation. The ID is typically in the format *inv_<unique_id>*, where *<unique_id>* is a string of alphanumeric characters. (required) + * @return ApiResponse<ResendInvitation> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<ResendInvitation> resendInvitationByInvitationIdWithHttpInfo(String invitationid) throws ApiException { + okhttp3.Call localVarCall = resendInvitationByInvitationIdValidateBeforeCall(invitationid, null); + Type localVarReturnType = new TypeToken<ResendInvitation>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Resend invitation by ID (asynchronously) + * Resends an invitation by invitation ID. + * @param invitationid The ID of the invitation. The ID is typically in the format *inv_<unique_id>*, where *<unique_id>* is a string of alphanumeric characters. (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resendInvitationByInvitationIdAsync(String invitationid, final ApiCallback<ResendInvitation> _callback) throws ApiException { + + okhttp3.Call localVarCall = resendInvitationByInvitationIdValidateBeforeCall(invitationid, _callback); + Type localVarReturnType = new TypeToken<ResendInvitation>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for sendInvitation + * @param sendInvitation (required) + * @param invitationUrl The URL to which the User will be redirected after accepting the invitation. This URL should be a valid URL and can include query parameters if needed. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Invitation sent successfully </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call sendInvitationCall(SendInvitation sendInvitation, String invitationUrl, 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 = sendInvitation; + + // create path and map variables + String localVarPath = "/v2/manage/invitations"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (invitationUrl != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("invitation_url", invitationUrl)); + } + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call sendInvitationValidateBeforeCall(SendInvitation sendInvitation, String invitationUrl, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'sendInvitation' is set + if (sendInvitation == null) { + throw new ApiException("Missing the required parameter 'sendInvitation' when calling sendInvitation(Async)"); + } + + return sendInvitationCall(sendInvitation, invitationUrl, _callback); + + } + + /** + * Send invitation + * Sends a new invitation. + * @param sendInvitation (required) + * @param invitationUrl The URL to which the User will be redirected after accepting the invitation. This URL should be a valid URL and can include query parameters if needed. (optional) + * @return Invitation + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Invitation sent successfully </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public Invitation sendInvitation(SendInvitation sendInvitation, String invitationUrl) throws ApiException { + ApiResponse<Invitation> localVarResp = sendInvitationWithHttpInfo(sendInvitation, invitationUrl); + return localVarResp.getData(); + } + + /** + * Send invitation + * Sends a new invitation. + * @param sendInvitation (required) + * @param invitationUrl The URL to which the User will be redirected after accepting the invitation. This URL should be a valid URL and can include query parameters if needed. (optional) + * @return ApiResponse<Invitation> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Invitation sent successfully </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<Invitation> sendInvitationWithHttpInfo(SendInvitation sendInvitation, String invitationUrl) throws ApiException { + okhttp3.Call localVarCall = sendInvitationValidateBeforeCall(sendInvitation, invitationUrl, null); + Type localVarReturnType = new TypeToken<Invitation>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Send invitation (asynchronously) + * Sends a new invitation. + * @param sendInvitation (required) + * @param invitationUrl The URL to which the User will be redirected after accepting the invitation. This URL should be a valid URL and can include query parameters if needed. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Invitation sent successfully </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call sendInvitationAsync(SendInvitation sendInvitation, String invitationUrl, final ApiCallback<Invitation> _callback) throws ApiException { + + okhttp3.Call localVarCall = sendInvitationValidateBeforeCall(sendInvitation, invitationUrl, _callback); + Type localVarReturnType = new TypeToken<Invitation>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateInvitationByInvitationId + * @param invitationid The ID of the invitation. The ID is typically in the format *inv_<unique_id>*, where *<unique_id>* is a string of alphanumeric characters. (required) + * @param updateInvitationByInvitationIdRequest (required) + * @param invitationUrl The URL to which the User will be redirected after accepting the invitation. This URL should be a valid URL and can include query parameters if needed. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateInvitationByInvitationIdCall(String invitationid, UpdateInvitationByInvitationIdRequest updateInvitationByInvitationIdRequest, String invitationUrl, 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 = updateInvitationByInvitationIdRequest; + + // create path and map variables + String localVarPath = "/v2/manage/invitations/{invitationid}" + .replace("{" + "invitationid" + "}", localVarApiClient.escapeString(invitationid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (invitationUrl != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("invitation_url", invitationUrl)); + } + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateInvitationByInvitationIdValidateBeforeCall(String invitationid, UpdateInvitationByInvitationIdRequest updateInvitationByInvitationIdRequest, String invitationUrl, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'invitationid' is set + if (invitationid == null) { + throw new ApiException("Missing the required parameter 'invitationid' when calling updateInvitationByInvitationId(Async)"); + } + + // verify the required parameter 'updateInvitationByInvitationIdRequest' is set + if (updateInvitationByInvitationIdRequest == null) { + throw new ApiException("Missing the required parameter 'updateInvitationByInvitationIdRequest' when calling updateInvitationByInvitationId(Async)"); + } + + return updateInvitationByInvitationIdCall(invitationid, updateInvitationByInvitationIdRequest, invitationUrl, _callback); + + } + + /** + * Update invitation by ID + * Updates invitation details by invitation ID. + * @param invitationid The ID of the invitation. The ID is typically in the format *inv_<unique_id>*, where *<unique_id>* is a string of alphanumeric characters. (required) + * @param updateInvitationByInvitationIdRequest (required) + * @param invitationUrl The URL to which the User will be redirected after accepting the invitation. This URL should be a valid URL and can include query parameters if needed. (optional) + * @return Invitation + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public Invitation updateInvitationByInvitationId(String invitationid, UpdateInvitationByInvitationIdRequest updateInvitationByInvitationIdRequest, String invitationUrl) throws ApiException { + ApiResponse<Invitation> localVarResp = updateInvitationByInvitationIdWithHttpInfo(invitationid, updateInvitationByInvitationIdRequest, invitationUrl); + return localVarResp.getData(); + } + + /** + * Update invitation by ID + * Updates invitation details by invitation ID. + * @param invitationid The ID of the invitation. The ID is typically in the format *inv_<unique_id>*, where *<unique_id>* is a string of alphanumeric characters. (required) + * @param updateInvitationByInvitationIdRequest (required) + * @param invitationUrl The URL to which the User will be redirected after accepting the invitation. This URL should be a valid URL and can include query parameters if needed. (optional) + * @return ApiResponse<Invitation> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<Invitation> updateInvitationByInvitationIdWithHttpInfo(String invitationid, UpdateInvitationByInvitationIdRequest updateInvitationByInvitationIdRequest, String invitationUrl) throws ApiException { + okhttp3.Call localVarCall = updateInvitationByInvitationIdValidateBeforeCall(invitationid, updateInvitationByInvitationIdRequest, invitationUrl, null); + Type localVarReturnType = new TypeToken<Invitation>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update invitation by ID (asynchronously) + * Updates invitation details by invitation ID. + * @param invitationid The ID of the invitation. The ID is typically in the format *inv_<unique_id>*, where *<unique_id>* is a string of alphanumeric characters. (required) + * @param updateInvitationByInvitationIdRequest (required) + * @param invitationUrl The URL to which the User will be redirected after accepting the invitation. This URL should be a valid URL and can include query parameters if needed. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateInvitationByInvitationIdAsync(String invitationid, UpdateInvitationByInvitationIdRequest updateInvitationByInvitationIdRequest, String invitationUrl, final ApiCallback<Invitation> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateInvitationByInvitationIdValidateBeforeCall(invitationid, updateInvitationByInvitationIdRequest, invitationUrl, _callback); + Type localVarReturnType = new TypeToken<Invitation>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/OrganizationUserRolesApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/OrganizationUserRolesApi.java new file mode 100644 index 0000000..141b313 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/OrganizationUserRolesApi.java @@ -0,0 +1,976 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.DeleteResponse; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.GetOrgContextByUid200Response; +import com.loginradius.sdk.internal.openapi.model.UserRolePutRequest; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class OrganizationUserRolesApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public OrganizationUserRolesApi() { + this(Configuration.getDefaultApiClient()); + } + + public OrganizationUserRolesApi(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 assignRolesToUser + * @param uid UID of the User (required) + * @param orgId Organization ID (required) + * @param userRolePutRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call assignRolesToUserCall(String uid, String orgId, UserRolePutRequest userRolePutRequest, 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 = userRolePutRequest; + + // create path and map variables + String localVarPath = "/v2/manage/account/{uid}/orgcontext/{orgId}/roles" + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())) + .replace("{" + "orgId" + "}", localVarApiClient.escapeString(orgId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call assignRolesToUserValidateBeforeCall(String uid, String orgId, UserRolePutRequest userRolePutRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling assignRolesToUser(Async)"); + } + + // verify the required parameter 'orgId' is set + if (orgId == null) { + throw new ApiException("Missing the required parameter 'orgId' when calling assignRolesToUser(Async)"); + } + + // verify the required parameter 'userRolePutRequest' is set + if (userRolePutRequest == null) { + throw new ApiException("Missing the required parameter 'userRolePutRequest' when calling assignRolesToUser(Async)"); + } + + return assignRolesToUserCall(uid, orgId, userRolePutRequest, _callback); + + } + + /** + * Assign Roles in Organization + * Assigns Roles to a User within a specific Organization. + * @param uid UID of the User (required) + * @param orgId Organization ID (required) + * @param userRolePutRequest (required) + * @return GetOrgContextByUid200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public GetOrgContextByUid200Response assignRolesToUser(String uid, String orgId, UserRolePutRequest userRolePutRequest) throws ApiException { + ApiResponse<GetOrgContextByUid200Response> localVarResp = assignRolesToUserWithHttpInfo(uid, orgId, userRolePutRequest); + return localVarResp.getData(); + } + + /** + * Assign Roles in Organization + * Assigns Roles to a User within a specific Organization. + * @param uid UID of the User (required) + * @param orgId Organization ID (required) + * @param userRolePutRequest (required) + * @return ApiResponse<GetOrgContextByUid200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetOrgContextByUid200Response> assignRolesToUserWithHttpInfo(String uid, String orgId, UserRolePutRequest userRolePutRequest) throws ApiException { + okhttp3.Call localVarCall = assignRolesToUserValidateBeforeCall(uid, orgId, userRolePutRequest, null); + Type localVarReturnType = new TypeToken<GetOrgContextByUid200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Assign Roles in Organization (asynchronously) + * Assigns Roles to a User within a specific Organization. + * @param uid UID of the User (required) + * @param orgId Organization ID (required) + * @param userRolePutRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call assignRolesToUserAsync(String uid, String orgId, UserRolePutRequest userRolePutRequest, final ApiCallback<GetOrgContextByUid200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = assignRolesToUserValidateBeforeCall(uid, orgId, userRolePutRequest, _callback); + Type localVarReturnType = new TypeToken<GetOrgContextByUid200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for assignRolesToUserInAllOrgs + * @param uid UID of the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call assignRolesToUserInAllOrgsCall(String uid, 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 = "/v2/manage/account/{uid}/orgcontext/roles" + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call assignRolesToUserInAllOrgsValidateBeforeCall(String uid, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling assignRolesToUserInAllOrgs(Async)"); + } + + return assignRolesToUserInAllOrgsCall(uid, _callback); + + } + + /** + * Assign Roles in Tenant + * Assigns Roles to a User within a Tenant. + * @param uid UID of the User (required) + * @return GetOrgContextByUid200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public GetOrgContextByUid200Response assignRolesToUserInAllOrgs(String uid) throws ApiException { + ApiResponse<GetOrgContextByUid200Response> localVarResp = assignRolesToUserInAllOrgsWithHttpInfo(uid); + return localVarResp.getData(); + } + + /** + * Assign Roles in Tenant + * Assigns Roles to a User within a Tenant. + * @param uid UID of the User (required) + * @return ApiResponse<GetOrgContextByUid200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetOrgContextByUid200Response> assignRolesToUserInAllOrgsWithHttpInfo(String uid) throws ApiException { + okhttp3.Call localVarCall = assignRolesToUserInAllOrgsValidateBeforeCall(uid, null); + Type localVarReturnType = new TypeToken<GetOrgContextByUid200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Assign Roles in Tenant (asynchronously) + * Assigns Roles to a User within a Tenant. + * @param uid UID of the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call assignRolesToUserInAllOrgsAsync(String uid, final ApiCallback<GetOrgContextByUid200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = assignRolesToUserInAllOrgsValidateBeforeCall(uid, _callback); + Type localVarReturnType = new TypeToken<GetOrgContextByUid200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteOrgContextByUid + * @param uid UID of the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteOrgContextByUidCall(String uid, 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 = "/v2/manage/account/{uid}/orgcontext" + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteOrgContextByUidValidateBeforeCall(String uid, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling deleteOrgContextByUid(Async)"); + } + + return deleteOrgContextByUidCall(uid, _callback); + + } + + /** + * Delete Organization context by UID + * Deletes User Roles for all Organizations by UID. + * @param uid UID of the User (required) + * @return DeleteResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public DeleteResponse deleteOrgContextByUid(String uid) throws ApiException { + ApiResponse<DeleteResponse> localVarResp = deleteOrgContextByUidWithHttpInfo(uid); + return localVarResp.getData(); + } + + /** + * Delete Organization context by UID + * Deletes User Roles for all Organizations by UID. + * @param uid UID of the User (required) + * @return ApiResponse<DeleteResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DeleteResponse> deleteOrgContextByUidWithHttpInfo(String uid) throws ApiException { + okhttp3.Call localVarCall = deleteOrgContextByUidValidateBeforeCall(uid, null); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Organization context by UID (asynchronously) + * Deletes User Roles for all Organizations by UID. + * @param uid UID of the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteOrgContextByUidAsync(String uid, final ApiCallback<DeleteResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteOrgContextByUidValidateBeforeCall(uid, _callback); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteOrgContextByUidAndOrgId + * @param uid UID of the User (required) + * @param orgId Organization ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteOrgContextByUidAndOrgIdCall(String uid, String orgId, 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 = "/v2/manage/account/{uid}/orgcontext/{orgId}" + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())) + .replace("{" + "orgId" + "}", localVarApiClient.escapeString(orgId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteOrgContextByUidAndOrgIdValidateBeforeCall(String uid, String orgId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling deleteOrgContextByUidAndOrgId(Async)"); + } + + // verify the required parameter 'orgId' is set + if (orgId == null) { + throw new ApiException("Missing the required parameter 'orgId' when calling deleteOrgContextByUidAndOrgId(Async)"); + } + + return deleteOrgContextByUidAndOrgIdCall(uid, orgId, _callback); + + } + + /** + * Delete Organization Roles by OrgID and UID + * Deletes User Roles of an Organization by UID and OrgID. + * @param uid UID of the User (required) + * @param orgId Organization ID (required) + * @return DeleteResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public DeleteResponse deleteOrgContextByUidAndOrgId(String uid, String orgId) throws ApiException { + ApiResponse<DeleteResponse> localVarResp = deleteOrgContextByUidAndOrgIdWithHttpInfo(uid, orgId); + return localVarResp.getData(); + } + + /** + * Delete Organization Roles by OrgID and UID + * Deletes User Roles of an Organization by UID and OrgID. + * @param uid UID of the User (required) + * @param orgId Organization ID (required) + * @return ApiResponse<DeleteResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DeleteResponse> deleteOrgContextByUidAndOrgIdWithHttpInfo(String uid, String orgId) throws ApiException { + okhttp3.Call localVarCall = deleteOrgContextByUidAndOrgIdValidateBeforeCall(uid, orgId, null); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Organization Roles by OrgID and UID (asynchronously) + * Deletes User Roles of an Organization by UID and OrgID. + * @param uid UID of the User (required) + * @param orgId Organization ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteOrgContextByUidAndOrgIdAsync(String uid, String orgId, final ApiCallback<DeleteResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteOrgContextByUidAndOrgIdValidateBeforeCall(uid, orgId, _callback); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getOrgContextByUid + * @param uid UID of the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOrgContextByUidCall(String uid, 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 = "/v2/manage/account/{uid}/orgcontext" + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOrgContextByUidValidateBeforeCall(String uid, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling getOrgContextByUid(Async)"); + } + + return getOrgContextByUidCall(uid, _callback); + + } + + /** + * Retrieve Organization context by UID + * Retrieves User Roles for all Organizations by UID. + * @param uid UID of the User (required) + * @return GetOrgContextByUid200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public GetOrgContextByUid200Response getOrgContextByUid(String uid) throws ApiException { + ApiResponse<GetOrgContextByUid200Response> localVarResp = getOrgContextByUidWithHttpInfo(uid); + return localVarResp.getData(); + } + + /** + * Retrieve Organization context by UID + * Retrieves User Roles for all Organizations by UID. + * @param uid UID of the User (required) + * @return ApiResponse<GetOrgContextByUid200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetOrgContextByUid200Response> getOrgContextByUidWithHttpInfo(String uid) throws ApiException { + okhttp3.Call localVarCall = getOrgContextByUidValidateBeforeCall(uid, null); + Type localVarReturnType = new TypeToken<GetOrgContextByUid200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Organization context by UID (asynchronously) + * Retrieves User Roles for all Organizations by UID. + * @param uid UID of the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOrgContextByUidAsync(String uid, final ApiCallback<GetOrgContextByUid200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getOrgContextByUidValidateBeforeCall(uid, _callback); + Type localVarReturnType = new TypeToken<GetOrgContextByUid200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getOrgContextByUidAndOrgId + * @param uid UID of the User (required) + * @param orgId Organization ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOrgContextByUidAndOrgIdCall(String uid, String orgId, 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 = "/v2/manage/account/{uid}/orgcontext/{orgId}" + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())) + .replace("{" + "orgId" + "}", localVarApiClient.escapeString(orgId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getOrgContextByUidAndOrgIdValidateBeforeCall(String uid, String orgId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling getOrgContextByUidAndOrgId(Async)"); + } + + // verify the required parameter 'orgId' is set + if (orgId == null) { + throw new ApiException("Missing the required parameter 'orgId' when calling getOrgContextByUidAndOrgId(Async)"); + } + + return getOrgContextByUidAndOrgIdCall(uid, orgId, _callback); + + } + + /** + * Retrieve Organization Roles by OrgID and UID + * Retrieves User Roles of an Organization by UID and OrgID. + * @param uid UID of the User (required) + * @param orgId Organization ID (required) + * @return GetOrgContextByUid200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public GetOrgContextByUid200Response getOrgContextByUidAndOrgId(String uid, String orgId) throws ApiException { + ApiResponse<GetOrgContextByUid200Response> localVarResp = getOrgContextByUidAndOrgIdWithHttpInfo(uid, orgId); + return localVarResp.getData(); + } + + /** + * Retrieve Organization Roles by OrgID and UID + * Retrieves User Roles of an Organization by UID and OrgID. + * @param uid UID of the User (required) + * @param orgId Organization ID (required) + * @return ApiResponse<GetOrgContextByUid200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetOrgContextByUid200Response> getOrgContextByUidAndOrgIdWithHttpInfo(String uid, String orgId) throws ApiException { + okhttp3.Call localVarCall = getOrgContextByUidAndOrgIdValidateBeforeCall(uid, orgId, null); + Type localVarReturnType = new TypeToken<GetOrgContextByUid200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Organization Roles by OrgID and UID (asynchronously) + * Retrieves User Roles of an Organization by UID and OrgID. + * @param uid UID of the User (required) + * @param orgId Organization ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getOrgContextByUidAndOrgIdAsync(String uid, String orgId, final ApiCallback<GetOrgContextByUid200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getOrgContextByUidAndOrgIdValidateBeforeCall(uid, orgId, _callback); + Type localVarReturnType = new TypeToken<GetOrgContextByUid200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/PasskeyConfigurationApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/PasskeyConfigurationApi.java new file mode 100644 index 0000000..a4f9e44 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/PasskeyConfigurationApi.java @@ -0,0 +1,340 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.PassKeyConfig; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class PasskeyConfigurationApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public PasskeyConfigurationApi() { + this(Configuration.getDefaultApiClient()); + } + + public PasskeyConfigurationApi(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 getPassKeyConfig + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getPassKeyConfigCall(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 = "/v2/manage/passkey"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPassKeyConfigValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getPassKeyConfigCall(_callback); + + } + + /** + * Retrieve Passkey configuration + * Retrieves the current Passkey configuration settings for the Tenant. + * @return PassKeyConfig + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public PassKeyConfig getPassKeyConfig() throws ApiException { + ApiResponse<PassKeyConfig> localVarResp = getPassKeyConfigWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Retrieve Passkey configuration + * Retrieves the current Passkey configuration settings for the Tenant. + * @return ApiResponse<PassKeyConfig> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<PassKeyConfig> getPassKeyConfigWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getPassKeyConfigValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<PassKeyConfig>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Passkey configuration (asynchronously) + * Retrieves the current Passkey configuration settings for the Tenant. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getPassKeyConfigAsync(final ApiCallback<PassKeyConfig> _callback) throws ApiException { + + okhttp3.Call localVarCall = getPassKeyConfigValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<PassKeyConfig>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for upsertPassKeyConfig + * @param passKeyConfig (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call upsertPassKeyConfigCall(PassKeyConfig passKeyConfig, 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 = passKeyConfig; + + // create path and map variables + String localVarPath = "/v2/manage/passkey"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call upsertPassKeyConfigValidateBeforeCall(PassKeyConfig passKeyConfig, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'passKeyConfig' is set + if (passKeyConfig == null) { + throw new ApiException("Missing the required parameter 'passKeyConfig' when calling upsertPassKeyConfig(Async)"); + } + + return upsertPassKeyConfigCall(passKeyConfig, _callback); + + } + + /** + * Update Passkey configuration + * Creates or updates the Passkey configuration settings for the Tenant. + * @param passKeyConfig (required) + * @return PassKeyConfig + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public PassKeyConfig upsertPassKeyConfig(PassKeyConfig passKeyConfig) throws ApiException { + ApiResponse<PassKeyConfig> localVarResp = upsertPassKeyConfigWithHttpInfo(passKeyConfig); + return localVarResp.getData(); + } + + /** + * Update Passkey configuration + * Creates or updates the Passkey configuration settings for the Tenant. + * @param passKeyConfig (required) + * @return ApiResponse<PassKeyConfig> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<PassKeyConfig> upsertPassKeyConfigWithHttpInfo(PassKeyConfig passKeyConfig) throws ApiException { + okhttp3.Call localVarCall = upsertPassKeyConfigValidateBeforeCall(passKeyConfig, null); + Type localVarReturnType = new TypeToken<PassKeyConfig>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Passkey configuration (asynchronously) + * Creates or updates the Passkey configuration settings for the Tenant. + * @param passKeyConfig (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call upsertPassKeyConfigAsync(PassKeyConfig passKeyConfig, final ApiCallback<PassKeyConfig> _callback) throws ApiException { + + okhttp3.Call localVarCall = upsertPassKeyConfigValidateBeforeCall(passKeyConfig, _callback); + Type localVarReturnType = new TypeToken<PassKeyConfig>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/PasswordApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/PasswordApi.java new file mode 100644 index 0000000..50d2721 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/PasswordApi.java @@ -0,0 +1,1430 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.ApiError; +import com.loginradius.sdk.internal.openapi.model.ChangePassword; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.ForgotPasswordPhoneModel; +import com.loginradius.sdk.internal.openapi.model.ForgotPasswordRequest; +import com.loginradius.sdk.internal.openapi.model.IsPostedResponse; +import com.loginradius.sdk.internal.openapi.model.ResetPassword; +import com.loginradius.sdk.internal.openapi.model.ResetPasswordBySecurityAnswer; +import com.loginradius.sdk.internal.openapi.model.ResetPasswordResponse; +import com.loginradius.sdk.internal.openapi.model.ResetPasswordWithOTP; +import com.loginradius.sdk.internal.openapi.model.SMSResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class PasswordApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public PasswordApi() { + this(Configuration.getDefaultApiClient()); + } + + public PasswordApi(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 changePassword + * @param changePassword (required) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @param accessToken Access Token of the User (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Password change successful </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call changePasswordCall(ChangePassword changePassword, String gRecaptchaResponse, String gRecaptchaResponse2, Boolean preventWebhook, Boolean xPreventWebhook, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, String accessToken, 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 = changePassword; + + // create path and map variables + String localVarPath = "/identity/v2/auth/password/change"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (gRecaptchaResponse2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g_recaptcha_response", gRecaptchaResponse2)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call changePasswordValidateBeforeCall(ChangePassword changePassword, String gRecaptchaResponse, String gRecaptchaResponse2, Boolean preventWebhook, Boolean xPreventWebhook, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, String accessToken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'changePassword' is set + if (changePassword == null) { + throw new ApiException("Missing the required parameter 'changePassword' when calling changePassword(Async)"); + } + + return changePasswordCall(changePassword, gRecaptchaResponse, gRecaptchaResponse2, preventWebhook, xPreventWebhook, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, accessToken, _callback); + + } + + /** + * Update Password + * Updates the Account Password using the current Password for verification. + * @param changePassword (required) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @param accessToken Access Token of the User (optional) + * @return IsPostedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Password change successful </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public IsPostedResponse changePassword(ChangePassword changePassword, String gRecaptchaResponse, String gRecaptchaResponse2, Boolean preventWebhook, Boolean xPreventWebhook, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, String accessToken) throws ApiException { + ApiResponse<IsPostedResponse> localVarResp = changePasswordWithHttpInfo(changePassword, gRecaptchaResponse, gRecaptchaResponse2, preventWebhook, xPreventWebhook, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, accessToken); + return localVarResp.getData(); + } + + /** + * Update Password + * Updates the Account Password using the current Password for verification. + * @param changePassword (required) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @param accessToken Access Token of the User (optional) + * @return ApiResponse<IsPostedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Password change successful </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedResponse> changePasswordWithHttpInfo(ChangePassword changePassword, String gRecaptchaResponse, String gRecaptchaResponse2, Boolean preventWebhook, Boolean xPreventWebhook, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, String accessToken) throws ApiException { + okhttp3.Call localVarCall = changePasswordValidateBeforeCall(changePassword, gRecaptchaResponse, gRecaptchaResponse2, preventWebhook, xPreventWebhook, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, accessToken, null); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Password (asynchronously) + * Updates the Account Password using the current Password for verification. + * @param changePassword (required) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @param accessToken Access Token of the User (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Password change successful </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call changePasswordAsync(ChangePassword changePassword, String gRecaptchaResponse, String gRecaptchaResponse2, Boolean preventWebhook, Boolean xPreventWebhook, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, String accessToken, final ApiCallback<IsPostedResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = changePasswordValidateBeforeCall(changePassword, gRecaptchaResponse, gRecaptchaResponse2, preventWebhook, xPreventWebhook, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, accessToken, _callback); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for forgotPassword + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param resetpasswordurl Callback URL for the Password Reset link in the Email. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param forgotPasswordRequest (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call forgotPasswordCall(String emailtemplate, String resetpasswordurl, Boolean preventWebhook, Boolean xPreventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, ForgotPasswordRequest forgotPasswordRequest, 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 = forgotPasswordRequest; + + // create path and map variables + String localVarPath = "/identity/v2/auth/password"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (emailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailtemplate", emailtemplate)); + } + + if (resetpasswordurl != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("resetpasswordurl", resetpasswordurl)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (gRecaptchaResponse2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g_recaptcha_response", gRecaptchaResponse2)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call forgotPasswordValidateBeforeCall(String emailtemplate, String resetpasswordurl, Boolean preventWebhook, Boolean xPreventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, ForgotPasswordRequest forgotPasswordRequest, final ApiCallback _callback) throws ApiException { + return forgotPasswordCall(emailtemplate, resetpasswordurl, preventWebhook, xPreventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, forgotPasswordRequest, _callback); + + } + + /** + * Forgot Password + * Initiates the Password recovery process using Username or Email. + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param resetpasswordurl Callback URL for the Password Reset link in the Email. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param forgotPasswordRequest (optional) + * @return IsPostedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public IsPostedResponse forgotPassword(String emailtemplate, String resetpasswordurl, Boolean preventWebhook, Boolean xPreventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, ForgotPasswordRequest forgotPasswordRequest) throws ApiException { + ApiResponse<IsPostedResponse> localVarResp = forgotPasswordWithHttpInfo(emailtemplate, resetpasswordurl, preventWebhook, xPreventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, forgotPasswordRequest); + return localVarResp.getData(); + } + + /** + * Forgot Password + * Initiates the Password recovery process using Username or Email. + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param resetpasswordurl Callback URL for the Password Reset link in the Email. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param forgotPasswordRequest (optional) + * @return ApiResponse<IsPostedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedResponse> forgotPasswordWithHttpInfo(String emailtemplate, String resetpasswordurl, Boolean preventWebhook, Boolean xPreventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, ForgotPasswordRequest forgotPasswordRequest) throws ApiException { + okhttp3.Call localVarCall = forgotPasswordValidateBeforeCall(emailtemplate, resetpasswordurl, preventWebhook, xPreventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, forgotPasswordRequest, null); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Forgot Password (asynchronously) + * Initiates the Password recovery process using Username or Email. + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param resetpasswordurl Callback URL for the Password Reset link in the Email. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param forgotPasswordRequest (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call forgotPasswordAsync(String emailtemplate, String resetpasswordurl, Boolean preventWebhook, Boolean xPreventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, ForgotPasswordRequest forgotPasswordRequest, final ApiCallback<IsPostedResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = forgotPasswordValidateBeforeCall(emailtemplate, resetpasswordurl, preventWebhook, xPreventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, forgotPasswordRequest, _callback); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for requestOTPForPasswordReset + * @param forgotPasswordPhoneModel (required) + * @param smstemplate SMS Template (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call requestOTPForPasswordResetCall(ForgotPasswordPhoneModel forgotPasswordPhoneModel, String smstemplate, String gRecaptchaResponse, String gRecaptchaResponse2, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, Boolean isvoiceotp, 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 = forgotPasswordPhoneModel; + + // create path and map variables + String localVarPath = "/identity/v2/auth/password/otp"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (smstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("smstemplate", smstemplate)); + } + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (gRecaptchaResponse2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g_recaptcha_response", gRecaptchaResponse2)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + if (isvoiceotp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("isvoiceotp", isvoiceotp)); + } + + 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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call requestOTPForPasswordResetValidateBeforeCall(ForgotPasswordPhoneModel forgotPasswordPhoneModel, String smstemplate, String gRecaptchaResponse, String gRecaptchaResponse2, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, Boolean isvoiceotp, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'forgotPasswordPhoneModel' is set + if (forgotPasswordPhoneModel == null) { + throw new ApiException("Missing the required parameter 'forgotPasswordPhoneModel' when calling requestOTPForPasswordReset(Async)"); + } + + return requestOTPForPasswordResetCall(forgotPasswordPhoneModel, smstemplate, gRecaptchaResponse, gRecaptchaResponse2, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, isvoiceotp, _callback); + + } + + /** + * Retrieve Password reset OTP + * Requests an OTP for resetting the Password using the User's Phone number. + * @param forgotPasswordPhoneModel (required) + * @param smstemplate SMS Template (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @return SMSResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public SMSResponse requestOTPForPasswordReset(ForgotPasswordPhoneModel forgotPasswordPhoneModel, String smstemplate, String gRecaptchaResponse, String gRecaptchaResponse2, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, Boolean isvoiceotp) throws ApiException { + ApiResponse<SMSResponse> localVarResp = requestOTPForPasswordResetWithHttpInfo(forgotPasswordPhoneModel, smstemplate, gRecaptchaResponse, gRecaptchaResponse2, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, isvoiceotp); + return localVarResp.getData(); + } + + /** + * Retrieve Password reset OTP + * Requests an OTP for resetting the Password using the User's Phone number. + * @param forgotPasswordPhoneModel (required) + * @param smstemplate SMS Template (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @return ApiResponse<SMSResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SMSResponse> requestOTPForPasswordResetWithHttpInfo(ForgotPasswordPhoneModel forgotPasswordPhoneModel, String smstemplate, String gRecaptchaResponse, String gRecaptchaResponse2, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, Boolean isvoiceotp) throws ApiException { + okhttp3.Call localVarCall = requestOTPForPasswordResetValidateBeforeCall(forgotPasswordPhoneModel, smstemplate, gRecaptchaResponse, gRecaptchaResponse2, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, isvoiceotp, null); + Type localVarReturnType = new TypeToken<SMSResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Password reset OTP (asynchronously) + * Requests an OTP for resetting the Password using the User's Phone number. + * @param forgotPasswordPhoneModel (required) + * @param smstemplate SMS Template (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call requestOTPForPasswordResetAsync(ForgotPasswordPhoneModel forgotPasswordPhoneModel, String smstemplate, String gRecaptchaResponse, String gRecaptchaResponse2, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, Boolean isvoiceotp, final ApiCallback<SMSResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = requestOTPForPasswordResetValidateBeforeCall(forgotPasswordPhoneModel, smstemplate, gRecaptchaResponse, gRecaptchaResponse2, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, isvoiceotp, _callback); + Type localVarReturnType = new TypeToken<SMSResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for resetPassword + * @param resetPassword (required) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetPasswordCall(ResetPassword resetPassword, String gRecaptchaResponse, String gRecaptchaResponse2, Boolean preventWebhook, Boolean xPreventWebhook, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, 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 = resetPassword; + + // create path and map variables + String localVarPath = "/identity/v2/auth/password/reset"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (gRecaptchaResponse2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g_recaptcha_response", gRecaptchaResponse2)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call resetPasswordValidateBeforeCall(ResetPassword resetPassword, String gRecaptchaResponse, String gRecaptchaResponse2, Boolean preventWebhook, Boolean xPreventWebhook, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'resetPassword' is set + if (resetPassword == null) { + throw new ApiException("Missing the required parameter 'resetPassword' when calling resetPassword(Async)"); + } + + return resetPasswordCall(resetPassword, gRecaptchaResponse, gRecaptchaResponse2, preventWebhook, xPreventWebhook, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, _callback); + + } + + /** + * Reset Password with token and OTP + * Sets a new Password for the specified Account using a reset token and OTP. + * @param resetPassword (required) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @return ResetPasswordResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ResetPasswordResponse resetPassword(ResetPassword resetPassword, String gRecaptchaResponse, String gRecaptchaResponse2, Boolean preventWebhook, Boolean xPreventWebhook, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr) throws ApiException { + ApiResponse<ResetPasswordResponse> localVarResp = resetPasswordWithHttpInfo(resetPassword, gRecaptchaResponse, gRecaptchaResponse2, preventWebhook, xPreventWebhook, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr); + return localVarResp.getData(); + } + + /** + * Reset Password with token and OTP + * Sets a new Password for the specified Account using a reset token and OTP. + * @param resetPassword (required) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @return ApiResponse<ResetPasswordResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<ResetPasswordResponse> resetPasswordWithHttpInfo(ResetPassword resetPassword, String gRecaptchaResponse, String gRecaptchaResponse2, Boolean preventWebhook, Boolean xPreventWebhook, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr) throws ApiException { + okhttp3.Call localVarCall = resetPasswordValidateBeforeCall(resetPassword, gRecaptchaResponse, gRecaptchaResponse2, preventWebhook, xPreventWebhook, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, null); + Type localVarReturnType = new TypeToken<ResetPasswordResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Reset Password with token and OTP (asynchronously) + * Sets a new Password for the specified Account using a reset token and OTP. + * @param resetPassword (required) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetPasswordAsync(ResetPassword resetPassword, String gRecaptchaResponse, String gRecaptchaResponse2, Boolean preventWebhook, Boolean xPreventWebhook, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, final ApiCallback<ResetPasswordResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = resetPasswordValidateBeforeCall(resetPassword, gRecaptchaResponse, gRecaptchaResponse2, preventWebhook, xPreventWebhook, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, _callback); + Type localVarReturnType = new TypeToken<ResetPasswordResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for resetPasswordByResetToken + * @param resetPassword (required) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetPasswordByResetTokenCall(ResetPassword resetPassword, String gRecaptchaResponse, String gRecaptchaResponse2, Boolean preventWebhook, Boolean xPreventWebhook, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, 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 = resetPassword; + + // create path and map variables + String localVarPath = "/identity/v2/auth/password"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (gRecaptchaResponse2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g_recaptcha_response", gRecaptchaResponse2)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call resetPasswordByResetTokenValidateBeforeCall(ResetPassword resetPassword, String gRecaptchaResponse, String gRecaptchaResponse2, Boolean preventWebhook, Boolean xPreventWebhook, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'resetPassword' is set + if (resetPassword == null) { + throw new ApiException("Missing the required parameter 'resetPassword' when calling resetPasswordByResetToken(Async)"); + } + + return resetPasswordByResetTokenCall(resetPassword, gRecaptchaResponse, gRecaptchaResponse2, preventWebhook, xPreventWebhook, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, _callback); + + } + + /** + * Reset Password with token and OTP + * Sets a new Password for the specified Account using a reset token and OTP. + * @param resetPassword (required) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @return ResetPasswordResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ResetPasswordResponse resetPasswordByResetToken(ResetPassword resetPassword, String gRecaptchaResponse, String gRecaptchaResponse2, Boolean preventWebhook, Boolean xPreventWebhook, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr) throws ApiException { + ApiResponse<ResetPasswordResponse> localVarResp = resetPasswordByResetTokenWithHttpInfo(resetPassword, gRecaptchaResponse, gRecaptchaResponse2, preventWebhook, xPreventWebhook, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr); + return localVarResp.getData(); + } + + /** + * Reset Password with token and OTP + * Sets a new Password for the specified Account using a reset token and OTP. + * @param resetPassword (required) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @return ApiResponse<ResetPasswordResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<ResetPasswordResponse> resetPasswordByResetTokenWithHttpInfo(ResetPassword resetPassword, String gRecaptchaResponse, String gRecaptchaResponse2, Boolean preventWebhook, Boolean xPreventWebhook, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr) throws ApiException { + okhttp3.Call localVarCall = resetPasswordByResetTokenValidateBeforeCall(resetPassword, gRecaptchaResponse, gRecaptchaResponse2, preventWebhook, xPreventWebhook, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, null); + Type localVarReturnType = new TypeToken<ResetPasswordResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Reset Password with token and OTP (asynchronously) + * Sets a new Password for the specified Account using a reset token and OTP. + * @param resetPassword (required) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetPasswordByResetTokenAsync(ResetPassword resetPassword, String gRecaptchaResponse, String gRecaptchaResponse2, Boolean preventWebhook, Boolean xPreventWebhook, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, final ApiCallback<ResetPasswordResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = resetPasswordByResetTokenValidateBeforeCall(resetPassword, gRecaptchaResponse, gRecaptchaResponse2, preventWebhook, xPreventWebhook, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, _callback); + Type localVarReturnType = new TypeToken<ResetPasswordResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for resetPasswordSecurityAnswer + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param resetPasswordBySecurityAnswer (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetPasswordSecurityAnswerCall(Boolean preventWebhook, Boolean xPreventWebhook, ResetPasswordBySecurityAnswer resetPasswordBySecurityAnswer, 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 = resetPasswordBySecurityAnswer; + + // create path and map variables + String localVarPath = "/identity/v2/auth/password/securityanswer"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call resetPasswordSecurityAnswerValidateBeforeCall(Boolean preventWebhook, Boolean xPreventWebhook, ResetPasswordBySecurityAnswer resetPasswordBySecurityAnswer, final ApiCallback _callback) throws ApiException { + return resetPasswordSecurityAnswerCall(preventWebhook, xPreventWebhook, resetPasswordBySecurityAnswer, _callback); + + } + + /** + * Reset Password with security question + * Resets the Password using a security question and Email, Username, or Phone. + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param resetPasswordBySecurityAnswer (optional) + * @return ResetPasswordResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ResetPasswordResponse resetPasswordSecurityAnswer(Boolean preventWebhook, Boolean xPreventWebhook, ResetPasswordBySecurityAnswer resetPasswordBySecurityAnswer) throws ApiException { + ApiResponse<ResetPasswordResponse> localVarResp = resetPasswordSecurityAnswerWithHttpInfo(preventWebhook, xPreventWebhook, resetPasswordBySecurityAnswer); + return localVarResp.getData(); + } + + /** + * Reset Password with security question + * Resets the Password using a security question and Email, Username, or Phone. + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param resetPasswordBySecurityAnswer (optional) + * @return ApiResponse<ResetPasswordResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<ResetPasswordResponse> resetPasswordSecurityAnswerWithHttpInfo(Boolean preventWebhook, Boolean xPreventWebhook, ResetPasswordBySecurityAnswer resetPasswordBySecurityAnswer) throws ApiException { + okhttp3.Call localVarCall = resetPasswordSecurityAnswerValidateBeforeCall(preventWebhook, xPreventWebhook, resetPasswordBySecurityAnswer, null); + Type localVarReturnType = new TypeToken<ResetPasswordResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Reset Password with security question (asynchronously) + * Resets the Password using a security question and Email, Username, or Phone. + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param resetPasswordBySecurityAnswer (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetPasswordSecurityAnswerAsync(Boolean preventWebhook, Boolean xPreventWebhook, ResetPasswordBySecurityAnswer resetPasswordBySecurityAnswer, final ApiCallback<ResetPasswordResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = resetPasswordSecurityAnswerValidateBeforeCall(preventWebhook, xPreventWebhook, resetPasswordBySecurityAnswer, _callback); + Type localVarReturnType = new TypeToken<ResetPasswordResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for resetPasswordWithOTP + * @param resetPasswordWithOTP (required) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetPasswordWithOTPCall(ResetPasswordWithOTP resetPasswordWithOTP, String gRecaptchaResponse, String gRecaptchaResponse2, Boolean preventWebhook, Boolean xPreventWebhook, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, 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 = resetPasswordWithOTP; + + // create path and map variables + String localVarPath = "/identity/v2/auth/password/otp"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (gRecaptchaResponse2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g_recaptcha_response", gRecaptchaResponse2)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call resetPasswordWithOTPValidateBeforeCall(ResetPasswordWithOTP resetPasswordWithOTP, String gRecaptchaResponse, String gRecaptchaResponse2, Boolean preventWebhook, Boolean xPreventWebhook, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'resetPasswordWithOTP' is set + if (resetPasswordWithOTP == null) { + throw new ApiException("Missing the required parameter 'resetPasswordWithOTP' when calling resetPasswordWithOTP(Async)"); + } + + return resetPasswordWithOTPCall(resetPasswordWithOTP, gRecaptchaResponse, gRecaptchaResponse2, preventWebhook, xPreventWebhook, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, _callback); + + } + + /** + * Reset Password with Phone and OTP + * Resets the Password using OTP and Phone number verification. + * @param resetPasswordWithOTP (required) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @return ResetPasswordResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public ResetPasswordResponse resetPasswordWithOTP(ResetPasswordWithOTP resetPasswordWithOTP, String gRecaptchaResponse, String gRecaptchaResponse2, Boolean preventWebhook, Boolean xPreventWebhook, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr) throws ApiException { + ApiResponse<ResetPasswordResponse> localVarResp = resetPasswordWithOTPWithHttpInfo(resetPasswordWithOTP, gRecaptchaResponse, gRecaptchaResponse2, preventWebhook, xPreventWebhook, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr); + return localVarResp.getData(); + } + + /** + * Reset Password with Phone and OTP + * Resets the Password using OTP and Phone number verification. + * @param resetPasswordWithOTP (required) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @return ApiResponse<ResetPasswordResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public ApiResponse<ResetPasswordResponse> resetPasswordWithOTPWithHttpInfo(ResetPasswordWithOTP resetPasswordWithOTP, String gRecaptchaResponse, String gRecaptchaResponse2, Boolean preventWebhook, Boolean xPreventWebhook, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr) throws ApiException { + okhttp3.Call localVarCall = resetPasswordWithOTPValidateBeforeCall(resetPasswordWithOTP, gRecaptchaResponse, gRecaptchaResponse2, preventWebhook, xPreventWebhook, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, null); + Type localVarReturnType = new TypeToken<ResetPasswordResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Reset Password with Phone and OTP (asynchronously) + * Resets the Password using OTP and Phone number verification. + * @param resetPasswordWithOTP (required) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetPasswordWithOTPAsync(ResetPasswordWithOTP resetPasswordWithOTP, String gRecaptchaResponse, String gRecaptchaResponse2, Boolean preventWebhook, Boolean xPreventWebhook, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, final ApiCallback<ResetPasswordResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = resetPasswordWithOTPValidateBeforeCall(resetPasswordWithOTP, gRecaptchaResponse, gRecaptchaResponse2, preventWebhook, xPreventWebhook, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, _callback); + Type localVarReturnType = new TypeToken<ResetPasswordResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/PasswordPolicyApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/PasswordPolicyApi.java new file mode 100644 index 0000000..6a5818e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/PasswordPolicyApi.java @@ -0,0 +1,344 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.PasswordPolicy; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class PasswordPolicyApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public PasswordPolicyApi() { + this(Configuration.getDefaultApiClient()); + } + + public PasswordPolicyApi(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 getPasswordPolicy + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getPasswordPolicyCall(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 = "/v2/manage/password-policies"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPasswordPolicyValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getPasswordPolicyCall(_callback); + + } + + /** + * Retrieve Password policy + * Retrieves the Password policy settings for a specific Tenant. + * @return PasswordPolicy + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public PasswordPolicy getPasswordPolicy() throws ApiException { + ApiResponse<PasswordPolicy> localVarResp = getPasswordPolicyWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Retrieve Password policy + * Retrieves the Password policy settings for a specific Tenant. + * @return ApiResponse<PasswordPolicy> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<PasswordPolicy> getPasswordPolicyWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getPasswordPolicyValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<PasswordPolicy>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Password policy (asynchronously) + * Retrieves the Password policy settings for a specific Tenant. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getPasswordPolicyAsync(final ApiCallback<PasswordPolicy> _callback) throws ApiException { + + okhttp3.Call localVarCall = getPasswordPolicyValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<PasswordPolicy>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updatePasswordPolicy + * @param passwordPolicy (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updatePasswordPolicyCall(PasswordPolicy passwordPolicy, 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 = passwordPolicy; + + // create path and map variables + String localVarPath = "/v2/manage/password-policies"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updatePasswordPolicyValidateBeforeCall(PasswordPolicy passwordPolicy, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'passwordPolicy' is set + if (passwordPolicy == null) { + throw new ApiException("Missing the required parameter 'passwordPolicy' when calling updatePasswordPolicy(Async)"); + } + + return updatePasswordPolicyCall(passwordPolicy, _callback); + + } + + /** + * Update Password policy + * Updates the Password policy settings for a specific Tenant. + * @param passwordPolicy (required) + * @return PasswordPolicy + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public PasswordPolicy updatePasswordPolicy(PasswordPolicy passwordPolicy) throws ApiException { + ApiResponse<PasswordPolicy> localVarResp = updatePasswordPolicyWithHttpInfo(passwordPolicy); + return localVarResp.getData(); + } + + /** + * Update Password policy + * Updates the Password policy settings for a specific Tenant. + * @param passwordPolicy (required) + * @return ApiResponse<PasswordPolicy> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<PasswordPolicy> updatePasswordPolicyWithHttpInfo(PasswordPolicy passwordPolicy) throws ApiException { + okhttp3.Call localVarCall = updatePasswordPolicyValidateBeforeCall(passwordPolicy, null); + Type localVarReturnType = new TypeToken<PasswordPolicy>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Password policy (asynchronously) + * Updates the Password policy settings for a specific Tenant. + * @param passwordPolicy (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updatePasswordPolicyAsync(PasswordPolicy passwordPolicy, final ApiCallback<PasswordPolicy> _callback) throws ApiException { + + okhttp3.Call localVarCall = updatePasswordPolicyValidateBeforeCall(passwordPolicy, _callback); + Type localVarReturnType = new TypeToken<PasswordPolicy>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/PerfectMindSsoApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/PerfectMindSsoApi.java new file mode 100644 index 0000000..e822e92 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/PerfectMindSsoApi.java @@ -0,0 +1,403 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.PerfectMindContactResponse; +import com.loginradius.sdk.internal.openapi.model.PerfectMindSessionResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class PerfectMindSsoApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public PerfectMindSsoApi() { + this(Configuration.getDefaultApiClient()); + } + + public PerfectMindSsoApi(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 getPerfectMindContact + * @param accessToken Access Token of the User (required) + * @param perfectmindsitename PerfectMind site name identifier (required) + * @param birthdate User's birth date for PerfectMind contact lookup (optional) + * @param perfectScanID PerfectMind scan ID for contact lookup (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: PerfectMind contact information retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The API key or access token is missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The request is not allowed. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getPerfectMindContactCall(String accessToken, String perfectmindsitename, String birthdate, String perfectScanID, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://{domain}.hub.loginradius.com" }; + + // 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 = "/sso/perfectmind/contact"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (perfectmindsitename != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("perfectmindsitename", perfectmindsitename)); + } + + if (birthdate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("birthdate", birthdate)); + } + + if (perfectScanID != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("perfectScanID", perfectScanID)); + } + + 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[] { "APIKey", "XLoginRadiusAPIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPerfectMindContactValidateBeforeCall(String accessToken, String perfectmindsitename, String birthdate, String perfectScanID, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'accessToken' is set + if (accessToken == null) { + throw new ApiException("Missing the required parameter 'accessToken' when calling getPerfectMindContact(Async)"); + } + + // verify the required parameter 'perfectmindsitename' is set + if (perfectmindsitename == null) { + throw new ApiException("Missing the required parameter 'perfectmindsitename' when calling getPerfectMindContact(Async)"); + } + + return getPerfectMindContactCall(accessToken, perfectmindsitename, birthdate, perfectScanID, _callback); + + } + + /** + * Get PerfectMind Contact IDs + * Retrieves PerfectMind contact IDs associated with the user's email address. Uses the LoginRadius access token to look up the user and match them against PerfectMind contacts using email and birth date. + * @param accessToken Access Token of the User (required) + * @param perfectmindsitename PerfectMind site name identifier (required) + * @param birthdate User's birth date for PerfectMind contact lookup (optional) + * @param perfectScanID PerfectMind scan ID for contact lookup (optional) + * @return PerfectMindContactResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: PerfectMind contact information retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The API key or access token is missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The request is not allowed. </td><td> - </td></tr> + </table> + */ + public PerfectMindContactResponse getPerfectMindContact(String accessToken, String perfectmindsitename, String birthdate, String perfectScanID) throws ApiException { + ApiResponse<PerfectMindContactResponse> localVarResp = getPerfectMindContactWithHttpInfo(accessToken, perfectmindsitename, birthdate, perfectScanID); + return localVarResp.getData(); + } + + /** + * Get PerfectMind Contact IDs + * Retrieves PerfectMind contact IDs associated with the user's email address. Uses the LoginRadius access token to look up the user and match them against PerfectMind contacts using email and birth date. + * @param accessToken Access Token of the User (required) + * @param perfectmindsitename PerfectMind site name identifier (required) + * @param birthdate User's birth date for PerfectMind contact lookup (optional) + * @param perfectScanID PerfectMind scan ID for contact lookup (optional) + * @return ApiResponse<PerfectMindContactResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: PerfectMind contact information retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The API key or access token is missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The request is not allowed. </td><td> - </td></tr> + </table> + */ + public ApiResponse<PerfectMindContactResponse> getPerfectMindContactWithHttpInfo(String accessToken, String perfectmindsitename, String birthdate, String perfectScanID) throws ApiException { + okhttp3.Call localVarCall = getPerfectMindContactValidateBeforeCall(accessToken, perfectmindsitename, birthdate, perfectScanID, null); + Type localVarReturnType = new TypeToken<PerfectMindContactResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Get PerfectMind Contact IDs (asynchronously) + * Retrieves PerfectMind contact IDs associated with the user's email address. Uses the LoginRadius access token to look up the user and match them against PerfectMind contacts using email and birth date. + * @param accessToken Access Token of the User (required) + * @param perfectmindsitename PerfectMind site name identifier (required) + * @param birthdate User's birth date for PerfectMind contact lookup (optional) + * @param perfectScanID PerfectMind scan ID for contact lookup (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: PerfectMind contact information retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The API key or access token is missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The request is not allowed. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getPerfectMindContactAsync(String accessToken, String perfectmindsitename, String birthdate, String perfectScanID, final ApiCallback<PerfectMindContactResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getPerfectMindContactValidateBeforeCall(accessToken, perfectmindsitename, birthdate, perfectScanID, _callback); + Type localVarReturnType = new TypeToken<PerfectMindContactResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPerfectMindSession + * @param accessToken Access Token of the User (required) + * @param perfectmindsitename PerfectMind site name identifier (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: PerfectMind session generated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The API key or access token is missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The request is not allowed. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getPerfectMindSessionCall(String accessToken, String perfectmindsitename, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://{domain}.hub.loginradius.com" }; + + // 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 = "/sso/perfectmind/session"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (perfectmindsitename != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("perfectmindsitename", perfectmindsitename)); + } + + 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[] { "APIKey", "XLoginRadiusAPIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPerfectMindSessionValidateBeforeCall(String accessToken, String perfectmindsitename, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'accessToken' is set + if (accessToken == null) { + throw new ApiException("Missing the required parameter 'accessToken' when calling getPerfectMindSession(Async)"); + } + + // verify the required parameter 'perfectmindsitename' is set + if (perfectmindsitename == null) { + throw new ApiException("Missing the required parameter 'perfectmindsitename' when calling getPerfectMindSession(Async)"); + } + + return getPerfectMindSessionCall(accessToken, perfectmindsitename, _callback); + + } + + /** + * Generate PerfectMind Login Session + * Generates a PerfectMind login session using the provided LoginRadius access token. Returns a session ID and URL that can be used to authenticate the user into the PerfectMind platform. + * @param accessToken Access Token of the User (required) + * @param perfectmindsitename PerfectMind site name identifier (required) + * @return PerfectMindSessionResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: PerfectMind session generated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The API key or access token is missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The request is not allowed. </td><td> - </td></tr> + </table> + */ + public PerfectMindSessionResponse getPerfectMindSession(String accessToken, String perfectmindsitename) throws ApiException { + ApiResponse<PerfectMindSessionResponse> localVarResp = getPerfectMindSessionWithHttpInfo(accessToken, perfectmindsitename); + return localVarResp.getData(); + } + + /** + * Generate PerfectMind Login Session + * Generates a PerfectMind login session using the provided LoginRadius access token. Returns a session ID and URL that can be used to authenticate the user into the PerfectMind platform. + * @param accessToken Access Token of the User (required) + * @param perfectmindsitename PerfectMind site name identifier (required) + * @return ApiResponse<PerfectMindSessionResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: PerfectMind session generated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The API key or access token is missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The request is not allowed. </td><td> - </td></tr> + </table> + */ + public ApiResponse<PerfectMindSessionResponse> getPerfectMindSessionWithHttpInfo(String accessToken, String perfectmindsitename) throws ApiException { + okhttp3.Call localVarCall = getPerfectMindSessionValidateBeforeCall(accessToken, perfectmindsitename, null); + Type localVarReturnType = new TypeToken<PerfectMindSessionResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Generate PerfectMind Login Session (asynchronously) + * Generates a PerfectMind login session using the provided LoginRadius access token. Returns a session ID and URL that can be used to authenticate the user into the PerfectMind platform. + * @param accessToken Access Token of the User (required) + * @param perfectmindsitename PerfectMind site name identifier (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: PerfectMind session generated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The API key or access token is missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The request is not allowed. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getPerfectMindSessionAsync(String accessToken, String perfectmindsitename, final ApiCallback<PerfectMindSessionResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getPerfectMindSessionValidateBeforeCall(accessToken, perfectmindsitename, _callback); + Type localVarReturnType = new TypeToken<PerfectMindSessionResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/PermissionsApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/PermissionsApi.java new file mode 100644 index 0000000..92838d4 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/PermissionsApi.java @@ -0,0 +1,769 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.DeleteResponse; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.PermissionPutRequest; +import com.loginradius.sdk.internal.openapi.model.Permissions; +import com.loginradius.sdk.internal.openapi.model.Permissions200Response; +import com.loginradius.sdk.internal.openapi.model.PermissionsPostRequest; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class PermissionsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public PermissionsApi() { + this(Configuration.getDefaultApiClient()); + } + + public PermissionsApi(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 addPermission + * @param permissionsPostRequest (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call addPermissionCall(PermissionsPostRequest permissionsPostRequest, 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 = permissionsPostRequest; + + // create path and map variables + String localVarPath = "/v2/manage/permissions"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call addPermissionValidateBeforeCall(PermissionsPostRequest permissionsPostRequest, final ApiCallback _callback) throws ApiException { + return addPermissionCall(permissionsPostRequest, _callback); + + } + + /** + * Create Permission + * Adds a new Permission. + * @param permissionsPostRequest (optional) + * @return Permissions + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public Permissions addPermission(PermissionsPostRequest permissionsPostRequest) throws ApiException { + ApiResponse<Permissions> localVarResp = addPermissionWithHttpInfo(permissionsPostRequest); + return localVarResp.getData(); + } + + /** + * Create Permission + * Adds a new Permission. + * @param permissionsPostRequest (optional) + * @return ApiResponse<Permissions> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<Permissions> addPermissionWithHttpInfo(PermissionsPostRequest permissionsPostRequest) throws ApiException { + okhttp3.Call localVarCall = addPermissionValidateBeforeCall(permissionsPostRequest, null); + Type localVarReturnType = new TypeToken<Permissions>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Permission (asynchronously) + * Adds a new Permission. + * @param permissionsPostRequest (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call addPermissionAsync(PermissionsPostRequest permissionsPostRequest, final ApiCallback<Permissions> _callback) throws ApiException { + + okhttp3.Call localVarCall = addPermissionValidateBeforeCall(permissionsPostRequest, _callback); + Type localVarReturnType = new TypeToken<Permissions>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteTenantPermission + * @param id The unique identifier for the Permission (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteTenantPermissionCall(String id, 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 = "/v2/manage/permissions/{id}" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteTenantPermissionValidateBeforeCall(String id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling deleteTenantPermission(Async)"); + } + + return deleteTenantPermissionCall(id, _callback); + + } + + /** + * Delete Permission + * Deletes a specific Permission. + * @param id The unique identifier for the Permission (required) + * @return DeleteResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public DeleteResponse deleteTenantPermission(String id) throws ApiException { + ApiResponse<DeleteResponse> localVarResp = deleteTenantPermissionWithHttpInfo(id); + return localVarResp.getData(); + } + + /** + * Delete Permission + * Deletes a specific Permission. + * @param id The unique identifier for the Permission (required) + * @return ApiResponse<DeleteResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DeleteResponse> deleteTenantPermissionWithHttpInfo(String id) throws ApiException { + okhttp3.Call localVarCall = deleteTenantPermissionValidateBeforeCall(id, null); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Permission (asynchronously) + * Deletes a specific Permission. + * @param id The unique identifier for the Permission (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteTenantPermissionAsync(String id, final ApiCallback<DeleteResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteTenantPermissionValidateBeforeCall(id, _callback); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPermissionById + * @param id The unique identifier for the Permission (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getPermissionByIdCall(String id, 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 = "/v2/manage/permissions/{id}" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPermissionByIdValidateBeforeCall(String id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling getPermissionById(Async)"); + } + + return getPermissionByIdCall(id, _callback); + + } + + /** + * Retrieve Permission by ID + * Retrieves a Permission by its ID. + * @param id The unique identifier for the Permission (required) + * @return Permissions + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public Permissions getPermissionById(String id) throws ApiException { + ApiResponse<Permissions> localVarResp = getPermissionByIdWithHttpInfo(id); + return localVarResp.getData(); + } + + /** + * Retrieve Permission by ID + * Retrieves a Permission by its ID. + * @param id The unique identifier for the Permission (required) + * @return ApiResponse<Permissions> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<Permissions> getPermissionByIdWithHttpInfo(String id) throws ApiException { + okhttp3.Call localVarCall = getPermissionByIdValidateBeforeCall(id, null); + Type localVarReturnType = new TypeToken<Permissions>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Permission by ID (asynchronously) + * Retrieves a Permission by its ID. + * @param id The unique identifier for the Permission (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getPermissionByIdAsync(String id, final ApiCallback<Permissions> _callback) throws ApiException { + + okhttp3.Call localVarCall = getPermissionByIdValidateBeforeCall(id, _callback); + Type localVarReturnType = new TypeToken<Permissions>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for permissions + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call permissionsCall(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 = "/v2/manage/permissions"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call permissionsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return permissionsCall(_callback); + + } + + /** + * List Permissions + * Retrieves a list of all Permissions. + * @return Permissions200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public Permissions200Response permissions() throws ApiException { + ApiResponse<Permissions200Response> localVarResp = permissionsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List Permissions + * Retrieves a list of all Permissions. + * @return ApiResponse<Permissions200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<Permissions200Response> permissionsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = permissionsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<Permissions200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Permissions (asynchronously) + * Retrieves a list of all Permissions. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call permissionsAsync(final ApiCallback<Permissions200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = permissionsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<Permissions200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateTenantPermission + * @param id The unique identifier for the Permission (required) + * @param permissionPutRequest (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateTenantPermissionCall(String id, PermissionPutRequest permissionPutRequest, 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 = permissionPutRequest; + + // create path and map variables + String localVarPath = "/v2/manage/permissions/{id}" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateTenantPermissionValidateBeforeCall(String id, PermissionPutRequest permissionPutRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling updateTenantPermission(Async)"); + } + + return updateTenantPermissionCall(id, permissionPutRequest, _callback); + + } + + /** + * Update Permission + * Updates a specific Permission. Note: The Name field cannot be modified for non-B2B apps. If a different Name value is provided, the API will return an error. + * @param id The unique identifier for the Permission (required) + * @param permissionPutRequest (optional) + * @return Permissions + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public Permissions updateTenantPermission(String id, PermissionPutRequest permissionPutRequest) throws ApiException { + ApiResponse<Permissions> localVarResp = updateTenantPermissionWithHttpInfo(id, permissionPutRequest); + return localVarResp.getData(); + } + + /** + * Update Permission + * Updates a specific Permission. Note: The Name field cannot be modified for non-B2B apps. If a different Name value is provided, the API will return an error. + * @param id The unique identifier for the Permission (required) + * @param permissionPutRequest (optional) + * @return ApiResponse<Permissions> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<Permissions> updateTenantPermissionWithHttpInfo(String id, PermissionPutRequest permissionPutRequest) throws ApiException { + okhttp3.Call localVarCall = updateTenantPermissionValidateBeforeCall(id, permissionPutRequest, null); + Type localVarReturnType = new TypeToken<Permissions>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Permission (asynchronously) + * Updates a specific Permission. Note: The Name field cannot be modified for non-B2B apps. If a different Name value is provided, the API will return an error. + * @param id The unique identifier for the Permission (required) + * @param permissionPutRequest (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateTenantPermissionAsync(String id, PermissionPutRequest permissionPutRequest, final ApiCallback<Permissions> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateTenantPermissionValidateBeforeCall(id, permissionPutRequest, _callback); + Type localVarReturnType = new TypeToken<Permissions>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/PushNotificationConfigurationApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/PushNotificationConfigurationApi.java new file mode 100644 index 0000000..04fd4d5 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/PushNotificationConfigurationApi.java @@ -0,0 +1,487 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.PushAuthenticator; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class PushNotificationConfigurationApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public PushNotificationConfigurationApi() { + this(Configuration.getDefaultApiClient()); + } + + public PushNotificationConfigurationApi(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 createPushSettings + * @param pushAuthenticator (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createPushSettingsCall(PushAuthenticator pushAuthenticator, 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 = pushAuthenticator; + + // create path and map variables + String localVarPath = "/v2/manage/2fa/push-notification-settings"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createPushSettingsValidateBeforeCall(PushAuthenticator pushAuthenticator, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'pushAuthenticator' is set + if (pushAuthenticator == null) { + throw new ApiException("Missing the required parameter 'pushAuthenticator' when calling createPushSettings(Async)"); + } + + return createPushSettingsCall(pushAuthenticator, _callback); + + } + + /** + * Create Push Notification settings + * Creates new Push Notification settings for second factor authentication. + * @param pushAuthenticator (required) + * @return PushAuthenticator + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public PushAuthenticator createPushSettings(PushAuthenticator pushAuthenticator) throws ApiException { + ApiResponse<PushAuthenticator> localVarResp = createPushSettingsWithHttpInfo(pushAuthenticator); + return localVarResp.getData(); + } + + /** + * Create Push Notification settings + * Creates new Push Notification settings for second factor authentication. + * @param pushAuthenticator (required) + * @return ApiResponse<PushAuthenticator> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<PushAuthenticator> createPushSettingsWithHttpInfo(PushAuthenticator pushAuthenticator) throws ApiException { + okhttp3.Call localVarCall = createPushSettingsValidateBeforeCall(pushAuthenticator, null); + Type localVarReturnType = new TypeToken<PushAuthenticator>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Push Notification settings (asynchronously) + * Creates new Push Notification settings for second factor authentication. + * @param pushAuthenticator (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createPushSettingsAsync(PushAuthenticator pushAuthenticator, final ApiCallback<PushAuthenticator> _callback) throws ApiException { + + okhttp3.Call localVarCall = createPushSettingsValidateBeforeCall(pushAuthenticator, _callback); + Type localVarReturnType = new TypeToken<PushAuthenticator>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPushSettings + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getPushSettingsCall(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 = "/v2/manage/2fa/push-notification-settings"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPushSettingsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getPushSettingsCall(_callback); + + } + + /** + * Retrieve Push Notification settings + * Retrieves the current Push Notification settings for second factor authentication. + * @return PushAuthenticator + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public PushAuthenticator getPushSettings() throws ApiException { + ApiResponse<PushAuthenticator> localVarResp = getPushSettingsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Retrieve Push Notification settings + * Retrieves the current Push Notification settings for second factor authentication. + * @return ApiResponse<PushAuthenticator> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<PushAuthenticator> getPushSettingsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getPushSettingsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<PushAuthenticator>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Push Notification settings (asynchronously) + * Retrieves the current Push Notification settings for second factor authentication. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getPushSettingsAsync(final ApiCallback<PushAuthenticator> _callback) throws ApiException { + + okhttp3.Call localVarCall = getPushSettingsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<PushAuthenticator>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updatePushSettings + * @param pushAuthenticator (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updatePushSettingsCall(PushAuthenticator pushAuthenticator, 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 = pushAuthenticator; + + // create path and map variables + String localVarPath = "/v2/manage/2fa/push-notification-settings"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updatePushSettingsValidateBeforeCall(PushAuthenticator pushAuthenticator, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'pushAuthenticator' is set + if (pushAuthenticator == null) { + throw new ApiException("Missing the required parameter 'pushAuthenticator' when calling updatePushSettings(Async)"); + } + + return updatePushSettingsCall(pushAuthenticator, _callback); + + } + + /** + * Update Push Notification settings + * Updates existing Push Notification settings for second factor authentication. + * @param pushAuthenticator (required) + * @return PushAuthenticator + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public PushAuthenticator updatePushSettings(PushAuthenticator pushAuthenticator) throws ApiException { + ApiResponse<PushAuthenticator> localVarResp = updatePushSettingsWithHttpInfo(pushAuthenticator); + return localVarResp.getData(); + } + + /** + * Update Push Notification settings + * Updates existing Push Notification settings for second factor authentication. + * @param pushAuthenticator (required) + * @return ApiResponse<PushAuthenticator> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<PushAuthenticator> updatePushSettingsWithHttpInfo(PushAuthenticator pushAuthenticator) throws ApiException { + okhttp3.Call localVarCall = updatePushSettingsValidateBeforeCall(pushAuthenticator, null); + Type localVarReturnType = new TypeToken<PushAuthenticator>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Push Notification settings (asynchronously) + * Updates existing Push Notification settings for second factor authentication. + * @param pushAuthenticator (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updatePushSettingsAsync(PushAuthenticator pushAuthenticator, final ApiCallback<PushAuthenticator> _callback) throws ApiException { + + okhttp3.Call localVarCall = updatePushSettingsValidateBeforeCall(pushAuthenticator, _callback); + Type localVarReturnType = new TypeToken<PushAuthenticator>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/RegistrationApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/RegistrationApi.java new file mode 100644 index 0000000..de62a93 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/RegistrationApi.java @@ -0,0 +1,935 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.ApiError; +import com.loginradius.sdk.internal.openapi.model.BeginPasskeyRegistration200Response; +import com.loginradius.sdk.internal.openapi.model.PasskeyRegisterFinish; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModel; +import com.loginradius.sdk.internal.openapi.model.RegistrationResponse; +import com.loginradius.sdk.internal.openapi.model.UserRegistrationByReCaptchaEmailPhoneUserNameRequest; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class RegistrationApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public RegistrationApi() { + this(Configuration.getDefaultApiClient()); + } + + public RegistrationApi(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 beginPasskeyRegistration + * @param identifier Email of the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated credential registration </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call beginPasskeyRegistrationCall(String identifier, 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 = "/identity/v2/auth/register/passkey/begin"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (identifier != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("identifier", identifier)); + } + + 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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call beginPasskeyRegistrationValidateBeforeCall(String identifier, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'identifier' is set + if (identifier == null) { + throw new ApiException("Missing the required parameter 'identifier' when calling beginPasskeyRegistration(Async)"); + } + + return beginPasskeyRegistrationCall(identifier, _callback); + + } + + /** + * Initiate Registration with Passkey + * Begins the registration process using a Passkey. + * @param identifier Email of the User (required) + * @return BeginPasskeyRegistration200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated credential registration </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public BeginPasskeyRegistration200Response beginPasskeyRegistration(String identifier) throws ApiException { + ApiResponse<BeginPasskeyRegistration200Response> localVarResp = beginPasskeyRegistrationWithHttpInfo(identifier); + return localVarResp.getData(); + } + + /** + * Initiate Registration with Passkey + * Begins the registration process using a Passkey. + * @param identifier Email of the User (required) + * @return ApiResponse<BeginPasskeyRegistration200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated credential registration </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<BeginPasskeyRegistration200Response> beginPasskeyRegistrationWithHttpInfo(String identifier) throws ApiException { + okhttp3.Call localVarCall = beginPasskeyRegistrationValidateBeforeCall(identifier, null); + Type localVarReturnType = new TypeToken<BeginPasskeyRegistration200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Initiate Registration with Passkey (asynchronously) + * Begins the registration process using a Passkey. + * @param identifier Email of the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated credential registration </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call beginPasskeyRegistrationAsync(String identifier, final ApiCallback<BeginPasskeyRegistration200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = beginPasskeyRegistrationValidateBeforeCall(identifier, _callback); + Type localVarReturnType = new TypeToken<BeginPasskeyRegistration200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for finishPasskeyRegistration + * @param passkeyRegisterFinish (required) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param invitationToken Invitation token of an organization (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully finish credential registration </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call finishPasskeyRegistrationCall(PasskeyRegisterFinish passkeyRegisterFinish, String verificationurl, String emailtemplate, String welcomeemailtemplate, String fields, String options, String invitationToken, Boolean preventWebhook, Boolean xPreventWebhook, 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 = passkeyRegisterFinish; + + // create path and map variables + String localVarPath = "/identity/v2/auth/register/passkey/finish"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (verificationurl != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("verificationurl", verificationurl)); + } + + if (emailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailtemplate", emailtemplate)); + } + + if (welcomeemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("welcomeemailtemplate", welcomeemailtemplate)); + } + + if (fields != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fields", fields)); + } + + if (options != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("options", options)); + } + + if (invitationToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("invitation_token", invitationToken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call finishPasskeyRegistrationValidateBeforeCall(PasskeyRegisterFinish passkeyRegisterFinish, String verificationurl, String emailtemplate, String welcomeemailtemplate, String fields, String options, String invitationToken, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'passkeyRegisterFinish' is set + if (passkeyRegisterFinish == null) { + throw new ApiException("Missing the required parameter 'passkeyRegisterFinish' when calling finishPasskeyRegistration(Async)"); + } + + return finishPasskeyRegistrationCall(passkeyRegisterFinish, verificationurl, emailtemplate, welcomeemailtemplate, fields, options, invitationToken, preventWebhook, xPreventWebhook, _callback); + + } + + /** + * Complete Registration with Passkey + * Completes the registration process using a Passkey. + * @param passkeyRegisterFinish (required) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param invitationToken Invitation token of an organization (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return RegistrationResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully finish credential registration </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public RegistrationResponse finishPasskeyRegistration(PasskeyRegisterFinish passkeyRegisterFinish, String verificationurl, String emailtemplate, String welcomeemailtemplate, String fields, String options, String invitationToken, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + ApiResponse<RegistrationResponse> localVarResp = finishPasskeyRegistrationWithHttpInfo(passkeyRegisterFinish, verificationurl, emailtemplate, welcomeemailtemplate, fields, options, invitationToken, preventWebhook, xPreventWebhook); + return localVarResp.getData(); + } + + /** + * Complete Registration with Passkey + * Completes the registration process using a Passkey. + * @param passkeyRegisterFinish (required) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param invitationToken Invitation token of an organization (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<RegistrationResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully finish credential registration </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public ApiResponse<RegistrationResponse> finishPasskeyRegistrationWithHttpInfo(PasskeyRegisterFinish passkeyRegisterFinish, String verificationurl, String emailtemplate, String welcomeemailtemplate, String fields, String options, String invitationToken, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + okhttp3.Call localVarCall = finishPasskeyRegistrationValidateBeforeCall(passkeyRegisterFinish, verificationurl, emailtemplate, welcomeemailtemplate, fields, options, invitationToken, preventWebhook, xPreventWebhook, null); + Type localVarReturnType = new TypeToken<RegistrationResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Complete Registration with Passkey (asynchronously) + * Completes the registration process using a Passkey. + * @param passkeyRegisterFinish (required) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param invitationToken Invitation token of an organization (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully finish credential registration </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call finishPasskeyRegistrationAsync(PasskeyRegisterFinish passkeyRegisterFinish, String verificationurl, String emailtemplate, String welcomeemailtemplate, String fields, String options, String invitationToken, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback<RegistrationResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = finishPasskeyRegistrationValidateBeforeCall(passkeyRegisterFinish, verificationurl, emailtemplate, welcomeemailtemplate, fields, options, invitationToken, preventWebhook, xPreventWebhook, _callback); + Type localVarReturnType = new TypeToken<RegistrationResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for userRegistrationByReCaptchaEmailPhoneUserName + * @param userRegistrationByReCaptchaEmailPhoneUserNameRequest (required) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param smstemplate SMS Template (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param invitationToken Invitation token of an organization (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call userRegistrationByReCaptchaEmailPhoneUserNameCall(UserRegistrationByReCaptchaEmailPhoneUserNameRequest userRegistrationByReCaptchaEmailPhoneUserNameRequest, String verificationurl, String emailtemplate, String smstemplate, String welcomeemailtemplate, String options, Boolean isvoiceotp, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String invitationToken, 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 = userRegistrationByReCaptchaEmailPhoneUserNameRequest; + + // create path and map variables + String localVarPath = "/identity/v2/auth/register/captcha"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (verificationurl != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("verificationurl", verificationurl)); + } + + if (emailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailtemplate", emailtemplate)); + } + + if (smstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("smstemplate", smstemplate)); + } + + if (welcomeemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("welcomeemailtemplate", welcomeemailtemplate)); + } + + if (options != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("options", options)); + } + + if (isvoiceotp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("isvoiceotp", isvoiceotp)); + } + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (gRecaptchaResponse2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g_recaptcha_response", gRecaptchaResponse2)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (fields != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fields", fields)); + } + + if (invitationToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("invitation_token", invitationToken)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call userRegistrationByReCaptchaEmailPhoneUserNameValidateBeforeCall(UserRegistrationByReCaptchaEmailPhoneUserNameRequest userRegistrationByReCaptchaEmailPhoneUserNameRequest, String verificationurl, String emailtemplate, String smstemplate, String welcomeemailtemplate, String options, Boolean isvoiceotp, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String invitationToken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'userRegistrationByReCaptchaEmailPhoneUserNameRequest' is set + if (userRegistrationByReCaptchaEmailPhoneUserNameRequest == null) { + throw new ApiException("Missing the required parameter 'userRegistrationByReCaptchaEmailPhoneUserNameRequest' when calling userRegistrationByReCaptchaEmailPhoneUserName(Async)"); + } + + return userRegistrationByReCaptchaEmailPhoneUserNameCall(userRegistrationByReCaptchaEmailPhoneUserNameRequest, verificationurl, emailtemplate, smstemplate, welcomeemailtemplate, options, isvoiceotp, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, preventWebhook, xPreventWebhook, fields, invitationToken, _callback); + + } + + /** + * Registration by Email/Phone/Username via Captcha + * Registers a new User using Email, Phone, or Username with Captcha verification. + * @param userRegistrationByReCaptchaEmailPhoneUserNameRequest (required) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param smstemplate SMS Template (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param invitationToken Invitation token of an organization (optional) + * @return RegistrationResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public RegistrationResponse userRegistrationByReCaptchaEmailPhoneUserName(UserRegistrationByReCaptchaEmailPhoneUserNameRequest userRegistrationByReCaptchaEmailPhoneUserNameRequest, String verificationurl, String emailtemplate, String smstemplate, String welcomeemailtemplate, String options, Boolean isvoiceotp, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String invitationToken) throws ApiException { + ApiResponse<RegistrationResponse> localVarResp = userRegistrationByReCaptchaEmailPhoneUserNameWithHttpInfo(userRegistrationByReCaptchaEmailPhoneUserNameRequest, verificationurl, emailtemplate, smstemplate, welcomeemailtemplate, options, isvoiceotp, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, preventWebhook, xPreventWebhook, fields, invitationToken); + return localVarResp.getData(); + } + + /** + * Registration by Email/Phone/Username via Captcha + * Registers a new User using Email, Phone, or Username with Captcha verification. + * @param userRegistrationByReCaptchaEmailPhoneUserNameRequest (required) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param smstemplate SMS Template (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param invitationToken Invitation token of an organization (optional) + * @return ApiResponse<RegistrationResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public ApiResponse<RegistrationResponse> userRegistrationByReCaptchaEmailPhoneUserNameWithHttpInfo(UserRegistrationByReCaptchaEmailPhoneUserNameRequest userRegistrationByReCaptchaEmailPhoneUserNameRequest, String verificationurl, String emailtemplate, String smstemplate, String welcomeemailtemplate, String options, Boolean isvoiceotp, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String invitationToken) throws ApiException { + okhttp3.Call localVarCall = userRegistrationByReCaptchaEmailPhoneUserNameValidateBeforeCall(userRegistrationByReCaptchaEmailPhoneUserNameRequest, verificationurl, emailtemplate, smstemplate, welcomeemailtemplate, options, isvoiceotp, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, preventWebhook, xPreventWebhook, fields, invitationToken, null); + Type localVarReturnType = new TypeToken<RegistrationResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Registration by Email/Phone/Username via Captcha (asynchronously) + * Registers a new User using Email, Phone, or Username with Captcha verification. + * @param userRegistrationByReCaptchaEmailPhoneUserNameRequest (required) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param smstemplate SMS Template (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param invitationToken Invitation token of an organization (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call userRegistrationByReCaptchaEmailPhoneUserNameAsync(UserRegistrationByReCaptchaEmailPhoneUserNameRequest userRegistrationByReCaptchaEmailPhoneUserNameRequest, String verificationurl, String emailtemplate, String smstemplate, String welcomeemailtemplate, String options, Boolean isvoiceotp, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String invitationToken, final ApiCallback<RegistrationResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = userRegistrationByReCaptchaEmailPhoneUserNameValidateBeforeCall(userRegistrationByReCaptchaEmailPhoneUserNameRequest, verificationurl, emailtemplate, smstemplate, welcomeemailtemplate, options, isvoiceotp, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, preventWebhook, xPreventWebhook, fields, invitationToken, _callback); + Type localVarReturnType = new TypeToken<RegistrationResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for userRegistrationBySottEmailPhoneUserName + * @param profileRequestModel (required) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param sott SOTT should be generated from the server side and passed here or in the X-LoginRadius-Sott header. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param smstemplate SMS Template (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param xLoginRadiusSott SOTT should be generated from the server side and passed here or in sott query parameter. (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param invitationToken Invitation token of an organization (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call userRegistrationBySottEmailPhoneUserNameCall(ProfileRequestModel profileRequestModel, String emailtemplate, String sott, String welcomeemailtemplate, String verificationurl, String smstemplate, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String xLoginRadiusSott, String options, String invitationToken, Boolean isvoiceotp, 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 = profileRequestModel; + + // create path and map variables + String localVarPath = "/identity/v2/auth/register"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (emailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailtemplate", emailtemplate)); + } + + if (sott != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("sott", sott)); + } + + if (welcomeemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("welcomeemailtemplate", welcomeemailtemplate)); + } + + if (verificationurl != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("verificationurl", verificationurl)); + } + + if (smstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("smstemplate", smstemplate)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (fields != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fields", fields)); + } + + if (options != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("options", options)); + } + + if (invitationToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("invitation_token", invitationToken)); + } + + if (isvoiceotp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("isvoiceotp", isvoiceotp)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + if (xLoginRadiusSott != null) { + localVarHeaderParams.put("X-LoginRadius-Sott", localVarApiClient.parameterToString(xLoginRadiusSott)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call userRegistrationBySottEmailPhoneUserNameValidateBeforeCall(ProfileRequestModel profileRequestModel, String emailtemplate, String sott, String welcomeemailtemplate, String verificationurl, String smstemplate, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String xLoginRadiusSott, String options, String invitationToken, Boolean isvoiceotp, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'profileRequestModel' is set + if (profileRequestModel == null) { + throw new ApiException("Missing the required parameter 'profileRequestModel' when calling userRegistrationBySottEmailPhoneUserName(Async)"); + } + + return userRegistrationBySottEmailPhoneUserNameCall(profileRequestModel, emailtemplate, sott, welcomeemailtemplate, verificationurl, smstemplate, preventWebhook, xPreventWebhook, fields, xLoginRadiusSott, options, invitationToken, isvoiceotp, _callback); + + } + + /** + * Registration by Email/Phone/Username via SOTT + * Registers a new User using Email, Phone, or Username via a Secure One Time Token (SOTT). + * @param profileRequestModel (required) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param sott SOTT should be generated from the server side and passed here or in the X-LoginRadius-Sott header. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param smstemplate SMS Template (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param xLoginRadiusSott SOTT should be generated from the server side and passed here or in sott query parameter. (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param invitationToken Invitation token of an organization (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @return RegistrationResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public RegistrationResponse userRegistrationBySottEmailPhoneUserName(ProfileRequestModel profileRequestModel, String emailtemplate, String sott, String welcomeemailtemplate, String verificationurl, String smstemplate, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String xLoginRadiusSott, String options, String invitationToken, Boolean isvoiceotp) throws ApiException { + ApiResponse<RegistrationResponse> localVarResp = userRegistrationBySottEmailPhoneUserNameWithHttpInfo(profileRequestModel, emailtemplate, sott, welcomeemailtemplate, verificationurl, smstemplate, preventWebhook, xPreventWebhook, fields, xLoginRadiusSott, options, invitationToken, isvoiceotp); + return localVarResp.getData(); + } + + /** + * Registration by Email/Phone/Username via SOTT + * Registers a new User using Email, Phone, or Username via a Secure One Time Token (SOTT). + * @param profileRequestModel (required) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param sott SOTT should be generated from the server side and passed here or in the X-LoginRadius-Sott header. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param smstemplate SMS Template (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param xLoginRadiusSott SOTT should be generated from the server side and passed here or in sott query parameter. (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param invitationToken Invitation token of an organization (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @return ApiResponse<RegistrationResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public ApiResponse<RegistrationResponse> userRegistrationBySottEmailPhoneUserNameWithHttpInfo(ProfileRequestModel profileRequestModel, String emailtemplate, String sott, String welcomeemailtemplate, String verificationurl, String smstemplate, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String xLoginRadiusSott, String options, String invitationToken, Boolean isvoiceotp) throws ApiException { + okhttp3.Call localVarCall = userRegistrationBySottEmailPhoneUserNameValidateBeforeCall(profileRequestModel, emailtemplate, sott, welcomeemailtemplate, verificationurl, smstemplate, preventWebhook, xPreventWebhook, fields, xLoginRadiusSott, options, invitationToken, isvoiceotp, null); + Type localVarReturnType = new TypeToken<RegistrationResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Registration by Email/Phone/Username via SOTT (asynchronously) + * Registers a new User using Email, Phone, or Username via a Secure One Time Token (SOTT). + * @param profileRequestModel (required) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param sott SOTT should be generated from the server side and passed here or in the X-LoginRadius-Sott header. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param smstemplate SMS Template (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param xLoginRadiusSott SOTT should be generated from the server side and passed here or in sott query parameter. (optional) + * @param options Options value will be passed when don't want to send the Email to the User for the verification, i.e. preventverificationemail (optional) + * @param invitationToken Invitation token of an organization (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call userRegistrationBySottEmailPhoneUserNameAsync(ProfileRequestModel profileRequestModel, String emailtemplate, String sott, String welcomeemailtemplate, String verificationurl, String smstemplate, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String xLoginRadiusSott, String options, String invitationToken, Boolean isvoiceotp, final ApiCallback<RegistrationResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = userRegistrationBySottEmailPhoneUserNameValidateBeforeCall(profileRequestModel, emailtemplate, sott, welcomeemailtemplate, verificationurl, smstemplate, preventWebhook, xPreventWebhook, fields, xLoginRadiusSott, options, invitationToken, isvoiceotp, _callback); + Type localVarReturnType = new TypeToken<RegistrationResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/RolesApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/RolesApi.java new file mode 100644 index 0000000..1800e6e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/RolesApi.java @@ -0,0 +1,1080 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.DefaultResponse; +import com.loginradius.sdk.internal.openapi.model.DeleteResponse; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.GetAllTenantRoles200Response; +import com.loginradius.sdk.internal.openapi.model.Role; +import com.loginradius.sdk.internal.openapi.model.RoleByName200Response; +import com.loginradius.sdk.internal.openapi.model.RolePostRequest; +import com.loginradius.sdk.internal.openapi.model.RolesPutRequest; +import com.loginradius.sdk.internal.openapi.model.TenantRole; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class RolesApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public RolesApi() { + this(Configuration.getDefaultApiClient()); + } + + public RolesApi(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 createTenantRole + * @param rolePostRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createTenantRoleCall(RolePostRequest rolePostRequest, 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 = rolePostRequest; + + // create path and map variables + String localVarPath = "/v2/manage/roles"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createTenantRoleValidateBeforeCall(RolePostRequest rolePostRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'rolePostRequest' is set + if (rolePostRequest == null) { + throw new ApiException("Missing the required parameter 'rolePostRequest' when calling createTenantRole(Async)"); + } + + return createTenantRoleCall(rolePostRequest, _callback); + + } + + /** + * Create Tenant Role + * Creates a Role within the Tenant. + * @param rolePostRequest (required) + * @return TenantRole + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public TenantRole createTenantRole(RolePostRequest rolePostRequest) throws ApiException { + ApiResponse<TenantRole> localVarResp = createTenantRoleWithHttpInfo(rolePostRequest); + return localVarResp.getData(); + } + + /** + * Create Tenant Role + * Creates a Role within the Tenant. + * @param rolePostRequest (required) + * @return ApiResponse<TenantRole> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<TenantRole> createTenantRoleWithHttpInfo(RolePostRequest rolePostRequest) throws ApiException { + okhttp3.Call localVarCall = createTenantRoleValidateBeforeCall(rolePostRequest, null); + Type localVarReturnType = new TypeToken<TenantRole>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create Tenant Role (asynchronously) + * Creates a Role within the Tenant. + * @param rolePostRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createTenantRoleAsync(RolePostRequest rolePostRequest, final ApiCallback<TenantRole> _callback) throws ApiException { + + okhttp3.Call localVarCall = createTenantRoleValidateBeforeCall(rolePostRequest, _callback); + Type localVarReturnType = new TypeToken<TenantRole>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteTenantRole + * @param id Role ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteTenantRoleCall(String id, 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 = "/v2/manage/roles/{id}" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteTenantRoleValidateBeforeCall(String id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling deleteTenantRole(Async)"); + } + + return deleteTenantRoleCall(id, _callback); + + } + + /** + * Delete Role + * Deletes a Role by its ID. + * @param id Role ID (required) + * @return DeleteResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public DeleteResponse deleteTenantRole(String id) throws ApiException { + ApiResponse<DeleteResponse> localVarResp = deleteTenantRoleWithHttpInfo(id); + return localVarResp.getData(); + } + + /** + * Delete Role + * Deletes a Role by its ID. + * @param id Role ID (required) + * @return ApiResponse<DeleteResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DeleteResponse> deleteTenantRoleWithHttpInfo(String id) throws ApiException { + okhttp3.Call localVarCall = deleteTenantRoleValidateBeforeCall(id, null); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Role (asynchronously) + * Deletes a Role by its ID. + * @param id Role ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteTenantRoleAsync(String id, final ApiCallback<DeleteResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteTenantRoleValidateBeforeCall(id, _callback); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAllTenantRoles + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllTenantRolesCall(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 = "/v2/manage/roles"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAllTenantRolesValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getAllTenantRolesCall(_callback); + + } + + /** + * List Tenant Roles + * Lists all Roles within the Tenant. + * @return GetAllTenantRoles200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public GetAllTenantRoles200Response getAllTenantRoles() throws ApiException { + ApiResponse<GetAllTenantRoles200Response> localVarResp = getAllTenantRolesWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List Tenant Roles + * Lists all Roles within the Tenant. + * @return ApiResponse<GetAllTenantRoles200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetAllTenantRoles200Response> getAllTenantRolesWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getAllTenantRolesValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<GetAllTenantRoles200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Tenant Roles (asynchronously) + * Lists all Roles within the Tenant. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllTenantRolesAsync(final ApiCallback<GetAllTenantRoles200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getAllTenantRolesValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<GetAllTenantRoles200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getRoleById + * @param id Role ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getRoleByIdCall(String id, 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 = "/v2/manage/roles/{id}" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getRoleByIdValidateBeforeCall(String id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling getRoleById(Async)"); + } + + return getRoleByIdCall(id, _callback); + + } + + /** + * Retrieve Role by ID + * Retrieves details of a Role by its ID. + * @param id Role ID (required) + * @return Role + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public Role getRoleById(String id) throws ApiException { + ApiResponse<Role> localVarResp = getRoleByIdWithHttpInfo(id); + return localVarResp.getData(); + } + + /** + * Retrieve Role by ID + * Retrieves details of a Role by its ID. + * @param id Role ID (required) + * @return ApiResponse<Role> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<Role> getRoleByIdWithHttpInfo(String id) throws ApiException { + okhttp3.Call localVarCall = getRoleByIdValidateBeforeCall(id, null); + Type localVarReturnType = new TypeToken<Role>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Role by ID (asynchronously) + * Retrieves details of a Role by its ID. + * @param id Role ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getRoleByIdAsync(String id, final ApiCallback<Role> _callback) throws ApiException { + + okhttp3.Call localVarCall = getRoleByIdValidateBeforeCall(id, _callback); + Type localVarReturnType = new TypeToken<Role>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for roleByName + * @param name Role Name (required) + * @param orgid Organization ID (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call roleByNameCall(String name, String orgid, 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 = "/v2/manage/roles/{name}/name" + .replace("{" + "name" + "}", localVarApiClient.escapeString(name.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (orgid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("orgid", orgid)); + } + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call roleByNameValidateBeforeCall(String name, String orgid, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'name' is set + if (name == null) { + throw new ApiException("Missing the required parameter 'name' when calling roleByName(Async)"); + } + + return roleByNameCall(name, orgid, _callback); + + } + + /** + * Retrieve Role by name + * Retrieves details of a Role by its name. + * @param name Role Name (required) + * @param orgid Organization ID (optional) + * @return RoleByName200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public RoleByName200Response roleByName(String name, String orgid) throws ApiException { + ApiResponse<RoleByName200Response> localVarResp = roleByNameWithHttpInfo(name, orgid); + return localVarResp.getData(); + } + + /** + * Retrieve Role by name + * Retrieves details of a Role by its name. + * @param name Role Name (required) + * @param orgid Organization ID (optional) + * @return ApiResponse<RoleByName200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<RoleByName200Response> roleByNameWithHttpInfo(String name, String orgid) throws ApiException { + okhttp3.Call localVarCall = roleByNameValidateBeforeCall(name, orgid, null); + Type localVarReturnType = new TypeToken<RoleByName200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Role by name (asynchronously) + * Retrieves details of a Role by its name. + * @param name Role Name (required) + * @param orgid Organization ID (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call roleByNameAsync(String name, String orgid, final ApiCallback<RoleByName200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = roleByNameValidateBeforeCall(name, orgid, _callback); + Type localVarReturnType = new TypeToken<RoleByName200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for setDefaultRole + * @param id Role ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call setDefaultRoleCall(String id, 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 = "/v2/manage/roles/{id}/default" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call setDefaultRoleValidateBeforeCall(String id, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling setDefaultRole(Async)"); + } + + return setDefaultRoleCall(id, _callback); + + } + + /** + * Set default Role + * Sets a Role as the default for new Users. This API is supported only for B2B tenants. + * @param id Role ID (required) + * @return DefaultResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public DefaultResponse setDefaultRole(String id) throws ApiException { + ApiResponse<DefaultResponse> localVarResp = setDefaultRoleWithHttpInfo(id); + return localVarResp.getData(); + } + + /** + * Set default Role + * Sets a Role as the default for new Users. This API is supported only for B2B tenants. + * @param id Role ID (required) + * @return ApiResponse<DefaultResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DefaultResponse> setDefaultRoleWithHttpInfo(String id) throws ApiException { + okhttp3.Call localVarCall = setDefaultRoleValidateBeforeCall(id, null); + Type localVarReturnType = new TypeToken<DefaultResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Set default Role (asynchronously) + * Sets a Role as the default for new Users. This API is supported only for B2B tenants. + * @param id Role ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call setDefaultRoleAsync(String id, final ApiCallback<DefaultResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = setDefaultRoleValidateBeforeCall(id, _callback); + Type localVarReturnType = new TypeToken<DefaultResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateRole + * @param id Role ID (required) + * @param rolesPutRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateRoleCall(String id, RolesPutRequest rolesPutRequest, 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 = rolesPutRequest; + + // create path and map variables + String localVarPath = "/v2/manage/roles/{id}" + .replace("{" + "id" + "}", localVarApiClient.escapeString(id.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateRoleValidateBeforeCall(String id, RolesPutRequest rolesPutRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'id' is set + if (id == null) { + throw new ApiException("Missing the required parameter 'id' when calling updateRole(Async)"); + } + + // verify the required parameter 'rolesPutRequest' is set + if (rolesPutRequest == null) { + throw new ApiException("Missing the required parameter 'rolesPutRequest' when calling updateRole(Async)"); + } + + return updateRoleCall(id, rolesPutRequest, _callback); + + } + + /** + * Update Role + * Updates a Role by its ID. + * @param id Role ID (required) + * @param rolesPutRequest (required) + * @return Role + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public Role updateRole(String id, RolesPutRequest rolesPutRequest) throws ApiException { + ApiResponse<Role> localVarResp = updateRoleWithHttpInfo(id, rolesPutRequest); + return localVarResp.getData(); + } + + /** + * Update Role + * Updates a Role by its ID. + * @param id Role ID (required) + * @param rolesPutRequest (required) + * @return ApiResponse<Role> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<Role> updateRoleWithHttpInfo(String id, RolesPutRequest rolesPutRequest) throws ApiException { + okhttp3.Call localVarCall = updateRoleValidateBeforeCall(id, rolesPutRequest, null); + Type localVarReturnType = new TypeToken<Role>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Role (asynchronously) + * Updates a Role by its ID. + * @param id Role ID (required) + * @param rolesPutRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateRoleAsync(String id, RolesPutRequest rolesPutRequest, final ApiCallback<Role> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateRoleValidateBeforeCall(id, rolesPutRequest, _callback); + Type localVarReturnType = new TypeToken<Role>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/RolesManagementApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/RolesManagementApi.java new file mode 100644 index 0000000..988ccbc --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/RolesManagementApi.java @@ -0,0 +1,1445 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.DeleteResponse; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.RemoveRoleContextAdditionalPermissionsModel; +import com.loginradius.sdk.internal.openapi.model.RemoveRoleContextRoleModel; +import com.loginradius.sdk.internal.openapi.model.RoleContextProfileResponseModel; +import com.loginradius.sdk.internal.openapi.model.RoleContextResponseModal; +import com.loginradius.sdk.internal.openapi.model.UpdateRoleContextBodyModel; +import com.loginradius.sdk.internal.openapi.model.UserRolesModel; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class RolesManagementApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public RolesManagementApi() { + this(Configuration.getDefaultApiClient()); + } + + public RolesManagementApi(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 deleteContextRoleByUid + * @param uid UID of the User (required) + * @param contextName Name of the Role Context (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param removeRoleContextRoleModel (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteContextRoleByUidCall(String uid, String contextName, Boolean preventWebhook, RemoveRoleContextRoleModel removeRoleContextRoleModel, 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 = removeRoleContextRoleModel; + + // create path and map variables + String localVarPath = "/identity/v2/manage/account/{uid}/rolecontext/{contextName}/role" + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())) + .replace("{" + "contextName" + "}", localVarApiClient.escapeString(contextName.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteContextRoleByUidValidateBeforeCall(String uid, String contextName, Boolean preventWebhook, RemoveRoleContextRoleModel removeRoleContextRoleModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling deleteContextRoleByUid(Async)"); + } + + // verify the required parameter 'contextName' is set + if (contextName == null) { + throw new ApiException("Missing the required parameter 'contextName' when calling deleteContextRoleByUid(Async)"); + } + + return deleteContextRoleByUidCall(uid, contextName, preventWebhook, removeRoleContextRoleModel, _callback); + + } + + /** + * Delete Role from Context + * Deletes the specified Role from a Context. This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + * @param uid UID of the User (required) + * @param contextName Name of the Role Context (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param removeRoleContextRoleModel (optional) + * @return DeleteResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public DeleteResponse deleteContextRoleByUid(String uid, String contextName, Boolean preventWebhook, RemoveRoleContextRoleModel removeRoleContextRoleModel) throws ApiException { + ApiResponse<DeleteResponse> localVarResp = deleteContextRoleByUidWithHttpInfo(uid, contextName, preventWebhook, removeRoleContextRoleModel); + return localVarResp.getData(); + } + + /** + * Delete Role from Context + * Deletes the specified Role from a Context. This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + * @param uid UID of the User (required) + * @param contextName Name of the Role Context (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param removeRoleContextRoleModel (optional) + * @return ApiResponse<DeleteResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DeleteResponse> deleteContextRoleByUidWithHttpInfo(String uid, String contextName, Boolean preventWebhook, RemoveRoleContextRoleModel removeRoleContextRoleModel) throws ApiException { + okhttp3.Call localVarCall = deleteContextRoleByUidValidateBeforeCall(uid, contextName, preventWebhook, removeRoleContextRoleModel, null); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Role from Context (asynchronously) + * Deletes the specified Role from a Context. This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + * @param uid UID of the User (required) + * @param contextName Name of the Role Context (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param removeRoleContextRoleModel (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteContextRoleByUidAsync(String uid, String contextName, Boolean preventWebhook, RemoveRoleContextRoleModel removeRoleContextRoleModel, final ApiCallback<DeleteResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteContextRoleByUidValidateBeforeCall(uid, contextName, preventWebhook, removeRoleContextRoleModel, _callback); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteRoleContextAdditionalPermissionsByUid + * @param uid UID of the User (required) + * @param contextName Name of the Role Context (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param removeRoleContextAdditionalPermissionsModel (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteRoleContextAdditionalPermissionsByUidCall(String uid, String contextName, Boolean preventWebhook, RemoveRoleContextAdditionalPermissionsModel removeRoleContextAdditionalPermissionsModel, 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 = removeRoleContextAdditionalPermissionsModel; + + // create path and map variables + String localVarPath = "/identity/v2/manage/account/{uid}/rolecontext/{contextName}/additionalpermission" + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())) + .replace("{" + "contextName" + "}", localVarApiClient.escapeString(contextName.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteRoleContextAdditionalPermissionsByUidValidateBeforeCall(String uid, String contextName, Boolean preventWebhook, RemoveRoleContextAdditionalPermissionsModel removeRoleContextAdditionalPermissionsModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling deleteRoleContextAdditionalPermissionsByUid(Async)"); + } + + // verify the required parameter 'contextName' is set + if (contextName == null) { + throw new ApiException("Missing the required parameter 'contextName' when calling deleteRoleContextAdditionalPermissionsByUid(Async)"); + } + + return deleteRoleContextAdditionalPermissionsByUidCall(uid, contextName, preventWebhook, removeRoleContextAdditionalPermissionsModel, _callback); + + } + + /** + * Delete Additional Permissions from Context + * Removes specified additional Permissions from a Context. This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + * @param uid UID of the User (required) + * @param contextName Name of the Role Context (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param removeRoleContextAdditionalPermissionsModel (optional) + * @return DeleteResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public DeleteResponse deleteRoleContextAdditionalPermissionsByUid(String uid, String contextName, Boolean preventWebhook, RemoveRoleContextAdditionalPermissionsModel removeRoleContextAdditionalPermissionsModel) throws ApiException { + ApiResponse<DeleteResponse> localVarResp = deleteRoleContextAdditionalPermissionsByUidWithHttpInfo(uid, contextName, preventWebhook, removeRoleContextAdditionalPermissionsModel); + return localVarResp.getData(); + } + + /** + * Delete Additional Permissions from Context + * Removes specified additional Permissions from a Context. This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + * @param uid UID of the User (required) + * @param contextName Name of the Role Context (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param removeRoleContextAdditionalPermissionsModel (optional) + * @return ApiResponse<DeleteResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DeleteResponse> deleteRoleContextAdditionalPermissionsByUidWithHttpInfo(String uid, String contextName, Boolean preventWebhook, RemoveRoleContextAdditionalPermissionsModel removeRoleContextAdditionalPermissionsModel) throws ApiException { + okhttp3.Call localVarCall = deleteRoleContextAdditionalPermissionsByUidValidateBeforeCall(uid, contextName, preventWebhook, removeRoleContextAdditionalPermissionsModel, null); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Additional Permissions from Context (asynchronously) + * Removes specified additional Permissions from a Context. This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + * @param uid UID of the User (required) + * @param contextName Name of the Role Context (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param removeRoleContextAdditionalPermissionsModel (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteRoleContextAdditionalPermissionsByUidAsync(String uid, String contextName, Boolean preventWebhook, RemoveRoleContextAdditionalPermissionsModel removeRoleContextAdditionalPermissionsModel, final ApiCallback<DeleteResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteRoleContextAdditionalPermissionsByUidValidateBeforeCall(uid, contextName, preventWebhook, removeRoleContextAdditionalPermissionsModel, _callback); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteRoleContextByUid + * @param contextName Name of the Role Context (required) + * @param uid UID of the User (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteRoleContextByUidCall(String contextName, String uid, Boolean preventWebhook, 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 = "/identity/v2/manage/account/{uid}/rolecontext/{contextName}" + .replace("{" + "contextName" + "}", localVarApiClient.escapeString(contextName.toString())) + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteRoleContextByUidValidateBeforeCall(String contextName, String uid, Boolean preventWebhook, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'contextName' is set + if (contextName == null) { + throw new ApiException("Missing the required parameter 'contextName' when calling deleteRoleContextByUid(Async)"); + } + + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling deleteRoleContextByUid(Async)"); + } + + return deleteRoleContextByUidCall(contextName, uid, preventWebhook, _callback); + + } + + /** + * Delete Role Context + * Deletes the specified Role Context. This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + * @param contextName Name of the Role Context (required) + * @param uid UID of the User (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return DeleteResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public DeleteResponse deleteRoleContextByUid(String contextName, String uid, Boolean preventWebhook) throws ApiException { + ApiResponse<DeleteResponse> localVarResp = deleteRoleContextByUidWithHttpInfo(contextName, uid, preventWebhook); + return localVarResp.getData(); + } + + /** + * Delete Role Context + * Deletes the specified Role Context. This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + * @param contextName Name of the Role Context (required) + * @param uid UID of the User (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<DeleteResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DeleteResponse> deleteRoleContextByUidWithHttpInfo(String contextName, String uid, Boolean preventWebhook) throws ApiException { + okhttp3.Call localVarCall = deleteRoleContextByUidValidateBeforeCall(contextName, uid, preventWebhook, null); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Role Context (asynchronously) + * Deletes the specified Role Context. This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + * @param contextName Name of the Role Context (required) + * @param uid UID of the User (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteRoleContextByUidAsync(String contextName, String uid, Boolean preventWebhook, final ApiCallback<DeleteResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteRoleContextByUidValidateBeforeCall(contextName, uid, preventWebhook, _callback); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteRolesByUid + * @param uid UID of the User (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param userRolesModel (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteRolesByUidCall(String uid, Boolean preventWebhook, UserRolesModel userRolesModel, 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 = userRolesModel; + + // create path and map variables + String localVarPath = "/identity/v2/manage/account/{uid}/role" + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteRolesByUidValidateBeforeCall(String uid, Boolean preventWebhook, UserRolesModel userRolesModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling deleteRolesByUid(Async)"); + } + + return deleteRolesByUidCall(uid, preventWebhook, userRolesModel, _callback); + + } + + /** + * Unassign Roles by UID + * Removes specified Roles from a User using the UID. This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + * @param uid UID of the User (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param userRolesModel (optional) + * @return DeleteResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public DeleteResponse deleteRolesByUid(String uid, Boolean preventWebhook, UserRolesModel userRolesModel) throws ApiException { + ApiResponse<DeleteResponse> localVarResp = deleteRolesByUidWithHttpInfo(uid, preventWebhook, userRolesModel); + return localVarResp.getData(); + } + + /** + * Unassign Roles by UID + * Removes specified Roles from a User using the UID. This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + * @param uid UID of the User (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param userRolesModel (optional) + * @return ApiResponse<DeleteResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DeleteResponse> deleteRolesByUidWithHttpInfo(String uid, Boolean preventWebhook, UserRolesModel userRolesModel) throws ApiException { + okhttp3.Call localVarCall = deleteRolesByUidValidateBeforeCall(uid, preventWebhook, userRolesModel, null); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Unassign Roles by UID (asynchronously) + * Removes specified Roles from a User using the UID. This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + * @param uid UID of the User (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param userRolesModel (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteRolesByUidAsync(String uid, Boolean preventWebhook, UserRolesModel userRolesModel, final ApiCallback<DeleteResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteRolesByUidValidateBeforeCall(uid, preventWebhook, userRolesModel, _callback); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getRoleContextByContextName + * @param contextName Name of the Role Context (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getRoleContextByContextNameCall(String contextName, 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 = "/identity/v2/manage/account/roleContext/{contextName}" + .replace("{" + "contextName" + "}", localVarApiClient.escapeString(contextName.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getRoleContextByContextNameValidateBeforeCall(String contextName, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'contextName' is set + if (contextName == null) { + throw new ApiException("Missing the required parameter 'contextName' when calling getRoleContextByContextName(Async)"); + } + + return getRoleContextByContextNameCall(contextName, _callback); + + } + + /** + * Retrieve Role Context + * Retrieves the Role Context for a specified Role. This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + * @param contextName Name of the Role Context (required) + * @return RoleContextProfileResponseModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public RoleContextProfileResponseModel getRoleContextByContextName(String contextName) throws ApiException { + ApiResponse<RoleContextProfileResponseModel> localVarResp = getRoleContextByContextNameWithHttpInfo(contextName); + return localVarResp.getData(); + } + + /** + * Retrieve Role Context + * Retrieves the Role Context for a specified Role. This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + * @param contextName Name of the Role Context (required) + * @return ApiResponse<RoleContextProfileResponseModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<RoleContextProfileResponseModel> getRoleContextByContextNameWithHttpInfo(String contextName) throws ApiException { + okhttp3.Call localVarCall = getRoleContextByContextNameValidateBeforeCall(contextName, null); + Type localVarReturnType = new TypeToken<RoleContextProfileResponseModel>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Role Context (asynchronously) + * Retrieves the Role Context for a specified Role. This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + * @param contextName Name of the Role Context (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getRoleContextByContextNameAsync(String contextName, final ApiCallback<RoleContextProfileResponseModel> _callback) throws ApiException { + + okhttp3.Call localVarCall = getRoleContextByContextNameValidateBeforeCall(contextName, _callback); + Type localVarReturnType = new TypeToken<RoleContextProfileResponseModel>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getRoleContextByUid + * @param uid UID of the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getRoleContextByUidCall(String uid, 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 = "/identity/v2/manage/account/{uid}/rolecontext" + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getRoleContextByUidValidateBeforeCall(String uid, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling getRoleContextByUid(Async)"); + } + + return getRoleContextByUidCall(uid, _callback); + + } + + /** + * Retrieve Context by UID + * Retrieves User Roles for all Contexts using the UID. This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + * @param uid UID of the User (required) + * @return RoleContextResponseModal + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public RoleContextResponseModal getRoleContextByUid(String uid) throws ApiException { + ApiResponse<RoleContextResponseModal> localVarResp = getRoleContextByUidWithHttpInfo(uid); + return localVarResp.getData(); + } + + /** + * Retrieve Context by UID + * Retrieves User Roles for all Contexts using the UID. This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + * @param uid UID of the User (required) + * @return ApiResponse<RoleContextResponseModal> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<RoleContextResponseModal> getRoleContextByUidWithHttpInfo(String uid) throws ApiException { + okhttp3.Call localVarCall = getRoleContextByUidValidateBeforeCall(uid, null); + Type localVarReturnType = new TypeToken<RoleContextResponseModal>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Context by UID (asynchronously) + * Retrieves User Roles for all Contexts using the UID. This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + * @param uid UID of the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getRoleContextByUidAsync(String uid, final ApiCallback<RoleContextResponseModal> _callback) throws ApiException { + + okhttp3.Call localVarCall = getRoleContextByUidValidateBeforeCall(uid, _callback); + Type localVarReturnType = new TypeToken<RoleContextResponseModal>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getRolesByUid + * @param uid UID of the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getRolesByUidCall(String uid, 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 = "/identity/v2/manage/account/{uid}/role" + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getRolesByUidValidateBeforeCall(String uid, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling getRolesByUid(Async)"); + } + + return getRolesByUidCall(uid, _callback); + + } + + /** + * Retrieve Roles by UID + * Retrieves Roles associated with a specified UID. This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + * @param uid UID of the User (required) + * @return UserRolesModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public UserRolesModel getRolesByUid(String uid) throws ApiException { + ApiResponse<UserRolesModel> localVarResp = getRolesByUidWithHttpInfo(uid); + return localVarResp.getData(); + } + + /** + * Retrieve Roles by UID + * Retrieves Roles associated with a specified UID. This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + * @param uid UID of the User (required) + * @return ApiResponse<UserRolesModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<UserRolesModel> getRolesByUidWithHttpInfo(String uid) throws ApiException { + okhttp3.Call localVarCall = getRolesByUidValidateBeforeCall(uid, null); + Type localVarReturnType = new TypeToken<UserRolesModel>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Roles by UID (asynchronously) + * Retrieves Roles associated with a specified UID. This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + * @param uid UID of the 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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getRolesByUidAsync(String uid, final ApiCallback<UserRolesModel> _callback) throws ApiException { + + okhttp3.Call localVarCall = getRolesByUidValidateBeforeCall(uid, _callback); + Type localVarReturnType = new TypeToken<UserRolesModel>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for saveRolesByUid + * @param uid UID of the User (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param userRolesModel (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call saveRolesByUidCall(String uid, Boolean preventWebhook, UserRolesModel userRolesModel, 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 = userRolesModel; + + // create path and map variables + String localVarPath = "/identity/v2/manage/account/{uid}/role" + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call saveRolesByUidValidateBeforeCall(String uid, Boolean preventWebhook, UserRolesModel userRolesModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling saveRolesByUid(Async)"); + } + + return saveRolesByUidCall(uid, preventWebhook, userRolesModel, _callback); + + } + + /** + * Assign Roles by UID + * Updates and assigns Roles to a User using the UID. This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + * @param uid UID of the User (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param userRolesModel (optional) + * @return UserRolesModel + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public UserRolesModel saveRolesByUid(String uid, Boolean preventWebhook, UserRolesModel userRolesModel) throws ApiException { + ApiResponse<UserRolesModel> localVarResp = saveRolesByUidWithHttpInfo(uid, preventWebhook, userRolesModel); + return localVarResp.getData(); + } + + /** + * Assign Roles by UID + * Updates and assigns Roles to a User using the UID. This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + * @param uid UID of the User (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param userRolesModel (optional) + * @return ApiResponse<UserRolesModel> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<UserRolesModel> saveRolesByUidWithHttpInfo(String uid, Boolean preventWebhook, UserRolesModel userRolesModel) throws ApiException { + okhttp3.Call localVarCall = saveRolesByUidValidateBeforeCall(uid, preventWebhook, userRolesModel, null); + Type localVarReturnType = new TypeToken<UserRolesModel>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Assign Roles by UID (asynchronously) + * Updates and assigns Roles to a User using the UID. This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + * @param uid UID of the User (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param userRolesModel (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call saveRolesByUidAsync(String uid, Boolean preventWebhook, UserRolesModel userRolesModel, final ApiCallback<UserRolesModel> _callback) throws ApiException { + + okhttp3.Call localVarCall = saveRolesByUidValidateBeforeCall(uid, preventWebhook, userRolesModel, _callback); + Type localVarReturnType = new TypeToken<UserRolesModel>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for upsertRoleContextByUid + * @param uid UID of the User (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param updateRoleContextBodyModel (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call upsertRoleContextByUidCall(String uid, Boolean preventWebhook, Boolean xPreventWebhook, UpdateRoleContextBodyModel updateRoleContextBodyModel, 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 = updateRoleContextBodyModel; + + // create path and map variables + String localVarPath = "/identity/v2/manage/account/{uid}/rolecontext" + .replace("{" + "uid" + "}", localVarApiClient.escapeString(uid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "M2MBearerToken", "XLoginRadiusAPIKey", "Digest", "XRequestExpiresTime", "XLoginRadiusAPISecret", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call upsertRoleContextByUidValidateBeforeCall(String uid, Boolean preventWebhook, Boolean xPreventWebhook, UpdateRoleContextBodyModel updateRoleContextBodyModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'uid' is set + if (uid == null) { + throw new ApiException("Missing the required parameter 'uid' when calling upsertRoleContextByUid(Async)"); + } + + return upsertRoleContextByUidCall(uid, preventWebhook, xPreventWebhook, updateRoleContextBodyModel, _callback); + + } + + /** + * Upsert Context by UID + * Creates or updates a Context with a set of Roles using the UID. This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + * @param uid UID of the User (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param updateRoleContextBodyModel (optional) + * @return RoleContextResponseModal + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public RoleContextResponseModal upsertRoleContextByUid(String uid, Boolean preventWebhook, Boolean xPreventWebhook, UpdateRoleContextBodyModel updateRoleContextBodyModel) throws ApiException { + ApiResponse<RoleContextResponseModal> localVarResp = upsertRoleContextByUidWithHttpInfo(uid, preventWebhook, xPreventWebhook, updateRoleContextBodyModel); + return localVarResp.getData(); + } + + /** + * Upsert Context by UID + * Creates or updates a Context with a set of Roles using the UID. This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + * @param uid UID of the User (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param updateRoleContextBodyModel (optional) + * @return ApiResponse<RoleContextResponseModal> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<RoleContextResponseModal> upsertRoleContextByUidWithHttpInfo(String uid, Boolean preventWebhook, Boolean xPreventWebhook, UpdateRoleContextBodyModel updateRoleContextBodyModel) throws ApiException { + okhttp3.Call localVarCall = upsertRoleContextByUidValidateBeforeCall(uid, preventWebhook, xPreventWebhook, updateRoleContextBodyModel, null); + Type localVarReturnType = new TypeToken<RoleContextResponseModal>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Upsert Context by UID (asynchronously) + * Creates or updates a Context with a set of Roles using the UID. This API is supported only for B2C tenants. For improved role and permission management, we recommend migrating to a B2B tenant. Please contact support for assistance with the migration. + * @param uid UID of the User (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param updateRoleContextBodyModel (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call upsertRoleContextByUidAsync(String uid, Boolean preventWebhook, Boolean xPreventWebhook, UpdateRoleContextBodyModel updateRoleContextBodyModel, final ApiCallback<RoleContextResponseModal> _callback) throws ApiException { + + okhttp3.Call localVarCall = upsertRoleContextByUidValidateBeforeCall(uid, preventWebhook, xPreventWebhook, updateRoleContextBodyModel, _callback); + Type localVarReturnType = new TypeToken<RoleContextResponseModal>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/SamlApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/SamlApi.java new file mode 100644 index 0000000..258e382 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/SamlApi.java @@ -0,0 +1,215 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.SamlIdpMetadataResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SamlApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public SamlApi() { + this(Configuration.getDefaultApiClient()); + } + + public SamlApi(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 getSAMLIDPMetadata + * @param appName Saml App Name (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getSAMLIDPMetadataCall(String appName, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://{TenantName}.hub.loginradius.com", "https://{CustomDomain}" }; + + // 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 = "/service/saml/idp/metadata"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (appName != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("appName", appName)); + } + + final String[] localVarAccepts = { + "application/xml", + "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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSAMLIDPMetadataValidateBeforeCall(String appName, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'appName' is set + if (appName == null) { + throw new ApiException("Missing the required parameter 'appName' when calling getSAMLIDPMetadata(Async)"); + } + + return getSAMLIDPMetadataCall(appName, _callback); + + } + + /** + * Retrieve SAML IDP metadata + * Retrieves metadata for a SAML Identity Provider (IDP). + * @param appName Saml App Name (required) + * @return SamlIdpMetadataResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public SamlIdpMetadataResponse getSAMLIDPMetadata(String appName) throws ApiException { + ApiResponse<SamlIdpMetadataResponse> localVarResp = getSAMLIDPMetadataWithHttpInfo(appName); + return localVarResp.getData(); + } + + /** + * Retrieve SAML IDP metadata + * Retrieves metadata for a SAML Identity Provider (IDP). + * @param appName Saml App Name (required) + * @return ApiResponse<SamlIdpMetadataResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SamlIdpMetadataResponse> getSAMLIDPMetadataWithHttpInfo(String appName) throws ApiException { + okhttp3.Call localVarCall = getSAMLIDPMetadataValidateBeforeCall(appName, null); + Type localVarReturnType = new TypeToken<SamlIdpMetadataResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve SAML IDP metadata (asynchronously) + * Retrieves metadata for a SAML Identity Provider (IDP). + * @param appName Saml App Name (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getSAMLIDPMetadataAsync(String appName, final ApiCallback<SamlIdpMetadataResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getSAMLIDPMetadataValidateBeforeCall(appName, _callback); + Type localVarReturnType = new TypeToken<SamlIdpMetadataResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/SamlCustomProvidersApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/SamlCustomProvidersApi.java new file mode 100644 index 0000000..c132ab1 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/SamlCustomProvidersApi.java @@ -0,0 +1,1043 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.DeleteResponse; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.GetAllSAMLSPClientConfigurations200Response; +import com.loginradius.sdk.internal.openapi.model.GetSamlSPClientMappingKeys200Response; +import com.loginradius.sdk.internal.openapi.model.SamlSpConfig; +import com.loginradius.sdk.internal.openapi.model.SamlSpConfigModel; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SamlCustomProvidersApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public SamlCustomProvidersApi() { + this(Configuration.getDefaultApiClient()); + } + + public SamlCustomProvidersApi(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 createSAMLSPClientConfiguration + * @param samlSpConfigModel (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createSAMLSPClientConfigurationCall(SamlSpConfigModel samlSpConfigModel, 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 = samlSpConfigModel; + + // create path and map variables + String localVarPath = "/v2/manage/custom-providers/saml"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createSAMLSPClientConfigurationValidateBeforeCall(SamlSpConfigModel samlSpConfigModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'samlSpConfigModel' is set + if (samlSpConfigModel == null) { + throw new ApiException("Missing the required parameter 'samlSpConfigModel' when calling createSAMLSPClientConfiguration(Async)"); + } + + return createSAMLSPClientConfigurationCall(samlSpConfigModel, _callback); + + } + + /** + * Create SAML SP Configuration + * Creates a new Service Provider configuration for a SAML client within the Tenant, defining necessary settings for SAML authentication flows. + * @param samlSpConfigModel (required) + * @return SamlSpConfig + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public SamlSpConfig createSAMLSPClientConfiguration(SamlSpConfigModel samlSpConfigModel) throws ApiException { + ApiResponse<SamlSpConfig> localVarResp = createSAMLSPClientConfigurationWithHttpInfo(samlSpConfigModel); + return localVarResp.getData(); + } + + /** + * Create SAML SP Configuration + * Creates a new Service Provider configuration for a SAML client within the Tenant, defining necessary settings for SAML authentication flows. + * @param samlSpConfigModel (required) + * @return ApiResponse<SamlSpConfig> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SamlSpConfig> createSAMLSPClientConfigurationWithHttpInfo(SamlSpConfigModel samlSpConfigModel) throws ApiException { + okhttp3.Call localVarCall = createSAMLSPClientConfigurationValidateBeforeCall(samlSpConfigModel, null); + Type localVarReturnType = new TypeToken<SamlSpConfig>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create SAML SP Configuration (asynchronously) + * Creates a new Service Provider configuration for a SAML client within the Tenant, defining necessary settings for SAML authentication flows. + * @param samlSpConfigModel (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createSAMLSPClientConfigurationAsync(SamlSpConfigModel samlSpConfigModel, final ApiCallback<SamlSpConfig> _callback) throws ApiException { + + okhttp3.Call localVarCall = createSAMLSPClientConfigurationValidateBeforeCall(samlSpConfigModel, _callback); + Type localVarReturnType = new TypeToken<SamlSpConfig>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteSAMLSPClientConfigurationByAppName + * @param samlApp The SAML App identifier (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteSAMLSPClientConfigurationByAppNameCall(String samlApp, 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 = "/v2/manage/custom-providers/saml/{samlApp}" + .replace("{" + "samlApp" + "}", localVarApiClient.escapeString(samlApp.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteSAMLSPClientConfigurationByAppNameValidateBeforeCall(String samlApp, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'samlApp' is set + if (samlApp == null) { + throw new ApiException("Missing the required parameter 'samlApp' when calling deleteSAMLSPClientConfigurationByAppName(Async)"); + } + + return deleteSAMLSPClientConfigurationByAppNameCall(samlApp, _callback); + + } + + /** + * Delete SAML SP Configuration + * Deletes the Service Provider configuration for a SAML client within the Tenant, identified by the application name. + * @param samlApp The SAML App identifier (required) + * @return DeleteResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public DeleteResponse deleteSAMLSPClientConfigurationByAppName(String samlApp) throws ApiException { + ApiResponse<DeleteResponse> localVarResp = deleteSAMLSPClientConfigurationByAppNameWithHttpInfo(samlApp); + return localVarResp.getData(); + } + + /** + * Delete SAML SP Configuration + * Deletes the Service Provider configuration for a SAML client within the Tenant, identified by the application name. + * @param samlApp The SAML App identifier (required) + * @return ApiResponse<DeleteResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DeleteResponse> deleteSAMLSPClientConfigurationByAppNameWithHttpInfo(String samlApp) throws ApiException { + okhttp3.Call localVarCall = deleteSAMLSPClientConfigurationByAppNameValidateBeforeCall(samlApp, null); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete SAML SP Configuration (asynchronously) + * Deletes the Service Provider configuration for a SAML client within the Tenant, identified by the application name. + * @param samlApp The SAML App identifier (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteSAMLSPClientConfigurationByAppNameAsync(String samlApp, final ApiCallback<DeleteResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteSAMLSPClientConfigurationByAppNameValidateBeforeCall(samlApp, _callback); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAllSAMLSPClientConfigurations + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllSAMLSPClientConfigurationsCall(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 = "/v2/manage/custom-providers/saml"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAllSAMLSPClientConfigurationsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getAllSAMLSPClientConfigurationsCall(_callback); + + } + + /** + * List SAML SP Configurations + * Retrieves a list of all Service Provider configurations for SAML clients within the Tenant, including details such as datamap, endpoints, and certificates. + * @return GetAllSAMLSPClientConfigurations200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public GetAllSAMLSPClientConfigurations200Response getAllSAMLSPClientConfigurations() throws ApiException { + ApiResponse<GetAllSAMLSPClientConfigurations200Response> localVarResp = getAllSAMLSPClientConfigurationsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List SAML SP Configurations + * Retrieves a list of all Service Provider configurations for SAML clients within the Tenant, including details such as datamap, endpoints, and certificates. + * @return ApiResponse<GetAllSAMLSPClientConfigurations200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetAllSAMLSPClientConfigurations200Response> getAllSAMLSPClientConfigurationsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getAllSAMLSPClientConfigurationsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<GetAllSAMLSPClientConfigurations200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List SAML SP Configurations (asynchronously) + * Retrieves a list of all Service Provider configurations for SAML clients within the Tenant, including details such as datamap, endpoints, and certificates. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllSAMLSPClientConfigurationsAsync(final ApiCallback<GetAllSAMLSPClientConfigurations200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getAllSAMLSPClientConfigurationsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<GetAllSAMLSPClientConfigurations200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getSAMLSPClientConfigurationByAppName + * @param samlApp The SAML App identifier (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getSAMLSPClientConfigurationByAppNameCall(String samlApp, 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 = "/v2/manage/custom-providers/saml/{samlApp}" + .replace("{" + "samlApp" + "}", localVarApiClient.escapeString(samlApp.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSAMLSPClientConfigurationByAppNameValidateBeforeCall(String samlApp, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'samlApp' is set + if (samlApp == null) { + throw new ApiException("Missing the required parameter 'samlApp' when calling getSAMLSPClientConfigurationByAppName(Async)"); + } + + return getSAMLSPClientConfigurationByAppNameCall(samlApp, _callback); + + } + + /** + * Retrieve SAML SP Configuration + * Retrieves the Service Provider configuration details for a SAML client within the Tenant, identified by the application name. + * @param samlApp The SAML App identifier (required) + * @return SamlSpConfig + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public SamlSpConfig getSAMLSPClientConfigurationByAppName(String samlApp) throws ApiException { + ApiResponse<SamlSpConfig> localVarResp = getSAMLSPClientConfigurationByAppNameWithHttpInfo(samlApp); + return localVarResp.getData(); + } + + /** + * Retrieve SAML SP Configuration + * Retrieves the Service Provider configuration details for a SAML client within the Tenant, identified by the application name. + * @param samlApp The SAML App identifier (required) + * @return ApiResponse<SamlSpConfig> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SamlSpConfig> getSAMLSPClientConfigurationByAppNameWithHttpInfo(String samlApp) throws ApiException { + okhttp3.Call localVarCall = getSAMLSPClientConfigurationByAppNameValidateBeforeCall(samlApp, null); + Type localVarReturnType = new TypeToken<SamlSpConfig>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve SAML SP Configuration (asynchronously) + * Retrieves the Service Provider configuration details for a SAML client within the Tenant, identified by the application name. + * @param samlApp The SAML App identifier (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getSAMLSPClientConfigurationByAppNameAsync(String samlApp, final ApiCallback<SamlSpConfig> _callback) throws ApiException { + + okhttp3.Call localVarCall = getSAMLSPClientConfigurationByAppNameValidateBeforeCall(samlApp, _callback); + Type localVarReturnType = new TypeToken<SamlSpConfig>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getSamlSPClientMappingKeys + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getSamlSPClientMappingKeysCall(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 = "/v2/manage/custom-providers/saml/keys"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSamlSPClientMappingKeysValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getSamlSPClientMappingKeysCall(_callback); + + } + + /** + * Retrieve SAML SP Mapping Keys + * Retrieves a list of mapping keys available for configuring attribute mappings in SAML Service Provider clients within the Tenant. + * @return GetSamlSPClientMappingKeys200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public GetSamlSPClientMappingKeys200Response getSamlSPClientMappingKeys() throws ApiException { + ApiResponse<GetSamlSPClientMappingKeys200Response> localVarResp = getSamlSPClientMappingKeysWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Retrieve SAML SP Mapping Keys + * Retrieves a list of mapping keys available for configuring attribute mappings in SAML Service Provider clients within the Tenant. + * @return ApiResponse<GetSamlSPClientMappingKeys200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetSamlSPClientMappingKeys200Response> getSamlSPClientMappingKeysWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getSamlSPClientMappingKeysValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<GetSamlSPClientMappingKeys200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve SAML SP Mapping Keys (asynchronously) + * Retrieves a list of mapping keys available for configuring attribute mappings in SAML Service Provider clients within the Tenant. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getSamlSPClientMappingKeysAsync(final ApiCallback<GetSamlSPClientMappingKeys200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getSamlSPClientMappingKeysValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<GetSamlSPClientMappingKeys200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for renewSAMLSppCertificate + * @param samlApp The SAML App identifier (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Status Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call renewSAMLSppCertificateCall(String samlApp, 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 = "/v2/manage/custom-providers/saml/{samlApp}/renew-certificate" + .replace("{" + "samlApp" + "}", localVarApiClient.escapeString(samlApp.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call renewSAMLSppCertificateValidateBeforeCall(String samlApp, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'samlApp' is set + if (samlApp == null) { + throw new ApiException("Missing the required parameter 'samlApp' when calling renewSAMLSppCertificate(Async)"); + } + + return renewSAMLSppCertificateCall(samlApp, _callback); + + } + + /** + * Renew SAML SP Certificate + * Renews the SAML Service Provider certificate to replace an expiring or compromised certificate. + * @param samlApp The SAML App identifier (required) + * @return SamlSpConfig + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Status Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public SamlSpConfig renewSAMLSppCertificate(String samlApp) throws ApiException { + ApiResponse<SamlSpConfig> localVarResp = renewSAMLSppCertificateWithHttpInfo(samlApp); + return localVarResp.getData(); + } + + /** + * Renew SAML SP Certificate + * Renews the SAML Service Provider certificate to replace an expiring or compromised certificate. + * @param samlApp The SAML App identifier (required) + * @return ApiResponse<SamlSpConfig> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Status Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SamlSpConfig> renewSAMLSppCertificateWithHttpInfo(String samlApp) throws ApiException { + okhttp3.Call localVarCall = renewSAMLSppCertificateValidateBeforeCall(samlApp, null); + Type localVarReturnType = new TypeToken<SamlSpConfig>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Renew SAML SP Certificate (asynchronously) + * Renews the SAML Service Provider certificate to replace an expiring or compromised certificate. + * @param samlApp The SAML App identifier (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Status Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call renewSAMLSppCertificateAsync(String samlApp, final ApiCallback<SamlSpConfig> _callback) throws ApiException { + + okhttp3.Call localVarCall = renewSAMLSppCertificateValidateBeforeCall(samlApp, _callback); + Type localVarReturnType = new TypeToken<SamlSpConfig>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateSAMLSPClientConfigurationByAppName + * @param samlApp The SAML App identifier (required) + * @param samlSpConfigModel (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateSAMLSPClientConfigurationByAppNameCall(String samlApp, SamlSpConfigModel samlSpConfigModel, 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 = samlSpConfigModel; + + // create path and map variables + String localVarPath = "/v2/manage/custom-providers/saml/{samlApp}" + .replace("{" + "samlApp" + "}", localVarApiClient.escapeString(samlApp.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateSAMLSPClientConfigurationByAppNameValidateBeforeCall(String samlApp, SamlSpConfigModel samlSpConfigModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'samlApp' is set + if (samlApp == null) { + throw new ApiException("Missing the required parameter 'samlApp' when calling updateSAMLSPClientConfigurationByAppName(Async)"); + } + + // verify the required parameter 'samlSpConfigModel' is set + if (samlSpConfigModel == null) { + throw new ApiException("Missing the required parameter 'samlSpConfigModel' when calling updateSAMLSPClientConfigurationByAppName(Async)"); + } + + return updateSAMLSPClientConfigurationByAppNameCall(samlApp, samlSpConfigModel, _callback); + + } + + /** + * Update SAML SP Configuration + * Updates an existing Service Provider configuration for a SAML client within the Tenant, identified by the application name. + * @param samlApp The SAML App identifier (required) + * @param samlSpConfigModel (required) + * @return SamlSpConfig + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public SamlSpConfig updateSAMLSPClientConfigurationByAppName(String samlApp, SamlSpConfigModel samlSpConfigModel) throws ApiException { + ApiResponse<SamlSpConfig> localVarResp = updateSAMLSPClientConfigurationByAppNameWithHttpInfo(samlApp, samlSpConfigModel); + return localVarResp.getData(); + } + + /** + * Update SAML SP Configuration + * Updates an existing Service Provider configuration for a SAML client within the Tenant, identified by the application name. + * @param samlApp The SAML App identifier (required) + * @param samlSpConfigModel (required) + * @return ApiResponse<SamlSpConfig> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SamlSpConfig> updateSAMLSPClientConfigurationByAppNameWithHttpInfo(String samlApp, SamlSpConfigModel samlSpConfigModel) throws ApiException { + okhttp3.Call localVarCall = updateSAMLSPClientConfigurationByAppNameValidateBeforeCall(samlApp, samlSpConfigModel, null); + Type localVarReturnType = new TypeToken<SamlSpConfig>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update SAML SP Configuration (asynchronously) + * Updates an existing Service Provider configuration for a SAML client within the Tenant, identified by the application name. + * @param samlApp The SAML App identifier (required) + * @param samlSpConfigModel (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateSAMLSPClientConfigurationByAppNameAsync(String samlApp, SamlSpConfigModel samlSpConfigModel, final ApiCallback<SamlSpConfig> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateSAMLSPClientConfigurationByAppNameValidateBeforeCall(samlApp, samlSpConfigModel, _callback); + Type localVarReturnType = new TypeToken<SamlSpConfig>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/SamlIntegrationsApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/SamlIntegrationsApi.java new file mode 100644 index 0000000..07d80d9 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/SamlIntegrationsApi.java @@ -0,0 +1,926 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.CreateSamlIntegrationRequest; +import com.loginradius.sdk.internal.openapi.model.DeleteResponse; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.GetAllSamlIntegrations200Response; +import com.loginradius.sdk.internal.openapi.model.SamlIntegrationRequest; +import com.loginradius.sdk.internal.openapi.model.SamlIntegrationResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SamlIntegrationsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public SamlIntegrationsApi() { + this(Configuration.getDefaultApiClient()); + } + + public SamlIntegrationsApi(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 createSamlIntegration + * @param createSamlIntegrationRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Status Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createSamlIntegrationCall(CreateSamlIntegrationRequest createSamlIntegrationRequest, 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 = createSamlIntegrationRequest; + + // create path and map variables + String localVarPath = "/v2/manage/integrations/saml"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createSamlIntegrationValidateBeforeCall(CreateSamlIntegrationRequest createSamlIntegrationRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'createSamlIntegrationRequest' is set + if (createSamlIntegrationRequest == null) { + throw new ApiException("Missing the required parameter 'createSamlIntegrationRequest' when calling createSamlIntegration(Async)"); + } + + return createSamlIntegrationCall(createSamlIntegrationRequest, _callback); + + } + + /** + * Create SAML IdP Configuration + * Creates a new SAML-based Identity Provider integration for the Tenant, enabling authentication and federation with the specified IdP. + * @param createSamlIntegrationRequest (required) + * @return SamlIntegrationResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Status Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public SamlIntegrationResponse createSamlIntegration(CreateSamlIntegrationRequest createSamlIntegrationRequest) throws ApiException { + ApiResponse<SamlIntegrationResponse> localVarResp = createSamlIntegrationWithHttpInfo(createSamlIntegrationRequest); + return localVarResp.getData(); + } + + /** + * Create SAML IdP Configuration + * Creates a new SAML-based Identity Provider integration for the Tenant, enabling authentication and federation with the specified IdP. + * @param createSamlIntegrationRequest (required) + * @return ApiResponse<SamlIntegrationResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Status Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SamlIntegrationResponse> createSamlIntegrationWithHttpInfo(CreateSamlIntegrationRequest createSamlIntegrationRequest) throws ApiException { + okhttp3.Call localVarCall = createSamlIntegrationValidateBeforeCall(createSamlIntegrationRequest, null); + Type localVarReturnType = new TypeToken<SamlIntegrationResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create SAML IdP Configuration (asynchronously) + * Creates a new SAML-based Identity Provider integration for the Tenant, enabling authentication and federation with the specified IdP. + * @param createSamlIntegrationRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Status Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createSamlIntegrationAsync(CreateSamlIntegrationRequest createSamlIntegrationRequest, final ApiCallback<SamlIntegrationResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = createSamlIntegrationValidateBeforeCall(createSamlIntegrationRequest, _callback); + Type localVarReturnType = new TypeToken<SamlIntegrationResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteSamlIntegrationByAppName + * @param samlApp The SAML App identifier (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteSamlIntegrationByAppNameCall(String samlApp, 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 = "/v2/manage/integrations/saml/{samlApp}" + .replace("{" + "samlApp" + "}", localVarApiClient.escapeString(samlApp.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteSamlIntegrationByAppNameValidateBeforeCall(String samlApp, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'samlApp' is set + if (samlApp == null) { + throw new ApiException("Missing the required parameter 'samlApp' when calling deleteSamlIntegrationByAppName(Async)"); + } + + return deleteSamlIntegrationByAppNameCall(samlApp, _callback); + + } + + /** + * Delete SAML IdP Configuration + * Deletes the SAML-based Identity Provider configuration for the Tenant identified by the application name, disabling authentication for the specified application. + * @param samlApp The SAML App identifier (required) + * @return DeleteResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public DeleteResponse deleteSamlIntegrationByAppName(String samlApp) throws ApiException { + ApiResponse<DeleteResponse> localVarResp = deleteSamlIntegrationByAppNameWithHttpInfo(samlApp); + return localVarResp.getData(); + } + + /** + * Delete SAML IdP Configuration + * Deletes the SAML-based Identity Provider configuration for the Tenant identified by the application name, disabling authentication for the specified application. + * @param samlApp The SAML App identifier (required) + * @return ApiResponse<DeleteResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DeleteResponse> deleteSamlIntegrationByAppNameWithHttpInfo(String samlApp) throws ApiException { + okhttp3.Call localVarCall = deleteSamlIntegrationByAppNameValidateBeforeCall(samlApp, null); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete SAML IdP Configuration (asynchronously) + * Deletes the SAML-based Identity Provider configuration for the Tenant identified by the application name, disabling authentication for the specified application. + * @param samlApp The SAML App identifier (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteSamlIntegrationByAppNameAsync(String samlApp, final ApiCallback<DeleteResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteSamlIntegrationByAppNameValidateBeforeCall(samlApp, _callback); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAllSamlIntegrations + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllSamlIntegrationsCall(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 = "/v2/manage/integrations/saml"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAllSamlIntegrationsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getAllSamlIntegrationsCall(_callback); + + } + + /** + * List SAML Integrations + * Retrieves a list of all configured SAML-based Identity Provider integrations for the Tenant, including metadata and settings for authentication. + * @return GetAllSamlIntegrations200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public GetAllSamlIntegrations200Response getAllSamlIntegrations() throws ApiException { + ApiResponse<GetAllSamlIntegrations200Response> localVarResp = getAllSamlIntegrationsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List SAML Integrations + * Retrieves a list of all configured SAML-based Identity Provider integrations for the Tenant, including metadata and settings for authentication. + * @return ApiResponse<GetAllSamlIntegrations200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetAllSamlIntegrations200Response> getAllSamlIntegrationsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getAllSamlIntegrationsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<GetAllSamlIntegrations200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List SAML Integrations (asynchronously) + * Retrieves a list of all configured SAML-based Identity Provider integrations for the Tenant, including metadata and settings for authentication. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllSamlIntegrationsAsync(final ApiCallback<GetAllSamlIntegrations200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getAllSamlIntegrationsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<GetAllSamlIntegrations200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getSamlIntegrationByAppName + * @param samlApp The SAML App identifier (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getSamlIntegrationByAppNameCall(String samlApp, 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 = "/v2/manage/integrations/saml/{samlApp}" + .replace("{" + "samlApp" + "}", localVarApiClient.escapeString(samlApp.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSamlIntegrationByAppNameValidateBeforeCall(String samlApp, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'samlApp' is set + if (samlApp == null) { + throw new ApiException("Missing the required parameter 'samlApp' when calling getSamlIntegrationByAppName(Async)"); + } + + return getSamlIntegrationByAppNameCall(samlApp, _callback); + + } + + /** + * Retrieve SAML IdP client configuration by app name + * Retrieves the SAML-based Identity Provider configuration details for the Tenant using the application name, including metadata and settings. + * @param samlApp The SAML App identifier (required) + * @return SamlIntegrationResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public SamlIntegrationResponse getSamlIntegrationByAppName(String samlApp) throws ApiException { + ApiResponse<SamlIntegrationResponse> localVarResp = getSamlIntegrationByAppNameWithHttpInfo(samlApp); + return localVarResp.getData(); + } + + /** + * Retrieve SAML IdP client configuration by app name + * Retrieves the SAML-based Identity Provider configuration details for the Tenant using the application name, including metadata and settings. + * @param samlApp The SAML App identifier (required) + * @return ApiResponse<SamlIntegrationResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SamlIntegrationResponse> getSamlIntegrationByAppNameWithHttpInfo(String samlApp) throws ApiException { + okhttp3.Call localVarCall = getSamlIntegrationByAppNameValidateBeforeCall(samlApp, null); + Type localVarReturnType = new TypeToken<SamlIntegrationResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve SAML IdP client configuration by app name (asynchronously) + * Retrieves the SAML-based Identity Provider configuration details for the Tenant using the application name, including metadata and settings. + * @param samlApp The SAML App identifier (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getSamlIntegrationByAppNameAsync(String samlApp, final ApiCallback<SamlIntegrationResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getSamlIntegrationByAppNameValidateBeforeCall(samlApp, _callback); + Type localVarReturnType = new TypeToken<SamlIntegrationResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for renewSamlIntegrationCertificate + * @param samlApp The SAML App identifier (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Status Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call renewSamlIntegrationCertificateCall(String samlApp, 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 = "/v2/manage/integrations/saml/{samlApp}/renew-certificate" + .replace("{" + "samlApp" + "}", localVarApiClient.escapeString(samlApp.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call renewSamlIntegrationCertificateValidateBeforeCall(String samlApp, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'samlApp' is set + if (samlApp == null) { + throw new ApiException("Missing the required parameter 'samlApp' when calling renewSamlIntegrationCertificate(Async)"); + } + + return renewSamlIntegrationCertificateCall(samlApp, _callback); + + } + + /** + * Renew SAML IdP Certificate + * Renews the SAML Identity Provider certificate to replace an expiring or compromised signing certificate. + * @param samlApp The SAML App identifier (required) + * @return SamlIntegrationResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Status Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public SamlIntegrationResponse renewSamlIntegrationCertificate(String samlApp) throws ApiException { + ApiResponse<SamlIntegrationResponse> localVarResp = renewSamlIntegrationCertificateWithHttpInfo(samlApp); + return localVarResp.getData(); + } + + /** + * Renew SAML IdP Certificate + * Renews the SAML Identity Provider certificate to replace an expiring or compromised signing certificate. + * @param samlApp The SAML App identifier (required) + * @return ApiResponse<SamlIntegrationResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Status Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SamlIntegrationResponse> renewSamlIntegrationCertificateWithHttpInfo(String samlApp) throws ApiException { + okhttp3.Call localVarCall = renewSamlIntegrationCertificateValidateBeforeCall(samlApp, null); + Type localVarReturnType = new TypeToken<SamlIntegrationResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Renew SAML IdP Certificate (asynchronously) + * Renews the SAML Identity Provider certificate to replace an expiring or compromised signing certificate. + * @param samlApp The SAML App identifier (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Status Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call renewSamlIntegrationCertificateAsync(String samlApp, final ApiCallback<SamlIntegrationResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = renewSamlIntegrationCertificateValidateBeforeCall(samlApp, _callback); + Type localVarReturnType = new TypeToken<SamlIntegrationResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateSamlIntegrationByAppName + * @param samlApp The SAML App identifier (required) + * @param samlIntegrationRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateSamlIntegrationByAppNameCall(String samlApp, SamlIntegrationRequest samlIntegrationRequest, 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 = samlIntegrationRequest; + + // create path and map variables + String localVarPath = "/v2/manage/integrations/saml/{samlApp}" + .replace("{" + "samlApp" + "}", localVarApiClient.escapeString(samlApp.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateSamlIntegrationByAppNameValidateBeforeCall(String samlApp, SamlIntegrationRequest samlIntegrationRequest, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'samlApp' is set + if (samlApp == null) { + throw new ApiException("Missing the required parameter 'samlApp' when calling updateSamlIntegrationByAppName(Async)"); + } + + // verify the required parameter 'samlIntegrationRequest' is set + if (samlIntegrationRequest == null) { + throw new ApiException("Missing the required parameter 'samlIntegrationRequest' when calling updateSamlIntegrationByAppName(Async)"); + } + + return updateSamlIntegrationByAppNameCall(samlApp, samlIntegrationRequest, _callback); + + } + + /** + * Update SAML IdP client configuration by app name + * Updates an existing SAML-based Identity Provider configuration for the Tenant identified by the application name, modifying necessary settings. + * @param samlApp The SAML App identifier (required) + * @param samlIntegrationRequest (required) + * @return SamlIntegrationResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public SamlIntegrationResponse updateSamlIntegrationByAppName(String samlApp, SamlIntegrationRequest samlIntegrationRequest) throws ApiException { + ApiResponse<SamlIntegrationResponse> localVarResp = updateSamlIntegrationByAppNameWithHttpInfo(samlApp, samlIntegrationRequest); + return localVarResp.getData(); + } + + /** + * Update SAML IdP client configuration by app name + * Updates an existing SAML-based Identity Provider configuration for the Tenant identified by the application name, modifying necessary settings. + * @param samlApp The SAML App identifier (required) + * @param samlIntegrationRequest (required) + * @return ApiResponse<SamlIntegrationResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SamlIntegrationResponse> updateSamlIntegrationByAppNameWithHttpInfo(String samlApp, SamlIntegrationRequest samlIntegrationRequest) throws ApiException { + okhttp3.Call localVarCall = updateSamlIntegrationByAppNameValidateBeforeCall(samlApp, samlIntegrationRequest, null); + Type localVarReturnType = new TypeToken<SamlIntegrationResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update SAML IdP client configuration by app name (asynchronously) + * Updates an existing SAML-based Identity Provider configuration for the Tenant identified by the application name, modifying necessary settings. + * @param samlApp The SAML App identifier (required) + * @param samlIntegrationRequest (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateSamlIntegrationByAppNameAsync(String samlApp, SamlIntegrationRequest samlIntegrationRequest, final ApiCallback<SamlIntegrationResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateSamlIntegrationByAppNameValidateBeforeCall(samlApp, samlIntegrationRequest, _callback); + Type localVarReturnType = new TypeToken<SamlIntegrationResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/SecondFactorConfigurationApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/SecondFactorConfigurationApi.java new file mode 100644 index 0000000..82dff9b --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/SecondFactorConfigurationApi.java @@ -0,0 +1,866 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.DuoSecurityAuthenticator; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.GoogleAuthenticator; +import com.loginradius.sdk.internal.openapi.model.MFASettings; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SecondFactorConfigurationApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public SecondFactorConfigurationApi() { + this(Configuration.getDefaultApiClient()); + } + + public SecondFactorConfigurationApi(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 getDuoAuthenticatorConfiguration + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getDuoAuthenticatorConfigurationCall(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 = "/v2/manage/2fa/duo-authenticator-settings"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getDuoAuthenticatorConfigurationValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getDuoAuthenticatorConfigurationCall(_callback); + + } + + /** + * Retrieve Duo configuration + * Retrieves the Duo Authentication configuration for a specific Tenant. + * @return DuoSecurityAuthenticator + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public DuoSecurityAuthenticator getDuoAuthenticatorConfiguration() throws ApiException { + ApiResponse<DuoSecurityAuthenticator> localVarResp = getDuoAuthenticatorConfigurationWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Retrieve Duo configuration + * Retrieves the Duo Authentication configuration for a specific Tenant. + * @return ApiResponse<DuoSecurityAuthenticator> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DuoSecurityAuthenticator> getDuoAuthenticatorConfigurationWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getDuoAuthenticatorConfigurationValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<DuoSecurityAuthenticator>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Duo configuration (asynchronously) + * Retrieves the Duo Authentication configuration for a specific Tenant. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getDuoAuthenticatorConfigurationAsync(final ApiCallback<DuoSecurityAuthenticator> _callback) throws ApiException { + + okhttp3.Call localVarCall = getDuoAuthenticatorConfigurationValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<DuoSecurityAuthenticator>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getSecondFactorConfiguration + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getSecondFactorConfigurationCall(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 = "/v2/manage/2fa/config"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSecondFactorConfigurationValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getSecondFactorConfigurationCall(_callback); + + } + + /** + * Retrieve second factor configuration + * Retrieves the second factor authentication configuration for the Tenant. + * @return MFASettings + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public MFASettings getSecondFactorConfiguration() throws ApiException { + ApiResponse<MFASettings> localVarResp = getSecondFactorConfigurationWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Retrieve second factor configuration + * Retrieves the second factor authentication configuration for the Tenant. + * @return ApiResponse<MFASettings> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<MFASettings> getSecondFactorConfigurationWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getSecondFactorConfigurationValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<MFASettings>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve second factor configuration (asynchronously) + * Retrieves the second factor authentication configuration for the Tenant. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getSecondFactorConfigurationAsync(final ApiCallback<MFASettings> _callback) throws ApiException { + + okhttp3.Call localVarCall = getSecondFactorConfigurationValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<MFASettings>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getTOTPConfiguration + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getTOTPConfigurationCall(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 = "/v2/manage/2fa/totp-authenticator-settings"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getTOTPConfigurationValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getTOTPConfigurationCall(_callback); + + } + + /** + * Retrieve TOTP configuration + * Retrieves the Time-based One Time Password (TOTP) configuration for a specific Tenant. + * @return GoogleAuthenticator + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public GoogleAuthenticator getTOTPConfiguration() throws ApiException { + ApiResponse<GoogleAuthenticator> localVarResp = getTOTPConfigurationWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Retrieve TOTP configuration + * Retrieves the Time-based One Time Password (TOTP) configuration for a specific Tenant. + * @return ApiResponse<GoogleAuthenticator> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GoogleAuthenticator> getTOTPConfigurationWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getTOTPConfigurationValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<GoogleAuthenticator>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve TOTP configuration (asynchronously) + * Retrieves the Time-based One Time Password (TOTP) configuration for a specific Tenant. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getTOTPConfigurationAsync(final ApiCallback<GoogleAuthenticator> _callback) throws ApiException { + + okhttp3.Call localVarCall = getTOTPConfigurationValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<GoogleAuthenticator>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateDuoAuthenticatorConfiguration + * @param duoSecurityAuthenticator (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateDuoAuthenticatorConfigurationCall(DuoSecurityAuthenticator duoSecurityAuthenticator, 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 = duoSecurityAuthenticator; + + // create path and map variables + String localVarPath = "/v2/manage/2fa/duo-authenticator-settings"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateDuoAuthenticatorConfigurationValidateBeforeCall(DuoSecurityAuthenticator duoSecurityAuthenticator, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'duoSecurityAuthenticator' is set + if (duoSecurityAuthenticator == null) { + throw new ApiException("Missing the required parameter 'duoSecurityAuthenticator' when calling updateDuoAuthenticatorConfiguration(Async)"); + } + + return updateDuoAuthenticatorConfigurationCall(duoSecurityAuthenticator, _callback); + + } + + /** + * Update Duo configuration + * Updates the Duo Authentication configuration for a specific Tenant. + * @param duoSecurityAuthenticator (required) + * @return DuoSecurityAuthenticator + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public DuoSecurityAuthenticator updateDuoAuthenticatorConfiguration(DuoSecurityAuthenticator duoSecurityAuthenticator) throws ApiException { + ApiResponse<DuoSecurityAuthenticator> localVarResp = updateDuoAuthenticatorConfigurationWithHttpInfo(duoSecurityAuthenticator); + return localVarResp.getData(); + } + + /** + * Update Duo configuration + * Updates the Duo Authentication configuration for a specific Tenant. + * @param duoSecurityAuthenticator (required) + * @return ApiResponse<DuoSecurityAuthenticator> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DuoSecurityAuthenticator> updateDuoAuthenticatorConfigurationWithHttpInfo(DuoSecurityAuthenticator duoSecurityAuthenticator) throws ApiException { + okhttp3.Call localVarCall = updateDuoAuthenticatorConfigurationValidateBeforeCall(duoSecurityAuthenticator, null); + Type localVarReturnType = new TypeToken<DuoSecurityAuthenticator>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Duo configuration (asynchronously) + * Updates the Duo Authentication configuration for a specific Tenant. + * @param duoSecurityAuthenticator (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateDuoAuthenticatorConfigurationAsync(DuoSecurityAuthenticator duoSecurityAuthenticator, final ApiCallback<DuoSecurityAuthenticator> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateDuoAuthenticatorConfigurationValidateBeforeCall(duoSecurityAuthenticator, _callback); + Type localVarReturnType = new TypeToken<DuoSecurityAuthenticator>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateSecondFactorConfiguration + * @param mfASettings (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateSecondFactorConfigurationCall(MFASettings mfASettings, 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 = mfASettings; + + // create path and map variables + String localVarPath = "/v2/manage/2fa/config"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateSecondFactorConfigurationValidateBeforeCall(MFASettings mfASettings, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'mfASettings' is set + if (mfASettings == null) { + throw new ApiException("Missing the required parameter 'mfASettings' when calling updateSecondFactorConfiguration(Async)"); + } + + return updateSecondFactorConfigurationCall(mfASettings, _callback); + + } + + /** + * Update second factor configuration + * Updates the second factor authentication configuration for the Tenant. + * @param mfASettings (required) + * @return MFASettings + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public MFASettings updateSecondFactorConfiguration(MFASettings mfASettings) throws ApiException { + ApiResponse<MFASettings> localVarResp = updateSecondFactorConfigurationWithHttpInfo(mfASettings); + return localVarResp.getData(); + } + + /** + * Update second factor configuration + * Updates the second factor authentication configuration for the Tenant. + * @param mfASettings (required) + * @return ApiResponse<MFASettings> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<MFASettings> updateSecondFactorConfigurationWithHttpInfo(MFASettings mfASettings) throws ApiException { + okhttp3.Call localVarCall = updateSecondFactorConfigurationValidateBeforeCall(mfASettings, null); + Type localVarReturnType = new TypeToken<MFASettings>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update second factor configuration (asynchronously) + * Updates the second factor authentication configuration for the Tenant. + * @param mfASettings (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateSecondFactorConfigurationAsync(MFASettings mfASettings, final ApiCallback<MFASettings> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateSecondFactorConfigurationValidateBeforeCall(mfASettings, _callback); + Type localVarReturnType = new TypeToken<MFASettings>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateTOTPConfiguration + * @param googleAuthenticator (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateTOTPConfigurationCall(GoogleAuthenticator googleAuthenticator, 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 = googleAuthenticator; + + // create path and map variables + String localVarPath = "/v2/manage/2fa/totp-authenticator-settings"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateTOTPConfigurationValidateBeforeCall(GoogleAuthenticator googleAuthenticator, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'googleAuthenticator' is set + if (googleAuthenticator == null) { + throw new ApiException("Missing the required parameter 'googleAuthenticator' when calling updateTOTPConfiguration(Async)"); + } + + return updateTOTPConfigurationCall(googleAuthenticator, _callback); + + } + + /** + * Update TOTP configuration + * Updates the Time-based One Time Password (TOTP) configuration for a specific Tenant. + * @param googleAuthenticator (required) + * @return GoogleAuthenticator + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public GoogleAuthenticator updateTOTPConfiguration(GoogleAuthenticator googleAuthenticator) throws ApiException { + ApiResponse<GoogleAuthenticator> localVarResp = updateTOTPConfigurationWithHttpInfo(googleAuthenticator); + return localVarResp.getData(); + } + + /** + * Update TOTP configuration + * Updates the Time-based One Time Password (TOTP) configuration for a specific Tenant. + * @param googleAuthenticator (required) + * @return ApiResponse<GoogleAuthenticator> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GoogleAuthenticator> updateTOTPConfigurationWithHttpInfo(GoogleAuthenticator googleAuthenticator) throws ApiException { + okhttp3.Call localVarCall = updateTOTPConfigurationValidateBeforeCall(googleAuthenticator, null); + Type localVarReturnType = new TypeToken<GoogleAuthenticator>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update TOTP configuration (asynchronously) + * Updates the Time-based One Time Password (TOTP) configuration for a specific Tenant. + * @param googleAuthenticator (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateTOTPConfigurationAsync(GoogleAuthenticator googleAuthenticator, final ApiCallback<GoogleAuthenticator> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateTOTPConfigurationValidateBeforeCall(googleAuthenticator, _callback); + Type localVarReturnType = new TypeToken<GoogleAuthenticator>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/SecurityApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/SecurityApi.java new file mode 100644 index 0000000..e4ffe0b --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/SecurityApi.java @@ -0,0 +1,8980 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.AccountRegisterMFAPasskeyFinishRequest; +import com.loginradius.sdk.internal.openapi.model.ApiError; +import com.loginradius.sdk.internal.openapi.model.AuthResponse; +import com.loginradius.sdk.internal.openapi.model.AuthenticatorCodeRequest; +import com.loginradius.sdk.internal.openapi.model.BeginMFAPasskeyRegistration200Response; +import com.loginradius.sdk.internal.openapi.model.BeginPasskeyMFAVerification200Response; +import com.loginradius.sdk.internal.openapi.model.ChangePin; +import com.loginradius.sdk.internal.openapi.model.DuoVerifyRequest; +import com.loginradius.sdk.internal.openapi.model.EmailModel; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.FinishMFAPasskeyRegistrationRequest; +import com.loginradius.sdk.internal.openapi.model.FinishPasskeyMFAVerificationRequest; +import com.loginradius.sdk.internal.openapi.model.ForgotPinByEmail; +import com.loginradius.sdk.internal.openapi.model.ForgotPinByPhone; +import com.loginradius.sdk.internal.openapi.model.ForgotPinByUsername; +import com.loginradius.sdk.internal.openapi.model.IdentityResponseWithSocialWithoutLogins; +import com.loginradius.sdk.internal.openapi.model.IsDeleted; +import com.loginradius.sdk.internal.openapi.model.IsPostedResponse; +import com.loginradius.sdk.internal.openapi.model.IsRegistered; +import com.loginradius.sdk.internal.openapi.model.MFABackUpCodeResponse; +import com.loginradius.sdk.internal.openapi.model.MFAPhoneUpdateModel; +import com.loginradius.sdk.internal.openapi.model.MFAVerifyPhoneOtpModel; +import com.loginradius.sdk.internal.openapi.model.PINLoginModel; +import com.loginradius.sdk.internal.openapi.model.PINModel; +import com.loginradius.sdk.internal.openapi.model.PasskeyCredentialObject; +import com.loginradius.sdk.internal.openapi.model.PasswordReauthRequest; +import com.loginradius.sdk.internal.openapi.model.PinReauthRequest; +import com.loginradius.sdk.internal.openapi.model.Profile; +import com.loginradius.sdk.internal.openapi.model.ReAuthModelByEmailOtp; +import com.loginradius.sdk.internal.openapi.model.ReAuthResponse; +import com.loginradius.sdk.internal.openapi.model.ReAuthTwoFAModel; +import com.loginradius.sdk.internal.openapi.model.ResetPINByOTP; +import com.loginradius.sdk.internal.openapi.model.ResetPINByToken; +import com.loginradius.sdk.internal.openapi.model.SMSResponse; +import com.loginradius.sdk.internal.openapi.model.SMSResponseData; +import com.loginradius.sdk.internal.openapi.model.TwoFAAuthByBackupCode; +import com.loginradius.sdk.internal.openapi.model.TwoFAAuthBySecQuesAuthModel; +import com.loginradius.sdk.internal.openapi.model.TwoFactorAuthenticationSettings; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SecurityApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public SecurityApi() { + this(Configuration.getDefaultApiClient()); + } + + public SecurityApi(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 accountRegisterMFAPasskeyBegin + * @param accessToken Access Token of the User (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated credential registration </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call accountRegisterMFAPasskeyBeginCall(String accessToken, 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 = "/identity/v2/auth/account/2fa/register/passkey/begin"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + 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[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call accountRegisterMFAPasskeyBeginValidateBeforeCall(String accessToken, final ApiCallback _callback) throws ApiException { + return accountRegisterMFAPasskeyBeginCall(accessToken, _callback); + + } + + /** + * Begin MFA Passkey registration + * Initiates the MFA Passkey registration flow for an Account. + * @param accessToken Access Token of the User (optional) + * @return BeginMFAPasskeyRegistration200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated credential registration </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public BeginMFAPasskeyRegistration200Response accountRegisterMFAPasskeyBegin(String accessToken) throws ApiException { + ApiResponse<BeginMFAPasskeyRegistration200Response> localVarResp = accountRegisterMFAPasskeyBeginWithHttpInfo(accessToken); + return localVarResp.getData(); + } + + /** + * Begin MFA Passkey registration + * Initiates the MFA Passkey registration flow for an Account. + * @param accessToken Access Token of the User (optional) + * @return ApiResponse<BeginMFAPasskeyRegistration200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated credential registration </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<BeginMFAPasskeyRegistration200Response> accountRegisterMFAPasskeyBeginWithHttpInfo(String accessToken) throws ApiException { + okhttp3.Call localVarCall = accountRegisterMFAPasskeyBeginValidateBeforeCall(accessToken, null); + Type localVarReturnType = new TypeToken<BeginMFAPasskeyRegistration200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Begin MFA Passkey registration (asynchronously) + * Initiates the MFA Passkey registration flow for an Account. + * @param accessToken Access Token of the User (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated credential registration </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call accountRegisterMFAPasskeyBeginAsync(String accessToken, final ApiCallback<BeginMFAPasskeyRegistration200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = accountRegisterMFAPasskeyBeginValidateBeforeCall(accessToken, _callback); + Type localVarReturnType = new TypeToken<BeginMFAPasskeyRegistration200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for accountRegisterMFAPasskeyFinish + * @param accountRegisterMFAPasskeyFinishRequest (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully finished credential registration </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call accountRegisterMFAPasskeyFinishCall(AccountRegisterMFAPasskeyFinishRequest accountRegisterMFAPasskeyFinishRequest, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, 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 = accountRegisterMFAPasskeyFinishRequest; + + // create path and map variables + String localVarPath = "/identity/v2/auth/account/2fa/register/passkey/finish"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call accountRegisterMFAPasskeyFinishValidateBeforeCall(AccountRegisterMFAPasskeyFinishRequest accountRegisterMFAPasskeyFinishRequest, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'accountRegisterMFAPasskeyFinishRequest' is set + if (accountRegisterMFAPasskeyFinishRequest == null) { + throw new ApiException("Missing the required parameter 'accountRegisterMFAPasskeyFinishRequest' when calling accountRegisterMFAPasskeyFinish(Async)"); + } + + return accountRegisterMFAPasskeyFinishCall(accountRegisterMFAPasskeyFinishRequest, accessToken, preventWebhook, xPreventWebhook, _callback); + + } + + /** + * Complete MFA Passkey registration + * Completes the MFA Passkey registration flow for an Account. + * @param accountRegisterMFAPasskeyFinishRequest (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return PasskeyCredentialObject + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully finished credential registration </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public PasskeyCredentialObject accountRegisterMFAPasskeyFinish(AccountRegisterMFAPasskeyFinishRequest accountRegisterMFAPasskeyFinishRequest, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + ApiResponse<PasskeyCredentialObject> localVarResp = accountRegisterMFAPasskeyFinishWithHttpInfo(accountRegisterMFAPasskeyFinishRequest, accessToken, preventWebhook, xPreventWebhook); + return localVarResp.getData(); + } + + /** + * Complete MFA Passkey registration + * Completes the MFA Passkey registration flow for an Account. + * @param accountRegisterMFAPasskeyFinishRequest (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<PasskeyCredentialObject> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully finished credential registration </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<PasskeyCredentialObject> accountRegisterMFAPasskeyFinishWithHttpInfo(AccountRegisterMFAPasskeyFinishRequest accountRegisterMFAPasskeyFinishRequest, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + okhttp3.Call localVarCall = accountRegisterMFAPasskeyFinishValidateBeforeCall(accountRegisterMFAPasskeyFinishRequest, accessToken, preventWebhook, xPreventWebhook, null); + Type localVarReturnType = new TypeToken<PasskeyCredentialObject>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Complete MFA Passkey registration (asynchronously) + * Completes the MFA Passkey registration flow for an Account. + * @param accountRegisterMFAPasskeyFinishRequest (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully finished credential registration </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call accountRegisterMFAPasskeyFinishAsync(AccountRegisterMFAPasskeyFinishRequest accountRegisterMFAPasskeyFinishRequest, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback<PasskeyCredentialObject> _callback) throws ApiException { + + okhttp3.Call localVarCall = accountRegisterMFAPasskeyFinishValidateBeforeCall(accountRegisterMFAPasskeyFinishRequest, accessToken, preventWebhook, xPreventWebhook, _callback); + Type localVarReturnType = new TypeToken<PasskeyCredentialObject>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for beginMFAPasskeyRegistration + * @param secondfactorauthenticationtoken Second factor token (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated credential registration </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call beginMFAPasskeyRegistrationCall(String secondfactorauthenticationtoken, 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 = "/identity/v2/auth/login/2fa/register/passkey/begin"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (secondfactorauthenticationtoken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("secondfactorauthenticationtoken", secondfactorauthenticationtoken)); + } + + 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[] { "APIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call beginMFAPasskeyRegistrationValidateBeforeCall(String secondfactorauthenticationtoken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'secondfactorauthenticationtoken' is set + if (secondfactorauthenticationtoken == null) { + throw new ApiException("Missing the required parameter 'secondfactorauthenticationtoken' when calling beginMFAPasskeyRegistration(Async)"); + } + + return beginMFAPasskeyRegistrationCall(secondfactorauthenticationtoken, _callback); + + } + + /** + * Begin Passkey Registration with MFA Token + * Begins the MFA Passkey registration flow. + * @param secondfactorauthenticationtoken Second factor token (required) + * @return BeginMFAPasskeyRegistration200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated credential registration </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public BeginMFAPasskeyRegistration200Response beginMFAPasskeyRegistration(String secondfactorauthenticationtoken) throws ApiException { + ApiResponse<BeginMFAPasskeyRegistration200Response> localVarResp = beginMFAPasskeyRegistrationWithHttpInfo(secondfactorauthenticationtoken); + return localVarResp.getData(); + } + + /** + * Begin Passkey Registration with MFA Token + * Begins the MFA Passkey registration flow. + * @param secondfactorauthenticationtoken Second factor token (required) + * @return ApiResponse<BeginMFAPasskeyRegistration200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated credential registration </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<BeginMFAPasskeyRegistration200Response> beginMFAPasskeyRegistrationWithHttpInfo(String secondfactorauthenticationtoken) throws ApiException { + okhttp3.Call localVarCall = beginMFAPasskeyRegistrationValidateBeforeCall(secondfactorauthenticationtoken, null); + Type localVarReturnType = new TypeToken<BeginMFAPasskeyRegistration200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Begin Passkey Registration with MFA Token (asynchronously) + * Begins the MFA Passkey registration flow. + * @param secondfactorauthenticationtoken Second factor token (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated credential registration </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call beginMFAPasskeyRegistrationAsync(String secondfactorauthenticationtoken, final ApiCallback<BeginMFAPasskeyRegistration200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = beginMFAPasskeyRegistrationValidateBeforeCall(secondfactorauthenticationtoken, _callback); + Type localVarReturnType = new TypeToken<BeginMFAPasskeyRegistration200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for beginPasskeyMFAVerification + * @param secondfactorauthenticationtoken Second factor token (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated login </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call beginPasskeyMFAVerificationCall(String secondfactorauthenticationtoken, 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 = "/identity/v2/auth/login/2fa/passkey/begin"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (secondfactorauthenticationtoken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("secondfactorauthenticationtoken", secondfactorauthenticationtoken)); + } + + 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[] { "APIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call beginPasskeyMFAVerificationValidateBeforeCall(String secondfactorauthenticationtoken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'secondfactorauthenticationtoken' is set + if (secondfactorauthenticationtoken == null) { + throw new ApiException("Missing the required parameter 'secondfactorauthenticationtoken' when calling beginPasskeyMFAVerification(Async)"); + } + + return beginPasskeyMFAVerificationCall(secondfactorauthenticationtoken, _callback); + + } + + /** + * Begin Passkey Login with MFA Token + * Begins the MFA Passkey verification flow. + * @param secondfactorauthenticationtoken Second factor token (required) + * @return BeginPasskeyMFAVerification200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated login </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public BeginPasskeyMFAVerification200Response beginPasskeyMFAVerification(String secondfactorauthenticationtoken) throws ApiException { + ApiResponse<BeginPasskeyMFAVerification200Response> localVarResp = beginPasskeyMFAVerificationWithHttpInfo(secondfactorauthenticationtoken); + return localVarResp.getData(); + } + + /** + * Begin Passkey Login with MFA Token + * Begins the MFA Passkey verification flow. + * @param secondfactorauthenticationtoken Second factor token (required) + * @return ApiResponse<BeginPasskeyMFAVerification200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated login </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<BeginPasskeyMFAVerification200Response> beginPasskeyMFAVerificationWithHttpInfo(String secondfactorauthenticationtoken) throws ApiException { + okhttp3.Call localVarCall = beginPasskeyMFAVerificationValidateBeforeCall(secondfactorauthenticationtoken, null); + Type localVarReturnType = new TypeToken<BeginPasskeyMFAVerification200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Begin Passkey Login with MFA Token (asynchronously) + * Begins the MFA Passkey verification flow. + * @param secondfactorauthenticationtoken Second factor token (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully initiated login </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call beginPasskeyMFAVerificationAsync(String secondfactorauthenticationtoken, final ApiCallback<BeginPasskeyMFAVerification200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = beginPasskeyMFAVerificationValidateBeforeCall(secondfactorauthenticationtoken, _callback); + Type localVarReturnType = new TypeToken<BeginPasskeyMFAVerification200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for changePinByAccessToken + * @param changePin (required) + * @param accessToken Access Token of the User (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully submit request to reset the PIN </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call changePinByAccessTokenCall(ChangePin changePin, String accessToken, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, 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 = changePin; + + // create path and map variables + String localVarPath = "/identity/v2/auth/pin/change"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (gRecaptchaResponse2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g_recaptcha_response", gRecaptchaResponse2)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call changePinByAccessTokenValidateBeforeCall(ChangePin changePin, String accessToken, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'changePin' is set + if (changePin == null) { + throw new ApiException("Missing the required parameter 'changePin' when calling changePinByAccessToken(Async)"); + } + + return changePinByAccessTokenCall(changePin, accessToken, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, _callback); + + } + + /** + * Update PIN with Access Token + * Updates an existing PIN by providing the current PIN and a valid Access Token for authentication, allowing a User to change their PIN while logged in. + * @param changePin (required) + * @param accessToken Access Token of the User (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @return IsPostedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully submit request to reset the PIN </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public IsPostedResponse changePinByAccessToken(ChangePin changePin, String accessToken, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr) throws ApiException { + ApiResponse<IsPostedResponse> localVarResp = changePinByAccessTokenWithHttpInfo(changePin, accessToken, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr); + return localVarResp.getData(); + } + + /** + * Update PIN with Access Token + * Updates an existing PIN by providing the current PIN and a valid Access Token for authentication, allowing a User to change their PIN while logged in. + * @param changePin (required) + * @param accessToken Access Token of the User (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @return ApiResponse<IsPostedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully submit request to reset the PIN </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedResponse> changePinByAccessTokenWithHttpInfo(ChangePin changePin, String accessToken, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr) throws ApiException { + okhttp3.Call localVarCall = changePinByAccessTokenValidateBeforeCall(changePin, accessToken, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, null); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update PIN with Access Token (asynchronously) + * Updates an existing PIN by providing the current PIN and a valid Access Token for authentication, allowing a User to change their PIN while logged in. + * @param changePin (required) + * @param accessToken Access Token of the User (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully submit request to reset the PIN </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call changePinByAccessTokenAsync(ChangePin changePin, String accessToken, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, final ApiCallback<IsPostedResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = changePinByAccessTokenValidateBeforeCall(changePin, accessToken, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, _callback); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for duoAuthVerificationByMFASecondFactorToken + * @param secondfactorauthenticationtoken Second factor token (required) + * @param duoVerifyRequest (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbaoneclickemailtemplate RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call duoAuthVerificationByMFASecondFactorTokenCall(String secondfactorauthenticationtoken, DuoVerifyRequest duoVerifyRequest, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, 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 = duoVerifyRequest; + + // create path and map variables + String localVarPath = "/identity/v2/auth/login/2fa/duo"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (secondfactorauthenticationtoken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("secondfactorauthenticationtoken", secondfactorauthenticationtoken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (fields != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fields", fields)); + } + + if (rbabrowseremailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbabrowseremailtemplate", rbabrowseremailtemplate)); + } + + if (rbaoneclickemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaoneclickemailtemplate", rbaoneclickemailtemplate)); + } + + if (rbacityemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacityemailtemplate", rbacityemailtemplate)); + } + + if (rbacountryemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacountryemailtemplate", rbacountryemailtemplate)); + } + + if (rbaipemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaipemailtemplate", rbaipemailtemplate)); + } + + if (rbadeviceemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbadeviceemailtemplate", rbadeviceemailtemplate)); + } + + if (rbaotpsmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaotpsmstemplate", rbaotpsmstemplate)); + } + + if (rbabrowsersmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbabrowsersmstemplate", rbabrowsersmstemplate)); + } + + if (rbacitysmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacitysmstemplate", rbacitysmstemplate)); + } + + if (rbacountrysmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacountrysmstemplate", rbacountrysmstemplate)); + } + + if (rbaipsmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaipsmstemplate", rbaipsmstemplate)); + } + + if (rbadevicesmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbadevicesmstemplate", rbadevicesmstemplate)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call duoAuthVerificationByMFASecondFactorTokenValidateBeforeCall(String secondfactorauthenticationtoken, DuoVerifyRequest duoVerifyRequest, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'secondfactorauthenticationtoken' is set + if (secondfactorauthenticationtoken == null) { + throw new ApiException("Missing the required parameter 'secondfactorauthenticationtoken' when calling duoAuthVerificationByMFASecondFactorToken(Async)"); + } + + // verify the required parameter 'duoVerifyRequest' is set + if (duoVerifyRequest == null) { + throw new ApiException("Missing the required parameter 'duoVerifyRequest' when calling duoAuthVerificationByMFASecondFactorToken(Async)"); + } + + return duoAuthVerificationByMFASecondFactorTokenCall(secondfactorauthenticationtoken, duoVerifyRequest, preventWebhook, xPreventWebhook, fields, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, _callback); + + } + + /** + * Verify Duo with MFA Token + * Verifies Duo authentication for a User using a second factor token. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param duoVerifyRequest (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbaoneclickemailtemplate RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @return AuthResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public AuthResponse duoAuthVerificationByMFASecondFactorToken(String secondfactorauthenticationtoken, DuoVerifyRequest duoVerifyRequest, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate) throws ApiException { + ApiResponse<AuthResponse> localVarResp = duoAuthVerificationByMFASecondFactorTokenWithHttpInfo(secondfactorauthenticationtoken, duoVerifyRequest, preventWebhook, xPreventWebhook, fields, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate); + return localVarResp.getData(); + } + + /** + * Verify Duo with MFA Token + * Verifies Duo authentication for a User using a second factor token. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param duoVerifyRequest (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbaoneclickemailtemplate RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @return ApiResponse<AuthResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public ApiResponse<AuthResponse> duoAuthVerificationByMFASecondFactorTokenWithHttpInfo(String secondfactorauthenticationtoken, DuoVerifyRequest duoVerifyRequest, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate) throws ApiException { + okhttp3.Call localVarCall = duoAuthVerificationByMFASecondFactorTokenValidateBeforeCall(secondfactorauthenticationtoken, duoVerifyRequest, preventWebhook, xPreventWebhook, fields, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, null); + Type localVarReturnType = new TypeToken<AuthResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Verify Duo with MFA Token (asynchronously) + * Verifies Duo authentication for a User using a second factor token. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param duoVerifyRequest (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbaoneclickemailtemplate RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call duoAuthVerificationByMFASecondFactorTokenAsync(String secondfactorauthenticationtoken, DuoVerifyRequest duoVerifyRequest, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, final ApiCallback<AuthResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = duoAuthVerificationByMFASecondFactorTokenValidateBeforeCall(secondfactorauthenticationtoken, duoVerifyRequest, preventWebhook, xPreventWebhook, fields, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, _callback); + Type localVarReturnType = new TypeToken<AuthResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for duoAuthenticationReAuthVerificationByAccessToken + * @param duoVerifyRequest (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param accessToken Access Token of the User (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call duoAuthenticationReAuthVerificationByAccessTokenCall(DuoVerifyRequest duoVerifyRequest, Boolean preventWebhook, Boolean xPreventWebhook, String accessToken, 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 = duoVerifyRequest; + + // create path and map variables + String localVarPath = "/identity/v2/auth/account/reauth/2fa/duo"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call duoAuthenticationReAuthVerificationByAccessTokenValidateBeforeCall(DuoVerifyRequest duoVerifyRequest, Boolean preventWebhook, Boolean xPreventWebhook, String accessToken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'duoVerifyRequest' is set + if (duoVerifyRequest == null) { + throw new ApiException("Missing the required parameter 'duoVerifyRequest' when calling duoAuthenticationReAuthVerificationByAccessToken(Async)"); + } + + return duoAuthenticationReAuthVerificationByAccessTokenCall(duoVerifyRequest, preventWebhook, xPreventWebhook, accessToken, _callback); + + } + + /** + * Verify Duo + * Verifies Duo authentication for a User using an Access Token, typically used when re-verification is required. + * @param duoVerifyRequest (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param accessToken Access Token of the User (optional) + * @return ReAuthResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ReAuthResponse duoAuthenticationReAuthVerificationByAccessToken(DuoVerifyRequest duoVerifyRequest, Boolean preventWebhook, Boolean xPreventWebhook, String accessToken) throws ApiException { + ApiResponse<ReAuthResponse> localVarResp = duoAuthenticationReAuthVerificationByAccessTokenWithHttpInfo(duoVerifyRequest, preventWebhook, xPreventWebhook, accessToken); + return localVarResp.getData(); + } + + /** + * Verify Duo + * Verifies Duo authentication for a User using an Access Token, typically used when re-verification is required. + * @param duoVerifyRequest (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param accessToken Access Token of the User (optional) + * @return ApiResponse<ReAuthResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<ReAuthResponse> duoAuthenticationReAuthVerificationByAccessTokenWithHttpInfo(DuoVerifyRequest duoVerifyRequest, Boolean preventWebhook, Boolean xPreventWebhook, String accessToken) throws ApiException { + okhttp3.Call localVarCall = duoAuthenticationReAuthVerificationByAccessTokenValidateBeforeCall(duoVerifyRequest, preventWebhook, xPreventWebhook, accessToken, null); + Type localVarReturnType = new TypeToken<ReAuthResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Verify Duo (asynchronously) + * Verifies Duo authentication for a User using an Access Token, typically used when re-verification is required. + * @param duoVerifyRequest (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param accessToken Access Token of the User (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call duoAuthenticationReAuthVerificationByAccessTokenAsync(DuoVerifyRequest duoVerifyRequest, Boolean preventWebhook, Boolean xPreventWebhook, String accessToken, final ApiCallback<ReAuthResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = duoAuthenticationReAuthVerificationByAccessTokenValidateBeforeCall(duoVerifyRequest, preventWebhook, xPreventWebhook, accessToken, _callback); + Type localVarReturnType = new TypeToken<ReAuthResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for duoAuthenticationVerificationByAccessToken + * @param duoVerifyRequest (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param accessToken Access Token of the User (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call duoAuthenticationVerificationByAccessTokenCall(DuoVerifyRequest duoVerifyRequest, Boolean preventWebhook, Boolean xPreventWebhook, String accessToken, String fields, 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 = duoVerifyRequest; + + // create path and map variables + String localVarPath = "/identity/v2/auth/account/2fa/duo"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (fields != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fields", fields)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call duoAuthenticationVerificationByAccessTokenValidateBeforeCall(DuoVerifyRequest duoVerifyRequest, Boolean preventWebhook, Boolean xPreventWebhook, String accessToken, String fields, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'duoVerifyRequest' is set + if (duoVerifyRequest == null) { + throw new ApiException("Missing the required parameter 'duoVerifyRequest' when calling duoAuthenticationVerificationByAccessToken(Async)"); + } + + return duoAuthenticationVerificationByAccessTokenCall(duoVerifyRequest, preventWebhook, xPreventWebhook, accessToken, fields, _callback); + + } + + /** + * Verify Duo authentication + * Verifies Duo authentication for a User using an Access Token, typically after initial authentication. + * @param duoVerifyRequest (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param accessToken Access Token of the User (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @return Profile + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public Profile duoAuthenticationVerificationByAccessToken(DuoVerifyRequest duoVerifyRequest, Boolean preventWebhook, Boolean xPreventWebhook, String accessToken, String fields) throws ApiException { + ApiResponse<Profile> localVarResp = duoAuthenticationVerificationByAccessTokenWithHttpInfo(duoVerifyRequest, preventWebhook, xPreventWebhook, accessToken, fields); + return localVarResp.getData(); + } + + /** + * Verify Duo authentication + * Verifies Duo authentication for a User using an Access Token, typically after initial authentication. + * @param duoVerifyRequest (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param accessToken Access Token of the User (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @return ApiResponse<Profile> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<Profile> duoAuthenticationVerificationByAccessTokenWithHttpInfo(DuoVerifyRequest duoVerifyRequest, Boolean preventWebhook, Boolean xPreventWebhook, String accessToken, String fields) throws ApiException { + okhttp3.Call localVarCall = duoAuthenticationVerificationByAccessTokenValidateBeforeCall(duoVerifyRequest, preventWebhook, xPreventWebhook, accessToken, fields, null); + Type localVarReturnType = new TypeToken<Profile>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Verify Duo authentication (asynchronously) + * Verifies Duo authentication for a User using an Access Token, typically after initial authentication. + * @param duoVerifyRequest (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param accessToken Access Token of the User (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call duoAuthenticationVerificationByAccessTokenAsync(DuoVerifyRequest duoVerifyRequest, Boolean preventWebhook, Boolean xPreventWebhook, String accessToken, String fields, final ApiCallback<Profile> _callback) throws ApiException { + + okhttp3.Call localVarCall = duoAuthenticationVerificationByAccessTokenValidateBeforeCall(duoVerifyRequest, preventWebhook, xPreventWebhook, accessToken, fields, _callback); + Type localVarReturnType = new TypeToken<Profile>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for emailOTPAuthVerificationByAccessToken + * @param reAuthModelByEmailOtp (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param accessToken Access Token of the User (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call emailOTPAuthVerificationByAccessTokenCall(ReAuthModelByEmailOtp reAuthModelByEmailOtp, Boolean preventWebhook, Boolean xPreventWebhook, String accessToken, String fields, 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 = reAuthModelByEmailOtp; + + // create path and map variables + String localVarPath = "/identity/v2/auth/account/2fa/email"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (fields != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fields", fields)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call emailOTPAuthVerificationByAccessTokenValidateBeforeCall(ReAuthModelByEmailOtp reAuthModelByEmailOtp, Boolean preventWebhook, Boolean xPreventWebhook, String accessToken, String fields, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'reAuthModelByEmailOtp' is set + if (reAuthModelByEmailOtp == null) { + throw new ApiException("Missing the required parameter 'reAuthModelByEmailOtp' when calling emailOTPAuthVerificationByAccessToken(Async)"); + } + + return emailOTPAuthVerificationByAccessTokenCall(reAuthModelByEmailOtp, preventWebhook, xPreventWebhook, accessToken, fields, _callback); + + } + + /** + * Verify Email OTP + * Verifies Email OTP authentication for a User using an Access Token. + * @param reAuthModelByEmailOtp (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param accessToken Access Token of the User (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @return Profile + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public Profile emailOTPAuthVerificationByAccessToken(ReAuthModelByEmailOtp reAuthModelByEmailOtp, Boolean preventWebhook, Boolean xPreventWebhook, String accessToken, String fields) throws ApiException { + ApiResponse<Profile> localVarResp = emailOTPAuthVerificationByAccessTokenWithHttpInfo(reAuthModelByEmailOtp, preventWebhook, xPreventWebhook, accessToken, fields); + return localVarResp.getData(); + } + + /** + * Verify Email OTP + * Verifies Email OTP authentication for a User using an Access Token. + * @param reAuthModelByEmailOtp (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param accessToken Access Token of the User (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @return ApiResponse<Profile> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<Profile> emailOTPAuthVerificationByAccessTokenWithHttpInfo(ReAuthModelByEmailOtp reAuthModelByEmailOtp, Boolean preventWebhook, Boolean xPreventWebhook, String accessToken, String fields) throws ApiException { + okhttp3.Call localVarCall = emailOTPAuthVerificationByAccessTokenValidateBeforeCall(reAuthModelByEmailOtp, preventWebhook, xPreventWebhook, accessToken, fields, null); + Type localVarReturnType = new TypeToken<Profile>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Verify Email OTP (asynchronously) + * Verifies Email OTP authentication for a User using an Access Token. + * @param reAuthModelByEmailOtp (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param accessToken Access Token of the User (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call emailOTPAuthVerificationByAccessTokenAsync(ReAuthModelByEmailOtp reAuthModelByEmailOtp, Boolean preventWebhook, Boolean xPreventWebhook, String accessToken, String fields, final ApiCallback<Profile> _callback) throws ApiException { + + okhttp3.Call localVarCall = emailOTPAuthVerificationByAccessTokenValidateBeforeCall(reAuthModelByEmailOtp, preventWebhook, xPreventWebhook, accessToken, fields, _callback); + Type localVarReturnType = new TypeToken<Profile>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for finishMFAPasskeyRegistration + * @param secondfactorauthenticationtoken Second factor token (required) + * @param finishMFAPasskeyRegistrationRequest (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbaoneclickemailtemplate RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found - the requested resource does not exist. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call finishMFAPasskeyRegistrationCall(String secondfactorauthenticationtoken, FinishMFAPasskeyRegistrationRequest finishMFAPasskeyRegistrationRequest, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, 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 = finishMFAPasskeyRegistrationRequest; + + // create path and map variables + String localVarPath = "/identity/v2/auth/login/2fa/register/passkey/finish"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (secondfactorauthenticationtoken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("secondfactorauthenticationtoken", secondfactorauthenticationtoken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (fields != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fields", fields)); + } + + if (rbabrowseremailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbabrowseremailtemplate", rbabrowseremailtemplate)); + } + + if (rbaoneclickemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaoneclickemailtemplate", rbaoneclickemailtemplate)); + } + + if (rbacityemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacityemailtemplate", rbacityemailtemplate)); + } + + if (rbacountryemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacountryemailtemplate", rbacountryemailtemplate)); + } + + if (rbaipemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaipemailtemplate", rbaipemailtemplate)); + } + + if (rbadeviceemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbadeviceemailtemplate", rbadeviceemailtemplate)); + } + + if (rbaotpsmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaotpsmstemplate", rbaotpsmstemplate)); + } + + if (rbabrowsersmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbabrowsersmstemplate", rbabrowsersmstemplate)); + } + + if (rbacitysmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacitysmstemplate", rbacitysmstemplate)); + } + + if (rbacountrysmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacountrysmstemplate", rbacountrysmstemplate)); + } + + if (rbaipsmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaipsmstemplate", rbaipsmstemplate)); + } + + if (rbadevicesmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbadevicesmstemplate", rbadevicesmstemplate)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call finishMFAPasskeyRegistrationValidateBeforeCall(String secondfactorauthenticationtoken, FinishMFAPasskeyRegistrationRequest finishMFAPasskeyRegistrationRequest, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'secondfactorauthenticationtoken' is set + if (secondfactorauthenticationtoken == null) { + throw new ApiException("Missing the required parameter 'secondfactorauthenticationtoken' when calling finishMFAPasskeyRegistration(Async)"); + } + + // verify the required parameter 'finishMFAPasskeyRegistrationRequest' is set + if (finishMFAPasskeyRegistrationRequest == null) { + throw new ApiException("Missing the required parameter 'finishMFAPasskeyRegistrationRequest' when calling finishMFAPasskeyRegistration(Async)"); + } + + return finishMFAPasskeyRegistrationCall(secondfactorauthenticationtoken, finishMFAPasskeyRegistrationRequest, preventWebhook, xPreventWebhook, fields, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, _callback); + + } + + /** + * Complete Passkey registration + * Completes the MFA Passkey registration process using the provided MFA token. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param finishMFAPasskeyRegistrationRequest (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbaoneclickemailtemplate RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @return AuthResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found - the requested resource does not exist. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public AuthResponse finishMFAPasskeyRegistration(String secondfactorauthenticationtoken, FinishMFAPasskeyRegistrationRequest finishMFAPasskeyRegistrationRequest, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate) throws ApiException { + ApiResponse<AuthResponse> localVarResp = finishMFAPasskeyRegistrationWithHttpInfo(secondfactorauthenticationtoken, finishMFAPasskeyRegistrationRequest, preventWebhook, xPreventWebhook, fields, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate); + return localVarResp.getData(); + } + + /** + * Complete Passkey registration + * Completes the MFA Passkey registration process using the provided MFA token. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param finishMFAPasskeyRegistrationRequest (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbaoneclickemailtemplate RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @return ApiResponse<AuthResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found - the requested resource does not exist. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public ApiResponse<AuthResponse> finishMFAPasskeyRegistrationWithHttpInfo(String secondfactorauthenticationtoken, FinishMFAPasskeyRegistrationRequest finishMFAPasskeyRegistrationRequest, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate) throws ApiException { + okhttp3.Call localVarCall = finishMFAPasskeyRegistrationValidateBeforeCall(secondfactorauthenticationtoken, finishMFAPasskeyRegistrationRequest, preventWebhook, xPreventWebhook, fields, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, null); + Type localVarReturnType = new TypeToken<AuthResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Complete Passkey registration (asynchronously) + * Completes the MFA Passkey registration process using the provided MFA token. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param finishMFAPasskeyRegistrationRequest (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbaoneclickemailtemplate RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found - the requested resource does not exist. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call finishMFAPasskeyRegistrationAsync(String secondfactorauthenticationtoken, FinishMFAPasskeyRegistrationRequest finishMFAPasskeyRegistrationRequest, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, final ApiCallback<AuthResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = finishMFAPasskeyRegistrationValidateBeforeCall(secondfactorauthenticationtoken, finishMFAPasskeyRegistrationRequest, preventWebhook, xPreventWebhook, fields, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, _callback); + Type localVarReturnType = new TypeToken<AuthResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for finishPasskeyMFAVerification + * @param secondfactorauthenticationtoken Second factor token (required) + * @param finishPasskeyMFAVerificationRequest (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbaoneclickemailtemplate RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully finish login </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found - the requested resource does not exist. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call finishPasskeyMFAVerificationCall(String secondfactorauthenticationtoken, FinishPasskeyMFAVerificationRequest finishPasskeyMFAVerificationRequest, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, 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 = finishPasskeyMFAVerificationRequest; + + // create path and map variables + String localVarPath = "/identity/v2/auth/login/2fa/passkey/finish"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (secondfactorauthenticationtoken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("secondfactorauthenticationtoken", secondfactorauthenticationtoken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (fields != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fields", fields)); + } + + if (rbabrowseremailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbabrowseremailtemplate", rbabrowseremailtemplate)); + } + + if (rbaoneclickemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaoneclickemailtemplate", rbaoneclickemailtemplate)); + } + + if (rbacityemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacityemailtemplate", rbacityemailtemplate)); + } + + if (rbacountryemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacountryemailtemplate", rbacountryemailtemplate)); + } + + if (rbaipemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaipemailtemplate", rbaipemailtemplate)); + } + + if (rbadeviceemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbadeviceemailtemplate", rbadeviceemailtemplate)); + } + + if (rbaotpsmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaotpsmstemplate", rbaotpsmstemplate)); + } + + if (rbabrowsersmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbabrowsersmstemplate", rbabrowsersmstemplate)); + } + + if (rbacitysmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacitysmstemplate", rbacitysmstemplate)); + } + + if (rbacountrysmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacountrysmstemplate", rbacountrysmstemplate)); + } + + if (rbaipsmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaipsmstemplate", rbaipsmstemplate)); + } + + if (rbadevicesmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbadevicesmstemplate", rbadevicesmstemplate)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call finishPasskeyMFAVerificationValidateBeforeCall(String secondfactorauthenticationtoken, FinishPasskeyMFAVerificationRequest finishPasskeyMFAVerificationRequest, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'secondfactorauthenticationtoken' is set + if (secondfactorauthenticationtoken == null) { + throw new ApiException("Missing the required parameter 'secondfactorauthenticationtoken' when calling finishPasskeyMFAVerification(Async)"); + } + + // verify the required parameter 'finishPasskeyMFAVerificationRequest' is set + if (finishPasskeyMFAVerificationRequest == null) { + throw new ApiException("Missing the required parameter 'finishPasskeyMFAVerificationRequest' when calling finishPasskeyMFAVerification(Async)"); + } + + return finishPasskeyMFAVerificationCall(secondfactorauthenticationtoken, finishPasskeyMFAVerificationRequest, preventWebhook, xPreventWebhook, fields, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, _callback); + + } + + /** + * Complete Passkey Login with MFA Token + * Completes the MFA Passkey verification flow. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param finishPasskeyMFAVerificationRequest (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbaoneclickemailtemplate RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @return AuthResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully finish login </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found - the requested resource does not exist. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public AuthResponse finishPasskeyMFAVerification(String secondfactorauthenticationtoken, FinishPasskeyMFAVerificationRequest finishPasskeyMFAVerificationRequest, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate) throws ApiException { + ApiResponse<AuthResponse> localVarResp = finishPasskeyMFAVerificationWithHttpInfo(secondfactorauthenticationtoken, finishPasskeyMFAVerificationRequest, preventWebhook, xPreventWebhook, fields, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate); + return localVarResp.getData(); + } + + /** + * Complete Passkey Login with MFA Token + * Completes the MFA Passkey verification flow. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param finishPasskeyMFAVerificationRequest (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbaoneclickemailtemplate RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @return ApiResponse<AuthResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully finish login </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found - the requested resource does not exist. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public ApiResponse<AuthResponse> finishPasskeyMFAVerificationWithHttpInfo(String secondfactorauthenticationtoken, FinishPasskeyMFAVerificationRequest finishPasskeyMFAVerificationRequest, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate) throws ApiException { + okhttp3.Call localVarCall = finishPasskeyMFAVerificationValidateBeforeCall(secondfactorauthenticationtoken, finishPasskeyMFAVerificationRequest, preventWebhook, xPreventWebhook, fields, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, null); + Type localVarReturnType = new TypeToken<AuthResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Complete Passkey Login with MFA Token (asynchronously) + * Completes the MFA Passkey verification flow. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param finishPasskeyMFAVerificationRequest (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbaoneclickemailtemplate RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully finish login </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found - the requested resource does not exist. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call finishPasskeyMFAVerificationAsync(String secondfactorauthenticationtoken, FinishPasskeyMFAVerificationRequest finishPasskeyMFAVerificationRequest, Boolean preventWebhook, Boolean xPreventWebhook, String fields, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, final ApiCallback<AuthResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = finishPasskeyMFAVerificationValidateBeforeCall(secondfactorauthenticationtoken, finishPasskeyMFAVerificationRequest, preventWebhook, xPreventWebhook, fields, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, _callback); + Type localVarReturnType = new TypeToken<AuthResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for forgotPinByEmail + * @param forgotPinByEmail (required) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param resetpinurl Reset PIN URL (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully submit request to reset the PIN </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call forgotPinByEmailCall(ForgotPinByEmail forgotPinByEmail, String emailtemplate, String resetpinurl, 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 = forgotPinByEmail; + + // create path and map variables + String localVarPath = "/identity/v2/auth/pin/forgot/email"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (emailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailtemplate", emailtemplate)); + } + + if (resetpinurl != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("resetpinurl", resetpinurl)); + } + + 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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call forgotPinByEmailValidateBeforeCall(ForgotPinByEmail forgotPinByEmail, String emailtemplate, String resetpinurl, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'forgotPinByEmail' is set + if (forgotPinByEmail == null) { + throw new ApiException("Missing the required parameter 'forgotPinByEmail' when calling forgotPinByEmail(Async)"); + } + + return forgotPinByEmailCall(forgotPinByEmail, emailtemplate, resetpinurl, _callback); + + } + + /** + * Send PIN Reset Email + * Sends a PIN reset Email to the User's registered Email, enabling them to reset their PIN if forgotten. + * @param forgotPinByEmail (required) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param resetpinurl Reset PIN URL (optional) + * @return IsPostedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully submit request to reset the PIN </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public IsPostedResponse forgotPinByEmail(ForgotPinByEmail forgotPinByEmail, String emailtemplate, String resetpinurl) throws ApiException { + ApiResponse<IsPostedResponse> localVarResp = forgotPinByEmailWithHttpInfo(forgotPinByEmail, emailtemplate, resetpinurl); + return localVarResp.getData(); + } + + /** + * Send PIN Reset Email + * Sends a PIN reset Email to the User's registered Email, enabling them to reset their PIN if forgotten. + * @param forgotPinByEmail (required) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param resetpinurl Reset PIN URL (optional) + * @return ApiResponse<IsPostedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully submit request to reset the PIN </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedResponse> forgotPinByEmailWithHttpInfo(ForgotPinByEmail forgotPinByEmail, String emailtemplate, String resetpinurl) throws ApiException { + okhttp3.Call localVarCall = forgotPinByEmailValidateBeforeCall(forgotPinByEmail, emailtemplate, resetpinurl, null); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Send PIN Reset Email (asynchronously) + * Sends a PIN reset Email to the User's registered Email, enabling them to reset their PIN if forgotten. + * @param forgotPinByEmail (required) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param resetpinurl Reset PIN URL (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully submit request to reset the PIN </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call forgotPinByEmailAsync(ForgotPinByEmail forgotPinByEmail, String emailtemplate, String resetpinurl, final ApiCallback<IsPostedResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = forgotPinByEmailValidateBeforeCall(forgotPinByEmail, emailtemplate, resetpinurl, _callback); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for forgotPinByPhone + * @param forgotPinByPhone (required) + * @param smstemplate SMS Template (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully submit request to reset the PIN </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call forgotPinByPhoneCall(ForgotPinByPhone forgotPinByPhone, String smstemplate, Boolean isvoiceotp, 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 = forgotPinByPhone; + + // create path and map variables + String localVarPath = "/identity/v2/auth/pin/forgot/otp"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (smstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("smstemplate", smstemplate)); + } + + if (isvoiceotp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("isvoiceotp", isvoiceotp)); + } + + 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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call forgotPinByPhoneValidateBeforeCall(ForgotPinByPhone forgotPinByPhone, String smstemplate, Boolean isvoiceotp, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'forgotPinByPhone' is set + if (forgotPinByPhone == null) { + throw new ApiException("Missing the required parameter 'forgotPinByPhone' when calling forgotPinByPhone(Async)"); + } + + return forgotPinByPhoneCall(forgotPinByPhone, smstemplate, isvoiceotp, _callback); + + } + + /** + * Send OTP for PIN Reset + * Sends a One-Time Password (OTP) to the User's registered Phone number, enabling them to reset their PIN if forgotten. + * @param forgotPinByPhone (required) + * @param smstemplate SMS Template (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @return SMSResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully submit request to reset the PIN </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public SMSResponse forgotPinByPhone(ForgotPinByPhone forgotPinByPhone, String smstemplate, Boolean isvoiceotp) throws ApiException { + ApiResponse<SMSResponse> localVarResp = forgotPinByPhoneWithHttpInfo(forgotPinByPhone, smstemplate, isvoiceotp); + return localVarResp.getData(); + } + + /** + * Send OTP for PIN Reset + * Sends a One-Time Password (OTP) to the User's registered Phone number, enabling them to reset their PIN if forgotten. + * @param forgotPinByPhone (required) + * @param smstemplate SMS Template (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @return ApiResponse<SMSResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully submit request to reset the PIN </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SMSResponse> forgotPinByPhoneWithHttpInfo(ForgotPinByPhone forgotPinByPhone, String smstemplate, Boolean isvoiceotp) throws ApiException { + okhttp3.Call localVarCall = forgotPinByPhoneValidateBeforeCall(forgotPinByPhone, smstemplate, isvoiceotp, null); + Type localVarReturnType = new TypeToken<SMSResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Send OTP for PIN Reset (asynchronously) + * Sends a One-Time Password (OTP) to the User's registered Phone number, enabling them to reset their PIN if forgotten. + * @param forgotPinByPhone (required) + * @param smstemplate SMS Template (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully submit request to reset the PIN </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call forgotPinByPhoneAsync(ForgotPinByPhone forgotPinByPhone, String smstemplate, Boolean isvoiceotp, final ApiCallback<SMSResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = forgotPinByPhoneValidateBeforeCall(forgotPinByPhone, smstemplate, isvoiceotp, _callback); + Type localVarReturnType = new TypeToken<SMSResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for forgotPinByUsername + * @param forgotPinByUsername (required) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param resetpinurl Reset PIN URL (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully submit request to reset the PIN </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call forgotPinByUsernameCall(ForgotPinByUsername forgotPinByUsername, String emailtemplate, String resetpinurl, 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 = forgotPinByUsername; + + // create path and map variables + String localVarPath = "/identity/v2/auth/pin/forgot/username"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (emailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailtemplate", emailtemplate)); + } + + if (resetpinurl != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("resetpinurl", resetpinurl)); + } + + 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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call forgotPinByUsernameValidateBeforeCall(ForgotPinByUsername forgotPinByUsername, String emailtemplate, String resetpinurl, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'forgotPinByUsername' is set + if (forgotPinByUsername == null) { + throw new ApiException("Missing the required parameter 'forgotPinByUsername' when calling forgotPinByUsername(Async)"); + } + + return forgotPinByUsernameCall(forgotPinByUsername, emailtemplate, resetpinurl, _callback); + + } + + /** + * Send PIN Reset Email by Username + * Sends a PIN reset Email to the User IDentified by their Username, enabling them to reset their PIN if forgotten. + * @param forgotPinByUsername (required) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param resetpinurl Reset PIN URL (optional) + * @return IsPostedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully submit request to reset the PIN </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public IsPostedResponse forgotPinByUsername(ForgotPinByUsername forgotPinByUsername, String emailtemplate, String resetpinurl) throws ApiException { + ApiResponse<IsPostedResponse> localVarResp = forgotPinByUsernameWithHttpInfo(forgotPinByUsername, emailtemplate, resetpinurl); + return localVarResp.getData(); + } + + /** + * Send PIN Reset Email by Username + * Sends a PIN reset Email to the User IDentified by their Username, enabling them to reset their PIN if forgotten. + * @param forgotPinByUsername (required) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param resetpinurl Reset PIN URL (optional) + * @return ApiResponse<IsPostedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully submit request to reset the PIN </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedResponse> forgotPinByUsernameWithHttpInfo(ForgotPinByUsername forgotPinByUsername, String emailtemplate, String resetpinurl) throws ApiException { + okhttp3.Call localVarCall = forgotPinByUsernameValidateBeforeCall(forgotPinByUsername, emailtemplate, resetpinurl, null); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Send PIN Reset Email by Username (asynchronously) + * Sends a PIN reset Email to the User IDentified by their Username, enabling them to reset their PIN if forgotten. + * @param forgotPinByUsername (required) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param resetpinurl Reset PIN URL (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully submit request to reset the PIN </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call forgotPinByUsernameAsync(ForgotPinByUsername forgotPinByUsername, String emailtemplate, String resetpinurl, final ApiCallback<IsPostedResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = forgotPinByUsernameValidateBeforeCall(forgotPinByUsername, emailtemplate, resetpinurl, _callback); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getMFASettings + * @param duoredirecturi Duo auth redirection url. (optional) + * @param accessToken Access Token of the User (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getMFASettingsCall(String duoredirecturi, String accessToken, 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 = "/identity/v2/auth/account/2fa"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (duoredirecturi != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("duoredirecturi", duoredirecturi)); + } + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + 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[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getMFASettingsValidateBeforeCall(String duoredirecturi, String accessToken, final ApiCallback _callback) throws ApiException { + return getMFASettingsCall(duoredirecturi, accessToken, _callback); + + } + + /** + * Retrieve MFA settings + * Retrieves all MFA settings configured for the User, including the status of each authenticator type and available configuration details. + * @param duoredirecturi Duo auth redirection url. (optional) + * @param accessToken Access Token of the User (optional) + * @return TwoFactorAuthenticationSettings + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public TwoFactorAuthenticationSettings getMFASettings(String duoredirecturi, String accessToken) throws ApiException { + ApiResponse<TwoFactorAuthenticationSettings> localVarResp = getMFASettingsWithHttpInfo(duoredirecturi, accessToken); + return localVarResp.getData(); + } + + /** + * Retrieve MFA settings + * Retrieves all MFA settings configured for the User, including the status of each authenticator type and available configuration details. + * @param duoredirecturi Duo auth redirection url. (optional) + * @param accessToken Access Token of the User (optional) + * @return ApiResponse<TwoFactorAuthenticationSettings> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<TwoFactorAuthenticationSettings> getMFASettingsWithHttpInfo(String duoredirecturi, String accessToken) throws ApiException { + okhttp3.Call localVarCall = getMFASettingsValidateBeforeCall(duoredirecturi, accessToken, null); + Type localVarReturnType = new TypeToken<TwoFactorAuthenticationSettings>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve MFA settings (asynchronously) + * Retrieves all MFA settings configured for the User, including the status of each authenticator type and available configuration details. + * @param duoredirecturi Duo auth redirection url. (optional) + * @param accessToken Access Token of the User (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getMFASettingsAsync(String duoredirecturi, String accessToken, final ApiCallback<TwoFactorAuthenticationSettings> _callback) throws ApiException { + + okhttp3.Call localVarCall = getMFASettingsValidateBeforeCall(duoredirecturi, accessToken, _callback); + Type localVarReturnType = new TypeToken<TwoFactorAuthenticationSettings>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getMfaPushDeviceStatus + * @param accessToken Access Token of the User (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful and a Push Notification device is registered on the profile. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getMfaPushDeviceStatusCall(String accessToken, 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 = "/identity/v2/auth/account/2fa/push/ping"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + 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[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getMfaPushDeviceStatusValidateBeforeCall(String accessToken, final ApiCallback _callback) throws ApiException { + return getMfaPushDeviceStatusCall(accessToken, _callback); + + } + + /** + * Check push device registration status + * Checks whether a Push Notification device is registered on the User's profile for MFA, using an Access Token. + * @param accessToken Access Token of the User (optional) + * @return IsRegistered + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful and a Push Notification device is registered on the profile. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public IsRegistered getMfaPushDeviceStatus(String accessToken) throws ApiException { + ApiResponse<IsRegistered> localVarResp = getMfaPushDeviceStatusWithHttpInfo(accessToken); + return localVarResp.getData(); + } + + /** + * Check push device registration status + * Checks whether a Push Notification device is registered on the User's profile for MFA, using an Access Token. + * @param accessToken Access Token of the User (optional) + * @return ApiResponse<IsRegistered> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful and a Push Notification device is registered on the profile. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsRegistered> getMfaPushDeviceStatusWithHttpInfo(String accessToken) throws ApiException { + okhttp3.Call localVarCall = getMfaPushDeviceStatusValidateBeforeCall(accessToken, null); + Type localVarReturnType = new TypeToken<IsRegistered>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Check push device registration status (asynchronously) + * Checks whether a Push Notification device is registered on the User's profile for MFA, using an Access Token. + * @param accessToken Access Token of the User (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful and a Push Notification device is registered on the profile. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getMfaPushDeviceStatusAsync(String accessToken, final ApiCallback<IsRegistered> _callback) throws ApiException { + + okhttp3.Call localVarCall = getMfaPushDeviceStatusValidateBeforeCall(accessToken, _callback); + Type localVarReturnType = new TypeToken<IsRegistered>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for mFAResetSMSAuthByToken + * @param accessToken Access Token of the User (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call mFAResetSMSAuthByTokenCall(String accessToken, 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 = "/identity/v2/auth/account/2fa/sms"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + 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[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call mFAResetSMSAuthByTokenValidateBeforeCall(String accessToken, final ApiCallback _callback) throws ApiException { + return mFAResetSMSAuthByTokenCall(accessToken, _callback); + + } + + /** + * Reset SMS Authenticator + * Resets SMS Authenticator configurations for an Account using an Access Token. + * @param accessToken Access Token of the User (optional) + * @return IsDeleted + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public IsDeleted mFAResetSMSAuthByToken(String accessToken) throws ApiException { + ApiResponse<IsDeleted> localVarResp = mFAResetSMSAuthByTokenWithHttpInfo(accessToken); + return localVarResp.getData(); + } + + /** + * Reset SMS Authenticator + * Resets SMS Authenticator configurations for an Account using an Access Token. + * @param accessToken Access Token of the User (optional) + * @return ApiResponse<IsDeleted> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsDeleted> mFAResetSMSAuthByTokenWithHttpInfo(String accessToken) throws ApiException { + okhttp3.Call localVarCall = mFAResetSMSAuthByTokenValidateBeforeCall(accessToken, null); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Reset SMS Authenticator (asynchronously) + * Resets SMS Authenticator configurations for an Account using an Access Token. + * @param accessToken Access Token of the User (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call mFAResetSMSAuthByTokenAsync(String accessToken, final ApiCallback<IsDeleted> _callback) throws ApiException { + + okhttp3.Call localVarCall = mFAResetSMSAuthByTokenValidateBeforeCall(accessToken, _callback); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for mFAResetTotpByToken + * @param accessToken Access Token of the User (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call mFAResetTotpByTokenCall(String accessToken, 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 = "/identity/v2/auth/account/2fa/totp"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + 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[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call mFAResetTotpByTokenValidateBeforeCall(String accessToken, final ApiCallback _callback) throws ApiException { + return mFAResetTotpByTokenCall(accessToken, _callback); + + } + + /** + * Reset TOTP + * Resets TOTP Authenticator configurations for an Account using an Access Token. + * @param accessToken Access Token of the User (optional) + * @return IsDeleted + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public IsDeleted mFAResetTotpByToken(String accessToken) throws ApiException { + ApiResponse<IsDeleted> localVarResp = mFAResetTotpByTokenWithHttpInfo(accessToken); + return localVarResp.getData(); + } + + /** + * Reset TOTP + * Resets TOTP Authenticator configurations for an Account using an Access Token. + * @param accessToken Access Token of the User (optional) + * @return ApiResponse<IsDeleted> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsDeleted> mFAResetTotpByTokenWithHttpInfo(String accessToken) throws ApiException { + okhttp3.Call localVarCall = mFAResetTotpByTokenValidateBeforeCall(accessToken, null); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Reset TOTP (asynchronously) + * Resets TOTP Authenticator configurations for an Account using an Access Token. + * @param accessToken Access Token of the User (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call mFAResetTotpByTokenAsync(String accessToken, final ApiCallback<IsDeleted> _callback) throws ApiException { + + okhttp3.Call localVarCall = mFAResetTotpByTokenValidateBeforeCall(accessToken, _callback); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for mFAUpdatePhoneNumberByMfaToken + * @param secondfactorauthenticationtoken Second factor token (required) + * @param mfAPhoneUpdateModel (required) + * @param smstemplate2fa SMS template name to be used for sending the 2FA code to the User. (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call mFAUpdatePhoneNumberByMfaTokenCall(String secondfactorauthenticationtoken, MFAPhoneUpdateModel mfAPhoneUpdateModel, String smstemplate2fa, Boolean isvoiceotp, 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 = mfAPhoneUpdateModel; + + // create path and map variables + String localVarPath = "/identity/v2/auth/login/2fa/sms/phone"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (secondfactorauthenticationtoken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("secondfactorauthenticationtoken", secondfactorauthenticationtoken)); + } + + if (smstemplate2fa != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("smstemplate2fa", smstemplate2fa)); + } + + if (isvoiceotp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("isvoiceotp", isvoiceotp)); + } + + 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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call mFAUpdatePhoneNumberByMfaTokenValidateBeforeCall(String secondfactorauthenticationtoken, MFAPhoneUpdateModel mfAPhoneUpdateModel, String smstemplate2fa, Boolean isvoiceotp, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'secondfactorauthenticationtoken' is set + if (secondfactorauthenticationtoken == null) { + throw new ApiException("Missing the required parameter 'secondfactorauthenticationtoken' when calling mFAUpdatePhoneNumberByMfaToken(Async)"); + } + + // verify the required parameter 'mfAPhoneUpdateModel' is set + if (mfAPhoneUpdateModel == null) { + throw new ApiException("Missing the required parameter 'mfAPhoneUpdateModel' when calling mFAUpdatePhoneNumberByMfaToken(Async)"); + } + + return mFAUpdatePhoneNumberByMfaTokenCall(secondfactorauthenticationtoken, mfAPhoneUpdateModel, smstemplate2fa, isvoiceotp, _callback); + + } + + /** + * Update Phone with MFA Token + * Sends a verification OTP to the provided Phone number as part of the process to update the Phone number used for Multi-Factor Authentication. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param mfAPhoneUpdateModel (required) + * @param smstemplate2fa SMS template name to be used for sending the 2FA code to the User. (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @return SMSResponseData + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public SMSResponseData mFAUpdatePhoneNumberByMfaToken(String secondfactorauthenticationtoken, MFAPhoneUpdateModel mfAPhoneUpdateModel, String smstemplate2fa, Boolean isvoiceotp) throws ApiException { + ApiResponse<SMSResponseData> localVarResp = mFAUpdatePhoneNumberByMfaTokenWithHttpInfo(secondfactorauthenticationtoken, mfAPhoneUpdateModel, smstemplate2fa, isvoiceotp); + return localVarResp.getData(); + } + + /** + * Update Phone with MFA Token + * Sends a verification OTP to the provided Phone number as part of the process to update the Phone number used for Multi-Factor Authentication. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param mfAPhoneUpdateModel (required) + * @param smstemplate2fa SMS template name to be used for sending the 2FA code to the User. (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @return ApiResponse<SMSResponseData> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SMSResponseData> mFAUpdatePhoneNumberByMfaTokenWithHttpInfo(String secondfactorauthenticationtoken, MFAPhoneUpdateModel mfAPhoneUpdateModel, String smstemplate2fa, Boolean isvoiceotp) throws ApiException { + okhttp3.Call localVarCall = mFAUpdatePhoneNumberByMfaTokenValidateBeforeCall(secondfactorauthenticationtoken, mfAPhoneUpdateModel, smstemplate2fa, isvoiceotp, null); + Type localVarReturnType = new TypeToken<SMSResponseData>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Phone with MFA Token (asynchronously) + * Sends a verification OTP to the provided Phone number as part of the process to update the Phone number used for Multi-Factor Authentication. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param mfAPhoneUpdateModel (required) + * @param smstemplate2fa SMS template name to be used for sending the 2FA code to the User. (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call mFAUpdatePhoneNumberByMfaTokenAsync(String secondfactorauthenticationtoken, MFAPhoneUpdateModel mfAPhoneUpdateModel, String smstemplate2fa, Boolean isvoiceotp, final ApiCallback<SMSResponseData> _callback) throws ApiException { + + okhttp3.Call localVarCall = mFAUpdatePhoneNumberByMfaTokenValidateBeforeCall(secondfactorauthenticationtoken, mfAPhoneUpdateModel, smstemplate2fa, isvoiceotp, _callback); + Type localVarReturnType = new TypeToken<SMSResponseData>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for mFAUpdatePhoneNumberByToken + * @param mfAPhoneUpdateModel (required) + * @param smstemplate2fa SMS template name to be used for sending the 2FA code to the User. (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param accessToken Access Token of the User (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call mFAUpdatePhoneNumberByTokenCall(MFAPhoneUpdateModel mfAPhoneUpdateModel, String smstemplate2fa, Boolean isvoiceotp, String accessToken, 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 = mfAPhoneUpdateModel; + + // create path and map variables + String localVarPath = "/identity/v2/auth/account/2fa/sms/phone"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (smstemplate2fa != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("smstemplate2fa", smstemplate2fa)); + } + + if (isvoiceotp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("isvoiceotp", isvoiceotp)); + } + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + 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[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call mFAUpdatePhoneNumberByTokenValidateBeforeCall(MFAPhoneUpdateModel mfAPhoneUpdateModel, String smstemplate2fa, Boolean isvoiceotp, String accessToken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'mfAPhoneUpdateModel' is set + if (mfAPhoneUpdateModel == null) { + throw new ApiException("Missing the required parameter 'mfAPhoneUpdateModel' when calling mFAUpdatePhoneNumberByToken(Async)"); + } + + return mFAUpdatePhoneNumberByTokenCall(mfAPhoneUpdateModel, smstemplate2fa, isvoiceotp, accessToken, _callback); + + } + + /** + * Update Phone by token + * Sends a verification OTP to the provided Phone number as part of the process to update the Phone number used for MFA. + * @param mfAPhoneUpdateModel (required) + * @param smstemplate2fa SMS template name to be used for sending the 2FA code to the User. (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param accessToken Access Token of the User (optional) + * @return SMSResponseData + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public SMSResponseData mFAUpdatePhoneNumberByToken(MFAPhoneUpdateModel mfAPhoneUpdateModel, String smstemplate2fa, Boolean isvoiceotp, String accessToken) throws ApiException { + ApiResponse<SMSResponseData> localVarResp = mFAUpdatePhoneNumberByTokenWithHttpInfo(mfAPhoneUpdateModel, smstemplate2fa, isvoiceotp, accessToken); + return localVarResp.getData(); + } + + /** + * Update Phone by token + * Sends a verification OTP to the provided Phone number as part of the process to update the Phone number used for MFA. + * @param mfAPhoneUpdateModel (required) + * @param smstemplate2fa SMS template name to be used for sending the 2FA code to the User. (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param accessToken Access Token of the User (optional) + * @return ApiResponse<SMSResponseData> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SMSResponseData> mFAUpdatePhoneNumberByTokenWithHttpInfo(MFAPhoneUpdateModel mfAPhoneUpdateModel, String smstemplate2fa, Boolean isvoiceotp, String accessToken) throws ApiException { + okhttp3.Call localVarCall = mFAUpdatePhoneNumberByTokenValidateBeforeCall(mfAPhoneUpdateModel, smstemplate2fa, isvoiceotp, accessToken, null); + Type localVarReturnType = new TypeToken<SMSResponseData>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Phone by token (asynchronously) + * Sends a verification OTP to the provided Phone number as part of the process to update the Phone number used for MFA. + * @param mfAPhoneUpdateModel (required) + * @param smstemplate2fa SMS template name to be used for sending the 2FA code to the User. (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param accessToken Access Token of the User (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call mFAUpdatePhoneNumberByTokenAsync(MFAPhoneUpdateModel mfAPhoneUpdateModel, String smstemplate2fa, Boolean isvoiceotp, String accessToken, final ApiCallback<SMSResponseData> _callback) throws ApiException { + + okhttp3.Call localVarCall = mFAUpdatePhoneNumberByTokenValidateBeforeCall(mfAPhoneUpdateModel, smstemplate2fa, isvoiceotp, accessToken, _callback); + Type localVarReturnType = new TypeToken<SMSResponseData>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for mFAVerifyPhoneNumberByAccessToken + * @param mfAVerifyPhoneOtpModel (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call mFAVerifyPhoneNumberByAccessTokenCall(MFAVerifyPhoneOtpModel mfAVerifyPhoneOtpModel, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, String fields, 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 = mfAVerifyPhoneOtpModel; + + // create path and map variables + String localVarPath = "/identity/v2/auth/account/2fa/sms"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (fields != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fields", fields)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call mFAVerifyPhoneNumberByAccessTokenValidateBeforeCall(MFAVerifyPhoneOtpModel mfAVerifyPhoneOtpModel, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, String fields, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'mfAVerifyPhoneOtpModel' is set + if (mfAVerifyPhoneOtpModel == null) { + throw new ApiException("Missing the required parameter 'mfAVerifyPhoneOtpModel' when calling mFAVerifyPhoneNumberByAccessToken(Async)"); + } + + return mFAVerifyPhoneNumberByAccessTokenCall(mfAVerifyPhoneOtpModel, accessToken, preventWebhook, xPreventWebhook, fields, _callback); + + } + + /** + * Verify Phone MFA + * Updates Phone-based MFA settings after a successful login, managing or verifying Phone MFA configurations for secure operations. + * @param mfAVerifyPhoneOtpModel (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @return Profile + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public Profile mFAVerifyPhoneNumberByAccessToken(MFAVerifyPhoneOtpModel mfAVerifyPhoneOtpModel, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, String fields) throws ApiException { + ApiResponse<Profile> localVarResp = mFAVerifyPhoneNumberByAccessTokenWithHttpInfo(mfAVerifyPhoneOtpModel, accessToken, preventWebhook, xPreventWebhook, fields); + return localVarResp.getData(); + } + + /** + * Verify Phone MFA + * Updates Phone-based MFA settings after a successful login, managing or verifying Phone MFA configurations for secure operations. + * @param mfAVerifyPhoneOtpModel (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @return ApiResponse<Profile> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<Profile> mFAVerifyPhoneNumberByAccessTokenWithHttpInfo(MFAVerifyPhoneOtpModel mfAVerifyPhoneOtpModel, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, String fields) throws ApiException { + okhttp3.Call localVarCall = mFAVerifyPhoneNumberByAccessTokenValidateBeforeCall(mfAVerifyPhoneOtpModel, accessToken, preventWebhook, xPreventWebhook, fields, null); + Type localVarReturnType = new TypeToken<Profile>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Verify Phone MFA (asynchronously) + * Updates Phone-based MFA settings after a successful login, managing or verifying Phone MFA configurations for secure operations. + * @param mfAVerifyPhoneOtpModel (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call mFAVerifyPhoneNumberByAccessTokenAsync(MFAVerifyPhoneOtpModel mfAVerifyPhoneOtpModel, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, String fields, final ApiCallback<Profile> _callback) throws ApiException { + + okhttp3.Call localVarCall = mFAVerifyPhoneNumberByAccessTokenValidateBeforeCall(mfAVerifyPhoneOtpModel, accessToken, preventWebhook, xPreventWebhook, fields, _callback); + Type localVarReturnType = new TypeToken<Profile>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for mfaGenerateBackupCodes + * @param accessToken Access Token of the User (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call mfaGenerateBackupCodesCall(String accessToken, 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 = "/identity/v2/auth/account/2fa/backupcode"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + 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[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call mfaGenerateBackupCodesValidateBeforeCall(String accessToken, final ApiCallback _callback) throws ApiException { + return mfaGenerateBackupCodesCall(accessToken, _callback); + + } + + /** + * Generate backup codes + * Generates a set of backup codes for a User with MFA enabled. Returns an error if backup codes already exist. + * @param accessToken Access Token of the User (optional) + * @return MFABackUpCodeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public MFABackUpCodeResponse mfaGenerateBackupCodes(String accessToken) throws ApiException { + ApiResponse<MFABackUpCodeResponse> localVarResp = mfaGenerateBackupCodesWithHttpInfo(accessToken); + return localVarResp.getData(); + } + + /** + * Generate backup codes + * Generates a set of backup codes for a User with MFA enabled. Returns an error if backup codes already exist. + * @param accessToken Access Token of the User (optional) + * @return ApiResponse<MFABackUpCodeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<MFABackUpCodeResponse> mfaGenerateBackupCodesWithHttpInfo(String accessToken) throws ApiException { + okhttp3.Call localVarCall = mfaGenerateBackupCodesValidateBeforeCall(accessToken, null); + Type localVarReturnType = new TypeToken<MFABackUpCodeResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Generate backup codes (asynchronously) + * Generates a set of backup codes for a User with MFA enabled. Returns an error if backup codes already exist. + * @param accessToken Access Token of the User (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call mfaGenerateBackupCodesAsync(String accessToken, final ApiCallback<MFABackUpCodeResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = mfaGenerateBackupCodesValidateBeforeCall(accessToken, _callback); + Type localVarReturnType = new TypeToken<MFABackUpCodeResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for mfaResendPushNotification + * @param secondfactorauthenticationtoken Second factor token (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Push Notification sent for verification </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call mfaResendPushNotificationCall(String secondfactorauthenticationtoken, 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 = "/identity/v2/auth/login/2fa/push"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (secondfactorauthenticationtoken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("secondfactorauthenticationtoken", secondfactorauthenticationtoken)); + } + + 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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call mfaResendPushNotificationValidateBeforeCall(String secondfactorauthenticationtoken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'secondfactorauthenticationtoken' is set + if (secondfactorauthenticationtoken == null) { + throw new ApiException("Missing the required parameter 'secondfactorauthenticationtoken' when calling mfaResendPushNotification(Async)"); + } + + return mfaResendPushNotificationCall(secondfactorauthenticationtoken, _callback); + + } + + /** + * Resend Push Notification + * Resends a Push Notification for Multi-Factor Authentication. + * @param secondfactorauthenticationtoken Second factor token (required) + * @return IsPostedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Push Notification sent for verification </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public IsPostedResponse mfaResendPushNotification(String secondfactorauthenticationtoken) throws ApiException { + ApiResponse<IsPostedResponse> localVarResp = mfaResendPushNotificationWithHttpInfo(secondfactorauthenticationtoken); + return localVarResp.getData(); + } + + /** + * Resend Push Notification + * Resends a Push Notification for Multi-Factor Authentication. + * @param secondfactorauthenticationtoken Second factor token (required) + * @return ApiResponse<IsPostedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Push Notification sent for verification </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedResponse> mfaResendPushNotificationWithHttpInfo(String secondfactorauthenticationtoken) throws ApiException { + okhttp3.Call localVarCall = mfaResendPushNotificationValidateBeforeCall(secondfactorauthenticationtoken, null); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Resend Push Notification (asynchronously) + * Resends a Push Notification for Multi-Factor Authentication. + * @param secondfactorauthenticationtoken Second factor token (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Push Notification sent for verification </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call mfaResendPushNotificationAsync(String secondfactorauthenticationtoken, final ApiCallback<IsPostedResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = mfaResendPushNotificationValidateBeforeCall(secondfactorauthenticationtoken, _callback); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for mfaResetBackupCodes + * @param accessToken Access Token of the User (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call mfaResetBackupCodesCall(String accessToken, 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 = "/identity/v2/auth/account/2fa/backupcode/reset"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + 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[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call mfaResetBackupCodesValidateBeforeCall(String accessToken, final ApiCallback _callback) throws ApiException { + return mfaResetBackupCodesCall(accessToken, _callback); + + } + + /** + * Reset backup codes + * Resets backup codes for a User with MFA enabled, allowing regeneration of backup codes. + * @param accessToken Access Token of the User (optional) + * @return MFABackUpCodeResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public MFABackUpCodeResponse mfaResetBackupCodes(String accessToken) throws ApiException { + ApiResponse<MFABackUpCodeResponse> localVarResp = mfaResetBackupCodesWithHttpInfo(accessToken); + return localVarResp.getData(); + } + + /** + * Reset backup codes + * Resets backup codes for a User with MFA enabled, allowing regeneration of backup codes. + * @param accessToken Access Token of the User (optional) + * @return ApiResponse<MFABackUpCodeResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<MFABackUpCodeResponse> mfaResetBackupCodesWithHttpInfo(String accessToken) throws ApiException { + okhttp3.Call localVarCall = mfaResetBackupCodesValidateBeforeCall(accessToken, null); + Type localVarReturnType = new TypeToken<MFABackUpCodeResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Reset backup codes (asynchronously) + * Resets backup codes for a User with MFA enabled, allowing regeneration of backup codes. + * @param accessToken Access Token of the User (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call mfaResetBackupCodesAsync(String accessToken, final ApiCallback<MFABackUpCodeResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = mfaResetBackupCodesValidateBeforeCall(accessToken, _callback); + Type localVarReturnType = new TypeToken<MFABackUpCodeResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for pINLogin + * @param sessionToken Session Token for PIN Auth (required) + * @param piNLoginModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + </table> + */ + public okhttp3.Call pINLoginCall(String sessionToken, PINLoginModel piNLoginModel, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, 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 = piNLoginModel; + + // create path and map variables + String localVarPath = "/identity/v2/auth/login/pin"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (sessionToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("session_token", sessionToken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (gRecaptchaResponse2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g_recaptcha_response", gRecaptchaResponse2)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call pINLoginValidateBeforeCall(String sessionToken, PINLoginModel piNLoginModel, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'sessionToken' is set + if (sessionToken == null) { + throw new ApiException("Missing the required parameter 'sessionToken' when calling pINLogin(Async)"); + } + + // verify the required parameter 'piNLoginModel' is set + if (piNLoginModel == null) { + throw new ApiException("Missing the required parameter 'piNLoginModel' when calling pINLogin(Async)"); + } + + return pINLoginCall(sessionToken, piNLoginModel, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + + } + + /** + * Login with PIN + * Allows Users to log in using their previously set PIN along with a valid session token. + * @param sessionToken Session Token for PIN Auth (required) + * @param piNLoginModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return AuthResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + </table> + */ + public AuthResponse pINLogin(String sessionToken, PINLoginModel piNLoginModel, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + ApiResponse<AuthResponse> localVarResp = pINLoginWithHttpInfo(sessionToken, piNLoginModel, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + return localVarResp.getData(); + } + + /** + * Login with PIN + * Allows Users to log in using their previously set PIN along with a valid session token. + * @param sessionToken Session Token for PIN Auth (required) + * @param piNLoginModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return ApiResponse<AuthResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + </table> + */ + public ApiResponse<AuthResponse> pINLoginWithHttpInfo(String sessionToken, PINLoginModel piNLoginModel, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + okhttp3.Call localVarCall = pINLoginValidateBeforeCall(sessionToken, piNLoginModel, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, null); + Type localVarReturnType = new TypeToken<AuthResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Login with PIN (asynchronously) + * Allows Users to log in using their previously set PIN along with a valid session token. + * @param sessionToken Session Token for PIN Auth (required) + * @param piNLoginModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden </td><td> - </td></tr> + </table> + */ + public okhttp3.Call pINLoginAsync(String sessionToken, PINLoginModel piNLoginModel, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback<AuthResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = pINLoginValidateBeforeCall(sessionToken, piNLoginModel, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + Type localVarReturnType = new TypeToken<AuthResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for pingPushVerificationStatus + * @param secondfactorauthenticationtoken Second factor token (required) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbaoneclickemailtemplate RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully verified and give login response </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call pingPushVerificationStatusCall(String secondfactorauthenticationtoken, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, 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 = "/identity/v2/auth/login/2fa/push/ping"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (secondfactorauthenticationtoken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("secondfactorauthenticationtoken", secondfactorauthenticationtoken)); + } + + if (rbabrowseremailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbabrowseremailtemplate", rbabrowseremailtemplate)); + } + + if (rbaoneclickemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaoneclickemailtemplate", rbaoneclickemailtemplate)); + } + + if (rbacityemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacityemailtemplate", rbacityemailtemplate)); + } + + if (rbacountryemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacountryemailtemplate", rbacountryemailtemplate)); + } + + if (rbaipemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaipemailtemplate", rbaipemailtemplate)); + } + + if (rbadeviceemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbadeviceemailtemplate", rbadeviceemailtemplate)); + } + + if (rbaotpsmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaotpsmstemplate", rbaotpsmstemplate)); + } + + if (rbabrowsersmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbabrowsersmstemplate", rbabrowsersmstemplate)); + } + + if (rbacitysmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacitysmstemplate", rbacitysmstemplate)); + } + + if (rbacountrysmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacountrysmstemplate", rbacountrysmstemplate)); + } + + if (rbaipsmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaipsmstemplate", rbaipsmstemplate)); + } + + if (rbadevicesmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbadevicesmstemplate", rbadevicesmstemplate)); + } + + 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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call pingPushVerificationStatusValidateBeforeCall(String secondfactorauthenticationtoken, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'secondfactorauthenticationtoken' is set + if (secondfactorauthenticationtoken == null) { + throw new ApiException("Missing the required parameter 'secondfactorauthenticationtoken' when calling pingPushVerificationStatus(Async)"); + } + + return pingPushVerificationStatusCall(secondfactorauthenticationtoken, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, _callback); + + } + + /** + * Check Push Notification Verification Status + * Checks the status of Push Notification verification and returns the login response when verified. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbaoneclickemailtemplate RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @return AuthResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully verified and give login response </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public AuthResponse pingPushVerificationStatus(String secondfactorauthenticationtoken, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate) throws ApiException { + ApiResponse<AuthResponse> localVarResp = pingPushVerificationStatusWithHttpInfo(secondfactorauthenticationtoken, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate); + return localVarResp.getData(); + } + + /** + * Check Push Notification Verification Status + * Checks the status of Push Notification verification and returns the login response when verified. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbaoneclickemailtemplate RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @return ApiResponse<AuthResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully verified and give login response </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<AuthResponse> pingPushVerificationStatusWithHttpInfo(String secondfactorauthenticationtoken, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate) throws ApiException { + okhttp3.Call localVarCall = pingPushVerificationStatusValidateBeforeCall(secondfactorauthenticationtoken, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, null); + Type localVarReturnType = new TypeToken<AuthResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Check Push Notification Verification Status (asynchronously) + * Checks the status of Push Notification verification and returns the login response when verified. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbaoneclickemailtemplate RBA one click Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA is enabled for the Tenant with one click sign in as a MFA option. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully verified and give login response </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call pingPushVerificationStatusAsync(String secondfactorauthenticationtoken, String rbabrowseremailtemplate, String rbaoneclickemailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, final ApiCallback<AuthResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = pingPushVerificationStatusValidateBeforeCall(secondfactorauthenticationtoken, rbabrowseremailtemplate, rbaoneclickemailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, _callback); + Type localVarReturnType = new TypeToken<AuthResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for reauthPassword + * @param passwordReauthRequest (required) + * @param accessToken Access Token of the User (optional) + * @param smstemplate SMS Template (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call reauthPasswordCall(PasswordReauthRequest passwordReauthRequest, String accessToken, String smstemplate, Boolean preventWebhook, Boolean xPreventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, 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 = passwordReauthRequest; + + // create path and map variables + String localVarPath = "/identity/v2/auth/account/reauth/password"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (smstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("smstemplate", smstemplate)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (gRecaptchaResponse2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g_recaptcha_response", gRecaptchaResponse2)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call reauthPasswordValidateBeforeCall(PasswordReauthRequest passwordReauthRequest, String accessToken, String smstemplate, Boolean preventWebhook, Boolean xPreventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'passwordReauthRequest' is set + if (passwordReauthRequest == null) { + throw new ApiException("Missing the required parameter 'passwordReauthRequest' when calling reauthPassword(Async)"); + } + + return reauthPasswordCall(passwordReauthRequest, accessToken, smstemplate, preventWebhook, xPreventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + + } + + /** + * Verify Password + * Verifies the Password for a User using an Access Token, typically used when re-verification is required. + * @param passwordReauthRequest (required) + * @param accessToken Access Token of the User (optional) + * @param smstemplate SMS Template (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return ReAuthResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public ReAuthResponse reauthPassword(PasswordReauthRequest passwordReauthRequest, String accessToken, String smstemplate, Boolean preventWebhook, Boolean xPreventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + ApiResponse<ReAuthResponse> localVarResp = reauthPasswordWithHttpInfo(passwordReauthRequest, accessToken, smstemplate, preventWebhook, xPreventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + return localVarResp.getData(); + } + + /** + * Verify Password + * Verifies the Password for a User using an Access Token, typically used when re-verification is required. + * @param passwordReauthRequest (required) + * @param accessToken Access Token of the User (optional) + * @param smstemplate SMS Template (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return ApiResponse<ReAuthResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<ReAuthResponse> reauthPasswordWithHttpInfo(PasswordReauthRequest passwordReauthRequest, String accessToken, String smstemplate, Boolean preventWebhook, Boolean xPreventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + okhttp3.Call localVarCall = reauthPasswordValidateBeforeCall(passwordReauthRequest, accessToken, smstemplate, preventWebhook, xPreventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, null); + Type localVarReturnType = new TypeToken<ReAuthResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Verify Password (asynchronously) + * Verifies the Password for a User using an Access Token, typically used when re-verification is required. + * @param passwordReauthRequest (required) + * @param accessToken Access Token of the User (optional) + * @param smstemplate SMS Template (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call reauthPasswordAsync(PasswordReauthRequest passwordReauthRequest, String accessToken, String smstemplate, Boolean preventWebhook, Boolean xPreventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback<ReAuthResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = reauthPasswordValidateBeforeCall(passwordReauthRequest, accessToken, smstemplate, preventWebhook, xPreventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + Type localVarReturnType = new TypeToken<ReAuthResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for reauthPin + * @param pinReauthRequest (required) + * @param smstemplate SMS Template (optional) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call reauthPinCall(PinReauthRequest pinReauthRequest, String smstemplate, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, 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 = pinReauthRequest; + + // create path and map variables + String localVarPath = "/identity/v2/auth/account/reauth/pin"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (smstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("smstemplate", smstemplate)); + } + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call reauthPinValidateBeforeCall(PinReauthRequest pinReauthRequest, String smstemplate, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'pinReauthRequest' is set + if (pinReauthRequest == null) { + throw new ApiException("Missing the required parameter 'pinReauthRequest' when calling reauthPin(Async)"); + } + + return reauthPinCall(pinReauthRequest, smstemplate, accessToken, preventWebhook, xPreventWebhook, _callback); + + } + + /** + * Verify PIN + * Verifies the PIN for a User using an Access Token, typically used when re-verification is required. + * @param pinReauthRequest (required) + * @param smstemplate SMS Template (optional) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ReAuthResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public ReAuthResponse reauthPin(PinReauthRequest pinReauthRequest, String smstemplate, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + ApiResponse<ReAuthResponse> localVarResp = reauthPinWithHttpInfo(pinReauthRequest, smstemplate, accessToken, preventWebhook, xPreventWebhook); + return localVarResp.getData(); + } + + /** + * Verify PIN + * Verifies the PIN for a User using an Access Token, typically used when re-verification is required. + * @param pinReauthRequest (required) + * @param smstemplate SMS Template (optional) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<ReAuthResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<ReAuthResponse> reauthPinWithHttpInfo(PinReauthRequest pinReauthRequest, String smstemplate, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + okhttp3.Call localVarCall = reauthPinValidateBeforeCall(pinReauthRequest, smstemplate, accessToken, preventWebhook, xPreventWebhook, null); + Type localVarReturnType = new TypeToken<ReAuthResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Verify PIN (asynchronously) + * Verifies the PIN for a User using an Access Token, typically used when re-verification is required. + * @param pinReauthRequest (required) + * @param smstemplate SMS Template (optional) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call reauthPinAsync(PinReauthRequest pinReauthRequest, String smstemplate, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback<ReAuthResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = reauthPinValidateBeforeCall(pinReauthRequest, smstemplate, accessToken, preventWebhook, xPreventWebhook, _callback); + Type localVarReturnType = new TypeToken<ReAuthResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for reauthTrigger + * @param accessToken Access Token of the User (optional) + * @param smstemplate2fa SMS template name to be used for sending the 2FA code to the User. (optional) + * @param duoredirecturi Duo auth redirection url. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call reauthTriggerCall(String accessToken, String smstemplate2fa, String duoredirecturi, 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 = "/identity/v2/auth/account/reauth/2fa"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (smstemplate2fa != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("smstemplate2fa", smstemplate2fa)); + } + + if (duoredirecturi != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("duoredirecturi", duoredirecturi)); + } + + 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[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call reauthTriggerValidateBeforeCall(String accessToken, String smstemplate2fa, String duoredirecturi, final ApiCallback _callback) throws ApiException { + return reauthTriggerCall(accessToken, smstemplate2fa, duoredirecturi, _callback); + + } + + /** + * Retrieve Step-Up Authentication settings + * Triggers Step-Up Authentication for Multi-Factor Authentication (MFA) settings, allowing Users to verify their MFA methods. + * @param accessToken Access Token of the User (optional) + * @param smstemplate2fa SMS template name to be used for sending the 2FA code to the User. (optional) + * @param duoredirecturi Duo auth redirection url. (optional) + * @return TwoFactorAuthenticationSettings + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public TwoFactorAuthenticationSettings reauthTrigger(String accessToken, String smstemplate2fa, String duoredirecturi) throws ApiException { + ApiResponse<TwoFactorAuthenticationSettings> localVarResp = reauthTriggerWithHttpInfo(accessToken, smstemplate2fa, duoredirecturi); + return localVarResp.getData(); + } + + /** + * Retrieve Step-Up Authentication settings + * Triggers Step-Up Authentication for Multi-Factor Authentication (MFA) settings, allowing Users to verify their MFA methods. + * @param accessToken Access Token of the User (optional) + * @param smstemplate2fa SMS template name to be used for sending the 2FA code to the User. (optional) + * @param duoredirecturi Duo auth redirection url. (optional) + * @return ApiResponse<TwoFactorAuthenticationSettings> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public ApiResponse<TwoFactorAuthenticationSettings> reauthTriggerWithHttpInfo(String accessToken, String smstemplate2fa, String duoredirecturi) throws ApiException { + okhttp3.Call localVarCall = reauthTriggerValidateBeforeCall(accessToken, smstemplate2fa, duoredirecturi, null); + Type localVarReturnType = new TypeToken<TwoFactorAuthenticationSettings>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Step-Up Authentication settings (asynchronously) + * Triggers Step-Up Authentication for Multi-Factor Authentication (MFA) settings, allowing Users to verify their MFA methods. + * @param accessToken Access Token of the User (optional) + * @param smstemplate2fa SMS template name to be used for sending the 2FA code to the User. (optional) + * @param duoredirecturi Duo auth redirection url. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call reauthTriggerAsync(String accessToken, String smstemplate2fa, String duoredirecturi, final ApiCallback<TwoFactorAuthenticationSettings> _callback) throws ApiException { + + okhttp3.Call localVarCall = reauthTriggerValidateBeforeCall(accessToken, smstemplate2fa, duoredirecturi, _callback); + Type localVarReturnType = new TypeToken<TwoFactorAuthenticationSettings>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for resend2FAOTP + * @param secondfactorauthenticationtoken Second factor token (required) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successful MFA login or MFA challenge required </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resend2FAOTPCall(String secondfactorauthenticationtoken, Boolean isvoiceotp, 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 = "/identity/v2/auth/login/2fa/resend"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (secondfactorauthenticationtoken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("secondfactorauthenticationtoken", secondfactorauthenticationtoken)); + } + + if (isvoiceotp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("isvoiceotp", isvoiceotp)); + } + + 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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call resend2FAOTPValidateBeforeCall(String secondfactorauthenticationtoken, Boolean isvoiceotp, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'secondfactorauthenticationtoken' is set + if (secondfactorauthenticationtoken == null) { + throw new ApiException("Missing the required parameter 'secondfactorauthenticationtoken' when calling resend2FAOTP(Async)"); + } + + return resend2FAOTPCall(secondfactorauthenticationtoken, isvoiceotp, _callback); + + } + + /** + * Resend SMS OTP with MFA Token + * Resends the Multi-Factor Authentication OTP via SMS for login. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @return SMSResponseData + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successful MFA login or MFA challenge required </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public SMSResponseData resend2FAOTP(String secondfactorauthenticationtoken, Boolean isvoiceotp) throws ApiException { + ApiResponse<SMSResponseData> localVarResp = resend2FAOTPWithHttpInfo(secondfactorauthenticationtoken, isvoiceotp); + return localVarResp.getData(); + } + + /** + * Resend SMS OTP with MFA Token + * Resends the Multi-Factor Authentication OTP via SMS for login. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @return ApiResponse<SMSResponseData> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successful MFA login or MFA challenge required </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SMSResponseData> resend2FAOTPWithHttpInfo(String secondfactorauthenticationtoken, Boolean isvoiceotp) throws ApiException { + okhttp3.Call localVarCall = resend2FAOTPValidateBeforeCall(secondfactorauthenticationtoken, isvoiceotp, null); + Type localVarReturnType = new TypeToken<SMSResponseData>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Resend SMS OTP with MFA Token (asynchronously) + * Resends the Multi-Factor Authentication OTP via SMS for login. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successful MFA login or MFA challenge required </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resend2FAOTPAsync(String secondfactorauthenticationtoken, Boolean isvoiceotp, final ApiCallback<SMSResponseData> _callback) throws ApiException { + + okhttp3.Call localVarCall = resend2FAOTPValidateBeforeCall(secondfactorauthenticationtoken, isvoiceotp, _callback); + Type localVarReturnType = new TypeToken<SMSResponseData>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for resend2faSMSOtp + * @param secondfactorauthenticationtoken Second factor token (required) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successful MFA login or MFA challenge required </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resend2faSMSOtpCall(String secondfactorauthenticationtoken, Boolean isvoiceotp, 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 = "/identity/v2/auth/login/2fa/sms/resend"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (secondfactorauthenticationtoken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("secondfactorauthenticationtoken", secondfactorauthenticationtoken)); + } + + if (isvoiceotp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("isvoiceotp", isvoiceotp)); + } + + 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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call resend2faSMSOtpValidateBeforeCall(String secondfactorauthenticationtoken, Boolean isvoiceotp, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'secondfactorauthenticationtoken' is set + if (secondfactorauthenticationtoken == null) { + throw new ApiException("Missing the required parameter 'secondfactorauthenticationtoken' when calling resend2faSMSOtp(Async)"); + } + + return resend2faSMSOtpCall(secondfactorauthenticationtoken, isvoiceotp, _callback); + + } + + /** + * Resend SMS OTP with MFA Token + * Resends the Multi-Factor Authentication OTP via SMS for login. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @return SMSResponseData + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successful MFA login or MFA challenge required </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public SMSResponseData resend2faSMSOtp(String secondfactorauthenticationtoken, Boolean isvoiceotp) throws ApiException { + ApiResponse<SMSResponseData> localVarResp = resend2faSMSOtpWithHttpInfo(secondfactorauthenticationtoken, isvoiceotp); + return localVarResp.getData(); + } + + /** + * Resend SMS OTP with MFA Token + * Resends the Multi-Factor Authentication OTP via SMS for login. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @return ApiResponse<SMSResponseData> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successful MFA login or MFA challenge required </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SMSResponseData> resend2faSMSOtpWithHttpInfo(String secondfactorauthenticationtoken, Boolean isvoiceotp) throws ApiException { + okhttp3.Call localVarCall = resend2faSMSOtpValidateBeforeCall(secondfactorauthenticationtoken, isvoiceotp, null); + Type localVarReturnType = new TypeToken<SMSResponseData>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Resend SMS OTP with MFA Token (asynchronously) + * Resends the Multi-Factor Authentication OTP via SMS for login. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successful MFA login or MFA challenge required </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resend2faSMSOtpAsync(String secondfactorauthenticationtoken, Boolean isvoiceotp, final ApiCallback<SMSResponseData> _callback) throws ApiException { + + okhttp3.Call localVarCall = resend2faSMSOtpValidateBeforeCall(secondfactorauthenticationtoken, isvoiceotp, _callback); + Type localVarReturnType = new TypeToken<SMSResponseData>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for resendEmailOTPMFAToken + * @param secondfactorauthenticationtoken Second factor token (required) + * @param emailModel (required) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param emailtemplate2fa Name of the 2FA Email template to use for this notification. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OTP sent successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resendEmailOTPMFATokenCall(String secondfactorauthenticationtoken, EmailModel emailModel, Boolean isvoiceotp, String emailtemplate2fa, 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 = emailModel; + + // create path and map variables + String localVarPath = "/identity/v2/auth/login/2fa/email"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (secondfactorauthenticationtoken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("secondfactorauthenticationtoken", secondfactorauthenticationtoken)); + } + + if (isvoiceotp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("isvoiceotp", isvoiceotp)); + } + + if (emailtemplate2fa != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailtemplate2fa", emailtemplate2fa)); + } + + 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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call resendEmailOTPMFATokenValidateBeforeCall(String secondfactorauthenticationtoken, EmailModel emailModel, Boolean isvoiceotp, String emailtemplate2fa, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'secondfactorauthenticationtoken' is set + if (secondfactorauthenticationtoken == null) { + throw new ApiException("Missing the required parameter 'secondfactorauthenticationtoken' when calling resendEmailOTPMFAToken(Async)"); + } + + // verify the required parameter 'emailModel' is set + if (emailModel == null) { + throw new ApiException("Missing the required parameter 'emailModel' when calling resendEmailOTPMFAToken(Async)"); + } + + return resendEmailOTPMFATokenCall(secondfactorauthenticationtoken, emailModel, isvoiceotp, emailtemplate2fa, _callback); + + } + + /** + * Resend Email OTP with MFA Token + * Sends the OTP to the Email if the Email OTP authenticator is enabled in the Tenant's MFA configuration. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param emailModel (required) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param emailtemplate2fa Name of the 2FA Email template to use for this notification. (optional) + * @return IsPostedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OTP sent successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public IsPostedResponse resendEmailOTPMFAToken(String secondfactorauthenticationtoken, EmailModel emailModel, Boolean isvoiceotp, String emailtemplate2fa) throws ApiException { + ApiResponse<IsPostedResponse> localVarResp = resendEmailOTPMFATokenWithHttpInfo(secondfactorauthenticationtoken, emailModel, isvoiceotp, emailtemplate2fa); + return localVarResp.getData(); + } + + /** + * Resend Email OTP with MFA Token + * Sends the OTP to the Email if the Email OTP authenticator is enabled in the Tenant's MFA configuration. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param emailModel (required) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param emailtemplate2fa Name of the 2FA Email template to use for this notification. (optional) + * @return ApiResponse<IsPostedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OTP sent successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedResponse> resendEmailOTPMFATokenWithHttpInfo(String secondfactorauthenticationtoken, EmailModel emailModel, Boolean isvoiceotp, String emailtemplate2fa) throws ApiException { + okhttp3.Call localVarCall = resendEmailOTPMFATokenValidateBeforeCall(secondfactorauthenticationtoken, emailModel, isvoiceotp, emailtemplate2fa, null); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Resend Email OTP with MFA Token (asynchronously) + * Sends the OTP to the Email if the Email OTP authenticator is enabled in the Tenant's MFA configuration. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param emailModel (required) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param emailtemplate2fa Name of the 2FA Email template to use for this notification. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OTP sent successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resendEmailOTPMFATokenAsync(String secondfactorauthenticationtoken, EmailModel emailModel, Boolean isvoiceotp, String emailtemplate2fa, final ApiCallback<IsPostedResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = resendEmailOTPMFATokenValidateBeforeCall(secondfactorauthenticationtoken, emailModel, isvoiceotp, emailtemplate2fa, _callback); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for resendTwoFactorEmailOtp + * @param emailid The Email address of User (optional) + * @param emailtemplate2fa Name of the 2FA Email template to use for this notification. (optional) + * @param accessToken Access Token of the User (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OTP resent successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resendTwoFactorEmailOtpCall(String emailid, String emailtemplate2fa, String accessToken, 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 = "/identity/v2/auth/account/2fa/email"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (emailid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailid", emailid)); + } + + if (emailtemplate2fa != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailtemplate2fa", emailtemplate2fa)); + } + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + 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[] { "APIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call resendTwoFactorEmailOtpValidateBeforeCall(String emailid, String emailtemplate2fa, String accessToken, final ApiCallback _callback) throws ApiException { + return resendTwoFactorEmailOtpCall(emailid, emailtemplate2fa, accessToken, _callback); + + } + + /** + * Resend Email OTP + * Sends the OTP to the Email if the Email OTP Authenticator is enabled in the Tenant's MFA configuration. + * @param emailid The Email address of User (optional) + * @param emailtemplate2fa Name of the 2FA Email template to use for this notification. (optional) + * @param accessToken Access Token of the User (optional) + * @return IsPostedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OTP resent successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public IsPostedResponse resendTwoFactorEmailOtp(String emailid, String emailtemplate2fa, String accessToken) throws ApiException { + ApiResponse<IsPostedResponse> localVarResp = resendTwoFactorEmailOtpWithHttpInfo(emailid, emailtemplate2fa, accessToken); + return localVarResp.getData(); + } + + /** + * Resend Email OTP + * Sends the OTP to the Email if the Email OTP Authenticator is enabled in the Tenant's MFA configuration. + * @param emailid The Email address of User (optional) + * @param emailtemplate2fa Name of the 2FA Email template to use for this notification. (optional) + * @param accessToken Access Token of the User (optional) + * @return ApiResponse<IsPostedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OTP resent successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedResponse> resendTwoFactorEmailOtpWithHttpInfo(String emailid, String emailtemplate2fa, String accessToken) throws ApiException { + okhttp3.Call localVarCall = resendTwoFactorEmailOtpValidateBeforeCall(emailid, emailtemplate2fa, accessToken, null); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Resend Email OTP (asynchronously) + * Sends the OTP to the Email if the Email OTP Authenticator is enabled in the Tenant's MFA configuration. + * @param emailid The Email address of User (optional) + * @param emailtemplate2fa Name of the 2FA Email template to use for this notification. (optional) + * @param accessToken Access Token of the User (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OTP resent successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - The client is not authorized to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resendTwoFactorEmailOtpAsync(String emailid, String emailtemplate2fa, String accessToken, final ApiCallback<IsPostedResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = resendTwoFactorEmailOtpValidateBeforeCall(emailid, emailtemplate2fa, accessToken, _callback); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for resetDuoAuthViaAccessToken + * @param accessToken Access Token of the User (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetDuoAuthViaAccessTokenCall(String accessToken, 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 = "/identity/v2/auth/account/2fa/duo"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + 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[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call resetDuoAuthViaAccessTokenValidateBeforeCall(String accessToken, final ApiCallback _callback) throws ApiException { + return resetDuoAuthViaAccessTokenCall(accessToken, _callback); + + } + + /** + * Reset Duo Authenticator + * Resets the Duo Authenticator settings for a User with MFA enabled, allowing reconfiguration or recovery of Duo access. + * @param accessToken Access Token of the User (optional) + * @return IsDeleted + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public IsDeleted resetDuoAuthViaAccessToken(String accessToken) throws ApiException { + ApiResponse<IsDeleted> localVarResp = resetDuoAuthViaAccessTokenWithHttpInfo(accessToken); + return localVarResp.getData(); + } + + /** + * Reset Duo Authenticator + * Resets the Duo Authenticator settings for a User with MFA enabled, allowing reconfiguration or recovery of Duo access. + * @param accessToken Access Token of the User (optional) + * @return ApiResponse<IsDeleted> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsDeleted> resetDuoAuthViaAccessTokenWithHttpInfo(String accessToken) throws ApiException { + okhttp3.Call localVarCall = resetDuoAuthViaAccessTokenValidateBeforeCall(accessToken, null); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Reset Duo Authenticator (asynchronously) + * Resets the Duo Authenticator settings for a User with MFA enabled, allowing reconfiguration or recovery of Duo access. + * @param accessToken Access Token of the User (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetDuoAuthViaAccessTokenAsync(String accessToken, final ApiCallback<IsDeleted> _callback) throws ApiException { + + okhttp3.Call localVarCall = resetDuoAuthViaAccessTokenValidateBeforeCall(accessToken, _callback); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for resetMFAEmailAuthByAccessToken + * @param accessToken Access Token of the User (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetMFAEmailAuthByAccessTokenCall(String accessToken, 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 = "/identity/v2/auth/account/2fa/email"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + 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[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call resetMFAEmailAuthByAccessTokenValidateBeforeCall(String accessToken, final ApiCallback _callback) throws ApiException { + return resetMFAEmailAuthByAccessTokenCall(accessToken, _callback); + + } + + /** + * Reset Email OTP Authenticator + * Resets the Email OTP Authenticator settings for a User with MFA enabled, allowing reconfiguration. + * @param accessToken Access Token of the User (optional) + * @return IsDeleted + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public IsDeleted resetMFAEmailAuthByAccessToken(String accessToken) throws ApiException { + ApiResponse<IsDeleted> localVarResp = resetMFAEmailAuthByAccessTokenWithHttpInfo(accessToken); + return localVarResp.getData(); + } + + /** + * Reset Email OTP Authenticator + * Resets the Email OTP Authenticator settings for a User with MFA enabled, allowing reconfiguration. + * @param accessToken Access Token of the User (optional) + * @return ApiResponse<IsDeleted> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsDeleted> resetMFAEmailAuthByAccessTokenWithHttpInfo(String accessToken) throws ApiException { + okhttp3.Call localVarCall = resetMFAEmailAuthByAccessTokenValidateBeforeCall(accessToken, null); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Reset Email OTP Authenticator (asynchronously) + * Resets the Email OTP Authenticator settings for a User with MFA enabled, allowing reconfiguration. + * @param accessToken Access Token of the User (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetMFAEmailAuthByAccessTokenAsync(String accessToken, final ApiCallback<IsDeleted> _callback) throws ApiException { + + okhttp3.Call localVarCall = resetMFAEmailAuthByAccessTokenValidateBeforeCall(accessToken, _callback); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for resetMFAPasskeyByAccessToken + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetMFAPasskeyByAccessTokenCall(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, 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 = "/identity/v2/auth/account/2fa/passkey"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call resetMFAPasskeyByAccessTokenValidateBeforeCall(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback _callback) throws ApiException { + return resetMFAPasskeyByAccessTokenCall(accessToken, preventWebhook, xPreventWebhook, _callback); + + } + + /** + * Reset Passkey Authenticator + * Resets the Passkey Authenticator settings for the specified User. + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return IsDeleted + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public IsDeleted resetMFAPasskeyByAccessToken(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + ApiResponse<IsDeleted> localVarResp = resetMFAPasskeyByAccessTokenWithHttpInfo(accessToken, preventWebhook, xPreventWebhook); + return localVarResp.getData(); + } + + /** + * Reset Passkey Authenticator + * Resets the Passkey Authenticator settings for the specified User. + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<IsDeleted> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsDeleted> resetMFAPasskeyByAccessTokenWithHttpInfo(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + okhttp3.Call localVarCall = resetMFAPasskeyByAccessTokenValidateBeforeCall(accessToken, preventWebhook, xPreventWebhook, null); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Reset Passkey Authenticator (asynchronously) + * Resets the Passkey Authenticator settings for the specified User. + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetMFAPasskeyByAccessTokenAsync(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback<IsDeleted> _callback) throws ApiException { + + okhttp3.Call localVarCall = resetMFAPasskeyByAccessTokenValidateBeforeCall(accessToken, preventWebhook, xPreventWebhook, _callback); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for resetMfaPushAuthSettings + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request has succeeded and the MFA Push Authenticator settings have been reset. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetMfaPushAuthSettingsCall(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 = "/identity/v2/auth/account/2fa/push"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call resetMfaPushAuthSettingsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return resetMfaPushAuthSettingsCall(_callback); + + } + + /** + * Reset MFA Push Notification + * Resets the MFA Push Authenticator settings for a User. + * @return IsDeleted + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request has succeeded and the MFA Push Authenticator settings have been reset. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + </table> + */ + public IsDeleted resetMfaPushAuthSettings() throws ApiException { + ApiResponse<IsDeleted> localVarResp = resetMfaPushAuthSettingsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Reset MFA Push Notification + * Resets the MFA Push Authenticator settings for a User. + * @return ApiResponse<IsDeleted> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request has succeeded and the MFA Push Authenticator settings have been reset. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsDeleted> resetMfaPushAuthSettingsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = resetMfaPushAuthSettingsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Reset MFA Push Notification (asynchronously) + * Resets the MFA Push Authenticator settings for a User. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request has succeeded and the MFA Push Authenticator settings have been reset. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but is refusing to fulfill it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetMfaPushAuthSettingsAsync(final ApiCallback<IsDeleted> _callback) throws ApiException { + + okhttp3.Call localVarCall = resetMfaPushAuthSettingsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for resetPinByOTP + * @param type The method of ReAuth MFA verification to use. (required) + * @param resetPINByOTP (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetPinByOTPCall(String type, ResetPINByOTP resetPINByOTP, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, 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 = resetPINByOTP; + + // create path and map variables + String localVarPath = "/identity/v2/auth/pin/reset/otp/{type}" + .replace("{" + "type" + "}", localVarApiClient.escapeString(type.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (gRecaptchaResponse2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g_recaptcha_response", gRecaptchaResponse2)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call resetPinByOTPValidateBeforeCall(String type, ResetPINByOTP resetPINByOTP, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'type' is set + if (type == null) { + throw new ApiException("Missing the required parameter 'type' when calling resetPinByOTP(Async)"); + } + + // verify the required parameter 'resetPINByOTP' is set + if (resetPINByOTP == null) { + throw new ApiException("Missing the required parameter 'resetPINByOTP' when calling resetPinByOTP(Async)"); + } + + return resetPinByOTPCall(type, resetPINByOTP, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + + } + + /** + * Reset PIN with OTP + * Allows a User to reset their PIN by verifying a One-Time Password (OTP). The User must provide the OTP, a new PIN, and one identifier (Phone, Email, or Username), enabling secure PIN recovery when the User forgets their PIN. + * @param type The method of ReAuth MFA verification to use. (required) + * @param resetPINByOTP (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return IsPostedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public IsPostedResponse resetPinByOTP(String type, ResetPINByOTP resetPINByOTP, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + ApiResponse<IsPostedResponse> localVarResp = resetPinByOTPWithHttpInfo(type, resetPINByOTP, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + return localVarResp.getData(); + } + + /** + * Reset PIN with OTP + * Allows a User to reset their PIN by verifying a One-Time Password (OTP). The User must provide the OTP, a new PIN, and one identifier (Phone, Email, or Username), enabling secure PIN recovery when the User forgets their PIN. + * @param type The method of ReAuth MFA verification to use. (required) + * @param resetPINByOTP (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return ApiResponse<IsPostedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedResponse> resetPinByOTPWithHttpInfo(String type, ResetPINByOTP resetPINByOTP, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + okhttp3.Call localVarCall = resetPinByOTPValidateBeforeCall(type, resetPINByOTP, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, null); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Reset PIN with OTP (asynchronously) + * Allows a User to reset their PIN by verifying a One-Time Password (OTP). The User must provide the OTP, a new PIN, and one identifier (Phone, Email, or Username), enabling secure PIN recovery when the User forgets their PIN. + * @param type The method of ReAuth MFA verification to use. (required) + * @param resetPINByOTP (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetPinByOTPAsync(String type, ResetPINByOTP resetPINByOTP, Boolean xPreventWebhook, Boolean preventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback<IsPostedResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = resetPinByOTPValidateBeforeCall(type, resetPINByOTP, xPreventWebhook, preventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for resetPinByResetToken + * @param resetPINByToken (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetPinByResetTokenCall(ResetPINByToken resetPINByToken, Boolean xPreventWebhook, Boolean preventWebhook, 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 = resetPINByToken; + + // create path and map variables + String localVarPath = "/identity/v2/auth/pin/reset/token"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call resetPinByResetTokenValidateBeforeCall(ResetPINByToken resetPINByToken, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'resetPINByToken' is set + if (resetPINByToken == null) { + throw new ApiException("Missing the required parameter 'resetPINByToken' when calling resetPinByResetToken(Async)"); + } + + return resetPinByResetTokenCall(resetPINByToken, xPreventWebhook, preventWebhook, _callback); + + } + + /** + * Reset PIN with Reset Token + * Allows a User to reset their PIN by providing a reset token received via Email and a new PIN, enabling secure PIN recovery when the User forgets their PIN. + * @param resetPINByToken (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return IsPostedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public IsPostedResponse resetPinByResetToken(ResetPINByToken resetPINByToken, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + ApiResponse<IsPostedResponse> localVarResp = resetPinByResetTokenWithHttpInfo(resetPINByToken, xPreventWebhook, preventWebhook); + return localVarResp.getData(); + } + + /** + * Reset PIN with Reset Token + * Allows a User to reset their PIN by providing a reset token received via Email and a new PIN, enabling secure PIN recovery when the User forgets their PIN. + * @param resetPINByToken (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<IsPostedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedResponse> resetPinByResetTokenWithHttpInfo(ResetPINByToken resetPINByToken, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + okhttp3.Call localVarCall = resetPinByResetTokenValidateBeforeCall(resetPINByToken, xPreventWebhook, preventWebhook, null); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Reset PIN with Reset Token (asynchronously) + * Allows a User to reset their PIN by providing a reset token received via Email and a new PIN, enabling secure PIN recovery when the User forgets their PIN. + * @param resetPINByToken (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resetPinByResetTokenAsync(ResetPINByToken resetPINByToken, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback<IsPostedResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = resetPinByResetTokenValidateBeforeCall(resetPINByToken, xPreventWebhook, preventWebhook, _callback); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for sendEmailOtpForReauthMFA + * @param emailid The Email address of User (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param accessToken Access Token of the User (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call sendEmailOtpForReauthMFACall(String emailid, String emailtemplate, String accessToken, 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 = "/identity/v2/auth/account/reauth/2fa/email"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (emailid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailid", emailid)); + } + + if (emailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailtemplate", emailtemplate)); + } + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + 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[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call sendEmailOtpForReauthMFAValidateBeforeCall(String emailid, String emailtemplate, String accessToken, final ApiCallback _callback) throws ApiException { + return sendEmailOtpForReauthMFACall(emailid, emailtemplate, accessToken, _callback); + + } + + /** + * Send Email OTP + * Sends a One-Time Password (OTP) to the User's Email for re-authentication. + * @param emailid The Email address of User (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param accessToken Access Token of the User (optional) + * @return IsPostedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public IsPostedResponse sendEmailOtpForReauthMFA(String emailid, String emailtemplate, String accessToken) throws ApiException { + ApiResponse<IsPostedResponse> localVarResp = sendEmailOtpForReauthMFAWithHttpInfo(emailid, emailtemplate, accessToken); + return localVarResp.getData(); + } + + /** + * Send Email OTP + * Sends a One-Time Password (OTP) to the User's Email for re-authentication. + * @param emailid The Email address of User (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param accessToken Access Token of the User (optional) + * @return ApiResponse<IsPostedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedResponse> sendEmailOtpForReauthMFAWithHttpInfo(String emailid, String emailtemplate, String accessToken) throws ApiException { + okhttp3.Call localVarCall = sendEmailOtpForReauthMFAValidateBeforeCall(emailid, emailtemplate, accessToken, null); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Send Email OTP (asynchronously) + * Sends a One-Time Password (OTP) to the User's Email for re-authentication. + * @param emailid The Email address of User (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param accessToken Access Token of the User (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call sendEmailOtpForReauthMFAAsync(String emailid, String emailtemplate, String accessToken, final ApiCallback<IsPostedResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = sendEmailOtpForReauthMFAValidateBeforeCall(emailid, emailtemplate, accessToken, _callback); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for sendReAuthEmailOtp + * @param emailid The Email address of User (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param accessToken Access Token of the User (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call sendReAuthEmailOtpCall(String emailid, String emailtemplate, String accessToken, 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 = "/identity/v2/auth/account/reauth/otp/email"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (emailid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailid", emailid)); + } + + if (emailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailtemplate", emailtemplate)); + } + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + 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[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call sendReAuthEmailOtpValidateBeforeCall(String emailid, String emailtemplate, String accessToken, final ApiCallback _callback) throws ApiException { + return sendReAuthEmailOtpCall(emailid, emailtemplate, accessToken, _callback); + + } + + /** + * Send Email OTP + * Sends a One-Time Password (OTP) to the User's Email for re-authentication. + * @param emailid The Email address of User (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param accessToken Access Token of the User (optional) + * @return IsPostedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public IsPostedResponse sendReAuthEmailOtp(String emailid, String emailtemplate, String accessToken) throws ApiException { + ApiResponse<IsPostedResponse> localVarResp = sendReAuthEmailOtpWithHttpInfo(emailid, emailtemplate, accessToken); + return localVarResp.getData(); + } + + /** + * Send Email OTP + * Sends a One-Time Password (OTP) to the User's Email for re-authentication. + * @param emailid The Email address of User (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param accessToken Access Token of the User (optional) + * @return ApiResponse<IsPostedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedResponse> sendReAuthEmailOtpWithHttpInfo(String emailid, String emailtemplate, String accessToken) throws ApiException { + okhttp3.Call localVarCall = sendReAuthEmailOtpValidateBeforeCall(emailid, emailtemplate, accessToken, null); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Send Email OTP (asynchronously) + * Sends a One-Time Password (OTP) to the User's Email for re-authentication. + * @param emailid The Email address of User (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param accessToken Access Token of the User (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call sendReAuthEmailOtpAsync(String emailid, String emailtemplate, String accessToken, final ApiCallback<IsPostedResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = sendReAuthEmailOtpValidateBeforeCall(emailid, emailtemplate, accessToken, _callback); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for setPinByPinAuthToken + * @param pinauthtoken Pin auth token to set the PIN on account (required) + * @param piNModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully submit request to reset the PIN </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call setPinByPinAuthTokenCall(String pinauthtoken, PINModel piNModel, Boolean xPreventWebhook, Boolean preventWebhook, 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 = piNModel; + + // create path and map variables + String localVarPath = "/identity/v2/auth/pin/set/pinauthtoken"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (pinauthtoken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("pinauthtoken", pinauthtoken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call setPinByPinAuthTokenValidateBeforeCall(String pinauthtoken, PINModel piNModel, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'pinauthtoken' is set + if (pinauthtoken == null) { + throw new ApiException("Missing the required parameter 'pinauthtoken' when calling setPinByPinAuthToken(Async)"); + } + + // verify the required parameter 'piNModel' is set + if (piNModel == null) { + throw new ApiException("Missing the required parameter 'piNModel' when calling setPinByPinAuthToken(Async)"); + } + + return setPinByPinAuthTokenCall(pinauthtoken, piNModel, xPreventWebhook, preventWebhook, _callback); + + } + + /** + * Set PIN with Authentication Token + * Sets a PIN for Users logging in or registering for the first time. Requires a valid PIN authentication token and is typically part of the onboarding or initial setup process. + * @param pinauthtoken Pin auth token to set the PIN on account (required) + * @param piNModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return AuthResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully submit request to reset the PIN </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public AuthResponse setPinByPinAuthToken(String pinauthtoken, PINModel piNModel, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + ApiResponse<AuthResponse> localVarResp = setPinByPinAuthTokenWithHttpInfo(pinauthtoken, piNModel, xPreventWebhook, preventWebhook); + return localVarResp.getData(); + } + + /** + * Set PIN with Authentication Token + * Sets a PIN for Users logging in or registering for the first time. Requires a valid PIN authentication token and is typically part of the onboarding or initial setup process. + * @param pinauthtoken Pin auth token to set the PIN on account (required) + * @param piNModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<AuthResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully submit request to reset the PIN </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<AuthResponse> setPinByPinAuthTokenWithHttpInfo(String pinauthtoken, PINModel piNModel, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + okhttp3.Call localVarCall = setPinByPinAuthTokenValidateBeforeCall(pinauthtoken, piNModel, xPreventWebhook, preventWebhook, null); + Type localVarReturnType = new TypeToken<AuthResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Set PIN with Authentication Token (asynchronously) + * Sets a PIN for Users logging in or registering for the first time. Requires a valid PIN authentication token and is typically part of the onboarding or initial setup process. + * @param pinauthtoken Pin auth token to set the PIN on account (required) + * @param piNModel (required) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully submit request to reset the PIN </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call setPinByPinAuthTokenAsync(String pinauthtoken, PINModel piNModel, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback<AuthResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = setPinByPinAuthTokenValidateBeforeCall(pinauthtoken, piNModel, xPreventWebhook, preventWebhook, _callback); + Type localVarReturnType = new TypeToken<AuthResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for validateEmailOtpForReauth + * @param reAuthModelByEmailOtp (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call validateEmailOtpForReauthCall(ReAuthModelByEmailOtp reAuthModelByEmailOtp, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, 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 = reAuthModelByEmailOtp; + + // create path and map variables + String localVarPath = "/identity/v2/auth/account/reauth/otp/email"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call validateEmailOtpForReauthValidateBeforeCall(ReAuthModelByEmailOtp reAuthModelByEmailOtp, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'reAuthModelByEmailOtp' is set + if (reAuthModelByEmailOtp == null) { + throw new ApiException("Missing the required parameter 'reAuthModelByEmailOtp' when calling validateEmailOtpForReauth(Async)"); + } + + return validateEmailOtpForReauthCall(reAuthModelByEmailOtp, accessToken, preventWebhook, xPreventWebhook, _callback); + + } + + /** + * Verify Email OTP + * Validates the One-Time Password (OTP) sent to the User's Email during re-authentication. + * @param reAuthModelByEmailOtp (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ReAuthResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public ReAuthResponse validateEmailOtpForReauth(ReAuthModelByEmailOtp reAuthModelByEmailOtp, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + ApiResponse<ReAuthResponse> localVarResp = validateEmailOtpForReauthWithHttpInfo(reAuthModelByEmailOtp, accessToken, preventWebhook, xPreventWebhook); + return localVarResp.getData(); + } + + /** + * Verify Email OTP + * Validates the One-Time Password (OTP) sent to the User's Email during re-authentication. + * @param reAuthModelByEmailOtp (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<ReAuthResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<ReAuthResponse> validateEmailOtpForReauthWithHttpInfo(ReAuthModelByEmailOtp reAuthModelByEmailOtp, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + okhttp3.Call localVarCall = validateEmailOtpForReauthValidateBeforeCall(reAuthModelByEmailOtp, accessToken, preventWebhook, xPreventWebhook, null); + Type localVarReturnType = new TypeToken<ReAuthResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Verify Email OTP (asynchronously) + * Validates the One-Time Password (OTP) sent to the User's Email during re-authentication. + * @param reAuthModelByEmailOtp (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call validateEmailOtpForReauthAsync(ReAuthModelByEmailOtp reAuthModelByEmailOtp, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback<ReAuthResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = validateEmailOtpForReauthValidateBeforeCall(reAuthModelByEmailOtp, accessToken, preventWebhook, xPreventWebhook, _callback); + Type localVarReturnType = new TypeToken<ReAuthResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for validateEmailOtpForReauthMFA + * @param reAuthModelByEmailOtp (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call validateEmailOtpForReauthMFACall(ReAuthModelByEmailOtp reAuthModelByEmailOtp, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, 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 = reAuthModelByEmailOtp; + + // create path and map variables + String localVarPath = "/identity/v2/auth/account/reauth/2fa/otp/email/verify"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call validateEmailOtpForReauthMFAValidateBeforeCall(ReAuthModelByEmailOtp reAuthModelByEmailOtp, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'reAuthModelByEmailOtp' is set + if (reAuthModelByEmailOtp == null) { + throw new ApiException("Missing the required parameter 'reAuthModelByEmailOtp' when calling validateEmailOtpForReauthMFA(Async)"); + } + + return validateEmailOtpForReauthMFACall(reAuthModelByEmailOtp, accessToken, preventWebhook, xPreventWebhook, _callback); + + } + + /** + * Verify Email OTP + * Verifies the User with Email OTP and Access Token, typically used when re-authentication via Email OTP is required. + * @param reAuthModelByEmailOtp (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ReAuthResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public ReAuthResponse validateEmailOtpForReauthMFA(ReAuthModelByEmailOtp reAuthModelByEmailOtp, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + ApiResponse<ReAuthResponse> localVarResp = validateEmailOtpForReauthMFAWithHttpInfo(reAuthModelByEmailOtp, accessToken, preventWebhook, xPreventWebhook); + return localVarResp.getData(); + } + + /** + * Verify Email OTP + * Verifies the User with Email OTP and Access Token, typically used when re-authentication via Email OTP is required. + * @param reAuthModelByEmailOtp (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<ReAuthResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<ReAuthResponse> validateEmailOtpForReauthMFAWithHttpInfo(ReAuthModelByEmailOtp reAuthModelByEmailOtp, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + okhttp3.Call localVarCall = validateEmailOtpForReauthMFAValidateBeforeCall(reAuthModelByEmailOtp, accessToken, preventWebhook, xPreventWebhook, null); + Type localVarReturnType = new TypeToken<ReAuthResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Verify Email OTP (asynchronously) + * Verifies the User with Email OTP and Access Token, typically used when re-authentication via Email OTP is required. + * @param reAuthModelByEmailOtp (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call validateEmailOtpForReauthMFAAsync(ReAuthModelByEmailOtp reAuthModelByEmailOtp, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback<ReAuthResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = validateEmailOtpForReauthMFAValidateBeforeCall(reAuthModelByEmailOtp, accessToken, preventWebhook, xPreventWebhook, _callback); + Type localVarReturnType = new TypeToken<ReAuthResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for validateMfaOTPByEmail + * @param secondfactorauthenticationtoken Second factor token (required) + * @param reAuthModelByEmailOtp (required) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call validateMfaOTPByEmailCall(String secondfactorauthenticationtoken, ReAuthModelByEmailOtp reAuthModelByEmailOtp, String rbabrowseremailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, 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 = reAuthModelByEmailOtp; + + // create path and map variables + String localVarPath = "/identity/v2/auth/login/2fa/email"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (secondfactorauthenticationtoken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("secondfactorauthenticationtoken", secondfactorauthenticationtoken)); + } + + if (rbabrowseremailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbabrowseremailtemplate", rbabrowseremailtemplate)); + } + + if (rbacityemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacityemailtemplate", rbacityemailtemplate)); + } + + if (rbacountryemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacountryemailtemplate", rbacountryemailtemplate)); + } + + if (rbaipemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaipemailtemplate", rbaipemailtemplate)); + } + + if (rbadeviceemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbadeviceemailtemplate", rbadeviceemailtemplate)); + } + + if (rbabrowsersmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbabrowsersmstemplate", rbabrowsersmstemplate)); + } + + if (rbacitysmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacitysmstemplate", rbacitysmstemplate)); + } + + if (rbacountrysmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacountrysmstemplate", rbacountrysmstemplate)); + } + + if (rbaipsmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaipsmstemplate", rbaipsmstemplate)); + } + + if (rbadevicesmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbadevicesmstemplate", rbadevicesmstemplate)); + } + + 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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call validateMfaOTPByEmailValidateBeforeCall(String secondfactorauthenticationtoken, ReAuthModelByEmailOtp reAuthModelByEmailOtp, String rbabrowseremailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'secondfactorauthenticationtoken' is set + if (secondfactorauthenticationtoken == null) { + throw new ApiException("Missing the required parameter 'secondfactorauthenticationtoken' when calling validateMfaOTPByEmail(Async)"); + } + + // verify the required parameter 'reAuthModelByEmailOtp' is set + if (reAuthModelByEmailOtp == null) { + throw new ApiException("Missing the required parameter 'reAuthModelByEmailOtp' when calling validateMfaOTPByEmail(Async)"); + } + + return validateMfaOTPByEmailCall(secondfactorauthenticationtoken, reAuthModelByEmailOtp, rbabrowseremailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, _callback); + + } + + /** + * Verify Email OTP with MFA Token + * Logs in to a User's account during the second MFA step with an OTP sent to the Email. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param reAuthModelByEmailOtp (required) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @return AuthResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public AuthResponse validateMfaOTPByEmail(String secondfactorauthenticationtoken, ReAuthModelByEmailOtp reAuthModelByEmailOtp, String rbabrowseremailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate) throws ApiException { + ApiResponse<AuthResponse> localVarResp = validateMfaOTPByEmailWithHttpInfo(secondfactorauthenticationtoken, reAuthModelByEmailOtp, rbabrowseremailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate); + return localVarResp.getData(); + } + + /** + * Verify Email OTP with MFA Token + * Logs in to a User's account during the second MFA step with an OTP sent to the Email. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param reAuthModelByEmailOtp (required) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @return ApiResponse<AuthResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public ApiResponse<AuthResponse> validateMfaOTPByEmailWithHttpInfo(String secondfactorauthenticationtoken, ReAuthModelByEmailOtp reAuthModelByEmailOtp, String rbabrowseremailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate) throws ApiException { + okhttp3.Call localVarCall = validateMfaOTPByEmailValidateBeforeCall(secondfactorauthenticationtoken, reAuthModelByEmailOtp, rbabrowseremailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, null); + Type localVarReturnType = new TypeToken<AuthResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Verify Email OTP with MFA Token (asynchronously) + * Logs in to a User's account during the second MFA step with an OTP sent to the Email. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param reAuthModelByEmailOtp (required) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call validateMfaOTPByEmailAsync(String secondfactorauthenticationtoken, ReAuthModelByEmailOtp reAuthModelByEmailOtp, String rbabrowseremailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, final ApiCallback<AuthResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = validateMfaOTPByEmailValidateBeforeCall(secondfactorauthenticationtoken, reAuthModelByEmailOtp, rbabrowseremailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, _callback); + Type localVarReturnType = new TypeToken<AuthResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for validateMfaOTPByPhone + * @param secondfactorauthenticationtoken Second factor token (required) + * @param mfAVerifyPhoneOtpModel (required) + * @param smstemplate2fa SMS template name to be used for sending the 2FA code to the User. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call validateMfaOTPByPhoneCall(String secondfactorauthenticationtoken, MFAVerifyPhoneOtpModel mfAVerifyPhoneOtpModel, String smstemplate2fa, String fields, Boolean preventWebhook, Boolean xPreventWebhook, Boolean isvoiceotp, String rbabrowseremailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, 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 = mfAVerifyPhoneOtpModel; + + // create path and map variables + String localVarPath = "/identity/v2/auth/login/2fa/sms"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (secondfactorauthenticationtoken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("secondfactorauthenticationtoken", secondfactorauthenticationtoken)); + } + + if (smstemplate2fa != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("smstemplate2fa", smstemplate2fa)); + } + + if (fields != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fields", fields)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (isvoiceotp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("isvoiceotp", isvoiceotp)); + } + + if (rbabrowseremailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbabrowseremailtemplate", rbabrowseremailtemplate)); + } + + if (rbacityemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacityemailtemplate", rbacityemailtemplate)); + } + + if (rbacountryemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacountryemailtemplate", rbacountryemailtemplate)); + } + + if (rbaipemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaipemailtemplate", rbaipemailtemplate)); + } + + if (rbadeviceemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbadeviceemailtemplate", rbadeviceemailtemplate)); + } + + if (rbaotpsmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaotpsmstemplate", rbaotpsmstemplate)); + } + + if (rbabrowsersmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbabrowsersmstemplate", rbabrowsersmstemplate)); + } + + if (rbacitysmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacitysmstemplate", rbacitysmstemplate)); + } + + if (rbacountrysmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacountrysmstemplate", rbacountrysmstemplate)); + } + + if (rbaipsmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaipsmstemplate", rbaipsmstemplate)); + } + + if (rbadevicesmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbadevicesmstemplate", rbadevicesmstemplate)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call validateMfaOTPByPhoneValidateBeforeCall(String secondfactorauthenticationtoken, MFAVerifyPhoneOtpModel mfAVerifyPhoneOtpModel, String smstemplate2fa, String fields, Boolean preventWebhook, Boolean xPreventWebhook, Boolean isvoiceotp, String rbabrowseremailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'secondfactorauthenticationtoken' is set + if (secondfactorauthenticationtoken == null) { + throw new ApiException("Missing the required parameter 'secondfactorauthenticationtoken' when calling validateMfaOTPByPhone(Async)"); + } + + // verify the required parameter 'mfAVerifyPhoneOtpModel' is set + if (mfAVerifyPhoneOtpModel == null) { + throw new ApiException("Missing the required parameter 'mfAVerifyPhoneOtpModel' when calling validateMfaOTPByPhone(Async)"); + } + + return validateMfaOTPByPhoneCall(secondfactorauthenticationtoken, mfAVerifyPhoneOtpModel, smstemplate2fa, fields, preventWebhook, xPreventWebhook, isvoiceotp, rbabrowseremailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, _callback); + + } + + /** + * Verify SMS OTP + * Allows Users to log in with Multi-Factor Authentication using the OTP sent via SMS or Voice OTP. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param mfAVerifyPhoneOtpModel (required) + * @param smstemplate2fa SMS template name to be used for sending the 2FA code to the User. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @return AuthResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public AuthResponse validateMfaOTPByPhone(String secondfactorauthenticationtoken, MFAVerifyPhoneOtpModel mfAVerifyPhoneOtpModel, String smstemplate2fa, String fields, Boolean preventWebhook, Boolean xPreventWebhook, Boolean isvoiceotp, String rbabrowseremailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate) throws ApiException { + ApiResponse<AuthResponse> localVarResp = validateMfaOTPByPhoneWithHttpInfo(secondfactorauthenticationtoken, mfAVerifyPhoneOtpModel, smstemplate2fa, fields, preventWebhook, xPreventWebhook, isvoiceotp, rbabrowseremailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate); + return localVarResp.getData(); + } + + /** + * Verify SMS OTP + * Allows Users to log in with Multi-Factor Authentication using the OTP sent via SMS or Voice OTP. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param mfAVerifyPhoneOtpModel (required) + * @param smstemplate2fa SMS template name to be used for sending the 2FA code to the User. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @return ApiResponse<AuthResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public ApiResponse<AuthResponse> validateMfaOTPByPhoneWithHttpInfo(String secondfactorauthenticationtoken, MFAVerifyPhoneOtpModel mfAVerifyPhoneOtpModel, String smstemplate2fa, String fields, Boolean preventWebhook, Boolean xPreventWebhook, Boolean isvoiceotp, String rbabrowseremailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate) throws ApiException { + okhttp3.Call localVarCall = validateMfaOTPByPhoneValidateBeforeCall(secondfactorauthenticationtoken, mfAVerifyPhoneOtpModel, smstemplate2fa, fields, preventWebhook, xPreventWebhook, isvoiceotp, rbabrowseremailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, null); + Type localVarReturnType = new TypeToken<AuthResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Verify SMS OTP (asynchronously) + * Allows Users to log in with Multi-Factor Authentication using the OTP sent via SMS or Voice OTP. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param mfAVerifyPhoneOtpModel (required) + * @param smstemplate2fa SMS template name to be used for sending the 2FA code to the User. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbaotpsmstemplate RBA OTP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call validateMfaOTPByPhoneAsync(String secondfactorauthenticationtoken, MFAVerifyPhoneOtpModel mfAVerifyPhoneOtpModel, String smstemplate2fa, String fields, Boolean preventWebhook, Boolean xPreventWebhook, Boolean isvoiceotp, String rbabrowseremailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbaotpsmstemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, final ApiCallback<AuthResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = validateMfaOTPByPhoneValidateBeforeCall(secondfactorauthenticationtoken, mfAVerifyPhoneOtpModel, smstemplate2fa, fields, preventWebhook, xPreventWebhook, isvoiceotp, rbabrowseremailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbaotpsmstemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, _callback); + Type localVarReturnType = new TypeToken<AuthResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for validateReauthMFA + * @param type The method of ReAuth MFA verification to use. (required) + * @param reAuthTwoFAModel (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call validateReauthMFACall(String type, ReAuthTwoFAModel reAuthTwoFAModel, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, 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 = reAuthTwoFAModel; + + // create path and map variables + String localVarPath = "/identity/v2/auth/account/reauth/2fa/{type}" + .replace("{" + "type" + "}", localVarApiClient.escapeString(type.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (gRecaptchaResponse2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g_recaptcha_response", gRecaptchaResponse2)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call validateReauthMFAValidateBeforeCall(String type, ReAuthTwoFAModel reAuthTwoFAModel, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'type' is set + if (type == null) { + throw new ApiException("Missing the required parameter 'type' when calling validateReauthMFA(Async)"); + } + + // verify the required parameter 'reAuthTwoFAModel' is set + if (reAuthTwoFAModel == null) { + throw new ApiException("Missing the required parameter 'reAuthTwoFAModel' when calling validateReauthMFA(Async)"); + } + + return validateReauthMFACall(type, reAuthTwoFAModel, accessToken, preventWebhook, xPreventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + + } + + /** + * Verify backup code or OTP + * Validates the triggered MFA authentication flow using a backup code, OTP, or authenticator code. + * @param type The method of ReAuth MFA verification to use. (required) + * @param reAuthTwoFAModel (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return ReAuthResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public ReAuthResponse validateReauthMFA(String type, ReAuthTwoFAModel reAuthTwoFAModel, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + ApiResponse<ReAuthResponse> localVarResp = validateReauthMFAWithHttpInfo(type, reAuthTwoFAModel, accessToken, preventWebhook, xPreventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + return localVarResp.getData(); + } + + /** + * Verify backup code or OTP + * Validates the triggered MFA authentication flow using a backup code, OTP, or authenticator code. + * @param type The method of ReAuth MFA verification to use. (required) + * @param reAuthTwoFAModel (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return ApiResponse<ReAuthResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<ReAuthResponse> validateReauthMFAWithHttpInfo(String type, ReAuthTwoFAModel reAuthTwoFAModel, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + okhttp3.Call localVarCall = validateReauthMFAValidateBeforeCall(type, reAuthTwoFAModel, accessToken, preventWebhook, xPreventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, null); + Type localVarReturnType = new TypeToken<ReAuthResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Verify backup code or OTP (asynchronously) + * Validates the triggered MFA authentication flow using a backup code, OTP, or authenticator code. + * @param type The method of ReAuth MFA verification to use. (required) + * @param reAuthTwoFAModel (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call validateReauthMFAAsync(String type, ReAuthTwoFAModel reAuthTwoFAModel, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback<ReAuthResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = validateReauthMFAValidateBeforeCall(type, reAuthTwoFAModel, accessToken, preventWebhook, xPreventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + Type localVarReturnType = new TypeToken<ReAuthResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for validateSecurityQuestionReauthMFA + * @param twoFAAuthBySecQuesAuthModel (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call validateSecurityQuestionReauthMFACall(TwoFAAuthBySecQuesAuthModel twoFAAuthBySecQuesAuthModel, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, 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 = twoFAAuthBySecQuesAuthModel; + + // create path and map variables + String localVarPath = "/identity/v2/auth/account/reauth/2fa/securityquestionanswer/verify"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call validateSecurityQuestionReauthMFAValidateBeforeCall(TwoFAAuthBySecQuesAuthModel twoFAAuthBySecQuesAuthModel, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'twoFAAuthBySecQuesAuthModel' is set + if (twoFAAuthBySecQuesAuthModel == null) { + throw new ApiException("Missing the required parameter 'twoFAAuthBySecQuesAuthModel' when calling validateSecurityQuestionReauthMFA(Async)"); + } + + return validateSecurityQuestionReauthMFACall(twoFAAuthBySecQuesAuthModel, accessToken, preventWebhook, xPreventWebhook, _callback); + + } + + /** + * Verify security question answer + * Validates the triggered MFA authentication flow using a security question answer. + * @param twoFAAuthBySecQuesAuthModel (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ReAuthResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public ReAuthResponse validateSecurityQuestionReauthMFA(TwoFAAuthBySecQuesAuthModel twoFAAuthBySecQuesAuthModel, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + ApiResponse<ReAuthResponse> localVarResp = validateSecurityQuestionReauthMFAWithHttpInfo(twoFAAuthBySecQuesAuthModel, accessToken, preventWebhook, xPreventWebhook); + return localVarResp.getData(); + } + + /** + * Verify security question answer + * Validates the triggered MFA authentication flow using a security question answer. + * @param twoFAAuthBySecQuesAuthModel (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<ReAuthResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<ReAuthResponse> validateSecurityQuestionReauthMFAWithHttpInfo(TwoFAAuthBySecQuesAuthModel twoFAAuthBySecQuesAuthModel, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + okhttp3.Call localVarCall = validateSecurityQuestionReauthMFAValidateBeforeCall(twoFAAuthBySecQuesAuthModel, accessToken, preventWebhook, xPreventWebhook, null); + Type localVarReturnType = new TypeToken<ReAuthResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Verify security question answer (asynchronously) + * Validates the triggered MFA authentication flow using a security question answer. + * @param twoFAAuthBySecQuesAuthModel (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call validateSecurityQuestionReauthMFAAsync(TwoFAAuthBySecQuesAuthModel twoFAAuthBySecQuesAuthModel, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback<ReAuthResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = validateSecurityQuestionReauthMFAValidateBeforeCall(twoFAAuthBySecQuesAuthModel, accessToken, preventWebhook, xPreventWebhook, _callback); + Type localVarReturnType = new TypeToken<ReAuthResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for verify2faTOTPAuth + * @param authenticatorCodeRequest (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call verify2faTOTPAuthCall(AuthenticatorCodeRequest authenticatorCodeRequest, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, 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 = authenticatorCodeRequest; + + // create path and map variables + String localVarPath = "/identity/v2/auth/account/2fa/totp"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call verify2faTOTPAuthValidateBeforeCall(AuthenticatorCodeRequest authenticatorCodeRequest, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'authenticatorCodeRequest' is set + if (authenticatorCodeRequest == null) { + throw new ApiException("Missing the required parameter 'authenticatorCodeRequest' when calling verify2faTOTPAuth(Async)"); + } + + return verify2faTOTPAuthCall(authenticatorCodeRequest, accessToken, preventWebhook, xPreventWebhook, _callback); + + } + + /** + * Verify TOTP code + * Validates an Authenticator Code as part of the MFA process. + * @param authenticatorCodeRequest (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return IdentityResponseWithSocialWithoutLogins + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public IdentityResponseWithSocialWithoutLogins verify2faTOTPAuth(AuthenticatorCodeRequest authenticatorCodeRequest, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + ApiResponse<IdentityResponseWithSocialWithoutLogins> localVarResp = verify2faTOTPAuthWithHttpInfo(authenticatorCodeRequest, accessToken, preventWebhook, xPreventWebhook); + return localVarResp.getData(); + } + + /** + * Verify TOTP code + * Validates an Authenticator Code as part of the MFA process. + * @param authenticatorCodeRequest (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<IdentityResponseWithSocialWithoutLogins> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IdentityResponseWithSocialWithoutLogins> verify2faTOTPAuthWithHttpInfo(AuthenticatorCodeRequest authenticatorCodeRequest, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + okhttp3.Call localVarCall = verify2faTOTPAuthValidateBeforeCall(authenticatorCodeRequest, accessToken, preventWebhook, xPreventWebhook, null); + Type localVarReturnType = new TypeToken<IdentityResponseWithSocialWithoutLogins>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Verify TOTP code (asynchronously) + * Validates an Authenticator Code as part of the MFA process. + * @param authenticatorCodeRequest (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call verify2faTOTPAuthAsync(AuthenticatorCodeRequest authenticatorCodeRequest, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback<IdentityResponseWithSocialWithoutLogins> _callback) throws ApiException { + + okhttp3.Call localVarCall = verify2faTOTPAuthValidateBeforeCall(authenticatorCodeRequest, accessToken, preventWebhook, xPreventWebhook, _callback); + Type localVarReturnType = new TypeToken<IdentityResponseWithSocialWithoutLogins>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for verifyBackupCodeForMFALogin + * @param secondfactorauthenticationtoken Second factor token (required) + * @param twoFAAuthByBackupCode (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call verifyBackupCodeForMFALoginCall(String secondfactorauthenticationtoken, TwoFAAuthByBackupCode twoFAAuthByBackupCode, Boolean preventWebhook, Boolean xPreventWebhook, String rbabrowseremailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, 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 = twoFAAuthByBackupCode; + + // create path and map variables + String localVarPath = "/identity/v2/auth/login/2fa/backupcode"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (secondfactorauthenticationtoken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("secondfactorauthenticationtoken", secondfactorauthenticationtoken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (rbabrowseremailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbabrowseremailtemplate", rbabrowseremailtemplate)); + } + + if (rbacityemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacityemailtemplate", rbacityemailtemplate)); + } + + if (rbacountryemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacountryemailtemplate", rbacountryemailtemplate)); + } + + if (rbaipemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaipemailtemplate", rbaipemailtemplate)); + } + + if (rbadeviceemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbadeviceemailtemplate", rbadeviceemailtemplate)); + } + + if (rbabrowsersmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbabrowsersmstemplate", rbabrowsersmstemplate)); + } + + if (rbacitysmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacitysmstemplate", rbacitysmstemplate)); + } + + if (rbacountrysmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacountrysmstemplate", rbacountrysmstemplate)); + } + + if (rbaipsmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaipsmstemplate", rbaipsmstemplate)); + } + + if (rbadevicesmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbadevicesmstemplate", rbadevicesmstemplate)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call verifyBackupCodeForMFALoginValidateBeforeCall(String secondfactorauthenticationtoken, TwoFAAuthByBackupCode twoFAAuthByBackupCode, Boolean preventWebhook, Boolean xPreventWebhook, String rbabrowseremailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'secondfactorauthenticationtoken' is set + if (secondfactorauthenticationtoken == null) { + throw new ApiException("Missing the required parameter 'secondfactorauthenticationtoken' when calling verifyBackupCodeForMFALogin(Async)"); + } + + // verify the required parameter 'twoFAAuthByBackupCode' is set + if (twoFAAuthByBackupCode == null) { + throw new ApiException("Missing the required parameter 'twoFAAuthByBackupCode' when calling verifyBackupCodeForMFALogin(Async)"); + } + + return verifyBackupCodeForMFALoginCall(secondfactorauthenticationtoken, twoFAAuthByBackupCode, preventWebhook, xPreventWebhook, rbabrowseremailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, _callback); + + } + + /** + * Verify Backup Code with MFA Token + * Verifies a User's MFA backup code as a second factor during the login process, typically used when the primary MFA method is unavailable. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param twoFAAuthByBackupCode (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @return AuthResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public AuthResponse verifyBackupCodeForMFALogin(String secondfactorauthenticationtoken, TwoFAAuthByBackupCode twoFAAuthByBackupCode, Boolean preventWebhook, Boolean xPreventWebhook, String rbabrowseremailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate) throws ApiException { + ApiResponse<AuthResponse> localVarResp = verifyBackupCodeForMFALoginWithHttpInfo(secondfactorauthenticationtoken, twoFAAuthByBackupCode, preventWebhook, xPreventWebhook, rbabrowseremailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate); + return localVarResp.getData(); + } + + /** + * Verify Backup Code with MFA Token + * Verifies a User's MFA backup code as a second factor during the login process, typically used when the primary MFA method is unavailable. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param twoFAAuthByBackupCode (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @return ApiResponse<AuthResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public ApiResponse<AuthResponse> verifyBackupCodeForMFALoginWithHttpInfo(String secondfactorauthenticationtoken, TwoFAAuthByBackupCode twoFAAuthByBackupCode, Boolean preventWebhook, Boolean xPreventWebhook, String rbabrowseremailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate) throws ApiException { + okhttp3.Call localVarCall = verifyBackupCodeForMFALoginValidateBeforeCall(secondfactorauthenticationtoken, twoFAAuthByBackupCode, preventWebhook, xPreventWebhook, rbabrowseremailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, null); + Type localVarReturnType = new TypeToken<AuthResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Verify Backup Code with MFA Token (asynchronously) + * Verifies a User's MFA backup code as a second factor during the login process, typically used when the primary MFA method is unavailable. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param twoFAAuthByBackupCode (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call verifyBackupCodeForMFALoginAsync(String secondfactorauthenticationtoken, TwoFAAuthByBackupCode twoFAAuthByBackupCode, Boolean preventWebhook, Boolean xPreventWebhook, String rbabrowseremailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, final ApiCallback<AuthResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = verifyBackupCodeForMFALoginValidateBeforeCall(secondfactorauthenticationtoken, twoFAAuthByBackupCode, preventWebhook, xPreventWebhook, rbabrowseremailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, _callback); + Type localVarReturnType = new TypeToken<AuthResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for verifyTotpByMfaToken + * @param secondfactorauthenticationtoken Second factor token (required) + * @param authenticatorCodeRequest (required) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successful MFA login or MFA challenge required </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call verifyTotpByMfaTokenCall(String secondfactorauthenticationtoken, AuthenticatorCodeRequest authenticatorCodeRequest, String fields, String rbabrowseremailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, Boolean preventWebhook, Boolean xPreventWebhook, 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 = authenticatorCodeRequest; + + // create path and map variables + String localVarPath = "/identity/v2/auth/login/2fa/totp"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (secondfactorauthenticationtoken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("secondfactorauthenticationtoken", secondfactorauthenticationtoken)); + } + + if (fields != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fields", fields)); + } + + if (rbabrowseremailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbabrowseremailtemplate", rbabrowseremailtemplate)); + } + + if (rbacityemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacityemailtemplate", rbacityemailtemplate)); + } + + if (rbacountryemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacountryemailtemplate", rbacountryemailtemplate)); + } + + if (rbaipemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaipemailtemplate", rbaipemailtemplate)); + } + + if (rbadeviceemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbadeviceemailtemplate", rbadeviceemailtemplate)); + } + + if (rbabrowsersmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbabrowsersmstemplate", rbabrowsersmstemplate)); + } + + if (rbacitysmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacitysmstemplate", rbacitysmstemplate)); + } + + if (rbacountrysmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbacountrysmstemplate", rbacountrysmstemplate)); + } + + if (rbaipsmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbaipsmstemplate", rbaipsmstemplate)); + } + + if (rbadevicesmstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("rbadevicesmstemplate", rbadevicesmstemplate)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call verifyTotpByMfaTokenValidateBeforeCall(String secondfactorauthenticationtoken, AuthenticatorCodeRequest authenticatorCodeRequest, String fields, String rbabrowseremailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'secondfactorauthenticationtoken' is set + if (secondfactorauthenticationtoken == null) { + throw new ApiException("Missing the required parameter 'secondfactorauthenticationtoken' when calling verifyTotpByMfaToken(Async)"); + } + + // verify the required parameter 'authenticatorCodeRequest' is set + if (authenticatorCodeRequest == null) { + throw new ApiException("Missing the required parameter 'authenticatorCodeRequest' when calling verifyTotpByMfaToken(Async)"); + } + + return verifyTotpByMfaTokenCall(secondfactorauthenticationtoken, authenticatorCodeRequest, fields, rbabrowseremailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, preventWebhook, xPreventWebhook, _callback); + + } + + /** + * Verify TOTP Code with MFA Token + * Validates the TOTP Authenticator code provided by the User as part of the Multi-Factor Authentication login process. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param authenticatorCodeRequest (required) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return AuthResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successful MFA login or MFA challenge required </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public AuthResponse verifyTotpByMfaToken(String secondfactorauthenticationtoken, AuthenticatorCodeRequest authenticatorCodeRequest, String fields, String rbabrowseremailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + ApiResponse<AuthResponse> localVarResp = verifyTotpByMfaTokenWithHttpInfo(secondfactorauthenticationtoken, authenticatorCodeRequest, fields, rbabrowseremailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, preventWebhook, xPreventWebhook); + return localVarResp.getData(); + } + + /** + * Verify TOTP Code with MFA Token + * Validates the TOTP Authenticator code provided by the User as part of the Multi-Factor Authentication login process. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param authenticatorCodeRequest (required) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<AuthResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successful MFA login or MFA challenge required </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public ApiResponse<AuthResponse> verifyTotpByMfaTokenWithHttpInfo(String secondfactorauthenticationtoken, AuthenticatorCodeRequest authenticatorCodeRequest, String fields, String rbabrowseremailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + okhttp3.Call localVarCall = verifyTotpByMfaTokenValidateBeforeCall(secondfactorauthenticationtoken, authenticatorCodeRequest, fields, rbabrowseremailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, preventWebhook, xPreventWebhook, null); + Type localVarReturnType = new TypeToken<AuthResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Verify TOTP Code with MFA Token (asynchronously) + * Validates the TOTP Authenticator code provided by the User as part of the Multi-Factor Authentication login process. + * @param secondfactorauthenticationtoken Second factor token (required) + * @param authenticatorCodeRequest (required) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param rbabrowseremailtemplate RBA browser Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with browser option is enabled for the Tenant. (optional) + * @param rbacityemailtemplate RBA city Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with city option is enabled for the Tenant. (optional) + * @param rbacountryemailtemplate RBA country Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with country option is enabled for the Tenant. (optional) + * @param rbaipemailtemplate RBA IP Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with IP option is enabled for the Tenant. (optional) + * @param rbadeviceemailtemplate RBA device Email template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when RBA with device option is enabled for the Tenant. (optional) + * @param rbabrowsersmstemplate RBA browser SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacitysmstemplate RBA city SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbacountrysmstemplate RBA country SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbaipsmstemplate RBA IP SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param rbadevicesmstemplate RBA device SMS template name which will be sent to the User when any risk is detected while logging in to the Tenant. It will only be used when a User has logged in via Phone. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successful MFA login or MFA challenge required </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - an unexpected error occurred on the server. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call verifyTotpByMfaTokenAsync(String secondfactorauthenticationtoken, AuthenticatorCodeRequest authenticatorCodeRequest, String fields, String rbabrowseremailtemplate, String rbacityemailtemplate, String rbacountryemailtemplate, String rbaipemailtemplate, String rbadeviceemailtemplate, String rbabrowsersmstemplate, String rbacitysmstemplate, String rbacountrysmstemplate, String rbaipsmstemplate, String rbadevicesmstemplate, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback<AuthResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = verifyTotpByMfaTokenValidateBeforeCall(secondfactorauthenticationtoken, authenticatorCodeRequest, fields, rbabrowseremailtemplate, rbacityemailtemplate, rbacountryemailtemplate, rbaipemailtemplate, rbadeviceemailtemplate, rbabrowsersmstemplate, rbacitysmstemplate, rbacountrysmstemplate, rbaipsmstemplate, rbadevicesmstemplate, preventWebhook, xPreventWebhook, _callback); + Type localVarReturnType = new TypeToken<AuthResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/SecurityQuestionsApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/SecurityQuestionsApi.java new file mode 100644 index 0000000..0bdf116 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/SecurityQuestionsApi.java @@ -0,0 +1,916 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.DeleteResponse; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.GetSecurityQuestions200Response; +import com.loginradius.sdk.internal.openapi.model.SecurityQuestion; +import com.loginradius.sdk.internal.openapi.model.SecurityQuestionInput; +import com.loginradius.sdk.internal.openapi.model.SecurityQuestionsRender; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SecurityQuestionsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public SecurityQuestionsApi() { + this(Configuration.getDefaultApiClient()); + } + + public SecurityQuestionsApi(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 addSecurityQuestion + * @param securityQuestionInput (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call addSecurityQuestionCall(SecurityQuestionInput securityQuestionInput, 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 = securityQuestionInput; + + // create path and map variables + String localVarPath = "/v2/manage/security-questions"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call addSecurityQuestionValidateBeforeCall(SecurityQuestionInput securityQuestionInput, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'securityQuestionInput' is set + if (securityQuestionInput == null) { + throw new ApiException("Missing the required parameter 'securityQuestionInput' when calling addSecurityQuestion(Async)"); + } + + return addSecurityQuestionCall(securityQuestionInput, _callback); + + } + + /** + * Add security question + * Adds a new security question to the Tenant's configuration. + * @param securityQuestionInput (required) + * @return SecurityQuestion + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public SecurityQuestion addSecurityQuestion(SecurityQuestionInput securityQuestionInput) throws ApiException { + ApiResponse<SecurityQuestion> localVarResp = addSecurityQuestionWithHttpInfo(securityQuestionInput); + return localVarResp.getData(); + } + + /** + * Add security question + * Adds a new security question to the Tenant's configuration. + * @param securityQuestionInput (required) + * @return ApiResponse<SecurityQuestion> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SecurityQuestion> addSecurityQuestionWithHttpInfo(SecurityQuestionInput securityQuestionInput) throws ApiException { + okhttp3.Call localVarCall = addSecurityQuestionValidateBeforeCall(securityQuestionInput, null); + Type localVarReturnType = new TypeToken<SecurityQuestion>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Add security question (asynchronously) + * Adds a new security question to the Tenant's configuration. + * @param securityQuestionInput (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call addSecurityQuestionAsync(SecurityQuestionInput securityQuestionInput, final ApiCallback<SecurityQuestion> _callback) throws ApiException { + + okhttp3.Call localVarCall = addSecurityQuestionValidateBeforeCall(securityQuestionInput, _callback); + Type localVarReturnType = new TypeToken<SecurityQuestion>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteSecurityQuestion + * @param securityQuestionID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Deletion status </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteSecurityQuestionCall(String securityQuestionID, 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 = "/v2/manage/security-questions/{securityQuestionID}" + .replace("{" + "securityQuestionID" + "}", localVarApiClient.escapeString(securityQuestionID.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteSecurityQuestionValidateBeforeCall(String securityQuestionID, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'securityQuestionID' is set + if (securityQuestionID == null) { + throw new ApiException("Missing the required parameter 'securityQuestionID' when calling deleteSecurityQuestion(Async)"); + } + + return deleteSecurityQuestionCall(securityQuestionID, _callback); + + } + + /** + * Delete security question + * Deletes a security question by its ID. + * @param securityQuestionID (required) + * @return DeleteResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Deletion status </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public DeleteResponse deleteSecurityQuestion(String securityQuestionID) throws ApiException { + ApiResponse<DeleteResponse> localVarResp = deleteSecurityQuestionWithHttpInfo(securityQuestionID); + return localVarResp.getData(); + } + + /** + * Delete security question + * Deletes a security question by its ID. + * @param securityQuestionID (required) + * @return ApiResponse<DeleteResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Deletion status </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DeleteResponse> deleteSecurityQuestionWithHttpInfo(String securityQuestionID) throws ApiException { + okhttp3.Call localVarCall = deleteSecurityQuestionValidateBeforeCall(securityQuestionID, null); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete security question (asynchronously) + * Deletes a security question by its ID. + * @param securityQuestionID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Deletion status </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteSecurityQuestionAsync(String securityQuestionID, final ApiCallback<DeleteResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteSecurityQuestionValidateBeforeCall(securityQuestionID, _callback); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getSecurityQuestionRenderCount + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getSecurityQuestionRenderCountCall(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 = "/v2/manage/security-questions/count"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSecurityQuestionRenderCountValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getSecurityQuestionRenderCountCall(_callback); + + } + + /** + * Retrieve security question count + * Retrieves the number of security questions to render for a User. + * @return SecurityQuestionsRender + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public SecurityQuestionsRender getSecurityQuestionRenderCount() throws ApiException { + ApiResponse<SecurityQuestionsRender> localVarResp = getSecurityQuestionRenderCountWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Retrieve security question count + * Retrieves the number of security questions to render for a User. + * @return ApiResponse<SecurityQuestionsRender> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SecurityQuestionsRender> getSecurityQuestionRenderCountWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getSecurityQuestionRenderCountValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<SecurityQuestionsRender>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve security question count (asynchronously) + * Retrieves the number of security questions to render for a User. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getSecurityQuestionRenderCountAsync(final ApiCallback<SecurityQuestionsRender> _callback) throws ApiException { + + okhttp3.Call localVarCall = getSecurityQuestionRenderCountValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<SecurityQuestionsRender>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getSecurityQuestions + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getSecurityQuestionsCall(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 = "/v2/manage/security-questions"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSecurityQuestionsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getSecurityQuestionsCall(_callback); + + } + + /** + * Retrieve security questions + * Retrieves a list of all available security questions for the Tenant. + * @return GetSecurityQuestions200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public GetSecurityQuestions200Response getSecurityQuestions() throws ApiException { + ApiResponse<GetSecurityQuestions200Response> localVarResp = getSecurityQuestionsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Retrieve security questions + * Retrieves a list of all available security questions for the Tenant. + * @return ApiResponse<GetSecurityQuestions200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetSecurityQuestions200Response> getSecurityQuestionsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getSecurityQuestionsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<GetSecurityQuestions200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve security questions (asynchronously) + * Retrieves a list of all available security questions for the Tenant. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getSecurityQuestionsAsync(final ApiCallback<GetSecurityQuestions200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getSecurityQuestionsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<GetSecurityQuestions200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateSecurityQuestion + * @param securityQuestionID (required) + * @param securityQuestionInput (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateSecurityQuestionCall(String securityQuestionID, SecurityQuestionInput securityQuestionInput, 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 = securityQuestionInput; + + // create path and map variables + String localVarPath = "/v2/manage/security-questions/{securityQuestionID}" + .replace("{" + "securityQuestionID" + "}", localVarApiClient.escapeString(securityQuestionID.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateSecurityQuestionValidateBeforeCall(String securityQuestionID, SecurityQuestionInput securityQuestionInput, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'securityQuestionID' is set + if (securityQuestionID == null) { + throw new ApiException("Missing the required parameter 'securityQuestionID' when calling updateSecurityQuestion(Async)"); + } + + // verify the required parameter 'securityQuestionInput' is set + if (securityQuestionInput == null) { + throw new ApiException("Missing the required parameter 'securityQuestionInput' when calling updateSecurityQuestion(Async)"); + } + + return updateSecurityQuestionCall(securityQuestionID, securityQuestionInput, _callback); + + } + + /** + * Update security question + * Updates an existing security question by its ID. + * @param securityQuestionID (required) + * @param securityQuestionInput (required) + * @return SecurityQuestion + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public SecurityQuestion updateSecurityQuestion(String securityQuestionID, SecurityQuestionInput securityQuestionInput) throws ApiException { + ApiResponse<SecurityQuestion> localVarResp = updateSecurityQuestionWithHttpInfo(securityQuestionID, securityQuestionInput); + return localVarResp.getData(); + } + + /** + * Update security question + * Updates an existing security question by its ID. + * @param securityQuestionID (required) + * @param securityQuestionInput (required) + * @return ApiResponse<SecurityQuestion> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SecurityQuestion> updateSecurityQuestionWithHttpInfo(String securityQuestionID, SecurityQuestionInput securityQuestionInput) throws ApiException { + okhttp3.Call localVarCall = updateSecurityQuestionValidateBeforeCall(securityQuestionID, securityQuestionInput, null); + Type localVarReturnType = new TypeToken<SecurityQuestion>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update security question (asynchronously) + * Updates an existing security question by its ID. + * @param securityQuestionID (required) + * @param securityQuestionInput (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateSecurityQuestionAsync(String securityQuestionID, SecurityQuestionInput securityQuestionInput, final ApiCallback<SecurityQuestion> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateSecurityQuestionValidateBeforeCall(securityQuestionID, securityQuestionInput, _callback); + Type localVarReturnType = new TypeToken<SecurityQuestion>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateSecurityQuestionRenderCount + * @param securityQuestionsRender (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateSecurityQuestionRenderCountCall(SecurityQuestionsRender securityQuestionsRender, 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 = securityQuestionsRender; + + // create path and map variables + String localVarPath = "/v2/manage/security-questions/count"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateSecurityQuestionRenderCountValidateBeforeCall(SecurityQuestionsRender securityQuestionsRender, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'securityQuestionsRender' is set + if (securityQuestionsRender == null) { + throw new ApiException("Missing the required parameter 'securityQuestionsRender' when calling updateSecurityQuestionRenderCount(Async)"); + } + + return updateSecurityQuestionRenderCountCall(securityQuestionsRender, _callback); + + } + + /** + * Update security question count + * Updates the number of security questions to render for a User. + * @param securityQuestionsRender (required) + * @return SecurityQuestionsRender + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public SecurityQuestionsRender updateSecurityQuestionRenderCount(SecurityQuestionsRender securityQuestionsRender) throws ApiException { + ApiResponse<SecurityQuestionsRender> localVarResp = updateSecurityQuestionRenderCountWithHttpInfo(securityQuestionsRender); + return localVarResp.getData(); + } + + /** + * Update security question count + * Updates the number of security questions to render for a User. + * @param securityQuestionsRender (required) + * @return ApiResponse<SecurityQuestionsRender> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SecurityQuestionsRender> updateSecurityQuestionRenderCountWithHttpInfo(SecurityQuestionsRender securityQuestionsRender) throws ApiException { + okhttp3.Call localVarCall = updateSecurityQuestionRenderCountValidateBeforeCall(securityQuestionsRender, null); + Type localVarReturnType = new TypeToken<SecurityQuestionsRender>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update security question count (asynchronously) + * Updates the number of security questions to render for a User. + * @param securityQuestionsRender (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateSecurityQuestionRenderCountAsync(SecurityQuestionsRender securityQuestionsRender, final ApiCallback<SecurityQuestionsRender> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateSecurityQuestionRenderCountValidateBeforeCall(securityQuestionsRender, _callback); + Type localVarReturnType = new TypeToken<SecurityQuestionsRender>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/SessionApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/SessionApi.java new file mode 100644 index 0000000..e09c30f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/SessionApi.java @@ -0,0 +1,469 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.AccessTokenInfo; +import com.loginradius.sdk.internal.openapi.model.AccessTokenResponse; +import com.loginradius.sdk.internal.openapi.model.ApiError; +import com.loginradius.sdk.internal.openapi.model.IsPostedResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SessionApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public SessionApi() { + this(Configuration.getDefaultApiClient()); + } + + public SessionApi(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 authValidateAccessToken + * @param accessToken Access Token of the User (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: Invalid request parameters </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: Access denied </td><td> - </td></tr> + </table> + */ + public okhttp3.Call authValidateAccessTokenCall(String accessToken, 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 = "/identity/v2/auth/access_token/validate"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + 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[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call authValidateAccessTokenValidateBeforeCall(String accessToken, final ApiCallback _callback) throws ApiException { + return authValidateAccessTokenCall(accessToken, _callback); + + } + + /** + * Validate Access Token + * Validates an Access Token, returning its expiry if valid, or an error if invalid. + * @param accessToken Access Token of the User (optional) + * @return AccessTokenResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: Invalid request parameters </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: Access denied </td><td> - </td></tr> + </table> + */ + public AccessTokenResponse authValidateAccessToken(String accessToken) throws ApiException { + ApiResponse<AccessTokenResponse> localVarResp = authValidateAccessTokenWithHttpInfo(accessToken); + return localVarResp.getData(); + } + + /** + * Validate Access Token + * Validates an Access Token, returning its expiry if valid, or an error if invalid. + * @param accessToken Access Token of the User (optional) + * @return ApiResponse<AccessTokenResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: Invalid request parameters </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: Access denied </td><td> - </td></tr> + </table> + */ + public ApiResponse<AccessTokenResponse> authValidateAccessTokenWithHttpInfo(String accessToken) throws ApiException { + okhttp3.Call localVarCall = authValidateAccessTokenValidateBeforeCall(accessToken, null); + Type localVarReturnType = new TypeToken<AccessTokenResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Validate Access Token (asynchronously) + * Validates an Access Token, returning its expiry if valid, or an error if invalid. + * @param accessToken Access Token of the User (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: Invalid request parameters </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: Access denied </td><td> - </td></tr> + </table> + */ + public okhttp3.Call authValidateAccessTokenAsync(String accessToken, final ApiCallback<AccessTokenResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = authValidateAccessTokenValidateBeforeCall(accessToken, _callback); + Type localVarReturnType = new TypeToken<AccessTokenResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAccessTokenInfo + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: Invalid request parameters </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: Access denied </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAccessTokenInfoCall(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 = "/identity/v2/auth/access_token"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAccessTokenInfoValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getAccessTokenInfoCall(_callback); + + } + + /** + * Retrieve Access Token information + * Obtains detailed information about the provided Access Token. + * @return AccessTokenInfo + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: Invalid request parameters </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: Access denied </td><td> - </td></tr> + </table> + */ + public AccessTokenInfo getAccessTokenInfo() throws ApiException { + ApiResponse<AccessTokenInfo> localVarResp = getAccessTokenInfoWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Retrieve Access Token information + * Obtains detailed information about the provided Access Token. + * @return ApiResponse<AccessTokenInfo> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: Invalid request parameters </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: Access denied </td><td> - </td></tr> + </table> + */ + public ApiResponse<AccessTokenInfo> getAccessTokenInfoWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getAccessTokenInfoValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<AccessTokenInfo>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Access Token information (asynchronously) + * Obtains detailed information about the provided Access Token. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: Invalid request parameters </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: Access denied </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAccessTokenInfoAsync(final ApiCallback<AccessTokenInfo> _callback) throws ApiException { + + okhttp3.Call localVarCall = getAccessTokenInfoValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<AccessTokenInfo>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for invalidateAccessToken + * @param preventRefresh Whether to prevent the token from being refreshed (true/false). (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Access Token invalidation request successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request. The request was invalid or malformed. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden. The request was valid, but the User does not have the necessary permissions. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call invalidateAccessTokenCall(Boolean preventRefresh, 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 = "/identity/v2/auth/access_token/invalidate"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (preventRefresh != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("preventRefresh", preventRefresh)); + } + + 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[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call invalidateAccessTokenValidateBeforeCall(Boolean preventRefresh, final ApiCallback _callback) throws ApiException { + return invalidateAccessTokenCall(preventRefresh, _callback); + + } + + /** + * Invalidate Access Token + * Invalidates an active Access Token, expiring its validity. + * @param preventRefresh Whether to prevent the token from being refreshed (true/false). (optional) + * @return IsPostedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Access Token invalidation request successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request. The request was invalid or malformed. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden. The request was valid, but the User does not have the necessary permissions. </td><td> - </td></tr> + </table> + */ + public IsPostedResponse invalidateAccessToken(Boolean preventRefresh) throws ApiException { + ApiResponse<IsPostedResponse> localVarResp = invalidateAccessTokenWithHttpInfo(preventRefresh); + return localVarResp.getData(); + } + + /** + * Invalidate Access Token + * Invalidates an active Access Token, expiring its validity. + * @param preventRefresh Whether to prevent the token from being refreshed (true/false). (optional) + * @return ApiResponse<IsPostedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Access Token invalidation request successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request. The request was invalid or malformed. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden. The request was valid, but the User does not have the necessary permissions. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedResponse> invalidateAccessTokenWithHttpInfo(Boolean preventRefresh) throws ApiException { + okhttp3.Call localVarCall = invalidateAccessTokenValidateBeforeCall(preventRefresh, null); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Invalidate Access Token (asynchronously) + * Invalidates an active Access Token, expiring its validity. + * @param preventRefresh Whether to prevent the token from being refreshed (true/false). (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Access Token invalidation request successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request. The request was invalid or malformed. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden. The request was valid, but the User does not have the necessary permissions. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call invalidateAccessTokenAsync(Boolean preventRefresh, final ApiCallback<IsPostedResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = invalidateAccessTokenValidateBeforeCall(preventRefresh, _callback); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/ShopifySsoApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/ShopifySsoApi.java new file mode 100644 index 0000000..4695675 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/ShopifySsoApi.java @@ -0,0 +1,239 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.ShopifyLoginUrlResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class ShopifySsoApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public ShopifySsoApi() { + this(Configuration.getDefaultApiClient()); + } + + public ShopifySsoApi(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 getShopifyLoginUrl + * @param accessToken Access Token of the User (required) + * @param store Shopify store domain (e.g., mystore.myshopify.com) (required) + * @param returnUrl URL to redirect the user to after login (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: Shopify Multipass login URL generated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The API key or access token is missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The request is not allowed. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getShopifyLoginUrlCall(String accessToken, String store, String returnUrl, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://{domain}.hub.loginradius.com" }; + + // 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 = "/sso/shopify/api/token"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (store != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("store", store)); + } + + if (returnUrl != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("return_url", returnUrl)); + } + + 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[] { "APIKey", "XLoginRadiusAPIKey" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getShopifyLoginUrlValidateBeforeCall(String accessToken, String store, String returnUrl, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'accessToken' is set + if (accessToken == null) { + throw new ApiException("Missing the required parameter 'accessToken' when calling getShopifyLoginUrl(Async)"); + } + + // verify the required parameter 'store' is set + if (store == null) { + throw new ApiException("Missing the required parameter 'store' when calling getShopifyLoginUrl(Async)"); + } + + return getShopifyLoginUrlCall(accessToken, store, returnUrl, _callback); + + } + + /** + * Generate Shopify Multipass Login URL + * Generates a Shopify Multipass login URL using the provided LoginRadius access token. Uses Shopify's Multipass feature to create a single sign-on URL that authenticates the user into the Shopify store. + * @param accessToken Access Token of the User (required) + * @param store Shopify store domain (e.g., mystore.myshopify.com) (required) + * @param returnUrl URL to redirect the user to after login (optional) + * @return ShopifyLoginUrlResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: Shopify Multipass login URL generated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The API key or access token is missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The request is not allowed. </td><td> - </td></tr> + </table> + */ + public ShopifyLoginUrlResponse getShopifyLoginUrl(String accessToken, String store, String returnUrl) throws ApiException { + ApiResponse<ShopifyLoginUrlResponse> localVarResp = getShopifyLoginUrlWithHttpInfo(accessToken, store, returnUrl); + return localVarResp.getData(); + } + + /** + * Generate Shopify Multipass Login URL + * Generates a Shopify Multipass login URL using the provided LoginRadius access token. Uses Shopify's Multipass feature to create a single sign-on URL that authenticates the user into the Shopify store. + * @param accessToken Access Token of the User (required) + * @param store Shopify store domain (e.g., mystore.myshopify.com) (required) + * @param returnUrl URL to redirect the user to after login (optional) + * @return ApiResponse<ShopifyLoginUrlResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: Shopify Multipass login URL generated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The API key or access token is missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The request is not allowed. </td><td> - </td></tr> + </table> + */ + public ApiResponse<ShopifyLoginUrlResponse> getShopifyLoginUrlWithHttpInfo(String accessToken, String store, String returnUrl) throws ApiException { + okhttp3.Call localVarCall = getShopifyLoginUrlValidateBeforeCall(accessToken, store, returnUrl, null); + Type localVarReturnType = new TypeToken<ShopifyLoginUrlResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Generate Shopify Multipass Login URL (asynchronously) + * Generates a Shopify Multipass login URL using the provided LoginRadius access token. Uses Shopify's Multipass feature to create a single sign-on URL that authenticates the user into the Shopify store. + * @param accessToken Access Token of the User (required) + * @param store Shopify store domain (e.g., mystore.myshopify.com) (required) + * @param returnUrl URL to redirect the user to after login (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: Shopify Multipass login URL generated successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The API key or access token is missing or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The request is not allowed. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getShopifyLoginUrlAsync(String accessToken, String store, String returnUrl, final ApiCallback<ShopifyLoginUrlResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getShopifyLoginUrlValidateBeforeCall(accessToken, store, returnUrl, _callback); + Type localVarReturnType = new TypeToken<ShopifyLoginUrlResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/SmsTemplatesApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/SmsTemplatesApi.java new file mode 100644 index 0000000..d0f0d5f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/SmsTemplatesApi.java @@ -0,0 +1,654 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.DeleteResponse; +import com.loginradius.sdk.internal.openapi.model.DeleteSmsTemplateModel; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.GetSmsTemplates200Response; +import com.loginradius.sdk.internal.openapi.model.SmsTemplate; +import com.loginradius.sdk.internal.openapi.model.UpdateSmsTemplateModel; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SmsTemplatesApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public SmsTemplatesApi() { + this(Configuration.getDefaultApiClient()); + } + + public SmsTemplatesApi(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 createSmsTemplate + * @param smsTemplate (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden due to invalid request body or SMS configuration details. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createSmsTemplateCall(SmsTemplate smsTemplate, 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 = smsTemplate; + + // create path and map variables + String localVarPath = "/v2/manage/smstemplates"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createSmsTemplateValidateBeforeCall(SmsTemplate smsTemplate, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'smsTemplate' is set + if (smsTemplate == null) { + throw new ApiException("Missing the required parameter 'smsTemplate' when calling createSmsTemplate(Async)"); + } + + return createSmsTemplateCall(smsTemplate, _callback); + + } + + /** + * Create SMS template + * Creates a new SMS template for a specified customer and Tenant. + * @param smsTemplate (required) + * @return SmsTemplate + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden due to invalid request body or SMS configuration details. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public SmsTemplate createSmsTemplate(SmsTemplate smsTemplate) throws ApiException { + ApiResponse<SmsTemplate> localVarResp = createSmsTemplateWithHttpInfo(smsTemplate); + return localVarResp.getData(); + } + + /** + * Create SMS template + * Creates a new SMS template for a specified customer and Tenant. + * @param smsTemplate (required) + * @return ApiResponse<SmsTemplate> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden due to invalid request body or SMS configuration details. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SmsTemplate> createSmsTemplateWithHttpInfo(SmsTemplate smsTemplate) throws ApiException { + okhttp3.Call localVarCall = createSmsTemplateValidateBeforeCall(smsTemplate, null); + Type localVarReturnType = new TypeToken<SmsTemplate>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create SMS template (asynchronously) + * Creates a new SMS template for a specified customer and Tenant. + * @param smsTemplate (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden due to invalid request body or SMS configuration details. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createSmsTemplateAsync(SmsTemplate smsTemplate, final ApiCallback<SmsTemplate> _callback) throws ApiException { + + okhttp3.Call localVarCall = createSmsTemplateValidateBeforeCall(smsTemplate, _callback); + Type localVarReturnType = new TypeToken<SmsTemplate>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteSmsTemplate + * @param templateType The type of SMS template to delete. (required) + * @param deleteSmsTemplateModel (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden due to invalid request body or SMS configuration details. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteSmsTemplateCall(String templateType, DeleteSmsTemplateModel deleteSmsTemplateModel, 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 = deleteSmsTemplateModel; + + // create path and map variables + String localVarPath = "/v2/manage/sms-templates/{templateType}" + .replace("{" + "templateType" + "}", localVarApiClient.escapeString(templateType.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteSmsTemplateValidateBeforeCall(String templateType, DeleteSmsTemplateModel deleteSmsTemplateModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'templateType' is set + if (templateType == null) { + throw new ApiException("Missing the required parameter 'templateType' when calling deleteSmsTemplate(Async)"); + } + + // verify the required parameter 'deleteSmsTemplateModel' is set + if (deleteSmsTemplateModel == null) { + throw new ApiException("Missing the required parameter 'deleteSmsTemplateModel' when calling deleteSmsTemplate(Async)"); + } + + return deleteSmsTemplateCall(templateType, deleteSmsTemplateModel, _callback); + + } + + /** + * Delete SMS template + * Deletes an SMS template by its type for a specified customer and Tenant. + * @param templateType The type of SMS template to delete. (required) + * @param deleteSmsTemplateModel (required) + * @return DeleteResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden due to invalid request body or SMS configuration details. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public DeleteResponse deleteSmsTemplate(String templateType, DeleteSmsTemplateModel deleteSmsTemplateModel) throws ApiException { + ApiResponse<DeleteResponse> localVarResp = deleteSmsTemplateWithHttpInfo(templateType, deleteSmsTemplateModel); + return localVarResp.getData(); + } + + /** + * Delete SMS template + * Deletes an SMS template by its type for a specified customer and Tenant. + * @param templateType The type of SMS template to delete. (required) + * @param deleteSmsTemplateModel (required) + * @return ApiResponse<DeleteResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden due to invalid request body or SMS configuration details. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DeleteResponse> deleteSmsTemplateWithHttpInfo(String templateType, DeleteSmsTemplateModel deleteSmsTemplateModel) throws ApiException { + okhttp3.Call localVarCall = deleteSmsTemplateValidateBeforeCall(templateType, deleteSmsTemplateModel, null); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete SMS template (asynchronously) + * Deletes an SMS template by its type for a specified customer and Tenant. + * @param templateType The type of SMS template to delete. (required) + * @param deleteSmsTemplateModel (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden due to invalid request body or SMS configuration details. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteSmsTemplateAsync(String templateType, DeleteSmsTemplateModel deleteSmsTemplateModel, final ApiCallback<DeleteResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteSmsTemplateValidateBeforeCall(templateType, deleteSmsTemplateModel, _callback); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getSmsTemplates + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getSmsTemplatesCall(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 = "/v2/manage/smstemplates"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSmsTemplatesValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getSmsTemplatesCall(_callback); + + } + + /** + * List SMS templates + * Retrieves a list of SMS templates for a specified customer and Tenant. + * @return GetSmsTemplates200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public GetSmsTemplates200Response getSmsTemplates() throws ApiException { + ApiResponse<GetSmsTemplates200Response> localVarResp = getSmsTemplatesWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List SMS templates + * Retrieves a list of SMS templates for a specified customer and Tenant. + * @return ApiResponse<GetSmsTemplates200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetSmsTemplates200Response> getSmsTemplatesWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getSmsTemplatesValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<GetSmsTemplates200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List SMS templates (asynchronously) + * Retrieves a list of SMS templates for a specified customer and Tenant. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getSmsTemplatesAsync(final ApiCallback<GetSmsTemplates200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getSmsTemplatesValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<GetSmsTemplates200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateSmsTemplate + * @param templateType The type of SMS template to delete. (required) + * @param updateSmsTemplateModel (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateSmsTemplateCall(String templateType, UpdateSmsTemplateModel updateSmsTemplateModel, 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 = updateSmsTemplateModel; + + // create path and map variables + String localVarPath = "/v2/manage/sms-templates/{templateType}" + .replace("{" + "templateType" + "}", localVarApiClient.escapeString(templateType.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateSmsTemplateValidateBeforeCall(String templateType, UpdateSmsTemplateModel updateSmsTemplateModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'templateType' is set + if (templateType == null) { + throw new ApiException("Missing the required parameter 'templateType' when calling updateSmsTemplate(Async)"); + } + + // verify the required parameter 'updateSmsTemplateModel' is set + if (updateSmsTemplateModel == null) { + throw new ApiException("Missing the required parameter 'updateSmsTemplateModel' when calling updateSmsTemplate(Async)"); + } + + return updateSmsTemplateCall(templateType, updateSmsTemplateModel, _callback); + + } + + /** + * Update SMS template + * Updates an existing SMS template by its type for a specified customer and Tenant. + * @param templateType The type of SMS template to delete. (required) + * @param updateSmsTemplateModel (required) + * @return SmsTemplate + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public SmsTemplate updateSmsTemplate(String templateType, UpdateSmsTemplateModel updateSmsTemplateModel) throws ApiException { + ApiResponse<SmsTemplate> localVarResp = updateSmsTemplateWithHttpInfo(templateType, updateSmsTemplateModel); + return localVarResp.getData(); + } + + /** + * Update SMS template + * Updates an existing SMS template by its type for a specified customer and Tenant. + * @param templateType The type of SMS template to delete. (required) + * @param updateSmsTemplateModel (required) + * @return ApiResponse<SmsTemplate> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SmsTemplate> updateSmsTemplateWithHttpInfo(String templateType, UpdateSmsTemplateModel updateSmsTemplateModel) throws ApiException { + okhttp3.Call localVarCall = updateSmsTemplateValidateBeforeCall(templateType, updateSmsTemplateModel, null); + Type localVarReturnType = new TypeToken<SmsTemplate>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update SMS template (asynchronously) + * Updates an existing SMS template by its type for a specified customer and Tenant. + * @param templateType The type of SMS template to delete. (required) + * @param updateSmsTemplateModel (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateSmsTemplateAsync(String templateType, UpdateSmsTemplateModel updateSmsTemplateModel, final ApiCallback<SmsTemplate> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateSmsTemplateValidateBeforeCall(templateType, updateSmsTemplateModel, _callback); + Type localVarReturnType = new TypeToken<SmsTemplate>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/SocialProvidersApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/SocialProvidersApi.java new file mode 100644 index 0000000..6f10b82 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/SocialProvidersApi.java @@ -0,0 +1,1009 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.AppProvider; +import com.loginradius.sdk.internal.openapi.model.DeleteResponse; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.GetAllProviderConfigurations200Response; +import com.loginradius.sdk.internal.openapi.model.ProviderStatusList; +import com.loginradius.sdk.internal.openapi.model.SetProvidersOrderRequest; +import com.loginradius.sdk.internal.openapi.model.SetProvidersStatus200Response; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SocialProvidersApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public SocialProvidersApi() { + this(Configuration.getDefaultApiClient()); + } + + public SocialProvidersApi(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 deleteSocialProviderByName + * @param provider Provider Name (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteSocialProviderByNameCall(String provider, 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 = "/v2/manage/providers/{provider}" + .replace("{" + "provider" + "}", localVarApiClient.escapeString(provider.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteSocialProviderByNameValidateBeforeCall(String provider, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'provider' is set + if (provider == null) { + throw new ApiException("Missing the required parameter 'provider' when calling deleteSocialProviderByName(Async)"); + } + + return deleteSocialProviderByNameCall(provider, _callback); + + } + + /** + * Delete social provider configuration + * Deletes the social provider configuration for a specified provider name for the Tenant. + * @param provider Provider Name (required) + * @return DeleteResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public DeleteResponse deleteSocialProviderByName(String provider) throws ApiException { + ApiResponse<DeleteResponse> localVarResp = deleteSocialProviderByNameWithHttpInfo(provider); + return localVarResp.getData(); + } + + /** + * Delete social provider configuration + * Deletes the social provider configuration for a specified provider name for the Tenant. + * @param provider Provider Name (required) + * @return ApiResponse<DeleteResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DeleteResponse> deleteSocialProviderByNameWithHttpInfo(String provider) throws ApiException { + okhttp3.Call localVarCall = deleteSocialProviderByNameValidateBeforeCall(provider, null); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete social provider configuration (asynchronously) + * Deletes the social provider configuration for a specified provider name for the Tenant. + * @param provider Provider Name (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteSocialProviderByNameAsync(String provider, final ApiCallback<DeleteResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteSocialProviderByNameValidateBeforeCall(provider, _callback); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAllProviderConfigurations + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllProviderConfigurationsCall(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 = "/v2/manage/providers"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAllProviderConfigurationsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getAllProviderConfigurationsCall(_callback); + + } + + /** + * List social provider configurations + * Retrieves all social provider configurations available for the Tenant. + * @return GetAllProviderConfigurations200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public GetAllProviderConfigurations200Response getAllProviderConfigurations() throws ApiException { + ApiResponse<GetAllProviderConfigurations200Response> localVarResp = getAllProviderConfigurationsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List social provider configurations + * Retrieves all social provider configurations available for the Tenant. + * @return ApiResponse<GetAllProviderConfigurations200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetAllProviderConfigurations200Response> getAllProviderConfigurationsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getAllProviderConfigurationsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<GetAllProviderConfigurations200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List social provider configurations (asynchronously) + * Retrieves all social provider configurations available for the Tenant. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllProviderConfigurationsAsync(final ApiCallback<GetAllProviderConfigurations200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getAllProviderConfigurationsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<GetAllProviderConfigurations200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getEnabledProviders + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getEnabledProvidersCall(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 = "/v2/manage/providers/active"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getEnabledProvidersValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getEnabledProvidersCall(_callback); + + } + + /** + * Retrieve enabled social providers + * Retrieves a list of all enabled social providers for the Tenant. + * @return SetProvidersStatus200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public SetProvidersStatus200Response getEnabledProviders() throws ApiException { + ApiResponse<SetProvidersStatus200Response> localVarResp = getEnabledProvidersWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * Retrieve enabled social providers + * Retrieves a list of all enabled social providers for the Tenant. + * @return ApiResponse<SetProvidersStatus200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SetProvidersStatus200Response> getEnabledProvidersWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getEnabledProvidersValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<SetProvidersStatus200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve enabled social providers (asynchronously) + * Retrieves a list of all enabled social providers for the Tenant. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getEnabledProvidersAsync(final ApiCallback<SetProvidersStatus200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getEnabledProvidersValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<SetProvidersStatus200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getSocialProviderByName + * @param provider Provider Name (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getSocialProviderByNameCall(String provider, 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 = "/v2/manage/providers/{provider}" + .replace("{" + "provider" + "}", localVarApiClient.escapeString(provider.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getSocialProviderByNameValidateBeforeCall(String provider, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'provider' is set + if (provider == null) { + throw new ApiException("Missing the required parameter 'provider' when calling getSocialProviderByName(Async)"); + } + + return getSocialProviderByNameCall(provider, _callback); + + } + + /** + * Retrieve social provider configuration + * Retrieves the social provider configuration for a specified provider name for the Tenant. + * @param provider Provider Name (required) + * @return AppProvider + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public AppProvider getSocialProviderByName(String provider) throws ApiException { + ApiResponse<AppProvider> localVarResp = getSocialProviderByNameWithHttpInfo(provider); + return localVarResp.getData(); + } + + /** + * Retrieve social provider configuration + * Retrieves the social provider configuration for a specified provider name for the Tenant. + * @param provider Provider Name (required) + * @return ApiResponse<AppProvider> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<AppProvider> getSocialProviderByNameWithHttpInfo(String provider) throws ApiException { + okhttp3.Call localVarCall = getSocialProviderByNameValidateBeforeCall(provider, null); + Type localVarReturnType = new TypeToken<AppProvider>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve social provider configuration (asynchronously) + * Retrieves the social provider configuration for a specified provider name for the Tenant. + * @param provider Provider Name (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getSocialProviderByNameAsync(String provider, final ApiCallback<AppProvider> _callback) throws ApiException { + + okhttp3.Call localVarCall = getSocialProviderByNameValidateBeforeCall(provider, _callback); + Type localVarReturnType = new TypeToken<AppProvider>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for setProvidersOrder + * @param setProvidersOrderRequest (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call setProvidersOrderCall(SetProvidersOrderRequest setProvidersOrderRequest, 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 = setProvidersOrderRequest; + + // create path and map variables + String localVarPath = "/v2/manage/providers/setorder"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call setProvidersOrderValidateBeforeCall(SetProvidersOrderRequest setProvidersOrderRequest, final ApiCallback _callback) throws ApiException { + return setProvidersOrderCall(setProvidersOrderRequest, _callback); + + } + + /** + * Set social provider order + * Sets the order of social providers for the Tenant to be listed in the UI. + * @param setProvidersOrderRequest (optional) + * @return SetProvidersOrderRequest + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public SetProvidersOrderRequest setProvidersOrder(SetProvidersOrderRequest setProvidersOrderRequest) throws ApiException { + ApiResponse<SetProvidersOrderRequest> localVarResp = setProvidersOrderWithHttpInfo(setProvidersOrderRequest); + return localVarResp.getData(); + } + + /** + * Set social provider order + * Sets the order of social providers for the Tenant to be listed in the UI. + * @param setProvidersOrderRequest (optional) + * @return ApiResponse<SetProvidersOrderRequest> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SetProvidersOrderRequest> setProvidersOrderWithHttpInfo(SetProvidersOrderRequest setProvidersOrderRequest) throws ApiException { + okhttp3.Call localVarCall = setProvidersOrderValidateBeforeCall(setProvidersOrderRequest, null); + Type localVarReturnType = new TypeToken<SetProvidersOrderRequest>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Set social provider order (asynchronously) + * Sets the order of social providers for the Tenant to be listed in the UI. + * @param setProvidersOrderRequest (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call setProvidersOrderAsync(SetProvidersOrderRequest setProvidersOrderRequest, final ApiCallback<SetProvidersOrderRequest> _callback) throws ApiException { + + okhttp3.Call localVarCall = setProvidersOrderValidateBeforeCall(setProvidersOrderRequest, _callback); + Type localVarReturnType = new TypeToken<SetProvidersOrderRequest>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for setProvidersStatus + * @param providerStatusList (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call setProvidersStatusCall(ProviderStatusList providerStatusList, 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 = providerStatusList; + + // create path and map variables + String localVarPath = "/v2/manage/providers"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call setProvidersStatusValidateBeforeCall(ProviderStatusList providerStatusList, final ApiCallback _callback) throws ApiException { + return setProvidersStatusCall(providerStatusList, _callback); + + } + + /** + * Set social provider status + * Sets the status of social providers for the Tenant. + * @param providerStatusList (optional) + * @return SetProvidersStatus200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public SetProvidersStatus200Response setProvidersStatus(ProviderStatusList providerStatusList) throws ApiException { + ApiResponse<SetProvidersStatus200Response> localVarResp = setProvidersStatusWithHttpInfo(providerStatusList); + return localVarResp.getData(); + } + + /** + * Set social provider status + * Sets the status of social providers for the Tenant. + * @param providerStatusList (optional) + * @return ApiResponse<SetProvidersStatus200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SetProvidersStatus200Response> setProvidersStatusWithHttpInfo(ProviderStatusList providerStatusList) throws ApiException { + okhttp3.Call localVarCall = setProvidersStatusValidateBeforeCall(providerStatusList, null); + Type localVarReturnType = new TypeToken<SetProvidersStatus200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Set social provider status (asynchronously) + * Sets the status of social providers for the Tenant. + * @param providerStatusList (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call setProvidersStatusAsync(ProviderStatusList providerStatusList, final ApiCallback<SetProvidersStatus200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = setProvidersStatusValidateBeforeCall(providerStatusList, _callback); + Type localVarReturnType = new TypeToken<SetProvidersStatus200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateSocialProviderByName + * @param provider Provider Name (required) + * @param appProvider (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateSocialProviderByNameCall(String provider, AppProvider appProvider, 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 = appProvider; + + // create path and map variables + String localVarPath = "/v2/manage/providers/{provider}" + .replace("{" + "provider" + "}", localVarApiClient.escapeString(provider.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateSocialProviderByNameValidateBeforeCall(String provider, AppProvider appProvider, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'provider' is set + if (provider == null) { + throw new ApiException("Missing the required parameter 'provider' when calling updateSocialProviderByName(Async)"); + } + + return updateSocialProviderByNameCall(provider, appProvider, _callback); + + } + + /** + * Update social provider configuration + * Updates the social provider configuration for a specified provider name for the Tenant. + * @param provider Provider Name (required) + * @param appProvider (optional) + * @return AppProvider + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public AppProvider updateSocialProviderByName(String provider, AppProvider appProvider) throws ApiException { + ApiResponse<AppProvider> localVarResp = updateSocialProviderByNameWithHttpInfo(provider, appProvider); + return localVarResp.getData(); + } + + /** + * Update social provider configuration + * Updates the social provider configuration for a specified provider name for the Tenant. + * @param provider Provider Name (required) + * @param appProvider (optional) + * @return ApiResponse<AppProvider> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<AppProvider> updateSocialProviderByNameWithHttpInfo(String provider, AppProvider appProvider) throws ApiException { + okhttp3.Call localVarCall = updateSocialProviderByNameValidateBeforeCall(provider, appProvider, null); + Type localVarReturnType = new TypeToken<AppProvider>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update social provider configuration (asynchronously) + * Updates the social provider configuration for a specified provider name for the Tenant. + * @param provider Provider Name (required) + * @param appProvider (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateSocialProviderByNameAsync(String provider, AppProvider appProvider, final ApiCallback<AppProvider> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateSocialProviderByNameValidateBeforeCall(provider, appProvider, _callback); + Type localVarReturnType = new TypeToken<AppProvider>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/SottApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/SottApi.java new file mode 100644 index 0000000..810ba8f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/SottApi.java @@ -0,0 +1,341 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.GetAllSOTT200Response; +import com.loginradius.sdk.internal.openapi.model.SottGenerateTechnology; +import com.loginradius.sdk.internal.openapi.model.SottResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class SottApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public SottApi() { + this(Configuration.getDefaultApiClient()); + } + + public SottApi(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 addSott + * @param sottGenerateTechnology (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call addSottCall(SottGenerateTechnology sottGenerateTechnology, 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 = sottGenerateTechnology; + + // create path and map variables + String localVarPath = "/v2/manage/sott"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call addSottValidateBeforeCall(SottGenerateTechnology sottGenerateTechnology, final ApiCallback _callback) throws ApiException { + return addSottCall(sottGenerateTechnology, _callback); + + } + + /** + * Generate SOTT + * Generates a new Secure One Time Token (SOTT) for the Tenant based on specified technology and parameters. + * @param sottGenerateTechnology (optional) + * @return SottResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public SottResponse addSott(SottGenerateTechnology sottGenerateTechnology) throws ApiException { + ApiResponse<SottResponse> localVarResp = addSottWithHttpInfo(sottGenerateTechnology); + return localVarResp.getData(); + } + + /** + * Generate SOTT + * Generates a new Secure One Time Token (SOTT) for the Tenant based on specified technology and parameters. + * @param sottGenerateTechnology (optional) + * @return ApiResponse<SottResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SottResponse> addSottWithHttpInfo(SottGenerateTechnology sottGenerateTechnology) throws ApiException { + okhttp3.Call localVarCall = addSottValidateBeforeCall(sottGenerateTechnology, null); + Type localVarReturnType = new TypeToken<SottResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Generate SOTT (asynchronously) + * Generates a new Secure One Time Token (SOTT) for the Tenant based on specified technology and parameters. + * @param sottGenerateTechnology (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call addSottAsync(SottGenerateTechnology sottGenerateTechnology, final ApiCallback<SottResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = addSottValidateBeforeCall(sottGenerateTechnology, _callback); + Type localVarReturnType = new TypeToken<SottResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAllSOTT + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllSOTTCall(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 = "/v2/manage/sott"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAllSOTTValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getAllSOTTCall(_callback); + + } + + /** + * List SOTTs + * Retrieves a list of all Secure One Time Token (SOTT) entries associated with the Tenant. + * @return GetAllSOTT200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public GetAllSOTT200Response getAllSOTT() throws ApiException { + ApiResponse<GetAllSOTT200Response> localVarResp = getAllSOTTWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List SOTTs + * Retrieves a list of all Secure One Time Token (SOTT) entries associated with the Tenant. + * @return ApiResponse<GetAllSOTT200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetAllSOTT200Response> getAllSOTTWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getAllSOTTValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<GetAllSOTT200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List SOTTs (asynchronously) + * Retrieves a list of all Secure One Time Token (SOTT) entries associated with the Tenant. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllSOTTAsync(final ApiCallback<GetAllSOTT200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getAllSOTTValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<GetAllSOTT200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/UserApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/UserApi.java new file mode 100644 index 0000000..4a60a3b --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/UserApi.java @@ -0,0 +1,5562 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.AddEmailModel; +import com.loginradius.sdk.internal.openapi.model.ApiError; +import com.loginradius.sdk.internal.openapi.model.CandidateTokenModel; +import com.loginradius.sdk.internal.openapi.model.CheckEmailAvailability200Response; +import com.loginradius.sdk.internal.openapi.model.ClientGuidBodyModel; +import com.loginradius.sdk.internal.openapi.model.ConsentLogsResponse; +import com.loginradius.sdk.internal.openapi.model.ConsentProfile; +import com.loginradius.sdk.internal.openapi.model.ConsentResponse; +import com.loginradius.sdk.internal.openapi.model.ConsentSubmit; +import com.loginradius.sdk.internal.openapi.model.ConsentUpdate; +import com.loginradius.sdk.internal.openapi.model.DeleteemailbyaccesstokenRequest; +import com.loginradius.sdk.internal.openapi.model.EmailModel; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.IdentityResponseWithSocialWithoutLogins; +import com.loginradius.sdk.internal.openapi.model.Invitation; +import com.loginradius.sdk.internal.openapi.model.InvitationToken; +import com.loginradius.sdk.internal.openapi.model.IsDeleteRequestAccepted; +import com.loginradius.sdk.internal.openapi.model.IsDeleted; +import com.loginradius.sdk.internal.openapi.model.IsPostedResponse; +import com.loginradius.sdk.internal.openapi.model.PasskeyListResponse; +import com.loginradius.sdk.internal.openapi.model.PhoneIdModel; +import com.loginradius.sdk.internal.openapi.model.PhoneIdModelOptional; +import com.loginradius.sdk.internal.openapi.model.PrivacyPolicyHistoryResponse; +import com.loginradius.sdk.internal.openapi.model.Profile; +import com.loginradius.sdk.internal.openapi.model.SMSResponse; +import com.loginradius.sdk.internal.openapi.model.SendEmailVerificationResponse; +import com.loginradius.sdk.internal.openapi.model.SetUserNameRequest; +import com.loginradius.sdk.internal.openapi.model.UnlinkSocialIdentityRequest; +import com.loginradius.sdk.internal.openapi.model.UnlockaccountbyaccesstokenRequest; +import com.loginradius.sdk.internal.openapi.model.UpdateAccountByAccessTokenRequest; +import com.loginradius.sdk.internal.openapi.model.UpdateByTokenResponse; +import com.loginradius.sdk.internal.openapi.model.UpdateEmail200Response; +import com.loginradius.sdk.internal.openapi.model.UpdateEmailRequest; +import com.loginradius.sdk.internal.openapi.model.VerifyConsent; +import com.loginradius.sdk.internal.openapi.model.VerifyDeleteAccountOtp; +import com.loginradius.sdk.internal.openapi.model.VerifyOtpPhoneModel; +import com.loginradius.sdk.internal.openapi.model.VerifyPhoneOtp200Response; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class UserApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public UserApi() { + this(Configuration.getDefaultApiClient()); + } + + public UserApi(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 accountListPasskey + * @param accessToken Access Token of the User (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> successful operation </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call accountListPasskeyCall(String accessToken, 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 = "/identity/v2/auth/account/passkey"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + 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[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call accountListPasskeyValidateBeforeCall(String accessToken, final ApiCallback _callback) throws ApiException { + return accountListPasskeyCall(accessToken, _callback); + + } + + /** + * List registered Passkeys + * Lists all registered Passkeys for a User with a valid Access Token. + * @param accessToken Access Token of the User (optional) + * @return PasskeyListResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> successful operation </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public PasskeyListResponse accountListPasskey(String accessToken) throws ApiException { + ApiResponse<PasskeyListResponse> localVarResp = accountListPasskeyWithHttpInfo(accessToken); + return localVarResp.getData(); + } + + /** + * List registered Passkeys + * Lists all registered Passkeys for a User with a valid Access Token. + * @param accessToken Access Token of the User (optional) + * @return ApiResponse<PasskeyListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> successful operation </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<PasskeyListResponse> accountListPasskeyWithHttpInfo(String accessToken) throws ApiException { + okhttp3.Call localVarCall = accountListPasskeyValidateBeforeCall(accessToken, null); + Type localVarReturnType = new TypeToken<PasskeyListResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List registered Passkeys (asynchronously) + * Lists all registered Passkeys for a User with a valid Access Token. + * @param accessToken Access Token of the User (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> successful operation </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call accountListPasskeyAsync(String accessToken, final ApiCallback<PasskeyListResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = accountListPasskeyValidateBeforeCall(accessToken, _callback); + Type localVarReturnType = new TypeToken<PasskeyListResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for accountRemovePasskey + * @param passkeyId Id asscociated with the Passkey (required) + * @param accessToken Access Token of the User (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Remove Passkey credential from account </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call accountRemovePasskeyCall(String passkeyId, String accessToken, 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 = "/identity/v2/auth/account/passkey/{passkeyId}" + .replace("{" + "passkeyId" + "}", localVarApiClient.escapeString(passkeyId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + 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[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call accountRemovePasskeyValidateBeforeCall(String passkeyId, String accessToken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'passkeyId' is set + if (passkeyId == null) { + throw new ApiException("Missing the required parameter 'passkeyId' when calling accountRemovePasskey(Async)"); + } + + return accountRemovePasskeyCall(passkeyId, accessToken, _callback); + + } + + /** + * Remove Passkey + * Removes a specific Passkey from the User's Account. + * @param passkeyId Id asscociated with the Passkey (required) + * @param accessToken Access Token of the User (optional) + * @return IsDeleted + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Remove Passkey credential from account </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public IsDeleted accountRemovePasskey(String passkeyId, String accessToken) throws ApiException { + ApiResponse<IsDeleted> localVarResp = accountRemovePasskeyWithHttpInfo(passkeyId, accessToken); + return localVarResp.getData(); + } + + /** + * Remove Passkey + * Removes a specific Passkey from the User's Account. + * @param passkeyId Id asscociated with the Passkey (required) + * @param accessToken Access Token of the User (optional) + * @return ApiResponse<IsDeleted> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Remove Passkey credential from account </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsDeleted> accountRemovePasskeyWithHttpInfo(String passkeyId, String accessToken) throws ApiException { + okhttp3.Call localVarCall = accountRemovePasskeyValidateBeforeCall(passkeyId, accessToken, null); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Remove Passkey (asynchronously) + * Removes a specific Passkey from the User's Account. + * @param passkeyId Id asscociated with the Passkey (required) + * @param accessToken Access Token of the User (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Remove Passkey credential from account </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call accountRemovePasskeyAsync(String passkeyId, String accessToken, final ApiCallback<IsDeleted> _callback) throws ApiException { + + okhttp3.Call localVarCall = accountRemovePasskeyValidateBeforeCall(passkeyId, accessToken, _callback); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for addEmail + * @param addEmailModel (required) + * @param accessToken Access Token of the User (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK:The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call addEmailCall(AddEmailModel addEmailModel, String accessToken, String emailtemplate, String verificationurl, Boolean preventWebhook, Boolean xPreventWebhook, 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 = addEmailModel; + + // create path and map variables + String localVarPath = "/identity/v2/auth/email"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (emailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailtemplate", emailtemplate)); + } + + if (verificationurl != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("verificationurl", verificationurl)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call addEmailValidateBeforeCall(AddEmailModel addEmailModel, String accessToken, String emailtemplate, String verificationurl, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'addEmailModel' is set + if (addEmailModel == null) { + throw new ApiException("Missing the required parameter 'addEmailModel' when calling addEmail(Async)"); + } + + return addEmailCall(addEmailModel, accessToken, emailtemplate, verificationurl, preventWebhook, xPreventWebhook, _callback); + + } + + /** + * Add Email + * Adds an Email to a User's account, either as a primary or additional Email. + * @param addEmailModel (required) + * @param accessToken Access Token of the User (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return IsPostedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK:The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public IsPostedResponse addEmail(AddEmailModel addEmailModel, String accessToken, String emailtemplate, String verificationurl, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + ApiResponse<IsPostedResponse> localVarResp = addEmailWithHttpInfo(addEmailModel, accessToken, emailtemplate, verificationurl, preventWebhook, xPreventWebhook); + return localVarResp.getData(); + } + + /** + * Add Email + * Adds an Email to a User's account, either as a primary or additional Email. + * @param addEmailModel (required) + * @param accessToken Access Token of the User (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<IsPostedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK:The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedResponse> addEmailWithHttpInfo(AddEmailModel addEmailModel, String accessToken, String emailtemplate, String verificationurl, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + okhttp3.Call localVarCall = addEmailValidateBeforeCall(addEmailModel, accessToken, emailtemplate, verificationurl, preventWebhook, xPreventWebhook, null); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Add Email (asynchronously) + * Adds an Email to a User's account, either as a primary or additional Email. + * @param addEmailModel (required) + * @param accessToken Access Token of the User (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK:The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call addEmailAsync(AddEmailModel addEmailModel, String accessToken, String emailtemplate, String verificationurl, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback<IsPostedResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = addEmailValidateBeforeCall(addEmailModel, accessToken, emailtemplate, verificationurl, preventWebhook, xPreventWebhook, _callback); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for changePhoneNumber + * @param smstemplate SMS Template (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param accessToken Access Token of the User (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param phoneIdModel (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call changePhoneNumberCall(String smstemplate, Boolean preventWebhook, Boolean xPreventWebhook, String accessToken, Boolean isvoiceotp, PhoneIdModel phoneIdModel, 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 = phoneIdModel; + + // create path and map variables + String localVarPath = "/identity/v2/auth/phone"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (smstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("smstemplate", smstemplate)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (isvoiceotp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("isvoiceotp", isvoiceotp)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call changePhoneNumberValidateBeforeCall(String smstemplate, Boolean preventWebhook, Boolean xPreventWebhook, String accessToken, Boolean isvoiceotp, PhoneIdModel phoneIdModel, final ApiCallback _callback) throws ApiException { + return changePhoneNumberCall(smstemplate, preventWebhook, xPreventWebhook, accessToken, isvoiceotp, phoneIdModel, _callback); + + } + + /** + * Change Phone number + * Updates the User's Phone number using the Access Token. + * @param smstemplate SMS Template (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param accessToken Access Token of the User (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param phoneIdModel (optional) + * @return SMSResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public SMSResponse changePhoneNumber(String smstemplate, Boolean preventWebhook, Boolean xPreventWebhook, String accessToken, Boolean isvoiceotp, PhoneIdModel phoneIdModel) throws ApiException { + ApiResponse<SMSResponse> localVarResp = changePhoneNumberWithHttpInfo(smstemplate, preventWebhook, xPreventWebhook, accessToken, isvoiceotp, phoneIdModel); + return localVarResp.getData(); + } + + /** + * Change Phone number + * Updates the User's Phone number using the Access Token. + * @param smstemplate SMS Template (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param accessToken Access Token of the User (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param phoneIdModel (optional) + * @return ApiResponse<SMSResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SMSResponse> changePhoneNumberWithHttpInfo(String smstemplate, Boolean preventWebhook, Boolean xPreventWebhook, String accessToken, Boolean isvoiceotp, PhoneIdModel phoneIdModel) throws ApiException { + okhttp3.Call localVarCall = changePhoneNumberValidateBeforeCall(smstemplate, preventWebhook, xPreventWebhook, accessToken, isvoiceotp, phoneIdModel, null); + Type localVarReturnType = new TypeToken<SMSResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Change Phone number (asynchronously) + * Updates the User's Phone number using the Access Token. + * @param smstemplate SMS Template (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param accessToken Access Token of the User (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param phoneIdModel (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call changePhoneNumberAsync(String smstemplate, Boolean preventWebhook, Boolean xPreventWebhook, String accessToken, Boolean isvoiceotp, PhoneIdModel phoneIdModel, final ApiCallback<SMSResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = changePhoneNumberValidateBeforeCall(smstemplate, preventWebhook, xPreventWebhook, accessToken, isvoiceotp, phoneIdModel, _callback); + Type localVarReturnType = new TypeToken<SMSResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for checkEmailAvailability + * @param email Email address of the associated Account. (optional) + * @param username Username of the associated Account. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param verificationtoken Verification token received in the Email. (optional) + * @param otp One-time passcode sent to the User's Email. (optional) + * @param uuid Email template for the welcome Email. (optional) + * @param url URL to log the main domain in the database. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Email existence check response </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call checkEmailAvailabilityCall(String email, String username, Boolean preventWebhook, Boolean xPreventWebhook, String verificationtoken, String otp, String uuid, String url, String welcomeemailtemplate, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, 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 = "/identity/v2/auth/email"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (email != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("email", email)); + } + + if (username != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("username", username)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (verificationtoken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("verificationtoken", verificationtoken)); + } + + if (otp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("otp", otp)); + } + + if (uuid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("uuid", uuid)); + } + + if (url != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("url", url)); + } + + if (welcomeemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("welcomeemailtemplate", welcomeemailtemplate)); + } + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (gRecaptchaResponse2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g_recaptcha_response", gRecaptchaResponse2)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call checkEmailAvailabilityValidateBeforeCall(String email, String username, Boolean preventWebhook, Boolean xPreventWebhook, String verificationtoken, String otp, String uuid, String url, String welcomeemailtemplate, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback _callback) throws ApiException { + return checkEmailAvailabilityCall(email, username, preventWebhook, xPreventWebhook, verificationtoken, otp, uuid, url, welcomeemailtemplate, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + + } + + /** + * Check Email availability + * Verifies Email availability or checks Email using a Verification Token or OTP. + * @param email Email address of the associated Account. (optional) + * @param username Username of the associated Account. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param verificationtoken Verification token received in the Email. (optional) + * @param otp One-time passcode sent to the User's Email. (optional) + * @param uuid Email template for the welcome Email. (optional) + * @param url URL to log the main domain in the database. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return CheckEmailAvailability200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Email existence check response </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public CheckEmailAvailability200Response checkEmailAvailability(String email, String username, Boolean preventWebhook, Boolean xPreventWebhook, String verificationtoken, String otp, String uuid, String url, String welcomeemailtemplate, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + ApiResponse<CheckEmailAvailability200Response> localVarResp = checkEmailAvailabilityWithHttpInfo(email, username, preventWebhook, xPreventWebhook, verificationtoken, otp, uuid, url, welcomeemailtemplate, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + return localVarResp.getData(); + } + + /** + * Check Email availability + * Verifies Email availability or checks Email using a Verification Token or OTP. + * @param email Email address of the associated Account. (optional) + * @param username Username of the associated Account. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param verificationtoken Verification token received in the Email. (optional) + * @param otp One-time passcode sent to the User's Email. (optional) + * @param uuid Email template for the welcome Email. (optional) + * @param url URL to log the main domain in the database. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return ApiResponse<CheckEmailAvailability200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Email existence check response </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<CheckEmailAvailability200Response> checkEmailAvailabilityWithHttpInfo(String email, String username, Boolean preventWebhook, Boolean xPreventWebhook, String verificationtoken, String otp, String uuid, String url, String welcomeemailtemplate, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + okhttp3.Call localVarCall = checkEmailAvailabilityValidateBeforeCall(email, username, preventWebhook, xPreventWebhook, verificationtoken, otp, uuid, url, welcomeemailtemplate, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, null); + Type localVarReturnType = new TypeToken<CheckEmailAvailability200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Check Email availability (asynchronously) + * Verifies Email availability or checks Email using a Verification Token or OTP. + * @param email Email address of the associated Account. (optional) + * @param username Username of the associated Account. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param verificationtoken Verification token received in the Email. (optional) + * @param otp One-time passcode sent to the User's Email. (optional) + * @param uuid Email template for the welcome Email. (optional) + * @param url URL to log the main domain in the database. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Email existence check response </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call checkEmailAvailabilityAsync(String email, String username, Boolean preventWebhook, Boolean xPreventWebhook, String verificationtoken, String otp, String uuid, String url, String welcomeemailtemplate, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback<CheckEmailAvailability200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = checkEmailAvailabilityValidateBeforeCall(email, username, preventWebhook, xPreventWebhook, verificationtoken, otp, uuid, url, welcomeemailtemplate, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + Type localVarReturnType = new TypeToken<CheckEmailAvailability200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteAccByPhoneOTP + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @param verifyDeleteAccountOtp (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden - Insufficient permissions to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteAccByPhoneOTPCall(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, VerifyDeleteAccountOtp verifyDeleteAccountOtp, 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 = verifyDeleteAccountOtp; + + // create path and map variables + String localVarPath = "/identity/v2/auth/account/delete"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (gRecaptchaResponse2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g_recaptcha_response", gRecaptchaResponse2)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteAccByPhoneOTPValidateBeforeCall(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, VerifyDeleteAccountOtp verifyDeleteAccountOtp, final ApiCallback _callback) throws ApiException { + return deleteAccByPhoneOTPCall(accessToken, preventWebhook, xPreventWebhook, gRecaptchaResponse, gRecaptchaResponse2, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, verifyDeleteAccountOtp, _callback); + + } + + /** + * Delete Account by Phone OTP + * Deletes an Account using a Phone OTP. + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @param verifyDeleteAccountOtp (optional) + * @return IsDeleted + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden - Insufficient permissions to perform this action. </td><td> - </td></tr> + </table> + */ + public IsDeleted deleteAccByPhoneOTP(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, VerifyDeleteAccountOtp verifyDeleteAccountOtp) throws ApiException { + ApiResponse<IsDeleted> localVarResp = deleteAccByPhoneOTPWithHttpInfo(accessToken, preventWebhook, xPreventWebhook, gRecaptchaResponse, gRecaptchaResponse2, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, verifyDeleteAccountOtp); + return localVarResp.getData(); + } + + /** + * Delete Account by Phone OTP + * Deletes an Account using a Phone OTP. + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @param verifyDeleteAccountOtp (optional) + * @return ApiResponse<IsDeleted> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden - Insufficient permissions to perform this action. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsDeleted> deleteAccByPhoneOTPWithHttpInfo(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, VerifyDeleteAccountOtp verifyDeleteAccountOtp) throws ApiException { + okhttp3.Call localVarCall = deleteAccByPhoneOTPValidateBeforeCall(accessToken, preventWebhook, xPreventWebhook, gRecaptchaResponse, gRecaptchaResponse2, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, verifyDeleteAccountOtp, null); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Account by Phone OTP (asynchronously) + * Deletes an Account using a Phone OTP. + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param qqCaptchaTicket QQ Captcha ticket (required if Bot Protection is enabled) (optional) + * @param qqCaptchaRandstr QQ Captcha rand string (required if Bot Protection is enabled) (optional) + * @param verifyDeleteAccountOtp (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden - Insufficient permissions to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteAccByPhoneOTPAsync(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String hCaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, VerifyDeleteAccountOtp verifyDeleteAccountOtp, final ApiCallback<IsDeleted> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteAccByPhoneOTPValidateBeforeCall(accessToken, preventWebhook, xPreventWebhook, gRecaptchaResponse, gRecaptchaResponse2, hCaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, verifyDeleteAccountOtp, _callback); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteAccount + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param deletetoken This is required if the OTP is not passed in the query parameter. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param email Email address of the associated Account. (optional) + * @param otp One-time passcode sent to the User's Email. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Account deletion request successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid parameters or missing required fields. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden - Insufficient permissions to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteAccountCall(Boolean preventWebhook, String deletetoken, Boolean xPreventWebhook, String email, String otp, 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 = "/identity/v2/auth/account/delete"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (deletetoken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("deletetoken", deletetoken)); + } + + if (email != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("email", email)); + } + + if (otp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("otp", otp)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteAccountValidateBeforeCall(Boolean preventWebhook, String deletetoken, Boolean xPreventWebhook, String email, String otp, final ApiCallback _callback) throws ApiException { + return deleteAccountCall(preventWebhook, deletetoken, xPreventWebhook, email, otp, _callback); + + } + + /** + * Delete Account by Email token or OTP + * Deletes an Account using a delete token or OTP. + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param deletetoken This is required if the OTP is not passed in the query parameter. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param email Email address of the associated Account. (optional) + * @param otp One-time passcode sent to the User's Email. (optional) + * @return IsPostedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Account deletion request successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid parameters or missing required fields. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden - Insufficient permissions to perform this action. </td><td> - </td></tr> + </table> + */ + public IsPostedResponse deleteAccount(Boolean preventWebhook, String deletetoken, Boolean xPreventWebhook, String email, String otp) throws ApiException { + ApiResponse<IsPostedResponse> localVarResp = deleteAccountWithHttpInfo(preventWebhook, deletetoken, xPreventWebhook, email, otp); + return localVarResp.getData(); + } + + /** + * Delete Account by Email token or OTP + * Deletes an Account using a delete token or OTP. + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param deletetoken This is required if the OTP is not passed in the query parameter. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param email Email address of the associated Account. (optional) + * @param otp One-time passcode sent to the User's Email. (optional) + * @return ApiResponse<IsPostedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Account deletion request successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid parameters or missing required fields. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden - Insufficient permissions to perform this action. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedResponse> deleteAccountWithHttpInfo(Boolean preventWebhook, String deletetoken, Boolean xPreventWebhook, String email, String otp) throws ApiException { + okhttp3.Call localVarCall = deleteAccountValidateBeforeCall(preventWebhook, deletetoken, xPreventWebhook, email, otp, null); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Account by Email token or OTP (asynchronously) + * Deletes an Account using a delete token or OTP. + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param deletetoken This is required if the OTP is not passed in the query parameter. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param email Email address of the associated Account. (optional) + * @param otp One-time passcode sent to the User's Email. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Account deletion request successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid parameters or missing required fields. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden - Insufficient permissions to perform this action. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteAccountAsync(Boolean preventWebhook, String deletetoken, Boolean xPreventWebhook, String email, String otp, final ApiCallback<IsPostedResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteAccountValidateBeforeCall(preventWebhook, deletetoken, xPreventWebhook, email, otp, _callback); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteAccountByAccessToken + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param deleteurl DeleteUrl URL which is being sent in the Email (optional) + * @param accessToken Access Token of the User (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteAccountByAccessTokenCall(String emailtemplate, String deleteurl, String accessToken, 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 = "/identity/v2/auth/account"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (emailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailtemplate", emailtemplate)); + } + + if (deleteurl != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("deleteurl", deleteurl)); + } + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + 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[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteAccountByAccessTokenValidateBeforeCall(String emailtemplate, String deleteurl, String accessToken, final ApiCallback _callback) throws ApiException { + return deleteAccountByAccessTokenCall(emailtemplate, deleteurl, accessToken, _callback); + + } + + /** + * Send User deletion Email + * Sends a confirmation Email for User deletion to the User's Email using their Access Token. + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param deleteurl DeleteUrl URL which is being sent in the Email (optional) + * @param accessToken Access Token of the User (optional) + * @return IsDeleteRequestAccepted + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public IsDeleteRequestAccepted deleteAccountByAccessToken(String emailtemplate, String deleteurl, String accessToken) throws ApiException { + ApiResponse<IsDeleteRequestAccepted> localVarResp = deleteAccountByAccessTokenWithHttpInfo(emailtemplate, deleteurl, accessToken); + return localVarResp.getData(); + } + + /** + * Send User deletion Email + * Sends a confirmation Email for User deletion to the User's Email using their Access Token. + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param deleteurl DeleteUrl URL which is being sent in the Email (optional) + * @param accessToken Access Token of the User (optional) + * @return ApiResponse<IsDeleteRequestAccepted> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsDeleteRequestAccepted> deleteAccountByAccessTokenWithHttpInfo(String emailtemplate, String deleteurl, String accessToken) throws ApiException { + okhttp3.Call localVarCall = deleteAccountByAccessTokenValidateBeforeCall(emailtemplate, deleteurl, accessToken, null); + Type localVarReturnType = new TypeToken<IsDeleteRequestAccepted>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Send User deletion Email (asynchronously) + * Sends a confirmation Email for User deletion to the User's Email using their Access Token. + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param deleteurl DeleteUrl URL which is being sent in the Email (optional) + * @param accessToken Access Token of the User (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status Ok: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteAccountByAccessTokenAsync(String emailtemplate, String deleteurl, String accessToken, final ApiCallback<IsDeleteRequestAccepted> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteAccountByAccessTokenValidateBeforeCall(emailtemplate, deleteurl, accessToken, _callback); + Type localVarReturnType = new TypeToken<IsDeleteRequestAccepted>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteemailbyaccesstoken + * @param deleteemailbyaccesstokenRequest (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteemailbyaccesstokenCall(DeleteemailbyaccesstokenRequest deleteemailbyaccesstokenRequest, Boolean preventWebhook, Boolean xPreventWebhook, 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 = deleteemailbyaccesstokenRequest; + + // create path and map variables + String localVarPath = "/identity/v2/auth/email"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteemailbyaccesstokenValidateBeforeCall(DeleteemailbyaccesstokenRequest deleteemailbyaccesstokenRequest, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'deleteemailbyaccesstokenRequest' is set + if (deleteemailbyaccesstokenRequest == null) { + throw new ApiException("Missing the required parameter 'deleteemailbyaccesstokenRequest' when calling deleteemailbyaccesstoken(Async)"); + } + + return deleteemailbyaccesstokenCall(deleteemailbyaccesstokenRequest, preventWebhook, xPreventWebhook, _callback); + + } + + /** + * Remove Email + * Removes additional Emails from a User's account. + * @param deleteemailbyaccesstokenRequest (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return IsDeleted + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public IsDeleted deleteemailbyaccesstoken(DeleteemailbyaccesstokenRequest deleteemailbyaccesstokenRequest, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + ApiResponse<IsDeleted> localVarResp = deleteemailbyaccesstokenWithHttpInfo(deleteemailbyaccesstokenRequest, preventWebhook, xPreventWebhook); + return localVarResp.getData(); + } + + /** + * Remove Email + * Removes additional Emails from a User's account. + * @param deleteemailbyaccesstokenRequest (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<IsDeleted> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsDeleted> deleteemailbyaccesstokenWithHttpInfo(DeleteemailbyaccesstokenRequest deleteemailbyaccesstokenRequest, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + okhttp3.Call localVarCall = deleteemailbyaccesstokenValidateBeforeCall(deleteemailbyaccesstokenRequest, preventWebhook, xPreventWebhook, null); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Remove Email (asynchronously) + * Removes additional Emails from a User's account. + * @param deleteemailbyaccesstokenRequest (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteemailbyaccesstokenAsync(DeleteemailbyaccesstokenRequest deleteemailbyaccesstokenRequest, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback<IsDeleted> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteemailbyaccesstokenValidateBeforeCall(deleteemailbyaccesstokenRequest, preventWebhook, xPreventWebhook, _callback); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAccountDetails + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully retrieved account details. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - User does not have permission to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: An unexpected error occurred. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAccountDetailsCall(String welcomeemailtemplate, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, 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 = "/identity/v2/auth/account"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (welcomeemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("welcomeemailtemplate", welcomeemailtemplate)); + } + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAccountDetailsValidateBeforeCall(String welcomeemailtemplate, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback _callback) throws ApiException { + return getAccountDetailsCall(welcomeemailtemplate, accessToken, preventWebhook, xPreventWebhook, _callback); + + } + + /** + * Retrieve User + * Retrieves User details based on the Access Token. + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return IdentityResponseWithSocialWithoutLogins + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully retrieved account details. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - User does not have permission to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: An unexpected error occurred. </td><td> - </td></tr> + </table> + */ + public IdentityResponseWithSocialWithoutLogins getAccountDetails(String welcomeemailtemplate, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + ApiResponse<IdentityResponseWithSocialWithoutLogins> localVarResp = getAccountDetailsWithHttpInfo(welcomeemailtemplate, accessToken, preventWebhook, xPreventWebhook); + return localVarResp.getData(); + } + + /** + * Retrieve User + * Retrieves User details based on the Access Token. + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<IdentityResponseWithSocialWithoutLogins> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully retrieved account details. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - User does not have permission to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: An unexpected error occurred. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IdentityResponseWithSocialWithoutLogins> getAccountDetailsWithHttpInfo(String welcomeemailtemplate, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + okhttp3.Call localVarCall = getAccountDetailsValidateBeforeCall(welcomeemailtemplate, accessToken, preventWebhook, xPreventWebhook, null); + Type localVarReturnType = new TypeToken<IdentityResponseWithSocialWithoutLogins>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve User (asynchronously) + * Retrieves User details based on the Access Token. + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Successfully retrieved account details. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - User does not have permission to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Status Not Found: The requested resource could not be found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Status Internal Server Error: An unexpected error occurred. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAccountDetailsAsync(String welcomeemailtemplate, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback<IdentityResponseWithSocialWithoutLogins> _callback) throws ApiException { + + okhttp3.Call localVarCall = getAccountDetailsValidateBeforeCall(welcomeemailtemplate, accessToken, preventWebhook, xPreventWebhook, _callback); + Type localVarReturnType = new TypeToken<IdentityResponseWithSocialWithoutLogins>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getConsentLogs + * @param accessToken Access Token of the User (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getConsentLogsCall(String accessToken, 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 = "/identity/v2/auth/consent/logs"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + 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[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getConsentLogsValidateBeforeCall(String accessToken, final ApiCallback _callback) throws ApiException { + return getConsentLogsCall(accessToken, _callback); + + } + + /** + * Retrieve Consent Logs + * Retrieves consent logs for a User based on the provided Access Token. + * @param accessToken Access Token of the User (optional) + * @return ConsentLogsResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ConsentLogsResponse getConsentLogs(String accessToken) throws ApiException { + ApiResponse<ConsentLogsResponse> localVarResp = getConsentLogsWithHttpInfo(accessToken); + return localVarResp.getData(); + } + + /** + * Retrieve Consent Logs + * Retrieves consent logs for a User based on the provided Access Token. + * @param accessToken Access Token of the User (optional) + * @return ApiResponse<ConsentLogsResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<ConsentLogsResponse> getConsentLogsWithHttpInfo(String accessToken) throws ApiException { + okhttp3.Call localVarCall = getConsentLogsValidateBeforeCall(accessToken, null); + Type localVarReturnType = new TypeToken<ConsentLogsResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Consent Logs (asynchronously) + * Retrieves consent logs for a User based on the provided Access Token. + * @param accessToken Access Token of the User (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getConsentLogsAsync(String accessToken, final ApiCallback<ConsentLogsResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getConsentLogsValidateBeforeCall(accessToken, _callback); + Type localVarReturnType = new TypeToken<ConsentLogsResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getInvitation + * @param invitationToken The token of the invitation to retrieve. (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found - the invitation token does not exist or is invalid. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getInvitationCall(String invitationToken, 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 = "/identity/v2/auth/invitations/{invitation_token}" + .replace("{" + "invitation_token" + "}", localVarApiClient.escapeString(invitationToken.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getInvitationValidateBeforeCall(String invitationToken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'invitationToken' is set + if (invitationToken == null) { + throw new ApiException("Missing the required parameter 'invitationToken' when calling getInvitation(Async)"); + } + + return getInvitationCall(invitationToken, _callback); + + } + + /** + * Retrieve invitation details + * Retrieves details about a specific invitation using the invitation token. + * @param invitationToken The token of the invitation to retrieve. (required) + * @return InvitationToken + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found - the invitation token does not exist or is invalid. </td><td> - </td></tr> + </table> + */ + public InvitationToken getInvitation(String invitationToken) throws ApiException { + ApiResponse<InvitationToken> localVarResp = getInvitationWithHttpInfo(invitationToken); + return localVarResp.getData(); + } + + /** + * Retrieve invitation details + * Retrieves details about a specific invitation using the invitation token. + * @param invitationToken The token of the invitation to retrieve. (required) + * @return ApiResponse<InvitationToken> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found - the invitation token does not exist or is invalid. </td><td> - </td></tr> + </table> + */ + public ApiResponse<InvitationToken> getInvitationWithHttpInfo(String invitationToken) throws ApiException { + okhttp3.Call localVarCall = getInvitationValidateBeforeCall(invitationToken, null); + Type localVarReturnType = new TypeToken<InvitationToken>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve invitation details (asynchronously) + * Retrieves details about a specific invitation using the invitation token. + * @param invitationToken The token of the invitation to retrieve. (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - the request is malformed or invalid. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - the client is not allowed to access this resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found - the invitation token does not exist or is invalid. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getInvitationAsync(String invitationToken, final ApiCallback<InvitationToken> _callback) throws ApiException { + + okhttp3.Call localVarCall = getInvitationValidateBeforeCall(invitationToken, _callback); + Type localVarReturnType = new TypeToken<InvitationToken>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getInvitationByInvitationId + * @param invitationid The ID of the invitation. The ID is typically in the format *inv_<unique_id>*, where *<unique_id>* is a string of alphanumeric characters. (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getInvitationByInvitationIdCall(String invitationid, 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 = "/v2/manage/invitations/{invitationid}" + .replace("{" + "invitationid" + "}", localVarApiClient.escapeString(invitationid.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "M2MBearerToken", "ClientSecret", "ClientId", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getInvitationByInvitationIdValidateBeforeCall(String invitationid, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'invitationid' is set + if (invitationid == null) { + throw new ApiException("Missing the required parameter 'invitationid' when calling getInvitationByInvitationId(Async)"); + } + + return getInvitationByInvitationIdCall(invitationid, _callback); + + } + + /** + * Retrieve invitation by ID + * Retrieves invitation details by invitation ID. + * @param invitationid The ID of the invitation. The ID is typically in the format *inv_<unique_id>*, where *<unique_id>* is a string of alphanumeric characters. (required) + * @return Invitation + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public Invitation getInvitationByInvitationId(String invitationid) throws ApiException { + ApiResponse<Invitation> localVarResp = getInvitationByInvitationIdWithHttpInfo(invitationid); + return localVarResp.getData(); + } + + /** + * Retrieve invitation by ID + * Retrieves invitation details by invitation ID. + * @param invitationid The ID of the invitation. The ID is typically in the format *inv_<unique_id>*, where *<unique_id>* is a string of alphanumeric characters. (required) + * @return ApiResponse<Invitation> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<Invitation> getInvitationByInvitationIdWithHttpInfo(String invitationid) throws ApiException { + okhttp3.Call localVarCall = getInvitationByInvitationIdValidateBeforeCall(invitationid, null); + Type localVarReturnType = new TypeToken<Invitation>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve invitation by ID (asynchronously) + * Retrieves invitation details by invitation ID. + * @param invitationid The ID of the invitation. The ID is typically in the format *inv_<unique_id>*, where *<unique_id>* is a string of alphanumeric characters. (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getInvitationByInvitationIdAsync(String invitationid, final ApiCallback<Invitation> _callback) throws ApiException { + + okhttp3.Call localVarCall = getInvitationByInvitationIdValidateBeforeCall(invitationid, _callback); + Type localVarReturnType = new TypeToken<Invitation>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPrivacyPolicyAcceptance + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> User information along with Privacy Policy acceptance details. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - User does not have permission to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getPrivacyPolicyAcceptanceCall(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, 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 = "/identity/v2/auth/privacypolicy/accept"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPrivacyPolicyAcceptanceValidateBeforeCall(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback _callback) throws ApiException { + return getPrivacyPolicyAcceptanceCall(accessToken, preventWebhook, xPreventWebhook, _callback); + + } + + /** + * Accept Privacy Policy + * Updates the Privacy Policy stored in a User's profile using their Access Token. + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return IdentityResponseWithSocialWithoutLogins + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> User information along with Privacy Policy acceptance details. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - User does not have permission to access this resource. </td><td> - </td></tr> + </table> + */ + public IdentityResponseWithSocialWithoutLogins getPrivacyPolicyAcceptance(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + ApiResponse<IdentityResponseWithSocialWithoutLogins> localVarResp = getPrivacyPolicyAcceptanceWithHttpInfo(accessToken, preventWebhook, xPreventWebhook); + return localVarResp.getData(); + } + + /** + * Accept Privacy Policy + * Updates the Privacy Policy stored in a User's profile using their Access Token. + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<IdentityResponseWithSocialWithoutLogins> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> User information along with Privacy Policy acceptance details. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - User does not have permission to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IdentityResponseWithSocialWithoutLogins> getPrivacyPolicyAcceptanceWithHttpInfo(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + okhttp3.Call localVarCall = getPrivacyPolicyAcceptanceValidateBeforeCall(accessToken, preventWebhook, xPreventWebhook, null); + Type localVarReturnType = new TypeToken<IdentityResponseWithSocialWithoutLogins>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Accept Privacy Policy (asynchronously) + * Updates the Privacy Policy stored in a User's profile using their Access Token. + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> User information along with Privacy Policy acceptance details. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - User does not have permission to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getPrivacyPolicyAcceptanceAsync(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback<IdentityResponseWithSocialWithoutLogins> _callback) throws ApiException { + + okhttp3.Call localVarCall = getPrivacyPolicyAcceptanceValidateBeforeCall(accessToken, preventWebhook, xPreventWebhook, _callback); + Type localVarReturnType = new TypeToken<IdentityResponseWithSocialWithoutLogins>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getPrivacyPolicyHistory + * @param accessToken Access Token of the User (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Privacy Policy History retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - User does not have permission to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getPrivacyPolicyHistoryCall(String accessToken, 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 = "/identity/v2/auth/privacypolicy/history"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + 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[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getPrivacyPolicyHistoryValidateBeforeCall(String accessToken, final ApiCallback _callback) throws ApiException { + return getPrivacyPolicyHistoryCall(accessToken, _callback); + + } + + /** + * Retrieve Privacy Policy History + * Returns all accepted Privacy Policies for a User using their Access Token. + * @param accessToken Access Token of the User (optional) + * @return PrivacyPolicyHistoryResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Privacy Policy History retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - User does not have permission to access this resource. </td><td> - </td></tr> + </table> + */ + public PrivacyPolicyHistoryResponse getPrivacyPolicyHistory(String accessToken) throws ApiException { + ApiResponse<PrivacyPolicyHistoryResponse> localVarResp = getPrivacyPolicyHistoryWithHttpInfo(accessToken); + return localVarResp.getData(); + } + + /** + * Retrieve Privacy Policy History + * Returns all accepted Privacy Policies for a User using their Access Token. + * @param accessToken Access Token of the User (optional) + * @return ApiResponse<PrivacyPolicyHistoryResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Privacy Policy History retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - User does not have permission to access this resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<PrivacyPolicyHistoryResponse> getPrivacyPolicyHistoryWithHttpInfo(String accessToken) throws ApiException { + okhttp3.Call localVarCall = getPrivacyPolicyHistoryValidateBeforeCall(accessToken, null); + Type localVarReturnType = new TypeToken<PrivacyPolicyHistoryResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Privacy Policy History (asynchronously) + * Returns all accepted Privacy Policies for a User using their Access Token. + * @param accessToken Access Token of the User (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Privacy Policy History retrieved successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - User does not have permission to access this resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getPrivacyPolicyHistoryAsync(String accessToken, final ApiCallback<PrivacyPolicyHistoryResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getPrivacyPolicyHistoryValidateBeforeCall(accessToken, _callback); + Type localVarReturnType = new TypeToken<PrivacyPolicyHistoryResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getVerifiedConsentWithAccessToken + * @param event Event type to filter consent verification (e.g., `login`). (required) + * @param iscustom This field value is used to filter the consent verification by custom events. The iscustom value should be a boolean. If true, it filters for custom events; if false, it filters for standard events. (required) + * @param accessToken Access Token of the User (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getVerifiedConsentWithAccessTokenCall(String event, Boolean iscustom, String accessToken, 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 = "/identity/v2/auth/consent/verify"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (event != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("event", event)); + } + + if (iscustom != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("iscustom", iscustom)); + } + + 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[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getVerifiedConsentWithAccessTokenValidateBeforeCall(String event, Boolean iscustom, String accessToken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'event' is set + if (event == null) { + throw new ApiException("Missing the required parameter 'event' when calling getVerifiedConsentWithAccessToken(Async)"); + } + + // verify the required parameter 'iscustom' is set + if (iscustom == null) { + throw new ApiException("Missing the required parameter 'iscustom' when calling getVerifiedConsentWithAccessToken(Async)"); + } + + return getVerifiedConsentWithAccessTokenCall(event, iscustom, accessToken, _callback); + + } + + /** + * Retrieve Consent Status + * Retrieves the consent verification status for a User based on the provided Access Token and event. + * @param event Event type to filter consent verification (e.g., `login`). (required) + * @param iscustom This field value is used to filter the consent verification by custom events. The iscustom value should be a boolean. If true, it filters for custom events; if false, it filters for standard events. (required) + * @param accessToken Access Token of the User (optional) + * @return VerifyConsent + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public VerifyConsent getVerifiedConsentWithAccessToken(String event, Boolean iscustom, String accessToken) throws ApiException { + ApiResponse<VerifyConsent> localVarResp = getVerifiedConsentWithAccessTokenWithHttpInfo(event, iscustom, accessToken); + return localVarResp.getData(); + } + + /** + * Retrieve Consent Status + * Retrieves the consent verification status for a User based on the provided Access Token and event. + * @param event Event type to filter consent verification (e.g., `login`). (required) + * @param iscustom This field value is used to filter the consent verification by custom events. The iscustom value should be a boolean. If true, it filters for custom events; if false, it filters for standard events. (required) + * @param accessToken Access Token of the User (optional) + * @return ApiResponse<VerifyConsent> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<VerifyConsent> getVerifiedConsentWithAccessTokenWithHttpInfo(String event, Boolean iscustom, String accessToken) throws ApiException { + okhttp3.Call localVarCall = getVerifiedConsentWithAccessTokenValidateBeforeCall(event, iscustom, accessToken, null); + Type localVarReturnType = new TypeToken<VerifyConsent>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Consent Status (asynchronously) + * Retrieves the consent verification status for a User based on the provided Access Token and event. + * @param event Event type to filter consent verification (e.g., `login`). (required) + * @param iscustom This field value is used to filter the consent verification by custom events. The iscustom value should be a boolean. If true, it filters for custom events; if false, it filters for standard events. (required) + * @param accessToken Access Token of the User (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getVerifiedConsentWithAccessTokenAsync(String event, Boolean iscustom, String accessToken, final ApiCallback<VerifyConsent> _callback) throws ApiException { + + okhttp3.Call localVarCall = getVerifiedConsentWithAccessTokenValidateBeforeCall(event, iscustom, accessToken, _callback); + Type localVarReturnType = new TypeToken<VerifyConsent>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for linkSocialIdentitiesByAccessToken + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param candidateTokenModel (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call linkSocialIdentitiesByAccessTokenCall(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, CandidateTokenModel candidateTokenModel, 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 = candidateTokenModel; + + // create path and map variables + String localVarPath = "/identity/v2/auth/socialidentity"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call linkSocialIdentitiesByAccessTokenValidateBeforeCall(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, CandidateTokenModel candidateTokenModel, final ApiCallback _callback) throws ApiException { + return linkSocialIdentitiesByAccessTokenCall(accessToken, preventWebhook, xPreventWebhook, candidateTokenModel, _callback); + + } + + /** + * Link social identities + * Links a social provider account to an existing Account using Access Tokens. + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param candidateTokenModel (optional) + * @return IsPostedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public IsPostedResponse linkSocialIdentitiesByAccessToken(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, CandidateTokenModel candidateTokenModel) throws ApiException { + ApiResponse<IsPostedResponse> localVarResp = linkSocialIdentitiesByAccessTokenWithHttpInfo(accessToken, preventWebhook, xPreventWebhook, candidateTokenModel); + return localVarResp.getData(); + } + + /** + * Link social identities + * Links a social provider account to an existing Account using Access Tokens. + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param candidateTokenModel (optional) + * @return ApiResponse<IsPostedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedResponse> linkSocialIdentitiesByAccessTokenWithHttpInfo(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, CandidateTokenModel candidateTokenModel) throws ApiException { + okhttp3.Call localVarCall = linkSocialIdentitiesByAccessTokenValidateBeforeCall(accessToken, preventWebhook, xPreventWebhook, candidateTokenModel, null); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Link social identities (asynchronously) + * Links a social provider account to an existing Account using Access Tokens. + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param candidateTokenModel (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call linkSocialIdentitiesByAccessTokenAsync(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, CandidateTokenModel candidateTokenModel, final ApiCallback<IsPostedResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = linkSocialIdentitiesByAccessTokenValidateBeforeCall(accessToken, preventWebhook, xPreventWebhook, candidateTokenModel, _callback); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for linkSocialIdentitiesByPing + * @param accessToken Access Token of the User (optional) + * @param clientGuidBodyModel (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call linkSocialIdentitiesByPingCall(String accessToken, ClientGuidBodyModel clientGuidBodyModel, 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 = clientGuidBodyModel; + + // create path and map variables + String localVarPath = "/identity/v2/auth/socialidentity/ping"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + 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[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call linkSocialIdentitiesByPingValidateBeforeCall(String accessToken, ClientGuidBodyModel clientGuidBodyModel, final ApiCallback _callback) throws ApiException { + return linkSocialIdentitiesByPingCall(accessToken, clientGuidBodyModel, _callback); + + } + + /** + * Link social identities via PING + * Links a social provider account with an existing Account using the Access Token and the social provider's User Access Token. + * @param accessToken Access Token of the User (optional) + * @param clientGuidBodyModel (optional) + * @return IsPostedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public IsPostedResponse linkSocialIdentitiesByPing(String accessToken, ClientGuidBodyModel clientGuidBodyModel) throws ApiException { + ApiResponse<IsPostedResponse> localVarResp = linkSocialIdentitiesByPingWithHttpInfo(accessToken, clientGuidBodyModel); + return localVarResp.getData(); + } + + /** + * Link social identities via PING + * Links a social provider account with an existing Account using the Access Token and the social provider's User Access Token. + * @param accessToken Access Token of the User (optional) + * @param clientGuidBodyModel (optional) + * @return ApiResponse<IsPostedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedResponse> linkSocialIdentitiesByPingWithHttpInfo(String accessToken, ClientGuidBodyModel clientGuidBodyModel) throws ApiException { + okhttp3.Call localVarCall = linkSocialIdentitiesByPingValidateBeforeCall(accessToken, clientGuidBodyModel, null); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Link social identities via PING (asynchronously) + * Links a social provider account with an existing Account using the Access Token and the social provider's User Access Token. + * @param accessToken Access Token of the User (optional) + * @param clientGuidBodyModel (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Success </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call linkSocialIdentitiesByPingAsync(String accessToken, ClientGuidBodyModel clientGuidBodyModel, final ApiCallback<IsPostedResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = linkSocialIdentitiesByPingValidateBeforeCall(accessToken, clientGuidBodyModel, _callback); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for removePhoneIdByToken + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call removePhoneIdByTokenCall(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, 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 = "/identity/v2/auth/phone"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call removePhoneIdByTokenValidateBeforeCall(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback _callback) throws ApiException { + return removePhoneIdByTokenCall(accessToken, preventWebhook, xPreventWebhook, _callback); + + } + + /** + * Remove Phone number + * Removes the User's Phone number using the Access Token. + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return IsDeleted + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public IsDeleted removePhoneIdByToken(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + ApiResponse<IsDeleted> localVarResp = removePhoneIdByTokenWithHttpInfo(accessToken, preventWebhook, xPreventWebhook); + return localVarResp.getData(); + } + + /** + * Remove Phone number + * Removes the User's Phone number using the Access Token. + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<IsDeleted> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsDeleted> removePhoneIdByTokenWithHttpInfo(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + okhttp3.Call localVarCall = removePhoneIdByTokenValidateBeforeCall(accessToken, preventWebhook, xPreventWebhook, null); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Remove Phone number (asynchronously) + * Removes the User's Phone number using the Access Token. + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call removePhoneIdByTokenAsync(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback<IsDeleted> _callback) throws ApiException { + + okhttp3.Call localVarCall = removePhoneIdByTokenValidateBeforeCall(accessToken, preventWebhook, xPreventWebhook, _callback); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for resendEmailVerification + * @param emailModel (required) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> User registration successful and verification Email sent </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid parameters or missing required fields </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden- Insufficient permissions to perform this action </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resendEmailVerificationCall(EmailModel emailModel, String verificationurl, String emailtemplate, 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 = emailModel; + + // create path and map variables + String localVarPath = "/identity/v2/auth/register"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (verificationurl != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("verificationurl", verificationurl)); + } + + if (emailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailtemplate", emailtemplate)); + } + + 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[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call resendEmailVerificationValidateBeforeCall(EmailModel emailModel, String verificationurl, String emailtemplate, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'emailModel' is set + if (emailModel == null) { + throw new ApiException("Missing the required parameter 'emailModel' when calling resendEmailVerification(Async)"); + } + + return resendEmailVerificationCall(emailModel, verificationurl, emailtemplate, _callback); + + } + + /** + * Resend verification Email + * Resends the verification Email to the User to confirm their Email address. + * @param emailModel (required) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @return IsPostedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> User registration successful and verification Email sent </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid parameters or missing required fields </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden- Insufficient permissions to perform this action </td><td> - </td></tr> + </table> + */ + public IsPostedResponse resendEmailVerification(EmailModel emailModel, String verificationurl, String emailtemplate) throws ApiException { + ApiResponse<IsPostedResponse> localVarResp = resendEmailVerificationWithHttpInfo(emailModel, verificationurl, emailtemplate); + return localVarResp.getData(); + } + + /** + * Resend verification Email + * Resends the verification Email to the User to confirm their Email address. + * @param emailModel (required) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @return ApiResponse<IsPostedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> User registration successful and verification Email sent </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid parameters or missing required fields </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden- Insufficient permissions to perform this action </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedResponse> resendEmailVerificationWithHttpInfo(EmailModel emailModel, String verificationurl, String emailtemplate) throws ApiException { + okhttp3.Call localVarCall = resendEmailVerificationValidateBeforeCall(emailModel, verificationurl, emailtemplate, null); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Resend verification Email (asynchronously) + * Resends the verification Email to the User to confirm their Email address. + * @param emailModel (required) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> User registration successful and verification Email sent </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid parameters or missing required fields </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden- Insufficient permissions to perform this action </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resendEmailVerificationAsync(EmailModel emailModel, String verificationurl, String emailtemplate, final ApiCallback<IsPostedResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = resendEmailVerificationValidateBeforeCall(emailModel, verificationurl, emailtemplate, _callback); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for resendPhoneOtp + * @param smstemplate SMS Template (optional) + * @param accessToken Access Token of the User (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param phoneIdModelOptional (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resendPhoneOtpCall(String smstemplate, String accessToken, Boolean isvoiceotp, PhoneIdModelOptional phoneIdModelOptional, 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 = phoneIdModelOptional; + + // create path and map variables + String localVarPath = "/identity/v2/auth/phone/otp"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (smstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("smstemplate", smstemplate)); + } + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (isvoiceotp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("isvoiceotp", isvoiceotp)); + } + + 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[] { "APIKey", "ClientId", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call resendPhoneOtpValidateBeforeCall(String smstemplate, String accessToken, Boolean isvoiceotp, PhoneIdModelOptional phoneIdModelOptional, final ApiCallback _callback) throws ApiException { + return resendPhoneOtpCall(smstemplate, accessToken, isvoiceotp, phoneIdModelOptional, _callback); + + } + + /** + * Resend Phone OTP + * Resends the Phone OTP using either the Access Token or Phone number. + * @param smstemplate SMS Template (optional) + * @param accessToken Access Token of the User (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param phoneIdModelOptional (optional) + * @return SMSResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public SMSResponse resendPhoneOtp(String smstemplate, String accessToken, Boolean isvoiceotp, PhoneIdModelOptional phoneIdModelOptional) throws ApiException { + ApiResponse<SMSResponse> localVarResp = resendPhoneOtpWithHttpInfo(smstemplate, accessToken, isvoiceotp, phoneIdModelOptional); + return localVarResp.getData(); + } + + /** + * Resend Phone OTP + * Resends the Phone OTP using either the Access Token or Phone number. + * @param smstemplate SMS Template (optional) + * @param accessToken Access Token of the User (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param phoneIdModelOptional (optional) + * @return ApiResponse<SMSResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SMSResponse> resendPhoneOtpWithHttpInfo(String smstemplate, String accessToken, Boolean isvoiceotp, PhoneIdModelOptional phoneIdModelOptional) throws ApiException { + okhttp3.Call localVarCall = resendPhoneOtpValidateBeforeCall(smstemplate, accessToken, isvoiceotp, phoneIdModelOptional, null); + Type localVarReturnType = new TypeToken<SMSResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Resend Phone OTP (asynchronously) + * Resends the Phone OTP using either the Access Token or Phone number. + * @param smstemplate SMS Template (optional) + * @param accessToken Access Token of the User (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param phoneIdModelOptional (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call resendPhoneOtpAsync(String smstemplate, String accessToken, Boolean isvoiceotp, PhoneIdModelOptional phoneIdModelOptional, final ApiCallback<SMSResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = resendPhoneOtpValidateBeforeCall(smstemplate, accessToken, isvoiceotp, phoneIdModelOptional, _callback); + Type localVarReturnType = new TypeToken<SMSResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for sendDeleteOtp + * @param accessToken Access Token of the User (optional) + * @param smstemplate SMS Template (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call sendDeleteOtpCall(String accessToken, String smstemplate, Boolean isvoiceotp, 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 = "/identity/v2/auth/account/otp"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (smstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("smstemplate", smstemplate)); + } + + if (isvoiceotp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("isvoiceotp", isvoiceotp)); + } + + 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[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call sendDeleteOtpValidateBeforeCall(String accessToken, String smstemplate, Boolean isvoiceotp, final ApiCallback _callback) throws ApiException { + return sendDeleteOtpCall(accessToken, smstemplate, isvoiceotp, _callback); + + } + + /** + * Retrieve delete Account OTP + * Retrieves the OTP for the specified Account to facilitate account deletion. + * @param accessToken Access Token of the User (optional) + * @param smstemplate SMS Template (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @return SMSResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public SMSResponse sendDeleteOtp(String accessToken, String smstemplate, Boolean isvoiceotp) throws ApiException { + ApiResponse<SMSResponse> localVarResp = sendDeleteOtpWithHttpInfo(accessToken, smstemplate, isvoiceotp); + return localVarResp.getData(); + } + + /** + * Retrieve delete Account OTP + * Retrieves the OTP for the specified Account to facilitate account deletion. + * @param accessToken Access Token of the User (optional) + * @param smstemplate SMS Template (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @return ApiResponse<SMSResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SMSResponse> sendDeleteOtpWithHttpInfo(String accessToken, String smstemplate, Boolean isvoiceotp) throws ApiException { + okhttp3.Call localVarCall = sendDeleteOtpValidateBeforeCall(accessToken, smstemplate, isvoiceotp, null); + Type localVarReturnType = new TypeToken<SMSResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve delete Account OTP (asynchronously) + * Retrieves the OTP for the specified Account to facilitate account deletion. + * @param accessToken Access Token of the User (optional) + * @param smstemplate SMS Template (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 401 </td><td> Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call sendDeleteOtpAsync(String accessToken, String smstemplate, Boolean isvoiceotp, final ApiCallback<SMSResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = sendDeleteOtpValidateBeforeCall(accessToken, smstemplate, isvoiceotp, _callback); + Type localVarReturnType = new TypeToken<SMSResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for sendEmailVerification + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param clientguid Client GUID for the request. (optional) + * @param accessToken Access Token of the User (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Email Verification request successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid parameters or missing required fields. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - Insufficient permissions to perform this action. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - An unexpected error occurred. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call sendEmailVerificationCall(String emailtemplate, String verificationurl, String clientguid, String accessToken, 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 = "/identity/v2/auth/email/sendverificationemail"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (emailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailtemplate", emailtemplate)); + } + + if (verificationurl != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("verificationurl", verificationurl)); + } + + if (clientguid != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("clientguid", clientguid)); + } + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + 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[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call sendEmailVerificationValidateBeforeCall(String emailtemplate, String verificationurl, String clientguid, String accessToken, final ApiCallback _callback) throws ApiException { + return sendEmailVerificationCall(emailtemplate, verificationurl, clientguid, accessToken, _callback); + + } + + /** + * Send verification Email for social profile linking + * Sends a verification Email to the unverified Email of the social profile. This is applicable only in optional verification workflows. + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param clientguid Client GUID for the request. (optional) + * @param accessToken Access Token of the User (optional) + * @return SendEmailVerificationResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Email Verification request successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid parameters or missing required fields. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - Insufficient permissions to perform this action. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - An unexpected error occurred. </td><td> - </td></tr> + </table> + */ + public SendEmailVerificationResponse sendEmailVerification(String emailtemplate, String verificationurl, String clientguid, String accessToken) throws ApiException { + ApiResponse<SendEmailVerificationResponse> localVarResp = sendEmailVerificationWithHttpInfo(emailtemplate, verificationurl, clientguid, accessToken); + return localVarResp.getData(); + } + + /** + * Send verification Email for social profile linking + * Sends a verification Email to the unverified Email of the social profile. This is applicable only in optional verification workflows. + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param clientguid Client GUID for the request. (optional) + * @param accessToken Access Token of the User (optional) + * @return ApiResponse<SendEmailVerificationResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Email Verification request successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid parameters or missing required fields. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - Insufficient permissions to perform this action. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - An unexpected error occurred. </td><td> - </td></tr> + </table> + */ + public ApiResponse<SendEmailVerificationResponse> sendEmailVerificationWithHttpInfo(String emailtemplate, String verificationurl, String clientguid, String accessToken) throws ApiException { + okhttp3.Call localVarCall = sendEmailVerificationValidateBeforeCall(emailtemplate, verificationurl, clientguid, accessToken, null); + Type localVarReturnType = new TypeToken<SendEmailVerificationResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Send verification Email for social profile linking (asynchronously) + * Sends a verification Email to the unverified Email of the social profile. This is applicable only in optional verification workflows. + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param clientguid Client GUID for the request. (optional) + * @param accessToken Access Token of the User (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Email Verification request successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request - Invalid parameters or missing required fields. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden - Insufficient permissions to perform this action. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error - An unexpected error occurred. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call sendEmailVerificationAsync(String emailtemplate, String verificationurl, String clientguid, String accessToken, final ApiCallback<SendEmailVerificationResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = sendEmailVerificationValidateBeforeCall(emailtemplate, verificationurl, clientguid, accessToken, _callback); + Type localVarReturnType = new TypeToken<SendEmailVerificationResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for sendWelcomeEmail + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param accessToken Access Token of the User (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: Invalid request parameters </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: Access denied </td><td> - </td></tr> + </table> + */ + public okhttp3.Call sendWelcomeEmailCall(String welcomeemailtemplate, String accessToken, 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 = "/identity/v2/auth/account/sendwelcomeemail"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (welcomeemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("welcomeemailtemplate", welcomeemailtemplate)); + } + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + 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[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call sendWelcomeEmailValidateBeforeCall(String welcomeemailtemplate, String accessToken, final ApiCallback _callback) throws ApiException { + return sendWelcomeEmailCall(welcomeemailtemplate, accessToken, _callback); + + } + + /** + * Send Welcome Email + * Sends a welcome Email to the User. + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param accessToken Access Token of the User (optional) + * @return IsPostedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: Invalid request parameters </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: Access denied </td><td> - </td></tr> + </table> + */ + public IsPostedResponse sendWelcomeEmail(String welcomeemailtemplate, String accessToken) throws ApiException { + ApiResponse<IsPostedResponse> localVarResp = sendWelcomeEmailWithHttpInfo(welcomeemailtemplate, accessToken); + return localVarResp.getData(); + } + + /** + * Send Welcome Email + * Sends a welcome Email to the User. + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param accessToken Access Token of the User (optional) + * @return ApiResponse<IsPostedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: Invalid request parameters </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: Access denied </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedResponse> sendWelcomeEmailWithHttpInfo(String welcomeemailtemplate, String accessToken) throws ApiException { + okhttp3.Call localVarCall = sendWelcomeEmailValidateBeforeCall(welcomeemailtemplate, accessToken, null); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Send Welcome Email (asynchronously) + * Sends a welcome Email to the User. + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param accessToken Access Token of the User (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: Invalid request parameters </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: Access denied </td><td> - </td></tr> + </table> + */ + public okhttp3.Call sendWelcomeEmailAsync(String welcomeemailtemplate, String accessToken, final ApiCallback<IsPostedResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = sendWelcomeEmailValidateBeforeCall(welcomeemailtemplate, accessToken, _callback); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for setorchangeusernamebyaccesstoken + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param setUserNameRequest (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call setorchangeusernamebyaccesstokenCall(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, SetUserNameRequest setUserNameRequest, 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 = setUserNameRequest; + + // create path and map variables + String localVarPath = "/identity/v2/auth/username"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call setorchangeusernamebyaccesstokenValidateBeforeCall(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, SetUserNameRequest setUserNameRequest, final ApiCallback _callback) throws ApiException { + return setorchangeusernamebyaccesstokenCall(accessToken, preventWebhook, xPreventWebhook, setUserNameRequest, _callback); + + } + + /** + * Update Username + * Sets or changes the User's Username using the Access Token. + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param setUserNameRequest (optional) + * @return IsPostedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public IsPostedResponse setorchangeusernamebyaccesstoken(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, SetUserNameRequest setUserNameRequest) throws ApiException { + ApiResponse<IsPostedResponse> localVarResp = setorchangeusernamebyaccesstokenWithHttpInfo(accessToken, preventWebhook, xPreventWebhook, setUserNameRequest); + return localVarResp.getData(); + } + + /** + * Update Username + * Sets or changes the User's Username using the Access Token. + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param setUserNameRequest (optional) + * @return ApiResponse<IsPostedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedResponse> setorchangeusernamebyaccesstokenWithHttpInfo(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, SetUserNameRequest setUserNameRequest) throws ApiException { + okhttp3.Call localVarCall = setorchangeusernamebyaccesstokenValidateBeforeCall(accessToken, preventWebhook, xPreventWebhook, setUserNameRequest, null); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Username (asynchronously) + * Sets or changes the User's Username using the Access Token. + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param setUserNameRequest (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call setorchangeusernamebyaccesstokenAsync(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, SetUserNameRequest setUserNameRequest, final ApiCallback<IsPostedResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = setorchangeusernamebyaccesstokenValidateBeforeCall(accessToken, preventWebhook, xPreventWebhook, setUserNameRequest, _callback); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for submitConsentByAccessToken + * @param consentSubmit (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call submitConsentByAccessTokenCall(ConsentSubmit consentSubmit, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, 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 = consentSubmit; + + // create path and map variables + String localVarPath = "/identity/v2/auth/consent/profile"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call submitConsentByAccessTokenValidateBeforeCall(ConsentSubmit consentSubmit, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'consentSubmit' is set + if (consentSubmit == null) { + throw new ApiException("Missing the required parameter 'consentSubmit' when calling submitConsentByAccessToken(Async)"); + } + + return submitConsentByAccessTokenCall(consentSubmit, accessToken, preventWebhook, xPreventWebhook, _callback); + + } + + /** + * Submit Consent + * Submits User consent information using an Access Token. + * @param consentSubmit (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return Profile + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public Profile submitConsentByAccessToken(ConsentSubmit consentSubmit, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + ApiResponse<Profile> localVarResp = submitConsentByAccessTokenWithHttpInfo(consentSubmit, accessToken, preventWebhook, xPreventWebhook); + return localVarResp.getData(); + } + + /** + * Submit Consent + * Submits User consent information using an Access Token. + * @param consentSubmit (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<Profile> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<Profile> submitConsentByAccessTokenWithHttpInfo(ConsentSubmit consentSubmit, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + okhttp3.Call localVarCall = submitConsentByAccessTokenValidateBeforeCall(consentSubmit, accessToken, preventWebhook, xPreventWebhook, null); + Type localVarReturnType = new TypeToken<Profile>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Submit Consent (asynchronously) + * Submits User consent information using an Access Token. + * @param consentSubmit (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call submitConsentByAccessTokenAsync(ConsentSubmit consentSubmit, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback<Profile> _callback) throws ApiException { + + okhttp3.Call localVarCall = submitConsentByAccessTokenValidateBeforeCall(consentSubmit, accessToken, preventWebhook, xPreventWebhook, _callback); + Type localVarReturnType = new TypeToken<Profile>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for submitConsentByConsentToken + * @param consenttoken The consent token for the User. (required) + * @param consentSubmit (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call submitConsentByConsentTokenCall(String consenttoken, ConsentSubmit consentSubmit, Boolean preventWebhook, Boolean xPreventWebhook, 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 = consentSubmit; + + // create path and map variables + String localVarPath = "/identity/v2/auth/consent"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (consenttoken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("consenttoken", consenttoken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call submitConsentByConsentTokenValidateBeforeCall(String consenttoken, ConsentSubmit consentSubmit, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'consenttoken' is set + if (consenttoken == null) { + throw new ApiException("Missing the required parameter 'consenttoken' when calling submitConsentByConsentToken(Async)"); + } + + // verify the required parameter 'consentSubmit' is set + if (consentSubmit == null) { + throw new ApiException("Missing the required parameter 'consentSubmit' when calling submitConsentByConsentToken(Async)"); + } + + return submitConsentByConsentTokenCall(consenttoken, consentSubmit, preventWebhook, xPreventWebhook, _callback); + + } + + /** + * Submit Consent with Token + * Submits User consent information using a consent token. + * @param consenttoken The consent token for the User. (required) + * @param consentSubmit (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ConsentResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ConsentResponse submitConsentByConsentToken(String consenttoken, ConsentSubmit consentSubmit, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + ApiResponse<ConsentResponse> localVarResp = submitConsentByConsentTokenWithHttpInfo(consenttoken, consentSubmit, preventWebhook, xPreventWebhook); + return localVarResp.getData(); + } + + /** + * Submit Consent with Token + * Submits User consent information using a consent token. + * @param consenttoken The consent token for the User. (required) + * @param consentSubmit (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<ConsentResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<ConsentResponse> submitConsentByConsentTokenWithHttpInfo(String consenttoken, ConsentSubmit consentSubmit, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + okhttp3.Call localVarCall = submitConsentByConsentTokenValidateBeforeCall(consenttoken, consentSubmit, preventWebhook, xPreventWebhook, null); + Type localVarReturnType = new TypeToken<ConsentResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Submit Consent with Token (asynchronously) + * Submits User consent information using a consent token. + * @param consenttoken The consent token for the User. (required) + * @param consentSubmit (required) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call submitConsentByConsentTokenAsync(String consenttoken, ConsentSubmit consentSubmit, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback<ConsentResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = submitConsentByConsentTokenValidateBeforeCall(consenttoken, consentSubmit, preventWebhook, xPreventWebhook, _callback); + Type localVarReturnType = new TypeToken<ConsentResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for unlinkSocialIdentitiesByAccessToken + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param unlinkSocialIdentityRequest (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> successful operation </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call unlinkSocialIdentitiesByAccessTokenCall(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, UnlinkSocialIdentityRequest unlinkSocialIdentityRequest, 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 = unlinkSocialIdentityRequest; + + // create path and map variables + String localVarPath = "/identity/v2/auth/socialidentity"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call unlinkSocialIdentitiesByAccessTokenValidateBeforeCall(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, UnlinkSocialIdentityRequest unlinkSocialIdentityRequest, final ApiCallback _callback) throws ApiException { + return unlinkSocialIdentitiesByAccessTokenCall(accessToken, preventWebhook, xPreventWebhook, unlinkSocialIdentityRequest, _callback); + + } + + /** + * Unlink social identities + * Unlinks a social provider account from the specified Account using Access Tokens, removing it from the database. + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param unlinkSocialIdentityRequest (optional) + * @return IsDeleted + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> successful operation </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public IsDeleted unlinkSocialIdentitiesByAccessToken(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, UnlinkSocialIdentityRequest unlinkSocialIdentityRequest) throws ApiException { + ApiResponse<IsDeleted> localVarResp = unlinkSocialIdentitiesByAccessTokenWithHttpInfo(accessToken, preventWebhook, xPreventWebhook, unlinkSocialIdentityRequest); + return localVarResp.getData(); + } + + /** + * Unlink social identities + * Unlinks a social provider account from the specified Account using Access Tokens, removing it from the database. + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param unlinkSocialIdentityRequest (optional) + * @return ApiResponse<IsDeleted> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> successful operation </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsDeleted> unlinkSocialIdentitiesByAccessTokenWithHttpInfo(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, UnlinkSocialIdentityRequest unlinkSocialIdentityRequest) throws ApiException { + okhttp3.Call localVarCall = unlinkSocialIdentitiesByAccessTokenValidateBeforeCall(accessToken, preventWebhook, xPreventWebhook, unlinkSocialIdentityRequest, null); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Unlink social identities (asynchronously) + * Unlinks a social provider account from the specified Account using Access Tokens, removing it from the database. + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param unlinkSocialIdentityRequest (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> successful operation </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call unlinkSocialIdentitiesByAccessTokenAsync(String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, UnlinkSocialIdentityRequest unlinkSocialIdentityRequest, final ApiCallback<IsDeleted> _callback) throws ApiException { + + okhttp3.Call localVarCall = unlinkSocialIdentitiesByAccessTokenValidateBeforeCall(accessToken, preventWebhook, xPreventWebhook, unlinkSocialIdentityRequest, _callback); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for unlockaccountbyaccesstoken + * @param unlockaccountbyaccesstokenRequest (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Request Forbidden </td><td> - </td></tr> + </table> + */ + public okhttp3.Call unlockaccountbyaccesstokenCall(UnlockaccountbyaccesstokenRequest unlockaccountbyaccesstokenRequest, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, String gRecaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, 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 = unlockaccountbyaccesstokenRequest; + + // create path and map variables + String localVarPath = "/identity/v2/auth/account/unlock"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call unlockaccountbyaccesstokenValidateBeforeCall(UnlockaccountbyaccesstokenRequest unlockaccountbyaccesstokenRequest, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, String gRecaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'unlockaccountbyaccesstokenRequest' is set + if (unlockaccountbyaccesstokenRequest == null) { + throw new ApiException("Missing the required parameter 'unlockaccountbyaccesstokenRequest' when calling unlockaccountbyaccesstoken(Async)"); + } + + return unlockaccountbyaccesstokenCall(unlockaccountbyaccesstokenRequest, accessToken, preventWebhook, xPreventWebhook, gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + + } + + /** + * Unlock User + * Unlocks a User's Account with a valid Access Token after successfully passing Bot Protection challenges. + * @param unlockaccountbyaccesstokenRequest (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return IsPostedResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Request Forbidden </td><td> - </td></tr> + </table> + */ + public IsPostedResponse unlockaccountbyaccesstoken(UnlockaccountbyaccesstokenRequest unlockaccountbyaccesstokenRequest, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, String gRecaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + ApiResponse<IsPostedResponse> localVarResp = unlockaccountbyaccesstokenWithHttpInfo(unlockaccountbyaccesstokenRequest, accessToken, preventWebhook, xPreventWebhook, gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse); + return localVarResp.getData(); + } + + /** + * Unlock User + * Unlocks a User's Account with a valid Access Token after successfully passing Bot Protection challenges. + * @param unlockaccountbyaccesstokenRequest (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @return ApiResponse<IsPostedResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Request Forbidden </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsPostedResponse> unlockaccountbyaccesstokenWithHttpInfo(UnlockaccountbyaccesstokenRequest unlockaccountbyaccesstokenRequest, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, String gRecaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse) throws ApiException { + okhttp3.Call localVarCall = unlockaccountbyaccesstokenValidateBeforeCall(unlockaccountbyaccesstokenRequest, accessToken, preventWebhook, xPreventWebhook, gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, null); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Unlock User (asynchronously) + * Unlocks a User's Account with a valid Access Token after successfully passing Bot Protection challenges. + * @param unlockaccountbyaccesstokenRequest (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Request Forbidden </td><td> - </td></tr> + </table> + */ + public okhttp3.Call unlockaccountbyaccesstokenAsync(UnlockaccountbyaccesstokenRequest unlockaccountbyaccesstokenRequest, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, String gRecaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, final ApiCallback<IsPostedResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = unlockaccountbyaccesstokenValidateBeforeCall(unlockaccountbyaccesstokenRequest, accessToken, preventWebhook, xPreventWebhook, gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, _callback); + Type localVarReturnType = new TypeToken<IsPostedResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateAccountByAccessToken + * @param updateAccountByAccessTokenRequest (required) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param smstemplate SMS Template (optional) + * @param nullsupport Bool flag, if this flag is sent as true then the fields which are send in payload as null then in the profile as well that will be saved as null only (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param accessToken Access Token of the User (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> successful operation </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateAccountByAccessTokenCall(UpdateAccountByAccessTokenRequest updateAccountByAccessTokenRequest, String verificationurl, String emailtemplate, String smstemplate, Boolean nullsupport, Boolean isvoiceotp, String fields, String gRecaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, Boolean preventWebhook, Boolean xPreventWebhook, String accessToken, 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 = updateAccountByAccessTokenRequest; + + // create path and map variables + String localVarPath = "/identity/v2/auth/account"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (verificationurl != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("verificationurl", verificationurl)); + } + + if (emailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("emailtemplate", emailtemplate)); + } + + if (smstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("smstemplate", smstemplate)); + } + + if (nullsupport != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("nullsupport", nullsupport)); + } + + if (isvoiceotp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("isvoiceotp", isvoiceotp)); + } + + if (fields != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("fields", fields)); + } + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateAccountByAccessTokenValidateBeforeCall(UpdateAccountByAccessTokenRequest updateAccountByAccessTokenRequest, String verificationurl, String emailtemplate, String smstemplate, Boolean nullsupport, Boolean isvoiceotp, String fields, String gRecaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, Boolean preventWebhook, Boolean xPreventWebhook, String accessToken, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'updateAccountByAccessTokenRequest' is set + if (updateAccountByAccessTokenRequest == null) { + throw new ApiException("Missing the required parameter 'updateAccountByAccessTokenRequest' when calling updateAccountByAccessToken(Async)"); + } + + return updateAccountByAccessTokenCall(updateAccountByAccessTokenRequest, verificationurl, emailtemplate, smstemplate, nullsupport, isvoiceotp, fields, gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, preventWebhook, xPreventWebhook, accessToken, _callback); + + } + + /** + * Update User + * Updates the User's account information using a valid Access Token. + * @param updateAccountByAccessTokenRequest (required) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param smstemplate SMS Template (optional) + * @param nullsupport Bool flag, if this flag is sent as true then the fields which are send in payload as null then in the profile as well that will be saved as null only (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param accessToken Access Token of the User (optional) + * @return UpdateByTokenResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> successful operation </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public UpdateByTokenResponse updateAccountByAccessToken(UpdateAccountByAccessTokenRequest updateAccountByAccessTokenRequest, String verificationurl, String emailtemplate, String smstemplate, Boolean nullsupport, Boolean isvoiceotp, String fields, String gRecaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, Boolean preventWebhook, Boolean xPreventWebhook, String accessToken) throws ApiException { + ApiResponse<UpdateByTokenResponse> localVarResp = updateAccountByAccessTokenWithHttpInfo(updateAccountByAccessTokenRequest, verificationurl, emailtemplate, smstemplate, nullsupport, isvoiceotp, fields, gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, preventWebhook, xPreventWebhook, accessToken); + return localVarResp.getData(); + } + + /** + * Update User + * Updates the User's account information using a valid Access Token. + * @param updateAccountByAccessTokenRequest (required) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param smstemplate SMS Template (optional) + * @param nullsupport Bool flag, if this flag is sent as true then the fields which are send in payload as null then in the profile as well that will be saved as null only (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param accessToken Access Token of the User (optional) + * @return ApiResponse<UpdateByTokenResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> successful operation </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<UpdateByTokenResponse> updateAccountByAccessTokenWithHttpInfo(UpdateAccountByAccessTokenRequest updateAccountByAccessTokenRequest, String verificationurl, String emailtemplate, String smstemplate, Boolean nullsupport, Boolean isvoiceotp, String fields, String gRecaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, Boolean preventWebhook, Boolean xPreventWebhook, String accessToken) throws ApiException { + okhttp3.Call localVarCall = updateAccountByAccessTokenValidateBeforeCall(updateAccountByAccessTokenRequest, verificationurl, emailtemplate, smstemplate, nullsupport, isvoiceotp, fields, gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, preventWebhook, xPreventWebhook, accessToken, null); + Type localVarReturnType = new TypeToken<UpdateByTokenResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update User (asynchronously) + * Updates the User's account information using a valid Access Token. + * @param updateAccountByAccessTokenRequest (required) + * @param verificationurl Verification URL for the User which will be included in the Email template.. (optional) + * @param emailtemplate Name of the Email template to use for this notification. (optional) + * @param smstemplate SMS Template (optional) + * @param nullsupport Bool flag, if this flag is sent as true then the fields which are send in payload as null then in the profile as well that will be saved as null only (optional) + * @param isvoiceotp Boolean flag to enforce sending SMS content via Voice. (optional) + * @param fields Comma-separated list of profile fields to include in the response. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param accessToken Access Token of the User (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> successful operation </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateAccountByAccessTokenAsync(UpdateAccountByAccessTokenRequest updateAccountByAccessTokenRequest, String verificationurl, String emailtemplate, String smstemplate, Boolean nullsupport, Boolean isvoiceotp, String fields, String gRecaptchaResponse, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, Boolean preventWebhook, Boolean xPreventWebhook, String accessToken, final ApiCallback<UpdateByTokenResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateAccountByAccessTokenValidateBeforeCall(updateAccountByAccessTokenRequest, verificationurl, emailtemplate, smstemplate, nullsupport, isvoiceotp, fields, gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, preventWebhook, xPreventWebhook, accessToken, _callback); + Type localVarReturnType = new TypeToken<UpdateByTokenResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateConsentByAccessToken + * @param consentUpdate (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateConsentByAccessTokenCall(ConsentUpdate consentUpdate, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, 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 = consentUpdate; + + // create path and map variables + String localVarPath = "/identity/v2/auth/consent"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateConsentByAccessTokenValidateBeforeCall(ConsentUpdate consentUpdate, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'consentUpdate' is set + if (consentUpdate == null) { + throw new ApiException("Missing the required parameter 'consentUpdate' when calling updateConsentByAccessToken(Async)"); + } + + return updateConsentByAccessTokenCall(consentUpdate, accessToken, preventWebhook, xPreventWebhook, _callback); + + } + + /** + * Update Consent Profile + * Updates the consent profile using an Access Token. + * @param consentUpdate (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ConsentProfile + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ConsentProfile updateConsentByAccessToken(ConsentUpdate consentUpdate, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + ApiResponse<ConsentProfile> localVarResp = updateConsentByAccessTokenWithHttpInfo(consentUpdate, accessToken, preventWebhook, xPreventWebhook); + return localVarResp.getData(); + } + + /** + * Update Consent Profile + * Updates the consent profile using an Access Token. + * @param consentUpdate (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<ConsentProfile> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<ConsentProfile> updateConsentByAccessTokenWithHttpInfo(ConsentUpdate consentUpdate, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook) throws ApiException { + okhttp3.Call localVarCall = updateConsentByAccessTokenValidateBeforeCall(consentUpdate, accessToken, preventWebhook, xPreventWebhook, null); + Type localVarReturnType = new TypeToken<ConsentProfile>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Consent Profile (asynchronously) + * Updates the consent profile using an Access Token. + * @param consentUpdate (required) + * @param accessToken Access Token of the User (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Status OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request was invalid or cannot be served. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateConsentByAccessTokenAsync(ConsentUpdate consentUpdate, String accessToken, Boolean preventWebhook, Boolean xPreventWebhook, final ApiCallback<ConsentProfile> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateConsentByAccessTokenValidateBeforeCall(consentUpdate, accessToken, preventWebhook, xPreventWebhook, _callback); + Type localVarReturnType = new TypeToken<ConsentProfile>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateEmail + * @param url URL to log the main domain in the database. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param updateEmailRequest (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Email existence check response </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateEmailCall(String url, String welcomeemailtemplate, Boolean preventWebhook, Boolean xPreventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, UpdateEmailRequest updateEmailRequest, 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 = updateEmailRequest; + + // create path and map variables + String localVarPath = "/identity/v2/auth/email"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (url != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("url", url)); + } + + if (welcomeemailtemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("welcomeemailtemplate", welcomeemailtemplate)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (gRecaptchaResponse2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g_recaptcha_response", gRecaptchaResponse2)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "BearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateEmailValidateBeforeCall(String url, String welcomeemailtemplate, Boolean preventWebhook, Boolean xPreventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, UpdateEmailRequest updateEmailRequest, final ApiCallback _callback) throws ApiException { + return updateEmailCall(url, welcomeemailtemplate, preventWebhook, xPreventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, updateEmailRequest, _callback); + + } + + /** + * Verify Email + * Verifies the User's Email when OTP Email Verification is enabled, requiring LoginRadius activation. + * @param url URL to log the main domain in the database. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param updateEmailRequest (optional) + * @return UpdateEmail200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Email existence check response </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public UpdateEmail200Response updateEmail(String url, String welcomeemailtemplate, Boolean preventWebhook, Boolean xPreventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, UpdateEmailRequest updateEmailRequest) throws ApiException { + ApiResponse<UpdateEmail200Response> localVarResp = updateEmailWithHttpInfo(url, welcomeemailtemplate, preventWebhook, xPreventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, updateEmailRequest); + return localVarResp.getData(); + } + + /** + * Verify Email + * Verifies the User's Email when OTP Email Verification is enabled, requiring LoginRadius activation. + * @param url URL to log the main domain in the database. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param updateEmailRequest (optional) + * @return ApiResponse<UpdateEmail200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Email existence check response </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public ApiResponse<UpdateEmail200Response> updateEmailWithHttpInfo(String url, String welcomeemailtemplate, Boolean preventWebhook, Boolean xPreventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, UpdateEmailRequest updateEmailRequest) throws ApiException { + okhttp3.Call localVarCall = updateEmailValidateBeforeCall(url, welcomeemailtemplate, preventWebhook, xPreventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, updateEmailRequest, null); + Type localVarReturnType = new TypeToken<UpdateEmail200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Verify Email (asynchronously) + * Verifies the User's Email when OTP Email Verification is enabled, requiring LoginRadius activation. + * @param url URL to log the main domain in the database. (optional) + * @param welcomeemailtemplate Welcome Email Template (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param updateEmailRequest (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Email existence check response </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 401 </td><td> Status Unauthorized: The request requires User authentication. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The server understood the request, but refuses to authorize it. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateEmailAsync(String url, String welcomeemailtemplate, Boolean preventWebhook, Boolean xPreventWebhook, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, UpdateEmailRequest updateEmailRequest, final ApiCallback<UpdateEmail200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateEmailValidateBeforeCall(url, welcomeemailtemplate, preventWebhook, xPreventWebhook, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, updateEmailRequest, _callback); + Type localVarReturnType = new TypeToken<UpdateEmail200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for verifyPhoneOtp + * @param verifyOtpPhoneModel (required) + * @param otp One-time passcode sent to the User's Email. (optional) + * @param smstemplate SMS Template (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param accessToken Access Token of the User (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call verifyPhoneOtpCall(VerifyOtpPhoneModel verifyOtpPhoneModel, String otp, String smstemplate, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, String accessToken, Boolean xPreventWebhook, Boolean preventWebhook, 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 = verifyOtpPhoneModel; + + // create path and map variables + String localVarPath = "/identity/v2/auth/phone/otp"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + if (otp != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("otp", otp)); + } + + if (smstemplate != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("smstemplate", smstemplate)); + } + + if (gRecaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g-recaptcha-response", gRecaptchaResponse)); + } + + if (gRecaptchaResponse2 != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("g_recaptcha_response", gRecaptchaResponse2)); + } + + if (qqCaptchaTicket != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_ticket", qqCaptchaTicket)); + } + + if (qqCaptchaRandstr != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("qq_captcha_randstr", qqCaptchaRandstr)); + } + + if (hCaptchaResponse != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("h-captcha-response", hCaptchaResponse)); + } + + if (accessToken != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("access_token", accessToken)); + } + + if (preventWebhook != null) { + localVarQueryParams.addAll(localVarApiClient.parameterToPair("prevent_webhook", preventWebhook)); + } + + 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); + } + + if (xPreventWebhook != null) { + localVarHeaderParams.put("X-PreventWebhook", localVarApiClient.parameterToString(xPreventWebhook)); + } + + + String[] localVarAuthNames = new String[] { "APIKey", "ClientId" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call verifyPhoneOtpValidateBeforeCall(VerifyOtpPhoneModel verifyOtpPhoneModel, String otp, String smstemplate, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, String accessToken, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'verifyOtpPhoneModel' is set + if (verifyOtpPhoneModel == null) { + throw new ApiException("Missing the required parameter 'verifyOtpPhoneModel' when calling verifyPhoneOtp(Async)"); + } + + return verifyPhoneOtpCall(verifyOtpPhoneModel, otp, smstemplate, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, accessToken, xPreventWebhook, preventWebhook, _callback); + + } + + /** + * Verify Phone + * Validates the verification code sent to confirm a User's Phone number when the User is logged in and provides an Access Token. + * @param verifyOtpPhoneModel (required) + * @param otp One-time passcode sent to the User's Email. (optional) + * @param smstemplate SMS Template (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param accessToken Access Token of the User (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return VerifyPhoneOtp200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public VerifyPhoneOtp200Response verifyPhoneOtp(VerifyOtpPhoneModel verifyOtpPhoneModel, String otp, String smstemplate, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, String accessToken, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + ApiResponse<VerifyPhoneOtp200Response> localVarResp = verifyPhoneOtpWithHttpInfo(verifyOtpPhoneModel, otp, smstemplate, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, accessToken, xPreventWebhook, preventWebhook); + return localVarResp.getData(); + } + + /** + * Verify Phone + * Validates the verification code sent to confirm a User's Phone number when the User is logged in and provides an Access Token. + * @param verifyOtpPhoneModel (required) + * @param otp One-time passcode sent to the User's Email. (optional) + * @param smstemplate SMS Template (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param accessToken Access Token of the User (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @return ApiResponse<VerifyPhoneOtp200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<VerifyPhoneOtp200Response> verifyPhoneOtpWithHttpInfo(VerifyOtpPhoneModel verifyOtpPhoneModel, String otp, String smstemplate, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, String accessToken, Boolean xPreventWebhook, Boolean preventWebhook) throws ApiException { + okhttp3.Call localVarCall = verifyPhoneOtpValidateBeforeCall(verifyOtpPhoneModel, otp, smstemplate, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, accessToken, xPreventWebhook, preventWebhook, null); + Type localVarReturnType = new TypeToken<VerifyPhoneOtp200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Verify Phone (asynchronously) + * Validates the verification code sent to confirm a User's Phone number when the User is logged in and provides an Access Token. + * @param verifyOtpPhoneModel (required) + * @param otp One-time passcode sent to the User's Email. (optional) + * @param smstemplate SMS Template (optional) + * @param gRecaptchaResponse Google reCAPTCHA response parameter which will be sent to the server for verification. (optional) + * @param gRecaptchaResponse2 Google reCAPTCHA Response (optional) + * @param qqCaptchaTicket QQ reCAPTCHA Response (optional) + * @param qqCaptchaRandstr QQ reCAPTCHA Response (optional) + * @param hCaptchaResponse hCaptcha Response (optional) + * @param accessToken Access Token of the User (optional) + * @param xPreventWebhook When true, suppresses webhook events for this operation. (optional) + * @param preventWebhook When true, suppresses webhook events for this operation. (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Status Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call verifyPhoneOtpAsync(VerifyOtpPhoneModel verifyOtpPhoneModel, String otp, String smstemplate, String gRecaptchaResponse, String gRecaptchaResponse2, String qqCaptchaTicket, String qqCaptchaRandstr, String hCaptchaResponse, String accessToken, Boolean xPreventWebhook, Boolean preventWebhook, final ApiCallback<VerifyPhoneOtp200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = verifyPhoneOtpValidateBeforeCall(verifyOtpPhoneModel, otp, smstemplate, gRecaptchaResponse, gRecaptchaResponse2, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, accessToken, xPreventWebhook, preventWebhook, _callback); + Type localVarReturnType = new TypeToken<VerifyPhoneOtp200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/UserMigrationApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/UserMigrationApi.java new file mode 100644 index 0000000..0805088 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/UserMigrationApi.java @@ -0,0 +1,217 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.BatchUpload; +import com.loginradius.sdk.internal.openapi.model.BatchUploadErrorResponse; +import com.loginradius.sdk.internal.openapi.model.BatchUploadResponse; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class UserMigrationApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public UserMigrationApi() { + this(Configuration.getDefaultApiClient()); + } + + public UserMigrationApi(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 batchUpload + * @param batchUpload (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call batchUploadCall(BatchUpload batchUpload, final ApiCallback _callback) throws ApiException { + String basePath = null; + // Operation Servers + String[] localBasePaths = new String[] { "https://migration.loginradius.com/v2" }; + + // Determine Base Path to Use + if (localCustomBaseUrl != null){ + basePath = localCustomBaseUrl; + } else if ( localBasePaths.length > 0 ) { + basePath = localBasePaths[localHostIndex]; + } else { + basePath = null; + } + + Object localVarPostBody = batchUpload; + + // create path and map variables + String localVarPath = "/bulk/upsert"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "APIKey", "APISecret" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call batchUploadValidateBeforeCall(BatchUpload batchUpload, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'batchUpload' is set + if (batchUpload == null) { + throw new ApiException("Missing the required parameter 'batchUpload' when calling batchUpload(Async)"); + } + + return batchUploadCall(batchUpload, _callback); + + } + + /** + * Batch upload Users + * Uploads an array of Users with optional Password and migration configuration. + * @param batchUpload (required) + * @return BatchUploadResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public BatchUploadResponse batchUpload(BatchUpload batchUpload) throws ApiException { + ApiResponse<BatchUploadResponse> localVarResp = batchUploadWithHttpInfo(batchUpload); + return localVarResp.getData(); + } + + /** + * Batch upload Users + * Uploads an array of Users with optional Password and migration configuration. + * @param batchUpload (required) + * @return ApiResponse<BatchUploadResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<BatchUploadResponse> batchUploadWithHttpInfo(BatchUpload batchUpload) throws ApiException { + okhttp3.Call localVarCall = batchUploadValidateBeforeCall(batchUpload, null); + Type localVarReturnType = new TypeToken<BatchUploadResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Batch upload Users (asynchronously) + * Uploads an array of Users with optional Password and migration configuration. + * @param batchUpload (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call batchUploadAsync(BatchUpload batchUpload, final ApiCallback<BatchUploadResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = batchUploadValidateBeforeCall(batchUpload, _callback); + Type localVarReturnType = new TypeToken<BatchUploadResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/WebhooksApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/WebhooksApi.java new file mode 100644 index 0000000..ac9cdab --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/WebhooksApi.java @@ -0,0 +1,903 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.DeleteResponse; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.WebhookEvents; +import com.loginradius.sdk.internal.openapi.model.WebhookSubscription; +import com.loginradius.sdk.internal.openapi.model.WebhookSubscriptionCreateModel; +import com.loginradius.sdk.internal.openapi.model.WebhookSubscriptionResponse; +import com.loginradius.sdk.internal.openapi.model.WebhookSubscriptionUpdateModel; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class WebhooksApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public WebhooksApi() { + this(Configuration.getDefaultApiClient()); + } + + public WebhooksApi(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 createWebhookConfiguration + * @param webhookSubscriptionCreateModel (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createWebhookConfigurationCall(WebhookSubscriptionCreateModel webhookSubscriptionCreateModel, 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 = webhookSubscriptionCreateModel; + + // create path and map variables + String localVarPath = "/v2/manage/webhooks"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call createWebhookConfigurationValidateBeforeCall(WebhookSubscriptionCreateModel webhookSubscriptionCreateModel, final ApiCallback _callback) throws ApiException { + return createWebhookConfigurationCall(webhookSubscriptionCreateModel, _callback); + + } + + /** + * Create webhook configuration + * Creates a new webhook configuration for the Tenant, allowing registration of a webhook with details such as the Target URL and subscribed events. + * @param webhookSubscriptionCreateModel (optional) + * @return WebhookSubscription + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public WebhookSubscription createWebhookConfiguration(WebhookSubscriptionCreateModel webhookSubscriptionCreateModel) throws ApiException { + ApiResponse<WebhookSubscription> localVarResp = createWebhookConfigurationWithHttpInfo(webhookSubscriptionCreateModel); + return localVarResp.getData(); + } + + /** + * Create webhook configuration + * Creates a new webhook configuration for the Tenant, allowing registration of a webhook with details such as the Target URL and subscribed events. + * @param webhookSubscriptionCreateModel (optional) + * @return ApiResponse<WebhookSubscription> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<WebhookSubscription> createWebhookConfigurationWithHttpInfo(WebhookSubscriptionCreateModel webhookSubscriptionCreateModel) throws ApiException { + okhttp3.Call localVarCall = createWebhookConfigurationValidateBeforeCall(webhookSubscriptionCreateModel, null); + Type localVarReturnType = new TypeToken<WebhookSubscription>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Create webhook configuration (asynchronously) + * Creates a new webhook configuration for the Tenant, allowing registration of a webhook with details such as the Target URL and subscribed events. + * @param webhookSubscriptionCreateModel (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call createWebhookConfigurationAsync(WebhookSubscriptionCreateModel webhookSubscriptionCreateModel, final ApiCallback<WebhookSubscription> _callback) throws ApiException { + + okhttp3.Call localVarCall = createWebhookConfigurationValidateBeforeCall(webhookSubscriptionCreateModel, _callback); + Type localVarReturnType = new TypeToken<WebhookSubscription>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteWebhookConfigurationById + * @param hookId Webhook ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteWebhookConfigurationByIdCall(String hookId, 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 = "/v2/manage/webhooks/{hookId}" + .replace("{" + "hookId" + "}", localVarApiClient.escapeString(hookId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteWebhookConfigurationByIdValidateBeforeCall(String hookId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'hookId' is set + if (hookId == null) { + throw new ApiException("Missing the required parameter 'hookId' when calling deleteWebhookConfigurationById(Async)"); + } + + return deleteWebhookConfigurationByIdCall(hookId, _callback); + + } + + /** + * Delete webhook configuration + * Deletes a specific webhook configuration for the Tenant using its unique ID, permanently removing the webhook from receiving further event notifications. + * @param hookId Webhook ID (required) + * @return DeleteResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public DeleteResponse deleteWebhookConfigurationById(String hookId) throws ApiException { + ApiResponse<DeleteResponse> localVarResp = deleteWebhookConfigurationByIdWithHttpInfo(hookId); + return localVarResp.getData(); + } + + /** + * Delete webhook configuration + * Deletes a specific webhook configuration for the Tenant using its unique ID, permanently removing the webhook from receiving further event notifications. + * @param hookId Webhook ID (required) + * @return ApiResponse<DeleteResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DeleteResponse> deleteWebhookConfigurationByIdWithHttpInfo(String hookId) throws ApiException { + okhttp3.Call localVarCall = deleteWebhookConfigurationByIdValidateBeforeCall(hookId, null); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete webhook configuration (asynchronously) + * Deletes a specific webhook configuration for the Tenant using its unique ID, permanently removing the webhook from receiving further event notifications. + * @param hookId Webhook ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteWebhookConfigurationByIdAsync(String hookId, final ApiCallback<DeleteResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteWebhookConfigurationByIdValidateBeforeCall(hookId, _callback); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAllEvents + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllEventsCall(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 = "/v2/manage/webhooks/events"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAllEventsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getAllEventsCall(_callback); + + } + + /** + * List webhook events + * Retrieves a list of all available webhook events that can be subscribed to by the Tenant for configuring webhooks to receive notifications for specific activities. + * @return WebhookEvents + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public WebhookEvents getAllEvents() throws ApiException { + ApiResponse<WebhookEvents> localVarResp = getAllEventsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List webhook events + * Retrieves a list of all available webhook events that can be subscribed to by the Tenant for configuring webhooks to receive notifications for specific activities. + * @return ApiResponse<WebhookEvents> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<WebhookEvents> getAllEventsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getAllEventsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<WebhookEvents>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List webhook events (asynchronously) + * Retrieves a list of all available webhook events that can be subscribed to by the Tenant for configuring webhooks to receive notifications for specific activities. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllEventsAsync(final ApiCallback<WebhookEvents> _callback) throws ApiException { + + okhttp3.Call localVarCall = getAllEventsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<WebhookEvents>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAllWebhooksConfigurations + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllWebhooksConfigurationsCall(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 = "/v2/manage/webhooks"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAllWebhooksConfigurationsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getAllWebhooksConfigurationsCall(_callback); + + } + + /** + * List webhook configurations + * Retrieves a list of all configured webhooks for the Tenant, including detailed information about each webhook and its subscribed events. + * @return WebhookSubscriptionResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public WebhookSubscriptionResponse getAllWebhooksConfigurations() throws ApiException { + ApiResponse<WebhookSubscriptionResponse> localVarResp = getAllWebhooksConfigurationsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List webhook configurations + * Retrieves a list of all configured webhooks for the Tenant, including detailed information about each webhook and its subscribed events. + * @return ApiResponse<WebhookSubscriptionResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<WebhookSubscriptionResponse> getAllWebhooksConfigurationsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getAllWebhooksConfigurationsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<WebhookSubscriptionResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List webhook configurations (asynchronously) + * Retrieves a list of all configured webhooks for the Tenant, including detailed information about each webhook and its subscribed events. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllWebhooksConfigurationsAsync(final ApiCallback<WebhookSubscriptionResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getAllWebhooksConfigurationsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<WebhookSubscriptionResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getWebhookConfigurationById + * @param hookId Webhook ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getWebhookConfigurationByIdCall(String hookId, 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 = "/v2/manage/webhooks/{hookId}" + .replace("{" + "hookId" + "}", localVarApiClient.escapeString(hookId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getWebhookConfigurationByIdValidateBeforeCall(String hookId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'hookId' is set + if (hookId == null) { + throw new ApiException("Missing the required parameter 'hookId' when calling getWebhookConfigurationById(Async)"); + } + + return getWebhookConfigurationByIdCall(hookId, _callback); + + } + + /** + * Retrieve webhook configuration + * Retrieves the details of a specific webhook configuration for the Tenant by its unique ID, including the Target URL, subscribed events, and other settings. + * @param hookId Webhook ID (required) + * @return WebhookSubscription + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public WebhookSubscription getWebhookConfigurationById(String hookId) throws ApiException { + ApiResponse<WebhookSubscription> localVarResp = getWebhookConfigurationByIdWithHttpInfo(hookId); + return localVarResp.getData(); + } + + /** + * Retrieve webhook configuration + * Retrieves the details of a specific webhook configuration for the Tenant by its unique ID, including the Target URL, subscribed events, and other settings. + * @param hookId Webhook ID (required) + * @return ApiResponse<WebhookSubscription> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public ApiResponse<WebhookSubscription> getWebhookConfigurationByIdWithHttpInfo(String hookId) throws ApiException { + okhttp3.Call localVarCall = getWebhookConfigurationByIdValidateBeforeCall(hookId, null); + Type localVarReturnType = new TypeToken<WebhookSubscription>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve webhook configuration (asynchronously) + * Retrieves the details of a specific webhook configuration for the Tenant by its unique ID, including the Target URL, subscribed events, and other settings. + * @param hookId Webhook ID (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getWebhookConfigurationByIdAsync(String hookId, final ApiCallback<WebhookSubscription> _callback) throws ApiException { + + okhttp3.Call localVarCall = getWebhookConfigurationByIdValidateBeforeCall(hookId, _callback); + Type localVarReturnType = new TypeToken<WebhookSubscription>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateWebhookConfigurationById + * @param hookId Webhook ID (required) + * @param webhookSubscriptionUpdateModel (optional) + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateWebhookConfigurationByIdCall(String hookId, WebhookSubscriptionUpdateModel webhookSubscriptionUpdateModel, 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 = webhookSubscriptionUpdateModel; + + // create path and map variables + String localVarPath = "/v2/manage/webhooks/{hookId}" + .replace("{" + "hookId" + "}", localVarApiClient.escapeString(hookId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateWebhookConfigurationByIdValidateBeforeCall(String hookId, WebhookSubscriptionUpdateModel webhookSubscriptionUpdateModel, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'hookId' is set + if (hookId == null) { + throw new ApiException("Missing the required parameter 'hookId' when calling updateWebhookConfigurationById(Async)"); + } + + return updateWebhookConfigurationByIdCall(hookId, webhookSubscriptionUpdateModel, _callback); + + } + + /** + * Update webhook configuration + * Updates an existing webhook configuration for the Tenant by its unique ID, modifying details such as the Target URL, subscribed events, or other settings. + * @param hookId Webhook ID (required) + * @param webhookSubscriptionUpdateModel (optional) + * @return WebhookSubscription + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public WebhookSubscription updateWebhookConfigurationById(String hookId, WebhookSubscriptionUpdateModel webhookSubscriptionUpdateModel) throws ApiException { + ApiResponse<WebhookSubscription> localVarResp = updateWebhookConfigurationByIdWithHttpInfo(hookId, webhookSubscriptionUpdateModel); + return localVarResp.getData(); + } + + /** + * Update webhook configuration + * Updates an existing webhook configuration for the Tenant by its unique ID, modifying details such as the Target URL, subscribed events, or other settings. + * @param hookId Webhook ID (required) + * @param webhookSubscriptionUpdateModel (optional) + * @return ApiResponse<WebhookSubscription> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<WebhookSubscription> updateWebhookConfigurationByIdWithHttpInfo(String hookId, WebhookSubscriptionUpdateModel webhookSubscriptionUpdateModel) throws ApiException { + okhttp3.Call localVarCall = updateWebhookConfigurationByIdValidateBeforeCall(hookId, webhookSubscriptionUpdateModel, null); + Type localVarReturnType = new TypeToken<WebhookSubscription>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update webhook configuration (asynchronously) + * Updates an existing webhook configuration for the Tenant by its unique ID, modifying details such as the Target URL, subscribed events, or other settings. + * @param hookId Webhook ID (required) + * @param webhookSubscriptionUpdateModel (optional) + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not Found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateWebhookConfigurationByIdAsync(String hookId, WebhookSubscriptionUpdateModel webhookSubscriptionUpdateModel, final ApiCallback<WebhookSubscription> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateWebhookConfigurationByIdValidateBeforeCall(hookId, webhookSubscriptionUpdateModel, _callback); + Type localVarReturnType = new TypeToken<WebhookSubscription>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/api/WorkflowsApi.java b/src/main/java/com/loginradius/sdk/internal/openapi/api/WorkflowsApi.java new file mode 100644 index 0000000..f4c192f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/api/WorkflowsApi.java @@ -0,0 +1,1239 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.api; + +import com.loginradius.sdk.internal.openapi.ApiCallback; +import com.loginradius.sdk.internal.openapi.ApiClient; +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.ApiResponse; +import com.loginradius.sdk.internal.openapi.Configuration; +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ProgressRequestBody; +import com.loginradius.sdk.internal.openapi.ProgressResponseBody; + +import com.google.gson.reflect.TypeToken; + +import java.io.IOException; + + +import com.loginradius.sdk.internal.openapi.model.AddWorkflowConfig; +import com.loginradius.sdk.internal.openapi.model.DeleteResponse; +import com.loginradius.sdk.internal.openapi.model.ErrorResponse; +import com.loginradius.sdk.internal.openapi.model.GetAllWorkflows200Response; +import com.loginradius.sdk.internal.openapi.model.IsDeleted; +import com.loginradius.sdk.internal.openapi.model.RestoreWorkflowVersion200Response; +import com.loginradius.sdk.internal.openapi.model.UpdateWorkflowConfig; +import com.loginradius.sdk.internal.openapi.model.VersionListResponse; +import com.loginradius.sdk.internal.openapi.model.WorkflowConfig; + +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class WorkflowsApi { + private ApiClient localVarApiClient; + private int localHostIndex; + private String localCustomBaseUrl; + + public WorkflowsApi() { + this(Configuration.getDefaultApiClient()); + } + + public WorkflowsApi(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 addWorkflow + * @param addWorkflowConfig (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call addWorkflowCall(AddWorkflowConfig addWorkflowConfig, 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 = addWorkflowConfig; + + // create path and map variables + String localVarPath = "/v2/manage/workflows"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "POST", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call addWorkflowValidateBeforeCall(AddWorkflowConfig addWorkflowConfig, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'addWorkflowConfig' is set + if (addWorkflowConfig == null) { + throw new ApiException("Missing the required parameter 'addWorkflowConfig' when calling addWorkflow(Async)"); + } + + return addWorkflowCall(addWorkflowConfig, _callback); + + } + + /** + * Add workflow + * Adds a new workflow configuration to the Tenant. + * @param addWorkflowConfig (required) + * @return WorkflowConfig + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public WorkflowConfig addWorkflow(AddWorkflowConfig addWorkflowConfig) throws ApiException { + ApiResponse<WorkflowConfig> localVarResp = addWorkflowWithHttpInfo(addWorkflowConfig); + return localVarResp.getData(); + } + + /** + * Add workflow + * Adds a new workflow configuration to the Tenant. + * @param addWorkflowConfig (required) + * @return ApiResponse<WorkflowConfig> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<WorkflowConfig> addWorkflowWithHttpInfo(AddWorkflowConfig addWorkflowConfig) throws ApiException { + okhttp3.Call localVarCall = addWorkflowValidateBeforeCall(addWorkflowConfig, null); + Type localVarReturnType = new TypeToken<WorkflowConfig>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Add workflow (asynchronously) + * Adds a new workflow configuration to the Tenant. + * @param addWorkflowConfig (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call addWorkflowAsync(AddWorkflowConfig addWorkflowConfig, final ApiCallback<WorkflowConfig> _callback) throws ApiException { + + okhttp3.Call localVarCall = addWorkflowValidateBeforeCall(addWorkflowConfig, _callback); + Type localVarReturnType = new TypeToken<WorkflowConfig>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteWorkflow + * @param workflowId The ID of the workflow. (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteWorkflowCall(String workflowId, 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 = "/v2/manage/workflows/{workflowId}" + .replace("{" + "workflowId" + "}", localVarApiClient.escapeString(workflowId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteWorkflowValidateBeforeCall(String workflowId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workflowId' is set + if (workflowId == null) { + throw new ApiException("Missing the required parameter 'workflowId' when calling deleteWorkflow(Async)"); + } + + return deleteWorkflowCall(workflowId, _callback); + + } + + /** + * Delete Workflow + * Deletes an existing Workflow from the system. + * @param workflowId The ID of the workflow. (required) + * @return DeleteResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public DeleteResponse deleteWorkflow(String workflowId) throws ApiException { + ApiResponse<DeleteResponse> localVarResp = deleteWorkflowWithHttpInfo(workflowId); + return localVarResp.getData(); + } + + /** + * Delete Workflow + * Deletes an existing Workflow from the system. + * @param workflowId The ID of the workflow. (required) + * @return ApiResponse<DeleteResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<DeleteResponse> deleteWorkflowWithHttpInfo(String workflowId) throws ApiException { + okhttp3.Call localVarCall = deleteWorkflowValidateBeforeCall(workflowId, null); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Workflow (asynchronously) + * Deletes an existing Workflow from the system. + * @param workflowId The ID of the workflow. (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteWorkflowAsync(String workflowId, final ApiCallback<DeleteResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteWorkflowValidateBeforeCall(workflowId, _callback); + Type localVarReturnType = new TypeToken<DeleteResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for deleteWorkflowVersion + * @param workflowId The ID of the workflow. (required) + * @param version The version identifier to delete. (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Workflow version deleted successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Invalid workflow id. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Workflow version not found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal server error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteWorkflowVersionCall(String workflowId, String version, 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 = "/v2/manage/workflows/{workflowId}/versions/{version}" + .replace("{" + "workflowId" + "}", localVarApiClient.escapeString(workflowId.toString())) + .replace("{" + "version" + "}", localVarApiClient.escapeString(version.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call deleteWorkflowVersionValidateBeforeCall(String workflowId, String version, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workflowId' is set + if (workflowId == null) { + throw new ApiException("Missing the required parameter 'workflowId' when calling deleteWorkflowVersion(Async)"); + } + + // verify the required parameter 'version' is set + if (version == null) { + throw new ApiException("Missing the required parameter 'version' when calling deleteWorkflowVersion(Async)"); + } + + return deleteWorkflowVersionCall(workflowId, version, _callback); + + } + + /** + * Delete Workflow Version + * Deletes a specific version of a Workflow from the system. + * @param workflowId The ID of the workflow. (required) + * @param version The version identifier to delete. (required) + * @return IsDeleted + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Workflow version deleted successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Invalid workflow id. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Workflow version not found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal server error. </td><td> - </td></tr> + </table> + */ + public IsDeleted deleteWorkflowVersion(String workflowId, String version) throws ApiException { + ApiResponse<IsDeleted> localVarResp = deleteWorkflowVersionWithHttpInfo(workflowId, version); + return localVarResp.getData(); + } + + /** + * Delete Workflow Version + * Deletes a specific version of a Workflow from the system. + * @param workflowId The ID of the workflow. (required) + * @param version The version identifier to delete. (required) + * @return ApiResponse<IsDeleted> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Workflow version deleted successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Invalid workflow id. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Workflow version not found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal server error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<IsDeleted> deleteWorkflowVersionWithHttpInfo(String workflowId, String version) throws ApiException { + okhttp3.Call localVarCall = deleteWorkflowVersionValidateBeforeCall(workflowId, version, null); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Delete Workflow Version (asynchronously) + * Deletes a specific version of a Workflow from the system. + * @param workflowId The ID of the workflow. (required) + * @param version The version identifier to delete. (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Workflow version deleted successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Invalid workflow id. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Workflow version not found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal server error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call deleteWorkflowVersionAsync(String workflowId, String version, final ApiCallback<IsDeleted> _callback) throws ApiException { + + okhttp3.Call localVarCall = deleteWorkflowVersionValidateBeforeCall(workflowId, version, _callback); + Type localVarReturnType = new TypeToken<IsDeleted>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAllWorkflowVersionList + * @param workflowId The ID of the workflow. (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> List of workflow versions. </td><td> - </td></tr> + <tr><td> 400 </td><td> Invalid workflow ID. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Workflow not found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal server error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllWorkflowVersionListCall(String workflowId, 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 = "/v2/manage/workflows/{workflowId}/versions" + .replace("{" + "workflowId" + "}", localVarApiClient.escapeString(workflowId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAllWorkflowVersionListValidateBeforeCall(String workflowId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workflowId' is set + if (workflowId == null) { + throw new ApiException("Missing the required parameter 'workflowId' when calling getAllWorkflowVersionList(Async)"); + } + + return getAllWorkflowVersionListCall(workflowId, _callback); + + } + + /** + * List Workflow Versions + * Returns a list of all available versions for a specified Workflow. + * @param workflowId The ID of the workflow. (required) + * @return VersionListResponse + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> List of workflow versions. </td><td> - </td></tr> + <tr><td> 400 </td><td> Invalid workflow ID. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Workflow not found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal server error. </td><td> - </td></tr> + </table> + */ + public VersionListResponse getAllWorkflowVersionList(String workflowId) throws ApiException { + ApiResponse<VersionListResponse> localVarResp = getAllWorkflowVersionListWithHttpInfo(workflowId); + return localVarResp.getData(); + } + + /** + * List Workflow Versions + * Returns a list of all available versions for a specified Workflow. + * @param workflowId The ID of the workflow. (required) + * @return ApiResponse<VersionListResponse> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> List of workflow versions. </td><td> - </td></tr> + <tr><td> 400 </td><td> Invalid workflow ID. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Workflow not found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal server error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<VersionListResponse> getAllWorkflowVersionListWithHttpInfo(String workflowId) throws ApiException { + okhttp3.Call localVarCall = getAllWorkflowVersionListValidateBeforeCall(workflowId, null); + Type localVarReturnType = new TypeToken<VersionListResponse>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List Workflow Versions (asynchronously) + * Returns a list of all available versions for a specified Workflow. + * @param workflowId The ID of the workflow. (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> List of workflow versions. </td><td> - </td></tr> + <tr><td> 400 </td><td> Invalid workflow ID. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Workflow not found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal server error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllWorkflowVersionListAsync(String workflowId, final ApiCallback<VersionListResponse> _callback) throws ApiException { + + okhttp3.Call localVarCall = getAllWorkflowVersionListValidateBeforeCall(workflowId, _callback); + Type localVarReturnType = new TypeToken<VersionListResponse>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getAllWorkflows + * @param _callback Callback for upload/download progress + * @return Call to execute + * @throws ApiException If fail to serialize the request body object + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllWorkflowsCall(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 = "/v2/manage/workflows"; + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getAllWorkflowsValidateBeforeCall(final ApiCallback _callback) throws ApiException { + return getAllWorkflowsCall(_callback); + + } + + /** + * List workflows + * Retrieves a list of all workflows configured for the Tenant. + * @return GetAllWorkflows200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public GetAllWorkflows200Response getAllWorkflows() throws ApiException { + ApiResponse<GetAllWorkflows200Response> localVarResp = getAllWorkflowsWithHttpInfo(); + return localVarResp.getData(); + } + + /** + * List workflows + * Retrieves a list of all workflows configured for the Tenant. + * @return ApiResponse<GetAllWorkflows200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<GetAllWorkflows200Response> getAllWorkflowsWithHttpInfo() throws ApiException { + okhttp3.Call localVarCall = getAllWorkflowsValidateBeforeCall(null); + Type localVarReturnType = new TypeToken<GetAllWorkflows200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * List workflows (asynchronously) + * Retrieves a list of all workflows configured for the Tenant. + * @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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getAllWorkflowsAsync(final ApiCallback<GetAllWorkflows200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = getAllWorkflowsValidateBeforeCall(_callback); + Type localVarReturnType = new TypeToken<GetAllWorkflows200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for getWorkflowById + * @param workflowId The ID of the workflow. (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getWorkflowByIdCall(String workflowId, 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 = "/v2/manage/workflows/{workflowId}" + .replace("{" + "workflowId" + "}", localVarApiClient.escapeString(workflowId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "GET", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call getWorkflowByIdValidateBeforeCall(String workflowId, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workflowId' is set + if (workflowId == null) { + throw new ApiException("Missing the required parameter 'workflowId' when calling getWorkflowById(Async)"); + } + + return getWorkflowByIdCall(workflowId, _callback); + + } + + /** + * Retrieve Workflow + * Retrieves details of a specific Workflow using its unique identifier. + * @param workflowId The ID of the workflow. (required) + * @return WorkflowConfig + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public WorkflowConfig getWorkflowById(String workflowId) throws ApiException { + ApiResponse<WorkflowConfig> localVarResp = getWorkflowByIdWithHttpInfo(workflowId); + return localVarResp.getData(); + } + + /** + * Retrieve Workflow + * Retrieves details of a specific Workflow using its unique identifier. + * @param workflowId The ID of the workflow. (required) + * @return ApiResponse<WorkflowConfig> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<WorkflowConfig> getWorkflowByIdWithHttpInfo(String workflowId) throws ApiException { + okhttp3.Call localVarCall = getWorkflowByIdValidateBeforeCall(workflowId, null); + Type localVarReturnType = new TypeToken<WorkflowConfig>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Retrieve Workflow (asynchronously) + * Retrieves details of a specific Workflow using its unique identifier. + * @param workflowId The ID of the workflow. (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call getWorkflowByIdAsync(String workflowId, final ApiCallback<WorkflowConfig> _callback) throws ApiException { + + okhttp3.Call localVarCall = getWorkflowByIdValidateBeforeCall(workflowId, _callback); + Type localVarReturnType = new TypeToken<WorkflowConfig>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for restoreWorkflowVersion + * @param workflowId The ID of the workflow. (required) + * @param version The version identifier to delete. (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Workflow version restored successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Invalid workflow id. </td><td> - </td></tr> + <tr><td> 403 </td><td> Unauthorized access to restore workflow version. </td><td> - </td></tr> + <tr><td> 404 </td><td> Workflow version not found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal server error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call restoreWorkflowVersionCall(String workflowId, String version, 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 = "/v2/manage/workflows/{workflowId}/versions/{version}" + .replace("{" + "workflowId" + "}", localVarApiClient.escapeString(workflowId.toString())) + .replace("{" + "version" + "}", localVarApiClient.escapeString(version.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call restoreWorkflowVersionValidateBeforeCall(String workflowId, String version, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workflowId' is set + if (workflowId == null) { + throw new ApiException("Missing the required parameter 'workflowId' when calling restoreWorkflowVersion(Async)"); + } + + // verify the required parameter 'version' is set + if (version == null) { + throw new ApiException("Missing the required parameter 'version' when calling restoreWorkflowVersion(Async)"); + } + + return restoreWorkflowVersionCall(workflowId, version, _callback); + + } + + /** + * Restore Workflow Version + * Restores a specific version of a Workflow to its active state. + * @param workflowId The ID of the workflow. (required) + * @param version The version identifier to delete. (required) + * @return RestoreWorkflowVersion200Response + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Workflow version restored successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Invalid workflow id. </td><td> - </td></tr> + <tr><td> 403 </td><td> Unauthorized access to restore workflow version. </td><td> - </td></tr> + <tr><td> 404 </td><td> Workflow version not found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal server error. </td><td> - </td></tr> + </table> + */ + public RestoreWorkflowVersion200Response restoreWorkflowVersion(String workflowId, String version) throws ApiException { + ApiResponse<RestoreWorkflowVersion200Response> localVarResp = restoreWorkflowVersionWithHttpInfo(workflowId, version); + return localVarResp.getData(); + } + + /** + * Restore Workflow Version + * Restores a specific version of a Workflow to its active state. + * @param workflowId The ID of the workflow. (required) + * @param version The version identifier to delete. (required) + * @return ApiResponse<RestoreWorkflowVersion200Response> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Workflow version restored successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Invalid workflow id. </td><td> - </td></tr> + <tr><td> 403 </td><td> Unauthorized access to restore workflow version. </td><td> - </td></tr> + <tr><td> 404 </td><td> Workflow version not found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal server error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<RestoreWorkflowVersion200Response> restoreWorkflowVersionWithHttpInfo(String workflowId, String version) throws ApiException { + okhttp3.Call localVarCall = restoreWorkflowVersionValidateBeforeCall(workflowId, version, null); + Type localVarReturnType = new TypeToken<RestoreWorkflowVersion200Response>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Restore Workflow Version (asynchronously) + * Restores a specific version of a Workflow to its active state. + * @param workflowId The ID of the workflow. (required) + * @param version The version identifier to delete. (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> Workflow version restored successfully. </td><td> - </td></tr> + <tr><td> 400 </td><td> Invalid workflow id. </td><td> - </td></tr> + <tr><td> 403 </td><td> Unauthorized access to restore workflow version. </td><td> - </td></tr> + <tr><td> 404 </td><td> Workflow version not found. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal server error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call restoreWorkflowVersionAsync(String workflowId, String version, final ApiCallback<RestoreWorkflowVersion200Response> _callback) throws ApiException { + + okhttp3.Call localVarCall = restoreWorkflowVersionValidateBeforeCall(workflowId, version, _callback); + Type localVarReturnType = new TypeToken<RestoreWorkflowVersion200Response>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } + /** + * Build call for updateWorkflow + * @param workflowId The ID of the workflow. (required) + * @param updateWorkflowConfig (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateWorkflowCall(String workflowId, UpdateWorkflowConfig updateWorkflowConfig, 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 = updateWorkflowConfig; + + // create path and map variables + String localVarPath = "/v2/manage/workflows/{workflowId}" + .replace("{" + "workflowId" + "}", localVarApiClient.escapeString(workflowId.toString())); + + List<Pair> localVarQueryParams = new ArrayList<Pair>(); + List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); + Map<String, String> localVarHeaderParams = new HashMap<String, String>(); + Map<String, String> localVarCookieParams = new HashMap<String, String>(); + Map<String, Object> localVarFormParams = new HashMap<String, Object>(); + + 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[] { "M2MBearerToken" }; + return localVarApiClient.buildCall(basePath, localVarPath, "PUT", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); + } + + @SuppressWarnings("rawtypes") + private okhttp3.Call updateWorkflowValidateBeforeCall(String workflowId, UpdateWorkflowConfig updateWorkflowConfig, final ApiCallback _callback) throws ApiException { + // verify the required parameter 'workflowId' is set + if (workflowId == null) { + throw new ApiException("Missing the required parameter 'workflowId' when calling updateWorkflow(Async)"); + } + + // verify the required parameter 'updateWorkflowConfig' is set + if (updateWorkflowConfig == null) { + throw new ApiException("Missing the required parameter 'updateWorkflowConfig' when calling updateWorkflow(Async)"); + } + + return updateWorkflowCall(workflowId, updateWorkflowConfig, _callback); + + } + + /** + * Update Workflow + * Updates the configuration of an existing Workflow. + * @param workflowId The ID of the workflow. (required) + * @param updateWorkflowConfig (required) + * @return WorkflowConfig + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public WorkflowConfig updateWorkflow(String workflowId, UpdateWorkflowConfig updateWorkflowConfig) throws ApiException { + ApiResponse<WorkflowConfig> localVarResp = updateWorkflowWithHttpInfo(workflowId, updateWorkflowConfig); + return localVarResp.getData(); + } + + /** + * Update Workflow + * Updates the configuration of an existing Workflow. + * @param workflowId The ID of the workflow. (required) + * @param updateWorkflowConfig (required) + * @return ApiResponse<WorkflowConfig> + * @throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body + * @http.response.details + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public ApiResponse<WorkflowConfig> updateWorkflowWithHttpInfo(String workflowId, UpdateWorkflowConfig updateWorkflowConfig) throws ApiException { + okhttp3.Call localVarCall = updateWorkflowValidateBeforeCall(workflowId, updateWorkflowConfig, null); + Type localVarReturnType = new TypeToken<WorkflowConfig>(){}.getType(); + return localVarApiClient.execute(localVarCall, localVarReturnType); + } + + /** + * Update Workflow (asynchronously) + * Updates the configuration of an existing Workflow. + * @param workflowId The ID of the workflow. (required) + * @param updateWorkflowConfig (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 + <table border="1"> + <caption>Response Details</caption> + <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> + <tr><td> 200 </td><td> OK: The request was successful. </td><td> - </td></tr> + <tr><td> 400 </td><td> Bad Request: The request could not be understood by the server due to malformed syntax. </td><td> - </td></tr> + <tr><td> 403 </td><td> Status Forbidden: The client does not have permission to access the resource. </td><td> - </td></tr> + <tr><td> 404 </td><td> Not found: The server cannot find the requested resource. </td><td> - </td></tr> + <tr><td> 409 </td><td> Conflict: The request could not be completed due to a conflict with the current state of the resource. </td><td> - </td></tr> + <tr><td> 500 </td><td> Internal Server Error: The server encountered an unexpected error. </td><td> - </td></tr> + </table> + */ + public okhttp3.Call updateWorkflowAsync(String workflowId, UpdateWorkflowConfig updateWorkflowConfig, final ApiCallback<WorkflowConfig> _callback) throws ApiException { + + okhttp3.Call localVarCall = updateWorkflowValidateBeforeCall(workflowId, updateWorkflowConfig, _callback); + Type localVarReturnType = new TypeToken<WorkflowConfig>(){}.getType(); + localVarApiClient.executeAsync(localVarCall, localVarReturnType, _callback); + return localVarCall; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/auth/ApiKeyAuth.java b/src/main/java/com/loginradius/sdk/internal/openapi/auth/ApiKeyAuth.java new file mode 100644 index 0000000..83411db --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/auth/ApiKeyAuth.java @@ -0,0 +1,80 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.auth; + +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.Pair; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ApiKeyAuth implements Authentication { + private final String location; + private final String paramName; + + private String apiKey; + private String apiKeyPrefix; + + public ApiKeyAuth(String location, String paramName) { + this.location = location; + this.paramName = paramName; + } + + public String getLocation() { + return location; + } + + public String getParamName() { + return paramName; + } + + public String getApiKey() { + return apiKey; + } + + public void setApiKey(String apiKey) { + this.apiKey = apiKey; + } + + public String getApiKeyPrefix() { + return apiKeyPrefix; + } + + public void setApiKeyPrefix(String apiKeyPrefix) { + this.apiKeyPrefix = apiKeyPrefix; + } + + @Override + public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams, + String payload, String method, URI uri) throws ApiException { + if (apiKey == null) { + return; + } + String value; + if (apiKeyPrefix != null) { + value = apiKeyPrefix + " " + apiKey; + } else { + value = apiKey; + } + if ("query".equals(location)) { + queryParams.add(new Pair(paramName, value)); + } else if ("header".equals(location)) { + headerParams.put(paramName, value); + } else if ("cookie".equals(location)) { + cookieParams.put(paramName, value); + } + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/auth/Authentication.java b/src/main/java/com/loginradius/sdk/internal/openapi/auth/Authentication.java new file mode 100644 index 0000000..4bdde4f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/auth/Authentication.java @@ -0,0 +1,36 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.auth; + +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ApiException; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public interface Authentication { + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param payload HTTP request body + * @param method HTTP method + * @param uri URI + * @throws ApiException if failed to update the parameters + */ + void applyToParams(List<Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams, String payload, String method, URI uri) throws ApiException; +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/auth/HttpBasicAuth.java b/src/main/java/com/loginradius/sdk/internal/openapi/auth/HttpBasicAuth.java new file mode 100644 index 0000000..0d9d113 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/auth/HttpBasicAuth.java @@ -0,0 +1,55 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.auth; + +import com.loginradius.sdk.internal.openapi.Pair; +import com.loginradius.sdk.internal.openapi.ApiException; + +import okhttp3.Credentials; + +import java.net.URI; +import java.util.Map; +import java.util.List; + +public class HttpBasicAuth implements Authentication { + private String username; + private String password; + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + @Override + public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams, + String payload, String method, URI uri) throws ApiException { + if (username == null && password == null) { + return; + } + headerParams.put("Authorization", Credentials.basic( + username == null ? "" : username, + password == null ? "" : password)); + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/auth/HttpBearerAuth.java b/src/main/java/com/loginradius/sdk/internal/openapi/auth/HttpBearerAuth.java new file mode 100644 index 0000000..8a11ec8 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/auth/HttpBearerAuth.java @@ -0,0 +1,75 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.auth; + +import com.loginradius.sdk.internal.openapi.ApiException; +import com.loginradius.sdk.internal.openapi.Pair; + +import java.net.URI; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.function.Supplier; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class HttpBearerAuth implements Authentication { + private final String scheme; + private Supplier<String> tokenSupplier; + + public HttpBearerAuth(String scheme) { + this.scheme = scheme; + } + + /** + * Gets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @return The bearer token + */ + public String getBearerToken() { + return tokenSupplier.get(); + } + + /** + * Sets the token, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param bearerToken The bearer token to send in the Authorization header + */ + public void setBearerToken(String bearerToken) { + this.tokenSupplier = () -> bearerToken; + } + + /** + * Sets the supplier of tokens, which together with the scheme, will be sent as the value of the Authorization header. + * + * @param tokenSupplier The supplier of bearer tokens to send in the Authorization header + */ + public void setBearerToken(Supplier<String> tokenSupplier) { + this.tokenSupplier = tokenSupplier; + } + + @Override + public void applyToParams(List<Pair> queryParams, Map<String, String> headerParams, Map<String, String> cookieParams, + String payload, String method, URI uri) throws ApiException { + String bearerToken = Optional.ofNullable(tokenSupplier).map(Supplier::get).orElse(null); + if (bearerToken == null) { + return; + } + + headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + } + + private static String upperCaseBearer(String scheme) { + return ("bearer".equalsIgnoreCase(scheme)) ? "Bearer" : scheme; + } +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/AWSPushConfig.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/AWSPushConfig.java new file mode 100644 index 0000000..72fa528 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/AWSPushConfig.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * AWSPushConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class AWSPushConfig { + public static final String SERIALIZED_NAME_ACCESS_KEY_ID = "AccessKeyId"; + @SerializedName(SERIALIZED_NAME_ACCESS_KEY_ID) + @javax.annotation.Nullable + private String accessKeyId; + + public static final String SERIALIZED_NAME_SECRET_ACCESS_KEY = "SecretAccessKey"; + @SerializedName(SERIALIZED_NAME_SECRET_ACCESS_KEY) + @javax.annotation.Nullable + private String secretAccessKey; + + public static final String SERIALIZED_NAME_REGION = "Region"; + @SerializedName(SERIALIZED_NAME_REGION) + @javax.annotation.Nullable + private String region; + + public AWSPushConfig() { + } + + public AWSPushConfig accessKeyId(@javax.annotation.Nullable String accessKeyId) { + this.accessKeyId = accessKeyId; + return this; + } + + /** + * AWS access key ID. + * @return accessKeyId + */ + @javax.annotation.Nullable + public String getAccessKeyId() { + return accessKeyId; + } + + public void setAccessKeyId(@javax.annotation.Nullable String accessKeyId) { + this.accessKeyId = accessKeyId; + } + + + public AWSPushConfig secretAccessKey(@javax.annotation.Nullable String secretAccessKey) { + this.secretAccessKey = secretAccessKey; + return this; + } + + /** + * AWS secret access key. + * @return secretAccessKey + */ + @javax.annotation.Nullable + public String getSecretAccessKey() { + return secretAccessKey; + } + + public void setSecretAccessKey(@javax.annotation.Nullable String secretAccessKey) { + this.secretAccessKey = secretAccessKey; + } + + + public AWSPushConfig region(@javax.annotation.Nullable String region) { + this.region = region; + return this; + } + + /** + * AWS region. + * @return region + */ + @javax.annotation.Nullable + public String getRegion() { + return region; + } + + public void setRegion(@javax.annotation.Nullable String region) { + this.region = region; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AWSPushConfig instance itself + */ + public AWSPushConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AWSPushConfig awSPushConfig = (AWSPushConfig) o; + return Objects.equals(this.accessKeyId, awSPushConfig.accessKeyId) && + Objects.equals(this.secretAccessKey, awSPushConfig.secretAccessKey) && + Objects.equals(this.region, awSPushConfig.region)&& + Objects.equals(this.additionalProperties, awSPushConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accessKeyId, secretAccessKey, region, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AWSPushConfig {\n"); + sb.append(" accessKeyId: ").append(toIndentedString(accessKeyId)).append("\n"); + sb.append(" secretAccessKey: ").append(toIndentedString(secretAccessKey)).append("\n"); + sb.append(" region: ").append(toIndentedString(region)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AccessKeyId"); + openapiFields.add("SecretAccessKey"); + openapiFields.add("Region"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 AWSPushConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AWSPushConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AWSPushConfig is not found in the empty JSON string", AWSPushConfig.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("AccessKeyId") != null && !jsonObj.get("AccessKeyId").isJsonNull()) && !jsonObj.get("AccessKeyId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccessKeyId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccessKeyId").toString())); + } + if ((jsonObj.get("SecretAccessKey") != null && !jsonObj.get("SecretAccessKey").isJsonNull()) && !jsonObj.get("SecretAccessKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SecretAccessKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SecretAccessKey").toString())); + } + if ((jsonObj.get("Region") != null && !jsonObj.get("Region").isJsonNull()) && !jsonObj.get("Region").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Region").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!AWSPushConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AWSPushConfig' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<AWSPushConfig> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AWSPushConfig.class)); + + return (TypeAdapter<T>) new TypeAdapter<AWSPushConfig>() { + @Override + public void write(JsonWriter out, AWSPushConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AWSPushConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AWSPushConfig instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AWSPushConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of AWSPushConfig + * @throws IOException if the JSON string is invalid with respect to AWSPushConfig + */ + public static AWSPushConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AWSPushConfig.class); + } + + /** + * Convert an instance of AWSPushConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/AbstractOpenApiSchema.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/AbstractOpenApiSchema.java new file mode 100644 index 0000000..f0981b1 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/AbstractOpenApiSchema.java @@ -0,0 +1,146 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import com.loginradius.sdk.internal.openapi.ApiException; +import java.util.Objects; +import java.lang.reflect.Type; +import java.util.Map; + +/** + * Abstract class for oneOf,anyOf schemas defined in OpenAPI spec + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public abstract class AbstractOpenApiSchema { + + // store the actual instance of the schema/object + private Object instance; + + // is nullable + private Boolean isNullable; + + // schema type (e.g. oneOf, anyOf) + private final String schemaType; + + public AbstractOpenApiSchema(String schemaType, Boolean isNullable) { + this.schemaType = schemaType; + this.isNullable = isNullable; + } + + /** + * Get the list of oneOf/anyOf composed schemas allowed to be stored in this object + * + * @return an instance of the actual schema/object + */ + public abstract Map<String, Class<?>> getSchemas(); + + /** + * Get the actual instance + * + * @return an instance of the actual schema/object + */ + //@JsonValue + public Object getActualInstance() {return instance;} + + /** + * Set the actual instance + * + * @param instance the actual instance of the schema/object + */ + public void setActualInstance(Object instance) {this.instance = instance;} + + /** + * Get the instant recursively when the schemas defined in oneOf/anyof happen to be oneOf/anyOf schema as well + * + * @return an instance of the actual schema/object + */ + public Object getActualInstanceRecursively() { + return getActualInstanceRecursively(this); + } + + private Object getActualInstanceRecursively(AbstractOpenApiSchema object) { + if (object.getActualInstance() == null) { + return null; + } else if (object.getActualInstance() instanceof AbstractOpenApiSchema) { + return getActualInstanceRecursively((AbstractOpenApiSchema)object.getActualInstance()); + } else { + return object.getActualInstance(); + } + } + + /** + * Get the schema type (e.g. anyOf, oneOf) + * + * @return the schema type + */ + public String getSchemaType() { + return schemaType; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ").append(getClass()).append(" {\n"); + sb.append(" instance: ").append(toIndentedString(instance)).append("\n"); + sb.append(" isNullable: ").append(toIndentedString(isNullable)).append("\n"); + sb.append(" schemaType: ").append(toIndentedString(schemaType)).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 boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AbstractOpenApiSchema a = (AbstractOpenApiSchema) o; + return Objects.equals(this.instance, a.instance) && + Objects.equals(this.isNullable, a.isNullable) && + Objects.equals(this.schemaType, a.schemaType); + } + + @Override + public int hashCode() { + return Objects.hash(instance, isNullable, schemaType); + } + + /** + * Is nullable + * + * @return true if it's nullable + */ + public Boolean isNullable() { + if (Boolean.TRUE.equals(isNullable)) { + return Boolean.TRUE; + } else { + return Boolean.FALSE; + } + } + + + +} diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/AccessToken.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/AccessToken.java new file mode 100644 index 0000000..b0614f2 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/AccessToken.java @@ -0,0 +1,389 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.AccessTokenSessionToken; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * AccessToken + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class AccessToken { + public static final String SERIALIZED_NAME_ACCESS_TOKEN = "access_token"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN) + @javax.annotation.Nullable + private String accessToken; + + public static final String SERIALIZED_NAME_REFRESH_TOKEN = "refresh_token"; + @SerializedName(SERIALIZED_NAME_REFRESH_TOKEN) + @javax.annotation.Nullable + private String refreshToken; + + public static final String SERIALIZED_NAME_EXPIRES_IN = "expires_in"; + @SerializedName(SERIALIZED_NAME_EXPIRES_IN) + @javax.annotation.Nullable + private OffsetDateTime expiresIn; + + public static final String SERIALIZED_NAME_SESSION_TOKEN = "SessionToken"; + @SerializedName(SERIALIZED_NAME_SESSION_TOKEN) + @javax.annotation.Nullable + private AccessTokenSessionToken sessionToken; + + public AccessToken() { + } + + public AccessToken accessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * The generated Access Token. + * @return accessToken + */ + @javax.annotation.Nullable + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + } + + + public AccessToken refreshToken(@javax.annotation.Nullable String refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + /** + * The refresh token associated with the Access Token. + * @return refreshToken + */ + @javax.annotation.Nullable + public String getRefreshToken() { + return refreshToken; + } + + public void setRefreshToken(@javax.annotation.Nullable String refreshToken) { + this.refreshToken = refreshToken; + } + + + public AccessToken expiresIn(@javax.annotation.Nullable OffsetDateTime expiresIn) { + this.expiresIn = expiresIn; + return this; + } + + /** + * The expiration time of the Access Token. + * @return expiresIn + */ + @javax.annotation.Nullable + public OffsetDateTime getExpiresIn() { + return expiresIn; + } + + public void setExpiresIn(@javax.annotation.Nullable OffsetDateTime expiresIn) { + this.expiresIn = expiresIn; + } + + + public AccessToken sessionToken(@javax.annotation.Nullable AccessTokenSessionToken sessionToken) { + this.sessionToken = sessionToken; + return this; + } + + /** + * Get sessionToken + * @return sessionToken + */ + @javax.annotation.Nullable + public AccessTokenSessionToken getSessionToken() { + return sessionToken; + } + + public void setSessionToken(@javax.annotation.Nullable AccessTokenSessionToken sessionToken) { + this.sessionToken = sessionToken; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AccessToken instance itself + */ + public AccessToken putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccessToken accessToken = (AccessToken) o; + return Objects.equals(this.accessToken, accessToken.accessToken) && + Objects.equals(this.refreshToken, accessToken.refreshToken) && + Objects.equals(this.expiresIn, accessToken.expiresIn) && + Objects.equals(this.sessionToken, accessToken.sessionToken)&& + Objects.equals(this.additionalProperties, accessToken.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(accessToken, refreshToken, expiresIn, sessionToken, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccessToken {\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" refreshToken: ").append(toIndentedString(refreshToken)).append("\n"); + sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n"); + sb.append(" sessionToken: ").append(toIndentedString(sessionToken)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("access_token"); + openapiFields.add("refresh_token"); + openapiFields.add("expires_in"); + openapiFields.add("SessionToken"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 AccessToken + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccessToken.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AccessToken is not found in the empty JSON string", AccessToken.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("access_token") != null && !jsonObj.get("access_token").isJsonNull()) && !jsonObj.get("access_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `access_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("access_token").toString())); + } + if ((jsonObj.get("refresh_token") != null && !jsonObj.get("refresh_token").isJsonNull()) && !jsonObj.get("refresh_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `refresh_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refresh_token").toString())); + } + // validate the optional field `SessionToken` + if (jsonObj.get("SessionToken") != null && !jsonObj.get("SessionToken").isJsonNull()) { + AccessTokenSessionToken.validateJsonElement(jsonObj.get("SessionToken")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!AccessToken.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccessToken' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<AccessToken> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AccessToken.class)); + + return (TypeAdapter<T>) new TypeAdapter<AccessToken>() { + @Override + public void write(JsonWriter out, AccessToken value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AccessToken read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AccessToken instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AccessToken given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccessToken + * @throws IOException if the JSON string is invalid with respect to AccessToken + */ + public static AccessToken fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccessToken.class); + } + + /** + * Convert an instance of AccessToken to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/AccessTokenByPingQRCodeResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/AccessTokenByPingQRCodeResponse.java new file mode 100644 index 0000000..ec8cbcd --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/AccessTokenByPingQRCodeResponse.java @@ -0,0 +1,299 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Access Token By Ping QR Code Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class AccessTokenByPingQRCodeResponse { + public static final String SERIALIZED_NAME_ACCESS_TOKEN = "access_token"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN) + @javax.annotation.Nullable + private String accessToken; + + public AccessTokenByPingQRCodeResponse() { + } + + public AccessTokenByPingQRCodeResponse accessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Get accessToken + * @return accessToken + */ + @javax.annotation.Nullable + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AccessTokenByPingQRCodeResponse instance itself + */ + public AccessTokenByPingQRCodeResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccessTokenByPingQRCodeResponse accessTokenByPingQRCodeResponse = (AccessTokenByPingQRCodeResponse) o; + return Objects.equals(this.accessToken, accessTokenByPingQRCodeResponse.accessToken)&& + Objects.equals(this.additionalProperties, accessTokenByPingQRCodeResponse.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(accessToken, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccessTokenByPingQRCodeResponse {\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("access_token"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 AccessTokenByPingQRCodeResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccessTokenByPingQRCodeResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AccessTokenByPingQRCodeResponse is not found in the empty JSON string", AccessTokenByPingQRCodeResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("access_token") != null && !jsonObj.get("access_token").isJsonNull()) && !jsonObj.get("access_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `access_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("access_token").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!AccessTokenByPingQRCodeResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccessTokenByPingQRCodeResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<AccessTokenByPingQRCodeResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AccessTokenByPingQRCodeResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<AccessTokenByPingQRCodeResponse>() { + @Override + public void write(JsonWriter out, AccessTokenByPingQRCodeResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AccessTokenByPingQRCodeResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AccessTokenByPingQRCodeResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AccessTokenByPingQRCodeResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccessTokenByPingQRCodeResponse + * @throws IOException if the JSON string is invalid with respect to AccessTokenByPingQRCodeResponse + */ + public static AccessTokenByPingQRCodeResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccessTokenByPingQRCodeResponse.class); + } + + /** + * Convert an instance of AccessTokenByPingQRCodeResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/AccessTokenInBody.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/AccessTokenInBody.java new file mode 100644 index 0000000..89f7090 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/AccessTokenInBody.java @@ -0,0 +1,287 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * AccessTokenInBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class AccessTokenInBody { + public static final String SERIALIZED_NAME_ACCESS_TOKEN = "access_token"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN) + @javax.annotation.Nullable + private String accessToken; + + public AccessTokenInBody() { + } + + public AccessTokenInBody accessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Access Token for authentication + * @return accessToken + */ + @javax.annotation.Nullable + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AccessTokenInBody instance itself + */ + public AccessTokenInBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccessTokenInBody accessTokenInBody = (AccessTokenInBody) o; + return Objects.equals(this.accessToken, accessTokenInBody.accessToken)&& + Objects.equals(this.additionalProperties, accessTokenInBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accessToken, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccessTokenInBody {\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("access_token"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 AccessTokenInBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccessTokenInBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AccessTokenInBody is not found in the empty JSON string", AccessTokenInBody.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("access_token") != null && !jsonObj.get("access_token").isJsonNull()) && !jsonObj.get("access_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `access_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("access_token").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!AccessTokenInBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccessTokenInBody' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<AccessTokenInBody> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AccessTokenInBody.class)); + + return (TypeAdapter<T>) new TypeAdapter<AccessTokenInBody>() { + @Override + public void write(JsonWriter out, AccessTokenInBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AccessTokenInBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AccessTokenInBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AccessTokenInBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccessTokenInBody + * @throws IOException if the JSON string is invalid with respect to AccessTokenInBody + */ + public static AccessTokenInBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccessTokenInBody.class); + } + + /** + * Convert an instance of AccessTokenInBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/AccessTokenInfo.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/AccessTokenInfo.java new file mode 100644 index 0000000..bf628f0 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/AccessTokenInfo.java @@ -0,0 +1,344 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * AccessTokenInfo + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class AccessTokenInfo { + public static final String SERIALIZED_NAME_PROVIDER = "provider"; + @SerializedName(SERIALIZED_NAME_PROVIDER) + @javax.annotation.Nullable + private String provider; + + public static final String SERIALIZED_NAME_ACCESS_TOKEN = "access_token"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN) + @javax.annotation.Nullable + private String accessToken; + + public static final String SERIALIZED_NAME_ISREMEMBERME = "isrememberme"; + @SerializedName(SERIALIZED_NAME_ISREMEMBERME) + @javax.annotation.Nullable + private Boolean isrememberme; + + public AccessTokenInfo() { + } + + public AccessTokenInfo provider(@javax.annotation.Nullable String provider) { + this.provider = provider; + return this; + } + + /** + * The provider for which the Access Token is issued. + * @return provider + */ + @javax.annotation.Nullable + public String getProvider() { + return provider; + } + + public void setProvider(@javax.annotation.Nullable String provider) { + this.provider = provider; + } + + + public AccessTokenInfo accessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * The Access Token associated with the provider. + * @return accessToken + */ + @javax.annotation.Nullable + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + } + + + public AccessTokenInfo isrememberme(@javax.annotation.Nullable Boolean isrememberme) { + this.isrememberme = isrememberme; + return this; + } + + /** + * Indicates whether the \"Remember Me\" option was selected during login. + * @return isrememberme + */ + @javax.annotation.Nullable + public Boolean getIsrememberme() { + return isrememberme; + } + + public void setIsrememberme(@javax.annotation.Nullable Boolean isrememberme) { + this.isrememberme = isrememberme; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AccessTokenInfo instance itself + */ + public AccessTokenInfo putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccessTokenInfo accessTokenInfo = (AccessTokenInfo) o; + return Objects.equals(this.provider, accessTokenInfo.provider) && + Objects.equals(this.accessToken, accessTokenInfo.accessToken) && + Objects.equals(this.isrememberme, accessTokenInfo.isrememberme)&& + Objects.equals(this.additionalProperties, accessTokenInfo.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(provider, accessToken, isrememberme, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccessTokenInfo {\n"); + sb.append(" provider: ").append(toIndentedString(provider)).append("\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" isrememberme: ").append(toIndentedString(isrememberme)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("provider"); + openapiFields.add("access_token"); + openapiFields.add("isrememberme"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 AccessTokenInfo + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccessTokenInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AccessTokenInfo is not found in the empty JSON string", AccessTokenInfo.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("provider") != null && !jsonObj.get("provider").isJsonNull()) && !jsonObj.get("provider").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `provider` to be a primitive type in the JSON string but got `%s`", jsonObj.get("provider").toString())); + } + if ((jsonObj.get("access_token") != null && !jsonObj.get("access_token").isJsonNull()) && !jsonObj.get("access_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `access_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("access_token").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!AccessTokenInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccessTokenInfo' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<AccessTokenInfo> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AccessTokenInfo.class)); + + return (TypeAdapter<T>) new TypeAdapter<AccessTokenInfo>() { + @Override + public void write(JsonWriter out, AccessTokenInfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AccessTokenInfo read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AccessTokenInfo instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AccessTokenInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccessTokenInfo + * @throws IOException if the JSON string is invalid with respect to AccessTokenInfo + */ + public static AccessTokenInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccessTokenInfo.class); + } + + /** + * Convert an instance of AccessTokenInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/AccessTokenResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/AccessTokenResponse.java new file mode 100644 index 0000000..8d48088 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/AccessTokenResponse.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * AccessTokenResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class AccessTokenResponse { + public static final String SERIALIZED_NAME_ACCESS_TOKEN = "access_token"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN) + @javax.annotation.Nullable + private String accessToken; + + public static final String SERIALIZED_NAME_REFRESH_TOKEN = "refresh_token"; + @SerializedName(SERIALIZED_NAME_REFRESH_TOKEN) + @javax.annotation.Nullable + private String refreshToken; + + public static final String SERIALIZED_NAME_EXPIRES_IN = "expires_in"; + @SerializedName(SERIALIZED_NAME_EXPIRES_IN) + @javax.annotation.Nullable + private String expiresIn; + + public AccessTokenResponse() { + } + + public AccessTokenResponse accessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Bearer token for authenticating API requests. + * @return accessToken + */ + @javax.annotation.Nullable + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + } + + + public AccessTokenResponse refreshToken(@javax.annotation.Nullable String refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + /** + * Long-lived token for obtaining new Access Tokens. + * @return refreshToken + */ + @javax.annotation.Nullable + public String getRefreshToken() { + return refreshToken; + } + + public void setRefreshToken(@javax.annotation.Nullable String refreshToken) { + this.refreshToken = refreshToken; + } + + + public AccessTokenResponse expiresIn(@javax.annotation.Nullable String expiresIn) { + this.expiresIn = expiresIn; + return this; + } + + /** + * Expiration time of the Access Token in seconds. + * @return expiresIn + */ + @javax.annotation.Nullable + public String getExpiresIn() { + return expiresIn; + } + + public void setExpiresIn(@javax.annotation.Nullable String expiresIn) { + this.expiresIn = expiresIn; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AccessTokenResponse instance itself + */ + public AccessTokenResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccessTokenResponse accessTokenResponse = (AccessTokenResponse) o; + return Objects.equals(this.accessToken, accessTokenResponse.accessToken) && + Objects.equals(this.refreshToken, accessTokenResponse.refreshToken) && + Objects.equals(this.expiresIn, accessTokenResponse.expiresIn)&& + Objects.equals(this.additionalProperties, accessTokenResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accessToken, refreshToken, expiresIn, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccessTokenResponse {\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" refreshToken: ").append(toIndentedString(refreshToken)).append("\n"); + sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("access_token"); + openapiFields.add("refresh_token"); + openapiFields.add("expires_in"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 AccessTokenResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccessTokenResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AccessTokenResponse is not found in the empty JSON string", AccessTokenResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("access_token") != null && !jsonObj.get("access_token").isJsonNull()) && !jsonObj.get("access_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `access_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("access_token").toString())); + } + if ((jsonObj.get("refresh_token") != null && !jsonObj.get("refresh_token").isJsonNull()) && !jsonObj.get("refresh_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `refresh_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refresh_token").toString())); + } + if ((jsonObj.get("expires_in") != null && !jsonObj.get("expires_in").isJsonNull()) && !jsonObj.get("expires_in").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `expires_in` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expires_in").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!AccessTokenResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccessTokenResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<AccessTokenResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AccessTokenResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<AccessTokenResponse>() { + @Override + public void write(JsonWriter out, AccessTokenResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AccessTokenResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AccessTokenResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AccessTokenResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccessTokenResponse + * @throws IOException if the JSON string is invalid with respect to AccessTokenResponse + */ + public static AccessTokenResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccessTokenResponse.class); + } + + /** + * Convert an instance of AccessTokenResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/AccessTokenSessionToken.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/AccessTokenSessionToken.java new file mode 100644 index 0000000..24e6cb0 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/AccessTokenSessionToken.java @@ -0,0 +1,315 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Session token details. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class AccessTokenSessionToken { + public static final String SERIALIZED_NAME_SESSION_TOKEN = "session_token"; + @SerializedName(SERIALIZED_NAME_SESSION_TOKEN) + @javax.annotation.Nullable + private String sessionToken; + + public static final String SERIALIZED_NAME_SESSION_EXPIRES_IN = "session_expires_in"; + @SerializedName(SERIALIZED_NAME_SESSION_EXPIRES_IN) + @javax.annotation.Nullable + private OffsetDateTime sessionExpiresIn; + + public AccessTokenSessionToken() { + } + + public AccessTokenSessionToken sessionToken(@javax.annotation.Nullable String sessionToken) { + this.sessionToken = sessionToken; + return this; + } + + /** + * The session token for specific features. + * @return sessionToken + */ + @javax.annotation.Nullable + public String getSessionToken() { + return sessionToken; + } + + public void setSessionToken(@javax.annotation.Nullable String sessionToken) { + this.sessionToken = sessionToken; + } + + + public AccessTokenSessionToken sessionExpiresIn(@javax.annotation.Nullable OffsetDateTime sessionExpiresIn) { + this.sessionExpiresIn = sessionExpiresIn; + return this; + } + + /** + * The expiration time of the session token. + * @return sessionExpiresIn + */ + @javax.annotation.Nullable + public OffsetDateTime getSessionExpiresIn() { + return sessionExpiresIn; + } + + public void setSessionExpiresIn(@javax.annotation.Nullable OffsetDateTime sessionExpiresIn) { + this.sessionExpiresIn = sessionExpiresIn; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AccessTokenSessionToken instance itself + */ + public AccessTokenSessionToken putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccessTokenSessionToken accessTokenSessionToken = (AccessTokenSessionToken) o; + return Objects.equals(this.sessionToken, accessTokenSessionToken.sessionToken) && + Objects.equals(this.sessionExpiresIn, accessTokenSessionToken.sessionExpiresIn)&& + Objects.equals(this.additionalProperties, accessTokenSessionToken.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(sessionToken, sessionExpiresIn, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccessTokenSessionToken {\n"); + sb.append(" sessionToken: ").append(toIndentedString(sessionToken)).append("\n"); + sb.append(" sessionExpiresIn: ").append(toIndentedString(sessionExpiresIn)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("session_token"); + openapiFields.add("session_expires_in"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 AccessTokenSessionToken + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccessTokenSessionToken.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AccessTokenSessionToken is not found in the empty JSON string", AccessTokenSessionToken.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("session_token") != null && !jsonObj.get("session_token").isJsonNull()) && !jsonObj.get("session_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `session_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("session_token").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!AccessTokenSessionToken.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccessTokenSessionToken' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<AccessTokenSessionToken> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AccessTokenSessionToken.class)); + + return (TypeAdapter<T>) new TypeAdapter<AccessTokenSessionToken>() { + @Override + public void write(JsonWriter out, AccessTokenSessionToken value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AccessTokenSessionToken read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AccessTokenSessionToken instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AccessTokenSessionToken given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccessTokenSessionToken + * @throws IOException if the JSON string is invalid with respect to AccessTokenSessionToken + */ + public static AccessTokenSessionToken fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccessTokenSessionToken.class); + } + + /** + * Convert an instance of AccessTokenSessionToken to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/AccountRegisterMFAPasskeyFinishRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/AccountRegisterMFAPasskeyFinishRequest.java new file mode 100644 index 0000000..786f801 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/AccountRegisterMFAPasskeyFinishRequest.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.PasskeyCredentialCreationResponse; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Passkey Credentials to finish Passkey registration (WebAuthn) + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class AccountRegisterMFAPasskeyFinishRequest { + public static final String SERIALIZED_NAME_PASSKEY_CREDENTIAL = "PasskeyCredential"; + @SerializedName(SERIALIZED_NAME_PASSKEY_CREDENTIAL) + @javax.annotation.Nonnull + private PasskeyCredentialCreationResponse passkeyCredential; + + public AccountRegisterMFAPasskeyFinishRequest() { + } + + public AccountRegisterMFAPasskeyFinishRequest passkeyCredential(@javax.annotation.Nonnull PasskeyCredentialCreationResponse passkeyCredential) { + this.passkeyCredential = passkeyCredential; + return this; + } + + /** + * Get passkeyCredential + * @return passkeyCredential + */ + @javax.annotation.Nonnull + public PasskeyCredentialCreationResponse getPasskeyCredential() { + return passkeyCredential; + } + + public void setPasskeyCredential(@javax.annotation.Nonnull PasskeyCredentialCreationResponse passkeyCredential) { + this.passkeyCredential = passkeyCredential; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AccountRegisterMFAPasskeyFinishRequest instance itself + */ + public AccountRegisterMFAPasskeyFinishRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AccountRegisterMFAPasskeyFinishRequest accountRegisterMFAPasskeyFinishRequest = (AccountRegisterMFAPasskeyFinishRequest) o; + return Objects.equals(this.passkeyCredential, accountRegisterMFAPasskeyFinishRequest.passkeyCredential)&& + Objects.equals(this.additionalProperties, accountRegisterMFAPasskeyFinishRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(passkeyCredential, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AccountRegisterMFAPasskeyFinishRequest {\n"); + sb.append(" passkeyCredential: ").append(toIndentedString(passkeyCredential)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("PasskeyCredential"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("PasskeyCredential"); + } + + /** + * 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 AccountRegisterMFAPasskeyFinishRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AccountRegisterMFAPasskeyFinishRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AccountRegisterMFAPasskeyFinishRequest is not found in the empty JSON string", AccountRegisterMFAPasskeyFinishRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AccountRegisterMFAPasskeyFinishRequest.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 `PasskeyCredential` + PasskeyCredentialCreationResponse.validateJsonElement(jsonObj.get("PasskeyCredential")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!AccountRegisterMFAPasskeyFinishRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AccountRegisterMFAPasskeyFinishRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<AccountRegisterMFAPasskeyFinishRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AccountRegisterMFAPasskeyFinishRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<AccountRegisterMFAPasskeyFinishRequest>() { + @Override + public void write(JsonWriter out, AccountRegisterMFAPasskeyFinishRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AccountRegisterMFAPasskeyFinishRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AccountRegisterMFAPasskeyFinishRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AccountRegisterMFAPasskeyFinishRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of AccountRegisterMFAPasskeyFinishRequest + * @throws IOException if the JSON string is invalid with respect to AccountRegisterMFAPasskeyFinishRequest + */ + public static AccountRegisterMFAPasskeyFinishRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AccountRegisterMFAPasskeyFinishRequest.class); + } + + /** + * Convert an instance of AccountRegisterMFAPasskeyFinishRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ActiveSession.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ActiveSession.java new file mode 100644 index 0000000..b176559 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ActiveSession.java @@ -0,0 +1,525 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ActiveSession + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ActiveSession { + public static final String SERIALIZED_NAME_ACCESS_TOKEN = "AccessToken"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN) + @javax.annotation.Nullable + private String accessToken; + + public static final String SERIALIZED_NAME_BROWSER = "Browser"; + @SerializedName(SERIALIZED_NAME_BROWSER) + @javax.annotation.Nullable + private String browser; + + public static final String SERIALIZED_NAME_DEVICE = "Device"; + @SerializedName(SERIALIZED_NAME_DEVICE) + @javax.annotation.Nullable + private String device; + + public static final String SERIALIZED_NAME_OS = "Os"; + @SerializedName(SERIALIZED_NAME_OS) + @javax.annotation.Nullable + private String os; + + public static final String SERIALIZED_NAME_DEVICE_TYPE = "DeviceType"; + @SerializedName(SERIALIZED_NAME_DEVICE_TYPE) + @javax.annotation.Nullable + private String deviceType; + + public static final String SERIALIZED_NAME_CITY = "City"; + @SerializedName(SERIALIZED_NAME_CITY) + @javax.annotation.Nullable + private String city; + + public static final String SERIALIZED_NAME_COUNTRY = "Country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + @javax.annotation.Nullable + private String country; + + public static final String SERIALIZED_NAME_IP = "Ip"; + @SerializedName(SERIALIZED_NAME_IP) + @javax.annotation.Nullable + private String ip; + + public static final String SERIALIZED_NAME_LOGIN_DATE = "LoginDate"; + @SerializedName(SERIALIZED_NAME_LOGIN_DATE) + @javax.annotation.Nullable + private OffsetDateTime loginDate; + + public ActiveSession() { + } + + public ActiveSession accessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Get accessToken + * @return accessToken + */ + @javax.annotation.Nullable + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + } + + + public ActiveSession browser(@javax.annotation.Nullable String browser) { + this.browser = browser; + return this; + } + + /** + * Get browser + * @return browser + */ + @javax.annotation.Nullable + public String getBrowser() { + return browser; + } + + public void setBrowser(@javax.annotation.Nullable String browser) { + this.browser = browser; + } + + + public ActiveSession device(@javax.annotation.Nullable String device) { + this.device = device; + return this; + } + + /** + * Get device + * @return device + */ + @javax.annotation.Nullable + public String getDevice() { + return device; + } + + public void setDevice(@javax.annotation.Nullable String device) { + this.device = device; + } + + + public ActiveSession os(@javax.annotation.Nullable String os) { + this.os = os; + return this; + } + + /** + * Get os + * @return os + */ + @javax.annotation.Nullable + public String getOs() { + return os; + } + + public void setOs(@javax.annotation.Nullable String os) { + this.os = os; + } + + + public ActiveSession deviceType(@javax.annotation.Nullable String deviceType) { + this.deviceType = deviceType; + return this; + } + + /** + * Get deviceType + * @return deviceType + */ + @javax.annotation.Nullable + public String getDeviceType() { + return deviceType; + } + + public void setDeviceType(@javax.annotation.Nullable String deviceType) { + this.deviceType = deviceType; + } + + + public ActiveSession city(@javax.annotation.Nullable String city) { + this.city = city; + return this; + } + + /** + * Get city + * @return city + */ + @javax.annotation.Nullable + public String getCity() { + return city; + } + + public void setCity(@javax.annotation.Nullable String city) { + this.city = city; + } + + + public ActiveSession country(@javax.annotation.Nullable String country) { + this.country = country; + return this; + } + + /** + * Get country + * @return country + */ + @javax.annotation.Nullable + public String getCountry() { + return country; + } + + public void setCountry(@javax.annotation.Nullable String country) { + this.country = country; + } + + + public ActiveSession ip(@javax.annotation.Nullable String ip) { + this.ip = ip; + return this; + } + + /** + * Get ip + * @return ip + */ + @javax.annotation.Nullable + public String getIp() { + return ip; + } + + public void setIp(@javax.annotation.Nullable String ip) { + this.ip = ip; + } + + + public ActiveSession loginDate(@javax.annotation.Nullable OffsetDateTime loginDate) { + this.loginDate = loginDate; + return this; + } + + /** + * Get loginDate + * @return loginDate + */ + @javax.annotation.Nullable + public OffsetDateTime getLoginDate() { + return loginDate; + } + + public void setLoginDate(@javax.annotation.Nullable OffsetDateTime loginDate) { + this.loginDate = loginDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ActiveSession instance itself + */ + public ActiveSession putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ActiveSession activeSession = (ActiveSession) o; + return Objects.equals(this.accessToken, activeSession.accessToken) && + Objects.equals(this.browser, activeSession.browser) && + Objects.equals(this.device, activeSession.device) && + Objects.equals(this.os, activeSession.os) && + Objects.equals(this.deviceType, activeSession.deviceType) && + Objects.equals(this.city, activeSession.city) && + Objects.equals(this.country, activeSession.country) && + Objects.equals(this.ip, activeSession.ip) && + Objects.equals(this.loginDate, activeSession.loginDate)&& + Objects.equals(this.additionalProperties, activeSession.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accessToken, browser, device, os, deviceType, city, country, ip, loginDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ActiveSession {\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" browser: ").append(toIndentedString(browser)).append("\n"); + sb.append(" device: ").append(toIndentedString(device)).append("\n"); + sb.append(" os: ").append(toIndentedString(os)).append("\n"); + sb.append(" deviceType: ").append(toIndentedString(deviceType)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" ip: ").append(toIndentedString(ip)).append("\n"); + sb.append(" loginDate: ").append(toIndentedString(loginDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AccessToken"); + openapiFields.add("Browser"); + openapiFields.add("Device"); + openapiFields.add("Os"); + openapiFields.add("DeviceType"); + openapiFields.add("City"); + openapiFields.add("Country"); + openapiFields.add("Ip"); + openapiFields.add("LoginDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ActiveSession + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ActiveSession.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ActiveSession is not found in the empty JSON string", ActiveSession.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("AccessToken") != null && !jsonObj.get("AccessToken").isJsonNull()) && !jsonObj.get("AccessToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccessToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccessToken").toString())); + } + if ((jsonObj.get("Browser") != null && !jsonObj.get("Browser").isJsonNull()) && !jsonObj.get("Browser").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Browser` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Browser").toString())); + } + if ((jsonObj.get("Device") != null && !jsonObj.get("Device").isJsonNull()) && !jsonObj.get("Device").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Device` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Device").toString())); + } + if ((jsonObj.get("Os") != null && !jsonObj.get("Os").isJsonNull()) && !jsonObj.get("Os").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Os` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Os").toString())); + } + if ((jsonObj.get("DeviceType") != null && !jsonObj.get("DeviceType").isJsonNull()) && !jsonObj.get("DeviceType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DeviceType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DeviceType").toString())); + } + if ((jsonObj.get("City") != null && !jsonObj.get("City").isJsonNull()) && !jsonObj.get("City").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `City` to be a primitive type in the JSON string but got `%s`", jsonObj.get("City").toString())); + } + if ((jsonObj.get("Country") != null && !jsonObj.get("Country").isJsonNull()) && !jsonObj.get("Country").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Country").toString())); + } + if ((jsonObj.get("Ip") != null && !jsonObj.get("Ip").isJsonNull()) && !jsonObj.get("Ip").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Ip` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Ip").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ActiveSession.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ActiveSession' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ActiveSession> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ActiveSession.class)); + + return (TypeAdapter<T>) new TypeAdapter<ActiveSession>() { + @Override + public void write(JsonWriter out, ActiveSession value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ActiveSession read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ActiveSession instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ActiveSession given an JSON string + * + * @param jsonString JSON string + * @return An instance of ActiveSession + * @throws IOException if the JSON string is invalid with respect to ActiveSession + */ + public static ActiveSession fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ActiveSession.class); + } + + /** + * Convert an instance of ActiveSession to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ActiveSessionResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ActiveSessionResponse.java new file mode 100644 index 0000000..435a73a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ActiveSessionResponse.java @@ -0,0 +1,336 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ActiveSession; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ActiveSessionResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ActiveSessionResponse { + public static final String SERIALIZED_NAME_NEXT_CURSOR = "nextCursor"; + @SerializedName(SERIALIZED_NAME_NEXT_CURSOR) + @javax.annotation.Nullable + private Integer nextCursor; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<ActiveSession> data = new ArrayList<>(); + + public ActiveSessionResponse() { + } + + public ActiveSessionResponse nextCursor(@javax.annotation.Nullable Integer nextCursor) { + this.nextCursor = nextCursor; + return this; + } + + /** + * Get nextCursor + * @return nextCursor + */ + @javax.annotation.Nullable + public Integer getNextCursor() { + return nextCursor; + } + + public void setNextCursor(@javax.annotation.Nullable Integer nextCursor) { + this.nextCursor = nextCursor; + } + + + public ActiveSessionResponse data(@javax.annotation.Nullable List<ActiveSession> data) { + this.data = data; + return this; + } + + public ActiveSessionResponse addDataItem(ActiveSession dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<ActiveSession> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<ActiveSession> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ActiveSessionResponse instance itself + */ + public ActiveSessionResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ActiveSessionResponse activeSessionResponse = (ActiveSessionResponse) o; + return Objects.equals(this.nextCursor, activeSessionResponse.nextCursor) && + Objects.equals(this.data, activeSessionResponse.data)&& + Objects.equals(this.additionalProperties, activeSessionResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(nextCursor, data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ActiveSessionResponse {\n"); + sb.append(" nextCursor: ").append(toIndentedString(nextCursor)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("nextCursor"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ActiveSessionResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ActiveSessionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ActiveSessionResponse is not found in the empty JSON string", ActiveSessionResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + // validate the optional field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + ActiveSession.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ActiveSessionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ActiveSessionResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ActiveSessionResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ActiveSessionResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<ActiveSessionResponse>() { + @Override + public void write(JsonWriter out, ActiveSessionResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ActiveSessionResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ActiveSessionResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ActiveSessionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ActiveSessionResponse + * @throws IOException if the JSON string is invalid with respect to ActiveSessionResponse + */ + public static ActiveSessionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ActiveSessionResponse.class); + } + + /** + * Convert an instance of ActiveSessionResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/AddEmailModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/AddEmailModel.java new file mode 100644 index 0000000..7a5fb7e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/AddEmailModel.java @@ -0,0 +1,325 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * AddEmailModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class AddEmailModel { + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nonnull + private String email; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public AddEmailModel() { + } + + public AddEmailModel email(@javax.annotation.Nonnull String email) { + this.email = email; + return this; + } + + /** + * email + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nonnull String email) { + this.email = email; + } + + + public AddEmailModel type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * type + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AddEmailModel instance itself + */ + public AddEmailModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddEmailModel addEmailModel = (AddEmailModel) o; + return Objects.equals(this.email, addEmailModel.email) && + Objects.equals(this.type, addEmailModel.type)&& + Objects.equals(this.additionalProperties, addEmailModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddEmailModel {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("email"); + openapiFields.add("type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("email"); + } + + /** + * 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 AddEmailModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AddEmailModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AddEmailModel is not found in the empty JSON string", AddEmailModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddEmailModel.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("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!AddEmailModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddEmailModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<AddEmailModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AddEmailModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<AddEmailModel>() { + @Override + public void write(JsonWriter out, AddEmailModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AddEmailModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AddEmailModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AddEmailModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddEmailModel + * @throws IOException if the JSON string is invalid with respect to AddEmailModel + */ + public static AddEmailModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddEmailModel.class); + } + + /** + * Convert an instance of AddEmailModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/AddEmailModelManage.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/AddEmailModelManage.java new file mode 100644 index 0000000..889f215 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/AddEmailModelManage.java @@ -0,0 +1,357 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * The model is used to add an Email address to a User account. It requires the Email address, the type of Email (e.g., primary or secondary), and the User's unique identifier (UID). + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class AddEmailModelManage { + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nonnull + private String email; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public static final String SERIALIZED_NAME_UID = "uid"; + @SerializedName(SERIALIZED_NAME_UID) + @javax.annotation.Nonnull + private String uid; + + public AddEmailModelManage() { + } + + public AddEmailModelManage email(@javax.annotation.Nonnull String email) { + this.email = email; + return this; + } + + /** + * Email to add to the User's Account. + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nonnull String email) { + this.email = email; + } + + + public AddEmailModelManage type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * Email type (e.g., primary or secondary). + * @return type + */ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public AddEmailModelManage uid(@javax.annotation.Nonnull String uid) { + this.uid = uid; + return this; + } + + /** + * The UID of the User. + * @return uid + */ + @javax.annotation.Nonnull + public String getUid() { + return uid; + } + + public void setUid(@javax.annotation.Nonnull String uid) { + this.uid = uid; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AddEmailModelManage instance itself + */ + public AddEmailModelManage putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddEmailModelManage addEmailModelManage = (AddEmailModelManage) o; + return Objects.equals(this.email, addEmailModelManage.email) && + Objects.equals(this.type, addEmailModelManage.type) && + Objects.equals(this.uid, addEmailModelManage.uid)&& + Objects.equals(this.additionalProperties, addEmailModelManage.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, type, uid, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddEmailModelManage {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("email"); + openapiFields.add("type"); + openapiFields.add("uid"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("uid"); + } + + /** + * 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 AddEmailModelManage + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AddEmailModelManage.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AddEmailModelManage is not found in the empty JSON string", AddEmailModelManage.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddEmailModelManage.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("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if (!jsonObj.get("uid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `uid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uid").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!AddEmailModelManage.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddEmailModelManage' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<AddEmailModelManage> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AddEmailModelManage.class)); + + return (TypeAdapter<T>) new TypeAdapter<AddEmailModelManage>() { + @Override + public void write(JsonWriter out, AddEmailModelManage value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AddEmailModelManage read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AddEmailModelManage instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AddEmailModelManage given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddEmailModelManage + * @throws IOException if the JSON string is invalid with respect to AddEmailModelManage + */ + public static AddEmailModelManage fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddEmailModelManage.class); + } + + /** + * Convert an instance of AddEmailModelManage to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/AddOrganizationDomainRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/AddOrganizationDomainRequest.java new file mode 100644 index 0000000..cce8123 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/AddOrganizationDomainRequest.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * AddOrganizationDomainRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class AddOrganizationDomainRequest { + public static final String SERIALIZED_NAME_DOMAIN_NAME = "DomainName"; + @SerializedName(SERIALIZED_NAME_DOMAIN_NAME) + @javax.annotation.Nonnull + private String domainName; + + public AddOrganizationDomainRequest() { + } + + public AddOrganizationDomainRequest domainName(@javax.annotation.Nonnull String domainName) { + this.domainName = domainName; + return this; + } + + /** + * Get domainName + * @return domainName + */ + @javax.annotation.Nonnull + public String getDomainName() { + return domainName; + } + + public void setDomainName(@javax.annotation.Nonnull String domainName) { + this.domainName = domainName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AddOrganizationDomainRequest instance itself + */ + public AddOrganizationDomainRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddOrganizationDomainRequest addOrganizationDomainRequest = (AddOrganizationDomainRequest) o; + return Objects.equals(this.domainName, addOrganizationDomainRequest.domainName)&& + Objects.equals(this.additionalProperties, addOrganizationDomainRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(domainName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddOrganizationDomainRequest {\n"); + sb.append(" domainName: ").append(toIndentedString(domainName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("DomainName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("DomainName"); + } + + /** + * 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 AddOrganizationDomainRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AddOrganizationDomainRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AddOrganizationDomainRequest is not found in the empty JSON string", AddOrganizationDomainRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddOrganizationDomainRequest.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("DomainName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DomainName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DomainName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!AddOrganizationDomainRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddOrganizationDomainRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<AddOrganizationDomainRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AddOrganizationDomainRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<AddOrganizationDomainRequest>() { + @Override + public void write(JsonWriter out, AddOrganizationDomainRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AddOrganizationDomainRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AddOrganizationDomainRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AddOrganizationDomainRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddOrganizationDomainRequest + * @throws IOException if the JSON string is invalid with respect to AddOrganizationDomainRequest + */ + public static AddOrganizationDomainRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddOrganizationDomainRequest.class); + } + + /** + * Convert an instance of AddOrganizationDomainRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/AddPhoneModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/AddPhoneModel.java new file mode 100644 index 0000000..429f634 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/AddPhoneModel.java @@ -0,0 +1,326 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * This model is used to add a Phone number to a User account. It requires the Phone number and the User's unique identifier (UID). + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class AddPhoneModel { + public static final String SERIALIZED_NAME_PHONE = "phone"; + @SerializedName(SERIALIZED_NAME_PHONE) + @javax.annotation.Nonnull + private String phone; + + public static final String SERIALIZED_NAME_UID = "uid"; + @SerializedName(SERIALIZED_NAME_UID) + @javax.annotation.Nonnull + private String uid; + + public AddPhoneModel() { + } + + public AddPhoneModel phone(@javax.annotation.Nonnull String phone) { + this.phone = phone; + return this; + } + + /** + * Phone number to add to the User's Account. + * @return phone + */ + @javax.annotation.Nonnull + public String getPhone() { + return phone; + } + + public void setPhone(@javax.annotation.Nonnull String phone) { + this.phone = phone; + } + + + public AddPhoneModel uid(@javax.annotation.Nonnull String uid) { + this.uid = uid; + return this; + } + + /** + * The UID of the User. + * @return uid + */ + @javax.annotation.Nonnull + public String getUid() { + return uid; + } + + public void setUid(@javax.annotation.Nonnull String uid) { + this.uid = uid; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AddPhoneModel instance itself + */ + public AddPhoneModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddPhoneModel addPhoneModel = (AddPhoneModel) o; + return Objects.equals(this.phone, addPhoneModel.phone) && + Objects.equals(this.uid, addPhoneModel.uid)&& + Objects.equals(this.additionalProperties, addPhoneModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(phone, uid, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddPhoneModel {\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("phone"); + openapiFields.add("uid"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("phone"); + openapiRequiredFields.add("uid"); + } + + /** + * 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 AddPhoneModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AddPhoneModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AddPhoneModel is not found in the empty JSON string", AddPhoneModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddPhoneModel.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("phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phone").toString())); + } + if (!jsonObj.get("uid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `uid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uid").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!AddPhoneModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddPhoneModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<AddPhoneModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AddPhoneModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<AddPhoneModel>() { + @Override + public void write(JsonWriter out, AddPhoneModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AddPhoneModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AddPhoneModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AddPhoneModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddPhoneModel + * @throws IOException if the JSON string is invalid with respect to AddPhoneModel + */ + public static AddPhoneModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddPhoneModel.class); + } + + /** + * Convert an instance of AddPhoneModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/AddWorkflowConfig.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/AddWorkflowConfig.java new file mode 100644 index 0000000..d561876 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/AddWorkflowConfig.java @@ -0,0 +1,471 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * AddWorkflowConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class AddWorkflowConfig { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_THEME_NAME = "ThemeName"; + @SerializedName(SERIALIZED_NAME_THEME_NAME) + @javax.annotation.Nullable + private String themeName; + + public static final String SERIALIZED_NAME_DESCRIPTION = "Description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private Object data; + + /** + * Gets or Sets state + */ + @JsonAdapter(StateEnum.Adapter.class) + public enum StateEnum { + ACTIVE("ACTIVE"), + + DEBUG("DEBUG"), + + ARCHIVE("ARCHIVE"); + + private String value; + + StateEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StateEnum fromValue(String value) { + for (StateEnum b : StateEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<StateEnum> { + @Override + public void write(final JsonWriter jsonWriter, final StateEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StateEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StateEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StateEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATE = "State"; + @SerializedName(SERIALIZED_NAME_STATE) + @javax.annotation.Nullable + private StateEnum state; + + public AddWorkflowConfig() { + } + + public AddWorkflowConfig 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 AddWorkflowConfig themeName(@javax.annotation.Nullable String themeName) { + this.themeName = themeName; + return this; + } + + /** + * Get themeName + * @return themeName + */ + @javax.annotation.Nullable + public String getThemeName() { + return themeName; + } + + public void setThemeName(@javax.annotation.Nullable String themeName) { + this.themeName = themeName; + } + + + public AddWorkflowConfig description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public AddWorkflowConfig data(@javax.annotation.Nonnull Object data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public Object getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull Object data) { + this.data = data; + } + + + public AddWorkflowConfig state(@javax.annotation.Nullable StateEnum state) { + this.state = state; + return this; + } + + /** + * Get state + * @return state + */ + @javax.annotation.Nullable + public StateEnum getState() { + return state; + } + + public void setState(@javax.annotation.Nullable StateEnum state) { + this.state = state; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AddWorkflowConfig instance itself + */ + public AddWorkflowConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AddWorkflowConfig addWorkflowConfig = (AddWorkflowConfig) o; + return Objects.equals(this.name, addWorkflowConfig.name) && + Objects.equals(this.themeName, addWorkflowConfig.themeName) && + Objects.equals(this.description, addWorkflowConfig.description) && + Objects.equals(this.data, addWorkflowConfig.data) && + Objects.equals(this.state, addWorkflowConfig.state)&& + Objects.equals(this.additionalProperties, addWorkflowConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, themeName, description, data, state, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AddWorkflowConfig {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" themeName: ").append(toIndentedString(themeName)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + openapiFields.add("ThemeName"); + openapiFields.add("Description"); + openapiFields.add("Data"); + openapiFields.add("State"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Name"); + openapiRequiredFields.add("Data"); + } + + /** + * 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 AddWorkflowConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AddWorkflowConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AddWorkflowConfig is not found in the empty JSON string", AddWorkflowConfig.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : AddWorkflowConfig.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("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("ThemeName") != null && !jsonObj.get("ThemeName").isJsonNull()) && !jsonObj.get("ThemeName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ThemeName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ThemeName").toString())); + } + if ((jsonObj.get("Description") != null && !jsonObj.get("Description").isJsonNull()) && !jsonObj.get("Description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Description").toString())); + } + if ((jsonObj.get("State") != null && !jsonObj.get("State").isJsonNull()) && !jsonObj.get("State").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `State` to be a primitive type in the JSON string but got `%s`", jsonObj.get("State").toString())); + } + // validate the optional field `State` + if (jsonObj.get("State") != null && !jsonObj.get("State").isJsonNull()) { + StateEnum.validateJsonElement(jsonObj.get("State")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!AddWorkflowConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AddWorkflowConfig' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<AddWorkflowConfig> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AddWorkflowConfig.class)); + + return (TypeAdapter<T>) new TypeAdapter<AddWorkflowConfig>() { + @Override + public void write(JsonWriter out, AddWorkflowConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AddWorkflowConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AddWorkflowConfig instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AddWorkflowConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of AddWorkflowConfig + * @throws IOException if the JSON string is invalid with respect to AddWorkflowConfig + */ + public static AddWorkflowConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AddWorkflowConfig.class); + } + + /** + * Convert an instance of AddWorkflowConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/Aggregation.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/Aggregation.java new file mode 100644 index 0000000..0004fcb --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/Aggregation.java @@ -0,0 +1,303 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.AggregationObj; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Defines the aggregation structure for the insights query. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class Aggregation { + public static final String SERIALIZED_NAME_AGGREGATIONS = "aggregations"; + @SerializedName(SERIALIZED_NAME_AGGREGATIONS) + @javax.annotation.Nonnull + private Map<String, AggregationObj> aggregations = new HashMap<>(); + + public Aggregation() { + } + + public Aggregation aggregations(@javax.annotation.Nonnull Map<String, AggregationObj> aggregations) { + this.aggregations = aggregations; + return this; + } + + public Aggregation putAggregationsItem(String key, AggregationObj aggregationsItem) { + if (this.aggregations == null) { + this.aggregations = new HashMap<>(); + } + this.aggregations.put(key, aggregationsItem); + return this; + } + + /** + * A map of aggregation names to their configuration objects. + * @return aggregations + */ + @javax.annotation.Nonnull + public Map<String, AggregationObj> getAggregations() { + return aggregations; + } + + public void setAggregations(@javax.annotation.Nonnull Map<String, AggregationObj> aggregations) { + this.aggregations = aggregations; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Aggregation instance itself + */ + public Aggregation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Aggregation aggregation = (Aggregation) o; + return Objects.equals(this.aggregations, aggregation.aggregations)&& + Objects.equals(this.additionalProperties, aggregation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(aggregations, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Aggregation {\n"); + sb.append(" aggregations: ").append(toIndentedString(aggregations)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("aggregations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("aggregations"); + } + + /** + * 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 Aggregation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Aggregation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Aggregation is not found in the empty JSON string", Aggregation.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Aggregation.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(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!Aggregation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Aggregation' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<Aggregation> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Aggregation.class)); + + return (TypeAdapter<T>) new TypeAdapter<Aggregation>() { + @Override + public void write(JsonWriter out, Aggregation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Aggregation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Aggregation instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Aggregation given an JSON string + * + * @param jsonString JSON string + * @return An instance of Aggregation + * @throws IOException if the JSON string is invalid with respect to Aggregation + */ + public static Aggregation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Aggregation.class); + } + + /** + * Convert an instance of Aggregation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/AggregationObj.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/AggregationObj.java new file mode 100644 index 0000000..3c525ad --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/AggregationObj.java @@ -0,0 +1,417 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.AggregationObjInterval; +import com.loginradius.sdk.internal.openapi.model.RangeObj; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Configuration for a single aggregation, including field, type, and optional range or interval. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class AggregationObj { + public static final String SERIALIZED_NAME_FIELD = "field"; + @SerializedName(SERIALIZED_NAME_FIELD) + @javax.annotation.Nullable + private String field; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_RANGES = "ranges"; + @SerializedName(SERIALIZED_NAME_RANGES) + @javax.annotation.Nullable + private Map<String, RangeObj> ranges = new HashMap<>(); + + public static final String SERIALIZED_NAME_INTERVAL = "interval"; + @SerializedName(SERIALIZED_NAME_INTERVAL) + @javax.annotation.Nullable + private AggregationObjInterval interval; + + public static final String SERIALIZED_NAME_FORMAT = "format"; + @SerializedName(SERIALIZED_NAME_FORMAT) + @javax.annotation.Nullable + private String format; + + public AggregationObj() { + } + + public AggregationObj field(@javax.annotation.Nullable String field) { + this.field = field; + return this; + } + + /** + * The field to aggregate on. + * @return field + */ + @javax.annotation.Nullable + public String getField() { + return field; + } + + public void setField(@javax.annotation.Nullable String field) { + this.field = field; + } + + + public AggregationObj type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * The type of aggregation (e.g., terms, range, histogram). + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public AggregationObj ranges(@javax.annotation.Nullable Map<String, RangeObj> ranges) { + this.ranges = ranges; + return this; + } + + public AggregationObj putRangesItem(String key, RangeObj rangesItem) { + if (this.ranges == null) { + this.ranges = new HashMap<>(); + } + this.ranges.put(key, rangesItem); + return this; + } + + /** + * Optional. A map of range names to range objects, used for range aggregations. + * @return ranges + */ + @javax.annotation.Nullable + public Map<String, RangeObj> getRanges() { + return ranges; + } + + public void setRanges(@javax.annotation.Nullable Map<String, RangeObj> ranges) { + this.ranges = ranges; + } + + + public AggregationObj interval(@javax.annotation.Nullable AggregationObjInterval interval) { + this.interval = interval; + return this; + } + + /** + * Get interval + * @return interval + */ + @javax.annotation.Nullable + public AggregationObjInterval getInterval() { + return interval; + } + + public void setInterval(@javax.annotation.Nullable AggregationObjInterval interval) { + this.interval = interval; + } + + + public AggregationObj format(@javax.annotation.Nullable String format) { + this.format = format; + return this; + } + + /** + * Optional. Format string for date or numeric values. + * @return format + */ + @javax.annotation.Nullable + public String getFormat() { + return format; + } + + public void setFormat(@javax.annotation.Nullable String format) { + this.format = format; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AggregationObj instance itself + */ + public AggregationObj putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AggregationObj aggregationObj = (AggregationObj) o; + return Objects.equals(this.field, aggregationObj.field) && + Objects.equals(this.type, aggregationObj.type) && + Objects.equals(this.ranges, aggregationObj.ranges) && + Objects.equals(this.interval, aggregationObj.interval) && + Objects.equals(this.format, aggregationObj.format)&& + Objects.equals(this.additionalProperties, aggregationObj.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(field, type, ranges, interval, format, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AggregationObj {\n"); + sb.append(" field: ").append(toIndentedString(field)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" ranges: ").append(toIndentedString(ranges)).append("\n"); + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append(" format: ").append(toIndentedString(format)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("field"); + openapiFields.add("type"); + openapiFields.add("ranges"); + openapiFields.add("interval"); + openapiFields.add("format"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 AggregationObj + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AggregationObj.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AggregationObj is not found in the empty JSON string", AggregationObj.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("field") != null && !jsonObj.get("field").isJsonNull()) && !jsonObj.get("field").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `field` to be a primitive type in the JSON string but got `%s`", jsonObj.get("field").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the optional field `interval` + if (jsonObj.get("interval") != null && !jsonObj.get("interval").isJsonNull()) { + AggregationObjInterval.validateJsonElement(jsonObj.get("interval")); + } + if ((jsonObj.get("format") != null && !jsonObj.get("format").isJsonNull()) && !jsonObj.get("format").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `format` to be a primitive type in the JSON string but got `%s`", jsonObj.get("format").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!AggregationObj.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AggregationObj' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<AggregationObj> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AggregationObj.class)); + + return (TypeAdapter<T>) new TypeAdapter<AggregationObj>() { + @Override + public void write(JsonWriter out, AggregationObj value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AggregationObj read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AggregationObj instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AggregationObj given an JSON string + * + * @param jsonString JSON string + * @return An instance of AggregationObj + * @throws IOException if the JSON string is invalid with respect to AggregationObj + */ + public static AggregationObj fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AggregationObj.class); + } + + /** + * Convert an instance of AggregationObj to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/AggregationObjInterval.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/AggregationObjInterval.java new file mode 100644 index 0000000..c1fbb4f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/AggregationObjInterval.java @@ -0,0 +1,323 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.math.BigDecimal; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class AggregationObjInterval extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(AggregationObjInterval.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!AggregationObjInterval.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AggregationObjInterval' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<String> adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + final TypeAdapter<Integer> adapterInteger = gson.getDelegateAdapter(this, TypeToken.get(Integer.class)); + final TypeAdapter<BigDecimal> adapterBigDecimal = gson.getDelegateAdapter(this, TypeToken.get(BigDecimal.class)); + + return (TypeAdapter<T>) new TypeAdapter<AggregationObjInterval>() { + @Override + public void write(JsonWriter out, AggregationObjInterval value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonPrimitive primitive = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Integer` + if (value.getActualInstance() instanceof Integer) { + JsonPrimitive primitive = adapterInteger.toJsonTree((Integer)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `BigDecimal` + if (value.getActualInstance() instanceof BigDecimal) { + JsonElement element = adapterBigDecimal.toJsonTree((BigDecimal)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: BigDecimal, Integer, String"); + } + + @Override + public AggregationObjInterval read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + // deserialize Integer + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterInteger; + match++; + log.log(Level.FINER, "Input data matches schema 'Integer'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Integer failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Integer'", e); + } + // deserialize BigDecimal + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterBigDecimal; + match++; + log.log(Level.FINER, "Input data matches schema 'BigDecimal'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'BigDecimal'", e); + } + + if (match == 1) { + AggregationObjInterval ret = new AggregationObjInterval(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for AggregationObjInterval: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public AggregationObjInterval() { + super("oneOf", Boolean.FALSE); + } + + public AggregationObjInterval(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", String.class); + schemas.put("Integer", Integer.class); + schemas.put("BigDecimal", BigDecimal.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return AggregationObjInterval.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * BigDecimal, Integer, String + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Integer) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof BigDecimal) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be BigDecimal, Integer, String"); + } + + /** + * Get the actual instance, which can be the following: + * BigDecimal, Integer, String + * + * @return The actual instance (BigDecimal, Integer, String) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + /** + * Get the actual instance of `Integer`. If the actual instance is not `Integer`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Integer` + * @throws ClassCastException if the instance is not `Integer` + */ + public Integer getInteger() throws ClassCastException { + return (Integer)super.getActualInstance(); + } + + /** + * Get the actual instance of `BigDecimal`. If the actual instance is not `BigDecimal`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `BigDecimal` + * @throws ClassCastException if the instance is not `BigDecimal` + */ + public BigDecimal getBigDecimal() throws ClassCastException { + return (BigDecimal)super.getActualInstance(); + } + + /** + * 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 AggregationObjInterval + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with String + try { + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Integer + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Integer failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with BigDecimal + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for AggregationObjInterval with oneOf schemas: BigDecimal, Integer, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of AggregationObjInterval given an JSON string + * + * @param jsonString JSON string + * @return An instance of AggregationObjInterval + * @throws IOException if the JSON string is invalid with respect to AggregationObjInterval + */ + public static AggregationObjInterval fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AggregationObjInterval.class); + } + + /** + * Convert an instance of AggregationObjInterval to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/AndroidPushConfig.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/AndroidPushConfig.java new file mode 100644 index 0000000..cb55ed5 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/AndroidPushConfig.java @@ -0,0 +1,374 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * AndroidPushConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class AndroidPushConfig { + public static final String SERIALIZED_NAME_ENABLED = "Enabled"; + @SerializedName(SERIALIZED_NAME_ENABLED) + @javax.annotation.Nullable + private Boolean enabled; + + public static final String SERIALIZED_NAME_PLATFORM_A_R_N = "PlatformARN"; + @SerializedName(SERIALIZED_NAME_PLATFORM_A_R_N) + @javax.annotation.Nullable + private String platformARN; + + public static final String SERIALIZED_NAME_PLAYSTORE_URL = "PlaystoreUrl"; + @SerializedName(SERIALIZED_NAME_PLAYSTORE_URL) + @javax.annotation.Nullable + private String playstoreUrl; + + public static final String SERIALIZED_NAME_SERVICE_JSON = "ServiceJson"; + @SerializedName(SERIALIZED_NAME_SERVICE_JSON) + @javax.annotation.Nullable + private String serviceJson; + + public AndroidPushConfig() { + } + + public AndroidPushConfig enabled(@javax.annotation.Nullable Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Indicates if Android Push Notifications are enabled. + * @return enabled + */ + @javax.annotation.Nullable + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(@javax.annotation.Nullable Boolean enabled) { + this.enabled = enabled; + } + + + public AndroidPushConfig platformARN(@javax.annotation.Nullable String platformARN) { + this.platformARN = platformARN; + return this; + } + + /** + * The platform ARN for Android Push Notifications. + * @return platformARN + */ + @javax.annotation.Nullable + public String getPlatformARN() { + return platformARN; + } + + public void setPlatformARN(@javax.annotation.Nullable String platformARN) { + this.platformARN = platformARN; + } + + + public AndroidPushConfig playstoreUrl(@javax.annotation.Nullable String playstoreUrl) { + this.playstoreUrl = playstoreUrl; + return this; + } + + /** + * The URL to the app in the Google Play Store. + * @return playstoreUrl + */ + @javax.annotation.Nullable + public String getPlaystoreUrl() { + return playstoreUrl; + } + + public void setPlaystoreUrl(@javax.annotation.Nullable String playstoreUrl) { + this.playstoreUrl = playstoreUrl; + } + + + public AndroidPushConfig serviceJson(@javax.annotation.Nullable String serviceJson) { + this.serviceJson = serviceJson; + return this; + } + + /** + * JSON string for Android Push Notification service. + * @return serviceJson + */ + @javax.annotation.Nullable + public String getServiceJson() { + return serviceJson; + } + + public void setServiceJson(@javax.annotation.Nullable String serviceJson) { + this.serviceJson = serviceJson; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AndroidPushConfig instance itself + */ + public AndroidPushConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AndroidPushConfig androidPushConfig = (AndroidPushConfig) o; + return Objects.equals(this.enabled, androidPushConfig.enabled) && + Objects.equals(this.platformARN, androidPushConfig.platformARN) && + Objects.equals(this.playstoreUrl, androidPushConfig.playstoreUrl) && + Objects.equals(this.serviceJson, androidPushConfig.serviceJson)&& + Objects.equals(this.additionalProperties, androidPushConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(enabled, platformARN, playstoreUrl, serviceJson, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AndroidPushConfig {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" platformARN: ").append(toIndentedString(platformARN)).append("\n"); + sb.append(" playstoreUrl: ").append(toIndentedString(playstoreUrl)).append("\n"); + sb.append(" serviceJson: ").append(toIndentedString(serviceJson)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Enabled"); + openapiFields.add("PlatformARN"); + openapiFields.add("PlaystoreUrl"); + openapiFields.add("ServiceJson"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 AndroidPushConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AndroidPushConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AndroidPushConfig is not found in the empty JSON string", AndroidPushConfig.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("PlatformARN") != null && !jsonObj.get("PlatformARN").isJsonNull()) && !jsonObj.get("PlatformARN").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PlatformARN` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PlatformARN").toString())); + } + if ((jsonObj.get("PlaystoreUrl") != null && !jsonObj.get("PlaystoreUrl").isJsonNull()) && !jsonObj.get("PlaystoreUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PlaystoreUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PlaystoreUrl").toString())); + } + if ((jsonObj.get("ServiceJson") != null && !jsonObj.get("ServiceJson").isJsonNull()) && !jsonObj.get("ServiceJson").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ServiceJson` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ServiceJson").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!AndroidPushConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AndroidPushConfig' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<AndroidPushConfig> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AndroidPushConfig.class)); + + return (TypeAdapter<T>) new TypeAdapter<AndroidPushConfig>() { + @Override + public void write(JsonWriter out, AndroidPushConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AndroidPushConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AndroidPushConfig instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AndroidPushConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of AndroidPushConfig + * @throws IOException if the JSON string is invalid with respect to AndroidPushConfig + */ + public static AndroidPushConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AndroidPushConfig.class); + } + + /** + * Convert an instance of AndroidPushConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ApiError.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ApiError.java new file mode 100644 index 0000000..8a60ee7 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ApiError.java @@ -0,0 +1,344 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ApiError + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ApiError { + public static final String SERIALIZED_NAME_ERROR_CODE = "ErrorCode"; + @SerializedName(SERIALIZED_NAME_ERROR_CODE) + @javax.annotation.Nullable + private Integer errorCode; + + public static final String SERIALIZED_NAME_MESSAGE = "Message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + @javax.annotation.Nullable + private String message; + + public static final String SERIALIZED_NAME_DESCRIPTION = "Description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public ApiError() { + } + + public ApiError errorCode(@javax.annotation.Nullable Integer errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * The error code + * @return errorCode + */ + @javax.annotation.Nullable + public Integer getErrorCode() { + return errorCode; + } + + public void setErrorCode(@javax.annotation.Nullable Integer errorCode) { + this.errorCode = errorCode; + } + + + public ApiError message(@javax.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * The error message + * @return message + */ + @javax.annotation.Nullable + public String getMessage() { + return message; + } + + public void setMessage(@javax.annotation.Nullable String message) { + this.message = message; + } + + + public ApiError description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * A detailed description of the error + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ApiError instance itself + */ + public ApiError putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ApiError apiError = (ApiError) o; + return Objects.equals(this.errorCode, apiError.errorCode) && + Objects.equals(this.message, apiError.message) && + Objects.equals(this.description, apiError.description)&& + Objects.equals(this.additionalProperties, apiError.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(errorCode, message, description, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ApiError {\n"); + sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ErrorCode"); + openapiFields.add("Message"); + openapiFields.add("Description"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ApiError + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ApiError.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ApiError is not found in the empty JSON string", ApiError.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Message") != null && !jsonObj.get("Message").isJsonNull()) && !jsonObj.get("Message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Message").toString())); + } + if ((jsonObj.get("Description") != null && !jsonObj.get("Description").isJsonNull()) && !jsonObj.get("Description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Description").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ApiError.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ApiError' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ApiError> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ApiError.class)); + + return (TypeAdapter<T>) new TypeAdapter<ApiError>() { + @Override + public void write(JsonWriter out, ApiError value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ApiError read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ApiError instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ApiError given an JSON string + * + * @param jsonString JSON string + * @return An instance of ApiError + * @throws IOException if the JSON string is invalid with respect to ApiError + */ + public static ApiError fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ApiError.class); + } + + /** + * Convert an instance of ApiError to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/AppProvider.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/AppProvider.java new file mode 100644 index 0000000..a725e06 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/AppProvider.java @@ -0,0 +1,436 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.AppleSecretConfiguration; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * AppProvider + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class AppProvider { + public static final String SERIALIZED_NAME_IS_ACTIVE = "IsActive"; + @SerializedName(SERIALIZED_NAME_IS_ACTIVE) + @javax.annotation.Nullable + private Boolean isActive; + + public static final String SERIALIZED_NAME_KEY = "Key"; + @SerializedName(SERIALIZED_NAME_KEY) + @javax.annotation.Nullable + private String key; + + public static final String SERIALIZED_NAME_SECRET = "Secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + @javax.annotation.Nullable + private String secret; + + public static final String SERIALIZED_NAME_EXTRA_FIELD1 = "ExtraField1"; + @SerializedName(SERIALIZED_NAME_EXTRA_FIELD1) + @javax.annotation.Nullable + private String extraField1; + + public static final String SERIALIZED_NAME_EXTRA_FIELD2 = "ExtraField2"; + @SerializedName(SERIALIZED_NAME_EXTRA_FIELD2) + @javax.annotation.Nullable + private String extraField2; + + public static final String SERIALIZED_NAME_APPLE_SECRET_CONFIGURATION = "AppleSecretConfiguration"; + @SerializedName(SERIALIZED_NAME_APPLE_SECRET_CONFIGURATION) + @javax.annotation.Nullable + private AppleSecretConfiguration appleSecretConfiguration; + + public AppProvider() { + } + + public AppProvider isActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Indicates whether the provider is active. + * @return isActive + */ + @javax.annotation.Nullable + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + } + + + public AppProvider key(@javax.annotation.Nullable String key) { + this.key = key; + return this; + } + + /** + * The key for the provider application. + * @return key + */ + @javax.annotation.Nullable + public String getKey() { + return key; + } + + public void setKey(@javax.annotation.Nullable String key) { + this.key = key; + } + + + public AppProvider secret(@javax.annotation.Nullable String secret) { + this.secret = secret; + return this; + } + + /** + * The secret for the provider application. + * @return secret + */ + @javax.annotation.Nullable + public String getSecret() { + return secret; + } + + public void setSecret(@javax.annotation.Nullable String secret) { + this.secret = secret; + } + + + public AppProvider extraField1(@javax.annotation.Nullable String extraField1) { + this.extraField1 = extraField1; + return this; + } + + /** + * An extra field for additional configuration. + * @return extraField1 + */ + @javax.annotation.Nullable + public String getExtraField1() { + return extraField1; + } + + public void setExtraField1(@javax.annotation.Nullable String extraField1) { + this.extraField1 = extraField1; + } + + + public AppProvider extraField2(@javax.annotation.Nullable String extraField2) { + this.extraField2 = extraField2; + return this; + } + + /** + * Another extra field for additional configuration. + * @return extraField2 + */ + @javax.annotation.Nullable + public String getExtraField2() { + return extraField2; + } + + public void setExtraField2(@javax.annotation.Nullable String extraField2) { + this.extraField2 = extraField2; + } + + + public AppProvider appleSecretConfiguration(@javax.annotation.Nullable AppleSecretConfiguration appleSecretConfiguration) { + this.appleSecretConfiguration = appleSecretConfiguration; + return this; + } + + /** + * Get appleSecretConfiguration + * @return appleSecretConfiguration + */ + @javax.annotation.Nullable + public AppleSecretConfiguration getAppleSecretConfiguration() { + return appleSecretConfiguration; + } + + public void setAppleSecretConfiguration(@javax.annotation.Nullable AppleSecretConfiguration appleSecretConfiguration) { + this.appleSecretConfiguration = appleSecretConfiguration; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AppProvider instance itself + */ + public AppProvider putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AppProvider appProvider = (AppProvider) o; + return Objects.equals(this.isActive, appProvider.isActive) && + Objects.equals(this.key, appProvider.key) && + Objects.equals(this.secret, appProvider.secret) && + Objects.equals(this.extraField1, appProvider.extraField1) && + Objects.equals(this.extraField2, appProvider.extraField2) && + Objects.equals(this.appleSecretConfiguration, appProvider.appleSecretConfiguration)&& + Objects.equals(this.additionalProperties, appProvider.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isActive, key, secret, extraField1, extraField2, appleSecretConfiguration, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AppProvider {\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" extraField1: ").append(toIndentedString(extraField1)).append("\n"); + sb.append(" extraField2: ").append(toIndentedString(extraField2)).append("\n"); + sb.append(" appleSecretConfiguration: ").append(toIndentedString(appleSecretConfiguration)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsActive"); + openapiFields.add("Key"); + openapiFields.add("Secret"); + openapiFields.add("ExtraField1"); + openapiFields.add("ExtraField2"); + openapiFields.add("AppleSecretConfiguration"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 AppProvider + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AppProvider.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AppProvider is not found in the empty JSON string", AppProvider.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Key") != null && !jsonObj.get("Key").isJsonNull()) && !jsonObj.get("Key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Key").toString())); + } + if ((jsonObj.get("Secret") != null && !jsonObj.get("Secret").isJsonNull()) && !jsonObj.get("Secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Secret").toString())); + } + if ((jsonObj.get("ExtraField1") != null && !jsonObj.get("ExtraField1").isJsonNull()) && !jsonObj.get("ExtraField1").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ExtraField1` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ExtraField1").toString())); + } + if ((jsonObj.get("ExtraField2") != null && !jsonObj.get("ExtraField2").isJsonNull()) && !jsonObj.get("ExtraField2").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ExtraField2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ExtraField2").toString())); + } + // validate the optional field `AppleSecretConfiguration` + if (jsonObj.get("AppleSecretConfiguration") != null && !jsonObj.get("AppleSecretConfiguration").isJsonNull()) { + AppleSecretConfiguration.validateJsonElement(jsonObj.get("AppleSecretConfiguration")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!AppProvider.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AppProvider' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<AppProvider> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AppProvider.class)); + + return (TypeAdapter<T>) new TypeAdapter<AppProvider>() { + @Override + public void write(JsonWriter out, AppProvider value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AppProvider read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AppProvider instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AppProvider given an JSON string + * + * @param jsonString JSON string + * @return An instance of AppProvider + * @throws IOException if the JSON string is invalid with respect to AppProvider + */ + public static AppProvider fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AppProvider.class); + } + + /** + * Convert an instance of AppProvider to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/AppleSecretConfiguration.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/AppleSecretConfiguration.java new file mode 100644 index 0000000..96d84a6 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/AppleSecretConfiguration.java @@ -0,0 +1,407 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * AppleSecretConfiguration + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class AppleSecretConfiguration { + public static final String SERIALIZED_NAME_CERTIFICATE = "Certificate"; + @SerializedName(SERIALIZED_NAME_CERTIFICATE) + @javax.annotation.Nullable + private String certificate; + + public static final String SERIALIZED_NAME_KEY_IDENTIFIER = "KeyIdentifier"; + @SerializedName(SERIALIZED_NAME_KEY_IDENTIFIER) + @javax.annotation.Nullable + private String keyIdentifier; + + public static final String SERIALIZED_NAME_SERVICE_ID = "ServiceId"; + @SerializedName(SERIALIZED_NAME_SERVICE_ID) + @javax.annotation.Nullable + private String serviceId; + + public static final String SERIALIZED_NAME_BUNDLE_ID = "BundleId"; + @SerializedName(SERIALIZED_NAME_BUNDLE_ID) + @javax.annotation.Nullable + private String bundleId; + + public static final String SERIALIZED_NAME_TEAM_ID = "TeamId"; + @SerializedName(SERIALIZED_NAME_TEAM_ID) + @javax.annotation.Nullable + private String teamId; + + public AppleSecretConfiguration() { + } + + public AppleSecretConfiguration certificate(@javax.annotation.Nullable String certificate) { + this.certificate = certificate; + return this; + } + + /** + * Certificate for Apple configuration + * @return certificate + */ + @javax.annotation.Nullable + public String getCertificate() { + return certificate; + } + + public void setCertificate(@javax.annotation.Nullable String certificate) { + this.certificate = certificate; + } + + + public AppleSecretConfiguration keyIdentifier(@javax.annotation.Nullable String keyIdentifier) { + this.keyIdentifier = keyIdentifier; + return this; + } + + /** + * Key identifier for Apple configuration + * @return keyIdentifier + */ + @javax.annotation.Nullable + public String getKeyIdentifier() { + return keyIdentifier; + } + + public void setKeyIdentifier(@javax.annotation.Nullable String keyIdentifier) { + this.keyIdentifier = keyIdentifier; + } + + + public AppleSecretConfiguration serviceId(@javax.annotation.Nullable String serviceId) { + this.serviceId = serviceId; + return this; + } + + /** + * Service ID for Apple configuration + * @return serviceId + */ + @javax.annotation.Nullable + public String getServiceId() { + return serviceId; + } + + public void setServiceId(@javax.annotation.Nullable String serviceId) { + this.serviceId = serviceId; + } + + + public AppleSecretConfiguration bundleId(@javax.annotation.Nullable String bundleId) { + this.bundleId = bundleId; + return this; + } + + /** + * Bundle ID for Apple configuration + * @return bundleId + */ + @javax.annotation.Nullable + public String getBundleId() { + return bundleId; + } + + public void setBundleId(@javax.annotation.Nullable String bundleId) { + this.bundleId = bundleId; + } + + + public AppleSecretConfiguration teamId(@javax.annotation.Nullable String teamId) { + this.teamId = teamId; + return this; + } + + /** + * Team ID for Apple configuration + * @return teamId + */ + @javax.annotation.Nullable + public String getTeamId() { + return teamId; + } + + public void setTeamId(@javax.annotation.Nullable String teamId) { + this.teamId = teamId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AppleSecretConfiguration instance itself + */ + public AppleSecretConfiguration putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AppleSecretConfiguration appleSecretConfiguration = (AppleSecretConfiguration) o; + return Objects.equals(this.certificate, appleSecretConfiguration.certificate) && + Objects.equals(this.keyIdentifier, appleSecretConfiguration.keyIdentifier) && + Objects.equals(this.serviceId, appleSecretConfiguration.serviceId) && + Objects.equals(this.bundleId, appleSecretConfiguration.bundleId) && + Objects.equals(this.teamId, appleSecretConfiguration.teamId)&& + Objects.equals(this.additionalProperties, appleSecretConfiguration.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(certificate, keyIdentifier, serviceId, bundleId, teamId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AppleSecretConfiguration {\n"); + sb.append(" certificate: ").append(toIndentedString(certificate)).append("\n"); + sb.append(" keyIdentifier: ").append(toIndentedString(keyIdentifier)).append("\n"); + sb.append(" serviceId: ").append(toIndentedString(serviceId)).append("\n"); + sb.append(" bundleId: ").append(toIndentedString(bundleId)).append("\n"); + sb.append(" teamId: ").append(toIndentedString(teamId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Certificate"); + openapiFields.add("KeyIdentifier"); + openapiFields.add("ServiceId"); + openapiFields.add("BundleId"); + openapiFields.add("TeamId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 AppleSecretConfiguration + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AppleSecretConfiguration.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AppleSecretConfiguration is not found in the empty JSON string", AppleSecretConfiguration.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Certificate") != null && !jsonObj.get("Certificate").isJsonNull()) && !jsonObj.get("Certificate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Certificate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Certificate").toString())); + } + if ((jsonObj.get("KeyIdentifier") != null && !jsonObj.get("KeyIdentifier").isJsonNull()) && !jsonObj.get("KeyIdentifier").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `KeyIdentifier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("KeyIdentifier").toString())); + } + if ((jsonObj.get("ServiceId") != null && !jsonObj.get("ServiceId").isJsonNull()) && !jsonObj.get("ServiceId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ServiceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ServiceId").toString())); + } + if ((jsonObj.get("BundleId") != null && !jsonObj.get("BundleId").isJsonNull()) && !jsonObj.get("BundleId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `BundleId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BundleId").toString())); + } + if ((jsonObj.get("TeamId") != null && !jsonObj.get("TeamId").isJsonNull()) && !jsonObj.get("TeamId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TeamId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TeamId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!AppleSecretConfiguration.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AppleSecretConfiguration' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<AppleSecretConfiguration> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AppleSecretConfiguration.class)); + + return (TypeAdapter<T>) new TypeAdapter<AppleSecretConfiguration>() { + @Override + public void write(JsonWriter out, AppleSecretConfiguration value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AppleSecretConfiguration read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AppleSecretConfiguration instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AppleSecretConfiguration given an JSON string + * + * @param jsonString JSON string + * @return An instance of AppleSecretConfiguration + * @throws IOException if the JSON string is invalid with respect to AppleSecretConfiguration + */ + public static AppleSecretConfiguration fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AppleSecretConfiguration.class); + } + + /** + * Convert an instance of AppleSecretConfiguration to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/AuthResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/AuthResponse.java new file mode 100644 index 0000000..0882e13 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/AuthResponse.java @@ -0,0 +1,377 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.Profile; +import java.io.IOException; +import java.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * AuthResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class AuthResponse { + public static final String SERIALIZED_NAME_PROFILE = "Profile"; + @SerializedName(SERIALIZED_NAME_PROFILE) + @javax.annotation.Nullable + private Profile profile; + + public static final String SERIALIZED_NAME_ACCESS_TOKEN = "access_token"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN) + @javax.annotation.Nullable + private String accessToken; + + public static final String SERIALIZED_NAME_REFRESH_TOKEN = "refresh_token"; + @SerializedName(SERIALIZED_NAME_REFRESH_TOKEN) + @javax.annotation.Nullable + private String refreshToken; + + public static final String SERIALIZED_NAME_EXPIRES_IN = "expires_in"; + @SerializedName(SERIALIZED_NAME_EXPIRES_IN) + @javax.annotation.Nullable + private OffsetDateTime expiresIn; + + public AuthResponse() { + } + + public AuthResponse profile(@javax.annotation.Nullable Profile profile) { + this.profile = profile; + return this; + } + + /** + * Get profile + * @return profile + */ + @javax.annotation.Nullable + public Profile getProfile() { + return profile; + } + + public void setProfile(@javax.annotation.Nullable Profile profile) { + this.profile = profile; + } + + + public AuthResponse accessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Bearer token for authenticating API requests. + * @return accessToken + */ + @javax.annotation.Nullable + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + } + + + public AuthResponse refreshToken(@javax.annotation.Nullable String refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + /** + * Long-lived token for obtaining new Access Tokens. + * @return refreshToken + */ + @javax.annotation.Nullable + public String getRefreshToken() { + return refreshToken; + } + + public void setRefreshToken(@javax.annotation.Nullable String refreshToken) { + this.refreshToken = refreshToken; + } + + + public AuthResponse expiresIn(@javax.annotation.Nullable OffsetDateTime expiresIn) { + this.expiresIn = expiresIn; + return this; + } + + /** + * Expiration time of the Access Token in seconds. + * @return expiresIn + */ + @javax.annotation.Nullable + public OffsetDateTime getExpiresIn() { + return expiresIn; + } + + public void setExpiresIn(@javax.annotation.Nullable OffsetDateTime expiresIn) { + this.expiresIn = expiresIn; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AuthResponse instance itself + */ + public AuthResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthResponse authResponse = (AuthResponse) o; + return Objects.equals(this.profile, authResponse.profile) && + Objects.equals(this.accessToken, authResponse.accessToken) && + Objects.equals(this.refreshToken, authResponse.refreshToken) && + Objects.equals(this.expiresIn, authResponse.expiresIn)&& + Objects.equals(this.additionalProperties, authResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(profile, accessToken, refreshToken, expiresIn, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuthResponse {\n"); + sb.append(" profile: ").append(toIndentedString(profile)).append("\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" refreshToken: ").append(toIndentedString(refreshToken)).append("\n"); + sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Profile"); + openapiFields.add("access_token"); + openapiFields.add("refresh_token"); + openapiFields.add("expires_in"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 AuthResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AuthResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AuthResponse is not found in the empty JSON string", AuthResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `Profile` + if (jsonObj.get("Profile") != null && !jsonObj.get("Profile").isJsonNull()) { + Profile.validateJsonElement(jsonObj.get("Profile")); + } + if ((jsonObj.get("access_token") != null && !jsonObj.get("access_token").isJsonNull()) && !jsonObj.get("access_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `access_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("access_token").toString())); + } + if ((jsonObj.get("refresh_token") != null && !jsonObj.get("refresh_token").isJsonNull()) && !jsonObj.get("refresh_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `refresh_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refresh_token").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!AuthResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AuthResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<AuthResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AuthResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<AuthResponse>() { + @Override + public void write(JsonWriter out, AuthResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AuthResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AuthResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AuthResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of AuthResponse + * @throws IOException if the JSON string is invalid with respect to AuthResponse + */ + public static AuthResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AuthResponse.class); + } + + /** + * Convert an instance of AuthResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/AuthResponseEmailVerification.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/AuthResponseEmailVerification.java new file mode 100644 index 0000000..6815e61 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/AuthResponseEmailVerification.java @@ -0,0 +1,316 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.AuthResponseEmailVerificationData; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * AuthResponseEmailVerification + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class AuthResponseEmailVerification { + public static final String SERIALIZED_NAME_IS_POSTED = "IsPosted"; + @SerializedName(SERIALIZED_NAME_IS_POSTED) + @javax.annotation.Nullable + private Boolean isPosted; + + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private AuthResponseEmailVerificationData data; + + public AuthResponseEmailVerification() { + } + + public AuthResponseEmailVerification isPosted(@javax.annotation.Nullable Boolean isPosted) { + this.isPosted = isPosted; + return this; + } + + /** + * Get isPosted + * @return isPosted + */ + @javax.annotation.Nullable + public Boolean getIsPosted() { + return isPosted; + } + + public void setIsPosted(@javax.annotation.Nullable Boolean isPosted) { + this.isPosted = isPosted; + } + + + public AuthResponseEmailVerification data(@javax.annotation.Nullable AuthResponseEmailVerificationData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public AuthResponseEmailVerificationData getData() { + return data; + } + + public void setData(@javax.annotation.Nullable AuthResponseEmailVerificationData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AuthResponseEmailVerification instance itself + */ + public AuthResponseEmailVerification putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthResponseEmailVerification authResponseEmailVerification = (AuthResponseEmailVerification) o; + return Objects.equals(this.isPosted, authResponseEmailVerification.isPosted) && + Objects.equals(this.data, authResponseEmailVerification.data)&& + Objects.equals(this.additionalProperties, authResponseEmailVerification.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isPosted, data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuthResponseEmailVerification {\n"); + sb.append(" isPosted: ").append(toIndentedString(isPosted)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsPosted"); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 AuthResponseEmailVerification + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AuthResponseEmailVerification.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AuthResponseEmailVerification is not found in the empty JSON string", AuthResponseEmailVerification.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `Data` + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + AuthResponseEmailVerificationData.validateJsonElement(jsonObj.get("Data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!AuthResponseEmailVerification.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AuthResponseEmailVerification' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<AuthResponseEmailVerification> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AuthResponseEmailVerification.class)); + + return (TypeAdapter<T>) new TypeAdapter<AuthResponseEmailVerification>() { + @Override + public void write(JsonWriter out, AuthResponseEmailVerification value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AuthResponseEmailVerification read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AuthResponseEmailVerification instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AuthResponseEmailVerification given an JSON string + * + * @param jsonString JSON string + * @return An instance of AuthResponseEmailVerification + * @throws IOException if the JSON string is invalid with respect to AuthResponseEmailVerification + */ + public static AuthResponseEmailVerification fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AuthResponseEmailVerification.class); + } + + /** + * Convert an instance of AuthResponseEmailVerification to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/AuthResponseEmailVerificationData.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/AuthResponseEmailVerificationData.java new file mode 100644 index 0000000..624b41e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/AuthResponseEmailVerificationData.java @@ -0,0 +1,287 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * AuthResponseEmailVerificationData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class AuthResponseEmailVerificationData { + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private String email; + + public AuthResponseEmailVerificationData() { + } + + public AuthResponseEmailVerificationData email(@javax.annotation.Nullable String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable String email) { + this.email = email; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AuthResponseEmailVerificationData instance itself + */ + public AuthResponseEmailVerificationData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthResponseEmailVerificationData authResponseEmailVerificationData = (AuthResponseEmailVerificationData) o; + return Objects.equals(this.email, authResponseEmailVerificationData.email)&& + Objects.equals(this.additionalProperties, authResponseEmailVerificationData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuthResponseEmailVerificationData {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 AuthResponseEmailVerificationData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AuthResponseEmailVerificationData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AuthResponseEmailVerificationData is not found in the empty JSON string", AuthResponseEmailVerificationData.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Email") != null && !jsonObj.get("Email").isJsonNull()) && !jsonObj.get("Email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Email").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!AuthResponseEmailVerificationData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AuthResponseEmailVerificationData' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<AuthResponseEmailVerificationData> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AuthResponseEmailVerificationData.class)); + + return (TypeAdapter<T>) new TypeAdapter<AuthResponseEmailVerificationData>() { + @Override + public void write(JsonWriter out, AuthResponseEmailVerificationData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AuthResponseEmailVerificationData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AuthResponseEmailVerificationData instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AuthResponseEmailVerificationData given an JSON string + * + * @param jsonString JSON string + * @return An instance of AuthResponseEmailVerificationData + * @throws IOException if the JSON string is invalid with respect to AuthResponseEmailVerificationData + */ + public static AuthResponseEmailVerificationData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AuthResponseEmailVerificationData.class); + } + + /** + * Convert an instance of AuthResponseEmailVerificationData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/AuthResponseForgotReset.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/AuthResponseForgotReset.java new file mode 100644 index 0000000..06f3646 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/AuthResponseForgotReset.java @@ -0,0 +1,316 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.AuthResponse; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * AuthResponseForgotReset + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class AuthResponseForgotReset { + public static final String SERIALIZED_NAME_IS_POSTED = "IsPosted"; + @SerializedName(SERIALIZED_NAME_IS_POSTED) + @javax.annotation.Nullable + private Boolean isPosted; + + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private AuthResponse data; + + public AuthResponseForgotReset() { + } + + public AuthResponseForgotReset isPosted(@javax.annotation.Nullable Boolean isPosted) { + this.isPosted = isPosted; + return this; + } + + /** + * Get isPosted + * @return isPosted + */ + @javax.annotation.Nullable + public Boolean getIsPosted() { + return isPosted; + } + + public void setIsPosted(@javax.annotation.Nullable Boolean isPosted) { + this.isPosted = isPosted; + } + + + public AuthResponseForgotReset data(@javax.annotation.Nullable AuthResponse data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public AuthResponse getData() { + return data; + } + + public void setData(@javax.annotation.Nullable AuthResponse data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AuthResponseForgotReset instance itself + */ + public AuthResponseForgotReset putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthResponseForgotReset authResponseForgotReset = (AuthResponseForgotReset) o; + return Objects.equals(this.isPosted, authResponseForgotReset.isPosted) && + Objects.equals(this.data, authResponseForgotReset.data)&& + Objects.equals(this.additionalProperties, authResponseForgotReset.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isPosted, data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuthResponseForgotReset {\n"); + sb.append(" isPosted: ").append(toIndentedString(isPosted)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsPosted"); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 AuthResponseForgotReset + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AuthResponseForgotReset.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AuthResponseForgotReset is not found in the empty JSON string", AuthResponseForgotReset.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `Data` + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + AuthResponse.validateJsonElement(jsonObj.get("Data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!AuthResponseForgotReset.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AuthResponseForgotReset' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<AuthResponseForgotReset> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AuthResponseForgotReset.class)); + + return (TypeAdapter<T>) new TypeAdapter<AuthResponseForgotReset>() { + @Override + public void write(JsonWriter out, AuthResponseForgotReset value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AuthResponseForgotReset read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AuthResponseForgotReset instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AuthResponseForgotReset given an JSON string + * + * @param jsonString JSON string + * @return An instance of AuthResponseForgotReset + * @throws IOException if the JSON string is invalid with respect to AuthResponseForgotReset + */ + public static AuthResponseForgotReset fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AuthResponseForgotReset.class); + } + + /** + * Convert an instance of AuthResponseForgotReset to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/AuthResponseOptionalMfa.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/AuthResponseOptionalMfa.java new file mode 100644 index 0000000..b8ae49b --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/AuthResponseOptionalMfa.java @@ -0,0 +1,415 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.Profile; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * AuthResponseOptionalMfa + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class AuthResponseOptionalMfa { + public static final String SERIALIZED_NAME_SECOND_FACTOR_AUTHENTICATION = "SecondFactorAuthentication"; + @SerializedName(SERIALIZED_NAME_SECOND_FACTOR_AUTHENTICATION) + @javax.annotation.Nullable + private Object secondFactorAuthentication; + + public static final String SERIALIZED_NAME_PROFILE = "Profile"; + @SerializedName(SERIALIZED_NAME_PROFILE) + @javax.annotation.Nullable + private Profile profile; + + public static final String SERIALIZED_NAME_ACCESS_TOKEN = "access_token"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN) + @javax.annotation.Nullable + private String accessToken; + + public static final String SERIALIZED_NAME_REFRESH_TOKEN = "refresh_token"; + @SerializedName(SERIALIZED_NAME_REFRESH_TOKEN) + @javax.annotation.Nullable + private String refreshToken; + + public static final String SERIALIZED_NAME_EXPIRES_IN = "expires_in"; + @SerializedName(SERIALIZED_NAME_EXPIRES_IN) + @javax.annotation.Nullable + private OffsetDateTime expiresIn; + + public AuthResponseOptionalMfa() { + } + + public AuthResponseOptionalMfa secondFactorAuthentication(@javax.annotation.Nullable Object secondFactorAuthentication) { + this.secondFactorAuthentication = secondFactorAuthentication; + return this; + } + + /** + * The two-factor authentication method response, if the User has 2FA enabled. + * @return secondFactorAuthentication + */ + @javax.annotation.Nullable + public Object getSecondFactorAuthentication() { + return secondFactorAuthentication; + } + + public void setSecondFactorAuthentication(@javax.annotation.Nullable Object secondFactorAuthentication) { + this.secondFactorAuthentication = secondFactorAuthentication; + } + + + public AuthResponseOptionalMfa profile(@javax.annotation.Nullable Profile profile) { + this.profile = profile; + return this; + } + + /** + * Get profile + * @return profile + */ + @javax.annotation.Nullable + public Profile getProfile() { + return profile; + } + + public void setProfile(@javax.annotation.Nullable Profile profile) { + this.profile = profile; + } + + + public AuthResponseOptionalMfa accessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Bearer token for authenticating API requests. + * @return accessToken + */ + @javax.annotation.Nullable + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + } + + + public AuthResponseOptionalMfa refreshToken(@javax.annotation.Nullable String refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + /** + * Long-lived token for obtaining new Access Tokens. + * @return refreshToken + */ + @javax.annotation.Nullable + public String getRefreshToken() { + return refreshToken; + } + + public void setRefreshToken(@javax.annotation.Nullable String refreshToken) { + this.refreshToken = refreshToken; + } + + + public AuthResponseOptionalMfa expiresIn(@javax.annotation.Nullable OffsetDateTime expiresIn) { + this.expiresIn = expiresIn; + return this; + } + + /** + * Expiration time of the Access Token in seconds. + * @return expiresIn + */ + @javax.annotation.Nullable + public OffsetDateTime getExpiresIn() { + return expiresIn; + } + + public void setExpiresIn(@javax.annotation.Nullable OffsetDateTime expiresIn) { + this.expiresIn = expiresIn; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AuthResponseOptionalMfa instance itself + */ + public AuthResponseOptionalMfa putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthResponseOptionalMfa authResponseOptionalMfa = (AuthResponseOptionalMfa) o; + return Objects.equals(this.secondFactorAuthentication, authResponseOptionalMfa.secondFactorAuthentication) && + Objects.equals(this.profile, authResponseOptionalMfa.profile) && + Objects.equals(this.accessToken, authResponseOptionalMfa.accessToken) && + Objects.equals(this.refreshToken, authResponseOptionalMfa.refreshToken) && + Objects.equals(this.expiresIn, authResponseOptionalMfa.expiresIn)&& + Objects.equals(this.additionalProperties, authResponseOptionalMfa.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(secondFactorAuthentication, profile, accessToken, refreshToken, expiresIn, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuthResponseOptionalMfa {\n"); + sb.append(" secondFactorAuthentication: ").append(toIndentedString(secondFactorAuthentication)).append("\n"); + sb.append(" profile: ").append(toIndentedString(profile)).append("\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" refreshToken: ").append(toIndentedString(refreshToken)).append("\n"); + sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Profile"); + openapiFields.add("access_token"); + openapiFields.add("refresh_token"); + openapiFields.add("expires_in"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 AuthResponseOptionalMfa + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AuthResponseOptionalMfa.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AuthResponseOptionalMfa is not found in the empty JSON string", AuthResponseOptionalMfa.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `Profile` + if (jsonObj.get("Profile") != null && !jsonObj.get("Profile").isJsonNull()) { + Profile.validateJsonElement(jsonObj.get("Profile")); + } + if ((jsonObj.get("access_token") != null && !jsonObj.get("access_token").isJsonNull()) && !jsonObj.get("access_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `access_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("access_token").toString())); + } + if ((jsonObj.get("refresh_token") != null && !jsonObj.get("refresh_token").isJsonNull()) && !jsonObj.get("refresh_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `refresh_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refresh_token").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!AuthResponseOptionalMfa.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AuthResponseOptionalMfa' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<AuthResponseOptionalMfa> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AuthResponseOptionalMfa.class)); + + return (TypeAdapter<T>) new TypeAdapter<AuthResponseOptionalMfa>() { + @Override + public void write(JsonWriter out, AuthResponseOptionalMfa value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AuthResponseOptionalMfa read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AuthResponseOptionalMfa instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AuthResponseOptionalMfa given an JSON string + * + * @param jsonString JSON string + * @return An instance of AuthResponseOptionalMfa + * @throws IOException if the JSON string is invalid with respect to AuthResponseOptionalMfa + */ + public static AuthResponseOptionalMfa fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AuthResponseOptionalMfa.class); + } + + /** + * Convert an instance of AuthResponseOptionalMfa to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/AuthResponseRequiredMfa.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/AuthResponseRequiredMfa.java new file mode 100644 index 0000000..cc3702f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/AuthResponseRequiredMfa.java @@ -0,0 +1,905 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.EmailOTPStatus; +import com.loginradius.sdk.internal.openapi.model.SMSResponseData; +import com.loginradius.sdk.internal.openapi.model.SecurityQuestions; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * AuthResponseRequiredMfa + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class AuthResponseRequiredMfa { + public static final String SERIALIZED_NAME_SECOND_FACTOR_AUTHENTICATION_TOKEN = "SecondFactorAuthenticationToken"; + @SerializedName(SERIALIZED_NAME_SECOND_FACTOR_AUTHENTICATION_TOKEN) + @javax.annotation.Nullable + private String secondFactorAuthenticationToken; + + public static final String SERIALIZED_NAME_EXPIRE_IN = "ExpireIn"; + @SerializedName(SERIALIZED_NAME_EXPIRE_IN) + @javax.annotation.Nullable + private OffsetDateTime expireIn; + + public static final String SERIALIZED_NAME_QR_CODE = "QRCode"; + @SerializedName(SERIALIZED_NAME_QR_CODE) + @javax.annotation.Nullable + private String qrCode; + + public static final String SERIALIZED_NAME_PUSH_Q_R_CODE = "PushQRCode"; + @SerializedName(SERIALIZED_NAME_PUSH_Q_R_CODE) + @javax.annotation.Nullable + private String pushQRCode; + + public static final String SERIALIZED_NAME_MANUAL_ENTRY_CODE = "ManualEntryCode"; + @SerializedName(SERIALIZED_NAME_MANUAL_ENTRY_CODE) + @javax.annotation.Nullable + private String manualEntryCode; + + public static final String SERIALIZED_NAME_DUO_AUTH_ENDPOINT = "DuoAuthEndpoint"; + @SerializedName(SERIALIZED_NAME_DUO_AUTH_ENDPOINT) + @javax.annotation.Nullable + private String duoAuthEndpoint; + + public static final String SERIALIZED_NAME_IS_GOOGLE_AUTHENTICATOR_VERIFIED = "IsGoogleAuthenticatorVerified"; + @SerializedName(SERIALIZED_NAME_IS_GOOGLE_AUTHENTICATOR_VERIFIED) + @javax.annotation.Nullable + private Boolean isGoogleAuthenticatorVerified; + + public static final String SERIALIZED_NAME_IS_PUSH_DEVICE_REGISTERED = "IsPushDeviceRegistered"; + @SerializedName(SERIALIZED_NAME_IS_PUSH_DEVICE_REGISTERED) + @javax.annotation.Nullable + private Boolean isPushDeviceRegistered; + + public static final String SERIALIZED_NAME_IS_AUTHENTICATOR_VERIFIED = "IsAuthenticatorVerified"; + @SerializedName(SERIALIZED_NAME_IS_AUTHENTICATOR_VERIFIED) + @javax.annotation.Nullable + private Boolean isAuthenticatorVerified; + + public static final String SERIALIZED_NAME_IS_EMAIL_OTP_AUTHENTICATOR_VERIFIED = "IsEmailOtpAuthenticatorVerified"; + @SerializedName(SERIALIZED_NAME_IS_EMAIL_OTP_AUTHENTICATOR_VERIFIED) + @javax.annotation.Nullable + private Boolean isEmailOtpAuthenticatorVerified; + + public static final String SERIALIZED_NAME_IS_O_T_P_AUTHENTICATOR_VERIFIED = "IsOTPAuthenticatorVerified"; + @SerializedName(SERIALIZED_NAME_IS_O_T_P_AUTHENTICATOR_VERIFIED) + @javax.annotation.Nullable + private Boolean isOTPAuthenticatorVerified; + + public static final String SERIALIZED_NAME_IS_DUO_AUTHENTICATOR_VERIFIED = "IsDuoAuthenticatorVerified"; + @SerializedName(SERIALIZED_NAME_IS_DUO_AUTHENTICATOR_VERIFIED) + @javax.annotation.Nullable + private Boolean isDuoAuthenticatorVerified; + + public static final String SERIALIZED_NAME_IS_PASSKEY_AUTHENTICATOR_VERIFIED = "IsPasskeyAuthenticatorVerified"; + @SerializedName(SERIALIZED_NAME_IS_PASSKEY_AUTHENTICATOR_VERIFIED) + @javax.annotation.Nullable + private Boolean isPasskeyAuthenticatorVerified; + + public static final String SERIALIZED_NAME_OT_P_PHONE_NO = "OTPPhoneNo"; + @SerializedName(SERIALIZED_NAME_OT_P_PHONE_NO) + @javax.annotation.Nullable + private String otPPhoneNo; + + public static final String SERIALIZED_NAME_OT_P_STATUS = "OTPStatus"; + @SerializedName(SERIALIZED_NAME_OT_P_STATUS) + @javax.annotation.Nullable + private SMSResponseData otPStatus; + + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private List<String> email = new ArrayList<>(); + + public static final String SERIALIZED_NAME_EMAIL_O_T_P_STATUS = "EmailOTPStatus"; + @SerializedName(SERIALIZED_NAME_EMAIL_O_T_P_STATUS) + @javax.annotation.Nullable + private EmailOTPStatus emailOTPStatus; + + public static final String SERIALIZED_NAME_IS_SECURITY_QUESTION_AUTHENTICATOR_VERIFIED = "IsSecurityQuestionAuthenticatorVerified"; + @SerializedName(SERIALIZED_NAME_IS_SECURITY_QUESTION_AUTHENTICATOR_VERIFIED) + @javax.annotation.Nullable + private Boolean isSecurityQuestionAuthenticatorVerified; + + public static final String SERIALIZED_NAME_SECURITY_QUESTIONS = "SecurityQuestions"; + @SerializedName(SERIALIZED_NAME_SECURITY_QUESTIONS) + @javax.annotation.Nullable + private List<SecurityQuestions> securityQuestions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ACCESS_TOKEN = "access_token"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN) + @javax.annotation.Nullable + private String accessToken; + + public static final String SERIALIZED_NAME_EXPIRES_IN = "expires_in"; + @SerializedName(SERIALIZED_NAME_EXPIRES_IN) + @javax.annotation.Nullable + private OffsetDateTime expiresIn; + + public AuthResponseRequiredMfa() { + } + + public AuthResponseRequiredMfa secondFactorAuthenticationToken(@javax.annotation.Nullable String secondFactorAuthenticationToken) { + this.secondFactorAuthenticationToken = secondFactorAuthenticationToken; + return this; + } + + /** + * Token for second factor authentication + * @return secondFactorAuthenticationToken + */ + @javax.annotation.Nullable + public String getSecondFactorAuthenticationToken() { + return secondFactorAuthenticationToken; + } + + public void setSecondFactorAuthenticationToken(@javax.annotation.Nullable String secondFactorAuthenticationToken) { + this.secondFactorAuthenticationToken = secondFactorAuthenticationToken; + } + + + public AuthResponseRequiredMfa expireIn(@javax.annotation.Nullable OffsetDateTime expireIn) { + this.expireIn = expireIn; + return this; + } + + /** + * Expiration time of the token + * @return expireIn + */ + @javax.annotation.Nullable + public OffsetDateTime getExpireIn() { + return expireIn; + } + + public void setExpireIn(@javax.annotation.Nullable OffsetDateTime expireIn) { + this.expireIn = expireIn; + } + + + public AuthResponseRequiredMfa qrCode(@javax.annotation.Nullable String qrCode) { + this.qrCode = qrCode; + return this; + } + + /** + * Get qrCode + * @return qrCode + */ + @javax.annotation.Nullable + public String getQrCode() { + return qrCode; + } + + public void setQrCode(@javax.annotation.Nullable String qrCode) { + this.qrCode = qrCode; + } + + + public AuthResponseRequiredMfa pushQRCode(@javax.annotation.Nullable String pushQRCode) { + this.pushQRCode = pushQRCode; + return this; + } + + /** + * Get pushQRCode + * @return pushQRCode + */ + @javax.annotation.Nullable + public String getPushQRCode() { + return pushQRCode; + } + + public void setPushQRCode(@javax.annotation.Nullable String pushQRCode) { + this.pushQRCode = pushQRCode; + } + + + public AuthResponseRequiredMfa manualEntryCode(@javax.annotation.Nullable String manualEntryCode) { + this.manualEntryCode = manualEntryCode; + return this; + } + + /** + * Get manualEntryCode + * @return manualEntryCode + */ + @javax.annotation.Nullable + public String getManualEntryCode() { + return manualEntryCode; + } + + public void setManualEntryCode(@javax.annotation.Nullable String manualEntryCode) { + this.manualEntryCode = manualEntryCode; + } + + + public AuthResponseRequiredMfa duoAuthEndpoint(@javax.annotation.Nullable String duoAuthEndpoint) { + this.duoAuthEndpoint = duoAuthEndpoint; + return this; + } + + /** + * Get duoAuthEndpoint + * @return duoAuthEndpoint + */ + @javax.annotation.Nullable + public String getDuoAuthEndpoint() { + return duoAuthEndpoint; + } + + public void setDuoAuthEndpoint(@javax.annotation.Nullable String duoAuthEndpoint) { + this.duoAuthEndpoint = duoAuthEndpoint; + } + + + public AuthResponseRequiredMfa isGoogleAuthenticatorVerified(@javax.annotation.Nullable Boolean isGoogleAuthenticatorVerified) { + this.isGoogleAuthenticatorVerified = isGoogleAuthenticatorVerified; + return this; + } + + /** + * Get isGoogleAuthenticatorVerified + * @return isGoogleAuthenticatorVerified + */ + @javax.annotation.Nullable + public Boolean getIsGoogleAuthenticatorVerified() { + return isGoogleAuthenticatorVerified; + } + + public void setIsGoogleAuthenticatorVerified(@javax.annotation.Nullable Boolean isGoogleAuthenticatorVerified) { + this.isGoogleAuthenticatorVerified = isGoogleAuthenticatorVerified; + } + + + public AuthResponseRequiredMfa isPushDeviceRegistered(@javax.annotation.Nullable Boolean isPushDeviceRegistered) { + this.isPushDeviceRegistered = isPushDeviceRegistered; + return this; + } + + /** + * Get isPushDeviceRegistered + * @return isPushDeviceRegistered + */ + @javax.annotation.Nullable + public Boolean getIsPushDeviceRegistered() { + return isPushDeviceRegistered; + } + + public void setIsPushDeviceRegistered(@javax.annotation.Nullable Boolean isPushDeviceRegistered) { + this.isPushDeviceRegistered = isPushDeviceRegistered; + } + + + public AuthResponseRequiredMfa isAuthenticatorVerified(@javax.annotation.Nullable Boolean isAuthenticatorVerified) { + this.isAuthenticatorVerified = isAuthenticatorVerified; + return this; + } + + /** + * Get isAuthenticatorVerified + * @return isAuthenticatorVerified + */ + @javax.annotation.Nullable + public Boolean getIsAuthenticatorVerified() { + return isAuthenticatorVerified; + } + + public void setIsAuthenticatorVerified(@javax.annotation.Nullable Boolean isAuthenticatorVerified) { + this.isAuthenticatorVerified = isAuthenticatorVerified; + } + + + public AuthResponseRequiredMfa isEmailOtpAuthenticatorVerified(@javax.annotation.Nullable Boolean isEmailOtpAuthenticatorVerified) { + this.isEmailOtpAuthenticatorVerified = isEmailOtpAuthenticatorVerified; + return this; + } + + /** + * Get isEmailOtpAuthenticatorVerified + * @return isEmailOtpAuthenticatorVerified + */ + @javax.annotation.Nullable + public Boolean getIsEmailOtpAuthenticatorVerified() { + return isEmailOtpAuthenticatorVerified; + } + + public void setIsEmailOtpAuthenticatorVerified(@javax.annotation.Nullable Boolean isEmailOtpAuthenticatorVerified) { + this.isEmailOtpAuthenticatorVerified = isEmailOtpAuthenticatorVerified; + } + + + public AuthResponseRequiredMfa isOTPAuthenticatorVerified(@javax.annotation.Nullable Boolean isOTPAuthenticatorVerified) { + this.isOTPAuthenticatorVerified = isOTPAuthenticatorVerified; + return this; + } + + /** + * Get isOTPAuthenticatorVerified + * @return isOTPAuthenticatorVerified + */ + @javax.annotation.Nullable + public Boolean getIsOTPAuthenticatorVerified() { + return isOTPAuthenticatorVerified; + } + + public void setIsOTPAuthenticatorVerified(@javax.annotation.Nullable Boolean isOTPAuthenticatorVerified) { + this.isOTPAuthenticatorVerified = isOTPAuthenticatorVerified; + } + + + public AuthResponseRequiredMfa isDuoAuthenticatorVerified(@javax.annotation.Nullable Boolean isDuoAuthenticatorVerified) { + this.isDuoAuthenticatorVerified = isDuoAuthenticatorVerified; + return this; + } + + /** + * Get isDuoAuthenticatorVerified + * @return isDuoAuthenticatorVerified + */ + @javax.annotation.Nullable + public Boolean getIsDuoAuthenticatorVerified() { + return isDuoAuthenticatorVerified; + } + + public void setIsDuoAuthenticatorVerified(@javax.annotation.Nullable Boolean isDuoAuthenticatorVerified) { + this.isDuoAuthenticatorVerified = isDuoAuthenticatorVerified; + } + + + public AuthResponseRequiredMfa isPasskeyAuthenticatorVerified(@javax.annotation.Nullable Boolean isPasskeyAuthenticatorVerified) { + this.isPasskeyAuthenticatorVerified = isPasskeyAuthenticatorVerified; + return this; + } + + /** + * Get isPasskeyAuthenticatorVerified + * @return isPasskeyAuthenticatorVerified + */ + @javax.annotation.Nullable + public Boolean getIsPasskeyAuthenticatorVerified() { + return isPasskeyAuthenticatorVerified; + } + + public void setIsPasskeyAuthenticatorVerified(@javax.annotation.Nullable Boolean isPasskeyAuthenticatorVerified) { + this.isPasskeyAuthenticatorVerified = isPasskeyAuthenticatorVerified; + } + + + public AuthResponseRequiredMfa otPPhoneNo(@javax.annotation.Nullable String otPPhoneNo) { + this.otPPhoneNo = otPPhoneNo; + return this; + } + + /** + * Get otPPhoneNo + * @return otPPhoneNo + */ + @javax.annotation.Nullable + public String getOtPPhoneNo() { + return otPPhoneNo; + } + + public void setOtPPhoneNo(@javax.annotation.Nullable String otPPhoneNo) { + this.otPPhoneNo = otPPhoneNo; + } + + + public AuthResponseRequiredMfa otPStatus(@javax.annotation.Nullable SMSResponseData otPStatus) { + this.otPStatus = otPStatus; + return this; + } + + /** + * Get otPStatus + * @return otPStatus + */ + @javax.annotation.Nullable + public SMSResponseData getOtPStatus() { + return otPStatus; + } + + public void setOtPStatus(@javax.annotation.Nullable SMSResponseData otPStatus) { + this.otPStatus = otPStatus; + } + + + public AuthResponseRequiredMfa email(@javax.annotation.Nullable List<String> email) { + this.email = email; + return this; + } + + public AuthResponseRequiredMfa addEmailItem(String emailItem) { + if (this.email == null) { + this.email = new ArrayList<>(); + } + this.email.add(emailItem); + return this; + } + + /** + * Get email + * @return email + */ + @javax.annotation.Nullable + public List<String> getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable List<String> email) { + this.email = email; + } + + + public AuthResponseRequiredMfa emailOTPStatus(@javax.annotation.Nullable EmailOTPStatus emailOTPStatus) { + this.emailOTPStatus = emailOTPStatus; + return this; + } + + /** + * Get emailOTPStatus + * @return emailOTPStatus + */ + @javax.annotation.Nullable + public EmailOTPStatus getEmailOTPStatus() { + return emailOTPStatus; + } + + public void setEmailOTPStatus(@javax.annotation.Nullable EmailOTPStatus emailOTPStatus) { + this.emailOTPStatus = emailOTPStatus; + } + + + public AuthResponseRequiredMfa isSecurityQuestionAuthenticatorVerified(@javax.annotation.Nullable Boolean isSecurityQuestionAuthenticatorVerified) { + this.isSecurityQuestionAuthenticatorVerified = isSecurityQuestionAuthenticatorVerified; + return this; + } + + /** + * Get isSecurityQuestionAuthenticatorVerified + * @return isSecurityQuestionAuthenticatorVerified + */ + @javax.annotation.Nullable + public Boolean getIsSecurityQuestionAuthenticatorVerified() { + return isSecurityQuestionAuthenticatorVerified; + } + + public void setIsSecurityQuestionAuthenticatorVerified(@javax.annotation.Nullable Boolean isSecurityQuestionAuthenticatorVerified) { + this.isSecurityQuestionAuthenticatorVerified = isSecurityQuestionAuthenticatorVerified; + } + + + public AuthResponseRequiredMfa securityQuestions(@javax.annotation.Nullable List<SecurityQuestions> securityQuestions) { + this.securityQuestions = securityQuestions; + return this; + } + + public AuthResponseRequiredMfa addSecurityQuestionsItem(SecurityQuestions securityQuestionsItem) { + if (this.securityQuestions == null) { + this.securityQuestions = new ArrayList<>(); + } + this.securityQuestions.add(securityQuestionsItem); + return this; + } + + /** + * Get securityQuestions + * @return securityQuestions + */ + @javax.annotation.Nullable + public List<SecurityQuestions> getSecurityQuestions() { + return securityQuestions; + } + + public void setSecurityQuestions(@javax.annotation.Nullable List<SecurityQuestions> securityQuestions) { + this.securityQuestions = securityQuestions; + } + + + public AuthResponseRequiredMfa accessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Empty access_token + * @return accessToken + */ + @javax.annotation.Nullable + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + } + + + public AuthResponseRequiredMfa expiresIn(@javax.annotation.Nullable OffsetDateTime expiresIn) { + this.expiresIn = expiresIn; + return this; + } + + /** + * Empty expires_in + * @return expiresIn + */ + @javax.annotation.Nullable + public OffsetDateTime getExpiresIn() { + return expiresIn; + } + + public void setExpiresIn(@javax.annotation.Nullable OffsetDateTime expiresIn) { + this.expiresIn = expiresIn; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AuthResponseRequiredMfa instance itself + */ + public AuthResponseRequiredMfa putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthResponseRequiredMfa authResponseRequiredMfa = (AuthResponseRequiredMfa) o; + return Objects.equals(this.secondFactorAuthenticationToken, authResponseRequiredMfa.secondFactorAuthenticationToken) && + Objects.equals(this.expireIn, authResponseRequiredMfa.expireIn) && + Objects.equals(this.qrCode, authResponseRequiredMfa.qrCode) && + Objects.equals(this.pushQRCode, authResponseRequiredMfa.pushQRCode) && + Objects.equals(this.manualEntryCode, authResponseRequiredMfa.manualEntryCode) && + Objects.equals(this.duoAuthEndpoint, authResponseRequiredMfa.duoAuthEndpoint) && + Objects.equals(this.isGoogleAuthenticatorVerified, authResponseRequiredMfa.isGoogleAuthenticatorVerified) && + Objects.equals(this.isPushDeviceRegistered, authResponseRequiredMfa.isPushDeviceRegistered) && + Objects.equals(this.isAuthenticatorVerified, authResponseRequiredMfa.isAuthenticatorVerified) && + Objects.equals(this.isEmailOtpAuthenticatorVerified, authResponseRequiredMfa.isEmailOtpAuthenticatorVerified) && + Objects.equals(this.isOTPAuthenticatorVerified, authResponseRequiredMfa.isOTPAuthenticatorVerified) && + Objects.equals(this.isDuoAuthenticatorVerified, authResponseRequiredMfa.isDuoAuthenticatorVerified) && + Objects.equals(this.isPasskeyAuthenticatorVerified, authResponseRequiredMfa.isPasskeyAuthenticatorVerified) && + Objects.equals(this.otPPhoneNo, authResponseRequiredMfa.otPPhoneNo) && + Objects.equals(this.otPStatus, authResponseRequiredMfa.otPStatus) && + Objects.equals(this.email, authResponseRequiredMfa.email) && + Objects.equals(this.emailOTPStatus, authResponseRequiredMfa.emailOTPStatus) && + Objects.equals(this.isSecurityQuestionAuthenticatorVerified, authResponseRequiredMfa.isSecurityQuestionAuthenticatorVerified) && + Objects.equals(this.securityQuestions, authResponseRequiredMfa.securityQuestions) && + Objects.equals(this.accessToken, authResponseRequiredMfa.accessToken) && + Objects.equals(this.expiresIn, authResponseRequiredMfa.expiresIn)&& + Objects.equals(this.additionalProperties, authResponseRequiredMfa.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(secondFactorAuthenticationToken, expireIn, qrCode, pushQRCode, manualEntryCode, duoAuthEndpoint, isGoogleAuthenticatorVerified, isPushDeviceRegistered, isAuthenticatorVerified, isEmailOtpAuthenticatorVerified, isOTPAuthenticatorVerified, isDuoAuthenticatorVerified, isPasskeyAuthenticatorVerified, otPPhoneNo, otPStatus, email, emailOTPStatus, isSecurityQuestionAuthenticatorVerified, securityQuestions, accessToken, expiresIn, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuthResponseRequiredMfa {\n"); + sb.append(" secondFactorAuthenticationToken: ").append(toIndentedString(secondFactorAuthenticationToken)).append("\n"); + sb.append(" expireIn: ").append(toIndentedString(expireIn)).append("\n"); + sb.append(" qrCode: ").append(toIndentedString(qrCode)).append("\n"); + sb.append(" pushQRCode: ").append(toIndentedString(pushQRCode)).append("\n"); + sb.append(" manualEntryCode: ").append(toIndentedString(manualEntryCode)).append("\n"); + sb.append(" duoAuthEndpoint: ").append(toIndentedString(duoAuthEndpoint)).append("\n"); + sb.append(" isGoogleAuthenticatorVerified: ").append(toIndentedString(isGoogleAuthenticatorVerified)).append("\n"); + sb.append(" isPushDeviceRegistered: ").append(toIndentedString(isPushDeviceRegistered)).append("\n"); + sb.append(" isAuthenticatorVerified: ").append(toIndentedString(isAuthenticatorVerified)).append("\n"); + sb.append(" isEmailOtpAuthenticatorVerified: ").append(toIndentedString(isEmailOtpAuthenticatorVerified)).append("\n"); + sb.append(" isOTPAuthenticatorVerified: ").append(toIndentedString(isOTPAuthenticatorVerified)).append("\n"); + sb.append(" isDuoAuthenticatorVerified: ").append(toIndentedString(isDuoAuthenticatorVerified)).append("\n"); + sb.append(" isPasskeyAuthenticatorVerified: ").append(toIndentedString(isPasskeyAuthenticatorVerified)).append("\n"); + sb.append(" otPPhoneNo: ").append(toIndentedString(otPPhoneNo)).append("\n"); + sb.append(" otPStatus: ").append(toIndentedString(otPStatus)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" emailOTPStatus: ").append(toIndentedString(emailOTPStatus)).append("\n"); + sb.append(" isSecurityQuestionAuthenticatorVerified: ").append(toIndentedString(isSecurityQuestionAuthenticatorVerified)).append("\n"); + sb.append(" securityQuestions: ").append(toIndentedString(securityQuestions)).append("\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("SecondFactorAuthenticationToken"); + openapiFields.add("ExpireIn"); + openapiFields.add("QRCode"); + openapiFields.add("PushQRCode"); + openapiFields.add("ManualEntryCode"); + openapiFields.add("DuoAuthEndpoint"); + openapiFields.add("IsGoogleAuthenticatorVerified"); + openapiFields.add("IsPushDeviceRegistered"); + openapiFields.add("IsAuthenticatorVerified"); + openapiFields.add("IsEmailOtpAuthenticatorVerified"); + openapiFields.add("IsOTPAuthenticatorVerified"); + openapiFields.add("IsDuoAuthenticatorVerified"); + openapiFields.add("IsPasskeyAuthenticatorVerified"); + openapiFields.add("OTPPhoneNo"); + openapiFields.add("OTPStatus"); + openapiFields.add("Email"); + openapiFields.add("EmailOTPStatus"); + openapiFields.add("IsSecurityQuestionAuthenticatorVerified"); + openapiFields.add("SecurityQuestions"); + openapiFields.add("access_token"); + openapiFields.add("expires_in"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 AuthResponseRequiredMfa + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AuthResponseRequiredMfa.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AuthResponseRequiredMfa is not found in the empty JSON string", AuthResponseRequiredMfa.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("SecondFactorAuthenticationToken") != null && !jsonObj.get("SecondFactorAuthenticationToken").isJsonNull()) && !jsonObj.get("SecondFactorAuthenticationToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SecondFactorAuthenticationToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SecondFactorAuthenticationToken").toString())); + } + if ((jsonObj.get("QRCode") != null && !jsonObj.get("QRCode").isJsonNull()) && !jsonObj.get("QRCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `QRCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("QRCode").toString())); + } + if ((jsonObj.get("PushQRCode") != null && !jsonObj.get("PushQRCode").isJsonNull()) && !jsonObj.get("PushQRCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PushQRCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PushQRCode").toString())); + } + if ((jsonObj.get("ManualEntryCode") != null && !jsonObj.get("ManualEntryCode").isJsonNull()) && !jsonObj.get("ManualEntryCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ManualEntryCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ManualEntryCode").toString())); + } + if ((jsonObj.get("DuoAuthEndpoint") != null && !jsonObj.get("DuoAuthEndpoint").isJsonNull()) && !jsonObj.get("DuoAuthEndpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DuoAuthEndpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DuoAuthEndpoint").toString())); + } + if ((jsonObj.get("OTPPhoneNo") != null && !jsonObj.get("OTPPhoneNo").isJsonNull()) && !jsonObj.get("OTPPhoneNo").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `OTPPhoneNo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("OTPPhoneNo").toString())); + } + // validate the optional field `OTPStatus` + if (jsonObj.get("OTPStatus") != null && !jsonObj.get("OTPStatus").isJsonNull()) { + SMSResponseData.validateJsonElement(jsonObj.get("OTPStatus")); + } + // ensure the optional json data is an array if present + if (jsonObj.get("Email") != null && !jsonObj.get("Email").isJsonNull() && !jsonObj.get("Email").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Email` to be an array in the JSON string but got `%s`", jsonObj.get("Email").toString())); + } + // validate the optional field `EmailOTPStatus` + if (jsonObj.get("EmailOTPStatus") != null && !jsonObj.get("EmailOTPStatus").isJsonNull()) { + EmailOTPStatus.validateJsonElement(jsonObj.get("EmailOTPStatus")); + } + if (jsonObj.get("SecurityQuestions") != null && !jsonObj.get("SecurityQuestions").isJsonNull()) { + JsonArray jsonArraysecurityQuestions = jsonObj.getAsJsonArray("SecurityQuestions"); + if (jsonArraysecurityQuestions != null) { + // ensure the json data is an array + if (!jsonObj.get("SecurityQuestions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `SecurityQuestions` to be an array in the JSON string but got `%s`", jsonObj.get("SecurityQuestions").toString())); + } + + // validate the optional field `SecurityQuestions` (array) + for (int i = 0; i < jsonArraysecurityQuestions.size(); i++) { + SecurityQuestions.validateJsonElement(jsonArraysecurityQuestions.get(i)); + }; + } + } + if ((jsonObj.get("access_token") != null && !jsonObj.get("access_token").isJsonNull()) && !jsonObj.get("access_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `access_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("access_token").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!AuthResponseRequiredMfa.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AuthResponseRequiredMfa' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<AuthResponseRequiredMfa> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AuthResponseRequiredMfa.class)); + + return (TypeAdapter<T>) new TypeAdapter<AuthResponseRequiredMfa>() { + @Override + public void write(JsonWriter out, AuthResponseRequiredMfa value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AuthResponseRequiredMfa read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AuthResponseRequiredMfa instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AuthResponseRequiredMfa given an JSON string + * + * @param jsonString JSON string + * @return An instance of AuthResponseRequiredMfa + * @throws IOException if the JSON string is invalid with respect to AuthResponseRequiredMfa + */ + public static AuthResponseRequiredMfa fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AuthResponseRequiredMfa.class); + } + + /** + * Convert an instance of AuthResponseRequiredMfa to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/AuthResponseRequiredMfaCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/AuthResponseRequiredMfaCore.java new file mode 100644 index 0000000..16e960a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/AuthResponseRequiredMfaCore.java @@ -0,0 +1,315 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * AuthResponseRequiredMfaCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class AuthResponseRequiredMfaCore { + public static final String SERIALIZED_NAME_ACCESS_TOKEN = "access_token"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN) + @javax.annotation.Nullable + private String accessToken; + + public static final String SERIALIZED_NAME_EXPIRES_IN = "expires_in"; + @SerializedName(SERIALIZED_NAME_EXPIRES_IN) + @javax.annotation.Nullable + private OffsetDateTime expiresIn; + + public AuthResponseRequiredMfaCore() { + } + + public AuthResponseRequiredMfaCore accessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Empty access_token + * @return accessToken + */ + @javax.annotation.Nullable + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + } + + + public AuthResponseRequiredMfaCore expiresIn(@javax.annotation.Nullable OffsetDateTime expiresIn) { + this.expiresIn = expiresIn; + return this; + } + + /** + * Empty expires_in + * @return expiresIn + */ + @javax.annotation.Nullable + public OffsetDateTime getExpiresIn() { + return expiresIn; + } + + public void setExpiresIn(@javax.annotation.Nullable OffsetDateTime expiresIn) { + this.expiresIn = expiresIn; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AuthResponseRequiredMfaCore instance itself + */ + public AuthResponseRequiredMfaCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthResponseRequiredMfaCore authResponseRequiredMfaCore = (AuthResponseRequiredMfaCore) o; + return Objects.equals(this.accessToken, authResponseRequiredMfaCore.accessToken) && + Objects.equals(this.expiresIn, authResponseRequiredMfaCore.expiresIn)&& + Objects.equals(this.additionalProperties, authResponseRequiredMfaCore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accessToken, expiresIn, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuthResponseRequiredMfaCore {\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("access_token"); + openapiFields.add("expires_in"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 AuthResponseRequiredMfaCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AuthResponseRequiredMfaCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AuthResponseRequiredMfaCore is not found in the empty JSON string", AuthResponseRequiredMfaCore.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("access_token") != null && !jsonObj.get("access_token").isJsonNull()) && !jsonObj.get("access_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `access_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("access_token").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!AuthResponseRequiredMfaCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AuthResponseRequiredMfaCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<AuthResponseRequiredMfaCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AuthResponseRequiredMfaCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<AuthResponseRequiredMfaCore>() { + @Override + public void write(JsonWriter out, AuthResponseRequiredMfaCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AuthResponseRequiredMfaCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AuthResponseRequiredMfaCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AuthResponseRequiredMfaCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of AuthResponseRequiredMfaCore + * @throws IOException if the JSON string is invalid with respect to AuthResponseRequiredMfaCore + */ + public static AuthResponseRequiredMfaCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AuthResponseRequiredMfaCore.class); + } + + /** + * Convert an instance of AuthResponseRequiredMfaCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/AuthResponseWithoutIdentites.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/AuthResponseWithoutIdentites.java new file mode 100644 index 0000000..c2ceb44 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/AuthResponseWithoutIdentites.java @@ -0,0 +1,379 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentities; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * AuthResponseWithoutIdentites + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class AuthResponseWithoutIdentites { + public static final String SERIALIZED_NAME_PROFILE = "Profile"; + @SerializedName(SERIALIZED_NAME_PROFILE) + @javax.annotation.Nullable + private ProfileWithoutIdentities profile; + + public static final String SERIALIZED_NAME_ACCESS_TOKEN = "access_token"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN) + @javax.annotation.Nullable + private String accessToken; + + public static final String SERIALIZED_NAME_REFRESH_TOKEN = "refresh_token"; + @SerializedName(SERIALIZED_NAME_REFRESH_TOKEN) + @javax.annotation.Nullable + private String refreshToken; + + public static final String SERIALIZED_NAME_EXPIRES_IN = "expires_in"; + @SerializedName(SERIALIZED_NAME_EXPIRES_IN) + @javax.annotation.Nullable + private String expiresIn; + + public AuthResponseWithoutIdentites() { + } + + public AuthResponseWithoutIdentites profile(@javax.annotation.Nullable ProfileWithoutIdentities profile) { + this.profile = profile; + return this; + } + + /** + * Get profile + * @return profile + */ + @javax.annotation.Nullable + public ProfileWithoutIdentities getProfile() { + return profile; + } + + public void setProfile(@javax.annotation.Nullable ProfileWithoutIdentities profile) { + this.profile = profile; + } + + + public AuthResponseWithoutIdentites accessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Bearer token for authenticating API requests. + * @return accessToken + */ + @javax.annotation.Nullable + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + } + + + public AuthResponseWithoutIdentites refreshToken(@javax.annotation.Nullable String refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + /** + * Long-lived token for obtaining new Access Tokens. + * @return refreshToken + */ + @javax.annotation.Nullable + public String getRefreshToken() { + return refreshToken; + } + + public void setRefreshToken(@javax.annotation.Nullable String refreshToken) { + this.refreshToken = refreshToken; + } + + + public AuthResponseWithoutIdentites expiresIn(@javax.annotation.Nullable String expiresIn) { + this.expiresIn = expiresIn; + return this; + } + + /** + * Expiration time of the Access Token in seconds. + * @return expiresIn + */ + @javax.annotation.Nullable + public String getExpiresIn() { + return expiresIn; + } + + public void setExpiresIn(@javax.annotation.Nullable String expiresIn) { + this.expiresIn = expiresIn; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AuthResponseWithoutIdentites instance itself + */ + public AuthResponseWithoutIdentites putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthResponseWithoutIdentites authResponseWithoutIdentites = (AuthResponseWithoutIdentites) o; + return Objects.equals(this.profile, authResponseWithoutIdentites.profile) && + Objects.equals(this.accessToken, authResponseWithoutIdentites.accessToken) && + Objects.equals(this.refreshToken, authResponseWithoutIdentites.refreshToken) && + Objects.equals(this.expiresIn, authResponseWithoutIdentites.expiresIn)&& + Objects.equals(this.additionalProperties, authResponseWithoutIdentites.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(profile, accessToken, refreshToken, expiresIn, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuthResponseWithoutIdentites {\n"); + sb.append(" profile: ").append(toIndentedString(profile)).append("\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" refreshToken: ").append(toIndentedString(refreshToken)).append("\n"); + sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Profile"); + openapiFields.add("access_token"); + openapiFields.add("refresh_token"); + openapiFields.add("expires_in"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 AuthResponseWithoutIdentites + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AuthResponseWithoutIdentites.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AuthResponseWithoutIdentites is not found in the empty JSON string", AuthResponseWithoutIdentites.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `Profile` + if (jsonObj.get("Profile") != null && !jsonObj.get("Profile").isJsonNull()) { + ProfileWithoutIdentities.validateJsonElement(jsonObj.get("Profile")); + } + if ((jsonObj.get("access_token") != null && !jsonObj.get("access_token").isJsonNull()) && !jsonObj.get("access_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `access_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("access_token").toString())); + } + if ((jsonObj.get("refresh_token") != null && !jsonObj.get("refresh_token").isJsonNull()) && !jsonObj.get("refresh_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `refresh_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refresh_token").toString())); + } + if ((jsonObj.get("expires_in") != null && !jsonObj.get("expires_in").isJsonNull()) && !jsonObj.get("expires_in").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `expires_in` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expires_in").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!AuthResponseWithoutIdentites.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AuthResponseWithoutIdentites' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<AuthResponseWithoutIdentites> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AuthResponseWithoutIdentites.class)); + + return (TypeAdapter<T>) new TypeAdapter<AuthResponseWithoutIdentites>() { + @Override + public void write(JsonWriter out, AuthResponseWithoutIdentites value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AuthResponseWithoutIdentites read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AuthResponseWithoutIdentites instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AuthResponseWithoutIdentites given an JSON string + * + * @param jsonString JSON string + * @return An instance of AuthResponseWithoutIdentites + * @throws IOException if the JSON string is invalid with respect to AuthResponseWithoutIdentites + */ + public static AuthResponseWithoutIdentites fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AuthResponseWithoutIdentites.class); + } + + /** + * Convert an instance of AuthResponseWithoutIdentites to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/AuthenticatorCodeRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/AuthenticatorCodeRequest.java new file mode 100644 index 0000000..964286c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/AuthenticatorCodeRequest.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * Body for the TOTP verification endpoints. LoginRadius has two authenticator generations and they do NOT share a field name: a tenant on Google Authenticator must send `googleauthenticatorcode`, while the newer generic authenticator uses `authenticatorcode`. Sending the wrong one returns ErrorCode 908 (\"The googleauthenticatorcode is a required parameter.\" / \"The authenticatorcode is a required parameter.\"), so both are declared here and callers populate whichever their tenant expects. DO NOT drop `googleauthenticatorcode` when refreshing this file from an external copy — tools/verify-spec-invariants.mjs will fail the build. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class AuthenticatorCodeRequest { + public static final String SERIALIZED_NAME_GOOGLEAUTHENTICATORCODE = "googleauthenticatorcode"; + @SerializedName(SERIALIZED_NAME_GOOGLEAUTHENTICATORCODE) + @javax.annotation.Nullable + private String googleauthenticatorcode; + + public static final String SERIALIZED_NAME_AUTHENTICATORCODE = "authenticatorcode"; + @SerializedName(SERIALIZED_NAME_AUTHENTICATORCODE) + @javax.annotation.Nullable + private String authenticatorcode; + + public AuthenticatorCodeRequest() { + } + + public AuthenticatorCodeRequest googleauthenticatorcode(@javax.annotation.Nullable String googleauthenticatorcode) { + this.googleauthenticatorcode = googleauthenticatorcode; + return this; + } + + /** + * The Google Authenticator (TOTP) code. Required by tenants configured for Google Authenticator. + * @return googleauthenticatorcode + */ + @javax.annotation.Nullable + public String getGoogleauthenticatorcode() { + return googleauthenticatorcode; + } + + public void setGoogleauthenticatorcode(@javax.annotation.Nullable String googleauthenticatorcode) { + this.googleauthenticatorcode = googleauthenticatorcode; + } + + + public AuthenticatorCodeRequest authenticatorcode(@javax.annotation.Nullable String authenticatorcode) { + this.authenticatorcode = authenticatorcode; + return this; + } + + /** + * The Authenticator code for multi-factor authentication. Used by tenants on the newer generic authenticator configuration. + * @return authenticatorcode + */ + @javax.annotation.Nullable + public String getAuthenticatorcode() { + return authenticatorcode; + } + + public void setAuthenticatorcode(@javax.annotation.Nullable String authenticatorcode) { + this.authenticatorcode = authenticatorcode; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the AuthenticatorCodeRequest instance itself + */ + public AuthenticatorCodeRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AuthenticatorCodeRequest authenticatorCodeRequest = (AuthenticatorCodeRequest) o; + return Objects.equals(this.googleauthenticatorcode, authenticatorCodeRequest.googleauthenticatorcode) && + Objects.equals(this.authenticatorcode, authenticatorCodeRequest.authenticatorcode)&& + Objects.equals(this.additionalProperties, authenticatorCodeRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(googleauthenticatorcode, authenticatorcode, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AuthenticatorCodeRequest {\n"); + sb.append(" googleauthenticatorcode: ").append(toIndentedString(googleauthenticatorcode)).append("\n"); + sb.append(" authenticatorcode: ").append(toIndentedString(authenticatorcode)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("googleauthenticatorcode"); + openapiFields.add("authenticatorcode"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 AuthenticatorCodeRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!AuthenticatorCodeRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in AuthenticatorCodeRequest is not found in the empty JSON string", AuthenticatorCodeRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("googleauthenticatorcode") != null && !jsonObj.get("googleauthenticatorcode").isJsonNull()) && !jsonObj.get("googleauthenticatorcode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `googleauthenticatorcode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("googleauthenticatorcode").toString())); + } + if ((jsonObj.get("authenticatorcode") != null && !jsonObj.get("authenticatorcode").isJsonNull()) && !jsonObj.get("authenticatorcode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `authenticatorcode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authenticatorcode").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!AuthenticatorCodeRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'AuthenticatorCodeRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<AuthenticatorCodeRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(AuthenticatorCodeRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<AuthenticatorCodeRequest>() { + @Override + public void write(JsonWriter out, AuthenticatorCodeRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public AuthenticatorCodeRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + AuthenticatorCodeRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of AuthenticatorCodeRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of AuthenticatorCodeRequest + * @throws IOException if the JSON string is invalid with respect to AuthenticatorCodeRequest + */ + public static AuthenticatorCodeRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, AuthenticatorCodeRequest.class); + } + + /** + * Convert an instance of AuthenticatorCodeRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/BasicAuthWebhook.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/BasicAuthWebhook.java new file mode 100644 index 0000000..2b44e3a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/BasicAuthWebhook.java @@ -0,0 +1,329 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * BasicAuthWebhook + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class BasicAuthWebhook { + public static final String SERIALIZED_NAME_USERNAME = "Username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nullable + private String username; + + public static final String SERIALIZED_NAME_PASSWORD = "Password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nullable + private String password; + + public BasicAuthWebhook() { + } + + public BasicAuthWebhook username(@javax.annotation.Nullable String username) { + this.username = username; + return this; + } + + /** + * The Username for basic authentication + * @return username + */ + @javax.annotation.Nullable + public String getUsername() { + return username; + } + + public void setUsername(@javax.annotation.Nullable String username) { + this.username = username; + } + + + public BasicAuthWebhook password(@javax.annotation.Nullable String password) { + this.password = password; + return this; + } + + /** + * The Password for basic authentication + * @return password + */ + @javax.annotation.Nullable + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nullable String password) { + this.password = password; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BasicAuthWebhook instance itself + */ + public BasicAuthWebhook putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BasicAuthWebhook basicAuthWebhook = (BasicAuthWebhook) o; + return Objects.equals(this.username, basicAuthWebhook.username) && + Objects.equals(this.password, basicAuthWebhook.password)&& + Objects.equals(this.additionalProperties, basicAuthWebhook.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(username, password, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BasicAuthWebhook {\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Username"); + openapiFields.add("Password"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 BasicAuthWebhook + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BasicAuthWebhook.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BasicAuthWebhook is not found in the empty JSON string", BasicAuthWebhook.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Username") != null && !jsonObj.get("Username").isJsonNull()) && !jsonObj.get("Username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Username").toString())); + } + if ((jsonObj.get("Password") != null && !jsonObj.get("Password").isJsonNull()) && !jsonObj.get("Password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Password").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!BasicAuthWebhook.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BasicAuthWebhook' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<BasicAuthWebhook> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BasicAuthWebhook.class)); + + return (TypeAdapter<T>) new TypeAdapter<BasicAuthWebhook>() { + @Override + public void write(JsonWriter out, BasicAuthWebhook value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public BasicAuthWebhook read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BasicAuthWebhook instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BasicAuthWebhook given an JSON string + * + * @param jsonString JSON string + * @return An instance of BasicAuthWebhook + * @throws IOException if the JSON string is invalid with respect to BasicAuthWebhook + */ + public static BasicAuthWebhook fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BasicAuthWebhook.class); + } + + /** + * Convert an instance of BasicAuthWebhook to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/BatchUpload.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/BatchUpload.java new file mode 100644 index 0000000..7b1c19e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/BatchUpload.java @@ -0,0 +1,377 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.DeltaMigrationModel; +import com.loginradius.sdk.internal.openapi.model.PasswordEncryptionModel; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModel; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * BatchUpload + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class BatchUpload { + public static final String SERIALIZED_NAME_PASSWORD_ENCRYPTION = "PasswordEncryption"; + @SerializedName(SERIALIZED_NAME_PASSWORD_ENCRYPTION) + @javax.annotation.Nullable + private PasswordEncryptionModel passwordEncryption; + + public static final String SERIALIZED_NAME_PROFILES = "Profiles"; + @SerializedName(SERIALIZED_NAME_PROFILES) + @javax.annotation.Nonnull + private List<ProfileRequestModel> profiles = new ArrayList<>(); + + public static final String SERIALIZED_NAME_DELTA_MIGRATION_MODEL = "DeltaMigrationModel"; + @SerializedName(SERIALIZED_NAME_DELTA_MIGRATION_MODEL) + @javax.annotation.Nullable + private DeltaMigrationModel deltaMigrationModel; + + public BatchUpload() { + } + + public BatchUpload passwordEncryption(@javax.annotation.Nullable PasswordEncryptionModel passwordEncryption) { + this.passwordEncryption = passwordEncryption; + return this; + } + + /** + * Get passwordEncryption + * @return passwordEncryption + */ + @javax.annotation.Nullable + public PasswordEncryptionModel getPasswordEncryption() { + return passwordEncryption; + } + + public void setPasswordEncryption(@javax.annotation.Nullable PasswordEncryptionModel passwordEncryption) { + this.passwordEncryption = passwordEncryption; + } + + + public BatchUpload profiles(@javax.annotation.Nonnull List<ProfileRequestModel> profiles) { + this.profiles = profiles; + return this; + } + + public BatchUpload addProfilesItem(ProfileRequestModel profilesItem) { + if (this.profiles == null) { + this.profiles = new ArrayList<>(); + } + this.profiles.add(profilesItem); + return this; + } + + /** + * A list of User profile objects to be uploaded in batch. + * @return profiles + */ + @javax.annotation.Nonnull + public List<ProfileRequestModel> getProfiles() { + return profiles; + } + + public void setProfiles(@javax.annotation.Nonnull List<ProfileRequestModel> profiles) { + this.profiles = profiles; + } + + + public BatchUpload deltaMigrationModel(@javax.annotation.Nullable DeltaMigrationModel deltaMigrationModel) { + this.deltaMigrationModel = deltaMigrationModel; + return this; + } + + /** + * Get deltaMigrationModel + * @return deltaMigrationModel + */ + @javax.annotation.Nullable + public DeltaMigrationModel getDeltaMigrationModel() { + return deltaMigrationModel; + } + + public void setDeltaMigrationModel(@javax.annotation.Nullable DeltaMigrationModel deltaMigrationModel) { + this.deltaMigrationModel = deltaMigrationModel; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BatchUpload instance itself + */ + public BatchUpload putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BatchUpload batchUpload = (BatchUpload) o; + return Objects.equals(this.passwordEncryption, batchUpload.passwordEncryption) && + Objects.equals(this.profiles, batchUpload.profiles) && + Objects.equals(this.deltaMigrationModel, batchUpload.deltaMigrationModel)&& + Objects.equals(this.additionalProperties, batchUpload.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(passwordEncryption, profiles, deltaMigrationModel, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BatchUpload {\n"); + sb.append(" passwordEncryption: ").append(toIndentedString(passwordEncryption)).append("\n"); + sb.append(" profiles: ").append(toIndentedString(profiles)).append("\n"); + sb.append(" deltaMigrationModel: ").append(toIndentedString(deltaMigrationModel)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("PasswordEncryption"); + openapiFields.add("Profiles"); + openapiFields.add("DeltaMigrationModel"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Profiles"); + } + + /** + * 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 BatchUpload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BatchUpload.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BatchUpload is not found in the empty JSON string", BatchUpload.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BatchUpload.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 optional field `PasswordEncryption` + if (jsonObj.get("PasswordEncryption") != null && !jsonObj.get("PasswordEncryption").isJsonNull()) { + PasswordEncryptionModel.validateJsonElement(jsonObj.get("PasswordEncryption")); + } + // ensure the json data is an array + if (!jsonObj.get("Profiles").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Profiles` to be an array in the JSON string but got `%s`", jsonObj.get("Profiles").toString())); + } + + JsonArray jsonArrayprofiles = jsonObj.getAsJsonArray("Profiles"); + // validate the required field `Profiles` (array) + for (int i = 0; i < jsonArrayprofiles.size(); i++) { + ProfileRequestModel.validateJsonElement(jsonArrayprofiles.get(i)); + }; + // validate the optional field `DeltaMigrationModel` + if (jsonObj.get("DeltaMigrationModel") != null && !jsonObj.get("DeltaMigrationModel").isJsonNull()) { + DeltaMigrationModel.validateJsonElement(jsonObj.get("DeltaMigrationModel")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!BatchUpload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BatchUpload' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<BatchUpload> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BatchUpload.class)); + + return (TypeAdapter<T>) new TypeAdapter<BatchUpload>() { + @Override + public void write(JsonWriter out, BatchUpload value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public BatchUpload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BatchUpload instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BatchUpload given an JSON string + * + * @param jsonString JSON string + * @return An instance of BatchUpload + * @throws IOException if the JSON string is invalid with respect to BatchUpload + */ + public static BatchUpload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BatchUpload.class); + } + + /** + * Convert an instance of BatchUpload to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/BatchUploadErrorResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/BatchUploadErrorResponse.java new file mode 100644 index 0000000..2edf449 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/BatchUploadErrorResponse.java @@ -0,0 +1,406 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.BatchUploadErrorResponseErrorsInner; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * BatchUploadErrorResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class BatchUploadErrorResponse { + public static final String SERIALIZED_NAME_ERROR_CODE = "ErrorCode"; + @SerializedName(SERIALIZED_NAME_ERROR_CODE) + @javax.annotation.Nonnull + private Integer errorCode; + + public static final String SERIALIZED_NAME_MESSAGE = "Message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + @javax.annotation.Nonnull + private String message; + + public static final String SERIALIZED_NAME_DESCRIPTION = "Description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nonnull + private String description; + + public static final String SERIALIZED_NAME_ERRORS = "Errors"; + @SerializedName(SERIALIZED_NAME_ERRORS) + @javax.annotation.Nullable + private List<BatchUploadErrorResponseErrorsInner> errors = new ArrayList<>(); + + public BatchUploadErrorResponse() { + } + + public BatchUploadErrorResponse errorCode(@javax.annotation.Nonnull Integer errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Error code for identifying the error type. + * @return errorCode + */ + @javax.annotation.Nonnull + public Integer getErrorCode() { + return errorCode; + } + + public void setErrorCode(@javax.annotation.Nonnull Integer errorCode) { + this.errorCode = errorCode; + } + + + public BatchUploadErrorResponse message(@javax.annotation.Nonnull String message) { + this.message = message; + return this; + } + + /** + * Brief message describing the error. + * @return message + */ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(@javax.annotation.Nonnull String message) { + this.message = message; + } + + + public BatchUploadErrorResponse description(@javax.annotation.Nonnull String description) { + this.description = description; + return this; + } + + /** + * Detailed description of the error. + * @return description + */ + @javax.annotation.Nonnull + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nonnull String description) { + this.description = description; + } + + + public BatchUploadErrorResponse errors(@javax.annotation.Nullable List<BatchUploadErrorResponseErrorsInner> errors) { + this.errors = errors; + return this; + } + + public BatchUploadErrorResponse addErrorsItem(BatchUploadErrorResponseErrorsInner errorsItem) { + if (this.errors == null) { + this.errors = new ArrayList<>(); + } + this.errors.add(errorsItem); + return this; + } + + /** + * List of individual field errors. + * @return errors + */ + @javax.annotation.Nullable + public List<BatchUploadErrorResponseErrorsInner> getErrors() { + return errors; + } + + public void setErrors(@javax.annotation.Nullable List<BatchUploadErrorResponseErrorsInner> errors) { + this.errors = errors; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BatchUploadErrorResponse instance itself + */ + public BatchUploadErrorResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BatchUploadErrorResponse batchUploadErrorResponse = (BatchUploadErrorResponse) o; + return Objects.equals(this.errorCode, batchUploadErrorResponse.errorCode) && + Objects.equals(this.message, batchUploadErrorResponse.message) && + Objects.equals(this.description, batchUploadErrorResponse.description) && + Objects.equals(this.errors, batchUploadErrorResponse.errors)&& + Objects.equals(this.additionalProperties, batchUploadErrorResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(errorCode, message, description, errors, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BatchUploadErrorResponse {\n"); + sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" errors: ").append(toIndentedString(errors)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ErrorCode"); + openapiFields.add("Message"); + openapiFields.add("Description"); + openapiFields.add("Errors"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("ErrorCode"); + openapiRequiredFields.add("Message"); + openapiRequiredFields.add("Description"); + } + + /** + * 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 BatchUploadErrorResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BatchUploadErrorResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BatchUploadErrorResponse is not found in the empty JSON string", BatchUploadErrorResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BatchUploadErrorResponse.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("Message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Message").toString())); + } + if (!jsonObj.get("Description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Description").toString())); + } + if (jsonObj.get("Errors") != null && !jsonObj.get("Errors").isJsonNull()) { + JsonArray jsonArrayerrors = jsonObj.getAsJsonArray("Errors"); + if (jsonArrayerrors != null) { + // ensure the json data is an array + if (!jsonObj.get("Errors").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Errors` to be an array in the JSON string but got `%s`", jsonObj.get("Errors").toString())); + } + + // validate the optional field `Errors` (array) + for (int i = 0; i < jsonArrayerrors.size(); i++) { + BatchUploadErrorResponseErrorsInner.validateJsonElement(jsonArrayerrors.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!BatchUploadErrorResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BatchUploadErrorResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<BatchUploadErrorResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BatchUploadErrorResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<BatchUploadErrorResponse>() { + @Override + public void write(JsonWriter out, BatchUploadErrorResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public BatchUploadErrorResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BatchUploadErrorResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BatchUploadErrorResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of BatchUploadErrorResponse + * @throws IOException if the JSON string is invalid with respect to BatchUploadErrorResponse + */ + public static BatchUploadErrorResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BatchUploadErrorResponse.class); + } + + /** + * Convert an instance of BatchUploadErrorResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/BatchUploadErrorResponseErrorsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/BatchUploadErrorResponseErrorsInner.java new file mode 100644 index 0000000..9250301 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/BatchUploadErrorResponseErrorsInner.java @@ -0,0 +1,326 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * BatchUploadErrorResponseErrorsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class BatchUploadErrorResponseErrorsInner { + public static final String SERIALIZED_NAME_FIELD_NAME = "FieldName"; + @SerializedName(SERIALIZED_NAME_FIELD_NAME) + @javax.annotation.Nonnull + private String fieldName; + + public static final String SERIALIZED_NAME_ERROR_MESSAGE = "ErrorMessage"; + @SerializedName(SERIALIZED_NAME_ERROR_MESSAGE) + @javax.annotation.Nonnull + private String errorMessage; + + public BatchUploadErrorResponseErrorsInner() { + } + + public BatchUploadErrorResponseErrorsInner fieldName(@javax.annotation.Nonnull String fieldName) { + this.fieldName = fieldName; + return this; + } + + /** + * Identifier for the record that caused the error. + * @return fieldName + */ + @javax.annotation.Nonnull + public String getFieldName() { + return fieldName; + } + + public void setFieldName(@javax.annotation.Nonnull String fieldName) { + this.fieldName = fieldName; + } + + + public BatchUploadErrorResponseErrorsInner errorMessage(@javax.annotation.Nonnull String errorMessage) { + this.errorMessage = errorMessage; + return this; + } + + /** + * Description of the specific error related to the field. + * @return errorMessage + */ + @javax.annotation.Nonnull + public String getErrorMessage() { + return errorMessage; + } + + public void setErrorMessage(@javax.annotation.Nonnull String errorMessage) { + this.errorMessage = errorMessage; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BatchUploadErrorResponseErrorsInner instance itself + */ + public BatchUploadErrorResponseErrorsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BatchUploadErrorResponseErrorsInner batchUploadErrorResponseErrorsInner = (BatchUploadErrorResponseErrorsInner) o; + return Objects.equals(this.fieldName, batchUploadErrorResponseErrorsInner.fieldName) && + Objects.equals(this.errorMessage, batchUploadErrorResponseErrorsInner.errorMessage)&& + Objects.equals(this.additionalProperties, batchUploadErrorResponseErrorsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(fieldName, errorMessage, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BatchUploadErrorResponseErrorsInner {\n"); + sb.append(" fieldName: ").append(toIndentedString(fieldName)).append("\n"); + sb.append(" errorMessage: ").append(toIndentedString(errorMessage)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("FieldName"); + openapiFields.add("ErrorMessage"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("FieldName"); + openapiRequiredFields.add("ErrorMessage"); + } + + /** + * 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 BatchUploadErrorResponseErrorsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BatchUploadErrorResponseErrorsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BatchUploadErrorResponseErrorsInner is not found in the empty JSON string", BatchUploadErrorResponseErrorsInner.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BatchUploadErrorResponseErrorsInner.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("FieldName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FieldName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FieldName").toString())); + } + if (!jsonObj.get("ErrorMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ErrorMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ErrorMessage").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!BatchUploadErrorResponseErrorsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BatchUploadErrorResponseErrorsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<BatchUploadErrorResponseErrorsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BatchUploadErrorResponseErrorsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<BatchUploadErrorResponseErrorsInner>() { + @Override + public void write(JsonWriter out, BatchUploadErrorResponseErrorsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public BatchUploadErrorResponseErrorsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BatchUploadErrorResponseErrorsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BatchUploadErrorResponseErrorsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of BatchUploadErrorResponseErrorsInner + * @throws IOException if the JSON string is invalid with respect to BatchUploadErrorResponseErrorsInner + */ + public static BatchUploadErrorResponseErrorsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BatchUploadErrorResponseErrorsInner.class); + } + + /** + * Convert an instance of BatchUploadErrorResponseErrorsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/BatchUploadResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/BatchUploadResponse.java new file mode 100644 index 0000000..a4fd42b --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/BatchUploadResponse.java @@ -0,0 +1,326 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.BulkInsertReport; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * BatchUploadResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class BatchUploadResponse { + public static final String SERIALIZED_NAME_PROFILE = "Profile"; + @SerializedName(SERIALIZED_NAME_PROFILE) + @javax.annotation.Nonnull + private BulkInsertReport profile; + + public static final String SERIALIZED_NAME_ROLES = "Roles"; + @SerializedName(SERIALIZED_NAME_ROLES) + @javax.annotation.Nullable + private BulkInsertReport roles; + + public BatchUploadResponse() { + } + + public BatchUploadResponse profile(@javax.annotation.Nonnull BulkInsertReport profile) { + this.profile = profile; + return this; + } + + /** + * Get profile + * @return profile + */ + @javax.annotation.Nonnull + public BulkInsertReport getProfile() { + return profile; + } + + public void setProfile(@javax.annotation.Nonnull BulkInsertReport profile) { + this.profile = profile; + } + + + public BatchUploadResponse roles(@javax.annotation.Nullable BulkInsertReport roles) { + this.roles = roles; + return this; + } + + /** + * Get roles + * @return roles + */ + @javax.annotation.Nullable + public BulkInsertReport getRoles() { + return roles; + } + + public void setRoles(@javax.annotation.Nullable BulkInsertReport roles) { + this.roles = roles; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BatchUploadResponse instance itself + */ + public BatchUploadResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BatchUploadResponse batchUploadResponse = (BatchUploadResponse) o; + return Objects.equals(this.profile, batchUploadResponse.profile) && + Objects.equals(this.roles, batchUploadResponse.roles)&& + Objects.equals(this.additionalProperties, batchUploadResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(profile, roles, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BatchUploadResponse {\n"); + sb.append(" profile: ").append(toIndentedString(profile)).append("\n"); + sb.append(" roles: ").append(toIndentedString(roles)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Profile"); + openapiFields.add("Roles"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Profile"); + } + + /** + * 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 BatchUploadResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BatchUploadResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BatchUploadResponse is not found in the empty JSON string", BatchUploadResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BatchUploadResponse.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 `Profile` + BulkInsertReport.validateJsonElement(jsonObj.get("Profile")); + // validate the optional field `Roles` + if (jsonObj.get("Roles") != null && !jsonObj.get("Roles").isJsonNull()) { + BulkInsertReport.validateJsonElement(jsonObj.get("Roles")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!BatchUploadResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BatchUploadResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<BatchUploadResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BatchUploadResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<BatchUploadResponse>() { + @Override + public void write(JsonWriter out, BatchUploadResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public BatchUploadResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BatchUploadResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BatchUploadResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of BatchUploadResponse + * @throws IOException if the JSON string is invalid with respect to BatchUploadResponse + */ + public static BatchUploadResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BatchUploadResponse.class); + } + + /** + * Convert an instance of BatchUploadResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/Bearertoken.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/Bearertoken.java new file mode 100644 index 0000000..34e5325 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/Bearertoken.java @@ -0,0 +1,299 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Bearertoken + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class Bearertoken { + public static final String SERIALIZED_NAME_TOKEN = "Token"; + @SerializedName(SERIALIZED_NAME_TOKEN) + @javax.annotation.Nullable + private String token; + + public Bearertoken() { + } + + public Bearertoken token(@javax.annotation.Nullable String token) { + this.token = token; + return this; + } + + /** + * The bearer token for authentication + * @return token + */ + @javax.annotation.Nullable + public String getToken() { + return token; + } + + public void setToken(@javax.annotation.Nullable String token) { + this.token = token; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Bearertoken instance itself + */ + public Bearertoken putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Bearertoken bearertoken = (Bearertoken) o; + return Objects.equals(this.token, bearertoken.token)&& + Objects.equals(this.additionalProperties, bearertoken.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(token, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Bearertoken {\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Token"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 Bearertoken + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Bearertoken.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Bearertoken is not found in the empty JSON string", Bearertoken.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Token") != null && !jsonObj.get("Token").isJsonNull()) && !jsonObj.get("Token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Token").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!Bearertoken.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Bearertoken' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<Bearertoken> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Bearertoken.class)); + + return (TypeAdapter<T>) new TypeAdapter<Bearertoken>() { + @Override + public void write(JsonWriter out, Bearertoken value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Bearertoken read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Bearertoken instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Bearertoken given an JSON string + * + * @param jsonString JSON string + * @return An instance of Bearertoken + * @throws IOException if the JSON string is invalid with respect to Bearertoken + */ + public static Bearertoken fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Bearertoken.class); + } + + /** + * Convert an instance of Bearertoken to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/BeginMFAPasskeyRegistration200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/BeginMFAPasskeyRegistration200Response.java new file mode 100644 index 0000000..a46690e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/BeginMFAPasskeyRegistration200Response.java @@ -0,0 +1,289 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Response object returned to initiate Passkey registration (WebAuthn) + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class BeginMFAPasskeyRegistration200Response { + public static final String SERIALIZED_NAME_REGISTER_BEGIN_CREDENTIAL = "RegisterBeginCredential"; + @SerializedName(SERIALIZED_NAME_REGISTER_BEGIN_CREDENTIAL) + @javax.annotation.Nullable + private BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential registerBeginCredential; + + public BeginMFAPasskeyRegistration200Response() { + } + + public BeginMFAPasskeyRegistration200Response registerBeginCredential(@javax.annotation.Nullable BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential registerBeginCredential) { + this.registerBeginCredential = registerBeginCredential; + return this; + } + + /** + * Get registerBeginCredential + * @return registerBeginCredential + */ + @javax.annotation.Nullable + public BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential getRegisterBeginCredential() { + return registerBeginCredential; + } + + public void setRegisterBeginCredential(@javax.annotation.Nullable BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential registerBeginCredential) { + this.registerBeginCredential = registerBeginCredential; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BeginMFAPasskeyRegistration200Response instance itself + */ + public BeginMFAPasskeyRegistration200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BeginMFAPasskeyRegistration200Response beginMFAPasskeyRegistration200Response = (BeginMFAPasskeyRegistration200Response) o; + return Objects.equals(this.registerBeginCredential, beginMFAPasskeyRegistration200Response.registerBeginCredential)&& + Objects.equals(this.additionalProperties, beginMFAPasskeyRegistration200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(registerBeginCredential, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BeginMFAPasskeyRegistration200Response {\n"); + sb.append(" registerBeginCredential: ").append(toIndentedString(registerBeginCredential)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("RegisterBeginCredential"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 BeginMFAPasskeyRegistration200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BeginMFAPasskeyRegistration200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BeginMFAPasskeyRegistration200Response is not found in the empty JSON string", BeginMFAPasskeyRegistration200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `RegisterBeginCredential` + if (jsonObj.get("RegisterBeginCredential") != null && !jsonObj.get("RegisterBeginCredential").isJsonNull()) { + BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential.validateJsonElement(jsonObj.get("RegisterBeginCredential")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!BeginMFAPasskeyRegistration200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BeginMFAPasskeyRegistration200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<BeginMFAPasskeyRegistration200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BeginMFAPasskeyRegistration200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<BeginMFAPasskeyRegistration200Response>() { + @Override + public void write(JsonWriter out, BeginMFAPasskeyRegistration200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public BeginMFAPasskeyRegistration200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BeginMFAPasskeyRegistration200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BeginMFAPasskeyRegistration200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of BeginMFAPasskeyRegistration200Response + * @throws IOException if the JSON string is invalid with respect to BeginMFAPasskeyRegistration200Response + */ + public static BeginMFAPasskeyRegistration200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BeginMFAPasskeyRegistration200Response.class); + } + + /** + * Convert an instance of BeginMFAPasskeyRegistration200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential.java new file mode 100644 index 0000000..45784a1 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential.java @@ -0,0 +1,289 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.PublicKeyCredentialCreationOptions; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Container for the WebAuthn registration initiation data + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential { + public static final String SERIALIZED_NAME_PUBLIC_KEY = "publicKey"; + @SerializedName(SERIALIZED_NAME_PUBLIC_KEY) + @javax.annotation.Nullable + private PublicKeyCredentialCreationOptions publicKey; + + public BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential() { + } + + public BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential publicKey(@javax.annotation.Nullable PublicKeyCredentialCreationOptions publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + * Get publicKey + * @return publicKey + */ + @javax.annotation.Nullable + public PublicKeyCredentialCreationOptions getPublicKey() { + return publicKey; + } + + public void setPublicKey(@javax.annotation.Nullable PublicKeyCredentialCreationOptions publicKey) { + this.publicKey = publicKey; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential instance itself + */ + public BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential beginMFAPasskeyRegistration200ResponseRegisterBeginCredential = (BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential) o; + return Objects.equals(this.publicKey, beginMFAPasskeyRegistration200ResponseRegisterBeginCredential.publicKey)&& + Objects.equals(this.additionalProperties, beginMFAPasskeyRegistration200ResponseRegisterBeginCredential.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(publicKey, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential {\n"); + sb.append(" publicKey: ").append(toIndentedString(publicKey)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("publicKey"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential is not found in the empty JSON string", BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `publicKey` + if (jsonObj.get("publicKey") != null && !jsonObj.get("publicKey").isJsonNull()) { + PublicKeyCredentialCreationOptions.validateJsonElement(jsonObj.get("publicKey")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential.class)); + + return (TypeAdapter<T>) new TypeAdapter<BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential>() { + @Override + public void write(JsonWriter out, BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential + * @throws IOException if the JSON string is invalid with respect to BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential + */ + public static BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential.class); + } + + /** + * Convert an instance of BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/BeginPasskeyLogin200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/BeginPasskeyLogin200Response.java new file mode 100644 index 0000000..9711f11 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/BeginPasskeyLogin200Response.java @@ -0,0 +1,289 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.BeginPasskeyLogin200ResponseLoginBeginCredential; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Response object returned to initiate Passkey login (WebAuthn) + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class BeginPasskeyLogin200Response { + public static final String SERIALIZED_NAME_LOGIN_BEGIN_CREDENTIAL = "LoginBeginCredential"; + @SerializedName(SERIALIZED_NAME_LOGIN_BEGIN_CREDENTIAL) + @javax.annotation.Nullable + private BeginPasskeyLogin200ResponseLoginBeginCredential loginBeginCredential; + + public BeginPasskeyLogin200Response() { + } + + public BeginPasskeyLogin200Response loginBeginCredential(@javax.annotation.Nullable BeginPasskeyLogin200ResponseLoginBeginCredential loginBeginCredential) { + this.loginBeginCredential = loginBeginCredential; + return this; + } + + /** + * Get loginBeginCredential + * @return loginBeginCredential + */ + @javax.annotation.Nullable + public BeginPasskeyLogin200ResponseLoginBeginCredential getLoginBeginCredential() { + return loginBeginCredential; + } + + public void setLoginBeginCredential(@javax.annotation.Nullable BeginPasskeyLogin200ResponseLoginBeginCredential loginBeginCredential) { + this.loginBeginCredential = loginBeginCredential; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BeginPasskeyLogin200Response instance itself + */ + public BeginPasskeyLogin200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BeginPasskeyLogin200Response beginPasskeyLogin200Response = (BeginPasskeyLogin200Response) o; + return Objects.equals(this.loginBeginCredential, beginPasskeyLogin200Response.loginBeginCredential)&& + Objects.equals(this.additionalProperties, beginPasskeyLogin200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(loginBeginCredential, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BeginPasskeyLogin200Response {\n"); + sb.append(" loginBeginCredential: ").append(toIndentedString(loginBeginCredential)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("LoginBeginCredential"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 BeginPasskeyLogin200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BeginPasskeyLogin200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BeginPasskeyLogin200Response is not found in the empty JSON string", BeginPasskeyLogin200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `LoginBeginCredential` + if (jsonObj.get("LoginBeginCredential") != null && !jsonObj.get("LoginBeginCredential").isJsonNull()) { + BeginPasskeyLogin200ResponseLoginBeginCredential.validateJsonElement(jsonObj.get("LoginBeginCredential")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!BeginPasskeyLogin200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BeginPasskeyLogin200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<BeginPasskeyLogin200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BeginPasskeyLogin200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<BeginPasskeyLogin200Response>() { + @Override + public void write(JsonWriter out, BeginPasskeyLogin200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public BeginPasskeyLogin200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BeginPasskeyLogin200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BeginPasskeyLogin200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of BeginPasskeyLogin200Response + * @throws IOException if the JSON string is invalid with respect to BeginPasskeyLogin200Response + */ + public static BeginPasskeyLogin200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BeginPasskeyLogin200Response.class); + } + + /** + * Convert an instance of BeginPasskeyLogin200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/BeginPasskeyLogin200ResponseLoginBeginCredential.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/BeginPasskeyLogin200ResponseLoginBeginCredential.java new file mode 100644 index 0000000..968ca67 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/BeginPasskeyLogin200ResponseLoginBeginCredential.java @@ -0,0 +1,289 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.PublicKeyCredentialRequestOptions; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * OpenAPI schema for protocol.PublicKeyCredentialRequestOptions + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class BeginPasskeyLogin200ResponseLoginBeginCredential { + public static final String SERIALIZED_NAME_PUBLIC_KEY = "publicKey"; + @SerializedName(SERIALIZED_NAME_PUBLIC_KEY) + @javax.annotation.Nullable + private PublicKeyCredentialRequestOptions publicKey; + + public BeginPasskeyLogin200ResponseLoginBeginCredential() { + } + + public BeginPasskeyLogin200ResponseLoginBeginCredential publicKey(@javax.annotation.Nullable PublicKeyCredentialRequestOptions publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + * Get publicKey + * @return publicKey + */ + @javax.annotation.Nullable + public PublicKeyCredentialRequestOptions getPublicKey() { + return publicKey; + } + + public void setPublicKey(@javax.annotation.Nullable PublicKeyCredentialRequestOptions publicKey) { + this.publicKey = publicKey; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BeginPasskeyLogin200ResponseLoginBeginCredential instance itself + */ + public BeginPasskeyLogin200ResponseLoginBeginCredential putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BeginPasskeyLogin200ResponseLoginBeginCredential beginPasskeyLogin200ResponseLoginBeginCredential = (BeginPasskeyLogin200ResponseLoginBeginCredential) o; + return Objects.equals(this.publicKey, beginPasskeyLogin200ResponseLoginBeginCredential.publicKey)&& + Objects.equals(this.additionalProperties, beginPasskeyLogin200ResponseLoginBeginCredential.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(publicKey, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BeginPasskeyLogin200ResponseLoginBeginCredential {\n"); + sb.append(" publicKey: ").append(toIndentedString(publicKey)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("publicKey"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 BeginPasskeyLogin200ResponseLoginBeginCredential + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BeginPasskeyLogin200ResponseLoginBeginCredential.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BeginPasskeyLogin200ResponseLoginBeginCredential is not found in the empty JSON string", BeginPasskeyLogin200ResponseLoginBeginCredential.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `publicKey` + if (jsonObj.get("publicKey") != null && !jsonObj.get("publicKey").isJsonNull()) { + PublicKeyCredentialRequestOptions.validateJsonElement(jsonObj.get("publicKey")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!BeginPasskeyLogin200ResponseLoginBeginCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BeginPasskeyLogin200ResponseLoginBeginCredential' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<BeginPasskeyLogin200ResponseLoginBeginCredential> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BeginPasskeyLogin200ResponseLoginBeginCredential.class)); + + return (TypeAdapter<T>) new TypeAdapter<BeginPasskeyLogin200ResponseLoginBeginCredential>() { + @Override + public void write(JsonWriter out, BeginPasskeyLogin200ResponseLoginBeginCredential value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public BeginPasskeyLogin200ResponseLoginBeginCredential read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BeginPasskeyLogin200ResponseLoginBeginCredential instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BeginPasskeyLogin200ResponseLoginBeginCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of BeginPasskeyLogin200ResponseLoginBeginCredential + * @throws IOException if the JSON string is invalid with respect to BeginPasskeyLogin200ResponseLoginBeginCredential + */ + public static BeginPasskeyLogin200ResponseLoginBeginCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BeginPasskeyLogin200ResponseLoginBeginCredential.class); + } + + /** + * Convert an instance of BeginPasskeyLogin200ResponseLoginBeginCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/BeginPasskeyMFAVerification200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/BeginPasskeyMFAVerification200Response.java new file mode 100644 index 0000000..10b02df --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/BeginPasskeyMFAVerification200Response.java @@ -0,0 +1,289 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.BeginPasskeyMFAVerification200ResponseLoginBeginCredential; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Response object returned to initiate Passkey login (WebAuthn) + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class BeginPasskeyMFAVerification200Response { + public static final String SERIALIZED_NAME_LOGIN_BEGIN_CREDENTIAL = "LoginBeginCredential"; + @SerializedName(SERIALIZED_NAME_LOGIN_BEGIN_CREDENTIAL) + @javax.annotation.Nullable + private BeginPasskeyMFAVerification200ResponseLoginBeginCredential loginBeginCredential; + + public BeginPasskeyMFAVerification200Response() { + } + + public BeginPasskeyMFAVerification200Response loginBeginCredential(@javax.annotation.Nullable BeginPasskeyMFAVerification200ResponseLoginBeginCredential loginBeginCredential) { + this.loginBeginCredential = loginBeginCredential; + return this; + } + + /** + * Get loginBeginCredential + * @return loginBeginCredential + */ + @javax.annotation.Nullable + public BeginPasskeyMFAVerification200ResponseLoginBeginCredential getLoginBeginCredential() { + return loginBeginCredential; + } + + public void setLoginBeginCredential(@javax.annotation.Nullable BeginPasskeyMFAVerification200ResponseLoginBeginCredential loginBeginCredential) { + this.loginBeginCredential = loginBeginCredential; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BeginPasskeyMFAVerification200Response instance itself + */ + public BeginPasskeyMFAVerification200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BeginPasskeyMFAVerification200Response beginPasskeyMFAVerification200Response = (BeginPasskeyMFAVerification200Response) o; + return Objects.equals(this.loginBeginCredential, beginPasskeyMFAVerification200Response.loginBeginCredential)&& + Objects.equals(this.additionalProperties, beginPasskeyMFAVerification200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(loginBeginCredential, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BeginPasskeyMFAVerification200Response {\n"); + sb.append(" loginBeginCredential: ").append(toIndentedString(loginBeginCredential)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("LoginBeginCredential"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 BeginPasskeyMFAVerification200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BeginPasskeyMFAVerification200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BeginPasskeyMFAVerification200Response is not found in the empty JSON string", BeginPasskeyMFAVerification200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `LoginBeginCredential` + if (jsonObj.get("LoginBeginCredential") != null && !jsonObj.get("LoginBeginCredential").isJsonNull()) { + BeginPasskeyMFAVerification200ResponseLoginBeginCredential.validateJsonElement(jsonObj.get("LoginBeginCredential")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!BeginPasskeyMFAVerification200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BeginPasskeyMFAVerification200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<BeginPasskeyMFAVerification200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BeginPasskeyMFAVerification200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<BeginPasskeyMFAVerification200Response>() { + @Override + public void write(JsonWriter out, BeginPasskeyMFAVerification200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public BeginPasskeyMFAVerification200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BeginPasskeyMFAVerification200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BeginPasskeyMFAVerification200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of BeginPasskeyMFAVerification200Response + * @throws IOException if the JSON string is invalid with respect to BeginPasskeyMFAVerification200Response + */ + public static BeginPasskeyMFAVerification200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BeginPasskeyMFAVerification200Response.class); + } + + /** + * Convert an instance of BeginPasskeyMFAVerification200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/BeginPasskeyMFAVerification200ResponseLoginBeginCredential.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/BeginPasskeyMFAVerification200ResponseLoginBeginCredential.java new file mode 100644 index 0000000..d9c48f7 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/BeginPasskeyMFAVerification200ResponseLoginBeginCredential.java @@ -0,0 +1,289 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.PublicKeyCredentialRequestOptions; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Container for the WebAuthn login initiation data + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class BeginPasskeyMFAVerification200ResponseLoginBeginCredential { + public static final String SERIALIZED_NAME_PUBLIC_KEY = "publicKey"; + @SerializedName(SERIALIZED_NAME_PUBLIC_KEY) + @javax.annotation.Nullable + private PublicKeyCredentialRequestOptions publicKey; + + public BeginPasskeyMFAVerification200ResponseLoginBeginCredential() { + } + + public BeginPasskeyMFAVerification200ResponseLoginBeginCredential publicKey(@javax.annotation.Nullable PublicKeyCredentialRequestOptions publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + * Get publicKey + * @return publicKey + */ + @javax.annotation.Nullable + public PublicKeyCredentialRequestOptions getPublicKey() { + return publicKey; + } + + public void setPublicKey(@javax.annotation.Nullable PublicKeyCredentialRequestOptions publicKey) { + this.publicKey = publicKey; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BeginPasskeyMFAVerification200ResponseLoginBeginCredential instance itself + */ + public BeginPasskeyMFAVerification200ResponseLoginBeginCredential putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BeginPasskeyMFAVerification200ResponseLoginBeginCredential beginPasskeyMFAVerification200ResponseLoginBeginCredential = (BeginPasskeyMFAVerification200ResponseLoginBeginCredential) o; + return Objects.equals(this.publicKey, beginPasskeyMFAVerification200ResponseLoginBeginCredential.publicKey)&& + Objects.equals(this.additionalProperties, beginPasskeyMFAVerification200ResponseLoginBeginCredential.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(publicKey, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BeginPasskeyMFAVerification200ResponseLoginBeginCredential {\n"); + sb.append(" publicKey: ").append(toIndentedString(publicKey)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("publicKey"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 BeginPasskeyMFAVerification200ResponseLoginBeginCredential + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BeginPasskeyMFAVerification200ResponseLoginBeginCredential.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BeginPasskeyMFAVerification200ResponseLoginBeginCredential is not found in the empty JSON string", BeginPasskeyMFAVerification200ResponseLoginBeginCredential.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `publicKey` + if (jsonObj.get("publicKey") != null && !jsonObj.get("publicKey").isJsonNull()) { + PublicKeyCredentialRequestOptions.validateJsonElement(jsonObj.get("publicKey")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!BeginPasskeyMFAVerification200ResponseLoginBeginCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BeginPasskeyMFAVerification200ResponseLoginBeginCredential' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<BeginPasskeyMFAVerification200ResponseLoginBeginCredential> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BeginPasskeyMFAVerification200ResponseLoginBeginCredential.class)); + + return (TypeAdapter<T>) new TypeAdapter<BeginPasskeyMFAVerification200ResponseLoginBeginCredential>() { + @Override + public void write(JsonWriter out, BeginPasskeyMFAVerification200ResponseLoginBeginCredential value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public BeginPasskeyMFAVerification200ResponseLoginBeginCredential read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BeginPasskeyMFAVerification200ResponseLoginBeginCredential instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BeginPasskeyMFAVerification200ResponseLoginBeginCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of BeginPasskeyMFAVerification200ResponseLoginBeginCredential + * @throws IOException if the JSON string is invalid with respect to BeginPasskeyMFAVerification200ResponseLoginBeginCredential + */ + public static BeginPasskeyMFAVerification200ResponseLoginBeginCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BeginPasskeyMFAVerification200ResponseLoginBeginCredential.class); + } + + /** + * Convert an instance of BeginPasskeyMFAVerification200ResponseLoginBeginCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/BeginPasskeyRegistration200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/BeginPasskeyRegistration200Response.java new file mode 100644 index 0000000..84aa0a8 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/BeginPasskeyRegistration200Response.java @@ -0,0 +1,289 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.BeginPasskeyRegistration200ResponseRegisterBeginCredential; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Response object returned to initiate Passkey registration (WebAuthn) + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class BeginPasskeyRegistration200Response { + public static final String SERIALIZED_NAME_REGISTER_BEGIN_CREDENTIAL = "RegisterBeginCredential"; + @SerializedName(SERIALIZED_NAME_REGISTER_BEGIN_CREDENTIAL) + @javax.annotation.Nullable + private BeginPasskeyRegistration200ResponseRegisterBeginCredential registerBeginCredential; + + public BeginPasskeyRegistration200Response() { + } + + public BeginPasskeyRegistration200Response registerBeginCredential(@javax.annotation.Nullable BeginPasskeyRegistration200ResponseRegisterBeginCredential registerBeginCredential) { + this.registerBeginCredential = registerBeginCredential; + return this; + } + + /** + * Get registerBeginCredential + * @return registerBeginCredential + */ + @javax.annotation.Nullable + public BeginPasskeyRegistration200ResponseRegisterBeginCredential getRegisterBeginCredential() { + return registerBeginCredential; + } + + public void setRegisterBeginCredential(@javax.annotation.Nullable BeginPasskeyRegistration200ResponseRegisterBeginCredential registerBeginCredential) { + this.registerBeginCredential = registerBeginCredential; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BeginPasskeyRegistration200Response instance itself + */ + public BeginPasskeyRegistration200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BeginPasskeyRegistration200Response beginPasskeyRegistration200Response = (BeginPasskeyRegistration200Response) o; + return Objects.equals(this.registerBeginCredential, beginPasskeyRegistration200Response.registerBeginCredential)&& + Objects.equals(this.additionalProperties, beginPasskeyRegistration200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(registerBeginCredential, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BeginPasskeyRegistration200Response {\n"); + sb.append(" registerBeginCredential: ").append(toIndentedString(registerBeginCredential)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("RegisterBeginCredential"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 BeginPasskeyRegistration200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BeginPasskeyRegistration200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BeginPasskeyRegistration200Response is not found in the empty JSON string", BeginPasskeyRegistration200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `RegisterBeginCredential` + if (jsonObj.get("RegisterBeginCredential") != null && !jsonObj.get("RegisterBeginCredential").isJsonNull()) { + BeginPasskeyRegistration200ResponseRegisterBeginCredential.validateJsonElement(jsonObj.get("RegisterBeginCredential")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!BeginPasskeyRegistration200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BeginPasskeyRegistration200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<BeginPasskeyRegistration200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BeginPasskeyRegistration200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<BeginPasskeyRegistration200Response>() { + @Override + public void write(JsonWriter out, BeginPasskeyRegistration200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public BeginPasskeyRegistration200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BeginPasskeyRegistration200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BeginPasskeyRegistration200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of BeginPasskeyRegistration200Response + * @throws IOException if the JSON string is invalid with respect to BeginPasskeyRegistration200Response + */ + public static BeginPasskeyRegistration200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BeginPasskeyRegistration200Response.class); + } + + /** + * Convert an instance of BeginPasskeyRegistration200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/BeginPasskeyRegistration200ResponseRegisterBeginCredential.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/BeginPasskeyRegistration200ResponseRegisterBeginCredential.java new file mode 100644 index 0000000..22888ec --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/BeginPasskeyRegistration200ResponseRegisterBeginCredential.java @@ -0,0 +1,289 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.PublicKeyCredentialCreationOptions; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * OpenAPI schema for protocol.PublicKeyCredentialCreationOptions + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class BeginPasskeyRegistration200ResponseRegisterBeginCredential { + public static final String SERIALIZED_NAME_PUBLIC_KEY = "publicKey"; + @SerializedName(SERIALIZED_NAME_PUBLIC_KEY) + @javax.annotation.Nullable + private PublicKeyCredentialCreationOptions publicKey; + + public BeginPasskeyRegistration200ResponseRegisterBeginCredential() { + } + + public BeginPasskeyRegistration200ResponseRegisterBeginCredential publicKey(@javax.annotation.Nullable PublicKeyCredentialCreationOptions publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + * Get publicKey + * @return publicKey + */ + @javax.annotation.Nullable + public PublicKeyCredentialCreationOptions getPublicKey() { + return publicKey; + } + + public void setPublicKey(@javax.annotation.Nullable PublicKeyCredentialCreationOptions publicKey) { + this.publicKey = publicKey; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BeginPasskeyRegistration200ResponseRegisterBeginCredential instance itself + */ + public BeginPasskeyRegistration200ResponseRegisterBeginCredential putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BeginPasskeyRegistration200ResponseRegisterBeginCredential beginPasskeyRegistration200ResponseRegisterBeginCredential = (BeginPasskeyRegistration200ResponseRegisterBeginCredential) o; + return Objects.equals(this.publicKey, beginPasskeyRegistration200ResponseRegisterBeginCredential.publicKey)&& + Objects.equals(this.additionalProperties, beginPasskeyRegistration200ResponseRegisterBeginCredential.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(publicKey, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BeginPasskeyRegistration200ResponseRegisterBeginCredential {\n"); + sb.append(" publicKey: ").append(toIndentedString(publicKey)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("publicKey"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 BeginPasskeyRegistration200ResponseRegisterBeginCredential + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BeginPasskeyRegistration200ResponseRegisterBeginCredential.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BeginPasskeyRegistration200ResponseRegisterBeginCredential is not found in the empty JSON string", BeginPasskeyRegistration200ResponseRegisterBeginCredential.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `publicKey` + if (jsonObj.get("publicKey") != null && !jsonObj.get("publicKey").isJsonNull()) { + PublicKeyCredentialCreationOptions.validateJsonElement(jsonObj.get("publicKey")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!BeginPasskeyRegistration200ResponseRegisterBeginCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BeginPasskeyRegistration200ResponseRegisterBeginCredential' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<BeginPasskeyRegistration200ResponseRegisterBeginCredential> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BeginPasskeyRegistration200ResponseRegisterBeginCredential.class)); + + return (TypeAdapter<T>) new TypeAdapter<BeginPasskeyRegistration200ResponseRegisterBeginCredential>() { + @Override + public void write(JsonWriter out, BeginPasskeyRegistration200ResponseRegisterBeginCredential value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public BeginPasskeyRegistration200ResponseRegisterBeginCredential read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BeginPasskeyRegistration200ResponseRegisterBeginCredential instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BeginPasskeyRegistration200ResponseRegisterBeginCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of BeginPasskeyRegistration200ResponseRegisterBeginCredential + * @throws IOException if the JSON string is invalid with respect to BeginPasskeyRegistration200ResponseRegisterBeginCredential + */ + public static BeginPasskeyRegistration200ResponseRegisterBeginCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BeginPasskeyRegistration200ResponseRegisterBeginCredential.class); + } + + /** + * Convert an instance of BeginPasskeyRegistration200ResponseRegisterBeginCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/BeginPasskeyReset200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/BeginPasskeyReset200Response.java new file mode 100644 index 0000000..c068f79 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/BeginPasskeyReset200Response.java @@ -0,0 +1,289 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Response object returned to initiate new Passkey registration (WebAuthn) + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class BeginPasskeyReset200Response { + public static final String SERIALIZED_NAME_REGISTER_BEGIN_CREDENTIAL = "RegisterBeginCredential"; + @SerializedName(SERIALIZED_NAME_REGISTER_BEGIN_CREDENTIAL) + @javax.annotation.Nullable + private BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential registerBeginCredential; + + public BeginPasskeyReset200Response() { + } + + public BeginPasskeyReset200Response registerBeginCredential(@javax.annotation.Nullable BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential registerBeginCredential) { + this.registerBeginCredential = registerBeginCredential; + return this; + } + + /** + * Get registerBeginCredential + * @return registerBeginCredential + */ + @javax.annotation.Nullable + public BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential getRegisterBeginCredential() { + return registerBeginCredential; + } + + public void setRegisterBeginCredential(@javax.annotation.Nullable BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential registerBeginCredential) { + this.registerBeginCredential = registerBeginCredential; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BeginPasskeyReset200Response instance itself + */ + public BeginPasskeyReset200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BeginPasskeyReset200Response beginPasskeyReset200Response = (BeginPasskeyReset200Response) o; + return Objects.equals(this.registerBeginCredential, beginPasskeyReset200Response.registerBeginCredential)&& + Objects.equals(this.additionalProperties, beginPasskeyReset200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(registerBeginCredential, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BeginPasskeyReset200Response {\n"); + sb.append(" registerBeginCredential: ").append(toIndentedString(registerBeginCredential)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("RegisterBeginCredential"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 BeginPasskeyReset200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BeginPasskeyReset200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BeginPasskeyReset200Response is not found in the empty JSON string", BeginPasskeyReset200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `RegisterBeginCredential` + if (jsonObj.get("RegisterBeginCredential") != null && !jsonObj.get("RegisterBeginCredential").isJsonNull()) { + BeginMFAPasskeyRegistration200ResponseRegisterBeginCredential.validateJsonElement(jsonObj.get("RegisterBeginCredential")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!BeginPasskeyReset200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BeginPasskeyReset200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<BeginPasskeyReset200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BeginPasskeyReset200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<BeginPasskeyReset200Response>() { + @Override + public void write(JsonWriter out, BeginPasskeyReset200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public BeginPasskeyReset200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BeginPasskeyReset200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BeginPasskeyReset200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of BeginPasskeyReset200Response + * @throws IOException if the JSON string is invalid with respect to BeginPasskeyReset200Response + */ + public static BeginPasskeyReset200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BeginPasskeyReset200Response.class); + } + + /** + * Convert an instance of BeginPasskeyReset200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/BigCommerceLoginUrlResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/BigCommerceLoginUrlResponse.java new file mode 100644 index 0000000..cb7cafc --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/BigCommerceLoginUrlResponse.java @@ -0,0 +1,287 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * BigCommerceLoginUrlResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class BigCommerceLoginUrlResponse { + public static final String SERIALIZED_NAME_LOGIN_URL = "loginUrl"; + @SerializedName(SERIALIZED_NAME_LOGIN_URL) + @javax.annotation.Nullable + private String loginUrl; + + public BigCommerceLoginUrlResponse() { + } + + public BigCommerceLoginUrlResponse loginUrl(@javax.annotation.Nullable String loginUrl) { + this.loginUrl = loginUrl; + return this; + } + + /** + * BigCommerce login URL for the customer. + * @return loginUrl + */ + @javax.annotation.Nullable + public String getLoginUrl() { + return loginUrl; + } + + public void setLoginUrl(@javax.annotation.Nullable String loginUrl) { + this.loginUrl = loginUrl; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BigCommerceLoginUrlResponse instance itself + */ + public BigCommerceLoginUrlResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCommerceLoginUrlResponse bigCommerceLoginUrlResponse = (BigCommerceLoginUrlResponse) o; + return Objects.equals(this.loginUrl, bigCommerceLoginUrlResponse.loginUrl)&& + Objects.equals(this.additionalProperties, bigCommerceLoginUrlResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(loginUrl, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCommerceLoginUrlResponse {\n"); + sb.append(" loginUrl: ").append(toIndentedString(loginUrl)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("loginUrl"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 BigCommerceLoginUrlResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BigCommerceLoginUrlResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BigCommerceLoginUrlResponse is not found in the empty JSON string", BigCommerceLoginUrlResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("loginUrl") != null && !jsonObj.get("loginUrl").isJsonNull()) && !jsonObj.get("loginUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `loginUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("loginUrl").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!BigCommerceLoginUrlResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BigCommerceLoginUrlResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<BigCommerceLoginUrlResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BigCommerceLoginUrlResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<BigCommerceLoginUrlResponse>() { + @Override + public void write(JsonWriter out, BigCommerceLoginUrlResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public BigCommerceLoginUrlResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BigCommerceLoginUrlResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BigCommerceLoginUrlResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of BigCommerceLoginUrlResponse + * @throws IOException if the JSON string is invalid with respect to BigCommerceLoginUrlResponse + */ + public static BigCommerceLoginUrlResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BigCommerceLoginUrlResponse.class); + } + + /** + * Convert an instance of BigCommerceLoginUrlResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/BigCommerceTokenPostRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/BigCommerceTokenPostRequest.java new file mode 100644 index 0000000..ad86b98 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/BigCommerceTokenPostRequest.java @@ -0,0 +1,355 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * BigCommerceTokenPostRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class BigCommerceTokenPostRequest { + public static final String SERIALIZED_NAME_ACCESS_TOKEN = "access_token"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN) + @javax.annotation.Nonnull + private String accessToken; + + public static final String SERIALIZED_NAME_PASSWORD = "password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nullable + private String password; + + public static final String SERIALIZED_NAME_RETURN_URL = "return_url"; + @SerializedName(SERIALIZED_NAME_RETURN_URL) + @javax.annotation.Nullable + private String returnUrl; + + public BigCommerceTokenPostRequest() { + } + + public BigCommerceTokenPostRequest accessToken(@javax.annotation.Nonnull String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * LoginRadius access token of the authenticated user. + * @return accessToken + */ + @javax.annotation.Nonnull + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(@javax.annotation.Nonnull String accessToken) { + this.accessToken = accessToken; + } + + + public BigCommerceTokenPostRequest password(@javax.annotation.Nullable String password) { + this.password = password; + return this; + } + + /** + * Optional password for BigCommerce customer creation. + * @return password + */ + @javax.annotation.Nullable + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nullable String password) { + this.password = password; + } + + + public BigCommerceTokenPostRequest returnUrl(@javax.annotation.Nullable String returnUrl) { + this.returnUrl = returnUrl; + return this; + } + + /** + * URL to redirect the user to after login. + * @return returnUrl + */ + @javax.annotation.Nullable + public String getReturnUrl() { + return returnUrl; + } + + public void setReturnUrl(@javax.annotation.Nullable String returnUrl) { + this.returnUrl = returnUrl; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BigCommerceTokenPostRequest instance itself + */ + public BigCommerceTokenPostRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCommerceTokenPostRequest bigCommerceTokenPostRequest = (BigCommerceTokenPostRequest) o; + return Objects.equals(this.accessToken, bigCommerceTokenPostRequest.accessToken) && + Objects.equals(this.password, bigCommerceTokenPostRequest.password) && + Objects.equals(this.returnUrl, bigCommerceTokenPostRequest.returnUrl)&& + Objects.equals(this.additionalProperties, bigCommerceTokenPostRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accessToken, password, returnUrl, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCommerceTokenPostRequest {\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" returnUrl: ").append(toIndentedString(returnUrl)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("access_token"); + openapiFields.add("password"); + openapiFields.add("return_url"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("access_token"); + } + + /** + * 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 BigCommerceTokenPostRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BigCommerceTokenPostRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BigCommerceTokenPostRequest is not found in the empty JSON string", BigCommerceTokenPostRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BigCommerceTokenPostRequest.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("access_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `access_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("access_token").toString())); + } + if ((jsonObj.get("password") != null && !jsonObj.get("password").isJsonNull()) && !jsonObj.get("password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); + } + if ((jsonObj.get("return_url") != null && !jsonObj.get("return_url").isJsonNull()) && !jsonObj.get("return_url").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `return_url` to be a primitive type in the JSON string but got `%s`", jsonObj.get("return_url").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!BigCommerceTokenPostRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BigCommerceTokenPostRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<BigCommerceTokenPostRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BigCommerceTokenPostRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<BigCommerceTokenPostRequest>() { + @Override + public void write(JsonWriter out, BigCommerceTokenPostRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public BigCommerceTokenPostRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BigCommerceTokenPostRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BigCommerceTokenPostRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of BigCommerceTokenPostRequest + * @throws IOException if the JSON string is invalid with respect to BigCommerceTokenPostRequest + */ + public static BigCommerceTokenPostRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BigCommerceTokenPostRequest.class); + } + + /** + * Convert an instance of BigCommerceTokenPostRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/BigCommerceValidatePasswordRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/BigCommerceValidatePasswordRequest.java new file mode 100644 index 0000000..dd9551a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/BigCommerceValidatePasswordRequest.java @@ -0,0 +1,326 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * BigCommerceValidatePasswordRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class BigCommerceValidatePasswordRequest { + public static final String SERIALIZED_NAME_EMAILID = "emailid"; + @SerializedName(SERIALIZED_NAME_EMAILID) + @javax.annotation.Nonnull + private String emailid; + + public static final String SERIALIZED_NAME_PASSWORD = "password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nonnull + private String password; + + public BigCommerceValidatePasswordRequest() { + } + + public BigCommerceValidatePasswordRequest emailid(@javax.annotation.Nonnull String emailid) { + this.emailid = emailid; + return this; + } + + /** + * Email address of the BigCommerce customer. + * @return emailid + */ + @javax.annotation.Nonnull + public String getEmailid() { + return emailid; + } + + public void setEmailid(@javax.annotation.Nonnull String emailid) { + this.emailid = emailid; + } + + + public BigCommerceValidatePasswordRequest password(@javax.annotation.Nonnull String password) { + this.password = password; + return this; + } + + /** + * Password to validate for the BigCommerce customer. + * @return password + */ + @javax.annotation.Nonnull + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nonnull String password) { + this.password = password; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BigCommerceValidatePasswordRequest instance itself + */ + public BigCommerceValidatePasswordRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCommerceValidatePasswordRequest bigCommerceValidatePasswordRequest = (BigCommerceValidatePasswordRequest) o; + return Objects.equals(this.emailid, bigCommerceValidatePasswordRequest.emailid) && + Objects.equals(this.password, bigCommerceValidatePasswordRequest.password)&& + Objects.equals(this.additionalProperties, bigCommerceValidatePasswordRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(emailid, password, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCommerceValidatePasswordRequest {\n"); + sb.append(" emailid: ").append(toIndentedString(emailid)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("emailid"); + openapiFields.add("password"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("emailid"); + openapiRequiredFields.add("password"); + } + + /** + * 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 BigCommerceValidatePasswordRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BigCommerceValidatePasswordRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BigCommerceValidatePasswordRequest is not found in the empty JSON string", BigCommerceValidatePasswordRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BigCommerceValidatePasswordRequest.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("emailid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `emailid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailid").toString())); + } + if (!jsonObj.get("password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!BigCommerceValidatePasswordRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BigCommerceValidatePasswordRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<BigCommerceValidatePasswordRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BigCommerceValidatePasswordRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<BigCommerceValidatePasswordRequest>() { + @Override + public void write(JsonWriter out, BigCommerceValidatePasswordRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public BigCommerceValidatePasswordRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BigCommerceValidatePasswordRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BigCommerceValidatePasswordRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of BigCommerceValidatePasswordRequest + * @throws IOException if the JSON string is invalid with respect to BigCommerceValidatePasswordRequest + */ + public static BigCommerceValidatePasswordRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BigCommerceValidatePasswordRequest.class); + } + + /** + * Convert an instance of BigCommerceValidatePasswordRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/BigCommerceValidatePasswordResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/BigCommerceValidatePasswordResponse.java new file mode 100644 index 0000000..db6102f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/BigCommerceValidatePasswordResponse.java @@ -0,0 +1,284 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * BigCommerceValidatePasswordResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class BigCommerceValidatePasswordResponse { + public static final String SERIALIZED_NAME_VERIFIED = "verified"; + @SerializedName(SERIALIZED_NAME_VERIFIED) + @javax.annotation.Nullable + private Boolean verified; + + public BigCommerceValidatePasswordResponse() { + } + + public BigCommerceValidatePasswordResponse verified(@javax.annotation.Nullable Boolean verified) { + this.verified = verified; + return this; + } + + /** + * Whether the password is valid for the BigCommerce customer. + * @return verified + */ + @javax.annotation.Nullable + public Boolean getVerified() { + return verified; + } + + public void setVerified(@javax.annotation.Nullable Boolean verified) { + this.verified = verified; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BigCommerceValidatePasswordResponse instance itself + */ + public BigCommerceValidatePasswordResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BigCommerceValidatePasswordResponse bigCommerceValidatePasswordResponse = (BigCommerceValidatePasswordResponse) o; + return Objects.equals(this.verified, bigCommerceValidatePasswordResponse.verified)&& + Objects.equals(this.additionalProperties, bigCommerceValidatePasswordResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(verified, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BigCommerceValidatePasswordResponse {\n"); + sb.append(" verified: ").append(toIndentedString(verified)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("verified"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 BigCommerceValidatePasswordResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BigCommerceValidatePasswordResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BigCommerceValidatePasswordResponse is not found in the empty JSON string", BigCommerceValidatePasswordResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!BigCommerceValidatePasswordResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BigCommerceValidatePasswordResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<BigCommerceValidatePasswordResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BigCommerceValidatePasswordResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<BigCommerceValidatePasswordResponse>() { + @Override + public void write(JsonWriter out, BigCommerceValidatePasswordResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public BigCommerceValidatePasswordResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BigCommerceValidatePasswordResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BigCommerceValidatePasswordResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of BigCommerceValidatePasswordResponse + * @throws IOException if the JSON string is invalid with respect to BigCommerceValidatePasswordResponse + */ + public static BigCommerceValidatePasswordResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BigCommerceValidatePasswordResponse.class); + } + + /** + * Convert an instance of BigCommerceValidatePasswordResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/BulkInsertErrorReport.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/BulkInsertErrorReport.java new file mode 100644 index 0000000..7868051 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/BulkInsertErrorReport.java @@ -0,0 +1,323 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * BulkInsertErrorReport + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class BulkInsertErrorReport { + public static final String SERIALIZED_NAME_RECORD_NUMBER = "RecordNumber"; + @SerializedName(SERIALIZED_NAME_RECORD_NUMBER) + @javax.annotation.Nonnull + private Integer recordNumber; + + public static final String SERIALIZED_NAME_MESSAGE = "Message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + @javax.annotation.Nonnull + private String message; + + public BulkInsertErrorReport() { + } + + public BulkInsertErrorReport recordNumber(@javax.annotation.Nonnull Integer recordNumber) { + this.recordNumber = recordNumber; + return this; + } + + /** + * Row no of the record that failed. + * @return recordNumber + */ + @javax.annotation.Nonnull + public Integer getRecordNumber() { + return recordNumber; + } + + public void setRecordNumber(@javax.annotation.Nonnull Integer recordNumber) { + this.recordNumber = recordNumber; + } + + + public BulkInsertErrorReport message(@javax.annotation.Nonnull String message) { + this.message = message; + return this; + } + + /** + * Description of the error encountered during insert or update. + * @return message + */ + @javax.annotation.Nonnull + public String getMessage() { + return message; + } + + public void setMessage(@javax.annotation.Nonnull String message) { + this.message = message; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BulkInsertErrorReport instance itself + */ + public BulkInsertErrorReport putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BulkInsertErrorReport bulkInsertErrorReport = (BulkInsertErrorReport) o; + return Objects.equals(this.recordNumber, bulkInsertErrorReport.recordNumber) && + Objects.equals(this.message, bulkInsertErrorReport.message)&& + Objects.equals(this.additionalProperties, bulkInsertErrorReport.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(recordNumber, message, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BulkInsertErrorReport {\n"); + sb.append(" recordNumber: ").append(toIndentedString(recordNumber)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("RecordNumber"); + openapiFields.add("Message"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("RecordNumber"); + openapiRequiredFields.add("Message"); + } + + /** + * 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 BulkInsertErrorReport + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BulkInsertErrorReport.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BulkInsertErrorReport is not found in the empty JSON string", BulkInsertErrorReport.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BulkInsertErrorReport.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("Message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Message").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!BulkInsertErrorReport.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BulkInsertErrorReport' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<BulkInsertErrorReport> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BulkInsertErrorReport.class)); + + return (TypeAdapter<T>) new TypeAdapter<BulkInsertErrorReport>() { + @Override + public void write(JsonWriter out, BulkInsertErrorReport value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public BulkInsertErrorReport read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BulkInsertErrorReport instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BulkInsertErrorReport given an JSON string + * + * @param jsonString JSON string + * @return An instance of BulkInsertErrorReport + * @throws IOException if the JSON string is invalid with respect to BulkInsertErrorReport + */ + public static BulkInsertErrorReport fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BulkInsertErrorReport.class); + } + + /** + * Convert an instance of BulkInsertErrorReport to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/BulkInsertReport.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/BulkInsertReport.java new file mode 100644 index 0000000..e11d2fa --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/BulkInsertReport.java @@ -0,0 +1,372 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.BulkInsertErrorReport; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * BulkInsertReport + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class BulkInsertReport { + public static final String SERIALIZED_NAME_RECORD_INSERTED = "RecordInserted"; + @SerializedName(SERIALIZED_NAME_RECORD_INSERTED) + @javax.annotation.Nonnull + private Long recordInserted; + + public static final String SERIALIZED_NAME_RECORD_UPDATED = "RecordUpdated"; + @SerializedName(SERIALIZED_NAME_RECORD_UPDATED) + @javax.annotation.Nonnull + private Long recordUpdated; + + public static final String SERIALIZED_NAME_FAILED = "Failed"; + @SerializedName(SERIALIZED_NAME_FAILED) + @javax.annotation.Nullable + private List<BulkInsertErrorReport> failed = new ArrayList<>(); + + public BulkInsertReport() { + } + + public BulkInsertReport recordInserted(@javax.annotation.Nonnull Long recordInserted) { + this.recordInserted = recordInserted; + return this; + } + + /** + * Number of records successfully inserted. + * @return recordInserted + */ + @javax.annotation.Nonnull + public Long getRecordInserted() { + return recordInserted; + } + + public void setRecordInserted(@javax.annotation.Nonnull Long recordInserted) { + this.recordInserted = recordInserted; + } + + + public BulkInsertReport recordUpdated(@javax.annotation.Nonnull Long recordUpdated) { + this.recordUpdated = recordUpdated; + return this; + } + + /** + * Number of records successfully updated. + * @return recordUpdated + */ + @javax.annotation.Nonnull + public Long getRecordUpdated() { + return recordUpdated; + } + + public void setRecordUpdated(@javax.annotation.Nonnull Long recordUpdated) { + this.recordUpdated = recordUpdated; + } + + + public BulkInsertReport failed(@javax.annotation.Nullable List<BulkInsertErrorReport> failed) { + this.failed = failed; + return this; + } + + public BulkInsertReport addFailedItem(BulkInsertErrorReport failedItem) { + if (this.failed == null) { + this.failed = new ArrayList<>(); + } + this.failed.add(failedItem); + return this; + } + + /** + * List of records that failed to insert or update. + * @return failed + */ + @javax.annotation.Nullable + public List<BulkInsertErrorReport> getFailed() { + return failed; + } + + public void setFailed(@javax.annotation.Nullable List<BulkInsertErrorReport> failed) { + this.failed = failed; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the BulkInsertReport instance itself + */ + public BulkInsertReport putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + BulkInsertReport bulkInsertReport = (BulkInsertReport) o; + return Objects.equals(this.recordInserted, bulkInsertReport.recordInserted) && + Objects.equals(this.recordUpdated, bulkInsertReport.recordUpdated) && + Objects.equals(this.failed, bulkInsertReport.failed)&& + Objects.equals(this.additionalProperties, bulkInsertReport.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(recordInserted, recordUpdated, failed, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class BulkInsertReport {\n"); + sb.append(" recordInserted: ").append(toIndentedString(recordInserted)).append("\n"); + sb.append(" recordUpdated: ").append(toIndentedString(recordUpdated)).append("\n"); + sb.append(" failed: ").append(toIndentedString(failed)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("RecordInserted"); + openapiFields.add("RecordUpdated"); + openapiFields.add("Failed"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("RecordInserted"); + openapiRequiredFields.add("RecordUpdated"); + } + + /** + * 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 BulkInsertReport + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!BulkInsertReport.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in BulkInsertReport is not found in the empty JSON string", BulkInsertReport.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : BulkInsertReport.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("Failed") != null && !jsonObj.get("Failed").isJsonNull()) { + JsonArray jsonArrayfailed = jsonObj.getAsJsonArray("Failed"); + if (jsonArrayfailed != null) { + // ensure the json data is an array + if (!jsonObj.get("Failed").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Failed` to be an array in the JSON string but got `%s`", jsonObj.get("Failed").toString())); + } + + // validate the optional field `Failed` (array) + for (int i = 0; i < jsonArrayfailed.size(); i++) { + BulkInsertErrorReport.validateJsonElement(jsonArrayfailed.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!BulkInsertReport.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'BulkInsertReport' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<BulkInsertReport> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(BulkInsertReport.class)); + + return (TypeAdapter<T>) new TypeAdapter<BulkInsertReport>() { + @Override + public void write(JsonWriter out, BulkInsertReport value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public BulkInsertReport read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + BulkInsertReport instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of BulkInsertReport given an JSON string + * + * @param jsonString JSON string + * @return An instance of BulkInsertReport + * @throws IOException if the JSON string is invalid with respect to BulkInsertReport + */ + public static BulkInsertReport fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, BulkInsertReport.class); + } + + /** + * Convert an instance of BulkInsertReport to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/CandidateTokenModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/CandidateTokenModel.java new file mode 100644 index 0000000..85d304e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/CandidateTokenModel.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * CandidateTokenModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class CandidateTokenModel { + public static final String SERIALIZED_NAME_CANDIDATETOKEN = "candidatetoken"; + @SerializedName(SERIALIZED_NAME_CANDIDATETOKEN) + @javax.annotation.Nonnull + private String candidatetoken; + + public CandidateTokenModel() { + } + + public CandidateTokenModel candidatetoken(@javax.annotation.Nonnull String candidatetoken) { + this.candidatetoken = candidatetoken; + return this; + } + + /** + * The candidate token + * @return candidatetoken + */ + @javax.annotation.Nonnull + public String getCandidatetoken() { + return candidatetoken; + } + + public void setCandidatetoken(@javax.annotation.Nonnull String candidatetoken) { + this.candidatetoken = candidatetoken; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CandidateTokenModel instance itself + */ + public CandidateTokenModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CandidateTokenModel candidateTokenModel = (CandidateTokenModel) o; + return Objects.equals(this.candidatetoken, candidateTokenModel.candidatetoken)&& + Objects.equals(this.additionalProperties, candidateTokenModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(candidatetoken, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CandidateTokenModel {\n"); + sb.append(" candidatetoken: ").append(toIndentedString(candidatetoken)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("candidatetoken"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("candidatetoken"); + } + + /** + * 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 CandidateTokenModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CandidateTokenModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CandidateTokenModel is not found in the empty JSON string", CandidateTokenModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CandidateTokenModel.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("candidatetoken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `candidatetoken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("candidatetoken").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!CandidateTokenModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CandidateTokenModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<CandidateTokenModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CandidateTokenModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<CandidateTokenModel>() { + @Override + public void write(JsonWriter out, CandidateTokenModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CandidateTokenModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CandidateTokenModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CandidateTokenModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of CandidateTokenModel + * @throws IOException if the JSON string is invalid with respect to CandidateTokenModel + */ + public static CandidateTokenModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CandidateTokenModel.class); + } + + /** + * Convert an instance of CandidateTokenModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/CaptchaConfig.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/CaptchaConfig.java new file mode 100644 index 0000000..76b749a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/CaptchaConfig.java @@ -0,0 +1,453 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.CaptchaKeys; +import com.loginradius.sdk.internal.openapi.model.GoogleRecaptchaV3; +import com.loginradius.sdk.internal.openapi.model.HCaptcha; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * CaptchaConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class CaptchaConfig { + public static final String SERIALIZED_NAME_IS_ENABLED = "IsEnabled"; + @SerializedName(SERIALIZED_NAME_IS_ENABLED) + @javax.annotation.Nullable + private Boolean isEnabled; + + public static final String SERIALIZED_NAME_QQ_TENCENT_CAPTCHA = "QQTencentCaptcha"; + @SerializedName(SERIALIZED_NAME_QQ_TENCENT_CAPTCHA) + @javax.annotation.Nullable + private CaptchaKeys qqTencentCaptcha; + + public static final String SERIALIZED_NAME_GOOGLE_RECAPTCHA_V2 = "GoogleRecaptchaV2"; + @SerializedName(SERIALIZED_NAME_GOOGLE_RECAPTCHA_V2) + @javax.annotation.Nullable + private CaptchaKeys googleRecaptchaV2; + + public static final String SERIALIZED_NAME_GOOGLE_RECAPTCHA_V3 = "GoogleRecaptchaV3"; + @SerializedName(SERIALIZED_NAME_GOOGLE_RECAPTCHA_V3) + @javax.annotation.Nullable + private GoogleRecaptchaV3 googleRecaptchaV3; + + public static final String SERIALIZED_NAME_HCAPTCHA = "HCaptcha"; + @SerializedName(SERIALIZED_NAME_HCAPTCHA) + @javax.annotation.Nullable + private HCaptcha hcaptcha; + + public static final String SERIALIZED_NAME_ENABLED_CAPTCHA = "EnabledCaptcha"; + @SerializedName(SERIALIZED_NAME_ENABLED_CAPTCHA) + @javax.annotation.Nullable + private String enabledCaptcha; + + public CaptchaConfig() { + } + + public CaptchaConfig isEnabled(@javax.annotation.Nullable Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Get isEnabled + * @return isEnabled + */ + @javax.annotation.Nullable + public Boolean getIsEnabled() { + return isEnabled; + } + + public void setIsEnabled(@javax.annotation.Nullable Boolean isEnabled) { + this.isEnabled = isEnabled; + } + + + public CaptchaConfig qqTencentCaptcha(@javax.annotation.Nullable CaptchaKeys qqTencentCaptcha) { + this.qqTencentCaptcha = qqTencentCaptcha; + return this; + } + + /** + * Get qqTencentCaptcha + * @return qqTencentCaptcha + */ + @javax.annotation.Nullable + public CaptchaKeys getQqTencentCaptcha() { + return qqTencentCaptcha; + } + + public void setQqTencentCaptcha(@javax.annotation.Nullable CaptchaKeys qqTencentCaptcha) { + this.qqTencentCaptcha = qqTencentCaptcha; + } + + + public CaptchaConfig googleRecaptchaV2(@javax.annotation.Nullable CaptchaKeys googleRecaptchaV2) { + this.googleRecaptchaV2 = googleRecaptchaV2; + return this; + } + + /** + * Get googleRecaptchaV2 + * @return googleRecaptchaV2 + */ + @javax.annotation.Nullable + public CaptchaKeys getGoogleRecaptchaV2() { + return googleRecaptchaV2; + } + + public void setGoogleRecaptchaV2(@javax.annotation.Nullable CaptchaKeys googleRecaptchaV2) { + this.googleRecaptchaV2 = googleRecaptchaV2; + } + + + public CaptchaConfig googleRecaptchaV3(@javax.annotation.Nullable GoogleRecaptchaV3 googleRecaptchaV3) { + this.googleRecaptchaV3 = googleRecaptchaV3; + return this; + } + + /** + * Get googleRecaptchaV3 + * @return googleRecaptchaV3 + */ + @javax.annotation.Nullable + public GoogleRecaptchaV3 getGoogleRecaptchaV3() { + return googleRecaptchaV3; + } + + public void setGoogleRecaptchaV3(@javax.annotation.Nullable GoogleRecaptchaV3 googleRecaptchaV3) { + this.googleRecaptchaV3 = googleRecaptchaV3; + } + + + public CaptchaConfig hcaptcha(@javax.annotation.Nullable HCaptcha hcaptcha) { + this.hcaptcha = hcaptcha; + return this; + } + + /** + * Get hcaptcha + * @return hcaptcha + */ + @javax.annotation.Nullable + public HCaptcha getHcaptcha() { + return hcaptcha; + } + + public void setHcaptcha(@javax.annotation.Nullable HCaptcha hcaptcha) { + this.hcaptcha = hcaptcha; + } + + + public CaptchaConfig enabledCaptcha(@javax.annotation.Nullable String enabledCaptcha) { + this.enabledCaptcha = enabledCaptcha; + return this; + } + + /** + * The enabled captcha type. Must pass the EnabledCaptchaValidation. + * @return enabledCaptcha + */ + @javax.annotation.Nullable + public String getEnabledCaptcha() { + return enabledCaptcha; + } + + public void setEnabledCaptcha(@javax.annotation.Nullable String enabledCaptcha) { + this.enabledCaptcha = enabledCaptcha; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CaptchaConfig instance itself + */ + public CaptchaConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaptchaConfig captchaConfig = (CaptchaConfig) o; + return Objects.equals(this.isEnabled, captchaConfig.isEnabled) && + Objects.equals(this.qqTencentCaptcha, captchaConfig.qqTencentCaptcha) && + Objects.equals(this.googleRecaptchaV2, captchaConfig.googleRecaptchaV2) && + Objects.equals(this.googleRecaptchaV3, captchaConfig.googleRecaptchaV3) && + Objects.equals(this.hcaptcha, captchaConfig.hcaptcha) && + Objects.equals(this.enabledCaptcha, captchaConfig.enabledCaptcha)&& + Objects.equals(this.additionalProperties, captchaConfig.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(isEnabled, qqTencentCaptcha, googleRecaptchaV2, googleRecaptchaV3, hcaptcha, enabledCaptcha, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaptchaConfig {\n"); + sb.append(" isEnabled: ").append(toIndentedString(isEnabled)).append("\n"); + sb.append(" qqTencentCaptcha: ").append(toIndentedString(qqTencentCaptcha)).append("\n"); + sb.append(" googleRecaptchaV2: ").append(toIndentedString(googleRecaptchaV2)).append("\n"); + sb.append(" googleRecaptchaV3: ").append(toIndentedString(googleRecaptchaV3)).append("\n"); + sb.append(" hcaptcha: ").append(toIndentedString(hcaptcha)).append("\n"); + sb.append(" enabledCaptcha: ").append(toIndentedString(enabledCaptcha)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsEnabled"); + openapiFields.add("QQTencentCaptcha"); + openapiFields.add("GoogleRecaptchaV2"); + openapiFields.add("GoogleRecaptchaV3"); + openapiFields.add("HCaptcha"); + openapiFields.add("EnabledCaptcha"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 CaptchaConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CaptchaConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CaptchaConfig is not found in the empty JSON string", CaptchaConfig.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `QQTencentCaptcha` + if (jsonObj.get("QQTencentCaptcha") != null && !jsonObj.get("QQTencentCaptcha").isJsonNull()) { + CaptchaKeys.validateJsonElement(jsonObj.get("QQTencentCaptcha")); + } + // validate the optional field `GoogleRecaptchaV2` + if (jsonObj.get("GoogleRecaptchaV2") != null && !jsonObj.get("GoogleRecaptchaV2").isJsonNull()) { + CaptchaKeys.validateJsonElement(jsonObj.get("GoogleRecaptchaV2")); + } + // validate the optional field `GoogleRecaptchaV3` + if (jsonObj.get("GoogleRecaptchaV3") != null && !jsonObj.get("GoogleRecaptchaV3").isJsonNull()) { + GoogleRecaptchaV3.validateJsonElement(jsonObj.get("GoogleRecaptchaV3")); + } + // validate the optional field `HCaptcha` + if (jsonObj.get("HCaptcha") != null && !jsonObj.get("HCaptcha").isJsonNull()) { + HCaptcha.validateJsonElement(jsonObj.get("HCaptcha")); + } + if ((jsonObj.get("EnabledCaptcha") != null && !jsonObj.get("EnabledCaptcha").isJsonNull()) && !jsonObj.get("EnabledCaptcha").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `EnabledCaptcha` to be a primitive type in the JSON string but got `%s`", jsonObj.get("EnabledCaptcha").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!CaptchaConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CaptchaConfig' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<CaptchaConfig> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CaptchaConfig.class)); + + return (TypeAdapter<T>) new TypeAdapter<CaptchaConfig>() { + @Override + public void write(JsonWriter out, CaptchaConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CaptchaConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CaptchaConfig instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CaptchaConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of CaptchaConfig + * @throws IOException if the JSON string is invalid with respect to CaptchaConfig + */ + public static CaptchaConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CaptchaConfig.class); + } + + /** + * Convert an instance of CaptchaConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/CaptchaKeys.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/CaptchaKeys.java new file mode 100644 index 0000000..cf0eb8c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/CaptchaKeys.java @@ -0,0 +1,329 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * CaptchaKeys + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class CaptchaKeys { + public static final String SERIALIZED_NAME_PUBLIC_KEY = "PublicKey"; + @SerializedName(SERIALIZED_NAME_PUBLIC_KEY) + @javax.annotation.Nullable + private String publicKey; + + public static final String SERIALIZED_NAME_PRIVATE_KEY = "PrivateKey"; + @SerializedName(SERIALIZED_NAME_PRIVATE_KEY) + @javax.annotation.Nullable + private String privateKey; + + public CaptchaKeys() { + } + + public CaptchaKeys publicKey(@javax.annotation.Nullable String publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + * Get publicKey + * @return publicKey + */ + @javax.annotation.Nullable + public String getPublicKey() { + return publicKey; + } + + public void setPublicKey(@javax.annotation.Nullable String publicKey) { + this.publicKey = publicKey; + } + + + public CaptchaKeys privateKey(@javax.annotation.Nullable String privateKey) { + this.privateKey = privateKey; + return this; + } + + /** + * Get privateKey + * @return privateKey + */ + @javax.annotation.Nullable + public String getPrivateKey() { + return privateKey; + } + + public void setPrivateKey(@javax.annotation.Nullable String privateKey) { + this.privateKey = privateKey; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CaptchaKeys instance itself + */ + public CaptchaKeys putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaptchaKeys captchaKeys = (CaptchaKeys) o; + return Objects.equals(this.publicKey, captchaKeys.publicKey) && + Objects.equals(this.privateKey, captchaKeys.privateKey)&& + Objects.equals(this.additionalProperties, captchaKeys.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(publicKey, privateKey, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaptchaKeys {\n"); + sb.append(" publicKey: ").append(toIndentedString(publicKey)).append("\n"); + sb.append(" privateKey: ").append(toIndentedString(privateKey)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("PublicKey"); + openapiFields.add("PrivateKey"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 CaptchaKeys + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CaptchaKeys.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CaptchaKeys is not found in the empty JSON string", CaptchaKeys.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("PublicKey") != null && !jsonObj.get("PublicKey").isJsonNull()) && !jsonObj.get("PublicKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PublicKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PublicKey").toString())); + } + if ((jsonObj.get("PrivateKey") != null && !jsonObj.get("PrivateKey").isJsonNull()) && !jsonObj.get("PrivateKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PrivateKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PrivateKey").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!CaptchaKeys.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CaptchaKeys' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<CaptchaKeys> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CaptchaKeys.class)); + + return (TypeAdapter<T>) new TypeAdapter<CaptchaKeys>() { + @Override + public void write(JsonWriter out, CaptchaKeys value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CaptchaKeys read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CaptchaKeys instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CaptchaKeys given an JSON string + * + * @param jsonString JSON string + * @return An instance of CaptchaKeys + * @throws IOException if the JSON string is invalid with respect to CaptchaKeys + */ + public static CaptchaKeys fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CaptchaKeys.class); + } + + /** + * Convert an instance of CaptchaKeys to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/CaptchaModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/CaptchaModel.java new file mode 100644 index 0000000..4321edb --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/CaptchaModel.java @@ -0,0 +1,389 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * CaptchaModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class CaptchaModel { + public static final String SERIALIZED_NAME_G_RECAPTCHA_RESPONSE = "g-recaptcha-response"; + @SerializedName(SERIALIZED_NAME_G_RECAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String gRecaptchaResponse; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_TICKET = "qq_captcha_ticket"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_TICKET) + @javax.annotation.Nullable + private String qqCaptchaTicket; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR = "qq_captcha_randstr"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR) + @javax.annotation.Nullable + private String qqCaptchaRandstr; + + public static final String SERIALIZED_NAME_H_CAPTCHA_RESPONSE = "h-captcha-response"; + @SerializedName(SERIALIZED_NAME_H_CAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String hCaptchaResponse; + + public CaptchaModel() { + } + + public CaptchaModel gRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + return this; + } + + /** + * The Google reCAPTCHA response which is sent to the server for verification. + * @return gRecaptchaResponse + */ + @javax.annotation.Nullable + public String getgRecaptchaResponse() { + return gRecaptchaResponse; + } + + public void setgRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + } + + + public CaptchaModel qqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + return this; + } + + /** + * The QQ Captcha ticket which is sent to the server for verification. + * @return qqCaptchaTicket + */ + @javax.annotation.Nullable + public String getQqCaptchaTicket() { + return qqCaptchaTicket; + } + + public void setQqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + } + + + public CaptchaModel qqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + return this; + } + + /** + * The QQ Captcha random string which is sent to the server for verification. + * @return qqCaptchaRandstr + */ + @javax.annotation.Nullable + public String getQqCaptchaRandstr() { + return qqCaptchaRandstr; + } + + public void setQqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + } + + + public CaptchaModel hCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + return this; + } + + /** + * The hCaptcha response which is sent to the server for verification. + * @return hCaptchaResponse + */ + @javax.annotation.Nullable + public String gethCaptchaResponse() { + return hCaptchaResponse; + } + + public void sethCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CaptchaModel instance itself + */ + public CaptchaModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CaptchaModel captchaModel = (CaptchaModel) o; + return Objects.equals(this.gRecaptchaResponse, captchaModel.gRecaptchaResponse) && + Objects.equals(this.qqCaptchaTicket, captchaModel.qqCaptchaTicket) && + Objects.equals(this.qqCaptchaRandstr, captchaModel.qqCaptchaRandstr) && + Objects.equals(this.hCaptchaResponse, captchaModel.hCaptchaResponse)&& + Objects.equals(this.additionalProperties, captchaModel.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CaptchaModel {\n"); + sb.append(" gRecaptchaResponse: ").append(toIndentedString(gRecaptchaResponse)).append("\n"); + sb.append(" qqCaptchaTicket: ").append(toIndentedString(qqCaptchaTicket)).append("\n"); + sb.append(" qqCaptchaRandstr: ").append(toIndentedString(qqCaptchaRandstr)).append("\n"); + sb.append(" hCaptchaResponse: ").append(toIndentedString(hCaptchaResponse)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("g-recaptcha-response"); + openapiFields.add("qq_captcha_ticket"); + openapiFields.add("qq_captcha_randstr"); + openapiFields.add("h-captcha-response"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 CaptchaModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CaptchaModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CaptchaModel is not found in the empty JSON string", CaptchaModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("g-recaptcha-response") != null && !jsonObj.get("g-recaptcha-response").isJsonNull()) && !jsonObj.get("g-recaptcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `g-recaptcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("g-recaptcha-response").toString())); + } + if ((jsonObj.get("qq_captcha_ticket") != null && !jsonObj.get("qq_captcha_ticket").isJsonNull()) && !jsonObj.get("qq_captcha_ticket").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_ticket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_ticket").toString())); + } + if ((jsonObj.get("qq_captcha_randstr") != null && !jsonObj.get("qq_captcha_randstr").isJsonNull()) && !jsonObj.get("qq_captcha_randstr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_randstr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_randstr").toString())); + } + if ((jsonObj.get("h-captcha-response") != null && !jsonObj.get("h-captcha-response").isJsonNull()) && !jsonObj.get("h-captcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `h-captcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("h-captcha-response").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!CaptchaModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CaptchaModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<CaptchaModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CaptchaModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<CaptchaModel>() { + @Override + public void write(JsonWriter out, CaptchaModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CaptchaModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CaptchaModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CaptchaModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of CaptchaModel + * @throws IOException if the JSON string is invalid with respect to CaptchaModel + */ + public static CaptchaModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CaptchaModel.class); + } + + /** + * Convert an instance of CaptchaModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/CertificateWithoutKey.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/CertificateWithoutKey.java new file mode 100644 index 0000000..c52f596 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/CertificateWithoutKey.java @@ -0,0 +1,299 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * CertificateWithoutKey + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class CertificateWithoutKey { + public static final String SERIALIZED_NAME_CERTIFICATE = "Certificate"; + @SerializedName(SERIALIZED_NAME_CERTIFICATE) + @javax.annotation.Nullable + private String certificate; + + public CertificateWithoutKey() { + } + + public CertificateWithoutKey certificate(@javax.annotation.Nullable String certificate) { + this.certificate = certificate; + return this; + } + + /** + * Get certificate + * @return certificate + */ + @javax.annotation.Nullable + public String getCertificate() { + return certificate; + } + + public void setCertificate(@javax.annotation.Nullable String certificate) { + this.certificate = certificate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CertificateWithoutKey instance itself + */ + public CertificateWithoutKey putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CertificateWithoutKey certificateWithoutKey = (CertificateWithoutKey) o; + return Objects.equals(this.certificate, certificateWithoutKey.certificate)&& + Objects.equals(this.additionalProperties, certificateWithoutKey.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(certificate, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CertificateWithoutKey {\n"); + sb.append(" certificate: ").append(toIndentedString(certificate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Certificate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 CertificateWithoutKey + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CertificateWithoutKey.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CertificateWithoutKey is not found in the empty JSON string", CertificateWithoutKey.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Certificate") != null && !jsonObj.get("Certificate").isJsonNull()) && !jsonObj.get("Certificate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Certificate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Certificate").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!CertificateWithoutKey.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CertificateWithoutKey' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<CertificateWithoutKey> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CertificateWithoutKey.class)); + + return (TypeAdapter<T>) new TypeAdapter<CertificateWithoutKey>() { + @Override + public void write(JsonWriter out, CertificateWithoutKey value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CertificateWithoutKey read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CertificateWithoutKey instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CertificateWithoutKey given an JSON string + * + * @param jsonString JSON string + * @return An instance of CertificateWithoutKey + * @throws IOException if the JSON string is invalid with respect to CertificateWithoutKey + */ + public static CertificateWithoutKey fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CertificateWithoutKey.class); + } + + /** + * Convert an instance of CertificateWithoutKey to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/Certificates.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/Certificates.java new file mode 100644 index 0000000..f0b91ae --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/Certificates.java @@ -0,0 +1,329 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Certificates + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class Certificates { + public static final String SERIALIZED_NAME_CERTIFICATE = "Certificate"; + @SerializedName(SERIALIZED_NAME_CERTIFICATE) + @javax.annotation.Nullable + private String certificate; + + public static final String SERIALIZED_NAME_KEY = "Key"; + @SerializedName(SERIALIZED_NAME_KEY) + @javax.annotation.Nullable + private String key; + + public Certificates() { + } + + public Certificates certificate(@javax.annotation.Nullable String certificate) { + this.certificate = certificate; + return this; + } + + /** + * Get certificate + * @return certificate + */ + @javax.annotation.Nullable + public String getCertificate() { + return certificate; + } + + public void setCertificate(@javax.annotation.Nullable String certificate) { + this.certificate = certificate; + } + + + public Certificates key(@javax.annotation.Nullable String key) { + this.key = key; + return this; + } + + /** + * Get key + * @return key + */ + @javax.annotation.Nullable + public String getKey() { + return key; + } + + public void setKey(@javax.annotation.Nullable String key) { + this.key = key; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Certificates instance itself + */ + public Certificates putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Certificates certificates = (Certificates) o; + return Objects.equals(this.certificate, certificates.certificate) && + Objects.equals(this.key, certificates.key)&& + Objects.equals(this.additionalProperties, certificates.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(certificate, key, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Certificates {\n"); + sb.append(" certificate: ").append(toIndentedString(certificate)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Certificate"); + openapiFields.add("Key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 Certificates + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Certificates.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Certificates is not found in the empty JSON string", Certificates.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Certificate") != null && !jsonObj.get("Certificate").isJsonNull()) && !jsonObj.get("Certificate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Certificate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Certificate").toString())); + } + if ((jsonObj.get("Key") != null && !jsonObj.get("Key").isJsonNull()) && !jsonObj.get("Key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!Certificates.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Certificates' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<Certificates> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Certificates.class)); + + return (TypeAdapter<T>) new TypeAdapter<Certificates>() { + @Override + public void write(JsonWriter out, Certificates value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Certificates read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Certificates instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Certificates given an JSON string + * + * @param jsonString JSON string + * @return An instance of Certificates + * @throws IOException if the JSON string is invalid with respect to Certificates + */ + public static Certificates fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Certificates.class); + } + + /** + * Convert an instance of Certificates to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ChangePassword.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ChangePassword.java new file mode 100644 index 0000000..d21ea76 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ChangePassword.java @@ -0,0 +1,495 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ChangePassword + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ChangePassword { + public static final String SERIALIZED_NAME_G_RECAPTCHA_RESPONSE = "g-recaptcha-response"; + @SerializedName(SERIALIZED_NAME_G_RECAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String gRecaptchaResponse; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_TICKET = "qq_captcha_ticket"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_TICKET) + @javax.annotation.Nullable + private String qqCaptchaTicket; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR = "qq_captcha_randstr"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR) + @javax.annotation.Nullable + private String qqCaptchaRandstr; + + public static final String SERIALIZED_NAME_H_CAPTCHA_RESPONSE = "h-captcha-response"; + @SerializedName(SERIALIZED_NAME_H_CAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String hCaptchaResponse; + + public static final String SERIALIZED_NAME_OLD_PASSWORD = "OldPassword"; + @SerializedName(SERIALIZED_NAME_OLD_PASSWORD) + @javax.annotation.Nonnull + private String oldPassword; + + public static final String SERIALIZED_NAME_NEW_PASSWORD = "NewPassword"; + @SerializedName(SERIALIZED_NAME_NEW_PASSWORD) + @javax.annotation.Nonnull + private String newPassword; + + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer = new HashMap<>(); + + public ChangePassword() { + } + + public ChangePassword gRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + return this; + } + + /** + * The Google reCAPTCHA response which is sent to the server for verification. + * @return gRecaptchaResponse + */ + @javax.annotation.Nullable + public String getgRecaptchaResponse() { + return gRecaptchaResponse; + } + + public void setgRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + } + + + public ChangePassword qqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + return this; + } + + /** + * The QQ Captcha ticket which is sent to the server for verification. + * @return qqCaptchaTicket + */ + @javax.annotation.Nullable + public String getQqCaptchaTicket() { + return qqCaptchaTicket; + } + + public void setQqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + } + + + public ChangePassword qqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + return this; + } + + /** + * The QQ Captcha random string which is sent to the server for verification. + * @return qqCaptchaRandstr + */ + @javax.annotation.Nullable + public String getQqCaptchaRandstr() { + return qqCaptchaRandstr; + } + + public void setQqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + } + + + public ChangePassword hCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + return this; + } + + /** + * The hCaptcha response which is sent to the server for verification. + * @return hCaptchaResponse + */ + @javax.annotation.Nullable + public String gethCaptchaResponse() { + return hCaptchaResponse; + } + + public void sethCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + } + + + public ChangePassword oldPassword(@javax.annotation.Nonnull String oldPassword) { + this.oldPassword = oldPassword; + return this; + } + + /** + * User's current password + * @return oldPassword + */ + @javax.annotation.Nonnull + public String getOldPassword() { + return oldPassword; + } + + public void setOldPassword(@javax.annotation.Nonnull String oldPassword) { + this.oldPassword = oldPassword; + } + + + public ChangePassword newPassword(@javax.annotation.Nonnull String newPassword) { + this.newPassword = newPassword; + return this; + } + + /** + * User's new password + * @return newPassword + */ + @javax.annotation.Nonnull + public String getNewPassword() { + return newPassword; + } + + public void setNewPassword(@javax.annotation.Nonnull String newPassword) { + this.newPassword = newPassword; + } + + + public ChangePassword securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public ChangePassword putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * Optional map of security question IDs/keys to answers, used to unlock an account that is locked pending security-question verification. + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ChangePassword instance itself + */ + public ChangePassword putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangePassword changePassword = (ChangePassword) o; + return Objects.equals(this.gRecaptchaResponse, changePassword.gRecaptchaResponse) && + Objects.equals(this.qqCaptchaTicket, changePassword.qqCaptchaTicket) && + Objects.equals(this.qqCaptchaRandstr, changePassword.qqCaptchaRandstr) && + Objects.equals(this.hCaptchaResponse, changePassword.hCaptchaResponse) && + Objects.equals(this.oldPassword, changePassword.oldPassword) && + Objects.equals(this.newPassword, changePassword.newPassword) && + Objects.equals(this.securityAnswer, changePassword.securityAnswer)&& + Objects.equals(this.additionalProperties, changePassword.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, oldPassword, newPassword, securityAnswer, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangePassword {\n"); + sb.append(" gRecaptchaResponse: ").append(toIndentedString(gRecaptchaResponse)).append("\n"); + sb.append(" qqCaptchaTicket: ").append(toIndentedString(qqCaptchaTicket)).append("\n"); + sb.append(" qqCaptchaRandstr: ").append(toIndentedString(qqCaptchaRandstr)).append("\n"); + sb.append(" hCaptchaResponse: ").append(toIndentedString(hCaptchaResponse)).append("\n"); + sb.append(" oldPassword: ").append(toIndentedString(oldPassword)).append("\n"); + sb.append(" newPassword: ").append(toIndentedString(newPassword)).append("\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("g-recaptcha-response"); + openapiFields.add("qq_captcha_ticket"); + openapiFields.add("qq_captcha_randstr"); + openapiFields.add("h-captcha-response"); + openapiFields.add("OldPassword"); + openapiFields.add("NewPassword"); + openapiFields.add("SecurityAnswer"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("OldPassword"); + openapiRequiredFields.add("NewPassword"); + } + + /** + * 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 ChangePassword + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ChangePassword.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ChangePassword is not found in the empty JSON string", ChangePassword.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ChangePassword.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("g-recaptcha-response") != null && !jsonObj.get("g-recaptcha-response").isJsonNull()) && !jsonObj.get("g-recaptcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `g-recaptcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("g-recaptcha-response").toString())); + } + if ((jsonObj.get("qq_captcha_ticket") != null && !jsonObj.get("qq_captcha_ticket").isJsonNull()) && !jsonObj.get("qq_captcha_ticket").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_ticket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_ticket").toString())); + } + if ((jsonObj.get("qq_captcha_randstr") != null && !jsonObj.get("qq_captcha_randstr").isJsonNull()) && !jsonObj.get("qq_captcha_randstr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_randstr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_randstr").toString())); + } + if ((jsonObj.get("h-captcha-response") != null && !jsonObj.get("h-captcha-response").isJsonNull()) && !jsonObj.get("h-captcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `h-captcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("h-captcha-response").toString())); + } + if (!jsonObj.get("OldPassword").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `OldPassword` to be a primitive type in the JSON string but got `%s`", jsonObj.get("OldPassword").toString())); + } + if (!jsonObj.get("NewPassword").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NewPassword` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NewPassword").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ChangePassword.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ChangePassword' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ChangePassword> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ChangePassword.class)); + + return (TypeAdapter<T>) new TypeAdapter<ChangePassword>() { + @Override + public void write(JsonWriter out, ChangePassword value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ChangePassword read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ChangePassword instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ChangePassword given an JSON string + * + * @param jsonString JSON string + * @return An instance of ChangePassword + * @throws IOException if the JSON string is invalid with respect to ChangePassword + */ + public static ChangePassword fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ChangePassword.class); + } + + /** + * Convert an instance of ChangePassword to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ChangePasswordCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ChangePasswordCore.java new file mode 100644 index 0000000..bbb1557 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ChangePasswordCore.java @@ -0,0 +1,363 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ChangePasswordCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ChangePasswordCore { + public static final String SERIALIZED_NAME_OLD_PASSWORD = "OldPassword"; + @SerializedName(SERIALIZED_NAME_OLD_PASSWORD) + @javax.annotation.Nonnull + private String oldPassword; + + public static final String SERIALIZED_NAME_NEW_PASSWORD = "NewPassword"; + @SerializedName(SERIALIZED_NAME_NEW_PASSWORD) + @javax.annotation.Nonnull + private String newPassword; + + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer = new HashMap<>(); + + public ChangePasswordCore() { + } + + public ChangePasswordCore oldPassword(@javax.annotation.Nonnull String oldPassword) { + this.oldPassword = oldPassword; + return this; + } + + /** + * User's current password + * @return oldPassword + */ + @javax.annotation.Nonnull + public String getOldPassword() { + return oldPassword; + } + + public void setOldPassword(@javax.annotation.Nonnull String oldPassword) { + this.oldPassword = oldPassword; + } + + + public ChangePasswordCore newPassword(@javax.annotation.Nonnull String newPassword) { + this.newPassword = newPassword; + return this; + } + + /** + * User's new password + * @return newPassword + */ + @javax.annotation.Nonnull + public String getNewPassword() { + return newPassword; + } + + public void setNewPassword(@javax.annotation.Nonnull String newPassword) { + this.newPassword = newPassword; + } + + + public ChangePasswordCore securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public ChangePasswordCore putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * Optional map of security question IDs/keys to answers, used to unlock an account that is locked pending security-question verification. + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ChangePasswordCore instance itself + */ + public ChangePasswordCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangePasswordCore changePasswordCore = (ChangePasswordCore) o; + return Objects.equals(this.oldPassword, changePasswordCore.oldPassword) && + Objects.equals(this.newPassword, changePasswordCore.newPassword) && + Objects.equals(this.securityAnswer, changePasswordCore.securityAnswer)&& + Objects.equals(this.additionalProperties, changePasswordCore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(oldPassword, newPassword, securityAnswer, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangePasswordCore {\n"); + sb.append(" oldPassword: ").append(toIndentedString(oldPassword)).append("\n"); + sb.append(" newPassword: ").append(toIndentedString(newPassword)).append("\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("OldPassword"); + openapiFields.add("NewPassword"); + openapiFields.add("SecurityAnswer"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("OldPassword"); + openapiRequiredFields.add("NewPassword"); + } + + /** + * 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 ChangePasswordCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ChangePasswordCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ChangePasswordCore is not found in the empty JSON string", ChangePasswordCore.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ChangePasswordCore.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("OldPassword").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `OldPassword` to be a primitive type in the JSON string but got `%s`", jsonObj.get("OldPassword").toString())); + } + if (!jsonObj.get("NewPassword").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NewPassword` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NewPassword").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ChangePasswordCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ChangePasswordCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ChangePasswordCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ChangePasswordCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<ChangePasswordCore>() { + @Override + public void write(JsonWriter out, ChangePasswordCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ChangePasswordCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ChangePasswordCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ChangePasswordCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of ChangePasswordCore + * @throws IOException if the JSON string is invalid with respect to ChangePasswordCore + */ + public static ChangePasswordCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ChangePasswordCore.class); + } + + /** + * Convert an instance of ChangePasswordCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ChangePin.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ChangePin.java new file mode 100644 index 0000000..2b1b00b --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ChangePin.java @@ -0,0 +1,495 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ChangePin + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ChangePin { + public static final String SERIALIZED_NAME_G_RECAPTCHA_RESPONSE = "g-recaptcha-response"; + @SerializedName(SERIALIZED_NAME_G_RECAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String gRecaptchaResponse; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_TICKET = "qq_captcha_ticket"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_TICKET) + @javax.annotation.Nullable + private String qqCaptchaTicket; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR = "qq_captcha_randstr"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR) + @javax.annotation.Nullable + private String qqCaptchaRandstr; + + public static final String SERIALIZED_NAME_H_CAPTCHA_RESPONSE = "h-captcha-response"; + @SerializedName(SERIALIZED_NAME_H_CAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String hCaptchaResponse; + + public static final String SERIALIZED_NAME_OLDPIN = "oldpin"; + @SerializedName(SERIALIZED_NAME_OLDPIN) + @javax.annotation.Nonnull + private String oldpin; + + public static final String SERIALIZED_NAME_NEWPIN = "newpin"; + @SerializedName(SERIALIZED_NAME_NEWPIN) + @javax.annotation.Nonnull + private String newpin; + + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer = new HashMap<>(); + + public ChangePin() { + } + + public ChangePin gRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + return this; + } + + /** + * The Google reCAPTCHA response which is sent to the server for verification. + * @return gRecaptchaResponse + */ + @javax.annotation.Nullable + public String getgRecaptchaResponse() { + return gRecaptchaResponse; + } + + public void setgRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + } + + + public ChangePin qqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + return this; + } + + /** + * The QQ Captcha ticket which is sent to the server for verification. + * @return qqCaptchaTicket + */ + @javax.annotation.Nullable + public String getQqCaptchaTicket() { + return qqCaptchaTicket; + } + + public void setQqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + } + + + public ChangePin qqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + return this; + } + + /** + * The QQ Captcha random string which is sent to the server for verification. + * @return qqCaptchaRandstr + */ + @javax.annotation.Nullable + public String getQqCaptchaRandstr() { + return qqCaptchaRandstr; + } + + public void setQqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + } + + + public ChangePin hCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + return this; + } + + /** + * The hCaptcha response which is sent to the server for verification. + * @return hCaptchaResponse + */ + @javax.annotation.Nullable + public String gethCaptchaResponse() { + return hCaptchaResponse; + } + + public void sethCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + } + + + public ChangePin oldpin(@javax.annotation.Nonnull String oldpin) { + this.oldpin = oldpin; + return this; + } + + /** + * Get oldpin + * @return oldpin + */ + @javax.annotation.Nonnull + public String getOldpin() { + return oldpin; + } + + public void setOldpin(@javax.annotation.Nonnull String oldpin) { + this.oldpin = oldpin; + } + + + public ChangePin newpin(@javax.annotation.Nonnull String newpin) { + this.newpin = newpin; + return this; + } + + /** + * Get newpin + * @return newpin + */ + @javax.annotation.Nonnull + public String getNewpin() { + return newpin; + } + + public void setNewpin(@javax.annotation.Nonnull String newpin) { + this.newpin = newpin; + } + + + public ChangePin securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public ChangePin putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * Optional map of security question IDs/keys to answers, used to unlock an account that is locked pending security-question verification. + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ChangePin instance itself + */ + public ChangePin putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangePin changePin = (ChangePin) o; + return Objects.equals(this.gRecaptchaResponse, changePin.gRecaptchaResponse) && + Objects.equals(this.qqCaptchaTicket, changePin.qqCaptchaTicket) && + Objects.equals(this.qqCaptchaRandstr, changePin.qqCaptchaRandstr) && + Objects.equals(this.hCaptchaResponse, changePin.hCaptchaResponse) && + Objects.equals(this.oldpin, changePin.oldpin) && + Objects.equals(this.newpin, changePin.newpin) && + Objects.equals(this.securityAnswer, changePin.securityAnswer)&& + Objects.equals(this.additionalProperties, changePin.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, oldpin, newpin, securityAnswer, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangePin {\n"); + sb.append(" gRecaptchaResponse: ").append(toIndentedString(gRecaptchaResponse)).append("\n"); + sb.append(" qqCaptchaTicket: ").append(toIndentedString(qqCaptchaTicket)).append("\n"); + sb.append(" qqCaptchaRandstr: ").append(toIndentedString(qqCaptchaRandstr)).append("\n"); + sb.append(" hCaptchaResponse: ").append(toIndentedString(hCaptchaResponse)).append("\n"); + sb.append(" oldpin: ").append(toIndentedString(oldpin)).append("\n"); + sb.append(" newpin: ").append(toIndentedString(newpin)).append("\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("g-recaptcha-response"); + openapiFields.add("qq_captcha_ticket"); + openapiFields.add("qq_captcha_randstr"); + openapiFields.add("h-captcha-response"); + openapiFields.add("oldpin"); + openapiFields.add("newpin"); + openapiFields.add("SecurityAnswer"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("oldpin"); + openapiRequiredFields.add("newpin"); + } + + /** + * 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 ChangePin + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ChangePin.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ChangePin is not found in the empty JSON string", ChangePin.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ChangePin.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("g-recaptcha-response") != null && !jsonObj.get("g-recaptcha-response").isJsonNull()) && !jsonObj.get("g-recaptcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `g-recaptcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("g-recaptcha-response").toString())); + } + if ((jsonObj.get("qq_captcha_ticket") != null && !jsonObj.get("qq_captcha_ticket").isJsonNull()) && !jsonObj.get("qq_captcha_ticket").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_ticket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_ticket").toString())); + } + if ((jsonObj.get("qq_captcha_randstr") != null && !jsonObj.get("qq_captcha_randstr").isJsonNull()) && !jsonObj.get("qq_captcha_randstr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_randstr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_randstr").toString())); + } + if ((jsonObj.get("h-captcha-response") != null && !jsonObj.get("h-captcha-response").isJsonNull()) && !jsonObj.get("h-captcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `h-captcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("h-captcha-response").toString())); + } + if (!jsonObj.get("oldpin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `oldpin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("oldpin").toString())); + } + if (!jsonObj.get("newpin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `newpin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("newpin").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ChangePin.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ChangePin' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ChangePin> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ChangePin.class)); + + return (TypeAdapter<T>) new TypeAdapter<ChangePin>() { + @Override + public void write(JsonWriter out, ChangePin value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ChangePin read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ChangePin instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ChangePin given an JSON string + * + * @param jsonString JSON string + * @return An instance of ChangePin + * @throws IOException if the JSON string is invalid with respect to ChangePin + */ + public static ChangePin fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ChangePin.class); + } + + /** + * Convert an instance of ChangePin to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ChangePinCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ChangePinCore.java new file mode 100644 index 0000000..11ccc59 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ChangePinCore.java @@ -0,0 +1,363 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ChangePinCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ChangePinCore { + public static final String SERIALIZED_NAME_OLDPIN = "oldpin"; + @SerializedName(SERIALIZED_NAME_OLDPIN) + @javax.annotation.Nonnull + private String oldpin; + + public static final String SERIALIZED_NAME_NEWPIN = "newpin"; + @SerializedName(SERIALIZED_NAME_NEWPIN) + @javax.annotation.Nonnull + private String newpin; + + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer = new HashMap<>(); + + public ChangePinCore() { + } + + public ChangePinCore oldpin(@javax.annotation.Nonnull String oldpin) { + this.oldpin = oldpin; + return this; + } + + /** + * Get oldpin + * @return oldpin + */ + @javax.annotation.Nonnull + public String getOldpin() { + return oldpin; + } + + public void setOldpin(@javax.annotation.Nonnull String oldpin) { + this.oldpin = oldpin; + } + + + public ChangePinCore newpin(@javax.annotation.Nonnull String newpin) { + this.newpin = newpin; + return this; + } + + /** + * Get newpin + * @return newpin + */ + @javax.annotation.Nonnull + public String getNewpin() { + return newpin; + } + + public void setNewpin(@javax.annotation.Nonnull String newpin) { + this.newpin = newpin; + } + + + public ChangePinCore securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public ChangePinCore putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * Optional map of security question IDs/keys to answers, used to unlock an account that is locked pending security-question verification. + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ChangePinCore instance itself + */ + public ChangePinCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChangePinCore changePinCore = (ChangePinCore) o; + return Objects.equals(this.oldpin, changePinCore.oldpin) && + Objects.equals(this.newpin, changePinCore.newpin) && + Objects.equals(this.securityAnswer, changePinCore.securityAnswer)&& + Objects.equals(this.additionalProperties, changePinCore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(oldpin, newpin, securityAnswer, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChangePinCore {\n"); + sb.append(" oldpin: ").append(toIndentedString(oldpin)).append("\n"); + sb.append(" newpin: ").append(toIndentedString(newpin)).append("\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("oldpin"); + openapiFields.add("newpin"); + openapiFields.add("SecurityAnswer"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("oldpin"); + openapiRequiredFields.add("newpin"); + } + + /** + * 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 ChangePinCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ChangePinCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ChangePinCore is not found in the empty JSON string", ChangePinCore.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ChangePinCore.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("oldpin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `oldpin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("oldpin").toString())); + } + if (!jsonObj.get("newpin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `newpin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("newpin").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ChangePinCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ChangePinCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ChangePinCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ChangePinCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<ChangePinCore>() { + @Override + public void write(JsonWriter out, ChangePinCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ChangePinCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ChangePinCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ChangePinCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of ChangePinCore + * @throws IOException if the JSON string is invalid with respect to ChangePinCore + */ + public static ChangePinCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ChangePinCore.class); + } + + /** + * Convert an instance of ChangePinCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/CheckEmailAvailability200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/CheckEmailAvailability200Response.java new file mode 100644 index 0000000..eda383f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/CheckEmailAvailability200Response.java @@ -0,0 +1,323 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.AuthResponse; +import com.loginradius.sdk.internal.openapi.model.AuthResponseEmailVerification; +import com.loginradius.sdk.internal.openapi.model.AuthResponseEmailVerificationData; +import com.loginradius.sdk.internal.openapi.model.IsExist; +import com.loginradius.sdk.internal.openapi.model.Profile; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class CheckEmailAvailability200Response extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(CheckEmailAvailability200Response.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!CheckEmailAvailability200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CheckEmailAvailability200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<IsExist> adapterIsExist = gson.getDelegateAdapter(this, TypeToken.get(IsExist.class)); + final TypeAdapter<AuthResponse> adapterAuthResponse = gson.getDelegateAdapter(this, TypeToken.get(AuthResponse.class)); + final TypeAdapter<AuthResponseEmailVerification> adapterAuthResponseEmailVerification = gson.getDelegateAdapter(this, TypeToken.get(AuthResponseEmailVerification.class)); + + return (TypeAdapter<T>) new TypeAdapter<CheckEmailAvailability200Response>() { + @Override + public void write(JsonWriter out, CheckEmailAvailability200Response value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `IsExist` + if (value.getActualInstance() instanceof IsExist) { + JsonElement element = adapterIsExist.toJsonTree((IsExist)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `AuthResponse` + if (value.getActualInstance() instanceof AuthResponse) { + JsonElement element = adapterAuthResponse.toJsonTree((AuthResponse)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `AuthResponseEmailVerification` + if (value.getActualInstance() instanceof AuthResponseEmailVerification) { + JsonElement element = adapterAuthResponseEmailVerification.toJsonTree((AuthResponseEmailVerification)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: AuthResponse, AuthResponseEmailVerification, IsExist"); + } + + @Override + public CheckEmailAvailability200Response read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize IsExist + try { + // validate the JSON object to see if any exception is thrown + IsExist.validateJsonElement(jsonElement); + actualAdapter = adapterIsExist; + match++; + log.log(Level.FINER, "Input data matches schema 'IsExist'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for IsExist failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'IsExist'", e); + } + // deserialize AuthResponse + try { + // validate the JSON object to see if any exception is thrown + AuthResponse.validateJsonElement(jsonElement); + actualAdapter = adapterAuthResponse; + match++; + log.log(Level.FINER, "Input data matches schema 'AuthResponse'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for AuthResponse failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'AuthResponse'", e); + } + // deserialize AuthResponseEmailVerification + try { + // validate the JSON object to see if any exception is thrown + AuthResponseEmailVerification.validateJsonElement(jsonElement); + actualAdapter = adapterAuthResponseEmailVerification; + match++; + log.log(Level.FINER, "Input data matches schema 'AuthResponseEmailVerification'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for AuthResponseEmailVerification failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'AuthResponseEmailVerification'", e); + } + + if (match == 1) { + CheckEmailAvailability200Response ret = new CheckEmailAvailability200Response(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for CheckEmailAvailability200Response: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public CheckEmailAvailability200Response() { + super("oneOf", Boolean.FALSE); + } + + public CheckEmailAvailability200Response(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("IsExist", IsExist.class); + schemas.put("AuthResponse", AuthResponse.class); + schemas.put("AuthResponseEmailVerification", AuthResponseEmailVerification.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return CheckEmailAvailability200Response.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * AuthResponse, AuthResponseEmailVerification, IsExist + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof IsExist) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof AuthResponse) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof AuthResponseEmailVerification) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be AuthResponse, AuthResponseEmailVerification, IsExist"); + } + + /** + * Get the actual instance, which can be the following: + * AuthResponse, AuthResponseEmailVerification, IsExist + * + * @return The actual instance (AuthResponse, AuthResponseEmailVerification, IsExist) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `IsExist`. If the actual instance is not `IsExist`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `IsExist` + * @throws ClassCastException if the instance is not `IsExist` + */ + public IsExist getIsExist() throws ClassCastException { + return (IsExist)super.getActualInstance(); + } + + /** + * Get the actual instance of `AuthResponse`. If the actual instance is not `AuthResponse`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AuthResponse` + * @throws ClassCastException if the instance is not `AuthResponse` + */ + public AuthResponse getAuthResponse() throws ClassCastException { + return (AuthResponse)super.getActualInstance(); + } + + /** + * Get the actual instance of `AuthResponseEmailVerification`. If the actual instance is not `AuthResponseEmailVerification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AuthResponseEmailVerification` + * @throws ClassCastException if the instance is not `AuthResponseEmailVerification` + */ + public AuthResponseEmailVerification getAuthResponseEmailVerification() throws ClassCastException { + return (AuthResponseEmailVerification)super.getActualInstance(); + } + + /** + * 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 CheckEmailAvailability200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with IsExist + try { + IsExist.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for IsExist failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with AuthResponse + try { + AuthResponse.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for AuthResponse failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with AuthResponseEmailVerification + try { + AuthResponseEmailVerification.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for AuthResponseEmailVerification failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for CheckEmailAvailability200Response with oneOf schemas: AuthResponse, AuthResponseEmailVerification, IsExist. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of CheckEmailAvailability200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CheckEmailAvailability200Response + * @throws IOException if the JSON string is invalid with respect to CheckEmailAvailability200Response + */ + public static CheckEmailAvailability200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CheckEmailAvailability200Response.class); + } + + /** + * Convert an instance of CheckEmailAvailability200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/CheckUserNameAvailability200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/CheckUserNameAvailability200Response.java new file mode 100644 index 0000000..d9815cd --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/CheckUserNameAvailability200Response.java @@ -0,0 +1,284 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * CheckUserNameAvailability200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class CheckUserNameAvailability200Response { + public static final String SERIALIZED_NAME_IS_EXIST = "IsExist"; + @SerializedName(SERIALIZED_NAME_IS_EXIST) + @javax.annotation.Nullable + private Boolean isExist; + + public CheckUserNameAvailability200Response() { + } + + public CheckUserNameAvailability200Response isExist(@javax.annotation.Nullable Boolean isExist) { + this.isExist = isExist; + return this; + } + + /** + * Indicates whether the Username exists in the system. + * @return isExist + */ + @javax.annotation.Nullable + public Boolean getIsExist() { + return isExist; + } + + public void setIsExist(@javax.annotation.Nullable Boolean isExist) { + this.isExist = isExist; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CheckUserNameAvailability200Response instance itself + */ + public CheckUserNameAvailability200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CheckUserNameAvailability200Response checkUserNameAvailability200Response = (CheckUserNameAvailability200Response) o; + return Objects.equals(this.isExist, checkUserNameAvailability200Response.isExist)&& + Objects.equals(this.additionalProperties, checkUserNameAvailability200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isExist, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CheckUserNameAvailability200Response {\n"); + sb.append(" isExist: ").append(toIndentedString(isExist)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsExist"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 CheckUserNameAvailability200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CheckUserNameAvailability200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CheckUserNameAvailability200Response is not found in the empty JSON string", CheckUserNameAvailability200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!CheckUserNameAvailability200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CheckUserNameAvailability200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<CheckUserNameAvailability200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CheckUserNameAvailability200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<CheckUserNameAvailability200Response>() { + @Override + public void write(JsonWriter out, CheckUserNameAvailability200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CheckUserNameAvailability200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CheckUserNameAvailability200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CheckUserNameAvailability200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of CheckUserNameAvailability200Response + * @throws IOException if the JSON string is invalid with respect to CheckUserNameAvailability200Response + */ + public static CheckUserNameAvailability200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CheckUserNameAvailability200Response.class); + } + + /** + * Convert an instance of CheckUserNameAvailability200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ClientGuidBodyModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ClientGuidBodyModel.java new file mode 100644 index 0000000..7c96bbb --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ClientGuidBodyModel.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * Structure of the request body to link social identity + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ClientGuidBodyModel { + public static final String SERIALIZED_NAME_CLIENTG_U_I_D = "clientgUID"; + @SerializedName(SERIALIZED_NAME_CLIENTG_U_I_D) + @javax.annotation.Nullable + private String clientgUID; + + public static final String SERIALIZED_NAME_ACCESS_TOKEN = "access_token"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN) + @javax.annotation.Nullable + private String accessToken; + + public ClientGuidBodyModel() { + } + + public ClientGuidBodyModel clientgUID(@javax.annotation.Nullable String clientgUID) { + this.clientgUID = clientgUID; + return this; + } + + /** + * The client's gUID to link social identity + * @return clientgUID + */ + @javax.annotation.Nullable + public String getClientgUID() { + return clientgUID; + } + + public void setClientgUID(@javax.annotation.Nullable String clientgUID) { + this.clientgUID = clientgUID; + } + + + public ClientGuidBodyModel accessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * The Access Token of the User + * @return accessToken + */ + @javax.annotation.Nullable + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ClientGuidBodyModel instance itself + */ + public ClientGuidBodyModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ClientGuidBodyModel clientGuidBodyModel = (ClientGuidBodyModel) o; + return Objects.equals(this.clientgUID, clientGuidBodyModel.clientgUID) && + Objects.equals(this.accessToken, clientGuidBodyModel.accessToken)&& + Objects.equals(this.additionalProperties, clientGuidBodyModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(clientgUID, accessToken, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ClientGuidBodyModel {\n"); + sb.append(" clientgUID: ").append(toIndentedString(clientgUID)).append("\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("clientgUID"); + openapiFields.add("access_token"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ClientGuidBodyModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ClientGuidBodyModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ClientGuidBodyModel is not found in the empty JSON string", ClientGuidBodyModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("clientgUID") != null && !jsonObj.get("clientgUID").isJsonNull()) && !jsonObj.get("clientgUID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientgUID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientgUID").toString())); + } + if ((jsonObj.get("access_token") != null && !jsonObj.get("access_token").isJsonNull()) && !jsonObj.get("access_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `access_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("access_token").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ClientGuidBodyModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ClientGuidBodyModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ClientGuidBodyModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ClientGuidBodyModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<ClientGuidBodyModel>() { + @Override + public void write(JsonWriter out, ClientGuidBodyModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ClientGuidBodyModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ClientGuidBodyModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ClientGuidBodyModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ClientGuidBodyModel + * @throws IOException if the JSON string is invalid with respect to ClientGuidBodyModel + */ + public static ClientGuidBodyModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ClientGuidBodyModel.class); + } + + /** + * Convert an instance of ClientGuidBodyModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ConnectionGroupRoleRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConnectionGroupRoleRequest.java new file mode 100644 index 0000000..d7a432f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConnectionGroupRoleRequest.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ConnectionGroupRoleRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ConnectionGroupRoleRequest { + public static final String SERIALIZED_NAME_GROUP_ID = "GroupId"; + @SerializedName(SERIALIZED_NAME_GROUP_ID) + @javax.annotation.Nullable + private String groupId; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_ROLE_ID = "RoleId"; + @SerializedName(SERIALIZED_NAME_ROLE_ID) + @javax.annotation.Nullable + private String roleId; + + public ConnectionGroupRoleRequest() { + } + + public ConnectionGroupRoleRequest groupId(@javax.annotation.Nullable String groupId) { + this.groupId = groupId; + return this; + } + + /** + * Unique identifier of the group to which the Role belongs. + * @return groupId + */ + @javax.annotation.Nullable + public String getGroupId() { + return groupId; + } + + public void setGroupId(@javax.annotation.Nullable String groupId) { + this.groupId = groupId; + } + + + public ConnectionGroupRoleRequest name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Name of the group Role connection. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ConnectionGroupRoleRequest roleId(@javax.annotation.Nullable String roleId) { + this.roleId = roleId; + return this; + } + + /** + * Unique identifier of the Role. + * @return roleId + */ + @javax.annotation.Nullable + public String getRoleId() { + return roleId; + } + + public void setRoleId(@javax.annotation.Nullable String roleId) { + this.roleId = roleId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConnectionGroupRoleRequest instance itself + */ + public ConnectionGroupRoleRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectionGroupRoleRequest connectionGroupRoleRequest = (ConnectionGroupRoleRequest) o; + return Objects.equals(this.groupId, connectionGroupRoleRequest.groupId) && + Objects.equals(this.name, connectionGroupRoleRequest.name) && + Objects.equals(this.roleId, connectionGroupRoleRequest.roleId)&& + Objects.equals(this.additionalProperties, connectionGroupRoleRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(groupId, name, roleId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectionGroupRoleRequest {\n"); + sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" roleId: ").append(toIndentedString(roleId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("GroupId"); + openapiFields.add("Name"); + openapiFields.add("RoleId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ConnectionGroupRoleRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConnectionGroupRoleRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConnectionGroupRoleRequest is not found in the empty JSON string", ConnectionGroupRoleRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("GroupId") != null && !jsonObj.get("GroupId").isJsonNull()) && !jsonObj.get("GroupId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GroupId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GroupId").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("RoleId") != null && !jsonObj.get("RoleId").isJsonNull()) && !jsonObj.get("RoleId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RoleId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RoleId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ConnectionGroupRoleRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConnectionGroupRoleRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ConnectionGroupRoleRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConnectionGroupRoleRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<ConnectionGroupRoleRequest>() { + @Override + public void write(JsonWriter out, ConnectionGroupRoleRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConnectionGroupRoleRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConnectionGroupRoleRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConnectionGroupRoleRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConnectionGroupRoleRequest + * @throws IOException if the JSON string is invalid with respect to ConnectionGroupRoleRequest + */ + public static ConnectionGroupRoleRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConnectionGroupRoleRequest.class); + } + + /** + * Convert an instance of ConnectionGroupRoleRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ConnectionGroupRoleResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConnectionGroupRoleResponse.java new file mode 100644 index 0000000..519b808 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConnectionGroupRoleResponse.java @@ -0,0 +1,377 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ConnectionGroupRoleResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ConnectionGroupRoleResponse { + public static final String SERIALIZED_NAME_GROUP_ID = "GroupId"; + @SerializedName(SERIALIZED_NAME_GROUP_ID) + @javax.annotation.Nullable + private String groupId; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_ROLE_ID = "RoleId"; + @SerializedName(SERIALIZED_NAME_ROLE_ID) + @javax.annotation.Nullable + private String roleId; + + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public ConnectionGroupRoleResponse() { + } + + public ConnectionGroupRoleResponse groupId(@javax.annotation.Nullable String groupId) { + this.groupId = groupId; + return this; + } + + /** + * Unique identifier of the group to which the Role belongs. + * @return groupId + */ + @javax.annotation.Nullable + public String getGroupId() { + return groupId; + } + + public void setGroupId(@javax.annotation.Nullable String groupId) { + this.groupId = groupId; + } + + + public ConnectionGroupRoleResponse name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Name of the group Role connection. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ConnectionGroupRoleResponse roleId(@javax.annotation.Nullable String roleId) { + this.roleId = roleId; + return this; + } + + /** + * Unique identifier of the Role. + * @return roleId + */ + @javax.annotation.Nullable + public String getRoleId() { + return roleId; + } + + public void setRoleId(@javax.annotation.Nullable String roleId) { + this.roleId = roleId; + } + + + public ConnectionGroupRoleResponse id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Unique identifier of the group-to-role mapping. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConnectionGroupRoleResponse instance itself + */ + public ConnectionGroupRoleResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectionGroupRoleResponse connectionGroupRoleResponse = (ConnectionGroupRoleResponse) o; + return Objects.equals(this.groupId, connectionGroupRoleResponse.groupId) && + Objects.equals(this.name, connectionGroupRoleResponse.name) && + Objects.equals(this.roleId, connectionGroupRoleResponse.roleId) && + Objects.equals(this.id, connectionGroupRoleResponse.id)&& + Objects.equals(this.additionalProperties, connectionGroupRoleResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(groupId, name, roleId, id, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectionGroupRoleResponse {\n"); + sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" roleId: ").append(toIndentedString(roleId)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("GroupId"); + openapiFields.add("Name"); + openapiFields.add("RoleId"); + openapiFields.add("Id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ConnectionGroupRoleResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConnectionGroupRoleResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConnectionGroupRoleResponse is not found in the empty JSON string", ConnectionGroupRoleResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("GroupId") != null && !jsonObj.get("GroupId").isJsonNull()) && !jsonObj.get("GroupId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GroupId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GroupId").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("RoleId") != null && !jsonObj.get("RoleId").isJsonNull()) && !jsonObj.get("RoleId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RoleId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RoleId").toString())); + } + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ConnectionGroupRoleResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConnectionGroupRoleResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ConnectionGroupRoleResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConnectionGroupRoleResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<ConnectionGroupRoleResponse>() { + @Override + public void write(JsonWriter out, ConnectionGroupRoleResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConnectionGroupRoleResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConnectionGroupRoleResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConnectionGroupRoleResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConnectionGroupRoleResponse + * @throws IOException if the JSON string is invalid with respect to ConnectionGroupRoleResponse + */ + public static ConnectionGroupRoleResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConnectionGroupRoleResponse.class); + } + + /** + * Convert an instance of ConnectionGroupRoleResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ConnectionGroupRoleResponseCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConnectionGroupRoleResponseCore.java new file mode 100644 index 0000000..aa4f910 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConnectionGroupRoleResponseCore.java @@ -0,0 +1,287 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ConnectionGroupRoleResponseCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ConnectionGroupRoleResponseCore { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public ConnectionGroupRoleResponseCore() { + } + + public ConnectionGroupRoleResponseCore id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Unique identifier of the group-to-role mapping. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConnectionGroupRoleResponseCore instance itself + */ + public ConnectionGroupRoleResponseCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectionGroupRoleResponseCore connectionGroupRoleResponseCore = (ConnectionGroupRoleResponseCore) o; + return Objects.equals(this.id, connectionGroupRoleResponseCore.id)&& + Objects.equals(this.additionalProperties, connectionGroupRoleResponseCore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectionGroupRoleResponseCore {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ConnectionGroupRoleResponseCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConnectionGroupRoleResponseCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConnectionGroupRoleResponseCore is not found in the empty JSON string", ConnectionGroupRoleResponseCore.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ConnectionGroupRoleResponseCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConnectionGroupRoleResponseCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ConnectionGroupRoleResponseCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConnectionGroupRoleResponseCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<ConnectionGroupRoleResponseCore>() { + @Override + public void write(JsonWriter out, ConnectionGroupRoleResponseCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConnectionGroupRoleResponseCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConnectionGroupRoleResponseCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConnectionGroupRoleResponseCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConnectionGroupRoleResponseCore + * @throws IOException if the JSON string is invalid with respect to ConnectionGroupRoleResponseCore + */ + public static ConnectionGroupRoleResponseCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConnectionGroupRoleResponseCore.class); + } + + /** + * Convert an instance of ConnectionGroupRoleResponseCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ConnectionResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConnectionResponse.java new file mode 100644 index 0000000..ab906c1 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConnectionResponse.java @@ -0,0 +1,1275 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ConnectionGroupRoleResponse; +import com.loginradius.sdk.internal.openapi.model.OrganizationsConnectionBaseAttributes; +import com.loginradius.sdk.internal.openapi.model.OrganizationsConnectionSamlBaseIDPCertificate; +import com.loginradius.sdk.internal.openapi.model.SamlConnectionResponseCoreSPCertificate; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ConnectionResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ConnectionResponse { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_IS_ACTIVE = "IsActive"; + @SerializedName(SERIALIZED_NAME_IS_ACTIVE) + @javax.annotation.Nullable + private Boolean isActive; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public static final String SERIALIZED_NAME_GROUP_ROLES = "GroupRoles"; + @SerializedName(SERIALIZED_NAME_GROUP_ROLES) + @javax.annotation.Nullable + private List<ConnectionGroupRoleResponse> groupRoles; + + public static final String SERIALIZED_NAME_MODIFIED_DATE = "ModifiedDate"; + @SerializedName(SERIALIZED_NAME_MODIFIED_DATE) + @javax.annotation.Nullable + private OffsetDateTime modifiedDate; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_DOMAIN = "Domain"; + @SerializedName(SERIALIZED_NAME_DOMAIN) + @javax.annotation.Nullable + private String domain; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "Attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nullable + private OrganizationsConnectionBaseAttributes attributes; + + public static final String SERIALIZED_NAME_ID_P_ENTITY_ID = "IDPEntityId"; + @SerializedName(SERIALIZED_NAME_ID_P_ENTITY_ID) + @javax.annotation.Nullable + private String idPEntityId; + + public static final String SERIALIZED_NAME_ID_P_METADATA_URL = "IDPMetadataUrl"; + @SerializedName(SERIALIZED_NAME_ID_P_METADATA_URL) + @javax.annotation.Nullable + private String idPMetadataUrl; + + public static final String SERIALIZED_NAME_IS_I_D_P_INITIATED = "IsIDPInitiated"; + @SerializedName(SERIALIZED_NAME_IS_I_D_P_INITIATED) + @javax.annotation.Nullable + private Boolean isIDPInitiated; + + public static final String SERIALIZED_NAME_ID_P_LOGIN_URL = "IDPLoginUrl"; + @SerializedName(SERIALIZED_NAME_ID_P_LOGIN_URL) + @javax.annotation.Nullable + private String idPLoginUrl; + + public static final String SERIALIZED_NAME_ID_P_LOGOUT_URL = "IDPLogoutUrl"; + @SerializedName(SERIALIZED_NAME_ID_P_LOGOUT_URL) + @javax.annotation.Nullable + private String idPLogoutUrl; + + public static final String SERIALIZED_NAME_ID_P_CERTIFICATE = "IDPCertificate"; + @SerializedName(SERIALIZED_NAME_ID_P_CERTIFICATE) + @javax.annotation.Nullable + private OrganizationsConnectionSamlBaseIDPCertificate idPCertificate; + + /** + * Type of the connection, which is OIDC in this case. + */ + @JsonAdapter(ConnectionTypeEnum.Adapter.class) + public enum ConnectionTypeEnum { + OIDC_CUSTOM("oidc_custom"); + + private String value; + + ConnectionTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ConnectionTypeEnum fromValue(String value) { + for (ConnectionTypeEnum b : ConnectionTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<ConnectionTypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final ConnectionTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ConnectionTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ConnectionTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ConnectionTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CONNECTION_TYPE = "ConnectionType"; + @SerializedName(SERIALIZED_NAME_CONNECTION_TYPE) + @javax.annotation.Nullable + private ConnectionTypeEnum connectionType; + + public static final String SERIALIZED_NAME_ID_P_LOGIN_BINDING = "IDPLoginBinding"; + @SerializedName(SERIALIZED_NAME_ID_P_LOGIN_BINDING) + @javax.annotation.Nullable + private String idPLoginBinding; + + public static final String SERIALIZED_NAME_ID_P_LOGOUT_BINDING = "IDPLogoutBinding"; + @SerializedName(SERIALIZED_NAME_ID_P_LOGOUT_BINDING) + @javax.annotation.Nullable + private String idPLogoutBinding; + + public static final String SERIALIZED_NAME_ENTITY_ID = "EntityId"; + @SerializedName(SERIALIZED_NAME_ENTITY_ID) + @javax.annotation.Nullable + private String entityId; + + public static final String SERIALIZED_NAME_METADATA_URL = "MetadataUrl"; + @SerializedName(SERIALIZED_NAME_METADATA_URL) + @javax.annotation.Nullable + private String metadataUrl; + + public static final String SERIALIZED_NAME_AC_S_ENDPOINT = "ACSEndpoint"; + @SerializedName(SERIALIZED_NAME_AC_S_ENDPOINT) + @javax.annotation.Nullable + private String acSEndpoint; + + public static final String SERIALIZED_NAME_SP_CERTIFICATE = "SPCertificate"; + @SerializedName(SERIALIZED_NAME_SP_CERTIFICATE) + @javax.annotation.Nullable + private SamlConnectionResponseCoreSPCertificate spCertificate; + + public static final String SERIALIZED_NAME_AUTHORIZATION_URL = "AuthorizationUrl"; + @SerializedName(SERIALIZED_NAME_AUTHORIZATION_URL) + @javax.annotation.Nullable + private String authorizationUrl; + + public static final String SERIALIZED_NAME_CLIENT_ID = "ClientId"; + @SerializedName(SERIALIZED_NAME_CLIENT_ID) + @javax.annotation.Nullable + private String clientId; + + public static final String SERIALIZED_NAME_CLIENT_SECRET = "ClientSecret"; + @SerializedName(SERIALIZED_NAME_CLIENT_SECRET) + @javax.annotation.Nullable + private String clientSecret; + + public static final String SERIALIZED_NAME_ISSUER = "Issuer"; + @SerializedName(SERIALIZED_NAME_ISSUER) + @javax.annotation.Nullable + private String issuer; + + public static final String SERIALIZED_NAME_SCOPES = "Scopes"; + @SerializedName(SERIALIZED_NAME_SCOPES) + @javax.annotation.Nullable + private List<String> scopes = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TOKEN_AUTH_METHOD = "TokenAuthMethod"; + @SerializedName(SERIALIZED_NAME_TOKEN_AUTH_METHOD) + @javax.annotation.Nullable + private String tokenAuthMethod; + + public static final String SERIALIZED_NAME_TOKEN_URL = "TokenUrl"; + @SerializedName(SERIALIZED_NAME_TOKEN_URL) + @javax.annotation.Nullable + private String tokenUrl; + + public static final String SERIALIZED_NAME_USER_INFO_URL = "UserInfoUrl"; + @SerializedName(SERIALIZED_NAME_USER_INFO_URL) + @javax.annotation.Nullable + private String userInfoUrl; + + public static final String SERIALIZED_NAME_USER_INFO_EXTRACT_BY_ID_TOKEN = "UserInfoExtractByIdToken"; + @SerializedName(SERIALIZED_NAME_USER_INFO_EXTRACT_BY_ID_TOKEN) + @javax.annotation.Nullable + private Boolean userInfoExtractByIdToken; + + public static final String SERIALIZED_NAME_JW_K_S_ENDPOINT = "JWKSEndpoint"; + @SerializedName(SERIALIZED_NAME_JW_K_S_ENDPOINT) + @javax.annotation.Nullable + private String jwKSEndpoint; + + public static final String SERIALIZED_NAME_REDIRECT_U_R_I = "RedirectURI"; + @SerializedName(SERIALIZED_NAME_REDIRECT_U_R_I) + @javax.annotation.Nullable + private String redirectURI; + + public ConnectionResponse() { + } + + public ConnectionResponse( + String idPLoginBinding, + String idPLogoutBinding, + String entityId, + String metadataUrl, + String acSEndpoint, + String redirectURI + ) { + this(); + this.idPLoginBinding = idPLoginBinding; + this.idPLogoutBinding = idPLogoutBinding; + this.entityId = entityId; + this.metadataUrl = metadataUrl; + this.acSEndpoint = acSEndpoint; + this.redirectURI = redirectURI; + } + + public ConnectionResponse id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the connection + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ConnectionResponse isActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Indicates whether the connection is active + * @return isActive + */ + @javax.annotation.Nullable + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + } + + + public ConnectionResponse createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Date when the connection was created + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + + public ConnectionResponse groupRoles(@javax.annotation.Nullable List<ConnectionGroupRoleResponse> groupRoles) { + this.groupRoles = groupRoles; + return this; + } + + public ConnectionResponse addGroupRolesItem(ConnectionGroupRoleResponse groupRolesItem) { + if (this.groupRoles == null) { + this.groupRoles = new ArrayList<>(); + } + this.groupRoles.add(groupRolesItem); + return this; + } + + /** + * Get groupRoles + * @return groupRoles + */ + @javax.annotation.Nullable + public List<ConnectionGroupRoleResponse> getGroupRoles() { + return groupRoles; + } + + public void setGroupRoles(@javax.annotation.Nullable List<ConnectionGroupRoleResponse> groupRoles) { + this.groupRoles = groupRoles; + } + + + public ConnectionResponse modifiedDate(@javax.annotation.Nullable OffsetDateTime modifiedDate) { + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Date when the connection was last modified + * @return modifiedDate + */ + @javax.annotation.Nullable + public OffsetDateTime getModifiedDate() { + return modifiedDate; + } + + public void setModifiedDate(@javax.annotation.Nullable OffsetDateTime modifiedDate) { + this.modifiedDate = modifiedDate; + } + + + public ConnectionResponse name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Name of the connection + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ConnectionResponse domain(@javax.annotation.Nullable String domain) { + this.domain = domain; + return this; + } + + /** + * Domain associated with the connection + * @return domain + */ + @javax.annotation.Nullable + public String getDomain() { + return domain; + } + + public void setDomain(@javax.annotation.Nullable String domain) { + this.domain = domain; + } + + + public ConnectionResponse attributes(@javax.annotation.Nullable OrganizationsConnectionBaseAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nullable + public OrganizationsConnectionBaseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nullable OrganizationsConnectionBaseAttributes attributes) { + this.attributes = attributes; + } + + + public ConnectionResponse idPEntityId(@javax.annotation.Nullable String idPEntityId) { + this.idPEntityId = idPEntityId; + return this; + } + + /** + * Unique identifier for the Identity Provider (IdP). + * @return idPEntityId + */ + @javax.annotation.Nullable + public String getIdPEntityId() { + return idPEntityId; + } + + public void setIdPEntityId(@javax.annotation.Nullable String idPEntityId) { + this.idPEntityId = idPEntityId; + } + + + public ConnectionResponse idPMetadataUrl(@javax.annotation.Nullable String idPMetadataUrl) { + this.idPMetadataUrl = idPMetadataUrl; + return this; + } + + /** + * URL to the IdP metadata XML file. + * @return idPMetadataUrl + */ + @javax.annotation.Nullable + public String getIdPMetadataUrl() { + return idPMetadataUrl; + } + + public void setIdPMetadataUrl(@javax.annotation.Nullable String idPMetadataUrl) { + this.idPMetadataUrl = idPMetadataUrl; + } + + + public ConnectionResponse isIDPInitiated(@javax.annotation.Nullable Boolean isIDPInitiated) { + this.isIDPInitiated = isIDPInitiated; + return this; + } + + /** + * Indicates whether the SAML connection is initiated by the IdP. + * @return isIDPInitiated + */ + @javax.annotation.Nullable + public Boolean getIsIDPInitiated() { + return isIDPInitiated; + } + + public void setIsIDPInitiated(@javax.annotation.Nullable Boolean isIDPInitiated) { + this.isIDPInitiated = isIDPInitiated; + } + + + public ConnectionResponse idPLoginUrl(@javax.annotation.Nullable String idPLoginUrl) { + this.idPLoginUrl = idPLoginUrl; + return this; + } + + /** + * The IdP's SAML single sign-on (login) URL. + * @return idPLoginUrl + */ + @javax.annotation.Nullable + public String getIdPLoginUrl() { + return idPLoginUrl; + } + + public void setIdPLoginUrl(@javax.annotation.Nullable String idPLoginUrl) { + this.idPLoginUrl = idPLoginUrl; + } + + + public ConnectionResponse idPLogoutUrl(@javax.annotation.Nullable String idPLogoutUrl) { + this.idPLogoutUrl = idPLogoutUrl; + return this; + } + + /** + * The IdP's SAML single logout (SLO) URL. + * @return idPLogoutUrl + */ + @javax.annotation.Nullable + public String getIdPLogoutUrl() { + return idPLogoutUrl; + } + + public void setIdPLogoutUrl(@javax.annotation.Nullable String idPLogoutUrl) { + this.idPLogoutUrl = idPLogoutUrl; + } + + + public ConnectionResponse idPCertificate(@javax.annotation.Nullable OrganizationsConnectionSamlBaseIDPCertificate idPCertificate) { + this.idPCertificate = idPCertificate; + return this; + } + + /** + * Get idPCertificate + * @return idPCertificate + */ + @javax.annotation.Nullable + public OrganizationsConnectionSamlBaseIDPCertificate getIdPCertificate() { + return idPCertificate; + } + + public void setIdPCertificate(@javax.annotation.Nullable OrganizationsConnectionSamlBaseIDPCertificate idPCertificate) { + this.idPCertificate = idPCertificate; + } + + + public ConnectionResponse connectionType(@javax.annotation.Nullable ConnectionTypeEnum connectionType) { + this.connectionType = connectionType; + return this; + } + + /** + * Type of the connection, which is OIDC in this case. + * @return connectionType + */ + @javax.annotation.Nullable + public ConnectionTypeEnum getConnectionType() { + return connectionType; + } + + public void setConnectionType(@javax.annotation.Nullable ConnectionTypeEnum connectionType) { + this.connectionType = connectionType; + } + + + /** + * SAML binding for the IdP login URL, derived from the IdP metadata. + * @return idPLoginBinding + */ + @javax.annotation.Nullable + public String getIdPLoginBinding() { + return idPLoginBinding; + } + + + + /** + * SAML binding for the IdP logout URL, derived from the IdP metadata. + * @return idPLogoutBinding + */ + @javax.annotation.Nullable + public String getIdPLogoutBinding() { + return idPLogoutBinding; + } + + + + /** + * The unique identifier for the SAML service provider. + * @return entityId + */ + @javax.annotation.Nullable + public String getEntityId() { + return entityId; + } + + + + /** + * The URL to the SAML metadata XML file. + * @return metadataUrl + */ + @javax.annotation.Nullable + public String getMetadataUrl() { + return metadataUrl; + } + + + + /** + * The Assertion Consumer Service (ACS) endpoint URL for SAML responses. + * @return acSEndpoint + */ + @javax.annotation.Nullable + public String getAcSEndpoint() { + return acSEndpoint; + } + + + + public ConnectionResponse spCertificate(@javax.annotation.Nullable SamlConnectionResponseCoreSPCertificate spCertificate) { + this.spCertificate = spCertificate; + return this; + } + + /** + * Get spCertificate + * @return spCertificate + */ + @javax.annotation.Nullable + public SamlConnectionResponseCoreSPCertificate getSpCertificate() { + return spCertificate; + } + + public void setSpCertificate(@javax.annotation.Nullable SamlConnectionResponseCoreSPCertificate spCertificate) { + this.spCertificate = spCertificate; + } + + + public ConnectionResponse authorizationUrl(@javax.annotation.Nullable String authorizationUrl) { + this.authorizationUrl = authorizationUrl; + return this; + } + + /** + * The URL to the OpenID Connect provider's authorization endpoint. This is where users are redirected to authenticate and authorize access. + * @return authorizationUrl + */ + @javax.annotation.Nullable + public String getAuthorizationUrl() { + return authorizationUrl; + } + + public void setAuthorizationUrl(@javax.annotation.Nullable String authorizationUrl) { + this.authorizationUrl = authorizationUrl; + } + + + public ConnectionResponse clientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * The client identifier issued to the application by the OpenID Connect provider. This is used to identify the application during the authentication process. + * @return clientId + */ + @javax.annotation.Nullable + public String getClientId() { + return clientId; + } + + public void setClientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + } + + + public ConnectionResponse clientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * The client secret issued to the application by the OpenID Connect provider. This is used to authenticate the application when requesting tokens. + * @return clientSecret + */ + @javax.annotation.Nullable + public String getClientSecret() { + return clientSecret; + } + + public void setClientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + } + + + public ConnectionResponse issuer(@javax.annotation.Nullable String issuer) { + this.issuer = issuer; + return this; + } + + /** + * The issuer identifier for the OpenID Connect provider. This is typically the base URL of the provider and is used to validate tokens. + * @return issuer + */ + @javax.annotation.Nullable + public String getIssuer() { + return issuer; + } + + public void setIssuer(@javax.annotation.Nullable String issuer) { + this.issuer = issuer; + } + + + public ConnectionResponse scopes(@javax.annotation.Nullable List<String> scopes) { + this.scopes = scopes; + return this; + } + + public ConnectionResponse addScopesItem(String scopesItem) { + if (this.scopes == null) { + this.scopes = new ArrayList<>(); + } + this.scopes.add(scopesItem); + return this; + } + + /** + * The scopes requested by the application during the authentication process. Scopes define the access level and Permissions granted to the application. + * @return scopes + */ + @javax.annotation.Nullable + public List<String> getScopes() { + return scopes; + } + + public void setScopes(@javax.annotation.Nullable List<String> scopes) { + this.scopes = scopes; + } + + + public ConnectionResponse tokenAuthMethod(@javax.annotation.Nullable String tokenAuthMethod) { + this.tokenAuthMethod = tokenAuthMethod; + return this; + } + + /** + * The method used to authenticate the application when requesting tokens. Common methods include `client_secret_post` and `client_secret_basic`. + * @return tokenAuthMethod + */ + @javax.annotation.Nullable + public String getTokenAuthMethod() { + return tokenAuthMethod; + } + + public void setTokenAuthMethod(@javax.annotation.Nullable String tokenAuthMethod) { + this.tokenAuthMethod = tokenAuthMethod; + } + + + public ConnectionResponse tokenUrl(@javax.annotation.Nullable String tokenUrl) { + this.tokenUrl = tokenUrl; + return this; + } + + /** + * The URL to the OpenID Connect provider's token endpoint. This is where the application exchanges the authorization code for tokens. + * @return tokenUrl + */ + @javax.annotation.Nullable + public String getTokenUrl() { + return tokenUrl; + } + + public void setTokenUrl(@javax.annotation.Nullable String tokenUrl) { + this.tokenUrl = tokenUrl; + } + + + public ConnectionResponse userInfoUrl(@javax.annotation.Nullable String userInfoUrl) { + this.userInfoUrl = userInfoUrl; + return this; + } + + /** + * The URL to the OpenID Connect provider's UserInfo endpoint. + * @return userInfoUrl + */ + @javax.annotation.Nullable + public String getUserInfoUrl() { + return userInfoUrl; + } + + public void setUserInfoUrl(@javax.annotation.Nullable String userInfoUrl) { + this.userInfoUrl = userInfoUrl; + } + + + public ConnectionResponse userInfoExtractByIdToken(@javax.annotation.Nullable Boolean userInfoExtractByIdToken) { + this.userInfoExtractByIdToken = userInfoExtractByIdToken; + return this; + } + + /** + * Indicates if user info should be extracted by ID token. + * @return userInfoExtractByIdToken + */ + @javax.annotation.Nullable + public Boolean getUserInfoExtractByIdToken() { + return userInfoExtractByIdToken; + } + + public void setUserInfoExtractByIdToken(@javax.annotation.Nullable Boolean userInfoExtractByIdToken) { + this.userInfoExtractByIdToken = userInfoExtractByIdToken; + } + + + public ConnectionResponse jwKSEndpoint(@javax.annotation.Nullable String jwKSEndpoint) { + this.jwKSEndpoint = jwKSEndpoint; + return this; + } + + /** + * The JWKS endpoint for verifying the ID token. + * @return jwKSEndpoint + */ + @javax.annotation.Nullable + public String getJwKSEndpoint() { + return jwKSEndpoint; + } + + public void setJwKSEndpoint(@javax.annotation.Nullable String jwKSEndpoint) { + this.jwKSEndpoint = jwKSEndpoint; + } + + + /** + * The redirect URI for the OIDC connection, where the authorization server will send the User after authentication. + * @return redirectURI + */ + @javax.annotation.Nullable + public String getRedirectURI() { + return redirectURI; + } + + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConnectionResponse instance itself + */ + public ConnectionResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectionResponse connectionResponse = (ConnectionResponse) o; + return Objects.equals(this.id, connectionResponse.id) && + Objects.equals(this.isActive, connectionResponse.isActive) && + Objects.equals(this.createdDate, connectionResponse.createdDate) && + Objects.equals(this.groupRoles, connectionResponse.groupRoles) && + Objects.equals(this.modifiedDate, connectionResponse.modifiedDate) && + Objects.equals(this.name, connectionResponse.name) && + Objects.equals(this.domain, connectionResponse.domain) && + Objects.equals(this.attributes, connectionResponse.attributes) && + Objects.equals(this.idPEntityId, connectionResponse.idPEntityId) && + Objects.equals(this.idPMetadataUrl, connectionResponse.idPMetadataUrl) && + Objects.equals(this.isIDPInitiated, connectionResponse.isIDPInitiated) && + Objects.equals(this.idPLoginUrl, connectionResponse.idPLoginUrl) && + Objects.equals(this.idPLogoutUrl, connectionResponse.idPLogoutUrl) && + Objects.equals(this.idPCertificate, connectionResponse.idPCertificate) && + Objects.equals(this.connectionType, connectionResponse.connectionType) && + Objects.equals(this.idPLoginBinding, connectionResponse.idPLoginBinding) && + Objects.equals(this.idPLogoutBinding, connectionResponse.idPLogoutBinding) && + Objects.equals(this.entityId, connectionResponse.entityId) && + Objects.equals(this.metadataUrl, connectionResponse.metadataUrl) && + Objects.equals(this.acSEndpoint, connectionResponse.acSEndpoint) && + Objects.equals(this.spCertificate, connectionResponse.spCertificate) && + Objects.equals(this.authorizationUrl, connectionResponse.authorizationUrl) && + Objects.equals(this.clientId, connectionResponse.clientId) && + Objects.equals(this.clientSecret, connectionResponse.clientSecret) && + Objects.equals(this.issuer, connectionResponse.issuer) && + Objects.equals(this.scopes, connectionResponse.scopes) && + Objects.equals(this.tokenAuthMethod, connectionResponse.tokenAuthMethod) && + Objects.equals(this.tokenUrl, connectionResponse.tokenUrl) && + Objects.equals(this.userInfoUrl, connectionResponse.userInfoUrl) && + Objects.equals(this.userInfoExtractByIdToken, connectionResponse.userInfoExtractByIdToken) && + Objects.equals(this.jwKSEndpoint, connectionResponse.jwKSEndpoint) && + Objects.equals(this.redirectURI, connectionResponse.redirectURI)&& + Objects.equals(this.additionalProperties, connectionResponse.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(id, isActive, createdDate, groupRoles, modifiedDate, name, domain, attributes, idPEntityId, idPMetadataUrl, isIDPInitiated, idPLoginUrl, idPLogoutUrl, idPCertificate, connectionType, idPLoginBinding, idPLogoutBinding, entityId, metadataUrl, acSEndpoint, spCertificate, authorizationUrl, clientId, clientSecret, issuer, scopes, tokenAuthMethod, tokenUrl, userInfoUrl, userInfoExtractByIdToken, jwKSEndpoint, redirectURI, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectionResponse {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" groupRoles: ").append(toIndentedString(groupRoles)).append("\n"); + sb.append(" modifiedDate: ").append(toIndentedString(modifiedDate)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" idPEntityId: ").append(toIndentedString(idPEntityId)).append("\n"); + sb.append(" idPMetadataUrl: ").append(toIndentedString(idPMetadataUrl)).append("\n"); + sb.append(" isIDPInitiated: ").append(toIndentedString(isIDPInitiated)).append("\n"); + sb.append(" idPLoginUrl: ").append(toIndentedString(idPLoginUrl)).append("\n"); + sb.append(" idPLogoutUrl: ").append(toIndentedString(idPLogoutUrl)).append("\n"); + sb.append(" idPCertificate: ").append(toIndentedString(idPCertificate)).append("\n"); + sb.append(" connectionType: ").append(toIndentedString(connectionType)).append("\n"); + sb.append(" idPLoginBinding: ").append(toIndentedString(idPLoginBinding)).append("\n"); + sb.append(" idPLogoutBinding: ").append(toIndentedString(idPLogoutBinding)).append("\n"); + sb.append(" entityId: ").append(toIndentedString(entityId)).append("\n"); + sb.append(" metadataUrl: ").append(toIndentedString(metadataUrl)).append("\n"); + sb.append(" acSEndpoint: ").append(toIndentedString(acSEndpoint)).append("\n"); + sb.append(" spCertificate: ").append(toIndentedString(spCertificate)).append("\n"); + sb.append(" authorizationUrl: ").append(toIndentedString(authorizationUrl)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); + sb.append(" issuer: ").append(toIndentedString(issuer)).append("\n"); + sb.append(" scopes: ").append(toIndentedString(scopes)).append("\n"); + sb.append(" tokenAuthMethod: ").append(toIndentedString(tokenAuthMethod)).append("\n"); + sb.append(" tokenUrl: ").append(toIndentedString(tokenUrl)).append("\n"); + sb.append(" userInfoUrl: ").append(toIndentedString(userInfoUrl)).append("\n"); + sb.append(" userInfoExtractByIdToken: ").append(toIndentedString(userInfoExtractByIdToken)).append("\n"); + sb.append(" jwKSEndpoint: ").append(toIndentedString(jwKSEndpoint)).append("\n"); + sb.append(" redirectURI: ").append(toIndentedString(redirectURI)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("IsActive"); + openapiFields.add("CreatedDate"); + openapiFields.add("GroupRoles"); + openapiFields.add("ModifiedDate"); + openapiFields.add("Name"); + openapiFields.add("Domain"); + openapiFields.add("Attributes"); + openapiFields.add("IDPEntityId"); + openapiFields.add("IDPMetadataUrl"); + openapiFields.add("IsIDPInitiated"); + openapiFields.add("IDPLoginUrl"); + openapiFields.add("IDPLogoutUrl"); + openapiFields.add("IDPCertificate"); + openapiFields.add("ConnectionType"); + openapiFields.add("IDPLoginBinding"); + openapiFields.add("IDPLogoutBinding"); + openapiFields.add("EntityId"); + openapiFields.add("MetadataUrl"); + openapiFields.add("ACSEndpoint"); + openapiFields.add("SPCertificate"); + openapiFields.add("AuthorizationUrl"); + openapiFields.add("ClientId"); + openapiFields.add("ClientSecret"); + openapiFields.add("Issuer"); + openapiFields.add("Scopes"); + openapiFields.add("TokenAuthMethod"); + openapiFields.add("TokenUrl"); + openapiFields.add("UserInfoUrl"); + openapiFields.add("UserInfoExtractByIdToken"); + openapiFields.add("JWKSEndpoint"); + openapiFields.add("RedirectURI"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ConnectionResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConnectionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConnectionResponse is not found in the empty JSON string", ConnectionResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("GroupRoles") != null && !jsonObj.get("GroupRoles").isJsonNull()) { + JsonArray jsonArraygroupRoles = jsonObj.getAsJsonArray("GroupRoles"); + if (jsonArraygroupRoles != null) { + // ensure the json data is an array + if (!jsonObj.get("GroupRoles").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `GroupRoles` to be an array in the JSON string but got `%s`", jsonObj.get("GroupRoles").toString())); + } + + // validate the optional field `GroupRoles` (array) + for (int i = 0; i < jsonArraygroupRoles.size(); i++) { + ConnectionGroupRoleResponse.validateJsonElement(jsonArraygroupRoles.get(i)); + }; + } + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Domain") != null && !jsonObj.get("Domain").isJsonNull()) && !jsonObj.get("Domain").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Domain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Domain").toString())); + } + // validate the optional field `Attributes` + if (jsonObj.get("Attributes") != null && !jsonObj.get("Attributes").isJsonNull()) { + OrganizationsConnectionBaseAttributes.validateJsonElement(jsonObj.get("Attributes")); + } + if ((jsonObj.get("IDPEntityId") != null && !jsonObj.get("IDPEntityId").isJsonNull()) && !jsonObj.get("IDPEntityId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IDPEntityId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IDPEntityId").toString())); + } + if ((jsonObj.get("IDPMetadataUrl") != null && !jsonObj.get("IDPMetadataUrl").isJsonNull()) && !jsonObj.get("IDPMetadataUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IDPMetadataUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IDPMetadataUrl").toString())); + } + if ((jsonObj.get("IDPLoginUrl") != null && !jsonObj.get("IDPLoginUrl").isJsonNull()) && !jsonObj.get("IDPLoginUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IDPLoginUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IDPLoginUrl").toString())); + } + if ((jsonObj.get("IDPLogoutUrl") != null && !jsonObj.get("IDPLogoutUrl").isJsonNull()) && !jsonObj.get("IDPLogoutUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IDPLogoutUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IDPLogoutUrl").toString())); + } + // validate the optional field `IDPCertificate` + if (jsonObj.get("IDPCertificate") != null && !jsonObj.get("IDPCertificate").isJsonNull()) { + OrganizationsConnectionSamlBaseIDPCertificate.validateJsonElement(jsonObj.get("IDPCertificate")); + } + if ((jsonObj.get("ConnectionType") != null && !jsonObj.get("ConnectionType").isJsonNull()) && !jsonObj.get("ConnectionType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ConnectionType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ConnectionType").toString())); + } + // validate the optional field `ConnectionType` + if (jsonObj.get("ConnectionType") != null && !jsonObj.get("ConnectionType").isJsonNull()) { + ConnectionTypeEnum.validateJsonElement(jsonObj.get("ConnectionType")); + } + if ((jsonObj.get("IDPLoginBinding") != null && !jsonObj.get("IDPLoginBinding").isJsonNull()) && !jsonObj.get("IDPLoginBinding").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IDPLoginBinding` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IDPLoginBinding").toString())); + } + if ((jsonObj.get("IDPLogoutBinding") != null && !jsonObj.get("IDPLogoutBinding").isJsonNull()) && !jsonObj.get("IDPLogoutBinding").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IDPLogoutBinding` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IDPLogoutBinding").toString())); + } + if ((jsonObj.get("EntityId") != null && !jsonObj.get("EntityId").isJsonNull()) && !jsonObj.get("EntityId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `EntityId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("EntityId").toString())); + } + if ((jsonObj.get("MetadataUrl") != null && !jsonObj.get("MetadataUrl").isJsonNull()) && !jsonObj.get("MetadataUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MetadataUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MetadataUrl").toString())); + } + if ((jsonObj.get("ACSEndpoint") != null && !jsonObj.get("ACSEndpoint").isJsonNull()) && !jsonObj.get("ACSEndpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ACSEndpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ACSEndpoint").toString())); + } + // validate the optional field `SPCertificate` + if (jsonObj.get("SPCertificate") != null && !jsonObj.get("SPCertificate").isJsonNull()) { + SamlConnectionResponseCoreSPCertificate.validateJsonElement(jsonObj.get("SPCertificate")); + } + if ((jsonObj.get("AuthorizationUrl") != null && !jsonObj.get("AuthorizationUrl").isJsonNull()) && !jsonObj.get("AuthorizationUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AuthorizationUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AuthorizationUrl").toString())); + } + if ((jsonObj.get("ClientId") != null && !jsonObj.get("ClientId").isJsonNull()) && !jsonObj.get("ClientId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ClientId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ClientId").toString())); + } + if ((jsonObj.get("ClientSecret") != null && !jsonObj.get("ClientSecret").isJsonNull()) && !jsonObj.get("ClientSecret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ClientSecret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ClientSecret").toString())); + } + if ((jsonObj.get("Issuer") != null && !jsonObj.get("Issuer").isJsonNull()) && !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())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("Scopes") != null && !jsonObj.get("Scopes").isJsonNull() && !jsonObj.get("Scopes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Scopes` to be an array in the JSON string but got `%s`", jsonObj.get("Scopes").toString())); + } + if ((jsonObj.get("TokenAuthMethod") != null && !jsonObj.get("TokenAuthMethod").isJsonNull()) && !jsonObj.get("TokenAuthMethod").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TokenAuthMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TokenAuthMethod").toString())); + } + if ((jsonObj.get("TokenUrl") != null && !jsonObj.get("TokenUrl").isJsonNull()) && !jsonObj.get("TokenUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TokenUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TokenUrl").toString())); + } + if ((jsonObj.get("UserInfoUrl") != null && !jsonObj.get("UserInfoUrl").isJsonNull()) && !jsonObj.get("UserInfoUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UserInfoUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UserInfoUrl").toString())); + } + if ((jsonObj.get("JWKSEndpoint") != null && !jsonObj.get("JWKSEndpoint").isJsonNull()) && !jsonObj.get("JWKSEndpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `JWKSEndpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("JWKSEndpoint").toString())); + } + if ((jsonObj.get("RedirectURI") != null && !jsonObj.get("RedirectURI").isJsonNull()) && !jsonObj.get("RedirectURI").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RedirectURI` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RedirectURI").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ConnectionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConnectionResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ConnectionResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConnectionResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<ConnectionResponse>() { + @Override + public void write(JsonWriter out, ConnectionResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConnectionResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConnectionResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConnectionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConnectionResponse + * @throws IOException if the JSON string is invalid with respect to ConnectionResponse + */ + public static ConnectionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConnectionResponse.class); + } + + /** + * Convert an instance of ConnectionResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ConnectionResponseCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConnectionResponseCore.java new file mode 100644 index 0000000..3ed8ffa --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConnectionResponseCore.java @@ -0,0 +1,433 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ConnectionGroupRoleResponse; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ConnectionResponseCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ConnectionResponseCore { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_IS_ACTIVE = "IsActive"; + @SerializedName(SERIALIZED_NAME_IS_ACTIVE) + @javax.annotation.Nullable + private Boolean isActive; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public static final String SERIALIZED_NAME_GROUP_ROLES = "GroupRoles"; + @SerializedName(SERIALIZED_NAME_GROUP_ROLES) + @javax.annotation.Nullable + private List<ConnectionGroupRoleResponse> groupRoles; + + public static final String SERIALIZED_NAME_MODIFIED_DATE = "ModifiedDate"; + @SerializedName(SERIALIZED_NAME_MODIFIED_DATE) + @javax.annotation.Nullable + private OffsetDateTime modifiedDate; + + public ConnectionResponseCore() { + } + + public ConnectionResponseCore id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the connection + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ConnectionResponseCore isActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Indicates whether the connection is active + * @return isActive + */ + @javax.annotation.Nullable + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + } + + + public ConnectionResponseCore createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Date when the connection was created + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + + public ConnectionResponseCore groupRoles(@javax.annotation.Nullable List<ConnectionGroupRoleResponse> groupRoles) { + this.groupRoles = groupRoles; + return this; + } + + public ConnectionResponseCore addGroupRolesItem(ConnectionGroupRoleResponse groupRolesItem) { + if (this.groupRoles == null) { + this.groupRoles = new ArrayList<>(); + } + this.groupRoles.add(groupRolesItem); + return this; + } + + /** + * Get groupRoles + * @return groupRoles + */ + @javax.annotation.Nullable + public List<ConnectionGroupRoleResponse> getGroupRoles() { + return groupRoles; + } + + public void setGroupRoles(@javax.annotation.Nullable List<ConnectionGroupRoleResponse> groupRoles) { + this.groupRoles = groupRoles; + } + + + public ConnectionResponseCore modifiedDate(@javax.annotation.Nullable OffsetDateTime modifiedDate) { + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Date when the connection was last modified + * @return modifiedDate + */ + @javax.annotation.Nullable + public OffsetDateTime getModifiedDate() { + return modifiedDate; + } + + public void setModifiedDate(@javax.annotation.Nullable OffsetDateTime modifiedDate) { + this.modifiedDate = modifiedDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConnectionResponseCore instance itself + */ + public ConnectionResponseCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectionResponseCore connectionResponseCore = (ConnectionResponseCore) o; + return Objects.equals(this.id, connectionResponseCore.id) && + Objects.equals(this.isActive, connectionResponseCore.isActive) && + Objects.equals(this.createdDate, connectionResponseCore.createdDate) && + Objects.equals(this.groupRoles, connectionResponseCore.groupRoles) && + Objects.equals(this.modifiedDate, connectionResponseCore.modifiedDate)&& + Objects.equals(this.additionalProperties, connectionResponseCore.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(id, isActive, createdDate, groupRoles, modifiedDate, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectionResponseCore {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" groupRoles: ").append(toIndentedString(groupRoles)).append("\n"); + sb.append(" modifiedDate: ").append(toIndentedString(modifiedDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("IsActive"); + openapiFields.add("CreatedDate"); + openapiFields.add("GroupRoles"); + openapiFields.add("ModifiedDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ConnectionResponseCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConnectionResponseCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConnectionResponseCore is not found in the empty JSON string", ConnectionResponseCore.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("GroupRoles") != null && !jsonObj.get("GroupRoles").isJsonNull()) { + JsonArray jsonArraygroupRoles = jsonObj.getAsJsonArray("GroupRoles"); + if (jsonArraygroupRoles != null) { + // ensure the json data is an array + if (!jsonObj.get("GroupRoles").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `GroupRoles` to be an array in the JSON string but got `%s`", jsonObj.get("GroupRoles").toString())); + } + + // validate the optional field `GroupRoles` (array) + for (int i = 0; i < jsonArraygroupRoles.size(); i++) { + ConnectionGroupRoleResponse.validateJsonElement(jsonArraygroupRoles.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ConnectionResponseCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConnectionResponseCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ConnectionResponseCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConnectionResponseCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<ConnectionResponseCore>() { + @Override + public void write(JsonWriter out, ConnectionResponseCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConnectionResponseCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConnectionResponseCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConnectionResponseCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConnectionResponseCore + * @throws IOException if the JSON string is invalid with respect to ConnectionResponseCore + */ + public static ConnectionResponseCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConnectionResponseCore.class); + } + + /** + * Convert an instance of ConnectionResponseCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ConnectionResponseVariant.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConnectionResponseVariant.java new file mode 100644 index 0000000..262cd51 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConnectionResponseVariant.java @@ -0,0 +1,280 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.OidcConnectionResponse; +import com.loginradius.sdk.internal.openapi.model.OrganizationsConnectionSamlBaseIDPCertificate; +import com.loginradius.sdk.internal.openapi.model.SamlConnectionResponse; +import com.loginradius.sdk.internal.openapi.model.SamlConnectionResponseCoreSPCertificate; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ConnectionResponseVariant extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(ConnectionResponseVariant.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ConnectionResponseVariant.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConnectionResponseVariant' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SamlConnectionResponse> adapterSamlConnectionResponse = gson.getDelegateAdapter(this, TypeToken.get(SamlConnectionResponse.class)); + final TypeAdapter<OidcConnectionResponse> adapterOidcConnectionResponse = gson.getDelegateAdapter(this, TypeToken.get(OidcConnectionResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<ConnectionResponseVariant>() { + @Override + public void write(JsonWriter out, ConnectionResponseVariant value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `SamlConnectionResponse` + if (value.getActualInstance() instanceof SamlConnectionResponse) { + JsonElement element = adapterSamlConnectionResponse.toJsonTree((SamlConnectionResponse)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `OidcConnectionResponse` + if (value.getActualInstance() instanceof OidcConnectionResponse) { + JsonElement element = adapterOidcConnectionResponse.toJsonTree((OidcConnectionResponse)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: OidcConnectionResponse, SamlConnectionResponse"); + } + + @Override + public ConnectionResponseVariant read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize SamlConnectionResponse + try { + // validate the JSON object to see if any exception is thrown + SamlConnectionResponse.validateJsonElement(jsonElement); + actualAdapter = adapterSamlConnectionResponse; + match++; + log.log(Level.FINER, "Input data matches schema 'SamlConnectionResponse'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for SamlConnectionResponse failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'SamlConnectionResponse'", e); + } + // deserialize OidcConnectionResponse + try { + // validate the JSON object to see if any exception is thrown + OidcConnectionResponse.validateJsonElement(jsonElement); + actualAdapter = adapterOidcConnectionResponse; + match++; + log.log(Level.FINER, "Input data matches schema 'OidcConnectionResponse'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for OidcConnectionResponse failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'OidcConnectionResponse'", e); + } + + if (match == 1) { + ConnectionResponseVariant ret = new ConnectionResponseVariant(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for ConnectionResponseVariant: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public ConnectionResponseVariant() { + super("oneOf", Boolean.FALSE); + } + + public ConnectionResponseVariant(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("SamlConnectionResponse", SamlConnectionResponse.class); + schemas.put("OidcConnectionResponse", OidcConnectionResponse.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return ConnectionResponseVariant.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * OidcConnectionResponse, SamlConnectionResponse + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof SamlConnectionResponse) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof OidcConnectionResponse) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be OidcConnectionResponse, SamlConnectionResponse"); + } + + /** + * Get the actual instance, which can be the following: + * OidcConnectionResponse, SamlConnectionResponse + * + * @return The actual instance (OidcConnectionResponse, SamlConnectionResponse) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `SamlConnectionResponse`. If the actual instance is not `SamlConnectionResponse`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `SamlConnectionResponse` + * @throws ClassCastException if the instance is not `SamlConnectionResponse` + */ + public SamlConnectionResponse getSamlConnectionResponse() throws ClassCastException { + return (SamlConnectionResponse)super.getActualInstance(); + } + + /** + * Get the actual instance of `OidcConnectionResponse`. If the actual instance is not `OidcConnectionResponse`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `OidcConnectionResponse` + * @throws ClassCastException if the instance is not `OidcConnectionResponse` + */ + public OidcConnectionResponse getOidcConnectionResponse() throws ClassCastException { + return (OidcConnectionResponse)super.getActualInstance(); + } + + /** + * 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 ConnectionResponseVariant + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with SamlConnectionResponse + try { + SamlConnectionResponse.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for SamlConnectionResponse failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with OidcConnectionResponse + try { + OidcConnectionResponse.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for OidcConnectionResponse failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for ConnectionResponseVariant with oneOf schemas: OidcConnectionResponse, SamlConnectionResponse. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of ConnectionResponseVariant given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConnectionResponseVariant + * @throws IOException if the JSON string is invalid with respect to ConnectionResponseVariant + */ + public static ConnectionResponseVariant fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConnectionResponseVariant.class); + } + + /** + * Convert an instance of ConnectionResponseVariant to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ConnectionStatusRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConnectionStatusRequest.java new file mode 100644 index 0000000..cc9e772 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConnectionStatusRequest.java @@ -0,0 +1,284 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ConnectionStatusRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ConnectionStatusRequest { + public static final String SERIALIZED_NAME_ACTIVE = "Active"; + @SerializedName(SERIALIZED_NAME_ACTIVE) + @javax.annotation.Nullable + private Boolean active; + + public ConnectionStatusRequest() { + } + + public ConnectionStatusRequest active(@javax.annotation.Nullable Boolean active) { + this.active = active; + return this; + } + + /** + * Indicates whether the connection is active. + * @return active + */ + @javax.annotation.Nullable + public Boolean getActive() { + return active; + } + + public void setActive(@javax.annotation.Nullable Boolean active) { + this.active = active; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConnectionStatusRequest instance itself + */ + public ConnectionStatusRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectionStatusRequest connectionStatusRequest = (ConnectionStatusRequest) o; + return Objects.equals(this.active, connectionStatusRequest.active)&& + Objects.equals(this.additionalProperties, connectionStatusRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(active, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectionStatusRequest {\n"); + sb.append(" active: ").append(toIndentedString(active)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Active"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ConnectionStatusRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConnectionStatusRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConnectionStatusRequest is not found in the empty JSON string", ConnectionStatusRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ConnectionStatusRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConnectionStatusRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ConnectionStatusRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConnectionStatusRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<ConnectionStatusRequest>() { + @Override + public void write(JsonWriter out, ConnectionStatusRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConnectionStatusRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConnectionStatusRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConnectionStatusRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConnectionStatusRequest + * @throws IOException if the JSON string is invalid with respect to ConnectionStatusRequest + */ + public static ConnectionStatusRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConnectionStatusRequest.class); + } + + /** + * Convert an instance of ConnectionStatusRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ConnectionStatusResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConnectionStatusResponse.java new file mode 100644 index 0000000..5615cae --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConnectionStatusResponse.java @@ -0,0 +1,284 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ConnectionStatusResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ConnectionStatusResponse { + public static final String SERIALIZED_NAME_IS_ACTIVE = "IsActive"; + @SerializedName(SERIALIZED_NAME_IS_ACTIVE) + @javax.annotation.Nullable + private Boolean isActive; + + public ConnectionStatusResponse() { + } + + public ConnectionStatusResponse isActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Indicates whether the connection is active. + * @return isActive + */ + @javax.annotation.Nullable + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConnectionStatusResponse instance itself + */ + public ConnectionStatusResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConnectionStatusResponse connectionStatusResponse = (ConnectionStatusResponse) o; + return Objects.equals(this.isActive, connectionStatusResponse.isActive)&& + Objects.equals(this.additionalProperties, connectionStatusResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isActive, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConnectionStatusResponse {\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsActive"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ConnectionStatusResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConnectionStatusResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConnectionStatusResponse is not found in the empty JSON string", ConnectionStatusResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ConnectionStatusResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConnectionStatusResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ConnectionStatusResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConnectionStatusResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<ConnectionStatusResponse>() { + @Override + public void write(JsonWriter out, ConnectionStatusResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConnectionStatusResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConnectionStatusResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConnectionStatusResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConnectionStatusResponse + * @throws IOException if the JSON string is invalid with respect to ConnectionStatusResponse + */ + public static ConnectionStatusResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConnectionStatusResponse.class); + } + + /** + * Convert an instance of ConnectionStatusResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentData.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentData.java new file mode 100644 index 0000000..f9052fa --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentData.java @@ -0,0 +1,323 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ConsentData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ConsentData { + public static final String SERIALIZED_NAME_CONSENTOPTIONID = "consentoptionid"; + @SerializedName(SERIALIZED_NAME_CONSENTOPTIONID) + @javax.annotation.Nonnull + private String consentoptionid; + + public static final String SERIALIZED_NAME_ISACCEPTED = "isaccepted"; + @SerializedName(SERIALIZED_NAME_ISACCEPTED) + @javax.annotation.Nonnull + private Boolean isaccepted; + + public ConsentData() { + } + + public ConsentData consentoptionid(@javax.annotation.Nonnull String consentoptionid) { + this.consentoptionid = consentoptionid; + return this; + } + + /** + * Get consentoptionid + * @return consentoptionid + */ + @javax.annotation.Nonnull + public String getConsentoptionid() { + return consentoptionid; + } + + public void setConsentoptionid(@javax.annotation.Nonnull String consentoptionid) { + this.consentoptionid = consentoptionid; + } + + + public ConsentData isaccepted(@javax.annotation.Nonnull Boolean isaccepted) { + this.isaccepted = isaccepted; + return this; + } + + /** + * Get isaccepted + * @return isaccepted + */ + @javax.annotation.Nonnull + public Boolean getIsaccepted() { + return isaccepted; + } + + public void setIsaccepted(@javax.annotation.Nonnull Boolean isaccepted) { + this.isaccepted = isaccepted; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConsentData instance itself + */ + public ConsentData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConsentData consentData = (ConsentData) o; + return Objects.equals(this.consentoptionid, consentData.consentoptionid) && + Objects.equals(this.isaccepted, consentData.isaccepted)&& + Objects.equals(this.additionalProperties, consentData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(consentoptionid, isaccepted, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConsentData {\n"); + sb.append(" consentoptionid: ").append(toIndentedString(consentoptionid)).append("\n"); + sb.append(" isaccepted: ").append(toIndentedString(isaccepted)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("consentoptionid"); + openapiFields.add("isaccepted"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("consentoptionid"); + openapiRequiredFields.add("isaccepted"); + } + + /** + * 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 ConsentData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConsentData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsentData is not found in the empty JSON string", ConsentData.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConsentData.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("consentoptionid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `consentoptionid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("consentoptionid").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ConsentData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsentData' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ConsentData> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsentData.class)); + + return (TypeAdapter<T>) new TypeAdapter<ConsentData>() { + @Override + public void write(JsonWriter out, ConsentData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConsentData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConsentData instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsentData given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsentData + * @throws IOException if the JSON string is invalid with respect to ConsentData + */ + public static ConsentData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsentData.class); + } + + /** + * Convert an instance of ConsentData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentEvent.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentEvent.java new file mode 100644 index 0000000..ea8f26c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentEvent.java @@ -0,0 +1,323 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ConsentEvent + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ConsentEvent { + public static final String SERIALIZED_NAME_EVENT = "event"; + @SerializedName(SERIALIZED_NAME_EVENT) + @javax.annotation.Nonnull + private String event; + + public static final String SERIALIZED_NAME_ISCUSTOM = "iscustom"; + @SerializedName(SERIALIZED_NAME_ISCUSTOM) + @javax.annotation.Nonnull + private Boolean iscustom; + + public ConsentEvent() { + } + + public ConsentEvent event(@javax.annotation.Nonnull String event) { + this.event = event; + return this; + } + + /** + * Get event + * @return event + */ + @javax.annotation.Nonnull + public String getEvent() { + return event; + } + + public void setEvent(@javax.annotation.Nonnull String event) { + this.event = event; + } + + + public ConsentEvent iscustom(@javax.annotation.Nonnull Boolean iscustom) { + this.iscustom = iscustom; + return this; + } + + /** + * Get iscustom + * @return iscustom + */ + @javax.annotation.Nonnull + public Boolean getIscustom() { + return iscustom; + } + + public void setIscustom(@javax.annotation.Nonnull Boolean iscustom) { + this.iscustom = iscustom; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConsentEvent instance itself + */ + public ConsentEvent putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConsentEvent consentEvent = (ConsentEvent) o; + return Objects.equals(this.event, consentEvent.event) && + Objects.equals(this.iscustom, consentEvent.iscustom)&& + Objects.equals(this.additionalProperties, consentEvent.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(event, iscustom, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConsentEvent {\n"); + sb.append(" event: ").append(toIndentedString(event)).append("\n"); + sb.append(" iscustom: ").append(toIndentedString(iscustom)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("event"); + openapiFields.add("iscustom"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("event"); + openapiRequiredFields.add("iscustom"); + } + + /** + * 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 ConsentEvent + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConsentEvent.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsentEvent is not found in the empty JSON string", ConsentEvent.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConsentEvent.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("event").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `event` to be a primitive type in the JSON string but got `%s`", jsonObj.get("event").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ConsentEvent.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsentEvent' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ConsentEvent> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsentEvent.class)); + + return (TypeAdapter<T>) new TypeAdapter<ConsentEvent>() { + @Override + public void write(JsonWriter out, ConsentEvent value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConsentEvent read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConsentEvent instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsentEvent given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsentEvent + * @throws IOException if the JSON string is invalid with respect to ConsentEvent + */ + public static ConsentEvent fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsentEvent.class); + } + + /** + * Convert an instance of ConsentEvent to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentForm.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentForm.java new file mode 100644 index 0000000..46df7e3 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentForm.java @@ -0,0 +1,567 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ConsentFormEvent; +import com.loginradius.sdk.internal.openapi.model.ConsentFormOption; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ConsentForm + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ConsentForm { + public static final String SERIALIZED_NAME_IS_ACTIVE = "IsActive"; + @SerializedName(SERIALIZED_NAME_IS_ACTIVE) + @javax.annotation.Nullable + private Boolean isActive; + + public static final String SERIALIZED_NAME_VERSION = "Version"; + @SerializedName(SERIALIZED_NAME_VERSION) + @javax.annotation.Nullable + private Integer version; + + public static final String SERIALIZED_NAME_EVENTS = "Events"; + @SerializedName(SERIALIZED_NAME_EVENTS) + @javax.annotation.Nullable + private List<ConsentFormEvent> events = new ArrayList<>(); + + public static final String SERIALIZED_NAME_START_FROM_DATE = "StartFromDate"; + @SerializedName(SERIALIZED_NAME_START_FROM_DATE) + @javax.annotation.Nullable + private OffsetDateTime startFromDate; + + public static final String SERIALIZED_NAME_CREATED_ON_DATE = "CreatedOnDate"; + @SerializedName(SERIALIZED_NAME_CREATED_ON_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdOnDate; + + public static final String SERIALIZED_NAME_CONSENT_OPTIONS = "ConsentOptions"; + @SerializedName(SERIALIZED_NAME_CONSENT_OPTIONS) + @javax.annotation.Nullable + private List<ConsentFormOption> consentOptions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TERM_OF_SERVICE = "TermOfService"; + @SerializedName(SERIALIZED_NAME_TERM_OF_SERVICE) + @javax.annotation.Nullable + private String termOfService; + + public static final String SERIALIZED_NAME_PRIVACY_POLICY = "PrivacyPolicy"; + @SerializedName(SERIALIZED_NAME_PRIVACY_POLICY) + @javax.annotation.Nullable + private String privacyPolicy; + + public static final String SERIALIZED_NAME_IS_WORKFLOW_FORM = "IsWorkflowForm"; + @SerializedName(SERIALIZED_NAME_IS_WORKFLOW_FORM) + @javax.annotation.Nullable + private Boolean isWorkflowForm; + + public ConsentForm() { + } + + public ConsentForm isActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Indicates if the consent form is active. + * @return isActive + */ + @javax.annotation.Nullable + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + } + + + public ConsentForm version(@javax.annotation.Nullable Integer version) { + this.version = version; + return this; + } + + /** + * Version number of the consent form. + * @return version + */ + @javax.annotation.Nullable + public Integer getVersion() { + return version; + } + + public void setVersion(@javax.annotation.Nullable Integer version) { + this.version = version; + } + + + public ConsentForm events(@javax.annotation.Nullable List<ConsentFormEvent> events) { + this.events = events; + return this; + } + + public ConsentForm addEventsItem(ConsentFormEvent eventsItem) { + if (this.events == null) { + this.events = new ArrayList<>(); + } + this.events.add(eventsItem); + return this; + } + + /** + * List of events associated with the consent form. + * @return events + */ + @javax.annotation.Nullable + public List<ConsentFormEvent> getEvents() { + return events; + } + + public void setEvents(@javax.annotation.Nullable List<ConsentFormEvent> events) { + this.events = events; + } + + + public ConsentForm startFromDate(@javax.annotation.Nullable OffsetDateTime startFromDate) { + this.startFromDate = startFromDate; + return this; + } + + /** + * Start date of the consent form. + * @return startFromDate + */ + @javax.annotation.Nullable + public OffsetDateTime getStartFromDate() { + return startFromDate; + } + + public void setStartFromDate(@javax.annotation.Nullable OffsetDateTime startFromDate) { + this.startFromDate = startFromDate; + } + + + public ConsentForm createdOnDate(@javax.annotation.Nullable OffsetDateTime createdOnDate) { + this.createdOnDate = createdOnDate; + return this; + } + + /** + * Creation date of the consent form. + * @return createdOnDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedOnDate() { + return createdOnDate; + } + + public void setCreatedOnDate(@javax.annotation.Nullable OffsetDateTime createdOnDate) { + this.createdOnDate = createdOnDate; + } + + + public ConsentForm consentOptions(@javax.annotation.Nullable List<ConsentFormOption> consentOptions) { + this.consentOptions = consentOptions; + return this; + } + + public ConsentForm addConsentOptionsItem(ConsentFormOption consentOptionsItem) { + if (this.consentOptions == null) { + this.consentOptions = new ArrayList<>(); + } + this.consentOptions.add(consentOptionsItem); + return this; + } + + /** + * List of consent options in the form. + * @return consentOptions + */ + @javax.annotation.Nullable + public List<ConsentFormOption> getConsentOptions() { + return consentOptions; + } + + public void setConsentOptions(@javax.annotation.Nullable List<ConsentFormOption> consentOptions) { + this.consentOptions = consentOptions; + } + + + public ConsentForm termOfService(@javax.annotation.Nullable String termOfService) { + this.termOfService = termOfService; + return this; + } + + /** + * Terms of service text. + * @return termOfService + */ + @javax.annotation.Nullable + public String getTermOfService() { + return termOfService; + } + + public void setTermOfService(@javax.annotation.Nullable String termOfService) { + this.termOfService = termOfService; + } + + + public ConsentForm privacyPolicy(@javax.annotation.Nullable String privacyPolicy) { + this.privacyPolicy = privacyPolicy; + return this; + } + + /** + * Privacy Policy text. + * @return privacyPolicy + */ + @javax.annotation.Nullable + public String getPrivacyPolicy() { + return privacyPolicy; + } + + public void setPrivacyPolicy(@javax.annotation.Nullable String privacyPolicy) { + this.privacyPolicy = privacyPolicy; + } + + + public ConsentForm isWorkflowForm(@javax.annotation.Nullable Boolean isWorkflowForm) { + this.isWorkflowForm = isWorkflowForm; + return this; + } + + /** + * Indicates if this is a workflow form. + * @return isWorkflowForm + */ + @javax.annotation.Nullable + public Boolean getIsWorkflowForm() { + return isWorkflowForm; + } + + public void setIsWorkflowForm(@javax.annotation.Nullable Boolean isWorkflowForm) { + this.isWorkflowForm = isWorkflowForm; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConsentForm instance itself + */ + public ConsentForm putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConsentForm consentForm = (ConsentForm) o; + return Objects.equals(this.isActive, consentForm.isActive) && + Objects.equals(this.version, consentForm.version) && + Objects.equals(this.events, consentForm.events) && + Objects.equals(this.startFromDate, consentForm.startFromDate) && + Objects.equals(this.createdOnDate, consentForm.createdOnDate) && + Objects.equals(this.consentOptions, consentForm.consentOptions) && + Objects.equals(this.termOfService, consentForm.termOfService) && + Objects.equals(this.privacyPolicy, consentForm.privacyPolicy) && + Objects.equals(this.isWorkflowForm, consentForm.isWorkflowForm)&& + Objects.equals(this.additionalProperties, consentForm.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(isActive, version, events, startFromDate, createdOnDate, consentOptions, termOfService, privacyPolicy, isWorkflowForm, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConsentForm {\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" events: ").append(toIndentedString(events)).append("\n"); + sb.append(" startFromDate: ").append(toIndentedString(startFromDate)).append("\n"); + sb.append(" createdOnDate: ").append(toIndentedString(createdOnDate)).append("\n"); + sb.append(" consentOptions: ").append(toIndentedString(consentOptions)).append("\n"); + sb.append(" termOfService: ").append(toIndentedString(termOfService)).append("\n"); + sb.append(" privacyPolicy: ").append(toIndentedString(privacyPolicy)).append("\n"); + sb.append(" isWorkflowForm: ").append(toIndentedString(isWorkflowForm)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsActive"); + openapiFields.add("Version"); + openapiFields.add("Events"); + openapiFields.add("StartFromDate"); + openapiFields.add("CreatedOnDate"); + openapiFields.add("ConsentOptions"); + openapiFields.add("TermOfService"); + openapiFields.add("PrivacyPolicy"); + openapiFields.add("IsWorkflowForm"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ConsentForm + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConsentForm.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsentForm is not found in the empty JSON string", ConsentForm.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Events") != null && !jsonObj.get("Events").isJsonNull()) { + JsonArray jsonArrayevents = jsonObj.getAsJsonArray("Events"); + if (jsonArrayevents != null) { + // ensure the json data is an array + if (!jsonObj.get("Events").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Events` to be an array in the JSON string but got `%s`", jsonObj.get("Events").toString())); + } + + // validate the optional field `Events` (array) + for (int i = 0; i < jsonArrayevents.size(); i++) { + ConsentFormEvent.validateJsonElement(jsonArrayevents.get(i)); + }; + } + } + if (jsonObj.get("ConsentOptions") != null && !jsonObj.get("ConsentOptions").isJsonNull()) { + JsonArray jsonArrayconsentOptions = jsonObj.getAsJsonArray("ConsentOptions"); + if (jsonArrayconsentOptions != null) { + // ensure the json data is an array + if (!jsonObj.get("ConsentOptions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ConsentOptions` to be an array in the JSON string but got `%s`", jsonObj.get("ConsentOptions").toString())); + } + + // validate the optional field `ConsentOptions` (array) + for (int i = 0; i < jsonArrayconsentOptions.size(); i++) { + ConsentFormOption.validateJsonElement(jsonArrayconsentOptions.get(i)); + }; + } + } + if ((jsonObj.get("TermOfService") != null && !jsonObj.get("TermOfService").isJsonNull()) && !jsonObj.get("TermOfService").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TermOfService` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TermOfService").toString())); + } + if ((jsonObj.get("PrivacyPolicy") != null && !jsonObj.get("PrivacyPolicy").isJsonNull()) && !jsonObj.get("PrivacyPolicy").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PrivacyPolicy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PrivacyPolicy").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ConsentForm.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsentForm' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ConsentForm> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsentForm.class)); + + return (TypeAdapter<T>) new TypeAdapter<ConsentForm>() { + @Override + public void write(JsonWriter out, ConsentForm value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConsentForm read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConsentForm instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsentForm given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsentForm + * @throws IOException if the JSON string is invalid with respect to ConsentForm + */ + public static ConsentForm fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsentForm.class); + } + + /** + * Convert an instance of ConsentForm to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentFormEvent.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentFormEvent.java new file mode 100644 index 0000000..9209734 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentFormEvent.java @@ -0,0 +1,314 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ConsentFormEvent + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ConsentFormEvent { + public static final String SERIALIZED_NAME_IS_CUSTOM = "IsCustom"; + @SerializedName(SERIALIZED_NAME_IS_CUSTOM) + @javax.annotation.Nullable + private Boolean isCustom; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ConsentFormEvent() { + } + + public ConsentFormEvent isCustom(@javax.annotation.Nullable Boolean isCustom) { + this.isCustom = isCustom; + return this; + } + + /** + * Indicates if the event is custom. + * @return isCustom + */ + @javax.annotation.Nullable + public Boolean getIsCustom() { + return isCustom; + } + + public void setIsCustom(@javax.annotation.Nullable Boolean isCustom) { + this.isCustom = isCustom; + } + + + public ConsentFormEvent name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Name of the event. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConsentFormEvent instance itself + */ + public ConsentFormEvent putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConsentFormEvent consentFormEvent = (ConsentFormEvent) o; + return Objects.equals(this.isCustom, consentFormEvent.isCustom) && + Objects.equals(this.name, consentFormEvent.name)&& + Objects.equals(this.additionalProperties, consentFormEvent.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isCustom, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConsentFormEvent {\n"); + sb.append(" isCustom: ").append(toIndentedString(isCustom)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsCustom"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ConsentFormEvent + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConsentFormEvent.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsentFormEvent is not found in the empty JSON string", ConsentFormEvent.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ConsentFormEvent.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsentFormEvent' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ConsentFormEvent> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsentFormEvent.class)); + + return (TypeAdapter<T>) new TypeAdapter<ConsentFormEvent>() { + @Override + public void write(JsonWriter out, ConsentFormEvent value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConsentFormEvent read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConsentFormEvent instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsentFormEvent given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsentFormEvent + * @throws IOException if the JSON string is invalid with respect to ConsentFormEvent + */ + public static ConsentFormEvent fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsentFormEvent.class); + } + + /** + * Convert an instance of ConsentFormEvent to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentFormModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentFormModel.java new file mode 100644 index 0000000..a263eab --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentFormModel.java @@ -0,0 +1,475 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ConsentFormOptions; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ConsentFormModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ConsentFormModel { + public static final String SERIALIZED_NAME_EVENTS = "Events"; + @SerializedName(SERIALIZED_NAME_EVENTS) + @javax.annotation.Nullable + private List<String> events = new ArrayList<>(); + + public static final String SERIALIZED_NAME_START_FROM_DATE = "StartFromDate"; + @SerializedName(SERIALIZED_NAME_START_FROM_DATE) + @javax.annotation.Nullable + private OffsetDateTime startFromDate; + + public static final String SERIALIZED_NAME_CONSENT_OPTIONS = "ConsentOptions"; + @SerializedName(SERIALIZED_NAME_CONSENT_OPTIONS) + @javax.annotation.Nullable + private List<ConsentFormOptions> consentOptions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TERM_OF_SERVICE = "TermOfService"; + @SerializedName(SERIALIZED_NAME_TERM_OF_SERVICE) + @javax.annotation.Nullable + private String termOfService; + + public static final String SERIALIZED_NAME_PRIVACY_POLICY = "PrivacyPolicy"; + @SerializedName(SERIALIZED_NAME_PRIVACY_POLICY) + @javax.annotation.Nullable + private String privacyPolicy; + + public static final String SERIALIZED_NAME_IS_WORKFLOW_FORM = "IsWorkflowForm"; + @SerializedName(SERIALIZED_NAME_IS_WORKFLOW_FORM) + @javax.annotation.Nullable + private Boolean isWorkflowForm; + + public ConsentFormModel() { + } + + public ConsentFormModel events(@javax.annotation.Nullable List<String> events) { + this.events = events; + return this; + } + + public ConsentFormModel addEventsItem(String eventsItem) { + if (this.events == null) { + this.events = new ArrayList<>(); + } + this.events.add(eventsItem); + return this; + } + + /** + * List of events associated with the consent form. + * @return events + */ + @javax.annotation.Nullable + public List<String> getEvents() { + return events; + } + + public void setEvents(@javax.annotation.Nullable List<String> events) { + this.events = events; + } + + + public ConsentFormModel startFromDate(@javax.annotation.Nullable OffsetDateTime startFromDate) { + this.startFromDate = startFromDate; + return this; + } + + /** + * Start date of the consent form. + * @return startFromDate + */ + @javax.annotation.Nullable + public OffsetDateTime getStartFromDate() { + return startFromDate; + } + + public void setStartFromDate(@javax.annotation.Nullable OffsetDateTime startFromDate) { + this.startFromDate = startFromDate; + } + + + public ConsentFormModel consentOptions(@javax.annotation.Nullable List<ConsentFormOptions> consentOptions) { + this.consentOptions = consentOptions; + return this; + } + + public ConsentFormModel addConsentOptionsItem(ConsentFormOptions consentOptionsItem) { + if (this.consentOptions == null) { + this.consentOptions = new ArrayList<>(); + } + this.consentOptions.add(consentOptionsItem); + return this; + } + + /** + * List of consent options in the form. + * @return consentOptions + */ + @javax.annotation.Nullable + public List<ConsentFormOptions> getConsentOptions() { + return consentOptions; + } + + public void setConsentOptions(@javax.annotation.Nullable List<ConsentFormOptions> consentOptions) { + this.consentOptions = consentOptions; + } + + + public ConsentFormModel termOfService(@javax.annotation.Nullable String termOfService) { + this.termOfService = termOfService; + return this; + } + + /** + * Terms of service text. + * @return termOfService + */ + @javax.annotation.Nullable + public String getTermOfService() { + return termOfService; + } + + public void setTermOfService(@javax.annotation.Nullable String termOfService) { + this.termOfService = termOfService; + } + + + public ConsentFormModel privacyPolicy(@javax.annotation.Nullable String privacyPolicy) { + this.privacyPolicy = privacyPolicy; + return this; + } + + /** + * Privacy Policy text. + * @return privacyPolicy + */ + @javax.annotation.Nullable + public String getPrivacyPolicy() { + return privacyPolicy; + } + + public void setPrivacyPolicy(@javax.annotation.Nullable String privacyPolicy) { + this.privacyPolicy = privacyPolicy; + } + + + public ConsentFormModel isWorkflowForm(@javax.annotation.Nullable Boolean isWorkflowForm) { + this.isWorkflowForm = isWorkflowForm; + return this; + } + + /** + * Indicates if this is a workflow form. + * @return isWorkflowForm + */ + @javax.annotation.Nullable + public Boolean getIsWorkflowForm() { + return isWorkflowForm; + } + + public void setIsWorkflowForm(@javax.annotation.Nullable Boolean isWorkflowForm) { + this.isWorkflowForm = isWorkflowForm; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConsentFormModel instance itself + */ + public ConsentFormModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConsentFormModel consentFormModel = (ConsentFormModel) o; + return Objects.equals(this.events, consentFormModel.events) && + Objects.equals(this.startFromDate, consentFormModel.startFromDate) && + Objects.equals(this.consentOptions, consentFormModel.consentOptions) && + Objects.equals(this.termOfService, consentFormModel.termOfService) && + Objects.equals(this.privacyPolicy, consentFormModel.privacyPolicy) && + Objects.equals(this.isWorkflowForm, consentFormModel.isWorkflowForm)&& + Objects.equals(this.additionalProperties, consentFormModel.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(events, startFromDate, consentOptions, termOfService, privacyPolicy, isWorkflowForm, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConsentFormModel {\n"); + sb.append(" events: ").append(toIndentedString(events)).append("\n"); + sb.append(" startFromDate: ").append(toIndentedString(startFromDate)).append("\n"); + sb.append(" consentOptions: ").append(toIndentedString(consentOptions)).append("\n"); + sb.append(" termOfService: ").append(toIndentedString(termOfService)).append("\n"); + sb.append(" privacyPolicy: ").append(toIndentedString(privacyPolicy)).append("\n"); + sb.append(" isWorkflowForm: ").append(toIndentedString(isWorkflowForm)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Events"); + openapiFields.add("StartFromDate"); + openapiFields.add("ConsentOptions"); + openapiFields.add("TermOfService"); + openapiFields.add("PrivacyPolicy"); + openapiFields.add("IsWorkflowForm"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ConsentFormModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConsentFormModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsentFormModel is not found in the empty JSON string", ConsentFormModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("Events") != null && !jsonObj.get("Events").isJsonNull() && !jsonObj.get("Events").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Events` to be an array in the JSON string but got `%s`", jsonObj.get("Events").toString())); + } + if (jsonObj.get("ConsentOptions") != null && !jsonObj.get("ConsentOptions").isJsonNull()) { + JsonArray jsonArrayconsentOptions = jsonObj.getAsJsonArray("ConsentOptions"); + if (jsonArrayconsentOptions != null) { + // ensure the json data is an array + if (!jsonObj.get("ConsentOptions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ConsentOptions` to be an array in the JSON string but got `%s`", jsonObj.get("ConsentOptions").toString())); + } + + // validate the optional field `ConsentOptions` (array) + for (int i = 0; i < jsonArrayconsentOptions.size(); i++) { + ConsentFormOptions.validateJsonElement(jsonArrayconsentOptions.get(i)); + }; + } + } + if ((jsonObj.get("TermOfService") != null && !jsonObj.get("TermOfService").isJsonNull()) && !jsonObj.get("TermOfService").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TermOfService` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TermOfService").toString())); + } + if ((jsonObj.get("PrivacyPolicy") != null && !jsonObj.get("PrivacyPolicy").isJsonNull()) && !jsonObj.get("PrivacyPolicy").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PrivacyPolicy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PrivacyPolicy").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ConsentFormModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsentFormModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ConsentFormModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsentFormModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<ConsentFormModel>() { + @Override + public void write(JsonWriter out, ConsentFormModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConsentFormModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConsentFormModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsentFormModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsentFormModel + * @throws IOException if the JSON string is invalid with respect to ConsentFormModel + */ + public static ConsentFormModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsentFormModel.class); + } + + /** + * Convert an instance of ConsentFormModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentFormOption.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentFormOption.java new file mode 100644 index 0000000..b615490 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentFormOption.java @@ -0,0 +1,341 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ConsentFormOption + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ConsentFormOption { + public static final String SERIALIZED_NAME_IS_REQUIRED = "IsRequired"; + @SerializedName(SERIALIZED_NAME_IS_REQUIRED) + @javax.annotation.Nullable + private Boolean isRequired; + + public static final String SERIALIZED_NAME_CONSENT_OPTION_ID = "ConsentOptionId"; + @SerializedName(SERIALIZED_NAME_CONSENT_OPTION_ID) + @javax.annotation.Nullable + private String consentOptionId; + + public static final String SERIALIZED_NAME_IS_ACTIVE = "IsActive"; + @SerializedName(SERIALIZED_NAME_IS_ACTIVE) + @javax.annotation.Nullable + private Boolean isActive; + + public ConsentFormOption() { + } + + public ConsentFormOption isRequired(@javax.annotation.Nullable Boolean isRequired) { + this.isRequired = isRequired; + return this; + } + + /** + * Indicates if this consent option is required. + * @return isRequired + */ + @javax.annotation.Nullable + public Boolean getIsRequired() { + return isRequired; + } + + public void setIsRequired(@javax.annotation.Nullable Boolean isRequired) { + this.isRequired = isRequired; + } + + + public ConsentFormOption consentOptionId(@javax.annotation.Nullable String consentOptionId) { + this.consentOptionId = consentOptionId; + return this; + } + + /** + * Unique identifier for the consent option. + * @return consentOptionId + */ + @javax.annotation.Nullable + public String getConsentOptionId() { + return consentOptionId; + } + + public void setConsentOptionId(@javax.annotation.Nullable String consentOptionId) { + this.consentOptionId = consentOptionId; + } + + + public ConsentFormOption isActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Indicates if the consent option is active. + * @return isActive + */ + @javax.annotation.Nullable + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConsentFormOption instance itself + */ + public ConsentFormOption putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConsentFormOption consentFormOption = (ConsentFormOption) o; + return Objects.equals(this.isRequired, consentFormOption.isRequired) && + Objects.equals(this.consentOptionId, consentFormOption.consentOptionId) && + Objects.equals(this.isActive, consentFormOption.isActive)&& + Objects.equals(this.additionalProperties, consentFormOption.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isRequired, consentOptionId, isActive, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConsentFormOption {\n"); + sb.append(" isRequired: ").append(toIndentedString(isRequired)).append("\n"); + sb.append(" consentOptionId: ").append(toIndentedString(consentOptionId)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsRequired"); + openapiFields.add("ConsentOptionId"); + openapiFields.add("IsActive"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ConsentFormOption + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConsentFormOption.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsentFormOption is not found in the empty JSON string", ConsentFormOption.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ConsentOptionId") != null && !jsonObj.get("ConsentOptionId").isJsonNull()) && !jsonObj.get("ConsentOptionId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ConsentOptionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ConsentOptionId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ConsentFormOption.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsentFormOption' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ConsentFormOption> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsentFormOption.class)); + + return (TypeAdapter<T>) new TypeAdapter<ConsentFormOption>() { + @Override + public void write(JsonWriter out, ConsentFormOption value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConsentFormOption read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConsentFormOption instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsentFormOption given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsentFormOption + * @throws IOException if the JSON string is invalid with respect to ConsentFormOption + */ + public static ConsentFormOption fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsentFormOption.class); + } + + /** + * Convert an instance of ConsentFormOption to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentFormOptions.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentFormOptions.java new file mode 100644 index 0000000..9a291ae --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentFormOptions.java @@ -0,0 +1,314 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ConsentFormOptions + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ConsentFormOptions { + public static final String SERIALIZED_NAME_IS_REQUIRED = "IsRequired"; + @SerializedName(SERIALIZED_NAME_IS_REQUIRED) + @javax.annotation.Nullable + private Boolean isRequired; + + public static final String SERIALIZED_NAME_CONSENT_OPTION_ID = "ConsentOptionId"; + @SerializedName(SERIALIZED_NAME_CONSENT_OPTION_ID) + @javax.annotation.Nullable + private String consentOptionId; + + public ConsentFormOptions() { + } + + public ConsentFormOptions isRequired(@javax.annotation.Nullable Boolean isRequired) { + this.isRequired = isRequired; + return this; + } + + /** + * Indicates if this consent option is required. + * @return isRequired + */ + @javax.annotation.Nullable + public Boolean getIsRequired() { + return isRequired; + } + + public void setIsRequired(@javax.annotation.Nullable Boolean isRequired) { + this.isRequired = isRequired; + } + + + public ConsentFormOptions consentOptionId(@javax.annotation.Nullable String consentOptionId) { + this.consentOptionId = consentOptionId; + return this; + } + + /** + * Unique identifier for the consent option. + * @return consentOptionId + */ + @javax.annotation.Nullable + public String getConsentOptionId() { + return consentOptionId; + } + + public void setConsentOptionId(@javax.annotation.Nullable String consentOptionId) { + this.consentOptionId = consentOptionId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConsentFormOptions instance itself + */ + public ConsentFormOptions putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConsentFormOptions consentFormOptions = (ConsentFormOptions) o; + return Objects.equals(this.isRequired, consentFormOptions.isRequired) && + Objects.equals(this.consentOptionId, consentFormOptions.consentOptionId)&& + Objects.equals(this.additionalProperties, consentFormOptions.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isRequired, consentOptionId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConsentFormOptions {\n"); + sb.append(" isRequired: ").append(toIndentedString(isRequired)).append("\n"); + sb.append(" consentOptionId: ").append(toIndentedString(consentOptionId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsRequired"); + openapiFields.add("ConsentOptionId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ConsentFormOptions + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConsentFormOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsentFormOptions is not found in the empty JSON string", ConsentFormOptions.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ConsentOptionId") != null && !jsonObj.get("ConsentOptionId").isJsonNull()) && !jsonObj.get("ConsentOptionId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ConsentOptionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ConsentOptionId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ConsentFormOptions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsentFormOptions' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ConsentFormOptions> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsentFormOptions.class)); + + return (TypeAdapter<T>) new TypeAdapter<ConsentFormOptions>() { + @Override + public void write(JsonWriter out, ConsentFormOptions value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConsentFormOptions read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConsentFormOptions instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsentFormOptions given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsentFormOptions + * @throws IOException if the JSON string is invalid with respect to ConsentFormOptions + */ + public static ConsentFormOptions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsentFormOptions.class); + } + + /** + * Convert an instance of ConsentFormOptions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentLog.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentLog.java new file mode 100644 index 0000000..3726a00 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentLog.java @@ -0,0 +1,549 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ConsentProfileLog; +import com.loginradius.sdk.internal.openapi.model.ConsentVersion; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ConsentLog + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ConsentLog { + public static final String SERIALIZED_NAME_UPDATE_TYPE = "UpdateType"; + @SerializedName(SERIALIZED_NAME_UPDATE_TYPE) + @javax.annotation.Nullable + private String updateType; + + public static final String SERIALIZED_NAME_USER_AGENT = "UserAgent"; + @SerializedName(SERIALIZED_NAME_USER_AGENT) + @javax.annotation.Nullable + private String userAgent; + + public static final String SERIALIZED_NAME_I_P = "IP"; + @SerializedName(SERIALIZED_NAME_I_P) + @javax.annotation.Nullable + private String IP; + + public static final String SERIALIZED_NAME_HOST = "Host"; + @SerializedName(SERIALIZED_NAME_HOST) + @javax.annotation.Nullable + private String host; + + public static final String SERIALIZED_NAME_LOGGED_ON_DATE = "LoggedOnDate"; + @SerializedName(SERIALIZED_NAME_LOGGED_ON_DATE) + @javax.annotation.Nullable + private OffsetDateTime loggedOnDate; + + public static final String SERIALIZED_NAME_CURRENT_CONSENT_FORMS_VERSIONS = "CurrentConsentFormsVersions"; + @SerializedName(SERIALIZED_NAME_CURRENT_CONSENT_FORMS_VERSIONS) + @javax.annotation.Nullable + private List<ConsentVersion> currentConsentFormsVersions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CONSENT_LOGS = "ConsentLogs"; + @SerializedName(SERIALIZED_NAME_CONSENT_LOGS) + @javax.annotation.Nullable + private List<ConsentProfileLog> consentLogs; + + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public ConsentLog() { + } + + public ConsentLog updateType(@javax.annotation.Nullable String updateType) { + this.updateType = updateType; + return this; + } + + /** + * Type of update performed + * @return updateType + */ + @javax.annotation.Nullable + public String getUpdateType() { + return updateType; + } + + public void setUpdateType(@javax.annotation.Nullable String updateType) { + this.updateType = updateType; + } + + + public ConsentLog userAgent(@javax.annotation.Nullable String userAgent) { + this.userAgent = userAgent; + return this; + } + + /** + * User agent string + * @return userAgent + */ + @javax.annotation.Nullable + public String getUserAgent() { + return userAgent; + } + + public void setUserAgent(@javax.annotation.Nullable String userAgent) { + this.userAgent = userAgent; + } + + + public ConsentLog IP(@javax.annotation.Nullable String IP) { + this.IP = IP; + return this; + } + + /** + * IP address of the User + * @return IP + */ + @javax.annotation.Nullable + public String getIP() { + return IP; + } + + public void setIP(@javax.annotation.Nullable String IP) { + this.IP = IP; + } + + + public ConsentLog host(@javax.annotation.Nullable String host) { + this.host = host; + return this; + } + + /** + * Host information + * @return host + */ + @javax.annotation.Nullable + public String getHost() { + return host; + } + + public void setHost(@javax.annotation.Nullable String host) { + this.host = host; + } + + + public ConsentLog loggedOnDate(@javax.annotation.Nullable OffsetDateTime loggedOnDate) { + this.loggedOnDate = loggedOnDate; + return this; + } + + /** + * Date and time when the log was created + * @return loggedOnDate + */ + @javax.annotation.Nullable + public OffsetDateTime getLoggedOnDate() { + return loggedOnDate; + } + + public void setLoggedOnDate(@javax.annotation.Nullable OffsetDateTime loggedOnDate) { + this.loggedOnDate = loggedOnDate; + } + + + public ConsentLog currentConsentFormsVersions(@javax.annotation.Nullable List<ConsentVersion> currentConsentFormsVersions) { + this.currentConsentFormsVersions = currentConsentFormsVersions; + return this; + } + + public ConsentLog addCurrentConsentFormsVersionsItem(ConsentVersion currentConsentFormsVersionsItem) { + if (this.currentConsentFormsVersions == null) { + this.currentConsentFormsVersions = new ArrayList<>(); + } + this.currentConsentFormsVersions.add(currentConsentFormsVersionsItem); + return this; + } + + /** + * List of current consent form versions + * @return currentConsentFormsVersions + */ + @javax.annotation.Nullable + public List<ConsentVersion> getCurrentConsentFormsVersions() { + return currentConsentFormsVersions; + } + + public void setCurrentConsentFormsVersions(@javax.annotation.Nullable List<ConsentVersion> currentConsentFormsVersions) { + this.currentConsentFormsVersions = currentConsentFormsVersions; + } + + + public ConsentLog consentLogs(@javax.annotation.Nullable List<ConsentProfileLog> consentLogs) { + this.consentLogs = consentLogs; + return this; + } + + public ConsentLog addConsentLogsItem(ConsentProfileLog consentLogsItem) { + if (this.consentLogs == null) { + this.consentLogs = new ArrayList<>(); + } + this.consentLogs.add(consentLogsItem); + return this; + } + + /** + * List of consent profile logs + * @return consentLogs + */ + @javax.annotation.Nullable + public List<ConsentProfileLog> getConsentLogs() { + return consentLogs; + } + + public void setConsentLogs(@javax.annotation.Nullable List<ConsentProfileLog> consentLogs) { + this.consentLogs = consentLogs; + } + + + public ConsentLog id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * ObjectId (MongoDB) of the log entry + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConsentLog instance itself + */ + public ConsentLog putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConsentLog consentLog = (ConsentLog) o; + return Objects.equals(this.updateType, consentLog.updateType) && + Objects.equals(this.userAgent, consentLog.userAgent) && + Objects.equals(this.IP, consentLog.IP) && + Objects.equals(this.host, consentLog.host) && + Objects.equals(this.loggedOnDate, consentLog.loggedOnDate) && + Objects.equals(this.currentConsentFormsVersions, consentLog.currentConsentFormsVersions) && + Objects.equals(this.consentLogs, consentLog.consentLogs) && + Objects.equals(this.id, consentLog.id)&& + Objects.equals(this.additionalProperties, consentLog.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(updateType, userAgent, IP, host, loggedOnDate, currentConsentFormsVersions, consentLogs, id, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConsentLog {\n"); + sb.append(" updateType: ").append(toIndentedString(updateType)).append("\n"); + sb.append(" userAgent: ").append(toIndentedString(userAgent)).append("\n"); + sb.append(" IP: ").append(toIndentedString(IP)).append("\n"); + sb.append(" host: ").append(toIndentedString(host)).append("\n"); + sb.append(" loggedOnDate: ").append(toIndentedString(loggedOnDate)).append("\n"); + sb.append(" currentConsentFormsVersions: ").append(toIndentedString(currentConsentFormsVersions)).append("\n"); + sb.append(" consentLogs: ").append(toIndentedString(consentLogs)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("UpdateType"); + openapiFields.add("UserAgent"); + openapiFields.add("IP"); + openapiFields.add("Host"); + openapiFields.add("LoggedOnDate"); + openapiFields.add("CurrentConsentFormsVersions"); + openapiFields.add("ConsentLogs"); + openapiFields.add("Id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ConsentLog + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConsentLog.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsentLog is not found in the empty JSON string", ConsentLog.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("UpdateType") != null && !jsonObj.get("UpdateType").isJsonNull()) && !jsonObj.get("UpdateType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UpdateType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UpdateType").toString())); + } + if ((jsonObj.get("UserAgent") != null && !jsonObj.get("UserAgent").isJsonNull()) && !jsonObj.get("UserAgent").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UserAgent` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UserAgent").toString())); + } + if ((jsonObj.get("IP") != null && !jsonObj.get("IP").isJsonNull()) && !jsonObj.get("IP").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IP` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IP").toString())); + } + if ((jsonObj.get("Host") != null && !jsonObj.get("Host").isJsonNull()) && !jsonObj.get("Host").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Host` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Host").toString())); + } + if (jsonObj.get("CurrentConsentFormsVersions") != null && !jsonObj.get("CurrentConsentFormsVersions").isJsonNull()) { + JsonArray jsonArraycurrentConsentFormsVersions = jsonObj.getAsJsonArray("CurrentConsentFormsVersions"); + if (jsonArraycurrentConsentFormsVersions != null) { + // ensure the json data is an array + if (!jsonObj.get("CurrentConsentFormsVersions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `CurrentConsentFormsVersions` to be an array in the JSON string but got `%s`", jsonObj.get("CurrentConsentFormsVersions").toString())); + } + + // validate the optional field `CurrentConsentFormsVersions` (array) + for (int i = 0; i < jsonArraycurrentConsentFormsVersions.size(); i++) { + ConsentVersion.validateJsonElement(jsonArraycurrentConsentFormsVersions.get(i)); + }; + } + } + if (jsonObj.get("ConsentLogs") != null && !jsonObj.get("ConsentLogs").isJsonNull()) { + JsonArray jsonArrayconsentLogs = jsonObj.getAsJsonArray("ConsentLogs"); + if (jsonArrayconsentLogs != null) { + // ensure the json data is an array + if (!jsonObj.get("ConsentLogs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ConsentLogs` to be an array in the JSON string but got `%s`", jsonObj.get("ConsentLogs").toString())); + } + + // validate the optional field `ConsentLogs` (array) + for (int i = 0; i < jsonArrayconsentLogs.size(); i++) { + ConsentProfileLog.validateJsonElement(jsonArrayconsentLogs.get(i)); + }; + } + } + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ConsentLog.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsentLog' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ConsentLog> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsentLog.class)); + + return (TypeAdapter<T>) new TypeAdapter<ConsentLog>() { + @Override + public void write(JsonWriter out, ConsentLog value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConsentLog read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConsentLog instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsentLog given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsentLog + * @throws IOException if the JSON string is invalid with respect to ConsentLog + */ + public static ConsentLog fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsentLog.class); + } + + /** + * Convert an instance of ConsentLog to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentLogsResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentLogsResponse.java new file mode 100644 index 0000000..d1dcacf --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentLogsResponse.java @@ -0,0 +1,351 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ConsentLog; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ConsentLogsResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ConsentLogsResponse { + public static final String SERIALIZED_NAME_UID = "Uid"; + @SerializedName(SERIALIZED_NAME_UID) + @javax.annotation.Nullable + private String uid; + + public static final String SERIALIZED_NAME_CONSENT_LOGS = "ConsentLogs"; + @SerializedName(SERIALIZED_NAME_CONSENT_LOGS) + @javax.annotation.Nullable + private List<ConsentLog> consentLogs; + + public ConsentLogsResponse() { + } + + public ConsentLogsResponse uid(@javax.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * User identifier + * @return uid + */ + @javax.annotation.Nullable + public String getUid() { + return uid; + } + + public void setUid(@javax.annotation.Nullable String uid) { + this.uid = uid; + } + + + public ConsentLogsResponse consentLogs(@javax.annotation.Nullable List<ConsentLog> consentLogs) { + this.consentLogs = consentLogs; + return this; + } + + public ConsentLogsResponse addConsentLogsItem(ConsentLog consentLogsItem) { + if (this.consentLogs == null) { + this.consentLogs = new ArrayList<>(); + } + this.consentLogs.add(consentLogsItem); + return this; + } + + /** + * List of consent logs + * @return consentLogs + */ + @javax.annotation.Nullable + public List<ConsentLog> getConsentLogs() { + return consentLogs; + } + + public void setConsentLogs(@javax.annotation.Nullable List<ConsentLog> consentLogs) { + this.consentLogs = consentLogs; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConsentLogsResponse instance itself + */ + public ConsentLogsResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConsentLogsResponse consentLogsResponse = (ConsentLogsResponse) o; + return Objects.equals(this.uid, consentLogsResponse.uid) && + Objects.equals(this.consentLogs, consentLogsResponse.consentLogs)&& + Objects.equals(this.additionalProperties, consentLogsResponse.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(uid, consentLogs, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConsentLogsResponse {\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" consentLogs: ").append(toIndentedString(consentLogs)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Uid"); + openapiFields.add("ConsentLogs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ConsentLogsResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConsentLogsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsentLogsResponse is not found in the empty JSON string", ConsentLogsResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Uid") != null && !jsonObj.get("Uid").isJsonNull()) && !jsonObj.get("Uid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Uid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Uid").toString())); + } + if (jsonObj.get("ConsentLogs") != null && !jsonObj.get("ConsentLogs").isJsonNull()) { + JsonArray jsonArrayconsentLogs = jsonObj.getAsJsonArray("ConsentLogs"); + if (jsonArrayconsentLogs != null) { + // ensure the json data is an array + if (!jsonObj.get("ConsentLogs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ConsentLogs` to be an array in the JSON string but got `%s`", jsonObj.get("ConsentLogs").toString())); + } + + // validate the optional field `ConsentLogs` (array) + for (int i = 0; i < jsonArrayconsentLogs.size(); i++) { + ConsentLog.validateJsonElement(jsonArrayconsentLogs.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ConsentLogsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsentLogsResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ConsentLogsResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsentLogsResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<ConsentLogsResponse>() { + @Override + public void write(JsonWriter out, ConsentLogsResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConsentLogsResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConsentLogsResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsentLogsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsentLogsResponse + * @throws IOException if the JSON string is invalid with respect to ConsentLogsResponse + */ + public static ConsentLogsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsentLogsResponse.class); + } + + /** + * Convert an instance of ConsentLogsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentOption.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentOption.java new file mode 100644 index 0000000..b9d2491 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentOption.java @@ -0,0 +1,315 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ConsentOption + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ConsentOption { + public static final String SERIALIZED_NAME_CONSENT_OPTION_ID = "ConsentOptionId"; + @SerializedName(SERIALIZED_NAME_CONSENT_OPTION_ID) + @javax.annotation.Nullable + private String consentOptionId; + + public static final String SERIALIZED_NAME_ACCEPT_ON_DATE = "AcceptOnDate"; + @SerializedName(SERIALIZED_NAME_ACCEPT_ON_DATE) + @javax.annotation.Nullable + private OffsetDateTime acceptOnDate; + + public ConsentOption() { + } + + public ConsentOption consentOptionId(@javax.annotation.Nullable String consentOptionId) { + this.consentOptionId = consentOptionId; + return this; + } + + /** + * Get consentOptionId + * @return consentOptionId + */ + @javax.annotation.Nullable + public String getConsentOptionId() { + return consentOptionId; + } + + public void setConsentOptionId(@javax.annotation.Nullable String consentOptionId) { + this.consentOptionId = consentOptionId; + } + + + public ConsentOption acceptOnDate(@javax.annotation.Nullable OffsetDateTime acceptOnDate) { + this.acceptOnDate = acceptOnDate; + return this; + } + + /** + * Get acceptOnDate + * @return acceptOnDate + */ + @javax.annotation.Nullable + public OffsetDateTime getAcceptOnDate() { + return acceptOnDate; + } + + public void setAcceptOnDate(@javax.annotation.Nullable OffsetDateTime acceptOnDate) { + this.acceptOnDate = acceptOnDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConsentOption instance itself + */ + public ConsentOption putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConsentOption consentOption = (ConsentOption) o; + return Objects.equals(this.consentOptionId, consentOption.consentOptionId) && + Objects.equals(this.acceptOnDate, consentOption.acceptOnDate)&& + Objects.equals(this.additionalProperties, consentOption.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(consentOptionId, acceptOnDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConsentOption {\n"); + sb.append(" consentOptionId: ").append(toIndentedString(consentOptionId)).append("\n"); + sb.append(" acceptOnDate: ").append(toIndentedString(acceptOnDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ConsentOptionId"); + openapiFields.add("AcceptOnDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ConsentOption + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConsentOption.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsentOption is not found in the empty JSON string", ConsentOption.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ConsentOptionId") != null && !jsonObj.get("ConsentOptionId").isJsonNull()) && !jsonObj.get("ConsentOptionId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ConsentOptionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ConsentOptionId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ConsentOption.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsentOption' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ConsentOption> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsentOption.class)); + + return (TypeAdapter<T>) new TypeAdapter<ConsentOption>() { + @Override + public void write(JsonWriter out, ConsentOption value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConsentOption read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConsentOption instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsentOption given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsentOption + * @throws IOException if the JSON string is invalid with respect to ConsentOption + */ + public static ConsentOption fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsentOption.class); + } + + /** + * Convert an instance of ConsentOption to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentOptionModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentOptionModel.java new file mode 100644 index 0000000..3cf3c87 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentOptionModel.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ConsentOptionModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ConsentOptionModel { + public static final String SERIALIZED_NAME_TITLE = "Title"; + @SerializedName(SERIALIZED_NAME_TITLE) + @javax.annotation.Nullable + private String title; + + public static final String SERIALIZED_NAME_DESCRIPTION = "Description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public ConsentOptionModel() { + } + + public ConsentOptionModel title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * Title of the consent option. + * @return title + */ + @javax.annotation.Nullable + public String getTitle() { + return title; + } + + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + public ConsentOptionModel description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Description of the consent option. + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConsentOptionModel instance itself + */ + public ConsentOptionModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConsentOptionModel consentOptionModel = (ConsentOptionModel) o; + return Objects.equals(this.title, consentOptionModel.title) && + Objects.equals(this.description, consentOptionModel.description)&& + Objects.equals(this.additionalProperties, consentOptionModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(title, description, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConsentOptionModel {\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Title"); + openapiFields.add("Description"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ConsentOptionModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConsentOptionModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsentOptionModel is not found in the empty JSON string", ConsentOptionModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Title") != null && !jsonObj.get("Title").isJsonNull()) && !jsonObj.get("Title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Title").toString())); + } + if ((jsonObj.get("Description") != null && !jsonObj.get("Description").isJsonNull()) && !jsonObj.get("Description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Description").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ConsentOptionModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsentOptionModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ConsentOptionModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsentOptionModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<ConsentOptionModel>() { + @Override + public void write(JsonWriter out, ConsentOptionModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConsentOptionModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConsentOptionModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsentOptionModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsentOptionModel + * @throws IOException if the JSON string is invalid with respect to ConsentOptionModel + */ + public static ConsentOptionModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsentOptionModel.class); + } + + /** + * Convert an instance of ConsentOptionModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentOptions.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentOptions.java new file mode 100644 index 0000000..da76841 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentOptions.java @@ -0,0 +1,414 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ConsentOptions + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ConsentOptions { + public static final String SERIALIZED_NAME_CONSENT_ID = "ConsentId"; + @SerializedName(SERIALIZED_NAME_CONSENT_ID) + @javax.annotation.Nullable + private String consentId; + + public static final String SERIALIZED_NAME_TITLE = "Title"; + @SerializedName(SERIALIZED_NAME_TITLE) + @javax.annotation.Nullable + private String title; + + public static final String SERIALIZED_NAME_DESCRIPTION = "Description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_CREATED_ON = "CreatedOn"; + @SerializedName(SERIALIZED_NAME_CREATED_ON) + @javax.annotation.Nullable + private OffsetDateTime createdOn; + + public static final String SERIALIZED_NAME_IS_ACTIVE = "IsActive"; + @SerializedName(SERIALIZED_NAME_IS_ACTIVE) + @javax.annotation.Nullable + private Boolean isActive; + + public ConsentOptions() { + } + + public ConsentOptions consentId(@javax.annotation.Nullable String consentId) { + this.consentId = consentId; + return this; + } + + /** + * Unique identifier for the consent option. + * @return consentId + */ + @javax.annotation.Nullable + public String getConsentId() { + return consentId; + } + + public void setConsentId(@javax.annotation.Nullable String consentId) { + this.consentId = consentId; + } + + + public ConsentOptions title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * Title of the consent option. + * @return title + */ + @javax.annotation.Nullable + public String getTitle() { + return title; + } + + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + public ConsentOptions description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Description of the consent option. + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public ConsentOptions createdOn(@javax.annotation.Nullable OffsetDateTime createdOn) { + this.createdOn = createdOn; + return this; + } + + /** + * Creation date of the consent option. + * @return createdOn + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedOn() { + return createdOn; + } + + public void setCreatedOn(@javax.annotation.Nullable OffsetDateTime createdOn) { + this.createdOn = createdOn; + } + + + public ConsentOptions isActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Indicates if the consent option is currently active. + * @return isActive + */ + @javax.annotation.Nullable + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConsentOptions instance itself + */ + public ConsentOptions putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConsentOptions consentOptions = (ConsentOptions) o; + return Objects.equals(this.consentId, consentOptions.consentId) && + Objects.equals(this.title, consentOptions.title) && + Objects.equals(this.description, consentOptions.description) && + Objects.equals(this.createdOn, consentOptions.createdOn) && + Objects.equals(this.isActive, consentOptions.isActive)&& + Objects.equals(this.additionalProperties, consentOptions.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(consentId, title, description, createdOn, isActive, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConsentOptions {\n"); + sb.append(" consentId: ").append(toIndentedString(consentId)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" createdOn: ").append(toIndentedString(createdOn)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ConsentId"); + openapiFields.add("Title"); + openapiFields.add("Description"); + openapiFields.add("CreatedOn"); + openapiFields.add("IsActive"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ConsentOptions + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConsentOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsentOptions is not found in the empty JSON string", ConsentOptions.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ConsentId") != null && !jsonObj.get("ConsentId").isJsonNull()) && !jsonObj.get("ConsentId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ConsentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ConsentId").toString())); + } + if ((jsonObj.get("Title") != null && !jsonObj.get("Title").isJsonNull()) && !jsonObj.get("Title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Title").toString())); + } + if ((jsonObj.get("Description") != null && !jsonObj.get("Description").isJsonNull()) && !jsonObj.get("Description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Description").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ConsentOptions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsentOptions' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ConsentOptions> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsentOptions.class)); + + return (TypeAdapter<T>) new TypeAdapter<ConsentOptions>() { + @Override + public void write(JsonWriter out, ConsentOptions value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConsentOptions read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConsentOptions instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsentOptions given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsentOptions + * @throws IOException if the JSON string is invalid with respect to ConsentOptions + */ + public static ConsentOptions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsentOptions.class); + } + + /** + * Convert an instance of ConsentOptions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentProfile.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentProfile.java new file mode 100644 index 0000000..bd87033 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentProfile.java @@ -0,0 +1,359 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ConsentOption; +import com.loginradius.sdk.internal.openapi.model.ConsentVersion; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ConsentProfile + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ConsentProfile { + public static final String SERIALIZED_NAME_ACCEPTED_CONSENT_VERSIONS = "AcceptedConsentVersions"; + @SerializedName(SERIALIZED_NAME_ACCEPTED_CONSENT_VERSIONS) + @javax.annotation.Nullable + private List<ConsentVersion> acceptedConsentVersions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CONSENTS = "Consents"; + @SerializedName(SERIALIZED_NAME_CONSENTS) + @javax.annotation.Nullable + private List<ConsentOption> consents = new ArrayList<>(); + + public ConsentProfile() { + } + + public ConsentProfile acceptedConsentVersions(@javax.annotation.Nullable List<ConsentVersion> acceptedConsentVersions) { + this.acceptedConsentVersions = acceptedConsentVersions; + return this; + } + + public ConsentProfile addAcceptedConsentVersionsItem(ConsentVersion acceptedConsentVersionsItem) { + if (this.acceptedConsentVersions == null) { + this.acceptedConsentVersions = new ArrayList<>(); + } + this.acceptedConsentVersions.add(acceptedConsentVersionsItem); + return this; + } + + /** + * Get acceptedConsentVersions + * @return acceptedConsentVersions + */ + @javax.annotation.Nullable + public List<ConsentVersion> getAcceptedConsentVersions() { + return acceptedConsentVersions; + } + + public void setAcceptedConsentVersions(@javax.annotation.Nullable List<ConsentVersion> acceptedConsentVersions) { + this.acceptedConsentVersions = acceptedConsentVersions; + } + + + public ConsentProfile consents(@javax.annotation.Nullable List<ConsentOption> consents) { + this.consents = consents; + return this; + } + + public ConsentProfile addConsentsItem(ConsentOption consentsItem) { + if (this.consents == null) { + this.consents = new ArrayList<>(); + } + this.consents.add(consentsItem); + return this; + } + + /** + * Get consents + * @return consents + */ + @javax.annotation.Nullable + public List<ConsentOption> getConsents() { + return consents; + } + + public void setConsents(@javax.annotation.Nullable List<ConsentOption> consents) { + this.consents = consents; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConsentProfile instance itself + */ + public ConsentProfile putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConsentProfile consentProfile = (ConsentProfile) o; + return Objects.equals(this.acceptedConsentVersions, consentProfile.acceptedConsentVersions) && + Objects.equals(this.consents, consentProfile.consents)&& + Objects.equals(this.additionalProperties, consentProfile.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(acceptedConsentVersions, consents, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConsentProfile {\n"); + sb.append(" acceptedConsentVersions: ").append(toIndentedString(acceptedConsentVersions)).append("\n"); + sb.append(" consents: ").append(toIndentedString(consents)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AcceptedConsentVersions"); + openapiFields.add("Consents"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ConsentProfile + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConsentProfile.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsentProfile is not found in the empty JSON string", ConsentProfile.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("AcceptedConsentVersions") != null && !jsonObj.get("AcceptedConsentVersions").isJsonNull()) { + JsonArray jsonArrayacceptedConsentVersions = jsonObj.getAsJsonArray("AcceptedConsentVersions"); + if (jsonArrayacceptedConsentVersions != null) { + // ensure the json data is an array + if (!jsonObj.get("AcceptedConsentVersions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `AcceptedConsentVersions` to be an array in the JSON string but got `%s`", jsonObj.get("AcceptedConsentVersions").toString())); + } + + // validate the optional field `AcceptedConsentVersions` (array) + for (int i = 0; i < jsonArrayacceptedConsentVersions.size(); i++) { + ConsentVersion.validateJsonElement(jsonArrayacceptedConsentVersions.get(i)); + }; + } + } + if (jsonObj.get("Consents") != null && !jsonObj.get("Consents").isJsonNull()) { + JsonArray jsonArrayconsents = jsonObj.getAsJsonArray("Consents"); + if (jsonArrayconsents != null) { + // ensure the json data is an array + if (!jsonObj.get("Consents").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Consents` to be an array in the JSON string but got `%s`", jsonObj.get("Consents").toString())); + } + + // validate the optional field `Consents` (array) + for (int i = 0; i < jsonArrayconsents.size(); i++) { + ConsentOption.validateJsonElement(jsonArrayconsents.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ConsentProfile.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsentProfile' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ConsentProfile> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsentProfile.class)); + + return (TypeAdapter<T>) new TypeAdapter<ConsentProfile>() { + @Override + public void write(JsonWriter out, ConsentProfile value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConsentProfile read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConsentProfile instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsentProfile given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsentProfile + * @throws IOException if the JSON string is invalid with respect to ConsentProfile + */ + public static ConsentProfile fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsentProfile.class); + } + + /** + * Convert an instance of ConsentProfile to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentProfileLog.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentProfileLog.java new file mode 100644 index 0000000..e6291d0 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentProfileLog.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ConsentProfileLog + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ConsentProfileLog { + public static final String SERIALIZED_NAME_CONSENT_ID = "ConsentId"; + @SerializedName(SERIALIZED_NAME_CONSENT_ID) + @javax.annotation.Nullable + private String consentId; + + public static final String SERIALIZED_NAME_EVENT = "Event"; + @SerializedName(SERIALIZED_NAME_EVENT) + @javax.annotation.Nullable + private String event; + + public ConsentProfileLog() { + } + + public ConsentProfileLog consentId(@javax.annotation.Nullable String consentId) { + this.consentId = consentId; + return this; + } + + /** + * Unique identifier for the consent option + * @return consentId + */ + @javax.annotation.Nullable + public String getConsentId() { + return consentId; + } + + public void setConsentId(@javax.annotation.Nullable String consentId) { + this.consentId = consentId; + } + + + public ConsentProfileLog event(@javax.annotation.Nullable String event) { + this.event = event; + return this; + } + + /** + * Event associated with this consent log entry + * @return event + */ + @javax.annotation.Nullable + public String getEvent() { + return event; + } + + public void setEvent(@javax.annotation.Nullable String event) { + this.event = event; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConsentProfileLog instance itself + */ + public ConsentProfileLog putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConsentProfileLog consentProfileLog = (ConsentProfileLog) o; + return Objects.equals(this.consentId, consentProfileLog.consentId) && + Objects.equals(this.event, consentProfileLog.event)&& + Objects.equals(this.additionalProperties, consentProfileLog.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(consentId, event, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConsentProfileLog {\n"); + sb.append(" consentId: ").append(toIndentedString(consentId)).append("\n"); + sb.append(" event: ").append(toIndentedString(event)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ConsentId"); + openapiFields.add("Event"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ConsentProfileLog + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConsentProfileLog.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsentProfileLog is not found in the empty JSON string", ConsentProfileLog.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ConsentId") != null && !jsonObj.get("ConsentId").isJsonNull()) && !jsonObj.get("ConsentId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ConsentId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ConsentId").toString())); + } + if ((jsonObj.get("Event") != null && !jsonObj.get("Event").isJsonNull()) && !jsonObj.get("Event").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Event` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Event").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ConsentProfileLog.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsentProfileLog' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ConsentProfileLog> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsentProfileLog.class)); + + return (TypeAdapter<T>) new TypeAdapter<ConsentProfileLog>() { + @Override + public void write(JsonWriter out, ConsentProfileLog value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConsentProfileLog read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConsentProfileLog instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsentProfileLog given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsentProfileLog + * @throws IOException if the JSON string is invalid with respect to ConsentProfileLog + */ + public static ConsentProfileLog fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsentProfileLog.class); + } + + /** + * Convert an instance of ConsentProfileLog to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentResponse.java new file mode 100644 index 0000000..34b23a5 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentResponse.java @@ -0,0 +1,379 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.Profile; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ConsentResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ConsentResponse { + public static final String SERIALIZED_NAME_PROFILE = "Profile"; + @SerializedName(SERIALIZED_NAME_PROFILE) + @javax.annotation.Nullable + private Profile profile; + + public static final String SERIALIZED_NAME_ACCESS_TOKEN = "access_token"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN) + @javax.annotation.Nullable + private String accessToken; + + public static final String SERIALIZED_NAME_REFRESH_TOKEN = "refresh_token"; + @SerializedName(SERIALIZED_NAME_REFRESH_TOKEN) + @javax.annotation.Nullable + private String refreshToken; + + public static final String SERIALIZED_NAME_EXPIRES_IN = "expires_in"; + @SerializedName(SERIALIZED_NAME_EXPIRES_IN) + @javax.annotation.Nullable + private String expiresIn; + + public ConsentResponse() { + } + + public ConsentResponse profile(@javax.annotation.Nullable Profile profile) { + this.profile = profile; + return this; + } + + /** + * Get profile + * @return profile + */ + @javax.annotation.Nullable + public Profile getProfile() { + return profile; + } + + public void setProfile(@javax.annotation.Nullable Profile profile) { + this.profile = profile; + } + + + public ConsentResponse accessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * The Access Token string + * @return accessToken + */ + @javax.annotation.Nullable + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + } + + + public ConsentResponse refreshToken(@javax.annotation.Nullable String refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + /** + * The refresh token string + * @return refreshToken + */ + @javax.annotation.Nullable + public String getRefreshToken() { + return refreshToken; + } + + public void setRefreshToken(@javax.annotation.Nullable String refreshToken) { + this.refreshToken = refreshToken; + } + + + public ConsentResponse expiresIn(@javax.annotation.Nullable String expiresIn) { + this.expiresIn = expiresIn; + return this; + } + + /** + * Expiration time of the Access Token + * @return expiresIn + */ + @javax.annotation.Nullable + public String getExpiresIn() { + return expiresIn; + } + + public void setExpiresIn(@javax.annotation.Nullable String expiresIn) { + this.expiresIn = expiresIn; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConsentResponse instance itself + */ + public ConsentResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConsentResponse consentResponse = (ConsentResponse) o; + return Objects.equals(this.profile, consentResponse.profile) && + Objects.equals(this.accessToken, consentResponse.accessToken) && + Objects.equals(this.refreshToken, consentResponse.refreshToken) && + Objects.equals(this.expiresIn, consentResponse.expiresIn)&& + Objects.equals(this.additionalProperties, consentResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(profile, accessToken, refreshToken, expiresIn, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConsentResponse {\n"); + sb.append(" profile: ").append(toIndentedString(profile)).append("\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" refreshToken: ").append(toIndentedString(refreshToken)).append("\n"); + sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Profile"); + openapiFields.add("access_token"); + openapiFields.add("refresh_token"); + openapiFields.add("expires_in"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ConsentResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConsentResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsentResponse is not found in the empty JSON string", ConsentResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `Profile` + if (jsonObj.get("Profile") != null && !jsonObj.get("Profile").isJsonNull()) { + Profile.validateJsonElement(jsonObj.get("Profile")); + } + if ((jsonObj.get("access_token") != null && !jsonObj.get("access_token").isJsonNull()) && !jsonObj.get("access_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `access_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("access_token").toString())); + } + if ((jsonObj.get("refresh_token") != null && !jsonObj.get("refresh_token").isJsonNull()) && !jsonObj.get("refresh_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `refresh_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refresh_token").toString())); + } + if ((jsonObj.get("expires_in") != null && !jsonObj.get("expires_in").isJsonNull()) && !jsonObj.get("expires_in").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `expires_in` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expires_in").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ConsentResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsentResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ConsentResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsentResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<ConsentResponse>() { + @Override + public void write(JsonWriter out, ConsentResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConsentResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConsentResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsentResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsentResponse + * @throws IOException if the JSON string is invalid with respect to ConsentResponse + */ + public static ConsentResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsentResponse.class); + } + + /** + * Convert an instance of ConsentResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentSubmit.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentSubmit.java new file mode 100644 index 0000000..37a3860 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentSubmit.java @@ -0,0 +1,360 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ConsentData; +import com.loginradius.sdk.internal.openapi.model.ConsentEvent; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ConsentSubmit + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ConsentSubmit { + public static final String SERIALIZED_NAME_EVENTS = "events"; + @SerializedName(SERIALIZED_NAME_EVENTS) + @javax.annotation.Nonnull + private List<ConsentEvent> events = new ArrayList<>(); + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private List<ConsentData> data = new ArrayList<>(); + + public ConsentSubmit() { + } + + public ConsentSubmit events(@javax.annotation.Nonnull List<ConsentEvent> events) { + this.events = events; + return this; + } + + public ConsentSubmit addEventsItem(ConsentEvent eventsItem) { + if (this.events == null) { + this.events = new ArrayList<>(); + } + this.events.add(eventsItem); + return this; + } + + /** + * Get events + * @return events + */ + @javax.annotation.Nonnull + public List<ConsentEvent> getEvents() { + return events; + } + + public void setEvents(@javax.annotation.Nonnull List<ConsentEvent> events) { + this.events = events; + } + + + public ConsentSubmit data(@javax.annotation.Nonnull List<ConsentData> data) { + this.data = data; + return this; + } + + public ConsentSubmit addDataItem(ConsentData dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public List<ConsentData> getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull List<ConsentData> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConsentSubmit instance itself + */ + public ConsentSubmit putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConsentSubmit consentSubmit = (ConsentSubmit) o; + return Objects.equals(this.events, consentSubmit.events) && + Objects.equals(this.data, consentSubmit.data)&& + Objects.equals(this.additionalProperties, consentSubmit.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(events, data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConsentSubmit {\n"); + sb.append(" events: ").append(toIndentedString(events)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("events"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("events"); + openapiRequiredFields.add("data"); + } + + /** + * 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 ConsentSubmit + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConsentSubmit.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsentSubmit is not found in the empty JSON string", ConsentSubmit.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConsentSubmit.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("events").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `events` to be an array in the JSON string but got `%s`", jsonObj.get("events").toString())); + } + + JsonArray jsonArrayevents = jsonObj.getAsJsonArray("events"); + // validate the required field `events` (array) + for (int i = 0; i < jsonArrayevents.size(); i++) { + ConsentEvent.validateJsonElement(jsonArrayevents.get(i)); + }; + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + // validate the required field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + ConsentData.validateJsonElement(jsonArraydata.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ConsentSubmit.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsentSubmit' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ConsentSubmit> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsentSubmit.class)); + + return (TypeAdapter<T>) new TypeAdapter<ConsentSubmit>() { + @Override + public void write(JsonWriter out, ConsentSubmit value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConsentSubmit read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConsentSubmit instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsentSubmit given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsentSubmit + * @throws IOException if the JSON string is invalid with respect to ConsentSubmit + */ + public static ConsentSubmit fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsentSubmit.class); + } + + /** + * Convert an instance of ConsentSubmit to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentUpdate.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentUpdate.java new file mode 100644 index 0000000..31d27a8 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentUpdate.java @@ -0,0 +1,313 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ConsentData; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ConsentUpdate + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ConsentUpdate { + public static final String SERIALIZED_NAME_CONSENTS = "consents"; + @SerializedName(SERIALIZED_NAME_CONSENTS) + @javax.annotation.Nonnull + private List<ConsentData> consents = new ArrayList<>(); + + public ConsentUpdate() { + } + + public ConsentUpdate consents(@javax.annotation.Nonnull List<ConsentData> consents) { + this.consents = consents; + return this; + } + + public ConsentUpdate addConsentsItem(ConsentData consentsItem) { + if (this.consents == null) { + this.consents = new ArrayList<>(); + } + this.consents.add(consentsItem); + return this; + } + + /** + * Get consents + * @return consents + */ + @javax.annotation.Nonnull + public List<ConsentData> getConsents() { + return consents; + } + + public void setConsents(@javax.annotation.Nonnull List<ConsentData> consents) { + this.consents = consents; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConsentUpdate instance itself + */ + public ConsentUpdate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConsentUpdate consentUpdate = (ConsentUpdate) o; + return Objects.equals(this.consents, consentUpdate.consents)&& + Objects.equals(this.additionalProperties, consentUpdate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(consents, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConsentUpdate {\n"); + sb.append(" consents: ").append(toIndentedString(consents)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("consents"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("consents"); + } + + /** + * 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 ConsentUpdate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConsentUpdate.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsentUpdate is not found in the empty JSON string", ConsentUpdate.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ConsentUpdate.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("consents").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `consents` to be an array in the JSON string but got `%s`", jsonObj.get("consents").toString())); + } + + JsonArray jsonArrayconsents = jsonObj.getAsJsonArray("consents"); + // validate the required field `consents` (array) + for (int i = 0; i < jsonArrayconsents.size(); i++) { + ConsentData.validateJsonElement(jsonArrayconsents.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ConsentUpdate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsentUpdate' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ConsentUpdate> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsentUpdate.class)); + + return (TypeAdapter<T>) new TypeAdapter<ConsentUpdate>() { + @Override + public void write(JsonWriter out, ConsentUpdate value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConsentUpdate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConsentUpdate instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsentUpdate given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsentUpdate + * @throws IOException if the JSON string is invalid with respect to ConsentUpdate + */ + public static ConsentUpdate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsentUpdate.class); + } + + /** + * Convert an instance of ConsentUpdate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentVersion.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentVersion.java new file mode 100644 index 0000000..89bdb16 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ConsentVersion.java @@ -0,0 +1,341 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ConsentVersion + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ConsentVersion { + public static final String SERIALIZED_NAME_IS_CUSTOM = "IsCustom"; + @SerializedName(SERIALIZED_NAME_IS_CUSTOM) + @javax.annotation.Nullable + private Boolean isCustom; + + public static final String SERIALIZED_NAME_VERSION = "Version"; + @SerializedName(SERIALIZED_NAME_VERSION) + @javax.annotation.Nullable + private Integer version; + + public static final String SERIALIZED_NAME_EVENT = "Event"; + @SerializedName(SERIALIZED_NAME_EVENT) + @javax.annotation.Nullable + private String event; + + public ConsentVersion() { + } + + public ConsentVersion isCustom(@javax.annotation.Nullable Boolean isCustom) { + this.isCustom = isCustom; + return this; + } + + /** + * Get isCustom + * @return isCustom + */ + @javax.annotation.Nullable + public Boolean getIsCustom() { + return isCustom; + } + + public void setIsCustom(@javax.annotation.Nullable Boolean isCustom) { + this.isCustom = isCustom; + } + + + public ConsentVersion version(@javax.annotation.Nullable Integer version) { + this.version = version; + return this; + } + + /** + * Get version + * @return version + */ + @javax.annotation.Nullable + public Integer getVersion() { + return version; + } + + public void setVersion(@javax.annotation.Nullable Integer version) { + this.version = version; + } + + + public ConsentVersion event(@javax.annotation.Nullable String event) { + this.event = event; + return this; + } + + /** + * Get event + * @return event + */ + @javax.annotation.Nullable + public String getEvent() { + return event; + } + + public void setEvent(@javax.annotation.Nullable String event) { + this.event = event; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ConsentVersion instance itself + */ + public ConsentVersion putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ConsentVersion consentVersion = (ConsentVersion) o; + return Objects.equals(this.isCustom, consentVersion.isCustom) && + Objects.equals(this.version, consentVersion.version) && + Objects.equals(this.event, consentVersion.event)&& + Objects.equals(this.additionalProperties, consentVersion.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isCustom, version, event, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ConsentVersion {\n"); + sb.append(" isCustom: ").append(toIndentedString(isCustom)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" event: ").append(toIndentedString(event)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsCustom"); + openapiFields.add("Version"); + openapiFields.add("Event"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ConsentVersion + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ConsentVersion.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ConsentVersion is not found in the empty JSON string", ConsentVersion.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Event") != null && !jsonObj.get("Event").isJsonNull()) && !jsonObj.get("Event").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Event` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Event").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ConsentVersion.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ConsentVersion' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ConsentVersion> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ConsentVersion.class)); + + return (TypeAdapter<T>) new TypeAdapter<ConsentVersion>() { + @Override + public void write(JsonWriter out, ConsentVersion value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ConsentVersion read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ConsentVersion instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ConsentVersion given an JSON string + * + * @param jsonString JSON string + * @return An instance of ConsentVersion + * @throws IOException if the JSON string is invalid with respect to ConsentVersion + */ + public static ConsentVersion fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ConsentVersion.class); + } + + /** + * Convert an instance of ConsentVersion to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/CreateConnectionGroupRoleRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/CreateConnectionGroupRoleRequest.java new file mode 100644 index 0000000..eb07c7e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/CreateConnectionGroupRoleRequest.java @@ -0,0 +1,357 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * CreateConnectionGroupRoleRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class CreateConnectionGroupRoleRequest { + public static final String SERIALIZED_NAME_GROUP_ID = "GroupId"; + @SerializedName(SERIALIZED_NAME_GROUP_ID) + @javax.annotation.Nonnull + private String groupId; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_ROLE_ID = "RoleId"; + @SerializedName(SERIALIZED_NAME_ROLE_ID) + @javax.annotation.Nonnull + private String roleId; + + public CreateConnectionGroupRoleRequest() { + } + + public CreateConnectionGroupRoleRequest groupId(@javax.annotation.Nonnull String groupId) { + this.groupId = groupId; + return this; + } + + /** + * Unique identifier of the group to which the Role belongs. + * @return groupId + */ + @javax.annotation.Nonnull + public String getGroupId() { + return groupId; + } + + public void setGroupId(@javax.annotation.Nonnull String groupId) { + this.groupId = groupId; + } + + + public CreateConnectionGroupRoleRequest name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Name of the group Role connection. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public CreateConnectionGroupRoleRequest roleId(@javax.annotation.Nonnull String roleId) { + this.roleId = roleId; + return this; + } + + /** + * Unique identifier of the Role. + * @return roleId + */ + @javax.annotation.Nonnull + public String getRoleId() { + return roleId; + } + + public void setRoleId(@javax.annotation.Nonnull String roleId) { + this.roleId = roleId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CreateConnectionGroupRoleRequest instance itself + */ + public CreateConnectionGroupRoleRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateConnectionGroupRoleRequest createConnectionGroupRoleRequest = (CreateConnectionGroupRoleRequest) o; + return Objects.equals(this.groupId, createConnectionGroupRoleRequest.groupId) && + Objects.equals(this.name, createConnectionGroupRoleRequest.name) && + Objects.equals(this.roleId, createConnectionGroupRoleRequest.roleId)&& + Objects.equals(this.additionalProperties, createConnectionGroupRoleRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(groupId, name, roleId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateConnectionGroupRoleRequest {\n"); + sb.append(" groupId: ").append(toIndentedString(groupId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" roleId: ").append(toIndentedString(roleId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("GroupId"); + openapiFields.add("Name"); + openapiFields.add("RoleId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("GroupId"); + openapiRequiredFields.add("Name"); + openapiRequiredFields.add("RoleId"); + } + + /** + * 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 CreateConnectionGroupRoleRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateConnectionGroupRoleRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateConnectionGroupRoleRequest is not found in the empty JSON string", CreateConnectionGroupRoleRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateConnectionGroupRoleRequest.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("GroupId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GroupId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GroupId").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("RoleId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RoleId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RoleId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!CreateConnectionGroupRoleRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateConnectionGroupRoleRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<CreateConnectionGroupRoleRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateConnectionGroupRoleRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<CreateConnectionGroupRoleRequest>() { + @Override + public void write(JsonWriter out, CreateConnectionGroupRoleRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CreateConnectionGroupRoleRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateConnectionGroupRoleRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateConnectionGroupRoleRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateConnectionGroupRoleRequest + * @throws IOException if the JSON string is invalid with respect to CreateConnectionGroupRoleRequest + */ + public static CreateConnectionGroupRoleRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateConnectionGroupRoleRequest.class); + } + + /** + * Convert an instance of CreateConnectionGroupRoleRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/CreateJwtIntegrationRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/CreateJwtIntegrationRequest.java new file mode 100644 index 0000000..5be99a6 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/CreateJwtIntegrationRequest.java @@ -0,0 +1,770 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * CreateJwtIntegrationRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class CreateJwtIntegrationRequest { + public static final String SERIALIZED_NAME_APP_NAME = "AppName"; + @SerializedName(SERIALIZED_NAME_APP_NAME) + @javax.annotation.Nonnull + private String appName; + + /** + * Gets or Sets algo + */ + @JsonAdapter(AlgoEnum.Adapter.class) + public enum AlgoEnum { + HS256("HS256"), + + HS384("HS384"), + + HS512("HS512"), + + RS256("RS256"), + + RS384("RS384"), + + RS512("RS512"), + + ES256("ES256"), + + ES384("ES384"), + + ES512("ES512"); + + private String value; + + AlgoEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AlgoEnum fromValue(String value) { + for (AlgoEnum b : AlgoEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<AlgoEnum> { + @Override + public void write(final JsonWriter jsonWriter, final AlgoEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AlgoEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AlgoEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AlgoEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ALGO = "Algo"; + @SerializedName(SERIALIZED_NAME_ALGO) + @javax.annotation.Nonnull + private AlgoEnum algo; + + public static final String SERIALIZED_NAME_SECRET = "Secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + @javax.annotation.Nonnull + private String secret; + + public static final String SERIALIZED_NAME_MAPPING_TEMPLATE = "MappingTemplate"; + @SerializedName(SERIALIZED_NAME_MAPPING_TEMPLATE) + @javax.annotation.Nullable + private String mappingTemplate; + + public static final String SERIALIZED_NAME_MAPPING = "Mapping"; + @SerializedName(SERIALIZED_NAME_MAPPING) + @javax.annotation.Nullable + private Map<String, String> mapping = new HashMap<>(); + + public static final String SERIALIZED_NAME_METADATA = "Metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + @javax.annotation.Nullable + private Map<String, String> metadata = new HashMap<>(); + + public static final String SERIALIZED_NAME_AUDIENCE = "Audience"; + @SerializedName(SERIALIZED_NAME_AUDIENCE) + @javax.annotation.Nullable + private List<String> audience = new ArrayList<>(); + + public static final String SERIALIZED_NAME_NOT_AFTER_DIFFERENCE = "NotAfterDifference"; + @SerializedName(SERIALIZED_NAME_NOT_AFTER_DIFFERENCE) + @javax.annotation.Nullable + private Integer notAfterDifference; + + public static final String SERIALIZED_NAME_NOT_BEFORE_DIFFERENCE = "NotBeforeDifference"; + @SerializedName(SERIALIZED_NAME_NOT_BEFORE_DIFFERENCE) + @javax.annotation.Nullable + private Integer notBeforeDifference; + + public static final String SERIALIZED_NAME_QUERY_STRING_PARAMETER = "QueryStringParameter"; + @SerializedName(SERIALIZED_NAME_QUERY_STRING_PARAMETER) + @javax.annotation.Nullable + private String queryStringParameter; + + /** + * Gets or Sets responseMode + */ + @JsonAdapter(ResponseModeEnum.Adapter.class) + public enum ResponseModeEnum { + QUERY("query"), + + FRAGMENT("fragment"), + + FORM_POST("form_post"); + + private String value; + + ResponseModeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ResponseModeEnum fromValue(String value) { + for (ResponseModeEnum b : ResponseModeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<ResponseModeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final ResponseModeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ResponseModeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ResponseModeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ResponseModeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_RESPONSE_MODE = "ResponseMode"; + @SerializedName(SERIALIZED_NAME_RESPONSE_MODE) + @javax.annotation.Nullable + private ResponseModeEnum responseMode; + + public static final String SERIALIZED_NAME_LOGIN_URL = "LoginUrl"; + @SerializedName(SERIALIZED_NAME_LOGIN_URL) + @javax.annotation.Nullable + private String loginUrl; + + public CreateJwtIntegrationRequest() { + } + + public CreateJwtIntegrationRequest appName(@javax.annotation.Nonnull String appName) { + this.appName = appName; + return this; + } + + /** + * Get appName + * @return appName + */ + @javax.annotation.Nonnull + public String getAppName() { + return appName; + } + + public void setAppName(@javax.annotation.Nonnull String appName) { + this.appName = appName; + } + + + public CreateJwtIntegrationRequest algo(@javax.annotation.Nonnull AlgoEnum algo) { + this.algo = algo; + return this; + } + + /** + * Get algo + * @return algo + */ + @javax.annotation.Nonnull + public AlgoEnum getAlgo() { + return algo; + } + + public void setAlgo(@javax.annotation.Nonnull AlgoEnum algo) { + this.algo = algo; + } + + + public CreateJwtIntegrationRequest secret(@javax.annotation.Nonnull String secret) { + this.secret = secret; + return this; + } + + /** + * Get secret + * @return secret + */ + @javax.annotation.Nonnull + public String getSecret() { + return secret; + } + + public void setSecret(@javax.annotation.Nonnull String secret) { + this.secret = secret; + } + + + public CreateJwtIntegrationRequest mappingTemplate(@javax.annotation.Nullable String mappingTemplate) { + this.mappingTemplate = mappingTemplate; + return this; + } + + /** + * Get mappingTemplate + * @return mappingTemplate + */ + @javax.annotation.Nullable + public String getMappingTemplate() { + return mappingTemplate; + } + + public void setMappingTemplate(@javax.annotation.Nullable String mappingTemplate) { + this.mappingTemplate = mappingTemplate; + } + + + public CreateJwtIntegrationRequest mapping(@javax.annotation.Nullable Map<String, String> mapping) { + this.mapping = mapping; + return this; + } + + public CreateJwtIntegrationRequest putMappingItem(String key, String mappingItem) { + if (this.mapping == null) { + this.mapping = new HashMap<>(); + } + this.mapping.put(key, mappingItem); + return this; + } + + /** + * Get mapping + * @return mapping + */ + @javax.annotation.Nullable + public Map<String, String> getMapping() { + return mapping; + } + + public void setMapping(@javax.annotation.Nullable Map<String, String> mapping) { + this.mapping = mapping; + } + + + public CreateJwtIntegrationRequest metadata(@javax.annotation.Nullable Map<String, String> metadata) { + this.metadata = metadata; + return this; + } + + public CreateJwtIntegrationRequest putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Get metadata + * @return metadata + */ + @javax.annotation.Nullable + public Map<String, String> getMetadata() { + return metadata; + } + + public void setMetadata(@javax.annotation.Nullable Map<String, String> metadata) { + this.metadata = metadata; + } + + + public CreateJwtIntegrationRequest audience(@javax.annotation.Nullable List<String> audience) { + this.audience = audience; + return this; + } + + public CreateJwtIntegrationRequest addAudienceItem(String audienceItem) { + if (this.audience == null) { + this.audience = new ArrayList<>(); + } + this.audience.add(audienceItem); + return this; + } + + /** + * Get audience + * @return audience + */ + @javax.annotation.Nullable + public List<String> getAudience() { + return audience; + } + + public void setAudience(@javax.annotation.Nullable List<String> audience) { + this.audience = audience; + } + + + public CreateJwtIntegrationRequest notAfterDifference(@javax.annotation.Nullable Integer notAfterDifference) { + this.notAfterDifference = notAfterDifference; + return this; + } + + /** + * Get notAfterDifference + * @return notAfterDifference + */ + @javax.annotation.Nullable + public Integer getNotAfterDifference() { + return notAfterDifference; + } + + public void setNotAfterDifference(@javax.annotation.Nullable Integer notAfterDifference) { + this.notAfterDifference = notAfterDifference; + } + + + public CreateJwtIntegrationRequest notBeforeDifference(@javax.annotation.Nullable Integer notBeforeDifference) { + this.notBeforeDifference = notBeforeDifference; + return this; + } + + /** + * Get notBeforeDifference + * @return notBeforeDifference + */ + @javax.annotation.Nullable + public Integer getNotBeforeDifference() { + return notBeforeDifference; + } + + public void setNotBeforeDifference(@javax.annotation.Nullable Integer notBeforeDifference) { + this.notBeforeDifference = notBeforeDifference; + } + + + public CreateJwtIntegrationRequest queryStringParameter(@javax.annotation.Nullable String queryStringParameter) { + this.queryStringParameter = queryStringParameter; + return this; + } + + /** + * Get queryStringParameter + * @return queryStringParameter + */ + @javax.annotation.Nullable + public String getQueryStringParameter() { + return queryStringParameter; + } + + public void setQueryStringParameter(@javax.annotation.Nullable String queryStringParameter) { + this.queryStringParameter = queryStringParameter; + } + + + public CreateJwtIntegrationRequest responseMode(@javax.annotation.Nullable ResponseModeEnum responseMode) { + this.responseMode = responseMode; + return this; + } + + /** + * Get responseMode + * @return responseMode + */ + @javax.annotation.Nullable + public ResponseModeEnum getResponseMode() { + return responseMode; + } + + public void setResponseMode(@javax.annotation.Nullable ResponseModeEnum responseMode) { + this.responseMode = responseMode; + } + + + public CreateJwtIntegrationRequest loginUrl(@javax.annotation.Nullable String loginUrl) { + this.loginUrl = loginUrl; + return this; + } + + /** + * Get loginUrl + * @return loginUrl + */ + @javax.annotation.Nullable + public String getLoginUrl() { + return loginUrl; + } + + public void setLoginUrl(@javax.annotation.Nullable String loginUrl) { + this.loginUrl = loginUrl; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CreateJwtIntegrationRequest instance itself + */ + public CreateJwtIntegrationRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateJwtIntegrationRequest createJwtIntegrationRequest = (CreateJwtIntegrationRequest) o; + return Objects.equals(this.appName, createJwtIntegrationRequest.appName) && + Objects.equals(this.algo, createJwtIntegrationRequest.algo) && + Objects.equals(this.secret, createJwtIntegrationRequest.secret) && + Objects.equals(this.mappingTemplate, createJwtIntegrationRequest.mappingTemplate) && + Objects.equals(this.mapping, createJwtIntegrationRequest.mapping) && + Objects.equals(this.metadata, createJwtIntegrationRequest.metadata) && + Objects.equals(this.audience, createJwtIntegrationRequest.audience) && + Objects.equals(this.notAfterDifference, createJwtIntegrationRequest.notAfterDifference) && + Objects.equals(this.notBeforeDifference, createJwtIntegrationRequest.notBeforeDifference) && + Objects.equals(this.queryStringParameter, createJwtIntegrationRequest.queryStringParameter) && + Objects.equals(this.responseMode, createJwtIntegrationRequest.responseMode) && + Objects.equals(this.loginUrl, createJwtIntegrationRequest.loginUrl)&& + Objects.equals(this.additionalProperties, createJwtIntegrationRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(appName, algo, secret, mappingTemplate, mapping, metadata, audience, notAfterDifference, notBeforeDifference, queryStringParameter, responseMode, loginUrl, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateJwtIntegrationRequest {\n"); + sb.append(" appName: ").append(toIndentedString(appName)).append("\n"); + sb.append(" algo: ").append(toIndentedString(algo)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" mappingTemplate: ").append(toIndentedString(mappingTemplate)).append("\n"); + sb.append(" mapping: ").append(toIndentedString(mapping)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" audience: ").append(toIndentedString(audience)).append("\n"); + sb.append(" notAfterDifference: ").append(toIndentedString(notAfterDifference)).append("\n"); + sb.append(" notBeforeDifference: ").append(toIndentedString(notBeforeDifference)).append("\n"); + sb.append(" queryStringParameter: ").append(toIndentedString(queryStringParameter)).append("\n"); + sb.append(" responseMode: ").append(toIndentedString(responseMode)).append("\n"); + sb.append(" loginUrl: ").append(toIndentedString(loginUrl)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AppName"); + openapiFields.add("Algo"); + openapiFields.add("Secret"); + openapiFields.add("MappingTemplate"); + openapiFields.add("Mapping"); + openapiFields.add("Metadata"); + openapiFields.add("Audience"); + openapiFields.add("NotAfterDifference"); + openapiFields.add("NotBeforeDifference"); + openapiFields.add("QueryStringParameter"); + openapiFields.add("ResponseMode"); + openapiFields.add("LoginUrl"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("AppName"); + openapiRequiredFields.add("Algo"); + openapiRequiredFields.add("Secret"); + } + + /** + * 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 CreateJwtIntegrationRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateJwtIntegrationRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateJwtIntegrationRequest is not found in the empty JSON string", CreateJwtIntegrationRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateJwtIntegrationRequest.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("AppName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AppName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AppName").toString())); + } + if (!jsonObj.get("Algo").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Algo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Algo").toString())); + } + // validate the required field `Algo` + AlgoEnum.validateJsonElement(jsonObj.get("Algo")); + if (!jsonObj.get("Secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Secret").toString())); + } + if ((jsonObj.get("MappingTemplate") != null && !jsonObj.get("MappingTemplate").isJsonNull()) && !jsonObj.get("MappingTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MappingTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MappingTemplate").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("Audience") != null && !jsonObj.get("Audience").isJsonNull() && !jsonObj.get("Audience").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Audience` to be an array in the JSON string but got `%s`", jsonObj.get("Audience").toString())); + } + if ((jsonObj.get("QueryStringParameter") != null && !jsonObj.get("QueryStringParameter").isJsonNull()) && !jsonObj.get("QueryStringParameter").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `QueryStringParameter` to be a primitive type in the JSON string but got `%s`", jsonObj.get("QueryStringParameter").toString())); + } + if ((jsonObj.get("ResponseMode") != null && !jsonObj.get("ResponseMode").isJsonNull()) && !jsonObj.get("ResponseMode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ResponseMode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ResponseMode").toString())); + } + // validate the optional field `ResponseMode` + if (jsonObj.get("ResponseMode") != null && !jsonObj.get("ResponseMode").isJsonNull()) { + ResponseModeEnum.validateJsonElement(jsonObj.get("ResponseMode")); + } + if ((jsonObj.get("LoginUrl") != null && !jsonObj.get("LoginUrl").isJsonNull()) && !jsonObj.get("LoginUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LoginUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LoginUrl").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!CreateJwtIntegrationRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateJwtIntegrationRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<CreateJwtIntegrationRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateJwtIntegrationRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<CreateJwtIntegrationRequest>() { + @Override + public void write(JsonWriter out, CreateJwtIntegrationRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CreateJwtIntegrationRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateJwtIntegrationRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateJwtIntegrationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateJwtIntegrationRequest + * @throws IOException if the JSON string is invalid with respect to CreateJwtIntegrationRequest + */ + public static CreateJwtIntegrationRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateJwtIntegrationRequest.class); + } + + /** + * Convert an instance of CreateJwtIntegrationRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/CreateJwtSPClientConfigurationRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/CreateJwtSPClientConfigurationRequest.java new file mode 100644 index 0000000..26376eb --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/CreateJwtSPClientConfigurationRequest.java @@ -0,0 +1,887 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.JwtClaimAudienceProperty; +import com.loginradius.sdk.internal.openapi.model.JwtClaimMandatory; +import com.loginradius.sdk.internal.openapi.model.JwtClaimSubjectProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * CreateJwtSPClientConfigurationRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class CreateJwtSPClientConfigurationRequest { + public static final String SERIALIZED_NAME_APP_NAME = "AppName"; + @SerializedName(SERIALIZED_NAME_APP_NAME) + @javax.annotation.Nonnull + private String appName; + + public static final String SERIALIZED_NAME_ALGO = "Algo"; + @SerializedName(SERIALIZED_NAME_ALGO) + @javax.annotation.Nullable + private String algo; + + public static final String SERIALIZED_NAME_MAPPING = "Mapping"; + @SerializedName(SERIALIZED_NAME_MAPPING) + @javax.annotation.Nonnull + private Map<String, String> mapping = new HashMap<>(); + + public static final String SERIALIZED_NAME_KEY = "Key"; + @SerializedName(SERIALIZED_NAME_KEY) + @javax.annotation.Nullable + private String key; + + public static final String SERIALIZED_NAME_TOKEN_QUERY_PARAMETER_NAME = "TokenQueryParameterName"; + @SerializedName(SERIALIZED_NAME_TOKEN_QUERY_PARAMETER_NAME) + @javax.annotation.Nullable + private String tokenQueryParameterName; + + public static final String SERIALIZED_NAME_CLOCK_SKEW = "ClockSkew"; + @SerializedName(SERIALIZED_NAME_CLOCK_SKEW) + @javax.annotation.Nullable + private Integer clockSkew; + + public static final String SERIALIZED_NAME_LOGIN_URL = "LoginUrl"; + @SerializedName(SERIALIZED_NAME_LOGIN_URL) + @javax.annotation.Nullable + private String loginUrl; + + public static final String SERIALIZED_NAME_ISSUER = "Issuer"; + @SerializedName(SERIALIZED_NAME_ISSUER) + @javax.annotation.Nullable + private JwtClaimSubjectProperty issuer; + + public static final String SERIALIZED_NAME_SUBJECT = "Subject"; + @SerializedName(SERIALIZED_NAME_SUBJECT) + @javax.annotation.Nullable + private JwtClaimMandatory subject; + + public static final String SERIALIZED_NAME_AUDIENCE = "Audience"; + @SerializedName(SERIALIZED_NAME_AUDIENCE) + @javax.annotation.Nullable + private JwtClaimAudienceProperty audience; + + public static final String SERIALIZED_NAME_EXPIRATION_TIME_DIFFERENCE = "ExpirationTimeDifference"; + @SerializedName(SERIALIZED_NAME_EXPIRATION_TIME_DIFFERENCE) + @javax.annotation.Nullable + private Integer expirationTimeDifference; + + public static final String SERIALIZED_NAME_USE_AUTHORIZATION_HEADER = "UseAuthorizationHeader"; + @SerializedName(SERIALIZED_NAME_USE_AUTHORIZATION_HEADER) + @javax.annotation.Nullable + private Boolean useAuthorizationHeader; + + public static final String SERIALIZED_NAME_NOT_BEFORE = "NotBefore"; + @SerializedName(SERIALIZED_NAME_NOT_BEFORE) + @javax.annotation.Nullable + private JwtClaimMandatory notBefore; + + public static final String SERIALIZED_NAME_EXPIRATION = "Expiration"; + @SerializedName(SERIALIZED_NAME_EXPIRATION) + @javax.annotation.Nullable + private JwtClaimMandatory expiration; + + public static final String SERIALIZED_NAME_JW_K_S_URL = "JWKSUrl"; + @SerializedName(SERIALIZED_NAME_JW_K_S_URL) + @javax.annotation.Nullable + private String jwKSUrl; + + public static final String SERIALIZED_NAME_UPDATE_EMAIL_PROFILE = "UpdateEmailProfile"; + @SerializedName(SERIALIZED_NAME_UPDATE_EMAIL_PROFILE) + @javax.annotation.Nullable + private Boolean updateEmailProfile; + + public static final String SERIALIZED_NAME_RAAS_UPDATE_FIELDS = "RaasUpdateFields"; + @SerializedName(SERIALIZED_NAME_RAAS_UPDATE_FIELDS) + @javax.annotation.Nullable + private List<String> raasUpdateFields = new ArrayList<>(); + + public static final String SERIALIZED_NAME_DOMAIN = "Domain"; + @SerializedName(SERIALIZED_NAME_DOMAIN) + @javax.annotation.Nullable + private String domain; + + public static final String SERIALIZED_NAME_ENABLE_AUTO_LOOK_UP = "EnableAutoLookUp"; + @SerializedName(SERIALIZED_NAME_ENABLE_AUTO_LOOK_UP) + @javax.annotation.Nullable + private Boolean enableAutoLookUp; + + public static final String SERIALIZED_NAME_LIST_IN_INTERFACE = "ListInInterface"; + @SerializedName(SERIALIZED_NAME_LIST_IN_INTERFACE) + @javax.annotation.Nullable + private Boolean listInInterface; + + public CreateJwtSPClientConfigurationRequest() { + } + + public CreateJwtSPClientConfigurationRequest appName(@javax.annotation.Nonnull String appName) { + this.appName = appName; + return this; + } + + /** + * Get appName + * @return appName + */ + @javax.annotation.Nonnull + public String getAppName() { + return appName; + } + + public void setAppName(@javax.annotation.Nonnull String appName) { + this.appName = appName; + } + + + public CreateJwtSPClientConfigurationRequest algo(@javax.annotation.Nullable String algo) { + this.algo = algo; + return this; + } + + /** + * Get algo + * @return algo + */ + @javax.annotation.Nullable + public String getAlgo() { + return algo; + } + + public void setAlgo(@javax.annotation.Nullable String algo) { + this.algo = algo; + } + + + public CreateJwtSPClientConfigurationRequest mapping(@javax.annotation.Nonnull Map<String, String> mapping) { + this.mapping = mapping; + return this; + } + + public CreateJwtSPClientConfigurationRequest putMappingItem(String key, String mappingItem) { + if (this.mapping == null) { + this.mapping = new HashMap<>(); + } + this.mapping.put(key, mappingItem); + return this; + } + + /** + * Get mapping + * @return mapping + */ + @javax.annotation.Nonnull + public Map<String, String> getMapping() { + return mapping; + } + + public void setMapping(@javax.annotation.Nonnull Map<String, String> mapping) { + this.mapping = mapping; + } + + + public CreateJwtSPClientConfigurationRequest key(@javax.annotation.Nullable String key) { + this.key = key; + return this; + } + + /** + * Get key + * @return key + */ + @javax.annotation.Nullable + public String getKey() { + return key; + } + + public void setKey(@javax.annotation.Nullable String key) { + this.key = key; + } + + + public CreateJwtSPClientConfigurationRequest tokenQueryParameterName(@javax.annotation.Nullable String tokenQueryParameterName) { + this.tokenQueryParameterName = tokenQueryParameterName; + return this; + } + + /** + * Get tokenQueryParameterName + * @return tokenQueryParameterName + */ + @javax.annotation.Nullable + public String getTokenQueryParameterName() { + return tokenQueryParameterName; + } + + public void setTokenQueryParameterName(@javax.annotation.Nullable String tokenQueryParameterName) { + this.tokenQueryParameterName = tokenQueryParameterName; + } + + + public CreateJwtSPClientConfigurationRequest clockSkew(@javax.annotation.Nullable Integer clockSkew) { + this.clockSkew = clockSkew; + return this; + } + + /** + * Get clockSkew + * @return clockSkew + */ + @javax.annotation.Nullable + public Integer getClockSkew() { + return clockSkew; + } + + public void setClockSkew(@javax.annotation.Nullable Integer clockSkew) { + this.clockSkew = clockSkew; + } + + + public CreateJwtSPClientConfigurationRequest loginUrl(@javax.annotation.Nullable String loginUrl) { + this.loginUrl = loginUrl; + return this; + } + + /** + * Get loginUrl + * @return loginUrl + */ + @javax.annotation.Nullable + public String getLoginUrl() { + return loginUrl; + } + + public void setLoginUrl(@javax.annotation.Nullable String loginUrl) { + this.loginUrl = loginUrl; + } + + + public CreateJwtSPClientConfigurationRequest issuer(@javax.annotation.Nullable JwtClaimSubjectProperty issuer) { + this.issuer = issuer; + return this; + } + + /** + * Get issuer + * @return issuer + */ + @javax.annotation.Nullable + public JwtClaimSubjectProperty getIssuer() { + return issuer; + } + + public void setIssuer(@javax.annotation.Nullable JwtClaimSubjectProperty issuer) { + this.issuer = issuer; + } + + + public CreateJwtSPClientConfigurationRequest subject(@javax.annotation.Nullable JwtClaimMandatory subject) { + this.subject = subject; + return this; + } + + /** + * Get subject + * @return subject + */ + @javax.annotation.Nullable + public JwtClaimMandatory getSubject() { + return subject; + } + + public void setSubject(@javax.annotation.Nullable JwtClaimMandatory subject) { + this.subject = subject; + } + + + public CreateJwtSPClientConfigurationRequest audience(@javax.annotation.Nullable JwtClaimAudienceProperty audience) { + this.audience = audience; + return this; + } + + /** + * Get audience + * @return audience + */ + @javax.annotation.Nullable + public JwtClaimAudienceProperty getAudience() { + return audience; + } + + public void setAudience(@javax.annotation.Nullable JwtClaimAudienceProperty audience) { + this.audience = audience; + } + + + public CreateJwtSPClientConfigurationRequest expirationTimeDifference(@javax.annotation.Nullable Integer expirationTimeDifference) { + this.expirationTimeDifference = expirationTimeDifference; + return this; + } + + /** + * Get expirationTimeDifference + * @return expirationTimeDifference + */ + @javax.annotation.Nullable + public Integer getExpirationTimeDifference() { + return expirationTimeDifference; + } + + public void setExpirationTimeDifference(@javax.annotation.Nullable Integer expirationTimeDifference) { + this.expirationTimeDifference = expirationTimeDifference; + } + + + public CreateJwtSPClientConfigurationRequest useAuthorizationHeader(@javax.annotation.Nullable Boolean useAuthorizationHeader) { + this.useAuthorizationHeader = useAuthorizationHeader; + return this; + } + + /** + * Get useAuthorizationHeader + * @return useAuthorizationHeader + */ + @javax.annotation.Nullable + public Boolean getUseAuthorizationHeader() { + return useAuthorizationHeader; + } + + public void setUseAuthorizationHeader(@javax.annotation.Nullable Boolean useAuthorizationHeader) { + this.useAuthorizationHeader = useAuthorizationHeader; + } + + + public CreateJwtSPClientConfigurationRequest notBefore(@javax.annotation.Nullable JwtClaimMandatory notBefore) { + this.notBefore = notBefore; + return this; + } + + /** + * Get notBefore + * @return notBefore + */ + @javax.annotation.Nullable + public JwtClaimMandatory getNotBefore() { + return notBefore; + } + + public void setNotBefore(@javax.annotation.Nullable JwtClaimMandatory notBefore) { + this.notBefore = notBefore; + } + + + public CreateJwtSPClientConfigurationRequest expiration(@javax.annotation.Nullable JwtClaimMandatory expiration) { + this.expiration = expiration; + return this; + } + + /** + * Get expiration + * @return expiration + */ + @javax.annotation.Nullable + public JwtClaimMandatory getExpiration() { + return expiration; + } + + public void setExpiration(@javax.annotation.Nullable JwtClaimMandatory expiration) { + this.expiration = expiration; + } + + + public CreateJwtSPClientConfigurationRequest jwKSUrl(@javax.annotation.Nullable String jwKSUrl) { + this.jwKSUrl = jwKSUrl; + return this; + } + + /** + * Get jwKSUrl + * @return jwKSUrl + */ + @javax.annotation.Nullable + public String getJwKSUrl() { + return jwKSUrl; + } + + public void setJwKSUrl(@javax.annotation.Nullable String jwKSUrl) { + this.jwKSUrl = jwKSUrl; + } + + + public CreateJwtSPClientConfigurationRequest updateEmailProfile(@javax.annotation.Nullable Boolean updateEmailProfile) { + this.updateEmailProfile = updateEmailProfile; + return this; + } + + /** + * Get updateEmailProfile + * @return updateEmailProfile + */ + @javax.annotation.Nullable + public Boolean getUpdateEmailProfile() { + return updateEmailProfile; + } + + public void setUpdateEmailProfile(@javax.annotation.Nullable Boolean updateEmailProfile) { + this.updateEmailProfile = updateEmailProfile; + } + + + public CreateJwtSPClientConfigurationRequest raasUpdateFields(@javax.annotation.Nullable List<String> raasUpdateFields) { + this.raasUpdateFields = raasUpdateFields; + return this; + } + + public CreateJwtSPClientConfigurationRequest addRaasUpdateFieldsItem(String raasUpdateFieldsItem) { + if (this.raasUpdateFields == null) { + this.raasUpdateFields = new ArrayList<>(); + } + this.raasUpdateFields.add(raasUpdateFieldsItem); + return this; + } + + /** + * Get raasUpdateFields + * @return raasUpdateFields + */ + @javax.annotation.Nullable + public List<String> getRaasUpdateFields() { + return raasUpdateFields; + } + + public void setRaasUpdateFields(@javax.annotation.Nullable List<String> raasUpdateFields) { + this.raasUpdateFields = raasUpdateFields; + } + + + public CreateJwtSPClientConfigurationRequest domain(@javax.annotation.Nullable String domain) { + this.domain = domain; + return this; + } + + /** + * Get domain + * @return domain + */ + @javax.annotation.Nullable + public String getDomain() { + return domain; + } + + public void setDomain(@javax.annotation.Nullable String domain) { + this.domain = domain; + } + + + public CreateJwtSPClientConfigurationRequest enableAutoLookUp(@javax.annotation.Nullable Boolean enableAutoLookUp) { + this.enableAutoLookUp = enableAutoLookUp; + return this; + } + + /** + * Get enableAutoLookUp + * @return enableAutoLookUp + */ + @javax.annotation.Nullable + public Boolean getEnableAutoLookUp() { + return enableAutoLookUp; + } + + public void setEnableAutoLookUp(@javax.annotation.Nullable Boolean enableAutoLookUp) { + this.enableAutoLookUp = enableAutoLookUp; + } + + + public CreateJwtSPClientConfigurationRequest listInInterface(@javax.annotation.Nullable Boolean listInInterface) { + this.listInInterface = listInInterface; + return this; + } + + /** + * Get listInInterface + * @return listInInterface + */ + @javax.annotation.Nullable + public Boolean getListInInterface() { + return listInInterface; + } + + public void setListInInterface(@javax.annotation.Nullable Boolean listInInterface) { + this.listInInterface = listInInterface; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CreateJwtSPClientConfigurationRequest instance itself + */ + public CreateJwtSPClientConfigurationRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateJwtSPClientConfigurationRequest createJwtSPClientConfigurationRequest = (CreateJwtSPClientConfigurationRequest) o; + return Objects.equals(this.appName, createJwtSPClientConfigurationRequest.appName) && + Objects.equals(this.algo, createJwtSPClientConfigurationRequest.algo) && + Objects.equals(this.mapping, createJwtSPClientConfigurationRequest.mapping) && + Objects.equals(this.key, createJwtSPClientConfigurationRequest.key) && + Objects.equals(this.tokenQueryParameterName, createJwtSPClientConfigurationRequest.tokenQueryParameterName) && + Objects.equals(this.clockSkew, createJwtSPClientConfigurationRequest.clockSkew) && + Objects.equals(this.loginUrl, createJwtSPClientConfigurationRequest.loginUrl) && + Objects.equals(this.issuer, createJwtSPClientConfigurationRequest.issuer) && + Objects.equals(this.subject, createJwtSPClientConfigurationRequest.subject) && + Objects.equals(this.audience, createJwtSPClientConfigurationRequest.audience) && + Objects.equals(this.expirationTimeDifference, createJwtSPClientConfigurationRequest.expirationTimeDifference) && + Objects.equals(this.useAuthorizationHeader, createJwtSPClientConfigurationRequest.useAuthorizationHeader) && + Objects.equals(this.notBefore, createJwtSPClientConfigurationRequest.notBefore) && + Objects.equals(this.expiration, createJwtSPClientConfigurationRequest.expiration) && + Objects.equals(this.jwKSUrl, createJwtSPClientConfigurationRequest.jwKSUrl) && + Objects.equals(this.updateEmailProfile, createJwtSPClientConfigurationRequest.updateEmailProfile) && + Objects.equals(this.raasUpdateFields, createJwtSPClientConfigurationRequest.raasUpdateFields) && + Objects.equals(this.domain, createJwtSPClientConfigurationRequest.domain) && + Objects.equals(this.enableAutoLookUp, createJwtSPClientConfigurationRequest.enableAutoLookUp) && + Objects.equals(this.listInInterface, createJwtSPClientConfigurationRequest.listInInterface)&& + Objects.equals(this.additionalProperties, createJwtSPClientConfigurationRequest.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(appName, algo, mapping, key, tokenQueryParameterName, clockSkew, loginUrl, issuer, subject, audience, expirationTimeDifference, useAuthorizationHeader, notBefore, expiration, jwKSUrl, updateEmailProfile, raasUpdateFields, domain, enableAutoLookUp, listInInterface, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateJwtSPClientConfigurationRequest {\n"); + sb.append(" appName: ").append(toIndentedString(appName)).append("\n"); + sb.append(" algo: ").append(toIndentedString(algo)).append("\n"); + sb.append(" mapping: ").append(toIndentedString(mapping)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" tokenQueryParameterName: ").append(toIndentedString(tokenQueryParameterName)).append("\n"); + sb.append(" clockSkew: ").append(toIndentedString(clockSkew)).append("\n"); + sb.append(" loginUrl: ").append(toIndentedString(loginUrl)).append("\n"); + sb.append(" issuer: ").append(toIndentedString(issuer)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" audience: ").append(toIndentedString(audience)).append("\n"); + sb.append(" expirationTimeDifference: ").append(toIndentedString(expirationTimeDifference)).append("\n"); + sb.append(" useAuthorizationHeader: ").append(toIndentedString(useAuthorizationHeader)).append("\n"); + sb.append(" notBefore: ").append(toIndentedString(notBefore)).append("\n"); + sb.append(" expiration: ").append(toIndentedString(expiration)).append("\n"); + sb.append(" jwKSUrl: ").append(toIndentedString(jwKSUrl)).append("\n"); + sb.append(" updateEmailProfile: ").append(toIndentedString(updateEmailProfile)).append("\n"); + sb.append(" raasUpdateFields: ").append(toIndentedString(raasUpdateFields)).append("\n"); + sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); + sb.append(" enableAutoLookUp: ").append(toIndentedString(enableAutoLookUp)).append("\n"); + sb.append(" listInInterface: ").append(toIndentedString(listInInterface)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AppName"); + openapiFields.add("Algo"); + openapiFields.add("Mapping"); + openapiFields.add("Key"); + openapiFields.add("TokenQueryParameterName"); + openapiFields.add("ClockSkew"); + openapiFields.add("LoginUrl"); + openapiFields.add("Issuer"); + openapiFields.add("Subject"); + openapiFields.add("Audience"); + openapiFields.add("ExpirationTimeDifference"); + openapiFields.add("UseAuthorizationHeader"); + openapiFields.add("NotBefore"); + openapiFields.add("Expiration"); + openapiFields.add("JWKSUrl"); + openapiFields.add("UpdateEmailProfile"); + openapiFields.add("RaasUpdateFields"); + openapiFields.add("Domain"); + openapiFields.add("EnableAutoLookUp"); + openapiFields.add("ListInInterface"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("AppName"); + openapiRequiredFields.add("Algo"); + openapiRequiredFields.add("Mapping"); + } + + /** + * 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 CreateJwtSPClientConfigurationRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateJwtSPClientConfigurationRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateJwtSPClientConfigurationRequest is not found in the empty JSON string", CreateJwtSPClientConfigurationRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateJwtSPClientConfigurationRequest.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("AppName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AppName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AppName").toString())); + } + if ((jsonObj.get("Algo") != null && !jsonObj.get("Algo").isJsonNull()) && !jsonObj.get("Algo").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Algo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Algo").toString())); + } + if ((jsonObj.get("Key") != null && !jsonObj.get("Key").isJsonNull()) && !jsonObj.get("Key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Key").toString())); + } + if ((jsonObj.get("TokenQueryParameterName") != null && !jsonObj.get("TokenQueryParameterName").isJsonNull()) && !jsonObj.get("TokenQueryParameterName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TokenQueryParameterName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TokenQueryParameterName").toString())); + } + if ((jsonObj.get("LoginUrl") != null && !jsonObj.get("LoginUrl").isJsonNull()) && !jsonObj.get("LoginUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LoginUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LoginUrl").toString())); + } + // validate the optional field `Issuer` + if (jsonObj.get("Issuer") != null && !jsonObj.get("Issuer").isJsonNull()) { + JwtClaimSubjectProperty.validateJsonElement(jsonObj.get("Issuer")); + } + // validate the optional field `Subject` + if (jsonObj.get("Subject") != null && !jsonObj.get("Subject").isJsonNull()) { + JwtClaimMandatory.validateJsonElement(jsonObj.get("Subject")); + } + // validate the optional field `Audience` + if (jsonObj.get("Audience") != null && !jsonObj.get("Audience").isJsonNull()) { + JwtClaimAudienceProperty.validateJsonElement(jsonObj.get("Audience")); + } + // validate the optional field `NotBefore` + if (jsonObj.get("NotBefore") != null && !jsonObj.get("NotBefore").isJsonNull()) { + JwtClaimMandatory.validateJsonElement(jsonObj.get("NotBefore")); + } + // validate the optional field `Expiration` + if (jsonObj.get("Expiration") != null && !jsonObj.get("Expiration").isJsonNull()) { + JwtClaimMandatory.validateJsonElement(jsonObj.get("Expiration")); + } + if ((jsonObj.get("JWKSUrl") != null && !jsonObj.get("JWKSUrl").isJsonNull()) && !jsonObj.get("JWKSUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `JWKSUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("JWKSUrl").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("RaasUpdateFields") != null && !jsonObj.get("RaasUpdateFields").isJsonNull() && !jsonObj.get("RaasUpdateFields").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RaasUpdateFields` to be an array in the JSON string but got `%s`", jsonObj.get("RaasUpdateFields").toString())); + } + if ((jsonObj.get("Domain") != null && !jsonObj.get("Domain").isJsonNull()) && !jsonObj.get("Domain").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Domain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Domain").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!CreateJwtSPClientConfigurationRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateJwtSPClientConfigurationRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<CreateJwtSPClientConfigurationRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateJwtSPClientConfigurationRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<CreateJwtSPClientConfigurationRequest>() { + @Override + public void write(JsonWriter out, CreateJwtSPClientConfigurationRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CreateJwtSPClientConfigurationRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateJwtSPClientConfigurationRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateJwtSPClientConfigurationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateJwtSPClientConfigurationRequest + * @throws IOException if the JSON string is invalid with respect to CreateJwtSPClientConfigurationRequest + */ + public static CreateJwtSPClientConfigurationRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateJwtSPClientConfigurationRequest.class); + } + + /** + * Convert an instance of CreateJwtSPClientConfigurationRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/CreateOAuthClientConfigurationRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/CreateOAuthClientConfigurationRequest.java new file mode 100644 index 0000000..da57a0c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/CreateOAuthClientConfigurationRequest.java @@ -0,0 +1,1415 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.OAuthClientRequestBackChannelLogout; +import com.loginradius.sdk.internal.openapi.model.OAuthClientRequestConnections; +import com.loginradius.sdk.internal.openapi.model.OAuthClientRequestDeviceCodeConfig; +import com.loginradius.sdk.internal.openapi.model.OAuthClientRequestJwtTokenConfig; +import com.loginradius.sdk.internal.openapi.model.OAuthClientResponseRefreshTokenRotation; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * CreateOAuthClientConfigurationRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class CreateOAuthClientConfigurationRequest { + public static final String SERIALIZED_NAME_APP_NAME = "AppName"; + @SerializedName(SERIALIZED_NAME_APP_NAME) + @javax.annotation.Nonnull + private String appName; + + public static final String SERIALIZED_NAME_ALLOWED_CORS_ORIGIN = "AllowedCorsOrigin"; + @SerializedName(SERIALIZED_NAME_ALLOWED_CORS_ORIGIN) + @javax.annotation.Nullable + private List<String> allowedCorsOrigin = new ArrayList<>(); + + /** + * Gets or Sets allowedScopes + */ + @JsonAdapter(AllowedScopesEnum.Adapter.class) + public enum AllowedScopesEnum { + EMAIL("email"), + + PHONE("phone"), + + PROFILE("profile"), + + ADDRESS("address"); + + private String value; + + AllowedScopesEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AllowedScopesEnum fromValue(String value) { + for (AllowedScopesEnum b : AllowedScopesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<AllowedScopesEnum> { + @Override + public void write(final JsonWriter jsonWriter, final AllowedScopesEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AllowedScopesEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AllowedScopesEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AllowedScopesEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ALLOWED_SCOPES = "AllowedScopes"; + @SerializedName(SERIALIZED_NAME_ALLOWED_SCOPES) + @javax.annotation.Nullable + private List<AllowedScopesEnum> allowedScopes = new ArrayList<>(); + + public static final String SERIALIZED_NAME_AUDIENCE_SCOPES = "AudienceScopes"; + @SerializedName(SERIALIZED_NAME_AUDIENCE_SCOPES) + @javax.annotation.Nullable + private Map<String, List<String>> audienceScopes = new HashMap<>(); + + public static final String SERIALIZED_NAME_BACK_CHANNEL_LOGOUT = "BackChannelLogout"; + @SerializedName(SERIALIZED_NAME_BACK_CHANNEL_LOGOUT) + @javax.annotation.Nullable + private OAuthClientRequestBackChannelLogout backChannelLogout; + + /** + * Whether the client can keep a secret confidential. `confidential` clients (server-side / M2M) authenticate with their secret; `public` clients (SPA / native) default to token endpoint auth method `none` and rely on PKCE. When omitted it is derived server-side from the resolved token endpoint auth method. + */ + @JsonAdapter(ClientTypeEnum.Adapter.class) + public enum ClientTypeEnum { + PUBLIC("public"), + + CONFIDENTIAL("confidential"); + + private String value; + + ClientTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ClientTypeEnum fromValue(String value) { + for (ClientTypeEnum b : ClientTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<ClientTypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final ClientTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ClientTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ClientTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ClientTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CLIENT_TYPE = "ClientType"; + @SerializedName(SERIALIZED_NAME_CLIENT_TYPE) + @javax.annotation.Nullable + private ClientTypeEnum clientType; + + public static final String SERIALIZED_NAME_CONNECTIONS = "Connections"; + @SerializedName(SERIALIZED_NAME_CONNECTIONS) + @javax.annotation.Nullable + private OAuthClientRequestConnections connections; + + public static final String SERIALIZED_NAME_DESCRIPTION = "Description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_DEVICE_CODE_CONFIG = "DeviceCodeConfig"; + @SerializedName(SERIALIZED_NAME_DEVICE_CODE_CONFIG) + @javax.annotation.Nullable + private OAuthClientRequestDeviceCodeConfig deviceCodeConfig; + + public static final String SERIALIZED_NAME_ENABLE_CORS_ORIGIN = "EnableCorsOrigin"; + @SerializedName(SERIALIZED_NAME_ENABLE_CORS_ORIGIN) + @javax.annotation.Nullable + private Boolean enableCorsOrigin; + + public static final String SERIALIZED_NAME_FORCE_RE_AUTHENTICATION = "ForceReAuthentication"; + @SerializedName(SERIALIZED_NAME_FORCE_RE_AUTHENTICATION) + @javax.annotation.Nullable + private Boolean forceReAuthentication; + + /** + * Gets or Sets grantTypes + */ + @JsonAdapter(GrantTypesEnum.Adapter.class) + public enum GrantTypesEnum { + AUTHORIZATION_CODE("authorization_code"), + + IMPLICIT("implicit"), + + PASSWORD("password"), + + CLIENT_CREDENTIALS("client_credentials"), + + REFRESH_TOKEN("refresh_token"), + + URN_IETF_PARAMS_OAUTH_GRANT_TYPE_DEVICE_CODE("urn:ietf:params:oauth:grant-type:device_code"), + + HTTP_LOGINRADIUS_COM_OAUTH_GRANT_TYPE_EXCHANGE_TOKEN("http://loginradius.com/oauth/grant-type/exchange_token"); + + private String value; + + GrantTypesEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static GrantTypesEnum fromValue(String value) { + for (GrantTypesEnum b : GrantTypesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<GrantTypesEnum> { + @Override + public void write(final JsonWriter jsonWriter, final GrantTypesEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public GrantTypesEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return GrantTypesEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + GrantTypesEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_GRANT_TYPES = "GrantTypes"; + @SerializedName(SERIALIZED_NAME_GRANT_TYPES) + @javax.annotation.Nullable + private List<GrantTypesEnum> grantTypes = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ID_TOKEN_AUDIENCES = "IdTokenAudiences"; + @SerializedName(SERIALIZED_NAME_ID_TOKEN_AUDIENCES) + @javax.annotation.Nullable + private List<String> idTokenAudiences = new ArrayList<>(); + + public static final String SERIALIZED_NAME_JWT_TOKEN_CONFIG = "JwtTokenConfig"; + @SerializedName(SERIALIZED_NAME_JWT_TOKEN_CONFIG) + @javax.annotation.Nullable + private OAuthClientRequestJwtTokenConfig jwtTokenConfig; + + public static final String SERIALIZED_NAME_LOGIN_URL = "LoginUrl"; + @SerializedName(SERIALIZED_NAME_LOGIN_URL) + @javax.annotation.Nullable + private String loginUrl; + + public static final String SERIALIZED_NAME_LOGIN_REDIRECT_URI = "LoginRedirectUri"; + @SerializedName(SERIALIZED_NAME_LOGIN_REDIRECT_URI) + @javax.annotation.Nullable + private List<String> loginRedirectUri = new ArrayList<>(); + + public static final String SERIALIZED_NAME_LOGOUT_REDIRECT_URI = "LogoutRedirectUri"; + @SerializedName(SERIALIZED_NAME_LOGOUT_REDIRECT_URI) + @javax.annotation.Nullable + private List<String> logoutRedirectUri = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ACCESS_TOKEN_MAPPING_TEMPLATE = "AccessTokenMappingTemplate"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN_MAPPING_TEMPLATE) + @javax.annotation.Nullable + private String accessTokenMappingTemplate; + + public static final String SERIALIZED_NAME_ID_TOKEN_MAPPING_TEMPLATE = "IdTokenMappingTemplate"; + @SerializedName(SERIALIZED_NAME_ID_TOKEN_MAPPING_TEMPLATE) + @javax.annotation.Nullable + private String idTokenMappingTemplate; + + public static final String SERIALIZED_NAME_MAPPING = "Mapping"; + @SerializedName(SERIALIZED_NAME_MAPPING) + @javax.annotation.Nullable + private Map<String, String> mapping = new HashMap<>(); + + public static final String SERIALIZED_NAME_METADATA = "Metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + @javax.annotation.Nullable + private Map<String, String> metadata = new HashMap<>(); + + public static final String SERIALIZED_NAME_REDIRECT_U_R_I_EXACT_MATCH = "RedirectURIExactMatch"; + @SerializedName(SERIALIZED_NAME_REDIRECT_U_R_I_EXACT_MATCH) + @javax.annotation.Nullable + private Boolean redirectURIExactMatch; + + public static final String SERIALIZED_NAME_REFRESH_TOKEN_ROTATION = "RefreshTokenRotation"; + @SerializedName(SERIALIZED_NAME_REFRESH_TOKEN_ROTATION) + @javax.annotation.Nullable + private OAuthClientResponseRefreshTokenRotation refreshTokenRotation; + + public static final String SERIALIZED_NAME_REFRESH_TOKEN_T_T_L = "RefreshTokenTTL"; + @SerializedName(SERIALIZED_NAME_REFRESH_TOKEN_T_T_L) + @javax.annotation.Nullable + private Integer refreshTokenTTL; + + public static final String SERIALIZED_NAME_SESSION_TOKEN_T_T_L = "SessionTokenTTL"; + @SerializedName(SERIALIZED_NAME_SESSION_TOKEN_T_T_L) + @javax.annotation.Nullable + private Integer sessionTokenTTL; + + public static final String SERIALIZED_NAME_SECRET = "Secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + @javax.annotation.Nullable + private String secret; + + public static final String SERIALIZED_NAME_SIGNED_USER_INFO = "SignedUserInfo"; + @SerializedName(SERIALIZED_NAME_SIGNED_USER_INFO) + @javax.annotation.Nullable + private Boolean signedUserInfo; + + /** + * Gets or Sets tokenAuthMethod + */ + @JsonAdapter(TokenAuthMethodEnum.Adapter.class) + public enum TokenAuthMethodEnum { + CLIENT_SECRET_BASIC("client_secret_basic"), + + CLIENT_SECRET_POST("client_secret_post"), + + CLIENT_SECRET_AUTO("client_secret_auto"), + + NONE("none"); + + private String value; + + TokenAuthMethodEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TokenAuthMethodEnum fromValue(String value) { + for (TokenAuthMethodEnum b : TokenAuthMethodEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<TokenAuthMethodEnum> { + @Override + public void write(final JsonWriter jsonWriter, final TokenAuthMethodEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TokenAuthMethodEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TokenAuthMethodEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TokenAuthMethodEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TOKEN_AUTH_METHOD = "TokenAuthMethod"; + @SerializedName(SERIALIZED_NAME_TOKEN_AUTH_METHOD) + @javax.annotation.Nonnull + private TokenAuthMethodEnum tokenAuthMethod; + + public CreateOAuthClientConfigurationRequest() { + } + + public CreateOAuthClientConfigurationRequest appName(@javax.annotation.Nonnull String appName) { + this.appName = appName; + return this; + } + + /** + * Get appName + * @return appName + */ + @javax.annotation.Nonnull + public String getAppName() { + return appName; + } + + public void setAppName(@javax.annotation.Nonnull String appName) { + this.appName = appName; + } + + + public CreateOAuthClientConfigurationRequest allowedCorsOrigin(@javax.annotation.Nullable List<String> allowedCorsOrigin) { + this.allowedCorsOrigin = allowedCorsOrigin; + return this; + } + + public CreateOAuthClientConfigurationRequest addAllowedCorsOriginItem(String allowedCorsOriginItem) { + if (this.allowedCorsOrigin == null) { + this.allowedCorsOrigin = new ArrayList<>(); + } + this.allowedCorsOrigin.add(allowedCorsOriginItem); + return this; + } + + /** + * Get allowedCorsOrigin + * @return allowedCorsOrigin + */ + @javax.annotation.Nullable + public List<String> getAllowedCorsOrigin() { + return allowedCorsOrigin; + } + + public void setAllowedCorsOrigin(@javax.annotation.Nullable List<String> allowedCorsOrigin) { + this.allowedCorsOrigin = allowedCorsOrigin; + } + + + public CreateOAuthClientConfigurationRequest allowedScopes(@javax.annotation.Nullable List<AllowedScopesEnum> allowedScopes) { + this.allowedScopes = allowedScopes; + return this; + } + + public CreateOAuthClientConfigurationRequest addAllowedScopesItem(AllowedScopesEnum allowedScopesItem) { + if (this.allowedScopes == null) { + this.allowedScopes = new ArrayList<>(); + } + this.allowedScopes.add(allowedScopesItem); + return this; + } + + /** + * Get allowedScopes + * @return allowedScopes + */ + @javax.annotation.Nullable + public List<AllowedScopesEnum> getAllowedScopes() { + return allowedScopes; + } + + public void setAllowedScopes(@javax.annotation.Nullable List<AllowedScopesEnum> allowedScopes) { + this.allowedScopes = allowedScopes; + } + + + public CreateOAuthClientConfigurationRequest audienceScopes(@javax.annotation.Nullable Map<String, List<String>> audienceScopes) { + this.audienceScopes = audienceScopes; + return this; + } + + public CreateOAuthClientConfigurationRequest putAudienceScopesItem(String key, List<String> audienceScopesItem) { + if (this.audienceScopes == null) { + this.audienceScopes = new HashMap<>(); + } + this.audienceScopes.put(key, audienceScopesItem); + return this; + } + + /** + * Get audienceScopes + * @return audienceScopes + */ + @javax.annotation.Nullable + public Map<String, List<String>> getAudienceScopes() { + return audienceScopes; + } + + public void setAudienceScopes(@javax.annotation.Nullable Map<String, List<String>> audienceScopes) { + this.audienceScopes = audienceScopes; + } + + + public CreateOAuthClientConfigurationRequest backChannelLogout(@javax.annotation.Nullable OAuthClientRequestBackChannelLogout backChannelLogout) { + this.backChannelLogout = backChannelLogout; + return this; + } + + /** + * Get backChannelLogout + * @return backChannelLogout + */ + @javax.annotation.Nullable + public OAuthClientRequestBackChannelLogout getBackChannelLogout() { + return backChannelLogout; + } + + public void setBackChannelLogout(@javax.annotation.Nullable OAuthClientRequestBackChannelLogout backChannelLogout) { + this.backChannelLogout = backChannelLogout; + } + + + public CreateOAuthClientConfigurationRequest clientType(@javax.annotation.Nullable ClientTypeEnum clientType) { + this.clientType = clientType; + return this; + } + + /** + * Whether the client can keep a secret confidential. `confidential` clients (server-side / M2M) authenticate with their secret; `public` clients (SPA / native) default to token endpoint auth method `none` and rely on PKCE. When omitted it is derived server-side from the resolved token endpoint auth method. + * @return clientType + */ + @javax.annotation.Nullable + public ClientTypeEnum getClientType() { + return clientType; + } + + public void setClientType(@javax.annotation.Nullable ClientTypeEnum clientType) { + this.clientType = clientType; + } + + + public CreateOAuthClientConfigurationRequest connections(@javax.annotation.Nullable OAuthClientRequestConnections connections) { + this.connections = connections; + return this; + } + + /** + * Get connections + * @return connections + */ + @javax.annotation.Nullable + public OAuthClientRequestConnections getConnections() { + return connections; + } + + public void setConnections(@javax.annotation.Nullable OAuthClientRequestConnections connections) { + this.connections = connections; + } + + + public CreateOAuthClientConfigurationRequest description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Optional free-text description of the application, shown only in the admin console (never exposed to end users). + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public CreateOAuthClientConfigurationRequest deviceCodeConfig(@javax.annotation.Nullable OAuthClientRequestDeviceCodeConfig deviceCodeConfig) { + this.deviceCodeConfig = deviceCodeConfig; + return this; + } + + /** + * Get deviceCodeConfig + * @return deviceCodeConfig + */ + @javax.annotation.Nullable + public OAuthClientRequestDeviceCodeConfig getDeviceCodeConfig() { + return deviceCodeConfig; + } + + public void setDeviceCodeConfig(@javax.annotation.Nullable OAuthClientRequestDeviceCodeConfig deviceCodeConfig) { + this.deviceCodeConfig = deviceCodeConfig; + } + + + public CreateOAuthClientConfigurationRequest enableCorsOrigin(@javax.annotation.Nullable Boolean enableCorsOrigin) { + this.enableCorsOrigin = enableCorsOrigin; + return this; + } + + /** + * Get enableCorsOrigin + * @return enableCorsOrigin + */ + @javax.annotation.Nullable + public Boolean getEnableCorsOrigin() { + return enableCorsOrigin; + } + + public void setEnableCorsOrigin(@javax.annotation.Nullable Boolean enableCorsOrigin) { + this.enableCorsOrigin = enableCorsOrigin; + } + + + public CreateOAuthClientConfigurationRequest forceReAuthentication(@javax.annotation.Nullable Boolean forceReAuthentication) { + this.forceReAuthentication = forceReAuthentication; + return this; + } + + /** + * Get forceReAuthentication + * @return forceReAuthentication + */ + @javax.annotation.Nullable + public Boolean getForceReAuthentication() { + return forceReAuthentication; + } + + public void setForceReAuthentication(@javax.annotation.Nullable Boolean forceReAuthentication) { + this.forceReAuthentication = forceReAuthentication; + } + + + public CreateOAuthClientConfigurationRequest grantTypes(@javax.annotation.Nullable List<GrantTypesEnum> grantTypes) { + this.grantTypes = grantTypes; + return this; + } + + public CreateOAuthClientConfigurationRequest addGrantTypesItem(GrantTypesEnum grantTypesItem) { + if (this.grantTypes == null) { + this.grantTypes = new ArrayList<>(); + } + this.grantTypes.add(grantTypesItem); + return this; + } + + /** + * Get grantTypes + * @return grantTypes + */ + @javax.annotation.Nullable + public List<GrantTypesEnum> getGrantTypes() { + return grantTypes; + } + + public void setGrantTypes(@javax.annotation.Nullable List<GrantTypesEnum> grantTypes) { + this.grantTypes = grantTypes; + } + + + public CreateOAuthClientConfigurationRequest idTokenAudiences(@javax.annotation.Nullable List<String> idTokenAudiences) { + this.idTokenAudiences = idTokenAudiences; + return this; + } + + public CreateOAuthClientConfigurationRequest addIdTokenAudiencesItem(String idTokenAudiencesItem) { + if (this.idTokenAudiences == null) { + this.idTokenAudiences = new ArrayList<>(); + } + this.idTokenAudiences.add(idTokenAudiencesItem); + return this; + } + + /** + * Get idTokenAudiences + * @return idTokenAudiences + */ + @javax.annotation.Nullable + public List<String> getIdTokenAudiences() { + return idTokenAudiences; + } + + public void setIdTokenAudiences(@javax.annotation.Nullable List<String> idTokenAudiences) { + this.idTokenAudiences = idTokenAudiences; + } + + + public CreateOAuthClientConfigurationRequest jwtTokenConfig(@javax.annotation.Nullable OAuthClientRequestJwtTokenConfig jwtTokenConfig) { + this.jwtTokenConfig = jwtTokenConfig; + return this; + } + + /** + * Get jwtTokenConfig + * @return jwtTokenConfig + */ + @javax.annotation.Nullable + public OAuthClientRequestJwtTokenConfig getJwtTokenConfig() { + return jwtTokenConfig; + } + + public void setJwtTokenConfig(@javax.annotation.Nullable OAuthClientRequestJwtTokenConfig jwtTokenConfig) { + this.jwtTokenConfig = jwtTokenConfig; + } + + + public CreateOAuthClientConfigurationRequest loginUrl(@javax.annotation.Nullable String loginUrl) { + this.loginUrl = loginUrl; + return this; + } + + /** + * Get loginUrl + * @return loginUrl + */ + @javax.annotation.Nullable + public String getLoginUrl() { + return loginUrl; + } + + public void setLoginUrl(@javax.annotation.Nullable String loginUrl) { + this.loginUrl = loginUrl; + } + + + public CreateOAuthClientConfigurationRequest loginRedirectUri(@javax.annotation.Nullable List<String> loginRedirectUri) { + this.loginRedirectUri = loginRedirectUri; + return this; + } + + public CreateOAuthClientConfigurationRequest addLoginRedirectUriItem(String loginRedirectUriItem) { + if (this.loginRedirectUri == null) { + this.loginRedirectUri = new ArrayList<>(); + } + this.loginRedirectUri.add(loginRedirectUriItem); + return this; + } + + /** + * Get loginRedirectUri + * @return loginRedirectUri + */ + @javax.annotation.Nullable + public List<String> getLoginRedirectUri() { + return loginRedirectUri; + } + + public void setLoginRedirectUri(@javax.annotation.Nullable List<String> loginRedirectUri) { + this.loginRedirectUri = loginRedirectUri; + } + + + public CreateOAuthClientConfigurationRequest logoutRedirectUri(@javax.annotation.Nullable List<String> logoutRedirectUri) { + this.logoutRedirectUri = logoutRedirectUri; + return this; + } + + public CreateOAuthClientConfigurationRequest addLogoutRedirectUriItem(String logoutRedirectUriItem) { + if (this.logoutRedirectUri == null) { + this.logoutRedirectUri = new ArrayList<>(); + } + this.logoutRedirectUri.add(logoutRedirectUriItem); + return this; + } + + /** + * Get logoutRedirectUri + * @return logoutRedirectUri + */ + @javax.annotation.Nullable + public List<String> getLogoutRedirectUri() { + return logoutRedirectUri; + } + + public void setLogoutRedirectUri(@javax.annotation.Nullable List<String> logoutRedirectUri) { + this.logoutRedirectUri = logoutRedirectUri; + } + + + public CreateOAuthClientConfigurationRequest accessTokenMappingTemplate(@javax.annotation.Nullable String accessTokenMappingTemplate) { + this.accessTokenMappingTemplate = accessTokenMappingTemplate; + return this; + } + + /** + * Get accessTokenMappingTemplate + * @return accessTokenMappingTemplate + */ + @javax.annotation.Nullable + public String getAccessTokenMappingTemplate() { + return accessTokenMappingTemplate; + } + + public void setAccessTokenMappingTemplate(@javax.annotation.Nullable String accessTokenMappingTemplate) { + this.accessTokenMappingTemplate = accessTokenMappingTemplate; + } + + + public CreateOAuthClientConfigurationRequest idTokenMappingTemplate(@javax.annotation.Nullable String idTokenMappingTemplate) { + this.idTokenMappingTemplate = idTokenMappingTemplate; + return this; + } + + /** + * Get idTokenMappingTemplate + * @return idTokenMappingTemplate + */ + @javax.annotation.Nullable + public String getIdTokenMappingTemplate() { + return idTokenMappingTemplate; + } + + public void setIdTokenMappingTemplate(@javax.annotation.Nullable String idTokenMappingTemplate) { + this.idTokenMappingTemplate = idTokenMappingTemplate; + } + + + public CreateOAuthClientConfigurationRequest mapping(@javax.annotation.Nullable Map<String, String> mapping) { + this.mapping = mapping; + return this; + } + + public CreateOAuthClientConfigurationRequest putMappingItem(String key, String mappingItem) { + if (this.mapping == null) { + this.mapping = new HashMap<>(); + } + this.mapping.put(key, mappingItem); + return this; + } + + /** + * Get mapping + * @return mapping + */ + @javax.annotation.Nullable + public Map<String, String> getMapping() { + return mapping; + } + + public void setMapping(@javax.annotation.Nullable Map<String, String> mapping) { + this.mapping = mapping; + } + + + public CreateOAuthClientConfigurationRequest metadata(@javax.annotation.Nullable Map<String, String> metadata) { + this.metadata = metadata; + return this; + } + + public CreateOAuthClientConfigurationRequest putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Get metadata + * @return metadata + */ + @javax.annotation.Nullable + public Map<String, String> getMetadata() { + return metadata; + } + + public void setMetadata(@javax.annotation.Nullable Map<String, String> metadata) { + this.metadata = metadata; + } + + + public CreateOAuthClientConfigurationRequest redirectURIExactMatch(@javax.annotation.Nullable Boolean redirectURIExactMatch) { + this.redirectURIExactMatch = redirectURIExactMatch; + return this; + } + + /** + * Get redirectURIExactMatch + * @return redirectURIExactMatch + */ + @javax.annotation.Nullable + public Boolean getRedirectURIExactMatch() { + return redirectURIExactMatch; + } + + public void setRedirectURIExactMatch(@javax.annotation.Nullable Boolean redirectURIExactMatch) { + this.redirectURIExactMatch = redirectURIExactMatch; + } + + + public CreateOAuthClientConfigurationRequest refreshTokenRotation(@javax.annotation.Nullable OAuthClientResponseRefreshTokenRotation refreshTokenRotation) { + this.refreshTokenRotation = refreshTokenRotation; + return this; + } + + /** + * Get refreshTokenRotation + * @return refreshTokenRotation + */ + @javax.annotation.Nullable + public OAuthClientResponseRefreshTokenRotation getRefreshTokenRotation() { + return refreshTokenRotation; + } + + public void setRefreshTokenRotation(@javax.annotation.Nullable OAuthClientResponseRefreshTokenRotation refreshTokenRotation) { + this.refreshTokenRotation = refreshTokenRotation; + } + + + public CreateOAuthClientConfigurationRequest refreshTokenTTL(@javax.annotation.Nullable Integer refreshTokenTTL) { + this.refreshTokenTTL = refreshTokenTTL; + return this; + } + + /** + * Get refreshTokenTTL + * @return refreshTokenTTL + */ + @javax.annotation.Nullable + public Integer getRefreshTokenTTL() { + return refreshTokenTTL; + } + + public void setRefreshTokenTTL(@javax.annotation.Nullable Integer refreshTokenTTL) { + this.refreshTokenTTL = refreshTokenTTL; + } + + + public CreateOAuthClientConfigurationRequest sessionTokenTTL(@javax.annotation.Nullable Integer sessionTokenTTL) { + this.sessionTokenTTL = sessionTokenTTL; + return this; + } + + /** + * Get sessionTokenTTL + * @return sessionTokenTTL + */ + @javax.annotation.Nullable + public Integer getSessionTokenTTL() { + return sessionTokenTTL; + } + + public void setSessionTokenTTL(@javax.annotation.Nullable Integer sessionTokenTTL) { + this.sessionTokenTTL = sessionTokenTTL; + } + + + public CreateOAuthClientConfigurationRequest secret(@javax.annotation.Nullable String secret) { + this.secret = secret; + return this; + } + + /** + * Get secret + * @return secret + */ + @javax.annotation.Nullable + public String getSecret() { + return secret; + } + + public void setSecret(@javax.annotation.Nullable String secret) { + this.secret = secret; + } + + + public CreateOAuthClientConfigurationRequest signedUserInfo(@javax.annotation.Nullable Boolean signedUserInfo) { + this.signedUserInfo = signedUserInfo; + return this; + } + + /** + * Get signedUserInfo + * @return signedUserInfo + */ + @javax.annotation.Nullable + public Boolean getSignedUserInfo() { + return signedUserInfo; + } + + public void setSignedUserInfo(@javax.annotation.Nullable Boolean signedUserInfo) { + this.signedUserInfo = signedUserInfo; + } + + + public CreateOAuthClientConfigurationRequest tokenAuthMethod(@javax.annotation.Nonnull TokenAuthMethodEnum tokenAuthMethod) { + this.tokenAuthMethod = tokenAuthMethod; + return this; + } + + /** + * Get tokenAuthMethod + * @return tokenAuthMethod + */ + @javax.annotation.Nonnull + public TokenAuthMethodEnum getTokenAuthMethod() { + return tokenAuthMethod; + } + + public void setTokenAuthMethod(@javax.annotation.Nonnull TokenAuthMethodEnum tokenAuthMethod) { + this.tokenAuthMethod = tokenAuthMethod; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CreateOAuthClientConfigurationRequest instance itself + */ + public CreateOAuthClientConfigurationRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateOAuthClientConfigurationRequest createOAuthClientConfigurationRequest = (CreateOAuthClientConfigurationRequest) o; + return Objects.equals(this.appName, createOAuthClientConfigurationRequest.appName) && + Objects.equals(this.allowedCorsOrigin, createOAuthClientConfigurationRequest.allowedCorsOrigin) && + Objects.equals(this.allowedScopes, createOAuthClientConfigurationRequest.allowedScopes) && + Objects.equals(this.audienceScopes, createOAuthClientConfigurationRequest.audienceScopes) && + Objects.equals(this.backChannelLogout, createOAuthClientConfigurationRequest.backChannelLogout) && + Objects.equals(this.clientType, createOAuthClientConfigurationRequest.clientType) && + Objects.equals(this.connections, createOAuthClientConfigurationRequest.connections) && + Objects.equals(this.description, createOAuthClientConfigurationRequest.description) && + Objects.equals(this.deviceCodeConfig, createOAuthClientConfigurationRequest.deviceCodeConfig) && + Objects.equals(this.enableCorsOrigin, createOAuthClientConfigurationRequest.enableCorsOrigin) && + Objects.equals(this.forceReAuthentication, createOAuthClientConfigurationRequest.forceReAuthentication) && + Objects.equals(this.grantTypes, createOAuthClientConfigurationRequest.grantTypes) && + Objects.equals(this.idTokenAudiences, createOAuthClientConfigurationRequest.idTokenAudiences) && + Objects.equals(this.jwtTokenConfig, createOAuthClientConfigurationRequest.jwtTokenConfig) && + Objects.equals(this.loginUrl, createOAuthClientConfigurationRequest.loginUrl) && + Objects.equals(this.loginRedirectUri, createOAuthClientConfigurationRequest.loginRedirectUri) && + Objects.equals(this.logoutRedirectUri, createOAuthClientConfigurationRequest.logoutRedirectUri) && + Objects.equals(this.accessTokenMappingTemplate, createOAuthClientConfigurationRequest.accessTokenMappingTemplate) && + Objects.equals(this.idTokenMappingTemplate, createOAuthClientConfigurationRequest.idTokenMappingTemplate) && + Objects.equals(this.mapping, createOAuthClientConfigurationRequest.mapping) && + Objects.equals(this.metadata, createOAuthClientConfigurationRequest.metadata) && + Objects.equals(this.redirectURIExactMatch, createOAuthClientConfigurationRequest.redirectURIExactMatch) && + Objects.equals(this.refreshTokenRotation, createOAuthClientConfigurationRequest.refreshTokenRotation) && + Objects.equals(this.refreshTokenTTL, createOAuthClientConfigurationRequest.refreshTokenTTL) && + Objects.equals(this.sessionTokenTTL, createOAuthClientConfigurationRequest.sessionTokenTTL) && + Objects.equals(this.secret, createOAuthClientConfigurationRequest.secret) && + Objects.equals(this.signedUserInfo, createOAuthClientConfigurationRequest.signedUserInfo) && + Objects.equals(this.tokenAuthMethod, createOAuthClientConfigurationRequest.tokenAuthMethod)&& + Objects.equals(this.additionalProperties, createOAuthClientConfigurationRequest.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(appName, allowedCorsOrigin, allowedScopes, audienceScopes, backChannelLogout, clientType, connections, description, deviceCodeConfig, enableCorsOrigin, forceReAuthentication, grantTypes, idTokenAudiences, jwtTokenConfig, loginUrl, loginRedirectUri, logoutRedirectUri, accessTokenMappingTemplate, idTokenMappingTemplate, mapping, metadata, redirectURIExactMatch, refreshTokenRotation, refreshTokenTTL, sessionTokenTTL, secret, signedUserInfo, tokenAuthMethod, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateOAuthClientConfigurationRequest {\n"); + sb.append(" appName: ").append(toIndentedString(appName)).append("\n"); + sb.append(" allowedCorsOrigin: ").append(toIndentedString(allowedCorsOrigin)).append("\n"); + sb.append(" allowedScopes: ").append(toIndentedString(allowedScopes)).append("\n"); + sb.append(" audienceScopes: ").append(toIndentedString(audienceScopes)).append("\n"); + sb.append(" backChannelLogout: ").append(toIndentedString(backChannelLogout)).append("\n"); + sb.append(" clientType: ").append(toIndentedString(clientType)).append("\n"); + sb.append(" connections: ").append(toIndentedString(connections)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" deviceCodeConfig: ").append(toIndentedString(deviceCodeConfig)).append("\n"); + sb.append(" enableCorsOrigin: ").append(toIndentedString(enableCorsOrigin)).append("\n"); + sb.append(" forceReAuthentication: ").append(toIndentedString(forceReAuthentication)).append("\n"); + sb.append(" grantTypes: ").append(toIndentedString(grantTypes)).append("\n"); + sb.append(" idTokenAudiences: ").append(toIndentedString(idTokenAudiences)).append("\n"); + sb.append(" jwtTokenConfig: ").append(toIndentedString(jwtTokenConfig)).append("\n"); + sb.append(" loginUrl: ").append(toIndentedString(loginUrl)).append("\n"); + sb.append(" loginRedirectUri: ").append(toIndentedString(loginRedirectUri)).append("\n"); + sb.append(" logoutRedirectUri: ").append(toIndentedString(logoutRedirectUri)).append("\n"); + sb.append(" accessTokenMappingTemplate: ").append(toIndentedString(accessTokenMappingTemplate)).append("\n"); + sb.append(" idTokenMappingTemplate: ").append(toIndentedString(idTokenMappingTemplate)).append("\n"); + sb.append(" mapping: ").append(toIndentedString(mapping)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" redirectURIExactMatch: ").append(toIndentedString(redirectURIExactMatch)).append("\n"); + sb.append(" refreshTokenRotation: ").append(toIndentedString(refreshTokenRotation)).append("\n"); + sb.append(" refreshTokenTTL: ").append(toIndentedString(refreshTokenTTL)).append("\n"); + sb.append(" sessionTokenTTL: ").append(toIndentedString(sessionTokenTTL)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" signedUserInfo: ").append(toIndentedString(signedUserInfo)).append("\n"); + sb.append(" tokenAuthMethod: ").append(toIndentedString(tokenAuthMethod)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AppName"); + openapiFields.add("AllowedCorsOrigin"); + openapiFields.add("AllowedScopes"); + openapiFields.add("AudienceScopes"); + openapiFields.add("BackChannelLogout"); + openapiFields.add("ClientType"); + openapiFields.add("Connections"); + openapiFields.add("Description"); + openapiFields.add("DeviceCodeConfig"); + openapiFields.add("EnableCorsOrigin"); + openapiFields.add("ForceReAuthentication"); + openapiFields.add("GrantTypes"); + openapiFields.add("IdTokenAudiences"); + openapiFields.add("JwtTokenConfig"); + openapiFields.add("LoginUrl"); + openapiFields.add("LoginRedirectUri"); + openapiFields.add("LogoutRedirectUri"); + openapiFields.add("AccessTokenMappingTemplate"); + openapiFields.add("IdTokenMappingTemplate"); + openapiFields.add("Mapping"); + openapiFields.add("Metadata"); + openapiFields.add("RedirectURIExactMatch"); + openapiFields.add("RefreshTokenRotation"); + openapiFields.add("RefreshTokenTTL"); + openapiFields.add("SessionTokenTTL"); + openapiFields.add("Secret"); + openapiFields.add("SignedUserInfo"); + openapiFields.add("TokenAuthMethod"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("AppName"); + openapiRequiredFields.add("TokenAuthMethod"); + } + + /** + * 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 CreateOAuthClientConfigurationRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateOAuthClientConfigurationRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateOAuthClientConfigurationRequest is not found in the empty JSON string", CreateOAuthClientConfigurationRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateOAuthClientConfigurationRequest.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("AppName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AppName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AppName").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("AllowedCorsOrigin") != null && !jsonObj.get("AllowedCorsOrigin").isJsonNull() && !jsonObj.get("AllowedCorsOrigin").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `AllowedCorsOrigin` to be an array in the JSON string but got `%s`", jsonObj.get("AllowedCorsOrigin").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("AllowedScopes") != null && !jsonObj.get("AllowedScopes").isJsonNull() && !jsonObj.get("AllowedScopes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `AllowedScopes` to be an array in the JSON string but got `%s`", jsonObj.get("AllowedScopes").toString())); + } + // validate the optional field `BackChannelLogout` + if (jsonObj.get("BackChannelLogout") != null && !jsonObj.get("BackChannelLogout").isJsonNull()) { + OAuthClientRequestBackChannelLogout.validateJsonElement(jsonObj.get("BackChannelLogout")); + } + if ((jsonObj.get("ClientType") != null && !jsonObj.get("ClientType").isJsonNull()) && !jsonObj.get("ClientType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ClientType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ClientType").toString())); + } + // validate the optional field `ClientType` + if (jsonObj.get("ClientType") != null && !jsonObj.get("ClientType").isJsonNull()) { + ClientTypeEnum.validateJsonElement(jsonObj.get("ClientType")); + } + // validate the optional field `Connections` + if (jsonObj.get("Connections") != null && !jsonObj.get("Connections").isJsonNull()) { + OAuthClientRequestConnections.validateJsonElement(jsonObj.get("Connections")); + } + if ((jsonObj.get("Description") != null && !jsonObj.get("Description").isJsonNull()) && !jsonObj.get("Description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Description").toString())); + } + // validate the optional field `DeviceCodeConfig` + if (jsonObj.get("DeviceCodeConfig") != null && !jsonObj.get("DeviceCodeConfig").isJsonNull()) { + OAuthClientRequestDeviceCodeConfig.validateJsonElement(jsonObj.get("DeviceCodeConfig")); + } + // ensure the optional json data is an array if present + if (jsonObj.get("GrantTypes") != null && !jsonObj.get("GrantTypes").isJsonNull() && !jsonObj.get("GrantTypes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `GrantTypes` to be an array in the JSON string but got `%s`", jsonObj.get("GrantTypes").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("IdTokenAudiences") != null && !jsonObj.get("IdTokenAudiences").isJsonNull() && !jsonObj.get("IdTokenAudiences").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `IdTokenAudiences` to be an array in the JSON string but got `%s`", jsonObj.get("IdTokenAudiences").toString())); + } + // validate the optional field `JwtTokenConfig` + if (jsonObj.get("JwtTokenConfig") != null && !jsonObj.get("JwtTokenConfig").isJsonNull()) { + OAuthClientRequestJwtTokenConfig.validateJsonElement(jsonObj.get("JwtTokenConfig")); + } + if ((jsonObj.get("LoginUrl") != null && !jsonObj.get("LoginUrl").isJsonNull()) && !jsonObj.get("LoginUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LoginUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LoginUrl").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("LoginRedirectUri") != null && !jsonObj.get("LoginRedirectUri").isJsonNull() && !jsonObj.get("LoginRedirectUri").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `LoginRedirectUri` to be an array in the JSON string but got `%s`", jsonObj.get("LoginRedirectUri").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("LogoutRedirectUri") != null && !jsonObj.get("LogoutRedirectUri").isJsonNull() && !jsonObj.get("LogoutRedirectUri").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `LogoutRedirectUri` to be an array in the JSON string but got `%s`", jsonObj.get("LogoutRedirectUri").toString())); + } + if ((jsonObj.get("AccessTokenMappingTemplate") != null && !jsonObj.get("AccessTokenMappingTemplate").isJsonNull()) && !jsonObj.get("AccessTokenMappingTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccessTokenMappingTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccessTokenMappingTemplate").toString())); + } + if ((jsonObj.get("IdTokenMappingTemplate") != null && !jsonObj.get("IdTokenMappingTemplate").isJsonNull()) && !jsonObj.get("IdTokenMappingTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IdTokenMappingTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IdTokenMappingTemplate").toString())); + } + // validate the optional field `RefreshTokenRotation` + if (jsonObj.get("RefreshTokenRotation") != null && !jsonObj.get("RefreshTokenRotation").isJsonNull()) { + OAuthClientResponseRefreshTokenRotation.validateJsonElement(jsonObj.get("RefreshTokenRotation")); + } + if ((jsonObj.get("Secret") != null && !jsonObj.get("Secret").isJsonNull()) && !jsonObj.get("Secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Secret").toString())); + } + if (!jsonObj.get("TokenAuthMethod").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TokenAuthMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TokenAuthMethod").toString())); + } + // validate the required field `TokenAuthMethod` + TokenAuthMethodEnum.validateJsonElement(jsonObj.get("TokenAuthMethod")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!CreateOAuthClientConfigurationRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateOAuthClientConfigurationRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<CreateOAuthClientConfigurationRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateOAuthClientConfigurationRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<CreateOAuthClientConfigurationRequest>() { + @Override + public void write(JsonWriter out, CreateOAuthClientConfigurationRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CreateOAuthClientConfigurationRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateOAuthClientConfigurationRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateOAuthClientConfigurationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateOAuthClientConfigurationRequest + * @throws IOException if the JSON string is invalid with respect to CreateOAuthClientConfigurationRequest + */ + public static CreateOAuthClientConfigurationRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateOAuthClientConfigurationRequest.class); + } + + /** + * Convert an instance of CreateOAuthClientConfigurationRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/CreateOAuthIntegrationRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/CreateOAuthIntegrationRequest.java new file mode 100644 index 0000000..bf7a085 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/CreateOAuthIntegrationRequest.java @@ -0,0 +1,907 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.OAuthIntegrationBaseModelConnections; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * CreateOAuthIntegrationRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class CreateOAuthIntegrationRequest { + 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_REDIRECT_U_R_IS = "RedirectURIs"; + @SerializedName(SERIALIZED_NAME_REDIRECT_U_R_IS) + @javax.annotation.Nonnull + private List<String> redirectURIs = new ArrayList<>(); + + /** + * Gets or Sets allowedScopes + */ + @JsonAdapter(AllowedScopesEnum.Adapter.class) + public enum AllowedScopesEnum { + OPENID("openid"), + + EMAIL("email"), + + PHONE("phone"), + + PROFILE("profile"), + + ADDRESS("address"); + + private String value; + + AllowedScopesEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AllowedScopesEnum fromValue(String value) { + for (AllowedScopesEnum b : AllowedScopesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<AllowedScopesEnum> { + @Override + public void write(final JsonWriter jsonWriter, final AllowedScopesEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AllowedScopesEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AllowedScopesEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AllowedScopesEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ALLOWED_SCOPES = "AllowedScopes"; + @SerializedName(SERIALIZED_NAME_ALLOWED_SCOPES) + @javax.annotation.Nullable + private List<AllowedScopesEnum> allowedScopes = new ArrayList<>(); + + /** + * Gets or Sets grantTypes + */ + @JsonAdapter(GrantTypesEnum.Adapter.class) + public enum GrantTypesEnum { + AUTHORIZATION_CODE("authorization_code"), + + REFRESH_TOKEN("refresh_token"); + + private String value; + + GrantTypesEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static GrantTypesEnum fromValue(String value) { + for (GrantTypesEnum b : GrantTypesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<GrantTypesEnum> { + @Override + public void write(final JsonWriter jsonWriter, final GrantTypesEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public GrantTypesEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return GrantTypesEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + GrantTypesEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_GRANT_TYPES = "GrantTypes"; + @SerializedName(SERIALIZED_NAME_GRANT_TYPES) + @javax.annotation.Nonnull + private List<GrantTypesEnum> grantTypes = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ACCESS_TOKEN_MAPPING_TEMPLATE = "AccessTokenMappingTemplate"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN_MAPPING_TEMPLATE) + @javax.annotation.Nullable + private String accessTokenMappingTemplate; + + public static final String SERIALIZED_NAME_ID_TOKEN_MAPPING_TEMPLATE = "IdTokenMappingTemplate"; + @SerializedName(SERIALIZED_NAME_ID_TOKEN_MAPPING_TEMPLATE) + @javax.annotation.Nullable + private String idTokenMappingTemplate; + + public static final String SERIALIZED_NAME_ACCESS_TOKEN_T_T_L = "AccessTokenTTL"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN_T_T_L) + @javax.annotation.Nullable + private Integer accessTokenTTL = 3600; + + public static final String SERIALIZED_NAME_ID_TOKEN_T_T_L = "IDTokenTTL"; + @SerializedName(SERIALIZED_NAME_ID_TOKEN_T_T_L) + @javax.annotation.Nullable + private Integer idTokenTTL = 3600; + + public static final String SERIALIZED_NAME_REFRESH_TOKEN_T_T_L = "RefreshTokenTTL"; + @SerializedName(SERIALIZED_NAME_REFRESH_TOKEN_T_T_L) + @javax.annotation.Nullable + private Integer refreshTokenTTL = 86400; + + public static final String SERIALIZED_NAME_ENABLE_P_K_C_E = "EnablePKCE"; + @SerializedName(SERIALIZED_NAME_ENABLE_P_K_C_E) + @javax.annotation.Nullable + private Boolean enablePKCE; + + public static final String SERIALIZED_NAME_IS_PREBUILT_INTEGRATION = "IsPrebuiltIntegration"; + @SerializedName(SERIALIZED_NAME_IS_PREBUILT_INTEGRATION) + @javax.annotation.Nullable + private Boolean isPrebuiltIntegration; + + public static final String SERIALIZED_NAME_INTEGRATION_TYPE = "IntegrationType"; + @SerializedName(SERIALIZED_NAME_INTEGRATION_TYPE) + @javax.annotation.Nullable + private String integrationType; + + /** + * Token-endpoint client authentication method. Defaults to client_secret_post when omitted. + */ + @JsonAdapter(TokenAuthMethodEnum.Adapter.class) + public enum TokenAuthMethodEnum { + CLIENT_SECRET_BASIC("client_secret_basic"), + + CLIENT_SECRET_POST("client_secret_post"), + + CLIENT_SECRET_AUTO("client_secret_auto"), + + NONE("none"); + + private String value; + + TokenAuthMethodEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TokenAuthMethodEnum fromValue(String value) { + for (TokenAuthMethodEnum b : TokenAuthMethodEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<TokenAuthMethodEnum> { + @Override + public void write(final JsonWriter jsonWriter, final TokenAuthMethodEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TokenAuthMethodEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TokenAuthMethodEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TokenAuthMethodEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TOKEN_AUTH_METHOD = "TokenAuthMethod"; + @SerializedName(SERIALIZED_NAME_TOKEN_AUTH_METHOD) + @javax.annotation.Nullable + private TokenAuthMethodEnum tokenAuthMethod = TokenAuthMethodEnum.CLIENT_SECRET_POST; + + public static final String SERIALIZED_NAME_DEFAULT_WORKFLOW = "DefaultWorkflow"; + @SerializedName(SERIALIZED_NAME_DEFAULT_WORKFLOW) + @javax.annotation.Nullable + private String defaultWorkflow; + + public static final String SERIALIZED_NAME_CONNECTIONS = "Connections"; + @SerializedName(SERIALIZED_NAME_CONNECTIONS) + @javax.annotation.Nullable + private OAuthIntegrationBaseModelConnections connections; + + public CreateOAuthIntegrationRequest() { + } + + public CreateOAuthIntegrationRequest displayName(@javax.annotation.Nonnull String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get displayName + * @return displayName + */ + @javax.annotation.Nonnull + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(@javax.annotation.Nonnull String displayName) { + this.displayName = displayName; + } + + + public CreateOAuthIntegrationRequest redirectURIs(@javax.annotation.Nonnull List<String> redirectURIs) { + this.redirectURIs = redirectURIs; + return this; + } + + public CreateOAuthIntegrationRequest addRedirectURIsItem(String redirectURIsItem) { + if (this.redirectURIs == null) { + this.redirectURIs = new ArrayList<>(); + } + this.redirectURIs.add(redirectURIsItem); + return this; + } + + /** + * Get redirectURIs + * @return redirectURIs + */ + @javax.annotation.Nonnull + public List<String> getRedirectURIs() { + return redirectURIs; + } + + public void setRedirectURIs(@javax.annotation.Nonnull List<String> redirectURIs) { + this.redirectURIs = redirectURIs; + } + + + public CreateOAuthIntegrationRequest allowedScopes(@javax.annotation.Nullable List<AllowedScopesEnum> allowedScopes) { + this.allowedScopes = allowedScopes; + return this; + } + + public CreateOAuthIntegrationRequest addAllowedScopesItem(AllowedScopesEnum allowedScopesItem) { + if (this.allowedScopes == null) { + this.allowedScopes = new ArrayList<>(); + } + this.allowedScopes.add(allowedScopesItem); + return this; + } + + /** + * Get allowedScopes + * @return allowedScopes + */ + @javax.annotation.Nullable + public List<AllowedScopesEnum> getAllowedScopes() { + return allowedScopes; + } + + public void setAllowedScopes(@javax.annotation.Nullable List<AllowedScopesEnum> allowedScopes) { + this.allowedScopes = allowedScopes; + } + + + public CreateOAuthIntegrationRequest grantTypes(@javax.annotation.Nonnull List<GrantTypesEnum> grantTypes) { + this.grantTypes = grantTypes; + return this; + } + + public CreateOAuthIntegrationRequest addGrantTypesItem(GrantTypesEnum grantTypesItem) { + if (this.grantTypes == null) { + this.grantTypes = new ArrayList<>(); + } + this.grantTypes.add(grantTypesItem); + return this; + } + + /** + * Only authorization_code and refresh_token are permitted for OAuth integrations. + * @return grantTypes + */ + @javax.annotation.Nonnull + public List<GrantTypesEnum> getGrantTypes() { + return grantTypes; + } + + public void setGrantTypes(@javax.annotation.Nonnull List<GrantTypesEnum> grantTypes) { + this.grantTypes = grantTypes; + } + + + public CreateOAuthIntegrationRequest accessTokenMappingTemplate(@javax.annotation.Nullable String accessTokenMappingTemplate) { + this.accessTokenMappingTemplate = accessTokenMappingTemplate; + return this; + } + + /** + * Get accessTokenMappingTemplate + * @return accessTokenMappingTemplate + */ + @javax.annotation.Nullable + public String getAccessTokenMappingTemplate() { + return accessTokenMappingTemplate; + } + + public void setAccessTokenMappingTemplate(@javax.annotation.Nullable String accessTokenMappingTemplate) { + this.accessTokenMappingTemplate = accessTokenMappingTemplate; + } + + + public CreateOAuthIntegrationRequest idTokenMappingTemplate(@javax.annotation.Nullable String idTokenMappingTemplate) { + this.idTokenMappingTemplate = idTokenMappingTemplate; + return this; + } + + /** + * Get idTokenMappingTemplate + * @return idTokenMappingTemplate + */ + @javax.annotation.Nullable + public String getIdTokenMappingTemplate() { + return idTokenMappingTemplate; + } + + public void setIdTokenMappingTemplate(@javax.annotation.Nullable String idTokenMappingTemplate) { + this.idTokenMappingTemplate = idTokenMappingTemplate; + } + + + public CreateOAuthIntegrationRequest accessTokenTTL(@javax.annotation.Nullable Integer accessTokenTTL) { + this.accessTokenTTL = accessTokenTTL; + return this; + } + + /** + * Access token lifetime in seconds. Defaults to 3600 when omitted. + * @return accessTokenTTL + */ + @javax.annotation.Nullable + public Integer getAccessTokenTTL() { + return accessTokenTTL; + } + + public void setAccessTokenTTL(@javax.annotation.Nullable Integer accessTokenTTL) { + this.accessTokenTTL = accessTokenTTL; + } + + + public CreateOAuthIntegrationRequest idTokenTTL(@javax.annotation.Nullable Integer idTokenTTL) { + this.idTokenTTL = idTokenTTL; + return this; + } + + /** + * ID token lifetime in seconds. Defaults to 3600 when omitted. + * @return idTokenTTL + */ + @javax.annotation.Nullable + public Integer getIdTokenTTL() { + return idTokenTTL; + } + + public void setIdTokenTTL(@javax.annotation.Nullable Integer idTokenTTL) { + this.idTokenTTL = idTokenTTL; + } + + + public CreateOAuthIntegrationRequest refreshTokenTTL(@javax.annotation.Nullable Integer refreshTokenTTL) { + this.refreshTokenTTL = refreshTokenTTL; + return this; + } + + /** + * Refresh token lifetime in seconds. Defaults to 86400 when omitted. + * @return refreshTokenTTL + */ + @javax.annotation.Nullable + public Integer getRefreshTokenTTL() { + return refreshTokenTTL; + } + + public void setRefreshTokenTTL(@javax.annotation.Nullable Integer refreshTokenTTL) { + this.refreshTokenTTL = refreshTokenTTL; + } + + + public CreateOAuthIntegrationRequest enablePKCE(@javax.annotation.Nullable Boolean enablePKCE) { + this.enablePKCE = enablePKCE; + return this; + } + + /** + * Get enablePKCE + * @return enablePKCE + */ + @javax.annotation.Nullable + public Boolean getEnablePKCE() { + return enablePKCE; + } + + public void setEnablePKCE(@javax.annotation.Nullable Boolean enablePKCE) { + this.enablePKCE = enablePKCE; + } + + + public CreateOAuthIntegrationRequest isPrebuiltIntegration(@javax.annotation.Nullable Boolean isPrebuiltIntegration) { + this.isPrebuiltIntegration = isPrebuiltIntegration; + return this; + } + + /** + * Get isPrebuiltIntegration + * @return isPrebuiltIntegration + */ + @javax.annotation.Nullable + public Boolean getIsPrebuiltIntegration() { + return isPrebuiltIntegration; + } + + public void setIsPrebuiltIntegration(@javax.annotation.Nullable Boolean isPrebuiltIntegration) { + this.isPrebuiltIntegration = isPrebuiltIntegration; + } + + + public CreateOAuthIntegrationRequest integrationType(@javax.annotation.Nullable String integrationType) { + this.integrationType = integrationType; + return this; + } + + /** + * Get integrationType + * @return integrationType + */ + @javax.annotation.Nullable + public String getIntegrationType() { + return integrationType; + } + + public void setIntegrationType(@javax.annotation.Nullable String integrationType) { + this.integrationType = integrationType; + } + + + public CreateOAuthIntegrationRequest tokenAuthMethod(@javax.annotation.Nullable TokenAuthMethodEnum tokenAuthMethod) { + this.tokenAuthMethod = tokenAuthMethod; + return this; + } + + /** + * Token-endpoint client authentication method. Defaults to client_secret_post when omitted. + * @return tokenAuthMethod + */ + @javax.annotation.Nullable + public TokenAuthMethodEnum getTokenAuthMethod() { + return tokenAuthMethod; + } + + public void setTokenAuthMethod(@javax.annotation.Nullable TokenAuthMethodEnum tokenAuthMethod) { + this.tokenAuthMethod = tokenAuthMethod; + } + + + public CreateOAuthIntegrationRequest defaultWorkflow(@javax.annotation.Nullable String defaultWorkflow) { + this.defaultWorkflow = defaultWorkflow; + return this; + } + + /** + * Name of the identity-orchestration workflow the authorize request falls back to when it carries no workflow parameter. Requires the IDENTITY_ORCHESTRATION feature; ignored when it is disabled. The workflow must already exist on the tenant, otherwise the request is rejected as an invalid integration configuration. Surrounding whitespace is trimmed; send an empty or blank string to clear it. + * @return defaultWorkflow + */ + @javax.annotation.Nullable + public String getDefaultWorkflow() { + return defaultWorkflow; + } + + public void setDefaultWorkflow(@javax.annotation.Nullable String defaultWorkflow) { + this.defaultWorkflow = defaultWorkflow; + } + + + public CreateOAuthIntegrationRequest connections(@javax.annotation.Nullable OAuthIntegrationBaseModelConnections connections) { + this.connections = connections; + return this; + } + + /** + * Get connections + * @return connections + */ + @javax.annotation.Nullable + public OAuthIntegrationBaseModelConnections getConnections() { + return connections; + } + + public void setConnections(@javax.annotation.Nullable OAuthIntegrationBaseModelConnections connections) { + this.connections = connections; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CreateOAuthIntegrationRequest instance itself + */ + public CreateOAuthIntegrationRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateOAuthIntegrationRequest createOAuthIntegrationRequest = (CreateOAuthIntegrationRequest) o; + return Objects.equals(this.displayName, createOAuthIntegrationRequest.displayName) && + Objects.equals(this.redirectURIs, createOAuthIntegrationRequest.redirectURIs) && + Objects.equals(this.allowedScopes, createOAuthIntegrationRequest.allowedScopes) && + Objects.equals(this.grantTypes, createOAuthIntegrationRequest.grantTypes) && + Objects.equals(this.accessTokenMappingTemplate, createOAuthIntegrationRequest.accessTokenMappingTemplate) && + Objects.equals(this.idTokenMappingTemplate, createOAuthIntegrationRequest.idTokenMappingTemplate) && + Objects.equals(this.accessTokenTTL, createOAuthIntegrationRequest.accessTokenTTL) && + Objects.equals(this.idTokenTTL, createOAuthIntegrationRequest.idTokenTTL) && + Objects.equals(this.refreshTokenTTL, createOAuthIntegrationRequest.refreshTokenTTL) && + Objects.equals(this.enablePKCE, createOAuthIntegrationRequest.enablePKCE) && + Objects.equals(this.isPrebuiltIntegration, createOAuthIntegrationRequest.isPrebuiltIntegration) && + Objects.equals(this.integrationType, createOAuthIntegrationRequest.integrationType) && + Objects.equals(this.tokenAuthMethod, createOAuthIntegrationRequest.tokenAuthMethod) && + Objects.equals(this.defaultWorkflow, createOAuthIntegrationRequest.defaultWorkflow) && + Objects.equals(this.connections, createOAuthIntegrationRequest.connections)&& + Objects.equals(this.additionalProperties, createOAuthIntegrationRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(displayName, redirectURIs, allowedScopes, grantTypes, accessTokenMappingTemplate, idTokenMappingTemplate, accessTokenTTL, idTokenTTL, refreshTokenTTL, enablePKCE, isPrebuiltIntegration, integrationType, tokenAuthMethod, defaultWorkflow, connections, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateOAuthIntegrationRequest {\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" redirectURIs: ").append(toIndentedString(redirectURIs)).append("\n"); + sb.append(" allowedScopes: ").append(toIndentedString(allowedScopes)).append("\n"); + sb.append(" grantTypes: ").append(toIndentedString(grantTypes)).append("\n"); + sb.append(" accessTokenMappingTemplate: ").append(toIndentedString(accessTokenMappingTemplate)).append("\n"); + sb.append(" idTokenMappingTemplate: ").append(toIndentedString(idTokenMappingTemplate)).append("\n"); + sb.append(" accessTokenTTL: ").append(toIndentedString(accessTokenTTL)).append("\n"); + sb.append(" idTokenTTL: ").append(toIndentedString(idTokenTTL)).append("\n"); + sb.append(" refreshTokenTTL: ").append(toIndentedString(refreshTokenTTL)).append("\n"); + sb.append(" enablePKCE: ").append(toIndentedString(enablePKCE)).append("\n"); + sb.append(" isPrebuiltIntegration: ").append(toIndentedString(isPrebuiltIntegration)).append("\n"); + sb.append(" integrationType: ").append(toIndentedString(integrationType)).append("\n"); + sb.append(" tokenAuthMethod: ").append(toIndentedString(tokenAuthMethod)).append("\n"); + sb.append(" defaultWorkflow: ").append(toIndentedString(defaultWorkflow)).append("\n"); + sb.append(" connections: ").append(toIndentedString(connections)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("DisplayName"); + openapiFields.add("RedirectURIs"); + openapiFields.add("AllowedScopes"); + openapiFields.add("GrantTypes"); + openapiFields.add("AccessTokenMappingTemplate"); + openapiFields.add("IdTokenMappingTemplate"); + openapiFields.add("AccessTokenTTL"); + openapiFields.add("IDTokenTTL"); + openapiFields.add("RefreshTokenTTL"); + openapiFields.add("EnablePKCE"); + openapiFields.add("IsPrebuiltIntegration"); + openapiFields.add("IntegrationType"); + openapiFields.add("TokenAuthMethod"); + openapiFields.add("DefaultWorkflow"); + openapiFields.add("Connections"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("DisplayName"); + openapiRequiredFields.add("RedirectURIs"); + openapiRequiredFields.add("GrantTypes"); + } + + /** + * 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 CreateOAuthIntegrationRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateOAuthIntegrationRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateOAuthIntegrationRequest is not found in the empty JSON string", CreateOAuthIntegrationRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateOAuthIntegrationRequest.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("DisplayName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DisplayName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DisplayName").toString())); + } + // ensure the required json array is present + if (jsonObj.get("RedirectURIs") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("RedirectURIs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RedirectURIs` to be an array in the JSON string but got `%s`", jsonObj.get("RedirectURIs").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("AllowedScopes") != null && !jsonObj.get("AllowedScopes").isJsonNull() && !jsonObj.get("AllowedScopes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `AllowedScopes` to be an array in the JSON string but got `%s`", jsonObj.get("AllowedScopes").toString())); + } + // ensure the required json array is present + if (jsonObj.get("GrantTypes") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("GrantTypes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `GrantTypes` to be an array in the JSON string but got `%s`", jsonObj.get("GrantTypes").toString())); + } + if ((jsonObj.get("AccessTokenMappingTemplate") != null && !jsonObj.get("AccessTokenMappingTemplate").isJsonNull()) && !jsonObj.get("AccessTokenMappingTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccessTokenMappingTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccessTokenMappingTemplate").toString())); + } + if ((jsonObj.get("IdTokenMappingTemplate") != null && !jsonObj.get("IdTokenMappingTemplate").isJsonNull()) && !jsonObj.get("IdTokenMappingTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IdTokenMappingTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IdTokenMappingTemplate").toString())); + } + if ((jsonObj.get("IntegrationType") != null && !jsonObj.get("IntegrationType").isJsonNull()) && !jsonObj.get("IntegrationType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IntegrationType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IntegrationType").toString())); + } + if ((jsonObj.get("TokenAuthMethod") != null && !jsonObj.get("TokenAuthMethod").isJsonNull()) && !jsonObj.get("TokenAuthMethod").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TokenAuthMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TokenAuthMethod").toString())); + } + // validate the optional field `TokenAuthMethod` + if (jsonObj.get("TokenAuthMethod") != null && !jsonObj.get("TokenAuthMethod").isJsonNull()) { + TokenAuthMethodEnum.validateJsonElement(jsonObj.get("TokenAuthMethod")); + } + if ((jsonObj.get("DefaultWorkflow") != null && !jsonObj.get("DefaultWorkflow").isJsonNull()) && !jsonObj.get("DefaultWorkflow").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DefaultWorkflow` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DefaultWorkflow").toString())); + } + // validate the optional field `Connections` + if (jsonObj.get("Connections") != null && !jsonObj.get("Connections").isJsonNull()) { + OAuthIntegrationBaseModelConnections.validateJsonElement(jsonObj.get("Connections")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!CreateOAuthIntegrationRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateOAuthIntegrationRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<CreateOAuthIntegrationRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateOAuthIntegrationRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<CreateOAuthIntegrationRequest>() { + @Override + public void write(JsonWriter out, CreateOAuthIntegrationRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CreateOAuthIntegrationRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateOAuthIntegrationRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateOAuthIntegrationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateOAuthIntegrationRequest + * @throws IOException if the JSON string is invalid with respect to CreateOAuthIntegrationRequest + */ + public static CreateOAuthIntegrationRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateOAuthIntegrationRequest.class); + } + + /** + * Convert an instance of CreateOAuthIntegrationRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/CreateOrganizationRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/CreateOrganizationRequest.java new file mode 100644 index 0000000..ab9798e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/CreateOrganizationRequest.java @@ -0,0 +1,428 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.OrganizationBaseDisplay; +import com.loginradius.sdk.internal.openapi.model.OrganizationDomainRequest; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * CreateOrganizationRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class CreateOrganizationRequest { + public static final String SERIALIZED_NAME_DISPLAY = "Display"; + @SerializedName(SERIALIZED_NAME_DISPLAY) + @javax.annotation.Nullable + private OrganizationBaseDisplay display; + + public static final String SERIALIZED_NAME_DOMAINS = "Domains"; + @SerializedName(SERIALIZED_NAME_DOMAINS) + @javax.annotation.Nullable + private List<OrganizationDomainRequest> domains = new ArrayList<>(); + + public static final String SERIALIZED_NAME_METADATA = "Metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + @javax.annotation.Nullable + private Map<String, String> metadata = new HashMap<>(); + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public CreateOrganizationRequest() { + } + + public CreateOrganizationRequest display(@javax.annotation.Nullable OrganizationBaseDisplay display) { + this.display = display; + return this; + } + + /** + * Get display + * @return display + */ + @javax.annotation.Nullable + public OrganizationBaseDisplay getDisplay() { + return display; + } + + public void setDisplay(@javax.annotation.Nullable OrganizationBaseDisplay display) { + this.display = display; + } + + + public CreateOrganizationRequest domains(@javax.annotation.Nullable List<OrganizationDomainRequest> domains) { + this.domains = domains; + return this; + } + + public CreateOrganizationRequest addDomainsItem(OrganizationDomainRequest domainsItem) { + if (this.domains == null) { + this.domains = new ArrayList<>(); + } + this.domains.add(domainsItem); + return this; + } + + /** + * Get domains + * @return domains + */ + @javax.annotation.Nullable + public List<OrganizationDomainRequest> getDomains() { + return domains; + } + + public void setDomains(@javax.annotation.Nullable List<OrganizationDomainRequest> domains) { + this.domains = domains; + } + + + public CreateOrganizationRequest metadata(@javax.annotation.Nullable Map<String, String> metadata) { + this.metadata = metadata; + return this; + } + + public CreateOrganizationRequest putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Additional metadata for the organization + * @return metadata + */ + @javax.annotation.Nullable + public Map<String, String> getMetadata() { + return metadata; + } + + public void setMetadata(@javax.annotation.Nullable Map<String, String> metadata) { + this.metadata = metadata; + } + + + public CreateOrganizationRequest name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Name of the organization + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CreateOrganizationRequest instance itself + */ + public CreateOrganizationRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateOrganizationRequest createOrganizationRequest = (CreateOrganizationRequest) o; + return Objects.equals(this.display, createOrganizationRequest.display) && + Objects.equals(this.domains, createOrganizationRequest.domains) && + Objects.equals(this.metadata, createOrganizationRequest.metadata) && + Objects.equals(this.name, createOrganizationRequest.name)&& + Objects.equals(this.additionalProperties, createOrganizationRequest.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(display, domains, metadata, name, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateOrganizationRequest {\n"); + sb.append(" display: ").append(toIndentedString(display)).append("\n"); + sb.append(" domains: ").append(toIndentedString(domains)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Display"); + openapiFields.add("Domains"); + openapiFields.add("Metadata"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Name"); + } + + /** + * 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 CreateOrganizationRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateOrganizationRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateOrganizationRequest is not found in the empty JSON string", CreateOrganizationRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateOrganizationRequest.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 optional field `Display` + if (jsonObj.get("Display") != null && !jsonObj.get("Display").isJsonNull()) { + OrganizationBaseDisplay.validateJsonElement(jsonObj.get("Display")); + } + if (jsonObj.get("Domains") != null && !jsonObj.get("Domains").isJsonNull()) { + JsonArray jsonArraydomains = jsonObj.getAsJsonArray("Domains"); + if (jsonArraydomains != null) { + // ensure the json data is an array + if (!jsonObj.get("Domains").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Domains` to be an array in the JSON string but got `%s`", jsonObj.get("Domains").toString())); + } + + // validate the optional field `Domains` (array) + for (int i = 0; i < jsonArraydomains.size(); i++) { + OrganizationDomainRequest.validateJsonElement(jsonArraydomains.get(i)); + }; + } + } + 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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!CreateOrganizationRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateOrganizationRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<CreateOrganizationRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateOrganizationRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<CreateOrganizationRequest>() { + @Override + public void write(JsonWriter out, CreateOrganizationRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CreateOrganizationRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateOrganizationRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateOrganizationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateOrganizationRequest + * @throws IOException if the JSON string is invalid with respect to CreateOrganizationRequest + */ + public static CreateOrganizationRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateOrganizationRequest.class); + } + + /** + * Convert an instance of CreateOrganizationRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/CreateSamlIntegrationRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/CreateSamlIntegrationRequest.java new file mode 100644 index 0000000..6c0c806 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/CreateSamlIntegrationRequest.java @@ -0,0 +1,818 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.Certificates; +import com.loginradius.sdk.internal.openapi.model.SamlIntegrationResponseAssertionConsumerService; +import com.loginradius.sdk.internal.openapi.model.SamlIntegrationResponseAttributesValue; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * CreateSamlIntegrationRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class CreateSamlIntegrationRequest { + public static final String SERIALIZED_NAME_APP_NAME = "AppName"; + @SerializedName(SERIALIZED_NAME_APP_NAME) + @javax.annotation.Nonnull + private String appName; + + public static final String SERIALIZED_NAME_AFTER_LOGOUT_URL = "AfterLogoutUrl"; + @SerializedName(SERIALIZED_NAME_AFTER_LOGOUT_URL) + @javax.annotation.Nullable + private String afterLogoutUrl; + + public static final String SERIALIZED_NAME_ASSERTION_CONSUMER_SERVICE = "AssertionConsumerService"; + @SerializedName(SERIALIZED_NAME_ASSERTION_CONSUMER_SERVICE) + @javax.annotation.Nullable + private SamlIntegrationResponseAssertionConsumerService assertionConsumerService; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "Attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nullable + private Map<String, SamlIntegrationResponseAttributesValue> attributes = new HashMap<>(); + + public static final String SERIALIZED_NAME_AUDIENCES = "Audiences"; + @SerializedName(SERIALIZED_NAME_AUDIENCES) + @javax.annotation.Nullable + private List<String> audiences = new ArrayList<>(); + + /** + * Gets or Sets defaultRequestBinding + */ + @JsonAdapter(DefaultRequestBindingEnum.Adapter.class) + public enum DefaultRequestBindingEnum { + POST("urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"), + + REDIRECT("urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"); + + private String value; + + DefaultRequestBindingEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static DefaultRequestBindingEnum fromValue(String value) { + for (DefaultRequestBindingEnum b : DefaultRequestBindingEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<DefaultRequestBindingEnum> { + @Override + public void write(final JsonWriter jsonWriter, final DefaultRequestBindingEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public DefaultRequestBindingEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return DefaultRequestBindingEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + DefaultRequestBindingEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_DEFAULT_REQUEST_BINDING = "DefaultRequestBinding"; + @SerializedName(SERIALIZED_NAME_DEFAULT_REQUEST_BINDING) + @javax.annotation.Nullable + private DefaultRequestBindingEnum defaultRequestBinding; + + public static final String SERIALIZED_NAME_IS_IDP_INITIATED = "IsIdpInitiated"; + @SerializedName(SERIALIZED_NAME_IS_IDP_INITIATED) + @javax.annotation.Nullable + private Boolean isIdpInitiated; + + public static final String SERIALIZED_NAME_ISSUER_URL = "IssuerUrl"; + @SerializedName(SERIALIZED_NAME_ISSUER_URL) + @javax.annotation.Nullable + private String issuerUrl; + + public static final String SERIALIZED_NAME_LOGIN_URL = "LoginUrl"; + @SerializedName(SERIALIZED_NAME_LOGIN_URL) + @javax.annotation.Nullable + private String loginUrl; + + /** + * Gets or Sets nameIdFormat + */ + @JsonAdapter(NameIdFormatEnum.Adapter.class) + public enum NameIdFormatEnum { + _1_1_NAMEID_FORMAT_UNSPECIFIED("urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified"), + + _1_1_NAMEID_FORMAT_EMAIL_ADDRESS("urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"), + + _2_0_NAMEID_FORMAT_PERSISTENT("urn:oasis:names:tc:SAML:2.0:nameid-format:persistent"), + + _2_0_NAMEID_FORMAT_TRANSIENT("urn:oasis:names:tc:SAML:2.0:nameid-format:transient"); + + private String value; + + NameIdFormatEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static NameIdFormatEnum fromValue(String value) { + for (NameIdFormatEnum b : NameIdFormatEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<NameIdFormatEnum> { + @Override + public void write(final JsonWriter jsonWriter, final NameIdFormatEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public NameIdFormatEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return NameIdFormatEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + NameIdFormatEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_NAME_ID_FORMAT = "NameIdFormat"; + @SerializedName(SERIALIZED_NAME_NAME_ID_FORMAT) + @javax.annotation.Nullable + private NameIdFormatEnum nameIdFormat; + + public static final String SERIALIZED_NAME_NOT_ON_OR_AFTER = "NotOnOrAfter"; + @SerializedName(SERIALIZED_NAME_NOT_ON_OR_AFTER) + @javax.annotation.Nullable + private Integer notOnOrAfter; + + public static final String SERIALIZED_NAME_RELAY_STATE_PARAMETER = "RelayStateParameter"; + @SerializedName(SERIALIZED_NAME_RELAY_STATE_PARAMETER) + @javax.annotation.Nullable + private String relayStateParameter; + + public static final String SERIALIZED_NAME_SP_CERTIFICATE = "SpCertificate"; + @SerializedName(SERIALIZED_NAME_SP_CERTIFICATE) + @javax.annotation.Nullable + private Certificates spCertificate; + + public static final String SERIALIZED_NAME_SP_LOGOUT_URL = "SpLogoutUrl"; + @SerializedName(SERIALIZED_NAME_SP_LOGOUT_URL) + @javax.annotation.Nullable + private String spLogoutUrl; + + public CreateSamlIntegrationRequest() { + } + + public CreateSamlIntegrationRequest appName(@javax.annotation.Nonnull String appName) { + this.appName = appName; + return this; + } + + /** + * Get appName + * @return appName + */ + @javax.annotation.Nonnull + public String getAppName() { + return appName; + } + + public void setAppName(@javax.annotation.Nonnull String appName) { + this.appName = appName; + } + + + public CreateSamlIntegrationRequest afterLogoutUrl(@javax.annotation.Nullable String afterLogoutUrl) { + this.afterLogoutUrl = afterLogoutUrl; + return this; + } + + /** + * Get afterLogoutUrl + * @return afterLogoutUrl + */ + @javax.annotation.Nullable + public String getAfterLogoutUrl() { + return afterLogoutUrl; + } + + public void setAfterLogoutUrl(@javax.annotation.Nullable String afterLogoutUrl) { + this.afterLogoutUrl = afterLogoutUrl; + } + + + public CreateSamlIntegrationRequest assertionConsumerService(@javax.annotation.Nullable SamlIntegrationResponseAssertionConsumerService assertionConsumerService) { + this.assertionConsumerService = assertionConsumerService; + return this; + } + + /** + * Get assertionConsumerService + * @return assertionConsumerService + */ + @javax.annotation.Nullable + public SamlIntegrationResponseAssertionConsumerService getAssertionConsumerService() { + return assertionConsumerService; + } + + public void setAssertionConsumerService(@javax.annotation.Nullable SamlIntegrationResponseAssertionConsumerService assertionConsumerService) { + this.assertionConsumerService = assertionConsumerService; + } + + + public CreateSamlIntegrationRequest attributes(@javax.annotation.Nullable Map<String, SamlIntegrationResponseAttributesValue> attributes) { + this.attributes = attributes; + return this; + } + + public CreateSamlIntegrationRequest putAttributesItem(String key, SamlIntegrationResponseAttributesValue attributesItem) { + if (this.attributes == null) { + this.attributes = new HashMap<>(); + } + this.attributes.put(key, attributesItem); + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nullable + public Map<String, SamlIntegrationResponseAttributesValue> getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nullable Map<String, SamlIntegrationResponseAttributesValue> attributes) { + this.attributes = attributes; + } + + + public CreateSamlIntegrationRequest audiences(@javax.annotation.Nullable List<String> audiences) { + this.audiences = audiences; + return this; + } + + public CreateSamlIntegrationRequest addAudiencesItem(String audiencesItem) { + if (this.audiences == null) { + this.audiences = new ArrayList<>(); + } + this.audiences.add(audiencesItem); + return this; + } + + /** + * Get audiences + * @return audiences + */ + @javax.annotation.Nullable + public List<String> getAudiences() { + return audiences; + } + + public void setAudiences(@javax.annotation.Nullable List<String> audiences) { + this.audiences = audiences; + } + + + public CreateSamlIntegrationRequest defaultRequestBinding(@javax.annotation.Nullable DefaultRequestBindingEnum defaultRequestBinding) { + this.defaultRequestBinding = defaultRequestBinding; + return this; + } + + /** + * Get defaultRequestBinding + * @return defaultRequestBinding + */ + @javax.annotation.Nullable + public DefaultRequestBindingEnum getDefaultRequestBinding() { + return defaultRequestBinding; + } + + public void setDefaultRequestBinding(@javax.annotation.Nullable DefaultRequestBindingEnum defaultRequestBinding) { + this.defaultRequestBinding = defaultRequestBinding; + } + + + public CreateSamlIntegrationRequest isIdpInitiated(@javax.annotation.Nullable Boolean isIdpInitiated) { + this.isIdpInitiated = isIdpInitiated; + return this; + } + + /** + * Get isIdpInitiated + * @return isIdpInitiated + */ + @javax.annotation.Nullable + public Boolean getIsIdpInitiated() { + return isIdpInitiated; + } + + public void setIsIdpInitiated(@javax.annotation.Nullable Boolean isIdpInitiated) { + this.isIdpInitiated = isIdpInitiated; + } + + + public CreateSamlIntegrationRequest issuerUrl(@javax.annotation.Nullable String issuerUrl) { + this.issuerUrl = issuerUrl; + return this; + } + + /** + * Get issuerUrl + * @return issuerUrl + */ + @javax.annotation.Nullable + public String getIssuerUrl() { + return issuerUrl; + } + + public void setIssuerUrl(@javax.annotation.Nullable String issuerUrl) { + this.issuerUrl = issuerUrl; + } + + + public CreateSamlIntegrationRequest loginUrl(@javax.annotation.Nullable String loginUrl) { + this.loginUrl = loginUrl; + return this; + } + + /** + * Get loginUrl + * @return loginUrl + */ + @javax.annotation.Nullable + public String getLoginUrl() { + return loginUrl; + } + + public void setLoginUrl(@javax.annotation.Nullable String loginUrl) { + this.loginUrl = loginUrl; + } + + + public CreateSamlIntegrationRequest nameIdFormat(@javax.annotation.Nullable NameIdFormatEnum nameIdFormat) { + this.nameIdFormat = nameIdFormat; + return this; + } + + /** + * Get nameIdFormat + * @return nameIdFormat + */ + @javax.annotation.Nullable + public NameIdFormatEnum getNameIdFormat() { + return nameIdFormat; + } + + public void setNameIdFormat(@javax.annotation.Nullable NameIdFormatEnum nameIdFormat) { + this.nameIdFormat = nameIdFormat; + } + + + public CreateSamlIntegrationRequest notOnOrAfter(@javax.annotation.Nullable Integer notOnOrAfter) { + this.notOnOrAfter = notOnOrAfter; + return this; + } + + /** + * Get notOnOrAfter + * @return notOnOrAfter + */ + @javax.annotation.Nullable + public Integer getNotOnOrAfter() { + return notOnOrAfter; + } + + public void setNotOnOrAfter(@javax.annotation.Nullable Integer notOnOrAfter) { + this.notOnOrAfter = notOnOrAfter; + } + + + public CreateSamlIntegrationRequest relayStateParameter(@javax.annotation.Nullable String relayStateParameter) { + this.relayStateParameter = relayStateParameter; + return this; + } + + /** + * Get relayStateParameter + * @return relayStateParameter + */ + @javax.annotation.Nullable + public String getRelayStateParameter() { + return relayStateParameter; + } + + public void setRelayStateParameter(@javax.annotation.Nullable String relayStateParameter) { + this.relayStateParameter = relayStateParameter; + } + + + public CreateSamlIntegrationRequest spCertificate(@javax.annotation.Nullable Certificates spCertificate) { + this.spCertificate = spCertificate; + return this; + } + + /** + * Get spCertificate + * @return spCertificate + */ + @javax.annotation.Nullable + public Certificates getSpCertificate() { + return spCertificate; + } + + public void setSpCertificate(@javax.annotation.Nullable Certificates spCertificate) { + this.spCertificate = spCertificate; + } + + + public CreateSamlIntegrationRequest spLogoutUrl(@javax.annotation.Nullable String spLogoutUrl) { + this.spLogoutUrl = spLogoutUrl; + return this; + } + + /** + * Get spLogoutUrl + * @return spLogoutUrl + */ + @javax.annotation.Nullable + public String getSpLogoutUrl() { + return spLogoutUrl; + } + + public void setSpLogoutUrl(@javax.annotation.Nullable String spLogoutUrl) { + this.spLogoutUrl = spLogoutUrl; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CreateSamlIntegrationRequest instance itself + */ + public CreateSamlIntegrationRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CreateSamlIntegrationRequest createSamlIntegrationRequest = (CreateSamlIntegrationRequest) o; + return Objects.equals(this.appName, createSamlIntegrationRequest.appName) && + Objects.equals(this.afterLogoutUrl, createSamlIntegrationRequest.afterLogoutUrl) && + Objects.equals(this.assertionConsumerService, createSamlIntegrationRequest.assertionConsumerService) && + Objects.equals(this.attributes, createSamlIntegrationRequest.attributes) && + Objects.equals(this.audiences, createSamlIntegrationRequest.audiences) && + Objects.equals(this.defaultRequestBinding, createSamlIntegrationRequest.defaultRequestBinding) && + Objects.equals(this.isIdpInitiated, createSamlIntegrationRequest.isIdpInitiated) && + Objects.equals(this.issuerUrl, createSamlIntegrationRequest.issuerUrl) && + Objects.equals(this.loginUrl, createSamlIntegrationRequest.loginUrl) && + Objects.equals(this.nameIdFormat, createSamlIntegrationRequest.nameIdFormat) && + Objects.equals(this.notOnOrAfter, createSamlIntegrationRequest.notOnOrAfter) && + Objects.equals(this.relayStateParameter, createSamlIntegrationRequest.relayStateParameter) && + Objects.equals(this.spCertificate, createSamlIntegrationRequest.spCertificate) && + Objects.equals(this.spLogoutUrl, createSamlIntegrationRequest.spLogoutUrl)&& + Objects.equals(this.additionalProperties, createSamlIntegrationRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(appName, afterLogoutUrl, assertionConsumerService, attributes, audiences, defaultRequestBinding, isIdpInitiated, issuerUrl, loginUrl, nameIdFormat, notOnOrAfter, relayStateParameter, spCertificate, spLogoutUrl, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CreateSamlIntegrationRequest {\n"); + sb.append(" appName: ").append(toIndentedString(appName)).append("\n"); + sb.append(" afterLogoutUrl: ").append(toIndentedString(afterLogoutUrl)).append("\n"); + sb.append(" assertionConsumerService: ").append(toIndentedString(assertionConsumerService)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" audiences: ").append(toIndentedString(audiences)).append("\n"); + sb.append(" defaultRequestBinding: ").append(toIndentedString(defaultRequestBinding)).append("\n"); + sb.append(" isIdpInitiated: ").append(toIndentedString(isIdpInitiated)).append("\n"); + sb.append(" issuerUrl: ").append(toIndentedString(issuerUrl)).append("\n"); + sb.append(" loginUrl: ").append(toIndentedString(loginUrl)).append("\n"); + sb.append(" nameIdFormat: ").append(toIndentedString(nameIdFormat)).append("\n"); + sb.append(" notOnOrAfter: ").append(toIndentedString(notOnOrAfter)).append("\n"); + sb.append(" relayStateParameter: ").append(toIndentedString(relayStateParameter)).append("\n"); + sb.append(" spCertificate: ").append(toIndentedString(spCertificate)).append("\n"); + sb.append(" spLogoutUrl: ").append(toIndentedString(spLogoutUrl)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AppName"); + openapiFields.add("AfterLogoutUrl"); + openapiFields.add("AssertionConsumerService"); + openapiFields.add("Attributes"); + openapiFields.add("Audiences"); + openapiFields.add("DefaultRequestBinding"); + openapiFields.add("IsIdpInitiated"); + openapiFields.add("IssuerUrl"); + openapiFields.add("LoginUrl"); + openapiFields.add("NameIdFormat"); + openapiFields.add("NotOnOrAfter"); + openapiFields.add("RelayStateParameter"); + openapiFields.add("SpCertificate"); + openapiFields.add("SpLogoutUrl"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("AppName"); + } + + /** + * 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 CreateSamlIntegrationRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CreateSamlIntegrationRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CreateSamlIntegrationRequest is not found in the empty JSON string", CreateSamlIntegrationRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CreateSamlIntegrationRequest.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("AppName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AppName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AppName").toString())); + } + if ((jsonObj.get("AfterLogoutUrl") != null && !jsonObj.get("AfterLogoutUrl").isJsonNull()) && !jsonObj.get("AfterLogoutUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AfterLogoutUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AfterLogoutUrl").toString())); + } + // validate the optional field `AssertionConsumerService` + if (jsonObj.get("AssertionConsumerService") != null && !jsonObj.get("AssertionConsumerService").isJsonNull()) { + SamlIntegrationResponseAssertionConsumerService.validateJsonElement(jsonObj.get("AssertionConsumerService")); + } + // ensure the optional json data is an array if present + if (jsonObj.get("Audiences") != null && !jsonObj.get("Audiences").isJsonNull() && !jsonObj.get("Audiences").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Audiences` to be an array in the JSON string but got `%s`", jsonObj.get("Audiences").toString())); + } + if ((jsonObj.get("DefaultRequestBinding") != null && !jsonObj.get("DefaultRequestBinding").isJsonNull()) && !jsonObj.get("DefaultRequestBinding").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DefaultRequestBinding` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DefaultRequestBinding").toString())); + } + // validate the optional field `DefaultRequestBinding` + if (jsonObj.get("DefaultRequestBinding") != null && !jsonObj.get("DefaultRequestBinding").isJsonNull()) { + DefaultRequestBindingEnum.validateJsonElement(jsonObj.get("DefaultRequestBinding")); + } + if ((jsonObj.get("IssuerUrl") != null && !jsonObj.get("IssuerUrl").isJsonNull()) && !jsonObj.get("IssuerUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IssuerUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IssuerUrl").toString())); + } + if ((jsonObj.get("LoginUrl") != null && !jsonObj.get("LoginUrl").isJsonNull()) && !jsonObj.get("LoginUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LoginUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LoginUrl").toString())); + } + if ((jsonObj.get("NameIdFormat") != null && !jsonObj.get("NameIdFormat").isJsonNull()) && !jsonObj.get("NameIdFormat").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NameIdFormat` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NameIdFormat").toString())); + } + // validate the optional field `NameIdFormat` + if (jsonObj.get("NameIdFormat") != null && !jsonObj.get("NameIdFormat").isJsonNull()) { + NameIdFormatEnum.validateJsonElement(jsonObj.get("NameIdFormat")); + } + if ((jsonObj.get("RelayStateParameter") != null && !jsonObj.get("RelayStateParameter").isJsonNull()) && !jsonObj.get("RelayStateParameter").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RelayStateParameter` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RelayStateParameter").toString())); + } + // validate the optional field `SpCertificate` + if (jsonObj.get("SpCertificate") != null && !jsonObj.get("SpCertificate").isJsonNull()) { + Certificates.validateJsonElement(jsonObj.get("SpCertificate")); + } + if ((jsonObj.get("SpLogoutUrl") != null && !jsonObj.get("SpLogoutUrl").isJsonNull()) && !jsonObj.get("SpLogoutUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SpLogoutUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SpLogoutUrl").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!CreateSamlIntegrationRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CreateSamlIntegrationRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<CreateSamlIntegrationRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CreateSamlIntegrationRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<CreateSamlIntegrationRequest>() { + @Override + public void write(JsonWriter out, CreateSamlIntegrationRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CreateSamlIntegrationRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CreateSamlIntegrationRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CreateSamlIntegrationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of CreateSamlIntegrationRequest + * @throws IOException if the JSON string is invalid with respect to CreateSamlIntegrationRequest + */ + public static CreateSamlIntegrationRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CreateSamlIntegrationRequest.class); + } + + /** + * Convert an instance of CreateSamlIntegrationRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/CredentialObj.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/CredentialObj.java new file mode 100644 index 0000000..fe2a17b --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/CredentialObj.java @@ -0,0 +1,375 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * CredentialObj + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class CredentialObj { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_AUTHENTICATOR = "Authenticator"; + @SerializedName(SERIALIZED_NAME_AUTHENTICATOR) + @javax.annotation.Nullable + private String authenticator; + + public static final String SERIALIZED_NAME_IDENTIFIER = "Identifier"; + @SerializedName(SERIALIZED_NAME_IDENTIFIER) + @javax.annotation.Nullable + private String identifier; + + public static final String SERIALIZED_NAME_CREATED_AT = "CreatedAt"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nullable + private OffsetDateTime createdAt; + + public CredentialObj() { + } + + public CredentialObj id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Unique credential identifier. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public CredentialObj authenticator(@javax.annotation.Nullable String authenticator) { + this.authenticator = authenticator; + return this; + } + + /** + * Authenticator type. + * @return authenticator + */ + @javax.annotation.Nullable + public String getAuthenticator() { + return authenticator; + } + + public void setAuthenticator(@javax.annotation.Nullable String authenticator) { + this.authenticator = authenticator; + } + + + public CredentialObj identifier(@javax.annotation.Nullable String identifier) { + this.identifier = identifier; + return this; + } + + /** + * Credential identifier (e.g., Username or email). + * @return identifier + */ + @javax.annotation.Nullable + public String getIdentifier() { + return identifier; + } + + public void setIdentifier(@javax.annotation.Nullable String identifier) { + this.identifier = identifier; + } + + + public CredentialObj createdAt(@javax.annotation.Nullable OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Credential creation time. + * @return createdAt + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nullable OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CredentialObj instance itself + */ + public CredentialObj putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CredentialObj credentialObj = (CredentialObj) o; + return Objects.equals(this.id, credentialObj.id) && + Objects.equals(this.authenticator, credentialObj.authenticator) && + Objects.equals(this.identifier, credentialObj.identifier) && + Objects.equals(this.createdAt, credentialObj.createdAt)&& + Objects.equals(this.additionalProperties, credentialObj.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, authenticator, identifier, createdAt, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CredentialObj {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" authenticator: ").append(toIndentedString(authenticator)).append("\n"); + sb.append(" identifier: ").append(toIndentedString(identifier)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Authenticator"); + openapiFields.add("Identifier"); + openapiFields.add("CreatedAt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 CredentialObj + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CredentialObj.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CredentialObj is not found in the empty JSON string", CredentialObj.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Authenticator") != null && !jsonObj.get("Authenticator").isJsonNull()) && !jsonObj.get("Authenticator").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Authenticator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Authenticator").toString())); + } + if ((jsonObj.get("Identifier") != null && !jsonObj.get("Identifier").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!CredentialObj.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CredentialObj' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<CredentialObj> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CredentialObj.class)); + + return (TypeAdapter<T>) new TypeAdapter<CredentialObj>() { + @Override + public void write(JsonWriter out, CredentialObj value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CredentialObj read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CredentialObj instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CredentialObj given an JSON string + * + * @param jsonString JSON string + * @return An instance of CredentialObj + * @throws IOException if the JSON string is invalid with respect to CredentialObj + */ + public static CredentialObj fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CredentialObj.class); + } + + /** + * Convert an instance of CredentialObj to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/CustomFieldLimitResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/CustomFieldLimitResponse.java new file mode 100644 index 0000000..ee998fd --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/CustomFieldLimitResponse.java @@ -0,0 +1,284 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * CustomFieldLimitResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class CustomFieldLimitResponse { + public static final String SERIALIZED_NAME_CUSTOM_FIELD_LIMIT = "CustomFieldLimit"; + @SerializedName(SERIALIZED_NAME_CUSTOM_FIELD_LIMIT) + @javax.annotation.Nullable + private Integer customFieldLimit; + + public CustomFieldLimitResponse() { + } + + public CustomFieldLimitResponse customFieldLimit(@javax.annotation.Nullable Integer customFieldLimit) { + this.customFieldLimit = customFieldLimit; + return this; + } + + /** + * The limit for custom fields. + * @return customFieldLimit + */ + @javax.annotation.Nullable + public Integer getCustomFieldLimit() { + return customFieldLimit; + } + + public void setCustomFieldLimit(@javax.annotation.Nullable Integer customFieldLimit) { + this.customFieldLimit = customFieldLimit; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CustomFieldLimitResponse instance itself + */ + public CustomFieldLimitResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CustomFieldLimitResponse customFieldLimitResponse = (CustomFieldLimitResponse) o; + return Objects.equals(this.customFieldLimit, customFieldLimitResponse.customFieldLimit)&& + Objects.equals(this.additionalProperties, customFieldLimitResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(customFieldLimit, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CustomFieldLimitResponse {\n"); + sb.append(" customFieldLimit: ").append(toIndentedString(customFieldLimit)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("CustomFieldLimit"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 CustomFieldLimitResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CustomFieldLimitResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CustomFieldLimitResponse is not found in the empty JSON string", CustomFieldLimitResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!CustomFieldLimitResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CustomFieldLimitResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<CustomFieldLimitResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CustomFieldLimitResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<CustomFieldLimitResponse>() { + @Override + public void write(JsonWriter out, CustomFieldLimitResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CustomFieldLimitResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CustomFieldLimitResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CustomFieldLimitResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of CustomFieldLimitResponse + * @throws IOException if the JSON string is invalid with respect to CustomFieldLimitResponse + */ + public static CustomFieldLimitResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CustomFieldLimitResponse.class); + } + + /** + * Convert an instance of CustomFieldLimitResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/CustomOAuth2DeleteModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/CustomOAuth2DeleteModel.java new file mode 100644 index 0000000..9094cac --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/CustomOAuth2DeleteModel.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * CustomOAuth2DeleteModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class CustomOAuth2DeleteModel { + public static final String SERIALIZED_NAME_PROVIDER_NAME = "ProviderName"; + @SerializedName(SERIALIZED_NAME_PROVIDER_NAME) + @javax.annotation.Nonnull + private String providerName; + + public CustomOAuth2DeleteModel() { + } + + public CustomOAuth2DeleteModel providerName(@javax.annotation.Nonnull String providerName) { + this.providerName = providerName; + return this; + } + + /** + * The name of the OAuth2 provider to be deleted. + * @return providerName + */ + @javax.annotation.Nonnull + public String getProviderName() { + return providerName; + } + + public void setProviderName(@javax.annotation.Nonnull String providerName) { + this.providerName = providerName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CustomOAuth2DeleteModel instance itself + */ + public CustomOAuth2DeleteModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CustomOAuth2DeleteModel customOAuth2DeleteModel = (CustomOAuth2DeleteModel) o; + return Objects.equals(this.providerName, customOAuth2DeleteModel.providerName)&& + Objects.equals(this.additionalProperties, customOAuth2DeleteModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(providerName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CustomOAuth2DeleteModel {\n"); + sb.append(" providerName: ").append(toIndentedString(providerName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ProviderName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("ProviderName"); + } + + /** + * 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 CustomOAuth2DeleteModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CustomOAuth2DeleteModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CustomOAuth2DeleteModel is not found in the empty JSON string", CustomOAuth2DeleteModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CustomOAuth2DeleteModel.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("ProviderName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProviderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProviderName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!CustomOAuth2DeleteModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CustomOAuth2DeleteModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<CustomOAuth2DeleteModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CustomOAuth2DeleteModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<CustomOAuth2DeleteModel>() { + @Override + public void write(JsonWriter out, CustomOAuth2DeleteModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CustomOAuth2DeleteModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CustomOAuth2DeleteModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CustomOAuth2DeleteModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of CustomOAuth2DeleteModel + * @throws IOException if the JSON string is invalid with respect to CustomOAuth2DeleteModel + */ + public static CustomOAuth2DeleteModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CustomOAuth2DeleteModel.class); + } + + /** + * Convert an instance of CustomOAuth2DeleteModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/CustomOAuth2Model.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/CustomOAuth2Model.java new file mode 100644 index 0000000..c0b7c5f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/CustomOAuth2Model.java @@ -0,0 +1,977 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * CustomOAuth2Model + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class CustomOAuth2Model { + public static final String SERIALIZED_NAME_PROVIDER_NAME = "ProviderName"; + @SerializedName(SERIALIZED_NAME_PROVIDER_NAME) + @javax.annotation.Nonnull + private String providerName; + + public static final String SERIALIZED_NAME_EXTRA_PARAMETER_IN_REDIRECT_TO_PROVIDER = "ExtraParameterInRedirectToProvider"; + @SerializedName(SERIALIZED_NAME_EXTRA_PARAMETER_IN_REDIRECT_TO_PROVIDER) + @javax.annotation.Nullable + private String extraParameterInRedirectToProvider; + + public static final String SERIALIZED_NAME_USER_LOGIN_ENDPOINT = "UserLoginEndpoint"; + @SerializedName(SERIALIZED_NAME_USER_LOGIN_ENDPOINT) + @javax.annotation.Nonnull + private String userLoginEndpoint; + + public static final String SERIALIZED_NAME_ACCESS_TOKEN_ENDPOINT = "AccessTokenEndpoint"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN_ENDPOINT) + @javax.annotation.Nonnull + private String accessTokenEndpoint; + + public static final String SERIALIZED_NAME_APPLICATION_KEY = "ApplicationKey"; + @SerializedName(SERIALIZED_NAME_APPLICATION_KEY) + @javax.annotation.Nonnull + private String applicationKey; + + public static final String SERIALIZED_NAME_APPLICATION_SECRET = "ApplicationSecret"; + @SerializedName(SERIALIZED_NAME_APPLICATION_SECRET) + @javax.annotation.Nonnull + private String applicationSecret; + + public static final String SERIALIZED_NAME_ENABLE_AUTO_LOOK_UP = "EnableAutoLookUp"; + @SerializedName(SERIALIZED_NAME_ENABLE_AUTO_LOOK_UP) + @javax.annotation.Nullable + private Boolean enableAutoLookUp; + + public static final String SERIALIZED_NAME_DOMAIN = "Domain"; + @SerializedName(SERIALIZED_NAME_DOMAIN) + @javax.annotation.Nullable + private String domain; + + public static final String SERIALIZED_NAME_APPLICATION_I_D = "ApplicationID"; + @SerializedName(SERIALIZED_NAME_APPLICATION_I_D) + @javax.annotation.Nullable + private String applicationID; + + public static final String SERIALIZED_NAME_SCOPE = "Scope"; + @SerializedName(SERIALIZED_NAME_SCOPE) + @javax.annotation.Nonnull + private String scope; + + public static final String SERIALIZED_NAME_RESPONSE_TYPE = "ResponseType"; + @SerializedName(SERIALIZED_NAME_RESPONSE_TYPE) + @javax.annotation.Nonnull + private String responseType; + + public static final String SERIALIZED_NAME_USERPROFILE_ENDPOINT = "UserprofileEndpoint"; + @SerializedName(SERIALIZED_NAME_USERPROFILE_ENDPOINT) + @javax.annotation.Nullable + private String userprofileEndpoint; + + public static final String SERIALIZED_NAME_USER_INFO_EXTRACT_BY_ID_TOKEN = "UserInfoExtractByIdToken"; + @SerializedName(SERIALIZED_NAME_USER_INFO_EXTRACT_BY_ID_TOKEN) + @javax.annotation.Nullable + private Boolean userInfoExtractByIdToken; + + public static final String SERIALIZED_NAME_JW_K_S_ENDPOINT = "JWKSEndpoint"; + @SerializedName(SERIALIZED_NAME_JW_K_S_ENDPOINT) + @javax.annotation.Nullable + private String jwKSEndpoint; + + public static final String SERIALIZED_NAME_DATA_MAP = "DataMap"; + @SerializedName(SERIALIZED_NAME_DATA_MAP) + @javax.annotation.Nonnull + private Map<String, String> dataMap = new HashMap<>(); + + public static final String SERIALIZED_NAME_ACCESS_TOKEN_PARAMETER_NAME_FOR_API_ACCESS = "AccessTokenParameterNameForApiAccess"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN_PARAMETER_NAME_FOR_API_ACCESS) + @javax.annotation.Nullable + private String accessTokenParameterNameForApiAccess; + + public static final String SERIALIZED_NAME_TRASNSPORT_TYPE = "TrasnsportType"; + @SerializedName(SERIALIZED_NAME_TRASNSPORT_TYPE) + @javax.annotation.Nullable + private String trasnsportType; + + /** + * The HTTP method for requesting tokens. + */ + @JsonAdapter(RequestTokenHttpMethodEnum.Adapter.class) + public enum RequestTokenHttpMethodEnum { + GET("GET"), + + POST("POST"); + + private String value; + + RequestTokenHttpMethodEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static RequestTokenHttpMethodEnum fromValue(String value) { + for (RequestTokenHttpMethodEnum b : RequestTokenHttpMethodEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<RequestTokenHttpMethodEnum> { + @Override + public void write(final JsonWriter jsonWriter, final RequestTokenHttpMethodEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public RequestTokenHttpMethodEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return RequestTokenHttpMethodEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + RequestTokenHttpMethodEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_REQUEST_TOKEN_HTTP_METHOD = "RequestTokenHttpMethod"; + @SerializedName(SERIALIZED_NAME_REQUEST_TOKEN_HTTP_METHOD) + @javax.annotation.Nonnull + private RequestTokenHttpMethodEnum requestTokenHttpMethod; + + public static final String SERIALIZED_NAME_HEADERS = "Headers"; + @SerializedName(SERIALIZED_NAME_HEADERS) + @javax.annotation.Nullable + private Map<String, String> headers = new HashMap<>(); + + public static final String SERIALIZED_NAME_QUERY_PARAM = "QueryParam"; + @SerializedName(SERIALIZED_NAME_QUERY_PARAM) + @javax.annotation.Nullable + private Map<String, String> queryParam = new HashMap<>(); + + public static final String SERIALIZED_NAME_LIST_IN_INTERFACE = "ListInInterface"; + @SerializedName(SERIALIZED_NAME_LIST_IN_INTERFACE) + @javax.annotation.Nullable + private Boolean listInInterface; + + public CustomOAuth2Model() { + } + + public CustomOAuth2Model providerName(@javax.annotation.Nonnull String providerName) { + this.providerName = providerName; + return this; + } + + /** + * The name of the OAuth2 provider. + * @return providerName + */ + @javax.annotation.Nonnull + public String getProviderName() { + return providerName; + } + + public void setProviderName(@javax.annotation.Nonnull String providerName) { + this.providerName = providerName; + } + + + public CustomOAuth2Model extraParameterInRedirectToProvider(@javax.annotation.Nullable String extraParameterInRedirectToProvider) { + this.extraParameterInRedirectToProvider = extraParameterInRedirectToProvider; + return this; + } + + /** + * Extra parameters in redirect to provider. + * @return extraParameterInRedirectToProvider + */ + @javax.annotation.Nullable + public String getExtraParameterInRedirectToProvider() { + return extraParameterInRedirectToProvider; + } + + public void setExtraParameterInRedirectToProvider(@javax.annotation.Nullable String extraParameterInRedirectToProvider) { + this.extraParameterInRedirectToProvider = extraParameterInRedirectToProvider; + } + + + public CustomOAuth2Model userLoginEndpoint(@javax.annotation.Nonnull String userLoginEndpoint) { + this.userLoginEndpoint = userLoginEndpoint; + return this; + } + + /** + * The User login endpoint for the OAuth2 provider. + * @return userLoginEndpoint + */ + @javax.annotation.Nonnull + public String getUserLoginEndpoint() { + return userLoginEndpoint; + } + + public void setUserLoginEndpoint(@javax.annotation.Nonnull String userLoginEndpoint) { + this.userLoginEndpoint = userLoginEndpoint; + } + + + public CustomOAuth2Model accessTokenEndpoint(@javax.annotation.Nonnull String accessTokenEndpoint) { + this.accessTokenEndpoint = accessTokenEndpoint; + return this; + } + + /** + * The Access Token endpoint for the OAuth2 provider. + * @return accessTokenEndpoint + */ + @javax.annotation.Nonnull + public String getAccessTokenEndpoint() { + return accessTokenEndpoint; + } + + public void setAccessTokenEndpoint(@javax.annotation.Nonnull String accessTokenEndpoint) { + this.accessTokenEndpoint = accessTokenEndpoint; + } + + + public CustomOAuth2Model applicationKey(@javax.annotation.Nonnull String applicationKey) { + this.applicationKey = applicationKey; + return this; + } + + /** + * The application key for the OAuth2 provider. + * @return applicationKey + */ + @javax.annotation.Nonnull + public String getApplicationKey() { + return applicationKey; + } + + public void setApplicationKey(@javax.annotation.Nonnull String applicationKey) { + this.applicationKey = applicationKey; + } + + + public CustomOAuth2Model applicationSecret(@javax.annotation.Nonnull String applicationSecret) { + this.applicationSecret = applicationSecret; + return this; + } + + /** + * The application secret for the OAuth2 provider. + * @return applicationSecret + */ + @javax.annotation.Nonnull + public String getApplicationSecret() { + return applicationSecret; + } + + public void setApplicationSecret(@javax.annotation.Nonnull String applicationSecret) { + this.applicationSecret = applicationSecret; + } + + + public CustomOAuth2Model enableAutoLookUp(@javax.annotation.Nullable Boolean enableAutoLookUp) { + this.enableAutoLookUp = enableAutoLookUp; + return this; + } + + /** + * Indicates if auto lookup is enabled. + * @return enableAutoLookUp + */ + @javax.annotation.Nullable + public Boolean getEnableAutoLookUp() { + return enableAutoLookUp; + } + + public void setEnableAutoLookUp(@javax.annotation.Nullable Boolean enableAutoLookUp) { + this.enableAutoLookUp = enableAutoLookUp; + } + + + public CustomOAuth2Model domain(@javax.annotation.Nullable String domain) { + this.domain = domain; + return this; + } + + /** + * The domain for the OAuth2 provider. + * @return domain + */ + @javax.annotation.Nullable + public String getDomain() { + return domain; + } + + public void setDomain(@javax.annotation.Nullable String domain) { + this.domain = domain; + } + + + public CustomOAuth2Model applicationID(@javax.annotation.Nullable String applicationID) { + this.applicationID = applicationID; + return this; + } + + /** + * The application ID for the OAuth2 provider. + * @return applicationID + */ + @javax.annotation.Nullable + public String getApplicationID() { + return applicationID; + } + + public void setApplicationID(@javax.annotation.Nullable String applicationID) { + this.applicationID = applicationID; + } + + + public CustomOAuth2Model scope(@javax.annotation.Nonnull String scope) { + this.scope = scope; + return this; + } + + /** + * The scope for the OAuth2 provider. + * @return scope + */ + @javax.annotation.Nonnull + public String getScope() { + return scope; + } + + public void setScope(@javax.annotation.Nonnull String scope) { + this.scope = scope; + } + + + public CustomOAuth2Model responseType(@javax.annotation.Nonnull String responseType) { + this.responseType = responseType; + return this; + } + + /** + * The response type for the OAuth2 provider. + * @return responseType + */ + @javax.annotation.Nonnull + public String getResponseType() { + return responseType; + } + + public void setResponseType(@javax.annotation.Nonnull String responseType) { + this.responseType = responseType; + } + + + public CustomOAuth2Model userprofileEndpoint(@javax.annotation.Nullable String userprofileEndpoint) { + this.userprofileEndpoint = userprofileEndpoint; + return this; + } + + /** + * The User profile endpoint for the OAuth2 provider. + * @return userprofileEndpoint + */ + @javax.annotation.Nullable + public String getUserprofileEndpoint() { + return userprofileEndpoint; + } + + public void setUserprofileEndpoint(@javax.annotation.Nullable String userprofileEndpoint) { + this.userprofileEndpoint = userprofileEndpoint; + } + + + public CustomOAuth2Model userInfoExtractByIdToken(@javax.annotation.Nullable Boolean userInfoExtractByIdToken) { + this.userInfoExtractByIdToken = userInfoExtractByIdToken; + return this; + } + + /** + * Indicates if user info should be extracted by ID token. + * @return userInfoExtractByIdToken + */ + @javax.annotation.Nullable + public Boolean getUserInfoExtractByIdToken() { + return userInfoExtractByIdToken; + } + + public void setUserInfoExtractByIdToken(@javax.annotation.Nullable Boolean userInfoExtractByIdToken) { + this.userInfoExtractByIdToken = userInfoExtractByIdToken; + } + + + public CustomOAuth2Model jwKSEndpoint(@javax.annotation.Nullable String jwKSEndpoint) { + this.jwKSEndpoint = jwKSEndpoint; + return this; + } + + /** + * The JWKS endpoint for verifying the ID token. + * @return jwKSEndpoint + */ + @javax.annotation.Nullable + public String getJwKSEndpoint() { + return jwKSEndpoint; + } + + public void setJwKSEndpoint(@javax.annotation.Nullable String jwKSEndpoint) { + this.jwKSEndpoint = jwKSEndpoint; + } + + + public CustomOAuth2Model dataMap(@javax.annotation.Nonnull Map<String, String> dataMap) { + this.dataMap = dataMap; + return this; + } + + public CustomOAuth2Model putDataMapItem(String key, String dataMapItem) { + if (this.dataMap == null) { + this.dataMap = new HashMap<>(); + } + this.dataMap.put(key, dataMapItem); + return this; + } + + /** + * The data map for the OAuth2 provider. + * @return dataMap + */ + @javax.annotation.Nonnull + public Map<String, String> getDataMap() { + return dataMap; + } + + public void setDataMap(@javax.annotation.Nonnull Map<String, String> dataMap) { + this.dataMap = dataMap; + } + + + public CustomOAuth2Model accessTokenParameterNameForApiAccess(@javax.annotation.Nullable String accessTokenParameterNameForApiAccess) { + this.accessTokenParameterNameForApiAccess = accessTokenParameterNameForApiAccess; + return this; + } + + /** + * The Access Token parameter name for API access. + * @return accessTokenParameterNameForApiAccess + */ + @javax.annotation.Nullable + public String getAccessTokenParameterNameForApiAccess() { + return accessTokenParameterNameForApiAccess; + } + + public void setAccessTokenParameterNameForApiAccess(@javax.annotation.Nullable String accessTokenParameterNameForApiAccess) { + this.accessTokenParameterNameForApiAccess = accessTokenParameterNameForApiAccess; + } + + + public CustomOAuth2Model trasnsportType(@javax.annotation.Nullable String trasnsportType) { + this.trasnsportType = trasnsportType; + return this; + } + + /** + * The transport type. + * @return trasnsportType + */ + @javax.annotation.Nullable + public String getTrasnsportType() { + return trasnsportType; + } + + public void setTrasnsportType(@javax.annotation.Nullable String trasnsportType) { + this.trasnsportType = trasnsportType; + } + + + public CustomOAuth2Model requestTokenHttpMethod(@javax.annotation.Nonnull RequestTokenHttpMethodEnum requestTokenHttpMethod) { + this.requestTokenHttpMethod = requestTokenHttpMethod; + return this; + } + + /** + * The HTTP method for requesting tokens. + * @return requestTokenHttpMethod + */ + @javax.annotation.Nonnull + public RequestTokenHttpMethodEnum getRequestTokenHttpMethod() { + return requestTokenHttpMethod; + } + + public void setRequestTokenHttpMethod(@javax.annotation.Nonnull RequestTokenHttpMethodEnum requestTokenHttpMethod) { + this.requestTokenHttpMethod = requestTokenHttpMethod; + } + + + public CustomOAuth2Model headers(@javax.annotation.Nullable Map<String, String> headers) { + this.headers = headers; + return this; + } + + public CustomOAuth2Model putHeadersItem(String key, String headersItem) { + if (this.headers == null) { + this.headers = new HashMap<>(); + } + this.headers.put(key, headersItem); + return this; + } + + /** + * The headers for the OAuth2 provider. + * @return headers + */ + @javax.annotation.Nullable + public Map<String, String> getHeaders() { + return headers; + } + + public void setHeaders(@javax.annotation.Nullable Map<String, String> headers) { + this.headers = headers; + } + + + public CustomOAuth2Model queryParam(@javax.annotation.Nullable Map<String, String> queryParam) { + this.queryParam = queryParam; + return this; + } + + public CustomOAuth2Model putQueryParamItem(String key, String queryParamItem) { + if (this.queryParam == null) { + this.queryParam = new HashMap<>(); + } + this.queryParam.put(key, queryParamItem); + return this; + } + + /** + * The query parameters for the OAuth2 provider. + * @return queryParam + */ + @javax.annotation.Nullable + public Map<String, String> getQueryParam() { + return queryParam; + } + + public void setQueryParam(@javax.annotation.Nullable Map<String, String> queryParam) { + this.queryParam = queryParam; + } + + + public CustomOAuth2Model listInInterface(@javax.annotation.Nullable Boolean listInInterface) { + this.listInInterface = listInInterface; + return this; + } + + /** + * Indicates if the provider should be listed in the interface. + * @return listInInterface + */ + @javax.annotation.Nullable + public Boolean getListInInterface() { + return listInInterface; + } + + public void setListInInterface(@javax.annotation.Nullable Boolean listInInterface) { + this.listInInterface = listInInterface; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CustomOAuth2Model instance itself + */ + public CustomOAuth2Model putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CustomOAuth2Model customOAuth2Model = (CustomOAuth2Model) o; + return Objects.equals(this.providerName, customOAuth2Model.providerName) && + Objects.equals(this.extraParameterInRedirectToProvider, customOAuth2Model.extraParameterInRedirectToProvider) && + Objects.equals(this.userLoginEndpoint, customOAuth2Model.userLoginEndpoint) && + Objects.equals(this.accessTokenEndpoint, customOAuth2Model.accessTokenEndpoint) && + Objects.equals(this.applicationKey, customOAuth2Model.applicationKey) && + Objects.equals(this.applicationSecret, customOAuth2Model.applicationSecret) && + Objects.equals(this.enableAutoLookUp, customOAuth2Model.enableAutoLookUp) && + Objects.equals(this.domain, customOAuth2Model.domain) && + Objects.equals(this.applicationID, customOAuth2Model.applicationID) && + Objects.equals(this.scope, customOAuth2Model.scope) && + Objects.equals(this.responseType, customOAuth2Model.responseType) && + Objects.equals(this.userprofileEndpoint, customOAuth2Model.userprofileEndpoint) && + Objects.equals(this.userInfoExtractByIdToken, customOAuth2Model.userInfoExtractByIdToken) && + Objects.equals(this.jwKSEndpoint, customOAuth2Model.jwKSEndpoint) && + Objects.equals(this.dataMap, customOAuth2Model.dataMap) && + Objects.equals(this.accessTokenParameterNameForApiAccess, customOAuth2Model.accessTokenParameterNameForApiAccess) && + Objects.equals(this.trasnsportType, customOAuth2Model.trasnsportType) && + Objects.equals(this.requestTokenHttpMethod, customOAuth2Model.requestTokenHttpMethod) && + Objects.equals(this.headers, customOAuth2Model.headers) && + Objects.equals(this.queryParam, customOAuth2Model.queryParam) && + Objects.equals(this.listInInterface, customOAuth2Model.listInInterface)&& + Objects.equals(this.additionalProperties, customOAuth2Model.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(providerName, extraParameterInRedirectToProvider, userLoginEndpoint, accessTokenEndpoint, applicationKey, applicationSecret, enableAutoLookUp, domain, applicationID, scope, responseType, userprofileEndpoint, userInfoExtractByIdToken, jwKSEndpoint, dataMap, accessTokenParameterNameForApiAccess, trasnsportType, requestTokenHttpMethod, headers, queryParam, listInInterface, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CustomOAuth2Model {\n"); + sb.append(" providerName: ").append(toIndentedString(providerName)).append("\n"); + sb.append(" extraParameterInRedirectToProvider: ").append(toIndentedString(extraParameterInRedirectToProvider)).append("\n"); + sb.append(" userLoginEndpoint: ").append(toIndentedString(userLoginEndpoint)).append("\n"); + sb.append(" accessTokenEndpoint: ").append(toIndentedString(accessTokenEndpoint)).append("\n"); + sb.append(" applicationKey: ").append(toIndentedString(applicationKey)).append("\n"); + sb.append(" applicationSecret: ").append(toIndentedString(applicationSecret)).append("\n"); + sb.append(" enableAutoLookUp: ").append(toIndentedString(enableAutoLookUp)).append("\n"); + sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); + sb.append(" applicationID: ").append(toIndentedString(applicationID)).append("\n"); + sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); + sb.append(" responseType: ").append(toIndentedString(responseType)).append("\n"); + sb.append(" userprofileEndpoint: ").append(toIndentedString(userprofileEndpoint)).append("\n"); + sb.append(" userInfoExtractByIdToken: ").append(toIndentedString(userInfoExtractByIdToken)).append("\n"); + sb.append(" jwKSEndpoint: ").append(toIndentedString(jwKSEndpoint)).append("\n"); + sb.append(" dataMap: ").append(toIndentedString(dataMap)).append("\n"); + sb.append(" accessTokenParameterNameForApiAccess: ").append(toIndentedString(accessTokenParameterNameForApiAccess)).append("\n"); + sb.append(" trasnsportType: ").append(toIndentedString(trasnsportType)).append("\n"); + sb.append(" requestTokenHttpMethod: ").append(toIndentedString(requestTokenHttpMethod)).append("\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append(" queryParam: ").append(toIndentedString(queryParam)).append("\n"); + sb.append(" listInInterface: ").append(toIndentedString(listInInterface)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ProviderName"); + openapiFields.add("ExtraParameterInRedirectToProvider"); + openapiFields.add("UserLoginEndpoint"); + openapiFields.add("AccessTokenEndpoint"); + openapiFields.add("ApplicationKey"); + openapiFields.add("ApplicationSecret"); + openapiFields.add("EnableAutoLookUp"); + openapiFields.add("Domain"); + openapiFields.add("ApplicationID"); + openapiFields.add("Scope"); + openapiFields.add("ResponseType"); + openapiFields.add("UserprofileEndpoint"); + openapiFields.add("UserInfoExtractByIdToken"); + openapiFields.add("JWKSEndpoint"); + openapiFields.add("DataMap"); + openapiFields.add("AccessTokenParameterNameForApiAccess"); + openapiFields.add("TrasnsportType"); + openapiFields.add("RequestTokenHttpMethod"); + openapiFields.add("Headers"); + openapiFields.add("QueryParam"); + openapiFields.add("ListInInterface"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("ProviderName"); + openapiRequiredFields.add("UserLoginEndpoint"); + openapiRequiredFields.add("AccessTokenEndpoint"); + openapiRequiredFields.add("ApplicationKey"); + openapiRequiredFields.add("ApplicationSecret"); + openapiRequiredFields.add("Scope"); + openapiRequiredFields.add("ResponseType"); + openapiRequiredFields.add("DataMap"); + openapiRequiredFields.add("RequestTokenHttpMethod"); + } + + /** + * 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 CustomOAuth2Model + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CustomOAuth2Model.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CustomOAuth2Model is not found in the empty JSON string", CustomOAuth2Model.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CustomOAuth2Model.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("ProviderName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProviderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProviderName").toString())); + } + if ((jsonObj.get("ExtraParameterInRedirectToProvider") != null && !jsonObj.get("ExtraParameterInRedirectToProvider").isJsonNull()) && !jsonObj.get("ExtraParameterInRedirectToProvider").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ExtraParameterInRedirectToProvider` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ExtraParameterInRedirectToProvider").toString())); + } + if (!jsonObj.get("UserLoginEndpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UserLoginEndpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UserLoginEndpoint").toString())); + } + if (!jsonObj.get("AccessTokenEndpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccessTokenEndpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccessTokenEndpoint").toString())); + } + if (!jsonObj.get("ApplicationKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ApplicationKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ApplicationKey").toString())); + } + if (!jsonObj.get("ApplicationSecret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ApplicationSecret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ApplicationSecret").toString())); + } + if ((jsonObj.get("Domain") != null && !jsonObj.get("Domain").isJsonNull()) && !jsonObj.get("Domain").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Domain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Domain").toString())); + } + if ((jsonObj.get("ApplicationID") != null && !jsonObj.get("ApplicationID").isJsonNull()) && !jsonObj.get("ApplicationID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ApplicationID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ApplicationID").toString())); + } + if (!jsonObj.get("Scope").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Scope").toString())); + } + if (!jsonObj.get("ResponseType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ResponseType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ResponseType").toString())); + } + if ((jsonObj.get("UserprofileEndpoint") != null && !jsonObj.get("UserprofileEndpoint").isJsonNull()) && !jsonObj.get("UserprofileEndpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UserprofileEndpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UserprofileEndpoint").toString())); + } + if ((jsonObj.get("JWKSEndpoint") != null && !jsonObj.get("JWKSEndpoint").isJsonNull()) && !jsonObj.get("JWKSEndpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `JWKSEndpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("JWKSEndpoint").toString())); + } + if ((jsonObj.get("AccessTokenParameterNameForApiAccess") != null && !jsonObj.get("AccessTokenParameterNameForApiAccess").isJsonNull()) && !jsonObj.get("AccessTokenParameterNameForApiAccess").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccessTokenParameterNameForApiAccess` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccessTokenParameterNameForApiAccess").toString())); + } + if ((jsonObj.get("TrasnsportType") != null && !jsonObj.get("TrasnsportType").isJsonNull()) && !jsonObj.get("TrasnsportType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TrasnsportType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TrasnsportType").toString())); + } + if (!jsonObj.get("RequestTokenHttpMethod").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RequestTokenHttpMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RequestTokenHttpMethod").toString())); + } + // validate the required field `RequestTokenHttpMethod` + RequestTokenHttpMethodEnum.validateJsonElement(jsonObj.get("RequestTokenHttpMethod")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!CustomOAuth2Model.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CustomOAuth2Model' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<CustomOAuth2Model> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CustomOAuth2Model.class)); + + return (TypeAdapter<T>) new TypeAdapter<CustomOAuth2Model>() { + @Override + public void write(JsonWriter out, CustomOAuth2Model value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CustomOAuth2Model read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CustomOAuth2Model instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CustomOAuth2Model given an JSON string + * + * @param jsonString JSON string + * @return An instance of CustomOAuth2Model + * @throws IOException if the JSON string is invalid with respect to CustomOAuth2Model + */ + public static CustomOAuth2Model fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CustomOAuth2Model.class); + } + + /** + * Convert an instance of CustomOAuth2Model to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/CustomOAuth2UpdateModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/CustomOAuth2UpdateModel.java new file mode 100644 index 0000000..d13c8e4 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/CustomOAuth2UpdateModel.java @@ -0,0 +1,801 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * CustomOAuth2UpdateModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class CustomOAuth2UpdateModel { + public static final String SERIALIZED_NAME_PROVIDER_NAME = "ProviderName"; + @SerializedName(SERIALIZED_NAME_PROVIDER_NAME) + @javax.annotation.Nonnull + private String providerName; + + public static final String SERIALIZED_NAME_EXTRA_PARAMETER_IN_REDIRECT_TO_PROVIDER = "ExtraParameterInRedirectToProvider"; + @SerializedName(SERIALIZED_NAME_EXTRA_PARAMETER_IN_REDIRECT_TO_PROVIDER) + @javax.annotation.Nullable + private String extraParameterInRedirectToProvider; + + public static final String SERIALIZED_NAME_ENABLE_AUTO_LOOK_UP = "EnableAutoLookUp"; + @SerializedName(SERIALIZED_NAME_ENABLE_AUTO_LOOK_UP) + @javax.annotation.Nullable + private Boolean enableAutoLookUp; + + public static final String SERIALIZED_NAME_DOMAIN = "Domain"; + @SerializedName(SERIALIZED_NAME_DOMAIN) + @javax.annotation.Nullable + private String domain; + + public static final String SERIALIZED_NAME_USER_LOGIN_ENDPOINT = "UserLoginEndpoint"; + @SerializedName(SERIALIZED_NAME_USER_LOGIN_ENDPOINT) + @javax.annotation.Nullable + private String userLoginEndpoint; + + public static final String SERIALIZED_NAME_ACCESS_TOKEN_ENDPOINT = "AccessTokenEndpoint"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN_ENDPOINT) + @javax.annotation.Nullable + private String accessTokenEndpoint; + + public static final String SERIALIZED_NAME_APPLICATION_KEY = "ApplicationKey"; + @SerializedName(SERIALIZED_NAME_APPLICATION_KEY) + @javax.annotation.Nullable + private String applicationKey; + + public static final String SERIALIZED_NAME_APPLICATION_SECRET = "ApplicationSecret"; + @SerializedName(SERIALIZED_NAME_APPLICATION_SECRET) + @javax.annotation.Nullable + private String applicationSecret; + + public static final String SERIALIZED_NAME_APPLICATION_I_D = "ApplicationID"; + @SerializedName(SERIALIZED_NAME_APPLICATION_I_D) + @javax.annotation.Nullable + private String applicationID; + + public static final String SERIALIZED_NAME_SCOPE = "Scope"; + @SerializedName(SERIALIZED_NAME_SCOPE) + @javax.annotation.Nullable + private String scope; + + public static final String SERIALIZED_NAME_RESPONSE_TYPE = "ResponseType"; + @SerializedName(SERIALIZED_NAME_RESPONSE_TYPE) + @javax.annotation.Nullable + private String responseType; + + public static final String SERIALIZED_NAME_USERPROFILE_ENDPOINT = "UserprofileEndpoint"; + @SerializedName(SERIALIZED_NAME_USERPROFILE_ENDPOINT) + @javax.annotation.Nullable + private String userprofileEndpoint; + + public static final String SERIALIZED_NAME_DATA_MAP = "DataMap"; + @SerializedName(SERIALIZED_NAME_DATA_MAP) + @javax.annotation.Nullable + private Map<String, String> dataMap = new HashMap<>(); + + public static final String SERIALIZED_NAME_ACCESS_TOKEN_PARAMETER_NAME_FOR_API_ACCESS = "AccessTokenParameterNameForApiAccess"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN_PARAMETER_NAME_FOR_API_ACCESS) + @javax.annotation.Nullable + private String accessTokenParameterNameForApiAccess; + + public static final String SERIALIZED_NAME_REQUEST_TOKEN_HTTP_METHOD = "RequestTokenHttpMethod"; + @SerializedName(SERIALIZED_NAME_REQUEST_TOKEN_HTTP_METHOD) + @javax.annotation.Nullable + private String requestTokenHttpMethod; + + public static final String SERIALIZED_NAME_HEADERS = "Headers"; + @SerializedName(SERIALIZED_NAME_HEADERS) + @javax.annotation.Nullable + private Map<String, String> headers = new HashMap<>(); + + public static final String SERIALIZED_NAME_QUERY_PARAM = "QueryParam"; + @SerializedName(SERIALIZED_NAME_QUERY_PARAM) + @javax.annotation.Nullable + private Map<String, String> queryParam = new HashMap<>(); + + public CustomOAuth2UpdateModel() { + } + + public CustomOAuth2UpdateModel providerName(@javax.annotation.Nonnull String providerName) { + this.providerName = providerName; + return this; + } + + /** + * The name of the OAuth2 provider. + * @return providerName + */ + @javax.annotation.Nonnull + public String getProviderName() { + return providerName; + } + + public void setProviderName(@javax.annotation.Nonnull String providerName) { + this.providerName = providerName; + } + + + public CustomOAuth2UpdateModel extraParameterInRedirectToProvider(@javax.annotation.Nullable String extraParameterInRedirectToProvider) { + this.extraParameterInRedirectToProvider = extraParameterInRedirectToProvider; + return this; + } + + /** + * Extra parameters in redirect to provider. + * @return extraParameterInRedirectToProvider + */ + @javax.annotation.Nullable + public String getExtraParameterInRedirectToProvider() { + return extraParameterInRedirectToProvider; + } + + public void setExtraParameterInRedirectToProvider(@javax.annotation.Nullable String extraParameterInRedirectToProvider) { + this.extraParameterInRedirectToProvider = extraParameterInRedirectToProvider; + } + + + public CustomOAuth2UpdateModel enableAutoLookUp(@javax.annotation.Nullable Boolean enableAutoLookUp) { + this.enableAutoLookUp = enableAutoLookUp; + return this; + } + + /** + * Indicates if auto lookup is enabled. + * @return enableAutoLookUp + */ + @javax.annotation.Nullable + public Boolean getEnableAutoLookUp() { + return enableAutoLookUp; + } + + public void setEnableAutoLookUp(@javax.annotation.Nullable Boolean enableAutoLookUp) { + this.enableAutoLookUp = enableAutoLookUp; + } + + + public CustomOAuth2UpdateModel domain(@javax.annotation.Nullable String domain) { + this.domain = domain; + return this; + } + + /** + * The domain for the OAuth2 provider. + * @return domain + */ + @javax.annotation.Nullable + public String getDomain() { + return domain; + } + + public void setDomain(@javax.annotation.Nullable String domain) { + this.domain = domain; + } + + + public CustomOAuth2UpdateModel userLoginEndpoint(@javax.annotation.Nullable String userLoginEndpoint) { + this.userLoginEndpoint = userLoginEndpoint; + return this; + } + + /** + * The User login endpoint for the OAuth2 provider. + * @return userLoginEndpoint + */ + @javax.annotation.Nullable + public String getUserLoginEndpoint() { + return userLoginEndpoint; + } + + public void setUserLoginEndpoint(@javax.annotation.Nullable String userLoginEndpoint) { + this.userLoginEndpoint = userLoginEndpoint; + } + + + public CustomOAuth2UpdateModel accessTokenEndpoint(@javax.annotation.Nullable String accessTokenEndpoint) { + this.accessTokenEndpoint = accessTokenEndpoint; + return this; + } + + /** + * The Access Token endpoint for the OAuth2 provider. + * @return accessTokenEndpoint + */ + @javax.annotation.Nullable + public String getAccessTokenEndpoint() { + return accessTokenEndpoint; + } + + public void setAccessTokenEndpoint(@javax.annotation.Nullable String accessTokenEndpoint) { + this.accessTokenEndpoint = accessTokenEndpoint; + } + + + public CustomOAuth2UpdateModel applicationKey(@javax.annotation.Nullable String applicationKey) { + this.applicationKey = applicationKey; + return this; + } + + /** + * The application key for the OAuth2 provider. + * @return applicationKey + */ + @javax.annotation.Nullable + public String getApplicationKey() { + return applicationKey; + } + + public void setApplicationKey(@javax.annotation.Nullable String applicationKey) { + this.applicationKey = applicationKey; + } + + + public CustomOAuth2UpdateModel applicationSecret(@javax.annotation.Nullable String applicationSecret) { + this.applicationSecret = applicationSecret; + return this; + } + + /** + * The application secret for the OAuth2 provider. + * @return applicationSecret + */ + @javax.annotation.Nullable + public String getApplicationSecret() { + return applicationSecret; + } + + public void setApplicationSecret(@javax.annotation.Nullable String applicationSecret) { + this.applicationSecret = applicationSecret; + } + + + public CustomOAuth2UpdateModel applicationID(@javax.annotation.Nullable String applicationID) { + this.applicationID = applicationID; + return this; + } + + /** + * The application ID for the OAuth2 provider. + * @return applicationID + */ + @javax.annotation.Nullable + public String getApplicationID() { + return applicationID; + } + + public void setApplicationID(@javax.annotation.Nullable String applicationID) { + this.applicationID = applicationID; + } + + + public CustomOAuth2UpdateModel scope(@javax.annotation.Nullable String scope) { + this.scope = scope; + return this; + } + + /** + * The scope for the OAuth2 provider. + * @return scope + */ + @javax.annotation.Nullable + public String getScope() { + return scope; + } + + public void setScope(@javax.annotation.Nullable String scope) { + this.scope = scope; + } + + + public CustomOAuth2UpdateModel responseType(@javax.annotation.Nullable String responseType) { + this.responseType = responseType; + return this; + } + + /** + * The response type for the OAuth2 provider. + * @return responseType + */ + @javax.annotation.Nullable + public String getResponseType() { + return responseType; + } + + public void setResponseType(@javax.annotation.Nullable String responseType) { + this.responseType = responseType; + } + + + public CustomOAuth2UpdateModel userprofileEndpoint(@javax.annotation.Nullable String userprofileEndpoint) { + this.userprofileEndpoint = userprofileEndpoint; + return this; + } + + /** + * The User profile endpoint for the OAuth2 provider. + * @return userprofileEndpoint + */ + @javax.annotation.Nullable + public String getUserprofileEndpoint() { + return userprofileEndpoint; + } + + public void setUserprofileEndpoint(@javax.annotation.Nullable String userprofileEndpoint) { + this.userprofileEndpoint = userprofileEndpoint; + } + + + public CustomOAuth2UpdateModel dataMap(@javax.annotation.Nullable Map<String, String> dataMap) { + this.dataMap = dataMap; + return this; + } + + public CustomOAuth2UpdateModel putDataMapItem(String key, String dataMapItem) { + if (this.dataMap == null) { + this.dataMap = new HashMap<>(); + } + this.dataMap.put(key, dataMapItem); + return this; + } + + /** + * The data map for the OAuth2 provider. + * @return dataMap + */ + @javax.annotation.Nullable + public Map<String, String> getDataMap() { + return dataMap; + } + + public void setDataMap(@javax.annotation.Nullable Map<String, String> dataMap) { + this.dataMap = dataMap; + } + + + public CustomOAuth2UpdateModel accessTokenParameterNameForApiAccess(@javax.annotation.Nullable String accessTokenParameterNameForApiAccess) { + this.accessTokenParameterNameForApiAccess = accessTokenParameterNameForApiAccess; + return this; + } + + /** + * The Access Token parameter name for API access. + * @return accessTokenParameterNameForApiAccess + */ + @javax.annotation.Nullable + public String getAccessTokenParameterNameForApiAccess() { + return accessTokenParameterNameForApiAccess; + } + + public void setAccessTokenParameterNameForApiAccess(@javax.annotation.Nullable String accessTokenParameterNameForApiAccess) { + this.accessTokenParameterNameForApiAccess = accessTokenParameterNameForApiAccess; + } + + + public CustomOAuth2UpdateModel requestTokenHttpMethod(@javax.annotation.Nullable String requestTokenHttpMethod) { + this.requestTokenHttpMethod = requestTokenHttpMethod; + return this; + } + + /** + * The HTTP method for requesting tokens. + * @return requestTokenHttpMethod + */ + @javax.annotation.Nullable + public String getRequestTokenHttpMethod() { + return requestTokenHttpMethod; + } + + public void setRequestTokenHttpMethod(@javax.annotation.Nullable String requestTokenHttpMethod) { + this.requestTokenHttpMethod = requestTokenHttpMethod; + } + + + public CustomOAuth2UpdateModel headers(@javax.annotation.Nullable Map<String, String> headers) { + this.headers = headers; + return this; + } + + public CustomOAuth2UpdateModel putHeadersItem(String key, String headersItem) { + if (this.headers == null) { + this.headers = new HashMap<>(); + } + this.headers.put(key, headersItem); + return this; + } + + /** + * The headers for the OAuth2 provider. + * @return headers + */ + @javax.annotation.Nullable + public Map<String, String> getHeaders() { + return headers; + } + + public void setHeaders(@javax.annotation.Nullable Map<String, String> headers) { + this.headers = headers; + } + + + public CustomOAuth2UpdateModel queryParam(@javax.annotation.Nullable Map<String, String> queryParam) { + this.queryParam = queryParam; + return this; + } + + public CustomOAuth2UpdateModel putQueryParamItem(String key, String queryParamItem) { + if (this.queryParam == null) { + this.queryParam = new HashMap<>(); + } + this.queryParam.put(key, queryParamItem); + return this; + } + + /** + * The query parameters for the OAuth2 provider. + * @return queryParam + */ + @javax.annotation.Nullable + public Map<String, String> getQueryParam() { + return queryParam; + } + + public void setQueryParam(@javax.annotation.Nullable Map<String, String> queryParam) { + this.queryParam = queryParam; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CustomOAuth2UpdateModel instance itself + */ + public CustomOAuth2UpdateModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CustomOAuth2UpdateModel customOAuth2UpdateModel = (CustomOAuth2UpdateModel) o; + return Objects.equals(this.providerName, customOAuth2UpdateModel.providerName) && + Objects.equals(this.extraParameterInRedirectToProvider, customOAuth2UpdateModel.extraParameterInRedirectToProvider) && + Objects.equals(this.enableAutoLookUp, customOAuth2UpdateModel.enableAutoLookUp) && + Objects.equals(this.domain, customOAuth2UpdateModel.domain) && + Objects.equals(this.userLoginEndpoint, customOAuth2UpdateModel.userLoginEndpoint) && + Objects.equals(this.accessTokenEndpoint, customOAuth2UpdateModel.accessTokenEndpoint) && + Objects.equals(this.applicationKey, customOAuth2UpdateModel.applicationKey) && + Objects.equals(this.applicationSecret, customOAuth2UpdateModel.applicationSecret) && + Objects.equals(this.applicationID, customOAuth2UpdateModel.applicationID) && + Objects.equals(this.scope, customOAuth2UpdateModel.scope) && + Objects.equals(this.responseType, customOAuth2UpdateModel.responseType) && + Objects.equals(this.userprofileEndpoint, customOAuth2UpdateModel.userprofileEndpoint) && + Objects.equals(this.dataMap, customOAuth2UpdateModel.dataMap) && + Objects.equals(this.accessTokenParameterNameForApiAccess, customOAuth2UpdateModel.accessTokenParameterNameForApiAccess) && + Objects.equals(this.requestTokenHttpMethod, customOAuth2UpdateModel.requestTokenHttpMethod) && + Objects.equals(this.headers, customOAuth2UpdateModel.headers) && + Objects.equals(this.queryParam, customOAuth2UpdateModel.queryParam)&& + Objects.equals(this.additionalProperties, customOAuth2UpdateModel.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(providerName, extraParameterInRedirectToProvider, enableAutoLookUp, domain, userLoginEndpoint, accessTokenEndpoint, applicationKey, applicationSecret, applicationID, scope, responseType, userprofileEndpoint, dataMap, accessTokenParameterNameForApiAccess, requestTokenHttpMethod, headers, queryParam, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CustomOAuth2UpdateModel {\n"); + sb.append(" providerName: ").append(toIndentedString(providerName)).append("\n"); + sb.append(" extraParameterInRedirectToProvider: ").append(toIndentedString(extraParameterInRedirectToProvider)).append("\n"); + sb.append(" enableAutoLookUp: ").append(toIndentedString(enableAutoLookUp)).append("\n"); + sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); + sb.append(" userLoginEndpoint: ").append(toIndentedString(userLoginEndpoint)).append("\n"); + sb.append(" accessTokenEndpoint: ").append(toIndentedString(accessTokenEndpoint)).append("\n"); + sb.append(" applicationKey: ").append(toIndentedString(applicationKey)).append("\n"); + sb.append(" applicationSecret: ").append(toIndentedString(applicationSecret)).append("\n"); + sb.append(" applicationID: ").append(toIndentedString(applicationID)).append("\n"); + sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); + sb.append(" responseType: ").append(toIndentedString(responseType)).append("\n"); + sb.append(" userprofileEndpoint: ").append(toIndentedString(userprofileEndpoint)).append("\n"); + sb.append(" dataMap: ").append(toIndentedString(dataMap)).append("\n"); + sb.append(" accessTokenParameterNameForApiAccess: ").append(toIndentedString(accessTokenParameterNameForApiAccess)).append("\n"); + sb.append(" requestTokenHttpMethod: ").append(toIndentedString(requestTokenHttpMethod)).append("\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append(" queryParam: ").append(toIndentedString(queryParam)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ProviderName"); + openapiFields.add("ExtraParameterInRedirectToProvider"); + openapiFields.add("EnableAutoLookUp"); + openapiFields.add("Domain"); + openapiFields.add("UserLoginEndpoint"); + openapiFields.add("AccessTokenEndpoint"); + openapiFields.add("ApplicationKey"); + openapiFields.add("ApplicationSecret"); + openapiFields.add("ApplicationID"); + openapiFields.add("Scope"); + openapiFields.add("ResponseType"); + openapiFields.add("UserprofileEndpoint"); + openapiFields.add("DataMap"); + openapiFields.add("AccessTokenParameterNameForApiAccess"); + openapiFields.add("RequestTokenHttpMethod"); + openapiFields.add("Headers"); + openapiFields.add("QueryParam"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("ProviderName"); + } + + /** + * 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 CustomOAuth2UpdateModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CustomOAuth2UpdateModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CustomOAuth2UpdateModel is not found in the empty JSON string", CustomOAuth2UpdateModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : CustomOAuth2UpdateModel.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("ProviderName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProviderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProviderName").toString())); + } + if ((jsonObj.get("ExtraParameterInRedirectToProvider") != null && !jsonObj.get("ExtraParameterInRedirectToProvider").isJsonNull()) && !jsonObj.get("ExtraParameterInRedirectToProvider").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ExtraParameterInRedirectToProvider` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ExtraParameterInRedirectToProvider").toString())); + } + if ((jsonObj.get("Domain") != null && !jsonObj.get("Domain").isJsonNull()) && !jsonObj.get("Domain").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Domain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Domain").toString())); + } + if ((jsonObj.get("UserLoginEndpoint") != null && !jsonObj.get("UserLoginEndpoint").isJsonNull()) && !jsonObj.get("UserLoginEndpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UserLoginEndpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UserLoginEndpoint").toString())); + } + if ((jsonObj.get("AccessTokenEndpoint") != null && !jsonObj.get("AccessTokenEndpoint").isJsonNull()) && !jsonObj.get("AccessTokenEndpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccessTokenEndpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccessTokenEndpoint").toString())); + } + if ((jsonObj.get("ApplicationKey") != null && !jsonObj.get("ApplicationKey").isJsonNull()) && !jsonObj.get("ApplicationKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ApplicationKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ApplicationKey").toString())); + } + if ((jsonObj.get("ApplicationSecret") != null && !jsonObj.get("ApplicationSecret").isJsonNull()) && !jsonObj.get("ApplicationSecret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ApplicationSecret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ApplicationSecret").toString())); + } + if ((jsonObj.get("ApplicationID") != null && !jsonObj.get("ApplicationID").isJsonNull()) && !jsonObj.get("ApplicationID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ApplicationID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ApplicationID").toString())); + } + if ((jsonObj.get("Scope") != null && !jsonObj.get("Scope").isJsonNull()) && !jsonObj.get("Scope").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Scope").toString())); + } + if ((jsonObj.get("ResponseType") != null && !jsonObj.get("ResponseType").isJsonNull()) && !jsonObj.get("ResponseType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ResponseType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ResponseType").toString())); + } + if ((jsonObj.get("UserprofileEndpoint") != null && !jsonObj.get("UserprofileEndpoint").isJsonNull()) && !jsonObj.get("UserprofileEndpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UserprofileEndpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UserprofileEndpoint").toString())); + } + if ((jsonObj.get("AccessTokenParameterNameForApiAccess") != null && !jsonObj.get("AccessTokenParameterNameForApiAccess").isJsonNull()) && !jsonObj.get("AccessTokenParameterNameForApiAccess").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccessTokenParameterNameForApiAccess` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccessTokenParameterNameForApiAccess").toString())); + } + if ((jsonObj.get("RequestTokenHttpMethod") != null && !jsonObj.get("RequestTokenHttpMethod").isJsonNull()) && !jsonObj.get("RequestTokenHttpMethod").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RequestTokenHttpMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RequestTokenHttpMethod").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!CustomOAuth2UpdateModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CustomOAuth2UpdateModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<CustomOAuth2UpdateModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CustomOAuth2UpdateModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<CustomOAuth2UpdateModel>() { + @Override + public void write(JsonWriter out, CustomOAuth2UpdateModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CustomOAuth2UpdateModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CustomOAuth2UpdateModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CustomOAuth2UpdateModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of CustomOAuth2UpdateModel + * @throws IOException if the JSON string is invalid with respect to CustomOAuth2UpdateModel + */ + public static CustomOAuth2UpdateModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CustomOAuth2UpdateModel.class); + } + + /** + * Convert an instance of CustomOAuth2UpdateModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/CustomObjectResponseModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/CustomObjectResponseModel.java new file mode 100644 index 0000000..0585818 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/CustomObjectResponseModel.java @@ -0,0 +1,463 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * CustomObjectResponseModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class CustomObjectResponseModel { + public static final String SERIALIZED_NAME_IS_ACTIVE = "IsActive"; + @SerializedName(SERIALIZED_NAME_IS_ACTIVE) + @javax.annotation.Nullable + private Boolean isActive; + + public static final String SERIALIZED_NAME_IS_DELETED = "IsDeleted"; + @SerializedName(SERIALIZED_NAME_IS_DELETED) + @javax.annotation.Nullable + private Boolean isDeleted; + + public static final String SERIALIZED_NAME_CUSTOM_OBJECT = "CustomObject"; + @SerializedName(SERIALIZED_NAME_CUSTOM_OBJECT) + @javax.annotation.Nullable + private Map<String, Object> customObject = new HashMap<>(); + + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_UID = "Uid"; + @SerializedName(SERIALIZED_NAME_UID) + @javax.annotation.Nullable + private String uid; + + public static final String SERIALIZED_NAME_DATE_CREATED = "DateCreated"; + @SerializedName(SERIALIZED_NAME_DATE_CREATED) + @javax.annotation.Nullable + private OffsetDateTime dateCreated; + + public static final String SERIALIZED_NAME_DATE_MODIFIED = "DateModified"; + @SerializedName(SERIALIZED_NAME_DATE_MODIFIED) + @javax.annotation.Nullable + private OffsetDateTime dateModified; + + public CustomObjectResponseModel() { + } + + public CustomObjectResponseModel isActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Get isActive + * @return isActive + */ + @javax.annotation.Nullable + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + } + + + public CustomObjectResponseModel isDeleted(@javax.annotation.Nullable Boolean isDeleted) { + this.isDeleted = isDeleted; + return this; + } + + /** + * Get isDeleted + * @return isDeleted + */ + @javax.annotation.Nullable + public Boolean getIsDeleted() { + return isDeleted; + } + + public void setIsDeleted(@javax.annotation.Nullable Boolean isDeleted) { + this.isDeleted = isDeleted; + } + + + public CustomObjectResponseModel customObject(@javax.annotation.Nullable Map<String, Object> customObject) { + this.customObject = customObject; + return this; + } + + public CustomObjectResponseModel putCustomObjectItem(String key, Object customObjectItem) { + if (this.customObject == null) { + this.customObject = new HashMap<>(); + } + this.customObject.put(key, customObjectItem); + return this; + } + + /** + * Get customObject + * @return customObject + */ + @javax.annotation.Nullable + public Map<String, Object> getCustomObject() { + return customObject; + } + + public void setCustomObject(@javax.annotation.Nullable Map<String, Object> customObject) { + this.customObject = customObject; + } + + + public CustomObjectResponseModel id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public CustomObjectResponseModel uid(@javax.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * Get uid + * @return uid + */ + @javax.annotation.Nullable + public String getUid() { + return uid; + } + + public void setUid(@javax.annotation.Nullable String uid) { + this.uid = uid; + } + + + public CustomObjectResponseModel dateCreated(@javax.annotation.Nullable OffsetDateTime dateCreated) { + this.dateCreated = dateCreated; + return this; + } + + /** + * Get dateCreated + * @return dateCreated + */ + @javax.annotation.Nullable + public OffsetDateTime getDateCreated() { + return dateCreated; + } + + public void setDateCreated(@javax.annotation.Nullable OffsetDateTime dateCreated) { + this.dateCreated = dateCreated; + } + + + public CustomObjectResponseModel dateModified(@javax.annotation.Nullable OffsetDateTime dateModified) { + this.dateModified = dateModified; + return this; + } + + /** + * Get dateModified + * @return dateModified + */ + @javax.annotation.Nullable + public OffsetDateTime getDateModified() { + return dateModified; + } + + public void setDateModified(@javax.annotation.Nullable OffsetDateTime dateModified) { + this.dateModified = dateModified; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CustomObjectResponseModel instance itself + */ + public CustomObjectResponseModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CustomObjectResponseModel customObjectResponseModel = (CustomObjectResponseModel) o; + return Objects.equals(this.isActive, customObjectResponseModel.isActive) && + Objects.equals(this.isDeleted, customObjectResponseModel.isDeleted) && + Objects.equals(this.customObject, customObjectResponseModel.customObject) && + Objects.equals(this.id, customObjectResponseModel.id) && + Objects.equals(this.uid, customObjectResponseModel.uid) && + Objects.equals(this.dateCreated, customObjectResponseModel.dateCreated) && + Objects.equals(this.dateModified, customObjectResponseModel.dateModified)&& + Objects.equals(this.additionalProperties, customObjectResponseModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isActive, isDeleted, customObject, id, uid, dateCreated, dateModified, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CustomObjectResponseModel {\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" isDeleted: ").append(toIndentedString(isDeleted)).append("\n"); + sb.append(" customObject: ").append(toIndentedString(customObject)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" dateCreated: ").append(toIndentedString(dateCreated)).append("\n"); + sb.append(" dateModified: ").append(toIndentedString(dateModified)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsActive"); + openapiFields.add("IsDeleted"); + openapiFields.add("CustomObject"); + openapiFields.add("Id"); + openapiFields.add("Uid"); + openapiFields.add("DateCreated"); + openapiFields.add("DateModified"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 CustomObjectResponseModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CustomObjectResponseModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CustomObjectResponseModel is not found in the empty JSON string", CustomObjectResponseModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Uid") != null && !jsonObj.get("Uid").isJsonNull()) && !jsonObj.get("Uid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Uid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Uid").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!CustomObjectResponseModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CustomObjectResponseModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<CustomObjectResponseModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CustomObjectResponseModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<CustomObjectResponseModel>() { + @Override + public void write(JsonWriter out, CustomObjectResponseModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CustomObjectResponseModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CustomObjectResponseModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CustomObjectResponseModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of CustomObjectResponseModel + * @throws IOException if the JSON string is invalid with respect to CustomObjectResponseModel + */ + public static CustomObjectResponseModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CustomObjectResponseModel.class); + } + + /** + * Convert an instance of CustomObjectResponseModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/CustomObjectsResponseModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/CustomObjectsResponseModel.java new file mode 100644 index 0000000..821e0c5 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/CustomObjectsResponseModel.java @@ -0,0 +1,336 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.CustomObjectResponseModel; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * CustomObjectsResponseModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class CustomObjectsResponseModel { + public static final String SERIALIZED_NAME_COUNT = "Count"; + @SerializedName(SERIALIZED_NAME_COUNT) + @javax.annotation.Nullable + private Integer count; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<CustomObjectResponseModel> data = new ArrayList<>(); + + public CustomObjectsResponseModel() { + } + + public CustomObjectsResponseModel count(@javax.annotation.Nullable Integer count) { + this.count = count; + return this; + } + + /** + * Get count + * @return count + */ + @javax.annotation.Nullable + public Integer getCount() { + return count; + } + + public void setCount(@javax.annotation.Nullable Integer count) { + this.count = count; + } + + + public CustomObjectsResponseModel data(@javax.annotation.Nullable List<CustomObjectResponseModel> data) { + this.data = data; + return this; + } + + public CustomObjectsResponseModel addDataItem(CustomObjectResponseModel dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<CustomObjectResponseModel> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<CustomObjectResponseModel> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CustomObjectsResponseModel instance itself + */ + public CustomObjectsResponseModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CustomObjectsResponseModel customObjectsResponseModel = (CustomObjectsResponseModel) o; + return Objects.equals(this.count, customObjectsResponseModel.count) && + Objects.equals(this.data, customObjectsResponseModel.data)&& + Objects.equals(this.additionalProperties, customObjectsResponseModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(count, data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CustomObjectsResponseModel {\n"); + sb.append(" count: ").append(toIndentedString(count)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Count"); + openapiFields.add("data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 CustomObjectsResponseModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CustomObjectsResponseModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CustomObjectsResponseModel is not found in the empty JSON string", CustomObjectsResponseModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + // validate the optional field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + CustomObjectResponseModel.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!CustomObjectsResponseModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CustomObjectsResponseModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<CustomObjectsResponseModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CustomObjectsResponseModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<CustomObjectsResponseModel>() { + @Override + public void write(JsonWriter out, CustomObjectsResponseModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CustomObjectsResponseModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CustomObjectsResponseModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CustomObjectsResponseModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of CustomObjectsResponseModel + * @throws IOException if the JSON string is invalid with respect to CustomObjectsResponseModel + */ + public static CustomObjectsResponseModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CustomObjectsResponseModel.class); + } + + /** + * Convert an instance of CustomObjectsResponseModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/CustomProviderKeys.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/CustomProviderKeys.java new file mode 100644 index 0000000..c2300da --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/CustomProviderKeys.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * CustomProviderKeys + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class CustomProviderKeys { + public static final String SERIALIZED_NAME_KEY = "Key"; + @SerializedName(SERIALIZED_NAME_KEY) + @javax.annotation.Nullable + private String key; + + public static final String SERIALIZED_NAME_DISPLAY = "Display"; + @SerializedName(SERIALIZED_NAME_DISPLAY) + @javax.annotation.Nullable + private String display; + + public CustomProviderKeys() { + } + + public CustomProviderKeys key(@javax.annotation.Nullable String key) { + this.key = key; + return this; + } + + /** + * The key of the custom provider. + * @return key + */ + @javax.annotation.Nullable + public String getKey() { + return key; + } + + public void setKey(@javax.annotation.Nullable String key) { + this.key = key; + } + + + public CustomProviderKeys display(@javax.annotation.Nullable String display) { + this.display = display; + return this; + } + + /** + * The display name of the custom provider. + * @return display + */ + @javax.annotation.Nullable + public String getDisplay() { + return display; + } + + public void setDisplay(@javax.annotation.Nullable String display) { + this.display = display; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the CustomProviderKeys instance itself + */ + public CustomProviderKeys putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + CustomProviderKeys customProviderKeys = (CustomProviderKeys) o; + return Objects.equals(this.key, customProviderKeys.key) && + Objects.equals(this.display, customProviderKeys.display)&& + Objects.equals(this.additionalProperties, customProviderKeys.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(key, display, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class CustomProviderKeys {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" display: ").append(toIndentedString(display)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Key"); + openapiFields.add("Display"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 CustomProviderKeys + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!CustomProviderKeys.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in CustomProviderKeys is not found in the empty JSON string", CustomProviderKeys.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Key") != null && !jsonObj.get("Key").isJsonNull()) && !jsonObj.get("Key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Key").toString())); + } + if ((jsonObj.get("Display") != null && !jsonObj.get("Display").isJsonNull()) && !jsonObj.get("Display").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Display` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Display").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!CustomProviderKeys.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'CustomProviderKeys' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<CustomProviderKeys> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(CustomProviderKeys.class)); + + return (TypeAdapter<T>) new TypeAdapter<CustomProviderKeys>() { + @Override + public void write(JsonWriter out, CustomProviderKeys value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public CustomProviderKeys read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + CustomProviderKeys instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of CustomProviderKeys given an JSON string + * + * @param jsonString JSON string + * @return An instance of CustomProviderKeys + * @throws IOException if the JSON string is invalid with respect to CustomProviderKeys + */ + public static CustomProviderKeys fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, CustomProviderKeys.class); + } + + /** + * Convert an instance of CustomProviderKeys to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/DefaultResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/DefaultResponse.java new file mode 100644 index 0000000..74daeb1 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/DefaultResponse.java @@ -0,0 +1,284 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * DefaultResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class DefaultResponse { + public static final String SERIALIZED_NAME_IS_DEFAULT = "IsDefault"; + @SerializedName(SERIALIZED_NAME_IS_DEFAULT) + @javax.annotation.Nullable + private Boolean isDefault; + + public DefaultResponse() { + } + + public DefaultResponse isDefault(@javax.annotation.Nullable Boolean isDefault) { + this.isDefault = isDefault; + return this; + } + + /** + * Indicates if the Role is set as default + * @return isDefault + */ + @javax.annotation.Nullable + public Boolean getIsDefault() { + return isDefault; + } + + public void setIsDefault(@javax.annotation.Nullable Boolean isDefault) { + this.isDefault = isDefault; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the DefaultResponse instance itself + */ + public DefaultResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DefaultResponse defaultResponse = (DefaultResponse) o; + return Objects.equals(this.isDefault, defaultResponse.isDefault)&& + Objects.equals(this.additionalProperties, defaultResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isDefault, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DefaultResponse {\n"); + sb.append(" isDefault: ").append(toIndentedString(isDefault)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsDefault"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 DefaultResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DefaultResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DefaultResponse is not found in the empty JSON string", DefaultResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!DefaultResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DefaultResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<DefaultResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DefaultResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<DefaultResponse>() { + @Override + public void write(JsonWriter out, DefaultResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public DefaultResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DefaultResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DefaultResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of DefaultResponse + * @throws IOException if the JSON string is invalid with respect to DefaultResponse + */ + public static DefaultResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DefaultResponse.class); + } + + /** + * Convert an instance of DefaultResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/DeleteEmailRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/DeleteEmailRequest.java new file mode 100644 index 0000000..b5b81ce --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/DeleteEmailRequest.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * DeleteEmailRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class DeleteEmailRequest { + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nonnull + private String email; + + public DeleteEmailRequest() { + } + + public DeleteEmailRequest email(@javax.annotation.Nonnull String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nonnull String email) { + this.email = email; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the DeleteEmailRequest instance itself + */ + public DeleteEmailRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteEmailRequest deleteEmailRequest = (DeleteEmailRequest) o; + return Objects.equals(this.email, deleteEmailRequest.email)&& + Objects.equals(this.additionalProperties, deleteEmailRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteEmailRequest {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("email"); + } + + /** + * 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 DeleteEmailRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DeleteEmailRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteEmailRequest is not found in the empty JSON string", DeleteEmailRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteEmailRequest.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("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!DeleteEmailRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteEmailRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<DeleteEmailRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteEmailRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<DeleteEmailRequest>() { + @Override + public void write(JsonWriter out, DeleteEmailRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public DeleteEmailRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DeleteEmailRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteEmailRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteEmailRequest + * @throws IOException if the JSON string is invalid with respect to DeleteEmailRequest + */ + public static DeleteEmailRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteEmailRequest.class); + } + + /** + * Convert an instance of DeleteEmailRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/DeleteEmailTemplate.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/DeleteEmailTemplate.java new file mode 100644 index 0000000..8b08d0d --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/DeleteEmailTemplate.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * DeleteEmailTemplate + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class DeleteEmailTemplate { + public static final String SERIALIZED_NAME_TEMPLATE_NAME = "TemplateName"; + @SerializedName(SERIALIZED_NAME_TEMPLATE_NAME) + @javax.annotation.Nonnull + private String templateName; + + public DeleteEmailTemplate() { + } + + public DeleteEmailTemplate templateName(@javax.annotation.Nonnull String templateName) { + this.templateName = templateName; + return this; + } + + /** + * The name of the template + * @return templateName + */ + @javax.annotation.Nonnull + public String getTemplateName() { + return templateName; + } + + public void setTemplateName(@javax.annotation.Nonnull String templateName) { + this.templateName = templateName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the DeleteEmailTemplate instance itself + */ + public DeleteEmailTemplate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteEmailTemplate deleteEmailTemplate = (DeleteEmailTemplate) o; + return Objects.equals(this.templateName, deleteEmailTemplate.templateName)&& + Objects.equals(this.additionalProperties, deleteEmailTemplate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(templateName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteEmailTemplate {\n"); + sb.append(" templateName: ").append(toIndentedString(templateName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("TemplateName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("TemplateName"); + } + + /** + * 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 DeleteEmailTemplate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DeleteEmailTemplate.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteEmailTemplate is not found in the empty JSON string", DeleteEmailTemplate.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteEmailTemplate.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("TemplateName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TemplateName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TemplateName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!DeleteEmailTemplate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteEmailTemplate' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<DeleteEmailTemplate> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteEmailTemplate.class)); + + return (TypeAdapter<T>) new TypeAdapter<DeleteEmailTemplate>() { + @Override + public void write(JsonWriter out, DeleteEmailTemplate value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public DeleteEmailTemplate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DeleteEmailTemplate instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteEmailTemplate given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteEmailTemplate + * @throws IOException if the JSON string is invalid with respect to DeleteEmailTemplate + */ + public static DeleteEmailTemplate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteEmailTemplate.class); + } + + /** + * Convert an instance of DeleteEmailTemplate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/DeleteResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/DeleteResponse.java new file mode 100644 index 0000000..dca3a9e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/DeleteResponse.java @@ -0,0 +1,284 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * DeleteResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class DeleteResponse { + public static final String SERIALIZED_NAME_IS_DELETED = "IsDeleted"; + @SerializedName(SERIALIZED_NAME_IS_DELETED) + @javax.annotation.Nullable + private Boolean isDeleted; + + public DeleteResponse() { + } + + public DeleteResponse isDeleted(@javax.annotation.Nullable Boolean isDeleted) { + this.isDeleted = isDeleted; + return this; + } + + /** + * Indicates if the resource was deleted + * @return isDeleted + */ + @javax.annotation.Nullable + public Boolean getIsDeleted() { + return isDeleted; + } + + public void setIsDeleted(@javax.annotation.Nullable Boolean isDeleted) { + this.isDeleted = isDeleted; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the DeleteResponse instance itself + */ + public DeleteResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteResponse deleteResponse = (DeleteResponse) o; + return Objects.equals(this.isDeleted, deleteResponse.isDeleted)&& + Objects.equals(this.additionalProperties, deleteResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isDeleted, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteResponse {\n"); + sb.append(" isDeleted: ").append(toIndentedString(isDeleted)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsDeleted"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 DeleteResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DeleteResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteResponse is not found in the empty JSON string", DeleteResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!DeleteResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<DeleteResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<DeleteResponse>() { + @Override + public void write(JsonWriter out, DeleteResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public DeleteResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DeleteResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteResponse + * @throws IOException if the JSON string is invalid with respect to DeleteResponse + */ + public static DeleteResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteResponse.class); + } + + /** + * Convert an instance of DeleteResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/DeleteSmsTemplateModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/DeleteSmsTemplateModel.java new file mode 100644 index 0000000..634a3da --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/DeleteSmsTemplateModel.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * DeleteSmsTemplateModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class DeleteSmsTemplateModel { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public DeleteSmsTemplateModel() { + } + + public DeleteSmsTemplateModel name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The name of the SMS template to delete. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the DeleteSmsTemplateModel instance itself + */ + public DeleteSmsTemplateModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteSmsTemplateModel deleteSmsTemplateModel = (DeleteSmsTemplateModel) o; + return Objects.equals(this.name, deleteSmsTemplateModel.name)&& + Objects.equals(this.additionalProperties, deleteSmsTemplateModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteSmsTemplateModel {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Name"); + } + + /** + * 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 DeleteSmsTemplateModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DeleteSmsTemplateModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteSmsTemplateModel is not found in the empty JSON string", DeleteSmsTemplateModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteSmsTemplateModel.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("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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!DeleteSmsTemplateModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteSmsTemplateModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<DeleteSmsTemplateModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteSmsTemplateModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<DeleteSmsTemplateModel>() { + @Override + public void write(JsonWriter out, DeleteSmsTemplateModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public DeleteSmsTemplateModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DeleteSmsTemplateModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteSmsTemplateModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteSmsTemplateModel + * @throws IOException if the JSON string is invalid with respect to DeleteSmsTemplateModel + */ + public static DeleteSmsTemplateModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteSmsTemplateModel.class); + } + + /** + * Convert an instance of DeleteSmsTemplateModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/DeleteUserModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/DeleteUserModel.java new file mode 100644 index 0000000..1be1828 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/DeleteUserModel.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * DeleteUserModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class DeleteUserModel { + public static final String SERIALIZED_NAME_UID = "uid"; + @SerializedName(SERIALIZED_NAME_UID) + @javax.annotation.Nonnull + private String uid; + + public DeleteUserModel() { + } + + public DeleteUserModel uid(@javax.annotation.Nonnull String uid) { + this.uid = uid; + return this; + } + + /** + * The UID of the User. + * @return uid + */ + @javax.annotation.Nonnull + public String getUid() { + return uid; + } + + public void setUid(@javax.annotation.Nonnull String uid) { + this.uid = uid; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the DeleteUserModel instance itself + */ + public DeleteUserModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteUserModel deleteUserModel = (DeleteUserModel) o; + return Objects.equals(this.uid, deleteUserModel.uid)&& + Objects.equals(this.additionalProperties, deleteUserModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(uid, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteUserModel {\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("uid"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("uid"); + } + + /** + * 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 DeleteUserModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DeleteUserModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteUserModel is not found in the empty JSON string", DeleteUserModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteUserModel.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("uid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `uid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("uid").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!DeleteUserModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteUserModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<DeleteUserModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteUserModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<DeleteUserModel>() { + @Override + public void write(JsonWriter out, DeleteUserModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public DeleteUserModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DeleteUserModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteUserModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteUserModel + * @throws IOException if the JSON string is invalid with respect to DeleteUserModel + */ + public static DeleteUserModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteUserModel.class); + } + + /** + * Convert an instance of DeleteUserModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/DeleteemailbyaccesstokenRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/DeleteemailbyaccesstokenRequest.java new file mode 100644 index 0000000..fd417ec --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/DeleteemailbyaccesstokenRequest.java @@ -0,0 +1,325 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * DeleteemailbyaccesstokenRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class DeleteemailbyaccesstokenRequest { + public static final String SERIALIZED_NAME_ACCESS_TOKEN = "access_token"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN) + @javax.annotation.Nullable + private String accessToken; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nonnull + private String email; + + public DeleteemailbyaccesstokenRequest() { + } + + public DeleteemailbyaccesstokenRequest accessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Access Token for authentication + * @return accessToken + */ + @javax.annotation.Nullable + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + } + + + public DeleteemailbyaccesstokenRequest email(@javax.annotation.Nonnull String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nonnull String email) { + this.email = email; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the DeleteemailbyaccesstokenRequest instance itself + */ + public DeleteemailbyaccesstokenRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeleteemailbyaccesstokenRequest deleteemailbyaccesstokenRequest = (DeleteemailbyaccesstokenRequest) o; + return Objects.equals(this.accessToken, deleteemailbyaccesstokenRequest.accessToken) && + Objects.equals(this.email, deleteemailbyaccesstokenRequest.email)&& + Objects.equals(this.additionalProperties, deleteemailbyaccesstokenRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accessToken, email, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeleteemailbyaccesstokenRequest {\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("access_token"); + openapiFields.add("email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("email"); + } + + /** + * 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 DeleteemailbyaccesstokenRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DeleteemailbyaccesstokenRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeleteemailbyaccesstokenRequest is not found in the empty JSON string", DeleteemailbyaccesstokenRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeleteemailbyaccesstokenRequest.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("access_token") != null && !jsonObj.get("access_token").isJsonNull()) && !jsonObj.get("access_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `access_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("access_token").toString())); + } + if (!jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!DeleteemailbyaccesstokenRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeleteemailbyaccesstokenRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<DeleteemailbyaccesstokenRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeleteemailbyaccesstokenRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<DeleteemailbyaccesstokenRequest>() { + @Override + public void write(JsonWriter out, DeleteemailbyaccesstokenRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public DeleteemailbyaccesstokenRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DeleteemailbyaccesstokenRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeleteemailbyaccesstokenRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeleteemailbyaccesstokenRequest + * @throws IOException if the JSON string is invalid with respect to DeleteemailbyaccesstokenRequest + */ + public static DeleteemailbyaccesstokenRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeleteemailbyaccesstokenRequest.class); + } + + /** + * Convert an instance of DeleteemailbyaccesstokenRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/DeltaMigrationModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/DeltaMigrationModel.java new file mode 100644 index 0000000..81a6543 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/DeltaMigrationModel.java @@ -0,0 +1,320 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * DeltaMigrationModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class DeltaMigrationModel { + public static final String SERIALIZED_NAME_DELTA_MIGRATION = "DeltaMigration"; + @SerializedName(SERIALIZED_NAME_DELTA_MIGRATION) + @javax.annotation.Nonnull + private Boolean deltaMigration; + + public static final String SERIALIZED_NAME_OVER_WRITE_DUPLICATE = "OverWriteDuplicate"; + @SerializedName(SERIALIZED_NAME_OVER_WRITE_DUPLICATE) + @javax.annotation.Nonnull + private Boolean overWriteDuplicate; + + public DeltaMigrationModel() { + } + + public DeltaMigrationModel deltaMigration(@javax.annotation.Nonnull Boolean deltaMigration) { + this.deltaMigration = deltaMigration; + return this; + } + + /** + * Indicates if delta migration is enabled. + * @return deltaMigration + */ + @javax.annotation.Nonnull + public Boolean getDeltaMigration() { + return deltaMigration; + } + + public void setDeltaMigration(@javax.annotation.Nonnull Boolean deltaMigration) { + this.deltaMigration = deltaMigration; + } + + + public DeltaMigrationModel overWriteDuplicate(@javax.annotation.Nonnull Boolean overWriteDuplicate) { + this.overWriteDuplicate = overWriteDuplicate; + return this; + } + + /** + * If true, existing records will be overwritten when duplicates are found. + * @return overWriteDuplicate + */ + @javax.annotation.Nonnull + public Boolean getOverWriteDuplicate() { + return overWriteDuplicate; + } + + public void setOverWriteDuplicate(@javax.annotation.Nonnull Boolean overWriteDuplicate) { + this.overWriteDuplicate = overWriteDuplicate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the DeltaMigrationModel instance itself + */ + public DeltaMigrationModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DeltaMigrationModel deltaMigrationModel = (DeltaMigrationModel) o; + return Objects.equals(this.deltaMigration, deltaMigrationModel.deltaMigration) && + Objects.equals(this.overWriteDuplicate, deltaMigrationModel.overWriteDuplicate)&& + Objects.equals(this.additionalProperties, deltaMigrationModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(deltaMigration, overWriteDuplicate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DeltaMigrationModel {\n"); + sb.append(" deltaMigration: ").append(toIndentedString(deltaMigration)).append("\n"); + sb.append(" overWriteDuplicate: ").append(toIndentedString(overWriteDuplicate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("DeltaMigration"); + openapiFields.add("OverWriteDuplicate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("DeltaMigration"); + openapiRequiredFields.add("OverWriteDuplicate"); + } + + /** + * 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 DeltaMigrationModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DeltaMigrationModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DeltaMigrationModel is not found in the empty JSON string", DeltaMigrationModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DeltaMigrationModel.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(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!DeltaMigrationModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DeltaMigrationModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<DeltaMigrationModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DeltaMigrationModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<DeltaMigrationModel>() { + @Override + public void write(JsonWriter out, DeltaMigrationModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public DeltaMigrationModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DeltaMigrationModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DeltaMigrationModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of DeltaMigrationModel + * @throws IOException if the JSON string is invalid with respect to DeltaMigrationModel + */ + public static DeltaMigrationModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DeltaMigrationModel.class); + } + + /** + * Convert an instance of DeltaMigrationModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/DomainAccessRestrictions.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/DomainAccessRestrictions.java new file mode 100644 index 0000000..9570903 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/DomainAccessRestrictions.java @@ -0,0 +1,337 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.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.loginradius.sdk.internal.openapi.JSON; + +/** + * DomainAccessRestrictions + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class DomainAccessRestrictions { + public static final String SERIALIZED_NAME_ALLOWLIST = "Allowlist"; + @SerializedName(SERIALIZED_NAME_ALLOWLIST) + @javax.annotation.Nullable + private List<String> allowlist = new ArrayList<>(); + + public static final String SERIALIZED_NAME_BLOCKLIST = "Blocklist"; + @SerializedName(SERIALIZED_NAME_BLOCKLIST) + @javax.annotation.Nullable + private List<String> blocklist = new ArrayList<>(); + + public DomainAccessRestrictions() { + } + + public DomainAccessRestrictions allowlist(@javax.annotation.Nullable List<String> allowlist) { + this.allowlist = allowlist; + return this; + } + + public DomainAccessRestrictions addAllowlistItem(String allowlistItem) { + if (this.allowlist == null) { + this.allowlist = new ArrayList<>(); + } + this.allowlist.add(allowlistItem); + return this; + } + + /** + * List of allowed domains/emails + * @return allowlist + */ + @javax.annotation.Nullable + public List<String> getAllowlist() { + return allowlist; + } + + public void setAllowlist(@javax.annotation.Nullable List<String> allowlist) { + this.allowlist = allowlist; + } + + + public DomainAccessRestrictions blocklist(@javax.annotation.Nullable List<String> blocklist) { + this.blocklist = blocklist; + return this; + } + + public DomainAccessRestrictions addBlocklistItem(String blocklistItem) { + if (this.blocklist == null) { + this.blocklist = new ArrayList<>(); + } + this.blocklist.add(blocklistItem); + return this; + } + + /** + * List of blocked domains/emails + * @return blocklist + */ + @javax.annotation.Nullable + public List<String> getBlocklist() { + return blocklist; + } + + public void setBlocklist(@javax.annotation.Nullable List<String> blocklist) { + this.blocklist = blocklist; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the DomainAccessRestrictions instance itself + */ + public DomainAccessRestrictions putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DomainAccessRestrictions domainAccessRestrictions = (DomainAccessRestrictions) o; + return Objects.equals(this.allowlist, domainAccessRestrictions.allowlist) && + Objects.equals(this.blocklist, domainAccessRestrictions.blocklist)&& + Objects.equals(this.additionalProperties, domainAccessRestrictions.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(allowlist, blocklist, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DomainAccessRestrictions {\n"); + sb.append(" allowlist: ").append(toIndentedString(allowlist)).append("\n"); + sb.append(" blocklist: ").append(toIndentedString(blocklist)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Allowlist"); + openapiFields.add("Blocklist"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 DomainAccessRestrictions + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DomainAccessRestrictions.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DomainAccessRestrictions is not found in the empty JSON string", DomainAccessRestrictions.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("Allowlist") != null && !jsonObj.get("Allowlist").isJsonNull() && !jsonObj.get("Allowlist").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Allowlist` to be an array in the JSON string but got `%s`", jsonObj.get("Allowlist").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("Blocklist") != null && !jsonObj.get("Blocklist").isJsonNull() && !jsonObj.get("Blocklist").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Blocklist` to be an array in the JSON string but got `%s`", jsonObj.get("Blocklist").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!DomainAccessRestrictions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DomainAccessRestrictions' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<DomainAccessRestrictions> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DomainAccessRestrictions.class)); + + return (TypeAdapter<T>) new TypeAdapter<DomainAccessRestrictions>() { + @Override + public void write(JsonWriter out, DomainAccessRestrictions value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public DomainAccessRestrictions read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DomainAccessRestrictions instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DomainAccessRestrictions given an JSON string + * + * @param jsonString JSON string + * @return An instance of DomainAccessRestrictions + * @throws IOException if the JSON string is invalid with respect to DomainAccessRestrictions + */ + public static DomainAccessRestrictions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DomainAccessRestrictions.class); + } + + /** + * Convert an instance of DomainAccessRestrictions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/DuoSecurityAuthenticator.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/DuoSecurityAuthenticator.java new file mode 100644 index 0000000..490f723 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/DuoSecurityAuthenticator.java @@ -0,0 +1,374 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * DuoSecurityAuthenticator + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class DuoSecurityAuthenticator { + public static final String SERIALIZED_NAME_IS_ENABLED = "IsEnabled"; + @SerializedName(SERIALIZED_NAME_IS_ENABLED) + @javax.annotation.Nullable + private Boolean isEnabled; + + public static final String SERIALIZED_NAME_CLIENT_ID = "ClientId"; + @SerializedName(SERIALIZED_NAME_CLIENT_ID) + @javax.annotation.Nullable + private String clientId; + + public static final String SERIALIZED_NAME_CLIENT_SECRET = "ClientSecret"; + @SerializedName(SERIALIZED_NAME_CLIENT_SECRET) + @javax.annotation.Nullable + private String clientSecret; + + public static final String SERIALIZED_NAME_AP_I_HOST = "APIHost"; + @SerializedName(SERIALIZED_NAME_AP_I_HOST) + @javax.annotation.Nullable + private String apIHost; + + public DuoSecurityAuthenticator() { + } + + public DuoSecurityAuthenticator isEnabled(@javax.annotation.Nullable Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Indicates if Duo Security is enabled + * @return isEnabled + */ + @javax.annotation.Nullable + public Boolean getIsEnabled() { + return isEnabled; + } + + public void setIsEnabled(@javax.annotation.Nullable Boolean isEnabled) { + this.isEnabled = isEnabled; + } + + + public DuoSecurityAuthenticator clientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * The client ID for Duo Security + * @return clientId + */ + @javax.annotation.Nullable + public String getClientId() { + return clientId; + } + + public void setClientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + } + + + public DuoSecurityAuthenticator clientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * The client secret for Duo Security + * @return clientSecret + */ + @javax.annotation.Nullable + public String getClientSecret() { + return clientSecret; + } + + public void setClientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + } + + + public DuoSecurityAuthenticator apIHost(@javax.annotation.Nullable String apIHost) { + this.apIHost = apIHost; + return this; + } + + /** + * The API host for Duo Security + * @return apIHost + */ + @javax.annotation.Nullable + public String getApIHost() { + return apIHost; + } + + public void setApIHost(@javax.annotation.Nullable String apIHost) { + this.apIHost = apIHost; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the DuoSecurityAuthenticator instance itself + */ + public DuoSecurityAuthenticator putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DuoSecurityAuthenticator duoSecurityAuthenticator = (DuoSecurityAuthenticator) o; + return Objects.equals(this.isEnabled, duoSecurityAuthenticator.isEnabled) && + Objects.equals(this.clientId, duoSecurityAuthenticator.clientId) && + Objects.equals(this.clientSecret, duoSecurityAuthenticator.clientSecret) && + Objects.equals(this.apIHost, duoSecurityAuthenticator.apIHost)&& + Objects.equals(this.additionalProperties, duoSecurityAuthenticator.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isEnabled, clientId, clientSecret, apIHost, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DuoSecurityAuthenticator {\n"); + sb.append(" isEnabled: ").append(toIndentedString(isEnabled)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); + sb.append(" apIHost: ").append(toIndentedString(apIHost)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsEnabled"); + openapiFields.add("ClientId"); + openapiFields.add("ClientSecret"); + openapiFields.add("APIHost"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 DuoSecurityAuthenticator + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DuoSecurityAuthenticator.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DuoSecurityAuthenticator is not found in the empty JSON string", DuoSecurityAuthenticator.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ClientId") != null && !jsonObj.get("ClientId").isJsonNull()) && !jsonObj.get("ClientId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ClientId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ClientId").toString())); + } + if ((jsonObj.get("ClientSecret") != null && !jsonObj.get("ClientSecret").isJsonNull()) && !jsonObj.get("ClientSecret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ClientSecret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ClientSecret").toString())); + } + if ((jsonObj.get("APIHost") != null && !jsonObj.get("APIHost").isJsonNull()) && !jsonObj.get("APIHost").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `APIHost` to be a primitive type in the JSON string but got `%s`", jsonObj.get("APIHost").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!DuoSecurityAuthenticator.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DuoSecurityAuthenticator' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<DuoSecurityAuthenticator> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DuoSecurityAuthenticator.class)); + + return (TypeAdapter<T>) new TypeAdapter<DuoSecurityAuthenticator>() { + @Override + public void write(JsonWriter out, DuoSecurityAuthenticator value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public DuoSecurityAuthenticator read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DuoSecurityAuthenticator instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DuoSecurityAuthenticator given an JSON string + * + * @param jsonString JSON string + * @return An instance of DuoSecurityAuthenticator + * @throws IOException if the JSON string is invalid with respect to DuoSecurityAuthenticator + */ + public static DuoSecurityAuthenticator fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DuoSecurityAuthenticator.class); + } + + /** + * Convert an instance of DuoSecurityAuthenticator to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/DuoVerifyRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/DuoVerifyRequest.java new file mode 100644 index 0000000..0d53794 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/DuoVerifyRequest.java @@ -0,0 +1,326 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * DuoVerifyRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class DuoVerifyRequest { + public static final String SERIALIZED_NAME_STATE = "State"; + @SerializedName(SERIALIZED_NAME_STATE) + @javax.annotation.Nonnull + private String state; + + public static final String SERIALIZED_NAME_CODE = "Code"; + @SerializedName(SERIALIZED_NAME_CODE) + @javax.annotation.Nonnull + private String code; + + public DuoVerifyRequest() { + } + + public DuoVerifyRequest state(@javax.annotation.Nonnull String state) { + this.state = state; + return this; + } + + /** + * The state which is received from Duo authenticator. + * @return state + */ + @javax.annotation.Nonnull + public String getState() { + return state; + } + + public void setState(@javax.annotation.Nonnull String state) { + this.state = state; + } + + + public DuoVerifyRequest code(@javax.annotation.Nonnull String code) { + this.code = code; + return this; + } + + /** + * The code which is received from Duo authenticator. + * @return code + */ + @javax.annotation.Nonnull + public String getCode() { + return code; + } + + public void setCode(@javax.annotation.Nonnull String code) { + this.code = code; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the DuoVerifyRequest instance itself + */ + public DuoVerifyRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DuoVerifyRequest duoVerifyRequest = (DuoVerifyRequest) o; + return Objects.equals(this.state, duoVerifyRequest.state) && + Objects.equals(this.code, duoVerifyRequest.code)&& + Objects.equals(this.additionalProperties, duoVerifyRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(state, code, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DuoVerifyRequest {\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("State"); + openapiFields.add("Code"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("State"); + openapiRequiredFields.add("Code"); + } + + /** + * 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 DuoVerifyRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DuoVerifyRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DuoVerifyRequest is not found in the empty JSON string", DuoVerifyRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : DuoVerifyRequest.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("State").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `State` to be a primitive type in the JSON string but got `%s`", jsonObj.get("State").toString())); + } + if (!jsonObj.get("Code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Code").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!DuoVerifyRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DuoVerifyRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<DuoVerifyRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DuoVerifyRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<DuoVerifyRequest>() { + @Override + public void write(JsonWriter out, DuoVerifyRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public DuoVerifyRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DuoVerifyRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DuoVerifyRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of DuoVerifyRequest + * @throws IOException if the JSON string is invalid with respect to DuoVerifyRequest + */ + public static DuoVerifyRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DuoVerifyRequest.class); + } + + /** + * Convert an instance of DuoVerifyRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/DynamicClientRegistrationRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/DynamicClientRegistrationRequest.java new file mode 100644 index 0000000..7f3c0ec --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/DynamicClientRegistrationRequest.java @@ -0,0 +1,497 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.net.URI; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Request for OIDC Dynamic Client Registration (RFC 7591). + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class DynamicClientRegistrationRequest { + public static final String SERIALIZED_NAME_REDIRECT_URIS = "redirect_uris"; + @SerializedName(SERIALIZED_NAME_REDIRECT_URIS) + @javax.annotation.Nullable + private List<URI> redirectUris = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CLIENT_NAME = "client_name"; + @SerializedName(SERIALIZED_NAME_CLIENT_NAME) + @javax.annotation.Nullable + private String clientName; + + public static final String SERIALIZED_NAME_CLIENT_URI = "client_uri"; + @SerializedName(SERIALIZED_NAME_CLIENT_URI) + @javax.annotation.Nullable + private URI clientUri; + + public static final String SERIALIZED_NAME_LOGO_URI = "logo_uri"; + @SerializedName(SERIALIZED_NAME_LOGO_URI) + @javax.annotation.Nullable + private URI logoUri; + + public static final String SERIALIZED_NAME_TOKEN_ENDPOINT_AUTH_METHOD = "token_endpoint_auth_method"; + @SerializedName(SERIALIZED_NAME_TOKEN_ENDPOINT_AUTH_METHOD) + @javax.annotation.Nullable + private String tokenEndpointAuthMethod; + + public static final String SERIALIZED_NAME_GRANT_TYPES = "grant_types"; + @SerializedName(SERIALIZED_NAME_GRANT_TYPES) + @javax.annotation.Nullable + private List<String> grantTypes = new ArrayList<>(); + + public static final String SERIALIZED_NAME_RESPONSE_TYPES = "response_types"; + @SerializedName(SERIALIZED_NAME_RESPONSE_TYPES) + @javax.annotation.Nullable + private List<String> responseTypes = new ArrayList<>(); + + public DynamicClientRegistrationRequest() { + } + + public DynamicClientRegistrationRequest redirectUris(@javax.annotation.Nullable List<URI> redirectUris) { + this.redirectUris = redirectUris; + return this; + } + + public DynamicClientRegistrationRequest addRedirectUrisItem(URI redirectUrisItem) { + if (this.redirectUris == null) { + this.redirectUris = new ArrayList<>(); + } + this.redirectUris.add(redirectUrisItem); + return this; + } + + /** + * Array of redirection URI strings. + * @return redirectUris + */ + @javax.annotation.Nullable + public List<URI> getRedirectUris() { + return redirectUris; + } + + public void setRedirectUris(@javax.annotation.Nullable List<URI> redirectUris) { + this.redirectUris = redirectUris; + } + + + public DynamicClientRegistrationRequest clientName(@javax.annotation.Nullable String clientName) { + this.clientName = clientName; + return this; + } + + /** + * Human-readable name of the client. + * @return clientName + */ + @javax.annotation.Nullable + public String getClientName() { + return clientName; + } + + public void setClientName(@javax.annotation.Nullable String clientName) { + this.clientName = clientName; + } + + + public DynamicClientRegistrationRequest clientUri(@javax.annotation.Nullable URI clientUri) { + this.clientUri = clientUri; + return this; + } + + /** + * URL of the home page of the client. + * @return clientUri + */ + @javax.annotation.Nullable + public URI getClientUri() { + return clientUri; + } + + public void setClientUri(@javax.annotation.Nullable URI clientUri) { + this.clientUri = clientUri; + } + + + public DynamicClientRegistrationRequest logoUri(@javax.annotation.Nullable URI logoUri) { + this.logoUri = logoUri; + return this; + } + + /** + * URL of the client logo. + * @return logoUri + */ + @javax.annotation.Nullable + public URI getLogoUri() { + return logoUri; + } + + public void setLogoUri(@javax.annotation.Nullable URI logoUri) { + this.logoUri = logoUri; + } + + + public DynamicClientRegistrationRequest tokenEndpointAuthMethod(@javax.annotation.Nullable String tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + return this; + } + + /** + * Authentication method for the token endpoint. + * @return tokenEndpointAuthMethod + */ + @javax.annotation.Nullable + public String getTokenEndpointAuthMethod() { + return tokenEndpointAuthMethod; + } + + public void setTokenEndpointAuthMethod(@javax.annotation.Nullable String tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + } + + + public DynamicClientRegistrationRequest grantTypes(@javax.annotation.Nullable List<String> grantTypes) { + this.grantTypes = grantTypes; + return this; + } + + public DynamicClientRegistrationRequest addGrantTypesItem(String grantTypesItem) { + if (this.grantTypes == null) { + this.grantTypes = new ArrayList<>(); + } + this.grantTypes.add(grantTypesItem); + return this; + } + + /** + * Array of OAuth 2.0 grant types. + * @return grantTypes + */ + @javax.annotation.Nullable + public List<String> getGrantTypes() { + return grantTypes; + } + + public void setGrantTypes(@javax.annotation.Nullable List<String> grantTypes) { + this.grantTypes = grantTypes; + } + + + public DynamicClientRegistrationRequest responseTypes(@javax.annotation.Nullable List<String> responseTypes) { + this.responseTypes = responseTypes; + return this; + } + + public DynamicClientRegistrationRequest addResponseTypesItem(String responseTypesItem) { + if (this.responseTypes == null) { + this.responseTypes = new ArrayList<>(); + } + this.responseTypes.add(responseTypesItem); + return this; + } + + /** + * Array of OAuth 2.0 response types. + * @return responseTypes + */ + @javax.annotation.Nullable + public List<String> getResponseTypes() { + return responseTypes; + } + + public void setResponseTypes(@javax.annotation.Nullable List<String> responseTypes) { + this.responseTypes = responseTypes; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the DynamicClientRegistrationRequest instance itself + */ + public DynamicClientRegistrationRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DynamicClientRegistrationRequest dynamicClientRegistrationRequest = (DynamicClientRegistrationRequest) o; + return Objects.equals(this.redirectUris, dynamicClientRegistrationRequest.redirectUris) && + Objects.equals(this.clientName, dynamicClientRegistrationRequest.clientName) && + Objects.equals(this.clientUri, dynamicClientRegistrationRequest.clientUri) && + Objects.equals(this.logoUri, dynamicClientRegistrationRequest.logoUri) && + Objects.equals(this.tokenEndpointAuthMethod, dynamicClientRegistrationRequest.tokenEndpointAuthMethod) && + Objects.equals(this.grantTypes, dynamicClientRegistrationRequest.grantTypes) && + Objects.equals(this.responseTypes, dynamicClientRegistrationRequest.responseTypes)&& + Objects.equals(this.additionalProperties, dynamicClientRegistrationRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(redirectUris, clientName, clientUri, logoUri, tokenEndpointAuthMethod, grantTypes, responseTypes, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DynamicClientRegistrationRequest {\n"); + sb.append(" redirectUris: ").append(toIndentedString(redirectUris)).append("\n"); + sb.append(" clientName: ").append(toIndentedString(clientName)).append("\n"); + sb.append(" clientUri: ").append(toIndentedString(clientUri)).append("\n"); + sb.append(" logoUri: ").append(toIndentedString(logoUri)).append("\n"); + sb.append(" tokenEndpointAuthMethod: ").append(toIndentedString(tokenEndpointAuthMethod)).append("\n"); + sb.append(" grantTypes: ").append(toIndentedString(grantTypes)).append("\n"); + sb.append(" responseTypes: ").append(toIndentedString(responseTypes)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("redirect_uris"); + openapiFields.add("client_name"); + openapiFields.add("client_uri"); + openapiFields.add("logo_uri"); + openapiFields.add("token_endpoint_auth_method"); + openapiFields.add("grant_types"); + openapiFields.add("response_types"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 DynamicClientRegistrationRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DynamicClientRegistrationRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DynamicClientRegistrationRequest is not found in the empty JSON string", DynamicClientRegistrationRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("redirect_uris") != null && !jsonObj.get("redirect_uris").isJsonNull() && !jsonObj.get("redirect_uris").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `redirect_uris` to be an array in the JSON string but got `%s`", jsonObj.get("redirect_uris").toString())); + } + if ((jsonObj.get("client_name") != null && !jsonObj.get("client_name").isJsonNull()) && !jsonObj.get("client_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_name").toString())); + } + if ((jsonObj.get("client_uri") != null && !jsonObj.get("client_uri").isJsonNull()) && !jsonObj.get("client_uri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_uri").toString())); + } + if ((jsonObj.get("logo_uri") != null && !jsonObj.get("logo_uri").isJsonNull()) && !jsonObj.get("logo_uri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `logo_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logo_uri").toString())); + } + if ((jsonObj.get("token_endpoint_auth_method") != null && !jsonObj.get("token_endpoint_auth_method").isJsonNull()) && !jsonObj.get("token_endpoint_auth_method").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `token_endpoint_auth_method` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token_endpoint_auth_method").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("grant_types") != null && !jsonObj.get("grant_types").isJsonNull() && !jsonObj.get("grant_types").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `grant_types` to be an array in the JSON string but got `%s`", jsonObj.get("grant_types").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("response_types") != null && !jsonObj.get("response_types").isJsonNull() && !jsonObj.get("response_types").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `response_types` to be an array in the JSON string but got `%s`", jsonObj.get("response_types").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!DynamicClientRegistrationRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DynamicClientRegistrationRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<DynamicClientRegistrationRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DynamicClientRegistrationRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<DynamicClientRegistrationRequest>() { + @Override + public void write(JsonWriter out, DynamicClientRegistrationRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public DynamicClientRegistrationRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DynamicClientRegistrationRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DynamicClientRegistrationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of DynamicClientRegistrationRequest + * @throws IOException if the JSON string is invalid with respect to DynamicClientRegistrationRequest + */ + public static DynamicClientRegistrationRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DynamicClientRegistrationRequest.class); + } + + /** + * Convert an instance of DynamicClientRegistrationRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/DynamicClientRegistrationResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/DynamicClientRegistrationResponse.java new file mode 100644 index 0000000..e31aea8 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/DynamicClientRegistrationResponse.java @@ -0,0 +1,551 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.net.URI; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Response from OIDC Dynamic Client Registration (RFC 7591). + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class DynamicClientRegistrationResponse { + public static final String SERIALIZED_NAME_CLIENT_ID = "client_id"; + @SerializedName(SERIALIZED_NAME_CLIENT_ID) + @javax.annotation.Nullable + private String clientId; + + public static final String SERIALIZED_NAME_CLIENT_SECRET = "client_secret"; + @SerializedName(SERIALIZED_NAME_CLIENT_SECRET) + @javax.annotation.Nullable + private String clientSecret; + + public static final String SERIALIZED_NAME_CLIENT_ID_ISSUED_AT = "client_id_issued_at"; + @SerializedName(SERIALIZED_NAME_CLIENT_ID_ISSUED_AT) + @javax.annotation.Nullable + private Integer clientIdIssuedAt; + + public static final String SERIALIZED_NAME_CLIENT_SECRET_EXPIRES_AT = "client_secret_expires_at"; + @SerializedName(SERIALIZED_NAME_CLIENT_SECRET_EXPIRES_AT) + @javax.annotation.Nullable + private Integer clientSecretExpiresAt; + + public static final String SERIALIZED_NAME_REDIRECT_URIS = "redirect_uris"; + @SerializedName(SERIALIZED_NAME_REDIRECT_URIS) + @javax.annotation.Nullable + private List<URI> redirectUris = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CLIENT_NAME = "client_name"; + @SerializedName(SERIALIZED_NAME_CLIENT_NAME) + @javax.annotation.Nullable + private String clientName; + + public static final String SERIALIZED_NAME_TOKEN_ENDPOINT_AUTH_METHOD = "token_endpoint_auth_method"; + @SerializedName(SERIALIZED_NAME_TOKEN_ENDPOINT_AUTH_METHOD) + @javax.annotation.Nullable + private String tokenEndpointAuthMethod; + + public static final String SERIALIZED_NAME_GRANT_TYPES = "grant_types"; + @SerializedName(SERIALIZED_NAME_GRANT_TYPES) + @javax.annotation.Nullable + private List<String> grantTypes = new ArrayList<>(); + + public static final String SERIALIZED_NAME_RESPONSE_TYPES = "response_types"; + @SerializedName(SERIALIZED_NAME_RESPONSE_TYPES) + @javax.annotation.Nullable + private List<String> responseTypes = new ArrayList<>(); + + public DynamicClientRegistrationResponse() { + } + + public DynamicClientRegistrationResponse clientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * The registered client identifier. + * @return clientId + */ + @javax.annotation.Nullable + public String getClientId() { + return clientId; + } + + public void setClientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + } + + + public DynamicClientRegistrationResponse clientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * The client secret (if applicable). + * @return clientSecret + */ + @javax.annotation.Nullable + public String getClientSecret() { + return clientSecret; + } + + public void setClientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + } + + + public DynamicClientRegistrationResponse clientIdIssuedAt(@javax.annotation.Nullable Integer clientIdIssuedAt) { + this.clientIdIssuedAt = clientIdIssuedAt; + return this; + } + + /** + * Time at which the client ID was issued (Unix timestamp). + * @return clientIdIssuedAt + */ + @javax.annotation.Nullable + public Integer getClientIdIssuedAt() { + return clientIdIssuedAt; + } + + public void setClientIdIssuedAt(@javax.annotation.Nullable Integer clientIdIssuedAt) { + this.clientIdIssuedAt = clientIdIssuedAt; + } + + + public DynamicClientRegistrationResponse clientSecretExpiresAt(@javax.annotation.Nullable Integer clientSecretExpiresAt) { + this.clientSecretExpiresAt = clientSecretExpiresAt; + return this; + } + + /** + * Time at which the client secret expires (0 means it does not expire). + * @return clientSecretExpiresAt + */ + @javax.annotation.Nullable + public Integer getClientSecretExpiresAt() { + return clientSecretExpiresAt; + } + + public void setClientSecretExpiresAt(@javax.annotation.Nullable Integer clientSecretExpiresAt) { + this.clientSecretExpiresAt = clientSecretExpiresAt; + } + + + public DynamicClientRegistrationResponse redirectUris(@javax.annotation.Nullable List<URI> redirectUris) { + this.redirectUris = redirectUris; + return this; + } + + public DynamicClientRegistrationResponse addRedirectUrisItem(URI redirectUrisItem) { + if (this.redirectUris == null) { + this.redirectUris = new ArrayList<>(); + } + this.redirectUris.add(redirectUrisItem); + return this; + } + + /** + * Get redirectUris + * @return redirectUris + */ + @javax.annotation.Nullable + public List<URI> getRedirectUris() { + return redirectUris; + } + + public void setRedirectUris(@javax.annotation.Nullable List<URI> redirectUris) { + this.redirectUris = redirectUris; + } + + + public DynamicClientRegistrationResponse clientName(@javax.annotation.Nullable String clientName) { + this.clientName = clientName; + return this; + } + + /** + * Get clientName + * @return clientName + */ + @javax.annotation.Nullable + public String getClientName() { + return clientName; + } + + public void setClientName(@javax.annotation.Nullable String clientName) { + this.clientName = clientName; + } + + + public DynamicClientRegistrationResponse tokenEndpointAuthMethod(@javax.annotation.Nullable String tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + return this; + } + + /** + * Get tokenEndpointAuthMethod + * @return tokenEndpointAuthMethod + */ + @javax.annotation.Nullable + public String getTokenEndpointAuthMethod() { + return tokenEndpointAuthMethod; + } + + public void setTokenEndpointAuthMethod(@javax.annotation.Nullable String tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + } + + + public DynamicClientRegistrationResponse grantTypes(@javax.annotation.Nullable List<String> grantTypes) { + this.grantTypes = grantTypes; + return this; + } + + public DynamicClientRegistrationResponse addGrantTypesItem(String grantTypesItem) { + if (this.grantTypes == null) { + this.grantTypes = new ArrayList<>(); + } + this.grantTypes.add(grantTypesItem); + return this; + } + + /** + * Get grantTypes + * @return grantTypes + */ + @javax.annotation.Nullable + public List<String> getGrantTypes() { + return grantTypes; + } + + public void setGrantTypes(@javax.annotation.Nullable List<String> grantTypes) { + this.grantTypes = grantTypes; + } + + + public DynamicClientRegistrationResponse responseTypes(@javax.annotation.Nullable List<String> responseTypes) { + this.responseTypes = responseTypes; + return this; + } + + public DynamicClientRegistrationResponse addResponseTypesItem(String responseTypesItem) { + if (this.responseTypes == null) { + this.responseTypes = new ArrayList<>(); + } + this.responseTypes.add(responseTypesItem); + return this; + } + + /** + * Get responseTypes + * @return responseTypes + */ + @javax.annotation.Nullable + public List<String> getResponseTypes() { + return responseTypes; + } + + public void setResponseTypes(@javax.annotation.Nullable List<String> responseTypes) { + this.responseTypes = responseTypes; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the DynamicClientRegistrationResponse instance itself + */ + public DynamicClientRegistrationResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DynamicClientRegistrationResponse dynamicClientRegistrationResponse = (DynamicClientRegistrationResponse) o; + return Objects.equals(this.clientId, dynamicClientRegistrationResponse.clientId) && + Objects.equals(this.clientSecret, dynamicClientRegistrationResponse.clientSecret) && + Objects.equals(this.clientIdIssuedAt, dynamicClientRegistrationResponse.clientIdIssuedAt) && + Objects.equals(this.clientSecretExpiresAt, dynamicClientRegistrationResponse.clientSecretExpiresAt) && + Objects.equals(this.redirectUris, dynamicClientRegistrationResponse.redirectUris) && + Objects.equals(this.clientName, dynamicClientRegistrationResponse.clientName) && + Objects.equals(this.tokenEndpointAuthMethod, dynamicClientRegistrationResponse.tokenEndpointAuthMethod) && + Objects.equals(this.grantTypes, dynamicClientRegistrationResponse.grantTypes) && + Objects.equals(this.responseTypes, dynamicClientRegistrationResponse.responseTypes)&& + Objects.equals(this.additionalProperties, dynamicClientRegistrationResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, clientSecret, clientIdIssuedAt, clientSecretExpiresAt, redirectUris, clientName, tokenEndpointAuthMethod, grantTypes, responseTypes, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class DynamicClientRegistrationResponse {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); + sb.append(" clientIdIssuedAt: ").append(toIndentedString(clientIdIssuedAt)).append("\n"); + sb.append(" clientSecretExpiresAt: ").append(toIndentedString(clientSecretExpiresAt)).append("\n"); + sb.append(" redirectUris: ").append(toIndentedString(redirectUris)).append("\n"); + sb.append(" clientName: ").append(toIndentedString(clientName)).append("\n"); + sb.append(" tokenEndpointAuthMethod: ").append(toIndentedString(tokenEndpointAuthMethod)).append("\n"); + sb.append(" grantTypes: ").append(toIndentedString(grantTypes)).append("\n"); + sb.append(" responseTypes: ").append(toIndentedString(responseTypes)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("client_id"); + openapiFields.add("client_secret"); + openapiFields.add("client_id_issued_at"); + openapiFields.add("client_secret_expires_at"); + openapiFields.add("redirect_uris"); + openapiFields.add("client_name"); + openapiFields.add("token_endpoint_auth_method"); + openapiFields.add("grant_types"); + openapiFields.add("response_types"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 DynamicClientRegistrationResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!DynamicClientRegistrationResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in DynamicClientRegistrationResponse is not found in the empty JSON string", DynamicClientRegistrationResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("client_id") != null && !jsonObj.get("client_id").isJsonNull()) && !jsonObj.get("client_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_id").toString())); + } + if ((jsonObj.get("client_secret") != null && !jsonObj.get("client_secret").isJsonNull()) && !jsonObj.get("client_secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_secret").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("redirect_uris") != null && !jsonObj.get("redirect_uris").isJsonNull() && !jsonObj.get("redirect_uris").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `redirect_uris` to be an array in the JSON string but got `%s`", jsonObj.get("redirect_uris").toString())); + } + if ((jsonObj.get("client_name") != null && !jsonObj.get("client_name").isJsonNull()) && !jsonObj.get("client_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_name").toString())); + } + if ((jsonObj.get("token_endpoint_auth_method") != null && !jsonObj.get("token_endpoint_auth_method").isJsonNull()) && !jsonObj.get("token_endpoint_auth_method").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `token_endpoint_auth_method` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token_endpoint_auth_method").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("grant_types") != null && !jsonObj.get("grant_types").isJsonNull() && !jsonObj.get("grant_types").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `grant_types` to be an array in the JSON string but got `%s`", jsonObj.get("grant_types").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("response_types") != null && !jsonObj.get("response_types").isJsonNull() && !jsonObj.get("response_types").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `response_types` to be an array in the JSON string but got `%s`", jsonObj.get("response_types").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!DynamicClientRegistrationResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'DynamicClientRegistrationResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<DynamicClientRegistrationResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(DynamicClientRegistrationResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<DynamicClientRegistrationResponse>() { + @Override + public void write(JsonWriter out, DynamicClientRegistrationResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public DynamicClientRegistrationResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + DynamicClientRegistrationResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of DynamicClientRegistrationResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of DynamicClientRegistrationResponse + * @throws IOException if the JSON string is invalid with respect to DynamicClientRegistrationResponse + */ + public static DynamicClientRegistrationResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, DynamicClientRegistrationResponse.class); + } + + /** + * Convert an instance of DynamicClientRegistrationResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/Email.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/Email.java new file mode 100644 index 0000000..aca72b3 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/Email.java @@ -0,0 +1,326 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * Email + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class Email { + public static final String SERIALIZED_NAME_TYPE = "Type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public static final String SERIALIZED_NAME_VALUE = "Value"; + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nonnull + private String value; + + public Email() { + } + + public Email type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The type of the Email (e.g., primary, secondary). + * @return type + */ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public Email value(@javax.annotation.Nonnull String value) { + this.value = value; + return this; + } + + /** + * The Email address. + * @return value + */ + @javax.annotation.Nonnull + public String getValue() { + return value; + } + + public void setValue(@javax.annotation.Nonnull String value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Email instance itself + */ + public Email putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Email email = (Email) o; + return Objects.equals(this.type, email.type) && + Objects.equals(this.value, email.value)&& + Objects.equals(this.additionalProperties, email.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Email {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Type"); + openapiFields.add("Value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Type"); + openapiRequiredFields.add("Value"); + } + + /** + * 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 Email + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Email.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Email is not found in the empty JSON string", Email.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : Email.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("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + 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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!Email.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Email' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<Email> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Email.class)); + + return (TypeAdapter<T>) new TypeAdapter<Email>() { + @Override + public void write(JsonWriter out, Email value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Email read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Email instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Email given an JSON string + * + * @param jsonString JSON string + * @return An instance of Email + * @throws IOException if the JSON string is invalid with respect to Email + */ + public static Email fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Email.class); + } + + /** + * Convert an instance of Email to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/EmailByLoginUserNamePhone200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/EmailByLoginUserNamePhone200Response.java new file mode 100644 index 0000000..d232d0f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/EmailByLoginUserNamePhone200Response.java @@ -0,0 +1,283 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.AuthResponseOptionalMfa; +import com.loginradius.sdk.internal.openapi.model.AuthResponseRequiredMfa; +import com.loginradius.sdk.internal.openapi.model.EmailOTPStatus; +import com.loginradius.sdk.internal.openapi.model.Profile; +import com.loginradius.sdk.internal.openapi.model.SMSResponseData; +import com.loginradius.sdk.internal.openapi.model.SecurityQuestions; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class EmailByLoginUserNamePhone200Response extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(EmailByLoginUserNamePhone200Response.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!EmailByLoginUserNamePhone200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailByLoginUserNamePhone200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<AuthResponseOptionalMfa> adapterAuthResponseOptionalMfa = gson.getDelegateAdapter(this, TypeToken.get(AuthResponseOptionalMfa.class)); + final TypeAdapter<AuthResponseRequiredMfa> adapterAuthResponseRequiredMfa = gson.getDelegateAdapter(this, TypeToken.get(AuthResponseRequiredMfa.class)); + + return (TypeAdapter<T>) new TypeAdapter<EmailByLoginUserNamePhone200Response>() { + @Override + public void write(JsonWriter out, EmailByLoginUserNamePhone200Response value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `AuthResponseOptionalMfa` + if (value.getActualInstance() instanceof AuthResponseOptionalMfa) { + JsonElement element = adapterAuthResponseOptionalMfa.toJsonTree((AuthResponseOptionalMfa)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `AuthResponseRequiredMfa` + if (value.getActualInstance() instanceof AuthResponseRequiredMfa) { + JsonElement element = adapterAuthResponseRequiredMfa.toJsonTree((AuthResponseRequiredMfa)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: AuthResponseOptionalMfa, AuthResponseRequiredMfa"); + } + + @Override + public EmailByLoginUserNamePhone200Response read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize AuthResponseOptionalMfa + try { + // validate the JSON object to see if any exception is thrown + AuthResponseOptionalMfa.validateJsonElement(jsonElement); + actualAdapter = adapterAuthResponseOptionalMfa; + match++; + log.log(Level.FINER, "Input data matches schema 'AuthResponseOptionalMfa'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for AuthResponseOptionalMfa failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'AuthResponseOptionalMfa'", e); + } + // deserialize AuthResponseRequiredMfa + try { + // validate the JSON object to see if any exception is thrown + AuthResponseRequiredMfa.validateJsonElement(jsonElement); + actualAdapter = adapterAuthResponseRequiredMfa; + match++; + log.log(Level.FINER, "Input data matches schema 'AuthResponseRequiredMfa'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for AuthResponseRequiredMfa failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'AuthResponseRequiredMfa'", e); + } + + if (match == 1) { + EmailByLoginUserNamePhone200Response ret = new EmailByLoginUserNamePhone200Response(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for EmailByLoginUserNamePhone200Response: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public EmailByLoginUserNamePhone200Response() { + super("oneOf", Boolean.FALSE); + } + + public EmailByLoginUserNamePhone200Response(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("AuthResponseOptionalMfa", AuthResponseOptionalMfa.class); + schemas.put("AuthResponseRequiredMfa", AuthResponseRequiredMfa.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return EmailByLoginUserNamePhone200Response.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * AuthResponseOptionalMfa, AuthResponseRequiredMfa + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof AuthResponseOptionalMfa) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof AuthResponseRequiredMfa) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be AuthResponseOptionalMfa, AuthResponseRequiredMfa"); + } + + /** + * Get the actual instance, which can be the following: + * AuthResponseOptionalMfa, AuthResponseRequiredMfa + * + * @return The actual instance (AuthResponseOptionalMfa, AuthResponseRequiredMfa) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `AuthResponseOptionalMfa`. If the actual instance is not `AuthResponseOptionalMfa`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AuthResponseOptionalMfa` + * @throws ClassCastException if the instance is not `AuthResponseOptionalMfa` + */ + public AuthResponseOptionalMfa getAuthResponseOptionalMfa() throws ClassCastException { + return (AuthResponseOptionalMfa)super.getActualInstance(); + } + + /** + * Get the actual instance of `AuthResponseRequiredMfa`. If the actual instance is not `AuthResponseRequiredMfa`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AuthResponseRequiredMfa` + * @throws ClassCastException if the instance is not `AuthResponseRequiredMfa` + */ + public AuthResponseRequiredMfa getAuthResponseRequiredMfa() throws ClassCastException { + return (AuthResponseRequiredMfa)super.getActualInstance(); + } + + /** + * 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 EmailByLoginUserNamePhone200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with AuthResponseOptionalMfa + try { + AuthResponseOptionalMfa.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for AuthResponseOptionalMfa failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with AuthResponseRequiredMfa + try { + AuthResponseRequiredMfa.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for AuthResponseRequiredMfa failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for EmailByLoginUserNamePhone200Response with oneOf schemas: AuthResponseOptionalMfa, AuthResponseRequiredMfa. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of EmailByLoginUserNamePhone200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailByLoginUserNamePhone200Response + * @throws IOException if the JSON string is invalid with respect to EmailByLoginUserNamePhone200Response + */ + public static EmailByLoginUserNamePhone200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailByLoginUserNamePhone200Response.class); + } + + /** + * Convert an instance of EmailByLoginUserNamePhone200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/EmailByLoginUserNamePhoneRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/EmailByLoginUserNamePhoneRequest.java new file mode 100644 index 0000000..8a17a86 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/EmailByLoginUserNamePhoneRequest.java @@ -0,0 +1,323 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.LoginByEmailRequest; +import com.loginradius.sdk.internal.openapi.model.LoginByPhone; +import com.loginradius.sdk.internal.openapi.model.LoginByUsernameRequest; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class EmailByLoginUserNamePhoneRequest extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(EmailByLoginUserNamePhoneRequest.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!EmailByLoginUserNamePhoneRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailByLoginUserNamePhoneRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<LoginByEmailRequest> adapterLoginByEmailRequest = gson.getDelegateAdapter(this, TypeToken.get(LoginByEmailRequest.class)); + final TypeAdapter<LoginByUsernameRequest> adapterLoginByUsernameRequest = gson.getDelegateAdapter(this, TypeToken.get(LoginByUsernameRequest.class)); + final TypeAdapter<LoginByPhone> adapterLoginByPhone = gson.getDelegateAdapter(this, TypeToken.get(LoginByPhone.class)); + + return (TypeAdapter<T>) new TypeAdapter<EmailByLoginUserNamePhoneRequest>() { + @Override + public void write(JsonWriter out, EmailByLoginUserNamePhoneRequest value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `LoginByEmailRequest` + if (value.getActualInstance() instanceof LoginByEmailRequest) { + JsonElement element = adapterLoginByEmailRequest.toJsonTree((LoginByEmailRequest)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `LoginByUsernameRequest` + if (value.getActualInstance() instanceof LoginByUsernameRequest) { + JsonElement element = adapterLoginByUsernameRequest.toJsonTree((LoginByUsernameRequest)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `LoginByPhone` + if (value.getActualInstance() instanceof LoginByPhone) { + JsonElement element = adapterLoginByPhone.toJsonTree((LoginByPhone)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: LoginByEmailRequest, LoginByPhone, LoginByUsernameRequest"); + } + + @Override + public EmailByLoginUserNamePhoneRequest read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize LoginByEmailRequest + try { + // validate the JSON object to see if any exception is thrown + LoginByEmailRequest.validateJsonElement(jsonElement); + actualAdapter = adapterLoginByEmailRequest; + match++; + log.log(Level.FINER, "Input data matches schema 'LoginByEmailRequest'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for LoginByEmailRequest failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'LoginByEmailRequest'", e); + } + // deserialize LoginByUsernameRequest + try { + // validate the JSON object to see if any exception is thrown + LoginByUsernameRequest.validateJsonElement(jsonElement); + actualAdapter = adapterLoginByUsernameRequest; + match++; + log.log(Level.FINER, "Input data matches schema 'LoginByUsernameRequest'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for LoginByUsernameRequest failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'LoginByUsernameRequest'", e); + } + // deserialize LoginByPhone + try { + // validate the JSON object to see if any exception is thrown + LoginByPhone.validateJsonElement(jsonElement); + actualAdapter = adapterLoginByPhone; + match++; + log.log(Level.FINER, "Input data matches schema 'LoginByPhone'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for LoginByPhone failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'LoginByPhone'", e); + } + + if (match == 1) { + EmailByLoginUserNamePhoneRequest ret = new EmailByLoginUserNamePhoneRequest(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for EmailByLoginUserNamePhoneRequest: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public EmailByLoginUserNamePhoneRequest() { + super("oneOf", Boolean.FALSE); + } + + public EmailByLoginUserNamePhoneRequest(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("LoginByEmailRequest", LoginByEmailRequest.class); + schemas.put("LoginByUsernameRequest", LoginByUsernameRequest.class); + schemas.put("LoginByPhone", LoginByPhone.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return EmailByLoginUserNamePhoneRequest.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * LoginByEmailRequest, LoginByPhone, LoginByUsernameRequest + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof LoginByEmailRequest) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof LoginByUsernameRequest) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof LoginByPhone) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be LoginByEmailRequest, LoginByPhone, LoginByUsernameRequest"); + } + + /** + * Get the actual instance, which can be the following: + * LoginByEmailRequest, LoginByPhone, LoginByUsernameRequest + * + * @return The actual instance (LoginByEmailRequest, LoginByPhone, LoginByUsernameRequest) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `LoginByEmailRequest`. If the actual instance is not `LoginByEmailRequest`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `LoginByEmailRequest` + * @throws ClassCastException if the instance is not `LoginByEmailRequest` + */ + public LoginByEmailRequest getLoginByEmailRequest() throws ClassCastException { + return (LoginByEmailRequest)super.getActualInstance(); + } + + /** + * Get the actual instance of `LoginByUsernameRequest`. If the actual instance is not `LoginByUsernameRequest`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `LoginByUsernameRequest` + * @throws ClassCastException if the instance is not `LoginByUsernameRequest` + */ + public LoginByUsernameRequest getLoginByUsernameRequest() throws ClassCastException { + return (LoginByUsernameRequest)super.getActualInstance(); + } + + /** + * Get the actual instance of `LoginByPhone`. If the actual instance is not `LoginByPhone`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `LoginByPhone` + * @throws ClassCastException if the instance is not `LoginByPhone` + */ + public LoginByPhone getLoginByPhone() throws ClassCastException { + return (LoginByPhone)super.getActualInstance(); + } + + /** + * 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 EmailByLoginUserNamePhoneRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with LoginByEmailRequest + try { + LoginByEmailRequest.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for LoginByEmailRequest failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with LoginByUsernameRequest + try { + LoginByUsernameRequest.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for LoginByUsernameRequest failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with LoginByPhone + try { + LoginByPhone.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for LoginByPhone failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for EmailByLoginUserNamePhoneRequest with oneOf schemas: LoginByEmailRequest, LoginByPhone, LoginByUsernameRequest. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of EmailByLoginUserNamePhoneRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailByLoginUserNamePhoneRequest + * @throws IOException if the JSON string is invalid with respect to EmailByLoginUserNamePhoneRequest + */ + public static EmailByLoginUserNamePhoneRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailByLoginUserNamePhoneRequest.class); + } + + /** + * Convert an instance of EmailByLoginUserNamePhoneRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/EmailModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/EmailModel.java new file mode 100644 index 0000000..8c805a8 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/EmailModel.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * EmailModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class EmailModel { + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nonnull + private String email; + + public EmailModel() { + } + + public EmailModel email(@javax.annotation.Nonnull String email) { + this.email = email; + return this; + } + + /** + * The User's Email address + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nonnull String email) { + this.email = email; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the EmailModel instance itself + */ + public EmailModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailModel emailModel = (EmailModel) o; + return Objects.equals(this.email, emailModel.email)&& + Objects.equals(this.additionalProperties, emailModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailModel {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("email"); + } + + /** + * 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 EmailModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EmailModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EmailModel is not found in the empty JSON string", EmailModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EmailModel.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("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!EmailModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<EmailModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<EmailModel>() { + @Override + public void write(JsonWriter out, EmailModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public EmailModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EmailModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailModel + * @throws IOException if the JSON string is invalid with respect to EmailModel + */ + public static EmailModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailModel.class); + } + + /** + * Convert an instance of EmailModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/EmailModelManage.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/EmailModelManage.java new file mode 100644 index 0000000..4abb295 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/EmailModelManage.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * EmailModelManage + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class EmailModelManage { + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nonnull + private String email; + + public EmailModelManage() { + } + + public EmailModelManage email(@javax.annotation.Nonnull String email) { + this.email = email; + return this; + } + + /** + * The Email address to be processed. + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nonnull String email) { + this.email = email; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the EmailModelManage instance itself + */ + public EmailModelManage putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailModelManage emailModelManage = (EmailModelManage) o; + return Objects.equals(this.email, emailModelManage.email)&& + Objects.equals(this.additionalProperties, emailModelManage.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailModelManage {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("email"); + } + + /** + * 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 EmailModelManage + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EmailModelManage.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EmailModelManage is not found in the empty JSON string", EmailModelManage.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EmailModelManage.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("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!EmailModelManage.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailModelManage' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<EmailModelManage> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailModelManage.class)); + + return (TypeAdapter<T>) new TypeAdapter<EmailModelManage>() { + @Override + public void write(JsonWriter out, EmailModelManage value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public EmailModelManage read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EmailModelManage instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailModelManage given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailModelManage + * @throws IOException if the JSON string is invalid with respect to EmailModelManage + */ + public static EmailModelManage fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailModelManage.class); + } + + /** + * Convert an instance of EmailModelManage to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/EmailOTPStatus.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/EmailOTPStatus.java new file mode 100644 index 0000000..cb8c8e8 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/EmailOTPStatus.java @@ -0,0 +1,287 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * EmailOTPStatus + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class EmailOTPStatus { + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private String email; + + public EmailOTPStatus() { + } + + public EmailOTPStatus email(@javax.annotation.Nullable String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable String email) { + this.email = email; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the EmailOTPStatus instance itself + */ + public EmailOTPStatus putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailOTPStatus emailOTPStatus = (EmailOTPStatus) o; + return Objects.equals(this.email, emailOTPStatus.email)&& + Objects.equals(this.additionalProperties, emailOTPStatus.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailOTPStatus {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 EmailOTPStatus + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EmailOTPStatus.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EmailOTPStatus is not found in the empty JSON string", EmailOTPStatus.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Email") != null && !jsonObj.get("Email").isJsonNull()) && !jsonObj.get("Email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Email").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!EmailOTPStatus.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailOTPStatus' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<EmailOTPStatus> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailOTPStatus.class)); + + return (TypeAdapter<T>) new TypeAdapter<EmailOTPStatus>() { + @Override + public void write(JsonWriter out, EmailOTPStatus value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public EmailOTPStatus read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EmailOTPStatus instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailOTPStatus given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailOTPStatus + * @throws IOException if the JSON string is invalid with respect to EmailOTPStatus + */ + public static EmailOTPStatus fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailOTPStatus.class); + } + + /** + * Convert an instance of EmailOTPStatus to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/EmailTemplateModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/EmailTemplateModel.java new file mode 100644 index 0000000..498fd99 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/EmailTemplateModel.java @@ -0,0 +1,718 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * EmailTemplateModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class EmailTemplateModel { + /** + * The type of the Email template + */ + @JsonAdapter(TemplateTypeEnum.Adapter.class) + public enum TemplateTypeEnum { + REGISTRATION("registration"), + + FORGOTPASSWORD("forgotpassword"), + + FORGOTPROVIDER("forgotprovider"), + + DELETEACCOUNT("deleteaccount"), + + ADD_EMAIL("add_email"), + + WELCOME("welcome"), + + ONECLICKSIGNIN("oneclicksignin"), + + AUTOLOGIN("autologin"), + + NOREGISTRATIONPASSWORDLESSLOGIN("noregistrationpasswordlesslogin"), + + RESETPASSWORD("resetpassword"), + + SUSPICIOUS_IP_EMAIL_TO_USER("suspicious_ip_email_to_user"), + + SUSPICIOUS_CITY_EMAIL_TO_USER("suspicious_city_email_to_user"), + + SUSPICIOUS_COUNTRY_EMAIL_TO_USER("suspicious_country_email_to_user"), + + SUSPICIOUS_BROWSER_EMAIL_TO_USER("suspicious_browser_email_to_user"), + + RISK_IDENTIFIED_TO_ADMIN("risk_identified_to_admin"), + + FORGOTPIN("forgotpin"), + + SECONDFACTORAUTHENTICATION("secondfactorauthentication"), + + INVITE_USER_TO_ORGANIZATION("invite_user_to_organization"), + + SUSPICIOUS_DEVICE_EMAIL_TO_USER("suspicious_device_email_to_user"), + + BREACHED_PASSWORD("breached_password"), + + ADMIN_NOTIFICATION_BREACHED_PASSWORD("admin_notification_breached_password"), + + ADD_PASSKEY("add_passkey"), + + DELETE_PASSKEY("delete_passkey"), + + FORGET_PASSKEY("forget_passkey"); + + private String value; + + TemplateTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TemplateTypeEnum fromValue(String value) { + for (TemplateTypeEnum b : TemplateTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<TemplateTypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final TemplateTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TemplateTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TemplateTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TemplateTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TEMPLATE_TYPE = "TemplateType"; + @SerializedName(SERIALIZED_NAME_TEMPLATE_TYPE) + @javax.annotation.Nonnull + private TemplateTypeEnum templateType; + + public static final String SERIALIZED_NAME_TEMPLATE_NAME = "TemplateName"; + @SerializedName(SERIALIZED_NAME_TEMPLATE_NAME) + @javax.annotation.Nullable + private String templateName; + + public static final String SERIALIZED_NAME_TEMPLATE = "Template"; + @SerializedName(SERIALIZED_NAME_TEMPLATE) + @javax.annotation.Nonnull + private String template; + + public static final String SERIALIZED_NAME_SUBJECT = "Subject"; + @SerializedName(SERIALIZED_NAME_SUBJECT) + @javax.annotation.Nonnull + private String subject; + + public static final String SERIALIZED_NAME_TEXT_TEMPLATE = "TextTemplate"; + @SerializedName(SERIALIZED_NAME_TEXT_TEMPLATE) + @javax.annotation.Nullable + private String textTemplate; + + public static final String SERIALIZED_NAME_FROM_NAME = "FromName"; + @SerializedName(SERIALIZED_NAME_FROM_NAME) + @javax.annotation.Nullable + private String fromName; + + public static final String SERIALIZED_NAME_FROM_EMAIL = "FromEmail"; + @SerializedName(SERIALIZED_NAME_FROM_EMAIL) + @javax.annotation.Nullable + private String fromEmail; + + public static final String SERIALIZED_NAME_EMAIL_CONFIG_ID = "EmailConfigId"; + @SerializedName(SERIALIZED_NAME_EMAIL_CONFIG_ID) + @javax.annotation.Nullable + private String emailConfigId; + + public static final String SERIALIZED_NAME_IS_DEFAULT = "IsDefault"; + @SerializedName(SERIALIZED_NAME_IS_DEFAULT) + @javax.annotation.Nullable + private Boolean isDefault = false; + + /** + * The Email Verification token type for the template. This will be set only for 'registration','forgotpassword','deleteaccount','add_email','oneclicksignin', 'autologin','noregistrationpasswordlesslogin','forgotpin','breached_password' and 'forget_passkey' templates. + */ + @JsonAdapter(VerificationTokenTypeEnum.Adapter.class) + public enum VerificationTokenTypeEnum { + MAGIC_LINK("MagicLink"), + + OTP("Otp"); + + private String value; + + VerificationTokenTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static VerificationTokenTypeEnum fromValue(String value) { + for (VerificationTokenTypeEnum b : VerificationTokenTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<VerificationTokenTypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final VerificationTokenTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public VerificationTokenTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return VerificationTokenTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + VerificationTokenTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_VERIFICATION_TOKEN_TYPE = "VerificationTokenType"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_TOKEN_TYPE) + @javax.annotation.Nullable + private VerificationTokenTypeEnum verificationTokenType; + + public EmailTemplateModel() { + } + + public EmailTemplateModel templateType(@javax.annotation.Nonnull TemplateTypeEnum templateType) { + this.templateType = templateType; + return this; + } + + /** + * The type of the Email template + * @return templateType + */ + @javax.annotation.Nonnull + public TemplateTypeEnum getTemplateType() { + return templateType; + } + + public void setTemplateType(@javax.annotation.Nonnull TemplateTypeEnum templateType) { + this.templateType = templateType; + } + + + public EmailTemplateModel templateName(@javax.annotation.Nullable String templateName) { + this.templateName = templateName; + return this; + } + + /** + * The name of the Email template + * @return templateName + */ + @javax.annotation.Nullable + public String getTemplateName() { + return templateName; + } + + public void setTemplateName(@javax.annotation.Nullable String templateName) { + this.templateName = templateName; + } + + + public EmailTemplateModel template(@javax.annotation.Nonnull String template) { + this.template = template; + return this; + } + + /** + * The content of the Email template + * @return template + */ + @javax.annotation.Nonnull + public String getTemplate() { + return template; + } + + public void setTemplate(@javax.annotation.Nonnull String template) { + this.template = template; + } + + + public EmailTemplateModel subject(@javax.annotation.Nonnull String subject) { + this.subject = subject; + return this; + } + + /** + * The subject of the Email template + * @return subject + */ + @javax.annotation.Nonnull + public String getSubject() { + return subject; + } + + public void setSubject(@javax.annotation.Nonnull String subject) { + this.subject = subject; + } + + + public EmailTemplateModel textTemplate(@javax.annotation.Nullable String textTemplate) { + this.textTemplate = textTemplate; + return this; + } + + /** + * The text version of the Email template + * @return textTemplate + */ + @javax.annotation.Nullable + public String getTextTemplate() { + return textTemplate; + } + + public void setTextTemplate(@javax.annotation.Nullable String textTemplate) { + this.textTemplate = textTemplate; + } + + + public EmailTemplateModel fromName(@javax.annotation.Nullable String fromName) { + this.fromName = fromName; + return this; + } + + /** + * The name of the sender + * @return fromName + */ + @javax.annotation.Nullable + public String getFromName() { + return fromName; + } + + public void setFromName(@javax.annotation.Nullable String fromName) { + this.fromName = fromName; + } + + + public EmailTemplateModel fromEmail(@javax.annotation.Nullable String fromEmail) { + this.fromEmail = fromEmail; + return this; + } + + /** + * The Email address of the sender + * @return fromEmail + */ + @javax.annotation.Nullable + public String getFromEmail() { + return fromEmail; + } + + public void setFromEmail(@javax.annotation.Nullable String fromEmail) { + this.fromEmail = fromEmail; + } + + + public EmailTemplateModel emailConfigId(@javax.annotation.Nullable String emailConfigId) { + this.emailConfigId = emailConfigId; + return this; + } + + /** + * Email configuration ID for sending this template. + * @return emailConfigId + */ + @javax.annotation.Nullable + public String getEmailConfigId() { + return emailConfigId; + } + + public void setEmailConfigId(@javax.annotation.Nullable String emailConfigId) { + this.emailConfigId = emailConfigId; + } + + + public EmailTemplateModel isDefault(@javax.annotation.Nullable Boolean isDefault) { + this.isDefault = isDefault; + return this; + } + + /** + * Set to true to mark this template as the default for its TemplateType. + * @return isDefault + */ + @javax.annotation.Nullable + public Boolean getIsDefault() { + return isDefault; + } + + public void setIsDefault(@javax.annotation.Nullable Boolean isDefault) { + this.isDefault = isDefault; + } + + + public EmailTemplateModel verificationTokenType(@javax.annotation.Nullable VerificationTokenTypeEnum verificationTokenType) { + this.verificationTokenType = verificationTokenType; + return this; + } + + /** + * The Email Verification token type for the template. This will be set only for 'registration','forgotpassword','deleteaccount','add_email','oneclicksignin', 'autologin','noregistrationpasswordlesslogin','forgotpin','breached_password' and 'forget_passkey' templates. + * @return verificationTokenType + */ + @javax.annotation.Nullable + public VerificationTokenTypeEnum getVerificationTokenType() { + return verificationTokenType; + } + + public void setVerificationTokenType(@javax.annotation.Nullable VerificationTokenTypeEnum verificationTokenType) { + this.verificationTokenType = verificationTokenType; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the EmailTemplateModel instance itself + */ + public EmailTemplateModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailTemplateModel emailTemplateModel = (EmailTemplateModel) o; + return Objects.equals(this.templateType, emailTemplateModel.templateType) && + Objects.equals(this.templateName, emailTemplateModel.templateName) && + Objects.equals(this.template, emailTemplateModel.template) && + Objects.equals(this.subject, emailTemplateModel.subject) && + Objects.equals(this.textTemplate, emailTemplateModel.textTemplate) && + Objects.equals(this.fromName, emailTemplateModel.fromName) && + Objects.equals(this.fromEmail, emailTemplateModel.fromEmail) && + Objects.equals(this.emailConfigId, emailTemplateModel.emailConfigId) && + Objects.equals(this.isDefault, emailTemplateModel.isDefault) && + Objects.equals(this.verificationTokenType, emailTemplateModel.verificationTokenType)&& + Objects.equals(this.additionalProperties, emailTemplateModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(templateType, templateName, template, subject, textTemplate, fromName, fromEmail, emailConfigId, isDefault, verificationTokenType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailTemplateModel {\n"); + sb.append(" templateType: ").append(toIndentedString(templateType)).append("\n"); + sb.append(" templateName: ").append(toIndentedString(templateName)).append("\n"); + sb.append(" template: ").append(toIndentedString(template)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" textTemplate: ").append(toIndentedString(textTemplate)).append("\n"); + sb.append(" fromName: ").append(toIndentedString(fromName)).append("\n"); + sb.append(" fromEmail: ").append(toIndentedString(fromEmail)).append("\n"); + sb.append(" emailConfigId: ").append(toIndentedString(emailConfigId)).append("\n"); + sb.append(" isDefault: ").append(toIndentedString(isDefault)).append("\n"); + sb.append(" verificationTokenType: ").append(toIndentedString(verificationTokenType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("TemplateType"); + openapiFields.add("TemplateName"); + openapiFields.add("Template"); + openapiFields.add("Subject"); + openapiFields.add("TextTemplate"); + openapiFields.add("FromName"); + openapiFields.add("FromEmail"); + openapiFields.add("EmailConfigId"); + openapiFields.add("IsDefault"); + openapiFields.add("VerificationTokenType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("TemplateType"); + openapiRequiredFields.add("Template"); + openapiRequiredFields.add("Subject"); + } + + /** + * 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 EmailTemplateModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EmailTemplateModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EmailTemplateModel is not found in the empty JSON string", EmailTemplateModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EmailTemplateModel.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("TemplateType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TemplateType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TemplateType").toString())); + } + // validate the required field `TemplateType` + TemplateTypeEnum.validateJsonElement(jsonObj.get("TemplateType")); + if ((jsonObj.get("TemplateName") != null && !jsonObj.get("TemplateName").isJsonNull()) && !jsonObj.get("TemplateName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TemplateName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TemplateName").toString())); + } + if (!jsonObj.get("Template").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Template` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Template").toString())); + } + if (!jsonObj.get("Subject").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Subject").toString())); + } + if ((jsonObj.get("TextTemplate") != null && !jsonObj.get("TextTemplate").isJsonNull()) && !jsonObj.get("TextTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TextTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TextTemplate").toString())); + } + if ((jsonObj.get("FromName") != null && !jsonObj.get("FromName").isJsonNull()) && !jsonObj.get("FromName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FromName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FromName").toString())); + } + if ((jsonObj.get("FromEmail") != null && !jsonObj.get("FromEmail").isJsonNull()) && !jsonObj.get("FromEmail").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FromEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FromEmail").toString())); + } + if ((jsonObj.get("EmailConfigId") != null && !jsonObj.get("EmailConfigId").isJsonNull()) && !jsonObj.get("EmailConfigId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `EmailConfigId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("EmailConfigId").toString())); + } + if ((jsonObj.get("VerificationTokenType") != null && !jsonObj.get("VerificationTokenType").isJsonNull()) && !jsonObj.get("VerificationTokenType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `VerificationTokenType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("VerificationTokenType").toString())); + } + // validate the optional field `VerificationTokenType` + if (jsonObj.get("VerificationTokenType") != null && !jsonObj.get("VerificationTokenType").isJsonNull()) { + VerificationTokenTypeEnum.validateJsonElement(jsonObj.get("VerificationTokenType")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!EmailTemplateModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailTemplateModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<EmailTemplateModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailTemplateModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<EmailTemplateModel>() { + @Override + public void write(JsonWriter out, EmailTemplateModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public EmailTemplateModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EmailTemplateModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailTemplateModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailTemplateModel + * @throws IOException if the JSON string is invalid with respect to EmailTemplateModel + */ + public static EmailTemplateModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailTemplateModel.class); + } + + /** + * Convert an instance of EmailTemplateModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/EmailTemplateResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/EmailTemplateResponse.java new file mode 100644 index 0000000..840c44d --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/EmailTemplateResponse.java @@ -0,0 +1,637 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * EmailTemplateResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class EmailTemplateResponse { + public static final String SERIALIZED_NAME_TEMPLATE_TYPE = "TemplateType"; + @SerializedName(SERIALIZED_NAME_TEMPLATE_TYPE) + @javax.annotation.Nullable + private String templateType; + + public static final String SERIALIZED_NAME_TEMPLATE_NAME = "TemplateName"; + @SerializedName(SERIALIZED_NAME_TEMPLATE_NAME) + @javax.annotation.Nullable + private String templateName; + + public static final String SERIALIZED_NAME_TEMPLATE = "Template"; + @SerializedName(SERIALIZED_NAME_TEMPLATE) + @javax.annotation.Nullable + private String template; + + public static final String SERIALIZED_NAME_SUBJECT = "Subject"; + @SerializedName(SERIALIZED_NAME_SUBJECT) + @javax.annotation.Nullable + private String subject; + + public static final String SERIALIZED_NAME_IS_ACTIVE = "IsActive"; + @SerializedName(SERIALIZED_NAME_IS_ACTIVE) + @javax.annotation.Nullable + private Boolean isActive; + + public static final String SERIALIZED_NAME_IS_DEFAULT = "IsDefault"; + @SerializedName(SERIALIZED_NAME_IS_DEFAULT) + @javax.annotation.Nullable + private Boolean isDefault; + + public static final String SERIALIZED_NAME_TEXT_TEMPLATE = "TextTemplate"; + @SerializedName(SERIALIZED_NAME_TEXT_TEMPLATE) + @javax.annotation.Nullable + private String textTemplate; + + public static final String SERIALIZED_NAME_FROM_NAME = "FromName"; + @SerializedName(SERIALIZED_NAME_FROM_NAME) + @javax.annotation.Nullable + private String fromName; + + public static final String SERIALIZED_NAME_FROM_EMAIL = "FromEmail"; + @SerializedName(SERIALIZED_NAME_FROM_EMAIL) + @javax.annotation.Nullable + private String fromEmail; + + public static final String SERIALIZED_NAME_EMAIL_CONFIG_ID = "EmailConfigId"; + @SerializedName(SERIALIZED_NAME_EMAIL_CONFIG_ID) + @javax.annotation.Nullable + private String emailConfigId; + + /** + * The Email Verification token type for the template. + */ + @JsonAdapter(VerificationTokenTypeEnum.Adapter.class) + public enum VerificationTokenTypeEnum { + MAGIC_LINK("MagicLink"), + + OTP("Otp"); + + private String value; + + VerificationTokenTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static VerificationTokenTypeEnum fromValue(String value) { + for (VerificationTokenTypeEnum b : VerificationTokenTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<VerificationTokenTypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final VerificationTokenTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public VerificationTokenTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return VerificationTokenTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + VerificationTokenTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_VERIFICATION_TOKEN_TYPE = "VerificationTokenType"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_TOKEN_TYPE) + @javax.annotation.Nullable + private VerificationTokenTypeEnum verificationTokenType; + + public EmailTemplateResponse() { + } + + public EmailTemplateResponse templateType(@javax.annotation.Nullable String templateType) { + this.templateType = templateType; + return this; + } + + /** + * The type of the Email template + * @return templateType + */ + @javax.annotation.Nullable + public String getTemplateType() { + return templateType; + } + + public void setTemplateType(@javax.annotation.Nullable String templateType) { + this.templateType = templateType; + } + + + public EmailTemplateResponse templateName(@javax.annotation.Nullable String templateName) { + this.templateName = templateName; + return this; + } + + /** + * The name of the Email template + * @return templateName + */ + @javax.annotation.Nullable + public String getTemplateName() { + return templateName; + } + + public void setTemplateName(@javax.annotation.Nullable String templateName) { + this.templateName = templateName; + } + + + public EmailTemplateResponse template(@javax.annotation.Nullable String template) { + this.template = template; + return this; + } + + /** + * Get template + * @return template + */ + @javax.annotation.Nullable + public String getTemplate() { + return template; + } + + public void setTemplate(@javax.annotation.Nullable String template) { + this.template = template; + } + + + public EmailTemplateResponse subject(@javax.annotation.Nullable String subject) { + this.subject = subject; + return this; + } + + /** + * The subject of the Email template + * @return subject + */ + @javax.annotation.Nullable + public String getSubject() { + return subject; + } + + public void setSubject(@javax.annotation.Nullable String subject) { + this.subject = subject; + } + + + public EmailTemplateResponse isActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Indicates if the Email template is active + * @return isActive + */ + @javax.annotation.Nullable + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + } + + + public EmailTemplateResponse isDefault(@javax.annotation.Nullable Boolean isDefault) { + this.isDefault = isDefault; + return this; + } + + /** + * Indicates if this is the default Email template for the given TemplateType + * @return isDefault + */ + @javax.annotation.Nullable + public Boolean getIsDefault() { + return isDefault; + } + + public void setIsDefault(@javax.annotation.Nullable Boolean isDefault) { + this.isDefault = isDefault; + } + + + public EmailTemplateResponse textTemplate(@javax.annotation.Nullable String textTemplate) { + this.textTemplate = textTemplate; + return this; + } + + /** + * The text version of the Email template + * @return textTemplate + */ + @javax.annotation.Nullable + public String getTextTemplate() { + return textTemplate; + } + + public void setTextTemplate(@javax.annotation.Nullable String textTemplate) { + this.textTemplate = textTemplate; + } + + + public EmailTemplateResponse fromName(@javax.annotation.Nullable String fromName) { + this.fromName = fromName; + return this; + } + + /** + * The name of the sender + * @return fromName + */ + @javax.annotation.Nullable + public String getFromName() { + return fromName; + } + + public void setFromName(@javax.annotation.Nullable String fromName) { + this.fromName = fromName; + } + + + public EmailTemplateResponse fromEmail(@javax.annotation.Nullable String fromEmail) { + this.fromEmail = fromEmail; + return this; + } + + /** + * The Email address of the sender + * @return fromEmail + */ + @javax.annotation.Nullable + public String getFromEmail() { + return fromEmail; + } + + public void setFromEmail(@javax.annotation.Nullable String fromEmail) { + this.fromEmail = fromEmail; + } + + + public EmailTemplateResponse emailConfigId(@javax.annotation.Nullable String emailConfigId) { + this.emailConfigId = emailConfigId; + return this; + } + + /** + * Email configuration ID for sending this template. + * @return emailConfigId + */ + @javax.annotation.Nullable + public String getEmailConfigId() { + return emailConfigId; + } + + public void setEmailConfigId(@javax.annotation.Nullable String emailConfigId) { + this.emailConfigId = emailConfigId; + } + + + public EmailTemplateResponse verificationTokenType(@javax.annotation.Nullable VerificationTokenTypeEnum verificationTokenType) { + this.verificationTokenType = verificationTokenType; + return this; + } + + /** + * The Email Verification token type for the template. + * @return verificationTokenType + */ + @javax.annotation.Nullable + public VerificationTokenTypeEnum getVerificationTokenType() { + return verificationTokenType; + } + + public void setVerificationTokenType(@javax.annotation.Nullable VerificationTokenTypeEnum verificationTokenType) { + this.verificationTokenType = verificationTokenType; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the EmailTemplateResponse instance itself + */ + public EmailTemplateResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailTemplateResponse emailTemplateResponse = (EmailTemplateResponse) o; + return Objects.equals(this.templateType, emailTemplateResponse.templateType) && + Objects.equals(this.templateName, emailTemplateResponse.templateName) && + Objects.equals(this.template, emailTemplateResponse.template) && + Objects.equals(this.subject, emailTemplateResponse.subject) && + Objects.equals(this.isActive, emailTemplateResponse.isActive) && + Objects.equals(this.isDefault, emailTemplateResponse.isDefault) && + Objects.equals(this.textTemplate, emailTemplateResponse.textTemplate) && + Objects.equals(this.fromName, emailTemplateResponse.fromName) && + Objects.equals(this.fromEmail, emailTemplateResponse.fromEmail) && + Objects.equals(this.emailConfigId, emailTemplateResponse.emailConfigId) && + Objects.equals(this.verificationTokenType, emailTemplateResponse.verificationTokenType)&& + Objects.equals(this.additionalProperties, emailTemplateResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(templateType, templateName, template, subject, isActive, isDefault, textTemplate, fromName, fromEmail, emailConfigId, verificationTokenType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailTemplateResponse {\n"); + sb.append(" templateType: ").append(toIndentedString(templateType)).append("\n"); + sb.append(" templateName: ").append(toIndentedString(templateName)).append("\n"); + sb.append(" template: ").append(toIndentedString(template)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" isDefault: ").append(toIndentedString(isDefault)).append("\n"); + sb.append(" textTemplate: ").append(toIndentedString(textTemplate)).append("\n"); + sb.append(" fromName: ").append(toIndentedString(fromName)).append("\n"); + sb.append(" fromEmail: ").append(toIndentedString(fromEmail)).append("\n"); + sb.append(" emailConfigId: ").append(toIndentedString(emailConfigId)).append("\n"); + sb.append(" verificationTokenType: ").append(toIndentedString(verificationTokenType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("TemplateType"); + openapiFields.add("TemplateName"); + openapiFields.add("Template"); + openapiFields.add("Subject"); + openapiFields.add("IsActive"); + openapiFields.add("IsDefault"); + openapiFields.add("TextTemplate"); + openapiFields.add("FromName"); + openapiFields.add("FromEmail"); + openapiFields.add("EmailConfigId"); + openapiFields.add("VerificationTokenType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 EmailTemplateResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EmailTemplateResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EmailTemplateResponse is not found in the empty JSON string", EmailTemplateResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("TemplateType") != null && !jsonObj.get("TemplateType").isJsonNull()) && !jsonObj.get("TemplateType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TemplateType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TemplateType").toString())); + } + if ((jsonObj.get("TemplateName") != null && !jsonObj.get("TemplateName").isJsonNull()) && !jsonObj.get("TemplateName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TemplateName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TemplateName").toString())); + } + if ((jsonObj.get("Template") != null && !jsonObj.get("Template").isJsonNull()) && !jsonObj.get("Template").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Template` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Template").toString())); + } + if ((jsonObj.get("Subject") != null && !jsonObj.get("Subject").isJsonNull()) && !jsonObj.get("Subject").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Subject").toString())); + } + if ((jsonObj.get("TextTemplate") != null && !jsonObj.get("TextTemplate").isJsonNull()) && !jsonObj.get("TextTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TextTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TextTemplate").toString())); + } + if ((jsonObj.get("FromName") != null && !jsonObj.get("FromName").isJsonNull()) && !jsonObj.get("FromName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FromName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FromName").toString())); + } + if ((jsonObj.get("FromEmail") != null && !jsonObj.get("FromEmail").isJsonNull()) && !jsonObj.get("FromEmail").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FromEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FromEmail").toString())); + } + if ((jsonObj.get("EmailConfigId") != null && !jsonObj.get("EmailConfigId").isJsonNull()) && !jsonObj.get("EmailConfigId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `EmailConfigId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("EmailConfigId").toString())); + } + if ((jsonObj.get("VerificationTokenType") != null && !jsonObj.get("VerificationTokenType").isJsonNull()) && !jsonObj.get("VerificationTokenType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `VerificationTokenType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("VerificationTokenType").toString())); + } + // validate the optional field `VerificationTokenType` + if (jsonObj.get("VerificationTokenType") != null && !jsonObj.get("VerificationTokenType").isJsonNull()) { + VerificationTokenTypeEnum.validateJsonElement(jsonObj.get("VerificationTokenType")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!EmailTemplateResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailTemplateResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<EmailTemplateResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailTemplateResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<EmailTemplateResponse>() { + @Override + public void write(JsonWriter out, EmailTemplateResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public EmailTemplateResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EmailTemplateResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailTemplateResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailTemplateResponse + * @throws IOException if the JSON string is invalid with respect to EmailTemplateResponse + */ + public static EmailTemplateResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailTemplateResponse.class); + } + + /** + * Convert an instance of EmailTemplateResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/EmailToValidateServerSide.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/EmailToValidateServerSide.java new file mode 100644 index 0000000..b32d637 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/EmailToValidateServerSide.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * EmailToValidateServerSide + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class EmailToValidateServerSide { + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nonnull + private String email; + + public EmailToValidateServerSide() { + } + + public EmailToValidateServerSide email(@javax.annotation.Nonnull String email) { + this.email = email; + return this; + } + + /** + * The Email address to validate on the server side. + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nonnull String email) { + this.email = email; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the EmailToValidateServerSide instance itself + */ + public EmailToValidateServerSide putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailToValidateServerSide emailToValidateServerSide = (EmailToValidateServerSide) o; + return Objects.equals(this.email, emailToValidateServerSide.email)&& + Objects.equals(this.additionalProperties, emailToValidateServerSide.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailToValidateServerSide {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Email"); + } + + /** + * 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 EmailToValidateServerSide + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EmailToValidateServerSide.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EmailToValidateServerSide is not found in the empty JSON string", EmailToValidateServerSide.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EmailToValidateServerSide.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("Email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Email").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!EmailToValidateServerSide.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailToValidateServerSide' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<EmailToValidateServerSide> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailToValidateServerSide.class)); + + return (TypeAdapter<T>) new TypeAdapter<EmailToValidateServerSide>() { + @Override + public void write(JsonWriter out, EmailToValidateServerSide value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public EmailToValidateServerSide read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EmailToValidateServerSide instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailToValidateServerSide given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailToValidateServerSide + * @throws IOException if the JSON string is invalid with respect to EmailToValidateServerSide + */ + public static EmailToValidateServerSide fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailToValidateServerSide.class); + } + + /** + * Convert an instance of EmailToValidateServerSide to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/EmailUserNameModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/EmailUserNameModel.java new file mode 100644 index 0000000..b606749 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/EmailUserNameModel.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * EmailUserNameModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class EmailUserNameModel { + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private String email; + + public static final String SERIALIZED_NAME_USER_NAME = "UserName"; + @SerializedName(SERIALIZED_NAME_USER_NAME) + @javax.annotation.Nullable + private String userName; + + public EmailUserNameModel() { + } + + public EmailUserNameModel email(@javax.annotation.Nullable String email) { + this.email = email; + return this; + } + + /** + * The Email address of the User + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable String email) { + this.email = email; + } + + + public EmailUserNameModel userName(@javax.annotation.Nullable String userName) { + this.userName = userName; + return this; + } + + /** + * The Username of the User + * @return userName + */ + @javax.annotation.Nullable + public String getUserName() { + return userName; + } + + public void setUserName(@javax.annotation.Nullable String userName) { + this.userName = userName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the EmailUserNameModel instance itself + */ + public EmailUserNameModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailUserNameModel emailUserNameModel = (EmailUserNameModel) o; + return Objects.equals(this.email, emailUserNameModel.email) && + Objects.equals(this.userName, emailUserNameModel.userName)&& + Objects.equals(this.additionalProperties, emailUserNameModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, userName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailUserNameModel {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" userName: ").append(toIndentedString(userName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Email"); + openapiFields.add("UserName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 EmailUserNameModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EmailUserNameModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EmailUserNameModel is not found in the empty JSON string", EmailUserNameModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Email") != null && !jsonObj.get("Email").isJsonNull()) && !jsonObj.get("Email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Email").toString())); + } + if ((jsonObj.get("UserName") != null && !jsonObj.get("UserName").isJsonNull()) && !jsonObj.get("UserName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UserName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UserName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!EmailUserNameModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailUserNameModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<EmailUserNameModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailUserNameModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<EmailUserNameModel>() { + @Override + public void write(JsonWriter out, EmailUserNameModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public EmailUserNameModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EmailUserNameModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailUserNameModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailUserNameModel + * @throws IOException if the JSON string is invalid with respect to EmailUserNameModel + */ + public static EmailUserNameModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailUserNameModel.class); + } + + /** + * Convert an instance of EmailUserNameModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/EmailVerificationOrForgotPINModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/EmailVerificationOrForgotPINModel.java new file mode 100644 index 0000000..846d634 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/EmailVerificationOrForgotPINModel.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * This model is used to verify the Email address of a User or send the forgot PIN request. It requires the Email address of the User. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class EmailVerificationOrForgotPINModel { + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nonnull + private String email; + + public EmailVerificationOrForgotPINModel() { + } + + public EmailVerificationOrForgotPINModel email(@javax.annotation.Nonnull String email) { + this.email = email; + return this; + } + + /** + * The Email address of the User + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nonnull String email) { + this.email = email; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the EmailVerificationOrForgotPINModel instance itself + */ + public EmailVerificationOrForgotPINModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EmailVerificationOrForgotPINModel emailVerificationOrForgotPINModel = (EmailVerificationOrForgotPINModel) o; + return Objects.equals(this.email, emailVerificationOrForgotPINModel.email)&& + Objects.equals(this.additionalProperties, emailVerificationOrForgotPINModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EmailVerificationOrForgotPINModel {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("email"); + } + + /** + * 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 EmailVerificationOrForgotPINModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EmailVerificationOrForgotPINModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EmailVerificationOrForgotPINModel is not found in the empty JSON string", EmailVerificationOrForgotPINModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EmailVerificationOrForgotPINModel.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("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!EmailVerificationOrForgotPINModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EmailVerificationOrForgotPINModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<EmailVerificationOrForgotPINModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EmailVerificationOrForgotPINModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<EmailVerificationOrForgotPINModel>() { + @Override + public void write(JsonWriter out, EmailVerificationOrForgotPINModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public EmailVerificationOrForgotPINModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EmailVerificationOrForgotPINModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EmailVerificationOrForgotPINModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of EmailVerificationOrForgotPINModel + * @throws IOException if the JSON string is invalid with respect to EmailVerificationOrForgotPINModel + */ + public static EmailVerificationOrForgotPINModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EmailVerificationOrForgotPINModel.class); + } + + /** + * Convert an instance of EmailVerificationOrForgotPINModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ErrorResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ErrorResponse.java new file mode 100644 index 0000000..293140e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ErrorResponse.java @@ -0,0 +1,383 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ErrorResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ErrorResponse { + public static final String SERIALIZED_NAME_MESSAGE = "Message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + @javax.annotation.Nullable + private String message; + + public static final String SERIALIZED_NAME_DESCRIPTION = "Description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_ERROR_CODE = "ErrorCode"; + @SerializedName(SERIALIZED_NAME_ERROR_CODE) + @javax.annotation.Nullable + private Integer errorCode; + + public static final String SERIALIZED_NAME_CODE = "Code"; + @SerializedName(SERIALIZED_NAME_CODE) + @javax.annotation.Nullable + private Integer code; + + public ErrorResponse() { + } + + public ErrorResponse message(@javax.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Brief message describing the error. + * @return message + */ + @javax.annotation.Nullable + public String getMessage() { + return message; + } + + public void setMessage(@javax.annotation.Nullable String message) { + this.message = message; + } + + + public ErrorResponse description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Detailed description of the error. + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public ErrorResponse errorCode(@javax.annotation.Nullable Integer errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Error code for identifying the error type. + * @return errorCode + */ + @javax.annotation.Nullable + public Integer getErrorCode() { + return errorCode; + } + + public void setErrorCode(@javax.annotation.Nullable Integer errorCode) { + this.errorCode = errorCode; + } + + + public ErrorResponse code(@javax.annotation.Nullable Integer code) { + this.code = code; + return this; + } + + /** + * HTTP status code associated with the error. + * @return code + */ + @javax.annotation.Nullable + public Integer getCode() { + return code; + } + + public void setCode(@javax.annotation.Nullable Integer code) { + this.code = code; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ErrorResponse instance itself + */ + public ErrorResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorResponse errorResponse = (ErrorResponse) o; + return Objects.equals(this.message, errorResponse.message) && + Objects.equals(this.description, errorResponse.description) && + Objects.equals(this.errorCode, errorResponse.errorCode) && + Objects.equals(this.code, errorResponse.code)&& + Objects.equals(this.additionalProperties, errorResponse.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(message, description, errorCode, code, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorResponse {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Message"); + openapiFields.add("Description"); + openapiFields.add("ErrorCode"); + openapiFields.add("Code"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ErrorResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ErrorResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ErrorResponse is not found in the empty JSON string", ErrorResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Message") != null && !jsonObj.get("Message").isJsonNull()) && !jsonObj.get("Message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Message").toString())); + } + if ((jsonObj.get("Description") != null && !jsonObj.get("Description").isJsonNull()) && !jsonObj.get("Description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Description").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ErrorResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ErrorResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ErrorResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ErrorResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<ErrorResponse>() { + @Override + public void write(JsonWriter out, ErrorResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ErrorResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ErrorResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ErrorResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ErrorResponse + * @throws IOException if the JSON string is invalid with respect to ErrorResponse + */ + public static ErrorResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ErrorResponse.class); + } + + /** + * Convert an instance of ErrorResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ErrorResponseNative.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ErrorResponseNative.java new file mode 100644 index 0000000..88cdd85 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ErrorResponseNative.java @@ -0,0 +1,344 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ErrorResponseNative + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ErrorResponseNative { + public static final String SERIALIZED_NAME_MESSAGE = "message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + @javax.annotation.Nullable + private String message; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_ERROR_CODE = "errorCode"; + @SerializedName(SERIALIZED_NAME_ERROR_CODE) + @javax.annotation.Nullable + private Integer errorCode; + + public ErrorResponseNative() { + } + + public ErrorResponseNative message(@javax.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Brief message describing the error. + * @return message + */ + @javax.annotation.Nullable + public String getMessage() { + return message; + } + + public void setMessage(@javax.annotation.Nullable String message) { + this.message = message; + } + + + public ErrorResponseNative description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Detailed description of the error. + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public ErrorResponseNative errorCode(@javax.annotation.Nullable Integer errorCode) { + this.errorCode = errorCode; + return this; + } + + /** + * Error code for identifying the error type. + * @return errorCode + */ + @javax.annotation.Nullable + public Integer getErrorCode() { + return errorCode; + } + + public void setErrorCode(@javax.annotation.Nullable Integer errorCode) { + this.errorCode = errorCode; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ErrorResponseNative instance itself + */ + public ErrorResponseNative putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ErrorResponseNative errorResponseNative = (ErrorResponseNative) o; + return Objects.equals(this.message, errorResponseNative.message) && + Objects.equals(this.description, errorResponseNative.description) && + Objects.equals(this.errorCode, errorResponseNative.errorCode)&& + Objects.equals(this.additionalProperties, errorResponseNative.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(message, description, errorCode, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ErrorResponseNative {\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" errorCode: ").append(toIndentedString(errorCode)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("message"); + openapiFields.add("description"); + openapiFields.add("errorCode"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ErrorResponseNative + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ErrorResponseNative.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ErrorResponseNative is not found in the empty JSON string", ErrorResponseNative.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("message") != null && !jsonObj.get("message").isJsonNull()) && !jsonObj.get("message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("message").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ErrorResponseNative.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ErrorResponseNative' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ErrorResponseNative> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ErrorResponseNative.class)); + + return (TypeAdapter<T>) new TypeAdapter<ErrorResponseNative>() { + @Override + public void write(JsonWriter out, ErrorResponseNative value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ErrorResponseNative read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ErrorResponseNative instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ErrorResponseNative given an JSON string + * + * @param jsonString JSON string + * @return An instance of ErrorResponseNative + * @throws IOException if the JSON string is invalid with respect to ErrorResponseNative + */ + public static ErrorResponseNative fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ErrorResponseNative.class); + } + + /** + * Convert an instance of ErrorResponseNative to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/EventBasedSecondFactorToken.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/EventBasedSecondFactorToken.java new file mode 100644 index 0000000..53ceaf0 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/EventBasedSecondFactorToken.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * EventBasedSecondFactorToken + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class EventBasedSecondFactorToken { + public static final String SERIALIZED_NAME_SECONDFACTORVALIDATIONTOKEN = "secondfactorvalidationtoken"; + @SerializedName(SERIALIZED_NAME_SECONDFACTORVALIDATIONTOKEN) + @javax.annotation.Nonnull + private String secondfactorvalidationtoken; + + public EventBasedSecondFactorToken() { + } + + public EventBasedSecondFactorToken secondfactorvalidationtoken(@javax.annotation.Nonnull String secondfactorvalidationtoken) { + this.secondfactorvalidationtoken = secondfactorvalidationtoken; + return this; + } + + /** + * The event-based second factor token. This token is used to verify the identity of the User during the authentication process. + * @return secondfactorvalidationtoken + */ + @javax.annotation.Nonnull + public String getSecondfactorvalidationtoken() { + return secondfactorvalidationtoken; + } + + public void setSecondfactorvalidationtoken(@javax.annotation.Nonnull String secondfactorvalidationtoken) { + this.secondfactorvalidationtoken = secondfactorvalidationtoken; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the EventBasedSecondFactorToken instance itself + */ + public EventBasedSecondFactorToken putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + EventBasedSecondFactorToken eventBasedSecondFactorToken = (EventBasedSecondFactorToken) o; + return Objects.equals(this.secondfactorvalidationtoken, eventBasedSecondFactorToken.secondfactorvalidationtoken)&& + Objects.equals(this.additionalProperties, eventBasedSecondFactorToken.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(secondfactorvalidationtoken, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class EventBasedSecondFactorToken {\n"); + sb.append(" secondfactorvalidationtoken: ").append(toIndentedString(secondfactorvalidationtoken)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("secondfactorvalidationtoken"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("secondfactorvalidationtoken"); + } + + /** + * 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 EventBasedSecondFactorToken + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!EventBasedSecondFactorToken.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in EventBasedSecondFactorToken is not found in the empty JSON string", EventBasedSecondFactorToken.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : EventBasedSecondFactorToken.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("secondfactorvalidationtoken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `secondfactorvalidationtoken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("secondfactorvalidationtoken").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!EventBasedSecondFactorToken.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'EventBasedSecondFactorToken' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<EventBasedSecondFactorToken> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(EventBasedSecondFactorToken.class)); + + return (TypeAdapter<T>) new TypeAdapter<EventBasedSecondFactorToken>() { + @Override + public void write(JsonWriter out, EventBasedSecondFactorToken value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public EventBasedSecondFactorToken read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + EventBasedSecondFactorToken instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of EventBasedSecondFactorToken given an JSON string + * + * @param jsonString JSON string + * @return An instance of EventBasedSecondFactorToken + * @throws IOException if the JSON string is invalid with respect to EventBasedSecondFactorToken + */ + public static EventBasedSecondFactorToken fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, EventBasedSecondFactorToken.class); + } + + /** + * Convert an instance of EventBasedSecondFactorToken to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ExtendUserProfileWithCustomObject.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ExtendUserProfileWithCustomObject.java new file mode 100644 index 0000000..9099b6b --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ExtendUserProfileWithCustomObject.java @@ -0,0 +1,4831 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.UserProfileAddresses; +import com.loginradius.sdk.internal.openapi.model.UserProfileAgeRange; +import com.loginradius.sdk.internal.openapi.model.UserProfileAwards; +import com.loginradius.sdk.internal.openapi.model.UserProfileBadges; +import com.loginradius.sdk.internal.openapi.model.UserProfileBooks; +import com.loginradius.sdk.internal.openapi.model.UserProfileCertifications; +import com.loginradius.sdk.internal.openapi.model.UserProfileCountry; +import com.loginradius.sdk.internal.openapi.model.UserProfileCourses; +import com.loginradius.sdk.internal.openapi.model.UserProfileCoverPhoto; +import com.loginradius.sdk.internal.openapi.model.UserProfileCurrentStatus; +import com.loginradius.sdk.internal.openapi.model.UserProfileCustomFields; +import com.loginradius.sdk.internal.openapi.model.UserProfileEducations; +import com.loginradius.sdk.internal.openapi.model.UserProfileEmail; +import com.loginradius.sdk.internal.openapi.model.UserProfileExternalIds; +import com.loginradius.sdk.internal.openapi.model.UserProfileFamily; +import com.loginradius.sdk.internal.openapi.model.UserProfileFavicon; +import com.loginradius.sdk.internal.openapi.model.UserProfileFavoriteThings; +import com.loginradius.sdk.internal.openapi.model.UserProfileGames; +import com.loginradius.sdk.internal.openapi.model.UserProfileGistsUrl; +import com.loginradius.sdk.internal.openapi.model.UserProfileGravatarImageUrl; +import com.loginradius.sdk.internal.openapi.model.UserProfileHttpsImageUrl; +import com.loginradius.sdk.internal.openapi.model.UserProfileIMAccounts; +import com.loginradius.sdk.internal.openapi.model.UserProfileImageUrl; +import com.loginradius.sdk.internal.openapi.model.UserProfileInspirationalPeople; +import com.loginradius.sdk.internal.openapi.model.UserProfileInterests; +import com.loginradius.sdk.internal.openapi.model.UserProfileJobBookmarks; +import com.loginradius.sdk.internal.openapi.model.UserProfileKloutScore; +import com.loginradius.sdk.internal.openapi.model.UserProfileKnownLoginVariables; +import com.loginradius.sdk.internal.openapi.model.UserProfileLanguages; +import com.loginradius.sdk.internal.openapi.model.UserProfileMemberUrlResources; +import com.loginradius.sdk.internal.openapi.model.UserProfileMovies; +import com.loginradius.sdk.internal.openapi.model.UserProfileMutualFriends; +import com.loginradius.sdk.internal.openapi.model.UserProfilePatents; +import com.loginradius.sdk.internal.openapi.model.UserProfilePhoneNumbers; +import com.loginradius.sdk.internal.openapi.model.UserProfilePlacesLived; +import com.loginradius.sdk.internal.openapi.model.UserProfilePositions; +import com.loginradius.sdk.internal.openapi.model.UserProfilePrivacyPolicy; +import com.loginradius.sdk.internal.openapi.model.UserProfileProfileImageUrls; +import com.loginradius.sdk.internal.openapi.model.UserProfileProfileUrl; +import com.loginradius.sdk.internal.openapi.model.UserProfileProjects; +import com.loginradius.sdk.internal.openapi.model.UserProfilePublicRepository; +import com.loginradius.sdk.internal.openapi.model.UserProfilePublications; +import com.loginradius.sdk.internal.openapi.model.UserProfileRecommendationsReceived; +import com.loginradius.sdk.internal.openapi.model.UserProfileRelatedProfileViews; +import com.loginradius.sdk.internal.openapi.model.UserProfileRepositoryUrl; +import com.loginradius.sdk.internal.openapi.model.UserProfileRoleContext; +import com.loginradius.sdk.internal.openapi.model.UserProfileSignupLog; +import com.loginradius.sdk.internal.openapi.model.UserProfileSkills; +import com.loginradius.sdk.internal.openapi.model.UserProfileSports; +import com.loginradius.sdk.internal.openapi.model.UserProfileStarredUrl; +import com.loginradius.sdk.internal.openapi.model.UserProfileSubscription; +import com.loginradius.sdk.internal.openapi.model.UserProfileSuggestions; +import com.loginradius.sdk.internal.openapi.model.UserProfileTeleVisionShow; +import com.loginradius.sdk.internal.openapi.model.UserProfileUnverifiedEmail; +import com.loginradius.sdk.internal.openapi.model.UserProfileUserAgent; +import com.loginradius.sdk.internal.openapi.model.UserProfileVolunteer; +import com.loginradius.sdk.internal.openapi.model.UserProfileWebProfiles; +import java.io.IOException; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ExtendUserProfileWithCustomObject + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ExtendUserProfileWithCustomObject { + public static final String SERIALIZED_NAME_APP_NAME = "AppName"; + @SerializedName(SERIALIZED_NAME_APP_NAME) + @javax.annotation.Nullable + private String appName; + + public static final String SERIALIZED_NAME_UID = "Uid"; + @SerializedName(SERIALIZED_NAME_UID) + @javax.annotation.Nullable + private String uid; + + public static final String SERIALIZED_NAME_I_D = "ID"; + @SerializedName(SERIALIZED_NAME_I_D) + @javax.annotation.Nullable + private String ID; + + public static final String SERIALIZED_NAME_PROVIDER = "Provider"; + @SerializedName(SERIALIZED_NAME_PROVIDER) + @javax.annotation.Nullable + private String provider; + + public static final String SERIALIZED_NAME_PREFIX = "Prefix"; + @SerializedName(SERIALIZED_NAME_PREFIX) + @javax.annotation.Nullable + private String prefix; + + public static final String SERIALIZED_NAME_FIRST_NAME = "FirstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nullable + private String firstName; + + public static final String SERIALIZED_NAME_MIDDLE_NAME = "MiddleName"; + @SerializedName(SERIALIZED_NAME_MIDDLE_NAME) + @javax.annotation.Nullable + private String middleName; + + public static final String SERIALIZED_NAME_LAST_NAME = "LastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nullable + private String lastName; + + public static final String SERIALIZED_NAME_SUFFIX = "Suffix"; + @SerializedName(SERIALIZED_NAME_SUFFIX) + @javax.annotation.Nullable + private String suffix; + + 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_NICK_NAME = "NickName"; + @SerializedName(SERIALIZED_NAME_NICK_NAME) + @javax.annotation.Nullable + private String nickName; + + public static final String SERIALIZED_NAME_PROFILE_NAME = "ProfileName"; + @SerializedName(SERIALIZED_NAME_PROFILE_NAME) + @javax.annotation.Nullable + private String profileName; + + public static final String SERIALIZED_NAME_BIRTH_DATE = "BirthDate"; + @SerializedName(SERIALIZED_NAME_BIRTH_DATE) + @javax.annotation.Nullable + private LocalDate birthDate; + + public static final String SERIALIZED_NAME_GENDER = "Gender"; + @SerializedName(SERIALIZED_NAME_GENDER) + @javax.annotation.Nullable + private String gender; + + public static final String SERIALIZED_NAME_WEBSITE = "Website"; + @SerializedName(SERIALIZED_NAME_WEBSITE) + @javax.annotation.Nullable + private String website; + + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private UserProfileEmail email; + + public static final String SERIALIZED_NAME_COUNTRY = "Country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + @javax.annotation.Nullable + private UserProfileCountry country; + + public static final String SERIALIZED_NAME_THUMBNAIL_IMAGE_URL = "ThumbnailImageUrl"; + @SerializedName(SERIALIZED_NAME_THUMBNAIL_IMAGE_URL) + @javax.annotation.Nullable + private String thumbnailImageUrl; + + public static final String SERIALIZED_NAME_IMAGE_URL = "ImageUrl"; + @SerializedName(SERIALIZED_NAME_IMAGE_URL) + @javax.annotation.Nullable + private UserProfileImageUrl imageUrl; + + public static final String SERIALIZED_NAME_FAVICON = "Favicon"; + @SerializedName(SERIALIZED_NAME_FAVICON) + @javax.annotation.Nullable + private UserProfileFavicon favicon; + + public static final String SERIALIZED_NAME_PROFILE_URL = "ProfileUrl"; + @SerializedName(SERIALIZED_NAME_PROFILE_URL) + @javax.annotation.Nullable + private UserProfileProfileUrl profileUrl; + + public static final String SERIALIZED_NAME_HOME_TOWN = "HomeTown"; + @SerializedName(SERIALIZED_NAME_HOME_TOWN) + @javax.annotation.Nullable + private String homeTown; + + public static final String SERIALIZED_NAME_STATE = "State"; + @SerializedName(SERIALIZED_NAME_STATE) + @javax.annotation.Nullable + private String state; + + public static final String SERIALIZED_NAME_CITY = "City"; + @SerializedName(SERIALIZED_NAME_CITY) + @javax.annotation.Nullable + private String city; + + public static final String SERIALIZED_NAME_INDUSTRY = "Industry"; + @SerializedName(SERIALIZED_NAME_INDUSTRY) + @javax.annotation.Nullable + private String industry; + + public static final String SERIALIZED_NAME_ABOUT = "About"; + @SerializedName(SERIALIZED_NAME_ABOUT) + @javax.annotation.Nullable + private String about; + + public static final String SERIALIZED_NAME_TIME_ZONE = "TimeZone"; + @SerializedName(SERIALIZED_NAME_TIME_ZONE) + @javax.annotation.Nullable + private String timeZone; + + public static final String SERIALIZED_NAME_LOCAL_LANGUAGE = "LocalLanguage"; + @SerializedName(SERIALIZED_NAME_LOCAL_LANGUAGE) + @javax.annotation.Nullable + private String localLanguage; + + public static final String SERIALIZED_NAME_COVER_PHOTO = "CoverPhoto"; + @SerializedName(SERIALIZED_NAME_COVER_PHOTO) + @javax.annotation.Nullable + private UserProfileCoverPhoto coverPhoto; + + public static final String SERIALIZED_NAME_TAG_LINE = "TagLine"; + @SerializedName(SERIALIZED_NAME_TAG_LINE) + @javax.annotation.Nullable + private String tagLine; + + public static final String SERIALIZED_NAME_LANGUAGE = "Language"; + @SerializedName(SERIALIZED_NAME_LANGUAGE) + @javax.annotation.Nullable + private String language; + + public static final String SERIALIZED_NAME_VERIFIED = "Verified"; + @SerializedName(SERIALIZED_NAME_VERIFIED) + @javax.annotation.Nullable + private String verified; + + public static final String SERIALIZED_NAME_UPDATED_TIME = "UpdatedTime"; + @SerializedName(SERIALIZED_NAME_UPDATED_TIME) + @javax.annotation.Nullable + private OffsetDateTime updatedTime; + + public static final String SERIALIZED_NAME_POSITIONS = "Positions"; + @SerializedName(SERIALIZED_NAME_POSITIONS) + @javax.annotation.Nullable + private UserProfilePositions positions; + + public static final String SERIALIZED_NAME_EDUCATIONS = "Educations"; + @SerializedName(SERIALIZED_NAME_EDUCATIONS) + @javax.annotation.Nullable + private UserProfileEducations educations; + + public static final String SERIALIZED_NAME_PHONE_NUMBERS = "PhoneNumbers"; + @SerializedName(SERIALIZED_NAME_PHONE_NUMBERS) + @javax.annotation.Nullable + private UserProfilePhoneNumbers phoneNumbers; + + public static final String SERIALIZED_NAME_IM_ACCOUNTS = "IMAccounts"; + @SerializedName(SERIALIZED_NAME_IM_ACCOUNTS) + @javax.annotation.Nullable + private UserProfileIMAccounts imAccounts; + + public static final String SERIALIZED_NAME_ADDRESSES = "Addresses"; + @SerializedName(SERIALIZED_NAME_ADDRESSES) + @javax.annotation.Nullable + private UserProfileAddresses addresses; + + public static final String SERIALIZED_NAME_MAIN_ADDRESS = "MainAddress"; + @SerializedName(SERIALIZED_NAME_MAIN_ADDRESS) + @javax.annotation.Nullable + private String mainAddress; + + public static final String SERIALIZED_NAME_CREATED = "Created"; + @SerializedName(SERIALIZED_NAME_CREATED) + @javax.annotation.Nullable + private OffsetDateTime created; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public static final String SERIALIZED_NAME_MODIFIED_DATE = "ModifiedDate"; + @SerializedName(SERIALIZED_NAME_MODIFIED_DATE) + @javax.annotation.Nullable + private OffsetDateTime modifiedDate; + + public static final String SERIALIZED_NAME_PROFILE_MODIFIED_DATE = "ProfileModifiedDate"; + @SerializedName(SERIALIZED_NAME_PROFILE_MODIFIED_DATE) + @javax.annotation.Nullable + private OffsetDateTime profileModifiedDate; + + public static final String SERIALIZED_NAME_LOCAL_CITY = "LocalCity"; + @SerializedName(SERIALIZED_NAME_LOCAL_CITY) + @javax.annotation.Nullable + private String localCity; + + public static final String SERIALIZED_NAME_PROFILE_CITY = "ProfileCity"; + @SerializedName(SERIALIZED_NAME_PROFILE_CITY) + @javax.annotation.Nullable + private String profileCity; + + public static final String SERIALIZED_NAME_LOCAL_COUNTRY = "LocalCountry"; + @SerializedName(SERIALIZED_NAME_LOCAL_COUNTRY) + @javax.annotation.Nullable + private String localCountry; + + public static final String SERIALIZED_NAME_PROFILE_COUNTRY = "ProfileCountry"; + @SerializedName(SERIALIZED_NAME_PROFILE_COUNTRY) + @javax.annotation.Nullable + private String profileCountry; + + public static final String SERIALIZED_NAME_FIRST_LOGIN = "FirstLogin"; + @SerializedName(SERIALIZED_NAME_FIRST_LOGIN) + @javax.annotation.Nullable + private Boolean firstLogin; + + public static final String SERIALIZED_NAME_IS_PROTECTED = "IsProtected"; + @SerializedName(SERIALIZED_NAME_IS_PROTECTED) + @javax.annotation.Nullable + private Boolean isProtected; + + public static final String SERIALIZED_NAME_RELATIONSHIP_STATUS = "RelationshipStatus"; + @SerializedName(SERIALIZED_NAME_RELATIONSHIP_STATUS) + @javax.annotation.Nullable + private String relationshipStatus; + + public static final String SERIALIZED_NAME_QUOTA = "Quota"; + @SerializedName(SERIALIZED_NAME_QUOTA) + @javax.annotation.Nullable + private String quota; + + public static final String SERIALIZED_NAME_INTERESTED_IN = "InterestedIn"; + @SerializedName(SERIALIZED_NAME_INTERESTED_IN) + @javax.annotation.Nullable + private List<String> interestedIn; + + public static final String SERIALIZED_NAME_INTERESTS = "Interests"; + @SerializedName(SERIALIZED_NAME_INTERESTS) + @javax.annotation.Nullable + private UserProfileInterests interests; + + public static final String SERIALIZED_NAME_RELIGION = "Religion"; + @SerializedName(SERIALIZED_NAME_RELIGION) + @javax.annotation.Nullable + private String religion; + + public static final String SERIALIZED_NAME_POLITICAL = "Political"; + @SerializedName(SERIALIZED_NAME_POLITICAL) + @javax.annotation.Nullable + private String political; + + public static final String SERIALIZED_NAME_SPORTS = "Sports"; + @SerializedName(SERIALIZED_NAME_SPORTS) + @javax.annotation.Nullable + private UserProfileSports sports; + + public static final String SERIALIZED_NAME_INSPIRATIONAL_PEOPLE = "InspirationalPeople"; + @SerializedName(SERIALIZED_NAME_INSPIRATIONAL_PEOPLE) + @javax.annotation.Nullable + private UserProfileInspirationalPeople inspirationalPeople; + + public static final String SERIALIZED_NAME_HTTPS_IMAGE_URL = "HttpsImageUrl"; + @SerializedName(SERIALIZED_NAME_HTTPS_IMAGE_URL) + @javax.annotation.Nullable + private UserProfileHttpsImageUrl httpsImageUrl; + + public static final String SERIALIZED_NAME_FOLLOWERS_COUNT = "FollowersCount"; + @SerializedName(SERIALIZED_NAME_FOLLOWERS_COUNT) + @javax.annotation.Nullable + private Integer followersCount; + + public static final String SERIALIZED_NAME_FRIENDS_COUNT = "FriendsCount"; + @SerializedName(SERIALIZED_NAME_FRIENDS_COUNT) + @javax.annotation.Nullable + private Integer friendsCount; + + public static final String SERIALIZED_NAME_IS_GEO_ENABLED = "IsGeoEnabled"; + @SerializedName(SERIALIZED_NAME_IS_GEO_ENABLED) + @javax.annotation.Nullable + private String isGeoEnabled; + + public static final String SERIALIZED_NAME_TOTAL_STATUSES_COUNT = "TotalStatusesCount"; + @SerializedName(SERIALIZED_NAME_TOTAL_STATUSES_COUNT) + @javax.annotation.Nullable + private Integer totalStatusesCount; + + public static final String SERIALIZED_NAME_ASSOCIATIONS = "Associations"; + @SerializedName(SERIALIZED_NAME_ASSOCIATIONS) + @javax.annotation.Nullable + private String associations; + + public static final String SERIALIZED_NAME_NUM_RECOMMENDERS = "NumRecommenders"; + @SerializedName(SERIALIZED_NAME_NUM_RECOMMENDERS) + @javax.annotation.Nullable + private Integer numRecommenders; + + public static final String SERIALIZED_NAME_HONORS = "Honors"; + @SerializedName(SERIALIZED_NAME_HONORS) + @javax.annotation.Nullable + private String honors; + + public static final String SERIALIZED_NAME_AWARDS = "Awards"; + @SerializedName(SERIALIZED_NAME_AWARDS) + @javax.annotation.Nullable + private UserProfileAwards awards; + + public static final String SERIALIZED_NAME_SKILLS = "Skills"; + @SerializedName(SERIALIZED_NAME_SKILLS) + @javax.annotation.Nullable + private UserProfileSkills skills; + + public static final String SERIALIZED_NAME_CURRENT_STATUS = "CurrentStatus"; + @SerializedName(SERIALIZED_NAME_CURRENT_STATUS) + @javax.annotation.Nullable + private UserProfileCurrentStatus currentStatus; + + public static final String SERIALIZED_NAME_CERTIFICATIONS = "Certifications"; + @SerializedName(SERIALIZED_NAME_CERTIFICATIONS) + @javax.annotation.Nullable + private UserProfileCertifications certifications; + + public static final String SERIALIZED_NAME_COURSES = "Courses"; + @SerializedName(SERIALIZED_NAME_COURSES) + @javax.annotation.Nullable + private UserProfileCourses courses; + + public static final String SERIALIZED_NAME_VOLUNTEER = "Volunteer"; + @SerializedName(SERIALIZED_NAME_VOLUNTEER) + @javax.annotation.Nullable + private UserProfileVolunteer volunteer; + + public static final String SERIALIZED_NAME_RECOMMENDATIONS_RECEIVED = "RecommendationsReceived"; + @SerializedName(SERIALIZED_NAME_RECOMMENDATIONS_RECEIVED) + @javax.annotation.Nullable + private UserProfileRecommendationsReceived recommendationsReceived; + + public static final String SERIALIZED_NAME_LANGUAGES = "Languages"; + @SerializedName(SERIALIZED_NAME_LANGUAGES) + @javax.annotation.Nullable + private UserProfileLanguages languages; + + public static final String SERIALIZED_NAME_PROJECTS = "Projects"; + @SerializedName(SERIALIZED_NAME_PROJECTS) + @javax.annotation.Nullable + private UserProfileProjects projects; + + public static final String SERIALIZED_NAME_GAMES = "Games"; + @SerializedName(SERIALIZED_NAME_GAMES) + @javax.annotation.Nullable + private UserProfileGames games; + + public static final String SERIALIZED_NAME_FAMILY = "Family"; + @SerializedName(SERIALIZED_NAME_FAMILY) + @javax.annotation.Nullable + private UserProfileFamily family; + + public static final String SERIALIZED_NAME_TELE_VISION_SHOW = "TeleVisionShow"; + @SerializedName(SERIALIZED_NAME_TELE_VISION_SHOW) + @javax.annotation.Nullable + private UserProfileTeleVisionShow teleVisionShow; + + public static final String SERIALIZED_NAME_MUTUAL_FRIENDS = "MutualFriends"; + @SerializedName(SERIALIZED_NAME_MUTUAL_FRIENDS) + @javax.annotation.Nullable + private UserProfileMutualFriends mutualFriends; + + public static final String SERIALIZED_NAME_MOVIES = "Movies"; + @SerializedName(SERIALIZED_NAME_MOVIES) + @javax.annotation.Nullable + private UserProfileMovies movies; + + public static final String SERIALIZED_NAME_BOOKS = "Books"; + @SerializedName(SERIALIZED_NAME_BOOKS) + @javax.annotation.Nullable + private UserProfileBooks books; + + public static final String SERIALIZED_NAME_AGE_RANGE = "AgeRange"; + @SerializedName(SERIALIZED_NAME_AGE_RANGE) + @javax.annotation.Nullable + private UserProfileAgeRange ageRange; + + public static final String SERIALIZED_NAME_PUBLIC_REPOSITORY = "PublicRepository"; + @SerializedName(SERIALIZED_NAME_PUBLIC_REPOSITORY) + @javax.annotation.Nullable + private UserProfilePublicRepository publicRepository; + + public static final String SERIALIZED_NAME_HIREABLE = "Hireable"; + @SerializedName(SERIALIZED_NAME_HIREABLE) + @javax.annotation.Nullable + private Boolean hireable; + + public static final String SERIALIZED_NAME_REPOSITORY_URL = "RepositoryUrl"; + @SerializedName(SERIALIZED_NAME_REPOSITORY_URL) + @javax.annotation.Nullable + private UserProfileRepositoryUrl repositoryUrl; + + public static final String SERIALIZED_NAME_AGE = "Age"; + @SerializedName(SERIALIZED_NAME_AGE) + @javax.annotation.Nullable + private Integer age; + + public static final String SERIALIZED_NAME_PATENTS = "Patents"; + @SerializedName(SERIALIZED_NAME_PATENTS) + @javax.annotation.Nullable + private UserProfilePatents patents; + + public static final String SERIALIZED_NAME_FAVORITE_THINGS = "FavoriteThings"; + @SerializedName(SERIALIZED_NAME_FAVORITE_THINGS) + @javax.annotation.Nullable + private UserProfileFavoriteThings favoriteThings; + + public static final String SERIALIZED_NAME_PROFESSIONAL_HEADLINE = "ProfessionalHeadline"; + @SerializedName(SERIALIZED_NAME_PROFESSIONAL_HEADLINE) + @javax.annotation.Nullable + private String professionalHeadline; + + public static final String SERIALIZED_NAME_RELATED_PROFILE_VIEWS = "RelatedProfileViews"; + @SerializedName(SERIALIZED_NAME_RELATED_PROFILE_VIEWS) + @javax.annotation.Nullable + private UserProfileRelatedProfileViews relatedProfileViews; + + public static final String SERIALIZED_NAME_KLOUT_SCORE = "KloutScore"; + @SerializedName(SERIALIZED_NAME_KLOUT_SCORE) + @javax.annotation.Nullable + private UserProfileKloutScore kloutScore; + + public static final String SERIALIZED_NAME_LR_USER_I_D = "LRUserID"; + @SerializedName(SERIALIZED_NAME_LR_USER_I_D) + @javax.annotation.Nullable + private String lrUserID; + + public static final String SERIALIZED_NAME_PLACES_LIVED = "PlacesLived"; + @SerializedName(SERIALIZED_NAME_PLACES_LIVED) + @javax.annotation.Nullable + private UserProfilePlacesLived placesLived; + + public static final String SERIALIZED_NAME_PUBLICATIONS = "Publications"; + @SerializedName(SERIALIZED_NAME_PUBLICATIONS) + @javax.annotation.Nullable + private UserProfilePublications publications; + + public static final String SERIALIZED_NAME_JOB_BOOKMARKS = "JobBookmarks"; + @SerializedName(SERIALIZED_NAME_JOB_BOOKMARKS) + @javax.annotation.Nullable + private UserProfileJobBookmarks jobBookmarks; + + public static final String SERIALIZED_NAME_SUGGESTIONS = "Suggestions"; + @SerializedName(SERIALIZED_NAME_SUGGESTIONS) + @javax.annotation.Nullable + private UserProfileSuggestions suggestions; + + public static final String SERIALIZED_NAME_BADGES = "Badges"; + @SerializedName(SERIALIZED_NAME_BADGES) + @javax.annotation.Nullable + private UserProfileBadges badges; + + public static final String SERIALIZED_NAME_MEMBER_URL_RESOURCES = "MemberUrlResources"; + @SerializedName(SERIALIZED_NAME_MEMBER_URL_RESOURCES) + @javax.annotation.Nullable + private UserProfileMemberUrlResources memberUrlResources; + + public static final String SERIALIZED_NAME_TOTAL_PRIVATE_REPOSITORY = "TotalPrivateRepository"; + @SerializedName(SERIALIZED_NAME_TOTAL_PRIVATE_REPOSITORY) + @javax.annotation.Nullable + private Integer totalPrivateRepository; + + public static final String SERIALIZED_NAME_CURRENCY = "Currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + @javax.annotation.Nullable + private String currency; + + public static final String SERIALIZED_NAME_STARRED_URL = "StarredUrl"; + @SerializedName(SERIALIZED_NAME_STARRED_URL) + @javax.annotation.Nullable + private UserProfileStarredUrl starredUrl; + + public static final String SERIALIZED_NAME_GISTS_URL = "GistsUrl"; + @SerializedName(SERIALIZED_NAME_GISTS_URL) + @javax.annotation.Nullable + private UserProfileGistsUrl gistsUrl; + + public static final String SERIALIZED_NAME_PUBLIC_GISTS = "PublicGists"; + @SerializedName(SERIALIZED_NAME_PUBLIC_GISTS) + @javax.annotation.Nullable + private Integer publicGists; + + public static final String SERIALIZED_NAME_PRIVATE_GISTS = "PrivateGists"; + @SerializedName(SERIALIZED_NAME_PRIVATE_GISTS) + @javax.annotation.Nullable + private Integer privateGists; + + public static final String SERIALIZED_NAME_SUBSCRIPTION = "Subscription"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION) + @javax.annotation.Nullable + private UserProfileSubscription subscription; + + public static final String SERIALIZED_NAME_COMPANY = "Company"; + @SerializedName(SERIALIZED_NAME_COMPANY) + @javax.annotation.Nullable + private String company; + + public static final String SERIALIZED_NAME_GRAVATAR_IMAGE_URL = "GravatarImageUrl"; + @SerializedName(SERIALIZED_NAME_GRAVATAR_IMAGE_URL) + @javax.annotation.Nullable + private UserProfileGravatarImageUrl gravatarImageUrl; + + public static final String SERIALIZED_NAME_PROFILE_IMAGE_URLS = "ProfileImageUrls"; + @SerializedName(SERIALIZED_NAME_PROFILE_IMAGE_URLS) + @javax.annotation.Nullable + private UserProfileProfileImageUrls profileImageUrls; + + public static final String SERIALIZED_NAME_WEB_PROFILES = "WebProfiles"; + @SerializedName(SERIALIZED_NAME_WEB_PROFILES) + @javax.annotation.Nullable + private UserProfileWebProfiles webProfiles; + + public static final String SERIALIZED_NAME_PINS_COUNT = "PinsCount"; + @SerializedName(SERIALIZED_NAME_PINS_COUNT) + @javax.annotation.Nullable + private Integer pinsCount; + + public static final String SERIALIZED_NAME_BOARDS_COUNT = "BoardsCount"; + @SerializedName(SERIALIZED_NAME_BOARDS_COUNT) + @javax.annotation.Nullable + private Integer boardsCount; + + public static final String SERIALIZED_NAME_LIKES_COUNT = "LikesCount"; + @SerializedName(SERIALIZED_NAME_LIKES_COUNT) + @javax.annotation.Nullable + private Integer likesCount; + + public static final String SERIALIZED_NAME_EMAIL_VERIFIED_FROM_SOCIAL = "EmailVerifiedFromSocial"; + @SerializedName(SERIALIZED_NAME_EMAIL_VERIFIED_FROM_SOCIAL) + @javax.annotation.Nullable + private Boolean emailVerifiedFromSocial; + + public static final String SERIALIZED_NAME_SIGNUP_DATE = "SignupDate"; + @SerializedName(SERIALIZED_NAME_SIGNUP_DATE) + @javax.annotation.Nullable + private OffsetDateTime signupDate; + + public static final String SERIALIZED_NAME_LAST_LOGIN_DATE = "LastLoginDate"; + @SerializedName(SERIALIZED_NAME_LAST_LOGIN_DATE) + @javax.annotation.Nullable + private OffsetDateTime lastLoginDate; + + public static final String SERIALIZED_NAME_CUSTOM_FIELDS = "CustomFields"; + @SerializedName(SERIALIZED_NAME_CUSTOM_FIELDS) + @javax.annotation.Nullable + private UserProfileCustomFields customFields; + + public static final String SERIALIZED_NAME_LAST_PASSWORD_CHANGE_DATE = "LastPasswordChangeDate"; + @SerializedName(SERIALIZED_NAME_LAST_PASSWORD_CHANGE_DATE) + @javax.annotation.Nullable + private OffsetDateTime lastPasswordChangeDate; + + public static final String SERIALIZED_NAME_PASSWORD_EXPIRATION_DATE = "PasswordExpirationDate"; + @SerializedName(SERIALIZED_NAME_PASSWORD_EXPIRATION_DATE) + @javax.annotation.Nullable + private OffsetDateTime passwordExpirationDate; + + public static final String SERIALIZED_NAME_LAST_PASSWORD_CHANGE_TOKEN = "LastPasswordChangeToken"; + @SerializedName(SERIALIZED_NAME_LAST_PASSWORD_CHANGE_TOKEN) + @javax.annotation.Nullable + private String lastPasswordChangeToken; + + public static final String SERIALIZED_NAME_EMAIL_VERIFIED = "EmailVerified"; + @SerializedName(SERIALIZED_NAME_EMAIL_VERIFIED) + @javax.annotation.Nullable + private Boolean emailVerified; + + public static final String SERIALIZED_NAME_IS_ACTIVE = "IsActive"; + @SerializedName(SERIALIZED_NAME_IS_ACTIVE) + @javax.annotation.Nullable + private Boolean isActive; + + public static final String SERIALIZED_NAME_IS_DELETED = "IsDeleted"; + @SerializedName(SERIALIZED_NAME_IS_DELETED) + @javax.annotation.Nullable + private Boolean isDeleted; + + public static final String SERIALIZED_NAME_IS_EMAIL_SUBSCRIBED = "IsEmailSubscribed"; + @SerializedName(SERIALIZED_NAME_IS_EMAIL_SUBSCRIBED) + @javax.annotation.Nullable + private Boolean isEmailSubscribed; + + public static final String SERIALIZED_NAME_USER_NAME = "UserName"; + @SerializedName(SERIALIZED_NAME_USER_NAME) + @javax.annotation.Nullable + private String userName; + + public static final String SERIALIZED_NAME_NO_OF_LOGINS = "NoOfLogins"; + @SerializedName(SERIALIZED_NAME_NO_OF_LOGINS) + @javax.annotation.Nullable + private Integer noOfLogins; + + public static final String SERIALIZED_NAME_PREVIOUS_UIDS = "PreviousUids"; + @SerializedName(SERIALIZED_NAME_PREVIOUS_UIDS) + @javax.annotation.Nullable + private List<String> previousUids; + + public static final String SERIALIZED_NAME_PHONE_ID = "PhoneId"; + @SerializedName(SERIALIZED_NAME_PHONE_ID) + @javax.annotation.Nullable + private String phoneId; + + public static final String SERIALIZED_NAME_PHONE_ID_VERIFIED = "PhoneIdVerified"; + @SerializedName(SERIALIZED_NAME_PHONE_ID_VERIFIED) + @javax.annotation.Nullable + private Boolean phoneIdVerified; + + public static final String SERIALIZED_NAME_ROLES = "Roles"; + @SerializedName(SERIALIZED_NAME_ROLES) + @javax.annotation.Nullable + private List<String> roles; + + public static final String SERIALIZED_NAME_EXTERNAL_USER_LOGIN_ID = "ExternalUserLoginId"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_USER_LOGIN_ID) + @javax.annotation.Nullable + private String externalUserLoginId; + + public static final String SERIALIZED_NAME_FAILED_LOGIN_ATTEMPT = "FailedLoginAttempt"; + @SerializedName(SERIALIZED_NAME_FAILED_LOGIN_ATTEMPT) + @javax.annotation.Nullable + private Integer failedLoginAttempt; + + public static final String SERIALIZED_NAME_SECURITY_QUESTION_FAILED_RESET_PASSWORD_ATTEMPTS = "SecurityQuestionFailedResetPasswordAttempts"; + @SerializedName(SERIALIZED_NAME_SECURITY_QUESTION_FAILED_RESET_PASSWORD_ATTEMPTS) + @javax.annotation.Nullable + private Integer securityQuestionFailedResetPasswordAttempts; + + public static final String SERIALIZED_NAME_SECURITY_QUESTION_FAILED_LOGIN_ATTEMPT = "SecurityQuestionFailedLoginAttempt"; + @SerializedName(SERIALIZED_NAME_SECURITY_QUESTION_FAILED_LOGIN_ATTEMPT) + @javax.annotation.Nullable + private Integer securityQuestionFailedLoginAttempt; + + public static final String SERIALIZED_NAME_DISABLE_LOGIN = "DisableLogin"; + @SerializedName(SERIALIZED_NAME_DISABLE_LOGIN) + @javax.annotation.Nullable + private Boolean disableLogin; + + public static final String SERIALIZED_NAME_REGISTRATION_PROVIDER = "RegistrationProvider"; + @SerializedName(SERIALIZED_NAME_REGISTRATION_PROVIDER) + @javax.annotation.Nullable + private String registrationProvider; + + public static final String SERIALIZED_NAME_IS_LOGIN_LOCKED = "IsLoginLocked"; + @SerializedName(SERIALIZED_NAME_IS_LOGIN_LOCKED) + @javax.annotation.Nullable + private Boolean isLoginLocked; + + public static final String SERIALIZED_NAME_LOGIN_LOCKED_TYPE = "LoginLockedType"; + @SerializedName(SERIALIZED_NAME_LOGIN_LOCKED_TYPE) + @javax.annotation.Nullable + private String loginLockedType; + + public static final String SERIALIZED_NAME_LAST_LOGIN_LOCATION = "LastLoginLocation"; + @SerializedName(SERIALIZED_NAME_LAST_LOGIN_LOCATION) + @javax.annotation.Nullable + private String lastLoginLocation; + + public static final String SERIALIZED_NAME_REGISTRATION_SOURCE = "RegistrationSource"; + @SerializedName(SERIALIZED_NAME_REGISTRATION_SOURCE) + @javax.annotation.Nullable + private String registrationSource; + + public static final String SERIALIZED_NAME_IS_CUSTOM_UID = "IsCustomUid"; + @SerializedName(SERIALIZED_NAME_IS_CUSTOM_UID) + @javax.annotation.Nullable + private Boolean isCustomUid; + + public static final String SERIALIZED_NAME_UNVERIFIED_EMAIL = "UnverifiedEmail"; + @SerializedName(SERIALIZED_NAME_UNVERIFIED_EMAIL) + @javax.annotation.Nullable + private UserProfileUnverifiedEmail unverifiedEmail; + + public static final String SERIALIZED_NAME_ROLE_CONTEXT = "RoleContext"; + @SerializedName(SERIALIZED_NAME_ROLE_CONTEXT) + @javax.annotation.Nullable + private UserProfileRoleContext roleContext; + + public static final String SERIALIZED_NAME_KNOWN_LOGIN_VARIABLES = "KnownLoginVariables"; + @SerializedName(SERIALIZED_NAME_KNOWN_LOGIN_VARIABLES) + @javax.annotation.Nullable + private UserProfileKnownLoginVariables knownLoginVariables; + + public static final String SERIALIZED_NAME_IS_SECURE_PASSWORD = "IsSecurePassword"; + @SerializedName(SERIALIZED_NAME_IS_SECURE_PASSWORD) + @javax.annotation.Nullable + private Boolean isSecurePassword; + + public static final String SERIALIZED_NAME_PRIVACY_POLICY = "PrivacyPolicy"; + @SerializedName(SERIALIZED_NAME_PRIVACY_POLICY) + @javax.annotation.Nullable + private UserProfilePrivacyPolicy privacyPolicy; + + public static final String SERIALIZED_NAME_LOGIN_LOCKED_TIMEOUT = "LoginLockedTimeout"; + @SerializedName(SERIALIZED_NAME_LOGIN_LOCKED_TIMEOUT) + @javax.annotation.Nullable + private String loginLockedTimeout; + + public static final String SERIALIZED_NAME_EXTERNAL_IDS = "ExternalIds"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_IDS) + @javax.annotation.Nullable + private UserProfileExternalIds externalIds; + + public static final String SERIALIZED_NAME_IS_REQUIRED_FIELDS_FILLED_ONCE = "IsRequiredFieldsFilledOnce"; + @SerializedName(SERIALIZED_NAME_IS_REQUIRED_FIELDS_FILLED_ONCE) + @javax.annotation.Nullable + private Boolean isRequiredFieldsFilledOnce; + + public static final String SERIALIZED_NAME_SIGNUP_LOG = "SignupLog"; + @SerializedName(SERIALIZED_NAME_SIGNUP_LOG) + @javax.annotation.Nullable + private UserProfileSignupLog signupLog; + + public static final String SERIALIZED_NAME_LAST_ACCEPTED_CONSENT_VERSION = "LastAcceptedConsentVersion"; + @SerializedName(SERIALIZED_NAME_LAST_ACCEPTED_CONSENT_VERSION) + @javax.annotation.Nullable + private Float lastAcceptedConsentVersion; + + public static final String SERIALIZED_NAME_USER_AGENT = "user_agent"; + @SerializedName(SERIALIZED_NAME_USER_AGENT) + @javax.annotation.Nullable + private UserProfileUserAgent userAgent; + + public static final String SERIALIZED_NAME_CUSTOM_OBJECT = "CustomObject"; + @SerializedName(SERIALIZED_NAME_CUSTOM_OBJECT) + @javax.annotation.Nullable + private Map<String, Object> customObject = new HashMap<>(); + + public ExtendUserProfileWithCustomObject() { + } + + public ExtendUserProfileWithCustomObject appName(@javax.annotation.Nullable String appName) { + this.appName = appName; + return this; + } + + /** + * Application name. + * @return appName + */ + @javax.annotation.Nullable + public String getAppName() { + return appName; + } + + public void setAppName(@javax.annotation.Nullable String appName) { + this.appName = appName; + } + + + public ExtendUserProfileWithCustomObject uid(@javax.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * Unique User identifier. + * @return uid + */ + @javax.annotation.Nullable + public String getUid() { + return uid; + } + + public void setUid(@javax.annotation.Nullable String uid) { + this.uid = uid; + } + + + public ExtendUserProfileWithCustomObject ID(@javax.annotation.Nullable String ID) { + this.ID = ID; + return this; + } + + /** + * Internal User ID. + * @return ID + */ + @javax.annotation.Nullable + public String getID() { + return ID; + } + + public void setID(@javax.annotation.Nullable String ID) { + this.ID = ID; + } + + + public ExtendUserProfileWithCustomObject provider(@javax.annotation.Nullable String provider) { + this.provider = provider; + return this; + } + + /** + * Authentication provider. + * @return provider + */ + @javax.annotation.Nullable + public String getProvider() { + return provider; + } + + public void setProvider(@javax.annotation.Nullable String provider) { + this.provider = provider; + } + + + public ExtendUserProfileWithCustomObject prefix(@javax.annotation.Nullable String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Name prefix. + * @return prefix + */ + @javax.annotation.Nullable + public String getPrefix() { + return prefix; + } + + public void setPrefix(@javax.annotation.Nullable String prefix) { + this.prefix = prefix; + } + + + public ExtendUserProfileWithCustomObject firstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * User's first name. + * @return firstName + */ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + } + + + public ExtendUserProfileWithCustomObject middleName(@javax.annotation.Nullable String middleName) { + this.middleName = middleName; + return this; + } + + /** + * User's middle name. + * @return middleName + */ + @javax.annotation.Nullable + public String getMiddleName() { + return middleName; + } + + public void setMiddleName(@javax.annotation.Nullable String middleName) { + this.middleName = middleName; + } + + + public ExtendUserProfileWithCustomObject lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * User's last name. + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + + public ExtendUserProfileWithCustomObject suffix(@javax.annotation.Nullable String suffix) { + this.suffix = suffix; + return this; + } + + /** + * Name suffix. + * @return suffix + */ + @javax.annotation.Nullable + public String getSuffix() { + return suffix; + } + + public void setSuffix(@javax.annotation.Nullable String suffix) { + this.suffix = suffix; + } + + + public ExtendUserProfileWithCustomObject fullName(@javax.annotation.Nullable String fullName) { + this.fullName = fullName; + return this; + } + + /** + * Full name. + * @return fullName + */ + @javax.annotation.Nullable + public String getFullName() { + return fullName; + } + + public void setFullName(@javax.annotation.Nullable String fullName) { + this.fullName = fullName; + } + + + public ExtendUserProfileWithCustomObject nickName(@javax.annotation.Nullable String nickName) { + this.nickName = nickName; + return this; + } + + /** + * Nickname. + * @return nickName + */ + @javax.annotation.Nullable + public String getNickName() { + return nickName; + } + + public void setNickName(@javax.annotation.Nullable String nickName) { + this.nickName = nickName; + } + + + public ExtendUserProfileWithCustomObject profileName(@javax.annotation.Nullable String profileName) { + this.profileName = profileName; + return this; + } + + /** + * Profile name. + * @return profileName + */ + @javax.annotation.Nullable + public String getProfileName() { + return profileName; + } + + public void setProfileName(@javax.annotation.Nullable String profileName) { + this.profileName = profileName; + } + + + public ExtendUserProfileWithCustomObject birthDate(@javax.annotation.Nullable LocalDate birthDate) { + this.birthDate = birthDate; + return this; + } + + /** + * Birth date. + * @return birthDate + */ + @javax.annotation.Nullable + public LocalDate getBirthDate() { + return birthDate; + } + + public void setBirthDate(@javax.annotation.Nullable LocalDate birthDate) { + this.birthDate = birthDate; + } + + + public ExtendUserProfileWithCustomObject gender(@javax.annotation.Nullable String gender) { + this.gender = gender; + return this; + } + + /** + * Gender. + * @return gender + */ + @javax.annotation.Nullable + public String getGender() { + return gender; + } + + public void setGender(@javax.annotation.Nullable String gender) { + this.gender = gender; + } + + + public ExtendUserProfileWithCustomObject website(@javax.annotation.Nullable String website) { + this.website = website; + return this; + } + + /** + * Personal website URL. + * @return website + */ + @javax.annotation.Nullable + public String getWebsite() { + return website; + } + + public void setWebsite(@javax.annotation.Nullable String website) { + this.website = website; + } + + + public ExtendUserProfileWithCustomObject email(@javax.annotation.Nullable UserProfileEmail email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + */ + @javax.annotation.Nullable + public UserProfileEmail getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable UserProfileEmail email) { + this.email = email; + } + + + public ExtendUserProfileWithCustomObject country(@javax.annotation.Nullable UserProfileCountry country) { + this.country = country; + return this; + } + + /** + * Get country + * @return country + */ + @javax.annotation.Nullable + public UserProfileCountry getCountry() { + return country; + } + + public void setCountry(@javax.annotation.Nullable UserProfileCountry country) { + this.country = country; + } + + + public ExtendUserProfileWithCustomObject thumbnailImageUrl(@javax.annotation.Nullable String thumbnailImageUrl) { + this.thumbnailImageUrl = thumbnailImageUrl; + return this; + } + + /** + * Thumbnail image URL. + * @return thumbnailImageUrl + */ + @javax.annotation.Nullable + public String getThumbnailImageUrl() { + return thumbnailImageUrl; + } + + public void setThumbnailImageUrl(@javax.annotation.Nullable String thumbnailImageUrl) { + this.thumbnailImageUrl = thumbnailImageUrl; + } + + + public ExtendUserProfileWithCustomObject imageUrl(@javax.annotation.Nullable UserProfileImageUrl imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** + * Get imageUrl + * @return imageUrl + */ + @javax.annotation.Nullable + public UserProfileImageUrl getImageUrl() { + return imageUrl; + } + + public void setImageUrl(@javax.annotation.Nullable UserProfileImageUrl imageUrl) { + this.imageUrl = imageUrl; + } + + + public ExtendUserProfileWithCustomObject favicon(@javax.annotation.Nullable UserProfileFavicon favicon) { + this.favicon = favicon; + return this; + } + + /** + * Get favicon + * @return favicon + */ + @javax.annotation.Nullable + public UserProfileFavicon getFavicon() { + return favicon; + } + + public void setFavicon(@javax.annotation.Nullable UserProfileFavicon favicon) { + this.favicon = favicon; + } + + + public ExtendUserProfileWithCustomObject profileUrl(@javax.annotation.Nullable UserProfileProfileUrl profileUrl) { + this.profileUrl = profileUrl; + return this; + } + + /** + * Get profileUrl + * @return profileUrl + */ + @javax.annotation.Nullable + public UserProfileProfileUrl getProfileUrl() { + return profileUrl; + } + + public void setProfileUrl(@javax.annotation.Nullable UserProfileProfileUrl profileUrl) { + this.profileUrl = profileUrl; + } + + + public ExtendUserProfileWithCustomObject homeTown(@javax.annotation.Nullable String homeTown) { + this.homeTown = homeTown; + return this; + } + + /** + * Hometown. + * @return homeTown + */ + @javax.annotation.Nullable + public String getHomeTown() { + return homeTown; + } + + public void setHomeTown(@javax.annotation.Nullable String homeTown) { + this.homeTown = homeTown; + } + + + public ExtendUserProfileWithCustomObject state(@javax.annotation.Nullable String state) { + this.state = state; + return this; + } + + /** + * State. + * @return state + */ + @javax.annotation.Nullable + public String getState() { + return state; + } + + public void setState(@javax.annotation.Nullable String state) { + this.state = state; + } + + + public ExtendUserProfileWithCustomObject city(@javax.annotation.Nullable String city) { + this.city = city; + return this; + } + + /** + * City. + * @return city + */ + @javax.annotation.Nullable + public String getCity() { + return city; + } + + public void setCity(@javax.annotation.Nullable String city) { + this.city = city; + } + + + public ExtendUserProfileWithCustomObject industry(@javax.annotation.Nullable String industry) { + this.industry = industry; + return this; + } + + /** + * Industry. + * @return industry + */ + @javax.annotation.Nullable + public String getIndustry() { + return industry; + } + + public void setIndustry(@javax.annotation.Nullable String industry) { + this.industry = industry; + } + + + public ExtendUserProfileWithCustomObject about(@javax.annotation.Nullable String about) { + this.about = about; + return this; + } + + /** + * About the User. + * @return about + */ + @javax.annotation.Nullable + public String getAbout() { + return about; + } + + public void setAbout(@javax.annotation.Nullable String about) { + this.about = about; + } + + + public ExtendUserProfileWithCustomObject timeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * Time zone. + * @return timeZone + */ + @javax.annotation.Nullable + public String getTimeZone() { + return timeZone; + } + + public void setTimeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + } + + + public ExtendUserProfileWithCustomObject localLanguage(@javax.annotation.Nullable String localLanguage) { + this.localLanguage = localLanguage; + return this; + } + + /** + * Local language. + * @return localLanguage + */ + @javax.annotation.Nullable + public String getLocalLanguage() { + return localLanguage; + } + + public void setLocalLanguage(@javax.annotation.Nullable String localLanguage) { + this.localLanguage = localLanguage; + } + + + public ExtendUserProfileWithCustomObject coverPhoto(@javax.annotation.Nullable UserProfileCoverPhoto coverPhoto) { + this.coverPhoto = coverPhoto; + return this; + } + + /** + * Get coverPhoto + * @return coverPhoto + */ + @javax.annotation.Nullable + public UserProfileCoverPhoto getCoverPhoto() { + return coverPhoto; + } + + public void setCoverPhoto(@javax.annotation.Nullable UserProfileCoverPhoto coverPhoto) { + this.coverPhoto = coverPhoto; + } + + + public ExtendUserProfileWithCustomObject tagLine(@javax.annotation.Nullable String tagLine) { + this.tagLine = tagLine; + return this; + } + + /** + * Tag line. + * @return tagLine + */ + @javax.annotation.Nullable + public String getTagLine() { + return tagLine; + } + + public void setTagLine(@javax.annotation.Nullable String tagLine) { + this.tagLine = tagLine; + } + + + public ExtendUserProfileWithCustomObject language(@javax.annotation.Nullable String language) { + this.language = language; + return this; + } + + /** + * Preferred language. + * @return language + */ + @javax.annotation.Nullable + public String getLanguage() { + return language; + } + + public void setLanguage(@javax.annotation.Nullable String language) { + this.language = language; + } + + + public ExtendUserProfileWithCustomObject verified(@javax.annotation.Nullable String verified) { + this.verified = verified; + return this; + } + + /** + * Verification status. + * @return verified + */ + @javax.annotation.Nullable + public String getVerified() { + return verified; + } + + public void setVerified(@javax.annotation.Nullable String verified) { + this.verified = verified; + } + + + public ExtendUserProfileWithCustomObject updatedTime(@javax.annotation.Nullable OffsetDateTime updatedTime) { + this.updatedTime = updatedTime; + return this; + } + + /** + * Last updated time. + * @return updatedTime + */ + @javax.annotation.Nullable + public OffsetDateTime getUpdatedTime() { + return updatedTime; + } + + public void setUpdatedTime(@javax.annotation.Nullable OffsetDateTime updatedTime) { + this.updatedTime = updatedTime; + } + + + public ExtendUserProfileWithCustomObject positions(@javax.annotation.Nullable UserProfilePositions positions) { + this.positions = positions; + return this; + } + + /** + * Get positions + * @return positions + */ + @javax.annotation.Nullable + public UserProfilePositions getPositions() { + return positions; + } + + public void setPositions(@javax.annotation.Nullable UserProfilePositions positions) { + this.positions = positions; + } + + + public ExtendUserProfileWithCustomObject educations(@javax.annotation.Nullable UserProfileEducations educations) { + this.educations = educations; + return this; + } + + /** + * Get educations + * @return educations + */ + @javax.annotation.Nullable + public UserProfileEducations getEducations() { + return educations; + } + + public void setEducations(@javax.annotation.Nullable UserProfileEducations educations) { + this.educations = educations; + } + + + public ExtendUserProfileWithCustomObject phoneNumbers(@javax.annotation.Nullable UserProfilePhoneNumbers phoneNumbers) { + this.phoneNumbers = phoneNumbers; + return this; + } + + /** + * Get phoneNumbers + * @return phoneNumbers + */ + @javax.annotation.Nullable + public UserProfilePhoneNumbers getPhoneNumbers() { + return phoneNumbers; + } + + public void setPhoneNumbers(@javax.annotation.Nullable UserProfilePhoneNumbers phoneNumbers) { + this.phoneNumbers = phoneNumbers; + } + + + public ExtendUserProfileWithCustomObject imAccounts(@javax.annotation.Nullable UserProfileIMAccounts imAccounts) { + this.imAccounts = imAccounts; + return this; + } + + /** + * Get imAccounts + * @return imAccounts + */ + @javax.annotation.Nullable + public UserProfileIMAccounts getImAccounts() { + return imAccounts; + } + + public void setImAccounts(@javax.annotation.Nullable UserProfileIMAccounts imAccounts) { + this.imAccounts = imAccounts; + } + + + public ExtendUserProfileWithCustomObject addresses(@javax.annotation.Nullable UserProfileAddresses addresses) { + this.addresses = addresses; + return this; + } + + /** + * Get addresses + * @return addresses + */ + @javax.annotation.Nullable + public UserProfileAddresses getAddresses() { + return addresses; + } + + public void setAddresses(@javax.annotation.Nullable UserProfileAddresses addresses) { + this.addresses = addresses; + } + + + public ExtendUserProfileWithCustomObject mainAddress(@javax.annotation.Nullable String mainAddress) { + this.mainAddress = mainAddress; + return this; + } + + /** + * Main address. + * @return mainAddress + */ + @javax.annotation.Nullable + public String getMainAddress() { + return mainAddress; + } + + public void setMainAddress(@javax.annotation.Nullable String mainAddress) { + this.mainAddress = mainAddress; + } + + + public ExtendUserProfileWithCustomObject created(@javax.annotation.Nullable OffsetDateTime created) { + this.created = created; + return this; + } + + /** + * Created timestamp. + * @return created + */ + @javax.annotation.Nullable + public OffsetDateTime getCreated() { + return created; + } + + public void setCreated(@javax.annotation.Nullable OffsetDateTime created) { + this.created = created; + } + + + public ExtendUserProfileWithCustomObject createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Created date. + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + + public ExtendUserProfileWithCustomObject modifiedDate(@javax.annotation.Nullable OffsetDateTime modifiedDate) { + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Modified date. + * @return modifiedDate + */ + @javax.annotation.Nullable + public OffsetDateTime getModifiedDate() { + return modifiedDate; + } + + public void setModifiedDate(@javax.annotation.Nullable OffsetDateTime modifiedDate) { + this.modifiedDate = modifiedDate; + } + + + public ExtendUserProfileWithCustomObject profileModifiedDate(@javax.annotation.Nullable OffsetDateTime profileModifiedDate) { + this.profileModifiedDate = profileModifiedDate; + return this; + } + + /** + * Profile modified date. + * @return profileModifiedDate + */ + @javax.annotation.Nullable + public OffsetDateTime getProfileModifiedDate() { + return profileModifiedDate; + } + + public void setProfileModifiedDate(@javax.annotation.Nullable OffsetDateTime profileModifiedDate) { + this.profileModifiedDate = profileModifiedDate; + } + + + public ExtendUserProfileWithCustomObject localCity(@javax.annotation.Nullable String localCity) { + this.localCity = localCity; + return this; + } + + /** + * Local city. + * @return localCity + */ + @javax.annotation.Nullable + public String getLocalCity() { + return localCity; + } + + public void setLocalCity(@javax.annotation.Nullable String localCity) { + this.localCity = localCity; + } + + + public ExtendUserProfileWithCustomObject profileCity(@javax.annotation.Nullable String profileCity) { + this.profileCity = profileCity; + return this; + } + + /** + * Profile city. + * @return profileCity + */ + @javax.annotation.Nullable + public String getProfileCity() { + return profileCity; + } + + public void setProfileCity(@javax.annotation.Nullable String profileCity) { + this.profileCity = profileCity; + } + + + public ExtendUserProfileWithCustomObject localCountry(@javax.annotation.Nullable String localCountry) { + this.localCountry = localCountry; + return this; + } + + /** + * Local country. + * @return localCountry + */ + @javax.annotation.Nullable + public String getLocalCountry() { + return localCountry; + } + + public void setLocalCountry(@javax.annotation.Nullable String localCountry) { + this.localCountry = localCountry; + } + + + public ExtendUserProfileWithCustomObject profileCountry(@javax.annotation.Nullable String profileCountry) { + this.profileCountry = profileCountry; + return this; + } + + /** + * Profile country. + * @return profileCountry + */ + @javax.annotation.Nullable + public String getProfileCountry() { + return profileCountry; + } + + public void setProfileCountry(@javax.annotation.Nullable String profileCountry) { + this.profileCountry = profileCountry; + } + + + public ExtendUserProfileWithCustomObject firstLogin(@javax.annotation.Nullable Boolean firstLogin) { + this.firstLogin = firstLogin; + return this; + } + + /** + * Whether this is the User's first login. + * @return firstLogin + */ + @javax.annotation.Nullable + public Boolean getFirstLogin() { + return firstLogin; + } + + public void setFirstLogin(@javax.annotation.Nullable Boolean firstLogin) { + this.firstLogin = firstLogin; + } + + + public ExtendUserProfileWithCustomObject isProtected(@javax.annotation.Nullable Boolean isProtected) { + this.isProtected = isProtected; + return this; + } + + /** + * Whether the profile is protected. + * @return isProtected + */ + @javax.annotation.Nullable + public Boolean getIsProtected() { + return isProtected; + } + + public void setIsProtected(@javax.annotation.Nullable Boolean isProtected) { + this.isProtected = isProtected; + } + + + public ExtendUserProfileWithCustomObject relationshipStatus(@javax.annotation.Nullable String relationshipStatus) { + this.relationshipStatus = relationshipStatus; + return this; + } + + /** + * Relationship status. + * @return relationshipStatus + */ + @javax.annotation.Nullable + public String getRelationshipStatus() { + return relationshipStatus; + } + + public void setRelationshipStatus(@javax.annotation.Nullable String relationshipStatus) { + this.relationshipStatus = relationshipStatus; + } + + + public ExtendUserProfileWithCustomObject quota(@javax.annotation.Nullable String quota) { + this.quota = quota; + return this; + } + + /** + * Quota. + * @return quota + */ + @javax.annotation.Nullable + public String getQuota() { + return quota; + } + + public void setQuota(@javax.annotation.Nullable String quota) { + this.quota = quota; + } + + + public ExtendUserProfileWithCustomObject interestedIn(@javax.annotation.Nullable List<String> interestedIn) { + this.interestedIn = interestedIn; + return this; + } + + public ExtendUserProfileWithCustomObject addInterestedInItem(String interestedInItem) { + if (this.interestedIn == null) { + this.interestedIn = new ArrayList<>(); + } + this.interestedIn.add(interestedInItem); + return this; + } + + /** + * List of interests. + * @return interestedIn + */ + @javax.annotation.Nullable + public List<String> getInterestedIn() { + return interestedIn; + } + + public void setInterestedIn(@javax.annotation.Nullable List<String> interestedIn) { + this.interestedIn = interestedIn; + } + + + public ExtendUserProfileWithCustomObject interests(@javax.annotation.Nullable UserProfileInterests interests) { + this.interests = interests; + return this; + } + + /** + * Get interests + * @return interests + */ + @javax.annotation.Nullable + public UserProfileInterests getInterests() { + return interests; + } + + public void setInterests(@javax.annotation.Nullable UserProfileInterests interests) { + this.interests = interests; + } + + + public ExtendUserProfileWithCustomObject religion(@javax.annotation.Nullable String religion) { + this.religion = religion; + return this; + } + + /** + * Religion. + * @return religion + */ + @javax.annotation.Nullable + public String getReligion() { + return religion; + } + + public void setReligion(@javax.annotation.Nullable String religion) { + this.religion = religion; + } + + + public ExtendUserProfileWithCustomObject political(@javax.annotation.Nullable String political) { + this.political = political; + return this; + } + + /** + * Political views. + * @return political + */ + @javax.annotation.Nullable + public String getPolitical() { + return political; + } + + public void setPolitical(@javax.annotation.Nullable String political) { + this.political = political; + } + + + public ExtendUserProfileWithCustomObject sports(@javax.annotation.Nullable UserProfileSports sports) { + this.sports = sports; + return this; + } + + /** + * Get sports + * @return sports + */ + @javax.annotation.Nullable + public UserProfileSports getSports() { + return sports; + } + + public void setSports(@javax.annotation.Nullable UserProfileSports sports) { + this.sports = sports; + } + + + public ExtendUserProfileWithCustomObject inspirationalPeople(@javax.annotation.Nullable UserProfileInspirationalPeople inspirationalPeople) { + this.inspirationalPeople = inspirationalPeople; + return this; + } + + /** + * Get inspirationalPeople + * @return inspirationalPeople + */ + @javax.annotation.Nullable + public UserProfileInspirationalPeople getInspirationalPeople() { + return inspirationalPeople; + } + + public void setInspirationalPeople(@javax.annotation.Nullable UserProfileInspirationalPeople inspirationalPeople) { + this.inspirationalPeople = inspirationalPeople; + } + + + public ExtendUserProfileWithCustomObject httpsImageUrl(@javax.annotation.Nullable UserProfileHttpsImageUrl httpsImageUrl) { + this.httpsImageUrl = httpsImageUrl; + return this; + } + + /** + * Get httpsImageUrl + * @return httpsImageUrl + */ + @javax.annotation.Nullable + public UserProfileHttpsImageUrl getHttpsImageUrl() { + return httpsImageUrl; + } + + public void setHttpsImageUrl(@javax.annotation.Nullable UserProfileHttpsImageUrl httpsImageUrl) { + this.httpsImageUrl = httpsImageUrl; + } + + + public ExtendUserProfileWithCustomObject followersCount(@javax.annotation.Nullable Integer followersCount) { + this.followersCount = followersCount; + return this; + } + + /** + * Number of followers. + * @return followersCount + */ + @javax.annotation.Nullable + public Integer getFollowersCount() { + return followersCount; + } + + public void setFollowersCount(@javax.annotation.Nullable Integer followersCount) { + this.followersCount = followersCount; + } + + + public ExtendUserProfileWithCustomObject friendsCount(@javax.annotation.Nullable Integer friendsCount) { + this.friendsCount = friendsCount; + return this; + } + + /** + * Number of friends. + * @return friendsCount + */ + @javax.annotation.Nullable + public Integer getFriendsCount() { + return friendsCount; + } + + public void setFriendsCount(@javax.annotation.Nullable Integer friendsCount) { + this.friendsCount = friendsCount; + } + + + public ExtendUserProfileWithCustomObject isGeoEnabled(@javax.annotation.Nullable String isGeoEnabled) { + this.isGeoEnabled = isGeoEnabled; + return this; + } + + /** + * Whether geo is enabled. + * @return isGeoEnabled + */ + @javax.annotation.Nullable + public String getIsGeoEnabled() { + return isGeoEnabled; + } + + public void setIsGeoEnabled(@javax.annotation.Nullable String isGeoEnabled) { + this.isGeoEnabled = isGeoEnabled; + } + + + public ExtendUserProfileWithCustomObject totalStatusesCount(@javax.annotation.Nullable Integer totalStatusesCount) { + this.totalStatusesCount = totalStatusesCount; + return this; + } + + /** + * Total number of statuses. + * @return totalStatusesCount + */ + @javax.annotation.Nullable + public Integer getTotalStatusesCount() { + return totalStatusesCount; + } + + public void setTotalStatusesCount(@javax.annotation.Nullable Integer totalStatusesCount) { + this.totalStatusesCount = totalStatusesCount; + } + + + public ExtendUserProfileWithCustomObject associations(@javax.annotation.Nullable String associations) { + this.associations = associations; + return this; + } + + /** + * Associations. + * @return associations + */ + @javax.annotation.Nullable + public String getAssociations() { + return associations; + } + + public void setAssociations(@javax.annotation.Nullable String associations) { + this.associations = associations; + } + + + public ExtendUserProfileWithCustomObject numRecommenders(@javax.annotation.Nullable Integer numRecommenders) { + this.numRecommenders = numRecommenders; + return this; + } + + /** + * Number of recommenders. + * @return numRecommenders + */ + @javax.annotation.Nullable + public Integer getNumRecommenders() { + return numRecommenders; + } + + public void setNumRecommenders(@javax.annotation.Nullable Integer numRecommenders) { + this.numRecommenders = numRecommenders; + } + + + public ExtendUserProfileWithCustomObject honors(@javax.annotation.Nullable String honors) { + this.honors = honors; + return this; + } + + /** + * Honors. + * @return honors + */ + @javax.annotation.Nullable + public String getHonors() { + return honors; + } + + public void setHonors(@javax.annotation.Nullable String honors) { + this.honors = honors; + } + + + public ExtendUserProfileWithCustomObject awards(@javax.annotation.Nullable UserProfileAwards awards) { + this.awards = awards; + return this; + } + + /** + * Get awards + * @return awards + */ + @javax.annotation.Nullable + public UserProfileAwards getAwards() { + return awards; + } + + public void setAwards(@javax.annotation.Nullable UserProfileAwards awards) { + this.awards = awards; + } + + + public ExtendUserProfileWithCustomObject skills(@javax.annotation.Nullable UserProfileSkills skills) { + this.skills = skills; + return this; + } + + /** + * Get skills + * @return skills + */ + @javax.annotation.Nullable + public UserProfileSkills getSkills() { + return skills; + } + + public void setSkills(@javax.annotation.Nullable UserProfileSkills skills) { + this.skills = skills; + } + + + public ExtendUserProfileWithCustomObject currentStatus(@javax.annotation.Nullable UserProfileCurrentStatus currentStatus) { + this.currentStatus = currentStatus; + return this; + } + + /** + * Get currentStatus + * @return currentStatus + */ + @javax.annotation.Nullable + public UserProfileCurrentStatus getCurrentStatus() { + return currentStatus; + } + + public void setCurrentStatus(@javax.annotation.Nullable UserProfileCurrentStatus currentStatus) { + this.currentStatus = currentStatus; + } + + + public ExtendUserProfileWithCustomObject certifications(@javax.annotation.Nullable UserProfileCertifications certifications) { + this.certifications = certifications; + return this; + } + + /** + * Get certifications + * @return certifications + */ + @javax.annotation.Nullable + public UserProfileCertifications getCertifications() { + return certifications; + } + + public void setCertifications(@javax.annotation.Nullable UserProfileCertifications certifications) { + this.certifications = certifications; + } + + + public ExtendUserProfileWithCustomObject courses(@javax.annotation.Nullable UserProfileCourses courses) { + this.courses = courses; + return this; + } + + /** + * Get courses + * @return courses + */ + @javax.annotation.Nullable + public UserProfileCourses getCourses() { + return courses; + } + + public void setCourses(@javax.annotation.Nullable UserProfileCourses courses) { + this.courses = courses; + } + + + public ExtendUserProfileWithCustomObject volunteer(@javax.annotation.Nullable UserProfileVolunteer volunteer) { + this.volunteer = volunteer; + return this; + } + + /** + * Get volunteer + * @return volunteer + */ + @javax.annotation.Nullable + public UserProfileVolunteer getVolunteer() { + return volunteer; + } + + public void setVolunteer(@javax.annotation.Nullable UserProfileVolunteer volunteer) { + this.volunteer = volunteer; + } + + + public ExtendUserProfileWithCustomObject recommendationsReceived(@javax.annotation.Nullable UserProfileRecommendationsReceived recommendationsReceived) { + this.recommendationsReceived = recommendationsReceived; + return this; + } + + /** + * Get recommendationsReceived + * @return recommendationsReceived + */ + @javax.annotation.Nullable + public UserProfileRecommendationsReceived getRecommendationsReceived() { + return recommendationsReceived; + } + + public void setRecommendationsReceived(@javax.annotation.Nullable UserProfileRecommendationsReceived recommendationsReceived) { + this.recommendationsReceived = recommendationsReceived; + } + + + public ExtendUserProfileWithCustomObject languages(@javax.annotation.Nullable UserProfileLanguages languages) { + this.languages = languages; + return this; + } + + /** + * Get languages + * @return languages + */ + @javax.annotation.Nullable + public UserProfileLanguages getLanguages() { + return languages; + } + + public void setLanguages(@javax.annotation.Nullable UserProfileLanguages languages) { + this.languages = languages; + } + + + public ExtendUserProfileWithCustomObject projects(@javax.annotation.Nullable UserProfileProjects projects) { + this.projects = projects; + return this; + } + + /** + * Get projects + * @return projects + */ + @javax.annotation.Nullable + public UserProfileProjects getProjects() { + return projects; + } + + public void setProjects(@javax.annotation.Nullable UserProfileProjects projects) { + this.projects = projects; + } + + + public ExtendUserProfileWithCustomObject games(@javax.annotation.Nullable UserProfileGames games) { + this.games = games; + return this; + } + + /** + * Get games + * @return games + */ + @javax.annotation.Nullable + public UserProfileGames getGames() { + return games; + } + + public void setGames(@javax.annotation.Nullable UserProfileGames games) { + this.games = games; + } + + + public ExtendUserProfileWithCustomObject family(@javax.annotation.Nullable UserProfileFamily family) { + this.family = family; + return this; + } + + /** + * Get family + * @return family + */ + @javax.annotation.Nullable + public UserProfileFamily getFamily() { + return family; + } + + public void setFamily(@javax.annotation.Nullable UserProfileFamily family) { + this.family = family; + } + + + public ExtendUserProfileWithCustomObject teleVisionShow(@javax.annotation.Nullable UserProfileTeleVisionShow teleVisionShow) { + this.teleVisionShow = teleVisionShow; + return this; + } + + /** + * Get teleVisionShow + * @return teleVisionShow + */ + @javax.annotation.Nullable + public UserProfileTeleVisionShow getTeleVisionShow() { + return teleVisionShow; + } + + public void setTeleVisionShow(@javax.annotation.Nullable UserProfileTeleVisionShow teleVisionShow) { + this.teleVisionShow = teleVisionShow; + } + + + public ExtendUserProfileWithCustomObject mutualFriends(@javax.annotation.Nullable UserProfileMutualFriends mutualFriends) { + this.mutualFriends = mutualFriends; + return this; + } + + /** + * Get mutualFriends + * @return mutualFriends + */ + @javax.annotation.Nullable + public UserProfileMutualFriends getMutualFriends() { + return mutualFriends; + } + + public void setMutualFriends(@javax.annotation.Nullable UserProfileMutualFriends mutualFriends) { + this.mutualFriends = mutualFriends; + } + + + public ExtendUserProfileWithCustomObject movies(@javax.annotation.Nullable UserProfileMovies movies) { + this.movies = movies; + return this; + } + + /** + * Get movies + * @return movies + */ + @javax.annotation.Nullable + public UserProfileMovies getMovies() { + return movies; + } + + public void setMovies(@javax.annotation.Nullable UserProfileMovies movies) { + this.movies = movies; + } + + + public ExtendUserProfileWithCustomObject books(@javax.annotation.Nullable UserProfileBooks books) { + this.books = books; + return this; + } + + /** + * Get books + * @return books + */ + @javax.annotation.Nullable + public UserProfileBooks getBooks() { + return books; + } + + public void setBooks(@javax.annotation.Nullable UserProfileBooks books) { + this.books = books; + } + + + public ExtendUserProfileWithCustomObject ageRange(@javax.annotation.Nullable UserProfileAgeRange ageRange) { + this.ageRange = ageRange; + return this; + } + + /** + * Get ageRange + * @return ageRange + */ + @javax.annotation.Nullable + public UserProfileAgeRange getAgeRange() { + return ageRange; + } + + public void setAgeRange(@javax.annotation.Nullable UserProfileAgeRange ageRange) { + this.ageRange = ageRange; + } + + + public ExtendUserProfileWithCustomObject publicRepository(@javax.annotation.Nullable UserProfilePublicRepository publicRepository) { + this.publicRepository = publicRepository; + return this; + } + + /** + * Get publicRepository + * @return publicRepository + */ + @javax.annotation.Nullable + public UserProfilePublicRepository getPublicRepository() { + return publicRepository; + } + + public void setPublicRepository(@javax.annotation.Nullable UserProfilePublicRepository publicRepository) { + this.publicRepository = publicRepository; + } + + + public ExtendUserProfileWithCustomObject hireable(@javax.annotation.Nullable Boolean hireable) { + this.hireable = hireable; + return this; + } + + /** + * Whether the User is hireable. + * @return hireable + */ + @javax.annotation.Nullable + public Boolean getHireable() { + return hireable; + } + + public void setHireable(@javax.annotation.Nullable Boolean hireable) { + this.hireable = hireable; + } + + + public ExtendUserProfileWithCustomObject repositoryUrl(@javax.annotation.Nullable UserProfileRepositoryUrl repositoryUrl) { + this.repositoryUrl = repositoryUrl; + return this; + } + + /** + * Get repositoryUrl + * @return repositoryUrl + */ + @javax.annotation.Nullable + public UserProfileRepositoryUrl getRepositoryUrl() { + return repositoryUrl; + } + + public void setRepositoryUrl(@javax.annotation.Nullable UserProfileRepositoryUrl repositoryUrl) { + this.repositoryUrl = repositoryUrl; + } + + + public ExtendUserProfileWithCustomObject age(@javax.annotation.Nullable Integer age) { + this.age = age; + return this; + } + + /** + * Age of the User. + * @return age + */ + @javax.annotation.Nullable + public Integer getAge() { + return age; + } + + public void setAge(@javax.annotation.Nullable Integer age) { + this.age = age; + } + + + public ExtendUserProfileWithCustomObject patents(@javax.annotation.Nullable UserProfilePatents patents) { + this.patents = patents; + return this; + } + + /** + * Get patents + * @return patents + */ + @javax.annotation.Nullable + public UserProfilePatents getPatents() { + return patents; + } + + public void setPatents(@javax.annotation.Nullable UserProfilePatents patents) { + this.patents = patents; + } + + + public ExtendUserProfileWithCustomObject favoriteThings(@javax.annotation.Nullable UserProfileFavoriteThings favoriteThings) { + this.favoriteThings = favoriteThings; + return this; + } + + /** + * Get favoriteThings + * @return favoriteThings + */ + @javax.annotation.Nullable + public UserProfileFavoriteThings getFavoriteThings() { + return favoriteThings; + } + + public void setFavoriteThings(@javax.annotation.Nullable UserProfileFavoriteThings favoriteThings) { + this.favoriteThings = favoriteThings; + } + + + public ExtendUserProfileWithCustomObject professionalHeadline(@javax.annotation.Nullable String professionalHeadline) { + this.professionalHeadline = professionalHeadline; + return this; + } + + /** + * Professional headline. + * @return professionalHeadline + */ + @javax.annotation.Nullable + public String getProfessionalHeadline() { + return professionalHeadline; + } + + public void setProfessionalHeadline(@javax.annotation.Nullable String professionalHeadline) { + this.professionalHeadline = professionalHeadline; + } + + + public ExtendUserProfileWithCustomObject relatedProfileViews(@javax.annotation.Nullable UserProfileRelatedProfileViews relatedProfileViews) { + this.relatedProfileViews = relatedProfileViews; + return this; + } + + /** + * Get relatedProfileViews + * @return relatedProfileViews + */ + @javax.annotation.Nullable + public UserProfileRelatedProfileViews getRelatedProfileViews() { + return relatedProfileViews; + } + + public void setRelatedProfileViews(@javax.annotation.Nullable UserProfileRelatedProfileViews relatedProfileViews) { + this.relatedProfileViews = relatedProfileViews; + } + + + public ExtendUserProfileWithCustomObject kloutScore(@javax.annotation.Nullable UserProfileKloutScore kloutScore) { + this.kloutScore = kloutScore; + return this; + } + + /** + * Get kloutScore + * @return kloutScore + */ + @javax.annotation.Nullable + public UserProfileKloutScore getKloutScore() { + return kloutScore; + } + + public void setKloutScore(@javax.annotation.Nullable UserProfileKloutScore kloutScore) { + this.kloutScore = kloutScore; + } + + + public ExtendUserProfileWithCustomObject lrUserID(@javax.annotation.Nullable String lrUserID) { + this.lrUserID = lrUserID; + return this; + } + + /** + * LoginRadius User ID. + * @return lrUserID + */ + @javax.annotation.Nullable + public String getLrUserID() { + return lrUserID; + } + + public void setLrUserID(@javax.annotation.Nullable String lrUserID) { + this.lrUserID = lrUserID; + } + + + public ExtendUserProfileWithCustomObject placesLived(@javax.annotation.Nullable UserProfilePlacesLived placesLived) { + this.placesLived = placesLived; + return this; + } + + /** + * Get placesLived + * @return placesLived + */ + @javax.annotation.Nullable + public UserProfilePlacesLived getPlacesLived() { + return placesLived; + } + + public void setPlacesLived(@javax.annotation.Nullable UserProfilePlacesLived placesLived) { + this.placesLived = placesLived; + } + + + public ExtendUserProfileWithCustomObject publications(@javax.annotation.Nullable UserProfilePublications publications) { + this.publications = publications; + return this; + } + + /** + * Get publications + * @return publications + */ + @javax.annotation.Nullable + public UserProfilePublications getPublications() { + return publications; + } + + public void setPublications(@javax.annotation.Nullable UserProfilePublications publications) { + this.publications = publications; + } + + + public ExtendUserProfileWithCustomObject jobBookmarks(@javax.annotation.Nullable UserProfileJobBookmarks jobBookmarks) { + this.jobBookmarks = jobBookmarks; + return this; + } + + /** + * Get jobBookmarks + * @return jobBookmarks + */ + @javax.annotation.Nullable + public UserProfileJobBookmarks getJobBookmarks() { + return jobBookmarks; + } + + public void setJobBookmarks(@javax.annotation.Nullable UserProfileJobBookmarks jobBookmarks) { + this.jobBookmarks = jobBookmarks; + } + + + public ExtendUserProfileWithCustomObject suggestions(@javax.annotation.Nullable UserProfileSuggestions suggestions) { + this.suggestions = suggestions; + return this; + } + + /** + * Get suggestions + * @return suggestions + */ + @javax.annotation.Nullable + public UserProfileSuggestions getSuggestions() { + return suggestions; + } + + public void setSuggestions(@javax.annotation.Nullable UserProfileSuggestions suggestions) { + this.suggestions = suggestions; + } + + + public ExtendUserProfileWithCustomObject badges(@javax.annotation.Nullable UserProfileBadges badges) { + this.badges = badges; + return this; + } + + /** + * Get badges + * @return badges + */ + @javax.annotation.Nullable + public UserProfileBadges getBadges() { + return badges; + } + + public void setBadges(@javax.annotation.Nullable UserProfileBadges badges) { + this.badges = badges; + } + + + public ExtendUserProfileWithCustomObject memberUrlResources(@javax.annotation.Nullable UserProfileMemberUrlResources memberUrlResources) { + this.memberUrlResources = memberUrlResources; + return this; + } + + /** + * Get memberUrlResources + * @return memberUrlResources + */ + @javax.annotation.Nullable + public UserProfileMemberUrlResources getMemberUrlResources() { + return memberUrlResources; + } + + public void setMemberUrlResources(@javax.annotation.Nullable UserProfileMemberUrlResources memberUrlResources) { + this.memberUrlResources = memberUrlResources; + } + + + public ExtendUserProfileWithCustomObject totalPrivateRepository(@javax.annotation.Nullable Integer totalPrivateRepository) { + this.totalPrivateRepository = totalPrivateRepository; + return this; + } + + /** + * Total number of private repositories. + * @return totalPrivateRepository + */ + @javax.annotation.Nullable + public Integer getTotalPrivateRepository() { + return totalPrivateRepository; + } + + public void setTotalPrivateRepository(@javax.annotation.Nullable Integer totalPrivateRepository) { + this.totalPrivateRepository = totalPrivateRepository; + } + + + public ExtendUserProfileWithCustomObject currency(@javax.annotation.Nullable String currency) { + this.currency = currency; + return this; + } + + /** + * Currency. + * @return currency + */ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + public void setCurrency(@javax.annotation.Nullable String currency) { + this.currency = currency; + } + + + public ExtendUserProfileWithCustomObject starredUrl(@javax.annotation.Nullable UserProfileStarredUrl starredUrl) { + this.starredUrl = starredUrl; + return this; + } + + /** + * Get starredUrl + * @return starredUrl + */ + @javax.annotation.Nullable + public UserProfileStarredUrl getStarredUrl() { + return starredUrl; + } + + public void setStarredUrl(@javax.annotation.Nullable UserProfileStarredUrl starredUrl) { + this.starredUrl = starredUrl; + } + + + public ExtendUserProfileWithCustomObject gistsUrl(@javax.annotation.Nullable UserProfileGistsUrl gistsUrl) { + this.gistsUrl = gistsUrl; + return this; + } + + /** + * Get gistsUrl + * @return gistsUrl + */ + @javax.annotation.Nullable + public UserProfileGistsUrl getGistsUrl() { + return gistsUrl; + } + + public void setGistsUrl(@javax.annotation.Nullable UserProfileGistsUrl gistsUrl) { + this.gistsUrl = gistsUrl; + } + + + public ExtendUserProfileWithCustomObject publicGists(@javax.annotation.Nullable Integer publicGists) { + this.publicGists = publicGists; + return this; + } + + /** + * Number of public gists. + * @return publicGists + */ + @javax.annotation.Nullable + public Integer getPublicGists() { + return publicGists; + } + + public void setPublicGists(@javax.annotation.Nullable Integer publicGists) { + this.publicGists = publicGists; + } + + + public ExtendUserProfileWithCustomObject privateGists(@javax.annotation.Nullable Integer privateGists) { + this.privateGists = privateGists; + return this; + } + + /** + * Number of private gists. + * @return privateGists + */ + @javax.annotation.Nullable + public Integer getPrivateGists() { + return privateGists; + } + + public void setPrivateGists(@javax.annotation.Nullable Integer privateGists) { + this.privateGists = privateGists; + } + + + public ExtendUserProfileWithCustomObject subscription(@javax.annotation.Nullable UserProfileSubscription subscription) { + this.subscription = subscription; + return this; + } + + /** + * Get subscription + * @return subscription + */ + @javax.annotation.Nullable + public UserProfileSubscription getSubscription() { + return subscription; + } + + public void setSubscription(@javax.annotation.Nullable UserProfileSubscription subscription) { + this.subscription = subscription; + } + + + public ExtendUserProfileWithCustomObject company(@javax.annotation.Nullable String company) { + this.company = company; + return this; + } + + /** + * Company name. + * @return company + */ + @javax.annotation.Nullable + public String getCompany() { + return company; + } + + public void setCompany(@javax.annotation.Nullable String company) { + this.company = company; + } + + + public ExtendUserProfileWithCustomObject gravatarImageUrl(@javax.annotation.Nullable UserProfileGravatarImageUrl gravatarImageUrl) { + this.gravatarImageUrl = gravatarImageUrl; + return this; + } + + /** + * Get gravatarImageUrl + * @return gravatarImageUrl + */ + @javax.annotation.Nullable + public UserProfileGravatarImageUrl getGravatarImageUrl() { + return gravatarImageUrl; + } + + public void setGravatarImageUrl(@javax.annotation.Nullable UserProfileGravatarImageUrl gravatarImageUrl) { + this.gravatarImageUrl = gravatarImageUrl; + } + + + public ExtendUserProfileWithCustomObject profileImageUrls(@javax.annotation.Nullable UserProfileProfileImageUrls profileImageUrls) { + this.profileImageUrls = profileImageUrls; + return this; + } + + /** + * Get profileImageUrls + * @return profileImageUrls + */ + @javax.annotation.Nullable + public UserProfileProfileImageUrls getProfileImageUrls() { + return profileImageUrls; + } + + public void setProfileImageUrls(@javax.annotation.Nullable UserProfileProfileImageUrls profileImageUrls) { + this.profileImageUrls = profileImageUrls; + } + + + public ExtendUserProfileWithCustomObject webProfiles(@javax.annotation.Nullable UserProfileWebProfiles webProfiles) { + this.webProfiles = webProfiles; + return this; + } + + /** + * Get webProfiles + * @return webProfiles + */ + @javax.annotation.Nullable + public UserProfileWebProfiles getWebProfiles() { + return webProfiles; + } + + public void setWebProfiles(@javax.annotation.Nullable UserProfileWebProfiles webProfiles) { + this.webProfiles = webProfiles; + } + + + public ExtendUserProfileWithCustomObject pinsCount(@javax.annotation.Nullable Integer pinsCount) { + this.pinsCount = pinsCount; + return this; + } + + /** + * Number of PINs. + * @return pinsCount + */ + @javax.annotation.Nullable + public Integer getPinsCount() { + return pinsCount; + } + + public void setPinsCount(@javax.annotation.Nullable Integer pinsCount) { + this.pinsCount = pinsCount; + } + + + public ExtendUserProfileWithCustomObject boardsCount(@javax.annotation.Nullable Integer boardsCount) { + this.boardsCount = boardsCount; + return this; + } + + /** + * Number of boards. + * @return boardsCount + */ + @javax.annotation.Nullable + public Integer getBoardsCount() { + return boardsCount; + } + + public void setBoardsCount(@javax.annotation.Nullable Integer boardsCount) { + this.boardsCount = boardsCount; + } + + + public ExtendUserProfileWithCustomObject likesCount(@javax.annotation.Nullable Integer likesCount) { + this.likesCount = likesCount; + return this; + } + + /** + * Number of likes. + * @return likesCount + */ + @javax.annotation.Nullable + public Integer getLikesCount() { + return likesCount; + } + + public void setLikesCount(@javax.annotation.Nullable Integer likesCount) { + this.likesCount = likesCount; + } + + + public ExtendUserProfileWithCustomObject emailVerifiedFromSocial(@javax.annotation.Nullable Boolean emailVerifiedFromSocial) { + this.emailVerifiedFromSocial = emailVerifiedFromSocial; + return this; + } + + /** + * Whether Email is verified from social login. + * @return emailVerifiedFromSocial + */ + @javax.annotation.Nullable + public Boolean getEmailVerifiedFromSocial() { + return emailVerifiedFromSocial; + } + + public void setEmailVerifiedFromSocial(@javax.annotation.Nullable Boolean emailVerifiedFromSocial) { + this.emailVerifiedFromSocial = emailVerifiedFromSocial; + } + + + public ExtendUserProfileWithCustomObject signupDate(@javax.annotation.Nullable OffsetDateTime signupDate) { + this.signupDate = signupDate; + return this; + } + + /** + * Signup date. + * @return signupDate + */ + @javax.annotation.Nullable + public OffsetDateTime getSignupDate() { + return signupDate; + } + + public void setSignupDate(@javax.annotation.Nullable OffsetDateTime signupDate) { + this.signupDate = signupDate; + } + + + public ExtendUserProfileWithCustomObject lastLoginDate(@javax.annotation.Nullable OffsetDateTime lastLoginDate) { + this.lastLoginDate = lastLoginDate; + return this; + } + + /** + * Last login date. + * @return lastLoginDate + */ + @javax.annotation.Nullable + public OffsetDateTime getLastLoginDate() { + return lastLoginDate; + } + + public void setLastLoginDate(@javax.annotation.Nullable OffsetDateTime lastLoginDate) { + this.lastLoginDate = lastLoginDate; + } + + + public ExtendUserProfileWithCustomObject customFields(@javax.annotation.Nullable UserProfileCustomFields customFields) { + this.customFields = customFields; + return this; + } + + /** + * Get customFields + * @return customFields + */ + @javax.annotation.Nullable + public UserProfileCustomFields getCustomFields() { + return customFields; + } + + public void setCustomFields(@javax.annotation.Nullable UserProfileCustomFields customFields) { + this.customFields = customFields; + } + + + public ExtendUserProfileWithCustomObject lastPasswordChangeDate(@javax.annotation.Nullable OffsetDateTime lastPasswordChangeDate) { + this.lastPasswordChangeDate = lastPasswordChangeDate; + return this; + } + + /** + * Last Password change date. + * @return lastPasswordChangeDate + */ + @javax.annotation.Nullable + public OffsetDateTime getLastPasswordChangeDate() { + return lastPasswordChangeDate; + } + + public void setLastPasswordChangeDate(@javax.annotation.Nullable OffsetDateTime lastPasswordChangeDate) { + this.lastPasswordChangeDate = lastPasswordChangeDate; + } + + + public ExtendUserProfileWithCustomObject passwordExpirationDate(@javax.annotation.Nullable OffsetDateTime passwordExpirationDate) { + this.passwordExpirationDate = passwordExpirationDate; + return this; + } + + /** + * Password expiration date. + * @return passwordExpirationDate + */ + @javax.annotation.Nullable + public OffsetDateTime getPasswordExpirationDate() { + return passwordExpirationDate; + } + + public void setPasswordExpirationDate(@javax.annotation.Nullable OffsetDateTime passwordExpirationDate) { + this.passwordExpirationDate = passwordExpirationDate; + } + + + public ExtendUserProfileWithCustomObject lastPasswordChangeToken(@javax.annotation.Nullable String lastPasswordChangeToken) { + this.lastPasswordChangeToken = lastPasswordChangeToken; + return this; + } + + /** + * Last Password change token. + * @return lastPasswordChangeToken + */ + @javax.annotation.Nullable + public String getLastPasswordChangeToken() { + return lastPasswordChangeToken; + } + + public void setLastPasswordChangeToken(@javax.annotation.Nullable String lastPasswordChangeToken) { + this.lastPasswordChangeToken = lastPasswordChangeToken; + } + + + public ExtendUserProfileWithCustomObject emailVerified(@javax.annotation.Nullable Boolean emailVerified) { + this.emailVerified = emailVerified; + return this; + } + + /** + * Whether Email is verified. + * @return emailVerified + */ + @javax.annotation.Nullable + public Boolean getEmailVerified() { + return emailVerified; + } + + public void setEmailVerified(@javax.annotation.Nullable Boolean emailVerified) { + this.emailVerified = emailVerified; + } + + + public ExtendUserProfileWithCustomObject isActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Whether the User is active. + * @return isActive + */ + @javax.annotation.Nullable + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + } + + + public ExtendUserProfileWithCustomObject isDeleted(@javax.annotation.Nullable Boolean isDeleted) { + this.isDeleted = isDeleted; + return this; + } + + /** + * Whether the User is deleted. + * @return isDeleted + */ + @javax.annotation.Nullable + public Boolean getIsDeleted() { + return isDeleted; + } + + public void setIsDeleted(@javax.annotation.Nullable Boolean isDeleted) { + this.isDeleted = isDeleted; + } + + + public ExtendUserProfileWithCustomObject isEmailSubscribed(@javax.annotation.Nullable Boolean isEmailSubscribed) { + this.isEmailSubscribed = isEmailSubscribed; + return this; + } + + /** + * Whether the User is subscribed to emails. + * @return isEmailSubscribed + */ + @javax.annotation.Nullable + public Boolean getIsEmailSubscribed() { + return isEmailSubscribed; + } + + public void setIsEmailSubscribed(@javax.annotation.Nullable Boolean isEmailSubscribed) { + this.isEmailSubscribed = isEmailSubscribed; + } + + + public ExtendUserProfileWithCustomObject userName(@javax.annotation.Nullable String userName) { + this.userName = userName; + return this; + } + + /** + * Username. + * @return userName + */ + @javax.annotation.Nullable + public String getUserName() { + return userName; + } + + public void setUserName(@javax.annotation.Nullable String userName) { + this.userName = userName; + } + + + public ExtendUserProfileWithCustomObject noOfLogins(@javax.annotation.Nullable Integer noOfLogins) { + this.noOfLogins = noOfLogins; + return this; + } + + /** + * Number of logins. + * @return noOfLogins + */ + @javax.annotation.Nullable + public Integer getNoOfLogins() { + return noOfLogins; + } + + public void setNoOfLogins(@javax.annotation.Nullable Integer noOfLogins) { + this.noOfLogins = noOfLogins; + } + + + public ExtendUserProfileWithCustomObject previousUids(@javax.annotation.Nullable List<String> previousUids) { + this.previousUids = previousUids; + return this; + } + + public ExtendUserProfileWithCustomObject addPreviousUidsItem(String previousUidsItem) { + if (this.previousUids == null) { + this.previousUids = new ArrayList<>(); + } + this.previousUids.add(previousUidsItem); + return this; + } + + /** + * Previous UIDs. + * @return previousUids + */ + @javax.annotation.Nullable + public List<String> getPreviousUids() { + return previousUids; + } + + public void setPreviousUids(@javax.annotation.Nullable List<String> previousUids) { + this.previousUids = previousUids; + } + + + public ExtendUserProfileWithCustomObject phoneId(@javax.annotation.Nullable String phoneId) { + this.phoneId = phoneId; + return this; + } + + /** + * Phone ID. + * @return phoneId + */ + @javax.annotation.Nullable + public String getPhoneId() { + return phoneId; + } + + public void setPhoneId(@javax.annotation.Nullable String phoneId) { + this.phoneId = phoneId; + } + + + public ExtendUserProfileWithCustomObject phoneIdVerified(@javax.annotation.Nullable Boolean phoneIdVerified) { + this.phoneIdVerified = phoneIdVerified; + return this; + } + + /** + * Whether Phone ID is verified. + * @return phoneIdVerified + */ + @javax.annotation.Nullable + public Boolean getPhoneIdVerified() { + return phoneIdVerified; + } + + public void setPhoneIdVerified(@javax.annotation.Nullable Boolean phoneIdVerified) { + this.phoneIdVerified = phoneIdVerified; + } + + + public ExtendUserProfileWithCustomObject roles(@javax.annotation.Nullable List<String> roles) { + this.roles = roles; + return this; + } + + public ExtendUserProfileWithCustomObject addRolesItem(String rolesItem) { + if (this.roles == null) { + this.roles = new ArrayList<>(); + } + this.roles.add(rolesItem); + return this; + } + + /** + * List of Roles. + * @return roles + */ + @javax.annotation.Nullable + public List<String> getRoles() { + return roles; + } + + public void setRoles(@javax.annotation.Nullable List<String> roles) { + this.roles = roles; + } + + + public ExtendUserProfileWithCustomObject externalUserLoginId(@javax.annotation.Nullable String externalUserLoginId) { + this.externalUserLoginId = externalUserLoginId; + return this; + } + + /** + * External User login ID. + * @return externalUserLoginId + */ + @javax.annotation.Nullable + public String getExternalUserLoginId() { + return externalUserLoginId; + } + + public void setExternalUserLoginId(@javax.annotation.Nullable String externalUserLoginId) { + this.externalUserLoginId = externalUserLoginId; + } + + + public ExtendUserProfileWithCustomObject failedLoginAttempt(@javax.annotation.Nullable Integer failedLoginAttempt) { + this.failedLoginAttempt = failedLoginAttempt; + return this; + } + + /** + * Number of failed login attempts. + * @return failedLoginAttempt + */ + @javax.annotation.Nullable + public Integer getFailedLoginAttempt() { + return failedLoginAttempt; + } + + public void setFailedLoginAttempt(@javax.annotation.Nullable Integer failedLoginAttempt) { + this.failedLoginAttempt = failedLoginAttempt; + } + + + public ExtendUserProfileWithCustomObject securityQuestionFailedResetPasswordAttempts(@javax.annotation.Nullable Integer securityQuestionFailedResetPasswordAttempts) { + this.securityQuestionFailedResetPasswordAttempts = securityQuestionFailedResetPasswordAttempts; + return this; + } + + /** + * Failed security question attempts for Password reset. + * @return securityQuestionFailedResetPasswordAttempts + */ + @javax.annotation.Nullable + public Integer getSecurityQuestionFailedResetPasswordAttempts() { + return securityQuestionFailedResetPasswordAttempts; + } + + public void setSecurityQuestionFailedResetPasswordAttempts(@javax.annotation.Nullable Integer securityQuestionFailedResetPasswordAttempts) { + this.securityQuestionFailedResetPasswordAttempts = securityQuestionFailedResetPasswordAttempts; + } + + + public ExtendUserProfileWithCustomObject securityQuestionFailedLoginAttempt(@javax.annotation.Nullable Integer securityQuestionFailedLoginAttempt) { + this.securityQuestionFailedLoginAttempt = securityQuestionFailedLoginAttempt; + return this; + } + + /** + * Failed security question attempts for login. + * @return securityQuestionFailedLoginAttempt + */ + @javax.annotation.Nullable + public Integer getSecurityQuestionFailedLoginAttempt() { + return securityQuestionFailedLoginAttempt; + } + + public void setSecurityQuestionFailedLoginAttempt(@javax.annotation.Nullable Integer securityQuestionFailedLoginAttempt) { + this.securityQuestionFailedLoginAttempt = securityQuestionFailedLoginAttempt; + } + + + public ExtendUserProfileWithCustomObject disableLogin(@javax.annotation.Nullable Boolean disableLogin) { + this.disableLogin = disableLogin; + return this; + } + + /** + * Whether login is disabled. + * @return disableLogin + */ + @javax.annotation.Nullable + public Boolean getDisableLogin() { + return disableLogin; + } + + public void setDisableLogin(@javax.annotation.Nullable Boolean disableLogin) { + this.disableLogin = disableLogin; + } + + + public ExtendUserProfileWithCustomObject registrationProvider(@javax.annotation.Nullable String registrationProvider) { + this.registrationProvider = registrationProvider; + return this; + } + + /** + * Registration provider. + * @return registrationProvider + */ + @javax.annotation.Nullable + public String getRegistrationProvider() { + return registrationProvider; + } + + public void setRegistrationProvider(@javax.annotation.Nullable String registrationProvider) { + this.registrationProvider = registrationProvider; + } + + + public ExtendUserProfileWithCustomObject isLoginLocked(@javax.annotation.Nullable Boolean isLoginLocked) { + this.isLoginLocked = isLoginLocked; + return this; + } + + /** + * Whether login is locked. + * @return isLoginLocked + */ + @javax.annotation.Nullable + public Boolean getIsLoginLocked() { + return isLoginLocked; + } + + public void setIsLoginLocked(@javax.annotation.Nullable Boolean isLoginLocked) { + this.isLoginLocked = isLoginLocked; + } + + + public ExtendUserProfileWithCustomObject loginLockedType(@javax.annotation.Nullable String loginLockedType) { + this.loginLockedType = loginLockedType; + return this; + } + + /** + * Type of login lock. + * @return loginLockedType + */ + @javax.annotation.Nullable + public String getLoginLockedType() { + return loginLockedType; + } + + public void setLoginLockedType(@javax.annotation.Nullable String loginLockedType) { + this.loginLockedType = loginLockedType; + } + + + public ExtendUserProfileWithCustomObject lastLoginLocation(@javax.annotation.Nullable String lastLoginLocation) { + this.lastLoginLocation = lastLoginLocation; + return this; + } + + /** + * Last login location. + * @return lastLoginLocation + */ + @javax.annotation.Nullable + public String getLastLoginLocation() { + return lastLoginLocation; + } + + public void setLastLoginLocation(@javax.annotation.Nullable String lastLoginLocation) { + this.lastLoginLocation = lastLoginLocation; + } + + + public ExtendUserProfileWithCustomObject registrationSource(@javax.annotation.Nullable String registrationSource) { + this.registrationSource = registrationSource; + return this; + } + + /** + * Registration source. + * @return registrationSource + */ + @javax.annotation.Nullable + public String getRegistrationSource() { + return registrationSource; + } + + public void setRegistrationSource(@javax.annotation.Nullable String registrationSource) { + this.registrationSource = registrationSource; + } + + + public ExtendUserProfileWithCustomObject isCustomUid(@javax.annotation.Nullable Boolean isCustomUid) { + this.isCustomUid = isCustomUid; + return this; + } + + /** + * Whether UID is custom. + * @return isCustomUid + */ + @javax.annotation.Nullable + public Boolean getIsCustomUid() { + return isCustomUid; + } + + public void setIsCustomUid(@javax.annotation.Nullable Boolean isCustomUid) { + this.isCustomUid = isCustomUid; + } + + + public ExtendUserProfileWithCustomObject unverifiedEmail(@javax.annotation.Nullable UserProfileUnverifiedEmail unverifiedEmail) { + this.unverifiedEmail = unverifiedEmail; + return this; + } + + /** + * Get unverifiedEmail + * @return unverifiedEmail + */ + @javax.annotation.Nullable + public UserProfileUnverifiedEmail getUnverifiedEmail() { + return unverifiedEmail; + } + + public void setUnverifiedEmail(@javax.annotation.Nullable UserProfileUnverifiedEmail unverifiedEmail) { + this.unverifiedEmail = unverifiedEmail; + } + + + public ExtendUserProfileWithCustomObject roleContext(@javax.annotation.Nullable UserProfileRoleContext roleContext) { + this.roleContext = roleContext; + return this; + } + + /** + * Get roleContext + * @return roleContext + */ + @javax.annotation.Nullable + public UserProfileRoleContext getRoleContext() { + return roleContext; + } + + public void setRoleContext(@javax.annotation.Nullable UserProfileRoleContext roleContext) { + this.roleContext = roleContext; + } + + + public ExtendUserProfileWithCustomObject knownLoginVariables(@javax.annotation.Nullable UserProfileKnownLoginVariables knownLoginVariables) { + this.knownLoginVariables = knownLoginVariables; + return this; + } + + /** + * Get knownLoginVariables + * @return knownLoginVariables + */ + @javax.annotation.Nullable + public UserProfileKnownLoginVariables getKnownLoginVariables() { + return knownLoginVariables; + } + + public void setKnownLoginVariables(@javax.annotation.Nullable UserProfileKnownLoginVariables knownLoginVariables) { + this.knownLoginVariables = knownLoginVariables; + } + + + public ExtendUserProfileWithCustomObject isSecurePassword(@javax.annotation.Nullable Boolean isSecurePassword) { + this.isSecurePassword = isSecurePassword; + return this; + } + + /** + * Whether the Password is secure. + * @return isSecurePassword + */ + @javax.annotation.Nullable + public Boolean getIsSecurePassword() { + return isSecurePassword; + } + + public void setIsSecurePassword(@javax.annotation.Nullable Boolean isSecurePassword) { + this.isSecurePassword = isSecurePassword; + } + + + public ExtendUserProfileWithCustomObject privacyPolicy(@javax.annotation.Nullable UserProfilePrivacyPolicy privacyPolicy) { + this.privacyPolicy = privacyPolicy; + return this; + } + + /** + * Get privacyPolicy + * @return privacyPolicy + */ + @javax.annotation.Nullable + public UserProfilePrivacyPolicy getPrivacyPolicy() { + return privacyPolicy; + } + + public void setPrivacyPolicy(@javax.annotation.Nullable UserProfilePrivacyPolicy privacyPolicy) { + this.privacyPolicy = privacyPolicy; + } + + + public ExtendUserProfileWithCustomObject loginLockedTimeout(@javax.annotation.Nullable String loginLockedTimeout) { + this.loginLockedTimeout = loginLockedTimeout; + return this; + } + + /** + * Login locked timeout. + * @return loginLockedTimeout + */ + @javax.annotation.Nullable + public String getLoginLockedTimeout() { + return loginLockedTimeout; + } + + public void setLoginLockedTimeout(@javax.annotation.Nullable String loginLockedTimeout) { + this.loginLockedTimeout = loginLockedTimeout; + } + + + public ExtendUserProfileWithCustomObject externalIds(@javax.annotation.Nullable UserProfileExternalIds externalIds) { + this.externalIds = externalIds; + return this; + } + + /** + * Get externalIds + * @return externalIds + */ + @javax.annotation.Nullable + public UserProfileExternalIds getExternalIds() { + return externalIds; + } + + public void setExternalIds(@javax.annotation.Nullable UserProfileExternalIds externalIds) { + this.externalIds = externalIds; + } + + + public ExtendUserProfileWithCustomObject isRequiredFieldsFilledOnce(@javax.annotation.Nullable Boolean isRequiredFieldsFilledOnce) { + this.isRequiredFieldsFilledOnce = isRequiredFieldsFilledOnce; + return this; + } + + /** + * Whether required fields are filled at least once. + * @return isRequiredFieldsFilledOnce + */ + @javax.annotation.Nullable + public Boolean getIsRequiredFieldsFilledOnce() { + return isRequiredFieldsFilledOnce; + } + + public void setIsRequiredFieldsFilledOnce(@javax.annotation.Nullable Boolean isRequiredFieldsFilledOnce) { + this.isRequiredFieldsFilledOnce = isRequiredFieldsFilledOnce; + } + + + public ExtendUserProfileWithCustomObject signupLog(@javax.annotation.Nullable UserProfileSignupLog signupLog) { + this.signupLog = signupLog; + return this; + } + + /** + * Get signupLog + * @return signupLog + */ + @javax.annotation.Nullable + public UserProfileSignupLog getSignupLog() { + return signupLog; + } + + public void setSignupLog(@javax.annotation.Nullable UserProfileSignupLog signupLog) { + this.signupLog = signupLog; + } + + + public ExtendUserProfileWithCustomObject lastAcceptedConsentVersion(@javax.annotation.Nullable Float lastAcceptedConsentVersion) { + this.lastAcceptedConsentVersion = lastAcceptedConsentVersion; + return this; + } + + /** + * Last accepted consent version. + * @return lastAcceptedConsentVersion + */ + @javax.annotation.Nullable + public Float getLastAcceptedConsentVersion() { + return lastAcceptedConsentVersion; + } + + public void setLastAcceptedConsentVersion(@javax.annotation.Nullable Float lastAcceptedConsentVersion) { + this.lastAcceptedConsentVersion = lastAcceptedConsentVersion; + } + + + public ExtendUserProfileWithCustomObject userAgent(@javax.annotation.Nullable UserProfileUserAgent userAgent) { + this.userAgent = userAgent; + return this; + } + + /** + * Get userAgent + * @return userAgent + */ + @javax.annotation.Nullable + public UserProfileUserAgent getUserAgent() { + return userAgent; + } + + public void setUserAgent(@javax.annotation.Nullable UserProfileUserAgent userAgent) { + this.userAgent = userAgent; + } + + + public ExtendUserProfileWithCustomObject customObject(@javax.annotation.Nullable Map<String, Object> customObject) { + this.customObject = customObject; + return this; + } + + public ExtendUserProfileWithCustomObject putCustomObjectItem(String key, Object customObjectItem) { + if (this.customObject == null) { + this.customObject = new HashMap<>(); + } + this.customObject.put(key, customObjectItem); + return this; + } + + /** + * Custom Object associated with the User profile. + * @return customObject + */ + @javax.annotation.Nullable + public Map<String, Object> getCustomObject() { + return customObject; + } + + public void setCustomObject(@javax.annotation.Nullable Map<String, Object> customObject) { + this.customObject = customObject; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ExtendUserProfileWithCustomObject instance itself + */ + public ExtendUserProfileWithCustomObject putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExtendUserProfileWithCustomObject extendUserProfileWithCustomObject = (ExtendUserProfileWithCustomObject) o; + return Objects.equals(this.appName, extendUserProfileWithCustomObject.appName) && + Objects.equals(this.uid, extendUserProfileWithCustomObject.uid) && + Objects.equals(this.ID, extendUserProfileWithCustomObject.ID) && + Objects.equals(this.provider, extendUserProfileWithCustomObject.provider) && + Objects.equals(this.prefix, extendUserProfileWithCustomObject.prefix) && + Objects.equals(this.firstName, extendUserProfileWithCustomObject.firstName) && + Objects.equals(this.middleName, extendUserProfileWithCustomObject.middleName) && + Objects.equals(this.lastName, extendUserProfileWithCustomObject.lastName) && + Objects.equals(this.suffix, extendUserProfileWithCustomObject.suffix) && + Objects.equals(this.fullName, extendUserProfileWithCustomObject.fullName) && + Objects.equals(this.nickName, extendUserProfileWithCustomObject.nickName) && + Objects.equals(this.profileName, extendUserProfileWithCustomObject.profileName) && + Objects.equals(this.birthDate, extendUserProfileWithCustomObject.birthDate) && + Objects.equals(this.gender, extendUserProfileWithCustomObject.gender) && + Objects.equals(this.website, extendUserProfileWithCustomObject.website) && + Objects.equals(this.email, extendUserProfileWithCustomObject.email) && + Objects.equals(this.country, extendUserProfileWithCustomObject.country) && + Objects.equals(this.thumbnailImageUrl, extendUserProfileWithCustomObject.thumbnailImageUrl) && + Objects.equals(this.imageUrl, extendUserProfileWithCustomObject.imageUrl) && + Objects.equals(this.favicon, extendUserProfileWithCustomObject.favicon) && + Objects.equals(this.profileUrl, extendUserProfileWithCustomObject.profileUrl) && + Objects.equals(this.homeTown, extendUserProfileWithCustomObject.homeTown) && + Objects.equals(this.state, extendUserProfileWithCustomObject.state) && + Objects.equals(this.city, extendUserProfileWithCustomObject.city) && + Objects.equals(this.industry, extendUserProfileWithCustomObject.industry) && + Objects.equals(this.about, extendUserProfileWithCustomObject.about) && + Objects.equals(this.timeZone, extendUserProfileWithCustomObject.timeZone) && + Objects.equals(this.localLanguage, extendUserProfileWithCustomObject.localLanguage) && + Objects.equals(this.coverPhoto, extendUserProfileWithCustomObject.coverPhoto) && + Objects.equals(this.tagLine, extendUserProfileWithCustomObject.tagLine) && + Objects.equals(this.language, extendUserProfileWithCustomObject.language) && + Objects.equals(this.verified, extendUserProfileWithCustomObject.verified) && + Objects.equals(this.updatedTime, extendUserProfileWithCustomObject.updatedTime) && + Objects.equals(this.positions, extendUserProfileWithCustomObject.positions) && + Objects.equals(this.educations, extendUserProfileWithCustomObject.educations) && + Objects.equals(this.phoneNumbers, extendUserProfileWithCustomObject.phoneNumbers) && + Objects.equals(this.imAccounts, extendUserProfileWithCustomObject.imAccounts) && + Objects.equals(this.addresses, extendUserProfileWithCustomObject.addresses) && + Objects.equals(this.mainAddress, extendUserProfileWithCustomObject.mainAddress) && + Objects.equals(this.created, extendUserProfileWithCustomObject.created) && + Objects.equals(this.createdDate, extendUserProfileWithCustomObject.createdDate) && + Objects.equals(this.modifiedDate, extendUserProfileWithCustomObject.modifiedDate) && + Objects.equals(this.profileModifiedDate, extendUserProfileWithCustomObject.profileModifiedDate) && + Objects.equals(this.localCity, extendUserProfileWithCustomObject.localCity) && + Objects.equals(this.profileCity, extendUserProfileWithCustomObject.profileCity) && + Objects.equals(this.localCountry, extendUserProfileWithCustomObject.localCountry) && + Objects.equals(this.profileCountry, extendUserProfileWithCustomObject.profileCountry) && + Objects.equals(this.firstLogin, extendUserProfileWithCustomObject.firstLogin) && + Objects.equals(this.isProtected, extendUserProfileWithCustomObject.isProtected) && + Objects.equals(this.relationshipStatus, extendUserProfileWithCustomObject.relationshipStatus) && + Objects.equals(this.quota, extendUserProfileWithCustomObject.quota) && + Objects.equals(this.interestedIn, extendUserProfileWithCustomObject.interestedIn) && + Objects.equals(this.interests, extendUserProfileWithCustomObject.interests) && + Objects.equals(this.religion, extendUserProfileWithCustomObject.religion) && + Objects.equals(this.political, extendUserProfileWithCustomObject.political) && + Objects.equals(this.sports, extendUserProfileWithCustomObject.sports) && + Objects.equals(this.inspirationalPeople, extendUserProfileWithCustomObject.inspirationalPeople) && + Objects.equals(this.httpsImageUrl, extendUserProfileWithCustomObject.httpsImageUrl) && + Objects.equals(this.followersCount, extendUserProfileWithCustomObject.followersCount) && + Objects.equals(this.friendsCount, extendUserProfileWithCustomObject.friendsCount) && + Objects.equals(this.isGeoEnabled, extendUserProfileWithCustomObject.isGeoEnabled) && + Objects.equals(this.totalStatusesCount, extendUserProfileWithCustomObject.totalStatusesCount) && + Objects.equals(this.associations, extendUserProfileWithCustomObject.associations) && + Objects.equals(this.numRecommenders, extendUserProfileWithCustomObject.numRecommenders) && + Objects.equals(this.honors, extendUserProfileWithCustomObject.honors) && + Objects.equals(this.awards, extendUserProfileWithCustomObject.awards) && + Objects.equals(this.skills, extendUserProfileWithCustomObject.skills) && + Objects.equals(this.currentStatus, extendUserProfileWithCustomObject.currentStatus) && + Objects.equals(this.certifications, extendUserProfileWithCustomObject.certifications) && + Objects.equals(this.courses, extendUserProfileWithCustomObject.courses) && + Objects.equals(this.volunteer, extendUserProfileWithCustomObject.volunteer) && + Objects.equals(this.recommendationsReceived, extendUserProfileWithCustomObject.recommendationsReceived) && + Objects.equals(this.languages, extendUserProfileWithCustomObject.languages) && + Objects.equals(this.projects, extendUserProfileWithCustomObject.projects) && + Objects.equals(this.games, extendUserProfileWithCustomObject.games) && + Objects.equals(this.family, extendUserProfileWithCustomObject.family) && + Objects.equals(this.teleVisionShow, extendUserProfileWithCustomObject.teleVisionShow) && + Objects.equals(this.mutualFriends, extendUserProfileWithCustomObject.mutualFriends) && + Objects.equals(this.movies, extendUserProfileWithCustomObject.movies) && + Objects.equals(this.books, extendUserProfileWithCustomObject.books) && + Objects.equals(this.ageRange, extendUserProfileWithCustomObject.ageRange) && + Objects.equals(this.publicRepository, extendUserProfileWithCustomObject.publicRepository) && + Objects.equals(this.hireable, extendUserProfileWithCustomObject.hireable) && + Objects.equals(this.repositoryUrl, extendUserProfileWithCustomObject.repositoryUrl) && + Objects.equals(this.age, extendUserProfileWithCustomObject.age) && + Objects.equals(this.patents, extendUserProfileWithCustomObject.patents) && + Objects.equals(this.favoriteThings, extendUserProfileWithCustomObject.favoriteThings) && + Objects.equals(this.professionalHeadline, extendUserProfileWithCustomObject.professionalHeadline) && + Objects.equals(this.relatedProfileViews, extendUserProfileWithCustomObject.relatedProfileViews) && + Objects.equals(this.kloutScore, extendUserProfileWithCustomObject.kloutScore) && + Objects.equals(this.lrUserID, extendUserProfileWithCustomObject.lrUserID) && + Objects.equals(this.placesLived, extendUserProfileWithCustomObject.placesLived) && + Objects.equals(this.publications, extendUserProfileWithCustomObject.publications) && + Objects.equals(this.jobBookmarks, extendUserProfileWithCustomObject.jobBookmarks) && + Objects.equals(this.suggestions, extendUserProfileWithCustomObject.suggestions) && + Objects.equals(this.badges, extendUserProfileWithCustomObject.badges) && + Objects.equals(this.memberUrlResources, extendUserProfileWithCustomObject.memberUrlResources) && + Objects.equals(this.totalPrivateRepository, extendUserProfileWithCustomObject.totalPrivateRepository) && + Objects.equals(this.currency, extendUserProfileWithCustomObject.currency) && + Objects.equals(this.starredUrl, extendUserProfileWithCustomObject.starredUrl) && + Objects.equals(this.gistsUrl, extendUserProfileWithCustomObject.gistsUrl) && + Objects.equals(this.publicGists, extendUserProfileWithCustomObject.publicGists) && + Objects.equals(this.privateGists, extendUserProfileWithCustomObject.privateGists) && + Objects.equals(this.subscription, extendUserProfileWithCustomObject.subscription) && + Objects.equals(this.company, extendUserProfileWithCustomObject.company) && + Objects.equals(this.gravatarImageUrl, extendUserProfileWithCustomObject.gravatarImageUrl) && + Objects.equals(this.profileImageUrls, extendUserProfileWithCustomObject.profileImageUrls) && + Objects.equals(this.webProfiles, extendUserProfileWithCustomObject.webProfiles) && + Objects.equals(this.pinsCount, extendUserProfileWithCustomObject.pinsCount) && + Objects.equals(this.boardsCount, extendUserProfileWithCustomObject.boardsCount) && + Objects.equals(this.likesCount, extendUserProfileWithCustomObject.likesCount) && + Objects.equals(this.emailVerifiedFromSocial, extendUserProfileWithCustomObject.emailVerifiedFromSocial) && + Objects.equals(this.signupDate, extendUserProfileWithCustomObject.signupDate) && + Objects.equals(this.lastLoginDate, extendUserProfileWithCustomObject.lastLoginDate) && + Objects.equals(this.customFields, extendUserProfileWithCustomObject.customFields) && + Objects.equals(this.lastPasswordChangeDate, extendUserProfileWithCustomObject.lastPasswordChangeDate) && + Objects.equals(this.passwordExpirationDate, extendUserProfileWithCustomObject.passwordExpirationDate) && + Objects.equals(this.lastPasswordChangeToken, extendUserProfileWithCustomObject.lastPasswordChangeToken) && + Objects.equals(this.emailVerified, extendUserProfileWithCustomObject.emailVerified) && + Objects.equals(this.isActive, extendUserProfileWithCustomObject.isActive) && + Objects.equals(this.isDeleted, extendUserProfileWithCustomObject.isDeleted) && + Objects.equals(this.isEmailSubscribed, extendUserProfileWithCustomObject.isEmailSubscribed) && + Objects.equals(this.userName, extendUserProfileWithCustomObject.userName) && + Objects.equals(this.noOfLogins, extendUserProfileWithCustomObject.noOfLogins) && + Objects.equals(this.previousUids, extendUserProfileWithCustomObject.previousUids) && + Objects.equals(this.phoneId, extendUserProfileWithCustomObject.phoneId) && + Objects.equals(this.phoneIdVerified, extendUserProfileWithCustomObject.phoneIdVerified) && + Objects.equals(this.roles, extendUserProfileWithCustomObject.roles) && + Objects.equals(this.externalUserLoginId, extendUserProfileWithCustomObject.externalUserLoginId) && + Objects.equals(this.failedLoginAttempt, extendUserProfileWithCustomObject.failedLoginAttempt) && + Objects.equals(this.securityQuestionFailedResetPasswordAttempts, extendUserProfileWithCustomObject.securityQuestionFailedResetPasswordAttempts) && + Objects.equals(this.securityQuestionFailedLoginAttempt, extendUserProfileWithCustomObject.securityQuestionFailedLoginAttempt) && + Objects.equals(this.disableLogin, extendUserProfileWithCustomObject.disableLogin) && + Objects.equals(this.registrationProvider, extendUserProfileWithCustomObject.registrationProvider) && + Objects.equals(this.isLoginLocked, extendUserProfileWithCustomObject.isLoginLocked) && + Objects.equals(this.loginLockedType, extendUserProfileWithCustomObject.loginLockedType) && + Objects.equals(this.lastLoginLocation, extendUserProfileWithCustomObject.lastLoginLocation) && + Objects.equals(this.registrationSource, extendUserProfileWithCustomObject.registrationSource) && + Objects.equals(this.isCustomUid, extendUserProfileWithCustomObject.isCustomUid) && + Objects.equals(this.unverifiedEmail, extendUserProfileWithCustomObject.unverifiedEmail) && + Objects.equals(this.roleContext, extendUserProfileWithCustomObject.roleContext) && + Objects.equals(this.knownLoginVariables, extendUserProfileWithCustomObject.knownLoginVariables) && + Objects.equals(this.isSecurePassword, extendUserProfileWithCustomObject.isSecurePassword) && + Objects.equals(this.privacyPolicy, extendUserProfileWithCustomObject.privacyPolicy) && + Objects.equals(this.loginLockedTimeout, extendUserProfileWithCustomObject.loginLockedTimeout) && + Objects.equals(this.externalIds, extendUserProfileWithCustomObject.externalIds) && + Objects.equals(this.isRequiredFieldsFilledOnce, extendUserProfileWithCustomObject.isRequiredFieldsFilledOnce) && + Objects.equals(this.signupLog, extendUserProfileWithCustomObject.signupLog) && + Objects.equals(this.lastAcceptedConsentVersion, extendUserProfileWithCustomObject.lastAcceptedConsentVersion) && + Objects.equals(this.userAgent, extendUserProfileWithCustomObject.userAgent) && + Objects.equals(this.customObject, extendUserProfileWithCustomObject.customObject)&& + Objects.equals(this.additionalProperties, extendUserProfileWithCustomObject.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(appName, uid, ID, provider, prefix, firstName, middleName, lastName, suffix, fullName, nickName, profileName, birthDate, gender, website, email, country, thumbnailImageUrl, imageUrl, favicon, profileUrl, homeTown, state, city, industry, about, timeZone, localLanguage, coverPhoto, tagLine, language, verified, updatedTime, positions, educations, phoneNumbers, imAccounts, addresses, mainAddress, created, createdDate, modifiedDate, profileModifiedDate, localCity, profileCity, localCountry, profileCountry, firstLogin, isProtected, relationshipStatus, quota, interestedIn, interests, religion, political, sports, inspirationalPeople, httpsImageUrl, followersCount, friendsCount, isGeoEnabled, totalStatusesCount, associations, numRecommenders, honors, awards, skills, currentStatus, certifications, courses, volunteer, recommendationsReceived, languages, projects, games, family, teleVisionShow, mutualFriends, movies, books, ageRange, publicRepository, hireable, repositoryUrl, age, patents, favoriteThings, professionalHeadline, relatedProfileViews, kloutScore, lrUserID, placesLived, publications, jobBookmarks, suggestions, badges, memberUrlResources, totalPrivateRepository, currency, starredUrl, gistsUrl, publicGists, privateGists, subscription, company, gravatarImageUrl, profileImageUrls, webProfiles, pinsCount, boardsCount, likesCount, emailVerifiedFromSocial, signupDate, lastLoginDate, customFields, lastPasswordChangeDate, passwordExpirationDate, lastPasswordChangeToken, emailVerified, isActive, isDeleted, isEmailSubscribed, userName, noOfLogins, previousUids, phoneId, phoneIdVerified, roles, externalUserLoginId, failedLoginAttempt, securityQuestionFailedResetPasswordAttempts, securityQuestionFailedLoginAttempt, disableLogin, registrationProvider, isLoginLocked, loginLockedType, lastLoginLocation, registrationSource, isCustomUid, unverifiedEmail, roleContext, knownLoginVariables, isSecurePassword, privacyPolicy, loginLockedTimeout, externalIds, isRequiredFieldsFilledOnce, signupLog, lastAcceptedConsentVersion, userAgent, customObject, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExtendUserProfileWithCustomObject {\n"); + sb.append(" appName: ").append(toIndentedString(appName)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" ID: ").append(toIndentedString(ID)).append("\n"); + sb.append(" provider: ").append(toIndentedString(provider)).append("\n"); + sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" middleName: ").append(toIndentedString(middleName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" suffix: ").append(toIndentedString(suffix)).append("\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append(" nickName: ").append(toIndentedString(nickName)).append("\n"); + sb.append(" profileName: ").append(toIndentedString(profileName)).append("\n"); + sb.append(" birthDate: ").append(toIndentedString(birthDate)).append("\n"); + sb.append(" gender: ").append(toIndentedString(gender)).append("\n"); + sb.append(" website: ").append(toIndentedString(website)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" thumbnailImageUrl: ").append(toIndentedString(thumbnailImageUrl)).append("\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append(" favicon: ").append(toIndentedString(favicon)).append("\n"); + sb.append(" profileUrl: ").append(toIndentedString(profileUrl)).append("\n"); + sb.append(" homeTown: ").append(toIndentedString(homeTown)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" industry: ").append(toIndentedString(industry)).append("\n"); + sb.append(" about: ").append(toIndentedString(about)).append("\n"); + sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); + sb.append(" localLanguage: ").append(toIndentedString(localLanguage)).append("\n"); + sb.append(" coverPhoto: ").append(toIndentedString(coverPhoto)).append("\n"); + sb.append(" tagLine: ").append(toIndentedString(tagLine)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" verified: ").append(toIndentedString(verified)).append("\n"); + sb.append(" updatedTime: ").append(toIndentedString(updatedTime)).append("\n"); + sb.append(" positions: ").append(toIndentedString(positions)).append("\n"); + sb.append(" educations: ").append(toIndentedString(educations)).append("\n"); + sb.append(" phoneNumbers: ").append(toIndentedString(phoneNumbers)).append("\n"); + sb.append(" imAccounts: ").append(toIndentedString(imAccounts)).append("\n"); + sb.append(" addresses: ").append(toIndentedString(addresses)).append("\n"); + sb.append(" mainAddress: ").append(toIndentedString(mainAddress)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" modifiedDate: ").append(toIndentedString(modifiedDate)).append("\n"); + sb.append(" profileModifiedDate: ").append(toIndentedString(profileModifiedDate)).append("\n"); + sb.append(" localCity: ").append(toIndentedString(localCity)).append("\n"); + sb.append(" profileCity: ").append(toIndentedString(profileCity)).append("\n"); + sb.append(" localCountry: ").append(toIndentedString(localCountry)).append("\n"); + sb.append(" profileCountry: ").append(toIndentedString(profileCountry)).append("\n"); + sb.append(" firstLogin: ").append(toIndentedString(firstLogin)).append("\n"); + sb.append(" isProtected: ").append(toIndentedString(isProtected)).append("\n"); + sb.append(" relationshipStatus: ").append(toIndentedString(relationshipStatus)).append("\n"); + sb.append(" quota: ").append(toIndentedString(quota)).append("\n"); + sb.append(" interestedIn: ").append(toIndentedString(interestedIn)).append("\n"); + sb.append(" interests: ").append(toIndentedString(interests)).append("\n"); + sb.append(" religion: ").append(toIndentedString(religion)).append("\n"); + sb.append(" political: ").append(toIndentedString(political)).append("\n"); + sb.append(" sports: ").append(toIndentedString(sports)).append("\n"); + sb.append(" inspirationalPeople: ").append(toIndentedString(inspirationalPeople)).append("\n"); + sb.append(" httpsImageUrl: ").append(toIndentedString(httpsImageUrl)).append("\n"); + sb.append(" followersCount: ").append(toIndentedString(followersCount)).append("\n"); + sb.append(" friendsCount: ").append(toIndentedString(friendsCount)).append("\n"); + sb.append(" isGeoEnabled: ").append(toIndentedString(isGeoEnabled)).append("\n"); + sb.append(" totalStatusesCount: ").append(toIndentedString(totalStatusesCount)).append("\n"); + sb.append(" associations: ").append(toIndentedString(associations)).append("\n"); + sb.append(" numRecommenders: ").append(toIndentedString(numRecommenders)).append("\n"); + sb.append(" honors: ").append(toIndentedString(honors)).append("\n"); + sb.append(" awards: ").append(toIndentedString(awards)).append("\n"); + sb.append(" skills: ").append(toIndentedString(skills)).append("\n"); + sb.append(" currentStatus: ").append(toIndentedString(currentStatus)).append("\n"); + sb.append(" certifications: ").append(toIndentedString(certifications)).append("\n"); + sb.append(" courses: ").append(toIndentedString(courses)).append("\n"); + sb.append(" volunteer: ").append(toIndentedString(volunteer)).append("\n"); + sb.append(" recommendationsReceived: ").append(toIndentedString(recommendationsReceived)).append("\n"); + sb.append(" languages: ").append(toIndentedString(languages)).append("\n"); + sb.append(" projects: ").append(toIndentedString(projects)).append("\n"); + sb.append(" games: ").append(toIndentedString(games)).append("\n"); + sb.append(" family: ").append(toIndentedString(family)).append("\n"); + sb.append(" teleVisionShow: ").append(toIndentedString(teleVisionShow)).append("\n"); + sb.append(" mutualFriends: ").append(toIndentedString(mutualFriends)).append("\n"); + sb.append(" movies: ").append(toIndentedString(movies)).append("\n"); + sb.append(" books: ").append(toIndentedString(books)).append("\n"); + sb.append(" ageRange: ").append(toIndentedString(ageRange)).append("\n"); + sb.append(" publicRepository: ").append(toIndentedString(publicRepository)).append("\n"); + sb.append(" hireable: ").append(toIndentedString(hireable)).append("\n"); + sb.append(" repositoryUrl: ").append(toIndentedString(repositoryUrl)).append("\n"); + sb.append(" age: ").append(toIndentedString(age)).append("\n"); + sb.append(" patents: ").append(toIndentedString(patents)).append("\n"); + sb.append(" favoriteThings: ").append(toIndentedString(favoriteThings)).append("\n"); + sb.append(" professionalHeadline: ").append(toIndentedString(professionalHeadline)).append("\n"); + sb.append(" relatedProfileViews: ").append(toIndentedString(relatedProfileViews)).append("\n"); + sb.append(" kloutScore: ").append(toIndentedString(kloutScore)).append("\n"); + sb.append(" lrUserID: ").append(toIndentedString(lrUserID)).append("\n"); + sb.append(" placesLived: ").append(toIndentedString(placesLived)).append("\n"); + sb.append(" publications: ").append(toIndentedString(publications)).append("\n"); + sb.append(" jobBookmarks: ").append(toIndentedString(jobBookmarks)).append("\n"); + sb.append(" suggestions: ").append(toIndentedString(suggestions)).append("\n"); + sb.append(" badges: ").append(toIndentedString(badges)).append("\n"); + sb.append(" memberUrlResources: ").append(toIndentedString(memberUrlResources)).append("\n"); + sb.append(" totalPrivateRepository: ").append(toIndentedString(totalPrivateRepository)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" starredUrl: ").append(toIndentedString(starredUrl)).append("\n"); + sb.append(" gistsUrl: ").append(toIndentedString(gistsUrl)).append("\n"); + sb.append(" publicGists: ").append(toIndentedString(publicGists)).append("\n"); + sb.append(" privateGists: ").append(toIndentedString(privateGists)).append("\n"); + sb.append(" subscription: ").append(toIndentedString(subscription)).append("\n"); + sb.append(" company: ").append(toIndentedString(company)).append("\n"); + sb.append(" gravatarImageUrl: ").append(toIndentedString(gravatarImageUrl)).append("\n"); + sb.append(" profileImageUrls: ").append(toIndentedString(profileImageUrls)).append("\n"); + sb.append(" webProfiles: ").append(toIndentedString(webProfiles)).append("\n"); + sb.append(" pinsCount: ").append(toIndentedString(pinsCount)).append("\n"); + sb.append(" boardsCount: ").append(toIndentedString(boardsCount)).append("\n"); + sb.append(" likesCount: ").append(toIndentedString(likesCount)).append("\n"); + sb.append(" emailVerifiedFromSocial: ").append(toIndentedString(emailVerifiedFromSocial)).append("\n"); + sb.append(" signupDate: ").append(toIndentedString(signupDate)).append("\n"); + sb.append(" lastLoginDate: ").append(toIndentedString(lastLoginDate)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" lastPasswordChangeDate: ").append(toIndentedString(lastPasswordChangeDate)).append("\n"); + sb.append(" passwordExpirationDate: ").append(toIndentedString(passwordExpirationDate)).append("\n"); + sb.append(" lastPasswordChangeToken: ").append(toIndentedString(lastPasswordChangeToken)).append("\n"); + sb.append(" emailVerified: ").append(toIndentedString(emailVerified)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" isDeleted: ").append(toIndentedString(isDeleted)).append("\n"); + sb.append(" isEmailSubscribed: ").append(toIndentedString(isEmailSubscribed)).append("\n"); + sb.append(" userName: ").append(toIndentedString(userName)).append("\n"); + sb.append(" noOfLogins: ").append(toIndentedString(noOfLogins)).append("\n"); + sb.append(" previousUids: ").append(toIndentedString(previousUids)).append("\n"); + sb.append(" phoneId: ").append(toIndentedString(phoneId)).append("\n"); + sb.append(" phoneIdVerified: ").append(toIndentedString(phoneIdVerified)).append("\n"); + sb.append(" roles: ").append(toIndentedString(roles)).append("\n"); + sb.append(" externalUserLoginId: ").append(toIndentedString(externalUserLoginId)).append("\n"); + sb.append(" failedLoginAttempt: ").append(toIndentedString(failedLoginAttempt)).append("\n"); + sb.append(" securityQuestionFailedResetPasswordAttempts: ").append(toIndentedString(securityQuestionFailedResetPasswordAttempts)).append("\n"); + sb.append(" securityQuestionFailedLoginAttempt: ").append(toIndentedString(securityQuestionFailedLoginAttempt)).append("\n"); + sb.append(" disableLogin: ").append(toIndentedString(disableLogin)).append("\n"); + sb.append(" registrationProvider: ").append(toIndentedString(registrationProvider)).append("\n"); + sb.append(" isLoginLocked: ").append(toIndentedString(isLoginLocked)).append("\n"); + sb.append(" loginLockedType: ").append(toIndentedString(loginLockedType)).append("\n"); + sb.append(" lastLoginLocation: ").append(toIndentedString(lastLoginLocation)).append("\n"); + sb.append(" registrationSource: ").append(toIndentedString(registrationSource)).append("\n"); + sb.append(" isCustomUid: ").append(toIndentedString(isCustomUid)).append("\n"); + sb.append(" unverifiedEmail: ").append(toIndentedString(unverifiedEmail)).append("\n"); + sb.append(" roleContext: ").append(toIndentedString(roleContext)).append("\n"); + sb.append(" knownLoginVariables: ").append(toIndentedString(knownLoginVariables)).append("\n"); + sb.append(" isSecurePassword: ").append(toIndentedString(isSecurePassword)).append("\n"); + sb.append(" privacyPolicy: ").append(toIndentedString(privacyPolicy)).append("\n"); + sb.append(" loginLockedTimeout: ").append(toIndentedString(loginLockedTimeout)).append("\n"); + sb.append(" externalIds: ").append(toIndentedString(externalIds)).append("\n"); + sb.append(" isRequiredFieldsFilledOnce: ").append(toIndentedString(isRequiredFieldsFilledOnce)).append("\n"); + sb.append(" signupLog: ").append(toIndentedString(signupLog)).append("\n"); + sb.append(" lastAcceptedConsentVersion: ").append(toIndentedString(lastAcceptedConsentVersion)).append("\n"); + sb.append(" userAgent: ").append(toIndentedString(userAgent)).append("\n"); + sb.append(" customObject: ").append(toIndentedString(customObject)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AppName"); + openapiFields.add("Uid"); + openapiFields.add("ID"); + openapiFields.add("Provider"); + openapiFields.add("Prefix"); + openapiFields.add("FirstName"); + openapiFields.add("MiddleName"); + openapiFields.add("LastName"); + openapiFields.add("Suffix"); + openapiFields.add("FullName"); + openapiFields.add("NickName"); + openapiFields.add("ProfileName"); + openapiFields.add("BirthDate"); + openapiFields.add("Gender"); + openapiFields.add("Website"); + openapiFields.add("Email"); + openapiFields.add("Country"); + openapiFields.add("ThumbnailImageUrl"); + openapiFields.add("ImageUrl"); + openapiFields.add("Favicon"); + openapiFields.add("ProfileUrl"); + openapiFields.add("HomeTown"); + openapiFields.add("State"); + openapiFields.add("City"); + openapiFields.add("Industry"); + openapiFields.add("About"); + openapiFields.add("TimeZone"); + openapiFields.add("LocalLanguage"); + openapiFields.add("CoverPhoto"); + openapiFields.add("TagLine"); + openapiFields.add("Language"); + openapiFields.add("Verified"); + openapiFields.add("UpdatedTime"); + openapiFields.add("Positions"); + openapiFields.add("Educations"); + openapiFields.add("PhoneNumbers"); + openapiFields.add("IMAccounts"); + openapiFields.add("Addresses"); + openapiFields.add("MainAddress"); + openapiFields.add("Created"); + openapiFields.add("CreatedDate"); + openapiFields.add("ModifiedDate"); + openapiFields.add("ProfileModifiedDate"); + openapiFields.add("LocalCity"); + openapiFields.add("ProfileCity"); + openapiFields.add("LocalCountry"); + openapiFields.add("ProfileCountry"); + openapiFields.add("FirstLogin"); + openapiFields.add("IsProtected"); + openapiFields.add("RelationshipStatus"); + openapiFields.add("Quota"); + openapiFields.add("InterestedIn"); + openapiFields.add("Interests"); + openapiFields.add("Religion"); + openapiFields.add("Political"); + openapiFields.add("Sports"); + openapiFields.add("InspirationalPeople"); + openapiFields.add("HttpsImageUrl"); + openapiFields.add("FollowersCount"); + openapiFields.add("FriendsCount"); + openapiFields.add("IsGeoEnabled"); + openapiFields.add("TotalStatusesCount"); + openapiFields.add("Associations"); + openapiFields.add("NumRecommenders"); + openapiFields.add("Honors"); + openapiFields.add("Awards"); + openapiFields.add("Skills"); + openapiFields.add("CurrentStatus"); + openapiFields.add("Certifications"); + openapiFields.add("Courses"); + openapiFields.add("Volunteer"); + openapiFields.add("RecommendationsReceived"); + openapiFields.add("Languages"); + openapiFields.add("Projects"); + openapiFields.add("Games"); + openapiFields.add("Family"); + openapiFields.add("TeleVisionShow"); + openapiFields.add("MutualFriends"); + openapiFields.add("Movies"); + openapiFields.add("Books"); + openapiFields.add("AgeRange"); + openapiFields.add("PublicRepository"); + openapiFields.add("Hireable"); + openapiFields.add("RepositoryUrl"); + openapiFields.add("Age"); + openapiFields.add("Patents"); + openapiFields.add("FavoriteThings"); + openapiFields.add("ProfessionalHeadline"); + openapiFields.add("RelatedProfileViews"); + openapiFields.add("KloutScore"); + openapiFields.add("LRUserID"); + openapiFields.add("PlacesLived"); + openapiFields.add("Publications"); + openapiFields.add("JobBookmarks"); + openapiFields.add("Suggestions"); + openapiFields.add("Badges"); + openapiFields.add("MemberUrlResources"); + openapiFields.add("TotalPrivateRepository"); + openapiFields.add("Currency"); + openapiFields.add("StarredUrl"); + openapiFields.add("GistsUrl"); + openapiFields.add("PublicGists"); + openapiFields.add("PrivateGists"); + openapiFields.add("Subscription"); + openapiFields.add("Company"); + openapiFields.add("GravatarImageUrl"); + openapiFields.add("ProfileImageUrls"); + openapiFields.add("WebProfiles"); + openapiFields.add("PinsCount"); + openapiFields.add("BoardsCount"); + openapiFields.add("LikesCount"); + openapiFields.add("EmailVerifiedFromSocial"); + openapiFields.add("SignupDate"); + openapiFields.add("LastLoginDate"); + openapiFields.add("CustomFields"); + openapiFields.add("LastPasswordChangeDate"); + openapiFields.add("PasswordExpirationDate"); + openapiFields.add("LastPasswordChangeToken"); + openapiFields.add("EmailVerified"); + openapiFields.add("IsActive"); + openapiFields.add("IsDeleted"); + openapiFields.add("IsEmailSubscribed"); + openapiFields.add("UserName"); + openapiFields.add("NoOfLogins"); + openapiFields.add("PreviousUids"); + openapiFields.add("PhoneId"); + openapiFields.add("PhoneIdVerified"); + openapiFields.add("Roles"); + openapiFields.add("ExternalUserLoginId"); + openapiFields.add("FailedLoginAttempt"); + openapiFields.add("SecurityQuestionFailedResetPasswordAttempts"); + openapiFields.add("SecurityQuestionFailedLoginAttempt"); + openapiFields.add("DisableLogin"); + openapiFields.add("RegistrationProvider"); + openapiFields.add("IsLoginLocked"); + openapiFields.add("LoginLockedType"); + openapiFields.add("LastLoginLocation"); + openapiFields.add("RegistrationSource"); + openapiFields.add("IsCustomUid"); + openapiFields.add("UnverifiedEmail"); + openapiFields.add("RoleContext"); + openapiFields.add("KnownLoginVariables"); + openapiFields.add("IsSecurePassword"); + openapiFields.add("PrivacyPolicy"); + openapiFields.add("LoginLockedTimeout"); + openapiFields.add("ExternalIds"); + openapiFields.add("IsRequiredFieldsFilledOnce"); + openapiFields.add("SignupLog"); + openapiFields.add("LastAcceptedConsentVersion"); + openapiFields.add("user_agent"); + openapiFields.add("CustomObject"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ExtendUserProfileWithCustomObject + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ExtendUserProfileWithCustomObject.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ExtendUserProfileWithCustomObject is not found in the empty JSON string", ExtendUserProfileWithCustomObject.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("AppName") != null && !jsonObj.get("AppName").isJsonNull()) && !jsonObj.get("AppName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AppName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AppName").toString())); + } + if ((jsonObj.get("Uid") != null && !jsonObj.get("Uid").isJsonNull()) && !jsonObj.get("Uid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Uid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Uid").toString())); + } + if ((jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonNull()) && !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("Provider") != null && !jsonObj.get("Provider").isJsonNull()) && !jsonObj.get("Provider").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Provider` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Provider").toString())); + } + if ((jsonObj.get("Prefix") != null && !jsonObj.get("Prefix").isJsonNull()) && !jsonObj.get("Prefix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Prefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Prefix").toString())); + } + if ((jsonObj.get("FirstName") != null && !jsonObj.get("FirstName").isJsonNull()) && !jsonObj.get("FirstName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FirstName").toString())); + } + if ((jsonObj.get("MiddleName") != null && !jsonObj.get("MiddleName").isJsonNull()) && !jsonObj.get("MiddleName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MiddleName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MiddleName").toString())); + } + if ((jsonObj.get("LastName") != null && !jsonObj.get("LastName").isJsonNull()) && !jsonObj.get("LastName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastName").toString())); + } + if ((jsonObj.get("Suffix") != null && !jsonObj.get("Suffix").isJsonNull()) && !jsonObj.get("Suffix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Suffix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Suffix").toString())); + } + if ((jsonObj.get("FullName") != null && !jsonObj.get("FullName").isJsonNull()) && !jsonObj.get("FullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FullName").toString())); + } + if ((jsonObj.get("NickName") != null && !jsonObj.get("NickName").isJsonNull()) && !jsonObj.get("NickName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NickName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NickName").toString())); + } + if ((jsonObj.get("ProfileName") != null && !jsonObj.get("ProfileName").isJsonNull()) && !jsonObj.get("ProfileName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileName").toString())); + } + if ((jsonObj.get("Gender") != null && !jsonObj.get("Gender").isJsonNull()) && !jsonObj.get("Gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Gender").toString())); + } + if ((jsonObj.get("Website") != null && !jsonObj.get("Website").isJsonNull()) && !jsonObj.get("Website").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Website` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Website").toString())); + } + // validate the optional field `Email` + if (jsonObj.get("Email") != null && !jsonObj.get("Email").isJsonNull()) { + UserProfileEmail.validateJsonElement(jsonObj.get("Email")); + } + // validate the optional field `Country` + if (jsonObj.get("Country") != null && !jsonObj.get("Country").isJsonNull()) { + UserProfileCountry.validateJsonElement(jsonObj.get("Country")); + } + if ((jsonObj.get("ThumbnailImageUrl") != null && !jsonObj.get("ThumbnailImageUrl").isJsonNull()) && !jsonObj.get("ThumbnailImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ThumbnailImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ThumbnailImageUrl").toString())); + } + // validate the optional field `ImageUrl` + if (jsonObj.get("ImageUrl") != null && !jsonObj.get("ImageUrl").isJsonNull()) { + UserProfileImageUrl.validateJsonElement(jsonObj.get("ImageUrl")); + } + // validate the optional field `Favicon` + if (jsonObj.get("Favicon") != null && !jsonObj.get("Favicon").isJsonNull()) { + UserProfileFavicon.validateJsonElement(jsonObj.get("Favicon")); + } + // validate the optional field `ProfileUrl` + if (jsonObj.get("ProfileUrl") != null && !jsonObj.get("ProfileUrl").isJsonNull()) { + UserProfileProfileUrl.validateJsonElement(jsonObj.get("ProfileUrl")); + } + if ((jsonObj.get("HomeTown") != null && !jsonObj.get("HomeTown").isJsonNull()) && !jsonObj.get("HomeTown").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HomeTown` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HomeTown").toString())); + } + if ((jsonObj.get("State") != null && !jsonObj.get("State").isJsonNull()) && !jsonObj.get("State").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `State` to be a primitive type in the JSON string but got `%s`", jsonObj.get("State").toString())); + } + if ((jsonObj.get("City") != null && !jsonObj.get("City").isJsonNull()) && !jsonObj.get("City").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `City` to be a primitive type in the JSON string but got `%s`", jsonObj.get("City").toString())); + } + if ((jsonObj.get("Industry") != null && !jsonObj.get("Industry").isJsonNull()) && !jsonObj.get("Industry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Industry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Industry").toString())); + } + if ((jsonObj.get("About") != null && !jsonObj.get("About").isJsonNull()) && !jsonObj.get("About").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `About` to be a primitive type in the JSON string but got `%s`", jsonObj.get("About").toString())); + } + if ((jsonObj.get("TimeZone") != null && !jsonObj.get("TimeZone").isJsonNull()) && !jsonObj.get("TimeZone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TimeZone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TimeZone").toString())); + } + if ((jsonObj.get("LocalLanguage") != null && !jsonObj.get("LocalLanguage").isJsonNull()) && !jsonObj.get("LocalLanguage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalLanguage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalLanguage").toString())); + } + // validate the optional field `CoverPhoto` + if (jsonObj.get("CoverPhoto") != null && !jsonObj.get("CoverPhoto").isJsonNull()) { + UserProfileCoverPhoto.validateJsonElement(jsonObj.get("CoverPhoto")); + } + if ((jsonObj.get("TagLine") != null && !jsonObj.get("TagLine").isJsonNull()) && !jsonObj.get("TagLine").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TagLine` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TagLine").toString())); + } + if ((jsonObj.get("Language") != null && !jsonObj.get("Language").isJsonNull()) && !jsonObj.get("Language").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Language` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Language").toString())); + } + if ((jsonObj.get("Verified") != null && !jsonObj.get("Verified").isJsonNull()) && !jsonObj.get("Verified").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Verified` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Verified").toString())); + } + // validate the optional field `Positions` + if (jsonObj.get("Positions") != null && !jsonObj.get("Positions").isJsonNull()) { + UserProfilePositions.validateJsonElement(jsonObj.get("Positions")); + } + // validate the optional field `Educations` + if (jsonObj.get("Educations") != null && !jsonObj.get("Educations").isJsonNull()) { + UserProfileEducations.validateJsonElement(jsonObj.get("Educations")); + } + // validate the optional field `PhoneNumbers` + if (jsonObj.get("PhoneNumbers") != null && !jsonObj.get("PhoneNumbers").isJsonNull()) { + UserProfilePhoneNumbers.validateJsonElement(jsonObj.get("PhoneNumbers")); + } + // validate the optional field `IMAccounts` + if (jsonObj.get("IMAccounts") != null && !jsonObj.get("IMAccounts").isJsonNull()) { + UserProfileIMAccounts.validateJsonElement(jsonObj.get("IMAccounts")); + } + // validate the optional field `Addresses` + if (jsonObj.get("Addresses") != null && !jsonObj.get("Addresses").isJsonNull()) { + UserProfileAddresses.validateJsonElement(jsonObj.get("Addresses")); + } + if ((jsonObj.get("MainAddress") != null && !jsonObj.get("MainAddress").isJsonNull()) && !jsonObj.get("MainAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MainAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MainAddress").toString())); + } + if ((jsonObj.get("LocalCity") != null && !jsonObj.get("LocalCity").isJsonNull()) && !jsonObj.get("LocalCity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalCity").toString())); + } + if ((jsonObj.get("ProfileCity") != null && !jsonObj.get("ProfileCity").isJsonNull()) && !jsonObj.get("ProfileCity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileCity").toString())); + } + if ((jsonObj.get("LocalCountry") != null && !jsonObj.get("LocalCountry").isJsonNull()) && !jsonObj.get("LocalCountry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalCountry").toString())); + } + if ((jsonObj.get("ProfileCountry") != null && !jsonObj.get("ProfileCountry").isJsonNull()) && !jsonObj.get("ProfileCountry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileCountry").toString())); + } + if ((jsonObj.get("RelationshipStatus") != null && !jsonObj.get("RelationshipStatus").isJsonNull()) && !jsonObj.get("RelationshipStatus").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RelationshipStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RelationshipStatus").toString())); + } + if ((jsonObj.get("Quota") != null && !jsonObj.get("Quota").isJsonNull()) && !jsonObj.get("Quota").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Quota` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Quota").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("InterestedIn") != null && !jsonObj.get("InterestedIn").isJsonNull() && !jsonObj.get("InterestedIn").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `InterestedIn` to be an array in the JSON string but got `%s`", jsonObj.get("InterestedIn").toString())); + } + // validate the optional field `Interests` + if (jsonObj.get("Interests") != null && !jsonObj.get("Interests").isJsonNull()) { + UserProfileInterests.validateJsonElement(jsonObj.get("Interests")); + } + if ((jsonObj.get("Religion") != null && !jsonObj.get("Religion").isJsonNull()) && !jsonObj.get("Religion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Religion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Religion").toString())); + } + if ((jsonObj.get("Political") != null && !jsonObj.get("Political").isJsonNull()) && !jsonObj.get("Political").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Political` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Political").toString())); + } + // validate the optional field `Sports` + if (jsonObj.get("Sports") != null && !jsonObj.get("Sports").isJsonNull()) { + UserProfileSports.validateJsonElement(jsonObj.get("Sports")); + } + // validate the optional field `InspirationalPeople` + if (jsonObj.get("InspirationalPeople") != null && !jsonObj.get("InspirationalPeople").isJsonNull()) { + UserProfileInspirationalPeople.validateJsonElement(jsonObj.get("InspirationalPeople")); + } + // validate the optional field `HttpsImageUrl` + if (jsonObj.get("HttpsImageUrl") != null && !jsonObj.get("HttpsImageUrl").isJsonNull()) { + UserProfileHttpsImageUrl.validateJsonElement(jsonObj.get("HttpsImageUrl")); + } + if ((jsonObj.get("IsGeoEnabled") != null && !jsonObj.get("IsGeoEnabled").isJsonNull()) && !jsonObj.get("IsGeoEnabled").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IsGeoEnabled` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IsGeoEnabled").toString())); + } + if ((jsonObj.get("Associations") != null && !jsonObj.get("Associations").isJsonNull()) && !jsonObj.get("Associations").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Associations` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Associations").toString())); + } + if ((jsonObj.get("Honors") != null && !jsonObj.get("Honors").isJsonNull()) && !jsonObj.get("Honors").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Honors` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Honors").toString())); + } + // validate the optional field `Awards` + if (jsonObj.get("Awards") != null && !jsonObj.get("Awards").isJsonNull()) { + UserProfileAwards.validateJsonElement(jsonObj.get("Awards")); + } + // validate the optional field `Skills` + if (jsonObj.get("Skills") != null && !jsonObj.get("Skills").isJsonNull()) { + UserProfileSkills.validateJsonElement(jsonObj.get("Skills")); + } + // validate the optional field `CurrentStatus` + if (jsonObj.get("CurrentStatus") != null && !jsonObj.get("CurrentStatus").isJsonNull()) { + UserProfileCurrentStatus.validateJsonElement(jsonObj.get("CurrentStatus")); + } + // validate the optional field `Certifications` + if (jsonObj.get("Certifications") != null && !jsonObj.get("Certifications").isJsonNull()) { + UserProfileCertifications.validateJsonElement(jsonObj.get("Certifications")); + } + // validate the optional field `Courses` + if (jsonObj.get("Courses") != null && !jsonObj.get("Courses").isJsonNull()) { + UserProfileCourses.validateJsonElement(jsonObj.get("Courses")); + } + // validate the optional field `Volunteer` + if (jsonObj.get("Volunteer") != null && !jsonObj.get("Volunteer").isJsonNull()) { + UserProfileVolunteer.validateJsonElement(jsonObj.get("Volunteer")); + } + // validate the optional field `RecommendationsReceived` + if (jsonObj.get("RecommendationsReceived") != null && !jsonObj.get("RecommendationsReceived").isJsonNull()) { + UserProfileRecommendationsReceived.validateJsonElement(jsonObj.get("RecommendationsReceived")); + } + // validate the optional field `Languages` + if (jsonObj.get("Languages") != null && !jsonObj.get("Languages").isJsonNull()) { + UserProfileLanguages.validateJsonElement(jsonObj.get("Languages")); + } + // validate the optional field `Projects` + if (jsonObj.get("Projects") != null && !jsonObj.get("Projects").isJsonNull()) { + UserProfileProjects.validateJsonElement(jsonObj.get("Projects")); + } + // validate the optional field `Games` + if (jsonObj.get("Games") != null && !jsonObj.get("Games").isJsonNull()) { + UserProfileGames.validateJsonElement(jsonObj.get("Games")); + } + // validate the optional field `Family` + if (jsonObj.get("Family") != null && !jsonObj.get("Family").isJsonNull()) { + UserProfileFamily.validateJsonElement(jsonObj.get("Family")); + } + // validate the optional field `TeleVisionShow` + if (jsonObj.get("TeleVisionShow") != null && !jsonObj.get("TeleVisionShow").isJsonNull()) { + UserProfileTeleVisionShow.validateJsonElement(jsonObj.get("TeleVisionShow")); + } + // validate the optional field `MutualFriends` + if (jsonObj.get("MutualFriends") != null && !jsonObj.get("MutualFriends").isJsonNull()) { + UserProfileMutualFriends.validateJsonElement(jsonObj.get("MutualFriends")); + } + // validate the optional field `Movies` + if (jsonObj.get("Movies") != null && !jsonObj.get("Movies").isJsonNull()) { + UserProfileMovies.validateJsonElement(jsonObj.get("Movies")); + } + // validate the optional field `Books` + if (jsonObj.get("Books") != null && !jsonObj.get("Books").isJsonNull()) { + UserProfileBooks.validateJsonElement(jsonObj.get("Books")); + } + // validate the optional field `AgeRange` + if (jsonObj.get("AgeRange") != null && !jsonObj.get("AgeRange").isJsonNull()) { + UserProfileAgeRange.validateJsonElement(jsonObj.get("AgeRange")); + } + // validate the optional field `PublicRepository` + if (jsonObj.get("PublicRepository") != null && !jsonObj.get("PublicRepository").isJsonNull()) { + UserProfilePublicRepository.validateJsonElement(jsonObj.get("PublicRepository")); + } + // validate the optional field `RepositoryUrl` + if (jsonObj.get("RepositoryUrl") != null && !jsonObj.get("RepositoryUrl").isJsonNull()) { + UserProfileRepositoryUrl.validateJsonElement(jsonObj.get("RepositoryUrl")); + } + // validate the optional field `Patents` + if (jsonObj.get("Patents") != null && !jsonObj.get("Patents").isJsonNull()) { + UserProfilePatents.validateJsonElement(jsonObj.get("Patents")); + } + // validate the optional field `FavoriteThings` + if (jsonObj.get("FavoriteThings") != null && !jsonObj.get("FavoriteThings").isJsonNull()) { + UserProfileFavoriteThings.validateJsonElement(jsonObj.get("FavoriteThings")); + } + if ((jsonObj.get("ProfessionalHeadline") != null && !jsonObj.get("ProfessionalHeadline").isJsonNull()) && !jsonObj.get("ProfessionalHeadline").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfessionalHeadline` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfessionalHeadline").toString())); + } + // validate the optional field `RelatedProfileViews` + if (jsonObj.get("RelatedProfileViews") != null && !jsonObj.get("RelatedProfileViews").isJsonNull()) { + UserProfileRelatedProfileViews.validateJsonElement(jsonObj.get("RelatedProfileViews")); + } + // validate the optional field `KloutScore` + if (jsonObj.get("KloutScore") != null && !jsonObj.get("KloutScore").isJsonNull()) { + UserProfileKloutScore.validateJsonElement(jsonObj.get("KloutScore")); + } + if ((jsonObj.get("LRUserID") != null && !jsonObj.get("LRUserID").isJsonNull()) && !jsonObj.get("LRUserID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LRUserID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LRUserID").toString())); + } + // validate the optional field `PlacesLived` + if (jsonObj.get("PlacesLived") != null && !jsonObj.get("PlacesLived").isJsonNull()) { + UserProfilePlacesLived.validateJsonElement(jsonObj.get("PlacesLived")); + } + // validate the optional field `Publications` + if (jsonObj.get("Publications") != null && !jsonObj.get("Publications").isJsonNull()) { + UserProfilePublications.validateJsonElement(jsonObj.get("Publications")); + } + // validate the optional field `JobBookmarks` + if (jsonObj.get("JobBookmarks") != null && !jsonObj.get("JobBookmarks").isJsonNull()) { + UserProfileJobBookmarks.validateJsonElement(jsonObj.get("JobBookmarks")); + } + // validate the optional field `Suggestions` + if (jsonObj.get("Suggestions") != null && !jsonObj.get("Suggestions").isJsonNull()) { + UserProfileSuggestions.validateJsonElement(jsonObj.get("Suggestions")); + } + // validate the optional field `Badges` + if (jsonObj.get("Badges") != null && !jsonObj.get("Badges").isJsonNull()) { + UserProfileBadges.validateJsonElement(jsonObj.get("Badges")); + } + // validate the optional field `MemberUrlResources` + if (jsonObj.get("MemberUrlResources") != null && !jsonObj.get("MemberUrlResources").isJsonNull()) { + UserProfileMemberUrlResources.validateJsonElement(jsonObj.get("MemberUrlResources")); + } + if ((jsonObj.get("Currency") != null && !jsonObj.get("Currency").isJsonNull()) && !jsonObj.get("Currency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Currency").toString())); + } + // validate the optional field `StarredUrl` + if (jsonObj.get("StarredUrl") != null && !jsonObj.get("StarredUrl").isJsonNull()) { + UserProfileStarredUrl.validateJsonElement(jsonObj.get("StarredUrl")); + } + // validate the optional field `GistsUrl` + if (jsonObj.get("GistsUrl") != null && !jsonObj.get("GistsUrl").isJsonNull()) { + UserProfileGistsUrl.validateJsonElement(jsonObj.get("GistsUrl")); + } + // validate the optional field `Subscription` + if (jsonObj.get("Subscription") != null && !jsonObj.get("Subscription").isJsonNull()) { + UserProfileSubscription.validateJsonElement(jsonObj.get("Subscription")); + } + if ((jsonObj.get("Company") != null && !jsonObj.get("Company").isJsonNull()) && !jsonObj.get("Company").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Company` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Company").toString())); + } + // validate the optional field `GravatarImageUrl` + if (jsonObj.get("GravatarImageUrl") != null && !jsonObj.get("GravatarImageUrl").isJsonNull()) { + UserProfileGravatarImageUrl.validateJsonElement(jsonObj.get("GravatarImageUrl")); + } + // validate the optional field `ProfileImageUrls` + if (jsonObj.get("ProfileImageUrls") != null && !jsonObj.get("ProfileImageUrls").isJsonNull()) { + UserProfileProfileImageUrls.validateJsonElement(jsonObj.get("ProfileImageUrls")); + } + // validate the optional field `WebProfiles` + if (jsonObj.get("WebProfiles") != null && !jsonObj.get("WebProfiles").isJsonNull()) { + UserProfileWebProfiles.validateJsonElement(jsonObj.get("WebProfiles")); + } + // validate the optional field `CustomFields` + if (jsonObj.get("CustomFields") != null && !jsonObj.get("CustomFields").isJsonNull()) { + UserProfileCustomFields.validateJsonElement(jsonObj.get("CustomFields")); + } + if ((jsonObj.get("LastPasswordChangeToken") != null && !jsonObj.get("LastPasswordChangeToken").isJsonNull()) && !jsonObj.get("LastPasswordChangeToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastPasswordChangeToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastPasswordChangeToken").toString())); + } + if ((jsonObj.get("UserName") != null && !jsonObj.get("UserName").isJsonNull()) && !jsonObj.get("UserName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UserName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UserName").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("PreviousUids") != null && !jsonObj.get("PreviousUids").isJsonNull() && !jsonObj.get("PreviousUids").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PreviousUids` to be an array in the JSON string but got `%s`", jsonObj.get("PreviousUids").toString())); + } + if ((jsonObj.get("PhoneId") != null && !jsonObj.get("PhoneId").isJsonNull()) && !jsonObj.get("PhoneId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PhoneId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PhoneId").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("Roles") != null && !jsonObj.get("Roles").isJsonNull() && !jsonObj.get("Roles").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Roles` to be an array in the JSON string but got `%s`", jsonObj.get("Roles").toString())); + } + if ((jsonObj.get("ExternalUserLoginId") != null && !jsonObj.get("ExternalUserLoginId").isJsonNull()) && !jsonObj.get("ExternalUserLoginId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ExternalUserLoginId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ExternalUserLoginId").toString())); + } + if ((jsonObj.get("RegistrationProvider") != null && !jsonObj.get("RegistrationProvider").isJsonNull()) && !jsonObj.get("RegistrationProvider").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RegistrationProvider` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RegistrationProvider").toString())); + } + if ((jsonObj.get("LoginLockedType") != null && !jsonObj.get("LoginLockedType").isJsonNull()) && !jsonObj.get("LoginLockedType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LoginLockedType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LoginLockedType").toString())); + } + if ((jsonObj.get("LastLoginLocation") != null && !jsonObj.get("LastLoginLocation").isJsonNull()) && !jsonObj.get("LastLoginLocation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastLoginLocation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastLoginLocation").toString())); + } + if ((jsonObj.get("RegistrationSource") != null && !jsonObj.get("RegistrationSource").isJsonNull()) && !jsonObj.get("RegistrationSource").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RegistrationSource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RegistrationSource").toString())); + } + // validate the optional field `UnverifiedEmail` + if (jsonObj.get("UnverifiedEmail") != null && !jsonObj.get("UnverifiedEmail").isJsonNull()) { + UserProfileUnverifiedEmail.validateJsonElement(jsonObj.get("UnverifiedEmail")); + } + // validate the optional field `RoleContext` + if (jsonObj.get("RoleContext") != null && !jsonObj.get("RoleContext").isJsonNull()) { + UserProfileRoleContext.validateJsonElement(jsonObj.get("RoleContext")); + } + // validate the optional field `KnownLoginVariables` + if (jsonObj.get("KnownLoginVariables") != null && !jsonObj.get("KnownLoginVariables").isJsonNull()) { + UserProfileKnownLoginVariables.validateJsonElement(jsonObj.get("KnownLoginVariables")); + } + // validate the optional field `PrivacyPolicy` + if (jsonObj.get("PrivacyPolicy") != null && !jsonObj.get("PrivacyPolicy").isJsonNull()) { + UserProfilePrivacyPolicy.validateJsonElement(jsonObj.get("PrivacyPolicy")); + } + if ((jsonObj.get("LoginLockedTimeout") != null && !jsonObj.get("LoginLockedTimeout").isJsonNull()) && !jsonObj.get("LoginLockedTimeout").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LoginLockedTimeout` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LoginLockedTimeout").toString())); + } + // validate the optional field `ExternalIds` + if (jsonObj.get("ExternalIds") != null && !jsonObj.get("ExternalIds").isJsonNull()) { + UserProfileExternalIds.validateJsonElement(jsonObj.get("ExternalIds")); + } + // validate the optional field `SignupLog` + if (jsonObj.get("SignupLog") != null && !jsonObj.get("SignupLog").isJsonNull()) { + UserProfileSignupLog.validateJsonElement(jsonObj.get("SignupLog")); + } + // validate the optional field `user_agent` + if (jsonObj.get("user_agent") != null && !jsonObj.get("user_agent").isJsonNull()) { + UserProfileUserAgent.validateJsonElement(jsonObj.get("user_agent")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ExtendUserProfileWithCustomObject.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ExtendUserProfileWithCustomObject' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ExtendUserProfileWithCustomObject> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ExtendUserProfileWithCustomObject.class)); + + return (TypeAdapter<T>) new TypeAdapter<ExtendUserProfileWithCustomObject>() { + @Override + public void write(JsonWriter out, ExtendUserProfileWithCustomObject value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ExtendUserProfileWithCustomObject read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ExtendUserProfileWithCustomObject instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ExtendUserProfileWithCustomObject given an JSON string + * + * @param jsonString JSON string + * @return An instance of ExtendUserProfileWithCustomObject + * @throws IOException if the JSON string is invalid with respect to ExtendUserProfileWithCustomObject + */ + public static ExtendUserProfileWithCustomObject fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ExtendUserProfileWithCustomObject.class); + } + + /** + * Convert an instance of ExtendUserProfileWithCustomObject to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ExtendUserProfileWithCustomObjectCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ExtendUserProfileWithCustomObjectCore.java new file mode 100644 index 0000000..fa6ee08 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ExtendUserProfileWithCustomObjectCore.java @@ -0,0 +1,294 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ExtendUserProfileWithCustomObjectCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ExtendUserProfileWithCustomObjectCore { + public static final String SERIALIZED_NAME_CUSTOM_OBJECT = "CustomObject"; + @SerializedName(SERIALIZED_NAME_CUSTOM_OBJECT) + @javax.annotation.Nullable + private Map<String, Object> customObject = new HashMap<>(); + + public ExtendUserProfileWithCustomObjectCore() { + } + + public ExtendUserProfileWithCustomObjectCore customObject(@javax.annotation.Nullable Map<String, Object> customObject) { + this.customObject = customObject; + return this; + } + + public ExtendUserProfileWithCustomObjectCore putCustomObjectItem(String key, Object customObjectItem) { + if (this.customObject == null) { + this.customObject = new HashMap<>(); + } + this.customObject.put(key, customObjectItem); + return this; + } + + /** + * Custom Object associated with the User profile. + * @return customObject + */ + @javax.annotation.Nullable + public Map<String, Object> getCustomObject() { + return customObject; + } + + public void setCustomObject(@javax.annotation.Nullable Map<String, Object> customObject) { + this.customObject = customObject; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ExtendUserProfileWithCustomObjectCore instance itself + */ + public ExtendUserProfileWithCustomObjectCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ExtendUserProfileWithCustomObjectCore extendUserProfileWithCustomObjectCore = (ExtendUserProfileWithCustomObjectCore) o; + return Objects.equals(this.customObject, extendUserProfileWithCustomObjectCore.customObject)&& + Objects.equals(this.additionalProperties, extendUserProfileWithCustomObjectCore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(customObject, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ExtendUserProfileWithCustomObjectCore {\n"); + sb.append(" customObject: ").append(toIndentedString(customObject)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("CustomObject"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ExtendUserProfileWithCustomObjectCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ExtendUserProfileWithCustomObjectCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ExtendUserProfileWithCustomObjectCore is not found in the empty JSON string", ExtendUserProfileWithCustomObjectCore.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ExtendUserProfileWithCustomObjectCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ExtendUserProfileWithCustomObjectCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ExtendUserProfileWithCustomObjectCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ExtendUserProfileWithCustomObjectCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<ExtendUserProfileWithCustomObjectCore>() { + @Override + public void write(JsonWriter out, ExtendUserProfileWithCustomObjectCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ExtendUserProfileWithCustomObjectCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ExtendUserProfileWithCustomObjectCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ExtendUserProfileWithCustomObjectCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of ExtendUserProfileWithCustomObjectCore + * @throws IOException if the JSON string is invalid with respect to ExtendUserProfileWithCustomObjectCore + */ + public static ExtendUserProfileWithCustomObjectCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ExtendUserProfileWithCustomObjectCore.class); + } + + /** + * Convert an instance of ExtendUserProfileWithCustomObjectCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/FinishMFAPasskeyRegistrationRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/FinishMFAPasskeyRegistrationRequest.java new file mode 100644 index 0000000..0c5c006 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/FinishMFAPasskeyRegistrationRequest.java @@ -0,0 +1,289 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.PasskeyCredentialCreationResponse; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Passkey Credentials to finish Passkey registration (WebAuthn) + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class FinishMFAPasskeyRegistrationRequest { + public static final String SERIALIZED_NAME_PASSKEY_CREDENTIAL = "PasskeyCredential"; + @SerializedName(SERIALIZED_NAME_PASSKEY_CREDENTIAL) + @javax.annotation.Nullable + private PasskeyCredentialCreationResponse passkeyCredential; + + public FinishMFAPasskeyRegistrationRequest() { + } + + public FinishMFAPasskeyRegistrationRequest passkeyCredential(@javax.annotation.Nullable PasskeyCredentialCreationResponse passkeyCredential) { + this.passkeyCredential = passkeyCredential; + return this; + } + + /** + * Get passkeyCredential + * @return passkeyCredential + */ + @javax.annotation.Nullable + public PasskeyCredentialCreationResponse getPasskeyCredential() { + return passkeyCredential; + } + + public void setPasskeyCredential(@javax.annotation.Nullable PasskeyCredentialCreationResponse passkeyCredential) { + this.passkeyCredential = passkeyCredential; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the FinishMFAPasskeyRegistrationRequest instance itself + */ + public FinishMFAPasskeyRegistrationRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FinishMFAPasskeyRegistrationRequest finishMFAPasskeyRegistrationRequest = (FinishMFAPasskeyRegistrationRequest) o; + return Objects.equals(this.passkeyCredential, finishMFAPasskeyRegistrationRequest.passkeyCredential)&& + Objects.equals(this.additionalProperties, finishMFAPasskeyRegistrationRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(passkeyCredential, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FinishMFAPasskeyRegistrationRequest {\n"); + sb.append(" passkeyCredential: ").append(toIndentedString(passkeyCredential)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("PasskeyCredential"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 FinishMFAPasskeyRegistrationRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FinishMFAPasskeyRegistrationRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in FinishMFAPasskeyRegistrationRequest is not found in the empty JSON string", FinishMFAPasskeyRegistrationRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `PasskeyCredential` + if (jsonObj.get("PasskeyCredential") != null && !jsonObj.get("PasskeyCredential").isJsonNull()) { + PasskeyCredentialCreationResponse.validateJsonElement(jsonObj.get("PasskeyCredential")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!FinishMFAPasskeyRegistrationRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FinishMFAPasskeyRegistrationRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<FinishMFAPasskeyRegistrationRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FinishMFAPasskeyRegistrationRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<FinishMFAPasskeyRegistrationRequest>() { + @Override + public void write(JsonWriter out, FinishMFAPasskeyRegistrationRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public FinishMFAPasskeyRegistrationRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + FinishMFAPasskeyRegistrationRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FinishMFAPasskeyRegistrationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of FinishMFAPasskeyRegistrationRequest + * @throws IOException if the JSON string is invalid with respect to FinishMFAPasskeyRegistrationRequest + */ + public static FinishMFAPasskeyRegistrationRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FinishMFAPasskeyRegistrationRequest.class); + } + + /** + * Convert an instance of FinishMFAPasskeyRegistrationRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/FinishPasskeyMFAVerificationRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/FinishPasskeyMFAVerificationRequest.java new file mode 100644 index 0000000..c4d1054 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/FinishPasskeyMFAVerificationRequest.java @@ -0,0 +1,289 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.PasskeyCredentialAssertionResponse; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Passkey Credentials to finish Passkey verify (WebAuthn) + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class FinishPasskeyMFAVerificationRequest { + public static final String SERIALIZED_NAME_PASSKEY_CREDENTIAL = "PasskeyCredential"; + @SerializedName(SERIALIZED_NAME_PASSKEY_CREDENTIAL) + @javax.annotation.Nullable + private PasskeyCredentialAssertionResponse passkeyCredential; + + public FinishPasskeyMFAVerificationRequest() { + } + + public FinishPasskeyMFAVerificationRequest passkeyCredential(@javax.annotation.Nullable PasskeyCredentialAssertionResponse passkeyCredential) { + this.passkeyCredential = passkeyCredential; + return this; + } + + /** + * Get passkeyCredential + * @return passkeyCredential + */ + @javax.annotation.Nullable + public PasskeyCredentialAssertionResponse getPasskeyCredential() { + return passkeyCredential; + } + + public void setPasskeyCredential(@javax.annotation.Nullable PasskeyCredentialAssertionResponse passkeyCredential) { + this.passkeyCredential = passkeyCredential; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the FinishPasskeyMFAVerificationRequest instance itself + */ + public FinishPasskeyMFAVerificationRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FinishPasskeyMFAVerificationRequest finishPasskeyMFAVerificationRequest = (FinishPasskeyMFAVerificationRequest) o; + return Objects.equals(this.passkeyCredential, finishPasskeyMFAVerificationRequest.passkeyCredential)&& + Objects.equals(this.additionalProperties, finishPasskeyMFAVerificationRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(passkeyCredential, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FinishPasskeyMFAVerificationRequest {\n"); + sb.append(" passkeyCredential: ").append(toIndentedString(passkeyCredential)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("PasskeyCredential"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 FinishPasskeyMFAVerificationRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!FinishPasskeyMFAVerificationRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in FinishPasskeyMFAVerificationRequest is not found in the empty JSON string", FinishPasskeyMFAVerificationRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `PasskeyCredential` + if (jsonObj.get("PasskeyCredential") != null && !jsonObj.get("PasskeyCredential").isJsonNull()) { + PasskeyCredentialAssertionResponse.validateJsonElement(jsonObj.get("PasskeyCredential")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!FinishPasskeyMFAVerificationRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'FinishPasskeyMFAVerificationRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<FinishPasskeyMFAVerificationRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(FinishPasskeyMFAVerificationRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<FinishPasskeyMFAVerificationRequest>() { + @Override + public void write(JsonWriter out, FinishPasskeyMFAVerificationRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public FinishPasskeyMFAVerificationRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + FinishPasskeyMFAVerificationRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of FinishPasskeyMFAVerificationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of FinishPasskeyMFAVerificationRequest + * @throws IOException if the JSON string is invalid with respect to FinishPasskeyMFAVerificationRequest + */ + public static FinishPasskeyMFAVerificationRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, FinishPasskeyMFAVerificationRequest.class); + } + + /** + * Convert an instance of FinishPasskeyMFAVerificationRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ForgotPasswordOrPasswordLessLoginOrAutoLoginModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ForgotPasswordOrPasswordLessLoginOrAutoLoginModel.java new file mode 100644 index 0000000..76d2baf --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ForgotPasswordOrPasswordLessLoginOrAutoLoginModel.java @@ -0,0 +1,315 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ForgotPasswordOrPasswordLessLoginOrAutoLoginModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ForgotPasswordOrPasswordLessLoginOrAutoLoginModel { + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private String email; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nullable + private String username; + + public ForgotPasswordOrPasswordLessLoginOrAutoLoginModel() { + } + + public ForgotPasswordOrPasswordLessLoginOrAutoLoginModel email(@javax.annotation.Nullable String email) { + this.email = email; + return this; + } + + /** + * The Email address of the User. + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable String email) { + this.email = email; + } + + + public ForgotPasswordOrPasswordLessLoginOrAutoLoginModel username(@javax.annotation.Nullable String username) { + this.username = username; + return this; + } + + /** + * The Username of the User. + * @return username + */ + @javax.annotation.Nullable + public String getUsername() { + return username; + } + + public void setUsername(@javax.annotation.Nullable String username) { + this.username = username; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ForgotPasswordOrPasswordLessLoginOrAutoLoginModel instance itself + */ + public ForgotPasswordOrPasswordLessLoginOrAutoLoginModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ForgotPasswordOrPasswordLessLoginOrAutoLoginModel forgotPasswordOrPasswordLessLoginOrAutoLoginModel = (ForgotPasswordOrPasswordLessLoginOrAutoLoginModel) o; + return Objects.equals(this.email, forgotPasswordOrPasswordLessLoginOrAutoLoginModel.email) && + Objects.equals(this.username, forgotPasswordOrPasswordLessLoginOrAutoLoginModel.username)&& + Objects.equals(this.additionalProperties, forgotPasswordOrPasswordLessLoginOrAutoLoginModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, username, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ForgotPasswordOrPasswordLessLoginOrAutoLoginModel {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ForgotPasswordOrPasswordLessLoginOrAutoLoginModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ForgotPasswordOrPasswordLessLoginOrAutoLoginModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ForgotPasswordOrPasswordLessLoginOrAutoLoginModel is not found in the empty JSON string", ForgotPasswordOrPasswordLessLoginOrAutoLoginModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("username") != null && !jsonObj.get("username").isJsonNull()) && !jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ForgotPasswordOrPasswordLessLoginOrAutoLoginModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ForgotPasswordOrPasswordLessLoginOrAutoLoginModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ForgotPasswordOrPasswordLessLoginOrAutoLoginModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ForgotPasswordOrPasswordLessLoginOrAutoLoginModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<ForgotPasswordOrPasswordLessLoginOrAutoLoginModel>() { + @Override + public void write(JsonWriter out, ForgotPasswordOrPasswordLessLoginOrAutoLoginModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ForgotPasswordOrPasswordLessLoginOrAutoLoginModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ForgotPasswordOrPasswordLessLoginOrAutoLoginModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ForgotPasswordOrPasswordLessLoginOrAutoLoginModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ForgotPasswordOrPasswordLessLoginOrAutoLoginModel + * @throws IOException if the JSON string is invalid with respect to ForgotPasswordOrPasswordLessLoginOrAutoLoginModel + */ + public static ForgotPasswordOrPasswordLessLoginOrAutoLoginModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ForgotPasswordOrPasswordLessLoginOrAutoLoginModel.class); + } + + /** + * Convert an instance of ForgotPasswordOrPasswordLessLoginOrAutoLoginModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ForgotPasswordPhoneModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ForgotPasswordPhoneModel.java new file mode 100644 index 0000000..ab5f7f5 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ForgotPasswordPhoneModel.java @@ -0,0 +1,427 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ForgotPasswordPhoneModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ForgotPasswordPhoneModel { + public static final String SERIALIZED_NAME_PHONE = "Phone"; + @SerializedName(SERIALIZED_NAME_PHONE) + @javax.annotation.Nonnull + private String phone; + + public static final String SERIALIZED_NAME_G_RECAPTCHA_RESPONSE = "g-recaptcha-response"; + @SerializedName(SERIALIZED_NAME_G_RECAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String gRecaptchaResponse; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_TICKET = "qq_captcha_ticket"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_TICKET) + @javax.annotation.Nullable + private String qqCaptchaTicket; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR = "qq_captcha_randstr"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR) + @javax.annotation.Nullable + private String qqCaptchaRandstr; + + public static final String SERIALIZED_NAME_H_CAPTCHA_RESPONSE = "h-captcha-response"; + @SerializedName(SERIALIZED_NAME_H_CAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String hCaptchaResponse; + + public ForgotPasswordPhoneModel() { + } + + public ForgotPasswordPhoneModel phone(@javax.annotation.Nonnull String phone) { + this.phone = phone; + return this; + } + + /** + * Phone number associated with the Account for Password reset. + * @return phone + */ + @javax.annotation.Nonnull + public String getPhone() { + return phone; + } + + public void setPhone(@javax.annotation.Nonnull String phone) { + this.phone = phone; + } + + + public ForgotPasswordPhoneModel gRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + return this; + } + + /** + * Get gRecaptchaResponse + * @return gRecaptchaResponse + */ + @javax.annotation.Nullable + public String getgRecaptchaResponse() { + return gRecaptchaResponse; + } + + public void setgRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + } + + + public ForgotPasswordPhoneModel qqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + return this; + } + + /** + * Get qqCaptchaTicket + * @return qqCaptchaTicket + */ + @javax.annotation.Nullable + public String getQqCaptchaTicket() { + return qqCaptchaTicket; + } + + public void setQqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + } + + + public ForgotPasswordPhoneModel qqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + return this; + } + + /** + * Get qqCaptchaRandstr + * @return qqCaptchaRandstr + */ + @javax.annotation.Nullable + public String getQqCaptchaRandstr() { + return qqCaptchaRandstr; + } + + public void setQqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + } + + + public ForgotPasswordPhoneModel hCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + return this; + } + + /** + * Get hCaptchaResponse + * @return hCaptchaResponse + */ + @javax.annotation.Nullable + public String gethCaptchaResponse() { + return hCaptchaResponse; + } + + public void sethCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ForgotPasswordPhoneModel instance itself + */ + public ForgotPasswordPhoneModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ForgotPasswordPhoneModel forgotPasswordPhoneModel = (ForgotPasswordPhoneModel) o; + return Objects.equals(this.phone, forgotPasswordPhoneModel.phone) && + Objects.equals(this.gRecaptchaResponse, forgotPasswordPhoneModel.gRecaptchaResponse) && + Objects.equals(this.qqCaptchaTicket, forgotPasswordPhoneModel.qqCaptchaTicket) && + Objects.equals(this.qqCaptchaRandstr, forgotPasswordPhoneModel.qqCaptchaRandstr) && + Objects.equals(this.hCaptchaResponse, forgotPasswordPhoneModel.hCaptchaResponse)&& + Objects.equals(this.additionalProperties, forgotPasswordPhoneModel.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(phone, gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ForgotPasswordPhoneModel {\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" gRecaptchaResponse: ").append(toIndentedString(gRecaptchaResponse)).append("\n"); + sb.append(" qqCaptchaTicket: ").append(toIndentedString(qqCaptchaTicket)).append("\n"); + sb.append(" qqCaptchaRandstr: ").append(toIndentedString(qqCaptchaRandstr)).append("\n"); + sb.append(" hCaptchaResponse: ").append(toIndentedString(hCaptchaResponse)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Phone"); + openapiFields.add("g-recaptcha-response"); + openapiFields.add("qq_captcha_ticket"); + openapiFields.add("qq_captcha_randstr"); + openapiFields.add("h-captcha-response"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Phone"); + } + + /** + * 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 ForgotPasswordPhoneModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ForgotPasswordPhoneModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ForgotPasswordPhoneModel is not found in the empty JSON string", ForgotPasswordPhoneModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ForgotPasswordPhoneModel.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("Phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Phone").toString())); + } + if ((jsonObj.get("g-recaptcha-response") != null && !jsonObj.get("g-recaptcha-response").isJsonNull()) && !jsonObj.get("g-recaptcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `g-recaptcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("g-recaptcha-response").toString())); + } + if ((jsonObj.get("qq_captcha_ticket") != null && !jsonObj.get("qq_captcha_ticket").isJsonNull()) && !jsonObj.get("qq_captcha_ticket").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_ticket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_ticket").toString())); + } + if ((jsonObj.get("qq_captcha_randstr") != null && !jsonObj.get("qq_captcha_randstr").isJsonNull()) && !jsonObj.get("qq_captcha_randstr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_randstr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_randstr").toString())); + } + if ((jsonObj.get("h-captcha-response") != null && !jsonObj.get("h-captcha-response").isJsonNull()) && !jsonObj.get("h-captcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `h-captcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("h-captcha-response").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ForgotPasswordPhoneModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ForgotPasswordPhoneModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ForgotPasswordPhoneModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ForgotPasswordPhoneModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<ForgotPasswordPhoneModel>() { + @Override + public void write(JsonWriter out, ForgotPasswordPhoneModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ForgotPasswordPhoneModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ForgotPasswordPhoneModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ForgotPasswordPhoneModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ForgotPasswordPhoneModel + * @throws IOException if the JSON string is invalid with respect to ForgotPasswordPhoneModel + */ + public static ForgotPasswordPhoneModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ForgotPasswordPhoneModel.class); + } + + /** + * Convert an instance of ForgotPasswordPhoneModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ForgotPasswordRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ForgotPasswordRequest.java new file mode 100644 index 0000000..5e52115 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ForgotPasswordRequest.java @@ -0,0 +1,449 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ForgotPasswordRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ForgotPasswordRequest { + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private String email; + + public static final String SERIALIZED_NAME_USER_NAME = "UserName"; + @SerializedName(SERIALIZED_NAME_USER_NAME) + @javax.annotation.Nullable + private String userName; + + public static final String SERIALIZED_NAME_G_RECAPTCHA_RESPONSE = "g-recaptcha-response"; + @SerializedName(SERIALIZED_NAME_G_RECAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String gRecaptchaResponse; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_TICKET = "qq_captcha_ticket"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_TICKET) + @javax.annotation.Nullable + private String qqCaptchaTicket; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR = "qq_captcha_randstr"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR) + @javax.annotation.Nullable + private String qqCaptchaRandstr; + + public static final String SERIALIZED_NAME_H_CAPTCHA_RESPONSE = "h-captcha-response"; + @SerializedName(SERIALIZED_NAME_H_CAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String hCaptchaResponse; + + public ForgotPasswordRequest() { + } + + public ForgotPasswordRequest email(@javax.annotation.Nullable String email) { + this.email = email; + return this; + } + + /** + * The Email address of the User + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable String email) { + this.email = email; + } + + + public ForgotPasswordRequest userName(@javax.annotation.Nullable String userName) { + this.userName = userName; + return this; + } + + /** + * The Username of the User + * @return userName + */ + @javax.annotation.Nullable + public String getUserName() { + return userName; + } + + public void setUserName(@javax.annotation.Nullable String userName) { + this.userName = userName; + } + + + public ForgotPasswordRequest gRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + return this; + } + + /** + * The Google reCAPTCHA response which is sent to the server for verification. + * @return gRecaptchaResponse + */ + @javax.annotation.Nullable + public String getgRecaptchaResponse() { + return gRecaptchaResponse; + } + + public void setgRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + } + + + public ForgotPasswordRequest qqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + return this; + } + + /** + * The QQ Captcha ticket which is sent to the server for verification. + * @return qqCaptchaTicket + */ + @javax.annotation.Nullable + public String getQqCaptchaTicket() { + return qqCaptchaTicket; + } + + public void setQqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + } + + + public ForgotPasswordRequest qqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + return this; + } + + /** + * The QQ Captcha random string which is sent to the server for verification. + * @return qqCaptchaRandstr + */ + @javax.annotation.Nullable + public String getQqCaptchaRandstr() { + return qqCaptchaRandstr; + } + + public void setQqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + } + + + public ForgotPasswordRequest hCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + return this; + } + + /** + * The hCaptcha response which is sent to the server for verification. + * @return hCaptchaResponse + */ + @javax.annotation.Nullable + public String gethCaptchaResponse() { + return hCaptchaResponse; + } + + public void sethCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ForgotPasswordRequest instance itself + */ + public ForgotPasswordRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ForgotPasswordRequest forgotPasswordRequest = (ForgotPasswordRequest) o; + return Objects.equals(this.email, forgotPasswordRequest.email) && + Objects.equals(this.userName, forgotPasswordRequest.userName) && + Objects.equals(this.gRecaptchaResponse, forgotPasswordRequest.gRecaptchaResponse) && + Objects.equals(this.qqCaptchaTicket, forgotPasswordRequest.qqCaptchaTicket) && + Objects.equals(this.qqCaptchaRandstr, forgotPasswordRequest.qqCaptchaRandstr) && + Objects.equals(this.hCaptchaResponse, forgotPasswordRequest.hCaptchaResponse)&& + Objects.equals(this.additionalProperties, forgotPasswordRequest.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(email, userName, gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ForgotPasswordRequest {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" userName: ").append(toIndentedString(userName)).append("\n"); + sb.append(" gRecaptchaResponse: ").append(toIndentedString(gRecaptchaResponse)).append("\n"); + sb.append(" qqCaptchaTicket: ").append(toIndentedString(qqCaptchaTicket)).append("\n"); + sb.append(" qqCaptchaRandstr: ").append(toIndentedString(qqCaptchaRandstr)).append("\n"); + sb.append(" hCaptchaResponse: ").append(toIndentedString(hCaptchaResponse)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Email"); + openapiFields.add("UserName"); + openapiFields.add("g-recaptcha-response"); + openapiFields.add("qq_captcha_ticket"); + openapiFields.add("qq_captcha_randstr"); + openapiFields.add("h-captcha-response"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ForgotPasswordRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ForgotPasswordRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ForgotPasswordRequest is not found in the empty JSON string", ForgotPasswordRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Email") != null && !jsonObj.get("Email").isJsonNull()) && !jsonObj.get("Email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Email").toString())); + } + if ((jsonObj.get("UserName") != null && !jsonObj.get("UserName").isJsonNull()) && !jsonObj.get("UserName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UserName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UserName").toString())); + } + if ((jsonObj.get("g-recaptcha-response") != null && !jsonObj.get("g-recaptcha-response").isJsonNull()) && !jsonObj.get("g-recaptcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `g-recaptcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("g-recaptcha-response").toString())); + } + if ((jsonObj.get("qq_captcha_ticket") != null && !jsonObj.get("qq_captcha_ticket").isJsonNull()) && !jsonObj.get("qq_captcha_ticket").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_ticket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_ticket").toString())); + } + if ((jsonObj.get("qq_captcha_randstr") != null && !jsonObj.get("qq_captcha_randstr").isJsonNull()) && !jsonObj.get("qq_captcha_randstr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_randstr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_randstr").toString())); + } + if ((jsonObj.get("h-captcha-response") != null && !jsonObj.get("h-captcha-response").isJsonNull()) && !jsonObj.get("h-captcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `h-captcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("h-captcha-response").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ForgotPasswordRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ForgotPasswordRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ForgotPasswordRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ForgotPasswordRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<ForgotPasswordRequest>() { + @Override + public void write(JsonWriter out, ForgotPasswordRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ForgotPasswordRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ForgotPasswordRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ForgotPasswordRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ForgotPasswordRequest + * @throws IOException if the JSON string is invalid with respect to ForgotPasswordRequest + */ + public static ForgotPasswordRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ForgotPasswordRequest.class); + } + + /** + * Convert an instance of ForgotPasswordRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ForgotPasswordTokenAndEmailRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ForgotPasswordTokenAndEmailRequest.java new file mode 100644 index 0000000..bf4ee49 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ForgotPasswordTokenAndEmailRequest.java @@ -0,0 +1,275 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.EmailToValidateServerSide; +import com.loginradius.sdk.internal.openapi.model.UsernameModel; +import java.io.IOException; +import java.util.Arrays; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ForgotPasswordTokenAndEmailRequest extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(ForgotPasswordTokenAndEmailRequest.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ForgotPasswordTokenAndEmailRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ForgotPasswordTokenAndEmailRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<UsernameModel> adapterUsernameModel = gson.getDelegateAdapter(this, TypeToken.get(UsernameModel.class)); + final TypeAdapter<EmailToValidateServerSide> adapterEmailToValidateServerSide = gson.getDelegateAdapter(this, TypeToken.get(EmailToValidateServerSide.class)); + + return (TypeAdapter<T>) new TypeAdapter<ForgotPasswordTokenAndEmailRequest>() { + @Override + public void write(JsonWriter out, ForgotPasswordTokenAndEmailRequest value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `UsernameModel` + if (value.getActualInstance() instanceof UsernameModel) { + JsonElement element = adapterUsernameModel.toJsonTree((UsernameModel)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `EmailToValidateServerSide` + if (value.getActualInstance() instanceof EmailToValidateServerSide) { + JsonElement element = adapterEmailToValidateServerSide.toJsonTree((EmailToValidateServerSide)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: EmailToValidateServerSide, UsernameModel"); + } + + @Override + public ForgotPasswordTokenAndEmailRequest read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize UsernameModel + try { + // validate the JSON object to see if any exception is thrown + UsernameModel.validateJsonElement(jsonElement); + actualAdapter = adapterUsernameModel; + match++; + log.log(Level.FINER, "Input data matches schema 'UsernameModel'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for UsernameModel failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'UsernameModel'", e); + } + // deserialize EmailToValidateServerSide + try { + // validate the JSON object to see if any exception is thrown + EmailToValidateServerSide.validateJsonElement(jsonElement); + actualAdapter = adapterEmailToValidateServerSide; + match++; + log.log(Level.FINER, "Input data matches schema 'EmailToValidateServerSide'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for EmailToValidateServerSide failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'EmailToValidateServerSide'", e); + } + + if (match == 1) { + ForgotPasswordTokenAndEmailRequest ret = new ForgotPasswordTokenAndEmailRequest(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for ForgotPasswordTokenAndEmailRequest: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public ForgotPasswordTokenAndEmailRequest() { + super("oneOf", Boolean.FALSE); + } + + public ForgotPasswordTokenAndEmailRequest(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("UsernameModel", UsernameModel.class); + schemas.put("EmailToValidateServerSide", EmailToValidateServerSide.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return ForgotPasswordTokenAndEmailRequest.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * EmailToValidateServerSide, UsernameModel + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof UsernameModel) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof EmailToValidateServerSide) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be EmailToValidateServerSide, UsernameModel"); + } + + /** + * Get the actual instance, which can be the following: + * EmailToValidateServerSide, UsernameModel + * + * @return The actual instance (EmailToValidateServerSide, UsernameModel) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `UsernameModel`. If the actual instance is not `UsernameModel`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `UsernameModel` + * @throws ClassCastException if the instance is not `UsernameModel` + */ + public UsernameModel getUsernameModel() throws ClassCastException { + return (UsernameModel)super.getActualInstance(); + } + + /** + * Get the actual instance of `EmailToValidateServerSide`. If the actual instance is not `EmailToValidateServerSide`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `EmailToValidateServerSide` + * @throws ClassCastException if the instance is not `EmailToValidateServerSide` + */ + public EmailToValidateServerSide getEmailToValidateServerSide() throws ClassCastException { + return (EmailToValidateServerSide)super.getActualInstance(); + } + + /** + * 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 ForgotPasswordTokenAndEmailRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with UsernameModel + try { + UsernameModel.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for UsernameModel failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with EmailToValidateServerSide + try { + EmailToValidateServerSide.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for EmailToValidateServerSide failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for ForgotPasswordTokenAndEmailRequest with oneOf schemas: EmailToValidateServerSide, UsernameModel. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of ForgotPasswordTokenAndEmailRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of ForgotPasswordTokenAndEmailRequest + * @throws IOException if the JSON string is invalid with respect to ForgotPasswordTokenAndEmailRequest + */ + public static ForgotPasswordTokenAndEmailRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ForgotPasswordTokenAndEmailRequest.class); + } + + /** + * Convert an instance of ForgotPasswordTokenAndEmailRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ForgotPasswordTokenModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ForgotPasswordTokenModel.java new file mode 100644 index 0000000..8a74bfe --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ForgotPasswordTokenModel.java @@ -0,0 +1,339 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ForgotPasswordTokenModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ForgotPasswordTokenModel { + public static final String SERIALIZED_NAME_FORGOT_TOKEN = "ForgotToken"; + @SerializedName(SERIALIZED_NAME_FORGOT_TOKEN) + @javax.annotation.Nonnull + private String forgotToken; + + public static final String SERIALIZED_NAME_IDENTITY_PROVIDERS = "IdentityProviders"; + @SerializedName(SERIALIZED_NAME_IDENTITY_PROVIDERS) + @javax.annotation.Nonnull + private List<String> identityProviders = new ArrayList<>(); + + public ForgotPasswordTokenModel() { + } + + public ForgotPasswordTokenModel forgotToken(@javax.annotation.Nonnull String forgotToken) { + this.forgotToken = forgotToken; + return this; + } + + /** + * The generated forgot Password token. + * @return forgotToken + */ + @javax.annotation.Nonnull + public String getForgotToken() { + return forgotToken; + } + + public void setForgotToken(@javax.annotation.Nonnull String forgotToken) { + this.forgotToken = forgotToken; + } + + + public ForgotPasswordTokenModel identityProviders(@javax.annotation.Nonnull List<String> identityProviders) { + this.identityProviders = identityProviders; + return this; + } + + public ForgotPasswordTokenModel addIdentityProvidersItem(String identityProvidersItem) { + if (this.identityProviders == null) { + this.identityProviders = new ArrayList<>(); + } + this.identityProviders.add(identityProvidersItem); + return this; + } + + /** + * List of identity providers associated with the User. + * @return identityProviders + */ + @javax.annotation.Nonnull + public List<String> getIdentityProviders() { + return identityProviders; + } + + public void setIdentityProviders(@javax.annotation.Nonnull List<String> identityProviders) { + this.identityProviders = identityProviders; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ForgotPasswordTokenModel instance itself + */ + public ForgotPasswordTokenModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ForgotPasswordTokenModel forgotPasswordTokenModel = (ForgotPasswordTokenModel) o; + return Objects.equals(this.forgotToken, forgotPasswordTokenModel.forgotToken) && + Objects.equals(this.identityProviders, forgotPasswordTokenModel.identityProviders)&& + Objects.equals(this.additionalProperties, forgotPasswordTokenModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(forgotToken, identityProviders, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ForgotPasswordTokenModel {\n"); + sb.append(" forgotToken: ").append(toIndentedString(forgotToken)).append("\n"); + sb.append(" identityProviders: ").append(toIndentedString(identityProviders)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ForgotToken"); + openapiFields.add("IdentityProviders"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("ForgotToken"); + openapiRequiredFields.add("IdentityProviders"); + } + + /** + * 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 ForgotPasswordTokenModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ForgotPasswordTokenModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ForgotPasswordTokenModel is not found in the empty JSON string", ForgotPasswordTokenModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ForgotPasswordTokenModel.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("ForgotToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ForgotToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ForgotToken").toString())); + } + // ensure the required json array is present + if (jsonObj.get("IdentityProviders") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("IdentityProviders").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `IdentityProviders` to be an array in the JSON string but got `%s`", jsonObj.get("IdentityProviders").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ForgotPasswordTokenModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ForgotPasswordTokenModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ForgotPasswordTokenModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ForgotPasswordTokenModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<ForgotPasswordTokenModel>() { + @Override + public void write(JsonWriter out, ForgotPasswordTokenModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ForgotPasswordTokenModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ForgotPasswordTokenModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ForgotPasswordTokenModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ForgotPasswordTokenModel + * @throws IOException if the JSON string is invalid with respect to ForgotPasswordTokenModel + */ + public static ForgotPasswordTokenModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ForgotPasswordTokenModel.class); + } + + /** + * Convert an instance of ForgotPasswordTokenModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ForgotPinByEmail.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ForgotPinByEmail.java new file mode 100644 index 0000000..8e90544 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ForgotPinByEmail.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * This model is used in forgot PIN by Email API + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ForgotPinByEmail { + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nonnull + private String email; + + public ForgotPinByEmail() { + } + + public ForgotPinByEmail email(@javax.annotation.Nonnull String email) { + this.email = email; + return this; + } + + /** + * The Email of the User. + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nonnull String email) { + this.email = email; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ForgotPinByEmail instance itself + */ + public ForgotPinByEmail putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ForgotPinByEmail forgotPinByEmail = (ForgotPinByEmail) o; + return Objects.equals(this.email, forgotPinByEmail.email)&& + Objects.equals(this.additionalProperties, forgotPinByEmail.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ForgotPinByEmail {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("email"); + } + + /** + * 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 ForgotPinByEmail + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ForgotPinByEmail.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ForgotPinByEmail is not found in the empty JSON string", ForgotPinByEmail.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ForgotPinByEmail.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("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ForgotPinByEmail.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ForgotPinByEmail' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ForgotPinByEmail> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ForgotPinByEmail.class)); + + return (TypeAdapter<T>) new TypeAdapter<ForgotPinByEmail>() { + @Override + public void write(JsonWriter out, ForgotPinByEmail value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ForgotPinByEmail read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ForgotPinByEmail instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ForgotPinByEmail given an JSON string + * + * @param jsonString JSON string + * @return An instance of ForgotPinByEmail + * @throws IOException if the JSON string is invalid with respect to ForgotPinByEmail + */ + public static ForgotPinByEmail fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ForgotPinByEmail.class); + } + + /** + * Convert an instance of ForgotPinByEmail to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ForgotPinByPhone.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ForgotPinByPhone.java new file mode 100644 index 0000000..d078097 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ForgotPinByPhone.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * This model is used in forgot PIN by Phone API + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ForgotPinByPhone { + public static final String SERIALIZED_NAME_PHONE = "phone"; + @SerializedName(SERIALIZED_NAME_PHONE) + @javax.annotation.Nonnull + private String phone; + + public ForgotPinByPhone() { + } + + public ForgotPinByPhone phone(@javax.annotation.Nonnull String phone) { + this.phone = phone; + return this; + } + + /** + * The Phone number of the User. + * @return phone + */ + @javax.annotation.Nonnull + public String getPhone() { + return phone; + } + + public void setPhone(@javax.annotation.Nonnull String phone) { + this.phone = phone; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ForgotPinByPhone instance itself + */ + public ForgotPinByPhone putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ForgotPinByPhone forgotPinByPhone = (ForgotPinByPhone) o; + return Objects.equals(this.phone, forgotPinByPhone.phone)&& + Objects.equals(this.additionalProperties, forgotPinByPhone.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(phone, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ForgotPinByPhone {\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("phone"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("phone"); + } + + /** + * 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 ForgotPinByPhone + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ForgotPinByPhone.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ForgotPinByPhone is not found in the empty JSON string", ForgotPinByPhone.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ForgotPinByPhone.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("phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phone").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ForgotPinByPhone.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ForgotPinByPhone' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ForgotPinByPhone> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ForgotPinByPhone.class)); + + return (TypeAdapter<T>) new TypeAdapter<ForgotPinByPhone>() { + @Override + public void write(JsonWriter out, ForgotPinByPhone value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ForgotPinByPhone read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ForgotPinByPhone instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ForgotPinByPhone given an JSON string + * + * @param jsonString JSON string + * @return An instance of ForgotPinByPhone + * @throws IOException if the JSON string is invalid with respect to ForgotPinByPhone + */ + public static ForgotPinByPhone fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ForgotPinByPhone.class); + } + + /** + * Convert an instance of ForgotPinByPhone to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ForgotPinByUsername.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ForgotPinByUsername.java new file mode 100644 index 0000000..511ecef --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ForgotPinByUsername.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * This model is used in forgot PIN by Username API + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ForgotPinByUsername { + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nonnull + private String username; + + public ForgotPinByUsername() { + } + + public ForgotPinByUsername username(@javax.annotation.Nonnull String username) { + this.username = username; + return this; + } + + /** + * The Username of the User. + * @return username + */ + @javax.annotation.Nonnull + public String getUsername() { + return username; + } + + public void setUsername(@javax.annotation.Nonnull String username) { + this.username = username; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ForgotPinByUsername instance itself + */ + public ForgotPinByUsername putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ForgotPinByUsername forgotPinByUsername = (ForgotPinByUsername) o; + return Objects.equals(this.username, forgotPinByUsername.username)&& + Objects.equals(this.additionalProperties, forgotPinByUsername.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(username, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ForgotPinByUsername {\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("username"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("username"); + } + + /** + * 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 ForgotPinByUsername + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ForgotPinByUsername.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ForgotPinByUsername is not found in the empty JSON string", ForgotPinByUsername.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ForgotPinByUsername.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("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ForgotPinByUsername.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ForgotPinByUsername' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ForgotPinByUsername> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ForgotPinByUsername.class)); + + return (TypeAdapter<T>) new TypeAdapter<ForgotPinByUsername>() { + @Override + public void write(JsonWriter out, ForgotPinByUsername value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ForgotPinByUsername read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ForgotPinByUsername instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ForgotPinByUsername given an JSON string + * + * @param jsonString JSON string + * @return An instance of ForgotPinByUsername + * @throws IOException if the JSON string is invalid with respect to ForgotPinByUsername + */ + public static ForgotPinByUsername fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ForgotPinByUsername.class); + } + + /** + * Convert an instance of ForgotPinByUsername to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GenerateSottResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GenerateSottResponse.java new file mode 100644 index 0000000..2287894 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GenerateSottResponse.java @@ -0,0 +1,324 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * GenerateSottResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GenerateSottResponse { + public static final String SERIALIZED_NAME_SOTT = "Sott"; + @SerializedName(SERIALIZED_NAME_SOTT) + @javax.annotation.Nonnull + private String sott; + + public static final String SERIALIZED_NAME_EXPIRY_TIME = "ExpiryTime"; + @SerializedName(SERIALIZED_NAME_EXPIRY_TIME) + @javax.annotation.Nonnull + private OffsetDateTime expiryTime; + + public GenerateSottResponse() { + } + + public GenerateSottResponse sott(@javax.annotation.Nonnull String sott) { + this.sott = sott; + return this; + } + + /** + * The generated Secure One Time Token (SOTT). + * @return sott + */ + @javax.annotation.Nonnull + public String getSott() { + return sott; + } + + public void setSott(@javax.annotation.Nonnull String sott) { + this.sott = sott; + } + + + public GenerateSottResponse expiryTime(@javax.annotation.Nonnull OffsetDateTime expiryTime) { + this.expiryTime = expiryTime; + return this; + } + + /** + * The SOTT expiration time. + * @return expiryTime + */ + @javax.annotation.Nonnull + public OffsetDateTime getExpiryTime() { + return expiryTime; + } + + public void setExpiryTime(@javax.annotation.Nonnull OffsetDateTime expiryTime) { + this.expiryTime = expiryTime; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GenerateSottResponse instance itself + */ + public GenerateSottResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenerateSottResponse generateSottResponse = (GenerateSottResponse) o; + return Objects.equals(this.sott, generateSottResponse.sott) && + Objects.equals(this.expiryTime, generateSottResponse.expiryTime)&& + Objects.equals(this.additionalProperties, generateSottResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(sott, expiryTime, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GenerateSottResponse {\n"); + sb.append(" sott: ").append(toIndentedString(sott)).append("\n"); + sb.append(" expiryTime: ").append(toIndentedString(expiryTime)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Sott"); + openapiFields.add("ExpiryTime"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Sott"); + openapiRequiredFields.add("ExpiryTime"); + } + + /** + * 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 GenerateSottResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GenerateSottResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GenerateSottResponse is not found in the empty JSON string", GenerateSottResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GenerateSottResponse.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("Sott").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Sott` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Sott").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GenerateSottResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GenerateSottResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GenerateSottResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GenerateSottResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<GenerateSottResponse>() { + @Override + public void write(JsonWriter out, GenerateSottResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GenerateSottResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GenerateSottResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GenerateSottResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GenerateSottResponse + * @throws IOException if the JSON string is invalid with respect to GenerateSottResponse + */ + public static GenerateSottResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GenerateSottResponse.class); + } + + /** + * Convert an instance of GenerateSottResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GenerateTokenResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GenerateTokenResponse.java new file mode 100644 index 0000000..94fef08 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GenerateTokenResponse.java @@ -0,0 +1,368 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * GenerateTokenResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GenerateTokenResponse { + public static final String SERIALIZED_NAME_TOKEN = "Token"; + @SerializedName(SERIALIZED_NAME_TOKEN) + @javax.annotation.Nullable + private String token; + + public static final String SERIALIZED_NAME_EXPIRES_IN = "ExpiresIn"; + @SerializedName(SERIALIZED_NAME_EXPIRES_IN) + @javax.annotation.Nullable + private OffsetDateTime expiresIn; + + public static final String SERIALIZED_NAME_IDENTITY_PROVIDERS = "IdentityProviders"; + @SerializedName(SERIALIZED_NAME_IDENTITY_PROVIDERS) + @javax.annotation.Nullable + private List<String> identityProviders; + + public GenerateTokenResponse() { + } + + public GenerateTokenResponse token(@javax.annotation.Nullable String token) { + this.token = token; + return this; + } + + /** + * The generated token for the specific request. + * @return token + */ + @javax.annotation.Nullable + public String getToken() { + return token; + } + + public void setToken(@javax.annotation.Nullable String token) { + this.token = token; + } + + + public GenerateTokenResponse expiresIn(@javax.annotation.Nullable OffsetDateTime expiresIn) { + this.expiresIn = expiresIn; + return this; + } + + /** + * The expiration date and time of the token. + * @return expiresIn + */ + @javax.annotation.Nullable + public OffsetDateTime getExpiresIn() { + return expiresIn; + } + + public void setExpiresIn(@javax.annotation.Nullable OffsetDateTime expiresIn) { + this.expiresIn = expiresIn; + } + + + public GenerateTokenResponse identityProviders(@javax.annotation.Nullable List<String> identityProviders) { + this.identityProviders = identityProviders; + return this; + } + + public GenerateTokenResponse addIdentityProvidersItem(String identityProvidersItem) { + if (this.identityProviders == null) { + this.identityProviders = new ArrayList<>(); + } + this.identityProviders.add(identityProvidersItem); + return this; + } + + /** + * The identity providers associated with the specified token, it will display a list of identity providers from where the User is already authenticated. + * @return identityProviders + */ + @javax.annotation.Nullable + public List<String> getIdentityProviders() { + return identityProviders; + } + + public void setIdentityProviders(@javax.annotation.Nullable List<String> identityProviders) { + this.identityProviders = identityProviders; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GenerateTokenResponse instance itself + */ + public GenerateTokenResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenerateTokenResponse generateTokenResponse = (GenerateTokenResponse) o; + return Objects.equals(this.token, generateTokenResponse.token) && + Objects.equals(this.expiresIn, generateTokenResponse.expiresIn) && + Objects.equals(this.identityProviders, generateTokenResponse.identityProviders)&& + Objects.equals(this.additionalProperties, generateTokenResponse.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(token, expiresIn, identityProviders, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GenerateTokenResponse {\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n"); + sb.append(" identityProviders: ").append(toIndentedString(identityProviders)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Token"); + openapiFields.add("ExpiresIn"); + openapiFields.add("IdentityProviders"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 GenerateTokenResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GenerateTokenResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GenerateTokenResponse is not found in the empty JSON string", GenerateTokenResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Token") != null && !jsonObj.get("Token").isJsonNull()) && !jsonObj.get("Token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Token").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("IdentityProviders") != null && !jsonObj.get("IdentityProviders").isJsonNull() && !jsonObj.get("IdentityProviders").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `IdentityProviders` to be an array in the JSON string but got `%s`", jsonObj.get("IdentityProviders").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GenerateTokenResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GenerateTokenResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GenerateTokenResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GenerateTokenResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<GenerateTokenResponse>() { + @Override + public void write(JsonWriter out, GenerateTokenResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GenerateTokenResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GenerateTokenResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GenerateTokenResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of GenerateTokenResponse + * @throws IOException if the JSON string is invalid with respect to GenerateTokenResponse + */ + public static GenerateTokenResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GenerateTokenResponse.class); + } + + /** + * Convert an instance of GenerateTokenResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GenericSecondFactorAuthentication.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GenericSecondFactorAuthentication.java new file mode 100644 index 0000000..5f299b5 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GenericSecondFactorAuthentication.java @@ -0,0 +1,518 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.SecondFactorAuthenticationPasskeyCredential; +import com.loginradius.sdk.internal.openapi.model.SecondFactorAuthenticationPushDevice; +import com.loginradius.sdk.internal.openapi.model.SecondFactorAuthenticator; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * GenericSecondFactorAuthentication + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GenericSecondFactorAuthentication { + public static final String SERIALIZED_NAME_GOOGLE_AUTHENTICATOR = "GoogleAuthenticator"; + @SerializedName(SERIALIZED_NAME_GOOGLE_AUTHENTICATOR) + @javax.annotation.Nullable + private SecondFactorAuthenticator googleAuthenticator; + + public static final String SERIALIZED_NAME_OT_P_AUTHENTICATOR = "OTPAuthenticator"; + @SerializedName(SERIALIZED_NAME_OT_P_AUTHENTICATOR) + @javax.annotation.Nullable + private SecondFactorAuthenticator otPAuthenticator; + + public static final String SERIALIZED_NAME_EMAIL_O_T_P_AUTHENTICATOR = "EmailOTPAuthenticator"; + @SerializedName(SERIALIZED_NAME_EMAIL_O_T_P_AUTHENTICATOR) + @javax.annotation.Nullable + private SecondFactorAuthenticator emailOTPAuthenticator; + + public static final String SERIALIZED_NAME_BACK_UP_CODES = "BackUpCodes"; + @SerializedName(SERIALIZED_NAME_BACK_UP_CODES) + @javax.annotation.Nullable + private List<String> backUpCodes = new ArrayList<>(); + + public static final String SERIALIZED_NAME_AUTHENTICATOR = "Authenticator"; + @SerializedName(SERIALIZED_NAME_AUTHENTICATOR) + @javax.annotation.Nullable + private SecondFactorAuthenticator authenticator; + + public static final String SERIALIZED_NAME_PUSH_AUTHENTICATOR = "PushAuthenticator"; + @SerializedName(SERIALIZED_NAME_PUSH_AUTHENTICATOR) + @javax.annotation.Nullable + private SecondFactorAuthenticationPushDevice pushAuthenticator; + + public static final String SERIALIZED_NAME_DUO_SECURITY_AUTHENTICATOR = "DuoSecurityAuthenticator"; + @SerializedName(SERIALIZED_NAME_DUO_SECURITY_AUTHENTICATOR) + @javax.annotation.Nullable + private SecondFactorAuthenticator duoSecurityAuthenticator; + + public static final String SERIALIZED_NAME_PASSKEY_AUTHENTICATOR = "PasskeyAuthenticator"; + @SerializedName(SERIALIZED_NAME_PASSKEY_AUTHENTICATOR) + @javax.annotation.Nullable + private SecondFactorAuthenticationPasskeyCredential passkeyAuthenticator; + + public GenericSecondFactorAuthentication() { + } + + public GenericSecondFactorAuthentication googleAuthenticator(@javax.annotation.Nullable SecondFactorAuthenticator googleAuthenticator) { + this.googleAuthenticator = googleAuthenticator; + return this; + } + + /** + * Get googleAuthenticator + * @return googleAuthenticator + */ + @javax.annotation.Nullable + public SecondFactorAuthenticator getGoogleAuthenticator() { + return googleAuthenticator; + } + + public void setGoogleAuthenticator(@javax.annotation.Nullable SecondFactorAuthenticator googleAuthenticator) { + this.googleAuthenticator = googleAuthenticator; + } + + + public GenericSecondFactorAuthentication otPAuthenticator(@javax.annotation.Nullable SecondFactorAuthenticator otPAuthenticator) { + this.otPAuthenticator = otPAuthenticator; + return this; + } + + /** + * Get otPAuthenticator + * @return otPAuthenticator + */ + @javax.annotation.Nullable + public SecondFactorAuthenticator getOtPAuthenticator() { + return otPAuthenticator; + } + + public void setOtPAuthenticator(@javax.annotation.Nullable SecondFactorAuthenticator otPAuthenticator) { + this.otPAuthenticator = otPAuthenticator; + } + + + public GenericSecondFactorAuthentication emailOTPAuthenticator(@javax.annotation.Nullable SecondFactorAuthenticator emailOTPAuthenticator) { + this.emailOTPAuthenticator = emailOTPAuthenticator; + return this; + } + + /** + * Get emailOTPAuthenticator + * @return emailOTPAuthenticator + */ + @javax.annotation.Nullable + public SecondFactorAuthenticator getEmailOTPAuthenticator() { + return emailOTPAuthenticator; + } + + public void setEmailOTPAuthenticator(@javax.annotation.Nullable SecondFactorAuthenticator emailOTPAuthenticator) { + this.emailOTPAuthenticator = emailOTPAuthenticator; + } + + + public GenericSecondFactorAuthentication backUpCodes(@javax.annotation.Nullable List<String> backUpCodes) { + this.backUpCodes = backUpCodes; + return this; + } + + public GenericSecondFactorAuthentication addBackUpCodesItem(String backUpCodesItem) { + if (this.backUpCodes == null) { + this.backUpCodes = new ArrayList<>(); + } + this.backUpCodes.add(backUpCodesItem); + return this; + } + + /** + * Get backUpCodes + * @return backUpCodes + */ + @javax.annotation.Nullable + public List<String> getBackUpCodes() { + return backUpCodes; + } + + public void setBackUpCodes(@javax.annotation.Nullable List<String> backUpCodes) { + this.backUpCodes = backUpCodes; + } + + + public GenericSecondFactorAuthentication authenticator(@javax.annotation.Nullable SecondFactorAuthenticator authenticator) { + this.authenticator = authenticator; + return this; + } + + /** + * Get authenticator + * @return authenticator + */ + @javax.annotation.Nullable + public SecondFactorAuthenticator getAuthenticator() { + return authenticator; + } + + public void setAuthenticator(@javax.annotation.Nullable SecondFactorAuthenticator authenticator) { + this.authenticator = authenticator; + } + + + public GenericSecondFactorAuthentication pushAuthenticator(@javax.annotation.Nullable SecondFactorAuthenticationPushDevice pushAuthenticator) { + this.pushAuthenticator = pushAuthenticator; + return this; + } + + /** + * Get pushAuthenticator + * @return pushAuthenticator + */ + @javax.annotation.Nullable + public SecondFactorAuthenticationPushDevice getPushAuthenticator() { + return pushAuthenticator; + } + + public void setPushAuthenticator(@javax.annotation.Nullable SecondFactorAuthenticationPushDevice pushAuthenticator) { + this.pushAuthenticator = pushAuthenticator; + } + + + public GenericSecondFactorAuthentication duoSecurityAuthenticator(@javax.annotation.Nullable SecondFactorAuthenticator duoSecurityAuthenticator) { + this.duoSecurityAuthenticator = duoSecurityAuthenticator; + return this; + } + + /** + * Get duoSecurityAuthenticator + * @return duoSecurityAuthenticator + */ + @javax.annotation.Nullable + public SecondFactorAuthenticator getDuoSecurityAuthenticator() { + return duoSecurityAuthenticator; + } + + public void setDuoSecurityAuthenticator(@javax.annotation.Nullable SecondFactorAuthenticator duoSecurityAuthenticator) { + this.duoSecurityAuthenticator = duoSecurityAuthenticator; + } + + + public GenericSecondFactorAuthentication passkeyAuthenticator(@javax.annotation.Nullable SecondFactorAuthenticationPasskeyCredential passkeyAuthenticator) { + this.passkeyAuthenticator = passkeyAuthenticator; + return this; + } + + /** + * Get passkeyAuthenticator + * @return passkeyAuthenticator + */ + @javax.annotation.Nullable + public SecondFactorAuthenticationPasskeyCredential getPasskeyAuthenticator() { + return passkeyAuthenticator; + } + + public void setPasskeyAuthenticator(@javax.annotation.Nullable SecondFactorAuthenticationPasskeyCredential passkeyAuthenticator) { + this.passkeyAuthenticator = passkeyAuthenticator; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GenericSecondFactorAuthentication instance itself + */ + public GenericSecondFactorAuthentication putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GenericSecondFactorAuthentication genericSecondFactorAuthentication = (GenericSecondFactorAuthentication) o; + return Objects.equals(this.googleAuthenticator, genericSecondFactorAuthentication.googleAuthenticator) && + Objects.equals(this.otPAuthenticator, genericSecondFactorAuthentication.otPAuthenticator) && + Objects.equals(this.emailOTPAuthenticator, genericSecondFactorAuthentication.emailOTPAuthenticator) && + Objects.equals(this.backUpCodes, genericSecondFactorAuthentication.backUpCodes) && + Objects.equals(this.authenticator, genericSecondFactorAuthentication.authenticator) && + Objects.equals(this.pushAuthenticator, genericSecondFactorAuthentication.pushAuthenticator) && + Objects.equals(this.duoSecurityAuthenticator, genericSecondFactorAuthentication.duoSecurityAuthenticator) && + Objects.equals(this.passkeyAuthenticator, genericSecondFactorAuthentication.passkeyAuthenticator)&& + Objects.equals(this.additionalProperties, genericSecondFactorAuthentication.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(googleAuthenticator, otPAuthenticator, emailOTPAuthenticator, backUpCodes, authenticator, pushAuthenticator, duoSecurityAuthenticator, passkeyAuthenticator, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GenericSecondFactorAuthentication {\n"); + sb.append(" googleAuthenticator: ").append(toIndentedString(googleAuthenticator)).append("\n"); + sb.append(" otPAuthenticator: ").append(toIndentedString(otPAuthenticator)).append("\n"); + sb.append(" emailOTPAuthenticator: ").append(toIndentedString(emailOTPAuthenticator)).append("\n"); + sb.append(" backUpCodes: ").append(toIndentedString(backUpCodes)).append("\n"); + sb.append(" authenticator: ").append(toIndentedString(authenticator)).append("\n"); + sb.append(" pushAuthenticator: ").append(toIndentedString(pushAuthenticator)).append("\n"); + sb.append(" duoSecurityAuthenticator: ").append(toIndentedString(duoSecurityAuthenticator)).append("\n"); + sb.append(" passkeyAuthenticator: ").append(toIndentedString(passkeyAuthenticator)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("GoogleAuthenticator"); + openapiFields.add("OTPAuthenticator"); + openapiFields.add("EmailOTPAuthenticator"); + openapiFields.add("BackUpCodes"); + openapiFields.add("Authenticator"); + openapiFields.add("PushAuthenticator"); + openapiFields.add("DuoSecurityAuthenticator"); + openapiFields.add("PasskeyAuthenticator"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 GenericSecondFactorAuthentication + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GenericSecondFactorAuthentication.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GenericSecondFactorAuthentication is not found in the empty JSON string", GenericSecondFactorAuthentication.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `GoogleAuthenticator` + if (jsonObj.get("GoogleAuthenticator") != null && !jsonObj.get("GoogleAuthenticator").isJsonNull()) { + SecondFactorAuthenticator.validateJsonElement(jsonObj.get("GoogleAuthenticator")); + } + // validate the optional field `OTPAuthenticator` + if (jsonObj.get("OTPAuthenticator") != null && !jsonObj.get("OTPAuthenticator").isJsonNull()) { + SecondFactorAuthenticator.validateJsonElement(jsonObj.get("OTPAuthenticator")); + } + // validate the optional field `EmailOTPAuthenticator` + if (jsonObj.get("EmailOTPAuthenticator") != null && !jsonObj.get("EmailOTPAuthenticator").isJsonNull()) { + SecondFactorAuthenticator.validateJsonElement(jsonObj.get("EmailOTPAuthenticator")); + } + // ensure the optional json data is an array if present + if (jsonObj.get("BackUpCodes") != null && !jsonObj.get("BackUpCodes").isJsonNull() && !jsonObj.get("BackUpCodes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `BackUpCodes` to be an array in the JSON string but got `%s`", jsonObj.get("BackUpCodes").toString())); + } + // validate the optional field `Authenticator` + if (jsonObj.get("Authenticator") != null && !jsonObj.get("Authenticator").isJsonNull()) { + SecondFactorAuthenticator.validateJsonElement(jsonObj.get("Authenticator")); + } + // validate the optional field `PushAuthenticator` + if (jsonObj.get("PushAuthenticator") != null && !jsonObj.get("PushAuthenticator").isJsonNull()) { + SecondFactorAuthenticationPushDevice.validateJsonElement(jsonObj.get("PushAuthenticator")); + } + // validate the optional field `DuoSecurityAuthenticator` + if (jsonObj.get("DuoSecurityAuthenticator") != null && !jsonObj.get("DuoSecurityAuthenticator").isJsonNull()) { + SecondFactorAuthenticator.validateJsonElement(jsonObj.get("DuoSecurityAuthenticator")); + } + // validate the optional field `PasskeyAuthenticator` + if (jsonObj.get("PasskeyAuthenticator") != null && !jsonObj.get("PasskeyAuthenticator").isJsonNull()) { + SecondFactorAuthenticationPasskeyCredential.validateJsonElement(jsonObj.get("PasskeyAuthenticator")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GenericSecondFactorAuthentication.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GenericSecondFactorAuthentication' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GenericSecondFactorAuthentication> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GenericSecondFactorAuthentication.class)); + + return (TypeAdapter<T>) new TypeAdapter<GenericSecondFactorAuthentication>() { + @Override + public void write(JsonWriter out, GenericSecondFactorAuthentication value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GenericSecondFactorAuthentication read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GenericSecondFactorAuthentication instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GenericSecondFactorAuthentication given an JSON string + * + * @param jsonString JSON string + * @return An instance of GenericSecondFactorAuthentication + * @throws IOException if the JSON string is invalid with respect to GenericSecondFactorAuthentication + */ + public static GenericSecondFactorAuthentication fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GenericSecondFactorAuthentication.class); + } + + /** + * Convert an instance of GenericSecondFactorAuthentication to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllConnectionGroupRoles200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllConnectionGroupRoles200Response.java new file mode 100644 index 0000000..4bcda40 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllConnectionGroupRoles200Response.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ConnectionGroupRoleResponse; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * GetAllConnectionGroupRoles200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GetAllConnectionGroupRoles200Response { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<ConnectionGroupRoleResponse> data = new ArrayList<>(); + + public GetAllConnectionGroupRoles200Response() { + } + + public GetAllConnectionGroupRoles200Response data(@javax.annotation.Nullable List<ConnectionGroupRoleResponse> data) { + this.data = data; + return this; + } + + public GetAllConnectionGroupRoles200Response addDataItem(ConnectionGroupRoleResponse dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<ConnectionGroupRoleResponse> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<ConnectionGroupRoleResponse> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GetAllConnectionGroupRoles200Response instance itself + */ + public GetAllConnectionGroupRoles200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAllConnectionGroupRoles200Response getAllConnectionGroupRoles200Response = (GetAllConnectionGroupRoles200Response) o; + return Objects.equals(this.data, getAllConnectionGroupRoles200Response.data)&& + Objects.equals(this.additionalProperties, getAllConnectionGroupRoles200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAllConnectionGroupRoles200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 GetAllConnectionGroupRoles200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAllConnectionGroupRoles200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetAllConnectionGroupRoles200Response is not found in the empty JSON string", GetAllConnectionGroupRoles200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + ConnectionGroupRoleResponse.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GetAllConnectionGroupRoles200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAllConnectionGroupRoles200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GetAllConnectionGroupRoles200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetAllConnectionGroupRoles200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<GetAllConnectionGroupRoles200Response>() { + @Override + public void write(JsonWriter out, GetAllConnectionGroupRoles200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GetAllConnectionGroupRoles200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetAllConnectionGroupRoles200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetAllConnectionGroupRoles200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAllConnectionGroupRoles200Response + * @throws IOException if the JSON string is invalid with respect to GetAllConnectionGroupRoles200Response + */ + public static GetAllConnectionGroupRoles200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAllConnectionGroupRoles200Response.class); + } + + /** + * Convert an instance of GetAllConnectionGroupRoles200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllCustomFields200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllCustomFields200Response.java new file mode 100644 index 0000000..db8ec11 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllCustomFields200Response.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.RaasCustomField; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * GetAllCustomFields200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GetAllCustomFields200Response { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<RaasCustomField> data = new ArrayList<>(); + + public GetAllCustomFields200Response() { + } + + public GetAllCustomFields200Response data(@javax.annotation.Nullable List<RaasCustomField> data) { + this.data = data; + return this; + } + + public GetAllCustomFields200Response addDataItem(RaasCustomField dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<RaasCustomField> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<RaasCustomField> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GetAllCustomFields200Response instance itself + */ + public GetAllCustomFields200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAllCustomFields200Response getAllCustomFields200Response = (GetAllCustomFields200Response) o; + return Objects.equals(this.data, getAllCustomFields200Response.data)&& + Objects.equals(this.additionalProperties, getAllCustomFields200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAllCustomFields200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 GetAllCustomFields200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAllCustomFields200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetAllCustomFields200Response is not found in the empty JSON string", GetAllCustomFields200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + RaasCustomField.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GetAllCustomFields200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAllCustomFields200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GetAllCustomFields200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetAllCustomFields200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<GetAllCustomFields200Response>() { + @Override + public void write(JsonWriter out, GetAllCustomFields200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GetAllCustomFields200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetAllCustomFields200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetAllCustomFields200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAllCustomFields200Response + * @throws IOException if the JSON string is invalid with respect to GetAllCustomFields200Response + */ + public static GetAllCustomFields200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAllCustomFields200Response.class); + } + + /** + * Convert an instance of GetAllCustomFields200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllCustomOAuthProviders200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllCustomOAuthProviders200Response.java new file mode 100644 index 0000000..8db31f3 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllCustomOAuthProviders200Response.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.OAuth2Provider; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * GetAllCustomOAuthProviders200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GetAllCustomOAuthProviders200Response { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<OAuth2Provider> data = new ArrayList<>(); + + public GetAllCustomOAuthProviders200Response() { + } + + public GetAllCustomOAuthProviders200Response data(@javax.annotation.Nullable List<OAuth2Provider> data) { + this.data = data; + return this; + } + + public GetAllCustomOAuthProviders200Response addDataItem(OAuth2Provider dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<OAuth2Provider> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<OAuth2Provider> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GetAllCustomOAuthProviders200Response instance itself + */ + public GetAllCustomOAuthProviders200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAllCustomOAuthProviders200Response getAllCustomOAuthProviders200Response = (GetAllCustomOAuthProviders200Response) o; + return Objects.equals(this.data, getAllCustomOAuthProviders200Response.data)&& + Objects.equals(this.additionalProperties, getAllCustomOAuthProviders200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAllCustomOAuthProviders200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 GetAllCustomOAuthProviders200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAllCustomOAuthProviders200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetAllCustomOAuthProviders200Response is not found in the empty JSON string", GetAllCustomOAuthProviders200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + OAuth2Provider.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GetAllCustomOAuthProviders200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAllCustomOAuthProviders200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GetAllCustomOAuthProviders200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetAllCustomOAuthProviders200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<GetAllCustomOAuthProviders200Response>() { + @Override + public void write(JsonWriter out, GetAllCustomOAuthProviders200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GetAllCustomOAuthProviders200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetAllCustomOAuthProviders200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetAllCustomOAuthProviders200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAllCustomOAuthProviders200Response + * @throws IOException if the JSON string is invalid with respect to GetAllCustomOAuthProviders200Response + */ + public static GetAllCustomOAuthProviders200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAllCustomOAuthProviders200Response.class); + } + + /** + * Convert an instance of GetAllCustomOAuthProviders200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllJwtConfigSPConfigurations200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllJwtConfigSPConfigurations200Response.java new file mode 100644 index 0000000..2064706 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllJwtConfigSPConfigurations200Response.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.JwtSpConfig; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * GetAllJwtConfigSPConfigurations200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GetAllJwtConfigSPConfigurations200Response { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<JwtSpConfig> data = new ArrayList<>(); + + public GetAllJwtConfigSPConfigurations200Response() { + } + + public GetAllJwtConfigSPConfigurations200Response data(@javax.annotation.Nullable List<JwtSpConfig> data) { + this.data = data; + return this; + } + + public GetAllJwtConfigSPConfigurations200Response addDataItem(JwtSpConfig dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<JwtSpConfig> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<JwtSpConfig> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GetAllJwtConfigSPConfigurations200Response instance itself + */ + public GetAllJwtConfigSPConfigurations200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAllJwtConfigSPConfigurations200Response getAllJwtConfigSPConfigurations200Response = (GetAllJwtConfigSPConfigurations200Response) o; + return Objects.equals(this.data, getAllJwtConfigSPConfigurations200Response.data)&& + Objects.equals(this.additionalProperties, getAllJwtConfigSPConfigurations200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAllJwtConfigSPConfigurations200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 GetAllJwtConfigSPConfigurations200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAllJwtConfigSPConfigurations200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetAllJwtConfigSPConfigurations200Response is not found in the empty JSON string", GetAllJwtConfigSPConfigurations200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + JwtSpConfig.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GetAllJwtConfigSPConfigurations200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAllJwtConfigSPConfigurations200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GetAllJwtConfigSPConfigurations200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetAllJwtConfigSPConfigurations200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<GetAllJwtConfigSPConfigurations200Response>() { + @Override + public void write(JsonWriter out, GetAllJwtConfigSPConfigurations200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GetAllJwtConfigSPConfigurations200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetAllJwtConfigSPConfigurations200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetAllJwtConfigSPConfigurations200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAllJwtConfigSPConfigurations200Response + * @throws IOException if the JSON string is invalid with respect to GetAllJwtConfigSPConfigurations200Response + */ + public static GetAllJwtConfigSPConfigurations200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAllJwtConfigSPConfigurations200Response.class); + } + + /** + * Convert an instance of GetAllJwtConfigSPConfigurations200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllJwtIntegrations200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllJwtIntegrations200Response.java new file mode 100644 index 0000000..5ce8369 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllJwtIntegrations200Response.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.JwtIntegrationResponse; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * GetAllJwtIntegrations200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GetAllJwtIntegrations200Response { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<JwtIntegrationResponse> data = new ArrayList<>(); + + public GetAllJwtIntegrations200Response() { + } + + public GetAllJwtIntegrations200Response data(@javax.annotation.Nullable List<JwtIntegrationResponse> data) { + this.data = data; + return this; + } + + public GetAllJwtIntegrations200Response addDataItem(JwtIntegrationResponse dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<JwtIntegrationResponse> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<JwtIntegrationResponse> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GetAllJwtIntegrations200Response instance itself + */ + public GetAllJwtIntegrations200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAllJwtIntegrations200Response getAllJwtIntegrations200Response = (GetAllJwtIntegrations200Response) o; + return Objects.equals(this.data, getAllJwtIntegrations200Response.data)&& + Objects.equals(this.additionalProperties, getAllJwtIntegrations200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAllJwtIntegrations200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 GetAllJwtIntegrations200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAllJwtIntegrations200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetAllJwtIntegrations200Response is not found in the empty JSON string", GetAllJwtIntegrations200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + JwtIntegrationResponse.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GetAllJwtIntegrations200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAllJwtIntegrations200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GetAllJwtIntegrations200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetAllJwtIntegrations200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<GetAllJwtIntegrations200Response>() { + @Override + public void write(JsonWriter out, GetAllJwtIntegrations200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GetAllJwtIntegrations200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetAllJwtIntegrations200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetAllJwtIntegrations200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAllJwtIntegrations200Response + * @throws IOException if the JSON string is invalid with respect to GetAllJwtIntegrations200Response + */ + public static GetAllJwtIntegrations200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAllJwtIntegrations200Response.class); + } + + /** + * Convert an instance of GetAllJwtIntegrations200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllOAuthClientsConfigurations200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllOAuthClientsConfigurations200Response.java new file mode 100644 index 0000000..837a2e2 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllOAuthClientsConfigurations200Response.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.OAuthClientResponse; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * GetAllOAuthClientsConfigurations200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GetAllOAuthClientsConfigurations200Response { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<OAuthClientResponse> data = new ArrayList<>(); + + public GetAllOAuthClientsConfigurations200Response() { + } + + public GetAllOAuthClientsConfigurations200Response data(@javax.annotation.Nullable List<OAuthClientResponse> data) { + this.data = data; + return this; + } + + public GetAllOAuthClientsConfigurations200Response addDataItem(OAuthClientResponse dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<OAuthClientResponse> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<OAuthClientResponse> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GetAllOAuthClientsConfigurations200Response instance itself + */ + public GetAllOAuthClientsConfigurations200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAllOAuthClientsConfigurations200Response getAllOAuthClientsConfigurations200Response = (GetAllOAuthClientsConfigurations200Response) o; + return Objects.equals(this.data, getAllOAuthClientsConfigurations200Response.data)&& + Objects.equals(this.additionalProperties, getAllOAuthClientsConfigurations200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAllOAuthClientsConfigurations200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 GetAllOAuthClientsConfigurations200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAllOAuthClientsConfigurations200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetAllOAuthClientsConfigurations200Response is not found in the empty JSON string", GetAllOAuthClientsConfigurations200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + OAuthClientResponse.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GetAllOAuthClientsConfigurations200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAllOAuthClientsConfigurations200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GetAllOAuthClientsConfigurations200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetAllOAuthClientsConfigurations200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<GetAllOAuthClientsConfigurations200Response>() { + @Override + public void write(JsonWriter out, GetAllOAuthClientsConfigurations200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GetAllOAuthClientsConfigurations200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetAllOAuthClientsConfigurations200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetAllOAuthClientsConfigurations200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAllOAuthClientsConfigurations200Response + * @throws IOException if the JSON string is invalid with respect to GetAllOAuthClientsConfigurations200Response + */ + public static GetAllOAuthClientsConfigurations200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAllOAuthClientsConfigurations200Response.class); + } + + /** + * Convert an instance of GetAllOAuthClientsConfigurations200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllOAuthIntegrations200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllOAuthIntegrations200Response.java new file mode 100644 index 0000000..702101c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllOAuthIntegrations200Response.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.OAuthIntegrationResponse; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * GetAllOAuthIntegrations200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GetAllOAuthIntegrations200Response { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<OAuthIntegrationResponse> data = new ArrayList<>(); + + public GetAllOAuthIntegrations200Response() { + } + + public GetAllOAuthIntegrations200Response data(@javax.annotation.Nullable List<OAuthIntegrationResponse> data) { + this.data = data; + return this; + } + + public GetAllOAuthIntegrations200Response addDataItem(OAuthIntegrationResponse dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<OAuthIntegrationResponse> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<OAuthIntegrationResponse> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GetAllOAuthIntegrations200Response instance itself + */ + public GetAllOAuthIntegrations200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAllOAuthIntegrations200Response getAllOAuthIntegrations200Response = (GetAllOAuthIntegrations200Response) o; + return Objects.equals(this.data, getAllOAuthIntegrations200Response.data)&& + Objects.equals(this.additionalProperties, getAllOAuthIntegrations200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAllOAuthIntegrations200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 GetAllOAuthIntegrations200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAllOAuthIntegrations200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetAllOAuthIntegrations200Response is not found in the empty JSON string", GetAllOAuthIntegrations200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + OAuthIntegrationResponse.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GetAllOAuthIntegrations200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAllOAuthIntegrations200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GetAllOAuthIntegrations200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetAllOAuthIntegrations200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<GetAllOAuthIntegrations200Response>() { + @Override + public void write(JsonWriter out, GetAllOAuthIntegrations200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GetAllOAuthIntegrations200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetAllOAuthIntegrations200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetAllOAuthIntegrations200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAllOAuthIntegrations200Response + * @throws IOException if the JSON string is invalid with respect to GetAllOAuthIntegrations200Response + */ + public static GetAllOAuthIntegrations200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAllOAuthIntegrations200Response.class); + } + + /** + * Convert an instance of GetAllOAuthIntegrations200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllOrganizationConnections200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllOrganizationConnections200Response.java new file mode 100644 index 0000000..8e03c2a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllOrganizationConnections200Response.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ConnectionResponse; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * GetAllOrganizationConnections200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GetAllOrganizationConnections200Response { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<ConnectionResponse> data = new ArrayList<>(); + + public GetAllOrganizationConnections200Response() { + } + + public GetAllOrganizationConnections200Response data(@javax.annotation.Nullable List<ConnectionResponse> data) { + this.data = data; + return this; + } + + public GetAllOrganizationConnections200Response addDataItem(ConnectionResponse dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<ConnectionResponse> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<ConnectionResponse> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GetAllOrganizationConnections200Response instance itself + */ + public GetAllOrganizationConnections200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAllOrganizationConnections200Response getAllOrganizationConnections200Response = (GetAllOrganizationConnections200Response) o; + return Objects.equals(this.data, getAllOrganizationConnections200Response.data)&& + Objects.equals(this.additionalProperties, getAllOrganizationConnections200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAllOrganizationConnections200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 GetAllOrganizationConnections200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAllOrganizationConnections200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetAllOrganizationConnections200Response is not found in the empty JSON string", GetAllOrganizationConnections200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + ConnectionResponse.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GetAllOrganizationConnections200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAllOrganizationConnections200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GetAllOrganizationConnections200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetAllOrganizationConnections200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<GetAllOrganizationConnections200Response>() { + @Override + public void write(JsonWriter out, GetAllOrganizationConnections200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GetAllOrganizationConnections200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetAllOrganizationConnections200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetAllOrganizationConnections200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAllOrganizationConnections200Response + * @throws IOException if the JSON string is invalid with respect to GetAllOrganizationConnections200Response + */ + public static GetAllOrganizationConnections200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAllOrganizationConnections200Response.class); + } + + /** + * Convert an instance of GetAllOrganizationConnections200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllOrganizationDomains200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllOrganizationDomains200Response.java new file mode 100644 index 0000000..79b6582 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllOrganizationDomains200Response.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.OrganizationsDomainsResponse; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * GetAllOrganizationDomains200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GetAllOrganizationDomains200Response { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<OrganizationsDomainsResponse> data = new ArrayList<>(); + + public GetAllOrganizationDomains200Response() { + } + + public GetAllOrganizationDomains200Response data(@javax.annotation.Nullable List<OrganizationsDomainsResponse> data) { + this.data = data; + return this; + } + + public GetAllOrganizationDomains200Response addDataItem(OrganizationsDomainsResponse dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<OrganizationsDomainsResponse> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<OrganizationsDomainsResponse> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GetAllOrganizationDomains200Response instance itself + */ + public GetAllOrganizationDomains200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAllOrganizationDomains200Response getAllOrganizationDomains200Response = (GetAllOrganizationDomains200Response) o; + return Objects.equals(this.data, getAllOrganizationDomains200Response.data)&& + Objects.equals(this.additionalProperties, getAllOrganizationDomains200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAllOrganizationDomains200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 GetAllOrganizationDomains200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAllOrganizationDomains200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetAllOrganizationDomains200Response is not found in the empty JSON string", GetAllOrganizationDomains200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + OrganizationsDomainsResponse.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GetAllOrganizationDomains200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAllOrganizationDomains200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GetAllOrganizationDomains200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetAllOrganizationDomains200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<GetAllOrganizationDomains200Response>() { + @Override + public void write(JsonWriter out, GetAllOrganizationDomains200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GetAllOrganizationDomains200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetAllOrganizationDomains200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetAllOrganizationDomains200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAllOrganizationDomains200Response + * @throws IOException if the JSON string is invalid with respect to GetAllOrganizationDomains200Response + */ + public static GetAllOrganizationDomains200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAllOrganizationDomains200Response.class); + } + + /** + * Convert an instance of GetAllOrganizationDomains200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllOrganizations200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllOrganizations200Response.java new file mode 100644 index 0000000..2ec7506 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllOrganizations200Response.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.OrganizationsResponse; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * GetAllOrganizations200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GetAllOrganizations200Response { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<OrganizationsResponse> data = new ArrayList<>(); + + public GetAllOrganizations200Response() { + } + + public GetAllOrganizations200Response data(@javax.annotation.Nullable List<OrganizationsResponse> data) { + this.data = data; + return this; + } + + public GetAllOrganizations200Response addDataItem(OrganizationsResponse dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<OrganizationsResponse> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<OrganizationsResponse> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GetAllOrganizations200Response instance itself + */ + public GetAllOrganizations200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAllOrganizations200Response getAllOrganizations200Response = (GetAllOrganizations200Response) o; + return Objects.equals(this.data, getAllOrganizations200Response.data)&& + Objects.equals(this.additionalProperties, getAllOrganizations200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAllOrganizations200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 GetAllOrganizations200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAllOrganizations200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetAllOrganizations200Response is not found in the empty JSON string", GetAllOrganizations200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + OrganizationsResponse.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GetAllOrganizations200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAllOrganizations200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GetAllOrganizations200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetAllOrganizations200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<GetAllOrganizations200Response>() { + @Override + public void write(JsonWriter out, GetAllOrganizations200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GetAllOrganizations200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetAllOrganizations200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetAllOrganizations200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAllOrganizations200Response + * @throws IOException if the JSON string is invalid with respect to GetAllOrganizations200Response + */ + public static GetAllOrganizations200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAllOrganizations200Response.class); + } + + /** + * Convert an instance of GetAllOrganizations200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllProviderConfigurations200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllProviderConfigurations200Response.java new file mode 100644 index 0000000..15ed5e6 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllProviderConfigurations200Response.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProviderConfigOptions; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * GetAllProviderConfigurations200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GetAllProviderConfigurations200Response { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<ProviderConfigOptions> data = new ArrayList<>(); + + public GetAllProviderConfigurations200Response() { + } + + public GetAllProviderConfigurations200Response data(@javax.annotation.Nullable List<ProviderConfigOptions> data) { + this.data = data; + return this; + } + + public GetAllProviderConfigurations200Response addDataItem(ProviderConfigOptions dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<ProviderConfigOptions> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<ProviderConfigOptions> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GetAllProviderConfigurations200Response instance itself + */ + public GetAllProviderConfigurations200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAllProviderConfigurations200Response getAllProviderConfigurations200Response = (GetAllProviderConfigurations200Response) o; + return Objects.equals(this.data, getAllProviderConfigurations200Response.data)&& + Objects.equals(this.additionalProperties, getAllProviderConfigurations200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAllProviderConfigurations200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 GetAllProviderConfigurations200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAllProviderConfigurations200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetAllProviderConfigurations200Response is not found in the empty JSON string", GetAllProviderConfigurations200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + ProviderConfigOptions.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GetAllProviderConfigurations200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAllProviderConfigurations200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GetAllProviderConfigurations200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetAllProviderConfigurations200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<GetAllProviderConfigurations200Response>() { + @Override + public void write(JsonWriter out, GetAllProviderConfigurations200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GetAllProviderConfigurations200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetAllProviderConfigurations200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetAllProviderConfigurations200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAllProviderConfigurations200Response + * @throws IOException if the JSON string is invalid with respect to GetAllProviderConfigurations200Response + */ + public static GetAllProviderConfigurations200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAllProviderConfigurations200Response.class); + } + + /** + * Convert an instance of GetAllProviderConfigurations200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllSAMLSPClientConfigurations200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllSAMLSPClientConfigurations200Response.java new file mode 100644 index 0000000..836413e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllSAMLSPClientConfigurations200Response.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.SamlSpConfig; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * GetAllSAMLSPClientConfigurations200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GetAllSAMLSPClientConfigurations200Response { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<SamlSpConfig> data = new ArrayList<>(); + + public GetAllSAMLSPClientConfigurations200Response() { + } + + public GetAllSAMLSPClientConfigurations200Response data(@javax.annotation.Nullable List<SamlSpConfig> data) { + this.data = data; + return this; + } + + public GetAllSAMLSPClientConfigurations200Response addDataItem(SamlSpConfig dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<SamlSpConfig> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<SamlSpConfig> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GetAllSAMLSPClientConfigurations200Response instance itself + */ + public GetAllSAMLSPClientConfigurations200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAllSAMLSPClientConfigurations200Response getAllSAMLSPClientConfigurations200Response = (GetAllSAMLSPClientConfigurations200Response) o; + return Objects.equals(this.data, getAllSAMLSPClientConfigurations200Response.data)&& + Objects.equals(this.additionalProperties, getAllSAMLSPClientConfigurations200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAllSAMLSPClientConfigurations200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 GetAllSAMLSPClientConfigurations200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAllSAMLSPClientConfigurations200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetAllSAMLSPClientConfigurations200Response is not found in the empty JSON string", GetAllSAMLSPClientConfigurations200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + SamlSpConfig.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GetAllSAMLSPClientConfigurations200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAllSAMLSPClientConfigurations200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GetAllSAMLSPClientConfigurations200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetAllSAMLSPClientConfigurations200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<GetAllSAMLSPClientConfigurations200Response>() { + @Override + public void write(JsonWriter out, GetAllSAMLSPClientConfigurations200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GetAllSAMLSPClientConfigurations200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetAllSAMLSPClientConfigurations200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetAllSAMLSPClientConfigurations200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAllSAMLSPClientConfigurations200Response + * @throws IOException if the JSON string is invalid with respect to GetAllSAMLSPClientConfigurations200Response + */ + public static GetAllSAMLSPClientConfigurations200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAllSAMLSPClientConfigurations200Response.class); + } + + /** + * Convert an instance of GetAllSAMLSPClientConfigurations200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllSOTT200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllSOTT200Response.java new file mode 100644 index 0000000..0e8b9e4 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllSOTT200Response.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.SottList; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * GetAllSOTT200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GetAllSOTT200Response { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<SottList> data = new ArrayList<>(); + + public GetAllSOTT200Response() { + } + + public GetAllSOTT200Response data(@javax.annotation.Nullable List<SottList> data) { + this.data = data; + return this; + } + + public GetAllSOTT200Response addDataItem(SottList dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<SottList> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<SottList> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GetAllSOTT200Response instance itself + */ + public GetAllSOTT200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAllSOTT200Response getAllSOTT200Response = (GetAllSOTT200Response) o; + return Objects.equals(this.data, getAllSOTT200Response.data)&& + Objects.equals(this.additionalProperties, getAllSOTT200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAllSOTT200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 GetAllSOTT200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAllSOTT200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetAllSOTT200Response is not found in the empty JSON string", GetAllSOTT200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + SottList.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GetAllSOTT200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAllSOTT200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GetAllSOTT200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetAllSOTT200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<GetAllSOTT200Response>() { + @Override + public void write(JsonWriter out, GetAllSOTT200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GetAllSOTT200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetAllSOTT200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetAllSOTT200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAllSOTT200Response + * @throws IOException if the JSON string is invalid with respect to GetAllSOTT200Response + */ + public static GetAllSOTT200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAllSOTT200Response.class); + } + + /** + * Convert an instance of GetAllSOTT200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllSamlIntegrations200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllSamlIntegrations200Response.java new file mode 100644 index 0000000..ccd8bee --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllSamlIntegrations200Response.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.SamlIntegrationResponse; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * GetAllSamlIntegrations200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GetAllSamlIntegrations200Response { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<SamlIntegrationResponse> data = new ArrayList<>(); + + public GetAllSamlIntegrations200Response() { + } + + public GetAllSamlIntegrations200Response data(@javax.annotation.Nullable List<SamlIntegrationResponse> data) { + this.data = data; + return this; + } + + public GetAllSamlIntegrations200Response addDataItem(SamlIntegrationResponse dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<SamlIntegrationResponse> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<SamlIntegrationResponse> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GetAllSamlIntegrations200Response instance itself + */ + public GetAllSamlIntegrations200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAllSamlIntegrations200Response getAllSamlIntegrations200Response = (GetAllSamlIntegrations200Response) o; + return Objects.equals(this.data, getAllSamlIntegrations200Response.data)&& + Objects.equals(this.additionalProperties, getAllSamlIntegrations200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAllSamlIntegrations200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 GetAllSamlIntegrations200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAllSamlIntegrations200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetAllSamlIntegrations200Response is not found in the empty JSON string", GetAllSamlIntegrations200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + SamlIntegrationResponse.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GetAllSamlIntegrations200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAllSamlIntegrations200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GetAllSamlIntegrations200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetAllSamlIntegrations200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<GetAllSamlIntegrations200Response>() { + @Override + public void write(JsonWriter out, GetAllSamlIntegrations200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GetAllSamlIntegrations200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetAllSamlIntegrations200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetAllSamlIntegrations200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAllSamlIntegrations200Response + * @throws IOException if the JSON string is invalid with respect to GetAllSamlIntegrations200Response + */ + public static GetAllSamlIntegrations200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAllSamlIntegrations200Response.class); + } + + /** + * Convert an instance of GetAllSamlIntegrations200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllTenantRoles200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllTenantRoles200Response.java new file mode 100644 index 0000000..71ad514 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllTenantRoles200Response.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.TenantRole; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * GetAllTenantRoles200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GetAllTenantRoles200Response { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<TenantRole> data = new ArrayList<>(); + + public GetAllTenantRoles200Response() { + } + + public GetAllTenantRoles200Response data(@javax.annotation.Nullable List<TenantRole> data) { + this.data = data; + return this; + } + + public GetAllTenantRoles200Response addDataItem(TenantRole dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<TenantRole> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<TenantRole> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GetAllTenantRoles200Response instance itself + */ + public GetAllTenantRoles200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAllTenantRoles200Response getAllTenantRoles200Response = (GetAllTenantRoles200Response) o; + return Objects.equals(this.data, getAllTenantRoles200Response.data)&& + Objects.equals(this.additionalProperties, getAllTenantRoles200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAllTenantRoles200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 GetAllTenantRoles200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAllTenantRoles200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetAllTenantRoles200Response is not found in the empty JSON string", GetAllTenantRoles200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + TenantRole.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GetAllTenantRoles200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAllTenantRoles200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GetAllTenantRoles200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetAllTenantRoles200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<GetAllTenantRoles200Response>() { + @Override + public void write(JsonWriter out, GetAllTenantRoles200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GetAllTenantRoles200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetAllTenantRoles200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetAllTenantRoles200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAllTenantRoles200Response + * @throws IOException if the JSON string is invalid with respect to GetAllTenantRoles200Response + */ + public static GetAllTenantRoles200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAllTenantRoles200Response.class); + } + + /** + * Convert an instance of GetAllTenantRoles200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllWorkflows200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllWorkflows200Response.java new file mode 100644 index 0000000..db32405 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetAllWorkflows200Response.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.WorkflowConfigWithoutData; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * GetAllWorkflows200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GetAllWorkflows200Response { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<WorkflowConfigWithoutData> data = new ArrayList<>(); + + public GetAllWorkflows200Response() { + } + + public GetAllWorkflows200Response data(@javax.annotation.Nullable List<WorkflowConfigWithoutData> data) { + this.data = data; + return this; + } + + public GetAllWorkflows200Response addDataItem(WorkflowConfigWithoutData dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<WorkflowConfigWithoutData> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<WorkflowConfigWithoutData> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GetAllWorkflows200Response instance itself + */ + public GetAllWorkflows200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetAllWorkflows200Response getAllWorkflows200Response = (GetAllWorkflows200Response) o; + return Objects.equals(this.data, getAllWorkflows200Response.data)&& + Objects.equals(this.additionalProperties, getAllWorkflows200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetAllWorkflows200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 GetAllWorkflows200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetAllWorkflows200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetAllWorkflows200Response is not found in the empty JSON string", GetAllWorkflows200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + WorkflowConfigWithoutData.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GetAllWorkflows200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetAllWorkflows200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GetAllWorkflows200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetAllWorkflows200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<GetAllWorkflows200Response>() { + @Override + public void write(JsonWriter out, GetAllWorkflows200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GetAllWorkflows200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetAllWorkflows200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetAllWorkflows200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetAllWorkflows200Response + * @throws IOException if the JSON string is invalid with respect to GetAllWorkflows200Response + */ + public static GetAllWorkflows200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetAllWorkflows200Response.class); + } + + /** + * Convert an instance of GetAllWorkflows200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GetConsentForms200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetConsentForms200Response.java new file mode 100644 index 0000000..0d71f90 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetConsentForms200Response.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ConsentForm; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * GetConsentForms200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GetConsentForms200Response { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<ConsentForm> data = new ArrayList<>(); + + public GetConsentForms200Response() { + } + + public GetConsentForms200Response data(@javax.annotation.Nullable List<ConsentForm> data) { + this.data = data; + return this; + } + + public GetConsentForms200Response addDataItem(ConsentForm dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<ConsentForm> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<ConsentForm> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GetConsentForms200Response instance itself + */ + public GetConsentForms200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetConsentForms200Response getConsentForms200Response = (GetConsentForms200Response) o; + return Objects.equals(this.data, getConsentForms200Response.data)&& + Objects.equals(this.additionalProperties, getConsentForms200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetConsentForms200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 GetConsentForms200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetConsentForms200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetConsentForms200Response is not found in the empty JSON string", GetConsentForms200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + ConsentForm.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GetConsentForms200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetConsentForms200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GetConsentForms200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetConsentForms200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<GetConsentForms200Response>() { + @Override + public void write(JsonWriter out, GetConsentForms200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GetConsentForms200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetConsentForms200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetConsentForms200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetConsentForms200Response + * @throws IOException if the JSON string is invalid with respect to GetConsentForms200Response + */ + public static GetConsentForms200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetConsentForms200Response.class); + } + + /** + * Convert an instance of GetConsentForms200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GetConsentOptions200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetConsentOptions200Response.java new file mode 100644 index 0000000..e0da160 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetConsentOptions200Response.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ConsentOptions; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * GetConsentOptions200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GetConsentOptions200Response { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<ConsentOptions> data = new ArrayList<>(); + + public GetConsentOptions200Response() { + } + + public GetConsentOptions200Response data(@javax.annotation.Nullable List<ConsentOptions> data) { + this.data = data; + return this; + } + + public GetConsentOptions200Response addDataItem(ConsentOptions dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<ConsentOptions> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<ConsentOptions> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GetConsentOptions200Response instance itself + */ + public GetConsentOptions200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetConsentOptions200Response getConsentOptions200Response = (GetConsentOptions200Response) o; + return Objects.equals(this.data, getConsentOptions200Response.data)&& + Objects.equals(this.additionalProperties, getConsentOptions200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetConsentOptions200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 GetConsentOptions200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetConsentOptions200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetConsentOptions200Response is not found in the empty JSON string", GetConsentOptions200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + ConsentOptions.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GetConsentOptions200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetConsentOptions200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GetConsentOptions200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetConsentOptions200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<GetConsentOptions200Response>() { + @Override + public void write(JsonWriter out, GetConsentOptions200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GetConsentOptions200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetConsentOptions200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetConsentOptions200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetConsentOptions200Response + * @throws IOException if the JSON string is invalid with respect to GetConsentOptions200Response + */ + public static GetConsentOptions200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetConsentOptions200Response.class); + } + + /** + * Convert an instance of GetConsentOptions200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GetCustomProviderKeys200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetCustomProviderKeys200Response.java new file mode 100644 index 0000000..d7ee4c3 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetCustomProviderKeys200Response.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.CustomProviderKeys; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * GetCustomProviderKeys200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GetCustomProviderKeys200Response { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<CustomProviderKeys> data = new ArrayList<>(); + + public GetCustomProviderKeys200Response() { + } + + public GetCustomProviderKeys200Response data(@javax.annotation.Nullable List<CustomProviderKeys> data) { + this.data = data; + return this; + } + + public GetCustomProviderKeys200Response addDataItem(CustomProviderKeys dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<CustomProviderKeys> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<CustomProviderKeys> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GetCustomProviderKeys200Response instance itself + */ + public GetCustomProviderKeys200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetCustomProviderKeys200Response getCustomProviderKeys200Response = (GetCustomProviderKeys200Response) o; + return Objects.equals(this.data, getCustomProviderKeys200Response.data)&& + Objects.equals(this.additionalProperties, getCustomProviderKeys200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetCustomProviderKeys200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 GetCustomProviderKeys200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetCustomProviderKeys200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetCustomProviderKeys200Response is not found in the empty JSON string", GetCustomProviderKeys200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + CustomProviderKeys.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GetCustomProviderKeys200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetCustomProviderKeys200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GetCustomProviderKeys200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetCustomProviderKeys200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<GetCustomProviderKeys200Response>() { + @Override + public void write(JsonWriter out, GetCustomProviderKeys200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GetCustomProviderKeys200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetCustomProviderKeys200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetCustomProviderKeys200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetCustomProviderKeys200Response + * @throws IOException if the JSON string is invalid with respect to GetCustomProviderKeys200Response + */ + public static GetCustomProviderKeys200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetCustomProviderKeys200Response.class); + } + + /** + * Convert an instance of GetCustomProviderKeys200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GetEmailTemplates200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetEmailTemplates200Response.java new file mode 100644 index 0000000..1de306c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetEmailTemplates200Response.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.EmailTemplateResponse; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * GetEmailTemplates200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GetEmailTemplates200Response { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<EmailTemplateResponse> data = new ArrayList<>(); + + public GetEmailTemplates200Response() { + } + + public GetEmailTemplates200Response data(@javax.annotation.Nullable List<EmailTemplateResponse> data) { + this.data = data; + return this; + } + + public GetEmailTemplates200Response addDataItem(EmailTemplateResponse dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<EmailTemplateResponse> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<EmailTemplateResponse> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GetEmailTemplates200Response instance itself + */ + public GetEmailTemplates200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetEmailTemplates200Response getEmailTemplates200Response = (GetEmailTemplates200Response) o; + return Objects.equals(this.data, getEmailTemplates200Response.data)&& + Objects.equals(this.additionalProperties, getEmailTemplates200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetEmailTemplates200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 GetEmailTemplates200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetEmailTemplates200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetEmailTemplates200Response is not found in the empty JSON string", GetEmailTemplates200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + EmailTemplateResponse.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GetEmailTemplates200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetEmailTemplates200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GetEmailTemplates200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetEmailTemplates200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<GetEmailTemplates200Response>() { + @Override + public void write(JsonWriter out, GetEmailTemplates200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GetEmailTemplates200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetEmailTemplates200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetEmailTemplates200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetEmailTemplates200Response + * @throws IOException if the JSON string is invalid with respect to GetEmailTemplates200Response + */ + public static GetEmailTemplates200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetEmailTemplates200Response.class); + } + + /** + * Convert an instance of GetEmailTemplates200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GetInvitationsByOrgId200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetInvitationsByOrgId200Response.java new file mode 100644 index 0000000..f0ba3fe --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetInvitationsByOrgId200Response.java @@ -0,0 +1,336 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.Invitation; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * GetInvitationsByOrgId200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GetInvitationsByOrgId200Response { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<Invitation> data = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TOTAL_COUNT = "TotalCount"; + @SerializedName(SERIALIZED_NAME_TOTAL_COUNT) + @javax.annotation.Nullable + private Integer totalCount; + + public GetInvitationsByOrgId200Response() { + } + + public GetInvitationsByOrgId200Response data(@javax.annotation.Nullable List<Invitation> data) { + this.data = data; + return this; + } + + public GetInvitationsByOrgId200Response addDataItem(Invitation dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<Invitation> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<Invitation> data) { + this.data = data; + } + + + public GetInvitationsByOrgId200Response totalCount(@javax.annotation.Nullable Integer totalCount) { + this.totalCount = totalCount; + return this; + } + + /** + * Get totalCount + * @return totalCount + */ + @javax.annotation.Nullable + public Integer getTotalCount() { + return totalCount; + } + + public void setTotalCount(@javax.annotation.Nullable Integer totalCount) { + this.totalCount = totalCount; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GetInvitationsByOrgId200Response instance itself + */ + public GetInvitationsByOrgId200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetInvitationsByOrgId200Response getInvitationsByOrgId200Response = (GetInvitationsByOrgId200Response) o; + return Objects.equals(this.data, getInvitationsByOrgId200Response.data) && + Objects.equals(this.totalCount, getInvitationsByOrgId200Response.totalCount)&& + Objects.equals(this.additionalProperties, getInvitationsByOrgId200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, totalCount, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetInvitationsByOrgId200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" totalCount: ").append(toIndentedString(totalCount)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + openapiFields.add("TotalCount"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 GetInvitationsByOrgId200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetInvitationsByOrgId200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetInvitationsByOrgId200Response is not found in the empty JSON string", GetInvitationsByOrgId200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + Invitation.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GetInvitationsByOrgId200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetInvitationsByOrgId200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GetInvitationsByOrgId200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetInvitationsByOrgId200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<GetInvitationsByOrgId200Response>() { + @Override + public void write(JsonWriter out, GetInvitationsByOrgId200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GetInvitationsByOrgId200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetInvitationsByOrgId200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetInvitationsByOrgId200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetInvitationsByOrgId200Response + * @throws IOException if the JSON string is invalid with respect to GetInvitationsByOrgId200Response + */ + public static GetInvitationsByOrgId200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetInvitationsByOrgId200Response.class); + } + + /** + * Convert an instance of GetInvitationsByOrgId200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GetJWTTokenByLoginCredentialsRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetJWTTokenByLoginCredentialsRequest.java new file mode 100644 index 0000000..c4d909f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetJWTTokenByLoginCredentialsRequest.java @@ -0,0 +1,321 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.LoginByEmail; +import com.loginradius.sdk.internal.openapi.model.LoginByPhone; +import com.loginradius.sdk.internal.openapi.model.LoginByUserName; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GetJWTTokenByLoginCredentialsRequest extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(GetJWTTokenByLoginCredentialsRequest.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GetJWTTokenByLoginCredentialsRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetJWTTokenByLoginCredentialsRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<LoginByEmail> adapterLoginByEmail = gson.getDelegateAdapter(this, TypeToken.get(LoginByEmail.class)); + final TypeAdapter<LoginByPhone> adapterLoginByPhone = gson.getDelegateAdapter(this, TypeToken.get(LoginByPhone.class)); + final TypeAdapter<LoginByUserName> adapterLoginByUserName = gson.getDelegateAdapter(this, TypeToken.get(LoginByUserName.class)); + + return (TypeAdapter<T>) new TypeAdapter<GetJWTTokenByLoginCredentialsRequest>() { + @Override + public void write(JsonWriter out, GetJWTTokenByLoginCredentialsRequest value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `LoginByEmail` + if (value.getActualInstance() instanceof LoginByEmail) { + JsonElement element = adapterLoginByEmail.toJsonTree((LoginByEmail)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `LoginByPhone` + if (value.getActualInstance() instanceof LoginByPhone) { + JsonElement element = adapterLoginByPhone.toJsonTree((LoginByPhone)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `LoginByUserName` + if (value.getActualInstance() instanceof LoginByUserName) { + JsonElement element = adapterLoginByUserName.toJsonTree((LoginByUserName)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: LoginByEmail, LoginByPhone, LoginByUserName"); + } + + @Override + public GetJWTTokenByLoginCredentialsRequest read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize LoginByEmail + try { + // validate the JSON object to see if any exception is thrown + LoginByEmail.validateJsonElement(jsonElement); + actualAdapter = adapterLoginByEmail; + match++; + log.log(Level.FINER, "Input data matches schema 'LoginByEmail'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for LoginByEmail failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'LoginByEmail'", e); + } + // deserialize LoginByPhone + try { + // validate the JSON object to see if any exception is thrown + LoginByPhone.validateJsonElement(jsonElement); + actualAdapter = adapterLoginByPhone; + match++; + log.log(Level.FINER, "Input data matches schema 'LoginByPhone'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for LoginByPhone failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'LoginByPhone'", e); + } + // deserialize LoginByUserName + try { + // validate the JSON object to see if any exception is thrown + LoginByUserName.validateJsonElement(jsonElement); + actualAdapter = adapterLoginByUserName; + match++; + log.log(Level.FINER, "Input data matches schema 'LoginByUserName'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for LoginByUserName failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'LoginByUserName'", e); + } + + if (match == 1) { + GetJWTTokenByLoginCredentialsRequest ret = new GetJWTTokenByLoginCredentialsRequest(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for GetJWTTokenByLoginCredentialsRequest: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public GetJWTTokenByLoginCredentialsRequest() { + super("oneOf", Boolean.FALSE); + } + + public GetJWTTokenByLoginCredentialsRequest(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("LoginByEmail", LoginByEmail.class); + schemas.put("LoginByPhone", LoginByPhone.class); + schemas.put("LoginByUserName", LoginByUserName.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return GetJWTTokenByLoginCredentialsRequest.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * LoginByEmail, LoginByPhone, LoginByUserName + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof LoginByEmail) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof LoginByPhone) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof LoginByUserName) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be LoginByEmail, LoginByPhone, LoginByUserName"); + } + + /** + * Get the actual instance, which can be the following: + * LoginByEmail, LoginByPhone, LoginByUserName + * + * @return The actual instance (LoginByEmail, LoginByPhone, LoginByUserName) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `LoginByEmail`. If the actual instance is not `LoginByEmail`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `LoginByEmail` + * @throws ClassCastException if the instance is not `LoginByEmail` + */ + public LoginByEmail getLoginByEmail() throws ClassCastException { + return (LoginByEmail)super.getActualInstance(); + } + + /** + * Get the actual instance of `LoginByPhone`. If the actual instance is not `LoginByPhone`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `LoginByPhone` + * @throws ClassCastException if the instance is not `LoginByPhone` + */ + public LoginByPhone getLoginByPhone() throws ClassCastException { + return (LoginByPhone)super.getActualInstance(); + } + + /** + * Get the actual instance of `LoginByUserName`. If the actual instance is not `LoginByUserName`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `LoginByUserName` + * @throws ClassCastException if the instance is not `LoginByUserName` + */ + public LoginByUserName getLoginByUserName() throws ClassCastException { + return (LoginByUserName)super.getActualInstance(); + } + + /** + * 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 GetJWTTokenByLoginCredentialsRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with LoginByEmail + try { + LoginByEmail.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for LoginByEmail failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with LoginByPhone + try { + LoginByPhone.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for LoginByPhone failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with LoginByUserName + try { + LoginByUserName.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for LoginByUserName failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for GetJWTTokenByLoginCredentialsRequest with oneOf schemas: LoginByEmail, LoginByPhone, LoginByUserName. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of GetJWTTokenByLoginCredentialsRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetJWTTokenByLoginCredentialsRequest + * @throws IOException if the JSON string is invalid with respect to GetJWTTokenByLoginCredentialsRequest + */ + public static GetJWTTokenByLoginCredentialsRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetJWTTokenByLoginCredentialsRequest.class); + } + + /** + * Convert an instance of GetJWTTokenByLoginCredentialsRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GetJwtIntegrationSupportedAlgoList200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetJwtIntegrationSupportedAlgoList200Response.java new file mode 100644 index 0000000..cc316b6 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetJwtIntegrationSupportedAlgoList200Response.java @@ -0,0 +1,298 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.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.loginradius.sdk.internal.openapi.JSON; + +/** + * GetJwtIntegrationSupportedAlgoList200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GetJwtIntegrationSupportedAlgoList200Response { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<String> data = new ArrayList<>(); + + public GetJwtIntegrationSupportedAlgoList200Response() { + } + + public GetJwtIntegrationSupportedAlgoList200Response data(@javax.annotation.Nullable List<String> data) { + this.data = data; + return this; + } + + public GetJwtIntegrationSupportedAlgoList200Response addDataItem(String dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<String> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<String> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GetJwtIntegrationSupportedAlgoList200Response instance itself + */ + public GetJwtIntegrationSupportedAlgoList200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetJwtIntegrationSupportedAlgoList200Response getJwtIntegrationSupportedAlgoList200Response = (GetJwtIntegrationSupportedAlgoList200Response) o; + return Objects.equals(this.data, getJwtIntegrationSupportedAlgoList200Response.data)&& + Objects.equals(this.additionalProperties, getJwtIntegrationSupportedAlgoList200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetJwtIntegrationSupportedAlgoList200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 GetJwtIntegrationSupportedAlgoList200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetJwtIntegrationSupportedAlgoList200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetJwtIntegrationSupportedAlgoList200Response is not found in the empty JSON string", GetJwtIntegrationSupportedAlgoList200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull() && !jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GetJwtIntegrationSupportedAlgoList200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetJwtIntegrationSupportedAlgoList200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GetJwtIntegrationSupportedAlgoList200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetJwtIntegrationSupportedAlgoList200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<GetJwtIntegrationSupportedAlgoList200Response>() { + @Override + public void write(JsonWriter out, GetJwtIntegrationSupportedAlgoList200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GetJwtIntegrationSupportedAlgoList200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetJwtIntegrationSupportedAlgoList200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetJwtIntegrationSupportedAlgoList200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetJwtIntegrationSupportedAlgoList200Response + * @throws IOException if the JSON string is invalid with respect to GetJwtIntegrationSupportedAlgoList200Response + */ + public static GetJwtIntegrationSupportedAlgoList200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetJwtIntegrationSupportedAlgoList200Response.class); + } + + /** + * Convert an instance of GetJwtIntegrationSupportedAlgoList200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GetOAuthClientConnectionsMetadata200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetOAuthClientConnectionsMetadata200Response.java new file mode 100644 index 0000000..38fcefb --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetOAuthClientConnectionsMetadata200Response.java @@ -0,0 +1,376 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.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.loginradius.sdk.internal.openapi.JSON; + +/** + * GetOAuthClientConnectionsMetadata200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GetOAuthClientConnectionsMetadata200Response { + public static final String SERIALIZED_NAME_CUSTOM_IDP = "CustomIdp"; + @SerializedName(SERIALIZED_NAME_CUSTOM_IDP) + @javax.annotation.Nullable + private List<String> customIdp = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ENTERPRISE = "Enterprise"; + @SerializedName(SERIALIZED_NAME_ENTERPRISE) + @javax.annotation.Nullable + private List<String> enterprise = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SOCIAL_LOGINS = "SocialLogins"; + @SerializedName(SERIALIZED_NAME_SOCIAL_LOGINS) + @javax.annotation.Nullable + private List<String> socialLogins = new ArrayList<>(); + + public GetOAuthClientConnectionsMetadata200Response() { + } + + public GetOAuthClientConnectionsMetadata200Response customIdp(@javax.annotation.Nullable List<String> customIdp) { + this.customIdp = customIdp; + return this; + } + + public GetOAuthClientConnectionsMetadata200Response addCustomIdpItem(String customIdpItem) { + if (this.customIdp == null) { + this.customIdp = new ArrayList<>(); + } + this.customIdp.add(customIdpItem); + return this; + } + + /** + * Get customIdp + * @return customIdp + */ + @javax.annotation.Nullable + public List<String> getCustomIdp() { + return customIdp; + } + + public void setCustomIdp(@javax.annotation.Nullable List<String> customIdp) { + this.customIdp = customIdp; + } + + + public GetOAuthClientConnectionsMetadata200Response enterprise(@javax.annotation.Nullable List<String> enterprise) { + this.enterprise = enterprise; + return this; + } + + public GetOAuthClientConnectionsMetadata200Response addEnterpriseItem(String enterpriseItem) { + if (this.enterprise == null) { + this.enterprise = new ArrayList<>(); + } + this.enterprise.add(enterpriseItem); + return this; + } + + /** + * Get enterprise + * @return enterprise + */ + @javax.annotation.Nullable + public List<String> getEnterprise() { + return enterprise; + } + + public void setEnterprise(@javax.annotation.Nullable List<String> enterprise) { + this.enterprise = enterprise; + } + + + public GetOAuthClientConnectionsMetadata200Response socialLogins(@javax.annotation.Nullable List<String> socialLogins) { + this.socialLogins = socialLogins; + return this; + } + + public GetOAuthClientConnectionsMetadata200Response addSocialLoginsItem(String socialLoginsItem) { + if (this.socialLogins == null) { + this.socialLogins = new ArrayList<>(); + } + this.socialLogins.add(socialLoginsItem); + return this; + } + + /** + * Get socialLogins + * @return socialLogins + */ + @javax.annotation.Nullable + public List<String> getSocialLogins() { + return socialLogins; + } + + public void setSocialLogins(@javax.annotation.Nullable List<String> socialLogins) { + this.socialLogins = socialLogins; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GetOAuthClientConnectionsMetadata200Response instance itself + */ + public GetOAuthClientConnectionsMetadata200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetOAuthClientConnectionsMetadata200Response getOAuthClientConnectionsMetadata200Response = (GetOAuthClientConnectionsMetadata200Response) o; + return Objects.equals(this.customIdp, getOAuthClientConnectionsMetadata200Response.customIdp) && + Objects.equals(this.enterprise, getOAuthClientConnectionsMetadata200Response.enterprise) && + Objects.equals(this.socialLogins, getOAuthClientConnectionsMetadata200Response.socialLogins)&& + Objects.equals(this.additionalProperties, getOAuthClientConnectionsMetadata200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(customIdp, enterprise, socialLogins, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetOAuthClientConnectionsMetadata200Response {\n"); + sb.append(" customIdp: ").append(toIndentedString(customIdp)).append("\n"); + sb.append(" enterprise: ").append(toIndentedString(enterprise)).append("\n"); + sb.append(" socialLogins: ").append(toIndentedString(socialLogins)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("CustomIdp"); + openapiFields.add("Enterprise"); + openapiFields.add("SocialLogins"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 GetOAuthClientConnectionsMetadata200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetOAuthClientConnectionsMetadata200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetOAuthClientConnectionsMetadata200Response is not found in the empty JSON string", GetOAuthClientConnectionsMetadata200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("CustomIdp") != null && !jsonObj.get("CustomIdp").isJsonNull() && !jsonObj.get("CustomIdp").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `CustomIdp` to be an array in the JSON string but got `%s`", jsonObj.get("CustomIdp").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("Enterprise") != null && !jsonObj.get("Enterprise").isJsonNull() && !jsonObj.get("Enterprise").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Enterprise` to be an array in the JSON string but got `%s`", jsonObj.get("Enterprise").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("SocialLogins") != null && !jsonObj.get("SocialLogins").isJsonNull() && !jsonObj.get("SocialLogins").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `SocialLogins` to be an array in the JSON string but got `%s`", jsonObj.get("SocialLogins").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GetOAuthClientConnectionsMetadata200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetOAuthClientConnectionsMetadata200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GetOAuthClientConnectionsMetadata200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetOAuthClientConnectionsMetadata200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<GetOAuthClientConnectionsMetadata200Response>() { + @Override + public void write(JsonWriter out, GetOAuthClientConnectionsMetadata200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GetOAuthClientConnectionsMetadata200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetOAuthClientConnectionsMetadata200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetOAuthClientConnectionsMetadata200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetOAuthClientConnectionsMetadata200Response + * @throws IOException if the JSON string is invalid with respect to GetOAuthClientConnectionsMetadata200Response + */ + public static GetOAuthClientConnectionsMetadata200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetOAuthClientConnectionsMetadata200Response.class); + } + + /** + * Convert an instance of GetOAuthClientConnectionsMetadata200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GetOAuthTokensRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetOAuthTokensRequest.java new file mode 100644 index 0000000..6e19d25 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetOAuthTokensRequest.java @@ -0,0 +1,455 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.OAuthAuthorizationCodeFlow; +import com.loginradius.sdk.internal.openapi.model.OAuthAuthorizationCodePKCEFlow; +import com.loginradius.sdk.internal.openapi.model.OAuthDeviceCodeFlow; +import com.loginradius.sdk.internal.openapi.model.OAuthLoginRadiusTokenExchangeFlow; +import com.loginradius.sdk.internal.openapi.model.OAuthPasswordCredentialFlow; +import com.loginradius.sdk.internal.openapi.model.OAuthRefreshTokenFlow; +import java.io.IOException; +import java.util.Arrays; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GetOAuthTokensRequest extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(GetOAuthTokensRequest.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GetOAuthTokensRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetOAuthTokensRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthAuthorizationCodeFlow> adapterOAuthAuthorizationCodeFlow = gson.getDelegateAdapter(this, TypeToken.get(OAuthAuthorizationCodeFlow.class)); + final TypeAdapter<OAuthAuthorizationCodePKCEFlow> adapterOAuthAuthorizationCodePKCEFlow = gson.getDelegateAdapter(this, TypeToken.get(OAuthAuthorizationCodePKCEFlow.class)); + final TypeAdapter<OAuthRefreshTokenFlow> adapterOAuthRefreshTokenFlow = gson.getDelegateAdapter(this, TypeToken.get(OAuthRefreshTokenFlow.class)); + final TypeAdapter<OAuthPasswordCredentialFlow> adapterOAuthPasswordCredentialFlow = gson.getDelegateAdapter(this, TypeToken.get(OAuthPasswordCredentialFlow.class)); + final TypeAdapter<OAuthDeviceCodeFlow> adapterOAuthDeviceCodeFlow = gson.getDelegateAdapter(this, TypeToken.get(OAuthDeviceCodeFlow.class)); + final TypeAdapter<OAuthLoginRadiusTokenExchangeFlow> adapterOAuthLoginRadiusTokenExchangeFlow = gson.getDelegateAdapter(this, TypeToken.get(OAuthLoginRadiusTokenExchangeFlow.class)); + + return (TypeAdapter<T>) new TypeAdapter<GetOAuthTokensRequest>() { + @Override + public void write(JsonWriter out, GetOAuthTokensRequest value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `OAuthAuthorizationCodeFlow` + if (value.getActualInstance() instanceof OAuthAuthorizationCodeFlow) { + JsonElement element = adapterOAuthAuthorizationCodeFlow.toJsonTree((OAuthAuthorizationCodeFlow)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `OAuthAuthorizationCodePKCEFlow` + if (value.getActualInstance() instanceof OAuthAuthorizationCodePKCEFlow) { + JsonElement element = adapterOAuthAuthorizationCodePKCEFlow.toJsonTree((OAuthAuthorizationCodePKCEFlow)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `OAuthRefreshTokenFlow` + if (value.getActualInstance() instanceof OAuthRefreshTokenFlow) { + JsonElement element = adapterOAuthRefreshTokenFlow.toJsonTree((OAuthRefreshTokenFlow)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `OAuthPasswordCredentialFlow` + if (value.getActualInstance() instanceof OAuthPasswordCredentialFlow) { + JsonElement element = adapterOAuthPasswordCredentialFlow.toJsonTree((OAuthPasswordCredentialFlow)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `OAuthDeviceCodeFlow` + if (value.getActualInstance() instanceof OAuthDeviceCodeFlow) { + JsonElement element = adapterOAuthDeviceCodeFlow.toJsonTree((OAuthDeviceCodeFlow)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `OAuthLoginRadiusTokenExchangeFlow` + if (value.getActualInstance() instanceof OAuthLoginRadiusTokenExchangeFlow) { + JsonElement element = adapterOAuthLoginRadiusTokenExchangeFlow.toJsonTree((OAuthLoginRadiusTokenExchangeFlow)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: OAuthAuthorizationCodeFlow, OAuthAuthorizationCodePKCEFlow, OAuthDeviceCodeFlow, OAuthLoginRadiusTokenExchangeFlow, OAuthPasswordCredentialFlow, OAuthRefreshTokenFlow"); + } + + @Override + public GetOAuthTokensRequest read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize OAuthAuthorizationCodeFlow + try { + // validate the JSON object to see if any exception is thrown + OAuthAuthorizationCodeFlow.validateJsonElement(jsonElement); + actualAdapter = adapterOAuthAuthorizationCodeFlow; + match++; + log.log(Level.FINER, "Input data matches schema 'OAuthAuthorizationCodeFlow'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for OAuthAuthorizationCodeFlow failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'OAuthAuthorizationCodeFlow'", e); + } + // deserialize OAuthAuthorizationCodePKCEFlow + try { + // validate the JSON object to see if any exception is thrown + OAuthAuthorizationCodePKCEFlow.validateJsonElement(jsonElement); + actualAdapter = adapterOAuthAuthorizationCodePKCEFlow; + match++; + log.log(Level.FINER, "Input data matches schema 'OAuthAuthorizationCodePKCEFlow'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for OAuthAuthorizationCodePKCEFlow failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'OAuthAuthorizationCodePKCEFlow'", e); + } + // deserialize OAuthRefreshTokenFlow + try { + // validate the JSON object to see if any exception is thrown + OAuthRefreshTokenFlow.validateJsonElement(jsonElement); + actualAdapter = adapterOAuthRefreshTokenFlow; + match++; + log.log(Level.FINER, "Input data matches schema 'OAuthRefreshTokenFlow'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for OAuthRefreshTokenFlow failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'OAuthRefreshTokenFlow'", e); + } + // deserialize OAuthPasswordCredentialFlow + try { + // validate the JSON object to see if any exception is thrown + OAuthPasswordCredentialFlow.validateJsonElement(jsonElement); + actualAdapter = adapterOAuthPasswordCredentialFlow; + match++; + log.log(Level.FINER, "Input data matches schema 'OAuthPasswordCredentialFlow'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for OAuthPasswordCredentialFlow failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'OAuthPasswordCredentialFlow'", e); + } + // deserialize OAuthDeviceCodeFlow + try { + // validate the JSON object to see if any exception is thrown + OAuthDeviceCodeFlow.validateJsonElement(jsonElement); + actualAdapter = adapterOAuthDeviceCodeFlow; + match++; + log.log(Level.FINER, "Input data matches schema 'OAuthDeviceCodeFlow'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for OAuthDeviceCodeFlow failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'OAuthDeviceCodeFlow'", e); + } + // deserialize OAuthLoginRadiusTokenExchangeFlow + try { + // validate the JSON object to see if any exception is thrown + OAuthLoginRadiusTokenExchangeFlow.validateJsonElement(jsonElement); + actualAdapter = adapterOAuthLoginRadiusTokenExchangeFlow; + match++; + log.log(Level.FINER, "Input data matches schema 'OAuthLoginRadiusTokenExchangeFlow'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for OAuthLoginRadiusTokenExchangeFlow failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'OAuthLoginRadiusTokenExchangeFlow'", e); + } + + if (match == 1) { + GetOAuthTokensRequest ret = new GetOAuthTokensRequest(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for GetOAuthTokensRequest: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public GetOAuthTokensRequest() { + super("oneOf", Boolean.FALSE); + } + + public GetOAuthTokensRequest(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("OAuthAuthorizationCodeFlow", OAuthAuthorizationCodeFlow.class); + schemas.put("OAuthAuthorizationCodePKCEFlow", OAuthAuthorizationCodePKCEFlow.class); + schemas.put("OAuthRefreshTokenFlow", OAuthRefreshTokenFlow.class); + schemas.put("OAuthPasswordCredentialFlow", OAuthPasswordCredentialFlow.class); + schemas.put("OAuthDeviceCodeFlow", OAuthDeviceCodeFlow.class); + schemas.put("OAuthLoginRadiusTokenExchangeFlow", OAuthLoginRadiusTokenExchangeFlow.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return GetOAuthTokensRequest.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * OAuthAuthorizationCodeFlow, OAuthAuthorizationCodePKCEFlow, OAuthDeviceCodeFlow, OAuthLoginRadiusTokenExchangeFlow, OAuthPasswordCredentialFlow, OAuthRefreshTokenFlow + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof OAuthAuthorizationCodeFlow) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof OAuthAuthorizationCodePKCEFlow) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof OAuthRefreshTokenFlow) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof OAuthPasswordCredentialFlow) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof OAuthDeviceCodeFlow) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof OAuthLoginRadiusTokenExchangeFlow) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be OAuthAuthorizationCodeFlow, OAuthAuthorizationCodePKCEFlow, OAuthDeviceCodeFlow, OAuthLoginRadiusTokenExchangeFlow, OAuthPasswordCredentialFlow, OAuthRefreshTokenFlow"); + } + + /** + * Get the actual instance, which can be the following: + * OAuthAuthorizationCodeFlow, OAuthAuthorizationCodePKCEFlow, OAuthDeviceCodeFlow, OAuthLoginRadiusTokenExchangeFlow, OAuthPasswordCredentialFlow, OAuthRefreshTokenFlow + * + * @return The actual instance (OAuthAuthorizationCodeFlow, OAuthAuthorizationCodePKCEFlow, OAuthDeviceCodeFlow, OAuthLoginRadiusTokenExchangeFlow, OAuthPasswordCredentialFlow, OAuthRefreshTokenFlow) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `OAuthAuthorizationCodeFlow`. If the actual instance is not `OAuthAuthorizationCodeFlow`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `OAuthAuthorizationCodeFlow` + * @throws ClassCastException if the instance is not `OAuthAuthorizationCodeFlow` + */ + public OAuthAuthorizationCodeFlow getOAuthAuthorizationCodeFlow() throws ClassCastException { + return (OAuthAuthorizationCodeFlow)super.getActualInstance(); + } + + /** + * Get the actual instance of `OAuthAuthorizationCodePKCEFlow`. If the actual instance is not `OAuthAuthorizationCodePKCEFlow`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `OAuthAuthorizationCodePKCEFlow` + * @throws ClassCastException if the instance is not `OAuthAuthorizationCodePKCEFlow` + */ + public OAuthAuthorizationCodePKCEFlow getOAuthAuthorizationCodePKCEFlow() throws ClassCastException { + return (OAuthAuthorizationCodePKCEFlow)super.getActualInstance(); + } + + /** + * Get the actual instance of `OAuthRefreshTokenFlow`. If the actual instance is not `OAuthRefreshTokenFlow`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `OAuthRefreshTokenFlow` + * @throws ClassCastException if the instance is not `OAuthRefreshTokenFlow` + */ + public OAuthRefreshTokenFlow getOAuthRefreshTokenFlow() throws ClassCastException { + return (OAuthRefreshTokenFlow)super.getActualInstance(); + } + + /** + * Get the actual instance of `OAuthPasswordCredentialFlow`. If the actual instance is not `OAuthPasswordCredentialFlow`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `OAuthPasswordCredentialFlow` + * @throws ClassCastException if the instance is not `OAuthPasswordCredentialFlow` + */ + public OAuthPasswordCredentialFlow getOAuthPasswordCredentialFlow() throws ClassCastException { + return (OAuthPasswordCredentialFlow)super.getActualInstance(); + } + + /** + * Get the actual instance of `OAuthDeviceCodeFlow`. If the actual instance is not `OAuthDeviceCodeFlow`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `OAuthDeviceCodeFlow` + * @throws ClassCastException if the instance is not `OAuthDeviceCodeFlow` + */ + public OAuthDeviceCodeFlow getOAuthDeviceCodeFlow() throws ClassCastException { + return (OAuthDeviceCodeFlow)super.getActualInstance(); + } + + /** + * Get the actual instance of `OAuthLoginRadiusTokenExchangeFlow`. If the actual instance is not `OAuthLoginRadiusTokenExchangeFlow`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `OAuthLoginRadiusTokenExchangeFlow` + * @throws ClassCastException if the instance is not `OAuthLoginRadiusTokenExchangeFlow` + */ + public OAuthLoginRadiusTokenExchangeFlow getOAuthLoginRadiusTokenExchangeFlow() throws ClassCastException { + return (OAuthLoginRadiusTokenExchangeFlow)super.getActualInstance(); + } + + /** + * 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 GetOAuthTokensRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with OAuthAuthorizationCodeFlow + try { + OAuthAuthorizationCodeFlow.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for OAuthAuthorizationCodeFlow failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with OAuthAuthorizationCodePKCEFlow + try { + OAuthAuthorizationCodePKCEFlow.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for OAuthAuthorizationCodePKCEFlow failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with OAuthRefreshTokenFlow + try { + OAuthRefreshTokenFlow.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for OAuthRefreshTokenFlow failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with OAuthPasswordCredentialFlow + try { + OAuthPasswordCredentialFlow.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for OAuthPasswordCredentialFlow failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with OAuthDeviceCodeFlow + try { + OAuthDeviceCodeFlow.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for OAuthDeviceCodeFlow failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with OAuthLoginRadiusTokenExchangeFlow + try { + OAuthLoginRadiusTokenExchangeFlow.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for OAuthLoginRadiusTokenExchangeFlow failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for GetOAuthTokensRequest with oneOf schemas: OAuthAuthorizationCodeFlow, OAuthAuthorizationCodePKCEFlow, OAuthDeviceCodeFlow, OAuthLoginRadiusTokenExchangeFlow, OAuthPasswordCredentialFlow, OAuthRefreshTokenFlow. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of GetOAuthTokensRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetOAuthTokensRequest + * @throws IOException if the JSON string is invalid with respect to GetOAuthTokensRequest + */ + public static GetOAuthTokensRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetOAuthTokensRequest.class); + } + + /** + * Convert an instance of GetOAuthTokensRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GetOrgContextByUid200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetOrgContextByUid200Response.java new file mode 100644 index 0000000..471de3c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetOrgContextByUid200Response.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.UserRole; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * GetOrgContextByUid200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GetOrgContextByUid200Response { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<UserRole> data = new ArrayList<>(); + + public GetOrgContextByUid200Response() { + } + + public GetOrgContextByUid200Response data(@javax.annotation.Nullable List<UserRole> data) { + this.data = data; + return this; + } + + public GetOrgContextByUid200Response addDataItem(UserRole dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<UserRole> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<UserRole> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GetOrgContextByUid200Response instance itself + */ + public GetOrgContextByUid200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetOrgContextByUid200Response getOrgContextByUid200Response = (GetOrgContextByUid200Response) o; + return Objects.equals(this.data, getOrgContextByUid200Response.data)&& + Objects.equals(this.additionalProperties, getOrgContextByUid200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetOrgContextByUid200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 GetOrgContextByUid200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetOrgContextByUid200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetOrgContextByUid200Response is not found in the empty JSON string", GetOrgContextByUid200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + UserRole.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GetOrgContextByUid200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetOrgContextByUid200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GetOrgContextByUid200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetOrgContextByUid200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<GetOrgContextByUid200Response>() { + @Override + public void write(JsonWriter out, GetOrgContextByUid200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GetOrgContextByUid200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetOrgContextByUid200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetOrgContextByUid200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetOrgContextByUid200Response + * @throws IOException if the JSON string is invalid with respect to GetOrgContextByUid200Response + */ + public static GetOrgContextByUid200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetOrgContextByUid200Response.class); + } + + /** + * Convert an instance of GetOrgContextByUid200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GetSamlSPClientMappingKeys200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetSamlSPClientMappingKeys200Response.java new file mode 100644 index 0000000..bcde896 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetSamlSPClientMappingKeys200Response.java @@ -0,0 +1,298 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.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.loginradius.sdk.internal.openapi.JSON; + +/** + * GetSamlSPClientMappingKeys200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GetSamlSPClientMappingKeys200Response { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<List<String>> data = new ArrayList<>(); + + public GetSamlSPClientMappingKeys200Response() { + } + + public GetSamlSPClientMappingKeys200Response data(@javax.annotation.Nullable List<List<String>> data) { + this.data = data; + return this; + } + + public GetSamlSPClientMappingKeys200Response addDataItem(List<String> dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<List<String>> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<List<String>> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GetSamlSPClientMappingKeys200Response instance itself + */ + public GetSamlSPClientMappingKeys200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSamlSPClientMappingKeys200Response getSamlSPClientMappingKeys200Response = (GetSamlSPClientMappingKeys200Response) o; + return Objects.equals(this.data, getSamlSPClientMappingKeys200Response.data)&& + Objects.equals(this.additionalProperties, getSamlSPClientMappingKeys200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSamlSPClientMappingKeys200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 GetSamlSPClientMappingKeys200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetSamlSPClientMappingKeys200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetSamlSPClientMappingKeys200Response is not found in the empty JSON string", GetSamlSPClientMappingKeys200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull() && !jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GetSamlSPClientMappingKeys200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetSamlSPClientMappingKeys200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GetSamlSPClientMappingKeys200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetSamlSPClientMappingKeys200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<GetSamlSPClientMappingKeys200Response>() { + @Override + public void write(JsonWriter out, GetSamlSPClientMappingKeys200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GetSamlSPClientMappingKeys200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetSamlSPClientMappingKeys200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetSamlSPClientMappingKeys200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetSamlSPClientMappingKeys200Response + * @throws IOException if the JSON string is invalid with respect to GetSamlSPClientMappingKeys200Response + */ + public static GetSamlSPClientMappingKeys200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetSamlSPClientMappingKeys200Response.class); + } + + /** + * Convert an instance of GetSamlSPClientMappingKeys200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GetSecurityQuestions200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetSecurityQuestions200Response.java new file mode 100644 index 0000000..8a61a3f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetSecurityQuestions200Response.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.SecurityQuestion; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * GetSecurityQuestions200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GetSecurityQuestions200Response { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<SecurityQuestion> data = new ArrayList<>(); + + public GetSecurityQuestions200Response() { + } + + public GetSecurityQuestions200Response data(@javax.annotation.Nullable List<SecurityQuestion> data) { + this.data = data; + return this; + } + + public GetSecurityQuestions200Response addDataItem(SecurityQuestion dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<SecurityQuestion> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<SecurityQuestion> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GetSecurityQuestions200Response instance itself + */ + public GetSecurityQuestions200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSecurityQuestions200Response getSecurityQuestions200Response = (GetSecurityQuestions200Response) o; + return Objects.equals(this.data, getSecurityQuestions200Response.data)&& + Objects.equals(this.additionalProperties, getSecurityQuestions200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSecurityQuestions200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 GetSecurityQuestions200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetSecurityQuestions200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetSecurityQuestions200Response is not found in the empty JSON string", GetSecurityQuestions200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + SecurityQuestion.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GetSecurityQuestions200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetSecurityQuestions200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GetSecurityQuestions200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetSecurityQuestions200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<GetSecurityQuestions200Response>() { + @Override + public void write(JsonWriter out, GetSecurityQuestions200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GetSecurityQuestions200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetSecurityQuestions200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetSecurityQuestions200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetSecurityQuestions200Response + * @throws IOException if the JSON string is invalid with respect to GetSecurityQuestions200Response + */ + public static GetSecurityQuestions200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetSecurityQuestions200Response.class); + } + + /** + * Convert an instance of GetSecurityQuestions200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GetSmsTemplates200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetSmsTemplates200Response.java new file mode 100644 index 0000000..0ef3a70 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GetSmsTemplates200Response.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.SmsTemplate; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * GetSmsTemplates200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GetSmsTemplates200Response { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<SmsTemplate> data = new ArrayList<>(); + + public GetSmsTemplates200Response() { + } + + public GetSmsTemplates200Response data(@javax.annotation.Nullable List<SmsTemplate> data) { + this.data = data; + return this; + } + + public GetSmsTemplates200Response addDataItem(SmsTemplate dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<SmsTemplate> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<SmsTemplate> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GetSmsTemplates200Response instance itself + */ + public GetSmsTemplates200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GetSmsTemplates200Response getSmsTemplates200Response = (GetSmsTemplates200Response) o; + return Objects.equals(this.data, getSmsTemplates200Response.data)&& + Objects.equals(this.additionalProperties, getSmsTemplates200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GetSmsTemplates200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 GetSmsTemplates200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GetSmsTemplates200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GetSmsTemplates200Response is not found in the empty JSON string", GetSmsTemplates200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + SmsTemplate.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GetSmsTemplates200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GetSmsTemplates200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GetSmsTemplates200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GetSmsTemplates200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<GetSmsTemplates200Response>() { + @Override + public void write(JsonWriter out, GetSmsTemplates200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GetSmsTemplates200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GetSmsTemplates200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GetSmsTemplates200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of GetSmsTemplates200Response + * @throws IOException if the JSON string is invalid with respect to GetSmsTemplates200Response + */ + public static GetSmsTemplates200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GetSmsTemplates200Response.class); + } + + /** + * Convert an instance of GetSmsTemplates200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GoogleAuthenticator.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GoogleAuthenticator.java new file mode 100644 index 0000000..d4bd403 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GoogleAuthenticator.java @@ -0,0 +1,381 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * GoogleAuthenticator + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GoogleAuthenticator { + public static final String SERIALIZED_NAME_IS_ENABLED = "IsEnabled"; + @SerializedName(SERIALIZED_NAME_IS_ENABLED) + @javax.annotation.Nullable + private Boolean isEnabled; + + public static final String SERIALIZED_NAME_QR_CODE_WIDTH = "QRCodeWidth"; + @SerializedName(SERIALIZED_NAME_QR_CODE_WIDTH) + @javax.annotation.Nullable + private Integer qrCodeWidth; + + public static final String SERIALIZED_NAME_ISSUER_ID = "IssuerId"; + @SerializedName(SERIALIZED_NAME_ISSUER_ID) + @javax.annotation.Nonnull + private String issuerId; + + public static final String SERIALIZED_NAME_ACCOUNT_SECRET_KEY = "AccountSecretKey"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_SECRET_KEY) + @javax.annotation.Nullable + private String accountSecretKey; + + public GoogleAuthenticator() { + } + + public GoogleAuthenticator isEnabled(@javax.annotation.Nullable Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Indicates if TOTP Authenticator is enabled + * @return isEnabled + */ + @javax.annotation.Nullable + public Boolean getIsEnabled() { + return isEnabled; + } + + public void setIsEnabled(@javax.annotation.Nullable Boolean isEnabled) { + this.isEnabled = isEnabled; + } + + + public GoogleAuthenticator qrCodeWidth(@javax.annotation.Nullable Integer qrCodeWidth) { + this.qrCodeWidth = qrCodeWidth; + return this; + } + + /** + * Width of the QR code + * minimum: 1 + * maximum: 400 + * @return qrCodeWidth + */ + @javax.annotation.Nullable + public Integer getQrCodeWidth() { + return qrCodeWidth; + } + + public void setQrCodeWidth(@javax.annotation.Nullable Integer qrCodeWidth) { + this.qrCodeWidth = qrCodeWidth; + } + + + public GoogleAuthenticator issuerId(@javax.annotation.Nonnull String issuerId) { + this.issuerId = issuerId; + return this; + } + + /** + * Issuer ID for TOTP Authenticator + * @return issuerId + */ + @javax.annotation.Nonnull + public String getIssuerId() { + return issuerId; + } + + public void setIssuerId(@javax.annotation.Nonnull String issuerId) { + this.issuerId = issuerId; + } + + + public GoogleAuthenticator accountSecretKey(@javax.annotation.Nullable String accountSecretKey) { + this.accountSecretKey = accountSecretKey; + return this; + } + + /** + * Account secret key for TOTP Authenticator + * @return accountSecretKey + */ + @javax.annotation.Nullable + public String getAccountSecretKey() { + return accountSecretKey; + } + + public void setAccountSecretKey(@javax.annotation.Nullable String accountSecretKey) { + this.accountSecretKey = accountSecretKey; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GoogleAuthenticator instance itself + */ + public GoogleAuthenticator putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GoogleAuthenticator googleAuthenticator = (GoogleAuthenticator) o; + return Objects.equals(this.isEnabled, googleAuthenticator.isEnabled) && + Objects.equals(this.qrCodeWidth, googleAuthenticator.qrCodeWidth) && + Objects.equals(this.issuerId, googleAuthenticator.issuerId) && + Objects.equals(this.accountSecretKey, googleAuthenticator.accountSecretKey)&& + Objects.equals(this.additionalProperties, googleAuthenticator.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isEnabled, qrCodeWidth, issuerId, accountSecretKey, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GoogleAuthenticator {\n"); + sb.append(" isEnabled: ").append(toIndentedString(isEnabled)).append("\n"); + sb.append(" qrCodeWidth: ").append(toIndentedString(qrCodeWidth)).append("\n"); + sb.append(" issuerId: ").append(toIndentedString(issuerId)).append("\n"); + sb.append(" accountSecretKey: ").append(toIndentedString(accountSecretKey)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsEnabled"); + openapiFields.add("QRCodeWidth"); + openapiFields.add("IssuerId"); + openapiFields.add("AccountSecretKey"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("IssuerId"); + } + + /** + * 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 GoogleAuthenticator + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GoogleAuthenticator.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GoogleAuthenticator is not found in the empty JSON string", GoogleAuthenticator.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : GoogleAuthenticator.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("IssuerId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IssuerId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IssuerId").toString())); + } + if ((jsonObj.get("AccountSecretKey") != null && !jsonObj.get("AccountSecretKey").isJsonNull()) && !jsonObj.get("AccountSecretKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccountSecretKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccountSecretKey").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GoogleAuthenticator.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GoogleAuthenticator' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GoogleAuthenticator> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GoogleAuthenticator.class)); + + return (TypeAdapter<T>) new TypeAdapter<GoogleAuthenticator>() { + @Override + public void write(JsonWriter out, GoogleAuthenticator value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GoogleAuthenticator read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GoogleAuthenticator instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GoogleAuthenticator given an JSON string + * + * @param jsonString JSON string + * @return An instance of GoogleAuthenticator + * @throws IOException if the JSON string is invalid with respect to GoogleAuthenticator + */ + public static GoogleAuthenticator fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GoogleAuthenticator.class); + } + + /** + * Convert an instance of GoogleAuthenticator to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GoogleRecaptchaV3.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GoogleRecaptchaV3.java new file mode 100644 index 0000000..ca47877 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GoogleRecaptchaV3.java @@ -0,0 +1,356 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * GoogleRecaptchaV3 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GoogleRecaptchaV3 { + public static final String SERIALIZED_NAME_PUBLIC_KEY = "PublicKey"; + @SerializedName(SERIALIZED_NAME_PUBLIC_KEY) + @javax.annotation.Nullable + private String publicKey; + + public static final String SERIALIZED_NAME_PRIVATE_KEY = "PrivateKey"; + @SerializedName(SERIALIZED_NAME_PRIVATE_KEY) + @javax.annotation.Nullable + private String privateKey; + + public static final String SERIALIZED_NAME_THRESHOLD = "Threshold"; + @SerializedName(SERIALIZED_NAME_THRESHOLD) + @javax.annotation.Nullable + private Float threshold; + + public GoogleRecaptchaV3() { + } + + public GoogleRecaptchaV3 publicKey(@javax.annotation.Nullable String publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + * Get publicKey + * @return publicKey + */ + @javax.annotation.Nullable + public String getPublicKey() { + return publicKey; + } + + public void setPublicKey(@javax.annotation.Nullable String publicKey) { + this.publicKey = publicKey; + } + + + public GoogleRecaptchaV3 privateKey(@javax.annotation.Nullable String privateKey) { + this.privateKey = privateKey; + return this; + } + + /** + * Get privateKey + * @return privateKey + */ + @javax.annotation.Nullable + public String getPrivateKey() { + return privateKey; + } + + public void setPrivateKey(@javax.annotation.Nullable String privateKey) { + this.privateKey = privateKey; + } + + + public GoogleRecaptchaV3 threshold(@javax.annotation.Nullable Float threshold) { + this.threshold = threshold; + return this; + } + + /** + * Get threshold + * @return threshold + */ + @javax.annotation.Nullable + public Float getThreshold() { + return threshold; + } + + public void setThreshold(@javax.annotation.Nullable Float threshold) { + this.threshold = threshold; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GoogleRecaptchaV3 instance itself + */ + public GoogleRecaptchaV3 putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GoogleRecaptchaV3 googleRecaptchaV3 = (GoogleRecaptchaV3) o; + return Objects.equals(this.publicKey, googleRecaptchaV3.publicKey) && + Objects.equals(this.privateKey, googleRecaptchaV3.privateKey) && + Objects.equals(this.threshold, googleRecaptchaV3.threshold)&& + Objects.equals(this.additionalProperties, googleRecaptchaV3.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(publicKey, privateKey, threshold, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GoogleRecaptchaV3 {\n"); + sb.append(" publicKey: ").append(toIndentedString(publicKey)).append("\n"); + sb.append(" privateKey: ").append(toIndentedString(privateKey)).append("\n"); + sb.append(" threshold: ").append(toIndentedString(threshold)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("PublicKey"); + openapiFields.add("PrivateKey"); + openapiFields.add("Threshold"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 GoogleRecaptchaV3 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GoogleRecaptchaV3.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GoogleRecaptchaV3 is not found in the empty JSON string", GoogleRecaptchaV3.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("PublicKey") != null && !jsonObj.get("PublicKey").isJsonNull()) && !jsonObj.get("PublicKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PublicKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PublicKey").toString())); + } + if ((jsonObj.get("PrivateKey") != null && !jsonObj.get("PrivateKey").isJsonNull()) && !jsonObj.get("PrivateKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PrivateKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PrivateKey").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GoogleRecaptchaV3.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GoogleRecaptchaV3' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GoogleRecaptchaV3> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GoogleRecaptchaV3.class)); + + return (TypeAdapter<T>) new TypeAdapter<GoogleRecaptchaV3>() { + @Override + public void write(JsonWriter out, GoogleRecaptchaV3 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GoogleRecaptchaV3 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GoogleRecaptchaV3 instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GoogleRecaptchaV3 given an JSON string + * + * @param jsonString JSON string + * @return An instance of GoogleRecaptchaV3 + * @throws IOException if the JSON string is invalid with respect to GoogleRecaptchaV3 + */ + public static GoogleRecaptchaV3 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GoogleRecaptchaV3.class); + } + + /** + * Convert an instance of GoogleRecaptchaV3 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/GoogleRecaptchaV3Core.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/GoogleRecaptchaV3Core.java new file mode 100644 index 0000000..1595262 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/GoogleRecaptchaV3Core.java @@ -0,0 +1,296 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * GoogleRecaptchaV3Core + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class GoogleRecaptchaV3Core { + public static final String SERIALIZED_NAME_THRESHOLD = "Threshold"; + @SerializedName(SERIALIZED_NAME_THRESHOLD) + @javax.annotation.Nullable + private Float threshold; + + public GoogleRecaptchaV3Core() { + } + + public GoogleRecaptchaV3Core threshold(@javax.annotation.Nullable Float threshold) { + this.threshold = threshold; + return this; + } + + /** + * Get threshold + * @return threshold + */ + @javax.annotation.Nullable + public Float getThreshold() { + return threshold; + } + + public void setThreshold(@javax.annotation.Nullable Float threshold) { + this.threshold = threshold; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the GoogleRecaptchaV3Core instance itself + */ + public GoogleRecaptchaV3Core putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + GoogleRecaptchaV3Core googleRecaptchaV3Core = (GoogleRecaptchaV3Core) o; + return Objects.equals(this.threshold, googleRecaptchaV3Core.threshold)&& + Objects.equals(this.additionalProperties, googleRecaptchaV3Core.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(threshold, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class GoogleRecaptchaV3Core {\n"); + sb.append(" threshold: ").append(toIndentedString(threshold)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Threshold"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 GoogleRecaptchaV3Core + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!GoogleRecaptchaV3Core.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in GoogleRecaptchaV3Core is not found in the empty JSON string", GoogleRecaptchaV3Core.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!GoogleRecaptchaV3Core.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'GoogleRecaptchaV3Core' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<GoogleRecaptchaV3Core> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(GoogleRecaptchaV3Core.class)); + + return (TypeAdapter<T>) new TypeAdapter<GoogleRecaptchaV3Core>() { + @Override + public void write(JsonWriter out, GoogleRecaptchaV3Core value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public GoogleRecaptchaV3Core read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + GoogleRecaptchaV3Core instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of GoogleRecaptchaV3Core given an JSON string + * + * @param jsonString JSON string + * @return An instance of GoogleRecaptchaV3Core + * @throws IOException if the JSON string is invalid with respect to GoogleRecaptchaV3Core + */ + public static GoogleRecaptchaV3Core fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, GoogleRecaptchaV3Core.class); + } + + /** + * Convert an instance of GoogleRecaptchaV3Core to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/HCaptcha.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/HCaptcha.java new file mode 100644 index 0000000..9d6f04f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/HCaptcha.java @@ -0,0 +1,410 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * HCaptcha + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class HCaptcha { + public static final String SERIALIZED_NAME_PUBLIC_KEY = "PublicKey"; + @SerializedName(SERIALIZED_NAME_PUBLIC_KEY) + @javax.annotation.Nullable + private String publicKey; + + public static final String SERIALIZED_NAME_PRIVATE_KEY = "PrivateKey"; + @SerializedName(SERIALIZED_NAME_PRIVATE_KEY) + @javax.annotation.Nullable + private String privateKey; + + public static final String SERIALIZED_NAME_THRESHOLD = "Threshold"; + @SerializedName(SERIALIZED_NAME_THRESHOLD) + @javax.annotation.Nullable + private Float threshold; + + public static final String SERIALIZED_NAME_IS_INVISIBLE_CAPTCHA = "IsInvisibleCaptcha"; + @SerializedName(SERIALIZED_NAME_IS_INVISIBLE_CAPTCHA) + @javax.annotation.Nullable + private Boolean isInvisibleCaptcha; + + public static final String SERIALIZED_NAME_IS_DARK_THEME = "IsDarkTheme"; + @SerializedName(SERIALIZED_NAME_IS_DARK_THEME) + @javax.annotation.Nullable + private Boolean isDarkTheme; + + public HCaptcha() { + } + + public HCaptcha publicKey(@javax.annotation.Nullable String publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + * Get publicKey + * @return publicKey + */ + @javax.annotation.Nullable + public String getPublicKey() { + return publicKey; + } + + public void setPublicKey(@javax.annotation.Nullable String publicKey) { + this.publicKey = publicKey; + } + + + public HCaptcha privateKey(@javax.annotation.Nullable String privateKey) { + this.privateKey = privateKey; + return this; + } + + /** + * Get privateKey + * @return privateKey + */ + @javax.annotation.Nullable + public String getPrivateKey() { + return privateKey; + } + + public void setPrivateKey(@javax.annotation.Nullable String privateKey) { + this.privateKey = privateKey; + } + + + public HCaptcha threshold(@javax.annotation.Nullable Float threshold) { + this.threshold = threshold; + return this; + } + + /** + * Get threshold + * @return threshold + */ + @javax.annotation.Nullable + public Float getThreshold() { + return threshold; + } + + public void setThreshold(@javax.annotation.Nullable Float threshold) { + this.threshold = threshold; + } + + + public HCaptcha isInvisibleCaptcha(@javax.annotation.Nullable Boolean isInvisibleCaptcha) { + this.isInvisibleCaptcha = isInvisibleCaptcha; + return this; + } + + /** + * Get isInvisibleCaptcha + * @return isInvisibleCaptcha + */ + @javax.annotation.Nullable + public Boolean getIsInvisibleCaptcha() { + return isInvisibleCaptcha; + } + + public void setIsInvisibleCaptcha(@javax.annotation.Nullable Boolean isInvisibleCaptcha) { + this.isInvisibleCaptcha = isInvisibleCaptcha; + } + + + public HCaptcha isDarkTheme(@javax.annotation.Nullable Boolean isDarkTheme) { + this.isDarkTheme = isDarkTheme; + return this; + } + + /** + * Get isDarkTheme + * @return isDarkTheme + */ + @javax.annotation.Nullable + public Boolean getIsDarkTheme() { + return isDarkTheme; + } + + public void setIsDarkTheme(@javax.annotation.Nullable Boolean isDarkTheme) { + this.isDarkTheme = isDarkTheme; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the HCaptcha instance itself + */ + public HCaptcha putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HCaptcha hcaptcha = (HCaptcha) o; + return Objects.equals(this.publicKey, hcaptcha.publicKey) && + Objects.equals(this.privateKey, hcaptcha.privateKey) && + Objects.equals(this.threshold, hcaptcha.threshold) && + Objects.equals(this.isInvisibleCaptcha, hcaptcha.isInvisibleCaptcha) && + Objects.equals(this.isDarkTheme, hcaptcha.isDarkTheme)&& + Objects.equals(this.additionalProperties, hcaptcha.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(publicKey, privateKey, threshold, isInvisibleCaptcha, isDarkTheme, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HCaptcha {\n"); + sb.append(" publicKey: ").append(toIndentedString(publicKey)).append("\n"); + sb.append(" privateKey: ").append(toIndentedString(privateKey)).append("\n"); + sb.append(" threshold: ").append(toIndentedString(threshold)).append("\n"); + sb.append(" isInvisibleCaptcha: ").append(toIndentedString(isInvisibleCaptcha)).append("\n"); + sb.append(" isDarkTheme: ").append(toIndentedString(isDarkTheme)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("PublicKey"); + openapiFields.add("PrivateKey"); + openapiFields.add("Threshold"); + openapiFields.add("IsInvisibleCaptcha"); + openapiFields.add("IsDarkTheme"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 HCaptcha + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!HCaptcha.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HCaptcha is not found in the empty JSON string", HCaptcha.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("PublicKey") != null && !jsonObj.get("PublicKey").isJsonNull()) && !jsonObj.get("PublicKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PublicKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PublicKey").toString())); + } + if ((jsonObj.get("PrivateKey") != null && !jsonObj.get("PrivateKey").isJsonNull()) && !jsonObj.get("PrivateKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PrivateKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PrivateKey").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!HCaptcha.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HCaptcha' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<HCaptcha> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HCaptcha.class)); + + return (TypeAdapter<T>) new TypeAdapter<HCaptcha>() { + @Override + public void write(JsonWriter out, HCaptcha value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public HCaptcha read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + HCaptcha instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HCaptcha given an JSON string + * + * @param jsonString JSON string + * @return An instance of HCaptcha + * @throws IOException if the JSON string is invalid with respect to HCaptcha + */ + public static HCaptcha fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HCaptcha.class); + } + + /** + * Convert an instance of HCaptcha to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/HCaptchaCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/HCaptchaCore.java new file mode 100644 index 0000000..c12dc82 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/HCaptchaCore.java @@ -0,0 +1,350 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * HCaptchaCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class HCaptchaCore { + public static final String SERIALIZED_NAME_THRESHOLD = "Threshold"; + @SerializedName(SERIALIZED_NAME_THRESHOLD) + @javax.annotation.Nullable + private Float threshold; + + public static final String SERIALIZED_NAME_IS_INVISIBLE_CAPTCHA = "IsInvisibleCaptcha"; + @SerializedName(SERIALIZED_NAME_IS_INVISIBLE_CAPTCHA) + @javax.annotation.Nullable + private Boolean isInvisibleCaptcha; + + public static final String SERIALIZED_NAME_IS_DARK_THEME = "IsDarkTheme"; + @SerializedName(SERIALIZED_NAME_IS_DARK_THEME) + @javax.annotation.Nullable + private Boolean isDarkTheme; + + public HCaptchaCore() { + } + + public HCaptchaCore threshold(@javax.annotation.Nullable Float threshold) { + this.threshold = threshold; + return this; + } + + /** + * Get threshold + * @return threshold + */ + @javax.annotation.Nullable + public Float getThreshold() { + return threshold; + } + + public void setThreshold(@javax.annotation.Nullable Float threshold) { + this.threshold = threshold; + } + + + public HCaptchaCore isInvisibleCaptcha(@javax.annotation.Nullable Boolean isInvisibleCaptcha) { + this.isInvisibleCaptcha = isInvisibleCaptcha; + return this; + } + + /** + * Get isInvisibleCaptcha + * @return isInvisibleCaptcha + */ + @javax.annotation.Nullable + public Boolean getIsInvisibleCaptcha() { + return isInvisibleCaptcha; + } + + public void setIsInvisibleCaptcha(@javax.annotation.Nullable Boolean isInvisibleCaptcha) { + this.isInvisibleCaptcha = isInvisibleCaptcha; + } + + + public HCaptchaCore isDarkTheme(@javax.annotation.Nullable Boolean isDarkTheme) { + this.isDarkTheme = isDarkTheme; + return this; + } + + /** + * Get isDarkTheme + * @return isDarkTheme + */ + @javax.annotation.Nullable + public Boolean getIsDarkTheme() { + return isDarkTheme; + } + + public void setIsDarkTheme(@javax.annotation.Nullable Boolean isDarkTheme) { + this.isDarkTheme = isDarkTheme; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the HCaptchaCore instance itself + */ + public HCaptchaCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HCaptchaCore hcaptchaCore = (HCaptchaCore) o; + return Objects.equals(this.threshold, hcaptchaCore.threshold) && + Objects.equals(this.isInvisibleCaptcha, hcaptchaCore.isInvisibleCaptcha) && + Objects.equals(this.isDarkTheme, hcaptchaCore.isDarkTheme)&& + Objects.equals(this.additionalProperties, hcaptchaCore.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(threshold, isInvisibleCaptcha, isDarkTheme, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HCaptchaCore {\n"); + sb.append(" threshold: ").append(toIndentedString(threshold)).append("\n"); + sb.append(" isInvisibleCaptcha: ").append(toIndentedString(isInvisibleCaptcha)).append("\n"); + sb.append(" isDarkTheme: ").append(toIndentedString(isDarkTheme)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Threshold"); + openapiFields.add("IsInvisibleCaptcha"); + openapiFields.add("IsDarkTheme"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 HCaptchaCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!HCaptchaCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in HCaptchaCore is not found in the empty JSON string", HCaptchaCore.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!HCaptchaCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'HCaptchaCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<HCaptchaCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(HCaptchaCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<HCaptchaCore>() { + @Override + public void write(JsonWriter out, HCaptchaCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public HCaptchaCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + HCaptchaCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of HCaptchaCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of HCaptchaCore + * @throws IOException if the JSON string is invalid with respect to HCaptchaCore + */ + public static HCaptchaCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, HCaptchaCore.class); + } + + /** + * Convert an instance of HCaptchaCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/IOSPushConfig.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/IOSPushConfig.java new file mode 100644 index 0000000..e87ec2c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/IOSPushConfig.java @@ -0,0 +1,490 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * IOSPushConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class IOSPushConfig { + public static final String SERIALIZED_NAME_ENABLED = "Enabled"; + @SerializedName(SERIALIZED_NAME_ENABLED) + @javax.annotation.Nullable + private Boolean enabled; + + public static final String SERIALIZED_NAME_APPSTORE_URL = "AppstoreUrl"; + @SerializedName(SERIALIZED_NAME_APPSTORE_URL) + @javax.annotation.Nullable + private String appstoreUrl; + + public static final String SERIALIZED_NAME_PLATFORM_A_R_N = "PlatformARN"; + @SerializedName(SERIALIZED_NAME_PLATFORM_A_R_N) + @javax.annotation.Nullable + private String platformARN; + + public static final String SERIALIZED_NAME_BUNDLE_ID = "BundleId"; + @SerializedName(SERIALIZED_NAME_BUNDLE_ID) + @javax.annotation.Nullable + private String bundleId; + + public static final String SERIALIZED_NAME_APNS_CERTIFICATE = "ApnsCertificate"; + @SerializedName(SERIALIZED_NAME_APNS_CERTIFICATE) + @javax.annotation.Nullable + private String apnsCertificate; + + /** + * The environment for APNs (e.g., sandbox, production). + */ + @JsonAdapter(EnvironmentEnum.Adapter.class) + public enum EnvironmentEnum { + SANDBOX("Sandbox"), + + PRODUCTION("Production"); + + private String value; + + EnvironmentEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EnvironmentEnum fromValue(String value) { + for (EnvironmentEnum b : EnvironmentEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<EnvironmentEnum> { + @Override + public void write(final JsonWriter jsonWriter, final EnvironmentEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EnvironmentEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EnvironmentEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + EnvironmentEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ENVIRONMENT = "Environment"; + @SerializedName(SERIALIZED_NAME_ENVIRONMENT) + @javax.annotation.Nullable + private EnvironmentEnum environment; + + public IOSPushConfig() { + } + + public IOSPushConfig enabled(@javax.annotation.Nullable Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Indicates if iOS Push Notifications are enabled. + * @return enabled + */ + @javax.annotation.Nullable + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(@javax.annotation.Nullable Boolean enabled) { + this.enabled = enabled; + } + + + public IOSPushConfig appstoreUrl(@javax.annotation.Nullable String appstoreUrl) { + this.appstoreUrl = appstoreUrl; + return this; + } + + /** + * The URL to the app in the Apple App Store. + * @return appstoreUrl + */ + @javax.annotation.Nullable + public String getAppstoreUrl() { + return appstoreUrl; + } + + public void setAppstoreUrl(@javax.annotation.Nullable String appstoreUrl) { + this.appstoreUrl = appstoreUrl; + } + + + public IOSPushConfig platformARN(@javax.annotation.Nullable String platformARN) { + this.platformARN = platformARN; + return this; + } + + /** + * The platform ARN for iOS Push Notifications. + * @return platformARN + */ + @javax.annotation.Nullable + public String getPlatformARN() { + return platformARN; + } + + public void setPlatformARN(@javax.annotation.Nullable String platformARN) { + this.platformARN = platformARN; + } + + + public IOSPushConfig bundleId(@javax.annotation.Nullable String bundleId) { + this.bundleId = bundleId; + return this; + } + + /** + * The bundle ID of the iOS app. + * @return bundleId + */ + @javax.annotation.Nullable + public String getBundleId() { + return bundleId; + } + + public void setBundleId(@javax.annotation.Nullable String bundleId) { + this.bundleId = bundleId; + } + + + public IOSPushConfig apnsCertificate(@javax.annotation.Nullable String apnsCertificate) { + this.apnsCertificate = apnsCertificate; + return this; + } + + /** + * The APNs certificate. + * @return apnsCertificate + */ + @javax.annotation.Nullable + public String getApnsCertificate() { + return apnsCertificate; + } + + public void setApnsCertificate(@javax.annotation.Nullable String apnsCertificate) { + this.apnsCertificate = apnsCertificate; + } + + + public IOSPushConfig environment(@javax.annotation.Nullable EnvironmentEnum environment) { + this.environment = environment; + return this; + } + + /** + * The environment for APNs (e.g., sandbox, production). + * @return environment + */ + @javax.annotation.Nullable + public EnvironmentEnum getEnvironment() { + return environment; + } + + public void setEnvironment(@javax.annotation.Nullable EnvironmentEnum environment) { + this.environment = environment; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IOSPushConfig instance itself + */ + public IOSPushConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IOSPushConfig ioSPushConfig = (IOSPushConfig) o; + return Objects.equals(this.enabled, ioSPushConfig.enabled) && + Objects.equals(this.appstoreUrl, ioSPushConfig.appstoreUrl) && + Objects.equals(this.platformARN, ioSPushConfig.platformARN) && + Objects.equals(this.bundleId, ioSPushConfig.bundleId) && + Objects.equals(this.apnsCertificate, ioSPushConfig.apnsCertificate) && + Objects.equals(this.environment, ioSPushConfig.environment)&& + Objects.equals(this.additionalProperties, ioSPushConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(enabled, appstoreUrl, platformARN, bundleId, apnsCertificate, environment, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IOSPushConfig {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" appstoreUrl: ").append(toIndentedString(appstoreUrl)).append("\n"); + sb.append(" platformARN: ").append(toIndentedString(platformARN)).append("\n"); + sb.append(" bundleId: ").append(toIndentedString(bundleId)).append("\n"); + sb.append(" apnsCertificate: ").append(toIndentedString(apnsCertificate)).append("\n"); + sb.append(" environment: ").append(toIndentedString(environment)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Enabled"); + openapiFields.add("AppstoreUrl"); + openapiFields.add("PlatformARN"); + openapiFields.add("BundleId"); + openapiFields.add("ApnsCertificate"); + openapiFields.add("Environment"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 IOSPushConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IOSPushConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IOSPushConfig is not found in the empty JSON string", IOSPushConfig.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("AppstoreUrl") != null && !jsonObj.get("AppstoreUrl").isJsonNull()) && !jsonObj.get("AppstoreUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AppstoreUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AppstoreUrl").toString())); + } + if ((jsonObj.get("PlatformARN") != null && !jsonObj.get("PlatformARN").isJsonNull()) && !jsonObj.get("PlatformARN").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PlatformARN` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PlatformARN").toString())); + } + if ((jsonObj.get("BundleId") != null && !jsonObj.get("BundleId").isJsonNull()) && !jsonObj.get("BundleId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `BundleId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BundleId").toString())); + } + if ((jsonObj.get("ApnsCertificate") != null && !jsonObj.get("ApnsCertificate").isJsonNull()) && !jsonObj.get("ApnsCertificate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ApnsCertificate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ApnsCertificate").toString())); + } + if ((jsonObj.get("Environment") != null && !jsonObj.get("Environment").isJsonNull()) && !jsonObj.get("Environment").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Environment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Environment").toString())); + } + // validate the optional field `Environment` + if (jsonObj.get("Environment") != null && !jsonObj.get("Environment").isJsonNull()) { + EnvironmentEnum.validateJsonElement(jsonObj.get("Environment")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!IOSPushConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IOSPushConfig' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<IOSPushConfig> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IOSPushConfig.class)); + + return (TypeAdapter<T>) new TypeAdapter<IOSPushConfig>() { + @Override + public void write(JsonWriter out, IOSPushConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public IOSPushConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + IOSPushConfig instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IOSPushConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of IOSPushConfig + * @throws IOException if the JSON string is invalid with respect to IOSPushConfig + */ + public static IOSPushConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IOSPushConfig.class); + } + + /** + * Convert an instance of IOSPushConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/IPAccessRestrictions.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/IPAccessRestrictions.java new file mode 100644 index 0000000..6804cd8 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/IPAccessRestrictions.java @@ -0,0 +1,337 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.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.loginradius.sdk.internal.openapi.JSON; + +/** + * IPAccessRestrictions + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class IPAccessRestrictions { + public static final String SERIALIZED_NAME_ALLOWED_I_PS = "AllowedIPs"; + @SerializedName(SERIALIZED_NAME_ALLOWED_I_PS) + @javax.annotation.Nullable + private List<String> allowedIPs = new ArrayList<>(); + + public static final String SERIALIZED_NAME_DENIED_I_PS = "DeniedIPs"; + @SerializedName(SERIALIZED_NAME_DENIED_I_PS) + @javax.annotation.Nullable + private List<String> deniedIPs = new ArrayList<>(); + + public IPAccessRestrictions() { + } + + public IPAccessRestrictions allowedIPs(@javax.annotation.Nullable List<String> allowedIPs) { + this.allowedIPs = allowedIPs; + return this; + } + + public IPAccessRestrictions addAllowedIPsItem(String allowedIPsItem) { + if (this.allowedIPs == null) { + this.allowedIPs = new ArrayList<>(); + } + this.allowedIPs.add(allowedIPsItem); + return this; + } + + /** + * List of allowed IP addresses + * @return allowedIPs + */ + @javax.annotation.Nullable + public List<String> getAllowedIPs() { + return allowedIPs; + } + + public void setAllowedIPs(@javax.annotation.Nullable List<String> allowedIPs) { + this.allowedIPs = allowedIPs; + } + + + public IPAccessRestrictions deniedIPs(@javax.annotation.Nullable List<String> deniedIPs) { + this.deniedIPs = deniedIPs; + return this; + } + + public IPAccessRestrictions addDeniedIPsItem(String deniedIPsItem) { + if (this.deniedIPs == null) { + this.deniedIPs = new ArrayList<>(); + } + this.deniedIPs.add(deniedIPsItem); + return this; + } + + /** + * List of blocked IP addresses + * @return deniedIPs + */ + @javax.annotation.Nullable + public List<String> getDeniedIPs() { + return deniedIPs; + } + + public void setDeniedIPs(@javax.annotation.Nullable List<String> deniedIPs) { + this.deniedIPs = deniedIPs; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IPAccessRestrictions instance itself + */ + public IPAccessRestrictions putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IPAccessRestrictions ipAccessRestrictions = (IPAccessRestrictions) o; + return Objects.equals(this.allowedIPs, ipAccessRestrictions.allowedIPs) && + Objects.equals(this.deniedIPs, ipAccessRestrictions.deniedIPs)&& + Objects.equals(this.additionalProperties, ipAccessRestrictions.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(allowedIPs, deniedIPs, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IPAccessRestrictions {\n"); + sb.append(" allowedIPs: ").append(toIndentedString(allowedIPs)).append("\n"); + sb.append(" deniedIPs: ").append(toIndentedString(deniedIPs)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AllowedIPs"); + openapiFields.add("DeniedIPs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 IPAccessRestrictions + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IPAccessRestrictions.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IPAccessRestrictions is not found in the empty JSON string", IPAccessRestrictions.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("AllowedIPs") != null && !jsonObj.get("AllowedIPs").isJsonNull() && !jsonObj.get("AllowedIPs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `AllowedIPs` to be an array in the JSON string but got `%s`", jsonObj.get("AllowedIPs").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("DeniedIPs") != null && !jsonObj.get("DeniedIPs").isJsonNull() && !jsonObj.get("DeniedIPs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `DeniedIPs` to be an array in the JSON string but got `%s`", jsonObj.get("DeniedIPs").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!IPAccessRestrictions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IPAccessRestrictions' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<IPAccessRestrictions> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IPAccessRestrictions.class)); + + return (TypeAdapter<T>) new TypeAdapter<IPAccessRestrictions>() { + @Override + public void write(JsonWriter out, IPAccessRestrictions value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public IPAccessRestrictions read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + IPAccessRestrictions instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IPAccessRestrictions given an JSON string + * + * @param jsonString JSON string + * @return An instance of IPAccessRestrictions + * @throws IOException if the JSON string is invalid with respect to IPAccessRestrictions + */ + public static IPAccessRestrictions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IPAccessRestrictions.class); + } + + /** + * Convert an instance of IPAccessRestrictions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/IdentitiesResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/IdentitiesResponse.java new file mode 100644 index 0000000..2773275 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/IdentitiesResponse.java @@ -0,0 +1,321 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.IdentityResponseWithSocialWithoutLogins; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * IdentitiesResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class IdentitiesResponse { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<IdentityResponseWithSocialWithoutLogins> data; + + public IdentitiesResponse() { + } + + public IdentitiesResponse data(@javax.annotation.Nullable List<IdentityResponseWithSocialWithoutLogins> data) { + this.data = data; + return this; + } + + public IdentitiesResponse addDataItem(IdentityResponseWithSocialWithoutLogins dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * List of User Identities with social information but without login details. + * @return data + */ + @javax.annotation.Nullable + public List<IdentityResponseWithSocialWithoutLogins> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<IdentityResponseWithSocialWithoutLogins> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IdentitiesResponse instance itself + */ + public IdentitiesResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IdentitiesResponse identitiesResponse = (IdentitiesResponse) o; + return Objects.equals(this.data, identitiesResponse.data)&& + Objects.equals(this.additionalProperties, identitiesResponse.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IdentitiesResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 IdentitiesResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IdentitiesResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IdentitiesResponse is not found in the empty JSON string", IdentitiesResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + IdentityResponseWithSocialWithoutLogins.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!IdentitiesResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IdentitiesResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<IdentitiesResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IdentitiesResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<IdentitiesResponse>() { + @Override + public void write(JsonWriter out, IdentitiesResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public IdentitiesResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + IdentitiesResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IdentitiesResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of IdentitiesResponse + * @throws IOException if the JSON string is invalid with respect to IdentitiesResponse + */ + public static IdentitiesResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IdentitiesResponse.class); + } + + /** + * Convert an instance of IdentitiesResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/Identity.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/Identity.java new file mode 100644 index 0000000..bd6ad7f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/Identity.java @@ -0,0 +1,5175 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.IdentityPasskeyLogin; +import com.loginradius.sdk.internal.openapi.model.ProfileAddressesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileAgeRange; +import com.loginradius.sdk.internal.openapi.model.ProfileAwardsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileBadgesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileBooksInner; +import com.loginradius.sdk.internal.openapi.model.ProfileCertificationsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileConsentProfile; +import com.loginradius.sdk.internal.openapi.model.ProfileCountry; +import com.loginradius.sdk.internal.openapi.model.ProfileCoursesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileCurrentStatusInner; +import com.loginradius.sdk.internal.openapi.model.ProfileEducationsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileEmailInner; +import com.loginradius.sdk.internal.openapi.model.ProfileExternalIdsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileFamilyInner; +import com.loginradius.sdk.internal.openapi.model.ProfileFavoriteThingsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileGamesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileIMAccountsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileInspirationalPeopleInner; +import com.loginradius.sdk.internal.openapi.model.ProfileInterestsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileJobBookmarksInner; +import com.loginradius.sdk.internal.openapi.model.ProfileKloutScore; +import com.loginradius.sdk.internal.openapi.model.ProfileLanguagesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileMemberUrlResourcesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileMoviesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileMutualFriendsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileOrganizationsInner; +import com.loginradius.sdk.internal.openapi.model.ProfilePIN; +import com.loginradius.sdk.internal.openapi.model.ProfilePatentsInner; +import com.loginradius.sdk.internal.openapi.model.ProfilePhoneNumbersInner; +import com.loginradius.sdk.internal.openapi.model.ProfilePlacesLivedInner; +import com.loginradius.sdk.internal.openapi.model.ProfilePositionsInner; +import com.loginradius.sdk.internal.openapi.model.ProfilePrivacyPolicy; +import com.loginradius.sdk.internal.openapi.model.ProfileProjectsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileProviderAccessCredential; +import com.loginradius.sdk.internal.openapi.model.ProfilePublicationsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRecommendationsReceivedInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRegistrationData; +import com.loginradius.sdk.internal.openapi.model.ProfileRelatedProfileViewsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileSkillsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileSportsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileSubscription; +import com.loginradius.sdk.internal.openapi.model.ProfileSuggestions; +import com.loginradius.sdk.internal.openapi.model.ProfileTelevisionShowInner; +import com.loginradius.sdk.internal.openapi.model.ProfileUnverifiedEmailInner; +import com.loginradius.sdk.internal.openapi.model.ProfileVolunteerInner; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Identity + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class Identity { + public static final String SERIALIZED_NAME_IS_PASSWORD_BREACHED = "IsPasswordBreached"; + @SerializedName(SERIALIZED_NAME_IS_PASSWORD_BREACHED) + @javax.annotation.Nullable + private Boolean isPasswordBreached; + + public static final String SERIALIZED_NAME_IS_ACTIVE = "IsActive"; + @SerializedName(SERIALIZED_NAME_IS_ACTIVE) + @javax.annotation.Nullable + private Boolean isActive; + + public static final String SERIALIZED_NAME_IS_DELETED = "IsDeleted"; + @SerializedName(SERIALIZED_NAME_IS_DELETED) + @javax.annotation.Nullable + private Boolean isDeleted; + + public static final String SERIALIZED_NAME_EMAIL_VERIFIED = "EmailVerified"; + @SerializedName(SERIALIZED_NAME_EMAIL_VERIFIED) + @javax.annotation.Nullable + private Boolean emailVerified; + + public static final String SERIALIZED_NAME_IS_LOGIN_LOCKED = "IsLoginLocked"; + @SerializedName(SERIALIZED_NAME_IS_LOGIN_LOCKED) + @javax.annotation.Nullable + private Boolean isLoginLocked; + + public static final String SERIALIZED_NAME_IS_REQUIRED_FIELDS_FILLED_ONCE = "IsRequiredFieldsFilledOnce"; + @SerializedName(SERIALIZED_NAME_IS_REQUIRED_FIELDS_FILLED_ONCE) + @javax.annotation.Nullable + private Boolean isRequiredFieldsFilledOnce; + + public static final String SERIALIZED_NAME_FIRST_LOGIN = "FirstLogin"; + @SerializedName(SERIALIZED_NAME_FIRST_LOGIN) + @javax.annotation.Nullable + private Boolean firstLogin; + + public static final String SERIALIZED_NAME_IS_PROTECTED = "IsProtected"; + @SerializedName(SERIALIZED_NAME_IS_PROTECTED) + @javax.annotation.Nullable + private Boolean isProtected; + + public static final String SERIALIZED_NAME_HIREABLE = "Hireable"; + @SerializedName(SERIALIZED_NAME_HIREABLE) + @javax.annotation.Nullable + private Boolean hireable; + + public static final String SERIALIZED_NAME_IS_SECURE_PASSWORD = "IsSecurePassword"; + @SerializedName(SERIALIZED_NAME_IS_SECURE_PASSWORD) + @javax.annotation.Nullable + private Boolean isSecurePassword; + + public static final String SERIALIZED_NAME_IS_CUSTOM_UID = "IsCustomUid"; + @SerializedName(SERIALIZED_NAME_IS_CUSTOM_UID) + @javax.annotation.Nullable + private Boolean isCustomUid; + + public static final String SERIALIZED_NAME_PHONE_ID_VERIFIED = "PhoneIdVerified"; + @SerializedName(SERIALIZED_NAME_PHONE_ID_VERIFIED) + @javax.annotation.Nullable + private Boolean phoneIdVerified; + + public static final String SERIALIZED_NAME_IS_EMAIL_SUBSCRIBED = "IsEmailSubscribed"; + @SerializedName(SERIALIZED_NAME_IS_EMAIL_SUBSCRIBED) + @javax.annotation.Nullable + private Boolean isEmailSubscribed; + + public static final String SERIALIZED_NAME_NO_OF_LOGINS = "NoOfLogins"; + @SerializedName(SERIALIZED_NAME_NO_OF_LOGINS) + @javax.annotation.Nullable + private Integer noOfLogins; + + public static final String SERIALIZED_NAME_FOLLOWERS_COUNT = "FollowersCount"; + @SerializedName(SERIALIZED_NAME_FOLLOWERS_COUNT) + @javax.annotation.Nullable + private Integer followersCount; + + public static final String SERIALIZED_NAME_FRIENDS_COUNT = "FriendsCount"; + @SerializedName(SERIALIZED_NAME_FRIENDS_COUNT) + @javax.annotation.Nullable + private Integer friendsCount; + + public static final String SERIALIZED_NAME_TOTAL_STATUSES_COUNT = "TotalStatusesCount"; + @SerializedName(SERIALIZED_NAME_TOTAL_STATUSES_COUNT) + @javax.annotation.Nullable + private Integer totalStatusesCount; + + public static final String SERIALIZED_NAME_NUM_RECOMMENDERS = "NumRecommenders"; + @SerializedName(SERIALIZED_NAME_NUM_RECOMMENDERS) + @javax.annotation.Nullable + private Integer numRecommenders; + + public static final String SERIALIZED_NAME_TOTAL_PRIVATE_REPOSITORY = "TotalPrivateRepository"; + @SerializedName(SERIALIZED_NAME_TOTAL_PRIVATE_REPOSITORY) + @javax.annotation.Nullable + private Integer totalPrivateRepository; + + public static final String SERIALIZED_NAME_PUBLIC_GISTS = "PublicGists"; + @SerializedName(SERIALIZED_NAME_PUBLIC_GISTS) + @javax.annotation.Nullable + private Integer publicGists; + + public static final String SERIALIZED_NAME_PRIVATE_GISTS = "PrivateGists"; + @SerializedName(SERIALIZED_NAME_PRIVATE_GISTS) + @javax.annotation.Nullable + private Integer privateGists; + + public static final String SERIALIZED_NAME_PINS_COUNT = "PinsCount"; + @SerializedName(SERIALIZED_NAME_PINS_COUNT) + @javax.annotation.Nullable + private Integer pinsCount; + + public static final String SERIALIZED_NAME_BOARDS_COUNT = "BoardsCount"; + @SerializedName(SERIALIZED_NAME_BOARDS_COUNT) + @javax.annotation.Nullable + private Integer boardsCount; + + public static final String SERIALIZED_NAME_LIKES_COUNT = "LikesCount"; + @SerializedName(SERIALIZED_NAME_LIKES_COUNT) + @javax.annotation.Nullable + private Integer likesCount; + + public static final String SERIALIZED_NAME_I_D = "ID"; + @SerializedName(SERIALIZED_NAME_I_D) + @javax.annotation.Nullable + private String ID; + + public static final String SERIALIZED_NAME_PROVIDER = "Provider"; + @SerializedName(SERIALIZED_NAME_PROVIDER) + @javax.annotation.Nullable + private String provider; + + 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_FIRST_NAME = "FirstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nullable + private String firstName; + + public static final String SERIALIZED_NAME_LAST_NAME = "LastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nullable + private String lastName; + + public static final String SERIALIZED_NAME_PHONE_ID = "PhoneId"; + @SerializedName(SERIALIZED_NAME_PHONE_ID) + @javax.annotation.Nullable + private String phoneId; + + public static final String SERIALIZED_NAME_USER_NAME = "UserName"; + @SerializedName(SERIALIZED_NAME_USER_NAME) + @javax.annotation.Nullable + private String userName; + + public static final String SERIALIZED_NAME_PREFIX = "Prefix"; + @SerializedName(SERIALIZED_NAME_PREFIX) + @javax.annotation.Nullable + private String prefix; + + public static final String SERIALIZED_NAME_MIDDLE_NAME = "MiddleName"; + @SerializedName(SERIALIZED_NAME_MIDDLE_NAME) + @javax.annotation.Nullable + private String middleName; + + public static final String SERIALIZED_NAME_SUFFIX = "Suffix"; + @SerializedName(SERIALIZED_NAME_SUFFIX) + @javax.annotation.Nullable + private String suffix; + + public static final String SERIALIZED_NAME_NICK_NAME = "NickName"; + @SerializedName(SERIALIZED_NAME_NICK_NAME) + @javax.annotation.Nullable + private String nickName; + + public static final String SERIALIZED_NAME_PROFILE_NAME = "ProfileName"; + @SerializedName(SERIALIZED_NAME_PROFILE_NAME) + @javax.annotation.Nullable + private String profileName; + + public static final String SERIALIZED_NAME_BIRTH_DATE = "BirthDate"; + @SerializedName(SERIALIZED_NAME_BIRTH_DATE) + @javax.annotation.Nullable + private String birthDate; + + public static final String SERIALIZED_NAME_GENDER = "Gender"; + @SerializedName(SERIALIZED_NAME_GENDER) + @javax.annotation.Nullable + private String gender; + + public static final String SERIALIZED_NAME_WEBSITE = "Website"; + @SerializedName(SERIALIZED_NAME_WEBSITE) + @javax.annotation.Nullable + private String website; + + public static final String SERIALIZED_NAME_THUMBNAIL_IMAGE_URL = "ThumbnailImageUrl"; + @SerializedName(SERIALIZED_NAME_THUMBNAIL_IMAGE_URL) + @javax.annotation.Nullable + private String thumbnailImageUrl; + + public static final String SERIALIZED_NAME_IMAGE_URL = "ImageUrl"; + @SerializedName(SERIALIZED_NAME_IMAGE_URL) + @javax.annotation.Nullable + private String imageUrl; + + public static final String SERIALIZED_NAME_FAVICON = "Favicon"; + @SerializedName(SERIALIZED_NAME_FAVICON) + @javax.annotation.Nullable + private String favicon; + + public static final String SERIALIZED_NAME_PROFILE_URL = "ProfileUrl"; + @SerializedName(SERIALIZED_NAME_PROFILE_URL) + @javax.annotation.Nullable + private String profileUrl; + + public static final String SERIALIZED_NAME_HOME_TOWN = "HomeTown"; + @SerializedName(SERIALIZED_NAME_HOME_TOWN) + @javax.annotation.Nullable + private String homeTown; + + public static final String SERIALIZED_NAME_STATE = "State"; + @SerializedName(SERIALIZED_NAME_STATE) + @javax.annotation.Nullable + private String state; + + public static final String SERIALIZED_NAME_CITY = "City"; + @SerializedName(SERIALIZED_NAME_CITY) + @javax.annotation.Nullable + private String city; + + public static final String SERIALIZED_NAME_INDUSTRY = "Industry"; + @SerializedName(SERIALIZED_NAME_INDUSTRY) + @javax.annotation.Nullable + private String industry; + + public static final String SERIALIZED_NAME_ABOUT = "About"; + @SerializedName(SERIALIZED_NAME_ABOUT) + @javax.annotation.Nullable + private String about; + + public static final String SERIALIZED_NAME_TIME_ZONE = "TimeZone"; + @SerializedName(SERIALIZED_NAME_TIME_ZONE) + @javax.annotation.Nullable + private String timeZone; + + public static final String SERIALIZED_NAME_LOCAL_LANGUAGE = "LocalLanguage"; + @SerializedName(SERIALIZED_NAME_LOCAL_LANGUAGE) + @javax.annotation.Nullable + private String localLanguage; + + public static final String SERIALIZED_NAME_COVER_PHOTO = "CoverPhoto"; + @SerializedName(SERIALIZED_NAME_COVER_PHOTO) + @javax.annotation.Nullable + private String coverPhoto; + + public static final String SERIALIZED_NAME_TAG_LINE = "TagLine"; + @SerializedName(SERIALIZED_NAME_TAG_LINE) + @javax.annotation.Nullable + private String tagLine; + + public static final String SERIALIZED_NAME_LANGUAGE = "Language"; + @SerializedName(SERIALIZED_NAME_LANGUAGE) + @javax.annotation.Nullable + private String language; + + public static final String SERIALIZED_NAME_VERIFIED = "Verified"; + @SerializedName(SERIALIZED_NAME_VERIFIED) + @javax.annotation.Nullable + private String verified; + + public static final String SERIALIZED_NAME_UPDATED_TIME = "UpdatedTime"; + @SerializedName(SERIALIZED_NAME_UPDATED_TIME) + @javax.annotation.Nullable + private String updatedTime; + + public static final String SERIALIZED_NAME_IS_GEO_ENABLED = "IsGeoEnabled"; + @SerializedName(SERIALIZED_NAME_IS_GEO_ENABLED) + @javax.annotation.Nullable + private String isGeoEnabled; + + public static final String SERIALIZED_NAME_ASSOCIATIONS = "Associations"; + @SerializedName(SERIALIZED_NAME_ASSOCIATIONS) + @javax.annotation.Nullable + private String associations; + + public static final String SERIALIZED_NAME_HONORS = "Honors"; + @SerializedName(SERIALIZED_NAME_HONORS) + @javax.annotation.Nullable + private String honors; + + public static final String SERIALIZED_NAME_HTTPS_IMAGE_URL = "HttpsImageUrl"; + @SerializedName(SERIALIZED_NAME_HTTPS_IMAGE_URL) + @javax.annotation.Nullable + private String httpsImageUrl; + + public static final String SERIALIZED_NAME_MAIN_ADDRESS = "MainAddress"; + @SerializedName(SERIALIZED_NAME_MAIN_ADDRESS) + @javax.annotation.Nullable + private String mainAddress; + + public static final String SERIALIZED_NAME_CREATED = "Created"; + @SerializedName(SERIALIZED_NAME_CREATED) + @javax.annotation.Nullable + private String created; + + public static final String SERIALIZED_NAME_LOCAL_CITY = "LocalCity"; + @SerializedName(SERIALIZED_NAME_LOCAL_CITY) + @javax.annotation.Nullable + private String localCity; + + public static final String SERIALIZED_NAME_PROFILE_CITY = "ProfileCity"; + @SerializedName(SERIALIZED_NAME_PROFILE_CITY) + @javax.annotation.Nullable + private String profileCity; + + public static final String SERIALIZED_NAME_LOCAL_COUNTRY = "LocalCountry"; + @SerializedName(SERIALIZED_NAME_LOCAL_COUNTRY) + @javax.annotation.Nullable + private String localCountry; + + public static final String SERIALIZED_NAME_PROFILE_COUNTRY = "ProfileCountry"; + @SerializedName(SERIALIZED_NAME_PROFILE_COUNTRY) + @javax.annotation.Nullable + private String profileCountry; + + public static final String SERIALIZED_NAME_RELATIONSHIP_STATUS = "RelationshipStatus"; + @SerializedName(SERIALIZED_NAME_RELATIONSHIP_STATUS) + @javax.annotation.Nullable + private String relationshipStatus; + + public static final String SERIALIZED_NAME_QUOTA = "Quota"; + @SerializedName(SERIALIZED_NAME_QUOTA) + @javax.annotation.Nullable + private String quota; + + public static final String SERIALIZED_NAME_QUOTE = "Quote"; + @SerializedName(SERIALIZED_NAME_QUOTE) + @javax.annotation.Nullable + private String quote; + + public static final String SERIALIZED_NAME_RELIGION = "Religion"; + @SerializedName(SERIALIZED_NAME_RELIGION) + @javax.annotation.Nullable + private String religion; + + public static final String SERIALIZED_NAME_POLITICAL = "Political"; + @SerializedName(SERIALIZED_NAME_POLITICAL) + @javax.annotation.Nullable + private String political; + + public static final String SERIALIZED_NAME_PUBLIC_REPOSITORY = "PublicRepository"; + @SerializedName(SERIALIZED_NAME_PUBLIC_REPOSITORY) + @javax.annotation.Nullable + private String publicRepository; + + public static final String SERIALIZED_NAME_REPOSITORY_URL = "RepositoryUrl"; + @SerializedName(SERIALIZED_NAME_REPOSITORY_URL) + @javax.annotation.Nullable + private String repositoryUrl; + + public static final String SERIALIZED_NAME_AGE = "Age"; + @SerializedName(SERIALIZED_NAME_AGE) + @javax.annotation.Nullable + private String age; + + public static final String SERIALIZED_NAME_PROFESSIONAL_HEADLINE = "ProfessionalHeadline"; + @SerializedName(SERIALIZED_NAME_PROFESSIONAL_HEADLINE) + @javax.annotation.Nullable + private String professionalHeadline; + + public static final String SERIALIZED_NAME_LR_USER_I_D = "LRUserID"; + @SerializedName(SERIALIZED_NAME_LR_USER_I_D) + @javax.annotation.Nullable + private String lrUserID; + + public static final String SERIALIZED_NAME_CURRENCY = "Currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + @javax.annotation.Nullable + private String currency; + + public static final String SERIALIZED_NAME_STARRED_URL = "StarredUrl"; + @SerializedName(SERIALIZED_NAME_STARRED_URL) + @javax.annotation.Nullable + private String starredUrl; + + public static final String SERIALIZED_NAME_GISTS_URL = "GistsUrl"; + @SerializedName(SERIALIZED_NAME_GISTS_URL) + @javax.annotation.Nullable + private String gistsUrl; + + public static final String SERIALIZED_NAME_COMPANY = "Company"; + @SerializedName(SERIALIZED_NAME_COMPANY) + @javax.annotation.Nullable + private String company; + + public static final String SERIALIZED_NAME_GRAVATAR_IMAGE_URL = "GravatarImageUrl"; + @SerializedName(SERIALIZED_NAME_GRAVATAR_IMAGE_URL) + @javax.annotation.Nullable + private String gravatarImageUrl; + + public static final String SERIALIZED_NAME_LAST_PASSWORD_CHANGE_DATE = "LastPasswordChangeDate"; + @SerializedName(SERIALIZED_NAME_LAST_PASSWORD_CHANGE_DATE) + @javax.annotation.Nullable + private OffsetDateTime lastPasswordChangeDate; + + public static final String SERIALIZED_NAME_PASSWORD_EXPIRATION_DATE = "PasswordExpirationDate"; + @SerializedName(SERIALIZED_NAME_PASSWORD_EXPIRATION_DATE) + @javax.annotation.Nullable + private OffsetDateTime passwordExpirationDate; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public static final String SERIALIZED_NAME_MODIFIED_DATE = "ModifiedDate"; + @SerializedName(SERIALIZED_NAME_MODIFIED_DATE) + @javax.annotation.Nullable + private OffsetDateTime modifiedDate; + + public static final String SERIALIZED_NAME_PROFILE_MODIFIED_DATE = "ProfileModifiedDate"; + @SerializedName(SERIALIZED_NAME_PROFILE_MODIFIED_DATE) + @javax.annotation.Nullable + private OffsetDateTime profileModifiedDate; + + public static final String SERIALIZED_NAME_LAST_LOGIN_DATE = "LastLoginDate"; + @SerializedName(SERIALIZED_NAME_LAST_LOGIN_DATE) + @javax.annotation.Nullable + private OffsetDateTime lastLoginDate; + + public static final String SERIALIZED_NAME_SIGNUP_DATE = "SignupDate"; + @SerializedName(SERIALIZED_NAME_SIGNUP_DATE) + @javax.annotation.Nullable + private OffsetDateTime signupDate; + + public static final String SERIALIZED_NAME_PRIVACY_POLICY = "PrivacyPolicy"; + @SerializedName(SERIALIZED_NAME_PRIVACY_POLICY) + @javax.annotation.Nullable + private ProfilePrivacyPolicy privacyPolicy; + + public static final String SERIALIZED_NAME_COUNTRY = "Country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + @javax.annotation.Nullable + private ProfileCountry country; + + public static final String SERIALIZED_NAME_AGE_RANGE = "AgeRange"; + @SerializedName(SERIALIZED_NAME_AGE_RANGE) + @javax.annotation.Nullable + private ProfileAgeRange ageRange; + + public static final String SERIALIZED_NAME_KLOUT_SCORE = "KloutScore"; + @SerializedName(SERIALIZED_NAME_KLOUT_SCORE) + @javax.annotation.Nullable + private ProfileKloutScore kloutScore; + + public static final String SERIALIZED_NAME_SUGGESTIONS = "Suggestions"; + @SerializedName(SERIALIZED_NAME_SUGGESTIONS) + @javax.annotation.Nullable + private ProfileSuggestions suggestions; + + public static final String SERIALIZED_NAME_SUBSCRIPTION = "Subscription"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION) + @javax.annotation.Nullable + private ProfileSubscription subscription; + + public static final String SERIALIZED_NAME_P_I_N = "PIN"; + @SerializedName(SERIALIZED_NAME_P_I_N) + @javax.annotation.Nullable + private ProfilePIN PIN; + + public static final String SERIALIZED_NAME_CONSENT_PROFILE = "ConsentProfile"; + @SerializedName(SERIALIZED_NAME_CONSENT_PROFILE) + @javax.annotation.Nullable + private ProfileConsentProfile consentProfile; + + public static final String SERIALIZED_NAME_REGISTRATION_DATA = "RegistrationData"; + @SerializedName(SERIALIZED_NAME_REGISTRATION_DATA) + @javax.annotation.Nullable + private ProfileRegistrationData registrationData; + + public static final String SERIALIZED_NAME_PROVIDER_ACCESS_CREDENTIAL = "ProviderAccessCredential"; + @SerializedName(SERIALIZED_NAME_PROVIDER_ACCESS_CREDENTIAL) + @javax.annotation.Nullable + private ProfileProviderAccessCredential providerAccessCredential; + + public static final String SERIALIZED_NAME_CUSTOM_FIELDS = "CustomFields"; + @SerializedName(SERIALIZED_NAME_CUSTOM_FIELDS) + @javax.annotation.Nullable + private Map<String, String> customFields; + + public static final String SERIALIZED_NAME_PROFILE_IMAGE_URLS = "ProfileImageUrls"; + @SerializedName(SERIALIZED_NAME_PROFILE_IMAGE_URLS) + @javax.annotation.Nullable + private Map<String, String> profileImageUrls; + + public static final String SERIALIZED_NAME_WEB_PROFILES = "WebProfiles"; + @SerializedName(SERIALIZED_NAME_WEB_PROFILES) + @javax.annotation.Nullable + private Map<String, String> webProfiles; + + public static final String SERIALIZED_NAME_ROLES = "Roles"; + @SerializedName(SERIALIZED_NAME_ROLES) + @javax.annotation.Nullable + private List<String> roles; + + public static final String SERIALIZED_NAME_UID = "Uid"; + @SerializedName(SERIALIZED_NAME_UID) + @javax.annotation.Nullable + private String uid; + + public static final String SERIALIZED_NAME_PREVIOUS_UIDS = "PreviousUids"; + @SerializedName(SERIALIZED_NAME_PREVIOUS_UIDS) + @javax.annotation.Nullable + private List<String> previousUids; + + public static final String SERIALIZED_NAME_INTERESTED_IN = "InterestedIn"; + @SerializedName(SERIALIZED_NAME_INTERESTED_IN) + @javax.annotation.Nullable + private List<String> interestedIn; + + public static final String SERIALIZED_NAME_EXTERNAL_IDS = "ExternalIds"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_IDS) + @javax.annotation.Nullable + private List<ProfileExternalIdsInner> externalIds; + + public static final String SERIALIZED_NAME_UNVERIFIED_EMAIL = "UnverifiedEmail"; + @SerializedName(SERIALIZED_NAME_UNVERIFIED_EMAIL) + @javax.annotation.Nullable + private List<ProfileUnverifiedEmailInner> unverifiedEmail; + + public static final String SERIALIZED_NAME_POSITIONS = "Positions"; + @SerializedName(SERIALIZED_NAME_POSITIONS) + @javax.annotation.Nullable + private List<ProfilePositionsInner> positions; + + public static final String SERIALIZED_NAME_EDUCATIONS = "Educations"; + @SerializedName(SERIALIZED_NAME_EDUCATIONS) + @javax.annotation.Nullable + private List<ProfileEducationsInner> educations; + + public static final String SERIALIZED_NAME_PHONE_NUMBERS = "PhoneNumbers"; + @SerializedName(SERIALIZED_NAME_PHONE_NUMBERS) + @javax.annotation.Nullable + private List<ProfilePhoneNumbersInner> phoneNumbers; + + public static final String SERIALIZED_NAME_IM_ACCOUNTS = "IMAccounts"; + @SerializedName(SERIALIZED_NAME_IM_ACCOUNTS) + @javax.annotation.Nullable + private List<ProfileIMAccountsInner> imAccounts; + + public static final String SERIALIZED_NAME_ADDRESSES = "Addresses"; + @SerializedName(SERIALIZED_NAME_ADDRESSES) + @javax.annotation.Nullable + private List<ProfileAddressesInner> addresses; + + public static final String SERIALIZED_NAME_INTERESTS = "Interests"; + @SerializedName(SERIALIZED_NAME_INTERESTS) + @javax.annotation.Nullable + private List<ProfileInterestsInner> interests; + + public static final String SERIALIZED_NAME_SPORTS = "Sports"; + @SerializedName(SERIALIZED_NAME_SPORTS) + @javax.annotation.Nullable + private List<ProfileSportsInner> sports; + + public static final String SERIALIZED_NAME_INSPIRATIONAL_PEOPLE = "InspirationalPeople"; + @SerializedName(SERIALIZED_NAME_INSPIRATIONAL_PEOPLE) + @javax.annotation.Nullable + private List<ProfileInspirationalPeopleInner> inspirationalPeople; + + public static final String SERIALIZED_NAME_AWARDS = "Awards"; + @SerializedName(SERIALIZED_NAME_AWARDS) + @javax.annotation.Nullable + private List<ProfileAwardsInner> awards; + + public static final String SERIALIZED_NAME_SKILLS = "Skills"; + @SerializedName(SERIALIZED_NAME_SKILLS) + @javax.annotation.Nullable + private List<ProfileSkillsInner> skills; + + public static final String SERIALIZED_NAME_CURRENT_STATUS = "CurrentStatus"; + @SerializedName(SERIALIZED_NAME_CURRENT_STATUS) + @javax.annotation.Nullable + private List<ProfileCurrentStatusInner> currentStatus; + + public static final String SERIALIZED_NAME_CERTIFICATIONS = "Certifications"; + @SerializedName(SERIALIZED_NAME_CERTIFICATIONS) + @javax.annotation.Nullable + private List<ProfileCertificationsInner> certifications; + + public static final String SERIALIZED_NAME_COURSES = "Courses"; + @SerializedName(SERIALIZED_NAME_COURSES) + @javax.annotation.Nullable + private List<ProfileCoursesInner> courses; + + public static final String SERIALIZED_NAME_VOLUNTEER = "Volunteer"; + @SerializedName(SERIALIZED_NAME_VOLUNTEER) + @javax.annotation.Nullable + private List<ProfileVolunteerInner> volunteer; + + public static final String SERIALIZED_NAME_RECOMMENDATIONS_RECEIVED = "RecommendationsReceived"; + @SerializedName(SERIALIZED_NAME_RECOMMENDATIONS_RECEIVED) + @javax.annotation.Nullable + private List<ProfileRecommendationsReceivedInner> recommendationsReceived; + + public static final String SERIALIZED_NAME_LANGUAGES = "Languages"; + @SerializedName(SERIALIZED_NAME_LANGUAGES) + @javax.annotation.Nullable + private List<ProfileLanguagesInner> languages; + + public static final String SERIALIZED_NAME_PROJECTS = "Projects"; + @SerializedName(SERIALIZED_NAME_PROJECTS) + @javax.annotation.Nullable + private List<ProfileProjectsInner> projects; + + public static final String SERIALIZED_NAME_GAMES = "Games"; + @SerializedName(SERIALIZED_NAME_GAMES) + @javax.annotation.Nullable + private List<ProfileGamesInner> games; + + public static final String SERIALIZED_NAME_FAMILY = "Family"; + @SerializedName(SERIALIZED_NAME_FAMILY) + @javax.annotation.Nullable + private List<ProfileFamilyInner> family; + + public static final String SERIALIZED_NAME_TELEVISION_SHOW = "TelevisionShow"; + @SerializedName(SERIALIZED_NAME_TELEVISION_SHOW) + @javax.annotation.Nullable + private List<ProfileTelevisionShowInner> televisionShow; + + public static final String SERIALIZED_NAME_MUTUAL_FRIENDS = "MutualFriends"; + @SerializedName(SERIALIZED_NAME_MUTUAL_FRIENDS) + @javax.annotation.Nullable + private List<ProfileMutualFriendsInner> mutualFriends; + + public static final String SERIALIZED_NAME_MOVIES = "Movies"; + @SerializedName(SERIALIZED_NAME_MOVIES) + @javax.annotation.Nullable + private List<ProfileMoviesInner> movies; + + public static final String SERIALIZED_NAME_BOOKS = "Books"; + @SerializedName(SERIALIZED_NAME_BOOKS) + @javax.annotation.Nullable + private List<ProfileBooksInner> books; + + public static final String SERIALIZED_NAME_PATENTS = "Patents"; + @SerializedName(SERIALIZED_NAME_PATENTS) + @javax.annotation.Nullable + private List<ProfilePatentsInner> patents; + + public static final String SERIALIZED_NAME_FAVORITE_THINGS = "FavoriteThings"; + @SerializedName(SERIALIZED_NAME_FAVORITE_THINGS) + @javax.annotation.Nullable + private List<ProfileFavoriteThingsInner> favoriteThings; + + public static final String SERIALIZED_NAME_RELATED_PROFILE_VIEWS = "RelatedProfileViews"; + @SerializedName(SERIALIZED_NAME_RELATED_PROFILE_VIEWS) + @javax.annotation.Nullable + private List<ProfileRelatedProfileViewsInner> relatedProfileViews; + + public static final String SERIALIZED_NAME_PLACES_LIVED = "PlacesLived"; + @SerializedName(SERIALIZED_NAME_PLACES_LIVED) + @javax.annotation.Nullable + private List<ProfilePlacesLivedInner> placesLived; + + public static final String SERIALIZED_NAME_PUBLICATIONS = "Publications"; + @SerializedName(SERIALIZED_NAME_PUBLICATIONS) + @javax.annotation.Nullable + private List<ProfilePublicationsInner> publications; + + public static final String SERIALIZED_NAME_JOB_BOOKMARKS = "JobBookmarks"; + @SerializedName(SERIALIZED_NAME_JOB_BOOKMARKS) + @javax.annotation.Nullable + private List<ProfileJobBookmarksInner> jobBookmarks; + + public static final String SERIALIZED_NAME_BADGES = "Badges"; + @SerializedName(SERIALIZED_NAME_BADGES) + @javax.annotation.Nullable + private List<ProfileBadgesInner> badges; + + public static final String SERIALIZED_NAME_MEMBER_URL_RESOURCES = "MemberUrlResources"; + @SerializedName(SERIALIZED_NAME_MEMBER_URL_RESOURCES) + @javax.annotation.Nullable + private List<ProfileMemberUrlResourcesInner> memberUrlResources; + + public static final String SERIALIZED_NAME_ORGANIZATIONS = "Organizations"; + @SerializedName(SERIALIZED_NAME_ORGANIZATIONS) + @javax.annotation.Nullable + private List<ProfileOrganizationsInner> organizations; + + public static final String SERIALIZED_NAME_OBJECT_ID = "ObjectId"; + @SerializedName(SERIALIZED_NAME_OBJECT_ID) + @javax.annotation.Nullable + private String objectId; + + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private List<ProfileEmailInner> email; + + public static final String SERIALIZED_NAME_PASSKEY_LOGIN = "PasskeyLogin"; + @SerializedName(SERIALIZED_NAME_PASSKEY_LOGIN) + @javax.annotation.Nullable + private IdentityPasskeyLogin passkeyLogin; + + public Identity() { + } + + public Identity isPasswordBreached(@javax.annotation.Nullable Boolean isPasswordBreached) { + this.isPasswordBreached = isPasswordBreached; + return this; + } + + /** + * Indicates if the Password has been breached. + * @return isPasswordBreached + */ + @javax.annotation.Nullable + public Boolean getIsPasswordBreached() { + return isPasswordBreached; + } + + public void setIsPasswordBreached(@javax.annotation.Nullable Boolean isPasswordBreached) { + this.isPasswordBreached = isPasswordBreached; + } + + + public Identity isActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Indicates if the User Account is active. + * @return isActive + */ + @javax.annotation.Nullable + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + } + + + public Identity isDeleted(@javax.annotation.Nullable Boolean isDeleted) { + this.isDeleted = isDeleted; + return this; + } + + /** + * Indicates if the User Account is deleted. + * @return isDeleted + */ + @javax.annotation.Nullable + public Boolean getIsDeleted() { + return isDeleted; + } + + public void setIsDeleted(@javax.annotation.Nullable Boolean isDeleted) { + this.isDeleted = isDeleted; + } + + + public Identity emailVerified(@javax.annotation.Nullable Boolean emailVerified) { + this.emailVerified = emailVerified; + return this; + } + + /** + * Indicates if the User's Email is verified. + * @return emailVerified + */ + @javax.annotation.Nullable + public Boolean getEmailVerified() { + return emailVerified; + } + + public void setEmailVerified(@javax.annotation.Nullable Boolean emailVerified) { + this.emailVerified = emailVerified; + } + + + public Identity isLoginLocked(@javax.annotation.Nullable Boolean isLoginLocked) { + this.isLoginLocked = isLoginLocked; + return this; + } + + /** + * Indicates if the User's login is locked. + * @return isLoginLocked + */ + @javax.annotation.Nullable + public Boolean getIsLoginLocked() { + return isLoginLocked; + } + + public void setIsLoginLocked(@javax.annotation.Nullable Boolean isLoginLocked) { + this.isLoginLocked = isLoginLocked; + } + + + public Identity isRequiredFieldsFilledOnce(@javax.annotation.Nullable Boolean isRequiredFieldsFilledOnce) { + this.isRequiredFieldsFilledOnce = isRequiredFieldsFilledOnce; + return this; + } + + /** + * Indicates if required fields have been filled at least once. + * @return isRequiredFieldsFilledOnce + */ + @javax.annotation.Nullable + public Boolean getIsRequiredFieldsFilledOnce() { + return isRequiredFieldsFilledOnce; + } + + public void setIsRequiredFieldsFilledOnce(@javax.annotation.Nullable Boolean isRequiredFieldsFilledOnce) { + this.isRequiredFieldsFilledOnce = isRequiredFieldsFilledOnce; + } + + + public Identity firstLogin(@javax.annotation.Nullable Boolean firstLogin) { + this.firstLogin = firstLogin; + return this; + } + + /** + * Indicates if this is the User's first login. + * @return firstLogin + */ + @javax.annotation.Nullable + public Boolean getFirstLogin() { + return firstLogin; + } + + public void setFirstLogin(@javax.annotation.Nullable Boolean firstLogin) { + this.firstLogin = firstLogin; + } + + + public Identity isProtected(@javax.annotation.Nullable Boolean isProtected) { + this.isProtected = isProtected; + return this; + } + + /** + * Indicates if the User Account is protected. + * @return isProtected + */ + @javax.annotation.Nullable + public Boolean getIsProtected() { + return isProtected; + } + + public void setIsProtected(@javax.annotation.Nullable Boolean isProtected) { + this.isProtected = isProtected; + } + + + public Identity hireable(@javax.annotation.Nullable Boolean hireable) { + this.hireable = hireable; + return this; + } + + /** + * Indicates if the User is hireable. + * @return hireable + */ + @javax.annotation.Nullable + public Boolean getHireable() { + return hireable; + } + + public void setHireable(@javax.annotation.Nullable Boolean hireable) { + this.hireable = hireable; + } + + + public Identity isSecurePassword(@javax.annotation.Nullable Boolean isSecurePassword) { + this.isSecurePassword = isSecurePassword; + return this; + } + + /** + * Indicates if the Password is secure. + * @return isSecurePassword + */ + @javax.annotation.Nullable + public Boolean getIsSecurePassword() { + return isSecurePassword; + } + + public void setIsSecurePassword(@javax.annotation.Nullable Boolean isSecurePassword) { + this.isSecurePassword = isSecurePassword; + } + + + public Identity isCustomUid(@javax.annotation.Nullable Boolean isCustomUid) { + this.isCustomUid = isCustomUid; + return this; + } + + /** + * Indicates if the UID is custom. + * @return isCustomUid + */ + @javax.annotation.Nullable + public Boolean getIsCustomUid() { + return isCustomUid; + } + + public void setIsCustomUid(@javax.annotation.Nullable Boolean isCustomUid) { + this.isCustomUid = isCustomUid; + } + + + public Identity phoneIdVerified(@javax.annotation.Nullable Boolean phoneIdVerified) { + this.phoneIdVerified = phoneIdVerified; + return this; + } + + /** + * Indicates if the Phone ID is verified. + * @return phoneIdVerified + */ + @javax.annotation.Nullable + public Boolean getPhoneIdVerified() { + return phoneIdVerified; + } + + public void setPhoneIdVerified(@javax.annotation.Nullable Boolean phoneIdVerified) { + this.phoneIdVerified = phoneIdVerified; + } + + + public Identity isEmailSubscribed(@javax.annotation.Nullable Boolean isEmailSubscribed) { + this.isEmailSubscribed = isEmailSubscribed; + return this; + } + + /** + * Indicates if the User is subscribed to emails. + * @return isEmailSubscribed + */ + @javax.annotation.Nullable + public Boolean getIsEmailSubscribed() { + return isEmailSubscribed; + } + + public void setIsEmailSubscribed(@javax.annotation.Nullable Boolean isEmailSubscribed) { + this.isEmailSubscribed = isEmailSubscribed; + } + + + public Identity noOfLogins(@javax.annotation.Nullable Integer noOfLogins) { + this.noOfLogins = noOfLogins; + return this; + } + + /** + * Number of logins by the User. + * @return noOfLogins + */ + @javax.annotation.Nullable + public Integer getNoOfLogins() { + return noOfLogins; + } + + public void setNoOfLogins(@javax.annotation.Nullable Integer noOfLogins) { + this.noOfLogins = noOfLogins; + } + + + public Identity followersCount(@javax.annotation.Nullable Integer followersCount) { + this.followersCount = followersCount; + return this; + } + + /** + * Number of followers the User has. + * @return followersCount + */ + @javax.annotation.Nullable + public Integer getFollowersCount() { + return followersCount; + } + + public void setFollowersCount(@javax.annotation.Nullable Integer followersCount) { + this.followersCount = followersCount; + } + + + public Identity friendsCount(@javax.annotation.Nullable Integer friendsCount) { + this.friendsCount = friendsCount; + return this; + } + + /** + * Number of friends the User has. + * @return friendsCount + */ + @javax.annotation.Nullable + public Integer getFriendsCount() { + return friendsCount; + } + + public void setFriendsCount(@javax.annotation.Nullable Integer friendsCount) { + this.friendsCount = friendsCount; + } + + + public Identity totalStatusesCount(@javax.annotation.Nullable Integer totalStatusesCount) { + this.totalStatusesCount = totalStatusesCount; + return this; + } + + /** + * Total number of statuses posted by the User. + * @return totalStatusesCount + */ + @javax.annotation.Nullable + public Integer getTotalStatusesCount() { + return totalStatusesCount; + } + + public void setTotalStatusesCount(@javax.annotation.Nullable Integer totalStatusesCount) { + this.totalStatusesCount = totalStatusesCount; + } + + + public Identity numRecommenders(@javax.annotation.Nullable Integer numRecommenders) { + this.numRecommenders = numRecommenders; + return this; + } + + /** + * Number of recommenders for the User. + * @return numRecommenders + */ + @javax.annotation.Nullable + public Integer getNumRecommenders() { + return numRecommenders; + } + + public void setNumRecommenders(@javax.annotation.Nullable Integer numRecommenders) { + this.numRecommenders = numRecommenders; + } + + + public Identity totalPrivateRepository(@javax.annotation.Nullable Integer totalPrivateRepository) { + this.totalPrivateRepository = totalPrivateRepository; + return this; + } + + /** + * Total number of private repositories. + * @return totalPrivateRepository + */ + @javax.annotation.Nullable + public Integer getTotalPrivateRepository() { + return totalPrivateRepository; + } + + public void setTotalPrivateRepository(@javax.annotation.Nullable Integer totalPrivateRepository) { + this.totalPrivateRepository = totalPrivateRepository; + } + + + public Identity publicGists(@javax.annotation.Nullable Integer publicGists) { + this.publicGists = publicGists; + return this; + } + + /** + * Total number of public gists. + * @return publicGists + */ + @javax.annotation.Nullable + public Integer getPublicGists() { + return publicGists; + } + + public void setPublicGists(@javax.annotation.Nullable Integer publicGists) { + this.publicGists = publicGists; + } + + + public Identity privateGists(@javax.annotation.Nullable Integer privateGists) { + this.privateGists = privateGists; + return this; + } + + /** + * Total number of private gists. + * @return privateGists + */ + @javax.annotation.Nullable + public Integer getPrivateGists() { + return privateGists; + } + + public void setPrivateGists(@javax.annotation.Nullable Integer privateGists) { + this.privateGists = privateGists; + } + + + public Identity pinsCount(@javax.annotation.Nullable Integer pinsCount) { + this.pinsCount = pinsCount; + return this; + } + + /** + * Total number of PINs. + * @return pinsCount + */ + @javax.annotation.Nullable + public Integer getPinsCount() { + return pinsCount; + } + + public void setPinsCount(@javax.annotation.Nullable Integer pinsCount) { + this.pinsCount = pinsCount; + } + + + public Identity boardsCount(@javax.annotation.Nullable Integer boardsCount) { + this.boardsCount = boardsCount; + return this; + } + + /** + * Total number of boards. + * @return boardsCount + */ + @javax.annotation.Nullable + public Integer getBoardsCount() { + return boardsCount; + } + + public void setBoardsCount(@javax.annotation.Nullable Integer boardsCount) { + this.boardsCount = boardsCount; + } + + + public Identity likesCount(@javax.annotation.Nullable Integer likesCount) { + this.likesCount = likesCount; + return this; + } + + /** + * Total number of likes. + * @return likesCount + */ + @javax.annotation.Nullable + public Integer getLikesCount() { + return likesCount; + } + + public void setLikesCount(@javax.annotation.Nullable Integer likesCount) { + this.likesCount = likesCount; + } + + + public Identity ID(@javax.annotation.Nullable String ID) { + this.ID = ID; + return this; + } + + /** + * Unique identifier for the User Profile. + * @return ID + */ + @javax.annotation.Nullable + public String getID() { + return ID; + } + + public void setID(@javax.annotation.Nullable String ID) { + this.ID = ID; + } + + + public Identity provider(@javax.annotation.Nullable String provider) { + this.provider = provider; + return this; + } + + /** + * Provider of the User Profile. + * @return provider + */ + @javax.annotation.Nullable + public String getProvider() { + return provider; + } + + public void setProvider(@javax.annotation.Nullable String provider) { + this.provider = provider; + } + + + public Identity fullName(@javax.annotation.Nullable String fullName) { + this.fullName = fullName; + return this; + } + + /** + * Full name of the User. + * @return fullName + */ + @javax.annotation.Nullable + public String getFullName() { + return fullName; + } + + public void setFullName(@javax.annotation.Nullable String fullName) { + this.fullName = fullName; + } + + + public Identity firstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * First name of the User. + * @return firstName + */ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + } + + + public Identity lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Last name of the User. + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + + public Identity phoneId(@javax.annotation.Nullable String phoneId) { + this.phoneId = phoneId; + return this; + } + + /** + * Phone ID of the User. + * @return phoneId + */ + @javax.annotation.Nullable + public String getPhoneId() { + return phoneId; + } + + public void setPhoneId(@javax.annotation.Nullable String phoneId) { + this.phoneId = phoneId; + } + + + public Identity userName(@javax.annotation.Nullable String userName) { + this.userName = userName; + return this; + } + + /** + * The Username of the User. + * @return userName + */ + @javax.annotation.Nullable + public String getUserName() { + return userName; + } + + public void setUserName(@javax.annotation.Nullable String userName) { + this.userName = userName; + } + + + public Identity prefix(@javax.annotation.Nullable String prefix) { + this.prefix = prefix; + return this; + } + + /** + * The prefix for the User's name. + * @return prefix + */ + @javax.annotation.Nullable + public String getPrefix() { + return prefix; + } + + public void setPrefix(@javax.annotation.Nullable String prefix) { + this.prefix = prefix; + } + + + public Identity middleName(@javax.annotation.Nullable String middleName) { + this.middleName = middleName; + return this; + } + + /** + * The middle name of the User. + * @return middleName + */ + @javax.annotation.Nullable + public String getMiddleName() { + return middleName; + } + + public void setMiddleName(@javax.annotation.Nullable String middleName) { + this.middleName = middleName; + } + + + public Identity suffix(@javax.annotation.Nullable String suffix) { + this.suffix = suffix; + return this; + } + + /** + * The suffix for the User's name. + * @return suffix + */ + @javax.annotation.Nullable + public String getSuffix() { + return suffix; + } + + public void setSuffix(@javax.annotation.Nullable String suffix) { + this.suffix = suffix; + } + + + public Identity nickName(@javax.annotation.Nullable String nickName) { + this.nickName = nickName; + return this; + } + + /** + * The nickname of the User. + * @return nickName + */ + @javax.annotation.Nullable + public String getNickName() { + return nickName; + } + + public void setNickName(@javax.annotation.Nullable String nickName) { + this.nickName = nickName; + } + + + public Identity profileName(@javax.annotation.Nullable String profileName) { + this.profileName = profileName; + return this; + } + + /** + * The profile name of the User. + * @return profileName + */ + @javax.annotation.Nullable + public String getProfileName() { + return profileName; + } + + public void setProfileName(@javax.annotation.Nullable String profileName) { + this.profileName = profileName; + } + + + public Identity birthDate(@javax.annotation.Nullable String birthDate) { + this.birthDate = birthDate; + return this; + } + + /** + * The birth date of the User. + * @return birthDate + */ + @javax.annotation.Nullable + public String getBirthDate() { + return birthDate; + } + + public void setBirthDate(@javax.annotation.Nullable String birthDate) { + this.birthDate = birthDate; + } + + + public Identity gender(@javax.annotation.Nullable String gender) { + this.gender = gender; + return this; + } + + /** + * The gender of the User. + * @return gender + */ + @javax.annotation.Nullable + public String getGender() { + return gender; + } + + public void setGender(@javax.annotation.Nullable String gender) { + this.gender = gender; + } + + + public Identity website(@javax.annotation.Nullable String website) { + this.website = website; + return this; + } + + /** + * The website of the User. + * @return website + */ + @javax.annotation.Nullable + public String getWebsite() { + return website; + } + + public void setWebsite(@javax.annotation.Nullable String website) { + this.website = website; + } + + + public Identity thumbnailImageUrl(@javax.annotation.Nullable String thumbnailImageUrl) { + this.thumbnailImageUrl = thumbnailImageUrl; + return this; + } + + /** + * The URL of the User's thumbnail image. + * @return thumbnailImageUrl + */ + @javax.annotation.Nullable + public String getThumbnailImageUrl() { + return thumbnailImageUrl; + } + + public void setThumbnailImageUrl(@javax.annotation.Nullable String thumbnailImageUrl) { + this.thumbnailImageUrl = thumbnailImageUrl; + } + + + public Identity imageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** + * The URL of the User's profile image. + * @return imageUrl + */ + @javax.annotation.Nullable + public String getImageUrl() { + return imageUrl; + } + + public void setImageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + } + + + public Identity favicon(@javax.annotation.Nullable String favicon) { + this.favicon = favicon; + return this; + } + + /** + * The URL of the User's favicon. + * @return favicon + */ + @javax.annotation.Nullable + public String getFavicon() { + return favicon; + } + + public void setFavicon(@javax.annotation.Nullable String favicon) { + this.favicon = favicon; + } + + + public Identity profileUrl(@javax.annotation.Nullable String profileUrl) { + this.profileUrl = profileUrl; + return this; + } + + /** + * The URL of the User's profile. + * @return profileUrl + */ + @javax.annotation.Nullable + public String getProfileUrl() { + return profileUrl; + } + + public void setProfileUrl(@javax.annotation.Nullable String profileUrl) { + this.profileUrl = profileUrl; + } + + + public Identity homeTown(@javax.annotation.Nullable String homeTown) { + this.homeTown = homeTown; + return this; + } + + /** + * The hometown of the User. + * @return homeTown + */ + @javax.annotation.Nullable + public String getHomeTown() { + return homeTown; + } + + public void setHomeTown(@javax.annotation.Nullable String homeTown) { + this.homeTown = homeTown; + } + + + public Identity state(@javax.annotation.Nullable String state) { + this.state = state; + return this; + } + + /** + * The state of the User. + * @return state + */ + @javax.annotation.Nullable + public String getState() { + return state; + } + + public void setState(@javax.annotation.Nullable String state) { + this.state = state; + } + + + public Identity city(@javax.annotation.Nullable String city) { + this.city = city; + return this; + } + + /** + * The city of the User. + * @return city + */ + @javax.annotation.Nullable + public String getCity() { + return city; + } + + public void setCity(@javax.annotation.Nullable String city) { + this.city = city; + } + + + public Identity industry(@javax.annotation.Nullable String industry) { + this.industry = industry; + return this; + } + + /** + * The industry of the User. + * @return industry + */ + @javax.annotation.Nullable + public String getIndustry() { + return industry; + } + + public void setIndustry(@javax.annotation.Nullable String industry) { + this.industry = industry; + } + + + public Identity about(@javax.annotation.Nullable String about) { + this.about = about; + return this; + } + + /** + * A brief description about the User. + * @return about + */ + @javax.annotation.Nullable + public String getAbout() { + return about; + } + + public void setAbout(@javax.annotation.Nullable String about) { + this.about = about; + } + + + public Identity timeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * The time zone of the User. + * @return timeZone + */ + @javax.annotation.Nullable + public String getTimeZone() { + return timeZone; + } + + public void setTimeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + } + + + public Identity localLanguage(@javax.annotation.Nullable String localLanguage) { + this.localLanguage = localLanguage; + return this; + } + + /** + * The local language of the User. + * @return localLanguage + */ + @javax.annotation.Nullable + public String getLocalLanguage() { + return localLanguage; + } + + public void setLocalLanguage(@javax.annotation.Nullable String localLanguage) { + this.localLanguage = localLanguage; + } + + + public Identity coverPhoto(@javax.annotation.Nullable String coverPhoto) { + this.coverPhoto = coverPhoto; + return this; + } + + /** + * The URL of the User's cover photo. + * @return coverPhoto + */ + @javax.annotation.Nullable + public String getCoverPhoto() { + return coverPhoto; + } + + public void setCoverPhoto(@javax.annotation.Nullable String coverPhoto) { + this.coverPhoto = coverPhoto; + } + + + public Identity tagLine(@javax.annotation.Nullable String tagLine) { + this.tagLine = tagLine; + return this; + } + + /** + * The tagline of the User. + * @return tagLine + */ + @javax.annotation.Nullable + public String getTagLine() { + return tagLine; + } + + public void setTagLine(@javax.annotation.Nullable String tagLine) { + this.tagLine = tagLine; + } + + + public Identity language(@javax.annotation.Nullable String language) { + this.language = language; + return this; + } + + /** + * The language of the User. + * @return language + */ + @javax.annotation.Nullable + public String getLanguage() { + return language; + } + + public void setLanguage(@javax.annotation.Nullable String language) { + this.language = language; + } + + + public Identity verified(@javax.annotation.Nullable String verified) { + this.verified = verified; + return this; + } + + /** + * Indicates if the User is verified. + * @return verified + */ + @javax.annotation.Nullable + public String getVerified() { + return verified; + } + + public void setVerified(@javax.annotation.Nullable String verified) { + this.verified = verified; + } + + + public Identity updatedTime(@javax.annotation.Nullable String updatedTime) { + this.updatedTime = updatedTime; + return this; + } + + /** + * The last updated time of the User's profile. + * @return updatedTime + */ + @javax.annotation.Nullable + public String getUpdatedTime() { + return updatedTime; + } + + public void setUpdatedTime(@javax.annotation.Nullable String updatedTime) { + this.updatedTime = updatedTime; + } + + + public Identity isGeoEnabled(@javax.annotation.Nullable String isGeoEnabled) { + this.isGeoEnabled = isGeoEnabled; + return this; + } + + /** + * Indicates if geolocation is enabled for the User. + * @return isGeoEnabled + */ + @javax.annotation.Nullable + public String getIsGeoEnabled() { + return isGeoEnabled; + } + + public void setIsGeoEnabled(@javax.annotation.Nullable String isGeoEnabled) { + this.isGeoEnabled = isGeoEnabled; + } + + + public Identity associations(@javax.annotation.Nullable String associations) { + this.associations = associations; + return this; + } + + /** + * The associations of the User. + * @return associations + */ + @javax.annotation.Nullable + public String getAssociations() { + return associations; + } + + public void setAssociations(@javax.annotation.Nullable String associations) { + this.associations = associations; + } + + + public Identity honors(@javax.annotation.Nullable String honors) { + this.honors = honors; + return this; + } + + /** + * The honors received by the User. + * @return honors + */ + @javax.annotation.Nullable + public String getHonors() { + return honors; + } + + public void setHonors(@javax.annotation.Nullable String honors) { + this.honors = honors; + } + + + public Identity httpsImageUrl(@javax.annotation.Nullable String httpsImageUrl) { + this.httpsImageUrl = httpsImageUrl; + return this; + } + + /** + * The HTTPS URL of the User's profile image. + * @return httpsImageUrl + */ + @javax.annotation.Nullable + public String getHttpsImageUrl() { + return httpsImageUrl; + } + + public void setHttpsImageUrl(@javax.annotation.Nullable String httpsImageUrl) { + this.httpsImageUrl = httpsImageUrl; + } + + + public Identity mainAddress(@javax.annotation.Nullable String mainAddress) { + this.mainAddress = mainAddress; + return this; + } + + /** + * The main address of the User. + * @return mainAddress + */ + @javax.annotation.Nullable + public String getMainAddress() { + return mainAddress; + } + + public void setMainAddress(@javax.annotation.Nullable String mainAddress) { + this.mainAddress = mainAddress; + } + + + public Identity created(@javax.annotation.Nullable String created) { + this.created = created; + return this; + } + + /** + * The creation date of the User's account. + * @return created + */ + @javax.annotation.Nullable + public String getCreated() { + return created; + } + + public void setCreated(@javax.annotation.Nullable String created) { + this.created = created; + } + + + public Identity localCity(@javax.annotation.Nullable String localCity) { + this.localCity = localCity; + return this; + } + + /** + * The local city of the User. + * @return localCity + */ + @javax.annotation.Nullable + public String getLocalCity() { + return localCity; + } + + public void setLocalCity(@javax.annotation.Nullable String localCity) { + this.localCity = localCity; + } + + + public Identity profileCity(@javax.annotation.Nullable String profileCity) { + this.profileCity = profileCity; + return this; + } + + /** + * The profile city of the User. + * @return profileCity + */ + @javax.annotation.Nullable + public String getProfileCity() { + return profileCity; + } + + public void setProfileCity(@javax.annotation.Nullable String profileCity) { + this.profileCity = profileCity; + } + + + public Identity localCountry(@javax.annotation.Nullable String localCountry) { + this.localCountry = localCountry; + return this; + } + + /** + * The local country of the User. + * @return localCountry + */ + @javax.annotation.Nullable + public String getLocalCountry() { + return localCountry; + } + + public void setLocalCountry(@javax.annotation.Nullable String localCountry) { + this.localCountry = localCountry; + } + + + public Identity profileCountry(@javax.annotation.Nullable String profileCountry) { + this.profileCountry = profileCountry; + return this; + } + + /** + * The profile country of the User. + * @return profileCountry + */ + @javax.annotation.Nullable + public String getProfileCountry() { + return profileCountry; + } + + public void setProfileCountry(@javax.annotation.Nullable String profileCountry) { + this.profileCountry = profileCountry; + } + + + public Identity relationshipStatus(@javax.annotation.Nullable String relationshipStatus) { + this.relationshipStatus = relationshipStatus; + return this; + } + + /** + * The relationship status of the User. + * @return relationshipStatus + */ + @javax.annotation.Nullable + public String getRelationshipStatus() { + return relationshipStatus; + } + + public void setRelationshipStatus(@javax.annotation.Nullable String relationshipStatus) { + this.relationshipStatus = relationshipStatus; + } + + + public Identity quota(@javax.annotation.Nullable String quota) { + this.quota = quota; + return this; + } + + /** + * The quota assigned to the User. + * @return quota + */ + @javax.annotation.Nullable + public String getQuota() { + return quota; + } + + public void setQuota(@javax.annotation.Nullable String quota) { + this.quota = quota; + } + + + public Identity quote(@javax.annotation.Nullable String quote) { + this.quote = quote; + return this; + } + + /** + * A quote associated with the User. + * @return quote + */ + @javax.annotation.Nullable + public String getQuote() { + return quote; + } + + public void setQuote(@javax.annotation.Nullable String quote) { + this.quote = quote; + } + + + public Identity religion(@javax.annotation.Nullable String religion) { + this.religion = religion; + return this; + } + + /** + * The religion of the User. + * @return religion + */ + @javax.annotation.Nullable + public String getReligion() { + return religion; + } + + public void setReligion(@javax.annotation.Nullable String religion) { + this.religion = religion; + } + + + public Identity political(@javax.annotation.Nullable String political) { + this.political = political; + return this; + } + + /** + * The political views of the User. + * @return political + */ + @javax.annotation.Nullable + public String getPolitical() { + return political; + } + + public void setPolitical(@javax.annotation.Nullable String political) { + this.political = political; + } + + + public Identity publicRepository(@javax.annotation.Nullable String publicRepository) { + this.publicRepository = publicRepository; + return this; + } + + /** + * The number of public repositories owned by the User. + * @return publicRepository + */ + @javax.annotation.Nullable + public String getPublicRepository() { + return publicRepository; + } + + public void setPublicRepository(@javax.annotation.Nullable String publicRepository) { + this.publicRepository = publicRepository; + } + + + public Identity repositoryUrl(@javax.annotation.Nullable String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + return this; + } + + /** + * The URL of the User's repository. + * @return repositoryUrl + */ + @javax.annotation.Nullable + public String getRepositoryUrl() { + return repositoryUrl; + } + + public void setRepositoryUrl(@javax.annotation.Nullable String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + } + + + public Identity age(@javax.annotation.Nullable String age) { + this.age = age; + return this; + } + + /** + * The age of the User. + * @return age + */ + @javax.annotation.Nullable + public String getAge() { + return age; + } + + public void setAge(@javax.annotation.Nullable String age) { + this.age = age; + } + + + public Identity professionalHeadline(@javax.annotation.Nullable String professionalHeadline) { + this.professionalHeadline = professionalHeadline; + return this; + } + + /** + * The professional headline of the User. + * @return professionalHeadline + */ + @javax.annotation.Nullable + public String getProfessionalHeadline() { + return professionalHeadline; + } + + public void setProfessionalHeadline(@javax.annotation.Nullable String professionalHeadline) { + this.professionalHeadline = professionalHeadline; + } + + + public Identity lrUserID(@javax.annotation.Nullable String lrUserID) { + this.lrUserID = lrUserID; + return this; + } + + /** + * The LoginRadius User ID. + * @return lrUserID + */ + @javax.annotation.Nullable + public String getLrUserID() { + return lrUserID; + } + + public void setLrUserID(@javax.annotation.Nullable String lrUserID) { + this.lrUserID = lrUserID; + } + + + public Identity currency(@javax.annotation.Nullable String currency) { + this.currency = currency; + return this; + } + + /** + * The preferred currency of the User. + * @return currency + */ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + public void setCurrency(@javax.annotation.Nullable String currency) { + this.currency = currency; + } + + + public Identity starredUrl(@javax.annotation.Nullable String starredUrl) { + this.starredUrl = starredUrl; + return this; + } + + /** + * The URL of the User's starred items. + * @return starredUrl + */ + @javax.annotation.Nullable + public String getStarredUrl() { + return starredUrl; + } + + public void setStarredUrl(@javax.annotation.Nullable String starredUrl) { + this.starredUrl = starredUrl; + } + + + public Identity gistsUrl(@javax.annotation.Nullable String gistsUrl) { + this.gistsUrl = gistsUrl; + return this; + } + + /** + * The URL of the User's gists. + * @return gistsUrl + */ + @javax.annotation.Nullable + public String getGistsUrl() { + return gistsUrl; + } + + public void setGistsUrl(@javax.annotation.Nullable String gistsUrl) { + this.gistsUrl = gistsUrl; + } + + + public Identity company(@javax.annotation.Nullable String company) { + this.company = company; + return this; + } + + /** + * The company the User is associated with. + * @return company + */ + @javax.annotation.Nullable + public String getCompany() { + return company; + } + + public void setCompany(@javax.annotation.Nullable String company) { + this.company = company; + } + + + public Identity gravatarImageUrl(@javax.annotation.Nullable String gravatarImageUrl) { + this.gravatarImageUrl = gravatarImageUrl; + return this; + } + + /** + * The URL of the User's Gravatar image. + * @return gravatarImageUrl + */ + @javax.annotation.Nullable + public String getGravatarImageUrl() { + return gravatarImageUrl; + } + + public void setGravatarImageUrl(@javax.annotation.Nullable String gravatarImageUrl) { + this.gravatarImageUrl = gravatarImageUrl; + } + + + public Identity lastPasswordChangeDate(@javax.annotation.Nullable OffsetDateTime lastPasswordChangeDate) { + this.lastPasswordChangeDate = lastPasswordChangeDate; + return this; + } + + /** + * The date of the last Password change. + * @return lastPasswordChangeDate + */ + @javax.annotation.Nullable + public OffsetDateTime getLastPasswordChangeDate() { + return lastPasswordChangeDate; + } + + public void setLastPasswordChangeDate(@javax.annotation.Nullable OffsetDateTime lastPasswordChangeDate) { + this.lastPasswordChangeDate = lastPasswordChangeDate; + } + + + public Identity passwordExpirationDate(@javax.annotation.Nullable OffsetDateTime passwordExpirationDate) { + this.passwordExpirationDate = passwordExpirationDate; + return this; + } + + /** + * The expiration date of the Password. + * @return passwordExpirationDate + */ + @javax.annotation.Nullable + public OffsetDateTime getPasswordExpirationDate() { + return passwordExpirationDate; + } + + public void setPasswordExpirationDate(@javax.annotation.Nullable OffsetDateTime passwordExpirationDate) { + this.passwordExpirationDate = passwordExpirationDate; + } + + + public Identity createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * The date the Account was created. + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + + public Identity modifiedDate(@javax.annotation.Nullable OffsetDateTime modifiedDate) { + this.modifiedDate = modifiedDate; + return this; + } + + /** + * The date the Account was last modified. + * @return modifiedDate + */ + @javax.annotation.Nullable + public OffsetDateTime getModifiedDate() { + return modifiedDate; + } + + public void setModifiedDate(@javax.annotation.Nullable OffsetDateTime modifiedDate) { + this.modifiedDate = modifiedDate; + } + + + public Identity profileModifiedDate(@javax.annotation.Nullable OffsetDateTime profileModifiedDate) { + this.profileModifiedDate = profileModifiedDate; + return this; + } + + /** + * The date the Profile was last modified. + * @return profileModifiedDate + */ + @javax.annotation.Nullable + public OffsetDateTime getProfileModifiedDate() { + return profileModifiedDate; + } + + public void setProfileModifiedDate(@javax.annotation.Nullable OffsetDateTime profileModifiedDate) { + this.profileModifiedDate = profileModifiedDate; + } + + + public Identity lastLoginDate(@javax.annotation.Nullable OffsetDateTime lastLoginDate) { + this.lastLoginDate = lastLoginDate; + return this; + } + + /** + * The date of the last login. + * @return lastLoginDate + */ + @javax.annotation.Nullable + public OffsetDateTime getLastLoginDate() { + return lastLoginDate; + } + + public void setLastLoginDate(@javax.annotation.Nullable OffsetDateTime lastLoginDate) { + this.lastLoginDate = lastLoginDate; + } + + + public Identity signupDate(@javax.annotation.Nullable OffsetDateTime signupDate) { + this.signupDate = signupDate; + return this; + } + + /** + * The date the User signed up. + * @return signupDate + */ + @javax.annotation.Nullable + public OffsetDateTime getSignupDate() { + return signupDate; + } + + public void setSignupDate(@javax.annotation.Nullable OffsetDateTime signupDate) { + this.signupDate = signupDate; + } + + + public Identity privacyPolicy(@javax.annotation.Nullable ProfilePrivacyPolicy privacyPolicy) { + this.privacyPolicy = privacyPolicy; + return this; + } + + /** + * Get privacyPolicy + * @return privacyPolicy + */ + @javax.annotation.Nullable + public ProfilePrivacyPolicy getPrivacyPolicy() { + return privacyPolicy; + } + + public void setPrivacyPolicy(@javax.annotation.Nullable ProfilePrivacyPolicy privacyPolicy) { + this.privacyPolicy = privacyPolicy; + } + + + public Identity country(@javax.annotation.Nullable ProfileCountry country) { + this.country = country; + return this; + } + + /** + * Get country + * @return country + */ + @javax.annotation.Nullable + public ProfileCountry getCountry() { + return country; + } + + public void setCountry(@javax.annotation.Nullable ProfileCountry country) { + this.country = country; + } + + + public Identity ageRange(@javax.annotation.Nullable ProfileAgeRange ageRange) { + this.ageRange = ageRange; + return this; + } + + /** + * Get ageRange + * @return ageRange + */ + @javax.annotation.Nullable + public ProfileAgeRange getAgeRange() { + return ageRange; + } + + public void setAgeRange(@javax.annotation.Nullable ProfileAgeRange ageRange) { + this.ageRange = ageRange; + } + + + public Identity kloutScore(@javax.annotation.Nullable ProfileKloutScore kloutScore) { + this.kloutScore = kloutScore; + return this; + } + + /** + * Get kloutScore + * @return kloutScore + */ + @javax.annotation.Nullable + public ProfileKloutScore getKloutScore() { + return kloutScore; + } + + public void setKloutScore(@javax.annotation.Nullable ProfileKloutScore kloutScore) { + this.kloutScore = kloutScore; + } + + + public Identity suggestions(@javax.annotation.Nullable ProfileSuggestions suggestions) { + this.suggestions = suggestions; + return this; + } + + /** + * Get suggestions + * @return suggestions + */ + @javax.annotation.Nullable + public ProfileSuggestions getSuggestions() { + return suggestions; + } + + public void setSuggestions(@javax.annotation.Nullable ProfileSuggestions suggestions) { + this.suggestions = suggestions; + } + + + public Identity subscription(@javax.annotation.Nullable ProfileSubscription subscription) { + this.subscription = subscription; + return this; + } + + /** + * Get subscription + * @return subscription + */ + @javax.annotation.Nullable + public ProfileSubscription getSubscription() { + return subscription; + } + + public void setSubscription(@javax.annotation.Nullable ProfileSubscription subscription) { + this.subscription = subscription; + } + + + public Identity PIN(@javax.annotation.Nullable ProfilePIN PIN) { + this.PIN = PIN; + return this; + } + + /** + * Get PIN + * @return PIN + */ + @javax.annotation.Nullable + public ProfilePIN getPIN() { + return PIN; + } + + public void setPIN(@javax.annotation.Nullable ProfilePIN PIN) { + this.PIN = PIN; + } + + + public Identity consentProfile(@javax.annotation.Nullable ProfileConsentProfile consentProfile) { + this.consentProfile = consentProfile; + return this; + } + + /** + * Get consentProfile + * @return consentProfile + */ + @javax.annotation.Nullable + public ProfileConsentProfile getConsentProfile() { + return consentProfile; + } + + public void setConsentProfile(@javax.annotation.Nullable ProfileConsentProfile consentProfile) { + this.consentProfile = consentProfile; + } + + + public Identity registrationData(@javax.annotation.Nullable ProfileRegistrationData registrationData) { + this.registrationData = registrationData; + return this; + } + + /** + * Get registrationData + * @return registrationData + */ + @javax.annotation.Nullable + public ProfileRegistrationData getRegistrationData() { + return registrationData; + } + + public void setRegistrationData(@javax.annotation.Nullable ProfileRegistrationData registrationData) { + this.registrationData = registrationData; + } + + + public Identity providerAccessCredential(@javax.annotation.Nullable ProfileProviderAccessCredential providerAccessCredential) { + this.providerAccessCredential = providerAccessCredential; + return this; + } + + /** + * Get providerAccessCredential + * @return providerAccessCredential + */ + @javax.annotation.Nullable + public ProfileProviderAccessCredential getProviderAccessCredential() { + return providerAccessCredential; + } + + public void setProviderAccessCredential(@javax.annotation.Nullable ProfileProviderAccessCredential providerAccessCredential) { + this.providerAccessCredential = providerAccessCredential; + } + + + public Identity customFields(@javax.annotation.Nullable Map<String, String> customFields) { + this.customFields = customFields; + return this; + } + + public Identity putCustomFieldsItem(String key, String customFieldsItem) { + if (this.customFields == null) { + this.customFields = new HashMap<>(); + } + this.customFields.put(key, customFieldsItem); + return this; + } + + /** + * Custom fields associated with the User. + * @return customFields + */ + @javax.annotation.Nullable + public Map<String, String> getCustomFields() { + return customFields; + } + + public void setCustomFields(@javax.annotation.Nullable Map<String, String> customFields) { + this.customFields = customFields; + } + + + public Identity profileImageUrls(@javax.annotation.Nullable Map<String, String> profileImageUrls) { + this.profileImageUrls = profileImageUrls; + return this; + } + + public Identity putProfileImageUrlsItem(String key, String profileImageUrlsItem) { + if (this.profileImageUrls == null) { + this.profileImageUrls = new HashMap<>(); + } + this.profileImageUrls.put(key, profileImageUrlsItem); + return this; + } + + /** + * URLs of the User's profile images. + * @return profileImageUrls + */ + @javax.annotation.Nullable + public Map<String, String> getProfileImageUrls() { + return profileImageUrls; + } + + public void setProfileImageUrls(@javax.annotation.Nullable Map<String, String> profileImageUrls) { + this.profileImageUrls = profileImageUrls; + } + + + public Identity webProfiles(@javax.annotation.Nullable Map<String, String> webProfiles) { + this.webProfiles = webProfiles; + return this; + } + + public Identity putWebProfilesItem(String key, String webProfilesItem) { + if (this.webProfiles == null) { + this.webProfiles = new HashMap<>(); + } + this.webProfiles.put(key, webProfilesItem); + return this; + } + + /** + * The User's web profiles. + * @return webProfiles + */ + @javax.annotation.Nullable + public Map<String, String> getWebProfiles() { + return webProfiles; + } + + public void setWebProfiles(@javax.annotation.Nullable Map<String, String> webProfiles) { + this.webProfiles = webProfiles; + } + + + public Identity roles(@javax.annotation.Nullable List<String> roles) { + this.roles = roles; + return this; + } + + public Identity addRolesItem(String rolesItem) { + if (this.roles == null) { + this.roles = new ArrayList<>(); + } + this.roles.add(rolesItem); + return this; + } + + /** + * Roles assigned to the User. + * @return roles + */ + @javax.annotation.Nullable + public List<String> getRoles() { + return roles; + } + + public void setRoles(@javax.annotation.Nullable List<String> roles) { + this.roles = roles; + } + + + public Identity uid(@javax.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * the unique id which belongs to the Account + * @return uid + */ + @javax.annotation.Nullable + public String getUid() { + return uid; + } + + public void setUid(@javax.annotation.Nullable String uid) { + this.uid = uid; + } + + + public Identity previousUids(@javax.annotation.Nullable List<String> previousUids) { + this.previousUids = previousUids; + return this; + } + + public Identity addPreviousUidsItem(String previousUidsItem) { + if (this.previousUids == null) { + this.previousUids = new ArrayList<>(); + } + this.previousUids.add(previousUidsItem); + return this; + } + + /** + * Previous UIDs associated with the Account. + * @return previousUids + */ + @javax.annotation.Nullable + public List<String> getPreviousUids() { + return previousUids; + } + + public void setPreviousUids(@javax.annotation.Nullable List<String> previousUids) { + this.previousUids = previousUids; + } + + + public Identity interestedIn(@javax.annotation.Nullable List<String> interestedIn) { + this.interestedIn = interestedIn; + return this; + } + + public Identity addInterestedInItem(String interestedInItem) { + if (this.interestedIn == null) { + this.interestedIn = new ArrayList<>(); + } + this.interestedIn.add(interestedInItem); + return this; + } + + /** + * Interests of the User. + * @return interestedIn + */ + @javax.annotation.Nullable + public List<String> getInterestedIn() { + return interestedIn; + } + + public void setInterestedIn(@javax.annotation.Nullable List<String> interestedIn) { + this.interestedIn = interestedIn; + } + + + public Identity externalIds(@javax.annotation.Nullable List<ProfileExternalIdsInner> externalIds) { + this.externalIds = externalIds; + return this; + } + + public Identity addExternalIdsItem(ProfileExternalIdsInner externalIdsItem) { + if (this.externalIds == null) { + this.externalIds = new ArrayList<>(); + } + this.externalIds.add(externalIdsItem); + return this; + } + + /** + * Get externalIds + * @return externalIds + */ + @javax.annotation.Nullable + public List<ProfileExternalIdsInner> getExternalIds() { + return externalIds; + } + + public void setExternalIds(@javax.annotation.Nullable List<ProfileExternalIdsInner> externalIds) { + this.externalIds = externalIds; + } + + + public Identity unverifiedEmail(@javax.annotation.Nullable List<ProfileUnverifiedEmailInner> unverifiedEmail) { + this.unverifiedEmail = unverifiedEmail; + return this; + } + + public Identity addUnverifiedEmailItem(ProfileUnverifiedEmailInner unverifiedEmailItem) { + if (this.unverifiedEmail == null) { + this.unverifiedEmail = new ArrayList<>(); + } + this.unverifiedEmail.add(unverifiedEmailItem); + return this; + } + + /** + * Get unverifiedEmail + * @return unverifiedEmail + */ + @javax.annotation.Nullable + public List<ProfileUnverifiedEmailInner> getUnverifiedEmail() { + return unverifiedEmail; + } + + public void setUnverifiedEmail(@javax.annotation.Nullable List<ProfileUnverifiedEmailInner> unverifiedEmail) { + this.unverifiedEmail = unverifiedEmail; + } + + + public Identity positions(@javax.annotation.Nullable List<ProfilePositionsInner> positions) { + this.positions = positions; + return this; + } + + public Identity addPositionsItem(ProfilePositionsInner positionsItem) { + if (this.positions == null) { + this.positions = new ArrayList<>(); + } + this.positions.add(positionsItem); + return this; + } + + /** + * List of positions held by the User. + * @return positions + */ + @javax.annotation.Nullable + public List<ProfilePositionsInner> getPositions() { + return positions; + } + + public void setPositions(@javax.annotation.Nullable List<ProfilePositionsInner> positions) { + this.positions = positions; + } + + + public Identity educations(@javax.annotation.Nullable List<ProfileEducationsInner> educations) { + this.educations = educations; + return this; + } + + public Identity addEducationsItem(ProfileEducationsInner educationsItem) { + if (this.educations == null) { + this.educations = new ArrayList<>(); + } + this.educations.add(educationsItem); + return this; + } + + /** + * List of educational qualifications of the User. + * @return educations + */ + @javax.annotation.Nullable + public List<ProfileEducationsInner> getEducations() { + return educations; + } + + public void setEducations(@javax.annotation.Nullable List<ProfileEducationsInner> educations) { + this.educations = educations; + } + + + public Identity phoneNumbers(@javax.annotation.Nullable List<ProfilePhoneNumbersInner> phoneNumbers) { + this.phoneNumbers = phoneNumbers; + return this; + } + + public Identity addPhoneNumbersItem(ProfilePhoneNumbersInner phoneNumbersItem) { + if (this.phoneNumbers == null) { + this.phoneNumbers = new ArrayList<>(); + } + this.phoneNumbers.add(phoneNumbersItem); + return this; + } + + /** + * List of Phone numbers associated with the User. + * @return phoneNumbers + */ + @javax.annotation.Nullable + public List<ProfilePhoneNumbersInner> getPhoneNumbers() { + return phoneNumbers; + } + + public void setPhoneNumbers(@javax.annotation.Nullable List<ProfilePhoneNumbersInner> phoneNumbers) { + this.phoneNumbers = phoneNumbers; + } + + + public Identity imAccounts(@javax.annotation.Nullable List<ProfileIMAccountsInner> imAccounts) { + this.imAccounts = imAccounts; + return this; + } + + public Identity addImAccountsItem(ProfileIMAccountsInner imAccountsItem) { + if (this.imAccounts == null) { + this.imAccounts = new ArrayList<>(); + } + this.imAccounts.add(imAccountsItem); + return this; + } + + /** + * List of instant messaging accounts associated with the User. + * @return imAccounts + */ + @javax.annotation.Nullable + public List<ProfileIMAccountsInner> getImAccounts() { + return imAccounts; + } + + public void setImAccounts(@javax.annotation.Nullable List<ProfileIMAccountsInner> imAccounts) { + this.imAccounts = imAccounts; + } + + + public Identity addresses(@javax.annotation.Nullable List<ProfileAddressesInner> addresses) { + this.addresses = addresses; + return this; + } + + public Identity addAddressesItem(ProfileAddressesInner addressesItem) { + if (this.addresses == null) { + this.addresses = new ArrayList<>(); + } + this.addresses.add(addressesItem); + return this; + } + + /** + * List of addresses associated with the User. + * @return addresses + */ + @javax.annotation.Nullable + public List<ProfileAddressesInner> getAddresses() { + return addresses; + } + + public void setAddresses(@javax.annotation.Nullable List<ProfileAddressesInner> addresses) { + this.addresses = addresses; + } + + + public Identity interests(@javax.annotation.Nullable List<ProfileInterestsInner> interests) { + this.interests = interests; + return this; + } + + public Identity addInterestsItem(ProfileInterestsInner interestsItem) { + if (this.interests == null) { + this.interests = new ArrayList<>(); + } + this.interests.add(interestsItem); + return this; + } + + /** + * List of interests of the User. + * @return interests + */ + @javax.annotation.Nullable + public List<ProfileInterestsInner> getInterests() { + return interests; + } + + public void setInterests(@javax.annotation.Nullable List<ProfileInterestsInner> interests) { + this.interests = interests; + } + + + public Identity sports(@javax.annotation.Nullable List<ProfileSportsInner> sports) { + this.sports = sports; + return this; + } + + public Identity addSportsItem(ProfileSportsInner sportsItem) { + if (this.sports == null) { + this.sports = new ArrayList<>(); + } + this.sports.add(sportsItem); + return this; + } + + /** + * List of sports the User is interested in. + * @return sports + */ + @javax.annotation.Nullable + public List<ProfileSportsInner> getSports() { + return sports; + } + + public void setSports(@javax.annotation.Nullable List<ProfileSportsInner> sports) { + this.sports = sports; + } + + + public Identity inspirationalPeople(@javax.annotation.Nullable List<ProfileInspirationalPeopleInner> inspirationalPeople) { + this.inspirationalPeople = inspirationalPeople; + return this; + } + + public Identity addInspirationalPeopleItem(ProfileInspirationalPeopleInner inspirationalPeopleItem) { + if (this.inspirationalPeople == null) { + this.inspirationalPeople = new ArrayList<>(); + } + this.inspirationalPeople.add(inspirationalPeopleItem); + return this; + } + + /** + * List of inspirational people for the User. + * @return inspirationalPeople + */ + @javax.annotation.Nullable + public List<ProfileInspirationalPeopleInner> getInspirationalPeople() { + return inspirationalPeople; + } + + public void setInspirationalPeople(@javax.annotation.Nullable List<ProfileInspirationalPeopleInner> inspirationalPeople) { + this.inspirationalPeople = inspirationalPeople; + } + + + public Identity awards(@javax.annotation.Nullable List<ProfileAwardsInner> awards) { + this.awards = awards; + return this; + } + + public Identity addAwardsItem(ProfileAwardsInner awardsItem) { + if (this.awards == null) { + this.awards = new ArrayList<>(); + } + this.awards.add(awardsItem); + return this; + } + + /** + * List of awards received by the User. + * @return awards + */ + @javax.annotation.Nullable + public List<ProfileAwardsInner> getAwards() { + return awards; + } + + public void setAwards(@javax.annotation.Nullable List<ProfileAwardsInner> awards) { + this.awards = awards; + } + + + public Identity skills(@javax.annotation.Nullable List<ProfileSkillsInner> skills) { + this.skills = skills; + return this; + } + + public Identity addSkillsItem(ProfileSkillsInner skillsItem) { + if (this.skills == null) { + this.skills = new ArrayList<>(); + } + this.skills.add(skillsItem); + return this; + } + + /** + * List of skills possessed by the User. + * @return skills + */ + @javax.annotation.Nullable + public List<ProfileSkillsInner> getSkills() { + return skills; + } + + public void setSkills(@javax.annotation.Nullable List<ProfileSkillsInner> skills) { + this.skills = skills; + } + + + public Identity currentStatus(@javax.annotation.Nullable List<ProfileCurrentStatusInner> currentStatus) { + this.currentStatus = currentStatus; + return this; + } + + public Identity addCurrentStatusItem(ProfileCurrentStatusInner currentStatusItem) { + if (this.currentStatus == null) { + this.currentStatus = new ArrayList<>(); + } + this.currentStatus.add(currentStatusItem); + return this; + } + + /** + * List of current statuses of the User. + * @return currentStatus + */ + @javax.annotation.Nullable + public List<ProfileCurrentStatusInner> getCurrentStatus() { + return currentStatus; + } + + public void setCurrentStatus(@javax.annotation.Nullable List<ProfileCurrentStatusInner> currentStatus) { + this.currentStatus = currentStatus; + } + + + public Identity certifications(@javax.annotation.Nullable List<ProfileCertificationsInner> certifications) { + this.certifications = certifications; + return this; + } + + public Identity addCertificationsItem(ProfileCertificationsInner certificationsItem) { + if (this.certifications == null) { + this.certifications = new ArrayList<>(); + } + this.certifications.add(certificationsItem); + return this; + } + + /** + * List of certifications obtained by the User. + * @return certifications + */ + @javax.annotation.Nullable + public List<ProfileCertificationsInner> getCertifications() { + return certifications; + } + + public void setCertifications(@javax.annotation.Nullable List<ProfileCertificationsInner> certifications) { + this.certifications = certifications; + } + + + public Identity courses(@javax.annotation.Nullable List<ProfileCoursesInner> courses) { + this.courses = courses; + return this; + } + + public Identity addCoursesItem(ProfileCoursesInner coursesItem) { + if (this.courses == null) { + this.courses = new ArrayList<>(); + } + this.courses.add(coursesItem); + return this; + } + + /** + * List of courses completed by the User. + * @return courses + */ + @javax.annotation.Nullable + public List<ProfileCoursesInner> getCourses() { + return courses; + } + + public void setCourses(@javax.annotation.Nullable List<ProfileCoursesInner> courses) { + this.courses = courses; + } + + + public Identity volunteer(@javax.annotation.Nullable List<ProfileVolunteerInner> volunteer) { + this.volunteer = volunteer; + return this; + } + + public Identity addVolunteerItem(ProfileVolunteerInner volunteerItem) { + if (this.volunteer == null) { + this.volunteer = new ArrayList<>(); + } + this.volunteer.add(volunteerItem); + return this; + } + + /** + * List of volunteer activities by the User. + * @return volunteer + */ + @javax.annotation.Nullable + public List<ProfileVolunteerInner> getVolunteer() { + return volunteer; + } + + public void setVolunteer(@javax.annotation.Nullable List<ProfileVolunteerInner> volunteer) { + this.volunteer = volunteer; + } + + + public Identity recommendationsReceived(@javax.annotation.Nullable List<ProfileRecommendationsReceivedInner> recommendationsReceived) { + this.recommendationsReceived = recommendationsReceived; + return this; + } + + public Identity addRecommendationsReceivedItem(ProfileRecommendationsReceivedInner recommendationsReceivedItem) { + if (this.recommendationsReceived == null) { + this.recommendationsReceived = new ArrayList<>(); + } + this.recommendationsReceived.add(recommendationsReceivedItem); + return this; + } + + /** + * List of recommendations received by the User. + * @return recommendationsReceived + */ + @javax.annotation.Nullable + public List<ProfileRecommendationsReceivedInner> getRecommendationsReceived() { + return recommendationsReceived; + } + + public void setRecommendationsReceived(@javax.annotation.Nullable List<ProfileRecommendationsReceivedInner> recommendationsReceived) { + this.recommendationsReceived = recommendationsReceived; + } + + + public Identity languages(@javax.annotation.Nullable List<ProfileLanguagesInner> languages) { + this.languages = languages; + return this; + } + + public Identity addLanguagesItem(ProfileLanguagesInner languagesItem) { + if (this.languages == null) { + this.languages = new ArrayList<>(); + } + this.languages.add(languagesItem); + return this; + } + + /** + * List of languages known by the User. + * @return languages + */ + @javax.annotation.Nullable + public List<ProfileLanguagesInner> getLanguages() { + return languages; + } + + public void setLanguages(@javax.annotation.Nullable List<ProfileLanguagesInner> languages) { + this.languages = languages; + } + + + public Identity projects(@javax.annotation.Nullable List<ProfileProjectsInner> projects) { + this.projects = projects; + return this; + } + + public Identity addProjectsItem(ProfileProjectsInner projectsItem) { + if (this.projects == null) { + this.projects = new ArrayList<>(); + } + this.projects.add(projectsItem); + return this; + } + + /** + * List of projects undertaken by the User. + * @return projects + */ + @javax.annotation.Nullable + public List<ProfileProjectsInner> getProjects() { + return projects; + } + + public void setProjects(@javax.annotation.Nullable List<ProfileProjectsInner> projects) { + this.projects = projects; + } + + + public Identity games(@javax.annotation.Nullable List<ProfileGamesInner> games) { + this.games = games; + return this; + } + + public Identity addGamesItem(ProfileGamesInner gamesItem) { + if (this.games == null) { + this.games = new ArrayList<>(); + } + this.games.add(gamesItem); + return this; + } + + /** + * List of games the User is interested in. + * @return games + */ + @javax.annotation.Nullable + public List<ProfileGamesInner> getGames() { + return games; + } + + public void setGames(@javax.annotation.Nullable List<ProfileGamesInner> games) { + this.games = games; + } + + + public Identity family(@javax.annotation.Nullable List<ProfileFamilyInner> family) { + this.family = family; + return this; + } + + public Identity addFamilyItem(ProfileFamilyInner familyItem) { + if (this.family == null) { + this.family = new ArrayList<>(); + } + this.family.add(familyItem); + return this; + } + + /** + * List of family members of the User. + * @return family + */ + @javax.annotation.Nullable + public List<ProfileFamilyInner> getFamily() { + return family; + } + + public void setFamily(@javax.annotation.Nullable List<ProfileFamilyInner> family) { + this.family = family; + } + + + public Identity televisionShow(@javax.annotation.Nullable List<ProfileTelevisionShowInner> televisionShow) { + this.televisionShow = televisionShow; + return this; + } + + public Identity addTelevisionShowItem(ProfileTelevisionShowInner televisionShowItem) { + if (this.televisionShow == null) { + this.televisionShow = new ArrayList<>(); + } + this.televisionShow.add(televisionShowItem); + return this; + } + + /** + * List of television shows the User is interested in. + * @return televisionShow + */ + @javax.annotation.Nullable + public List<ProfileTelevisionShowInner> getTelevisionShow() { + return televisionShow; + } + + public void setTelevisionShow(@javax.annotation.Nullable List<ProfileTelevisionShowInner> televisionShow) { + this.televisionShow = televisionShow; + } + + + public Identity mutualFriends(@javax.annotation.Nullable List<ProfileMutualFriendsInner> mutualFriends) { + this.mutualFriends = mutualFriends; + return this; + } + + public Identity addMutualFriendsItem(ProfileMutualFriendsInner mutualFriendsItem) { + if (this.mutualFriends == null) { + this.mutualFriends = new ArrayList<>(); + } + this.mutualFriends.add(mutualFriendsItem); + return this; + } + + /** + * List of mutual friends of the User. + * @return mutualFriends + */ + @javax.annotation.Nullable + public List<ProfileMutualFriendsInner> getMutualFriends() { + return mutualFriends; + } + + public void setMutualFriends(@javax.annotation.Nullable List<ProfileMutualFriendsInner> mutualFriends) { + this.mutualFriends = mutualFriends; + } + + + public Identity movies(@javax.annotation.Nullable List<ProfileMoviesInner> movies) { + this.movies = movies; + return this; + } + + public Identity addMoviesItem(ProfileMoviesInner moviesItem) { + if (this.movies == null) { + this.movies = new ArrayList<>(); + } + this.movies.add(moviesItem); + return this; + } + + /** + * List of movies the User is interested in. + * @return movies + */ + @javax.annotation.Nullable + public List<ProfileMoviesInner> getMovies() { + return movies; + } + + public void setMovies(@javax.annotation.Nullable List<ProfileMoviesInner> movies) { + this.movies = movies; + } + + + public Identity books(@javax.annotation.Nullable List<ProfileBooksInner> books) { + this.books = books; + return this; + } + + public Identity addBooksItem(ProfileBooksInner booksItem) { + if (this.books == null) { + this.books = new ArrayList<>(); + } + this.books.add(booksItem); + return this; + } + + /** + * List of books the User is interested in. + * @return books + */ + @javax.annotation.Nullable + public List<ProfileBooksInner> getBooks() { + return books; + } + + public void setBooks(@javax.annotation.Nullable List<ProfileBooksInner> books) { + this.books = books; + } + + + public Identity patents(@javax.annotation.Nullable List<ProfilePatentsInner> patents) { + this.patents = patents; + return this; + } + + public Identity addPatentsItem(ProfilePatentsInner patentsItem) { + if (this.patents == null) { + this.patents = new ArrayList<>(); + } + this.patents.add(patentsItem); + return this; + } + + /** + * List of patents owned by the User. + * @return patents + */ + @javax.annotation.Nullable + public List<ProfilePatentsInner> getPatents() { + return patents; + } + + public void setPatents(@javax.annotation.Nullable List<ProfilePatentsInner> patents) { + this.patents = patents; + } + + + public Identity favoriteThings(@javax.annotation.Nullable List<ProfileFavoriteThingsInner> favoriteThings) { + this.favoriteThings = favoriteThings; + return this; + } + + public Identity addFavoriteThingsItem(ProfileFavoriteThingsInner favoriteThingsItem) { + if (this.favoriteThings == null) { + this.favoriteThings = new ArrayList<>(); + } + this.favoriteThings.add(favoriteThingsItem); + return this; + } + + /** + * List of favorite things of the User. + * @return favoriteThings + */ + @javax.annotation.Nullable + public List<ProfileFavoriteThingsInner> getFavoriteThings() { + return favoriteThings; + } + + public void setFavoriteThings(@javax.annotation.Nullable List<ProfileFavoriteThingsInner> favoriteThings) { + this.favoriteThings = favoriteThings; + } + + + public Identity relatedProfileViews(@javax.annotation.Nullable List<ProfileRelatedProfileViewsInner> relatedProfileViews) { + this.relatedProfileViews = relatedProfileViews; + return this; + } + + public Identity addRelatedProfileViewsItem(ProfileRelatedProfileViewsInner relatedProfileViewsItem) { + if (this.relatedProfileViews == null) { + this.relatedProfileViews = new ArrayList<>(); + } + this.relatedProfileViews.add(relatedProfileViewsItem); + return this; + } + + /** + * List of related profile views of the User. + * @return relatedProfileViews + */ + @javax.annotation.Nullable + public List<ProfileRelatedProfileViewsInner> getRelatedProfileViews() { + return relatedProfileViews; + } + + public void setRelatedProfileViews(@javax.annotation.Nullable List<ProfileRelatedProfileViewsInner> relatedProfileViews) { + this.relatedProfileViews = relatedProfileViews; + } + + + public Identity placesLived(@javax.annotation.Nullable List<ProfilePlacesLivedInner> placesLived) { + this.placesLived = placesLived; + return this; + } + + public Identity addPlacesLivedItem(ProfilePlacesLivedInner placesLivedItem) { + if (this.placesLived == null) { + this.placesLived = new ArrayList<>(); + } + this.placesLived.add(placesLivedItem); + return this; + } + + /** + * List of places the User has lived. + * @return placesLived + */ + @javax.annotation.Nullable + public List<ProfilePlacesLivedInner> getPlacesLived() { + return placesLived; + } + + public void setPlacesLived(@javax.annotation.Nullable List<ProfilePlacesLivedInner> placesLived) { + this.placesLived = placesLived; + } + + + public Identity publications(@javax.annotation.Nullable List<ProfilePublicationsInner> publications) { + this.publications = publications; + return this; + } + + public Identity addPublicationsItem(ProfilePublicationsInner publicationsItem) { + if (this.publications == null) { + this.publications = new ArrayList<>(); + } + this.publications.add(publicationsItem); + return this; + } + + /** + * List of publications by the User. + * @return publications + */ + @javax.annotation.Nullable + public List<ProfilePublicationsInner> getPublications() { + return publications; + } + + public void setPublications(@javax.annotation.Nullable List<ProfilePublicationsInner> publications) { + this.publications = publications; + } + + + public Identity jobBookmarks(@javax.annotation.Nullable List<ProfileJobBookmarksInner> jobBookmarks) { + this.jobBookmarks = jobBookmarks; + return this; + } + + public Identity addJobBookmarksItem(ProfileJobBookmarksInner jobBookmarksItem) { + if (this.jobBookmarks == null) { + this.jobBookmarks = new ArrayList<>(); + } + this.jobBookmarks.add(jobBookmarksItem); + return this; + } + + /** + * List of job bookmarks by the User. + * @return jobBookmarks + */ + @javax.annotation.Nullable + public List<ProfileJobBookmarksInner> getJobBookmarks() { + return jobBookmarks; + } + + public void setJobBookmarks(@javax.annotation.Nullable List<ProfileJobBookmarksInner> jobBookmarks) { + this.jobBookmarks = jobBookmarks; + } + + + public Identity badges(@javax.annotation.Nullable List<ProfileBadgesInner> badges) { + this.badges = badges; + return this; + } + + public Identity addBadgesItem(ProfileBadgesInner badgesItem) { + if (this.badges == null) { + this.badges = new ArrayList<>(); + } + this.badges.add(badgesItem); + return this; + } + + /** + * List of badges earned by the User. + * @return badges + */ + @javax.annotation.Nullable + public List<ProfileBadgesInner> getBadges() { + return badges; + } + + public void setBadges(@javax.annotation.Nullable List<ProfileBadgesInner> badges) { + this.badges = badges; + } + + + public Identity memberUrlResources(@javax.annotation.Nullable List<ProfileMemberUrlResourcesInner> memberUrlResources) { + this.memberUrlResources = memberUrlResources; + return this; + } + + public Identity addMemberUrlResourcesItem(ProfileMemberUrlResourcesInner memberUrlResourcesItem) { + if (this.memberUrlResources == null) { + this.memberUrlResources = new ArrayList<>(); + } + this.memberUrlResources.add(memberUrlResourcesItem); + return this; + } + + /** + * List of member URL resources. + * @return memberUrlResources + */ + @javax.annotation.Nullable + public List<ProfileMemberUrlResourcesInner> getMemberUrlResources() { + return memberUrlResources; + } + + public void setMemberUrlResources(@javax.annotation.Nullable List<ProfileMemberUrlResourcesInner> memberUrlResources) { + this.memberUrlResources = memberUrlResources; + } + + + public Identity organizations(@javax.annotation.Nullable List<ProfileOrganizationsInner> organizations) { + this.organizations = organizations; + return this; + } + + public Identity addOrganizationsItem(ProfileOrganizationsInner organizationsItem) { + if (this.organizations == null) { + this.organizations = new ArrayList<>(); + } + this.organizations.add(organizationsItem); + return this; + } + + /** + * List of organizations associated with the User. + * @return organizations + */ + @javax.annotation.Nullable + public List<ProfileOrganizationsInner> getOrganizations() { + return organizations; + } + + public void setOrganizations(@javax.annotation.Nullable List<ProfileOrganizationsInner> organizations) { + this.organizations = organizations; + } + + + public Identity objectId(@javax.annotation.Nullable String objectId) { + this.objectId = objectId; + return this; + } + + /** + * The object ID of the User. + * @return objectId + */ + @javax.annotation.Nullable + public String getObjectId() { + return objectId; + } + + public void setObjectId(@javax.annotation.Nullable String objectId) { + this.objectId = objectId; + } + + + public Identity email(@javax.annotation.Nullable List<ProfileEmailInner> email) { + this.email = email; + return this; + } + + public Identity addEmailItem(ProfileEmailInner emailItem) { + if (this.email == null) { + this.email = new ArrayList<>(); + } + this.email.add(emailItem); + return this; + } + + /** + * List of Email addresses associated with the User. + * @return email + */ + @javax.annotation.Nullable + public List<ProfileEmailInner> getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable List<ProfileEmailInner> email) { + this.email = email; + } + + + public Identity passkeyLogin(@javax.annotation.Nullable IdentityPasskeyLogin passkeyLogin) { + this.passkeyLogin = passkeyLogin; + return this; + } + + /** + * Get passkeyLogin + * @return passkeyLogin + */ + @javax.annotation.Nullable + public IdentityPasskeyLogin getPasskeyLogin() { + return passkeyLogin; + } + + public void setPasskeyLogin(@javax.annotation.Nullable IdentityPasskeyLogin passkeyLogin) { + this.passkeyLogin = passkeyLogin; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Identity instance itself + */ + public Identity putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Identity identity = (Identity) o; + return Objects.equals(this.isPasswordBreached, identity.isPasswordBreached) && + Objects.equals(this.isActive, identity.isActive) && + Objects.equals(this.isDeleted, identity.isDeleted) && + Objects.equals(this.emailVerified, identity.emailVerified) && + Objects.equals(this.isLoginLocked, identity.isLoginLocked) && + Objects.equals(this.isRequiredFieldsFilledOnce, identity.isRequiredFieldsFilledOnce) && + Objects.equals(this.firstLogin, identity.firstLogin) && + Objects.equals(this.isProtected, identity.isProtected) && + Objects.equals(this.hireable, identity.hireable) && + Objects.equals(this.isSecurePassword, identity.isSecurePassword) && + Objects.equals(this.isCustomUid, identity.isCustomUid) && + Objects.equals(this.phoneIdVerified, identity.phoneIdVerified) && + Objects.equals(this.isEmailSubscribed, identity.isEmailSubscribed) && + Objects.equals(this.noOfLogins, identity.noOfLogins) && + Objects.equals(this.followersCount, identity.followersCount) && + Objects.equals(this.friendsCount, identity.friendsCount) && + Objects.equals(this.totalStatusesCount, identity.totalStatusesCount) && + Objects.equals(this.numRecommenders, identity.numRecommenders) && + Objects.equals(this.totalPrivateRepository, identity.totalPrivateRepository) && + Objects.equals(this.publicGists, identity.publicGists) && + Objects.equals(this.privateGists, identity.privateGists) && + Objects.equals(this.pinsCount, identity.pinsCount) && + Objects.equals(this.boardsCount, identity.boardsCount) && + Objects.equals(this.likesCount, identity.likesCount) && + Objects.equals(this.ID, identity.ID) && + Objects.equals(this.provider, identity.provider) && + Objects.equals(this.fullName, identity.fullName) && + Objects.equals(this.firstName, identity.firstName) && + Objects.equals(this.lastName, identity.lastName) && + Objects.equals(this.phoneId, identity.phoneId) && + Objects.equals(this.userName, identity.userName) && + Objects.equals(this.prefix, identity.prefix) && + Objects.equals(this.middleName, identity.middleName) && + Objects.equals(this.suffix, identity.suffix) && + Objects.equals(this.nickName, identity.nickName) && + Objects.equals(this.profileName, identity.profileName) && + Objects.equals(this.birthDate, identity.birthDate) && + Objects.equals(this.gender, identity.gender) && + Objects.equals(this.website, identity.website) && + Objects.equals(this.thumbnailImageUrl, identity.thumbnailImageUrl) && + Objects.equals(this.imageUrl, identity.imageUrl) && + Objects.equals(this.favicon, identity.favicon) && + Objects.equals(this.profileUrl, identity.profileUrl) && + Objects.equals(this.homeTown, identity.homeTown) && + Objects.equals(this.state, identity.state) && + Objects.equals(this.city, identity.city) && + Objects.equals(this.industry, identity.industry) && + Objects.equals(this.about, identity.about) && + Objects.equals(this.timeZone, identity.timeZone) && + Objects.equals(this.localLanguage, identity.localLanguage) && + Objects.equals(this.coverPhoto, identity.coverPhoto) && + Objects.equals(this.tagLine, identity.tagLine) && + Objects.equals(this.language, identity.language) && + Objects.equals(this.verified, identity.verified) && + Objects.equals(this.updatedTime, identity.updatedTime) && + Objects.equals(this.isGeoEnabled, identity.isGeoEnabled) && + Objects.equals(this.associations, identity.associations) && + Objects.equals(this.honors, identity.honors) && + Objects.equals(this.httpsImageUrl, identity.httpsImageUrl) && + Objects.equals(this.mainAddress, identity.mainAddress) && + Objects.equals(this.created, identity.created) && + Objects.equals(this.localCity, identity.localCity) && + Objects.equals(this.profileCity, identity.profileCity) && + Objects.equals(this.localCountry, identity.localCountry) && + Objects.equals(this.profileCountry, identity.profileCountry) && + Objects.equals(this.relationshipStatus, identity.relationshipStatus) && + Objects.equals(this.quota, identity.quota) && + Objects.equals(this.quote, identity.quote) && + Objects.equals(this.religion, identity.religion) && + Objects.equals(this.political, identity.political) && + Objects.equals(this.publicRepository, identity.publicRepository) && + Objects.equals(this.repositoryUrl, identity.repositoryUrl) && + Objects.equals(this.age, identity.age) && + Objects.equals(this.professionalHeadline, identity.professionalHeadline) && + Objects.equals(this.lrUserID, identity.lrUserID) && + Objects.equals(this.currency, identity.currency) && + Objects.equals(this.starredUrl, identity.starredUrl) && + Objects.equals(this.gistsUrl, identity.gistsUrl) && + Objects.equals(this.company, identity.company) && + Objects.equals(this.gravatarImageUrl, identity.gravatarImageUrl) && + Objects.equals(this.lastPasswordChangeDate, identity.lastPasswordChangeDate) && + Objects.equals(this.passwordExpirationDate, identity.passwordExpirationDate) && + Objects.equals(this.createdDate, identity.createdDate) && + Objects.equals(this.modifiedDate, identity.modifiedDate) && + Objects.equals(this.profileModifiedDate, identity.profileModifiedDate) && + Objects.equals(this.lastLoginDate, identity.lastLoginDate) && + Objects.equals(this.signupDate, identity.signupDate) && + Objects.equals(this.privacyPolicy, identity.privacyPolicy) && + Objects.equals(this.country, identity.country) && + Objects.equals(this.ageRange, identity.ageRange) && + Objects.equals(this.kloutScore, identity.kloutScore) && + Objects.equals(this.suggestions, identity.suggestions) && + Objects.equals(this.subscription, identity.subscription) && + Objects.equals(this.PIN, identity.PIN) && + Objects.equals(this.consentProfile, identity.consentProfile) && + Objects.equals(this.registrationData, identity.registrationData) && + Objects.equals(this.providerAccessCredential, identity.providerAccessCredential) && + Objects.equals(this.customFields, identity.customFields) && + Objects.equals(this.profileImageUrls, identity.profileImageUrls) && + Objects.equals(this.webProfiles, identity.webProfiles) && + Objects.equals(this.roles, identity.roles) && + Objects.equals(this.uid, identity.uid) && + Objects.equals(this.previousUids, identity.previousUids) && + Objects.equals(this.interestedIn, identity.interestedIn) && + Objects.equals(this.externalIds, identity.externalIds) && + Objects.equals(this.unverifiedEmail, identity.unverifiedEmail) && + Objects.equals(this.positions, identity.positions) && + Objects.equals(this.educations, identity.educations) && + Objects.equals(this.phoneNumbers, identity.phoneNumbers) && + Objects.equals(this.imAccounts, identity.imAccounts) && + Objects.equals(this.addresses, identity.addresses) && + Objects.equals(this.interests, identity.interests) && + Objects.equals(this.sports, identity.sports) && + Objects.equals(this.inspirationalPeople, identity.inspirationalPeople) && + Objects.equals(this.awards, identity.awards) && + Objects.equals(this.skills, identity.skills) && + Objects.equals(this.currentStatus, identity.currentStatus) && + Objects.equals(this.certifications, identity.certifications) && + Objects.equals(this.courses, identity.courses) && + Objects.equals(this.volunteer, identity.volunteer) && + Objects.equals(this.recommendationsReceived, identity.recommendationsReceived) && + Objects.equals(this.languages, identity.languages) && + Objects.equals(this.projects, identity.projects) && + Objects.equals(this.games, identity.games) && + Objects.equals(this.family, identity.family) && + Objects.equals(this.televisionShow, identity.televisionShow) && + Objects.equals(this.mutualFriends, identity.mutualFriends) && + Objects.equals(this.movies, identity.movies) && + Objects.equals(this.books, identity.books) && + Objects.equals(this.patents, identity.patents) && + Objects.equals(this.favoriteThings, identity.favoriteThings) && + Objects.equals(this.relatedProfileViews, identity.relatedProfileViews) && + Objects.equals(this.placesLived, identity.placesLived) && + Objects.equals(this.publications, identity.publications) && + Objects.equals(this.jobBookmarks, identity.jobBookmarks) && + Objects.equals(this.badges, identity.badges) && + Objects.equals(this.memberUrlResources, identity.memberUrlResources) && + Objects.equals(this.organizations, identity.organizations) && + Objects.equals(this.objectId, identity.objectId) && + Objects.equals(this.email, identity.email) && + Objects.equals(this.passkeyLogin, identity.passkeyLogin)&& + Objects.equals(this.additionalProperties, identity.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(isPasswordBreached, isActive, isDeleted, emailVerified, isLoginLocked, isRequiredFieldsFilledOnce, firstLogin, isProtected, hireable, isSecurePassword, isCustomUid, phoneIdVerified, isEmailSubscribed, noOfLogins, followersCount, friendsCount, totalStatusesCount, numRecommenders, totalPrivateRepository, publicGists, privateGists, pinsCount, boardsCount, likesCount, ID, provider, fullName, firstName, lastName, phoneId, userName, prefix, middleName, suffix, nickName, profileName, birthDate, gender, website, thumbnailImageUrl, imageUrl, favicon, profileUrl, homeTown, state, city, industry, about, timeZone, localLanguage, coverPhoto, tagLine, language, verified, updatedTime, isGeoEnabled, associations, honors, httpsImageUrl, mainAddress, created, localCity, profileCity, localCountry, profileCountry, relationshipStatus, quota, quote, religion, political, publicRepository, repositoryUrl, age, professionalHeadline, lrUserID, currency, starredUrl, gistsUrl, company, gravatarImageUrl, lastPasswordChangeDate, passwordExpirationDate, createdDate, modifiedDate, profileModifiedDate, lastLoginDate, signupDate, privacyPolicy, country, ageRange, kloutScore, suggestions, subscription, PIN, consentProfile, registrationData, providerAccessCredential, customFields, profileImageUrls, webProfiles, roles, uid, previousUids, interestedIn, externalIds, unverifiedEmail, positions, educations, phoneNumbers, imAccounts, addresses, interests, sports, inspirationalPeople, awards, skills, currentStatus, certifications, courses, volunteer, recommendationsReceived, languages, projects, games, family, televisionShow, mutualFriends, movies, books, patents, favoriteThings, relatedProfileViews, placesLived, publications, jobBookmarks, badges, memberUrlResources, organizations, objectId, email, passkeyLogin, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Identity {\n"); + sb.append(" isPasswordBreached: ").append(toIndentedString(isPasswordBreached)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" isDeleted: ").append(toIndentedString(isDeleted)).append("\n"); + sb.append(" emailVerified: ").append(toIndentedString(emailVerified)).append("\n"); + sb.append(" isLoginLocked: ").append(toIndentedString(isLoginLocked)).append("\n"); + sb.append(" isRequiredFieldsFilledOnce: ").append(toIndentedString(isRequiredFieldsFilledOnce)).append("\n"); + sb.append(" firstLogin: ").append(toIndentedString(firstLogin)).append("\n"); + sb.append(" isProtected: ").append(toIndentedString(isProtected)).append("\n"); + sb.append(" hireable: ").append(toIndentedString(hireable)).append("\n"); + sb.append(" isSecurePassword: ").append(toIndentedString(isSecurePassword)).append("\n"); + sb.append(" isCustomUid: ").append(toIndentedString(isCustomUid)).append("\n"); + sb.append(" phoneIdVerified: ").append(toIndentedString(phoneIdVerified)).append("\n"); + sb.append(" isEmailSubscribed: ").append(toIndentedString(isEmailSubscribed)).append("\n"); + sb.append(" noOfLogins: ").append(toIndentedString(noOfLogins)).append("\n"); + sb.append(" followersCount: ").append(toIndentedString(followersCount)).append("\n"); + sb.append(" friendsCount: ").append(toIndentedString(friendsCount)).append("\n"); + sb.append(" totalStatusesCount: ").append(toIndentedString(totalStatusesCount)).append("\n"); + sb.append(" numRecommenders: ").append(toIndentedString(numRecommenders)).append("\n"); + sb.append(" totalPrivateRepository: ").append(toIndentedString(totalPrivateRepository)).append("\n"); + sb.append(" publicGists: ").append(toIndentedString(publicGists)).append("\n"); + sb.append(" privateGists: ").append(toIndentedString(privateGists)).append("\n"); + sb.append(" pinsCount: ").append(toIndentedString(pinsCount)).append("\n"); + sb.append(" boardsCount: ").append(toIndentedString(boardsCount)).append("\n"); + sb.append(" likesCount: ").append(toIndentedString(likesCount)).append("\n"); + sb.append(" ID: ").append(toIndentedString(ID)).append("\n"); + sb.append(" provider: ").append(toIndentedString(provider)).append("\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" phoneId: ").append(toIndentedString(phoneId)).append("\n"); + sb.append(" userName: ").append(toIndentedString(userName)).append("\n"); + sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n"); + sb.append(" middleName: ").append(toIndentedString(middleName)).append("\n"); + sb.append(" suffix: ").append(toIndentedString(suffix)).append("\n"); + sb.append(" nickName: ").append(toIndentedString(nickName)).append("\n"); + sb.append(" profileName: ").append(toIndentedString(profileName)).append("\n"); + sb.append(" birthDate: ").append(toIndentedString(birthDate)).append("\n"); + sb.append(" gender: ").append(toIndentedString(gender)).append("\n"); + sb.append(" website: ").append(toIndentedString(website)).append("\n"); + sb.append(" thumbnailImageUrl: ").append(toIndentedString(thumbnailImageUrl)).append("\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append(" favicon: ").append(toIndentedString(favicon)).append("\n"); + sb.append(" profileUrl: ").append(toIndentedString(profileUrl)).append("\n"); + sb.append(" homeTown: ").append(toIndentedString(homeTown)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" industry: ").append(toIndentedString(industry)).append("\n"); + sb.append(" about: ").append(toIndentedString(about)).append("\n"); + sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); + sb.append(" localLanguage: ").append(toIndentedString(localLanguage)).append("\n"); + sb.append(" coverPhoto: ").append(toIndentedString(coverPhoto)).append("\n"); + sb.append(" tagLine: ").append(toIndentedString(tagLine)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" verified: ").append(toIndentedString(verified)).append("\n"); + sb.append(" updatedTime: ").append(toIndentedString(updatedTime)).append("\n"); + sb.append(" isGeoEnabled: ").append(toIndentedString(isGeoEnabled)).append("\n"); + sb.append(" associations: ").append(toIndentedString(associations)).append("\n"); + sb.append(" honors: ").append(toIndentedString(honors)).append("\n"); + sb.append(" httpsImageUrl: ").append(toIndentedString(httpsImageUrl)).append("\n"); + sb.append(" mainAddress: ").append(toIndentedString(mainAddress)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" localCity: ").append(toIndentedString(localCity)).append("\n"); + sb.append(" profileCity: ").append(toIndentedString(profileCity)).append("\n"); + sb.append(" localCountry: ").append(toIndentedString(localCountry)).append("\n"); + sb.append(" profileCountry: ").append(toIndentedString(profileCountry)).append("\n"); + sb.append(" relationshipStatus: ").append(toIndentedString(relationshipStatus)).append("\n"); + sb.append(" quota: ").append(toIndentedString(quota)).append("\n"); + sb.append(" quote: ").append(toIndentedString(quote)).append("\n"); + sb.append(" religion: ").append(toIndentedString(religion)).append("\n"); + sb.append(" political: ").append(toIndentedString(political)).append("\n"); + sb.append(" publicRepository: ").append(toIndentedString(publicRepository)).append("\n"); + sb.append(" repositoryUrl: ").append(toIndentedString(repositoryUrl)).append("\n"); + sb.append(" age: ").append(toIndentedString(age)).append("\n"); + sb.append(" professionalHeadline: ").append(toIndentedString(professionalHeadline)).append("\n"); + sb.append(" lrUserID: ").append(toIndentedString(lrUserID)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" starredUrl: ").append(toIndentedString(starredUrl)).append("\n"); + sb.append(" gistsUrl: ").append(toIndentedString(gistsUrl)).append("\n"); + sb.append(" company: ").append(toIndentedString(company)).append("\n"); + sb.append(" gravatarImageUrl: ").append(toIndentedString(gravatarImageUrl)).append("\n"); + sb.append(" lastPasswordChangeDate: ").append(toIndentedString(lastPasswordChangeDate)).append("\n"); + sb.append(" passwordExpirationDate: ").append(toIndentedString(passwordExpirationDate)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" modifiedDate: ").append(toIndentedString(modifiedDate)).append("\n"); + sb.append(" profileModifiedDate: ").append(toIndentedString(profileModifiedDate)).append("\n"); + sb.append(" lastLoginDate: ").append(toIndentedString(lastLoginDate)).append("\n"); + sb.append(" signupDate: ").append(toIndentedString(signupDate)).append("\n"); + sb.append(" privacyPolicy: ").append(toIndentedString(privacyPolicy)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" ageRange: ").append(toIndentedString(ageRange)).append("\n"); + sb.append(" kloutScore: ").append(toIndentedString(kloutScore)).append("\n"); + sb.append(" suggestions: ").append(toIndentedString(suggestions)).append("\n"); + sb.append(" subscription: ").append(toIndentedString(subscription)).append("\n"); + sb.append(" PIN: ").append(toIndentedString(PIN)).append("\n"); + sb.append(" consentProfile: ").append(toIndentedString(consentProfile)).append("\n"); + sb.append(" registrationData: ").append(toIndentedString(registrationData)).append("\n"); + sb.append(" providerAccessCredential: ").append(toIndentedString(providerAccessCredential)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" profileImageUrls: ").append(toIndentedString(profileImageUrls)).append("\n"); + sb.append(" webProfiles: ").append(toIndentedString(webProfiles)).append("\n"); + sb.append(" roles: ").append(toIndentedString(roles)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" previousUids: ").append(toIndentedString(previousUids)).append("\n"); + sb.append(" interestedIn: ").append(toIndentedString(interestedIn)).append("\n"); + sb.append(" externalIds: ").append(toIndentedString(externalIds)).append("\n"); + sb.append(" unverifiedEmail: ").append(toIndentedString(unverifiedEmail)).append("\n"); + sb.append(" positions: ").append(toIndentedString(positions)).append("\n"); + sb.append(" educations: ").append(toIndentedString(educations)).append("\n"); + sb.append(" phoneNumbers: ").append(toIndentedString(phoneNumbers)).append("\n"); + sb.append(" imAccounts: ").append(toIndentedString(imAccounts)).append("\n"); + sb.append(" addresses: ").append(toIndentedString(addresses)).append("\n"); + sb.append(" interests: ").append(toIndentedString(interests)).append("\n"); + sb.append(" sports: ").append(toIndentedString(sports)).append("\n"); + sb.append(" inspirationalPeople: ").append(toIndentedString(inspirationalPeople)).append("\n"); + sb.append(" awards: ").append(toIndentedString(awards)).append("\n"); + sb.append(" skills: ").append(toIndentedString(skills)).append("\n"); + sb.append(" currentStatus: ").append(toIndentedString(currentStatus)).append("\n"); + sb.append(" certifications: ").append(toIndentedString(certifications)).append("\n"); + sb.append(" courses: ").append(toIndentedString(courses)).append("\n"); + sb.append(" volunteer: ").append(toIndentedString(volunteer)).append("\n"); + sb.append(" recommendationsReceived: ").append(toIndentedString(recommendationsReceived)).append("\n"); + sb.append(" languages: ").append(toIndentedString(languages)).append("\n"); + sb.append(" projects: ").append(toIndentedString(projects)).append("\n"); + sb.append(" games: ").append(toIndentedString(games)).append("\n"); + sb.append(" family: ").append(toIndentedString(family)).append("\n"); + sb.append(" televisionShow: ").append(toIndentedString(televisionShow)).append("\n"); + sb.append(" mutualFriends: ").append(toIndentedString(mutualFriends)).append("\n"); + sb.append(" movies: ").append(toIndentedString(movies)).append("\n"); + sb.append(" books: ").append(toIndentedString(books)).append("\n"); + sb.append(" patents: ").append(toIndentedString(patents)).append("\n"); + sb.append(" favoriteThings: ").append(toIndentedString(favoriteThings)).append("\n"); + sb.append(" relatedProfileViews: ").append(toIndentedString(relatedProfileViews)).append("\n"); + sb.append(" placesLived: ").append(toIndentedString(placesLived)).append("\n"); + sb.append(" publications: ").append(toIndentedString(publications)).append("\n"); + sb.append(" jobBookmarks: ").append(toIndentedString(jobBookmarks)).append("\n"); + sb.append(" badges: ").append(toIndentedString(badges)).append("\n"); + sb.append(" memberUrlResources: ").append(toIndentedString(memberUrlResources)).append("\n"); + sb.append(" organizations: ").append(toIndentedString(organizations)).append("\n"); + sb.append(" objectId: ").append(toIndentedString(objectId)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" passkeyLogin: ").append(toIndentedString(passkeyLogin)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsPasswordBreached"); + openapiFields.add("IsActive"); + openapiFields.add("IsDeleted"); + openapiFields.add("EmailVerified"); + openapiFields.add("IsLoginLocked"); + openapiFields.add("IsRequiredFieldsFilledOnce"); + openapiFields.add("FirstLogin"); + openapiFields.add("IsProtected"); + openapiFields.add("Hireable"); + openapiFields.add("IsSecurePassword"); + openapiFields.add("IsCustomUid"); + openapiFields.add("PhoneIdVerified"); + openapiFields.add("IsEmailSubscribed"); + openapiFields.add("NoOfLogins"); + openapiFields.add("FollowersCount"); + openapiFields.add("FriendsCount"); + openapiFields.add("TotalStatusesCount"); + openapiFields.add("NumRecommenders"); + openapiFields.add("TotalPrivateRepository"); + openapiFields.add("PublicGists"); + openapiFields.add("PrivateGists"); + openapiFields.add("PinsCount"); + openapiFields.add("BoardsCount"); + openapiFields.add("LikesCount"); + openapiFields.add("ID"); + openapiFields.add("Provider"); + openapiFields.add("FullName"); + openapiFields.add("FirstName"); + openapiFields.add("LastName"); + openapiFields.add("PhoneId"); + openapiFields.add("UserName"); + openapiFields.add("Prefix"); + openapiFields.add("MiddleName"); + openapiFields.add("Suffix"); + openapiFields.add("NickName"); + openapiFields.add("ProfileName"); + openapiFields.add("BirthDate"); + openapiFields.add("Gender"); + openapiFields.add("Website"); + openapiFields.add("ThumbnailImageUrl"); + openapiFields.add("ImageUrl"); + openapiFields.add("Favicon"); + openapiFields.add("ProfileUrl"); + openapiFields.add("HomeTown"); + openapiFields.add("State"); + openapiFields.add("City"); + openapiFields.add("Industry"); + openapiFields.add("About"); + openapiFields.add("TimeZone"); + openapiFields.add("LocalLanguage"); + openapiFields.add("CoverPhoto"); + openapiFields.add("TagLine"); + openapiFields.add("Language"); + openapiFields.add("Verified"); + openapiFields.add("UpdatedTime"); + openapiFields.add("IsGeoEnabled"); + openapiFields.add("Associations"); + openapiFields.add("Honors"); + openapiFields.add("HttpsImageUrl"); + openapiFields.add("MainAddress"); + openapiFields.add("Created"); + openapiFields.add("LocalCity"); + openapiFields.add("ProfileCity"); + openapiFields.add("LocalCountry"); + openapiFields.add("ProfileCountry"); + openapiFields.add("RelationshipStatus"); + openapiFields.add("Quota"); + openapiFields.add("Quote"); + openapiFields.add("Religion"); + openapiFields.add("Political"); + openapiFields.add("PublicRepository"); + openapiFields.add("RepositoryUrl"); + openapiFields.add("Age"); + openapiFields.add("ProfessionalHeadline"); + openapiFields.add("LRUserID"); + openapiFields.add("Currency"); + openapiFields.add("StarredUrl"); + openapiFields.add("GistsUrl"); + openapiFields.add("Company"); + openapiFields.add("GravatarImageUrl"); + openapiFields.add("LastPasswordChangeDate"); + openapiFields.add("PasswordExpirationDate"); + openapiFields.add("CreatedDate"); + openapiFields.add("ModifiedDate"); + openapiFields.add("ProfileModifiedDate"); + openapiFields.add("LastLoginDate"); + openapiFields.add("SignupDate"); + openapiFields.add("PrivacyPolicy"); + openapiFields.add("Country"); + openapiFields.add("AgeRange"); + openapiFields.add("KloutScore"); + openapiFields.add("Suggestions"); + openapiFields.add("Subscription"); + openapiFields.add("PIN"); + openapiFields.add("ConsentProfile"); + openapiFields.add("RegistrationData"); + openapiFields.add("ProviderAccessCredential"); + openapiFields.add("CustomFields"); + openapiFields.add("ProfileImageUrls"); + openapiFields.add("WebProfiles"); + openapiFields.add("Roles"); + openapiFields.add("Uid"); + openapiFields.add("PreviousUids"); + openapiFields.add("InterestedIn"); + openapiFields.add("ExternalIds"); + openapiFields.add("UnverifiedEmail"); + openapiFields.add("Positions"); + openapiFields.add("Educations"); + openapiFields.add("PhoneNumbers"); + openapiFields.add("IMAccounts"); + openapiFields.add("Addresses"); + openapiFields.add("Interests"); + openapiFields.add("Sports"); + openapiFields.add("InspirationalPeople"); + openapiFields.add("Awards"); + openapiFields.add("Skills"); + openapiFields.add("CurrentStatus"); + openapiFields.add("Certifications"); + openapiFields.add("Courses"); + openapiFields.add("Volunteer"); + openapiFields.add("RecommendationsReceived"); + openapiFields.add("Languages"); + openapiFields.add("Projects"); + openapiFields.add("Games"); + openapiFields.add("Family"); + openapiFields.add("TelevisionShow"); + openapiFields.add("MutualFriends"); + openapiFields.add("Movies"); + openapiFields.add("Books"); + openapiFields.add("Patents"); + openapiFields.add("FavoriteThings"); + openapiFields.add("RelatedProfileViews"); + openapiFields.add("PlacesLived"); + openapiFields.add("Publications"); + openapiFields.add("JobBookmarks"); + openapiFields.add("Badges"); + openapiFields.add("MemberUrlResources"); + openapiFields.add("Organizations"); + openapiFields.add("ObjectId"); + openapiFields.add("Email"); + openapiFields.add("PasskeyLogin"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 Identity + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Identity.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Identity is not found in the empty JSON string", Identity.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonNull()) && !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("Provider") != null && !jsonObj.get("Provider").isJsonNull()) && !jsonObj.get("Provider").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Provider` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Provider").toString())); + } + if ((jsonObj.get("FullName") != null && !jsonObj.get("FullName").isJsonNull()) && !jsonObj.get("FullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FullName").toString())); + } + if ((jsonObj.get("FirstName") != null && !jsonObj.get("FirstName").isJsonNull()) && !jsonObj.get("FirstName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FirstName").toString())); + } + if ((jsonObj.get("LastName") != null && !jsonObj.get("LastName").isJsonNull()) && !jsonObj.get("LastName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastName").toString())); + } + if ((jsonObj.get("PhoneId") != null && !jsonObj.get("PhoneId").isJsonNull()) && !jsonObj.get("PhoneId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PhoneId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PhoneId").toString())); + } + if ((jsonObj.get("UserName") != null && !jsonObj.get("UserName").isJsonNull()) && !jsonObj.get("UserName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UserName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UserName").toString())); + } + if ((jsonObj.get("Prefix") != null && !jsonObj.get("Prefix").isJsonNull()) && !jsonObj.get("Prefix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Prefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Prefix").toString())); + } + if ((jsonObj.get("MiddleName") != null && !jsonObj.get("MiddleName").isJsonNull()) && !jsonObj.get("MiddleName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MiddleName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MiddleName").toString())); + } + if ((jsonObj.get("Suffix") != null && !jsonObj.get("Suffix").isJsonNull()) && !jsonObj.get("Suffix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Suffix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Suffix").toString())); + } + if ((jsonObj.get("NickName") != null && !jsonObj.get("NickName").isJsonNull()) && !jsonObj.get("NickName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NickName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NickName").toString())); + } + if ((jsonObj.get("ProfileName") != null && !jsonObj.get("ProfileName").isJsonNull()) && !jsonObj.get("ProfileName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileName").toString())); + } + if ((jsonObj.get("BirthDate") != null && !jsonObj.get("BirthDate").isJsonNull()) && !jsonObj.get("BirthDate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `BirthDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BirthDate").toString())); + } + if ((jsonObj.get("Gender") != null && !jsonObj.get("Gender").isJsonNull()) && !jsonObj.get("Gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Gender").toString())); + } + if ((jsonObj.get("Website") != null && !jsonObj.get("Website").isJsonNull()) && !jsonObj.get("Website").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Website` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Website").toString())); + } + if ((jsonObj.get("ThumbnailImageUrl") != null && !jsonObj.get("ThumbnailImageUrl").isJsonNull()) && !jsonObj.get("ThumbnailImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ThumbnailImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ThumbnailImageUrl").toString())); + } + if ((jsonObj.get("ImageUrl") != null && !jsonObj.get("ImageUrl").isJsonNull()) && !jsonObj.get("ImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ImageUrl").toString())); + } + if ((jsonObj.get("Favicon") != null && !jsonObj.get("Favicon").isJsonNull()) && !jsonObj.get("Favicon").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Favicon` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Favicon").toString())); + } + if ((jsonObj.get("ProfileUrl") != null && !jsonObj.get("ProfileUrl").isJsonNull()) && !jsonObj.get("ProfileUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileUrl").toString())); + } + if ((jsonObj.get("HomeTown") != null && !jsonObj.get("HomeTown").isJsonNull()) && !jsonObj.get("HomeTown").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HomeTown` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HomeTown").toString())); + } + if ((jsonObj.get("State") != null && !jsonObj.get("State").isJsonNull()) && !jsonObj.get("State").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `State` to be a primitive type in the JSON string but got `%s`", jsonObj.get("State").toString())); + } + if ((jsonObj.get("City") != null && !jsonObj.get("City").isJsonNull()) && !jsonObj.get("City").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `City` to be a primitive type in the JSON string but got `%s`", jsonObj.get("City").toString())); + } + if ((jsonObj.get("Industry") != null && !jsonObj.get("Industry").isJsonNull()) && !jsonObj.get("Industry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Industry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Industry").toString())); + } + if ((jsonObj.get("About") != null && !jsonObj.get("About").isJsonNull()) && !jsonObj.get("About").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `About` to be a primitive type in the JSON string but got `%s`", jsonObj.get("About").toString())); + } + if ((jsonObj.get("TimeZone") != null && !jsonObj.get("TimeZone").isJsonNull()) && !jsonObj.get("TimeZone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TimeZone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TimeZone").toString())); + } + if ((jsonObj.get("LocalLanguage") != null && !jsonObj.get("LocalLanguage").isJsonNull()) && !jsonObj.get("LocalLanguage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalLanguage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalLanguage").toString())); + } + if ((jsonObj.get("CoverPhoto") != null && !jsonObj.get("CoverPhoto").isJsonNull()) && !jsonObj.get("CoverPhoto").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CoverPhoto` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CoverPhoto").toString())); + } + if ((jsonObj.get("TagLine") != null && !jsonObj.get("TagLine").isJsonNull()) && !jsonObj.get("TagLine").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TagLine` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TagLine").toString())); + } + if ((jsonObj.get("Language") != null && !jsonObj.get("Language").isJsonNull()) && !jsonObj.get("Language").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Language` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Language").toString())); + } + if ((jsonObj.get("Verified") != null && !jsonObj.get("Verified").isJsonNull()) && !jsonObj.get("Verified").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Verified` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Verified").toString())); + } + if ((jsonObj.get("UpdatedTime") != null && !jsonObj.get("UpdatedTime").isJsonNull()) && !jsonObj.get("UpdatedTime").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UpdatedTime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UpdatedTime").toString())); + } + if ((jsonObj.get("IsGeoEnabled") != null && !jsonObj.get("IsGeoEnabled").isJsonNull()) && !jsonObj.get("IsGeoEnabled").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IsGeoEnabled` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IsGeoEnabled").toString())); + } + if ((jsonObj.get("Associations") != null && !jsonObj.get("Associations").isJsonNull()) && !jsonObj.get("Associations").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Associations` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Associations").toString())); + } + if ((jsonObj.get("Honors") != null && !jsonObj.get("Honors").isJsonNull()) && !jsonObj.get("Honors").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Honors` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Honors").toString())); + } + if ((jsonObj.get("HttpsImageUrl") != null && !jsonObj.get("HttpsImageUrl").isJsonNull()) && !jsonObj.get("HttpsImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HttpsImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HttpsImageUrl").toString())); + } + if ((jsonObj.get("MainAddress") != null && !jsonObj.get("MainAddress").isJsonNull()) && !jsonObj.get("MainAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MainAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MainAddress").toString())); + } + if ((jsonObj.get("Created") != null && !jsonObj.get("Created").isJsonNull()) && !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("LocalCity") != null && !jsonObj.get("LocalCity").isJsonNull()) && !jsonObj.get("LocalCity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalCity").toString())); + } + if ((jsonObj.get("ProfileCity") != null && !jsonObj.get("ProfileCity").isJsonNull()) && !jsonObj.get("ProfileCity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileCity").toString())); + } + if ((jsonObj.get("LocalCountry") != null && !jsonObj.get("LocalCountry").isJsonNull()) && !jsonObj.get("LocalCountry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalCountry").toString())); + } + if ((jsonObj.get("ProfileCountry") != null && !jsonObj.get("ProfileCountry").isJsonNull()) && !jsonObj.get("ProfileCountry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileCountry").toString())); + } + if ((jsonObj.get("RelationshipStatus") != null && !jsonObj.get("RelationshipStatus").isJsonNull()) && !jsonObj.get("RelationshipStatus").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RelationshipStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RelationshipStatus").toString())); + } + if ((jsonObj.get("Quota") != null && !jsonObj.get("Quota").isJsonNull()) && !jsonObj.get("Quota").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Quota` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Quota").toString())); + } + if ((jsonObj.get("Quote") != null && !jsonObj.get("Quote").isJsonNull()) && !jsonObj.get("Quote").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Quote` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Quote").toString())); + } + if ((jsonObj.get("Religion") != null && !jsonObj.get("Religion").isJsonNull()) && !jsonObj.get("Religion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Religion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Religion").toString())); + } + if ((jsonObj.get("Political") != null && !jsonObj.get("Political").isJsonNull()) && !jsonObj.get("Political").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Political` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Political").toString())); + } + if ((jsonObj.get("PublicRepository") != null && !jsonObj.get("PublicRepository").isJsonNull()) && !jsonObj.get("PublicRepository").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PublicRepository` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PublicRepository").toString())); + } + if ((jsonObj.get("RepositoryUrl") != null && !jsonObj.get("RepositoryUrl").isJsonNull()) && !jsonObj.get("RepositoryUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RepositoryUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RepositoryUrl").toString())); + } + if ((jsonObj.get("Age") != null && !jsonObj.get("Age").isJsonNull()) && !jsonObj.get("Age").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Age` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Age").toString())); + } + if ((jsonObj.get("ProfessionalHeadline") != null && !jsonObj.get("ProfessionalHeadline").isJsonNull()) && !jsonObj.get("ProfessionalHeadline").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfessionalHeadline` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfessionalHeadline").toString())); + } + if ((jsonObj.get("LRUserID") != null && !jsonObj.get("LRUserID").isJsonNull()) && !jsonObj.get("LRUserID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LRUserID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LRUserID").toString())); + } + if ((jsonObj.get("Currency") != null && !jsonObj.get("Currency").isJsonNull()) && !jsonObj.get("Currency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Currency").toString())); + } + if ((jsonObj.get("StarredUrl") != null && !jsonObj.get("StarredUrl").isJsonNull()) && !jsonObj.get("StarredUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `StarredUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("StarredUrl").toString())); + } + if ((jsonObj.get("GistsUrl") != null && !jsonObj.get("GistsUrl").isJsonNull()) && !jsonObj.get("GistsUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GistsUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GistsUrl").toString())); + } + if ((jsonObj.get("Company") != null && !jsonObj.get("Company").isJsonNull()) && !jsonObj.get("Company").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Company` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Company").toString())); + } + if ((jsonObj.get("GravatarImageUrl") != null && !jsonObj.get("GravatarImageUrl").isJsonNull()) && !jsonObj.get("GravatarImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GravatarImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GravatarImageUrl").toString())); + } + // validate the optional field `PrivacyPolicy` + if (jsonObj.get("PrivacyPolicy") != null && !jsonObj.get("PrivacyPolicy").isJsonNull()) { + ProfilePrivacyPolicy.validateJsonElement(jsonObj.get("PrivacyPolicy")); + } + // validate the optional field `Country` + if (jsonObj.get("Country") != null && !jsonObj.get("Country").isJsonNull()) { + ProfileCountry.validateJsonElement(jsonObj.get("Country")); + } + // validate the optional field `AgeRange` + if (jsonObj.get("AgeRange") != null && !jsonObj.get("AgeRange").isJsonNull()) { + ProfileAgeRange.validateJsonElement(jsonObj.get("AgeRange")); + } + // validate the optional field `KloutScore` + if (jsonObj.get("KloutScore") != null && !jsonObj.get("KloutScore").isJsonNull()) { + ProfileKloutScore.validateJsonElement(jsonObj.get("KloutScore")); + } + // validate the optional field `Suggestions` + if (jsonObj.get("Suggestions") != null && !jsonObj.get("Suggestions").isJsonNull()) { + ProfileSuggestions.validateJsonElement(jsonObj.get("Suggestions")); + } + // validate the optional field `Subscription` + if (jsonObj.get("Subscription") != null && !jsonObj.get("Subscription").isJsonNull()) { + ProfileSubscription.validateJsonElement(jsonObj.get("Subscription")); + } + // validate the optional field `PIN` + if (jsonObj.get("PIN") != null && !jsonObj.get("PIN").isJsonNull()) { + ProfilePIN.validateJsonElement(jsonObj.get("PIN")); + } + // validate the optional field `ConsentProfile` + if (jsonObj.get("ConsentProfile") != null && !jsonObj.get("ConsentProfile").isJsonNull()) { + ProfileConsentProfile.validateJsonElement(jsonObj.get("ConsentProfile")); + } + // validate the optional field `RegistrationData` + if (jsonObj.get("RegistrationData") != null && !jsonObj.get("RegistrationData").isJsonNull()) { + ProfileRegistrationData.validateJsonElement(jsonObj.get("RegistrationData")); + } + // validate the optional field `ProviderAccessCredential` + if (jsonObj.get("ProviderAccessCredential") != null && !jsonObj.get("ProviderAccessCredential").isJsonNull()) { + ProfileProviderAccessCredential.validateJsonElement(jsonObj.get("ProviderAccessCredential")); + } + // ensure the optional json data is an array if present + if (jsonObj.get("Roles") != null && !jsonObj.get("Roles").isJsonNull() && !jsonObj.get("Roles").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Roles` to be an array in the JSON string but got `%s`", jsonObj.get("Roles").toString())); + } + if ((jsonObj.get("Uid") != null && !jsonObj.get("Uid").isJsonNull()) && !jsonObj.get("Uid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Uid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Uid").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("PreviousUids") != null && !jsonObj.get("PreviousUids").isJsonNull() && !jsonObj.get("PreviousUids").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PreviousUids` to be an array in the JSON string but got `%s`", jsonObj.get("PreviousUids").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("InterestedIn") != null && !jsonObj.get("InterestedIn").isJsonNull() && !jsonObj.get("InterestedIn").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `InterestedIn` to be an array in the JSON string but got `%s`", jsonObj.get("InterestedIn").toString())); + } + if (jsonObj.get("ExternalIds") != null && !jsonObj.get("ExternalIds").isJsonNull()) { + JsonArray jsonArrayexternalIds = jsonObj.getAsJsonArray("ExternalIds"); + if (jsonArrayexternalIds != null) { + // ensure the json data is an array + if (!jsonObj.get("ExternalIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ExternalIds` to be an array in the JSON string but got `%s`", jsonObj.get("ExternalIds").toString())); + } + + // validate the optional field `ExternalIds` (array) + for (int i = 0; i < jsonArrayexternalIds.size(); i++) { + ProfileExternalIdsInner.validateJsonElement(jsonArrayexternalIds.get(i)); + }; + } + } + if (jsonObj.get("UnverifiedEmail") != null && !jsonObj.get("UnverifiedEmail").isJsonNull()) { + JsonArray jsonArrayunverifiedEmail = jsonObj.getAsJsonArray("UnverifiedEmail"); + if (jsonArrayunverifiedEmail != null) { + // ensure the json data is an array + if (!jsonObj.get("UnverifiedEmail").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `UnverifiedEmail` to be an array in the JSON string but got `%s`", jsonObj.get("UnverifiedEmail").toString())); + } + + // validate the optional field `UnverifiedEmail` (array) + for (int i = 0; i < jsonArrayunverifiedEmail.size(); i++) { + ProfileUnverifiedEmailInner.validateJsonElement(jsonArrayunverifiedEmail.get(i)); + }; + } + } + if (jsonObj.get("Positions") != null && !jsonObj.get("Positions").isJsonNull()) { + JsonArray jsonArraypositions = jsonObj.getAsJsonArray("Positions"); + if (jsonArraypositions != null) { + // ensure the json data is an array + if (!jsonObj.get("Positions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Positions` to be an array in the JSON string but got `%s`", jsonObj.get("Positions").toString())); + } + + // validate the optional field `Positions` (array) + for (int i = 0; i < jsonArraypositions.size(); i++) { + ProfilePositionsInner.validateJsonElement(jsonArraypositions.get(i)); + }; + } + } + if (jsonObj.get("Educations") != null && !jsonObj.get("Educations").isJsonNull()) { + JsonArray jsonArrayeducations = jsonObj.getAsJsonArray("Educations"); + if (jsonArrayeducations != null) { + // ensure the json data is an array + if (!jsonObj.get("Educations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Educations` to be an array in the JSON string but got `%s`", jsonObj.get("Educations").toString())); + } + + // validate the optional field `Educations` (array) + for (int i = 0; i < jsonArrayeducations.size(); i++) { + ProfileEducationsInner.validateJsonElement(jsonArrayeducations.get(i)); + }; + } + } + if (jsonObj.get("PhoneNumbers") != null && !jsonObj.get("PhoneNumbers").isJsonNull()) { + JsonArray jsonArrayphoneNumbers = jsonObj.getAsJsonArray("PhoneNumbers"); + if (jsonArrayphoneNumbers != null) { + // ensure the json data is an array + if (!jsonObj.get("PhoneNumbers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PhoneNumbers` to be an array in the JSON string but got `%s`", jsonObj.get("PhoneNumbers").toString())); + } + + // validate the optional field `PhoneNumbers` (array) + for (int i = 0; i < jsonArrayphoneNumbers.size(); i++) { + ProfilePhoneNumbersInner.validateJsonElement(jsonArrayphoneNumbers.get(i)); + }; + } + } + if (jsonObj.get("IMAccounts") != null && !jsonObj.get("IMAccounts").isJsonNull()) { + JsonArray jsonArrayimAccounts = jsonObj.getAsJsonArray("IMAccounts"); + if (jsonArrayimAccounts != null) { + // ensure the json data is an array + if (!jsonObj.get("IMAccounts").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `IMAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("IMAccounts").toString())); + } + + // validate the optional field `IMAccounts` (array) + for (int i = 0; i < jsonArrayimAccounts.size(); i++) { + ProfileIMAccountsInner.validateJsonElement(jsonArrayimAccounts.get(i)); + }; + } + } + if (jsonObj.get("Addresses") != null && !jsonObj.get("Addresses").isJsonNull()) { + JsonArray jsonArrayaddresses = jsonObj.getAsJsonArray("Addresses"); + if (jsonArrayaddresses != null) { + // ensure the json data is an array + if (!jsonObj.get("Addresses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Addresses` to be an array in the JSON string but got `%s`", jsonObj.get("Addresses").toString())); + } + + // validate the optional field `Addresses` (array) + for (int i = 0; i < jsonArrayaddresses.size(); i++) { + ProfileAddressesInner.validateJsonElement(jsonArrayaddresses.get(i)); + }; + } + } + if (jsonObj.get("Interests") != null && !jsonObj.get("Interests").isJsonNull()) { + JsonArray jsonArrayinterests = jsonObj.getAsJsonArray("Interests"); + if (jsonArrayinterests != null) { + // ensure the json data is an array + if (!jsonObj.get("Interests").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Interests` to be an array in the JSON string but got `%s`", jsonObj.get("Interests").toString())); + } + + // validate the optional field `Interests` (array) + for (int i = 0; i < jsonArrayinterests.size(); i++) { + ProfileInterestsInner.validateJsonElement(jsonArrayinterests.get(i)); + }; + } + } + if (jsonObj.get("Sports") != null && !jsonObj.get("Sports").isJsonNull()) { + JsonArray jsonArraysports = jsonObj.getAsJsonArray("Sports"); + if (jsonArraysports != null) { + // ensure the json data is an array + if (!jsonObj.get("Sports").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Sports` to be an array in the JSON string but got `%s`", jsonObj.get("Sports").toString())); + } + + // validate the optional field `Sports` (array) + for (int i = 0; i < jsonArraysports.size(); i++) { + ProfileSportsInner.validateJsonElement(jsonArraysports.get(i)); + }; + } + } + if (jsonObj.get("InspirationalPeople") != null && !jsonObj.get("InspirationalPeople").isJsonNull()) { + JsonArray jsonArrayinspirationalPeople = jsonObj.getAsJsonArray("InspirationalPeople"); + if (jsonArrayinspirationalPeople != null) { + // ensure the json data is an array + if (!jsonObj.get("InspirationalPeople").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `InspirationalPeople` to be an array in the JSON string but got `%s`", jsonObj.get("InspirationalPeople").toString())); + } + + // validate the optional field `InspirationalPeople` (array) + for (int i = 0; i < jsonArrayinspirationalPeople.size(); i++) { + ProfileInspirationalPeopleInner.validateJsonElement(jsonArrayinspirationalPeople.get(i)); + }; + } + } + if (jsonObj.get("Awards") != null && !jsonObj.get("Awards").isJsonNull()) { + JsonArray jsonArrayawards = jsonObj.getAsJsonArray("Awards"); + if (jsonArrayawards != null) { + // ensure the json data is an array + if (!jsonObj.get("Awards").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Awards` to be an array in the JSON string but got `%s`", jsonObj.get("Awards").toString())); + } + + // validate the optional field `Awards` (array) + for (int i = 0; i < jsonArrayawards.size(); i++) { + ProfileAwardsInner.validateJsonElement(jsonArrayawards.get(i)); + }; + } + } + if (jsonObj.get("Skills") != null && !jsonObj.get("Skills").isJsonNull()) { + JsonArray jsonArrayskills = jsonObj.getAsJsonArray("Skills"); + if (jsonArrayskills != null) { + // ensure the json data is an array + if (!jsonObj.get("Skills").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Skills` to be an array in the JSON string but got `%s`", jsonObj.get("Skills").toString())); + } + + // validate the optional field `Skills` (array) + for (int i = 0; i < jsonArrayskills.size(); i++) { + ProfileSkillsInner.validateJsonElement(jsonArrayskills.get(i)); + }; + } + } + if (jsonObj.get("CurrentStatus") != null && !jsonObj.get("CurrentStatus").isJsonNull()) { + JsonArray jsonArraycurrentStatus = jsonObj.getAsJsonArray("CurrentStatus"); + if (jsonArraycurrentStatus != null) { + // ensure the json data is an array + if (!jsonObj.get("CurrentStatus").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `CurrentStatus` to be an array in the JSON string but got `%s`", jsonObj.get("CurrentStatus").toString())); + } + + // validate the optional field `CurrentStatus` (array) + for (int i = 0; i < jsonArraycurrentStatus.size(); i++) { + ProfileCurrentStatusInner.validateJsonElement(jsonArraycurrentStatus.get(i)); + }; + } + } + if (jsonObj.get("Certifications") != null && !jsonObj.get("Certifications").isJsonNull()) { + JsonArray jsonArraycertifications = jsonObj.getAsJsonArray("Certifications"); + if (jsonArraycertifications != null) { + // ensure the json data is an array + if (!jsonObj.get("Certifications").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Certifications` to be an array in the JSON string but got `%s`", jsonObj.get("Certifications").toString())); + } + + // validate the optional field `Certifications` (array) + for (int i = 0; i < jsonArraycertifications.size(); i++) { + ProfileCertificationsInner.validateJsonElement(jsonArraycertifications.get(i)); + }; + } + } + if (jsonObj.get("Courses") != null && !jsonObj.get("Courses").isJsonNull()) { + JsonArray jsonArraycourses = jsonObj.getAsJsonArray("Courses"); + if (jsonArraycourses != null) { + // ensure the json data is an array + if (!jsonObj.get("Courses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Courses` to be an array in the JSON string but got `%s`", jsonObj.get("Courses").toString())); + } + + // validate the optional field `Courses` (array) + for (int i = 0; i < jsonArraycourses.size(); i++) { + ProfileCoursesInner.validateJsonElement(jsonArraycourses.get(i)); + }; + } + } + if (jsonObj.get("Volunteer") != null && !jsonObj.get("Volunteer").isJsonNull()) { + JsonArray jsonArrayvolunteer = jsonObj.getAsJsonArray("Volunteer"); + if (jsonArrayvolunteer != null) { + // ensure the json data is an array + if (!jsonObj.get("Volunteer").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Volunteer` to be an array in the JSON string but got `%s`", jsonObj.get("Volunteer").toString())); + } + + // validate the optional field `Volunteer` (array) + for (int i = 0; i < jsonArrayvolunteer.size(); i++) { + ProfileVolunteerInner.validateJsonElement(jsonArrayvolunteer.get(i)); + }; + } + } + if (jsonObj.get("RecommendationsReceived") != null && !jsonObj.get("RecommendationsReceived").isJsonNull()) { + JsonArray jsonArrayrecommendationsReceived = jsonObj.getAsJsonArray("RecommendationsReceived"); + if (jsonArrayrecommendationsReceived != null) { + // ensure the json data is an array + if (!jsonObj.get("RecommendationsReceived").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RecommendationsReceived` to be an array in the JSON string but got `%s`", jsonObj.get("RecommendationsReceived").toString())); + } + + // validate the optional field `RecommendationsReceived` (array) + for (int i = 0; i < jsonArrayrecommendationsReceived.size(); i++) { + ProfileRecommendationsReceivedInner.validateJsonElement(jsonArrayrecommendationsReceived.get(i)); + }; + } + } + if (jsonObj.get("Languages") != null && !jsonObj.get("Languages").isJsonNull()) { + JsonArray jsonArraylanguages = jsonObj.getAsJsonArray("Languages"); + if (jsonArraylanguages != null) { + // ensure the json data is an array + if (!jsonObj.get("Languages").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Languages` to be an array in the JSON string but got `%s`", jsonObj.get("Languages").toString())); + } + + // validate the optional field `Languages` (array) + for (int i = 0; i < jsonArraylanguages.size(); i++) { + ProfileLanguagesInner.validateJsonElement(jsonArraylanguages.get(i)); + }; + } + } + if (jsonObj.get("Projects") != null && !jsonObj.get("Projects").isJsonNull()) { + JsonArray jsonArrayprojects = jsonObj.getAsJsonArray("Projects"); + if (jsonArrayprojects != null) { + // ensure the json data is an array + if (!jsonObj.get("Projects").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Projects` to be an array in the JSON string but got `%s`", jsonObj.get("Projects").toString())); + } + + // validate the optional field `Projects` (array) + for (int i = 0; i < jsonArrayprojects.size(); i++) { + ProfileProjectsInner.validateJsonElement(jsonArrayprojects.get(i)); + }; + } + } + if (jsonObj.get("Games") != null && !jsonObj.get("Games").isJsonNull()) { + JsonArray jsonArraygames = jsonObj.getAsJsonArray("Games"); + if (jsonArraygames != null) { + // ensure the json data is an array + if (!jsonObj.get("Games").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Games` to be an array in the JSON string but got `%s`", jsonObj.get("Games").toString())); + } + + // validate the optional field `Games` (array) + for (int i = 0; i < jsonArraygames.size(); i++) { + ProfileGamesInner.validateJsonElement(jsonArraygames.get(i)); + }; + } + } + if (jsonObj.get("Family") != null && !jsonObj.get("Family").isJsonNull()) { + JsonArray jsonArrayfamily = jsonObj.getAsJsonArray("Family"); + if (jsonArrayfamily != null) { + // ensure the json data is an array + if (!jsonObj.get("Family").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Family` to be an array in the JSON string but got `%s`", jsonObj.get("Family").toString())); + } + + // validate the optional field `Family` (array) + for (int i = 0; i < jsonArrayfamily.size(); i++) { + ProfileFamilyInner.validateJsonElement(jsonArrayfamily.get(i)); + }; + } + } + if (jsonObj.get("TelevisionShow") != null && !jsonObj.get("TelevisionShow").isJsonNull()) { + JsonArray jsonArraytelevisionShow = jsonObj.getAsJsonArray("TelevisionShow"); + if (jsonArraytelevisionShow != null) { + // ensure the json data is an array + if (!jsonObj.get("TelevisionShow").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `TelevisionShow` to be an array in the JSON string but got `%s`", jsonObj.get("TelevisionShow").toString())); + } + + // validate the optional field `TelevisionShow` (array) + for (int i = 0; i < jsonArraytelevisionShow.size(); i++) { + ProfileTelevisionShowInner.validateJsonElement(jsonArraytelevisionShow.get(i)); + }; + } + } + if (jsonObj.get("MutualFriends") != null && !jsonObj.get("MutualFriends").isJsonNull()) { + JsonArray jsonArraymutualFriends = jsonObj.getAsJsonArray("MutualFriends"); + if (jsonArraymutualFriends != null) { + // ensure the json data is an array + if (!jsonObj.get("MutualFriends").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `MutualFriends` to be an array in the JSON string but got `%s`", jsonObj.get("MutualFriends").toString())); + } + + // validate the optional field `MutualFriends` (array) + for (int i = 0; i < jsonArraymutualFriends.size(); i++) { + ProfileMutualFriendsInner.validateJsonElement(jsonArraymutualFriends.get(i)); + }; + } + } + if (jsonObj.get("Movies") != null && !jsonObj.get("Movies").isJsonNull()) { + JsonArray jsonArraymovies = jsonObj.getAsJsonArray("Movies"); + if (jsonArraymovies != null) { + // ensure the json data is an array + if (!jsonObj.get("Movies").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Movies` to be an array in the JSON string but got `%s`", jsonObj.get("Movies").toString())); + } + + // validate the optional field `Movies` (array) + for (int i = 0; i < jsonArraymovies.size(); i++) { + ProfileMoviesInner.validateJsonElement(jsonArraymovies.get(i)); + }; + } + } + if (jsonObj.get("Books") != null && !jsonObj.get("Books").isJsonNull()) { + JsonArray jsonArraybooks = jsonObj.getAsJsonArray("Books"); + if (jsonArraybooks != null) { + // ensure the json data is an array + if (!jsonObj.get("Books").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Books` to be an array in the JSON string but got `%s`", jsonObj.get("Books").toString())); + } + + // validate the optional field `Books` (array) + for (int i = 0; i < jsonArraybooks.size(); i++) { + ProfileBooksInner.validateJsonElement(jsonArraybooks.get(i)); + }; + } + } + if (jsonObj.get("Patents") != null && !jsonObj.get("Patents").isJsonNull()) { + JsonArray jsonArraypatents = jsonObj.getAsJsonArray("Patents"); + if (jsonArraypatents != null) { + // ensure the json data is an array + if (!jsonObj.get("Patents").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Patents` to be an array in the JSON string but got `%s`", jsonObj.get("Patents").toString())); + } + + // validate the optional field `Patents` (array) + for (int i = 0; i < jsonArraypatents.size(); i++) { + ProfilePatentsInner.validateJsonElement(jsonArraypatents.get(i)); + }; + } + } + if (jsonObj.get("FavoriteThings") != null && !jsonObj.get("FavoriteThings").isJsonNull()) { + JsonArray jsonArrayfavoriteThings = jsonObj.getAsJsonArray("FavoriteThings"); + if (jsonArrayfavoriteThings != null) { + // ensure the json data is an array + if (!jsonObj.get("FavoriteThings").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `FavoriteThings` to be an array in the JSON string but got `%s`", jsonObj.get("FavoriteThings").toString())); + } + + // validate the optional field `FavoriteThings` (array) + for (int i = 0; i < jsonArrayfavoriteThings.size(); i++) { + ProfileFavoriteThingsInner.validateJsonElement(jsonArrayfavoriteThings.get(i)); + }; + } + } + if (jsonObj.get("RelatedProfileViews") != null && !jsonObj.get("RelatedProfileViews").isJsonNull()) { + JsonArray jsonArrayrelatedProfileViews = jsonObj.getAsJsonArray("RelatedProfileViews"); + if (jsonArrayrelatedProfileViews != null) { + // ensure the json data is an array + if (!jsonObj.get("RelatedProfileViews").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RelatedProfileViews` to be an array in the JSON string but got `%s`", jsonObj.get("RelatedProfileViews").toString())); + } + + // validate the optional field `RelatedProfileViews` (array) + for (int i = 0; i < jsonArrayrelatedProfileViews.size(); i++) { + ProfileRelatedProfileViewsInner.validateJsonElement(jsonArrayrelatedProfileViews.get(i)); + }; + } + } + if (jsonObj.get("PlacesLived") != null && !jsonObj.get("PlacesLived").isJsonNull()) { + JsonArray jsonArrayplacesLived = jsonObj.getAsJsonArray("PlacesLived"); + if (jsonArrayplacesLived != null) { + // ensure the json data is an array + if (!jsonObj.get("PlacesLived").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PlacesLived` to be an array in the JSON string but got `%s`", jsonObj.get("PlacesLived").toString())); + } + + // validate the optional field `PlacesLived` (array) + for (int i = 0; i < jsonArrayplacesLived.size(); i++) { + ProfilePlacesLivedInner.validateJsonElement(jsonArrayplacesLived.get(i)); + }; + } + } + if (jsonObj.get("Publications") != null && !jsonObj.get("Publications").isJsonNull()) { + JsonArray jsonArraypublications = jsonObj.getAsJsonArray("Publications"); + if (jsonArraypublications != null) { + // ensure the json data is an array + if (!jsonObj.get("Publications").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Publications` to be an array in the JSON string but got `%s`", jsonObj.get("Publications").toString())); + } + + // validate the optional field `Publications` (array) + for (int i = 0; i < jsonArraypublications.size(); i++) { + ProfilePublicationsInner.validateJsonElement(jsonArraypublications.get(i)); + }; + } + } + if (jsonObj.get("JobBookmarks") != null && !jsonObj.get("JobBookmarks").isJsonNull()) { + JsonArray jsonArrayjobBookmarks = jsonObj.getAsJsonArray("JobBookmarks"); + if (jsonArrayjobBookmarks != null) { + // ensure the json data is an array + if (!jsonObj.get("JobBookmarks").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `JobBookmarks` to be an array in the JSON string but got `%s`", jsonObj.get("JobBookmarks").toString())); + } + + // validate the optional field `JobBookmarks` (array) + for (int i = 0; i < jsonArrayjobBookmarks.size(); i++) { + ProfileJobBookmarksInner.validateJsonElement(jsonArrayjobBookmarks.get(i)); + }; + } + } + if (jsonObj.get("Badges") != null && !jsonObj.get("Badges").isJsonNull()) { + JsonArray jsonArraybadges = jsonObj.getAsJsonArray("Badges"); + if (jsonArraybadges != null) { + // ensure the json data is an array + if (!jsonObj.get("Badges").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Badges` to be an array in the JSON string but got `%s`", jsonObj.get("Badges").toString())); + } + + // validate the optional field `Badges` (array) + for (int i = 0; i < jsonArraybadges.size(); i++) { + ProfileBadgesInner.validateJsonElement(jsonArraybadges.get(i)); + }; + } + } + if (jsonObj.get("MemberUrlResources") != null && !jsonObj.get("MemberUrlResources").isJsonNull()) { + JsonArray jsonArraymemberUrlResources = jsonObj.getAsJsonArray("MemberUrlResources"); + if (jsonArraymemberUrlResources != null) { + // ensure the json data is an array + if (!jsonObj.get("MemberUrlResources").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `MemberUrlResources` to be an array in the JSON string but got `%s`", jsonObj.get("MemberUrlResources").toString())); + } + + // validate the optional field `MemberUrlResources` (array) + for (int i = 0; i < jsonArraymemberUrlResources.size(); i++) { + ProfileMemberUrlResourcesInner.validateJsonElement(jsonArraymemberUrlResources.get(i)); + }; + } + } + if (jsonObj.get("Organizations") != null && !jsonObj.get("Organizations").isJsonNull()) { + JsonArray jsonArrayorganizations = jsonObj.getAsJsonArray("Organizations"); + if (jsonArrayorganizations != null) { + // ensure the json data is an array + if (!jsonObj.get("Organizations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Organizations` to be an array in the JSON string but got `%s`", jsonObj.get("Organizations").toString())); + } + + // validate the optional field `Organizations` (array) + for (int i = 0; i < jsonArrayorganizations.size(); i++) { + ProfileOrganizationsInner.validateJsonElement(jsonArrayorganizations.get(i)); + }; + } + } + if ((jsonObj.get("ObjectId") != null && !jsonObj.get("ObjectId").isJsonNull()) && !jsonObj.get("ObjectId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ObjectId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ObjectId").toString())); + } + if (jsonObj.get("Email") != null && !jsonObj.get("Email").isJsonNull()) { + JsonArray jsonArrayemail = jsonObj.getAsJsonArray("Email"); + if (jsonArrayemail != null) { + // ensure the json data is an array + if (!jsonObj.get("Email").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Email` to be an array in the JSON string but got `%s`", jsonObj.get("Email").toString())); + } + + // validate the optional field `Email` (array) + for (int i = 0; i < jsonArrayemail.size(); i++) { + ProfileEmailInner.validateJsonElement(jsonArrayemail.get(i)); + }; + } + } + // validate the optional field `PasskeyLogin` + if (jsonObj.get("PasskeyLogin") != null && !jsonObj.get("PasskeyLogin").isJsonNull()) { + IdentityPasskeyLogin.validateJsonElement(jsonObj.get("PasskeyLogin")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!Identity.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Identity' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<Identity> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Identity.class)); + + return (TypeAdapter<T>) new TypeAdapter<Identity>() { + @Override + public void write(JsonWriter out, Identity value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Identity read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Identity instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Identity given an JSON string + * + * @param jsonString JSON string + * @return An instance of Identity + * @throws IOException if the JSON string is invalid with respect to Identity + */ + public static Identity fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Identity.class); + } + + /** + * Convert an instance of Identity to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/IdentityPasskeyLogin.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/IdentityPasskeyLogin.java new file mode 100644 index 0000000..fd1bd93 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/IdentityPasskeyLogin.java @@ -0,0 +1,297 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Passkey login details for the User. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class IdentityPasskeyLogin { + public static final String SERIALIZED_NAME_PROGRESSIVE_ENROLLMENT_DATE = "ProgressiveEnrollmentDate"; + @SerializedName(SERIALIZED_NAME_PROGRESSIVE_ENROLLMENT_DATE) + @javax.annotation.Nullable + private OffsetDateTime progressiveEnrollmentDate; + + public IdentityPasskeyLogin() { + } + + public IdentityPasskeyLogin progressiveEnrollmentDate(@javax.annotation.Nullable OffsetDateTime progressiveEnrollmentDate) { + this.progressiveEnrollmentDate = progressiveEnrollmentDate; + return this; + } + + /** + * The date of progressive enrollment. + * @return progressiveEnrollmentDate + */ + @javax.annotation.Nullable + public OffsetDateTime getProgressiveEnrollmentDate() { + return progressiveEnrollmentDate; + } + + public void setProgressiveEnrollmentDate(@javax.annotation.Nullable OffsetDateTime progressiveEnrollmentDate) { + this.progressiveEnrollmentDate = progressiveEnrollmentDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IdentityPasskeyLogin instance itself + */ + public IdentityPasskeyLogin putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IdentityPasskeyLogin identityPasskeyLogin = (IdentityPasskeyLogin) o; + return Objects.equals(this.progressiveEnrollmentDate, identityPasskeyLogin.progressiveEnrollmentDate)&& + Objects.equals(this.additionalProperties, identityPasskeyLogin.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(progressiveEnrollmentDate, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IdentityPasskeyLogin {\n"); + sb.append(" progressiveEnrollmentDate: ").append(toIndentedString(progressiveEnrollmentDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ProgressiveEnrollmentDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 IdentityPasskeyLogin + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IdentityPasskeyLogin.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IdentityPasskeyLogin is not found in the empty JSON string", IdentityPasskeyLogin.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!IdentityPasskeyLogin.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IdentityPasskeyLogin' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<IdentityPasskeyLogin> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IdentityPasskeyLogin.class)); + + return (TypeAdapter<T>) new TypeAdapter<IdentityPasskeyLogin>() { + @Override + public void write(JsonWriter out, IdentityPasskeyLogin value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public IdentityPasskeyLogin read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + IdentityPasskeyLogin instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IdentityPasskeyLogin given an JSON string + * + * @param jsonString JSON string + * @return An instance of IdentityPasskeyLogin + * @throws IOException if the JSON string is invalid with respect to IdentityPasskeyLogin + */ + public static IdentityPasskeyLogin fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IdentityPasskeyLogin.class); + } + + /** + * Convert an instance of IdentityPasskeyLogin to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/IdentityProvider.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/IdentityProvider.java new file mode 100644 index 0000000..2d03e71 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/IdentityProvider.java @@ -0,0 +1,359 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * IdentityProvider + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class IdentityProvider { + public static final String SERIALIZED_NAME_BINDING = "Binding"; + @SerializedName(SERIALIZED_NAME_BINDING) + @javax.annotation.Nullable + private String binding; + + public static final String SERIALIZED_NAME_LOCATION = "Location"; + @SerializedName(SERIALIZED_NAME_LOCATION) + @javax.annotation.Nullable + private String location; + + public static final String SERIALIZED_NAME_LOG_OUT = "LogOut"; + @SerializedName(SERIALIZED_NAME_LOG_OUT) + @javax.annotation.Nullable + private String logOut; + + public IdentityProvider() { + } + + public IdentityProvider binding(@javax.annotation.Nullable String binding) { + this.binding = binding; + return this; + } + + /** + * Get binding + * @return binding + */ + @javax.annotation.Nullable + public String getBinding() { + return binding; + } + + public void setBinding(@javax.annotation.Nullable String binding) { + this.binding = binding; + } + + + public IdentityProvider location(@javax.annotation.Nullable String location) { + this.location = location; + return this; + } + + /** + * Get location + * @return location + */ + @javax.annotation.Nullable + public String getLocation() { + return location; + } + + public void setLocation(@javax.annotation.Nullable String location) { + this.location = location; + } + + + public IdentityProvider logOut(@javax.annotation.Nullable String logOut) { + this.logOut = logOut; + return this; + } + + /** + * Get logOut + * @return logOut + */ + @javax.annotation.Nullable + public String getLogOut() { + return logOut; + } + + public void setLogOut(@javax.annotation.Nullable String logOut) { + this.logOut = logOut; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IdentityProvider instance itself + */ + public IdentityProvider putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IdentityProvider identityProvider = (IdentityProvider) o; + return Objects.equals(this.binding, identityProvider.binding) && + Objects.equals(this.location, identityProvider.location) && + Objects.equals(this.logOut, identityProvider.logOut)&& + Objects.equals(this.additionalProperties, identityProvider.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(binding, location, logOut, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IdentityProvider {\n"); + sb.append(" binding: ").append(toIndentedString(binding)).append("\n"); + sb.append(" location: ").append(toIndentedString(location)).append("\n"); + sb.append(" logOut: ").append(toIndentedString(logOut)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Binding"); + openapiFields.add("Location"); + openapiFields.add("LogOut"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 IdentityProvider + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IdentityProvider.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IdentityProvider is not found in the empty JSON string", IdentityProvider.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Binding") != null && !jsonObj.get("Binding").isJsonNull()) && !jsonObj.get("Binding").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Binding` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Binding").toString())); + } + if ((jsonObj.get("Location") != null && !jsonObj.get("Location").isJsonNull()) && !jsonObj.get("Location").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Location` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Location").toString())); + } + if ((jsonObj.get("LogOut") != null && !jsonObj.get("LogOut").isJsonNull()) && !jsonObj.get("LogOut").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LogOut` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LogOut").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!IdentityProvider.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IdentityProvider' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<IdentityProvider> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IdentityProvider.class)); + + return (TypeAdapter<T>) new TypeAdapter<IdentityProvider>() { + @Override + public void write(JsonWriter out, IdentityProvider value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public IdentityProvider read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + IdentityProvider instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IdentityProvider given an JSON string + * + * @param jsonString JSON string + * @return An instance of IdentityProvider + * @throws IOException if the JSON string is invalid with respect to IdentityProvider + */ + public static IdentityProvider fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IdentityProvider.class); + } + + /** + * Convert an instance of IdentityProvider to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/IdentityQuery.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/IdentityQuery.java new file mode 100644 index 0000000..f939ec9 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/IdentityQuery.java @@ -0,0 +1,289 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.QueryGroup; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * IdentityQuery + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class IdentityQuery { + public static final String SERIALIZED_NAME_GROUP = "group"; + @SerializedName(SERIALIZED_NAME_GROUP) + @javax.annotation.Nullable + private QueryGroup group; + + public IdentityQuery() { + } + + public IdentityQuery group(@javax.annotation.Nullable QueryGroup group) { + this.group = group; + return this; + } + + /** + * Get group + * @return group + */ + @javax.annotation.Nullable + public QueryGroup getGroup() { + return group; + } + + public void setGroup(@javax.annotation.Nullable QueryGroup group) { + this.group = group; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IdentityQuery instance itself + */ + public IdentityQuery putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IdentityQuery identityQuery = (IdentityQuery) o; + return Objects.equals(this.group, identityQuery.group)&& + Objects.equals(this.additionalProperties, identityQuery.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(group, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IdentityQuery {\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("group"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 IdentityQuery + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IdentityQuery.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IdentityQuery is not found in the empty JSON string", IdentityQuery.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `group` + if (jsonObj.get("group") != null && !jsonObj.get("group").isJsonNull()) { + QueryGroup.validateJsonElement(jsonObj.get("group")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!IdentityQuery.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IdentityQuery' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<IdentityQuery> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IdentityQuery.class)); + + return (TypeAdapter<T>) new TypeAdapter<IdentityQuery>() { + @Override + public void write(JsonWriter out, IdentityQuery value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public IdentityQuery read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + IdentityQuery instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IdentityQuery given an JSON string + * + * @param jsonString JSON string + * @return An instance of IdentityQuery + * @throws IOException if the JSON string is invalid with respect to IdentityQuery + */ + public static IdentityQuery fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IdentityQuery.class); + } + + /** + * Convert an instance of IdentityQuery to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/IdentityResponseWithSocialWithoutLogins.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/IdentityResponseWithSocialWithoutLogins.java new file mode 100644 index 0000000..f97f3cd --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/IdentityResponseWithSocialWithoutLogins.java @@ -0,0 +1,5225 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.IdentityPasskeyLogin; +import com.loginradius.sdk.internal.openapi.model.ProfileAddressesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileAgeRange; +import com.loginradius.sdk.internal.openapi.model.ProfileAwardsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileBadgesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileBooksInner; +import com.loginradius.sdk.internal.openapi.model.ProfileCertificationsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileConsentProfile; +import com.loginradius.sdk.internal.openapi.model.ProfileCountry; +import com.loginradius.sdk.internal.openapi.model.ProfileCoursesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileCurrentStatusInner; +import com.loginradius.sdk.internal.openapi.model.ProfileEducationsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileEmailInner; +import com.loginradius.sdk.internal.openapi.model.ProfileExternalIdsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileFamilyInner; +import com.loginradius.sdk.internal.openapi.model.ProfileFavoriteThingsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileGamesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileIMAccountsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileInspirationalPeopleInner; +import com.loginradius.sdk.internal.openapi.model.ProfileInterestsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileJobBookmarksInner; +import com.loginradius.sdk.internal.openapi.model.ProfileKloutScore; +import com.loginradius.sdk.internal.openapi.model.ProfileLanguagesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileMemberUrlResourcesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileMoviesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileMutualFriendsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileOrganizationsInner; +import com.loginradius.sdk.internal.openapi.model.ProfilePIN; +import com.loginradius.sdk.internal.openapi.model.ProfilePatentsInner; +import com.loginradius.sdk.internal.openapi.model.ProfilePhoneNumbersInner; +import com.loginradius.sdk.internal.openapi.model.ProfilePlacesLivedInner; +import com.loginradius.sdk.internal.openapi.model.ProfilePositionsInner; +import com.loginradius.sdk.internal.openapi.model.ProfilePrivacyPolicy; +import com.loginradius.sdk.internal.openapi.model.ProfileProjectsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileProviderAccessCredential; +import com.loginradius.sdk.internal.openapi.model.ProfilePublicationsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRecommendationsReceivedInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRegistrationData; +import com.loginradius.sdk.internal.openapi.model.ProfileRelatedProfileViewsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileSkillsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileSportsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileSubscription; +import com.loginradius.sdk.internal.openapi.model.ProfileSuggestions; +import com.loginradius.sdk.internal.openapi.model.ProfileTelevisionShowInner; +import com.loginradius.sdk.internal.openapi.model.ProfileUnverifiedEmailInner; +import com.loginradius.sdk.internal.openapi.model.ProfileVolunteerInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentity; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * IdentityResponseWithSocialWithoutLogins + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class IdentityResponseWithSocialWithoutLogins { + public static final String SERIALIZED_NAME_IS_PASSWORD_BREACHED = "IsPasswordBreached"; + @SerializedName(SERIALIZED_NAME_IS_PASSWORD_BREACHED) + @javax.annotation.Nullable + private Boolean isPasswordBreached; + + public static final String SERIALIZED_NAME_IS_ACTIVE = "IsActive"; + @SerializedName(SERIALIZED_NAME_IS_ACTIVE) + @javax.annotation.Nullable + private Boolean isActive; + + public static final String SERIALIZED_NAME_IS_DELETED = "IsDeleted"; + @SerializedName(SERIALIZED_NAME_IS_DELETED) + @javax.annotation.Nullable + private Boolean isDeleted; + + public static final String SERIALIZED_NAME_EMAIL_VERIFIED = "EmailVerified"; + @SerializedName(SERIALIZED_NAME_EMAIL_VERIFIED) + @javax.annotation.Nullable + private Boolean emailVerified; + + public static final String SERIALIZED_NAME_IS_LOGIN_LOCKED = "IsLoginLocked"; + @SerializedName(SERIALIZED_NAME_IS_LOGIN_LOCKED) + @javax.annotation.Nullable + private Boolean isLoginLocked; + + public static final String SERIALIZED_NAME_IS_REQUIRED_FIELDS_FILLED_ONCE = "IsRequiredFieldsFilledOnce"; + @SerializedName(SERIALIZED_NAME_IS_REQUIRED_FIELDS_FILLED_ONCE) + @javax.annotation.Nullable + private Boolean isRequiredFieldsFilledOnce; + + public static final String SERIALIZED_NAME_FIRST_LOGIN = "FirstLogin"; + @SerializedName(SERIALIZED_NAME_FIRST_LOGIN) + @javax.annotation.Nullable + private Boolean firstLogin; + + public static final String SERIALIZED_NAME_IS_PROTECTED = "IsProtected"; + @SerializedName(SERIALIZED_NAME_IS_PROTECTED) + @javax.annotation.Nullable + private Boolean isProtected; + + public static final String SERIALIZED_NAME_HIREABLE = "Hireable"; + @SerializedName(SERIALIZED_NAME_HIREABLE) + @javax.annotation.Nullable + private Boolean hireable; + + public static final String SERIALIZED_NAME_IS_SECURE_PASSWORD = "IsSecurePassword"; + @SerializedName(SERIALIZED_NAME_IS_SECURE_PASSWORD) + @javax.annotation.Nullable + private Boolean isSecurePassword; + + public static final String SERIALIZED_NAME_IS_CUSTOM_UID = "IsCustomUid"; + @SerializedName(SERIALIZED_NAME_IS_CUSTOM_UID) + @javax.annotation.Nullable + private Boolean isCustomUid; + + public static final String SERIALIZED_NAME_PHONE_ID_VERIFIED = "PhoneIdVerified"; + @SerializedName(SERIALIZED_NAME_PHONE_ID_VERIFIED) + @javax.annotation.Nullable + private Boolean phoneIdVerified; + + public static final String SERIALIZED_NAME_IS_EMAIL_SUBSCRIBED = "IsEmailSubscribed"; + @SerializedName(SERIALIZED_NAME_IS_EMAIL_SUBSCRIBED) + @javax.annotation.Nullable + private Boolean isEmailSubscribed; + + public static final String SERIALIZED_NAME_NO_OF_LOGINS = "NoOfLogins"; + @SerializedName(SERIALIZED_NAME_NO_OF_LOGINS) + @javax.annotation.Nullable + private Integer noOfLogins; + + public static final String SERIALIZED_NAME_FOLLOWERS_COUNT = "FollowersCount"; + @SerializedName(SERIALIZED_NAME_FOLLOWERS_COUNT) + @javax.annotation.Nullable + private Integer followersCount; + + public static final String SERIALIZED_NAME_FRIENDS_COUNT = "FriendsCount"; + @SerializedName(SERIALIZED_NAME_FRIENDS_COUNT) + @javax.annotation.Nullable + private Integer friendsCount; + + public static final String SERIALIZED_NAME_TOTAL_STATUSES_COUNT = "TotalStatusesCount"; + @SerializedName(SERIALIZED_NAME_TOTAL_STATUSES_COUNT) + @javax.annotation.Nullable + private Integer totalStatusesCount; + + public static final String SERIALIZED_NAME_NUM_RECOMMENDERS = "NumRecommenders"; + @SerializedName(SERIALIZED_NAME_NUM_RECOMMENDERS) + @javax.annotation.Nullable + private Integer numRecommenders; + + public static final String SERIALIZED_NAME_TOTAL_PRIVATE_REPOSITORY = "TotalPrivateRepository"; + @SerializedName(SERIALIZED_NAME_TOTAL_PRIVATE_REPOSITORY) + @javax.annotation.Nullable + private Integer totalPrivateRepository; + + public static final String SERIALIZED_NAME_PUBLIC_GISTS = "PublicGists"; + @SerializedName(SERIALIZED_NAME_PUBLIC_GISTS) + @javax.annotation.Nullable + private Integer publicGists; + + public static final String SERIALIZED_NAME_PRIVATE_GISTS = "PrivateGists"; + @SerializedName(SERIALIZED_NAME_PRIVATE_GISTS) + @javax.annotation.Nullable + private Integer privateGists; + + public static final String SERIALIZED_NAME_PINS_COUNT = "PinsCount"; + @SerializedName(SERIALIZED_NAME_PINS_COUNT) + @javax.annotation.Nullable + private Integer pinsCount; + + public static final String SERIALIZED_NAME_BOARDS_COUNT = "BoardsCount"; + @SerializedName(SERIALIZED_NAME_BOARDS_COUNT) + @javax.annotation.Nullable + private Integer boardsCount; + + public static final String SERIALIZED_NAME_LIKES_COUNT = "LikesCount"; + @SerializedName(SERIALIZED_NAME_LIKES_COUNT) + @javax.annotation.Nullable + private Integer likesCount; + + public static final String SERIALIZED_NAME_I_D = "ID"; + @SerializedName(SERIALIZED_NAME_I_D) + @javax.annotation.Nullable + private String ID; + + public static final String SERIALIZED_NAME_PROVIDER = "Provider"; + @SerializedName(SERIALIZED_NAME_PROVIDER) + @javax.annotation.Nullable + private String provider; + + 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_FIRST_NAME = "FirstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nullable + private String firstName; + + public static final String SERIALIZED_NAME_LAST_NAME = "LastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nullable + private String lastName; + + public static final String SERIALIZED_NAME_PHONE_ID = "PhoneId"; + @SerializedName(SERIALIZED_NAME_PHONE_ID) + @javax.annotation.Nullable + private String phoneId; + + public static final String SERIALIZED_NAME_USER_NAME = "UserName"; + @SerializedName(SERIALIZED_NAME_USER_NAME) + @javax.annotation.Nullable + private String userName; + + public static final String SERIALIZED_NAME_PREFIX = "Prefix"; + @SerializedName(SERIALIZED_NAME_PREFIX) + @javax.annotation.Nullable + private String prefix; + + public static final String SERIALIZED_NAME_MIDDLE_NAME = "MiddleName"; + @SerializedName(SERIALIZED_NAME_MIDDLE_NAME) + @javax.annotation.Nullable + private String middleName; + + public static final String SERIALIZED_NAME_SUFFIX = "Suffix"; + @SerializedName(SERIALIZED_NAME_SUFFIX) + @javax.annotation.Nullable + private String suffix; + + public static final String SERIALIZED_NAME_NICK_NAME = "NickName"; + @SerializedName(SERIALIZED_NAME_NICK_NAME) + @javax.annotation.Nullable + private String nickName; + + public static final String SERIALIZED_NAME_PROFILE_NAME = "ProfileName"; + @SerializedName(SERIALIZED_NAME_PROFILE_NAME) + @javax.annotation.Nullable + private String profileName; + + public static final String SERIALIZED_NAME_BIRTH_DATE = "BirthDate"; + @SerializedName(SERIALIZED_NAME_BIRTH_DATE) + @javax.annotation.Nullable + private String birthDate; + + public static final String SERIALIZED_NAME_GENDER = "Gender"; + @SerializedName(SERIALIZED_NAME_GENDER) + @javax.annotation.Nullable + private String gender; + + public static final String SERIALIZED_NAME_WEBSITE = "Website"; + @SerializedName(SERIALIZED_NAME_WEBSITE) + @javax.annotation.Nullable + private String website; + + public static final String SERIALIZED_NAME_THUMBNAIL_IMAGE_URL = "ThumbnailImageUrl"; + @SerializedName(SERIALIZED_NAME_THUMBNAIL_IMAGE_URL) + @javax.annotation.Nullable + private String thumbnailImageUrl; + + public static final String SERIALIZED_NAME_IMAGE_URL = "ImageUrl"; + @SerializedName(SERIALIZED_NAME_IMAGE_URL) + @javax.annotation.Nullable + private String imageUrl; + + public static final String SERIALIZED_NAME_FAVICON = "Favicon"; + @SerializedName(SERIALIZED_NAME_FAVICON) + @javax.annotation.Nullable + private String favicon; + + public static final String SERIALIZED_NAME_PROFILE_URL = "ProfileUrl"; + @SerializedName(SERIALIZED_NAME_PROFILE_URL) + @javax.annotation.Nullable + private String profileUrl; + + public static final String SERIALIZED_NAME_HOME_TOWN = "HomeTown"; + @SerializedName(SERIALIZED_NAME_HOME_TOWN) + @javax.annotation.Nullable + private String homeTown; + + public static final String SERIALIZED_NAME_STATE = "State"; + @SerializedName(SERIALIZED_NAME_STATE) + @javax.annotation.Nullable + private String state; + + public static final String SERIALIZED_NAME_CITY = "City"; + @SerializedName(SERIALIZED_NAME_CITY) + @javax.annotation.Nullable + private String city; + + public static final String SERIALIZED_NAME_INDUSTRY = "Industry"; + @SerializedName(SERIALIZED_NAME_INDUSTRY) + @javax.annotation.Nullable + private String industry; + + public static final String SERIALIZED_NAME_ABOUT = "About"; + @SerializedName(SERIALIZED_NAME_ABOUT) + @javax.annotation.Nullable + private String about; + + public static final String SERIALIZED_NAME_TIME_ZONE = "TimeZone"; + @SerializedName(SERIALIZED_NAME_TIME_ZONE) + @javax.annotation.Nullable + private String timeZone; + + public static final String SERIALIZED_NAME_LOCAL_LANGUAGE = "LocalLanguage"; + @SerializedName(SERIALIZED_NAME_LOCAL_LANGUAGE) + @javax.annotation.Nullable + private String localLanguage; + + public static final String SERIALIZED_NAME_COVER_PHOTO = "CoverPhoto"; + @SerializedName(SERIALIZED_NAME_COVER_PHOTO) + @javax.annotation.Nullable + private String coverPhoto; + + public static final String SERIALIZED_NAME_TAG_LINE = "TagLine"; + @SerializedName(SERIALIZED_NAME_TAG_LINE) + @javax.annotation.Nullable + private String tagLine; + + public static final String SERIALIZED_NAME_LANGUAGE = "Language"; + @SerializedName(SERIALIZED_NAME_LANGUAGE) + @javax.annotation.Nullable + private String language; + + public static final String SERIALIZED_NAME_VERIFIED = "Verified"; + @SerializedName(SERIALIZED_NAME_VERIFIED) + @javax.annotation.Nullable + private String verified; + + public static final String SERIALIZED_NAME_UPDATED_TIME = "UpdatedTime"; + @SerializedName(SERIALIZED_NAME_UPDATED_TIME) + @javax.annotation.Nullable + private String updatedTime; + + public static final String SERIALIZED_NAME_IS_GEO_ENABLED = "IsGeoEnabled"; + @SerializedName(SERIALIZED_NAME_IS_GEO_ENABLED) + @javax.annotation.Nullable + private String isGeoEnabled; + + public static final String SERIALIZED_NAME_ASSOCIATIONS = "Associations"; + @SerializedName(SERIALIZED_NAME_ASSOCIATIONS) + @javax.annotation.Nullable + private String associations; + + public static final String SERIALIZED_NAME_HONORS = "Honors"; + @SerializedName(SERIALIZED_NAME_HONORS) + @javax.annotation.Nullable + private String honors; + + public static final String SERIALIZED_NAME_HTTPS_IMAGE_URL = "HttpsImageUrl"; + @SerializedName(SERIALIZED_NAME_HTTPS_IMAGE_URL) + @javax.annotation.Nullable + private String httpsImageUrl; + + public static final String SERIALIZED_NAME_MAIN_ADDRESS = "MainAddress"; + @SerializedName(SERIALIZED_NAME_MAIN_ADDRESS) + @javax.annotation.Nullable + private String mainAddress; + + public static final String SERIALIZED_NAME_CREATED = "Created"; + @SerializedName(SERIALIZED_NAME_CREATED) + @javax.annotation.Nullable + private String created; + + public static final String SERIALIZED_NAME_LOCAL_CITY = "LocalCity"; + @SerializedName(SERIALIZED_NAME_LOCAL_CITY) + @javax.annotation.Nullable + private String localCity; + + public static final String SERIALIZED_NAME_PROFILE_CITY = "ProfileCity"; + @SerializedName(SERIALIZED_NAME_PROFILE_CITY) + @javax.annotation.Nullable + private String profileCity; + + public static final String SERIALIZED_NAME_LOCAL_COUNTRY = "LocalCountry"; + @SerializedName(SERIALIZED_NAME_LOCAL_COUNTRY) + @javax.annotation.Nullable + private String localCountry; + + public static final String SERIALIZED_NAME_PROFILE_COUNTRY = "ProfileCountry"; + @SerializedName(SERIALIZED_NAME_PROFILE_COUNTRY) + @javax.annotation.Nullable + private String profileCountry; + + public static final String SERIALIZED_NAME_RELATIONSHIP_STATUS = "RelationshipStatus"; + @SerializedName(SERIALIZED_NAME_RELATIONSHIP_STATUS) + @javax.annotation.Nullable + private String relationshipStatus; + + public static final String SERIALIZED_NAME_QUOTA = "Quota"; + @SerializedName(SERIALIZED_NAME_QUOTA) + @javax.annotation.Nullable + private String quota; + + public static final String SERIALIZED_NAME_QUOTE = "Quote"; + @SerializedName(SERIALIZED_NAME_QUOTE) + @javax.annotation.Nullable + private String quote; + + public static final String SERIALIZED_NAME_RELIGION = "Religion"; + @SerializedName(SERIALIZED_NAME_RELIGION) + @javax.annotation.Nullable + private String religion; + + public static final String SERIALIZED_NAME_POLITICAL = "Political"; + @SerializedName(SERIALIZED_NAME_POLITICAL) + @javax.annotation.Nullable + private String political; + + public static final String SERIALIZED_NAME_PUBLIC_REPOSITORY = "PublicRepository"; + @SerializedName(SERIALIZED_NAME_PUBLIC_REPOSITORY) + @javax.annotation.Nullable + private String publicRepository; + + public static final String SERIALIZED_NAME_REPOSITORY_URL = "RepositoryUrl"; + @SerializedName(SERIALIZED_NAME_REPOSITORY_URL) + @javax.annotation.Nullable + private String repositoryUrl; + + public static final String SERIALIZED_NAME_AGE = "Age"; + @SerializedName(SERIALIZED_NAME_AGE) + @javax.annotation.Nullable + private String age; + + public static final String SERIALIZED_NAME_PROFESSIONAL_HEADLINE = "ProfessionalHeadline"; + @SerializedName(SERIALIZED_NAME_PROFESSIONAL_HEADLINE) + @javax.annotation.Nullable + private String professionalHeadline; + + public static final String SERIALIZED_NAME_LR_USER_I_D = "LRUserID"; + @SerializedName(SERIALIZED_NAME_LR_USER_I_D) + @javax.annotation.Nullable + private String lrUserID; + + public static final String SERIALIZED_NAME_CURRENCY = "Currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + @javax.annotation.Nullable + private String currency; + + public static final String SERIALIZED_NAME_STARRED_URL = "StarredUrl"; + @SerializedName(SERIALIZED_NAME_STARRED_URL) + @javax.annotation.Nullable + private String starredUrl; + + public static final String SERIALIZED_NAME_GISTS_URL = "GistsUrl"; + @SerializedName(SERIALIZED_NAME_GISTS_URL) + @javax.annotation.Nullable + private String gistsUrl; + + public static final String SERIALIZED_NAME_COMPANY = "Company"; + @SerializedName(SERIALIZED_NAME_COMPANY) + @javax.annotation.Nullable + private String company; + + public static final String SERIALIZED_NAME_GRAVATAR_IMAGE_URL = "GravatarImageUrl"; + @SerializedName(SERIALIZED_NAME_GRAVATAR_IMAGE_URL) + @javax.annotation.Nullable + private String gravatarImageUrl; + + public static final String SERIALIZED_NAME_LAST_PASSWORD_CHANGE_DATE = "LastPasswordChangeDate"; + @SerializedName(SERIALIZED_NAME_LAST_PASSWORD_CHANGE_DATE) + @javax.annotation.Nullable + private OffsetDateTime lastPasswordChangeDate; + + public static final String SERIALIZED_NAME_PASSWORD_EXPIRATION_DATE = "PasswordExpirationDate"; + @SerializedName(SERIALIZED_NAME_PASSWORD_EXPIRATION_DATE) + @javax.annotation.Nullable + private OffsetDateTime passwordExpirationDate; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public static final String SERIALIZED_NAME_MODIFIED_DATE = "ModifiedDate"; + @SerializedName(SERIALIZED_NAME_MODIFIED_DATE) + @javax.annotation.Nullable + private OffsetDateTime modifiedDate; + + public static final String SERIALIZED_NAME_PROFILE_MODIFIED_DATE = "ProfileModifiedDate"; + @SerializedName(SERIALIZED_NAME_PROFILE_MODIFIED_DATE) + @javax.annotation.Nullable + private OffsetDateTime profileModifiedDate; + + public static final String SERIALIZED_NAME_LAST_LOGIN_DATE = "LastLoginDate"; + @SerializedName(SERIALIZED_NAME_LAST_LOGIN_DATE) + @javax.annotation.Nullable + private OffsetDateTime lastLoginDate; + + public static final String SERIALIZED_NAME_SIGNUP_DATE = "SignupDate"; + @SerializedName(SERIALIZED_NAME_SIGNUP_DATE) + @javax.annotation.Nullable + private OffsetDateTime signupDate; + + public static final String SERIALIZED_NAME_PRIVACY_POLICY = "PrivacyPolicy"; + @SerializedName(SERIALIZED_NAME_PRIVACY_POLICY) + @javax.annotation.Nullable + private ProfilePrivacyPolicy privacyPolicy; + + public static final String SERIALIZED_NAME_COUNTRY = "Country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + @javax.annotation.Nullable + private ProfileCountry country; + + public static final String SERIALIZED_NAME_AGE_RANGE = "AgeRange"; + @SerializedName(SERIALIZED_NAME_AGE_RANGE) + @javax.annotation.Nullable + private ProfileAgeRange ageRange; + + public static final String SERIALIZED_NAME_KLOUT_SCORE = "KloutScore"; + @SerializedName(SERIALIZED_NAME_KLOUT_SCORE) + @javax.annotation.Nullable + private ProfileKloutScore kloutScore; + + public static final String SERIALIZED_NAME_SUGGESTIONS = "Suggestions"; + @SerializedName(SERIALIZED_NAME_SUGGESTIONS) + @javax.annotation.Nullable + private ProfileSuggestions suggestions; + + public static final String SERIALIZED_NAME_SUBSCRIPTION = "Subscription"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION) + @javax.annotation.Nullable + private ProfileSubscription subscription; + + public static final String SERIALIZED_NAME_P_I_N = "PIN"; + @SerializedName(SERIALIZED_NAME_P_I_N) + @javax.annotation.Nullable + private ProfilePIN PIN; + + public static final String SERIALIZED_NAME_CONSENT_PROFILE = "ConsentProfile"; + @SerializedName(SERIALIZED_NAME_CONSENT_PROFILE) + @javax.annotation.Nullable + private ProfileConsentProfile consentProfile; + + public static final String SERIALIZED_NAME_REGISTRATION_DATA = "RegistrationData"; + @SerializedName(SERIALIZED_NAME_REGISTRATION_DATA) + @javax.annotation.Nullable + private ProfileRegistrationData registrationData; + + public static final String SERIALIZED_NAME_PROVIDER_ACCESS_CREDENTIAL = "ProviderAccessCredential"; + @SerializedName(SERIALIZED_NAME_PROVIDER_ACCESS_CREDENTIAL) + @javax.annotation.Nullable + private ProfileProviderAccessCredential providerAccessCredential; + + public static final String SERIALIZED_NAME_CUSTOM_FIELDS = "CustomFields"; + @SerializedName(SERIALIZED_NAME_CUSTOM_FIELDS) + @javax.annotation.Nullable + private Map<String, String> customFields; + + public static final String SERIALIZED_NAME_PROFILE_IMAGE_URLS = "ProfileImageUrls"; + @SerializedName(SERIALIZED_NAME_PROFILE_IMAGE_URLS) + @javax.annotation.Nullable + private Map<String, String> profileImageUrls; + + public static final String SERIALIZED_NAME_WEB_PROFILES = "WebProfiles"; + @SerializedName(SERIALIZED_NAME_WEB_PROFILES) + @javax.annotation.Nullable + private Map<String, String> webProfiles; + + public static final String SERIALIZED_NAME_ROLES = "Roles"; + @SerializedName(SERIALIZED_NAME_ROLES) + @javax.annotation.Nullable + private List<String> roles; + + public static final String SERIALIZED_NAME_UID = "Uid"; + @SerializedName(SERIALIZED_NAME_UID) + @javax.annotation.Nullable + private String uid; + + public static final String SERIALIZED_NAME_PREVIOUS_UIDS = "PreviousUids"; + @SerializedName(SERIALIZED_NAME_PREVIOUS_UIDS) + @javax.annotation.Nullable + private List<String> previousUids; + + public static final String SERIALIZED_NAME_INTERESTED_IN = "InterestedIn"; + @SerializedName(SERIALIZED_NAME_INTERESTED_IN) + @javax.annotation.Nullable + private List<String> interestedIn; + + public static final String SERIALIZED_NAME_EXTERNAL_IDS = "ExternalIds"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_IDS) + @javax.annotation.Nullable + private List<ProfileExternalIdsInner> externalIds; + + public static final String SERIALIZED_NAME_UNVERIFIED_EMAIL = "UnverifiedEmail"; + @SerializedName(SERIALIZED_NAME_UNVERIFIED_EMAIL) + @javax.annotation.Nullable + private List<ProfileUnverifiedEmailInner> unverifiedEmail; + + public static final String SERIALIZED_NAME_POSITIONS = "Positions"; + @SerializedName(SERIALIZED_NAME_POSITIONS) + @javax.annotation.Nullable + private List<ProfilePositionsInner> positions; + + public static final String SERIALIZED_NAME_EDUCATIONS = "Educations"; + @SerializedName(SERIALIZED_NAME_EDUCATIONS) + @javax.annotation.Nullable + private List<ProfileEducationsInner> educations; + + public static final String SERIALIZED_NAME_PHONE_NUMBERS = "PhoneNumbers"; + @SerializedName(SERIALIZED_NAME_PHONE_NUMBERS) + @javax.annotation.Nullable + private List<ProfilePhoneNumbersInner> phoneNumbers; + + public static final String SERIALIZED_NAME_IM_ACCOUNTS = "IMAccounts"; + @SerializedName(SERIALIZED_NAME_IM_ACCOUNTS) + @javax.annotation.Nullable + private List<ProfileIMAccountsInner> imAccounts; + + public static final String SERIALIZED_NAME_ADDRESSES = "Addresses"; + @SerializedName(SERIALIZED_NAME_ADDRESSES) + @javax.annotation.Nullable + private List<ProfileAddressesInner> addresses; + + public static final String SERIALIZED_NAME_INTERESTS = "Interests"; + @SerializedName(SERIALIZED_NAME_INTERESTS) + @javax.annotation.Nullable + private List<ProfileInterestsInner> interests; + + public static final String SERIALIZED_NAME_SPORTS = "Sports"; + @SerializedName(SERIALIZED_NAME_SPORTS) + @javax.annotation.Nullable + private List<ProfileSportsInner> sports; + + public static final String SERIALIZED_NAME_INSPIRATIONAL_PEOPLE = "InspirationalPeople"; + @SerializedName(SERIALIZED_NAME_INSPIRATIONAL_PEOPLE) + @javax.annotation.Nullable + private List<ProfileInspirationalPeopleInner> inspirationalPeople; + + public static final String SERIALIZED_NAME_AWARDS = "Awards"; + @SerializedName(SERIALIZED_NAME_AWARDS) + @javax.annotation.Nullable + private List<ProfileAwardsInner> awards; + + public static final String SERIALIZED_NAME_SKILLS = "Skills"; + @SerializedName(SERIALIZED_NAME_SKILLS) + @javax.annotation.Nullable + private List<ProfileSkillsInner> skills; + + public static final String SERIALIZED_NAME_CURRENT_STATUS = "CurrentStatus"; + @SerializedName(SERIALIZED_NAME_CURRENT_STATUS) + @javax.annotation.Nullable + private List<ProfileCurrentStatusInner> currentStatus; + + public static final String SERIALIZED_NAME_CERTIFICATIONS = "Certifications"; + @SerializedName(SERIALIZED_NAME_CERTIFICATIONS) + @javax.annotation.Nullable + private List<ProfileCertificationsInner> certifications; + + public static final String SERIALIZED_NAME_COURSES = "Courses"; + @SerializedName(SERIALIZED_NAME_COURSES) + @javax.annotation.Nullable + private List<ProfileCoursesInner> courses; + + public static final String SERIALIZED_NAME_VOLUNTEER = "Volunteer"; + @SerializedName(SERIALIZED_NAME_VOLUNTEER) + @javax.annotation.Nullable + private List<ProfileVolunteerInner> volunteer; + + public static final String SERIALIZED_NAME_RECOMMENDATIONS_RECEIVED = "RecommendationsReceived"; + @SerializedName(SERIALIZED_NAME_RECOMMENDATIONS_RECEIVED) + @javax.annotation.Nullable + private List<ProfileRecommendationsReceivedInner> recommendationsReceived; + + public static final String SERIALIZED_NAME_LANGUAGES = "Languages"; + @SerializedName(SERIALIZED_NAME_LANGUAGES) + @javax.annotation.Nullable + private List<ProfileLanguagesInner> languages; + + public static final String SERIALIZED_NAME_PROJECTS = "Projects"; + @SerializedName(SERIALIZED_NAME_PROJECTS) + @javax.annotation.Nullable + private List<ProfileProjectsInner> projects; + + public static final String SERIALIZED_NAME_GAMES = "Games"; + @SerializedName(SERIALIZED_NAME_GAMES) + @javax.annotation.Nullable + private List<ProfileGamesInner> games; + + public static final String SERIALIZED_NAME_FAMILY = "Family"; + @SerializedName(SERIALIZED_NAME_FAMILY) + @javax.annotation.Nullable + private List<ProfileFamilyInner> family; + + public static final String SERIALIZED_NAME_TELEVISION_SHOW = "TelevisionShow"; + @SerializedName(SERIALIZED_NAME_TELEVISION_SHOW) + @javax.annotation.Nullable + private List<ProfileTelevisionShowInner> televisionShow; + + public static final String SERIALIZED_NAME_MUTUAL_FRIENDS = "MutualFriends"; + @SerializedName(SERIALIZED_NAME_MUTUAL_FRIENDS) + @javax.annotation.Nullable + private List<ProfileMutualFriendsInner> mutualFriends; + + public static final String SERIALIZED_NAME_MOVIES = "Movies"; + @SerializedName(SERIALIZED_NAME_MOVIES) + @javax.annotation.Nullable + private List<ProfileMoviesInner> movies; + + public static final String SERIALIZED_NAME_BOOKS = "Books"; + @SerializedName(SERIALIZED_NAME_BOOKS) + @javax.annotation.Nullable + private List<ProfileBooksInner> books; + + public static final String SERIALIZED_NAME_PATENTS = "Patents"; + @SerializedName(SERIALIZED_NAME_PATENTS) + @javax.annotation.Nullable + private List<ProfilePatentsInner> patents; + + public static final String SERIALIZED_NAME_FAVORITE_THINGS = "FavoriteThings"; + @SerializedName(SERIALIZED_NAME_FAVORITE_THINGS) + @javax.annotation.Nullable + private List<ProfileFavoriteThingsInner> favoriteThings; + + public static final String SERIALIZED_NAME_RELATED_PROFILE_VIEWS = "RelatedProfileViews"; + @SerializedName(SERIALIZED_NAME_RELATED_PROFILE_VIEWS) + @javax.annotation.Nullable + private List<ProfileRelatedProfileViewsInner> relatedProfileViews; + + public static final String SERIALIZED_NAME_PLACES_LIVED = "PlacesLived"; + @SerializedName(SERIALIZED_NAME_PLACES_LIVED) + @javax.annotation.Nullable + private List<ProfilePlacesLivedInner> placesLived; + + public static final String SERIALIZED_NAME_PUBLICATIONS = "Publications"; + @SerializedName(SERIALIZED_NAME_PUBLICATIONS) + @javax.annotation.Nullable + private List<ProfilePublicationsInner> publications; + + public static final String SERIALIZED_NAME_JOB_BOOKMARKS = "JobBookmarks"; + @SerializedName(SERIALIZED_NAME_JOB_BOOKMARKS) + @javax.annotation.Nullable + private List<ProfileJobBookmarksInner> jobBookmarks; + + public static final String SERIALIZED_NAME_BADGES = "Badges"; + @SerializedName(SERIALIZED_NAME_BADGES) + @javax.annotation.Nullable + private List<ProfileBadgesInner> badges; + + public static final String SERIALIZED_NAME_MEMBER_URL_RESOURCES = "MemberUrlResources"; + @SerializedName(SERIALIZED_NAME_MEMBER_URL_RESOURCES) + @javax.annotation.Nullable + private List<ProfileMemberUrlResourcesInner> memberUrlResources; + + public static final String SERIALIZED_NAME_ORGANIZATIONS = "Organizations"; + @SerializedName(SERIALIZED_NAME_ORGANIZATIONS) + @javax.annotation.Nullable + private List<ProfileOrganizationsInner> organizations; + + public static final String SERIALIZED_NAME_OBJECT_ID = "ObjectId"; + @SerializedName(SERIALIZED_NAME_OBJECT_ID) + @javax.annotation.Nullable + private String objectId; + + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private List<ProfileEmailInner> email; + + public static final String SERIALIZED_NAME_PASSKEY_LOGIN = "PasskeyLogin"; + @SerializedName(SERIALIZED_NAME_PASSKEY_LOGIN) + @javax.annotation.Nullable + private IdentityPasskeyLogin passkeyLogin; + + public static final String SERIALIZED_NAME_IDENTITIES = "Identities"; + @SerializedName(SERIALIZED_NAME_IDENTITIES) + @javax.annotation.Nullable + private List<SocialIdentity> identities; + + public IdentityResponseWithSocialWithoutLogins() { + } + + public IdentityResponseWithSocialWithoutLogins isPasswordBreached(@javax.annotation.Nullable Boolean isPasswordBreached) { + this.isPasswordBreached = isPasswordBreached; + return this; + } + + /** + * Indicates if the Password has been breached. + * @return isPasswordBreached + */ + @javax.annotation.Nullable + public Boolean getIsPasswordBreached() { + return isPasswordBreached; + } + + public void setIsPasswordBreached(@javax.annotation.Nullable Boolean isPasswordBreached) { + this.isPasswordBreached = isPasswordBreached; + } + + + public IdentityResponseWithSocialWithoutLogins isActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Indicates if the User Account is active. + * @return isActive + */ + @javax.annotation.Nullable + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + } + + + public IdentityResponseWithSocialWithoutLogins isDeleted(@javax.annotation.Nullable Boolean isDeleted) { + this.isDeleted = isDeleted; + return this; + } + + /** + * Indicates if the User Account is deleted. + * @return isDeleted + */ + @javax.annotation.Nullable + public Boolean getIsDeleted() { + return isDeleted; + } + + public void setIsDeleted(@javax.annotation.Nullable Boolean isDeleted) { + this.isDeleted = isDeleted; + } + + + public IdentityResponseWithSocialWithoutLogins emailVerified(@javax.annotation.Nullable Boolean emailVerified) { + this.emailVerified = emailVerified; + return this; + } + + /** + * Indicates if the User's Email is verified. + * @return emailVerified + */ + @javax.annotation.Nullable + public Boolean getEmailVerified() { + return emailVerified; + } + + public void setEmailVerified(@javax.annotation.Nullable Boolean emailVerified) { + this.emailVerified = emailVerified; + } + + + public IdentityResponseWithSocialWithoutLogins isLoginLocked(@javax.annotation.Nullable Boolean isLoginLocked) { + this.isLoginLocked = isLoginLocked; + return this; + } + + /** + * Indicates if the User's login is locked. + * @return isLoginLocked + */ + @javax.annotation.Nullable + public Boolean getIsLoginLocked() { + return isLoginLocked; + } + + public void setIsLoginLocked(@javax.annotation.Nullable Boolean isLoginLocked) { + this.isLoginLocked = isLoginLocked; + } + + + public IdentityResponseWithSocialWithoutLogins isRequiredFieldsFilledOnce(@javax.annotation.Nullable Boolean isRequiredFieldsFilledOnce) { + this.isRequiredFieldsFilledOnce = isRequiredFieldsFilledOnce; + return this; + } + + /** + * Indicates if required fields have been filled at least once. + * @return isRequiredFieldsFilledOnce + */ + @javax.annotation.Nullable + public Boolean getIsRequiredFieldsFilledOnce() { + return isRequiredFieldsFilledOnce; + } + + public void setIsRequiredFieldsFilledOnce(@javax.annotation.Nullable Boolean isRequiredFieldsFilledOnce) { + this.isRequiredFieldsFilledOnce = isRequiredFieldsFilledOnce; + } + + + public IdentityResponseWithSocialWithoutLogins firstLogin(@javax.annotation.Nullable Boolean firstLogin) { + this.firstLogin = firstLogin; + return this; + } + + /** + * Indicates if this is the User's first login. + * @return firstLogin + */ + @javax.annotation.Nullable + public Boolean getFirstLogin() { + return firstLogin; + } + + public void setFirstLogin(@javax.annotation.Nullable Boolean firstLogin) { + this.firstLogin = firstLogin; + } + + + public IdentityResponseWithSocialWithoutLogins isProtected(@javax.annotation.Nullable Boolean isProtected) { + this.isProtected = isProtected; + return this; + } + + /** + * Indicates if the User Account is protected. + * @return isProtected + */ + @javax.annotation.Nullable + public Boolean getIsProtected() { + return isProtected; + } + + public void setIsProtected(@javax.annotation.Nullable Boolean isProtected) { + this.isProtected = isProtected; + } + + + public IdentityResponseWithSocialWithoutLogins hireable(@javax.annotation.Nullable Boolean hireable) { + this.hireable = hireable; + return this; + } + + /** + * Indicates if the User is hireable. + * @return hireable + */ + @javax.annotation.Nullable + public Boolean getHireable() { + return hireable; + } + + public void setHireable(@javax.annotation.Nullable Boolean hireable) { + this.hireable = hireable; + } + + + public IdentityResponseWithSocialWithoutLogins isSecurePassword(@javax.annotation.Nullable Boolean isSecurePassword) { + this.isSecurePassword = isSecurePassword; + return this; + } + + /** + * Indicates if the Password is secure. + * @return isSecurePassword + */ + @javax.annotation.Nullable + public Boolean getIsSecurePassword() { + return isSecurePassword; + } + + public void setIsSecurePassword(@javax.annotation.Nullable Boolean isSecurePassword) { + this.isSecurePassword = isSecurePassword; + } + + + public IdentityResponseWithSocialWithoutLogins isCustomUid(@javax.annotation.Nullable Boolean isCustomUid) { + this.isCustomUid = isCustomUid; + return this; + } + + /** + * Indicates if the UID is custom. + * @return isCustomUid + */ + @javax.annotation.Nullable + public Boolean getIsCustomUid() { + return isCustomUid; + } + + public void setIsCustomUid(@javax.annotation.Nullable Boolean isCustomUid) { + this.isCustomUid = isCustomUid; + } + + + public IdentityResponseWithSocialWithoutLogins phoneIdVerified(@javax.annotation.Nullable Boolean phoneIdVerified) { + this.phoneIdVerified = phoneIdVerified; + return this; + } + + /** + * Indicates if the Phone ID is verified. + * @return phoneIdVerified + */ + @javax.annotation.Nullable + public Boolean getPhoneIdVerified() { + return phoneIdVerified; + } + + public void setPhoneIdVerified(@javax.annotation.Nullable Boolean phoneIdVerified) { + this.phoneIdVerified = phoneIdVerified; + } + + + public IdentityResponseWithSocialWithoutLogins isEmailSubscribed(@javax.annotation.Nullable Boolean isEmailSubscribed) { + this.isEmailSubscribed = isEmailSubscribed; + return this; + } + + /** + * Indicates if the User is subscribed to emails. + * @return isEmailSubscribed + */ + @javax.annotation.Nullable + public Boolean getIsEmailSubscribed() { + return isEmailSubscribed; + } + + public void setIsEmailSubscribed(@javax.annotation.Nullable Boolean isEmailSubscribed) { + this.isEmailSubscribed = isEmailSubscribed; + } + + + public IdentityResponseWithSocialWithoutLogins noOfLogins(@javax.annotation.Nullable Integer noOfLogins) { + this.noOfLogins = noOfLogins; + return this; + } + + /** + * Number of logins by the User. + * @return noOfLogins + */ + @javax.annotation.Nullable + public Integer getNoOfLogins() { + return noOfLogins; + } + + public void setNoOfLogins(@javax.annotation.Nullable Integer noOfLogins) { + this.noOfLogins = noOfLogins; + } + + + public IdentityResponseWithSocialWithoutLogins followersCount(@javax.annotation.Nullable Integer followersCount) { + this.followersCount = followersCount; + return this; + } + + /** + * Number of followers the User has. + * @return followersCount + */ + @javax.annotation.Nullable + public Integer getFollowersCount() { + return followersCount; + } + + public void setFollowersCount(@javax.annotation.Nullable Integer followersCount) { + this.followersCount = followersCount; + } + + + public IdentityResponseWithSocialWithoutLogins friendsCount(@javax.annotation.Nullable Integer friendsCount) { + this.friendsCount = friendsCount; + return this; + } + + /** + * Number of friends the User has. + * @return friendsCount + */ + @javax.annotation.Nullable + public Integer getFriendsCount() { + return friendsCount; + } + + public void setFriendsCount(@javax.annotation.Nullable Integer friendsCount) { + this.friendsCount = friendsCount; + } + + + public IdentityResponseWithSocialWithoutLogins totalStatusesCount(@javax.annotation.Nullable Integer totalStatusesCount) { + this.totalStatusesCount = totalStatusesCount; + return this; + } + + /** + * Total number of statuses posted by the User. + * @return totalStatusesCount + */ + @javax.annotation.Nullable + public Integer getTotalStatusesCount() { + return totalStatusesCount; + } + + public void setTotalStatusesCount(@javax.annotation.Nullable Integer totalStatusesCount) { + this.totalStatusesCount = totalStatusesCount; + } + + + public IdentityResponseWithSocialWithoutLogins numRecommenders(@javax.annotation.Nullable Integer numRecommenders) { + this.numRecommenders = numRecommenders; + return this; + } + + /** + * Number of recommenders for the User. + * @return numRecommenders + */ + @javax.annotation.Nullable + public Integer getNumRecommenders() { + return numRecommenders; + } + + public void setNumRecommenders(@javax.annotation.Nullable Integer numRecommenders) { + this.numRecommenders = numRecommenders; + } + + + public IdentityResponseWithSocialWithoutLogins totalPrivateRepository(@javax.annotation.Nullable Integer totalPrivateRepository) { + this.totalPrivateRepository = totalPrivateRepository; + return this; + } + + /** + * Total number of private repositories. + * @return totalPrivateRepository + */ + @javax.annotation.Nullable + public Integer getTotalPrivateRepository() { + return totalPrivateRepository; + } + + public void setTotalPrivateRepository(@javax.annotation.Nullable Integer totalPrivateRepository) { + this.totalPrivateRepository = totalPrivateRepository; + } + + + public IdentityResponseWithSocialWithoutLogins publicGists(@javax.annotation.Nullable Integer publicGists) { + this.publicGists = publicGists; + return this; + } + + /** + * Total number of public gists. + * @return publicGists + */ + @javax.annotation.Nullable + public Integer getPublicGists() { + return publicGists; + } + + public void setPublicGists(@javax.annotation.Nullable Integer publicGists) { + this.publicGists = publicGists; + } + + + public IdentityResponseWithSocialWithoutLogins privateGists(@javax.annotation.Nullable Integer privateGists) { + this.privateGists = privateGists; + return this; + } + + /** + * Total number of private gists. + * @return privateGists + */ + @javax.annotation.Nullable + public Integer getPrivateGists() { + return privateGists; + } + + public void setPrivateGists(@javax.annotation.Nullable Integer privateGists) { + this.privateGists = privateGists; + } + + + public IdentityResponseWithSocialWithoutLogins pinsCount(@javax.annotation.Nullable Integer pinsCount) { + this.pinsCount = pinsCount; + return this; + } + + /** + * Total number of PINs. + * @return pinsCount + */ + @javax.annotation.Nullable + public Integer getPinsCount() { + return pinsCount; + } + + public void setPinsCount(@javax.annotation.Nullable Integer pinsCount) { + this.pinsCount = pinsCount; + } + + + public IdentityResponseWithSocialWithoutLogins boardsCount(@javax.annotation.Nullable Integer boardsCount) { + this.boardsCount = boardsCount; + return this; + } + + /** + * Total number of boards. + * @return boardsCount + */ + @javax.annotation.Nullable + public Integer getBoardsCount() { + return boardsCount; + } + + public void setBoardsCount(@javax.annotation.Nullable Integer boardsCount) { + this.boardsCount = boardsCount; + } + + + public IdentityResponseWithSocialWithoutLogins likesCount(@javax.annotation.Nullable Integer likesCount) { + this.likesCount = likesCount; + return this; + } + + /** + * Total number of likes. + * @return likesCount + */ + @javax.annotation.Nullable + public Integer getLikesCount() { + return likesCount; + } + + public void setLikesCount(@javax.annotation.Nullable Integer likesCount) { + this.likesCount = likesCount; + } + + + public IdentityResponseWithSocialWithoutLogins ID(@javax.annotation.Nullable String ID) { + this.ID = ID; + return this; + } + + /** + * Unique identifier for the User Profile. + * @return ID + */ + @javax.annotation.Nullable + public String getID() { + return ID; + } + + public void setID(@javax.annotation.Nullable String ID) { + this.ID = ID; + } + + + public IdentityResponseWithSocialWithoutLogins provider(@javax.annotation.Nullable String provider) { + this.provider = provider; + return this; + } + + /** + * Provider of the User Profile. + * @return provider + */ + @javax.annotation.Nullable + public String getProvider() { + return provider; + } + + public void setProvider(@javax.annotation.Nullable String provider) { + this.provider = provider; + } + + + public IdentityResponseWithSocialWithoutLogins fullName(@javax.annotation.Nullable String fullName) { + this.fullName = fullName; + return this; + } + + /** + * Full name of the User. + * @return fullName + */ + @javax.annotation.Nullable + public String getFullName() { + return fullName; + } + + public void setFullName(@javax.annotation.Nullable String fullName) { + this.fullName = fullName; + } + + + public IdentityResponseWithSocialWithoutLogins firstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * First name of the User. + * @return firstName + */ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + } + + + public IdentityResponseWithSocialWithoutLogins lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Last name of the User. + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + + public IdentityResponseWithSocialWithoutLogins phoneId(@javax.annotation.Nullable String phoneId) { + this.phoneId = phoneId; + return this; + } + + /** + * Phone ID of the User. + * @return phoneId + */ + @javax.annotation.Nullable + public String getPhoneId() { + return phoneId; + } + + public void setPhoneId(@javax.annotation.Nullable String phoneId) { + this.phoneId = phoneId; + } + + + public IdentityResponseWithSocialWithoutLogins userName(@javax.annotation.Nullable String userName) { + this.userName = userName; + return this; + } + + /** + * The Username of the User. + * @return userName + */ + @javax.annotation.Nullable + public String getUserName() { + return userName; + } + + public void setUserName(@javax.annotation.Nullable String userName) { + this.userName = userName; + } + + + public IdentityResponseWithSocialWithoutLogins prefix(@javax.annotation.Nullable String prefix) { + this.prefix = prefix; + return this; + } + + /** + * The prefix for the User's name. + * @return prefix + */ + @javax.annotation.Nullable + public String getPrefix() { + return prefix; + } + + public void setPrefix(@javax.annotation.Nullable String prefix) { + this.prefix = prefix; + } + + + public IdentityResponseWithSocialWithoutLogins middleName(@javax.annotation.Nullable String middleName) { + this.middleName = middleName; + return this; + } + + /** + * The middle name of the User. + * @return middleName + */ + @javax.annotation.Nullable + public String getMiddleName() { + return middleName; + } + + public void setMiddleName(@javax.annotation.Nullable String middleName) { + this.middleName = middleName; + } + + + public IdentityResponseWithSocialWithoutLogins suffix(@javax.annotation.Nullable String suffix) { + this.suffix = suffix; + return this; + } + + /** + * The suffix for the User's name. + * @return suffix + */ + @javax.annotation.Nullable + public String getSuffix() { + return suffix; + } + + public void setSuffix(@javax.annotation.Nullable String suffix) { + this.suffix = suffix; + } + + + public IdentityResponseWithSocialWithoutLogins nickName(@javax.annotation.Nullable String nickName) { + this.nickName = nickName; + return this; + } + + /** + * The nickname of the User. + * @return nickName + */ + @javax.annotation.Nullable + public String getNickName() { + return nickName; + } + + public void setNickName(@javax.annotation.Nullable String nickName) { + this.nickName = nickName; + } + + + public IdentityResponseWithSocialWithoutLogins profileName(@javax.annotation.Nullable String profileName) { + this.profileName = profileName; + return this; + } + + /** + * The profile name of the User. + * @return profileName + */ + @javax.annotation.Nullable + public String getProfileName() { + return profileName; + } + + public void setProfileName(@javax.annotation.Nullable String profileName) { + this.profileName = profileName; + } + + + public IdentityResponseWithSocialWithoutLogins birthDate(@javax.annotation.Nullable String birthDate) { + this.birthDate = birthDate; + return this; + } + + /** + * The birth date of the User. + * @return birthDate + */ + @javax.annotation.Nullable + public String getBirthDate() { + return birthDate; + } + + public void setBirthDate(@javax.annotation.Nullable String birthDate) { + this.birthDate = birthDate; + } + + + public IdentityResponseWithSocialWithoutLogins gender(@javax.annotation.Nullable String gender) { + this.gender = gender; + return this; + } + + /** + * The gender of the User. + * @return gender + */ + @javax.annotation.Nullable + public String getGender() { + return gender; + } + + public void setGender(@javax.annotation.Nullable String gender) { + this.gender = gender; + } + + + public IdentityResponseWithSocialWithoutLogins website(@javax.annotation.Nullable String website) { + this.website = website; + return this; + } + + /** + * The website of the User. + * @return website + */ + @javax.annotation.Nullable + public String getWebsite() { + return website; + } + + public void setWebsite(@javax.annotation.Nullable String website) { + this.website = website; + } + + + public IdentityResponseWithSocialWithoutLogins thumbnailImageUrl(@javax.annotation.Nullable String thumbnailImageUrl) { + this.thumbnailImageUrl = thumbnailImageUrl; + return this; + } + + /** + * The URL of the User's thumbnail image. + * @return thumbnailImageUrl + */ + @javax.annotation.Nullable + public String getThumbnailImageUrl() { + return thumbnailImageUrl; + } + + public void setThumbnailImageUrl(@javax.annotation.Nullable String thumbnailImageUrl) { + this.thumbnailImageUrl = thumbnailImageUrl; + } + + + public IdentityResponseWithSocialWithoutLogins imageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** + * The URL of the User's profile image. + * @return imageUrl + */ + @javax.annotation.Nullable + public String getImageUrl() { + return imageUrl; + } + + public void setImageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + } + + + public IdentityResponseWithSocialWithoutLogins favicon(@javax.annotation.Nullable String favicon) { + this.favicon = favicon; + return this; + } + + /** + * The URL of the User's favicon. + * @return favicon + */ + @javax.annotation.Nullable + public String getFavicon() { + return favicon; + } + + public void setFavicon(@javax.annotation.Nullable String favicon) { + this.favicon = favicon; + } + + + public IdentityResponseWithSocialWithoutLogins profileUrl(@javax.annotation.Nullable String profileUrl) { + this.profileUrl = profileUrl; + return this; + } + + /** + * The URL of the User's profile. + * @return profileUrl + */ + @javax.annotation.Nullable + public String getProfileUrl() { + return profileUrl; + } + + public void setProfileUrl(@javax.annotation.Nullable String profileUrl) { + this.profileUrl = profileUrl; + } + + + public IdentityResponseWithSocialWithoutLogins homeTown(@javax.annotation.Nullable String homeTown) { + this.homeTown = homeTown; + return this; + } + + /** + * The hometown of the User. + * @return homeTown + */ + @javax.annotation.Nullable + public String getHomeTown() { + return homeTown; + } + + public void setHomeTown(@javax.annotation.Nullable String homeTown) { + this.homeTown = homeTown; + } + + + public IdentityResponseWithSocialWithoutLogins state(@javax.annotation.Nullable String state) { + this.state = state; + return this; + } + + /** + * The state of the User. + * @return state + */ + @javax.annotation.Nullable + public String getState() { + return state; + } + + public void setState(@javax.annotation.Nullable String state) { + this.state = state; + } + + + public IdentityResponseWithSocialWithoutLogins city(@javax.annotation.Nullable String city) { + this.city = city; + return this; + } + + /** + * The city of the User. + * @return city + */ + @javax.annotation.Nullable + public String getCity() { + return city; + } + + public void setCity(@javax.annotation.Nullable String city) { + this.city = city; + } + + + public IdentityResponseWithSocialWithoutLogins industry(@javax.annotation.Nullable String industry) { + this.industry = industry; + return this; + } + + /** + * The industry of the User. + * @return industry + */ + @javax.annotation.Nullable + public String getIndustry() { + return industry; + } + + public void setIndustry(@javax.annotation.Nullable String industry) { + this.industry = industry; + } + + + public IdentityResponseWithSocialWithoutLogins about(@javax.annotation.Nullable String about) { + this.about = about; + return this; + } + + /** + * A brief description about the User. + * @return about + */ + @javax.annotation.Nullable + public String getAbout() { + return about; + } + + public void setAbout(@javax.annotation.Nullable String about) { + this.about = about; + } + + + public IdentityResponseWithSocialWithoutLogins timeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * The time zone of the User. + * @return timeZone + */ + @javax.annotation.Nullable + public String getTimeZone() { + return timeZone; + } + + public void setTimeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + } + + + public IdentityResponseWithSocialWithoutLogins localLanguage(@javax.annotation.Nullable String localLanguage) { + this.localLanguage = localLanguage; + return this; + } + + /** + * The local language of the User. + * @return localLanguage + */ + @javax.annotation.Nullable + public String getLocalLanguage() { + return localLanguage; + } + + public void setLocalLanguage(@javax.annotation.Nullable String localLanguage) { + this.localLanguage = localLanguage; + } + + + public IdentityResponseWithSocialWithoutLogins coverPhoto(@javax.annotation.Nullable String coverPhoto) { + this.coverPhoto = coverPhoto; + return this; + } + + /** + * The URL of the User's cover photo. + * @return coverPhoto + */ + @javax.annotation.Nullable + public String getCoverPhoto() { + return coverPhoto; + } + + public void setCoverPhoto(@javax.annotation.Nullable String coverPhoto) { + this.coverPhoto = coverPhoto; + } + + + public IdentityResponseWithSocialWithoutLogins tagLine(@javax.annotation.Nullable String tagLine) { + this.tagLine = tagLine; + return this; + } + + /** + * The tagline of the User. + * @return tagLine + */ + @javax.annotation.Nullable + public String getTagLine() { + return tagLine; + } + + public void setTagLine(@javax.annotation.Nullable String tagLine) { + this.tagLine = tagLine; + } + + + public IdentityResponseWithSocialWithoutLogins language(@javax.annotation.Nullable String language) { + this.language = language; + return this; + } + + /** + * The language of the User. + * @return language + */ + @javax.annotation.Nullable + public String getLanguage() { + return language; + } + + public void setLanguage(@javax.annotation.Nullable String language) { + this.language = language; + } + + + public IdentityResponseWithSocialWithoutLogins verified(@javax.annotation.Nullable String verified) { + this.verified = verified; + return this; + } + + /** + * Indicates if the User is verified. + * @return verified + */ + @javax.annotation.Nullable + public String getVerified() { + return verified; + } + + public void setVerified(@javax.annotation.Nullable String verified) { + this.verified = verified; + } + + + public IdentityResponseWithSocialWithoutLogins updatedTime(@javax.annotation.Nullable String updatedTime) { + this.updatedTime = updatedTime; + return this; + } + + /** + * The last updated time of the User's profile. + * @return updatedTime + */ + @javax.annotation.Nullable + public String getUpdatedTime() { + return updatedTime; + } + + public void setUpdatedTime(@javax.annotation.Nullable String updatedTime) { + this.updatedTime = updatedTime; + } + + + public IdentityResponseWithSocialWithoutLogins isGeoEnabled(@javax.annotation.Nullable String isGeoEnabled) { + this.isGeoEnabled = isGeoEnabled; + return this; + } + + /** + * Indicates if geolocation is enabled for the User. + * @return isGeoEnabled + */ + @javax.annotation.Nullable + public String getIsGeoEnabled() { + return isGeoEnabled; + } + + public void setIsGeoEnabled(@javax.annotation.Nullable String isGeoEnabled) { + this.isGeoEnabled = isGeoEnabled; + } + + + public IdentityResponseWithSocialWithoutLogins associations(@javax.annotation.Nullable String associations) { + this.associations = associations; + return this; + } + + /** + * The associations of the User. + * @return associations + */ + @javax.annotation.Nullable + public String getAssociations() { + return associations; + } + + public void setAssociations(@javax.annotation.Nullable String associations) { + this.associations = associations; + } + + + public IdentityResponseWithSocialWithoutLogins honors(@javax.annotation.Nullable String honors) { + this.honors = honors; + return this; + } + + /** + * The honors received by the User. + * @return honors + */ + @javax.annotation.Nullable + public String getHonors() { + return honors; + } + + public void setHonors(@javax.annotation.Nullable String honors) { + this.honors = honors; + } + + + public IdentityResponseWithSocialWithoutLogins httpsImageUrl(@javax.annotation.Nullable String httpsImageUrl) { + this.httpsImageUrl = httpsImageUrl; + return this; + } + + /** + * The HTTPS URL of the User's profile image. + * @return httpsImageUrl + */ + @javax.annotation.Nullable + public String getHttpsImageUrl() { + return httpsImageUrl; + } + + public void setHttpsImageUrl(@javax.annotation.Nullable String httpsImageUrl) { + this.httpsImageUrl = httpsImageUrl; + } + + + public IdentityResponseWithSocialWithoutLogins mainAddress(@javax.annotation.Nullable String mainAddress) { + this.mainAddress = mainAddress; + return this; + } + + /** + * The main address of the User. + * @return mainAddress + */ + @javax.annotation.Nullable + public String getMainAddress() { + return mainAddress; + } + + public void setMainAddress(@javax.annotation.Nullable String mainAddress) { + this.mainAddress = mainAddress; + } + + + public IdentityResponseWithSocialWithoutLogins created(@javax.annotation.Nullable String created) { + this.created = created; + return this; + } + + /** + * The creation date of the User's account. + * @return created + */ + @javax.annotation.Nullable + public String getCreated() { + return created; + } + + public void setCreated(@javax.annotation.Nullable String created) { + this.created = created; + } + + + public IdentityResponseWithSocialWithoutLogins localCity(@javax.annotation.Nullable String localCity) { + this.localCity = localCity; + return this; + } + + /** + * The local city of the User. + * @return localCity + */ + @javax.annotation.Nullable + public String getLocalCity() { + return localCity; + } + + public void setLocalCity(@javax.annotation.Nullable String localCity) { + this.localCity = localCity; + } + + + public IdentityResponseWithSocialWithoutLogins profileCity(@javax.annotation.Nullable String profileCity) { + this.profileCity = profileCity; + return this; + } + + /** + * The profile city of the User. + * @return profileCity + */ + @javax.annotation.Nullable + public String getProfileCity() { + return profileCity; + } + + public void setProfileCity(@javax.annotation.Nullable String profileCity) { + this.profileCity = profileCity; + } + + + public IdentityResponseWithSocialWithoutLogins localCountry(@javax.annotation.Nullable String localCountry) { + this.localCountry = localCountry; + return this; + } + + /** + * The local country of the User. + * @return localCountry + */ + @javax.annotation.Nullable + public String getLocalCountry() { + return localCountry; + } + + public void setLocalCountry(@javax.annotation.Nullable String localCountry) { + this.localCountry = localCountry; + } + + + public IdentityResponseWithSocialWithoutLogins profileCountry(@javax.annotation.Nullable String profileCountry) { + this.profileCountry = profileCountry; + return this; + } + + /** + * The profile country of the User. + * @return profileCountry + */ + @javax.annotation.Nullable + public String getProfileCountry() { + return profileCountry; + } + + public void setProfileCountry(@javax.annotation.Nullable String profileCountry) { + this.profileCountry = profileCountry; + } + + + public IdentityResponseWithSocialWithoutLogins relationshipStatus(@javax.annotation.Nullable String relationshipStatus) { + this.relationshipStatus = relationshipStatus; + return this; + } + + /** + * The relationship status of the User. + * @return relationshipStatus + */ + @javax.annotation.Nullable + public String getRelationshipStatus() { + return relationshipStatus; + } + + public void setRelationshipStatus(@javax.annotation.Nullable String relationshipStatus) { + this.relationshipStatus = relationshipStatus; + } + + + public IdentityResponseWithSocialWithoutLogins quota(@javax.annotation.Nullable String quota) { + this.quota = quota; + return this; + } + + /** + * The quota assigned to the User. + * @return quota + */ + @javax.annotation.Nullable + public String getQuota() { + return quota; + } + + public void setQuota(@javax.annotation.Nullable String quota) { + this.quota = quota; + } + + + public IdentityResponseWithSocialWithoutLogins quote(@javax.annotation.Nullable String quote) { + this.quote = quote; + return this; + } + + /** + * A quote associated with the User. + * @return quote + */ + @javax.annotation.Nullable + public String getQuote() { + return quote; + } + + public void setQuote(@javax.annotation.Nullable String quote) { + this.quote = quote; + } + + + public IdentityResponseWithSocialWithoutLogins religion(@javax.annotation.Nullable String religion) { + this.religion = religion; + return this; + } + + /** + * The religion of the User. + * @return religion + */ + @javax.annotation.Nullable + public String getReligion() { + return religion; + } + + public void setReligion(@javax.annotation.Nullable String religion) { + this.religion = religion; + } + + + public IdentityResponseWithSocialWithoutLogins political(@javax.annotation.Nullable String political) { + this.political = political; + return this; + } + + /** + * The political views of the User. + * @return political + */ + @javax.annotation.Nullable + public String getPolitical() { + return political; + } + + public void setPolitical(@javax.annotation.Nullable String political) { + this.political = political; + } + + + public IdentityResponseWithSocialWithoutLogins publicRepository(@javax.annotation.Nullable String publicRepository) { + this.publicRepository = publicRepository; + return this; + } + + /** + * The number of public repositories owned by the User. + * @return publicRepository + */ + @javax.annotation.Nullable + public String getPublicRepository() { + return publicRepository; + } + + public void setPublicRepository(@javax.annotation.Nullable String publicRepository) { + this.publicRepository = publicRepository; + } + + + public IdentityResponseWithSocialWithoutLogins repositoryUrl(@javax.annotation.Nullable String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + return this; + } + + /** + * The URL of the User's repository. + * @return repositoryUrl + */ + @javax.annotation.Nullable + public String getRepositoryUrl() { + return repositoryUrl; + } + + public void setRepositoryUrl(@javax.annotation.Nullable String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + } + + + public IdentityResponseWithSocialWithoutLogins age(@javax.annotation.Nullable String age) { + this.age = age; + return this; + } + + /** + * The age of the User. + * @return age + */ + @javax.annotation.Nullable + public String getAge() { + return age; + } + + public void setAge(@javax.annotation.Nullable String age) { + this.age = age; + } + + + public IdentityResponseWithSocialWithoutLogins professionalHeadline(@javax.annotation.Nullable String professionalHeadline) { + this.professionalHeadline = professionalHeadline; + return this; + } + + /** + * The professional headline of the User. + * @return professionalHeadline + */ + @javax.annotation.Nullable + public String getProfessionalHeadline() { + return professionalHeadline; + } + + public void setProfessionalHeadline(@javax.annotation.Nullable String professionalHeadline) { + this.professionalHeadline = professionalHeadline; + } + + + public IdentityResponseWithSocialWithoutLogins lrUserID(@javax.annotation.Nullable String lrUserID) { + this.lrUserID = lrUserID; + return this; + } + + /** + * The LoginRadius User ID. + * @return lrUserID + */ + @javax.annotation.Nullable + public String getLrUserID() { + return lrUserID; + } + + public void setLrUserID(@javax.annotation.Nullable String lrUserID) { + this.lrUserID = lrUserID; + } + + + public IdentityResponseWithSocialWithoutLogins currency(@javax.annotation.Nullable String currency) { + this.currency = currency; + return this; + } + + /** + * The preferred currency of the User. + * @return currency + */ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + public void setCurrency(@javax.annotation.Nullable String currency) { + this.currency = currency; + } + + + public IdentityResponseWithSocialWithoutLogins starredUrl(@javax.annotation.Nullable String starredUrl) { + this.starredUrl = starredUrl; + return this; + } + + /** + * The URL of the User's starred items. + * @return starredUrl + */ + @javax.annotation.Nullable + public String getStarredUrl() { + return starredUrl; + } + + public void setStarredUrl(@javax.annotation.Nullable String starredUrl) { + this.starredUrl = starredUrl; + } + + + public IdentityResponseWithSocialWithoutLogins gistsUrl(@javax.annotation.Nullable String gistsUrl) { + this.gistsUrl = gistsUrl; + return this; + } + + /** + * The URL of the User's gists. + * @return gistsUrl + */ + @javax.annotation.Nullable + public String getGistsUrl() { + return gistsUrl; + } + + public void setGistsUrl(@javax.annotation.Nullable String gistsUrl) { + this.gistsUrl = gistsUrl; + } + + + public IdentityResponseWithSocialWithoutLogins company(@javax.annotation.Nullable String company) { + this.company = company; + return this; + } + + /** + * The company the User is associated with. + * @return company + */ + @javax.annotation.Nullable + public String getCompany() { + return company; + } + + public void setCompany(@javax.annotation.Nullable String company) { + this.company = company; + } + + + public IdentityResponseWithSocialWithoutLogins gravatarImageUrl(@javax.annotation.Nullable String gravatarImageUrl) { + this.gravatarImageUrl = gravatarImageUrl; + return this; + } + + /** + * The URL of the User's Gravatar image. + * @return gravatarImageUrl + */ + @javax.annotation.Nullable + public String getGravatarImageUrl() { + return gravatarImageUrl; + } + + public void setGravatarImageUrl(@javax.annotation.Nullable String gravatarImageUrl) { + this.gravatarImageUrl = gravatarImageUrl; + } + + + public IdentityResponseWithSocialWithoutLogins lastPasswordChangeDate(@javax.annotation.Nullable OffsetDateTime lastPasswordChangeDate) { + this.lastPasswordChangeDate = lastPasswordChangeDate; + return this; + } + + /** + * The date of the last Password change. + * @return lastPasswordChangeDate + */ + @javax.annotation.Nullable + public OffsetDateTime getLastPasswordChangeDate() { + return lastPasswordChangeDate; + } + + public void setLastPasswordChangeDate(@javax.annotation.Nullable OffsetDateTime lastPasswordChangeDate) { + this.lastPasswordChangeDate = lastPasswordChangeDate; + } + + + public IdentityResponseWithSocialWithoutLogins passwordExpirationDate(@javax.annotation.Nullable OffsetDateTime passwordExpirationDate) { + this.passwordExpirationDate = passwordExpirationDate; + return this; + } + + /** + * The expiration date of the Password. + * @return passwordExpirationDate + */ + @javax.annotation.Nullable + public OffsetDateTime getPasswordExpirationDate() { + return passwordExpirationDate; + } + + public void setPasswordExpirationDate(@javax.annotation.Nullable OffsetDateTime passwordExpirationDate) { + this.passwordExpirationDate = passwordExpirationDate; + } + + + public IdentityResponseWithSocialWithoutLogins createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * The date the Account was created. + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + + public IdentityResponseWithSocialWithoutLogins modifiedDate(@javax.annotation.Nullable OffsetDateTime modifiedDate) { + this.modifiedDate = modifiedDate; + return this; + } + + /** + * The date the Account was last modified. + * @return modifiedDate + */ + @javax.annotation.Nullable + public OffsetDateTime getModifiedDate() { + return modifiedDate; + } + + public void setModifiedDate(@javax.annotation.Nullable OffsetDateTime modifiedDate) { + this.modifiedDate = modifiedDate; + } + + + public IdentityResponseWithSocialWithoutLogins profileModifiedDate(@javax.annotation.Nullable OffsetDateTime profileModifiedDate) { + this.profileModifiedDate = profileModifiedDate; + return this; + } + + /** + * The date the Profile was last modified. + * @return profileModifiedDate + */ + @javax.annotation.Nullable + public OffsetDateTime getProfileModifiedDate() { + return profileModifiedDate; + } + + public void setProfileModifiedDate(@javax.annotation.Nullable OffsetDateTime profileModifiedDate) { + this.profileModifiedDate = profileModifiedDate; + } + + + public IdentityResponseWithSocialWithoutLogins lastLoginDate(@javax.annotation.Nullable OffsetDateTime lastLoginDate) { + this.lastLoginDate = lastLoginDate; + return this; + } + + /** + * The date of the last login. + * @return lastLoginDate + */ + @javax.annotation.Nullable + public OffsetDateTime getLastLoginDate() { + return lastLoginDate; + } + + public void setLastLoginDate(@javax.annotation.Nullable OffsetDateTime lastLoginDate) { + this.lastLoginDate = lastLoginDate; + } + + + public IdentityResponseWithSocialWithoutLogins signupDate(@javax.annotation.Nullable OffsetDateTime signupDate) { + this.signupDate = signupDate; + return this; + } + + /** + * The date the User signed up. + * @return signupDate + */ + @javax.annotation.Nullable + public OffsetDateTime getSignupDate() { + return signupDate; + } + + public void setSignupDate(@javax.annotation.Nullable OffsetDateTime signupDate) { + this.signupDate = signupDate; + } + + + public IdentityResponseWithSocialWithoutLogins privacyPolicy(@javax.annotation.Nullable ProfilePrivacyPolicy privacyPolicy) { + this.privacyPolicy = privacyPolicy; + return this; + } + + /** + * Get privacyPolicy + * @return privacyPolicy + */ + @javax.annotation.Nullable + public ProfilePrivacyPolicy getPrivacyPolicy() { + return privacyPolicy; + } + + public void setPrivacyPolicy(@javax.annotation.Nullable ProfilePrivacyPolicy privacyPolicy) { + this.privacyPolicy = privacyPolicy; + } + + + public IdentityResponseWithSocialWithoutLogins country(@javax.annotation.Nullable ProfileCountry country) { + this.country = country; + return this; + } + + /** + * Get country + * @return country + */ + @javax.annotation.Nullable + public ProfileCountry getCountry() { + return country; + } + + public void setCountry(@javax.annotation.Nullable ProfileCountry country) { + this.country = country; + } + + + public IdentityResponseWithSocialWithoutLogins ageRange(@javax.annotation.Nullable ProfileAgeRange ageRange) { + this.ageRange = ageRange; + return this; + } + + /** + * Get ageRange + * @return ageRange + */ + @javax.annotation.Nullable + public ProfileAgeRange getAgeRange() { + return ageRange; + } + + public void setAgeRange(@javax.annotation.Nullable ProfileAgeRange ageRange) { + this.ageRange = ageRange; + } + + + public IdentityResponseWithSocialWithoutLogins kloutScore(@javax.annotation.Nullable ProfileKloutScore kloutScore) { + this.kloutScore = kloutScore; + return this; + } + + /** + * Get kloutScore + * @return kloutScore + */ + @javax.annotation.Nullable + public ProfileKloutScore getKloutScore() { + return kloutScore; + } + + public void setKloutScore(@javax.annotation.Nullable ProfileKloutScore kloutScore) { + this.kloutScore = kloutScore; + } + + + public IdentityResponseWithSocialWithoutLogins suggestions(@javax.annotation.Nullable ProfileSuggestions suggestions) { + this.suggestions = suggestions; + return this; + } + + /** + * Get suggestions + * @return suggestions + */ + @javax.annotation.Nullable + public ProfileSuggestions getSuggestions() { + return suggestions; + } + + public void setSuggestions(@javax.annotation.Nullable ProfileSuggestions suggestions) { + this.suggestions = suggestions; + } + + + public IdentityResponseWithSocialWithoutLogins subscription(@javax.annotation.Nullable ProfileSubscription subscription) { + this.subscription = subscription; + return this; + } + + /** + * Get subscription + * @return subscription + */ + @javax.annotation.Nullable + public ProfileSubscription getSubscription() { + return subscription; + } + + public void setSubscription(@javax.annotation.Nullable ProfileSubscription subscription) { + this.subscription = subscription; + } + + + public IdentityResponseWithSocialWithoutLogins PIN(@javax.annotation.Nullable ProfilePIN PIN) { + this.PIN = PIN; + return this; + } + + /** + * Get PIN + * @return PIN + */ + @javax.annotation.Nullable + public ProfilePIN getPIN() { + return PIN; + } + + public void setPIN(@javax.annotation.Nullable ProfilePIN PIN) { + this.PIN = PIN; + } + + + public IdentityResponseWithSocialWithoutLogins consentProfile(@javax.annotation.Nullable ProfileConsentProfile consentProfile) { + this.consentProfile = consentProfile; + return this; + } + + /** + * Get consentProfile + * @return consentProfile + */ + @javax.annotation.Nullable + public ProfileConsentProfile getConsentProfile() { + return consentProfile; + } + + public void setConsentProfile(@javax.annotation.Nullable ProfileConsentProfile consentProfile) { + this.consentProfile = consentProfile; + } + + + public IdentityResponseWithSocialWithoutLogins registrationData(@javax.annotation.Nullable ProfileRegistrationData registrationData) { + this.registrationData = registrationData; + return this; + } + + /** + * Get registrationData + * @return registrationData + */ + @javax.annotation.Nullable + public ProfileRegistrationData getRegistrationData() { + return registrationData; + } + + public void setRegistrationData(@javax.annotation.Nullable ProfileRegistrationData registrationData) { + this.registrationData = registrationData; + } + + + public IdentityResponseWithSocialWithoutLogins providerAccessCredential(@javax.annotation.Nullable ProfileProviderAccessCredential providerAccessCredential) { + this.providerAccessCredential = providerAccessCredential; + return this; + } + + /** + * Get providerAccessCredential + * @return providerAccessCredential + */ + @javax.annotation.Nullable + public ProfileProviderAccessCredential getProviderAccessCredential() { + return providerAccessCredential; + } + + public void setProviderAccessCredential(@javax.annotation.Nullable ProfileProviderAccessCredential providerAccessCredential) { + this.providerAccessCredential = providerAccessCredential; + } + + + public IdentityResponseWithSocialWithoutLogins customFields(@javax.annotation.Nullable Map<String, String> customFields) { + this.customFields = customFields; + return this; + } + + public IdentityResponseWithSocialWithoutLogins putCustomFieldsItem(String key, String customFieldsItem) { + if (this.customFields == null) { + this.customFields = new HashMap<>(); + } + this.customFields.put(key, customFieldsItem); + return this; + } + + /** + * Custom fields associated with the User. + * @return customFields + */ + @javax.annotation.Nullable + public Map<String, String> getCustomFields() { + return customFields; + } + + public void setCustomFields(@javax.annotation.Nullable Map<String, String> customFields) { + this.customFields = customFields; + } + + + public IdentityResponseWithSocialWithoutLogins profileImageUrls(@javax.annotation.Nullable Map<String, String> profileImageUrls) { + this.profileImageUrls = profileImageUrls; + return this; + } + + public IdentityResponseWithSocialWithoutLogins putProfileImageUrlsItem(String key, String profileImageUrlsItem) { + if (this.profileImageUrls == null) { + this.profileImageUrls = new HashMap<>(); + } + this.profileImageUrls.put(key, profileImageUrlsItem); + return this; + } + + /** + * URLs of the User's profile images. + * @return profileImageUrls + */ + @javax.annotation.Nullable + public Map<String, String> getProfileImageUrls() { + return profileImageUrls; + } + + public void setProfileImageUrls(@javax.annotation.Nullable Map<String, String> profileImageUrls) { + this.profileImageUrls = profileImageUrls; + } + + + public IdentityResponseWithSocialWithoutLogins webProfiles(@javax.annotation.Nullable Map<String, String> webProfiles) { + this.webProfiles = webProfiles; + return this; + } + + public IdentityResponseWithSocialWithoutLogins putWebProfilesItem(String key, String webProfilesItem) { + if (this.webProfiles == null) { + this.webProfiles = new HashMap<>(); + } + this.webProfiles.put(key, webProfilesItem); + return this; + } + + /** + * The User's web profiles. + * @return webProfiles + */ + @javax.annotation.Nullable + public Map<String, String> getWebProfiles() { + return webProfiles; + } + + public void setWebProfiles(@javax.annotation.Nullable Map<String, String> webProfiles) { + this.webProfiles = webProfiles; + } + + + public IdentityResponseWithSocialWithoutLogins roles(@javax.annotation.Nullable List<String> roles) { + this.roles = roles; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addRolesItem(String rolesItem) { + if (this.roles == null) { + this.roles = new ArrayList<>(); + } + this.roles.add(rolesItem); + return this; + } + + /** + * Roles assigned to the User. + * @return roles + */ + @javax.annotation.Nullable + public List<String> getRoles() { + return roles; + } + + public void setRoles(@javax.annotation.Nullable List<String> roles) { + this.roles = roles; + } + + + public IdentityResponseWithSocialWithoutLogins uid(@javax.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * the unique id which belongs to the Account + * @return uid + */ + @javax.annotation.Nullable + public String getUid() { + return uid; + } + + public void setUid(@javax.annotation.Nullable String uid) { + this.uid = uid; + } + + + public IdentityResponseWithSocialWithoutLogins previousUids(@javax.annotation.Nullable List<String> previousUids) { + this.previousUids = previousUids; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addPreviousUidsItem(String previousUidsItem) { + if (this.previousUids == null) { + this.previousUids = new ArrayList<>(); + } + this.previousUids.add(previousUidsItem); + return this; + } + + /** + * Previous UIDs associated with the Account. + * @return previousUids + */ + @javax.annotation.Nullable + public List<String> getPreviousUids() { + return previousUids; + } + + public void setPreviousUids(@javax.annotation.Nullable List<String> previousUids) { + this.previousUids = previousUids; + } + + + public IdentityResponseWithSocialWithoutLogins interestedIn(@javax.annotation.Nullable List<String> interestedIn) { + this.interestedIn = interestedIn; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addInterestedInItem(String interestedInItem) { + if (this.interestedIn == null) { + this.interestedIn = new ArrayList<>(); + } + this.interestedIn.add(interestedInItem); + return this; + } + + /** + * Interests of the User. + * @return interestedIn + */ + @javax.annotation.Nullable + public List<String> getInterestedIn() { + return interestedIn; + } + + public void setInterestedIn(@javax.annotation.Nullable List<String> interestedIn) { + this.interestedIn = interestedIn; + } + + + public IdentityResponseWithSocialWithoutLogins externalIds(@javax.annotation.Nullable List<ProfileExternalIdsInner> externalIds) { + this.externalIds = externalIds; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addExternalIdsItem(ProfileExternalIdsInner externalIdsItem) { + if (this.externalIds == null) { + this.externalIds = new ArrayList<>(); + } + this.externalIds.add(externalIdsItem); + return this; + } + + /** + * Get externalIds + * @return externalIds + */ + @javax.annotation.Nullable + public List<ProfileExternalIdsInner> getExternalIds() { + return externalIds; + } + + public void setExternalIds(@javax.annotation.Nullable List<ProfileExternalIdsInner> externalIds) { + this.externalIds = externalIds; + } + + + public IdentityResponseWithSocialWithoutLogins unverifiedEmail(@javax.annotation.Nullable List<ProfileUnverifiedEmailInner> unverifiedEmail) { + this.unverifiedEmail = unverifiedEmail; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addUnverifiedEmailItem(ProfileUnverifiedEmailInner unverifiedEmailItem) { + if (this.unverifiedEmail == null) { + this.unverifiedEmail = new ArrayList<>(); + } + this.unverifiedEmail.add(unverifiedEmailItem); + return this; + } + + /** + * Get unverifiedEmail + * @return unverifiedEmail + */ + @javax.annotation.Nullable + public List<ProfileUnverifiedEmailInner> getUnverifiedEmail() { + return unverifiedEmail; + } + + public void setUnverifiedEmail(@javax.annotation.Nullable List<ProfileUnverifiedEmailInner> unverifiedEmail) { + this.unverifiedEmail = unverifiedEmail; + } + + + public IdentityResponseWithSocialWithoutLogins positions(@javax.annotation.Nullable List<ProfilePositionsInner> positions) { + this.positions = positions; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addPositionsItem(ProfilePositionsInner positionsItem) { + if (this.positions == null) { + this.positions = new ArrayList<>(); + } + this.positions.add(positionsItem); + return this; + } + + /** + * List of positions held by the User. + * @return positions + */ + @javax.annotation.Nullable + public List<ProfilePositionsInner> getPositions() { + return positions; + } + + public void setPositions(@javax.annotation.Nullable List<ProfilePositionsInner> positions) { + this.positions = positions; + } + + + public IdentityResponseWithSocialWithoutLogins educations(@javax.annotation.Nullable List<ProfileEducationsInner> educations) { + this.educations = educations; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addEducationsItem(ProfileEducationsInner educationsItem) { + if (this.educations == null) { + this.educations = new ArrayList<>(); + } + this.educations.add(educationsItem); + return this; + } + + /** + * List of educational qualifications of the User. + * @return educations + */ + @javax.annotation.Nullable + public List<ProfileEducationsInner> getEducations() { + return educations; + } + + public void setEducations(@javax.annotation.Nullable List<ProfileEducationsInner> educations) { + this.educations = educations; + } + + + public IdentityResponseWithSocialWithoutLogins phoneNumbers(@javax.annotation.Nullable List<ProfilePhoneNumbersInner> phoneNumbers) { + this.phoneNumbers = phoneNumbers; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addPhoneNumbersItem(ProfilePhoneNumbersInner phoneNumbersItem) { + if (this.phoneNumbers == null) { + this.phoneNumbers = new ArrayList<>(); + } + this.phoneNumbers.add(phoneNumbersItem); + return this; + } + + /** + * List of Phone numbers associated with the User. + * @return phoneNumbers + */ + @javax.annotation.Nullable + public List<ProfilePhoneNumbersInner> getPhoneNumbers() { + return phoneNumbers; + } + + public void setPhoneNumbers(@javax.annotation.Nullable List<ProfilePhoneNumbersInner> phoneNumbers) { + this.phoneNumbers = phoneNumbers; + } + + + public IdentityResponseWithSocialWithoutLogins imAccounts(@javax.annotation.Nullable List<ProfileIMAccountsInner> imAccounts) { + this.imAccounts = imAccounts; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addImAccountsItem(ProfileIMAccountsInner imAccountsItem) { + if (this.imAccounts == null) { + this.imAccounts = new ArrayList<>(); + } + this.imAccounts.add(imAccountsItem); + return this; + } + + /** + * List of instant messaging accounts associated with the User. + * @return imAccounts + */ + @javax.annotation.Nullable + public List<ProfileIMAccountsInner> getImAccounts() { + return imAccounts; + } + + public void setImAccounts(@javax.annotation.Nullable List<ProfileIMAccountsInner> imAccounts) { + this.imAccounts = imAccounts; + } + + + public IdentityResponseWithSocialWithoutLogins addresses(@javax.annotation.Nullable List<ProfileAddressesInner> addresses) { + this.addresses = addresses; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addAddressesItem(ProfileAddressesInner addressesItem) { + if (this.addresses == null) { + this.addresses = new ArrayList<>(); + } + this.addresses.add(addressesItem); + return this; + } + + /** + * List of addresses associated with the User. + * @return addresses + */ + @javax.annotation.Nullable + public List<ProfileAddressesInner> getAddresses() { + return addresses; + } + + public void setAddresses(@javax.annotation.Nullable List<ProfileAddressesInner> addresses) { + this.addresses = addresses; + } + + + public IdentityResponseWithSocialWithoutLogins interests(@javax.annotation.Nullable List<ProfileInterestsInner> interests) { + this.interests = interests; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addInterestsItem(ProfileInterestsInner interestsItem) { + if (this.interests == null) { + this.interests = new ArrayList<>(); + } + this.interests.add(interestsItem); + return this; + } + + /** + * List of interests of the User. + * @return interests + */ + @javax.annotation.Nullable + public List<ProfileInterestsInner> getInterests() { + return interests; + } + + public void setInterests(@javax.annotation.Nullable List<ProfileInterestsInner> interests) { + this.interests = interests; + } + + + public IdentityResponseWithSocialWithoutLogins sports(@javax.annotation.Nullable List<ProfileSportsInner> sports) { + this.sports = sports; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addSportsItem(ProfileSportsInner sportsItem) { + if (this.sports == null) { + this.sports = new ArrayList<>(); + } + this.sports.add(sportsItem); + return this; + } + + /** + * List of sports the User is interested in. + * @return sports + */ + @javax.annotation.Nullable + public List<ProfileSportsInner> getSports() { + return sports; + } + + public void setSports(@javax.annotation.Nullable List<ProfileSportsInner> sports) { + this.sports = sports; + } + + + public IdentityResponseWithSocialWithoutLogins inspirationalPeople(@javax.annotation.Nullable List<ProfileInspirationalPeopleInner> inspirationalPeople) { + this.inspirationalPeople = inspirationalPeople; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addInspirationalPeopleItem(ProfileInspirationalPeopleInner inspirationalPeopleItem) { + if (this.inspirationalPeople == null) { + this.inspirationalPeople = new ArrayList<>(); + } + this.inspirationalPeople.add(inspirationalPeopleItem); + return this; + } + + /** + * List of inspirational people for the User. + * @return inspirationalPeople + */ + @javax.annotation.Nullable + public List<ProfileInspirationalPeopleInner> getInspirationalPeople() { + return inspirationalPeople; + } + + public void setInspirationalPeople(@javax.annotation.Nullable List<ProfileInspirationalPeopleInner> inspirationalPeople) { + this.inspirationalPeople = inspirationalPeople; + } + + + public IdentityResponseWithSocialWithoutLogins awards(@javax.annotation.Nullable List<ProfileAwardsInner> awards) { + this.awards = awards; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addAwardsItem(ProfileAwardsInner awardsItem) { + if (this.awards == null) { + this.awards = new ArrayList<>(); + } + this.awards.add(awardsItem); + return this; + } + + /** + * List of awards received by the User. + * @return awards + */ + @javax.annotation.Nullable + public List<ProfileAwardsInner> getAwards() { + return awards; + } + + public void setAwards(@javax.annotation.Nullable List<ProfileAwardsInner> awards) { + this.awards = awards; + } + + + public IdentityResponseWithSocialWithoutLogins skills(@javax.annotation.Nullable List<ProfileSkillsInner> skills) { + this.skills = skills; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addSkillsItem(ProfileSkillsInner skillsItem) { + if (this.skills == null) { + this.skills = new ArrayList<>(); + } + this.skills.add(skillsItem); + return this; + } + + /** + * List of skills possessed by the User. + * @return skills + */ + @javax.annotation.Nullable + public List<ProfileSkillsInner> getSkills() { + return skills; + } + + public void setSkills(@javax.annotation.Nullable List<ProfileSkillsInner> skills) { + this.skills = skills; + } + + + public IdentityResponseWithSocialWithoutLogins currentStatus(@javax.annotation.Nullable List<ProfileCurrentStatusInner> currentStatus) { + this.currentStatus = currentStatus; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addCurrentStatusItem(ProfileCurrentStatusInner currentStatusItem) { + if (this.currentStatus == null) { + this.currentStatus = new ArrayList<>(); + } + this.currentStatus.add(currentStatusItem); + return this; + } + + /** + * List of current statuses of the User. + * @return currentStatus + */ + @javax.annotation.Nullable + public List<ProfileCurrentStatusInner> getCurrentStatus() { + return currentStatus; + } + + public void setCurrentStatus(@javax.annotation.Nullable List<ProfileCurrentStatusInner> currentStatus) { + this.currentStatus = currentStatus; + } + + + public IdentityResponseWithSocialWithoutLogins certifications(@javax.annotation.Nullable List<ProfileCertificationsInner> certifications) { + this.certifications = certifications; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addCertificationsItem(ProfileCertificationsInner certificationsItem) { + if (this.certifications == null) { + this.certifications = new ArrayList<>(); + } + this.certifications.add(certificationsItem); + return this; + } + + /** + * List of certifications obtained by the User. + * @return certifications + */ + @javax.annotation.Nullable + public List<ProfileCertificationsInner> getCertifications() { + return certifications; + } + + public void setCertifications(@javax.annotation.Nullable List<ProfileCertificationsInner> certifications) { + this.certifications = certifications; + } + + + public IdentityResponseWithSocialWithoutLogins courses(@javax.annotation.Nullable List<ProfileCoursesInner> courses) { + this.courses = courses; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addCoursesItem(ProfileCoursesInner coursesItem) { + if (this.courses == null) { + this.courses = new ArrayList<>(); + } + this.courses.add(coursesItem); + return this; + } + + /** + * List of courses completed by the User. + * @return courses + */ + @javax.annotation.Nullable + public List<ProfileCoursesInner> getCourses() { + return courses; + } + + public void setCourses(@javax.annotation.Nullable List<ProfileCoursesInner> courses) { + this.courses = courses; + } + + + public IdentityResponseWithSocialWithoutLogins volunteer(@javax.annotation.Nullable List<ProfileVolunteerInner> volunteer) { + this.volunteer = volunteer; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addVolunteerItem(ProfileVolunteerInner volunteerItem) { + if (this.volunteer == null) { + this.volunteer = new ArrayList<>(); + } + this.volunteer.add(volunteerItem); + return this; + } + + /** + * List of volunteer activities by the User. + * @return volunteer + */ + @javax.annotation.Nullable + public List<ProfileVolunteerInner> getVolunteer() { + return volunteer; + } + + public void setVolunteer(@javax.annotation.Nullable List<ProfileVolunteerInner> volunteer) { + this.volunteer = volunteer; + } + + + public IdentityResponseWithSocialWithoutLogins recommendationsReceived(@javax.annotation.Nullable List<ProfileRecommendationsReceivedInner> recommendationsReceived) { + this.recommendationsReceived = recommendationsReceived; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addRecommendationsReceivedItem(ProfileRecommendationsReceivedInner recommendationsReceivedItem) { + if (this.recommendationsReceived == null) { + this.recommendationsReceived = new ArrayList<>(); + } + this.recommendationsReceived.add(recommendationsReceivedItem); + return this; + } + + /** + * List of recommendations received by the User. + * @return recommendationsReceived + */ + @javax.annotation.Nullable + public List<ProfileRecommendationsReceivedInner> getRecommendationsReceived() { + return recommendationsReceived; + } + + public void setRecommendationsReceived(@javax.annotation.Nullable List<ProfileRecommendationsReceivedInner> recommendationsReceived) { + this.recommendationsReceived = recommendationsReceived; + } + + + public IdentityResponseWithSocialWithoutLogins languages(@javax.annotation.Nullable List<ProfileLanguagesInner> languages) { + this.languages = languages; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addLanguagesItem(ProfileLanguagesInner languagesItem) { + if (this.languages == null) { + this.languages = new ArrayList<>(); + } + this.languages.add(languagesItem); + return this; + } + + /** + * List of languages known by the User. + * @return languages + */ + @javax.annotation.Nullable + public List<ProfileLanguagesInner> getLanguages() { + return languages; + } + + public void setLanguages(@javax.annotation.Nullable List<ProfileLanguagesInner> languages) { + this.languages = languages; + } + + + public IdentityResponseWithSocialWithoutLogins projects(@javax.annotation.Nullable List<ProfileProjectsInner> projects) { + this.projects = projects; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addProjectsItem(ProfileProjectsInner projectsItem) { + if (this.projects == null) { + this.projects = new ArrayList<>(); + } + this.projects.add(projectsItem); + return this; + } + + /** + * List of projects undertaken by the User. + * @return projects + */ + @javax.annotation.Nullable + public List<ProfileProjectsInner> getProjects() { + return projects; + } + + public void setProjects(@javax.annotation.Nullable List<ProfileProjectsInner> projects) { + this.projects = projects; + } + + + public IdentityResponseWithSocialWithoutLogins games(@javax.annotation.Nullable List<ProfileGamesInner> games) { + this.games = games; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addGamesItem(ProfileGamesInner gamesItem) { + if (this.games == null) { + this.games = new ArrayList<>(); + } + this.games.add(gamesItem); + return this; + } + + /** + * List of games the User is interested in. + * @return games + */ + @javax.annotation.Nullable + public List<ProfileGamesInner> getGames() { + return games; + } + + public void setGames(@javax.annotation.Nullable List<ProfileGamesInner> games) { + this.games = games; + } + + + public IdentityResponseWithSocialWithoutLogins family(@javax.annotation.Nullable List<ProfileFamilyInner> family) { + this.family = family; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addFamilyItem(ProfileFamilyInner familyItem) { + if (this.family == null) { + this.family = new ArrayList<>(); + } + this.family.add(familyItem); + return this; + } + + /** + * List of family members of the User. + * @return family + */ + @javax.annotation.Nullable + public List<ProfileFamilyInner> getFamily() { + return family; + } + + public void setFamily(@javax.annotation.Nullable List<ProfileFamilyInner> family) { + this.family = family; + } + + + public IdentityResponseWithSocialWithoutLogins televisionShow(@javax.annotation.Nullable List<ProfileTelevisionShowInner> televisionShow) { + this.televisionShow = televisionShow; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addTelevisionShowItem(ProfileTelevisionShowInner televisionShowItem) { + if (this.televisionShow == null) { + this.televisionShow = new ArrayList<>(); + } + this.televisionShow.add(televisionShowItem); + return this; + } + + /** + * List of television shows the User is interested in. + * @return televisionShow + */ + @javax.annotation.Nullable + public List<ProfileTelevisionShowInner> getTelevisionShow() { + return televisionShow; + } + + public void setTelevisionShow(@javax.annotation.Nullable List<ProfileTelevisionShowInner> televisionShow) { + this.televisionShow = televisionShow; + } + + + public IdentityResponseWithSocialWithoutLogins mutualFriends(@javax.annotation.Nullable List<ProfileMutualFriendsInner> mutualFriends) { + this.mutualFriends = mutualFriends; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addMutualFriendsItem(ProfileMutualFriendsInner mutualFriendsItem) { + if (this.mutualFriends == null) { + this.mutualFriends = new ArrayList<>(); + } + this.mutualFriends.add(mutualFriendsItem); + return this; + } + + /** + * List of mutual friends of the User. + * @return mutualFriends + */ + @javax.annotation.Nullable + public List<ProfileMutualFriendsInner> getMutualFriends() { + return mutualFriends; + } + + public void setMutualFriends(@javax.annotation.Nullable List<ProfileMutualFriendsInner> mutualFriends) { + this.mutualFriends = mutualFriends; + } + + + public IdentityResponseWithSocialWithoutLogins movies(@javax.annotation.Nullable List<ProfileMoviesInner> movies) { + this.movies = movies; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addMoviesItem(ProfileMoviesInner moviesItem) { + if (this.movies == null) { + this.movies = new ArrayList<>(); + } + this.movies.add(moviesItem); + return this; + } + + /** + * List of movies the User is interested in. + * @return movies + */ + @javax.annotation.Nullable + public List<ProfileMoviesInner> getMovies() { + return movies; + } + + public void setMovies(@javax.annotation.Nullable List<ProfileMoviesInner> movies) { + this.movies = movies; + } + + + public IdentityResponseWithSocialWithoutLogins books(@javax.annotation.Nullable List<ProfileBooksInner> books) { + this.books = books; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addBooksItem(ProfileBooksInner booksItem) { + if (this.books == null) { + this.books = new ArrayList<>(); + } + this.books.add(booksItem); + return this; + } + + /** + * List of books the User is interested in. + * @return books + */ + @javax.annotation.Nullable + public List<ProfileBooksInner> getBooks() { + return books; + } + + public void setBooks(@javax.annotation.Nullable List<ProfileBooksInner> books) { + this.books = books; + } + + + public IdentityResponseWithSocialWithoutLogins patents(@javax.annotation.Nullable List<ProfilePatentsInner> patents) { + this.patents = patents; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addPatentsItem(ProfilePatentsInner patentsItem) { + if (this.patents == null) { + this.patents = new ArrayList<>(); + } + this.patents.add(patentsItem); + return this; + } + + /** + * List of patents owned by the User. + * @return patents + */ + @javax.annotation.Nullable + public List<ProfilePatentsInner> getPatents() { + return patents; + } + + public void setPatents(@javax.annotation.Nullable List<ProfilePatentsInner> patents) { + this.patents = patents; + } + + + public IdentityResponseWithSocialWithoutLogins favoriteThings(@javax.annotation.Nullable List<ProfileFavoriteThingsInner> favoriteThings) { + this.favoriteThings = favoriteThings; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addFavoriteThingsItem(ProfileFavoriteThingsInner favoriteThingsItem) { + if (this.favoriteThings == null) { + this.favoriteThings = new ArrayList<>(); + } + this.favoriteThings.add(favoriteThingsItem); + return this; + } + + /** + * List of favorite things of the User. + * @return favoriteThings + */ + @javax.annotation.Nullable + public List<ProfileFavoriteThingsInner> getFavoriteThings() { + return favoriteThings; + } + + public void setFavoriteThings(@javax.annotation.Nullable List<ProfileFavoriteThingsInner> favoriteThings) { + this.favoriteThings = favoriteThings; + } + + + public IdentityResponseWithSocialWithoutLogins relatedProfileViews(@javax.annotation.Nullable List<ProfileRelatedProfileViewsInner> relatedProfileViews) { + this.relatedProfileViews = relatedProfileViews; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addRelatedProfileViewsItem(ProfileRelatedProfileViewsInner relatedProfileViewsItem) { + if (this.relatedProfileViews == null) { + this.relatedProfileViews = new ArrayList<>(); + } + this.relatedProfileViews.add(relatedProfileViewsItem); + return this; + } + + /** + * List of related profile views of the User. + * @return relatedProfileViews + */ + @javax.annotation.Nullable + public List<ProfileRelatedProfileViewsInner> getRelatedProfileViews() { + return relatedProfileViews; + } + + public void setRelatedProfileViews(@javax.annotation.Nullable List<ProfileRelatedProfileViewsInner> relatedProfileViews) { + this.relatedProfileViews = relatedProfileViews; + } + + + public IdentityResponseWithSocialWithoutLogins placesLived(@javax.annotation.Nullable List<ProfilePlacesLivedInner> placesLived) { + this.placesLived = placesLived; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addPlacesLivedItem(ProfilePlacesLivedInner placesLivedItem) { + if (this.placesLived == null) { + this.placesLived = new ArrayList<>(); + } + this.placesLived.add(placesLivedItem); + return this; + } + + /** + * List of places the User has lived. + * @return placesLived + */ + @javax.annotation.Nullable + public List<ProfilePlacesLivedInner> getPlacesLived() { + return placesLived; + } + + public void setPlacesLived(@javax.annotation.Nullable List<ProfilePlacesLivedInner> placesLived) { + this.placesLived = placesLived; + } + + + public IdentityResponseWithSocialWithoutLogins publications(@javax.annotation.Nullable List<ProfilePublicationsInner> publications) { + this.publications = publications; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addPublicationsItem(ProfilePublicationsInner publicationsItem) { + if (this.publications == null) { + this.publications = new ArrayList<>(); + } + this.publications.add(publicationsItem); + return this; + } + + /** + * List of publications by the User. + * @return publications + */ + @javax.annotation.Nullable + public List<ProfilePublicationsInner> getPublications() { + return publications; + } + + public void setPublications(@javax.annotation.Nullable List<ProfilePublicationsInner> publications) { + this.publications = publications; + } + + + public IdentityResponseWithSocialWithoutLogins jobBookmarks(@javax.annotation.Nullable List<ProfileJobBookmarksInner> jobBookmarks) { + this.jobBookmarks = jobBookmarks; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addJobBookmarksItem(ProfileJobBookmarksInner jobBookmarksItem) { + if (this.jobBookmarks == null) { + this.jobBookmarks = new ArrayList<>(); + } + this.jobBookmarks.add(jobBookmarksItem); + return this; + } + + /** + * List of job bookmarks by the User. + * @return jobBookmarks + */ + @javax.annotation.Nullable + public List<ProfileJobBookmarksInner> getJobBookmarks() { + return jobBookmarks; + } + + public void setJobBookmarks(@javax.annotation.Nullable List<ProfileJobBookmarksInner> jobBookmarks) { + this.jobBookmarks = jobBookmarks; + } + + + public IdentityResponseWithSocialWithoutLogins badges(@javax.annotation.Nullable List<ProfileBadgesInner> badges) { + this.badges = badges; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addBadgesItem(ProfileBadgesInner badgesItem) { + if (this.badges == null) { + this.badges = new ArrayList<>(); + } + this.badges.add(badgesItem); + return this; + } + + /** + * List of badges earned by the User. + * @return badges + */ + @javax.annotation.Nullable + public List<ProfileBadgesInner> getBadges() { + return badges; + } + + public void setBadges(@javax.annotation.Nullable List<ProfileBadgesInner> badges) { + this.badges = badges; + } + + + public IdentityResponseWithSocialWithoutLogins memberUrlResources(@javax.annotation.Nullable List<ProfileMemberUrlResourcesInner> memberUrlResources) { + this.memberUrlResources = memberUrlResources; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addMemberUrlResourcesItem(ProfileMemberUrlResourcesInner memberUrlResourcesItem) { + if (this.memberUrlResources == null) { + this.memberUrlResources = new ArrayList<>(); + } + this.memberUrlResources.add(memberUrlResourcesItem); + return this; + } + + /** + * List of member URL resources. + * @return memberUrlResources + */ + @javax.annotation.Nullable + public List<ProfileMemberUrlResourcesInner> getMemberUrlResources() { + return memberUrlResources; + } + + public void setMemberUrlResources(@javax.annotation.Nullable List<ProfileMemberUrlResourcesInner> memberUrlResources) { + this.memberUrlResources = memberUrlResources; + } + + + public IdentityResponseWithSocialWithoutLogins organizations(@javax.annotation.Nullable List<ProfileOrganizationsInner> organizations) { + this.organizations = organizations; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addOrganizationsItem(ProfileOrganizationsInner organizationsItem) { + if (this.organizations == null) { + this.organizations = new ArrayList<>(); + } + this.organizations.add(organizationsItem); + return this; + } + + /** + * List of organizations associated with the User. + * @return organizations + */ + @javax.annotation.Nullable + public List<ProfileOrganizationsInner> getOrganizations() { + return organizations; + } + + public void setOrganizations(@javax.annotation.Nullable List<ProfileOrganizationsInner> organizations) { + this.organizations = organizations; + } + + + public IdentityResponseWithSocialWithoutLogins objectId(@javax.annotation.Nullable String objectId) { + this.objectId = objectId; + return this; + } + + /** + * The object ID of the User. + * @return objectId + */ + @javax.annotation.Nullable + public String getObjectId() { + return objectId; + } + + public void setObjectId(@javax.annotation.Nullable String objectId) { + this.objectId = objectId; + } + + + public IdentityResponseWithSocialWithoutLogins email(@javax.annotation.Nullable List<ProfileEmailInner> email) { + this.email = email; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addEmailItem(ProfileEmailInner emailItem) { + if (this.email == null) { + this.email = new ArrayList<>(); + } + this.email.add(emailItem); + return this; + } + + /** + * List of Email addresses associated with the User. + * @return email + */ + @javax.annotation.Nullable + public List<ProfileEmailInner> getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable List<ProfileEmailInner> email) { + this.email = email; + } + + + public IdentityResponseWithSocialWithoutLogins passkeyLogin(@javax.annotation.Nullable IdentityPasskeyLogin passkeyLogin) { + this.passkeyLogin = passkeyLogin; + return this; + } + + /** + * Get passkeyLogin + * @return passkeyLogin + */ + @javax.annotation.Nullable + public IdentityPasskeyLogin getPasskeyLogin() { + return passkeyLogin; + } + + public void setPasskeyLogin(@javax.annotation.Nullable IdentityPasskeyLogin passkeyLogin) { + this.passkeyLogin = passkeyLogin; + } + + + public IdentityResponseWithSocialWithoutLogins identities(@javax.annotation.Nullable List<SocialIdentity> identities) { + this.identities = identities; + return this; + } + + public IdentityResponseWithSocialWithoutLogins addIdentitiesItem(SocialIdentity identitiesItem) { + if (this.identities == null) { + this.identities = new ArrayList<>(); + } + this.identities.add(identitiesItem); + return this; + } + + /** + * List of identities with social information but without login details. + * @return identities + */ + @javax.annotation.Nullable + public List<SocialIdentity> getIdentities() { + return identities; + } + + public void setIdentities(@javax.annotation.Nullable List<SocialIdentity> identities) { + this.identities = identities; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IdentityResponseWithSocialWithoutLogins instance itself + */ + public IdentityResponseWithSocialWithoutLogins putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IdentityResponseWithSocialWithoutLogins identityResponseWithSocialWithoutLogins = (IdentityResponseWithSocialWithoutLogins) o; + return Objects.equals(this.isPasswordBreached, identityResponseWithSocialWithoutLogins.isPasswordBreached) && + Objects.equals(this.isActive, identityResponseWithSocialWithoutLogins.isActive) && + Objects.equals(this.isDeleted, identityResponseWithSocialWithoutLogins.isDeleted) && + Objects.equals(this.emailVerified, identityResponseWithSocialWithoutLogins.emailVerified) && + Objects.equals(this.isLoginLocked, identityResponseWithSocialWithoutLogins.isLoginLocked) && + Objects.equals(this.isRequiredFieldsFilledOnce, identityResponseWithSocialWithoutLogins.isRequiredFieldsFilledOnce) && + Objects.equals(this.firstLogin, identityResponseWithSocialWithoutLogins.firstLogin) && + Objects.equals(this.isProtected, identityResponseWithSocialWithoutLogins.isProtected) && + Objects.equals(this.hireable, identityResponseWithSocialWithoutLogins.hireable) && + Objects.equals(this.isSecurePassword, identityResponseWithSocialWithoutLogins.isSecurePassword) && + Objects.equals(this.isCustomUid, identityResponseWithSocialWithoutLogins.isCustomUid) && + Objects.equals(this.phoneIdVerified, identityResponseWithSocialWithoutLogins.phoneIdVerified) && + Objects.equals(this.isEmailSubscribed, identityResponseWithSocialWithoutLogins.isEmailSubscribed) && + Objects.equals(this.noOfLogins, identityResponseWithSocialWithoutLogins.noOfLogins) && + Objects.equals(this.followersCount, identityResponseWithSocialWithoutLogins.followersCount) && + Objects.equals(this.friendsCount, identityResponseWithSocialWithoutLogins.friendsCount) && + Objects.equals(this.totalStatusesCount, identityResponseWithSocialWithoutLogins.totalStatusesCount) && + Objects.equals(this.numRecommenders, identityResponseWithSocialWithoutLogins.numRecommenders) && + Objects.equals(this.totalPrivateRepository, identityResponseWithSocialWithoutLogins.totalPrivateRepository) && + Objects.equals(this.publicGists, identityResponseWithSocialWithoutLogins.publicGists) && + Objects.equals(this.privateGists, identityResponseWithSocialWithoutLogins.privateGists) && + Objects.equals(this.pinsCount, identityResponseWithSocialWithoutLogins.pinsCount) && + Objects.equals(this.boardsCount, identityResponseWithSocialWithoutLogins.boardsCount) && + Objects.equals(this.likesCount, identityResponseWithSocialWithoutLogins.likesCount) && + Objects.equals(this.ID, identityResponseWithSocialWithoutLogins.ID) && + Objects.equals(this.provider, identityResponseWithSocialWithoutLogins.provider) && + Objects.equals(this.fullName, identityResponseWithSocialWithoutLogins.fullName) && + Objects.equals(this.firstName, identityResponseWithSocialWithoutLogins.firstName) && + Objects.equals(this.lastName, identityResponseWithSocialWithoutLogins.lastName) && + Objects.equals(this.phoneId, identityResponseWithSocialWithoutLogins.phoneId) && + Objects.equals(this.userName, identityResponseWithSocialWithoutLogins.userName) && + Objects.equals(this.prefix, identityResponseWithSocialWithoutLogins.prefix) && + Objects.equals(this.middleName, identityResponseWithSocialWithoutLogins.middleName) && + Objects.equals(this.suffix, identityResponseWithSocialWithoutLogins.suffix) && + Objects.equals(this.nickName, identityResponseWithSocialWithoutLogins.nickName) && + Objects.equals(this.profileName, identityResponseWithSocialWithoutLogins.profileName) && + Objects.equals(this.birthDate, identityResponseWithSocialWithoutLogins.birthDate) && + Objects.equals(this.gender, identityResponseWithSocialWithoutLogins.gender) && + Objects.equals(this.website, identityResponseWithSocialWithoutLogins.website) && + Objects.equals(this.thumbnailImageUrl, identityResponseWithSocialWithoutLogins.thumbnailImageUrl) && + Objects.equals(this.imageUrl, identityResponseWithSocialWithoutLogins.imageUrl) && + Objects.equals(this.favicon, identityResponseWithSocialWithoutLogins.favicon) && + Objects.equals(this.profileUrl, identityResponseWithSocialWithoutLogins.profileUrl) && + Objects.equals(this.homeTown, identityResponseWithSocialWithoutLogins.homeTown) && + Objects.equals(this.state, identityResponseWithSocialWithoutLogins.state) && + Objects.equals(this.city, identityResponseWithSocialWithoutLogins.city) && + Objects.equals(this.industry, identityResponseWithSocialWithoutLogins.industry) && + Objects.equals(this.about, identityResponseWithSocialWithoutLogins.about) && + Objects.equals(this.timeZone, identityResponseWithSocialWithoutLogins.timeZone) && + Objects.equals(this.localLanguage, identityResponseWithSocialWithoutLogins.localLanguage) && + Objects.equals(this.coverPhoto, identityResponseWithSocialWithoutLogins.coverPhoto) && + Objects.equals(this.tagLine, identityResponseWithSocialWithoutLogins.tagLine) && + Objects.equals(this.language, identityResponseWithSocialWithoutLogins.language) && + Objects.equals(this.verified, identityResponseWithSocialWithoutLogins.verified) && + Objects.equals(this.updatedTime, identityResponseWithSocialWithoutLogins.updatedTime) && + Objects.equals(this.isGeoEnabled, identityResponseWithSocialWithoutLogins.isGeoEnabled) && + Objects.equals(this.associations, identityResponseWithSocialWithoutLogins.associations) && + Objects.equals(this.honors, identityResponseWithSocialWithoutLogins.honors) && + Objects.equals(this.httpsImageUrl, identityResponseWithSocialWithoutLogins.httpsImageUrl) && + Objects.equals(this.mainAddress, identityResponseWithSocialWithoutLogins.mainAddress) && + Objects.equals(this.created, identityResponseWithSocialWithoutLogins.created) && + Objects.equals(this.localCity, identityResponseWithSocialWithoutLogins.localCity) && + Objects.equals(this.profileCity, identityResponseWithSocialWithoutLogins.profileCity) && + Objects.equals(this.localCountry, identityResponseWithSocialWithoutLogins.localCountry) && + Objects.equals(this.profileCountry, identityResponseWithSocialWithoutLogins.profileCountry) && + Objects.equals(this.relationshipStatus, identityResponseWithSocialWithoutLogins.relationshipStatus) && + Objects.equals(this.quota, identityResponseWithSocialWithoutLogins.quota) && + Objects.equals(this.quote, identityResponseWithSocialWithoutLogins.quote) && + Objects.equals(this.religion, identityResponseWithSocialWithoutLogins.religion) && + Objects.equals(this.political, identityResponseWithSocialWithoutLogins.political) && + Objects.equals(this.publicRepository, identityResponseWithSocialWithoutLogins.publicRepository) && + Objects.equals(this.repositoryUrl, identityResponseWithSocialWithoutLogins.repositoryUrl) && + Objects.equals(this.age, identityResponseWithSocialWithoutLogins.age) && + Objects.equals(this.professionalHeadline, identityResponseWithSocialWithoutLogins.professionalHeadline) && + Objects.equals(this.lrUserID, identityResponseWithSocialWithoutLogins.lrUserID) && + Objects.equals(this.currency, identityResponseWithSocialWithoutLogins.currency) && + Objects.equals(this.starredUrl, identityResponseWithSocialWithoutLogins.starredUrl) && + Objects.equals(this.gistsUrl, identityResponseWithSocialWithoutLogins.gistsUrl) && + Objects.equals(this.company, identityResponseWithSocialWithoutLogins.company) && + Objects.equals(this.gravatarImageUrl, identityResponseWithSocialWithoutLogins.gravatarImageUrl) && + Objects.equals(this.lastPasswordChangeDate, identityResponseWithSocialWithoutLogins.lastPasswordChangeDate) && + Objects.equals(this.passwordExpirationDate, identityResponseWithSocialWithoutLogins.passwordExpirationDate) && + Objects.equals(this.createdDate, identityResponseWithSocialWithoutLogins.createdDate) && + Objects.equals(this.modifiedDate, identityResponseWithSocialWithoutLogins.modifiedDate) && + Objects.equals(this.profileModifiedDate, identityResponseWithSocialWithoutLogins.profileModifiedDate) && + Objects.equals(this.lastLoginDate, identityResponseWithSocialWithoutLogins.lastLoginDate) && + Objects.equals(this.signupDate, identityResponseWithSocialWithoutLogins.signupDate) && + Objects.equals(this.privacyPolicy, identityResponseWithSocialWithoutLogins.privacyPolicy) && + Objects.equals(this.country, identityResponseWithSocialWithoutLogins.country) && + Objects.equals(this.ageRange, identityResponseWithSocialWithoutLogins.ageRange) && + Objects.equals(this.kloutScore, identityResponseWithSocialWithoutLogins.kloutScore) && + Objects.equals(this.suggestions, identityResponseWithSocialWithoutLogins.suggestions) && + Objects.equals(this.subscription, identityResponseWithSocialWithoutLogins.subscription) && + Objects.equals(this.PIN, identityResponseWithSocialWithoutLogins.PIN) && + Objects.equals(this.consentProfile, identityResponseWithSocialWithoutLogins.consentProfile) && + Objects.equals(this.registrationData, identityResponseWithSocialWithoutLogins.registrationData) && + Objects.equals(this.providerAccessCredential, identityResponseWithSocialWithoutLogins.providerAccessCredential) && + Objects.equals(this.customFields, identityResponseWithSocialWithoutLogins.customFields) && + Objects.equals(this.profileImageUrls, identityResponseWithSocialWithoutLogins.profileImageUrls) && + Objects.equals(this.webProfiles, identityResponseWithSocialWithoutLogins.webProfiles) && + Objects.equals(this.roles, identityResponseWithSocialWithoutLogins.roles) && + Objects.equals(this.uid, identityResponseWithSocialWithoutLogins.uid) && + Objects.equals(this.previousUids, identityResponseWithSocialWithoutLogins.previousUids) && + Objects.equals(this.interestedIn, identityResponseWithSocialWithoutLogins.interestedIn) && + Objects.equals(this.externalIds, identityResponseWithSocialWithoutLogins.externalIds) && + Objects.equals(this.unverifiedEmail, identityResponseWithSocialWithoutLogins.unverifiedEmail) && + Objects.equals(this.positions, identityResponseWithSocialWithoutLogins.positions) && + Objects.equals(this.educations, identityResponseWithSocialWithoutLogins.educations) && + Objects.equals(this.phoneNumbers, identityResponseWithSocialWithoutLogins.phoneNumbers) && + Objects.equals(this.imAccounts, identityResponseWithSocialWithoutLogins.imAccounts) && + Objects.equals(this.addresses, identityResponseWithSocialWithoutLogins.addresses) && + Objects.equals(this.interests, identityResponseWithSocialWithoutLogins.interests) && + Objects.equals(this.sports, identityResponseWithSocialWithoutLogins.sports) && + Objects.equals(this.inspirationalPeople, identityResponseWithSocialWithoutLogins.inspirationalPeople) && + Objects.equals(this.awards, identityResponseWithSocialWithoutLogins.awards) && + Objects.equals(this.skills, identityResponseWithSocialWithoutLogins.skills) && + Objects.equals(this.currentStatus, identityResponseWithSocialWithoutLogins.currentStatus) && + Objects.equals(this.certifications, identityResponseWithSocialWithoutLogins.certifications) && + Objects.equals(this.courses, identityResponseWithSocialWithoutLogins.courses) && + Objects.equals(this.volunteer, identityResponseWithSocialWithoutLogins.volunteer) && + Objects.equals(this.recommendationsReceived, identityResponseWithSocialWithoutLogins.recommendationsReceived) && + Objects.equals(this.languages, identityResponseWithSocialWithoutLogins.languages) && + Objects.equals(this.projects, identityResponseWithSocialWithoutLogins.projects) && + Objects.equals(this.games, identityResponseWithSocialWithoutLogins.games) && + Objects.equals(this.family, identityResponseWithSocialWithoutLogins.family) && + Objects.equals(this.televisionShow, identityResponseWithSocialWithoutLogins.televisionShow) && + Objects.equals(this.mutualFriends, identityResponseWithSocialWithoutLogins.mutualFriends) && + Objects.equals(this.movies, identityResponseWithSocialWithoutLogins.movies) && + Objects.equals(this.books, identityResponseWithSocialWithoutLogins.books) && + Objects.equals(this.patents, identityResponseWithSocialWithoutLogins.patents) && + Objects.equals(this.favoriteThings, identityResponseWithSocialWithoutLogins.favoriteThings) && + Objects.equals(this.relatedProfileViews, identityResponseWithSocialWithoutLogins.relatedProfileViews) && + Objects.equals(this.placesLived, identityResponseWithSocialWithoutLogins.placesLived) && + Objects.equals(this.publications, identityResponseWithSocialWithoutLogins.publications) && + Objects.equals(this.jobBookmarks, identityResponseWithSocialWithoutLogins.jobBookmarks) && + Objects.equals(this.badges, identityResponseWithSocialWithoutLogins.badges) && + Objects.equals(this.memberUrlResources, identityResponseWithSocialWithoutLogins.memberUrlResources) && + Objects.equals(this.organizations, identityResponseWithSocialWithoutLogins.organizations) && + Objects.equals(this.objectId, identityResponseWithSocialWithoutLogins.objectId) && + Objects.equals(this.email, identityResponseWithSocialWithoutLogins.email) && + Objects.equals(this.passkeyLogin, identityResponseWithSocialWithoutLogins.passkeyLogin) && + Objects.equals(this.identities, identityResponseWithSocialWithoutLogins.identities)&& + Objects.equals(this.additionalProperties, identityResponseWithSocialWithoutLogins.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(isPasswordBreached, isActive, isDeleted, emailVerified, isLoginLocked, isRequiredFieldsFilledOnce, firstLogin, isProtected, hireable, isSecurePassword, isCustomUid, phoneIdVerified, isEmailSubscribed, noOfLogins, followersCount, friendsCount, totalStatusesCount, numRecommenders, totalPrivateRepository, publicGists, privateGists, pinsCount, boardsCount, likesCount, ID, provider, fullName, firstName, lastName, phoneId, userName, prefix, middleName, suffix, nickName, profileName, birthDate, gender, website, thumbnailImageUrl, imageUrl, favicon, profileUrl, homeTown, state, city, industry, about, timeZone, localLanguage, coverPhoto, tagLine, language, verified, updatedTime, isGeoEnabled, associations, honors, httpsImageUrl, mainAddress, created, localCity, profileCity, localCountry, profileCountry, relationshipStatus, quota, quote, religion, political, publicRepository, repositoryUrl, age, professionalHeadline, lrUserID, currency, starredUrl, gistsUrl, company, gravatarImageUrl, lastPasswordChangeDate, passwordExpirationDate, createdDate, modifiedDate, profileModifiedDate, lastLoginDate, signupDate, privacyPolicy, country, ageRange, kloutScore, suggestions, subscription, PIN, consentProfile, registrationData, providerAccessCredential, customFields, profileImageUrls, webProfiles, roles, uid, previousUids, interestedIn, externalIds, unverifiedEmail, positions, educations, phoneNumbers, imAccounts, addresses, interests, sports, inspirationalPeople, awards, skills, currentStatus, certifications, courses, volunteer, recommendationsReceived, languages, projects, games, family, televisionShow, mutualFriends, movies, books, patents, favoriteThings, relatedProfileViews, placesLived, publications, jobBookmarks, badges, memberUrlResources, organizations, objectId, email, passkeyLogin, identities, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IdentityResponseWithSocialWithoutLogins {\n"); + sb.append(" isPasswordBreached: ").append(toIndentedString(isPasswordBreached)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" isDeleted: ").append(toIndentedString(isDeleted)).append("\n"); + sb.append(" emailVerified: ").append(toIndentedString(emailVerified)).append("\n"); + sb.append(" isLoginLocked: ").append(toIndentedString(isLoginLocked)).append("\n"); + sb.append(" isRequiredFieldsFilledOnce: ").append(toIndentedString(isRequiredFieldsFilledOnce)).append("\n"); + sb.append(" firstLogin: ").append(toIndentedString(firstLogin)).append("\n"); + sb.append(" isProtected: ").append(toIndentedString(isProtected)).append("\n"); + sb.append(" hireable: ").append(toIndentedString(hireable)).append("\n"); + sb.append(" isSecurePassword: ").append(toIndentedString(isSecurePassword)).append("\n"); + sb.append(" isCustomUid: ").append(toIndentedString(isCustomUid)).append("\n"); + sb.append(" phoneIdVerified: ").append(toIndentedString(phoneIdVerified)).append("\n"); + sb.append(" isEmailSubscribed: ").append(toIndentedString(isEmailSubscribed)).append("\n"); + sb.append(" noOfLogins: ").append(toIndentedString(noOfLogins)).append("\n"); + sb.append(" followersCount: ").append(toIndentedString(followersCount)).append("\n"); + sb.append(" friendsCount: ").append(toIndentedString(friendsCount)).append("\n"); + sb.append(" totalStatusesCount: ").append(toIndentedString(totalStatusesCount)).append("\n"); + sb.append(" numRecommenders: ").append(toIndentedString(numRecommenders)).append("\n"); + sb.append(" totalPrivateRepository: ").append(toIndentedString(totalPrivateRepository)).append("\n"); + sb.append(" publicGists: ").append(toIndentedString(publicGists)).append("\n"); + sb.append(" privateGists: ").append(toIndentedString(privateGists)).append("\n"); + sb.append(" pinsCount: ").append(toIndentedString(pinsCount)).append("\n"); + sb.append(" boardsCount: ").append(toIndentedString(boardsCount)).append("\n"); + sb.append(" likesCount: ").append(toIndentedString(likesCount)).append("\n"); + sb.append(" ID: ").append(toIndentedString(ID)).append("\n"); + sb.append(" provider: ").append(toIndentedString(provider)).append("\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" phoneId: ").append(toIndentedString(phoneId)).append("\n"); + sb.append(" userName: ").append(toIndentedString(userName)).append("\n"); + sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n"); + sb.append(" middleName: ").append(toIndentedString(middleName)).append("\n"); + sb.append(" suffix: ").append(toIndentedString(suffix)).append("\n"); + sb.append(" nickName: ").append(toIndentedString(nickName)).append("\n"); + sb.append(" profileName: ").append(toIndentedString(profileName)).append("\n"); + sb.append(" birthDate: ").append(toIndentedString(birthDate)).append("\n"); + sb.append(" gender: ").append(toIndentedString(gender)).append("\n"); + sb.append(" website: ").append(toIndentedString(website)).append("\n"); + sb.append(" thumbnailImageUrl: ").append(toIndentedString(thumbnailImageUrl)).append("\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append(" favicon: ").append(toIndentedString(favicon)).append("\n"); + sb.append(" profileUrl: ").append(toIndentedString(profileUrl)).append("\n"); + sb.append(" homeTown: ").append(toIndentedString(homeTown)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" industry: ").append(toIndentedString(industry)).append("\n"); + sb.append(" about: ").append(toIndentedString(about)).append("\n"); + sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); + sb.append(" localLanguage: ").append(toIndentedString(localLanguage)).append("\n"); + sb.append(" coverPhoto: ").append(toIndentedString(coverPhoto)).append("\n"); + sb.append(" tagLine: ").append(toIndentedString(tagLine)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" verified: ").append(toIndentedString(verified)).append("\n"); + sb.append(" updatedTime: ").append(toIndentedString(updatedTime)).append("\n"); + sb.append(" isGeoEnabled: ").append(toIndentedString(isGeoEnabled)).append("\n"); + sb.append(" associations: ").append(toIndentedString(associations)).append("\n"); + sb.append(" honors: ").append(toIndentedString(honors)).append("\n"); + sb.append(" httpsImageUrl: ").append(toIndentedString(httpsImageUrl)).append("\n"); + sb.append(" mainAddress: ").append(toIndentedString(mainAddress)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" localCity: ").append(toIndentedString(localCity)).append("\n"); + sb.append(" profileCity: ").append(toIndentedString(profileCity)).append("\n"); + sb.append(" localCountry: ").append(toIndentedString(localCountry)).append("\n"); + sb.append(" profileCountry: ").append(toIndentedString(profileCountry)).append("\n"); + sb.append(" relationshipStatus: ").append(toIndentedString(relationshipStatus)).append("\n"); + sb.append(" quota: ").append(toIndentedString(quota)).append("\n"); + sb.append(" quote: ").append(toIndentedString(quote)).append("\n"); + sb.append(" religion: ").append(toIndentedString(religion)).append("\n"); + sb.append(" political: ").append(toIndentedString(political)).append("\n"); + sb.append(" publicRepository: ").append(toIndentedString(publicRepository)).append("\n"); + sb.append(" repositoryUrl: ").append(toIndentedString(repositoryUrl)).append("\n"); + sb.append(" age: ").append(toIndentedString(age)).append("\n"); + sb.append(" professionalHeadline: ").append(toIndentedString(professionalHeadline)).append("\n"); + sb.append(" lrUserID: ").append(toIndentedString(lrUserID)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" starredUrl: ").append(toIndentedString(starredUrl)).append("\n"); + sb.append(" gistsUrl: ").append(toIndentedString(gistsUrl)).append("\n"); + sb.append(" company: ").append(toIndentedString(company)).append("\n"); + sb.append(" gravatarImageUrl: ").append(toIndentedString(gravatarImageUrl)).append("\n"); + sb.append(" lastPasswordChangeDate: ").append(toIndentedString(lastPasswordChangeDate)).append("\n"); + sb.append(" passwordExpirationDate: ").append(toIndentedString(passwordExpirationDate)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" modifiedDate: ").append(toIndentedString(modifiedDate)).append("\n"); + sb.append(" profileModifiedDate: ").append(toIndentedString(profileModifiedDate)).append("\n"); + sb.append(" lastLoginDate: ").append(toIndentedString(lastLoginDate)).append("\n"); + sb.append(" signupDate: ").append(toIndentedString(signupDate)).append("\n"); + sb.append(" privacyPolicy: ").append(toIndentedString(privacyPolicy)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" ageRange: ").append(toIndentedString(ageRange)).append("\n"); + sb.append(" kloutScore: ").append(toIndentedString(kloutScore)).append("\n"); + sb.append(" suggestions: ").append(toIndentedString(suggestions)).append("\n"); + sb.append(" subscription: ").append(toIndentedString(subscription)).append("\n"); + sb.append(" PIN: ").append(toIndentedString(PIN)).append("\n"); + sb.append(" consentProfile: ").append(toIndentedString(consentProfile)).append("\n"); + sb.append(" registrationData: ").append(toIndentedString(registrationData)).append("\n"); + sb.append(" providerAccessCredential: ").append(toIndentedString(providerAccessCredential)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" profileImageUrls: ").append(toIndentedString(profileImageUrls)).append("\n"); + sb.append(" webProfiles: ").append(toIndentedString(webProfiles)).append("\n"); + sb.append(" roles: ").append(toIndentedString(roles)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" previousUids: ").append(toIndentedString(previousUids)).append("\n"); + sb.append(" interestedIn: ").append(toIndentedString(interestedIn)).append("\n"); + sb.append(" externalIds: ").append(toIndentedString(externalIds)).append("\n"); + sb.append(" unverifiedEmail: ").append(toIndentedString(unverifiedEmail)).append("\n"); + sb.append(" positions: ").append(toIndentedString(positions)).append("\n"); + sb.append(" educations: ").append(toIndentedString(educations)).append("\n"); + sb.append(" phoneNumbers: ").append(toIndentedString(phoneNumbers)).append("\n"); + sb.append(" imAccounts: ").append(toIndentedString(imAccounts)).append("\n"); + sb.append(" addresses: ").append(toIndentedString(addresses)).append("\n"); + sb.append(" interests: ").append(toIndentedString(interests)).append("\n"); + sb.append(" sports: ").append(toIndentedString(sports)).append("\n"); + sb.append(" inspirationalPeople: ").append(toIndentedString(inspirationalPeople)).append("\n"); + sb.append(" awards: ").append(toIndentedString(awards)).append("\n"); + sb.append(" skills: ").append(toIndentedString(skills)).append("\n"); + sb.append(" currentStatus: ").append(toIndentedString(currentStatus)).append("\n"); + sb.append(" certifications: ").append(toIndentedString(certifications)).append("\n"); + sb.append(" courses: ").append(toIndentedString(courses)).append("\n"); + sb.append(" volunteer: ").append(toIndentedString(volunteer)).append("\n"); + sb.append(" recommendationsReceived: ").append(toIndentedString(recommendationsReceived)).append("\n"); + sb.append(" languages: ").append(toIndentedString(languages)).append("\n"); + sb.append(" projects: ").append(toIndentedString(projects)).append("\n"); + sb.append(" games: ").append(toIndentedString(games)).append("\n"); + sb.append(" family: ").append(toIndentedString(family)).append("\n"); + sb.append(" televisionShow: ").append(toIndentedString(televisionShow)).append("\n"); + sb.append(" mutualFriends: ").append(toIndentedString(mutualFriends)).append("\n"); + sb.append(" movies: ").append(toIndentedString(movies)).append("\n"); + sb.append(" books: ").append(toIndentedString(books)).append("\n"); + sb.append(" patents: ").append(toIndentedString(patents)).append("\n"); + sb.append(" favoriteThings: ").append(toIndentedString(favoriteThings)).append("\n"); + sb.append(" relatedProfileViews: ").append(toIndentedString(relatedProfileViews)).append("\n"); + sb.append(" placesLived: ").append(toIndentedString(placesLived)).append("\n"); + sb.append(" publications: ").append(toIndentedString(publications)).append("\n"); + sb.append(" jobBookmarks: ").append(toIndentedString(jobBookmarks)).append("\n"); + sb.append(" badges: ").append(toIndentedString(badges)).append("\n"); + sb.append(" memberUrlResources: ").append(toIndentedString(memberUrlResources)).append("\n"); + sb.append(" organizations: ").append(toIndentedString(organizations)).append("\n"); + sb.append(" objectId: ").append(toIndentedString(objectId)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" passkeyLogin: ").append(toIndentedString(passkeyLogin)).append("\n"); + sb.append(" identities: ").append(toIndentedString(identities)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsPasswordBreached"); + openapiFields.add("IsActive"); + openapiFields.add("IsDeleted"); + openapiFields.add("EmailVerified"); + openapiFields.add("IsLoginLocked"); + openapiFields.add("IsRequiredFieldsFilledOnce"); + openapiFields.add("FirstLogin"); + openapiFields.add("IsProtected"); + openapiFields.add("Hireable"); + openapiFields.add("IsSecurePassword"); + openapiFields.add("IsCustomUid"); + openapiFields.add("PhoneIdVerified"); + openapiFields.add("IsEmailSubscribed"); + openapiFields.add("NoOfLogins"); + openapiFields.add("FollowersCount"); + openapiFields.add("FriendsCount"); + openapiFields.add("TotalStatusesCount"); + openapiFields.add("NumRecommenders"); + openapiFields.add("TotalPrivateRepository"); + openapiFields.add("PublicGists"); + openapiFields.add("PrivateGists"); + openapiFields.add("PinsCount"); + openapiFields.add("BoardsCount"); + openapiFields.add("LikesCount"); + openapiFields.add("ID"); + openapiFields.add("Provider"); + openapiFields.add("FullName"); + openapiFields.add("FirstName"); + openapiFields.add("LastName"); + openapiFields.add("PhoneId"); + openapiFields.add("UserName"); + openapiFields.add("Prefix"); + openapiFields.add("MiddleName"); + openapiFields.add("Suffix"); + openapiFields.add("NickName"); + openapiFields.add("ProfileName"); + openapiFields.add("BirthDate"); + openapiFields.add("Gender"); + openapiFields.add("Website"); + openapiFields.add("ThumbnailImageUrl"); + openapiFields.add("ImageUrl"); + openapiFields.add("Favicon"); + openapiFields.add("ProfileUrl"); + openapiFields.add("HomeTown"); + openapiFields.add("State"); + openapiFields.add("City"); + openapiFields.add("Industry"); + openapiFields.add("About"); + openapiFields.add("TimeZone"); + openapiFields.add("LocalLanguage"); + openapiFields.add("CoverPhoto"); + openapiFields.add("TagLine"); + openapiFields.add("Language"); + openapiFields.add("Verified"); + openapiFields.add("UpdatedTime"); + openapiFields.add("IsGeoEnabled"); + openapiFields.add("Associations"); + openapiFields.add("Honors"); + openapiFields.add("HttpsImageUrl"); + openapiFields.add("MainAddress"); + openapiFields.add("Created"); + openapiFields.add("LocalCity"); + openapiFields.add("ProfileCity"); + openapiFields.add("LocalCountry"); + openapiFields.add("ProfileCountry"); + openapiFields.add("RelationshipStatus"); + openapiFields.add("Quota"); + openapiFields.add("Quote"); + openapiFields.add("Religion"); + openapiFields.add("Political"); + openapiFields.add("PublicRepository"); + openapiFields.add("RepositoryUrl"); + openapiFields.add("Age"); + openapiFields.add("ProfessionalHeadline"); + openapiFields.add("LRUserID"); + openapiFields.add("Currency"); + openapiFields.add("StarredUrl"); + openapiFields.add("GistsUrl"); + openapiFields.add("Company"); + openapiFields.add("GravatarImageUrl"); + openapiFields.add("LastPasswordChangeDate"); + openapiFields.add("PasswordExpirationDate"); + openapiFields.add("CreatedDate"); + openapiFields.add("ModifiedDate"); + openapiFields.add("ProfileModifiedDate"); + openapiFields.add("LastLoginDate"); + openapiFields.add("SignupDate"); + openapiFields.add("PrivacyPolicy"); + openapiFields.add("Country"); + openapiFields.add("AgeRange"); + openapiFields.add("KloutScore"); + openapiFields.add("Suggestions"); + openapiFields.add("Subscription"); + openapiFields.add("PIN"); + openapiFields.add("ConsentProfile"); + openapiFields.add("RegistrationData"); + openapiFields.add("ProviderAccessCredential"); + openapiFields.add("CustomFields"); + openapiFields.add("ProfileImageUrls"); + openapiFields.add("WebProfiles"); + openapiFields.add("Roles"); + openapiFields.add("Uid"); + openapiFields.add("PreviousUids"); + openapiFields.add("InterestedIn"); + openapiFields.add("ExternalIds"); + openapiFields.add("UnverifiedEmail"); + openapiFields.add("Positions"); + openapiFields.add("Educations"); + openapiFields.add("PhoneNumbers"); + openapiFields.add("IMAccounts"); + openapiFields.add("Addresses"); + openapiFields.add("Interests"); + openapiFields.add("Sports"); + openapiFields.add("InspirationalPeople"); + openapiFields.add("Awards"); + openapiFields.add("Skills"); + openapiFields.add("CurrentStatus"); + openapiFields.add("Certifications"); + openapiFields.add("Courses"); + openapiFields.add("Volunteer"); + openapiFields.add("RecommendationsReceived"); + openapiFields.add("Languages"); + openapiFields.add("Projects"); + openapiFields.add("Games"); + openapiFields.add("Family"); + openapiFields.add("TelevisionShow"); + openapiFields.add("MutualFriends"); + openapiFields.add("Movies"); + openapiFields.add("Books"); + openapiFields.add("Patents"); + openapiFields.add("FavoriteThings"); + openapiFields.add("RelatedProfileViews"); + openapiFields.add("PlacesLived"); + openapiFields.add("Publications"); + openapiFields.add("JobBookmarks"); + openapiFields.add("Badges"); + openapiFields.add("MemberUrlResources"); + openapiFields.add("Organizations"); + openapiFields.add("ObjectId"); + openapiFields.add("Email"); + openapiFields.add("PasskeyLogin"); + openapiFields.add("Identities"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 IdentityResponseWithSocialWithoutLogins + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IdentityResponseWithSocialWithoutLogins.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IdentityResponseWithSocialWithoutLogins is not found in the empty JSON string", IdentityResponseWithSocialWithoutLogins.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonNull()) && !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("Provider") != null && !jsonObj.get("Provider").isJsonNull()) && !jsonObj.get("Provider").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Provider` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Provider").toString())); + } + if ((jsonObj.get("FullName") != null && !jsonObj.get("FullName").isJsonNull()) && !jsonObj.get("FullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FullName").toString())); + } + if ((jsonObj.get("FirstName") != null && !jsonObj.get("FirstName").isJsonNull()) && !jsonObj.get("FirstName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FirstName").toString())); + } + if ((jsonObj.get("LastName") != null && !jsonObj.get("LastName").isJsonNull()) && !jsonObj.get("LastName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastName").toString())); + } + if ((jsonObj.get("PhoneId") != null && !jsonObj.get("PhoneId").isJsonNull()) && !jsonObj.get("PhoneId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PhoneId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PhoneId").toString())); + } + if ((jsonObj.get("UserName") != null && !jsonObj.get("UserName").isJsonNull()) && !jsonObj.get("UserName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UserName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UserName").toString())); + } + if ((jsonObj.get("Prefix") != null && !jsonObj.get("Prefix").isJsonNull()) && !jsonObj.get("Prefix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Prefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Prefix").toString())); + } + if ((jsonObj.get("MiddleName") != null && !jsonObj.get("MiddleName").isJsonNull()) && !jsonObj.get("MiddleName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MiddleName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MiddleName").toString())); + } + if ((jsonObj.get("Suffix") != null && !jsonObj.get("Suffix").isJsonNull()) && !jsonObj.get("Suffix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Suffix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Suffix").toString())); + } + if ((jsonObj.get("NickName") != null && !jsonObj.get("NickName").isJsonNull()) && !jsonObj.get("NickName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NickName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NickName").toString())); + } + if ((jsonObj.get("ProfileName") != null && !jsonObj.get("ProfileName").isJsonNull()) && !jsonObj.get("ProfileName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileName").toString())); + } + if ((jsonObj.get("BirthDate") != null && !jsonObj.get("BirthDate").isJsonNull()) && !jsonObj.get("BirthDate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `BirthDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BirthDate").toString())); + } + if ((jsonObj.get("Gender") != null && !jsonObj.get("Gender").isJsonNull()) && !jsonObj.get("Gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Gender").toString())); + } + if ((jsonObj.get("Website") != null && !jsonObj.get("Website").isJsonNull()) && !jsonObj.get("Website").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Website` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Website").toString())); + } + if ((jsonObj.get("ThumbnailImageUrl") != null && !jsonObj.get("ThumbnailImageUrl").isJsonNull()) && !jsonObj.get("ThumbnailImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ThumbnailImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ThumbnailImageUrl").toString())); + } + if ((jsonObj.get("ImageUrl") != null && !jsonObj.get("ImageUrl").isJsonNull()) && !jsonObj.get("ImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ImageUrl").toString())); + } + if ((jsonObj.get("Favicon") != null && !jsonObj.get("Favicon").isJsonNull()) && !jsonObj.get("Favicon").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Favicon` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Favicon").toString())); + } + if ((jsonObj.get("ProfileUrl") != null && !jsonObj.get("ProfileUrl").isJsonNull()) && !jsonObj.get("ProfileUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileUrl").toString())); + } + if ((jsonObj.get("HomeTown") != null && !jsonObj.get("HomeTown").isJsonNull()) && !jsonObj.get("HomeTown").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HomeTown` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HomeTown").toString())); + } + if ((jsonObj.get("State") != null && !jsonObj.get("State").isJsonNull()) && !jsonObj.get("State").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `State` to be a primitive type in the JSON string but got `%s`", jsonObj.get("State").toString())); + } + if ((jsonObj.get("City") != null && !jsonObj.get("City").isJsonNull()) && !jsonObj.get("City").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `City` to be a primitive type in the JSON string but got `%s`", jsonObj.get("City").toString())); + } + if ((jsonObj.get("Industry") != null && !jsonObj.get("Industry").isJsonNull()) && !jsonObj.get("Industry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Industry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Industry").toString())); + } + if ((jsonObj.get("About") != null && !jsonObj.get("About").isJsonNull()) && !jsonObj.get("About").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `About` to be a primitive type in the JSON string but got `%s`", jsonObj.get("About").toString())); + } + if ((jsonObj.get("TimeZone") != null && !jsonObj.get("TimeZone").isJsonNull()) && !jsonObj.get("TimeZone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TimeZone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TimeZone").toString())); + } + if ((jsonObj.get("LocalLanguage") != null && !jsonObj.get("LocalLanguage").isJsonNull()) && !jsonObj.get("LocalLanguage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalLanguage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalLanguage").toString())); + } + if ((jsonObj.get("CoverPhoto") != null && !jsonObj.get("CoverPhoto").isJsonNull()) && !jsonObj.get("CoverPhoto").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CoverPhoto` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CoverPhoto").toString())); + } + if ((jsonObj.get("TagLine") != null && !jsonObj.get("TagLine").isJsonNull()) && !jsonObj.get("TagLine").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TagLine` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TagLine").toString())); + } + if ((jsonObj.get("Language") != null && !jsonObj.get("Language").isJsonNull()) && !jsonObj.get("Language").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Language` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Language").toString())); + } + if ((jsonObj.get("Verified") != null && !jsonObj.get("Verified").isJsonNull()) && !jsonObj.get("Verified").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Verified` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Verified").toString())); + } + if ((jsonObj.get("UpdatedTime") != null && !jsonObj.get("UpdatedTime").isJsonNull()) && !jsonObj.get("UpdatedTime").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UpdatedTime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UpdatedTime").toString())); + } + if ((jsonObj.get("IsGeoEnabled") != null && !jsonObj.get("IsGeoEnabled").isJsonNull()) && !jsonObj.get("IsGeoEnabled").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IsGeoEnabled` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IsGeoEnabled").toString())); + } + if ((jsonObj.get("Associations") != null && !jsonObj.get("Associations").isJsonNull()) && !jsonObj.get("Associations").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Associations` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Associations").toString())); + } + if ((jsonObj.get("Honors") != null && !jsonObj.get("Honors").isJsonNull()) && !jsonObj.get("Honors").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Honors` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Honors").toString())); + } + if ((jsonObj.get("HttpsImageUrl") != null && !jsonObj.get("HttpsImageUrl").isJsonNull()) && !jsonObj.get("HttpsImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HttpsImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HttpsImageUrl").toString())); + } + if ((jsonObj.get("MainAddress") != null && !jsonObj.get("MainAddress").isJsonNull()) && !jsonObj.get("MainAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MainAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MainAddress").toString())); + } + if ((jsonObj.get("Created") != null && !jsonObj.get("Created").isJsonNull()) && !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("LocalCity") != null && !jsonObj.get("LocalCity").isJsonNull()) && !jsonObj.get("LocalCity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalCity").toString())); + } + if ((jsonObj.get("ProfileCity") != null && !jsonObj.get("ProfileCity").isJsonNull()) && !jsonObj.get("ProfileCity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileCity").toString())); + } + if ((jsonObj.get("LocalCountry") != null && !jsonObj.get("LocalCountry").isJsonNull()) && !jsonObj.get("LocalCountry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalCountry").toString())); + } + if ((jsonObj.get("ProfileCountry") != null && !jsonObj.get("ProfileCountry").isJsonNull()) && !jsonObj.get("ProfileCountry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileCountry").toString())); + } + if ((jsonObj.get("RelationshipStatus") != null && !jsonObj.get("RelationshipStatus").isJsonNull()) && !jsonObj.get("RelationshipStatus").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RelationshipStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RelationshipStatus").toString())); + } + if ((jsonObj.get("Quota") != null && !jsonObj.get("Quota").isJsonNull()) && !jsonObj.get("Quota").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Quota` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Quota").toString())); + } + if ((jsonObj.get("Quote") != null && !jsonObj.get("Quote").isJsonNull()) && !jsonObj.get("Quote").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Quote` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Quote").toString())); + } + if ((jsonObj.get("Religion") != null && !jsonObj.get("Religion").isJsonNull()) && !jsonObj.get("Religion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Religion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Religion").toString())); + } + if ((jsonObj.get("Political") != null && !jsonObj.get("Political").isJsonNull()) && !jsonObj.get("Political").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Political` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Political").toString())); + } + if ((jsonObj.get("PublicRepository") != null && !jsonObj.get("PublicRepository").isJsonNull()) && !jsonObj.get("PublicRepository").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PublicRepository` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PublicRepository").toString())); + } + if ((jsonObj.get("RepositoryUrl") != null && !jsonObj.get("RepositoryUrl").isJsonNull()) && !jsonObj.get("RepositoryUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RepositoryUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RepositoryUrl").toString())); + } + if ((jsonObj.get("Age") != null && !jsonObj.get("Age").isJsonNull()) && !jsonObj.get("Age").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Age` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Age").toString())); + } + if ((jsonObj.get("ProfessionalHeadline") != null && !jsonObj.get("ProfessionalHeadline").isJsonNull()) && !jsonObj.get("ProfessionalHeadline").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfessionalHeadline` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfessionalHeadline").toString())); + } + if ((jsonObj.get("LRUserID") != null && !jsonObj.get("LRUserID").isJsonNull()) && !jsonObj.get("LRUserID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LRUserID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LRUserID").toString())); + } + if ((jsonObj.get("Currency") != null && !jsonObj.get("Currency").isJsonNull()) && !jsonObj.get("Currency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Currency").toString())); + } + if ((jsonObj.get("StarredUrl") != null && !jsonObj.get("StarredUrl").isJsonNull()) && !jsonObj.get("StarredUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `StarredUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("StarredUrl").toString())); + } + if ((jsonObj.get("GistsUrl") != null && !jsonObj.get("GistsUrl").isJsonNull()) && !jsonObj.get("GistsUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GistsUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GistsUrl").toString())); + } + if ((jsonObj.get("Company") != null && !jsonObj.get("Company").isJsonNull()) && !jsonObj.get("Company").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Company` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Company").toString())); + } + if ((jsonObj.get("GravatarImageUrl") != null && !jsonObj.get("GravatarImageUrl").isJsonNull()) && !jsonObj.get("GravatarImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GravatarImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GravatarImageUrl").toString())); + } + // validate the optional field `PrivacyPolicy` + if (jsonObj.get("PrivacyPolicy") != null && !jsonObj.get("PrivacyPolicy").isJsonNull()) { + ProfilePrivacyPolicy.validateJsonElement(jsonObj.get("PrivacyPolicy")); + } + // validate the optional field `Country` + if (jsonObj.get("Country") != null && !jsonObj.get("Country").isJsonNull()) { + ProfileCountry.validateJsonElement(jsonObj.get("Country")); + } + // validate the optional field `AgeRange` + if (jsonObj.get("AgeRange") != null && !jsonObj.get("AgeRange").isJsonNull()) { + ProfileAgeRange.validateJsonElement(jsonObj.get("AgeRange")); + } + // validate the optional field `KloutScore` + if (jsonObj.get("KloutScore") != null && !jsonObj.get("KloutScore").isJsonNull()) { + ProfileKloutScore.validateJsonElement(jsonObj.get("KloutScore")); + } + // validate the optional field `Suggestions` + if (jsonObj.get("Suggestions") != null && !jsonObj.get("Suggestions").isJsonNull()) { + ProfileSuggestions.validateJsonElement(jsonObj.get("Suggestions")); + } + // validate the optional field `Subscription` + if (jsonObj.get("Subscription") != null && !jsonObj.get("Subscription").isJsonNull()) { + ProfileSubscription.validateJsonElement(jsonObj.get("Subscription")); + } + // validate the optional field `PIN` + if (jsonObj.get("PIN") != null && !jsonObj.get("PIN").isJsonNull()) { + ProfilePIN.validateJsonElement(jsonObj.get("PIN")); + } + // validate the optional field `ConsentProfile` + if (jsonObj.get("ConsentProfile") != null && !jsonObj.get("ConsentProfile").isJsonNull()) { + ProfileConsentProfile.validateJsonElement(jsonObj.get("ConsentProfile")); + } + // validate the optional field `RegistrationData` + if (jsonObj.get("RegistrationData") != null && !jsonObj.get("RegistrationData").isJsonNull()) { + ProfileRegistrationData.validateJsonElement(jsonObj.get("RegistrationData")); + } + // validate the optional field `ProviderAccessCredential` + if (jsonObj.get("ProviderAccessCredential") != null && !jsonObj.get("ProviderAccessCredential").isJsonNull()) { + ProfileProviderAccessCredential.validateJsonElement(jsonObj.get("ProviderAccessCredential")); + } + // ensure the optional json data is an array if present + if (jsonObj.get("Roles") != null && !jsonObj.get("Roles").isJsonNull() && !jsonObj.get("Roles").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Roles` to be an array in the JSON string but got `%s`", jsonObj.get("Roles").toString())); + } + if ((jsonObj.get("Uid") != null && !jsonObj.get("Uid").isJsonNull()) && !jsonObj.get("Uid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Uid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Uid").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("PreviousUids") != null && !jsonObj.get("PreviousUids").isJsonNull() && !jsonObj.get("PreviousUids").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PreviousUids` to be an array in the JSON string but got `%s`", jsonObj.get("PreviousUids").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("InterestedIn") != null && !jsonObj.get("InterestedIn").isJsonNull() && !jsonObj.get("InterestedIn").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `InterestedIn` to be an array in the JSON string but got `%s`", jsonObj.get("InterestedIn").toString())); + } + if (jsonObj.get("ExternalIds") != null && !jsonObj.get("ExternalIds").isJsonNull()) { + JsonArray jsonArrayexternalIds = jsonObj.getAsJsonArray("ExternalIds"); + if (jsonArrayexternalIds != null) { + // ensure the json data is an array + if (!jsonObj.get("ExternalIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ExternalIds` to be an array in the JSON string but got `%s`", jsonObj.get("ExternalIds").toString())); + } + + // validate the optional field `ExternalIds` (array) + for (int i = 0; i < jsonArrayexternalIds.size(); i++) { + ProfileExternalIdsInner.validateJsonElement(jsonArrayexternalIds.get(i)); + }; + } + } + if (jsonObj.get("UnverifiedEmail") != null && !jsonObj.get("UnverifiedEmail").isJsonNull()) { + JsonArray jsonArrayunverifiedEmail = jsonObj.getAsJsonArray("UnverifiedEmail"); + if (jsonArrayunverifiedEmail != null) { + // ensure the json data is an array + if (!jsonObj.get("UnverifiedEmail").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `UnverifiedEmail` to be an array in the JSON string but got `%s`", jsonObj.get("UnverifiedEmail").toString())); + } + + // validate the optional field `UnverifiedEmail` (array) + for (int i = 0; i < jsonArrayunverifiedEmail.size(); i++) { + ProfileUnverifiedEmailInner.validateJsonElement(jsonArrayunverifiedEmail.get(i)); + }; + } + } + if (jsonObj.get("Positions") != null && !jsonObj.get("Positions").isJsonNull()) { + JsonArray jsonArraypositions = jsonObj.getAsJsonArray("Positions"); + if (jsonArraypositions != null) { + // ensure the json data is an array + if (!jsonObj.get("Positions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Positions` to be an array in the JSON string but got `%s`", jsonObj.get("Positions").toString())); + } + + // validate the optional field `Positions` (array) + for (int i = 0; i < jsonArraypositions.size(); i++) { + ProfilePositionsInner.validateJsonElement(jsonArraypositions.get(i)); + }; + } + } + if (jsonObj.get("Educations") != null && !jsonObj.get("Educations").isJsonNull()) { + JsonArray jsonArrayeducations = jsonObj.getAsJsonArray("Educations"); + if (jsonArrayeducations != null) { + // ensure the json data is an array + if (!jsonObj.get("Educations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Educations` to be an array in the JSON string but got `%s`", jsonObj.get("Educations").toString())); + } + + // validate the optional field `Educations` (array) + for (int i = 0; i < jsonArrayeducations.size(); i++) { + ProfileEducationsInner.validateJsonElement(jsonArrayeducations.get(i)); + }; + } + } + if (jsonObj.get("PhoneNumbers") != null && !jsonObj.get("PhoneNumbers").isJsonNull()) { + JsonArray jsonArrayphoneNumbers = jsonObj.getAsJsonArray("PhoneNumbers"); + if (jsonArrayphoneNumbers != null) { + // ensure the json data is an array + if (!jsonObj.get("PhoneNumbers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PhoneNumbers` to be an array in the JSON string but got `%s`", jsonObj.get("PhoneNumbers").toString())); + } + + // validate the optional field `PhoneNumbers` (array) + for (int i = 0; i < jsonArrayphoneNumbers.size(); i++) { + ProfilePhoneNumbersInner.validateJsonElement(jsonArrayphoneNumbers.get(i)); + }; + } + } + if (jsonObj.get("IMAccounts") != null && !jsonObj.get("IMAccounts").isJsonNull()) { + JsonArray jsonArrayimAccounts = jsonObj.getAsJsonArray("IMAccounts"); + if (jsonArrayimAccounts != null) { + // ensure the json data is an array + if (!jsonObj.get("IMAccounts").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `IMAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("IMAccounts").toString())); + } + + // validate the optional field `IMAccounts` (array) + for (int i = 0; i < jsonArrayimAccounts.size(); i++) { + ProfileIMAccountsInner.validateJsonElement(jsonArrayimAccounts.get(i)); + }; + } + } + if (jsonObj.get("Addresses") != null && !jsonObj.get("Addresses").isJsonNull()) { + JsonArray jsonArrayaddresses = jsonObj.getAsJsonArray("Addresses"); + if (jsonArrayaddresses != null) { + // ensure the json data is an array + if (!jsonObj.get("Addresses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Addresses` to be an array in the JSON string but got `%s`", jsonObj.get("Addresses").toString())); + } + + // validate the optional field `Addresses` (array) + for (int i = 0; i < jsonArrayaddresses.size(); i++) { + ProfileAddressesInner.validateJsonElement(jsonArrayaddresses.get(i)); + }; + } + } + if (jsonObj.get("Interests") != null && !jsonObj.get("Interests").isJsonNull()) { + JsonArray jsonArrayinterests = jsonObj.getAsJsonArray("Interests"); + if (jsonArrayinterests != null) { + // ensure the json data is an array + if (!jsonObj.get("Interests").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Interests` to be an array in the JSON string but got `%s`", jsonObj.get("Interests").toString())); + } + + // validate the optional field `Interests` (array) + for (int i = 0; i < jsonArrayinterests.size(); i++) { + ProfileInterestsInner.validateJsonElement(jsonArrayinterests.get(i)); + }; + } + } + if (jsonObj.get("Sports") != null && !jsonObj.get("Sports").isJsonNull()) { + JsonArray jsonArraysports = jsonObj.getAsJsonArray("Sports"); + if (jsonArraysports != null) { + // ensure the json data is an array + if (!jsonObj.get("Sports").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Sports` to be an array in the JSON string but got `%s`", jsonObj.get("Sports").toString())); + } + + // validate the optional field `Sports` (array) + for (int i = 0; i < jsonArraysports.size(); i++) { + ProfileSportsInner.validateJsonElement(jsonArraysports.get(i)); + }; + } + } + if (jsonObj.get("InspirationalPeople") != null && !jsonObj.get("InspirationalPeople").isJsonNull()) { + JsonArray jsonArrayinspirationalPeople = jsonObj.getAsJsonArray("InspirationalPeople"); + if (jsonArrayinspirationalPeople != null) { + // ensure the json data is an array + if (!jsonObj.get("InspirationalPeople").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `InspirationalPeople` to be an array in the JSON string but got `%s`", jsonObj.get("InspirationalPeople").toString())); + } + + // validate the optional field `InspirationalPeople` (array) + for (int i = 0; i < jsonArrayinspirationalPeople.size(); i++) { + ProfileInspirationalPeopleInner.validateJsonElement(jsonArrayinspirationalPeople.get(i)); + }; + } + } + if (jsonObj.get("Awards") != null && !jsonObj.get("Awards").isJsonNull()) { + JsonArray jsonArrayawards = jsonObj.getAsJsonArray("Awards"); + if (jsonArrayawards != null) { + // ensure the json data is an array + if (!jsonObj.get("Awards").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Awards` to be an array in the JSON string but got `%s`", jsonObj.get("Awards").toString())); + } + + // validate the optional field `Awards` (array) + for (int i = 0; i < jsonArrayawards.size(); i++) { + ProfileAwardsInner.validateJsonElement(jsonArrayawards.get(i)); + }; + } + } + if (jsonObj.get("Skills") != null && !jsonObj.get("Skills").isJsonNull()) { + JsonArray jsonArrayskills = jsonObj.getAsJsonArray("Skills"); + if (jsonArrayskills != null) { + // ensure the json data is an array + if (!jsonObj.get("Skills").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Skills` to be an array in the JSON string but got `%s`", jsonObj.get("Skills").toString())); + } + + // validate the optional field `Skills` (array) + for (int i = 0; i < jsonArrayskills.size(); i++) { + ProfileSkillsInner.validateJsonElement(jsonArrayskills.get(i)); + }; + } + } + if (jsonObj.get("CurrentStatus") != null && !jsonObj.get("CurrentStatus").isJsonNull()) { + JsonArray jsonArraycurrentStatus = jsonObj.getAsJsonArray("CurrentStatus"); + if (jsonArraycurrentStatus != null) { + // ensure the json data is an array + if (!jsonObj.get("CurrentStatus").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `CurrentStatus` to be an array in the JSON string but got `%s`", jsonObj.get("CurrentStatus").toString())); + } + + // validate the optional field `CurrentStatus` (array) + for (int i = 0; i < jsonArraycurrentStatus.size(); i++) { + ProfileCurrentStatusInner.validateJsonElement(jsonArraycurrentStatus.get(i)); + }; + } + } + if (jsonObj.get("Certifications") != null && !jsonObj.get("Certifications").isJsonNull()) { + JsonArray jsonArraycertifications = jsonObj.getAsJsonArray("Certifications"); + if (jsonArraycertifications != null) { + // ensure the json data is an array + if (!jsonObj.get("Certifications").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Certifications` to be an array in the JSON string but got `%s`", jsonObj.get("Certifications").toString())); + } + + // validate the optional field `Certifications` (array) + for (int i = 0; i < jsonArraycertifications.size(); i++) { + ProfileCertificationsInner.validateJsonElement(jsonArraycertifications.get(i)); + }; + } + } + if (jsonObj.get("Courses") != null && !jsonObj.get("Courses").isJsonNull()) { + JsonArray jsonArraycourses = jsonObj.getAsJsonArray("Courses"); + if (jsonArraycourses != null) { + // ensure the json data is an array + if (!jsonObj.get("Courses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Courses` to be an array in the JSON string but got `%s`", jsonObj.get("Courses").toString())); + } + + // validate the optional field `Courses` (array) + for (int i = 0; i < jsonArraycourses.size(); i++) { + ProfileCoursesInner.validateJsonElement(jsonArraycourses.get(i)); + }; + } + } + if (jsonObj.get("Volunteer") != null && !jsonObj.get("Volunteer").isJsonNull()) { + JsonArray jsonArrayvolunteer = jsonObj.getAsJsonArray("Volunteer"); + if (jsonArrayvolunteer != null) { + // ensure the json data is an array + if (!jsonObj.get("Volunteer").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Volunteer` to be an array in the JSON string but got `%s`", jsonObj.get("Volunteer").toString())); + } + + // validate the optional field `Volunteer` (array) + for (int i = 0; i < jsonArrayvolunteer.size(); i++) { + ProfileVolunteerInner.validateJsonElement(jsonArrayvolunteer.get(i)); + }; + } + } + if (jsonObj.get("RecommendationsReceived") != null && !jsonObj.get("RecommendationsReceived").isJsonNull()) { + JsonArray jsonArrayrecommendationsReceived = jsonObj.getAsJsonArray("RecommendationsReceived"); + if (jsonArrayrecommendationsReceived != null) { + // ensure the json data is an array + if (!jsonObj.get("RecommendationsReceived").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RecommendationsReceived` to be an array in the JSON string but got `%s`", jsonObj.get("RecommendationsReceived").toString())); + } + + // validate the optional field `RecommendationsReceived` (array) + for (int i = 0; i < jsonArrayrecommendationsReceived.size(); i++) { + ProfileRecommendationsReceivedInner.validateJsonElement(jsonArrayrecommendationsReceived.get(i)); + }; + } + } + if (jsonObj.get("Languages") != null && !jsonObj.get("Languages").isJsonNull()) { + JsonArray jsonArraylanguages = jsonObj.getAsJsonArray("Languages"); + if (jsonArraylanguages != null) { + // ensure the json data is an array + if (!jsonObj.get("Languages").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Languages` to be an array in the JSON string but got `%s`", jsonObj.get("Languages").toString())); + } + + // validate the optional field `Languages` (array) + for (int i = 0; i < jsonArraylanguages.size(); i++) { + ProfileLanguagesInner.validateJsonElement(jsonArraylanguages.get(i)); + }; + } + } + if (jsonObj.get("Projects") != null && !jsonObj.get("Projects").isJsonNull()) { + JsonArray jsonArrayprojects = jsonObj.getAsJsonArray("Projects"); + if (jsonArrayprojects != null) { + // ensure the json data is an array + if (!jsonObj.get("Projects").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Projects` to be an array in the JSON string but got `%s`", jsonObj.get("Projects").toString())); + } + + // validate the optional field `Projects` (array) + for (int i = 0; i < jsonArrayprojects.size(); i++) { + ProfileProjectsInner.validateJsonElement(jsonArrayprojects.get(i)); + }; + } + } + if (jsonObj.get("Games") != null && !jsonObj.get("Games").isJsonNull()) { + JsonArray jsonArraygames = jsonObj.getAsJsonArray("Games"); + if (jsonArraygames != null) { + // ensure the json data is an array + if (!jsonObj.get("Games").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Games` to be an array in the JSON string but got `%s`", jsonObj.get("Games").toString())); + } + + // validate the optional field `Games` (array) + for (int i = 0; i < jsonArraygames.size(); i++) { + ProfileGamesInner.validateJsonElement(jsonArraygames.get(i)); + }; + } + } + if (jsonObj.get("Family") != null && !jsonObj.get("Family").isJsonNull()) { + JsonArray jsonArrayfamily = jsonObj.getAsJsonArray("Family"); + if (jsonArrayfamily != null) { + // ensure the json data is an array + if (!jsonObj.get("Family").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Family` to be an array in the JSON string but got `%s`", jsonObj.get("Family").toString())); + } + + // validate the optional field `Family` (array) + for (int i = 0; i < jsonArrayfamily.size(); i++) { + ProfileFamilyInner.validateJsonElement(jsonArrayfamily.get(i)); + }; + } + } + if (jsonObj.get("TelevisionShow") != null && !jsonObj.get("TelevisionShow").isJsonNull()) { + JsonArray jsonArraytelevisionShow = jsonObj.getAsJsonArray("TelevisionShow"); + if (jsonArraytelevisionShow != null) { + // ensure the json data is an array + if (!jsonObj.get("TelevisionShow").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `TelevisionShow` to be an array in the JSON string but got `%s`", jsonObj.get("TelevisionShow").toString())); + } + + // validate the optional field `TelevisionShow` (array) + for (int i = 0; i < jsonArraytelevisionShow.size(); i++) { + ProfileTelevisionShowInner.validateJsonElement(jsonArraytelevisionShow.get(i)); + }; + } + } + if (jsonObj.get("MutualFriends") != null && !jsonObj.get("MutualFriends").isJsonNull()) { + JsonArray jsonArraymutualFriends = jsonObj.getAsJsonArray("MutualFriends"); + if (jsonArraymutualFriends != null) { + // ensure the json data is an array + if (!jsonObj.get("MutualFriends").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `MutualFriends` to be an array in the JSON string but got `%s`", jsonObj.get("MutualFriends").toString())); + } + + // validate the optional field `MutualFriends` (array) + for (int i = 0; i < jsonArraymutualFriends.size(); i++) { + ProfileMutualFriendsInner.validateJsonElement(jsonArraymutualFriends.get(i)); + }; + } + } + if (jsonObj.get("Movies") != null && !jsonObj.get("Movies").isJsonNull()) { + JsonArray jsonArraymovies = jsonObj.getAsJsonArray("Movies"); + if (jsonArraymovies != null) { + // ensure the json data is an array + if (!jsonObj.get("Movies").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Movies` to be an array in the JSON string but got `%s`", jsonObj.get("Movies").toString())); + } + + // validate the optional field `Movies` (array) + for (int i = 0; i < jsonArraymovies.size(); i++) { + ProfileMoviesInner.validateJsonElement(jsonArraymovies.get(i)); + }; + } + } + if (jsonObj.get("Books") != null && !jsonObj.get("Books").isJsonNull()) { + JsonArray jsonArraybooks = jsonObj.getAsJsonArray("Books"); + if (jsonArraybooks != null) { + // ensure the json data is an array + if (!jsonObj.get("Books").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Books` to be an array in the JSON string but got `%s`", jsonObj.get("Books").toString())); + } + + // validate the optional field `Books` (array) + for (int i = 0; i < jsonArraybooks.size(); i++) { + ProfileBooksInner.validateJsonElement(jsonArraybooks.get(i)); + }; + } + } + if (jsonObj.get("Patents") != null && !jsonObj.get("Patents").isJsonNull()) { + JsonArray jsonArraypatents = jsonObj.getAsJsonArray("Patents"); + if (jsonArraypatents != null) { + // ensure the json data is an array + if (!jsonObj.get("Patents").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Patents` to be an array in the JSON string but got `%s`", jsonObj.get("Patents").toString())); + } + + // validate the optional field `Patents` (array) + for (int i = 0; i < jsonArraypatents.size(); i++) { + ProfilePatentsInner.validateJsonElement(jsonArraypatents.get(i)); + }; + } + } + if (jsonObj.get("FavoriteThings") != null && !jsonObj.get("FavoriteThings").isJsonNull()) { + JsonArray jsonArrayfavoriteThings = jsonObj.getAsJsonArray("FavoriteThings"); + if (jsonArrayfavoriteThings != null) { + // ensure the json data is an array + if (!jsonObj.get("FavoriteThings").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `FavoriteThings` to be an array in the JSON string but got `%s`", jsonObj.get("FavoriteThings").toString())); + } + + // validate the optional field `FavoriteThings` (array) + for (int i = 0; i < jsonArrayfavoriteThings.size(); i++) { + ProfileFavoriteThingsInner.validateJsonElement(jsonArrayfavoriteThings.get(i)); + }; + } + } + if (jsonObj.get("RelatedProfileViews") != null && !jsonObj.get("RelatedProfileViews").isJsonNull()) { + JsonArray jsonArrayrelatedProfileViews = jsonObj.getAsJsonArray("RelatedProfileViews"); + if (jsonArrayrelatedProfileViews != null) { + // ensure the json data is an array + if (!jsonObj.get("RelatedProfileViews").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RelatedProfileViews` to be an array in the JSON string but got `%s`", jsonObj.get("RelatedProfileViews").toString())); + } + + // validate the optional field `RelatedProfileViews` (array) + for (int i = 0; i < jsonArrayrelatedProfileViews.size(); i++) { + ProfileRelatedProfileViewsInner.validateJsonElement(jsonArrayrelatedProfileViews.get(i)); + }; + } + } + if (jsonObj.get("PlacesLived") != null && !jsonObj.get("PlacesLived").isJsonNull()) { + JsonArray jsonArrayplacesLived = jsonObj.getAsJsonArray("PlacesLived"); + if (jsonArrayplacesLived != null) { + // ensure the json data is an array + if (!jsonObj.get("PlacesLived").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PlacesLived` to be an array in the JSON string but got `%s`", jsonObj.get("PlacesLived").toString())); + } + + // validate the optional field `PlacesLived` (array) + for (int i = 0; i < jsonArrayplacesLived.size(); i++) { + ProfilePlacesLivedInner.validateJsonElement(jsonArrayplacesLived.get(i)); + }; + } + } + if (jsonObj.get("Publications") != null && !jsonObj.get("Publications").isJsonNull()) { + JsonArray jsonArraypublications = jsonObj.getAsJsonArray("Publications"); + if (jsonArraypublications != null) { + // ensure the json data is an array + if (!jsonObj.get("Publications").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Publications` to be an array in the JSON string but got `%s`", jsonObj.get("Publications").toString())); + } + + // validate the optional field `Publications` (array) + for (int i = 0; i < jsonArraypublications.size(); i++) { + ProfilePublicationsInner.validateJsonElement(jsonArraypublications.get(i)); + }; + } + } + if (jsonObj.get("JobBookmarks") != null && !jsonObj.get("JobBookmarks").isJsonNull()) { + JsonArray jsonArrayjobBookmarks = jsonObj.getAsJsonArray("JobBookmarks"); + if (jsonArrayjobBookmarks != null) { + // ensure the json data is an array + if (!jsonObj.get("JobBookmarks").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `JobBookmarks` to be an array in the JSON string but got `%s`", jsonObj.get("JobBookmarks").toString())); + } + + // validate the optional field `JobBookmarks` (array) + for (int i = 0; i < jsonArrayjobBookmarks.size(); i++) { + ProfileJobBookmarksInner.validateJsonElement(jsonArrayjobBookmarks.get(i)); + }; + } + } + if (jsonObj.get("Badges") != null && !jsonObj.get("Badges").isJsonNull()) { + JsonArray jsonArraybadges = jsonObj.getAsJsonArray("Badges"); + if (jsonArraybadges != null) { + // ensure the json data is an array + if (!jsonObj.get("Badges").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Badges` to be an array in the JSON string but got `%s`", jsonObj.get("Badges").toString())); + } + + // validate the optional field `Badges` (array) + for (int i = 0; i < jsonArraybadges.size(); i++) { + ProfileBadgesInner.validateJsonElement(jsonArraybadges.get(i)); + }; + } + } + if (jsonObj.get("MemberUrlResources") != null && !jsonObj.get("MemberUrlResources").isJsonNull()) { + JsonArray jsonArraymemberUrlResources = jsonObj.getAsJsonArray("MemberUrlResources"); + if (jsonArraymemberUrlResources != null) { + // ensure the json data is an array + if (!jsonObj.get("MemberUrlResources").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `MemberUrlResources` to be an array in the JSON string but got `%s`", jsonObj.get("MemberUrlResources").toString())); + } + + // validate the optional field `MemberUrlResources` (array) + for (int i = 0; i < jsonArraymemberUrlResources.size(); i++) { + ProfileMemberUrlResourcesInner.validateJsonElement(jsonArraymemberUrlResources.get(i)); + }; + } + } + if (jsonObj.get("Organizations") != null && !jsonObj.get("Organizations").isJsonNull()) { + JsonArray jsonArrayorganizations = jsonObj.getAsJsonArray("Organizations"); + if (jsonArrayorganizations != null) { + // ensure the json data is an array + if (!jsonObj.get("Organizations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Organizations` to be an array in the JSON string but got `%s`", jsonObj.get("Organizations").toString())); + } + + // validate the optional field `Organizations` (array) + for (int i = 0; i < jsonArrayorganizations.size(); i++) { + ProfileOrganizationsInner.validateJsonElement(jsonArrayorganizations.get(i)); + }; + } + } + if ((jsonObj.get("ObjectId") != null && !jsonObj.get("ObjectId").isJsonNull()) && !jsonObj.get("ObjectId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ObjectId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ObjectId").toString())); + } + if (jsonObj.get("Email") != null && !jsonObj.get("Email").isJsonNull()) { + JsonArray jsonArrayemail = jsonObj.getAsJsonArray("Email"); + if (jsonArrayemail != null) { + // ensure the json data is an array + if (!jsonObj.get("Email").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Email` to be an array in the JSON string but got `%s`", jsonObj.get("Email").toString())); + } + + // validate the optional field `Email` (array) + for (int i = 0; i < jsonArrayemail.size(); i++) { + ProfileEmailInner.validateJsonElement(jsonArrayemail.get(i)); + }; + } + } + // validate the optional field `PasskeyLogin` + if (jsonObj.get("PasskeyLogin") != null && !jsonObj.get("PasskeyLogin").isJsonNull()) { + IdentityPasskeyLogin.validateJsonElement(jsonObj.get("PasskeyLogin")); + } + if (jsonObj.get("Identities") != null && !jsonObj.get("Identities").isJsonNull()) { + JsonArray jsonArrayidentities = jsonObj.getAsJsonArray("Identities"); + if (jsonArrayidentities != null) { + // ensure the json data is an array + if (!jsonObj.get("Identities").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Identities` to be an array in the JSON string but got `%s`", jsonObj.get("Identities").toString())); + } + + // validate the optional field `Identities` (array) + for (int i = 0; i < jsonArrayidentities.size(); i++) { + SocialIdentity.validateJsonElement(jsonArrayidentities.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!IdentityResponseWithSocialWithoutLogins.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IdentityResponseWithSocialWithoutLogins' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<IdentityResponseWithSocialWithoutLogins> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IdentityResponseWithSocialWithoutLogins.class)); + + return (TypeAdapter<T>) new TypeAdapter<IdentityResponseWithSocialWithoutLogins>() { + @Override + public void write(JsonWriter out, IdentityResponseWithSocialWithoutLogins value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public IdentityResponseWithSocialWithoutLogins read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + IdentityResponseWithSocialWithoutLogins instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IdentityResponseWithSocialWithoutLogins given an JSON string + * + * @param jsonString JSON string + * @return An instance of IdentityResponseWithSocialWithoutLogins + * @throws IOException if the JSON string is invalid with respect to IdentityResponseWithSocialWithoutLogins + */ + public static IdentityResponseWithSocialWithoutLogins fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IdentityResponseWithSocialWithoutLogins.class); + } + + /** + * Convert an instance of IdentityResponseWithSocialWithoutLogins to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/IdentityResponseWithSocialWithoutLoginsCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/IdentityResponseWithSocialWithoutLoginsCore.java new file mode 100644 index 0000000..adfb727 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/IdentityResponseWithSocialWithoutLoginsCore.java @@ -0,0 +1,321 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.SocialIdentity; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * IdentityResponseWithSocialWithoutLoginsCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class IdentityResponseWithSocialWithoutLoginsCore { + public static final String SERIALIZED_NAME_IDENTITIES = "Identities"; + @SerializedName(SERIALIZED_NAME_IDENTITIES) + @javax.annotation.Nullable + private List<SocialIdentity> identities; + + public IdentityResponseWithSocialWithoutLoginsCore() { + } + + public IdentityResponseWithSocialWithoutLoginsCore identities(@javax.annotation.Nullable List<SocialIdentity> identities) { + this.identities = identities; + return this; + } + + public IdentityResponseWithSocialWithoutLoginsCore addIdentitiesItem(SocialIdentity identitiesItem) { + if (this.identities == null) { + this.identities = new ArrayList<>(); + } + this.identities.add(identitiesItem); + return this; + } + + /** + * List of identities with social information but without login details. + * @return identities + */ + @javax.annotation.Nullable + public List<SocialIdentity> getIdentities() { + return identities; + } + + public void setIdentities(@javax.annotation.Nullable List<SocialIdentity> identities) { + this.identities = identities; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IdentityResponseWithSocialWithoutLoginsCore instance itself + */ + public IdentityResponseWithSocialWithoutLoginsCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IdentityResponseWithSocialWithoutLoginsCore identityResponseWithSocialWithoutLoginsCore = (IdentityResponseWithSocialWithoutLoginsCore) o; + return Objects.equals(this.identities, identityResponseWithSocialWithoutLoginsCore.identities)&& + Objects.equals(this.additionalProperties, identityResponseWithSocialWithoutLoginsCore.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(identities, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IdentityResponseWithSocialWithoutLoginsCore {\n"); + sb.append(" identities: ").append(toIndentedString(identities)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Identities"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 IdentityResponseWithSocialWithoutLoginsCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IdentityResponseWithSocialWithoutLoginsCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IdentityResponseWithSocialWithoutLoginsCore is not found in the empty JSON string", IdentityResponseWithSocialWithoutLoginsCore.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Identities") != null && !jsonObj.get("Identities").isJsonNull()) { + JsonArray jsonArrayidentities = jsonObj.getAsJsonArray("Identities"); + if (jsonArrayidentities != null) { + // ensure the json data is an array + if (!jsonObj.get("Identities").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Identities` to be an array in the JSON string but got `%s`", jsonObj.get("Identities").toString())); + } + + // validate the optional field `Identities` (array) + for (int i = 0; i < jsonArrayidentities.size(); i++) { + SocialIdentity.validateJsonElement(jsonArrayidentities.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!IdentityResponseWithSocialWithoutLoginsCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IdentityResponseWithSocialWithoutLoginsCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<IdentityResponseWithSocialWithoutLoginsCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IdentityResponseWithSocialWithoutLoginsCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<IdentityResponseWithSocialWithoutLoginsCore>() { + @Override + public void write(JsonWriter out, IdentityResponseWithSocialWithoutLoginsCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public IdentityResponseWithSocialWithoutLoginsCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + IdentityResponseWithSocialWithoutLoginsCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IdentityResponseWithSocialWithoutLoginsCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of IdentityResponseWithSocialWithoutLoginsCore + * @throws IOException if the JSON string is invalid with respect to IdentityResponseWithSocialWithoutLoginsCore + */ + public static IdentityResponseWithSocialWithoutLoginsCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IdentityResponseWithSocialWithoutLoginsCore.class); + } + + /** + * Convert an instance of IdentityResponseWithSocialWithoutLoginsCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/InsightsResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/InsightsResponse.java new file mode 100644 index 0000000..28e5363 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/InsightsResponse.java @@ -0,0 +1,321 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * InsightsResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class InsightsResponse { + public static final String SERIALIZED_NAME_TOTAL = "total"; + @SerializedName(SERIALIZED_NAME_TOTAL) + @javax.annotation.Nullable + private Integer total; + + public static final String SERIALIZED_NAME_AGGREGATIONS = "aggregations"; + @SerializedName(SERIALIZED_NAME_AGGREGATIONS) + @javax.annotation.Nullable + private Map<String, Object> aggregations = new HashMap<>(); + + public InsightsResponse() { + } + + public InsightsResponse total(@javax.annotation.Nullable Integer total) { + this.total = total; + return this; + } + + /** + * Total number of results + * @return total + */ + @javax.annotation.Nullable + public Integer getTotal() { + return total; + } + + public void setTotal(@javax.annotation.Nullable Integer total) { + this.total = total; + } + + + public InsightsResponse aggregations(@javax.annotation.Nullable Map<String, Object> aggregations) { + this.aggregations = aggregations; + return this; + } + + public InsightsResponse putAggregationsItem(String key, Object aggregationsItem) { + if (this.aggregations == null) { + this.aggregations = new HashMap<>(); + } + this.aggregations.put(key, aggregationsItem); + return this; + } + + /** + * Aggregated data + * @return aggregations + */ + @javax.annotation.Nullable + public Map<String, Object> getAggregations() { + return aggregations; + } + + public void setAggregations(@javax.annotation.Nullable Map<String, Object> aggregations) { + this.aggregations = aggregations; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the InsightsResponse instance itself + */ + public InsightsResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InsightsResponse insightsResponse = (InsightsResponse) o; + return Objects.equals(this.total, insightsResponse.total) && + Objects.equals(this.aggregations, insightsResponse.aggregations)&& + Objects.equals(this.additionalProperties, insightsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(total, aggregations, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InsightsResponse {\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" aggregations: ").append(toIndentedString(aggregations)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("total"); + openapiFields.add("aggregations"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 InsightsResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!InsightsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InsightsResponse is not found in the empty JSON string", InsightsResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!InsightsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InsightsResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<InsightsResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InsightsResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<InsightsResponse>() { + @Override + public void write(JsonWriter out, InsightsResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public InsightsResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + InsightsResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InsightsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of InsightsResponse + * @throws IOException if the JSON string is invalid with respect to InsightsResponse + */ + public static InsightsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InsightsResponse.class); + } + + /** + * Convert an instance of InsightsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/Invitation.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/Invitation.java new file mode 100644 index 0000000..21bd563 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/Invitation.java @@ -0,0 +1,590 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Invitation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class Invitation { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_EMAIL_ID = "EmailId"; + @SerializedName(SERIALIZED_NAME_EMAIL_ID) + @javax.annotation.Nullable + private String emailId; + + /** + * The status of the invitation. Possible values are *invited*, *accepted*, *expired*, and *revoked*. + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + INVITED("invited"), + + ACCEPTED("accepted"), + + EXPIRED("expired"), + + REVOKED("revoked"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<StatusEnum> { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "Status"; + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nullable + private StatusEnum status; + + public static final String SERIALIZED_NAME_ROLE_IDS = "RoleIds"; + @SerializedName(SERIALIZED_NAME_ROLE_IDS) + @javax.annotation.Nullable + private List<String> roleIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ORG_ID = "OrgId"; + @SerializedName(SERIALIZED_NAME_ORG_ID) + @javax.annotation.Nullable + private String orgId; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public static final String SERIALIZED_NAME_EXPIRATION_DATE = "ExpirationDate"; + @SerializedName(SERIALIZED_NAME_EXPIRATION_DATE) + @javax.annotation.Nullable + private OffsetDateTime expirationDate; + + public static final String SERIALIZED_NAME_MODIFIED_DATE = "ModifiedDate"; + @SerializedName(SERIALIZED_NAME_MODIFIED_DATE) + @javax.annotation.Nullable + private OffsetDateTime modifiedDate; + + public static final String SERIALIZED_NAME_INVITER_UID = "InviterUid"; + @SerializedName(SERIALIZED_NAME_INVITER_UID) + @javax.annotation.Nullable + private String inviterUid; + + public Invitation() { + } + + public Invitation id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The unique identifier for the invitation. The ID is typically in the format *inv_<unique_id>*, where *<unique_id>* is a string of alphanumeric characters. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public Invitation emailId(@javax.annotation.Nullable String emailId) { + this.emailId = emailId; + return this; + } + + /** + * The Email address of the User to whom the invitation is sent. + * @return emailId + */ + @javax.annotation.Nullable + public String getEmailId() { + return emailId; + } + + public void setEmailId(@javax.annotation.Nullable String emailId) { + this.emailId = emailId; + } + + + public Invitation status(@javax.annotation.Nullable StatusEnum status) { + this.status = status; + return this; + } + + /** + * The status of the invitation. Possible values are *invited*, *accepted*, *expired*, and *revoked*. + * @return status + */ + @javax.annotation.Nullable + public StatusEnum getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nullable StatusEnum status) { + this.status = status; + } + + + public Invitation roleIds(@javax.annotation.Nullable List<String> roleIds) { + this.roleIds = roleIds; + return this; + } + + public Invitation addRoleIdsItem(String roleIdsItem) { + if (this.roleIds == null) { + this.roleIds = new ArrayList<>(); + } + this.roleIds.add(roleIdsItem); + return this; + } + + /** + * The list of Role IDs associated with the invitation. Each Role ID is typically in the format *role_<unique_id>*, where *<unique_id>* is a string of alphanumeric characters. + * @return roleIds + */ + @javax.annotation.Nullable + public List<String> getRoleIds() { + return roleIds; + } + + public void setRoleIds(@javax.annotation.Nullable List<String> roleIds) { + this.roleIds = roleIds; + } + + + public Invitation orgId(@javax.annotation.Nullable String orgId) { + this.orgId = orgId; + return this; + } + + /** + * The unique identifier for the organization associated with the invitation. The ID is typically in the format *org_<unique_id>*, where *<unique_id>* is a string of alphanumeric characters. + * @return orgId + */ + @javax.annotation.Nullable + public String getOrgId() { + return orgId; + } + + public void setOrgId(@javax.annotation.Nullable String orgId) { + this.orgId = orgId; + } + + + public Invitation createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * The date and time when the invitation was created, UTC format. + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + + public Invitation expirationDate(@javax.annotation.Nullable OffsetDateTime expirationDate) { + this.expirationDate = expirationDate; + return this; + } + + /** + * The date and time when the invitation expires, UTC format. + * @return expirationDate + */ + @javax.annotation.Nullable + public OffsetDateTime getExpirationDate() { + return expirationDate; + } + + public void setExpirationDate(@javax.annotation.Nullable OffsetDateTime expirationDate) { + this.expirationDate = expirationDate; + } + + + public Invitation modifiedDate(@javax.annotation.Nullable OffsetDateTime modifiedDate) { + this.modifiedDate = modifiedDate; + return this; + } + + /** + * The date and time when the invitation was last modified, UTC format. + * @return modifiedDate + */ + @javax.annotation.Nullable + public OffsetDateTime getModifiedDate() { + return modifiedDate; + } + + public void setModifiedDate(@javax.annotation.Nullable OffsetDateTime modifiedDate) { + this.modifiedDate = modifiedDate; + } + + + public Invitation inviterUid(@javax.annotation.Nullable String inviterUid) { + this.inviterUid = inviterUid; + return this; + } + + /** + * The unique identifier for the User who sent the invitation. The ID is typically in the format unique_id, where *<unique_id>* is a string of alphanumeric characters. + * @return inviterUid + */ + @javax.annotation.Nullable + public String getInviterUid() { + return inviterUid; + } + + public void setInviterUid(@javax.annotation.Nullable String inviterUid) { + this.inviterUid = inviterUid; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Invitation instance itself + */ + public Invitation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Invitation invitation = (Invitation) o; + return Objects.equals(this.id, invitation.id) && + Objects.equals(this.emailId, invitation.emailId) && + Objects.equals(this.status, invitation.status) && + Objects.equals(this.roleIds, invitation.roleIds) && + Objects.equals(this.orgId, invitation.orgId) && + Objects.equals(this.createdDate, invitation.createdDate) && + Objects.equals(this.expirationDate, invitation.expirationDate) && + Objects.equals(this.modifiedDate, invitation.modifiedDate) && + Objects.equals(this.inviterUid, invitation.inviterUid)&& + Objects.equals(this.additionalProperties, invitation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, emailId, status, roleIds, orgId, createdDate, expirationDate, modifiedDate, inviterUid, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Invitation {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" emailId: ").append(toIndentedString(emailId)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" roleIds: ").append(toIndentedString(roleIds)).append("\n"); + sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" expirationDate: ").append(toIndentedString(expirationDate)).append("\n"); + sb.append(" modifiedDate: ").append(toIndentedString(modifiedDate)).append("\n"); + sb.append(" inviterUid: ").append(toIndentedString(inviterUid)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("EmailId"); + openapiFields.add("Status"); + openapiFields.add("RoleIds"); + openapiFields.add("OrgId"); + openapiFields.add("CreatedDate"); + openapiFields.add("ExpirationDate"); + openapiFields.add("ModifiedDate"); + openapiFields.add("InviterUid"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 Invitation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Invitation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Invitation is not found in the empty JSON string", Invitation.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("EmailId") != null && !jsonObj.get("EmailId").isJsonNull()) && !jsonObj.get("EmailId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `EmailId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("EmailId").toString())); + } + if ((jsonObj.get("Status") != null && !jsonObj.get("Status").isJsonNull()) && !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())); + } + // validate the optional field `Status` + if (jsonObj.get("Status") != null && !jsonObj.get("Status").isJsonNull()) { + StatusEnum.validateJsonElement(jsonObj.get("Status")); + } + // ensure the optional json data is an array if present + if (jsonObj.get("RoleIds") != null && !jsonObj.get("RoleIds").isJsonNull() && !jsonObj.get("RoleIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RoleIds` to be an array in the JSON string but got `%s`", jsonObj.get("RoleIds").toString())); + } + if ((jsonObj.get("OrgId") != null && !jsonObj.get("OrgId").isJsonNull()) && !jsonObj.get("OrgId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `OrgId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("OrgId").toString())); + } + if ((jsonObj.get("InviterUid") != null && !jsonObj.get("InviterUid").isJsonNull()) && !jsonObj.get("InviterUid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `InviterUid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("InviterUid").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!Invitation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Invitation' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<Invitation> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Invitation.class)); + + return (TypeAdapter<T>) new TypeAdapter<Invitation>() { + @Override + public void write(JsonWriter out, Invitation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Invitation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Invitation instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Invitation given an JSON string + * + * @param jsonString JSON string + * @return An instance of Invitation + * @throws IOException if the JSON string is invalid with respect to Invitation + */ + public static Invitation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Invitation.class); + } + + /** + * Convert an instance of Invitation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/InvitationToken.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/InvitationToken.java new file mode 100644 index 0000000..f118126 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/InvitationToken.java @@ -0,0 +1,404 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * InvitationToken + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class InvitationToken { + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private String email; + + /** + * The status of the invitation. Possible values are *invited*, *accepted*, *expired*, and *revoked*. + */ + @JsonAdapter(StatusEnum.Adapter.class) + public enum StatusEnum { + ACCEPTED("Accepted"), + + REVOKED("Revoked"), + + EXPIRED("Expired"), + + INVITED("Invited"); + + private String value; + + StatusEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StatusEnum fromValue(String value) { + for (StatusEnum b : StatusEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<StatusEnum> { + @Override + public void write(final JsonWriter jsonWriter, final StatusEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StatusEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StatusEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StatusEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATUS = "Status"; + @SerializedName(SERIALIZED_NAME_STATUS) + @javax.annotation.Nullable + private StatusEnum status; + + public static final String SERIALIZED_NAME_IS_EMAIL_EXIST = "IsEmailExist"; + @SerializedName(SERIALIZED_NAME_IS_EMAIL_EXIST) + @javax.annotation.Nullable + private Boolean isEmailExist; + + public InvitationToken() { + } + + public InvitationToken email(@javax.annotation.Nullable String email) { + this.email = email; + return this; + } + + /** + * The Email address of the User to whom the invitation is sent. + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable String email) { + this.email = email; + } + + + public InvitationToken status(@javax.annotation.Nullable StatusEnum status) { + this.status = status; + return this; + } + + /** + * The status of the invitation. Possible values are *invited*, *accepted*, *expired*, and *revoked*. + * @return status + */ + @javax.annotation.Nullable + public StatusEnum getStatus() { + return status; + } + + public void setStatus(@javax.annotation.Nullable StatusEnum status) { + this.status = status; + } + + + public InvitationToken isEmailExist(@javax.annotation.Nullable Boolean isEmailExist) { + this.isEmailExist = isEmailExist; + return this; + } + + /** + * Indicates whether the Email address is already associated with an existing User account. + * @return isEmailExist + */ + @javax.annotation.Nullable + public Boolean getIsEmailExist() { + return isEmailExist; + } + + public void setIsEmailExist(@javax.annotation.Nullable Boolean isEmailExist) { + this.isEmailExist = isEmailExist; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the InvitationToken instance itself + */ + public InvitationToken putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + InvitationToken invitationToken = (InvitationToken) o; + return Objects.equals(this.email, invitationToken.email) && + Objects.equals(this.status, invitationToken.status) && + Objects.equals(this.isEmailExist, invitationToken.isEmailExist)&& + Objects.equals(this.additionalProperties, invitationToken.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, status, isEmailExist, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class InvitationToken {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" status: ").append(toIndentedString(status)).append("\n"); + sb.append(" isEmailExist: ").append(toIndentedString(isEmailExist)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Email"); + openapiFields.add("Status"); + openapiFields.add("IsEmailExist"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 InvitationToken + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!InvitationToken.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in InvitationToken is not found in the empty JSON string", InvitationToken.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Email") != null && !jsonObj.get("Email").isJsonNull()) && !jsonObj.get("Email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Email").toString())); + } + if ((jsonObj.get("Status") != null && !jsonObj.get("Status").isJsonNull()) && !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())); + } + // validate the optional field `Status` + if (jsonObj.get("Status") != null && !jsonObj.get("Status").isJsonNull()) { + StatusEnum.validateJsonElement(jsonObj.get("Status")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!InvitationToken.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'InvitationToken' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<InvitationToken> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(InvitationToken.class)); + + return (TypeAdapter<T>) new TypeAdapter<InvitationToken>() { + @Override + public void write(JsonWriter out, InvitationToken value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public InvitationToken read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + InvitationToken instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of InvitationToken given an JSON string + * + * @param jsonString JSON string + * @return An instance of InvitationToken + * @throws IOException if the JSON string is invalid with respect to InvitationToken + */ + public static InvitationToken fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, InvitationToken.class); + } + + /** + * Convert an instance of InvitationToken to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/IsDeleteRequestAccepted.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/IsDeleteRequestAccepted.java new file mode 100644 index 0000000..122bd92 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/IsDeleteRequestAccepted.java @@ -0,0 +1,284 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * Indicates if the item delete request is accepted + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class IsDeleteRequestAccepted { + public static final String SERIALIZED_NAME_IS_DELETE_REQUEST_ACCEPTED = "IsDeleteRequestAccepted"; + @SerializedName(SERIALIZED_NAME_IS_DELETE_REQUEST_ACCEPTED) + @javax.annotation.Nullable + private Boolean isDeleteRequestAccepted; + + public IsDeleteRequestAccepted() { + } + + public IsDeleteRequestAccepted isDeleteRequestAccepted(@javax.annotation.Nullable Boolean isDeleteRequestAccepted) { + this.isDeleteRequestAccepted = isDeleteRequestAccepted; + return this; + } + + /** + * Get isDeleteRequestAccepted + * @return isDeleteRequestAccepted + */ + @javax.annotation.Nullable + public Boolean getIsDeleteRequestAccepted() { + return isDeleteRequestAccepted; + } + + public void setIsDeleteRequestAccepted(@javax.annotation.Nullable Boolean isDeleteRequestAccepted) { + this.isDeleteRequestAccepted = isDeleteRequestAccepted; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IsDeleteRequestAccepted instance itself + */ + public IsDeleteRequestAccepted putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IsDeleteRequestAccepted isDeleteRequestAccepted = (IsDeleteRequestAccepted) o; + return Objects.equals(this.isDeleteRequestAccepted, isDeleteRequestAccepted.isDeleteRequestAccepted)&& + Objects.equals(this.additionalProperties, isDeleteRequestAccepted.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isDeleteRequestAccepted, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IsDeleteRequestAccepted {\n"); + sb.append(" isDeleteRequestAccepted: ").append(toIndentedString(isDeleteRequestAccepted)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsDeleteRequestAccepted"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 IsDeleteRequestAccepted + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IsDeleteRequestAccepted.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IsDeleteRequestAccepted is not found in the empty JSON string", IsDeleteRequestAccepted.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!IsDeleteRequestAccepted.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IsDeleteRequestAccepted' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<IsDeleteRequestAccepted> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IsDeleteRequestAccepted.class)); + + return (TypeAdapter<T>) new TypeAdapter<IsDeleteRequestAccepted>() { + @Override + public void write(JsonWriter out, IsDeleteRequestAccepted value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public IsDeleteRequestAccepted read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + IsDeleteRequestAccepted instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IsDeleteRequestAccepted given an JSON string + * + * @param jsonString JSON string + * @return An instance of IsDeleteRequestAccepted + * @throws IOException if the JSON string is invalid with respect to IsDeleteRequestAccepted + */ + public static IsDeleteRequestAccepted fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IsDeleteRequestAccepted.class); + } + + /** + * Convert an instance of IsDeleteRequestAccepted to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/IsDeleted.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/IsDeleted.java new file mode 100644 index 0000000..8dab3a6 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/IsDeleted.java @@ -0,0 +1,284 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * IsDeleted + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class IsDeleted { + public static final String SERIALIZED_NAME_IS_DELETED = "IsDeleted"; + @SerializedName(SERIALIZED_NAME_IS_DELETED) + @javax.annotation.Nullable + private Boolean isDeleted; + + public IsDeleted() { + } + + public IsDeleted isDeleted(@javax.annotation.Nullable Boolean isDeleted) { + this.isDeleted = isDeleted; + return this; + } + + /** + * Indicates if the item is deleted + * @return isDeleted + */ + @javax.annotation.Nullable + public Boolean getIsDeleted() { + return isDeleted; + } + + public void setIsDeleted(@javax.annotation.Nullable Boolean isDeleted) { + this.isDeleted = isDeleted; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IsDeleted instance itself + */ + public IsDeleted putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IsDeleted isDeleted = (IsDeleted) o; + return Objects.equals(this.isDeleted, isDeleted.isDeleted)&& + Objects.equals(this.additionalProperties, isDeleted.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isDeleted, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IsDeleted {\n"); + sb.append(" isDeleted: ").append(toIndentedString(isDeleted)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsDeleted"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 IsDeleted + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IsDeleted.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IsDeleted is not found in the empty JSON string", IsDeleted.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!IsDeleted.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IsDeleted' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<IsDeleted> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IsDeleted.class)); + + return (TypeAdapter<T>) new TypeAdapter<IsDeleted>() { + @Override + public void write(JsonWriter out, IsDeleted value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public IsDeleted read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + IsDeleted instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IsDeleted given an JSON string + * + * @param jsonString JSON string + * @return An instance of IsDeleted + * @throws IOException if the JSON string is invalid with respect to IsDeleted + */ + public static IsDeleted fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IsDeleted.class); + } + + /** + * Convert an instance of IsDeleted to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/IsDeletedResponseWithCount.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/IsDeletedResponseWithCount.java new file mode 100644 index 0000000..e42a17e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/IsDeletedResponseWithCount.java @@ -0,0 +1,311 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * IsDeletedResponseWithCount + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class IsDeletedResponseWithCount { + public static final String SERIALIZED_NAME_IS_DELETED = "IsDeleted"; + @SerializedName(SERIALIZED_NAME_IS_DELETED) + @javax.annotation.Nullable + private Boolean isDeleted; + + public static final String SERIALIZED_NAME_RECORDS_DELETED = "RecordsDeleted"; + @SerializedName(SERIALIZED_NAME_RECORDS_DELETED) + @javax.annotation.Nullable + private Integer recordsDeleted; + + public IsDeletedResponseWithCount() { + } + + public IsDeletedResponseWithCount isDeleted(@javax.annotation.Nullable Boolean isDeleted) { + this.isDeleted = isDeleted; + return this; + } + + /** + * Indicates whether the Account was successfully deleted. + * @return isDeleted + */ + @javax.annotation.Nullable + public Boolean getIsDeleted() { + return isDeleted; + } + + public void setIsDeleted(@javax.annotation.Nullable Boolean isDeleted) { + this.isDeleted = isDeleted; + } + + + public IsDeletedResponseWithCount recordsDeleted(@javax.annotation.Nullable Integer recordsDeleted) { + this.recordsDeleted = recordsDeleted; + return this; + } + + /** + * The number of records that were deleted. + * @return recordsDeleted + */ + @javax.annotation.Nullable + public Integer getRecordsDeleted() { + return recordsDeleted; + } + + public void setRecordsDeleted(@javax.annotation.Nullable Integer recordsDeleted) { + this.recordsDeleted = recordsDeleted; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IsDeletedResponseWithCount instance itself + */ + public IsDeletedResponseWithCount putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IsDeletedResponseWithCount isDeletedResponseWithCount = (IsDeletedResponseWithCount) o; + return Objects.equals(this.isDeleted, isDeletedResponseWithCount.isDeleted) && + Objects.equals(this.recordsDeleted, isDeletedResponseWithCount.recordsDeleted)&& + Objects.equals(this.additionalProperties, isDeletedResponseWithCount.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isDeleted, recordsDeleted, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IsDeletedResponseWithCount {\n"); + sb.append(" isDeleted: ").append(toIndentedString(isDeleted)).append("\n"); + sb.append(" recordsDeleted: ").append(toIndentedString(recordsDeleted)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsDeleted"); + openapiFields.add("RecordsDeleted"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 IsDeletedResponseWithCount + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IsDeletedResponseWithCount.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IsDeletedResponseWithCount is not found in the empty JSON string", IsDeletedResponseWithCount.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!IsDeletedResponseWithCount.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IsDeletedResponseWithCount' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<IsDeletedResponseWithCount> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IsDeletedResponseWithCount.class)); + + return (TypeAdapter<T>) new TypeAdapter<IsDeletedResponseWithCount>() { + @Override + public void write(JsonWriter out, IsDeletedResponseWithCount value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public IsDeletedResponseWithCount read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + IsDeletedResponseWithCount instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IsDeletedResponseWithCount given an JSON string + * + * @param jsonString JSON string + * @return An instance of IsDeletedResponseWithCount + * @throws IOException if the JSON string is invalid with respect to IsDeletedResponseWithCount + */ + public static IsDeletedResponseWithCount fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IsDeletedResponseWithCount.class); + } + + /** + * Convert an instance of IsDeletedResponseWithCount to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/IsExist.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/IsExist.java new file mode 100644 index 0000000..4dc61d1 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/IsExist.java @@ -0,0 +1,284 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * Indicates whether the Email exists in the system. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class IsExist { + public static final String SERIALIZED_NAME_IS_EXIST = "IsExist"; + @SerializedName(SERIALIZED_NAME_IS_EXIST) + @javax.annotation.Nullable + private Boolean isExist; + + public IsExist() { + } + + public IsExist isExist(@javax.annotation.Nullable Boolean isExist) { + this.isExist = isExist; + return this; + } + + /** + * Get isExist + * @return isExist + */ + @javax.annotation.Nullable + public Boolean getIsExist() { + return isExist; + } + + public void setIsExist(@javax.annotation.Nullable Boolean isExist) { + this.isExist = isExist; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IsExist instance itself + */ + public IsExist putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IsExist isExist = (IsExist) o; + return Objects.equals(this.isExist, isExist.isExist)&& + Objects.equals(this.additionalProperties, isExist.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isExist, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IsExist {\n"); + sb.append(" isExist: ").append(toIndentedString(isExist)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsExist"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 IsExist + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IsExist.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IsExist is not found in the empty JSON string", IsExist.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!IsExist.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IsExist' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<IsExist> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IsExist.class)); + + return (TypeAdapter<T>) new TypeAdapter<IsExist>() { + @Override + public void write(JsonWriter out, IsExist value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public IsExist read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + IsExist instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IsExist given an JSON string + * + * @param jsonString JSON string + * @return An instance of IsExist + * @throws IOException if the JSON string is invalid with respect to IsExist + */ + public static IsExist fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IsExist.class); + } + + /** + * Convert an instance of IsExist to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/IsPostedResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/IsPostedResponse.java new file mode 100644 index 0000000..f62a67e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/IsPostedResponse.java @@ -0,0 +1,284 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * IsPostedResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class IsPostedResponse { + public static final String SERIALIZED_NAME_IS_POSTED = "IsPosted"; + @SerializedName(SERIALIZED_NAME_IS_POSTED) + @javax.annotation.Nullable + private Boolean isPosted; + + public IsPostedResponse() { + } + + public IsPostedResponse isPosted(@javax.annotation.Nullable Boolean isPosted) { + this.isPosted = isPosted; + return this; + } + + /** + * Indicates whether the item is posted + * @return isPosted + */ + @javax.annotation.Nullable + public Boolean getIsPosted() { + return isPosted; + } + + public void setIsPosted(@javax.annotation.Nullable Boolean isPosted) { + this.isPosted = isPosted; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IsPostedResponse instance itself + */ + public IsPostedResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IsPostedResponse isPostedResponse = (IsPostedResponse) o; + return Objects.equals(this.isPosted, isPostedResponse.isPosted)&& + Objects.equals(this.additionalProperties, isPostedResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isPosted, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IsPostedResponse {\n"); + sb.append(" isPosted: ").append(toIndentedString(isPosted)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsPosted"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 IsPostedResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IsPostedResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IsPostedResponse is not found in the empty JSON string", IsPostedResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!IsPostedResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IsPostedResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<IsPostedResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IsPostedResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<IsPostedResponse>() { + @Override + public void write(JsonWriter out, IsPostedResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public IsPostedResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + IsPostedResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IsPostedResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of IsPostedResponse + * @throws IOException if the JSON string is invalid with respect to IsPostedResponse + */ + public static IsPostedResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IsPostedResponse.class); + } + + /** + * Convert an instance of IsPostedResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/IsPostedVerified.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/IsPostedVerified.java new file mode 100644 index 0000000..9c57b53 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/IsPostedVerified.java @@ -0,0 +1,311 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * IsPostedVerified + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class IsPostedVerified { + public static final String SERIALIZED_NAME_IS_POSTED = "IsPosted"; + @SerializedName(SERIALIZED_NAME_IS_POSTED) + @javax.annotation.Nullable + private Boolean isPosted; + + public static final String SERIALIZED_NAME_IS_VERIFIED = "IsVerified"; + @SerializedName(SERIALIZED_NAME_IS_VERIFIED) + @javax.annotation.Nullable + private Boolean isVerified; + + public IsPostedVerified() { + } + + public IsPostedVerified isPosted(@javax.annotation.Nullable Boolean isPosted) { + this.isPosted = isPosted; + return this; + } + + /** + * Indicates if the item is posted. + * @return isPosted + */ + @javax.annotation.Nullable + public Boolean getIsPosted() { + return isPosted; + } + + public void setIsPosted(@javax.annotation.Nullable Boolean isPosted) { + this.isPosted = isPosted; + } + + + public IsPostedVerified isVerified(@javax.annotation.Nullable Boolean isVerified) { + this.isVerified = isVerified; + return this; + } + + /** + * Indicates if the item is verified. + * @return isVerified + */ + @javax.annotation.Nullable + public Boolean getIsVerified() { + return isVerified; + } + + public void setIsVerified(@javax.annotation.Nullable Boolean isVerified) { + this.isVerified = isVerified; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IsPostedVerified instance itself + */ + public IsPostedVerified putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IsPostedVerified isPostedVerified = (IsPostedVerified) o; + return Objects.equals(this.isPosted, isPostedVerified.isPosted) && + Objects.equals(this.isVerified, isPostedVerified.isVerified)&& + Objects.equals(this.additionalProperties, isPostedVerified.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isPosted, isVerified, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IsPostedVerified {\n"); + sb.append(" isPosted: ").append(toIndentedString(isPosted)).append("\n"); + sb.append(" isVerified: ").append(toIndentedString(isVerified)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsPosted"); + openapiFields.add("IsVerified"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 IsPostedVerified + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IsPostedVerified.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IsPostedVerified is not found in the empty JSON string", IsPostedVerified.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!IsPostedVerified.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IsPostedVerified' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<IsPostedVerified> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IsPostedVerified.class)); + + return (TypeAdapter<T>) new TypeAdapter<IsPostedVerified>() { + @Override + public void write(JsonWriter out, IsPostedVerified value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public IsPostedVerified read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + IsPostedVerified instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IsPostedVerified given an JSON string + * + * @param jsonString JSON string + * @return An instance of IsPostedVerified + * @throws IOException if the JSON string is invalid with respect to IsPostedVerified + */ + public static IsPostedVerified fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IsPostedVerified.class); + } + + /** + * Convert an instance of IsPostedVerified to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/IsRegistered.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/IsRegistered.java new file mode 100644 index 0000000..808a3fc --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/IsRegistered.java @@ -0,0 +1,284 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * IsRegistered + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class IsRegistered { + public static final String SERIALIZED_NAME_IS_REGISTERED = "IsRegistered"; + @SerializedName(SERIALIZED_NAME_IS_REGISTERED) + @javax.annotation.Nullable + private Boolean isRegistered; + + public IsRegistered() { + } + + public IsRegistered isRegistered(@javax.annotation.Nullable Boolean isRegistered) { + this.isRegistered = isRegistered; + return this; + } + + /** + * Indicates if the Push Notification device is registered + * @return isRegistered + */ + @javax.annotation.Nullable + public Boolean getIsRegistered() { + return isRegistered; + } + + public void setIsRegistered(@javax.annotation.Nullable Boolean isRegistered) { + this.isRegistered = isRegistered; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IsRegistered instance itself + */ + public IsRegistered putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IsRegistered isRegistered = (IsRegistered) o; + return Objects.equals(this.isRegistered, isRegistered.isRegistered)&& + Objects.equals(this.additionalProperties, isRegistered.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isRegistered, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IsRegistered {\n"); + sb.append(" isRegistered: ").append(toIndentedString(isRegistered)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsRegistered"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 IsRegistered + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IsRegistered.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IsRegistered is not found in the empty JSON string", IsRegistered.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!IsRegistered.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IsRegistered' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<IsRegistered> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IsRegistered.class)); + + return (TypeAdapter<T>) new TypeAdapter<IsRegistered>() { + @Override + public void write(JsonWriter out, IsRegistered value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public IsRegistered read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + IsRegistered instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IsRegistered given an JSON string + * + * @param jsonString JSON string + * @return An instance of IsRegistered + * @throws IOException if the JSON string is invalid with respect to IsRegistered + */ + public static IsRegistered fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IsRegistered.class); + } + + /** + * Convert an instance of IsRegistered to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/IsValid.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/IsValid.java new file mode 100644 index 0000000..faa90b9 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/IsValid.java @@ -0,0 +1,292 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * IsValid + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class IsValid { + public static final String SERIALIZED_NAME_IS_VALID = "IsValid"; + @SerializedName(SERIALIZED_NAME_IS_VALID) + @javax.annotation.Nonnull + private Boolean isValid; + + public IsValid() { + } + + public IsValid isValid(@javax.annotation.Nonnull Boolean isValid) { + this.isValid = isValid; + return this; + } + + /** + * Indicates whether the provided event-based second factor token is valid or not. A value of `true` means the token is valid, while `false` indicates that the token is invalid or has expired. + * @return isValid + */ + @javax.annotation.Nonnull + public Boolean getIsValid() { + return isValid; + } + + public void setIsValid(@javax.annotation.Nonnull Boolean isValid) { + this.isValid = isValid; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the IsValid instance itself + */ + public IsValid putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + IsValid isValid = (IsValid) o; + return Objects.equals(this.isValid, isValid.isValid)&& + Objects.equals(this.additionalProperties, isValid.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isValid, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class IsValid {\n"); + sb.append(" isValid: ").append(toIndentedString(isValid)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsValid"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("IsValid"); + } + + /** + * 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 IsValid + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!IsValid.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in IsValid is not found in the empty JSON string", IsValid.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : IsValid.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(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!IsValid.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'IsValid' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<IsValid> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(IsValid.class)); + + return (TypeAdapter<T>) new TypeAdapter<IsValid>() { + @Override + public void write(JsonWriter out, IsValid value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public IsValid read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + IsValid instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of IsValid given an JSON string + * + * @param jsonString JSON string + * @return An instance of IsValid + * @throws IOException if the JSON string is invalid with respect to IsValid + */ + public static IsValid fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, IsValid.class); + } + + /** + * Convert an instance of IsValid to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/JWKSResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/JWKSResponse.java new file mode 100644 index 0000000..8832da4 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/JWKSResponse.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.JWKSResponseKeysInner; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * JWKS Config Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class JWKSResponse { + public static final String SERIALIZED_NAME_KEYS = "keys"; + @SerializedName(SERIALIZED_NAME_KEYS) + @javax.annotation.Nullable + private List<JWKSResponseKeysInner> keys = new ArrayList<>(); + + public JWKSResponse() { + } + + public JWKSResponse keys(@javax.annotation.Nullable List<JWKSResponseKeysInner> keys) { + this.keys = keys; + return this; + } + + public JWKSResponse addKeysItem(JWKSResponseKeysInner keysItem) { + if (this.keys == null) { + this.keys = new ArrayList<>(); + } + this.keys.add(keysItem); + return this; + } + + /** + * Get keys + * @return keys + */ + @javax.annotation.Nullable + public List<JWKSResponseKeysInner> getKeys() { + return keys; + } + + public void setKeys(@javax.annotation.Nullable List<JWKSResponseKeysInner> keys) { + this.keys = keys; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the JWKSResponse instance itself + */ + public JWKSResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JWKSResponse jwKSResponse = (JWKSResponse) o; + return Objects.equals(this.keys, jwKSResponse.keys)&& + Objects.equals(this.additionalProperties, jwKSResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(keys, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JWKSResponse {\n"); + sb.append(" keys: ").append(toIndentedString(keys)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("keys"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 JWKSResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!JWKSResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JWKSResponse is not found in the empty JSON string", JWKSResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("keys") != null && !jsonObj.get("keys").isJsonNull()) { + JsonArray jsonArraykeys = jsonObj.getAsJsonArray("keys"); + if (jsonArraykeys != null) { + // ensure the json data is an array + if (!jsonObj.get("keys").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `keys` to be an array in the JSON string but got `%s`", jsonObj.get("keys").toString())); + } + + // validate the optional field `keys` (array) + for (int i = 0; i < jsonArraykeys.size(); i++) { + JWKSResponseKeysInner.validateJsonElement(jsonArraykeys.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!JWKSResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JWKSResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<JWKSResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JWKSResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<JWKSResponse>() { + @Override + public void write(JsonWriter out, JWKSResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public JWKSResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + JWKSResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JWKSResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of JWKSResponse + * @throws IOException if the JSON string is invalid with respect to JWKSResponse + */ + public static JWKSResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JWKSResponse.class); + } + + /** + * Convert an instance of JWKSResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/JWKSResponseKeysInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/JWKSResponseKeysInner.java new file mode 100644 index 0000000..94603a3 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/JWKSResponseKeysInner.java @@ -0,0 +1,437 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * JWKSResponseKeysInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class JWKSResponseKeysInner { + public static final String SERIALIZED_NAME_ALG = "alg"; + @SerializedName(SERIALIZED_NAME_ALG) + @javax.annotation.Nullable + private String alg; + + public static final String SERIALIZED_NAME_E = "e"; + @SerializedName(SERIALIZED_NAME_E) + @javax.annotation.Nullable + private String e; + + public static final String SERIALIZED_NAME_KID = "kid"; + @SerializedName(SERIALIZED_NAME_KID) + @javax.annotation.Nullable + private String kid; + + public static final String SERIALIZED_NAME_KTY = "kty"; + @SerializedName(SERIALIZED_NAME_KTY) + @javax.annotation.Nullable + private String kty; + + public static final String SERIALIZED_NAME_N = "n"; + @SerializedName(SERIALIZED_NAME_N) + @javax.annotation.Nullable + private String n; + + public static final String SERIALIZED_NAME_USE = "use"; + @SerializedName(SERIALIZED_NAME_USE) + @javax.annotation.Nullable + private String use; + + public JWKSResponseKeysInner() { + } + + public JWKSResponseKeysInner alg(@javax.annotation.Nullable String alg) { + this.alg = alg; + return this; + } + + /** + * Get alg + * @return alg + */ + @javax.annotation.Nullable + public String getAlg() { + return alg; + } + + public void setAlg(@javax.annotation.Nullable String alg) { + this.alg = alg; + } + + + public JWKSResponseKeysInner e(@javax.annotation.Nullable String e) { + this.e = e; + return this; + } + + /** + * Get e + * @return e + */ + @javax.annotation.Nullable + public String getE() { + return e; + } + + public void setE(@javax.annotation.Nullable String e) { + this.e = e; + } + + + public JWKSResponseKeysInner kid(@javax.annotation.Nullable String kid) { + this.kid = kid; + return this; + } + + /** + * Get kid + * @return kid + */ + @javax.annotation.Nullable + public String getKid() { + return kid; + } + + public void setKid(@javax.annotation.Nullable String kid) { + this.kid = kid; + } + + + public JWKSResponseKeysInner kty(@javax.annotation.Nullable String kty) { + this.kty = kty; + return this; + } + + /** + * Get kty + * @return kty + */ + @javax.annotation.Nullable + public String getKty() { + return kty; + } + + public void setKty(@javax.annotation.Nullable String kty) { + this.kty = kty; + } + + + public JWKSResponseKeysInner n(@javax.annotation.Nullable String n) { + this.n = n; + return this; + } + + /** + * Get n + * @return n + */ + @javax.annotation.Nullable + public String getN() { + return n; + } + + public void setN(@javax.annotation.Nullable String n) { + this.n = n; + } + + + public JWKSResponseKeysInner use(@javax.annotation.Nullable String use) { + this.use = use; + return this; + } + + /** + * Get use + * @return use + */ + @javax.annotation.Nullable + public String getUse() { + return use; + } + + public void setUse(@javax.annotation.Nullable String use) { + this.use = use; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the JWKSResponseKeysInner instance itself + */ + public JWKSResponseKeysInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JWKSResponseKeysInner jwKSResponseKeysInner = (JWKSResponseKeysInner) o; + return Objects.equals(this.alg, jwKSResponseKeysInner.alg) && + Objects.equals(this.e, jwKSResponseKeysInner.e) && + Objects.equals(this.kid, jwKSResponseKeysInner.kid) && + Objects.equals(this.kty, jwKSResponseKeysInner.kty) && + Objects.equals(this.n, jwKSResponseKeysInner.n) && + Objects.equals(this.use, jwKSResponseKeysInner.use)&& + Objects.equals(this.additionalProperties, jwKSResponseKeysInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(alg, e, kid, kty, n, use, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JWKSResponseKeysInner {\n"); + sb.append(" alg: ").append(toIndentedString(alg)).append("\n"); + sb.append(" e: ").append(toIndentedString(e)).append("\n"); + sb.append(" kid: ").append(toIndentedString(kid)).append("\n"); + sb.append(" kty: ").append(toIndentedString(kty)).append("\n"); + sb.append(" n: ").append(toIndentedString(n)).append("\n"); + sb.append(" use: ").append(toIndentedString(use)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("alg"); + openapiFields.add("e"); + openapiFields.add("kid"); + openapiFields.add("kty"); + openapiFields.add("n"); + openapiFields.add("use"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 JWKSResponseKeysInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!JWKSResponseKeysInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JWKSResponseKeysInner is not found in the empty JSON string", JWKSResponseKeysInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("alg") != null && !jsonObj.get("alg").isJsonNull()) && !jsonObj.get("alg").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `alg` to be a primitive type in the JSON string but got `%s`", jsonObj.get("alg").toString())); + } + if ((jsonObj.get("e") != null && !jsonObj.get("e").isJsonNull()) && !jsonObj.get("e").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `e` to be a primitive type in the JSON string but got `%s`", jsonObj.get("e").toString())); + } + if ((jsonObj.get("kid") != null && !jsonObj.get("kid").isJsonNull()) && !jsonObj.get("kid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `kid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kid").toString())); + } + if ((jsonObj.get("kty") != null && !jsonObj.get("kty").isJsonNull()) && !jsonObj.get("kty").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `kty` to be a primitive type in the JSON string but got `%s`", jsonObj.get("kty").toString())); + } + if ((jsonObj.get("n") != null && !jsonObj.get("n").isJsonNull()) && !jsonObj.get("n").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `n` to be a primitive type in the JSON string but got `%s`", jsonObj.get("n").toString())); + } + if ((jsonObj.get("use") != null && !jsonObj.get("use").isJsonNull()) && !jsonObj.get("use").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `use` to be a primitive type in the JSON string but got `%s`", jsonObj.get("use").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!JWKSResponseKeysInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JWKSResponseKeysInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<JWKSResponseKeysInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JWKSResponseKeysInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<JWKSResponseKeysInner>() { + @Override + public void write(JsonWriter out, JWKSResponseKeysInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public JWKSResponseKeysInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + JWKSResponseKeysInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JWKSResponseKeysInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of JWKSResponseKeysInner + * @throws IOException if the JSON string is invalid with respect to JWKSResponseKeysInner + */ + public static JWKSResponseKeysInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JWKSResponseKeysInner.class); + } + + /** + * Convert an instance of JWKSResponseKeysInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/JWTSignature.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/JWTSignature.java new file mode 100644 index 0000000..4323863 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/JWTSignature.java @@ -0,0 +1,287 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * JWT Signature Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class JWTSignature { + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + @javax.annotation.Nullable + private String signature; + + public JWTSignature() { + } + + public JWTSignature signature(@javax.annotation.Nullable String signature) { + this.signature = signature; + return this; + } + + /** + * Get signature + * @return signature + */ + @javax.annotation.Nullable + public String getSignature() { + return signature; + } + + public void setSignature(@javax.annotation.Nullable String signature) { + this.signature = signature; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the JWTSignature instance itself + */ + public JWTSignature putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JWTSignature jwTSignature = (JWTSignature) o; + return Objects.equals(this.signature, jwTSignature.signature)&& + Objects.equals(this.additionalProperties, jwTSignature.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(signature, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JWTSignature {\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("signature"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 JWTSignature + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!JWTSignature.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JWTSignature is not found in the empty JSON string", JWTSignature.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("signature") != null && !jsonObj.get("signature").isJsonNull()) && !jsonObj.get("signature").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `signature` to be a primitive type in the JSON string but got `%s`", jsonObj.get("signature").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!JWTSignature.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JWTSignature' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<JWTSignature> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JWTSignature.class)); + + return (TypeAdapter<T>) new TypeAdapter<JWTSignature>() { + @Override + public void write(JsonWriter out, JWTSignature value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public JWTSignature read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + JWTSignature instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JWTSignature given an JSON string + * + * @param jsonString JSON string + * @return An instance of JWTSignature + * @throws IOException if the JSON string is invalid with respect to JWTSignature + */ + public static JWTSignature fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JWTSignature.class); + } + + /** + * Convert an instance of JWTSignature to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtAudienceValidation.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtAudienceValidation.java new file mode 100644 index 0000000..0f7b9fc --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtAudienceValidation.java @@ -0,0 +1,352 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.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.loginradius.sdk.internal.openapi.JSON; + +/** + * JwtAudienceValidation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class JwtAudienceValidation { + public static final String SERIALIZED_NAME_EXPECTED_VALUES = "ExpectedValues"; + @SerializedName(SERIALIZED_NAME_EXPECTED_VALUES) + @javax.annotation.Nullable + private List<String> expectedValues = new ArrayList<>(); + + public static final String SERIALIZED_NAME_MATCH_VALUE = "MatchValue"; + @SerializedName(SERIALIZED_NAME_MATCH_VALUE) + @javax.annotation.Nullable + private Boolean matchValue; + + public static final String SERIALIZED_NAME_IS_MANDATORY = "IsMandatory"; + @SerializedName(SERIALIZED_NAME_IS_MANDATORY) + @javax.annotation.Nullable + private Boolean isMandatory; + + public JwtAudienceValidation() { + } + + public JwtAudienceValidation expectedValues(@javax.annotation.Nullable List<String> expectedValues) { + this.expectedValues = expectedValues; + return this; + } + + public JwtAudienceValidation addExpectedValuesItem(String expectedValuesItem) { + if (this.expectedValues == null) { + this.expectedValues = new ArrayList<>(); + } + this.expectedValues.add(expectedValuesItem); + return this; + } + + /** + * Get expectedValues + * @return expectedValues + */ + @javax.annotation.Nullable + public List<String> getExpectedValues() { + return expectedValues; + } + + public void setExpectedValues(@javax.annotation.Nullable List<String> expectedValues) { + this.expectedValues = expectedValues; + } + + + public JwtAudienceValidation matchValue(@javax.annotation.Nullable Boolean matchValue) { + this.matchValue = matchValue; + return this; + } + + /** + * Get matchValue + * @return matchValue + */ + @javax.annotation.Nullable + public Boolean getMatchValue() { + return matchValue; + } + + public void setMatchValue(@javax.annotation.Nullable Boolean matchValue) { + this.matchValue = matchValue; + } + + + public JwtAudienceValidation isMandatory(@javax.annotation.Nullable Boolean isMandatory) { + this.isMandatory = isMandatory; + return this; + } + + /** + * Get isMandatory + * @return isMandatory + */ + @javax.annotation.Nullable + public Boolean getIsMandatory() { + return isMandatory; + } + + public void setIsMandatory(@javax.annotation.Nullable Boolean isMandatory) { + this.isMandatory = isMandatory; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the JwtAudienceValidation instance itself + */ + public JwtAudienceValidation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JwtAudienceValidation jwtAudienceValidation = (JwtAudienceValidation) o; + return Objects.equals(this.expectedValues, jwtAudienceValidation.expectedValues) && + Objects.equals(this.matchValue, jwtAudienceValidation.matchValue) && + Objects.equals(this.isMandatory, jwtAudienceValidation.isMandatory)&& + Objects.equals(this.additionalProperties, jwtAudienceValidation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(expectedValues, matchValue, isMandatory, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JwtAudienceValidation {\n"); + sb.append(" expectedValues: ").append(toIndentedString(expectedValues)).append("\n"); + sb.append(" matchValue: ").append(toIndentedString(matchValue)).append("\n"); + sb.append(" isMandatory: ").append(toIndentedString(isMandatory)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ExpectedValues"); + openapiFields.add("MatchValue"); + openapiFields.add("IsMandatory"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 JwtAudienceValidation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!JwtAudienceValidation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JwtAudienceValidation is not found in the empty JSON string", JwtAudienceValidation.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("ExpectedValues") != null && !jsonObj.get("ExpectedValues").isJsonNull() && !jsonObj.get("ExpectedValues").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ExpectedValues` to be an array in the JSON string but got `%s`", jsonObj.get("ExpectedValues").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!JwtAudienceValidation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JwtAudienceValidation' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<JwtAudienceValidation> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JwtAudienceValidation.class)); + + return (TypeAdapter<T>) new TypeAdapter<JwtAudienceValidation>() { + @Override + public void write(JsonWriter out, JwtAudienceValidation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public JwtAudienceValidation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + JwtAudienceValidation instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JwtAudienceValidation given an JSON string + * + * @param jsonString JSON string + * @return An instance of JwtAudienceValidation + * @throws IOException if the JSON string is invalid with respect to JwtAudienceValidation + */ + public static JwtAudienceValidation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JwtAudienceValidation.class); + } + + /** + * Convert an instance of JwtAudienceValidation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtClaimAudienceProperty.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtClaimAudienceProperty.java new file mode 100644 index 0000000..2a859e8 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtClaimAudienceProperty.java @@ -0,0 +1,364 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * JwtClaimAudienceProperty + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class JwtClaimAudienceProperty { + public static final String SERIALIZED_NAME_EXPECTED_VALUES = "ExpectedValues"; + @SerializedName(SERIALIZED_NAME_EXPECTED_VALUES) + @javax.annotation.Nullable + private List<String> expectedValues = new ArrayList<>(); + + public static final String SERIALIZED_NAME_MATCH_VALUE = "MatchValue"; + @SerializedName(SERIALIZED_NAME_MATCH_VALUE) + @javax.annotation.Nullable + private Boolean matchValue; + + public static final String SERIALIZED_NAME_IS_MANDATORY = "IsMandatory"; + @SerializedName(SERIALIZED_NAME_IS_MANDATORY) + @javax.annotation.Nullable + private Boolean isMandatory; + + public JwtClaimAudienceProperty() { + } + + public JwtClaimAudienceProperty expectedValues(@javax.annotation.Nullable List<String> expectedValues) { + this.expectedValues = expectedValues; + return this; + } + + public JwtClaimAudienceProperty addExpectedValuesItem(String expectedValuesItem) { + if (this.expectedValues == null) { + this.expectedValues = new ArrayList<>(); + } + this.expectedValues.add(expectedValuesItem); + return this; + } + + /** + * Get expectedValues + * @return expectedValues + */ + @javax.annotation.Nullable + public List<String> getExpectedValues() { + return expectedValues; + } + + public void setExpectedValues(@javax.annotation.Nullable List<String> expectedValues) { + this.expectedValues = expectedValues; + } + + + public JwtClaimAudienceProperty matchValue(@javax.annotation.Nullable Boolean matchValue) { + this.matchValue = matchValue; + return this; + } + + /** + * Get matchValue + * @return matchValue + */ + @javax.annotation.Nullable + public Boolean getMatchValue() { + return matchValue; + } + + public void setMatchValue(@javax.annotation.Nullable Boolean matchValue) { + this.matchValue = matchValue; + } + + + public JwtClaimAudienceProperty isMandatory(@javax.annotation.Nullable Boolean isMandatory) { + this.isMandatory = isMandatory; + return this; + } + + /** + * Get isMandatory + * @return isMandatory + */ + @javax.annotation.Nullable + public Boolean getIsMandatory() { + return isMandatory; + } + + public void setIsMandatory(@javax.annotation.Nullable Boolean isMandatory) { + this.isMandatory = isMandatory; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the JwtClaimAudienceProperty instance itself + */ + public JwtClaimAudienceProperty putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JwtClaimAudienceProperty jwtClaimAudienceProperty = (JwtClaimAudienceProperty) o; + return Objects.equals(this.expectedValues, jwtClaimAudienceProperty.expectedValues) && + Objects.equals(this.matchValue, jwtClaimAudienceProperty.matchValue) && + Objects.equals(this.isMandatory, jwtClaimAudienceProperty.isMandatory)&& + Objects.equals(this.additionalProperties, jwtClaimAudienceProperty.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(expectedValues, matchValue, isMandatory, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JwtClaimAudienceProperty {\n"); + sb.append(" expectedValues: ").append(toIndentedString(expectedValues)).append("\n"); + sb.append(" matchValue: ").append(toIndentedString(matchValue)).append("\n"); + sb.append(" isMandatory: ").append(toIndentedString(isMandatory)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ExpectedValues"); + openapiFields.add("MatchValue"); + openapiFields.add("IsMandatory"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 JwtClaimAudienceProperty + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!JwtClaimAudienceProperty.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JwtClaimAudienceProperty is not found in the empty JSON string", JwtClaimAudienceProperty.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("ExpectedValues") != null && !jsonObj.get("ExpectedValues").isJsonNull() && !jsonObj.get("ExpectedValues").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ExpectedValues` to be an array in the JSON string but got `%s`", jsonObj.get("ExpectedValues").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!JwtClaimAudienceProperty.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JwtClaimAudienceProperty' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<JwtClaimAudienceProperty> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JwtClaimAudienceProperty.class)); + + return (TypeAdapter<T>) new TypeAdapter<JwtClaimAudienceProperty>() { + @Override + public void write(JsonWriter out, JwtClaimAudienceProperty value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public JwtClaimAudienceProperty read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + JwtClaimAudienceProperty instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JwtClaimAudienceProperty given an JSON string + * + * @param jsonString JSON string + * @return An instance of JwtClaimAudienceProperty + * @throws IOException if the JSON string is invalid with respect to JwtClaimAudienceProperty + */ + public static JwtClaimAudienceProperty fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JwtClaimAudienceProperty.class); + } + + /** + * Convert an instance of JwtClaimAudienceProperty to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtClaimMandatory.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtClaimMandatory.java new file mode 100644 index 0000000..99f6e33 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtClaimMandatory.java @@ -0,0 +1,296 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * JwtClaimMandatory + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class JwtClaimMandatory { + public static final String SERIALIZED_NAME_IS_MANDATORY = "IsMandatory"; + @SerializedName(SERIALIZED_NAME_IS_MANDATORY) + @javax.annotation.Nullable + private Boolean isMandatory; + + public JwtClaimMandatory() { + } + + public JwtClaimMandatory isMandatory(@javax.annotation.Nullable Boolean isMandatory) { + this.isMandatory = isMandatory; + return this; + } + + /** + * Get isMandatory + * @return isMandatory + */ + @javax.annotation.Nullable + public Boolean getIsMandatory() { + return isMandatory; + } + + public void setIsMandatory(@javax.annotation.Nullable Boolean isMandatory) { + this.isMandatory = isMandatory; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the JwtClaimMandatory instance itself + */ + public JwtClaimMandatory putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JwtClaimMandatory jwtClaimMandatory = (JwtClaimMandatory) o; + return Objects.equals(this.isMandatory, jwtClaimMandatory.isMandatory)&& + Objects.equals(this.additionalProperties, jwtClaimMandatory.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(isMandatory, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JwtClaimMandatory {\n"); + sb.append(" isMandatory: ").append(toIndentedString(isMandatory)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsMandatory"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 JwtClaimMandatory + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!JwtClaimMandatory.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JwtClaimMandatory is not found in the empty JSON string", JwtClaimMandatory.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!JwtClaimMandatory.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JwtClaimMandatory' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<JwtClaimMandatory> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JwtClaimMandatory.class)); + + return (TypeAdapter<T>) new TypeAdapter<JwtClaimMandatory>() { + @Override + public void write(JsonWriter out, JwtClaimMandatory value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public JwtClaimMandatory read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + JwtClaimMandatory instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JwtClaimMandatory given an JSON string + * + * @param jsonString JSON string + * @return An instance of JwtClaimMandatory + * @throws IOException if the JSON string is invalid with respect to JwtClaimMandatory + */ + public static JwtClaimMandatory fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JwtClaimMandatory.class); + } + + /** + * Convert an instance of JwtClaimMandatory to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtClaimSubjectProperty.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtClaimSubjectProperty.java new file mode 100644 index 0000000..84d90c4 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtClaimSubjectProperty.java @@ -0,0 +1,353 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * JwtClaimSubjectProperty + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class JwtClaimSubjectProperty { + public static final String SERIALIZED_NAME_EXPECTED_VALUE = "ExpectedValue"; + @SerializedName(SERIALIZED_NAME_EXPECTED_VALUE) + @javax.annotation.Nullable + private String expectedValue; + + public static final String SERIALIZED_NAME_MATCH_VALUE = "MatchValue"; + @SerializedName(SERIALIZED_NAME_MATCH_VALUE) + @javax.annotation.Nullable + private Boolean matchValue; + + public static final String SERIALIZED_NAME_IS_MANDATORY = "IsMandatory"; + @SerializedName(SERIALIZED_NAME_IS_MANDATORY) + @javax.annotation.Nullable + private Boolean isMandatory; + + public JwtClaimSubjectProperty() { + } + + public JwtClaimSubjectProperty expectedValue(@javax.annotation.Nullable String expectedValue) { + this.expectedValue = expectedValue; + return this; + } + + /** + * Get expectedValue + * @return expectedValue + */ + @javax.annotation.Nullable + public String getExpectedValue() { + return expectedValue; + } + + public void setExpectedValue(@javax.annotation.Nullable String expectedValue) { + this.expectedValue = expectedValue; + } + + + public JwtClaimSubjectProperty matchValue(@javax.annotation.Nullable Boolean matchValue) { + this.matchValue = matchValue; + return this; + } + + /** + * Get matchValue + * @return matchValue + */ + @javax.annotation.Nullable + public Boolean getMatchValue() { + return matchValue; + } + + public void setMatchValue(@javax.annotation.Nullable Boolean matchValue) { + this.matchValue = matchValue; + } + + + public JwtClaimSubjectProperty isMandatory(@javax.annotation.Nullable Boolean isMandatory) { + this.isMandatory = isMandatory; + return this; + } + + /** + * Get isMandatory + * @return isMandatory + */ + @javax.annotation.Nullable + public Boolean getIsMandatory() { + return isMandatory; + } + + public void setIsMandatory(@javax.annotation.Nullable Boolean isMandatory) { + this.isMandatory = isMandatory; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the JwtClaimSubjectProperty instance itself + */ + public JwtClaimSubjectProperty putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JwtClaimSubjectProperty jwtClaimSubjectProperty = (JwtClaimSubjectProperty) o; + return Objects.equals(this.expectedValue, jwtClaimSubjectProperty.expectedValue) && + Objects.equals(this.matchValue, jwtClaimSubjectProperty.matchValue) && + Objects.equals(this.isMandatory, jwtClaimSubjectProperty.isMandatory)&& + Objects.equals(this.additionalProperties, jwtClaimSubjectProperty.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(expectedValue, matchValue, isMandatory, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JwtClaimSubjectProperty {\n"); + sb.append(" expectedValue: ").append(toIndentedString(expectedValue)).append("\n"); + sb.append(" matchValue: ").append(toIndentedString(matchValue)).append("\n"); + sb.append(" isMandatory: ").append(toIndentedString(isMandatory)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ExpectedValue"); + openapiFields.add("MatchValue"); + openapiFields.add("IsMandatory"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 JwtClaimSubjectProperty + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!JwtClaimSubjectProperty.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JwtClaimSubjectProperty is not found in the empty JSON string", JwtClaimSubjectProperty.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ExpectedValue") != null && !jsonObj.get("ExpectedValue").isJsonNull()) && !jsonObj.get("ExpectedValue").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ExpectedValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ExpectedValue").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!JwtClaimSubjectProperty.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JwtClaimSubjectProperty' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<JwtClaimSubjectProperty> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JwtClaimSubjectProperty.class)); + + return (TypeAdapter<T>) new TypeAdapter<JwtClaimSubjectProperty>() { + @Override + public void write(JsonWriter out, JwtClaimSubjectProperty value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public JwtClaimSubjectProperty read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + JwtClaimSubjectProperty instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JwtClaimSubjectProperty given an JSON string + * + * @param jsonString JSON string + * @return An instance of JwtClaimSubjectProperty + * @throws IOException if the JSON string is invalid with respect to JwtClaimSubjectProperty + */ + public static JwtClaimSubjectProperty fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JwtClaimSubjectProperty.class); + } + + /** + * Convert an instance of JwtClaimSubjectProperty to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtIntegrationBaseModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtIntegrationBaseModel.java new file mode 100644 index 0000000..825da21 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtIntegrationBaseModel.java @@ -0,0 +1,732 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * JwtIntegrationBaseModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class JwtIntegrationBaseModel { + /** + * Gets or Sets algo + */ + @JsonAdapter(AlgoEnum.Adapter.class) + public enum AlgoEnum { + HS256("HS256"), + + HS384("HS384"), + + HS512("HS512"), + + RS256("RS256"), + + RS384("RS384"), + + RS512("RS512"), + + ES256("ES256"), + + ES384("ES384"), + + ES512("ES512"); + + private String value; + + AlgoEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AlgoEnum fromValue(String value) { + for (AlgoEnum b : AlgoEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<AlgoEnum> { + @Override + public void write(final JsonWriter jsonWriter, final AlgoEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AlgoEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AlgoEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AlgoEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ALGO = "Algo"; + @SerializedName(SERIALIZED_NAME_ALGO) + @javax.annotation.Nullable + private AlgoEnum algo; + + public static final String SERIALIZED_NAME_SECRET = "Secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + @javax.annotation.Nullable + private String secret; + + public static final String SERIALIZED_NAME_MAPPING_TEMPLATE = "MappingTemplate"; + @SerializedName(SERIALIZED_NAME_MAPPING_TEMPLATE) + @javax.annotation.Nullable + private String mappingTemplate; + + public static final String SERIALIZED_NAME_MAPPING = "Mapping"; + @SerializedName(SERIALIZED_NAME_MAPPING) + @javax.annotation.Nullable + private Map<String, String> mapping = new HashMap<>(); + + public static final String SERIALIZED_NAME_METADATA = "Metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + @javax.annotation.Nullable + private Map<String, String> metadata = new HashMap<>(); + + public static final String SERIALIZED_NAME_AUDIENCE = "Audience"; + @SerializedName(SERIALIZED_NAME_AUDIENCE) + @javax.annotation.Nullable + private List<String> audience = new ArrayList<>(); + + public static final String SERIALIZED_NAME_NOT_AFTER_DIFFERENCE = "NotAfterDifference"; + @SerializedName(SERIALIZED_NAME_NOT_AFTER_DIFFERENCE) + @javax.annotation.Nullable + private Integer notAfterDifference; + + public static final String SERIALIZED_NAME_NOT_BEFORE_DIFFERENCE = "NotBeforeDifference"; + @SerializedName(SERIALIZED_NAME_NOT_BEFORE_DIFFERENCE) + @javax.annotation.Nullable + private Integer notBeforeDifference; + + public static final String SERIALIZED_NAME_QUERY_STRING_PARAMETER = "QueryStringParameter"; + @SerializedName(SERIALIZED_NAME_QUERY_STRING_PARAMETER) + @javax.annotation.Nullable + private String queryStringParameter; + + /** + * Gets or Sets responseMode + */ + @JsonAdapter(ResponseModeEnum.Adapter.class) + public enum ResponseModeEnum { + QUERY("query"), + + FRAGMENT("fragment"), + + FORM_POST("form_post"); + + private String value; + + ResponseModeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ResponseModeEnum fromValue(String value) { + for (ResponseModeEnum b : ResponseModeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<ResponseModeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final ResponseModeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ResponseModeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ResponseModeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ResponseModeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_RESPONSE_MODE = "ResponseMode"; + @SerializedName(SERIALIZED_NAME_RESPONSE_MODE) + @javax.annotation.Nullable + private ResponseModeEnum responseMode; + + public static final String SERIALIZED_NAME_LOGIN_URL = "LoginUrl"; + @SerializedName(SERIALIZED_NAME_LOGIN_URL) + @javax.annotation.Nullable + private String loginUrl; + + public JwtIntegrationBaseModel() { + } + + public JwtIntegrationBaseModel algo(@javax.annotation.Nullable AlgoEnum algo) { + this.algo = algo; + return this; + } + + /** + * Get algo + * @return algo + */ + @javax.annotation.Nullable + public AlgoEnum getAlgo() { + return algo; + } + + public void setAlgo(@javax.annotation.Nullable AlgoEnum algo) { + this.algo = algo; + } + + + public JwtIntegrationBaseModel secret(@javax.annotation.Nullable String secret) { + this.secret = secret; + return this; + } + + /** + * Get secret + * @return secret + */ + @javax.annotation.Nullable + public String getSecret() { + return secret; + } + + public void setSecret(@javax.annotation.Nullable String secret) { + this.secret = secret; + } + + + public JwtIntegrationBaseModel mappingTemplate(@javax.annotation.Nullable String mappingTemplate) { + this.mappingTemplate = mappingTemplate; + return this; + } + + /** + * Get mappingTemplate + * @return mappingTemplate + */ + @javax.annotation.Nullable + public String getMappingTemplate() { + return mappingTemplate; + } + + public void setMappingTemplate(@javax.annotation.Nullable String mappingTemplate) { + this.mappingTemplate = mappingTemplate; + } + + + public JwtIntegrationBaseModel mapping(@javax.annotation.Nullable Map<String, String> mapping) { + this.mapping = mapping; + return this; + } + + public JwtIntegrationBaseModel putMappingItem(String key, String mappingItem) { + if (this.mapping == null) { + this.mapping = new HashMap<>(); + } + this.mapping.put(key, mappingItem); + return this; + } + + /** + * Get mapping + * @return mapping + */ + @javax.annotation.Nullable + public Map<String, String> getMapping() { + return mapping; + } + + public void setMapping(@javax.annotation.Nullable Map<String, String> mapping) { + this.mapping = mapping; + } + + + public JwtIntegrationBaseModel metadata(@javax.annotation.Nullable Map<String, String> metadata) { + this.metadata = metadata; + return this; + } + + public JwtIntegrationBaseModel putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Get metadata + * @return metadata + */ + @javax.annotation.Nullable + public Map<String, String> getMetadata() { + return metadata; + } + + public void setMetadata(@javax.annotation.Nullable Map<String, String> metadata) { + this.metadata = metadata; + } + + + public JwtIntegrationBaseModel audience(@javax.annotation.Nullable List<String> audience) { + this.audience = audience; + return this; + } + + public JwtIntegrationBaseModel addAudienceItem(String audienceItem) { + if (this.audience == null) { + this.audience = new ArrayList<>(); + } + this.audience.add(audienceItem); + return this; + } + + /** + * Get audience + * @return audience + */ + @javax.annotation.Nullable + public List<String> getAudience() { + return audience; + } + + public void setAudience(@javax.annotation.Nullable List<String> audience) { + this.audience = audience; + } + + + public JwtIntegrationBaseModel notAfterDifference(@javax.annotation.Nullable Integer notAfterDifference) { + this.notAfterDifference = notAfterDifference; + return this; + } + + /** + * Get notAfterDifference + * @return notAfterDifference + */ + @javax.annotation.Nullable + public Integer getNotAfterDifference() { + return notAfterDifference; + } + + public void setNotAfterDifference(@javax.annotation.Nullable Integer notAfterDifference) { + this.notAfterDifference = notAfterDifference; + } + + + public JwtIntegrationBaseModel notBeforeDifference(@javax.annotation.Nullable Integer notBeforeDifference) { + this.notBeforeDifference = notBeforeDifference; + return this; + } + + /** + * Get notBeforeDifference + * @return notBeforeDifference + */ + @javax.annotation.Nullable + public Integer getNotBeforeDifference() { + return notBeforeDifference; + } + + public void setNotBeforeDifference(@javax.annotation.Nullable Integer notBeforeDifference) { + this.notBeforeDifference = notBeforeDifference; + } + + + public JwtIntegrationBaseModel queryStringParameter(@javax.annotation.Nullable String queryStringParameter) { + this.queryStringParameter = queryStringParameter; + return this; + } + + /** + * Get queryStringParameter + * @return queryStringParameter + */ + @javax.annotation.Nullable + public String getQueryStringParameter() { + return queryStringParameter; + } + + public void setQueryStringParameter(@javax.annotation.Nullable String queryStringParameter) { + this.queryStringParameter = queryStringParameter; + } + + + public JwtIntegrationBaseModel responseMode(@javax.annotation.Nullable ResponseModeEnum responseMode) { + this.responseMode = responseMode; + return this; + } + + /** + * Get responseMode + * @return responseMode + */ + @javax.annotation.Nullable + public ResponseModeEnum getResponseMode() { + return responseMode; + } + + public void setResponseMode(@javax.annotation.Nullable ResponseModeEnum responseMode) { + this.responseMode = responseMode; + } + + + public JwtIntegrationBaseModel loginUrl(@javax.annotation.Nullable String loginUrl) { + this.loginUrl = loginUrl; + return this; + } + + /** + * Get loginUrl + * @return loginUrl + */ + @javax.annotation.Nullable + public String getLoginUrl() { + return loginUrl; + } + + public void setLoginUrl(@javax.annotation.Nullable String loginUrl) { + this.loginUrl = loginUrl; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the JwtIntegrationBaseModel instance itself + */ + public JwtIntegrationBaseModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JwtIntegrationBaseModel jwtIntegrationBaseModel = (JwtIntegrationBaseModel) o; + return Objects.equals(this.algo, jwtIntegrationBaseModel.algo) && + Objects.equals(this.secret, jwtIntegrationBaseModel.secret) && + Objects.equals(this.mappingTemplate, jwtIntegrationBaseModel.mappingTemplate) && + Objects.equals(this.mapping, jwtIntegrationBaseModel.mapping) && + Objects.equals(this.metadata, jwtIntegrationBaseModel.metadata) && + Objects.equals(this.audience, jwtIntegrationBaseModel.audience) && + Objects.equals(this.notAfterDifference, jwtIntegrationBaseModel.notAfterDifference) && + Objects.equals(this.notBeforeDifference, jwtIntegrationBaseModel.notBeforeDifference) && + Objects.equals(this.queryStringParameter, jwtIntegrationBaseModel.queryStringParameter) && + Objects.equals(this.responseMode, jwtIntegrationBaseModel.responseMode) && + Objects.equals(this.loginUrl, jwtIntegrationBaseModel.loginUrl)&& + Objects.equals(this.additionalProperties, jwtIntegrationBaseModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(algo, secret, mappingTemplate, mapping, metadata, audience, notAfterDifference, notBeforeDifference, queryStringParameter, responseMode, loginUrl, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JwtIntegrationBaseModel {\n"); + sb.append(" algo: ").append(toIndentedString(algo)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" mappingTemplate: ").append(toIndentedString(mappingTemplate)).append("\n"); + sb.append(" mapping: ").append(toIndentedString(mapping)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" audience: ").append(toIndentedString(audience)).append("\n"); + sb.append(" notAfterDifference: ").append(toIndentedString(notAfterDifference)).append("\n"); + sb.append(" notBeforeDifference: ").append(toIndentedString(notBeforeDifference)).append("\n"); + sb.append(" queryStringParameter: ").append(toIndentedString(queryStringParameter)).append("\n"); + sb.append(" responseMode: ").append(toIndentedString(responseMode)).append("\n"); + sb.append(" loginUrl: ").append(toIndentedString(loginUrl)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Algo"); + openapiFields.add("Secret"); + openapiFields.add("MappingTemplate"); + openapiFields.add("Mapping"); + openapiFields.add("Metadata"); + openapiFields.add("Audience"); + openapiFields.add("NotAfterDifference"); + openapiFields.add("NotBeforeDifference"); + openapiFields.add("QueryStringParameter"); + openapiFields.add("ResponseMode"); + openapiFields.add("LoginUrl"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 JwtIntegrationBaseModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!JwtIntegrationBaseModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JwtIntegrationBaseModel is not found in the empty JSON string", JwtIntegrationBaseModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Algo") != null && !jsonObj.get("Algo").isJsonNull()) && !jsonObj.get("Algo").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Algo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Algo").toString())); + } + // validate the optional field `Algo` + if (jsonObj.get("Algo") != null && !jsonObj.get("Algo").isJsonNull()) { + AlgoEnum.validateJsonElement(jsonObj.get("Algo")); + } + if ((jsonObj.get("Secret") != null && !jsonObj.get("Secret").isJsonNull()) && !jsonObj.get("Secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Secret").toString())); + } + if ((jsonObj.get("MappingTemplate") != null && !jsonObj.get("MappingTemplate").isJsonNull()) && !jsonObj.get("MappingTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MappingTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MappingTemplate").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("Audience") != null && !jsonObj.get("Audience").isJsonNull() && !jsonObj.get("Audience").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Audience` to be an array in the JSON string but got `%s`", jsonObj.get("Audience").toString())); + } + if ((jsonObj.get("QueryStringParameter") != null && !jsonObj.get("QueryStringParameter").isJsonNull()) && !jsonObj.get("QueryStringParameter").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `QueryStringParameter` to be a primitive type in the JSON string but got `%s`", jsonObj.get("QueryStringParameter").toString())); + } + if ((jsonObj.get("ResponseMode") != null && !jsonObj.get("ResponseMode").isJsonNull()) && !jsonObj.get("ResponseMode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ResponseMode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ResponseMode").toString())); + } + // validate the optional field `ResponseMode` + if (jsonObj.get("ResponseMode") != null && !jsonObj.get("ResponseMode").isJsonNull()) { + ResponseModeEnum.validateJsonElement(jsonObj.get("ResponseMode")); + } + if ((jsonObj.get("LoginUrl") != null && !jsonObj.get("LoginUrl").isJsonNull()) && !jsonObj.get("LoginUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LoginUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LoginUrl").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!JwtIntegrationBaseModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JwtIntegrationBaseModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<JwtIntegrationBaseModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JwtIntegrationBaseModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<JwtIntegrationBaseModel>() { + @Override + public void write(JsonWriter out, JwtIntegrationBaseModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public JwtIntegrationBaseModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + JwtIntegrationBaseModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JwtIntegrationBaseModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of JwtIntegrationBaseModel + * @throws IOException if the JSON string is invalid with respect to JwtIntegrationBaseModel + */ + public static JwtIntegrationBaseModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JwtIntegrationBaseModel.class); + } + + /** + * Convert an instance of JwtIntegrationBaseModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtIntegrationCreateCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtIntegrationCreateCore.java new file mode 100644 index 0000000..45ba6ca --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtIntegrationCreateCore.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * JwtIntegrationCreateCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class JwtIntegrationCreateCore { + public static final String SERIALIZED_NAME_APP_NAME = "AppName"; + @SerializedName(SERIALIZED_NAME_APP_NAME) + @javax.annotation.Nonnull + private String appName; + + public JwtIntegrationCreateCore() { + } + + public JwtIntegrationCreateCore appName(@javax.annotation.Nonnull String appName) { + this.appName = appName; + return this; + } + + /** + * Get appName + * @return appName + */ + @javax.annotation.Nonnull + public String getAppName() { + return appName; + } + + public void setAppName(@javax.annotation.Nonnull String appName) { + this.appName = appName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the JwtIntegrationCreateCore instance itself + */ + public JwtIntegrationCreateCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JwtIntegrationCreateCore jwtIntegrationCreateCore = (JwtIntegrationCreateCore) o; + return Objects.equals(this.appName, jwtIntegrationCreateCore.appName)&& + Objects.equals(this.additionalProperties, jwtIntegrationCreateCore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(appName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JwtIntegrationCreateCore {\n"); + sb.append(" appName: ").append(toIndentedString(appName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AppName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("AppName"); + } + + /** + * 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 JwtIntegrationCreateCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!JwtIntegrationCreateCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JwtIntegrationCreateCore is not found in the empty JSON string", JwtIntegrationCreateCore.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : JwtIntegrationCreateCore.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("AppName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AppName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AppName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!JwtIntegrationCreateCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JwtIntegrationCreateCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<JwtIntegrationCreateCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JwtIntegrationCreateCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<JwtIntegrationCreateCore>() { + @Override + public void write(JsonWriter out, JwtIntegrationCreateCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public JwtIntegrationCreateCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + JwtIntegrationCreateCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JwtIntegrationCreateCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of JwtIntegrationCreateCore + * @throws IOException if the JSON string is invalid with respect to JwtIntegrationCreateCore + */ + public static JwtIntegrationCreateCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JwtIntegrationCreateCore.class); + } + + /** + * Convert an instance of JwtIntegrationCreateCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtIntegrationRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtIntegrationRequest.java new file mode 100644 index 0000000..484d80e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtIntegrationRequest.java @@ -0,0 +1,762 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * JwtIntegrationRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class JwtIntegrationRequest { + /** + * Gets or Sets algo + */ + @JsonAdapter(AlgoEnum.Adapter.class) + public enum AlgoEnum { + HS256("HS256"), + + HS384("HS384"), + + HS512("HS512"), + + RS256("RS256"), + + RS384("RS384"), + + RS512("RS512"), + + ES256("ES256"), + + ES384("ES384"), + + ES512("ES512"); + + private String value; + + AlgoEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AlgoEnum fromValue(String value) { + for (AlgoEnum b : AlgoEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<AlgoEnum> { + @Override + public void write(final JsonWriter jsonWriter, final AlgoEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AlgoEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AlgoEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AlgoEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ALGO = "Algo"; + @SerializedName(SERIALIZED_NAME_ALGO) + @javax.annotation.Nullable + private AlgoEnum algo; + + public static final String SERIALIZED_NAME_SECRET = "Secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + @javax.annotation.Nullable + private String secret; + + public static final String SERIALIZED_NAME_MAPPING_TEMPLATE = "MappingTemplate"; + @SerializedName(SERIALIZED_NAME_MAPPING_TEMPLATE) + @javax.annotation.Nullable + private String mappingTemplate; + + public static final String SERIALIZED_NAME_MAPPING = "Mapping"; + @SerializedName(SERIALIZED_NAME_MAPPING) + @javax.annotation.Nullable + private Map<String, String> mapping = new HashMap<>(); + + public static final String SERIALIZED_NAME_METADATA = "Metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + @javax.annotation.Nullable + private Map<String, String> metadata = new HashMap<>(); + + public static final String SERIALIZED_NAME_AUDIENCE = "Audience"; + @SerializedName(SERIALIZED_NAME_AUDIENCE) + @javax.annotation.Nullable + private List<String> audience = new ArrayList<>(); + + public static final String SERIALIZED_NAME_NOT_AFTER_DIFFERENCE = "NotAfterDifference"; + @SerializedName(SERIALIZED_NAME_NOT_AFTER_DIFFERENCE) + @javax.annotation.Nullable + private Integer notAfterDifference; + + public static final String SERIALIZED_NAME_NOT_BEFORE_DIFFERENCE = "NotBeforeDifference"; + @SerializedName(SERIALIZED_NAME_NOT_BEFORE_DIFFERENCE) + @javax.annotation.Nullable + private Integer notBeforeDifference; + + public static final String SERIALIZED_NAME_QUERY_STRING_PARAMETER = "QueryStringParameter"; + @SerializedName(SERIALIZED_NAME_QUERY_STRING_PARAMETER) + @javax.annotation.Nullable + private String queryStringParameter; + + /** + * Gets or Sets responseMode + */ + @JsonAdapter(ResponseModeEnum.Adapter.class) + public enum ResponseModeEnum { + QUERY("query"), + + FRAGMENT("fragment"), + + FORM_POST("form_post"); + + private String value; + + ResponseModeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ResponseModeEnum fromValue(String value) { + for (ResponseModeEnum b : ResponseModeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<ResponseModeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final ResponseModeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ResponseModeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ResponseModeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ResponseModeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_RESPONSE_MODE = "ResponseMode"; + @SerializedName(SERIALIZED_NAME_RESPONSE_MODE) + @javax.annotation.Nullable + private ResponseModeEnum responseMode; + + public static final String SERIALIZED_NAME_LOGIN_URL = "LoginUrl"; + @SerializedName(SERIALIZED_NAME_LOGIN_URL) + @javax.annotation.Nullable + private String loginUrl; + + public static final String SERIALIZED_NAME_APP_NAME = "AppName"; + @SerializedName(SERIALIZED_NAME_APP_NAME) + @javax.annotation.Nullable + private String appName; + + public JwtIntegrationRequest() { + } + + public JwtIntegrationRequest algo(@javax.annotation.Nullable AlgoEnum algo) { + this.algo = algo; + return this; + } + + /** + * Get algo + * @return algo + */ + @javax.annotation.Nullable + public AlgoEnum getAlgo() { + return algo; + } + + public void setAlgo(@javax.annotation.Nullable AlgoEnum algo) { + this.algo = algo; + } + + + public JwtIntegrationRequest secret(@javax.annotation.Nullable String secret) { + this.secret = secret; + return this; + } + + /** + * Get secret + * @return secret + */ + @javax.annotation.Nullable + public String getSecret() { + return secret; + } + + public void setSecret(@javax.annotation.Nullable String secret) { + this.secret = secret; + } + + + public JwtIntegrationRequest mappingTemplate(@javax.annotation.Nullable String mappingTemplate) { + this.mappingTemplate = mappingTemplate; + return this; + } + + /** + * Get mappingTemplate + * @return mappingTemplate + */ + @javax.annotation.Nullable + public String getMappingTemplate() { + return mappingTemplate; + } + + public void setMappingTemplate(@javax.annotation.Nullable String mappingTemplate) { + this.mappingTemplate = mappingTemplate; + } + + + public JwtIntegrationRequest mapping(@javax.annotation.Nullable Map<String, String> mapping) { + this.mapping = mapping; + return this; + } + + public JwtIntegrationRequest putMappingItem(String key, String mappingItem) { + if (this.mapping == null) { + this.mapping = new HashMap<>(); + } + this.mapping.put(key, mappingItem); + return this; + } + + /** + * Get mapping + * @return mapping + */ + @javax.annotation.Nullable + public Map<String, String> getMapping() { + return mapping; + } + + public void setMapping(@javax.annotation.Nullable Map<String, String> mapping) { + this.mapping = mapping; + } + + + public JwtIntegrationRequest metadata(@javax.annotation.Nullable Map<String, String> metadata) { + this.metadata = metadata; + return this; + } + + public JwtIntegrationRequest putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Get metadata + * @return metadata + */ + @javax.annotation.Nullable + public Map<String, String> getMetadata() { + return metadata; + } + + public void setMetadata(@javax.annotation.Nullable Map<String, String> metadata) { + this.metadata = metadata; + } + + + public JwtIntegrationRequest audience(@javax.annotation.Nullable List<String> audience) { + this.audience = audience; + return this; + } + + public JwtIntegrationRequest addAudienceItem(String audienceItem) { + if (this.audience == null) { + this.audience = new ArrayList<>(); + } + this.audience.add(audienceItem); + return this; + } + + /** + * Get audience + * @return audience + */ + @javax.annotation.Nullable + public List<String> getAudience() { + return audience; + } + + public void setAudience(@javax.annotation.Nullable List<String> audience) { + this.audience = audience; + } + + + public JwtIntegrationRequest notAfterDifference(@javax.annotation.Nullable Integer notAfterDifference) { + this.notAfterDifference = notAfterDifference; + return this; + } + + /** + * Get notAfterDifference + * @return notAfterDifference + */ + @javax.annotation.Nullable + public Integer getNotAfterDifference() { + return notAfterDifference; + } + + public void setNotAfterDifference(@javax.annotation.Nullable Integer notAfterDifference) { + this.notAfterDifference = notAfterDifference; + } + + + public JwtIntegrationRequest notBeforeDifference(@javax.annotation.Nullable Integer notBeforeDifference) { + this.notBeforeDifference = notBeforeDifference; + return this; + } + + /** + * Get notBeforeDifference + * @return notBeforeDifference + */ + @javax.annotation.Nullable + public Integer getNotBeforeDifference() { + return notBeforeDifference; + } + + public void setNotBeforeDifference(@javax.annotation.Nullable Integer notBeforeDifference) { + this.notBeforeDifference = notBeforeDifference; + } + + + public JwtIntegrationRequest queryStringParameter(@javax.annotation.Nullable String queryStringParameter) { + this.queryStringParameter = queryStringParameter; + return this; + } + + /** + * Get queryStringParameter + * @return queryStringParameter + */ + @javax.annotation.Nullable + public String getQueryStringParameter() { + return queryStringParameter; + } + + public void setQueryStringParameter(@javax.annotation.Nullable String queryStringParameter) { + this.queryStringParameter = queryStringParameter; + } + + + public JwtIntegrationRequest responseMode(@javax.annotation.Nullable ResponseModeEnum responseMode) { + this.responseMode = responseMode; + return this; + } + + /** + * Get responseMode + * @return responseMode + */ + @javax.annotation.Nullable + public ResponseModeEnum getResponseMode() { + return responseMode; + } + + public void setResponseMode(@javax.annotation.Nullable ResponseModeEnum responseMode) { + this.responseMode = responseMode; + } + + + public JwtIntegrationRequest loginUrl(@javax.annotation.Nullable String loginUrl) { + this.loginUrl = loginUrl; + return this; + } + + /** + * Get loginUrl + * @return loginUrl + */ + @javax.annotation.Nullable + public String getLoginUrl() { + return loginUrl; + } + + public void setLoginUrl(@javax.annotation.Nullable String loginUrl) { + this.loginUrl = loginUrl; + } + + + public JwtIntegrationRequest appName(@javax.annotation.Nullable String appName) { + this.appName = appName; + return this; + } + + /** + * Get appName + * @return appName + */ + @javax.annotation.Nullable + public String getAppName() { + return appName; + } + + public void setAppName(@javax.annotation.Nullable String appName) { + this.appName = appName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the JwtIntegrationRequest instance itself + */ + public JwtIntegrationRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JwtIntegrationRequest jwtIntegrationRequest = (JwtIntegrationRequest) o; + return Objects.equals(this.algo, jwtIntegrationRequest.algo) && + Objects.equals(this.secret, jwtIntegrationRequest.secret) && + Objects.equals(this.mappingTemplate, jwtIntegrationRequest.mappingTemplate) && + Objects.equals(this.mapping, jwtIntegrationRequest.mapping) && + Objects.equals(this.metadata, jwtIntegrationRequest.metadata) && + Objects.equals(this.audience, jwtIntegrationRequest.audience) && + Objects.equals(this.notAfterDifference, jwtIntegrationRequest.notAfterDifference) && + Objects.equals(this.notBeforeDifference, jwtIntegrationRequest.notBeforeDifference) && + Objects.equals(this.queryStringParameter, jwtIntegrationRequest.queryStringParameter) && + Objects.equals(this.responseMode, jwtIntegrationRequest.responseMode) && + Objects.equals(this.loginUrl, jwtIntegrationRequest.loginUrl) && + Objects.equals(this.appName, jwtIntegrationRequest.appName)&& + Objects.equals(this.additionalProperties, jwtIntegrationRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(algo, secret, mappingTemplate, mapping, metadata, audience, notAfterDifference, notBeforeDifference, queryStringParameter, responseMode, loginUrl, appName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JwtIntegrationRequest {\n"); + sb.append(" algo: ").append(toIndentedString(algo)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" mappingTemplate: ").append(toIndentedString(mappingTemplate)).append("\n"); + sb.append(" mapping: ").append(toIndentedString(mapping)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" audience: ").append(toIndentedString(audience)).append("\n"); + sb.append(" notAfterDifference: ").append(toIndentedString(notAfterDifference)).append("\n"); + sb.append(" notBeforeDifference: ").append(toIndentedString(notBeforeDifference)).append("\n"); + sb.append(" queryStringParameter: ").append(toIndentedString(queryStringParameter)).append("\n"); + sb.append(" responseMode: ").append(toIndentedString(responseMode)).append("\n"); + sb.append(" loginUrl: ").append(toIndentedString(loginUrl)).append("\n"); + sb.append(" appName: ").append(toIndentedString(appName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Algo"); + openapiFields.add("Secret"); + openapiFields.add("MappingTemplate"); + openapiFields.add("Mapping"); + openapiFields.add("Metadata"); + openapiFields.add("Audience"); + openapiFields.add("NotAfterDifference"); + openapiFields.add("NotBeforeDifference"); + openapiFields.add("QueryStringParameter"); + openapiFields.add("ResponseMode"); + openapiFields.add("LoginUrl"); + openapiFields.add("AppName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 JwtIntegrationRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!JwtIntegrationRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JwtIntegrationRequest is not found in the empty JSON string", JwtIntegrationRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Algo") != null && !jsonObj.get("Algo").isJsonNull()) && !jsonObj.get("Algo").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Algo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Algo").toString())); + } + // validate the optional field `Algo` + if (jsonObj.get("Algo") != null && !jsonObj.get("Algo").isJsonNull()) { + AlgoEnum.validateJsonElement(jsonObj.get("Algo")); + } + if ((jsonObj.get("Secret") != null && !jsonObj.get("Secret").isJsonNull()) && !jsonObj.get("Secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Secret").toString())); + } + if ((jsonObj.get("MappingTemplate") != null && !jsonObj.get("MappingTemplate").isJsonNull()) && !jsonObj.get("MappingTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MappingTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MappingTemplate").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("Audience") != null && !jsonObj.get("Audience").isJsonNull() && !jsonObj.get("Audience").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Audience` to be an array in the JSON string but got `%s`", jsonObj.get("Audience").toString())); + } + if ((jsonObj.get("QueryStringParameter") != null && !jsonObj.get("QueryStringParameter").isJsonNull()) && !jsonObj.get("QueryStringParameter").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `QueryStringParameter` to be a primitive type in the JSON string but got `%s`", jsonObj.get("QueryStringParameter").toString())); + } + if ((jsonObj.get("ResponseMode") != null && !jsonObj.get("ResponseMode").isJsonNull()) && !jsonObj.get("ResponseMode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ResponseMode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ResponseMode").toString())); + } + // validate the optional field `ResponseMode` + if (jsonObj.get("ResponseMode") != null && !jsonObj.get("ResponseMode").isJsonNull()) { + ResponseModeEnum.validateJsonElement(jsonObj.get("ResponseMode")); + } + if ((jsonObj.get("LoginUrl") != null && !jsonObj.get("LoginUrl").isJsonNull()) && !jsonObj.get("LoginUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LoginUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LoginUrl").toString())); + } + if ((jsonObj.get("AppName") != null && !jsonObj.get("AppName").isJsonNull()) && !jsonObj.get("AppName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AppName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AppName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!JwtIntegrationRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JwtIntegrationRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<JwtIntegrationRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JwtIntegrationRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<JwtIntegrationRequest>() { + @Override + public void write(JsonWriter out, JwtIntegrationRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public JwtIntegrationRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + JwtIntegrationRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JwtIntegrationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of JwtIntegrationRequest + * @throws IOException if the JSON string is invalid with respect to JwtIntegrationRequest + */ + public static JwtIntegrationRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JwtIntegrationRequest.class); + } + + /** + * Convert an instance of JwtIntegrationRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtIntegrationRequestCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtIntegrationRequestCore.java new file mode 100644 index 0000000..32083f7 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtIntegrationRequestCore.java @@ -0,0 +1,287 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * JwtIntegrationRequestCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class JwtIntegrationRequestCore { + public static final String SERIALIZED_NAME_APP_NAME = "AppName"; + @SerializedName(SERIALIZED_NAME_APP_NAME) + @javax.annotation.Nullable + private String appName; + + public JwtIntegrationRequestCore() { + } + + public JwtIntegrationRequestCore appName(@javax.annotation.Nullable String appName) { + this.appName = appName; + return this; + } + + /** + * Get appName + * @return appName + */ + @javax.annotation.Nullable + public String getAppName() { + return appName; + } + + public void setAppName(@javax.annotation.Nullable String appName) { + this.appName = appName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the JwtIntegrationRequestCore instance itself + */ + public JwtIntegrationRequestCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JwtIntegrationRequestCore jwtIntegrationRequestCore = (JwtIntegrationRequestCore) o; + return Objects.equals(this.appName, jwtIntegrationRequestCore.appName)&& + Objects.equals(this.additionalProperties, jwtIntegrationRequestCore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(appName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JwtIntegrationRequestCore {\n"); + sb.append(" appName: ").append(toIndentedString(appName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AppName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 JwtIntegrationRequestCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!JwtIntegrationRequestCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JwtIntegrationRequestCore is not found in the empty JSON string", JwtIntegrationRequestCore.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("AppName") != null && !jsonObj.get("AppName").isJsonNull()) && !jsonObj.get("AppName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AppName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AppName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!JwtIntegrationRequestCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JwtIntegrationRequestCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<JwtIntegrationRequestCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JwtIntegrationRequestCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<JwtIntegrationRequestCore>() { + @Override + public void write(JsonWriter out, JwtIntegrationRequestCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public JwtIntegrationRequestCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + JwtIntegrationRequestCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JwtIntegrationRequestCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of JwtIntegrationRequestCore + * @throws IOException if the JSON string is invalid with respect to JwtIntegrationRequestCore + */ + public static JwtIntegrationRequestCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JwtIntegrationRequestCore.class); + } + + /** + * Convert an instance of JwtIntegrationRequestCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtIntegrationResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtIntegrationResponse.java new file mode 100644 index 0000000..23dfa96 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtIntegrationResponse.java @@ -0,0 +1,762 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * JwtIntegrationResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class JwtIntegrationResponse { + /** + * Gets or Sets algo + */ + @JsonAdapter(AlgoEnum.Adapter.class) + public enum AlgoEnum { + HS256("HS256"), + + HS384("HS384"), + + HS512("HS512"), + + RS256("RS256"), + + RS384("RS384"), + + RS512("RS512"), + + ES256("ES256"), + + ES384("ES384"), + + ES512("ES512"); + + private String value; + + AlgoEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AlgoEnum fromValue(String value) { + for (AlgoEnum b : AlgoEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<AlgoEnum> { + @Override + public void write(final JsonWriter jsonWriter, final AlgoEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AlgoEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AlgoEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AlgoEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ALGO = "Algo"; + @SerializedName(SERIALIZED_NAME_ALGO) + @javax.annotation.Nullable + private AlgoEnum algo; + + public static final String SERIALIZED_NAME_SECRET = "Secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + @javax.annotation.Nullable + private String secret; + + public static final String SERIALIZED_NAME_MAPPING_TEMPLATE = "MappingTemplate"; + @SerializedName(SERIALIZED_NAME_MAPPING_TEMPLATE) + @javax.annotation.Nullable + private String mappingTemplate; + + public static final String SERIALIZED_NAME_MAPPING = "Mapping"; + @SerializedName(SERIALIZED_NAME_MAPPING) + @javax.annotation.Nullable + private Map<String, String> mapping = new HashMap<>(); + + public static final String SERIALIZED_NAME_METADATA = "Metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + @javax.annotation.Nullable + private Map<String, String> metadata = new HashMap<>(); + + public static final String SERIALIZED_NAME_AUDIENCE = "Audience"; + @SerializedName(SERIALIZED_NAME_AUDIENCE) + @javax.annotation.Nullable + private List<String> audience = new ArrayList<>(); + + public static final String SERIALIZED_NAME_NOT_AFTER_DIFFERENCE = "NotAfterDifference"; + @SerializedName(SERIALIZED_NAME_NOT_AFTER_DIFFERENCE) + @javax.annotation.Nullable + private Integer notAfterDifference; + + public static final String SERIALIZED_NAME_NOT_BEFORE_DIFFERENCE = "NotBeforeDifference"; + @SerializedName(SERIALIZED_NAME_NOT_BEFORE_DIFFERENCE) + @javax.annotation.Nullable + private Integer notBeforeDifference; + + public static final String SERIALIZED_NAME_QUERY_STRING_PARAMETER = "QueryStringParameter"; + @SerializedName(SERIALIZED_NAME_QUERY_STRING_PARAMETER) + @javax.annotation.Nullable + private String queryStringParameter; + + /** + * Gets or Sets responseMode + */ + @JsonAdapter(ResponseModeEnum.Adapter.class) + public enum ResponseModeEnum { + QUERY("query"), + + FRAGMENT("fragment"), + + FORM_POST("form_post"); + + private String value; + + ResponseModeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ResponseModeEnum fromValue(String value) { + for (ResponseModeEnum b : ResponseModeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<ResponseModeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final ResponseModeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ResponseModeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ResponseModeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ResponseModeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_RESPONSE_MODE = "ResponseMode"; + @SerializedName(SERIALIZED_NAME_RESPONSE_MODE) + @javax.annotation.Nullable + private ResponseModeEnum responseMode; + + public static final String SERIALIZED_NAME_LOGIN_URL = "LoginUrl"; + @SerializedName(SERIALIZED_NAME_LOGIN_URL) + @javax.annotation.Nullable + private String loginUrl; + + public static final String SERIALIZED_NAME_APP_NAME = "AppName"; + @SerializedName(SERIALIZED_NAME_APP_NAME) + @javax.annotation.Nullable + private String appName; + + public JwtIntegrationResponse() { + } + + public JwtIntegrationResponse algo(@javax.annotation.Nullable AlgoEnum algo) { + this.algo = algo; + return this; + } + + /** + * Get algo + * @return algo + */ + @javax.annotation.Nullable + public AlgoEnum getAlgo() { + return algo; + } + + public void setAlgo(@javax.annotation.Nullable AlgoEnum algo) { + this.algo = algo; + } + + + public JwtIntegrationResponse secret(@javax.annotation.Nullable String secret) { + this.secret = secret; + return this; + } + + /** + * Get secret + * @return secret + */ + @javax.annotation.Nullable + public String getSecret() { + return secret; + } + + public void setSecret(@javax.annotation.Nullable String secret) { + this.secret = secret; + } + + + public JwtIntegrationResponse mappingTemplate(@javax.annotation.Nullable String mappingTemplate) { + this.mappingTemplate = mappingTemplate; + return this; + } + + /** + * Get mappingTemplate + * @return mappingTemplate + */ + @javax.annotation.Nullable + public String getMappingTemplate() { + return mappingTemplate; + } + + public void setMappingTemplate(@javax.annotation.Nullable String mappingTemplate) { + this.mappingTemplate = mappingTemplate; + } + + + public JwtIntegrationResponse mapping(@javax.annotation.Nullable Map<String, String> mapping) { + this.mapping = mapping; + return this; + } + + public JwtIntegrationResponse putMappingItem(String key, String mappingItem) { + if (this.mapping == null) { + this.mapping = new HashMap<>(); + } + this.mapping.put(key, mappingItem); + return this; + } + + /** + * Get mapping + * @return mapping + */ + @javax.annotation.Nullable + public Map<String, String> getMapping() { + return mapping; + } + + public void setMapping(@javax.annotation.Nullable Map<String, String> mapping) { + this.mapping = mapping; + } + + + public JwtIntegrationResponse metadata(@javax.annotation.Nullable Map<String, String> metadata) { + this.metadata = metadata; + return this; + } + + public JwtIntegrationResponse putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Get metadata + * @return metadata + */ + @javax.annotation.Nullable + public Map<String, String> getMetadata() { + return metadata; + } + + public void setMetadata(@javax.annotation.Nullable Map<String, String> metadata) { + this.metadata = metadata; + } + + + public JwtIntegrationResponse audience(@javax.annotation.Nullable List<String> audience) { + this.audience = audience; + return this; + } + + public JwtIntegrationResponse addAudienceItem(String audienceItem) { + if (this.audience == null) { + this.audience = new ArrayList<>(); + } + this.audience.add(audienceItem); + return this; + } + + /** + * Get audience + * @return audience + */ + @javax.annotation.Nullable + public List<String> getAudience() { + return audience; + } + + public void setAudience(@javax.annotation.Nullable List<String> audience) { + this.audience = audience; + } + + + public JwtIntegrationResponse notAfterDifference(@javax.annotation.Nullable Integer notAfterDifference) { + this.notAfterDifference = notAfterDifference; + return this; + } + + /** + * Get notAfterDifference + * @return notAfterDifference + */ + @javax.annotation.Nullable + public Integer getNotAfterDifference() { + return notAfterDifference; + } + + public void setNotAfterDifference(@javax.annotation.Nullable Integer notAfterDifference) { + this.notAfterDifference = notAfterDifference; + } + + + public JwtIntegrationResponse notBeforeDifference(@javax.annotation.Nullable Integer notBeforeDifference) { + this.notBeforeDifference = notBeforeDifference; + return this; + } + + /** + * Get notBeforeDifference + * @return notBeforeDifference + */ + @javax.annotation.Nullable + public Integer getNotBeforeDifference() { + return notBeforeDifference; + } + + public void setNotBeforeDifference(@javax.annotation.Nullable Integer notBeforeDifference) { + this.notBeforeDifference = notBeforeDifference; + } + + + public JwtIntegrationResponse queryStringParameter(@javax.annotation.Nullable String queryStringParameter) { + this.queryStringParameter = queryStringParameter; + return this; + } + + /** + * Get queryStringParameter + * @return queryStringParameter + */ + @javax.annotation.Nullable + public String getQueryStringParameter() { + return queryStringParameter; + } + + public void setQueryStringParameter(@javax.annotation.Nullable String queryStringParameter) { + this.queryStringParameter = queryStringParameter; + } + + + public JwtIntegrationResponse responseMode(@javax.annotation.Nullable ResponseModeEnum responseMode) { + this.responseMode = responseMode; + return this; + } + + /** + * Get responseMode + * @return responseMode + */ + @javax.annotation.Nullable + public ResponseModeEnum getResponseMode() { + return responseMode; + } + + public void setResponseMode(@javax.annotation.Nullable ResponseModeEnum responseMode) { + this.responseMode = responseMode; + } + + + public JwtIntegrationResponse loginUrl(@javax.annotation.Nullable String loginUrl) { + this.loginUrl = loginUrl; + return this; + } + + /** + * Get loginUrl + * @return loginUrl + */ + @javax.annotation.Nullable + public String getLoginUrl() { + return loginUrl; + } + + public void setLoginUrl(@javax.annotation.Nullable String loginUrl) { + this.loginUrl = loginUrl; + } + + + public JwtIntegrationResponse appName(@javax.annotation.Nullable String appName) { + this.appName = appName; + return this; + } + + /** + * Get appName + * @return appName + */ + @javax.annotation.Nullable + public String getAppName() { + return appName; + } + + public void setAppName(@javax.annotation.Nullable String appName) { + this.appName = appName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the JwtIntegrationResponse instance itself + */ + public JwtIntegrationResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JwtIntegrationResponse jwtIntegrationResponse = (JwtIntegrationResponse) o; + return Objects.equals(this.algo, jwtIntegrationResponse.algo) && + Objects.equals(this.secret, jwtIntegrationResponse.secret) && + Objects.equals(this.mappingTemplate, jwtIntegrationResponse.mappingTemplate) && + Objects.equals(this.mapping, jwtIntegrationResponse.mapping) && + Objects.equals(this.metadata, jwtIntegrationResponse.metadata) && + Objects.equals(this.audience, jwtIntegrationResponse.audience) && + Objects.equals(this.notAfterDifference, jwtIntegrationResponse.notAfterDifference) && + Objects.equals(this.notBeforeDifference, jwtIntegrationResponse.notBeforeDifference) && + Objects.equals(this.queryStringParameter, jwtIntegrationResponse.queryStringParameter) && + Objects.equals(this.responseMode, jwtIntegrationResponse.responseMode) && + Objects.equals(this.loginUrl, jwtIntegrationResponse.loginUrl) && + Objects.equals(this.appName, jwtIntegrationResponse.appName)&& + Objects.equals(this.additionalProperties, jwtIntegrationResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(algo, secret, mappingTemplate, mapping, metadata, audience, notAfterDifference, notBeforeDifference, queryStringParameter, responseMode, loginUrl, appName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JwtIntegrationResponse {\n"); + sb.append(" algo: ").append(toIndentedString(algo)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" mappingTemplate: ").append(toIndentedString(mappingTemplate)).append("\n"); + sb.append(" mapping: ").append(toIndentedString(mapping)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" audience: ").append(toIndentedString(audience)).append("\n"); + sb.append(" notAfterDifference: ").append(toIndentedString(notAfterDifference)).append("\n"); + sb.append(" notBeforeDifference: ").append(toIndentedString(notBeforeDifference)).append("\n"); + sb.append(" queryStringParameter: ").append(toIndentedString(queryStringParameter)).append("\n"); + sb.append(" responseMode: ").append(toIndentedString(responseMode)).append("\n"); + sb.append(" loginUrl: ").append(toIndentedString(loginUrl)).append("\n"); + sb.append(" appName: ").append(toIndentedString(appName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Algo"); + openapiFields.add("Secret"); + openapiFields.add("MappingTemplate"); + openapiFields.add("Mapping"); + openapiFields.add("Metadata"); + openapiFields.add("Audience"); + openapiFields.add("NotAfterDifference"); + openapiFields.add("NotBeforeDifference"); + openapiFields.add("QueryStringParameter"); + openapiFields.add("ResponseMode"); + openapiFields.add("LoginUrl"); + openapiFields.add("AppName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 JwtIntegrationResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!JwtIntegrationResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JwtIntegrationResponse is not found in the empty JSON string", JwtIntegrationResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Algo") != null && !jsonObj.get("Algo").isJsonNull()) && !jsonObj.get("Algo").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Algo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Algo").toString())); + } + // validate the optional field `Algo` + if (jsonObj.get("Algo") != null && !jsonObj.get("Algo").isJsonNull()) { + AlgoEnum.validateJsonElement(jsonObj.get("Algo")); + } + if ((jsonObj.get("Secret") != null && !jsonObj.get("Secret").isJsonNull()) && !jsonObj.get("Secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Secret").toString())); + } + if ((jsonObj.get("MappingTemplate") != null && !jsonObj.get("MappingTemplate").isJsonNull()) && !jsonObj.get("MappingTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MappingTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MappingTemplate").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("Audience") != null && !jsonObj.get("Audience").isJsonNull() && !jsonObj.get("Audience").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Audience` to be an array in the JSON string but got `%s`", jsonObj.get("Audience").toString())); + } + if ((jsonObj.get("QueryStringParameter") != null && !jsonObj.get("QueryStringParameter").isJsonNull()) && !jsonObj.get("QueryStringParameter").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `QueryStringParameter` to be a primitive type in the JSON string but got `%s`", jsonObj.get("QueryStringParameter").toString())); + } + if ((jsonObj.get("ResponseMode") != null && !jsonObj.get("ResponseMode").isJsonNull()) && !jsonObj.get("ResponseMode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ResponseMode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ResponseMode").toString())); + } + // validate the optional field `ResponseMode` + if (jsonObj.get("ResponseMode") != null && !jsonObj.get("ResponseMode").isJsonNull()) { + ResponseModeEnum.validateJsonElement(jsonObj.get("ResponseMode")); + } + if ((jsonObj.get("LoginUrl") != null && !jsonObj.get("LoginUrl").isJsonNull()) && !jsonObj.get("LoginUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LoginUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LoginUrl").toString())); + } + if ((jsonObj.get("AppName") != null && !jsonObj.get("AppName").isJsonNull()) && !jsonObj.get("AppName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AppName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AppName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!JwtIntegrationResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JwtIntegrationResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<JwtIntegrationResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JwtIntegrationResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<JwtIntegrationResponse>() { + @Override + public void write(JsonWriter out, JwtIntegrationResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public JwtIntegrationResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + JwtIntegrationResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JwtIntegrationResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of JwtIntegrationResponse + * @throws IOException if the JSON string is invalid with respect to JwtIntegrationResponse + */ + public static JwtIntegrationResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JwtIntegrationResponse.class); + } + + /** + * Convert an instance of JwtIntegrationResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtIntegrationResponseCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtIntegrationResponseCore.java new file mode 100644 index 0000000..739e9a2 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtIntegrationResponseCore.java @@ -0,0 +1,287 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * JwtIntegrationResponseCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class JwtIntegrationResponseCore { + public static final String SERIALIZED_NAME_APP_NAME = "AppName"; + @SerializedName(SERIALIZED_NAME_APP_NAME) + @javax.annotation.Nullable + private String appName; + + public JwtIntegrationResponseCore() { + } + + public JwtIntegrationResponseCore appName(@javax.annotation.Nullable String appName) { + this.appName = appName; + return this; + } + + /** + * Get appName + * @return appName + */ + @javax.annotation.Nullable + public String getAppName() { + return appName; + } + + public void setAppName(@javax.annotation.Nullable String appName) { + this.appName = appName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the JwtIntegrationResponseCore instance itself + */ + public JwtIntegrationResponseCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JwtIntegrationResponseCore jwtIntegrationResponseCore = (JwtIntegrationResponseCore) o; + return Objects.equals(this.appName, jwtIntegrationResponseCore.appName)&& + Objects.equals(this.additionalProperties, jwtIntegrationResponseCore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(appName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JwtIntegrationResponseCore {\n"); + sb.append(" appName: ").append(toIndentedString(appName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AppName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 JwtIntegrationResponseCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!JwtIntegrationResponseCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JwtIntegrationResponseCore is not found in the empty JSON string", JwtIntegrationResponseCore.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("AppName") != null && !jsonObj.get("AppName").isJsonNull()) && !jsonObj.get("AppName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AppName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AppName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!JwtIntegrationResponseCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JwtIntegrationResponseCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<JwtIntegrationResponseCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JwtIntegrationResponseCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<JwtIntegrationResponseCore>() { + @Override + public void write(JsonWriter out, JwtIntegrationResponseCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public JwtIntegrationResponseCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + JwtIntegrationResponseCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JwtIntegrationResponseCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of JwtIntegrationResponseCore + * @throws IOException if the JSON string is invalid with respect to JwtIntegrationResponseCore + */ + public static JwtIntegrationResponseCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JwtIntegrationResponseCore.class); + } + + /** + * Convert an instance of JwtIntegrationResponseCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtIssuerValidation.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtIssuerValidation.java new file mode 100644 index 0000000..bbc7edc --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtIssuerValidation.java @@ -0,0 +1,341 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * JwtIssuerValidation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class JwtIssuerValidation { + public static final String SERIALIZED_NAME_EXPECTED_VALUE = "ExpectedValue"; + @SerializedName(SERIALIZED_NAME_EXPECTED_VALUE) + @javax.annotation.Nullable + private String expectedValue; + + public static final String SERIALIZED_NAME_MATCH_VALUE = "MatchValue"; + @SerializedName(SERIALIZED_NAME_MATCH_VALUE) + @javax.annotation.Nullable + private Boolean matchValue; + + public static final String SERIALIZED_NAME_IS_MANDATORY = "IsMandatory"; + @SerializedName(SERIALIZED_NAME_IS_MANDATORY) + @javax.annotation.Nullable + private Boolean isMandatory; + + public JwtIssuerValidation() { + } + + public JwtIssuerValidation expectedValue(@javax.annotation.Nullable String expectedValue) { + this.expectedValue = expectedValue; + return this; + } + + /** + * Get expectedValue + * @return expectedValue + */ + @javax.annotation.Nullable + public String getExpectedValue() { + return expectedValue; + } + + public void setExpectedValue(@javax.annotation.Nullable String expectedValue) { + this.expectedValue = expectedValue; + } + + + public JwtIssuerValidation matchValue(@javax.annotation.Nullable Boolean matchValue) { + this.matchValue = matchValue; + return this; + } + + /** + * Get matchValue + * @return matchValue + */ + @javax.annotation.Nullable + public Boolean getMatchValue() { + return matchValue; + } + + public void setMatchValue(@javax.annotation.Nullable Boolean matchValue) { + this.matchValue = matchValue; + } + + + public JwtIssuerValidation isMandatory(@javax.annotation.Nullable Boolean isMandatory) { + this.isMandatory = isMandatory; + return this; + } + + /** + * Get isMandatory + * @return isMandatory + */ + @javax.annotation.Nullable + public Boolean getIsMandatory() { + return isMandatory; + } + + public void setIsMandatory(@javax.annotation.Nullable Boolean isMandatory) { + this.isMandatory = isMandatory; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the JwtIssuerValidation instance itself + */ + public JwtIssuerValidation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JwtIssuerValidation jwtIssuerValidation = (JwtIssuerValidation) o; + return Objects.equals(this.expectedValue, jwtIssuerValidation.expectedValue) && + Objects.equals(this.matchValue, jwtIssuerValidation.matchValue) && + Objects.equals(this.isMandatory, jwtIssuerValidation.isMandatory)&& + Objects.equals(this.additionalProperties, jwtIssuerValidation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(expectedValue, matchValue, isMandatory, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JwtIssuerValidation {\n"); + sb.append(" expectedValue: ").append(toIndentedString(expectedValue)).append("\n"); + sb.append(" matchValue: ").append(toIndentedString(matchValue)).append("\n"); + sb.append(" isMandatory: ").append(toIndentedString(isMandatory)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ExpectedValue"); + openapiFields.add("MatchValue"); + openapiFields.add("IsMandatory"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 JwtIssuerValidation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!JwtIssuerValidation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JwtIssuerValidation is not found in the empty JSON string", JwtIssuerValidation.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ExpectedValue") != null && !jsonObj.get("ExpectedValue").isJsonNull()) && !jsonObj.get("ExpectedValue").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ExpectedValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ExpectedValue").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!JwtIssuerValidation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JwtIssuerValidation' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<JwtIssuerValidation> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JwtIssuerValidation.class)); + + return (TypeAdapter<T>) new TypeAdapter<JwtIssuerValidation>() { + @Override + public void write(JsonWriter out, JwtIssuerValidation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public JwtIssuerValidation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + JwtIssuerValidation instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JwtIssuerValidation given an JSON string + * + * @param jsonString JSON string + * @return An instance of JwtIssuerValidation + * @throws IOException if the JSON string is invalid with respect to JwtIssuerValidation + */ + public static JwtIssuerValidation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JwtIssuerValidation.class); + } + + /** + * Convert an instance of JwtIssuerValidation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtSpConfig.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtSpConfig.java new file mode 100644 index 0000000..5b63aad --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtSpConfig.java @@ -0,0 +1,1046 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.JwtAudienceValidation; +import com.loginradius.sdk.internal.openapi.model.JwtIssuerValidation; +import com.loginradius.sdk.internal.openapi.model.JwtValidation; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * JwtSpConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class JwtSpConfig { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_IS_ACTIVE = "IsActive"; + @SerializedName(SERIALIZED_NAME_IS_ACTIVE) + @javax.annotation.Nullable + private Boolean isActive; + + public static final String SERIALIZED_NAME_APP_ID = "AppId"; + @SerializedName(SERIALIZED_NAME_APP_ID) + @javax.annotation.Nullable + private Integer appId; + + public static final String SERIALIZED_NAME_APP_NAME = "AppName"; + @SerializedName(SERIALIZED_NAME_APP_NAME) + @javax.annotation.Nullable + private String appName; + + public static final String SERIALIZED_NAME_ALGO = "Algo"; + @SerializedName(SERIALIZED_NAME_ALGO) + @javax.annotation.Nullable + private String algo; + + public static final String SERIALIZED_NAME_MAPPING = "Mapping"; + @SerializedName(SERIALIZED_NAME_MAPPING) + @javax.annotation.Nullable + private Map<String, String> mapping = new HashMap<>(); + + public static final String SERIALIZED_NAME_KEY = "Key"; + @SerializedName(SERIALIZED_NAME_KEY) + @javax.annotation.Nullable + private String key; + + public static final String SERIALIZED_NAME_TOKEN_QUERY_PARAMETER_NAME = "TokenQueryParameterName"; + @SerializedName(SERIALIZED_NAME_TOKEN_QUERY_PARAMETER_NAME) + @javax.annotation.Nullable + private String tokenQueryParameterName; + + public static final String SERIALIZED_NAME_CLOCK_SKEW = "ClockSkew"; + @SerializedName(SERIALIZED_NAME_CLOCK_SKEW) + @javax.annotation.Nullable + private Integer clockSkew; + + public static final String SERIALIZED_NAME_LOGIN_URL = "LoginUrl"; + @SerializedName(SERIALIZED_NAME_LOGIN_URL) + @javax.annotation.Nullable + private String loginUrl; + + public static final String SERIALIZED_NAME_ISSUER = "Issuer"; + @SerializedName(SERIALIZED_NAME_ISSUER) + @javax.annotation.Nullable + private JwtIssuerValidation issuer; + + public static final String SERIALIZED_NAME_SUBJECT = "Subject"; + @SerializedName(SERIALIZED_NAME_SUBJECT) + @javax.annotation.Nullable + private JwtValidation subject; + + public static final String SERIALIZED_NAME_AUDIENCE = "Audience"; + @SerializedName(SERIALIZED_NAME_AUDIENCE) + @javax.annotation.Nullable + private JwtAudienceValidation audience; + + public static final String SERIALIZED_NAME_EXPIRATION_TIME_DIFFERENCE = "ExpirationTimeDifference"; + @SerializedName(SERIALIZED_NAME_EXPIRATION_TIME_DIFFERENCE) + @javax.annotation.Nullable + private Integer expirationTimeDifference; + + public static final String SERIALIZED_NAME_USE_AUTHORIZATION_HEADER = "UseAuthorizationHeader"; + @SerializedName(SERIALIZED_NAME_USE_AUTHORIZATION_HEADER) + @javax.annotation.Nullable + private Boolean useAuthorizationHeader; + + public static final String SERIALIZED_NAME_NOT_BEFORE = "NotBefore"; + @SerializedName(SERIALIZED_NAME_NOT_BEFORE) + @javax.annotation.Nullable + private JwtValidation notBefore; + + public static final String SERIALIZED_NAME_EXPIRATION = "Expiration"; + @SerializedName(SERIALIZED_NAME_EXPIRATION) + @javax.annotation.Nullable + private JwtValidation expiration; + + public static final String SERIALIZED_NAME_JW_K_S_URL = "JWKSUrl"; + @SerializedName(SERIALIZED_NAME_JW_K_S_URL) + @javax.annotation.Nullable + private String jwKSUrl; + + public static final String SERIALIZED_NAME_UPDATE_EMAIL_PROFILE = "UpdateEmailProfile"; + @SerializedName(SERIALIZED_NAME_UPDATE_EMAIL_PROFILE) + @javax.annotation.Nullable + private Boolean updateEmailProfile; + + public static final String SERIALIZED_NAME_RAAS_UPDATE_FIELDS = "RaasUpdateFields"; + @SerializedName(SERIALIZED_NAME_RAAS_UPDATE_FIELDS) + @javax.annotation.Nullable + private List<String> raasUpdateFields = new ArrayList<>(); + + public static final String SERIALIZED_NAME_DOMAIN = "Domain"; + @SerializedName(SERIALIZED_NAME_DOMAIN) + @javax.annotation.Nullable + private String domain; + + public static final String SERIALIZED_NAME_ENABLE_AUTO_LOOK_UP = "EnableAutoLookUp"; + @SerializedName(SERIALIZED_NAME_ENABLE_AUTO_LOOK_UP) + @javax.annotation.Nullable + private Boolean enableAutoLookUp; + + public static final String SERIALIZED_NAME_VERSION = "Version"; + @SerializedName(SERIALIZED_NAME_VERSION) + @javax.annotation.Nullable + private String version; + + public static final String SERIALIZED_NAME_LIST_IN_INTERFACE = "ListInInterface"; + @SerializedName(SERIALIZED_NAME_LIST_IN_INTERFACE) + @javax.annotation.Nullable + private Boolean listInInterface; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public static final String SERIALIZED_NAME_LAST_MODIFIED_DATE = "LastModifiedDate"; + @SerializedName(SERIALIZED_NAME_LAST_MODIFIED_DATE) + @javax.annotation.Nullable + private OffsetDateTime lastModifiedDate; + + public JwtSpConfig() { + } + + public JwtSpConfig id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public JwtSpConfig isActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Get isActive + * @return isActive + */ + @javax.annotation.Nullable + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + } + + + public JwtSpConfig appId(@javax.annotation.Nullable Integer appId) { + this.appId = appId; + return this; + } + + /** + * Get appId + * @return appId + */ + @javax.annotation.Nullable + public Integer getAppId() { + return appId; + } + + public void setAppId(@javax.annotation.Nullable Integer appId) { + this.appId = appId; + } + + + public JwtSpConfig appName(@javax.annotation.Nullable String appName) { + this.appName = appName; + return this; + } + + /** + * Get appName + * @return appName + */ + @javax.annotation.Nullable + public String getAppName() { + return appName; + } + + public void setAppName(@javax.annotation.Nullable String appName) { + this.appName = appName; + } + + + public JwtSpConfig algo(@javax.annotation.Nullable String algo) { + this.algo = algo; + return this; + } + + /** + * Get algo + * @return algo + */ + @javax.annotation.Nullable + public String getAlgo() { + return algo; + } + + public void setAlgo(@javax.annotation.Nullable String algo) { + this.algo = algo; + } + + + public JwtSpConfig mapping(@javax.annotation.Nullable Map<String, String> mapping) { + this.mapping = mapping; + return this; + } + + public JwtSpConfig putMappingItem(String key, String mappingItem) { + if (this.mapping == null) { + this.mapping = new HashMap<>(); + } + this.mapping.put(key, mappingItem); + return this; + } + + /** + * Get mapping + * @return mapping + */ + @javax.annotation.Nullable + public Map<String, String> getMapping() { + return mapping; + } + + public void setMapping(@javax.annotation.Nullable Map<String, String> mapping) { + this.mapping = mapping; + } + + + public JwtSpConfig key(@javax.annotation.Nullable String key) { + this.key = key; + return this; + } + + /** + * Get key + * @return key + */ + @javax.annotation.Nullable + public String getKey() { + return key; + } + + public void setKey(@javax.annotation.Nullable String key) { + this.key = key; + } + + + public JwtSpConfig tokenQueryParameterName(@javax.annotation.Nullable String tokenQueryParameterName) { + this.tokenQueryParameterName = tokenQueryParameterName; + return this; + } + + /** + * Get tokenQueryParameterName + * @return tokenQueryParameterName + */ + @javax.annotation.Nullable + public String getTokenQueryParameterName() { + return tokenQueryParameterName; + } + + public void setTokenQueryParameterName(@javax.annotation.Nullable String tokenQueryParameterName) { + this.tokenQueryParameterName = tokenQueryParameterName; + } + + + public JwtSpConfig clockSkew(@javax.annotation.Nullable Integer clockSkew) { + this.clockSkew = clockSkew; + return this; + } + + /** + * Get clockSkew + * @return clockSkew + */ + @javax.annotation.Nullable + public Integer getClockSkew() { + return clockSkew; + } + + public void setClockSkew(@javax.annotation.Nullable Integer clockSkew) { + this.clockSkew = clockSkew; + } + + + public JwtSpConfig loginUrl(@javax.annotation.Nullable String loginUrl) { + this.loginUrl = loginUrl; + return this; + } + + /** + * Get loginUrl + * @return loginUrl + */ + @javax.annotation.Nullable + public String getLoginUrl() { + return loginUrl; + } + + public void setLoginUrl(@javax.annotation.Nullable String loginUrl) { + this.loginUrl = loginUrl; + } + + + public JwtSpConfig issuer(@javax.annotation.Nullable JwtIssuerValidation issuer) { + this.issuer = issuer; + return this; + } + + /** + * Get issuer + * @return issuer + */ + @javax.annotation.Nullable + public JwtIssuerValidation getIssuer() { + return issuer; + } + + public void setIssuer(@javax.annotation.Nullable JwtIssuerValidation issuer) { + this.issuer = issuer; + } + + + public JwtSpConfig subject(@javax.annotation.Nullable JwtValidation subject) { + this.subject = subject; + return this; + } + + /** + * Get subject + * @return subject + */ + @javax.annotation.Nullable + public JwtValidation getSubject() { + return subject; + } + + public void setSubject(@javax.annotation.Nullable JwtValidation subject) { + this.subject = subject; + } + + + public JwtSpConfig audience(@javax.annotation.Nullable JwtAudienceValidation audience) { + this.audience = audience; + return this; + } + + /** + * Get audience + * @return audience + */ + @javax.annotation.Nullable + public JwtAudienceValidation getAudience() { + return audience; + } + + public void setAudience(@javax.annotation.Nullable JwtAudienceValidation audience) { + this.audience = audience; + } + + + public JwtSpConfig expirationTimeDifference(@javax.annotation.Nullable Integer expirationTimeDifference) { + this.expirationTimeDifference = expirationTimeDifference; + return this; + } + + /** + * Get expirationTimeDifference + * @return expirationTimeDifference + */ + @javax.annotation.Nullable + public Integer getExpirationTimeDifference() { + return expirationTimeDifference; + } + + public void setExpirationTimeDifference(@javax.annotation.Nullable Integer expirationTimeDifference) { + this.expirationTimeDifference = expirationTimeDifference; + } + + + public JwtSpConfig useAuthorizationHeader(@javax.annotation.Nullable Boolean useAuthorizationHeader) { + this.useAuthorizationHeader = useAuthorizationHeader; + return this; + } + + /** + * Get useAuthorizationHeader + * @return useAuthorizationHeader + */ + @javax.annotation.Nullable + public Boolean getUseAuthorizationHeader() { + return useAuthorizationHeader; + } + + public void setUseAuthorizationHeader(@javax.annotation.Nullable Boolean useAuthorizationHeader) { + this.useAuthorizationHeader = useAuthorizationHeader; + } + + + public JwtSpConfig notBefore(@javax.annotation.Nullable JwtValidation notBefore) { + this.notBefore = notBefore; + return this; + } + + /** + * Get notBefore + * @return notBefore + */ + @javax.annotation.Nullable + public JwtValidation getNotBefore() { + return notBefore; + } + + public void setNotBefore(@javax.annotation.Nullable JwtValidation notBefore) { + this.notBefore = notBefore; + } + + + public JwtSpConfig expiration(@javax.annotation.Nullable JwtValidation expiration) { + this.expiration = expiration; + return this; + } + + /** + * Get expiration + * @return expiration + */ + @javax.annotation.Nullable + public JwtValidation getExpiration() { + return expiration; + } + + public void setExpiration(@javax.annotation.Nullable JwtValidation expiration) { + this.expiration = expiration; + } + + + public JwtSpConfig jwKSUrl(@javax.annotation.Nullable String jwKSUrl) { + this.jwKSUrl = jwKSUrl; + return this; + } + + /** + * Get jwKSUrl + * @return jwKSUrl + */ + @javax.annotation.Nullable + public String getJwKSUrl() { + return jwKSUrl; + } + + public void setJwKSUrl(@javax.annotation.Nullable String jwKSUrl) { + this.jwKSUrl = jwKSUrl; + } + + + public JwtSpConfig updateEmailProfile(@javax.annotation.Nullable Boolean updateEmailProfile) { + this.updateEmailProfile = updateEmailProfile; + return this; + } + + /** + * Get updateEmailProfile + * @return updateEmailProfile + */ + @javax.annotation.Nullable + public Boolean getUpdateEmailProfile() { + return updateEmailProfile; + } + + public void setUpdateEmailProfile(@javax.annotation.Nullable Boolean updateEmailProfile) { + this.updateEmailProfile = updateEmailProfile; + } + + + public JwtSpConfig raasUpdateFields(@javax.annotation.Nullable List<String> raasUpdateFields) { + this.raasUpdateFields = raasUpdateFields; + return this; + } + + public JwtSpConfig addRaasUpdateFieldsItem(String raasUpdateFieldsItem) { + if (this.raasUpdateFields == null) { + this.raasUpdateFields = new ArrayList<>(); + } + this.raasUpdateFields.add(raasUpdateFieldsItem); + return this; + } + + /** + * Get raasUpdateFields + * @return raasUpdateFields + */ + @javax.annotation.Nullable + public List<String> getRaasUpdateFields() { + return raasUpdateFields; + } + + public void setRaasUpdateFields(@javax.annotation.Nullable List<String> raasUpdateFields) { + this.raasUpdateFields = raasUpdateFields; + } + + + public JwtSpConfig domain(@javax.annotation.Nullable String domain) { + this.domain = domain; + return this; + } + + /** + * Get domain + * @return domain + */ + @javax.annotation.Nullable + public String getDomain() { + return domain; + } + + public void setDomain(@javax.annotation.Nullable String domain) { + this.domain = domain; + } + + + public JwtSpConfig enableAutoLookUp(@javax.annotation.Nullable Boolean enableAutoLookUp) { + this.enableAutoLookUp = enableAutoLookUp; + return this; + } + + /** + * Get enableAutoLookUp + * @return enableAutoLookUp + */ + @javax.annotation.Nullable + public Boolean getEnableAutoLookUp() { + return enableAutoLookUp; + } + + public void setEnableAutoLookUp(@javax.annotation.Nullable Boolean enableAutoLookUp) { + this.enableAutoLookUp = enableAutoLookUp; + } + + + public JwtSpConfig version(@javax.annotation.Nullable String version) { + this.version = version; + return this; + } + + /** + * Get version + * @return version + */ + @javax.annotation.Nullable + public String getVersion() { + return version; + } + + public void setVersion(@javax.annotation.Nullable String version) { + this.version = version; + } + + + public JwtSpConfig listInInterface(@javax.annotation.Nullable Boolean listInInterface) { + this.listInInterface = listInInterface; + return this; + } + + /** + * Get listInInterface + * @return listInInterface + */ + @javax.annotation.Nullable + public Boolean getListInInterface() { + return listInInterface; + } + + public void setListInInterface(@javax.annotation.Nullable Boolean listInInterface) { + this.listInInterface = listInInterface; + } + + + public JwtSpConfig createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get createdDate + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + + public JwtSpConfig lastModifiedDate(@javax.annotation.Nullable OffsetDateTime lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + return this; + } + + /** + * Get lastModifiedDate + * @return lastModifiedDate + */ + @javax.annotation.Nullable + public OffsetDateTime getLastModifiedDate() { + return lastModifiedDate; + } + + public void setLastModifiedDate(@javax.annotation.Nullable OffsetDateTime lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the JwtSpConfig instance itself + */ + public JwtSpConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JwtSpConfig jwtSpConfig = (JwtSpConfig) o; + return Objects.equals(this.id, jwtSpConfig.id) && + Objects.equals(this.isActive, jwtSpConfig.isActive) && + Objects.equals(this.appId, jwtSpConfig.appId) && + Objects.equals(this.appName, jwtSpConfig.appName) && + Objects.equals(this.algo, jwtSpConfig.algo) && + Objects.equals(this.mapping, jwtSpConfig.mapping) && + Objects.equals(this.key, jwtSpConfig.key) && + Objects.equals(this.tokenQueryParameterName, jwtSpConfig.tokenQueryParameterName) && + Objects.equals(this.clockSkew, jwtSpConfig.clockSkew) && + Objects.equals(this.loginUrl, jwtSpConfig.loginUrl) && + Objects.equals(this.issuer, jwtSpConfig.issuer) && + Objects.equals(this.subject, jwtSpConfig.subject) && + Objects.equals(this.audience, jwtSpConfig.audience) && + Objects.equals(this.expirationTimeDifference, jwtSpConfig.expirationTimeDifference) && + Objects.equals(this.useAuthorizationHeader, jwtSpConfig.useAuthorizationHeader) && + Objects.equals(this.notBefore, jwtSpConfig.notBefore) && + Objects.equals(this.expiration, jwtSpConfig.expiration) && + Objects.equals(this.jwKSUrl, jwtSpConfig.jwKSUrl) && + Objects.equals(this.updateEmailProfile, jwtSpConfig.updateEmailProfile) && + Objects.equals(this.raasUpdateFields, jwtSpConfig.raasUpdateFields) && + Objects.equals(this.domain, jwtSpConfig.domain) && + Objects.equals(this.enableAutoLookUp, jwtSpConfig.enableAutoLookUp) && + Objects.equals(this.version, jwtSpConfig.version) && + Objects.equals(this.listInInterface, jwtSpConfig.listInInterface) && + Objects.equals(this.createdDate, jwtSpConfig.createdDate) && + Objects.equals(this.lastModifiedDate, jwtSpConfig.lastModifiedDate)&& + Objects.equals(this.additionalProperties, jwtSpConfig.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(id, isActive, appId, appName, algo, mapping, key, tokenQueryParameterName, clockSkew, loginUrl, issuer, subject, audience, expirationTimeDifference, useAuthorizationHeader, notBefore, expiration, jwKSUrl, updateEmailProfile, raasUpdateFields, domain, enableAutoLookUp, version, listInInterface, createdDate, lastModifiedDate, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JwtSpConfig {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" appId: ").append(toIndentedString(appId)).append("\n"); + sb.append(" appName: ").append(toIndentedString(appName)).append("\n"); + sb.append(" algo: ").append(toIndentedString(algo)).append("\n"); + sb.append(" mapping: ").append(toIndentedString(mapping)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" tokenQueryParameterName: ").append(toIndentedString(tokenQueryParameterName)).append("\n"); + sb.append(" clockSkew: ").append(toIndentedString(clockSkew)).append("\n"); + sb.append(" loginUrl: ").append(toIndentedString(loginUrl)).append("\n"); + sb.append(" issuer: ").append(toIndentedString(issuer)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" audience: ").append(toIndentedString(audience)).append("\n"); + sb.append(" expirationTimeDifference: ").append(toIndentedString(expirationTimeDifference)).append("\n"); + sb.append(" useAuthorizationHeader: ").append(toIndentedString(useAuthorizationHeader)).append("\n"); + sb.append(" notBefore: ").append(toIndentedString(notBefore)).append("\n"); + sb.append(" expiration: ").append(toIndentedString(expiration)).append("\n"); + sb.append(" jwKSUrl: ").append(toIndentedString(jwKSUrl)).append("\n"); + sb.append(" updateEmailProfile: ").append(toIndentedString(updateEmailProfile)).append("\n"); + sb.append(" raasUpdateFields: ").append(toIndentedString(raasUpdateFields)).append("\n"); + sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); + sb.append(" enableAutoLookUp: ").append(toIndentedString(enableAutoLookUp)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" listInInterface: ").append(toIndentedString(listInInterface)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" lastModifiedDate: ").append(toIndentedString(lastModifiedDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("IsActive"); + openapiFields.add("AppId"); + openapiFields.add("AppName"); + openapiFields.add("Algo"); + openapiFields.add("Mapping"); + openapiFields.add("Key"); + openapiFields.add("TokenQueryParameterName"); + openapiFields.add("ClockSkew"); + openapiFields.add("LoginUrl"); + openapiFields.add("Issuer"); + openapiFields.add("Subject"); + openapiFields.add("Audience"); + openapiFields.add("ExpirationTimeDifference"); + openapiFields.add("UseAuthorizationHeader"); + openapiFields.add("NotBefore"); + openapiFields.add("Expiration"); + openapiFields.add("JWKSUrl"); + openapiFields.add("UpdateEmailProfile"); + openapiFields.add("RaasUpdateFields"); + openapiFields.add("Domain"); + openapiFields.add("EnableAutoLookUp"); + openapiFields.add("Version"); + openapiFields.add("ListInInterface"); + openapiFields.add("CreatedDate"); + openapiFields.add("LastModifiedDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 JwtSpConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!JwtSpConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JwtSpConfig is not found in the empty JSON string", JwtSpConfig.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("AppName") != null && !jsonObj.get("AppName").isJsonNull()) && !jsonObj.get("AppName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AppName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AppName").toString())); + } + if ((jsonObj.get("Algo") != null && !jsonObj.get("Algo").isJsonNull()) && !jsonObj.get("Algo").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Algo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Algo").toString())); + } + if ((jsonObj.get("Key") != null && !jsonObj.get("Key").isJsonNull()) && !jsonObj.get("Key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Key").toString())); + } + if ((jsonObj.get("TokenQueryParameterName") != null && !jsonObj.get("TokenQueryParameterName").isJsonNull()) && !jsonObj.get("TokenQueryParameterName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TokenQueryParameterName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TokenQueryParameterName").toString())); + } + if ((jsonObj.get("LoginUrl") != null && !jsonObj.get("LoginUrl").isJsonNull()) && !jsonObj.get("LoginUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LoginUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LoginUrl").toString())); + } + // validate the optional field `Issuer` + if (jsonObj.get("Issuer") != null && !jsonObj.get("Issuer").isJsonNull()) { + JwtIssuerValidation.validateJsonElement(jsonObj.get("Issuer")); + } + // validate the optional field `Subject` + if (jsonObj.get("Subject") != null && !jsonObj.get("Subject").isJsonNull()) { + JwtValidation.validateJsonElement(jsonObj.get("Subject")); + } + // validate the optional field `Audience` + if (jsonObj.get("Audience") != null && !jsonObj.get("Audience").isJsonNull()) { + JwtAudienceValidation.validateJsonElement(jsonObj.get("Audience")); + } + // validate the optional field `NotBefore` + if (jsonObj.get("NotBefore") != null && !jsonObj.get("NotBefore").isJsonNull()) { + JwtValidation.validateJsonElement(jsonObj.get("NotBefore")); + } + // validate the optional field `Expiration` + if (jsonObj.get("Expiration") != null && !jsonObj.get("Expiration").isJsonNull()) { + JwtValidation.validateJsonElement(jsonObj.get("Expiration")); + } + if ((jsonObj.get("JWKSUrl") != null && !jsonObj.get("JWKSUrl").isJsonNull()) && !jsonObj.get("JWKSUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `JWKSUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("JWKSUrl").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("RaasUpdateFields") != null && !jsonObj.get("RaasUpdateFields").isJsonNull() && !jsonObj.get("RaasUpdateFields").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RaasUpdateFields` to be an array in the JSON string but got `%s`", jsonObj.get("RaasUpdateFields").toString())); + } + if ((jsonObj.get("Domain") != null && !jsonObj.get("Domain").isJsonNull()) && !jsonObj.get("Domain").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Domain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Domain").toString())); + } + if ((jsonObj.get("Version") != null && !jsonObj.get("Version").isJsonNull()) && !jsonObj.get("Version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Version").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!JwtSpConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JwtSpConfig' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<JwtSpConfig> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JwtSpConfig.class)); + + return (TypeAdapter<T>) new TypeAdapter<JwtSpConfig>() { + @Override + public void write(JsonWriter out, JwtSpConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public JwtSpConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + JwtSpConfig instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JwtSpConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of JwtSpConfig + * @throws IOException if the JSON string is invalid with respect to JwtSpConfig + */ + public static JwtSpConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JwtSpConfig.class); + } + + /** + * Convert an instance of JwtSpConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtSpConfigBaseModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtSpConfigBaseModel.java new file mode 100644 index 0000000..54501ad --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtSpConfigBaseModel.java @@ -0,0 +1,847 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.JwtClaimAudienceProperty; +import com.loginradius.sdk.internal.openapi.model.JwtClaimMandatory; +import com.loginradius.sdk.internal.openapi.model.JwtClaimSubjectProperty; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * JwtSpConfigBaseModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class JwtSpConfigBaseModel { + public static final String SERIALIZED_NAME_ALGO = "Algo"; + @SerializedName(SERIALIZED_NAME_ALGO) + @javax.annotation.Nullable + private String algo; + + public static final String SERIALIZED_NAME_MAPPING = "Mapping"; + @SerializedName(SERIALIZED_NAME_MAPPING) + @javax.annotation.Nullable + private Map<String, String> mapping = new HashMap<>(); + + public static final String SERIALIZED_NAME_KEY = "Key"; + @SerializedName(SERIALIZED_NAME_KEY) + @javax.annotation.Nullable + private String key; + + public static final String SERIALIZED_NAME_TOKEN_QUERY_PARAMETER_NAME = "TokenQueryParameterName"; + @SerializedName(SERIALIZED_NAME_TOKEN_QUERY_PARAMETER_NAME) + @javax.annotation.Nullable + private String tokenQueryParameterName; + + public static final String SERIALIZED_NAME_CLOCK_SKEW = "ClockSkew"; + @SerializedName(SERIALIZED_NAME_CLOCK_SKEW) + @javax.annotation.Nullable + private Integer clockSkew; + + public static final String SERIALIZED_NAME_LOGIN_URL = "LoginUrl"; + @SerializedName(SERIALIZED_NAME_LOGIN_URL) + @javax.annotation.Nullable + private String loginUrl; + + public static final String SERIALIZED_NAME_ISSUER = "Issuer"; + @SerializedName(SERIALIZED_NAME_ISSUER) + @javax.annotation.Nullable + private JwtClaimSubjectProperty issuer; + + public static final String SERIALIZED_NAME_SUBJECT = "Subject"; + @SerializedName(SERIALIZED_NAME_SUBJECT) + @javax.annotation.Nullable + private JwtClaimMandatory subject; + + public static final String SERIALIZED_NAME_AUDIENCE = "Audience"; + @SerializedName(SERIALIZED_NAME_AUDIENCE) + @javax.annotation.Nullable + private JwtClaimAudienceProperty audience; + + public static final String SERIALIZED_NAME_EXPIRATION_TIME_DIFFERENCE = "ExpirationTimeDifference"; + @SerializedName(SERIALIZED_NAME_EXPIRATION_TIME_DIFFERENCE) + @javax.annotation.Nullable + private Integer expirationTimeDifference; + + public static final String SERIALIZED_NAME_USE_AUTHORIZATION_HEADER = "UseAuthorizationHeader"; + @SerializedName(SERIALIZED_NAME_USE_AUTHORIZATION_HEADER) + @javax.annotation.Nullable + private Boolean useAuthorizationHeader; + + public static final String SERIALIZED_NAME_NOT_BEFORE = "NotBefore"; + @SerializedName(SERIALIZED_NAME_NOT_BEFORE) + @javax.annotation.Nullable + private JwtClaimMandatory notBefore; + + public static final String SERIALIZED_NAME_EXPIRATION = "Expiration"; + @SerializedName(SERIALIZED_NAME_EXPIRATION) + @javax.annotation.Nullable + private JwtClaimMandatory expiration; + + public static final String SERIALIZED_NAME_JW_K_S_URL = "JWKSUrl"; + @SerializedName(SERIALIZED_NAME_JW_K_S_URL) + @javax.annotation.Nullable + private String jwKSUrl; + + public static final String SERIALIZED_NAME_UPDATE_EMAIL_PROFILE = "UpdateEmailProfile"; + @SerializedName(SERIALIZED_NAME_UPDATE_EMAIL_PROFILE) + @javax.annotation.Nullable + private Boolean updateEmailProfile; + + public static final String SERIALIZED_NAME_RAAS_UPDATE_FIELDS = "RaasUpdateFields"; + @SerializedName(SERIALIZED_NAME_RAAS_UPDATE_FIELDS) + @javax.annotation.Nullable + private List<String> raasUpdateFields = new ArrayList<>(); + + public static final String SERIALIZED_NAME_DOMAIN = "Domain"; + @SerializedName(SERIALIZED_NAME_DOMAIN) + @javax.annotation.Nullable + private String domain; + + public static final String SERIALIZED_NAME_ENABLE_AUTO_LOOK_UP = "EnableAutoLookUp"; + @SerializedName(SERIALIZED_NAME_ENABLE_AUTO_LOOK_UP) + @javax.annotation.Nullable + private Boolean enableAutoLookUp; + + public static final String SERIALIZED_NAME_LIST_IN_INTERFACE = "ListInInterface"; + @SerializedName(SERIALIZED_NAME_LIST_IN_INTERFACE) + @javax.annotation.Nullable + private Boolean listInInterface; + + public JwtSpConfigBaseModel() { + } + + public JwtSpConfigBaseModel algo(@javax.annotation.Nullable String algo) { + this.algo = algo; + return this; + } + + /** + * Get algo + * @return algo + */ + @javax.annotation.Nullable + public String getAlgo() { + return algo; + } + + public void setAlgo(@javax.annotation.Nullable String algo) { + this.algo = algo; + } + + + public JwtSpConfigBaseModel mapping(@javax.annotation.Nullable Map<String, String> mapping) { + this.mapping = mapping; + return this; + } + + public JwtSpConfigBaseModel putMappingItem(String key, String mappingItem) { + if (this.mapping == null) { + this.mapping = new HashMap<>(); + } + this.mapping.put(key, mappingItem); + return this; + } + + /** + * Get mapping + * @return mapping + */ + @javax.annotation.Nullable + public Map<String, String> getMapping() { + return mapping; + } + + public void setMapping(@javax.annotation.Nullable Map<String, String> mapping) { + this.mapping = mapping; + } + + + public JwtSpConfigBaseModel key(@javax.annotation.Nullable String key) { + this.key = key; + return this; + } + + /** + * Get key + * @return key + */ + @javax.annotation.Nullable + public String getKey() { + return key; + } + + public void setKey(@javax.annotation.Nullable String key) { + this.key = key; + } + + + public JwtSpConfigBaseModel tokenQueryParameterName(@javax.annotation.Nullable String tokenQueryParameterName) { + this.tokenQueryParameterName = tokenQueryParameterName; + return this; + } + + /** + * Get tokenQueryParameterName + * @return tokenQueryParameterName + */ + @javax.annotation.Nullable + public String getTokenQueryParameterName() { + return tokenQueryParameterName; + } + + public void setTokenQueryParameterName(@javax.annotation.Nullable String tokenQueryParameterName) { + this.tokenQueryParameterName = tokenQueryParameterName; + } + + + public JwtSpConfigBaseModel clockSkew(@javax.annotation.Nullable Integer clockSkew) { + this.clockSkew = clockSkew; + return this; + } + + /** + * Get clockSkew + * @return clockSkew + */ + @javax.annotation.Nullable + public Integer getClockSkew() { + return clockSkew; + } + + public void setClockSkew(@javax.annotation.Nullable Integer clockSkew) { + this.clockSkew = clockSkew; + } + + + public JwtSpConfigBaseModel loginUrl(@javax.annotation.Nullable String loginUrl) { + this.loginUrl = loginUrl; + return this; + } + + /** + * Get loginUrl + * @return loginUrl + */ + @javax.annotation.Nullable + public String getLoginUrl() { + return loginUrl; + } + + public void setLoginUrl(@javax.annotation.Nullable String loginUrl) { + this.loginUrl = loginUrl; + } + + + public JwtSpConfigBaseModel issuer(@javax.annotation.Nullable JwtClaimSubjectProperty issuer) { + this.issuer = issuer; + return this; + } + + /** + * Get issuer + * @return issuer + */ + @javax.annotation.Nullable + public JwtClaimSubjectProperty getIssuer() { + return issuer; + } + + public void setIssuer(@javax.annotation.Nullable JwtClaimSubjectProperty issuer) { + this.issuer = issuer; + } + + + public JwtSpConfigBaseModel subject(@javax.annotation.Nullable JwtClaimMandatory subject) { + this.subject = subject; + return this; + } + + /** + * Get subject + * @return subject + */ + @javax.annotation.Nullable + public JwtClaimMandatory getSubject() { + return subject; + } + + public void setSubject(@javax.annotation.Nullable JwtClaimMandatory subject) { + this.subject = subject; + } + + + public JwtSpConfigBaseModel audience(@javax.annotation.Nullable JwtClaimAudienceProperty audience) { + this.audience = audience; + return this; + } + + /** + * Get audience + * @return audience + */ + @javax.annotation.Nullable + public JwtClaimAudienceProperty getAudience() { + return audience; + } + + public void setAudience(@javax.annotation.Nullable JwtClaimAudienceProperty audience) { + this.audience = audience; + } + + + public JwtSpConfigBaseModel expirationTimeDifference(@javax.annotation.Nullable Integer expirationTimeDifference) { + this.expirationTimeDifference = expirationTimeDifference; + return this; + } + + /** + * Get expirationTimeDifference + * @return expirationTimeDifference + */ + @javax.annotation.Nullable + public Integer getExpirationTimeDifference() { + return expirationTimeDifference; + } + + public void setExpirationTimeDifference(@javax.annotation.Nullable Integer expirationTimeDifference) { + this.expirationTimeDifference = expirationTimeDifference; + } + + + public JwtSpConfigBaseModel useAuthorizationHeader(@javax.annotation.Nullable Boolean useAuthorizationHeader) { + this.useAuthorizationHeader = useAuthorizationHeader; + return this; + } + + /** + * Get useAuthorizationHeader + * @return useAuthorizationHeader + */ + @javax.annotation.Nullable + public Boolean getUseAuthorizationHeader() { + return useAuthorizationHeader; + } + + public void setUseAuthorizationHeader(@javax.annotation.Nullable Boolean useAuthorizationHeader) { + this.useAuthorizationHeader = useAuthorizationHeader; + } + + + public JwtSpConfigBaseModel notBefore(@javax.annotation.Nullable JwtClaimMandatory notBefore) { + this.notBefore = notBefore; + return this; + } + + /** + * Get notBefore + * @return notBefore + */ + @javax.annotation.Nullable + public JwtClaimMandatory getNotBefore() { + return notBefore; + } + + public void setNotBefore(@javax.annotation.Nullable JwtClaimMandatory notBefore) { + this.notBefore = notBefore; + } + + + public JwtSpConfigBaseModel expiration(@javax.annotation.Nullable JwtClaimMandatory expiration) { + this.expiration = expiration; + return this; + } + + /** + * Get expiration + * @return expiration + */ + @javax.annotation.Nullable + public JwtClaimMandatory getExpiration() { + return expiration; + } + + public void setExpiration(@javax.annotation.Nullable JwtClaimMandatory expiration) { + this.expiration = expiration; + } + + + public JwtSpConfigBaseModel jwKSUrl(@javax.annotation.Nullable String jwKSUrl) { + this.jwKSUrl = jwKSUrl; + return this; + } + + /** + * Get jwKSUrl + * @return jwKSUrl + */ + @javax.annotation.Nullable + public String getJwKSUrl() { + return jwKSUrl; + } + + public void setJwKSUrl(@javax.annotation.Nullable String jwKSUrl) { + this.jwKSUrl = jwKSUrl; + } + + + public JwtSpConfigBaseModel updateEmailProfile(@javax.annotation.Nullable Boolean updateEmailProfile) { + this.updateEmailProfile = updateEmailProfile; + return this; + } + + /** + * Get updateEmailProfile + * @return updateEmailProfile + */ + @javax.annotation.Nullable + public Boolean getUpdateEmailProfile() { + return updateEmailProfile; + } + + public void setUpdateEmailProfile(@javax.annotation.Nullable Boolean updateEmailProfile) { + this.updateEmailProfile = updateEmailProfile; + } + + + public JwtSpConfigBaseModel raasUpdateFields(@javax.annotation.Nullable List<String> raasUpdateFields) { + this.raasUpdateFields = raasUpdateFields; + return this; + } + + public JwtSpConfigBaseModel addRaasUpdateFieldsItem(String raasUpdateFieldsItem) { + if (this.raasUpdateFields == null) { + this.raasUpdateFields = new ArrayList<>(); + } + this.raasUpdateFields.add(raasUpdateFieldsItem); + return this; + } + + /** + * Get raasUpdateFields + * @return raasUpdateFields + */ + @javax.annotation.Nullable + public List<String> getRaasUpdateFields() { + return raasUpdateFields; + } + + public void setRaasUpdateFields(@javax.annotation.Nullable List<String> raasUpdateFields) { + this.raasUpdateFields = raasUpdateFields; + } + + + public JwtSpConfigBaseModel domain(@javax.annotation.Nullable String domain) { + this.domain = domain; + return this; + } + + /** + * Get domain + * @return domain + */ + @javax.annotation.Nullable + public String getDomain() { + return domain; + } + + public void setDomain(@javax.annotation.Nullable String domain) { + this.domain = domain; + } + + + public JwtSpConfigBaseModel enableAutoLookUp(@javax.annotation.Nullable Boolean enableAutoLookUp) { + this.enableAutoLookUp = enableAutoLookUp; + return this; + } + + /** + * Get enableAutoLookUp + * @return enableAutoLookUp + */ + @javax.annotation.Nullable + public Boolean getEnableAutoLookUp() { + return enableAutoLookUp; + } + + public void setEnableAutoLookUp(@javax.annotation.Nullable Boolean enableAutoLookUp) { + this.enableAutoLookUp = enableAutoLookUp; + } + + + public JwtSpConfigBaseModel listInInterface(@javax.annotation.Nullable Boolean listInInterface) { + this.listInInterface = listInInterface; + return this; + } + + /** + * Get listInInterface + * @return listInInterface + */ + @javax.annotation.Nullable + public Boolean getListInInterface() { + return listInInterface; + } + + public void setListInInterface(@javax.annotation.Nullable Boolean listInInterface) { + this.listInInterface = listInInterface; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the JwtSpConfigBaseModel instance itself + */ + public JwtSpConfigBaseModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JwtSpConfigBaseModel jwtSpConfigBaseModel = (JwtSpConfigBaseModel) o; + return Objects.equals(this.algo, jwtSpConfigBaseModel.algo) && + Objects.equals(this.mapping, jwtSpConfigBaseModel.mapping) && + Objects.equals(this.key, jwtSpConfigBaseModel.key) && + Objects.equals(this.tokenQueryParameterName, jwtSpConfigBaseModel.tokenQueryParameterName) && + Objects.equals(this.clockSkew, jwtSpConfigBaseModel.clockSkew) && + Objects.equals(this.loginUrl, jwtSpConfigBaseModel.loginUrl) && + Objects.equals(this.issuer, jwtSpConfigBaseModel.issuer) && + Objects.equals(this.subject, jwtSpConfigBaseModel.subject) && + Objects.equals(this.audience, jwtSpConfigBaseModel.audience) && + Objects.equals(this.expirationTimeDifference, jwtSpConfigBaseModel.expirationTimeDifference) && + Objects.equals(this.useAuthorizationHeader, jwtSpConfigBaseModel.useAuthorizationHeader) && + Objects.equals(this.notBefore, jwtSpConfigBaseModel.notBefore) && + Objects.equals(this.expiration, jwtSpConfigBaseModel.expiration) && + Objects.equals(this.jwKSUrl, jwtSpConfigBaseModel.jwKSUrl) && + Objects.equals(this.updateEmailProfile, jwtSpConfigBaseModel.updateEmailProfile) && + Objects.equals(this.raasUpdateFields, jwtSpConfigBaseModel.raasUpdateFields) && + Objects.equals(this.domain, jwtSpConfigBaseModel.domain) && + Objects.equals(this.enableAutoLookUp, jwtSpConfigBaseModel.enableAutoLookUp) && + Objects.equals(this.listInInterface, jwtSpConfigBaseModel.listInInterface)&& + Objects.equals(this.additionalProperties, jwtSpConfigBaseModel.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(algo, mapping, key, tokenQueryParameterName, clockSkew, loginUrl, issuer, subject, audience, expirationTimeDifference, useAuthorizationHeader, notBefore, expiration, jwKSUrl, updateEmailProfile, raasUpdateFields, domain, enableAutoLookUp, listInInterface, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JwtSpConfigBaseModel {\n"); + sb.append(" algo: ").append(toIndentedString(algo)).append("\n"); + sb.append(" mapping: ").append(toIndentedString(mapping)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" tokenQueryParameterName: ").append(toIndentedString(tokenQueryParameterName)).append("\n"); + sb.append(" clockSkew: ").append(toIndentedString(clockSkew)).append("\n"); + sb.append(" loginUrl: ").append(toIndentedString(loginUrl)).append("\n"); + sb.append(" issuer: ").append(toIndentedString(issuer)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" audience: ").append(toIndentedString(audience)).append("\n"); + sb.append(" expirationTimeDifference: ").append(toIndentedString(expirationTimeDifference)).append("\n"); + sb.append(" useAuthorizationHeader: ").append(toIndentedString(useAuthorizationHeader)).append("\n"); + sb.append(" notBefore: ").append(toIndentedString(notBefore)).append("\n"); + sb.append(" expiration: ").append(toIndentedString(expiration)).append("\n"); + sb.append(" jwKSUrl: ").append(toIndentedString(jwKSUrl)).append("\n"); + sb.append(" updateEmailProfile: ").append(toIndentedString(updateEmailProfile)).append("\n"); + sb.append(" raasUpdateFields: ").append(toIndentedString(raasUpdateFields)).append("\n"); + sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); + sb.append(" enableAutoLookUp: ").append(toIndentedString(enableAutoLookUp)).append("\n"); + sb.append(" listInInterface: ").append(toIndentedString(listInInterface)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Algo"); + openapiFields.add("Mapping"); + openapiFields.add("Key"); + openapiFields.add("TokenQueryParameterName"); + openapiFields.add("ClockSkew"); + openapiFields.add("LoginUrl"); + openapiFields.add("Issuer"); + openapiFields.add("Subject"); + openapiFields.add("Audience"); + openapiFields.add("ExpirationTimeDifference"); + openapiFields.add("UseAuthorizationHeader"); + openapiFields.add("NotBefore"); + openapiFields.add("Expiration"); + openapiFields.add("JWKSUrl"); + openapiFields.add("UpdateEmailProfile"); + openapiFields.add("RaasUpdateFields"); + openapiFields.add("Domain"); + openapiFields.add("EnableAutoLookUp"); + openapiFields.add("ListInInterface"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 JwtSpConfigBaseModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!JwtSpConfigBaseModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JwtSpConfigBaseModel is not found in the empty JSON string", JwtSpConfigBaseModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Algo") != null && !jsonObj.get("Algo").isJsonNull()) && !jsonObj.get("Algo").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Algo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Algo").toString())); + } + if ((jsonObj.get("Key") != null && !jsonObj.get("Key").isJsonNull()) && !jsonObj.get("Key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Key").toString())); + } + if ((jsonObj.get("TokenQueryParameterName") != null && !jsonObj.get("TokenQueryParameterName").isJsonNull()) && !jsonObj.get("TokenQueryParameterName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TokenQueryParameterName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TokenQueryParameterName").toString())); + } + if ((jsonObj.get("LoginUrl") != null && !jsonObj.get("LoginUrl").isJsonNull()) && !jsonObj.get("LoginUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LoginUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LoginUrl").toString())); + } + // validate the optional field `Issuer` + if (jsonObj.get("Issuer") != null && !jsonObj.get("Issuer").isJsonNull()) { + JwtClaimSubjectProperty.validateJsonElement(jsonObj.get("Issuer")); + } + // validate the optional field `Subject` + if (jsonObj.get("Subject") != null && !jsonObj.get("Subject").isJsonNull()) { + JwtClaimMandatory.validateJsonElement(jsonObj.get("Subject")); + } + // validate the optional field `Audience` + if (jsonObj.get("Audience") != null && !jsonObj.get("Audience").isJsonNull()) { + JwtClaimAudienceProperty.validateJsonElement(jsonObj.get("Audience")); + } + // validate the optional field `NotBefore` + if (jsonObj.get("NotBefore") != null && !jsonObj.get("NotBefore").isJsonNull()) { + JwtClaimMandatory.validateJsonElement(jsonObj.get("NotBefore")); + } + // validate the optional field `Expiration` + if (jsonObj.get("Expiration") != null && !jsonObj.get("Expiration").isJsonNull()) { + JwtClaimMandatory.validateJsonElement(jsonObj.get("Expiration")); + } + if ((jsonObj.get("JWKSUrl") != null && !jsonObj.get("JWKSUrl").isJsonNull()) && !jsonObj.get("JWKSUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `JWKSUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("JWKSUrl").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("RaasUpdateFields") != null && !jsonObj.get("RaasUpdateFields").isJsonNull() && !jsonObj.get("RaasUpdateFields").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RaasUpdateFields` to be an array in the JSON string but got `%s`", jsonObj.get("RaasUpdateFields").toString())); + } + if ((jsonObj.get("Domain") != null && !jsonObj.get("Domain").isJsonNull()) && !jsonObj.get("Domain").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Domain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Domain").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!JwtSpConfigBaseModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JwtSpConfigBaseModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<JwtSpConfigBaseModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JwtSpConfigBaseModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<JwtSpConfigBaseModel>() { + @Override + public void write(JsonWriter out, JwtSpConfigBaseModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public JwtSpConfigBaseModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + JwtSpConfigBaseModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JwtSpConfigBaseModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of JwtSpConfigBaseModel + * @throws IOException if the JSON string is invalid with respect to JwtSpConfigBaseModel + */ + public static JwtSpConfigBaseModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JwtSpConfigBaseModel.class); + } + + /** + * Convert an instance of JwtSpConfigBaseModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtSpConfigCreateCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtSpConfigCreateCore.java new file mode 100644 index 0000000..ebe3a32 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtSpConfigCreateCore.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * JwtSpConfigCreateCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class JwtSpConfigCreateCore { + public static final String SERIALIZED_NAME_APP_NAME = "AppName"; + @SerializedName(SERIALIZED_NAME_APP_NAME) + @javax.annotation.Nonnull + private String appName; + + public JwtSpConfigCreateCore() { + } + + public JwtSpConfigCreateCore appName(@javax.annotation.Nonnull String appName) { + this.appName = appName; + return this; + } + + /** + * Get appName + * @return appName + */ + @javax.annotation.Nonnull + public String getAppName() { + return appName; + } + + public void setAppName(@javax.annotation.Nonnull String appName) { + this.appName = appName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the JwtSpConfigCreateCore instance itself + */ + public JwtSpConfigCreateCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JwtSpConfigCreateCore jwtSpConfigCreateCore = (JwtSpConfigCreateCore) o; + return Objects.equals(this.appName, jwtSpConfigCreateCore.appName)&& + Objects.equals(this.additionalProperties, jwtSpConfigCreateCore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(appName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JwtSpConfigCreateCore {\n"); + sb.append(" appName: ").append(toIndentedString(appName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AppName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("AppName"); + } + + /** + * 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 JwtSpConfigCreateCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!JwtSpConfigCreateCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JwtSpConfigCreateCore is not found in the empty JSON string", JwtSpConfigCreateCore.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : JwtSpConfigCreateCore.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("AppName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AppName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AppName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!JwtSpConfigCreateCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JwtSpConfigCreateCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<JwtSpConfigCreateCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JwtSpConfigCreateCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<JwtSpConfigCreateCore>() { + @Override + public void write(JsonWriter out, JwtSpConfigCreateCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public JwtSpConfigCreateCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + JwtSpConfigCreateCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JwtSpConfigCreateCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of JwtSpConfigCreateCore + * @throws IOException if the JSON string is invalid with respect to JwtSpConfigCreateCore + */ + public static JwtSpConfigCreateCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JwtSpConfigCreateCore.class); + } + + /** + * Convert an instance of JwtSpConfigCreateCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtValidation.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtValidation.java new file mode 100644 index 0000000..ffd8d53 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/JwtValidation.java @@ -0,0 +1,284 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * JwtValidation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class JwtValidation { + public static final String SERIALIZED_NAME_IS_MANDATORY = "IsMandatory"; + @SerializedName(SERIALIZED_NAME_IS_MANDATORY) + @javax.annotation.Nullable + private Boolean isMandatory; + + public JwtValidation() { + } + + public JwtValidation isMandatory(@javax.annotation.Nullable Boolean isMandatory) { + this.isMandatory = isMandatory; + return this; + } + + /** + * Get isMandatory + * @return isMandatory + */ + @javax.annotation.Nullable + public Boolean getIsMandatory() { + return isMandatory; + } + + public void setIsMandatory(@javax.annotation.Nullable Boolean isMandatory) { + this.isMandatory = isMandatory; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the JwtValidation instance itself + */ + public JwtValidation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JwtValidation jwtValidation = (JwtValidation) o; + return Objects.equals(this.isMandatory, jwtValidation.isMandatory)&& + Objects.equals(this.additionalProperties, jwtValidation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isMandatory, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class JwtValidation {\n"); + sb.append(" isMandatory: ").append(toIndentedString(isMandatory)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsMandatory"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 JwtValidation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!JwtValidation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in JwtValidation is not found in the empty JSON string", JwtValidation.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!JwtValidation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'JwtValidation' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<JwtValidation> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(JwtValidation.class)); + + return (TypeAdapter<T>) new TypeAdapter<JwtValidation>() { + @Override + public void write(JsonWriter out, JwtValidation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public JwtValidation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + JwtValidation instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of JwtValidation given an JSON string + * + * @param jsonString JSON string + * @return An instance of JwtValidation + * @throws IOException if the JSON string is invalid with respect to JwtValidation + */ + public static JwtValidation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, JwtValidation.class); + } + + /** + * Convert an instance of JwtValidation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/LoginByEmail.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/LoginByEmail.java new file mode 100644 index 0000000..8203954 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/LoginByEmail.java @@ -0,0 +1,326 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * Login By Email + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class LoginByEmail { + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nonnull + private String email; + + public static final String SERIALIZED_NAME_PASSWORD = "password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nonnull + private String password; + + public LoginByEmail() { + } + + public LoginByEmail email(@javax.annotation.Nonnull String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nonnull String email) { + this.email = email; + } + + + public LoginByEmail password(@javax.annotation.Nonnull String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + @javax.annotation.Nonnull + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nonnull String password) { + this.password = password; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the LoginByEmail instance itself + */ + public LoginByEmail putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoginByEmail loginByEmail = (LoginByEmail) o; + return Objects.equals(this.email, loginByEmail.email) && + Objects.equals(this.password, loginByEmail.password)&& + Objects.equals(this.additionalProperties, loginByEmail.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, password, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LoginByEmail {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("email"); + openapiFields.add("password"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("password"); + } + + /** + * 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 LoginByEmail + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!LoginByEmail.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in LoginByEmail is not found in the empty JSON string", LoginByEmail.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : LoginByEmail.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("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if (!jsonObj.get("password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!LoginByEmail.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'LoginByEmail' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<LoginByEmail> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(LoginByEmail.class)); + + return (TypeAdapter<T>) new TypeAdapter<LoginByEmail>() { + @Override + public void write(JsonWriter out, LoginByEmail value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public LoginByEmail read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + LoginByEmail instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of LoginByEmail given an JSON string + * + * @param jsonString JSON string + * @return An instance of LoginByEmail + * @throws IOException if the JSON string is invalid with respect to LoginByEmail + */ + public static LoginByEmail fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, LoginByEmail.class); + } + + /** + * Convert an instance of LoginByEmail to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/LoginByEmailRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/LoginByEmailRequest.java new file mode 100644 index 0000000..df651b1 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/LoginByEmailRequest.java @@ -0,0 +1,486 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * LoginByEmailRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class LoginByEmailRequest { + public static final String SERIALIZED_NAME_G_RECAPTCHA_RESPONSE = "g-recaptcha-response"; + @SerializedName(SERIALIZED_NAME_G_RECAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String gRecaptchaResponse; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_TICKET = "qq_captcha_ticket"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_TICKET) + @javax.annotation.Nullable + private String qqCaptchaTicket; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR = "qq_captcha_randstr"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR) + @javax.annotation.Nullable + private String qqCaptchaRandstr; + + public static final String SERIALIZED_NAME_H_CAPTCHA_RESPONSE = "h-captcha-response"; + @SerializedName(SERIALIZED_NAME_H_CAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String hCaptchaResponse; + + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer; + + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private String email; + + public static final String SERIALIZED_NAME_PASSWORD = "Password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nullable + private String password; + + public LoginByEmailRequest() { + } + + public LoginByEmailRequest gRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + return this; + } + + /** + * The Google reCAPTCHA response which is sent to the server for verification. + * @return gRecaptchaResponse + */ + @javax.annotation.Nullable + public String getgRecaptchaResponse() { + return gRecaptchaResponse; + } + + public void setgRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + } + + + public LoginByEmailRequest qqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + return this; + } + + /** + * The QQ Captcha ticket which is sent to the server for verification. + * @return qqCaptchaTicket + */ + @javax.annotation.Nullable + public String getQqCaptchaTicket() { + return qqCaptchaTicket; + } + + public void setQqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + } + + + public LoginByEmailRequest qqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + return this; + } + + /** + * The QQ Captcha random string which is sent to the server for verification. + * @return qqCaptchaRandstr + */ + @javax.annotation.Nullable + public String getQqCaptchaRandstr() { + return qqCaptchaRandstr; + } + + public void setQqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + } + + + public LoginByEmailRequest hCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + return this; + } + + /** + * The hCaptcha response which is sent to the server for verification. + * @return hCaptchaResponse + */ + @javax.annotation.Nullable + public String gethCaptchaResponse() { + return hCaptchaResponse; + } + + public void sethCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + } + + + public LoginByEmailRequest securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public LoginByEmailRequest putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * The security answers which is set for the User, this will be used when the User is blocked for the security question. + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + + public LoginByEmailRequest email(@javax.annotation.Nullable String email) { + this.email = email; + return this; + } + + /** + * The Email address of the User + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable String email) { + this.email = email; + } + + + public LoginByEmailRequest password(@javax.annotation.Nullable String password) { + this.password = password; + return this; + } + + /** + * The Password of the User + * @return password + */ + @javax.annotation.Nullable + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nullable String password) { + this.password = password; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the LoginByEmailRequest instance itself + */ + public LoginByEmailRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoginByEmailRequest loginByEmailRequest = (LoginByEmailRequest) o; + return Objects.equals(this.gRecaptchaResponse, loginByEmailRequest.gRecaptchaResponse) && + Objects.equals(this.qqCaptchaTicket, loginByEmailRequest.qqCaptchaTicket) && + Objects.equals(this.qqCaptchaRandstr, loginByEmailRequest.qqCaptchaRandstr) && + Objects.equals(this.hCaptchaResponse, loginByEmailRequest.hCaptchaResponse) && + Objects.equals(this.securityAnswer, loginByEmailRequest.securityAnswer) && + Objects.equals(this.email, loginByEmailRequest.email) && + Objects.equals(this.password, loginByEmailRequest.password)&& + Objects.equals(this.additionalProperties, loginByEmailRequest.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, securityAnswer, email, password, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LoginByEmailRequest {\n"); + sb.append(" gRecaptchaResponse: ").append(toIndentedString(gRecaptchaResponse)).append("\n"); + sb.append(" qqCaptchaTicket: ").append(toIndentedString(qqCaptchaTicket)).append("\n"); + sb.append(" qqCaptchaRandstr: ").append(toIndentedString(qqCaptchaRandstr)).append("\n"); + sb.append(" hCaptchaResponse: ").append(toIndentedString(hCaptchaResponse)).append("\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("g-recaptcha-response"); + openapiFields.add("qq_captcha_ticket"); + openapiFields.add("qq_captcha_randstr"); + openapiFields.add("h-captcha-response"); + openapiFields.add("SecurityAnswer"); + openapiFields.add("Email"); + openapiFields.add("Password"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 LoginByEmailRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!LoginByEmailRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in LoginByEmailRequest is not found in the empty JSON string", LoginByEmailRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("g-recaptcha-response") != null && !jsonObj.get("g-recaptcha-response").isJsonNull()) && !jsonObj.get("g-recaptcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `g-recaptcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("g-recaptcha-response").toString())); + } + if ((jsonObj.get("qq_captcha_ticket") != null && !jsonObj.get("qq_captcha_ticket").isJsonNull()) && !jsonObj.get("qq_captcha_ticket").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_ticket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_ticket").toString())); + } + if ((jsonObj.get("qq_captcha_randstr") != null && !jsonObj.get("qq_captcha_randstr").isJsonNull()) && !jsonObj.get("qq_captcha_randstr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_randstr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_randstr").toString())); + } + if ((jsonObj.get("h-captcha-response") != null && !jsonObj.get("h-captcha-response").isJsonNull()) && !jsonObj.get("h-captcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `h-captcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("h-captcha-response").toString())); + } + if ((jsonObj.get("Email") != null && !jsonObj.get("Email").isJsonNull()) && !jsonObj.get("Email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Email").toString())); + } + if ((jsonObj.get("Password") != null && !jsonObj.get("Password").isJsonNull()) && !jsonObj.get("Password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Password").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!LoginByEmailRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'LoginByEmailRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<LoginByEmailRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(LoginByEmailRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<LoginByEmailRequest>() { + @Override + public void write(JsonWriter out, LoginByEmailRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public LoginByEmailRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + LoginByEmailRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of LoginByEmailRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of LoginByEmailRequest + * @throws IOException if the JSON string is invalid with respect to LoginByEmailRequest + */ + public static LoginByEmailRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, LoginByEmailRequest.class); + } + + /** + * Convert an instance of LoginByEmailRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/LoginByEmailRequestCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/LoginByEmailRequestCore.java new file mode 100644 index 0000000..370b608 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/LoginByEmailRequestCore.java @@ -0,0 +1,366 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * LoginByEmailRequestCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class LoginByEmailRequestCore { + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer; + + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private String email; + + public static final String SERIALIZED_NAME_PASSWORD = "Password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nullable + private String password; + + public LoginByEmailRequestCore() { + } + + public LoginByEmailRequestCore securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public LoginByEmailRequestCore putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * The security answers which is set for the User, this will be used when the User is blocked for the security question. + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + + public LoginByEmailRequestCore email(@javax.annotation.Nullable String email) { + this.email = email; + return this; + } + + /** + * The Email address of the User + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable String email) { + this.email = email; + } + + + public LoginByEmailRequestCore password(@javax.annotation.Nullable String password) { + this.password = password; + return this; + } + + /** + * The Password of the User + * @return password + */ + @javax.annotation.Nullable + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nullable String password) { + this.password = password; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the LoginByEmailRequestCore instance itself + */ + public LoginByEmailRequestCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoginByEmailRequestCore loginByEmailRequestCore = (LoginByEmailRequestCore) o; + return Objects.equals(this.securityAnswer, loginByEmailRequestCore.securityAnswer) && + Objects.equals(this.email, loginByEmailRequestCore.email) && + Objects.equals(this.password, loginByEmailRequestCore.password)&& + Objects.equals(this.additionalProperties, loginByEmailRequestCore.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(securityAnswer, email, password, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LoginByEmailRequestCore {\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("SecurityAnswer"); + openapiFields.add("Email"); + openapiFields.add("Password"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 LoginByEmailRequestCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!LoginByEmailRequestCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in LoginByEmailRequestCore is not found in the empty JSON string", LoginByEmailRequestCore.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Email") != null && !jsonObj.get("Email").isJsonNull()) && !jsonObj.get("Email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Email").toString())); + } + if ((jsonObj.get("Password") != null && !jsonObj.get("Password").isJsonNull()) && !jsonObj.get("Password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Password").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!LoginByEmailRequestCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'LoginByEmailRequestCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<LoginByEmailRequestCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(LoginByEmailRequestCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<LoginByEmailRequestCore>() { + @Override + public void write(JsonWriter out, LoginByEmailRequestCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public LoginByEmailRequestCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + LoginByEmailRequestCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of LoginByEmailRequestCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of LoginByEmailRequestCore + * @throws IOException if the JSON string is invalid with respect to LoginByEmailRequestCore + */ + public static LoginByEmailRequestCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, LoginByEmailRequestCore.class); + } + + /** + * Convert an instance of LoginByEmailRequestCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/LoginByPhone.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/LoginByPhone.java new file mode 100644 index 0000000..89a6621 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/LoginByPhone.java @@ -0,0 +1,488 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * LoginByPhone + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class LoginByPhone { + public static final String SERIALIZED_NAME_G_RECAPTCHA_RESPONSE = "g-recaptcha-response"; + @SerializedName(SERIALIZED_NAME_G_RECAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String gRecaptchaResponse; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_TICKET = "qq_captcha_ticket"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_TICKET) + @javax.annotation.Nullable + private String qqCaptchaTicket; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR = "qq_captcha_randstr"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR) + @javax.annotation.Nullable + private String qqCaptchaRandstr; + + public static final String SERIALIZED_NAME_H_CAPTCHA_RESPONSE = "h-captcha-response"; + @SerializedName(SERIALIZED_NAME_H_CAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String hCaptchaResponse; + + public static final String SERIALIZED_NAME_PHONE = "phone"; + @SerializedName(SERIALIZED_NAME_PHONE) + @javax.annotation.Nonnull + private String phone; + + public static final String SERIALIZED_NAME_PASSWORD = "password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nonnull + private String password; + + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "securityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private String securityAnswer; + + public LoginByPhone() { + } + + public LoginByPhone gRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + return this; + } + + /** + * The Google reCAPTCHA response which is sent to the server for verification. + * @return gRecaptchaResponse + */ + @javax.annotation.Nullable + public String getgRecaptchaResponse() { + return gRecaptchaResponse; + } + + public void setgRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + } + + + public LoginByPhone qqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + return this; + } + + /** + * The QQ Captcha ticket which is sent to the server for verification. + * @return qqCaptchaTicket + */ + @javax.annotation.Nullable + public String getQqCaptchaTicket() { + return qqCaptchaTicket; + } + + public void setQqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + } + + + public LoginByPhone qqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + return this; + } + + /** + * The QQ Captcha random string which is sent to the server for verification. + * @return qqCaptchaRandstr + */ + @javax.annotation.Nullable + public String getQqCaptchaRandstr() { + return qqCaptchaRandstr; + } + + public void setQqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + } + + + public LoginByPhone hCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + return this; + } + + /** + * The hCaptcha response which is sent to the server for verification. + * @return hCaptchaResponse + */ + @javax.annotation.Nullable + public String gethCaptchaResponse() { + return hCaptchaResponse; + } + + public void sethCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + } + + + public LoginByPhone phone(@javax.annotation.Nonnull String phone) { + this.phone = phone; + return this; + } + + /** + * The Phone number of the User + * @return phone + */ + @javax.annotation.Nonnull + public String getPhone() { + return phone; + } + + public void setPhone(@javax.annotation.Nonnull String phone) { + this.phone = phone; + } + + + public LoginByPhone password(@javax.annotation.Nonnull String password) { + this.password = password; + return this; + } + + /** + * The Password of the User + * @return password + */ + @javax.annotation.Nonnull + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nonnull String password) { + this.password = password; + } + + + public LoginByPhone securityAnswer(@javax.annotation.Nullable String securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + /** + * The security answer which is set for the User, this will be used when the User is blocked for the security question. + * @return securityAnswer + */ + @javax.annotation.Nullable + public String getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable String securityAnswer) { + this.securityAnswer = securityAnswer; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the LoginByPhone instance itself + */ + public LoginByPhone putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoginByPhone loginByPhone = (LoginByPhone) o; + return Objects.equals(this.gRecaptchaResponse, loginByPhone.gRecaptchaResponse) && + Objects.equals(this.qqCaptchaTicket, loginByPhone.qqCaptchaTicket) && + Objects.equals(this.qqCaptchaRandstr, loginByPhone.qqCaptchaRandstr) && + Objects.equals(this.hCaptchaResponse, loginByPhone.hCaptchaResponse) && + Objects.equals(this.phone, loginByPhone.phone) && + Objects.equals(this.password, loginByPhone.password) && + Objects.equals(this.securityAnswer, loginByPhone.securityAnswer)&& + Objects.equals(this.additionalProperties, loginByPhone.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, phone, password, securityAnswer, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LoginByPhone {\n"); + sb.append(" gRecaptchaResponse: ").append(toIndentedString(gRecaptchaResponse)).append("\n"); + sb.append(" qqCaptchaTicket: ").append(toIndentedString(qqCaptchaTicket)).append("\n"); + sb.append(" qqCaptchaRandstr: ").append(toIndentedString(qqCaptchaRandstr)).append("\n"); + sb.append(" hCaptchaResponse: ").append(toIndentedString(hCaptchaResponse)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" password: ").append("*").append("\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("g-recaptcha-response"); + openapiFields.add("qq_captcha_ticket"); + openapiFields.add("qq_captcha_randstr"); + openapiFields.add("h-captcha-response"); + openapiFields.add("phone"); + openapiFields.add("password"); + openapiFields.add("securityAnswer"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("phone"); + openapiRequiredFields.add("password"); + } + + /** + * 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 LoginByPhone + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!LoginByPhone.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in LoginByPhone is not found in the empty JSON string", LoginByPhone.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : LoginByPhone.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("g-recaptcha-response") != null && !jsonObj.get("g-recaptcha-response").isJsonNull()) && !jsonObj.get("g-recaptcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `g-recaptcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("g-recaptcha-response").toString())); + } + if ((jsonObj.get("qq_captcha_ticket") != null && !jsonObj.get("qq_captcha_ticket").isJsonNull()) && !jsonObj.get("qq_captcha_ticket").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_ticket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_ticket").toString())); + } + if ((jsonObj.get("qq_captcha_randstr") != null && !jsonObj.get("qq_captcha_randstr").isJsonNull()) && !jsonObj.get("qq_captcha_randstr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_randstr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_randstr").toString())); + } + if ((jsonObj.get("h-captcha-response") != null && !jsonObj.get("h-captcha-response").isJsonNull()) && !jsonObj.get("h-captcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `h-captcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("h-captcha-response").toString())); + } + if (!jsonObj.get("phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phone").toString())); + } + if (!jsonObj.get("password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); + } + if ((jsonObj.get("securityAnswer") != null && !jsonObj.get("securityAnswer").isJsonNull()) && !jsonObj.get("securityAnswer").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `securityAnswer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("securityAnswer").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!LoginByPhone.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'LoginByPhone' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<LoginByPhone> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(LoginByPhone.class)); + + return (TypeAdapter<T>) new TypeAdapter<LoginByPhone>() { + @Override + public void write(JsonWriter out, LoginByPhone value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public LoginByPhone read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + LoginByPhone instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of LoginByPhone given an JSON string + * + * @param jsonString JSON string + * @return An instance of LoginByPhone + * @throws IOException if the JSON string is invalid with respect to LoginByPhone + */ + public static LoginByPhone fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, LoginByPhone.class); + } + + /** + * Convert an instance of LoginByPhone to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/LoginByPhoneCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/LoginByPhoneCore.java new file mode 100644 index 0000000..16d53bc --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/LoginByPhoneCore.java @@ -0,0 +1,356 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * LoginByPhoneCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class LoginByPhoneCore { + public static final String SERIALIZED_NAME_PHONE = "phone"; + @SerializedName(SERIALIZED_NAME_PHONE) + @javax.annotation.Nonnull + private String phone; + + public static final String SERIALIZED_NAME_PASSWORD = "password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nonnull + private String password; + + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "securityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private String securityAnswer; + + public LoginByPhoneCore() { + } + + public LoginByPhoneCore phone(@javax.annotation.Nonnull String phone) { + this.phone = phone; + return this; + } + + /** + * The Phone number of the User + * @return phone + */ + @javax.annotation.Nonnull + public String getPhone() { + return phone; + } + + public void setPhone(@javax.annotation.Nonnull String phone) { + this.phone = phone; + } + + + public LoginByPhoneCore password(@javax.annotation.Nonnull String password) { + this.password = password; + return this; + } + + /** + * The Password of the User + * @return password + */ + @javax.annotation.Nonnull + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nonnull String password) { + this.password = password; + } + + + public LoginByPhoneCore securityAnswer(@javax.annotation.Nullable String securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + /** + * The security answer which is set for the User, this will be used when the User is blocked for the security question. + * @return securityAnswer + */ + @javax.annotation.Nullable + public String getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable String securityAnswer) { + this.securityAnswer = securityAnswer; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the LoginByPhoneCore instance itself + */ + public LoginByPhoneCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoginByPhoneCore loginByPhoneCore = (LoginByPhoneCore) o; + return Objects.equals(this.phone, loginByPhoneCore.phone) && + Objects.equals(this.password, loginByPhoneCore.password) && + Objects.equals(this.securityAnswer, loginByPhoneCore.securityAnswer)&& + Objects.equals(this.additionalProperties, loginByPhoneCore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(phone, password, securityAnswer, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LoginByPhoneCore {\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" password: ").append("*").append("\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("phone"); + openapiFields.add("password"); + openapiFields.add("securityAnswer"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("phone"); + openapiRequiredFields.add("password"); + } + + /** + * 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 LoginByPhoneCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!LoginByPhoneCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in LoginByPhoneCore is not found in the empty JSON string", LoginByPhoneCore.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : LoginByPhoneCore.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("phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phone").toString())); + } + if (!jsonObj.get("password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); + } + if ((jsonObj.get("securityAnswer") != null && !jsonObj.get("securityAnswer").isJsonNull()) && !jsonObj.get("securityAnswer").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `securityAnswer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("securityAnswer").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!LoginByPhoneCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'LoginByPhoneCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<LoginByPhoneCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(LoginByPhoneCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<LoginByPhoneCore>() { + @Override + public void write(JsonWriter out, LoginByPhoneCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public LoginByPhoneCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + LoginByPhoneCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of LoginByPhoneCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of LoginByPhoneCore + * @throws IOException if the JSON string is invalid with respect to LoginByPhoneCore + */ + public static LoginByPhoneCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, LoginByPhoneCore.class); + } + + /** + * Convert an instance of LoginByPhoneCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/LoginByUserName.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/LoginByUserName.java new file mode 100644 index 0000000..515a402 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/LoginByUserName.java @@ -0,0 +1,326 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * Login By UserName + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class LoginByUserName { + public static final String SERIALIZED_NAME_PASSWORD = "password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nonnull + private String password; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nonnull + private String username; + + public LoginByUserName() { + } + + public LoginByUserName password(@javax.annotation.Nonnull String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + @javax.annotation.Nonnull + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nonnull String password) { + this.password = password; + } + + + public LoginByUserName username(@javax.annotation.Nonnull String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + */ + @javax.annotation.Nonnull + public String getUsername() { + return username; + } + + public void setUsername(@javax.annotation.Nonnull String username) { + this.username = username; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the LoginByUserName instance itself + */ + public LoginByUserName putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoginByUserName loginByUserName = (LoginByUserName) o; + return Objects.equals(this.password, loginByUserName.password) && + Objects.equals(this.username, loginByUserName.username)&& + Objects.equals(this.additionalProperties, loginByUserName.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(password, username, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LoginByUserName {\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("password"); + openapiFields.add("username"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("password"); + openapiRequiredFields.add("username"); + } + + /** + * 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 LoginByUserName + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!LoginByUserName.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in LoginByUserName is not found in the empty JSON string", LoginByUserName.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : LoginByUserName.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("password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); + } + if (!jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!LoginByUserName.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'LoginByUserName' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<LoginByUserName> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(LoginByUserName.class)); + + return (TypeAdapter<T>) new TypeAdapter<LoginByUserName>() { + @Override + public void write(JsonWriter out, LoginByUserName value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public LoginByUserName read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + LoginByUserName instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of LoginByUserName given an JSON string + * + * @param jsonString JSON string + * @return An instance of LoginByUserName + * @throws IOException if the JSON string is invalid with respect to LoginByUserName + */ + public static LoginByUserName fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, LoginByUserName.class); + } + + /** + * Convert an instance of LoginByUserName to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/LoginByUsernameRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/LoginByUsernameRequest.java new file mode 100644 index 0000000..c52a9bc --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/LoginByUsernameRequest.java @@ -0,0 +1,488 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * LoginByUsernameRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class LoginByUsernameRequest { + public static final String SERIALIZED_NAME_G_RECAPTCHA_RESPONSE = "g-recaptcha-response"; + @SerializedName(SERIALIZED_NAME_G_RECAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String gRecaptchaResponse; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_TICKET = "qq_captcha_ticket"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_TICKET) + @javax.annotation.Nullable + private String qqCaptchaTicket; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR = "qq_captcha_randstr"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR) + @javax.annotation.Nullable + private String qqCaptchaRandstr; + + public static final String SERIALIZED_NAME_H_CAPTCHA_RESPONSE = "h-captcha-response"; + @SerializedName(SERIALIZED_NAME_H_CAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String hCaptchaResponse; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nonnull + private String username; + + public static final String SERIALIZED_NAME_PASSWORD = "password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nonnull + private String password; + + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "securityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private String securityAnswer; + + public LoginByUsernameRequest() { + } + + public LoginByUsernameRequest gRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + return this; + } + + /** + * The Google reCAPTCHA response which is sent to the server for verification. + * @return gRecaptchaResponse + */ + @javax.annotation.Nullable + public String getgRecaptchaResponse() { + return gRecaptchaResponse; + } + + public void setgRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + } + + + public LoginByUsernameRequest qqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + return this; + } + + /** + * The QQ Captcha ticket which is sent to the server for verification. + * @return qqCaptchaTicket + */ + @javax.annotation.Nullable + public String getQqCaptchaTicket() { + return qqCaptchaTicket; + } + + public void setQqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + } + + + public LoginByUsernameRequest qqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + return this; + } + + /** + * The QQ Captcha random string which is sent to the server for verification. + * @return qqCaptchaRandstr + */ + @javax.annotation.Nullable + public String getQqCaptchaRandstr() { + return qqCaptchaRandstr; + } + + public void setQqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + } + + + public LoginByUsernameRequest hCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + return this; + } + + /** + * The hCaptcha response which is sent to the server for verification. + * @return hCaptchaResponse + */ + @javax.annotation.Nullable + public String gethCaptchaResponse() { + return hCaptchaResponse; + } + + public void sethCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + } + + + public LoginByUsernameRequest username(@javax.annotation.Nonnull String username) { + this.username = username; + return this; + } + + /** + * The Username of the User + * @return username + */ + @javax.annotation.Nonnull + public String getUsername() { + return username; + } + + public void setUsername(@javax.annotation.Nonnull String username) { + this.username = username; + } + + + public LoginByUsernameRequest password(@javax.annotation.Nonnull String password) { + this.password = password; + return this; + } + + /** + * The Password of the User + * @return password + */ + @javax.annotation.Nonnull + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nonnull String password) { + this.password = password; + } + + + public LoginByUsernameRequest securityAnswer(@javax.annotation.Nullable String securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + /** + * The security answer which is set for the User, this will be used when the User is blocked for the security question. + * @return securityAnswer + */ + @javax.annotation.Nullable + public String getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable String securityAnswer) { + this.securityAnswer = securityAnswer; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the LoginByUsernameRequest instance itself + */ + public LoginByUsernameRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoginByUsernameRequest loginByUsernameRequest = (LoginByUsernameRequest) o; + return Objects.equals(this.gRecaptchaResponse, loginByUsernameRequest.gRecaptchaResponse) && + Objects.equals(this.qqCaptchaTicket, loginByUsernameRequest.qqCaptchaTicket) && + Objects.equals(this.qqCaptchaRandstr, loginByUsernameRequest.qqCaptchaRandstr) && + Objects.equals(this.hCaptchaResponse, loginByUsernameRequest.hCaptchaResponse) && + Objects.equals(this.username, loginByUsernameRequest.username) && + Objects.equals(this.password, loginByUsernameRequest.password) && + Objects.equals(this.securityAnswer, loginByUsernameRequest.securityAnswer)&& + Objects.equals(this.additionalProperties, loginByUsernameRequest.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, username, password, securityAnswer, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LoginByUsernameRequest {\n"); + sb.append(" gRecaptchaResponse: ").append(toIndentedString(gRecaptchaResponse)).append("\n"); + sb.append(" qqCaptchaTicket: ").append(toIndentedString(qqCaptchaTicket)).append("\n"); + sb.append(" qqCaptchaRandstr: ").append(toIndentedString(qqCaptchaRandstr)).append("\n"); + sb.append(" hCaptchaResponse: ").append(toIndentedString(hCaptchaResponse)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" password: ").append("*").append("\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("g-recaptcha-response"); + openapiFields.add("qq_captcha_ticket"); + openapiFields.add("qq_captcha_randstr"); + openapiFields.add("h-captcha-response"); + openapiFields.add("username"); + openapiFields.add("password"); + openapiFields.add("securityAnswer"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("username"); + openapiRequiredFields.add("password"); + } + + /** + * 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 LoginByUsernameRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!LoginByUsernameRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in LoginByUsernameRequest is not found in the empty JSON string", LoginByUsernameRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : LoginByUsernameRequest.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("g-recaptcha-response") != null && !jsonObj.get("g-recaptcha-response").isJsonNull()) && !jsonObj.get("g-recaptcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `g-recaptcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("g-recaptcha-response").toString())); + } + if ((jsonObj.get("qq_captcha_ticket") != null && !jsonObj.get("qq_captcha_ticket").isJsonNull()) && !jsonObj.get("qq_captcha_ticket").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_ticket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_ticket").toString())); + } + if ((jsonObj.get("qq_captcha_randstr") != null && !jsonObj.get("qq_captcha_randstr").isJsonNull()) && !jsonObj.get("qq_captcha_randstr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_randstr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_randstr").toString())); + } + if ((jsonObj.get("h-captcha-response") != null && !jsonObj.get("h-captcha-response").isJsonNull()) && !jsonObj.get("h-captcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `h-captcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("h-captcha-response").toString())); + } + if (!jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + if (!jsonObj.get("password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); + } + if ((jsonObj.get("securityAnswer") != null && !jsonObj.get("securityAnswer").isJsonNull()) && !jsonObj.get("securityAnswer").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `securityAnswer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("securityAnswer").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!LoginByUsernameRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'LoginByUsernameRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<LoginByUsernameRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(LoginByUsernameRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<LoginByUsernameRequest>() { + @Override + public void write(JsonWriter out, LoginByUsernameRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public LoginByUsernameRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + LoginByUsernameRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of LoginByUsernameRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of LoginByUsernameRequest + * @throws IOException if the JSON string is invalid with respect to LoginByUsernameRequest + */ + public static LoginByUsernameRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, LoginByUsernameRequest.class); + } + + /** + * Convert an instance of LoginByUsernameRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/LoginByUsernameRequestCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/LoginByUsernameRequestCore.java new file mode 100644 index 0000000..f37c6a5 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/LoginByUsernameRequestCore.java @@ -0,0 +1,356 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * LoginByUsernameRequestCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class LoginByUsernameRequestCore { + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nonnull + private String username; + + public static final String SERIALIZED_NAME_PASSWORD = "password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nonnull + private String password; + + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "securityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private String securityAnswer; + + public LoginByUsernameRequestCore() { + } + + public LoginByUsernameRequestCore username(@javax.annotation.Nonnull String username) { + this.username = username; + return this; + } + + /** + * The Username of the User + * @return username + */ + @javax.annotation.Nonnull + public String getUsername() { + return username; + } + + public void setUsername(@javax.annotation.Nonnull String username) { + this.username = username; + } + + + public LoginByUsernameRequestCore password(@javax.annotation.Nonnull String password) { + this.password = password; + return this; + } + + /** + * The Password of the User + * @return password + */ + @javax.annotation.Nonnull + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nonnull String password) { + this.password = password; + } + + + public LoginByUsernameRequestCore securityAnswer(@javax.annotation.Nullable String securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + /** + * The security answer which is set for the User, this will be used when the User is blocked for the security question. + * @return securityAnswer + */ + @javax.annotation.Nullable + public String getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable String securityAnswer) { + this.securityAnswer = securityAnswer; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the LoginByUsernameRequestCore instance itself + */ + public LoginByUsernameRequestCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LoginByUsernameRequestCore loginByUsernameRequestCore = (LoginByUsernameRequestCore) o; + return Objects.equals(this.username, loginByUsernameRequestCore.username) && + Objects.equals(this.password, loginByUsernameRequestCore.password) && + Objects.equals(this.securityAnswer, loginByUsernameRequestCore.securityAnswer)&& + Objects.equals(this.additionalProperties, loginByUsernameRequestCore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(username, password, securityAnswer, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LoginByUsernameRequestCore {\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" password: ").append("*").append("\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("username"); + openapiFields.add("password"); + openapiFields.add("securityAnswer"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("username"); + openapiRequiredFields.add("password"); + } + + /** + * 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 LoginByUsernameRequestCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!LoginByUsernameRequestCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in LoginByUsernameRequestCore is not found in the empty JSON string", LoginByUsernameRequestCore.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : LoginByUsernameRequestCore.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("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + if (!jsonObj.get("password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); + } + if ((jsonObj.get("securityAnswer") != null && !jsonObj.get("securityAnswer").isJsonNull()) && !jsonObj.get("securityAnswer").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `securityAnswer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("securityAnswer").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!LoginByUsernameRequestCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'LoginByUsernameRequestCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<LoginByUsernameRequestCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(LoginByUsernameRequestCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<LoginByUsernameRequestCore>() { + @Override + public void write(JsonWriter out, LoginByUsernameRequestCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public LoginByUsernameRequestCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + LoginByUsernameRequestCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of LoginByUsernameRequestCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of LoginByUsernameRequestCore + * @throws IOException if the JSON string is invalid with respect to LoginByUsernameRequestCore + */ + public static LoginByUsernameRequestCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, LoginByUsernameRequestCore.class); + } + + /** + * Convert an instance of LoginByUsernameRequestCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/MFABackUpCodeResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/MFABackUpCodeResponse.java new file mode 100644 index 0000000..50b3b24 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/MFABackUpCodeResponse.java @@ -0,0 +1,308 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.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.loginradius.sdk.internal.openapi.JSON; + +/** + * MFABackUpCodeResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class MFABackUpCodeResponse { + public static final String SERIALIZED_NAME_BACK_UP_CODES = "BackUpCodes"; + @SerializedName(SERIALIZED_NAME_BACK_UP_CODES) + @javax.annotation.Nonnull + private List<String> backUpCodes = new ArrayList<>(); + + public MFABackUpCodeResponse() { + } + + public MFABackUpCodeResponse backUpCodes(@javax.annotation.Nonnull List<String> backUpCodes) { + this.backUpCodes = backUpCodes; + return this; + } + + public MFABackUpCodeResponse addBackUpCodesItem(String backUpCodesItem) { + if (this.backUpCodes == null) { + this.backUpCodes = new ArrayList<>(); + } + this.backUpCodes.add(backUpCodesItem); + return this; + } + + /** + * List of Backup Codes generated for MFA + * @return backUpCodes + */ + @javax.annotation.Nonnull + public List<String> getBackUpCodes() { + return backUpCodes; + } + + public void setBackUpCodes(@javax.annotation.Nonnull List<String> backUpCodes) { + this.backUpCodes = backUpCodes; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the MFABackUpCodeResponse instance itself + */ + public MFABackUpCodeResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MFABackUpCodeResponse mfABackUpCodeResponse = (MFABackUpCodeResponse) o; + return Objects.equals(this.backUpCodes, mfABackUpCodeResponse.backUpCodes)&& + Objects.equals(this.additionalProperties, mfABackUpCodeResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(backUpCodes, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MFABackUpCodeResponse {\n"); + sb.append(" backUpCodes: ").append(toIndentedString(backUpCodes)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("BackUpCodes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("BackUpCodes"); + } + + /** + * 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 MFABackUpCodeResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MFABackUpCodeResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in MFABackUpCodeResponse is not found in the empty JSON string", MFABackUpCodeResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : MFABackUpCodeResponse.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 required json array is present + if (jsonObj.get("BackUpCodes") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("BackUpCodes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `BackUpCodes` to be an array in the JSON string but got `%s`", jsonObj.get("BackUpCodes").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!MFABackUpCodeResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MFABackUpCodeResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<MFABackUpCodeResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MFABackUpCodeResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<MFABackUpCodeResponse>() { + @Override + public void write(JsonWriter out, MFABackUpCodeResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public MFABackUpCodeResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + MFABackUpCodeResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MFABackUpCodeResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of MFABackUpCodeResponse + * @throws IOException if the JSON string is invalid with respect to MFABackUpCodeResponse + */ + public static MFABackUpCodeResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MFABackUpCodeResponse.class); + } + + /** + * Convert an instance of MFABackUpCodeResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/MFAPhoneUpdateModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/MFAPhoneUpdateModel.java new file mode 100644 index 0000000..d8bbf4b --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/MFAPhoneUpdateModel.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * MFAPhoneUpdateModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class MFAPhoneUpdateModel { + public static final String SERIALIZED_NAME_PHONENO2FA = "phoneno2fa"; + @SerializedName(SERIALIZED_NAME_PHONENO2FA) + @javax.annotation.Nonnull + private String phoneno2fa; + + public MFAPhoneUpdateModel() { + } + + public MFAPhoneUpdateModel phoneno2fa(@javax.annotation.Nonnull String phoneno2fa) { + this.phoneno2fa = phoneno2fa; + return this; + } + + /** + * The Phone number of the User. + * @return phoneno2fa + */ + @javax.annotation.Nonnull + public String getPhoneno2fa() { + return phoneno2fa; + } + + public void setPhoneno2fa(@javax.annotation.Nonnull String phoneno2fa) { + this.phoneno2fa = phoneno2fa; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the MFAPhoneUpdateModel instance itself + */ + public MFAPhoneUpdateModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MFAPhoneUpdateModel mfAPhoneUpdateModel = (MFAPhoneUpdateModel) o; + return Objects.equals(this.phoneno2fa, mfAPhoneUpdateModel.phoneno2fa)&& + Objects.equals(this.additionalProperties, mfAPhoneUpdateModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(phoneno2fa, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MFAPhoneUpdateModel {\n"); + sb.append(" phoneno2fa: ").append(toIndentedString(phoneno2fa)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("phoneno2fa"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("phoneno2fa"); + } + + /** + * 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 MFAPhoneUpdateModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MFAPhoneUpdateModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in MFAPhoneUpdateModel is not found in the empty JSON string", MFAPhoneUpdateModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : MFAPhoneUpdateModel.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("phoneno2fa").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phoneno2fa` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phoneno2fa").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!MFAPhoneUpdateModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MFAPhoneUpdateModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<MFAPhoneUpdateModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MFAPhoneUpdateModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<MFAPhoneUpdateModel>() { + @Override + public void write(JsonWriter out, MFAPhoneUpdateModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public MFAPhoneUpdateModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + MFAPhoneUpdateModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MFAPhoneUpdateModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of MFAPhoneUpdateModel + * @throws IOException if the JSON string is invalid with respect to MFAPhoneUpdateModel + */ + public static MFAPhoneUpdateModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MFAPhoneUpdateModel.class); + } + + /** + * Convert an instance of MFAPhoneUpdateModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/MFASettings.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/MFASettings.java new file mode 100644 index 0000000..299d878 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/MFASettings.java @@ -0,0 +1,527 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * MFASettings + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class MFASettings { + public static final String SERIALIZED_NAME_IS_SECOND_FACTOR_AUTHENTICATOR_ENABLED = "IsSecondFactorAuthenticatorEnabled"; + @SerializedName(SERIALIZED_NAME_IS_SECOND_FACTOR_AUTHENTICATOR_ENABLED) + @javax.annotation.Nullable + private Boolean isSecondFactorAuthenticatorEnabled; + + public static final String SERIALIZED_NAME_IS_REQUIRED = "IsRequired"; + @SerializedName(SERIALIZED_NAME_IS_REQUIRED) + @javax.annotation.Nullable + private Boolean isRequired; + + public static final String SERIALIZED_NAME_IS_AUTHENTICATOR_ENABLED = "IsAuthenticatorEnabled"; + @SerializedName(SERIALIZED_NAME_IS_AUTHENTICATOR_ENABLED) + @javax.annotation.Nullable + private Boolean isAuthenticatorEnabled; + + public static final String SERIALIZED_NAME_IS_EMAIL_OTP_AUTHENTICATOR_ENABLED = "IsEmailOtpAuthenticatorEnabled"; + @SerializedName(SERIALIZED_NAME_IS_EMAIL_OTP_AUTHENTICATOR_ENABLED) + @javax.annotation.Nullable + private Boolean isEmailOtpAuthenticatorEnabled; + + public static final String SERIALIZED_NAME_IS_SMS_OTP_AUTHENTICATOR_ENABLED = "IsSmsOtpAuthenticatorEnabled"; + @SerializedName(SERIALIZED_NAME_IS_SMS_OTP_AUTHENTICATOR_ENABLED) + @javax.annotation.Nullable + private Boolean isSmsOtpAuthenticatorEnabled; + + public static final String SERIALIZED_NAME_IS_SECURITY_QUESTION_AS_M_F_A_ENABLED = "IsSecurityQuestionAsMFAEnabled"; + @SerializedName(SERIALIZED_NAME_IS_SECURITY_QUESTION_AS_M_F_A_ENABLED) + @javax.annotation.Nullable + private Boolean isSecurityQuestionAsMFAEnabled; + + public static final String SERIALIZED_NAME_MINIMUM_SECURITY_QUESTIONS_TO_ASK = "MinimumSecurityQuestionsToAsk"; + @SerializedName(SERIALIZED_NAME_MINIMUM_SECURITY_QUESTIONS_TO_ASK) + @javax.annotation.Nullable + private Integer minimumSecurityQuestionsToAsk; + + public static final String SERIALIZED_NAME_IS_PUSH_AUTHENTICATOR_ENABLED = "IsPushAuthenticatorEnabled"; + @SerializedName(SERIALIZED_NAME_IS_PUSH_AUTHENTICATOR_ENABLED) + @javax.annotation.Nullable + private Boolean isPushAuthenticatorEnabled; + + public static final String SERIALIZED_NAME_IS_DUO_AUTHENTICATOR_ENABLED = "IsDuoAuthenticatorEnabled"; + @SerializedName(SERIALIZED_NAME_IS_DUO_AUTHENTICATOR_ENABLED) + @javax.annotation.Nullable + private Boolean isDuoAuthenticatorEnabled; + + public static final String SERIALIZED_NAME_IS_PASSKEY_M_F_A_ENABLED = "IsPasskeyMFAEnabled"; + @SerializedName(SERIALIZED_NAME_IS_PASSKEY_M_F_A_ENABLED) + @javax.annotation.Nullable + private Boolean isPasskeyMFAEnabled; + + public MFASettings() { + } + + public MFASettings isSecondFactorAuthenticatorEnabled(@javax.annotation.Nullable Boolean isSecondFactorAuthenticatorEnabled) { + this.isSecondFactorAuthenticatorEnabled = isSecondFactorAuthenticatorEnabled; + return this; + } + + /** + * Indicates if the second factor authenticator is enabled + * @return isSecondFactorAuthenticatorEnabled + */ + @javax.annotation.Nullable + public Boolean getIsSecondFactorAuthenticatorEnabled() { + return isSecondFactorAuthenticatorEnabled; + } + + public void setIsSecondFactorAuthenticatorEnabled(@javax.annotation.Nullable Boolean isSecondFactorAuthenticatorEnabled) { + this.isSecondFactorAuthenticatorEnabled = isSecondFactorAuthenticatorEnabled; + } + + + public MFASettings isRequired(@javax.annotation.Nullable Boolean isRequired) { + this.isRequired = isRequired; + return this; + } + + /** + * Indicates if MFA is required + * @return isRequired + */ + @javax.annotation.Nullable + public Boolean getIsRequired() { + return isRequired; + } + + public void setIsRequired(@javax.annotation.Nullable Boolean isRequired) { + this.isRequired = isRequired; + } + + + public MFASettings isAuthenticatorEnabled(@javax.annotation.Nullable Boolean isAuthenticatorEnabled) { + this.isAuthenticatorEnabled = isAuthenticatorEnabled; + return this; + } + + /** + * Indicates if TOTP Authenticator is enabled + * @return isAuthenticatorEnabled + */ + @javax.annotation.Nullable + public Boolean getIsAuthenticatorEnabled() { + return isAuthenticatorEnabled; + } + + public void setIsAuthenticatorEnabled(@javax.annotation.Nullable Boolean isAuthenticatorEnabled) { + this.isAuthenticatorEnabled = isAuthenticatorEnabled; + } + + + public MFASettings isEmailOtpAuthenticatorEnabled(@javax.annotation.Nullable Boolean isEmailOtpAuthenticatorEnabled) { + this.isEmailOtpAuthenticatorEnabled = isEmailOtpAuthenticatorEnabled; + return this; + } + + /** + * Indicates if Email OTP Authenticator is enabled + * @return isEmailOtpAuthenticatorEnabled + */ + @javax.annotation.Nullable + public Boolean getIsEmailOtpAuthenticatorEnabled() { + return isEmailOtpAuthenticatorEnabled; + } + + public void setIsEmailOtpAuthenticatorEnabled(@javax.annotation.Nullable Boolean isEmailOtpAuthenticatorEnabled) { + this.isEmailOtpAuthenticatorEnabled = isEmailOtpAuthenticatorEnabled; + } + + + public MFASettings isSmsOtpAuthenticatorEnabled(@javax.annotation.Nullable Boolean isSmsOtpAuthenticatorEnabled) { + this.isSmsOtpAuthenticatorEnabled = isSmsOtpAuthenticatorEnabled; + return this; + } + + /** + * Indicates if SMS OTP Authenticator is enabled + * @return isSmsOtpAuthenticatorEnabled + */ + @javax.annotation.Nullable + public Boolean getIsSmsOtpAuthenticatorEnabled() { + return isSmsOtpAuthenticatorEnabled; + } + + public void setIsSmsOtpAuthenticatorEnabled(@javax.annotation.Nullable Boolean isSmsOtpAuthenticatorEnabled) { + this.isSmsOtpAuthenticatorEnabled = isSmsOtpAuthenticatorEnabled; + } + + + public MFASettings isSecurityQuestionAsMFAEnabled(@javax.annotation.Nullable Boolean isSecurityQuestionAsMFAEnabled) { + this.isSecurityQuestionAsMFAEnabled = isSecurityQuestionAsMFAEnabled; + return this; + } + + /** + * Indicates if Security Question as MFA is enabled + * @return isSecurityQuestionAsMFAEnabled + */ + @javax.annotation.Nullable + public Boolean getIsSecurityQuestionAsMFAEnabled() { + return isSecurityQuestionAsMFAEnabled; + } + + public void setIsSecurityQuestionAsMFAEnabled(@javax.annotation.Nullable Boolean isSecurityQuestionAsMFAEnabled) { + this.isSecurityQuestionAsMFAEnabled = isSecurityQuestionAsMFAEnabled; + } + + + public MFASettings minimumSecurityQuestionsToAsk(@javax.annotation.Nullable Integer minimumSecurityQuestionsToAsk) { + this.minimumSecurityQuestionsToAsk = minimumSecurityQuestionsToAsk; + return this; + } + + /** + * Minimum number of security questions to ask + * @return minimumSecurityQuestionsToAsk + */ + @javax.annotation.Nullable + public Integer getMinimumSecurityQuestionsToAsk() { + return minimumSecurityQuestionsToAsk; + } + + public void setMinimumSecurityQuestionsToAsk(@javax.annotation.Nullable Integer minimumSecurityQuestionsToAsk) { + this.minimumSecurityQuestionsToAsk = minimumSecurityQuestionsToAsk; + } + + + public MFASettings isPushAuthenticatorEnabled(@javax.annotation.Nullable Boolean isPushAuthenticatorEnabled) { + this.isPushAuthenticatorEnabled = isPushAuthenticatorEnabled; + return this; + } + + /** + * Indicates if Push Authenticator is enabled + * @return isPushAuthenticatorEnabled + */ + @javax.annotation.Nullable + public Boolean getIsPushAuthenticatorEnabled() { + return isPushAuthenticatorEnabled; + } + + public void setIsPushAuthenticatorEnabled(@javax.annotation.Nullable Boolean isPushAuthenticatorEnabled) { + this.isPushAuthenticatorEnabled = isPushAuthenticatorEnabled; + } + + + public MFASettings isDuoAuthenticatorEnabled(@javax.annotation.Nullable Boolean isDuoAuthenticatorEnabled) { + this.isDuoAuthenticatorEnabled = isDuoAuthenticatorEnabled; + return this; + } + + /** + * Indicates if Duo Authenticator is enabled + * @return isDuoAuthenticatorEnabled + */ + @javax.annotation.Nullable + public Boolean getIsDuoAuthenticatorEnabled() { + return isDuoAuthenticatorEnabled; + } + + public void setIsDuoAuthenticatorEnabled(@javax.annotation.Nullable Boolean isDuoAuthenticatorEnabled) { + this.isDuoAuthenticatorEnabled = isDuoAuthenticatorEnabled; + } + + + public MFASettings isPasskeyMFAEnabled(@javax.annotation.Nullable Boolean isPasskeyMFAEnabled) { + this.isPasskeyMFAEnabled = isPasskeyMFAEnabled; + return this; + } + + /** + * Indicates if Passkey MFA is enabled + * @return isPasskeyMFAEnabled + */ + @javax.annotation.Nullable + public Boolean getIsPasskeyMFAEnabled() { + return isPasskeyMFAEnabled; + } + + public void setIsPasskeyMFAEnabled(@javax.annotation.Nullable Boolean isPasskeyMFAEnabled) { + this.isPasskeyMFAEnabled = isPasskeyMFAEnabled; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the MFASettings instance itself + */ + public MFASettings putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MFASettings mfASettings = (MFASettings) o; + return Objects.equals(this.isSecondFactorAuthenticatorEnabled, mfASettings.isSecondFactorAuthenticatorEnabled) && + Objects.equals(this.isRequired, mfASettings.isRequired) && + Objects.equals(this.isAuthenticatorEnabled, mfASettings.isAuthenticatorEnabled) && + Objects.equals(this.isEmailOtpAuthenticatorEnabled, mfASettings.isEmailOtpAuthenticatorEnabled) && + Objects.equals(this.isSmsOtpAuthenticatorEnabled, mfASettings.isSmsOtpAuthenticatorEnabled) && + Objects.equals(this.isSecurityQuestionAsMFAEnabled, mfASettings.isSecurityQuestionAsMFAEnabled) && + Objects.equals(this.minimumSecurityQuestionsToAsk, mfASettings.minimumSecurityQuestionsToAsk) && + Objects.equals(this.isPushAuthenticatorEnabled, mfASettings.isPushAuthenticatorEnabled) && + Objects.equals(this.isDuoAuthenticatorEnabled, mfASettings.isDuoAuthenticatorEnabled) && + Objects.equals(this.isPasskeyMFAEnabled, mfASettings.isPasskeyMFAEnabled)&& + Objects.equals(this.additionalProperties, mfASettings.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isSecondFactorAuthenticatorEnabled, isRequired, isAuthenticatorEnabled, isEmailOtpAuthenticatorEnabled, isSmsOtpAuthenticatorEnabled, isSecurityQuestionAsMFAEnabled, minimumSecurityQuestionsToAsk, isPushAuthenticatorEnabled, isDuoAuthenticatorEnabled, isPasskeyMFAEnabled, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MFASettings {\n"); + sb.append(" isSecondFactorAuthenticatorEnabled: ").append(toIndentedString(isSecondFactorAuthenticatorEnabled)).append("\n"); + sb.append(" isRequired: ").append(toIndentedString(isRequired)).append("\n"); + sb.append(" isAuthenticatorEnabled: ").append(toIndentedString(isAuthenticatorEnabled)).append("\n"); + sb.append(" isEmailOtpAuthenticatorEnabled: ").append(toIndentedString(isEmailOtpAuthenticatorEnabled)).append("\n"); + sb.append(" isSmsOtpAuthenticatorEnabled: ").append(toIndentedString(isSmsOtpAuthenticatorEnabled)).append("\n"); + sb.append(" isSecurityQuestionAsMFAEnabled: ").append(toIndentedString(isSecurityQuestionAsMFAEnabled)).append("\n"); + sb.append(" minimumSecurityQuestionsToAsk: ").append(toIndentedString(minimumSecurityQuestionsToAsk)).append("\n"); + sb.append(" isPushAuthenticatorEnabled: ").append(toIndentedString(isPushAuthenticatorEnabled)).append("\n"); + sb.append(" isDuoAuthenticatorEnabled: ").append(toIndentedString(isDuoAuthenticatorEnabled)).append("\n"); + sb.append(" isPasskeyMFAEnabled: ").append(toIndentedString(isPasskeyMFAEnabled)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsSecondFactorAuthenticatorEnabled"); + openapiFields.add("IsRequired"); + openapiFields.add("IsAuthenticatorEnabled"); + openapiFields.add("IsEmailOtpAuthenticatorEnabled"); + openapiFields.add("IsSmsOtpAuthenticatorEnabled"); + openapiFields.add("IsSecurityQuestionAsMFAEnabled"); + openapiFields.add("MinimumSecurityQuestionsToAsk"); + openapiFields.add("IsPushAuthenticatorEnabled"); + openapiFields.add("IsDuoAuthenticatorEnabled"); + openapiFields.add("IsPasskeyMFAEnabled"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 MFASettings + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MFASettings.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in MFASettings is not found in the empty JSON string", MFASettings.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!MFASettings.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MFASettings' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<MFASettings> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MFASettings.class)); + + return (TypeAdapter<T>) new TypeAdapter<MFASettings>() { + @Override + public void write(JsonWriter out, MFASettings value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public MFASettings read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + MFASettings instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MFASettings given an JSON string + * + * @param jsonString JSON string + * @return An instance of MFASettings + * @throws IOException if the JSON string is invalid with respect to MFASettings + */ + public static MFASettings fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MFASettings.class); + } + + /** + * Convert an instance of MFASettings to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/MFAVerifyPhoneOtpModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/MFAVerifyPhoneOtpModel.java new file mode 100644 index 0000000..890e735 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/MFAVerifyPhoneOtpModel.java @@ -0,0 +1,464 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * MFAVerifyPhoneOtpModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class MFAVerifyPhoneOtpModel { + public static final String SERIALIZED_NAME_G_RECAPTCHA_RESPONSE = "g-recaptcha-response"; + @SerializedName(SERIALIZED_NAME_G_RECAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String gRecaptchaResponse; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_TICKET = "qq_captcha_ticket"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_TICKET) + @javax.annotation.Nullable + private String qqCaptchaTicket; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR = "qq_captcha_randstr"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR) + @javax.annotation.Nullable + private String qqCaptchaRandstr; + + public static final String SERIALIZED_NAME_H_CAPTCHA_RESPONSE = "h-captcha-response"; + @SerializedName(SERIALIZED_NAME_H_CAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String hCaptchaResponse; + + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer = new HashMap<>(); + + public static final String SERIALIZED_NAME_OTP = "otp"; + @SerializedName(SERIALIZED_NAME_OTP) + @javax.annotation.Nonnull + private String otp; + + public MFAVerifyPhoneOtpModel() { + } + + public MFAVerifyPhoneOtpModel gRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + return this; + } + + /** + * The Google reCAPTCHA response which is sent to the server for verification. + * @return gRecaptchaResponse + */ + @javax.annotation.Nullable + public String getgRecaptchaResponse() { + return gRecaptchaResponse; + } + + public void setgRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + } + + + public MFAVerifyPhoneOtpModel qqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + return this; + } + + /** + * The QQ Captcha ticket which is sent to the server for verification. + * @return qqCaptchaTicket + */ + @javax.annotation.Nullable + public String getQqCaptchaTicket() { + return qqCaptchaTicket; + } + + public void setQqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + } + + + public MFAVerifyPhoneOtpModel qqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + return this; + } + + /** + * The QQ Captcha random string which is sent to the server for verification. + * @return qqCaptchaRandstr + */ + @javax.annotation.Nullable + public String getQqCaptchaRandstr() { + return qqCaptchaRandstr; + } + + public void setQqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + } + + + public MFAVerifyPhoneOtpModel hCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + return this; + } + + /** + * The hCaptcha response which is sent to the server for verification. + * @return hCaptchaResponse + */ + @javax.annotation.Nullable + public String gethCaptchaResponse() { + return hCaptchaResponse; + } + + public void sethCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + } + + + public MFAVerifyPhoneOtpModel securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public MFAVerifyPhoneOtpModel putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * Get securityAnswer + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + + public MFAVerifyPhoneOtpModel otp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + return this; + } + + /** + * The one-time Password (OTP). + * @return otp + */ + @javax.annotation.Nonnull + public String getOtp() { + return otp; + } + + public void setOtp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the MFAVerifyPhoneOtpModel instance itself + */ + public MFAVerifyPhoneOtpModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MFAVerifyPhoneOtpModel mfAVerifyPhoneOtpModel = (MFAVerifyPhoneOtpModel) o; + return Objects.equals(this.gRecaptchaResponse, mfAVerifyPhoneOtpModel.gRecaptchaResponse) && + Objects.equals(this.qqCaptchaTicket, mfAVerifyPhoneOtpModel.qqCaptchaTicket) && + Objects.equals(this.qqCaptchaRandstr, mfAVerifyPhoneOtpModel.qqCaptchaRandstr) && + Objects.equals(this.hCaptchaResponse, mfAVerifyPhoneOtpModel.hCaptchaResponse) && + Objects.equals(this.securityAnswer, mfAVerifyPhoneOtpModel.securityAnswer) && + Objects.equals(this.otp, mfAVerifyPhoneOtpModel.otp)&& + Objects.equals(this.additionalProperties, mfAVerifyPhoneOtpModel.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, securityAnswer, otp, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MFAVerifyPhoneOtpModel {\n"); + sb.append(" gRecaptchaResponse: ").append(toIndentedString(gRecaptchaResponse)).append("\n"); + sb.append(" qqCaptchaTicket: ").append(toIndentedString(qqCaptchaTicket)).append("\n"); + sb.append(" qqCaptchaRandstr: ").append(toIndentedString(qqCaptchaRandstr)).append("\n"); + sb.append(" hCaptchaResponse: ").append(toIndentedString(hCaptchaResponse)).append("\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" otp: ").append(toIndentedString(otp)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("g-recaptcha-response"); + openapiFields.add("qq_captcha_ticket"); + openapiFields.add("qq_captcha_randstr"); + openapiFields.add("h-captcha-response"); + openapiFields.add("SecurityAnswer"); + openapiFields.add("otp"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("otp"); + } + + /** + * 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 MFAVerifyPhoneOtpModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MFAVerifyPhoneOtpModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in MFAVerifyPhoneOtpModel is not found in the empty JSON string", MFAVerifyPhoneOtpModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : MFAVerifyPhoneOtpModel.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("g-recaptcha-response") != null && !jsonObj.get("g-recaptcha-response").isJsonNull()) && !jsonObj.get("g-recaptcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `g-recaptcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("g-recaptcha-response").toString())); + } + if ((jsonObj.get("qq_captcha_ticket") != null && !jsonObj.get("qq_captcha_ticket").isJsonNull()) && !jsonObj.get("qq_captcha_ticket").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_ticket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_ticket").toString())); + } + if ((jsonObj.get("qq_captcha_randstr") != null && !jsonObj.get("qq_captcha_randstr").isJsonNull()) && !jsonObj.get("qq_captcha_randstr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_randstr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_randstr").toString())); + } + if ((jsonObj.get("h-captcha-response") != null && !jsonObj.get("h-captcha-response").isJsonNull()) && !jsonObj.get("h-captcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `h-captcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("h-captcha-response").toString())); + } + if (!jsonObj.get("otp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `otp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("otp").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!MFAVerifyPhoneOtpModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MFAVerifyPhoneOtpModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<MFAVerifyPhoneOtpModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MFAVerifyPhoneOtpModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<MFAVerifyPhoneOtpModel>() { + @Override + public void write(JsonWriter out, MFAVerifyPhoneOtpModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public MFAVerifyPhoneOtpModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + MFAVerifyPhoneOtpModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MFAVerifyPhoneOtpModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of MFAVerifyPhoneOtpModel + * @throws IOException if the JSON string is invalid with respect to MFAVerifyPhoneOtpModel + */ + public static MFAVerifyPhoneOtpModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MFAVerifyPhoneOtpModel.class); + } + + /** + * Convert an instance of MFAVerifyPhoneOtpModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/MFAVerifyPhoneOtpModelCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/MFAVerifyPhoneOtpModelCore.java new file mode 100644 index 0000000..141f58d --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/MFAVerifyPhoneOtpModelCore.java @@ -0,0 +1,332 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * MFAVerifyPhoneOtpModelCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class MFAVerifyPhoneOtpModelCore { + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer = new HashMap<>(); + + public static final String SERIALIZED_NAME_OTP = "otp"; + @SerializedName(SERIALIZED_NAME_OTP) + @javax.annotation.Nonnull + private String otp; + + public MFAVerifyPhoneOtpModelCore() { + } + + public MFAVerifyPhoneOtpModelCore securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public MFAVerifyPhoneOtpModelCore putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * Get securityAnswer + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + + public MFAVerifyPhoneOtpModelCore otp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + return this; + } + + /** + * The one-time Password (OTP). + * @return otp + */ + @javax.annotation.Nonnull + public String getOtp() { + return otp; + } + + public void setOtp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the MFAVerifyPhoneOtpModelCore instance itself + */ + public MFAVerifyPhoneOtpModelCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MFAVerifyPhoneOtpModelCore mfAVerifyPhoneOtpModelCore = (MFAVerifyPhoneOtpModelCore) o; + return Objects.equals(this.securityAnswer, mfAVerifyPhoneOtpModelCore.securityAnswer) && + Objects.equals(this.otp, mfAVerifyPhoneOtpModelCore.otp)&& + Objects.equals(this.additionalProperties, mfAVerifyPhoneOtpModelCore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(securityAnswer, otp, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MFAVerifyPhoneOtpModelCore {\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" otp: ").append(toIndentedString(otp)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("SecurityAnswer"); + openapiFields.add("otp"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("otp"); + } + + /** + * 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 MFAVerifyPhoneOtpModelCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!MFAVerifyPhoneOtpModelCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in MFAVerifyPhoneOtpModelCore is not found in the empty JSON string", MFAVerifyPhoneOtpModelCore.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : MFAVerifyPhoneOtpModelCore.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("otp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `otp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("otp").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!MFAVerifyPhoneOtpModelCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MFAVerifyPhoneOtpModelCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<MFAVerifyPhoneOtpModelCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(MFAVerifyPhoneOtpModelCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<MFAVerifyPhoneOtpModelCore>() { + @Override + public void write(JsonWriter out, MFAVerifyPhoneOtpModelCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public MFAVerifyPhoneOtpModelCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + MFAVerifyPhoneOtpModelCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of MFAVerifyPhoneOtpModelCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of MFAVerifyPhoneOtpModelCore + * @throws IOException if the JSON string is invalid with respect to MFAVerifyPhoneOtpModelCore + */ + public static MFAVerifyPhoneOtpModelCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MFAVerifyPhoneOtpModelCore.class); + } + + /** + * Convert an instance of MFAVerifyPhoneOtpModelCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModel.java new file mode 100644 index 0000000..427ec1e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModel.java @@ -0,0 +1,4491 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ManageRegisterModelAddressesInner; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelAgeRange; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelBadgesInner; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelBooksInner; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelCertificationsInner; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelConsents; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelCountry; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelCoursesInner; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelEducationsInner; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelEmailInner; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelFamilyInner; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelFavoriteThingsInner; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelGamesInner; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelJobBookmarksInner; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelLanguagesInner; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelMemberUrlResourcesInner; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelMoviesInner; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelMutualFriendsInner; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelPINInfo; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelPatentsInner; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelPlacesLivedInner; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelPositionsInner; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelPrivacyPolicy; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelProjectsInner; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelProviderAccessCredential; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelPublicationsInner; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelRecommendationsReceivedInner; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelRelatedProfileViewsInner; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelSubscription; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelSuggestions; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelTelevisionShowInner; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelVolunteerInner; +import com.loginradius.sdk.internal.openapi.model.ProfileAwardsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileCurrentStatusInner; +import com.loginradius.sdk.internal.openapi.model.ProfileExternalIdsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileIMAccountsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileInspirationalPeopleInner; +import com.loginradius.sdk.internal.openapi.model.ProfileInterestsInner; +import com.loginradius.sdk.internal.openapi.model.ProfilePhoneNumbersInner; +import com.loginradius.sdk.internal.openapi.model.ProfileSkillsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileSportsInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModel { + public static final String SERIALIZED_NAME_UID = "Uid"; + @SerializedName(SERIALIZED_NAME_UID) + @javax.annotation.Nullable + private String uid; + + public static final String SERIALIZED_NAME_USER_NAME = "UserName"; + @SerializedName(SERIALIZED_NAME_USER_NAME) + @javax.annotation.Nullable + private String userName; + + public static final String SERIALIZED_NAME_PHONE_ID = "PhoneId"; + @SerializedName(SERIALIZED_NAME_PHONE_ID) + @javax.annotation.Nullable + private String phoneId; + + public static final String SERIALIZED_NAME_GENDER = "Gender"; + @SerializedName(SERIALIZED_NAME_GENDER) + @javax.annotation.Nullable + private String gender; + + public static final String SERIALIZED_NAME_BIRTH_DATE = "BirthDate"; + @SerializedName(SERIALIZED_NAME_BIRTH_DATE) + @javax.annotation.Nullable + private String birthDate; + + public static final String SERIALIZED_NAME_PREFIX = "Prefix"; + @SerializedName(SERIALIZED_NAME_PREFIX) + @javax.annotation.Nullable + private String prefix; + + public static final String SERIALIZED_NAME_FIRST_NAME = "FirstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nullable + private String firstName; + + public static final String SERIALIZED_NAME_MIDDLE_NAME = "MiddleName"; + @SerializedName(SERIALIZED_NAME_MIDDLE_NAME) + @javax.annotation.Nullable + private String middleName; + + public static final String SERIALIZED_NAME_LAST_NAME = "LastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nullable + private String lastName; + + public static final String SERIALIZED_NAME_SUFFIX = "Suffix"; + @SerializedName(SERIALIZED_NAME_SUFFIX) + @javax.annotation.Nullable + private String suffix; + + public static final String SERIALIZED_NAME_NICK_NAME = "NickName"; + @SerializedName(SERIALIZED_NAME_NICK_NAME) + @javax.annotation.Nullable + private String nickName; + + public static final String SERIALIZED_NAME_PROFILE_NAME = "ProfileName"; + @SerializedName(SERIALIZED_NAME_PROFILE_NAME) + @javax.annotation.Nullable + private String profileName; + + public static final String SERIALIZED_NAME_ABOUT = "About"; + @SerializedName(SERIALIZED_NAME_ABOUT) + @javax.annotation.Nullable + private String about; + + public static final String SERIALIZED_NAME_COMPANY = "Company"; + @SerializedName(SERIALIZED_NAME_COMPANY) + @javax.annotation.Nullable + private String company; + + public static final String SERIALIZED_NAME_IMAGE_URL = "ImageUrl"; + @SerializedName(SERIALIZED_NAME_IMAGE_URL) + @javax.annotation.Nullable + private String imageUrl; + + public static final String SERIALIZED_NAME_TIME_ZONE = "TimeZone"; + @SerializedName(SERIALIZED_NAME_TIME_ZONE) + @javax.annotation.Nullable + private String timeZone; + + public static final String SERIALIZED_NAME_WEBSITE = "Website"; + @SerializedName(SERIALIZED_NAME_WEBSITE) + @javax.annotation.Nullable + private String website; + + public static final String SERIALIZED_NAME_THUMBNAIL_IMAGE_URL = "ThumbnailImageUrl"; + @SerializedName(SERIALIZED_NAME_THUMBNAIL_IMAGE_URL) + @javax.annotation.Nullable + private String thumbnailImageUrl; + + public static final String SERIALIZED_NAME_FAVICON = "Favicon"; + @SerializedName(SERIALIZED_NAME_FAVICON) + @javax.annotation.Nullable + private String favicon; + + public static final String SERIALIZED_NAME_PROFILE_URL = "ProfileUrl"; + @SerializedName(SERIALIZED_NAME_PROFILE_URL) + @javax.annotation.Nullable + private String profileUrl; + + public static final String SERIALIZED_NAME_HOME_TOWN = "HomeTown"; + @SerializedName(SERIALIZED_NAME_HOME_TOWN) + @javax.annotation.Nullable + private String homeTown; + + public static final String SERIALIZED_NAME_STATE = "State"; + @SerializedName(SERIALIZED_NAME_STATE) + @javax.annotation.Nullable + private String state; + + public static final String SERIALIZED_NAME_CITY = "City"; + @SerializedName(SERIALIZED_NAME_CITY) + @javax.annotation.Nullable + private String city; + + public static final String SERIALIZED_NAME_INDUSTRY = "Industry"; + @SerializedName(SERIALIZED_NAME_INDUSTRY) + @javax.annotation.Nullable + private String industry; + + public static final String SERIALIZED_NAME_LOCAL_LANGUAGE = "LocalLanguage"; + @SerializedName(SERIALIZED_NAME_LOCAL_LANGUAGE) + @javax.annotation.Nullable + private String localLanguage; + + public static final String SERIALIZED_NAME_LANGUAGE = "Language"; + @SerializedName(SERIALIZED_NAME_LANGUAGE) + @javax.annotation.Nullable + private String language; + + public static final String SERIALIZED_NAME_COVER_PHOTO = "CoverPhoto"; + @SerializedName(SERIALIZED_NAME_COVER_PHOTO) + @javax.annotation.Nullable + private String coverPhoto; + + public static final String SERIALIZED_NAME_TAG_LINE = "TagLine"; + @SerializedName(SERIALIZED_NAME_TAG_LINE) + @javax.annotation.Nullable + private String tagLine; + + public static final String SERIALIZED_NAME_MAIN_ADDRESS = "MainAddress"; + @SerializedName(SERIALIZED_NAME_MAIN_ADDRESS) + @javax.annotation.Nullable + private String mainAddress; + + public static final String SERIALIZED_NAME_LOCAL_CITY = "LocalCity"; + @SerializedName(SERIALIZED_NAME_LOCAL_CITY) + @javax.annotation.Nullable + private String localCity; + + public static final String SERIALIZED_NAME_PROFILE_CITY = "ProfileCity"; + @SerializedName(SERIALIZED_NAME_PROFILE_CITY) + @javax.annotation.Nullable + private String profileCity; + + public static final String SERIALIZED_NAME_LOCAL_COUNTRY = "LocalCountry"; + @SerializedName(SERIALIZED_NAME_LOCAL_COUNTRY) + @javax.annotation.Nullable + private String localCountry; + + public static final String SERIALIZED_NAME_PROFILE_COUNTRY = "ProfileCountry"; + @SerializedName(SERIALIZED_NAME_PROFILE_COUNTRY) + @javax.annotation.Nullable + private String profileCountry; + + public static final String SERIALIZED_NAME_QUOTA = "Quota"; + @SerializedName(SERIALIZED_NAME_QUOTA) + @javax.annotation.Nullable + private String quota; + + public static final String SERIALIZED_NAME_RELIGION = "Religion"; + @SerializedName(SERIALIZED_NAME_RELIGION) + @javax.annotation.Nullable + private String religion; + + public static final String SERIALIZED_NAME_POLITICAL = "Political"; + @SerializedName(SERIALIZED_NAME_POLITICAL) + @javax.annotation.Nullable + private String political; + + public static final String SERIALIZED_NAME_RELATIONSHIP_STATUS = "RelationshipStatus"; + @SerializedName(SERIALIZED_NAME_RELATIONSHIP_STATUS) + @javax.annotation.Nullable + private String relationshipStatus; + + public static final String SERIALIZED_NAME_HTTPS_IMAGE_URL = "HttpsImageUrl"; + @SerializedName(SERIALIZED_NAME_HTTPS_IMAGE_URL) + @javax.annotation.Nullable + private String httpsImageUrl; + + public static final String SERIALIZED_NAME_IS_GEO_ENABLED = "IsGeoEnabled"; + @SerializedName(SERIALIZED_NAME_IS_GEO_ENABLED) + @javax.annotation.Nullable + private String isGeoEnabled; + + public static final String SERIALIZED_NAME_ASSOCIATIONS = "Associations"; + @SerializedName(SERIALIZED_NAME_ASSOCIATIONS) + @javax.annotation.Nullable + private String associations; + + public static final String SERIALIZED_NAME_HONORS = "Honors"; + @SerializedName(SERIALIZED_NAME_HONORS) + @javax.annotation.Nullable + private String honors; + + public static final String SERIALIZED_NAME_PUBLIC_REPOSITORY = "PublicRepository"; + @SerializedName(SERIALIZED_NAME_PUBLIC_REPOSITORY) + @javax.annotation.Nullable + private String publicRepository; + + public static final String SERIALIZED_NAME_REPOSITORY_URL = "RepositoryUrl"; + @SerializedName(SERIALIZED_NAME_REPOSITORY_URL) + @javax.annotation.Nullable + private String repositoryUrl; + + public static final String SERIALIZED_NAME_PROFESSIONAL_HEADLINE = "ProfessionalHeadline"; + @SerializedName(SERIALIZED_NAME_PROFESSIONAL_HEADLINE) + @javax.annotation.Nullable + private String professionalHeadline; + + public static final String SERIALIZED_NAME_CURRENCY = "Currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + @javax.annotation.Nullable + private String currency; + + public static final String SERIALIZED_NAME_STARRED_URL = "StarredUrl"; + @SerializedName(SERIALIZED_NAME_STARRED_URL) + @javax.annotation.Nullable + private String starredUrl; + + public static final String SERIALIZED_NAME_GISTS_URL = "GistsUrl"; + @SerializedName(SERIALIZED_NAME_GISTS_URL) + @javax.annotation.Nullable + private String gistsUrl; + + public static final String SERIALIZED_NAME_GRAVATAR_IMAGE_URL = "GravatarImageUrl"; + @SerializedName(SERIALIZED_NAME_GRAVATAR_IMAGE_URL) + @javax.annotation.Nullable + private String gravatarImageUrl; + + public static final String SERIALIZED_NAME_EXTERNAL_USER_LOGIN_ID = "ExternalUserLoginId"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_USER_LOGIN_ID) + @javax.annotation.Nullable + private String externalUserLoginId; + + public static final String SERIALIZED_NAME_INTERESTED_IN = "InterestedIn"; + @SerializedName(SERIALIZED_NAME_INTERESTED_IN) + @javax.annotation.Nullable + private List<String> interestedIn; + + public static final String SERIALIZED_NAME_FOLLOWERS_COUNT = "FollowersCount"; + @SerializedName(SERIALIZED_NAME_FOLLOWERS_COUNT) + @javax.annotation.Nullable + private Integer followersCount; + + public static final String SERIALIZED_NAME_FRIENDS_COUNT = "FriendsCount"; + @SerializedName(SERIALIZED_NAME_FRIENDS_COUNT) + @javax.annotation.Nullable + private Integer friendsCount; + + public static final String SERIALIZED_NAME_TOTAL_STATUSES_COUNT = "TotalStatusesCount"; + @SerializedName(SERIALIZED_NAME_TOTAL_STATUSES_COUNT) + @javax.annotation.Nullable + private Integer totalStatusesCount; + + public static final String SERIALIZED_NAME_NUM_RECOMMENDERS = "NumRecommenders"; + @SerializedName(SERIALIZED_NAME_NUM_RECOMMENDERS) + @javax.annotation.Nullable + private Integer numRecommenders; + + public static final String SERIALIZED_NAME_TOTAL_PRIVATE_REPOSITORY = "TotalPrivateRepository"; + @SerializedName(SERIALIZED_NAME_TOTAL_PRIVATE_REPOSITORY) + @javax.annotation.Nullable + private Integer totalPrivateRepository; + + public static final String SERIALIZED_NAME_PUBLIC_GISTS = "PublicGists"; + @SerializedName(SERIALIZED_NAME_PUBLIC_GISTS) + @javax.annotation.Nullable + private Integer publicGists; + + public static final String SERIALIZED_NAME_PRIVATE_GISTS = "PrivateGists"; + @SerializedName(SERIALIZED_NAME_PRIVATE_GISTS) + @javax.annotation.Nullable + private Integer privateGists; + + public static final String SERIALIZED_NAME_SESSION_LIMIT = "SessionLimit"; + @SerializedName(SERIALIZED_NAME_SESSION_LIMIT) + @javax.annotation.Nullable + private Integer sessionLimit; + + public static final String SERIALIZED_NAME_CUSTOM_FIELDS = "CustomFields"; + @SerializedName(SERIALIZED_NAME_CUSTOM_FIELDS) + @javax.annotation.Nullable + private Map<String, String> customFields; + + public static final String SERIALIZED_NAME_PROFILE_IMAGE_URLS = "ProfileImageUrls"; + @SerializedName(SERIALIZED_NAME_PROFILE_IMAGE_URLS) + @javax.annotation.Nullable + private Map<String, String> profileImageUrls; + + public static final String SERIALIZED_NAME_WEB_PROFILES = "WebProfiles"; + @SerializedName(SERIALIZED_NAME_WEB_PROFILES) + @javax.annotation.Nullable + private Map<String, String> webProfiles; + + public static final String SERIALIZED_NAME_SECURITY_QUESTION_ANSWER = "SecurityQuestionAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_QUESTION_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityQuestionAnswer; + + public static final String SERIALIZED_NAME_COUNTRY = "Country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + @javax.annotation.Nullable + private ManageRegisterModelCountry country; + + public static final String SERIALIZED_NAME_PROVIDER_ACCESS_CREDENTIAL = "ProviderAccessCredential"; + @SerializedName(SERIALIZED_NAME_PROVIDER_ACCESS_CREDENTIAL) + @javax.annotation.Nullable + private ManageRegisterModelProviderAccessCredential providerAccessCredential; + + public static final String SERIALIZED_NAME_SUGGESTIONS = "Suggestions"; + @SerializedName(SERIALIZED_NAME_SUGGESTIONS) + @javax.annotation.Nullable + private ManageRegisterModelSuggestions suggestions; + + public static final String SERIALIZED_NAME_SUBSCRIPTION = "Subscription"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION) + @javax.annotation.Nullable + private ManageRegisterModelSubscription subscription; + + public static final String SERIALIZED_NAME_AGE_RANGE = "AgeRange"; + @SerializedName(SERIALIZED_NAME_AGE_RANGE) + @javax.annotation.Nullable + private ManageRegisterModelAgeRange ageRange; + + public static final String SERIALIZED_NAME_PRIVACY_POLICY = "PrivacyPolicy"; + @SerializedName(SERIALIZED_NAME_PRIVACY_POLICY) + @javax.annotation.Nullable + private ManageRegisterModelPrivacyPolicy privacyPolicy; + + public static final String SERIALIZED_NAME_PI_N_INFO = "PINInfo"; + @SerializedName(SERIALIZED_NAME_PI_N_INFO) + @javax.annotation.Nullable + private ManageRegisterModelPINInfo piNInfo; + + public static final String SERIALIZED_NAME_ADDRESSES = "Addresses"; + @SerializedName(SERIALIZED_NAME_ADDRESSES) + @javax.annotation.Nullable + private List<ManageRegisterModelAddressesInner> addresses = new ArrayList<>(); + + public static final String SERIALIZED_NAME_POSITIONS = "Positions"; + @SerializedName(SERIALIZED_NAME_POSITIONS) + @javax.annotation.Nullable + private List<ManageRegisterModelPositionsInner> positions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_EDUCATIONS = "Educations"; + @SerializedName(SERIALIZED_NAME_EDUCATIONS) + @javax.annotation.Nullable + private List<ManageRegisterModelEducationsInner> educations = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PHONE_NUMBERS = "PhoneNumbers"; + @SerializedName(SERIALIZED_NAME_PHONE_NUMBERS) + @javax.annotation.Nullable + private List<ProfilePhoneNumbersInner> phoneNumbers = new ArrayList<>(); + + public static final String SERIALIZED_NAME_IM_ACCOUNTS = "IMAccounts"; + @SerializedName(SERIALIZED_NAME_IM_ACCOUNTS) + @javax.annotation.Nullable + private List<ProfileIMAccountsInner> imAccounts = new ArrayList<>(); + + public static final String SERIALIZED_NAME_INTERESTS = "Interests"; + @SerializedName(SERIALIZED_NAME_INTERESTS) + @javax.annotation.Nullable + private List<ProfileInterestsInner> interests = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SPORTS = "Sports"; + @SerializedName(SERIALIZED_NAME_SPORTS) + @javax.annotation.Nullable + private List<ProfileSportsInner> sports = new ArrayList<>(); + + public static final String SERIALIZED_NAME_INSPIRATIONAL_PEOPLE = "InspirationalPeople"; + @SerializedName(SERIALIZED_NAME_INSPIRATIONAL_PEOPLE) + @javax.annotation.Nullable + private List<ProfileInspirationalPeopleInner> inspirationalPeople = new ArrayList<>(); + + public static final String SERIALIZED_NAME_AWARDS = "Awards"; + @SerializedName(SERIALIZED_NAME_AWARDS) + @javax.annotation.Nullable + private List<ProfileAwardsInner> awards = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SKILLS = "Skills"; + @SerializedName(SERIALIZED_NAME_SKILLS) + @javax.annotation.Nullable + private List<ProfileSkillsInner> skills = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CURRENT_STATUS = "CurrentStatus"; + @SerializedName(SERIALIZED_NAME_CURRENT_STATUS) + @javax.annotation.Nullable + private List<ProfileCurrentStatusInner> currentStatus = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CERTIFICATIONS = "Certifications"; + @SerializedName(SERIALIZED_NAME_CERTIFICATIONS) + @javax.annotation.Nullable + private List<ManageRegisterModelCertificationsInner> certifications = new ArrayList<>(); + + public static final String SERIALIZED_NAME_COURSES = "Courses"; + @SerializedName(SERIALIZED_NAME_COURSES) + @javax.annotation.Nullable + private List<ManageRegisterModelCoursesInner> courses = new ArrayList<>(); + + public static final String SERIALIZED_NAME_VOLUNTEER = "Volunteer"; + @SerializedName(SERIALIZED_NAME_VOLUNTEER) + @javax.annotation.Nullable + private List<ManageRegisterModelVolunteerInner> volunteer = new ArrayList<>(); + + public static final String SERIALIZED_NAME_RECOMMENDATIONS_RECEIVED = "RecommendationsReceived"; + @SerializedName(SERIALIZED_NAME_RECOMMENDATIONS_RECEIVED) + @javax.annotation.Nullable + private List<ManageRegisterModelRecommendationsReceivedInner> recommendationsReceived = new ArrayList<>(); + + public static final String SERIALIZED_NAME_LANGUAGES = "Languages"; + @SerializedName(SERIALIZED_NAME_LANGUAGES) + @javax.annotation.Nullable + private List<ManageRegisterModelLanguagesInner> languages = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PROJECTS = "Projects"; + @SerializedName(SERIALIZED_NAME_PROJECTS) + @javax.annotation.Nullable + private List<ManageRegisterModelProjectsInner> projects = new ArrayList<>(); + + public static final String SERIALIZED_NAME_GAMES = "Games"; + @SerializedName(SERIALIZED_NAME_GAMES) + @javax.annotation.Nullable + private List<ManageRegisterModelGamesInner> games = new ArrayList<>(); + + public static final String SERIALIZED_NAME_FAMILY = "Family"; + @SerializedName(SERIALIZED_NAME_FAMILY) + @javax.annotation.Nullable + private List<ManageRegisterModelFamilyInner> family = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TELEVISION_SHOW = "TelevisionShow"; + @SerializedName(SERIALIZED_NAME_TELEVISION_SHOW) + @javax.annotation.Nullable + private List<ManageRegisterModelTelevisionShowInner> televisionShow = new ArrayList<>(); + + public static final String SERIALIZED_NAME_MUTUAL_FRIENDS = "MutualFriends"; + @SerializedName(SERIALIZED_NAME_MUTUAL_FRIENDS) + @javax.annotation.Nullable + private List<ManageRegisterModelMutualFriendsInner> mutualFriends = new ArrayList<>(); + + public static final String SERIALIZED_NAME_MOVIES = "Movies"; + @SerializedName(SERIALIZED_NAME_MOVIES) + @javax.annotation.Nullable + private List<ManageRegisterModelMoviesInner> movies = new ArrayList<>(); + + public static final String SERIALIZED_NAME_BOOKS = "Books"; + @SerializedName(SERIALIZED_NAME_BOOKS) + @javax.annotation.Nullable + private List<ManageRegisterModelBooksInner> books = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PATENTS = "Patents"; + @SerializedName(SERIALIZED_NAME_PATENTS) + @javax.annotation.Nullable + private List<ManageRegisterModelPatentsInner> patents = new ArrayList<>(); + + public static final String SERIALIZED_NAME_FAVORITE_THINGS = "FavoriteThings"; + @SerializedName(SERIALIZED_NAME_FAVORITE_THINGS) + @javax.annotation.Nullable + private List<ManageRegisterModelFavoriteThingsInner> favoriteThings = new ArrayList<>(); + + public static final String SERIALIZED_NAME_RELATED_PROFILE_VIEWS = "RelatedProfileViews"; + @SerializedName(SERIALIZED_NAME_RELATED_PROFILE_VIEWS) + @javax.annotation.Nullable + private List<ManageRegisterModelRelatedProfileViewsInner> relatedProfileViews = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PLACES_LIVED = "PlacesLived"; + @SerializedName(SERIALIZED_NAME_PLACES_LIVED) + @javax.annotation.Nullable + private List<ManageRegisterModelPlacesLivedInner> placesLived = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PUBLICATIONS = "Publications"; + @SerializedName(SERIALIZED_NAME_PUBLICATIONS) + @javax.annotation.Nullable + private List<ManageRegisterModelPublicationsInner> publications = new ArrayList<>(); + + public static final String SERIALIZED_NAME_JOB_BOOKMARKS = "JobBookmarks"; + @SerializedName(SERIALIZED_NAME_JOB_BOOKMARKS) + @javax.annotation.Nullable + private List<ManageRegisterModelJobBookmarksInner> jobBookmarks = new ArrayList<>(); + + public static final String SERIALIZED_NAME_BADGES = "Badges"; + @SerializedName(SERIALIZED_NAME_BADGES) + @javax.annotation.Nullable + private List<ManageRegisterModelBadgesInner> badges = new ArrayList<>(); + + public static final String SERIALIZED_NAME_MEMBER_URL_RESOURCES = "MemberUrlResources"; + @SerializedName(SERIALIZED_NAME_MEMBER_URL_RESOURCES) + @javax.annotation.Nullable + private List<ManageRegisterModelMemberUrlResourcesInner> memberUrlResources = new ArrayList<>(); + + public static final String SERIALIZED_NAME_EXTERNAL_IDS = "ExternalIds"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_IDS) + @javax.annotation.Nullable + private List<ProfileExternalIdsInner> externalIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_IS_EMAIL_SUBSCRIBED = "IsEmailSubscribed"; + @SerializedName(SERIALIZED_NAME_IS_EMAIL_SUBSCRIBED) + @javax.annotation.Nullable + private Boolean isEmailSubscribed; + + public static final String SERIALIZED_NAME_IS_PROTECTED = "IsProtected"; + @SerializedName(SERIALIZED_NAME_IS_PROTECTED) + @javax.annotation.Nullable + private Boolean isProtected; + + public static final String SERIALIZED_NAME_HIREABLE = "Hireable"; + @SerializedName(SERIALIZED_NAME_HIREABLE) + @javax.annotation.Nullable + private Boolean hireable; + + public static final String SERIALIZED_NAME_IS_TWO_FACTOR_AUTHENTICATION_ENABLED = "IsTwoFactorAuthenticationEnabled"; + @SerializedName(SERIALIZED_NAME_IS_TWO_FACTOR_AUTHENTICATION_ENABLED) + @javax.annotation.Nullable + private Boolean isTwoFactorAuthenticationEnabled; + + public static final String SERIALIZED_NAME_IS_ACTIVE = "IsActive"; + @SerializedName(SERIALIZED_NAME_IS_ACTIVE) + @javax.annotation.Nullable + private Boolean isActive; + + public static final String SERIALIZED_NAME_IS_DELETED = "IsDeleted"; + @SerializedName(SERIALIZED_NAME_IS_DELETED) + @javax.annotation.Nullable + private Boolean isDeleted; + + public static final String SERIALIZED_NAME_EMAIL_VERIFIED = "EmailVerified"; + @SerializedName(SERIALIZED_NAME_EMAIL_VERIFIED) + @javax.annotation.Nullable + private Boolean emailVerified; + + public static final String SERIALIZED_NAME_PHONE_ID_VERIFIED = "PhoneIdVerified"; + @SerializedName(SERIALIZED_NAME_PHONE_ID_VERIFIED) + @javax.annotation.Nullable + private Boolean phoneIdVerified; + + public static final String SERIALIZED_NAME_DISABLE_LOGIN = "DisableLogin"; + @SerializedName(SERIALIZED_NAME_DISABLE_LOGIN) + @javax.annotation.Nullable + private Boolean disableLogin; + + public static final String SERIALIZED_NAME_IS_LOGIN_LOCKED = "IsLoginLocked"; + @SerializedName(SERIALIZED_NAME_IS_LOGIN_LOCKED) + @javax.annotation.Nullable + private Boolean isLoginLocked; + + public static final String SERIALIZED_NAME_ACCEPT_PRIVACY_POLICY = "AcceptPrivacyPolicy"; + @SerializedName(SERIALIZED_NAME_ACCEPT_PRIVACY_POLICY) + @javax.annotation.Nullable + private Boolean acceptPrivacyPolicy; + + public static final String SERIALIZED_NAME_RE_CAPTCHA_RESPONSE_FIELD = "ReCaptchaResponseField"; + @SerializedName(SERIALIZED_NAME_RE_CAPTCHA_RESPONSE_FIELD) + @javax.annotation.Nullable + private String reCaptchaResponseField; + + public static final String SERIALIZED_NAME_RE_CAPTCHA_CHALLENGE_FIELD = "ReCaptchaChallengeField"; + @SerializedName(SERIALIZED_NAME_RE_CAPTCHA_CHALLENGE_FIELD) + @javax.annotation.Nullable + private String reCaptchaChallengeField; + + public static final String SERIALIZED_NAME_REGISTRATION_SOURCE = "RegistrationSource"; + @SerializedName(SERIALIZED_NAME_REGISTRATION_SOURCE) + @javax.annotation.Nullable + private String registrationSource; + + 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_CONSENTS = "Consents"; + @SerializedName(SERIALIZED_NAME_CONSENTS) + @javax.annotation.Nullable + private ManageRegisterModelConsents consents; + + public static final String SERIALIZED_NAME_PASSWORD = "Password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nullable + private String password; + + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private List<ManageRegisterModelEmailInner> email = new ArrayList<>(); + + public ManageRegisterModel() { + } + + public ManageRegisterModel uid(@javax.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * The unique identifier (UID) of the User. + * @return uid + */ + @javax.annotation.Nullable + public String getUid() { + return uid; + } + + public void setUid(@javax.annotation.Nullable String uid) { + this.uid = uid; + } + + + public ManageRegisterModel userName(@javax.annotation.Nullable String userName) { + this.userName = userName; + return this; + } + + /** + * The Username of the User. + * @return userName + */ + @javax.annotation.Nullable + public String getUserName() { + return userName; + } + + public void setUserName(@javax.annotation.Nullable String userName) { + this.userName = userName; + } + + + public ManageRegisterModel phoneId(@javax.annotation.Nullable String phoneId) { + this.phoneId = phoneId; + return this; + } + + /** + * The Phone ID of the User. + * @return phoneId + */ + @javax.annotation.Nullable + public String getPhoneId() { + return phoneId; + } + + public void setPhoneId(@javax.annotation.Nullable String phoneId) { + this.phoneId = phoneId; + } + + + public ManageRegisterModel gender(@javax.annotation.Nullable String gender) { + this.gender = gender; + return this; + } + + /** + * The gender of the User. + * @return gender + */ + @javax.annotation.Nullable + public String getGender() { + return gender; + } + + public void setGender(@javax.annotation.Nullable String gender) { + this.gender = gender; + } + + + public ManageRegisterModel birthDate(@javax.annotation.Nullable String birthDate) { + this.birthDate = birthDate; + return this; + } + + /** + * The birth date of the User. + * @return birthDate + */ + @javax.annotation.Nullable + public String getBirthDate() { + return birthDate; + } + + public void setBirthDate(@javax.annotation.Nullable String birthDate) { + this.birthDate = birthDate; + } + + + public ManageRegisterModel prefix(@javax.annotation.Nullable String prefix) { + this.prefix = prefix; + return this; + } + + /** + * The prefix for the User's name. + * @return prefix + */ + @javax.annotation.Nullable + public String getPrefix() { + return prefix; + } + + public void setPrefix(@javax.annotation.Nullable String prefix) { + this.prefix = prefix; + } + + + public ManageRegisterModel firstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * The first name of the User. + * @return firstName + */ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + } + + + public ManageRegisterModel middleName(@javax.annotation.Nullable String middleName) { + this.middleName = middleName; + return this; + } + + /** + * The middle name of the User. + * @return middleName + */ + @javax.annotation.Nullable + public String getMiddleName() { + return middleName; + } + + public void setMiddleName(@javax.annotation.Nullable String middleName) { + this.middleName = middleName; + } + + + public ManageRegisterModel lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * The last name of the User. + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + + public ManageRegisterModel suffix(@javax.annotation.Nullable String suffix) { + this.suffix = suffix; + return this; + } + + /** + * The suffix for the User's name. + * @return suffix + */ + @javax.annotation.Nullable + public String getSuffix() { + return suffix; + } + + public void setSuffix(@javax.annotation.Nullable String suffix) { + this.suffix = suffix; + } + + + public ManageRegisterModel nickName(@javax.annotation.Nullable String nickName) { + this.nickName = nickName; + return this; + } + + /** + * The nickname of the User. + * @return nickName + */ + @javax.annotation.Nullable + public String getNickName() { + return nickName; + } + + public void setNickName(@javax.annotation.Nullable String nickName) { + this.nickName = nickName; + } + + + public ManageRegisterModel profileName(@javax.annotation.Nullable String profileName) { + this.profileName = profileName; + return this; + } + + /** + * The profile name of the User. + * @return profileName + */ + @javax.annotation.Nullable + public String getProfileName() { + return profileName; + } + + public void setProfileName(@javax.annotation.Nullable String profileName) { + this.profileName = profileName; + } + + + public ManageRegisterModel about(@javax.annotation.Nullable String about) { + this.about = about; + return this; + } + + /** + * A brief description about the User. + * @return about + */ + @javax.annotation.Nullable + public String getAbout() { + return about; + } + + public void setAbout(@javax.annotation.Nullable String about) { + this.about = about; + } + + + public ManageRegisterModel company(@javax.annotation.Nullable String company) { + this.company = company; + return this; + } + + /** + * The company the User is associated with. + * @return company + */ + @javax.annotation.Nullable + public String getCompany() { + return company; + } + + public void setCompany(@javax.annotation.Nullable String company) { + this.company = company; + } + + + public ManageRegisterModel imageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** + * The URL of the User's profile image. + * @return imageUrl + */ + @javax.annotation.Nullable + public String getImageUrl() { + return imageUrl; + } + + public void setImageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + } + + + public ManageRegisterModel timeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * The time zone of the User. + * @return timeZone + */ + @javax.annotation.Nullable + public String getTimeZone() { + return timeZone; + } + + public void setTimeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + } + + + public ManageRegisterModel website(@javax.annotation.Nullable String website) { + this.website = website; + return this; + } + + /** + * The website of the User. + * @return website + */ + @javax.annotation.Nullable + public String getWebsite() { + return website; + } + + public void setWebsite(@javax.annotation.Nullable String website) { + this.website = website; + } + + + public ManageRegisterModel thumbnailImageUrl(@javax.annotation.Nullable String thumbnailImageUrl) { + this.thumbnailImageUrl = thumbnailImageUrl; + return this; + } + + /** + * The URL of the User's thumbnail image. + * @return thumbnailImageUrl + */ + @javax.annotation.Nullable + public String getThumbnailImageUrl() { + return thumbnailImageUrl; + } + + public void setThumbnailImageUrl(@javax.annotation.Nullable String thumbnailImageUrl) { + this.thumbnailImageUrl = thumbnailImageUrl; + } + + + public ManageRegisterModel favicon(@javax.annotation.Nullable String favicon) { + this.favicon = favicon; + return this; + } + + /** + * The URL of the User's favicon. + * @return favicon + */ + @javax.annotation.Nullable + public String getFavicon() { + return favicon; + } + + public void setFavicon(@javax.annotation.Nullable String favicon) { + this.favicon = favicon; + } + + + public ManageRegisterModel profileUrl(@javax.annotation.Nullable String profileUrl) { + this.profileUrl = profileUrl; + return this; + } + + /** + * The URL of the User's profile. + * @return profileUrl + */ + @javax.annotation.Nullable + public String getProfileUrl() { + return profileUrl; + } + + public void setProfileUrl(@javax.annotation.Nullable String profileUrl) { + this.profileUrl = profileUrl; + } + + + public ManageRegisterModel homeTown(@javax.annotation.Nullable String homeTown) { + this.homeTown = homeTown; + return this; + } + + /** + * The hometown of the User. + * @return homeTown + */ + @javax.annotation.Nullable + public String getHomeTown() { + return homeTown; + } + + public void setHomeTown(@javax.annotation.Nullable String homeTown) { + this.homeTown = homeTown; + } + + + public ManageRegisterModel state(@javax.annotation.Nullable String state) { + this.state = state; + return this; + } + + /** + * The state of the User. + * @return state + */ + @javax.annotation.Nullable + public String getState() { + return state; + } + + public void setState(@javax.annotation.Nullable String state) { + this.state = state; + } + + + public ManageRegisterModel city(@javax.annotation.Nullable String city) { + this.city = city; + return this; + } + + /** + * The city of the User. + * @return city + */ + @javax.annotation.Nullable + public String getCity() { + return city; + } + + public void setCity(@javax.annotation.Nullable String city) { + this.city = city; + } + + + public ManageRegisterModel industry(@javax.annotation.Nullable String industry) { + this.industry = industry; + return this; + } + + /** + * The industry of the User. + * @return industry + */ + @javax.annotation.Nullable + public String getIndustry() { + return industry; + } + + public void setIndustry(@javax.annotation.Nullable String industry) { + this.industry = industry; + } + + + public ManageRegisterModel localLanguage(@javax.annotation.Nullable String localLanguage) { + this.localLanguage = localLanguage; + return this; + } + + /** + * The local language of the User. + * @return localLanguage + */ + @javax.annotation.Nullable + public String getLocalLanguage() { + return localLanguage; + } + + public void setLocalLanguage(@javax.annotation.Nullable String localLanguage) { + this.localLanguage = localLanguage; + } + + + public ManageRegisterModel language(@javax.annotation.Nullable String language) { + this.language = language; + return this; + } + + /** + * The language of the User. + * @return language + */ + @javax.annotation.Nullable + public String getLanguage() { + return language; + } + + public void setLanguage(@javax.annotation.Nullable String language) { + this.language = language; + } + + + public ManageRegisterModel coverPhoto(@javax.annotation.Nullable String coverPhoto) { + this.coverPhoto = coverPhoto; + return this; + } + + /** + * The URL of the User's cover photo. + * @return coverPhoto + */ + @javax.annotation.Nullable + public String getCoverPhoto() { + return coverPhoto; + } + + public void setCoverPhoto(@javax.annotation.Nullable String coverPhoto) { + this.coverPhoto = coverPhoto; + } + + + public ManageRegisterModel tagLine(@javax.annotation.Nullable String tagLine) { + this.tagLine = tagLine; + return this; + } + + /** + * The tagline of the User. + * @return tagLine + */ + @javax.annotation.Nullable + public String getTagLine() { + return tagLine; + } + + public void setTagLine(@javax.annotation.Nullable String tagLine) { + this.tagLine = tagLine; + } + + + public ManageRegisterModel mainAddress(@javax.annotation.Nullable String mainAddress) { + this.mainAddress = mainAddress; + return this; + } + + /** + * The main address of the User. + * @return mainAddress + */ + @javax.annotation.Nullable + public String getMainAddress() { + return mainAddress; + } + + public void setMainAddress(@javax.annotation.Nullable String mainAddress) { + this.mainAddress = mainAddress; + } + + + public ManageRegisterModel localCity(@javax.annotation.Nullable String localCity) { + this.localCity = localCity; + return this; + } + + /** + * The local city of the User. + * @return localCity + */ + @javax.annotation.Nullable + public String getLocalCity() { + return localCity; + } + + public void setLocalCity(@javax.annotation.Nullable String localCity) { + this.localCity = localCity; + } + + + public ManageRegisterModel profileCity(@javax.annotation.Nullable String profileCity) { + this.profileCity = profileCity; + return this; + } + + /** + * The profile city of the User. + * @return profileCity + */ + @javax.annotation.Nullable + public String getProfileCity() { + return profileCity; + } + + public void setProfileCity(@javax.annotation.Nullable String profileCity) { + this.profileCity = profileCity; + } + + + public ManageRegisterModel localCountry(@javax.annotation.Nullable String localCountry) { + this.localCountry = localCountry; + return this; + } + + /** + * The local country of the User. + * @return localCountry + */ + @javax.annotation.Nullable + public String getLocalCountry() { + return localCountry; + } + + public void setLocalCountry(@javax.annotation.Nullable String localCountry) { + this.localCountry = localCountry; + } + + + public ManageRegisterModel profileCountry(@javax.annotation.Nullable String profileCountry) { + this.profileCountry = profileCountry; + return this; + } + + /** + * The profile country of the User. + * @return profileCountry + */ + @javax.annotation.Nullable + public String getProfileCountry() { + return profileCountry; + } + + public void setProfileCountry(@javax.annotation.Nullable String profileCountry) { + this.profileCountry = profileCountry; + } + + + public ManageRegisterModel quota(@javax.annotation.Nullable String quota) { + this.quota = quota; + return this; + } + + /** + * The quota assigned to the User. + * @return quota + */ + @javax.annotation.Nullable + public String getQuota() { + return quota; + } + + public void setQuota(@javax.annotation.Nullable String quota) { + this.quota = quota; + } + + + public ManageRegisterModel religion(@javax.annotation.Nullable String religion) { + this.religion = religion; + return this; + } + + /** + * The religion of the User. + * @return religion + */ + @javax.annotation.Nullable + public String getReligion() { + return religion; + } + + public void setReligion(@javax.annotation.Nullable String religion) { + this.religion = religion; + } + + + public ManageRegisterModel political(@javax.annotation.Nullable String political) { + this.political = political; + return this; + } + + /** + * The political views of the User. + * @return political + */ + @javax.annotation.Nullable + public String getPolitical() { + return political; + } + + public void setPolitical(@javax.annotation.Nullable String political) { + this.political = political; + } + + + public ManageRegisterModel relationshipStatus(@javax.annotation.Nullable String relationshipStatus) { + this.relationshipStatus = relationshipStatus; + return this; + } + + /** + * The relationship status of the User. + * @return relationshipStatus + */ + @javax.annotation.Nullable + public String getRelationshipStatus() { + return relationshipStatus; + } + + public void setRelationshipStatus(@javax.annotation.Nullable String relationshipStatus) { + this.relationshipStatus = relationshipStatus; + } + + + public ManageRegisterModel httpsImageUrl(@javax.annotation.Nullable String httpsImageUrl) { + this.httpsImageUrl = httpsImageUrl; + return this; + } + + /** + * The HTTPS URL of the User's profile image. + * @return httpsImageUrl + */ + @javax.annotation.Nullable + public String getHttpsImageUrl() { + return httpsImageUrl; + } + + public void setHttpsImageUrl(@javax.annotation.Nullable String httpsImageUrl) { + this.httpsImageUrl = httpsImageUrl; + } + + + public ManageRegisterModel isGeoEnabled(@javax.annotation.Nullable String isGeoEnabled) { + this.isGeoEnabled = isGeoEnabled; + return this; + } + + /** + * Indicates if geolocation is enabled for the User. + * @return isGeoEnabled + */ + @javax.annotation.Nullable + public String getIsGeoEnabled() { + return isGeoEnabled; + } + + public void setIsGeoEnabled(@javax.annotation.Nullable String isGeoEnabled) { + this.isGeoEnabled = isGeoEnabled; + } + + + public ManageRegisterModel associations(@javax.annotation.Nullable String associations) { + this.associations = associations; + return this; + } + + /** + * The associations of the User. + * @return associations + */ + @javax.annotation.Nullable + public String getAssociations() { + return associations; + } + + public void setAssociations(@javax.annotation.Nullable String associations) { + this.associations = associations; + } + + + public ManageRegisterModel honors(@javax.annotation.Nullable String honors) { + this.honors = honors; + return this; + } + + /** + * The honors received by the User. + * @return honors + */ + @javax.annotation.Nullable + public String getHonors() { + return honors; + } + + public void setHonors(@javax.annotation.Nullable String honors) { + this.honors = honors; + } + + + public ManageRegisterModel publicRepository(@javax.annotation.Nullable String publicRepository) { + this.publicRepository = publicRepository; + return this; + } + + /** + * The number of public repositories owned by the User. + * @return publicRepository + */ + @javax.annotation.Nullable + public String getPublicRepository() { + return publicRepository; + } + + public void setPublicRepository(@javax.annotation.Nullable String publicRepository) { + this.publicRepository = publicRepository; + } + + + public ManageRegisterModel repositoryUrl(@javax.annotation.Nullable String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + return this; + } + + /** + * The URL of the User's repository. + * @return repositoryUrl + */ + @javax.annotation.Nullable + public String getRepositoryUrl() { + return repositoryUrl; + } + + public void setRepositoryUrl(@javax.annotation.Nullable String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + } + + + public ManageRegisterModel professionalHeadline(@javax.annotation.Nullable String professionalHeadline) { + this.professionalHeadline = professionalHeadline; + return this; + } + + /** + * The professional headline of the User. + * @return professionalHeadline + */ + @javax.annotation.Nullable + public String getProfessionalHeadline() { + return professionalHeadline; + } + + public void setProfessionalHeadline(@javax.annotation.Nullable String professionalHeadline) { + this.professionalHeadline = professionalHeadline; + } + + + public ManageRegisterModel currency(@javax.annotation.Nullable String currency) { + this.currency = currency; + return this; + } + + /** + * The preferred currency of the User. + * @return currency + */ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + public void setCurrency(@javax.annotation.Nullable String currency) { + this.currency = currency; + } + + + public ManageRegisterModel starredUrl(@javax.annotation.Nullable String starredUrl) { + this.starredUrl = starredUrl; + return this; + } + + /** + * The URL of the User's starred items. + * @return starredUrl + */ + @javax.annotation.Nullable + public String getStarredUrl() { + return starredUrl; + } + + public void setStarredUrl(@javax.annotation.Nullable String starredUrl) { + this.starredUrl = starredUrl; + } + + + public ManageRegisterModel gistsUrl(@javax.annotation.Nullable String gistsUrl) { + this.gistsUrl = gistsUrl; + return this; + } + + /** + * The URL of the User's gists. + * @return gistsUrl + */ + @javax.annotation.Nullable + public String getGistsUrl() { + return gistsUrl; + } + + public void setGistsUrl(@javax.annotation.Nullable String gistsUrl) { + this.gistsUrl = gistsUrl; + } + + + public ManageRegisterModel gravatarImageUrl(@javax.annotation.Nullable String gravatarImageUrl) { + this.gravatarImageUrl = gravatarImageUrl; + return this; + } + + /** + * The URL of the User's Gravatar image. + * @return gravatarImageUrl + */ + @javax.annotation.Nullable + public String getGravatarImageUrl() { + return gravatarImageUrl; + } + + public void setGravatarImageUrl(@javax.annotation.Nullable String gravatarImageUrl) { + this.gravatarImageUrl = gravatarImageUrl; + } + + + public ManageRegisterModel externalUserLoginId(@javax.annotation.Nullable String externalUserLoginId) { + this.externalUserLoginId = externalUserLoginId; + return this; + } + + /** + * The external User login ID. + * @return externalUserLoginId + */ + @javax.annotation.Nullable + public String getExternalUserLoginId() { + return externalUserLoginId; + } + + public void setExternalUserLoginId(@javax.annotation.Nullable String externalUserLoginId) { + this.externalUserLoginId = externalUserLoginId; + } + + + public ManageRegisterModel interestedIn(@javax.annotation.Nullable List<String> interestedIn) { + this.interestedIn = interestedIn; + return this; + } + + public ManageRegisterModel addInterestedInItem(String interestedInItem) { + if (this.interestedIn == null) { + this.interestedIn = new ArrayList<>(); + } + this.interestedIn.add(interestedInItem); + return this; + } + + /** + * Interests of the User. + * @return interestedIn + */ + @javax.annotation.Nullable + public List<String> getInterestedIn() { + return interestedIn; + } + + public void setInterestedIn(@javax.annotation.Nullable List<String> interestedIn) { + this.interestedIn = interestedIn; + } + + + public ManageRegisterModel followersCount(@javax.annotation.Nullable Integer followersCount) { + this.followersCount = followersCount; + return this; + } + + /** + * The number of followers the User has. + * @return followersCount + */ + @javax.annotation.Nullable + public Integer getFollowersCount() { + return followersCount; + } + + public void setFollowersCount(@javax.annotation.Nullable Integer followersCount) { + this.followersCount = followersCount; + } + + + public ManageRegisterModel friendsCount(@javax.annotation.Nullable Integer friendsCount) { + this.friendsCount = friendsCount; + return this; + } + + /** + * The number of friends the User has. + * @return friendsCount + */ + @javax.annotation.Nullable + public Integer getFriendsCount() { + return friendsCount; + } + + public void setFriendsCount(@javax.annotation.Nullable Integer friendsCount) { + this.friendsCount = friendsCount; + } + + + public ManageRegisterModel totalStatusesCount(@javax.annotation.Nullable Integer totalStatusesCount) { + this.totalStatusesCount = totalStatusesCount; + return this; + } + + /** + * The total number of statuses posted by the User. + * @return totalStatusesCount + */ + @javax.annotation.Nullable + public Integer getTotalStatusesCount() { + return totalStatusesCount; + } + + public void setTotalStatusesCount(@javax.annotation.Nullable Integer totalStatusesCount) { + this.totalStatusesCount = totalStatusesCount; + } + + + public ManageRegisterModel numRecommenders(@javax.annotation.Nullable Integer numRecommenders) { + this.numRecommenders = numRecommenders; + return this; + } + + /** + * The number of recommenders for the User. + * @return numRecommenders + */ + @javax.annotation.Nullable + public Integer getNumRecommenders() { + return numRecommenders; + } + + public void setNumRecommenders(@javax.annotation.Nullable Integer numRecommenders) { + this.numRecommenders = numRecommenders; + } + + + public ManageRegisterModel totalPrivateRepository(@javax.annotation.Nullable Integer totalPrivateRepository) { + this.totalPrivateRepository = totalPrivateRepository; + return this; + } + + /** + * The total number of private repositories owned by the User. + * @return totalPrivateRepository + */ + @javax.annotation.Nullable + public Integer getTotalPrivateRepository() { + return totalPrivateRepository; + } + + public void setTotalPrivateRepository(@javax.annotation.Nullable Integer totalPrivateRepository) { + this.totalPrivateRepository = totalPrivateRepository; + } + + + public ManageRegisterModel publicGists(@javax.annotation.Nullable Integer publicGists) { + this.publicGists = publicGists; + return this; + } + + /** + * The total number of public gists owned by the User. + * @return publicGists + */ + @javax.annotation.Nullable + public Integer getPublicGists() { + return publicGists; + } + + public void setPublicGists(@javax.annotation.Nullable Integer publicGists) { + this.publicGists = publicGists; + } + + + public ManageRegisterModel privateGists(@javax.annotation.Nullable Integer privateGists) { + this.privateGists = privateGists; + return this; + } + + /** + * The total number of private gists owned by the User. + * @return privateGists + */ + @javax.annotation.Nullable + public Integer getPrivateGists() { + return privateGists; + } + + public void setPrivateGists(@javax.annotation.Nullable Integer privateGists) { + this.privateGists = privateGists; + } + + + public ManageRegisterModel sessionLimit(@javax.annotation.Nullable Integer sessionLimit) { + this.sessionLimit = sessionLimit; + return this; + } + + /** + * The session limit for the User. + * @return sessionLimit + */ + @javax.annotation.Nullable + public Integer getSessionLimit() { + return sessionLimit; + } + + public void setSessionLimit(@javax.annotation.Nullable Integer sessionLimit) { + this.sessionLimit = sessionLimit; + } + + + public ManageRegisterModel customFields(@javax.annotation.Nullable Map<String, String> customFields) { + this.customFields = customFields; + return this; + } + + public ManageRegisterModel putCustomFieldsItem(String key, String customFieldsItem) { + if (this.customFields == null) { + this.customFields = new HashMap<>(); + } + this.customFields.put(key, customFieldsItem); + return this; + } + + /** + * Custom fields associated with the User. + * @return customFields + */ + @javax.annotation.Nullable + public Map<String, String> getCustomFields() { + return customFields; + } + + public void setCustomFields(@javax.annotation.Nullable Map<String, String> customFields) { + this.customFields = customFields; + } + + + public ManageRegisterModel profileImageUrls(@javax.annotation.Nullable Map<String, String> profileImageUrls) { + this.profileImageUrls = profileImageUrls; + return this; + } + + public ManageRegisterModel putProfileImageUrlsItem(String key, String profileImageUrlsItem) { + if (this.profileImageUrls == null) { + this.profileImageUrls = new HashMap<>(); + } + this.profileImageUrls.put(key, profileImageUrlsItem); + return this; + } + + /** + * URLs of the User's profile images. + * @return profileImageUrls + */ + @javax.annotation.Nullable + public Map<String, String> getProfileImageUrls() { + return profileImageUrls; + } + + public void setProfileImageUrls(@javax.annotation.Nullable Map<String, String> profileImageUrls) { + this.profileImageUrls = profileImageUrls; + } + + + public ManageRegisterModel webProfiles(@javax.annotation.Nullable Map<String, String> webProfiles) { + this.webProfiles = webProfiles; + return this; + } + + public ManageRegisterModel putWebProfilesItem(String key, String webProfilesItem) { + if (this.webProfiles == null) { + this.webProfiles = new HashMap<>(); + } + this.webProfiles.put(key, webProfilesItem); + return this; + } + + /** + * The User's web profiles. + * @return webProfiles + */ + @javax.annotation.Nullable + public Map<String, String> getWebProfiles() { + return webProfiles; + } + + public void setWebProfiles(@javax.annotation.Nullable Map<String, String> webProfiles) { + this.webProfiles = webProfiles; + } + + + public ManageRegisterModel securityQuestionAnswer(@javax.annotation.Nullable Map<String, String> securityQuestionAnswer) { + this.securityQuestionAnswer = securityQuestionAnswer; + return this; + } + + public ManageRegisterModel putSecurityQuestionAnswerItem(String key, String securityQuestionAnswerItem) { + if (this.securityQuestionAnswer == null) { + this.securityQuestionAnswer = new HashMap<>(); + } + this.securityQuestionAnswer.put(key, securityQuestionAnswerItem); + return this; + } + + /** + * Security question answers for the User. + * @return securityQuestionAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityQuestionAnswer() { + return securityQuestionAnswer; + } + + public void setSecurityQuestionAnswer(@javax.annotation.Nullable Map<String, String> securityQuestionAnswer) { + this.securityQuestionAnswer = securityQuestionAnswer; + } + + + public ManageRegisterModel country(@javax.annotation.Nullable ManageRegisterModelCountry country) { + this.country = country; + return this; + } + + /** + * Get country + * @return country + */ + @javax.annotation.Nullable + public ManageRegisterModelCountry getCountry() { + return country; + } + + public void setCountry(@javax.annotation.Nullable ManageRegisterModelCountry country) { + this.country = country; + } + + + public ManageRegisterModel providerAccessCredential(@javax.annotation.Nullable ManageRegisterModelProviderAccessCredential providerAccessCredential) { + this.providerAccessCredential = providerAccessCredential; + return this; + } + + /** + * Get providerAccessCredential + * @return providerAccessCredential + */ + @javax.annotation.Nullable + public ManageRegisterModelProviderAccessCredential getProviderAccessCredential() { + return providerAccessCredential; + } + + public void setProviderAccessCredential(@javax.annotation.Nullable ManageRegisterModelProviderAccessCredential providerAccessCredential) { + this.providerAccessCredential = providerAccessCredential; + } + + + public ManageRegisterModel suggestions(@javax.annotation.Nullable ManageRegisterModelSuggestions suggestions) { + this.suggestions = suggestions; + return this; + } + + /** + * Get suggestions + * @return suggestions + */ + @javax.annotation.Nullable + public ManageRegisterModelSuggestions getSuggestions() { + return suggestions; + } + + public void setSuggestions(@javax.annotation.Nullable ManageRegisterModelSuggestions suggestions) { + this.suggestions = suggestions; + } + + + public ManageRegisterModel subscription(@javax.annotation.Nullable ManageRegisterModelSubscription subscription) { + this.subscription = subscription; + return this; + } + + /** + * Get subscription + * @return subscription + */ + @javax.annotation.Nullable + public ManageRegisterModelSubscription getSubscription() { + return subscription; + } + + public void setSubscription(@javax.annotation.Nullable ManageRegisterModelSubscription subscription) { + this.subscription = subscription; + } + + + public ManageRegisterModel ageRange(@javax.annotation.Nullable ManageRegisterModelAgeRange ageRange) { + this.ageRange = ageRange; + return this; + } + + /** + * Get ageRange + * @return ageRange + */ + @javax.annotation.Nullable + public ManageRegisterModelAgeRange getAgeRange() { + return ageRange; + } + + public void setAgeRange(@javax.annotation.Nullable ManageRegisterModelAgeRange ageRange) { + this.ageRange = ageRange; + } + + + public ManageRegisterModel privacyPolicy(@javax.annotation.Nullable ManageRegisterModelPrivacyPolicy privacyPolicy) { + this.privacyPolicy = privacyPolicy; + return this; + } + + /** + * Get privacyPolicy + * @return privacyPolicy + */ + @javax.annotation.Nullable + public ManageRegisterModelPrivacyPolicy getPrivacyPolicy() { + return privacyPolicy; + } + + public void setPrivacyPolicy(@javax.annotation.Nullable ManageRegisterModelPrivacyPolicy privacyPolicy) { + this.privacyPolicy = privacyPolicy; + } + + + public ManageRegisterModel piNInfo(@javax.annotation.Nullable ManageRegisterModelPINInfo piNInfo) { + this.piNInfo = piNInfo; + return this; + } + + /** + * Get piNInfo + * @return piNInfo + */ + @javax.annotation.Nullable + public ManageRegisterModelPINInfo getPiNInfo() { + return piNInfo; + } + + public void setPiNInfo(@javax.annotation.Nullable ManageRegisterModelPINInfo piNInfo) { + this.piNInfo = piNInfo; + } + + + public ManageRegisterModel addresses(@javax.annotation.Nullable List<ManageRegisterModelAddressesInner> addresses) { + this.addresses = addresses; + return this; + } + + public ManageRegisterModel addAddressesItem(ManageRegisterModelAddressesInner addressesItem) { + if (this.addresses == null) { + this.addresses = new ArrayList<>(); + } + this.addresses.add(addressesItem); + return this; + } + + /** + * List of addresses associated with the User. + * @return addresses + */ + @javax.annotation.Nullable + public List<ManageRegisterModelAddressesInner> getAddresses() { + return addresses; + } + + public void setAddresses(@javax.annotation.Nullable List<ManageRegisterModelAddressesInner> addresses) { + this.addresses = addresses; + } + + + public ManageRegisterModel positions(@javax.annotation.Nullable List<ManageRegisterModelPositionsInner> positions) { + this.positions = positions; + return this; + } + + public ManageRegisterModel addPositionsItem(ManageRegisterModelPositionsInner positionsItem) { + if (this.positions == null) { + this.positions = new ArrayList<>(); + } + this.positions.add(positionsItem); + return this; + } + + /** + * List of positions held by the User. + * @return positions + */ + @javax.annotation.Nullable + public List<ManageRegisterModelPositionsInner> getPositions() { + return positions; + } + + public void setPositions(@javax.annotation.Nullable List<ManageRegisterModelPositionsInner> positions) { + this.positions = positions; + } + + + public ManageRegisterModel educations(@javax.annotation.Nullable List<ManageRegisterModelEducationsInner> educations) { + this.educations = educations; + return this; + } + + public ManageRegisterModel addEducationsItem(ManageRegisterModelEducationsInner educationsItem) { + if (this.educations == null) { + this.educations = new ArrayList<>(); + } + this.educations.add(educationsItem); + return this; + } + + /** + * List of educational qualifications of the User. + * @return educations + */ + @javax.annotation.Nullable + public List<ManageRegisterModelEducationsInner> getEducations() { + return educations; + } + + public void setEducations(@javax.annotation.Nullable List<ManageRegisterModelEducationsInner> educations) { + this.educations = educations; + } + + + public ManageRegisterModel phoneNumbers(@javax.annotation.Nullable List<ProfilePhoneNumbersInner> phoneNumbers) { + this.phoneNumbers = phoneNumbers; + return this; + } + + public ManageRegisterModel addPhoneNumbersItem(ProfilePhoneNumbersInner phoneNumbersItem) { + if (this.phoneNumbers == null) { + this.phoneNumbers = new ArrayList<>(); + } + this.phoneNumbers.add(phoneNumbersItem); + return this; + } + + /** + * List of Phone numbers associated with the User. + * @return phoneNumbers + */ + @javax.annotation.Nullable + public List<ProfilePhoneNumbersInner> getPhoneNumbers() { + return phoneNumbers; + } + + public void setPhoneNumbers(@javax.annotation.Nullable List<ProfilePhoneNumbersInner> phoneNumbers) { + this.phoneNumbers = phoneNumbers; + } + + + public ManageRegisterModel imAccounts(@javax.annotation.Nullable List<ProfileIMAccountsInner> imAccounts) { + this.imAccounts = imAccounts; + return this; + } + + public ManageRegisterModel addImAccountsItem(ProfileIMAccountsInner imAccountsItem) { + if (this.imAccounts == null) { + this.imAccounts = new ArrayList<>(); + } + this.imAccounts.add(imAccountsItem); + return this; + } + + /** + * List of instant messaging accounts associated with the User. + * @return imAccounts + */ + @javax.annotation.Nullable + public List<ProfileIMAccountsInner> getImAccounts() { + return imAccounts; + } + + public void setImAccounts(@javax.annotation.Nullable List<ProfileIMAccountsInner> imAccounts) { + this.imAccounts = imAccounts; + } + + + public ManageRegisterModel interests(@javax.annotation.Nullable List<ProfileInterestsInner> interests) { + this.interests = interests; + return this; + } + + public ManageRegisterModel addInterestsItem(ProfileInterestsInner interestsItem) { + if (this.interests == null) { + this.interests = new ArrayList<>(); + } + this.interests.add(interestsItem); + return this; + } + + /** + * List of interests of the User. + * @return interests + */ + @javax.annotation.Nullable + public List<ProfileInterestsInner> getInterests() { + return interests; + } + + public void setInterests(@javax.annotation.Nullable List<ProfileInterestsInner> interests) { + this.interests = interests; + } + + + public ManageRegisterModel sports(@javax.annotation.Nullable List<ProfileSportsInner> sports) { + this.sports = sports; + return this; + } + + public ManageRegisterModel addSportsItem(ProfileSportsInner sportsItem) { + if (this.sports == null) { + this.sports = new ArrayList<>(); + } + this.sports.add(sportsItem); + return this; + } + + /** + * List of sports the User is interested in. + * @return sports + */ + @javax.annotation.Nullable + public List<ProfileSportsInner> getSports() { + return sports; + } + + public void setSports(@javax.annotation.Nullable List<ProfileSportsInner> sports) { + this.sports = sports; + } + + + public ManageRegisterModel inspirationalPeople(@javax.annotation.Nullable List<ProfileInspirationalPeopleInner> inspirationalPeople) { + this.inspirationalPeople = inspirationalPeople; + return this; + } + + public ManageRegisterModel addInspirationalPeopleItem(ProfileInspirationalPeopleInner inspirationalPeopleItem) { + if (this.inspirationalPeople == null) { + this.inspirationalPeople = new ArrayList<>(); + } + this.inspirationalPeople.add(inspirationalPeopleItem); + return this; + } + + /** + * List of inspirational people for the User. + * @return inspirationalPeople + */ + @javax.annotation.Nullable + public List<ProfileInspirationalPeopleInner> getInspirationalPeople() { + return inspirationalPeople; + } + + public void setInspirationalPeople(@javax.annotation.Nullable List<ProfileInspirationalPeopleInner> inspirationalPeople) { + this.inspirationalPeople = inspirationalPeople; + } + + + public ManageRegisterModel awards(@javax.annotation.Nullable List<ProfileAwardsInner> awards) { + this.awards = awards; + return this; + } + + public ManageRegisterModel addAwardsItem(ProfileAwardsInner awardsItem) { + if (this.awards == null) { + this.awards = new ArrayList<>(); + } + this.awards.add(awardsItem); + return this; + } + + /** + * List of awards received by the User. + * @return awards + */ + @javax.annotation.Nullable + public List<ProfileAwardsInner> getAwards() { + return awards; + } + + public void setAwards(@javax.annotation.Nullable List<ProfileAwardsInner> awards) { + this.awards = awards; + } + + + public ManageRegisterModel skills(@javax.annotation.Nullable List<ProfileSkillsInner> skills) { + this.skills = skills; + return this; + } + + public ManageRegisterModel addSkillsItem(ProfileSkillsInner skillsItem) { + if (this.skills == null) { + this.skills = new ArrayList<>(); + } + this.skills.add(skillsItem); + return this; + } + + /** + * List of skills possessed by the User. + * @return skills + */ + @javax.annotation.Nullable + public List<ProfileSkillsInner> getSkills() { + return skills; + } + + public void setSkills(@javax.annotation.Nullable List<ProfileSkillsInner> skills) { + this.skills = skills; + } + + + public ManageRegisterModel currentStatus(@javax.annotation.Nullable List<ProfileCurrentStatusInner> currentStatus) { + this.currentStatus = currentStatus; + return this; + } + + public ManageRegisterModel addCurrentStatusItem(ProfileCurrentStatusInner currentStatusItem) { + if (this.currentStatus == null) { + this.currentStatus = new ArrayList<>(); + } + this.currentStatus.add(currentStatusItem); + return this; + } + + /** + * List of current statuses of the User. + * @return currentStatus + */ + @javax.annotation.Nullable + public List<ProfileCurrentStatusInner> getCurrentStatus() { + return currentStatus; + } + + public void setCurrentStatus(@javax.annotation.Nullable List<ProfileCurrentStatusInner> currentStatus) { + this.currentStatus = currentStatus; + } + + + public ManageRegisterModel certifications(@javax.annotation.Nullable List<ManageRegisterModelCertificationsInner> certifications) { + this.certifications = certifications; + return this; + } + + public ManageRegisterModel addCertificationsItem(ManageRegisterModelCertificationsInner certificationsItem) { + if (this.certifications == null) { + this.certifications = new ArrayList<>(); + } + this.certifications.add(certificationsItem); + return this; + } + + /** + * List of certifications obtained by the User. + * @return certifications + */ + @javax.annotation.Nullable + public List<ManageRegisterModelCertificationsInner> getCertifications() { + return certifications; + } + + public void setCertifications(@javax.annotation.Nullable List<ManageRegisterModelCertificationsInner> certifications) { + this.certifications = certifications; + } + + + public ManageRegisterModel courses(@javax.annotation.Nullable List<ManageRegisterModelCoursesInner> courses) { + this.courses = courses; + return this; + } + + public ManageRegisterModel addCoursesItem(ManageRegisterModelCoursesInner coursesItem) { + if (this.courses == null) { + this.courses = new ArrayList<>(); + } + this.courses.add(coursesItem); + return this; + } + + /** + * List of courses completed by the User. + * @return courses + */ + @javax.annotation.Nullable + public List<ManageRegisterModelCoursesInner> getCourses() { + return courses; + } + + public void setCourses(@javax.annotation.Nullable List<ManageRegisterModelCoursesInner> courses) { + this.courses = courses; + } + + + public ManageRegisterModel volunteer(@javax.annotation.Nullable List<ManageRegisterModelVolunteerInner> volunteer) { + this.volunteer = volunteer; + return this; + } + + public ManageRegisterModel addVolunteerItem(ManageRegisterModelVolunteerInner volunteerItem) { + if (this.volunteer == null) { + this.volunteer = new ArrayList<>(); + } + this.volunteer.add(volunteerItem); + return this; + } + + /** + * List of volunteer experiences of the User. + * @return volunteer + */ + @javax.annotation.Nullable + public List<ManageRegisterModelVolunteerInner> getVolunteer() { + return volunteer; + } + + public void setVolunteer(@javax.annotation.Nullable List<ManageRegisterModelVolunteerInner> volunteer) { + this.volunteer = volunteer; + } + + + public ManageRegisterModel recommendationsReceived(@javax.annotation.Nullable List<ManageRegisterModelRecommendationsReceivedInner> recommendationsReceived) { + this.recommendationsReceived = recommendationsReceived; + return this; + } + + public ManageRegisterModel addRecommendationsReceivedItem(ManageRegisterModelRecommendationsReceivedInner recommendationsReceivedItem) { + if (this.recommendationsReceived == null) { + this.recommendationsReceived = new ArrayList<>(); + } + this.recommendationsReceived.add(recommendationsReceivedItem); + return this; + } + + /** + * List of recommendations received by the User. + * @return recommendationsReceived + */ + @javax.annotation.Nullable + public List<ManageRegisterModelRecommendationsReceivedInner> getRecommendationsReceived() { + return recommendationsReceived; + } + + public void setRecommendationsReceived(@javax.annotation.Nullable List<ManageRegisterModelRecommendationsReceivedInner> recommendationsReceived) { + this.recommendationsReceived = recommendationsReceived; + } + + + public ManageRegisterModel languages(@javax.annotation.Nullable List<ManageRegisterModelLanguagesInner> languages) { + this.languages = languages; + return this; + } + + public ManageRegisterModel addLanguagesItem(ManageRegisterModelLanguagesInner languagesItem) { + if (this.languages == null) { + this.languages = new ArrayList<>(); + } + this.languages.add(languagesItem); + return this; + } + + /** + * List of languages known by the User. + * @return languages + */ + @javax.annotation.Nullable + public List<ManageRegisterModelLanguagesInner> getLanguages() { + return languages; + } + + public void setLanguages(@javax.annotation.Nullable List<ManageRegisterModelLanguagesInner> languages) { + this.languages = languages; + } + + + public ManageRegisterModel projects(@javax.annotation.Nullable List<ManageRegisterModelProjectsInner> projects) { + this.projects = projects; + return this; + } + + public ManageRegisterModel addProjectsItem(ManageRegisterModelProjectsInner projectsItem) { + if (this.projects == null) { + this.projects = new ArrayList<>(); + } + this.projects.add(projectsItem); + return this; + } + + /** + * List of projects associated with the User. + * @return projects + */ + @javax.annotation.Nullable + public List<ManageRegisterModelProjectsInner> getProjects() { + return projects; + } + + public void setProjects(@javax.annotation.Nullable List<ManageRegisterModelProjectsInner> projects) { + this.projects = projects; + } + + + public ManageRegisterModel games(@javax.annotation.Nullable List<ManageRegisterModelGamesInner> games) { + this.games = games; + return this; + } + + public ManageRegisterModel addGamesItem(ManageRegisterModelGamesInner gamesItem) { + if (this.games == null) { + this.games = new ArrayList<>(); + } + this.games.add(gamesItem); + return this; + } + + /** + * List of games the User is interested in. + * @return games + */ + @javax.annotation.Nullable + public List<ManageRegisterModelGamesInner> getGames() { + return games; + } + + public void setGames(@javax.annotation.Nullable List<ManageRegisterModelGamesInner> games) { + this.games = games; + } + + + public ManageRegisterModel family(@javax.annotation.Nullable List<ManageRegisterModelFamilyInner> family) { + this.family = family; + return this; + } + + public ManageRegisterModel addFamilyItem(ManageRegisterModelFamilyInner familyItem) { + if (this.family == null) { + this.family = new ArrayList<>(); + } + this.family.add(familyItem); + return this; + } + + /** + * List of family members associated with the User. + * @return family + */ + @javax.annotation.Nullable + public List<ManageRegisterModelFamilyInner> getFamily() { + return family; + } + + public void setFamily(@javax.annotation.Nullable List<ManageRegisterModelFamilyInner> family) { + this.family = family; + } + + + public ManageRegisterModel televisionShow(@javax.annotation.Nullable List<ManageRegisterModelTelevisionShowInner> televisionShow) { + this.televisionShow = televisionShow; + return this; + } + + public ManageRegisterModel addTelevisionShowItem(ManageRegisterModelTelevisionShowInner televisionShowItem) { + if (this.televisionShow == null) { + this.televisionShow = new ArrayList<>(); + } + this.televisionShow.add(televisionShowItem); + return this; + } + + /** + * List of television shows the User is interested in. + * @return televisionShow + */ + @javax.annotation.Nullable + public List<ManageRegisterModelTelevisionShowInner> getTelevisionShow() { + return televisionShow; + } + + public void setTelevisionShow(@javax.annotation.Nullable List<ManageRegisterModelTelevisionShowInner> televisionShow) { + this.televisionShow = televisionShow; + } + + + public ManageRegisterModel mutualFriends(@javax.annotation.Nullable List<ManageRegisterModelMutualFriendsInner> mutualFriends) { + this.mutualFriends = mutualFriends; + return this; + } + + public ManageRegisterModel addMutualFriendsItem(ManageRegisterModelMutualFriendsInner mutualFriendsItem) { + if (this.mutualFriends == null) { + this.mutualFriends = new ArrayList<>(); + } + this.mutualFriends.add(mutualFriendsItem); + return this; + } + + /** + * List of mutual friends associated with the User. + * @return mutualFriends + */ + @javax.annotation.Nullable + public List<ManageRegisterModelMutualFriendsInner> getMutualFriends() { + return mutualFriends; + } + + public void setMutualFriends(@javax.annotation.Nullable List<ManageRegisterModelMutualFriendsInner> mutualFriends) { + this.mutualFriends = mutualFriends; + } + + + public ManageRegisterModel movies(@javax.annotation.Nullable List<ManageRegisterModelMoviesInner> movies) { + this.movies = movies; + return this; + } + + public ManageRegisterModel addMoviesItem(ManageRegisterModelMoviesInner moviesItem) { + if (this.movies == null) { + this.movies = new ArrayList<>(); + } + this.movies.add(moviesItem); + return this; + } + + /** + * List of movies the User is interested in. + * @return movies + */ + @javax.annotation.Nullable + public List<ManageRegisterModelMoviesInner> getMovies() { + return movies; + } + + public void setMovies(@javax.annotation.Nullable List<ManageRegisterModelMoviesInner> movies) { + this.movies = movies; + } + + + public ManageRegisterModel books(@javax.annotation.Nullable List<ManageRegisterModelBooksInner> books) { + this.books = books; + return this; + } + + public ManageRegisterModel addBooksItem(ManageRegisterModelBooksInner booksItem) { + if (this.books == null) { + this.books = new ArrayList<>(); + } + this.books.add(booksItem); + return this; + } + + /** + * List of books the User is interested in. + * @return books + */ + @javax.annotation.Nullable + public List<ManageRegisterModelBooksInner> getBooks() { + return books; + } + + public void setBooks(@javax.annotation.Nullable List<ManageRegisterModelBooksInner> books) { + this.books = books; + } + + + public ManageRegisterModel patents(@javax.annotation.Nullable List<ManageRegisterModelPatentsInner> patents) { + this.patents = patents; + return this; + } + + public ManageRegisterModel addPatentsItem(ManageRegisterModelPatentsInner patentsItem) { + if (this.patents == null) { + this.patents = new ArrayList<>(); + } + this.patents.add(patentsItem); + return this; + } + + /** + * List of patents associated with the User. + * @return patents + */ + @javax.annotation.Nullable + public List<ManageRegisterModelPatentsInner> getPatents() { + return patents; + } + + public void setPatents(@javax.annotation.Nullable List<ManageRegisterModelPatentsInner> patents) { + this.patents = patents; + } + + + public ManageRegisterModel favoriteThings(@javax.annotation.Nullable List<ManageRegisterModelFavoriteThingsInner> favoriteThings) { + this.favoriteThings = favoriteThings; + return this; + } + + public ManageRegisterModel addFavoriteThingsItem(ManageRegisterModelFavoriteThingsInner favoriteThingsItem) { + if (this.favoriteThings == null) { + this.favoriteThings = new ArrayList<>(); + } + this.favoriteThings.add(favoriteThingsItem); + return this; + } + + /** + * List of favorite things of the User. + * @return favoriteThings + */ + @javax.annotation.Nullable + public List<ManageRegisterModelFavoriteThingsInner> getFavoriteThings() { + return favoriteThings; + } + + public void setFavoriteThings(@javax.annotation.Nullable List<ManageRegisterModelFavoriteThingsInner> favoriteThings) { + this.favoriteThings = favoriteThings; + } + + + public ManageRegisterModel relatedProfileViews(@javax.annotation.Nullable List<ManageRegisterModelRelatedProfileViewsInner> relatedProfileViews) { + this.relatedProfileViews = relatedProfileViews; + return this; + } + + public ManageRegisterModel addRelatedProfileViewsItem(ManageRegisterModelRelatedProfileViewsInner relatedProfileViewsItem) { + if (this.relatedProfileViews == null) { + this.relatedProfileViews = new ArrayList<>(); + } + this.relatedProfileViews.add(relatedProfileViewsItem); + return this; + } + + /** + * List of related profile views for the User. + * @return relatedProfileViews + */ + @javax.annotation.Nullable + public List<ManageRegisterModelRelatedProfileViewsInner> getRelatedProfileViews() { + return relatedProfileViews; + } + + public void setRelatedProfileViews(@javax.annotation.Nullable List<ManageRegisterModelRelatedProfileViewsInner> relatedProfileViews) { + this.relatedProfileViews = relatedProfileViews; + } + + + public ManageRegisterModel placesLived(@javax.annotation.Nullable List<ManageRegisterModelPlacesLivedInner> placesLived) { + this.placesLived = placesLived; + return this; + } + + public ManageRegisterModel addPlacesLivedItem(ManageRegisterModelPlacesLivedInner placesLivedItem) { + if (this.placesLived == null) { + this.placesLived = new ArrayList<>(); + } + this.placesLived.add(placesLivedItem); + return this; + } + + /** + * List of places the User has lived. + * @return placesLived + */ + @javax.annotation.Nullable + public List<ManageRegisterModelPlacesLivedInner> getPlacesLived() { + return placesLived; + } + + public void setPlacesLived(@javax.annotation.Nullable List<ManageRegisterModelPlacesLivedInner> placesLived) { + this.placesLived = placesLived; + } + + + public ManageRegisterModel publications(@javax.annotation.Nullable List<ManageRegisterModelPublicationsInner> publications) { + this.publications = publications; + return this; + } + + public ManageRegisterModel addPublicationsItem(ManageRegisterModelPublicationsInner publicationsItem) { + if (this.publications == null) { + this.publications = new ArrayList<>(); + } + this.publications.add(publicationsItem); + return this; + } + + /** + * List of publications associated with the User. + * @return publications + */ + @javax.annotation.Nullable + public List<ManageRegisterModelPublicationsInner> getPublications() { + return publications; + } + + public void setPublications(@javax.annotation.Nullable List<ManageRegisterModelPublicationsInner> publications) { + this.publications = publications; + } + + + public ManageRegisterModel jobBookmarks(@javax.annotation.Nullable List<ManageRegisterModelJobBookmarksInner> jobBookmarks) { + this.jobBookmarks = jobBookmarks; + return this; + } + + public ManageRegisterModel addJobBookmarksItem(ManageRegisterModelJobBookmarksInner jobBookmarksItem) { + if (this.jobBookmarks == null) { + this.jobBookmarks = new ArrayList<>(); + } + this.jobBookmarks.add(jobBookmarksItem); + return this; + } + + /** + * List of job bookmarks associated with the User. + * @return jobBookmarks + */ + @javax.annotation.Nullable + public List<ManageRegisterModelJobBookmarksInner> getJobBookmarks() { + return jobBookmarks; + } + + public void setJobBookmarks(@javax.annotation.Nullable List<ManageRegisterModelJobBookmarksInner> jobBookmarks) { + this.jobBookmarks = jobBookmarks; + } + + + public ManageRegisterModel badges(@javax.annotation.Nullable List<ManageRegisterModelBadgesInner> badges) { + this.badges = badges; + return this; + } + + public ManageRegisterModel addBadgesItem(ManageRegisterModelBadgesInner badgesItem) { + if (this.badges == null) { + this.badges = new ArrayList<>(); + } + this.badges.add(badgesItem); + return this; + } + + /** + * List of badges associated with the User. + * @return badges + */ + @javax.annotation.Nullable + public List<ManageRegisterModelBadgesInner> getBadges() { + return badges; + } + + public void setBadges(@javax.annotation.Nullable List<ManageRegisterModelBadgesInner> badges) { + this.badges = badges; + } + + + public ManageRegisterModel memberUrlResources(@javax.annotation.Nullable List<ManageRegisterModelMemberUrlResourcesInner> memberUrlResources) { + this.memberUrlResources = memberUrlResources; + return this; + } + + public ManageRegisterModel addMemberUrlResourcesItem(ManageRegisterModelMemberUrlResourcesInner memberUrlResourcesItem) { + if (this.memberUrlResources == null) { + this.memberUrlResources = new ArrayList<>(); + } + this.memberUrlResources.add(memberUrlResourcesItem); + return this; + } + + /** + * List of member URL resources associated with the User. + * @return memberUrlResources + */ + @javax.annotation.Nullable + public List<ManageRegisterModelMemberUrlResourcesInner> getMemberUrlResources() { + return memberUrlResources; + } + + public void setMemberUrlResources(@javax.annotation.Nullable List<ManageRegisterModelMemberUrlResourcesInner> memberUrlResources) { + this.memberUrlResources = memberUrlResources; + } + + + public ManageRegisterModel externalIds(@javax.annotation.Nullable List<ProfileExternalIdsInner> externalIds) { + this.externalIds = externalIds; + return this; + } + + public ManageRegisterModel addExternalIdsItem(ProfileExternalIdsInner externalIdsItem) { + if (this.externalIds == null) { + this.externalIds = new ArrayList<>(); + } + this.externalIds.add(externalIdsItem); + return this; + } + + /** + * List of external IDs associated with the User. + * @return externalIds + */ + @javax.annotation.Nullable + public List<ProfileExternalIdsInner> getExternalIds() { + return externalIds; + } + + public void setExternalIds(@javax.annotation.Nullable List<ProfileExternalIdsInner> externalIds) { + this.externalIds = externalIds; + } + + + public ManageRegisterModel isEmailSubscribed(@javax.annotation.Nullable Boolean isEmailSubscribed) { + this.isEmailSubscribed = isEmailSubscribed; + return this; + } + + /** + * Indicates if the User is subscribed to emails. + * @return isEmailSubscribed + */ + @javax.annotation.Nullable + public Boolean getIsEmailSubscribed() { + return isEmailSubscribed; + } + + public void setIsEmailSubscribed(@javax.annotation.Nullable Boolean isEmailSubscribed) { + this.isEmailSubscribed = isEmailSubscribed; + } + + + public ManageRegisterModel isProtected(@javax.annotation.Nullable Boolean isProtected) { + this.isProtected = isProtected; + return this; + } + + /** + * Indicates if the User Account is protected. + * @return isProtected + */ + @javax.annotation.Nullable + public Boolean getIsProtected() { + return isProtected; + } + + public void setIsProtected(@javax.annotation.Nullable Boolean isProtected) { + this.isProtected = isProtected; + } + + + public ManageRegisterModel hireable(@javax.annotation.Nullable Boolean hireable) { + this.hireable = hireable; + return this; + } + + /** + * Indicates if the User is hireable. + * @return hireable + */ + @javax.annotation.Nullable + public Boolean getHireable() { + return hireable; + } + + public void setHireable(@javax.annotation.Nullable Boolean hireable) { + this.hireable = hireable; + } + + + public ManageRegisterModel isTwoFactorAuthenticationEnabled(@javax.annotation.Nullable Boolean isTwoFactorAuthenticationEnabled) { + this.isTwoFactorAuthenticationEnabled = isTwoFactorAuthenticationEnabled; + return this; + } + + /** + * Indicates if two-factor authentication is enabled for the User. + * @return isTwoFactorAuthenticationEnabled + */ + @javax.annotation.Nullable + public Boolean getIsTwoFactorAuthenticationEnabled() { + return isTwoFactorAuthenticationEnabled; + } + + public void setIsTwoFactorAuthenticationEnabled(@javax.annotation.Nullable Boolean isTwoFactorAuthenticationEnabled) { + this.isTwoFactorAuthenticationEnabled = isTwoFactorAuthenticationEnabled; + } + + + public ManageRegisterModel isActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Indicates if the User Account is active. + * @return isActive + */ + @javax.annotation.Nullable + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + } + + + public ManageRegisterModel isDeleted(@javax.annotation.Nullable Boolean isDeleted) { + this.isDeleted = isDeleted; + return this; + } + + /** + * Indicates if the User Account is deleted. + * @return isDeleted + */ + @javax.annotation.Nullable + public Boolean getIsDeleted() { + return isDeleted; + } + + public void setIsDeleted(@javax.annotation.Nullable Boolean isDeleted) { + this.isDeleted = isDeleted; + } + + + public ManageRegisterModel emailVerified(@javax.annotation.Nullable Boolean emailVerified) { + this.emailVerified = emailVerified; + return this; + } + + /** + * Indicates if the User's Email is verified. + * @return emailVerified + */ + @javax.annotation.Nullable + public Boolean getEmailVerified() { + return emailVerified; + } + + public void setEmailVerified(@javax.annotation.Nullable Boolean emailVerified) { + this.emailVerified = emailVerified; + } + + + public ManageRegisterModel phoneIdVerified(@javax.annotation.Nullable Boolean phoneIdVerified) { + this.phoneIdVerified = phoneIdVerified; + return this; + } + + /** + * Indicates if the User's Phone ID is verified. + * @return phoneIdVerified + */ + @javax.annotation.Nullable + public Boolean getPhoneIdVerified() { + return phoneIdVerified; + } + + public void setPhoneIdVerified(@javax.annotation.Nullable Boolean phoneIdVerified) { + this.phoneIdVerified = phoneIdVerified; + } + + + public ManageRegisterModel disableLogin(@javax.annotation.Nullable Boolean disableLogin) { + this.disableLogin = disableLogin; + return this; + } + + /** + * Indicates if login is disabled for the User. + * @return disableLogin + */ + @javax.annotation.Nullable + public Boolean getDisableLogin() { + return disableLogin; + } + + public void setDisableLogin(@javax.annotation.Nullable Boolean disableLogin) { + this.disableLogin = disableLogin; + } + + + public ManageRegisterModel isLoginLocked(@javax.annotation.Nullable Boolean isLoginLocked) { + this.isLoginLocked = isLoginLocked; + return this; + } + + /** + * Indicates if the User's login is locked. + * @return isLoginLocked + */ + @javax.annotation.Nullable + public Boolean getIsLoginLocked() { + return isLoginLocked; + } + + public void setIsLoginLocked(@javax.annotation.Nullable Boolean isLoginLocked) { + this.isLoginLocked = isLoginLocked; + } + + + public ManageRegisterModel acceptPrivacyPolicy(@javax.annotation.Nullable Boolean acceptPrivacyPolicy) { + this.acceptPrivacyPolicy = acceptPrivacyPolicy; + return this; + } + + /** + * Indicates if the User has accepted the Privacy Policy. + * @return acceptPrivacyPolicy + */ + @javax.annotation.Nullable + public Boolean getAcceptPrivacyPolicy() { + return acceptPrivacyPolicy; + } + + public void setAcceptPrivacyPolicy(@javax.annotation.Nullable Boolean acceptPrivacyPolicy) { + this.acceptPrivacyPolicy = acceptPrivacyPolicy; + } + + + public ManageRegisterModel reCaptchaResponseField(@javax.annotation.Nullable String reCaptchaResponseField) { + this.reCaptchaResponseField = reCaptchaResponseField; + return this; + } + + /** + * The response field for reCAPTCHA verification. + * @return reCaptchaResponseField + */ + @javax.annotation.Nullable + public String getReCaptchaResponseField() { + return reCaptchaResponseField; + } + + public void setReCaptchaResponseField(@javax.annotation.Nullable String reCaptchaResponseField) { + this.reCaptchaResponseField = reCaptchaResponseField; + } + + + public ManageRegisterModel reCaptchaChallengeField(@javax.annotation.Nullable String reCaptchaChallengeField) { + this.reCaptchaChallengeField = reCaptchaChallengeField; + return this; + } + + /** + * The challenge field for reCAPTCHA verification. + * @return reCaptchaChallengeField + */ + @javax.annotation.Nullable + public String getReCaptchaChallengeField() { + return reCaptchaChallengeField; + } + + public void setReCaptchaChallengeField(@javax.annotation.Nullable String reCaptchaChallengeField) { + this.reCaptchaChallengeField = reCaptchaChallengeField; + } + + + public ManageRegisterModel registrationSource(@javax.annotation.Nullable String registrationSource) { + this.registrationSource = registrationSource; + return this; + } + + /** + * The source of the User's registration. + * @return registrationSource + */ + @javax.annotation.Nullable + public String getRegistrationSource() { + return registrationSource; + } + + public void setRegistrationSource(@javax.annotation.Nullable String registrationSource) { + this.registrationSource = registrationSource; + } + + + public ManageRegisterModel fullName(@javax.annotation.Nullable String fullName) { + this.fullName = fullName; + return this; + } + + /** + * The full name of the User. + * @return fullName + */ + @javax.annotation.Nullable + public String getFullName() { + return fullName; + } + + public void setFullName(@javax.annotation.Nullable String fullName) { + this.fullName = fullName; + } + + + public ManageRegisterModel consents(@javax.annotation.Nullable ManageRegisterModelConsents consents) { + this.consents = consents; + return this; + } + + /** + * Get consents + * @return consents + */ + @javax.annotation.Nullable + public ManageRegisterModelConsents getConsents() { + return consents; + } + + public void setConsents(@javax.annotation.Nullable ManageRegisterModelConsents consents) { + this.consents = consents; + } + + + public ManageRegisterModel password(@javax.annotation.Nullable String password) { + this.password = password; + return this; + } + + /** + * The Password of the User. + * @return password + */ + @javax.annotation.Nullable + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nullable String password) { + this.password = password; + } + + + public ManageRegisterModel email(@javax.annotation.Nullable List<ManageRegisterModelEmailInner> email) { + this.email = email; + return this; + } + + public ManageRegisterModel addEmailItem(ManageRegisterModelEmailInner emailItem) { + if (this.email == null) { + this.email = new ArrayList<>(); + } + this.email.add(emailItem); + return this; + } + + /** + * List of Email addresses associated with the User. + * @return email + */ + @javax.annotation.Nullable + public List<ManageRegisterModelEmailInner> getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable List<ManageRegisterModelEmailInner> email) { + this.email = email; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModel instance itself + */ + public ManageRegisterModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModel manageRegisterModel = (ManageRegisterModel) o; + return Objects.equals(this.uid, manageRegisterModel.uid) && + Objects.equals(this.userName, manageRegisterModel.userName) && + Objects.equals(this.phoneId, manageRegisterModel.phoneId) && + Objects.equals(this.gender, manageRegisterModel.gender) && + Objects.equals(this.birthDate, manageRegisterModel.birthDate) && + Objects.equals(this.prefix, manageRegisterModel.prefix) && + Objects.equals(this.firstName, manageRegisterModel.firstName) && + Objects.equals(this.middleName, manageRegisterModel.middleName) && + Objects.equals(this.lastName, manageRegisterModel.lastName) && + Objects.equals(this.suffix, manageRegisterModel.suffix) && + Objects.equals(this.nickName, manageRegisterModel.nickName) && + Objects.equals(this.profileName, manageRegisterModel.profileName) && + Objects.equals(this.about, manageRegisterModel.about) && + Objects.equals(this.company, manageRegisterModel.company) && + Objects.equals(this.imageUrl, manageRegisterModel.imageUrl) && + Objects.equals(this.timeZone, manageRegisterModel.timeZone) && + Objects.equals(this.website, manageRegisterModel.website) && + Objects.equals(this.thumbnailImageUrl, manageRegisterModel.thumbnailImageUrl) && + Objects.equals(this.favicon, manageRegisterModel.favicon) && + Objects.equals(this.profileUrl, manageRegisterModel.profileUrl) && + Objects.equals(this.homeTown, manageRegisterModel.homeTown) && + Objects.equals(this.state, manageRegisterModel.state) && + Objects.equals(this.city, manageRegisterModel.city) && + Objects.equals(this.industry, manageRegisterModel.industry) && + Objects.equals(this.localLanguage, manageRegisterModel.localLanguage) && + Objects.equals(this.language, manageRegisterModel.language) && + Objects.equals(this.coverPhoto, manageRegisterModel.coverPhoto) && + Objects.equals(this.tagLine, manageRegisterModel.tagLine) && + Objects.equals(this.mainAddress, manageRegisterModel.mainAddress) && + Objects.equals(this.localCity, manageRegisterModel.localCity) && + Objects.equals(this.profileCity, manageRegisterModel.profileCity) && + Objects.equals(this.localCountry, manageRegisterModel.localCountry) && + Objects.equals(this.profileCountry, manageRegisterModel.profileCountry) && + Objects.equals(this.quota, manageRegisterModel.quota) && + Objects.equals(this.religion, manageRegisterModel.religion) && + Objects.equals(this.political, manageRegisterModel.political) && + Objects.equals(this.relationshipStatus, manageRegisterModel.relationshipStatus) && + Objects.equals(this.httpsImageUrl, manageRegisterModel.httpsImageUrl) && + Objects.equals(this.isGeoEnabled, manageRegisterModel.isGeoEnabled) && + Objects.equals(this.associations, manageRegisterModel.associations) && + Objects.equals(this.honors, manageRegisterModel.honors) && + Objects.equals(this.publicRepository, manageRegisterModel.publicRepository) && + Objects.equals(this.repositoryUrl, manageRegisterModel.repositoryUrl) && + Objects.equals(this.professionalHeadline, manageRegisterModel.professionalHeadline) && + Objects.equals(this.currency, manageRegisterModel.currency) && + Objects.equals(this.starredUrl, manageRegisterModel.starredUrl) && + Objects.equals(this.gistsUrl, manageRegisterModel.gistsUrl) && + Objects.equals(this.gravatarImageUrl, manageRegisterModel.gravatarImageUrl) && + Objects.equals(this.externalUserLoginId, manageRegisterModel.externalUserLoginId) && + Objects.equals(this.interestedIn, manageRegisterModel.interestedIn) && + Objects.equals(this.followersCount, manageRegisterModel.followersCount) && + Objects.equals(this.friendsCount, manageRegisterModel.friendsCount) && + Objects.equals(this.totalStatusesCount, manageRegisterModel.totalStatusesCount) && + Objects.equals(this.numRecommenders, manageRegisterModel.numRecommenders) && + Objects.equals(this.totalPrivateRepository, manageRegisterModel.totalPrivateRepository) && + Objects.equals(this.publicGists, manageRegisterModel.publicGists) && + Objects.equals(this.privateGists, manageRegisterModel.privateGists) && + Objects.equals(this.sessionLimit, manageRegisterModel.sessionLimit) && + Objects.equals(this.customFields, manageRegisterModel.customFields) && + Objects.equals(this.profileImageUrls, manageRegisterModel.profileImageUrls) && + Objects.equals(this.webProfiles, manageRegisterModel.webProfiles) && + Objects.equals(this.securityQuestionAnswer, manageRegisterModel.securityQuestionAnswer) && + Objects.equals(this.country, manageRegisterModel.country) && + Objects.equals(this.providerAccessCredential, manageRegisterModel.providerAccessCredential) && + Objects.equals(this.suggestions, manageRegisterModel.suggestions) && + Objects.equals(this.subscription, manageRegisterModel.subscription) && + Objects.equals(this.ageRange, manageRegisterModel.ageRange) && + Objects.equals(this.privacyPolicy, manageRegisterModel.privacyPolicy) && + Objects.equals(this.piNInfo, manageRegisterModel.piNInfo) && + Objects.equals(this.addresses, manageRegisterModel.addresses) && + Objects.equals(this.positions, manageRegisterModel.positions) && + Objects.equals(this.educations, manageRegisterModel.educations) && + Objects.equals(this.phoneNumbers, manageRegisterModel.phoneNumbers) && + Objects.equals(this.imAccounts, manageRegisterModel.imAccounts) && + Objects.equals(this.interests, manageRegisterModel.interests) && + Objects.equals(this.sports, manageRegisterModel.sports) && + Objects.equals(this.inspirationalPeople, manageRegisterModel.inspirationalPeople) && + Objects.equals(this.awards, manageRegisterModel.awards) && + Objects.equals(this.skills, manageRegisterModel.skills) && + Objects.equals(this.currentStatus, manageRegisterModel.currentStatus) && + Objects.equals(this.certifications, manageRegisterModel.certifications) && + Objects.equals(this.courses, manageRegisterModel.courses) && + Objects.equals(this.volunteer, manageRegisterModel.volunteer) && + Objects.equals(this.recommendationsReceived, manageRegisterModel.recommendationsReceived) && + Objects.equals(this.languages, manageRegisterModel.languages) && + Objects.equals(this.projects, manageRegisterModel.projects) && + Objects.equals(this.games, manageRegisterModel.games) && + Objects.equals(this.family, manageRegisterModel.family) && + Objects.equals(this.televisionShow, manageRegisterModel.televisionShow) && + Objects.equals(this.mutualFriends, manageRegisterModel.mutualFriends) && + Objects.equals(this.movies, manageRegisterModel.movies) && + Objects.equals(this.books, manageRegisterModel.books) && + Objects.equals(this.patents, manageRegisterModel.patents) && + Objects.equals(this.favoriteThings, manageRegisterModel.favoriteThings) && + Objects.equals(this.relatedProfileViews, manageRegisterModel.relatedProfileViews) && + Objects.equals(this.placesLived, manageRegisterModel.placesLived) && + Objects.equals(this.publications, manageRegisterModel.publications) && + Objects.equals(this.jobBookmarks, manageRegisterModel.jobBookmarks) && + Objects.equals(this.badges, manageRegisterModel.badges) && + Objects.equals(this.memberUrlResources, manageRegisterModel.memberUrlResources) && + Objects.equals(this.externalIds, manageRegisterModel.externalIds) && + Objects.equals(this.isEmailSubscribed, manageRegisterModel.isEmailSubscribed) && + Objects.equals(this.isProtected, manageRegisterModel.isProtected) && + Objects.equals(this.hireable, manageRegisterModel.hireable) && + Objects.equals(this.isTwoFactorAuthenticationEnabled, manageRegisterModel.isTwoFactorAuthenticationEnabled) && + Objects.equals(this.isActive, manageRegisterModel.isActive) && + Objects.equals(this.isDeleted, manageRegisterModel.isDeleted) && + Objects.equals(this.emailVerified, manageRegisterModel.emailVerified) && + Objects.equals(this.phoneIdVerified, manageRegisterModel.phoneIdVerified) && + Objects.equals(this.disableLogin, manageRegisterModel.disableLogin) && + Objects.equals(this.isLoginLocked, manageRegisterModel.isLoginLocked) && + Objects.equals(this.acceptPrivacyPolicy, manageRegisterModel.acceptPrivacyPolicy) && + Objects.equals(this.reCaptchaResponseField, manageRegisterModel.reCaptchaResponseField) && + Objects.equals(this.reCaptchaChallengeField, manageRegisterModel.reCaptchaChallengeField) && + Objects.equals(this.registrationSource, manageRegisterModel.registrationSource) && + Objects.equals(this.fullName, manageRegisterModel.fullName) && + Objects.equals(this.consents, manageRegisterModel.consents) && + Objects.equals(this.password, manageRegisterModel.password) && + Objects.equals(this.email, manageRegisterModel.email)&& + Objects.equals(this.additionalProperties, manageRegisterModel.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(uid, userName, phoneId, gender, birthDate, prefix, firstName, middleName, lastName, suffix, nickName, profileName, about, company, imageUrl, timeZone, website, thumbnailImageUrl, favicon, profileUrl, homeTown, state, city, industry, localLanguage, language, coverPhoto, tagLine, mainAddress, localCity, profileCity, localCountry, profileCountry, quota, religion, political, relationshipStatus, httpsImageUrl, isGeoEnabled, associations, honors, publicRepository, repositoryUrl, professionalHeadline, currency, starredUrl, gistsUrl, gravatarImageUrl, externalUserLoginId, interestedIn, followersCount, friendsCount, totalStatusesCount, numRecommenders, totalPrivateRepository, publicGists, privateGists, sessionLimit, customFields, profileImageUrls, webProfiles, securityQuestionAnswer, country, providerAccessCredential, suggestions, subscription, ageRange, privacyPolicy, piNInfo, addresses, positions, educations, phoneNumbers, imAccounts, interests, sports, inspirationalPeople, awards, skills, currentStatus, certifications, courses, volunteer, recommendationsReceived, languages, projects, games, family, televisionShow, mutualFriends, movies, books, patents, favoriteThings, relatedProfileViews, placesLived, publications, jobBookmarks, badges, memberUrlResources, externalIds, isEmailSubscribed, isProtected, hireable, isTwoFactorAuthenticationEnabled, isActive, isDeleted, emailVerified, phoneIdVerified, disableLogin, isLoginLocked, acceptPrivacyPolicy, reCaptchaResponseField, reCaptchaChallengeField, registrationSource, fullName, consents, password, email, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModel {\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" userName: ").append(toIndentedString(userName)).append("\n"); + sb.append(" phoneId: ").append(toIndentedString(phoneId)).append("\n"); + sb.append(" gender: ").append(toIndentedString(gender)).append("\n"); + sb.append(" birthDate: ").append(toIndentedString(birthDate)).append("\n"); + sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" middleName: ").append(toIndentedString(middleName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" suffix: ").append(toIndentedString(suffix)).append("\n"); + sb.append(" nickName: ").append(toIndentedString(nickName)).append("\n"); + sb.append(" profileName: ").append(toIndentedString(profileName)).append("\n"); + sb.append(" about: ").append(toIndentedString(about)).append("\n"); + sb.append(" company: ").append(toIndentedString(company)).append("\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); + sb.append(" website: ").append(toIndentedString(website)).append("\n"); + sb.append(" thumbnailImageUrl: ").append(toIndentedString(thumbnailImageUrl)).append("\n"); + sb.append(" favicon: ").append(toIndentedString(favicon)).append("\n"); + sb.append(" profileUrl: ").append(toIndentedString(profileUrl)).append("\n"); + sb.append(" homeTown: ").append(toIndentedString(homeTown)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" industry: ").append(toIndentedString(industry)).append("\n"); + sb.append(" localLanguage: ").append(toIndentedString(localLanguage)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" coverPhoto: ").append(toIndentedString(coverPhoto)).append("\n"); + sb.append(" tagLine: ").append(toIndentedString(tagLine)).append("\n"); + sb.append(" mainAddress: ").append(toIndentedString(mainAddress)).append("\n"); + sb.append(" localCity: ").append(toIndentedString(localCity)).append("\n"); + sb.append(" profileCity: ").append(toIndentedString(profileCity)).append("\n"); + sb.append(" localCountry: ").append(toIndentedString(localCountry)).append("\n"); + sb.append(" profileCountry: ").append(toIndentedString(profileCountry)).append("\n"); + sb.append(" quota: ").append(toIndentedString(quota)).append("\n"); + sb.append(" religion: ").append(toIndentedString(religion)).append("\n"); + sb.append(" political: ").append(toIndentedString(political)).append("\n"); + sb.append(" relationshipStatus: ").append(toIndentedString(relationshipStatus)).append("\n"); + sb.append(" httpsImageUrl: ").append(toIndentedString(httpsImageUrl)).append("\n"); + sb.append(" isGeoEnabled: ").append(toIndentedString(isGeoEnabled)).append("\n"); + sb.append(" associations: ").append(toIndentedString(associations)).append("\n"); + sb.append(" honors: ").append(toIndentedString(honors)).append("\n"); + sb.append(" publicRepository: ").append(toIndentedString(publicRepository)).append("\n"); + sb.append(" repositoryUrl: ").append(toIndentedString(repositoryUrl)).append("\n"); + sb.append(" professionalHeadline: ").append(toIndentedString(professionalHeadline)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" starredUrl: ").append(toIndentedString(starredUrl)).append("\n"); + sb.append(" gistsUrl: ").append(toIndentedString(gistsUrl)).append("\n"); + sb.append(" gravatarImageUrl: ").append(toIndentedString(gravatarImageUrl)).append("\n"); + sb.append(" externalUserLoginId: ").append(toIndentedString(externalUserLoginId)).append("\n"); + sb.append(" interestedIn: ").append(toIndentedString(interestedIn)).append("\n"); + sb.append(" followersCount: ").append(toIndentedString(followersCount)).append("\n"); + sb.append(" friendsCount: ").append(toIndentedString(friendsCount)).append("\n"); + sb.append(" totalStatusesCount: ").append(toIndentedString(totalStatusesCount)).append("\n"); + sb.append(" numRecommenders: ").append(toIndentedString(numRecommenders)).append("\n"); + sb.append(" totalPrivateRepository: ").append(toIndentedString(totalPrivateRepository)).append("\n"); + sb.append(" publicGists: ").append(toIndentedString(publicGists)).append("\n"); + sb.append(" privateGists: ").append(toIndentedString(privateGists)).append("\n"); + sb.append(" sessionLimit: ").append(toIndentedString(sessionLimit)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" profileImageUrls: ").append(toIndentedString(profileImageUrls)).append("\n"); + sb.append(" webProfiles: ").append(toIndentedString(webProfiles)).append("\n"); + sb.append(" securityQuestionAnswer: ").append(toIndentedString(securityQuestionAnswer)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" providerAccessCredential: ").append(toIndentedString(providerAccessCredential)).append("\n"); + sb.append(" suggestions: ").append(toIndentedString(suggestions)).append("\n"); + sb.append(" subscription: ").append(toIndentedString(subscription)).append("\n"); + sb.append(" ageRange: ").append(toIndentedString(ageRange)).append("\n"); + sb.append(" privacyPolicy: ").append(toIndentedString(privacyPolicy)).append("\n"); + sb.append(" piNInfo: ").append(toIndentedString(piNInfo)).append("\n"); + sb.append(" addresses: ").append(toIndentedString(addresses)).append("\n"); + sb.append(" positions: ").append(toIndentedString(positions)).append("\n"); + sb.append(" educations: ").append(toIndentedString(educations)).append("\n"); + sb.append(" phoneNumbers: ").append(toIndentedString(phoneNumbers)).append("\n"); + sb.append(" imAccounts: ").append(toIndentedString(imAccounts)).append("\n"); + sb.append(" interests: ").append(toIndentedString(interests)).append("\n"); + sb.append(" sports: ").append(toIndentedString(sports)).append("\n"); + sb.append(" inspirationalPeople: ").append(toIndentedString(inspirationalPeople)).append("\n"); + sb.append(" awards: ").append(toIndentedString(awards)).append("\n"); + sb.append(" skills: ").append(toIndentedString(skills)).append("\n"); + sb.append(" currentStatus: ").append(toIndentedString(currentStatus)).append("\n"); + sb.append(" certifications: ").append(toIndentedString(certifications)).append("\n"); + sb.append(" courses: ").append(toIndentedString(courses)).append("\n"); + sb.append(" volunteer: ").append(toIndentedString(volunteer)).append("\n"); + sb.append(" recommendationsReceived: ").append(toIndentedString(recommendationsReceived)).append("\n"); + sb.append(" languages: ").append(toIndentedString(languages)).append("\n"); + sb.append(" projects: ").append(toIndentedString(projects)).append("\n"); + sb.append(" games: ").append(toIndentedString(games)).append("\n"); + sb.append(" family: ").append(toIndentedString(family)).append("\n"); + sb.append(" televisionShow: ").append(toIndentedString(televisionShow)).append("\n"); + sb.append(" mutualFriends: ").append(toIndentedString(mutualFriends)).append("\n"); + sb.append(" movies: ").append(toIndentedString(movies)).append("\n"); + sb.append(" books: ").append(toIndentedString(books)).append("\n"); + sb.append(" patents: ").append(toIndentedString(patents)).append("\n"); + sb.append(" favoriteThings: ").append(toIndentedString(favoriteThings)).append("\n"); + sb.append(" relatedProfileViews: ").append(toIndentedString(relatedProfileViews)).append("\n"); + sb.append(" placesLived: ").append(toIndentedString(placesLived)).append("\n"); + sb.append(" publications: ").append(toIndentedString(publications)).append("\n"); + sb.append(" jobBookmarks: ").append(toIndentedString(jobBookmarks)).append("\n"); + sb.append(" badges: ").append(toIndentedString(badges)).append("\n"); + sb.append(" memberUrlResources: ").append(toIndentedString(memberUrlResources)).append("\n"); + sb.append(" externalIds: ").append(toIndentedString(externalIds)).append("\n"); + sb.append(" isEmailSubscribed: ").append(toIndentedString(isEmailSubscribed)).append("\n"); + sb.append(" isProtected: ").append(toIndentedString(isProtected)).append("\n"); + sb.append(" hireable: ").append(toIndentedString(hireable)).append("\n"); + sb.append(" isTwoFactorAuthenticationEnabled: ").append(toIndentedString(isTwoFactorAuthenticationEnabled)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" isDeleted: ").append(toIndentedString(isDeleted)).append("\n"); + sb.append(" emailVerified: ").append(toIndentedString(emailVerified)).append("\n"); + sb.append(" phoneIdVerified: ").append(toIndentedString(phoneIdVerified)).append("\n"); + sb.append(" disableLogin: ").append(toIndentedString(disableLogin)).append("\n"); + sb.append(" isLoginLocked: ").append(toIndentedString(isLoginLocked)).append("\n"); + sb.append(" acceptPrivacyPolicy: ").append(toIndentedString(acceptPrivacyPolicy)).append("\n"); + sb.append(" reCaptchaResponseField: ").append(toIndentedString(reCaptchaResponseField)).append("\n"); + sb.append(" reCaptchaChallengeField: ").append(toIndentedString(reCaptchaChallengeField)).append("\n"); + sb.append(" registrationSource: ").append(toIndentedString(registrationSource)).append("\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append(" consents: ").append(toIndentedString(consents)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Uid"); + openapiFields.add("UserName"); + openapiFields.add("PhoneId"); + openapiFields.add("Gender"); + openapiFields.add("BirthDate"); + openapiFields.add("Prefix"); + openapiFields.add("FirstName"); + openapiFields.add("MiddleName"); + openapiFields.add("LastName"); + openapiFields.add("Suffix"); + openapiFields.add("NickName"); + openapiFields.add("ProfileName"); + openapiFields.add("About"); + openapiFields.add("Company"); + openapiFields.add("ImageUrl"); + openapiFields.add("TimeZone"); + openapiFields.add("Website"); + openapiFields.add("ThumbnailImageUrl"); + openapiFields.add("Favicon"); + openapiFields.add("ProfileUrl"); + openapiFields.add("HomeTown"); + openapiFields.add("State"); + openapiFields.add("City"); + openapiFields.add("Industry"); + openapiFields.add("LocalLanguage"); + openapiFields.add("Language"); + openapiFields.add("CoverPhoto"); + openapiFields.add("TagLine"); + openapiFields.add("MainAddress"); + openapiFields.add("LocalCity"); + openapiFields.add("ProfileCity"); + openapiFields.add("LocalCountry"); + openapiFields.add("ProfileCountry"); + openapiFields.add("Quota"); + openapiFields.add("Religion"); + openapiFields.add("Political"); + openapiFields.add("RelationshipStatus"); + openapiFields.add("HttpsImageUrl"); + openapiFields.add("IsGeoEnabled"); + openapiFields.add("Associations"); + openapiFields.add("Honors"); + openapiFields.add("PublicRepository"); + openapiFields.add("RepositoryUrl"); + openapiFields.add("ProfessionalHeadline"); + openapiFields.add("Currency"); + openapiFields.add("StarredUrl"); + openapiFields.add("GistsUrl"); + openapiFields.add("GravatarImageUrl"); + openapiFields.add("ExternalUserLoginId"); + openapiFields.add("InterestedIn"); + openapiFields.add("FollowersCount"); + openapiFields.add("FriendsCount"); + openapiFields.add("TotalStatusesCount"); + openapiFields.add("NumRecommenders"); + openapiFields.add("TotalPrivateRepository"); + openapiFields.add("PublicGists"); + openapiFields.add("PrivateGists"); + openapiFields.add("SessionLimit"); + openapiFields.add("CustomFields"); + openapiFields.add("ProfileImageUrls"); + openapiFields.add("WebProfiles"); + openapiFields.add("SecurityQuestionAnswer"); + openapiFields.add("Country"); + openapiFields.add("ProviderAccessCredential"); + openapiFields.add("Suggestions"); + openapiFields.add("Subscription"); + openapiFields.add("AgeRange"); + openapiFields.add("PrivacyPolicy"); + openapiFields.add("PINInfo"); + openapiFields.add("Addresses"); + openapiFields.add("Positions"); + openapiFields.add("Educations"); + openapiFields.add("PhoneNumbers"); + openapiFields.add("IMAccounts"); + openapiFields.add("Interests"); + openapiFields.add("Sports"); + openapiFields.add("InspirationalPeople"); + openapiFields.add("Awards"); + openapiFields.add("Skills"); + openapiFields.add("CurrentStatus"); + openapiFields.add("Certifications"); + openapiFields.add("Courses"); + openapiFields.add("Volunteer"); + openapiFields.add("RecommendationsReceived"); + openapiFields.add("Languages"); + openapiFields.add("Projects"); + openapiFields.add("Games"); + openapiFields.add("Family"); + openapiFields.add("TelevisionShow"); + openapiFields.add("MutualFriends"); + openapiFields.add("Movies"); + openapiFields.add("Books"); + openapiFields.add("Patents"); + openapiFields.add("FavoriteThings"); + openapiFields.add("RelatedProfileViews"); + openapiFields.add("PlacesLived"); + openapiFields.add("Publications"); + openapiFields.add("JobBookmarks"); + openapiFields.add("Badges"); + openapiFields.add("MemberUrlResources"); + openapiFields.add("ExternalIds"); + openapiFields.add("IsEmailSubscribed"); + openapiFields.add("IsProtected"); + openapiFields.add("Hireable"); + openapiFields.add("IsTwoFactorAuthenticationEnabled"); + openapiFields.add("IsActive"); + openapiFields.add("IsDeleted"); + openapiFields.add("EmailVerified"); + openapiFields.add("PhoneIdVerified"); + openapiFields.add("DisableLogin"); + openapiFields.add("IsLoginLocked"); + openapiFields.add("AcceptPrivacyPolicy"); + openapiFields.add("ReCaptchaResponseField"); + openapiFields.add("ReCaptchaChallengeField"); + openapiFields.add("RegistrationSource"); + openapiFields.add("FullName"); + openapiFields.add("Consents"); + openapiFields.add("Password"); + openapiFields.add("Email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModel is not found in the empty JSON string", ManageRegisterModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Uid") != null && !jsonObj.get("Uid").isJsonNull()) && !jsonObj.get("Uid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Uid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Uid").toString())); + } + if ((jsonObj.get("UserName") != null && !jsonObj.get("UserName").isJsonNull()) && !jsonObj.get("UserName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UserName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UserName").toString())); + } + if ((jsonObj.get("PhoneId") != null && !jsonObj.get("PhoneId").isJsonNull()) && !jsonObj.get("PhoneId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PhoneId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PhoneId").toString())); + } + if ((jsonObj.get("Gender") != null && !jsonObj.get("Gender").isJsonNull()) && !jsonObj.get("Gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Gender").toString())); + } + if ((jsonObj.get("BirthDate") != null && !jsonObj.get("BirthDate").isJsonNull()) && !jsonObj.get("BirthDate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `BirthDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BirthDate").toString())); + } + if ((jsonObj.get("Prefix") != null && !jsonObj.get("Prefix").isJsonNull()) && !jsonObj.get("Prefix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Prefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Prefix").toString())); + } + if ((jsonObj.get("FirstName") != null && !jsonObj.get("FirstName").isJsonNull()) && !jsonObj.get("FirstName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FirstName").toString())); + } + if ((jsonObj.get("MiddleName") != null && !jsonObj.get("MiddleName").isJsonNull()) && !jsonObj.get("MiddleName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MiddleName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MiddleName").toString())); + } + if ((jsonObj.get("LastName") != null && !jsonObj.get("LastName").isJsonNull()) && !jsonObj.get("LastName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastName").toString())); + } + if ((jsonObj.get("Suffix") != null && !jsonObj.get("Suffix").isJsonNull()) && !jsonObj.get("Suffix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Suffix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Suffix").toString())); + } + if ((jsonObj.get("NickName") != null && !jsonObj.get("NickName").isJsonNull()) && !jsonObj.get("NickName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NickName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NickName").toString())); + } + if ((jsonObj.get("ProfileName") != null && !jsonObj.get("ProfileName").isJsonNull()) && !jsonObj.get("ProfileName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileName").toString())); + } + if ((jsonObj.get("About") != null && !jsonObj.get("About").isJsonNull()) && !jsonObj.get("About").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `About` to be a primitive type in the JSON string but got `%s`", jsonObj.get("About").toString())); + } + if ((jsonObj.get("Company") != null && !jsonObj.get("Company").isJsonNull()) && !jsonObj.get("Company").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Company` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Company").toString())); + } + if ((jsonObj.get("ImageUrl") != null && !jsonObj.get("ImageUrl").isJsonNull()) && !jsonObj.get("ImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ImageUrl").toString())); + } + if ((jsonObj.get("TimeZone") != null && !jsonObj.get("TimeZone").isJsonNull()) && !jsonObj.get("TimeZone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TimeZone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TimeZone").toString())); + } + if ((jsonObj.get("Website") != null && !jsonObj.get("Website").isJsonNull()) && !jsonObj.get("Website").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Website` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Website").toString())); + } + if ((jsonObj.get("ThumbnailImageUrl") != null && !jsonObj.get("ThumbnailImageUrl").isJsonNull()) && !jsonObj.get("ThumbnailImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ThumbnailImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ThumbnailImageUrl").toString())); + } + if ((jsonObj.get("Favicon") != null && !jsonObj.get("Favicon").isJsonNull()) && !jsonObj.get("Favicon").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Favicon` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Favicon").toString())); + } + if ((jsonObj.get("ProfileUrl") != null && !jsonObj.get("ProfileUrl").isJsonNull()) && !jsonObj.get("ProfileUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileUrl").toString())); + } + if ((jsonObj.get("HomeTown") != null && !jsonObj.get("HomeTown").isJsonNull()) && !jsonObj.get("HomeTown").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HomeTown` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HomeTown").toString())); + } + if ((jsonObj.get("State") != null && !jsonObj.get("State").isJsonNull()) && !jsonObj.get("State").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `State` to be a primitive type in the JSON string but got `%s`", jsonObj.get("State").toString())); + } + if ((jsonObj.get("City") != null && !jsonObj.get("City").isJsonNull()) && !jsonObj.get("City").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `City` to be a primitive type in the JSON string but got `%s`", jsonObj.get("City").toString())); + } + if ((jsonObj.get("Industry") != null && !jsonObj.get("Industry").isJsonNull()) && !jsonObj.get("Industry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Industry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Industry").toString())); + } + if ((jsonObj.get("LocalLanguage") != null && !jsonObj.get("LocalLanguage").isJsonNull()) && !jsonObj.get("LocalLanguage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalLanguage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalLanguage").toString())); + } + if ((jsonObj.get("Language") != null && !jsonObj.get("Language").isJsonNull()) && !jsonObj.get("Language").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Language` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Language").toString())); + } + if ((jsonObj.get("CoverPhoto") != null && !jsonObj.get("CoverPhoto").isJsonNull()) && !jsonObj.get("CoverPhoto").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CoverPhoto` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CoverPhoto").toString())); + } + if ((jsonObj.get("TagLine") != null && !jsonObj.get("TagLine").isJsonNull()) && !jsonObj.get("TagLine").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TagLine` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TagLine").toString())); + } + if ((jsonObj.get("MainAddress") != null && !jsonObj.get("MainAddress").isJsonNull()) && !jsonObj.get("MainAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MainAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MainAddress").toString())); + } + if ((jsonObj.get("LocalCity") != null && !jsonObj.get("LocalCity").isJsonNull()) && !jsonObj.get("LocalCity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalCity").toString())); + } + if ((jsonObj.get("ProfileCity") != null && !jsonObj.get("ProfileCity").isJsonNull()) && !jsonObj.get("ProfileCity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileCity").toString())); + } + if ((jsonObj.get("LocalCountry") != null && !jsonObj.get("LocalCountry").isJsonNull()) && !jsonObj.get("LocalCountry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalCountry").toString())); + } + if ((jsonObj.get("ProfileCountry") != null && !jsonObj.get("ProfileCountry").isJsonNull()) && !jsonObj.get("ProfileCountry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileCountry").toString())); + } + if ((jsonObj.get("Quota") != null && !jsonObj.get("Quota").isJsonNull()) && !jsonObj.get("Quota").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Quota` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Quota").toString())); + } + if ((jsonObj.get("Religion") != null && !jsonObj.get("Religion").isJsonNull()) && !jsonObj.get("Religion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Religion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Religion").toString())); + } + if ((jsonObj.get("Political") != null && !jsonObj.get("Political").isJsonNull()) && !jsonObj.get("Political").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Political` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Political").toString())); + } + if ((jsonObj.get("RelationshipStatus") != null && !jsonObj.get("RelationshipStatus").isJsonNull()) && !jsonObj.get("RelationshipStatus").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RelationshipStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RelationshipStatus").toString())); + } + if ((jsonObj.get("HttpsImageUrl") != null && !jsonObj.get("HttpsImageUrl").isJsonNull()) && !jsonObj.get("HttpsImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HttpsImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HttpsImageUrl").toString())); + } + if ((jsonObj.get("IsGeoEnabled") != null && !jsonObj.get("IsGeoEnabled").isJsonNull()) && !jsonObj.get("IsGeoEnabled").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IsGeoEnabled` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IsGeoEnabled").toString())); + } + if ((jsonObj.get("Associations") != null && !jsonObj.get("Associations").isJsonNull()) && !jsonObj.get("Associations").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Associations` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Associations").toString())); + } + if ((jsonObj.get("Honors") != null && !jsonObj.get("Honors").isJsonNull()) && !jsonObj.get("Honors").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Honors` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Honors").toString())); + } + if ((jsonObj.get("PublicRepository") != null && !jsonObj.get("PublicRepository").isJsonNull()) && !jsonObj.get("PublicRepository").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PublicRepository` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PublicRepository").toString())); + } + if ((jsonObj.get("RepositoryUrl") != null && !jsonObj.get("RepositoryUrl").isJsonNull()) && !jsonObj.get("RepositoryUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RepositoryUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RepositoryUrl").toString())); + } + if ((jsonObj.get("ProfessionalHeadline") != null && !jsonObj.get("ProfessionalHeadline").isJsonNull()) && !jsonObj.get("ProfessionalHeadline").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfessionalHeadline` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfessionalHeadline").toString())); + } + if ((jsonObj.get("Currency") != null && !jsonObj.get("Currency").isJsonNull()) && !jsonObj.get("Currency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Currency").toString())); + } + if ((jsonObj.get("StarredUrl") != null && !jsonObj.get("StarredUrl").isJsonNull()) && !jsonObj.get("StarredUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `StarredUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("StarredUrl").toString())); + } + if ((jsonObj.get("GistsUrl") != null && !jsonObj.get("GistsUrl").isJsonNull()) && !jsonObj.get("GistsUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GistsUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GistsUrl").toString())); + } + if ((jsonObj.get("GravatarImageUrl") != null && !jsonObj.get("GravatarImageUrl").isJsonNull()) && !jsonObj.get("GravatarImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GravatarImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GravatarImageUrl").toString())); + } + if ((jsonObj.get("ExternalUserLoginId") != null && !jsonObj.get("ExternalUserLoginId").isJsonNull()) && !jsonObj.get("ExternalUserLoginId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ExternalUserLoginId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ExternalUserLoginId").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("InterestedIn") != null && !jsonObj.get("InterestedIn").isJsonNull() && !jsonObj.get("InterestedIn").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `InterestedIn` to be an array in the JSON string but got `%s`", jsonObj.get("InterestedIn").toString())); + } + // validate the optional field `Country` + if (jsonObj.get("Country") != null && !jsonObj.get("Country").isJsonNull()) { + ManageRegisterModelCountry.validateJsonElement(jsonObj.get("Country")); + } + // validate the optional field `ProviderAccessCredential` + if (jsonObj.get("ProviderAccessCredential") != null && !jsonObj.get("ProviderAccessCredential").isJsonNull()) { + ManageRegisterModelProviderAccessCredential.validateJsonElement(jsonObj.get("ProviderAccessCredential")); + } + // validate the optional field `Suggestions` + if (jsonObj.get("Suggestions") != null && !jsonObj.get("Suggestions").isJsonNull()) { + ManageRegisterModelSuggestions.validateJsonElement(jsonObj.get("Suggestions")); + } + // validate the optional field `Subscription` + if (jsonObj.get("Subscription") != null && !jsonObj.get("Subscription").isJsonNull()) { + ManageRegisterModelSubscription.validateJsonElement(jsonObj.get("Subscription")); + } + // validate the optional field `AgeRange` + if (jsonObj.get("AgeRange") != null && !jsonObj.get("AgeRange").isJsonNull()) { + ManageRegisterModelAgeRange.validateJsonElement(jsonObj.get("AgeRange")); + } + // validate the optional field `PrivacyPolicy` + if (jsonObj.get("PrivacyPolicy") != null && !jsonObj.get("PrivacyPolicy").isJsonNull()) { + ManageRegisterModelPrivacyPolicy.validateJsonElement(jsonObj.get("PrivacyPolicy")); + } + // validate the optional field `PINInfo` + if (jsonObj.get("PINInfo") != null && !jsonObj.get("PINInfo").isJsonNull()) { + ManageRegisterModelPINInfo.validateJsonElement(jsonObj.get("PINInfo")); + } + if (jsonObj.get("Addresses") != null && !jsonObj.get("Addresses").isJsonNull()) { + JsonArray jsonArrayaddresses = jsonObj.getAsJsonArray("Addresses"); + if (jsonArrayaddresses != null) { + // ensure the json data is an array + if (!jsonObj.get("Addresses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Addresses` to be an array in the JSON string but got `%s`", jsonObj.get("Addresses").toString())); + } + + // validate the optional field `Addresses` (array) + for (int i = 0; i < jsonArrayaddresses.size(); i++) { + ManageRegisterModelAddressesInner.validateJsonElement(jsonArrayaddresses.get(i)); + }; + } + } + if (jsonObj.get("Positions") != null && !jsonObj.get("Positions").isJsonNull()) { + JsonArray jsonArraypositions = jsonObj.getAsJsonArray("Positions"); + if (jsonArraypositions != null) { + // ensure the json data is an array + if (!jsonObj.get("Positions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Positions` to be an array in the JSON string but got `%s`", jsonObj.get("Positions").toString())); + } + + // validate the optional field `Positions` (array) + for (int i = 0; i < jsonArraypositions.size(); i++) { + ManageRegisterModelPositionsInner.validateJsonElement(jsonArraypositions.get(i)); + }; + } + } + if (jsonObj.get("Educations") != null && !jsonObj.get("Educations").isJsonNull()) { + JsonArray jsonArrayeducations = jsonObj.getAsJsonArray("Educations"); + if (jsonArrayeducations != null) { + // ensure the json data is an array + if (!jsonObj.get("Educations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Educations` to be an array in the JSON string but got `%s`", jsonObj.get("Educations").toString())); + } + + // validate the optional field `Educations` (array) + for (int i = 0; i < jsonArrayeducations.size(); i++) { + ManageRegisterModelEducationsInner.validateJsonElement(jsonArrayeducations.get(i)); + }; + } + } + if (jsonObj.get("PhoneNumbers") != null && !jsonObj.get("PhoneNumbers").isJsonNull()) { + JsonArray jsonArrayphoneNumbers = jsonObj.getAsJsonArray("PhoneNumbers"); + if (jsonArrayphoneNumbers != null) { + // ensure the json data is an array + if (!jsonObj.get("PhoneNumbers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PhoneNumbers` to be an array in the JSON string but got `%s`", jsonObj.get("PhoneNumbers").toString())); + } + + // validate the optional field `PhoneNumbers` (array) + for (int i = 0; i < jsonArrayphoneNumbers.size(); i++) { + ProfilePhoneNumbersInner.validateJsonElement(jsonArrayphoneNumbers.get(i)); + }; + } + } + if (jsonObj.get("IMAccounts") != null && !jsonObj.get("IMAccounts").isJsonNull()) { + JsonArray jsonArrayimAccounts = jsonObj.getAsJsonArray("IMAccounts"); + if (jsonArrayimAccounts != null) { + // ensure the json data is an array + if (!jsonObj.get("IMAccounts").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `IMAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("IMAccounts").toString())); + } + + // validate the optional field `IMAccounts` (array) + for (int i = 0; i < jsonArrayimAccounts.size(); i++) { + ProfileIMAccountsInner.validateJsonElement(jsonArrayimAccounts.get(i)); + }; + } + } + if (jsonObj.get("Interests") != null && !jsonObj.get("Interests").isJsonNull()) { + JsonArray jsonArrayinterests = jsonObj.getAsJsonArray("Interests"); + if (jsonArrayinterests != null) { + // ensure the json data is an array + if (!jsonObj.get("Interests").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Interests` to be an array in the JSON string but got `%s`", jsonObj.get("Interests").toString())); + } + + // validate the optional field `Interests` (array) + for (int i = 0; i < jsonArrayinterests.size(); i++) { + ProfileInterestsInner.validateJsonElement(jsonArrayinterests.get(i)); + }; + } + } + if (jsonObj.get("Sports") != null && !jsonObj.get("Sports").isJsonNull()) { + JsonArray jsonArraysports = jsonObj.getAsJsonArray("Sports"); + if (jsonArraysports != null) { + // ensure the json data is an array + if (!jsonObj.get("Sports").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Sports` to be an array in the JSON string but got `%s`", jsonObj.get("Sports").toString())); + } + + // validate the optional field `Sports` (array) + for (int i = 0; i < jsonArraysports.size(); i++) { + ProfileSportsInner.validateJsonElement(jsonArraysports.get(i)); + }; + } + } + if (jsonObj.get("InspirationalPeople") != null && !jsonObj.get("InspirationalPeople").isJsonNull()) { + JsonArray jsonArrayinspirationalPeople = jsonObj.getAsJsonArray("InspirationalPeople"); + if (jsonArrayinspirationalPeople != null) { + // ensure the json data is an array + if (!jsonObj.get("InspirationalPeople").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `InspirationalPeople` to be an array in the JSON string but got `%s`", jsonObj.get("InspirationalPeople").toString())); + } + + // validate the optional field `InspirationalPeople` (array) + for (int i = 0; i < jsonArrayinspirationalPeople.size(); i++) { + ProfileInspirationalPeopleInner.validateJsonElement(jsonArrayinspirationalPeople.get(i)); + }; + } + } + if (jsonObj.get("Awards") != null && !jsonObj.get("Awards").isJsonNull()) { + JsonArray jsonArrayawards = jsonObj.getAsJsonArray("Awards"); + if (jsonArrayawards != null) { + // ensure the json data is an array + if (!jsonObj.get("Awards").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Awards` to be an array in the JSON string but got `%s`", jsonObj.get("Awards").toString())); + } + + // validate the optional field `Awards` (array) + for (int i = 0; i < jsonArrayawards.size(); i++) { + ProfileAwardsInner.validateJsonElement(jsonArrayawards.get(i)); + }; + } + } + if (jsonObj.get("Skills") != null && !jsonObj.get("Skills").isJsonNull()) { + JsonArray jsonArrayskills = jsonObj.getAsJsonArray("Skills"); + if (jsonArrayskills != null) { + // ensure the json data is an array + if (!jsonObj.get("Skills").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Skills` to be an array in the JSON string but got `%s`", jsonObj.get("Skills").toString())); + } + + // validate the optional field `Skills` (array) + for (int i = 0; i < jsonArrayskills.size(); i++) { + ProfileSkillsInner.validateJsonElement(jsonArrayskills.get(i)); + }; + } + } + if (jsonObj.get("CurrentStatus") != null && !jsonObj.get("CurrentStatus").isJsonNull()) { + JsonArray jsonArraycurrentStatus = jsonObj.getAsJsonArray("CurrentStatus"); + if (jsonArraycurrentStatus != null) { + // ensure the json data is an array + if (!jsonObj.get("CurrentStatus").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `CurrentStatus` to be an array in the JSON string but got `%s`", jsonObj.get("CurrentStatus").toString())); + } + + // validate the optional field `CurrentStatus` (array) + for (int i = 0; i < jsonArraycurrentStatus.size(); i++) { + ProfileCurrentStatusInner.validateJsonElement(jsonArraycurrentStatus.get(i)); + }; + } + } + if (jsonObj.get("Certifications") != null && !jsonObj.get("Certifications").isJsonNull()) { + JsonArray jsonArraycertifications = jsonObj.getAsJsonArray("Certifications"); + if (jsonArraycertifications != null) { + // ensure the json data is an array + if (!jsonObj.get("Certifications").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Certifications` to be an array in the JSON string but got `%s`", jsonObj.get("Certifications").toString())); + } + + // validate the optional field `Certifications` (array) + for (int i = 0; i < jsonArraycertifications.size(); i++) { + ManageRegisterModelCertificationsInner.validateJsonElement(jsonArraycertifications.get(i)); + }; + } + } + if (jsonObj.get("Courses") != null && !jsonObj.get("Courses").isJsonNull()) { + JsonArray jsonArraycourses = jsonObj.getAsJsonArray("Courses"); + if (jsonArraycourses != null) { + // ensure the json data is an array + if (!jsonObj.get("Courses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Courses` to be an array in the JSON string but got `%s`", jsonObj.get("Courses").toString())); + } + + // validate the optional field `Courses` (array) + for (int i = 0; i < jsonArraycourses.size(); i++) { + ManageRegisterModelCoursesInner.validateJsonElement(jsonArraycourses.get(i)); + }; + } + } + if (jsonObj.get("Volunteer") != null && !jsonObj.get("Volunteer").isJsonNull()) { + JsonArray jsonArrayvolunteer = jsonObj.getAsJsonArray("Volunteer"); + if (jsonArrayvolunteer != null) { + // ensure the json data is an array + if (!jsonObj.get("Volunteer").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Volunteer` to be an array in the JSON string but got `%s`", jsonObj.get("Volunteer").toString())); + } + + // validate the optional field `Volunteer` (array) + for (int i = 0; i < jsonArrayvolunteer.size(); i++) { + ManageRegisterModelVolunteerInner.validateJsonElement(jsonArrayvolunteer.get(i)); + }; + } + } + if (jsonObj.get("RecommendationsReceived") != null && !jsonObj.get("RecommendationsReceived").isJsonNull()) { + JsonArray jsonArrayrecommendationsReceived = jsonObj.getAsJsonArray("RecommendationsReceived"); + if (jsonArrayrecommendationsReceived != null) { + // ensure the json data is an array + if (!jsonObj.get("RecommendationsReceived").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RecommendationsReceived` to be an array in the JSON string but got `%s`", jsonObj.get("RecommendationsReceived").toString())); + } + + // validate the optional field `RecommendationsReceived` (array) + for (int i = 0; i < jsonArrayrecommendationsReceived.size(); i++) { + ManageRegisterModelRecommendationsReceivedInner.validateJsonElement(jsonArrayrecommendationsReceived.get(i)); + }; + } + } + if (jsonObj.get("Languages") != null && !jsonObj.get("Languages").isJsonNull()) { + JsonArray jsonArraylanguages = jsonObj.getAsJsonArray("Languages"); + if (jsonArraylanguages != null) { + // ensure the json data is an array + if (!jsonObj.get("Languages").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Languages` to be an array in the JSON string but got `%s`", jsonObj.get("Languages").toString())); + } + + // validate the optional field `Languages` (array) + for (int i = 0; i < jsonArraylanguages.size(); i++) { + ManageRegisterModelLanguagesInner.validateJsonElement(jsonArraylanguages.get(i)); + }; + } + } + if (jsonObj.get("Projects") != null && !jsonObj.get("Projects").isJsonNull()) { + JsonArray jsonArrayprojects = jsonObj.getAsJsonArray("Projects"); + if (jsonArrayprojects != null) { + // ensure the json data is an array + if (!jsonObj.get("Projects").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Projects` to be an array in the JSON string but got `%s`", jsonObj.get("Projects").toString())); + } + + // validate the optional field `Projects` (array) + for (int i = 0; i < jsonArrayprojects.size(); i++) { + ManageRegisterModelProjectsInner.validateJsonElement(jsonArrayprojects.get(i)); + }; + } + } + if (jsonObj.get("Games") != null && !jsonObj.get("Games").isJsonNull()) { + JsonArray jsonArraygames = jsonObj.getAsJsonArray("Games"); + if (jsonArraygames != null) { + // ensure the json data is an array + if (!jsonObj.get("Games").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Games` to be an array in the JSON string but got `%s`", jsonObj.get("Games").toString())); + } + + // validate the optional field `Games` (array) + for (int i = 0; i < jsonArraygames.size(); i++) { + ManageRegisterModelGamesInner.validateJsonElement(jsonArraygames.get(i)); + }; + } + } + if (jsonObj.get("Family") != null && !jsonObj.get("Family").isJsonNull()) { + JsonArray jsonArrayfamily = jsonObj.getAsJsonArray("Family"); + if (jsonArrayfamily != null) { + // ensure the json data is an array + if (!jsonObj.get("Family").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Family` to be an array in the JSON string but got `%s`", jsonObj.get("Family").toString())); + } + + // validate the optional field `Family` (array) + for (int i = 0; i < jsonArrayfamily.size(); i++) { + ManageRegisterModelFamilyInner.validateJsonElement(jsonArrayfamily.get(i)); + }; + } + } + if (jsonObj.get("TelevisionShow") != null && !jsonObj.get("TelevisionShow").isJsonNull()) { + JsonArray jsonArraytelevisionShow = jsonObj.getAsJsonArray("TelevisionShow"); + if (jsonArraytelevisionShow != null) { + // ensure the json data is an array + if (!jsonObj.get("TelevisionShow").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `TelevisionShow` to be an array in the JSON string but got `%s`", jsonObj.get("TelevisionShow").toString())); + } + + // validate the optional field `TelevisionShow` (array) + for (int i = 0; i < jsonArraytelevisionShow.size(); i++) { + ManageRegisterModelTelevisionShowInner.validateJsonElement(jsonArraytelevisionShow.get(i)); + }; + } + } + if (jsonObj.get("MutualFriends") != null && !jsonObj.get("MutualFriends").isJsonNull()) { + JsonArray jsonArraymutualFriends = jsonObj.getAsJsonArray("MutualFriends"); + if (jsonArraymutualFriends != null) { + // ensure the json data is an array + if (!jsonObj.get("MutualFriends").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `MutualFriends` to be an array in the JSON string but got `%s`", jsonObj.get("MutualFriends").toString())); + } + + // validate the optional field `MutualFriends` (array) + for (int i = 0; i < jsonArraymutualFriends.size(); i++) { + ManageRegisterModelMutualFriendsInner.validateJsonElement(jsonArraymutualFriends.get(i)); + }; + } + } + if (jsonObj.get("Movies") != null && !jsonObj.get("Movies").isJsonNull()) { + JsonArray jsonArraymovies = jsonObj.getAsJsonArray("Movies"); + if (jsonArraymovies != null) { + // ensure the json data is an array + if (!jsonObj.get("Movies").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Movies` to be an array in the JSON string but got `%s`", jsonObj.get("Movies").toString())); + } + + // validate the optional field `Movies` (array) + for (int i = 0; i < jsonArraymovies.size(); i++) { + ManageRegisterModelMoviesInner.validateJsonElement(jsonArraymovies.get(i)); + }; + } + } + if (jsonObj.get("Books") != null && !jsonObj.get("Books").isJsonNull()) { + JsonArray jsonArraybooks = jsonObj.getAsJsonArray("Books"); + if (jsonArraybooks != null) { + // ensure the json data is an array + if (!jsonObj.get("Books").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Books` to be an array in the JSON string but got `%s`", jsonObj.get("Books").toString())); + } + + // validate the optional field `Books` (array) + for (int i = 0; i < jsonArraybooks.size(); i++) { + ManageRegisterModelBooksInner.validateJsonElement(jsonArraybooks.get(i)); + }; + } + } + if (jsonObj.get("Patents") != null && !jsonObj.get("Patents").isJsonNull()) { + JsonArray jsonArraypatents = jsonObj.getAsJsonArray("Patents"); + if (jsonArraypatents != null) { + // ensure the json data is an array + if (!jsonObj.get("Patents").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Patents` to be an array in the JSON string but got `%s`", jsonObj.get("Patents").toString())); + } + + // validate the optional field `Patents` (array) + for (int i = 0; i < jsonArraypatents.size(); i++) { + ManageRegisterModelPatentsInner.validateJsonElement(jsonArraypatents.get(i)); + }; + } + } + if (jsonObj.get("FavoriteThings") != null && !jsonObj.get("FavoriteThings").isJsonNull()) { + JsonArray jsonArrayfavoriteThings = jsonObj.getAsJsonArray("FavoriteThings"); + if (jsonArrayfavoriteThings != null) { + // ensure the json data is an array + if (!jsonObj.get("FavoriteThings").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `FavoriteThings` to be an array in the JSON string but got `%s`", jsonObj.get("FavoriteThings").toString())); + } + + // validate the optional field `FavoriteThings` (array) + for (int i = 0; i < jsonArrayfavoriteThings.size(); i++) { + ManageRegisterModelFavoriteThingsInner.validateJsonElement(jsonArrayfavoriteThings.get(i)); + }; + } + } + if (jsonObj.get("RelatedProfileViews") != null && !jsonObj.get("RelatedProfileViews").isJsonNull()) { + JsonArray jsonArrayrelatedProfileViews = jsonObj.getAsJsonArray("RelatedProfileViews"); + if (jsonArrayrelatedProfileViews != null) { + // ensure the json data is an array + if (!jsonObj.get("RelatedProfileViews").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RelatedProfileViews` to be an array in the JSON string but got `%s`", jsonObj.get("RelatedProfileViews").toString())); + } + + // validate the optional field `RelatedProfileViews` (array) + for (int i = 0; i < jsonArrayrelatedProfileViews.size(); i++) { + ManageRegisterModelRelatedProfileViewsInner.validateJsonElement(jsonArrayrelatedProfileViews.get(i)); + }; + } + } + if (jsonObj.get("PlacesLived") != null && !jsonObj.get("PlacesLived").isJsonNull()) { + JsonArray jsonArrayplacesLived = jsonObj.getAsJsonArray("PlacesLived"); + if (jsonArrayplacesLived != null) { + // ensure the json data is an array + if (!jsonObj.get("PlacesLived").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PlacesLived` to be an array in the JSON string but got `%s`", jsonObj.get("PlacesLived").toString())); + } + + // validate the optional field `PlacesLived` (array) + for (int i = 0; i < jsonArrayplacesLived.size(); i++) { + ManageRegisterModelPlacesLivedInner.validateJsonElement(jsonArrayplacesLived.get(i)); + }; + } + } + if (jsonObj.get("Publications") != null && !jsonObj.get("Publications").isJsonNull()) { + JsonArray jsonArraypublications = jsonObj.getAsJsonArray("Publications"); + if (jsonArraypublications != null) { + // ensure the json data is an array + if (!jsonObj.get("Publications").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Publications` to be an array in the JSON string but got `%s`", jsonObj.get("Publications").toString())); + } + + // validate the optional field `Publications` (array) + for (int i = 0; i < jsonArraypublications.size(); i++) { + ManageRegisterModelPublicationsInner.validateJsonElement(jsonArraypublications.get(i)); + }; + } + } + if (jsonObj.get("JobBookmarks") != null && !jsonObj.get("JobBookmarks").isJsonNull()) { + JsonArray jsonArrayjobBookmarks = jsonObj.getAsJsonArray("JobBookmarks"); + if (jsonArrayjobBookmarks != null) { + // ensure the json data is an array + if (!jsonObj.get("JobBookmarks").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `JobBookmarks` to be an array in the JSON string but got `%s`", jsonObj.get("JobBookmarks").toString())); + } + + // validate the optional field `JobBookmarks` (array) + for (int i = 0; i < jsonArrayjobBookmarks.size(); i++) { + ManageRegisterModelJobBookmarksInner.validateJsonElement(jsonArrayjobBookmarks.get(i)); + }; + } + } + if (jsonObj.get("Badges") != null && !jsonObj.get("Badges").isJsonNull()) { + JsonArray jsonArraybadges = jsonObj.getAsJsonArray("Badges"); + if (jsonArraybadges != null) { + // ensure the json data is an array + if (!jsonObj.get("Badges").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Badges` to be an array in the JSON string but got `%s`", jsonObj.get("Badges").toString())); + } + + // validate the optional field `Badges` (array) + for (int i = 0; i < jsonArraybadges.size(); i++) { + ManageRegisterModelBadgesInner.validateJsonElement(jsonArraybadges.get(i)); + }; + } + } + if (jsonObj.get("MemberUrlResources") != null && !jsonObj.get("MemberUrlResources").isJsonNull()) { + JsonArray jsonArraymemberUrlResources = jsonObj.getAsJsonArray("MemberUrlResources"); + if (jsonArraymemberUrlResources != null) { + // ensure the json data is an array + if (!jsonObj.get("MemberUrlResources").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `MemberUrlResources` to be an array in the JSON string but got `%s`", jsonObj.get("MemberUrlResources").toString())); + } + + // validate the optional field `MemberUrlResources` (array) + for (int i = 0; i < jsonArraymemberUrlResources.size(); i++) { + ManageRegisterModelMemberUrlResourcesInner.validateJsonElement(jsonArraymemberUrlResources.get(i)); + }; + } + } + if (jsonObj.get("ExternalIds") != null && !jsonObj.get("ExternalIds").isJsonNull()) { + JsonArray jsonArrayexternalIds = jsonObj.getAsJsonArray("ExternalIds"); + if (jsonArrayexternalIds != null) { + // ensure the json data is an array + if (!jsonObj.get("ExternalIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ExternalIds` to be an array in the JSON string but got `%s`", jsonObj.get("ExternalIds").toString())); + } + + // validate the optional field `ExternalIds` (array) + for (int i = 0; i < jsonArrayexternalIds.size(); i++) { + ProfileExternalIdsInner.validateJsonElement(jsonArrayexternalIds.get(i)); + }; + } + } + if ((jsonObj.get("ReCaptchaResponseField") != null && !jsonObj.get("ReCaptchaResponseField").isJsonNull()) && !jsonObj.get("ReCaptchaResponseField").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ReCaptchaResponseField` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ReCaptchaResponseField").toString())); + } + if ((jsonObj.get("ReCaptchaChallengeField") != null && !jsonObj.get("ReCaptchaChallengeField").isJsonNull()) && !jsonObj.get("ReCaptchaChallengeField").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ReCaptchaChallengeField` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ReCaptchaChallengeField").toString())); + } + if ((jsonObj.get("RegistrationSource") != null && !jsonObj.get("RegistrationSource").isJsonNull()) && !jsonObj.get("RegistrationSource").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RegistrationSource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RegistrationSource").toString())); + } + if ((jsonObj.get("FullName") != null && !jsonObj.get("FullName").isJsonNull()) && !jsonObj.get("FullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FullName").toString())); + } + // validate the optional field `Consents` + if (jsonObj.get("Consents") != null && !jsonObj.get("Consents").isJsonNull()) { + ManageRegisterModelConsents.validateJsonElement(jsonObj.get("Consents")); + } + if ((jsonObj.get("Password") != null && !jsonObj.get("Password").isJsonNull()) && !jsonObj.get("Password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Password").toString())); + } + if (jsonObj.get("Email") != null && !jsonObj.get("Email").isJsonNull()) { + JsonArray jsonArrayemail = jsonObj.getAsJsonArray("Email"); + if (jsonArrayemail != null) { + // ensure the json data is an array + if (!jsonObj.get("Email").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Email` to be an array in the JSON string but got `%s`", jsonObj.get("Email").toString())); + } + + // validate the optional field `Email` (array) + for (int i = 0; i < jsonArrayemail.size(); i++) { + ManageRegisterModelEmailInner.validateJsonElement(jsonArrayemail.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModel>() { + @Override + public void write(JsonWriter out, ManageRegisterModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModel + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModel + */ + public static ManageRegisterModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModel.class); + } + + /** + * Convert an instance of ManageRegisterModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelAddressesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelAddressesInner.java new file mode 100644 index 0000000..3bfcea7 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelAddressesInner.java @@ -0,0 +1,407 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModelAddressesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelAddressesInner { + public static final String SERIALIZED_NAME_TYPE = "Type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_ADDRESS1 = "Address1"; + @SerializedName(SERIALIZED_NAME_ADDRESS1) + @javax.annotation.Nullable + private String address1; + + public static final String SERIALIZED_NAME_CITY = "City"; + @SerializedName(SERIALIZED_NAME_CITY) + @javax.annotation.Nullable + private String city; + + public static final String SERIALIZED_NAME_STATE = "State"; + @SerializedName(SERIALIZED_NAME_STATE) + @javax.annotation.Nullable + private String state; + + public static final String SERIALIZED_NAME_COUNTRY = "Country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + @javax.annotation.Nullable + private String country; + + public ManageRegisterModelAddressesInner() { + } + + public ManageRegisterModelAddressesInner type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * The type of address (e.g., Home, Work). + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public ManageRegisterModelAddressesInner address1(@javax.annotation.Nullable String address1) { + this.address1 = address1; + return this; + } + + /** + * The first line of the address. + * @return address1 + */ + @javax.annotation.Nullable + public String getAddress1() { + return address1; + } + + public void setAddress1(@javax.annotation.Nullable String address1) { + this.address1 = address1; + } + + + public ManageRegisterModelAddressesInner city(@javax.annotation.Nullable String city) { + this.city = city; + return this; + } + + /** + * The city of the address. + * @return city + */ + @javax.annotation.Nullable + public String getCity() { + return city; + } + + public void setCity(@javax.annotation.Nullable String city) { + this.city = city; + } + + + public ManageRegisterModelAddressesInner state(@javax.annotation.Nullable String state) { + this.state = state; + return this; + } + + /** + * The state of the address. + * @return state + */ + @javax.annotation.Nullable + public String getState() { + return state; + } + + public void setState(@javax.annotation.Nullable String state) { + this.state = state; + } + + + public ManageRegisterModelAddressesInner country(@javax.annotation.Nullable String country) { + this.country = country; + return this; + } + + /** + * The country of the address. + * @return country + */ + @javax.annotation.Nullable + public String getCountry() { + return country; + } + + public void setCountry(@javax.annotation.Nullable String country) { + this.country = country; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelAddressesInner instance itself + */ + public ManageRegisterModelAddressesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelAddressesInner manageRegisterModelAddressesInner = (ManageRegisterModelAddressesInner) o; + return Objects.equals(this.type, manageRegisterModelAddressesInner.type) && + Objects.equals(this.address1, manageRegisterModelAddressesInner.address1) && + Objects.equals(this.city, manageRegisterModelAddressesInner.city) && + Objects.equals(this.state, manageRegisterModelAddressesInner.state) && + Objects.equals(this.country, manageRegisterModelAddressesInner.country)&& + Objects.equals(this.additionalProperties, manageRegisterModelAddressesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, address1, city, state, country, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelAddressesInner {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" address1: ").append(toIndentedString(address1)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Type"); + openapiFields.add("Address1"); + openapiFields.add("City"); + openapiFields.add("State"); + openapiFields.add("Country"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelAddressesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelAddressesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelAddressesInner is not found in the empty JSON string", ManageRegisterModelAddressesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonNull()) && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + if ((jsonObj.get("Address1") != null && !jsonObj.get("Address1").isJsonNull()) && !jsonObj.get("Address1").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Address1` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Address1").toString())); + } + if ((jsonObj.get("City") != null && !jsonObj.get("City").isJsonNull()) && !jsonObj.get("City").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `City` to be a primitive type in the JSON string but got `%s`", jsonObj.get("City").toString())); + } + if ((jsonObj.get("State") != null && !jsonObj.get("State").isJsonNull()) && !jsonObj.get("State").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `State` to be a primitive type in the JSON string but got `%s`", jsonObj.get("State").toString())); + } + if ((jsonObj.get("Country") != null && !jsonObj.get("Country").isJsonNull()) && !jsonObj.get("Country").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Country").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelAddressesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelAddressesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelAddressesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelAddressesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelAddressesInner>() { + @Override + public void write(JsonWriter out, ManageRegisterModelAddressesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelAddressesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelAddressesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelAddressesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelAddressesInner + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelAddressesInner + */ + public static ManageRegisterModelAddressesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelAddressesInner.class); + } + + /** + * Convert an instance of ManageRegisterModelAddressesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelAgeRange.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelAgeRange.java new file mode 100644 index 0000000..dbf5bda --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelAgeRange.java @@ -0,0 +1,323 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * The age range of the User. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelAgeRange { + public static final String SERIALIZED_NAME_MIN = "Min"; + @SerializedName(SERIALIZED_NAME_MIN) + @javax.annotation.Nullable + private Integer min; + + public static final String SERIALIZED_NAME_MAX = "Max"; + @SerializedName(SERIALIZED_NAME_MAX) + @javax.annotation.Nullable + private Integer max; + + public ManageRegisterModelAgeRange() { + } + + public ManageRegisterModelAgeRange min(@javax.annotation.Nullable Integer min) { + this.min = min; + return this; + } + + /** + * The minimum age in the range. + * @return min + */ + @javax.annotation.Nullable + public Integer getMin() { + return min; + } + + public void setMin(@javax.annotation.Nullable Integer min) { + this.min = min; + } + + + public ManageRegisterModelAgeRange max(@javax.annotation.Nullable Integer max) { + this.max = max; + return this; + } + + /** + * The maximum age in the range. + * @return max + */ + @javax.annotation.Nullable + public Integer getMax() { + return max; + } + + public void setMax(@javax.annotation.Nullable Integer max) { + this.max = max; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelAgeRange instance itself + */ + public ManageRegisterModelAgeRange putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelAgeRange manageRegisterModelAgeRange = (ManageRegisterModelAgeRange) o; + return Objects.equals(this.min, manageRegisterModelAgeRange.min) && + Objects.equals(this.max, manageRegisterModelAgeRange.max)&& + Objects.equals(this.additionalProperties, manageRegisterModelAgeRange.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(min, max, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelAgeRange {\n"); + sb.append(" min: ").append(toIndentedString(min)).append("\n"); + sb.append(" max: ").append(toIndentedString(max)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Min"); + openapiFields.add("Max"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelAgeRange + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelAgeRange.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelAgeRange is not found in the empty JSON string", ManageRegisterModelAgeRange.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelAgeRange.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelAgeRange' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelAgeRange> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelAgeRange.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelAgeRange>() { + @Override + public void write(JsonWriter out, ManageRegisterModelAgeRange value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelAgeRange read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelAgeRange instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelAgeRange given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelAgeRange + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelAgeRange + */ + public static ManageRegisterModelAgeRange fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelAgeRange.class); + } + + /** + * Convert an instance of ManageRegisterModelAgeRange to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelBadgesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelBadgesInner.java new file mode 100644 index 0000000..18f1b80 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelBadgesInner.java @@ -0,0 +1,407 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModelBadgesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelBadgesInner { + public static final String SERIALIZED_NAME_BADGE_ID = "BadgeId"; + @SerializedName(SERIALIZED_NAME_BADGE_ID) + @javax.annotation.Nullable + private String badgeId; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_BADGE_MESSAGE = "BadgeMessage"; + @SerializedName(SERIALIZED_NAME_BADGE_MESSAGE) + @javax.annotation.Nullable + private String badgeMessage; + + public static final String SERIALIZED_NAME_DESCRIPTION = "Description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_IMAGE_URL = "ImageUrl"; + @SerializedName(SERIALIZED_NAME_IMAGE_URL) + @javax.annotation.Nullable + private String imageUrl; + + public ManageRegisterModelBadgesInner() { + } + + public ManageRegisterModelBadgesInner badgeId(@javax.annotation.Nullable String badgeId) { + this.badgeId = badgeId; + return this; + } + + /** + * The ID of the badge. + * @return badgeId + */ + @javax.annotation.Nullable + public String getBadgeId() { + return badgeId; + } + + public void setBadgeId(@javax.annotation.Nullable String badgeId) { + this.badgeId = badgeId; + } + + + public ManageRegisterModelBadgesInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the badge. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ManageRegisterModelBadgesInner badgeMessage(@javax.annotation.Nullable String badgeMessage) { + this.badgeMessage = badgeMessage; + return this; + } + + /** + * A message associated with the badge. + * @return badgeMessage + */ + @javax.annotation.Nullable + public String getBadgeMessage() { + return badgeMessage; + } + + public void setBadgeMessage(@javax.annotation.Nullable String badgeMessage) { + this.badgeMessage = badgeMessage; + } + + + public ManageRegisterModelBadgesInner description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * A description of the badge. + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public ManageRegisterModelBadgesInner imageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** + * The URL of the badge image. + * @return imageUrl + */ + @javax.annotation.Nullable + public String getImageUrl() { + return imageUrl; + } + + public void setImageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelBadgesInner instance itself + */ + public ManageRegisterModelBadgesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelBadgesInner manageRegisterModelBadgesInner = (ManageRegisterModelBadgesInner) o; + return Objects.equals(this.badgeId, manageRegisterModelBadgesInner.badgeId) && + Objects.equals(this.name, manageRegisterModelBadgesInner.name) && + Objects.equals(this.badgeMessage, manageRegisterModelBadgesInner.badgeMessage) && + Objects.equals(this.description, manageRegisterModelBadgesInner.description) && + Objects.equals(this.imageUrl, manageRegisterModelBadgesInner.imageUrl)&& + Objects.equals(this.additionalProperties, manageRegisterModelBadgesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(badgeId, name, badgeMessage, description, imageUrl, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelBadgesInner {\n"); + sb.append(" badgeId: ").append(toIndentedString(badgeId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" badgeMessage: ").append(toIndentedString(badgeMessage)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("BadgeId"); + openapiFields.add("Name"); + openapiFields.add("BadgeMessage"); + openapiFields.add("Description"); + openapiFields.add("ImageUrl"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelBadgesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelBadgesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelBadgesInner is not found in the empty JSON string", ManageRegisterModelBadgesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("BadgeId") != null && !jsonObj.get("BadgeId").isJsonNull()) && !jsonObj.get("BadgeId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `BadgeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BadgeId").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("BadgeMessage") != null && !jsonObj.get("BadgeMessage").isJsonNull()) && !jsonObj.get("BadgeMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `BadgeMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BadgeMessage").toString())); + } + if ((jsonObj.get("Description") != null && !jsonObj.get("Description").isJsonNull()) && !jsonObj.get("Description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Description").toString())); + } + if ((jsonObj.get("ImageUrl") != null && !jsonObj.get("ImageUrl").isJsonNull()) && !jsonObj.get("ImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ImageUrl").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelBadgesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelBadgesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelBadgesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelBadgesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelBadgesInner>() { + @Override + public void write(JsonWriter out, ManageRegisterModelBadgesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelBadgesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelBadgesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelBadgesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelBadgesInner + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelBadgesInner + */ + public static ManageRegisterModelBadgesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelBadgesInner.class); + } + + /** + * Convert an instance of ManageRegisterModelBadgesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelBooksInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelBooksInner.java new file mode 100644 index 0000000..dacef54 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelBooksInner.java @@ -0,0 +1,375 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModelBooksInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelBooksInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_CATEGORY = "Category"; + @SerializedName(SERIALIZED_NAME_CATEGORY) + @javax.annotation.Nullable + private String category; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public ManageRegisterModelBooksInner() { + } + + public ManageRegisterModelBooksInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the book. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ManageRegisterModelBooksInner category(@javax.annotation.Nullable String category) { + this.category = category; + return this; + } + + /** + * The category of the book. + * @return category + */ + @javax.annotation.Nullable + public String getCategory() { + return category; + } + + public void setCategory(@javax.annotation.Nullable String category) { + this.category = category; + } + + + public ManageRegisterModelBooksInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the book. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ManageRegisterModelBooksInner createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * The date the book was added. + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelBooksInner instance itself + */ + public ManageRegisterModelBooksInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelBooksInner manageRegisterModelBooksInner = (ManageRegisterModelBooksInner) o; + return Objects.equals(this.id, manageRegisterModelBooksInner.id) && + Objects.equals(this.category, manageRegisterModelBooksInner.category) && + Objects.equals(this.name, manageRegisterModelBooksInner.name) && + Objects.equals(this.createdDate, manageRegisterModelBooksInner.createdDate)&& + Objects.equals(this.additionalProperties, manageRegisterModelBooksInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, createdDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelBooksInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Category"); + openapiFields.add("Name"); + openapiFields.add("CreatedDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelBooksInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelBooksInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelBooksInner is not found in the empty JSON string", ManageRegisterModelBooksInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Category") != null && !jsonObj.get("Category").isJsonNull()) && !jsonObj.get("Category").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Category` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Category").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelBooksInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelBooksInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelBooksInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelBooksInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelBooksInner>() { + @Override + public void write(JsonWriter out, ManageRegisterModelBooksInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelBooksInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelBooksInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelBooksInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelBooksInner + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelBooksInner + */ + public static ManageRegisterModelBooksInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelBooksInner.class); + } + + /** + * Convert an instance of ManageRegisterModelBooksInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelCertificationsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelCertificationsInner.java new file mode 100644 index 0000000..e660a06 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelCertificationsInner.java @@ -0,0 +1,402 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModelCertificationsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelCertificationsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_AUTHORITY = "Authority"; + @SerializedName(SERIALIZED_NAME_AUTHORITY) + @javax.annotation.Nullable + private String authority; + + public static final String SERIALIZED_NAME_START_DATE = "StartDate"; + @SerializedName(SERIALIZED_NAME_START_DATE) + @javax.annotation.Nullable + private OffsetDateTime startDate; + + public static final String SERIALIZED_NAME_END_DATE = "EndDate"; + @SerializedName(SERIALIZED_NAME_END_DATE) + @javax.annotation.Nullable + private OffsetDateTime endDate; + + public ManageRegisterModelCertificationsInner() { + } + + public ManageRegisterModelCertificationsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the certification. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ManageRegisterModelCertificationsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the certification. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ManageRegisterModelCertificationsInner authority(@javax.annotation.Nullable String authority) { + this.authority = authority; + return this; + } + + /** + * The authority that issued the certification. + * @return authority + */ + @javax.annotation.Nullable + public String getAuthority() { + return authority; + } + + public void setAuthority(@javax.annotation.Nullable String authority) { + this.authority = authority; + } + + + public ManageRegisterModelCertificationsInner startDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * The start date of the certification. + * @return startDate + */ + @javax.annotation.Nullable + public OffsetDateTime getStartDate() { + return startDate; + } + + public void setStartDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + } + + + public ManageRegisterModelCertificationsInner endDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * The end date of the certification. + * @return endDate + */ + @javax.annotation.Nullable + public OffsetDateTime getEndDate() { + return endDate; + } + + public void setEndDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelCertificationsInner instance itself + */ + public ManageRegisterModelCertificationsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelCertificationsInner manageRegisterModelCertificationsInner = (ManageRegisterModelCertificationsInner) o; + return Objects.equals(this.id, manageRegisterModelCertificationsInner.id) && + Objects.equals(this.name, manageRegisterModelCertificationsInner.name) && + Objects.equals(this.authority, manageRegisterModelCertificationsInner.authority) && + Objects.equals(this.startDate, manageRegisterModelCertificationsInner.startDate) && + Objects.equals(this.endDate, manageRegisterModelCertificationsInner.endDate)&& + Objects.equals(this.additionalProperties, manageRegisterModelCertificationsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, authority, startDate, endDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelCertificationsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" authority: ").append(toIndentedString(authority)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Authority"); + openapiFields.add("StartDate"); + openapiFields.add("EndDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelCertificationsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelCertificationsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelCertificationsInner is not found in the empty JSON string", ManageRegisterModelCertificationsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Authority") != null && !jsonObj.get("Authority").isJsonNull()) && !jsonObj.get("Authority").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Authority` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Authority").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelCertificationsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelCertificationsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelCertificationsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelCertificationsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelCertificationsInner>() { + @Override + public void write(JsonWriter out, ManageRegisterModelCertificationsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelCertificationsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelCertificationsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelCertificationsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelCertificationsInner + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelCertificationsInner + */ + public static ManageRegisterModelCertificationsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelCertificationsInner.class); + } + + /** + * Convert an instance of ManageRegisterModelCertificationsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelConsents.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelConsents.java new file mode 100644 index 0000000..59ce228 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelConsents.java @@ -0,0 +1,359 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ManageRegisterModelConsentsDataInner; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelConsentsEventsInner; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Consent registration details. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelConsents { + public static final String SERIALIZED_NAME_EVENTS = "Events"; + @SerializedName(SERIALIZED_NAME_EVENTS) + @javax.annotation.Nullable + private List<ManageRegisterModelConsentsEventsInner> events = new ArrayList<>(); + + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<ManageRegisterModelConsentsDataInner> data = new ArrayList<>(); + + public ManageRegisterModelConsents() { + } + + public ManageRegisterModelConsents events(@javax.annotation.Nullable List<ManageRegisterModelConsentsEventsInner> events) { + this.events = events; + return this; + } + + public ManageRegisterModelConsents addEventsItem(ManageRegisterModelConsentsEventsInner eventsItem) { + if (this.events == null) { + this.events = new ArrayList<>(); + } + this.events.add(eventsItem); + return this; + } + + /** + * List of consent acceptance events. + * @return events + */ + @javax.annotation.Nullable + public List<ManageRegisterModelConsentsEventsInner> getEvents() { + return events; + } + + public void setEvents(@javax.annotation.Nullable List<ManageRegisterModelConsentsEventsInner> events) { + this.events = events; + } + + + public ManageRegisterModelConsents data(@javax.annotation.Nullable List<ManageRegisterModelConsentsDataInner> data) { + this.data = data; + return this; + } + + public ManageRegisterModelConsents addDataItem(ManageRegisterModelConsentsDataInner dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * List of consent options accepted by the User. + * @return data + */ + @javax.annotation.Nullable + public List<ManageRegisterModelConsentsDataInner> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<ManageRegisterModelConsentsDataInner> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelConsents instance itself + */ + public ManageRegisterModelConsents putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelConsents manageRegisterModelConsents = (ManageRegisterModelConsents) o; + return Objects.equals(this.events, manageRegisterModelConsents.events) && + Objects.equals(this.data, manageRegisterModelConsents.data)&& + Objects.equals(this.additionalProperties, manageRegisterModelConsents.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(events, data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelConsents {\n"); + sb.append(" events: ").append(toIndentedString(events)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Events"); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelConsents + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelConsents.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelConsents is not found in the empty JSON string", ManageRegisterModelConsents.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Events") != null && !jsonObj.get("Events").isJsonNull()) { + JsonArray jsonArrayevents = jsonObj.getAsJsonArray("Events"); + if (jsonArrayevents != null) { + // ensure the json data is an array + if (!jsonObj.get("Events").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Events` to be an array in the JSON string but got `%s`", jsonObj.get("Events").toString())); + } + + // validate the optional field `Events` (array) + for (int i = 0; i < jsonArrayevents.size(); i++) { + ManageRegisterModelConsentsEventsInner.validateJsonElement(jsonArrayevents.get(i)); + }; + } + } + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + ManageRegisterModelConsentsDataInner.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelConsents.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelConsents' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelConsents> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelConsents.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelConsents>() { + @Override + public void write(JsonWriter out, ManageRegisterModelConsents value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelConsents read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelConsents instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelConsents given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelConsents + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelConsents + */ + public static ManageRegisterModelConsents fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelConsents.class); + } + + /** + * Convert an instance of ManageRegisterModelConsents to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelConsentsDataInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelConsentsDataInner.java new file mode 100644 index 0000000..68a2703 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelConsentsDataInner.java @@ -0,0 +1,314 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModelConsentsDataInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelConsentsDataInner { + public static final String SERIALIZED_NAME_IS_ACCEPTED = "IsAccepted"; + @SerializedName(SERIALIZED_NAME_IS_ACCEPTED) + @javax.annotation.Nullable + private Boolean isAccepted; + + public static final String SERIALIZED_NAME_CONSENT_OPTION_ID = "ConsentOptionId"; + @SerializedName(SERIALIZED_NAME_CONSENT_OPTION_ID) + @javax.annotation.Nullable + private String consentOptionId; + + public ManageRegisterModelConsentsDataInner() { + } + + public ManageRegisterModelConsentsDataInner isAccepted(@javax.annotation.Nullable Boolean isAccepted) { + this.isAccepted = isAccepted; + return this; + } + + /** + * Indicates if the consent option is accepted. + * @return isAccepted + */ + @javax.annotation.Nullable + public Boolean getIsAccepted() { + return isAccepted; + } + + public void setIsAccepted(@javax.annotation.Nullable Boolean isAccepted) { + this.isAccepted = isAccepted; + } + + + public ManageRegisterModelConsentsDataInner consentOptionId(@javax.annotation.Nullable String consentOptionId) { + this.consentOptionId = consentOptionId; + return this; + } + + /** + * The ID of the Consent option. + * @return consentOptionId + */ + @javax.annotation.Nullable + public String getConsentOptionId() { + return consentOptionId; + } + + public void setConsentOptionId(@javax.annotation.Nullable String consentOptionId) { + this.consentOptionId = consentOptionId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelConsentsDataInner instance itself + */ + public ManageRegisterModelConsentsDataInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelConsentsDataInner manageRegisterModelConsentsDataInner = (ManageRegisterModelConsentsDataInner) o; + return Objects.equals(this.isAccepted, manageRegisterModelConsentsDataInner.isAccepted) && + Objects.equals(this.consentOptionId, manageRegisterModelConsentsDataInner.consentOptionId)&& + Objects.equals(this.additionalProperties, manageRegisterModelConsentsDataInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isAccepted, consentOptionId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelConsentsDataInner {\n"); + sb.append(" isAccepted: ").append(toIndentedString(isAccepted)).append("\n"); + sb.append(" consentOptionId: ").append(toIndentedString(consentOptionId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsAccepted"); + openapiFields.add("ConsentOptionId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelConsentsDataInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelConsentsDataInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelConsentsDataInner is not found in the empty JSON string", ManageRegisterModelConsentsDataInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ConsentOptionId") != null && !jsonObj.get("ConsentOptionId").isJsonNull()) && !jsonObj.get("ConsentOptionId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ConsentOptionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ConsentOptionId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelConsentsDataInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelConsentsDataInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelConsentsDataInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelConsentsDataInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelConsentsDataInner>() { + @Override + public void write(JsonWriter out, ManageRegisterModelConsentsDataInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelConsentsDataInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelConsentsDataInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelConsentsDataInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelConsentsDataInner + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelConsentsDataInner + */ + public static ManageRegisterModelConsentsDataInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelConsentsDataInner.class); + } + + /** + * Convert an instance of ManageRegisterModelConsentsDataInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelConsentsEventsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelConsentsEventsInner.java new file mode 100644 index 0000000..60d62ce --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelConsentsEventsInner.java @@ -0,0 +1,314 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModelConsentsEventsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelConsentsEventsInner { + public static final String SERIALIZED_NAME_IS_CUSTOM = "IsCustom"; + @SerializedName(SERIALIZED_NAME_IS_CUSTOM) + @javax.annotation.Nullable + private Boolean isCustom; + + public static final String SERIALIZED_NAME_EVENT = "Event"; + @SerializedName(SERIALIZED_NAME_EVENT) + @javax.annotation.Nullable + private String event; + + public ManageRegisterModelConsentsEventsInner() { + } + + public ManageRegisterModelConsentsEventsInner isCustom(@javax.annotation.Nullable Boolean isCustom) { + this.isCustom = isCustom; + return this; + } + + /** + * Indicates if the consent is custom. + * @return isCustom + */ + @javax.annotation.Nullable + public Boolean getIsCustom() { + return isCustom; + } + + public void setIsCustom(@javax.annotation.Nullable Boolean isCustom) { + this.isCustom = isCustom; + } + + + public ManageRegisterModelConsentsEventsInner event(@javax.annotation.Nullable String event) { + this.event = event; + return this; + } + + /** + * The event associated with the Consent. + * @return event + */ + @javax.annotation.Nullable + public String getEvent() { + return event; + } + + public void setEvent(@javax.annotation.Nullable String event) { + this.event = event; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelConsentsEventsInner instance itself + */ + public ManageRegisterModelConsentsEventsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelConsentsEventsInner manageRegisterModelConsentsEventsInner = (ManageRegisterModelConsentsEventsInner) o; + return Objects.equals(this.isCustom, manageRegisterModelConsentsEventsInner.isCustom) && + Objects.equals(this.event, manageRegisterModelConsentsEventsInner.event)&& + Objects.equals(this.additionalProperties, manageRegisterModelConsentsEventsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isCustom, event, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelConsentsEventsInner {\n"); + sb.append(" isCustom: ").append(toIndentedString(isCustom)).append("\n"); + sb.append(" event: ").append(toIndentedString(event)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsCustom"); + openapiFields.add("Event"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelConsentsEventsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelConsentsEventsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelConsentsEventsInner is not found in the empty JSON string", ManageRegisterModelConsentsEventsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Event") != null && !jsonObj.get("Event").isJsonNull()) && !jsonObj.get("Event").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Event` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Event").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelConsentsEventsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelConsentsEventsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelConsentsEventsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelConsentsEventsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelConsentsEventsInner>() { + @Override + public void write(JsonWriter out, ManageRegisterModelConsentsEventsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelConsentsEventsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelConsentsEventsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelConsentsEventsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelConsentsEventsInner + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelConsentsEventsInner + */ + public static ManageRegisterModelConsentsEventsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelConsentsEventsInner.class); + } + + /** + * Convert an instance of ManageRegisterModelConsentsEventsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelCountry.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelCountry.java new file mode 100644 index 0000000..3e4d612 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelCountry.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * The country details of the User. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelCountry { + public static final String SERIALIZED_NAME_CODE = "Code"; + @SerializedName(SERIALIZED_NAME_CODE) + @javax.annotation.Nullable + private String code; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ManageRegisterModelCountry() { + } + + public ManageRegisterModelCountry code(@javax.annotation.Nullable String code) { + this.code = code; + return this; + } + + /** + * The country code. + * @return code + */ + @javax.annotation.Nullable + public String getCode() { + return code; + } + + public void setCode(@javax.annotation.Nullable String code) { + this.code = code; + } + + + public ManageRegisterModelCountry name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The country name. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelCountry instance itself + */ + public ManageRegisterModelCountry putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelCountry manageRegisterModelCountry = (ManageRegisterModelCountry) o; + return Objects.equals(this.code, manageRegisterModelCountry.code) && + Objects.equals(this.name, manageRegisterModelCountry.name)&& + Objects.equals(this.additionalProperties, manageRegisterModelCountry.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(code, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelCountry {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Code"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelCountry + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelCountry.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelCountry is not found in the empty JSON string", ManageRegisterModelCountry.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Code") != null && !jsonObj.get("Code").isJsonNull()) && !jsonObj.get("Code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Code").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelCountry.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelCountry' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelCountry> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelCountry.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelCountry>() { + @Override + public void write(JsonWriter out, ManageRegisterModelCountry value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelCountry read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelCountry instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelCountry given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelCountry + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelCountry + */ + public static ManageRegisterModelCountry fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelCountry.class); + } + + /** + * Convert an instance of ManageRegisterModelCountry to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelCoursesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelCoursesInner.java new file mode 100644 index 0000000..43f61f1 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelCoursesInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModelCoursesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelCoursesInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_NUMBER = "Number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + @javax.annotation.Nullable + private String number; + + public ManageRegisterModelCoursesInner() { + } + + public ManageRegisterModelCoursesInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the course. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ManageRegisterModelCoursesInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the course. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ManageRegisterModelCoursesInner number(@javax.annotation.Nullable String number) { + this.number = number; + return this; + } + + /** + * The course number. + * @return number + */ + @javax.annotation.Nullable + public String getNumber() { + return number; + } + + public void setNumber(@javax.annotation.Nullable String number) { + this.number = number; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelCoursesInner instance itself + */ + public ManageRegisterModelCoursesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelCoursesInner manageRegisterModelCoursesInner = (ManageRegisterModelCoursesInner) o; + return Objects.equals(this.id, manageRegisterModelCoursesInner.id) && + Objects.equals(this.name, manageRegisterModelCoursesInner.name) && + Objects.equals(this.number, manageRegisterModelCoursesInner.number)&& + Objects.equals(this.additionalProperties, manageRegisterModelCoursesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, number, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelCoursesInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Number"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelCoursesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelCoursesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelCoursesInner is not found in the empty JSON string", ManageRegisterModelCoursesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Number") != null && !jsonObj.get("Number").isJsonNull()) && !jsonObj.get("Number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Number").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelCoursesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelCoursesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelCoursesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelCoursesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelCoursesInner>() { + @Override + public void write(JsonWriter out, ManageRegisterModelCoursesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelCoursesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelCoursesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelCoursesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelCoursesInner + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelCoursesInner + */ + public static ManageRegisterModelCoursesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelCoursesInner.class); + } + + /** + * Convert an instance of ManageRegisterModelCoursesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelEducationsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelEducationsInner.java new file mode 100644 index 0000000..da86841 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelEducationsInner.java @@ -0,0 +1,402 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModelEducationsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelEducationsInner { + public static final String SERIALIZED_NAME_SCHOOL = "School"; + @SerializedName(SERIALIZED_NAME_SCHOOL) + @javax.annotation.Nullable + private String school; + + public static final String SERIALIZED_NAME_DEGREE = "Degree"; + @SerializedName(SERIALIZED_NAME_DEGREE) + @javax.annotation.Nullable + private String degree; + + public static final String SERIALIZED_NAME_FIELD_OF_STUDY = "FieldOfStudy"; + @SerializedName(SERIALIZED_NAME_FIELD_OF_STUDY) + @javax.annotation.Nullable + private String fieldOfStudy; + + public static final String SERIALIZED_NAME_START_DATE = "StartDate"; + @SerializedName(SERIALIZED_NAME_START_DATE) + @javax.annotation.Nullable + private OffsetDateTime startDate; + + public static final String SERIALIZED_NAME_END_DATE = "EndDate"; + @SerializedName(SERIALIZED_NAME_END_DATE) + @javax.annotation.Nullable + private OffsetDateTime endDate; + + public ManageRegisterModelEducationsInner() { + } + + public ManageRegisterModelEducationsInner school(@javax.annotation.Nullable String school) { + this.school = school; + return this; + } + + /** + * The name of the school. + * @return school + */ + @javax.annotation.Nullable + public String getSchool() { + return school; + } + + public void setSchool(@javax.annotation.Nullable String school) { + this.school = school; + } + + + public ManageRegisterModelEducationsInner degree(@javax.annotation.Nullable String degree) { + this.degree = degree; + return this; + } + + /** + * The degree obtained. + * @return degree + */ + @javax.annotation.Nullable + public String getDegree() { + return degree; + } + + public void setDegree(@javax.annotation.Nullable String degree) { + this.degree = degree; + } + + + public ManageRegisterModelEducationsInner fieldOfStudy(@javax.annotation.Nullable String fieldOfStudy) { + this.fieldOfStudy = fieldOfStudy; + return this; + } + + /** + * The field of study. + * @return fieldOfStudy + */ + @javax.annotation.Nullable + public String getFieldOfStudy() { + return fieldOfStudy; + } + + public void setFieldOfStudy(@javax.annotation.Nullable String fieldOfStudy) { + this.fieldOfStudy = fieldOfStudy; + } + + + public ManageRegisterModelEducationsInner startDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * The start date of the education. + * @return startDate + */ + @javax.annotation.Nullable + public OffsetDateTime getStartDate() { + return startDate; + } + + public void setStartDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + } + + + public ManageRegisterModelEducationsInner endDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * The end date of the education. + * @return endDate + */ + @javax.annotation.Nullable + public OffsetDateTime getEndDate() { + return endDate; + } + + public void setEndDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelEducationsInner instance itself + */ + public ManageRegisterModelEducationsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelEducationsInner manageRegisterModelEducationsInner = (ManageRegisterModelEducationsInner) o; + return Objects.equals(this.school, manageRegisterModelEducationsInner.school) && + Objects.equals(this.degree, manageRegisterModelEducationsInner.degree) && + Objects.equals(this.fieldOfStudy, manageRegisterModelEducationsInner.fieldOfStudy) && + Objects.equals(this.startDate, manageRegisterModelEducationsInner.startDate) && + Objects.equals(this.endDate, manageRegisterModelEducationsInner.endDate)&& + Objects.equals(this.additionalProperties, manageRegisterModelEducationsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(school, degree, fieldOfStudy, startDate, endDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelEducationsInner {\n"); + sb.append(" school: ").append(toIndentedString(school)).append("\n"); + sb.append(" degree: ").append(toIndentedString(degree)).append("\n"); + sb.append(" fieldOfStudy: ").append(toIndentedString(fieldOfStudy)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("School"); + openapiFields.add("Degree"); + openapiFields.add("FieldOfStudy"); + openapiFields.add("StartDate"); + openapiFields.add("EndDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelEducationsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelEducationsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelEducationsInner is not found in the empty JSON string", ManageRegisterModelEducationsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("School") != null && !jsonObj.get("School").isJsonNull()) && !jsonObj.get("School").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `School` to be a primitive type in the JSON string but got `%s`", jsonObj.get("School").toString())); + } + if ((jsonObj.get("Degree") != null && !jsonObj.get("Degree").isJsonNull()) && !jsonObj.get("Degree").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Degree` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Degree").toString())); + } + if ((jsonObj.get("FieldOfStudy") != null && !jsonObj.get("FieldOfStudy").isJsonNull()) && !jsonObj.get("FieldOfStudy").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FieldOfStudy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FieldOfStudy").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelEducationsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelEducationsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelEducationsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelEducationsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelEducationsInner>() { + @Override + public void write(JsonWriter out, ManageRegisterModelEducationsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelEducationsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelEducationsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelEducationsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelEducationsInner + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelEducationsInner + */ + public static ManageRegisterModelEducationsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelEducationsInner.class); + } + + /** + * Convert an instance of ManageRegisterModelEducationsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelEmailInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelEmailInner.java new file mode 100644 index 0000000..d48e3ff --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelEmailInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModelEmailInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelEmailInner { + public static final String SERIALIZED_NAME_TYPE = "Type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_VALUE = "Value"; + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nullable + private String value; + + public ManageRegisterModelEmailInner() { + } + + public ManageRegisterModelEmailInner type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * The type of the Email (e.g., Primary, Secondary). + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public ManageRegisterModelEmailInner value(@javax.annotation.Nullable String value) { + this.value = value; + return this; + } + + /** + * The Email address. + * @return value + */ + @javax.annotation.Nullable + public String getValue() { + return value; + } + + public void setValue(@javax.annotation.Nullable String value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelEmailInner instance itself + */ + public ManageRegisterModelEmailInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelEmailInner manageRegisterModelEmailInner = (ManageRegisterModelEmailInner) o; + return Objects.equals(this.type, manageRegisterModelEmailInner.type) && + Objects.equals(this.value, manageRegisterModelEmailInner.value)&& + Objects.equals(this.additionalProperties, manageRegisterModelEmailInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelEmailInner {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Type"); + openapiFields.add("Value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelEmailInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelEmailInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelEmailInner is not found in the empty JSON string", ManageRegisterModelEmailInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonNull()) && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + if ((jsonObj.get("Value") != null && !jsonObj.get("Value").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelEmailInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelEmailInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelEmailInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelEmailInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelEmailInner>() { + @Override + public void write(JsonWriter out, ManageRegisterModelEmailInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelEmailInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelEmailInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelEmailInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelEmailInner + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelEmailInner + */ + public static ManageRegisterModelEmailInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelEmailInner.class); + } + + /** + * Convert an instance of ManageRegisterModelEmailInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelFamilyInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelFamilyInner.java new file mode 100644 index 0000000..63ac215 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelFamilyInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModelFamilyInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelFamilyInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_RELATIONSHIP = "Relationship"; + @SerializedName(SERIALIZED_NAME_RELATIONSHIP) + @javax.annotation.Nullable + private String relationship; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ManageRegisterModelFamilyInner() { + } + + public ManageRegisterModelFamilyInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the family member. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ManageRegisterModelFamilyInner relationship(@javax.annotation.Nullable String relationship) { + this.relationship = relationship; + return this; + } + + /** + * The relationship with the family member. + * @return relationship + */ + @javax.annotation.Nullable + public String getRelationship() { + return relationship; + } + + public void setRelationship(@javax.annotation.Nullable String relationship) { + this.relationship = relationship; + } + + + public ManageRegisterModelFamilyInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the family member. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelFamilyInner instance itself + */ + public ManageRegisterModelFamilyInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelFamilyInner manageRegisterModelFamilyInner = (ManageRegisterModelFamilyInner) o; + return Objects.equals(this.id, manageRegisterModelFamilyInner.id) && + Objects.equals(this.relationship, manageRegisterModelFamilyInner.relationship) && + Objects.equals(this.name, manageRegisterModelFamilyInner.name)&& + Objects.equals(this.additionalProperties, manageRegisterModelFamilyInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, relationship, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelFamilyInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationship: ").append(toIndentedString(relationship)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Relationship"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelFamilyInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelFamilyInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelFamilyInner is not found in the empty JSON string", ManageRegisterModelFamilyInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Relationship") != null && !jsonObj.get("Relationship").isJsonNull()) && !jsonObj.get("Relationship").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Relationship` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Relationship").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelFamilyInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelFamilyInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelFamilyInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelFamilyInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelFamilyInner>() { + @Override + public void write(JsonWriter out, ManageRegisterModelFamilyInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelFamilyInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelFamilyInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelFamilyInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelFamilyInner + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelFamilyInner + */ + public static ManageRegisterModelFamilyInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelFamilyInner.class); + } + + /** + * Convert an instance of ManageRegisterModelFamilyInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelFavoriteThingsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelFavoriteThingsInner.java new file mode 100644 index 0000000..592020f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelFavoriteThingsInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModelFavoriteThingsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelFavoriteThingsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_TYPE = "Type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public ManageRegisterModelFavoriteThingsInner() { + } + + public ManageRegisterModelFavoriteThingsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the favorite thing. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ManageRegisterModelFavoriteThingsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the favorite thing. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ManageRegisterModelFavoriteThingsInner type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * The type of the favorite thing. + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelFavoriteThingsInner instance itself + */ + public ManageRegisterModelFavoriteThingsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelFavoriteThingsInner manageRegisterModelFavoriteThingsInner = (ManageRegisterModelFavoriteThingsInner) o; + return Objects.equals(this.id, manageRegisterModelFavoriteThingsInner.id) && + Objects.equals(this.name, manageRegisterModelFavoriteThingsInner.name) && + Objects.equals(this.type, manageRegisterModelFavoriteThingsInner.type)&& + Objects.equals(this.additionalProperties, manageRegisterModelFavoriteThingsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelFavoriteThingsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelFavoriteThingsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelFavoriteThingsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelFavoriteThingsInner is not found in the empty JSON string", ManageRegisterModelFavoriteThingsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Type") != null && !jsonObj.get("Type").isJsonNull()) && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelFavoriteThingsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelFavoriteThingsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelFavoriteThingsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelFavoriteThingsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelFavoriteThingsInner>() { + @Override + public void write(JsonWriter out, ManageRegisterModelFavoriteThingsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelFavoriteThingsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelFavoriteThingsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelFavoriteThingsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelFavoriteThingsInner + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelFavoriteThingsInner + */ + public static ManageRegisterModelFavoriteThingsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelFavoriteThingsInner.class); + } + + /** + * Convert an instance of ManageRegisterModelFavoriteThingsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelGamesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelGamesInner.java new file mode 100644 index 0000000..b48c3c1 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelGamesInner.java @@ -0,0 +1,375 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModelGamesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelGamesInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_CATEGORY = "Category"; + @SerializedName(SERIALIZED_NAME_CATEGORY) + @javax.annotation.Nullable + private String category; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public ManageRegisterModelGamesInner() { + } + + public ManageRegisterModelGamesInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the game. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ManageRegisterModelGamesInner category(@javax.annotation.Nullable String category) { + this.category = category; + return this; + } + + /** + * The category of the game. + * @return category + */ + @javax.annotation.Nullable + public String getCategory() { + return category; + } + + public void setCategory(@javax.annotation.Nullable String category) { + this.category = category; + } + + + public ManageRegisterModelGamesInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the game. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ManageRegisterModelGamesInner createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * The date the game was added. + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelGamesInner instance itself + */ + public ManageRegisterModelGamesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelGamesInner manageRegisterModelGamesInner = (ManageRegisterModelGamesInner) o; + return Objects.equals(this.id, manageRegisterModelGamesInner.id) && + Objects.equals(this.category, manageRegisterModelGamesInner.category) && + Objects.equals(this.name, manageRegisterModelGamesInner.name) && + Objects.equals(this.createdDate, manageRegisterModelGamesInner.createdDate)&& + Objects.equals(this.additionalProperties, manageRegisterModelGamesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, createdDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelGamesInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Category"); + openapiFields.add("Name"); + openapiFields.add("CreatedDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelGamesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelGamesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelGamesInner is not found in the empty JSON string", ManageRegisterModelGamesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Category") != null && !jsonObj.get("Category").isJsonNull()) && !jsonObj.get("Category").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Category` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Category").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelGamesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelGamesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelGamesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelGamesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelGamesInner>() { + @Override + public void write(JsonWriter out, ManageRegisterModelGamesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelGamesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelGamesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelGamesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelGamesInner + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelGamesInner + */ + public static ManageRegisterModelGamesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelGamesInner.class); + } + + /** + * Convert an instance of ManageRegisterModelGamesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelJobBookmarksInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelJobBookmarksInner.java new file mode 100644 index 0000000..2920974 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelJobBookmarksInner.java @@ -0,0 +1,398 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ManageRegisterModelJobBookmarksInnerJob; +import java.io.IOException; +import java.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModelJobBookmarksInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelJobBookmarksInner { + public static final String SERIALIZED_NAME_IS_APPLIED = "IsApplied"; + @SerializedName(SERIALIZED_NAME_IS_APPLIED) + @javax.annotation.Nullable + private Boolean isApplied; + + public static final String SERIALIZED_NAME_IS_SAVED = "IsSaved"; + @SerializedName(SERIALIZED_NAME_IS_SAVED) + @javax.annotation.Nullable + private Boolean isSaved; + + public static final String SERIALIZED_NAME_APPLY_TIMESTAMP = "ApplyTimestamp"; + @SerializedName(SERIALIZED_NAME_APPLY_TIMESTAMP) + @javax.annotation.Nullable + private OffsetDateTime applyTimestamp; + + public static final String SERIALIZED_NAME_SAVED_TIMESTAMP = "SavedTimestamp"; + @SerializedName(SERIALIZED_NAME_SAVED_TIMESTAMP) + @javax.annotation.Nullable + private OffsetDateTime savedTimestamp; + + public static final String SERIALIZED_NAME_JOB = "Job"; + @SerializedName(SERIALIZED_NAME_JOB) + @javax.annotation.Nullable + private ManageRegisterModelJobBookmarksInnerJob job; + + public ManageRegisterModelJobBookmarksInner() { + } + + public ManageRegisterModelJobBookmarksInner isApplied(@javax.annotation.Nullable Boolean isApplied) { + this.isApplied = isApplied; + return this; + } + + /** + * Indicates if the job has been applied for. + * @return isApplied + */ + @javax.annotation.Nullable + public Boolean getIsApplied() { + return isApplied; + } + + public void setIsApplied(@javax.annotation.Nullable Boolean isApplied) { + this.isApplied = isApplied; + } + + + public ManageRegisterModelJobBookmarksInner isSaved(@javax.annotation.Nullable Boolean isSaved) { + this.isSaved = isSaved; + return this; + } + + /** + * Indicates if the job has been saved. + * @return isSaved + */ + @javax.annotation.Nullable + public Boolean getIsSaved() { + return isSaved; + } + + public void setIsSaved(@javax.annotation.Nullable Boolean isSaved) { + this.isSaved = isSaved; + } + + + public ManageRegisterModelJobBookmarksInner applyTimestamp(@javax.annotation.Nullable OffsetDateTime applyTimestamp) { + this.applyTimestamp = applyTimestamp; + return this; + } + + /** + * The timestamp when the job was applied for. + * @return applyTimestamp + */ + @javax.annotation.Nullable + public OffsetDateTime getApplyTimestamp() { + return applyTimestamp; + } + + public void setApplyTimestamp(@javax.annotation.Nullable OffsetDateTime applyTimestamp) { + this.applyTimestamp = applyTimestamp; + } + + + public ManageRegisterModelJobBookmarksInner savedTimestamp(@javax.annotation.Nullable OffsetDateTime savedTimestamp) { + this.savedTimestamp = savedTimestamp; + return this; + } + + /** + * The timestamp when the job was saved. + * @return savedTimestamp + */ + @javax.annotation.Nullable + public OffsetDateTime getSavedTimestamp() { + return savedTimestamp; + } + + public void setSavedTimestamp(@javax.annotation.Nullable OffsetDateTime savedTimestamp) { + this.savedTimestamp = savedTimestamp; + } + + + public ManageRegisterModelJobBookmarksInner job(@javax.annotation.Nullable ManageRegisterModelJobBookmarksInnerJob job) { + this.job = job; + return this; + } + + /** + * Get job + * @return job + */ + @javax.annotation.Nullable + public ManageRegisterModelJobBookmarksInnerJob getJob() { + return job; + } + + public void setJob(@javax.annotation.Nullable ManageRegisterModelJobBookmarksInnerJob job) { + this.job = job; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelJobBookmarksInner instance itself + */ + public ManageRegisterModelJobBookmarksInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelJobBookmarksInner manageRegisterModelJobBookmarksInner = (ManageRegisterModelJobBookmarksInner) o; + return Objects.equals(this.isApplied, manageRegisterModelJobBookmarksInner.isApplied) && + Objects.equals(this.isSaved, manageRegisterModelJobBookmarksInner.isSaved) && + Objects.equals(this.applyTimestamp, manageRegisterModelJobBookmarksInner.applyTimestamp) && + Objects.equals(this.savedTimestamp, manageRegisterModelJobBookmarksInner.savedTimestamp) && + Objects.equals(this.job, manageRegisterModelJobBookmarksInner.job)&& + Objects.equals(this.additionalProperties, manageRegisterModelJobBookmarksInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isApplied, isSaved, applyTimestamp, savedTimestamp, job, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelJobBookmarksInner {\n"); + sb.append(" isApplied: ").append(toIndentedString(isApplied)).append("\n"); + sb.append(" isSaved: ").append(toIndentedString(isSaved)).append("\n"); + sb.append(" applyTimestamp: ").append(toIndentedString(applyTimestamp)).append("\n"); + sb.append(" savedTimestamp: ").append(toIndentedString(savedTimestamp)).append("\n"); + sb.append(" job: ").append(toIndentedString(job)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsApplied"); + openapiFields.add("IsSaved"); + openapiFields.add("ApplyTimestamp"); + openapiFields.add("SavedTimestamp"); + openapiFields.add("Job"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelJobBookmarksInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelJobBookmarksInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelJobBookmarksInner is not found in the empty JSON string", ManageRegisterModelJobBookmarksInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `Job` + if (jsonObj.get("Job") != null && !jsonObj.get("Job").isJsonNull()) { + ManageRegisterModelJobBookmarksInnerJob.validateJsonElement(jsonObj.get("Job")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelJobBookmarksInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelJobBookmarksInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelJobBookmarksInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelJobBookmarksInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelJobBookmarksInner>() { + @Override + public void write(JsonWriter out, ManageRegisterModelJobBookmarksInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelJobBookmarksInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelJobBookmarksInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelJobBookmarksInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelJobBookmarksInner + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelJobBookmarksInner + */ + public static ManageRegisterModelJobBookmarksInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelJobBookmarksInner.class); + } + + /** + * Convert an instance of ManageRegisterModelJobBookmarksInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelJobBookmarksInnerJob.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelJobBookmarksInnerJob.java new file mode 100644 index 0000000..9b333b8 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelJobBookmarksInnerJob.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * Details of the job. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelJobBookmarksInnerJob { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_TITLE = "Title"; + @SerializedName(SERIALIZED_NAME_TITLE) + @javax.annotation.Nullable + private String title; + + public static final String SERIALIZED_NAME_COMPANY = "Company"; + @SerializedName(SERIALIZED_NAME_COMPANY) + @javax.annotation.Nullable + private String company; + + public ManageRegisterModelJobBookmarksInnerJob() { + } + + public ManageRegisterModelJobBookmarksInnerJob id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the job. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ManageRegisterModelJobBookmarksInnerJob title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * The title of the job. + * @return title + */ + @javax.annotation.Nullable + public String getTitle() { + return title; + } + + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + public ManageRegisterModelJobBookmarksInnerJob company(@javax.annotation.Nullable String company) { + this.company = company; + return this; + } + + /** + * The company offering the job. + * @return company + */ + @javax.annotation.Nullable + public String getCompany() { + return company; + } + + public void setCompany(@javax.annotation.Nullable String company) { + this.company = company; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelJobBookmarksInnerJob instance itself + */ + public ManageRegisterModelJobBookmarksInnerJob putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelJobBookmarksInnerJob manageRegisterModelJobBookmarksInnerJob = (ManageRegisterModelJobBookmarksInnerJob) o; + return Objects.equals(this.id, manageRegisterModelJobBookmarksInnerJob.id) && + Objects.equals(this.title, manageRegisterModelJobBookmarksInnerJob.title) && + Objects.equals(this.company, manageRegisterModelJobBookmarksInnerJob.company)&& + Objects.equals(this.additionalProperties, manageRegisterModelJobBookmarksInnerJob.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, title, company, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelJobBookmarksInnerJob {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" company: ").append(toIndentedString(company)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Title"); + openapiFields.add("Company"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelJobBookmarksInnerJob + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelJobBookmarksInnerJob.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelJobBookmarksInnerJob is not found in the empty JSON string", ManageRegisterModelJobBookmarksInnerJob.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Title") != null && !jsonObj.get("Title").isJsonNull()) && !jsonObj.get("Title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Title").toString())); + } + if ((jsonObj.get("Company") != null && !jsonObj.get("Company").isJsonNull()) && !jsonObj.get("Company").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Company` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Company").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelJobBookmarksInnerJob.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelJobBookmarksInnerJob' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelJobBookmarksInnerJob> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelJobBookmarksInnerJob.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelJobBookmarksInnerJob>() { + @Override + public void write(JsonWriter out, ManageRegisterModelJobBookmarksInnerJob value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelJobBookmarksInnerJob read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelJobBookmarksInnerJob instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelJobBookmarksInnerJob given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelJobBookmarksInnerJob + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelJobBookmarksInnerJob + */ + public static ManageRegisterModelJobBookmarksInnerJob fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelJobBookmarksInnerJob.class); + } + + /** + * Convert an instance of ManageRegisterModelJobBookmarksInnerJob to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelLanguagesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelLanguagesInner.java new file mode 100644 index 0000000..612abaa --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelLanguagesInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModelLanguagesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelLanguagesInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_PROFICIENCY = "Proficiency"; + @SerializedName(SERIALIZED_NAME_PROFICIENCY) + @javax.annotation.Nullable + private String proficiency; + + public ManageRegisterModelLanguagesInner() { + } + + public ManageRegisterModelLanguagesInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the language. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ManageRegisterModelLanguagesInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the language. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ManageRegisterModelLanguagesInner proficiency(@javax.annotation.Nullable String proficiency) { + this.proficiency = proficiency; + return this; + } + + /** + * The proficiency level in the language. + * @return proficiency + */ + @javax.annotation.Nullable + public String getProficiency() { + return proficiency; + } + + public void setProficiency(@javax.annotation.Nullable String proficiency) { + this.proficiency = proficiency; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelLanguagesInner instance itself + */ + public ManageRegisterModelLanguagesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelLanguagesInner manageRegisterModelLanguagesInner = (ManageRegisterModelLanguagesInner) o; + return Objects.equals(this.id, manageRegisterModelLanguagesInner.id) && + Objects.equals(this.name, manageRegisterModelLanguagesInner.name) && + Objects.equals(this.proficiency, manageRegisterModelLanguagesInner.proficiency)&& + Objects.equals(this.additionalProperties, manageRegisterModelLanguagesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, proficiency, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelLanguagesInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" proficiency: ").append(toIndentedString(proficiency)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Proficiency"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelLanguagesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelLanguagesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelLanguagesInner is not found in the empty JSON string", ManageRegisterModelLanguagesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Proficiency") != null && !jsonObj.get("Proficiency").isJsonNull()) && !jsonObj.get("Proficiency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Proficiency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Proficiency").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelLanguagesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelLanguagesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelLanguagesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelLanguagesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelLanguagesInner>() { + @Override + public void write(JsonWriter out, ManageRegisterModelLanguagesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelLanguagesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelLanguagesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelLanguagesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelLanguagesInner + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelLanguagesInner + */ + public static ManageRegisterModelLanguagesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelLanguagesInner.class); + } + + /** + * Convert an instance of ManageRegisterModelLanguagesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelMemberUrlResourcesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelMemberUrlResourcesInner.java new file mode 100644 index 0000000..120b3ef --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelMemberUrlResourcesInner.java @@ -0,0 +1,318 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.net.URI; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModelMemberUrlResourcesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelMemberUrlResourcesInner { + public static final String SERIALIZED_NAME_URL = "Url"; + @SerializedName(SERIALIZED_NAME_URL) + @javax.annotation.Nullable + private URI url; + + public static final String SERIALIZED_NAME_URL_NAME = "UrlName"; + @SerializedName(SERIALIZED_NAME_URL_NAME) + @javax.annotation.Nullable + private String urlName; + + public ManageRegisterModelMemberUrlResourcesInner() { + } + + public ManageRegisterModelMemberUrlResourcesInner url(@javax.annotation.Nullable URI url) { + this.url = url; + return this; + } + + /** + * The URL of the resource. + * @return url + */ + @javax.annotation.Nullable + public URI getUrl() { + return url; + } + + public void setUrl(@javax.annotation.Nullable URI url) { + this.url = url; + } + + + public ManageRegisterModelMemberUrlResourcesInner urlName(@javax.annotation.Nullable String urlName) { + this.urlName = urlName; + return this; + } + + /** + * The name of the resource URL. + * @return urlName + */ + @javax.annotation.Nullable + public String getUrlName() { + return urlName; + } + + public void setUrlName(@javax.annotation.Nullable String urlName) { + this.urlName = urlName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelMemberUrlResourcesInner instance itself + */ + public ManageRegisterModelMemberUrlResourcesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelMemberUrlResourcesInner manageRegisterModelMemberUrlResourcesInner = (ManageRegisterModelMemberUrlResourcesInner) o; + return Objects.equals(this.url, manageRegisterModelMemberUrlResourcesInner.url) && + Objects.equals(this.urlName, manageRegisterModelMemberUrlResourcesInner.urlName)&& + Objects.equals(this.additionalProperties, manageRegisterModelMemberUrlResourcesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(url, urlName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelMemberUrlResourcesInner {\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" urlName: ").append(toIndentedString(urlName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Url"); + openapiFields.add("UrlName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelMemberUrlResourcesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelMemberUrlResourcesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelMemberUrlResourcesInner is not found in the empty JSON string", ManageRegisterModelMemberUrlResourcesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Url") != null && !jsonObj.get("Url").isJsonNull()) && !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())); + } + if ((jsonObj.get("UrlName") != null && !jsonObj.get("UrlName").isJsonNull()) && !jsonObj.get("UrlName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UrlName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UrlName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelMemberUrlResourcesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelMemberUrlResourcesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelMemberUrlResourcesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelMemberUrlResourcesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelMemberUrlResourcesInner>() { + @Override + public void write(JsonWriter out, ManageRegisterModelMemberUrlResourcesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelMemberUrlResourcesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelMemberUrlResourcesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelMemberUrlResourcesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelMemberUrlResourcesInner + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelMemberUrlResourcesInner + */ + public static ManageRegisterModelMemberUrlResourcesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelMemberUrlResourcesInner.class); + } + + /** + * Convert an instance of ManageRegisterModelMemberUrlResourcesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelMoviesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelMoviesInner.java new file mode 100644 index 0000000..0f1e3ee --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelMoviesInner.java @@ -0,0 +1,375 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModelMoviesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelMoviesInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_CATEGORY = "Category"; + @SerializedName(SERIALIZED_NAME_CATEGORY) + @javax.annotation.Nullable + private String category; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public ManageRegisterModelMoviesInner() { + } + + public ManageRegisterModelMoviesInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the movie. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ManageRegisterModelMoviesInner category(@javax.annotation.Nullable String category) { + this.category = category; + return this; + } + + /** + * The category of the movie. + * @return category + */ + @javax.annotation.Nullable + public String getCategory() { + return category; + } + + public void setCategory(@javax.annotation.Nullable String category) { + this.category = category; + } + + + public ManageRegisterModelMoviesInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the movie. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ManageRegisterModelMoviesInner createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * The date the movie was added. + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelMoviesInner instance itself + */ + public ManageRegisterModelMoviesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelMoviesInner manageRegisterModelMoviesInner = (ManageRegisterModelMoviesInner) o; + return Objects.equals(this.id, manageRegisterModelMoviesInner.id) && + Objects.equals(this.category, manageRegisterModelMoviesInner.category) && + Objects.equals(this.name, manageRegisterModelMoviesInner.name) && + Objects.equals(this.createdDate, manageRegisterModelMoviesInner.createdDate)&& + Objects.equals(this.additionalProperties, manageRegisterModelMoviesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, createdDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelMoviesInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Category"); + openapiFields.add("Name"); + openapiFields.add("CreatedDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelMoviesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelMoviesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelMoviesInner is not found in the empty JSON string", ManageRegisterModelMoviesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Category") != null && !jsonObj.get("Category").isJsonNull()) && !jsonObj.get("Category").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Category` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Category").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelMoviesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelMoviesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelMoviesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelMoviesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelMoviesInner>() { + @Override + public void write(JsonWriter out, ManageRegisterModelMoviesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelMoviesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelMoviesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelMoviesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelMoviesInner + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelMoviesInner + */ + public static ManageRegisterModelMoviesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelMoviesInner.class); + } + + /** + * Convert an instance of ManageRegisterModelMoviesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelMutualFriendsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelMutualFriendsInner.java new file mode 100644 index 0000000..a7df730 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelMutualFriendsInner.java @@ -0,0 +1,495 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.LocalDate; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModelMutualFriendsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelMutualFriendsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_FIRST_NAME = "FirstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nullable + private String firstName; + + public static final String SERIALIZED_NAME_LAST_NAME = "LastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nullable + private String lastName; + + public static final String SERIALIZED_NAME_BIRTHDAY = "Birthday"; + @SerializedName(SERIALIZED_NAME_BIRTHDAY) + @javax.annotation.Nullable + private LocalDate birthday; + + public static final String SERIALIZED_NAME_HOMETOWN = "Hometown"; + @SerializedName(SERIALIZED_NAME_HOMETOWN) + @javax.annotation.Nullable + private String hometown; + + public static final String SERIALIZED_NAME_LINK = "Link"; + @SerializedName(SERIALIZED_NAME_LINK) + @javax.annotation.Nullable + private String link; + + public static final String SERIALIZED_NAME_GENDER = "Gender"; + @SerializedName(SERIALIZED_NAME_GENDER) + @javax.annotation.Nullable + private String gender; + + public ManageRegisterModelMutualFriendsInner() { + } + + public ManageRegisterModelMutualFriendsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the mutual friend. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ManageRegisterModelMutualFriendsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the mutual friend. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ManageRegisterModelMutualFriendsInner firstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * The first name of the mutual friend. + * @return firstName + */ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + } + + + public ManageRegisterModelMutualFriendsInner lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * The last name of the mutual friend. + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + + public ManageRegisterModelMutualFriendsInner birthday(@javax.annotation.Nullable LocalDate birthday) { + this.birthday = birthday; + return this; + } + + /** + * The birthday of the mutual friend. + * @return birthday + */ + @javax.annotation.Nullable + public LocalDate getBirthday() { + return birthday; + } + + public void setBirthday(@javax.annotation.Nullable LocalDate birthday) { + this.birthday = birthday; + } + + + public ManageRegisterModelMutualFriendsInner hometown(@javax.annotation.Nullable String hometown) { + this.hometown = hometown; + return this; + } + + /** + * The hometown of the mutual friend. + * @return hometown + */ + @javax.annotation.Nullable + public String getHometown() { + return hometown; + } + + public void setHometown(@javax.annotation.Nullable String hometown) { + this.hometown = hometown; + } + + + public ManageRegisterModelMutualFriendsInner link(@javax.annotation.Nullable String link) { + this.link = link; + return this; + } + + /** + * The profile link of the mutual friend. + * @return link + */ + @javax.annotation.Nullable + public String getLink() { + return link; + } + + public void setLink(@javax.annotation.Nullable String link) { + this.link = link; + } + + + public ManageRegisterModelMutualFriendsInner gender(@javax.annotation.Nullable String gender) { + this.gender = gender; + return this; + } + + /** + * The gender of the mutual friend. + * @return gender + */ + @javax.annotation.Nullable + public String getGender() { + return gender; + } + + public void setGender(@javax.annotation.Nullable String gender) { + this.gender = gender; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelMutualFriendsInner instance itself + */ + public ManageRegisterModelMutualFriendsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelMutualFriendsInner manageRegisterModelMutualFriendsInner = (ManageRegisterModelMutualFriendsInner) o; + return Objects.equals(this.id, manageRegisterModelMutualFriendsInner.id) && + Objects.equals(this.name, manageRegisterModelMutualFriendsInner.name) && + Objects.equals(this.firstName, manageRegisterModelMutualFriendsInner.firstName) && + Objects.equals(this.lastName, manageRegisterModelMutualFriendsInner.lastName) && + Objects.equals(this.birthday, manageRegisterModelMutualFriendsInner.birthday) && + Objects.equals(this.hometown, manageRegisterModelMutualFriendsInner.hometown) && + Objects.equals(this.link, manageRegisterModelMutualFriendsInner.link) && + Objects.equals(this.gender, manageRegisterModelMutualFriendsInner.gender)&& + Objects.equals(this.additionalProperties, manageRegisterModelMutualFriendsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, firstName, lastName, birthday, hometown, link, gender, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelMutualFriendsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" birthday: ").append(toIndentedString(birthday)).append("\n"); + sb.append(" hometown: ").append(toIndentedString(hometown)).append("\n"); + sb.append(" link: ").append(toIndentedString(link)).append("\n"); + sb.append(" gender: ").append(toIndentedString(gender)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("FirstName"); + openapiFields.add("LastName"); + openapiFields.add("Birthday"); + openapiFields.add("Hometown"); + openapiFields.add("Link"); + openapiFields.add("Gender"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelMutualFriendsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelMutualFriendsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelMutualFriendsInner is not found in the empty JSON string", ManageRegisterModelMutualFriendsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("FirstName") != null && !jsonObj.get("FirstName").isJsonNull()) && !jsonObj.get("FirstName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FirstName").toString())); + } + if ((jsonObj.get("LastName") != null && !jsonObj.get("LastName").isJsonNull()) && !jsonObj.get("LastName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastName").toString())); + } + if ((jsonObj.get("Hometown") != null && !jsonObj.get("Hometown").isJsonNull()) && !jsonObj.get("Hometown").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Hometown` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Hometown").toString())); + } + 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())); + } + if ((jsonObj.get("Gender") != null && !jsonObj.get("Gender").isJsonNull()) && !jsonObj.get("Gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Gender").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelMutualFriendsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelMutualFriendsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelMutualFriendsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelMutualFriendsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelMutualFriendsInner>() { + @Override + public void write(JsonWriter out, ManageRegisterModelMutualFriendsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelMutualFriendsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelMutualFriendsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelMutualFriendsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelMutualFriendsInner + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelMutualFriendsInner + */ + public static ManageRegisterModelMutualFriendsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelMutualFriendsInner.class); + } + + /** + * Convert an instance of ManageRegisterModelMutualFriendsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelPINInfo.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelPINInfo.java new file mode 100644 index 0000000..0b579c8 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelPINInfo.java @@ -0,0 +1,380 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * PIN information of the User. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelPINInfo { + public static final String SERIALIZED_NAME_P_I_N = "PIN"; + @SerializedName(SERIALIZED_NAME_P_I_N) + @javax.annotation.Nullable + private String PIN; + + public static final String SERIALIZED_NAME_SKIPPED = "Skipped"; + @SerializedName(SERIALIZED_NAME_SKIPPED) + @javax.annotation.Nullable + private Boolean skipped; + + public static final String SERIALIZED_NAME_IS_VALID = "IsValid"; + @SerializedName(SERIALIZED_NAME_IS_VALID) + @javax.annotation.Nullable + private Boolean isValid; + + public static final String SERIALIZED_NAME_IO_VALIDATION_REQUIRED = "IOValidationRequired"; + @SerializedName(SERIALIZED_NAME_IO_VALIDATION_REQUIRED) + @javax.annotation.Nullable + private Boolean ioValidationRequired; + + public ManageRegisterModelPINInfo() { + } + + public ManageRegisterModelPINInfo PIN(@javax.annotation.Nullable String PIN) { + this.PIN = PIN; + return this; + } + + /** + * The PIN of the User. + * @return PIN + */ + @javax.annotation.Nullable + public String getPIN() { + return PIN; + } + + public void setPIN(@javax.annotation.Nullable String PIN) { + this.PIN = PIN; + } + + + public ManageRegisterModelPINInfo skipped(@javax.annotation.Nullable Boolean skipped) { + this.skipped = skipped; + return this; + } + + /** + * Indicates if the PIN setup was skipped. + * @return skipped + */ + @javax.annotation.Nullable + public Boolean getSkipped() { + return skipped; + } + + public void setSkipped(@javax.annotation.Nullable Boolean skipped) { + this.skipped = skipped; + } + + + public ManageRegisterModelPINInfo isValid(@javax.annotation.Nullable Boolean isValid) { + this.isValid = isValid; + return this; + } + + /** + * Indicates if the PIN is valid. + * @return isValid + */ + @javax.annotation.Nullable + public Boolean getIsValid() { + return isValid; + } + + public void setIsValid(@javax.annotation.Nullable Boolean isValid) { + this.isValid = isValid; + } + + + public ManageRegisterModelPINInfo ioValidationRequired(@javax.annotation.Nullable Boolean ioValidationRequired) { + this.ioValidationRequired = ioValidationRequired; + return this; + } + + /** + * Indicates if IO validation is required. + * @return ioValidationRequired + */ + @javax.annotation.Nullable + public Boolean getIoValidationRequired() { + return ioValidationRequired; + } + + public void setIoValidationRequired(@javax.annotation.Nullable Boolean ioValidationRequired) { + this.ioValidationRequired = ioValidationRequired; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelPINInfo instance itself + */ + public ManageRegisterModelPINInfo putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelPINInfo manageRegisterModelPINInfo = (ManageRegisterModelPINInfo) o; + return Objects.equals(this.PIN, manageRegisterModelPINInfo.PIN) && + Objects.equals(this.skipped, manageRegisterModelPINInfo.skipped) && + Objects.equals(this.isValid, manageRegisterModelPINInfo.isValid) && + Objects.equals(this.ioValidationRequired, manageRegisterModelPINInfo.ioValidationRequired)&& + Objects.equals(this.additionalProperties, manageRegisterModelPINInfo.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(PIN, skipped, isValid, ioValidationRequired, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelPINInfo {\n"); + sb.append(" PIN: ").append(toIndentedString(PIN)).append("\n"); + sb.append(" skipped: ").append(toIndentedString(skipped)).append("\n"); + sb.append(" isValid: ").append(toIndentedString(isValid)).append("\n"); + sb.append(" ioValidationRequired: ").append(toIndentedString(ioValidationRequired)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("PIN"); + openapiFields.add("Skipped"); + openapiFields.add("IsValid"); + openapiFields.add("IOValidationRequired"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelPINInfo + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelPINInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelPINInfo is not found in the empty JSON string", ManageRegisterModelPINInfo.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("PIN") != null && !jsonObj.get("PIN").isJsonNull()) && !jsonObj.get("PIN").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PIN` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PIN").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelPINInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelPINInfo' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelPINInfo> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelPINInfo.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelPINInfo>() { + @Override + public void write(JsonWriter out, ManageRegisterModelPINInfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelPINInfo read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelPINInfo instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelPINInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelPINInfo + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelPINInfo + */ + public static ManageRegisterModelPINInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelPINInfo.class); + } + + /** + * Convert an instance of ManageRegisterModelPINInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelPatentsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelPatentsInner.java new file mode 100644 index 0000000..ce1b7ca --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelPatentsInner.java @@ -0,0 +1,345 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.LocalDate; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModelPatentsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelPatentsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_TITLE = "Title"; + @SerializedName(SERIALIZED_NAME_TITLE) + @javax.annotation.Nullable + private String title; + + public static final String SERIALIZED_NAME_DATE = "Date"; + @SerializedName(SERIALIZED_NAME_DATE) + @javax.annotation.Nullable + private LocalDate date; + + public ManageRegisterModelPatentsInner() { + } + + public ManageRegisterModelPatentsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the patent. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ManageRegisterModelPatentsInner title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * The title of the patent. + * @return title + */ + @javax.annotation.Nullable + public String getTitle() { + return title; + } + + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + public ManageRegisterModelPatentsInner date(@javax.annotation.Nullable LocalDate date) { + this.date = date; + return this; + } + + /** + * The date the patent was filed. + * @return date + */ + @javax.annotation.Nullable + public LocalDate getDate() { + return date; + } + + public void setDate(@javax.annotation.Nullable LocalDate date) { + this.date = date; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelPatentsInner instance itself + */ + public ManageRegisterModelPatentsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelPatentsInner manageRegisterModelPatentsInner = (ManageRegisterModelPatentsInner) o; + return Objects.equals(this.id, manageRegisterModelPatentsInner.id) && + Objects.equals(this.title, manageRegisterModelPatentsInner.title) && + Objects.equals(this.date, manageRegisterModelPatentsInner.date)&& + Objects.equals(this.additionalProperties, manageRegisterModelPatentsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, title, date, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelPatentsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Title"); + openapiFields.add("Date"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelPatentsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelPatentsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelPatentsInner is not found in the empty JSON string", ManageRegisterModelPatentsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Title") != null && !jsonObj.get("Title").isJsonNull()) && !jsonObj.get("Title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Title").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelPatentsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelPatentsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelPatentsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelPatentsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelPatentsInner>() { + @Override + public void write(JsonWriter out, ManageRegisterModelPatentsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelPatentsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelPatentsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelPatentsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelPatentsInner + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelPatentsInner + */ + public static ManageRegisterModelPatentsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelPatentsInner.class); + } + + /** + * Convert an instance of ManageRegisterModelPatentsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelPlacesLivedInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelPlacesLivedInner.java new file mode 100644 index 0000000..3e85708 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelPlacesLivedInner.java @@ -0,0 +1,344 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModelPlacesLivedInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelPlacesLivedInner { + public static final String SERIALIZED_NAME_IS_PRIMARY = "IsPrimary"; + @SerializedName(SERIALIZED_NAME_IS_PRIMARY) + @javax.annotation.Nullable + private Boolean isPrimary; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_OPERATION = "Operation"; + @SerializedName(SERIALIZED_NAME_OPERATION) + @javax.annotation.Nullable + private String operation; + + public ManageRegisterModelPlacesLivedInner() { + } + + public ManageRegisterModelPlacesLivedInner isPrimary(@javax.annotation.Nullable Boolean isPrimary) { + this.isPrimary = isPrimary; + return this; + } + + /** + * Indicates if the place is the primary residence. + * @return isPrimary + */ + @javax.annotation.Nullable + public Boolean getIsPrimary() { + return isPrimary; + } + + public void setIsPrimary(@javax.annotation.Nullable Boolean isPrimary) { + this.isPrimary = isPrimary; + } + + + public ManageRegisterModelPlacesLivedInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the place. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ManageRegisterModelPlacesLivedInner operation(@javax.annotation.Nullable String operation) { + this.operation = operation; + return this; + } + + /** + * The operation performed on the place. + * @return operation + */ + @javax.annotation.Nullable + public String getOperation() { + return operation; + } + + public void setOperation(@javax.annotation.Nullable String operation) { + this.operation = operation; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelPlacesLivedInner instance itself + */ + public ManageRegisterModelPlacesLivedInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelPlacesLivedInner manageRegisterModelPlacesLivedInner = (ManageRegisterModelPlacesLivedInner) o; + return Objects.equals(this.isPrimary, manageRegisterModelPlacesLivedInner.isPrimary) && + Objects.equals(this.name, manageRegisterModelPlacesLivedInner.name) && + Objects.equals(this.operation, manageRegisterModelPlacesLivedInner.operation)&& + Objects.equals(this.additionalProperties, manageRegisterModelPlacesLivedInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isPrimary, name, operation, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelPlacesLivedInner {\n"); + sb.append(" isPrimary: ").append(toIndentedString(isPrimary)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" operation: ").append(toIndentedString(operation)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsPrimary"); + openapiFields.add("Name"); + openapiFields.add("Operation"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelPlacesLivedInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelPlacesLivedInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelPlacesLivedInner is not found in the empty JSON string", ManageRegisterModelPlacesLivedInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Operation") != null && !jsonObj.get("Operation").isJsonNull()) && !jsonObj.get("Operation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Operation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Operation").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelPlacesLivedInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelPlacesLivedInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelPlacesLivedInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelPlacesLivedInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelPlacesLivedInner>() { + @Override + public void write(JsonWriter out, ManageRegisterModelPlacesLivedInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelPlacesLivedInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelPlacesLivedInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelPlacesLivedInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelPlacesLivedInner + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelPlacesLivedInner + */ + public static ManageRegisterModelPlacesLivedInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelPlacesLivedInner.class); + } + + /** + * Convert an instance of ManageRegisterModelPlacesLivedInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelPositionsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelPositionsInner.java new file mode 100644 index 0000000..e53f072 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelPositionsInner.java @@ -0,0 +1,399 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModelPositionsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelPositionsInner { + public static final String SERIALIZED_NAME_POSITION = "Position"; + @SerializedName(SERIALIZED_NAME_POSITION) + @javax.annotation.Nullable + private String position; + + public static final String SERIALIZED_NAME_COMPANY = "Company"; + @SerializedName(SERIALIZED_NAME_COMPANY) + @javax.annotation.Nullable + private String company; + + public static final String SERIALIZED_NAME_START_DATE = "StartDate"; + @SerializedName(SERIALIZED_NAME_START_DATE) + @javax.annotation.Nullable + private OffsetDateTime startDate; + + public static final String SERIALIZED_NAME_END_DATE = "EndDate"; + @SerializedName(SERIALIZED_NAME_END_DATE) + @javax.annotation.Nullable + private OffsetDateTime endDate; + + public static final String SERIALIZED_NAME_IS_CURRENT = "IsCurrent"; + @SerializedName(SERIALIZED_NAME_IS_CURRENT) + @javax.annotation.Nullable + private Boolean isCurrent; + + public ManageRegisterModelPositionsInner() { + } + + public ManageRegisterModelPositionsInner position(@javax.annotation.Nullable String position) { + this.position = position; + return this; + } + + /** + * The position held by the User. + * @return position + */ + @javax.annotation.Nullable + public String getPosition() { + return position; + } + + public void setPosition(@javax.annotation.Nullable String position) { + this.position = position; + } + + + public ManageRegisterModelPositionsInner company(@javax.annotation.Nullable String company) { + this.company = company; + return this; + } + + /** + * The company where the position was held. + * @return company + */ + @javax.annotation.Nullable + public String getCompany() { + return company; + } + + public void setCompany(@javax.annotation.Nullable String company) { + this.company = company; + } + + + public ManageRegisterModelPositionsInner startDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * The start date of the position. + * @return startDate + */ + @javax.annotation.Nullable + public OffsetDateTime getStartDate() { + return startDate; + } + + public void setStartDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + } + + + public ManageRegisterModelPositionsInner endDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * The end date of the position. + * @return endDate + */ + @javax.annotation.Nullable + public OffsetDateTime getEndDate() { + return endDate; + } + + public void setEndDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + } + + + public ManageRegisterModelPositionsInner isCurrent(@javax.annotation.Nullable Boolean isCurrent) { + this.isCurrent = isCurrent; + return this; + } + + /** + * Indicates if the position is current. + * @return isCurrent + */ + @javax.annotation.Nullable + public Boolean getIsCurrent() { + return isCurrent; + } + + public void setIsCurrent(@javax.annotation.Nullable Boolean isCurrent) { + this.isCurrent = isCurrent; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelPositionsInner instance itself + */ + public ManageRegisterModelPositionsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelPositionsInner manageRegisterModelPositionsInner = (ManageRegisterModelPositionsInner) o; + return Objects.equals(this.position, manageRegisterModelPositionsInner.position) && + Objects.equals(this.company, manageRegisterModelPositionsInner.company) && + Objects.equals(this.startDate, manageRegisterModelPositionsInner.startDate) && + Objects.equals(this.endDate, manageRegisterModelPositionsInner.endDate) && + Objects.equals(this.isCurrent, manageRegisterModelPositionsInner.isCurrent)&& + Objects.equals(this.additionalProperties, manageRegisterModelPositionsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(position, company, startDate, endDate, isCurrent, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelPositionsInner {\n"); + sb.append(" position: ").append(toIndentedString(position)).append("\n"); + sb.append(" company: ").append(toIndentedString(company)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" isCurrent: ").append(toIndentedString(isCurrent)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Position"); + openapiFields.add("Company"); + openapiFields.add("StartDate"); + openapiFields.add("EndDate"); + openapiFields.add("IsCurrent"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelPositionsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelPositionsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelPositionsInner is not found in the empty JSON string", ManageRegisterModelPositionsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Position") != null && !jsonObj.get("Position").isJsonNull()) && !jsonObj.get("Position").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Position` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Position").toString())); + } + if ((jsonObj.get("Company") != null && !jsonObj.get("Company").isJsonNull()) && !jsonObj.get("Company").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Company` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Company").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelPositionsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelPositionsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelPositionsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelPositionsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelPositionsInner>() { + @Override + public void write(JsonWriter out, ManageRegisterModelPositionsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelPositionsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelPositionsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelPositionsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelPositionsInner + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelPositionsInner + */ + public static ManageRegisterModelPositionsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelPositionsInner.class); + } + + /** + * Convert an instance of ManageRegisterModelPositionsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelPrivacyPolicy.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelPrivacyPolicy.java new file mode 100644 index 0000000..aeab1d2 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelPrivacyPolicy.java @@ -0,0 +1,299 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * The Privacy Policy details of the User. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelPrivacyPolicy { + public static final String SERIALIZED_NAME_VERSION = "Version"; + @SerializedName(SERIALIZED_NAME_VERSION) + @javax.annotation.Nullable + private String version; + + public ManageRegisterModelPrivacyPolicy() { + } + + public ManageRegisterModelPrivacyPolicy version(@javax.annotation.Nullable String version) { + this.version = version; + return this; + } + + /** + * The version of the Privacy Policy. + * @return version + */ + @javax.annotation.Nullable + public String getVersion() { + return version; + } + + public void setVersion(@javax.annotation.Nullable String version) { + this.version = version; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelPrivacyPolicy instance itself + */ + public ManageRegisterModelPrivacyPolicy putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelPrivacyPolicy manageRegisterModelPrivacyPolicy = (ManageRegisterModelPrivacyPolicy) o; + return Objects.equals(this.version, manageRegisterModelPrivacyPolicy.version)&& + Objects.equals(this.additionalProperties, manageRegisterModelPrivacyPolicy.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(version, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelPrivacyPolicy {\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Version"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelPrivacyPolicy + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelPrivacyPolicy.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelPrivacyPolicy is not found in the empty JSON string", ManageRegisterModelPrivacyPolicy.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Version") != null && !jsonObj.get("Version").isJsonNull()) && !jsonObj.get("Version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Version").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelPrivacyPolicy.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelPrivacyPolicy' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelPrivacyPolicy> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelPrivacyPolicy.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelPrivacyPolicy>() { + @Override + public void write(JsonWriter out, ManageRegisterModelPrivacyPolicy value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelPrivacyPolicy read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelPrivacyPolicy instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelPrivacyPolicy given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelPrivacyPolicy + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelPrivacyPolicy + */ + public static ManageRegisterModelPrivacyPolicy fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelPrivacyPolicy.class); + } + + /** + * Convert an instance of ManageRegisterModelPrivacyPolicy to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelProjectsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelProjectsInner.java new file mode 100644 index 0000000..066aeb5 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelProjectsInner.java @@ -0,0 +1,429 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModelProjectsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelProjectsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_SUMMARY = "Summary"; + @SerializedName(SERIALIZED_NAME_SUMMARY) + @javax.annotation.Nullable + private String summary; + + public static final String SERIALIZED_NAME_START_DATE = "StartDate"; + @SerializedName(SERIALIZED_NAME_START_DATE) + @javax.annotation.Nullable + private OffsetDateTime startDate; + + public static final String SERIALIZED_NAME_END_DATE = "EndDate"; + @SerializedName(SERIALIZED_NAME_END_DATE) + @javax.annotation.Nullable + private OffsetDateTime endDate; + + public static final String SERIALIZED_NAME_IS_CURRENT = "IsCurrent"; + @SerializedName(SERIALIZED_NAME_IS_CURRENT) + @javax.annotation.Nullable + private Boolean isCurrent; + + public ManageRegisterModelProjectsInner() { + } + + public ManageRegisterModelProjectsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the project. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ManageRegisterModelProjectsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the project. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ManageRegisterModelProjectsInner summary(@javax.annotation.Nullable String summary) { + this.summary = summary; + return this; + } + + /** + * A brief summary of the project. + * @return summary + */ + @javax.annotation.Nullable + public String getSummary() { + return summary; + } + + public void setSummary(@javax.annotation.Nullable String summary) { + this.summary = summary; + } + + + public ManageRegisterModelProjectsInner startDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * The start date of the project. + * @return startDate + */ + @javax.annotation.Nullable + public OffsetDateTime getStartDate() { + return startDate; + } + + public void setStartDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + } + + + public ManageRegisterModelProjectsInner endDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * The end date of the project. + * @return endDate + */ + @javax.annotation.Nullable + public OffsetDateTime getEndDate() { + return endDate; + } + + public void setEndDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + } + + + public ManageRegisterModelProjectsInner isCurrent(@javax.annotation.Nullable Boolean isCurrent) { + this.isCurrent = isCurrent; + return this; + } + + /** + * Indicates if the project is ongoing. + * @return isCurrent + */ + @javax.annotation.Nullable + public Boolean getIsCurrent() { + return isCurrent; + } + + public void setIsCurrent(@javax.annotation.Nullable Boolean isCurrent) { + this.isCurrent = isCurrent; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelProjectsInner instance itself + */ + public ManageRegisterModelProjectsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelProjectsInner manageRegisterModelProjectsInner = (ManageRegisterModelProjectsInner) o; + return Objects.equals(this.id, manageRegisterModelProjectsInner.id) && + Objects.equals(this.name, manageRegisterModelProjectsInner.name) && + Objects.equals(this.summary, manageRegisterModelProjectsInner.summary) && + Objects.equals(this.startDate, manageRegisterModelProjectsInner.startDate) && + Objects.equals(this.endDate, manageRegisterModelProjectsInner.endDate) && + Objects.equals(this.isCurrent, manageRegisterModelProjectsInner.isCurrent)&& + Objects.equals(this.additionalProperties, manageRegisterModelProjectsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, summary, startDate, endDate, isCurrent, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelProjectsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" summary: ").append(toIndentedString(summary)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" isCurrent: ").append(toIndentedString(isCurrent)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Summary"); + openapiFields.add("StartDate"); + openapiFields.add("EndDate"); + openapiFields.add("IsCurrent"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelProjectsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelProjectsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelProjectsInner is not found in the empty JSON string", ManageRegisterModelProjectsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Summary") != null && !jsonObj.get("Summary").isJsonNull()) && !jsonObj.get("Summary").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Summary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Summary").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelProjectsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelProjectsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelProjectsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelProjectsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelProjectsInner>() { + @Override + public void write(JsonWriter out, ManageRegisterModelProjectsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelProjectsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelProjectsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelProjectsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelProjectsInner + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelProjectsInner + */ + public static ManageRegisterModelProjectsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelProjectsInner.class); + } + + /** + * Convert an instance of ManageRegisterModelProjectsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelProviderAccessCredential.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelProviderAccessCredential.java new file mode 100644 index 0000000..888e08d --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelProviderAccessCredential.java @@ -0,0 +1,329 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * The provider access credentials of the User. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelProviderAccessCredential { + public static final String SERIALIZED_NAME_ACCESS_TOKEN = "AccessToken"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN) + @javax.annotation.Nullable + private String accessToken; + + public static final String SERIALIZED_NAME_TOKEN_SECRET = "TokenSecret"; + @SerializedName(SERIALIZED_NAME_TOKEN_SECRET) + @javax.annotation.Nullable + private String tokenSecret; + + public ManageRegisterModelProviderAccessCredential() { + } + + public ManageRegisterModelProviderAccessCredential accessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * The Access Token for the provider. + * @return accessToken + */ + @javax.annotation.Nullable + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + } + + + public ManageRegisterModelProviderAccessCredential tokenSecret(@javax.annotation.Nullable String tokenSecret) { + this.tokenSecret = tokenSecret; + return this; + } + + /** + * The token secret for the provider. + * @return tokenSecret + */ + @javax.annotation.Nullable + public String getTokenSecret() { + return tokenSecret; + } + + public void setTokenSecret(@javax.annotation.Nullable String tokenSecret) { + this.tokenSecret = tokenSecret; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelProviderAccessCredential instance itself + */ + public ManageRegisterModelProviderAccessCredential putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelProviderAccessCredential manageRegisterModelProviderAccessCredential = (ManageRegisterModelProviderAccessCredential) o; + return Objects.equals(this.accessToken, manageRegisterModelProviderAccessCredential.accessToken) && + Objects.equals(this.tokenSecret, manageRegisterModelProviderAccessCredential.tokenSecret)&& + Objects.equals(this.additionalProperties, manageRegisterModelProviderAccessCredential.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(accessToken, tokenSecret, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelProviderAccessCredential {\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" tokenSecret: ").append(toIndentedString(tokenSecret)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AccessToken"); + openapiFields.add("TokenSecret"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelProviderAccessCredential + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelProviderAccessCredential.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelProviderAccessCredential is not found in the empty JSON string", ManageRegisterModelProviderAccessCredential.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("AccessToken") != null && !jsonObj.get("AccessToken").isJsonNull()) && !jsonObj.get("AccessToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccessToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccessToken").toString())); + } + if ((jsonObj.get("TokenSecret") != null && !jsonObj.get("TokenSecret").isJsonNull()) && !jsonObj.get("TokenSecret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TokenSecret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TokenSecret").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelProviderAccessCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelProviderAccessCredential' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelProviderAccessCredential> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelProviderAccessCredential.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelProviderAccessCredential>() { + @Override + public void write(JsonWriter out, ManageRegisterModelProviderAccessCredential value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelProviderAccessCredential read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelProviderAccessCredential instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelProviderAccessCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelProviderAccessCredential + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelProviderAccessCredential + */ + public static ManageRegisterModelProviderAccessCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelProviderAccessCredential.class); + } + + /** + * Convert an instance of ManageRegisterModelProviderAccessCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelPublicationsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelPublicationsInner.java new file mode 100644 index 0000000..ba9fefd --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelPublicationsInner.java @@ -0,0 +1,488 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ManageRegisterModelPublicationsInnerAuthorsInner; +import java.io.IOException; +import java.net.URI; +import java.time.LocalDate; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModelPublicationsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelPublicationsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_TITLE = "Title"; + @SerializedName(SERIALIZED_NAME_TITLE) + @javax.annotation.Nullable + private String title; + + public static final String SERIALIZED_NAME_PUBLISHER = "Publisher"; + @SerializedName(SERIALIZED_NAME_PUBLISHER) + @javax.annotation.Nullable + private String publisher; + + public static final String SERIALIZED_NAME_DATE = "Date"; + @SerializedName(SERIALIZED_NAME_DATE) + @javax.annotation.Nullable + private LocalDate date; + + public static final String SERIALIZED_NAME_URL = "Url"; + @SerializedName(SERIALIZED_NAME_URL) + @javax.annotation.Nullable + private URI url; + + public static final String SERIALIZED_NAME_SUMMARY = "Summary"; + @SerializedName(SERIALIZED_NAME_SUMMARY) + @javax.annotation.Nullable + private String summary; + + public static final String SERIALIZED_NAME_AUTHORS = "Authors"; + @SerializedName(SERIALIZED_NAME_AUTHORS) + @javax.annotation.Nullable + private List<ManageRegisterModelPublicationsInnerAuthorsInner> authors = new ArrayList<>(); + + public ManageRegisterModelPublicationsInner() { + } + + public ManageRegisterModelPublicationsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the publication. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ManageRegisterModelPublicationsInner title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * The title of the publication. + * @return title + */ + @javax.annotation.Nullable + public String getTitle() { + return title; + } + + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + public ManageRegisterModelPublicationsInner publisher(@javax.annotation.Nullable String publisher) { + this.publisher = publisher; + return this; + } + + /** + * The publisher of the publication. + * @return publisher + */ + @javax.annotation.Nullable + public String getPublisher() { + return publisher; + } + + public void setPublisher(@javax.annotation.Nullable String publisher) { + this.publisher = publisher; + } + + + public ManageRegisterModelPublicationsInner date(@javax.annotation.Nullable LocalDate date) { + this.date = date; + return this; + } + + /** + * The date the publication was published. + * @return date + */ + @javax.annotation.Nullable + public LocalDate getDate() { + return date; + } + + public void setDate(@javax.annotation.Nullable LocalDate date) { + this.date = date; + } + + + public ManageRegisterModelPublicationsInner url(@javax.annotation.Nullable URI url) { + this.url = url; + return this; + } + + /** + * The URL of the publication. + * @return url + */ + @javax.annotation.Nullable + public URI getUrl() { + return url; + } + + public void setUrl(@javax.annotation.Nullable URI url) { + this.url = url; + } + + + public ManageRegisterModelPublicationsInner summary(@javax.annotation.Nullable String summary) { + this.summary = summary; + return this; + } + + /** + * A brief summary of the publication. + * @return summary + */ + @javax.annotation.Nullable + public String getSummary() { + return summary; + } + + public void setSummary(@javax.annotation.Nullable String summary) { + this.summary = summary; + } + + + public ManageRegisterModelPublicationsInner authors(@javax.annotation.Nullable List<ManageRegisterModelPublicationsInnerAuthorsInner> authors) { + this.authors = authors; + return this; + } + + public ManageRegisterModelPublicationsInner addAuthorsItem(ManageRegisterModelPublicationsInnerAuthorsInner authorsItem) { + if (this.authors == null) { + this.authors = new ArrayList<>(); + } + this.authors.add(authorsItem); + return this; + } + + /** + * List of authors of the publication. + * @return authors + */ + @javax.annotation.Nullable + public List<ManageRegisterModelPublicationsInnerAuthorsInner> getAuthors() { + return authors; + } + + public void setAuthors(@javax.annotation.Nullable List<ManageRegisterModelPublicationsInnerAuthorsInner> authors) { + this.authors = authors; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelPublicationsInner instance itself + */ + public ManageRegisterModelPublicationsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelPublicationsInner manageRegisterModelPublicationsInner = (ManageRegisterModelPublicationsInner) o; + return Objects.equals(this.id, manageRegisterModelPublicationsInner.id) && + Objects.equals(this.title, manageRegisterModelPublicationsInner.title) && + Objects.equals(this.publisher, manageRegisterModelPublicationsInner.publisher) && + Objects.equals(this.date, manageRegisterModelPublicationsInner.date) && + Objects.equals(this.url, manageRegisterModelPublicationsInner.url) && + Objects.equals(this.summary, manageRegisterModelPublicationsInner.summary) && + Objects.equals(this.authors, manageRegisterModelPublicationsInner.authors)&& + Objects.equals(this.additionalProperties, manageRegisterModelPublicationsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, title, publisher, date, url, summary, authors, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelPublicationsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" publisher: ").append(toIndentedString(publisher)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" summary: ").append(toIndentedString(summary)).append("\n"); + sb.append(" authors: ").append(toIndentedString(authors)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Title"); + openapiFields.add("Publisher"); + openapiFields.add("Date"); + openapiFields.add("Url"); + openapiFields.add("Summary"); + openapiFields.add("Authors"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelPublicationsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelPublicationsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelPublicationsInner is not found in the empty JSON string", ManageRegisterModelPublicationsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Title") != null && !jsonObj.get("Title").isJsonNull()) && !jsonObj.get("Title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Title").toString())); + } + if ((jsonObj.get("Publisher") != null && !jsonObj.get("Publisher").isJsonNull()) && !jsonObj.get("Publisher").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Publisher` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Publisher").toString())); + } + if ((jsonObj.get("Url") != null && !jsonObj.get("Url").isJsonNull()) && !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())); + } + if ((jsonObj.get("Summary") != null && !jsonObj.get("Summary").isJsonNull()) && !jsonObj.get("Summary").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Summary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Summary").toString())); + } + if (jsonObj.get("Authors") != null && !jsonObj.get("Authors").isJsonNull()) { + JsonArray jsonArrayauthors = jsonObj.getAsJsonArray("Authors"); + if (jsonArrayauthors != null) { + // ensure the json data is an array + if (!jsonObj.get("Authors").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Authors` to be an array in the JSON string but got `%s`", jsonObj.get("Authors").toString())); + } + + // validate the optional field `Authors` (array) + for (int i = 0; i < jsonArrayauthors.size(); i++) { + ManageRegisterModelPublicationsInnerAuthorsInner.validateJsonElement(jsonArrayauthors.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelPublicationsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelPublicationsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelPublicationsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelPublicationsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelPublicationsInner>() { + @Override + public void write(JsonWriter out, ManageRegisterModelPublicationsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelPublicationsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelPublicationsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelPublicationsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelPublicationsInner + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelPublicationsInner + */ + public static ManageRegisterModelPublicationsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelPublicationsInner.class); + } + + /** + * Convert an instance of ManageRegisterModelPublicationsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelPublicationsInnerAuthorsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelPublicationsInnerAuthorsInner.java new file mode 100644 index 0000000..07a7a9b --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelPublicationsInnerAuthorsInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModelPublicationsInnerAuthorsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelPublicationsInnerAuthorsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ManageRegisterModelPublicationsInnerAuthorsInner() { + } + + public ManageRegisterModelPublicationsInnerAuthorsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the author. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ManageRegisterModelPublicationsInnerAuthorsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the author. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelPublicationsInnerAuthorsInner instance itself + */ + public ManageRegisterModelPublicationsInnerAuthorsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelPublicationsInnerAuthorsInner manageRegisterModelPublicationsInnerAuthorsInner = (ManageRegisterModelPublicationsInnerAuthorsInner) o; + return Objects.equals(this.id, manageRegisterModelPublicationsInnerAuthorsInner.id) && + Objects.equals(this.name, manageRegisterModelPublicationsInnerAuthorsInner.name)&& + Objects.equals(this.additionalProperties, manageRegisterModelPublicationsInnerAuthorsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelPublicationsInnerAuthorsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelPublicationsInnerAuthorsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelPublicationsInnerAuthorsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelPublicationsInnerAuthorsInner is not found in the empty JSON string", ManageRegisterModelPublicationsInnerAuthorsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelPublicationsInnerAuthorsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelPublicationsInnerAuthorsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelPublicationsInnerAuthorsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelPublicationsInnerAuthorsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelPublicationsInnerAuthorsInner>() { + @Override + public void write(JsonWriter out, ManageRegisterModelPublicationsInnerAuthorsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelPublicationsInnerAuthorsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelPublicationsInnerAuthorsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelPublicationsInnerAuthorsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelPublicationsInnerAuthorsInner + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelPublicationsInnerAuthorsInner + */ + public static ManageRegisterModelPublicationsInnerAuthorsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelPublicationsInnerAuthorsInner.class); + } + + /** + * Convert an instance of ManageRegisterModelPublicationsInnerAuthorsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelRecommendationsReceivedInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelRecommendationsReceivedInner.java new file mode 100644 index 0000000..1f260fd --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelRecommendationsReceivedInner.java @@ -0,0 +1,377 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModelRecommendationsReceivedInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelRecommendationsReceivedInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_RECOMMENDATION_TYPE = "RecommendationType"; + @SerializedName(SERIALIZED_NAME_RECOMMENDATION_TYPE) + @javax.annotation.Nullable + private String recommendationType; + + public static final String SERIALIZED_NAME_RECOMMENDATION_TEXT = "RecommendationText"; + @SerializedName(SERIALIZED_NAME_RECOMMENDATION_TEXT) + @javax.annotation.Nullable + private String recommendationText; + + public static final String SERIALIZED_NAME_RECOMMENDER = "Recommender"; + @SerializedName(SERIALIZED_NAME_RECOMMENDER) + @javax.annotation.Nullable + private String recommender; + + public ManageRegisterModelRecommendationsReceivedInner() { + } + + public ManageRegisterModelRecommendationsReceivedInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the recommendation. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ManageRegisterModelRecommendationsReceivedInner recommendationType(@javax.annotation.Nullable String recommendationType) { + this.recommendationType = recommendationType; + return this; + } + + /** + * The type of recommendation. + * @return recommendationType + */ + @javax.annotation.Nullable + public String getRecommendationType() { + return recommendationType; + } + + public void setRecommendationType(@javax.annotation.Nullable String recommendationType) { + this.recommendationType = recommendationType; + } + + + public ManageRegisterModelRecommendationsReceivedInner recommendationText(@javax.annotation.Nullable String recommendationText) { + this.recommendationText = recommendationText; + return this; + } + + /** + * The text of the recommendation. + * @return recommendationText + */ + @javax.annotation.Nullable + public String getRecommendationText() { + return recommendationText; + } + + public void setRecommendationText(@javax.annotation.Nullable String recommendationText) { + this.recommendationText = recommendationText; + } + + + public ManageRegisterModelRecommendationsReceivedInner recommender(@javax.annotation.Nullable String recommender) { + this.recommender = recommender; + return this; + } + + /** + * The name of the person who gave the recommendation. + * @return recommender + */ + @javax.annotation.Nullable + public String getRecommender() { + return recommender; + } + + public void setRecommender(@javax.annotation.Nullable String recommender) { + this.recommender = recommender; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelRecommendationsReceivedInner instance itself + */ + public ManageRegisterModelRecommendationsReceivedInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelRecommendationsReceivedInner manageRegisterModelRecommendationsReceivedInner = (ManageRegisterModelRecommendationsReceivedInner) o; + return Objects.equals(this.id, manageRegisterModelRecommendationsReceivedInner.id) && + Objects.equals(this.recommendationType, manageRegisterModelRecommendationsReceivedInner.recommendationType) && + Objects.equals(this.recommendationText, manageRegisterModelRecommendationsReceivedInner.recommendationText) && + Objects.equals(this.recommender, manageRegisterModelRecommendationsReceivedInner.recommender)&& + Objects.equals(this.additionalProperties, manageRegisterModelRecommendationsReceivedInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, recommendationType, recommendationText, recommender, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelRecommendationsReceivedInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" recommendationType: ").append(toIndentedString(recommendationType)).append("\n"); + sb.append(" recommendationText: ").append(toIndentedString(recommendationText)).append("\n"); + sb.append(" recommender: ").append(toIndentedString(recommender)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("RecommendationType"); + openapiFields.add("RecommendationText"); + openapiFields.add("Recommender"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelRecommendationsReceivedInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelRecommendationsReceivedInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelRecommendationsReceivedInner is not found in the empty JSON string", ManageRegisterModelRecommendationsReceivedInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("RecommendationType") != null && !jsonObj.get("RecommendationType").isJsonNull()) && !jsonObj.get("RecommendationType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RecommendationType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RecommendationType").toString())); + } + if ((jsonObj.get("RecommendationText") != null && !jsonObj.get("RecommendationText").isJsonNull()) && !jsonObj.get("RecommendationText").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RecommendationText` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RecommendationText").toString())); + } + if ((jsonObj.get("Recommender") != null && !jsonObj.get("Recommender").isJsonNull()) && !jsonObj.get("Recommender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Recommender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Recommender").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelRecommendationsReceivedInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelRecommendationsReceivedInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelRecommendationsReceivedInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelRecommendationsReceivedInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelRecommendationsReceivedInner>() { + @Override + public void write(JsonWriter out, ManageRegisterModelRecommendationsReceivedInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelRecommendationsReceivedInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelRecommendationsReceivedInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelRecommendationsReceivedInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelRecommendationsReceivedInner + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelRecommendationsReceivedInner + */ + public static ManageRegisterModelRecommendationsReceivedInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelRecommendationsReceivedInner.class); + } + + /** + * Convert an instance of ManageRegisterModelRecommendationsReceivedInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelRelatedProfileViewsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelRelatedProfileViewsInner.java new file mode 100644 index 0000000..347dccf --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelRelatedProfileViewsInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModelRelatedProfileViewsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelRelatedProfileViewsInner { + public static final String SERIALIZED_NAME_FIRST_NAME = "FirstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nullable + private String firstName; + + public static final String SERIALIZED_NAME_LAST_NAME = "LastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nullable + private String lastName; + + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public ManageRegisterModelRelatedProfileViewsInner() { + } + + public ManageRegisterModelRelatedProfileViewsInner firstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * The first name of the related profile. + * @return firstName + */ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + } + + + public ManageRegisterModelRelatedProfileViewsInner lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * The last name of the related profile. + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + + public ManageRegisterModelRelatedProfileViewsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the related profile. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelRelatedProfileViewsInner instance itself + */ + public ManageRegisterModelRelatedProfileViewsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelRelatedProfileViewsInner manageRegisterModelRelatedProfileViewsInner = (ManageRegisterModelRelatedProfileViewsInner) o; + return Objects.equals(this.firstName, manageRegisterModelRelatedProfileViewsInner.firstName) && + Objects.equals(this.lastName, manageRegisterModelRelatedProfileViewsInner.lastName) && + Objects.equals(this.id, manageRegisterModelRelatedProfileViewsInner.id)&& + Objects.equals(this.additionalProperties, manageRegisterModelRelatedProfileViewsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(firstName, lastName, id, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelRelatedProfileViewsInner {\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("FirstName"); + openapiFields.add("LastName"); + openapiFields.add("Id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelRelatedProfileViewsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelRelatedProfileViewsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelRelatedProfileViewsInner is not found in the empty JSON string", ManageRegisterModelRelatedProfileViewsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("FirstName") != null && !jsonObj.get("FirstName").isJsonNull()) && !jsonObj.get("FirstName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FirstName").toString())); + } + if ((jsonObj.get("LastName") != null && !jsonObj.get("LastName").isJsonNull()) && !jsonObj.get("LastName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastName").toString())); + } + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelRelatedProfileViewsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelRelatedProfileViewsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelRelatedProfileViewsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelRelatedProfileViewsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelRelatedProfileViewsInner>() { + @Override + public void write(JsonWriter out, ManageRegisterModelRelatedProfileViewsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelRelatedProfileViewsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelRelatedProfileViewsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelRelatedProfileViewsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelRelatedProfileViewsInner + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelRelatedProfileViewsInner + */ + public static ManageRegisterModelRelatedProfileViewsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelRelatedProfileViewsInner.class); + } + + /** + * Convert an instance of ManageRegisterModelRelatedProfileViewsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelSubscription.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelSubscription.java new file mode 100644 index 0000000..f1a38ff --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelSubscription.java @@ -0,0 +1,389 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Subscription details of the User. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelSubscription { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_SPACE = "Space"; + @SerializedName(SERIALIZED_NAME_SPACE) + @javax.annotation.Nullable + private String space; + + public static final String SERIALIZED_NAME_PRIVATE_REPOS = "PrivateRepos"; + @SerializedName(SERIALIZED_NAME_PRIVATE_REPOS) + @javax.annotation.Nullable + private String privateRepos; + + public static final String SERIALIZED_NAME_COLLABORATORS = "Collaborators"; + @SerializedName(SERIALIZED_NAME_COLLABORATORS) + @javax.annotation.Nullable + private String collaborators; + + public ManageRegisterModelSubscription() { + } + + public ManageRegisterModelSubscription name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the subscription. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ManageRegisterModelSubscription space(@javax.annotation.Nullable String space) { + this.space = space; + return this; + } + + /** + * The allocated space for the subscription. + * @return space + */ + @javax.annotation.Nullable + public String getSpace() { + return space; + } + + public void setSpace(@javax.annotation.Nullable String space) { + this.space = space; + } + + + public ManageRegisterModelSubscription privateRepos(@javax.annotation.Nullable String privateRepos) { + this.privateRepos = privateRepos; + return this; + } + + /** + * The number of private repositories allowed. + * @return privateRepos + */ + @javax.annotation.Nullable + public String getPrivateRepos() { + return privateRepos; + } + + public void setPrivateRepos(@javax.annotation.Nullable String privateRepos) { + this.privateRepos = privateRepos; + } + + + public ManageRegisterModelSubscription collaborators(@javax.annotation.Nullable String collaborators) { + this.collaborators = collaborators; + return this; + } + + /** + * The number of collaborators allowed. + * @return collaborators + */ + @javax.annotation.Nullable + public String getCollaborators() { + return collaborators; + } + + public void setCollaborators(@javax.annotation.Nullable String collaborators) { + this.collaborators = collaborators; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelSubscription instance itself + */ + public ManageRegisterModelSubscription putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelSubscription manageRegisterModelSubscription = (ManageRegisterModelSubscription) o; + return Objects.equals(this.name, manageRegisterModelSubscription.name) && + Objects.equals(this.space, manageRegisterModelSubscription.space) && + Objects.equals(this.privateRepos, manageRegisterModelSubscription.privateRepos) && + Objects.equals(this.collaborators, manageRegisterModelSubscription.collaborators)&& + Objects.equals(this.additionalProperties, manageRegisterModelSubscription.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(name, space, privateRepos, collaborators, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelSubscription {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" space: ").append(toIndentedString(space)).append("\n"); + sb.append(" privateRepos: ").append(toIndentedString(privateRepos)).append("\n"); + sb.append(" collaborators: ").append(toIndentedString(collaborators)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + openapiFields.add("Space"); + openapiFields.add("PrivateRepos"); + openapiFields.add("Collaborators"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelSubscription + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelSubscription.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelSubscription is not found in the empty JSON string", ManageRegisterModelSubscription.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Space") != null && !jsonObj.get("Space").isJsonNull()) && !jsonObj.get("Space").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Space` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Space").toString())); + } + if ((jsonObj.get("PrivateRepos") != null && !jsonObj.get("PrivateRepos").isJsonNull()) && !jsonObj.get("PrivateRepos").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PrivateRepos` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PrivateRepos").toString())); + } + if ((jsonObj.get("Collaborators") != null && !jsonObj.get("Collaborators").isJsonNull()) && !jsonObj.get("Collaborators").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Collaborators` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Collaborators").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelSubscription.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelSubscription' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelSubscription> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelSubscription.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelSubscription>() { + @Override + public void write(JsonWriter out, ManageRegisterModelSubscription value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelSubscription read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelSubscription instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelSubscription given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelSubscription + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelSubscription + */ + public static ManageRegisterModelSubscription fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelSubscription.class); + } + + /** + * Convert an instance of ManageRegisterModelSubscription to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelSuggestions.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelSuggestions.java new file mode 100644 index 0000000..716551d --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelSuggestions.java @@ -0,0 +1,459 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ManageRegisterModelSuggestionsCompaniesToFollowInner; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelSuggestionsIndustriesToFollowInner; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelSuggestionsNewssourceToFollowInner; +import com.loginradius.sdk.internal.openapi.model.ManageRegisterModelSuggestionsPeopleToFollowInner; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Suggestions for the User to follow. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelSuggestions { + public static final String SERIALIZED_NAME_COMPANIES_TO_FOLLOW = "CompaniesToFollow"; + @SerializedName(SERIALIZED_NAME_COMPANIES_TO_FOLLOW) + @javax.annotation.Nullable + private List<ManageRegisterModelSuggestionsCompaniesToFollowInner> companiesToFollow = new ArrayList<>(); + + public static final String SERIALIZED_NAME_INDUSTRIES_TO_FOLLOW = "IndustriesToFollow"; + @SerializedName(SERIALIZED_NAME_INDUSTRIES_TO_FOLLOW) + @javax.annotation.Nullable + private List<ManageRegisterModelSuggestionsIndustriesToFollowInner> industriesToFollow = new ArrayList<>(); + + public static final String SERIALIZED_NAME_NEWSSOURCE_TO_FOLLOW = "NewssourceToFollow"; + @SerializedName(SERIALIZED_NAME_NEWSSOURCE_TO_FOLLOW) + @javax.annotation.Nullable + private List<ManageRegisterModelSuggestionsNewssourceToFollowInner> newssourceToFollow = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PEOPLE_TO_FOLLOW = "PeopleToFollow"; + @SerializedName(SERIALIZED_NAME_PEOPLE_TO_FOLLOW) + @javax.annotation.Nullable + private List<ManageRegisterModelSuggestionsPeopleToFollowInner> peopleToFollow = new ArrayList<>(); + + public ManageRegisterModelSuggestions() { + } + + public ManageRegisterModelSuggestions companiesToFollow(@javax.annotation.Nullable List<ManageRegisterModelSuggestionsCompaniesToFollowInner> companiesToFollow) { + this.companiesToFollow = companiesToFollow; + return this; + } + + public ManageRegisterModelSuggestions addCompaniesToFollowItem(ManageRegisterModelSuggestionsCompaniesToFollowInner companiesToFollowItem) { + if (this.companiesToFollow == null) { + this.companiesToFollow = new ArrayList<>(); + } + this.companiesToFollow.add(companiesToFollowItem); + return this; + } + + /** + * List of companies suggested to follow. + * @return companiesToFollow + */ + @javax.annotation.Nullable + public List<ManageRegisterModelSuggestionsCompaniesToFollowInner> getCompaniesToFollow() { + return companiesToFollow; + } + + public void setCompaniesToFollow(@javax.annotation.Nullable List<ManageRegisterModelSuggestionsCompaniesToFollowInner> companiesToFollow) { + this.companiesToFollow = companiesToFollow; + } + + + public ManageRegisterModelSuggestions industriesToFollow(@javax.annotation.Nullable List<ManageRegisterModelSuggestionsIndustriesToFollowInner> industriesToFollow) { + this.industriesToFollow = industriesToFollow; + return this; + } + + public ManageRegisterModelSuggestions addIndustriesToFollowItem(ManageRegisterModelSuggestionsIndustriesToFollowInner industriesToFollowItem) { + if (this.industriesToFollow == null) { + this.industriesToFollow = new ArrayList<>(); + } + this.industriesToFollow.add(industriesToFollowItem); + return this; + } + + /** + * List of industries suggested to follow. + * @return industriesToFollow + */ + @javax.annotation.Nullable + public List<ManageRegisterModelSuggestionsIndustriesToFollowInner> getIndustriesToFollow() { + return industriesToFollow; + } + + public void setIndustriesToFollow(@javax.annotation.Nullable List<ManageRegisterModelSuggestionsIndustriesToFollowInner> industriesToFollow) { + this.industriesToFollow = industriesToFollow; + } + + + public ManageRegisterModelSuggestions newssourceToFollow(@javax.annotation.Nullable List<ManageRegisterModelSuggestionsNewssourceToFollowInner> newssourceToFollow) { + this.newssourceToFollow = newssourceToFollow; + return this; + } + + public ManageRegisterModelSuggestions addNewssourceToFollowItem(ManageRegisterModelSuggestionsNewssourceToFollowInner newssourceToFollowItem) { + if (this.newssourceToFollow == null) { + this.newssourceToFollow = new ArrayList<>(); + } + this.newssourceToFollow.add(newssourceToFollowItem); + return this; + } + + /** + * List of news sources suggested to follow. + * @return newssourceToFollow + */ + @javax.annotation.Nullable + public List<ManageRegisterModelSuggestionsNewssourceToFollowInner> getNewssourceToFollow() { + return newssourceToFollow; + } + + public void setNewssourceToFollow(@javax.annotation.Nullable List<ManageRegisterModelSuggestionsNewssourceToFollowInner> newssourceToFollow) { + this.newssourceToFollow = newssourceToFollow; + } + + + public ManageRegisterModelSuggestions peopleToFollow(@javax.annotation.Nullable List<ManageRegisterModelSuggestionsPeopleToFollowInner> peopleToFollow) { + this.peopleToFollow = peopleToFollow; + return this; + } + + public ManageRegisterModelSuggestions addPeopleToFollowItem(ManageRegisterModelSuggestionsPeopleToFollowInner peopleToFollowItem) { + if (this.peopleToFollow == null) { + this.peopleToFollow = new ArrayList<>(); + } + this.peopleToFollow.add(peopleToFollowItem); + return this; + } + + /** + * List of people suggested to follow. + * @return peopleToFollow + */ + @javax.annotation.Nullable + public List<ManageRegisterModelSuggestionsPeopleToFollowInner> getPeopleToFollow() { + return peopleToFollow; + } + + public void setPeopleToFollow(@javax.annotation.Nullable List<ManageRegisterModelSuggestionsPeopleToFollowInner> peopleToFollow) { + this.peopleToFollow = peopleToFollow; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelSuggestions instance itself + */ + public ManageRegisterModelSuggestions putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelSuggestions manageRegisterModelSuggestions = (ManageRegisterModelSuggestions) o; + return Objects.equals(this.companiesToFollow, manageRegisterModelSuggestions.companiesToFollow) && + Objects.equals(this.industriesToFollow, manageRegisterModelSuggestions.industriesToFollow) && + Objects.equals(this.newssourceToFollow, manageRegisterModelSuggestions.newssourceToFollow) && + Objects.equals(this.peopleToFollow, manageRegisterModelSuggestions.peopleToFollow)&& + Objects.equals(this.additionalProperties, manageRegisterModelSuggestions.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(companiesToFollow, industriesToFollow, newssourceToFollow, peopleToFollow, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelSuggestions {\n"); + sb.append(" companiesToFollow: ").append(toIndentedString(companiesToFollow)).append("\n"); + sb.append(" industriesToFollow: ").append(toIndentedString(industriesToFollow)).append("\n"); + sb.append(" newssourceToFollow: ").append(toIndentedString(newssourceToFollow)).append("\n"); + sb.append(" peopleToFollow: ").append(toIndentedString(peopleToFollow)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("CompaniesToFollow"); + openapiFields.add("IndustriesToFollow"); + openapiFields.add("NewssourceToFollow"); + openapiFields.add("PeopleToFollow"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelSuggestions + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelSuggestions.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelSuggestions is not found in the empty JSON string", ManageRegisterModelSuggestions.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("CompaniesToFollow") != null && !jsonObj.get("CompaniesToFollow").isJsonNull()) { + JsonArray jsonArraycompaniesToFollow = jsonObj.getAsJsonArray("CompaniesToFollow"); + if (jsonArraycompaniesToFollow != null) { + // ensure the json data is an array + if (!jsonObj.get("CompaniesToFollow").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `CompaniesToFollow` to be an array in the JSON string but got `%s`", jsonObj.get("CompaniesToFollow").toString())); + } + + // validate the optional field `CompaniesToFollow` (array) + for (int i = 0; i < jsonArraycompaniesToFollow.size(); i++) { + ManageRegisterModelSuggestionsCompaniesToFollowInner.validateJsonElement(jsonArraycompaniesToFollow.get(i)); + }; + } + } + if (jsonObj.get("IndustriesToFollow") != null && !jsonObj.get("IndustriesToFollow").isJsonNull()) { + JsonArray jsonArrayindustriesToFollow = jsonObj.getAsJsonArray("IndustriesToFollow"); + if (jsonArrayindustriesToFollow != null) { + // ensure the json data is an array + if (!jsonObj.get("IndustriesToFollow").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `IndustriesToFollow` to be an array in the JSON string but got `%s`", jsonObj.get("IndustriesToFollow").toString())); + } + + // validate the optional field `IndustriesToFollow` (array) + for (int i = 0; i < jsonArrayindustriesToFollow.size(); i++) { + ManageRegisterModelSuggestionsIndustriesToFollowInner.validateJsonElement(jsonArrayindustriesToFollow.get(i)); + }; + } + } + if (jsonObj.get("NewssourceToFollow") != null && !jsonObj.get("NewssourceToFollow").isJsonNull()) { + JsonArray jsonArraynewssourceToFollow = jsonObj.getAsJsonArray("NewssourceToFollow"); + if (jsonArraynewssourceToFollow != null) { + // ensure the json data is an array + if (!jsonObj.get("NewssourceToFollow").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `NewssourceToFollow` to be an array in the JSON string but got `%s`", jsonObj.get("NewssourceToFollow").toString())); + } + + // validate the optional field `NewssourceToFollow` (array) + for (int i = 0; i < jsonArraynewssourceToFollow.size(); i++) { + ManageRegisterModelSuggestionsNewssourceToFollowInner.validateJsonElement(jsonArraynewssourceToFollow.get(i)); + }; + } + } + if (jsonObj.get("PeopleToFollow") != null && !jsonObj.get("PeopleToFollow").isJsonNull()) { + JsonArray jsonArraypeopleToFollow = jsonObj.getAsJsonArray("PeopleToFollow"); + if (jsonArraypeopleToFollow != null) { + // ensure the json data is an array + if (!jsonObj.get("PeopleToFollow").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PeopleToFollow` to be an array in the JSON string but got `%s`", jsonObj.get("PeopleToFollow").toString())); + } + + // validate the optional field `PeopleToFollow` (array) + for (int i = 0; i < jsonArraypeopleToFollow.size(); i++) { + ManageRegisterModelSuggestionsPeopleToFollowInner.validateJsonElement(jsonArraypeopleToFollow.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelSuggestions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelSuggestions' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelSuggestions> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelSuggestions.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelSuggestions>() { + @Override + public void write(JsonWriter out, ManageRegisterModelSuggestions value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelSuggestions read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelSuggestions instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelSuggestions given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelSuggestions + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelSuggestions + */ + public static ManageRegisterModelSuggestions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelSuggestions.class); + } + + /** + * Convert an instance of ManageRegisterModelSuggestions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelSuggestionsCompaniesToFollowInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelSuggestionsCompaniesToFollowInner.java new file mode 100644 index 0000000..fec6b6f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelSuggestionsCompaniesToFollowInner.java @@ -0,0 +1,329 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModelSuggestionsCompaniesToFollowInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelSuggestionsCompaniesToFollowInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ManageRegisterModelSuggestionsCompaniesToFollowInner() { + } + + public ManageRegisterModelSuggestionsCompaniesToFollowInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the company. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ManageRegisterModelSuggestionsCompaniesToFollowInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the company. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelSuggestionsCompaniesToFollowInner instance itself + */ + public ManageRegisterModelSuggestionsCompaniesToFollowInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelSuggestionsCompaniesToFollowInner manageRegisterModelSuggestionsCompaniesToFollowInner = (ManageRegisterModelSuggestionsCompaniesToFollowInner) o; + return Objects.equals(this.id, manageRegisterModelSuggestionsCompaniesToFollowInner.id) && + Objects.equals(this.name, manageRegisterModelSuggestionsCompaniesToFollowInner.name)&& + Objects.equals(this.additionalProperties, manageRegisterModelSuggestionsCompaniesToFollowInner.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelSuggestionsCompaniesToFollowInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelSuggestionsCompaniesToFollowInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelSuggestionsCompaniesToFollowInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelSuggestionsCompaniesToFollowInner is not found in the empty JSON string", ManageRegisterModelSuggestionsCompaniesToFollowInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelSuggestionsCompaniesToFollowInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelSuggestionsCompaniesToFollowInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelSuggestionsCompaniesToFollowInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelSuggestionsCompaniesToFollowInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelSuggestionsCompaniesToFollowInner>() { + @Override + public void write(JsonWriter out, ManageRegisterModelSuggestionsCompaniesToFollowInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelSuggestionsCompaniesToFollowInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelSuggestionsCompaniesToFollowInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelSuggestionsCompaniesToFollowInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelSuggestionsCompaniesToFollowInner + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelSuggestionsCompaniesToFollowInner + */ + public static ManageRegisterModelSuggestionsCompaniesToFollowInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelSuggestionsCompaniesToFollowInner.class); + } + + /** + * Convert an instance of ManageRegisterModelSuggestionsCompaniesToFollowInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelSuggestionsIndustriesToFollowInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelSuggestionsIndustriesToFollowInner.java new file mode 100644 index 0000000..c446723 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelSuggestionsIndustriesToFollowInner.java @@ -0,0 +1,329 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModelSuggestionsIndustriesToFollowInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelSuggestionsIndustriesToFollowInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ManageRegisterModelSuggestionsIndustriesToFollowInner() { + } + + public ManageRegisterModelSuggestionsIndustriesToFollowInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the industry. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ManageRegisterModelSuggestionsIndustriesToFollowInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the industry. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelSuggestionsIndustriesToFollowInner instance itself + */ + public ManageRegisterModelSuggestionsIndustriesToFollowInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelSuggestionsIndustriesToFollowInner manageRegisterModelSuggestionsIndustriesToFollowInner = (ManageRegisterModelSuggestionsIndustriesToFollowInner) o; + return Objects.equals(this.id, manageRegisterModelSuggestionsIndustriesToFollowInner.id) && + Objects.equals(this.name, manageRegisterModelSuggestionsIndustriesToFollowInner.name)&& + Objects.equals(this.additionalProperties, manageRegisterModelSuggestionsIndustriesToFollowInner.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelSuggestionsIndustriesToFollowInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelSuggestionsIndustriesToFollowInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelSuggestionsIndustriesToFollowInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelSuggestionsIndustriesToFollowInner is not found in the empty JSON string", ManageRegisterModelSuggestionsIndustriesToFollowInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelSuggestionsIndustriesToFollowInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelSuggestionsIndustriesToFollowInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelSuggestionsIndustriesToFollowInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelSuggestionsIndustriesToFollowInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelSuggestionsIndustriesToFollowInner>() { + @Override + public void write(JsonWriter out, ManageRegisterModelSuggestionsIndustriesToFollowInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelSuggestionsIndustriesToFollowInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelSuggestionsIndustriesToFollowInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelSuggestionsIndustriesToFollowInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelSuggestionsIndustriesToFollowInner + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelSuggestionsIndustriesToFollowInner + */ + public static ManageRegisterModelSuggestionsIndustriesToFollowInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelSuggestionsIndustriesToFollowInner.class); + } + + /** + * Convert an instance of ManageRegisterModelSuggestionsIndustriesToFollowInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelSuggestionsNewssourceToFollowInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelSuggestionsNewssourceToFollowInner.java new file mode 100644 index 0000000..67d03df --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelSuggestionsNewssourceToFollowInner.java @@ -0,0 +1,329 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModelSuggestionsNewssourceToFollowInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelSuggestionsNewssourceToFollowInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ManageRegisterModelSuggestionsNewssourceToFollowInner() { + } + + public ManageRegisterModelSuggestionsNewssourceToFollowInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the news source. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ManageRegisterModelSuggestionsNewssourceToFollowInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the news source. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelSuggestionsNewssourceToFollowInner instance itself + */ + public ManageRegisterModelSuggestionsNewssourceToFollowInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelSuggestionsNewssourceToFollowInner manageRegisterModelSuggestionsNewssourceToFollowInner = (ManageRegisterModelSuggestionsNewssourceToFollowInner) o; + return Objects.equals(this.id, manageRegisterModelSuggestionsNewssourceToFollowInner.id) && + Objects.equals(this.name, manageRegisterModelSuggestionsNewssourceToFollowInner.name)&& + Objects.equals(this.additionalProperties, manageRegisterModelSuggestionsNewssourceToFollowInner.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelSuggestionsNewssourceToFollowInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelSuggestionsNewssourceToFollowInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelSuggestionsNewssourceToFollowInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelSuggestionsNewssourceToFollowInner is not found in the empty JSON string", ManageRegisterModelSuggestionsNewssourceToFollowInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelSuggestionsNewssourceToFollowInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelSuggestionsNewssourceToFollowInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelSuggestionsNewssourceToFollowInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelSuggestionsNewssourceToFollowInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelSuggestionsNewssourceToFollowInner>() { + @Override + public void write(JsonWriter out, ManageRegisterModelSuggestionsNewssourceToFollowInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelSuggestionsNewssourceToFollowInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelSuggestionsNewssourceToFollowInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelSuggestionsNewssourceToFollowInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelSuggestionsNewssourceToFollowInner + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelSuggestionsNewssourceToFollowInner + */ + public static ManageRegisterModelSuggestionsNewssourceToFollowInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelSuggestionsNewssourceToFollowInner.class); + } + + /** + * Convert an instance of ManageRegisterModelSuggestionsNewssourceToFollowInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelSuggestionsPeopleToFollowInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelSuggestionsPeopleToFollowInner.java new file mode 100644 index 0000000..5511095 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelSuggestionsPeopleToFollowInner.java @@ -0,0 +1,329 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModelSuggestionsPeopleToFollowInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelSuggestionsPeopleToFollowInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ManageRegisterModelSuggestionsPeopleToFollowInner() { + } + + public ManageRegisterModelSuggestionsPeopleToFollowInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the person. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ManageRegisterModelSuggestionsPeopleToFollowInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the person. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelSuggestionsPeopleToFollowInner instance itself + */ + public ManageRegisterModelSuggestionsPeopleToFollowInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelSuggestionsPeopleToFollowInner manageRegisterModelSuggestionsPeopleToFollowInner = (ManageRegisterModelSuggestionsPeopleToFollowInner) o; + return Objects.equals(this.id, manageRegisterModelSuggestionsPeopleToFollowInner.id) && + Objects.equals(this.name, manageRegisterModelSuggestionsPeopleToFollowInner.name)&& + Objects.equals(this.additionalProperties, manageRegisterModelSuggestionsPeopleToFollowInner.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelSuggestionsPeopleToFollowInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelSuggestionsPeopleToFollowInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelSuggestionsPeopleToFollowInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelSuggestionsPeopleToFollowInner is not found in the empty JSON string", ManageRegisterModelSuggestionsPeopleToFollowInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelSuggestionsPeopleToFollowInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelSuggestionsPeopleToFollowInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelSuggestionsPeopleToFollowInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelSuggestionsPeopleToFollowInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelSuggestionsPeopleToFollowInner>() { + @Override + public void write(JsonWriter out, ManageRegisterModelSuggestionsPeopleToFollowInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelSuggestionsPeopleToFollowInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelSuggestionsPeopleToFollowInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelSuggestionsPeopleToFollowInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelSuggestionsPeopleToFollowInner + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelSuggestionsPeopleToFollowInner + */ + public static ManageRegisterModelSuggestionsPeopleToFollowInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelSuggestionsPeopleToFollowInner.class); + } + + /** + * Convert an instance of ManageRegisterModelSuggestionsPeopleToFollowInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelTelevisionShowInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelTelevisionShowInner.java new file mode 100644 index 0000000..24e97c6 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelTelevisionShowInner.java @@ -0,0 +1,375 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModelTelevisionShowInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelTelevisionShowInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_CATEGORY = "Category"; + @SerializedName(SERIALIZED_NAME_CATEGORY) + @javax.annotation.Nullable + private String category; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public ManageRegisterModelTelevisionShowInner() { + } + + public ManageRegisterModelTelevisionShowInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the television show. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ManageRegisterModelTelevisionShowInner category(@javax.annotation.Nullable String category) { + this.category = category; + return this; + } + + /** + * The category of the television show. + * @return category + */ + @javax.annotation.Nullable + public String getCategory() { + return category; + } + + public void setCategory(@javax.annotation.Nullable String category) { + this.category = category; + } + + + public ManageRegisterModelTelevisionShowInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the television show. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ManageRegisterModelTelevisionShowInner createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * The date the television show was added. + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelTelevisionShowInner instance itself + */ + public ManageRegisterModelTelevisionShowInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelTelevisionShowInner manageRegisterModelTelevisionShowInner = (ManageRegisterModelTelevisionShowInner) o; + return Objects.equals(this.id, manageRegisterModelTelevisionShowInner.id) && + Objects.equals(this.category, manageRegisterModelTelevisionShowInner.category) && + Objects.equals(this.name, manageRegisterModelTelevisionShowInner.name) && + Objects.equals(this.createdDate, manageRegisterModelTelevisionShowInner.createdDate)&& + Objects.equals(this.additionalProperties, manageRegisterModelTelevisionShowInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, createdDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelTelevisionShowInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Category"); + openapiFields.add("Name"); + openapiFields.add("CreatedDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelTelevisionShowInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelTelevisionShowInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelTelevisionShowInner is not found in the empty JSON string", ManageRegisterModelTelevisionShowInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Category") != null && !jsonObj.get("Category").isJsonNull()) && !jsonObj.get("Category").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Category` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Category").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelTelevisionShowInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelTelevisionShowInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelTelevisionShowInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelTelevisionShowInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelTelevisionShowInner>() { + @Override + public void write(JsonWriter out, ManageRegisterModelTelevisionShowInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelTelevisionShowInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelTelevisionShowInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelTelevisionShowInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelTelevisionShowInner + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelTelevisionShowInner + */ + public static ManageRegisterModelTelevisionShowInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelTelevisionShowInner.class); + } + + /** + * Convert an instance of ManageRegisterModelTelevisionShowInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelVolunteerInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelVolunteerInner.java new file mode 100644 index 0000000..acf69c6 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ManageRegisterModelVolunteerInner.java @@ -0,0 +1,377 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ManageRegisterModelVolunteerInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ManageRegisterModelVolunteerInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_ROLE = "Role"; + @SerializedName(SERIALIZED_NAME_ROLE) + @javax.annotation.Nullable + private String role; + + public static final String SERIALIZED_NAME_ORGANIZATION = "Organization"; + @SerializedName(SERIALIZED_NAME_ORGANIZATION) + @javax.annotation.Nullable + private String organization; + + public static final String SERIALIZED_NAME_CAUSE = "Cause"; + @SerializedName(SERIALIZED_NAME_CAUSE) + @javax.annotation.Nullable + private String cause; + + public ManageRegisterModelVolunteerInner() { + } + + public ManageRegisterModelVolunteerInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the volunteer experience. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ManageRegisterModelVolunteerInner role(@javax.annotation.Nullable String role) { + this.role = role; + return this; + } + + /** + * The Role of the User in the volunteer experience. + * @return role + */ + @javax.annotation.Nullable + public String getRole() { + return role; + } + + public void setRole(@javax.annotation.Nullable String role) { + this.role = role; + } + + + public ManageRegisterModelVolunteerInner organization(@javax.annotation.Nullable String organization) { + this.organization = organization; + return this; + } + + /** + * The organization where the User volunteered. + * @return organization + */ + @javax.annotation.Nullable + public String getOrganization() { + return organization; + } + + public void setOrganization(@javax.annotation.Nullable String organization) { + this.organization = organization; + } + + + public ManageRegisterModelVolunteerInner cause(@javax.annotation.Nullable String cause) { + this.cause = cause; + return this; + } + + /** + * The cause supported by the volunteer experience. + * @return cause + */ + @javax.annotation.Nullable + public String getCause() { + return cause; + } + + public void setCause(@javax.annotation.Nullable String cause) { + this.cause = cause; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ManageRegisterModelVolunteerInner instance itself + */ + public ManageRegisterModelVolunteerInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ManageRegisterModelVolunteerInner manageRegisterModelVolunteerInner = (ManageRegisterModelVolunteerInner) o; + return Objects.equals(this.id, manageRegisterModelVolunteerInner.id) && + Objects.equals(this.role, manageRegisterModelVolunteerInner.role) && + Objects.equals(this.organization, manageRegisterModelVolunteerInner.organization) && + Objects.equals(this.cause, manageRegisterModelVolunteerInner.cause)&& + Objects.equals(this.additionalProperties, manageRegisterModelVolunteerInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, role, organization, cause, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ManageRegisterModelVolunteerInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" organization: ").append(toIndentedString(organization)).append("\n"); + sb.append(" cause: ").append(toIndentedString(cause)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Role"); + openapiFields.add("Organization"); + openapiFields.add("Cause"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ManageRegisterModelVolunteerInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ManageRegisterModelVolunteerInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ManageRegisterModelVolunteerInner is not found in the empty JSON string", ManageRegisterModelVolunteerInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Role") != null && !jsonObj.get("Role").isJsonNull()) && !jsonObj.get("Role").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Role` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Role").toString())); + } + if ((jsonObj.get("Organization") != null && !jsonObj.get("Organization").isJsonNull()) && !jsonObj.get("Organization").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Organization` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Organization").toString())); + } + if ((jsonObj.get("Cause") != null && !jsonObj.get("Cause").isJsonNull()) && !jsonObj.get("Cause").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Cause` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Cause").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ManageRegisterModelVolunteerInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ManageRegisterModelVolunteerInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ManageRegisterModelVolunteerInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ManageRegisterModelVolunteerInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ManageRegisterModelVolunteerInner>() { + @Override + public void write(JsonWriter out, ManageRegisterModelVolunteerInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ManageRegisterModelVolunteerInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ManageRegisterModelVolunteerInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ManageRegisterModelVolunteerInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ManageRegisterModelVolunteerInner + * @throws IOException if the JSON string is invalid with respect to ManageRegisterModelVolunteerInner + */ + public static ManageRegisterModelVolunteerInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ManageRegisterModelVolunteerInner.class); + } + + /** + * Convert an instance of ManageRegisterModelVolunteerInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/MultipurposeEmailTokenAPIRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/MultipurposeEmailTokenAPIRequest.java new file mode 100644 index 0000000..86ad95b --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/MultipurposeEmailTokenAPIRequest.java @@ -0,0 +1,365 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.AddEmailModelManage; +import com.loginradius.sdk.internal.openapi.model.DeleteUserModel; +import com.loginradius.sdk.internal.openapi.model.EmailVerificationOrForgotPINModel; +import com.loginradius.sdk.internal.openapi.model.ForgotPasswordOrPasswordLessLoginOrAutoLoginModel; +import java.io.IOException; +import java.util.Arrays; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class MultipurposeEmailTokenAPIRequest extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(MultipurposeEmailTokenAPIRequest.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!MultipurposeEmailTokenAPIRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MultipurposeEmailTokenAPIRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<EmailVerificationOrForgotPINModel> adapterEmailVerificationOrForgotPINModel = gson.getDelegateAdapter(this, TypeToken.get(EmailVerificationOrForgotPINModel.class)); + final TypeAdapter<AddEmailModelManage> adapterAddEmailModelManage = gson.getDelegateAdapter(this, TypeToken.get(AddEmailModelManage.class)); + final TypeAdapter<ForgotPasswordOrPasswordLessLoginOrAutoLoginModel> adapterForgotPasswordOrPasswordLessLoginOrAutoLoginModel = gson.getDelegateAdapter(this, TypeToken.get(ForgotPasswordOrPasswordLessLoginOrAutoLoginModel.class)); + final TypeAdapter<DeleteUserModel> adapterDeleteUserModel = gson.getDelegateAdapter(this, TypeToken.get(DeleteUserModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<MultipurposeEmailTokenAPIRequest>() { + @Override + public void write(JsonWriter out, MultipurposeEmailTokenAPIRequest value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `EmailVerificationOrForgotPINModel` + if (value.getActualInstance() instanceof EmailVerificationOrForgotPINModel) { + JsonElement element = adapterEmailVerificationOrForgotPINModel.toJsonTree((EmailVerificationOrForgotPINModel)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `AddEmailModelManage` + if (value.getActualInstance() instanceof AddEmailModelManage) { + JsonElement element = adapterAddEmailModelManage.toJsonTree((AddEmailModelManage)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `ForgotPasswordOrPasswordLessLoginOrAutoLoginModel` + if (value.getActualInstance() instanceof ForgotPasswordOrPasswordLessLoginOrAutoLoginModel) { + JsonElement element = adapterForgotPasswordOrPasswordLessLoginOrAutoLoginModel.toJsonTree((ForgotPasswordOrPasswordLessLoginOrAutoLoginModel)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `DeleteUserModel` + if (value.getActualInstance() instanceof DeleteUserModel) { + JsonElement element = adapterDeleteUserModel.toJsonTree((DeleteUserModel)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: AddEmailModelManage, DeleteUserModel, EmailVerificationOrForgotPINModel, ForgotPasswordOrPasswordLessLoginOrAutoLoginModel"); + } + + @Override + public MultipurposeEmailTokenAPIRequest read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize EmailVerificationOrForgotPINModel + try { + // validate the JSON object to see if any exception is thrown + EmailVerificationOrForgotPINModel.validateJsonElement(jsonElement); + actualAdapter = adapterEmailVerificationOrForgotPINModel; + match++; + log.log(Level.FINER, "Input data matches schema 'EmailVerificationOrForgotPINModel'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for EmailVerificationOrForgotPINModel failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'EmailVerificationOrForgotPINModel'", e); + } + // deserialize AddEmailModelManage + try { + // validate the JSON object to see if any exception is thrown + AddEmailModelManage.validateJsonElement(jsonElement); + actualAdapter = adapterAddEmailModelManage; + match++; + log.log(Level.FINER, "Input data matches schema 'AddEmailModelManage'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for AddEmailModelManage failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'AddEmailModelManage'", e); + } + // deserialize ForgotPasswordOrPasswordLessLoginOrAutoLoginModel + try { + // validate the JSON object to see if any exception is thrown + ForgotPasswordOrPasswordLessLoginOrAutoLoginModel.validateJsonElement(jsonElement); + actualAdapter = adapterForgotPasswordOrPasswordLessLoginOrAutoLoginModel; + match++; + log.log(Level.FINER, "Input data matches schema 'ForgotPasswordOrPasswordLessLoginOrAutoLoginModel'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for ForgotPasswordOrPasswordLessLoginOrAutoLoginModel failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'ForgotPasswordOrPasswordLessLoginOrAutoLoginModel'", e); + } + // deserialize DeleteUserModel + try { + // validate the JSON object to see if any exception is thrown + DeleteUserModel.validateJsonElement(jsonElement); + actualAdapter = adapterDeleteUserModel; + match++; + log.log(Level.FINER, "Input data matches schema 'DeleteUserModel'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for DeleteUserModel failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'DeleteUserModel'", e); + } + + if (match == 1) { + MultipurposeEmailTokenAPIRequest ret = new MultipurposeEmailTokenAPIRequest(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for MultipurposeEmailTokenAPIRequest: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public MultipurposeEmailTokenAPIRequest() { + super("oneOf", Boolean.FALSE); + } + + public MultipurposeEmailTokenAPIRequest(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("EmailVerificationOrForgotPINModel", EmailVerificationOrForgotPINModel.class); + schemas.put("AddEmailModelManage", AddEmailModelManage.class); + schemas.put("ForgotPasswordOrPasswordLessLoginOrAutoLoginModel", ForgotPasswordOrPasswordLessLoginOrAutoLoginModel.class); + schemas.put("DeleteUserModel", DeleteUserModel.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return MultipurposeEmailTokenAPIRequest.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * AddEmailModelManage, DeleteUserModel, EmailVerificationOrForgotPINModel, ForgotPasswordOrPasswordLessLoginOrAutoLoginModel + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof EmailVerificationOrForgotPINModel) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof AddEmailModelManage) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ForgotPasswordOrPasswordLessLoginOrAutoLoginModel) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof DeleteUserModel) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be AddEmailModelManage, DeleteUserModel, EmailVerificationOrForgotPINModel, ForgotPasswordOrPasswordLessLoginOrAutoLoginModel"); + } + + /** + * Get the actual instance, which can be the following: + * AddEmailModelManage, DeleteUserModel, EmailVerificationOrForgotPINModel, ForgotPasswordOrPasswordLessLoginOrAutoLoginModel + * + * @return The actual instance (AddEmailModelManage, DeleteUserModel, EmailVerificationOrForgotPINModel, ForgotPasswordOrPasswordLessLoginOrAutoLoginModel) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `EmailVerificationOrForgotPINModel`. If the actual instance is not `EmailVerificationOrForgotPINModel`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `EmailVerificationOrForgotPINModel` + * @throws ClassCastException if the instance is not `EmailVerificationOrForgotPINModel` + */ + public EmailVerificationOrForgotPINModel getEmailVerificationOrForgotPINModel() throws ClassCastException { + return (EmailVerificationOrForgotPINModel)super.getActualInstance(); + } + + /** + * Get the actual instance of `AddEmailModelManage`. If the actual instance is not `AddEmailModelManage`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AddEmailModelManage` + * @throws ClassCastException if the instance is not `AddEmailModelManage` + */ + public AddEmailModelManage getAddEmailModelManage() throws ClassCastException { + return (AddEmailModelManage)super.getActualInstance(); + } + + /** + * Get the actual instance of `ForgotPasswordOrPasswordLessLoginOrAutoLoginModel`. If the actual instance is not `ForgotPasswordOrPasswordLessLoginOrAutoLoginModel`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ForgotPasswordOrPasswordLessLoginOrAutoLoginModel` + * @throws ClassCastException if the instance is not `ForgotPasswordOrPasswordLessLoginOrAutoLoginModel` + */ + public ForgotPasswordOrPasswordLessLoginOrAutoLoginModel getForgotPasswordOrPasswordLessLoginOrAutoLoginModel() throws ClassCastException { + return (ForgotPasswordOrPasswordLessLoginOrAutoLoginModel)super.getActualInstance(); + } + + /** + * Get the actual instance of `DeleteUserModel`. If the actual instance is not `DeleteUserModel`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `DeleteUserModel` + * @throws ClassCastException if the instance is not `DeleteUserModel` + */ + public DeleteUserModel getDeleteUserModel() throws ClassCastException { + return (DeleteUserModel)super.getActualInstance(); + } + + /** + * 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 MultipurposeEmailTokenAPIRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with EmailVerificationOrForgotPINModel + try { + EmailVerificationOrForgotPINModel.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for EmailVerificationOrForgotPINModel failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with AddEmailModelManage + try { + AddEmailModelManage.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for AddEmailModelManage failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with ForgotPasswordOrPasswordLessLoginOrAutoLoginModel + try { + ForgotPasswordOrPasswordLessLoginOrAutoLoginModel.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for ForgotPasswordOrPasswordLessLoginOrAutoLoginModel failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with DeleteUserModel + try { + DeleteUserModel.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for DeleteUserModel failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for MultipurposeEmailTokenAPIRequest with oneOf schemas: AddEmailModelManage, DeleteUserModel, EmailVerificationOrForgotPINModel, ForgotPasswordOrPasswordLessLoginOrAutoLoginModel. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of MultipurposeEmailTokenAPIRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of MultipurposeEmailTokenAPIRequest + * @throws IOException if the JSON string is invalid with respect to MultipurposeEmailTokenAPIRequest + */ + public static MultipurposeEmailTokenAPIRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MultipurposeEmailTokenAPIRequest.class); + } + + /** + * Convert an instance of MultipurposeEmailTokenAPIRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/MultipurposeSmsOtpAPIRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/MultipurposeSmsOtpAPIRequest.java new file mode 100644 index 0000000..91d84d8 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/MultipurposeSmsOtpAPIRequest.java @@ -0,0 +1,365 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.AddPhoneModel; +import com.loginradius.sdk.internal.openapi.model.DeleteUserModel; +import com.loginradius.sdk.internal.openapi.model.OneTouchLoginPhoneModel; +import com.loginradius.sdk.internal.openapi.model.PhoneIdModel; +import java.io.IOException; +import java.util.Arrays; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class MultipurposeSmsOtpAPIRequest extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(MultipurposeSmsOtpAPIRequest.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!MultipurposeSmsOtpAPIRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'MultipurposeSmsOtpAPIRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<AddPhoneModel> adapterAddPhoneModel = gson.getDelegateAdapter(this, TypeToken.get(AddPhoneModel.class)); + final TypeAdapter<PhoneIdModel> adapterPhoneIdModel = gson.getDelegateAdapter(this, TypeToken.get(PhoneIdModel.class)); + final TypeAdapter<OneTouchLoginPhoneModel> adapterOneTouchLoginPhoneModel = gson.getDelegateAdapter(this, TypeToken.get(OneTouchLoginPhoneModel.class)); + final TypeAdapter<DeleteUserModel> adapterDeleteUserModel = gson.getDelegateAdapter(this, TypeToken.get(DeleteUserModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<MultipurposeSmsOtpAPIRequest>() { + @Override + public void write(JsonWriter out, MultipurposeSmsOtpAPIRequest value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `AddPhoneModel` + if (value.getActualInstance() instanceof AddPhoneModel) { + JsonElement element = adapterAddPhoneModel.toJsonTree((AddPhoneModel)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `PhoneIdModel` + if (value.getActualInstance() instanceof PhoneIdModel) { + JsonElement element = adapterPhoneIdModel.toJsonTree((PhoneIdModel)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `OneTouchLoginPhoneModel` + if (value.getActualInstance() instanceof OneTouchLoginPhoneModel) { + JsonElement element = adapterOneTouchLoginPhoneModel.toJsonTree((OneTouchLoginPhoneModel)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `DeleteUserModel` + if (value.getActualInstance() instanceof DeleteUserModel) { + JsonElement element = adapterDeleteUserModel.toJsonTree((DeleteUserModel)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: AddPhoneModel, DeleteUserModel, OneTouchLoginPhoneModel, PhoneIdModel"); + } + + @Override + public MultipurposeSmsOtpAPIRequest read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize AddPhoneModel + try { + // validate the JSON object to see if any exception is thrown + AddPhoneModel.validateJsonElement(jsonElement); + actualAdapter = adapterAddPhoneModel; + match++; + log.log(Level.FINER, "Input data matches schema 'AddPhoneModel'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for AddPhoneModel failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'AddPhoneModel'", e); + } + // deserialize PhoneIdModel + try { + // validate the JSON object to see if any exception is thrown + PhoneIdModel.validateJsonElement(jsonElement); + actualAdapter = adapterPhoneIdModel; + match++; + log.log(Level.FINER, "Input data matches schema 'PhoneIdModel'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for PhoneIdModel failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'PhoneIdModel'", e); + } + // deserialize OneTouchLoginPhoneModel + try { + // validate the JSON object to see if any exception is thrown + OneTouchLoginPhoneModel.validateJsonElement(jsonElement); + actualAdapter = adapterOneTouchLoginPhoneModel; + match++; + log.log(Level.FINER, "Input data matches schema 'OneTouchLoginPhoneModel'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for OneTouchLoginPhoneModel failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'OneTouchLoginPhoneModel'", e); + } + // deserialize DeleteUserModel + try { + // validate the JSON object to see if any exception is thrown + DeleteUserModel.validateJsonElement(jsonElement); + actualAdapter = adapterDeleteUserModel; + match++; + log.log(Level.FINER, "Input data matches schema 'DeleteUserModel'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for DeleteUserModel failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'DeleteUserModel'", e); + } + + if (match == 1) { + MultipurposeSmsOtpAPIRequest ret = new MultipurposeSmsOtpAPIRequest(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for MultipurposeSmsOtpAPIRequest: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public MultipurposeSmsOtpAPIRequest() { + super("oneOf", Boolean.FALSE); + } + + public MultipurposeSmsOtpAPIRequest(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("AddPhoneModel", AddPhoneModel.class); + schemas.put("PhoneIdModel", PhoneIdModel.class); + schemas.put("OneTouchLoginPhoneModel", OneTouchLoginPhoneModel.class); + schemas.put("DeleteUserModel", DeleteUserModel.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return MultipurposeSmsOtpAPIRequest.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * AddPhoneModel, DeleteUserModel, OneTouchLoginPhoneModel, PhoneIdModel + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof AddPhoneModel) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof PhoneIdModel) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof OneTouchLoginPhoneModel) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof DeleteUserModel) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be AddPhoneModel, DeleteUserModel, OneTouchLoginPhoneModel, PhoneIdModel"); + } + + /** + * Get the actual instance, which can be the following: + * AddPhoneModel, DeleteUserModel, OneTouchLoginPhoneModel, PhoneIdModel + * + * @return The actual instance (AddPhoneModel, DeleteUserModel, OneTouchLoginPhoneModel, PhoneIdModel) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `AddPhoneModel`. If the actual instance is not `AddPhoneModel`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AddPhoneModel` + * @throws ClassCastException if the instance is not `AddPhoneModel` + */ + public AddPhoneModel getAddPhoneModel() throws ClassCastException { + return (AddPhoneModel)super.getActualInstance(); + } + + /** + * Get the actual instance of `PhoneIdModel`. If the actual instance is not `PhoneIdModel`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `PhoneIdModel` + * @throws ClassCastException if the instance is not `PhoneIdModel` + */ + public PhoneIdModel getPhoneIdModel() throws ClassCastException { + return (PhoneIdModel)super.getActualInstance(); + } + + /** + * Get the actual instance of `OneTouchLoginPhoneModel`. If the actual instance is not `OneTouchLoginPhoneModel`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `OneTouchLoginPhoneModel` + * @throws ClassCastException if the instance is not `OneTouchLoginPhoneModel` + */ + public OneTouchLoginPhoneModel getOneTouchLoginPhoneModel() throws ClassCastException { + return (OneTouchLoginPhoneModel)super.getActualInstance(); + } + + /** + * Get the actual instance of `DeleteUserModel`. If the actual instance is not `DeleteUserModel`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `DeleteUserModel` + * @throws ClassCastException if the instance is not `DeleteUserModel` + */ + public DeleteUserModel getDeleteUserModel() throws ClassCastException { + return (DeleteUserModel)super.getActualInstance(); + } + + /** + * 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 MultipurposeSmsOtpAPIRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with AddPhoneModel + try { + AddPhoneModel.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for AddPhoneModel failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with PhoneIdModel + try { + PhoneIdModel.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for PhoneIdModel failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with OneTouchLoginPhoneModel + try { + OneTouchLoginPhoneModel.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for OneTouchLoginPhoneModel failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with DeleteUserModel + try { + DeleteUserModel.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for DeleteUserModel failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for MultipurposeSmsOtpAPIRequest with oneOf schemas: AddPhoneModel, DeleteUserModel, OneTouchLoginPhoneModel, PhoneIdModel. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of MultipurposeSmsOtpAPIRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of MultipurposeSmsOtpAPIRequest + * @throws IOException if the JSON string is invalid with respect to MultipurposeSmsOtpAPIRequest + */ + public static MultipurposeSmsOtpAPIRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, MultipurposeSmsOtpAPIRequest.class); + } + + /** + * Convert an instance of MultipurposeSmsOtpAPIRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuth2Provider.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuth2Provider.java new file mode 100644 index 0000000..7f0f8ce --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuth2Provider.java @@ -0,0 +1,902 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuth2Provider + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuth2Provider { + public static final String SERIALIZED_NAME_IS_ACTIVE = "IsActive"; + @SerializedName(SERIALIZED_NAME_IS_ACTIVE) + @javax.annotation.Nullable + private Boolean isActive; + + public static final String SERIALIZED_NAME_CREATED_AT = "CreatedAt"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nullable + private OffsetDateTime createdAt; + + public static final String SERIALIZED_NAME_LAST_MODIFIED = "LastModified"; + @SerializedName(SERIALIZED_NAME_LAST_MODIFIED) + @javax.annotation.Nullable + private OffsetDateTime lastModified; + + public static final String SERIALIZED_NAME_QUERY_PARAM = "QueryParam"; + @SerializedName(SERIALIZED_NAME_QUERY_PARAM) + @javax.annotation.Nullable + private Map<String, String> queryParam = new HashMap<>(); + + public static final String SERIALIZED_NAME_HEADERS = "Headers"; + @SerializedName(SERIALIZED_NAME_HEADERS) + @javax.annotation.Nullable + private Map<String, String> headers = new HashMap<>(); + + public static final String SERIALIZED_NAME_DATA_MAP = "DataMap"; + @SerializedName(SERIALIZED_NAME_DATA_MAP) + @javax.annotation.Nullable + private Map<String, String> dataMap = new HashMap<>(); + + public static final String SERIALIZED_NAME_PROVIDER_NAME = "ProviderName"; + @SerializedName(SERIALIZED_NAME_PROVIDER_NAME) + @javax.annotation.Nullable + private String providerName; + + public static final String SERIALIZED_NAME_APPLICATION_I_D = "ApplicationID"; + @SerializedName(SERIALIZED_NAME_APPLICATION_I_D) + @javax.annotation.Nullable + private String applicationID; + + public static final String SERIALIZED_NAME_APPLICATION_KEY = "ApplicationKey"; + @SerializedName(SERIALIZED_NAME_APPLICATION_KEY) + @javax.annotation.Nullable + private String applicationKey; + + public static final String SERIALIZED_NAME_APPLICATION_SECRET = "ApplicationSecret"; + @SerializedName(SERIALIZED_NAME_APPLICATION_SECRET) + @javax.annotation.Nullable + private String applicationSecret; + + public static final String SERIALIZED_NAME_SCOPE = "Scope"; + @SerializedName(SERIALIZED_NAME_SCOPE) + @javax.annotation.Nullable + private String scope; + + public static final String SERIALIZED_NAME_RESPONSE_TYPE = "ResponseType"; + @SerializedName(SERIALIZED_NAME_RESPONSE_TYPE) + @javax.annotation.Nullable + private String responseType; + + public static final String SERIALIZED_NAME_USER_LOGIN_ENDPOINT = "UserLoginEndpoint"; + @SerializedName(SERIALIZED_NAME_USER_LOGIN_ENDPOINT) + @javax.annotation.Nullable + private String userLoginEndpoint; + + public static final String SERIALIZED_NAME_EXTRA_PARAMETER_IN_REDIRECT_TO_PROVIDER = "ExtraParameterInRedirectToProvider"; + @SerializedName(SERIALIZED_NAME_EXTRA_PARAMETER_IN_REDIRECT_TO_PROVIDER) + @javax.annotation.Nullable + private String extraParameterInRedirectToProvider; + + public static final String SERIALIZED_NAME_ACCESS_TOKEN_ENDPOINT = "AccessTokenEndpoint"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN_ENDPOINT) + @javax.annotation.Nullable + private String accessTokenEndpoint; + + public static final String SERIALIZED_NAME_REQUEST_TOKEN_HTTP_METHOD = "RequestTokenHttpMethod"; + @SerializedName(SERIALIZED_NAME_REQUEST_TOKEN_HTTP_METHOD) + @javax.annotation.Nullable + private String requestTokenHttpMethod; + + public static final String SERIALIZED_NAME_ACCESS_TOKEN_PARAMETER_NAME_FOR_API_ACCESS = "AccessTokenParameterNameForApiAccess"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN_PARAMETER_NAME_FOR_API_ACCESS) + @javax.annotation.Nullable + private String accessTokenParameterNameForApiAccess; + + public static final String SERIALIZED_NAME_USERPROFILE_ENDPOINT = "UserprofileEndpoint"; + @SerializedName(SERIALIZED_NAME_USERPROFILE_ENDPOINT) + @javax.annotation.Nullable + private String userprofileEndpoint; + + public static final String SERIALIZED_NAME_DOMAIN = "Domain"; + @SerializedName(SERIALIZED_NAME_DOMAIN) + @javax.annotation.Nullable + private String domain; + + public static final String SERIALIZED_NAME_ENABLE_AUTO_LOOK_UP = "EnableAutoLookUp"; + @SerializedName(SERIALIZED_NAME_ENABLE_AUTO_LOOK_UP) + @javax.annotation.Nullable + private Boolean enableAutoLookUp; + + public static final String SERIALIZED_NAME_LIST_IN_INTERFACE = "ListInInterface"; + @SerializedName(SERIALIZED_NAME_LIST_IN_INTERFACE) + @javax.annotation.Nullable + private Boolean listInInterface; + + public OAuth2Provider() { + } + + public OAuth2Provider isActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Indicates if the OAuth2 provider is active. + * @return isActive + */ + @javax.annotation.Nullable + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + } + + + public OAuth2Provider createdAt(@javax.annotation.Nullable OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * The date and time when the OAuth2 provider was created. + * @return createdAt + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nullable OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + + public OAuth2Provider lastModified(@javax.annotation.Nullable OffsetDateTime lastModified) { + this.lastModified = lastModified; + return this; + } + + /** + * The date and time when the OAuth2 provider was last modified. + * @return lastModified + */ + @javax.annotation.Nullable + public OffsetDateTime getLastModified() { + return lastModified; + } + + public void setLastModified(@javax.annotation.Nullable OffsetDateTime lastModified) { + this.lastModified = lastModified; + } + + + public OAuth2Provider queryParam(@javax.annotation.Nullable Map<String, String> queryParam) { + this.queryParam = queryParam; + return this; + } + + public OAuth2Provider putQueryParamItem(String key, String queryParamItem) { + if (this.queryParam == null) { + this.queryParam = new HashMap<>(); + } + this.queryParam.put(key, queryParamItem); + return this; + } + + /** + * The query parameters for the OAuth2 provider. + * @return queryParam + */ + @javax.annotation.Nullable + public Map<String, String> getQueryParam() { + return queryParam; + } + + public void setQueryParam(@javax.annotation.Nullable Map<String, String> queryParam) { + this.queryParam = queryParam; + } + + + public OAuth2Provider headers(@javax.annotation.Nullable Map<String, String> headers) { + this.headers = headers; + return this; + } + + public OAuth2Provider putHeadersItem(String key, String headersItem) { + if (this.headers == null) { + this.headers = new HashMap<>(); + } + this.headers.put(key, headersItem); + return this; + } + + /** + * The headers for the OAuth2 provider. + * @return headers + */ + @javax.annotation.Nullable + public Map<String, String> getHeaders() { + return headers; + } + + public void setHeaders(@javax.annotation.Nullable Map<String, String> headers) { + this.headers = headers; + } + + + public OAuth2Provider dataMap(@javax.annotation.Nullable Map<String, String> dataMap) { + this.dataMap = dataMap; + return this; + } + + public OAuth2Provider putDataMapItem(String key, String dataMapItem) { + if (this.dataMap == null) { + this.dataMap = new HashMap<>(); + } + this.dataMap.put(key, dataMapItem); + return this; + } + + /** + * The data map for the OAuth2 provider. + * @return dataMap + */ + @javax.annotation.Nullable + public Map<String, String> getDataMap() { + return dataMap; + } + + public void setDataMap(@javax.annotation.Nullable Map<String, String> dataMap) { + this.dataMap = dataMap; + } + + + public OAuth2Provider providerName(@javax.annotation.Nullable String providerName) { + this.providerName = providerName; + return this; + } + + /** + * The name of the OAuth2 provider. + * @return providerName + */ + @javax.annotation.Nullable + public String getProviderName() { + return providerName; + } + + public void setProviderName(@javax.annotation.Nullable String providerName) { + this.providerName = providerName; + } + + + public OAuth2Provider applicationID(@javax.annotation.Nullable String applicationID) { + this.applicationID = applicationID; + return this; + } + + /** + * The application ID for the OAuth2 provider. + * @return applicationID + */ + @javax.annotation.Nullable + public String getApplicationID() { + return applicationID; + } + + public void setApplicationID(@javax.annotation.Nullable String applicationID) { + this.applicationID = applicationID; + } + + + public OAuth2Provider applicationKey(@javax.annotation.Nullable String applicationKey) { + this.applicationKey = applicationKey; + return this; + } + + /** + * The application key for the OAuth2 provider. + * @return applicationKey + */ + @javax.annotation.Nullable + public String getApplicationKey() { + return applicationKey; + } + + public void setApplicationKey(@javax.annotation.Nullable String applicationKey) { + this.applicationKey = applicationKey; + } + + + public OAuth2Provider applicationSecret(@javax.annotation.Nullable String applicationSecret) { + this.applicationSecret = applicationSecret; + return this; + } + + /** + * The application secret for the OAuth2 provider. + * @return applicationSecret + */ + @javax.annotation.Nullable + public String getApplicationSecret() { + return applicationSecret; + } + + public void setApplicationSecret(@javax.annotation.Nullable String applicationSecret) { + this.applicationSecret = applicationSecret; + } + + + public OAuth2Provider scope(@javax.annotation.Nullable String scope) { + this.scope = scope; + return this; + } + + /** + * The scope for the OAuth2 provider. + * @return scope + */ + @javax.annotation.Nullable + public String getScope() { + return scope; + } + + public void setScope(@javax.annotation.Nullable String scope) { + this.scope = scope; + } + + + public OAuth2Provider responseType(@javax.annotation.Nullable String responseType) { + this.responseType = responseType; + return this; + } + + /** + * The response type for the OAuth2 provider. + * @return responseType + */ + @javax.annotation.Nullable + public String getResponseType() { + return responseType; + } + + public void setResponseType(@javax.annotation.Nullable String responseType) { + this.responseType = responseType; + } + + + public OAuth2Provider userLoginEndpoint(@javax.annotation.Nullable String userLoginEndpoint) { + this.userLoginEndpoint = userLoginEndpoint; + return this; + } + + /** + * The User login endpoint for the OAuth2 provider. + * @return userLoginEndpoint + */ + @javax.annotation.Nullable + public String getUserLoginEndpoint() { + return userLoginEndpoint; + } + + public void setUserLoginEndpoint(@javax.annotation.Nullable String userLoginEndpoint) { + this.userLoginEndpoint = userLoginEndpoint; + } + + + public OAuth2Provider extraParameterInRedirectToProvider(@javax.annotation.Nullable String extraParameterInRedirectToProvider) { + this.extraParameterInRedirectToProvider = extraParameterInRedirectToProvider; + return this; + } + + /** + * Extra parameters in redirect to provider. + * @return extraParameterInRedirectToProvider + */ + @javax.annotation.Nullable + public String getExtraParameterInRedirectToProvider() { + return extraParameterInRedirectToProvider; + } + + public void setExtraParameterInRedirectToProvider(@javax.annotation.Nullable String extraParameterInRedirectToProvider) { + this.extraParameterInRedirectToProvider = extraParameterInRedirectToProvider; + } + + + public OAuth2Provider accessTokenEndpoint(@javax.annotation.Nullable String accessTokenEndpoint) { + this.accessTokenEndpoint = accessTokenEndpoint; + return this; + } + + /** + * The Access Token endpoint for the OAuth2 provider. + * @return accessTokenEndpoint + */ + @javax.annotation.Nullable + public String getAccessTokenEndpoint() { + return accessTokenEndpoint; + } + + public void setAccessTokenEndpoint(@javax.annotation.Nullable String accessTokenEndpoint) { + this.accessTokenEndpoint = accessTokenEndpoint; + } + + + public OAuth2Provider requestTokenHttpMethod(@javax.annotation.Nullable String requestTokenHttpMethod) { + this.requestTokenHttpMethod = requestTokenHttpMethod; + return this; + } + + /** + * The HTTP method for requesting tokens. + * @return requestTokenHttpMethod + */ + @javax.annotation.Nullable + public String getRequestTokenHttpMethod() { + return requestTokenHttpMethod; + } + + public void setRequestTokenHttpMethod(@javax.annotation.Nullable String requestTokenHttpMethod) { + this.requestTokenHttpMethod = requestTokenHttpMethod; + } + + + public OAuth2Provider accessTokenParameterNameForApiAccess(@javax.annotation.Nullable String accessTokenParameterNameForApiAccess) { + this.accessTokenParameterNameForApiAccess = accessTokenParameterNameForApiAccess; + return this; + } + + /** + * The Access Token parameter name for API access. + * @return accessTokenParameterNameForApiAccess + */ + @javax.annotation.Nullable + public String getAccessTokenParameterNameForApiAccess() { + return accessTokenParameterNameForApiAccess; + } + + public void setAccessTokenParameterNameForApiAccess(@javax.annotation.Nullable String accessTokenParameterNameForApiAccess) { + this.accessTokenParameterNameForApiAccess = accessTokenParameterNameForApiAccess; + } + + + public OAuth2Provider userprofileEndpoint(@javax.annotation.Nullable String userprofileEndpoint) { + this.userprofileEndpoint = userprofileEndpoint; + return this; + } + + /** + * The User profile endpoint for the OAuth2 provider. + * @return userprofileEndpoint + */ + @javax.annotation.Nullable + public String getUserprofileEndpoint() { + return userprofileEndpoint; + } + + public void setUserprofileEndpoint(@javax.annotation.Nullable String userprofileEndpoint) { + this.userprofileEndpoint = userprofileEndpoint; + } + + + public OAuth2Provider domain(@javax.annotation.Nullable String domain) { + this.domain = domain; + return this; + } + + /** + * The domain for the OAuth2 provider. + * @return domain + */ + @javax.annotation.Nullable + public String getDomain() { + return domain; + } + + public void setDomain(@javax.annotation.Nullable String domain) { + this.domain = domain; + } + + + public OAuth2Provider enableAutoLookUp(@javax.annotation.Nullable Boolean enableAutoLookUp) { + this.enableAutoLookUp = enableAutoLookUp; + return this; + } + + /** + * Indicates if auto lookup is enabled. + * @return enableAutoLookUp + */ + @javax.annotation.Nullable + public Boolean getEnableAutoLookUp() { + return enableAutoLookUp; + } + + public void setEnableAutoLookUp(@javax.annotation.Nullable Boolean enableAutoLookUp) { + this.enableAutoLookUp = enableAutoLookUp; + } + + + public OAuth2Provider listInInterface(@javax.annotation.Nullable Boolean listInInterface) { + this.listInInterface = listInInterface; + return this; + } + + /** + * Indicates if the provider should be listed in the interface. + * @return listInInterface + */ + @javax.annotation.Nullable + public Boolean getListInInterface() { + return listInInterface; + } + + public void setListInInterface(@javax.annotation.Nullable Boolean listInInterface) { + this.listInInterface = listInInterface; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuth2Provider instance itself + */ + public OAuth2Provider putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuth2Provider oauth2Provider = (OAuth2Provider) o; + return Objects.equals(this.isActive, oauth2Provider.isActive) && + Objects.equals(this.createdAt, oauth2Provider.createdAt) && + Objects.equals(this.lastModified, oauth2Provider.lastModified) && + Objects.equals(this.queryParam, oauth2Provider.queryParam) && + Objects.equals(this.headers, oauth2Provider.headers) && + Objects.equals(this.dataMap, oauth2Provider.dataMap) && + Objects.equals(this.providerName, oauth2Provider.providerName) && + Objects.equals(this.applicationID, oauth2Provider.applicationID) && + Objects.equals(this.applicationKey, oauth2Provider.applicationKey) && + Objects.equals(this.applicationSecret, oauth2Provider.applicationSecret) && + Objects.equals(this.scope, oauth2Provider.scope) && + Objects.equals(this.responseType, oauth2Provider.responseType) && + Objects.equals(this.userLoginEndpoint, oauth2Provider.userLoginEndpoint) && + Objects.equals(this.extraParameterInRedirectToProvider, oauth2Provider.extraParameterInRedirectToProvider) && + Objects.equals(this.accessTokenEndpoint, oauth2Provider.accessTokenEndpoint) && + Objects.equals(this.requestTokenHttpMethod, oauth2Provider.requestTokenHttpMethod) && + Objects.equals(this.accessTokenParameterNameForApiAccess, oauth2Provider.accessTokenParameterNameForApiAccess) && + Objects.equals(this.userprofileEndpoint, oauth2Provider.userprofileEndpoint) && + Objects.equals(this.domain, oauth2Provider.domain) && + Objects.equals(this.enableAutoLookUp, oauth2Provider.enableAutoLookUp) && + Objects.equals(this.listInInterface, oauth2Provider.listInInterface)&& + Objects.equals(this.additionalProperties, oauth2Provider.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(isActive, createdAt, lastModified, queryParam, headers, dataMap, providerName, applicationID, applicationKey, applicationSecret, scope, responseType, userLoginEndpoint, extraParameterInRedirectToProvider, accessTokenEndpoint, requestTokenHttpMethod, accessTokenParameterNameForApiAccess, userprofileEndpoint, domain, enableAutoLookUp, listInInterface, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuth2Provider {\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" lastModified: ").append(toIndentedString(lastModified)).append("\n"); + sb.append(" queryParam: ").append(toIndentedString(queryParam)).append("\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append(" dataMap: ").append(toIndentedString(dataMap)).append("\n"); + sb.append(" providerName: ").append(toIndentedString(providerName)).append("\n"); + sb.append(" applicationID: ").append(toIndentedString(applicationID)).append("\n"); + sb.append(" applicationKey: ").append(toIndentedString(applicationKey)).append("\n"); + sb.append(" applicationSecret: ").append(toIndentedString(applicationSecret)).append("\n"); + sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); + sb.append(" responseType: ").append(toIndentedString(responseType)).append("\n"); + sb.append(" userLoginEndpoint: ").append(toIndentedString(userLoginEndpoint)).append("\n"); + sb.append(" extraParameterInRedirectToProvider: ").append(toIndentedString(extraParameterInRedirectToProvider)).append("\n"); + sb.append(" accessTokenEndpoint: ").append(toIndentedString(accessTokenEndpoint)).append("\n"); + sb.append(" requestTokenHttpMethod: ").append(toIndentedString(requestTokenHttpMethod)).append("\n"); + sb.append(" accessTokenParameterNameForApiAccess: ").append(toIndentedString(accessTokenParameterNameForApiAccess)).append("\n"); + sb.append(" userprofileEndpoint: ").append(toIndentedString(userprofileEndpoint)).append("\n"); + sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); + sb.append(" enableAutoLookUp: ").append(toIndentedString(enableAutoLookUp)).append("\n"); + sb.append(" listInInterface: ").append(toIndentedString(listInInterface)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsActive"); + openapiFields.add("CreatedAt"); + openapiFields.add("LastModified"); + openapiFields.add("QueryParam"); + openapiFields.add("Headers"); + openapiFields.add("DataMap"); + openapiFields.add("ProviderName"); + openapiFields.add("ApplicationID"); + openapiFields.add("ApplicationKey"); + openapiFields.add("ApplicationSecret"); + openapiFields.add("Scope"); + openapiFields.add("ResponseType"); + openapiFields.add("UserLoginEndpoint"); + openapiFields.add("ExtraParameterInRedirectToProvider"); + openapiFields.add("AccessTokenEndpoint"); + openapiFields.add("RequestTokenHttpMethod"); + openapiFields.add("AccessTokenParameterNameForApiAccess"); + openapiFields.add("UserprofileEndpoint"); + openapiFields.add("Domain"); + openapiFields.add("EnableAutoLookUp"); + openapiFields.add("ListInInterface"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OAuth2Provider + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuth2Provider.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuth2Provider is not found in the empty JSON string", OAuth2Provider.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ProviderName") != null && !jsonObj.get("ProviderName").isJsonNull()) && !jsonObj.get("ProviderName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProviderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProviderName").toString())); + } + if ((jsonObj.get("ApplicationID") != null && !jsonObj.get("ApplicationID").isJsonNull()) && !jsonObj.get("ApplicationID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ApplicationID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ApplicationID").toString())); + } + if ((jsonObj.get("ApplicationKey") != null && !jsonObj.get("ApplicationKey").isJsonNull()) && !jsonObj.get("ApplicationKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ApplicationKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ApplicationKey").toString())); + } + if ((jsonObj.get("ApplicationSecret") != null && !jsonObj.get("ApplicationSecret").isJsonNull()) && !jsonObj.get("ApplicationSecret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ApplicationSecret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ApplicationSecret").toString())); + } + if ((jsonObj.get("Scope") != null && !jsonObj.get("Scope").isJsonNull()) && !jsonObj.get("Scope").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Scope").toString())); + } + if ((jsonObj.get("ResponseType") != null && !jsonObj.get("ResponseType").isJsonNull()) && !jsonObj.get("ResponseType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ResponseType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ResponseType").toString())); + } + if ((jsonObj.get("UserLoginEndpoint") != null && !jsonObj.get("UserLoginEndpoint").isJsonNull()) && !jsonObj.get("UserLoginEndpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UserLoginEndpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UserLoginEndpoint").toString())); + } + if ((jsonObj.get("ExtraParameterInRedirectToProvider") != null && !jsonObj.get("ExtraParameterInRedirectToProvider").isJsonNull()) && !jsonObj.get("ExtraParameterInRedirectToProvider").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ExtraParameterInRedirectToProvider` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ExtraParameterInRedirectToProvider").toString())); + } + if ((jsonObj.get("AccessTokenEndpoint") != null && !jsonObj.get("AccessTokenEndpoint").isJsonNull()) && !jsonObj.get("AccessTokenEndpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccessTokenEndpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccessTokenEndpoint").toString())); + } + if ((jsonObj.get("RequestTokenHttpMethod") != null && !jsonObj.get("RequestTokenHttpMethod").isJsonNull()) && !jsonObj.get("RequestTokenHttpMethod").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RequestTokenHttpMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RequestTokenHttpMethod").toString())); + } + if ((jsonObj.get("AccessTokenParameterNameForApiAccess") != null && !jsonObj.get("AccessTokenParameterNameForApiAccess").isJsonNull()) && !jsonObj.get("AccessTokenParameterNameForApiAccess").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccessTokenParameterNameForApiAccess` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccessTokenParameterNameForApiAccess").toString())); + } + if ((jsonObj.get("UserprofileEndpoint") != null && !jsonObj.get("UserprofileEndpoint").isJsonNull()) && !jsonObj.get("UserprofileEndpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UserprofileEndpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UserprofileEndpoint").toString())); + } + if ((jsonObj.get("Domain") != null && !jsonObj.get("Domain").isJsonNull()) && !jsonObj.get("Domain").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Domain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Domain").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuth2Provider.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuth2Provider' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuth2Provider> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuth2Provider.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuth2Provider>() { + @Override + public void write(JsonWriter out, OAuth2Provider value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuth2Provider read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuth2Provider instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuth2Provider given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuth2Provider + * @throws IOException if the JSON string is invalid with respect to OAuth2Provider + */ + public static OAuth2Provider fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuth2Provider.class); + } + + /** + * Convert an instance of OAuth2Provider to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthAuthorizationCodeFlow.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthAuthorizationCodeFlow.java new file mode 100644 index 0000000..b3b9ccf --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthAuthorizationCodeFlow.java @@ -0,0 +1,449 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * Authorization Code Flow + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthAuthorizationCodeFlow { + public static final String SERIALIZED_NAME_CLIENT_ID = "client_id"; + @SerializedName(SERIALIZED_NAME_CLIENT_ID) + @javax.annotation.Nonnull + private String clientId; + + public static final String SERIALIZED_NAME_CLIENT_SECRET = "client_secret"; + @SerializedName(SERIALIZED_NAME_CLIENT_SECRET) + @javax.annotation.Nonnull + private String clientSecret; + + public static final String SERIALIZED_NAME_CODE = "code"; + @SerializedName(SERIALIZED_NAME_CODE) + @javax.annotation.Nonnull + private String code; + + public static final String SERIALIZED_NAME_GRANT_TYPE = "grant_type"; + @SerializedName(SERIALIZED_NAME_GRANT_TYPE) + @javax.annotation.Nonnull + private String grantType = "authorization_code"; + + public static final String SERIALIZED_NAME_REDIRECT_URI = "redirect_uri"; + @SerializedName(SERIALIZED_NAME_REDIRECT_URI) + @javax.annotation.Nonnull + private String redirectUri; + + public static final String SERIALIZED_NAME_RESPONSE_TYPE = "response_type"; + @SerializedName(SERIALIZED_NAME_RESPONSE_TYPE) + @javax.annotation.Nullable + private String responseType = "token"; + + public OAuthAuthorizationCodeFlow() { + } + + public OAuthAuthorizationCodeFlow clientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get clientId + * @return clientId + */ + @javax.annotation.Nonnull + public String getClientId() { + return clientId; + } + + public void setClientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + } + + + public OAuthAuthorizationCodeFlow clientSecret(@javax.annotation.Nonnull String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get clientSecret + * @return clientSecret + */ + @javax.annotation.Nonnull + public String getClientSecret() { + return clientSecret; + } + + public void setClientSecret(@javax.annotation.Nonnull String clientSecret) { + this.clientSecret = clientSecret; + } + + + public OAuthAuthorizationCodeFlow code(@javax.annotation.Nonnull String code) { + this.code = code; + return this; + } + + /** + * Get code + * @return code + */ + @javax.annotation.Nonnull + public String getCode() { + return code; + } + + public void setCode(@javax.annotation.Nonnull String code) { + this.code = code; + } + + + public OAuthAuthorizationCodeFlow grantType(@javax.annotation.Nonnull String grantType) { + this.grantType = grantType; + return this; + } + + /** + * Get grantType + * @return grantType + */ + @javax.annotation.Nonnull + public String getGrantType() { + return grantType; + } + + public void setGrantType(@javax.annotation.Nonnull String grantType) { + this.grantType = grantType; + } + + + public OAuthAuthorizationCodeFlow redirectUri(@javax.annotation.Nonnull String redirectUri) { + this.redirectUri = redirectUri; + return this; + } + + /** + * Get redirectUri + * @return redirectUri + */ + @javax.annotation.Nonnull + public String getRedirectUri() { + return redirectUri; + } + + public void setRedirectUri(@javax.annotation.Nonnull String redirectUri) { + this.redirectUri = redirectUri; + } + + + public OAuthAuthorizationCodeFlow responseType(@javax.annotation.Nullable String responseType) { + this.responseType = responseType; + return this; + } + + /** + * Get responseType + * @return responseType + */ + @javax.annotation.Nullable + public String getResponseType() { + return responseType; + } + + public void setResponseType(@javax.annotation.Nullable String responseType) { + this.responseType = responseType; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthAuthorizationCodeFlow instance itself + */ + public OAuthAuthorizationCodeFlow putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthAuthorizationCodeFlow oauthAuthorizationCodeFlow = (OAuthAuthorizationCodeFlow) o; + return Objects.equals(this.clientId, oauthAuthorizationCodeFlow.clientId) && + Objects.equals(this.clientSecret, oauthAuthorizationCodeFlow.clientSecret) && + Objects.equals(this.code, oauthAuthorizationCodeFlow.code) && + Objects.equals(this.grantType, oauthAuthorizationCodeFlow.grantType) && + Objects.equals(this.redirectUri, oauthAuthorizationCodeFlow.redirectUri) && + Objects.equals(this.responseType, oauthAuthorizationCodeFlow.responseType)&& + Objects.equals(this.additionalProperties, oauthAuthorizationCodeFlow.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, clientSecret, code, grantType, redirectUri, responseType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthAuthorizationCodeFlow {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" grantType: ").append(toIndentedString(grantType)).append("\n"); + sb.append(" redirectUri: ").append(toIndentedString(redirectUri)).append("\n"); + sb.append(" responseType: ").append(toIndentedString(responseType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("client_id"); + openapiFields.add("client_secret"); + openapiFields.add("code"); + openapiFields.add("grant_type"); + openapiFields.add("redirect_uri"); + openapiFields.add("response_type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("client_id"); + openapiRequiredFields.add("client_secret"); + openapiRequiredFields.add("code"); + openapiRequiredFields.add("grant_type"); + openapiRequiredFields.add("redirect_uri"); + } + + /** + * 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 OAuthAuthorizationCodeFlow + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthAuthorizationCodeFlow.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthAuthorizationCodeFlow is not found in the empty JSON string", OAuthAuthorizationCodeFlow.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OAuthAuthorizationCodeFlow.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("client_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_id").toString())); + } + if (!jsonObj.get("client_secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_secret").toString())); + } + if (!jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); + } + if (!jsonObj.get("grant_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `grant_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("grant_type").toString())); + } + if (!jsonObj.get("redirect_uri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `redirect_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirect_uri").toString())); + } + if ((jsonObj.get("response_type") != null && !jsonObj.get("response_type").isJsonNull()) && !jsonObj.get("response_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `response_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("response_type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthAuthorizationCodeFlow.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthAuthorizationCodeFlow' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthAuthorizationCodeFlow> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthAuthorizationCodeFlow.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthAuthorizationCodeFlow>() { + @Override + public void write(JsonWriter out, OAuthAuthorizationCodeFlow value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthAuthorizationCodeFlow read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthAuthorizationCodeFlow instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthAuthorizationCodeFlow given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthAuthorizationCodeFlow + * @throws IOException if the JSON string is invalid with respect to OAuthAuthorizationCodeFlow + */ + public static OAuthAuthorizationCodeFlow fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthAuthorizationCodeFlow.class); + } + + /** + * Convert an instance of OAuthAuthorizationCodeFlow to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthAuthorizationCodePKCEFlow.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthAuthorizationCodePKCEFlow.java new file mode 100644 index 0000000..7d8102c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthAuthorizationCodePKCEFlow.java @@ -0,0 +1,449 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * Authorization Code PKCE Flow + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthAuthorizationCodePKCEFlow { + public static final String SERIALIZED_NAME_CLIENT_ID = "client_id"; + @SerializedName(SERIALIZED_NAME_CLIENT_ID) + @javax.annotation.Nonnull + private String clientId; + + public static final String SERIALIZED_NAME_CODE = "code"; + @SerializedName(SERIALIZED_NAME_CODE) + @javax.annotation.Nonnull + private String code; + + public static final String SERIALIZED_NAME_CODE_VERIFIER = "code_verifier"; + @SerializedName(SERIALIZED_NAME_CODE_VERIFIER) + @javax.annotation.Nonnull + private String codeVerifier; + + public static final String SERIALIZED_NAME_GRANT_TYPE = "grant_type"; + @SerializedName(SERIALIZED_NAME_GRANT_TYPE) + @javax.annotation.Nonnull + private String grantType = "authorization_code"; + + public static final String SERIALIZED_NAME_REDIRECT_URI = "redirect_uri"; + @SerializedName(SERIALIZED_NAME_REDIRECT_URI) + @javax.annotation.Nonnull + private String redirectUri; + + public static final String SERIALIZED_NAME_RESPONSE_TYPE = "response_type"; + @SerializedName(SERIALIZED_NAME_RESPONSE_TYPE) + @javax.annotation.Nullable + private String responseType = "token"; + + public OAuthAuthorizationCodePKCEFlow() { + } + + public OAuthAuthorizationCodePKCEFlow clientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get clientId + * @return clientId + */ + @javax.annotation.Nonnull + public String getClientId() { + return clientId; + } + + public void setClientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + } + + + public OAuthAuthorizationCodePKCEFlow code(@javax.annotation.Nonnull String code) { + this.code = code; + return this; + } + + /** + * Get code + * @return code + */ + @javax.annotation.Nonnull + public String getCode() { + return code; + } + + public void setCode(@javax.annotation.Nonnull String code) { + this.code = code; + } + + + public OAuthAuthorizationCodePKCEFlow codeVerifier(@javax.annotation.Nonnull String codeVerifier) { + this.codeVerifier = codeVerifier; + return this; + } + + /** + * Get codeVerifier + * @return codeVerifier + */ + @javax.annotation.Nonnull + public String getCodeVerifier() { + return codeVerifier; + } + + public void setCodeVerifier(@javax.annotation.Nonnull String codeVerifier) { + this.codeVerifier = codeVerifier; + } + + + public OAuthAuthorizationCodePKCEFlow grantType(@javax.annotation.Nonnull String grantType) { + this.grantType = grantType; + return this; + } + + /** + * Get grantType + * @return grantType + */ + @javax.annotation.Nonnull + public String getGrantType() { + return grantType; + } + + public void setGrantType(@javax.annotation.Nonnull String grantType) { + this.grantType = grantType; + } + + + public OAuthAuthorizationCodePKCEFlow redirectUri(@javax.annotation.Nonnull String redirectUri) { + this.redirectUri = redirectUri; + return this; + } + + /** + * Get redirectUri + * @return redirectUri + */ + @javax.annotation.Nonnull + public String getRedirectUri() { + return redirectUri; + } + + public void setRedirectUri(@javax.annotation.Nonnull String redirectUri) { + this.redirectUri = redirectUri; + } + + + public OAuthAuthorizationCodePKCEFlow responseType(@javax.annotation.Nullable String responseType) { + this.responseType = responseType; + return this; + } + + /** + * Get responseType + * @return responseType + */ + @javax.annotation.Nullable + public String getResponseType() { + return responseType; + } + + public void setResponseType(@javax.annotation.Nullable String responseType) { + this.responseType = responseType; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthAuthorizationCodePKCEFlow instance itself + */ + public OAuthAuthorizationCodePKCEFlow putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthAuthorizationCodePKCEFlow oauthAuthorizationCodePKCEFlow = (OAuthAuthorizationCodePKCEFlow) o; + return Objects.equals(this.clientId, oauthAuthorizationCodePKCEFlow.clientId) && + Objects.equals(this.code, oauthAuthorizationCodePKCEFlow.code) && + Objects.equals(this.codeVerifier, oauthAuthorizationCodePKCEFlow.codeVerifier) && + Objects.equals(this.grantType, oauthAuthorizationCodePKCEFlow.grantType) && + Objects.equals(this.redirectUri, oauthAuthorizationCodePKCEFlow.redirectUri) && + Objects.equals(this.responseType, oauthAuthorizationCodePKCEFlow.responseType)&& + Objects.equals(this.additionalProperties, oauthAuthorizationCodePKCEFlow.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, code, codeVerifier, grantType, redirectUri, responseType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthAuthorizationCodePKCEFlow {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" codeVerifier: ").append(toIndentedString(codeVerifier)).append("\n"); + sb.append(" grantType: ").append(toIndentedString(grantType)).append("\n"); + sb.append(" redirectUri: ").append(toIndentedString(redirectUri)).append("\n"); + sb.append(" responseType: ").append(toIndentedString(responseType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("client_id"); + openapiFields.add("code"); + openapiFields.add("code_verifier"); + openapiFields.add("grant_type"); + openapiFields.add("redirect_uri"); + openapiFields.add("response_type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("client_id"); + openapiRequiredFields.add("code"); + openapiRequiredFields.add("code_verifier"); + openapiRequiredFields.add("grant_type"); + openapiRequiredFields.add("redirect_uri"); + } + + /** + * 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 OAuthAuthorizationCodePKCEFlow + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthAuthorizationCodePKCEFlow.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthAuthorizationCodePKCEFlow is not found in the empty JSON string", OAuthAuthorizationCodePKCEFlow.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OAuthAuthorizationCodePKCEFlow.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("client_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_id").toString())); + } + if (!jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); + } + if (!jsonObj.get("code_verifier").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `code_verifier` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code_verifier").toString())); + } + if (!jsonObj.get("grant_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `grant_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("grant_type").toString())); + } + if (!jsonObj.get("redirect_uri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `redirect_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirect_uri").toString())); + } + if ((jsonObj.get("response_type") != null && !jsonObj.get("response_type").isJsonNull()) && !jsonObj.get("response_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `response_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("response_type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthAuthorizationCodePKCEFlow.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthAuthorizationCodePKCEFlow' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthAuthorizationCodePKCEFlow> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthAuthorizationCodePKCEFlow.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthAuthorizationCodePKCEFlow>() { + @Override + public void write(JsonWriter out, OAuthAuthorizationCodePKCEFlow value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthAuthorizationCodePKCEFlow read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthAuthorizationCodePKCEFlow instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthAuthorizationCodePKCEFlow given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthAuthorizationCodePKCEFlow + * @throws IOException if the JSON string is invalid with respect to OAuthAuthorizationCodePKCEFlow + */ + public static OAuthAuthorizationCodePKCEFlow fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthAuthorizationCodePKCEFlow.class); + } + + /** + * Convert an instance of OAuthAuthorizationCodePKCEFlow to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthAuthorizationServerMetadata.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthAuthorizationServerMetadata.java new file mode 100644 index 0000000..2220da2 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthAuthorizationServerMetadata.java @@ -0,0 +1,863 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuth 2.0 Authorization Server Metadata (RFC 8414). Standard discovery document for OAuth 2.0 authorization servers; does not include OpenID Connect-specific fields (e.g. userinfo_endpoint, claims_supported). + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthAuthorizationServerMetadata { + public static final String SERIALIZED_NAME_ISSUER = "issuer"; + @SerializedName(SERIALIZED_NAME_ISSUER) + @javax.annotation.Nonnull + private String issuer; + + public static final String SERIALIZED_NAME_AUTHORIZATION_ENDPOINT = "authorization_endpoint"; + @SerializedName(SERIALIZED_NAME_AUTHORIZATION_ENDPOINT) + @javax.annotation.Nullable + private String authorizationEndpoint; + + public static final String SERIALIZED_NAME_TOKEN_ENDPOINT = "token_endpoint"; + @SerializedName(SERIALIZED_NAME_TOKEN_ENDPOINT) + @javax.annotation.Nonnull + private String tokenEndpoint; + + public static final String SERIALIZED_NAME_JWKS_URI = "jwks_uri"; + @SerializedName(SERIALIZED_NAME_JWKS_URI) + @javax.annotation.Nonnull + private String jwksUri; + + public static final String SERIALIZED_NAME_RESPONSE_TYPES_SUPPORTED = "response_types_supported"; + @SerializedName(SERIALIZED_NAME_RESPONSE_TYPES_SUPPORTED) + @javax.annotation.Nonnull + private List<String> responseTypesSupported = new ArrayList<>(); + + public static final String SERIALIZED_NAME_GRANT_TYPES_SUPPORTED = "grant_types_supported"; + @SerializedName(SERIALIZED_NAME_GRANT_TYPES_SUPPORTED) + @javax.annotation.Nonnull + private List<String> grantTypesSupported = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TOKEN_ENDPOINT_AUTH_METHODS_SUPPORTED = "token_endpoint_auth_methods_supported"; + @SerializedName(SERIALIZED_NAME_TOKEN_ENDPOINT_AUTH_METHODS_SUPPORTED) + @javax.annotation.Nullable + private List<String> tokenEndpointAuthMethodsSupported = new ArrayList<>(); + + public static final String SERIALIZED_NAME_REGISTRATION_ENDPOINT = "registration_endpoint"; + @SerializedName(SERIALIZED_NAME_REGISTRATION_ENDPOINT) + @javax.annotation.Nullable + private String registrationEndpoint; + + public static final String SERIALIZED_NAME_SCOPES_SUPPORTED = "scopes_supported"; + @SerializedName(SERIALIZED_NAME_SCOPES_SUPPORTED) + @javax.annotation.Nullable + private List<String> scopesSupported = new ArrayList<>(); + + public static final String SERIALIZED_NAME_RESPONSE_MODES_SUPPORTED = "response_modes_supported"; + @SerializedName(SERIALIZED_NAME_RESPONSE_MODES_SUPPORTED) + @javax.annotation.Nullable + private List<String> responseModesSupported = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CODE_CHALLENGE_METHODS_SUPPORTED = "code_challenge_methods_supported"; + @SerializedName(SERIALIZED_NAME_CODE_CHALLENGE_METHODS_SUPPORTED) + @javax.annotation.Nullable + private List<String> codeChallengeMethodsSupported = new ArrayList<>(); + + public static final String SERIALIZED_NAME_REVOCATION_ENDPOINT = "revocation_endpoint"; + @SerializedName(SERIALIZED_NAME_REVOCATION_ENDPOINT) + @javax.annotation.Nullable + private String revocationEndpoint; + + public static final String SERIALIZED_NAME_REVOCATION_ENDPOINT_AUTH_METHODS_SUPPORTED = "revocation_endpoint_auth_methods_supported"; + @SerializedName(SERIALIZED_NAME_REVOCATION_ENDPOINT_AUTH_METHODS_SUPPORTED) + @javax.annotation.Nullable + private List<String> revocationEndpointAuthMethodsSupported = new ArrayList<>(); + + public static final String SERIALIZED_NAME_DEVICE_AUTHORIZATION_ENDPOINT = "device_authorization_endpoint"; + @SerializedName(SERIALIZED_NAME_DEVICE_AUTHORIZATION_ENDPOINT) + @javax.annotation.Nullable + private String deviceAuthorizationEndpoint; + + public static final String SERIALIZED_NAME_TOKEN_ENDPOINT_AUTH_SIGNING_ALG_VALUES_SUPPORTED = "token_endpoint_auth_signing_alg_values_supported"; + @SerializedName(SERIALIZED_NAME_TOKEN_ENDPOINT_AUTH_SIGNING_ALG_VALUES_SUPPORTED) + @javax.annotation.Nullable + private List<String> tokenEndpointAuthSigningAlgValuesSupported = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SUBJECT_TYPES_SUPPORTED = "subject_types_supported"; + @SerializedName(SERIALIZED_NAME_SUBJECT_TYPES_SUPPORTED) + @javax.annotation.Nullable + private List<String> subjectTypesSupported = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CLIENT_ID_METADATA_DOCUMENT_SUPPORTED = "ClientIdMetadataDocumentSupported"; + @SerializedName(SERIALIZED_NAME_CLIENT_ID_METADATA_DOCUMENT_SUPPORTED) + @javax.annotation.Nullable + private Boolean clientIdMetadataDocumentSupported; + + public OAuthAuthorizationServerMetadata() { + } + + public OAuthAuthorizationServerMetadata issuer(@javax.annotation.Nonnull String issuer) { + this.issuer = issuer; + return this; + } + + /** + * The authorization server's issuer identifier (MUST match the requested issuer). + * @return issuer + */ + @javax.annotation.Nonnull + public String getIssuer() { + return issuer; + } + + public void setIssuer(@javax.annotation.Nonnull String issuer) { + this.issuer = issuer; + } + + + public OAuthAuthorizationServerMetadata authorizationEndpoint(@javax.annotation.Nullable String authorizationEndpoint) { + this.authorizationEndpoint = authorizationEndpoint; + return this; + } + + /** + * URL of the authorization endpoint. + * @return authorizationEndpoint + */ + @javax.annotation.Nullable + public String getAuthorizationEndpoint() { + return authorizationEndpoint; + } + + public void setAuthorizationEndpoint(@javax.annotation.Nullable String authorizationEndpoint) { + this.authorizationEndpoint = authorizationEndpoint; + } + + + public OAuthAuthorizationServerMetadata tokenEndpoint(@javax.annotation.Nonnull String tokenEndpoint) { + this.tokenEndpoint = tokenEndpoint; + return this; + } + + /** + * URL of the token endpoint. + * @return tokenEndpoint + */ + @javax.annotation.Nonnull + public String getTokenEndpoint() { + return tokenEndpoint; + } + + public void setTokenEndpoint(@javax.annotation.Nonnull String tokenEndpoint) { + this.tokenEndpoint = tokenEndpoint; + } + + + public OAuthAuthorizationServerMetadata jwksUri(@javax.annotation.Nonnull String jwksUri) { + this.jwksUri = jwksUri; + return this; + } + + /** + * URL of the JSON Web Key Set document. + * @return jwksUri + */ + @javax.annotation.Nonnull + public String getJwksUri() { + return jwksUri; + } + + public void setJwksUri(@javax.annotation.Nonnull String jwksUri) { + this.jwksUri = jwksUri; + } + + + public OAuthAuthorizationServerMetadata responseTypesSupported(@javax.annotation.Nonnull List<String> responseTypesSupported) { + this.responseTypesSupported = responseTypesSupported; + return this; + } + + public OAuthAuthorizationServerMetadata addResponseTypesSupportedItem(String responseTypesSupportedItem) { + if (this.responseTypesSupported == null) { + this.responseTypesSupported = new ArrayList<>(); + } + this.responseTypesSupported.add(responseTypesSupportedItem); + return this; + } + + /** + * List of OAuth 2.0 response_type values supported. + * @return responseTypesSupported + */ + @javax.annotation.Nonnull + public List<String> getResponseTypesSupported() { + return responseTypesSupported; + } + + public void setResponseTypesSupported(@javax.annotation.Nonnull List<String> responseTypesSupported) { + this.responseTypesSupported = responseTypesSupported; + } + + + public OAuthAuthorizationServerMetadata grantTypesSupported(@javax.annotation.Nonnull List<String> grantTypesSupported) { + this.grantTypesSupported = grantTypesSupported; + return this; + } + + public OAuthAuthorizationServerMetadata addGrantTypesSupportedItem(String grantTypesSupportedItem) { + if (this.grantTypesSupported == null) { + this.grantTypesSupported = new ArrayList<>(); + } + this.grantTypesSupported.add(grantTypesSupportedItem); + return this; + } + + /** + * List of OAuth 2.0 grant type values supported. + * @return grantTypesSupported + */ + @javax.annotation.Nonnull + public List<String> getGrantTypesSupported() { + return grantTypesSupported; + } + + public void setGrantTypesSupported(@javax.annotation.Nonnull List<String> grantTypesSupported) { + this.grantTypesSupported = grantTypesSupported; + } + + + public OAuthAuthorizationServerMetadata tokenEndpointAuthMethodsSupported(@javax.annotation.Nullable List<String> tokenEndpointAuthMethodsSupported) { + this.tokenEndpointAuthMethodsSupported = tokenEndpointAuthMethodsSupported; + return this; + } + + public OAuthAuthorizationServerMetadata addTokenEndpointAuthMethodsSupportedItem(String tokenEndpointAuthMethodsSupportedItem) { + if (this.tokenEndpointAuthMethodsSupported == null) { + this.tokenEndpointAuthMethodsSupported = new ArrayList<>(); + } + this.tokenEndpointAuthMethodsSupported.add(tokenEndpointAuthMethodsSupportedItem); + return this; + } + + /** + * List of client authentication methods supported at the token endpoint. + * @return tokenEndpointAuthMethodsSupported + */ + @javax.annotation.Nullable + public List<String> getTokenEndpointAuthMethodsSupported() { + return tokenEndpointAuthMethodsSupported; + } + + public void setTokenEndpointAuthMethodsSupported(@javax.annotation.Nullable List<String> tokenEndpointAuthMethodsSupported) { + this.tokenEndpointAuthMethodsSupported = tokenEndpointAuthMethodsSupported; + } + + + public OAuthAuthorizationServerMetadata registrationEndpoint(@javax.annotation.Nullable String registrationEndpoint) { + this.registrationEndpoint = registrationEndpoint; + return this; + } + + /** + * URL of the dynamic client registration endpoint (optional). + * @return registrationEndpoint + */ + @javax.annotation.Nullable + public String getRegistrationEndpoint() { + return registrationEndpoint; + } + + public void setRegistrationEndpoint(@javax.annotation.Nullable String registrationEndpoint) { + this.registrationEndpoint = registrationEndpoint; + } + + + public OAuthAuthorizationServerMetadata scopesSupported(@javax.annotation.Nullable List<String> scopesSupported) { + this.scopesSupported = scopesSupported; + return this; + } + + public OAuthAuthorizationServerMetadata addScopesSupportedItem(String scopesSupportedItem) { + if (this.scopesSupported == null) { + this.scopesSupported = new ArrayList<>(); + } + this.scopesSupported.add(scopesSupportedItem); + return this; + } + + /** + * List of OAuth 2.0 scope values supported. + * @return scopesSupported + */ + @javax.annotation.Nullable + public List<String> getScopesSupported() { + return scopesSupported; + } + + public void setScopesSupported(@javax.annotation.Nullable List<String> scopesSupported) { + this.scopesSupported = scopesSupported; + } + + + public OAuthAuthorizationServerMetadata responseModesSupported(@javax.annotation.Nullable List<String> responseModesSupported) { + this.responseModesSupported = responseModesSupported; + return this; + } + + public OAuthAuthorizationServerMetadata addResponseModesSupportedItem(String responseModesSupportedItem) { + if (this.responseModesSupported == null) { + this.responseModesSupported = new ArrayList<>(); + } + this.responseModesSupported.add(responseModesSupportedItem); + return this; + } + + /** + * Get responseModesSupported + * @return responseModesSupported + */ + @javax.annotation.Nullable + public List<String> getResponseModesSupported() { + return responseModesSupported; + } + + public void setResponseModesSupported(@javax.annotation.Nullable List<String> responseModesSupported) { + this.responseModesSupported = responseModesSupported; + } + + + public OAuthAuthorizationServerMetadata codeChallengeMethodsSupported(@javax.annotation.Nullable List<String> codeChallengeMethodsSupported) { + this.codeChallengeMethodsSupported = codeChallengeMethodsSupported; + return this; + } + + public OAuthAuthorizationServerMetadata addCodeChallengeMethodsSupportedItem(String codeChallengeMethodsSupportedItem) { + if (this.codeChallengeMethodsSupported == null) { + this.codeChallengeMethodsSupported = new ArrayList<>(); + } + this.codeChallengeMethodsSupported.add(codeChallengeMethodsSupportedItem); + return this; + } + + /** + * PKCE code challenge methods supported. + * @return codeChallengeMethodsSupported + */ + @javax.annotation.Nullable + public List<String> getCodeChallengeMethodsSupported() { + return codeChallengeMethodsSupported; + } + + public void setCodeChallengeMethodsSupported(@javax.annotation.Nullable List<String> codeChallengeMethodsSupported) { + this.codeChallengeMethodsSupported = codeChallengeMethodsSupported; + } + + + public OAuthAuthorizationServerMetadata revocationEndpoint(@javax.annotation.Nullable String revocationEndpoint) { + this.revocationEndpoint = revocationEndpoint; + return this; + } + + /** + * URL of the token revocation endpoint. + * @return revocationEndpoint + */ + @javax.annotation.Nullable + public String getRevocationEndpoint() { + return revocationEndpoint; + } + + public void setRevocationEndpoint(@javax.annotation.Nullable String revocationEndpoint) { + this.revocationEndpoint = revocationEndpoint; + } + + + public OAuthAuthorizationServerMetadata revocationEndpointAuthMethodsSupported(@javax.annotation.Nullable List<String> revocationEndpointAuthMethodsSupported) { + this.revocationEndpointAuthMethodsSupported = revocationEndpointAuthMethodsSupported; + return this; + } + + public OAuthAuthorizationServerMetadata addRevocationEndpointAuthMethodsSupportedItem(String revocationEndpointAuthMethodsSupportedItem) { + if (this.revocationEndpointAuthMethodsSupported == null) { + this.revocationEndpointAuthMethodsSupported = new ArrayList<>(); + } + this.revocationEndpointAuthMethodsSupported.add(revocationEndpointAuthMethodsSupportedItem); + return this; + } + + /** + * Get revocationEndpointAuthMethodsSupported + * @return revocationEndpointAuthMethodsSupported + */ + @javax.annotation.Nullable + public List<String> getRevocationEndpointAuthMethodsSupported() { + return revocationEndpointAuthMethodsSupported; + } + + public void setRevocationEndpointAuthMethodsSupported(@javax.annotation.Nullable List<String> revocationEndpointAuthMethodsSupported) { + this.revocationEndpointAuthMethodsSupported = revocationEndpointAuthMethodsSupported; + } + + + public OAuthAuthorizationServerMetadata deviceAuthorizationEndpoint(@javax.annotation.Nullable String deviceAuthorizationEndpoint) { + this.deviceAuthorizationEndpoint = deviceAuthorizationEndpoint; + return this; + } + + /** + * URL of the device authorization endpoint. + * @return deviceAuthorizationEndpoint + */ + @javax.annotation.Nullable + public String getDeviceAuthorizationEndpoint() { + return deviceAuthorizationEndpoint; + } + + public void setDeviceAuthorizationEndpoint(@javax.annotation.Nullable String deviceAuthorizationEndpoint) { + this.deviceAuthorizationEndpoint = deviceAuthorizationEndpoint; + } + + + public OAuthAuthorizationServerMetadata tokenEndpointAuthSigningAlgValuesSupported(@javax.annotation.Nullable List<String> tokenEndpointAuthSigningAlgValuesSupported) { + this.tokenEndpointAuthSigningAlgValuesSupported = tokenEndpointAuthSigningAlgValuesSupported; + return this; + } + + public OAuthAuthorizationServerMetadata addTokenEndpointAuthSigningAlgValuesSupportedItem(String tokenEndpointAuthSigningAlgValuesSupportedItem) { + if (this.tokenEndpointAuthSigningAlgValuesSupported == null) { + this.tokenEndpointAuthSigningAlgValuesSupported = new ArrayList<>(); + } + this.tokenEndpointAuthSigningAlgValuesSupported.add(tokenEndpointAuthSigningAlgValuesSupportedItem); + return this; + } + + /** + * Get tokenEndpointAuthSigningAlgValuesSupported + * @return tokenEndpointAuthSigningAlgValuesSupported + */ + @javax.annotation.Nullable + public List<String> getTokenEndpointAuthSigningAlgValuesSupported() { + return tokenEndpointAuthSigningAlgValuesSupported; + } + + public void setTokenEndpointAuthSigningAlgValuesSupported(@javax.annotation.Nullable List<String> tokenEndpointAuthSigningAlgValuesSupported) { + this.tokenEndpointAuthSigningAlgValuesSupported = tokenEndpointAuthSigningAlgValuesSupported; + } + + + public OAuthAuthorizationServerMetadata subjectTypesSupported(@javax.annotation.Nullable List<String> subjectTypesSupported) { + this.subjectTypesSupported = subjectTypesSupported; + return this; + } + + public OAuthAuthorizationServerMetadata addSubjectTypesSupportedItem(String subjectTypesSupportedItem) { + if (this.subjectTypesSupported == null) { + this.subjectTypesSupported = new ArrayList<>(); + } + this.subjectTypesSupported.add(subjectTypesSupportedItem); + return this; + } + + /** + * List of subject identifier types supported. + * @return subjectTypesSupported + */ + @javax.annotation.Nullable + public List<String> getSubjectTypesSupported() { + return subjectTypesSupported; + } + + public void setSubjectTypesSupported(@javax.annotation.Nullable List<String> subjectTypesSupported) { + this.subjectTypesSupported = subjectTypesSupported; + } + + + public OAuthAuthorizationServerMetadata clientIdMetadataDocumentSupported(@javax.annotation.Nullable Boolean clientIdMetadataDocumentSupported) { + this.clientIdMetadataDocumentSupported = clientIdMetadataDocumentSupported; + return this; + } + + /** + * Indicates if the client metadata document is supported. + * @return clientIdMetadataDocumentSupported + */ + @javax.annotation.Nullable + public Boolean getClientIdMetadataDocumentSupported() { + return clientIdMetadataDocumentSupported; + } + + public void setClientIdMetadataDocumentSupported(@javax.annotation.Nullable Boolean clientIdMetadataDocumentSupported) { + this.clientIdMetadataDocumentSupported = clientIdMetadataDocumentSupported; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthAuthorizationServerMetadata instance itself + */ + public OAuthAuthorizationServerMetadata putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthAuthorizationServerMetadata oauthAuthorizationServerMetadata = (OAuthAuthorizationServerMetadata) o; + return Objects.equals(this.issuer, oauthAuthorizationServerMetadata.issuer) && + Objects.equals(this.authorizationEndpoint, oauthAuthorizationServerMetadata.authorizationEndpoint) && + Objects.equals(this.tokenEndpoint, oauthAuthorizationServerMetadata.tokenEndpoint) && + Objects.equals(this.jwksUri, oauthAuthorizationServerMetadata.jwksUri) && + Objects.equals(this.responseTypesSupported, oauthAuthorizationServerMetadata.responseTypesSupported) && + Objects.equals(this.grantTypesSupported, oauthAuthorizationServerMetadata.grantTypesSupported) && + Objects.equals(this.tokenEndpointAuthMethodsSupported, oauthAuthorizationServerMetadata.tokenEndpointAuthMethodsSupported) && + Objects.equals(this.registrationEndpoint, oauthAuthorizationServerMetadata.registrationEndpoint) && + Objects.equals(this.scopesSupported, oauthAuthorizationServerMetadata.scopesSupported) && + Objects.equals(this.responseModesSupported, oauthAuthorizationServerMetadata.responseModesSupported) && + Objects.equals(this.codeChallengeMethodsSupported, oauthAuthorizationServerMetadata.codeChallengeMethodsSupported) && + Objects.equals(this.revocationEndpoint, oauthAuthorizationServerMetadata.revocationEndpoint) && + Objects.equals(this.revocationEndpointAuthMethodsSupported, oauthAuthorizationServerMetadata.revocationEndpointAuthMethodsSupported) && + Objects.equals(this.deviceAuthorizationEndpoint, oauthAuthorizationServerMetadata.deviceAuthorizationEndpoint) && + Objects.equals(this.tokenEndpointAuthSigningAlgValuesSupported, oauthAuthorizationServerMetadata.tokenEndpointAuthSigningAlgValuesSupported) && + Objects.equals(this.subjectTypesSupported, oauthAuthorizationServerMetadata.subjectTypesSupported) && + Objects.equals(this.clientIdMetadataDocumentSupported, oauthAuthorizationServerMetadata.clientIdMetadataDocumentSupported)&& + Objects.equals(this.additionalProperties, oauthAuthorizationServerMetadata.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(issuer, authorizationEndpoint, tokenEndpoint, jwksUri, responseTypesSupported, grantTypesSupported, tokenEndpointAuthMethodsSupported, registrationEndpoint, scopesSupported, responseModesSupported, codeChallengeMethodsSupported, revocationEndpoint, revocationEndpointAuthMethodsSupported, deviceAuthorizationEndpoint, tokenEndpointAuthSigningAlgValuesSupported, subjectTypesSupported, clientIdMetadataDocumentSupported, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthAuthorizationServerMetadata {\n"); + sb.append(" issuer: ").append(toIndentedString(issuer)).append("\n"); + sb.append(" authorizationEndpoint: ").append(toIndentedString(authorizationEndpoint)).append("\n"); + sb.append(" tokenEndpoint: ").append(toIndentedString(tokenEndpoint)).append("\n"); + sb.append(" jwksUri: ").append(toIndentedString(jwksUri)).append("\n"); + sb.append(" responseTypesSupported: ").append(toIndentedString(responseTypesSupported)).append("\n"); + sb.append(" grantTypesSupported: ").append(toIndentedString(grantTypesSupported)).append("\n"); + sb.append(" tokenEndpointAuthMethodsSupported: ").append(toIndentedString(tokenEndpointAuthMethodsSupported)).append("\n"); + sb.append(" registrationEndpoint: ").append(toIndentedString(registrationEndpoint)).append("\n"); + sb.append(" scopesSupported: ").append(toIndentedString(scopesSupported)).append("\n"); + sb.append(" responseModesSupported: ").append(toIndentedString(responseModesSupported)).append("\n"); + sb.append(" codeChallengeMethodsSupported: ").append(toIndentedString(codeChallengeMethodsSupported)).append("\n"); + sb.append(" revocationEndpoint: ").append(toIndentedString(revocationEndpoint)).append("\n"); + sb.append(" revocationEndpointAuthMethodsSupported: ").append(toIndentedString(revocationEndpointAuthMethodsSupported)).append("\n"); + sb.append(" deviceAuthorizationEndpoint: ").append(toIndentedString(deviceAuthorizationEndpoint)).append("\n"); + sb.append(" tokenEndpointAuthSigningAlgValuesSupported: ").append(toIndentedString(tokenEndpointAuthSigningAlgValuesSupported)).append("\n"); + sb.append(" subjectTypesSupported: ").append(toIndentedString(subjectTypesSupported)).append("\n"); + sb.append(" clientIdMetadataDocumentSupported: ").append(toIndentedString(clientIdMetadataDocumentSupported)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("issuer"); + openapiFields.add("authorization_endpoint"); + openapiFields.add("token_endpoint"); + openapiFields.add("jwks_uri"); + openapiFields.add("response_types_supported"); + openapiFields.add("grant_types_supported"); + openapiFields.add("token_endpoint_auth_methods_supported"); + openapiFields.add("registration_endpoint"); + openapiFields.add("scopes_supported"); + openapiFields.add("response_modes_supported"); + openapiFields.add("code_challenge_methods_supported"); + openapiFields.add("revocation_endpoint"); + openapiFields.add("revocation_endpoint_auth_methods_supported"); + openapiFields.add("device_authorization_endpoint"); + openapiFields.add("token_endpoint_auth_signing_alg_values_supported"); + openapiFields.add("subject_types_supported"); + openapiFields.add("ClientIdMetadataDocumentSupported"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("issuer"); + openapiRequiredFields.add("token_endpoint"); + openapiRequiredFields.add("jwks_uri"); + openapiRequiredFields.add("response_types_supported"); + openapiRequiredFields.add("grant_types_supported"); + } + + /** + * 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 OAuthAuthorizationServerMetadata + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthAuthorizationServerMetadata.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthAuthorizationServerMetadata is not found in the empty JSON string", OAuthAuthorizationServerMetadata.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OAuthAuthorizationServerMetadata.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("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("authorization_endpoint") != null && !jsonObj.get("authorization_endpoint").isJsonNull()) && !jsonObj.get("authorization_endpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `authorization_endpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorization_endpoint").toString())); + } + if (!jsonObj.get("token_endpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `token_endpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token_endpoint").toString())); + } + if (!jsonObj.get("jwks_uri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `jwks_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("jwks_uri").toString())); + } + // ensure the required json array is present + if (jsonObj.get("response_types_supported") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("response_types_supported").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `response_types_supported` to be an array in the JSON string but got `%s`", jsonObj.get("response_types_supported").toString())); + } + // ensure the required json array is present + if (jsonObj.get("grant_types_supported") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("grant_types_supported").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `grant_types_supported` to be an array in the JSON string but got `%s`", jsonObj.get("grant_types_supported").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("token_endpoint_auth_methods_supported") != null && !jsonObj.get("token_endpoint_auth_methods_supported").isJsonNull() && !jsonObj.get("token_endpoint_auth_methods_supported").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `token_endpoint_auth_methods_supported` to be an array in the JSON string but got `%s`", jsonObj.get("token_endpoint_auth_methods_supported").toString())); + } + if ((jsonObj.get("registration_endpoint") != null && !jsonObj.get("registration_endpoint").isJsonNull()) && !jsonObj.get("registration_endpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `registration_endpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("registration_endpoint").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("scopes_supported") != null && !jsonObj.get("scopes_supported").isJsonNull() && !jsonObj.get("scopes_supported").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `scopes_supported` to be an array in the JSON string but got `%s`", jsonObj.get("scopes_supported").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("response_modes_supported") != null && !jsonObj.get("response_modes_supported").isJsonNull() && !jsonObj.get("response_modes_supported").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `response_modes_supported` to be an array in the JSON string but got `%s`", jsonObj.get("response_modes_supported").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("code_challenge_methods_supported") != null && !jsonObj.get("code_challenge_methods_supported").isJsonNull() && !jsonObj.get("code_challenge_methods_supported").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `code_challenge_methods_supported` to be an array in the JSON string but got `%s`", jsonObj.get("code_challenge_methods_supported").toString())); + } + if ((jsonObj.get("revocation_endpoint") != null && !jsonObj.get("revocation_endpoint").isJsonNull()) && !jsonObj.get("revocation_endpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `revocation_endpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("revocation_endpoint").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("revocation_endpoint_auth_methods_supported") != null && !jsonObj.get("revocation_endpoint_auth_methods_supported").isJsonNull() && !jsonObj.get("revocation_endpoint_auth_methods_supported").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `revocation_endpoint_auth_methods_supported` to be an array in the JSON string but got `%s`", jsonObj.get("revocation_endpoint_auth_methods_supported").toString())); + } + if ((jsonObj.get("device_authorization_endpoint") != null && !jsonObj.get("device_authorization_endpoint").isJsonNull()) && !jsonObj.get("device_authorization_endpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `device_authorization_endpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("device_authorization_endpoint").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("token_endpoint_auth_signing_alg_values_supported") != null && !jsonObj.get("token_endpoint_auth_signing_alg_values_supported").isJsonNull() && !jsonObj.get("token_endpoint_auth_signing_alg_values_supported").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `token_endpoint_auth_signing_alg_values_supported` to be an array in the JSON string but got `%s`", jsonObj.get("token_endpoint_auth_signing_alg_values_supported").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("subject_types_supported") != null && !jsonObj.get("subject_types_supported").isJsonNull() && !jsonObj.get("subject_types_supported").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `subject_types_supported` to be an array in the JSON string but got `%s`", jsonObj.get("subject_types_supported").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthAuthorizationServerMetadata.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthAuthorizationServerMetadata' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthAuthorizationServerMetadata> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthAuthorizationServerMetadata.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthAuthorizationServerMetadata>() { + @Override + public void write(JsonWriter out, OAuthAuthorizationServerMetadata value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthAuthorizationServerMetadata read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthAuthorizationServerMetadata instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthAuthorizationServerMetadata given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthAuthorizationServerMetadata + * @throws IOException if the JSON string is invalid with respect to OAuthAuthorizationServerMetadata + */ + public static OAuthAuthorizationServerMetadata fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthAuthorizationServerMetadata.class); + } + + /** + * Convert an instance of OAuthAuthorizationServerMetadata to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientCreateCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientCreateCore.java new file mode 100644 index 0000000..89ba8ec --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientCreateCore.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuthClientCreateCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthClientCreateCore { + public static final String SERIALIZED_NAME_APP_NAME = "AppName"; + @SerializedName(SERIALIZED_NAME_APP_NAME) + @javax.annotation.Nonnull + private String appName; + + public OAuthClientCreateCore() { + } + + public OAuthClientCreateCore appName(@javax.annotation.Nonnull String appName) { + this.appName = appName; + return this; + } + + /** + * Get appName + * @return appName + */ + @javax.annotation.Nonnull + public String getAppName() { + return appName; + } + + public void setAppName(@javax.annotation.Nonnull String appName) { + this.appName = appName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthClientCreateCore instance itself + */ + public OAuthClientCreateCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthClientCreateCore oauthClientCreateCore = (OAuthClientCreateCore) o; + return Objects.equals(this.appName, oauthClientCreateCore.appName)&& + Objects.equals(this.additionalProperties, oauthClientCreateCore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(appName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthClientCreateCore {\n"); + sb.append(" appName: ").append(toIndentedString(appName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AppName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("AppName"); + } + + /** + * 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 OAuthClientCreateCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthClientCreateCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthClientCreateCore is not found in the empty JSON string", OAuthClientCreateCore.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OAuthClientCreateCore.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("AppName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AppName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AppName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthClientCreateCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthClientCreateCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthClientCreateCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthClientCreateCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthClientCreateCore>() { + @Override + public void write(JsonWriter out, OAuthClientCreateCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthClientCreateCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthClientCreateCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthClientCreateCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthClientCreateCore + * @throws IOException if the JSON string is invalid with respect to OAuthClientCreateCore + */ + public static OAuthClientCreateCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthClientCreateCore.class); + } + + /** + * Convert an instance of OAuthClientCreateCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientRequest.java new file mode 100644 index 0000000..c249165 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientRequest.java @@ -0,0 +1,1378 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.OAuthClientRequestBackChannelLogout; +import com.loginradius.sdk.internal.openapi.model.OAuthClientRequestConnections; +import com.loginradius.sdk.internal.openapi.model.OAuthClientRequestDeviceCodeConfig; +import com.loginradius.sdk.internal.openapi.model.OAuthClientRequestJwtTokenConfig; +import com.loginradius.sdk.internal.openapi.model.OAuthClientResponseRefreshTokenRotation; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuthClientRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthClientRequest { + public static final String SERIALIZED_NAME_ALLOWED_CORS_ORIGIN = "AllowedCorsOrigin"; + @SerializedName(SERIALIZED_NAME_ALLOWED_CORS_ORIGIN) + @javax.annotation.Nullable + private List<String> allowedCorsOrigin = new ArrayList<>(); + + /** + * Gets or Sets allowedScopes + */ + @JsonAdapter(AllowedScopesEnum.Adapter.class) + public enum AllowedScopesEnum { + EMAIL("email"), + + PHONE("phone"), + + PROFILE("profile"), + + ADDRESS("address"); + + private String value; + + AllowedScopesEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AllowedScopesEnum fromValue(String value) { + for (AllowedScopesEnum b : AllowedScopesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<AllowedScopesEnum> { + @Override + public void write(final JsonWriter jsonWriter, final AllowedScopesEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AllowedScopesEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AllowedScopesEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AllowedScopesEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ALLOWED_SCOPES = "AllowedScopes"; + @SerializedName(SERIALIZED_NAME_ALLOWED_SCOPES) + @javax.annotation.Nullable + private List<AllowedScopesEnum> allowedScopes = new ArrayList<>(); + + public static final String SERIALIZED_NAME_AUDIENCE_SCOPES = "AudienceScopes"; + @SerializedName(SERIALIZED_NAME_AUDIENCE_SCOPES) + @javax.annotation.Nullable + private Map<String, List<String>> audienceScopes = new HashMap<>(); + + public static final String SERIALIZED_NAME_BACK_CHANNEL_LOGOUT = "BackChannelLogout"; + @SerializedName(SERIALIZED_NAME_BACK_CHANNEL_LOGOUT) + @javax.annotation.Nullable + private OAuthClientRequestBackChannelLogout backChannelLogout; + + /** + * Whether the client can keep a secret confidential. `confidential` clients (server-side / M2M) authenticate with their secret; `public` clients (SPA / native) default to token endpoint auth method `none` and rely on PKCE. When omitted it is derived server-side from the resolved token endpoint auth method. + */ + @JsonAdapter(ClientTypeEnum.Adapter.class) + public enum ClientTypeEnum { + PUBLIC("public"), + + CONFIDENTIAL("confidential"); + + private String value; + + ClientTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ClientTypeEnum fromValue(String value) { + for (ClientTypeEnum b : ClientTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<ClientTypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final ClientTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ClientTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ClientTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ClientTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CLIENT_TYPE = "ClientType"; + @SerializedName(SERIALIZED_NAME_CLIENT_TYPE) + @javax.annotation.Nullable + private ClientTypeEnum clientType; + + public static final String SERIALIZED_NAME_CONNECTIONS = "Connections"; + @SerializedName(SERIALIZED_NAME_CONNECTIONS) + @javax.annotation.Nullable + private OAuthClientRequestConnections connections; + + public static final String SERIALIZED_NAME_DESCRIPTION = "Description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_DEVICE_CODE_CONFIG = "DeviceCodeConfig"; + @SerializedName(SERIALIZED_NAME_DEVICE_CODE_CONFIG) + @javax.annotation.Nullable + private OAuthClientRequestDeviceCodeConfig deviceCodeConfig; + + public static final String SERIALIZED_NAME_ENABLE_CORS_ORIGIN = "EnableCorsOrigin"; + @SerializedName(SERIALIZED_NAME_ENABLE_CORS_ORIGIN) + @javax.annotation.Nullable + private Boolean enableCorsOrigin; + + public static final String SERIALIZED_NAME_FORCE_RE_AUTHENTICATION = "ForceReAuthentication"; + @SerializedName(SERIALIZED_NAME_FORCE_RE_AUTHENTICATION) + @javax.annotation.Nullable + private Boolean forceReAuthentication; + + /** + * Gets or Sets grantTypes + */ + @JsonAdapter(GrantTypesEnum.Adapter.class) + public enum GrantTypesEnum { + AUTHORIZATION_CODE("authorization_code"), + + IMPLICIT("implicit"), + + PASSWORD("password"), + + CLIENT_CREDENTIALS("client_credentials"), + + REFRESH_TOKEN("refresh_token"), + + URN_IETF_PARAMS_OAUTH_GRANT_TYPE_DEVICE_CODE("urn:ietf:params:oauth:grant-type:device_code"), + + HTTP_LOGINRADIUS_COM_OAUTH_GRANT_TYPE_EXCHANGE_TOKEN("http://loginradius.com/oauth/grant-type/exchange_token"); + + private String value; + + GrantTypesEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static GrantTypesEnum fromValue(String value) { + for (GrantTypesEnum b : GrantTypesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<GrantTypesEnum> { + @Override + public void write(final JsonWriter jsonWriter, final GrantTypesEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public GrantTypesEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return GrantTypesEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + GrantTypesEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_GRANT_TYPES = "GrantTypes"; + @SerializedName(SERIALIZED_NAME_GRANT_TYPES) + @javax.annotation.Nullable + private List<GrantTypesEnum> grantTypes = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ID_TOKEN_AUDIENCES = "IdTokenAudiences"; + @SerializedName(SERIALIZED_NAME_ID_TOKEN_AUDIENCES) + @javax.annotation.Nullable + private List<String> idTokenAudiences = new ArrayList<>(); + + public static final String SERIALIZED_NAME_JWT_TOKEN_CONFIG = "JwtTokenConfig"; + @SerializedName(SERIALIZED_NAME_JWT_TOKEN_CONFIG) + @javax.annotation.Nullable + private OAuthClientRequestJwtTokenConfig jwtTokenConfig; + + public static final String SERIALIZED_NAME_LOGIN_URL = "LoginUrl"; + @SerializedName(SERIALIZED_NAME_LOGIN_URL) + @javax.annotation.Nullable + private String loginUrl; + + public static final String SERIALIZED_NAME_LOGIN_REDIRECT_URI = "LoginRedirectUri"; + @SerializedName(SERIALIZED_NAME_LOGIN_REDIRECT_URI) + @javax.annotation.Nullable + private List<String> loginRedirectUri = new ArrayList<>(); + + public static final String SERIALIZED_NAME_LOGOUT_REDIRECT_URI = "LogoutRedirectUri"; + @SerializedName(SERIALIZED_NAME_LOGOUT_REDIRECT_URI) + @javax.annotation.Nullable + private List<String> logoutRedirectUri = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ACCESS_TOKEN_MAPPING_TEMPLATE = "AccessTokenMappingTemplate"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN_MAPPING_TEMPLATE) + @javax.annotation.Nullable + private String accessTokenMappingTemplate; + + public static final String SERIALIZED_NAME_ID_TOKEN_MAPPING_TEMPLATE = "IdTokenMappingTemplate"; + @SerializedName(SERIALIZED_NAME_ID_TOKEN_MAPPING_TEMPLATE) + @javax.annotation.Nullable + private String idTokenMappingTemplate; + + public static final String SERIALIZED_NAME_MAPPING = "Mapping"; + @SerializedName(SERIALIZED_NAME_MAPPING) + @javax.annotation.Nullable + private Map<String, String> mapping = new HashMap<>(); + + public static final String SERIALIZED_NAME_METADATA = "Metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + @javax.annotation.Nullable + private Map<String, String> metadata = new HashMap<>(); + + public static final String SERIALIZED_NAME_REDIRECT_U_R_I_EXACT_MATCH = "RedirectURIExactMatch"; + @SerializedName(SERIALIZED_NAME_REDIRECT_U_R_I_EXACT_MATCH) + @javax.annotation.Nullable + private Boolean redirectURIExactMatch; + + public static final String SERIALIZED_NAME_REFRESH_TOKEN_ROTATION = "RefreshTokenRotation"; + @SerializedName(SERIALIZED_NAME_REFRESH_TOKEN_ROTATION) + @javax.annotation.Nullable + private OAuthClientResponseRefreshTokenRotation refreshTokenRotation; + + public static final String SERIALIZED_NAME_REFRESH_TOKEN_T_T_L = "RefreshTokenTTL"; + @SerializedName(SERIALIZED_NAME_REFRESH_TOKEN_T_T_L) + @javax.annotation.Nullable + private Integer refreshTokenTTL; + + public static final String SERIALIZED_NAME_SESSION_TOKEN_T_T_L = "SessionTokenTTL"; + @SerializedName(SERIALIZED_NAME_SESSION_TOKEN_T_T_L) + @javax.annotation.Nullable + private Integer sessionTokenTTL; + + public static final String SERIALIZED_NAME_SECRET = "Secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + @javax.annotation.Nullable + private String secret; + + public static final String SERIALIZED_NAME_SIGNED_USER_INFO = "SignedUserInfo"; + @SerializedName(SERIALIZED_NAME_SIGNED_USER_INFO) + @javax.annotation.Nullable + private Boolean signedUserInfo; + + /** + * Gets or Sets tokenAuthMethod + */ + @JsonAdapter(TokenAuthMethodEnum.Adapter.class) + public enum TokenAuthMethodEnum { + CLIENT_SECRET_BASIC("client_secret_basic"), + + CLIENT_SECRET_POST("client_secret_post"), + + CLIENT_SECRET_AUTO("client_secret_auto"), + + NONE("none"); + + private String value; + + TokenAuthMethodEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TokenAuthMethodEnum fromValue(String value) { + for (TokenAuthMethodEnum b : TokenAuthMethodEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<TokenAuthMethodEnum> { + @Override + public void write(final JsonWriter jsonWriter, final TokenAuthMethodEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TokenAuthMethodEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TokenAuthMethodEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TokenAuthMethodEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TOKEN_AUTH_METHOD = "TokenAuthMethod"; + @SerializedName(SERIALIZED_NAME_TOKEN_AUTH_METHOD) + @javax.annotation.Nullable + private TokenAuthMethodEnum tokenAuthMethod; + + public OAuthClientRequest() { + } + + public OAuthClientRequest allowedCorsOrigin(@javax.annotation.Nullable List<String> allowedCorsOrigin) { + this.allowedCorsOrigin = allowedCorsOrigin; + return this; + } + + public OAuthClientRequest addAllowedCorsOriginItem(String allowedCorsOriginItem) { + if (this.allowedCorsOrigin == null) { + this.allowedCorsOrigin = new ArrayList<>(); + } + this.allowedCorsOrigin.add(allowedCorsOriginItem); + return this; + } + + /** + * Get allowedCorsOrigin + * @return allowedCorsOrigin + */ + @javax.annotation.Nullable + public List<String> getAllowedCorsOrigin() { + return allowedCorsOrigin; + } + + public void setAllowedCorsOrigin(@javax.annotation.Nullable List<String> allowedCorsOrigin) { + this.allowedCorsOrigin = allowedCorsOrigin; + } + + + public OAuthClientRequest allowedScopes(@javax.annotation.Nullable List<AllowedScopesEnum> allowedScopes) { + this.allowedScopes = allowedScopes; + return this; + } + + public OAuthClientRequest addAllowedScopesItem(AllowedScopesEnum allowedScopesItem) { + if (this.allowedScopes == null) { + this.allowedScopes = new ArrayList<>(); + } + this.allowedScopes.add(allowedScopesItem); + return this; + } + + /** + * Get allowedScopes + * @return allowedScopes + */ + @javax.annotation.Nullable + public List<AllowedScopesEnum> getAllowedScopes() { + return allowedScopes; + } + + public void setAllowedScopes(@javax.annotation.Nullable List<AllowedScopesEnum> allowedScopes) { + this.allowedScopes = allowedScopes; + } + + + public OAuthClientRequest audienceScopes(@javax.annotation.Nullable Map<String, List<String>> audienceScopes) { + this.audienceScopes = audienceScopes; + return this; + } + + public OAuthClientRequest putAudienceScopesItem(String key, List<String> audienceScopesItem) { + if (this.audienceScopes == null) { + this.audienceScopes = new HashMap<>(); + } + this.audienceScopes.put(key, audienceScopesItem); + return this; + } + + /** + * Get audienceScopes + * @return audienceScopes + */ + @javax.annotation.Nullable + public Map<String, List<String>> getAudienceScopes() { + return audienceScopes; + } + + public void setAudienceScopes(@javax.annotation.Nullable Map<String, List<String>> audienceScopes) { + this.audienceScopes = audienceScopes; + } + + + public OAuthClientRequest backChannelLogout(@javax.annotation.Nullable OAuthClientRequestBackChannelLogout backChannelLogout) { + this.backChannelLogout = backChannelLogout; + return this; + } + + /** + * Get backChannelLogout + * @return backChannelLogout + */ + @javax.annotation.Nullable + public OAuthClientRequestBackChannelLogout getBackChannelLogout() { + return backChannelLogout; + } + + public void setBackChannelLogout(@javax.annotation.Nullable OAuthClientRequestBackChannelLogout backChannelLogout) { + this.backChannelLogout = backChannelLogout; + } + + + public OAuthClientRequest clientType(@javax.annotation.Nullable ClientTypeEnum clientType) { + this.clientType = clientType; + return this; + } + + /** + * Whether the client can keep a secret confidential. `confidential` clients (server-side / M2M) authenticate with their secret; `public` clients (SPA / native) default to token endpoint auth method `none` and rely on PKCE. When omitted it is derived server-side from the resolved token endpoint auth method. + * @return clientType + */ + @javax.annotation.Nullable + public ClientTypeEnum getClientType() { + return clientType; + } + + public void setClientType(@javax.annotation.Nullable ClientTypeEnum clientType) { + this.clientType = clientType; + } + + + public OAuthClientRequest connections(@javax.annotation.Nullable OAuthClientRequestConnections connections) { + this.connections = connections; + return this; + } + + /** + * Get connections + * @return connections + */ + @javax.annotation.Nullable + public OAuthClientRequestConnections getConnections() { + return connections; + } + + public void setConnections(@javax.annotation.Nullable OAuthClientRequestConnections connections) { + this.connections = connections; + } + + + public OAuthClientRequest description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Optional free-text description of the application, shown only in the admin console (never exposed to end users). + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public OAuthClientRequest deviceCodeConfig(@javax.annotation.Nullable OAuthClientRequestDeviceCodeConfig deviceCodeConfig) { + this.deviceCodeConfig = deviceCodeConfig; + return this; + } + + /** + * Get deviceCodeConfig + * @return deviceCodeConfig + */ + @javax.annotation.Nullable + public OAuthClientRequestDeviceCodeConfig getDeviceCodeConfig() { + return deviceCodeConfig; + } + + public void setDeviceCodeConfig(@javax.annotation.Nullable OAuthClientRequestDeviceCodeConfig deviceCodeConfig) { + this.deviceCodeConfig = deviceCodeConfig; + } + + + public OAuthClientRequest enableCorsOrigin(@javax.annotation.Nullable Boolean enableCorsOrigin) { + this.enableCorsOrigin = enableCorsOrigin; + return this; + } + + /** + * Get enableCorsOrigin + * @return enableCorsOrigin + */ + @javax.annotation.Nullable + public Boolean getEnableCorsOrigin() { + return enableCorsOrigin; + } + + public void setEnableCorsOrigin(@javax.annotation.Nullable Boolean enableCorsOrigin) { + this.enableCorsOrigin = enableCorsOrigin; + } + + + public OAuthClientRequest forceReAuthentication(@javax.annotation.Nullable Boolean forceReAuthentication) { + this.forceReAuthentication = forceReAuthentication; + return this; + } + + /** + * Get forceReAuthentication + * @return forceReAuthentication + */ + @javax.annotation.Nullable + public Boolean getForceReAuthentication() { + return forceReAuthentication; + } + + public void setForceReAuthentication(@javax.annotation.Nullable Boolean forceReAuthentication) { + this.forceReAuthentication = forceReAuthentication; + } + + + public OAuthClientRequest grantTypes(@javax.annotation.Nullable List<GrantTypesEnum> grantTypes) { + this.grantTypes = grantTypes; + return this; + } + + public OAuthClientRequest addGrantTypesItem(GrantTypesEnum grantTypesItem) { + if (this.grantTypes == null) { + this.grantTypes = new ArrayList<>(); + } + this.grantTypes.add(grantTypesItem); + return this; + } + + /** + * Get grantTypes + * @return grantTypes + */ + @javax.annotation.Nullable + public List<GrantTypesEnum> getGrantTypes() { + return grantTypes; + } + + public void setGrantTypes(@javax.annotation.Nullable List<GrantTypesEnum> grantTypes) { + this.grantTypes = grantTypes; + } + + + public OAuthClientRequest idTokenAudiences(@javax.annotation.Nullable List<String> idTokenAudiences) { + this.idTokenAudiences = idTokenAudiences; + return this; + } + + public OAuthClientRequest addIdTokenAudiencesItem(String idTokenAudiencesItem) { + if (this.idTokenAudiences == null) { + this.idTokenAudiences = new ArrayList<>(); + } + this.idTokenAudiences.add(idTokenAudiencesItem); + return this; + } + + /** + * Get idTokenAudiences + * @return idTokenAudiences + */ + @javax.annotation.Nullable + public List<String> getIdTokenAudiences() { + return idTokenAudiences; + } + + public void setIdTokenAudiences(@javax.annotation.Nullable List<String> idTokenAudiences) { + this.idTokenAudiences = idTokenAudiences; + } + + + public OAuthClientRequest jwtTokenConfig(@javax.annotation.Nullable OAuthClientRequestJwtTokenConfig jwtTokenConfig) { + this.jwtTokenConfig = jwtTokenConfig; + return this; + } + + /** + * Get jwtTokenConfig + * @return jwtTokenConfig + */ + @javax.annotation.Nullable + public OAuthClientRequestJwtTokenConfig getJwtTokenConfig() { + return jwtTokenConfig; + } + + public void setJwtTokenConfig(@javax.annotation.Nullable OAuthClientRequestJwtTokenConfig jwtTokenConfig) { + this.jwtTokenConfig = jwtTokenConfig; + } + + + public OAuthClientRequest loginUrl(@javax.annotation.Nullable String loginUrl) { + this.loginUrl = loginUrl; + return this; + } + + /** + * Get loginUrl + * @return loginUrl + */ + @javax.annotation.Nullable + public String getLoginUrl() { + return loginUrl; + } + + public void setLoginUrl(@javax.annotation.Nullable String loginUrl) { + this.loginUrl = loginUrl; + } + + + public OAuthClientRequest loginRedirectUri(@javax.annotation.Nullable List<String> loginRedirectUri) { + this.loginRedirectUri = loginRedirectUri; + return this; + } + + public OAuthClientRequest addLoginRedirectUriItem(String loginRedirectUriItem) { + if (this.loginRedirectUri == null) { + this.loginRedirectUri = new ArrayList<>(); + } + this.loginRedirectUri.add(loginRedirectUriItem); + return this; + } + + /** + * Get loginRedirectUri + * @return loginRedirectUri + */ + @javax.annotation.Nullable + public List<String> getLoginRedirectUri() { + return loginRedirectUri; + } + + public void setLoginRedirectUri(@javax.annotation.Nullable List<String> loginRedirectUri) { + this.loginRedirectUri = loginRedirectUri; + } + + + public OAuthClientRequest logoutRedirectUri(@javax.annotation.Nullable List<String> logoutRedirectUri) { + this.logoutRedirectUri = logoutRedirectUri; + return this; + } + + public OAuthClientRequest addLogoutRedirectUriItem(String logoutRedirectUriItem) { + if (this.logoutRedirectUri == null) { + this.logoutRedirectUri = new ArrayList<>(); + } + this.logoutRedirectUri.add(logoutRedirectUriItem); + return this; + } + + /** + * Get logoutRedirectUri + * @return logoutRedirectUri + */ + @javax.annotation.Nullable + public List<String> getLogoutRedirectUri() { + return logoutRedirectUri; + } + + public void setLogoutRedirectUri(@javax.annotation.Nullable List<String> logoutRedirectUri) { + this.logoutRedirectUri = logoutRedirectUri; + } + + + public OAuthClientRequest accessTokenMappingTemplate(@javax.annotation.Nullable String accessTokenMappingTemplate) { + this.accessTokenMappingTemplate = accessTokenMappingTemplate; + return this; + } + + /** + * Get accessTokenMappingTemplate + * @return accessTokenMappingTemplate + */ + @javax.annotation.Nullable + public String getAccessTokenMappingTemplate() { + return accessTokenMappingTemplate; + } + + public void setAccessTokenMappingTemplate(@javax.annotation.Nullable String accessTokenMappingTemplate) { + this.accessTokenMappingTemplate = accessTokenMappingTemplate; + } + + + public OAuthClientRequest idTokenMappingTemplate(@javax.annotation.Nullable String idTokenMappingTemplate) { + this.idTokenMappingTemplate = idTokenMappingTemplate; + return this; + } + + /** + * Get idTokenMappingTemplate + * @return idTokenMappingTemplate + */ + @javax.annotation.Nullable + public String getIdTokenMappingTemplate() { + return idTokenMappingTemplate; + } + + public void setIdTokenMappingTemplate(@javax.annotation.Nullable String idTokenMappingTemplate) { + this.idTokenMappingTemplate = idTokenMappingTemplate; + } + + + public OAuthClientRequest mapping(@javax.annotation.Nullable Map<String, String> mapping) { + this.mapping = mapping; + return this; + } + + public OAuthClientRequest putMappingItem(String key, String mappingItem) { + if (this.mapping == null) { + this.mapping = new HashMap<>(); + } + this.mapping.put(key, mappingItem); + return this; + } + + /** + * Get mapping + * @return mapping + */ + @javax.annotation.Nullable + public Map<String, String> getMapping() { + return mapping; + } + + public void setMapping(@javax.annotation.Nullable Map<String, String> mapping) { + this.mapping = mapping; + } + + + public OAuthClientRequest metadata(@javax.annotation.Nullable Map<String, String> metadata) { + this.metadata = metadata; + return this; + } + + public OAuthClientRequest putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Get metadata + * @return metadata + */ + @javax.annotation.Nullable + public Map<String, String> getMetadata() { + return metadata; + } + + public void setMetadata(@javax.annotation.Nullable Map<String, String> metadata) { + this.metadata = metadata; + } + + + public OAuthClientRequest redirectURIExactMatch(@javax.annotation.Nullable Boolean redirectURIExactMatch) { + this.redirectURIExactMatch = redirectURIExactMatch; + return this; + } + + /** + * Get redirectURIExactMatch + * @return redirectURIExactMatch + */ + @javax.annotation.Nullable + public Boolean getRedirectURIExactMatch() { + return redirectURIExactMatch; + } + + public void setRedirectURIExactMatch(@javax.annotation.Nullable Boolean redirectURIExactMatch) { + this.redirectURIExactMatch = redirectURIExactMatch; + } + + + public OAuthClientRequest refreshTokenRotation(@javax.annotation.Nullable OAuthClientResponseRefreshTokenRotation refreshTokenRotation) { + this.refreshTokenRotation = refreshTokenRotation; + return this; + } + + /** + * Get refreshTokenRotation + * @return refreshTokenRotation + */ + @javax.annotation.Nullable + public OAuthClientResponseRefreshTokenRotation getRefreshTokenRotation() { + return refreshTokenRotation; + } + + public void setRefreshTokenRotation(@javax.annotation.Nullable OAuthClientResponseRefreshTokenRotation refreshTokenRotation) { + this.refreshTokenRotation = refreshTokenRotation; + } + + + public OAuthClientRequest refreshTokenTTL(@javax.annotation.Nullable Integer refreshTokenTTL) { + this.refreshTokenTTL = refreshTokenTTL; + return this; + } + + /** + * Get refreshTokenTTL + * @return refreshTokenTTL + */ + @javax.annotation.Nullable + public Integer getRefreshTokenTTL() { + return refreshTokenTTL; + } + + public void setRefreshTokenTTL(@javax.annotation.Nullable Integer refreshTokenTTL) { + this.refreshTokenTTL = refreshTokenTTL; + } + + + public OAuthClientRequest sessionTokenTTL(@javax.annotation.Nullable Integer sessionTokenTTL) { + this.sessionTokenTTL = sessionTokenTTL; + return this; + } + + /** + * Get sessionTokenTTL + * @return sessionTokenTTL + */ + @javax.annotation.Nullable + public Integer getSessionTokenTTL() { + return sessionTokenTTL; + } + + public void setSessionTokenTTL(@javax.annotation.Nullable Integer sessionTokenTTL) { + this.sessionTokenTTL = sessionTokenTTL; + } + + + public OAuthClientRequest secret(@javax.annotation.Nullable String secret) { + this.secret = secret; + return this; + } + + /** + * Get secret + * @return secret + */ + @javax.annotation.Nullable + public String getSecret() { + return secret; + } + + public void setSecret(@javax.annotation.Nullable String secret) { + this.secret = secret; + } + + + public OAuthClientRequest signedUserInfo(@javax.annotation.Nullable Boolean signedUserInfo) { + this.signedUserInfo = signedUserInfo; + return this; + } + + /** + * Get signedUserInfo + * @return signedUserInfo + */ + @javax.annotation.Nullable + public Boolean getSignedUserInfo() { + return signedUserInfo; + } + + public void setSignedUserInfo(@javax.annotation.Nullable Boolean signedUserInfo) { + this.signedUserInfo = signedUserInfo; + } + + + public OAuthClientRequest tokenAuthMethod(@javax.annotation.Nullable TokenAuthMethodEnum tokenAuthMethod) { + this.tokenAuthMethod = tokenAuthMethod; + return this; + } + + /** + * Get tokenAuthMethod + * @return tokenAuthMethod + */ + @javax.annotation.Nullable + public TokenAuthMethodEnum getTokenAuthMethod() { + return tokenAuthMethod; + } + + public void setTokenAuthMethod(@javax.annotation.Nullable TokenAuthMethodEnum tokenAuthMethod) { + this.tokenAuthMethod = tokenAuthMethod; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthClientRequest instance itself + */ + public OAuthClientRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthClientRequest oauthClientRequest = (OAuthClientRequest) o; + return Objects.equals(this.allowedCorsOrigin, oauthClientRequest.allowedCorsOrigin) && + Objects.equals(this.allowedScopes, oauthClientRequest.allowedScopes) && + Objects.equals(this.audienceScopes, oauthClientRequest.audienceScopes) && + Objects.equals(this.backChannelLogout, oauthClientRequest.backChannelLogout) && + Objects.equals(this.clientType, oauthClientRequest.clientType) && + Objects.equals(this.connections, oauthClientRequest.connections) && + Objects.equals(this.description, oauthClientRequest.description) && + Objects.equals(this.deviceCodeConfig, oauthClientRequest.deviceCodeConfig) && + Objects.equals(this.enableCorsOrigin, oauthClientRequest.enableCorsOrigin) && + Objects.equals(this.forceReAuthentication, oauthClientRequest.forceReAuthentication) && + Objects.equals(this.grantTypes, oauthClientRequest.grantTypes) && + Objects.equals(this.idTokenAudiences, oauthClientRequest.idTokenAudiences) && + Objects.equals(this.jwtTokenConfig, oauthClientRequest.jwtTokenConfig) && + Objects.equals(this.loginUrl, oauthClientRequest.loginUrl) && + Objects.equals(this.loginRedirectUri, oauthClientRequest.loginRedirectUri) && + Objects.equals(this.logoutRedirectUri, oauthClientRequest.logoutRedirectUri) && + Objects.equals(this.accessTokenMappingTemplate, oauthClientRequest.accessTokenMappingTemplate) && + Objects.equals(this.idTokenMappingTemplate, oauthClientRequest.idTokenMappingTemplate) && + Objects.equals(this.mapping, oauthClientRequest.mapping) && + Objects.equals(this.metadata, oauthClientRequest.metadata) && + Objects.equals(this.redirectURIExactMatch, oauthClientRequest.redirectURIExactMatch) && + Objects.equals(this.refreshTokenRotation, oauthClientRequest.refreshTokenRotation) && + Objects.equals(this.refreshTokenTTL, oauthClientRequest.refreshTokenTTL) && + Objects.equals(this.sessionTokenTTL, oauthClientRequest.sessionTokenTTL) && + Objects.equals(this.secret, oauthClientRequest.secret) && + Objects.equals(this.signedUserInfo, oauthClientRequest.signedUserInfo) && + Objects.equals(this.tokenAuthMethod, oauthClientRequest.tokenAuthMethod)&& + Objects.equals(this.additionalProperties, oauthClientRequest.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(allowedCorsOrigin, allowedScopes, audienceScopes, backChannelLogout, clientType, connections, description, deviceCodeConfig, enableCorsOrigin, forceReAuthentication, grantTypes, idTokenAudiences, jwtTokenConfig, loginUrl, loginRedirectUri, logoutRedirectUri, accessTokenMappingTemplate, idTokenMappingTemplate, mapping, metadata, redirectURIExactMatch, refreshTokenRotation, refreshTokenTTL, sessionTokenTTL, secret, signedUserInfo, tokenAuthMethod, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthClientRequest {\n"); + sb.append(" allowedCorsOrigin: ").append(toIndentedString(allowedCorsOrigin)).append("\n"); + sb.append(" allowedScopes: ").append(toIndentedString(allowedScopes)).append("\n"); + sb.append(" audienceScopes: ").append(toIndentedString(audienceScopes)).append("\n"); + sb.append(" backChannelLogout: ").append(toIndentedString(backChannelLogout)).append("\n"); + sb.append(" clientType: ").append(toIndentedString(clientType)).append("\n"); + sb.append(" connections: ").append(toIndentedString(connections)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" deviceCodeConfig: ").append(toIndentedString(deviceCodeConfig)).append("\n"); + sb.append(" enableCorsOrigin: ").append(toIndentedString(enableCorsOrigin)).append("\n"); + sb.append(" forceReAuthentication: ").append(toIndentedString(forceReAuthentication)).append("\n"); + sb.append(" grantTypes: ").append(toIndentedString(grantTypes)).append("\n"); + sb.append(" idTokenAudiences: ").append(toIndentedString(idTokenAudiences)).append("\n"); + sb.append(" jwtTokenConfig: ").append(toIndentedString(jwtTokenConfig)).append("\n"); + sb.append(" loginUrl: ").append(toIndentedString(loginUrl)).append("\n"); + sb.append(" loginRedirectUri: ").append(toIndentedString(loginRedirectUri)).append("\n"); + sb.append(" logoutRedirectUri: ").append(toIndentedString(logoutRedirectUri)).append("\n"); + sb.append(" accessTokenMappingTemplate: ").append(toIndentedString(accessTokenMappingTemplate)).append("\n"); + sb.append(" idTokenMappingTemplate: ").append(toIndentedString(idTokenMappingTemplate)).append("\n"); + sb.append(" mapping: ").append(toIndentedString(mapping)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" redirectURIExactMatch: ").append(toIndentedString(redirectURIExactMatch)).append("\n"); + sb.append(" refreshTokenRotation: ").append(toIndentedString(refreshTokenRotation)).append("\n"); + sb.append(" refreshTokenTTL: ").append(toIndentedString(refreshTokenTTL)).append("\n"); + sb.append(" sessionTokenTTL: ").append(toIndentedString(sessionTokenTTL)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" signedUserInfo: ").append(toIndentedString(signedUserInfo)).append("\n"); + sb.append(" tokenAuthMethod: ").append(toIndentedString(tokenAuthMethod)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AllowedCorsOrigin"); + openapiFields.add("AllowedScopes"); + openapiFields.add("AudienceScopes"); + openapiFields.add("BackChannelLogout"); + openapiFields.add("ClientType"); + openapiFields.add("Connections"); + openapiFields.add("Description"); + openapiFields.add("DeviceCodeConfig"); + openapiFields.add("EnableCorsOrigin"); + openapiFields.add("ForceReAuthentication"); + openapiFields.add("GrantTypes"); + openapiFields.add("IdTokenAudiences"); + openapiFields.add("JwtTokenConfig"); + openapiFields.add("LoginUrl"); + openapiFields.add("LoginRedirectUri"); + openapiFields.add("LogoutRedirectUri"); + openapiFields.add("AccessTokenMappingTemplate"); + openapiFields.add("IdTokenMappingTemplate"); + openapiFields.add("Mapping"); + openapiFields.add("Metadata"); + openapiFields.add("RedirectURIExactMatch"); + openapiFields.add("RefreshTokenRotation"); + openapiFields.add("RefreshTokenTTL"); + openapiFields.add("SessionTokenTTL"); + openapiFields.add("Secret"); + openapiFields.add("SignedUserInfo"); + openapiFields.add("TokenAuthMethod"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OAuthClientRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthClientRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthClientRequest is not found in the empty JSON string", OAuthClientRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("AllowedCorsOrigin") != null && !jsonObj.get("AllowedCorsOrigin").isJsonNull() && !jsonObj.get("AllowedCorsOrigin").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `AllowedCorsOrigin` to be an array in the JSON string but got `%s`", jsonObj.get("AllowedCorsOrigin").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("AllowedScopes") != null && !jsonObj.get("AllowedScopes").isJsonNull() && !jsonObj.get("AllowedScopes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `AllowedScopes` to be an array in the JSON string but got `%s`", jsonObj.get("AllowedScopes").toString())); + } + // validate the optional field `BackChannelLogout` + if (jsonObj.get("BackChannelLogout") != null && !jsonObj.get("BackChannelLogout").isJsonNull()) { + OAuthClientRequestBackChannelLogout.validateJsonElement(jsonObj.get("BackChannelLogout")); + } + if ((jsonObj.get("ClientType") != null && !jsonObj.get("ClientType").isJsonNull()) && !jsonObj.get("ClientType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ClientType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ClientType").toString())); + } + // validate the optional field `ClientType` + if (jsonObj.get("ClientType") != null && !jsonObj.get("ClientType").isJsonNull()) { + ClientTypeEnum.validateJsonElement(jsonObj.get("ClientType")); + } + // validate the optional field `Connections` + if (jsonObj.get("Connections") != null && !jsonObj.get("Connections").isJsonNull()) { + OAuthClientRequestConnections.validateJsonElement(jsonObj.get("Connections")); + } + if ((jsonObj.get("Description") != null && !jsonObj.get("Description").isJsonNull()) && !jsonObj.get("Description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Description").toString())); + } + // validate the optional field `DeviceCodeConfig` + if (jsonObj.get("DeviceCodeConfig") != null && !jsonObj.get("DeviceCodeConfig").isJsonNull()) { + OAuthClientRequestDeviceCodeConfig.validateJsonElement(jsonObj.get("DeviceCodeConfig")); + } + // ensure the optional json data is an array if present + if (jsonObj.get("GrantTypes") != null && !jsonObj.get("GrantTypes").isJsonNull() && !jsonObj.get("GrantTypes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `GrantTypes` to be an array in the JSON string but got `%s`", jsonObj.get("GrantTypes").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("IdTokenAudiences") != null && !jsonObj.get("IdTokenAudiences").isJsonNull() && !jsonObj.get("IdTokenAudiences").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `IdTokenAudiences` to be an array in the JSON string but got `%s`", jsonObj.get("IdTokenAudiences").toString())); + } + // validate the optional field `JwtTokenConfig` + if (jsonObj.get("JwtTokenConfig") != null && !jsonObj.get("JwtTokenConfig").isJsonNull()) { + OAuthClientRequestJwtTokenConfig.validateJsonElement(jsonObj.get("JwtTokenConfig")); + } + if ((jsonObj.get("LoginUrl") != null && !jsonObj.get("LoginUrl").isJsonNull()) && !jsonObj.get("LoginUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LoginUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LoginUrl").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("LoginRedirectUri") != null && !jsonObj.get("LoginRedirectUri").isJsonNull() && !jsonObj.get("LoginRedirectUri").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `LoginRedirectUri` to be an array in the JSON string but got `%s`", jsonObj.get("LoginRedirectUri").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("LogoutRedirectUri") != null && !jsonObj.get("LogoutRedirectUri").isJsonNull() && !jsonObj.get("LogoutRedirectUri").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `LogoutRedirectUri` to be an array in the JSON string but got `%s`", jsonObj.get("LogoutRedirectUri").toString())); + } + if ((jsonObj.get("AccessTokenMappingTemplate") != null && !jsonObj.get("AccessTokenMappingTemplate").isJsonNull()) && !jsonObj.get("AccessTokenMappingTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccessTokenMappingTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccessTokenMappingTemplate").toString())); + } + if ((jsonObj.get("IdTokenMappingTemplate") != null && !jsonObj.get("IdTokenMappingTemplate").isJsonNull()) && !jsonObj.get("IdTokenMappingTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IdTokenMappingTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IdTokenMappingTemplate").toString())); + } + // validate the optional field `RefreshTokenRotation` + if (jsonObj.get("RefreshTokenRotation") != null && !jsonObj.get("RefreshTokenRotation").isJsonNull()) { + OAuthClientResponseRefreshTokenRotation.validateJsonElement(jsonObj.get("RefreshTokenRotation")); + } + if ((jsonObj.get("Secret") != null && !jsonObj.get("Secret").isJsonNull()) && !jsonObj.get("Secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Secret").toString())); + } + if ((jsonObj.get("TokenAuthMethod") != null && !jsonObj.get("TokenAuthMethod").isJsonNull()) && !jsonObj.get("TokenAuthMethod").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TokenAuthMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TokenAuthMethod").toString())); + } + // validate the optional field `TokenAuthMethod` + if (jsonObj.get("TokenAuthMethod") != null && !jsonObj.get("TokenAuthMethod").isJsonNull()) { + TokenAuthMethodEnum.validateJsonElement(jsonObj.get("TokenAuthMethod")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthClientRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthClientRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthClientRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthClientRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthClientRequest>() { + @Override + public void write(JsonWriter out, OAuthClientRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthClientRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthClientRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthClientRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthClientRequest + * @throws IOException if the JSON string is invalid with respect to OAuthClientRequest + */ + public static OAuthClientRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthClientRequest.class); + } + + /** + * Convert an instance of OAuthClientRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientRequestBackChannelLogout.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientRequestBackChannelLogout.java new file mode 100644 index 0000000..a795043 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientRequestBackChannelLogout.java @@ -0,0 +1,352 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuthClientRequestBackChannelLogout + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthClientRequestBackChannelLogout { + public static final String SERIALIZED_NAME_IS_ENABLED = "IsEnabled"; + @SerializedName(SERIALIZED_NAME_IS_ENABLED) + @javax.annotation.Nullable + private Boolean isEnabled; + + public static final String SERIALIZED_NAME_LOGOUT_TOKEN_T_T_L = "LogoutTokenTTL"; + @SerializedName(SERIALIZED_NAME_LOGOUT_TOKEN_T_T_L) + @javax.annotation.Nullable + private Integer logoutTokenTTL; + + public static final String SERIALIZED_NAME_LOGOUT_U_R_IS = "LogoutURIs"; + @SerializedName(SERIALIZED_NAME_LOGOUT_U_R_IS) + @javax.annotation.Nullable + private List<String> logoutURIs = new ArrayList<>(); + + public OAuthClientRequestBackChannelLogout() { + } + + public OAuthClientRequestBackChannelLogout isEnabled(@javax.annotation.Nullable Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Get isEnabled + * @return isEnabled + */ + @javax.annotation.Nullable + public Boolean getIsEnabled() { + return isEnabled; + } + + public void setIsEnabled(@javax.annotation.Nullable Boolean isEnabled) { + this.isEnabled = isEnabled; + } + + + public OAuthClientRequestBackChannelLogout logoutTokenTTL(@javax.annotation.Nullable Integer logoutTokenTTL) { + this.logoutTokenTTL = logoutTokenTTL; + return this; + } + + /** + * Get logoutTokenTTL + * @return logoutTokenTTL + */ + @javax.annotation.Nullable + public Integer getLogoutTokenTTL() { + return logoutTokenTTL; + } + + public void setLogoutTokenTTL(@javax.annotation.Nullable Integer logoutTokenTTL) { + this.logoutTokenTTL = logoutTokenTTL; + } + + + public OAuthClientRequestBackChannelLogout logoutURIs(@javax.annotation.Nullable List<String> logoutURIs) { + this.logoutURIs = logoutURIs; + return this; + } + + public OAuthClientRequestBackChannelLogout addLogoutURIsItem(String logoutURIsItem) { + if (this.logoutURIs == null) { + this.logoutURIs = new ArrayList<>(); + } + this.logoutURIs.add(logoutURIsItem); + return this; + } + + /** + * Get logoutURIs + * @return logoutURIs + */ + @javax.annotation.Nullable + public List<String> getLogoutURIs() { + return logoutURIs; + } + + public void setLogoutURIs(@javax.annotation.Nullable List<String> logoutURIs) { + this.logoutURIs = logoutURIs; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthClientRequestBackChannelLogout instance itself + */ + public OAuthClientRequestBackChannelLogout putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthClientRequestBackChannelLogout oauthClientRequestBackChannelLogout = (OAuthClientRequestBackChannelLogout) o; + return Objects.equals(this.isEnabled, oauthClientRequestBackChannelLogout.isEnabled) && + Objects.equals(this.logoutTokenTTL, oauthClientRequestBackChannelLogout.logoutTokenTTL) && + Objects.equals(this.logoutURIs, oauthClientRequestBackChannelLogout.logoutURIs)&& + Objects.equals(this.additionalProperties, oauthClientRequestBackChannelLogout.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isEnabled, logoutTokenTTL, logoutURIs, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthClientRequestBackChannelLogout {\n"); + sb.append(" isEnabled: ").append(toIndentedString(isEnabled)).append("\n"); + sb.append(" logoutTokenTTL: ").append(toIndentedString(logoutTokenTTL)).append("\n"); + sb.append(" logoutURIs: ").append(toIndentedString(logoutURIs)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsEnabled"); + openapiFields.add("LogoutTokenTTL"); + openapiFields.add("LogoutURIs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OAuthClientRequestBackChannelLogout + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthClientRequestBackChannelLogout.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthClientRequestBackChannelLogout is not found in the empty JSON string", OAuthClientRequestBackChannelLogout.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("LogoutURIs") != null && !jsonObj.get("LogoutURIs").isJsonNull() && !jsonObj.get("LogoutURIs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `LogoutURIs` to be an array in the JSON string but got `%s`", jsonObj.get("LogoutURIs").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthClientRequestBackChannelLogout.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthClientRequestBackChannelLogout' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthClientRequestBackChannelLogout> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthClientRequestBackChannelLogout.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthClientRequestBackChannelLogout>() { + @Override + public void write(JsonWriter out, OAuthClientRequestBackChannelLogout value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthClientRequestBackChannelLogout read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthClientRequestBackChannelLogout instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthClientRequestBackChannelLogout given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthClientRequestBackChannelLogout + * @throws IOException if the JSON string is invalid with respect to OAuthClientRequestBackChannelLogout + */ + public static OAuthClientRequestBackChannelLogout fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthClientRequestBackChannelLogout.class); + } + + /** + * Convert an instance of OAuthClientRequestBackChannelLogout to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientRequestConnections.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientRequestConnections.java new file mode 100644 index 0000000..32b8eb3 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientRequestConnections.java @@ -0,0 +1,494 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.OAuthClientRequestConnectionsCustomIdpInner; +import com.loginradius.sdk.internal.openapi.model.OAuthIntegrationBaseModelConnectionsPasswordLessLogin; +import com.loginradius.sdk.internal.openapi.model.OAuthIntegrationBaseModelConnectionsSocialLoginsInner; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuthClientRequestConnections + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthClientRequestConnections { + public static final String SERIALIZED_NAME_ENABLED = "Enabled"; + @SerializedName(SERIALIZED_NAME_ENABLED) + @javax.annotation.Nullable + private Boolean enabled; + + public static final String SERIALIZED_NAME_PASSWORDLESS_LOGIN = "PasswordlessLogin"; + @SerializedName(SERIALIZED_NAME_PASSWORDLESS_LOGIN) + @javax.annotation.Nullable + private OAuthIntegrationBaseModelConnectionsPasswordLessLogin passwordlessLogin; + + public static final String SERIALIZED_NAME_TRADITIONAL_LOGIN = "TraditionalLogin"; + @SerializedName(SERIALIZED_NAME_TRADITIONAL_LOGIN) + @javax.annotation.Nullable + private Boolean traditionalLogin; + + public static final String SERIALIZED_NAME_SOCIAL_LOGINS = "SocialLogins"; + @SerializedName(SERIALIZED_NAME_SOCIAL_LOGINS) + @javax.annotation.Nullable + private List<OAuthIntegrationBaseModelConnectionsSocialLoginsInner> socialLogins = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CUSTOM_IDP = "CustomIdp"; + @SerializedName(SERIALIZED_NAME_CUSTOM_IDP) + @javax.annotation.Nullable + private List<OAuthClientRequestConnectionsCustomIdpInner> customIdp = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ENTERPRISE = "Enterprise"; + @SerializedName(SERIALIZED_NAME_ENTERPRISE) + @javax.annotation.Nullable + private List<OAuthClientRequestConnectionsCustomIdpInner> enterprise = new ArrayList<>(); + + public OAuthClientRequestConnections() { + } + + public OAuthClientRequestConnections enabled(@javax.annotation.Nullable Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get enabled + * @return enabled + */ + @javax.annotation.Nullable + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(@javax.annotation.Nullable Boolean enabled) { + this.enabled = enabled; + } + + + public OAuthClientRequestConnections passwordlessLogin(@javax.annotation.Nullable OAuthIntegrationBaseModelConnectionsPasswordLessLogin passwordlessLogin) { + this.passwordlessLogin = passwordlessLogin; + return this; + } + + /** + * Get passwordlessLogin + * @return passwordlessLogin + */ + @javax.annotation.Nullable + public OAuthIntegrationBaseModelConnectionsPasswordLessLogin getPasswordlessLogin() { + return passwordlessLogin; + } + + public void setPasswordlessLogin(@javax.annotation.Nullable OAuthIntegrationBaseModelConnectionsPasswordLessLogin passwordlessLogin) { + this.passwordlessLogin = passwordlessLogin; + } + + + public OAuthClientRequestConnections traditionalLogin(@javax.annotation.Nullable Boolean traditionalLogin) { + this.traditionalLogin = traditionalLogin; + return this; + } + + /** + * Get traditionalLogin + * @return traditionalLogin + */ + @javax.annotation.Nullable + public Boolean getTraditionalLogin() { + return traditionalLogin; + } + + public void setTraditionalLogin(@javax.annotation.Nullable Boolean traditionalLogin) { + this.traditionalLogin = traditionalLogin; + } + + + public OAuthClientRequestConnections socialLogins(@javax.annotation.Nullable List<OAuthIntegrationBaseModelConnectionsSocialLoginsInner> socialLogins) { + this.socialLogins = socialLogins; + return this; + } + + public OAuthClientRequestConnections addSocialLoginsItem(OAuthIntegrationBaseModelConnectionsSocialLoginsInner socialLoginsItem) { + if (this.socialLogins == null) { + this.socialLogins = new ArrayList<>(); + } + this.socialLogins.add(socialLoginsItem); + return this; + } + + /** + * Get socialLogins + * @return socialLogins + */ + @javax.annotation.Nullable + public List<OAuthIntegrationBaseModelConnectionsSocialLoginsInner> getSocialLogins() { + return socialLogins; + } + + public void setSocialLogins(@javax.annotation.Nullable List<OAuthIntegrationBaseModelConnectionsSocialLoginsInner> socialLogins) { + this.socialLogins = socialLogins; + } + + + public OAuthClientRequestConnections customIdp(@javax.annotation.Nullable List<OAuthClientRequestConnectionsCustomIdpInner> customIdp) { + this.customIdp = customIdp; + return this; + } + + public OAuthClientRequestConnections addCustomIdpItem(OAuthClientRequestConnectionsCustomIdpInner customIdpItem) { + if (this.customIdp == null) { + this.customIdp = new ArrayList<>(); + } + this.customIdp.add(customIdpItem); + return this; + } + + /** + * Get customIdp + * @return customIdp + */ + @javax.annotation.Nullable + public List<OAuthClientRequestConnectionsCustomIdpInner> getCustomIdp() { + return customIdp; + } + + public void setCustomIdp(@javax.annotation.Nullable List<OAuthClientRequestConnectionsCustomIdpInner> customIdp) { + this.customIdp = customIdp; + } + + + public OAuthClientRequestConnections enterprise(@javax.annotation.Nullable List<OAuthClientRequestConnectionsCustomIdpInner> enterprise) { + this.enterprise = enterprise; + return this; + } + + public OAuthClientRequestConnections addEnterpriseItem(OAuthClientRequestConnectionsCustomIdpInner enterpriseItem) { + if (this.enterprise == null) { + this.enterprise = new ArrayList<>(); + } + this.enterprise.add(enterpriseItem); + return this; + } + + /** + * Get enterprise + * @return enterprise + */ + @javax.annotation.Nullable + public List<OAuthClientRequestConnectionsCustomIdpInner> getEnterprise() { + return enterprise; + } + + public void setEnterprise(@javax.annotation.Nullable List<OAuthClientRequestConnectionsCustomIdpInner> enterprise) { + this.enterprise = enterprise; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthClientRequestConnections instance itself + */ + public OAuthClientRequestConnections putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthClientRequestConnections oauthClientRequestConnections = (OAuthClientRequestConnections) o; + return Objects.equals(this.enabled, oauthClientRequestConnections.enabled) && + Objects.equals(this.passwordlessLogin, oauthClientRequestConnections.passwordlessLogin) && + Objects.equals(this.traditionalLogin, oauthClientRequestConnections.traditionalLogin) && + Objects.equals(this.socialLogins, oauthClientRequestConnections.socialLogins) && + Objects.equals(this.customIdp, oauthClientRequestConnections.customIdp) && + Objects.equals(this.enterprise, oauthClientRequestConnections.enterprise)&& + Objects.equals(this.additionalProperties, oauthClientRequestConnections.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(enabled, passwordlessLogin, traditionalLogin, socialLogins, customIdp, enterprise, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthClientRequestConnections {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" passwordlessLogin: ").append(toIndentedString(passwordlessLogin)).append("\n"); + sb.append(" traditionalLogin: ").append(toIndentedString(traditionalLogin)).append("\n"); + sb.append(" socialLogins: ").append(toIndentedString(socialLogins)).append("\n"); + sb.append(" customIdp: ").append(toIndentedString(customIdp)).append("\n"); + sb.append(" enterprise: ").append(toIndentedString(enterprise)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Enabled"); + openapiFields.add("PasswordlessLogin"); + openapiFields.add("TraditionalLogin"); + openapiFields.add("SocialLogins"); + openapiFields.add("CustomIdp"); + openapiFields.add("Enterprise"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OAuthClientRequestConnections + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthClientRequestConnections.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthClientRequestConnections is not found in the empty JSON string", OAuthClientRequestConnections.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `PasswordlessLogin` + if (jsonObj.get("PasswordlessLogin") != null && !jsonObj.get("PasswordlessLogin").isJsonNull()) { + OAuthIntegrationBaseModelConnectionsPasswordLessLogin.validateJsonElement(jsonObj.get("PasswordlessLogin")); + } + if (jsonObj.get("SocialLogins") != null && !jsonObj.get("SocialLogins").isJsonNull()) { + JsonArray jsonArraysocialLogins = jsonObj.getAsJsonArray("SocialLogins"); + if (jsonArraysocialLogins != null) { + // ensure the json data is an array + if (!jsonObj.get("SocialLogins").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `SocialLogins` to be an array in the JSON string but got `%s`", jsonObj.get("SocialLogins").toString())); + } + + // validate the optional field `SocialLogins` (array) + for (int i = 0; i < jsonArraysocialLogins.size(); i++) { + OAuthIntegrationBaseModelConnectionsSocialLoginsInner.validateJsonElement(jsonArraysocialLogins.get(i)); + }; + } + } + if (jsonObj.get("CustomIdp") != null && !jsonObj.get("CustomIdp").isJsonNull()) { + JsonArray jsonArraycustomIdp = jsonObj.getAsJsonArray("CustomIdp"); + if (jsonArraycustomIdp != null) { + // ensure the json data is an array + if (!jsonObj.get("CustomIdp").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `CustomIdp` to be an array in the JSON string but got `%s`", jsonObj.get("CustomIdp").toString())); + } + + // validate the optional field `CustomIdp` (array) + for (int i = 0; i < jsonArraycustomIdp.size(); i++) { + OAuthClientRequestConnectionsCustomIdpInner.validateJsonElement(jsonArraycustomIdp.get(i)); + }; + } + } + if (jsonObj.get("Enterprise") != null && !jsonObj.get("Enterprise").isJsonNull()) { + JsonArray jsonArrayenterprise = jsonObj.getAsJsonArray("Enterprise"); + if (jsonArrayenterprise != null) { + // ensure the json data is an array + if (!jsonObj.get("Enterprise").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Enterprise` to be an array in the JSON string but got `%s`", jsonObj.get("Enterprise").toString())); + } + + // validate the optional field `Enterprise` (array) + for (int i = 0; i < jsonArrayenterprise.size(); i++) { + OAuthClientRequestConnectionsCustomIdpInner.validateJsonElement(jsonArrayenterprise.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthClientRequestConnections.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthClientRequestConnections' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthClientRequestConnections> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthClientRequestConnections.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthClientRequestConnections>() { + @Override + public void write(JsonWriter out, OAuthClientRequestConnections value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthClientRequestConnections read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthClientRequestConnections instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthClientRequestConnections given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthClientRequestConnections + * @throws IOException if the JSON string is invalid with respect to OAuthClientRequestConnections + */ + public static OAuthClientRequestConnections fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthClientRequestConnections.class); + } + + /** + * Convert an instance of OAuthClientRequestConnections to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientRequestConnectionsCustomIdpInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientRequestConnectionsCustomIdpInner.java new file mode 100644 index 0000000..3b2c312 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientRequestConnectionsCustomIdpInner.java @@ -0,0 +1,314 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuthClientRequestConnectionsCustomIdpInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthClientRequestConnectionsCustomIdpInner { + public static final String SERIALIZED_NAME_IS_ENABLED = "IsEnabled"; + @SerializedName(SERIALIZED_NAME_IS_ENABLED) + @javax.annotation.Nullable + private Boolean isEnabled; + + public static final String SERIALIZED_NAME_PROVIDER_NAME = "ProviderName"; + @SerializedName(SERIALIZED_NAME_PROVIDER_NAME) + @javax.annotation.Nullable + private String providerName; + + public OAuthClientRequestConnectionsCustomIdpInner() { + } + + public OAuthClientRequestConnectionsCustomIdpInner isEnabled(@javax.annotation.Nullable Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Get isEnabled + * @return isEnabled + */ + @javax.annotation.Nullable + public Boolean getIsEnabled() { + return isEnabled; + } + + public void setIsEnabled(@javax.annotation.Nullable Boolean isEnabled) { + this.isEnabled = isEnabled; + } + + + public OAuthClientRequestConnectionsCustomIdpInner providerName(@javax.annotation.Nullable String providerName) { + this.providerName = providerName; + return this; + } + + /** + * Get providerName + * @return providerName + */ + @javax.annotation.Nullable + public String getProviderName() { + return providerName; + } + + public void setProviderName(@javax.annotation.Nullable String providerName) { + this.providerName = providerName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthClientRequestConnectionsCustomIdpInner instance itself + */ + public OAuthClientRequestConnectionsCustomIdpInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthClientRequestConnectionsCustomIdpInner oauthClientRequestConnectionsCustomIdpInner = (OAuthClientRequestConnectionsCustomIdpInner) o; + return Objects.equals(this.isEnabled, oauthClientRequestConnectionsCustomIdpInner.isEnabled) && + Objects.equals(this.providerName, oauthClientRequestConnectionsCustomIdpInner.providerName)&& + Objects.equals(this.additionalProperties, oauthClientRequestConnectionsCustomIdpInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isEnabled, providerName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthClientRequestConnectionsCustomIdpInner {\n"); + sb.append(" isEnabled: ").append(toIndentedString(isEnabled)).append("\n"); + sb.append(" providerName: ").append(toIndentedString(providerName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsEnabled"); + openapiFields.add("ProviderName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OAuthClientRequestConnectionsCustomIdpInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthClientRequestConnectionsCustomIdpInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthClientRequestConnectionsCustomIdpInner is not found in the empty JSON string", OAuthClientRequestConnectionsCustomIdpInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ProviderName") != null && !jsonObj.get("ProviderName").isJsonNull()) && !jsonObj.get("ProviderName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProviderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProviderName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthClientRequestConnectionsCustomIdpInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthClientRequestConnectionsCustomIdpInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthClientRequestConnectionsCustomIdpInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthClientRequestConnectionsCustomIdpInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthClientRequestConnectionsCustomIdpInner>() { + @Override + public void write(JsonWriter out, OAuthClientRequestConnectionsCustomIdpInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthClientRequestConnectionsCustomIdpInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthClientRequestConnectionsCustomIdpInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthClientRequestConnectionsCustomIdpInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthClientRequestConnectionsCustomIdpInner + * @throws IOException if the JSON string is invalid with respect to OAuthClientRequestConnectionsCustomIdpInner + */ + public static OAuthClientRequestConnectionsCustomIdpInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthClientRequestConnectionsCustomIdpInner.class); + } + + /** + * Convert an instance of OAuthClientRequestConnectionsCustomIdpInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientRequestDeviceCodeConfig.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientRequestDeviceCodeConfig.java new file mode 100644 index 0000000..aa18de4 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientRequestDeviceCodeConfig.java @@ -0,0 +1,491 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuthClientRequestDeviceCodeConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthClientRequestDeviceCodeConfig { + public static final String SERIALIZED_NAME_AFTER_VERIFICATION_URL = "AfterVerificationUrl"; + @SerializedName(SERIALIZED_NAME_AFTER_VERIFICATION_URL) + @javax.annotation.Nullable + private String afterVerificationUrl; + + public static final String SERIALIZED_NAME_DEVICE_CODE_EXPIRE = "DeviceCodeExpire"; + @SerializedName(SERIALIZED_NAME_DEVICE_CODE_EXPIRE) + @javax.annotation.Nullable + private Integer deviceCodeExpire; + + public static final String SERIALIZED_NAME_POLLING_INTERVAL = "PollingInterval"; + @SerializedName(SERIALIZED_NAME_POLLING_INTERVAL) + @javax.annotation.Nullable + private Integer pollingInterval; + + /** + * Gets or Sets userCodeCharacterSet + */ + @JsonAdapter(UserCodeCharacterSetEnum.Adapter.class) + public enum UserCodeCharacterSetEnum { + BASE20("Base20"), + + ALPHA("Alpha"), + + DIGITS("Digits"), + + ALPHANUMERIC("Alphanumeric"); + + private String value; + + UserCodeCharacterSetEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static UserCodeCharacterSetEnum fromValue(String value) { + for (UserCodeCharacterSetEnum b : UserCodeCharacterSetEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<UserCodeCharacterSetEnum> { + @Override + public void write(final JsonWriter jsonWriter, final UserCodeCharacterSetEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public UserCodeCharacterSetEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return UserCodeCharacterSetEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + UserCodeCharacterSetEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_USER_CODE_CHARACTER_SET = "UserCodeCharacterSet"; + @SerializedName(SERIALIZED_NAME_USER_CODE_CHARACTER_SET) + @javax.annotation.Nullable + private UserCodeCharacterSetEnum userCodeCharacterSet; + + public static final String SERIALIZED_NAME_USER_CODE_MASK = "UserCodeMask"; + @SerializedName(SERIALIZED_NAME_USER_CODE_MASK) + @javax.annotation.Nullable + private String userCodeMask; + + public static final String SERIALIZED_NAME_VERIFICATION_URL = "VerificationUrl"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_URL) + @javax.annotation.Nullable + private String verificationUrl; + + public OAuthClientRequestDeviceCodeConfig() { + } + + public OAuthClientRequestDeviceCodeConfig afterVerificationUrl(@javax.annotation.Nullable String afterVerificationUrl) { + this.afterVerificationUrl = afterVerificationUrl; + return this; + } + + /** + * Get afterVerificationUrl + * @return afterVerificationUrl + */ + @javax.annotation.Nullable + public String getAfterVerificationUrl() { + return afterVerificationUrl; + } + + public void setAfterVerificationUrl(@javax.annotation.Nullable String afterVerificationUrl) { + this.afterVerificationUrl = afterVerificationUrl; + } + + + public OAuthClientRequestDeviceCodeConfig deviceCodeExpire(@javax.annotation.Nullable Integer deviceCodeExpire) { + this.deviceCodeExpire = deviceCodeExpire; + return this; + } + + /** + * Get deviceCodeExpire + * @return deviceCodeExpire + */ + @javax.annotation.Nullable + public Integer getDeviceCodeExpire() { + return deviceCodeExpire; + } + + public void setDeviceCodeExpire(@javax.annotation.Nullable Integer deviceCodeExpire) { + this.deviceCodeExpire = deviceCodeExpire; + } + + + public OAuthClientRequestDeviceCodeConfig pollingInterval(@javax.annotation.Nullable Integer pollingInterval) { + this.pollingInterval = pollingInterval; + return this; + } + + /** + * Get pollingInterval + * @return pollingInterval + */ + @javax.annotation.Nullable + public Integer getPollingInterval() { + return pollingInterval; + } + + public void setPollingInterval(@javax.annotation.Nullable Integer pollingInterval) { + this.pollingInterval = pollingInterval; + } + + + public OAuthClientRequestDeviceCodeConfig userCodeCharacterSet(@javax.annotation.Nullable UserCodeCharacterSetEnum userCodeCharacterSet) { + this.userCodeCharacterSet = userCodeCharacterSet; + return this; + } + + /** + * Get userCodeCharacterSet + * @return userCodeCharacterSet + */ + @javax.annotation.Nullable + public UserCodeCharacterSetEnum getUserCodeCharacterSet() { + return userCodeCharacterSet; + } + + public void setUserCodeCharacterSet(@javax.annotation.Nullable UserCodeCharacterSetEnum userCodeCharacterSet) { + this.userCodeCharacterSet = userCodeCharacterSet; + } + + + public OAuthClientRequestDeviceCodeConfig userCodeMask(@javax.annotation.Nullable String userCodeMask) { + this.userCodeMask = userCodeMask; + return this; + } + + /** + * Get userCodeMask + * @return userCodeMask + */ + @javax.annotation.Nullable + public String getUserCodeMask() { + return userCodeMask; + } + + public void setUserCodeMask(@javax.annotation.Nullable String userCodeMask) { + this.userCodeMask = userCodeMask; + } + + + public OAuthClientRequestDeviceCodeConfig verificationUrl(@javax.annotation.Nullable String verificationUrl) { + this.verificationUrl = verificationUrl; + return this; + } + + /** + * Get verificationUrl + * @return verificationUrl + */ + @javax.annotation.Nullable + public String getVerificationUrl() { + return verificationUrl; + } + + public void setVerificationUrl(@javax.annotation.Nullable String verificationUrl) { + this.verificationUrl = verificationUrl; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthClientRequestDeviceCodeConfig instance itself + */ + public OAuthClientRequestDeviceCodeConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthClientRequestDeviceCodeConfig oauthClientRequestDeviceCodeConfig = (OAuthClientRequestDeviceCodeConfig) o; + return Objects.equals(this.afterVerificationUrl, oauthClientRequestDeviceCodeConfig.afterVerificationUrl) && + Objects.equals(this.deviceCodeExpire, oauthClientRequestDeviceCodeConfig.deviceCodeExpire) && + Objects.equals(this.pollingInterval, oauthClientRequestDeviceCodeConfig.pollingInterval) && + Objects.equals(this.userCodeCharacterSet, oauthClientRequestDeviceCodeConfig.userCodeCharacterSet) && + Objects.equals(this.userCodeMask, oauthClientRequestDeviceCodeConfig.userCodeMask) && + Objects.equals(this.verificationUrl, oauthClientRequestDeviceCodeConfig.verificationUrl)&& + Objects.equals(this.additionalProperties, oauthClientRequestDeviceCodeConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(afterVerificationUrl, deviceCodeExpire, pollingInterval, userCodeCharacterSet, userCodeMask, verificationUrl, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthClientRequestDeviceCodeConfig {\n"); + sb.append(" afterVerificationUrl: ").append(toIndentedString(afterVerificationUrl)).append("\n"); + sb.append(" deviceCodeExpire: ").append(toIndentedString(deviceCodeExpire)).append("\n"); + sb.append(" pollingInterval: ").append(toIndentedString(pollingInterval)).append("\n"); + sb.append(" userCodeCharacterSet: ").append(toIndentedString(userCodeCharacterSet)).append("\n"); + sb.append(" userCodeMask: ").append(toIndentedString(userCodeMask)).append("\n"); + sb.append(" verificationUrl: ").append(toIndentedString(verificationUrl)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AfterVerificationUrl"); + openapiFields.add("DeviceCodeExpire"); + openapiFields.add("PollingInterval"); + openapiFields.add("UserCodeCharacterSet"); + openapiFields.add("UserCodeMask"); + openapiFields.add("VerificationUrl"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OAuthClientRequestDeviceCodeConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthClientRequestDeviceCodeConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthClientRequestDeviceCodeConfig is not found in the empty JSON string", OAuthClientRequestDeviceCodeConfig.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("AfterVerificationUrl") != null && !jsonObj.get("AfterVerificationUrl").isJsonNull()) && !jsonObj.get("AfterVerificationUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AfterVerificationUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AfterVerificationUrl").toString())); + } + if ((jsonObj.get("UserCodeCharacterSet") != null && !jsonObj.get("UserCodeCharacterSet").isJsonNull()) && !jsonObj.get("UserCodeCharacterSet").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UserCodeCharacterSet` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UserCodeCharacterSet").toString())); + } + // validate the optional field `UserCodeCharacterSet` + if (jsonObj.get("UserCodeCharacterSet") != null && !jsonObj.get("UserCodeCharacterSet").isJsonNull()) { + UserCodeCharacterSetEnum.validateJsonElement(jsonObj.get("UserCodeCharacterSet")); + } + if ((jsonObj.get("UserCodeMask") != null && !jsonObj.get("UserCodeMask").isJsonNull()) && !jsonObj.get("UserCodeMask").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UserCodeMask` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UserCodeMask").toString())); + } + if ((jsonObj.get("VerificationUrl") != null && !jsonObj.get("VerificationUrl").isJsonNull()) && !jsonObj.get("VerificationUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `VerificationUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("VerificationUrl").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthClientRequestDeviceCodeConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthClientRequestDeviceCodeConfig' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthClientRequestDeviceCodeConfig> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthClientRequestDeviceCodeConfig.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthClientRequestDeviceCodeConfig>() { + @Override + public void write(JsonWriter out, OAuthClientRequestDeviceCodeConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthClientRequestDeviceCodeConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthClientRequestDeviceCodeConfig instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthClientRequestDeviceCodeConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthClientRequestDeviceCodeConfig + * @throws IOException if the JSON string is invalid with respect to OAuthClientRequestDeviceCodeConfig + */ + public static OAuthClientRequestDeviceCodeConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthClientRequestDeviceCodeConfig.class); + } + + /** + * Convert an instance of OAuthClientRequestDeviceCodeConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientRequestJwtTokenConfig.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientRequestJwtTokenConfig.java new file mode 100644 index 0000000..dd93508 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientRequestJwtTokenConfig.java @@ -0,0 +1,311 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuthClientRequestJwtTokenConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthClientRequestJwtTokenConfig { + public static final String SERIALIZED_NAME_ID_TOKEN_T_T_L = "IdTokenTTL"; + @SerializedName(SERIALIZED_NAME_ID_TOKEN_T_T_L) + @javax.annotation.Nullable + private Integer idTokenTTL; + + public static final String SERIALIZED_NAME_TOKEN_T_T_L = "TokenTTL"; + @SerializedName(SERIALIZED_NAME_TOKEN_T_T_L) + @javax.annotation.Nullable + private Integer tokenTTL; + + public OAuthClientRequestJwtTokenConfig() { + } + + public OAuthClientRequestJwtTokenConfig idTokenTTL(@javax.annotation.Nullable Integer idTokenTTL) { + this.idTokenTTL = idTokenTTL; + return this; + } + + /** + * Get idTokenTTL + * @return idTokenTTL + */ + @javax.annotation.Nullable + public Integer getIdTokenTTL() { + return idTokenTTL; + } + + public void setIdTokenTTL(@javax.annotation.Nullable Integer idTokenTTL) { + this.idTokenTTL = idTokenTTL; + } + + + public OAuthClientRequestJwtTokenConfig tokenTTL(@javax.annotation.Nullable Integer tokenTTL) { + this.tokenTTL = tokenTTL; + return this; + } + + /** + * Get tokenTTL + * @return tokenTTL + */ + @javax.annotation.Nullable + public Integer getTokenTTL() { + return tokenTTL; + } + + public void setTokenTTL(@javax.annotation.Nullable Integer tokenTTL) { + this.tokenTTL = tokenTTL; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthClientRequestJwtTokenConfig instance itself + */ + public OAuthClientRequestJwtTokenConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthClientRequestJwtTokenConfig oauthClientRequestJwtTokenConfig = (OAuthClientRequestJwtTokenConfig) o; + return Objects.equals(this.idTokenTTL, oauthClientRequestJwtTokenConfig.idTokenTTL) && + Objects.equals(this.tokenTTL, oauthClientRequestJwtTokenConfig.tokenTTL)&& + Objects.equals(this.additionalProperties, oauthClientRequestJwtTokenConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(idTokenTTL, tokenTTL, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthClientRequestJwtTokenConfig {\n"); + sb.append(" idTokenTTL: ").append(toIndentedString(idTokenTTL)).append("\n"); + sb.append(" tokenTTL: ").append(toIndentedString(tokenTTL)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IdTokenTTL"); + openapiFields.add("TokenTTL"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OAuthClientRequestJwtTokenConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthClientRequestJwtTokenConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthClientRequestJwtTokenConfig is not found in the empty JSON string", OAuthClientRequestJwtTokenConfig.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthClientRequestJwtTokenConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthClientRequestJwtTokenConfig' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthClientRequestJwtTokenConfig> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthClientRequestJwtTokenConfig.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthClientRequestJwtTokenConfig>() { + @Override + public void write(JsonWriter out, OAuthClientRequestJwtTokenConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthClientRequestJwtTokenConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthClientRequestJwtTokenConfig instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthClientRequestJwtTokenConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthClientRequestJwtTokenConfig + * @throws IOException if the JSON string is invalid with respect to OAuthClientRequestJwtTokenConfig + */ + public static OAuthClientRequestJwtTokenConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthClientRequestJwtTokenConfig.class); + } + + /** + * Convert an instance of OAuthClientRequestJwtTokenConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientResponse.java new file mode 100644 index 0000000..d814c25 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientResponse.java @@ -0,0 +1,1439 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.OAuthClientResponseBackChannelLogout; +import com.loginradius.sdk.internal.openapi.model.OAuthClientResponseConnections; +import com.loginradius.sdk.internal.openapi.model.OAuthClientResponseDeviceCodeConfig; +import com.loginradius.sdk.internal.openapi.model.OAuthClientResponseJwtTokenConfig; +import com.loginradius.sdk.internal.openapi.model.OAuthClientResponseRefreshTokenRotation; +import java.io.IOException; +import java.math.BigDecimal; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuthClientResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthClientResponse { + public static final String SERIALIZED_NAME_ALLOWED_CORS_ORIGIN = "AllowedCorsOrigin"; + @SerializedName(SERIALIZED_NAME_ALLOWED_CORS_ORIGIN) + @javax.annotation.Nullable + private List<String> allowedCorsOrigin = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ALLOWED_SCOPES = "AllowedScopes"; + @SerializedName(SERIALIZED_NAME_ALLOWED_SCOPES) + @javax.annotation.Nullable + private List<String> allowedScopes = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ALLOWED_WEB_ORIGIN = "AllowedWebOrigin"; + @SerializedName(SERIALIZED_NAME_ALLOWED_WEB_ORIGIN) + @javax.annotation.Nullable + private List<String> allowedWebOrigin = new ArrayList<>(); + + public static final String SERIALIZED_NAME_APP_ID = "AppId"; + @SerializedName(SERIALIZED_NAME_APP_ID) + @javax.annotation.Nullable + private BigDecimal appId; + + public static final String SERIALIZED_NAME_APP_NAME = "AppName"; + @SerializedName(SERIALIZED_NAME_APP_NAME) + @javax.annotation.Nullable + private String appName; + + public static final String SERIALIZED_NAME_AUDIENCE_SCOPES = "AudienceScopes"; + @SerializedName(SERIALIZED_NAME_AUDIENCE_SCOPES) + @javax.annotation.Nullable + private Map<String, List<String>> audienceScopes = new HashMap<>(); + + public static final String SERIALIZED_NAME_BACK_CHANNEL_LOGOUT = "BackChannelLogout"; + @SerializedName(SERIALIZED_NAME_BACK_CHANNEL_LOGOUT) + @javax.annotation.Nullable + private OAuthClientResponseBackChannelLogout backChannelLogout; + + public static final String SERIALIZED_NAME_CLIENT_ID = "ClientId"; + @SerializedName(SERIALIZED_NAME_CLIENT_ID) + @javax.annotation.Nullable + private String clientId; + + public static final String SERIALIZED_NAME_CLIENT_SECRET = "ClientSecret"; + @SerializedName(SERIALIZED_NAME_CLIENT_SECRET) + @javax.annotation.Nullable + private String clientSecret; + + /** + * Gets or Sets clientType + */ + @JsonAdapter(ClientTypeEnum.Adapter.class) + public enum ClientTypeEnum { + PUBLIC("public"), + + CONFIDENTIAL("confidential"); + + private String value; + + ClientTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ClientTypeEnum fromValue(String value) { + for (ClientTypeEnum b : ClientTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<ClientTypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final ClientTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ClientTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ClientTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ClientTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CLIENT_TYPE = "ClientType"; + @SerializedName(SERIALIZED_NAME_CLIENT_TYPE) + @javax.annotation.Nullable + private ClientTypeEnum clientType; + + public static final String SERIALIZED_NAME_CONNECTIONS = "Connections"; + @SerializedName(SERIALIZED_NAME_CONNECTIONS) + @javax.annotation.Nullable + private OAuthClientResponseConnections connections; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public static final String SERIALIZED_NAME_DESCRIPTION = "Description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_DEVICE_CODE_CONFIG = "DeviceCodeConfig"; + @SerializedName(SERIALIZED_NAME_DEVICE_CODE_CONFIG) + @javax.annotation.Nullable + private OAuthClientResponseDeviceCodeConfig deviceCodeConfig; + + public static final String SERIALIZED_NAME_ENABLE_CORS_ORIGIN = "EnableCorsOrigin"; + @SerializedName(SERIALIZED_NAME_ENABLE_CORS_ORIGIN) + @javax.annotation.Nullable + private Boolean enableCorsOrigin; + + public static final String SERIALIZED_NAME_FORCE_RE_AUTHENTICATION = "ForceReAuthentication"; + @SerializedName(SERIALIZED_NAME_FORCE_RE_AUTHENTICATION) + @javax.annotation.Nullable + private Boolean forceReAuthentication; + + public static final String SERIALIZED_NAME_GLOBAL_CLIENT = "GlobalClient"; + @SerializedName(SERIALIZED_NAME_GLOBAL_CLIENT) + @javax.annotation.Nullable + private Boolean globalClient; + + public static final String SERIALIZED_NAME_GRANT_TYPES = "GrantTypes"; + @SerializedName(SERIALIZED_NAME_GRANT_TYPES) + @javax.annotation.Nullable + private List<String> grantTypes = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ID_TOKEN_AUDIENCES = "IdTokenAudiences"; + @SerializedName(SERIALIZED_NAME_ID_TOKEN_AUDIENCES) + @javax.annotation.Nullable + private List<String> idTokenAudiences = new ArrayList<>(); + + public static final String SERIALIZED_NAME_JWT_TOKEN_CONFIG = "JwtTokenConfig"; + @SerializedName(SERIALIZED_NAME_JWT_TOKEN_CONFIG) + @javax.annotation.Nullable + private OAuthClientResponseJwtTokenConfig jwtTokenConfig; + + public static final String SERIALIZED_NAME_LAST_MODIFIED_DATE = "LastModifiedDate"; + @SerializedName(SERIALIZED_NAME_LAST_MODIFIED_DATE) + @javax.annotation.Nullable + private OffsetDateTime lastModifiedDate; + + public static final String SERIALIZED_NAME_LOGIN_URL = "LoginUrl"; + @SerializedName(SERIALIZED_NAME_LOGIN_URL) + @javax.annotation.Nullable + private String loginUrl; + + public static final String SERIALIZED_NAME_LOGIN_REDIRECT_URI = "LoginRedirectUri"; + @SerializedName(SERIALIZED_NAME_LOGIN_REDIRECT_URI) + @javax.annotation.Nullable + private List<String> loginRedirectUri = new ArrayList<>(); + + public static final String SERIALIZED_NAME_LOGOUT_REDIRECT_URI = "LogoutRedirectUri"; + @SerializedName(SERIALIZED_NAME_LOGOUT_REDIRECT_URI) + @javax.annotation.Nullable + private List<String> logoutRedirectUri = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ACCESS_TOKEN_MAPPING_TEMPLATE = "AccessTokenMappingTemplate"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN_MAPPING_TEMPLATE) + @javax.annotation.Nullable + private String accessTokenMappingTemplate; + + public static final String SERIALIZED_NAME_ID_TOKEN_MAPPING_TEMPLATE = "IdTokenMappingTemplate"; + @SerializedName(SERIALIZED_NAME_ID_TOKEN_MAPPING_TEMPLATE) + @javax.annotation.Nullable + private String idTokenMappingTemplate; + + public static final String SERIALIZED_NAME_MAPPING = "Mapping"; + @SerializedName(SERIALIZED_NAME_MAPPING) + @javax.annotation.Nullable + private Map<String, String> mapping = new HashMap<>(); + + public static final String SERIALIZED_NAME_METADATA = "Metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + @javax.annotation.Nullable + private Map<String, String> metadata = new HashMap<>(); + + public static final String SERIALIZED_NAME_REDIRECT_U_R_I_EXACT_MATCH = "RedirectURIExactMatch"; + @SerializedName(SERIALIZED_NAME_REDIRECT_U_R_I_EXACT_MATCH) + @javax.annotation.Nullable + private Boolean redirectURIExactMatch; + + public static final String SERIALIZED_NAME_REFRESH_TOKEN_ROTATION = "RefreshTokenRotation"; + @SerializedName(SERIALIZED_NAME_REFRESH_TOKEN_ROTATION) + @javax.annotation.Nullable + private OAuthClientResponseRefreshTokenRotation refreshTokenRotation; + + public static final String SERIALIZED_NAME_REFRESH_TOKEN_T_T_L = "RefreshTokenTTL"; + @SerializedName(SERIALIZED_NAME_REFRESH_TOKEN_T_T_L) + @javax.annotation.Nullable + private Integer refreshTokenTTL; + + public static final String SERIALIZED_NAME_SECRET = "Secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + @javax.annotation.Nullable + private String secret; + + public static final String SERIALIZED_NAME_SIGNED_USER_INFO = "SignedUserInfo"; + @SerializedName(SERIALIZED_NAME_SIGNED_USER_INFO) + @javax.annotation.Nullable + private Boolean signedUserInfo; + + public static final String SERIALIZED_NAME_TOKEN_AUTH_METHOD = "TokenAuthMethod"; + @SerializedName(SERIALIZED_NAME_TOKEN_AUTH_METHOD) + @javax.annotation.Nullable + private String tokenAuthMethod; + + public static final String SERIALIZED_NAME_TOKEN_WEB_ORIGIN_MATCH = "TokenWebOriginMatch"; + @SerializedName(SERIALIZED_NAME_TOKEN_WEB_ORIGIN_MATCH) + @javax.annotation.Nullable + private Boolean tokenWebOriginMatch; + + public OAuthClientResponse() { + } + + public OAuthClientResponse allowedCorsOrigin(@javax.annotation.Nullable List<String> allowedCorsOrigin) { + this.allowedCorsOrigin = allowedCorsOrigin; + return this; + } + + public OAuthClientResponse addAllowedCorsOriginItem(String allowedCorsOriginItem) { + if (this.allowedCorsOrigin == null) { + this.allowedCorsOrigin = new ArrayList<>(); + } + this.allowedCorsOrigin.add(allowedCorsOriginItem); + return this; + } + + /** + * Get allowedCorsOrigin + * @return allowedCorsOrigin + */ + @javax.annotation.Nullable + public List<String> getAllowedCorsOrigin() { + return allowedCorsOrigin; + } + + public void setAllowedCorsOrigin(@javax.annotation.Nullable List<String> allowedCorsOrigin) { + this.allowedCorsOrigin = allowedCorsOrigin; + } + + + public OAuthClientResponse allowedScopes(@javax.annotation.Nullable List<String> allowedScopes) { + this.allowedScopes = allowedScopes; + return this; + } + + public OAuthClientResponse addAllowedScopesItem(String allowedScopesItem) { + if (this.allowedScopes == null) { + this.allowedScopes = new ArrayList<>(); + } + this.allowedScopes.add(allowedScopesItem); + return this; + } + + /** + * Get allowedScopes + * @return allowedScopes + */ + @javax.annotation.Nullable + public List<String> getAllowedScopes() { + return allowedScopes; + } + + public void setAllowedScopes(@javax.annotation.Nullable List<String> allowedScopes) { + this.allowedScopes = allowedScopes; + } + + + public OAuthClientResponse allowedWebOrigin(@javax.annotation.Nullable List<String> allowedWebOrigin) { + this.allowedWebOrigin = allowedWebOrigin; + return this; + } + + public OAuthClientResponse addAllowedWebOriginItem(String allowedWebOriginItem) { + if (this.allowedWebOrigin == null) { + this.allowedWebOrigin = new ArrayList<>(); + } + this.allowedWebOrigin.add(allowedWebOriginItem); + return this; + } + + /** + * Get allowedWebOrigin + * @return allowedWebOrigin + */ + @javax.annotation.Nullable + public List<String> getAllowedWebOrigin() { + return allowedWebOrigin; + } + + public void setAllowedWebOrigin(@javax.annotation.Nullable List<String> allowedWebOrigin) { + this.allowedWebOrigin = allowedWebOrigin; + } + + + public OAuthClientResponse appId(@javax.annotation.Nullable BigDecimal appId) { + this.appId = appId; + return this; + } + + /** + * Get appId + * @return appId + */ + @javax.annotation.Nullable + public BigDecimal getAppId() { + return appId; + } + + public void setAppId(@javax.annotation.Nullable BigDecimal appId) { + this.appId = appId; + } + + + public OAuthClientResponse appName(@javax.annotation.Nullable String appName) { + this.appName = appName; + return this; + } + + /** + * Get appName + * @return appName + */ + @javax.annotation.Nullable + public String getAppName() { + return appName; + } + + public void setAppName(@javax.annotation.Nullable String appName) { + this.appName = appName; + } + + + public OAuthClientResponse audienceScopes(@javax.annotation.Nullable Map<String, List<String>> audienceScopes) { + this.audienceScopes = audienceScopes; + return this; + } + + public OAuthClientResponse putAudienceScopesItem(String key, List<String> audienceScopesItem) { + if (this.audienceScopes == null) { + this.audienceScopes = new HashMap<>(); + } + this.audienceScopes.put(key, audienceScopesItem); + return this; + } + + /** + * Get audienceScopes + * @return audienceScopes + */ + @javax.annotation.Nullable + public Map<String, List<String>> getAudienceScopes() { + return audienceScopes; + } + + public void setAudienceScopes(@javax.annotation.Nullable Map<String, List<String>> audienceScopes) { + this.audienceScopes = audienceScopes; + } + + + public OAuthClientResponse backChannelLogout(@javax.annotation.Nullable OAuthClientResponseBackChannelLogout backChannelLogout) { + this.backChannelLogout = backChannelLogout; + return this; + } + + /** + * Get backChannelLogout + * @return backChannelLogout + */ + @javax.annotation.Nullable + public OAuthClientResponseBackChannelLogout getBackChannelLogout() { + return backChannelLogout; + } + + public void setBackChannelLogout(@javax.annotation.Nullable OAuthClientResponseBackChannelLogout backChannelLogout) { + this.backChannelLogout = backChannelLogout; + } + + + public OAuthClientResponse clientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get clientId + * @return clientId + */ + @javax.annotation.Nullable + public String getClientId() { + return clientId; + } + + public void setClientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + } + + + public OAuthClientResponse clientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get clientSecret + * @return clientSecret + */ + @javax.annotation.Nullable + public String getClientSecret() { + return clientSecret; + } + + public void setClientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + } + + + public OAuthClientResponse clientType(@javax.annotation.Nullable ClientTypeEnum clientType) { + this.clientType = clientType; + return this; + } + + /** + * Get clientType + * @return clientType + */ + @javax.annotation.Nullable + public ClientTypeEnum getClientType() { + return clientType; + } + + public void setClientType(@javax.annotation.Nullable ClientTypeEnum clientType) { + this.clientType = clientType; + } + + + public OAuthClientResponse connections(@javax.annotation.Nullable OAuthClientResponseConnections connections) { + this.connections = connections; + return this; + } + + /** + * Get connections + * @return connections + */ + @javax.annotation.Nullable + public OAuthClientResponseConnections getConnections() { + return connections; + } + + public void setConnections(@javax.annotation.Nullable OAuthClientResponseConnections connections) { + this.connections = connections; + } + + + public OAuthClientResponse createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get createdDate + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + + public OAuthClientResponse description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public OAuthClientResponse deviceCodeConfig(@javax.annotation.Nullable OAuthClientResponseDeviceCodeConfig deviceCodeConfig) { + this.deviceCodeConfig = deviceCodeConfig; + return this; + } + + /** + * Get deviceCodeConfig + * @return deviceCodeConfig + */ + @javax.annotation.Nullable + public OAuthClientResponseDeviceCodeConfig getDeviceCodeConfig() { + return deviceCodeConfig; + } + + public void setDeviceCodeConfig(@javax.annotation.Nullable OAuthClientResponseDeviceCodeConfig deviceCodeConfig) { + this.deviceCodeConfig = deviceCodeConfig; + } + + + public OAuthClientResponse enableCorsOrigin(@javax.annotation.Nullable Boolean enableCorsOrigin) { + this.enableCorsOrigin = enableCorsOrigin; + return this; + } + + /** + * Get enableCorsOrigin + * @return enableCorsOrigin + */ + @javax.annotation.Nullable + public Boolean getEnableCorsOrigin() { + return enableCorsOrigin; + } + + public void setEnableCorsOrigin(@javax.annotation.Nullable Boolean enableCorsOrigin) { + this.enableCorsOrigin = enableCorsOrigin; + } + + + public OAuthClientResponse forceReAuthentication(@javax.annotation.Nullable Boolean forceReAuthentication) { + this.forceReAuthentication = forceReAuthentication; + return this; + } + + /** + * Get forceReAuthentication + * @return forceReAuthentication + */ + @javax.annotation.Nullable + public Boolean getForceReAuthentication() { + return forceReAuthentication; + } + + public void setForceReAuthentication(@javax.annotation.Nullable Boolean forceReAuthentication) { + this.forceReAuthentication = forceReAuthentication; + } + + + public OAuthClientResponse globalClient(@javax.annotation.Nullable Boolean globalClient) { + this.globalClient = globalClient; + return this; + } + + /** + * Get globalClient + * @return globalClient + */ + @javax.annotation.Nullable + public Boolean getGlobalClient() { + return globalClient; + } + + public void setGlobalClient(@javax.annotation.Nullable Boolean globalClient) { + this.globalClient = globalClient; + } + + + public OAuthClientResponse grantTypes(@javax.annotation.Nullable List<String> grantTypes) { + this.grantTypes = grantTypes; + return this; + } + + public OAuthClientResponse addGrantTypesItem(String grantTypesItem) { + if (this.grantTypes == null) { + this.grantTypes = new ArrayList<>(); + } + this.grantTypes.add(grantTypesItem); + return this; + } + + /** + * Get grantTypes + * @return grantTypes + */ + @javax.annotation.Nullable + public List<String> getGrantTypes() { + return grantTypes; + } + + public void setGrantTypes(@javax.annotation.Nullable List<String> grantTypes) { + this.grantTypes = grantTypes; + } + + + public OAuthClientResponse idTokenAudiences(@javax.annotation.Nullable List<String> idTokenAudiences) { + this.idTokenAudiences = idTokenAudiences; + return this; + } + + public OAuthClientResponse addIdTokenAudiencesItem(String idTokenAudiencesItem) { + if (this.idTokenAudiences == null) { + this.idTokenAudiences = new ArrayList<>(); + } + this.idTokenAudiences.add(idTokenAudiencesItem); + return this; + } + + /** + * Get idTokenAudiences + * @return idTokenAudiences + */ + @javax.annotation.Nullable + public List<String> getIdTokenAudiences() { + return idTokenAudiences; + } + + public void setIdTokenAudiences(@javax.annotation.Nullable List<String> idTokenAudiences) { + this.idTokenAudiences = idTokenAudiences; + } + + + public OAuthClientResponse jwtTokenConfig(@javax.annotation.Nullable OAuthClientResponseJwtTokenConfig jwtTokenConfig) { + this.jwtTokenConfig = jwtTokenConfig; + return this; + } + + /** + * Get jwtTokenConfig + * @return jwtTokenConfig + */ + @javax.annotation.Nullable + public OAuthClientResponseJwtTokenConfig getJwtTokenConfig() { + return jwtTokenConfig; + } + + public void setJwtTokenConfig(@javax.annotation.Nullable OAuthClientResponseJwtTokenConfig jwtTokenConfig) { + this.jwtTokenConfig = jwtTokenConfig; + } + + + public OAuthClientResponse lastModifiedDate(@javax.annotation.Nullable OffsetDateTime lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + return this; + } + + /** + * Get lastModifiedDate + * @return lastModifiedDate + */ + @javax.annotation.Nullable + public OffsetDateTime getLastModifiedDate() { + return lastModifiedDate; + } + + public void setLastModifiedDate(@javax.annotation.Nullable OffsetDateTime lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + } + + + public OAuthClientResponse loginUrl(@javax.annotation.Nullable String loginUrl) { + this.loginUrl = loginUrl; + return this; + } + + /** + * Get loginUrl + * @return loginUrl + */ + @javax.annotation.Nullable + public String getLoginUrl() { + return loginUrl; + } + + public void setLoginUrl(@javax.annotation.Nullable String loginUrl) { + this.loginUrl = loginUrl; + } + + + public OAuthClientResponse loginRedirectUri(@javax.annotation.Nullable List<String> loginRedirectUri) { + this.loginRedirectUri = loginRedirectUri; + return this; + } + + public OAuthClientResponse addLoginRedirectUriItem(String loginRedirectUriItem) { + if (this.loginRedirectUri == null) { + this.loginRedirectUri = new ArrayList<>(); + } + this.loginRedirectUri.add(loginRedirectUriItem); + return this; + } + + /** + * Get loginRedirectUri + * @return loginRedirectUri + */ + @javax.annotation.Nullable + public List<String> getLoginRedirectUri() { + return loginRedirectUri; + } + + public void setLoginRedirectUri(@javax.annotation.Nullable List<String> loginRedirectUri) { + this.loginRedirectUri = loginRedirectUri; + } + + + public OAuthClientResponse logoutRedirectUri(@javax.annotation.Nullable List<String> logoutRedirectUri) { + this.logoutRedirectUri = logoutRedirectUri; + return this; + } + + public OAuthClientResponse addLogoutRedirectUriItem(String logoutRedirectUriItem) { + if (this.logoutRedirectUri == null) { + this.logoutRedirectUri = new ArrayList<>(); + } + this.logoutRedirectUri.add(logoutRedirectUriItem); + return this; + } + + /** + * Get logoutRedirectUri + * @return logoutRedirectUri + */ + @javax.annotation.Nullable + public List<String> getLogoutRedirectUri() { + return logoutRedirectUri; + } + + public void setLogoutRedirectUri(@javax.annotation.Nullable List<String> logoutRedirectUri) { + this.logoutRedirectUri = logoutRedirectUri; + } + + + public OAuthClientResponse accessTokenMappingTemplate(@javax.annotation.Nullable String accessTokenMappingTemplate) { + this.accessTokenMappingTemplate = accessTokenMappingTemplate; + return this; + } + + /** + * Get accessTokenMappingTemplate + * @return accessTokenMappingTemplate + */ + @javax.annotation.Nullable + public String getAccessTokenMappingTemplate() { + return accessTokenMappingTemplate; + } + + public void setAccessTokenMappingTemplate(@javax.annotation.Nullable String accessTokenMappingTemplate) { + this.accessTokenMappingTemplate = accessTokenMappingTemplate; + } + + + public OAuthClientResponse idTokenMappingTemplate(@javax.annotation.Nullable String idTokenMappingTemplate) { + this.idTokenMappingTemplate = idTokenMappingTemplate; + return this; + } + + /** + * Get idTokenMappingTemplate + * @return idTokenMappingTemplate + */ + @javax.annotation.Nullable + public String getIdTokenMappingTemplate() { + return idTokenMappingTemplate; + } + + public void setIdTokenMappingTemplate(@javax.annotation.Nullable String idTokenMappingTemplate) { + this.idTokenMappingTemplate = idTokenMappingTemplate; + } + + + public OAuthClientResponse mapping(@javax.annotation.Nullable Map<String, String> mapping) { + this.mapping = mapping; + return this; + } + + public OAuthClientResponse putMappingItem(String key, String mappingItem) { + if (this.mapping == null) { + this.mapping = new HashMap<>(); + } + this.mapping.put(key, mappingItem); + return this; + } + + /** + * Get mapping + * @return mapping + */ + @javax.annotation.Nullable + public Map<String, String> getMapping() { + return mapping; + } + + public void setMapping(@javax.annotation.Nullable Map<String, String> mapping) { + this.mapping = mapping; + } + + + public OAuthClientResponse metadata(@javax.annotation.Nullable Map<String, String> metadata) { + this.metadata = metadata; + return this; + } + + public OAuthClientResponse putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Get metadata + * @return metadata + */ + @javax.annotation.Nullable + public Map<String, String> getMetadata() { + return metadata; + } + + public void setMetadata(@javax.annotation.Nullable Map<String, String> metadata) { + this.metadata = metadata; + } + + + public OAuthClientResponse redirectURIExactMatch(@javax.annotation.Nullable Boolean redirectURIExactMatch) { + this.redirectURIExactMatch = redirectURIExactMatch; + return this; + } + + /** + * Get redirectURIExactMatch + * @return redirectURIExactMatch + */ + @javax.annotation.Nullable + public Boolean getRedirectURIExactMatch() { + return redirectURIExactMatch; + } + + public void setRedirectURIExactMatch(@javax.annotation.Nullable Boolean redirectURIExactMatch) { + this.redirectURIExactMatch = redirectURIExactMatch; + } + + + public OAuthClientResponse refreshTokenRotation(@javax.annotation.Nullable OAuthClientResponseRefreshTokenRotation refreshTokenRotation) { + this.refreshTokenRotation = refreshTokenRotation; + return this; + } + + /** + * Get refreshTokenRotation + * @return refreshTokenRotation + */ + @javax.annotation.Nullable + public OAuthClientResponseRefreshTokenRotation getRefreshTokenRotation() { + return refreshTokenRotation; + } + + public void setRefreshTokenRotation(@javax.annotation.Nullable OAuthClientResponseRefreshTokenRotation refreshTokenRotation) { + this.refreshTokenRotation = refreshTokenRotation; + } + + + public OAuthClientResponse refreshTokenTTL(@javax.annotation.Nullable Integer refreshTokenTTL) { + this.refreshTokenTTL = refreshTokenTTL; + return this; + } + + /** + * Get refreshTokenTTL + * @return refreshTokenTTL + */ + @javax.annotation.Nullable + public Integer getRefreshTokenTTL() { + return refreshTokenTTL; + } + + public void setRefreshTokenTTL(@javax.annotation.Nullable Integer refreshTokenTTL) { + this.refreshTokenTTL = refreshTokenTTL; + } + + + public OAuthClientResponse secret(@javax.annotation.Nullable String secret) { + this.secret = secret; + return this; + } + + /** + * Get secret + * @return secret + */ + @javax.annotation.Nullable + public String getSecret() { + return secret; + } + + public void setSecret(@javax.annotation.Nullable String secret) { + this.secret = secret; + } + + + public OAuthClientResponse signedUserInfo(@javax.annotation.Nullable Boolean signedUserInfo) { + this.signedUserInfo = signedUserInfo; + return this; + } + + /** + * Get signedUserInfo + * @return signedUserInfo + */ + @javax.annotation.Nullable + public Boolean getSignedUserInfo() { + return signedUserInfo; + } + + public void setSignedUserInfo(@javax.annotation.Nullable Boolean signedUserInfo) { + this.signedUserInfo = signedUserInfo; + } + + + public OAuthClientResponse tokenAuthMethod(@javax.annotation.Nullable String tokenAuthMethod) { + this.tokenAuthMethod = tokenAuthMethod; + return this; + } + + /** + * Get tokenAuthMethod + * @return tokenAuthMethod + */ + @javax.annotation.Nullable + public String getTokenAuthMethod() { + return tokenAuthMethod; + } + + public void setTokenAuthMethod(@javax.annotation.Nullable String tokenAuthMethod) { + this.tokenAuthMethod = tokenAuthMethod; + } + + + public OAuthClientResponse tokenWebOriginMatch(@javax.annotation.Nullable Boolean tokenWebOriginMatch) { + this.tokenWebOriginMatch = tokenWebOriginMatch; + return this; + } + + /** + * Get tokenWebOriginMatch + * @return tokenWebOriginMatch + */ + @javax.annotation.Nullable + public Boolean getTokenWebOriginMatch() { + return tokenWebOriginMatch; + } + + public void setTokenWebOriginMatch(@javax.annotation.Nullable Boolean tokenWebOriginMatch) { + this.tokenWebOriginMatch = tokenWebOriginMatch; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthClientResponse instance itself + */ + public OAuthClientResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthClientResponse oauthClientResponse = (OAuthClientResponse) o; + return Objects.equals(this.allowedCorsOrigin, oauthClientResponse.allowedCorsOrigin) && + Objects.equals(this.allowedScopes, oauthClientResponse.allowedScopes) && + Objects.equals(this.allowedWebOrigin, oauthClientResponse.allowedWebOrigin) && + Objects.equals(this.appId, oauthClientResponse.appId) && + Objects.equals(this.appName, oauthClientResponse.appName) && + Objects.equals(this.audienceScopes, oauthClientResponse.audienceScopes) && + Objects.equals(this.backChannelLogout, oauthClientResponse.backChannelLogout) && + Objects.equals(this.clientId, oauthClientResponse.clientId) && + Objects.equals(this.clientSecret, oauthClientResponse.clientSecret) && + Objects.equals(this.clientType, oauthClientResponse.clientType) && + Objects.equals(this.connections, oauthClientResponse.connections) && + Objects.equals(this.createdDate, oauthClientResponse.createdDate) && + Objects.equals(this.description, oauthClientResponse.description) && + Objects.equals(this.deviceCodeConfig, oauthClientResponse.deviceCodeConfig) && + Objects.equals(this.enableCorsOrigin, oauthClientResponse.enableCorsOrigin) && + Objects.equals(this.forceReAuthentication, oauthClientResponse.forceReAuthentication) && + Objects.equals(this.globalClient, oauthClientResponse.globalClient) && + Objects.equals(this.grantTypes, oauthClientResponse.grantTypes) && + Objects.equals(this.idTokenAudiences, oauthClientResponse.idTokenAudiences) && + Objects.equals(this.jwtTokenConfig, oauthClientResponse.jwtTokenConfig) && + Objects.equals(this.lastModifiedDate, oauthClientResponse.lastModifiedDate) && + Objects.equals(this.loginUrl, oauthClientResponse.loginUrl) && + Objects.equals(this.loginRedirectUri, oauthClientResponse.loginRedirectUri) && + Objects.equals(this.logoutRedirectUri, oauthClientResponse.logoutRedirectUri) && + Objects.equals(this.accessTokenMappingTemplate, oauthClientResponse.accessTokenMappingTemplate) && + Objects.equals(this.idTokenMappingTemplate, oauthClientResponse.idTokenMappingTemplate) && + Objects.equals(this.mapping, oauthClientResponse.mapping) && + Objects.equals(this.metadata, oauthClientResponse.metadata) && + Objects.equals(this.redirectURIExactMatch, oauthClientResponse.redirectURIExactMatch) && + Objects.equals(this.refreshTokenRotation, oauthClientResponse.refreshTokenRotation) && + Objects.equals(this.refreshTokenTTL, oauthClientResponse.refreshTokenTTL) && + Objects.equals(this.secret, oauthClientResponse.secret) && + Objects.equals(this.signedUserInfo, oauthClientResponse.signedUserInfo) && + Objects.equals(this.tokenAuthMethod, oauthClientResponse.tokenAuthMethod) && + Objects.equals(this.tokenWebOriginMatch, oauthClientResponse.tokenWebOriginMatch)&& + Objects.equals(this.additionalProperties, oauthClientResponse.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(allowedCorsOrigin, allowedScopes, allowedWebOrigin, appId, appName, audienceScopes, backChannelLogout, clientId, clientSecret, clientType, connections, createdDate, description, deviceCodeConfig, enableCorsOrigin, forceReAuthentication, globalClient, grantTypes, idTokenAudiences, jwtTokenConfig, lastModifiedDate, loginUrl, loginRedirectUri, logoutRedirectUri, accessTokenMappingTemplate, idTokenMappingTemplate, mapping, metadata, redirectURIExactMatch, refreshTokenRotation, refreshTokenTTL, secret, signedUserInfo, tokenAuthMethod, tokenWebOriginMatch, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthClientResponse {\n"); + sb.append(" allowedCorsOrigin: ").append(toIndentedString(allowedCorsOrigin)).append("\n"); + sb.append(" allowedScopes: ").append(toIndentedString(allowedScopes)).append("\n"); + sb.append(" allowedWebOrigin: ").append(toIndentedString(allowedWebOrigin)).append("\n"); + sb.append(" appId: ").append(toIndentedString(appId)).append("\n"); + sb.append(" appName: ").append(toIndentedString(appName)).append("\n"); + sb.append(" audienceScopes: ").append(toIndentedString(audienceScopes)).append("\n"); + sb.append(" backChannelLogout: ").append(toIndentedString(backChannelLogout)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); + sb.append(" clientType: ").append(toIndentedString(clientType)).append("\n"); + sb.append(" connections: ").append(toIndentedString(connections)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" deviceCodeConfig: ").append(toIndentedString(deviceCodeConfig)).append("\n"); + sb.append(" enableCorsOrigin: ").append(toIndentedString(enableCorsOrigin)).append("\n"); + sb.append(" forceReAuthentication: ").append(toIndentedString(forceReAuthentication)).append("\n"); + sb.append(" globalClient: ").append(toIndentedString(globalClient)).append("\n"); + sb.append(" grantTypes: ").append(toIndentedString(grantTypes)).append("\n"); + sb.append(" idTokenAudiences: ").append(toIndentedString(idTokenAudiences)).append("\n"); + sb.append(" jwtTokenConfig: ").append(toIndentedString(jwtTokenConfig)).append("\n"); + sb.append(" lastModifiedDate: ").append(toIndentedString(lastModifiedDate)).append("\n"); + sb.append(" loginUrl: ").append(toIndentedString(loginUrl)).append("\n"); + sb.append(" loginRedirectUri: ").append(toIndentedString(loginRedirectUri)).append("\n"); + sb.append(" logoutRedirectUri: ").append(toIndentedString(logoutRedirectUri)).append("\n"); + sb.append(" accessTokenMappingTemplate: ").append(toIndentedString(accessTokenMappingTemplate)).append("\n"); + sb.append(" idTokenMappingTemplate: ").append(toIndentedString(idTokenMappingTemplate)).append("\n"); + sb.append(" mapping: ").append(toIndentedString(mapping)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" redirectURIExactMatch: ").append(toIndentedString(redirectURIExactMatch)).append("\n"); + sb.append(" refreshTokenRotation: ").append(toIndentedString(refreshTokenRotation)).append("\n"); + sb.append(" refreshTokenTTL: ").append(toIndentedString(refreshTokenTTL)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" signedUserInfo: ").append(toIndentedString(signedUserInfo)).append("\n"); + sb.append(" tokenAuthMethod: ").append(toIndentedString(tokenAuthMethod)).append("\n"); + sb.append(" tokenWebOriginMatch: ").append(toIndentedString(tokenWebOriginMatch)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AllowedCorsOrigin"); + openapiFields.add("AllowedScopes"); + openapiFields.add("AllowedWebOrigin"); + openapiFields.add("AppId"); + openapiFields.add("AppName"); + openapiFields.add("AudienceScopes"); + openapiFields.add("BackChannelLogout"); + openapiFields.add("ClientId"); + openapiFields.add("ClientSecret"); + openapiFields.add("ClientType"); + openapiFields.add("Connections"); + openapiFields.add("CreatedDate"); + openapiFields.add("Description"); + openapiFields.add("DeviceCodeConfig"); + openapiFields.add("EnableCorsOrigin"); + openapiFields.add("ForceReAuthentication"); + openapiFields.add("GlobalClient"); + openapiFields.add("GrantTypes"); + openapiFields.add("IdTokenAudiences"); + openapiFields.add("JwtTokenConfig"); + openapiFields.add("LastModifiedDate"); + openapiFields.add("LoginUrl"); + openapiFields.add("LoginRedirectUri"); + openapiFields.add("LogoutRedirectUri"); + openapiFields.add("AccessTokenMappingTemplate"); + openapiFields.add("IdTokenMappingTemplate"); + openapiFields.add("Mapping"); + openapiFields.add("Metadata"); + openapiFields.add("RedirectURIExactMatch"); + openapiFields.add("RefreshTokenRotation"); + openapiFields.add("RefreshTokenTTL"); + openapiFields.add("Secret"); + openapiFields.add("SignedUserInfo"); + openapiFields.add("TokenAuthMethod"); + openapiFields.add("TokenWebOriginMatch"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OAuthClientResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthClientResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthClientResponse is not found in the empty JSON string", OAuthClientResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("AllowedCorsOrigin") != null && !jsonObj.get("AllowedCorsOrigin").isJsonNull() && !jsonObj.get("AllowedCorsOrigin").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `AllowedCorsOrigin` to be an array in the JSON string but got `%s`", jsonObj.get("AllowedCorsOrigin").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("AllowedScopes") != null && !jsonObj.get("AllowedScopes").isJsonNull() && !jsonObj.get("AllowedScopes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `AllowedScopes` to be an array in the JSON string but got `%s`", jsonObj.get("AllowedScopes").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("AllowedWebOrigin") != null && !jsonObj.get("AllowedWebOrigin").isJsonNull() && !jsonObj.get("AllowedWebOrigin").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `AllowedWebOrigin` to be an array in the JSON string but got `%s`", jsonObj.get("AllowedWebOrigin").toString())); + } + if ((jsonObj.get("AppName") != null && !jsonObj.get("AppName").isJsonNull()) && !jsonObj.get("AppName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AppName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AppName").toString())); + } + // validate the optional field `BackChannelLogout` + if (jsonObj.get("BackChannelLogout") != null && !jsonObj.get("BackChannelLogout").isJsonNull()) { + OAuthClientResponseBackChannelLogout.validateJsonElement(jsonObj.get("BackChannelLogout")); + } + if ((jsonObj.get("ClientId") != null && !jsonObj.get("ClientId").isJsonNull()) && !jsonObj.get("ClientId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ClientId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ClientId").toString())); + } + if ((jsonObj.get("ClientSecret") != null && !jsonObj.get("ClientSecret").isJsonNull()) && !jsonObj.get("ClientSecret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ClientSecret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ClientSecret").toString())); + } + if ((jsonObj.get("ClientType") != null && !jsonObj.get("ClientType").isJsonNull()) && !jsonObj.get("ClientType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ClientType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ClientType").toString())); + } + // validate the optional field `ClientType` + if (jsonObj.get("ClientType") != null && !jsonObj.get("ClientType").isJsonNull()) { + ClientTypeEnum.validateJsonElement(jsonObj.get("ClientType")); + } + // validate the optional field `Connections` + if (jsonObj.get("Connections") != null && !jsonObj.get("Connections").isJsonNull()) { + OAuthClientResponseConnections.validateJsonElement(jsonObj.get("Connections")); + } + if ((jsonObj.get("Description") != null && !jsonObj.get("Description").isJsonNull()) && !jsonObj.get("Description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Description").toString())); + } + // validate the optional field `DeviceCodeConfig` + if (jsonObj.get("DeviceCodeConfig") != null && !jsonObj.get("DeviceCodeConfig").isJsonNull()) { + OAuthClientResponseDeviceCodeConfig.validateJsonElement(jsonObj.get("DeviceCodeConfig")); + } + // ensure the optional json data is an array if present + if (jsonObj.get("GrantTypes") != null && !jsonObj.get("GrantTypes").isJsonNull() && !jsonObj.get("GrantTypes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `GrantTypes` to be an array in the JSON string but got `%s`", jsonObj.get("GrantTypes").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("IdTokenAudiences") != null && !jsonObj.get("IdTokenAudiences").isJsonNull() && !jsonObj.get("IdTokenAudiences").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `IdTokenAudiences` to be an array in the JSON string but got `%s`", jsonObj.get("IdTokenAudiences").toString())); + } + // validate the optional field `JwtTokenConfig` + if (jsonObj.get("JwtTokenConfig") != null && !jsonObj.get("JwtTokenConfig").isJsonNull()) { + OAuthClientResponseJwtTokenConfig.validateJsonElement(jsonObj.get("JwtTokenConfig")); + } + if ((jsonObj.get("LoginUrl") != null && !jsonObj.get("LoginUrl").isJsonNull()) && !jsonObj.get("LoginUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LoginUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LoginUrl").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("LoginRedirectUri") != null && !jsonObj.get("LoginRedirectUri").isJsonNull() && !jsonObj.get("LoginRedirectUri").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `LoginRedirectUri` to be an array in the JSON string but got `%s`", jsonObj.get("LoginRedirectUri").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("LogoutRedirectUri") != null && !jsonObj.get("LogoutRedirectUri").isJsonNull() && !jsonObj.get("LogoutRedirectUri").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `LogoutRedirectUri` to be an array in the JSON string but got `%s`", jsonObj.get("LogoutRedirectUri").toString())); + } + if ((jsonObj.get("AccessTokenMappingTemplate") != null && !jsonObj.get("AccessTokenMappingTemplate").isJsonNull()) && !jsonObj.get("AccessTokenMappingTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccessTokenMappingTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccessTokenMappingTemplate").toString())); + } + if ((jsonObj.get("IdTokenMappingTemplate") != null && !jsonObj.get("IdTokenMappingTemplate").isJsonNull()) && !jsonObj.get("IdTokenMappingTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IdTokenMappingTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IdTokenMappingTemplate").toString())); + } + // validate the optional field `RefreshTokenRotation` + if (jsonObj.get("RefreshTokenRotation") != null && !jsonObj.get("RefreshTokenRotation").isJsonNull()) { + OAuthClientResponseRefreshTokenRotation.validateJsonElement(jsonObj.get("RefreshTokenRotation")); + } + if ((jsonObj.get("Secret") != null && !jsonObj.get("Secret").isJsonNull()) && !jsonObj.get("Secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Secret").toString())); + } + if ((jsonObj.get("TokenAuthMethod") != null && !jsonObj.get("TokenAuthMethod").isJsonNull()) && !jsonObj.get("TokenAuthMethod").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TokenAuthMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TokenAuthMethod").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthClientResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthClientResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthClientResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthClientResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthClientResponse>() { + @Override + public void write(JsonWriter out, OAuthClientResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthClientResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthClientResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthClientResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthClientResponse + * @throws IOException if the JSON string is invalid with respect to OAuthClientResponse + */ + public static OAuthClientResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthClientResponse.class); + } + + /** + * Convert an instance of OAuthClientResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientResponseBackChannelLogout.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientResponseBackChannelLogout.java new file mode 100644 index 0000000..5e24a16 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientResponseBackChannelLogout.java @@ -0,0 +1,384 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.OAuthClientResponseBackChannelLogoutLogoutInitiator; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuthClientResponseBackChannelLogout + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthClientResponseBackChannelLogout { + public static final String SERIALIZED_NAME_IS_ENABLED = "IsEnabled"; + @SerializedName(SERIALIZED_NAME_IS_ENABLED) + @javax.annotation.Nullable + private Boolean isEnabled; + + public static final String SERIALIZED_NAME_LOGOUT_INITIATOR = "LogoutInitiator"; + @SerializedName(SERIALIZED_NAME_LOGOUT_INITIATOR) + @javax.annotation.Nullable + private OAuthClientResponseBackChannelLogoutLogoutInitiator logoutInitiator; + + public static final String SERIALIZED_NAME_LOGOUT_TOKEN_T_T_L = "LogoutTokenTTL"; + @SerializedName(SERIALIZED_NAME_LOGOUT_TOKEN_T_T_L) + @javax.annotation.Nullable + private Integer logoutTokenTTL; + + public static final String SERIALIZED_NAME_LOGOUT_U_R_IS = "LogoutURIs"; + @SerializedName(SERIALIZED_NAME_LOGOUT_U_R_IS) + @javax.annotation.Nullable + private List<String> logoutURIs = new ArrayList<>(); + + public OAuthClientResponseBackChannelLogout() { + } + + public OAuthClientResponseBackChannelLogout isEnabled(@javax.annotation.Nullable Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Get isEnabled + * @return isEnabled + */ + @javax.annotation.Nullable + public Boolean getIsEnabled() { + return isEnabled; + } + + public void setIsEnabled(@javax.annotation.Nullable Boolean isEnabled) { + this.isEnabled = isEnabled; + } + + + public OAuthClientResponseBackChannelLogout logoutInitiator(@javax.annotation.Nullable OAuthClientResponseBackChannelLogoutLogoutInitiator logoutInitiator) { + this.logoutInitiator = logoutInitiator; + return this; + } + + /** + * Get logoutInitiator + * @return logoutInitiator + */ + @javax.annotation.Nullable + public OAuthClientResponseBackChannelLogoutLogoutInitiator getLogoutInitiator() { + return logoutInitiator; + } + + public void setLogoutInitiator(@javax.annotation.Nullable OAuthClientResponseBackChannelLogoutLogoutInitiator logoutInitiator) { + this.logoutInitiator = logoutInitiator; + } + + + public OAuthClientResponseBackChannelLogout logoutTokenTTL(@javax.annotation.Nullable Integer logoutTokenTTL) { + this.logoutTokenTTL = logoutTokenTTL; + return this; + } + + /** + * Get logoutTokenTTL + * @return logoutTokenTTL + */ + @javax.annotation.Nullable + public Integer getLogoutTokenTTL() { + return logoutTokenTTL; + } + + public void setLogoutTokenTTL(@javax.annotation.Nullable Integer logoutTokenTTL) { + this.logoutTokenTTL = logoutTokenTTL; + } + + + public OAuthClientResponseBackChannelLogout logoutURIs(@javax.annotation.Nullable List<String> logoutURIs) { + this.logoutURIs = logoutURIs; + return this; + } + + public OAuthClientResponseBackChannelLogout addLogoutURIsItem(String logoutURIsItem) { + if (this.logoutURIs == null) { + this.logoutURIs = new ArrayList<>(); + } + this.logoutURIs.add(logoutURIsItem); + return this; + } + + /** + * Get logoutURIs + * @return logoutURIs + */ + @javax.annotation.Nullable + public List<String> getLogoutURIs() { + return logoutURIs; + } + + public void setLogoutURIs(@javax.annotation.Nullable List<String> logoutURIs) { + this.logoutURIs = logoutURIs; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthClientResponseBackChannelLogout instance itself + */ + public OAuthClientResponseBackChannelLogout putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthClientResponseBackChannelLogout oauthClientResponseBackChannelLogout = (OAuthClientResponseBackChannelLogout) o; + return Objects.equals(this.isEnabled, oauthClientResponseBackChannelLogout.isEnabled) && + Objects.equals(this.logoutInitiator, oauthClientResponseBackChannelLogout.logoutInitiator) && + Objects.equals(this.logoutTokenTTL, oauthClientResponseBackChannelLogout.logoutTokenTTL) && + Objects.equals(this.logoutURIs, oauthClientResponseBackChannelLogout.logoutURIs)&& + Objects.equals(this.additionalProperties, oauthClientResponseBackChannelLogout.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isEnabled, logoutInitiator, logoutTokenTTL, logoutURIs, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthClientResponseBackChannelLogout {\n"); + sb.append(" isEnabled: ").append(toIndentedString(isEnabled)).append("\n"); + sb.append(" logoutInitiator: ").append(toIndentedString(logoutInitiator)).append("\n"); + sb.append(" logoutTokenTTL: ").append(toIndentedString(logoutTokenTTL)).append("\n"); + sb.append(" logoutURIs: ").append(toIndentedString(logoutURIs)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsEnabled"); + openapiFields.add("LogoutInitiator"); + openapiFields.add("LogoutTokenTTL"); + openapiFields.add("LogoutURIs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OAuthClientResponseBackChannelLogout + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthClientResponseBackChannelLogout.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthClientResponseBackChannelLogout is not found in the empty JSON string", OAuthClientResponseBackChannelLogout.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `LogoutInitiator` + if (jsonObj.get("LogoutInitiator") != null && !jsonObj.get("LogoutInitiator").isJsonNull()) { + OAuthClientResponseBackChannelLogoutLogoutInitiator.validateJsonElement(jsonObj.get("LogoutInitiator")); + } + // ensure the optional json data is an array if present + if (jsonObj.get("LogoutURIs") != null && !jsonObj.get("LogoutURIs").isJsonNull() && !jsonObj.get("LogoutURIs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `LogoutURIs` to be an array in the JSON string but got `%s`", jsonObj.get("LogoutURIs").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthClientResponseBackChannelLogout.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthClientResponseBackChannelLogout' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthClientResponseBackChannelLogout> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthClientResponseBackChannelLogout.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthClientResponseBackChannelLogout>() { + @Override + public void write(JsonWriter out, OAuthClientResponseBackChannelLogout value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthClientResponseBackChannelLogout read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthClientResponseBackChannelLogout instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthClientResponseBackChannelLogout given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthClientResponseBackChannelLogout + * @throws IOException if the JSON string is invalid with respect to OAuthClientResponseBackChannelLogout + */ + public static OAuthClientResponseBackChannelLogout fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthClientResponseBackChannelLogout.class); + } + + /** + * Convert an instance of OAuthClientResponseBackChannelLogout to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientResponseBackChannelLogoutLogoutInitiator.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientResponseBackChannelLogoutLogoutInitiator.java new file mode 100644 index 0000000..872b0c7 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientResponseBackChannelLogoutLogoutInitiator.java @@ -0,0 +1,319 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuthClientResponseBackChannelLogoutLogoutInitiator + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthClientResponseBackChannelLogoutLogoutInitiator { + public static final String SERIALIZED_NAME_MODE = "Mode"; + @SerializedName(SERIALIZED_NAME_MODE) + @javax.annotation.Nullable + private String mode; + + public static final String SERIALIZED_NAME_INTIATORS = "Intiators"; + @SerializedName(SERIALIZED_NAME_INTIATORS) + @javax.annotation.Nullable + private OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators intiators; + + public OAuthClientResponseBackChannelLogoutLogoutInitiator() { + } + + public OAuthClientResponseBackChannelLogoutLogoutInitiator mode(@javax.annotation.Nullable String mode) { + this.mode = mode; + return this; + } + + /** + * Get mode + * @return mode + */ + @javax.annotation.Nullable + public String getMode() { + return mode; + } + + public void setMode(@javax.annotation.Nullable String mode) { + this.mode = mode; + } + + + public OAuthClientResponseBackChannelLogoutLogoutInitiator intiators(@javax.annotation.Nullable OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators intiators) { + this.intiators = intiators; + return this; + } + + /** + * Get intiators + * @return intiators + */ + @javax.annotation.Nullable + public OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators getIntiators() { + return intiators; + } + + public void setIntiators(@javax.annotation.Nullable OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators intiators) { + this.intiators = intiators; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthClientResponseBackChannelLogoutLogoutInitiator instance itself + */ + public OAuthClientResponseBackChannelLogoutLogoutInitiator putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthClientResponseBackChannelLogoutLogoutInitiator oauthClientResponseBackChannelLogoutLogoutInitiator = (OAuthClientResponseBackChannelLogoutLogoutInitiator) o; + return Objects.equals(this.mode, oauthClientResponseBackChannelLogoutLogoutInitiator.mode) && + Objects.equals(this.intiators, oauthClientResponseBackChannelLogoutLogoutInitiator.intiators)&& + Objects.equals(this.additionalProperties, oauthClientResponseBackChannelLogoutLogoutInitiator.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(mode, intiators, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthClientResponseBackChannelLogoutLogoutInitiator {\n"); + sb.append(" mode: ").append(toIndentedString(mode)).append("\n"); + sb.append(" intiators: ").append(toIndentedString(intiators)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Mode"); + openapiFields.add("Intiators"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OAuthClientResponseBackChannelLogoutLogoutInitiator + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthClientResponseBackChannelLogoutLogoutInitiator.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthClientResponseBackChannelLogoutLogoutInitiator is not found in the empty JSON string", OAuthClientResponseBackChannelLogoutLogoutInitiator.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Mode") != null && !jsonObj.get("Mode").isJsonNull()) && !jsonObj.get("Mode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Mode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Mode").toString())); + } + // validate the optional field `Intiators` + if (jsonObj.get("Intiators") != null && !jsonObj.get("Intiators").isJsonNull()) { + OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators.validateJsonElement(jsonObj.get("Intiators")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthClientResponseBackChannelLogoutLogoutInitiator.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthClientResponseBackChannelLogoutLogoutInitiator' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthClientResponseBackChannelLogoutLogoutInitiator> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthClientResponseBackChannelLogoutLogoutInitiator.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthClientResponseBackChannelLogoutLogoutInitiator>() { + @Override + public void write(JsonWriter out, OAuthClientResponseBackChannelLogoutLogoutInitiator value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthClientResponseBackChannelLogoutLogoutInitiator read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthClientResponseBackChannelLogoutLogoutInitiator instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthClientResponseBackChannelLogoutLogoutInitiator given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthClientResponseBackChannelLogoutLogoutInitiator + * @throws IOException if the JSON string is invalid with respect to OAuthClientResponseBackChannelLogoutLogoutInitiator + */ + public static OAuthClientResponseBackChannelLogoutLogoutInitiator fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthClientResponseBackChannelLogoutLogoutInitiator.class); + } + + /** + * Convert an instance of OAuthClientResponseBackChannelLogoutLogoutInitiator to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators.java new file mode 100644 index 0000000..f3ff653 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators.java @@ -0,0 +1,365 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators { + public static final String SERIALIZED_NAME_RP_LOGOUT = "RPLogout"; + @SerializedName(SERIALIZED_NAME_RP_LOGOUT) + @javax.annotation.Nullable + private Boolean rpLogout; + + public static final String SERIALIZED_NAME_ID_P_LOGOUT = "IDPLogout"; + @SerializedName(SERIALIZED_NAME_ID_P_LOGOUT) + @javax.annotation.Nullable + private Boolean idPLogout; + + public static final String SERIALIZED_NAME_PASSWORD_CHANGE = "PasswordChange"; + @SerializedName(SERIALIZED_NAME_PASSWORD_CHANGE) + @javax.annotation.Nullable + private Boolean passwordChange; + + public static final String SERIALIZED_NAME_ACCOUNT_DELETE = "AccountDelete"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_DELETE) + @javax.annotation.Nullable + private Boolean accountDelete; + + public OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators() { + } + + public OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators rpLogout(@javax.annotation.Nullable Boolean rpLogout) { + this.rpLogout = rpLogout; + return this; + } + + /** + * Get rpLogout + * @return rpLogout + */ + @javax.annotation.Nullable + public Boolean getRpLogout() { + return rpLogout; + } + + public void setRpLogout(@javax.annotation.Nullable Boolean rpLogout) { + this.rpLogout = rpLogout; + } + + + public OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators idPLogout(@javax.annotation.Nullable Boolean idPLogout) { + this.idPLogout = idPLogout; + return this; + } + + /** + * Get idPLogout + * @return idPLogout + */ + @javax.annotation.Nullable + public Boolean getIdPLogout() { + return idPLogout; + } + + public void setIdPLogout(@javax.annotation.Nullable Boolean idPLogout) { + this.idPLogout = idPLogout; + } + + + public OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators passwordChange(@javax.annotation.Nullable Boolean passwordChange) { + this.passwordChange = passwordChange; + return this; + } + + /** + * Get passwordChange + * @return passwordChange + */ + @javax.annotation.Nullable + public Boolean getPasswordChange() { + return passwordChange; + } + + public void setPasswordChange(@javax.annotation.Nullable Boolean passwordChange) { + this.passwordChange = passwordChange; + } + + + public OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators accountDelete(@javax.annotation.Nullable Boolean accountDelete) { + this.accountDelete = accountDelete; + return this; + } + + /** + * Get accountDelete + * @return accountDelete + */ + @javax.annotation.Nullable + public Boolean getAccountDelete() { + return accountDelete; + } + + public void setAccountDelete(@javax.annotation.Nullable Boolean accountDelete) { + this.accountDelete = accountDelete; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators instance itself + */ + public OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators oauthClientResponseBackChannelLogoutLogoutInitiatorIntiators = (OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators) o; + return Objects.equals(this.rpLogout, oauthClientResponseBackChannelLogoutLogoutInitiatorIntiators.rpLogout) && + Objects.equals(this.idPLogout, oauthClientResponseBackChannelLogoutLogoutInitiatorIntiators.idPLogout) && + Objects.equals(this.passwordChange, oauthClientResponseBackChannelLogoutLogoutInitiatorIntiators.passwordChange) && + Objects.equals(this.accountDelete, oauthClientResponseBackChannelLogoutLogoutInitiatorIntiators.accountDelete)&& + Objects.equals(this.additionalProperties, oauthClientResponseBackChannelLogoutLogoutInitiatorIntiators.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(rpLogout, idPLogout, passwordChange, accountDelete, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators {\n"); + sb.append(" rpLogout: ").append(toIndentedString(rpLogout)).append("\n"); + sb.append(" idPLogout: ").append(toIndentedString(idPLogout)).append("\n"); + sb.append(" passwordChange: ").append(toIndentedString(passwordChange)).append("\n"); + sb.append(" accountDelete: ").append(toIndentedString(accountDelete)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("RPLogout"); + openapiFields.add("IDPLogout"); + openapiFields.add("PasswordChange"); + openapiFields.add("AccountDelete"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators is not found in the empty JSON string", OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators>() { + @Override + public void write(JsonWriter out, OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators + * @throws IOException if the JSON string is invalid with respect to OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators + */ + public static OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators.class); + } + + /** + * Convert an instance of OAuthClientResponseBackChannelLogoutLogoutInitiatorIntiators to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientResponseConnections.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientResponseConnections.java new file mode 100644 index 0000000..ef46e44 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientResponseConnections.java @@ -0,0 +1,493 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.OAuthIntegrationBaseModelConnectionsPasswordLessLogin; +import com.loginradius.sdk.internal.openapi.model.OAuthIntegrationBaseModelConnectionsSocialLoginsInner; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuthClientResponseConnections + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthClientResponseConnections { + public static final String SERIALIZED_NAME_ENABLED = "Enabled"; + @SerializedName(SERIALIZED_NAME_ENABLED) + @javax.annotation.Nullable + private Boolean enabled; + + public static final String SERIALIZED_NAME_PASSWORDLESS_LOGIN = "PasswordlessLogin"; + @SerializedName(SERIALIZED_NAME_PASSWORDLESS_LOGIN) + @javax.annotation.Nullable + private OAuthIntegrationBaseModelConnectionsPasswordLessLogin passwordlessLogin; + + public static final String SERIALIZED_NAME_TRADITIONAL_LOGIN = "TraditionalLogin"; + @SerializedName(SERIALIZED_NAME_TRADITIONAL_LOGIN) + @javax.annotation.Nullable + private Boolean traditionalLogin; + + public static final String SERIALIZED_NAME_SOCIAL_LOGINS = "SocialLogins"; + @SerializedName(SERIALIZED_NAME_SOCIAL_LOGINS) + @javax.annotation.Nullable + private List<OAuthIntegrationBaseModelConnectionsSocialLoginsInner> socialLogins = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CUSTOM_IDP = "CustomIdp"; + @SerializedName(SERIALIZED_NAME_CUSTOM_IDP) + @javax.annotation.Nullable + private List<OAuthIntegrationBaseModelConnectionsSocialLoginsInner> customIdp = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ENTERPRISE = "Enterprise"; + @SerializedName(SERIALIZED_NAME_ENTERPRISE) + @javax.annotation.Nullable + private List<OAuthIntegrationBaseModelConnectionsSocialLoginsInner> enterprise = new ArrayList<>(); + + public OAuthClientResponseConnections() { + } + + public OAuthClientResponseConnections enabled(@javax.annotation.Nullable Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get enabled + * @return enabled + */ + @javax.annotation.Nullable + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(@javax.annotation.Nullable Boolean enabled) { + this.enabled = enabled; + } + + + public OAuthClientResponseConnections passwordlessLogin(@javax.annotation.Nullable OAuthIntegrationBaseModelConnectionsPasswordLessLogin passwordlessLogin) { + this.passwordlessLogin = passwordlessLogin; + return this; + } + + /** + * Get passwordlessLogin + * @return passwordlessLogin + */ + @javax.annotation.Nullable + public OAuthIntegrationBaseModelConnectionsPasswordLessLogin getPasswordlessLogin() { + return passwordlessLogin; + } + + public void setPasswordlessLogin(@javax.annotation.Nullable OAuthIntegrationBaseModelConnectionsPasswordLessLogin passwordlessLogin) { + this.passwordlessLogin = passwordlessLogin; + } + + + public OAuthClientResponseConnections traditionalLogin(@javax.annotation.Nullable Boolean traditionalLogin) { + this.traditionalLogin = traditionalLogin; + return this; + } + + /** + * Get traditionalLogin + * @return traditionalLogin + */ + @javax.annotation.Nullable + public Boolean getTraditionalLogin() { + return traditionalLogin; + } + + public void setTraditionalLogin(@javax.annotation.Nullable Boolean traditionalLogin) { + this.traditionalLogin = traditionalLogin; + } + + + public OAuthClientResponseConnections socialLogins(@javax.annotation.Nullable List<OAuthIntegrationBaseModelConnectionsSocialLoginsInner> socialLogins) { + this.socialLogins = socialLogins; + return this; + } + + public OAuthClientResponseConnections addSocialLoginsItem(OAuthIntegrationBaseModelConnectionsSocialLoginsInner socialLoginsItem) { + if (this.socialLogins == null) { + this.socialLogins = new ArrayList<>(); + } + this.socialLogins.add(socialLoginsItem); + return this; + } + + /** + * Get socialLogins + * @return socialLogins + */ + @javax.annotation.Nullable + public List<OAuthIntegrationBaseModelConnectionsSocialLoginsInner> getSocialLogins() { + return socialLogins; + } + + public void setSocialLogins(@javax.annotation.Nullable List<OAuthIntegrationBaseModelConnectionsSocialLoginsInner> socialLogins) { + this.socialLogins = socialLogins; + } + + + public OAuthClientResponseConnections customIdp(@javax.annotation.Nullable List<OAuthIntegrationBaseModelConnectionsSocialLoginsInner> customIdp) { + this.customIdp = customIdp; + return this; + } + + public OAuthClientResponseConnections addCustomIdpItem(OAuthIntegrationBaseModelConnectionsSocialLoginsInner customIdpItem) { + if (this.customIdp == null) { + this.customIdp = new ArrayList<>(); + } + this.customIdp.add(customIdpItem); + return this; + } + + /** + * Get customIdp + * @return customIdp + */ + @javax.annotation.Nullable + public List<OAuthIntegrationBaseModelConnectionsSocialLoginsInner> getCustomIdp() { + return customIdp; + } + + public void setCustomIdp(@javax.annotation.Nullable List<OAuthIntegrationBaseModelConnectionsSocialLoginsInner> customIdp) { + this.customIdp = customIdp; + } + + + public OAuthClientResponseConnections enterprise(@javax.annotation.Nullable List<OAuthIntegrationBaseModelConnectionsSocialLoginsInner> enterprise) { + this.enterprise = enterprise; + return this; + } + + public OAuthClientResponseConnections addEnterpriseItem(OAuthIntegrationBaseModelConnectionsSocialLoginsInner enterpriseItem) { + if (this.enterprise == null) { + this.enterprise = new ArrayList<>(); + } + this.enterprise.add(enterpriseItem); + return this; + } + + /** + * Get enterprise + * @return enterprise + */ + @javax.annotation.Nullable + public List<OAuthIntegrationBaseModelConnectionsSocialLoginsInner> getEnterprise() { + return enterprise; + } + + public void setEnterprise(@javax.annotation.Nullable List<OAuthIntegrationBaseModelConnectionsSocialLoginsInner> enterprise) { + this.enterprise = enterprise; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthClientResponseConnections instance itself + */ + public OAuthClientResponseConnections putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthClientResponseConnections oauthClientResponseConnections = (OAuthClientResponseConnections) o; + return Objects.equals(this.enabled, oauthClientResponseConnections.enabled) && + Objects.equals(this.passwordlessLogin, oauthClientResponseConnections.passwordlessLogin) && + Objects.equals(this.traditionalLogin, oauthClientResponseConnections.traditionalLogin) && + Objects.equals(this.socialLogins, oauthClientResponseConnections.socialLogins) && + Objects.equals(this.customIdp, oauthClientResponseConnections.customIdp) && + Objects.equals(this.enterprise, oauthClientResponseConnections.enterprise)&& + Objects.equals(this.additionalProperties, oauthClientResponseConnections.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(enabled, passwordlessLogin, traditionalLogin, socialLogins, customIdp, enterprise, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthClientResponseConnections {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" passwordlessLogin: ").append(toIndentedString(passwordlessLogin)).append("\n"); + sb.append(" traditionalLogin: ").append(toIndentedString(traditionalLogin)).append("\n"); + sb.append(" socialLogins: ").append(toIndentedString(socialLogins)).append("\n"); + sb.append(" customIdp: ").append(toIndentedString(customIdp)).append("\n"); + sb.append(" enterprise: ").append(toIndentedString(enterprise)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Enabled"); + openapiFields.add("PasswordlessLogin"); + openapiFields.add("TraditionalLogin"); + openapiFields.add("SocialLogins"); + openapiFields.add("CustomIdp"); + openapiFields.add("Enterprise"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OAuthClientResponseConnections + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthClientResponseConnections.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthClientResponseConnections is not found in the empty JSON string", OAuthClientResponseConnections.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `PasswordlessLogin` + if (jsonObj.get("PasswordlessLogin") != null && !jsonObj.get("PasswordlessLogin").isJsonNull()) { + OAuthIntegrationBaseModelConnectionsPasswordLessLogin.validateJsonElement(jsonObj.get("PasswordlessLogin")); + } + if (jsonObj.get("SocialLogins") != null && !jsonObj.get("SocialLogins").isJsonNull()) { + JsonArray jsonArraysocialLogins = jsonObj.getAsJsonArray("SocialLogins"); + if (jsonArraysocialLogins != null) { + // ensure the json data is an array + if (!jsonObj.get("SocialLogins").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `SocialLogins` to be an array in the JSON string but got `%s`", jsonObj.get("SocialLogins").toString())); + } + + // validate the optional field `SocialLogins` (array) + for (int i = 0; i < jsonArraysocialLogins.size(); i++) { + OAuthIntegrationBaseModelConnectionsSocialLoginsInner.validateJsonElement(jsonArraysocialLogins.get(i)); + }; + } + } + if (jsonObj.get("CustomIdp") != null && !jsonObj.get("CustomIdp").isJsonNull()) { + JsonArray jsonArraycustomIdp = jsonObj.getAsJsonArray("CustomIdp"); + if (jsonArraycustomIdp != null) { + // ensure the json data is an array + if (!jsonObj.get("CustomIdp").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `CustomIdp` to be an array in the JSON string but got `%s`", jsonObj.get("CustomIdp").toString())); + } + + // validate the optional field `CustomIdp` (array) + for (int i = 0; i < jsonArraycustomIdp.size(); i++) { + OAuthIntegrationBaseModelConnectionsSocialLoginsInner.validateJsonElement(jsonArraycustomIdp.get(i)); + }; + } + } + if (jsonObj.get("Enterprise") != null && !jsonObj.get("Enterprise").isJsonNull()) { + JsonArray jsonArrayenterprise = jsonObj.getAsJsonArray("Enterprise"); + if (jsonArrayenterprise != null) { + // ensure the json data is an array + if (!jsonObj.get("Enterprise").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Enterprise` to be an array in the JSON string but got `%s`", jsonObj.get("Enterprise").toString())); + } + + // validate the optional field `Enterprise` (array) + for (int i = 0; i < jsonArrayenterprise.size(); i++) { + OAuthIntegrationBaseModelConnectionsSocialLoginsInner.validateJsonElement(jsonArrayenterprise.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthClientResponseConnections.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthClientResponseConnections' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthClientResponseConnections> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthClientResponseConnections.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthClientResponseConnections>() { + @Override + public void write(JsonWriter out, OAuthClientResponseConnections value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthClientResponseConnections read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthClientResponseConnections instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthClientResponseConnections given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthClientResponseConnections + * @throws IOException if the JSON string is invalid with respect to OAuthClientResponseConnections + */ + public static OAuthClientResponseConnections fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthClientResponseConnections.class); + } + + /** + * Convert an instance of OAuthClientResponseConnections to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientResponseDeviceCodeConfig.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientResponseDeviceCodeConfig.java new file mode 100644 index 0000000..b7dbea3 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientResponseDeviceCodeConfig.java @@ -0,0 +1,491 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuthClientResponseDeviceCodeConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthClientResponseDeviceCodeConfig { + public static final String SERIALIZED_NAME_AFTER_VERIFICATION_URL = "AfterVerificationUrl"; + @SerializedName(SERIALIZED_NAME_AFTER_VERIFICATION_URL) + @javax.annotation.Nullable + private String afterVerificationUrl; + + public static final String SERIALIZED_NAME_DEVICE_CODE_EXPIRE = "DeviceCodeExpire"; + @SerializedName(SERIALIZED_NAME_DEVICE_CODE_EXPIRE) + @javax.annotation.Nullable + private Integer deviceCodeExpire; + + public static final String SERIALIZED_NAME_POLLING_INTERVAL = "PollingInterval"; + @SerializedName(SERIALIZED_NAME_POLLING_INTERVAL) + @javax.annotation.Nullable + private Integer pollingInterval; + + /** + * Gets or Sets userCodeCharacterSet + */ + @JsonAdapter(UserCodeCharacterSetEnum.Adapter.class) + public enum UserCodeCharacterSetEnum { + BASE20("Base20"), + + ALPHA("Alpha"), + + DIGITS("Digits"), + + ALPHANUMERIC("Alphanumeric"); + + private String value; + + UserCodeCharacterSetEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static UserCodeCharacterSetEnum fromValue(String value) { + for (UserCodeCharacterSetEnum b : UserCodeCharacterSetEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<UserCodeCharacterSetEnum> { + @Override + public void write(final JsonWriter jsonWriter, final UserCodeCharacterSetEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public UserCodeCharacterSetEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return UserCodeCharacterSetEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + UserCodeCharacterSetEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_USER_CODE_CHARACTER_SET = "UserCodeCharacterSet"; + @SerializedName(SERIALIZED_NAME_USER_CODE_CHARACTER_SET) + @javax.annotation.Nullable + private UserCodeCharacterSetEnum userCodeCharacterSet; + + public static final String SERIALIZED_NAME_USER_CODE_MASK = "UserCodeMask"; + @SerializedName(SERIALIZED_NAME_USER_CODE_MASK) + @javax.annotation.Nullable + private String userCodeMask; + + public static final String SERIALIZED_NAME_VERIFICATION_URL = "VerificationUrl"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_URL) + @javax.annotation.Nullable + private String verificationUrl; + + public OAuthClientResponseDeviceCodeConfig() { + } + + public OAuthClientResponseDeviceCodeConfig afterVerificationUrl(@javax.annotation.Nullable String afterVerificationUrl) { + this.afterVerificationUrl = afterVerificationUrl; + return this; + } + + /** + * Get afterVerificationUrl + * @return afterVerificationUrl + */ + @javax.annotation.Nullable + public String getAfterVerificationUrl() { + return afterVerificationUrl; + } + + public void setAfterVerificationUrl(@javax.annotation.Nullable String afterVerificationUrl) { + this.afterVerificationUrl = afterVerificationUrl; + } + + + public OAuthClientResponseDeviceCodeConfig deviceCodeExpire(@javax.annotation.Nullable Integer deviceCodeExpire) { + this.deviceCodeExpire = deviceCodeExpire; + return this; + } + + /** + * Get deviceCodeExpire + * @return deviceCodeExpire + */ + @javax.annotation.Nullable + public Integer getDeviceCodeExpire() { + return deviceCodeExpire; + } + + public void setDeviceCodeExpire(@javax.annotation.Nullable Integer deviceCodeExpire) { + this.deviceCodeExpire = deviceCodeExpire; + } + + + public OAuthClientResponseDeviceCodeConfig pollingInterval(@javax.annotation.Nullable Integer pollingInterval) { + this.pollingInterval = pollingInterval; + return this; + } + + /** + * Get pollingInterval + * @return pollingInterval + */ + @javax.annotation.Nullable + public Integer getPollingInterval() { + return pollingInterval; + } + + public void setPollingInterval(@javax.annotation.Nullable Integer pollingInterval) { + this.pollingInterval = pollingInterval; + } + + + public OAuthClientResponseDeviceCodeConfig userCodeCharacterSet(@javax.annotation.Nullable UserCodeCharacterSetEnum userCodeCharacterSet) { + this.userCodeCharacterSet = userCodeCharacterSet; + return this; + } + + /** + * Get userCodeCharacterSet + * @return userCodeCharacterSet + */ + @javax.annotation.Nullable + public UserCodeCharacterSetEnum getUserCodeCharacterSet() { + return userCodeCharacterSet; + } + + public void setUserCodeCharacterSet(@javax.annotation.Nullable UserCodeCharacterSetEnum userCodeCharacterSet) { + this.userCodeCharacterSet = userCodeCharacterSet; + } + + + public OAuthClientResponseDeviceCodeConfig userCodeMask(@javax.annotation.Nullable String userCodeMask) { + this.userCodeMask = userCodeMask; + return this; + } + + /** + * Get userCodeMask + * @return userCodeMask + */ + @javax.annotation.Nullable + public String getUserCodeMask() { + return userCodeMask; + } + + public void setUserCodeMask(@javax.annotation.Nullable String userCodeMask) { + this.userCodeMask = userCodeMask; + } + + + public OAuthClientResponseDeviceCodeConfig verificationUrl(@javax.annotation.Nullable String verificationUrl) { + this.verificationUrl = verificationUrl; + return this; + } + + /** + * Get verificationUrl + * @return verificationUrl + */ + @javax.annotation.Nullable + public String getVerificationUrl() { + return verificationUrl; + } + + public void setVerificationUrl(@javax.annotation.Nullable String verificationUrl) { + this.verificationUrl = verificationUrl; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthClientResponseDeviceCodeConfig instance itself + */ + public OAuthClientResponseDeviceCodeConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthClientResponseDeviceCodeConfig oauthClientResponseDeviceCodeConfig = (OAuthClientResponseDeviceCodeConfig) o; + return Objects.equals(this.afterVerificationUrl, oauthClientResponseDeviceCodeConfig.afterVerificationUrl) && + Objects.equals(this.deviceCodeExpire, oauthClientResponseDeviceCodeConfig.deviceCodeExpire) && + Objects.equals(this.pollingInterval, oauthClientResponseDeviceCodeConfig.pollingInterval) && + Objects.equals(this.userCodeCharacterSet, oauthClientResponseDeviceCodeConfig.userCodeCharacterSet) && + Objects.equals(this.userCodeMask, oauthClientResponseDeviceCodeConfig.userCodeMask) && + Objects.equals(this.verificationUrl, oauthClientResponseDeviceCodeConfig.verificationUrl)&& + Objects.equals(this.additionalProperties, oauthClientResponseDeviceCodeConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(afterVerificationUrl, deviceCodeExpire, pollingInterval, userCodeCharacterSet, userCodeMask, verificationUrl, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthClientResponseDeviceCodeConfig {\n"); + sb.append(" afterVerificationUrl: ").append(toIndentedString(afterVerificationUrl)).append("\n"); + sb.append(" deviceCodeExpire: ").append(toIndentedString(deviceCodeExpire)).append("\n"); + sb.append(" pollingInterval: ").append(toIndentedString(pollingInterval)).append("\n"); + sb.append(" userCodeCharacterSet: ").append(toIndentedString(userCodeCharacterSet)).append("\n"); + sb.append(" userCodeMask: ").append(toIndentedString(userCodeMask)).append("\n"); + sb.append(" verificationUrl: ").append(toIndentedString(verificationUrl)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AfterVerificationUrl"); + openapiFields.add("DeviceCodeExpire"); + openapiFields.add("PollingInterval"); + openapiFields.add("UserCodeCharacterSet"); + openapiFields.add("UserCodeMask"); + openapiFields.add("VerificationUrl"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OAuthClientResponseDeviceCodeConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthClientResponseDeviceCodeConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthClientResponseDeviceCodeConfig is not found in the empty JSON string", OAuthClientResponseDeviceCodeConfig.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("AfterVerificationUrl") != null && !jsonObj.get("AfterVerificationUrl").isJsonNull()) && !jsonObj.get("AfterVerificationUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AfterVerificationUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AfterVerificationUrl").toString())); + } + if ((jsonObj.get("UserCodeCharacterSet") != null && !jsonObj.get("UserCodeCharacterSet").isJsonNull()) && !jsonObj.get("UserCodeCharacterSet").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UserCodeCharacterSet` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UserCodeCharacterSet").toString())); + } + // validate the optional field `UserCodeCharacterSet` + if (jsonObj.get("UserCodeCharacterSet") != null && !jsonObj.get("UserCodeCharacterSet").isJsonNull()) { + UserCodeCharacterSetEnum.validateJsonElement(jsonObj.get("UserCodeCharacterSet")); + } + if ((jsonObj.get("UserCodeMask") != null && !jsonObj.get("UserCodeMask").isJsonNull()) && !jsonObj.get("UserCodeMask").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UserCodeMask` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UserCodeMask").toString())); + } + if ((jsonObj.get("VerificationUrl") != null && !jsonObj.get("VerificationUrl").isJsonNull()) && !jsonObj.get("VerificationUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `VerificationUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("VerificationUrl").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthClientResponseDeviceCodeConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthClientResponseDeviceCodeConfig' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthClientResponseDeviceCodeConfig> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthClientResponseDeviceCodeConfig.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthClientResponseDeviceCodeConfig>() { + @Override + public void write(JsonWriter out, OAuthClientResponseDeviceCodeConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthClientResponseDeviceCodeConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthClientResponseDeviceCodeConfig instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthClientResponseDeviceCodeConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthClientResponseDeviceCodeConfig + * @throws IOException if the JSON string is invalid with respect to OAuthClientResponseDeviceCodeConfig + */ + public static OAuthClientResponseDeviceCodeConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthClientResponseDeviceCodeConfig.class); + } + + /** + * Convert an instance of OAuthClientResponseDeviceCodeConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientResponseJwtTokenConfig.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientResponseJwtTokenConfig.java new file mode 100644 index 0000000..63364b6 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientResponseJwtTokenConfig.java @@ -0,0 +1,341 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuthClientResponseJwtTokenConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthClientResponseJwtTokenConfig { + public static final String SERIALIZED_NAME_ALGORITHM = "Algorithm"; + @SerializedName(SERIALIZED_NAME_ALGORITHM) + @javax.annotation.Nullable + private String algorithm; + + public static final String SERIALIZED_NAME_ID_TOKEN_T_T_L = "IdTokenTTL"; + @SerializedName(SERIALIZED_NAME_ID_TOKEN_T_T_L) + @javax.annotation.Nullable + private Integer idTokenTTL; + + public static final String SERIALIZED_NAME_TOKEN_T_T_L = "TokenTTL"; + @SerializedName(SERIALIZED_NAME_TOKEN_T_T_L) + @javax.annotation.Nullable + private Integer tokenTTL; + + public OAuthClientResponseJwtTokenConfig() { + } + + public OAuthClientResponseJwtTokenConfig algorithm(@javax.annotation.Nullable String algorithm) { + this.algorithm = algorithm; + return this; + } + + /** + * Get algorithm + * @return algorithm + */ + @javax.annotation.Nullable + public String getAlgorithm() { + return algorithm; + } + + public void setAlgorithm(@javax.annotation.Nullable String algorithm) { + this.algorithm = algorithm; + } + + + public OAuthClientResponseJwtTokenConfig idTokenTTL(@javax.annotation.Nullable Integer idTokenTTL) { + this.idTokenTTL = idTokenTTL; + return this; + } + + /** + * Get idTokenTTL + * @return idTokenTTL + */ + @javax.annotation.Nullable + public Integer getIdTokenTTL() { + return idTokenTTL; + } + + public void setIdTokenTTL(@javax.annotation.Nullable Integer idTokenTTL) { + this.idTokenTTL = idTokenTTL; + } + + + public OAuthClientResponseJwtTokenConfig tokenTTL(@javax.annotation.Nullable Integer tokenTTL) { + this.tokenTTL = tokenTTL; + return this; + } + + /** + * Get tokenTTL + * @return tokenTTL + */ + @javax.annotation.Nullable + public Integer getTokenTTL() { + return tokenTTL; + } + + public void setTokenTTL(@javax.annotation.Nullable Integer tokenTTL) { + this.tokenTTL = tokenTTL; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthClientResponseJwtTokenConfig instance itself + */ + public OAuthClientResponseJwtTokenConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthClientResponseJwtTokenConfig oauthClientResponseJwtTokenConfig = (OAuthClientResponseJwtTokenConfig) o; + return Objects.equals(this.algorithm, oauthClientResponseJwtTokenConfig.algorithm) && + Objects.equals(this.idTokenTTL, oauthClientResponseJwtTokenConfig.idTokenTTL) && + Objects.equals(this.tokenTTL, oauthClientResponseJwtTokenConfig.tokenTTL)&& + Objects.equals(this.additionalProperties, oauthClientResponseJwtTokenConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(algorithm, idTokenTTL, tokenTTL, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthClientResponseJwtTokenConfig {\n"); + sb.append(" algorithm: ").append(toIndentedString(algorithm)).append("\n"); + sb.append(" idTokenTTL: ").append(toIndentedString(idTokenTTL)).append("\n"); + sb.append(" tokenTTL: ").append(toIndentedString(tokenTTL)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Algorithm"); + openapiFields.add("IdTokenTTL"); + openapiFields.add("TokenTTL"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OAuthClientResponseJwtTokenConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthClientResponseJwtTokenConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthClientResponseJwtTokenConfig is not found in the empty JSON string", OAuthClientResponseJwtTokenConfig.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Algorithm") != null && !jsonObj.get("Algorithm").isJsonNull()) && !jsonObj.get("Algorithm").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Algorithm` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Algorithm").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthClientResponseJwtTokenConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthClientResponseJwtTokenConfig' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthClientResponseJwtTokenConfig> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthClientResponseJwtTokenConfig.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthClientResponseJwtTokenConfig>() { + @Override + public void write(JsonWriter out, OAuthClientResponseJwtTokenConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthClientResponseJwtTokenConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthClientResponseJwtTokenConfig instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthClientResponseJwtTokenConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthClientResponseJwtTokenConfig + * @throws IOException if the JSON string is invalid with respect to OAuthClientResponseJwtTokenConfig + */ + public static OAuthClientResponseJwtTokenConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthClientResponseJwtTokenConfig.class); + } + + /** + * Convert an instance of OAuthClientResponseJwtTokenConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientResponseRefreshTokenRotation.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientResponseRefreshTokenRotation.java new file mode 100644 index 0000000..a6fe8f3 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientResponseRefreshTokenRotation.java @@ -0,0 +1,286 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuthClientResponseRefreshTokenRotation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthClientResponseRefreshTokenRotation { + public static final String SERIALIZED_NAME_REUSE_INTERVAL = "ReuseInterval"; + @SerializedName(SERIALIZED_NAME_REUSE_INTERVAL) + @javax.annotation.Nullable + private Integer reuseInterval; + + public OAuthClientResponseRefreshTokenRotation() { + } + + public OAuthClientResponseRefreshTokenRotation reuseInterval(@javax.annotation.Nullable Integer reuseInterval) { + this.reuseInterval = reuseInterval; + return this; + } + + /** + * Get reuseInterval + * minimum: 0 + * maximum: 60 + * @return reuseInterval + */ + @javax.annotation.Nullable + public Integer getReuseInterval() { + return reuseInterval; + } + + public void setReuseInterval(@javax.annotation.Nullable Integer reuseInterval) { + this.reuseInterval = reuseInterval; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthClientResponseRefreshTokenRotation instance itself + */ + public OAuthClientResponseRefreshTokenRotation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthClientResponseRefreshTokenRotation oauthClientResponseRefreshTokenRotation = (OAuthClientResponseRefreshTokenRotation) o; + return Objects.equals(this.reuseInterval, oauthClientResponseRefreshTokenRotation.reuseInterval)&& + Objects.equals(this.additionalProperties, oauthClientResponseRefreshTokenRotation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(reuseInterval, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthClientResponseRefreshTokenRotation {\n"); + sb.append(" reuseInterval: ").append(toIndentedString(reuseInterval)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ReuseInterval"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OAuthClientResponseRefreshTokenRotation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthClientResponseRefreshTokenRotation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthClientResponseRefreshTokenRotation is not found in the empty JSON string", OAuthClientResponseRefreshTokenRotation.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthClientResponseRefreshTokenRotation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthClientResponseRefreshTokenRotation' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthClientResponseRefreshTokenRotation> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthClientResponseRefreshTokenRotation.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthClientResponseRefreshTokenRotation>() { + @Override + public void write(JsonWriter out, OAuthClientResponseRefreshTokenRotation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthClientResponseRefreshTokenRotation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthClientResponseRefreshTokenRotation instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthClientResponseRefreshTokenRotation given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthClientResponseRefreshTokenRotation + * @throws IOException if the JSON string is invalid with respect to OAuthClientResponseRefreshTokenRotation + */ + public static OAuthClientResponseRefreshTokenRotation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthClientResponseRefreshTokenRotation.class); + } + + /** + * Convert an instance of OAuthClientResponseRefreshTokenRotation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientSecretResetResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientSecretResetResponse.java new file mode 100644 index 0000000..5986d95 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthClientSecretResetResponse.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuthClientSecretResetResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthClientSecretResetResponse { + public static final String SERIALIZED_NAME_CLIENT_ID = "ClientId"; + @SerializedName(SERIALIZED_NAME_CLIENT_ID) + @javax.annotation.Nullable + private String clientId; + + public static final String SERIALIZED_NAME_CLIENT_SECRET = "ClientSecret"; + @SerializedName(SERIALIZED_NAME_CLIENT_SECRET) + @javax.annotation.Nullable + private String clientSecret; + + public OAuthClientSecretResetResponse() { + } + + public OAuthClientSecretResetResponse clientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get clientId + * @return clientId + */ + @javax.annotation.Nullable + public String getClientId() { + return clientId; + } + + public void setClientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + } + + + public OAuthClientSecretResetResponse clientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get clientSecret + * @return clientSecret + */ + @javax.annotation.Nullable + public String getClientSecret() { + return clientSecret; + } + + public void setClientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthClientSecretResetResponse instance itself + */ + public OAuthClientSecretResetResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthClientSecretResetResponse oauthClientSecretResetResponse = (OAuthClientSecretResetResponse) o; + return Objects.equals(this.clientId, oauthClientSecretResetResponse.clientId) && + Objects.equals(this.clientSecret, oauthClientSecretResetResponse.clientSecret)&& + Objects.equals(this.additionalProperties, oauthClientSecretResetResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, clientSecret, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthClientSecretResetResponse {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ClientId"); + openapiFields.add("ClientSecret"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OAuthClientSecretResetResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthClientSecretResetResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthClientSecretResetResponse is not found in the empty JSON string", OAuthClientSecretResetResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ClientId") != null && !jsonObj.get("ClientId").isJsonNull()) && !jsonObj.get("ClientId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ClientId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ClientId").toString())); + } + if ((jsonObj.get("ClientSecret") != null && !jsonObj.get("ClientSecret").isJsonNull()) && !jsonObj.get("ClientSecret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ClientSecret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ClientSecret").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthClientSecretResetResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthClientSecretResetResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthClientSecretResetResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthClientSecretResetResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthClientSecretResetResponse>() { + @Override + public void write(JsonWriter out, OAuthClientSecretResetResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthClientSecretResetResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthClientSecretResetResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthClientSecretResetResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthClientSecretResetResponse + * @throws IOException if the JSON string is invalid with respect to OAuthClientSecretResetResponse + */ + public static OAuthClientSecretResetResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthClientSecretResetResponse.class); + } + + /** + * Convert an instance of OAuthClientSecretResetResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthDeviceCode.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthDeviceCode.java new file mode 100644 index 0000000..0c710de --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthDeviceCode.java @@ -0,0 +1,325 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuth Device Code Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthDeviceCode { + public static final String SERIALIZED_NAME_CLIENT_ID = "client_id"; + @SerializedName(SERIALIZED_NAME_CLIENT_ID) + @javax.annotation.Nonnull + private String clientId; + + public static final String SERIALIZED_NAME_SCOPE = "scope"; + @SerializedName(SERIALIZED_NAME_SCOPE) + @javax.annotation.Nullable + private String scope; + + public OAuthDeviceCode() { + } + + public OAuthDeviceCode clientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get clientId + * @return clientId + */ + @javax.annotation.Nonnull + public String getClientId() { + return clientId; + } + + public void setClientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + } + + + public OAuthDeviceCode scope(@javax.annotation.Nullable String scope) { + this.scope = scope; + return this; + } + + /** + * Get scope + * @return scope + */ + @javax.annotation.Nullable + public String getScope() { + return scope; + } + + public void setScope(@javax.annotation.Nullable String scope) { + this.scope = scope; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthDeviceCode instance itself + */ + public OAuthDeviceCode putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthDeviceCode oauthDeviceCode = (OAuthDeviceCode) o; + return Objects.equals(this.clientId, oauthDeviceCode.clientId) && + Objects.equals(this.scope, oauthDeviceCode.scope)&& + Objects.equals(this.additionalProperties, oauthDeviceCode.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, scope, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthDeviceCode {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("client_id"); + openapiFields.add("scope"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("client_id"); + } + + /** + * 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 OAuthDeviceCode + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthDeviceCode.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthDeviceCode is not found in the empty JSON string", OAuthDeviceCode.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OAuthDeviceCode.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("client_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_id").toString())); + } + if ((jsonObj.get("scope") != null && !jsonObj.get("scope").isJsonNull()) && !jsonObj.get("scope").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scope").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthDeviceCode.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthDeviceCode' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthDeviceCode> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthDeviceCode.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthDeviceCode>() { + @Override + public void write(JsonWriter out, OAuthDeviceCode value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthDeviceCode read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthDeviceCode instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthDeviceCode given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthDeviceCode + * @throws IOException if the JSON string is invalid with respect to OAuthDeviceCode + */ + public static OAuthDeviceCode fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthDeviceCode.class); + } + + /** + * Convert an instance of OAuthDeviceCode to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthDeviceCodeFlow.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthDeviceCodeFlow.java new file mode 100644 index 0000000..02d8f45 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthDeviceCodeFlow.java @@ -0,0 +1,417 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * Device Code Flow + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthDeviceCodeFlow { + public static final String SERIALIZED_NAME_CLIENT_ID = "client_id"; + @SerializedName(SERIALIZED_NAME_CLIENT_ID) + @javax.annotation.Nonnull + private String clientId; + + public static final String SERIALIZED_NAME_DEVICE_CODE = "device_code"; + @SerializedName(SERIALIZED_NAME_DEVICE_CODE) + @javax.annotation.Nonnull + private String deviceCode; + + public static final String SERIALIZED_NAME_GRANT_TYPE = "grant_type"; + @SerializedName(SERIALIZED_NAME_GRANT_TYPE) + @javax.annotation.Nonnull + private String grantType = "urn:ietf:params:oauth:grant-type:device_code"; + + public static final String SERIALIZED_NAME_RESPONSE_TYPE = "response_type"; + @SerializedName(SERIALIZED_NAME_RESPONSE_TYPE) + @javax.annotation.Nullable + private String responseType = "token"; + + public static final String SERIALIZED_NAME_SCOPE = "scope"; + @SerializedName(SERIALIZED_NAME_SCOPE) + @javax.annotation.Nullable + private String scope; + + public OAuthDeviceCodeFlow() { + } + + public OAuthDeviceCodeFlow clientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get clientId + * @return clientId + */ + @javax.annotation.Nonnull + public String getClientId() { + return clientId; + } + + public void setClientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + } + + + public OAuthDeviceCodeFlow deviceCode(@javax.annotation.Nonnull String deviceCode) { + this.deviceCode = deviceCode; + return this; + } + + /** + * Get deviceCode + * @return deviceCode + */ + @javax.annotation.Nonnull + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(@javax.annotation.Nonnull String deviceCode) { + this.deviceCode = deviceCode; + } + + + public OAuthDeviceCodeFlow grantType(@javax.annotation.Nonnull String grantType) { + this.grantType = grantType; + return this; + } + + /** + * Get grantType + * @return grantType + */ + @javax.annotation.Nonnull + public String getGrantType() { + return grantType; + } + + public void setGrantType(@javax.annotation.Nonnull String grantType) { + this.grantType = grantType; + } + + + public OAuthDeviceCodeFlow responseType(@javax.annotation.Nullable String responseType) { + this.responseType = responseType; + return this; + } + + /** + * Get responseType + * @return responseType + */ + @javax.annotation.Nullable + public String getResponseType() { + return responseType; + } + + public void setResponseType(@javax.annotation.Nullable String responseType) { + this.responseType = responseType; + } + + + public OAuthDeviceCodeFlow scope(@javax.annotation.Nullable String scope) { + this.scope = scope; + return this; + } + + /** + * Get scope + * @return scope + */ + @javax.annotation.Nullable + public String getScope() { + return scope; + } + + public void setScope(@javax.annotation.Nullable String scope) { + this.scope = scope; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthDeviceCodeFlow instance itself + */ + public OAuthDeviceCodeFlow putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthDeviceCodeFlow oauthDeviceCodeFlow = (OAuthDeviceCodeFlow) o; + return Objects.equals(this.clientId, oauthDeviceCodeFlow.clientId) && + Objects.equals(this.deviceCode, oauthDeviceCodeFlow.deviceCode) && + Objects.equals(this.grantType, oauthDeviceCodeFlow.grantType) && + Objects.equals(this.responseType, oauthDeviceCodeFlow.responseType) && + Objects.equals(this.scope, oauthDeviceCodeFlow.scope)&& + Objects.equals(this.additionalProperties, oauthDeviceCodeFlow.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, deviceCode, grantType, responseType, scope, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthDeviceCodeFlow {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" deviceCode: ").append(toIndentedString(deviceCode)).append("\n"); + sb.append(" grantType: ").append(toIndentedString(grantType)).append("\n"); + sb.append(" responseType: ").append(toIndentedString(responseType)).append("\n"); + sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("client_id"); + openapiFields.add("device_code"); + openapiFields.add("grant_type"); + openapiFields.add("response_type"); + openapiFields.add("scope"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("client_id"); + openapiRequiredFields.add("device_code"); + openapiRequiredFields.add("grant_type"); + } + + /** + * 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 OAuthDeviceCodeFlow + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthDeviceCodeFlow.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthDeviceCodeFlow is not found in the empty JSON string", OAuthDeviceCodeFlow.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OAuthDeviceCodeFlow.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("client_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_id").toString())); + } + if (!jsonObj.get("device_code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `device_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("device_code").toString())); + } + if (!jsonObj.get("grant_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `grant_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("grant_type").toString())); + } + if ((jsonObj.get("response_type") != null && !jsonObj.get("response_type").isJsonNull()) && !jsonObj.get("response_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `response_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("response_type").toString())); + } + if ((jsonObj.get("scope") != null && !jsonObj.get("scope").isJsonNull()) && !jsonObj.get("scope").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scope").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthDeviceCodeFlow.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthDeviceCodeFlow' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthDeviceCodeFlow> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthDeviceCodeFlow.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthDeviceCodeFlow>() { + @Override + public void write(JsonWriter out, OAuthDeviceCodeFlow value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthDeviceCodeFlow read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthDeviceCodeFlow instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthDeviceCodeFlow given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthDeviceCodeFlow + * @throws IOException if the JSON string is invalid with respect to OAuthDeviceCodeFlow + */ + public static OAuthDeviceCodeFlow fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthDeviceCodeFlow.class); + } + + /** + * Convert an instance of OAuthDeviceCodeFlow to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthDeviceCodeResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthDeviceCodeResponse.java new file mode 100644 index 0000000..6125a51 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthDeviceCodeResponse.java @@ -0,0 +1,431 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuth Device Code Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthDeviceCodeResponse { + public static final String SERIALIZED_NAME_DEVICE_CODE = "device_code"; + @SerializedName(SERIALIZED_NAME_DEVICE_CODE) + @javax.annotation.Nullable + private String deviceCode; + + public static final String SERIALIZED_NAME_EXPIRES_IN = "expires_in"; + @SerializedName(SERIALIZED_NAME_EXPIRES_IN) + @javax.annotation.Nullable + private Integer expiresIn; + + public static final String SERIALIZED_NAME_INTERVAL = "interval"; + @SerializedName(SERIALIZED_NAME_INTERVAL) + @javax.annotation.Nullable + private Integer interval; + + public static final String SERIALIZED_NAME_USER_CODE = "user_code"; + @SerializedName(SERIALIZED_NAME_USER_CODE) + @javax.annotation.Nullable + private String userCode; + + public static final String SERIALIZED_NAME_VERIFICATION_URI = "verification_uri"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_URI) + @javax.annotation.Nullable + private String verificationUri; + + public static final String SERIALIZED_NAME_VERIFICATION_URI_COMPLETE = "verification_uri_complete"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_URI_COMPLETE) + @javax.annotation.Nullable + private String verificationUriComplete; + + public OAuthDeviceCodeResponse() { + } + + public OAuthDeviceCodeResponse deviceCode(@javax.annotation.Nullable String deviceCode) { + this.deviceCode = deviceCode; + return this; + } + + /** + * Get deviceCode + * @return deviceCode + */ + @javax.annotation.Nullable + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(@javax.annotation.Nullable String deviceCode) { + this.deviceCode = deviceCode; + } + + + public OAuthDeviceCodeResponse expiresIn(@javax.annotation.Nullable Integer expiresIn) { + this.expiresIn = expiresIn; + return this; + } + + /** + * Get expiresIn + * @return expiresIn + */ + @javax.annotation.Nullable + public Integer getExpiresIn() { + return expiresIn; + } + + public void setExpiresIn(@javax.annotation.Nullable Integer expiresIn) { + this.expiresIn = expiresIn; + } + + + public OAuthDeviceCodeResponse interval(@javax.annotation.Nullable Integer interval) { + this.interval = interval; + return this; + } + + /** + * Get interval + * @return interval + */ + @javax.annotation.Nullable + public Integer getInterval() { + return interval; + } + + public void setInterval(@javax.annotation.Nullable Integer interval) { + this.interval = interval; + } + + + public OAuthDeviceCodeResponse userCode(@javax.annotation.Nullable String userCode) { + this.userCode = userCode; + return this; + } + + /** + * Get userCode + * @return userCode + */ + @javax.annotation.Nullable + public String getUserCode() { + return userCode; + } + + public void setUserCode(@javax.annotation.Nullable String userCode) { + this.userCode = userCode; + } + + + public OAuthDeviceCodeResponse verificationUri(@javax.annotation.Nullable String verificationUri) { + this.verificationUri = verificationUri; + return this; + } + + /** + * Get verificationUri + * @return verificationUri + */ + @javax.annotation.Nullable + public String getVerificationUri() { + return verificationUri; + } + + public void setVerificationUri(@javax.annotation.Nullable String verificationUri) { + this.verificationUri = verificationUri; + } + + + public OAuthDeviceCodeResponse verificationUriComplete(@javax.annotation.Nullable String verificationUriComplete) { + this.verificationUriComplete = verificationUriComplete; + return this; + } + + /** + * Get verificationUriComplete + * @return verificationUriComplete + */ + @javax.annotation.Nullable + public String getVerificationUriComplete() { + return verificationUriComplete; + } + + public void setVerificationUriComplete(@javax.annotation.Nullable String verificationUriComplete) { + this.verificationUriComplete = verificationUriComplete; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthDeviceCodeResponse instance itself + */ + public OAuthDeviceCodeResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthDeviceCodeResponse oauthDeviceCodeResponse = (OAuthDeviceCodeResponse) o; + return Objects.equals(this.deviceCode, oauthDeviceCodeResponse.deviceCode) && + Objects.equals(this.expiresIn, oauthDeviceCodeResponse.expiresIn) && + Objects.equals(this.interval, oauthDeviceCodeResponse.interval) && + Objects.equals(this.userCode, oauthDeviceCodeResponse.userCode) && + Objects.equals(this.verificationUri, oauthDeviceCodeResponse.verificationUri) && + Objects.equals(this.verificationUriComplete, oauthDeviceCodeResponse.verificationUriComplete)&& + Objects.equals(this.additionalProperties, oauthDeviceCodeResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(deviceCode, expiresIn, interval, userCode, verificationUri, verificationUriComplete, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthDeviceCodeResponse {\n"); + sb.append(" deviceCode: ").append(toIndentedString(deviceCode)).append("\n"); + sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n"); + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append(" userCode: ").append(toIndentedString(userCode)).append("\n"); + sb.append(" verificationUri: ").append(toIndentedString(verificationUri)).append("\n"); + sb.append(" verificationUriComplete: ").append(toIndentedString(verificationUriComplete)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("device_code"); + openapiFields.add("expires_in"); + openapiFields.add("interval"); + openapiFields.add("user_code"); + openapiFields.add("verification_uri"); + openapiFields.add("verification_uri_complete"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OAuthDeviceCodeResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthDeviceCodeResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthDeviceCodeResponse is not found in the empty JSON string", OAuthDeviceCodeResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("device_code") != null && !jsonObj.get("device_code").isJsonNull()) && !jsonObj.get("device_code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `device_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("device_code").toString())); + } + if ((jsonObj.get("user_code") != null && !jsonObj.get("user_code").isJsonNull()) && !jsonObj.get("user_code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `user_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("user_code").toString())); + } + if ((jsonObj.get("verification_uri") != null && !jsonObj.get("verification_uri").isJsonNull()) && !jsonObj.get("verification_uri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_uri").toString())); + } + if ((jsonObj.get("verification_uri_complete") != null && !jsonObj.get("verification_uri_complete").isJsonNull()) && !jsonObj.get("verification_uri_complete").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_uri_complete` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_uri_complete").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthDeviceCodeResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthDeviceCodeResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthDeviceCodeResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthDeviceCodeResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthDeviceCodeResponse>() { + @Override + public void write(JsonWriter out, OAuthDeviceCodeResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthDeviceCodeResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthDeviceCodeResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthDeviceCodeResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthDeviceCodeResponse + * @throws IOException if the JSON string is invalid with respect to OAuthDeviceCodeResponse + */ + public static OAuthDeviceCodeResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthDeviceCodeResponse.class); + } + + /** + * Convert an instance of OAuthDeviceCodeResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthDynamicClientRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthDynamicClientRequest.java new file mode 100644 index 0000000..f0fb525 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthDynamicClientRequest.java @@ -0,0 +1,1094 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuthDynamicClientRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthDynamicClientRequest { + public static final String SERIALIZED_NAME_CLIENT_NAME = "client_name"; + @SerializedName(SERIALIZED_NAME_CLIENT_NAME) + @javax.annotation.Nonnull + private String clientName; + + public static final String SERIALIZED_NAME_CLIENT_URI = "client_uri"; + @SerializedName(SERIALIZED_NAME_CLIENT_URI) + @javax.annotation.Nullable + private String clientUri; + + public static final String SERIALIZED_NAME_GRANT_TYPES = "grant_types"; + @SerializedName(SERIALIZED_NAME_GRANT_TYPES) + @javax.annotation.Nullable + private List<String> grantTypes = new ArrayList<>(); + + public static final String SERIALIZED_NAME_RESPONSE_TYPES = "response_types"; + @SerializedName(SERIALIZED_NAME_RESPONSE_TYPES) + @javax.annotation.Nullable + private List<String> responseTypes = new ArrayList<>(); + + public static final String SERIALIZED_NAME_REDIRECT_URIS = "redirect_uris"; + @SerializedName(SERIALIZED_NAME_REDIRECT_URIS) + @javax.annotation.Nonnull + private List<String> redirectUris = new ArrayList<>(); + + public static final String SERIALIZED_NAME_POST_LOGOUT_REDIRECT_URIS = "post_logout_redirect_uris"; + @SerializedName(SERIALIZED_NAME_POST_LOGOUT_REDIRECT_URIS) + @javax.annotation.Nullable + private List<String> postLogoutRedirectUris = new ArrayList<>(); + + public static final String SERIALIZED_NAME_REQUEST_URIS = "request_uris"; + @SerializedName(SERIALIZED_NAME_REQUEST_URIS) + @javax.annotation.Nullable + private List<String> requestUris = new ArrayList<>(); + + /** + * Kind of application. Defaults to \"web\". + */ + @JsonAdapter(ApplicationTypeEnum.Adapter.class) + public enum ApplicationTypeEnum { + WEB("web"), + + NATIVE("native"); + + private String value; + + ApplicationTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ApplicationTypeEnum fromValue(String value) { + for (ApplicationTypeEnum b : ApplicationTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<ApplicationTypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final ApplicationTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ApplicationTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ApplicationTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ApplicationTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_APPLICATION_TYPE = "application_type"; + @SerializedName(SERIALIZED_NAME_APPLICATION_TYPE) + @javax.annotation.Nullable + private ApplicationTypeEnum applicationType; + + /** + * Client authentication method at the token endpoint. + */ + @JsonAdapter(TokenEndpointAuthMethodEnum.Adapter.class) + public enum TokenEndpointAuthMethodEnum { + CLIENT_SECRET_BASIC("client_secret_basic"), + + CLIENT_SECRET_POST("client_secret_post"), + + PRIVATE_KEY_JWT("private_key_jwt"), + + NONE("none"); + + private String value; + + TokenEndpointAuthMethodEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TokenEndpointAuthMethodEnum fromValue(String value) { + for (TokenEndpointAuthMethodEnum b : TokenEndpointAuthMethodEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<TokenEndpointAuthMethodEnum> { + @Override + public void write(final JsonWriter jsonWriter, final TokenEndpointAuthMethodEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TokenEndpointAuthMethodEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TokenEndpointAuthMethodEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TokenEndpointAuthMethodEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TOKEN_ENDPOINT_AUTH_METHOD = "token_endpoint_auth_method"; + @SerializedName(SERIALIZED_NAME_TOKEN_ENDPOINT_AUTH_METHOD) + @javax.annotation.Nullable + private TokenEndpointAuthMethodEnum tokenEndpointAuthMethod; + + public static final String SERIALIZED_NAME_SCOPE = "scope"; + @SerializedName(SERIALIZED_NAME_SCOPE) + @javax.annotation.Nullable + private String scope; + + public static final String SERIALIZED_NAME_LOGO_URI = "logo_uri"; + @SerializedName(SERIALIZED_NAME_LOGO_URI) + @javax.annotation.Nullable + private String logoUri; + + public static final String SERIALIZED_NAME_TOS_URI = "tos_uri"; + @SerializedName(SERIALIZED_NAME_TOS_URI) + @javax.annotation.Nullable + private String tosUri; + + public static final String SERIALIZED_NAME_POLICY_URI = "policy_uri"; + @SerializedName(SERIALIZED_NAME_POLICY_URI) + @javax.annotation.Nullable + private String policyUri; + + public static final String SERIALIZED_NAME_CONTACTS = "contacts"; + @SerializedName(SERIALIZED_NAME_CONTACTS) + @javax.annotation.Nullable + private List<String> contacts = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SOFTWARE_ID = "software_id"; + @SerializedName(SERIALIZED_NAME_SOFTWARE_ID) + @javax.annotation.Nullable + private String softwareId; + + public static final String SERIALIZED_NAME_SOFTWARE_VERSION = "software_version"; + @SerializedName(SERIALIZED_NAME_SOFTWARE_VERSION) + @javax.annotation.Nullable + private String softwareVersion; + + public static final String SERIALIZED_NAME_JWKS_URI = "jwks_uri"; + @SerializedName(SERIALIZED_NAME_JWKS_URI) + @javax.annotation.Nullable + private String jwksUri; + + public static final String SERIALIZED_NAME_JWKS = "jwks"; + @SerializedName(SERIALIZED_NAME_JWKS) + @javax.annotation.Nullable + private Object jwks; + + public static final String SERIALIZED_NAME_ID_TOKEN_SIGNED_RESPONSE_ALG = "id_token_signed_response_alg"; + @SerializedName(SERIALIZED_NAME_ID_TOKEN_SIGNED_RESPONSE_ALG) + @javax.annotation.Nullable + private String idTokenSignedResponseAlg; + + public static final String SERIALIZED_NAME_USERINFO_SIGNED_RESPONSE_ALG = "userinfo_signed_response_alg"; + @SerializedName(SERIALIZED_NAME_USERINFO_SIGNED_RESPONSE_ALG) + @javax.annotation.Nullable + private String userinfoSignedResponseAlg; + + public static final String SERIALIZED_NAME_BACKCHANNEL_LOGOUT_URI = "backchannel_logout_uri"; + @SerializedName(SERIALIZED_NAME_BACKCHANNEL_LOGOUT_URI) + @javax.annotation.Nullable + private String backchannelLogoutUri; + + public static final String SERIALIZED_NAME_BACKCHANNEL_LOGOUT_SESSION_REQUIRED = "backchannel_logout_session_required"; + @SerializedName(SERIALIZED_NAME_BACKCHANNEL_LOGOUT_SESSION_REQUIRED) + @javax.annotation.Nullable + private Boolean backchannelLogoutSessionRequired; + + public OAuthDynamicClientRequest() { + } + + public OAuthDynamicClientRequest clientName(@javax.annotation.Nonnull String clientName) { + this.clientName = clientName; + return this; + } + + /** + * Human-readable name of the client. + * @return clientName + */ + @javax.annotation.Nonnull + public String getClientName() { + return clientName; + } + + public void setClientName(@javax.annotation.Nonnull String clientName) { + this.clientName = clientName; + } + + + public OAuthDynamicClientRequest clientUri(@javax.annotation.Nullable String clientUri) { + this.clientUri = clientUri; + return this; + } + + /** + * URL of the client's home page. + * @return clientUri + */ + @javax.annotation.Nullable + public String getClientUri() { + return clientUri; + } + + public void setClientUri(@javax.annotation.Nullable String clientUri) { + this.clientUri = clientUri; + } + + + public OAuthDynamicClientRequest grantTypes(@javax.annotation.Nullable List<String> grantTypes) { + this.grantTypes = grantTypes; + return this; + } + + public OAuthDynamicClientRequest addGrantTypesItem(String grantTypesItem) { + if (this.grantTypes == null) { + this.grantTypes = new ArrayList<>(); + } + this.grantTypes.add(grantTypesItem); + return this; + } + + /** + * OAuth 2.0 grant types the client will use. Defaults to [\"authorization_code\"]. + * @return grantTypes + */ + @javax.annotation.Nullable + public List<String> getGrantTypes() { + return grantTypes; + } + + public void setGrantTypes(@javax.annotation.Nullable List<String> grantTypes) { + this.grantTypes = grantTypes; + } + + + public OAuthDynamicClientRequest responseTypes(@javax.annotation.Nullable List<String> responseTypes) { + this.responseTypes = responseTypes; + return this; + } + + public OAuthDynamicClientRequest addResponseTypesItem(String responseTypesItem) { + if (this.responseTypes == null) { + this.responseTypes = new ArrayList<>(); + } + this.responseTypes.add(responseTypesItem); + return this; + } + + /** + * OAuth 2.0 response types. Defaults to [\"code\"]. + * @return responseTypes + */ + @javax.annotation.Nullable + public List<String> getResponseTypes() { + return responseTypes; + } + + public void setResponseTypes(@javax.annotation.Nullable List<String> responseTypes) { + this.responseTypes = responseTypes; + } + + + public OAuthDynamicClientRequest redirectUris(@javax.annotation.Nonnull List<String> redirectUris) { + this.redirectUris = redirectUris; + return this; + } + + public OAuthDynamicClientRequest addRedirectUrisItem(String redirectUrisItem) { + if (this.redirectUris == null) { + this.redirectUris = new ArrayList<>(); + } + this.redirectUris.add(redirectUrisItem); + return this; + } + + /** + * Redirect URIs for redirect-based flows. Required. + * @return redirectUris + */ + @javax.annotation.Nonnull + public List<String> getRedirectUris() { + return redirectUris; + } + + public void setRedirectUris(@javax.annotation.Nonnull List<String> redirectUris) { + this.redirectUris = redirectUris; + } + + + public OAuthDynamicClientRequest postLogoutRedirectUris(@javax.annotation.Nullable List<String> postLogoutRedirectUris) { + this.postLogoutRedirectUris = postLogoutRedirectUris; + return this; + } + + public OAuthDynamicClientRequest addPostLogoutRedirectUrisItem(String postLogoutRedirectUrisItem) { + if (this.postLogoutRedirectUris == null) { + this.postLogoutRedirectUris = new ArrayList<>(); + } + this.postLogoutRedirectUris.add(postLogoutRedirectUrisItem); + return this; + } + + /** + * Post-logout redirect URIs. + * @return postLogoutRedirectUris + */ + @javax.annotation.Nullable + public List<String> getPostLogoutRedirectUris() { + return postLogoutRedirectUris; + } + + public void setPostLogoutRedirectUris(@javax.annotation.Nullable List<String> postLogoutRedirectUris) { + this.postLogoutRedirectUris = postLogoutRedirectUris; + } + + + public OAuthDynamicClientRequest requestUris(@javax.annotation.Nullable List<String> requestUris) { + this.requestUris = requestUris; + return this; + } + + public OAuthDynamicClientRequest addRequestUrisItem(String requestUrisItem) { + if (this.requestUris == null) { + this.requestUris = new ArrayList<>(); + } + this.requestUris.add(requestUrisItem); + return this; + } + + /** + * Pre-registered request_uri values for JAR (JWT Authorization Request). + * @return requestUris + */ + @javax.annotation.Nullable + public List<String> getRequestUris() { + return requestUris; + } + + public void setRequestUris(@javax.annotation.Nullable List<String> requestUris) { + this.requestUris = requestUris; + } + + + public OAuthDynamicClientRequest applicationType(@javax.annotation.Nullable ApplicationTypeEnum applicationType) { + this.applicationType = applicationType; + return this; + } + + /** + * Kind of application. Defaults to \"web\". + * @return applicationType + */ + @javax.annotation.Nullable + public ApplicationTypeEnum getApplicationType() { + return applicationType; + } + + public void setApplicationType(@javax.annotation.Nullable ApplicationTypeEnum applicationType) { + this.applicationType = applicationType; + } + + + public OAuthDynamicClientRequest tokenEndpointAuthMethod(@javax.annotation.Nullable TokenEndpointAuthMethodEnum tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + return this; + } + + /** + * Client authentication method at the token endpoint. + * @return tokenEndpointAuthMethod + */ + @javax.annotation.Nullable + public TokenEndpointAuthMethodEnum getTokenEndpointAuthMethod() { + return tokenEndpointAuthMethod; + } + + public void setTokenEndpointAuthMethod(@javax.annotation.Nullable TokenEndpointAuthMethodEnum tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + } + + + public OAuthDynamicClientRequest scope(@javax.annotation.Nullable String scope) { + this.scope = scope; + return this; + } + + /** + * Space-separated scopes the client may request. + * @return scope + */ + @javax.annotation.Nullable + public String getScope() { + return scope; + } + + public void setScope(@javax.annotation.Nullable String scope) { + this.scope = scope; + } + + + public OAuthDynamicClientRequest logoUri(@javax.annotation.Nullable String logoUri) { + this.logoUri = logoUri; + return this; + } + + /** + * URL of the client's logo image. + * @return logoUri + */ + @javax.annotation.Nullable + public String getLogoUri() { + return logoUri; + } + + public void setLogoUri(@javax.annotation.Nullable String logoUri) { + this.logoUri = logoUri; + } + + + public OAuthDynamicClientRequest tosUri(@javax.annotation.Nullable String tosUri) { + this.tosUri = tosUri; + return this; + } + + /** + * URL of the client's Terms of Service. + * @return tosUri + */ + @javax.annotation.Nullable + public String getTosUri() { + return tosUri; + } + + public void setTosUri(@javax.annotation.Nullable String tosUri) { + this.tosUri = tosUri; + } + + + public OAuthDynamicClientRequest policyUri(@javax.annotation.Nullable String policyUri) { + this.policyUri = policyUri; + return this; + } + + /** + * URL of the client's Privacy Policy. + * @return policyUri + */ + @javax.annotation.Nullable + public String getPolicyUri() { + return policyUri; + } + + public void setPolicyUri(@javax.annotation.Nullable String policyUri) { + this.policyUri = policyUri; + } + + + public OAuthDynamicClientRequest contacts(@javax.annotation.Nullable List<String> contacts) { + this.contacts = contacts; + return this; + } + + public OAuthDynamicClientRequest addContactsItem(String contactsItem) { + if (this.contacts == null) { + this.contacts = new ArrayList<>(); + } + this.contacts.add(contactsItem); + return this; + } + + /** + * Contact email addresses for the client. + * @return contacts + */ + @javax.annotation.Nullable + public List<String> getContacts() { + return contacts; + } + + public void setContacts(@javax.annotation.Nullable List<String> contacts) { + this.contacts = contacts; + } + + + public OAuthDynamicClientRequest softwareId(@javax.annotation.Nullable String softwareId) { + this.softwareId = softwareId; + return this; + } + + /** + * Unique identifier for the client software. + * @return softwareId + */ + @javax.annotation.Nullable + public String getSoftwareId() { + return softwareId; + } + + public void setSoftwareId(@javax.annotation.Nullable String softwareId) { + this.softwareId = softwareId; + } + + + public OAuthDynamicClientRequest softwareVersion(@javax.annotation.Nullable String softwareVersion) { + this.softwareVersion = softwareVersion; + return this; + } + + /** + * Version of the client software. + * @return softwareVersion + */ + @javax.annotation.Nullable + public String getSoftwareVersion() { + return softwareVersion; + } + + public void setSoftwareVersion(@javax.annotation.Nullable String softwareVersion) { + this.softwareVersion = softwareVersion; + } + + + public OAuthDynamicClientRequest jwksUri(@javax.annotation.Nullable String jwksUri) { + this.jwksUri = jwksUri; + return this; + } + + /** + * URL of the client's JWKS document. Mutually exclusive with jwks. + * @return jwksUri + */ + @javax.annotation.Nullable + public String getJwksUri() { + return jwksUri; + } + + public void setJwksUri(@javax.annotation.Nullable String jwksUri) { + this.jwksUri = jwksUri; + } + + + public OAuthDynamicClientRequest jwks(@javax.annotation.Nullable Object jwks) { + this.jwks = jwks; + return this; + } + + /** + * Inline JSON Web Key Set. Mutually exclusive with jwks_uri. + * @return jwks + */ + @javax.annotation.Nullable + public Object getJwks() { + return jwks; + } + + public void setJwks(@javax.annotation.Nullable Object jwks) { + this.jwks = jwks; + } + + + public OAuthDynamicClientRequest idTokenSignedResponseAlg(@javax.annotation.Nullable String idTokenSignedResponseAlg) { + this.idTokenSignedResponseAlg = idTokenSignedResponseAlg; + return this; + } + + /** + * JWS algorithm for signing ID tokens. Defaults to RS256. + * @return idTokenSignedResponseAlg + */ + @javax.annotation.Nullable + public String getIdTokenSignedResponseAlg() { + return idTokenSignedResponseAlg; + } + + public void setIdTokenSignedResponseAlg(@javax.annotation.Nullable String idTokenSignedResponseAlg) { + this.idTokenSignedResponseAlg = idTokenSignedResponseAlg; + } + + + public OAuthDynamicClientRequest userinfoSignedResponseAlg(@javax.annotation.Nullable String userinfoSignedResponseAlg) { + this.userinfoSignedResponseAlg = userinfoSignedResponseAlg; + return this; + } + + /** + * JWS algorithm for signing UserInfo responses. If set, UserInfo returns a signed JWT. + * @return userinfoSignedResponseAlg + */ + @javax.annotation.Nullable + public String getUserinfoSignedResponseAlg() { + return userinfoSignedResponseAlg; + } + + public void setUserinfoSignedResponseAlg(@javax.annotation.Nullable String userinfoSignedResponseAlg) { + this.userinfoSignedResponseAlg = userinfoSignedResponseAlg; + } + + + public OAuthDynamicClientRequest backchannelLogoutUri(@javax.annotation.Nullable String backchannelLogoutUri) { + this.backchannelLogoutUri = backchannelLogoutUri; + return this; + } + + /** + * URL to which the OP sends logout tokens (OIDC Back-Channel Logout). + * @return backchannelLogoutUri + */ + @javax.annotation.Nullable + public String getBackchannelLogoutUri() { + return backchannelLogoutUri; + } + + public void setBackchannelLogoutUri(@javax.annotation.Nullable String backchannelLogoutUri) { + this.backchannelLogoutUri = backchannelLogoutUri; + } + + + public OAuthDynamicClientRequest backchannelLogoutSessionRequired(@javax.annotation.Nullable Boolean backchannelLogoutSessionRequired) { + this.backchannelLogoutSessionRequired = backchannelLogoutSessionRequired; + return this; + } + + /** + * Whether the OP must include a sid claim in logout tokens. + * @return backchannelLogoutSessionRequired + */ + @javax.annotation.Nullable + public Boolean getBackchannelLogoutSessionRequired() { + return backchannelLogoutSessionRequired; + } + + public void setBackchannelLogoutSessionRequired(@javax.annotation.Nullable Boolean backchannelLogoutSessionRequired) { + this.backchannelLogoutSessionRequired = backchannelLogoutSessionRequired; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthDynamicClientRequest instance itself + */ + public OAuthDynamicClientRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthDynamicClientRequest oauthDynamicClientRequest = (OAuthDynamicClientRequest) o; + return Objects.equals(this.clientName, oauthDynamicClientRequest.clientName) && + Objects.equals(this.clientUri, oauthDynamicClientRequest.clientUri) && + Objects.equals(this.grantTypes, oauthDynamicClientRequest.grantTypes) && + Objects.equals(this.responseTypes, oauthDynamicClientRequest.responseTypes) && + Objects.equals(this.redirectUris, oauthDynamicClientRequest.redirectUris) && + Objects.equals(this.postLogoutRedirectUris, oauthDynamicClientRequest.postLogoutRedirectUris) && + Objects.equals(this.requestUris, oauthDynamicClientRequest.requestUris) && + Objects.equals(this.applicationType, oauthDynamicClientRequest.applicationType) && + Objects.equals(this.tokenEndpointAuthMethod, oauthDynamicClientRequest.tokenEndpointAuthMethod) && + Objects.equals(this.scope, oauthDynamicClientRequest.scope) && + Objects.equals(this.logoUri, oauthDynamicClientRequest.logoUri) && + Objects.equals(this.tosUri, oauthDynamicClientRequest.tosUri) && + Objects.equals(this.policyUri, oauthDynamicClientRequest.policyUri) && + Objects.equals(this.contacts, oauthDynamicClientRequest.contacts) && + Objects.equals(this.softwareId, oauthDynamicClientRequest.softwareId) && + Objects.equals(this.softwareVersion, oauthDynamicClientRequest.softwareVersion) && + Objects.equals(this.jwksUri, oauthDynamicClientRequest.jwksUri) && + Objects.equals(this.jwks, oauthDynamicClientRequest.jwks) && + Objects.equals(this.idTokenSignedResponseAlg, oauthDynamicClientRequest.idTokenSignedResponseAlg) && + Objects.equals(this.userinfoSignedResponseAlg, oauthDynamicClientRequest.userinfoSignedResponseAlg) && + Objects.equals(this.backchannelLogoutUri, oauthDynamicClientRequest.backchannelLogoutUri) && + Objects.equals(this.backchannelLogoutSessionRequired, oauthDynamicClientRequest.backchannelLogoutSessionRequired)&& + Objects.equals(this.additionalProperties, oauthDynamicClientRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(clientName, clientUri, grantTypes, responseTypes, redirectUris, postLogoutRedirectUris, requestUris, applicationType, tokenEndpointAuthMethod, scope, logoUri, tosUri, policyUri, contacts, softwareId, softwareVersion, jwksUri, jwks, idTokenSignedResponseAlg, userinfoSignedResponseAlg, backchannelLogoutUri, backchannelLogoutSessionRequired, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthDynamicClientRequest {\n"); + sb.append(" clientName: ").append(toIndentedString(clientName)).append("\n"); + sb.append(" clientUri: ").append(toIndentedString(clientUri)).append("\n"); + sb.append(" grantTypes: ").append(toIndentedString(grantTypes)).append("\n"); + sb.append(" responseTypes: ").append(toIndentedString(responseTypes)).append("\n"); + sb.append(" redirectUris: ").append(toIndentedString(redirectUris)).append("\n"); + sb.append(" postLogoutRedirectUris: ").append(toIndentedString(postLogoutRedirectUris)).append("\n"); + sb.append(" requestUris: ").append(toIndentedString(requestUris)).append("\n"); + sb.append(" applicationType: ").append(toIndentedString(applicationType)).append("\n"); + sb.append(" tokenEndpointAuthMethod: ").append(toIndentedString(tokenEndpointAuthMethod)).append("\n"); + sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); + sb.append(" logoUri: ").append(toIndentedString(logoUri)).append("\n"); + sb.append(" tosUri: ").append(toIndentedString(tosUri)).append("\n"); + sb.append(" policyUri: ").append(toIndentedString(policyUri)).append("\n"); + sb.append(" contacts: ").append(toIndentedString(contacts)).append("\n"); + sb.append(" softwareId: ").append(toIndentedString(softwareId)).append("\n"); + sb.append(" softwareVersion: ").append(toIndentedString(softwareVersion)).append("\n"); + sb.append(" jwksUri: ").append(toIndentedString(jwksUri)).append("\n"); + sb.append(" jwks: ").append(toIndentedString(jwks)).append("\n"); + sb.append(" idTokenSignedResponseAlg: ").append(toIndentedString(idTokenSignedResponseAlg)).append("\n"); + sb.append(" userinfoSignedResponseAlg: ").append(toIndentedString(userinfoSignedResponseAlg)).append("\n"); + sb.append(" backchannelLogoutUri: ").append(toIndentedString(backchannelLogoutUri)).append("\n"); + sb.append(" backchannelLogoutSessionRequired: ").append(toIndentedString(backchannelLogoutSessionRequired)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("client_name"); + openapiFields.add("client_uri"); + openapiFields.add("grant_types"); + openapiFields.add("response_types"); + openapiFields.add("redirect_uris"); + openapiFields.add("post_logout_redirect_uris"); + openapiFields.add("request_uris"); + openapiFields.add("application_type"); + openapiFields.add("token_endpoint_auth_method"); + openapiFields.add("scope"); + openapiFields.add("logo_uri"); + openapiFields.add("tos_uri"); + openapiFields.add("policy_uri"); + openapiFields.add("contacts"); + openapiFields.add("software_id"); + openapiFields.add("software_version"); + openapiFields.add("jwks_uri"); + openapiFields.add("jwks"); + openapiFields.add("id_token_signed_response_alg"); + openapiFields.add("userinfo_signed_response_alg"); + openapiFields.add("backchannel_logout_uri"); + openapiFields.add("backchannel_logout_session_required"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("client_name"); + openapiRequiredFields.add("redirect_uris"); + } + + /** + * 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 OAuthDynamicClientRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthDynamicClientRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthDynamicClientRequest is not found in the empty JSON string", OAuthDynamicClientRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OAuthDynamicClientRequest.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("client_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_name").toString())); + } + if ((jsonObj.get("client_uri") != null && !jsonObj.get("client_uri").isJsonNull()) && !jsonObj.get("client_uri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_uri").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("grant_types") != null && !jsonObj.get("grant_types").isJsonNull() && !jsonObj.get("grant_types").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `grant_types` to be an array in the JSON string but got `%s`", jsonObj.get("grant_types").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("response_types") != null && !jsonObj.get("response_types").isJsonNull() && !jsonObj.get("response_types").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `response_types` to be an array in the JSON string but got `%s`", jsonObj.get("response_types").toString())); + } + // ensure the required json array is present + if (jsonObj.get("redirect_uris") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("redirect_uris").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `redirect_uris` to be an array in the JSON string but got `%s`", jsonObj.get("redirect_uris").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("post_logout_redirect_uris") != null && !jsonObj.get("post_logout_redirect_uris").isJsonNull() && !jsonObj.get("post_logout_redirect_uris").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `post_logout_redirect_uris` to be an array in the JSON string but got `%s`", jsonObj.get("post_logout_redirect_uris").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("request_uris") != null && !jsonObj.get("request_uris").isJsonNull() && !jsonObj.get("request_uris").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `request_uris` to be an array in the JSON string but got `%s`", jsonObj.get("request_uris").toString())); + } + if ((jsonObj.get("application_type") != null && !jsonObj.get("application_type").isJsonNull()) && !jsonObj.get("application_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `application_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("application_type").toString())); + } + // validate the optional field `application_type` + if (jsonObj.get("application_type") != null && !jsonObj.get("application_type").isJsonNull()) { + ApplicationTypeEnum.validateJsonElement(jsonObj.get("application_type")); + } + if ((jsonObj.get("token_endpoint_auth_method") != null && !jsonObj.get("token_endpoint_auth_method").isJsonNull()) && !jsonObj.get("token_endpoint_auth_method").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `token_endpoint_auth_method` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token_endpoint_auth_method").toString())); + } + // validate the optional field `token_endpoint_auth_method` + if (jsonObj.get("token_endpoint_auth_method") != null && !jsonObj.get("token_endpoint_auth_method").isJsonNull()) { + TokenEndpointAuthMethodEnum.validateJsonElement(jsonObj.get("token_endpoint_auth_method")); + } + if ((jsonObj.get("scope") != null && !jsonObj.get("scope").isJsonNull()) && !jsonObj.get("scope").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scope").toString())); + } + if ((jsonObj.get("logo_uri") != null && !jsonObj.get("logo_uri").isJsonNull()) && !jsonObj.get("logo_uri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `logo_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logo_uri").toString())); + } + if ((jsonObj.get("tos_uri") != null && !jsonObj.get("tos_uri").isJsonNull()) && !jsonObj.get("tos_uri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `tos_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tos_uri").toString())); + } + if ((jsonObj.get("policy_uri") != null && !jsonObj.get("policy_uri").isJsonNull()) && !jsonObj.get("policy_uri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `policy_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("policy_uri").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("contacts") != null && !jsonObj.get("contacts").isJsonNull() && !jsonObj.get("contacts").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `contacts` to be an array in the JSON string but got `%s`", jsonObj.get("contacts").toString())); + } + if ((jsonObj.get("software_id") != null && !jsonObj.get("software_id").isJsonNull()) && !jsonObj.get("software_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `software_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("software_id").toString())); + } + if ((jsonObj.get("software_version") != null && !jsonObj.get("software_version").isJsonNull()) && !jsonObj.get("software_version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `software_version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("software_version").toString())); + } + if ((jsonObj.get("jwks_uri") != null && !jsonObj.get("jwks_uri").isJsonNull()) && !jsonObj.get("jwks_uri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `jwks_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("jwks_uri").toString())); + } + if ((jsonObj.get("id_token_signed_response_alg") != null && !jsonObj.get("id_token_signed_response_alg").isJsonNull()) && !jsonObj.get("id_token_signed_response_alg").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id_token_signed_response_alg` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id_token_signed_response_alg").toString())); + } + if ((jsonObj.get("userinfo_signed_response_alg") != null && !jsonObj.get("userinfo_signed_response_alg").isJsonNull()) && !jsonObj.get("userinfo_signed_response_alg").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userinfo_signed_response_alg` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userinfo_signed_response_alg").toString())); + } + if ((jsonObj.get("backchannel_logout_uri") != null && !jsonObj.get("backchannel_logout_uri").isJsonNull()) && !jsonObj.get("backchannel_logout_uri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `backchannel_logout_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("backchannel_logout_uri").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthDynamicClientRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthDynamicClientRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthDynamicClientRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthDynamicClientRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthDynamicClientRequest>() { + @Override + public void write(JsonWriter out, OAuthDynamicClientRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthDynamicClientRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthDynamicClientRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthDynamicClientRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthDynamicClientRequest + * @throws IOException if the JSON string is invalid with respect to OAuthDynamicClientRequest + */ + public static OAuthDynamicClientRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthDynamicClientRequest.class); + } + + /** + * Convert an instance of OAuthDynamicClientRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthDynamicClientResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthDynamicClientResponse.java new file mode 100644 index 0000000..8f5be83 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthDynamicClientResponse.java @@ -0,0 +1,1268 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuthDynamicClientResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthDynamicClientResponse { + public static final String SERIALIZED_NAME_CLIENT_NAME = "client_name"; + @SerializedName(SERIALIZED_NAME_CLIENT_NAME) + @javax.annotation.Nonnull + private String clientName; + + public static final String SERIALIZED_NAME_CLIENT_URI = "client_uri"; + @SerializedName(SERIALIZED_NAME_CLIENT_URI) + @javax.annotation.Nullable + private String clientUri; + + public static final String SERIALIZED_NAME_GRANT_TYPES = "grant_types"; + @SerializedName(SERIALIZED_NAME_GRANT_TYPES) + @javax.annotation.Nullable + private List<String> grantTypes = new ArrayList<>(); + + public static final String SERIALIZED_NAME_RESPONSE_TYPES = "response_types"; + @SerializedName(SERIALIZED_NAME_RESPONSE_TYPES) + @javax.annotation.Nullable + private List<String> responseTypes = new ArrayList<>(); + + public static final String SERIALIZED_NAME_REDIRECT_URIS = "redirect_uris"; + @SerializedName(SERIALIZED_NAME_REDIRECT_URIS) + @javax.annotation.Nonnull + private List<String> redirectUris = new ArrayList<>(); + + public static final String SERIALIZED_NAME_POST_LOGOUT_REDIRECT_URIS = "post_logout_redirect_uris"; + @SerializedName(SERIALIZED_NAME_POST_LOGOUT_REDIRECT_URIS) + @javax.annotation.Nullable + private List<String> postLogoutRedirectUris = new ArrayList<>(); + + public static final String SERIALIZED_NAME_REQUEST_URIS = "request_uris"; + @SerializedName(SERIALIZED_NAME_REQUEST_URIS) + @javax.annotation.Nullable + private List<String> requestUris = new ArrayList<>(); + + /** + * Kind of application. Defaults to \"web\". + */ + @JsonAdapter(ApplicationTypeEnum.Adapter.class) + public enum ApplicationTypeEnum { + WEB("web"), + + NATIVE("native"); + + private String value; + + ApplicationTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ApplicationTypeEnum fromValue(String value) { + for (ApplicationTypeEnum b : ApplicationTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<ApplicationTypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final ApplicationTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ApplicationTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ApplicationTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ApplicationTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_APPLICATION_TYPE = "application_type"; + @SerializedName(SERIALIZED_NAME_APPLICATION_TYPE) + @javax.annotation.Nullable + private ApplicationTypeEnum applicationType; + + /** + * Client authentication method at the token endpoint. + */ + @JsonAdapter(TokenEndpointAuthMethodEnum.Adapter.class) + public enum TokenEndpointAuthMethodEnum { + CLIENT_SECRET_BASIC("client_secret_basic"), + + CLIENT_SECRET_POST("client_secret_post"), + + PRIVATE_KEY_JWT("private_key_jwt"), + + NONE("none"); + + private String value; + + TokenEndpointAuthMethodEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TokenEndpointAuthMethodEnum fromValue(String value) { + for (TokenEndpointAuthMethodEnum b : TokenEndpointAuthMethodEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<TokenEndpointAuthMethodEnum> { + @Override + public void write(final JsonWriter jsonWriter, final TokenEndpointAuthMethodEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TokenEndpointAuthMethodEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TokenEndpointAuthMethodEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TokenEndpointAuthMethodEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TOKEN_ENDPOINT_AUTH_METHOD = "token_endpoint_auth_method"; + @SerializedName(SERIALIZED_NAME_TOKEN_ENDPOINT_AUTH_METHOD) + @javax.annotation.Nullable + private TokenEndpointAuthMethodEnum tokenEndpointAuthMethod; + + public static final String SERIALIZED_NAME_SCOPE = "scope"; + @SerializedName(SERIALIZED_NAME_SCOPE) + @javax.annotation.Nullable + private String scope; + + public static final String SERIALIZED_NAME_LOGO_URI = "logo_uri"; + @SerializedName(SERIALIZED_NAME_LOGO_URI) + @javax.annotation.Nullable + private String logoUri; + + public static final String SERIALIZED_NAME_TOS_URI = "tos_uri"; + @SerializedName(SERIALIZED_NAME_TOS_URI) + @javax.annotation.Nullable + private String tosUri; + + public static final String SERIALIZED_NAME_POLICY_URI = "policy_uri"; + @SerializedName(SERIALIZED_NAME_POLICY_URI) + @javax.annotation.Nullable + private String policyUri; + + public static final String SERIALIZED_NAME_CONTACTS = "contacts"; + @SerializedName(SERIALIZED_NAME_CONTACTS) + @javax.annotation.Nullable + private List<String> contacts = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SOFTWARE_ID = "software_id"; + @SerializedName(SERIALIZED_NAME_SOFTWARE_ID) + @javax.annotation.Nullable + private String softwareId; + + public static final String SERIALIZED_NAME_SOFTWARE_VERSION = "software_version"; + @SerializedName(SERIALIZED_NAME_SOFTWARE_VERSION) + @javax.annotation.Nullable + private String softwareVersion; + + public static final String SERIALIZED_NAME_JWKS_URI = "jwks_uri"; + @SerializedName(SERIALIZED_NAME_JWKS_URI) + @javax.annotation.Nullable + private String jwksUri; + + public static final String SERIALIZED_NAME_JWKS = "jwks"; + @SerializedName(SERIALIZED_NAME_JWKS) + @javax.annotation.Nullable + private Object jwks; + + public static final String SERIALIZED_NAME_ID_TOKEN_SIGNED_RESPONSE_ALG = "id_token_signed_response_alg"; + @SerializedName(SERIALIZED_NAME_ID_TOKEN_SIGNED_RESPONSE_ALG) + @javax.annotation.Nullable + private String idTokenSignedResponseAlg; + + public static final String SERIALIZED_NAME_USERINFO_SIGNED_RESPONSE_ALG = "userinfo_signed_response_alg"; + @SerializedName(SERIALIZED_NAME_USERINFO_SIGNED_RESPONSE_ALG) + @javax.annotation.Nullable + private String userinfoSignedResponseAlg; + + public static final String SERIALIZED_NAME_BACKCHANNEL_LOGOUT_URI = "backchannel_logout_uri"; + @SerializedName(SERIALIZED_NAME_BACKCHANNEL_LOGOUT_URI) + @javax.annotation.Nullable + private String backchannelLogoutUri; + + public static final String SERIALIZED_NAME_BACKCHANNEL_LOGOUT_SESSION_REQUIRED = "backchannel_logout_session_required"; + @SerializedName(SERIALIZED_NAME_BACKCHANNEL_LOGOUT_SESSION_REQUIRED) + @javax.annotation.Nullable + private Boolean backchannelLogoutSessionRequired; + + public static final String SERIALIZED_NAME_CLIENT_ID = "client_id"; + @SerializedName(SERIALIZED_NAME_CLIENT_ID) + @javax.annotation.Nullable + private String clientId; + + public static final String SERIALIZED_NAME_CLIENT_SECRET = "client_secret"; + @SerializedName(SERIALIZED_NAME_CLIENT_SECRET) + @javax.annotation.Nullable + private String clientSecret; + + public static final String SERIALIZED_NAME_CLIENT_ID_ISSUED_AT = "client_id_issued_at"; + @SerializedName(SERIALIZED_NAME_CLIENT_ID_ISSUED_AT) + @javax.annotation.Nullable + private Long clientIdIssuedAt; + + public static final String SERIALIZED_NAME_CLIENT_SECRET_EXPIRES_AT = "client_secret_expires_at"; + @SerializedName(SERIALIZED_NAME_CLIENT_SECRET_EXPIRES_AT) + @javax.annotation.Nullable + private Long clientSecretExpiresAt; + + public static final String SERIALIZED_NAME_REGISTRATION_ACCESS_TOKEN = "registration_access_token"; + @SerializedName(SERIALIZED_NAME_REGISTRATION_ACCESS_TOKEN) + @javax.annotation.Nullable + private String registrationAccessToken; + + public static final String SERIALIZED_NAME_REGISTRATION_CLIENT_URI = "registration_client_uri"; + @SerializedName(SERIALIZED_NAME_REGISTRATION_CLIENT_URI) + @javax.annotation.Nullable + private String registrationClientUri; + + public OAuthDynamicClientResponse() { + } + + public OAuthDynamicClientResponse clientName(@javax.annotation.Nonnull String clientName) { + this.clientName = clientName; + return this; + } + + /** + * Human-readable name of the client. + * @return clientName + */ + @javax.annotation.Nonnull + public String getClientName() { + return clientName; + } + + public void setClientName(@javax.annotation.Nonnull String clientName) { + this.clientName = clientName; + } + + + public OAuthDynamicClientResponse clientUri(@javax.annotation.Nullable String clientUri) { + this.clientUri = clientUri; + return this; + } + + /** + * URL of the client's home page. + * @return clientUri + */ + @javax.annotation.Nullable + public String getClientUri() { + return clientUri; + } + + public void setClientUri(@javax.annotation.Nullable String clientUri) { + this.clientUri = clientUri; + } + + + public OAuthDynamicClientResponse grantTypes(@javax.annotation.Nullable List<String> grantTypes) { + this.grantTypes = grantTypes; + return this; + } + + public OAuthDynamicClientResponse addGrantTypesItem(String grantTypesItem) { + if (this.grantTypes == null) { + this.grantTypes = new ArrayList<>(); + } + this.grantTypes.add(grantTypesItem); + return this; + } + + /** + * OAuth 2.0 grant types the client will use. Defaults to [\"authorization_code\"]. + * @return grantTypes + */ + @javax.annotation.Nullable + public List<String> getGrantTypes() { + return grantTypes; + } + + public void setGrantTypes(@javax.annotation.Nullable List<String> grantTypes) { + this.grantTypes = grantTypes; + } + + + public OAuthDynamicClientResponse responseTypes(@javax.annotation.Nullable List<String> responseTypes) { + this.responseTypes = responseTypes; + return this; + } + + public OAuthDynamicClientResponse addResponseTypesItem(String responseTypesItem) { + if (this.responseTypes == null) { + this.responseTypes = new ArrayList<>(); + } + this.responseTypes.add(responseTypesItem); + return this; + } + + /** + * OAuth 2.0 response types. Defaults to [\"code\"]. + * @return responseTypes + */ + @javax.annotation.Nullable + public List<String> getResponseTypes() { + return responseTypes; + } + + public void setResponseTypes(@javax.annotation.Nullable List<String> responseTypes) { + this.responseTypes = responseTypes; + } + + + public OAuthDynamicClientResponse redirectUris(@javax.annotation.Nonnull List<String> redirectUris) { + this.redirectUris = redirectUris; + return this; + } + + public OAuthDynamicClientResponse addRedirectUrisItem(String redirectUrisItem) { + if (this.redirectUris == null) { + this.redirectUris = new ArrayList<>(); + } + this.redirectUris.add(redirectUrisItem); + return this; + } + + /** + * Redirect URIs for redirect-based flows. Required. + * @return redirectUris + */ + @javax.annotation.Nonnull + public List<String> getRedirectUris() { + return redirectUris; + } + + public void setRedirectUris(@javax.annotation.Nonnull List<String> redirectUris) { + this.redirectUris = redirectUris; + } + + + public OAuthDynamicClientResponse postLogoutRedirectUris(@javax.annotation.Nullable List<String> postLogoutRedirectUris) { + this.postLogoutRedirectUris = postLogoutRedirectUris; + return this; + } + + public OAuthDynamicClientResponse addPostLogoutRedirectUrisItem(String postLogoutRedirectUrisItem) { + if (this.postLogoutRedirectUris == null) { + this.postLogoutRedirectUris = new ArrayList<>(); + } + this.postLogoutRedirectUris.add(postLogoutRedirectUrisItem); + return this; + } + + /** + * Post-logout redirect URIs. + * @return postLogoutRedirectUris + */ + @javax.annotation.Nullable + public List<String> getPostLogoutRedirectUris() { + return postLogoutRedirectUris; + } + + public void setPostLogoutRedirectUris(@javax.annotation.Nullable List<String> postLogoutRedirectUris) { + this.postLogoutRedirectUris = postLogoutRedirectUris; + } + + + public OAuthDynamicClientResponse requestUris(@javax.annotation.Nullable List<String> requestUris) { + this.requestUris = requestUris; + return this; + } + + public OAuthDynamicClientResponse addRequestUrisItem(String requestUrisItem) { + if (this.requestUris == null) { + this.requestUris = new ArrayList<>(); + } + this.requestUris.add(requestUrisItem); + return this; + } + + /** + * Pre-registered request_uri values for JAR (JWT Authorization Request). + * @return requestUris + */ + @javax.annotation.Nullable + public List<String> getRequestUris() { + return requestUris; + } + + public void setRequestUris(@javax.annotation.Nullable List<String> requestUris) { + this.requestUris = requestUris; + } + + + public OAuthDynamicClientResponse applicationType(@javax.annotation.Nullable ApplicationTypeEnum applicationType) { + this.applicationType = applicationType; + return this; + } + + /** + * Kind of application. Defaults to \"web\". + * @return applicationType + */ + @javax.annotation.Nullable + public ApplicationTypeEnum getApplicationType() { + return applicationType; + } + + public void setApplicationType(@javax.annotation.Nullable ApplicationTypeEnum applicationType) { + this.applicationType = applicationType; + } + + + public OAuthDynamicClientResponse tokenEndpointAuthMethod(@javax.annotation.Nullable TokenEndpointAuthMethodEnum tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + return this; + } + + /** + * Client authentication method at the token endpoint. + * @return tokenEndpointAuthMethod + */ + @javax.annotation.Nullable + public TokenEndpointAuthMethodEnum getTokenEndpointAuthMethod() { + return tokenEndpointAuthMethod; + } + + public void setTokenEndpointAuthMethod(@javax.annotation.Nullable TokenEndpointAuthMethodEnum tokenEndpointAuthMethod) { + this.tokenEndpointAuthMethod = tokenEndpointAuthMethod; + } + + + public OAuthDynamicClientResponse scope(@javax.annotation.Nullable String scope) { + this.scope = scope; + return this; + } + + /** + * Space-separated scopes the client may request. + * @return scope + */ + @javax.annotation.Nullable + public String getScope() { + return scope; + } + + public void setScope(@javax.annotation.Nullable String scope) { + this.scope = scope; + } + + + public OAuthDynamicClientResponse logoUri(@javax.annotation.Nullable String logoUri) { + this.logoUri = logoUri; + return this; + } + + /** + * URL of the client's logo image. + * @return logoUri + */ + @javax.annotation.Nullable + public String getLogoUri() { + return logoUri; + } + + public void setLogoUri(@javax.annotation.Nullable String logoUri) { + this.logoUri = logoUri; + } + + + public OAuthDynamicClientResponse tosUri(@javax.annotation.Nullable String tosUri) { + this.tosUri = tosUri; + return this; + } + + /** + * URL of the client's Terms of Service. + * @return tosUri + */ + @javax.annotation.Nullable + public String getTosUri() { + return tosUri; + } + + public void setTosUri(@javax.annotation.Nullable String tosUri) { + this.tosUri = tosUri; + } + + + public OAuthDynamicClientResponse policyUri(@javax.annotation.Nullable String policyUri) { + this.policyUri = policyUri; + return this; + } + + /** + * URL of the client's Privacy Policy. + * @return policyUri + */ + @javax.annotation.Nullable + public String getPolicyUri() { + return policyUri; + } + + public void setPolicyUri(@javax.annotation.Nullable String policyUri) { + this.policyUri = policyUri; + } + + + public OAuthDynamicClientResponse contacts(@javax.annotation.Nullable List<String> contacts) { + this.contacts = contacts; + return this; + } + + public OAuthDynamicClientResponse addContactsItem(String contactsItem) { + if (this.contacts == null) { + this.contacts = new ArrayList<>(); + } + this.contacts.add(contactsItem); + return this; + } + + /** + * Contact email addresses for the client. + * @return contacts + */ + @javax.annotation.Nullable + public List<String> getContacts() { + return contacts; + } + + public void setContacts(@javax.annotation.Nullable List<String> contacts) { + this.contacts = contacts; + } + + + public OAuthDynamicClientResponse softwareId(@javax.annotation.Nullable String softwareId) { + this.softwareId = softwareId; + return this; + } + + /** + * Unique identifier for the client software. + * @return softwareId + */ + @javax.annotation.Nullable + public String getSoftwareId() { + return softwareId; + } + + public void setSoftwareId(@javax.annotation.Nullable String softwareId) { + this.softwareId = softwareId; + } + + + public OAuthDynamicClientResponse softwareVersion(@javax.annotation.Nullable String softwareVersion) { + this.softwareVersion = softwareVersion; + return this; + } + + /** + * Version of the client software. + * @return softwareVersion + */ + @javax.annotation.Nullable + public String getSoftwareVersion() { + return softwareVersion; + } + + public void setSoftwareVersion(@javax.annotation.Nullable String softwareVersion) { + this.softwareVersion = softwareVersion; + } + + + public OAuthDynamicClientResponse jwksUri(@javax.annotation.Nullable String jwksUri) { + this.jwksUri = jwksUri; + return this; + } + + /** + * URL of the client's JWKS document. Mutually exclusive with jwks. + * @return jwksUri + */ + @javax.annotation.Nullable + public String getJwksUri() { + return jwksUri; + } + + public void setJwksUri(@javax.annotation.Nullable String jwksUri) { + this.jwksUri = jwksUri; + } + + + public OAuthDynamicClientResponse jwks(@javax.annotation.Nullable Object jwks) { + this.jwks = jwks; + return this; + } + + /** + * Inline JSON Web Key Set. Mutually exclusive with jwks_uri. + * @return jwks + */ + @javax.annotation.Nullable + public Object getJwks() { + return jwks; + } + + public void setJwks(@javax.annotation.Nullable Object jwks) { + this.jwks = jwks; + } + + + public OAuthDynamicClientResponse idTokenSignedResponseAlg(@javax.annotation.Nullable String idTokenSignedResponseAlg) { + this.idTokenSignedResponseAlg = idTokenSignedResponseAlg; + return this; + } + + /** + * JWS algorithm for signing ID tokens. Defaults to RS256. + * @return idTokenSignedResponseAlg + */ + @javax.annotation.Nullable + public String getIdTokenSignedResponseAlg() { + return idTokenSignedResponseAlg; + } + + public void setIdTokenSignedResponseAlg(@javax.annotation.Nullable String idTokenSignedResponseAlg) { + this.idTokenSignedResponseAlg = idTokenSignedResponseAlg; + } + + + public OAuthDynamicClientResponse userinfoSignedResponseAlg(@javax.annotation.Nullable String userinfoSignedResponseAlg) { + this.userinfoSignedResponseAlg = userinfoSignedResponseAlg; + return this; + } + + /** + * JWS algorithm for signing UserInfo responses. If set, UserInfo returns a signed JWT. + * @return userinfoSignedResponseAlg + */ + @javax.annotation.Nullable + public String getUserinfoSignedResponseAlg() { + return userinfoSignedResponseAlg; + } + + public void setUserinfoSignedResponseAlg(@javax.annotation.Nullable String userinfoSignedResponseAlg) { + this.userinfoSignedResponseAlg = userinfoSignedResponseAlg; + } + + + public OAuthDynamicClientResponse backchannelLogoutUri(@javax.annotation.Nullable String backchannelLogoutUri) { + this.backchannelLogoutUri = backchannelLogoutUri; + return this; + } + + /** + * URL to which the OP sends logout tokens (OIDC Back-Channel Logout). + * @return backchannelLogoutUri + */ + @javax.annotation.Nullable + public String getBackchannelLogoutUri() { + return backchannelLogoutUri; + } + + public void setBackchannelLogoutUri(@javax.annotation.Nullable String backchannelLogoutUri) { + this.backchannelLogoutUri = backchannelLogoutUri; + } + + + public OAuthDynamicClientResponse backchannelLogoutSessionRequired(@javax.annotation.Nullable Boolean backchannelLogoutSessionRequired) { + this.backchannelLogoutSessionRequired = backchannelLogoutSessionRequired; + return this; + } + + /** + * Whether the OP must include a sid claim in logout tokens. + * @return backchannelLogoutSessionRequired + */ + @javax.annotation.Nullable + public Boolean getBackchannelLogoutSessionRequired() { + return backchannelLogoutSessionRequired; + } + + public void setBackchannelLogoutSessionRequired(@javax.annotation.Nullable Boolean backchannelLogoutSessionRequired) { + this.backchannelLogoutSessionRequired = backchannelLogoutSessionRequired; + } + + + public OAuthDynamicClientResponse clientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Unique client identifier issued by the authorization server. + * @return clientId + */ + @javax.annotation.Nullable + public String getClientId() { + return clientId; + } + + public void setClientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + } + + + public OAuthDynamicClientResponse clientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Client secret. Only returned for confidential clients. + * @return clientSecret + */ + @javax.annotation.Nullable + public String getClientSecret() { + return clientSecret; + } + + public void setClientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + } + + + public OAuthDynamicClientResponse clientIdIssuedAt(@javax.annotation.Nullable Long clientIdIssuedAt) { + this.clientIdIssuedAt = clientIdIssuedAt; + return this; + } + + /** + * Unix timestamp when the client_id was issued. + * @return clientIdIssuedAt + */ + @javax.annotation.Nullable + public Long getClientIdIssuedAt() { + return clientIdIssuedAt; + } + + public void setClientIdIssuedAt(@javax.annotation.Nullable Long clientIdIssuedAt) { + this.clientIdIssuedAt = clientIdIssuedAt; + } + + + public OAuthDynamicClientResponse clientSecretExpiresAt(@javax.annotation.Nullable Long clientSecretExpiresAt) { + this.clientSecretExpiresAt = clientSecretExpiresAt; + return this; + } + + /** + * Unix timestamp when the client_secret expires. 0 means it does not expire. + * @return clientSecretExpiresAt + */ + @javax.annotation.Nullable + public Long getClientSecretExpiresAt() { + return clientSecretExpiresAt; + } + + public void setClientSecretExpiresAt(@javax.annotation.Nullable Long clientSecretExpiresAt) { + this.clientSecretExpiresAt = clientSecretExpiresAt; + } + + + public OAuthDynamicClientResponse registrationAccessToken(@javax.annotation.Nullable String registrationAccessToken) { + this.registrationAccessToken = registrationAccessToken; + return this; + } + + /** + * Bearer token to access the client configuration endpoint. Only returned on initial registration. + * @return registrationAccessToken + */ + @javax.annotation.Nullable + public String getRegistrationAccessToken() { + return registrationAccessToken; + } + + public void setRegistrationAccessToken(@javax.annotation.Nullable String registrationAccessToken) { + this.registrationAccessToken = registrationAccessToken; + } + + + public OAuthDynamicClientResponse registrationClientUri(@javax.annotation.Nullable String registrationClientUri) { + this.registrationClientUri = registrationClientUri; + return this; + } + + /** + * URL of the client configuration endpoint for this client. + * @return registrationClientUri + */ + @javax.annotation.Nullable + public String getRegistrationClientUri() { + return registrationClientUri; + } + + public void setRegistrationClientUri(@javax.annotation.Nullable String registrationClientUri) { + this.registrationClientUri = registrationClientUri; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthDynamicClientResponse instance itself + */ + public OAuthDynamicClientResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthDynamicClientResponse oauthDynamicClientResponse = (OAuthDynamicClientResponse) o; + return Objects.equals(this.clientName, oauthDynamicClientResponse.clientName) && + Objects.equals(this.clientUri, oauthDynamicClientResponse.clientUri) && + Objects.equals(this.grantTypes, oauthDynamicClientResponse.grantTypes) && + Objects.equals(this.responseTypes, oauthDynamicClientResponse.responseTypes) && + Objects.equals(this.redirectUris, oauthDynamicClientResponse.redirectUris) && + Objects.equals(this.postLogoutRedirectUris, oauthDynamicClientResponse.postLogoutRedirectUris) && + Objects.equals(this.requestUris, oauthDynamicClientResponse.requestUris) && + Objects.equals(this.applicationType, oauthDynamicClientResponse.applicationType) && + Objects.equals(this.tokenEndpointAuthMethod, oauthDynamicClientResponse.tokenEndpointAuthMethod) && + Objects.equals(this.scope, oauthDynamicClientResponse.scope) && + Objects.equals(this.logoUri, oauthDynamicClientResponse.logoUri) && + Objects.equals(this.tosUri, oauthDynamicClientResponse.tosUri) && + Objects.equals(this.policyUri, oauthDynamicClientResponse.policyUri) && + Objects.equals(this.contacts, oauthDynamicClientResponse.contacts) && + Objects.equals(this.softwareId, oauthDynamicClientResponse.softwareId) && + Objects.equals(this.softwareVersion, oauthDynamicClientResponse.softwareVersion) && + Objects.equals(this.jwksUri, oauthDynamicClientResponse.jwksUri) && + Objects.equals(this.jwks, oauthDynamicClientResponse.jwks) && + Objects.equals(this.idTokenSignedResponseAlg, oauthDynamicClientResponse.idTokenSignedResponseAlg) && + Objects.equals(this.userinfoSignedResponseAlg, oauthDynamicClientResponse.userinfoSignedResponseAlg) && + Objects.equals(this.backchannelLogoutUri, oauthDynamicClientResponse.backchannelLogoutUri) && + Objects.equals(this.backchannelLogoutSessionRequired, oauthDynamicClientResponse.backchannelLogoutSessionRequired) && + Objects.equals(this.clientId, oauthDynamicClientResponse.clientId) && + Objects.equals(this.clientSecret, oauthDynamicClientResponse.clientSecret) && + Objects.equals(this.clientIdIssuedAt, oauthDynamicClientResponse.clientIdIssuedAt) && + Objects.equals(this.clientSecretExpiresAt, oauthDynamicClientResponse.clientSecretExpiresAt) && + Objects.equals(this.registrationAccessToken, oauthDynamicClientResponse.registrationAccessToken) && + Objects.equals(this.registrationClientUri, oauthDynamicClientResponse.registrationClientUri)&& + Objects.equals(this.additionalProperties, oauthDynamicClientResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(clientName, clientUri, grantTypes, responseTypes, redirectUris, postLogoutRedirectUris, requestUris, applicationType, tokenEndpointAuthMethod, scope, logoUri, tosUri, policyUri, contacts, softwareId, softwareVersion, jwksUri, jwks, idTokenSignedResponseAlg, userinfoSignedResponseAlg, backchannelLogoutUri, backchannelLogoutSessionRequired, clientId, clientSecret, clientIdIssuedAt, clientSecretExpiresAt, registrationAccessToken, registrationClientUri, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthDynamicClientResponse {\n"); + sb.append(" clientName: ").append(toIndentedString(clientName)).append("\n"); + sb.append(" clientUri: ").append(toIndentedString(clientUri)).append("\n"); + sb.append(" grantTypes: ").append(toIndentedString(grantTypes)).append("\n"); + sb.append(" responseTypes: ").append(toIndentedString(responseTypes)).append("\n"); + sb.append(" redirectUris: ").append(toIndentedString(redirectUris)).append("\n"); + sb.append(" postLogoutRedirectUris: ").append(toIndentedString(postLogoutRedirectUris)).append("\n"); + sb.append(" requestUris: ").append(toIndentedString(requestUris)).append("\n"); + sb.append(" applicationType: ").append(toIndentedString(applicationType)).append("\n"); + sb.append(" tokenEndpointAuthMethod: ").append(toIndentedString(tokenEndpointAuthMethod)).append("\n"); + sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); + sb.append(" logoUri: ").append(toIndentedString(logoUri)).append("\n"); + sb.append(" tosUri: ").append(toIndentedString(tosUri)).append("\n"); + sb.append(" policyUri: ").append(toIndentedString(policyUri)).append("\n"); + sb.append(" contacts: ").append(toIndentedString(contacts)).append("\n"); + sb.append(" softwareId: ").append(toIndentedString(softwareId)).append("\n"); + sb.append(" softwareVersion: ").append(toIndentedString(softwareVersion)).append("\n"); + sb.append(" jwksUri: ").append(toIndentedString(jwksUri)).append("\n"); + sb.append(" jwks: ").append(toIndentedString(jwks)).append("\n"); + sb.append(" idTokenSignedResponseAlg: ").append(toIndentedString(idTokenSignedResponseAlg)).append("\n"); + sb.append(" userinfoSignedResponseAlg: ").append(toIndentedString(userinfoSignedResponseAlg)).append("\n"); + sb.append(" backchannelLogoutUri: ").append(toIndentedString(backchannelLogoutUri)).append("\n"); + sb.append(" backchannelLogoutSessionRequired: ").append(toIndentedString(backchannelLogoutSessionRequired)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); + sb.append(" clientIdIssuedAt: ").append(toIndentedString(clientIdIssuedAt)).append("\n"); + sb.append(" clientSecretExpiresAt: ").append(toIndentedString(clientSecretExpiresAt)).append("\n"); + sb.append(" registrationAccessToken: ").append(toIndentedString(registrationAccessToken)).append("\n"); + sb.append(" registrationClientUri: ").append(toIndentedString(registrationClientUri)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("client_name"); + openapiFields.add("client_uri"); + openapiFields.add("grant_types"); + openapiFields.add("response_types"); + openapiFields.add("redirect_uris"); + openapiFields.add("post_logout_redirect_uris"); + openapiFields.add("request_uris"); + openapiFields.add("application_type"); + openapiFields.add("token_endpoint_auth_method"); + openapiFields.add("scope"); + openapiFields.add("logo_uri"); + openapiFields.add("tos_uri"); + openapiFields.add("policy_uri"); + openapiFields.add("contacts"); + openapiFields.add("software_id"); + openapiFields.add("software_version"); + openapiFields.add("jwks_uri"); + openapiFields.add("jwks"); + openapiFields.add("id_token_signed_response_alg"); + openapiFields.add("userinfo_signed_response_alg"); + openapiFields.add("backchannel_logout_uri"); + openapiFields.add("backchannel_logout_session_required"); + openapiFields.add("client_id"); + openapiFields.add("client_secret"); + openapiFields.add("client_id_issued_at"); + openapiFields.add("client_secret_expires_at"); + openapiFields.add("registration_access_token"); + openapiFields.add("registration_client_uri"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("client_name"); + openapiRequiredFields.add("redirect_uris"); + } + + /** + * 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 OAuthDynamicClientResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthDynamicClientResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthDynamicClientResponse is not found in the empty JSON string", OAuthDynamicClientResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OAuthDynamicClientResponse.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("client_name").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_name` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_name").toString())); + } + if ((jsonObj.get("client_uri") != null && !jsonObj.get("client_uri").isJsonNull()) && !jsonObj.get("client_uri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_uri").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("grant_types") != null && !jsonObj.get("grant_types").isJsonNull() && !jsonObj.get("grant_types").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `grant_types` to be an array in the JSON string but got `%s`", jsonObj.get("grant_types").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("response_types") != null && !jsonObj.get("response_types").isJsonNull() && !jsonObj.get("response_types").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `response_types` to be an array in the JSON string but got `%s`", jsonObj.get("response_types").toString())); + } + // ensure the required json array is present + if (jsonObj.get("redirect_uris") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("redirect_uris").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `redirect_uris` to be an array in the JSON string but got `%s`", jsonObj.get("redirect_uris").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("post_logout_redirect_uris") != null && !jsonObj.get("post_logout_redirect_uris").isJsonNull() && !jsonObj.get("post_logout_redirect_uris").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `post_logout_redirect_uris` to be an array in the JSON string but got `%s`", jsonObj.get("post_logout_redirect_uris").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("request_uris") != null && !jsonObj.get("request_uris").isJsonNull() && !jsonObj.get("request_uris").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `request_uris` to be an array in the JSON string but got `%s`", jsonObj.get("request_uris").toString())); + } + if ((jsonObj.get("application_type") != null && !jsonObj.get("application_type").isJsonNull()) && !jsonObj.get("application_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `application_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("application_type").toString())); + } + // validate the optional field `application_type` + if (jsonObj.get("application_type") != null && !jsonObj.get("application_type").isJsonNull()) { + ApplicationTypeEnum.validateJsonElement(jsonObj.get("application_type")); + } + if ((jsonObj.get("token_endpoint_auth_method") != null && !jsonObj.get("token_endpoint_auth_method").isJsonNull()) && !jsonObj.get("token_endpoint_auth_method").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `token_endpoint_auth_method` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token_endpoint_auth_method").toString())); + } + // validate the optional field `token_endpoint_auth_method` + if (jsonObj.get("token_endpoint_auth_method") != null && !jsonObj.get("token_endpoint_auth_method").isJsonNull()) { + TokenEndpointAuthMethodEnum.validateJsonElement(jsonObj.get("token_endpoint_auth_method")); + } + if ((jsonObj.get("scope") != null && !jsonObj.get("scope").isJsonNull()) && !jsonObj.get("scope").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scope").toString())); + } + if ((jsonObj.get("logo_uri") != null && !jsonObj.get("logo_uri").isJsonNull()) && !jsonObj.get("logo_uri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `logo_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("logo_uri").toString())); + } + if ((jsonObj.get("tos_uri") != null && !jsonObj.get("tos_uri").isJsonNull()) && !jsonObj.get("tos_uri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `tos_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("tos_uri").toString())); + } + if ((jsonObj.get("policy_uri") != null && !jsonObj.get("policy_uri").isJsonNull()) && !jsonObj.get("policy_uri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `policy_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("policy_uri").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("contacts") != null && !jsonObj.get("contacts").isJsonNull() && !jsonObj.get("contacts").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `contacts` to be an array in the JSON string but got `%s`", jsonObj.get("contacts").toString())); + } + if ((jsonObj.get("software_id") != null && !jsonObj.get("software_id").isJsonNull()) && !jsonObj.get("software_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `software_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("software_id").toString())); + } + if ((jsonObj.get("software_version") != null && !jsonObj.get("software_version").isJsonNull()) && !jsonObj.get("software_version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `software_version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("software_version").toString())); + } + if ((jsonObj.get("jwks_uri") != null && !jsonObj.get("jwks_uri").isJsonNull()) && !jsonObj.get("jwks_uri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `jwks_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("jwks_uri").toString())); + } + if ((jsonObj.get("id_token_signed_response_alg") != null && !jsonObj.get("id_token_signed_response_alg").isJsonNull()) && !jsonObj.get("id_token_signed_response_alg").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id_token_signed_response_alg` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id_token_signed_response_alg").toString())); + } + if ((jsonObj.get("userinfo_signed_response_alg") != null && !jsonObj.get("userinfo_signed_response_alg").isJsonNull()) && !jsonObj.get("userinfo_signed_response_alg").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userinfo_signed_response_alg` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userinfo_signed_response_alg").toString())); + } + if ((jsonObj.get("backchannel_logout_uri") != null && !jsonObj.get("backchannel_logout_uri").isJsonNull()) && !jsonObj.get("backchannel_logout_uri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `backchannel_logout_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("backchannel_logout_uri").toString())); + } + if ((jsonObj.get("client_id") != null && !jsonObj.get("client_id").isJsonNull()) && !jsonObj.get("client_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_id").toString())); + } + if ((jsonObj.get("client_secret") != null && !jsonObj.get("client_secret").isJsonNull()) && !jsonObj.get("client_secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_secret").toString())); + } + if ((jsonObj.get("registration_access_token") != null && !jsonObj.get("registration_access_token").isJsonNull()) && !jsonObj.get("registration_access_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `registration_access_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("registration_access_token").toString())); + } + if ((jsonObj.get("registration_client_uri") != null && !jsonObj.get("registration_client_uri").isJsonNull()) && !jsonObj.get("registration_client_uri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `registration_client_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("registration_client_uri").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthDynamicClientResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthDynamicClientResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthDynamicClientResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthDynamicClientResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthDynamicClientResponse>() { + @Override + public void write(JsonWriter out, OAuthDynamicClientResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthDynamicClientResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthDynamicClientResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthDynamicClientResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthDynamicClientResponse + * @throws IOException if the JSON string is invalid with respect to OAuthDynamicClientResponse + */ + public static OAuthDynamicClientResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthDynamicClientResponse.class); + } + + /** + * Convert an instance of OAuthDynamicClientResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthDynamicClientResponseCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthDynamicClientResponseCore.java new file mode 100644 index 0000000..0bd1997 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthDynamicClientResponseCore.java @@ -0,0 +1,431 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuthDynamicClientResponseCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthDynamicClientResponseCore { + public static final String SERIALIZED_NAME_CLIENT_ID = "client_id"; + @SerializedName(SERIALIZED_NAME_CLIENT_ID) + @javax.annotation.Nullable + private String clientId; + + public static final String SERIALIZED_NAME_CLIENT_SECRET = "client_secret"; + @SerializedName(SERIALIZED_NAME_CLIENT_SECRET) + @javax.annotation.Nullable + private String clientSecret; + + public static final String SERIALIZED_NAME_CLIENT_ID_ISSUED_AT = "client_id_issued_at"; + @SerializedName(SERIALIZED_NAME_CLIENT_ID_ISSUED_AT) + @javax.annotation.Nullable + private Long clientIdIssuedAt; + + public static final String SERIALIZED_NAME_CLIENT_SECRET_EXPIRES_AT = "client_secret_expires_at"; + @SerializedName(SERIALIZED_NAME_CLIENT_SECRET_EXPIRES_AT) + @javax.annotation.Nullable + private Long clientSecretExpiresAt; + + public static final String SERIALIZED_NAME_REGISTRATION_ACCESS_TOKEN = "registration_access_token"; + @SerializedName(SERIALIZED_NAME_REGISTRATION_ACCESS_TOKEN) + @javax.annotation.Nullable + private String registrationAccessToken; + + public static final String SERIALIZED_NAME_REGISTRATION_CLIENT_URI = "registration_client_uri"; + @SerializedName(SERIALIZED_NAME_REGISTRATION_CLIENT_URI) + @javax.annotation.Nullable + private String registrationClientUri; + + public OAuthDynamicClientResponseCore() { + } + + public OAuthDynamicClientResponseCore clientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Unique client identifier issued by the authorization server. + * @return clientId + */ + @javax.annotation.Nullable + public String getClientId() { + return clientId; + } + + public void setClientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + } + + + public OAuthDynamicClientResponseCore clientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Client secret. Only returned for confidential clients. + * @return clientSecret + */ + @javax.annotation.Nullable + public String getClientSecret() { + return clientSecret; + } + + public void setClientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + } + + + public OAuthDynamicClientResponseCore clientIdIssuedAt(@javax.annotation.Nullable Long clientIdIssuedAt) { + this.clientIdIssuedAt = clientIdIssuedAt; + return this; + } + + /** + * Unix timestamp when the client_id was issued. + * @return clientIdIssuedAt + */ + @javax.annotation.Nullable + public Long getClientIdIssuedAt() { + return clientIdIssuedAt; + } + + public void setClientIdIssuedAt(@javax.annotation.Nullable Long clientIdIssuedAt) { + this.clientIdIssuedAt = clientIdIssuedAt; + } + + + public OAuthDynamicClientResponseCore clientSecretExpiresAt(@javax.annotation.Nullable Long clientSecretExpiresAt) { + this.clientSecretExpiresAt = clientSecretExpiresAt; + return this; + } + + /** + * Unix timestamp when the client_secret expires. 0 means it does not expire. + * @return clientSecretExpiresAt + */ + @javax.annotation.Nullable + public Long getClientSecretExpiresAt() { + return clientSecretExpiresAt; + } + + public void setClientSecretExpiresAt(@javax.annotation.Nullable Long clientSecretExpiresAt) { + this.clientSecretExpiresAt = clientSecretExpiresAt; + } + + + public OAuthDynamicClientResponseCore registrationAccessToken(@javax.annotation.Nullable String registrationAccessToken) { + this.registrationAccessToken = registrationAccessToken; + return this; + } + + /** + * Bearer token to access the client configuration endpoint. Only returned on initial registration. + * @return registrationAccessToken + */ + @javax.annotation.Nullable + public String getRegistrationAccessToken() { + return registrationAccessToken; + } + + public void setRegistrationAccessToken(@javax.annotation.Nullable String registrationAccessToken) { + this.registrationAccessToken = registrationAccessToken; + } + + + public OAuthDynamicClientResponseCore registrationClientUri(@javax.annotation.Nullable String registrationClientUri) { + this.registrationClientUri = registrationClientUri; + return this; + } + + /** + * URL of the client configuration endpoint for this client. + * @return registrationClientUri + */ + @javax.annotation.Nullable + public String getRegistrationClientUri() { + return registrationClientUri; + } + + public void setRegistrationClientUri(@javax.annotation.Nullable String registrationClientUri) { + this.registrationClientUri = registrationClientUri; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthDynamicClientResponseCore instance itself + */ + public OAuthDynamicClientResponseCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthDynamicClientResponseCore oauthDynamicClientResponseCore = (OAuthDynamicClientResponseCore) o; + return Objects.equals(this.clientId, oauthDynamicClientResponseCore.clientId) && + Objects.equals(this.clientSecret, oauthDynamicClientResponseCore.clientSecret) && + Objects.equals(this.clientIdIssuedAt, oauthDynamicClientResponseCore.clientIdIssuedAt) && + Objects.equals(this.clientSecretExpiresAt, oauthDynamicClientResponseCore.clientSecretExpiresAt) && + Objects.equals(this.registrationAccessToken, oauthDynamicClientResponseCore.registrationAccessToken) && + Objects.equals(this.registrationClientUri, oauthDynamicClientResponseCore.registrationClientUri)&& + Objects.equals(this.additionalProperties, oauthDynamicClientResponseCore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, clientSecret, clientIdIssuedAt, clientSecretExpiresAt, registrationAccessToken, registrationClientUri, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthDynamicClientResponseCore {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); + sb.append(" clientIdIssuedAt: ").append(toIndentedString(clientIdIssuedAt)).append("\n"); + sb.append(" clientSecretExpiresAt: ").append(toIndentedString(clientSecretExpiresAt)).append("\n"); + sb.append(" registrationAccessToken: ").append(toIndentedString(registrationAccessToken)).append("\n"); + sb.append(" registrationClientUri: ").append(toIndentedString(registrationClientUri)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("client_id"); + openapiFields.add("client_secret"); + openapiFields.add("client_id_issued_at"); + openapiFields.add("client_secret_expires_at"); + openapiFields.add("registration_access_token"); + openapiFields.add("registration_client_uri"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OAuthDynamicClientResponseCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthDynamicClientResponseCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthDynamicClientResponseCore is not found in the empty JSON string", OAuthDynamicClientResponseCore.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("client_id") != null && !jsonObj.get("client_id").isJsonNull()) && !jsonObj.get("client_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_id").toString())); + } + if ((jsonObj.get("client_secret") != null && !jsonObj.get("client_secret").isJsonNull()) && !jsonObj.get("client_secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_secret").toString())); + } + if ((jsonObj.get("registration_access_token") != null && !jsonObj.get("registration_access_token").isJsonNull()) && !jsonObj.get("registration_access_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `registration_access_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("registration_access_token").toString())); + } + if ((jsonObj.get("registration_client_uri") != null && !jsonObj.get("registration_client_uri").isJsonNull()) && !jsonObj.get("registration_client_uri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `registration_client_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("registration_client_uri").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthDynamicClientResponseCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthDynamicClientResponseCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthDynamicClientResponseCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthDynamicClientResponseCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthDynamicClientResponseCore>() { + @Override + public void write(JsonWriter out, OAuthDynamicClientResponseCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthDynamicClientResponseCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthDynamicClientResponseCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthDynamicClientResponseCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthDynamicClientResponseCore + * @throws IOException if the JSON string is invalid with respect to OAuthDynamicClientResponseCore + */ + public static OAuthDynamicClientResponseCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthDynamicClientResponseCore.class); + } + + /** + * Convert an instance of OAuthDynamicClientResponseCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthErrorResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthErrorResponse.java new file mode 100644 index 0000000..e01d044 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthErrorResponse.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuthErrorResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthErrorResponse { + public static final String SERIALIZED_NAME_ERROR = "error"; + @SerializedName(SERIALIZED_NAME_ERROR) + @javax.annotation.Nullable + private String error; + + public static final String SERIALIZED_NAME_ERROR_DESCRIPTION = "error_description"; + @SerializedName(SERIALIZED_NAME_ERROR_DESCRIPTION) + @javax.annotation.Nullable + private String errorDescription; + + public OAuthErrorResponse() { + } + + public OAuthErrorResponse error(@javax.annotation.Nullable String error) { + this.error = error; + return this; + } + + /** + * Get error + * @return error + */ + @javax.annotation.Nullable + public String getError() { + return error; + } + + public void setError(@javax.annotation.Nullable String error) { + this.error = error; + } + + + public OAuthErrorResponse errorDescription(@javax.annotation.Nullable String errorDescription) { + this.errorDescription = errorDescription; + return this; + } + + /** + * Get errorDescription + * @return errorDescription + */ + @javax.annotation.Nullable + public String getErrorDescription() { + return errorDescription; + } + + public void setErrorDescription(@javax.annotation.Nullable String errorDescription) { + this.errorDescription = errorDescription; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthErrorResponse instance itself + */ + public OAuthErrorResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthErrorResponse oauthErrorResponse = (OAuthErrorResponse) o; + return Objects.equals(this.error, oauthErrorResponse.error) && + Objects.equals(this.errorDescription, oauthErrorResponse.errorDescription)&& + Objects.equals(this.additionalProperties, oauthErrorResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(error, errorDescription, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthErrorResponse {\n"); + sb.append(" error: ").append(toIndentedString(error)).append("\n"); + sb.append(" errorDescription: ").append(toIndentedString(errorDescription)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("error"); + openapiFields.add("error_description"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OAuthErrorResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthErrorResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthErrorResponse is not found in the empty JSON string", OAuthErrorResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("error") != null && !jsonObj.get("error").isJsonNull()) && !jsonObj.get("error").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `error` to be a primitive type in the JSON string but got `%s`", jsonObj.get("error").toString())); + } + if ((jsonObj.get("error_description") != null && !jsonObj.get("error_description").isJsonNull()) && !jsonObj.get("error_description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `error_description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("error_description").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthErrorResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthErrorResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthErrorResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthErrorResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthErrorResponse>() { + @Override + public void write(JsonWriter out, OAuthErrorResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthErrorResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthErrorResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthErrorResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthErrorResponse + * @throws IOException if the JSON string is invalid with respect to OAuthErrorResponse + */ + public static OAuthErrorResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthErrorResponse.class); + } + + /** + * Convert an instance of OAuthErrorResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthIntegrationBaseModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthIntegrationBaseModel.java new file mode 100644 index 0000000..2b0203a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthIntegrationBaseModel.java @@ -0,0 +1,863 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.OAuthIntegrationBaseModelConnections; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuthIntegrationBaseModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthIntegrationBaseModel { + public static final String SERIALIZED_NAME_REDIRECT_U_R_IS = "RedirectURIs"; + @SerializedName(SERIALIZED_NAME_REDIRECT_U_R_IS) + @javax.annotation.Nullable + private List<String> redirectURIs = new ArrayList<>(); + + /** + * Gets or Sets allowedScopes + */ + @JsonAdapter(AllowedScopesEnum.Adapter.class) + public enum AllowedScopesEnum { + OPENID("openid"), + + EMAIL("email"), + + PHONE("phone"), + + PROFILE("profile"), + + ADDRESS("address"); + + private String value; + + AllowedScopesEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AllowedScopesEnum fromValue(String value) { + for (AllowedScopesEnum b : AllowedScopesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<AllowedScopesEnum> { + @Override + public void write(final JsonWriter jsonWriter, final AllowedScopesEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AllowedScopesEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AllowedScopesEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AllowedScopesEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ALLOWED_SCOPES = "AllowedScopes"; + @SerializedName(SERIALIZED_NAME_ALLOWED_SCOPES) + @javax.annotation.Nullable + private List<AllowedScopesEnum> allowedScopes = new ArrayList<>(); + + /** + * Gets or Sets grantTypes + */ + @JsonAdapter(GrantTypesEnum.Adapter.class) + public enum GrantTypesEnum { + AUTHORIZATION_CODE("authorization_code"), + + REFRESH_TOKEN("refresh_token"); + + private String value; + + GrantTypesEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static GrantTypesEnum fromValue(String value) { + for (GrantTypesEnum b : GrantTypesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<GrantTypesEnum> { + @Override + public void write(final JsonWriter jsonWriter, final GrantTypesEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public GrantTypesEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return GrantTypesEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + GrantTypesEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_GRANT_TYPES = "GrantTypes"; + @SerializedName(SERIALIZED_NAME_GRANT_TYPES) + @javax.annotation.Nullable + private List<GrantTypesEnum> grantTypes = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ACCESS_TOKEN_MAPPING_TEMPLATE = "AccessTokenMappingTemplate"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN_MAPPING_TEMPLATE) + @javax.annotation.Nullable + private String accessTokenMappingTemplate; + + public static final String SERIALIZED_NAME_ID_TOKEN_MAPPING_TEMPLATE = "IdTokenMappingTemplate"; + @SerializedName(SERIALIZED_NAME_ID_TOKEN_MAPPING_TEMPLATE) + @javax.annotation.Nullable + private String idTokenMappingTemplate; + + public static final String SERIALIZED_NAME_ACCESS_TOKEN_T_T_L = "AccessTokenTTL"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN_T_T_L) + @javax.annotation.Nullable + private Integer accessTokenTTL = 3600; + + public static final String SERIALIZED_NAME_ID_TOKEN_T_T_L = "IDTokenTTL"; + @SerializedName(SERIALIZED_NAME_ID_TOKEN_T_T_L) + @javax.annotation.Nullable + private Integer idTokenTTL = 3600; + + public static final String SERIALIZED_NAME_REFRESH_TOKEN_T_T_L = "RefreshTokenTTL"; + @SerializedName(SERIALIZED_NAME_REFRESH_TOKEN_T_T_L) + @javax.annotation.Nullable + private Integer refreshTokenTTL = 86400; + + public static final String SERIALIZED_NAME_ENABLE_P_K_C_E = "EnablePKCE"; + @SerializedName(SERIALIZED_NAME_ENABLE_P_K_C_E) + @javax.annotation.Nullable + private Boolean enablePKCE; + + public static final String SERIALIZED_NAME_IS_PREBUILT_INTEGRATION = "IsPrebuiltIntegration"; + @SerializedName(SERIALIZED_NAME_IS_PREBUILT_INTEGRATION) + @javax.annotation.Nullable + private Boolean isPrebuiltIntegration; + + public static final String SERIALIZED_NAME_INTEGRATION_TYPE = "IntegrationType"; + @SerializedName(SERIALIZED_NAME_INTEGRATION_TYPE) + @javax.annotation.Nullable + private String integrationType; + + /** + * Token-endpoint client authentication method. Defaults to client_secret_post when omitted. + */ + @JsonAdapter(TokenAuthMethodEnum.Adapter.class) + public enum TokenAuthMethodEnum { + CLIENT_SECRET_BASIC("client_secret_basic"), + + CLIENT_SECRET_POST("client_secret_post"), + + CLIENT_SECRET_AUTO("client_secret_auto"), + + NONE("none"); + + private String value; + + TokenAuthMethodEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TokenAuthMethodEnum fromValue(String value) { + for (TokenAuthMethodEnum b : TokenAuthMethodEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<TokenAuthMethodEnum> { + @Override + public void write(final JsonWriter jsonWriter, final TokenAuthMethodEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TokenAuthMethodEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TokenAuthMethodEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TokenAuthMethodEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TOKEN_AUTH_METHOD = "TokenAuthMethod"; + @SerializedName(SERIALIZED_NAME_TOKEN_AUTH_METHOD) + @javax.annotation.Nullable + private TokenAuthMethodEnum tokenAuthMethod = TokenAuthMethodEnum.CLIENT_SECRET_POST; + + public static final String SERIALIZED_NAME_DEFAULT_WORKFLOW = "DefaultWorkflow"; + @SerializedName(SERIALIZED_NAME_DEFAULT_WORKFLOW) + @javax.annotation.Nullable + private String defaultWorkflow; + + public static final String SERIALIZED_NAME_CONNECTIONS = "Connections"; + @SerializedName(SERIALIZED_NAME_CONNECTIONS) + @javax.annotation.Nullable + private OAuthIntegrationBaseModelConnections connections; + + public OAuthIntegrationBaseModel() { + } + + public OAuthIntegrationBaseModel redirectURIs(@javax.annotation.Nullable List<String> redirectURIs) { + this.redirectURIs = redirectURIs; + return this; + } + + public OAuthIntegrationBaseModel addRedirectURIsItem(String redirectURIsItem) { + if (this.redirectURIs == null) { + this.redirectURIs = new ArrayList<>(); + } + this.redirectURIs.add(redirectURIsItem); + return this; + } + + /** + * Get redirectURIs + * @return redirectURIs + */ + @javax.annotation.Nullable + public List<String> getRedirectURIs() { + return redirectURIs; + } + + public void setRedirectURIs(@javax.annotation.Nullable List<String> redirectURIs) { + this.redirectURIs = redirectURIs; + } + + + public OAuthIntegrationBaseModel allowedScopes(@javax.annotation.Nullable List<AllowedScopesEnum> allowedScopes) { + this.allowedScopes = allowedScopes; + return this; + } + + public OAuthIntegrationBaseModel addAllowedScopesItem(AllowedScopesEnum allowedScopesItem) { + if (this.allowedScopes == null) { + this.allowedScopes = new ArrayList<>(); + } + this.allowedScopes.add(allowedScopesItem); + return this; + } + + /** + * Get allowedScopes + * @return allowedScopes + */ + @javax.annotation.Nullable + public List<AllowedScopesEnum> getAllowedScopes() { + return allowedScopes; + } + + public void setAllowedScopes(@javax.annotation.Nullable List<AllowedScopesEnum> allowedScopes) { + this.allowedScopes = allowedScopes; + } + + + public OAuthIntegrationBaseModel grantTypes(@javax.annotation.Nullable List<GrantTypesEnum> grantTypes) { + this.grantTypes = grantTypes; + return this; + } + + public OAuthIntegrationBaseModel addGrantTypesItem(GrantTypesEnum grantTypesItem) { + if (this.grantTypes == null) { + this.grantTypes = new ArrayList<>(); + } + this.grantTypes.add(grantTypesItem); + return this; + } + + /** + * Only authorization_code and refresh_token are permitted for OAuth integrations. + * @return grantTypes + */ + @javax.annotation.Nullable + public List<GrantTypesEnum> getGrantTypes() { + return grantTypes; + } + + public void setGrantTypes(@javax.annotation.Nullable List<GrantTypesEnum> grantTypes) { + this.grantTypes = grantTypes; + } + + + public OAuthIntegrationBaseModel accessTokenMappingTemplate(@javax.annotation.Nullable String accessTokenMappingTemplate) { + this.accessTokenMappingTemplate = accessTokenMappingTemplate; + return this; + } + + /** + * Get accessTokenMappingTemplate + * @return accessTokenMappingTemplate + */ + @javax.annotation.Nullable + public String getAccessTokenMappingTemplate() { + return accessTokenMappingTemplate; + } + + public void setAccessTokenMappingTemplate(@javax.annotation.Nullable String accessTokenMappingTemplate) { + this.accessTokenMappingTemplate = accessTokenMappingTemplate; + } + + + public OAuthIntegrationBaseModel idTokenMappingTemplate(@javax.annotation.Nullable String idTokenMappingTemplate) { + this.idTokenMappingTemplate = idTokenMappingTemplate; + return this; + } + + /** + * Get idTokenMappingTemplate + * @return idTokenMappingTemplate + */ + @javax.annotation.Nullable + public String getIdTokenMappingTemplate() { + return idTokenMappingTemplate; + } + + public void setIdTokenMappingTemplate(@javax.annotation.Nullable String idTokenMappingTemplate) { + this.idTokenMappingTemplate = idTokenMappingTemplate; + } + + + public OAuthIntegrationBaseModel accessTokenTTL(@javax.annotation.Nullable Integer accessTokenTTL) { + this.accessTokenTTL = accessTokenTTL; + return this; + } + + /** + * Access token lifetime in seconds. Defaults to 3600 when omitted. + * @return accessTokenTTL + */ + @javax.annotation.Nullable + public Integer getAccessTokenTTL() { + return accessTokenTTL; + } + + public void setAccessTokenTTL(@javax.annotation.Nullable Integer accessTokenTTL) { + this.accessTokenTTL = accessTokenTTL; + } + + + public OAuthIntegrationBaseModel idTokenTTL(@javax.annotation.Nullable Integer idTokenTTL) { + this.idTokenTTL = idTokenTTL; + return this; + } + + /** + * ID token lifetime in seconds. Defaults to 3600 when omitted. + * @return idTokenTTL + */ + @javax.annotation.Nullable + public Integer getIdTokenTTL() { + return idTokenTTL; + } + + public void setIdTokenTTL(@javax.annotation.Nullable Integer idTokenTTL) { + this.idTokenTTL = idTokenTTL; + } + + + public OAuthIntegrationBaseModel refreshTokenTTL(@javax.annotation.Nullable Integer refreshTokenTTL) { + this.refreshTokenTTL = refreshTokenTTL; + return this; + } + + /** + * Refresh token lifetime in seconds. Defaults to 86400 when omitted. + * @return refreshTokenTTL + */ + @javax.annotation.Nullable + public Integer getRefreshTokenTTL() { + return refreshTokenTTL; + } + + public void setRefreshTokenTTL(@javax.annotation.Nullable Integer refreshTokenTTL) { + this.refreshTokenTTL = refreshTokenTTL; + } + + + public OAuthIntegrationBaseModel enablePKCE(@javax.annotation.Nullable Boolean enablePKCE) { + this.enablePKCE = enablePKCE; + return this; + } + + /** + * Get enablePKCE + * @return enablePKCE + */ + @javax.annotation.Nullable + public Boolean getEnablePKCE() { + return enablePKCE; + } + + public void setEnablePKCE(@javax.annotation.Nullable Boolean enablePKCE) { + this.enablePKCE = enablePKCE; + } + + + public OAuthIntegrationBaseModel isPrebuiltIntegration(@javax.annotation.Nullable Boolean isPrebuiltIntegration) { + this.isPrebuiltIntegration = isPrebuiltIntegration; + return this; + } + + /** + * Get isPrebuiltIntegration + * @return isPrebuiltIntegration + */ + @javax.annotation.Nullable + public Boolean getIsPrebuiltIntegration() { + return isPrebuiltIntegration; + } + + public void setIsPrebuiltIntegration(@javax.annotation.Nullable Boolean isPrebuiltIntegration) { + this.isPrebuiltIntegration = isPrebuiltIntegration; + } + + + public OAuthIntegrationBaseModel integrationType(@javax.annotation.Nullable String integrationType) { + this.integrationType = integrationType; + return this; + } + + /** + * Get integrationType + * @return integrationType + */ + @javax.annotation.Nullable + public String getIntegrationType() { + return integrationType; + } + + public void setIntegrationType(@javax.annotation.Nullable String integrationType) { + this.integrationType = integrationType; + } + + + public OAuthIntegrationBaseModel tokenAuthMethod(@javax.annotation.Nullable TokenAuthMethodEnum tokenAuthMethod) { + this.tokenAuthMethod = tokenAuthMethod; + return this; + } + + /** + * Token-endpoint client authentication method. Defaults to client_secret_post when omitted. + * @return tokenAuthMethod + */ + @javax.annotation.Nullable + public TokenAuthMethodEnum getTokenAuthMethod() { + return tokenAuthMethod; + } + + public void setTokenAuthMethod(@javax.annotation.Nullable TokenAuthMethodEnum tokenAuthMethod) { + this.tokenAuthMethod = tokenAuthMethod; + } + + + public OAuthIntegrationBaseModel defaultWorkflow(@javax.annotation.Nullable String defaultWorkflow) { + this.defaultWorkflow = defaultWorkflow; + return this; + } + + /** + * Name of the identity-orchestration workflow the authorize request falls back to when it carries no workflow parameter. Requires the IDENTITY_ORCHESTRATION feature; ignored when it is disabled. The workflow must already exist on the tenant, otherwise the request is rejected as an invalid integration configuration. Surrounding whitespace is trimmed; send an empty or blank string to clear it. + * @return defaultWorkflow + */ + @javax.annotation.Nullable + public String getDefaultWorkflow() { + return defaultWorkflow; + } + + public void setDefaultWorkflow(@javax.annotation.Nullable String defaultWorkflow) { + this.defaultWorkflow = defaultWorkflow; + } + + + public OAuthIntegrationBaseModel connections(@javax.annotation.Nullable OAuthIntegrationBaseModelConnections connections) { + this.connections = connections; + return this; + } + + /** + * Get connections + * @return connections + */ + @javax.annotation.Nullable + public OAuthIntegrationBaseModelConnections getConnections() { + return connections; + } + + public void setConnections(@javax.annotation.Nullable OAuthIntegrationBaseModelConnections connections) { + this.connections = connections; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthIntegrationBaseModel instance itself + */ + public OAuthIntegrationBaseModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthIntegrationBaseModel oauthIntegrationBaseModel = (OAuthIntegrationBaseModel) o; + return Objects.equals(this.redirectURIs, oauthIntegrationBaseModel.redirectURIs) && + Objects.equals(this.allowedScopes, oauthIntegrationBaseModel.allowedScopes) && + Objects.equals(this.grantTypes, oauthIntegrationBaseModel.grantTypes) && + Objects.equals(this.accessTokenMappingTemplate, oauthIntegrationBaseModel.accessTokenMappingTemplate) && + Objects.equals(this.idTokenMappingTemplate, oauthIntegrationBaseModel.idTokenMappingTemplate) && + Objects.equals(this.accessTokenTTL, oauthIntegrationBaseModel.accessTokenTTL) && + Objects.equals(this.idTokenTTL, oauthIntegrationBaseModel.idTokenTTL) && + Objects.equals(this.refreshTokenTTL, oauthIntegrationBaseModel.refreshTokenTTL) && + Objects.equals(this.enablePKCE, oauthIntegrationBaseModel.enablePKCE) && + Objects.equals(this.isPrebuiltIntegration, oauthIntegrationBaseModel.isPrebuiltIntegration) && + Objects.equals(this.integrationType, oauthIntegrationBaseModel.integrationType) && + Objects.equals(this.tokenAuthMethod, oauthIntegrationBaseModel.tokenAuthMethod) && + Objects.equals(this.defaultWorkflow, oauthIntegrationBaseModel.defaultWorkflow) && + Objects.equals(this.connections, oauthIntegrationBaseModel.connections)&& + Objects.equals(this.additionalProperties, oauthIntegrationBaseModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(redirectURIs, allowedScopes, grantTypes, accessTokenMappingTemplate, idTokenMappingTemplate, accessTokenTTL, idTokenTTL, refreshTokenTTL, enablePKCE, isPrebuiltIntegration, integrationType, tokenAuthMethod, defaultWorkflow, connections, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthIntegrationBaseModel {\n"); + sb.append(" redirectURIs: ").append(toIndentedString(redirectURIs)).append("\n"); + sb.append(" allowedScopes: ").append(toIndentedString(allowedScopes)).append("\n"); + sb.append(" grantTypes: ").append(toIndentedString(grantTypes)).append("\n"); + sb.append(" accessTokenMappingTemplate: ").append(toIndentedString(accessTokenMappingTemplate)).append("\n"); + sb.append(" idTokenMappingTemplate: ").append(toIndentedString(idTokenMappingTemplate)).append("\n"); + sb.append(" accessTokenTTL: ").append(toIndentedString(accessTokenTTL)).append("\n"); + sb.append(" idTokenTTL: ").append(toIndentedString(idTokenTTL)).append("\n"); + sb.append(" refreshTokenTTL: ").append(toIndentedString(refreshTokenTTL)).append("\n"); + sb.append(" enablePKCE: ").append(toIndentedString(enablePKCE)).append("\n"); + sb.append(" isPrebuiltIntegration: ").append(toIndentedString(isPrebuiltIntegration)).append("\n"); + sb.append(" integrationType: ").append(toIndentedString(integrationType)).append("\n"); + sb.append(" tokenAuthMethod: ").append(toIndentedString(tokenAuthMethod)).append("\n"); + sb.append(" defaultWorkflow: ").append(toIndentedString(defaultWorkflow)).append("\n"); + sb.append(" connections: ").append(toIndentedString(connections)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("RedirectURIs"); + openapiFields.add("AllowedScopes"); + openapiFields.add("GrantTypes"); + openapiFields.add("AccessTokenMappingTemplate"); + openapiFields.add("IdTokenMappingTemplate"); + openapiFields.add("AccessTokenTTL"); + openapiFields.add("IDTokenTTL"); + openapiFields.add("RefreshTokenTTL"); + openapiFields.add("EnablePKCE"); + openapiFields.add("IsPrebuiltIntegration"); + openapiFields.add("IntegrationType"); + openapiFields.add("TokenAuthMethod"); + openapiFields.add("DefaultWorkflow"); + openapiFields.add("Connections"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OAuthIntegrationBaseModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthIntegrationBaseModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthIntegrationBaseModel is not found in the empty JSON string", OAuthIntegrationBaseModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("RedirectURIs") != null && !jsonObj.get("RedirectURIs").isJsonNull() && !jsonObj.get("RedirectURIs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RedirectURIs` to be an array in the JSON string but got `%s`", jsonObj.get("RedirectURIs").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("AllowedScopes") != null && !jsonObj.get("AllowedScopes").isJsonNull() && !jsonObj.get("AllowedScopes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `AllowedScopes` to be an array in the JSON string but got `%s`", jsonObj.get("AllowedScopes").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("GrantTypes") != null && !jsonObj.get("GrantTypes").isJsonNull() && !jsonObj.get("GrantTypes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `GrantTypes` to be an array in the JSON string but got `%s`", jsonObj.get("GrantTypes").toString())); + } + if ((jsonObj.get("AccessTokenMappingTemplate") != null && !jsonObj.get("AccessTokenMappingTemplate").isJsonNull()) && !jsonObj.get("AccessTokenMappingTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccessTokenMappingTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccessTokenMappingTemplate").toString())); + } + if ((jsonObj.get("IdTokenMappingTemplate") != null && !jsonObj.get("IdTokenMappingTemplate").isJsonNull()) && !jsonObj.get("IdTokenMappingTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IdTokenMappingTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IdTokenMappingTemplate").toString())); + } + if ((jsonObj.get("IntegrationType") != null && !jsonObj.get("IntegrationType").isJsonNull()) && !jsonObj.get("IntegrationType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IntegrationType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IntegrationType").toString())); + } + if ((jsonObj.get("TokenAuthMethod") != null && !jsonObj.get("TokenAuthMethod").isJsonNull()) && !jsonObj.get("TokenAuthMethod").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TokenAuthMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TokenAuthMethod").toString())); + } + // validate the optional field `TokenAuthMethod` + if (jsonObj.get("TokenAuthMethod") != null && !jsonObj.get("TokenAuthMethod").isJsonNull()) { + TokenAuthMethodEnum.validateJsonElement(jsonObj.get("TokenAuthMethod")); + } + if ((jsonObj.get("DefaultWorkflow") != null && !jsonObj.get("DefaultWorkflow").isJsonNull()) && !jsonObj.get("DefaultWorkflow").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DefaultWorkflow` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DefaultWorkflow").toString())); + } + // validate the optional field `Connections` + if (jsonObj.get("Connections") != null && !jsonObj.get("Connections").isJsonNull()) { + OAuthIntegrationBaseModelConnections.validateJsonElement(jsonObj.get("Connections")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthIntegrationBaseModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthIntegrationBaseModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthIntegrationBaseModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthIntegrationBaseModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthIntegrationBaseModel>() { + @Override + public void write(JsonWriter out, OAuthIntegrationBaseModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthIntegrationBaseModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthIntegrationBaseModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthIntegrationBaseModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthIntegrationBaseModel + * @throws IOException if the JSON string is invalid with respect to OAuthIntegrationBaseModel + */ + public static OAuthIntegrationBaseModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthIntegrationBaseModel.class); + } + + /** + * Convert an instance of OAuthIntegrationBaseModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthIntegrationBaseModelConnections.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthIntegrationBaseModelConnections.java new file mode 100644 index 0000000..02ad14c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthIntegrationBaseModelConnections.java @@ -0,0 +1,495 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.OAuthIntegrationBaseModelConnectionsCustomIdpInner; +import com.loginradius.sdk.internal.openapi.model.OAuthIntegrationBaseModelConnectionsEnterpriseInner; +import com.loginradius.sdk.internal.openapi.model.OAuthIntegrationBaseModelConnectionsPasswordLessLogin; +import com.loginradius.sdk.internal.openapi.model.OAuthIntegrationBaseModelConnectionsSocialLoginsInner; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Scopes which login methods this integration offers. A provider may only be listed here if it is already enabled on the app, otherwise the request is rejected as an invalid integration configuration. Omit to leave the stored value unchanged; send an empty array to clear a provider list. Setting Enabled to true without also sending a PasswordLessLogin block disables passwordless email and SMS login for this integration. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthIntegrationBaseModelConnections { + public static final String SERIALIZED_NAME_ENABLED = "Enabled"; + @SerializedName(SERIALIZED_NAME_ENABLED) + @javax.annotation.Nullable + private Boolean enabled; + + public static final String SERIALIZED_NAME_PASSWORD_LESS_LOGIN = "PasswordLessLogin"; + @SerializedName(SERIALIZED_NAME_PASSWORD_LESS_LOGIN) + @javax.annotation.Nullable + private OAuthIntegrationBaseModelConnectionsPasswordLessLogin passwordLessLogin; + + public static final String SERIALIZED_NAME_TRADITIONAL_LOGIN = "TraditionalLogin"; + @SerializedName(SERIALIZED_NAME_TRADITIONAL_LOGIN) + @javax.annotation.Nullable + private Boolean traditionalLogin; + + public static final String SERIALIZED_NAME_SOCIAL_LOGINS = "SocialLogins"; + @SerializedName(SERIALIZED_NAME_SOCIAL_LOGINS) + @javax.annotation.Nullable + private List<OAuthIntegrationBaseModelConnectionsSocialLoginsInner> socialLogins = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CUSTOM_IDP = "CustomIdp"; + @SerializedName(SERIALIZED_NAME_CUSTOM_IDP) + @javax.annotation.Nullable + private List<OAuthIntegrationBaseModelConnectionsCustomIdpInner> customIdp = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ENTERPRISE = "Enterprise"; + @SerializedName(SERIALIZED_NAME_ENTERPRISE) + @javax.annotation.Nullable + private List<OAuthIntegrationBaseModelConnectionsEnterpriseInner> enterprise = new ArrayList<>(); + + public OAuthIntegrationBaseModelConnections() { + } + + public OAuthIntegrationBaseModelConnections enabled(@javax.annotation.Nullable Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get enabled + * @return enabled + */ + @javax.annotation.Nullable + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(@javax.annotation.Nullable Boolean enabled) { + this.enabled = enabled; + } + + + public OAuthIntegrationBaseModelConnections passwordLessLogin(@javax.annotation.Nullable OAuthIntegrationBaseModelConnectionsPasswordLessLogin passwordLessLogin) { + this.passwordLessLogin = passwordLessLogin; + return this; + } + + /** + * Get passwordLessLogin + * @return passwordLessLogin + */ + @javax.annotation.Nullable + public OAuthIntegrationBaseModelConnectionsPasswordLessLogin getPasswordLessLogin() { + return passwordLessLogin; + } + + public void setPasswordLessLogin(@javax.annotation.Nullable OAuthIntegrationBaseModelConnectionsPasswordLessLogin passwordLessLogin) { + this.passwordLessLogin = passwordLessLogin; + } + + + public OAuthIntegrationBaseModelConnections traditionalLogin(@javax.annotation.Nullable Boolean traditionalLogin) { + this.traditionalLogin = traditionalLogin; + return this; + } + + /** + * Get traditionalLogin + * @return traditionalLogin + */ + @javax.annotation.Nullable + public Boolean getTraditionalLogin() { + return traditionalLogin; + } + + public void setTraditionalLogin(@javax.annotation.Nullable Boolean traditionalLogin) { + this.traditionalLogin = traditionalLogin; + } + + + public OAuthIntegrationBaseModelConnections socialLogins(@javax.annotation.Nullable List<OAuthIntegrationBaseModelConnectionsSocialLoginsInner> socialLogins) { + this.socialLogins = socialLogins; + return this; + } + + public OAuthIntegrationBaseModelConnections addSocialLoginsItem(OAuthIntegrationBaseModelConnectionsSocialLoginsInner socialLoginsItem) { + if (this.socialLogins == null) { + this.socialLogins = new ArrayList<>(); + } + this.socialLogins.add(socialLoginsItem); + return this; + } + + /** + * Get socialLogins + * @return socialLogins + */ + @javax.annotation.Nullable + public List<OAuthIntegrationBaseModelConnectionsSocialLoginsInner> getSocialLogins() { + return socialLogins; + } + + public void setSocialLogins(@javax.annotation.Nullable List<OAuthIntegrationBaseModelConnectionsSocialLoginsInner> socialLogins) { + this.socialLogins = socialLogins; + } + + + public OAuthIntegrationBaseModelConnections customIdp(@javax.annotation.Nullable List<OAuthIntegrationBaseModelConnectionsCustomIdpInner> customIdp) { + this.customIdp = customIdp; + return this; + } + + public OAuthIntegrationBaseModelConnections addCustomIdpItem(OAuthIntegrationBaseModelConnectionsCustomIdpInner customIdpItem) { + if (this.customIdp == null) { + this.customIdp = new ArrayList<>(); + } + this.customIdp.add(customIdpItem); + return this; + } + + /** + * Get customIdp + * @return customIdp + */ + @javax.annotation.Nullable + public List<OAuthIntegrationBaseModelConnectionsCustomIdpInner> getCustomIdp() { + return customIdp; + } + + public void setCustomIdp(@javax.annotation.Nullable List<OAuthIntegrationBaseModelConnectionsCustomIdpInner> customIdp) { + this.customIdp = customIdp; + } + + + public OAuthIntegrationBaseModelConnections enterprise(@javax.annotation.Nullable List<OAuthIntegrationBaseModelConnectionsEnterpriseInner> enterprise) { + this.enterprise = enterprise; + return this; + } + + public OAuthIntegrationBaseModelConnections addEnterpriseItem(OAuthIntegrationBaseModelConnectionsEnterpriseInner enterpriseItem) { + if (this.enterprise == null) { + this.enterprise = new ArrayList<>(); + } + this.enterprise.add(enterpriseItem); + return this; + } + + /** + * Get enterprise + * @return enterprise + */ + @javax.annotation.Nullable + public List<OAuthIntegrationBaseModelConnectionsEnterpriseInner> getEnterprise() { + return enterprise; + } + + public void setEnterprise(@javax.annotation.Nullable List<OAuthIntegrationBaseModelConnectionsEnterpriseInner> enterprise) { + this.enterprise = enterprise; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthIntegrationBaseModelConnections instance itself + */ + public OAuthIntegrationBaseModelConnections putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthIntegrationBaseModelConnections oauthIntegrationBaseModelConnections = (OAuthIntegrationBaseModelConnections) o; + return Objects.equals(this.enabled, oauthIntegrationBaseModelConnections.enabled) && + Objects.equals(this.passwordLessLogin, oauthIntegrationBaseModelConnections.passwordLessLogin) && + Objects.equals(this.traditionalLogin, oauthIntegrationBaseModelConnections.traditionalLogin) && + Objects.equals(this.socialLogins, oauthIntegrationBaseModelConnections.socialLogins) && + Objects.equals(this.customIdp, oauthIntegrationBaseModelConnections.customIdp) && + Objects.equals(this.enterprise, oauthIntegrationBaseModelConnections.enterprise)&& + Objects.equals(this.additionalProperties, oauthIntegrationBaseModelConnections.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(enabled, passwordLessLogin, traditionalLogin, socialLogins, customIdp, enterprise, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthIntegrationBaseModelConnections {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" passwordLessLogin: ").append(toIndentedString(passwordLessLogin)).append("\n"); + sb.append(" traditionalLogin: ").append(toIndentedString(traditionalLogin)).append("\n"); + sb.append(" socialLogins: ").append(toIndentedString(socialLogins)).append("\n"); + sb.append(" customIdp: ").append(toIndentedString(customIdp)).append("\n"); + sb.append(" enterprise: ").append(toIndentedString(enterprise)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Enabled"); + openapiFields.add("PasswordLessLogin"); + openapiFields.add("TraditionalLogin"); + openapiFields.add("SocialLogins"); + openapiFields.add("CustomIdp"); + openapiFields.add("Enterprise"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OAuthIntegrationBaseModelConnections + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthIntegrationBaseModelConnections.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthIntegrationBaseModelConnections is not found in the empty JSON string", OAuthIntegrationBaseModelConnections.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `PasswordLessLogin` + if (jsonObj.get("PasswordLessLogin") != null && !jsonObj.get("PasswordLessLogin").isJsonNull()) { + OAuthIntegrationBaseModelConnectionsPasswordLessLogin.validateJsonElement(jsonObj.get("PasswordLessLogin")); + } + if (jsonObj.get("SocialLogins") != null && !jsonObj.get("SocialLogins").isJsonNull()) { + JsonArray jsonArraysocialLogins = jsonObj.getAsJsonArray("SocialLogins"); + if (jsonArraysocialLogins != null) { + // ensure the json data is an array + if (!jsonObj.get("SocialLogins").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `SocialLogins` to be an array in the JSON string but got `%s`", jsonObj.get("SocialLogins").toString())); + } + + // validate the optional field `SocialLogins` (array) + for (int i = 0; i < jsonArraysocialLogins.size(); i++) { + OAuthIntegrationBaseModelConnectionsSocialLoginsInner.validateJsonElement(jsonArraysocialLogins.get(i)); + }; + } + } + if (jsonObj.get("CustomIdp") != null && !jsonObj.get("CustomIdp").isJsonNull()) { + JsonArray jsonArraycustomIdp = jsonObj.getAsJsonArray("CustomIdp"); + if (jsonArraycustomIdp != null) { + // ensure the json data is an array + if (!jsonObj.get("CustomIdp").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `CustomIdp` to be an array in the JSON string but got `%s`", jsonObj.get("CustomIdp").toString())); + } + + // validate the optional field `CustomIdp` (array) + for (int i = 0; i < jsonArraycustomIdp.size(); i++) { + OAuthIntegrationBaseModelConnectionsCustomIdpInner.validateJsonElement(jsonArraycustomIdp.get(i)); + }; + } + } + if (jsonObj.get("Enterprise") != null && !jsonObj.get("Enterprise").isJsonNull()) { + JsonArray jsonArrayenterprise = jsonObj.getAsJsonArray("Enterprise"); + if (jsonArrayenterprise != null) { + // ensure the json data is an array + if (!jsonObj.get("Enterprise").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Enterprise` to be an array in the JSON string but got `%s`", jsonObj.get("Enterprise").toString())); + } + + // validate the optional field `Enterprise` (array) + for (int i = 0; i < jsonArrayenterprise.size(); i++) { + OAuthIntegrationBaseModelConnectionsEnterpriseInner.validateJsonElement(jsonArrayenterprise.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthIntegrationBaseModelConnections.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthIntegrationBaseModelConnections' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthIntegrationBaseModelConnections> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthIntegrationBaseModelConnections.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthIntegrationBaseModelConnections>() { + @Override + public void write(JsonWriter out, OAuthIntegrationBaseModelConnections value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthIntegrationBaseModelConnections read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthIntegrationBaseModelConnections instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthIntegrationBaseModelConnections given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthIntegrationBaseModelConnections + * @throws IOException if the JSON string is invalid with respect to OAuthIntegrationBaseModelConnections + */ + public static OAuthIntegrationBaseModelConnections fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthIntegrationBaseModelConnections.class); + } + + /** + * Convert an instance of OAuthIntegrationBaseModelConnections to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthIntegrationBaseModelConnectionsCustomIdpInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthIntegrationBaseModelConnectionsCustomIdpInner.java new file mode 100644 index 0000000..17dfc0f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthIntegrationBaseModelConnectionsCustomIdpInner.java @@ -0,0 +1,314 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuthIntegrationBaseModelConnectionsCustomIdpInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthIntegrationBaseModelConnectionsCustomIdpInner { + public static final String SERIALIZED_NAME_IS_ENABLED = "IsEnabled"; + @SerializedName(SERIALIZED_NAME_IS_ENABLED) + @javax.annotation.Nullable + private Boolean isEnabled; + + public static final String SERIALIZED_NAME_PROVIDER_NAME = "ProviderName"; + @SerializedName(SERIALIZED_NAME_PROVIDER_NAME) + @javax.annotation.Nullable + private String providerName; + + public OAuthIntegrationBaseModelConnectionsCustomIdpInner() { + } + + public OAuthIntegrationBaseModelConnectionsCustomIdpInner isEnabled(@javax.annotation.Nullable Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Get isEnabled + * @return isEnabled + */ + @javax.annotation.Nullable + public Boolean getIsEnabled() { + return isEnabled; + } + + public void setIsEnabled(@javax.annotation.Nullable Boolean isEnabled) { + this.isEnabled = isEnabled; + } + + + public OAuthIntegrationBaseModelConnectionsCustomIdpInner providerName(@javax.annotation.Nullable String providerName) { + this.providerName = providerName; + return this; + } + + /** + * Get providerName + * @return providerName + */ + @javax.annotation.Nullable + public String getProviderName() { + return providerName; + } + + public void setProviderName(@javax.annotation.Nullable String providerName) { + this.providerName = providerName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthIntegrationBaseModelConnectionsCustomIdpInner instance itself + */ + public OAuthIntegrationBaseModelConnectionsCustomIdpInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthIntegrationBaseModelConnectionsCustomIdpInner oauthIntegrationBaseModelConnectionsCustomIdpInner = (OAuthIntegrationBaseModelConnectionsCustomIdpInner) o; + return Objects.equals(this.isEnabled, oauthIntegrationBaseModelConnectionsCustomIdpInner.isEnabled) && + Objects.equals(this.providerName, oauthIntegrationBaseModelConnectionsCustomIdpInner.providerName)&& + Objects.equals(this.additionalProperties, oauthIntegrationBaseModelConnectionsCustomIdpInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isEnabled, providerName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthIntegrationBaseModelConnectionsCustomIdpInner {\n"); + sb.append(" isEnabled: ").append(toIndentedString(isEnabled)).append("\n"); + sb.append(" providerName: ").append(toIndentedString(providerName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsEnabled"); + openapiFields.add("ProviderName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OAuthIntegrationBaseModelConnectionsCustomIdpInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthIntegrationBaseModelConnectionsCustomIdpInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthIntegrationBaseModelConnectionsCustomIdpInner is not found in the empty JSON string", OAuthIntegrationBaseModelConnectionsCustomIdpInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ProviderName") != null && !jsonObj.get("ProviderName").isJsonNull()) && !jsonObj.get("ProviderName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProviderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProviderName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthIntegrationBaseModelConnectionsCustomIdpInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthIntegrationBaseModelConnectionsCustomIdpInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthIntegrationBaseModelConnectionsCustomIdpInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthIntegrationBaseModelConnectionsCustomIdpInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthIntegrationBaseModelConnectionsCustomIdpInner>() { + @Override + public void write(JsonWriter out, OAuthIntegrationBaseModelConnectionsCustomIdpInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthIntegrationBaseModelConnectionsCustomIdpInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthIntegrationBaseModelConnectionsCustomIdpInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthIntegrationBaseModelConnectionsCustomIdpInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthIntegrationBaseModelConnectionsCustomIdpInner + * @throws IOException if the JSON string is invalid with respect to OAuthIntegrationBaseModelConnectionsCustomIdpInner + */ + public static OAuthIntegrationBaseModelConnectionsCustomIdpInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthIntegrationBaseModelConnectionsCustomIdpInner.class); + } + + /** + * Convert an instance of OAuthIntegrationBaseModelConnectionsCustomIdpInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthIntegrationBaseModelConnectionsEnterpriseInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthIntegrationBaseModelConnectionsEnterpriseInner.java new file mode 100644 index 0000000..8cf3aa4 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthIntegrationBaseModelConnectionsEnterpriseInner.java @@ -0,0 +1,314 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuthIntegrationBaseModelConnectionsEnterpriseInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthIntegrationBaseModelConnectionsEnterpriseInner { + public static final String SERIALIZED_NAME_IS_ENABLED = "IsEnabled"; + @SerializedName(SERIALIZED_NAME_IS_ENABLED) + @javax.annotation.Nullable + private Boolean isEnabled; + + public static final String SERIALIZED_NAME_PROVIDER_NAME = "ProviderName"; + @SerializedName(SERIALIZED_NAME_PROVIDER_NAME) + @javax.annotation.Nullable + private String providerName; + + public OAuthIntegrationBaseModelConnectionsEnterpriseInner() { + } + + public OAuthIntegrationBaseModelConnectionsEnterpriseInner isEnabled(@javax.annotation.Nullable Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Get isEnabled + * @return isEnabled + */ + @javax.annotation.Nullable + public Boolean getIsEnabled() { + return isEnabled; + } + + public void setIsEnabled(@javax.annotation.Nullable Boolean isEnabled) { + this.isEnabled = isEnabled; + } + + + public OAuthIntegrationBaseModelConnectionsEnterpriseInner providerName(@javax.annotation.Nullable String providerName) { + this.providerName = providerName; + return this; + } + + /** + * Get providerName + * @return providerName + */ + @javax.annotation.Nullable + public String getProviderName() { + return providerName; + } + + public void setProviderName(@javax.annotation.Nullable String providerName) { + this.providerName = providerName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthIntegrationBaseModelConnectionsEnterpriseInner instance itself + */ + public OAuthIntegrationBaseModelConnectionsEnterpriseInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthIntegrationBaseModelConnectionsEnterpriseInner oauthIntegrationBaseModelConnectionsEnterpriseInner = (OAuthIntegrationBaseModelConnectionsEnterpriseInner) o; + return Objects.equals(this.isEnabled, oauthIntegrationBaseModelConnectionsEnterpriseInner.isEnabled) && + Objects.equals(this.providerName, oauthIntegrationBaseModelConnectionsEnterpriseInner.providerName)&& + Objects.equals(this.additionalProperties, oauthIntegrationBaseModelConnectionsEnterpriseInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isEnabled, providerName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthIntegrationBaseModelConnectionsEnterpriseInner {\n"); + sb.append(" isEnabled: ").append(toIndentedString(isEnabled)).append("\n"); + sb.append(" providerName: ").append(toIndentedString(providerName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsEnabled"); + openapiFields.add("ProviderName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OAuthIntegrationBaseModelConnectionsEnterpriseInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthIntegrationBaseModelConnectionsEnterpriseInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthIntegrationBaseModelConnectionsEnterpriseInner is not found in the empty JSON string", OAuthIntegrationBaseModelConnectionsEnterpriseInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ProviderName") != null && !jsonObj.get("ProviderName").isJsonNull()) && !jsonObj.get("ProviderName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProviderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProviderName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthIntegrationBaseModelConnectionsEnterpriseInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthIntegrationBaseModelConnectionsEnterpriseInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthIntegrationBaseModelConnectionsEnterpriseInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthIntegrationBaseModelConnectionsEnterpriseInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthIntegrationBaseModelConnectionsEnterpriseInner>() { + @Override + public void write(JsonWriter out, OAuthIntegrationBaseModelConnectionsEnterpriseInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthIntegrationBaseModelConnectionsEnterpriseInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthIntegrationBaseModelConnectionsEnterpriseInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthIntegrationBaseModelConnectionsEnterpriseInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthIntegrationBaseModelConnectionsEnterpriseInner + * @throws IOException if the JSON string is invalid with respect to OAuthIntegrationBaseModelConnectionsEnterpriseInner + */ + public static OAuthIntegrationBaseModelConnectionsEnterpriseInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthIntegrationBaseModelConnectionsEnterpriseInner.class); + } + + /** + * Convert an instance of OAuthIntegrationBaseModelConnectionsEnterpriseInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthIntegrationBaseModelConnectionsPasswordLessLogin.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthIntegrationBaseModelConnectionsPasswordLessLogin.java new file mode 100644 index 0000000..50ebe19 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthIntegrationBaseModelConnectionsPasswordLessLogin.java @@ -0,0 +1,338 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuthIntegrationBaseModelConnectionsPasswordLessLogin + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthIntegrationBaseModelConnectionsPasswordLessLogin { + public static final String SERIALIZED_NAME_ENABLED = "Enabled"; + @SerializedName(SERIALIZED_NAME_ENABLED) + @javax.annotation.Nullable + private Boolean enabled; + + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private Boolean email; + + public static final String SERIALIZED_NAME_S_M_S = "SMS"; + @SerializedName(SERIALIZED_NAME_S_M_S) + @javax.annotation.Nullable + private Boolean SMS; + + public OAuthIntegrationBaseModelConnectionsPasswordLessLogin() { + } + + public OAuthIntegrationBaseModelConnectionsPasswordLessLogin enabled(@javax.annotation.Nullable Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get enabled + * @return enabled + */ + @javax.annotation.Nullable + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(@javax.annotation.Nullable Boolean enabled) { + this.enabled = enabled; + } + + + public OAuthIntegrationBaseModelConnectionsPasswordLessLogin email(@javax.annotation.Nullable Boolean email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + */ + @javax.annotation.Nullable + public Boolean getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable Boolean email) { + this.email = email; + } + + + public OAuthIntegrationBaseModelConnectionsPasswordLessLogin SMS(@javax.annotation.Nullable Boolean SMS) { + this.SMS = SMS; + return this; + } + + /** + * Get SMS + * @return SMS + */ + @javax.annotation.Nullable + public Boolean getSMS() { + return SMS; + } + + public void setSMS(@javax.annotation.Nullable Boolean SMS) { + this.SMS = SMS; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthIntegrationBaseModelConnectionsPasswordLessLogin instance itself + */ + public OAuthIntegrationBaseModelConnectionsPasswordLessLogin putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthIntegrationBaseModelConnectionsPasswordLessLogin oauthIntegrationBaseModelConnectionsPasswordLessLogin = (OAuthIntegrationBaseModelConnectionsPasswordLessLogin) o; + return Objects.equals(this.enabled, oauthIntegrationBaseModelConnectionsPasswordLessLogin.enabled) && + Objects.equals(this.email, oauthIntegrationBaseModelConnectionsPasswordLessLogin.email) && + Objects.equals(this.SMS, oauthIntegrationBaseModelConnectionsPasswordLessLogin.SMS)&& + Objects.equals(this.additionalProperties, oauthIntegrationBaseModelConnectionsPasswordLessLogin.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(enabled, email, SMS, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthIntegrationBaseModelConnectionsPasswordLessLogin {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" SMS: ").append(toIndentedString(SMS)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Enabled"); + openapiFields.add("Email"); + openapiFields.add("SMS"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OAuthIntegrationBaseModelConnectionsPasswordLessLogin + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthIntegrationBaseModelConnectionsPasswordLessLogin.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthIntegrationBaseModelConnectionsPasswordLessLogin is not found in the empty JSON string", OAuthIntegrationBaseModelConnectionsPasswordLessLogin.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthIntegrationBaseModelConnectionsPasswordLessLogin.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthIntegrationBaseModelConnectionsPasswordLessLogin' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthIntegrationBaseModelConnectionsPasswordLessLogin> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthIntegrationBaseModelConnectionsPasswordLessLogin.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthIntegrationBaseModelConnectionsPasswordLessLogin>() { + @Override + public void write(JsonWriter out, OAuthIntegrationBaseModelConnectionsPasswordLessLogin value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthIntegrationBaseModelConnectionsPasswordLessLogin read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthIntegrationBaseModelConnectionsPasswordLessLogin instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthIntegrationBaseModelConnectionsPasswordLessLogin given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthIntegrationBaseModelConnectionsPasswordLessLogin + * @throws IOException if the JSON string is invalid with respect to OAuthIntegrationBaseModelConnectionsPasswordLessLogin + */ + public static OAuthIntegrationBaseModelConnectionsPasswordLessLogin fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthIntegrationBaseModelConnectionsPasswordLessLogin.class); + } + + /** + * Convert an instance of OAuthIntegrationBaseModelConnectionsPasswordLessLogin to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthIntegrationBaseModelConnectionsSocialLoginsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthIntegrationBaseModelConnectionsSocialLoginsInner.java new file mode 100644 index 0000000..40a2915 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthIntegrationBaseModelConnectionsSocialLoginsInner.java @@ -0,0 +1,314 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuthIntegrationBaseModelConnectionsSocialLoginsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthIntegrationBaseModelConnectionsSocialLoginsInner { + public static final String SERIALIZED_NAME_IS_ENABLED = "IsEnabled"; + @SerializedName(SERIALIZED_NAME_IS_ENABLED) + @javax.annotation.Nullable + private Boolean isEnabled; + + public static final String SERIALIZED_NAME_PROVIDER_NAME = "ProviderName"; + @SerializedName(SERIALIZED_NAME_PROVIDER_NAME) + @javax.annotation.Nullable + private String providerName; + + public OAuthIntegrationBaseModelConnectionsSocialLoginsInner() { + } + + public OAuthIntegrationBaseModelConnectionsSocialLoginsInner isEnabled(@javax.annotation.Nullable Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Get isEnabled + * @return isEnabled + */ + @javax.annotation.Nullable + public Boolean getIsEnabled() { + return isEnabled; + } + + public void setIsEnabled(@javax.annotation.Nullable Boolean isEnabled) { + this.isEnabled = isEnabled; + } + + + public OAuthIntegrationBaseModelConnectionsSocialLoginsInner providerName(@javax.annotation.Nullable String providerName) { + this.providerName = providerName; + return this; + } + + /** + * Get providerName + * @return providerName + */ + @javax.annotation.Nullable + public String getProviderName() { + return providerName; + } + + public void setProviderName(@javax.annotation.Nullable String providerName) { + this.providerName = providerName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthIntegrationBaseModelConnectionsSocialLoginsInner instance itself + */ + public OAuthIntegrationBaseModelConnectionsSocialLoginsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthIntegrationBaseModelConnectionsSocialLoginsInner oauthIntegrationBaseModelConnectionsSocialLoginsInner = (OAuthIntegrationBaseModelConnectionsSocialLoginsInner) o; + return Objects.equals(this.isEnabled, oauthIntegrationBaseModelConnectionsSocialLoginsInner.isEnabled) && + Objects.equals(this.providerName, oauthIntegrationBaseModelConnectionsSocialLoginsInner.providerName)&& + Objects.equals(this.additionalProperties, oauthIntegrationBaseModelConnectionsSocialLoginsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isEnabled, providerName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthIntegrationBaseModelConnectionsSocialLoginsInner {\n"); + sb.append(" isEnabled: ").append(toIndentedString(isEnabled)).append("\n"); + sb.append(" providerName: ").append(toIndentedString(providerName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsEnabled"); + openapiFields.add("ProviderName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OAuthIntegrationBaseModelConnectionsSocialLoginsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthIntegrationBaseModelConnectionsSocialLoginsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthIntegrationBaseModelConnectionsSocialLoginsInner is not found in the empty JSON string", OAuthIntegrationBaseModelConnectionsSocialLoginsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ProviderName") != null && !jsonObj.get("ProviderName").isJsonNull()) && !jsonObj.get("ProviderName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProviderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProviderName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthIntegrationBaseModelConnectionsSocialLoginsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthIntegrationBaseModelConnectionsSocialLoginsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthIntegrationBaseModelConnectionsSocialLoginsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthIntegrationBaseModelConnectionsSocialLoginsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthIntegrationBaseModelConnectionsSocialLoginsInner>() { + @Override + public void write(JsonWriter out, OAuthIntegrationBaseModelConnectionsSocialLoginsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthIntegrationBaseModelConnectionsSocialLoginsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthIntegrationBaseModelConnectionsSocialLoginsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthIntegrationBaseModelConnectionsSocialLoginsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthIntegrationBaseModelConnectionsSocialLoginsInner + * @throws IOException if the JSON string is invalid with respect to OAuthIntegrationBaseModelConnectionsSocialLoginsInner + */ + public static OAuthIntegrationBaseModelConnectionsSocialLoginsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthIntegrationBaseModelConnectionsSocialLoginsInner.class); + } + + /** + * Convert an instance of OAuthIntegrationBaseModelConnectionsSocialLoginsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthIntegrationCreateCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthIntegrationCreateCore.java new file mode 100644 index 0000000..832ea2d --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthIntegrationCreateCore.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuthIntegrationCreateCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthIntegrationCreateCore { + public static final String SERIALIZED_NAME_DISPLAY_NAME = "DisplayName"; + @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) + @javax.annotation.Nonnull + private String displayName; + + public OAuthIntegrationCreateCore() { + } + + public OAuthIntegrationCreateCore displayName(@javax.annotation.Nonnull String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Get displayName + * @return displayName + */ + @javax.annotation.Nonnull + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(@javax.annotation.Nonnull String displayName) { + this.displayName = displayName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthIntegrationCreateCore instance itself + */ + public OAuthIntegrationCreateCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthIntegrationCreateCore oauthIntegrationCreateCore = (OAuthIntegrationCreateCore) o; + return Objects.equals(this.displayName, oauthIntegrationCreateCore.displayName)&& + Objects.equals(this.additionalProperties, oauthIntegrationCreateCore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(displayName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthIntegrationCreateCore {\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("DisplayName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("DisplayName"); + } + + /** + * 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 OAuthIntegrationCreateCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthIntegrationCreateCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthIntegrationCreateCore is not found in the empty JSON string", OAuthIntegrationCreateCore.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OAuthIntegrationCreateCore.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("DisplayName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DisplayName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DisplayName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthIntegrationCreateCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthIntegrationCreateCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthIntegrationCreateCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthIntegrationCreateCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthIntegrationCreateCore>() { + @Override + public void write(JsonWriter out, OAuthIntegrationCreateCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthIntegrationCreateCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthIntegrationCreateCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthIntegrationCreateCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthIntegrationCreateCore + * @throws IOException if the JSON string is invalid with respect to OAuthIntegrationCreateCore + */ + public static OAuthIntegrationCreateCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthIntegrationCreateCore.class); + } + + /** + * Convert an instance of OAuthIntegrationCreateCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthIntegrationCredentialsResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthIntegrationCredentialsResponse.java new file mode 100644 index 0000000..8b75a48 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthIntegrationCredentialsResponse.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * Client credentials returned after rotating an OAuth integration's secret. The plaintext ClientSecret is returned only once, in this response; only the hash is persisted server-side. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthIntegrationCredentialsResponse { + public static final String SERIALIZED_NAME_CLIENT_ID = "ClientId"; + @SerializedName(SERIALIZED_NAME_CLIENT_ID) + @javax.annotation.Nullable + private String clientId; + + public static final String SERIALIZED_NAME_CLIENT_SECRET = "ClientSecret"; + @SerializedName(SERIALIZED_NAME_CLIENT_SECRET) + @javax.annotation.Nullable + private String clientSecret; + + public OAuthIntegrationCredentialsResponse() { + } + + public OAuthIntegrationCredentialsResponse clientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * The integration's immutable client identifier (unchanged by rotation). + * @return clientId + */ + @javax.annotation.Nullable + public String getClientId() { + return clientId; + } + + public void setClientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + } + + + public OAuthIntegrationCredentialsResponse clientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * The newly generated plaintext client secret. Shown only once. + * @return clientSecret + */ + @javax.annotation.Nullable + public String getClientSecret() { + return clientSecret; + } + + public void setClientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthIntegrationCredentialsResponse instance itself + */ + public OAuthIntegrationCredentialsResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthIntegrationCredentialsResponse oauthIntegrationCredentialsResponse = (OAuthIntegrationCredentialsResponse) o; + return Objects.equals(this.clientId, oauthIntegrationCredentialsResponse.clientId) && + Objects.equals(this.clientSecret, oauthIntegrationCredentialsResponse.clientSecret)&& + Objects.equals(this.additionalProperties, oauthIntegrationCredentialsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, clientSecret, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthIntegrationCredentialsResponse {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ClientId"); + openapiFields.add("ClientSecret"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OAuthIntegrationCredentialsResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthIntegrationCredentialsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthIntegrationCredentialsResponse is not found in the empty JSON string", OAuthIntegrationCredentialsResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ClientId") != null && !jsonObj.get("ClientId").isJsonNull()) && !jsonObj.get("ClientId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ClientId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ClientId").toString())); + } + if ((jsonObj.get("ClientSecret") != null && !jsonObj.get("ClientSecret").isJsonNull()) && !jsonObj.get("ClientSecret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ClientSecret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ClientSecret").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthIntegrationCredentialsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthIntegrationCredentialsResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthIntegrationCredentialsResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthIntegrationCredentialsResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthIntegrationCredentialsResponse>() { + @Override + public void write(JsonWriter out, OAuthIntegrationCredentialsResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthIntegrationCredentialsResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthIntegrationCredentialsResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthIntegrationCredentialsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthIntegrationCredentialsResponse + * @throws IOException if the JSON string is invalid with respect to OAuthIntegrationCredentialsResponse + */ + public static OAuthIntegrationCredentialsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthIntegrationCredentialsResponse.class); + } + + /** + * Convert an instance of OAuthIntegrationCredentialsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthIntegrationResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthIntegrationResponse.java new file mode 100644 index 0000000..f627b91 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthIntegrationResponse.java @@ -0,0 +1,983 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.OAuthIntegrationBaseModelConnections; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuthIntegrationResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthIntegrationResponse { + public static final String SERIALIZED_NAME_REDIRECT_U_R_IS = "RedirectURIs"; + @SerializedName(SERIALIZED_NAME_REDIRECT_U_R_IS) + @javax.annotation.Nullable + private List<String> redirectURIs = new ArrayList<>(); + + /** + * Gets or Sets allowedScopes + */ + @JsonAdapter(AllowedScopesEnum.Adapter.class) + public enum AllowedScopesEnum { + OPENID("openid"), + + EMAIL("email"), + + PHONE("phone"), + + PROFILE("profile"), + + ADDRESS("address"); + + private String value; + + AllowedScopesEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AllowedScopesEnum fromValue(String value) { + for (AllowedScopesEnum b : AllowedScopesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<AllowedScopesEnum> { + @Override + public void write(final JsonWriter jsonWriter, final AllowedScopesEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AllowedScopesEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AllowedScopesEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AllowedScopesEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ALLOWED_SCOPES = "AllowedScopes"; + @SerializedName(SERIALIZED_NAME_ALLOWED_SCOPES) + @javax.annotation.Nullable + private List<AllowedScopesEnum> allowedScopes = new ArrayList<>(); + + /** + * Gets or Sets grantTypes + */ + @JsonAdapter(GrantTypesEnum.Adapter.class) + public enum GrantTypesEnum { + AUTHORIZATION_CODE("authorization_code"), + + REFRESH_TOKEN("refresh_token"); + + private String value; + + GrantTypesEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static GrantTypesEnum fromValue(String value) { + for (GrantTypesEnum b : GrantTypesEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<GrantTypesEnum> { + @Override + public void write(final JsonWriter jsonWriter, final GrantTypesEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public GrantTypesEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return GrantTypesEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + GrantTypesEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_GRANT_TYPES = "GrantTypes"; + @SerializedName(SERIALIZED_NAME_GRANT_TYPES) + @javax.annotation.Nullable + private List<GrantTypesEnum> grantTypes = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ACCESS_TOKEN_MAPPING_TEMPLATE = "AccessTokenMappingTemplate"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN_MAPPING_TEMPLATE) + @javax.annotation.Nullable + private String accessTokenMappingTemplate; + + public static final String SERIALIZED_NAME_ID_TOKEN_MAPPING_TEMPLATE = "IdTokenMappingTemplate"; + @SerializedName(SERIALIZED_NAME_ID_TOKEN_MAPPING_TEMPLATE) + @javax.annotation.Nullable + private String idTokenMappingTemplate; + + public static final String SERIALIZED_NAME_ACCESS_TOKEN_T_T_L = "AccessTokenTTL"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN_T_T_L) + @javax.annotation.Nullable + private Integer accessTokenTTL = 3600; + + public static final String SERIALIZED_NAME_ID_TOKEN_T_T_L = "IDTokenTTL"; + @SerializedName(SERIALIZED_NAME_ID_TOKEN_T_T_L) + @javax.annotation.Nullable + private Integer idTokenTTL = 3600; + + public static final String SERIALIZED_NAME_REFRESH_TOKEN_T_T_L = "RefreshTokenTTL"; + @SerializedName(SERIALIZED_NAME_REFRESH_TOKEN_T_T_L) + @javax.annotation.Nullable + private Integer refreshTokenTTL = 86400; + + public static final String SERIALIZED_NAME_ENABLE_P_K_C_E = "EnablePKCE"; + @SerializedName(SERIALIZED_NAME_ENABLE_P_K_C_E) + @javax.annotation.Nullable + private Boolean enablePKCE; + + public static final String SERIALIZED_NAME_IS_PREBUILT_INTEGRATION = "IsPrebuiltIntegration"; + @SerializedName(SERIALIZED_NAME_IS_PREBUILT_INTEGRATION) + @javax.annotation.Nullable + private Boolean isPrebuiltIntegration; + + public static final String SERIALIZED_NAME_INTEGRATION_TYPE = "IntegrationType"; + @SerializedName(SERIALIZED_NAME_INTEGRATION_TYPE) + @javax.annotation.Nullable + private String integrationType; + + /** + * Token-endpoint client authentication method. Defaults to client_secret_post when omitted. + */ + @JsonAdapter(TokenAuthMethodEnum.Adapter.class) + public enum TokenAuthMethodEnum { + CLIENT_SECRET_BASIC("client_secret_basic"), + + CLIENT_SECRET_POST("client_secret_post"), + + CLIENT_SECRET_AUTO("client_secret_auto"), + + NONE("none"); + + private String value; + + TokenAuthMethodEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TokenAuthMethodEnum fromValue(String value) { + for (TokenAuthMethodEnum b : TokenAuthMethodEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<TokenAuthMethodEnum> { + @Override + public void write(final JsonWriter jsonWriter, final TokenAuthMethodEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TokenAuthMethodEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TokenAuthMethodEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TokenAuthMethodEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TOKEN_AUTH_METHOD = "TokenAuthMethod"; + @SerializedName(SERIALIZED_NAME_TOKEN_AUTH_METHOD) + @javax.annotation.Nullable + private TokenAuthMethodEnum tokenAuthMethod = TokenAuthMethodEnum.CLIENT_SECRET_POST; + + public static final String SERIALIZED_NAME_DEFAULT_WORKFLOW = "DefaultWorkflow"; + @SerializedName(SERIALIZED_NAME_DEFAULT_WORKFLOW) + @javax.annotation.Nullable + private String defaultWorkflow; + + public static final String SERIALIZED_NAME_CONNECTIONS = "Connections"; + @SerializedName(SERIALIZED_NAME_CONNECTIONS) + @javax.annotation.Nullable + private OAuthIntegrationBaseModelConnections connections; + + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_DISPLAY_NAME = "DisplayName"; + @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) + @javax.annotation.Nullable + private String displayName; + + public static final String SERIALIZED_NAME_CLIENT_ID = "ClientId"; + @SerializedName(SERIALIZED_NAME_CLIENT_ID) + @javax.annotation.Nullable + private String clientId; + + public static final String SERIALIZED_NAME_CLIENT_SECRET = "ClientSecret"; + @SerializedName(SERIALIZED_NAME_CLIENT_SECRET) + @javax.annotation.Nullable + private String clientSecret; + + public OAuthIntegrationResponse() { + } + + public OAuthIntegrationResponse redirectURIs(@javax.annotation.Nullable List<String> redirectURIs) { + this.redirectURIs = redirectURIs; + return this; + } + + public OAuthIntegrationResponse addRedirectURIsItem(String redirectURIsItem) { + if (this.redirectURIs == null) { + this.redirectURIs = new ArrayList<>(); + } + this.redirectURIs.add(redirectURIsItem); + return this; + } + + /** + * Get redirectURIs + * @return redirectURIs + */ + @javax.annotation.Nullable + public List<String> getRedirectURIs() { + return redirectURIs; + } + + public void setRedirectURIs(@javax.annotation.Nullable List<String> redirectURIs) { + this.redirectURIs = redirectURIs; + } + + + public OAuthIntegrationResponse allowedScopes(@javax.annotation.Nullable List<AllowedScopesEnum> allowedScopes) { + this.allowedScopes = allowedScopes; + return this; + } + + public OAuthIntegrationResponse addAllowedScopesItem(AllowedScopesEnum allowedScopesItem) { + if (this.allowedScopes == null) { + this.allowedScopes = new ArrayList<>(); + } + this.allowedScopes.add(allowedScopesItem); + return this; + } + + /** + * Get allowedScopes + * @return allowedScopes + */ + @javax.annotation.Nullable + public List<AllowedScopesEnum> getAllowedScopes() { + return allowedScopes; + } + + public void setAllowedScopes(@javax.annotation.Nullable List<AllowedScopesEnum> allowedScopes) { + this.allowedScopes = allowedScopes; + } + + + public OAuthIntegrationResponse grantTypes(@javax.annotation.Nullable List<GrantTypesEnum> grantTypes) { + this.grantTypes = grantTypes; + return this; + } + + public OAuthIntegrationResponse addGrantTypesItem(GrantTypesEnum grantTypesItem) { + if (this.grantTypes == null) { + this.grantTypes = new ArrayList<>(); + } + this.grantTypes.add(grantTypesItem); + return this; + } + + /** + * Only authorization_code and refresh_token are permitted for OAuth integrations. + * @return grantTypes + */ + @javax.annotation.Nullable + public List<GrantTypesEnum> getGrantTypes() { + return grantTypes; + } + + public void setGrantTypes(@javax.annotation.Nullable List<GrantTypesEnum> grantTypes) { + this.grantTypes = grantTypes; + } + + + public OAuthIntegrationResponse accessTokenMappingTemplate(@javax.annotation.Nullable String accessTokenMappingTemplate) { + this.accessTokenMappingTemplate = accessTokenMappingTemplate; + return this; + } + + /** + * Get accessTokenMappingTemplate + * @return accessTokenMappingTemplate + */ + @javax.annotation.Nullable + public String getAccessTokenMappingTemplate() { + return accessTokenMappingTemplate; + } + + public void setAccessTokenMappingTemplate(@javax.annotation.Nullable String accessTokenMappingTemplate) { + this.accessTokenMappingTemplate = accessTokenMappingTemplate; + } + + + public OAuthIntegrationResponse idTokenMappingTemplate(@javax.annotation.Nullable String idTokenMappingTemplate) { + this.idTokenMappingTemplate = idTokenMappingTemplate; + return this; + } + + /** + * Get idTokenMappingTemplate + * @return idTokenMappingTemplate + */ + @javax.annotation.Nullable + public String getIdTokenMappingTemplate() { + return idTokenMappingTemplate; + } + + public void setIdTokenMappingTemplate(@javax.annotation.Nullable String idTokenMappingTemplate) { + this.idTokenMappingTemplate = idTokenMappingTemplate; + } + + + public OAuthIntegrationResponse accessTokenTTL(@javax.annotation.Nullable Integer accessTokenTTL) { + this.accessTokenTTL = accessTokenTTL; + return this; + } + + /** + * Access token lifetime in seconds. Defaults to 3600 when omitted. + * @return accessTokenTTL + */ + @javax.annotation.Nullable + public Integer getAccessTokenTTL() { + return accessTokenTTL; + } + + public void setAccessTokenTTL(@javax.annotation.Nullable Integer accessTokenTTL) { + this.accessTokenTTL = accessTokenTTL; + } + + + public OAuthIntegrationResponse idTokenTTL(@javax.annotation.Nullable Integer idTokenTTL) { + this.idTokenTTL = idTokenTTL; + return this; + } + + /** + * ID token lifetime in seconds. Defaults to 3600 when omitted. + * @return idTokenTTL + */ + @javax.annotation.Nullable + public Integer getIdTokenTTL() { + return idTokenTTL; + } + + public void setIdTokenTTL(@javax.annotation.Nullable Integer idTokenTTL) { + this.idTokenTTL = idTokenTTL; + } + + + public OAuthIntegrationResponse refreshTokenTTL(@javax.annotation.Nullable Integer refreshTokenTTL) { + this.refreshTokenTTL = refreshTokenTTL; + return this; + } + + /** + * Refresh token lifetime in seconds. Defaults to 86400 when omitted. + * @return refreshTokenTTL + */ + @javax.annotation.Nullable + public Integer getRefreshTokenTTL() { + return refreshTokenTTL; + } + + public void setRefreshTokenTTL(@javax.annotation.Nullable Integer refreshTokenTTL) { + this.refreshTokenTTL = refreshTokenTTL; + } + + + public OAuthIntegrationResponse enablePKCE(@javax.annotation.Nullable Boolean enablePKCE) { + this.enablePKCE = enablePKCE; + return this; + } + + /** + * Get enablePKCE + * @return enablePKCE + */ + @javax.annotation.Nullable + public Boolean getEnablePKCE() { + return enablePKCE; + } + + public void setEnablePKCE(@javax.annotation.Nullable Boolean enablePKCE) { + this.enablePKCE = enablePKCE; + } + + + public OAuthIntegrationResponse isPrebuiltIntegration(@javax.annotation.Nullable Boolean isPrebuiltIntegration) { + this.isPrebuiltIntegration = isPrebuiltIntegration; + return this; + } + + /** + * Get isPrebuiltIntegration + * @return isPrebuiltIntegration + */ + @javax.annotation.Nullable + public Boolean getIsPrebuiltIntegration() { + return isPrebuiltIntegration; + } + + public void setIsPrebuiltIntegration(@javax.annotation.Nullable Boolean isPrebuiltIntegration) { + this.isPrebuiltIntegration = isPrebuiltIntegration; + } + + + public OAuthIntegrationResponse integrationType(@javax.annotation.Nullable String integrationType) { + this.integrationType = integrationType; + return this; + } + + /** + * Get integrationType + * @return integrationType + */ + @javax.annotation.Nullable + public String getIntegrationType() { + return integrationType; + } + + public void setIntegrationType(@javax.annotation.Nullable String integrationType) { + this.integrationType = integrationType; + } + + + public OAuthIntegrationResponse tokenAuthMethod(@javax.annotation.Nullable TokenAuthMethodEnum tokenAuthMethod) { + this.tokenAuthMethod = tokenAuthMethod; + return this; + } + + /** + * Token-endpoint client authentication method. Defaults to client_secret_post when omitted. + * @return tokenAuthMethod + */ + @javax.annotation.Nullable + public TokenAuthMethodEnum getTokenAuthMethod() { + return tokenAuthMethod; + } + + public void setTokenAuthMethod(@javax.annotation.Nullable TokenAuthMethodEnum tokenAuthMethod) { + this.tokenAuthMethod = tokenAuthMethod; + } + + + public OAuthIntegrationResponse defaultWorkflow(@javax.annotation.Nullable String defaultWorkflow) { + this.defaultWorkflow = defaultWorkflow; + return this; + } + + /** + * Name of the identity-orchestration workflow the authorize request falls back to when it carries no workflow parameter. Requires the IDENTITY_ORCHESTRATION feature; ignored when it is disabled. The workflow must already exist on the tenant, otherwise the request is rejected as an invalid integration configuration. Surrounding whitespace is trimmed; send an empty or blank string to clear it. + * @return defaultWorkflow + */ + @javax.annotation.Nullable + public String getDefaultWorkflow() { + return defaultWorkflow; + } + + public void setDefaultWorkflow(@javax.annotation.Nullable String defaultWorkflow) { + this.defaultWorkflow = defaultWorkflow; + } + + + public OAuthIntegrationResponse connections(@javax.annotation.Nullable OAuthIntegrationBaseModelConnections connections) { + this.connections = connections; + return this; + } + + /** + * Get connections + * @return connections + */ + @javax.annotation.Nullable + public OAuthIntegrationBaseModelConnections getConnections() { + return connections; + } + + public void setConnections(@javax.annotation.Nullable OAuthIntegrationBaseModelConnections connections) { + this.connections = connections; + } + + + public OAuthIntegrationResponse id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The integration identifier. It is also the {oAuthApp} path segment of the runtime OAuth/OIDC endpoints, e.g. /api/oidc/{Id}/token. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public OAuthIntegrationResponse displayName(@javax.annotation.Nullable String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Customer-provided display label. Identification/display only. + * @return displayName + */ + @javax.annotation.Nullable + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(@javax.annotation.Nullable String displayName) { + this.displayName = displayName; + } + + + public OAuthIntegrationResponse clientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * System-generated, immutable client identifier. + * @return clientId + */ + @javax.annotation.Nullable + public String getClientId() { + return clientId; + } + + public void setClientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + } + + + public OAuthIntegrationResponse clientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Plaintext client secret. Returned only once, in the create response (and the rotate-credentials response). It is never returned on read operations — only the hash is stored server-side. + * @return clientSecret + */ + @javax.annotation.Nullable + public String getClientSecret() { + return clientSecret; + } + + public void setClientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthIntegrationResponse instance itself + */ + public OAuthIntegrationResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthIntegrationResponse oauthIntegrationResponse = (OAuthIntegrationResponse) o; + return Objects.equals(this.redirectURIs, oauthIntegrationResponse.redirectURIs) && + Objects.equals(this.allowedScopes, oauthIntegrationResponse.allowedScopes) && + Objects.equals(this.grantTypes, oauthIntegrationResponse.grantTypes) && + Objects.equals(this.accessTokenMappingTemplate, oauthIntegrationResponse.accessTokenMappingTemplate) && + Objects.equals(this.idTokenMappingTemplate, oauthIntegrationResponse.idTokenMappingTemplate) && + Objects.equals(this.accessTokenTTL, oauthIntegrationResponse.accessTokenTTL) && + Objects.equals(this.idTokenTTL, oauthIntegrationResponse.idTokenTTL) && + Objects.equals(this.refreshTokenTTL, oauthIntegrationResponse.refreshTokenTTL) && + Objects.equals(this.enablePKCE, oauthIntegrationResponse.enablePKCE) && + Objects.equals(this.isPrebuiltIntegration, oauthIntegrationResponse.isPrebuiltIntegration) && + Objects.equals(this.integrationType, oauthIntegrationResponse.integrationType) && + Objects.equals(this.tokenAuthMethod, oauthIntegrationResponse.tokenAuthMethod) && + Objects.equals(this.defaultWorkflow, oauthIntegrationResponse.defaultWorkflow) && + Objects.equals(this.connections, oauthIntegrationResponse.connections) && + Objects.equals(this.id, oauthIntegrationResponse.id) && + Objects.equals(this.displayName, oauthIntegrationResponse.displayName) && + Objects.equals(this.clientId, oauthIntegrationResponse.clientId) && + Objects.equals(this.clientSecret, oauthIntegrationResponse.clientSecret)&& + Objects.equals(this.additionalProperties, oauthIntegrationResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(redirectURIs, allowedScopes, grantTypes, accessTokenMappingTemplate, idTokenMappingTemplate, accessTokenTTL, idTokenTTL, refreshTokenTTL, enablePKCE, isPrebuiltIntegration, integrationType, tokenAuthMethod, defaultWorkflow, connections, id, displayName, clientId, clientSecret, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthIntegrationResponse {\n"); + sb.append(" redirectURIs: ").append(toIndentedString(redirectURIs)).append("\n"); + sb.append(" allowedScopes: ").append(toIndentedString(allowedScopes)).append("\n"); + sb.append(" grantTypes: ").append(toIndentedString(grantTypes)).append("\n"); + sb.append(" accessTokenMappingTemplate: ").append(toIndentedString(accessTokenMappingTemplate)).append("\n"); + sb.append(" idTokenMappingTemplate: ").append(toIndentedString(idTokenMappingTemplate)).append("\n"); + sb.append(" accessTokenTTL: ").append(toIndentedString(accessTokenTTL)).append("\n"); + sb.append(" idTokenTTL: ").append(toIndentedString(idTokenTTL)).append("\n"); + sb.append(" refreshTokenTTL: ").append(toIndentedString(refreshTokenTTL)).append("\n"); + sb.append(" enablePKCE: ").append(toIndentedString(enablePKCE)).append("\n"); + sb.append(" isPrebuiltIntegration: ").append(toIndentedString(isPrebuiltIntegration)).append("\n"); + sb.append(" integrationType: ").append(toIndentedString(integrationType)).append("\n"); + sb.append(" tokenAuthMethod: ").append(toIndentedString(tokenAuthMethod)).append("\n"); + sb.append(" defaultWorkflow: ").append(toIndentedString(defaultWorkflow)).append("\n"); + sb.append(" connections: ").append(toIndentedString(connections)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("RedirectURIs"); + openapiFields.add("AllowedScopes"); + openapiFields.add("GrantTypes"); + openapiFields.add("AccessTokenMappingTemplate"); + openapiFields.add("IdTokenMappingTemplate"); + openapiFields.add("AccessTokenTTL"); + openapiFields.add("IDTokenTTL"); + openapiFields.add("RefreshTokenTTL"); + openapiFields.add("EnablePKCE"); + openapiFields.add("IsPrebuiltIntegration"); + openapiFields.add("IntegrationType"); + openapiFields.add("TokenAuthMethod"); + openapiFields.add("DefaultWorkflow"); + openapiFields.add("Connections"); + openapiFields.add("Id"); + openapiFields.add("DisplayName"); + openapiFields.add("ClientId"); + openapiFields.add("ClientSecret"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OAuthIntegrationResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthIntegrationResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthIntegrationResponse is not found in the empty JSON string", OAuthIntegrationResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("RedirectURIs") != null && !jsonObj.get("RedirectURIs").isJsonNull() && !jsonObj.get("RedirectURIs").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RedirectURIs` to be an array in the JSON string but got `%s`", jsonObj.get("RedirectURIs").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("AllowedScopes") != null && !jsonObj.get("AllowedScopes").isJsonNull() && !jsonObj.get("AllowedScopes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `AllowedScopes` to be an array in the JSON string but got `%s`", jsonObj.get("AllowedScopes").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("GrantTypes") != null && !jsonObj.get("GrantTypes").isJsonNull() && !jsonObj.get("GrantTypes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `GrantTypes` to be an array in the JSON string but got `%s`", jsonObj.get("GrantTypes").toString())); + } + if ((jsonObj.get("AccessTokenMappingTemplate") != null && !jsonObj.get("AccessTokenMappingTemplate").isJsonNull()) && !jsonObj.get("AccessTokenMappingTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccessTokenMappingTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccessTokenMappingTemplate").toString())); + } + if ((jsonObj.get("IdTokenMappingTemplate") != null && !jsonObj.get("IdTokenMappingTemplate").isJsonNull()) && !jsonObj.get("IdTokenMappingTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IdTokenMappingTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IdTokenMappingTemplate").toString())); + } + if ((jsonObj.get("IntegrationType") != null && !jsonObj.get("IntegrationType").isJsonNull()) && !jsonObj.get("IntegrationType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IntegrationType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IntegrationType").toString())); + } + if ((jsonObj.get("TokenAuthMethod") != null && !jsonObj.get("TokenAuthMethod").isJsonNull()) && !jsonObj.get("TokenAuthMethod").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TokenAuthMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TokenAuthMethod").toString())); + } + // validate the optional field `TokenAuthMethod` + if (jsonObj.get("TokenAuthMethod") != null && !jsonObj.get("TokenAuthMethod").isJsonNull()) { + TokenAuthMethodEnum.validateJsonElement(jsonObj.get("TokenAuthMethod")); + } + if ((jsonObj.get("DefaultWorkflow") != null && !jsonObj.get("DefaultWorkflow").isJsonNull()) && !jsonObj.get("DefaultWorkflow").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DefaultWorkflow` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DefaultWorkflow").toString())); + } + // validate the optional field `Connections` + if (jsonObj.get("Connections") != null && !jsonObj.get("Connections").isJsonNull()) { + OAuthIntegrationBaseModelConnections.validateJsonElement(jsonObj.get("Connections")); + } + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("DisplayName") != null && !jsonObj.get("DisplayName").isJsonNull()) && !jsonObj.get("DisplayName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DisplayName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DisplayName").toString())); + } + if ((jsonObj.get("ClientId") != null && !jsonObj.get("ClientId").isJsonNull()) && !jsonObj.get("ClientId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ClientId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ClientId").toString())); + } + if ((jsonObj.get("ClientSecret") != null && !jsonObj.get("ClientSecret").isJsonNull()) && !jsonObj.get("ClientSecret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ClientSecret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ClientSecret").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthIntegrationResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthIntegrationResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthIntegrationResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthIntegrationResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthIntegrationResponse>() { + @Override + public void write(JsonWriter out, OAuthIntegrationResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthIntegrationResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthIntegrationResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthIntegrationResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthIntegrationResponse + * @throws IOException if the JSON string is invalid with respect to OAuthIntegrationResponse + */ + public static OAuthIntegrationResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthIntegrationResponse.class); + } + + /** + * Convert an instance of OAuthIntegrationResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthIntegrationResponseCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthIntegrationResponseCore.java new file mode 100644 index 0000000..5c72f76 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthIntegrationResponseCore.java @@ -0,0 +1,377 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuthIntegrationResponseCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthIntegrationResponseCore { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_DISPLAY_NAME = "DisplayName"; + @SerializedName(SERIALIZED_NAME_DISPLAY_NAME) + @javax.annotation.Nullable + private String displayName; + + public static final String SERIALIZED_NAME_CLIENT_ID = "ClientId"; + @SerializedName(SERIALIZED_NAME_CLIENT_ID) + @javax.annotation.Nullable + private String clientId; + + public static final String SERIALIZED_NAME_CLIENT_SECRET = "ClientSecret"; + @SerializedName(SERIALIZED_NAME_CLIENT_SECRET) + @javax.annotation.Nullable + private String clientSecret; + + public OAuthIntegrationResponseCore() { + } + + public OAuthIntegrationResponseCore id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The integration identifier. It is also the {oAuthApp} path segment of the runtime OAuth/OIDC endpoints, e.g. /api/oidc/{Id}/token. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public OAuthIntegrationResponseCore displayName(@javax.annotation.Nullable String displayName) { + this.displayName = displayName; + return this; + } + + /** + * Customer-provided display label. Identification/display only. + * @return displayName + */ + @javax.annotation.Nullable + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(@javax.annotation.Nullable String displayName) { + this.displayName = displayName; + } + + + public OAuthIntegrationResponseCore clientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * System-generated, immutable client identifier. + * @return clientId + */ + @javax.annotation.Nullable + public String getClientId() { + return clientId; + } + + public void setClientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + } + + + public OAuthIntegrationResponseCore clientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Plaintext client secret. Returned only once, in the create response (and the rotate-credentials response). It is never returned on read operations — only the hash is stored server-side. + * @return clientSecret + */ + @javax.annotation.Nullable + public String getClientSecret() { + return clientSecret; + } + + public void setClientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthIntegrationResponseCore instance itself + */ + public OAuthIntegrationResponseCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthIntegrationResponseCore oauthIntegrationResponseCore = (OAuthIntegrationResponseCore) o; + return Objects.equals(this.id, oauthIntegrationResponseCore.id) && + Objects.equals(this.displayName, oauthIntegrationResponseCore.displayName) && + Objects.equals(this.clientId, oauthIntegrationResponseCore.clientId) && + Objects.equals(this.clientSecret, oauthIntegrationResponseCore.clientSecret)&& + Objects.equals(this.additionalProperties, oauthIntegrationResponseCore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, displayName, clientId, clientSecret, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthIntegrationResponseCore {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("DisplayName"); + openapiFields.add("ClientId"); + openapiFields.add("ClientSecret"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OAuthIntegrationResponseCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthIntegrationResponseCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthIntegrationResponseCore is not found in the empty JSON string", OAuthIntegrationResponseCore.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("DisplayName") != null && !jsonObj.get("DisplayName").isJsonNull()) && !jsonObj.get("DisplayName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DisplayName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DisplayName").toString())); + } + if ((jsonObj.get("ClientId") != null && !jsonObj.get("ClientId").isJsonNull()) && !jsonObj.get("ClientId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ClientId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ClientId").toString())); + } + if ((jsonObj.get("ClientSecret") != null && !jsonObj.get("ClientSecret").isJsonNull()) && !jsonObj.get("ClientSecret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ClientSecret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ClientSecret").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthIntegrationResponseCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthIntegrationResponseCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthIntegrationResponseCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthIntegrationResponseCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthIntegrationResponseCore>() { + @Override + public void write(JsonWriter out, OAuthIntegrationResponseCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthIntegrationResponseCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthIntegrationResponseCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthIntegrationResponseCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthIntegrationResponseCore + * @throws IOException if the JSON string is invalid with respect to OAuthIntegrationResponseCore + */ + public static OAuthIntegrationResponseCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthIntegrationResponseCore.class); + } + + /** + * Convert an instance of OAuthIntegrationResponseCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthLoginRadiusTokenExchangeFlow.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthLoginRadiusTokenExchangeFlow.java new file mode 100644 index 0000000..c15c8b4 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthLoginRadiusTokenExchangeFlow.java @@ -0,0 +1,448 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * LoginRadius Token Exchange Flow converts Loginradius GUID or JWT Encrypted token to OAuth Tokens + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthLoginRadiusTokenExchangeFlow { + public static final String SERIALIZED_NAME_CLIENT_ID = "client_id"; + @SerializedName(SERIALIZED_NAME_CLIENT_ID) + @javax.annotation.Nonnull + private String clientId; + + public static final String SERIALIZED_NAME_CLIENT_SECRET = "client_secret"; + @SerializedName(SERIALIZED_NAME_CLIENT_SECRET) + @javax.annotation.Nonnull + private String clientSecret; + + public static final String SERIALIZED_NAME_GRANT_TYPE = "grant_type"; + @SerializedName(SERIALIZED_NAME_GRANT_TYPE) + @javax.annotation.Nonnull + private String grantType = "http://loginradius.com/oauth/grant-type/exchange_token"; + + public static final String SERIALIZED_NAME_RESPONSE_TYPE = "response_type"; + @SerializedName(SERIALIZED_NAME_RESPONSE_TYPE) + @javax.annotation.Nullable + private String responseType = "token"; + + public static final String SERIALIZED_NAME_SCOPE = "scope"; + @SerializedName(SERIALIZED_NAME_SCOPE) + @javax.annotation.Nullable + private String scope; + + public static final String SERIALIZED_NAME_TOKEN = "token"; + @SerializedName(SERIALIZED_NAME_TOKEN) + @javax.annotation.Nonnull + private String token; + + public OAuthLoginRadiusTokenExchangeFlow() { + } + + public OAuthLoginRadiusTokenExchangeFlow clientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get clientId + * @return clientId + */ + @javax.annotation.Nonnull + public String getClientId() { + return clientId; + } + + public void setClientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + } + + + public OAuthLoginRadiusTokenExchangeFlow clientSecret(@javax.annotation.Nonnull String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get clientSecret + * @return clientSecret + */ + @javax.annotation.Nonnull + public String getClientSecret() { + return clientSecret; + } + + public void setClientSecret(@javax.annotation.Nonnull String clientSecret) { + this.clientSecret = clientSecret; + } + + + public OAuthLoginRadiusTokenExchangeFlow grantType(@javax.annotation.Nonnull String grantType) { + this.grantType = grantType; + return this; + } + + /** + * Get grantType + * @return grantType + */ + @javax.annotation.Nonnull + public String getGrantType() { + return grantType; + } + + public void setGrantType(@javax.annotation.Nonnull String grantType) { + this.grantType = grantType; + } + + + public OAuthLoginRadiusTokenExchangeFlow responseType(@javax.annotation.Nullable String responseType) { + this.responseType = responseType; + return this; + } + + /** + * Get responseType + * @return responseType + */ + @javax.annotation.Nullable + public String getResponseType() { + return responseType; + } + + public void setResponseType(@javax.annotation.Nullable String responseType) { + this.responseType = responseType; + } + + + public OAuthLoginRadiusTokenExchangeFlow scope(@javax.annotation.Nullable String scope) { + this.scope = scope; + return this; + } + + /** + * Get scope + * @return scope + */ + @javax.annotation.Nullable + public String getScope() { + return scope; + } + + public void setScope(@javax.annotation.Nullable String scope) { + this.scope = scope; + } + + + public OAuthLoginRadiusTokenExchangeFlow token(@javax.annotation.Nonnull String token) { + this.token = token; + return this; + } + + /** + * Get token + * @return token + */ + @javax.annotation.Nonnull + public String getToken() { + return token; + } + + public void setToken(@javax.annotation.Nonnull String token) { + this.token = token; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthLoginRadiusTokenExchangeFlow instance itself + */ + public OAuthLoginRadiusTokenExchangeFlow putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthLoginRadiusTokenExchangeFlow oauthLoginRadiusTokenExchangeFlow = (OAuthLoginRadiusTokenExchangeFlow) o; + return Objects.equals(this.clientId, oauthLoginRadiusTokenExchangeFlow.clientId) && + Objects.equals(this.clientSecret, oauthLoginRadiusTokenExchangeFlow.clientSecret) && + Objects.equals(this.grantType, oauthLoginRadiusTokenExchangeFlow.grantType) && + Objects.equals(this.responseType, oauthLoginRadiusTokenExchangeFlow.responseType) && + Objects.equals(this.scope, oauthLoginRadiusTokenExchangeFlow.scope) && + Objects.equals(this.token, oauthLoginRadiusTokenExchangeFlow.token)&& + Objects.equals(this.additionalProperties, oauthLoginRadiusTokenExchangeFlow.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, clientSecret, grantType, responseType, scope, token, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthLoginRadiusTokenExchangeFlow {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); + sb.append(" grantType: ").append(toIndentedString(grantType)).append("\n"); + sb.append(" responseType: ").append(toIndentedString(responseType)).append("\n"); + sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("client_id"); + openapiFields.add("client_secret"); + openapiFields.add("grant_type"); + openapiFields.add("response_type"); + openapiFields.add("scope"); + openapiFields.add("token"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("client_id"); + openapiRequiredFields.add("client_secret"); + openapiRequiredFields.add("grant_type"); + openapiRequiredFields.add("token"); + } + + /** + * 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 OAuthLoginRadiusTokenExchangeFlow + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthLoginRadiusTokenExchangeFlow.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthLoginRadiusTokenExchangeFlow is not found in the empty JSON string", OAuthLoginRadiusTokenExchangeFlow.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OAuthLoginRadiusTokenExchangeFlow.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("client_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_id").toString())); + } + if (!jsonObj.get("client_secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_secret").toString())); + } + if (!jsonObj.get("grant_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `grant_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("grant_type").toString())); + } + if ((jsonObj.get("response_type") != null && !jsonObj.get("response_type").isJsonNull()) && !jsonObj.get("response_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `response_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("response_type").toString())); + } + if ((jsonObj.get("scope") != null && !jsonObj.get("scope").isJsonNull()) && !jsonObj.get("scope").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scope").toString())); + } + if (!jsonObj.get("token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthLoginRadiusTokenExchangeFlow.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthLoginRadiusTokenExchangeFlow' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthLoginRadiusTokenExchangeFlow> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthLoginRadiusTokenExchangeFlow.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthLoginRadiusTokenExchangeFlow>() { + @Override + public void write(JsonWriter out, OAuthLoginRadiusTokenExchangeFlow value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthLoginRadiusTokenExchangeFlow read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthLoginRadiusTokenExchangeFlow instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthLoginRadiusTokenExchangeFlow given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthLoginRadiusTokenExchangeFlow + * @throws IOException if the JSON string is invalid with respect to OAuthLoginRadiusTokenExchangeFlow + */ + public static OAuthLoginRadiusTokenExchangeFlow fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthLoginRadiusTokenExchangeFlow.class); + } + + /** + * Convert an instance of OAuthLoginRadiusTokenExchangeFlow to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthM2MIntrospectResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthM2MIntrospectResponse.java new file mode 100644 index 0000000..a0a34ed --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthM2MIntrospectResponse.java @@ -0,0 +1,595 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.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.loginradius.sdk.internal.openapi.JSON; + +/** + * M2M Token Introspect Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthM2MIntrospectResponse { + public static final String SERIALIZED_NAME_ACTIVE = "active"; + @SerializedName(SERIALIZED_NAME_ACTIVE) + @javax.annotation.Nullable + private Boolean active; + + public static final String SERIALIZED_NAME_AUD = "aud"; + @SerializedName(SERIALIZED_NAME_AUD) + @javax.annotation.Nullable + private List<String> aud = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CID = "cid"; + @SerializedName(SERIALIZED_NAME_CID) + @javax.annotation.Nullable + private String cid; + + public static final String SERIALIZED_NAME_EXP = "exp"; + @SerializedName(SERIALIZED_NAME_EXP) + @javax.annotation.Nullable + private Integer exp; + + public static final String SERIALIZED_NAME_GTY = "gty"; + @SerializedName(SERIALIZED_NAME_GTY) + @javax.annotation.Nullable + private String gty; + + public static final String SERIALIZED_NAME_IAT = "iat"; + @SerializedName(SERIALIZED_NAME_IAT) + @javax.annotation.Nullable + private Integer iat; + + public static final String SERIALIZED_NAME_ISS = "iss"; + @SerializedName(SERIALIZED_NAME_ISS) + @javax.annotation.Nullable + private String iss; + + public static final String SERIALIZED_NAME_JTI = "jti"; + @SerializedName(SERIALIZED_NAME_JTI) + @javax.annotation.Nullable + private String jti; + + public static final String SERIALIZED_NAME_NBF = "nbf"; + @SerializedName(SERIALIZED_NAME_NBF) + @javax.annotation.Nullable + private Integer nbf; + + public static final String SERIALIZED_NAME_SCP = "scp"; + @SerializedName(SERIALIZED_NAME_SCP) + @javax.annotation.Nullable + private List<String> scp = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SUB = "sub"; + @SerializedName(SERIALIZED_NAME_SUB) + @javax.annotation.Nullable + private String sub; + + public OAuthM2MIntrospectResponse() { + } + + public OAuthM2MIntrospectResponse active(@javax.annotation.Nullable Boolean active) { + this.active = active; + return this; + } + + /** + * Get active + * @return active + */ + @javax.annotation.Nullable + public Boolean getActive() { + return active; + } + + public void setActive(@javax.annotation.Nullable Boolean active) { + this.active = active; + } + + + public OAuthM2MIntrospectResponse aud(@javax.annotation.Nullable List<String> aud) { + this.aud = aud; + return this; + } + + public OAuthM2MIntrospectResponse addAudItem(String audItem) { + if (this.aud == null) { + this.aud = new ArrayList<>(); + } + this.aud.add(audItem); + return this; + } + + /** + * Get aud + * @return aud + */ + @javax.annotation.Nullable + public List<String> getAud() { + return aud; + } + + public void setAud(@javax.annotation.Nullable List<String> aud) { + this.aud = aud; + } + + + public OAuthM2MIntrospectResponse cid(@javax.annotation.Nullable String cid) { + this.cid = cid; + return this; + } + + /** + * Get cid + * @return cid + */ + @javax.annotation.Nullable + public String getCid() { + return cid; + } + + public void setCid(@javax.annotation.Nullable String cid) { + this.cid = cid; + } + + + public OAuthM2MIntrospectResponse exp(@javax.annotation.Nullable Integer exp) { + this.exp = exp; + return this; + } + + /** + * Get exp + * @return exp + */ + @javax.annotation.Nullable + public Integer getExp() { + return exp; + } + + public void setExp(@javax.annotation.Nullable Integer exp) { + this.exp = exp; + } + + + public OAuthM2MIntrospectResponse gty(@javax.annotation.Nullable String gty) { + this.gty = gty; + return this; + } + + /** + * Get gty + * @return gty + */ + @javax.annotation.Nullable + public String getGty() { + return gty; + } + + public void setGty(@javax.annotation.Nullable String gty) { + this.gty = gty; + } + + + public OAuthM2MIntrospectResponse iat(@javax.annotation.Nullable Integer iat) { + this.iat = iat; + return this; + } + + /** + * Get iat + * @return iat + */ + @javax.annotation.Nullable + public Integer getIat() { + return iat; + } + + public void setIat(@javax.annotation.Nullable Integer iat) { + this.iat = iat; + } + + + public OAuthM2MIntrospectResponse iss(@javax.annotation.Nullable String iss) { + this.iss = iss; + return this; + } + + /** + * Get iss + * @return iss + */ + @javax.annotation.Nullable + public String getIss() { + return iss; + } + + public void setIss(@javax.annotation.Nullable String iss) { + this.iss = iss; + } + + + public OAuthM2MIntrospectResponse jti(@javax.annotation.Nullable String jti) { + this.jti = jti; + return this; + } + + /** + * Get jti + * @return jti + */ + @javax.annotation.Nullable + public String getJti() { + return jti; + } + + public void setJti(@javax.annotation.Nullable String jti) { + this.jti = jti; + } + + + public OAuthM2MIntrospectResponse nbf(@javax.annotation.Nullable Integer nbf) { + this.nbf = nbf; + return this; + } + + /** + * Get nbf + * @return nbf + */ + @javax.annotation.Nullable + public Integer getNbf() { + return nbf; + } + + public void setNbf(@javax.annotation.Nullable Integer nbf) { + this.nbf = nbf; + } + + + public OAuthM2MIntrospectResponse scp(@javax.annotation.Nullable List<String> scp) { + this.scp = scp; + return this; + } + + public OAuthM2MIntrospectResponse addScpItem(String scpItem) { + if (this.scp == null) { + this.scp = new ArrayList<>(); + } + this.scp.add(scpItem); + return this; + } + + /** + * Get scp + * @return scp + */ + @javax.annotation.Nullable + public List<String> getScp() { + return scp; + } + + public void setScp(@javax.annotation.Nullable List<String> scp) { + this.scp = scp; + } + + + public OAuthM2MIntrospectResponse sub(@javax.annotation.Nullable String sub) { + this.sub = sub; + return this; + } + + /** + * Get sub + * @return sub + */ + @javax.annotation.Nullable + public String getSub() { + return sub; + } + + public void setSub(@javax.annotation.Nullable String sub) { + this.sub = sub; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthM2MIntrospectResponse instance itself + */ + public OAuthM2MIntrospectResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthM2MIntrospectResponse oauthM2MIntrospectResponse = (OAuthM2MIntrospectResponse) o; + return Objects.equals(this.active, oauthM2MIntrospectResponse.active) && + Objects.equals(this.aud, oauthM2MIntrospectResponse.aud) && + Objects.equals(this.cid, oauthM2MIntrospectResponse.cid) && + Objects.equals(this.exp, oauthM2MIntrospectResponse.exp) && + Objects.equals(this.gty, oauthM2MIntrospectResponse.gty) && + Objects.equals(this.iat, oauthM2MIntrospectResponse.iat) && + Objects.equals(this.iss, oauthM2MIntrospectResponse.iss) && + Objects.equals(this.jti, oauthM2MIntrospectResponse.jti) && + Objects.equals(this.nbf, oauthM2MIntrospectResponse.nbf) && + Objects.equals(this.scp, oauthM2MIntrospectResponse.scp) && + Objects.equals(this.sub, oauthM2MIntrospectResponse.sub)&& + Objects.equals(this.additionalProperties, oauthM2MIntrospectResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(active, aud, cid, exp, gty, iat, iss, jti, nbf, scp, sub, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthM2MIntrospectResponse {\n"); + sb.append(" active: ").append(toIndentedString(active)).append("\n"); + sb.append(" aud: ").append(toIndentedString(aud)).append("\n"); + sb.append(" cid: ").append(toIndentedString(cid)).append("\n"); + sb.append(" exp: ").append(toIndentedString(exp)).append("\n"); + sb.append(" gty: ").append(toIndentedString(gty)).append("\n"); + sb.append(" iat: ").append(toIndentedString(iat)).append("\n"); + sb.append(" iss: ").append(toIndentedString(iss)).append("\n"); + sb.append(" jti: ").append(toIndentedString(jti)).append("\n"); + sb.append(" nbf: ").append(toIndentedString(nbf)).append("\n"); + sb.append(" scp: ").append(toIndentedString(scp)).append("\n"); + sb.append(" sub: ").append(toIndentedString(sub)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("active"); + openapiFields.add("aud"); + openapiFields.add("cid"); + openapiFields.add("exp"); + openapiFields.add("gty"); + openapiFields.add("iat"); + openapiFields.add("iss"); + openapiFields.add("jti"); + openapiFields.add("nbf"); + openapiFields.add("scp"); + openapiFields.add("sub"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OAuthM2MIntrospectResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthM2MIntrospectResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthM2MIntrospectResponse is not found in the empty JSON string", OAuthM2MIntrospectResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("aud") != null && !jsonObj.get("aud").isJsonNull() && !jsonObj.get("aud").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `aud` to be an array in the JSON string but got `%s`", jsonObj.get("aud").toString())); + } + if ((jsonObj.get("cid") != null && !jsonObj.get("cid").isJsonNull()) && !jsonObj.get("cid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cid").toString())); + } + if ((jsonObj.get("gty") != null && !jsonObj.get("gty").isJsonNull()) && !jsonObj.get("gty").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gty` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gty").toString())); + } + if ((jsonObj.get("iss") != null && !jsonObj.get("iss").isJsonNull()) && !jsonObj.get("iss").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `iss` to be a primitive type in the JSON string but got `%s`", jsonObj.get("iss").toString())); + } + if ((jsonObj.get("jti") != null && !jsonObj.get("jti").isJsonNull()) && !jsonObj.get("jti").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `jti` to be a primitive type in the JSON string but got `%s`", jsonObj.get("jti").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("scp") != null && !jsonObj.get("scp").isJsonNull() && !jsonObj.get("scp").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `scp` to be an array in the JSON string but got `%s`", jsonObj.get("scp").toString())); + } + if ((jsonObj.get("sub") != null && !jsonObj.get("sub").isJsonNull()) && !jsonObj.get("sub").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sub` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sub").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthM2MIntrospectResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthM2MIntrospectResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthM2MIntrospectResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthM2MIntrospectResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthM2MIntrospectResponse>() { + @Override + public void write(JsonWriter out, OAuthM2MIntrospectResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthM2MIntrospectResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthM2MIntrospectResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthM2MIntrospectResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthM2MIntrospectResponse + * @throws IOException if the JSON string is invalid with respect to OAuthM2MIntrospectResponse + */ + public static OAuthM2MIntrospectResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthM2MIntrospectResponse.class); + } + + /** + * Convert an instance of OAuthM2MIntrospectResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthM2MTokenGenerate.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthM2MTokenGenerate.java new file mode 100644 index 0000000..b13ffeb --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthM2MTokenGenerate.java @@ -0,0 +1,388 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * M2M Token Generate Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthM2MTokenGenerate { + public static final String SERIALIZED_NAME_AUDIENCE = "audience"; + @SerializedName(SERIALIZED_NAME_AUDIENCE) + @javax.annotation.Nonnull + private String audience; + + public static final String SERIALIZED_NAME_CLIENT_ID = "client_id"; + @SerializedName(SERIALIZED_NAME_CLIENT_ID) + @javax.annotation.Nonnull + private String clientId; + + public static final String SERIALIZED_NAME_CLIENT_SECRET = "client_secret"; + @SerializedName(SERIALIZED_NAME_CLIENT_SECRET) + @javax.annotation.Nonnull + private String clientSecret; + + public static final String SERIALIZED_NAME_GRANT_TYPE = "grant_type"; + @SerializedName(SERIALIZED_NAME_GRANT_TYPE) + @javax.annotation.Nonnull + private String grantType = "client_credentials"; + + public OAuthM2MTokenGenerate() { + } + + public OAuthM2MTokenGenerate audience(@javax.annotation.Nonnull String audience) { + this.audience = audience; + return this; + } + + /** + * Get audience + * @return audience + */ + @javax.annotation.Nonnull + public String getAudience() { + return audience; + } + + public void setAudience(@javax.annotation.Nonnull String audience) { + this.audience = audience; + } + + + public OAuthM2MTokenGenerate clientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get clientId + * @return clientId + */ + @javax.annotation.Nonnull + public String getClientId() { + return clientId; + } + + public void setClientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + } + + + public OAuthM2MTokenGenerate clientSecret(@javax.annotation.Nonnull String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get clientSecret + * @return clientSecret + */ + @javax.annotation.Nonnull + public String getClientSecret() { + return clientSecret; + } + + public void setClientSecret(@javax.annotation.Nonnull String clientSecret) { + this.clientSecret = clientSecret; + } + + + public OAuthM2MTokenGenerate grantType(@javax.annotation.Nonnull String grantType) { + this.grantType = grantType; + return this; + } + + /** + * Get grantType + * @return grantType + */ + @javax.annotation.Nonnull + public String getGrantType() { + return grantType; + } + + public void setGrantType(@javax.annotation.Nonnull String grantType) { + this.grantType = grantType; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthM2MTokenGenerate instance itself + */ + public OAuthM2MTokenGenerate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthM2MTokenGenerate oauthM2MTokenGenerate = (OAuthM2MTokenGenerate) o; + return Objects.equals(this.audience, oauthM2MTokenGenerate.audience) && + Objects.equals(this.clientId, oauthM2MTokenGenerate.clientId) && + Objects.equals(this.clientSecret, oauthM2MTokenGenerate.clientSecret) && + Objects.equals(this.grantType, oauthM2MTokenGenerate.grantType)&& + Objects.equals(this.additionalProperties, oauthM2MTokenGenerate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(audience, clientId, clientSecret, grantType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthM2MTokenGenerate {\n"); + sb.append(" audience: ").append(toIndentedString(audience)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); + sb.append(" grantType: ").append(toIndentedString(grantType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("audience"); + openapiFields.add("client_id"); + openapiFields.add("client_secret"); + openapiFields.add("grant_type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("audience"); + openapiRequiredFields.add("client_id"); + openapiRequiredFields.add("client_secret"); + openapiRequiredFields.add("grant_type"); + } + + /** + * 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 OAuthM2MTokenGenerate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthM2MTokenGenerate.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthM2MTokenGenerate is not found in the empty JSON string", OAuthM2MTokenGenerate.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OAuthM2MTokenGenerate.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("audience").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `audience` to be a primitive type in the JSON string but got `%s`", jsonObj.get("audience").toString())); + } + if (!jsonObj.get("client_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_id").toString())); + } + if (!jsonObj.get("client_secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_secret").toString())); + } + if (!jsonObj.get("grant_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `grant_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("grant_type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthM2MTokenGenerate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthM2MTokenGenerate' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthM2MTokenGenerate> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthM2MTokenGenerate.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthM2MTokenGenerate>() { + @Override + public void write(JsonWriter out, OAuthM2MTokenGenerate value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthM2MTokenGenerate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthM2MTokenGenerate instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthM2MTokenGenerate given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthM2MTokenGenerate + * @throws IOException if the JSON string is invalid with respect to OAuthM2MTokenGenerate + */ + public static OAuthM2MTokenGenerate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthM2MTokenGenerate.class); + } + + /** + * Convert an instance of OAuthM2MTokenGenerate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthM2MTokenIntrospect.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthM2MTokenIntrospect.java new file mode 100644 index 0000000..1f6aaad --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthM2MTokenIntrospect.java @@ -0,0 +1,388 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * M2M Token Introspect Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthM2MTokenIntrospect { + public static final String SERIALIZED_NAME_CLIENT_ID = "client_id"; + @SerializedName(SERIALIZED_NAME_CLIENT_ID) + @javax.annotation.Nonnull + private String clientId; + + public static final String SERIALIZED_NAME_CLIENT_SECRET = "client_secret"; + @SerializedName(SERIALIZED_NAME_CLIENT_SECRET) + @javax.annotation.Nonnull + private String clientSecret; + + public static final String SERIALIZED_NAME_TOKEN = "token"; + @SerializedName(SERIALIZED_NAME_TOKEN) + @javax.annotation.Nonnull + private String token; + + public static final String SERIALIZED_NAME_TOKEN_TYPE_HINT = "token_type_hint"; + @SerializedName(SERIALIZED_NAME_TOKEN_TYPE_HINT) + @javax.annotation.Nonnull + private String tokenTypeHint = "access_token"; + + public OAuthM2MTokenIntrospect() { + } + + public OAuthM2MTokenIntrospect clientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get clientId + * @return clientId + */ + @javax.annotation.Nonnull + public String getClientId() { + return clientId; + } + + public void setClientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + } + + + public OAuthM2MTokenIntrospect clientSecret(@javax.annotation.Nonnull String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get clientSecret + * @return clientSecret + */ + @javax.annotation.Nonnull + public String getClientSecret() { + return clientSecret; + } + + public void setClientSecret(@javax.annotation.Nonnull String clientSecret) { + this.clientSecret = clientSecret; + } + + + public OAuthM2MTokenIntrospect token(@javax.annotation.Nonnull String token) { + this.token = token; + return this; + } + + /** + * Get token + * @return token + */ + @javax.annotation.Nonnull + public String getToken() { + return token; + } + + public void setToken(@javax.annotation.Nonnull String token) { + this.token = token; + } + + + public OAuthM2MTokenIntrospect tokenTypeHint(@javax.annotation.Nonnull String tokenTypeHint) { + this.tokenTypeHint = tokenTypeHint; + return this; + } + + /** + * Get tokenTypeHint + * @return tokenTypeHint + */ + @javax.annotation.Nonnull + public String getTokenTypeHint() { + return tokenTypeHint; + } + + public void setTokenTypeHint(@javax.annotation.Nonnull String tokenTypeHint) { + this.tokenTypeHint = tokenTypeHint; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthM2MTokenIntrospect instance itself + */ + public OAuthM2MTokenIntrospect putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthM2MTokenIntrospect oauthM2MTokenIntrospect = (OAuthM2MTokenIntrospect) o; + return Objects.equals(this.clientId, oauthM2MTokenIntrospect.clientId) && + Objects.equals(this.clientSecret, oauthM2MTokenIntrospect.clientSecret) && + Objects.equals(this.token, oauthM2MTokenIntrospect.token) && + Objects.equals(this.tokenTypeHint, oauthM2MTokenIntrospect.tokenTypeHint)&& + Objects.equals(this.additionalProperties, oauthM2MTokenIntrospect.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, clientSecret, token, tokenTypeHint, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthM2MTokenIntrospect {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append(" tokenTypeHint: ").append(toIndentedString(tokenTypeHint)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("client_id"); + openapiFields.add("client_secret"); + openapiFields.add("token"); + openapiFields.add("token_type_hint"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("client_id"); + openapiRequiredFields.add("client_secret"); + openapiRequiredFields.add("token"); + openapiRequiredFields.add("token_type_hint"); + } + + /** + * 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 OAuthM2MTokenIntrospect + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthM2MTokenIntrospect.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthM2MTokenIntrospect is not found in the empty JSON string", OAuthM2MTokenIntrospect.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OAuthM2MTokenIntrospect.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("client_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_id").toString())); + } + if (!jsonObj.get("client_secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_secret").toString())); + } + if (!jsonObj.get("token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); + } + if (!jsonObj.get("token_type_hint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `token_type_hint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token_type_hint").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthM2MTokenIntrospect.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthM2MTokenIntrospect' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthM2MTokenIntrospect> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthM2MTokenIntrospect.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthM2MTokenIntrospect>() { + @Override + public void write(JsonWriter out, OAuthM2MTokenIntrospect value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthM2MTokenIntrospect read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthM2MTokenIntrospect instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthM2MTokenIntrospect given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthM2MTokenIntrospect + * @throws IOException if the JSON string is invalid with respect to OAuthM2MTokenIntrospect + */ + public static OAuthM2MTokenIntrospect fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthM2MTokenIntrospect.class); + } + + /** + * Convert an instance of OAuthM2MTokenIntrospect to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthM2MTokenResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthM2MTokenResponse.java new file mode 100644 index 0000000..c649689 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthM2MTokenResponse.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * M2M Token Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthM2MTokenResponse { + public static final String SERIALIZED_NAME_ACCESS_TOKEN = "access_token"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN) + @javax.annotation.Nullable + private String accessToken; + + public static final String SERIALIZED_NAME_EXPIRE_IN = "expire_in"; + @SerializedName(SERIALIZED_NAME_EXPIRE_IN) + @javax.annotation.Nullable + private String expireIn; + + public static final String SERIALIZED_NAME_TOKEN_TYPE = "token_type"; + @SerializedName(SERIALIZED_NAME_TOKEN_TYPE) + @javax.annotation.Nullable + private String tokenType = "Bearer"; + + public OAuthM2MTokenResponse() { + } + + public OAuthM2MTokenResponse accessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Get accessToken + * @return accessToken + */ + @javax.annotation.Nullable + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + } + + + public OAuthM2MTokenResponse expireIn(@javax.annotation.Nullable String expireIn) { + this.expireIn = expireIn; + return this; + } + + /** + * Get expireIn + * @return expireIn + */ + @javax.annotation.Nullable + public String getExpireIn() { + return expireIn; + } + + public void setExpireIn(@javax.annotation.Nullable String expireIn) { + this.expireIn = expireIn; + } + + + public OAuthM2MTokenResponse tokenType(@javax.annotation.Nullable String tokenType) { + this.tokenType = tokenType; + return this; + } + + /** + * Get tokenType + * @return tokenType + */ + @javax.annotation.Nullable + public String getTokenType() { + return tokenType; + } + + public void setTokenType(@javax.annotation.Nullable String tokenType) { + this.tokenType = tokenType; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthM2MTokenResponse instance itself + */ + public OAuthM2MTokenResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthM2MTokenResponse oauthM2MTokenResponse = (OAuthM2MTokenResponse) o; + return Objects.equals(this.accessToken, oauthM2MTokenResponse.accessToken) && + Objects.equals(this.expireIn, oauthM2MTokenResponse.expireIn) && + Objects.equals(this.tokenType, oauthM2MTokenResponse.tokenType)&& + Objects.equals(this.additionalProperties, oauthM2MTokenResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accessToken, expireIn, tokenType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthM2MTokenResponse {\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" expireIn: ").append(toIndentedString(expireIn)).append("\n"); + sb.append(" tokenType: ").append(toIndentedString(tokenType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("access_token"); + openapiFields.add("expire_in"); + openapiFields.add("token_type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OAuthM2MTokenResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthM2MTokenResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthM2MTokenResponse is not found in the empty JSON string", OAuthM2MTokenResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("access_token") != null && !jsonObj.get("access_token").isJsonNull()) && !jsonObj.get("access_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `access_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("access_token").toString())); + } + if ((jsonObj.get("expire_in") != null && !jsonObj.get("expire_in").isJsonNull()) && !jsonObj.get("expire_in").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `expire_in` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expire_in").toString())); + } + if ((jsonObj.get("token_type") != null && !jsonObj.get("token_type").isJsonNull()) && !jsonObj.get("token_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `token_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token_type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthM2MTokenResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthM2MTokenResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthM2MTokenResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthM2MTokenResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthM2MTokenResponse>() { + @Override + public void write(JsonWriter out, OAuthM2MTokenResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthM2MTokenResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthM2MTokenResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthM2MTokenResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthM2MTokenResponse + * @throws IOException if the JSON string is invalid with respect to OAuthM2MTokenResponse + */ + public static OAuthM2MTokenResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthM2MTokenResponse.class); + } + + /** + * Convert an instance of OAuthM2MTokenResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthM2MTokenRevoke.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthM2MTokenRevoke.java new file mode 100644 index 0000000..0c8ef95 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthM2MTokenRevoke.java @@ -0,0 +1,388 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * M2M Token Service Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthM2MTokenRevoke { + public static final String SERIALIZED_NAME_CLIENT_ID = "client_id"; + @SerializedName(SERIALIZED_NAME_CLIENT_ID) + @javax.annotation.Nonnull + private String clientId; + + public static final String SERIALIZED_NAME_CLIENT_SECRET = "client_secret"; + @SerializedName(SERIALIZED_NAME_CLIENT_SECRET) + @javax.annotation.Nonnull + private String clientSecret; + + public static final String SERIALIZED_NAME_TOKEN = "token"; + @SerializedName(SERIALIZED_NAME_TOKEN) + @javax.annotation.Nonnull + private String token; + + public static final String SERIALIZED_NAME_TOKEN_TYPE_HINT = "token_type_hint"; + @SerializedName(SERIALIZED_NAME_TOKEN_TYPE_HINT) + @javax.annotation.Nonnull + private String tokenTypeHint = "access_token"; + + public OAuthM2MTokenRevoke() { + } + + public OAuthM2MTokenRevoke clientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get clientId + * @return clientId + */ + @javax.annotation.Nonnull + public String getClientId() { + return clientId; + } + + public void setClientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + } + + + public OAuthM2MTokenRevoke clientSecret(@javax.annotation.Nonnull String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get clientSecret + * @return clientSecret + */ + @javax.annotation.Nonnull + public String getClientSecret() { + return clientSecret; + } + + public void setClientSecret(@javax.annotation.Nonnull String clientSecret) { + this.clientSecret = clientSecret; + } + + + public OAuthM2MTokenRevoke token(@javax.annotation.Nonnull String token) { + this.token = token; + return this; + } + + /** + * Get token + * @return token + */ + @javax.annotation.Nonnull + public String getToken() { + return token; + } + + public void setToken(@javax.annotation.Nonnull String token) { + this.token = token; + } + + + public OAuthM2MTokenRevoke tokenTypeHint(@javax.annotation.Nonnull String tokenTypeHint) { + this.tokenTypeHint = tokenTypeHint; + return this; + } + + /** + * Get tokenTypeHint + * @return tokenTypeHint + */ + @javax.annotation.Nonnull + public String getTokenTypeHint() { + return tokenTypeHint; + } + + public void setTokenTypeHint(@javax.annotation.Nonnull String tokenTypeHint) { + this.tokenTypeHint = tokenTypeHint; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthM2MTokenRevoke instance itself + */ + public OAuthM2MTokenRevoke putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthM2MTokenRevoke oauthM2MTokenRevoke = (OAuthM2MTokenRevoke) o; + return Objects.equals(this.clientId, oauthM2MTokenRevoke.clientId) && + Objects.equals(this.clientSecret, oauthM2MTokenRevoke.clientSecret) && + Objects.equals(this.token, oauthM2MTokenRevoke.token) && + Objects.equals(this.tokenTypeHint, oauthM2MTokenRevoke.tokenTypeHint)&& + Objects.equals(this.additionalProperties, oauthM2MTokenRevoke.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, clientSecret, token, tokenTypeHint, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthM2MTokenRevoke {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append(" tokenTypeHint: ").append(toIndentedString(tokenTypeHint)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("client_id"); + openapiFields.add("client_secret"); + openapiFields.add("token"); + openapiFields.add("token_type_hint"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("client_id"); + openapiRequiredFields.add("client_secret"); + openapiRequiredFields.add("token"); + openapiRequiredFields.add("token_type_hint"); + } + + /** + * 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 OAuthM2MTokenRevoke + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthM2MTokenRevoke.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthM2MTokenRevoke is not found in the empty JSON string", OAuthM2MTokenRevoke.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OAuthM2MTokenRevoke.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("client_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_id").toString())); + } + if (!jsonObj.get("client_secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_secret").toString())); + } + if (!jsonObj.get("token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); + } + if (!jsonObj.get("token_type_hint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `token_type_hint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token_type_hint").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthM2MTokenRevoke.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthM2MTokenRevoke' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthM2MTokenRevoke> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthM2MTokenRevoke.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthM2MTokenRevoke>() { + @Override + public void write(JsonWriter out, OAuthM2MTokenRevoke value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthM2MTokenRevoke read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthM2MTokenRevoke instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthM2MTokenRevoke given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthM2MTokenRevoke + * @throws IOException if the JSON string is invalid with respect to OAuthM2MTokenRevoke + */ + public static OAuthM2MTokenRevoke fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthM2MTokenRevoke.class); + } + + /** + * Convert an instance of OAuthM2MTokenRevoke to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthPasswordCredentialFlow.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthPasswordCredentialFlow.java new file mode 100644 index 0000000..5d5218f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthPasswordCredentialFlow.java @@ -0,0 +1,479 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * Password Credential Flow + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthPasswordCredentialFlow { + public static final String SERIALIZED_NAME_CLIENT_ID = "client_id"; + @SerializedName(SERIALIZED_NAME_CLIENT_ID) + @javax.annotation.Nonnull + private String clientId; + + public static final String SERIALIZED_NAME_CLIENT_SECRET = "client_secret"; + @SerializedName(SERIALIZED_NAME_CLIENT_SECRET) + @javax.annotation.Nonnull + private String clientSecret; + + public static final String SERIALIZED_NAME_GRANT_TYPE = "grant_type"; + @SerializedName(SERIALIZED_NAME_GRANT_TYPE) + @javax.annotation.Nonnull + private String grantType = "password"; + + public static final String SERIALIZED_NAME_PASSWORD = "password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nonnull + private String password; + + public static final String SERIALIZED_NAME_RESPONSE_TYPE = "response_type"; + @SerializedName(SERIALIZED_NAME_RESPONSE_TYPE) + @javax.annotation.Nullable + private String responseType = "token"; + + public static final String SERIALIZED_NAME_SCOPE = "scope"; + @SerializedName(SERIALIZED_NAME_SCOPE) + @javax.annotation.Nullable + private String scope; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nonnull + private String username; + + public OAuthPasswordCredentialFlow() { + } + + public OAuthPasswordCredentialFlow clientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get clientId + * @return clientId + */ + @javax.annotation.Nonnull + public String getClientId() { + return clientId; + } + + public void setClientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + } + + + public OAuthPasswordCredentialFlow clientSecret(@javax.annotation.Nonnull String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get clientSecret + * @return clientSecret + */ + @javax.annotation.Nonnull + public String getClientSecret() { + return clientSecret; + } + + public void setClientSecret(@javax.annotation.Nonnull String clientSecret) { + this.clientSecret = clientSecret; + } + + + public OAuthPasswordCredentialFlow grantType(@javax.annotation.Nonnull String grantType) { + this.grantType = grantType; + return this; + } + + /** + * Get grantType + * @return grantType + */ + @javax.annotation.Nonnull + public String getGrantType() { + return grantType; + } + + public void setGrantType(@javax.annotation.Nonnull String grantType) { + this.grantType = grantType; + } + + + public OAuthPasswordCredentialFlow password(@javax.annotation.Nonnull String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + @javax.annotation.Nonnull + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nonnull String password) { + this.password = password; + } + + + public OAuthPasswordCredentialFlow responseType(@javax.annotation.Nullable String responseType) { + this.responseType = responseType; + return this; + } + + /** + * Get responseType + * @return responseType + */ + @javax.annotation.Nullable + public String getResponseType() { + return responseType; + } + + public void setResponseType(@javax.annotation.Nullable String responseType) { + this.responseType = responseType; + } + + + public OAuthPasswordCredentialFlow scope(@javax.annotation.Nullable String scope) { + this.scope = scope; + return this; + } + + /** + * Get scope + * @return scope + */ + @javax.annotation.Nullable + public String getScope() { + return scope; + } + + public void setScope(@javax.annotation.Nullable String scope) { + this.scope = scope; + } + + + public OAuthPasswordCredentialFlow username(@javax.annotation.Nonnull String username) { + this.username = username; + return this; + } + + /** + * Get username + * @return username + */ + @javax.annotation.Nonnull + public String getUsername() { + return username; + } + + public void setUsername(@javax.annotation.Nonnull String username) { + this.username = username; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthPasswordCredentialFlow instance itself + */ + public OAuthPasswordCredentialFlow putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthPasswordCredentialFlow oauthPasswordCredentialFlow = (OAuthPasswordCredentialFlow) o; + return Objects.equals(this.clientId, oauthPasswordCredentialFlow.clientId) && + Objects.equals(this.clientSecret, oauthPasswordCredentialFlow.clientSecret) && + Objects.equals(this.grantType, oauthPasswordCredentialFlow.grantType) && + Objects.equals(this.password, oauthPasswordCredentialFlow.password) && + Objects.equals(this.responseType, oauthPasswordCredentialFlow.responseType) && + Objects.equals(this.scope, oauthPasswordCredentialFlow.scope) && + Objects.equals(this.username, oauthPasswordCredentialFlow.username)&& + Objects.equals(this.additionalProperties, oauthPasswordCredentialFlow.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, clientSecret, grantType, password, responseType, scope, username, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthPasswordCredentialFlow {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); + sb.append(" grantType: ").append(toIndentedString(grantType)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" responseType: ").append(toIndentedString(responseType)).append("\n"); + sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("client_id"); + openapiFields.add("client_secret"); + openapiFields.add("grant_type"); + openapiFields.add("password"); + openapiFields.add("response_type"); + openapiFields.add("scope"); + openapiFields.add("username"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("client_id"); + openapiRequiredFields.add("client_secret"); + openapiRequiredFields.add("grant_type"); + openapiRequiredFields.add("password"); + openapiRequiredFields.add("username"); + } + + /** + * 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 OAuthPasswordCredentialFlow + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthPasswordCredentialFlow.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthPasswordCredentialFlow is not found in the empty JSON string", OAuthPasswordCredentialFlow.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OAuthPasswordCredentialFlow.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("client_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_id").toString())); + } + if (!jsonObj.get("client_secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_secret").toString())); + } + if (!jsonObj.get("grant_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `grant_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("grant_type").toString())); + } + if (!jsonObj.get("password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); + } + if ((jsonObj.get("response_type") != null && !jsonObj.get("response_type").isJsonNull()) && !jsonObj.get("response_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `response_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("response_type").toString())); + } + if ((jsonObj.get("scope") != null && !jsonObj.get("scope").isJsonNull()) && !jsonObj.get("scope").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scope").toString())); + } + if (!jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthPasswordCredentialFlow.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthPasswordCredentialFlow' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthPasswordCredentialFlow> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthPasswordCredentialFlow.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthPasswordCredentialFlow>() { + @Override + public void write(JsonWriter out, OAuthPasswordCredentialFlow value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthPasswordCredentialFlow read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthPasswordCredentialFlow instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthPasswordCredentialFlow given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthPasswordCredentialFlow + * @throws IOException if the JSON string is invalid with respect to OAuthPasswordCredentialFlow + */ + public static OAuthPasswordCredentialFlow fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthPasswordCredentialFlow.class); + } + + /** + * Convert an instance of OAuthPasswordCredentialFlow to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthRefreshTokenFlow.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthRefreshTokenFlow.java new file mode 100644 index 0000000..1d0664c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthRefreshTokenFlow.java @@ -0,0 +1,418 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * Refresh Token Flow + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthRefreshTokenFlow { + public static final String SERIALIZED_NAME_CLIENT_ID = "client_id"; + @SerializedName(SERIALIZED_NAME_CLIENT_ID) + @javax.annotation.Nonnull + private String clientId; + + public static final String SERIALIZED_NAME_CLIENT_SECRET = "client_secret"; + @SerializedName(SERIALIZED_NAME_CLIENT_SECRET) + @javax.annotation.Nonnull + private String clientSecret; + + public static final String SERIALIZED_NAME_GRANT_TYPE = "grant_type"; + @SerializedName(SERIALIZED_NAME_GRANT_TYPE) + @javax.annotation.Nonnull + private String grantType = "refresh_token"; + + public static final String SERIALIZED_NAME_RESPONSE_TYPE = "response_type"; + @SerializedName(SERIALIZED_NAME_RESPONSE_TYPE) + @javax.annotation.Nullable + private String responseType = "token"; + + public static final String SERIALIZED_NAME_TOKEN = "token"; + @SerializedName(SERIALIZED_NAME_TOKEN) + @javax.annotation.Nonnull + private String token; + + public OAuthRefreshTokenFlow() { + } + + public OAuthRefreshTokenFlow clientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get clientId + * @return clientId + */ + @javax.annotation.Nonnull + public String getClientId() { + return clientId; + } + + public void setClientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + } + + + public OAuthRefreshTokenFlow clientSecret(@javax.annotation.Nonnull String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get clientSecret + * @return clientSecret + */ + @javax.annotation.Nonnull + public String getClientSecret() { + return clientSecret; + } + + public void setClientSecret(@javax.annotation.Nonnull String clientSecret) { + this.clientSecret = clientSecret; + } + + + public OAuthRefreshTokenFlow grantType(@javax.annotation.Nonnull String grantType) { + this.grantType = grantType; + return this; + } + + /** + * Get grantType + * @return grantType + */ + @javax.annotation.Nonnull + public String getGrantType() { + return grantType; + } + + public void setGrantType(@javax.annotation.Nonnull String grantType) { + this.grantType = grantType; + } + + + public OAuthRefreshTokenFlow responseType(@javax.annotation.Nullable String responseType) { + this.responseType = responseType; + return this; + } + + /** + * Get responseType + * @return responseType + */ + @javax.annotation.Nullable + public String getResponseType() { + return responseType; + } + + public void setResponseType(@javax.annotation.Nullable String responseType) { + this.responseType = responseType; + } + + + public OAuthRefreshTokenFlow token(@javax.annotation.Nonnull String token) { + this.token = token; + return this; + } + + /** + * Get token + * @return token + */ + @javax.annotation.Nonnull + public String getToken() { + return token; + } + + public void setToken(@javax.annotation.Nonnull String token) { + this.token = token; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthRefreshTokenFlow instance itself + */ + public OAuthRefreshTokenFlow putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthRefreshTokenFlow oauthRefreshTokenFlow = (OAuthRefreshTokenFlow) o; + return Objects.equals(this.clientId, oauthRefreshTokenFlow.clientId) && + Objects.equals(this.clientSecret, oauthRefreshTokenFlow.clientSecret) && + Objects.equals(this.grantType, oauthRefreshTokenFlow.grantType) && + Objects.equals(this.responseType, oauthRefreshTokenFlow.responseType) && + Objects.equals(this.token, oauthRefreshTokenFlow.token)&& + Objects.equals(this.additionalProperties, oauthRefreshTokenFlow.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, clientSecret, grantType, responseType, token, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthRefreshTokenFlow {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); + sb.append(" grantType: ").append(toIndentedString(grantType)).append("\n"); + sb.append(" responseType: ").append(toIndentedString(responseType)).append("\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("client_id"); + openapiFields.add("client_secret"); + openapiFields.add("grant_type"); + openapiFields.add("response_type"); + openapiFields.add("token"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("client_id"); + openapiRequiredFields.add("client_secret"); + openapiRequiredFields.add("grant_type"); + openapiRequiredFields.add("token"); + } + + /** + * 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 OAuthRefreshTokenFlow + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthRefreshTokenFlow.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthRefreshTokenFlow is not found in the empty JSON string", OAuthRefreshTokenFlow.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OAuthRefreshTokenFlow.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("client_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_id").toString())); + } + if (!jsonObj.get("client_secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_secret").toString())); + } + if (!jsonObj.get("grant_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `grant_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("grant_type").toString())); + } + if ((jsonObj.get("response_type") != null && !jsonObj.get("response_type").isJsonNull()) && !jsonObj.get("response_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `response_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("response_type").toString())); + } + if (!jsonObj.get("token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthRefreshTokenFlow.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthRefreshTokenFlow' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthRefreshTokenFlow> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthRefreshTokenFlow.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthRefreshTokenFlow>() { + @Override + public void write(JsonWriter out, OAuthRefreshTokenFlow value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthRefreshTokenFlow read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthRefreshTokenFlow instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthRefreshTokenFlow given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthRefreshTokenFlow + * @throws IOException if the JSON string is invalid with respect to OAuthRefreshTokenFlow + */ + public static OAuthRefreshTokenFlow fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthRefreshTokenFlow.class); + } + + /** + * Convert an instance of OAuthRefreshTokenFlow to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthRevokeRefreshToken.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthRevokeRefreshToken.java new file mode 100644 index 0000000..5d01785 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthRevokeRefreshToken.java @@ -0,0 +1,357 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuth Revoke Refresh Token Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthRevokeRefreshToken { + public static final String SERIALIZED_NAME_CLIENT_ID = "client_id"; + @SerializedName(SERIALIZED_NAME_CLIENT_ID) + @javax.annotation.Nonnull + private String clientId; + + public static final String SERIALIZED_NAME_CLIENT_SECRET = "client_secret"; + @SerializedName(SERIALIZED_NAME_CLIENT_SECRET) + @javax.annotation.Nonnull + private String clientSecret; + + public static final String SERIALIZED_NAME_TOKEN = "token"; + @SerializedName(SERIALIZED_NAME_TOKEN) + @javax.annotation.Nonnull + private String token; + + public OAuthRevokeRefreshToken() { + } + + public OAuthRevokeRefreshToken clientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get clientId + * @return clientId + */ + @javax.annotation.Nonnull + public String getClientId() { + return clientId; + } + + public void setClientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + } + + + public OAuthRevokeRefreshToken clientSecret(@javax.annotation.Nonnull String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Get clientSecret + * @return clientSecret + */ + @javax.annotation.Nonnull + public String getClientSecret() { + return clientSecret; + } + + public void setClientSecret(@javax.annotation.Nonnull String clientSecret) { + this.clientSecret = clientSecret; + } + + + public OAuthRevokeRefreshToken token(@javax.annotation.Nonnull String token) { + this.token = token; + return this; + } + + /** + * Get token + * @return token + */ + @javax.annotation.Nonnull + public String getToken() { + return token; + } + + public void setToken(@javax.annotation.Nonnull String token) { + this.token = token; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthRevokeRefreshToken instance itself + */ + public OAuthRevokeRefreshToken putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthRevokeRefreshToken oauthRevokeRefreshToken = (OAuthRevokeRefreshToken) o; + return Objects.equals(this.clientId, oauthRevokeRefreshToken.clientId) && + Objects.equals(this.clientSecret, oauthRevokeRefreshToken.clientSecret) && + Objects.equals(this.token, oauthRevokeRefreshToken.token)&& + Objects.equals(this.additionalProperties, oauthRevokeRefreshToken.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, clientSecret, token, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthRevokeRefreshToken {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); + sb.append(" token: ").append(toIndentedString(token)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("client_id"); + openapiFields.add("client_secret"); + openapiFields.add("token"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("client_id"); + openapiRequiredFields.add("client_secret"); + openapiRequiredFields.add("token"); + } + + /** + * 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 OAuthRevokeRefreshToken + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthRevokeRefreshToken.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthRevokeRefreshToken is not found in the empty JSON string", OAuthRevokeRefreshToken.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OAuthRevokeRefreshToken.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("client_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_id").toString())); + } + if (!jsonObj.get("client_secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_secret").toString())); + } + if (!jsonObj.get("token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthRevokeRefreshToken.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthRevokeRefreshToken' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthRevokeRefreshToken> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthRevokeRefreshToken.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthRevokeRefreshToken>() { + @Override + public void write(JsonWriter out, OAuthRevokeRefreshToken value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthRevokeRefreshToken read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthRevokeRefreshToken instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthRevokeRefreshToken given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthRevokeRefreshToken + * @throws IOException if the JSON string is invalid with respect to OAuthRevokeRefreshToken + */ + public static OAuthRevokeRefreshToken fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthRevokeRefreshToken.class); + } + + /** + * Convert an instance of OAuthRevokeRefreshToken to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthTokenResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthTokenResponse.java new file mode 100644 index 0000000..0ca081f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OAuthTokenResponse.java @@ -0,0 +1,377 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OAuth Token Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OAuthTokenResponse { + public static final String SERIALIZED_NAME_ACCESS_TOKEN = "access_token"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN) + @javax.annotation.Nullable + private String accessToken; + + public static final String SERIALIZED_NAME_EXPIRE_IN = "expire_in"; + @SerializedName(SERIALIZED_NAME_EXPIRE_IN) + @javax.annotation.Nullable + private String expireIn; + + public static final String SERIALIZED_NAME_REFRESH_TOKEN = "refresh_token"; + @SerializedName(SERIALIZED_NAME_REFRESH_TOKEN) + @javax.annotation.Nullable + private String refreshToken; + + public static final String SERIALIZED_NAME_TOKEN_TYPE = "token_type"; + @SerializedName(SERIALIZED_NAME_TOKEN_TYPE) + @javax.annotation.Nullable + private String tokenType = "Bearer"; + + public OAuthTokenResponse() { + } + + public OAuthTokenResponse accessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Get accessToken + * @return accessToken + */ + @javax.annotation.Nullable + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + } + + + public OAuthTokenResponse expireIn(@javax.annotation.Nullable String expireIn) { + this.expireIn = expireIn; + return this; + } + + /** + * Get expireIn + * @return expireIn + */ + @javax.annotation.Nullable + public String getExpireIn() { + return expireIn; + } + + public void setExpireIn(@javax.annotation.Nullable String expireIn) { + this.expireIn = expireIn; + } + + + public OAuthTokenResponse refreshToken(@javax.annotation.Nullable String refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + /** + * Get refreshToken + * @return refreshToken + */ + @javax.annotation.Nullable + public String getRefreshToken() { + return refreshToken; + } + + public void setRefreshToken(@javax.annotation.Nullable String refreshToken) { + this.refreshToken = refreshToken; + } + + + public OAuthTokenResponse tokenType(@javax.annotation.Nullable String tokenType) { + this.tokenType = tokenType; + return this; + } + + /** + * Get tokenType + * @return tokenType + */ + @javax.annotation.Nullable + public String getTokenType() { + return tokenType; + } + + public void setTokenType(@javax.annotation.Nullable String tokenType) { + this.tokenType = tokenType; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OAuthTokenResponse instance itself + */ + public OAuthTokenResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OAuthTokenResponse oauthTokenResponse = (OAuthTokenResponse) o; + return Objects.equals(this.accessToken, oauthTokenResponse.accessToken) && + Objects.equals(this.expireIn, oauthTokenResponse.expireIn) && + Objects.equals(this.refreshToken, oauthTokenResponse.refreshToken) && + Objects.equals(this.tokenType, oauthTokenResponse.tokenType)&& + Objects.equals(this.additionalProperties, oauthTokenResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accessToken, expireIn, refreshToken, tokenType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OAuthTokenResponse {\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" expireIn: ").append(toIndentedString(expireIn)).append("\n"); + sb.append(" refreshToken: ").append(toIndentedString(refreshToken)).append("\n"); + sb.append(" tokenType: ").append(toIndentedString(tokenType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("access_token"); + openapiFields.add("expire_in"); + openapiFields.add("refresh_token"); + openapiFields.add("token_type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OAuthTokenResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OAuthTokenResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OAuthTokenResponse is not found in the empty JSON string", OAuthTokenResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("access_token") != null && !jsonObj.get("access_token").isJsonNull()) && !jsonObj.get("access_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `access_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("access_token").toString())); + } + if ((jsonObj.get("expire_in") != null && !jsonObj.get("expire_in").isJsonNull()) && !jsonObj.get("expire_in").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `expire_in` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expire_in").toString())); + } + if ((jsonObj.get("refresh_token") != null && !jsonObj.get("refresh_token").isJsonNull()) && !jsonObj.get("refresh_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `refresh_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refresh_token").toString())); + } + if ((jsonObj.get("token_type") != null && !jsonObj.get("token_type").isJsonNull()) && !jsonObj.get("token_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `token_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token_type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OAuthTokenResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OAuthTokenResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OAuthTokenResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OAuthTokenResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<OAuthTokenResponse>() { + @Override + public void write(JsonWriter out, OAuthTokenResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OAuthTokenResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OAuthTokenResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OAuthTokenResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of OAuthTokenResponse + * @throws IOException if the JSON string is invalid with respect to OAuthTokenResponse + */ + public static OAuthTokenResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OAuthTokenResponse.class); + } + + /** + * Convert an instance of OAuthTokenResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OIDCConnectionCreateRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OIDCConnectionCreateRequest.java new file mode 100644 index 0000000..96cbfe2 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OIDCConnectionCreateRequest.java @@ -0,0 +1,761 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.OrganizationsConnectionBaseAttributes; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * OIDCConnectionCreateRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OIDCConnectionCreateRequest { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_DOMAIN = "Domain"; + @SerializedName(SERIALIZED_NAME_DOMAIN) + @javax.annotation.Nonnull + private String domain; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "Attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nullable + private OrganizationsConnectionBaseAttributes attributes; + + /** + * Type of the connection, which is OIDC in this case. + */ + @JsonAdapter(ConnectionTypeEnum.Adapter.class) + public enum ConnectionTypeEnum { + OIDC_CUSTOM("oidc_custom"); + + private String value; + + ConnectionTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ConnectionTypeEnum fromValue(String value) { + for (ConnectionTypeEnum b : ConnectionTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<ConnectionTypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final ConnectionTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ConnectionTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ConnectionTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ConnectionTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CONNECTION_TYPE = "ConnectionType"; + @SerializedName(SERIALIZED_NAME_CONNECTION_TYPE) + @javax.annotation.Nonnull + private ConnectionTypeEnum connectionType; + + public static final String SERIALIZED_NAME_AUTHORIZATION_URL = "AuthorizationUrl"; + @SerializedName(SERIALIZED_NAME_AUTHORIZATION_URL) + @javax.annotation.Nullable + private String authorizationUrl; + + public static final String SERIALIZED_NAME_CLIENT_ID = "ClientId"; + @SerializedName(SERIALIZED_NAME_CLIENT_ID) + @javax.annotation.Nullable + private String clientId; + + public static final String SERIALIZED_NAME_CLIENT_SECRET = "ClientSecret"; + @SerializedName(SERIALIZED_NAME_CLIENT_SECRET) + @javax.annotation.Nullable + private String clientSecret; + + public static final String SERIALIZED_NAME_ISSUER = "Issuer"; + @SerializedName(SERIALIZED_NAME_ISSUER) + @javax.annotation.Nullable + private String issuer; + + public static final String SERIALIZED_NAME_SCOPES = "Scopes"; + @SerializedName(SERIALIZED_NAME_SCOPES) + @javax.annotation.Nullable + private List<String> scopes = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TOKEN_AUTH_METHOD = "TokenAuthMethod"; + @SerializedName(SERIALIZED_NAME_TOKEN_AUTH_METHOD) + @javax.annotation.Nullable + private String tokenAuthMethod; + + public static final String SERIALIZED_NAME_TOKEN_URL = "TokenUrl"; + @SerializedName(SERIALIZED_NAME_TOKEN_URL) + @javax.annotation.Nullable + private String tokenUrl; + + public static final String SERIALIZED_NAME_USER_INFO_URL = "UserInfoUrl"; + @SerializedName(SERIALIZED_NAME_USER_INFO_URL) + @javax.annotation.Nullable + private String userInfoUrl; + + public static final String SERIALIZED_NAME_USER_INFO_EXTRACT_BY_ID_TOKEN = "UserInfoExtractByIdToken"; + @SerializedName(SERIALIZED_NAME_USER_INFO_EXTRACT_BY_ID_TOKEN) + @javax.annotation.Nullable + private Boolean userInfoExtractByIdToken; + + public static final String SERIALIZED_NAME_JW_K_S_ENDPOINT = "JWKSEndpoint"; + @SerializedName(SERIALIZED_NAME_JW_K_S_ENDPOINT) + @javax.annotation.Nullable + private String jwKSEndpoint; + + public OIDCConnectionCreateRequest() { + } + + public OIDCConnectionCreateRequest name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Name of the connection + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public OIDCConnectionCreateRequest domain(@javax.annotation.Nonnull String domain) { + this.domain = domain; + return this; + } + + /** + * Domain associated with the connection + * @return domain + */ + @javax.annotation.Nonnull + public String getDomain() { + return domain; + } + + public void setDomain(@javax.annotation.Nonnull String domain) { + this.domain = domain; + } + + + public OIDCConnectionCreateRequest attributes(@javax.annotation.Nullable OrganizationsConnectionBaseAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nullable + public OrganizationsConnectionBaseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nullable OrganizationsConnectionBaseAttributes attributes) { + this.attributes = attributes; + } + + + public OIDCConnectionCreateRequest connectionType(@javax.annotation.Nonnull ConnectionTypeEnum connectionType) { + this.connectionType = connectionType; + return this; + } + + /** + * Type of the connection, which is OIDC in this case. + * @return connectionType + */ + @javax.annotation.Nonnull + public ConnectionTypeEnum getConnectionType() { + return connectionType; + } + + public void setConnectionType(@javax.annotation.Nonnull ConnectionTypeEnum connectionType) { + this.connectionType = connectionType; + } + + + public OIDCConnectionCreateRequest authorizationUrl(@javax.annotation.Nullable String authorizationUrl) { + this.authorizationUrl = authorizationUrl; + return this; + } + + /** + * The URL to the OpenID Connect provider's authorization endpoint. This is where users are redirected to authenticate and authorize access. + * @return authorizationUrl + */ + @javax.annotation.Nullable + public String getAuthorizationUrl() { + return authorizationUrl; + } + + public void setAuthorizationUrl(@javax.annotation.Nullable String authorizationUrl) { + this.authorizationUrl = authorizationUrl; + } + + + public OIDCConnectionCreateRequest clientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * The client identifier issued to the application by the OpenID Connect provider. This is used to identify the application during the authentication process. + * @return clientId + */ + @javax.annotation.Nullable + public String getClientId() { + return clientId; + } + + public void setClientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + } + + + public OIDCConnectionCreateRequest clientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * The client secret issued to the application by the OpenID Connect provider. This is used to authenticate the application when requesting tokens. + * @return clientSecret + */ + @javax.annotation.Nullable + public String getClientSecret() { + return clientSecret; + } + + public void setClientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + } + + + public OIDCConnectionCreateRequest issuer(@javax.annotation.Nullable String issuer) { + this.issuer = issuer; + return this; + } + + /** + * The issuer identifier for the OpenID Connect provider. This is typically the base URL of the provider and is used to validate tokens. + * @return issuer + */ + @javax.annotation.Nullable + public String getIssuer() { + return issuer; + } + + public void setIssuer(@javax.annotation.Nullable String issuer) { + this.issuer = issuer; + } + + + public OIDCConnectionCreateRequest scopes(@javax.annotation.Nullable List<String> scopes) { + this.scopes = scopes; + return this; + } + + public OIDCConnectionCreateRequest addScopesItem(String scopesItem) { + if (this.scopes == null) { + this.scopes = new ArrayList<>(); + } + this.scopes.add(scopesItem); + return this; + } + + /** + * The scopes requested by the application during the authentication process. Scopes define the access level and Permissions granted to the application. + * @return scopes + */ + @javax.annotation.Nullable + public List<String> getScopes() { + return scopes; + } + + public void setScopes(@javax.annotation.Nullable List<String> scopes) { + this.scopes = scopes; + } + + + public OIDCConnectionCreateRequest tokenAuthMethod(@javax.annotation.Nullable String tokenAuthMethod) { + this.tokenAuthMethod = tokenAuthMethod; + return this; + } + + /** + * The method used to authenticate the application when requesting tokens. Common methods include `client_secret_post` and `client_secret_basic`. + * @return tokenAuthMethod + */ + @javax.annotation.Nullable + public String getTokenAuthMethod() { + return tokenAuthMethod; + } + + public void setTokenAuthMethod(@javax.annotation.Nullable String tokenAuthMethod) { + this.tokenAuthMethod = tokenAuthMethod; + } + + + public OIDCConnectionCreateRequest tokenUrl(@javax.annotation.Nullable String tokenUrl) { + this.tokenUrl = tokenUrl; + return this; + } + + /** + * The URL to the OpenID Connect provider's token endpoint. This is where the application exchanges the authorization code for tokens. + * @return tokenUrl + */ + @javax.annotation.Nullable + public String getTokenUrl() { + return tokenUrl; + } + + public void setTokenUrl(@javax.annotation.Nullable String tokenUrl) { + this.tokenUrl = tokenUrl; + } + + + public OIDCConnectionCreateRequest userInfoUrl(@javax.annotation.Nullable String userInfoUrl) { + this.userInfoUrl = userInfoUrl; + return this; + } + + /** + * The URL to the OpenID Connect provider's UserInfo endpoint. + * @return userInfoUrl + */ + @javax.annotation.Nullable + public String getUserInfoUrl() { + return userInfoUrl; + } + + public void setUserInfoUrl(@javax.annotation.Nullable String userInfoUrl) { + this.userInfoUrl = userInfoUrl; + } + + + public OIDCConnectionCreateRequest userInfoExtractByIdToken(@javax.annotation.Nullable Boolean userInfoExtractByIdToken) { + this.userInfoExtractByIdToken = userInfoExtractByIdToken; + return this; + } + + /** + * Indicates if user info should be extracted by ID token. + * @return userInfoExtractByIdToken + */ + @javax.annotation.Nullable + public Boolean getUserInfoExtractByIdToken() { + return userInfoExtractByIdToken; + } + + public void setUserInfoExtractByIdToken(@javax.annotation.Nullable Boolean userInfoExtractByIdToken) { + this.userInfoExtractByIdToken = userInfoExtractByIdToken; + } + + + public OIDCConnectionCreateRequest jwKSEndpoint(@javax.annotation.Nullable String jwKSEndpoint) { + this.jwKSEndpoint = jwKSEndpoint; + return this; + } + + /** + * The JWKS endpoint for verifying the ID token. + * @return jwKSEndpoint + */ + @javax.annotation.Nullable + public String getJwKSEndpoint() { + return jwKSEndpoint; + } + + public void setJwKSEndpoint(@javax.annotation.Nullable String jwKSEndpoint) { + this.jwKSEndpoint = jwKSEndpoint; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OIDCConnectionCreateRequest instance itself + */ + public OIDCConnectionCreateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OIDCConnectionCreateRequest oiDCConnectionCreateRequest = (OIDCConnectionCreateRequest) o; + return Objects.equals(this.name, oiDCConnectionCreateRequest.name) && + Objects.equals(this.domain, oiDCConnectionCreateRequest.domain) && + Objects.equals(this.attributes, oiDCConnectionCreateRequest.attributes) && + Objects.equals(this.connectionType, oiDCConnectionCreateRequest.connectionType) && + Objects.equals(this.authorizationUrl, oiDCConnectionCreateRequest.authorizationUrl) && + Objects.equals(this.clientId, oiDCConnectionCreateRequest.clientId) && + Objects.equals(this.clientSecret, oiDCConnectionCreateRequest.clientSecret) && + Objects.equals(this.issuer, oiDCConnectionCreateRequest.issuer) && + Objects.equals(this.scopes, oiDCConnectionCreateRequest.scopes) && + Objects.equals(this.tokenAuthMethod, oiDCConnectionCreateRequest.tokenAuthMethod) && + Objects.equals(this.tokenUrl, oiDCConnectionCreateRequest.tokenUrl) && + Objects.equals(this.userInfoUrl, oiDCConnectionCreateRequest.userInfoUrl) && + Objects.equals(this.userInfoExtractByIdToken, oiDCConnectionCreateRequest.userInfoExtractByIdToken) && + Objects.equals(this.jwKSEndpoint, oiDCConnectionCreateRequest.jwKSEndpoint)&& + Objects.equals(this.additionalProperties, oiDCConnectionCreateRequest.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(name, domain, attributes, connectionType, authorizationUrl, clientId, clientSecret, issuer, scopes, tokenAuthMethod, tokenUrl, userInfoUrl, userInfoExtractByIdToken, jwKSEndpoint, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OIDCConnectionCreateRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" connectionType: ").append(toIndentedString(connectionType)).append("\n"); + sb.append(" authorizationUrl: ").append(toIndentedString(authorizationUrl)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); + sb.append(" issuer: ").append(toIndentedString(issuer)).append("\n"); + sb.append(" scopes: ").append(toIndentedString(scopes)).append("\n"); + sb.append(" tokenAuthMethod: ").append(toIndentedString(tokenAuthMethod)).append("\n"); + sb.append(" tokenUrl: ").append(toIndentedString(tokenUrl)).append("\n"); + sb.append(" userInfoUrl: ").append(toIndentedString(userInfoUrl)).append("\n"); + sb.append(" userInfoExtractByIdToken: ").append(toIndentedString(userInfoExtractByIdToken)).append("\n"); + sb.append(" jwKSEndpoint: ").append(toIndentedString(jwKSEndpoint)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + openapiFields.add("Domain"); + openapiFields.add("Attributes"); + openapiFields.add("ConnectionType"); + openapiFields.add("AuthorizationUrl"); + openapiFields.add("ClientId"); + openapiFields.add("ClientSecret"); + openapiFields.add("Issuer"); + openapiFields.add("Scopes"); + openapiFields.add("TokenAuthMethod"); + openapiFields.add("TokenUrl"); + openapiFields.add("UserInfoUrl"); + openapiFields.add("UserInfoExtractByIdToken"); + openapiFields.add("JWKSEndpoint"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Name"); + openapiRequiredFields.add("Domain"); + openapiRequiredFields.add("ConnectionType"); + } + + /** + * 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 OIDCConnectionCreateRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OIDCConnectionCreateRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OIDCConnectionCreateRequest is not found in the empty JSON string", OIDCConnectionCreateRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OIDCConnectionCreateRequest.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("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("Domain").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Domain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Domain").toString())); + } + // validate the optional field `Attributes` + if (jsonObj.get("Attributes") != null && !jsonObj.get("Attributes").isJsonNull()) { + OrganizationsConnectionBaseAttributes.validateJsonElement(jsonObj.get("Attributes")); + } + if (!jsonObj.get("ConnectionType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ConnectionType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ConnectionType").toString())); + } + // validate the required field `ConnectionType` + ConnectionTypeEnum.validateJsonElement(jsonObj.get("ConnectionType")); + if ((jsonObj.get("AuthorizationUrl") != null && !jsonObj.get("AuthorizationUrl").isJsonNull()) && !jsonObj.get("AuthorizationUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AuthorizationUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AuthorizationUrl").toString())); + } + if ((jsonObj.get("ClientId") != null && !jsonObj.get("ClientId").isJsonNull()) && !jsonObj.get("ClientId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ClientId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ClientId").toString())); + } + if ((jsonObj.get("ClientSecret") != null && !jsonObj.get("ClientSecret").isJsonNull()) && !jsonObj.get("ClientSecret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ClientSecret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ClientSecret").toString())); + } + if ((jsonObj.get("Issuer") != null && !jsonObj.get("Issuer").isJsonNull()) && !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())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("Scopes") != null && !jsonObj.get("Scopes").isJsonNull() && !jsonObj.get("Scopes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Scopes` to be an array in the JSON string but got `%s`", jsonObj.get("Scopes").toString())); + } + if ((jsonObj.get("TokenAuthMethod") != null && !jsonObj.get("TokenAuthMethod").isJsonNull()) && !jsonObj.get("TokenAuthMethod").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TokenAuthMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TokenAuthMethod").toString())); + } + if ((jsonObj.get("TokenUrl") != null && !jsonObj.get("TokenUrl").isJsonNull()) && !jsonObj.get("TokenUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TokenUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TokenUrl").toString())); + } + if ((jsonObj.get("UserInfoUrl") != null && !jsonObj.get("UserInfoUrl").isJsonNull()) && !jsonObj.get("UserInfoUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UserInfoUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UserInfoUrl").toString())); + } + if ((jsonObj.get("JWKSEndpoint") != null && !jsonObj.get("JWKSEndpoint").isJsonNull()) && !jsonObj.get("JWKSEndpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `JWKSEndpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("JWKSEndpoint").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OIDCConnectionCreateRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OIDCConnectionCreateRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OIDCConnectionCreateRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OIDCConnectionCreateRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<OIDCConnectionCreateRequest>() { + @Override + public void write(JsonWriter out, OIDCConnectionCreateRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OIDCConnectionCreateRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OIDCConnectionCreateRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OIDCConnectionCreateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of OIDCConnectionCreateRequest + * @throws IOException if the JSON string is invalid with respect to OIDCConnectionCreateRequest + */ + public static OIDCConnectionCreateRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OIDCConnectionCreateRequest.class); + } + + /** + * Convert an instance of OIDCConnectionCreateRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OIDCDeviceCode.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OIDCDeviceCode.java new file mode 100644 index 0000000..20d9f32 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OIDCDeviceCode.java @@ -0,0 +1,325 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OIDC Device Code Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OIDCDeviceCode { + public static final String SERIALIZED_NAME_CLIENT_ID = "client_id"; + @SerializedName(SERIALIZED_NAME_CLIENT_ID) + @javax.annotation.Nonnull + private String clientId; + + public static final String SERIALIZED_NAME_SCOPE = "scope"; + @SerializedName(SERIALIZED_NAME_SCOPE) + @javax.annotation.Nullable + private String scope; + + public OIDCDeviceCode() { + } + + public OIDCDeviceCode clientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + return this; + } + + /** + * Get clientId + * @return clientId + */ + @javax.annotation.Nonnull + public String getClientId() { + return clientId; + } + + public void setClientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + } + + + public OIDCDeviceCode scope(@javax.annotation.Nullable String scope) { + this.scope = scope; + return this; + } + + /** + * Get scope + * @return scope + */ + @javax.annotation.Nullable + public String getScope() { + return scope; + } + + public void setScope(@javax.annotation.Nullable String scope) { + this.scope = scope; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OIDCDeviceCode instance itself + */ + public OIDCDeviceCode putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OIDCDeviceCode oiDCDeviceCode = (OIDCDeviceCode) o; + return Objects.equals(this.clientId, oiDCDeviceCode.clientId) && + Objects.equals(this.scope, oiDCDeviceCode.scope)&& + Objects.equals(this.additionalProperties, oiDCDeviceCode.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, scope, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OIDCDeviceCode {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("client_id"); + openapiFields.add("scope"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("client_id"); + } + + /** + * 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 OIDCDeviceCode + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OIDCDeviceCode.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OIDCDeviceCode is not found in the empty JSON string", OIDCDeviceCode.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OIDCDeviceCode.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("client_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_id").toString())); + } + if ((jsonObj.get("scope") != null && !jsonObj.get("scope").isJsonNull()) && !jsonObj.get("scope").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scope").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OIDCDeviceCode.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OIDCDeviceCode' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OIDCDeviceCode> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OIDCDeviceCode.class)); + + return (TypeAdapter<T>) new TypeAdapter<OIDCDeviceCode>() { + @Override + public void write(JsonWriter out, OIDCDeviceCode value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OIDCDeviceCode read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OIDCDeviceCode instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OIDCDeviceCode given an JSON string + * + * @param jsonString JSON string + * @return An instance of OIDCDeviceCode + * @throws IOException if the JSON string is invalid with respect to OIDCDeviceCode + */ + public static OIDCDeviceCode fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OIDCDeviceCode.class); + } + + /** + * Convert an instance of OIDCDeviceCode to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OIDCDeviceCodeResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OIDCDeviceCodeResponse.java new file mode 100644 index 0000000..fd819ce --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OIDCDeviceCodeResponse.java @@ -0,0 +1,431 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OIDC Device Code Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OIDCDeviceCodeResponse { + public static final String SERIALIZED_NAME_DEVICE_CODE = "device_code"; + @SerializedName(SERIALIZED_NAME_DEVICE_CODE) + @javax.annotation.Nullable + private String deviceCode; + + public static final String SERIALIZED_NAME_EXPIRES_IN = "expires_in"; + @SerializedName(SERIALIZED_NAME_EXPIRES_IN) + @javax.annotation.Nullable + private Integer expiresIn; + + public static final String SERIALIZED_NAME_INTERVAL = "interval"; + @SerializedName(SERIALIZED_NAME_INTERVAL) + @javax.annotation.Nullable + private Integer interval; + + public static final String SERIALIZED_NAME_USER_CODE = "user_code"; + @SerializedName(SERIALIZED_NAME_USER_CODE) + @javax.annotation.Nullable + private String userCode; + + public static final String SERIALIZED_NAME_VERIFICATION_URI = "verification_uri"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_URI) + @javax.annotation.Nullable + private String verificationUri; + + public static final String SERIALIZED_NAME_VERIFICATION_URI_COMPLETE = "verification_uri_complete"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_URI_COMPLETE) + @javax.annotation.Nullable + private String verificationUriComplete; + + public OIDCDeviceCodeResponse() { + } + + public OIDCDeviceCodeResponse deviceCode(@javax.annotation.Nullable String deviceCode) { + this.deviceCode = deviceCode; + return this; + } + + /** + * Get deviceCode + * @return deviceCode + */ + @javax.annotation.Nullable + public String getDeviceCode() { + return deviceCode; + } + + public void setDeviceCode(@javax.annotation.Nullable String deviceCode) { + this.deviceCode = deviceCode; + } + + + public OIDCDeviceCodeResponse expiresIn(@javax.annotation.Nullable Integer expiresIn) { + this.expiresIn = expiresIn; + return this; + } + + /** + * Get expiresIn + * @return expiresIn + */ + @javax.annotation.Nullable + public Integer getExpiresIn() { + return expiresIn; + } + + public void setExpiresIn(@javax.annotation.Nullable Integer expiresIn) { + this.expiresIn = expiresIn; + } + + + public OIDCDeviceCodeResponse interval(@javax.annotation.Nullable Integer interval) { + this.interval = interval; + return this; + } + + /** + * Get interval + * @return interval + */ + @javax.annotation.Nullable + public Integer getInterval() { + return interval; + } + + public void setInterval(@javax.annotation.Nullable Integer interval) { + this.interval = interval; + } + + + public OIDCDeviceCodeResponse userCode(@javax.annotation.Nullable String userCode) { + this.userCode = userCode; + return this; + } + + /** + * Get userCode + * @return userCode + */ + @javax.annotation.Nullable + public String getUserCode() { + return userCode; + } + + public void setUserCode(@javax.annotation.Nullable String userCode) { + this.userCode = userCode; + } + + + public OIDCDeviceCodeResponse verificationUri(@javax.annotation.Nullable String verificationUri) { + this.verificationUri = verificationUri; + return this; + } + + /** + * Get verificationUri + * @return verificationUri + */ + @javax.annotation.Nullable + public String getVerificationUri() { + return verificationUri; + } + + public void setVerificationUri(@javax.annotation.Nullable String verificationUri) { + this.verificationUri = verificationUri; + } + + + public OIDCDeviceCodeResponse verificationUriComplete(@javax.annotation.Nullable String verificationUriComplete) { + this.verificationUriComplete = verificationUriComplete; + return this; + } + + /** + * Get verificationUriComplete + * @return verificationUriComplete + */ + @javax.annotation.Nullable + public String getVerificationUriComplete() { + return verificationUriComplete; + } + + public void setVerificationUriComplete(@javax.annotation.Nullable String verificationUriComplete) { + this.verificationUriComplete = verificationUriComplete; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OIDCDeviceCodeResponse instance itself + */ + public OIDCDeviceCodeResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OIDCDeviceCodeResponse oiDCDeviceCodeResponse = (OIDCDeviceCodeResponse) o; + return Objects.equals(this.deviceCode, oiDCDeviceCodeResponse.deviceCode) && + Objects.equals(this.expiresIn, oiDCDeviceCodeResponse.expiresIn) && + Objects.equals(this.interval, oiDCDeviceCodeResponse.interval) && + Objects.equals(this.userCode, oiDCDeviceCodeResponse.userCode) && + Objects.equals(this.verificationUri, oiDCDeviceCodeResponse.verificationUri) && + Objects.equals(this.verificationUriComplete, oiDCDeviceCodeResponse.verificationUriComplete)&& + Objects.equals(this.additionalProperties, oiDCDeviceCodeResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(deviceCode, expiresIn, interval, userCode, verificationUri, verificationUriComplete, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OIDCDeviceCodeResponse {\n"); + sb.append(" deviceCode: ").append(toIndentedString(deviceCode)).append("\n"); + sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n"); + sb.append(" interval: ").append(toIndentedString(interval)).append("\n"); + sb.append(" userCode: ").append(toIndentedString(userCode)).append("\n"); + sb.append(" verificationUri: ").append(toIndentedString(verificationUri)).append("\n"); + sb.append(" verificationUriComplete: ").append(toIndentedString(verificationUriComplete)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("device_code"); + openapiFields.add("expires_in"); + openapiFields.add("interval"); + openapiFields.add("user_code"); + openapiFields.add("verification_uri"); + openapiFields.add("verification_uri_complete"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OIDCDeviceCodeResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OIDCDeviceCodeResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OIDCDeviceCodeResponse is not found in the empty JSON string", OIDCDeviceCodeResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("device_code") != null && !jsonObj.get("device_code").isJsonNull()) && !jsonObj.get("device_code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `device_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("device_code").toString())); + } + if ((jsonObj.get("user_code") != null && !jsonObj.get("user_code").isJsonNull()) && !jsonObj.get("user_code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `user_code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("user_code").toString())); + } + if ((jsonObj.get("verification_uri") != null && !jsonObj.get("verification_uri").isJsonNull()) && !jsonObj.get("verification_uri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_uri").toString())); + } + if ((jsonObj.get("verification_uri_complete") != null && !jsonObj.get("verification_uri_complete").isJsonNull()) && !jsonObj.get("verification_uri_complete").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verification_uri_complete` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verification_uri_complete").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OIDCDeviceCodeResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OIDCDeviceCodeResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OIDCDeviceCodeResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OIDCDeviceCodeResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<OIDCDeviceCodeResponse>() { + @Override + public void write(JsonWriter out, OIDCDeviceCodeResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OIDCDeviceCodeResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OIDCDeviceCodeResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OIDCDeviceCodeResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of OIDCDeviceCodeResponse + * @throws IOException if the JSON string is invalid with respect to OIDCDeviceCodeResponse + */ + public static OIDCDeviceCodeResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OIDCDeviceCodeResponse.class); + } + + /** + * Convert an instance of OIDCDeviceCodeResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OIDCDiscoveryResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OIDCDiscoveryResponse.java new file mode 100644 index 0000000..30034e5 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OIDCDiscoveryResponse.java @@ -0,0 +1,1009 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OIDC Discovery Config Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OIDCDiscoveryResponse { + public static final String SERIALIZED_NAME_ACR_VALUES_SUPPORTED = "acr_values_supported"; + @SerializedName(SERIALIZED_NAME_ACR_VALUES_SUPPORTED) + @javax.annotation.Nullable + private List<String> acrValuesSupported = new ArrayList<>(); + + public static final String SERIALIZED_NAME_AUTHORIZATION_ENDPOINT = "authorization_endpoint"; + @SerializedName(SERIALIZED_NAME_AUTHORIZATION_ENDPOINT) + @javax.annotation.Nullable + private String authorizationEndpoint; + + public static final String SERIALIZED_NAME_BACKCHANNEL_LOGOUT_SESSION_SUPPORTED = "backchannel_logout_session_supported"; + @SerializedName(SERIALIZED_NAME_BACKCHANNEL_LOGOUT_SESSION_SUPPORTED) + @javax.annotation.Nullable + private Boolean backchannelLogoutSessionSupported; + + public static final String SERIALIZED_NAME_BACKCHANNEL_LOGOUT_SUPPORTED = "backchannel_logout_supported"; + @SerializedName(SERIALIZED_NAME_BACKCHANNEL_LOGOUT_SUPPORTED) + @javax.annotation.Nullable + private Boolean backchannelLogoutSupported; + + public static final String SERIALIZED_NAME_CLAIMS_SUPPORTED = "claims_supported"; + @SerializedName(SERIALIZED_NAME_CLAIMS_SUPPORTED) + @javax.annotation.Nullable + private List<String> claimsSupported = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CODE_CHALLENGE_METHODS_SUPPORTED = "code_challenge_methods_supported"; + @SerializedName(SERIALIZED_NAME_CODE_CHALLENGE_METHODS_SUPPORTED) + @javax.annotation.Nullable + private List<String> codeChallengeMethodsSupported = new ArrayList<>(); + + public static final String SERIALIZED_NAME_END_SESSION_ENDPOINT = "end_session_endpoint"; + @SerializedName(SERIALIZED_NAME_END_SESSION_ENDPOINT) + @javax.annotation.Nullable + private String endSessionEndpoint; + + public static final String SERIALIZED_NAME_GRANT_TYPES_SUPPORTED = "grant_types_supported"; + @SerializedName(SERIALIZED_NAME_GRANT_TYPES_SUPPORTED) + @javax.annotation.Nullable + private List<String> grantTypesSupported = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ID_TOKEN_SIGNING_ALG_VALUES_SUPPORTED = "id_token_signing_alg_values_supported"; + @SerializedName(SERIALIZED_NAME_ID_TOKEN_SIGNING_ALG_VALUES_SUPPORTED) + @javax.annotation.Nullable + private List<String> idTokenSigningAlgValuesSupported = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ISSUER = "issuer"; + @SerializedName(SERIALIZED_NAME_ISSUER) + @javax.annotation.Nullable + private String issuer; + + public static final String SERIALIZED_NAME_JWKS_URI = "jwks_uri"; + @SerializedName(SERIALIZED_NAME_JWKS_URI) + @javax.annotation.Nullable + private String jwksUri; + + public static final String SERIALIZED_NAME_REQUEST_PARAMETER_SUPPORTED = "request_parameter_supported"; + @SerializedName(SERIALIZED_NAME_REQUEST_PARAMETER_SUPPORTED) + @javax.annotation.Nullable + private Boolean requestParameterSupported; + + public static final String SERIALIZED_NAME_RESPONSE_MODES_SUPPORTED = "response_modes_supported"; + @SerializedName(SERIALIZED_NAME_RESPONSE_MODES_SUPPORTED) + @javax.annotation.Nullable + private List<String> responseModesSupported = new ArrayList<>(); + + public static final String SERIALIZED_NAME_RESPONSE_TYPES_SUPPORTED = "response_types_supported"; + @SerializedName(SERIALIZED_NAME_RESPONSE_TYPES_SUPPORTED) + @javax.annotation.Nullable + private List<String> responseTypesSupported = new ArrayList<>(); + + public static final String SERIALIZED_NAME_REVOCATION_ENDPOINT = "revocation_endpoint"; + @SerializedName(SERIALIZED_NAME_REVOCATION_ENDPOINT) + @javax.annotation.Nullable + private String revocationEndpoint; + + public static final String SERIALIZED_NAME_INTROSPECTION_ENDPOINT = "introspection_endpoint"; + @SerializedName(SERIALIZED_NAME_INTROSPECTION_ENDPOINT) + @javax.annotation.Nullable + private String introspectionEndpoint; + + public static final String SERIALIZED_NAME_REVOCATION_ENDPOINT_AUTH_METHODS_SUPPORTED = "revocation_endpoint_auth_methods_supported"; + @SerializedName(SERIALIZED_NAME_REVOCATION_ENDPOINT_AUTH_METHODS_SUPPORTED) + @javax.annotation.Nullable + private List<String> revocationEndpointAuthMethodsSupported = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SCOPES_SUPPORTED = "scopes_supported"; + @SerializedName(SERIALIZED_NAME_SCOPES_SUPPORTED) + @javax.annotation.Nullable + private List<String> scopesSupported = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SUBJECT_TYPES_SUPPORTED = "subject_types_supported"; + @SerializedName(SERIALIZED_NAME_SUBJECT_TYPES_SUPPORTED) + @javax.annotation.Nullable + private List<String> subjectTypesSupported = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TOKEN_ENDPOINT = "token_endpoint"; + @SerializedName(SERIALIZED_NAME_TOKEN_ENDPOINT) + @javax.annotation.Nullable + private String tokenEndpoint; + + public static final String SERIALIZED_NAME_TOKEN_ENDPOINT_AUTH_METHODS_SUPPORTED = "token_endpoint_auth_methods_supported"; + @SerializedName(SERIALIZED_NAME_TOKEN_ENDPOINT_AUTH_METHODS_SUPPORTED) + @javax.annotation.Nullable + private List<String> tokenEndpointAuthMethodsSupported = new ArrayList<>(); + + public static final String SERIALIZED_NAME_USERINFO_ENDPOINT = "userinfo_endpoint"; + @SerializedName(SERIALIZED_NAME_USERINFO_ENDPOINT) + @javax.annotation.Nullable + private String userinfoEndpoint; + + public OIDCDiscoveryResponse() { + } + + public OIDCDiscoveryResponse acrValuesSupported(@javax.annotation.Nullable List<String> acrValuesSupported) { + this.acrValuesSupported = acrValuesSupported; + return this; + } + + public OIDCDiscoveryResponse addAcrValuesSupportedItem(String acrValuesSupportedItem) { + if (this.acrValuesSupported == null) { + this.acrValuesSupported = new ArrayList<>(); + } + this.acrValuesSupported.add(acrValuesSupportedItem); + return this; + } + + /** + * Get acrValuesSupported + * @return acrValuesSupported + */ + @javax.annotation.Nullable + public List<String> getAcrValuesSupported() { + return acrValuesSupported; + } + + public void setAcrValuesSupported(@javax.annotation.Nullable List<String> acrValuesSupported) { + this.acrValuesSupported = acrValuesSupported; + } + + + public OIDCDiscoveryResponse authorizationEndpoint(@javax.annotation.Nullable String authorizationEndpoint) { + this.authorizationEndpoint = authorizationEndpoint; + return this; + } + + /** + * Get authorizationEndpoint + * @return authorizationEndpoint + */ + @javax.annotation.Nullable + public String getAuthorizationEndpoint() { + return authorizationEndpoint; + } + + public void setAuthorizationEndpoint(@javax.annotation.Nullable String authorizationEndpoint) { + this.authorizationEndpoint = authorizationEndpoint; + } + + + public OIDCDiscoveryResponse backchannelLogoutSessionSupported(@javax.annotation.Nullable Boolean backchannelLogoutSessionSupported) { + this.backchannelLogoutSessionSupported = backchannelLogoutSessionSupported; + return this; + } + + /** + * Get backchannelLogoutSessionSupported + * @return backchannelLogoutSessionSupported + */ + @javax.annotation.Nullable + public Boolean getBackchannelLogoutSessionSupported() { + return backchannelLogoutSessionSupported; + } + + public void setBackchannelLogoutSessionSupported(@javax.annotation.Nullable Boolean backchannelLogoutSessionSupported) { + this.backchannelLogoutSessionSupported = backchannelLogoutSessionSupported; + } + + + public OIDCDiscoveryResponse backchannelLogoutSupported(@javax.annotation.Nullable Boolean backchannelLogoutSupported) { + this.backchannelLogoutSupported = backchannelLogoutSupported; + return this; + } + + /** + * Get backchannelLogoutSupported + * @return backchannelLogoutSupported + */ + @javax.annotation.Nullable + public Boolean getBackchannelLogoutSupported() { + return backchannelLogoutSupported; + } + + public void setBackchannelLogoutSupported(@javax.annotation.Nullable Boolean backchannelLogoutSupported) { + this.backchannelLogoutSupported = backchannelLogoutSupported; + } + + + public OIDCDiscoveryResponse claimsSupported(@javax.annotation.Nullable List<String> claimsSupported) { + this.claimsSupported = claimsSupported; + return this; + } + + public OIDCDiscoveryResponse addClaimsSupportedItem(String claimsSupportedItem) { + if (this.claimsSupported == null) { + this.claimsSupported = new ArrayList<>(); + } + this.claimsSupported.add(claimsSupportedItem); + return this; + } + + /** + * Get claimsSupported + * @return claimsSupported + */ + @javax.annotation.Nullable + public List<String> getClaimsSupported() { + return claimsSupported; + } + + public void setClaimsSupported(@javax.annotation.Nullable List<String> claimsSupported) { + this.claimsSupported = claimsSupported; + } + + + public OIDCDiscoveryResponse codeChallengeMethodsSupported(@javax.annotation.Nullable List<String> codeChallengeMethodsSupported) { + this.codeChallengeMethodsSupported = codeChallengeMethodsSupported; + return this; + } + + public OIDCDiscoveryResponse addCodeChallengeMethodsSupportedItem(String codeChallengeMethodsSupportedItem) { + if (this.codeChallengeMethodsSupported == null) { + this.codeChallengeMethodsSupported = new ArrayList<>(); + } + this.codeChallengeMethodsSupported.add(codeChallengeMethodsSupportedItem); + return this; + } + + /** + * Get codeChallengeMethodsSupported + * @return codeChallengeMethodsSupported + */ + @javax.annotation.Nullable + public List<String> getCodeChallengeMethodsSupported() { + return codeChallengeMethodsSupported; + } + + public void setCodeChallengeMethodsSupported(@javax.annotation.Nullable List<String> codeChallengeMethodsSupported) { + this.codeChallengeMethodsSupported = codeChallengeMethodsSupported; + } + + + public OIDCDiscoveryResponse endSessionEndpoint(@javax.annotation.Nullable String endSessionEndpoint) { + this.endSessionEndpoint = endSessionEndpoint; + return this; + } + + /** + * Get endSessionEndpoint + * @return endSessionEndpoint + */ + @javax.annotation.Nullable + public String getEndSessionEndpoint() { + return endSessionEndpoint; + } + + public void setEndSessionEndpoint(@javax.annotation.Nullable String endSessionEndpoint) { + this.endSessionEndpoint = endSessionEndpoint; + } + + + public OIDCDiscoveryResponse grantTypesSupported(@javax.annotation.Nullable List<String> grantTypesSupported) { + this.grantTypesSupported = grantTypesSupported; + return this; + } + + public OIDCDiscoveryResponse addGrantTypesSupportedItem(String grantTypesSupportedItem) { + if (this.grantTypesSupported == null) { + this.grantTypesSupported = new ArrayList<>(); + } + this.grantTypesSupported.add(grantTypesSupportedItem); + return this; + } + + /** + * Get grantTypesSupported + * @return grantTypesSupported + */ + @javax.annotation.Nullable + public List<String> getGrantTypesSupported() { + return grantTypesSupported; + } + + public void setGrantTypesSupported(@javax.annotation.Nullable List<String> grantTypesSupported) { + this.grantTypesSupported = grantTypesSupported; + } + + + public OIDCDiscoveryResponse idTokenSigningAlgValuesSupported(@javax.annotation.Nullable List<String> idTokenSigningAlgValuesSupported) { + this.idTokenSigningAlgValuesSupported = idTokenSigningAlgValuesSupported; + return this; + } + + public OIDCDiscoveryResponse addIdTokenSigningAlgValuesSupportedItem(String idTokenSigningAlgValuesSupportedItem) { + if (this.idTokenSigningAlgValuesSupported == null) { + this.idTokenSigningAlgValuesSupported = new ArrayList<>(); + } + this.idTokenSigningAlgValuesSupported.add(idTokenSigningAlgValuesSupportedItem); + return this; + } + + /** + * Get idTokenSigningAlgValuesSupported + * @return idTokenSigningAlgValuesSupported + */ + @javax.annotation.Nullable + public List<String> getIdTokenSigningAlgValuesSupported() { + return idTokenSigningAlgValuesSupported; + } + + public void setIdTokenSigningAlgValuesSupported(@javax.annotation.Nullable List<String> idTokenSigningAlgValuesSupported) { + this.idTokenSigningAlgValuesSupported = idTokenSigningAlgValuesSupported; + } + + + public OIDCDiscoveryResponse issuer(@javax.annotation.Nullable String issuer) { + this.issuer = issuer; + return this; + } + + /** + * Get issuer + * @return issuer + */ + @javax.annotation.Nullable + public String getIssuer() { + return issuer; + } + + public void setIssuer(@javax.annotation.Nullable String issuer) { + this.issuer = issuer; + } + + + public OIDCDiscoveryResponse jwksUri(@javax.annotation.Nullable String jwksUri) { + this.jwksUri = jwksUri; + return this; + } + + /** + * Get jwksUri + * @return jwksUri + */ + @javax.annotation.Nullable + public String getJwksUri() { + return jwksUri; + } + + public void setJwksUri(@javax.annotation.Nullable String jwksUri) { + this.jwksUri = jwksUri; + } + + + public OIDCDiscoveryResponse requestParameterSupported(@javax.annotation.Nullable Boolean requestParameterSupported) { + this.requestParameterSupported = requestParameterSupported; + return this; + } + + /** + * Get requestParameterSupported + * @return requestParameterSupported + */ + @javax.annotation.Nullable + public Boolean getRequestParameterSupported() { + return requestParameterSupported; + } + + public void setRequestParameterSupported(@javax.annotation.Nullable Boolean requestParameterSupported) { + this.requestParameterSupported = requestParameterSupported; + } + + + public OIDCDiscoveryResponse responseModesSupported(@javax.annotation.Nullable List<String> responseModesSupported) { + this.responseModesSupported = responseModesSupported; + return this; + } + + public OIDCDiscoveryResponse addResponseModesSupportedItem(String responseModesSupportedItem) { + if (this.responseModesSupported == null) { + this.responseModesSupported = new ArrayList<>(); + } + this.responseModesSupported.add(responseModesSupportedItem); + return this; + } + + /** + * Get responseModesSupported + * @return responseModesSupported + */ + @javax.annotation.Nullable + public List<String> getResponseModesSupported() { + return responseModesSupported; + } + + public void setResponseModesSupported(@javax.annotation.Nullable List<String> responseModesSupported) { + this.responseModesSupported = responseModesSupported; + } + + + public OIDCDiscoveryResponse responseTypesSupported(@javax.annotation.Nullable List<String> responseTypesSupported) { + this.responseTypesSupported = responseTypesSupported; + return this; + } + + public OIDCDiscoveryResponse addResponseTypesSupportedItem(String responseTypesSupportedItem) { + if (this.responseTypesSupported == null) { + this.responseTypesSupported = new ArrayList<>(); + } + this.responseTypesSupported.add(responseTypesSupportedItem); + return this; + } + + /** + * Get responseTypesSupported + * @return responseTypesSupported + */ + @javax.annotation.Nullable + public List<String> getResponseTypesSupported() { + return responseTypesSupported; + } + + public void setResponseTypesSupported(@javax.annotation.Nullable List<String> responseTypesSupported) { + this.responseTypesSupported = responseTypesSupported; + } + + + public OIDCDiscoveryResponse revocationEndpoint(@javax.annotation.Nullable String revocationEndpoint) { + this.revocationEndpoint = revocationEndpoint; + return this; + } + + /** + * Get revocationEndpoint + * @return revocationEndpoint + */ + @javax.annotation.Nullable + public String getRevocationEndpoint() { + return revocationEndpoint; + } + + public void setRevocationEndpoint(@javax.annotation.Nullable String revocationEndpoint) { + this.revocationEndpoint = revocationEndpoint; + } + + + public OIDCDiscoveryResponse introspectionEndpoint(@javax.annotation.Nullable String introspectionEndpoint) { + this.introspectionEndpoint = introspectionEndpoint; + return this; + } + + /** + * OAuth 2.0 Token Introspection endpoint (RFC 7662) + * @return introspectionEndpoint + */ + @javax.annotation.Nullable + public String getIntrospectionEndpoint() { + return introspectionEndpoint; + } + + public void setIntrospectionEndpoint(@javax.annotation.Nullable String introspectionEndpoint) { + this.introspectionEndpoint = introspectionEndpoint; + } + + + public OIDCDiscoveryResponse revocationEndpointAuthMethodsSupported(@javax.annotation.Nullable List<String> revocationEndpointAuthMethodsSupported) { + this.revocationEndpointAuthMethodsSupported = revocationEndpointAuthMethodsSupported; + return this; + } + + public OIDCDiscoveryResponse addRevocationEndpointAuthMethodsSupportedItem(String revocationEndpointAuthMethodsSupportedItem) { + if (this.revocationEndpointAuthMethodsSupported == null) { + this.revocationEndpointAuthMethodsSupported = new ArrayList<>(); + } + this.revocationEndpointAuthMethodsSupported.add(revocationEndpointAuthMethodsSupportedItem); + return this; + } + + /** + * Get revocationEndpointAuthMethodsSupported + * @return revocationEndpointAuthMethodsSupported + */ + @javax.annotation.Nullable + public List<String> getRevocationEndpointAuthMethodsSupported() { + return revocationEndpointAuthMethodsSupported; + } + + public void setRevocationEndpointAuthMethodsSupported(@javax.annotation.Nullable List<String> revocationEndpointAuthMethodsSupported) { + this.revocationEndpointAuthMethodsSupported = revocationEndpointAuthMethodsSupported; + } + + + public OIDCDiscoveryResponse scopesSupported(@javax.annotation.Nullable List<String> scopesSupported) { + this.scopesSupported = scopesSupported; + return this; + } + + public OIDCDiscoveryResponse addScopesSupportedItem(String scopesSupportedItem) { + if (this.scopesSupported == null) { + this.scopesSupported = new ArrayList<>(); + } + this.scopesSupported.add(scopesSupportedItem); + return this; + } + + /** + * Get scopesSupported + * @return scopesSupported + */ + @javax.annotation.Nullable + public List<String> getScopesSupported() { + return scopesSupported; + } + + public void setScopesSupported(@javax.annotation.Nullable List<String> scopesSupported) { + this.scopesSupported = scopesSupported; + } + + + public OIDCDiscoveryResponse subjectTypesSupported(@javax.annotation.Nullable List<String> subjectTypesSupported) { + this.subjectTypesSupported = subjectTypesSupported; + return this; + } + + public OIDCDiscoveryResponse addSubjectTypesSupportedItem(String subjectTypesSupportedItem) { + if (this.subjectTypesSupported == null) { + this.subjectTypesSupported = new ArrayList<>(); + } + this.subjectTypesSupported.add(subjectTypesSupportedItem); + return this; + } + + /** + * Get subjectTypesSupported + * @return subjectTypesSupported + */ + @javax.annotation.Nullable + public List<String> getSubjectTypesSupported() { + return subjectTypesSupported; + } + + public void setSubjectTypesSupported(@javax.annotation.Nullable List<String> subjectTypesSupported) { + this.subjectTypesSupported = subjectTypesSupported; + } + + + public OIDCDiscoveryResponse tokenEndpoint(@javax.annotation.Nullable String tokenEndpoint) { + this.tokenEndpoint = tokenEndpoint; + return this; + } + + /** + * Get tokenEndpoint + * @return tokenEndpoint + */ + @javax.annotation.Nullable + public String getTokenEndpoint() { + return tokenEndpoint; + } + + public void setTokenEndpoint(@javax.annotation.Nullable String tokenEndpoint) { + this.tokenEndpoint = tokenEndpoint; + } + + + public OIDCDiscoveryResponse tokenEndpointAuthMethodsSupported(@javax.annotation.Nullable List<String> tokenEndpointAuthMethodsSupported) { + this.tokenEndpointAuthMethodsSupported = tokenEndpointAuthMethodsSupported; + return this; + } + + public OIDCDiscoveryResponse addTokenEndpointAuthMethodsSupportedItem(String tokenEndpointAuthMethodsSupportedItem) { + if (this.tokenEndpointAuthMethodsSupported == null) { + this.tokenEndpointAuthMethodsSupported = new ArrayList<>(); + } + this.tokenEndpointAuthMethodsSupported.add(tokenEndpointAuthMethodsSupportedItem); + return this; + } + + /** + * Get tokenEndpointAuthMethodsSupported + * @return tokenEndpointAuthMethodsSupported + */ + @javax.annotation.Nullable + public List<String> getTokenEndpointAuthMethodsSupported() { + return tokenEndpointAuthMethodsSupported; + } + + public void setTokenEndpointAuthMethodsSupported(@javax.annotation.Nullable List<String> tokenEndpointAuthMethodsSupported) { + this.tokenEndpointAuthMethodsSupported = tokenEndpointAuthMethodsSupported; + } + + + public OIDCDiscoveryResponse userinfoEndpoint(@javax.annotation.Nullable String userinfoEndpoint) { + this.userinfoEndpoint = userinfoEndpoint; + return this; + } + + /** + * Get userinfoEndpoint + * @return userinfoEndpoint + */ + @javax.annotation.Nullable + public String getUserinfoEndpoint() { + return userinfoEndpoint; + } + + public void setUserinfoEndpoint(@javax.annotation.Nullable String userinfoEndpoint) { + this.userinfoEndpoint = userinfoEndpoint; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OIDCDiscoveryResponse instance itself + */ + public OIDCDiscoveryResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OIDCDiscoveryResponse oiDCDiscoveryResponse = (OIDCDiscoveryResponse) o; + return Objects.equals(this.acrValuesSupported, oiDCDiscoveryResponse.acrValuesSupported) && + Objects.equals(this.authorizationEndpoint, oiDCDiscoveryResponse.authorizationEndpoint) && + Objects.equals(this.backchannelLogoutSessionSupported, oiDCDiscoveryResponse.backchannelLogoutSessionSupported) && + Objects.equals(this.backchannelLogoutSupported, oiDCDiscoveryResponse.backchannelLogoutSupported) && + Objects.equals(this.claimsSupported, oiDCDiscoveryResponse.claimsSupported) && + Objects.equals(this.codeChallengeMethodsSupported, oiDCDiscoveryResponse.codeChallengeMethodsSupported) && + Objects.equals(this.endSessionEndpoint, oiDCDiscoveryResponse.endSessionEndpoint) && + Objects.equals(this.grantTypesSupported, oiDCDiscoveryResponse.grantTypesSupported) && + Objects.equals(this.idTokenSigningAlgValuesSupported, oiDCDiscoveryResponse.idTokenSigningAlgValuesSupported) && + Objects.equals(this.issuer, oiDCDiscoveryResponse.issuer) && + Objects.equals(this.jwksUri, oiDCDiscoveryResponse.jwksUri) && + Objects.equals(this.requestParameterSupported, oiDCDiscoveryResponse.requestParameterSupported) && + Objects.equals(this.responseModesSupported, oiDCDiscoveryResponse.responseModesSupported) && + Objects.equals(this.responseTypesSupported, oiDCDiscoveryResponse.responseTypesSupported) && + Objects.equals(this.revocationEndpoint, oiDCDiscoveryResponse.revocationEndpoint) && + Objects.equals(this.introspectionEndpoint, oiDCDiscoveryResponse.introspectionEndpoint) && + Objects.equals(this.revocationEndpointAuthMethodsSupported, oiDCDiscoveryResponse.revocationEndpointAuthMethodsSupported) && + Objects.equals(this.scopesSupported, oiDCDiscoveryResponse.scopesSupported) && + Objects.equals(this.subjectTypesSupported, oiDCDiscoveryResponse.subjectTypesSupported) && + Objects.equals(this.tokenEndpoint, oiDCDiscoveryResponse.tokenEndpoint) && + Objects.equals(this.tokenEndpointAuthMethodsSupported, oiDCDiscoveryResponse.tokenEndpointAuthMethodsSupported) && + Objects.equals(this.userinfoEndpoint, oiDCDiscoveryResponse.userinfoEndpoint)&& + Objects.equals(this.additionalProperties, oiDCDiscoveryResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(acrValuesSupported, authorizationEndpoint, backchannelLogoutSessionSupported, backchannelLogoutSupported, claimsSupported, codeChallengeMethodsSupported, endSessionEndpoint, grantTypesSupported, idTokenSigningAlgValuesSupported, issuer, jwksUri, requestParameterSupported, responseModesSupported, responseTypesSupported, revocationEndpoint, introspectionEndpoint, revocationEndpointAuthMethodsSupported, scopesSupported, subjectTypesSupported, tokenEndpoint, tokenEndpointAuthMethodsSupported, userinfoEndpoint, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OIDCDiscoveryResponse {\n"); + sb.append(" acrValuesSupported: ").append(toIndentedString(acrValuesSupported)).append("\n"); + sb.append(" authorizationEndpoint: ").append(toIndentedString(authorizationEndpoint)).append("\n"); + sb.append(" backchannelLogoutSessionSupported: ").append(toIndentedString(backchannelLogoutSessionSupported)).append("\n"); + sb.append(" backchannelLogoutSupported: ").append(toIndentedString(backchannelLogoutSupported)).append("\n"); + sb.append(" claimsSupported: ").append(toIndentedString(claimsSupported)).append("\n"); + sb.append(" codeChallengeMethodsSupported: ").append(toIndentedString(codeChallengeMethodsSupported)).append("\n"); + sb.append(" endSessionEndpoint: ").append(toIndentedString(endSessionEndpoint)).append("\n"); + sb.append(" grantTypesSupported: ").append(toIndentedString(grantTypesSupported)).append("\n"); + sb.append(" idTokenSigningAlgValuesSupported: ").append(toIndentedString(idTokenSigningAlgValuesSupported)).append("\n"); + sb.append(" issuer: ").append(toIndentedString(issuer)).append("\n"); + sb.append(" jwksUri: ").append(toIndentedString(jwksUri)).append("\n"); + sb.append(" requestParameterSupported: ").append(toIndentedString(requestParameterSupported)).append("\n"); + sb.append(" responseModesSupported: ").append(toIndentedString(responseModesSupported)).append("\n"); + sb.append(" responseTypesSupported: ").append(toIndentedString(responseTypesSupported)).append("\n"); + sb.append(" revocationEndpoint: ").append(toIndentedString(revocationEndpoint)).append("\n"); + sb.append(" introspectionEndpoint: ").append(toIndentedString(introspectionEndpoint)).append("\n"); + sb.append(" revocationEndpointAuthMethodsSupported: ").append(toIndentedString(revocationEndpointAuthMethodsSupported)).append("\n"); + sb.append(" scopesSupported: ").append(toIndentedString(scopesSupported)).append("\n"); + sb.append(" subjectTypesSupported: ").append(toIndentedString(subjectTypesSupported)).append("\n"); + sb.append(" tokenEndpoint: ").append(toIndentedString(tokenEndpoint)).append("\n"); + sb.append(" tokenEndpointAuthMethodsSupported: ").append(toIndentedString(tokenEndpointAuthMethodsSupported)).append("\n"); + sb.append(" userinfoEndpoint: ").append(toIndentedString(userinfoEndpoint)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("acr_values_supported"); + openapiFields.add("authorization_endpoint"); + openapiFields.add("backchannel_logout_session_supported"); + openapiFields.add("backchannel_logout_supported"); + openapiFields.add("claims_supported"); + openapiFields.add("code_challenge_methods_supported"); + openapiFields.add("end_session_endpoint"); + openapiFields.add("grant_types_supported"); + openapiFields.add("id_token_signing_alg_values_supported"); + openapiFields.add("issuer"); + openapiFields.add("jwks_uri"); + openapiFields.add("request_parameter_supported"); + openapiFields.add("response_modes_supported"); + openapiFields.add("response_types_supported"); + openapiFields.add("revocation_endpoint"); + openapiFields.add("introspection_endpoint"); + openapiFields.add("revocation_endpoint_auth_methods_supported"); + openapiFields.add("scopes_supported"); + openapiFields.add("subject_types_supported"); + openapiFields.add("token_endpoint"); + openapiFields.add("token_endpoint_auth_methods_supported"); + openapiFields.add("userinfo_endpoint"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OIDCDiscoveryResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OIDCDiscoveryResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OIDCDiscoveryResponse is not found in the empty JSON string", OIDCDiscoveryResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("acr_values_supported") != null && !jsonObj.get("acr_values_supported").isJsonNull() && !jsonObj.get("acr_values_supported").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `acr_values_supported` to be an array in the JSON string but got `%s`", jsonObj.get("acr_values_supported").toString())); + } + if ((jsonObj.get("authorization_endpoint") != null && !jsonObj.get("authorization_endpoint").isJsonNull()) && !jsonObj.get("authorization_endpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `authorization_endpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorization_endpoint").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("claims_supported") != null && !jsonObj.get("claims_supported").isJsonNull() && !jsonObj.get("claims_supported").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `claims_supported` to be an array in the JSON string but got `%s`", jsonObj.get("claims_supported").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("code_challenge_methods_supported") != null && !jsonObj.get("code_challenge_methods_supported").isJsonNull() && !jsonObj.get("code_challenge_methods_supported").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `code_challenge_methods_supported` to be an array in the JSON string but got `%s`", jsonObj.get("code_challenge_methods_supported").toString())); + } + if ((jsonObj.get("end_session_endpoint") != null && !jsonObj.get("end_session_endpoint").isJsonNull()) && !jsonObj.get("end_session_endpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `end_session_endpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("end_session_endpoint").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("grant_types_supported") != null && !jsonObj.get("grant_types_supported").isJsonNull() && !jsonObj.get("grant_types_supported").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `grant_types_supported` to be an array in the JSON string but got `%s`", jsonObj.get("grant_types_supported").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("id_token_signing_alg_values_supported") != null && !jsonObj.get("id_token_signing_alg_values_supported").isJsonNull() && !jsonObj.get("id_token_signing_alg_values_supported").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `id_token_signing_alg_values_supported` to be an array in the JSON string but got `%s`", jsonObj.get("id_token_signing_alg_values_supported").toString())); + } + if ((jsonObj.get("issuer") != null && !jsonObj.get("issuer").isJsonNull()) && !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("jwks_uri") != null && !jsonObj.get("jwks_uri").isJsonNull()) && !jsonObj.get("jwks_uri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `jwks_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("jwks_uri").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("response_modes_supported") != null && !jsonObj.get("response_modes_supported").isJsonNull() && !jsonObj.get("response_modes_supported").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `response_modes_supported` to be an array in the JSON string but got `%s`", jsonObj.get("response_modes_supported").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("response_types_supported") != null && !jsonObj.get("response_types_supported").isJsonNull() && !jsonObj.get("response_types_supported").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `response_types_supported` to be an array in the JSON string but got `%s`", jsonObj.get("response_types_supported").toString())); + } + if ((jsonObj.get("revocation_endpoint") != null && !jsonObj.get("revocation_endpoint").isJsonNull()) && !jsonObj.get("revocation_endpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `revocation_endpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("revocation_endpoint").toString())); + } + if ((jsonObj.get("introspection_endpoint") != null && !jsonObj.get("introspection_endpoint").isJsonNull()) && !jsonObj.get("introspection_endpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `introspection_endpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("introspection_endpoint").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("revocation_endpoint_auth_methods_supported") != null && !jsonObj.get("revocation_endpoint_auth_methods_supported").isJsonNull() && !jsonObj.get("revocation_endpoint_auth_methods_supported").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `revocation_endpoint_auth_methods_supported` to be an array in the JSON string but got `%s`", jsonObj.get("revocation_endpoint_auth_methods_supported").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("scopes_supported") != null && !jsonObj.get("scopes_supported").isJsonNull() && !jsonObj.get("scopes_supported").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `scopes_supported` to be an array in the JSON string but got `%s`", jsonObj.get("scopes_supported").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("subject_types_supported") != null && !jsonObj.get("subject_types_supported").isJsonNull() && !jsonObj.get("subject_types_supported").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `subject_types_supported` to be an array in the JSON string but got `%s`", jsonObj.get("subject_types_supported").toString())); + } + if ((jsonObj.get("token_endpoint") != null && !jsonObj.get("token_endpoint").isJsonNull()) && !jsonObj.get("token_endpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `token_endpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token_endpoint").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("token_endpoint_auth_methods_supported") != null && !jsonObj.get("token_endpoint_auth_methods_supported").isJsonNull() && !jsonObj.get("token_endpoint_auth_methods_supported").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `token_endpoint_auth_methods_supported` to be an array in the JSON string but got `%s`", jsonObj.get("token_endpoint_auth_methods_supported").toString())); + } + if ((jsonObj.get("userinfo_endpoint") != null && !jsonObj.get("userinfo_endpoint").isJsonNull()) && !jsonObj.get("userinfo_endpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userinfo_endpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userinfo_endpoint").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OIDCDiscoveryResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OIDCDiscoveryResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OIDCDiscoveryResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OIDCDiscoveryResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<OIDCDiscoveryResponse>() { + @Override + public void write(JsonWriter out, OIDCDiscoveryResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OIDCDiscoveryResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OIDCDiscoveryResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OIDCDiscoveryResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of OIDCDiscoveryResponse + * @throws IOException if the JSON string is invalid with respect to OIDCDiscoveryResponse + */ + public static OIDCDiscoveryResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OIDCDiscoveryResponse.class); + } + + /** + * Convert an instance of OIDCDiscoveryResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OIDCTokenIntrospectResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OIDCTokenIntrospectResponse.java new file mode 100644 index 0000000..8320523 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OIDCTokenIntrospectResponse.java @@ -0,0 +1,633 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OIDC Token Introspection Response (RFC 7662). When active is false, only active is returned. When active is true, standard claims may be included. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OIDCTokenIntrospectResponse { + public static final String SERIALIZED_NAME_ACTIVE = "active"; + @SerializedName(SERIALIZED_NAME_ACTIVE) + @javax.annotation.Nonnull + private Boolean active; + + public static final String SERIALIZED_NAME_SUB = "sub"; + @SerializedName(SERIALIZED_NAME_SUB) + @javax.annotation.Nullable + private String sub; + + public static final String SERIALIZED_NAME_CID = "cid"; + @SerializedName(SERIALIZED_NAME_CID) + @javax.annotation.Nullable + private String cid; + + public static final String SERIALIZED_NAME_AZP = "azp"; + @SerializedName(SERIALIZED_NAME_AZP) + @javax.annotation.Nullable + private String azp; + + public static final String SERIALIZED_NAME_ISS = "iss"; + @SerializedName(SERIALIZED_NAME_ISS) + @javax.annotation.Nullable + private String iss; + + public static final String SERIALIZED_NAME_EXP = "exp"; + @SerializedName(SERIALIZED_NAME_EXP) + @javax.annotation.Nullable + private Integer exp; + + public static final String SERIALIZED_NAME_IAT = "iat"; + @SerializedName(SERIALIZED_NAME_IAT) + @javax.annotation.Nullable + private Integer iat; + + public static final String SERIALIZED_NAME_NBF = "nbf"; + @SerializedName(SERIALIZED_NAME_NBF) + @javax.annotation.Nullable + private Integer nbf; + + public static final String SERIALIZED_NAME_GTY = "gty"; + @SerializedName(SERIALIZED_NAME_GTY) + @javax.annotation.Nullable + private String gty; + + public static final String SERIALIZED_NAME_SCP = "scp"; + @SerializedName(SERIALIZED_NAME_SCP) + @javax.annotation.Nullable + private List<String> scp = new ArrayList<>(); + + public static final String SERIALIZED_NAME_AUD = "aud"; + @SerializedName(SERIALIZED_NAME_AUD) + @javax.annotation.Nullable + private List<String> aud = new ArrayList<>(); + + public static final String SERIALIZED_NAME_JTI = "jti"; + @SerializedName(SERIALIZED_NAME_JTI) + @javax.annotation.Nullable + private String jti; + + public OIDCTokenIntrospectResponse() { + } + + public OIDCTokenIntrospectResponse active(@javax.annotation.Nonnull Boolean active) { + this.active = active; + return this; + } + + /** + * True if the token is valid and active; false otherwise. + * @return active + */ + @javax.annotation.Nonnull + public Boolean getActive() { + return active; + } + + public void setActive(@javax.annotation.Nonnull Boolean active) { + this.active = active; + } + + + public OIDCTokenIntrospectResponse sub(@javax.annotation.Nullable String sub) { + this.sub = sub; + return this; + } + + /** + * Subject (e.g. user or client identifier) + * @return sub + */ + @javax.annotation.Nullable + public String getSub() { + return sub; + } + + public void setSub(@javax.annotation.Nullable String sub) { + this.sub = sub; + } + + + public OIDCTokenIntrospectResponse cid(@javax.annotation.Nullable String cid) { + this.cid = cid; + return this; + } + + /** + * Client ID (audience/client) + * @return cid + */ + @javax.annotation.Nullable + public String getCid() { + return cid; + } + + public void setCid(@javax.annotation.Nullable String cid) { + this.cid = cid; + } + + + public OIDCTokenIntrospectResponse azp(@javax.annotation.Nullable String azp) { + this.azp = azp; + return this; + } + + /** + * Authorized party + * @return azp + */ + @javax.annotation.Nullable + public String getAzp() { + return azp; + } + + public void setAzp(@javax.annotation.Nullable String azp) { + this.azp = azp; + } + + + public OIDCTokenIntrospectResponse iss(@javax.annotation.Nullable String iss) { + this.iss = iss; + return this; + } + + /** + * Issuer + * @return iss + */ + @javax.annotation.Nullable + public String getIss() { + return iss; + } + + public void setIss(@javax.annotation.Nullable String iss) { + this.iss = iss; + } + + + public OIDCTokenIntrospectResponse exp(@javax.annotation.Nullable Integer exp) { + this.exp = exp; + return this; + } + + /** + * Expiration time (Unix) + * @return exp + */ + @javax.annotation.Nullable + public Integer getExp() { + return exp; + } + + public void setExp(@javax.annotation.Nullable Integer exp) { + this.exp = exp; + } + + + public OIDCTokenIntrospectResponse iat(@javax.annotation.Nullable Integer iat) { + this.iat = iat; + return this; + } + + /** + * Issued at (Unix) + * @return iat + */ + @javax.annotation.Nullable + public Integer getIat() { + return iat; + } + + public void setIat(@javax.annotation.Nullable Integer iat) { + this.iat = iat; + } + + + public OIDCTokenIntrospectResponse nbf(@javax.annotation.Nullable Integer nbf) { + this.nbf = nbf; + return this; + } + + /** + * Not before (Unix) + * @return nbf + */ + @javax.annotation.Nullable + public Integer getNbf() { + return nbf; + } + + public void setNbf(@javax.annotation.Nullable Integer nbf) { + this.nbf = nbf; + } + + + public OIDCTokenIntrospectResponse gty(@javax.annotation.Nullable String gty) { + this.gty = gty; + return this; + } + + /** + * Grant type (e.g. authorization_code, refresh_token, password) + * @return gty + */ + @javax.annotation.Nullable + public String getGty() { + return gty; + } + + public void setGty(@javax.annotation.Nullable String gty) { + this.gty = gty; + } + + + public OIDCTokenIntrospectResponse scp(@javax.annotation.Nullable List<String> scp) { + this.scp = scp; + return this; + } + + public OIDCTokenIntrospectResponse addScpItem(String scpItem) { + if (this.scp == null) { + this.scp = new ArrayList<>(); + } + this.scp.add(scpItem); + return this; + } + + /** + * Scopes + * @return scp + */ + @javax.annotation.Nullable + public List<String> getScp() { + return scp; + } + + public void setScp(@javax.annotation.Nullable List<String> scp) { + this.scp = scp; + } + + + public OIDCTokenIntrospectResponse aud(@javax.annotation.Nullable List<String> aud) { + this.aud = aud; + return this; + } + + public OIDCTokenIntrospectResponse addAudItem(String audItem) { + if (this.aud == null) { + this.aud = new ArrayList<>(); + } + this.aud.add(audItem); + return this; + } + + /** + * Audience + * @return aud + */ + @javax.annotation.Nullable + public List<String> getAud() { + return aud; + } + + public void setAud(@javax.annotation.Nullable List<String> aud) { + this.aud = aud; + } + + + public OIDCTokenIntrospectResponse jti(@javax.annotation.Nullable String jti) { + this.jti = jti; + return this; + } + + /** + * JWT ID + * @return jti + */ + @javax.annotation.Nullable + public String getJti() { + return jti; + } + + public void setJti(@javax.annotation.Nullable String jti) { + this.jti = jti; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OIDCTokenIntrospectResponse instance itself + */ + public OIDCTokenIntrospectResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OIDCTokenIntrospectResponse oiDCTokenIntrospectResponse = (OIDCTokenIntrospectResponse) o; + return Objects.equals(this.active, oiDCTokenIntrospectResponse.active) && + Objects.equals(this.sub, oiDCTokenIntrospectResponse.sub) && + Objects.equals(this.cid, oiDCTokenIntrospectResponse.cid) && + Objects.equals(this.azp, oiDCTokenIntrospectResponse.azp) && + Objects.equals(this.iss, oiDCTokenIntrospectResponse.iss) && + Objects.equals(this.exp, oiDCTokenIntrospectResponse.exp) && + Objects.equals(this.iat, oiDCTokenIntrospectResponse.iat) && + Objects.equals(this.nbf, oiDCTokenIntrospectResponse.nbf) && + Objects.equals(this.gty, oiDCTokenIntrospectResponse.gty) && + Objects.equals(this.scp, oiDCTokenIntrospectResponse.scp) && + Objects.equals(this.aud, oiDCTokenIntrospectResponse.aud) && + Objects.equals(this.jti, oiDCTokenIntrospectResponse.jti)&& + Objects.equals(this.additionalProperties, oiDCTokenIntrospectResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(active, sub, cid, azp, iss, exp, iat, nbf, gty, scp, aud, jti, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OIDCTokenIntrospectResponse {\n"); + sb.append(" active: ").append(toIndentedString(active)).append("\n"); + sb.append(" sub: ").append(toIndentedString(sub)).append("\n"); + sb.append(" cid: ").append(toIndentedString(cid)).append("\n"); + sb.append(" azp: ").append(toIndentedString(azp)).append("\n"); + sb.append(" iss: ").append(toIndentedString(iss)).append("\n"); + sb.append(" exp: ").append(toIndentedString(exp)).append("\n"); + sb.append(" iat: ").append(toIndentedString(iat)).append("\n"); + sb.append(" nbf: ").append(toIndentedString(nbf)).append("\n"); + sb.append(" gty: ").append(toIndentedString(gty)).append("\n"); + sb.append(" scp: ").append(toIndentedString(scp)).append("\n"); + sb.append(" aud: ").append(toIndentedString(aud)).append("\n"); + sb.append(" jti: ").append(toIndentedString(jti)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("active"); + openapiFields.add("sub"); + openapiFields.add("cid"); + openapiFields.add("azp"); + openapiFields.add("iss"); + openapiFields.add("exp"); + openapiFields.add("iat"); + openapiFields.add("nbf"); + openapiFields.add("gty"); + openapiFields.add("scp"); + openapiFields.add("aud"); + openapiFields.add("jti"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("active"); + } + + /** + * 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 OIDCTokenIntrospectResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OIDCTokenIntrospectResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OIDCTokenIntrospectResponse is not found in the empty JSON string", OIDCTokenIntrospectResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OIDCTokenIntrospectResponse.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("sub") != null && !jsonObj.get("sub").isJsonNull()) && !jsonObj.get("sub").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `sub` to be a primitive type in the JSON string but got `%s`", jsonObj.get("sub").toString())); + } + if ((jsonObj.get("cid") != null && !jsonObj.get("cid").isJsonNull()) && !jsonObj.get("cid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `cid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("cid").toString())); + } + if ((jsonObj.get("azp") != null && !jsonObj.get("azp").isJsonNull()) && !jsonObj.get("azp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `azp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("azp").toString())); + } + if ((jsonObj.get("iss") != null && !jsonObj.get("iss").isJsonNull()) && !jsonObj.get("iss").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `iss` to be a primitive type in the JSON string but got `%s`", jsonObj.get("iss").toString())); + } + if ((jsonObj.get("gty") != null && !jsonObj.get("gty").isJsonNull()) && !jsonObj.get("gty").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `gty` to be a primitive type in the JSON string but got `%s`", jsonObj.get("gty").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("scp") != null && !jsonObj.get("scp").isJsonNull() && !jsonObj.get("scp").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `scp` to be an array in the JSON string but got `%s`", jsonObj.get("scp").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("aud") != null && !jsonObj.get("aud").isJsonNull() && !jsonObj.get("aud").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `aud` to be an array in the JSON string but got `%s`", jsonObj.get("aud").toString())); + } + if ((jsonObj.get("jti") != null && !jsonObj.get("jti").isJsonNull()) && !jsonObj.get("jti").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `jti` to be a primitive type in the JSON string but got `%s`", jsonObj.get("jti").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OIDCTokenIntrospectResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OIDCTokenIntrospectResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OIDCTokenIntrospectResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OIDCTokenIntrospectResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<OIDCTokenIntrospectResponse>() { + @Override + public void write(JsonWriter out, OIDCTokenIntrospectResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OIDCTokenIntrospectResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OIDCTokenIntrospectResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OIDCTokenIntrospectResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of OIDCTokenIntrospectResponse + * @throws IOException if the JSON string is invalid with respect to OIDCTokenIntrospectResponse + */ + public static OIDCTokenIntrospectResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OIDCTokenIntrospectResponse.class); + } + + /** + * Convert an instance of OIDCTokenIntrospectResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OIDCTokenResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OIDCTokenResponse.java new file mode 100644 index 0000000..e466f6a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OIDCTokenResponse.java @@ -0,0 +1,407 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OIDC Token Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OIDCTokenResponse { + public static final String SERIALIZED_NAME_ACCESS_TOKEN = "access_token"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN) + @javax.annotation.Nullable + private String accessToken; + + public static final String SERIALIZED_NAME_EXPIRE_IN = "expire_in"; + @SerializedName(SERIALIZED_NAME_EXPIRE_IN) + @javax.annotation.Nullable + private String expireIn; + + public static final String SERIALIZED_NAME_ID_TOKEN = "id_token"; + @SerializedName(SERIALIZED_NAME_ID_TOKEN) + @javax.annotation.Nullable + private String idToken; + + public static final String SERIALIZED_NAME_REFRESH_TOKEN = "refresh_token"; + @SerializedName(SERIALIZED_NAME_REFRESH_TOKEN) + @javax.annotation.Nullable + private String refreshToken; + + public static final String SERIALIZED_NAME_TOKEN_TYPE = "token_type"; + @SerializedName(SERIALIZED_NAME_TOKEN_TYPE) + @javax.annotation.Nullable + private String tokenType = "Bearer"; + + public OIDCTokenResponse() { + } + + public OIDCTokenResponse accessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Get accessToken + * @return accessToken + */ + @javax.annotation.Nullable + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + } + + + public OIDCTokenResponse expireIn(@javax.annotation.Nullable String expireIn) { + this.expireIn = expireIn; + return this; + } + + /** + * Get expireIn + * @return expireIn + */ + @javax.annotation.Nullable + public String getExpireIn() { + return expireIn; + } + + public void setExpireIn(@javax.annotation.Nullable String expireIn) { + this.expireIn = expireIn; + } + + + public OIDCTokenResponse idToken(@javax.annotation.Nullable String idToken) { + this.idToken = idToken; + return this; + } + + /** + * Get idToken + * @return idToken + */ + @javax.annotation.Nullable + public String getIdToken() { + return idToken; + } + + public void setIdToken(@javax.annotation.Nullable String idToken) { + this.idToken = idToken; + } + + + public OIDCTokenResponse refreshToken(@javax.annotation.Nullable String refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + /** + * Get refreshToken + * @return refreshToken + */ + @javax.annotation.Nullable + public String getRefreshToken() { + return refreshToken; + } + + public void setRefreshToken(@javax.annotation.Nullable String refreshToken) { + this.refreshToken = refreshToken; + } + + + public OIDCTokenResponse tokenType(@javax.annotation.Nullable String tokenType) { + this.tokenType = tokenType; + return this; + } + + /** + * Get tokenType + * @return tokenType + */ + @javax.annotation.Nullable + public String getTokenType() { + return tokenType; + } + + public void setTokenType(@javax.annotation.Nullable String tokenType) { + this.tokenType = tokenType; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OIDCTokenResponse instance itself + */ + public OIDCTokenResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OIDCTokenResponse oiDCTokenResponse = (OIDCTokenResponse) o; + return Objects.equals(this.accessToken, oiDCTokenResponse.accessToken) && + Objects.equals(this.expireIn, oiDCTokenResponse.expireIn) && + Objects.equals(this.idToken, oiDCTokenResponse.idToken) && + Objects.equals(this.refreshToken, oiDCTokenResponse.refreshToken) && + Objects.equals(this.tokenType, oiDCTokenResponse.tokenType)&& + Objects.equals(this.additionalProperties, oiDCTokenResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accessToken, expireIn, idToken, refreshToken, tokenType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OIDCTokenResponse {\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" expireIn: ").append(toIndentedString(expireIn)).append("\n"); + sb.append(" idToken: ").append(toIndentedString(idToken)).append("\n"); + sb.append(" refreshToken: ").append(toIndentedString(refreshToken)).append("\n"); + sb.append(" tokenType: ").append(toIndentedString(tokenType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("access_token"); + openapiFields.add("expire_in"); + openapiFields.add("id_token"); + openapiFields.add("refresh_token"); + openapiFields.add("token_type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OIDCTokenResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OIDCTokenResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OIDCTokenResponse is not found in the empty JSON string", OIDCTokenResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("access_token") != null && !jsonObj.get("access_token").isJsonNull()) && !jsonObj.get("access_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `access_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("access_token").toString())); + } + if ((jsonObj.get("expire_in") != null && !jsonObj.get("expire_in").isJsonNull()) && !jsonObj.get("expire_in").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `expire_in` to be a primitive type in the JSON string but got `%s`", jsonObj.get("expire_in").toString())); + } + if ((jsonObj.get("id_token") != null && !jsonObj.get("id_token").isJsonNull()) && !jsonObj.get("id_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id_token").toString())); + } + if ((jsonObj.get("refresh_token") != null && !jsonObj.get("refresh_token").isJsonNull()) && !jsonObj.get("refresh_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `refresh_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("refresh_token").toString())); + } + if ((jsonObj.get("token_type") != null && !jsonObj.get("token_type").isJsonNull()) && !jsonObj.get("token_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `token_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("token_type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OIDCTokenResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OIDCTokenResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OIDCTokenResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OIDCTokenResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<OIDCTokenResponse>() { + @Override + public void write(JsonWriter out, OIDCTokenResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OIDCTokenResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OIDCTokenResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OIDCTokenResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of OIDCTokenResponse + * @throws IOException if the JSON string is invalid with respect to OIDCTokenResponse + */ + public static OIDCTokenResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OIDCTokenResponse.class); + } + + /** + * Convert an instance of OIDCTokenResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OIDCUserinfo.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OIDCUserinfo.java new file mode 100644 index 0000000..2fd7379 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OIDCUserinfo.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OIDC Userinfo request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OIDCUserinfo { + public static final String SERIALIZED_NAME_ACCESS_TOKEN = "access_token"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN) + @javax.annotation.Nonnull + private String accessToken; + + public OIDCUserinfo() { + } + + public OIDCUserinfo accessToken(@javax.annotation.Nonnull String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Get accessToken + * @return accessToken + */ + @javax.annotation.Nonnull + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(@javax.annotation.Nonnull String accessToken) { + this.accessToken = accessToken; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OIDCUserinfo instance itself + */ + public OIDCUserinfo putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OIDCUserinfo oiDCUserinfo = (OIDCUserinfo) o; + return Objects.equals(this.accessToken, oiDCUserinfo.accessToken)&& + Objects.equals(this.additionalProperties, oiDCUserinfo.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accessToken, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OIDCUserinfo {\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("access_token"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("access_token"); + } + + /** + * 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 OIDCUserinfo + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OIDCUserinfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OIDCUserinfo is not found in the empty JSON string", OIDCUserinfo.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OIDCUserinfo.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("access_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `access_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("access_token").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OIDCUserinfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OIDCUserinfo' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OIDCUserinfo> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OIDCUserinfo.class)); + + return (TypeAdapter<T>) new TypeAdapter<OIDCUserinfo>() { + @Override + public void write(JsonWriter out, OIDCUserinfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OIDCUserinfo read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OIDCUserinfo instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OIDCUserinfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of OIDCUserinfo + * @throws IOException if the JSON string is invalid with respect to OIDCUserinfo + */ + public static OIDCUserinfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OIDCUserinfo.class); + } + + /** + * Convert an instance of OIDCUserinfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OidcConnectionBase.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OidcConnectionBase.java new file mode 100644 index 0000000..0f2971a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OidcConnectionBase.java @@ -0,0 +1,577 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * OidcConnectionBase + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OidcConnectionBase { + public static final String SERIALIZED_NAME_AUTHORIZATION_URL = "AuthorizationUrl"; + @SerializedName(SERIALIZED_NAME_AUTHORIZATION_URL) + @javax.annotation.Nullable + private String authorizationUrl; + + public static final String SERIALIZED_NAME_CLIENT_ID = "ClientId"; + @SerializedName(SERIALIZED_NAME_CLIENT_ID) + @javax.annotation.Nullable + private String clientId; + + public static final String SERIALIZED_NAME_CLIENT_SECRET = "ClientSecret"; + @SerializedName(SERIALIZED_NAME_CLIENT_SECRET) + @javax.annotation.Nullable + private String clientSecret; + + public static final String SERIALIZED_NAME_ISSUER = "Issuer"; + @SerializedName(SERIALIZED_NAME_ISSUER) + @javax.annotation.Nullable + private String issuer; + + public static final String SERIALIZED_NAME_SCOPES = "Scopes"; + @SerializedName(SERIALIZED_NAME_SCOPES) + @javax.annotation.Nullable + private List<String> scopes = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TOKEN_AUTH_METHOD = "TokenAuthMethod"; + @SerializedName(SERIALIZED_NAME_TOKEN_AUTH_METHOD) + @javax.annotation.Nullable + private String tokenAuthMethod; + + public static final String SERIALIZED_NAME_TOKEN_URL = "TokenUrl"; + @SerializedName(SERIALIZED_NAME_TOKEN_URL) + @javax.annotation.Nullable + private String tokenUrl; + + public static final String SERIALIZED_NAME_USER_INFO_URL = "UserInfoUrl"; + @SerializedName(SERIALIZED_NAME_USER_INFO_URL) + @javax.annotation.Nullable + private String userInfoUrl; + + public static final String SERIALIZED_NAME_USER_INFO_EXTRACT_BY_ID_TOKEN = "UserInfoExtractByIdToken"; + @SerializedName(SERIALIZED_NAME_USER_INFO_EXTRACT_BY_ID_TOKEN) + @javax.annotation.Nullable + private Boolean userInfoExtractByIdToken; + + public static final String SERIALIZED_NAME_JW_K_S_ENDPOINT = "JWKSEndpoint"; + @SerializedName(SERIALIZED_NAME_JW_K_S_ENDPOINT) + @javax.annotation.Nullable + private String jwKSEndpoint; + + public OidcConnectionBase() { + } + + public OidcConnectionBase authorizationUrl(@javax.annotation.Nullable String authorizationUrl) { + this.authorizationUrl = authorizationUrl; + return this; + } + + /** + * The URL to the OpenID Connect provider's authorization endpoint. This is where users are redirected to authenticate and authorize access. + * @return authorizationUrl + */ + @javax.annotation.Nullable + public String getAuthorizationUrl() { + return authorizationUrl; + } + + public void setAuthorizationUrl(@javax.annotation.Nullable String authorizationUrl) { + this.authorizationUrl = authorizationUrl; + } + + + public OidcConnectionBase clientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * The client identifier issued to the application by the OpenID Connect provider. This is used to identify the application during the authentication process. + * @return clientId + */ + @javax.annotation.Nullable + public String getClientId() { + return clientId; + } + + public void setClientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + } + + + public OidcConnectionBase clientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * The client secret issued to the application by the OpenID Connect provider. This is used to authenticate the application when requesting tokens. + * @return clientSecret + */ + @javax.annotation.Nullable + public String getClientSecret() { + return clientSecret; + } + + public void setClientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + } + + + public OidcConnectionBase issuer(@javax.annotation.Nullable String issuer) { + this.issuer = issuer; + return this; + } + + /** + * The issuer identifier for the OpenID Connect provider. This is typically the base URL of the provider and is used to validate tokens. + * @return issuer + */ + @javax.annotation.Nullable + public String getIssuer() { + return issuer; + } + + public void setIssuer(@javax.annotation.Nullable String issuer) { + this.issuer = issuer; + } + + + public OidcConnectionBase scopes(@javax.annotation.Nullable List<String> scopes) { + this.scopes = scopes; + return this; + } + + public OidcConnectionBase addScopesItem(String scopesItem) { + if (this.scopes == null) { + this.scopes = new ArrayList<>(); + } + this.scopes.add(scopesItem); + return this; + } + + /** + * The scopes requested by the application during the authentication process. Scopes define the access level and Permissions granted to the application. + * @return scopes + */ + @javax.annotation.Nullable + public List<String> getScopes() { + return scopes; + } + + public void setScopes(@javax.annotation.Nullable List<String> scopes) { + this.scopes = scopes; + } + + + public OidcConnectionBase tokenAuthMethod(@javax.annotation.Nullable String tokenAuthMethod) { + this.tokenAuthMethod = tokenAuthMethod; + return this; + } + + /** + * The method used to authenticate the application when requesting tokens. Common methods include `client_secret_post` and `client_secret_basic`. + * @return tokenAuthMethod + */ + @javax.annotation.Nullable + public String getTokenAuthMethod() { + return tokenAuthMethod; + } + + public void setTokenAuthMethod(@javax.annotation.Nullable String tokenAuthMethod) { + this.tokenAuthMethod = tokenAuthMethod; + } + + + public OidcConnectionBase tokenUrl(@javax.annotation.Nullable String tokenUrl) { + this.tokenUrl = tokenUrl; + return this; + } + + /** + * The URL to the OpenID Connect provider's token endpoint. This is where the application exchanges the authorization code for tokens. + * @return tokenUrl + */ + @javax.annotation.Nullable + public String getTokenUrl() { + return tokenUrl; + } + + public void setTokenUrl(@javax.annotation.Nullable String tokenUrl) { + this.tokenUrl = tokenUrl; + } + + + public OidcConnectionBase userInfoUrl(@javax.annotation.Nullable String userInfoUrl) { + this.userInfoUrl = userInfoUrl; + return this; + } + + /** + * The URL to the OpenID Connect provider's UserInfo endpoint. + * @return userInfoUrl + */ + @javax.annotation.Nullable + public String getUserInfoUrl() { + return userInfoUrl; + } + + public void setUserInfoUrl(@javax.annotation.Nullable String userInfoUrl) { + this.userInfoUrl = userInfoUrl; + } + + + public OidcConnectionBase userInfoExtractByIdToken(@javax.annotation.Nullable Boolean userInfoExtractByIdToken) { + this.userInfoExtractByIdToken = userInfoExtractByIdToken; + return this; + } + + /** + * Indicates if user info should be extracted by ID token. + * @return userInfoExtractByIdToken + */ + @javax.annotation.Nullable + public Boolean getUserInfoExtractByIdToken() { + return userInfoExtractByIdToken; + } + + public void setUserInfoExtractByIdToken(@javax.annotation.Nullable Boolean userInfoExtractByIdToken) { + this.userInfoExtractByIdToken = userInfoExtractByIdToken; + } + + + public OidcConnectionBase jwKSEndpoint(@javax.annotation.Nullable String jwKSEndpoint) { + this.jwKSEndpoint = jwKSEndpoint; + return this; + } + + /** + * The JWKS endpoint for verifying the ID token. + * @return jwKSEndpoint + */ + @javax.annotation.Nullable + public String getJwKSEndpoint() { + return jwKSEndpoint; + } + + public void setJwKSEndpoint(@javax.annotation.Nullable String jwKSEndpoint) { + this.jwKSEndpoint = jwKSEndpoint; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OidcConnectionBase instance itself + */ + public OidcConnectionBase putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OidcConnectionBase oidcConnectionBase = (OidcConnectionBase) o; + return Objects.equals(this.authorizationUrl, oidcConnectionBase.authorizationUrl) && + Objects.equals(this.clientId, oidcConnectionBase.clientId) && + Objects.equals(this.clientSecret, oidcConnectionBase.clientSecret) && + Objects.equals(this.issuer, oidcConnectionBase.issuer) && + Objects.equals(this.scopes, oidcConnectionBase.scopes) && + Objects.equals(this.tokenAuthMethod, oidcConnectionBase.tokenAuthMethod) && + Objects.equals(this.tokenUrl, oidcConnectionBase.tokenUrl) && + Objects.equals(this.userInfoUrl, oidcConnectionBase.userInfoUrl) && + Objects.equals(this.userInfoExtractByIdToken, oidcConnectionBase.userInfoExtractByIdToken) && + Objects.equals(this.jwKSEndpoint, oidcConnectionBase.jwKSEndpoint)&& + Objects.equals(this.additionalProperties, oidcConnectionBase.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(authorizationUrl, clientId, clientSecret, issuer, scopes, tokenAuthMethod, tokenUrl, userInfoUrl, userInfoExtractByIdToken, jwKSEndpoint, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OidcConnectionBase {\n"); + sb.append(" authorizationUrl: ").append(toIndentedString(authorizationUrl)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); + sb.append(" issuer: ").append(toIndentedString(issuer)).append("\n"); + sb.append(" scopes: ").append(toIndentedString(scopes)).append("\n"); + sb.append(" tokenAuthMethod: ").append(toIndentedString(tokenAuthMethod)).append("\n"); + sb.append(" tokenUrl: ").append(toIndentedString(tokenUrl)).append("\n"); + sb.append(" userInfoUrl: ").append(toIndentedString(userInfoUrl)).append("\n"); + sb.append(" userInfoExtractByIdToken: ").append(toIndentedString(userInfoExtractByIdToken)).append("\n"); + sb.append(" jwKSEndpoint: ").append(toIndentedString(jwKSEndpoint)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AuthorizationUrl"); + openapiFields.add("ClientId"); + openapiFields.add("ClientSecret"); + openapiFields.add("Issuer"); + openapiFields.add("Scopes"); + openapiFields.add("TokenAuthMethod"); + openapiFields.add("TokenUrl"); + openapiFields.add("UserInfoUrl"); + openapiFields.add("UserInfoExtractByIdToken"); + openapiFields.add("JWKSEndpoint"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OidcConnectionBase + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OidcConnectionBase.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OidcConnectionBase is not found in the empty JSON string", OidcConnectionBase.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("AuthorizationUrl") != null && !jsonObj.get("AuthorizationUrl").isJsonNull()) && !jsonObj.get("AuthorizationUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AuthorizationUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AuthorizationUrl").toString())); + } + if ((jsonObj.get("ClientId") != null && !jsonObj.get("ClientId").isJsonNull()) && !jsonObj.get("ClientId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ClientId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ClientId").toString())); + } + if ((jsonObj.get("ClientSecret") != null && !jsonObj.get("ClientSecret").isJsonNull()) && !jsonObj.get("ClientSecret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ClientSecret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ClientSecret").toString())); + } + if ((jsonObj.get("Issuer") != null && !jsonObj.get("Issuer").isJsonNull()) && !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())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("Scopes") != null && !jsonObj.get("Scopes").isJsonNull() && !jsonObj.get("Scopes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Scopes` to be an array in the JSON string but got `%s`", jsonObj.get("Scopes").toString())); + } + if ((jsonObj.get("TokenAuthMethod") != null && !jsonObj.get("TokenAuthMethod").isJsonNull()) && !jsonObj.get("TokenAuthMethod").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TokenAuthMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TokenAuthMethod").toString())); + } + if ((jsonObj.get("TokenUrl") != null && !jsonObj.get("TokenUrl").isJsonNull()) && !jsonObj.get("TokenUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TokenUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TokenUrl").toString())); + } + if ((jsonObj.get("UserInfoUrl") != null && !jsonObj.get("UserInfoUrl").isJsonNull()) && !jsonObj.get("UserInfoUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UserInfoUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UserInfoUrl").toString())); + } + if ((jsonObj.get("JWKSEndpoint") != null && !jsonObj.get("JWKSEndpoint").isJsonNull()) && !jsonObj.get("JWKSEndpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `JWKSEndpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("JWKSEndpoint").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OidcConnectionBase.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OidcConnectionBase' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OidcConnectionBase> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OidcConnectionBase.class)); + + return (TypeAdapter<T>) new TypeAdapter<OidcConnectionBase>() { + @Override + public void write(JsonWriter out, OidcConnectionBase value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OidcConnectionBase read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OidcConnectionBase instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OidcConnectionBase given an JSON string + * + * @param jsonString JSON string + * @return An instance of OidcConnectionBase + * @throws IOException if the JSON string is invalid with respect to OidcConnectionBase + */ + public static OidcConnectionBase fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OidcConnectionBase.class); + } + + /** + * Convert an instance of OidcConnectionBase to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OidcConnectionRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OidcConnectionRequest.java new file mode 100644 index 0000000..5f84539 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OidcConnectionRequest.java @@ -0,0 +1,753 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.OrganizationsConnectionBaseAttributes; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * OidcConnectionRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OidcConnectionRequest { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_DOMAIN = "Domain"; + @SerializedName(SERIALIZED_NAME_DOMAIN) + @javax.annotation.Nullable + private String domain; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "Attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nullable + private OrganizationsConnectionBaseAttributes attributes; + + /** + * Type of the connection, which is OIDC in this case. + */ + @JsonAdapter(ConnectionTypeEnum.Adapter.class) + public enum ConnectionTypeEnum { + OIDC_CUSTOM("oidc_custom"); + + private String value; + + ConnectionTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ConnectionTypeEnum fromValue(String value) { + for (ConnectionTypeEnum b : ConnectionTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<ConnectionTypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final ConnectionTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ConnectionTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ConnectionTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ConnectionTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CONNECTION_TYPE = "ConnectionType"; + @SerializedName(SERIALIZED_NAME_CONNECTION_TYPE) + @javax.annotation.Nullable + private ConnectionTypeEnum connectionType; + + public static final String SERIALIZED_NAME_AUTHORIZATION_URL = "AuthorizationUrl"; + @SerializedName(SERIALIZED_NAME_AUTHORIZATION_URL) + @javax.annotation.Nullable + private String authorizationUrl; + + public static final String SERIALIZED_NAME_CLIENT_ID = "ClientId"; + @SerializedName(SERIALIZED_NAME_CLIENT_ID) + @javax.annotation.Nullable + private String clientId; + + public static final String SERIALIZED_NAME_CLIENT_SECRET = "ClientSecret"; + @SerializedName(SERIALIZED_NAME_CLIENT_SECRET) + @javax.annotation.Nullable + private String clientSecret; + + public static final String SERIALIZED_NAME_ISSUER = "Issuer"; + @SerializedName(SERIALIZED_NAME_ISSUER) + @javax.annotation.Nullable + private String issuer; + + public static final String SERIALIZED_NAME_SCOPES = "Scopes"; + @SerializedName(SERIALIZED_NAME_SCOPES) + @javax.annotation.Nullable + private List<String> scopes = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TOKEN_AUTH_METHOD = "TokenAuthMethod"; + @SerializedName(SERIALIZED_NAME_TOKEN_AUTH_METHOD) + @javax.annotation.Nullable + private String tokenAuthMethod; + + public static final String SERIALIZED_NAME_TOKEN_URL = "TokenUrl"; + @SerializedName(SERIALIZED_NAME_TOKEN_URL) + @javax.annotation.Nullable + private String tokenUrl; + + public static final String SERIALIZED_NAME_USER_INFO_URL = "UserInfoUrl"; + @SerializedName(SERIALIZED_NAME_USER_INFO_URL) + @javax.annotation.Nullable + private String userInfoUrl; + + public static final String SERIALIZED_NAME_USER_INFO_EXTRACT_BY_ID_TOKEN = "UserInfoExtractByIdToken"; + @SerializedName(SERIALIZED_NAME_USER_INFO_EXTRACT_BY_ID_TOKEN) + @javax.annotation.Nullable + private Boolean userInfoExtractByIdToken; + + public static final String SERIALIZED_NAME_JW_K_S_ENDPOINT = "JWKSEndpoint"; + @SerializedName(SERIALIZED_NAME_JW_K_S_ENDPOINT) + @javax.annotation.Nullable + private String jwKSEndpoint; + + public OidcConnectionRequest() { + } + + public OidcConnectionRequest name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Name of the connection + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public OidcConnectionRequest domain(@javax.annotation.Nullable String domain) { + this.domain = domain; + return this; + } + + /** + * Domain associated with the connection + * @return domain + */ + @javax.annotation.Nullable + public String getDomain() { + return domain; + } + + public void setDomain(@javax.annotation.Nullable String domain) { + this.domain = domain; + } + + + public OidcConnectionRequest attributes(@javax.annotation.Nullable OrganizationsConnectionBaseAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nullable + public OrganizationsConnectionBaseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nullable OrganizationsConnectionBaseAttributes attributes) { + this.attributes = attributes; + } + + + public OidcConnectionRequest connectionType(@javax.annotation.Nullable ConnectionTypeEnum connectionType) { + this.connectionType = connectionType; + return this; + } + + /** + * Type of the connection, which is OIDC in this case. + * @return connectionType + */ + @javax.annotation.Nullable + public ConnectionTypeEnum getConnectionType() { + return connectionType; + } + + public void setConnectionType(@javax.annotation.Nullable ConnectionTypeEnum connectionType) { + this.connectionType = connectionType; + } + + + public OidcConnectionRequest authorizationUrl(@javax.annotation.Nullable String authorizationUrl) { + this.authorizationUrl = authorizationUrl; + return this; + } + + /** + * The URL to the OpenID Connect provider's authorization endpoint. This is where users are redirected to authenticate and authorize access. + * @return authorizationUrl + */ + @javax.annotation.Nullable + public String getAuthorizationUrl() { + return authorizationUrl; + } + + public void setAuthorizationUrl(@javax.annotation.Nullable String authorizationUrl) { + this.authorizationUrl = authorizationUrl; + } + + + public OidcConnectionRequest clientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * The client identifier issued to the application by the OpenID Connect provider. This is used to identify the application during the authentication process. + * @return clientId + */ + @javax.annotation.Nullable + public String getClientId() { + return clientId; + } + + public void setClientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + } + + + public OidcConnectionRequest clientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * The client secret issued to the application by the OpenID Connect provider. This is used to authenticate the application when requesting tokens. + * @return clientSecret + */ + @javax.annotation.Nullable + public String getClientSecret() { + return clientSecret; + } + + public void setClientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + } + + + public OidcConnectionRequest issuer(@javax.annotation.Nullable String issuer) { + this.issuer = issuer; + return this; + } + + /** + * The issuer identifier for the OpenID Connect provider. This is typically the base URL of the provider and is used to validate tokens. + * @return issuer + */ + @javax.annotation.Nullable + public String getIssuer() { + return issuer; + } + + public void setIssuer(@javax.annotation.Nullable String issuer) { + this.issuer = issuer; + } + + + public OidcConnectionRequest scopes(@javax.annotation.Nullable List<String> scopes) { + this.scopes = scopes; + return this; + } + + public OidcConnectionRequest addScopesItem(String scopesItem) { + if (this.scopes == null) { + this.scopes = new ArrayList<>(); + } + this.scopes.add(scopesItem); + return this; + } + + /** + * The scopes requested by the application during the authentication process. Scopes define the access level and Permissions granted to the application. + * @return scopes + */ + @javax.annotation.Nullable + public List<String> getScopes() { + return scopes; + } + + public void setScopes(@javax.annotation.Nullable List<String> scopes) { + this.scopes = scopes; + } + + + public OidcConnectionRequest tokenAuthMethod(@javax.annotation.Nullable String tokenAuthMethod) { + this.tokenAuthMethod = tokenAuthMethod; + return this; + } + + /** + * The method used to authenticate the application when requesting tokens. Common methods include `client_secret_post` and `client_secret_basic`. + * @return tokenAuthMethod + */ + @javax.annotation.Nullable + public String getTokenAuthMethod() { + return tokenAuthMethod; + } + + public void setTokenAuthMethod(@javax.annotation.Nullable String tokenAuthMethod) { + this.tokenAuthMethod = tokenAuthMethod; + } + + + public OidcConnectionRequest tokenUrl(@javax.annotation.Nullable String tokenUrl) { + this.tokenUrl = tokenUrl; + return this; + } + + /** + * The URL to the OpenID Connect provider's token endpoint. This is where the application exchanges the authorization code for tokens. + * @return tokenUrl + */ + @javax.annotation.Nullable + public String getTokenUrl() { + return tokenUrl; + } + + public void setTokenUrl(@javax.annotation.Nullable String tokenUrl) { + this.tokenUrl = tokenUrl; + } + + + public OidcConnectionRequest userInfoUrl(@javax.annotation.Nullable String userInfoUrl) { + this.userInfoUrl = userInfoUrl; + return this; + } + + /** + * The URL to the OpenID Connect provider's UserInfo endpoint. + * @return userInfoUrl + */ + @javax.annotation.Nullable + public String getUserInfoUrl() { + return userInfoUrl; + } + + public void setUserInfoUrl(@javax.annotation.Nullable String userInfoUrl) { + this.userInfoUrl = userInfoUrl; + } + + + public OidcConnectionRequest userInfoExtractByIdToken(@javax.annotation.Nullable Boolean userInfoExtractByIdToken) { + this.userInfoExtractByIdToken = userInfoExtractByIdToken; + return this; + } + + /** + * Indicates if user info should be extracted by ID token. + * @return userInfoExtractByIdToken + */ + @javax.annotation.Nullable + public Boolean getUserInfoExtractByIdToken() { + return userInfoExtractByIdToken; + } + + public void setUserInfoExtractByIdToken(@javax.annotation.Nullable Boolean userInfoExtractByIdToken) { + this.userInfoExtractByIdToken = userInfoExtractByIdToken; + } + + + public OidcConnectionRequest jwKSEndpoint(@javax.annotation.Nullable String jwKSEndpoint) { + this.jwKSEndpoint = jwKSEndpoint; + return this; + } + + /** + * The JWKS endpoint for verifying the ID token. + * @return jwKSEndpoint + */ + @javax.annotation.Nullable + public String getJwKSEndpoint() { + return jwKSEndpoint; + } + + public void setJwKSEndpoint(@javax.annotation.Nullable String jwKSEndpoint) { + this.jwKSEndpoint = jwKSEndpoint; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OidcConnectionRequest instance itself + */ + public OidcConnectionRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OidcConnectionRequest oidcConnectionRequest = (OidcConnectionRequest) o; + return Objects.equals(this.name, oidcConnectionRequest.name) && + Objects.equals(this.domain, oidcConnectionRequest.domain) && + Objects.equals(this.attributes, oidcConnectionRequest.attributes) && + Objects.equals(this.connectionType, oidcConnectionRequest.connectionType) && + Objects.equals(this.authorizationUrl, oidcConnectionRequest.authorizationUrl) && + Objects.equals(this.clientId, oidcConnectionRequest.clientId) && + Objects.equals(this.clientSecret, oidcConnectionRequest.clientSecret) && + Objects.equals(this.issuer, oidcConnectionRequest.issuer) && + Objects.equals(this.scopes, oidcConnectionRequest.scopes) && + Objects.equals(this.tokenAuthMethod, oidcConnectionRequest.tokenAuthMethod) && + Objects.equals(this.tokenUrl, oidcConnectionRequest.tokenUrl) && + Objects.equals(this.userInfoUrl, oidcConnectionRequest.userInfoUrl) && + Objects.equals(this.userInfoExtractByIdToken, oidcConnectionRequest.userInfoExtractByIdToken) && + Objects.equals(this.jwKSEndpoint, oidcConnectionRequest.jwKSEndpoint)&& + Objects.equals(this.additionalProperties, oidcConnectionRequest.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(name, domain, attributes, connectionType, authorizationUrl, clientId, clientSecret, issuer, scopes, tokenAuthMethod, tokenUrl, userInfoUrl, userInfoExtractByIdToken, jwKSEndpoint, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OidcConnectionRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" connectionType: ").append(toIndentedString(connectionType)).append("\n"); + sb.append(" authorizationUrl: ").append(toIndentedString(authorizationUrl)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); + sb.append(" issuer: ").append(toIndentedString(issuer)).append("\n"); + sb.append(" scopes: ").append(toIndentedString(scopes)).append("\n"); + sb.append(" tokenAuthMethod: ").append(toIndentedString(tokenAuthMethod)).append("\n"); + sb.append(" tokenUrl: ").append(toIndentedString(tokenUrl)).append("\n"); + sb.append(" userInfoUrl: ").append(toIndentedString(userInfoUrl)).append("\n"); + sb.append(" userInfoExtractByIdToken: ").append(toIndentedString(userInfoExtractByIdToken)).append("\n"); + sb.append(" jwKSEndpoint: ").append(toIndentedString(jwKSEndpoint)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + openapiFields.add("Domain"); + openapiFields.add("Attributes"); + openapiFields.add("ConnectionType"); + openapiFields.add("AuthorizationUrl"); + openapiFields.add("ClientId"); + openapiFields.add("ClientSecret"); + openapiFields.add("Issuer"); + openapiFields.add("Scopes"); + openapiFields.add("TokenAuthMethod"); + openapiFields.add("TokenUrl"); + openapiFields.add("UserInfoUrl"); + openapiFields.add("UserInfoExtractByIdToken"); + openapiFields.add("JWKSEndpoint"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OidcConnectionRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OidcConnectionRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OidcConnectionRequest is not found in the empty JSON string", OidcConnectionRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Domain") != null && !jsonObj.get("Domain").isJsonNull()) && !jsonObj.get("Domain").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Domain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Domain").toString())); + } + // validate the optional field `Attributes` + if (jsonObj.get("Attributes") != null && !jsonObj.get("Attributes").isJsonNull()) { + OrganizationsConnectionBaseAttributes.validateJsonElement(jsonObj.get("Attributes")); + } + if ((jsonObj.get("ConnectionType") != null && !jsonObj.get("ConnectionType").isJsonNull()) && !jsonObj.get("ConnectionType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ConnectionType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ConnectionType").toString())); + } + // validate the optional field `ConnectionType` + if (jsonObj.get("ConnectionType") != null && !jsonObj.get("ConnectionType").isJsonNull()) { + ConnectionTypeEnum.validateJsonElement(jsonObj.get("ConnectionType")); + } + if ((jsonObj.get("AuthorizationUrl") != null && !jsonObj.get("AuthorizationUrl").isJsonNull()) && !jsonObj.get("AuthorizationUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AuthorizationUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AuthorizationUrl").toString())); + } + if ((jsonObj.get("ClientId") != null && !jsonObj.get("ClientId").isJsonNull()) && !jsonObj.get("ClientId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ClientId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ClientId").toString())); + } + if ((jsonObj.get("ClientSecret") != null && !jsonObj.get("ClientSecret").isJsonNull()) && !jsonObj.get("ClientSecret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ClientSecret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ClientSecret").toString())); + } + if ((jsonObj.get("Issuer") != null && !jsonObj.get("Issuer").isJsonNull()) && !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())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("Scopes") != null && !jsonObj.get("Scopes").isJsonNull() && !jsonObj.get("Scopes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Scopes` to be an array in the JSON string but got `%s`", jsonObj.get("Scopes").toString())); + } + if ((jsonObj.get("TokenAuthMethod") != null && !jsonObj.get("TokenAuthMethod").isJsonNull()) && !jsonObj.get("TokenAuthMethod").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TokenAuthMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TokenAuthMethod").toString())); + } + if ((jsonObj.get("TokenUrl") != null && !jsonObj.get("TokenUrl").isJsonNull()) && !jsonObj.get("TokenUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TokenUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TokenUrl").toString())); + } + if ((jsonObj.get("UserInfoUrl") != null && !jsonObj.get("UserInfoUrl").isJsonNull()) && !jsonObj.get("UserInfoUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UserInfoUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UserInfoUrl").toString())); + } + if ((jsonObj.get("JWKSEndpoint") != null && !jsonObj.get("JWKSEndpoint").isJsonNull()) && !jsonObj.get("JWKSEndpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `JWKSEndpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("JWKSEndpoint").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OidcConnectionRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OidcConnectionRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OidcConnectionRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OidcConnectionRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<OidcConnectionRequest>() { + @Override + public void write(JsonWriter out, OidcConnectionRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OidcConnectionRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OidcConnectionRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OidcConnectionRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of OidcConnectionRequest + * @throws IOException if the JSON string is invalid with respect to OidcConnectionRequest + */ + public static OidcConnectionRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OidcConnectionRequest.class); + } + + /** + * Convert an instance of OidcConnectionRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OidcConnectionRequestCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OidcConnectionRequestCore.java new file mode 100644 index 0000000..82ecfbf --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OidcConnectionRequestCore.java @@ -0,0 +1,341 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OidcConnectionRequestCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OidcConnectionRequestCore { + /** + * Type of the connection, which is OIDC in this case. + */ + @JsonAdapter(ConnectionTypeEnum.Adapter.class) + public enum ConnectionTypeEnum { + OIDC_CUSTOM("oidc_custom"); + + private String value; + + ConnectionTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ConnectionTypeEnum fromValue(String value) { + for (ConnectionTypeEnum b : ConnectionTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<ConnectionTypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final ConnectionTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ConnectionTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ConnectionTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ConnectionTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CONNECTION_TYPE = "ConnectionType"; + @SerializedName(SERIALIZED_NAME_CONNECTION_TYPE) + @javax.annotation.Nullable + private ConnectionTypeEnum connectionType; + + public OidcConnectionRequestCore() { + } + + public OidcConnectionRequestCore connectionType(@javax.annotation.Nullable ConnectionTypeEnum connectionType) { + this.connectionType = connectionType; + return this; + } + + /** + * Type of the connection, which is OIDC in this case. + * @return connectionType + */ + @javax.annotation.Nullable + public ConnectionTypeEnum getConnectionType() { + return connectionType; + } + + public void setConnectionType(@javax.annotation.Nullable ConnectionTypeEnum connectionType) { + this.connectionType = connectionType; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OidcConnectionRequestCore instance itself + */ + public OidcConnectionRequestCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OidcConnectionRequestCore oidcConnectionRequestCore = (OidcConnectionRequestCore) o; + return Objects.equals(this.connectionType, oidcConnectionRequestCore.connectionType)&& + Objects.equals(this.additionalProperties, oidcConnectionRequestCore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(connectionType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OidcConnectionRequestCore {\n"); + sb.append(" connectionType: ").append(toIndentedString(connectionType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ConnectionType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OidcConnectionRequestCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OidcConnectionRequestCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OidcConnectionRequestCore is not found in the empty JSON string", OidcConnectionRequestCore.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ConnectionType") != null && !jsonObj.get("ConnectionType").isJsonNull()) && !jsonObj.get("ConnectionType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ConnectionType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ConnectionType").toString())); + } + // validate the optional field `ConnectionType` + if (jsonObj.get("ConnectionType") != null && !jsonObj.get("ConnectionType").isJsonNull()) { + ConnectionTypeEnum.validateJsonElement(jsonObj.get("ConnectionType")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OidcConnectionRequestCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OidcConnectionRequestCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OidcConnectionRequestCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OidcConnectionRequestCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<OidcConnectionRequestCore>() { + @Override + public void write(JsonWriter out, OidcConnectionRequestCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OidcConnectionRequestCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OidcConnectionRequestCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OidcConnectionRequestCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of OidcConnectionRequestCore + * @throws IOException if the JSON string is invalid with respect to OidcConnectionRequestCore + */ + public static OidcConnectionRequestCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OidcConnectionRequestCore.class); + } + + /** + * Convert an instance of OidcConnectionRequestCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OidcConnectionResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OidcConnectionResponse.java new file mode 100644 index 0000000..ec17be6 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OidcConnectionResponse.java @@ -0,0 +1,690 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * OidcConnectionResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OidcConnectionResponse { + public static final String SERIALIZED_NAME_AUTHORIZATION_URL = "AuthorizationUrl"; + @SerializedName(SERIALIZED_NAME_AUTHORIZATION_URL) + @javax.annotation.Nullable + private String authorizationUrl; + + public static final String SERIALIZED_NAME_CLIENT_ID = "ClientId"; + @SerializedName(SERIALIZED_NAME_CLIENT_ID) + @javax.annotation.Nullable + private String clientId; + + public static final String SERIALIZED_NAME_CLIENT_SECRET = "ClientSecret"; + @SerializedName(SERIALIZED_NAME_CLIENT_SECRET) + @javax.annotation.Nullable + private String clientSecret; + + public static final String SERIALIZED_NAME_ISSUER = "Issuer"; + @SerializedName(SERIALIZED_NAME_ISSUER) + @javax.annotation.Nullable + private String issuer; + + public static final String SERIALIZED_NAME_SCOPES = "Scopes"; + @SerializedName(SERIALIZED_NAME_SCOPES) + @javax.annotation.Nullable + private List<String> scopes = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TOKEN_AUTH_METHOD = "TokenAuthMethod"; + @SerializedName(SERIALIZED_NAME_TOKEN_AUTH_METHOD) + @javax.annotation.Nullable + private String tokenAuthMethod; + + public static final String SERIALIZED_NAME_TOKEN_URL = "TokenUrl"; + @SerializedName(SERIALIZED_NAME_TOKEN_URL) + @javax.annotation.Nullable + private String tokenUrl; + + public static final String SERIALIZED_NAME_USER_INFO_URL = "UserInfoUrl"; + @SerializedName(SERIALIZED_NAME_USER_INFO_URL) + @javax.annotation.Nullable + private String userInfoUrl; + + public static final String SERIALIZED_NAME_USER_INFO_EXTRACT_BY_ID_TOKEN = "UserInfoExtractByIdToken"; + @SerializedName(SERIALIZED_NAME_USER_INFO_EXTRACT_BY_ID_TOKEN) + @javax.annotation.Nullable + private Boolean userInfoExtractByIdToken; + + public static final String SERIALIZED_NAME_JW_K_S_ENDPOINT = "JWKSEndpoint"; + @SerializedName(SERIALIZED_NAME_JW_K_S_ENDPOINT) + @javax.annotation.Nullable + private String jwKSEndpoint; + + /** + * Type of the connection, which is OIDC in this case. + */ + @JsonAdapter(ConnectionTypeEnum.Adapter.class) + public enum ConnectionTypeEnum { + OIDC_CUSTOM("oidc_custom"); + + private String value; + + ConnectionTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ConnectionTypeEnum fromValue(String value) { + for (ConnectionTypeEnum b : ConnectionTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<ConnectionTypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final ConnectionTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ConnectionTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ConnectionTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ConnectionTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CONNECTION_TYPE = "ConnectionType"; + @SerializedName(SERIALIZED_NAME_CONNECTION_TYPE) + @javax.annotation.Nullable + private ConnectionTypeEnum connectionType; + + public static final String SERIALIZED_NAME_REDIRECT_U_R_I = "RedirectURI"; + @SerializedName(SERIALIZED_NAME_REDIRECT_U_R_I) + @javax.annotation.Nullable + private String redirectURI; + + public OidcConnectionResponse() { + } + + public OidcConnectionResponse( + String redirectURI + ) { + this(); + this.redirectURI = redirectURI; + } + + public OidcConnectionResponse authorizationUrl(@javax.annotation.Nullable String authorizationUrl) { + this.authorizationUrl = authorizationUrl; + return this; + } + + /** + * The URL to the OpenID Connect provider's authorization endpoint. This is where users are redirected to authenticate and authorize access. + * @return authorizationUrl + */ + @javax.annotation.Nullable + public String getAuthorizationUrl() { + return authorizationUrl; + } + + public void setAuthorizationUrl(@javax.annotation.Nullable String authorizationUrl) { + this.authorizationUrl = authorizationUrl; + } + + + public OidcConnectionResponse clientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + return this; + } + + /** + * The client identifier issued to the application by the OpenID Connect provider. This is used to identify the application during the authentication process. + * @return clientId + */ + @javax.annotation.Nullable + public String getClientId() { + return clientId; + } + + public void setClientId(@javax.annotation.Nullable String clientId) { + this.clientId = clientId; + } + + + public OidcConnectionResponse clientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * The client secret issued to the application by the OpenID Connect provider. This is used to authenticate the application when requesting tokens. + * @return clientSecret + */ + @javax.annotation.Nullable + public String getClientSecret() { + return clientSecret; + } + + public void setClientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + } + + + public OidcConnectionResponse issuer(@javax.annotation.Nullable String issuer) { + this.issuer = issuer; + return this; + } + + /** + * The issuer identifier for the OpenID Connect provider. This is typically the base URL of the provider and is used to validate tokens. + * @return issuer + */ + @javax.annotation.Nullable + public String getIssuer() { + return issuer; + } + + public void setIssuer(@javax.annotation.Nullable String issuer) { + this.issuer = issuer; + } + + + public OidcConnectionResponse scopes(@javax.annotation.Nullable List<String> scopes) { + this.scopes = scopes; + return this; + } + + public OidcConnectionResponse addScopesItem(String scopesItem) { + if (this.scopes == null) { + this.scopes = new ArrayList<>(); + } + this.scopes.add(scopesItem); + return this; + } + + /** + * The scopes requested by the application during the authentication process. Scopes define the access level and Permissions granted to the application. + * @return scopes + */ + @javax.annotation.Nullable + public List<String> getScopes() { + return scopes; + } + + public void setScopes(@javax.annotation.Nullable List<String> scopes) { + this.scopes = scopes; + } + + + public OidcConnectionResponse tokenAuthMethod(@javax.annotation.Nullable String tokenAuthMethod) { + this.tokenAuthMethod = tokenAuthMethod; + return this; + } + + /** + * The method used to authenticate the application when requesting tokens. Common methods include `client_secret_post` and `client_secret_basic`. + * @return tokenAuthMethod + */ + @javax.annotation.Nullable + public String getTokenAuthMethod() { + return tokenAuthMethod; + } + + public void setTokenAuthMethod(@javax.annotation.Nullable String tokenAuthMethod) { + this.tokenAuthMethod = tokenAuthMethod; + } + + + public OidcConnectionResponse tokenUrl(@javax.annotation.Nullable String tokenUrl) { + this.tokenUrl = tokenUrl; + return this; + } + + /** + * The URL to the OpenID Connect provider's token endpoint. This is where the application exchanges the authorization code for tokens. + * @return tokenUrl + */ + @javax.annotation.Nullable + public String getTokenUrl() { + return tokenUrl; + } + + public void setTokenUrl(@javax.annotation.Nullable String tokenUrl) { + this.tokenUrl = tokenUrl; + } + + + public OidcConnectionResponse userInfoUrl(@javax.annotation.Nullable String userInfoUrl) { + this.userInfoUrl = userInfoUrl; + return this; + } + + /** + * The URL to the OpenID Connect provider's UserInfo endpoint. + * @return userInfoUrl + */ + @javax.annotation.Nullable + public String getUserInfoUrl() { + return userInfoUrl; + } + + public void setUserInfoUrl(@javax.annotation.Nullable String userInfoUrl) { + this.userInfoUrl = userInfoUrl; + } + + + public OidcConnectionResponse userInfoExtractByIdToken(@javax.annotation.Nullable Boolean userInfoExtractByIdToken) { + this.userInfoExtractByIdToken = userInfoExtractByIdToken; + return this; + } + + /** + * Indicates if user info should be extracted by ID token. + * @return userInfoExtractByIdToken + */ + @javax.annotation.Nullable + public Boolean getUserInfoExtractByIdToken() { + return userInfoExtractByIdToken; + } + + public void setUserInfoExtractByIdToken(@javax.annotation.Nullable Boolean userInfoExtractByIdToken) { + this.userInfoExtractByIdToken = userInfoExtractByIdToken; + } + + + public OidcConnectionResponse jwKSEndpoint(@javax.annotation.Nullable String jwKSEndpoint) { + this.jwKSEndpoint = jwKSEndpoint; + return this; + } + + /** + * The JWKS endpoint for verifying the ID token. + * @return jwKSEndpoint + */ + @javax.annotation.Nullable + public String getJwKSEndpoint() { + return jwKSEndpoint; + } + + public void setJwKSEndpoint(@javax.annotation.Nullable String jwKSEndpoint) { + this.jwKSEndpoint = jwKSEndpoint; + } + + + public OidcConnectionResponse connectionType(@javax.annotation.Nullable ConnectionTypeEnum connectionType) { + this.connectionType = connectionType; + return this; + } + + /** + * Type of the connection, which is OIDC in this case. + * @return connectionType + */ + @javax.annotation.Nullable + public ConnectionTypeEnum getConnectionType() { + return connectionType; + } + + public void setConnectionType(@javax.annotation.Nullable ConnectionTypeEnum connectionType) { + this.connectionType = connectionType; + } + + + /** + * The redirect URI for the OIDC connection, where the authorization server will send the User after authentication. + * @return redirectURI + */ + @javax.annotation.Nullable + public String getRedirectURI() { + return redirectURI; + } + + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OidcConnectionResponse instance itself + */ + public OidcConnectionResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OidcConnectionResponse oidcConnectionResponse = (OidcConnectionResponse) o; + return Objects.equals(this.authorizationUrl, oidcConnectionResponse.authorizationUrl) && + Objects.equals(this.clientId, oidcConnectionResponse.clientId) && + Objects.equals(this.clientSecret, oidcConnectionResponse.clientSecret) && + Objects.equals(this.issuer, oidcConnectionResponse.issuer) && + Objects.equals(this.scopes, oidcConnectionResponse.scopes) && + Objects.equals(this.tokenAuthMethod, oidcConnectionResponse.tokenAuthMethod) && + Objects.equals(this.tokenUrl, oidcConnectionResponse.tokenUrl) && + Objects.equals(this.userInfoUrl, oidcConnectionResponse.userInfoUrl) && + Objects.equals(this.userInfoExtractByIdToken, oidcConnectionResponse.userInfoExtractByIdToken) && + Objects.equals(this.jwKSEndpoint, oidcConnectionResponse.jwKSEndpoint) && + Objects.equals(this.connectionType, oidcConnectionResponse.connectionType) && + Objects.equals(this.redirectURI, oidcConnectionResponse.redirectURI)&& + Objects.equals(this.additionalProperties, oidcConnectionResponse.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(authorizationUrl, clientId, clientSecret, issuer, scopes, tokenAuthMethod, tokenUrl, userInfoUrl, userInfoExtractByIdToken, jwKSEndpoint, connectionType, redirectURI, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OidcConnectionResponse {\n"); + sb.append(" authorizationUrl: ").append(toIndentedString(authorizationUrl)).append("\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); + sb.append(" issuer: ").append(toIndentedString(issuer)).append("\n"); + sb.append(" scopes: ").append(toIndentedString(scopes)).append("\n"); + sb.append(" tokenAuthMethod: ").append(toIndentedString(tokenAuthMethod)).append("\n"); + sb.append(" tokenUrl: ").append(toIndentedString(tokenUrl)).append("\n"); + sb.append(" userInfoUrl: ").append(toIndentedString(userInfoUrl)).append("\n"); + sb.append(" userInfoExtractByIdToken: ").append(toIndentedString(userInfoExtractByIdToken)).append("\n"); + sb.append(" jwKSEndpoint: ").append(toIndentedString(jwKSEndpoint)).append("\n"); + sb.append(" connectionType: ").append(toIndentedString(connectionType)).append("\n"); + sb.append(" redirectURI: ").append(toIndentedString(redirectURI)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AuthorizationUrl"); + openapiFields.add("ClientId"); + openapiFields.add("ClientSecret"); + openapiFields.add("Issuer"); + openapiFields.add("Scopes"); + openapiFields.add("TokenAuthMethod"); + openapiFields.add("TokenUrl"); + openapiFields.add("UserInfoUrl"); + openapiFields.add("UserInfoExtractByIdToken"); + openapiFields.add("JWKSEndpoint"); + openapiFields.add("ConnectionType"); + openapiFields.add("RedirectURI"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OidcConnectionResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OidcConnectionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OidcConnectionResponse is not found in the empty JSON string", OidcConnectionResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("AuthorizationUrl") != null && !jsonObj.get("AuthorizationUrl").isJsonNull()) && !jsonObj.get("AuthorizationUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AuthorizationUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AuthorizationUrl").toString())); + } + if ((jsonObj.get("ClientId") != null && !jsonObj.get("ClientId").isJsonNull()) && !jsonObj.get("ClientId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ClientId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ClientId").toString())); + } + if ((jsonObj.get("ClientSecret") != null && !jsonObj.get("ClientSecret").isJsonNull()) && !jsonObj.get("ClientSecret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ClientSecret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ClientSecret").toString())); + } + if ((jsonObj.get("Issuer") != null && !jsonObj.get("Issuer").isJsonNull()) && !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())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("Scopes") != null && !jsonObj.get("Scopes").isJsonNull() && !jsonObj.get("Scopes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Scopes` to be an array in the JSON string but got `%s`", jsonObj.get("Scopes").toString())); + } + if ((jsonObj.get("TokenAuthMethod") != null && !jsonObj.get("TokenAuthMethod").isJsonNull()) && !jsonObj.get("TokenAuthMethod").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TokenAuthMethod` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TokenAuthMethod").toString())); + } + if ((jsonObj.get("TokenUrl") != null && !jsonObj.get("TokenUrl").isJsonNull()) && !jsonObj.get("TokenUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TokenUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TokenUrl").toString())); + } + if ((jsonObj.get("UserInfoUrl") != null && !jsonObj.get("UserInfoUrl").isJsonNull()) && !jsonObj.get("UserInfoUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UserInfoUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UserInfoUrl").toString())); + } + if ((jsonObj.get("JWKSEndpoint") != null && !jsonObj.get("JWKSEndpoint").isJsonNull()) && !jsonObj.get("JWKSEndpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `JWKSEndpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("JWKSEndpoint").toString())); + } + if ((jsonObj.get("ConnectionType") != null && !jsonObj.get("ConnectionType").isJsonNull()) && !jsonObj.get("ConnectionType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ConnectionType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ConnectionType").toString())); + } + // validate the optional field `ConnectionType` + if (jsonObj.get("ConnectionType") != null && !jsonObj.get("ConnectionType").isJsonNull()) { + ConnectionTypeEnum.validateJsonElement(jsonObj.get("ConnectionType")); + } + if ((jsonObj.get("RedirectURI") != null && !jsonObj.get("RedirectURI").isJsonNull()) && !jsonObj.get("RedirectURI").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RedirectURI` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RedirectURI").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OidcConnectionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OidcConnectionResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OidcConnectionResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OidcConnectionResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<OidcConnectionResponse>() { + @Override + public void write(JsonWriter out, OidcConnectionResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OidcConnectionResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OidcConnectionResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OidcConnectionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of OidcConnectionResponse + * @throws IOException if the JSON string is invalid with respect to OidcConnectionResponse + */ + public static OidcConnectionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OidcConnectionResponse.class); + } + + /** + * Convert an instance of OidcConnectionResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OidcConnectionResponseCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OidcConnectionResponseCore.java new file mode 100644 index 0000000..723b05f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OidcConnectionResponseCore.java @@ -0,0 +1,370 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OidcConnectionResponseCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OidcConnectionResponseCore { + /** + * Type of the connection, which is OIDC in this case. + */ + @JsonAdapter(ConnectionTypeEnum.Adapter.class) + public enum ConnectionTypeEnum { + OIDC_CUSTOM("oidc_custom"); + + private String value; + + ConnectionTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ConnectionTypeEnum fromValue(String value) { + for (ConnectionTypeEnum b : ConnectionTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<ConnectionTypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final ConnectionTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ConnectionTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ConnectionTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ConnectionTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CONNECTION_TYPE = "ConnectionType"; + @SerializedName(SERIALIZED_NAME_CONNECTION_TYPE) + @javax.annotation.Nullable + private ConnectionTypeEnum connectionType; + + public static final String SERIALIZED_NAME_REDIRECT_U_R_I = "RedirectURI"; + @SerializedName(SERIALIZED_NAME_REDIRECT_U_R_I) + @javax.annotation.Nullable + private String redirectURI; + + public OidcConnectionResponseCore() { + } + + public OidcConnectionResponseCore( + String redirectURI + ) { + this(); + this.redirectURI = redirectURI; + } + + public OidcConnectionResponseCore connectionType(@javax.annotation.Nullable ConnectionTypeEnum connectionType) { + this.connectionType = connectionType; + return this; + } + + /** + * Type of the connection, which is OIDC in this case. + * @return connectionType + */ + @javax.annotation.Nullable + public ConnectionTypeEnum getConnectionType() { + return connectionType; + } + + public void setConnectionType(@javax.annotation.Nullable ConnectionTypeEnum connectionType) { + this.connectionType = connectionType; + } + + + /** + * The redirect URI for the OIDC connection, where the authorization server will send the User after authentication. + * @return redirectURI + */ + @javax.annotation.Nullable + public String getRedirectURI() { + return redirectURI; + } + + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OidcConnectionResponseCore instance itself + */ + public OidcConnectionResponseCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OidcConnectionResponseCore oidcConnectionResponseCore = (OidcConnectionResponseCore) o; + return Objects.equals(this.connectionType, oidcConnectionResponseCore.connectionType) && + Objects.equals(this.redirectURI, oidcConnectionResponseCore.redirectURI)&& + Objects.equals(this.additionalProperties, oidcConnectionResponseCore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(connectionType, redirectURI, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OidcConnectionResponseCore {\n"); + sb.append(" connectionType: ").append(toIndentedString(connectionType)).append("\n"); + sb.append(" redirectURI: ").append(toIndentedString(redirectURI)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ConnectionType"); + openapiFields.add("RedirectURI"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OidcConnectionResponseCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OidcConnectionResponseCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OidcConnectionResponseCore is not found in the empty JSON string", OidcConnectionResponseCore.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ConnectionType") != null && !jsonObj.get("ConnectionType").isJsonNull()) && !jsonObj.get("ConnectionType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ConnectionType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ConnectionType").toString())); + } + // validate the optional field `ConnectionType` + if (jsonObj.get("ConnectionType") != null && !jsonObj.get("ConnectionType").isJsonNull()) { + ConnectionTypeEnum.validateJsonElement(jsonObj.get("ConnectionType")); + } + if ((jsonObj.get("RedirectURI") != null && !jsonObj.get("RedirectURI").isJsonNull()) && !jsonObj.get("RedirectURI").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RedirectURI` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RedirectURI").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OidcConnectionResponseCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OidcConnectionResponseCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OidcConnectionResponseCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OidcConnectionResponseCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<OidcConnectionResponseCore>() { + @Override + public void write(JsonWriter out, OidcConnectionResponseCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OidcConnectionResponseCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OidcConnectionResponseCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OidcConnectionResponseCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of OidcConnectionResponseCore + * @throws IOException if the JSON string is invalid with respect to OidcConnectionResponseCore + */ + public static OidcConnectionResponseCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OidcConnectionResponseCore.class); + } + + /** + * Convert an instance of OidcConnectionResponseCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OneTouchLoginByEmail.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OneTouchLoginByEmail.java new file mode 100644 index 0000000..86a41b7 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OneTouchLoginByEmail.java @@ -0,0 +1,476 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OneTouchLoginByEmail + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OneTouchLoginByEmail { + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nonnull + private String email; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_CLIENT_GUID = "ClientGuid"; + @SerializedName(SERIALIZED_NAME_CLIENT_GUID) + @javax.annotation.Nonnull + private String clientGuid; + + public static final String SERIALIZED_NAME_GOOGLE_RECAPTCHA_RESPONSE = "GoogleRecaptchaResponse"; + @SerializedName(SERIALIZED_NAME_GOOGLE_RECAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String googleRecaptchaResponse; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_TICKET = "QQCaptchaTicket"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_TICKET) + @javax.annotation.Nullable + private String qqCaptchaTicket; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_RANDOM_STRING = "QQCaptchaRandomString"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_RANDOM_STRING) + @javax.annotation.Nullable + private String qqCaptchaRandomString; + + public static final String SERIALIZED_NAME_HCAPTCHA_RESPONSE = "HCaptchaResponse"; + @SerializedName(SERIALIZED_NAME_HCAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String hcaptchaResponse; + + public OneTouchLoginByEmail() { + } + + public OneTouchLoginByEmail email(@javax.annotation.Nonnull String email) { + this.email = email; + return this; + } + + /** + * The Email address for the one-touch login. + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nonnull String email) { + this.email = email; + } + + + public OneTouchLoginByEmail name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the User. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public OneTouchLoginByEmail clientGuid(@javax.annotation.Nonnull String clientGuid) { + this.clientGuid = clientGuid; + return this; + } + + /** + * The client GUID for the one-touch login process. + * @return clientGuid + */ + @javax.annotation.Nonnull + public String getClientGuid() { + return clientGuid; + } + + public void setClientGuid(@javax.annotation.Nonnull String clientGuid) { + this.clientGuid = clientGuid; + } + + + public OneTouchLoginByEmail googleRecaptchaResponse(@javax.annotation.Nullable String googleRecaptchaResponse) { + this.googleRecaptchaResponse = googleRecaptchaResponse; + return this; + } + + /** + * Google reCAPTCHA response. + * @return googleRecaptchaResponse + */ + @javax.annotation.Nullable + public String getGoogleRecaptchaResponse() { + return googleRecaptchaResponse; + } + + public void setGoogleRecaptchaResponse(@javax.annotation.Nullable String googleRecaptchaResponse) { + this.googleRecaptchaResponse = googleRecaptchaResponse; + } + + + public OneTouchLoginByEmail qqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + return this; + } + + /** + * QQ Captcha ticket. + * @return qqCaptchaTicket + */ + @javax.annotation.Nullable + public String getQqCaptchaTicket() { + return qqCaptchaTicket; + } + + public void setQqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + } + + + public OneTouchLoginByEmail qqCaptchaRandomString(@javax.annotation.Nullable String qqCaptchaRandomString) { + this.qqCaptchaRandomString = qqCaptchaRandomString; + return this; + } + + /** + * QQ Captcha random string. + * @return qqCaptchaRandomString + */ + @javax.annotation.Nullable + public String getQqCaptchaRandomString() { + return qqCaptchaRandomString; + } + + public void setQqCaptchaRandomString(@javax.annotation.Nullable String qqCaptchaRandomString) { + this.qqCaptchaRandomString = qqCaptchaRandomString; + } + + + public OneTouchLoginByEmail hcaptchaResponse(@javax.annotation.Nullable String hcaptchaResponse) { + this.hcaptchaResponse = hcaptchaResponse; + return this; + } + + /** + * hCaptcha response. + * @return hcaptchaResponse + */ + @javax.annotation.Nullable + public String getHcaptchaResponse() { + return hcaptchaResponse; + } + + public void setHcaptchaResponse(@javax.annotation.Nullable String hcaptchaResponse) { + this.hcaptchaResponse = hcaptchaResponse; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OneTouchLoginByEmail instance itself + */ + public OneTouchLoginByEmail putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OneTouchLoginByEmail oneTouchLoginByEmail = (OneTouchLoginByEmail) o; + return Objects.equals(this.email, oneTouchLoginByEmail.email) && + Objects.equals(this.name, oneTouchLoginByEmail.name) && + Objects.equals(this.clientGuid, oneTouchLoginByEmail.clientGuid) && + Objects.equals(this.googleRecaptchaResponse, oneTouchLoginByEmail.googleRecaptchaResponse) && + Objects.equals(this.qqCaptchaTicket, oneTouchLoginByEmail.qqCaptchaTicket) && + Objects.equals(this.qqCaptchaRandomString, oneTouchLoginByEmail.qqCaptchaRandomString) && + Objects.equals(this.hcaptchaResponse, oneTouchLoginByEmail.hcaptchaResponse)&& + Objects.equals(this.additionalProperties, oneTouchLoginByEmail.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, name, clientGuid, googleRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandomString, hcaptchaResponse, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OneTouchLoginByEmail {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" clientGuid: ").append(toIndentedString(clientGuid)).append("\n"); + sb.append(" googleRecaptchaResponse: ").append(toIndentedString(googleRecaptchaResponse)).append("\n"); + sb.append(" qqCaptchaTicket: ").append(toIndentedString(qqCaptchaTicket)).append("\n"); + sb.append(" qqCaptchaRandomString: ").append(toIndentedString(qqCaptchaRandomString)).append("\n"); + sb.append(" hcaptchaResponse: ").append(toIndentedString(hcaptchaResponse)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Email"); + openapiFields.add("Name"); + openapiFields.add("ClientGuid"); + openapiFields.add("GoogleRecaptchaResponse"); + openapiFields.add("QQCaptchaTicket"); + openapiFields.add("QQCaptchaRandomString"); + openapiFields.add("HCaptchaResponse"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Email"); + openapiRequiredFields.add("ClientGuid"); + } + + /** + * 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 OneTouchLoginByEmail + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OneTouchLoginByEmail.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OneTouchLoginByEmail is not found in the empty JSON string", OneTouchLoginByEmail.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OneTouchLoginByEmail.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("Email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Email").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("ClientGuid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ClientGuid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ClientGuid").toString())); + } + if ((jsonObj.get("GoogleRecaptchaResponse") != null && !jsonObj.get("GoogleRecaptchaResponse").isJsonNull()) && !jsonObj.get("GoogleRecaptchaResponse").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GoogleRecaptchaResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GoogleRecaptchaResponse").toString())); + } + if ((jsonObj.get("QQCaptchaTicket") != null && !jsonObj.get("QQCaptchaTicket").isJsonNull()) && !jsonObj.get("QQCaptchaTicket").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `QQCaptchaTicket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("QQCaptchaTicket").toString())); + } + if ((jsonObj.get("QQCaptchaRandomString") != null && !jsonObj.get("QQCaptchaRandomString").isJsonNull()) && !jsonObj.get("QQCaptchaRandomString").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `QQCaptchaRandomString` to be a primitive type in the JSON string but got `%s`", jsonObj.get("QQCaptchaRandomString").toString())); + } + if ((jsonObj.get("HCaptchaResponse") != null && !jsonObj.get("HCaptchaResponse").isJsonNull()) && !jsonObj.get("HCaptchaResponse").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HCaptchaResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HCaptchaResponse").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OneTouchLoginByEmail.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OneTouchLoginByEmail' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OneTouchLoginByEmail> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OneTouchLoginByEmail.class)); + + return (TypeAdapter<T>) new TypeAdapter<OneTouchLoginByEmail>() { + @Override + public void write(JsonWriter out, OneTouchLoginByEmail value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OneTouchLoginByEmail read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OneTouchLoginByEmail instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OneTouchLoginByEmail given an JSON string + * + * @param jsonString JSON string + * @return An instance of OneTouchLoginByEmail + * @throws IOException if the JSON string is invalid with respect to OneTouchLoginByEmail + */ + public static OneTouchLoginByEmail fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OneTouchLoginByEmail.class); + } + + /** + * Convert an instance of OneTouchLoginByEmail to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OneTouchLoginByPhone.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OneTouchLoginByPhone.java new file mode 100644 index 0000000..073478b --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OneTouchLoginByPhone.java @@ -0,0 +1,445 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OneTouchLoginByPhone + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OneTouchLoginByPhone { + public static final String SERIALIZED_NAME_PHONE = "Phone"; + @SerializedName(SERIALIZED_NAME_PHONE) + @javax.annotation.Nonnull + private String phone; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_GOOGLE_RECAPTCHA_RESPONSE = "GoogleRecaptchaResponse"; + @SerializedName(SERIALIZED_NAME_GOOGLE_RECAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String googleRecaptchaResponse; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_TICKET = "QQCaptchaTicket"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_TICKET) + @javax.annotation.Nullable + private String qqCaptchaTicket; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_RANDOM_STRING = "QQCaptchaRandomString"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_RANDOM_STRING) + @javax.annotation.Nullable + private String qqCaptchaRandomString; + + public static final String SERIALIZED_NAME_HCAPTCHA_RESPONSE = "HCaptchaResponse"; + @SerializedName(SERIALIZED_NAME_HCAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String hcaptchaResponse; + + public OneTouchLoginByPhone() { + } + + public OneTouchLoginByPhone phone(@javax.annotation.Nonnull String phone) { + this.phone = phone; + return this; + } + + /** + * The Phone number for the one-touch login. + * @return phone + */ + @javax.annotation.Nonnull + public String getPhone() { + return phone; + } + + public void setPhone(@javax.annotation.Nonnull String phone) { + this.phone = phone; + } + + + public OneTouchLoginByPhone name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the User. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public OneTouchLoginByPhone googleRecaptchaResponse(@javax.annotation.Nullable String googleRecaptchaResponse) { + this.googleRecaptchaResponse = googleRecaptchaResponse; + return this; + } + + /** + * Google reCAPTCHA response. + * @return googleRecaptchaResponse + */ + @javax.annotation.Nullable + public String getGoogleRecaptchaResponse() { + return googleRecaptchaResponse; + } + + public void setGoogleRecaptchaResponse(@javax.annotation.Nullable String googleRecaptchaResponse) { + this.googleRecaptchaResponse = googleRecaptchaResponse; + } + + + public OneTouchLoginByPhone qqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + return this; + } + + /** + * QQ Captcha ticket. + * @return qqCaptchaTicket + */ + @javax.annotation.Nullable + public String getQqCaptchaTicket() { + return qqCaptchaTicket; + } + + public void setQqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + } + + + public OneTouchLoginByPhone qqCaptchaRandomString(@javax.annotation.Nullable String qqCaptchaRandomString) { + this.qqCaptchaRandomString = qqCaptchaRandomString; + return this; + } + + /** + * QQ Captcha random string. + * @return qqCaptchaRandomString + */ + @javax.annotation.Nullable + public String getQqCaptchaRandomString() { + return qqCaptchaRandomString; + } + + public void setQqCaptchaRandomString(@javax.annotation.Nullable String qqCaptchaRandomString) { + this.qqCaptchaRandomString = qqCaptchaRandomString; + } + + + public OneTouchLoginByPhone hcaptchaResponse(@javax.annotation.Nullable String hcaptchaResponse) { + this.hcaptchaResponse = hcaptchaResponse; + return this; + } + + /** + * hCaptcha response. + * @return hcaptchaResponse + */ + @javax.annotation.Nullable + public String getHcaptchaResponse() { + return hcaptchaResponse; + } + + public void setHcaptchaResponse(@javax.annotation.Nullable String hcaptchaResponse) { + this.hcaptchaResponse = hcaptchaResponse; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OneTouchLoginByPhone instance itself + */ + public OneTouchLoginByPhone putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OneTouchLoginByPhone oneTouchLoginByPhone = (OneTouchLoginByPhone) o; + return Objects.equals(this.phone, oneTouchLoginByPhone.phone) && + Objects.equals(this.name, oneTouchLoginByPhone.name) && + Objects.equals(this.googleRecaptchaResponse, oneTouchLoginByPhone.googleRecaptchaResponse) && + Objects.equals(this.qqCaptchaTicket, oneTouchLoginByPhone.qqCaptchaTicket) && + Objects.equals(this.qqCaptchaRandomString, oneTouchLoginByPhone.qqCaptchaRandomString) && + Objects.equals(this.hcaptchaResponse, oneTouchLoginByPhone.hcaptchaResponse)&& + Objects.equals(this.additionalProperties, oneTouchLoginByPhone.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(phone, name, googleRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandomString, hcaptchaResponse, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OneTouchLoginByPhone {\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" googleRecaptchaResponse: ").append(toIndentedString(googleRecaptchaResponse)).append("\n"); + sb.append(" qqCaptchaTicket: ").append(toIndentedString(qqCaptchaTicket)).append("\n"); + sb.append(" qqCaptchaRandomString: ").append(toIndentedString(qqCaptchaRandomString)).append("\n"); + sb.append(" hcaptchaResponse: ").append(toIndentedString(hcaptchaResponse)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Phone"); + openapiFields.add("Name"); + openapiFields.add("GoogleRecaptchaResponse"); + openapiFields.add("QQCaptchaTicket"); + openapiFields.add("QQCaptchaRandomString"); + openapiFields.add("HCaptchaResponse"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Phone"); + } + + /** + * 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 OneTouchLoginByPhone + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OneTouchLoginByPhone.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OneTouchLoginByPhone is not found in the empty JSON string", OneTouchLoginByPhone.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OneTouchLoginByPhone.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("Phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Phone").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("GoogleRecaptchaResponse") != null && !jsonObj.get("GoogleRecaptchaResponse").isJsonNull()) && !jsonObj.get("GoogleRecaptchaResponse").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GoogleRecaptchaResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GoogleRecaptchaResponse").toString())); + } + if ((jsonObj.get("QQCaptchaTicket") != null && !jsonObj.get("QQCaptchaTicket").isJsonNull()) && !jsonObj.get("QQCaptchaTicket").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `QQCaptchaTicket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("QQCaptchaTicket").toString())); + } + if ((jsonObj.get("QQCaptchaRandomString") != null && !jsonObj.get("QQCaptchaRandomString").isJsonNull()) && !jsonObj.get("QQCaptchaRandomString").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `QQCaptchaRandomString` to be a primitive type in the JSON string but got `%s`", jsonObj.get("QQCaptchaRandomString").toString())); + } + if ((jsonObj.get("HCaptchaResponse") != null && !jsonObj.get("HCaptchaResponse").isJsonNull()) && !jsonObj.get("HCaptchaResponse").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HCaptchaResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HCaptchaResponse").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OneTouchLoginByPhone.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OneTouchLoginByPhone' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OneTouchLoginByPhone> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OneTouchLoginByPhone.class)); + + return (TypeAdapter<T>) new TypeAdapter<OneTouchLoginByPhone>() { + @Override + public void write(JsonWriter out, OneTouchLoginByPhone value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OneTouchLoginByPhone read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OneTouchLoginByPhone instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OneTouchLoginByPhone given an JSON string + * + * @param jsonString JSON string + * @return An instance of OneTouchLoginByPhone + * @throws IOException if the JSON string is invalid with respect to OneTouchLoginByPhone + */ + public static OneTouchLoginByPhone fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OneTouchLoginByPhone.class); + } + + /** + * Convert an instance of OneTouchLoginByPhone to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OneTouchLoginPhoneModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OneTouchLoginPhoneModel.java new file mode 100644 index 0000000..88c30fa --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OneTouchLoginPhoneModel.java @@ -0,0 +1,325 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OneTouchLoginPhoneModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OneTouchLoginPhoneModel { + public static final String SERIALIZED_NAME_PHONE = "phone"; + @SerializedName(SERIALIZED_NAME_PHONE) + @javax.annotation.Nonnull + private String phone; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public OneTouchLoginPhoneModel() { + } + + public OneTouchLoginPhoneModel phone(@javax.annotation.Nonnull String phone) { + this.phone = phone; + return this; + } + + /** + * The Phone number of the User. + * @return phone + */ + @javax.annotation.Nonnull + public String getPhone() { + return phone; + } + + public void setPhone(@javax.annotation.Nonnull String phone) { + this.phone = phone; + } + + + public OneTouchLoginPhoneModel name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the User. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OneTouchLoginPhoneModel instance itself + */ + public OneTouchLoginPhoneModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OneTouchLoginPhoneModel oneTouchLoginPhoneModel = (OneTouchLoginPhoneModel) o; + return Objects.equals(this.phone, oneTouchLoginPhoneModel.phone) && + Objects.equals(this.name, oneTouchLoginPhoneModel.name)&& + Objects.equals(this.additionalProperties, oneTouchLoginPhoneModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(phone, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OneTouchLoginPhoneModel {\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("phone"); + openapiFields.add("name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("phone"); + } + + /** + * 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 OneTouchLoginPhoneModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OneTouchLoginPhoneModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OneTouchLoginPhoneModel is not found in the empty JSON string", OneTouchLoginPhoneModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : OneTouchLoginPhoneModel.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("phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phone").toString())); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OneTouchLoginPhoneModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OneTouchLoginPhoneModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OneTouchLoginPhoneModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OneTouchLoginPhoneModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<OneTouchLoginPhoneModel>() { + @Override + public void write(JsonWriter out, OneTouchLoginPhoneModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OneTouchLoginPhoneModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OneTouchLoginPhoneModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OneTouchLoginPhoneModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of OneTouchLoginPhoneModel + * @throws IOException if the JSON string is invalid with respect to OneTouchLoginPhoneModel + */ + public static OneTouchLoginPhoneModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OneTouchLoginPhoneModel.class); + } + + /** + * Convert an instance of OneTouchLoginPhoneModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationBase.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationBase.java new file mode 100644 index 0000000..7de8b34 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationBase.java @@ -0,0 +1,420 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.OrganizationBaseDisplay; +import com.loginradius.sdk.internal.openapi.model.OrganizationDomainRequest; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * OrganizationBase + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OrganizationBase { + public static final String SERIALIZED_NAME_DISPLAY = "Display"; + @SerializedName(SERIALIZED_NAME_DISPLAY) + @javax.annotation.Nullable + private OrganizationBaseDisplay display; + + public static final String SERIALIZED_NAME_DOMAINS = "Domains"; + @SerializedName(SERIALIZED_NAME_DOMAINS) + @javax.annotation.Nullable + private List<OrganizationDomainRequest> domains = new ArrayList<>(); + + public static final String SERIALIZED_NAME_METADATA = "Metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + @javax.annotation.Nullable + private Map<String, String> metadata = new HashMap<>(); + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public OrganizationBase() { + } + + public OrganizationBase display(@javax.annotation.Nullable OrganizationBaseDisplay display) { + this.display = display; + return this; + } + + /** + * Get display + * @return display + */ + @javax.annotation.Nullable + public OrganizationBaseDisplay getDisplay() { + return display; + } + + public void setDisplay(@javax.annotation.Nullable OrganizationBaseDisplay display) { + this.display = display; + } + + + public OrganizationBase domains(@javax.annotation.Nullable List<OrganizationDomainRequest> domains) { + this.domains = domains; + return this; + } + + public OrganizationBase addDomainsItem(OrganizationDomainRequest domainsItem) { + if (this.domains == null) { + this.domains = new ArrayList<>(); + } + this.domains.add(domainsItem); + return this; + } + + /** + * Get domains + * @return domains + */ + @javax.annotation.Nullable + public List<OrganizationDomainRequest> getDomains() { + return domains; + } + + public void setDomains(@javax.annotation.Nullable List<OrganizationDomainRequest> domains) { + this.domains = domains; + } + + + public OrganizationBase metadata(@javax.annotation.Nullable Map<String, String> metadata) { + this.metadata = metadata; + return this; + } + + public OrganizationBase putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Additional metadata for the organization + * @return metadata + */ + @javax.annotation.Nullable + public Map<String, String> getMetadata() { + return metadata; + } + + public void setMetadata(@javax.annotation.Nullable Map<String, String> metadata) { + this.metadata = metadata; + } + + + public OrganizationBase name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Name of the organization + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OrganizationBase instance itself + */ + public OrganizationBase putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationBase organizationBase = (OrganizationBase) o; + return Objects.equals(this.display, organizationBase.display) && + Objects.equals(this.domains, organizationBase.domains) && + Objects.equals(this.metadata, organizationBase.metadata) && + Objects.equals(this.name, organizationBase.name)&& + Objects.equals(this.additionalProperties, organizationBase.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(display, domains, metadata, name, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrganizationBase {\n"); + sb.append(" display: ").append(toIndentedString(display)).append("\n"); + sb.append(" domains: ").append(toIndentedString(domains)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Display"); + openapiFields.add("Domains"); + openapiFields.add("Metadata"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OrganizationBase + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrganizationBase.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationBase is not found in the empty JSON string", OrganizationBase.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `Display` + if (jsonObj.get("Display") != null && !jsonObj.get("Display").isJsonNull()) { + OrganizationBaseDisplay.validateJsonElement(jsonObj.get("Display")); + } + if (jsonObj.get("Domains") != null && !jsonObj.get("Domains").isJsonNull()) { + JsonArray jsonArraydomains = jsonObj.getAsJsonArray("Domains"); + if (jsonArraydomains != null) { + // ensure the json data is an array + if (!jsonObj.get("Domains").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Domains` to be an array in the JSON string but got `%s`", jsonObj.get("Domains").toString())); + } + + // validate the optional field `Domains` (array) + for (int i = 0; i < jsonArraydomains.size(); i++) { + OrganizationDomainRequest.validateJsonElement(jsonArraydomains.get(i)); + }; + } + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OrganizationBase.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrganizationBase' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OrganizationBase> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OrganizationBase.class)); + + return (TypeAdapter<T>) new TypeAdapter<OrganizationBase>() { + @Override + public void write(JsonWriter out, OrganizationBase value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OrganizationBase read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OrganizationBase instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OrganizationBase given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganizationBase + * @throws IOException if the JSON string is invalid with respect to OrganizationBase + */ + public static OrganizationBase fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrganizationBase.class); + } + + /** + * Convert an instance of OrganizationBase to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationBaseDisplay.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationBaseDisplay.java new file mode 100644 index 0000000..aab5db1 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationBaseDisplay.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OrganizationBaseDisplay + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OrganizationBaseDisplay { + public static final String SERIALIZED_NAME_LOGO_U_R_L = "LogoURL"; + @SerializedName(SERIALIZED_NAME_LOGO_U_R_L) + @javax.annotation.Nullable + private String logoURL; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public OrganizationBaseDisplay() { + } + + public OrganizationBaseDisplay logoURL(@javax.annotation.Nullable String logoURL) { + this.logoURL = logoURL; + return this; + } + + /** + * URL to the organization's logo + * @return logoURL + */ + @javax.annotation.Nullable + public String getLogoURL() { + return logoURL; + } + + public void setLogoURL(@javax.annotation.Nullable String logoURL) { + this.logoURL = logoURL; + } + + + public OrganizationBaseDisplay name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Display name of the organization + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OrganizationBaseDisplay instance itself + */ + public OrganizationBaseDisplay putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationBaseDisplay organizationBaseDisplay = (OrganizationBaseDisplay) o; + return Objects.equals(this.logoURL, organizationBaseDisplay.logoURL) && + Objects.equals(this.name, organizationBaseDisplay.name)&& + Objects.equals(this.additionalProperties, organizationBaseDisplay.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(logoURL, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrganizationBaseDisplay {\n"); + sb.append(" logoURL: ").append(toIndentedString(logoURL)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("LogoURL"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OrganizationBaseDisplay + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrganizationBaseDisplay.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationBaseDisplay is not found in the empty JSON string", OrganizationBaseDisplay.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("LogoURL") != null && !jsonObj.get("LogoURL").isJsonNull()) && !jsonObj.get("LogoURL").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LogoURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LogoURL").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OrganizationBaseDisplay.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrganizationBaseDisplay' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OrganizationBaseDisplay> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OrganizationBaseDisplay.class)); + + return (TypeAdapter<T>) new TypeAdapter<OrganizationBaseDisplay>() { + @Override + public void write(JsonWriter out, OrganizationBaseDisplay value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OrganizationBaseDisplay read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OrganizationBaseDisplay instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OrganizationBaseDisplay given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganizationBaseDisplay + * @throws IOException if the JSON string is invalid with respect to OrganizationBaseDisplay + */ + public static OrganizationBaseDisplay fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrganizationBaseDisplay.class); + } + + /** + * Convert an instance of OrganizationBaseDisplay to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationConnectionCreateRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationConnectionCreateRequest.java new file mode 100644 index 0000000..7d635d6 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationConnectionCreateRequest.java @@ -0,0 +1,279 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.OIDCConnectionCreateRequest; +import com.loginradius.sdk.internal.openapi.model.OrganizationsConnectionBaseAttributes; +import com.loginradius.sdk.internal.openapi.model.SAMLConnectionCreateRequest; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OrganizationConnectionCreateRequest extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(OrganizationConnectionCreateRequest.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OrganizationConnectionCreateRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrganizationConnectionCreateRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SAMLConnectionCreateRequest> adapterSAMLConnectionCreateRequest = gson.getDelegateAdapter(this, TypeToken.get(SAMLConnectionCreateRequest.class)); + final TypeAdapter<OIDCConnectionCreateRequest> adapterOIDCConnectionCreateRequest = gson.getDelegateAdapter(this, TypeToken.get(OIDCConnectionCreateRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<OrganizationConnectionCreateRequest>() { + @Override + public void write(JsonWriter out, OrganizationConnectionCreateRequest value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `SAMLConnectionCreateRequest` + if (value.getActualInstance() instanceof SAMLConnectionCreateRequest) { + JsonElement element = adapterSAMLConnectionCreateRequest.toJsonTree((SAMLConnectionCreateRequest)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `OIDCConnectionCreateRequest` + if (value.getActualInstance() instanceof OIDCConnectionCreateRequest) { + JsonElement element = adapterOIDCConnectionCreateRequest.toJsonTree((OIDCConnectionCreateRequest)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: OIDCConnectionCreateRequest, SAMLConnectionCreateRequest"); + } + + @Override + public OrganizationConnectionCreateRequest read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize SAMLConnectionCreateRequest + try { + // validate the JSON object to see if any exception is thrown + SAMLConnectionCreateRequest.validateJsonElement(jsonElement); + actualAdapter = adapterSAMLConnectionCreateRequest; + match++; + log.log(Level.FINER, "Input data matches schema 'SAMLConnectionCreateRequest'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for SAMLConnectionCreateRequest failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'SAMLConnectionCreateRequest'", e); + } + // deserialize OIDCConnectionCreateRequest + try { + // validate the JSON object to see if any exception is thrown + OIDCConnectionCreateRequest.validateJsonElement(jsonElement); + actualAdapter = adapterOIDCConnectionCreateRequest; + match++; + log.log(Level.FINER, "Input data matches schema 'OIDCConnectionCreateRequest'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for OIDCConnectionCreateRequest failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'OIDCConnectionCreateRequest'", e); + } + + if (match == 1) { + OrganizationConnectionCreateRequest ret = new OrganizationConnectionCreateRequest(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for OrganizationConnectionCreateRequest: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public OrganizationConnectionCreateRequest() { + super("oneOf", Boolean.FALSE); + } + + public OrganizationConnectionCreateRequest(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("SAMLConnectionCreateRequest", SAMLConnectionCreateRequest.class); + schemas.put("OIDCConnectionCreateRequest", OIDCConnectionCreateRequest.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return OrganizationConnectionCreateRequest.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * OIDCConnectionCreateRequest, SAMLConnectionCreateRequest + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof SAMLConnectionCreateRequest) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof OIDCConnectionCreateRequest) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be OIDCConnectionCreateRequest, SAMLConnectionCreateRequest"); + } + + /** + * Get the actual instance, which can be the following: + * OIDCConnectionCreateRequest, SAMLConnectionCreateRequest + * + * @return The actual instance (OIDCConnectionCreateRequest, SAMLConnectionCreateRequest) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `SAMLConnectionCreateRequest`. If the actual instance is not `SAMLConnectionCreateRequest`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `SAMLConnectionCreateRequest` + * @throws ClassCastException if the instance is not `SAMLConnectionCreateRequest` + */ + public SAMLConnectionCreateRequest getSAMLConnectionCreateRequest() throws ClassCastException { + return (SAMLConnectionCreateRequest)super.getActualInstance(); + } + + /** + * Get the actual instance of `OIDCConnectionCreateRequest`. If the actual instance is not `OIDCConnectionCreateRequest`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `OIDCConnectionCreateRequest` + * @throws ClassCastException if the instance is not `OIDCConnectionCreateRequest` + */ + public OIDCConnectionCreateRequest getOIDCConnectionCreateRequest() throws ClassCastException { + return (OIDCConnectionCreateRequest)super.getActualInstance(); + } + + /** + * 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 OrganizationConnectionCreateRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with SAMLConnectionCreateRequest + try { + SAMLConnectionCreateRequest.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for SAMLConnectionCreateRequest failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with OIDCConnectionCreateRequest + try { + OIDCConnectionCreateRequest.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for OIDCConnectionCreateRequest failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for OrganizationConnectionCreateRequest with oneOf schemas: OIDCConnectionCreateRequest, SAMLConnectionCreateRequest. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of OrganizationConnectionCreateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganizationConnectionCreateRequest + * @throws IOException if the JSON string is invalid with respect to OrganizationConnectionCreateRequest + */ + public static OrganizationConnectionCreateRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrganizationConnectionCreateRequest.class); + } + + /** + * Convert an instance of OrganizationConnectionCreateRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationConnectionRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationConnectionRequest.java new file mode 100644 index 0000000..fff899e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationConnectionRequest.java @@ -0,0 +1,279 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.OidcConnectionRequest; +import com.loginradius.sdk.internal.openapi.model.OrganizationsConnectionBaseAttributes; +import com.loginradius.sdk.internal.openapi.model.SamlConnectionRequest; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OrganizationConnectionRequest extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(OrganizationConnectionRequest.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OrganizationConnectionRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrganizationConnectionRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SamlConnectionRequest> adapterSamlConnectionRequest = gson.getDelegateAdapter(this, TypeToken.get(SamlConnectionRequest.class)); + final TypeAdapter<OidcConnectionRequest> adapterOidcConnectionRequest = gson.getDelegateAdapter(this, TypeToken.get(OidcConnectionRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<OrganizationConnectionRequest>() { + @Override + public void write(JsonWriter out, OrganizationConnectionRequest value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `SamlConnectionRequest` + if (value.getActualInstance() instanceof SamlConnectionRequest) { + JsonElement element = adapterSamlConnectionRequest.toJsonTree((SamlConnectionRequest)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `OidcConnectionRequest` + if (value.getActualInstance() instanceof OidcConnectionRequest) { + JsonElement element = adapterOidcConnectionRequest.toJsonTree((OidcConnectionRequest)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: OidcConnectionRequest, SamlConnectionRequest"); + } + + @Override + public OrganizationConnectionRequest read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize SamlConnectionRequest + try { + // validate the JSON object to see if any exception is thrown + SamlConnectionRequest.validateJsonElement(jsonElement); + actualAdapter = adapterSamlConnectionRequest; + match++; + log.log(Level.FINER, "Input data matches schema 'SamlConnectionRequest'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for SamlConnectionRequest failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'SamlConnectionRequest'", e); + } + // deserialize OidcConnectionRequest + try { + // validate the JSON object to see if any exception is thrown + OidcConnectionRequest.validateJsonElement(jsonElement); + actualAdapter = adapterOidcConnectionRequest; + match++; + log.log(Level.FINER, "Input data matches schema 'OidcConnectionRequest'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for OidcConnectionRequest failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'OidcConnectionRequest'", e); + } + + if (match == 1) { + OrganizationConnectionRequest ret = new OrganizationConnectionRequest(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for OrganizationConnectionRequest: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public OrganizationConnectionRequest() { + super("oneOf", Boolean.FALSE); + } + + public OrganizationConnectionRequest(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("SamlConnectionRequest", SamlConnectionRequest.class); + schemas.put("OidcConnectionRequest", OidcConnectionRequest.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return OrganizationConnectionRequest.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * OidcConnectionRequest, SamlConnectionRequest + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof SamlConnectionRequest) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof OidcConnectionRequest) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be OidcConnectionRequest, SamlConnectionRequest"); + } + + /** + * Get the actual instance, which can be the following: + * OidcConnectionRequest, SamlConnectionRequest + * + * @return The actual instance (OidcConnectionRequest, SamlConnectionRequest) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `SamlConnectionRequest`. If the actual instance is not `SamlConnectionRequest`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `SamlConnectionRequest` + * @throws ClassCastException if the instance is not `SamlConnectionRequest` + */ + public SamlConnectionRequest getSamlConnectionRequest() throws ClassCastException { + return (SamlConnectionRequest)super.getActualInstance(); + } + + /** + * Get the actual instance of `OidcConnectionRequest`. If the actual instance is not `OidcConnectionRequest`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `OidcConnectionRequest` + * @throws ClassCastException if the instance is not `OidcConnectionRequest` + */ + public OidcConnectionRequest getOidcConnectionRequest() throws ClassCastException { + return (OidcConnectionRequest)super.getActualInstance(); + } + + /** + * 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 OrganizationConnectionRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with SamlConnectionRequest + try { + SamlConnectionRequest.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for SamlConnectionRequest failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with OidcConnectionRequest + try { + OidcConnectionRequest.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for OidcConnectionRequest failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for OrganizationConnectionRequest with oneOf schemas: OidcConnectionRequest, SamlConnectionRequest. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of OrganizationConnectionRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganizationConnectionRequest + * @throws IOException if the JSON string is invalid with respect to OrganizationConnectionRequest + */ + public static OrganizationConnectionRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrganizationConnectionRequest.class); + } + + /** + * Convert an instance of OrganizationConnectionRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationDomainRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationDomainRequest.java new file mode 100644 index 0000000..2257456 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationDomainRequest.java @@ -0,0 +1,314 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OrganizationDomainRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OrganizationDomainRequest { + public static final String SERIALIZED_NAME_DOMAIN_NAME = "DomainName"; + @SerializedName(SERIALIZED_NAME_DOMAIN_NAME) + @javax.annotation.Nullable + private String domainName; + + public static final String SERIALIZED_NAME_IS_VERIFIED = "IsVerified"; + @SerializedName(SERIALIZED_NAME_IS_VERIFIED) + @javax.annotation.Nullable + private Boolean isVerified; + + public OrganizationDomainRequest() { + } + + public OrganizationDomainRequest domainName(@javax.annotation.Nullable String domainName) { + this.domainName = domainName; + return this; + } + + /** + * The domain name to be verified + * @return domainName + */ + @javax.annotation.Nullable + public String getDomainName() { + return domainName; + } + + public void setDomainName(@javax.annotation.Nullable String domainName) { + this.domainName = domainName; + } + + + public OrganizationDomainRequest isVerified(@javax.annotation.Nullable Boolean isVerified) { + this.isVerified = isVerified; + return this; + } + + /** + * Indicates whether the domain has been verified + * @return isVerified + */ + @javax.annotation.Nullable + public Boolean getIsVerified() { + return isVerified; + } + + public void setIsVerified(@javax.annotation.Nullable Boolean isVerified) { + this.isVerified = isVerified; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OrganizationDomainRequest instance itself + */ + public OrganizationDomainRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationDomainRequest organizationDomainRequest = (OrganizationDomainRequest) o; + return Objects.equals(this.domainName, organizationDomainRequest.domainName) && + Objects.equals(this.isVerified, organizationDomainRequest.isVerified)&& + Objects.equals(this.additionalProperties, organizationDomainRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(domainName, isVerified, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrganizationDomainRequest {\n"); + sb.append(" domainName: ").append(toIndentedString(domainName)).append("\n"); + sb.append(" isVerified: ").append(toIndentedString(isVerified)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("DomainName"); + openapiFields.add("IsVerified"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OrganizationDomainRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrganizationDomainRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationDomainRequest is not found in the empty JSON string", OrganizationDomainRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("DomainName") != null && !jsonObj.get("DomainName").isJsonNull()) && !jsonObj.get("DomainName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DomainName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DomainName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OrganizationDomainRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrganizationDomainRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OrganizationDomainRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OrganizationDomainRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<OrganizationDomainRequest>() { + @Override + public void write(JsonWriter out, OrganizationDomainRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OrganizationDomainRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OrganizationDomainRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OrganizationDomainRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganizationDomainRequest + * @throws IOException if the JSON string is invalid with respect to OrganizationDomainRequest + */ + public static OrganizationDomainRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrganizationDomainRequest.class); + } + + /** + * Convert an instance of OrganizationDomainRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationUpdateRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationUpdateRequest.java new file mode 100644 index 0000000..e305562 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationUpdateRequest.java @@ -0,0 +1,506 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.OrganizationBaseDisplay; +import com.loginradius.sdk.internal.openapi.model.OrganizationDomainRequest; +import com.loginradius.sdk.internal.openapi.model.OrganizationsPolicyBase; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * OrganizationUpdateRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OrganizationUpdateRequest { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_DISPLAY = "Display"; + @SerializedName(SERIALIZED_NAME_DISPLAY) + @javax.annotation.Nullable + private OrganizationBaseDisplay display; + + public static final String SERIALIZED_NAME_METADATA = "Metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + @javax.annotation.Nullable + private Map<String, String> metadata = new HashMap<>(); + + public static final String SERIALIZED_NAME_DOMAINS = "Domains"; + @SerializedName(SERIALIZED_NAME_DOMAINS) + @javax.annotation.Nullable + private List<OrganizationDomainRequest> domains = new ArrayList<>(); + + public static final String SERIALIZED_NAME_IS_AUTH_RESTRICTED_TO_DOMAIN = "IsAuthRestrictedToDomain"; + @SerializedName(SERIALIZED_NAME_IS_AUTH_RESTRICTED_TO_DOMAIN) + @javax.annotation.Nullable + private Boolean isAuthRestrictedToDomain; + + public static final String SERIALIZED_NAME_POLICIES = "Policies"; + @SerializedName(SERIALIZED_NAME_POLICIES) + @javax.annotation.Nullable + private OrganizationsPolicyBase policies; + + public static final String SERIALIZED_NAME_IS_ACTIVE = "IsActive"; + @SerializedName(SERIALIZED_NAME_IS_ACTIVE) + @javax.annotation.Nullable + private Boolean isActive; + + public OrganizationUpdateRequest() { + } + + public OrganizationUpdateRequest name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Name of the organization + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public OrganizationUpdateRequest display(@javax.annotation.Nullable OrganizationBaseDisplay display) { + this.display = display; + return this; + } + + /** + * Get display + * @return display + */ + @javax.annotation.Nullable + public OrganizationBaseDisplay getDisplay() { + return display; + } + + public void setDisplay(@javax.annotation.Nullable OrganizationBaseDisplay display) { + this.display = display; + } + + + public OrganizationUpdateRequest metadata(@javax.annotation.Nullable Map<String, String> metadata) { + this.metadata = metadata; + return this; + } + + public OrganizationUpdateRequest putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Additional metadata for the organization + * @return metadata + */ + @javax.annotation.Nullable + public Map<String, String> getMetadata() { + return metadata; + } + + public void setMetadata(@javax.annotation.Nullable Map<String, String> metadata) { + this.metadata = metadata; + } + + + public OrganizationUpdateRequest domains(@javax.annotation.Nullable List<OrganizationDomainRequest> domains) { + this.domains = domains; + return this; + } + + public OrganizationUpdateRequest addDomainsItem(OrganizationDomainRequest domainsItem) { + if (this.domains == null) { + this.domains = new ArrayList<>(); + } + this.domains.add(domainsItem); + return this; + } + + /** + * Get domains + * @return domains + */ + @javax.annotation.Nullable + public List<OrganizationDomainRequest> getDomains() { + return domains; + } + + public void setDomains(@javax.annotation.Nullable List<OrganizationDomainRequest> domains) { + this.domains = domains; + } + + + public OrganizationUpdateRequest isAuthRestrictedToDomain(@javax.annotation.Nullable Boolean isAuthRestrictedToDomain) { + this.isAuthRestrictedToDomain = isAuthRestrictedToDomain; + return this; + } + + /** + * Restricts authentication to registered domains only + * @return isAuthRestrictedToDomain + */ + @javax.annotation.Nullable + public Boolean getIsAuthRestrictedToDomain() { + return isAuthRestrictedToDomain; + } + + public void setIsAuthRestrictedToDomain(@javax.annotation.Nullable Boolean isAuthRestrictedToDomain) { + this.isAuthRestrictedToDomain = isAuthRestrictedToDomain; + } + + + public OrganizationUpdateRequest policies(@javax.annotation.Nullable OrganizationsPolicyBase policies) { + this.policies = policies; + return this; + } + + /** + * Get policies + * @return policies + */ + @javax.annotation.Nullable + public OrganizationsPolicyBase getPolicies() { + return policies; + } + + public void setPolicies(@javax.annotation.Nullable OrganizationsPolicyBase policies) { + this.policies = policies; + } + + + public OrganizationUpdateRequest isActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Indicates whether the organization is active or not + * @return isActive + */ + @javax.annotation.Nullable + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OrganizationUpdateRequest instance itself + */ + public OrganizationUpdateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationUpdateRequest organizationUpdateRequest = (OrganizationUpdateRequest) o; + return Objects.equals(this.name, organizationUpdateRequest.name) && + Objects.equals(this.display, organizationUpdateRequest.display) && + Objects.equals(this.metadata, organizationUpdateRequest.metadata) && + Objects.equals(this.domains, organizationUpdateRequest.domains) && + Objects.equals(this.isAuthRestrictedToDomain, organizationUpdateRequest.isAuthRestrictedToDomain) && + Objects.equals(this.policies, organizationUpdateRequest.policies) && + Objects.equals(this.isActive, organizationUpdateRequest.isActive)&& + Objects.equals(this.additionalProperties, organizationUpdateRequest.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(name, display, metadata, domains, isAuthRestrictedToDomain, policies, isActive, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrganizationUpdateRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" display: ").append(toIndentedString(display)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" domains: ").append(toIndentedString(domains)).append("\n"); + sb.append(" isAuthRestrictedToDomain: ").append(toIndentedString(isAuthRestrictedToDomain)).append("\n"); + sb.append(" policies: ").append(toIndentedString(policies)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + openapiFields.add("Display"); + openapiFields.add("Metadata"); + openapiFields.add("Domains"); + openapiFields.add("IsAuthRestrictedToDomain"); + openapiFields.add("Policies"); + openapiFields.add("IsActive"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OrganizationUpdateRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrganizationUpdateRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationUpdateRequest is not found in the empty JSON string", OrganizationUpdateRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + // validate the optional field `Display` + if (jsonObj.get("Display") != null && !jsonObj.get("Display").isJsonNull()) { + OrganizationBaseDisplay.validateJsonElement(jsonObj.get("Display")); + } + if (jsonObj.get("Domains") != null && !jsonObj.get("Domains").isJsonNull()) { + JsonArray jsonArraydomains = jsonObj.getAsJsonArray("Domains"); + if (jsonArraydomains != null) { + // ensure the json data is an array + if (!jsonObj.get("Domains").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Domains` to be an array in the JSON string but got `%s`", jsonObj.get("Domains").toString())); + } + + // validate the optional field `Domains` (array) + for (int i = 0; i < jsonArraydomains.size(); i++) { + OrganizationDomainRequest.validateJsonElement(jsonArraydomains.get(i)); + }; + } + } + // validate the optional field `Policies` + if (jsonObj.get("Policies") != null && !jsonObj.get("Policies").isJsonNull()) { + OrganizationsPolicyBase.validateJsonElement(jsonObj.get("Policies")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OrganizationUpdateRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrganizationUpdateRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OrganizationUpdateRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OrganizationUpdateRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<OrganizationUpdateRequest>() { + @Override + public void write(JsonWriter out, OrganizationUpdateRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OrganizationUpdateRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OrganizationUpdateRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OrganizationUpdateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganizationUpdateRequest + * @throws IOException if the JSON string is invalid with respect to OrganizationUpdateRequest + */ + public static OrganizationUpdateRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrganizationUpdateRequest.class); + } + + /** + * Convert an instance of OrganizationUpdateRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsConnectionBase.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsConnectionBase.java new file mode 100644 index 0000000..5b128e1 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsConnectionBase.java @@ -0,0 +1,349 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.OrganizationsConnectionBaseAttributes; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * OrganizationsConnectionBase + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OrganizationsConnectionBase { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_DOMAIN = "Domain"; + @SerializedName(SERIALIZED_NAME_DOMAIN) + @javax.annotation.Nullable + private String domain; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "Attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nullable + private OrganizationsConnectionBaseAttributes attributes; + + public OrganizationsConnectionBase() { + } + + public OrganizationsConnectionBase name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Name of the connection + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public OrganizationsConnectionBase domain(@javax.annotation.Nullable String domain) { + this.domain = domain; + return this; + } + + /** + * Domain associated with the connection + * @return domain + */ + @javax.annotation.Nullable + public String getDomain() { + return domain; + } + + public void setDomain(@javax.annotation.Nullable String domain) { + this.domain = domain; + } + + + public OrganizationsConnectionBase attributes(@javax.annotation.Nullable OrganizationsConnectionBaseAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nullable + public OrganizationsConnectionBaseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nullable OrganizationsConnectionBaseAttributes attributes) { + this.attributes = attributes; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OrganizationsConnectionBase instance itself + */ + public OrganizationsConnectionBase putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationsConnectionBase organizationsConnectionBase = (OrganizationsConnectionBase) o; + return Objects.equals(this.name, organizationsConnectionBase.name) && + Objects.equals(this.domain, organizationsConnectionBase.domain) && + Objects.equals(this.attributes, organizationsConnectionBase.attributes)&& + Objects.equals(this.additionalProperties, organizationsConnectionBase.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, domain, attributes, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrganizationsConnectionBase {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + openapiFields.add("Domain"); + openapiFields.add("Attributes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OrganizationsConnectionBase + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrganizationsConnectionBase.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationsConnectionBase is not found in the empty JSON string", OrganizationsConnectionBase.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Domain") != null && !jsonObj.get("Domain").isJsonNull()) && !jsonObj.get("Domain").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Domain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Domain").toString())); + } + // validate the optional field `Attributes` + if (jsonObj.get("Attributes") != null && !jsonObj.get("Attributes").isJsonNull()) { + OrganizationsConnectionBaseAttributes.validateJsonElement(jsonObj.get("Attributes")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OrganizationsConnectionBase.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrganizationsConnectionBase' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OrganizationsConnectionBase> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OrganizationsConnectionBase.class)); + + return (TypeAdapter<T>) new TypeAdapter<OrganizationsConnectionBase>() { + @Override + public void write(JsonWriter out, OrganizationsConnectionBase value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OrganizationsConnectionBase read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OrganizationsConnectionBase instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OrganizationsConnectionBase given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganizationsConnectionBase + * @throws IOException if the JSON string is invalid with respect to OrganizationsConnectionBase + */ + public static OrganizationsConnectionBase fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrganizationsConnectionBase.class); + } + + /** + * Convert an instance of OrganizationsConnectionBase to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsConnectionBaseAttributes.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsConnectionBaseAttributes.java new file mode 100644 index 0000000..f900d8c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsConnectionBaseAttributes.java @@ -0,0 +1,444 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Attribute mapping between the IdP claims and user fields. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OrganizationsConnectionBaseAttributes { + public static final String SERIALIZED_NAME_CUSTOM_MAPPING = "CustomMapping"; + @SerializedName(SERIALIZED_NAME_CUSTOM_MAPPING) + @javax.annotation.Nullable + private Map<String, String> customMapping = new HashMap<>(); + + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private String email; + + public static final String SERIALIZED_NAME_FIRST_NAME = "FirstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nullable + private String firstName; + + public static final String SERIALIZED_NAME_GROUPS = "Groups"; + @SerializedName(SERIALIZED_NAME_GROUPS) + @javax.annotation.Nullable + private String groups; + + public static final String SERIALIZED_NAME_I_D = "ID"; + @SerializedName(SERIALIZED_NAME_I_D) + @javax.annotation.Nullable + private String ID; + + public static final String SERIALIZED_NAME_LAST_NAME = "LastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nullable + private String lastName; + + public OrganizationsConnectionBaseAttributes() { + } + + public OrganizationsConnectionBaseAttributes customMapping(@javax.annotation.Nullable Map<String, String> customMapping) { + this.customMapping = customMapping; + return this; + } + + public OrganizationsConnectionBaseAttributes putCustomMappingItem(String key, String customMappingItem) { + if (this.customMapping == null) { + this.customMapping = new HashMap<>(); + } + this.customMapping.put(key, customMappingItem); + return this; + } + + /** + * Custom attribute mapping for the connection + * @return customMapping + */ + @javax.annotation.Nullable + public Map<String, String> getCustomMapping() { + return customMapping; + } + + public void setCustomMapping(@javax.annotation.Nullable Map<String, String> customMapping) { + this.customMapping = customMapping; + } + + + public OrganizationsConnectionBaseAttributes email(@javax.annotation.Nullable String email) { + this.email = email; + return this; + } + + /** + * Email attribute for the connection + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable String email) { + this.email = email; + } + + + public OrganizationsConnectionBaseAttributes firstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * First name attribute for the connection + * @return firstName + */ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + } + + + public OrganizationsConnectionBaseAttributes groups(@javax.annotation.Nullable String groups) { + this.groups = groups; + return this; + } + + /** + * Groups attribute for the connection + * @return groups + */ + @javax.annotation.Nullable + public String getGroups() { + return groups; + } + + public void setGroups(@javax.annotation.Nullable String groups) { + this.groups = groups; + } + + + public OrganizationsConnectionBaseAttributes ID(@javax.annotation.Nullable String ID) { + this.ID = ID; + return this; + } + + /** + * Unique identifier attribute for the connection + * @return ID + */ + @javax.annotation.Nullable + public String getID() { + return ID; + } + + public void setID(@javax.annotation.Nullable String ID) { + this.ID = ID; + } + + + public OrganizationsConnectionBaseAttributes lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Last name attribute for the connection + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OrganizationsConnectionBaseAttributes instance itself + */ + public OrganizationsConnectionBaseAttributes putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationsConnectionBaseAttributes organizationsConnectionBaseAttributes = (OrganizationsConnectionBaseAttributes) o; + return Objects.equals(this.customMapping, organizationsConnectionBaseAttributes.customMapping) && + Objects.equals(this.email, organizationsConnectionBaseAttributes.email) && + Objects.equals(this.firstName, organizationsConnectionBaseAttributes.firstName) && + Objects.equals(this.groups, organizationsConnectionBaseAttributes.groups) && + Objects.equals(this.ID, organizationsConnectionBaseAttributes.ID) && + Objects.equals(this.lastName, organizationsConnectionBaseAttributes.lastName)&& + Objects.equals(this.additionalProperties, organizationsConnectionBaseAttributes.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(customMapping, email, firstName, groups, ID, lastName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrganizationsConnectionBaseAttributes {\n"); + sb.append(" customMapping: ").append(toIndentedString(customMapping)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" groups: ").append(toIndentedString(groups)).append("\n"); + sb.append(" ID: ").append(toIndentedString(ID)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("CustomMapping"); + openapiFields.add("Email"); + openapiFields.add("FirstName"); + openapiFields.add("Groups"); + openapiFields.add("ID"); + openapiFields.add("LastName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OrganizationsConnectionBaseAttributes + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrganizationsConnectionBaseAttributes.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationsConnectionBaseAttributes is not found in the empty JSON string", OrganizationsConnectionBaseAttributes.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Email") != null && !jsonObj.get("Email").isJsonNull()) && !jsonObj.get("Email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Email").toString())); + } + if ((jsonObj.get("FirstName") != null && !jsonObj.get("FirstName").isJsonNull()) && !jsonObj.get("FirstName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FirstName").toString())); + } + if ((jsonObj.get("Groups") != null && !jsonObj.get("Groups").isJsonNull()) && !jsonObj.get("Groups").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Groups` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Groups").toString())); + } + if ((jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonNull()) && !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("LastName") != null && !jsonObj.get("LastName").isJsonNull()) && !jsonObj.get("LastName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OrganizationsConnectionBaseAttributes.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrganizationsConnectionBaseAttributes' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OrganizationsConnectionBaseAttributes> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OrganizationsConnectionBaseAttributes.class)); + + return (TypeAdapter<T>) new TypeAdapter<OrganizationsConnectionBaseAttributes>() { + @Override + public void write(JsonWriter out, OrganizationsConnectionBaseAttributes value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OrganizationsConnectionBaseAttributes read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OrganizationsConnectionBaseAttributes instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OrganizationsConnectionBaseAttributes given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganizationsConnectionBaseAttributes + * @throws IOException if the JSON string is invalid with respect to OrganizationsConnectionBaseAttributes + */ + public static OrganizationsConnectionBaseAttributes fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrganizationsConnectionBaseAttributes.class); + } + + /** + * Convert an instance of OrganizationsConnectionBaseAttributes to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsConnectionSamlBase.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsConnectionSamlBase.java new file mode 100644 index 0000000..28253e8 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsConnectionSamlBase.java @@ -0,0 +1,448 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.OrganizationsConnectionSamlBaseIDPCertificate; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * OrganizationsConnectionSamlBase + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OrganizationsConnectionSamlBase { + public static final String SERIALIZED_NAME_ID_P_ENTITY_ID = "IDPEntityId"; + @SerializedName(SERIALIZED_NAME_ID_P_ENTITY_ID) + @javax.annotation.Nullable + private String idPEntityId; + + public static final String SERIALIZED_NAME_ID_P_METADATA_URL = "IDPMetadataUrl"; + @SerializedName(SERIALIZED_NAME_ID_P_METADATA_URL) + @javax.annotation.Nullable + private String idPMetadataUrl; + + public static final String SERIALIZED_NAME_IS_I_D_P_INITIATED = "IsIDPInitiated"; + @SerializedName(SERIALIZED_NAME_IS_I_D_P_INITIATED) + @javax.annotation.Nullable + private Boolean isIDPInitiated; + + public static final String SERIALIZED_NAME_ID_P_LOGIN_URL = "IDPLoginUrl"; + @SerializedName(SERIALIZED_NAME_ID_P_LOGIN_URL) + @javax.annotation.Nullable + private String idPLoginUrl; + + public static final String SERIALIZED_NAME_ID_P_LOGOUT_URL = "IDPLogoutUrl"; + @SerializedName(SERIALIZED_NAME_ID_P_LOGOUT_URL) + @javax.annotation.Nullable + private String idPLogoutUrl; + + public static final String SERIALIZED_NAME_ID_P_CERTIFICATE = "IDPCertificate"; + @SerializedName(SERIALIZED_NAME_ID_P_CERTIFICATE) + @javax.annotation.Nullable + private OrganizationsConnectionSamlBaseIDPCertificate idPCertificate; + + public OrganizationsConnectionSamlBase() { + } + + public OrganizationsConnectionSamlBase idPEntityId(@javax.annotation.Nullable String idPEntityId) { + this.idPEntityId = idPEntityId; + return this; + } + + /** + * Unique identifier for the Identity Provider (IdP). + * @return idPEntityId + */ + @javax.annotation.Nullable + public String getIdPEntityId() { + return idPEntityId; + } + + public void setIdPEntityId(@javax.annotation.Nullable String idPEntityId) { + this.idPEntityId = idPEntityId; + } + + + public OrganizationsConnectionSamlBase idPMetadataUrl(@javax.annotation.Nullable String idPMetadataUrl) { + this.idPMetadataUrl = idPMetadataUrl; + return this; + } + + /** + * URL to the IdP metadata XML file. + * @return idPMetadataUrl + */ + @javax.annotation.Nullable + public String getIdPMetadataUrl() { + return idPMetadataUrl; + } + + public void setIdPMetadataUrl(@javax.annotation.Nullable String idPMetadataUrl) { + this.idPMetadataUrl = idPMetadataUrl; + } + + + public OrganizationsConnectionSamlBase isIDPInitiated(@javax.annotation.Nullable Boolean isIDPInitiated) { + this.isIDPInitiated = isIDPInitiated; + return this; + } + + /** + * Indicates whether the SAML connection is initiated by the IdP. + * @return isIDPInitiated + */ + @javax.annotation.Nullable + public Boolean getIsIDPInitiated() { + return isIDPInitiated; + } + + public void setIsIDPInitiated(@javax.annotation.Nullable Boolean isIDPInitiated) { + this.isIDPInitiated = isIDPInitiated; + } + + + public OrganizationsConnectionSamlBase idPLoginUrl(@javax.annotation.Nullable String idPLoginUrl) { + this.idPLoginUrl = idPLoginUrl; + return this; + } + + /** + * The IdP's SAML single sign-on (login) URL. + * @return idPLoginUrl + */ + @javax.annotation.Nullable + public String getIdPLoginUrl() { + return idPLoginUrl; + } + + public void setIdPLoginUrl(@javax.annotation.Nullable String idPLoginUrl) { + this.idPLoginUrl = idPLoginUrl; + } + + + public OrganizationsConnectionSamlBase idPLogoutUrl(@javax.annotation.Nullable String idPLogoutUrl) { + this.idPLogoutUrl = idPLogoutUrl; + return this; + } + + /** + * The IdP's SAML single logout (SLO) URL. + * @return idPLogoutUrl + */ + @javax.annotation.Nullable + public String getIdPLogoutUrl() { + return idPLogoutUrl; + } + + public void setIdPLogoutUrl(@javax.annotation.Nullable String idPLogoutUrl) { + this.idPLogoutUrl = idPLogoutUrl; + } + + + public OrganizationsConnectionSamlBase idPCertificate(@javax.annotation.Nullable OrganizationsConnectionSamlBaseIDPCertificate idPCertificate) { + this.idPCertificate = idPCertificate; + return this; + } + + /** + * Get idPCertificate + * @return idPCertificate + */ + @javax.annotation.Nullable + public OrganizationsConnectionSamlBaseIDPCertificate getIdPCertificate() { + return idPCertificate; + } + + public void setIdPCertificate(@javax.annotation.Nullable OrganizationsConnectionSamlBaseIDPCertificate idPCertificate) { + this.idPCertificate = idPCertificate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OrganizationsConnectionSamlBase instance itself + */ + public OrganizationsConnectionSamlBase putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationsConnectionSamlBase organizationsConnectionSamlBase = (OrganizationsConnectionSamlBase) o; + return Objects.equals(this.idPEntityId, organizationsConnectionSamlBase.idPEntityId) && + Objects.equals(this.idPMetadataUrl, organizationsConnectionSamlBase.idPMetadataUrl) && + Objects.equals(this.isIDPInitiated, organizationsConnectionSamlBase.isIDPInitiated) && + Objects.equals(this.idPLoginUrl, organizationsConnectionSamlBase.idPLoginUrl) && + Objects.equals(this.idPLogoutUrl, organizationsConnectionSamlBase.idPLogoutUrl) && + Objects.equals(this.idPCertificate, organizationsConnectionSamlBase.idPCertificate)&& + Objects.equals(this.additionalProperties, organizationsConnectionSamlBase.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(idPEntityId, idPMetadataUrl, isIDPInitiated, idPLoginUrl, idPLogoutUrl, idPCertificate, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrganizationsConnectionSamlBase {\n"); + sb.append(" idPEntityId: ").append(toIndentedString(idPEntityId)).append("\n"); + sb.append(" idPMetadataUrl: ").append(toIndentedString(idPMetadataUrl)).append("\n"); + sb.append(" isIDPInitiated: ").append(toIndentedString(isIDPInitiated)).append("\n"); + sb.append(" idPLoginUrl: ").append(toIndentedString(idPLoginUrl)).append("\n"); + sb.append(" idPLogoutUrl: ").append(toIndentedString(idPLogoutUrl)).append("\n"); + sb.append(" idPCertificate: ").append(toIndentedString(idPCertificate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IDPEntityId"); + openapiFields.add("IDPMetadataUrl"); + openapiFields.add("IsIDPInitiated"); + openapiFields.add("IDPLoginUrl"); + openapiFields.add("IDPLogoutUrl"); + openapiFields.add("IDPCertificate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OrganizationsConnectionSamlBase + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrganizationsConnectionSamlBase.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationsConnectionSamlBase is not found in the empty JSON string", OrganizationsConnectionSamlBase.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("IDPEntityId") != null && !jsonObj.get("IDPEntityId").isJsonNull()) && !jsonObj.get("IDPEntityId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IDPEntityId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IDPEntityId").toString())); + } + if ((jsonObj.get("IDPMetadataUrl") != null && !jsonObj.get("IDPMetadataUrl").isJsonNull()) && !jsonObj.get("IDPMetadataUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IDPMetadataUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IDPMetadataUrl").toString())); + } + if ((jsonObj.get("IDPLoginUrl") != null && !jsonObj.get("IDPLoginUrl").isJsonNull()) && !jsonObj.get("IDPLoginUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IDPLoginUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IDPLoginUrl").toString())); + } + if ((jsonObj.get("IDPLogoutUrl") != null && !jsonObj.get("IDPLogoutUrl").isJsonNull()) && !jsonObj.get("IDPLogoutUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IDPLogoutUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IDPLogoutUrl").toString())); + } + // validate the optional field `IDPCertificate` + if (jsonObj.get("IDPCertificate") != null && !jsonObj.get("IDPCertificate").isJsonNull()) { + OrganizationsConnectionSamlBaseIDPCertificate.validateJsonElement(jsonObj.get("IDPCertificate")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OrganizationsConnectionSamlBase.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrganizationsConnectionSamlBase' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OrganizationsConnectionSamlBase> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OrganizationsConnectionSamlBase.class)); + + return (TypeAdapter<T>) new TypeAdapter<OrganizationsConnectionSamlBase>() { + @Override + public void write(JsonWriter out, OrganizationsConnectionSamlBase value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OrganizationsConnectionSamlBase read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OrganizationsConnectionSamlBase instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OrganizationsConnectionSamlBase given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganizationsConnectionSamlBase + * @throws IOException if the JSON string is invalid with respect to OrganizationsConnectionSamlBase + */ + public static OrganizationsConnectionSamlBase fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrganizationsConnectionSamlBase.class); + } + + /** + * Convert an instance of OrganizationsConnectionSamlBase to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsConnectionSamlBaseIDPCertificate.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsConnectionSamlBaseIDPCertificate.java new file mode 100644 index 0000000..270d9f4 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsConnectionSamlBaseIDPCertificate.java @@ -0,0 +1,342 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * IdP certificate details, including the PEM value and its validity window. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OrganizationsConnectionSamlBaseIDPCertificate { + public static final String SERIALIZED_NAME_CERTIFICATE = "Certificate"; + @SerializedName(SERIALIZED_NAME_CERTIFICATE) + @javax.annotation.Nullable + private String certificate; + + public static final String SERIALIZED_NAME_NOT_AFTER = "NotAfter"; + @SerializedName(SERIALIZED_NAME_NOT_AFTER) + @javax.annotation.Nullable + private OffsetDateTime notAfter; + + public static final String SERIALIZED_NAME_NOT_BEFORE = "NotBefore"; + @SerializedName(SERIALIZED_NAME_NOT_BEFORE) + @javax.annotation.Nullable + private OffsetDateTime notBefore; + + public OrganizationsConnectionSamlBaseIDPCertificate() { + } + + public OrganizationsConnectionSamlBaseIDPCertificate certificate(@javax.annotation.Nullable String certificate) { + this.certificate = certificate; + return this; + } + + /** + * The Identity Provider's certificate in PEM format. + * @return certificate + */ + @javax.annotation.Nullable + public String getCertificate() { + return certificate; + } + + public void setCertificate(@javax.annotation.Nullable String certificate) { + this.certificate = certificate; + } + + + public OrganizationsConnectionSamlBaseIDPCertificate notAfter(@javax.annotation.Nullable OffsetDateTime notAfter) { + this.notAfter = notAfter; + return this; + } + + /** + * The expiration date of the IdP certificate. + * @return notAfter + */ + @javax.annotation.Nullable + public OffsetDateTime getNotAfter() { + return notAfter; + } + + public void setNotAfter(@javax.annotation.Nullable OffsetDateTime notAfter) { + this.notAfter = notAfter; + } + + + public OrganizationsConnectionSamlBaseIDPCertificate notBefore(@javax.annotation.Nullable OffsetDateTime notBefore) { + this.notBefore = notBefore; + return this; + } + + /** + * The start date of the IdP certificate validity. + * @return notBefore + */ + @javax.annotation.Nullable + public OffsetDateTime getNotBefore() { + return notBefore; + } + + public void setNotBefore(@javax.annotation.Nullable OffsetDateTime notBefore) { + this.notBefore = notBefore; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OrganizationsConnectionSamlBaseIDPCertificate instance itself + */ + public OrganizationsConnectionSamlBaseIDPCertificate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationsConnectionSamlBaseIDPCertificate organizationsConnectionSamlBaseIDPCertificate = (OrganizationsConnectionSamlBaseIDPCertificate) o; + return Objects.equals(this.certificate, organizationsConnectionSamlBaseIDPCertificate.certificate) && + Objects.equals(this.notAfter, organizationsConnectionSamlBaseIDPCertificate.notAfter) && + Objects.equals(this.notBefore, organizationsConnectionSamlBaseIDPCertificate.notBefore)&& + Objects.equals(this.additionalProperties, organizationsConnectionSamlBaseIDPCertificate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(certificate, notAfter, notBefore, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrganizationsConnectionSamlBaseIDPCertificate {\n"); + sb.append(" certificate: ").append(toIndentedString(certificate)).append("\n"); + sb.append(" notAfter: ").append(toIndentedString(notAfter)).append("\n"); + sb.append(" notBefore: ").append(toIndentedString(notBefore)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Certificate"); + openapiFields.add("NotAfter"); + openapiFields.add("NotBefore"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OrganizationsConnectionSamlBaseIDPCertificate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrganizationsConnectionSamlBaseIDPCertificate.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationsConnectionSamlBaseIDPCertificate is not found in the empty JSON string", OrganizationsConnectionSamlBaseIDPCertificate.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Certificate") != null && !jsonObj.get("Certificate").isJsonNull()) && !jsonObj.get("Certificate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Certificate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Certificate").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OrganizationsConnectionSamlBaseIDPCertificate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrganizationsConnectionSamlBaseIDPCertificate' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OrganizationsConnectionSamlBaseIDPCertificate> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OrganizationsConnectionSamlBaseIDPCertificate.class)); + + return (TypeAdapter<T>) new TypeAdapter<OrganizationsConnectionSamlBaseIDPCertificate>() { + @Override + public void write(JsonWriter out, OrganizationsConnectionSamlBaseIDPCertificate value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OrganizationsConnectionSamlBaseIDPCertificate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OrganizationsConnectionSamlBaseIDPCertificate instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OrganizationsConnectionSamlBaseIDPCertificate given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganizationsConnectionSamlBaseIDPCertificate + * @throws IOException if the JSON string is invalid with respect to OrganizationsConnectionSamlBaseIDPCertificate + */ + public static OrganizationsConnectionSamlBaseIDPCertificate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrganizationsConnectionSamlBaseIDPCertificate.class); + } + + /** + * Convert an instance of OrganizationsConnectionSamlBaseIDPCertificate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsDomainsResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsDomainsResponse.java new file mode 100644 index 0000000..cd40e2e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsDomainsResponse.java @@ -0,0 +1,404 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OrganizationsDomainsResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OrganizationsDomainsResponse { + public static final String SERIALIZED_NAME_DOMAIN_NAME = "DomainName"; + @SerializedName(SERIALIZED_NAME_DOMAIN_NAME) + @javax.annotation.Nullable + private String domainName; + + public static final String SERIALIZED_NAME_IS_VERIFIED = "IsVerified"; + @SerializedName(SERIALIZED_NAME_IS_VERIFIED) + @javax.annotation.Nullable + private Boolean isVerified; + + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_VERIFICATION_STRATEGY = "VerificationStrategy"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_STRATEGY) + @javax.annotation.Nullable + private String verificationStrategy; + + public static final String SERIALIZED_NAME_VERIFICATION_TOKEN = "VerificationToken"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_TOKEN) + @javax.annotation.Nullable + private String verificationToken; + + public OrganizationsDomainsResponse() { + } + + public OrganizationsDomainsResponse domainName(@javax.annotation.Nullable String domainName) { + this.domainName = domainName; + return this; + } + + /** + * The domain name to be verified + * @return domainName + */ + @javax.annotation.Nullable + public String getDomainName() { + return domainName; + } + + public void setDomainName(@javax.annotation.Nullable String domainName) { + this.domainName = domainName; + } + + + public OrganizationsDomainsResponse isVerified(@javax.annotation.Nullable Boolean isVerified) { + this.isVerified = isVerified; + return this; + } + + /** + * Indicates whether the domain has been verified + * @return isVerified + */ + @javax.annotation.Nullable + public Boolean getIsVerified() { + return isVerified; + } + + public void setIsVerified(@javax.annotation.Nullable Boolean isVerified) { + this.isVerified = isVerified; + } + + + public OrganizationsDomainsResponse id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the organization domain. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public OrganizationsDomainsResponse verificationStrategy(@javax.annotation.Nullable String verificationStrategy) { + this.verificationStrategy = verificationStrategy; + return this; + } + + /** + * Strategy used for domain verification, e.g., 'manual'. + * @return verificationStrategy + */ + @javax.annotation.Nullable + public String getVerificationStrategy() { + return verificationStrategy; + } + + public void setVerificationStrategy(@javax.annotation.Nullable String verificationStrategy) { + this.verificationStrategy = verificationStrategy; + } + + + public OrganizationsDomainsResponse verificationToken(@javax.annotation.Nullable String verificationToken) { + this.verificationToken = verificationToken; + return this; + } + + /** + * Token used for domain verification. + * @return verificationToken + */ + @javax.annotation.Nullable + public String getVerificationToken() { + return verificationToken; + } + + public void setVerificationToken(@javax.annotation.Nullable String verificationToken) { + this.verificationToken = verificationToken; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OrganizationsDomainsResponse instance itself + */ + public OrganizationsDomainsResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationsDomainsResponse organizationsDomainsResponse = (OrganizationsDomainsResponse) o; + return Objects.equals(this.domainName, organizationsDomainsResponse.domainName) && + Objects.equals(this.isVerified, organizationsDomainsResponse.isVerified) && + Objects.equals(this.id, organizationsDomainsResponse.id) && + Objects.equals(this.verificationStrategy, organizationsDomainsResponse.verificationStrategy) && + Objects.equals(this.verificationToken, organizationsDomainsResponse.verificationToken)&& + Objects.equals(this.additionalProperties, organizationsDomainsResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(domainName, isVerified, id, verificationStrategy, verificationToken, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrganizationsDomainsResponse {\n"); + sb.append(" domainName: ").append(toIndentedString(domainName)).append("\n"); + sb.append(" isVerified: ").append(toIndentedString(isVerified)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" verificationStrategy: ").append(toIndentedString(verificationStrategy)).append("\n"); + sb.append(" verificationToken: ").append(toIndentedString(verificationToken)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("DomainName"); + openapiFields.add("IsVerified"); + openapiFields.add("Id"); + openapiFields.add("VerificationStrategy"); + openapiFields.add("VerificationToken"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OrganizationsDomainsResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrganizationsDomainsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationsDomainsResponse is not found in the empty JSON string", OrganizationsDomainsResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("DomainName") != null && !jsonObj.get("DomainName").isJsonNull()) && !jsonObj.get("DomainName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DomainName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DomainName").toString())); + } + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("VerificationStrategy") != null && !jsonObj.get("VerificationStrategy").isJsonNull()) && !jsonObj.get("VerificationStrategy").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `VerificationStrategy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("VerificationStrategy").toString())); + } + if ((jsonObj.get("VerificationToken") != null && !jsonObj.get("VerificationToken").isJsonNull()) && !jsonObj.get("VerificationToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `VerificationToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("VerificationToken").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OrganizationsDomainsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrganizationsDomainsResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OrganizationsDomainsResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OrganizationsDomainsResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<OrganizationsDomainsResponse>() { + @Override + public void write(JsonWriter out, OrganizationsDomainsResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OrganizationsDomainsResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OrganizationsDomainsResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OrganizationsDomainsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganizationsDomainsResponse + * @throws IOException if the JSON string is invalid with respect to OrganizationsDomainsResponse + */ + public static OrganizationsDomainsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrganizationsDomainsResponse.class); + } + + /** + * Convert an instance of OrganizationsDomainsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsDomainsResponseCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsDomainsResponseCore.java new file mode 100644 index 0000000..04cd3fe --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsDomainsResponseCore.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * OrganizationsDomainsResponseCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OrganizationsDomainsResponseCore { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_VERIFICATION_STRATEGY = "VerificationStrategy"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_STRATEGY) + @javax.annotation.Nullable + private String verificationStrategy; + + public static final String SERIALIZED_NAME_VERIFICATION_TOKEN = "VerificationToken"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_TOKEN) + @javax.annotation.Nullable + private String verificationToken; + + public OrganizationsDomainsResponseCore() { + } + + public OrganizationsDomainsResponseCore id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the organization domain. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public OrganizationsDomainsResponseCore verificationStrategy(@javax.annotation.Nullable String verificationStrategy) { + this.verificationStrategy = verificationStrategy; + return this; + } + + /** + * Strategy used for domain verification, e.g., 'manual'. + * @return verificationStrategy + */ + @javax.annotation.Nullable + public String getVerificationStrategy() { + return verificationStrategy; + } + + public void setVerificationStrategy(@javax.annotation.Nullable String verificationStrategy) { + this.verificationStrategy = verificationStrategy; + } + + + public OrganizationsDomainsResponseCore verificationToken(@javax.annotation.Nullable String verificationToken) { + this.verificationToken = verificationToken; + return this; + } + + /** + * Token used for domain verification. + * @return verificationToken + */ + @javax.annotation.Nullable + public String getVerificationToken() { + return verificationToken; + } + + public void setVerificationToken(@javax.annotation.Nullable String verificationToken) { + this.verificationToken = verificationToken; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OrganizationsDomainsResponseCore instance itself + */ + public OrganizationsDomainsResponseCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationsDomainsResponseCore organizationsDomainsResponseCore = (OrganizationsDomainsResponseCore) o; + return Objects.equals(this.id, organizationsDomainsResponseCore.id) && + Objects.equals(this.verificationStrategy, organizationsDomainsResponseCore.verificationStrategy) && + Objects.equals(this.verificationToken, organizationsDomainsResponseCore.verificationToken)&& + Objects.equals(this.additionalProperties, organizationsDomainsResponseCore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, verificationStrategy, verificationToken, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrganizationsDomainsResponseCore {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" verificationStrategy: ").append(toIndentedString(verificationStrategy)).append("\n"); + sb.append(" verificationToken: ").append(toIndentedString(verificationToken)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("VerificationStrategy"); + openapiFields.add("VerificationToken"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OrganizationsDomainsResponseCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrganizationsDomainsResponseCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationsDomainsResponseCore is not found in the empty JSON string", OrganizationsDomainsResponseCore.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("VerificationStrategy") != null && !jsonObj.get("VerificationStrategy").isJsonNull()) && !jsonObj.get("VerificationStrategy").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `VerificationStrategy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("VerificationStrategy").toString())); + } + if ((jsonObj.get("VerificationToken") != null && !jsonObj.get("VerificationToken").isJsonNull()) && !jsonObj.get("VerificationToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `VerificationToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("VerificationToken").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OrganizationsDomainsResponseCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrganizationsDomainsResponseCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OrganizationsDomainsResponseCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OrganizationsDomainsResponseCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<OrganizationsDomainsResponseCore>() { + @Override + public void write(JsonWriter out, OrganizationsDomainsResponseCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OrganizationsDomainsResponseCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OrganizationsDomainsResponseCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OrganizationsDomainsResponseCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganizationsDomainsResponseCore + * @throws IOException if the JSON string is invalid with respect to OrganizationsDomainsResponseCore + */ + public static OrganizationsDomainsResponseCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrganizationsDomainsResponseCore.class); + } + + /** + * Convert an instance of OrganizationsDomainsResponseCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsPolicyBase.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsPolicyBase.java new file mode 100644 index 0000000..ce15cb3 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsPolicyBase.java @@ -0,0 +1,429 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.OrganizationsPolicyBaseJITPolicy; +import com.loginradius.sdk.internal.openapi.model.OrganizationsPolicyBaseMFAPolicy; +import com.loginradius.sdk.internal.openapi.model.OrganizationsPolicyBaseMemberPolicy; +import com.loginradius.sdk.internal.openapi.model.OrganizationsPolicyBasePasswordPolicy; +import com.loginradius.sdk.internal.openapi.model.OrganizationsPolicyBaseSessionPolicy; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * OrganizationsPolicyBase + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OrganizationsPolicyBase { + public static final String SERIALIZED_NAME_JI_T_POLICY = "JITPolicy"; + @SerializedName(SERIALIZED_NAME_JI_T_POLICY) + @javax.annotation.Nullable + private OrganizationsPolicyBaseJITPolicy jiTPolicy; + + public static final String SERIALIZED_NAME_MF_A_POLICY = "MFAPolicy"; + @SerializedName(SERIALIZED_NAME_MF_A_POLICY) + @javax.annotation.Nullable + private OrganizationsPolicyBaseMFAPolicy mfAPolicy; + + public static final String SERIALIZED_NAME_MEMBER_POLICY = "MemberPolicy"; + @SerializedName(SERIALIZED_NAME_MEMBER_POLICY) + @javax.annotation.Nullable + private OrganizationsPolicyBaseMemberPolicy memberPolicy; + + public static final String SERIALIZED_NAME_PASSWORD_POLICY = "PasswordPolicy"; + @SerializedName(SERIALIZED_NAME_PASSWORD_POLICY) + @javax.annotation.Nullable + private OrganizationsPolicyBasePasswordPolicy passwordPolicy; + + public static final String SERIALIZED_NAME_SESSION_POLICY = "SessionPolicy"; + @SerializedName(SERIALIZED_NAME_SESSION_POLICY) + @javax.annotation.Nullable + private OrganizationsPolicyBaseSessionPolicy sessionPolicy; + + public OrganizationsPolicyBase() { + } + + public OrganizationsPolicyBase jiTPolicy(@javax.annotation.Nullable OrganizationsPolicyBaseJITPolicy jiTPolicy) { + this.jiTPolicy = jiTPolicy; + return this; + } + + /** + * Get jiTPolicy + * @return jiTPolicy + */ + @javax.annotation.Nullable + public OrganizationsPolicyBaseJITPolicy getJiTPolicy() { + return jiTPolicy; + } + + public void setJiTPolicy(@javax.annotation.Nullable OrganizationsPolicyBaseJITPolicy jiTPolicy) { + this.jiTPolicy = jiTPolicy; + } + + + public OrganizationsPolicyBase mfAPolicy(@javax.annotation.Nullable OrganizationsPolicyBaseMFAPolicy mfAPolicy) { + this.mfAPolicy = mfAPolicy; + return this; + } + + /** + * Get mfAPolicy + * @return mfAPolicy + */ + @javax.annotation.Nullable + public OrganizationsPolicyBaseMFAPolicy getMfAPolicy() { + return mfAPolicy; + } + + public void setMfAPolicy(@javax.annotation.Nullable OrganizationsPolicyBaseMFAPolicy mfAPolicy) { + this.mfAPolicy = mfAPolicy; + } + + + public OrganizationsPolicyBase memberPolicy(@javax.annotation.Nullable OrganizationsPolicyBaseMemberPolicy memberPolicy) { + this.memberPolicy = memberPolicy; + return this; + } + + /** + * Get memberPolicy + * @return memberPolicy + */ + @javax.annotation.Nullable + public OrganizationsPolicyBaseMemberPolicy getMemberPolicy() { + return memberPolicy; + } + + public void setMemberPolicy(@javax.annotation.Nullable OrganizationsPolicyBaseMemberPolicy memberPolicy) { + this.memberPolicy = memberPolicy; + } + + + public OrganizationsPolicyBase passwordPolicy(@javax.annotation.Nullable OrganizationsPolicyBasePasswordPolicy passwordPolicy) { + this.passwordPolicy = passwordPolicy; + return this; + } + + /** + * Get passwordPolicy + * @return passwordPolicy + */ + @javax.annotation.Nullable + public OrganizationsPolicyBasePasswordPolicy getPasswordPolicy() { + return passwordPolicy; + } + + public void setPasswordPolicy(@javax.annotation.Nullable OrganizationsPolicyBasePasswordPolicy passwordPolicy) { + this.passwordPolicy = passwordPolicy; + } + + + public OrganizationsPolicyBase sessionPolicy(@javax.annotation.Nullable OrganizationsPolicyBaseSessionPolicy sessionPolicy) { + this.sessionPolicy = sessionPolicy; + return this; + } + + /** + * Get sessionPolicy + * @return sessionPolicy + */ + @javax.annotation.Nullable + public OrganizationsPolicyBaseSessionPolicy getSessionPolicy() { + return sessionPolicy; + } + + public void setSessionPolicy(@javax.annotation.Nullable OrganizationsPolicyBaseSessionPolicy sessionPolicy) { + this.sessionPolicy = sessionPolicy; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OrganizationsPolicyBase instance itself + */ + public OrganizationsPolicyBase putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationsPolicyBase organizationsPolicyBase = (OrganizationsPolicyBase) o; + return Objects.equals(this.jiTPolicy, organizationsPolicyBase.jiTPolicy) && + Objects.equals(this.mfAPolicy, organizationsPolicyBase.mfAPolicy) && + Objects.equals(this.memberPolicy, organizationsPolicyBase.memberPolicy) && + Objects.equals(this.passwordPolicy, organizationsPolicyBase.passwordPolicy) && + Objects.equals(this.sessionPolicy, organizationsPolicyBase.sessionPolicy)&& + Objects.equals(this.additionalProperties, organizationsPolicyBase.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(jiTPolicy, mfAPolicy, memberPolicy, passwordPolicy, sessionPolicy, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrganizationsPolicyBase {\n"); + sb.append(" jiTPolicy: ").append(toIndentedString(jiTPolicy)).append("\n"); + sb.append(" mfAPolicy: ").append(toIndentedString(mfAPolicy)).append("\n"); + sb.append(" memberPolicy: ").append(toIndentedString(memberPolicy)).append("\n"); + sb.append(" passwordPolicy: ").append(toIndentedString(passwordPolicy)).append("\n"); + sb.append(" sessionPolicy: ").append(toIndentedString(sessionPolicy)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("JITPolicy"); + openapiFields.add("MFAPolicy"); + openapiFields.add("MemberPolicy"); + openapiFields.add("PasswordPolicy"); + openapiFields.add("SessionPolicy"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OrganizationsPolicyBase + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrganizationsPolicyBase.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationsPolicyBase is not found in the empty JSON string", OrganizationsPolicyBase.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `JITPolicy` + if (jsonObj.get("JITPolicy") != null && !jsonObj.get("JITPolicy").isJsonNull()) { + OrganizationsPolicyBaseJITPolicy.validateJsonElement(jsonObj.get("JITPolicy")); + } + // validate the optional field `MFAPolicy` + if (jsonObj.get("MFAPolicy") != null && !jsonObj.get("MFAPolicy").isJsonNull()) { + OrganizationsPolicyBaseMFAPolicy.validateJsonElement(jsonObj.get("MFAPolicy")); + } + // validate the optional field `MemberPolicy` + if (jsonObj.get("MemberPolicy") != null && !jsonObj.get("MemberPolicy").isJsonNull()) { + OrganizationsPolicyBaseMemberPolicy.validateJsonElement(jsonObj.get("MemberPolicy")); + } + // validate the optional field `PasswordPolicy` + if (jsonObj.get("PasswordPolicy") != null && !jsonObj.get("PasswordPolicy").isJsonNull()) { + OrganizationsPolicyBasePasswordPolicy.validateJsonElement(jsonObj.get("PasswordPolicy")); + } + // validate the optional field `SessionPolicy` + if (jsonObj.get("SessionPolicy") != null && !jsonObj.get("SessionPolicy").isJsonNull()) { + OrganizationsPolicyBaseSessionPolicy.validateJsonElement(jsonObj.get("SessionPolicy")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OrganizationsPolicyBase.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrganizationsPolicyBase' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OrganizationsPolicyBase> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OrganizationsPolicyBase.class)); + + return (TypeAdapter<T>) new TypeAdapter<OrganizationsPolicyBase>() { + @Override + public void write(JsonWriter out, OrganizationsPolicyBase value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OrganizationsPolicyBase read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OrganizationsPolicyBase instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OrganizationsPolicyBase given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganizationsPolicyBase + * @throws IOException if the JSON string is invalid with respect to OrganizationsPolicyBase + */ + public static OrganizationsPolicyBase fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrganizationsPolicyBase.class); + } + + /** + * Convert an instance of OrganizationsPolicyBase to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsPolicyBaseJITPolicy.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsPolicyBaseJITPolicy.java new file mode 100644 index 0000000..5e33775 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsPolicyBaseJITPolicy.java @@ -0,0 +1,296 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Just-In-Time (JIT) provisioning policy for the organization + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OrganizationsPolicyBaseJITPolicy { + public static final String SERIALIZED_NAME_ENABLED = "Enabled"; + @SerializedName(SERIALIZED_NAME_ENABLED) + @javax.annotation.Nullable + private Boolean enabled; + + public OrganizationsPolicyBaseJITPolicy() { + } + + public OrganizationsPolicyBaseJITPolicy enabled(@javax.annotation.Nullable Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Indicates if JIT provisioning is enabled + * @return enabled + */ + @javax.annotation.Nullable + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(@javax.annotation.Nullable Boolean enabled) { + this.enabled = enabled; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OrganizationsPolicyBaseJITPolicy instance itself + */ + public OrganizationsPolicyBaseJITPolicy putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationsPolicyBaseJITPolicy organizationsPolicyBaseJITPolicy = (OrganizationsPolicyBaseJITPolicy) o; + return Objects.equals(this.enabled, organizationsPolicyBaseJITPolicy.enabled)&& + Objects.equals(this.additionalProperties, organizationsPolicyBaseJITPolicy.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(enabled, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrganizationsPolicyBaseJITPolicy {\n"); + sb.append(" enabled: ").append(toIndentedString(enabled)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Enabled"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OrganizationsPolicyBaseJITPolicy + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrganizationsPolicyBaseJITPolicy.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationsPolicyBaseJITPolicy is not found in the empty JSON string", OrganizationsPolicyBaseJITPolicy.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OrganizationsPolicyBaseJITPolicy.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrganizationsPolicyBaseJITPolicy' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OrganizationsPolicyBaseJITPolicy> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OrganizationsPolicyBaseJITPolicy.class)); + + return (TypeAdapter<T>) new TypeAdapter<OrganizationsPolicyBaseJITPolicy>() { + @Override + public void write(JsonWriter out, OrganizationsPolicyBaseJITPolicy value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OrganizationsPolicyBaseJITPolicy read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OrganizationsPolicyBaseJITPolicy instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OrganizationsPolicyBaseJITPolicy given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganizationsPolicyBaseJITPolicy + * @throws IOException if the JSON string is invalid with respect to OrganizationsPolicyBaseJITPolicy + */ + public static OrganizationsPolicyBaseJITPolicy fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrganizationsPolicyBaseJITPolicy.class); + } + + /** + * Convert an instance of OrganizationsPolicyBaseJITPolicy to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsPolicyBaseMFAPolicy.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsPolicyBaseMFAPolicy.java new file mode 100644 index 0000000..aa310bb --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsPolicyBaseMFAPolicy.java @@ -0,0 +1,287 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * Multi-Factor Authentication (MFA) policy for the organization + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OrganizationsPolicyBaseMFAPolicy { + public static final String SERIALIZED_NAME_ENFORCEMENT_MODE = "EnforcementMode"; + @SerializedName(SERIALIZED_NAME_ENFORCEMENT_MODE) + @javax.annotation.Nullable + private String enforcementMode; + + public OrganizationsPolicyBaseMFAPolicy() { + } + + public OrganizationsPolicyBaseMFAPolicy enforcementMode(@javax.annotation.Nullable String enforcementMode) { + this.enforcementMode = enforcementMode; + return this; + } + + /** + * Mode of enforcement for Multi-Factor Authentication (MFA) + * @return enforcementMode + */ + @javax.annotation.Nullable + public String getEnforcementMode() { + return enforcementMode; + } + + public void setEnforcementMode(@javax.annotation.Nullable String enforcementMode) { + this.enforcementMode = enforcementMode; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OrganizationsPolicyBaseMFAPolicy instance itself + */ + public OrganizationsPolicyBaseMFAPolicy putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationsPolicyBaseMFAPolicy organizationsPolicyBaseMFAPolicy = (OrganizationsPolicyBaseMFAPolicy) o; + return Objects.equals(this.enforcementMode, organizationsPolicyBaseMFAPolicy.enforcementMode)&& + Objects.equals(this.additionalProperties, organizationsPolicyBaseMFAPolicy.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(enforcementMode, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrganizationsPolicyBaseMFAPolicy {\n"); + sb.append(" enforcementMode: ").append(toIndentedString(enforcementMode)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("EnforcementMode"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OrganizationsPolicyBaseMFAPolicy + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrganizationsPolicyBaseMFAPolicy.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationsPolicyBaseMFAPolicy is not found in the empty JSON string", OrganizationsPolicyBaseMFAPolicy.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("EnforcementMode") != null && !jsonObj.get("EnforcementMode").isJsonNull()) && !jsonObj.get("EnforcementMode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `EnforcementMode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("EnforcementMode").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OrganizationsPolicyBaseMFAPolicy.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrganizationsPolicyBaseMFAPolicy' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OrganizationsPolicyBaseMFAPolicy> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OrganizationsPolicyBaseMFAPolicy.class)); + + return (TypeAdapter<T>) new TypeAdapter<OrganizationsPolicyBaseMFAPolicy>() { + @Override + public void write(JsonWriter out, OrganizationsPolicyBaseMFAPolicy value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OrganizationsPolicyBaseMFAPolicy read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OrganizationsPolicyBaseMFAPolicy instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OrganizationsPolicyBaseMFAPolicy given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganizationsPolicyBaseMFAPolicy + * @throws IOException if the JSON string is invalid with respect to OrganizationsPolicyBaseMFAPolicy + */ + public static OrganizationsPolicyBaseMFAPolicy fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrganizationsPolicyBaseMFAPolicy.class); + } + + /** + * Convert an instance of OrganizationsPolicyBaseMFAPolicy to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsPolicyBaseMemberPolicy.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsPolicyBaseMemberPolicy.java new file mode 100644 index 0000000..6879883 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsPolicyBaseMemberPolicy.java @@ -0,0 +1,287 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * Member policy for the organization + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OrganizationsPolicyBaseMemberPolicy { + public static final String SERIALIZED_NAME_DEFAULT_MEMBER_ROLE = "DefaultMemberRole"; + @SerializedName(SERIALIZED_NAME_DEFAULT_MEMBER_ROLE) + @javax.annotation.Nullable + private String defaultMemberRole; + + public OrganizationsPolicyBaseMemberPolicy() { + } + + public OrganizationsPolicyBaseMemberPolicy defaultMemberRole(@javax.annotation.Nullable String defaultMemberRole) { + this.defaultMemberRole = defaultMemberRole; + return this; + } + + /** + * Default Role assigned to new members in the organization + * @return defaultMemberRole + */ + @javax.annotation.Nullable + public String getDefaultMemberRole() { + return defaultMemberRole; + } + + public void setDefaultMemberRole(@javax.annotation.Nullable String defaultMemberRole) { + this.defaultMemberRole = defaultMemberRole; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OrganizationsPolicyBaseMemberPolicy instance itself + */ + public OrganizationsPolicyBaseMemberPolicy putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationsPolicyBaseMemberPolicy organizationsPolicyBaseMemberPolicy = (OrganizationsPolicyBaseMemberPolicy) o; + return Objects.equals(this.defaultMemberRole, organizationsPolicyBaseMemberPolicy.defaultMemberRole)&& + Objects.equals(this.additionalProperties, organizationsPolicyBaseMemberPolicy.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(defaultMemberRole, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrganizationsPolicyBaseMemberPolicy {\n"); + sb.append(" defaultMemberRole: ").append(toIndentedString(defaultMemberRole)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("DefaultMemberRole"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OrganizationsPolicyBaseMemberPolicy + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrganizationsPolicyBaseMemberPolicy.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationsPolicyBaseMemberPolicy is not found in the empty JSON string", OrganizationsPolicyBaseMemberPolicy.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("DefaultMemberRole") != null && !jsonObj.get("DefaultMemberRole").isJsonNull()) && !jsonObj.get("DefaultMemberRole").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DefaultMemberRole` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DefaultMemberRole").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OrganizationsPolicyBaseMemberPolicy.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrganizationsPolicyBaseMemberPolicy' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OrganizationsPolicyBaseMemberPolicy> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OrganizationsPolicyBaseMemberPolicy.class)); + + return (TypeAdapter<T>) new TypeAdapter<OrganizationsPolicyBaseMemberPolicy>() { + @Override + public void write(JsonWriter out, OrganizationsPolicyBaseMemberPolicy value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OrganizationsPolicyBaseMemberPolicy read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OrganizationsPolicyBaseMemberPolicy instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OrganizationsPolicyBaseMemberPolicy given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganizationsPolicyBaseMemberPolicy + * @throws IOException if the JSON string is invalid with respect to OrganizationsPolicyBaseMemberPolicy + */ + public static OrganizationsPolicyBaseMemberPolicy fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrganizationsPolicyBaseMemberPolicy.class); + } + + /** + * Convert an instance of OrganizationsPolicyBaseMemberPolicy to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsPolicyBasePasswordPolicy.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsPolicyBasePasswordPolicy.java new file mode 100644 index 0000000..747024a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsPolicyBasePasswordPolicy.java @@ -0,0 +1,446 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * Password policy for the organization + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OrganizationsPolicyBasePasswordPolicy { + public static final String SERIALIZED_NAME_EXPIRY_DAYS = "ExpiryDays"; + @SerializedName(SERIALIZED_NAME_EXPIRY_DAYS) + @javax.annotation.Nullable + private Integer expiryDays; + + public static final String SERIALIZED_NAME_MAX_LENGTH = "MaxLength"; + @SerializedName(SERIALIZED_NAME_MAX_LENGTH) + @javax.annotation.Nullable + private Integer maxLength; + + public static final String SERIALIZED_NAME_MIN_LENGTH = "MinLength"; + @SerializedName(SERIALIZED_NAME_MIN_LENGTH) + @javax.annotation.Nullable + private Integer minLength; + + public static final String SERIALIZED_NAME_REQUIRE_LOWERCASE = "RequireLowercase"; + @SerializedName(SERIALIZED_NAME_REQUIRE_LOWERCASE) + @javax.annotation.Nullable + private Boolean requireLowercase; + + public static final String SERIALIZED_NAME_REQUIRE_NUMBER = "RequireNumber"; + @SerializedName(SERIALIZED_NAME_REQUIRE_NUMBER) + @javax.annotation.Nullable + private Boolean requireNumber; + + public static final String SERIALIZED_NAME_REQUIRE_SPECIAL_CHAR = "RequireSpecialChar"; + @SerializedName(SERIALIZED_NAME_REQUIRE_SPECIAL_CHAR) + @javax.annotation.Nullable + private Boolean requireSpecialChar; + + public static final String SERIALIZED_NAME_REQUIRE_UPPERCASE = "RequireUppercase"; + @SerializedName(SERIALIZED_NAME_REQUIRE_UPPERCASE) + @javax.annotation.Nullable + private Boolean requireUppercase; + + public OrganizationsPolicyBasePasswordPolicy() { + } + + public OrganizationsPolicyBasePasswordPolicy expiryDays(@javax.annotation.Nullable Integer expiryDays) { + this.expiryDays = expiryDays; + return this; + } + + /** + * Number of days after which the Password expires + * @return expiryDays + */ + @javax.annotation.Nullable + public Integer getExpiryDays() { + return expiryDays; + } + + public void setExpiryDays(@javax.annotation.Nullable Integer expiryDays) { + this.expiryDays = expiryDays; + } + + + public OrganizationsPolicyBasePasswordPolicy maxLength(@javax.annotation.Nullable Integer maxLength) { + this.maxLength = maxLength; + return this; + } + + /** + * Maximum length of the Password + * @return maxLength + */ + @javax.annotation.Nullable + public Integer getMaxLength() { + return maxLength; + } + + public void setMaxLength(@javax.annotation.Nullable Integer maxLength) { + this.maxLength = maxLength; + } + + + public OrganizationsPolicyBasePasswordPolicy minLength(@javax.annotation.Nullable Integer minLength) { + this.minLength = minLength; + return this; + } + + /** + * Minimum length of the Password + * @return minLength + */ + @javax.annotation.Nullable + public Integer getMinLength() { + return minLength; + } + + public void setMinLength(@javax.annotation.Nullable Integer minLength) { + this.minLength = minLength; + } + + + public OrganizationsPolicyBasePasswordPolicy requireLowercase(@javax.annotation.Nullable Boolean requireLowercase) { + this.requireLowercase = requireLowercase; + return this; + } + + /** + * Indicates if at least one lowercase letter is required in the Password + * @return requireLowercase + */ + @javax.annotation.Nullable + public Boolean getRequireLowercase() { + return requireLowercase; + } + + public void setRequireLowercase(@javax.annotation.Nullable Boolean requireLowercase) { + this.requireLowercase = requireLowercase; + } + + + public OrganizationsPolicyBasePasswordPolicy requireNumber(@javax.annotation.Nullable Boolean requireNumber) { + this.requireNumber = requireNumber; + return this; + } + + /** + * Indicates if at least one number is required in the Password + * @return requireNumber + */ + @javax.annotation.Nullable + public Boolean getRequireNumber() { + return requireNumber; + } + + public void setRequireNumber(@javax.annotation.Nullable Boolean requireNumber) { + this.requireNumber = requireNumber; + } + + + public OrganizationsPolicyBasePasswordPolicy requireSpecialChar(@javax.annotation.Nullable Boolean requireSpecialChar) { + this.requireSpecialChar = requireSpecialChar; + return this; + } + + /** + * Indicates if at least one special character is required in the Password + * @return requireSpecialChar + */ + @javax.annotation.Nullable + public Boolean getRequireSpecialChar() { + return requireSpecialChar; + } + + public void setRequireSpecialChar(@javax.annotation.Nullable Boolean requireSpecialChar) { + this.requireSpecialChar = requireSpecialChar; + } + + + public OrganizationsPolicyBasePasswordPolicy requireUppercase(@javax.annotation.Nullable Boolean requireUppercase) { + this.requireUppercase = requireUppercase; + return this; + } + + /** + * Indicates if at least one uppercase letter is required in the Password + * @return requireUppercase + */ + @javax.annotation.Nullable + public Boolean getRequireUppercase() { + return requireUppercase; + } + + public void setRequireUppercase(@javax.annotation.Nullable Boolean requireUppercase) { + this.requireUppercase = requireUppercase; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OrganizationsPolicyBasePasswordPolicy instance itself + */ + public OrganizationsPolicyBasePasswordPolicy putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationsPolicyBasePasswordPolicy organizationsPolicyBasePasswordPolicy = (OrganizationsPolicyBasePasswordPolicy) o; + return Objects.equals(this.expiryDays, organizationsPolicyBasePasswordPolicy.expiryDays) && + Objects.equals(this.maxLength, organizationsPolicyBasePasswordPolicy.maxLength) && + Objects.equals(this.minLength, organizationsPolicyBasePasswordPolicy.minLength) && + Objects.equals(this.requireLowercase, organizationsPolicyBasePasswordPolicy.requireLowercase) && + Objects.equals(this.requireNumber, organizationsPolicyBasePasswordPolicy.requireNumber) && + Objects.equals(this.requireSpecialChar, organizationsPolicyBasePasswordPolicy.requireSpecialChar) && + Objects.equals(this.requireUppercase, organizationsPolicyBasePasswordPolicy.requireUppercase)&& + Objects.equals(this.additionalProperties, organizationsPolicyBasePasswordPolicy.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(expiryDays, maxLength, minLength, requireLowercase, requireNumber, requireSpecialChar, requireUppercase, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrganizationsPolicyBasePasswordPolicy {\n"); + sb.append(" expiryDays: ").append(toIndentedString(expiryDays)).append("\n"); + sb.append(" maxLength: ").append(toIndentedString(maxLength)).append("\n"); + sb.append(" minLength: ").append(toIndentedString(minLength)).append("\n"); + sb.append(" requireLowercase: ").append(toIndentedString(requireLowercase)).append("\n"); + sb.append(" requireNumber: ").append(toIndentedString(requireNumber)).append("\n"); + sb.append(" requireSpecialChar: ").append(toIndentedString(requireSpecialChar)).append("\n"); + sb.append(" requireUppercase: ").append(toIndentedString(requireUppercase)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ExpiryDays"); + openapiFields.add("MaxLength"); + openapiFields.add("MinLength"); + openapiFields.add("RequireLowercase"); + openapiFields.add("RequireNumber"); + openapiFields.add("RequireSpecialChar"); + openapiFields.add("RequireUppercase"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OrganizationsPolicyBasePasswordPolicy + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrganizationsPolicyBasePasswordPolicy.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationsPolicyBasePasswordPolicy is not found in the empty JSON string", OrganizationsPolicyBasePasswordPolicy.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OrganizationsPolicyBasePasswordPolicy.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrganizationsPolicyBasePasswordPolicy' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OrganizationsPolicyBasePasswordPolicy> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OrganizationsPolicyBasePasswordPolicy.class)); + + return (TypeAdapter<T>) new TypeAdapter<OrganizationsPolicyBasePasswordPolicy>() { + @Override + public void write(JsonWriter out, OrganizationsPolicyBasePasswordPolicy value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OrganizationsPolicyBasePasswordPolicy read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OrganizationsPolicyBasePasswordPolicy instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OrganizationsPolicyBasePasswordPolicy given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganizationsPolicyBasePasswordPolicy + * @throws IOException if the JSON string is invalid with respect to OrganizationsPolicyBasePasswordPolicy + */ + public static OrganizationsPolicyBasePasswordPolicy fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrganizationsPolicyBasePasswordPolicy.class); + } + + /** + * Convert an instance of OrganizationsPolicyBasePasswordPolicy to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsPolicyBaseSessionPolicy.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsPolicyBaseSessionPolicy.java new file mode 100644 index 0000000..ba87303 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsPolicyBaseSessionPolicy.java @@ -0,0 +1,311 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * Session policy for the organization + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OrganizationsPolicyBaseSessionPolicy { + public static final String SERIALIZED_NAME_ACCESS_TOKEN_T_T_L = "AccessTokenTTL"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN_T_T_L) + @javax.annotation.Nullable + private Integer accessTokenTTL; + + public static final String SERIALIZED_NAME_REFRESH_TOKEN_T_T_L = "RefreshTokenTTL"; + @SerializedName(SERIALIZED_NAME_REFRESH_TOKEN_T_T_L) + @javax.annotation.Nullable + private Integer refreshTokenTTL; + + public OrganizationsPolicyBaseSessionPolicy() { + } + + public OrganizationsPolicyBaseSessionPolicy accessTokenTTL(@javax.annotation.Nullable Integer accessTokenTTL) { + this.accessTokenTTL = accessTokenTTL; + return this; + } + + /** + * Time-to-live (TTL) for Access Tokens in seconds + * @return accessTokenTTL + */ + @javax.annotation.Nullable + public Integer getAccessTokenTTL() { + return accessTokenTTL; + } + + public void setAccessTokenTTL(@javax.annotation.Nullable Integer accessTokenTTL) { + this.accessTokenTTL = accessTokenTTL; + } + + + public OrganizationsPolicyBaseSessionPolicy refreshTokenTTL(@javax.annotation.Nullable Integer refreshTokenTTL) { + this.refreshTokenTTL = refreshTokenTTL; + return this; + } + + /** + * Time-to-live (TTL) for refresh tokens in seconds + * @return refreshTokenTTL + */ + @javax.annotation.Nullable + public Integer getRefreshTokenTTL() { + return refreshTokenTTL; + } + + public void setRefreshTokenTTL(@javax.annotation.Nullable Integer refreshTokenTTL) { + this.refreshTokenTTL = refreshTokenTTL; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OrganizationsPolicyBaseSessionPolicy instance itself + */ + public OrganizationsPolicyBaseSessionPolicy putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationsPolicyBaseSessionPolicy organizationsPolicyBaseSessionPolicy = (OrganizationsPolicyBaseSessionPolicy) o; + return Objects.equals(this.accessTokenTTL, organizationsPolicyBaseSessionPolicy.accessTokenTTL) && + Objects.equals(this.refreshTokenTTL, organizationsPolicyBaseSessionPolicy.refreshTokenTTL)&& + Objects.equals(this.additionalProperties, organizationsPolicyBaseSessionPolicy.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accessTokenTTL, refreshTokenTTL, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrganizationsPolicyBaseSessionPolicy {\n"); + sb.append(" accessTokenTTL: ").append(toIndentedString(accessTokenTTL)).append("\n"); + sb.append(" refreshTokenTTL: ").append(toIndentedString(refreshTokenTTL)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AccessTokenTTL"); + openapiFields.add("RefreshTokenTTL"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OrganizationsPolicyBaseSessionPolicy + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrganizationsPolicyBaseSessionPolicy.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationsPolicyBaseSessionPolicy is not found in the empty JSON string", OrganizationsPolicyBaseSessionPolicy.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OrganizationsPolicyBaseSessionPolicy.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrganizationsPolicyBaseSessionPolicy' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OrganizationsPolicyBaseSessionPolicy> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OrganizationsPolicyBaseSessionPolicy.class)); + + return (TypeAdapter<T>) new TypeAdapter<OrganizationsPolicyBaseSessionPolicy>() { + @Override + public void write(JsonWriter out, OrganizationsPolicyBaseSessionPolicy value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OrganizationsPolicyBaseSessionPolicy read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OrganizationsPolicyBaseSessionPolicy instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OrganizationsPolicyBaseSessionPolicy given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganizationsPolicyBaseSessionPolicy + * @throws IOException if the JSON string is invalid with respect to OrganizationsPolicyBaseSessionPolicy + */ + public static OrganizationsPolicyBaseSessionPolicy fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrganizationsPolicyBaseSessionPolicy.class); + } + + /** + * Convert an instance of OrganizationsPolicyBaseSessionPolicy to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsResponse.java new file mode 100644 index 0000000..f8d046e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsResponse.java @@ -0,0 +1,614 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ConnectionResponse; +import com.loginradius.sdk.internal.openapi.model.OrganizationBaseDisplay; +import com.loginradius.sdk.internal.openapi.model.OrganizationsDomainsResponse; +import com.loginradius.sdk.internal.openapi.model.OrganizationsPolicyBase; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * OrganizationsResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OrganizationsResponse { + public static final String SERIALIZED_NAME_DISPLAY = "Display"; + @SerializedName(SERIALIZED_NAME_DISPLAY) + @javax.annotation.Nullable + private OrganizationBaseDisplay display; + + public static final String SERIALIZED_NAME_DOMAINS = "Domains"; + @SerializedName(SERIALIZED_NAME_DOMAINS) + @javax.annotation.Nullable + private List<OrganizationsDomainsResponse> domains; + + public static final String SERIALIZED_NAME_METADATA = "Metadata"; + @SerializedName(SERIALIZED_NAME_METADATA) + @javax.annotation.Nullable + private Map<String, String> metadata = new HashMap<>(); + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_CONNECTIONS = "Connections"; + @SerializedName(SERIALIZED_NAME_CONNECTIONS) + @javax.annotation.Nullable + private List<ConnectionResponse> connections; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_IS_ACTIVE = "IsActive"; + @SerializedName(SERIALIZED_NAME_IS_ACTIVE) + @javax.annotation.Nullable + private Boolean isActive; + + public static final String SERIALIZED_NAME_MODIFIED_DATE = "ModifiedDate"; + @SerializedName(SERIALIZED_NAME_MODIFIED_DATE) + @javax.annotation.Nullable + private OffsetDateTime modifiedDate; + + public static final String SERIALIZED_NAME_POLICIES = "Policies"; + @SerializedName(SERIALIZED_NAME_POLICIES) + @javax.annotation.Nullable + private OrganizationsPolicyBase policies; + + public OrganizationsResponse() { + } + + public OrganizationsResponse display(@javax.annotation.Nullable OrganizationBaseDisplay display) { + this.display = display; + return this; + } + + /** + * Get display + * @return display + */ + @javax.annotation.Nullable + public OrganizationBaseDisplay getDisplay() { + return display; + } + + public void setDisplay(@javax.annotation.Nullable OrganizationBaseDisplay display) { + this.display = display; + } + + + public OrganizationsResponse domains(@javax.annotation.Nullable List<OrganizationsDomainsResponse> domains) { + this.domains = domains; + return this; + } + + public OrganizationsResponse addDomainsItem(OrganizationsDomainsResponse domainsItem) { + if (this.domains == null) { + this.domains = new ArrayList<>(); + } + this.domains.add(domainsItem); + return this; + } + + /** + * List of domains associated with the organization + * @return domains + */ + @javax.annotation.Nullable + public List<OrganizationsDomainsResponse> getDomains() { + return domains; + } + + public void setDomains(@javax.annotation.Nullable List<OrganizationsDomainsResponse> domains) { + this.domains = domains; + } + + + public OrganizationsResponse metadata(@javax.annotation.Nullable Map<String, String> metadata) { + this.metadata = metadata; + return this; + } + + public OrganizationsResponse putMetadataItem(String key, String metadataItem) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, metadataItem); + return this; + } + + /** + * Additional metadata for the organization + * @return metadata + */ + @javax.annotation.Nullable + public Map<String, String> getMetadata() { + return metadata; + } + + public void setMetadata(@javax.annotation.Nullable Map<String, String> metadata) { + this.metadata = metadata; + } + + + public OrganizationsResponse name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Name of the organization + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public OrganizationsResponse connections(@javax.annotation.Nullable List<ConnectionResponse> connections) { + this.connections = connections; + return this; + } + + public OrganizationsResponse addConnectionsItem(ConnectionResponse connectionsItem) { + if (this.connections == null) { + this.connections = new ArrayList<>(); + } + this.connections.add(connectionsItem); + return this; + } + + /** + * List of connections associated with the organization + * @return connections + */ + @javax.annotation.Nullable + public List<ConnectionResponse> getConnections() { + return connections; + } + + public void setConnections(@javax.annotation.Nullable List<ConnectionResponse> connections) { + this.connections = connections; + } + + + public OrganizationsResponse createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Date when the organization was created + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + + public OrganizationsResponse id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the organization + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public OrganizationsResponse isActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Indicates whether the organization is active + * @return isActive + */ + @javax.annotation.Nullable + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + } + + + public OrganizationsResponse modifiedDate(@javax.annotation.Nullable OffsetDateTime modifiedDate) { + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Date when the organization was last modified + * @return modifiedDate + */ + @javax.annotation.Nullable + public OffsetDateTime getModifiedDate() { + return modifiedDate; + } + + public void setModifiedDate(@javax.annotation.Nullable OffsetDateTime modifiedDate) { + this.modifiedDate = modifiedDate; + } + + + public OrganizationsResponse policies(@javax.annotation.Nullable OrganizationsPolicyBase policies) { + this.policies = policies; + return this; + } + + /** + * Get policies + * @return policies + */ + @javax.annotation.Nullable + public OrganizationsPolicyBase getPolicies() { + return policies; + } + + public void setPolicies(@javax.annotation.Nullable OrganizationsPolicyBase policies) { + this.policies = policies; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OrganizationsResponse instance itself + */ + public OrganizationsResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationsResponse organizationsResponse = (OrganizationsResponse) o; + return Objects.equals(this.display, organizationsResponse.display) && + Objects.equals(this.domains, organizationsResponse.domains) && + Objects.equals(this.metadata, organizationsResponse.metadata) && + Objects.equals(this.name, organizationsResponse.name) && + Objects.equals(this.connections, organizationsResponse.connections) && + Objects.equals(this.createdDate, organizationsResponse.createdDate) && + Objects.equals(this.id, organizationsResponse.id) && + Objects.equals(this.isActive, organizationsResponse.isActive) && + Objects.equals(this.modifiedDate, organizationsResponse.modifiedDate) && + Objects.equals(this.policies, organizationsResponse.policies)&& + Objects.equals(this.additionalProperties, organizationsResponse.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(display, domains, metadata, name, connections, createdDate, id, isActive, modifiedDate, policies, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrganizationsResponse {\n"); + sb.append(" display: ").append(toIndentedString(display)).append("\n"); + sb.append(" domains: ").append(toIndentedString(domains)).append("\n"); + sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" connections: ").append(toIndentedString(connections)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" modifiedDate: ").append(toIndentedString(modifiedDate)).append("\n"); + sb.append(" policies: ").append(toIndentedString(policies)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Display"); + openapiFields.add("Domains"); + openapiFields.add("Metadata"); + openapiFields.add("Name"); + openapiFields.add("Connections"); + openapiFields.add("CreatedDate"); + openapiFields.add("Id"); + openapiFields.add("IsActive"); + openapiFields.add("ModifiedDate"); + openapiFields.add("Policies"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OrganizationsResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrganizationsResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationsResponse is not found in the empty JSON string", OrganizationsResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `Display` + if (jsonObj.get("Display") != null && !jsonObj.get("Display").isJsonNull()) { + OrganizationBaseDisplay.validateJsonElement(jsonObj.get("Display")); + } + if (jsonObj.get("Domains") != null && !jsonObj.get("Domains").isJsonNull()) { + JsonArray jsonArraydomains = jsonObj.getAsJsonArray("Domains"); + if (jsonArraydomains != null) { + // ensure the json data is an array + if (!jsonObj.get("Domains").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Domains` to be an array in the JSON string but got `%s`", jsonObj.get("Domains").toString())); + } + + // validate the optional field `Domains` (array) + for (int i = 0; i < jsonArraydomains.size(); i++) { + OrganizationsDomainsResponse.validateJsonElement(jsonArraydomains.get(i)); + }; + } + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Connections") != null && !jsonObj.get("Connections").isJsonNull()) { + JsonArray jsonArrayconnections = jsonObj.getAsJsonArray("Connections"); + if (jsonArrayconnections != null) { + // ensure the json data is an array + if (!jsonObj.get("Connections").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Connections` to be an array in the JSON string but got `%s`", jsonObj.get("Connections").toString())); + } + + // validate the optional field `Connections` (array) + for (int i = 0; i < jsonArrayconnections.size(); i++) { + ConnectionResponse.validateJsonElement(jsonArrayconnections.get(i)); + }; + } + } + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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())); + } + // validate the optional field `Policies` + if (jsonObj.get("Policies") != null && !jsonObj.get("Policies").isJsonNull()) { + OrganizationsPolicyBase.validateJsonElement(jsonObj.get("Policies")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OrganizationsResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrganizationsResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OrganizationsResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OrganizationsResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<OrganizationsResponse>() { + @Override + public void write(JsonWriter out, OrganizationsResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OrganizationsResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OrganizationsResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OrganizationsResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganizationsResponse + * @throws IOException if the JSON string is invalid with respect to OrganizationsResponse + */ + public static OrganizationsResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrganizationsResponse.class); + } + + /** + * Convert an instance of OrganizationsResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsResponseCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsResponseCore.java new file mode 100644 index 0000000..b6d53a4 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/OrganizationsResponseCore.java @@ -0,0 +1,515 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ConnectionResponse; +import com.loginradius.sdk.internal.openapi.model.OrganizationsDomainsResponse; +import com.loginradius.sdk.internal.openapi.model.OrganizationsPolicyBase; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * OrganizationsResponseCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class OrganizationsResponseCore { + public static final String SERIALIZED_NAME_CONNECTIONS = "Connections"; + @SerializedName(SERIALIZED_NAME_CONNECTIONS) + @javax.annotation.Nullable + private List<ConnectionResponse> connections; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public static final String SERIALIZED_NAME_DOMAINS = "Domains"; + @SerializedName(SERIALIZED_NAME_DOMAINS) + @javax.annotation.Nullable + private List<OrganizationsDomainsResponse> domains; + + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_IS_ACTIVE = "IsActive"; + @SerializedName(SERIALIZED_NAME_IS_ACTIVE) + @javax.annotation.Nullable + private Boolean isActive; + + public static final String SERIALIZED_NAME_MODIFIED_DATE = "ModifiedDate"; + @SerializedName(SERIALIZED_NAME_MODIFIED_DATE) + @javax.annotation.Nullable + private OffsetDateTime modifiedDate; + + public static final String SERIALIZED_NAME_POLICIES = "Policies"; + @SerializedName(SERIALIZED_NAME_POLICIES) + @javax.annotation.Nullable + private OrganizationsPolicyBase policies; + + public OrganizationsResponseCore() { + } + + public OrganizationsResponseCore connections(@javax.annotation.Nullable List<ConnectionResponse> connections) { + this.connections = connections; + return this; + } + + public OrganizationsResponseCore addConnectionsItem(ConnectionResponse connectionsItem) { + if (this.connections == null) { + this.connections = new ArrayList<>(); + } + this.connections.add(connectionsItem); + return this; + } + + /** + * List of connections associated with the organization + * @return connections + */ + @javax.annotation.Nullable + public List<ConnectionResponse> getConnections() { + return connections; + } + + public void setConnections(@javax.annotation.Nullable List<ConnectionResponse> connections) { + this.connections = connections; + } + + + public OrganizationsResponseCore createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Date when the organization was created + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + + public OrganizationsResponseCore domains(@javax.annotation.Nullable List<OrganizationsDomainsResponse> domains) { + this.domains = domains; + return this; + } + + public OrganizationsResponseCore addDomainsItem(OrganizationsDomainsResponse domainsItem) { + if (this.domains == null) { + this.domains = new ArrayList<>(); + } + this.domains.add(domainsItem); + return this; + } + + /** + * List of domains associated with the organization + * @return domains + */ + @javax.annotation.Nullable + public List<OrganizationsDomainsResponse> getDomains() { + return domains; + } + + public void setDomains(@javax.annotation.Nullable List<OrganizationsDomainsResponse> domains) { + this.domains = domains; + } + + + public OrganizationsResponseCore id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the organization + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public OrganizationsResponseCore isActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Indicates whether the organization is active + * @return isActive + */ + @javax.annotation.Nullable + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + } + + + public OrganizationsResponseCore modifiedDate(@javax.annotation.Nullable OffsetDateTime modifiedDate) { + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Date when the organization was last modified + * @return modifiedDate + */ + @javax.annotation.Nullable + public OffsetDateTime getModifiedDate() { + return modifiedDate; + } + + public void setModifiedDate(@javax.annotation.Nullable OffsetDateTime modifiedDate) { + this.modifiedDate = modifiedDate; + } + + + public OrganizationsResponseCore policies(@javax.annotation.Nullable OrganizationsPolicyBase policies) { + this.policies = policies; + return this; + } + + /** + * Get policies + * @return policies + */ + @javax.annotation.Nullable + public OrganizationsPolicyBase getPolicies() { + return policies; + } + + public void setPolicies(@javax.annotation.Nullable OrganizationsPolicyBase policies) { + this.policies = policies; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the OrganizationsResponseCore instance itself + */ + public OrganizationsResponseCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OrganizationsResponseCore organizationsResponseCore = (OrganizationsResponseCore) o; + return Objects.equals(this.connections, organizationsResponseCore.connections) && + Objects.equals(this.createdDate, organizationsResponseCore.createdDate) && + Objects.equals(this.domains, organizationsResponseCore.domains) && + Objects.equals(this.id, organizationsResponseCore.id) && + Objects.equals(this.isActive, organizationsResponseCore.isActive) && + Objects.equals(this.modifiedDate, organizationsResponseCore.modifiedDate) && + Objects.equals(this.policies, organizationsResponseCore.policies)&& + Objects.equals(this.additionalProperties, organizationsResponseCore.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(connections, createdDate, domains, id, isActive, modifiedDate, policies, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OrganizationsResponseCore {\n"); + sb.append(" connections: ").append(toIndentedString(connections)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" domains: ").append(toIndentedString(domains)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" modifiedDate: ").append(toIndentedString(modifiedDate)).append("\n"); + sb.append(" policies: ").append(toIndentedString(policies)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Connections"); + openapiFields.add("CreatedDate"); + openapiFields.add("Domains"); + openapiFields.add("Id"); + openapiFields.add("IsActive"); + openapiFields.add("ModifiedDate"); + openapiFields.add("Policies"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 OrganizationsResponseCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!OrganizationsResponseCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in OrganizationsResponseCore is not found in the empty JSON string", OrganizationsResponseCore.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Connections") != null && !jsonObj.get("Connections").isJsonNull()) { + JsonArray jsonArrayconnections = jsonObj.getAsJsonArray("Connections"); + if (jsonArrayconnections != null) { + // ensure the json data is an array + if (!jsonObj.get("Connections").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Connections` to be an array in the JSON string but got `%s`", jsonObj.get("Connections").toString())); + } + + // validate the optional field `Connections` (array) + for (int i = 0; i < jsonArrayconnections.size(); i++) { + ConnectionResponse.validateJsonElement(jsonArrayconnections.get(i)); + }; + } + } + if (jsonObj.get("Domains") != null && !jsonObj.get("Domains").isJsonNull()) { + JsonArray jsonArraydomains = jsonObj.getAsJsonArray("Domains"); + if (jsonArraydomains != null) { + // ensure the json data is an array + if (!jsonObj.get("Domains").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Domains` to be an array in the JSON string but got `%s`", jsonObj.get("Domains").toString())); + } + + // validate the optional field `Domains` (array) + for (int i = 0; i < jsonArraydomains.size(); i++) { + OrganizationsDomainsResponse.validateJsonElement(jsonArraydomains.get(i)); + }; + } + } + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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())); + } + // validate the optional field `Policies` + if (jsonObj.get("Policies") != null && !jsonObj.get("Policies").isJsonNull()) { + OrganizationsPolicyBase.validateJsonElement(jsonObj.get("Policies")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!OrganizationsResponseCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'OrganizationsResponseCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<OrganizationsResponseCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(OrganizationsResponseCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<OrganizationsResponseCore>() { + @Override + public void write(JsonWriter out, OrganizationsResponseCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public OrganizationsResponseCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + OrganizationsResponseCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of OrganizationsResponseCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of OrganizationsResponseCore + * @throws IOException if the JSON string is invalid with respect to OrganizationsResponseCore + */ + public static OrganizationsResponseCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, OrganizationsResponseCore.class); + } + + /** + * Convert an instance of OrganizationsResponseCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PARRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PARRequest.java new file mode 100644 index 0000000..ad99027 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PARRequest.java @@ -0,0 +1,1129 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.net.URI; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * PARRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PARRequest { + public static final String SERIALIZED_NAME_CLIENT_ID = "client_id"; + @SerializedName(SERIALIZED_NAME_CLIENT_ID) + @javax.annotation.Nonnull + private String clientId; + + public static final String SERIALIZED_NAME_CLIENT_SECRET = "client_secret"; + @SerializedName(SERIALIZED_NAME_CLIENT_SECRET) + @javax.annotation.Nullable + private String clientSecret; + + public static final String SERIALIZED_NAME_REDIRECT_URI = "redirect_uri"; + @SerializedName(SERIALIZED_NAME_REDIRECT_URI) + @javax.annotation.Nonnull + private URI redirectUri; + + public static final String SERIALIZED_NAME_RESPONSE_TYPE = "response_type"; + @SerializedName(SERIALIZED_NAME_RESPONSE_TYPE) + @javax.annotation.Nonnull + private String responseType; + + public static final String SERIALIZED_NAME_SCOPE = "scope"; + @SerializedName(SERIALIZED_NAME_SCOPE) + @javax.annotation.Nonnull + private String scope; + + public static final String SERIALIZED_NAME_STATE = "state"; + @SerializedName(SERIALIZED_NAME_STATE) + @javax.annotation.Nullable + private String state; + + public static final String SERIALIZED_NAME_NONCE = "nonce"; + @SerializedName(SERIALIZED_NAME_NONCE) + @javax.annotation.Nullable + private String nonce; + + public static final String SERIALIZED_NAME_CODE_CHALLENGE = "code_challenge"; + @SerializedName(SERIALIZED_NAME_CODE_CHALLENGE) + @javax.annotation.Nullable + private String codeChallenge; + + /** + * PKCE code challenge transformation method. + */ + @JsonAdapter(CodeChallengeMethodEnum.Adapter.class) + public enum CodeChallengeMethodEnum { + PLAIN("plain"), + + S256("S256"); + + private String value; + + CodeChallengeMethodEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static CodeChallengeMethodEnum fromValue(String value) { + for (CodeChallengeMethodEnum b : CodeChallengeMethodEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<CodeChallengeMethodEnum> { + @Override + public void write(final JsonWriter jsonWriter, final CodeChallengeMethodEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public CodeChallengeMethodEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return CodeChallengeMethodEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + CodeChallengeMethodEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CODE_CHALLENGE_METHOD = "code_challenge_method"; + @SerializedName(SERIALIZED_NAME_CODE_CHALLENGE_METHOD) + @javax.annotation.Nullable + private CodeChallengeMethodEnum codeChallengeMethod; + + /** + * Mechanism for returning authorization response parameters to the client. + */ + @JsonAdapter(ResponseModeEnum.Adapter.class) + public enum ResponseModeEnum { + QUERY("query"), + + FRAGMENT("fragment"), + + FORM_POST("form_post"); + + private String value; + + ResponseModeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ResponseModeEnum fromValue(String value) { + for (ResponseModeEnum b : ResponseModeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<ResponseModeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final ResponseModeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ResponseModeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ResponseModeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ResponseModeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_RESPONSE_MODE = "response_mode"; + @SerializedName(SERIALIZED_NAME_RESPONSE_MODE) + @javax.annotation.Nullable + private ResponseModeEnum responseMode; + + /** + * Controls whether the authorization server prompts the user for re-authentication. + */ + @JsonAdapter(PromptEnum.Adapter.class) + public enum PromptEnum { + LOGIN("login"), + + NONE("none"); + + private String value; + + PromptEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PromptEnum fromValue(String value) { + for (PromptEnum b : PromptEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<PromptEnum> { + @Override + public void write(final JsonWriter jsonWriter, final PromptEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PromptEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PromptEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PromptEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_PROMPT = "prompt"; + @SerializedName(SERIALIZED_NAME_PROMPT) + @javax.annotation.Nullable + private PromptEnum prompt; + + /** + * How the authorization server displays the authentication UI to the end-user. + */ + @JsonAdapter(DisplayEnum.Adapter.class) + public enum DisplayEnum { + PAGE("page"), + + POPUP("popup"), + + TOUCH("touch"), + + WAP("wap"); + + private String value; + + DisplayEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static DisplayEnum fromValue(String value) { + for (DisplayEnum b : DisplayEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<DisplayEnum> { + @Override + public void write(final JsonWriter jsonWriter, final DisplayEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public DisplayEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return DisplayEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + DisplayEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_DISPLAY = "display"; + @SerializedName(SERIALIZED_NAME_DISPLAY) + @javax.annotation.Nullable + private DisplayEnum display; + + public static final String SERIALIZED_NAME_MAX_AGE = "max_age"; + @SerializedName(SERIALIZED_NAME_MAX_AGE) + @javax.annotation.Nullable + private String maxAge; + + public static final String SERIALIZED_NAME_ACR_VALUES = "acr_values"; + @SerializedName(SERIALIZED_NAME_ACR_VALUES) + @javax.annotation.Nullable + private String acrValues; + + public static final String SERIALIZED_NAME_LOGIN_HINT = "login_hint"; + @SerializedName(SERIALIZED_NAME_LOGIN_HINT) + @javax.annotation.Nullable + private String loginHint; + + public static final String SERIALIZED_NAME_ID_TOKEN_HINT = "id_token_hint"; + @SerializedName(SERIALIZED_NAME_ID_TOKEN_HINT) + @javax.annotation.Nullable + private String idTokenHint; + + public static final String SERIALIZED_NAME_UI_LOCALES = "ui_locales"; + @SerializedName(SERIALIZED_NAME_UI_LOCALES) + @javax.annotation.Nullable + private String uiLocales; + + public static final String SERIALIZED_NAME_ORG_ID = "org_id"; + @SerializedName(SERIALIZED_NAME_ORG_ID) + @javax.annotation.Nullable + private String orgId; + + public static final String SERIALIZED_NAME_CLAIMS = "claims"; + @SerializedName(SERIALIZED_NAME_CLAIMS) + @javax.annotation.Nullable + private String claims; + + public static final String SERIALIZED_NAME_AUTHORIZATION_DETAILS = "authorization_details"; + @SerializedName(SERIALIZED_NAME_AUTHORIZATION_DETAILS) + @javax.annotation.Nullable + private String authorizationDetails; + + public static final String SERIALIZED_NAME_RESOURCE = "resource"; + @SerializedName(SERIALIZED_NAME_RESOURCE) + @javax.annotation.Nullable + private String resource; + + public PARRequest() { + } + + public PARRequest clientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + return this; + } + + /** + * OAuth 2.0 client identifier. + * @return clientId + */ + @javax.annotation.Nonnull + public String getClientId() { + return clientId; + } + + public void setClientId(@javax.annotation.Nonnull String clientId) { + this.clientId = clientId; + } + + + public PARRequest clientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + return this; + } + + /** + * Client secret. Optional when client credentials are provided via HTTP Basic Authentication in the Authorization header. + * @return clientSecret + */ + @javax.annotation.Nullable + public String getClientSecret() { + return clientSecret; + } + + public void setClientSecret(@javax.annotation.Nullable String clientSecret) { + this.clientSecret = clientSecret; + } + + + public PARRequest redirectUri(@javax.annotation.Nonnull URI redirectUri) { + this.redirectUri = redirectUri; + return this; + } + + /** + * Redirect URI registered for the client. + * @return redirectUri + */ + @javax.annotation.Nonnull + public URI getRedirectUri() { + return redirectUri; + } + + public void setRedirectUri(@javax.annotation.Nonnull URI redirectUri) { + this.redirectUri = redirectUri; + } + + + public PARRequest responseType(@javax.annotation.Nonnull String responseType) { + this.responseType = responseType; + return this; + } + + /** + * Space-separated list of desired response types. Valid values: code, token, id_token. + * @return responseType + */ + @javax.annotation.Nonnull + public String getResponseType() { + return responseType; + } + + public void setResponseType(@javax.annotation.Nonnull String responseType) { + this.responseType = responseType; + } + + + public PARRequest scope(@javax.annotation.Nonnull String scope) { + this.scope = scope; + return this; + } + + /** + * Space-separated list of requested scopes. Must include openid for OIDC flows. + * @return scope + */ + @javax.annotation.Nonnull + public String getScope() { + return scope; + } + + public void setScope(@javax.annotation.Nonnull String scope) { + this.scope = scope; + } + + + public PARRequest state(@javax.annotation.Nullable String state) { + this.state = state; + return this; + } + + /** + * Opaque value to maintain state between the request and the callback. + * @return state + */ + @javax.annotation.Nullable + public String getState() { + return state; + } + + public void setState(@javax.annotation.Nullable String state) { + this.state = state; + } + + + public PARRequest nonce(@javax.annotation.Nullable String nonce) { + this.nonce = nonce; + return this; + } + + /** + * String associating a client session with an ID Token. Required when response_type includes id_token. + * @return nonce + */ + @javax.annotation.Nullable + public String getNonce() { + return nonce; + } + + public void setNonce(@javax.annotation.Nullable String nonce) { + this.nonce = nonce; + } + + + public PARRequest codeChallenge(@javax.annotation.Nullable String codeChallenge) { + this.codeChallenge = codeChallenge; + return this; + } + + /** + * PKCE code challenge derived from the code_verifier (RFC 7636). + * @return codeChallenge + */ + @javax.annotation.Nullable + public String getCodeChallenge() { + return codeChallenge; + } + + public void setCodeChallenge(@javax.annotation.Nullable String codeChallenge) { + this.codeChallenge = codeChallenge; + } + + + public PARRequest codeChallengeMethod(@javax.annotation.Nullable CodeChallengeMethodEnum codeChallengeMethod) { + this.codeChallengeMethod = codeChallengeMethod; + return this; + } + + /** + * PKCE code challenge transformation method. + * @return codeChallengeMethod + */ + @javax.annotation.Nullable + public CodeChallengeMethodEnum getCodeChallengeMethod() { + return codeChallengeMethod; + } + + public void setCodeChallengeMethod(@javax.annotation.Nullable CodeChallengeMethodEnum codeChallengeMethod) { + this.codeChallengeMethod = codeChallengeMethod; + } + + + public PARRequest responseMode(@javax.annotation.Nullable ResponseModeEnum responseMode) { + this.responseMode = responseMode; + return this; + } + + /** + * Mechanism for returning authorization response parameters to the client. + * @return responseMode + */ + @javax.annotation.Nullable + public ResponseModeEnum getResponseMode() { + return responseMode; + } + + public void setResponseMode(@javax.annotation.Nullable ResponseModeEnum responseMode) { + this.responseMode = responseMode; + } + + + public PARRequest prompt(@javax.annotation.Nullable PromptEnum prompt) { + this.prompt = prompt; + return this; + } + + /** + * Controls whether the authorization server prompts the user for re-authentication. + * @return prompt + */ + @javax.annotation.Nullable + public PromptEnum getPrompt() { + return prompt; + } + + public void setPrompt(@javax.annotation.Nullable PromptEnum prompt) { + this.prompt = prompt; + } + + + public PARRequest display(@javax.annotation.Nullable DisplayEnum display) { + this.display = display; + return this; + } + + /** + * How the authorization server displays the authentication UI to the end-user. + * @return display + */ + @javax.annotation.Nullable + public DisplayEnum getDisplay() { + return display; + } + + public void setDisplay(@javax.annotation.Nullable DisplayEnum display) { + this.display = display; + } + + + public PARRequest maxAge(@javax.annotation.Nullable String maxAge) { + this.maxAge = maxAge; + return this; + } + + /** + * Maximum authentication age in seconds. Requires re-authentication if exceeded. + * @return maxAge + */ + @javax.annotation.Nullable + public String getMaxAge() { + return maxAge; + } + + public void setMaxAge(@javax.annotation.Nullable String maxAge) { + this.maxAge = maxAge; + } + + + public PARRequest acrValues(@javax.annotation.Nullable String acrValues) { + this.acrValues = acrValues; + return this; + } + + /** + * Space-separated list of requested Authentication Context Class Reference values. + * @return acrValues + */ + @javax.annotation.Nullable + public String getAcrValues() { + return acrValues; + } + + public void setAcrValues(@javax.annotation.Nullable String acrValues) { + this.acrValues = acrValues; + } + + + public PARRequest loginHint(@javax.annotation.Nullable String loginHint) { + this.loginHint = loginHint; + return this; + } + + /** + * Hint about the end-user login identifier (email or phone). + * @return loginHint + */ + @javax.annotation.Nullable + public String getLoginHint() { + return loginHint; + } + + public void setLoginHint(@javax.annotation.Nullable String loginHint) { + this.loginHint = loginHint; + } + + + public PARRequest idTokenHint(@javax.annotation.Nullable String idTokenHint) { + this.idTokenHint = idTokenHint; + return this; + } + + /** + * Previously issued ID Token passed as a hint about the authenticated end-user. + * @return idTokenHint + */ + @javax.annotation.Nullable + public String getIdTokenHint() { + return idTokenHint; + } + + public void setIdTokenHint(@javax.annotation.Nullable String idTokenHint) { + this.idTokenHint = idTokenHint; + } + + + public PARRequest uiLocales(@javax.annotation.Nullable String uiLocales) { + this.uiLocales = uiLocales; + return this; + } + + /** + * Space-separated list of preferred UI display locales. + * @return uiLocales + */ + @javax.annotation.Nullable + public String getUiLocales() { + return uiLocales; + } + + public void setUiLocales(@javax.annotation.Nullable String uiLocales) { + this.uiLocales = uiLocales; + } + + + public PARRequest orgId(@javax.annotation.Nullable String orgId) { + this.orgId = orgId; + return this; + } + + /** + * B2B organization identifier. Only valid when B2B features are enabled on the app. + * @return orgId + */ + @javax.annotation.Nullable + public String getOrgId() { + return orgId; + } + + public void setOrgId(@javax.annotation.Nullable String orgId) { + this.orgId = orgId; + } + + + public PARRequest claims(@javax.annotation.Nullable String claims) { + this.claims = claims; + return this; + } + + /** + * JSON-encoded claims request object specifying desired claims in the ID Token or userinfo response. + * @return claims + */ + @javax.annotation.Nullable + public String getClaims() { + return claims; + } + + public void setClaims(@javax.annotation.Nullable String claims) { + this.claims = claims; + } + + + public PARRequest authorizationDetails(@javax.annotation.Nullable String authorizationDetails) { + this.authorizationDetails = authorizationDetails; + return this; + } + + /** + * JSON-encoded array of authorization detail objects per RFC 9396 (Rich Authorization Requests). Requires RAR to be enabled on the application. + * @return authorizationDetails + */ + @javax.annotation.Nullable + public String getAuthorizationDetails() { + return authorizationDetails; + } + + public void setAuthorizationDetails(@javax.annotation.Nullable String authorizationDetails) { + this.authorizationDetails = authorizationDetails; + } + + + public PARRequest resource(@javax.annotation.Nullable String resource) { + this.resource = resource; + return this; + } + + /** + * Resource indicator (RFC 8707) identifying the target API. Must match a configured API resource on the authorization server. + * @return resource + */ + @javax.annotation.Nullable + public String getResource() { + return resource; + } + + public void setResource(@javax.annotation.Nullable String resource) { + this.resource = resource; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PARRequest instance itself + */ + public PARRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PARRequest paRRequest = (PARRequest) o; + return Objects.equals(this.clientId, paRRequest.clientId) && + Objects.equals(this.clientSecret, paRRequest.clientSecret) && + Objects.equals(this.redirectUri, paRRequest.redirectUri) && + Objects.equals(this.responseType, paRRequest.responseType) && + Objects.equals(this.scope, paRRequest.scope) && + Objects.equals(this.state, paRRequest.state) && + Objects.equals(this.nonce, paRRequest.nonce) && + Objects.equals(this.codeChallenge, paRRequest.codeChallenge) && + Objects.equals(this.codeChallengeMethod, paRRequest.codeChallengeMethod) && + Objects.equals(this.responseMode, paRRequest.responseMode) && + Objects.equals(this.prompt, paRRequest.prompt) && + Objects.equals(this.display, paRRequest.display) && + Objects.equals(this.maxAge, paRRequest.maxAge) && + Objects.equals(this.acrValues, paRRequest.acrValues) && + Objects.equals(this.loginHint, paRRequest.loginHint) && + Objects.equals(this.idTokenHint, paRRequest.idTokenHint) && + Objects.equals(this.uiLocales, paRRequest.uiLocales) && + Objects.equals(this.orgId, paRRequest.orgId) && + Objects.equals(this.claims, paRRequest.claims) && + Objects.equals(this.authorizationDetails, paRRequest.authorizationDetails) && + Objects.equals(this.resource, paRRequest.resource)&& + Objects.equals(this.additionalProperties, paRRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, clientSecret, redirectUri, responseType, scope, state, nonce, codeChallenge, codeChallengeMethod, responseMode, prompt, display, maxAge, acrValues, loginHint, idTokenHint, uiLocales, orgId, claims, authorizationDetails, resource, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PARRequest {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" clientSecret: ").append(toIndentedString(clientSecret)).append("\n"); + sb.append(" redirectUri: ").append(toIndentedString(redirectUri)).append("\n"); + sb.append(" responseType: ").append(toIndentedString(responseType)).append("\n"); + sb.append(" scope: ").append(toIndentedString(scope)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" nonce: ").append(toIndentedString(nonce)).append("\n"); + sb.append(" codeChallenge: ").append(toIndentedString(codeChallenge)).append("\n"); + sb.append(" codeChallengeMethod: ").append(toIndentedString(codeChallengeMethod)).append("\n"); + sb.append(" responseMode: ").append(toIndentedString(responseMode)).append("\n"); + sb.append(" prompt: ").append(toIndentedString(prompt)).append("\n"); + sb.append(" display: ").append(toIndentedString(display)).append("\n"); + sb.append(" maxAge: ").append(toIndentedString(maxAge)).append("\n"); + sb.append(" acrValues: ").append(toIndentedString(acrValues)).append("\n"); + sb.append(" loginHint: ").append(toIndentedString(loginHint)).append("\n"); + sb.append(" idTokenHint: ").append(toIndentedString(idTokenHint)).append("\n"); + sb.append(" uiLocales: ").append(toIndentedString(uiLocales)).append("\n"); + sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n"); + sb.append(" claims: ").append(toIndentedString(claims)).append("\n"); + sb.append(" authorizationDetails: ").append(toIndentedString(authorizationDetails)).append("\n"); + sb.append(" resource: ").append(toIndentedString(resource)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("client_id"); + openapiFields.add("client_secret"); + openapiFields.add("redirect_uri"); + openapiFields.add("response_type"); + openapiFields.add("scope"); + openapiFields.add("state"); + openapiFields.add("nonce"); + openapiFields.add("code_challenge"); + openapiFields.add("code_challenge_method"); + openapiFields.add("response_mode"); + openapiFields.add("prompt"); + openapiFields.add("display"); + openapiFields.add("max_age"); + openapiFields.add("acr_values"); + openapiFields.add("login_hint"); + openapiFields.add("id_token_hint"); + openapiFields.add("ui_locales"); + openapiFields.add("org_id"); + openapiFields.add("claims"); + openapiFields.add("authorization_details"); + openapiFields.add("resource"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("client_id"); + openapiRequiredFields.add("redirect_uri"); + openapiRequiredFields.add("response_type"); + openapiRequiredFields.add("scope"); + } + + /** + * 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 PARRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PARRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PARRequest is not found in the empty JSON string", PARRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PARRequest.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("client_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_id").toString())); + } + if ((jsonObj.get("client_secret") != null && !jsonObj.get("client_secret").isJsonNull()) && !jsonObj.get("client_secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `client_secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("client_secret").toString())); + } + if (!jsonObj.get("redirect_uri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `redirect_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("redirect_uri").toString())); + } + if (!jsonObj.get("response_type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `response_type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("response_type").toString())); + } + if (!jsonObj.get("scope").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `scope` to be a primitive type in the JSON string but got `%s`", jsonObj.get("scope").toString())); + } + if ((jsonObj.get("state") != null && !jsonObj.get("state").isJsonNull()) && !jsonObj.get("state").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `state` to be a primitive type in the JSON string but got `%s`", jsonObj.get("state").toString())); + } + if ((jsonObj.get("nonce") != null && !jsonObj.get("nonce").isJsonNull()) && !jsonObj.get("nonce").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `nonce` to be a primitive type in the JSON string but got `%s`", jsonObj.get("nonce").toString())); + } + if ((jsonObj.get("code_challenge") != null && !jsonObj.get("code_challenge").isJsonNull()) && !jsonObj.get("code_challenge").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `code_challenge` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code_challenge").toString())); + } + if ((jsonObj.get("code_challenge_method") != null && !jsonObj.get("code_challenge_method").isJsonNull()) && !jsonObj.get("code_challenge_method").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `code_challenge_method` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code_challenge_method").toString())); + } + // validate the optional field `code_challenge_method` + if (jsonObj.get("code_challenge_method") != null && !jsonObj.get("code_challenge_method").isJsonNull()) { + CodeChallengeMethodEnum.validateJsonElement(jsonObj.get("code_challenge_method")); + } + if ((jsonObj.get("response_mode") != null && !jsonObj.get("response_mode").isJsonNull()) && !jsonObj.get("response_mode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `response_mode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("response_mode").toString())); + } + // validate the optional field `response_mode` + if (jsonObj.get("response_mode") != null && !jsonObj.get("response_mode").isJsonNull()) { + ResponseModeEnum.validateJsonElement(jsonObj.get("response_mode")); + } + if ((jsonObj.get("prompt") != null && !jsonObj.get("prompt").isJsonNull()) && !jsonObj.get("prompt").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `prompt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("prompt").toString())); + } + // validate the optional field `prompt` + if (jsonObj.get("prompt") != null && !jsonObj.get("prompt").isJsonNull()) { + PromptEnum.validateJsonElement(jsonObj.get("prompt")); + } + if ((jsonObj.get("display") != null && !jsonObj.get("display").isJsonNull()) && !jsonObj.get("display").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `display` to be a primitive type in the JSON string but got `%s`", jsonObj.get("display").toString())); + } + // validate the optional field `display` + if (jsonObj.get("display") != null && !jsonObj.get("display").isJsonNull()) { + DisplayEnum.validateJsonElement(jsonObj.get("display")); + } + if ((jsonObj.get("max_age") != null && !jsonObj.get("max_age").isJsonNull()) && !jsonObj.get("max_age").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `max_age` to be a primitive type in the JSON string but got `%s`", jsonObj.get("max_age").toString())); + } + if ((jsonObj.get("acr_values") != null && !jsonObj.get("acr_values").isJsonNull()) && !jsonObj.get("acr_values").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `acr_values` to be a primitive type in the JSON string but got `%s`", jsonObj.get("acr_values").toString())); + } + if ((jsonObj.get("login_hint") != null && !jsonObj.get("login_hint").isJsonNull()) && !jsonObj.get("login_hint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `login_hint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("login_hint").toString())); + } + if ((jsonObj.get("id_token_hint") != null && !jsonObj.get("id_token_hint").isJsonNull()) && !jsonObj.get("id_token_hint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `id_token_hint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("id_token_hint").toString())); + } + if ((jsonObj.get("ui_locales") != null && !jsonObj.get("ui_locales").isJsonNull()) && !jsonObj.get("ui_locales").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ui_locales` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ui_locales").toString())); + } + if ((jsonObj.get("org_id") != null && !jsonObj.get("org_id").isJsonNull()) && !jsonObj.get("org_id").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `org_id` to be a primitive type in the JSON string but got `%s`", jsonObj.get("org_id").toString())); + } + if ((jsonObj.get("claims") != null && !jsonObj.get("claims").isJsonNull()) && !jsonObj.get("claims").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `claims` to be a primitive type in the JSON string but got `%s`", jsonObj.get("claims").toString())); + } + if ((jsonObj.get("authorization_details") != null && !jsonObj.get("authorization_details").isJsonNull()) && !jsonObj.get("authorization_details").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `authorization_details` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authorization_details").toString())); + } + if ((jsonObj.get("resource") != null && !jsonObj.get("resource").isJsonNull()) && !jsonObj.get("resource").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `resource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resource").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PARRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PARRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PARRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PARRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<PARRequest>() { + @Override + public void write(JsonWriter out, PARRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PARRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PARRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PARRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of PARRequest + * @throws IOException if the JSON string is invalid with respect to PARRequest + */ + public static PARRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PARRequest.class); + } + + /** + * Convert an instance of PARRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PARResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PARResponse.java new file mode 100644 index 0000000..80e2c2e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PARResponse.java @@ -0,0 +1,323 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * PARResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PARResponse { + public static final String SERIALIZED_NAME_REQUEST_URI = "request_uri"; + @SerializedName(SERIALIZED_NAME_REQUEST_URI) + @javax.annotation.Nonnull + private String requestUri; + + public static final String SERIALIZED_NAME_EXPIRES_IN = "expires_in"; + @SerializedName(SERIALIZED_NAME_EXPIRES_IN) + @javax.annotation.Nonnull + private Integer expiresIn; + + public PARResponse() { + } + + public PARResponse requestUri(@javax.annotation.Nonnull String requestUri) { + this.requestUri = requestUri; + return this; + } + + /** + * Opaque URI identifying the pushed authorization request. Pass this as the request_uri parameter in a subsequent authorization request. Valid for expires_in seconds from issuance. + * @return requestUri + */ + @javax.annotation.Nonnull + public String getRequestUri() { + return requestUri; + } + + public void setRequestUri(@javax.annotation.Nonnull String requestUri) { + this.requestUri = requestUri; + } + + + public PARResponse expiresIn(@javax.annotation.Nonnull Integer expiresIn) { + this.expiresIn = expiresIn; + return this; + } + + /** + * Lifetime of the request_uri in seconds. + * @return expiresIn + */ + @javax.annotation.Nonnull + public Integer getExpiresIn() { + return expiresIn; + } + + public void setExpiresIn(@javax.annotation.Nonnull Integer expiresIn) { + this.expiresIn = expiresIn; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PARResponse instance itself + */ + public PARResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PARResponse paRResponse = (PARResponse) o; + return Objects.equals(this.requestUri, paRResponse.requestUri) && + Objects.equals(this.expiresIn, paRResponse.expiresIn)&& + Objects.equals(this.additionalProperties, paRResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(requestUri, expiresIn, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PARResponse {\n"); + sb.append(" requestUri: ").append(toIndentedString(requestUri)).append("\n"); + sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("request_uri"); + openapiFields.add("expires_in"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("request_uri"); + openapiRequiredFields.add("expires_in"); + } + + /** + * 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 PARResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PARResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PARResponse is not found in the empty JSON string", PARResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PARResponse.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("request_uri").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `request_uri` to be a primitive type in the JSON string but got `%s`", jsonObj.get("request_uri").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PARResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PARResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PARResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PARResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<PARResponse>() { + @Override + public void write(JsonWriter out, PARResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PARResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PARResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PARResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of PARResponse + * @throws IOException if the JSON string is invalid with respect to PARResponse + */ + public static PARResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PARResponse.class); + } + + /** + * Convert an instance of PARResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PINLoginModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PINLoginModel.java new file mode 100644 index 0000000..e5901cd --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PINLoginModel.java @@ -0,0 +1,427 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * PINLoginModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PINLoginModel { + public static final String SERIALIZED_NAME_PIN = "pin"; + @SerializedName(SERIALIZED_NAME_PIN) + @javax.annotation.Nonnull + private String pin; + + public static final String SERIALIZED_NAME_G_RECAPTCHA_RESPONSE = "g-recaptcha-response"; + @SerializedName(SERIALIZED_NAME_G_RECAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String gRecaptchaResponse; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_TICKET = "qq_captcha_ticket"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_TICKET) + @javax.annotation.Nullable + private String qqCaptchaTicket; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR = "qq_captcha_randstr"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR) + @javax.annotation.Nullable + private String qqCaptchaRandstr; + + public static final String SERIALIZED_NAME_H_CAPTCHA_RESPONSE = "h-captcha-response"; + @SerializedName(SERIALIZED_NAME_H_CAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String hCaptchaResponse; + + public PINLoginModel() { + } + + public PINLoginModel pin(@javax.annotation.Nonnull String pin) { + this.pin = pin; + return this; + } + + /** + * PIN used to log in the User. + * @return pin + */ + @javax.annotation.Nonnull + public String getPin() { + return pin; + } + + public void setPin(@javax.annotation.Nonnull String pin) { + this.pin = pin; + } + + + public PINLoginModel gRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + return this; + } + + /** + * Google reCAPTCHA response. + * @return gRecaptchaResponse + */ + @javax.annotation.Nullable + public String getgRecaptchaResponse() { + return gRecaptchaResponse; + } + + public void setgRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + } + + + public PINLoginModel qqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + return this; + } + + /** + * QQ captcha ticket. + * @return qqCaptchaTicket + */ + @javax.annotation.Nullable + public String getQqCaptchaTicket() { + return qqCaptchaTicket; + } + + public void setQqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + } + + + public PINLoginModel qqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + return this; + } + + /** + * QQ captcha random string. + * @return qqCaptchaRandstr + */ + @javax.annotation.Nullable + public String getQqCaptchaRandstr() { + return qqCaptchaRandstr; + } + + public void setQqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + } + + + public PINLoginModel hCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + return this; + } + + /** + * hCaptcha response. + * @return hCaptchaResponse + */ + @javax.annotation.Nullable + public String gethCaptchaResponse() { + return hCaptchaResponse; + } + + public void sethCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PINLoginModel instance itself + */ + public PINLoginModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PINLoginModel piNLoginModel = (PINLoginModel) o; + return Objects.equals(this.pin, piNLoginModel.pin) && + Objects.equals(this.gRecaptchaResponse, piNLoginModel.gRecaptchaResponse) && + Objects.equals(this.qqCaptchaTicket, piNLoginModel.qqCaptchaTicket) && + Objects.equals(this.qqCaptchaRandstr, piNLoginModel.qqCaptchaRandstr) && + Objects.equals(this.hCaptchaResponse, piNLoginModel.hCaptchaResponse)&& + Objects.equals(this.additionalProperties, piNLoginModel.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(pin, gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PINLoginModel {\n"); + sb.append(" pin: ").append(toIndentedString(pin)).append("\n"); + sb.append(" gRecaptchaResponse: ").append(toIndentedString(gRecaptchaResponse)).append("\n"); + sb.append(" qqCaptchaTicket: ").append(toIndentedString(qqCaptchaTicket)).append("\n"); + sb.append(" qqCaptchaRandstr: ").append(toIndentedString(qqCaptchaRandstr)).append("\n"); + sb.append(" hCaptchaResponse: ").append(toIndentedString(hCaptchaResponse)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("pin"); + openapiFields.add("g-recaptcha-response"); + openapiFields.add("qq_captcha_ticket"); + openapiFields.add("qq_captcha_randstr"); + openapiFields.add("h-captcha-response"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("pin"); + } + + /** + * 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 PINLoginModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PINLoginModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PINLoginModel is not found in the empty JSON string", PINLoginModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PINLoginModel.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("pin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pin").toString())); + } + if ((jsonObj.get("g-recaptcha-response") != null && !jsonObj.get("g-recaptcha-response").isJsonNull()) && !jsonObj.get("g-recaptcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `g-recaptcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("g-recaptcha-response").toString())); + } + if ((jsonObj.get("qq_captcha_ticket") != null && !jsonObj.get("qq_captcha_ticket").isJsonNull()) && !jsonObj.get("qq_captcha_ticket").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_ticket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_ticket").toString())); + } + if ((jsonObj.get("qq_captcha_randstr") != null && !jsonObj.get("qq_captcha_randstr").isJsonNull()) && !jsonObj.get("qq_captcha_randstr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_randstr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_randstr").toString())); + } + if ((jsonObj.get("h-captcha-response") != null && !jsonObj.get("h-captcha-response").isJsonNull()) && !jsonObj.get("h-captcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `h-captcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("h-captcha-response").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PINLoginModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PINLoginModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PINLoginModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PINLoginModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<PINLoginModel>() { + @Override + public void write(JsonWriter out, PINLoginModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PINLoginModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PINLoginModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PINLoginModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of PINLoginModel + * @throws IOException if the JSON string is invalid with respect to PINLoginModel + */ + public static PINLoginModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PINLoginModel.class); + } + + /** + * Convert an instance of PINLoginModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PINModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PINModel.java new file mode 100644 index 0000000..b332a60 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PINModel.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * PINModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PINModel { + public static final String SERIALIZED_NAME_PIN = "pin"; + @SerializedName(SERIALIZED_NAME_PIN) + @javax.annotation.Nonnull + private String pin; + + public PINModel() { + } + + public PINModel pin(@javax.annotation.Nonnull String pin) { + this.pin = pin; + return this; + } + + /** + * New PIN to be set by the User. + * @return pin + */ + @javax.annotation.Nonnull + public String getPin() { + return pin; + } + + public void setPin(@javax.annotation.Nonnull String pin) { + this.pin = pin; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PINModel instance itself + */ + public PINModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PINModel piNModel = (PINModel) o; + return Objects.equals(this.pin, piNModel.pin)&& + Objects.equals(this.additionalProperties, piNModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(pin, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PINModel {\n"); + sb.append(" pin: ").append(toIndentedString(pin)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("pin"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("pin"); + } + + /** + * 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 PINModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PINModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PINModel is not found in the empty JSON string", PINModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PINModel.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("pin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pin").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PINModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PINModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PINModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PINModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<PINModel>() { + @Override + public void write(JsonWriter out, PINModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PINModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PINModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PINModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of PINModel + * @throws IOException if the JSON string is invalid with respect to PINModel + */ + public static PINModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PINModel.class); + } + + /** + * Convert an instance of PINModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PassKeyConfig.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PassKeyConfig.java new file mode 100644 index 0000000..6f9102f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PassKeyConfig.java @@ -0,0 +1,655 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.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.loginradius.sdk.internal.openapi.JSON; + +/** + * PassKeyConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PassKeyConfig { + public static final String SERIALIZED_NAME_IS_ENABLED = "IsEnabled"; + @SerializedName(SERIALIZED_NAME_IS_ENABLED) + @javax.annotation.Nonnull + private Boolean isEnabled; + + /** + * The type of PassKey selection. + */ + @JsonAdapter(PasskeySelectionEnum.Adapter.class) + public enum PasskeySelectionEnum { + AUTO_FILL("AutoFill"), + + BUTTON("Button"), + + BOTH("Both"); + + private String value; + + PasskeySelectionEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PasskeySelectionEnum fromValue(String value) { + for (PasskeySelectionEnum b : PasskeySelectionEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<PasskeySelectionEnum> { + @Override + public void write(final JsonWriter jsonWriter, final PasskeySelectionEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PasskeySelectionEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PasskeySelectionEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PasskeySelectionEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_PASSKEY_SELECTION = "PasskeySelection"; + @SerializedName(SERIALIZED_NAME_PASSKEY_SELECTION) + @javax.annotation.Nonnull + private PasskeySelectionEnum passkeySelection; + + public static final String SERIALIZED_NAME_PROGRESSIVE_ENROLLMENT = "ProgressiveEnrollment"; + @SerializedName(SERIALIZED_NAME_PROGRESSIVE_ENROLLMENT) + @javax.annotation.Nullable + private Boolean progressiveEnrollment; + + public static final String SERIALIZED_NAME_PROGRESSIVE_ENROLLMENT_DELAY = "ProgressiveEnrollmentDelay"; + @SerializedName(SERIALIZED_NAME_PROGRESSIVE_ENROLLMENT_DELAY) + @javax.annotation.Nullable + private Integer progressiveEnrollmentDelay; + + public static final String SERIALIZED_NAME_LOCAL_ENROLLMENT = "LocalEnrollment"; + @SerializedName(SERIALIZED_NAME_LOCAL_ENROLLMENT) + @javax.annotation.Nonnull + private Boolean localEnrollment; + + public static final String SERIALIZED_NAME_RP_DISPLAY_NAME = "RPDisplayName"; + @SerializedName(SERIALIZED_NAME_RP_DISPLAY_NAME) + @javax.annotation.Nonnull + private String rpDisplayName; + + public static final String SERIALIZED_NAME_R_P_I_D = "RPID"; + @SerializedName(SERIALIZED_NAME_R_P_I_D) + @javax.annotation.Nonnull + private String RPID; + + public static final String SERIALIZED_NAME_RP_ORIGINS = "RPOrigins"; + @SerializedName(SERIALIZED_NAME_RP_ORIGINS) + @javax.annotation.Nonnull + private List<String> rpOrigins = new ArrayList<>(); + + /** + * The type of PassKey Attestation flow. + */ + @JsonAdapter(AttestationEnum.Adapter.class) + public enum AttestationEnum { + NONE("none"), + + INDIRECT("indirect"), + + DIRECT("direct"); + + private String value; + + AttestationEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AttestationEnum fromValue(String value) { + for (AttestationEnum b : AttestationEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<AttestationEnum> { + @Override + public void write(final JsonWriter jsonWriter, final AttestationEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AttestationEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AttestationEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AttestationEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ATTESTATION = "Attestation"; + @SerializedName(SERIALIZED_NAME_ATTESTATION) + @javax.annotation.Nullable + private AttestationEnum attestation; + + public PassKeyConfig() { + } + + public PassKeyConfig isEnabled(@javax.annotation.Nonnull Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Whether PassKey is enabled. + * @return isEnabled + */ + @javax.annotation.Nonnull + public Boolean getIsEnabled() { + return isEnabled; + } + + public void setIsEnabled(@javax.annotation.Nonnull Boolean isEnabled) { + this.isEnabled = isEnabled; + } + + + public PassKeyConfig passkeySelection(@javax.annotation.Nonnull PasskeySelectionEnum passkeySelection) { + this.passkeySelection = passkeySelection; + return this; + } + + /** + * The type of PassKey selection. + * @return passkeySelection + */ + @javax.annotation.Nonnull + public PasskeySelectionEnum getPasskeySelection() { + return passkeySelection; + } + + public void setPasskeySelection(@javax.annotation.Nonnull PasskeySelectionEnum passkeySelection) { + this.passkeySelection = passkeySelection; + } + + + public PassKeyConfig progressiveEnrollment(@javax.annotation.Nullable Boolean progressiveEnrollment) { + this.progressiveEnrollment = progressiveEnrollment; + return this; + } + + /** + * Whether progressive enrollment is enabled. + * @return progressiveEnrollment + */ + @javax.annotation.Nullable + public Boolean getProgressiveEnrollment() { + return progressiveEnrollment; + } + + public void setProgressiveEnrollment(@javax.annotation.Nullable Boolean progressiveEnrollment) { + this.progressiveEnrollment = progressiveEnrollment; + } + + + public PassKeyConfig progressiveEnrollmentDelay(@javax.annotation.Nullable Integer progressiveEnrollmentDelay) { + this.progressiveEnrollmentDelay = progressiveEnrollmentDelay; + return this; + } + + /** + * Delay in minutes for progressive enrollment. + * @return progressiveEnrollmentDelay + */ + @javax.annotation.Nullable + public Integer getProgressiveEnrollmentDelay() { + return progressiveEnrollmentDelay; + } + + public void setProgressiveEnrollmentDelay(@javax.annotation.Nullable Integer progressiveEnrollmentDelay) { + this.progressiveEnrollmentDelay = progressiveEnrollmentDelay; + } + + + public PassKeyConfig localEnrollment(@javax.annotation.Nonnull Boolean localEnrollment) { + this.localEnrollment = localEnrollment; + return this; + } + + /** + * Whether local enrollment is enabled. + * @return localEnrollment + */ + @javax.annotation.Nonnull + public Boolean getLocalEnrollment() { + return localEnrollment; + } + + public void setLocalEnrollment(@javax.annotation.Nonnull Boolean localEnrollment) { + this.localEnrollment = localEnrollment; + } + + + public PassKeyConfig rpDisplayName(@javax.annotation.Nonnull String rpDisplayName) { + this.rpDisplayName = rpDisplayName; + return this; + } + + /** + * Display name for the relying party. + * @return rpDisplayName + */ + @javax.annotation.Nonnull + public String getRpDisplayName() { + return rpDisplayName; + } + + public void setRpDisplayName(@javax.annotation.Nonnull String rpDisplayName) { + this.rpDisplayName = rpDisplayName; + } + + + public PassKeyConfig RPID(@javax.annotation.Nonnull String RPID) { + this.RPID = RPID; + return this; + } + + /** + * ID for the relying party. + * @return RPID + */ + @javax.annotation.Nonnull + public String getRPID() { + return RPID; + } + + public void setRPID(@javax.annotation.Nonnull String RPID) { + this.RPID = RPID; + } + + + public PassKeyConfig rpOrigins(@javax.annotation.Nonnull List<String> rpOrigins) { + this.rpOrigins = rpOrigins; + return this; + } + + public PassKeyConfig addRpOriginsItem(String rpOriginsItem) { + if (this.rpOrigins == null) { + this.rpOrigins = new ArrayList<>(); + } + this.rpOrigins.add(rpOriginsItem); + return this; + } + + /** + * List of allowed origins for the relying party. + * @return rpOrigins + */ + @javax.annotation.Nonnull + public List<String> getRpOrigins() { + return rpOrigins; + } + + public void setRpOrigins(@javax.annotation.Nonnull List<String> rpOrigins) { + this.rpOrigins = rpOrigins; + } + + + public PassKeyConfig attestation(@javax.annotation.Nullable AttestationEnum attestation) { + this.attestation = attestation; + return this; + } + + /** + * The type of PassKey Attestation flow. + * @return attestation + */ + @javax.annotation.Nullable + public AttestationEnum getAttestation() { + return attestation; + } + + public void setAttestation(@javax.annotation.Nullable AttestationEnum attestation) { + this.attestation = attestation; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PassKeyConfig instance itself + */ + public PassKeyConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PassKeyConfig passKeyConfig = (PassKeyConfig) o; + return Objects.equals(this.isEnabled, passKeyConfig.isEnabled) && + Objects.equals(this.passkeySelection, passKeyConfig.passkeySelection) && + Objects.equals(this.progressiveEnrollment, passKeyConfig.progressiveEnrollment) && + Objects.equals(this.progressiveEnrollmentDelay, passKeyConfig.progressiveEnrollmentDelay) && + Objects.equals(this.localEnrollment, passKeyConfig.localEnrollment) && + Objects.equals(this.rpDisplayName, passKeyConfig.rpDisplayName) && + Objects.equals(this.RPID, passKeyConfig.RPID) && + Objects.equals(this.rpOrigins, passKeyConfig.rpOrigins) && + Objects.equals(this.attestation, passKeyConfig.attestation)&& + Objects.equals(this.additionalProperties, passKeyConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isEnabled, passkeySelection, progressiveEnrollment, progressiveEnrollmentDelay, localEnrollment, rpDisplayName, RPID, rpOrigins, attestation, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PassKeyConfig {\n"); + sb.append(" isEnabled: ").append(toIndentedString(isEnabled)).append("\n"); + sb.append(" passkeySelection: ").append(toIndentedString(passkeySelection)).append("\n"); + sb.append(" progressiveEnrollment: ").append(toIndentedString(progressiveEnrollment)).append("\n"); + sb.append(" progressiveEnrollmentDelay: ").append(toIndentedString(progressiveEnrollmentDelay)).append("\n"); + sb.append(" localEnrollment: ").append(toIndentedString(localEnrollment)).append("\n"); + sb.append(" rpDisplayName: ").append(toIndentedString(rpDisplayName)).append("\n"); + sb.append(" RPID: ").append(toIndentedString(RPID)).append("\n"); + sb.append(" rpOrigins: ").append(toIndentedString(rpOrigins)).append("\n"); + sb.append(" attestation: ").append(toIndentedString(attestation)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsEnabled"); + openapiFields.add("PasskeySelection"); + openapiFields.add("ProgressiveEnrollment"); + openapiFields.add("ProgressiveEnrollmentDelay"); + openapiFields.add("LocalEnrollment"); + openapiFields.add("RPDisplayName"); + openapiFields.add("RPID"); + openapiFields.add("RPOrigins"); + openapiFields.add("Attestation"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("IsEnabled"); + openapiRequiredFields.add("PasskeySelection"); + openapiRequiredFields.add("LocalEnrollment"); + openapiRequiredFields.add("RPDisplayName"); + openapiRequiredFields.add("RPID"); + openapiRequiredFields.add("RPOrigins"); + } + + /** + * 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 PassKeyConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PassKeyConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PassKeyConfig is not found in the empty JSON string", PassKeyConfig.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PassKeyConfig.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("PasskeySelection").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PasskeySelection` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PasskeySelection").toString())); + } + // validate the required field `PasskeySelection` + PasskeySelectionEnum.validateJsonElement(jsonObj.get("PasskeySelection")); + if (!jsonObj.get("RPDisplayName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RPDisplayName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RPDisplayName").toString())); + } + if (!jsonObj.get("RPID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RPID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RPID").toString())); + } + // ensure the required json array is present + if (jsonObj.get("RPOrigins") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("RPOrigins").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RPOrigins` to be an array in the JSON string but got `%s`", jsonObj.get("RPOrigins").toString())); + } + if ((jsonObj.get("Attestation") != null && !jsonObj.get("Attestation").isJsonNull()) && !jsonObj.get("Attestation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Attestation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Attestation").toString())); + } + // validate the optional field `Attestation` + if (jsonObj.get("Attestation") != null && !jsonObj.get("Attestation").isJsonNull()) { + AttestationEnum.validateJsonElement(jsonObj.get("Attestation")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PassKeyConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PassKeyConfig' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PassKeyConfig> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PassKeyConfig.class)); + + return (TypeAdapter<T>) new TypeAdapter<PassKeyConfig>() { + @Override + public void write(JsonWriter out, PassKeyConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PassKeyConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PassKeyConfig instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PassKeyConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of PassKeyConfig + * @throws IOException if the JSON string is invalid with respect to PassKeyConfig + */ + public static PassKeyConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PassKeyConfig.class); + } + + /** + * Convert an instance of PassKeyConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyCredentialAssertionResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyCredentialAssertionResponse.java new file mode 100644 index 0000000..47ba210 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyCredentialAssertionResponse.java @@ -0,0 +1,523 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.PasskeyCredentialAssertionResponseResponse; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * CredentialAssertionResponse represents the response from a client when asserting credentials. It is the result of the navigator.credentials.get() call on the client side and is sent to the server for verification during the authentication process. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PasskeyCredentialAssertionResponse { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private String id; + + /** + * String describing the credential type. For WebAuthn, this is always \"public-key\". + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + PUBLIC_KEY("public-key"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<TypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + public static final String SERIALIZED_NAME_RAW_ID = "rawId"; + @SerializedName(SERIALIZED_NAME_RAW_ID) + @javax.annotation.Nonnull + private byte[] rawId; + + /** + * Indicates the authenticator attachment modality used during assertion. This helps identify the type of authenticator used, either a platform authenticator integrated into the device or a roaming authenticator that can be connected to different devices. + */ + @JsonAdapter(AuthenticatorAttachmentEnum.Adapter.class) + public enum AuthenticatorAttachmentEnum { + PLATFORM("platform"), + + CROSS_PLATFORM("cross-platform"); + + private String value; + + AuthenticatorAttachmentEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AuthenticatorAttachmentEnum fromValue(String value) { + for (AuthenticatorAttachmentEnum b : AuthenticatorAttachmentEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<AuthenticatorAttachmentEnum> { + @Override + public void write(final JsonWriter jsonWriter, final AuthenticatorAttachmentEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AuthenticatorAttachmentEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AuthenticatorAttachmentEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AuthenticatorAttachmentEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_AUTHENTICATOR_ATTACHMENT = "authenticatorAttachment"; + @SerializedName(SERIALIZED_NAME_AUTHENTICATOR_ATTACHMENT) + @javax.annotation.Nullable + private AuthenticatorAttachmentEnum authenticatorAttachment; + + public static final String SERIALIZED_NAME_RESPONSE = "response"; + @SerializedName(SERIALIZED_NAME_RESPONSE) + @javax.annotation.Nonnull + private PasskeyCredentialAssertionResponseResponse response; + + public PasskeyCredentialAssertionResponse() { + } + + public PasskeyCredentialAssertionResponse id(@javax.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * Base64URL-encoded string representing the ID of the credential used for the authentication assertion. This is typically the same as rawId, but encoded as a string. + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + + public PasskeyCredentialAssertionResponse type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * String describing the credential type. For WebAuthn, this is always \"public-key\". + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + public PasskeyCredentialAssertionResponse rawId(@javax.annotation.Nonnull byte[] rawId) { + this.rawId = rawId; + return this; + } + + /** + * Base64URL-encoded ArrayBuffer containing the credential ID. This ID is used by the Relying Party to identify the credential used for the authentication assertion. + * @return rawId + */ + @javax.annotation.Nonnull + public byte[] getRawId() { + return rawId; + } + + public void setRawId(@javax.annotation.Nonnull byte[] rawId) { + this.rawId = rawId; + } + + + public PasskeyCredentialAssertionResponse authenticatorAttachment(@javax.annotation.Nullable AuthenticatorAttachmentEnum authenticatorAttachment) { + this.authenticatorAttachment = authenticatorAttachment; + return this; + } + + /** + * Indicates the authenticator attachment modality used during assertion. This helps identify the type of authenticator used, either a platform authenticator integrated into the device or a roaming authenticator that can be connected to different devices. + * @return authenticatorAttachment + */ + @javax.annotation.Nullable + public AuthenticatorAttachmentEnum getAuthenticatorAttachment() { + return authenticatorAttachment; + } + + public void setAuthenticatorAttachment(@javax.annotation.Nullable AuthenticatorAttachmentEnum authenticatorAttachment) { + this.authenticatorAttachment = authenticatorAttachment; + } + + + public PasskeyCredentialAssertionResponse response(@javax.annotation.Nonnull PasskeyCredentialAssertionResponseResponse response) { + this.response = response; + return this; + } + + /** + * Get response + * @return response + */ + @javax.annotation.Nonnull + public PasskeyCredentialAssertionResponseResponse getResponse() { + return response; + } + + public void setResponse(@javax.annotation.Nonnull PasskeyCredentialAssertionResponseResponse response) { + this.response = response; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyCredentialAssertionResponse instance itself + */ + public PasskeyCredentialAssertionResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyCredentialAssertionResponse passkeyCredentialAssertionResponse = (PasskeyCredentialAssertionResponse) o; + return Objects.equals(this.id, passkeyCredentialAssertionResponse.id) && + Objects.equals(this.type, passkeyCredentialAssertionResponse.type) && + Arrays.equals(this.rawId, passkeyCredentialAssertionResponse.rawId) && + Objects.equals(this.authenticatorAttachment, passkeyCredentialAssertionResponse.authenticatorAttachment) && + Objects.equals(this.response, passkeyCredentialAssertionResponse.response)&& + Objects.equals(this.additionalProperties, passkeyCredentialAssertionResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, Arrays.hashCode(rawId), authenticatorAttachment, response, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyCredentialAssertionResponse {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" rawId: ").append(toIndentedString(rawId)).append("\n"); + sb.append(" authenticatorAttachment: ").append(toIndentedString(authenticatorAttachment)).append("\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("id"); + openapiFields.add("type"); + openapiFields.add("rawId"); + openapiFields.add("authenticatorAttachment"); + openapiFields.add("response"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("rawId"); + openapiRequiredFields.add("response"); + } + + /** + * 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 PasskeyCredentialAssertionResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyCredentialAssertionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyCredentialAssertionResponse is not found in the empty JSON string", PasskeyCredentialAssertionResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasskeyCredentialAssertionResponse.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("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + if ((jsonObj.get("authenticatorAttachment") != null && !jsonObj.get("authenticatorAttachment").isJsonNull()) && !jsonObj.get("authenticatorAttachment").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `authenticatorAttachment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authenticatorAttachment").toString())); + } + // validate the optional field `authenticatorAttachment` + if (jsonObj.get("authenticatorAttachment") != null && !jsonObj.get("authenticatorAttachment").isJsonNull()) { + AuthenticatorAttachmentEnum.validateJsonElement(jsonObj.get("authenticatorAttachment")); + } + // validate the required field `response` + PasskeyCredentialAssertionResponseResponse.validateJsonElement(jsonObj.get("response")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PasskeyCredentialAssertionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyCredentialAssertionResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PasskeyCredentialAssertionResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyCredentialAssertionResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<PasskeyCredentialAssertionResponse>() { + @Override + public void write(JsonWriter out, PasskeyCredentialAssertionResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PasskeyCredentialAssertionResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyCredentialAssertionResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyCredentialAssertionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyCredentialAssertionResponse + * @throws IOException if the JSON string is invalid with respect to PasskeyCredentialAssertionResponse + */ + public static PasskeyCredentialAssertionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyCredentialAssertionResponse.class); + } + + /** + * Convert an instance of PasskeyCredentialAssertionResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyCredentialAssertionResponseResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyCredentialAssertionResponseResponse.java new file mode 100644 index 0000000..7798dd4 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyCredentialAssertionResponseResponse.java @@ -0,0 +1,375 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * The authenticator's response to the client's request to generate an assertion. Contains information about the authentication like the signature and client data. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PasskeyCredentialAssertionResponseResponse { + public static final String SERIALIZED_NAME_CLIENT_DATA_J_S_O_N = "clientDataJSON"; + @SerializedName(SERIALIZED_NAME_CLIENT_DATA_J_S_O_N) + @javax.annotation.Nonnull + private byte[] clientDataJSON; + + public static final String SERIALIZED_NAME_AUTHENTICATOR_DATA = "authenticatorData"; + @SerializedName(SERIALIZED_NAME_AUTHENTICATOR_DATA) + @javax.annotation.Nonnull + private byte[] authenticatorData; + + public static final String SERIALIZED_NAME_SIGNATURE = "signature"; + @SerializedName(SERIALIZED_NAME_SIGNATURE) + @javax.annotation.Nonnull + private byte[] signature; + + public static final String SERIALIZED_NAME_USER_HANDLE = "userHandle"; + @SerializedName(SERIALIZED_NAME_USER_HANDLE) + @javax.annotation.Nullable + private byte[] userHandle; + + public PasskeyCredentialAssertionResponseResponse() { + } + + public PasskeyCredentialAssertionResponseResponse clientDataJSON(@javax.annotation.Nonnull byte[] clientDataJSON) { + this.clientDataJSON = clientDataJSON; + return this; + } + + /** + * Base64URL-encoded JSON serialized client data. Contains information about the authentication like the challenge, origin, and type of credential. + * @return clientDataJSON + */ + @javax.annotation.Nonnull + public byte[] getClientDataJSON() { + return clientDataJSON; + } + + public void setClientDataJSON(@javax.annotation.Nonnull byte[] clientDataJSON) { + this.clientDataJSON = clientDataJSON; + } + + + public PasskeyCredentialAssertionResponseResponse authenticatorData(@javax.annotation.Nonnull byte[] authenticatorData) { + this.authenticatorData = authenticatorData; + return this; + } + + /** + * Base64URL-encoded authenticator data. Contains information about the authentication such as the RP ID hash, User presence/verification flags, counter, and extensions. + * @return authenticatorData + */ + @javax.annotation.Nonnull + public byte[] getAuthenticatorData() { + return authenticatorData; + } + + public void setAuthenticatorData(@javax.annotation.Nonnull byte[] authenticatorData) { + this.authenticatorData = authenticatorData; + } + + + public PasskeyCredentialAssertionResponseResponse signature(@javax.annotation.Nonnull byte[] signature) { + this.signature = signature; + return this; + } + + /** + * Base64URL-encoded signature. This is the actual assertion signature produced by the authenticator using its private key. + * @return signature + */ + @javax.annotation.Nonnull + public byte[] getSignature() { + return signature; + } + + public void setSignature(@javax.annotation.Nonnull byte[] signature) { + this.signature = signature; + } + + + public PasskeyCredentialAssertionResponseResponse userHandle(@javax.annotation.Nullable byte[] userHandle) { + this.userHandle = userHandle; + return this; + } + + /** + * Optional. Base64URL-encoded User handle (user.id). Allows the Relying Party to link the assertion to a specific User account. It might be empty if the authenticator doesn't store it. + * @return userHandle + */ + @javax.annotation.Nullable + public byte[] getUserHandle() { + return userHandle; + } + + public void setUserHandle(@javax.annotation.Nullable byte[] userHandle) { + this.userHandle = userHandle; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyCredentialAssertionResponseResponse instance itself + */ + public PasskeyCredentialAssertionResponseResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyCredentialAssertionResponseResponse passkeyCredentialAssertionResponseResponse = (PasskeyCredentialAssertionResponseResponse) o; + return Arrays.equals(this.clientDataJSON, passkeyCredentialAssertionResponseResponse.clientDataJSON) && + Arrays.equals(this.authenticatorData, passkeyCredentialAssertionResponseResponse.authenticatorData) && + Arrays.equals(this.signature, passkeyCredentialAssertionResponseResponse.signature) && + Arrays.equals(this.userHandle, passkeyCredentialAssertionResponseResponse.userHandle)&& + Objects.equals(this.additionalProperties, passkeyCredentialAssertionResponseResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(Arrays.hashCode(clientDataJSON), Arrays.hashCode(authenticatorData), Arrays.hashCode(signature), Arrays.hashCode(userHandle), additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyCredentialAssertionResponseResponse {\n"); + sb.append(" clientDataJSON: ").append(toIndentedString(clientDataJSON)).append("\n"); + sb.append(" authenticatorData: ").append(toIndentedString(authenticatorData)).append("\n"); + sb.append(" signature: ").append(toIndentedString(signature)).append("\n"); + sb.append(" userHandle: ").append(toIndentedString(userHandle)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("clientDataJSON"); + openapiFields.add("authenticatorData"); + openapiFields.add("signature"); + openapiFields.add("userHandle"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("clientDataJSON"); + openapiRequiredFields.add("authenticatorData"); + openapiRequiredFields.add("signature"); + } + + /** + * 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 PasskeyCredentialAssertionResponseResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyCredentialAssertionResponseResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyCredentialAssertionResponseResponse is not found in the empty JSON string", PasskeyCredentialAssertionResponseResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasskeyCredentialAssertionResponseResponse.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(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PasskeyCredentialAssertionResponseResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyCredentialAssertionResponseResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PasskeyCredentialAssertionResponseResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyCredentialAssertionResponseResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<PasskeyCredentialAssertionResponseResponse>() { + @Override + public void write(JsonWriter out, PasskeyCredentialAssertionResponseResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PasskeyCredentialAssertionResponseResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyCredentialAssertionResponseResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyCredentialAssertionResponseResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyCredentialAssertionResponseResponse + * @throws IOException if the JSON string is invalid with respect to PasskeyCredentialAssertionResponseResponse + */ + public static PasskeyCredentialAssertionResponseResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyCredentialAssertionResponseResponse.class); + } + + /** + * Convert an instance of PasskeyCredentialAssertionResponseResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyCredentialCreationResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyCredentialCreationResponse.java new file mode 100644 index 0000000..80b8c1c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyCredentialCreationResponse.java @@ -0,0 +1,558 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.PasskeyCredentialCreationResponseClientExtensionResults; +import com.loginradius.sdk.internal.openapi.model.PasskeyCredentialCreationResponseResponse; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * CredentialCreationResponse represents the response from a client when creating new credentials. It is the result of the navigator.credentials.create() call on the client side and is sent to the server for verification during the registration process. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PasskeyCredentialCreationResponse { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private String id; + + public static final String SERIALIZED_NAME_RAW_ID = "rawId"; + @SerializedName(SERIALIZED_NAME_RAW_ID) + @javax.annotation.Nonnull + private String rawId; + + public static final String SERIALIZED_NAME_RESPONSE = "response"; + @SerializedName(SERIALIZED_NAME_RESPONSE) + @javax.annotation.Nonnull + private PasskeyCredentialCreationResponseResponse response; + + /** + * String describing the credential type. For WebAuthn, this is always \"public-key\". + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + PUBLIC_KEY("public-key"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<TypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + public static final String SERIALIZED_NAME_CLIENT_EXTENSION_RESULTS = "clientExtensionResults"; + @SerializedName(SERIALIZED_NAME_CLIENT_EXTENSION_RESULTS) + @javax.annotation.Nullable + private PasskeyCredentialCreationResponseClientExtensionResults clientExtensionResults; + + /** + * Indicates the authenticator attachment modality used during credential creation. This helps identify the type of authenticator used, either a platform authenticator integrated into the device or a roaming authenticator that can be connected to different devices. + */ + @JsonAdapter(AuthenticatorAttachmentEnum.Adapter.class) + public enum AuthenticatorAttachmentEnum { + PLATFORM("platform"), + + CROSS_PLATFORM("cross-platform"); + + private String value; + + AuthenticatorAttachmentEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AuthenticatorAttachmentEnum fromValue(String value) { + for (AuthenticatorAttachmentEnum b : AuthenticatorAttachmentEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<AuthenticatorAttachmentEnum> { + @Override + public void write(final JsonWriter jsonWriter, final AuthenticatorAttachmentEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AuthenticatorAttachmentEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AuthenticatorAttachmentEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AuthenticatorAttachmentEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_AUTHENTICATOR_ATTACHMENT = "authenticatorAttachment"; + @SerializedName(SERIALIZED_NAME_AUTHENTICATOR_ATTACHMENT) + @javax.annotation.Nullable + private AuthenticatorAttachmentEnum authenticatorAttachment; + + public PasskeyCredentialCreationResponse() { + } + + public PasskeyCredentialCreationResponse id(@javax.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * Base64URL-encoded string representing the ID of the newly created credential. This is typically the same as rawId, but encoded as a string. + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + + public PasskeyCredentialCreationResponse rawId(@javax.annotation.Nonnull String rawId) { + this.rawId = rawId; + return this; + } + + /** + * Base64URL-encoded ArrayBuffer containing the credential ID. This ID is used by the Relying Party to identify the credential for future authentications. + * @return rawId + */ + @javax.annotation.Nonnull + public String getRawId() { + return rawId; + } + + public void setRawId(@javax.annotation.Nonnull String rawId) { + this.rawId = rawId; + } + + + public PasskeyCredentialCreationResponse response(@javax.annotation.Nonnull PasskeyCredentialCreationResponseResponse response) { + this.response = response; + return this; + } + + /** + * Get response + * @return response + */ + @javax.annotation.Nonnull + public PasskeyCredentialCreationResponseResponse getResponse() { + return response; + } + + public void setResponse(@javax.annotation.Nonnull PasskeyCredentialCreationResponseResponse response) { + this.response = response; + } + + + public PasskeyCredentialCreationResponse type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * String describing the credential type. For WebAuthn, this is always \"public-key\". + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + public PasskeyCredentialCreationResponse clientExtensionResults(@javax.annotation.Nullable PasskeyCredentialCreationResponseClientExtensionResults clientExtensionResults) { + this.clientExtensionResults = clientExtensionResults; + return this; + } + + /** + * Get clientExtensionResults + * @return clientExtensionResults + */ + @javax.annotation.Nullable + public PasskeyCredentialCreationResponseClientExtensionResults getClientExtensionResults() { + return clientExtensionResults; + } + + public void setClientExtensionResults(@javax.annotation.Nullable PasskeyCredentialCreationResponseClientExtensionResults clientExtensionResults) { + this.clientExtensionResults = clientExtensionResults; + } + + + public PasskeyCredentialCreationResponse authenticatorAttachment(@javax.annotation.Nullable AuthenticatorAttachmentEnum authenticatorAttachment) { + this.authenticatorAttachment = authenticatorAttachment; + return this; + } + + /** + * Indicates the authenticator attachment modality used during credential creation. This helps identify the type of authenticator used, either a platform authenticator integrated into the device or a roaming authenticator that can be connected to different devices. + * @return authenticatorAttachment + */ + @javax.annotation.Nullable + public AuthenticatorAttachmentEnum getAuthenticatorAttachment() { + return authenticatorAttachment; + } + + public void setAuthenticatorAttachment(@javax.annotation.Nullable AuthenticatorAttachmentEnum authenticatorAttachment) { + this.authenticatorAttachment = authenticatorAttachment; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyCredentialCreationResponse instance itself + */ + public PasskeyCredentialCreationResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyCredentialCreationResponse passkeyCredentialCreationResponse = (PasskeyCredentialCreationResponse) o; + return Objects.equals(this.id, passkeyCredentialCreationResponse.id) && + Objects.equals(this.rawId, passkeyCredentialCreationResponse.rawId) && + Objects.equals(this.response, passkeyCredentialCreationResponse.response) && + Objects.equals(this.type, passkeyCredentialCreationResponse.type) && + Objects.equals(this.clientExtensionResults, passkeyCredentialCreationResponse.clientExtensionResults) && + Objects.equals(this.authenticatorAttachment, passkeyCredentialCreationResponse.authenticatorAttachment)&& + Objects.equals(this.additionalProperties, passkeyCredentialCreationResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, rawId, response, type, clientExtensionResults, authenticatorAttachment, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyCredentialCreationResponse {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" rawId: ").append(toIndentedString(rawId)).append("\n"); + sb.append(" response: ").append(toIndentedString(response)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" clientExtensionResults: ").append(toIndentedString(clientExtensionResults)).append("\n"); + sb.append(" authenticatorAttachment: ").append(toIndentedString(authenticatorAttachment)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("id"); + openapiFields.add("rawId"); + openapiFields.add("response"); + openapiFields.add("type"); + openapiFields.add("clientExtensionResults"); + openapiFields.add("authenticatorAttachment"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("rawId"); + openapiRequiredFields.add("response"); + openapiRequiredFields.add("type"); + } + + /** + * 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 PasskeyCredentialCreationResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyCredentialCreationResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyCredentialCreationResponse is not found in the empty JSON string", PasskeyCredentialCreationResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasskeyCredentialCreationResponse.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("rawId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rawId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rawId").toString())); + } + // validate the required field `response` + PasskeyCredentialCreationResponseResponse.validateJsonElement(jsonObj.get("response")); + if (!jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + // validate the optional field `clientExtensionResults` + if (jsonObj.get("clientExtensionResults") != null && !jsonObj.get("clientExtensionResults").isJsonNull()) { + PasskeyCredentialCreationResponseClientExtensionResults.validateJsonElement(jsonObj.get("clientExtensionResults")); + } + if ((jsonObj.get("authenticatorAttachment") != null && !jsonObj.get("authenticatorAttachment").isJsonNull()) && !jsonObj.get("authenticatorAttachment").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `authenticatorAttachment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authenticatorAttachment").toString())); + } + // validate the optional field `authenticatorAttachment` + if (jsonObj.get("authenticatorAttachment") != null && !jsonObj.get("authenticatorAttachment").isJsonNull()) { + AuthenticatorAttachmentEnum.validateJsonElement(jsonObj.get("authenticatorAttachment")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PasskeyCredentialCreationResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyCredentialCreationResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PasskeyCredentialCreationResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyCredentialCreationResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<PasskeyCredentialCreationResponse>() { + @Override + public void write(JsonWriter out, PasskeyCredentialCreationResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PasskeyCredentialCreationResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyCredentialCreationResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyCredentialCreationResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyCredentialCreationResponse + * @throws IOException if the JSON string is invalid with respect to PasskeyCredentialCreationResponse + */ + public static PasskeyCredentialCreationResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyCredentialCreationResponse.class); + } + + /** + * Convert an instance of PasskeyCredentialCreationResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyCredentialCreationResponseClientExtensionResults.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyCredentialCreationResponseClientExtensionResults.java new file mode 100644 index 0000000..3604229 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyCredentialCreationResponseClientExtensionResults.java @@ -0,0 +1,289 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.PasskeyCredentialCreationResponseClientExtensionResultsCredProps; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Results of any WebAuthn extensions processed by the client. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PasskeyCredentialCreationResponseClientExtensionResults { + public static final String SERIALIZED_NAME_CRED_PROPS = "credProps"; + @SerializedName(SERIALIZED_NAME_CRED_PROPS) + @javax.annotation.Nullable + private PasskeyCredentialCreationResponseClientExtensionResultsCredProps credProps; + + public PasskeyCredentialCreationResponseClientExtensionResults() { + } + + public PasskeyCredentialCreationResponseClientExtensionResults credProps(@javax.annotation.Nullable PasskeyCredentialCreationResponseClientExtensionResultsCredProps credProps) { + this.credProps = credProps; + return this; + } + + /** + * Get credProps + * @return credProps + */ + @javax.annotation.Nullable + public PasskeyCredentialCreationResponseClientExtensionResultsCredProps getCredProps() { + return credProps; + } + + public void setCredProps(@javax.annotation.Nullable PasskeyCredentialCreationResponseClientExtensionResultsCredProps credProps) { + this.credProps = credProps; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyCredentialCreationResponseClientExtensionResults instance itself + */ + public PasskeyCredentialCreationResponseClientExtensionResults putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyCredentialCreationResponseClientExtensionResults passkeyCredentialCreationResponseClientExtensionResults = (PasskeyCredentialCreationResponseClientExtensionResults) o; + return Objects.equals(this.credProps, passkeyCredentialCreationResponseClientExtensionResults.credProps)&& + Objects.equals(this.additionalProperties, passkeyCredentialCreationResponseClientExtensionResults.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(credProps, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyCredentialCreationResponseClientExtensionResults {\n"); + sb.append(" credProps: ").append(toIndentedString(credProps)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("credProps"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 PasskeyCredentialCreationResponseClientExtensionResults + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyCredentialCreationResponseClientExtensionResults.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyCredentialCreationResponseClientExtensionResults is not found in the empty JSON string", PasskeyCredentialCreationResponseClientExtensionResults.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `credProps` + if (jsonObj.get("credProps") != null && !jsonObj.get("credProps").isJsonNull()) { + PasskeyCredentialCreationResponseClientExtensionResultsCredProps.validateJsonElement(jsonObj.get("credProps")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PasskeyCredentialCreationResponseClientExtensionResults.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyCredentialCreationResponseClientExtensionResults' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PasskeyCredentialCreationResponseClientExtensionResults> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyCredentialCreationResponseClientExtensionResults.class)); + + return (TypeAdapter<T>) new TypeAdapter<PasskeyCredentialCreationResponseClientExtensionResults>() { + @Override + public void write(JsonWriter out, PasskeyCredentialCreationResponseClientExtensionResults value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PasskeyCredentialCreationResponseClientExtensionResults read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyCredentialCreationResponseClientExtensionResults instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyCredentialCreationResponseClientExtensionResults given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyCredentialCreationResponseClientExtensionResults + * @throws IOException if the JSON string is invalid with respect to PasskeyCredentialCreationResponseClientExtensionResults + */ + public static PasskeyCredentialCreationResponseClientExtensionResults fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyCredentialCreationResponseClientExtensionResults.class); + } + + /** + * Convert an instance of PasskeyCredentialCreationResponseClientExtensionResults to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyCredentialCreationResponseClientExtensionResultsCredProps.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyCredentialCreationResponseClientExtensionResultsCredProps.java new file mode 100644 index 0000000..e17dd08 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyCredentialCreationResponseClientExtensionResultsCredProps.java @@ -0,0 +1,284 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * Credential Properties Extension results. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PasskeyCredentialCreationResponseClientExtensionResultsCredProps { + public static final String SERIALIZED_NAME_RK = "rk"; + @SerializedName(SERIALIZED_NAME_RK) + @javax.annotation.Nullable + private Boolean rk; + + public PasskeyCredentialCreationResponseClientExtensionResultsCredProps() { + } + + public PasskeyCredentialCreationResponseClientExtensionResultsCredProps rk(@javax.annotation.Nullable Boolean rk) { + this.rk = rk; + return this; + } + + /** + * Get rk + * @return rk + */ + @javax.annotation.Nullable + public Boolean getRk() { + return rk; + } + + public void setRk(@javax.annotation.Nullable Boolean rk) { + this.rk = rk; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyCredentialCreationResponseClientExtensionResultsCredProps instance itself + */ + public PasskeyCredentialCreationResponseClientExtensionResultsCredProps putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyCredentialCreationResponseClientExtensionResultsCredProps passkeyCredentialCreationResponseClientExtensionResultsCredProps = (PasskeyCredentialCreationResponseClientExtensionResultsCredProps) o; + return Objects.equals(this.rk, passkeyCredentialCreationResponseClientExtensionResultsCredProps.rk)&& + Objects.equals(this.additionalProperties, passkeyCredentialCreationResponseClientExtensionResultsCredProps.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(rk, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyCredentialCreationResponseClientExtensionResultsCredProps {\n"); + sb.append(" rk: ").append(toIndentedString(rk)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("rk"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 PasskeyCredentialCreationResponseClientExtensionResultsCredProps + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyCredentialCreationResponseClientExtensionResultsCredProps.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyCredentialCreationResponseClientExtensionResultsCredProps is not found in the empty JSON string", PasskeyCredentialCreationResponseClientExtensionResultsCredProps.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PasskeyCredentialCreationResponseClientExtensionResultsCredProps.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyCredentialCreationResponseClientExtensionResultsCredProps' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PasskeyCredentialCreationResponseClientExtensionResultsCredProps> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyCredentialCreationResponseClientExtensionResultsCredProps.class)); + + return (TypeAdapter<T>) new TypeAdapter<PasskeyCredentialCreationResponseClientExtensionResultsCredProps>() { + @Override + public void write(JsonWriter out, PasskeyCredentialCreationResponseClientExtensionResultsCredProps value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PasskeyCredentialCreationResponseClientExtensionResultsCredProps read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyCredentialCreationResponseClientExtensionResultsCredProps instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyCredentialCreationResponseClientExtensionResultsCredProps given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyCredentialCreationResponseClientExtensionResultsCredProps + * @throws IOException if the JSON string is invalid with respect to PasskeyCredentialCreationResponseClientExtensionResultsCredProps + */ + public static PasskeyCredentialCreationResponseClientExtensionResultsCredProps fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyCredentialCreationResponseClientExtensionResultsCredProps.class); + } + + /** + * Convert an instance of PasskeyCredentialCreationResponseClientExtensionResultsCredProps to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyCredentialCreationResponseResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyCredentialCreationResponseResponse.java new file mode 100644 index 0000000..9977644 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyCredentialCreationResponseResponse.java @@ -0,0 +1,425 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.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.loginradius.sdk.internal.openapi.JSON; + +/** + * The authenticator's response to the client's request to create a credential. Contains attestation information that can be used to verify the credential's origin. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PasskeyCredentialCreationResponseResponse { + public static final String SERIALIZED_NAME_CLIENT_DATA_J_S_O_N = "clientDataJSON"; + @SerializedName(SERIALIZED_NAME_CLIENT_DATA_J_S_O_N) + @javax.annotation.Nonnull + private String clientDataJSON; + + public static final String SERIALIZED_NAME_ATTESTATION_OBJECT = "attestationObject"; + @SerializedName(SERIALIZED_NAME_ATTESTATION_OBJECT) + @javax.annotation.Nonnull + private String attestationObject; + + /** + * Gets or Sets transports + */ + @JsonAdapter(TransportsEnum.Adapter.class) + public enum TransportsEnum { + USB("usb"), + + NFC("nfc"), + + BLE("ble"), + + INTERNAL("internal"), + + HYBRID("hybrid"); + + private String value; + + TransportsEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TransportsEnum fromValue(String value) { + for (TransportsEnum b : TransportsEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<TransportsEnum> { + @Override + public void write(final JsonWriter jsonWriter, final TransportsEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TransportsEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TransportsEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TransportsEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TRANSPORTS = "transports"; + @SerializedName(SERIALIZED_NAME_TRANSPORTS) + @javax.annotation.Nullable + private List<TransportsEnum> transports = new ArrayList<>(); + + public PasskeyCredentialCreationResponseResponse() { + } + + public PasskeyCredentialCreationResponseResponse clientDataJSON(@javax.annotation.Nonnull String clientDataJSON) { + this.clientDataJSON = clientDataJSON; + return this; + } + + /** + * Base64URL-encoded JSON serialized client data. Contains information about the credential creation like the challenge, origin, and type of credential. + * @return clientDataJSON + */ + @javax.annotation.Nonnull + public String getClientDataJSON() { + return clientDataJSON; + } + + public void setClientDataJSON(@javax.annotation.Nonnull String clientDataJSON) { + this.clientDataJSON = clientDataJSON; + } + + + public PasskeyCredentialCreationResponseResponse attestationObject(@javax.annotation.Nonnull String attestationObject) { + this.attestationObject = attestationObject; + return this; + } + + /** + * Base64URL-encoded attestation object. Contains the attestation statement and authenticator data used to verify the credential's provenance. + * @return attestationObject + */ + @javax.annotation.Nonnull + public String getAttestationObject() { + return attestationObject; + } + + public void setAttestationObject(@javax.annotation.Nonnull String attestationObject) { + this.attestationObject = attestationObject; + } + + + public PasskeyCredentialCreationResponseResponse transports(@javax.annotation.Nullable List<TransportsEnum> transports) { + this.transports = transports; + return this; + } + + public PasskeyCredentialCreationResponseResponse addTransportsItem(TransportsEnum transportsItem) { + if (this.transports == null) { + this.transports = new ArrayList<>(); + } + this.transports.add(transportsItem); + return this; + } + + /** + * List of transports supported by the authenticator for this credential. May be included by the client or extracted from attestation metadata. + * @return transports + */ + @javax.annotation.Nullable + public List<TransportsEnum> getTransports() { + return transports; + } + + public void setTransports(@javax.annotation.Nullable List<TransportsEnum> transports) { + this.transports = transports; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyCredentialCreationResponseResponse instance itself + */ + public PasskeyCredentialCreationResponseResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyCredentialCreationResponseResponse passkeyCredentialCreationResponseResponse = (PasskeyCredentialCreationResponseResponse) o; + return Objects.equals(this.clientDataJSON, passkeyCredentialCreationResponseResponse.clientDataJSON) && + Objects.equals(this.attestationObject, passkeyCredentialCreationResponseResponse.attestationObject) && + Objects.equals(this.transports, passkeyCredentialCreationResponseResponse.transports)&& + Objects.equals(this.additionalProperties, passkeyCredentialCreationResponseResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(clientDataJSON, attestationObject, transports, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyCredentialCreationResponseResponse {\n"); + sb.append(" clientDataJSON: ").append(toIndentedString(clientDataJSON)).append("\n"); + sb.append(" attestationObject: ").append(toIndentedString(attestationObject)).append("\n"); + sb.append(" transports: ").append(toIndentedString(transports)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("clientDataJSON"); + openapiFields.add("attestationObject"); + openapiFields.add("transports"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("clientDataJSON"); + openapiRequiredFields.add("attestationObject"); + } + + /** + * 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 PasskeyCredentialCreationResponseResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyCredentialCreationResponseResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyCredentialCreationResponseResponse is not found in the empty JSON string", PasskeyCredentialCreationResponseResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasskeyCredentialCreationResponseResponse.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("clientDataJSON").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `clientDataJSON` to be a primitive type in the JSON string but got `%s`", jsonObj.get("clientDataJSON").toString())); + } + if (!jsonObj.get("attestationObject").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `attestationObject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("attestationObject").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("transports") != null && !jsonObj.get("transports").isJsonNull() && !jsonObj.get("transports").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `transports` to be an array in the JSON string but got `%s`", jsonObj.get("transports").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PasskeyCredentialCreationResponseResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyCredentialCreationResponseResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PasskeyCredentialCreationResponseResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyCredentialCreationResponseResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<PasskeyCredentialCreationResponseResponse>() { + @Override + public void write(JsonWriter out, PasskeyCredentialCreationResponseResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PasskeyCredentialCreationResponseResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyCredentialCreationResponseResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyCredentialCreationResponseResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyCredentialCreationResponseResponse + * @throws IOException if the JSON string is invalid with respect to PasskeyCredentialCreationResponseResponse + */ + public static PasskeyCredentialCreationResponseResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyCredentialCreationResponseResponse.class); + } + + /** + * Convert an instance of PasskeyCredentialCreationResponseResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyCredentialObject.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyCredentialObject.java new file mode 100644 index 0000000..c1a685a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyCredentialObject.java @@ -0,0 +1,375 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * A single credential object + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PasskeyCredentialObject { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_AUTHENTICATOR = "Authenticator"; + @SerializedName(SERIALIZED_NAME_AUTHENTICATOR) + @javax.annotation.Nullable + private String authenticator; + + public static final String SERIALIZED_NAME_IDENTIFIER = "Identifier"; + @SerializedName(SERIALIZED_NAME_IDENTIFIER) + @javax.annotation.Nullable + private String identifier; + + public static final String SERIALIZED_NAME_CREATED_AT = "CreatedAt"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nullable + private OffsetDateTime createdAt; + + public PasskeyCredentialObject() { + } + + public PasskeyCredentialObject id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the Passkey credential, typically a hashed or encoded key ID. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public PasskeyCredentialObject authenticator(@javax.annotation.Nullable String authenticator) { + this.authenticator = authenticator; + return this; + } + + /** + * (Optional) Name of the authenticator used to register the Passkey, such as iCloud Keychain or Windows Hello. May be null or omitted if not available. + * @return authenticator + */ + @javax.annotation.Nullable + public String getAuthenticator() { + return authenticator; + } + + public void setAuthenticator(@javax.annotation.Nullable String authenticator) { + this.authenticator = authenticator; + } + + + public PasskeyCredentialObject identifier(@javax.annotation.Nullable String identifier) { + this.identifier = identifier; + return this; + } + + /** + * User-provided identifier associated with the Passkey, usually an unique id. + * @return identifier + */ + @javax.annotation.Nullable + public String getIdentifier() { + return identifier; + } + + public void setIdentifier(@javax.annotation.Nullable String identifier) { + this.identifier = identifier; + } + + + public PasskeyCredentialObject createdAt(@javax.annotation.Nullable OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Timestamp indicating when the Passkey credential was created. + * @return createdAt + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nullable OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyCredentialObject instance itself + */ + public PasskeyCredentialObject putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyCredentialObject passkeyCredentialObject = (PasskeyCredentialObject) o; + return Objects.equals(this.id, passkeyCredentialObject.id) && + Objects.equals(this.authenticator, passkeyCredentialObject.authenticator) && + Objects.equals(this.identifier, passkeyCredentialObject.identifier) && + Objects.equals(this.createdAt, passkeyCredentialObject.createdAt)&& + Objects.equals(this.additionalProperties, passkeyCredentialObject.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, authenticator, identifier, createdAt, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyCredentialObject {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" authenticator: ").append(toIndentedString(authenticator)).append("\n"); + sb.append(" identifier: ").append(toIndentedString(identifier)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Authenticator"); + openapiFields.add("Identifier"); + openapiFields.add("CreatedAt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 PasskeyCredentialObject + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyCredentialObject.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyCredentialObject is not found in the empty JSON string", PasskeyCredentialObject.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Authenticator") != null && !jsonObj.get("Authenticator").isJsonNull()) && !jsonObj.get("Authenticator").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Authenticator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Authenticator").toString())); + } + if ((jsonObj.get("Identifier") != null && !jsonObj.get("Identifier").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PasskeyCredentialObject.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyCredentialObject' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PasskeyCredentialObject> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyCredentialObject.class)); + + return (TypeAdapter<T>) new TypeAdapter<PasskeyCredentialObject>() { + @Override + public void write(JsonWriter out, PasskeyCredentialObject value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PasskeyCredentialObject read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyCredentialObject instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyCredentialObject given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyCredentialObject + * @throws IOException if the JSON string is invalid with respect to PasskeyCredentialObject + */ + public static PasskeyCredentialObject fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyCredentialObject.class); + } + + /** + * Convert an instance of PasskeyCredentialObject to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyForgot.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyForgot.java new file mode 100644 index 0000000..589e15f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyForgot.java @@ -0,0 +1,419 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Request to reset the Passkey associated with a User account due to loss or inability to access the current Passkey + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PasskeyForgot { + public static final String SERIALIZED_NAME_G_RECAPTCHA_RESPONSE = "g-recaptcha-response"; + @SerializedName(SERIALIZED_NAME_G_RECAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String gRecaptchaResponse; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_TICKET = "qq_captcha_ticket"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_TICKET) + @javax.annotation.Nullable + private String qqCaptchaTicket; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR = "qq_captcha_randstr"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR) + @javax.annotation.Nullable + private String qqCaptchaRandstr; + + public static final String SERIALIZED_NAME_H_CAPTCHA_RESPONSE = "h-captcha-response"; + @SerializedName(SERIALIZED_NAME_H_CAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String hCaptchaResponse; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private String email; + + public PasskeyForgot() { + } + + public PasskeyForgot gRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + return this; + } + + /** + * The Google reCAPTCHA response which is sent to the server for verification. + * @return gRecaptchaResponse + */ + @javax.annotation.Nullable + public String getgRecaptchaResponse() { + return gRecaptchaResponse; + } + + public void setgRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + } + + + public PasskeyForgot qqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + return this; + } + + /** + * The QQ Captcha ticket which is sent to the server for verification. + * @return qqCaptchaTicket + */ + @javax.annotation.Nullable + public String getQqCaptchaTicket() { + return qqCaptchaTicket; + } + + public void setQqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + } + + + public PasskeyForgot qqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + return this; + } + + /** + * The QQ Captcha random string which is sent to the server for verification. + * @return qqCaptchaRandstr + */ + @javax.annotation.Nullable + public String getQqCaptchaRandstr() { + return qqCaptchaRandstr; + } + + public void setQqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + } + + + public PasskeyForgot hCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + return this; + } + + /** + * The hCaptcha response which is sent to the server for verification. + * @return hCaptchaResponse + */ + @javax.annotation.Nullable + public String gethCaptchaResponse() { + return hCaptchaResponse; + } + + public void sethCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + } + + + public PasskeyForgot email(@javax.annotation.Nullable String email) { + this.email = email; + return this; + } + + /** + * Email address of the User requesting a Passkey reset + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable String email) { + this.email = email; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyForgot instance itself + */ + public PasskeyForgot putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyForgot passkeyForgot = (PasskeyForgot) o; + return Objects.equals(this.gRecaptchaResponse, passkeyForgot.gRecaptchaResponse) && + Objects.equals(this.qqCaptchaTicket, passkeyForgot.qqCaptchaTicket) && + Objects.equals(this.qqCaptchaRandstr, passkeyForgot.qqCaptchaRandstr) && + Objects.equals(this.hCaptchaResponse, passkeyForgot.hCaptchaResponse) && + Objects.equals(this.email, passkeyForgot.email)&& + Objects.equals(this.additionalProperties, passkeyForgot.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, email, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyForgot {\n"); + sb.append(" gRecaptchaResponse: ").append(toIndentedString(gRecaptchaResponse)).append("\n"); + sb.append(" qqCaptchaTicket: ").append(toIndentedString(qqCaptchaTicket)).append("\n"); + sb.append(" qqCaptchaRandstr: ").append(toIndentedString(qqCaptchaRandstr)).append("\n"); + sb.append(" hCaptchaResponse: ").append(toIndentedString(hCaptchaResponse)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("g-recaptcha-response"); + openapiFields.add("qq_captcha_ticket"); + openapiFields.add("qq_captcha_randstr"); + openapiFields.add("h-captcha-response"); + openapiFields.add("email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 PasskeyForgot + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyForgot.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyForgot is not found in the empty JSON string", PasskeyForgot.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("g-recaptcha-response") != null && !jsonObj.get("g-recaptcha-response").isJsonNull()) && !jsonObj.get("g-recaptcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `g-recaptcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("g-recaptcha-response").toString())); + } + if ((jsonObj.get("qq_captcha_ticket") != null && !jsonObj.get("qq_captcha_ticket").isJsonNull()) && !jsonObj.get("qq_captcha_ticket").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_ticket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_ticket").toString())); + } + if ((jsonObj.get("qq_captcha_randstr") != null && !jsonObj.get("qq_captcha_randstr").isJsonNull()) && !jsonObj.get("qq_captcha_randstr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_randstr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_randstr").toString())); + } + if ((jsonObj.get("h-captcha-response") != null && !jsonObj.get("h-captcha-response").isJsonNull()) && !jsonObj.get("h-captcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `h-captcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("h-captcha-response").toString())); + } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PasskeyForgot.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyForgot' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PasskeyForgot> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyForgot.class)); + + return (TypeAdapter<T>) new TypeAdapter<PasskeyForgot>() { + @Override + public void write(JsonWriter out, PasskeyForgot value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PasskeyForgot read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyForgot instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyForgot given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyForgot + * @throws IOException if the JSON string is invalid with respect to PasskeyForgot + */ + public static PasskeyForgot fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyForgot.class); + } + + /** + * Convert an instance of PasskeyForgot to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyForgot200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyForgot200Response.java new file mode 100644 index 0000000..2344d68 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyForgot200Response.java @@ -0,0 +1,284 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * PasskeyForgot200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PasskeyForgot200Response { + public static final String SERIALIZED_NAME_IS_POSTED = "IsPosted"; + @SerializedName(SERIALIZED_NAME_IS_POSTED) + @javax.annotation.Nullable + private Boolean isPosted; + + public PasskeyForgot200Response() { + } + + public PasskeyForgot200Response isPosted(@javax.annotation.Nullable Boolean isPosted) { + this.isPosted = isPosted; + return this; + } + + /** + * Indicates if the request was successfully posted. + * @return isPosted + */ + @javax.annotation.Nullable + public Boolean getIsPosted() { + return isPosted; + } + + public void setIsPosted(@javax.annotation.Nullable Boolean isPosted) { + this.isPosted = isPosted; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyForgot200Response instance itself + */ + public PasskeyForgot200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyForgot200Response passkeyForgot200Response = (PasskeyForgot200Response) o; + return Objects.equals(this.isPosted, passkeyForgot200Response.isPosted)&& + Objects.equals(this.additionalProperties, passkeyForgot200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isPosted, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyForgot200Response {\n"); + sb.append(" isPosted: ").append(toIndentedString(isPosted)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsPosted"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 PasskeyForgot200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyForgot200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyForgot200Response is not found in the empty JSON string", PasskeyForgot200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PasskeyForgot200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyForgot200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PasskeyForgot200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyForgot200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<PasskeyForgot200Response>() { + @Override + public void write(JsonWriter out, PasskeyForgot200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PasskeyForgot200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyForgot200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyForgot200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyForgot200Response + * @throws IOException if the JSON string is invalid with respect to PasskeyForgot200Response + */ + public static PasskeyForgot200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyForgot200Response.class); + } + + /** + * Convert an instance of PasskeyForgot200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyForgotCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyForgotCore.java new file mode 100644 index 0000000..be3197a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyForgotCore.java @@ -0,0 +1,287 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * PasskeyForgotCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PasskeyForgotCore { + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private String email; + + public PasskeyForgotCore() { + } + + public PasskeyForgotCore email(@javax.annotation.Nullable String email) { + this.email = email; + return this; + } + + /** + * Email address of the User requesting a Passkey reset + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable String email) { + this.email = email; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyForgotCore instance itself + */ + public PasskeyForgotCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyForgotCore passkeyForgotCore = (PasskeyForgotCore) o; + return Objects.equals(this.email, passkeyForgotCore.email)&& + Objects.equals(this.additionalProperties, passkeyForgotCore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyForgotCore {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 PasskeyForgotCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyForgotCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyForgotCore is not found in the empty JSON string", PasskeyForgotCore.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PasskeyForgotCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyForgotCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PasskeyForgotCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyForgotCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<PasskeyForgotCore>() { + @Override + public void write(JsonWriter out, PasskeyForgotCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PasskeyForgotCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyForgotCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyForgotCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyForgotCore + * @throws IOException if the JSON string is invalid with respect to PasskeyForgotCore + */ + public static PasskeyForgotCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyForgotCore.class); + } + + /** + * Convert an instance of PasskeyForgotCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyListResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyListResponse.java new file mode 100644 index 0000000..8846694 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyListResponse.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.PasskeyCredentialObject; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Response containing a list of registered Passkey credentials + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PasskeyListResponse { + public static final String SERIALIZED_NAME_CREDENTIALS = "Credentials"; + @SerializedName(SERIALIZED_NAME_CREDENTIALS) + @javax.annotation.Nullable + private List<PasskeyCredentialObject> credentials = new ArrayList<>(); + + public PasskeyListResponse() { + } + + public PasskeyListResponse credentials(@javax.annotation.Nullable List<PasskeyCredentialObject> credentials) { + this.credentials = credentials; + return this; + } + + public PasskeyListResponse addCredentialsItem(PasskeyCredentialObject credentialsItem) { + if (this.credentials == null) { + this.credentials = new ArrayList<>(); + } + this.credentials.add(credentialsItem); + return this; + } + + /** + * List of Passkey credentials associated with the User + * @return credentials + */ + @javax.annotation.Nullable + public List<PasskeyCredentialObject> getCredentials() { + return credentials; + } + + public void setCredentials(@javax.annotation.Nullable List<PasskeyCredentialObject> credentials) { + this.credentials = credentials; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyListResponse instance itself + */ + public PasskeyListResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyListResponse passkeyListResponse = (PasskeyListResponse) o; + return Objects.equals(this.credentials, passkeyListResponse.credentials)&& + Objects.equals(this.additionalProperties, passkeyListResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(credentials, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyListResponse {\n"); + sb.append(" credentials: ").append(toIndentedString(credentials)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Credentials"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 PasskeyListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyListResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyListResponse is not found in the empty JSON string", PasskeyListResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Credentials") != null && !jsonObj.get("Credentials").isJsonNull()) { + JsonArray jsonArraycredentials = jsonObj.getAsJsonArray("Credentials"); + if (jsonArraycredentials != null) { + // ensure the json data is an array + if (!jsonObj.get("Credentials").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Credentials` to be an array in the JSON string but got `%s`", jsonObj.get("Credentials").toString())); + } + + // validate the optional field `Credentials` (array) + for (int i = 0; i < jsonArraycredentials.size(); i++) { + PasskeyCredentialObject.validateJsonElement(jsonArraycredentials.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PasskeyListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyListResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PasskeyListResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyListResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<PasskeyListResponse>() { + @Override + public void write(JsonWriter out, PasskeyListResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PasskeyListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyListResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyListResponse + * @throws IOException if the JSON string is invalid with respect to PasskeyListResponse + */ + public static PasskeyListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyListResponse.class); + } + + /** + * Convert an instance of PasskeyListResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyLoginAutofillRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyLoginAutofillRequest.java new file mode 100644 index 0000000..9d36b00 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyLoginAutofillRequest.java @@ -0,0 +1,458 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.PasskeyCredentialAssertionResponse; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Response payload after a User attempts to authenticate using a Passkey + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PasskeyLoginAutofillRequest { + public static final String SERIALIZED_NAME_G_RECAPTCHA_RESPONSE = "g-recaptcha-response"; + @SerializedName(SERIALIZED_NAME_G_RECAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String gRecaptchaResponse; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_TICKET = "qq_captcha_ticket"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_TICKET) + @javax.annotation.Nullable + private String qqCaptchaTicket; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR = "qq_captcha_randstr"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR) + @javax.annotation.Nullable + private String qqCaptchaRandstr; + + public static final String SERIALIZED_NAME_H_CAPTCHA_RESPONSE = "h-captcha-response"; + @SerializedName(SERIALIZED_NAME_H_CAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String hCaptchaResponse; + + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer; + + public static final String SERIALIZED_NAME_PASSKEY_CREDENTIAL = "PasskeyCredential"; + @SerializedName(SERIALIZED_NAME_PASSKEY_CREDENTIAL) + @javax.annotation.Nullable + private PasskeyCredentialAssertionResponse passkeyCredential; + + public PasskeyLoginAutofillRequest() { + } + + public PasskeyLoginAutofillRequest gRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + return this; + } + + /** + * The Google reCAPTCHA response which is sent to the server for verification. + * @return gRecaptchaResponse + */ + @javax.annotation.Nullable + public String getgRecaptchaResponse() { + return gRecaptchaResponse; + } + + public void setgRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + } + + + public PasskeyLoginAutofillRequest qqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + return this; + } + + /** + * The QQ Captcha ticket which is sent to the server for verification. + * @return qqCaptchaTicket + */ + @javax.annotation.Nullable + public String getQqCaptchaTicket() { + return qqCaptchaTicket; + } + + public void setQqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + } + + + public PasskeyLoginAutofillRequest qqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + return this; + } + + /** + * The QQ Captcha random string which is sent to the server for verification. + * @return qqCaptchaRandstr + */ + @javax.annotation.Nullable + public String getQqCaptchaRandstr() { + return qqCaptchaRandstr; + } + + public void setQqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + } + + + public PasskeyLoginAutofillRequest hCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + return this; + } + + /** + * The hCaptcha response which is sent to the server for verification. + * @return hCaptchaResponse + */ + @javax.annotation.Nullable + public String gethCaptchaResponse() { + return hCaptchaResponse; + } + + public void sethCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + } + + + public PasskeyLoginAutofillRequest securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public PasskeyLoginAutofillRequest putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * The security answers + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + + public PasskeyLoginAutofillRequest passkeyCredential(@javax.annotation.Nullable PasskeyCredentialAssertionResponse passkeyCredential) { + this.passkeyCredential = passkeyCredential; + return this; + } + + /** + * Get passkeyCredential + * @return passkeyCredential + */ + @javax.annotation.Nullable + public PasskeyCredentialAssertionResponse getPasskeyCredential() { + return passkeyCredential; + } + + public void setPasskeyCredential(@javax.annotation.Nullable PasskeyCredentialAssertionResponse passkeyCredential) { + this.passkeyCredential = passkeyCredential; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyLoginAutofillRequest instance itself + */ + public PasskeyLoginAutofillRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyLoginAutofillRequest passkeyLoginAutofillRequest = (PasskeyLoginAutofillRequest) o; + return Objects.equals(this.gRecaptchaResponse, passkeyLoginAutofillRequest.gRecaptchaResponse) && + Objects.equals(this.qqCaptchaTicket, passkeyLoginAutofillRequest.qqCaptchaTicket) && + Objects.equals(this.qqCaptchaRandstr, passkeyLoginAutofillRequest.qqCaptchaRandstr) && + Objects.equals(this.hCaptchaResponse, passkeyLoginAutofillRequest.hCaptchaResponse) && + Objects.equals(this.securityAnswer, passkeyLoginAutofillRequest.securityAnswer) && + Objects.equals(this.passkeyCredential, passkeyLoginAutofillRequest.passkeyCredential)&& + Objects.equals(this.additionalProperties, passkeyLoginAutofillRequest.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, securityAnswer, passkeyCredential, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyLoginAutofillRequest {\n"); + sb.append(" gRecaptchaResponse: ").append(toIndentedString(gRecaptchaResponse)).append("\n"); + sb.append(" qqCaptchaTicket: ").append(toIndentedString(qqCaptchaTicket)).append("\n"); + sb.append(" qqCaptchaRandstr: ").append(toIndentedString(qqCaptchaRandstr)).append("\n"); + sb.append(" hCaptchaResponse: ").append(toIndentedString(hCaptchaResponse)).append("\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" passkeyCredential: ").append(toIndentedString(passkeyCredential)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("g-recaptcha-response"); + openapiFields.add("qq_captcha_ticket"); + openapiFields.add("qq_captcha_randstr"); + openapiFields.add("h-captcha-response"); + openapiFields.add("SecurityAnswer"); + openapiFields.add("PasskeyCredential"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 PasskeyLoginAutofillRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyLoginAutofillRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyLoginAutofillRequest is not found in the empty JSON string", PasskeyLoginAutofillRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("g-recaptcha-response") != null && !jsonObj.get("g-recaptcha-response").isJsonNull()) && !jsonObj.get("g-recaptcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `g-recaptcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("g-recaptcha-response").toString())); + } + if ((jsonObj.get("qq_captcha_ticket") != null && !jsonObj.get("qq_captcha_ticket").isJsonNull()) && !jsonObj.get("qq_captcha_ticket").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_ticket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_ticket").toString())); + } + if ((jsonObj.get("qq_captcha_randstr") != null && !jsonObj.get("qq_captcha_randstr").isJsonNull()) && !jsonObj.get("qq_captcha_randstr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_randstr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_randstr").toString())); + } + if ((jsonObj.get("h-captcha-response") != null && !jsonObj.get("h-captcha-response").isJsonNull()) && !jsonObj.get("h-captcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `h-captcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("h-captcha-response").toString())); + } + // validate the optional field `PasskeyCredential` + if (jsonObj.get("PasskeyCredential") != null && !jsonObj.get("PasskeyCredential").isJsonNull()) { + PasskeyCredentialAssertionResponse.validateJsonElement(jsonObj.get("PasskeyCredential")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PasskeyLoginAutofillRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyLoginAutofillRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PasskeyLoginAutofillRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyLoginAutofillRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<PasskeyLoginAutofillRequest>() { + @Override + public void write(JsonWriter out, PasskeyLoginAutofillRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PasskeyLoginAutofillRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyLoginAutofillRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyLoginAutofillRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyLoginAutofillRequest + * @throws IOException if the JSON string is invalid with respect to PasskeyLoginAutofillRequest + */ + public static PasskeyLoginAutofillRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyLoginAutofillRequest.class); + } + + /** + * Convert an instance of PasskeyLoginAutofillRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyLoginAutofillRequestCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyLoginAutofillRequestCore.java new file mode 100644 index 0000000..d1c7d79 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyLoginAutofillRequestCore.java @@ -0,0 +1,338 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.PasskeyCredentialAssertionResponse; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * PasskeyLoginAutofillRequestCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PasskeyLoginAutofillRequestCore { + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer; + + public static final String SERIALIZED_NAME_PASSKEY_CREDENTIAL = "PasskeyCredential"; + @SerializedName(SERIALIZED_NAME_PASSKEY_CREDENTIAL) + @javax.annotation.Nullable + private PasskeyCredentialAssertionResponse passkeyCredential; + + public PasskeyLoginAutofillRequestCore() { + } + + public PasskeyLoginAutofillRequestCore securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public PasskeyLoginAutofillRequestCore putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * The security answers + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + + public PasskeyLoginAutofillRequestCore passkeyCredential(@javax.annotation.Nullable PasskeyCredentialAssertionResponse passkeyCredential) { + this.passkeyCredential = passkeyCredential; + return this; + } + + /** + * Get passkeyCredential + * @return passkeyCredential + */ + @javax.annotation.Nullable + public PasskeyCredentialAssertionResponse getPasskeyCredential() { + return passkeyCredential; + } + + public void setPasskeyCredential(@javax.annotation.Nullable PasskeyCredentialAssertionResponse passkeyCredential) { + this.passkeyCredential = passkeyCredential; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyLoginAutofillRequestCore instance itself + */ + public PasskeyLoginAutofillRequestCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyLoginAutofillRequestCore passkeyLoginAutofillRequestCore = (PasskeyLoginAutofillRequestCore) o; + return Objects.equals(this.securityAnswer, passkeyLoginAutofillRequestCore.securityAnswer) && + Objects.equals(this.passkeyCredential, passkeyLoginAutofillRequestCore.passkeyCredential)&& + Objects.equals(this.additionalProperties, passkeyLoginAutofillRequestCore.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(securityAnswer, passkeyCredential, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyLoginAutofillRequestCore {\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" passkeyCredential: ").append(toIndentedString(passkeyCredential)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("SecurityAnswer"); + openapiFields.add("PasskeyCredential"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 PasskeyLoginAutofillRequestCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyLoginAutofillRequestCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyLoginAutofillRequestCore is not found in the empty JSON string", PasskeyLoginAutofillRequestCore.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `PasskeyCredential` + if (jsonObj.get("PasskeyCredential") != null && !jsonObj.get("PasskeyCredential").isJsonNull()) { + PasskeyCredentialAssertionResponse.validateJsonElement(jsonObj.get("PasskeyCredential")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PasskeyLoginAutofillRequestCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyLoginAutofillRequestCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PasskeyLoginAutofillRequestCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyLoginAutofillRequestCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<PasskeyLoginAutofillRequestCore>() { + @Override + public void write(JsonWriter out, PasskeyLoginAutofillRequestCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PasskeyLoginAutofillRequestCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyLoginAutofillRequestCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyLoginAutofillRequestCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyLoginAutofillRequestCore + * @throws IOException if the JSON string is invalid with respect to PasskeyLoginAutofillRequestCore + */ + public static PasskeyLoginAutofillRequestCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyLoginAutofillRequestCore.class); + } + + /** + * Convert an instance of PasskeyLoginAutofillRequestCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyLoginFinish.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyLoginFinish.java new file mode 100644 index 0000000..a9d744a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyLoginFinish.java @@ -0,0 +1,488 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.PasskeyCredentialAssertionResponse; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * PasskeyLoginFinish + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PasskeyLoginFinish { + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private String email; + + public static final String SERIALIZED_NAME_PASSKEY_CREDENTIAL = "PasskeyCredential"; + @SerializedName(SERIALIZED_NAME_PASSKEY_CREDENTIAL) + @javax.annotation.Nullable + private PasskeyCredentialAssertionResponse passkeyCredential; + + public static final String SERIALIZED_NAME_G_RECAPTCHA_RESPONSE = "g-recaptcha-response"; + @SerializedName(SERIALIZED_NAME_G_RECAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String gRecaptchaResponse; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_TICKET = "qq_captcha_ticket"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_TICKET) + @javax.annotation.Nullable + private String qqCaptchaTicket; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR = "qq_captcha_randstr"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR) + @javax.annotation.Nullable + private String qqCaptchaRandstr; + + public static final String SERIALIZED_NAME_H_CAPTCHA_RESPONSE = "h-captcha-response"; + @SerializedName(SERIALIZED_NAME_H_CAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String hCaptchaResponse; + + public PasskeyLoginFinish() { + } + + public PasskeyLoginFinish securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public PasskeyLoginFinish putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * The security answers + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + + public PasskeyLoginFinish email(@javax.annotation.Nullable String email) { + this.email = email; + return this; + } + + /** + * Email address of the User attempting authentication + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable String email) { + this.email = email; + } + + + public PasskeyLoginFinish passkeyCredential(@javax.annotation.Nullable PasskeyCredentialAssertionResponse passkeyCredential) { + this.passkeyCredential = passkeyCredential; + return this; + } + + /** + * Get passkeyCredential + * @return passkeyCredential + */ + @javax.annotation.Nullable + public PasskeyCredentialAssertionResponse getPasskeyCredential() { + return passkeyCredential; + } + + public void setPasskeyCredential(@javax.annotation.Nullable PasskeyCredentialAssertionResponse passkeyCredential) { + this.passkeyCredential = passkeyCredential; + } + + + public PasskeyLoginFinish gRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + return this; + } + + /** + * The Google reCAPTCHA response which is sent to the server for verification. + * @return gRecaptchaResponse + */ + @javax.annotation.Nullable + public String getgRecaptchaResponse() { + return gRecaptchaResponse; + } + + public void setgRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + } + + + public PasskeyLoginFinish qqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + return this; + } + + /** + * The QQ Captcha ticket which is sent to the server for verification. + * @return qqCaptchaTicket + */ + @javax.annotation.Nullable + public String getQqCaptchaTicket() { + return qqCaptchaTicket; + } + + public void setQqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + } + + + public PasskeyLoginFinish qqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + return this; + } + + /** + * The QQ Captcha random string which is sent to the server for verification. + * @return qqCaptchaRandstr + */ + @javax.annotation.Nullable + public String getQqCaptchaRandstr() { + return qqCaptchaRandstr; + } + + public void setQqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + } + + + public PasskeyLoginFinish hCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + return this; + } + + /** + * The hCaptcha response which is sent to the server for verification. + * @return hCaptchaResponse + */ + @javax.annotation.Nullable + public String gethCaptchaResponse() { + return hCaptchaResponse; + } + + public void sethCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyLoginFinish instance itself + */ + public PasskeyLoginFinish putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyLoginFinish passkeyLoginFinish = (PasskeyLoginFinish) o; + return Objects.equals(this.securityAnswer, passkeyLoginFinish.securityAnswer) && + Objects.equals(this.email, passkeyLoginFinish.email) && + Objects.equals(this.passkeyCredential, passkeyLoginFinish.passkeyCredential) && + Objects.equals(this.gRecaptchaResponse, passkeyLoginFinish.gRecaptchaResponse) && + Objects.equals(this.qqCaptchaTicket, passkeyLoginFinish.qqCaptchaTicket) && + Objects.equals(this.qqCaptchaRandstr, passkeyLoginFinish.qqCaptchaRandstr) && + Objects.equals(this.hCaptchaResponse, passkeyLoginFinish.hCaptchaResponse)&& + Objects.equals(this.additionalProperties, passkeyLoginFinish.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(securityAnswer, email, passkeyCredential, gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyLoginFinish {\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" passkeyCredential: ").append(toIndentedString(passkeyCredential)).append("\n"); + sb.append(" gRecaptchaResponse: ").append(toIndentedString(gRecaptchaResponse)).append("\n"); + sb.append(" qqCaptchaTicket: ").append(toIndentedString(qqCaptchaTicket)).append("\n"); + sb.append(" qqCaptchaRandstr: ").append(toIndentedString(qqCaptchaRandstr)).append("\n"); + sb.append(" hCaptchaResponse: ").append(toIndentedString(hCaptchaResponse)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("SecurityAnswer"); + openapiFields.add("email"); + openapiFields.add("PasskeyCredential"); + openapiFields.add("g-recaptcha-response"); + openapiFields.add("qq_captcha_ticket"); + openapiFields.add("qq_captcha_randstr"); + openapiFields.add("h-captcha-response"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 PasskeyLoginFinish + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyLoginFinish.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyLoginFinish is not found in the empty JSON string", PasskeyLoginFinish.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + // validate the optional field `PasskeyCredential` + if (jsonObj.get("PasskeyCredential") != null && !jsonObj.get("PasskeyCredential").isJsonNull()) { + PasskeyCredentialAssertionResponse.validateJsonElement(jsonObj.get("PasskeyCredential")); + } + if ((jsonObj.get("g-recaptcha-response") != null && !jsonObj.get("g-recaptcha-response").isJsonNull()) && !jsonObj.get("g-recaptcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `g-recaptcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("g-recaptcha-response").toString())); + } + if ((jsonObj.get("qq_captcha_ticket") != null && !jsonObj.get("qq_captcha_ticket").isJsonNull()) && !jsonObj.get("qq_captcha_ticket").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_ticket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_ticket").toString())); + } + if ((jsonObj.get("qq_captcha_randstr") != null && !jsonObj.get("qq_captcha_randstr").isJsonNull()) && !jsonObj.get("qq_captcha_randstr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_randstr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_randstr").toString())); + } + if ((jsonObj.get("h-captcha-response") != null && !jsonObj.get("h-captcha-response").isJsonNull()) && !jsonObj.get("h-captcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `h-captcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("h-captcha-response").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PasskeyLoginFinish.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyLoginFinish' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PasskeyLoginFinish> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyLoginFinish.class)); + + return (TypeAdapter<T>) new TypeAdapter<PasskeyLoginFinish>() { + @Override + public void write(JsonWriter out, PasskeyLoginFinish value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PasskeyLoginFinish read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyLoginFinish instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyLoginFinish given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyLoginFinish + * @throws IOException if the JSON string is invalid with respect to PasskeyLoginFinish + */ + public static PasskeyLoginFinish fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyLoginFinish.class); + } + + /** + * Convert an instance of PasskeyLoginFinish to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyLoginFinishCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyLoginFinishCore.java new file mode 100644 index 0000000..bc3d9cd --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyLoginFinishCore.java @@ -0,0 +1,368 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.PasskeyCredentialAssertionResponse; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Response payload after a User attempts to authenticate using a Passkey + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PasskeyLoginFinishCore { + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private String email; + + public static final String SERIALIZED_NAME_PASSKEY_CREDENTIAL = "PasskeyCredential"; + @SerializedName(SERIALIZED_NAME_PASSKEY_CREDENTIAL) + @javax.annotation.Nullable + private PasskeyCredentialAssertionResponse passkeyCredential; + + public PasskeyLoginFinishCore() { + } + + public PasskeyLoginFinishCore securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public PasskeyLoginFinishCore putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * The security answers + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + + public PasskeyLoginFinishCore email(@javax.annotation.Nullable String email) { + this.email = email; + return this; + } + + /** + * Email address of the User attempting authentication + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable String email) { + this.email = email; + } + + + public PasskeyLoginFinishCore passkeyCredential(@javax.annotation.Nullable PasskeyCredentialAssertionResponse passkeyCredential) { + this.passkeyCredential = passkeyCredential; + return this; + } + + /** + * Get passkeyCredential + * @return passkeyCredential + */ + @javax.annotation.Nullable + public PasskeyCredentialAssertionResponse getPasskeyCredential() { + return passkeyCredential; + } + + public void setPasskeyCredential(@javax.annotation.Nullable PasskeyCredentialAssertionResponse passkeyCredential) { + this.passkeyCredential = passkeyCredential; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyLoginFinishCore instance itself + */ + public PasskeyLoginFinishCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyLoginFinishCore passkeyLoginFinishCore = (PasskeyLoginFinishCore) o; + return Objects.equals(this.securityAnswer, passkeyLoginFinishCore.securityAnswer) && + Objects.equals(this.email, passkeyLoginFinishCore.email) && + Objects.equals(this.passkeyCredential, passkeyLoginFinishCore.passkeyCredential)&& + Objects.equals(this.additionalProperties, passkeyLoginFinishCore.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(securityAnswer, email, passkeyCredential, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyLoginFinishCore {\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" passkeyCredential: ").append(toIndentedString(passkeyCredential)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("SecurityAnswer"); + openapiFields.add("email"); + openapiFields.add("PasskeyCredential"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 PasskeyLoginFinishCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyLoginFinishCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyLoginFinishCore is not found in the empty JSON string", PasskeyLoginFinishCore.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + // validate the optional field `PasskeyCredential` + if (jsonObj.get("PasskeyCredential") != null && !jsonObj.get("PasskeyCredential").isJsonNull()) { + PasskeyCredentialAssertionResponse.validateJsonElement(jsonObj.get("PasskeyCredential")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PasskeyLoginFinishCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyLoginFinishCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PasskeyLoginFinishCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyLoginFinishCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<PasskeyLoginFinishCore>() { + @Override + public void write(JsonWriter out, PasskeyLoginFinishCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PasskeyLoginFinishCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyLoginFinishCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyLoginFinishCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyLoginFinishCore + * @throws IOException if the JSON string is invalid with respect to PasskeyLoginFinishCore + */ + public static PasskeyLoginFinishCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyLoginFinishCore.class); + } + + /** + * Convert an instance of PasskeyLoginFinishCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyRegisterFinish.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyRegisterFinish.java new file mode 100644 index 0000000..4d6f395 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyRegisterFinish.java @@ -0,0 +1,4105 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.PasskeyCredentialCreationResponse; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelAddressesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelAwardsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelBadgesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelBooksInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelCertificationsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelConsents; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelCountry; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelCoursesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelCurrentStatusInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelEducationsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelEmailInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelExternalIdsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelFamilyInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelFavoriteThingsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelGamesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelIMAccountsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelInspirationalPeopleInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelInterestsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelJobBookmarksInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelLanguagesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelMemberUrlResourcesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelMoviesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelMutualFriendsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPINInfo; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPatentsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPhoneNumbersInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPlacesLivedInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPositionsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPrivacyPolicy; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelProjectsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPublicationsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelRecommendationsReceivedInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelRelatedProfileViewsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSkillsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSportsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSubscription; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSuggestions; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelTeleVisionShowInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelVolunteerInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * PasskeyRegisterFinish + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PasskeyRegisterFinish { + public static final String SERIALIZED_NAME_PASSKEY_CREDENTIAL = "PasskeyCredential"; + @SerializedName(SERIALIZED_NAME_PASSKEY_CREDENTIAL) + @javax.annotation.Nullable + private PasskeyCredentialCreationResponse passkeyCredential; + + public static final String SERIALIZED_NAME_GENDER = "Gender"; + @SerializedName(SERIALIZED_NAME_GENDER) + @javax.annotation.Nullable + private String gender; + + public static final String SERIALIZED_NAME_BIRTH_DATE = "BirthDate"; + @SerializedName(SERIALIZED_NAME_BIRTH_DATE) + @javax.annotation.Nullable + private String birthDate; + + public static final String SERIALIZED_NAME_PREFIX = "Prefix"; + @SerializedName(SERIALIZED_NAME_PREFIX) + @javax.annotation.Nullable + private String prefix; + + public static final String SERIALIZED_NAME_FIRST_NAME = "FirstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nullable + private String firstName; + + public static final String SERIALIZED_NAME_MIDDLE_NAME = "MiddleName"; + @SerializedName(SERIALIZED_NAME_MIDDLE_NAME) + @javax.annotation.Nullable + private String middleName; + + public static final String SERIALIZED_NAME_LAST_NAME = "LastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nullable + private String lastName; + + public static final String SERIALIZED_NAME_SUFFIX = "Suffix"; + @SerializedName(SERIALIZED_NAME_SUFFIX) + @javax.annotation.Nullable + private String suffix; + + public static final String SERIALIZED_NAME_NICK_NAME = "NickName"; + @SerializedName(SERIALIZED_NAME_NICK_NAME) + @javax.annotation.Nullable + private String nickName; + + public static final String SERIALIZED_NAME_PROFILE_NAME = "ProfileName"; + @SerializedName(SERIALIZED_NAME_PROFILE_NAME) + @javax.annotation.Nullable + private String profileName; + + public static final String SERIALIZED_NAME_ABOUT = "About"; + @SerializedName(SERIALIZED_NAME_ABOUT) + @javax.annotation.Nullable + private String about; + + public static final String SERIALIZED_NAME_COMPANY = "Company"; + @SerializedName(SERIALIZED_NAME_COMPANY) + @javax.annotation.Nullable + private String company; + + public static final String SERIALIZED_NAME_IMAGE_URL = "ImageUrl"; + @SerializedName(SERIALIZED_NAME_IMAGE_URL) + @javax.annotation.Nullable + private String imageUrl; + + public static final String SERIALIZED_NAME_TIME_ZONE = "TimeZone"; + @SerializedName(SERIALIZED_NAME_TIME_ZONE) + @javax.annotation.Nullable + private String timeZone; + + public static final String SERIALIZED_NAME_WEBSITE = "Website"; + @SerializedName(SERIALIZED_NAME_WEBSITE) + @javax.annotation.Nullable + private String website; + + public static final String SERIALIZED_NAME_THUMBNAIL_IMAGE_URL = "ThumbnailImageUrl"; + @SerializedName(SERIALIZED_NAME_THUMBNAIL_IMAGE_URL) + @javax.annotation.Nullable + private String thumbnailImageUrl; + + public static final String SERIALIZED_NAME_FAVICON = "Favicon"; + @SerializedName(SERIALIZED_NAME_FAVICON) + @javax.annotation.Nullable + private String favicon; + + public static final String SERIALIZED_NAME_PROFILE_URL = "ProfileUrl"; + @SerializedName(SERIALIZED_NAME_PROFILE_URL) + @javax.annotation.Nullable + private String profileUrl; + + public static final String SERIALIZED_NAME_HOME_TOWN = "HomeTown"; + @SerializedName(SERIALIZED_NAME_HOME_TOWN) + @javax.annotation.Nullable + private String homeTown; + + public static final String SERIALIZED_NAME_STATE = "State"; + @SerializedName(SERIALIZED_NAME_STATE) + @javax.annotation.Nullable + private String state; + + public static final String SERIALIZED_NAME_CITY = "City"; + @SerializedName(SERIALIZED_NAME_CITY) + @javax.annotation.Nullable + private String city; + + public static final String SERIALIZED_NAME_INDUSTRY = "Industry"; + @SerializedName(SERIALIZED_NAME_INDUSTRY) + @javax.annotation.Nullable + private String industry; + + public static final String SERIALIZED_NAME_LOCAL_LANGUAGE = "LocalLanguage"; + @SerializedName(SERIALIZED_NAME_LOCAL_LANGUAGE) + @javax.annotation.Nullable + private String localLanguage; + + public static final String SERIALIZED_NAME_LANGUAGE = "Language"; + @SerializedName(SERIALIZED_NAME_LANGUAGE) + @javax.annotation.Nullable + private String language; + + public static final String SERIALIZED_NAME_COVER_PHOTO = "CoverPhoto"; + @SerializedName(SERIALIZED_NAME_COVER_PHOTO) + @javax.annotation.Nullable + private String coverPhoto; + + public static final String SERIALIZED_NAME_TAG_LINE = "TagLine"; + @SerializedName(SERIALIZED_NAME_TAG_LINE) + @javax.annotation.Nullable + private String tagLine; + + public static final String SERIALIZED_NAME_MAIN_ADDRESS = "MainAddress"; + @SerializedName(SERIALIZED_NAME_MAIN_ADDRESS) + @javax.annotation.Nullable + private String mainAddress; + + public static final String SERIALIZED_NAME_LOCAL_CITY = "LocalCity"; + @SerializedName(SERIALIZED_NAME_LOCAL_CITY) + @javax.annotation.Nullable + private String localCity; + + public static final String SERIALIZED_NAME_PROFILE_CITY = "ProfileCity"; + @SerializedName(SERIALIZED_NAME_PROFILE_CITY) + @javax.annotation.Nullable + private String profileCity; + + public static final String SERIALIZED_NAME_LOCAL_COUNTRY = "LocalCountry"; + @SerializedName(SERIALIZED_NAME_LOCAL_COUNTRY) + @javax.annotation.Nullable + private String localCountry; + + public static final String SERIALIZED_NAME_PROFILE_COUNTRY = "ProfileCountry"; + @SerializedName(SERIALIZED_NAME_PROFILE_COUNTRY) + @javax.annotation.Nullable + private String profileCountry; + + public static final String SERIALIZED_NAME_QUOTA = "Quota"; + @SerializedName(SERIALIZED_NAME_QUOTA) + @javax.annotation.Nullable + private String quota; + + public static final String SERIALIZED_NAME_RELIGION = "Religion"; + @SerializedName(SERIALIZED_NAME_RELIGION) + @javax.annotation.Nullable + private String religion; + + public static final String SERIALIZED_NAME_POLITICAL = "Political"; + @SerializedName(SERIALIZED_NAME_POLITICAL) + @javax.annotation.Nullable + private String political; + + public static final String SERIALIZED_NAME_RELATIONSHIP_STATUS = "RelationshipStatus"; + @SerializedName(SERIALIZED_NAME_RELATIONSHIP_STATUS) + @javax.annotation.Nullable + private String relationshipStatus; + + public static final String SERIALIZED_NAME_HTTPS_IMAGE_URL = "HttpsImageUrl"; + @SerializedName(SERIALIZED_NAME_HTTPS_IMAGE_URL) + @javax.annotation.Nullable + private String httpsImageUrl; + + public static final String SERIALIZED_NAME_IS_GEO_ENABLED = "IsGeoEnabled"; + @SerializedName(SERIALIZED_NAME_IS_GEO_ENABLED) + @javax.annotation.Nullable + private String isGeoEnabled; + + public static final String SERIALIZED_NAME_ASSOCIATIONS = "Associations"; + @SerializedName(SERIALIZED_NAME_ASSOCIATIONS) + @javax.annotation.Nullable + private String associations; + + public static final String SERIALIZED_NAME_HONORS = "Honors"; + @SerializedName(SERIALIZED_NAME_HONORS) + @javax.annotation.Nullable + private String honors; + + public static final String SERIALIZED_NAME_PUBLIC_REPOSITORY = "PublicRepository"; + @SerializedName(SERIALIZED_NAME_PUBLIC_REPOSITORY) + @javax.annotation.Nullable + private String publicRepository; + + public static final String SERIALIZED_NAME_REPOSITORY_URL = "RepositoryUrl"; + @SerializedName(SERIALIZED_NAME_REPOSITORY_URL) + @javax.annotation.Nullable + private String repositoryUrl; + + public static final String SERIALIZED_NAME_PROFESSIONAL_HEADLINE = "ProfessionalHeadline"; + @SerializedName(SERIALIZED_NAME_PROFESSIONAL_HEADLINE) + @javax.annotation.Nullable + private String professionalHeadline; + + public static final String SERIALIZED_NAME_CURRENCY = "Currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + @javax.annotation.Nullable + private String currency; + + public static final String SERIALIZED_NAME_STARRED_URL = "StarredUrl"; + @SerializedName(SERIALIZED_NAME_STARRED_URL) + @javax.annotation.Nullable + private String starredUrl; + + public static final String SERIALIZED_NAME_GISTS_URL = "GistsUrl"; + @SerializedName(SERIALIZED_NAME_GISTS_URL) + @javax.annotation.Nullable + private String gistsUrl; + + public static final String SERIALIZED_NAME_GRAVATAR_IMAGE_URL = "GravatarImageUrl"; + @SerializedName(SERIALIZED_NAME_GRAVATAR_IMAGE_URL) + @javax.annotation.Nullable + private String gravatarImageUrl; + + public static final String SERIALIZED_NAME_EXTERNAL_USER_LOGIN_ID = "ExternalUserLoginId"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_USER_LOGIN_ID) + @javax.annotation.Nullable + private String externalUserLoginId; + + public static final String SERIALIZED_NAME_INTERESTED_IN = "InterestedIn"; + @SerializedName(SERIALIZED_NAME_INTERESTED_IN) + @javax.annotation.Nullable + private List<String> interestedIn = new ArrayList<>(); + + public static final String SERIALIZED_NAME_FOLLOWERS_COUNT = "FollowersCount"; + @SerializedName(SERIALIZED_NAME_FOLLOWERS_COUNT) + @javax.annotation.Nullable + private Integer followersCount; + + public static final String SERIALIZED_NAME_FRIENDS_COUNT = "FriendsCount"; + @SerializedName(SERIALIZED_NAME_FRIENDS_COUNT) + @javax.annotation.Nullable + private Integer friendsCount; + + public static final String SERIALIZED_NAME_TOTAL_STATUSES_COUNT = "TotalStatusesCount"; + @SerializedName(SERIALIZED_NAME_TOTAL_STATUSES_COUNT) + @javax.annotation.Nullable + private Integer totalStatusesCount; + + public static final String SERIALIZED_NAME_NUM_RECOMMENDERS = "NumRecommenders"; + @SerializedName(SERIALIZED_NAME_NUM_RECOMMENDERS) + @javax.annotation.Nullable + private Integer numRecommenders; + + public static final String SERIALIZED_NAME_TOTAL_PRIVATE_REPOSITORY = "TotalPrivateRepository"; + @SerializedName(SERIALIZED_NAME_TOTAL_PRIVATE_REPOSITORY) + @javax.annotation.Nullable + private Integer totalPrivateRepository; + + public static final String SERIALIZED_NAME_PUBLIC_GISTS = "PublicGists"; + @SerializedName(SERIALIZED_NAME_PUBLIC_GISTS) + @javax.annotation.Nullable + private Integer publicGists; + + public static final String SERIALIZED_NAME_PRIVATE_GISTS = "PrivateGists"; + @SerializedName(SERIALIZED_NAME_PRIVATE_GISTS) + @javax.annotation.Nullable + private Integer privateGists; + + public static final String SERIALIZED_NAME_SESSION_LIMIT = "SessionLimit"; + @SerializedName(SERIALIZED_NAME_SESSION_LIMIT) + @javax.annotation.Nullable + private Integer sessionLimit; + + public static final String SERIALIZED_NAME_CUSTOM_FIELDS = "CustomFields"; + @SerializedName(SERIALIZED_NAME_CUSTOM_FIELDS) + @javax.annotation.Nullable + private Map<String, String> customFields = new HashMap<>(); + + public static final String SERIALIZED_NAME_PROFILE_IMAGE_URLS = "ProfileImageUrls"; + @SerializedName(SERIALIZED_NAME_PROFILE_IMAGE_URLS) + @javax.annotation.Nullable + private Map<String, String> profileImageUrls = new HashMap<>(); + + public static final String SERIALIZED_NAME_WEB_PROFILES = "WebProfiles"; + @SerializedName(SERIALIZED_NAME_WEB_PROFILES) + @javax.annotation.Nullable + private Map<String, String> webProfiles = new HashMap<>(); + + public static final String SERIALIZED_NAME_SECURITY_QUESTION_ANSWER = "SecurityQuestionAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_QUESTION_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityQuestionAnswer = new HashMap<>(); + + public static final String SERIALIZED_NAME_COUNTRY = "Country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + @javax.annotation.Nullable + private ProfileRequestModelCountry country; + + public static final String SERIALIZED_NAME_SUGGESTIONS = "Suggestions"; + @SerializedName(SERIALIZED_NAME_SUGGESTIONS) + @javax.annotation.Nullable + private ProfileRequestModelSuggestions suggestions; + + public static final String SERIALIZED_NAME_SUBSCRIPTION = "Subscription"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION) + @javax.annotation.Nullable + private ProfileRequestModelSubscription subscription; + + public static final String SERIALIZED_NAME_PRIVACY_POLICY = "PrivacyPolicy"; + @SerializedName(SERIALIZED_NAME_PRIVACY_POLICY) + @javax.annotation.Nullable + private ProfileRequestModelPrivacyPolicy privacyPolicy; + + public static final String SERIALIZED_NAME_PI_N_INFO = "PINInfo"; + @SerializedName(SERIALIZED_NAME_PI_N_INFO) + @javax.annotation.Nullable + private ProfileRequestModelPINInfo piNInfo; + + public static final String SERIALIZED_NAME_ADDRESSES = "Addresses"; + @SerializedName(SERIALIZED_NAME_ADDRESSES) + @javax.annotation.Nullable + private List<ProfileRequestModelAddressesInner> addresses = new ArrayList<>(); + + public static final String SERIALIZED_NAME_POSITIONS = "Positions"; + @SerializedName(SERIALIZED_NAME_POSITIONS) + @javax.annotation.Nullable + private List<ProfileRequestModelPositionsInner> positions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_EDUCATIONS = "Educations"; + @SerializedName(SERIALIZED_NAME_EDUCATIONS) + @javax.annotation.Nullable + private List<ProfileRequestModelEducationsInner> educations = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PHONE_NUMBERS = "PhoneNumbers"; + @SerializedName(SERIALIZED_NAME_PHONE_NUMBERS) + @javax.annotation.Nullable + private List<ProfileRequestModelPhoneNumbersInner> phoneNumbers = new ArrayList<>(); + + public static final String SERIALIZED_NAME_IM_ACCOUNTS = "IMAccounts"; + @SerializedName(SERIALIZED_NAME_IM_ACCOUNTS) + @javax.annotation.Nullable + private List<ProfileRequestModelIMAccountsInner> imAccounts = new ArrayList<>(); + + public static final String SERIALIZED_NAME_INTERESTS = "Interests"; + @SerializedName(SERIALIZED_NAME_INTERESTS) + @javax.annotation.Nullable + private List<ProfileRequestModelInterestsInner> interests = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SPORTS = "Sports"; + @SerializedName(SERIALIZED_NAME_SPORTS) + @javax.annotation.Nullable + private List<ProfileRequestModelSportsInner> sports = new ArrayList<>(); + + public static final String SERIALIZED_NAME_INSPIRATIONAL_PEOPLE = "InspirationalPeople"; + @SerializedName(SERIALIZED_NAME_INSPIRATIONAL_PEOPLE) + @javax.annotation.Nullable + private List<ProfileRequestModelInspirationalPeopleInner> inspirationalPeople = new ArrayList<>(); + + public static final String SERIALIZED_NAME_AWARDS = "Awards"; + @SerializedName(SERIALIZED_NAME_AWARDS) + @javax.annotation.Nullable + private List<ProfileRequestModelAwardsInner> awards = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SKILLS = "Skills"; + @SerializedName(SERIALIZED_NAME_SKILLS) + @javax.annotation.Nullable + private List<ProfileRequestModelSkillsInner> skills = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CURRENT_STATUS = "CurrentStatus"; + @SerializedName(SERIALIZED_NAME_CURRENT_STATUS) + @javax.annotation.Nullable + private List<ProfileRequestModelCurrentStatusInner> currentStatus = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CERTIFICATIONS = "Certifications"; + @SerializedName(SERIALIZED_NAME_CERTIFICATIONS) + @javax.annotation.Nullable + private List<ProfileRequestModelCertificationsInner> certifications = new ArrayList<>(); + + public static final String SERIALIZED_NAME_COURSES = "Courses"; + @SerializedName(SERIALIZED_NAME_COURSES) + @javax.annotation.Nullable + private List<ProfileRequestModelCoursesInner> courses = new ArrayList<>(); + + public static final String SERIALIZED_NAME_VOLUNTEER = "Volunteer"; + @SerializedName(SERIALIZED_NAME_VOLUNTEER) + @javax.annotation.Nullable + private List<ProfileRequestModelVolunteerInner> volunteer = new ArrayList<>(); + + public static final String SERIALIZED_NAME_RECOMMENDATIONS_RECEIVED = "RecommendationsReceived"; + @SerializedName(SERIALIZED_NAME_RECOMMENDATIONS_RECEIVED) + @javax.annotation.Nullable + private List<ProfileRequestModelRecommendationsReceivedInner> recommendationsReceived = new ArrayList<>(); + + public static final String SERIALIZED_NAME_LANGUAGES = "Languages"; + @SerializedName(SERIALIZED_NAME_LANGUAGES) + @javax.annotation.Nullable + private List<ProfileRequestModelLanguagesInner> languages = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PROJECTS = "Projects"; + @SerializedName(SERIALIZED_NAME_PROJECTS) + @javax.annotation.Nullable + private List<ProfileRequestModelProjectsInner> projects = new ArrayList<>(); + + public static final String SERIALIZED_NAME_GAMES = "Games"; + @SerializedName(SERIALIZED_NAME_GAMES) + @javax.annotation.Nullable + private List<ProfileRequestModelGamesInner> games = new ArrayList<>(); + + public static final String SERIALIZED_NAME_FAMILY = "Family"; + @SerializedName(SERIALIZED_NAME_FAMILY) + @javax.annotation.Nullable + private List<ProfileRequestModelFamilyInner> family = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TELE_VISION_SHOW = "TeleVisionShow"; + @SerializedName(SERIALIZED_NAME_TELE_VISION_SHOW) + @javax.annotation.Nullable + private List<ProfileRequestModelTeleVisionShowInner> teleVisionShow = new ArrayList<>(); + + public static final String SERIALIZED_NAME_MUTUAL_FRIENDS = "MutualFriends"; + @SerializedName(SERIALIZED_NAME_MUTUAL_FRIENDS) + @javax.annotation.Nullable + private List<ProfileRequestModelMutualFriendsInner> mutualFriends = new ArrayList<>(); + + public static final String SERIALIZED_NAME_MOVIES = "Movies"; + @SerializedName(SERIALIZED_NAME_MOVIES) + @javax.annotation.Nullable + private List<ProfileRequestModelMoviesInner> movies = new ArrayList<>(); + + public static final String SERIALIZED_NAME_BOOKS = "Books"; + @SerializedName(SERIALIZED_NAME_BOOKS) + @javax.annotation.Nullable + private List<ProfileRequestModelBooksInner> books = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PATENTS = "Patents"; + @SerializedName(SERIALIZED_NAME_PATENTS) + @javax.annotation.Nullable + private List<ProfileRequestModelPatentsInner> patents = new ArrayList<>(); + + public static final String SERIALIZED_NAME_FAVORITE_THINGS = "FavoriteThings"; + @SerializedName(SERIALIZED_NAME_FAVORITE_THINGS) + @javax.annotation.Nullable + private List<ProfileRequestModelFavoriteThingsInner> favoriteThings = new ArrayList<>(); + + public static final String SERIALIZED_NAME_RELATED_PROFILE_VIEWS = "RelatedProfileViews"; + @SerializedName(SERIALIZED_NAME_RELATED_PROFILE_VIEWS) + @javax.annotation.Nullable + private List<ProfileRequestModelRelatedProfileViewsInner> relatedProfileViews = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PLACES_LIVED = "PlacesLived"; + @SerializedName(SERIALIZED_NAME_PLACES_LIVED) + @javax.annotation.Nullable + private List<ProfileRequestModelPlacesLivedInner> placesLived = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PUBLICATIONS = "Publications"; + @SerializedName(SERIALIZED_NAME_PUBLICATIONS) + @javax.annotation.Nullable + private List<ProfileRequestModelPublicationsInner> publications = new ArrayList<>(); + + public static final String SERIALIZED_NAME_JOB_BOOKMARKS = "JobBookmarks"; + @SerializedName(SERIALIZED_NAME_JOB_BOOKMARKS) + @javax.annotation.Nullable + private List<ProfileRequestModelJobBookmarksInner> jobBookmarks = new ArrayList<>(); + + public static final String SERIALIZED_NAME_BADGES = "Badges"; + @SerializedName(SERIALIZED_NAME_BADGES) + @javax.annotation.Nullable + private List<ProfileRequestModelBadgesInner> badges = new ArrayList<>(); + + public static final String SERIALIZED_NAME_MEMBER_URL_RESOURCES = "MemberUrlResources"; + @SerializedName(SERIALIZED_NAME_MEMBER_URL_RESOURCES) + @javax.annotation.Nullable + private List<ProfileRequestModelMemberUrlResourcesInner> memberUrlResources = new ArrayList<>(); + + public static final String SERIALIZED_NAME_EXTERNAL_IDS = "ExternalIds"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_IDS) + @javax.annotation.Nullable + private List<ProfileRequestModelExternalIdsInner> externalIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_IS_EMAIL_SUBSCRIBED = "IsEmailSubscribed"; + @SerializedName(SERIALIZED_NAME_IS_EMAIL_SUBSCRIBED) + @javax.annotation.Nullable + private Boolean isEmailSubscribed; + + public static final String SERIALIZED_NAME_IS_PROTECTED = "IsProtected"; + @SerializedName(SERIALIZED_NAME_IS_PROTECTED) + @javax.annotation.Nullable + private Boolean isProtected; + + public static final String SERIALIZED_NAME_HIREABLE = "Hireable"; + @SerializedName(SERIALIZED_NAME_HIREABLE) + @javax.annotation.Nullable + private Boolean hireable; + + public static final String SERIALIZED_NAME_DISABLE_LOGIN = "DisableLogin"; + @SerializedName(SERIALIZED_NAME_DISABLE_LOGIN) + @javax.annotation.Nullable + private Boolean disableLogin; + + public static final String SERIALIZED_NAME_ACCEPT_PRIVACY_POLICY = "AcceptPrivacyPolicy"; + @SerializedName(SERIALIZED_NAME_ACCEPT_PRIVACY_POLICY) + @javax.annotation.Nullable + private Boolean acceptPrivacyPolicy; + + public static final String SERIALIZED_NAME_REGISTRATION_SOURCE = "RegistrationSource"; + @SerializedName(SERIALIZED_NAME_REGISTRATION_SOURCE) + @javax.annotation.Nullable + private String registrationSource; + + 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_CONSENTS = "Consents"; + @SerializedName(SERIALIZED_NAME_CONSENTS) + @javax.annotation.Nullable + private ProfileRequestModelConsents consents; + + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private List<ProfileRequestModelEmailInner> email = new ArrayList<>(); + + public PasskeyRegisterFinish() { + } + + public PasskeyRegisterFinish passkeyCredential(@javax.annotation.Nullable PasskeyCredentialCreationResponse passkeyCredential) { + this.passkeyCredential = passkeyCredential; + return this; + } + + /** + * Get passkeyCredential + * @return passkeyCredential + */ + @javax.annotation.Nullable + public PasskeyCredentialCreationResponse getPasskeyCredential() { + return passkeyCredential; + } + + public void setPasskeyCredential(@javax.annotation.Nullable PasskeyCredentialCreationResponse passkeyCredential) { + this.passkeyCredential = passkeyCredential; + } + + + public PasskeyRegisterFinish gender(@javax.annotation.Nullable String gender) { + this.gender = gender; + return this; + } + + /** + * Get gender + * @return gender + */ + @javax.annotation.Nullable + public String getGender() { + return gender; + } + + public void setGender(@javax.annotation.Nullable String gender) { + this.gender = gender; + } + + + public PasskeyRegisterFinish birthDate(@javax.annotation.Nullable String birthDate) { + this.birthDate = birthDate; + return this; + } + + /** + * Get birthDate + * @return birthDate + */ + @javax.annotation.Nullable + public String getBirthDate() { + return birthDate; + } + + public void setBirthDate(@javax.annotation.Nullable String birthDate) { + this.birthDate = birthDate; + } + + + public PasskeyRegisterFinish prefix(@javax.annotation.Nullable String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Get prefix + * @return prefix + */ + @javax.annotation.Nullable + public String getPrefix() { + return prefix; + } + + public void setPrefix(@javax.annotation.Nullable String prefix) { + this.prefix = prefix; + } + + + public PasskeyRegisterFinish firstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + */ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + } + + + public PasskeyRegisterFinish middleName(@javax.annotation.Nullable String middleName) { + this.middleName = middleName; + return this; + } + + /** + * Get middleName + * @return middleName + */ + @javax.annotation.Nullable + public String getMiddleName() { + return middleName; + } + + public void setMiddleName(@javax.annotation.Nullable String middleName) { + this.middleName = middleName; + } + + + public PasskeyRegisterFinish lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + + public PasskeyRegisterFinish suffix(@javax.annotation.Nullable String suffix) { + this.suffix = suffix; + return this; + } + + /** + * Get suffix + * @return suffix + */ + @javax.annotation.Nullable + public String getSuffix() { + return suffix; + } + + public void setSuffix(@javax.annotation.Nullable String suffix) { + this.suffix = suffix; + } + + + public PasskeyRegisterFinish nickName(@javax.annotation.Nullable String nickName) { + this.nickName = nickName; + return this; + } + + /** + * Get nickName + * @return nickName + */ + @javax.annotation.Nullable + public String getNickName() { + return nickName; + } + + public void setNickName(@javax.annotation.Nullable String nickName) { + this.nickName = nickName; + } + + + public PasskeyRegisterFinish profileName(@javax.annotation.Nullable String profileName) { + this.profileName = profileName; + return this; + } + + /** + * Get profileName + * @return profileName + */ + @javax.annotation.Nullable + public String getProfileName() { + return profileName; + } + + public void setProfileName(@javax.annotation.Nullable String profileName) { + this.profileName = profileName; + } + + + public PasskeyRegisterFinish about(@javax.annotation.Nullable String about) { + this.about = about; + return this; + } + + /** + * Get about + * @return about + */ + @javax.annotation.Nullable + public String getAbout() { + return about; + } + + public void setAbout(@javax.annotation.Nullable String about) { + this.about = about; + } + + + public PasskeyRegisterFinish company(@javax.annotation.Nullable String company) { + this.company = company; + return this; + } + + /** + * Get company + * @return company + */ + @javax.annotation.Nullable + public String getCompany() { + return company; + } + + public void setCompany(@javax.annotation.Nullable String company) { + this.company = company; + } + + + public PasskeyRegisterFinish imageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** + * Get imageUrl + * @return imageUrl + */ + @javax.annotation.Nullable + public String getImageUrl() { + return imageUrl; + } + + public void setImageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + } + + + public PasskeyRegisterFinish timeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * Get timeZone + * @return timeZone + */ + @javax.annotation.Nullable + public String getTimeZone() { + return timeZone; + } + + public void setTimeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + } + + + public PasskeyRegisterFinish website(@javax.annotation.Nullable String website) { + this.website = website; + return this; + } + + /** + * Get website + * @return website + */ + @javax.annotation.Nullable + public String getWebsite() { + return website; + } + + public void setWebsite(@javax.annotation.Nullable String website) { + this.website = website; + } + + + public PasskeyRegisterFinish thumbnailImageUrl(@javax.annotation.Nullable String thumbnailImageUrl) { + this.thumbnailImageUrl = thumbnailImageUrl; + return this; + } + + /** + * Get thumbnailImageUrl + * @return thumbnailImageUrl + */ + @javax.annotation.Nullable + public String getThumbnailImageUrl() { + return thumbnailImageUrl; + } + + public void setThumbnailImageUrl(@javax.annotation.Nullable String thumbnailImageUrl) { + this.thumbnailImageUrl = thumbnailImageUrl; + } + + + public PasskeyRegisterFinish favicon(@javax.annotation.Nullable String favicon) { + this.favicon = favicon; + return this; + } + + /** + * Get favicon + * @return favicon + */ + @javax.annotation.Nullable + public String getFavicon() { + return favicon; + } + + public void setFavicon(@javax.annotation.Nullable String favicon) { + this.favicon = favicon; + } + + + public PasskeyRegisterFinish profileUrl(@javax.annotation.Nullable String profileUrl) { + this.profileUrl = profileUrl; + return this; + } + + /** + * Get profileUrl + * @return profileUrl + */ + @javax.annotation.Nullable + public String getProfileUrl() { + return profileUrl; + } + + public void setProfileUrl(@javax.annotation.Nullable String profileUrl) { + this.profileUrl = profileUrl; + } + + + public PasskeyRegisterFinish homeTown(@javax.annotation.Nullable String homeTown) { + this.homeTown = homeTown; + return this; + } + + /** + * Get homeTown + * @return homeTown + */ + @javax.annotation.Nullable + public String getHomeTown() { + return homeTown; + } + + public void setHomeTown(@javax.annotation.Nullable String homeTown) { + this.homeTown = homeTown; + } + + + public PasskeyRegisterFinish state(@javax.annotation.Nullable String state) { + this.state = state; + return this; + } + + /** + * Get state + * @return state + */ + @javax.annotation.Nullable + public String getState() { + return state; + } + + public void setState(@javax.annotation.Nullable String state) { + this.state = state; + } + + + public PasskeyRegisterFinish city(@javax.annotation.Nullable String city) { + this.city = city; + return this; + } + + /** + * Get city + * @return city + */ + @javax.annotation.Nullable + public String getCity() { + return city; + } + + public void setCity(@javax.annotation.Nullable String city) { + this.city = city; + } + + + public PasskeyRegisterFinish industry(@javax.annotation.Nullable String industry) { + this.industry = industry; + return this; + } + + /** + * Get industry + * @return industry + */ + @javax.annotation.Nullable + public String getIndustry() { + return industry; + } + + public void setIndustry(@javax.annotation.Nullable String industry) { + this.industry = industry; + } + + + public PasskeyRegisterFinish localLanguage(@javax.annotation.Nullable String localLanguage) { + this.localLanguage = localLanguage; + return this; + } + + /** + * Get localLanguage + * @return localLanguage + */ + @javax.annotation.Nullable + public String getLocalLanguage() { + return localLanguage; + } + + public void setLocalLanguage(@javax.annotation.Nullable String localLanguage) { + this.localLanguage = localLanguage; + } + + + public PasskeyRegisterFinish language(@javax.annotation.Nullable String language) { + this.language = language; + return this; + } + + /** + * Get language + * @return language + */ + @javax.annotation.Nullable + public String getLanguage() { + return language; + } + + public void setLanguage(@javax.annotation.Nullable String language) { + this.language = language; + } + + + public PasskeyRegisterFinish coverPhoto(@javax.annotation.Nullable String coverPhoto) { + this.coverPhoto = coverPhoto; + return this; + } + + /** + * Get coverPhoto + * @return coverPhoto + */ + @javax.annotation.Nullable + public String getCoverPhoto() { + return coverPhoto; + } + + public void setCoverPhoto(@javax.annotation.Nullable String coverPhoto) { + this.coverPhoto = coverPhoto; + } + + + public PasskeyRegisterFinish tagLine(@javax.annotation.Nullable String tagLine) { + this.tagLine = tagLine; + return this; + } + + /** + * Get tagLine + * @return tagLine + */ + @javax.annotation.Nullable + public String getTagLine() { + return tagLine; + } + + public void setTagLine(@javax.annotation.Nullable String tagLine) { + this.tagLine = tagLine; + } + + + public PasskeyRegisterFinish mainAddress(@javax.annotation.Nullable String mainAddress) { + this.mainAddress = mainAddress; + return this; + } + + /** + * Get mainAddress + * @return mainAddress + */ + @javax.annotation.Nullable + public String getMainAddress() { + return mainAddress; + } + + public void setMainAddress(@javax.annotation.Nullable String mainAddress) { + this.mainAddress = mainAddress; + } + + + public PasskeyRegisterFinish localCity(@javax.annotation.Nullable String localCity) { + this.localCity = localCity; + return this; + } + + /** + * Get localCity + * @return localCity + */ + @javax.annotation.Nullable + public String getLocalCity() { + return localCity; + } + + public void setLocalCity(@javax.annotation.Nullable String localCity) { + this.localCity = localCity; + } + + + public PasskeyRegisterFinish profileCity(@javax.annotation.Nullable String profileCity) { + this.profileCity = profileCity; + return this; + } + + /** + * Get profileCity + * @return profileCity + */ + @javax.annotation.Nullable + public String getProfileCity() { + return profileCity; + } + + public void setProfileCity(@javax.annotation.Nullable String profileCity) { + this.profileCity = profileCity; + } + + + public PasskeyRegisterFinish localCountry(@javax.annotation.Nullable String localCountry) { + this.localCountry = localCountry; + return this; + } + + /** + * Get localCountry + * @return localCountry + */ + @javax.annotation.Nullable + public String getLocalCountry() { + return localCountry; + } + + public void setLocalCountry(@javax.annotation.Nullable String localCountry) { + this.localCountry = localCountry; + } + + + public PasskeyRegisterFinish profileCountry(@javax.annotation.Nullable String profileCountry) { + this.profileCountry = profileCountry; + return this; + } + + /** + * Get profileCountry + * @return profileCountry + */ + @javax.annotation.Nullable + public String getProfileCountry() { + return profileCountry; + } + + public void setProfileCountry(@javax.annotation.Nullable String profileCountry) { + this.profileCountry = profileCountry; + } + + + public PasskeyRegisterFinish quota(@javax.annotation.Nullable String quota) { + this.quota = quota; + return this; + } + + /** + * Get quota + * @return quota + */ + @javax.annotation.Nullable + public String getQuota() { + return quota; + } + + public void setQuota(@javax.annotation.Nullable String quota) { + this.quota = quota; + } + + + public PasskeyRegisterFinish religion(@javax.annotation.Nullable String religion) { + this.religion = religion; + return this; + } + + /** + * Get religion + * @return religion + */ + @javax.annotation.Nullable + public String getReligion() { + return religion; + } + + public void setReligion(@javax.annotation.Nullable String religion) { + this.religion = religion; + } + + + public PasskeyRegisterFinish political(@javax.annotation.Nullable String political) { + this.political = political; + return this; + } + + /** + * Get political + * @return political + */ + @javax.annotation.Nullable + public String getPolitical() { + return political; + } + + public void setPolitical(@javax.annotation.Nullable String political) { + this.political = political; + } + + + public PasskeyRegisterFinish relationshipStatus(@javax.annotation.Nullable String relationshipStatus) { + this.relationshipStatus = relationshipStatus; + return this; + } + + /** + * Get relationshipStatus + * @return relationshipStatus + */ + @javax.annotation.Nullable + public String getRelationshipStatus() { + return relationshipStatus; + } + + public void setRelationshipStatus(@javax.annotation.Nullable String relationshipStatus) { + this.relationshipStatus = relationshipStatus; + } + + + public PasskeyRegisterFinish httpsImageUrl(@javax.annotation.Nullable String httpsImageUrl) { + this.httpsImageUrl = httpsImageUrl; + return this; + } + + /** + * Get httpsImageUrl + * @return httpsImageUrl + */ + @javax.annotation.Nullable + public String getHttpsImageUrl() { + return httpsImageUrl; + } + + public void setHttpsImageUrl(@javax.annotation.Nullable String httpsImageUrl) { + this.httpsImageUrl = httpsImageUrl; + } + + + public PasskeyRegisterFinish isGeoEnabled(@javax.annotation.Nullable String isGeoEnabled) { + this.isGeoEnabled = isGeoEnabled; + return this; + } + + /** + * Get isGeoEnabled + * @return isGeoEnabled + */ + @javax.annotation.Nullable + public String getIsGeoEnabled() { + return isGeoEnabled; + } + + public void setIsGeoEnabled(@javax.annotation.Nullable String isGeoEnabled) { + this.isGeoEnabled = isGeoEnabled; + } + + + public PasskeyRegisterFinish associations(@javax.annotation.Nullable String associations) { + this.associations = associations; + return this; + } + + /** + * Get associations + * @return associations + */ + @javax.annotation.Nullable + public String getAssociations() { + return associations; + } + + public void setAssociations(@javax.annotation.Nullable String associations) { + this.associations = associations; + } + + + public PasskeyRegisterFinish honors(@javax.annotation.Nullable String honors) { + this.honors = honors; + return this; + } + + /** + * Get honors + * @return honors + */ + @javax.annotation.Nullable + public String getHonors() { + return honors; + } + + public void setHonors(@javax.annotation.Nullable String honors) { + this.honors = honors; + } + + + public PasskeyRegisterFinish publicRepository(@javax.annotation.Nullable String publicRepository) { + this.publicRepository = publicRepository; + return this; + } + + /** + * Get publicRepository + * @return publicRepository + */ + @javax.annotation.Nullable + public String getPublicRepository() { + return publicRepository; + } + + public void setPublicRepository(@javax.annotation.Nullable String publicRepository) { + this.publicRepository = publicRepository; + } + + + public PasskeyRegisterFinish repositoryUrl(@javax.annotation.Nullable String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + return this; + } + + /** + * Get repositoryUrl + * @return repositoryUrl + */ + @javax.annotation.Nullable + public String getRepositoryUrl() { + return repositoryUrl; + } + + public void setRepositoryUrl(@javax.annotation.Nullable String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + } + + + public PasskeyRegisterFinish professionalHeadline(@javax.annotation.Nullable String professionalHeadline) { + this.professionalHeadline = professionalHeadline; + return this; + } + + /** + * Get professionalHeadline + * @return professionalHeadline + */ + @javax.annotation.Nullable + public String getProfessionalHeadline() { + return professionalHeadline; + } + + public void setProfessionalHeadline(@javax.annotation.Nullable String professionalHeadline) { + this.professionalHeadline = professionalHeadline; + } + + + public PasskeyRegisterFinish currency(@javax.annotation.Nullable String currency) { + this.currency = currency; + return this; + } + + /** + * Get currency + * @return currency + */ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + public void setCurrency(@javax.annotation.Nullable String currency) { + this.currency = currency; + } + + + public PasskeyRegisterFinish starredUrl(@javax.annotation.Nullable String starredUrl) { + this.starredUrl = starredUrl; + return this; + } + + /** + * Get starredUrl + * @return starredUrl + */ + @javax.annotation.Nullable + public String getStarredUrl() { + return starredUrl; + } + + public void setStarredUrl(@javax.annotation.Nullable String starredUrl) { + this.starredUrl = starredUrl; + } + + + public PasskeyRegisterFinish gistsUrl(@javax.annotation.Nullable String gistsUrl) { + this.gistsUrl = gistsUrl; + return this; + } + + /** + * Get gistsUrl + * @return gistsUrl + */ + @javax.annotation.Nullable + public String getGistsUrl() { + return gistsUrl; + } + + public void setGistsUrl(@javax.annotation.Nullable String gistsUrl) { + this.gistsUrl = gistsUrl; + } + + + public PasskeyRegisterFinish gravatarImageUrl(@javax.annotation.Nullable String gravatarImageUrl) { + this.gravatarImageUrl = gravatarImageUrl; + return this; + } + + /** + * Get gravatarImageUrl + * @return gravatarImageUrl + */ + @javax.annotation.Nullable + public String getGravatarImageUrl() { + return gravatarImageUrl; + } + + public void setGravatarImageUrl(@javax.annotation.Nullable String gravatarImageUrl) { + this.gravatarImageUrl = gravatarImageUrl; + } + + + public PasskeyRegisterFinish externalUserLoginId(@javax.annotation.Nullable String externalUserLoginId) { + this.externalUserLoginId = externalUserLoginId; + return this; + } + + /** + * Get externalUserLoginId + * @return externalUserLoginId + */ + @javax.annotation.Nullable + public String getExternalUserLoginId() { + return externalUserLoginId; + } + + public void setExternalUserLoginId(@javax.annotation.Nullable String externalUserLoginId) { + this.externalUserLoginId = externalUserLoginId; + } + + + public PasskeyRegisterFinish interestedIn(@javax.annotation.Nullable List<String> interestedIn) { + this.interestedIn = interestedIn; + return this; + } + + public PasskeyRegisterFinish addInterestedInItem(String interestedInItem) { + if (this.interestedIn == null) { + this.interestedIn = new ArrayList<>(); + } + this.interestedIn.add(interestedInItem); + return this; + } + + /** + * Get interestedIn + * @return interestedIn + */ + @javax.annotation.Nullable + public List<String> getInterestedIn() { + return interestedIn; + } + + public void setInterestedIn(@javax.annotation.Nullable List<String> interestedIn) { + this.interestedIn = interestedIn; + } + + + public PasskeyRegisterFinish followersCount(@javax.annotation.Nullable Integer followersCount) { + this.followersCount = followersCount; + return this; + } + + /** + * Get followersCount + * @return followersCount + */ + @javax.annotation.Nullable + public Integer getFollowersCount() { + return followersCount; + } + + public void setFollowersCount(@javax.annotation.Nullable Integer followersCount) { + this.followersCount = followersCount; + } + + + public PasskeyRegisterFinish friendsCount(@javax.annotation.Nullable Integer friendsCount) { + this.friendsCount = friendsCount; + return this; + } + + /** + * Get friendsCount + * @return friendsCount + */ + @javax.annotation.Nullable + public Integer getFriendsCount() { + return friendsCount; + } + + public void setFriendsCount(@javax.annotation.Nullable Integer friendsCount) { + this.friendsCount = friendsCount; + } + + + public PasskeyRegisterFinish totalStatusesCount(@javax.annotation.Nullable Integer totalStatusesCount) { + this.totalStatusesCount = totalStatusesCount; + return this; + } + + /** + * Get totalStatusesCount + * @return totalStatusesCount + */ + @javax.annotation.Nullable + public Integer getTotalStatusesCount() { + return totalStatusesCount; + } + + public void setTotalStatusesCount(@javax.annotation.Nullable Integer totalStatusesCount) { + this.totalStatusesCount = totalStatusesCount; + } + + + public PasskeyRegisterFinish numRecommenders(@javax.annotation.Nullable Integer numRecommenders) { + this.numRecommenders = numRecommenders; + return this; + } + + /** + * Get numRecommenders + * @return numRecommenders + */ + @javax.annotation.Nullable + public Integer getNumRecommenders() { + return numRecommenders; + } + + public void setNumRecommenders(@javax.annotation.Nullable Integer numRecommenders) { + this.numRecommenders = numRecommenders; + } + + + public PasskeyRegisterFinish totalPrivateRepository(@javax.annotation.Nullable Integer totalPrivateRepository) { + this.totalPrivateRepository = totalPrivateRepository; + return this; + } + + /** + * Get totalPrivateRepository + * @return totalPrivateRepository + */ + @javax.annotation.Nullable + public Integer getTotalPrivateRepository() { + return totalPrivateRepository; + } + + public void setTotalPrivateRepository(@javax.annotation.Nullable Integer totalPrivateRepository) { + this.totalPrivateRepository = totalPrivateRepository; + } + + + public PasskeyRegisterFinish publicGists(@javax.annotation.Nullable Integer publicGists) { + this.publicGists = publicGists; + return this; + } + + /** + * Get publicGists + * @return publicGists + */ + @javax.annotation.Nullable + public Integer getPublicGists() { + return publicGists; + } + + public void setPublicGists(@javax.annotation.Nullable Integer publicGists) { + this.publicGists = publicGists; + } + + + public PasskeyRegisterFinish privateGists(@javax.annotation.Nullable Integer privateGists) { + this.privateGists = privateGists; + return this; + } + + /** + * Get privateGists + * @return privateGists + */ + @javax.annotation.Nullable + public Integer getPrivateGists() { + return privateGists; + } + + public void setPrivateGists(@javax.annotation.Nullable Integer privateGists) { + this.privateGists = privateGists; + } + + + public PasskeyRegisterFinish sessionLimit(@javax.annotation.Nullable Integer sessionLimit) { + this.sessionLimit = sessionLimit; + return this; + } + + /** + * Get sessionLimit + * @return sessionLimit + */ + @javax.annotation.Nullable + public Integer getSessionLimit() { + return sessionLimit; + } + + public void setSessionLimit(@javax.annotation.Nullable Integer sessionLimit) { + this.sessionLimit = sessionLimit; + } + + + public PasskeyRegisterFinish customFields(@javax.annotation.Nullable Map<String, String> customFields) { + this.customFields = customFields; + return this; + } + + public PasskeyRegisterFinish putCustomFieldsItem(String key, String customFieldsItem) { + if (this.customFields == null) { + this.customFields = new HashMap<>(); + } + this.customFields.put(key, customFieldsItem); + return this; + } + + /** + * Get customFields + * @return customFields + */ + @javax.annotation.Nullable + public Map<String, String> getCustomFields() { + return customFields; + } + + public void setCustomFields(@javax.annotation.Nullable Map<String, String> customFields) { + this.customFields = customFields; + } + + + public PasskeyRegisterFinish profileImageUrls(@javax.annotation.Nullable Map<String, String> profileImageUrls) { + this.profileImageUrls = profileImageUrls; + return this; + } + + public PasskeyRegisterFinish putProfileImageUrlsItem(String key, String profileImageUrlsItem) { + if (this.profileImageUrls == null) { + this.profileImageUrls = new HashMap<>(); + } + this.profileImageUrls.put(key, profileImageUrlsItem); + return this; + } + + /** + * Get profileImageUrls + * @return profileImageUrls + */ + @javax.annotation.Nullable + public Map<String, String> getProfileImageUrls() { + return profileImageUrls; + } + + public void setProfileImageUrls(@javax.annotation.Nullable Map<String, String> profileImageUrls) { + this.profileImageUrls = profileImageUrls; + } + + + public PasskeyRegisterFinish webProfiles(@javax.annotation.Nullable Map<String, String> webProfiles) { + this.webProfiles = webProfiles; + return this; + } + + public PasskeyRegisterFinish putWebProfilesItem(String key, String webProfilesItem) { + if (this.webProfiles == null) { + this.webProfiles = new HashMap<>(); + } + this.webProfiles.put(key, webProfilesItem); + return this; + } + + /** + * Get webProfiles + * @return webProfiles + */ + @javax.annotation.Nullable + public Map<String, String> getWebProfiles() { + return webProfiles; + } + + public void setWebProfiles(@javax.annotation.Nullable Map<String, String> webProfiles) { + this.webProfiles = webProfiles; + } + + + public PasskeyRegisterFinish securityQuestionAnswer(@javax.annotation.Nullable Map<String, String> securityQuestionAnswer) { + this.securityQuestionAnswer = securityQuestionAnswer; + return this; + } + + public PasskeyRegisterFinish putSecurityQuestionAnswerItem(String key, String securityQuestionAnswerItem) { + if (this.securityQuestionAnswer == null) { + this.securityQuestionAnswer = new HashMap<>(); + } + this.securityQuestionAnswer.put(key, securityQuestionAnswerItem); + return this; + } + + /** + * Get securityQuestionAnswer + * @return securityQuestionAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityQuestionAnswer() { + return securityQuestionAnswer; + } + + public void setSecurityQuestionAnswer(@javax.annotation.Nullable Map<String, String> securityQuestionAnswer) { + this.securityQuestionAnswer = securityQuestionAnswer; + } + + + public PasskeyRegisterFinish country(@javax.annotation.Nullable ProfileRequestModelCountry country) { + this.country = country; + return this; + } + + /** + * Get country + * @return country + */ + @javax.annotation.Nullable + public ProfileRequestModelCountry getCountry() { + return country; + } + + public void setCountry(@javax.annotation.Nullable ProfileRequestModelCountry country) { + this.country = country; + } + + + public PasskeyRegisterFinish suggestions(@javax.annotation.Nullable ProfileRequestModelSuggestions suggestions) { + this.suggestions = suggestions; + return this; + } + + /** + * Get suggestions + * @return suggestions + */ + @javax.annotation.Nullable + public ProfileRequestModelSuggestions getSuggestions() { + return suggestions; + } + + public void setSuggestions(@javax.annotation.Nullable ProfileRequestModelSuggestions suggestions) { + this.suggestions = suggestions; + } + + + public PasskeyRegisterFinish subscription(@javax.annotation.Nullable ProfileRequestModelSubscription subscription) { + this.subscription = subscription; + return this; + } + + /** + * Get subscription + * @return subscription + */ + @javax.annotation.Nullable + public ProfileRequestModelSubscription getSubscription() { + return subscription; + } + + public void setSubscription(@javax.annotation.Nullable ProfileRequestModelSubscription subscription) { + this.subscription = subscription; + } + + + public PasskeyRegisterFinish privacyPolicy(@javax.annotation.Nullable ProfileRequestModelPrivacyPolicy privacyPolicy) { + this.privacyPolicy = privacyPolicy; + return this; + } + + /** + * Get privacyPolicy + * @return privacyPolicy + */ + @javax.annotation.Nullable + public ProfileRequestModelPrivacyPolicy getPrivacyPolicy() { + return privacyPolicy; + } + + public void setPrivacyPolicy(@javax.annotation.Nullable ProfileRequestModelPrivacyPolicy privacyPolicy) { + this.privacyPolicy = privacyPolicy; + } + + + public PasskeyRegisterFinish piNInfo(@javax.annotation.Nullable ProfileRequestModelPINInfo piNInfo) { + this.piNInfo = piNInfo; + return this; + } + + /** + * Get piNInfo + * @return piNInfo + */ + @javax.annotation.Nullable + public ProfileRequestModelPINInfo getPiNInfo() { + return piNInfo; + } + + public void setPiNInfo(@javax.annotation.Nullable ProfileRequestModelPINInfo piNInfo) { + this.piNInfo = piNInfo; + } + + + public PasskeyRegisterFinish addresses(@javax.annotation.Nullable List<ProfileRequestModelAddressesInner> addresses) { + this.addresses = addresses; + return this; + } + + public PasskeyRegisterFinish addAddressesItem(ProfileRequestModelAddressesInner addressesItem) { + if (this.addresses == null) { + this.addresses = new ArrayList<>(); + } + this.addresses.add(addressesItem); + return this; + } + + /** + * Get addresses + * @return addresses + */ + @javax.annotation.Nullable + public List<ProfileRequestModelAddressesInner> getAddresses() { + return addresses; + } + + public void setAddresses(@javax.annotation.Nullable List<ProfileRequestModelAddressesInner> addresses) { + this.addresses = addresses; + } + + + public PasskeyRegisterFinish positions(@javax.annotation.Nullable List<ProfileRequestModelPositionsInner> positions) { + this.positions = positions; + return this; + } + + public PasskeyRegisterFinish addPositionsItem(ProfileRequestModelPositionsInner positionsItem) { + if (this.positions == null) { + this.positions = new ArrayList<>(); + } + this.positions.add(positionsItem); + return this; + } + + /** + * Get positions + * @return positions + */ + @javax.annotation.Nullable + public List<ProfileRequestModelPositionsInner> getPositions() { + return positions; + } + + public void setPositions(@javax.annotation.Nullable List<ProfileRequestModelPositionsInner> positions) { + this.positions = positions; + } + + + public PasskeyRegisterFinish educations(@javax.annotation.Nullable List<ProfileRequestModelEducationsInner> educations) { + this.educations = educations; + return this; + } + + public PasskeyRegisterFinish addEducationsItem(ProfileRequestModelEducationsInner educationsItem) { + if (this.educations == null) { + this.educations = new ArrayList<>(); + } + this.educations.add(educationsItem); + return this; + } + + /** + * Get educations + * @return educations + */ + @javax.annotation.Nullable + public List<ProfileRequestModelEducationsInner> getEducations() { + return educations; + } + + public void setEducations(@javax.annotation.Nullable List<ProfileRequestModelEducationsInner> educations) { + this.educations = educations; + } + + + public PasskeyRegisterFinish phoneNumbers(@javax.annotation.Nullable List<ProfileRequestModelPhoneNumbersInner> phoneNumbers) { + this.phoneNumbers = phoneNumbers; + return this; + } + + public PasskeyRegisterFinish addPhoneNumbersItem(ProfileRequestModelPhoneNumbersInner phoneNumbersItem) { + if (this.phoneNumbers == null) { + this.phoneNumbers = new ArrayList<>(); + } + this.phoneNumbers.add(phoneNumbersItem); + return this; + } + + /** + * Get phoneNumbers + * @return phoneNumbers + */ + @javax.annotation.Nullable + public List<ProfileRequestModelPhoneNumbersInner> getPhoneNumbers() { + return phoneNumbers; + } + + public void setPhoneNumbers(@javax.annotation.Nullable List<ProfileRequestModelPhoneNumbersInner> phoneNumbers) { + this.phoneNumbers = phoneNumbers; + } + + + public PasskeyRegisterFinish imAccounts(@javax.annotation.Nullable List<ProfileRequestModelIMAccountsInner> imAccounts) { + this.imAccounts = imAccounts; + return this; + } + + public PasskeyRegisterFinish addImAccountsItem(ProfileRequestModelIMAccountsInner imAccountsItem) { + if (this.imAccounts == null) { + this.imAccounts = new ArrayList<>(); + } + this.imAccounts.add(imAccountsItem); + return this; + } + + /** + * Get imAccounts + * @return imAccounts + */ + @javax.annotation.Nullable + public List<ProfileRequestModelIMAccountsInner> getImAccounts() { + return imAccounts; + } + + public void setImAccounts(@javax.annotation.Nullable List<ProfileRequestModelIMAccountsInner> imAccounts) { + this.imAccounts = imAccounts; + } + + + public PasskeyRegisterFinish interests(@javax.annotation.Nullable List<ProfileRequestModelInterestsInner> interests) { + this.interests = interests; + return this; + } + + public PasskeyRegisterFinish addInterestsItem(ProfileRequestModelInterestsInner interestsItem) { + if (this.interests == null) { + this.interests = new ArrayList<>(); + } + this.interests.add(interestsItem); + return this; + } + + /** + * Get interests + * @return interests + */ + @javax.annotation.Nullable + public List<ProfileRequestModelInterestsInner> getInterests() { + return interests; + } + + public void setInterests(@javax.annotation.Nullable List<ProfileRequestModelInterestsInner> interests) { + this.interests = interests; + } + + + public PasskeyRegisterFinish sports(@javax.annotation.Nullable List<ProfileRequestModelSportsInner> sports) { + this.sports = sports; + return this; + } + + public PasskeyRegisterFinish addSportsItem(ProfileRequestModelSportsInner sportsItem) { + if (this.sports == null) { + this.sports = new ArrayList<>(); + } + this.sports.add(sportsItem); + return this; + } + + /** + * Get sports + * @return sports + */ + @javax.annotation.Nullable + public List<ProfileRequestModelSportsInner> getSports() { + return sports; + } + + public void setSports(@javax.annotation.Nullable List<ProfileRequestModelSportsInner> sports) { + this.sports = sports; + } + + + public PasskeyRegisterFinish inspirationalPeople(@javax.annotation.Nullable List<ProfileRequestModelInspirationalPeopleInner> inspirationalPeople) { + this.inspirationalPeople = inspirationalPeople; + return this; + } + + public PasskeyRegisterFinish addInspirationalPeopleItem(ProfileRequestModelInspirationalPeopleInner inspirationalPeopleItem) { + if (this.inspirationalPeople == null) { + this.inspirationalPeople = new ArrayList<>(); + } + this.inspirationalPeople.add(inspirationalPeopleItem); + return this; + } + + /** + * Get inspirationalPeople + * @return inspirationalPeople + */ + @javax.annotation.Nullable + public List<ProfileRequestModelInspirationalPeopleInner> getInspirationalPeople() { + return inspirationalPeople; + } + + public void setInspirationalPeople(@javax.annotation.Nullable List<ProfileRequestModelInspirationalPeopleInner> inspirationalPeople) { + this.inspirationalPeople = inspirationalPeople; + } + + + public PasskeyRegisterFinish awards(@javax.annotation.Nullable List<ProfileRequestModelAwardsInner> awards) { + this.awards = awards; + return this; + } + + public PasskeyRegisterFinish addAwardsItem(ProfileRequestModelAwardsInner awardsItem) { + if (this.awards == null) { + this.awards = new ArrayList<>(); + } + this.awards.add(awardsItem); + return this; + } + + /** + * Get awards + * @return awards + */ + @javax.annotation.Nullable + public List<ProfileRequestModelAwardsInner> getAwards() { + return awards; + } + + public void setAwards(@javax.annotation.Nullable List<ProfileRequestModelAwardsInner> awards) { + this.awards = awards; + } + + + public PasskeyRegisterFinish skills(@javax.annotation.Nullable List<ProfileRequestModelSkillsInner> skills) { + this.skills = skills; + return this; + } + + public PasskeyRegisterFinish addSkillsItem(ProfileRequestModelSkillsInner skillsItem) { + if (this.skills == null) { + this.skills = new ArrayList<>(); + } + this.skills.add(skillsItem); + return this; + } + + /** + * Get skills + * @return skills + */ + @javax.annotation.Nullable + public List<ProfileRequestModelSkillsInner> getSkills() { + return skills; + } + + public void setSkills(@javax.annotation.Nullable List<ProfileRequestModelSkillsInner> skills) { + this.skills = skills; + } + + + public PasskeyRegisterFinish currentStatus(@javax.annotation.Nullable List<ProfileRequestModelCurrentStatusInner> currentStatus) { + this.currentStatus = currentStatus; + return this; + } + + public PasskeyRegisterFinish addCurrentStatusItem(ProfileRequestModelCurrentStatusInner currentStatusItem) { + if (this.currentStatus == null) { + this.currentStatus = new ArrayList<>(); + } + this.currentStatus.add(currentStatusItem); + return this; + } + + /** + * Get currentStatus + * @return currentStatus + */ + @javax.annotation.Nullable + public List<ProfileRequestModelCurrentStatusInner> getCurrentStatus() { + return currentStatus; + } + + public void setCurrentStatus(@javax.annotation.Nullable List<ProfileRequestModelCurrentStatusInner> currentStatus) { + this.currentStatus = currentStatus; + } + + + public PasskeyRegisterFinish certifications(@javax.annotation.Nullable List<ProfileRequestModelCertificationsInner> certifications) { + this.certifications = certifications; + return this; + } + + public PasskeyRegisterFinish addCertificationsItem(ProfileRequestModelCertificationsInner certificationsItem) { + if (this.certifications == null) { + this.certifications = new ArrayList<>(); + } + this.certifications.add(certificationsItem); + return this; + } + + /** + * Get certifications + * @return certifications + */ + @javax.annotation.Nullable + public List<ProfileRequestModelCertificationsInner> getCertifications() { + return certifications; + } + + public void setCertifications(@javax.annotation.Nullable List<ProfileRequestModelCertificationsInner> certifications) { + this.certifications = certifications; + } + + + public PasskeyRegisterFinish courses(@javax.annotation.Nullable List<ProfileRequestModelCoursesInner> courses) { + this.courses = courses; + return this; + } + + public PasskeyRegisterFinish addCoursesItem(ProfileRequestModelCoursesInner coursesItem) { + if (this.courses == null) { + this.courses = new ArrayList<>(); + } + this.courses.add(coursesItem); + return this; + } + + /** + * Get courses + * @return courses + */ + @javax.annotation.Nullable + public List<ProfileRequestModelCoursesInner> getCourses() { + return courses; + } + + public void setCourses(@javax.annotation.Nullable List<ProfileRequestModelCoursesInner> courses) { + this.courses = courses; + } + + + public PasskeyRegisterFinish volunteer(@javax.annotation.Nullable List<ProfileRequestModelVolunteerInner> volunteer) { + this.volunteer = volunteer; + return this; + } + + public PasskeyRegisterFinish addVolunteerItem(ProfileRequestModelVolunteerInner volunteerItem) { + if (this.volunteer == null) { + this.volunteer = new ArrayList<>(); + } + this.volunteer.add(volunteerItem); + return this; + } + + /** + * Get volunteer + * @return volunteer + */ + @javax.annotation.Nullable + public List<ProfileRequestModelVolunteerInner> getVolunteer() { + return volunteer; + } + + public void setVolunteer(@javax.annotation.Nullable List<ProfileRequestModelVolunteerInner> volunteer) { + this.volunteer = volunteer; + } + + + public PasskeyRegisterFinish recommendationsReceived(@javax.annotation.Nullable List<ProfileRequestModelRecommendationsReceivedInner> recommendationsReceived) { + this.recommendationsReceived = recommendationsReceived; + return this; + } + + public PasskeyRegisterFinish addRecommendationsReceivedItem(ProfileRequestModelRecommendationsReceivedInner recommendationsReceivedItem) { + if (this.recommendationsReceived == null) { + this.recommendationsReceived = new ArrayList<>(); + } + this.recommendationsReceived.add(recommendationsReceivedItem); + return this; + } + + /** + * Get recommendationsReceived + * @return recommendationsReceived + */ + @javax.annotation.Nullable + public List<ProfileRequestModelRecommendationsReceivedInner> getRecommendationsReceived() { + return recommendationsReceived; + } + + public void setRecommendationsReceived(@javax.annotation.Nullable List<ProfileRequestModelRecommendationsReceivedInner> recommendationsReceived) { + this.recommendationsReceived = recommendationsReceived; + } + + + public PasskeyRegisterFinish languages(@javax.annotation.Nullable List<ProfileRequestModelLanguagesInner> languages) { + this.languages = languages; + return this; + } + + public PasskeyRegisterFinish addLanguagesItem(ProfileRequestModelLanguagesInner languagesItem) { + if (this.languages == null) { + this.languages = new ArrayList<>(); + } + this.languages.add(languagesItem); + return this; + } + + /** + * Get languages + * @return languages + */ + @javax.annotation.Nullable + public List<ProfileRequestModelLanguagesInner> getLanguages() { + return languages; + } + + public void setLanguages(@javax.annotation.Nullable List<ProfileRequestModelLanguagesInner> languages) { + this.languages = languages; + } + + + public PasskeyRegisterFinish projects(@javax.annotation.Nullable List<ProfileRequestModelProjectsInner> projects) { + this.projects = projects; + return this; + } + + public PasskeyRegisterFinish addProjectsItem(ProfileRequestModelProjectsInner projectsItem) { + if (this.projects == null) { + this.projects = new ArrayList<>(); + } + this.projects.add(projectsItem); + return this; + } + + /** + * Get projects + * @return projects + */ + @javax.annotation.Nullable + public List<ProfileRequestModelProjectsInner> getProjects() { + return projects; + } + + public void setProjects(@javax.annotation.Nullable List<ProfileRequestModelProjectsInner> projects) { + this.projects = projects; + } + + + public PasskeyRegisterFinish games(@javax.annotation.Nullable List<ProfileRequestModelGamesInner> games) { + this.games = games; + return this; + } + + public PasskeyRegisterFinish addGamesItem(ProfileRequestModelGamesInner gamesItem) { + if (this.games == null) { + this.games = new ArrayList<>(); + } + this.games.add(gamesItem); + return this; + } + + /** + * Get games + * @return games + */ + @javax.annotation.Nullable + public List<ProfileRequestModelGamesInner> getGames() { + return games; + } + + public void setGames(@javax.annotation.Nullable List<ProfileRequestModelGamesInner> games) { + this.games = games; + } + + + public PasskeyRegisterFinish family(@javax.annotation.Nullable List<ProfileRequestModelFamilyInner> family) { + this.family = family; + return this; + } + + public PasskeyRegisterFinish addFamilyItem(ProfileRequestModelFamilyInner familyItem) { + if (this.family == null) { + this.family = new ArrayList<>(); + } + this.family.add(familyItem); + return this; + } + + /** + * Get family + * @return family + */ + @javax.annotation.Nullable + public List<ProfileRequestModelFamilyInner> getFamily() { + return family; + } + + public void setFamily(@javax.annotation.Nullable List<ProfileRequestModelFamilyInner> family) { + this.family = family; + } + + + public PasskeyRegisterFinish teleVisionShow(@javax.annotation.Nullable List<ProfileRequestModelTeleVisionShowInner> teleVisionShow) { + this.teleVisionShow = teleVisionShow; + return this; + } + + public PasskeyRegisterFinish addTeleVisionShowItem(ProfileRequestModelTeleVisionShowInner teleVisionShowItem) { + if (this.teleVisionShow == null) { + this.teleVisionShow = new ArrayList<>(); + } + this.teleVisionShow.add(teleVisionShowItem); + return this; + } + + /** + * Get teleVisionShow + * @return teleVisionShow + */ + @javax.annotation.Nullable + public List<ProfileRequestModelTeleVisionShowInner> getTeleVisionShow() { + return teleVisionShow; + } + + public void setTeleVisionShow(@javax.annotation.Nullable List<ProfileRequestModelTeleVisionShowInner> teleVisionShow) { + this.teleVisionShow = teleVisionShow; + } + + + public PasskeyRegisterFinish mutualFriends(@javax.annotation.Nullable List<ProfileRequestModelMutualFriendsInner> mutualFriends) { + this.mutualFriends = mutualFriends; + return this; + } + + public PasskeyRegisterFinish addMutualFriendsItem(ProfileRequestModelMutualFriendsInner mutualFriendsItem) { + if (this.mutualFriends == null) { + this.mutualFriends = new ArrayList<>(); + } + this.mutualFriends.add(mutualFriendsItem); + return this; + } + + /** + * Get mutualFriends + * @return mutualFriends + */ + @javax.annotation.Nullable + public List<ProfileRequestModelMutualFriendsInner> getMutualFriends() { + return mutualFriends; + } + + public void setMutualFriends(@javax.annotation.Nullable List<ProfileRequestModelMutualFriendsInner> mutualFriends) { + this.mutualFriends = mutualFriends; + } + + + public PasskeyRegisterFinish movies(@javax.annotation.Nullable List<ProfileRequestModelMoviesInner> movies) { + this.movies = movies; + return this; + } + + public PasskeyRegisterFinish addMoviesItem(ProfileRequestModelMoviesInner moviesItem) { + if (this.movies == null) { + this.movies = new ArrayList<>(); + } + this.movies.add(moviesItem); + return this; + } + + /** + * Get movies + * @return movies + */ + @javax.annotation.Nullable + public List<ProfileRequestModelMoviesInner> getMovies() { + return movies; + } + + public void setMovies(@javax.annotation.Nullable List<ProfileRequestModelMoviesInner> movies) { + this.movies = movies; + } + + + public PasskeyRegisterFinish books(@javax.annotation.Nullable List<ProfileRequestModelBooksInner> books) { + this.books = books; + return this; + } + + public PasskeyRegisterFinish addBooksItem(ProfileRequestModelBooksInner booksItem) { + if (this.books == null) { + this.books = new ArrayList<>(); + } + this.books.add(booksItem); + return this; + } + + /** + * Get books + * @return books + */ + @javax.annotation.Nullable + public List<ProfileRequestModelBooksInner> getBooks() { + return books; + } + + public void setBooks(@javax.annotation.Nullable List<ProfileRequestModelBooksInner> books) { + this.books = books; + } + + + public PasskeyRegisterFinish patents(@javax.annotation.Nullable List<ProfileRequestModelPatentsInner> patents) { + this.patents = patents; + return this; + } + + public PasskeyRegisterFinish addPatentsItem(ProfileRequestModelPatentsInner patentsItem) { + if (this.patents == null) { + this.patents = new ArrayList<>(); + } + this.patents.add(patentsItem); + return this; + } + + /** + * Get patents + * @return patents + */ + @javax.annotation.Nullable + public List<ProfileRequestModelPatentsInner> getPatents() { + return patents; + } + + public void setPatents(@javax.annotation.Nullable List<ProfileRequestModelPatentsInner> patents) { + this.patents = patents; + } + + + public PasskeyRegisterFinish favoriteThings(@javax.annotation.Nullable List<ProfileRequestModelFavoriteThingsInner> favoriteThings) { + this.favoriteThings = favoriteThings; + return this; + } + + public PasskeyRegisterFinish addFavoriteThingsItem(ProfileRequestModelFavoriteThingsInner favoriteThingsItem) { + if (this.favoriteThings == null) { + this.favoriteThings = new ArrayList<>(); + } + this.favoriteThings.add(favoriteThingsItem); + return this; + } + + /** + * Get favoriteThings + * @return favoriteThings + */ + @javax.annotation.Nullable + public List<ProfileRequestModelFavoriteThingsInner> getFavoriteThings() { + return favoriteThings; + } + + public void setFavoriteThings(@javax.annotation.Nullable List<ProfileRequestModelFavoriteThingsInner> favoriteThings) { + this.favoriteThings = favoriteThings; + } + + + public PasskeyRegisterFinish relatedProfileViews(@javax.annotation.Nullable List<ProfileRequestModelRelatedProfileViewsInner> relatedProfileViews) { + this.relatedProfileViews = relatedProfileViews; + return this; + } + + public PasskeyRegisterFinish addRelatedProfileViewsItem(ProfileRequestModelRelatedProfileViewsInner relatedProfileViewsItem) { + if (this.relatedProfileViews == null) { + this.relatedProfileViews = new ArrayList<>(); + } + this.relatedProfileViews.add(relatedProfileViewsItem); + return this; + } + + /** + * Get relatedProfileViews + * @return relatedProfileViews + */ + @javax.annotation.Nullable + public List<ProfileRequestModelRelatedProfileViewsInner> getRelatedProfileViews() { + return relatedProfileViews; + } + + public void setRelatedProfileViews(@javax.annotation.Nullable List<ProfileRequestModelRelatedProfileViewsInner> relatedProfileViews) { + this.relatedProfileViews = relatedProfileViews; + } + + + public PasskeyRegisterFinish placesLived(@javax.annotation.Nullable List<ProfileRequestModelPlacesLivedInner> placesLived) { + this.placesLived = placesLived; + return this; + } + + public PasskeyRegisterFinish addPlacesLivedItem(ProfileRequestModelPlacesLivedInner placesLivedItem) { + if (this.placesLived == null) { + this.placesLived = new ArrayList<>(); + } + this.placesLived.add(placesLivedItem); + return this; + } + + /** + * Get placesLived + * @return placesLived + */ + @javax.annotation.Nullable + public List<ProfileRequestModelPlacesLivedInner> getPlacesLived() { + return placesLived; + } + + public void setPlacesLived(@javax.annotation.Nullable List<ProfileRequestModelPlacesLivedInner> placesLived) { + this.placesLived = placesLived; + } + + + public PasskeyRegisterFinish publications(@javax.annotation.Nullable List<ProfileRequestModelPublicationsInner> publications) { + this.publications = publications; + return this; + } + + public PasskeyRegisterFinish addPublicationsItem(ProfileRequestModelPublicationsInner publicationsItem) { + if (this.publications == null) { + this.publications = new ArrayList<>(); + } + this.publications.add(publicationsItem); + return this; + } + + /** + * Get publications + * @return publications + */ + @javax.annotation.Nullable + public List<ProfileRequestModelPublicationsInner> getPublications() { + return publications; + } + + public void setPublications(@javax.annotation.Nullable List<ProfileRequestModelPublicationsInner> publications) { + this.publications = publications; + } + + + public PasskeyRegisterFinish jobBookmarks(@javax.annotation.Nullable List<ProfileRequestModelJobBookmarksInner> jobBookmarks) { + this.jobBookmarks = jobBookmarks; + return this; + } + + public PasskeyRegisterFinish addJobBookmarksItem(ProfileRequestModelJobBookmarksInner jobBookmarksItem) { + if (this.jobBookmarks == null) { + this.jobBookmarks = new ArrayList<>(); + } + this.jobBookmarks.add(jobBookmarksItem); + return this; + } + + /** + * Get jobBookmarks + * @return jobBookmarks + */ + @javax.annotation.Nullable + public List<ProfileRequestModelJobBookmarksInner> getJobBookmarks() { + return jobBookmarks; + } + + public void setJobBookmarks(@javax.annotation.Nullable List<ProfileRequestModelJobBookmarksInner> jobBookmarks) { + this.jobBookmarks = jobBookmarks; + } + + + public PasskeyRegisterFinish badges(@javax.annotation.Nullable List<ProfileRequestModelBadgesInner> badges) { + this.badges = badges; + return this; + } + + public PasskeyRegisterFinish addBadgesItem(ProfileRequestModelBadgesInner badgesItem) { + if (this.badges == null) { + this.badges = new ArrayList<>(); + } + this.badges.add(badgesItem); + return this; + } + + /** + * Get badges + * @return badges + */ + @javax.annotation.Nullable + public List<ProfileRequestModelBadgesInner> getBadges() { + return badges; + } + + public void setBadges(@javax.annotation.Nullable List<ProfileRequestModelBadgesInner> badges) { + this.badges = badges; + } + + + public PasskeyRegisterFinish memberUrlResources(@javax.annotation.Nullable List<ProfileRequestModelMemberUrlResourcesInner> memberUrlResources) { + this.memberUrlResources = memberUrlResources; + return this; + } + + public PasskeyRegisterFinish addMemberUrlResourcesItem(ProfileRequestModelMemberUrlResourcesInner memberUrlResourcesItem) { + if (this.memberUrlResources == null) { + this.memberUrlResources = new ArrayList<>(); + } + this.memberUrlResources.add(memberUrlResourcesItem); + return this; + } + + /** + * Get memberUrlResources + * @return memberUrlResources + */ + @javax.annotation.Nullable + public List<ProfileRequestModelMemberUrlResourcesInner> getMemberUrlResources() { + return memberUrlResources; + } + + public void setMemberUrlResources(@javax.annotation.Nullable List<ProfileRequestModelMemberUrlResourcesInner> memberUrlResources) { + this.memberUrlResources = memberUrlResources; + } + + + public PasskeyRegisterFinish externalIds(@javax.annotation.Nullable List<ProfileRequestModelExternalIdsInner> externalIds) { + this.externalIds = externalIds; + return this; + } + + public PasskeyRegisterFinish addExternalIdsItem(ProfileRequestModelExternalIdsInner externalIdsItem) { + if (this.externalIds == null) { + this.externalIds = new ArrayList<>(); + } + this.externalIds.add(externalIdsItem); + return this; + } + + /** + * Get externalIds + * @return externalIds + */ + @javax.annotation.Nullable + public List<ProfileRequestModelExternalIdsInner> getExternalIds() { + return externalIds; + } + + public void setExternalIds(@javax.annotation.Nullable List<ProfileRequestModelExternalIdsInner> externalIds) { + this.externalIds = externalIds; + } + + + public PasskeyRegisterFinish isEmailSubscribed(@javax.annotation.Nullable Boolean isEmailSubscribed) { + this.isEmailSubscribed = isEmailSubscribed; + return this; + } + + /** + * Get isEmailSubscribed + * @return isEmailSubscribed + */ + @javax.annotation.Nullable + public Boolean getIsEmailSubscribed() { + return isEmailSubscribed; + } + + public void setIsEmailSubscribed(@javax.annotation.Nullable Boolean isEmailSubscribed) { + this.isEmailSubscribed = isEmailSubscribed; + } + + + public PasskeyRegisterFinish isProtected(@javax.annotation.Nullable Boolean isProtected) { + this.isProtected = isProtected; + return this; + } + + /** + * Get isProtected + * @return isProtected + */ + @javax.annotation.Nullable + public Boolean getIsProtected() { + return isProtected; + } + + public void setIsProtected(@javax.annotation.Nullable Boolean isProtected) { + this.isProtected = isProtected; + } + + + public PasskeyRegisterFinish hireable(@javax.annotation.Nullable Boolean hireable) { + this.hireable = hireable; + return this; + } + + /** + * Get hireable + * @return hireable + */ + @javax.annotation.Nullable + public Boolean getHireable() { + return hireable; + } + + public void setHireable(@javax.annotation.Nullable Boolean hireable) { + this.hireable = hireable; + } + + + public PasskeyRegisterFinish disableLogin(@javax.annotation.Nullable Boolean disableLogin) { + this.disableLogin = disableLogin; + return this; + } + + /** + * Get disableLogin + * @return disableLogin + */ + @javax.annotation.Nullable + public Boolean getDisableLogin() { + return disableLogin; + } + + public void setDisableLogin(@javax.annotation.Nullable Boolean disableLogin) { + this.disableLogin = disableLogin; + } + + + public PasskeyRegisterFinish acceptPrivacyPolicy(@javax.annotation.Nullable Boolean acceptPrivacyPolicy) { + this.acceptPrivacyPolicy = acceptPrivacyPolicy; + return this; + } + + /** + * Get acceptPrivacyPolicy + * @return acceptPrivacyPolicy + */ + @javax.annotation.Nullable + public Boolean getAcceptPrivacyPolicy() { + return acceptPrivacyPolicy; + } + + public void setAcceptPrivacyPolicy(@javax.annotation.Nullable Boolean acceptPrivacyPolicy) { + this.acceptPrivacyPolicy = acceptPrivacyPolicy; + } + + + public PasskeyRegisterFinish registrationSource(@javax.annotation.Nullable String registrationSource) { + this.registrationSource = registrationSource; + return this; + } + + /** + * Get registrationSource + * @return registrationSource + */ + @javax.annotation.Nullable + public String getRegistrationSource() { + return registrationSource; + } + + public void setRegistrationSource(@javax.annotation.Nullable String registrationSource) { + this.registrationSource = registrationSource; + } + + + public PasskeyRegisterFinish fullName(@javax.annotation.Nullable String fullName) { + this.fullName = fullName; + return this; + } + + /** + * Get fullName + * @return fullName + */ + @javax.annotation.Nullable + public String getFullName() { + return fullName; + } + + public void setFullName(@javax.annotation.Nullable String fullName) { + this.fullName = fullName; + } + + + public PasskeyRegisterFinish consents(@javax.annotation.Nullable ProfileRequestModelConsents consents) { + this.consents = consents; + return this; + } + + /** + * Get consents + * @return consents + */ + @javax.annotation.Nullable + public ProfileRequestModelConsents getConsents() { + return consents; + } + + public void setConsents(@javax.annotation.Nullable ProfileRequestModelConsents consents) { + this.consents = consents; + } + + + public PasskeyRegisterFinish email(@javax.annotation.Nullable List<ProfileRequestModelEmailInner> email) { + this.email = email; + return this; + } + + public PasskeyRegisterFinish addEmailItem(ProfileRequestModelEmailInner emailItem) { + if (this.email == null) { + this.email = new ArrayList<>(); + } + this.email.add(emailItem); + return this; + } + + /** + * Get email + * @return email + */ + @javax.annotation.Nullable + public List<ProfileRequestModelEmailInner> getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable List<ProfileRequestModelEmailInner> email) { + this.email = email; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyRegisterFinish instance itself + */ + public PasskeyRegisterFinish putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyRegisterFinish passkeyRegisterFinish = (PasskeyRegisterFinish) o; + return Objects.equals(this.passkeyCredential, passkeyRegisterFinish.passkeyCredential) && + Objects.equals(this.gender, passkeyRegisterFinish.gender) && + Objects.equals(this.birthDate, passkeyRegisterFinish.birthDate) && + Objects.equals(this.prefix, passkeyRegisterFinish.prefix) && + Objects.equals(this.firstName, passkeyRegisterFinish.firstName) && + Objects.equals(this.middleName, passkeyRegisterFinish.middleName) && + Objects.equals(this.lastName, passkeyRegisterFinish.lastName) && + Objects.equals(this.suffix, passkeyRegisterFinish.suffix) && + Objects.equals(this.nickName, passkeyRegisterFinish.nickName) && + Objects.equals(this.profileName, passkeyRegisterFinish.profileName) && + Objects.equals(this.about, passkeyRegisterFinish.about) && + Objects.equals(this.company, passkeyRegisterFinish.company) && + Objects.equals(this.imageUrl, passkeyRegisterFinish.imageUrl) && + Objects.equals(this.timeZone, passkeyRegisterFinish.timeZone) && + Objects.equals(this.website, passkeyRegisterFinish.website) && + Objects.equals(this.thumbnailImageUrl, passkeyRegisterFinish.thumbnailImageUrl) && + Objects.equals(this.favicon, passkeyRegisterFinish.favicon) && + Objects.equals(this.profileUrl, passkeyRegisterFinish.profileUrl) && + Objects.equals(this.homeTown, passkeyRegisterFinish.homeTown) && + Objects.equals(this.state, passkeyRegisterFinish.state) && + Objects.equals(this.city, passkeyRegisterFinish.city) && + Objects.equals(this.industry, passkeyRegisterFinish.industry) && + Objects.equals(this.localLanguage, passkeyRegisterFinish.localLanguage) && + Objects.equals(this.language, passkeyRegisterFinish.language) && + Objects.equals(this.coverPhoto, passkeyRegisterFinish.coverPhoto) && + Objects.equals(this.tagLine, passkeyRegisterFinish.tagLine) && + Objects.equals(this.mainAddress, passkeyRegisterFinish.mainAddress) && + Objects.equals(this.localCity, passkeyRegisterFinish.localCity) && + Objects.equals(this.profileCity, passkeyRegisterFinish.profileCity) && + Objects.equals(this.localCountry, passkeyRegisterFinish.localCountry) && + Objects.equals(this.profileCountry, passkeyRegisterFinish.profileCountry) && + Objects.equals(this.quota, passkeyRegisterFinish.quota) && + Objects.equals(this.religion, passkeyRegisterFinish.religion) && + Objects.equals(this.political, passkeyRegisterFinish.political) && + Objects.equals(this.relationshipStatus, passkeyRegisterFinish.relationshipStatus) && + Objects.equals(this.httpsImageUrl, passkeyRegisterFinish.httpsImageUrl) && + Objects.equals(this.isGeoEnabled, passkeyRegisterFinish.isGeoEnabled) && + Objects.equals(this.associations, passkeyRegisterFinish.associations) && + Objects.equals(this.honors, passkeyRegisterFinish.honors) && + Objects.equals(this.publicRepository, passkeyRegisterFinish.publicRepository) && + Objects.equals(this.repositoryUrl, passkeyRegisterFinish.repositoryUrl) && + Objects.equals(this.professionalHeadline, passkeyRegisterFinish.professionalHeadline) && + Objects.equals(this.currency, passkeyRegisterFinish.currency) && + Objects.equals(this.starredUrl, passkeyRegisterFinish.starredUrl) && + Objects.equals(this.gistsUrl, passkeyRegisterFinish.gistsUrl) && + Objects.equals(this.gravatarImageUrl, passkeyRegisterFinish.gravatarImageUrl) && + Objects.equals(this.externalUserLoginId, passkeyRegisterFinish.externalUserLoginId) && + Objects.equals(this.interestedIn, passkeyRegisterFinish.interestedIn) && + Objects.equals(this.followersCount, passkeyRegisterFinish.followersCount) && + Objects.equals(this.friendsCount, passkeyRegisterFinish.friendsCount) && + Objects.equals(this.totalStatusesCount, passkeyRegisterFinish.totalStatusesCount) && + Objects.equals(this.numRecommenders, passkeyRegisterFinish.numRecommenders) && + Objects.equals(this.totalPrivateRepository, passkeyRegisterFinish.totalPrivateRepository) && + Objects.equals(this.publicGists, passkeyRegisterFinish.publicGists) && + Objects.equals(this.privateGists, passkeyRegisterFinish.privateGists) && + Objects.equals(this.sessionLimit, passkeyRegisterFinish.sessionLimit) && + Objects.equals(this.customFields, passkeyRegisterFinish.customFields) && + Objects.equals(this.profileImageUrls, passkeyRegisterFinish.profileImageUrls) && + Objects.equals(this.webProfiles, passkeyRegisterFinish.webProfiles) && + Objects.equals(this.securityQuestionAnswer, passkeyRegisterFinish.securityQuestionAnswer) && + Objects.equals(this.country, passkeyRegisterFinish.country) && + Objects.equals(this.suggestions, passkeyRegisterFinish.suggestions) && + Objects.equals(this.subscription, passkeyRegisterFinish.subscription) && + Objects.equals(this.privacyPolicy, passkeyRegisterFinish.privacyPolicy) && + Objects.equals(this.piNInfo, passkeyRegisterFinish.piNInfo) && + Objects.equals(this.addresses, passkeyRegisterFinish.addresses) && + Objects.equals(this.positions, passkeyRegisterFinish.positions) && + Objects.equals(this.educations, passkeyRegisterFinish.educations) && + Objects.equals(this.phoneNumbers, passkeyRegisterFinish.phoneNumbers) && + Objects.equals(this.imAccounts, passkeyRegisterFinish.imAccounts) && + Objects.equals(this.interests, passkeyRegisterFinish.interests) && + Objects.equals(this.sports, passkeyRegisterFinish.sports) && + Objects.equals(this.inspirationalPeople, passkeyRegisterFinish.inspirationalPeople) && + Objects.equals(this.awards, passkeyRegisterFinish.awards) && + Objects.equals(this.skills, passkeyRegisterFinish.skills) && + Objects.equals(this.currentStatus, passkeyRegisterFinish.currentStatus) && + Objects.equals(this.certifications, passkeyRegisterFinish.certifications) && + Objects.equals(this.courses, passkeyRegisterFinish.courses) && + Objects.equals(this.volunteer, passkeyRegisterFinish.volunteer) && + Objects.equals(this.recommendationsReceived, passkeyRegisterFinish.recommendationsReceived) && + Objects.equals(this.languages, passkeyRegisterFinish.languages) && + Objects.equals(this.projects, passkeyRegisterFinish.projects) && + Objects.equals(this.games, passkeyRegisterFinish.games) && + Objects.equals(this.family, passkeyRegisterFinish.family) && + Objects.equals(this.teleVisionShow, passkeyRegisterFinish.teleVisionShow) && + Objects.equals(this.mutualFriends, passkeyRegisterFinish.mutualFriends) && + Objects.equals(this.movies, passkeyRegisterFinish.movies) && + Objects.equals(this.books, passkeyRegisterFinish.books) && + Objects.equals(this.patents, passkeyRegisterFinish.patents) && + Objects.equals(this.favoriteThings, passkeyRegisterFinish.favoriteThings) && + Objects.equals(this.relatedProfileViews, passkeyRegisterFinish.relatedProfileViews) && + Objects.equals(this.placesLived, passkeyRegisterFinish.placesLived) && + Objects.equals(this.publications, passkeyRegisterFinish.publications) && + Objects.equals(this.jobBookmarks, passkeyRegisterFinish.jobBookmarks) && + Objects.equals(this.badges, passkeyRegisterFinish.badges) && + Objects.equals(this.memberUrlResources, passkeyRegisterFinish.memberUrlResources) && + Objects.equals(this.externalIds, passkeyRegisterFinish.externalIds) && + Objects.equals(this.isEmailSubscribed, passkeyRegisterFinish.isEmailSubscribed) && + Objects.equals(this.isProtected, passkeyRegisterFinish.isProtected) && + Objects.equals(this.hireable, passkeyRegisterFinish.hireable) && + Objects.equals(this.disableLogin, passkeyRegisterFinish.disableLogin) && + Objects.equals(this.acceptPrivacyPolicy, passkeyRegisterFinish.acceptPrivacyPolicy) && + Objects.equals(this.registrationSource, passkeyRegisterFinish.registrationSource) && + Objects.equals(this.fullName, passkeyRegisterFinish.fullName) && + Objects.equals(this.consents, passkeyRegisterFinish.consents) && + Objects.equals(this.email, passkeyRegisterFinish.email)&& + Objects.equals(this.additionalProperties, passkeyRegisterFinish.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(passkeyCredential, gender, birthDate, prefix, firstName, middleName, lastName, suffix, nickName, profileName, about, company, imageUrl, timeZone, website, thumbnailImageUrl, favicon, profileUrl, homeTown, state, city, industry, localLanguage, language, coverPhoto, tagLine, mainAddress, localCity, profileCity, localCountry, profileCountry, quota, religion, political, relationshipStatus, httpsImageUrl, isGeoEnabled, associations, honors, publicRepository, repositoryUrl, professionalHeadline, currency, starredUrl, gistsUrl, gravatarImageUrl, externalUserLoginId, interestedIn, followersCount, friendsCount, totalStatusesCount, numRecommenders, totalPrivateRepository, publicGists, privateGists, sessionLimit, customFields, profileImageUrls, webProfiles, securityQuestionAnswer, country, suggestions, subscription, privacyPolicy, piNInfo, addresses, positions, educations, phoneNumbers, imAccounts, interests, sports, inspirationalPeople, awards, skills, currentStatus, certifications, courses, volunteer, recommendationsReceived, languages, projects, games, family, teleVisionShow, mutualFriends, movies, books, patents, favoriteThings, relatedProfileViews, placesLived, publications, jobBookmarks, badges, memberUrlResources, externalIds, isEmailSubscribed, isProtected, hireable, disableLogin, acceptPrivacyPolicy, registrationSource, fullName, consents, email, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyRegisterFinish {\n"); + sb.append(" passkeyCredential: ").append(toIndentedString(passkeyCredential)).append("\n"); + sb.append(" gender: ").append(toIndentedString(gender)).append("\n"); + sb.append(" birthDate: ").append(toIndentedString(birthDate)).append("\n"); + sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" middleName: ").append(toIndentedString(middleName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" suffix: ").append(toIndentedString(suffix)).append("\n"); + sb.append(" nickName: ").append(toIndentedString(nickName)).append("\n"); + sb.append(" profileName: ").append(toIndentedString(profileName)).append("\n"); + sb.append(" about: ").append(toIndentedString(about)).append("\n"); + sb.append(" company: ").append(toIndentedString(company)).append("\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); + sb.append(" website: ").append(toIndentedString(website)).append("\n"); + sb.append(" thumbnailImageUrl: ").append(toIndentedString(thumbnailImageUrl)).append("\n"); + sb.append(" favicon: ").append(toIndentedString(favicon)).append("\n"); + sb.append(" profileUrl: ").append(toIndentedString(profileUrl)).append("\n"); + sb.append(" homeTown: ").append(toIndentedString(homeTown)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" industry: ").append(toIndentedString(industry)).append("\n"); + sb.append(" localLanguage: ").append(toIndentedString(localLanguage)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" coverPhoto: ").append(toIndentedString(coverPhoto)).append("\n"); + sb.append(" tagLine: ").append(toIndentedString(tagLine)).append("\n"); + sb.append(" mainAddress: ").append(toIndentedString(mainAddress)).append("\n"); + sb.append(" localCity: ").append(toIndentedString(localCity)).append("\n"); + sb.append(" profileCity: ").append(toIndentedString(profileCity)).append("\n"); + sb.append(" localCountry: ").append(toIndentedString(localCountry)).append("\n"); + sb.append(" profileCountry: ").append(toIndentedString(profileCountry)).append("\n"); + sb.append(" quota: ").append(toIndentedString(quota)).append("\n"); + sb.append(" religion: ").append(toIndentedString(religion)).append("\n"); + sb.append(" political: ").append(toIndentedString(political)).append("\n"); + sb.append(" relationshipStatus: ").append(toIndentedString(relationshipStatus)).append("\n"); + sb.append(" httpsImageUrl: ").append(toIndentedString(httpsImageUrl)).append("\n"); + sb.append(" isGeoEnabled: ").append(toIndentedString(isGeoEnabled)).append("\n"); + sb.append(" associations: ").append(toIndentedString(associations)).append("\n"); + sb.append(" honors: ").append(toIndentedString(honors)).append("\n"); + sb.append(" publicRepository: ").append(toIndentedString(publicRepository)).append("\n"); + sb.append(" repositoryUrl: ").append(toIndentedString(repositoryUrl)).append("\n"); + sb.append(" professionalHeadline: ").append(toIndentedString(professionalHeadline)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" starredUrl: ").append(toIndentedString(starredUrl)).append("\n"); + sb.append(" gistsUrl: ").append(toIndentedString(gistsUrl)).append("\n"); + sb.append(" gravatarImageUrl: ").append(toIndentedString(gravatarImageUrl)).append("\n"); + sb.append(" externalUserLoginId: ").append(toIndentedString(externalUserLoginId)).append("\n"); + sb.append(" interestedIn: ").append(toIndentedString(interestedIn)).append("\n"); + sb.append(" followersCount: ").append(toIndentedString(followersCount)).append("\n"); + sb.append(" friendsCount: ").append(toIndentedString(friendsCount)).append("\n"); + sb.append(" totalStatusesCount: ").append(toIndentedString(totalStatusesCount)).append("\n"); + sb.append(" numRecommenders: ").append(toIndentedString(numRecommenders)).append("\n"); + sb.append(" totalPrivateRepository: ").append(toIndentedString(totalPrivateRepository)).append("\n"); + sb.append(" publicGists: ").append(toIndentedString(publicGists)).append("\n"); + sb.append(" privateGists: ").append(toIndentedString(privateGists)).append("\n"); + sb.append(" sessionLimit: ").append(toIndentedString(sessionLimit)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" profileImageUrls: ").append(toIndentedString(profileImageUrls)).append("\n"); + sb.append(" webProfiles: ").append(toIndentedString(webProfiles)).append("\n"); + sb.append(" securityQuestionAnswer: ").append(toIndentedString(securityQuestionAnswer)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" suggestions: ").append(toIndentedString(suggestions)).append("\n"); + sb.append(" subscription: ").append(toIndentedString(subscription)).append("\n"); + sb.append(" privacyPolicy: ").append(toIndentedString(privacyPolicy)).append("\n"); + sb.append(" piNInfo: ").append(toIndentedString(piNInfo)).append("\n"); + sb.append(" addresses: ").append(toIndentedString(addresses)).append("\n"); + sb.append(" positions: ").append(toIndentedString(positions)).append("\n"); + sb.append(" educations: ").append(toIndentedString(educations)).append("\n"); + sb.append(" phoneNumbers: ").append(toIndentedString(phoneNumbers)).append("\n"); + sb.append(" imAccounts: ").append(toIndentedString(imAccounts)).append("\n"); + sb.append(" interests: ").append(toIndentedString(interests)).append("\n"); + sb.append(" sports: ").append(toIndentedString(sports)).append("\n"); + sb.append(" inspirationalPeople: ").append(toIndentedString(inspirationalPeople)).append("\n"); + sb.append(" awards: ").append(toIndentedString(awards)).append("\n"); + sb.append(" skills: ").append(toIndentedString(skills)).append("\n"); + sb.append(" currentStatus: ").append(toIndentedString(currentStatus)).append("\n"); + sb.append(" certifications: ").append(toIndentedString(certifications)).append("\n"); + sb.append(" courses: ").append(toIndentedString(courses)).append("\n"); + sb.append(" volunteer: ").append(toIndentedString(volunteer)).append("\n"); + sb.append(" recommendationsReceived: ").append(toIndentedString(recommendationsReceived)).append("\n"); + sb.append(" languages: ").append(toIndentedString(languages)).append("\n"); + sb.append(" projects: ").append(toIndentedString(projects)).append("\n"); + sb.append(" games: ").append(toIndentedString(games)).append("\n"); + sb.append(" family: ").append(toIndentedString(family)).append("\n"); + sb.append(" teleVisionShow: ").append(toIndentedString(teleVisionShow)).append("\n"); + sb.append(" mutualFriends: ").append(toIndentedString(mutualFriends)).append("\n"); + sb.append(" movies: ").append(toIndentedString(movies)).append("\n"); + sb.append(" books: ").append(toIndentedString(books)).append("\n"); + sb.append(" patents: ").append(toIndentedString(patents)).append("\n"); + sb.append(" favoriteThings: ").append(toIndentedString(favoriteThings)).append("\n"); + sb.append(" relatedProfileViews: ").append(toIndentedString(relatedProfileViews)).append("\n"); + sb.append(" placesLived: ").append(toIndentedString(placesLived)).append("\n"); + sb.append(" publications: ").append(toIndentedString(publications)).append("\n"); + sb.append(" jobBookmarks: ").append(toIndentedString(jobBookmarks)).append("\n"); + sb.append(" badges: ").append(toIndentedString(badges)).append("\n"); + sb.append(" memberUrlResources: ").append(toIndentedString(memberUrlResources)).append("\n"); + sb.append(" externalIds: ").append(toIndentedString(externalIds)).append("\n"); + sb.append(" isEmailSubscribed: ").append(toIndentedString(isEmailSubscribed)).append("\n"); + sb.append(" isProtected: ").append(toIndentedString(isProtected)).append("\n"); + sb.append(" hireable: ").append(toIndentedString(hireable)).append("\n"); + sb.append(" disableLogin: ").append(toIndentedString(disableLogin)).append("\n"); + sb.append(" acceptPrivacyPolicy: ").append(toIndentedString(acceptPrivacyPolicy)).append("\n"); + sb.append(" registrationSource: ").append(toIndentedString(registrationSource)).append("\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append(" consents: ").append(toIndentedString(consents)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("PasskeyCredential"); + openapiFields.add("Gender"); + openapiFields.add("BirthDate"); + openapiFields.add("Prefix"); + openapiFields.add("FirstName"); + openapiFields.add("MiddleName"); + openapiFields.add("LastName"); + openapiFields.add("Suffix"); + openapiFields.add("NickName"); + openapiFields.add("ProfileName"); + openapiFields.add("About"); + openapiFields.add("Company"); + openapiFields.add("ImageUrl"); + openapiFields.add("TimeZone"); + openapiFields.add("Website"); + openapiFields.add("ThumbnailImageUrl"); + openapiFields.add("Favicon"); + openapiFields.add("ProfileUrl"); + openapiFields.add("HomeTown"); + openapiFields.add("State"); + openapiFields.add("City"); + openapiFields.add("Industry"); + openapiFields.add("LocalLanguage"); + openapiFields.add("Language"); + openapiFields.add("CoverPhoto"); + openapiFields.add("TagLine"); + openapiFields.add("MainAddress"); + openapiFields.add("LocalCity"); + openapiFields.add("ProfileCity"); + openapiFields.add("LocalCountry"); + openapiFields.add("ProfileCountry"); + openapiFields.add("Quota"); + openapiFields.add("Religion"); + openapiFields.add("Political"); + openapiFields.add("RelationshipStatus"); + openapiFields.add("HttpsImageUrl"); + openapiFields.add("IsGeoEnabled"); + openapiFields.add("Associations"); + openapiFields.add("Honors"); + openapiFields.add("PublicRepository"); + openapiFields.add("RepositoryUrl"); + openapiFields.add("ProfessionalHeadline"); + openapiFields.add("Currency"); + openapiFields.add("StarredUrl"); + openapiFields.add("GistsUrl"); + openapiFields.add("GravatarImageUrl"); + openapiFields.add("ExternalUserLoginId"); + openapiFields.add("InterestedIn"); + openapiFields.add("FollowersCount"); + openapiFields.add("FriendsCount"); + openapiFields.add("TotalStatusesCount"); + openapiFields.add("NumRecommenders"); + openapiFields.add("TotalPrivateRepository"); + openapiFields.add("PublicGists"); + openapiFields.add("PrivateGists"); + openapiFields.add("SessionLimit"); + openapiFields.add("CustomFields"); + openapiFields.add("ProfileImageUrls"); + openapiFields.add("WebProfiles"); + openapiFields.add("SecurityQuestionAnswer"); + openapiFields.add("Country"); + openapiFields.add("Suggestions"); + openapiFields.add("Subscription"); + openapiFields.add("PrivacyPolicy"); + openapiFields.add("PINInfo"); + openapiFields.add("Addresses"); + openapiFields.add("Positions"); + openapiFields.add("Educations"); + openapiFields.add("PhoneNumbers"); + openapiFields.add("IMAccounts"); + openapiFields.add("Interests"); + openapiFields.add("Sports"); + openapiFields.add("InspirationalPeople"); + openapiFields.add("Awards"); + openapiFields.add("Skills"); + openapiFields.add("CurrentStatus"); + openapiFields.add("Certifications"); + openapiFields.add("Courses"); + openapiFields.add("Volunteer"); + openapiFields.add("RecommendationsReceived"); + openapiFields.add("Languages"); + openapiFields.add("Projects"); + openapiFields.add("Games"); + openapiFields.add("Family"); + openapiFields.add("TeleVisionShow"); + openapiFields.add("MutualFriends"); + openapiFields.add("Movies"); + openapiFields.add("Books"); + openapiFields.add("Patents"); + openapiFields.add("FavoriteThings"); + openapiFields.add("RelatedProfileViews"); + openapiFields.add("PlacesLived"); + openapiFields.add("Publications"); + openapiFields.add("JobBookmarks"); + openapiFields.add("Badges"); + openapiFields.add("MemberUrlResources"); + openapiFields.add("ExternalIds"); + openapiFields.add("IsEmailSubscribed"); + openapiFields.add("IsProtected"); + openapiFields.add("Hireable"); + openapiFields.add("DisableLogin"); + openapiFields.add("AcceptPrivacyPolicy"); + openapiFields.add("RegistrationSource"); + openapiFields.add("FullName"); + openapiFields.add("Consents"); + openapiFields.add("Email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 PasskeyRegisterFinish + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyRegisterFinish.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyRegisterFinish is not found in the empty JSON string", PasskeyRegisterFinish.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `PasskeyCredential` + if (jsonObj.get("PasskeyCredential") != null && !jsonObj.get("PasskeyCredential").isJsonNull()) { + PasskeyCredentialCreationResponse.validateJsonElement(jsonObj.get("PasskeyCredential")); + } + if ((jsonObj.get("Gender") != null && !jsonObj.get("Gender").isJsonNull()) && !jsonObj.get("Gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Gender").toString())); + } + if ((jsonObj.get("BirthDate") != null && !jsonObj.get("BirthDate").isJsonNull()) && !jsonObj.get("BirthDate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `BirthDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BirthDate").toString())); + } + if ((jsonObj.get("Prefix") != null && !jsonObj.get("Prefix").isJsonNull()) && !jsonObj.get("Prefix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Prefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Prefix").toString())); + } + if ((jsonObj.get("FirstName") != null && !jsonObj.get("FirstName").isJsonNull()) && !jsonObj.get("FirstName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FirstName").toString())); + } + if ((jsonObj.get("MiddleName") != null && !jsonObj.get("MiddleName").isJsonNull()) && !jsonObj.get("MiddleName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MiddleName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MiddleName").toString())); + } + if ((jsonObj.get("LastName") != null && !jsonObj.get("LastName").isJsonNull()) && !jsonObj.get("LastName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastName").toString())); + } + if ((jsonObj.get("Suffix") != null && !jsonObj.get("Suffix").isJsonNull()) && !jsonObj.get("Suffix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Suffix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Suffix").toString())); + } + if ((jsonObj.get("NickName") != null && !jsonObj.get("NickName").isJsonNull()) && !jsonObj.get("NickName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NickName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NickName").toString())); + } + if ((jsonObj.get("ProfileName") != null && !jsonObj.get("ProfileName").isJsonNull()) && !jsonObj.get("ProfileName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileName").toString())); + } + if ((jsonObj.get("About") != null && !jsonObj.get("About").isJsonNull()) && !jsonObj.get("About").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `About` to be a primitive type in the JSON string but got `%s`", jsonObj.get("About").toString())); + } + if ((jsonObj.get("Company") != null && !jsonObj.get("Company").isJsonNull()) && !jsonObj.get("Company").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Company` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Company").toString())); + } + if ((jsonObj.get("ImageUrl") != null && !jsonObj.get("ImageUrl").isJsonNull()) && !jsonObj.get("ImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ImageUrl").toString())); + } + if ((jsonObj.get("TimeZone") != null && !jsonObj.get("TimeZone").isJsonNull()) && !jsonObj.get("TimeZone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TimeZone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TimeZone").toString())); + } + if ((jsonObj.get("Website") != null && !jsonObj.get("Website").isJsonNull()) && !jsonObj.get("Website").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Website` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Website").toString())); + } + if ((jsonObj.get("ThumbnailImageUrl") != null && !jsonObj.get("ThumbnailImageUrl").isJsonNull()) && !jsonObj.get("ThumbnailImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ThumbnailImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ThumbnailImageUrl").toString())); + } + if ((jsonObj.get("Favicon") != null && !jsonObj.get("Favicon").isJsonNull()) && !jsonObj.get("Favicon").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Favicon` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Favicon").toString())); + } + if ((jsonObj.get("ProfileUrl") != null && !jsonObj.get("ProfileUrl").isJsonNull()) && !jsonObj.get("ProfileUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileUrl").toString())); + } + if ((jsonObj.get("HomeTown") != null && !jsonObj.get("HomeTown").isJsonNull()) && !jsonObj.get("HomeTown").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HomeTown` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HomeTown").toString())); + } + if ((jsonObj.get("State") != null && !jsonObj.get("State").isJsonNull()) && !jsonObj.get("State").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `State` to be a primitive type in the JSON string but got `%s`", jsonObj.get("State").toString())); + } + if ((jsonObj.get("City") != null && !jsonObj.get("City").isJsonNull()) && !jsonObj.get("City").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `City` to be a primitive type in the JSON string but got `%s`", jsonObj.get("City").toString())); + } + if ((jsonObj.get("Industry") != null && !jsonObj.get("Industry").isJsonNull()) && !jsonObj.get("Industry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Industry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Industry").toString())); + } + if ((jsonObj.get("LocalLanguage") != null && !jsonObj.get("LocalLanguage").isJsonNull()) && !jsonObj.get("LocalLanguage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalLanguage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalLanguage").toString())); + } + if ((jsonObj.get("Language") != null && !jsonObj.get("Language").isJsonNull()) && !jsonObj.get("Language").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Language` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Language").toString())); + } + if ((jsonObj.get("CoverPhoto") != null && !jsonObj.get("CoverPhoto").isJsonNull()) && !jsonObj.get("CoverPhoto").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CoverPhoto` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CoverPhoto").toString())); + } + if ((jsonObj.get("TagLine") != null && !jsonObj.get("TagLine").isJsonNull()) && !jsonObj.get("TagLine").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TagLine` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TagLine").toString())); + } + if ((jsonObj.get("MainAddress") != null && !jsonObj.get("MainAddress").isJsonNull()) && !jsonObj.get("MainAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MainAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MainAddress").toString())); + } + if ((jsonObj.get("LocalCity") != null && !jsonObj.get("LocalCity").isJsonNull()) && !jsonObj.get("LocalCity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalCity").toString())); + } + if ((jsonObj.get("ProfileCity") != null && !jsonObj.get("ProfileCity").isJsonNull()) && !jsonObj.get("ProfileCity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileCity").toString())); + } + if ((jsonObj.get("LocalCountry") != null && !jsonObj.get("LocalCountry").isJsonNull()) && !jsonObj.get("LocalCountry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalCountry").toString())); + } + if ((jsonObj.get("ProfileCountry") != null && !jsonObj.get("ProfileCountry").isJsonNull()) && !jsonObj.get("ProfileCountry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileCountry").toString())); + } + if ((jsonObj.get("Quota") != null && !jsonObj.get("Quota").isJsonNull()) && !jsonObj.get("Quota").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Quota` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Quota").toString())); + } + if ((jsonObj.get("Religion") != null && !jsonObj.get("Religion").isJsonNull()) && !jsonObj.get("Religion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Religion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Religion").toString())); + } + if ((jsonObj.get("Political") != null && !jsonObj.get("Political").isJsonNull()) && !jsonObj.get("Political").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Political` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Political").toString())); + } + if ((jsonObj.get("RelationshipStatus") != null && !jsonObj.get("RelationshipStatus").isJsonNull()) && !jsonObj.get("RelationshipStatus").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RelationshipStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RelationshipStatus").toString())); + } + if ((jsonObj.get("HttpsImageUrl") != null && !jsonObj.get("HttpsImageUrl").isJsonNull()) && !jsonObj.get("HttpsImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HttpsImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HttpsImageUrl").toString())); + } + if ((jsonObj.get("IsGeoEnabled") != null && !jsonObj.get("IsGeoEnabled").isJsonNull()) && !jsonObj.get("IsGeoEnabled").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IsGeoEnabled` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IsGeoEnabled").toString())); + } + if ((jsonObj.get("Associations") != null && !jsonObj.get("Associations").isJsonNull()) && !jsonObj.get("Associations").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Associations` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Associations").toString())); + } + if ((jsonObj.get("Honors") != null && !jsonObj.get("Honors").isJsonNull()) && !jsonObj.get("Honors").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Honors` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Honors").toString())); + } + if ((jsonObj.get("PublicRepository") != null && !jsonObj.get("PublicRepository").isJsonNull()) && !jsonObj.get("PublicRepository").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PublicRepository` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PublicRepository").toString())); + } + if ((jsonObj.get("RepositoryUrl") != null && !jsonObj.get("RepositoryUrl").isJsonNull()) && !jsonObj.get("RepositoryUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RepositoryUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RepositoryUrl").toString())); + } + if ((jsonObj.get("ProfessionalHeadline") != null && !jsonObj.get("ProfessionalHeadline").isJsonNull()) && !jsonObj.get("ProfessionalHeadline").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfessionalHeadline` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfessionalHeadline").toString())); + } + if ((jsonObj.get("Currency") != null && !jsonObj.get("Currency").isJsonNull()) && !jsonObj.get("Currency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Currency").toString())); + } + if ((jsonObj.get("StarredUrl") != null && !jsonObj.get("StarredUrl").isJsonNull()) && !jsonObj.get("StarredUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `StarredUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("StarredUrl").toString())); + } + if ((jsonObj.get("GistsUrl") != null && !jsonObj.get("GistsUrl").isJsonNull()) && !jsonObj.get("GistsUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GistsUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GistsUrl").toString())); + } + if ((jsonObj.get("GravatarImageUrl") != null && !jsonObj.get("GravatarImageUrl").isJsonNull()) && !jsonObj.get("GravatarImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GravatarImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GravatarImageUrl").toString())); + } + if ((jsonObj.get("ExternalUserLoginId") != null && !jsonObj.get("ExternalUserLoginId").isJsonNull()) && !jsonObj.get("ExternalUserLoginId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ExternalUserLoginId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ExternalUserLoginId").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("InterestedIn") != null && !jsonObj.get("InterestedIn").isJsonNull() && !jsonObj.get("InterestedIn").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `InterestedIn` to be an array in the JSON string but got `%s`", jsonObj.get("InterestedIn").toString())); + } + // validate the optional field `Country` + if (jsonObj.get("Country") != null && !jsonObj.get("Country").isJsonNull()) { + ProfileRequestModelCountry.validateJsonElement(jsonObj.get("Country")); + } + // validate the optional field `Suggestions` + if (jsonObj.get("Suggestions") != null && !jsonObj.get("Suggestions").isJsonNull()) { + ProfileRequestModelSuggestions.validateJsonElement(jsonObj.get("Suggestions")); + } + // validate the optional field `Subscription` + if (jsonObj.get("Subscription") != null && !jsonObj.get("Subscription").isJsonNull()) { + ProfileRequestModelSubscription.validateJsonElement(jsonObj.get("Subscription")); + } + // validate the optional field `PrivacyPolicy` + if (jsonObj.get("PrivacyPolicy") != null && !jsonObj.get("PrivacyPolicy").isJsonNull()) { + ProfileRequestModelPrivacyPolicy.validateJsonElement(jsonObj.get("PrivacyPolicy")); + } + // validate the optional field `PINInfo` + if (jsonObj.get("PINInfo") != null && !jsonObj.get("PINInfo").isJsonNull()) { + ProfileRequestModelPINInfo.validateJsonElement(jsonObj.get("PINInfo")); + } + if (jsonObj.get("Addresses") != null && !jsonObj.get("Addresses").isJsonNull()) { + JsonArray jsonArrayaddresses = jsonObj.getAsJsonArray("Addresses"); + if (jsonArrayaddresses != null) { + // ensure the json data is an array + if (!jsonObj.get("Addresses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Addresses` to be an array in the JSON string but got `%s`", jsonObj.get("Addresses").toString())); + } + + // validate the optional field `Addresses` (array) + for (int i = 0; i < jsonArrayaddresses.size(); i++) { + ProfileRequestModelAddressesInner.validateJsonElement(jsonArrayaddresses.get(i)); + }; + } + } + if (jsonObj.get("Positions") != null && !jsonObj.get("Positions").isJsonNull()) { + JsonArray jsonArraypositions = jsonObj.getAsJsonArray("Positions"); + if (jsonArraypositions != null) { + // ensure the json data is an array + if (!jsonObj.get("Positions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Positions` to be an array in the JSON string but got `%s`", jsonObj.get("Positions").toString())); + } + + // validate the optional field `Positions` (array) + for (int i = 0; i < jsonArraypositions.size(); i++) { + ProfileRequestModelPositionsInner.validateJsonElement(jsonArraypositions.get(i)); + }; + } + } + if (jsonObj.get("Educations") != null && !jsonObj.get("Educations").isJsonNull()) { + JsonArray jsonArrayeducations = jsonObj.getAsJsonArray("Educations"); + if (jsonArrayeducations != null) { + // ensure the json data is an array + if (!jsonObj.get("Educations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Educations` to be an array in the JSON string but got `%s`", jsonObj.get("Educations").toString())); + } + + // validate the optional field `Educations` (array) + for (int i = 0; i < jsonArrayeducations.size(); i++) { + ProfileRequestModelEducationsInner.validateJsonElement(jsonArrayeducations.get(i)); + }; + } + } + if (jsonObj.get("PhoneNumbers") != null && !jsonObj.get("PhoneNumbers").isJsonNull()) { + JsonArray jsonArrayphoneNumbers = jsonObj.getAsJsonArray("PhoneNumbers"); + if (jsonArrayphoneNumbers != null) { + // ensure the json data is an array + if (!jsonObj.get("PhoneNumbers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PhoneNumbers` to be an array in the JSON string but got `%s`", jsonObj.get("PhoneNumbers").toString())); + } + + // validate the optional field `PhoneNumbers` (array) + for (int i = 0; i < jsonArrayphoneNumbers.size(); i++) { + ProfileRequestModelPhoneNumbersInner.validateJsonElement(jsonArrayphoneNumbers.get(i)); + }; + } + } + if (jsonObj.get("IMAccounts") != null && !jsonObj.get("IMAccounts").isJsonNull()) { + JsonArray jsonArrayimAccounts = jsonObj.getAsJsonArray("IMAccounts"); + if (jsonArrayimAccounts != null) { + // ensure the json data is an array + if (!jsonObj.get("IMAccounts").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `IMAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("IMAccounts").toString())); + } + + // validate the optional field `IMAccounts` (array) + for (int i = 0; i < jsonArrayimAccounts.size(); i++) { + ProfileRequestModelIMAccountsInner.validateJsonElement(jsonArrayimAccounts.get(i)); + }; + } + } + if (jsonObj.get("Interests") != null && !jsonObj.get("Interests").isJsonNull()) { + JsonArray jsonArrayinterests = jsonObj.getAsJsonArray("Interests"); + if (jsonArrayinterests != null) { + // ensure the json data is an array + if (!jsonObj.get("Interests").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Interests` to be an array in the JSON string but got `%s`", jsonObj.get("Interests").toString())); + } + + // validate the optional field `Interests` (array) + for (int i = 0; i < jsonArrayinterests.size(); i++) { + ProfileRequestModelInterestsInner.validateJsonElement(jsonArrayinterests.get(i)); + }; + } + } + if (jsonObj.get("Sports") != null && !jsonObj.get("Sports").isJsonNull()) { + JsonArray jsonArraysports = jsonObj.getAsJsonArray("Sports"); + if (jsonArraysports != null) { + // ensure the json data is an array + if (!jsonObj.get("Sports").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Sports` to be an array in the JSON string but got `%s`", jsonObj.get("Sports").toString())); + } + + // validate the optional field `Sports` (array) + for (int i = 0; i < jsonArraysports.size(); i++) { + ProfileRequestModelSportsInner.validateJsonElement(jsonArraysports.get(i)); + }; + } + } + if (jsonObj.get("InspirationalPeople") != null && !jsonObj.get("InspirationalPeople").isJsonNull()) { + JsonArray jsonArrayinspirationalPeople = jsonObj.getAsJsonArray("InspirationalPeople"); + if (jsonArrayinspirationalPeople != null) { + // ensure the json data is an array + if (!jsonObj.get("InspirationalPeople").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `InspirationalPeople` to be an array in the JSON string but got `%s`", jsonObj.get("InspirationalPeople").toString())); + } + + // validate the optional field `InspirationalPeople` (array) + for (int i = 0; i < jsonArrayinspirationalPeople.size(); i++) { + ProfileRequestModelInspirationalPeopleInner.validateJsonElement(jsonArrayinspirationalPeople.get(i)); + }; + } + } + if (jsonObj.get("Awards") != null && !jsonObj.get("Awards").isJsonNull()) { + JsonArray jsonArrayawards = jsonObj.getAsJsonArray("Awards"); + if (jsonArrayawards != null) { + // ensure the json data is an array + if (!jsonObj.get("Awards").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Awards` to be an array in the JSON string but got `%s`", jsonObj.get("Awards").toString())); + } + + // validate the optional field `Awards` (array) + for (int i = 0; i < jsonArrayawards.size(); i++) { + ProfileRequestModelAwardsInner.validateJsonElement(jsonArrayawards.get(i)); + }; + } + } + if (jsonObj.get("Skills") != null && !jsonObj.get("Skills").isJsonNull()) { + JsonArray jsonArrayskills = jsonObj.getAsJsonArray("Skills"); + if (jsonArrayskills != null) { + // ensure the json data is an array + if (!jsonObj.get("Skills").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Skills` to be an array in the JSON string but got `%s`", jsonObj.get("Skills").toString())); + } + + // validate the optional field `Skills` (array) + for (int i = 0; i < jsonArrayskills.size(); i++) { + ProfileRequestModelSkillsInner.validateJsonElement(jsonArrayskills.get(i)); + }; + } + } + if (jsonObj.get("CurrentStatus") != null && !jsonObj.get("CurrentStatus").isJsonNull()) { + JsonArray jsonArraycurrentStatus = jsonObj.getAsJsonArray("CurrentStatus"); + if (jsonArraycurrentStatus != null) { + // ensure the json data is an array + if (!jsonObj.get("CurrentStatus").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `CurrentStatus` to be an array in the JSON string but got `%s`", jsonObj.get("CurrentStatus").toString())); + } + + // validate the optional field `CurrentStatus` (array) + for (int i = 0; i < jsonArraycurrentStatus.size(); i++) { + ProfileRequestModelCurrentStatusInner.validateJsonElement(jsonArraycurrentStatus.get(i)); + }; + } + } + if (jsonObj.get("Certifications") != null && !jsonObj.get("Certifications").isJsonNull()) { + JsonArray jsonArraycertifications = jsonObj.getAsJsonArray("Certifications"); + if (jsonArraycertifications != null) { + // ensure the json data is an array + if (!jsonObj.get("Certifications").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Certifications` to be an array in the JSON string but got `%s`", jsonObj.get("Certifications").toString())); + } + + // validate the optional field `Certifications` (array) + for (int i = 0; i < jsonArraycertifications.size(); i++) { + ProfileRequestModelCertificationsInner.validateJsonElement(jsonArraycertifications.get(i)); + }; + } + } + if (jsonObj.get("Courses") != null && !jsonObj.get("Courses").isJsonNull()) { + JsonArray jsonArraycourses = jsonObj.getAsJsonArray("Courses"); + if (jsonArraycourses != null) { + // ensure the json data is an array + if (!jsonObj.get("Courses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Courses` to be an array in the JSON string but got `%s`", jsonObj.get("Courses").toString())); + } + + // validate the optional field `Courses` (array) + for (int i = 0; i < jsonArraycourses.size(); i++) { + ProfileRequestModelCoursesInner.validateJsonElement(jsonArraycourses.get(i)); + }; + } + } + if (jsonObj.get("Volunteer") != null && !jsonObj.get("Volunteer").isJsonNull()) { + JsonArray jsonArrayvolunteer = jsonObj.getAsJsonArray("Volunteer"); + if (jsonArrayvolunteer != null) { + // ensure the json data is an array + if (!jsonObj.get("Volunteer").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Volunteer` to be an array in the JSON string but got `%s`", jsonObj.get("Volunteer").toString())); + } + + // validate the optional field `Volunteer` (array) + for (int i = 0; i < jsonArrayvolunteer.size(); i++) { + ProfileRequestModelVolunteerInner.validateJsonElement(jsonArrayvolunteer.get(i)); + }; + } + } + if (jsonObj.get("RecommendationsReceived") != null && !jsonObj.get("RecommendationsReceived").isJsonNull()) { + JsonArray jsonArrayrecommendationsReceived = jsonObj.getAsJsonArray("RecommendationsReceived"); + if (jsonArrayrecommendationsReceived != null) { + // ensure the json data is an array + if (!jsonObj.get("RecommendationsReceived").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RecommendationsReceived` to be an array in the JSON string but got `%s`", jsonObj.get("RecommendationsReceived").toString())); + } + + // validate the optional field `RecommendationsReceived` (array) + for (int i = 0; i < jsonArrayrecommendationsReceived.size(); i++) { + ProfileRequestModelRecommendationsReceivedInner.validateJsonElement(jsonArrayrecommendationsReceived.get(i)); + }; + } + } + if (jsonObj.get("Languages") != null && !jsonObj.get("Languages").isJsonNull()) { + JsonArray jsonArraylanguages = jsonObj.getAsJsonArray("Languages"); + if (jsonArraylanguages != null) { + // ensure the json data is an array + if (!jsonObj.get("Languages").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Languages` to be an array in the JSON string but got `%s`", jsonObj.get("Languages").toString())); + } + + // validate the optional field `Languages` (array) + for (int i = 0; i < jsonArraylanguages.size(); i++) { + ProfileRequestModelLanguagesInner.validateJsonElement(jsonArraylanguages.get(i)); + }; + } + } + if (jsonObj.get("Projects") != null && !jsonObj.get("Projects").isJsonNull()) { + JsonArray jsonArrayprojects = jsonObj.getAsJsonArray("Projects"); + if (jsonArrayprojects != null) { + // ensure the json data is an array + if (!jsonObj.get("Projects").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Projects` to be an array in the JSON string but got `%s`", jsonObj.get("Projects").toString())); + } + + // validate the optional field `Projects` (array) + for (int i = 0; i < jsonArrayprojects.size(); i++) { + ProfileRequestModelProjectsInner.validateJsonElement(jsonArrayprojects.get(i)); + }; + } + } + if (jsonObj.get("Games") != null && !jsonObj.get("Games").isJsonNull()) { + JsonArray jsonArraygames = jsonObj.getAsJsonArray("Games"); + if (jsonArraygames != null) { + // ensure the json data is an array + if (!jsonObj.get("Games").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Games` to be an array in the JSON string but got `%s`", jsonObj.get("Games").toString())); + } + + // validate the optional field `Games` (array) + for (int i = 0; i < jsonArraygames.size(); i++) { + ProfileRequestModelGamesInner.validateJsonElement(jsonArraygames.get(i)); + }; + } + } + if (jsonObj.get("Family") != null && !jsonObj.get("Family").isJsonNull()) { + JsonArray jsonArrayfamily = jsonObj.getAsJsonArray("Family"); + if (jsonArrayfamily != null) { + // ensure the json data is an array + if (!jsonObj.get("Family").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Family` to be an array in the JSON string but got `%s`", jsonObj.get("Family").toString())); + } + + // validate the optional field `Family` (array) + for (int i = 0; i < jsonArrayfamily.size(); i++) { + ProfileRequestModelFamilyInner.validateJsonElement(jsonArrayfamily.get(i)); + }; + } + } + if (jsonObj.get("TeleVisionShow") != null && !jsonObj.get("TeleVisionShow").isJsonNull()) { + JsonArray jsonArrayteleVisionShow = jsonObj.getAsJsonArray("TeleVisionShow"); + if (jsonArrayteleVisionShow != null) { + // ensure the json data is an array + if (!jsonObj.get("TeleVisionShow").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `TeleVisionShow` to be an array in the JSON string but got `%s`", jsonObj.get("TeleVisionShow").toString())); + } + + // validate the optional field `TeleVisionShow` (array) + for (int i = 0; i < jsonArrayteleVisionShow.size(); i++) { + ProfileRequestModelTeleVisionShowInner.validateJsonElement(jsonArrayteleVisionShow.get(i)); + }; + } + } + if (jsonObj.get("MutualFriends") != null && !jsonObj.get("MutualFriends").isJsonNull()) { + JsonArray jsonArraymutualFriends = jsonObj.getAsJsonArray("MutualFriends"); + if (jsonArraymutualFriends != null) { + // ensure the json data is an array + if (!jsonObj.get("MutualFriends").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `MutualFriends` to be an array in the JSON string but got `%s`", jsonObj.get("MutualFriends").toString())); + } + + // validate the optional field `MutualFriends` (array) + for (int i = 0; i < jsonArraymutualFriends.size(); i++) { + ProfileRequestModelMutualFriendsInner.validateJsonElement(jsonArraymutualFriends.get(i)); + }; + } + } + if (jsonObj.get("Movies") != null && !jsonObj.get("Movies").isJsonNull()) { + JsonArray jsonArraymovies = jsonObj.getAsJsonArray("Movies"); + if (jsonArraymovies != null) { + // ensure the json data is an array + if (!jsonObj.get("Movies").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Movies` to be an array in the JSON string but got `%s`", jsonObj.get("Movies").toString())); + } + + // validate the optional field `Movies` (array) + for (int i = 0; i < jsonArraymovies.size(); i++) { + ProfileRequestModelMoviesInner.validateJsonElement(jsonArraymovies.get(i)); + }; + } + } + if (jsonObj.get("Books") != null && !jsonObj.get("Books").isJsonNull()) { + JsonArray jsonArraybooks = jsonObj.getAsJsonArray("Books"); + if (jsonArraybooks != null) { + // ensure the json data is an array + if (!jsonObj.get("Books").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Books` to be an array in the JSON string but got `%s`", jsonObj.get("Books").toString())); + } + + // validate the optional field `Books` (array) + for (int i = 0; i < jsonArraybooks.size(); i++) { + ProfileRequestModelBooksInner.validateJsonElement(jsonArraybooks.get(i)); + }; + } + } + if (jsonObj.get("Patents") != null && !jsonObj.get("Patents").isJsonNull()) { + JsonArray jsonArraypatents = jsonObj.getAsJsonArray("Patents"); + if (jsonArraypatents != null) { + // ensure the json data is an array + if (!jsonObj.get("Patents").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Patents` to be an array in the JSON string but got `%s`", jsonObj.get("Patents").toString())); + } + + // validate the optional field `Patents` (array) + for (int i = 0; i < jsonArraypatents.size(); i++) { + ProfileRequestModelPatentsInner.validateJsonElement(jsonArraypatents.get(i)); + }; + } + } + if (jsonObj.get("FavoriteThings") != null && !jsonObj.get("FavoriteThings").isJsonNull()) { + JsonArray jsonArrayfavoriteThings = jsonObj.getAsJsonArray("FavoriteThings"); + if (jsonArrayfavoriteThings != null) { + // ensure the json data is an array + if (!jsonObj.get("FavoriteThings").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `FavoriteThings` to be an array in the JSON string but got `%s`", jsonObj.get("FavoriteThings").toString())); + } + + // validate the optional field `FavoriteThings` (array) + for (int i = 0; i < jsonArrayfavoriteThings.size(); i++) { + ProfileRequestModelFavoriteThingsInner.validateJsonElement(jsonArrayfavoriteThings.get(i)); + }; + } + } + if (jsonObj.get("RelatedProfileViews") != null && !jsonObj.get("RelatedProfileViews").isJsonNull()) { + JsonArray jsonArrayrelatedProfileViews = jsonObj.getAsJsonArray("RelatedProfileViews"); + if (jsonArrayrelatedProfileViews != null) { + // ensure the json data is an array + if (!jsonObj.get("RelatedProfileViews").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RelatedProfileViews` to be an array in the JSON string but got `%s`", jsonObj.get("RelatedProfileViews").toString())); + } + + // validate the optional field `RelatedProfileViews` (array) + for (int i = 0; i < jsonArrayrelatedProfileViews.size(); i++) { + ProfileRequestModelRelatedProfileViewsInner.validateJsonElement(jsonArrayrelatedProfileViews.get(i)); + }; + } + } + if (jsonObj.get("PlacesLived") != null && !jsonObj.get("PlacesLived").isJsonNull()) { + JsonArray jsonArrayplacesLived = jsonObj.getAsJsonArray("PlacesLived"); + if (jsonArrayplacesLived != null) { + // ensure the json data is an array + if (!jsonObj.get("PlacesLived").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PlacesLived` to be an array in the JSON string but got `%s`", jsonObj.get("PlacesLived").toString())); + } + + // validate the optional field `PlacesLived` (array) + for (int i = 0; i < jsonArrayplacesLived.size(); i++) { + ProfileRequestModelPlacesLivedInner.validateJsonElement(jsonArrayplacesLived.get(i)); + }; + } + } + if (jsonObj.get("Publications") != null && !jsonObj.get("Publications").isJsonNull()) { + JsonArray jsonArraypublications = jsonObj.getAsJsonArray("Publications"); + if (jsonArraypublications != null) { + // ensure the json data is an array + if (!jsonObj.get("Publications").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Publications` to be an array in the JSON string but got `%s`", jsonObj.get("Publications").toString())); + } + + // validate the optional field `Publications` (array) + for (int i = 0; i < jsonArraypublications.size(); i++) { + ProfileRequestModelPublicationsInner.validateJsonElement(jsonArraypublications.get(i)); + }; + } + } + if (jsonObj.get("JobBookmarks") != null && !jsonObj.get("JobBookmarks").isJsonNull()) { + JsonArray jsonArrayjobBookmarks = jsonObj.getAsJsonArray("JobBookmarks"); + if (jsonArrayjobBookmarks != null) { + // ensure the json data is an array + if (!jsonObj.get("JobBookmarks").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `JobBookmarks` to be an array in the JSON string but got `%s`", jsonObj.get("JobBookmarks").toString())); + } + + // validate the optional field `JobBookmarks` (array) + for (int i = 0; i < jsonArrayjobBookmarks.size(); i++) { + ProfileRequestModelJobBookmarksInner.validateJsonElement(jsonArrayjobBookmarks.get(i)); + }; + } + } + if (jsonObj.get("Badges") != null && !jsonObj.get("Badges").isJsonNull()) { + JsonArray jsonArraybadges = jsonObj.getAsJsonArray("Badges"); + if (jsonArraybadges != null) { + // ensure the json data is an array + if (!jsonObj.get("Badges").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Badges` to be an array in the JSON string but got `%s`", jsonObj.get("Badges").toString())); + } + + // validate the optional field `Badges` (array) + for (int i = 0; i < jsonArraybadges.size(); i++) { + ProfileRequestModelBadgesInner.validateJsonElement(jsonArraybadges.get(i)); + }; + } + } + if (jsonObj.get("MemberUrlResources") != null && !jsonObj.get("MemberUrlResources").isJsonNull()) { + JsonArray jsonArraymemberUrlResources = jsonObj.getAsJsonArray("MemberUrlResources"); + if (jsonArraymemberUrlResources != null) { + // ensure the json data is an array + if (!jsonObj.get("MemberUrlResources").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `MemberUrlResources` to be an array in the JSON string but got `%s`", jsonObj.get("MemberUrlResources").toString())); + } + + // validate the optional field `MemberUrlResources` (array) + for (int i = 0; i < jsonArraymemberUrlResources.size(); i++) { + ProfileRequestModelMemberUrlResourcesInner.validateJsonElement(jsonArraymemberUrlResources.get(i)); + }; + } + } + if (jsonObj.get("ExternalIds") != null && !jsonObj.get("ExternalIds").isJsonNull()) { + JsonArray jsonArrayexternalIds = jsonObj.getAsJsonArray("ExternalIds"); + if (jsonArrayexternalIds != null) { + // ensure the json data is an array + if (!jsonObj.get("ExternalIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ExternalIds` to be an array in the JSON string but got `%s`", jsonObj.get("ExternalIds").toString())); + } + + // validate the optional field `ExternalIds` (array) + for (int i = 0; i < jsonArrayexternalIds.size(); i++) { + ProfileRequestModelExternalIdsInner.validateJsonElement(jsonArrayexternalIds.get(i)); + }; + } + } + if ((jsonObj.get("RegistrationSource") != null && !jsonObj.get("RegistrationSource").isJsonNull()) && !jsonObj.get("RegistrationSource").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RegistrationSource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RegistrationSource").toString())); + } + if ((jsonObj.get("FullName") != null && !jsonObj.get("FullName").isJsonNull()) && !jsonObj.get("FullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FullName").toString())); + } + // validate the optional field `Consents` + if (jsonObj.get("Consents") != null && !jsonObj.get("Consents").isJsonNull()) { + ProfileRequestModelConsents.validateJsonElement(jsonObj.get("Consents")); + } + if (jsonObj.get("Email") != null && !jsonObj.get("Email").isJsonNull()) { + JsonArray jsonArrayemail = jsonObj.getAsJsonArray("Email"); + if (jsonArrayemail != null) { + // ensure the json data is an array + if (!jsonObj.get("Email").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Email` to be an array in the JSON string but got `%s`", jsonObj.get("Email").toString())); + } + + // validate the optional field `Email` (array) + for (int i = 0; i < jsonArrayemail.size(); i++) { + ProfileRequestModelEmailInner.validateJsonElement(jsonArrayemail.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PasskeyRegisterFinish.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyRegisterFinish' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PasskeyRegisterFinish> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyRegisterFinish.class)); + + return (TypeAdapter<T>) new TypeAdapter<PasskeyRegisterFinish>() { + @Override + public void write(JsonWriter out, PasskeyRegisterFinish value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PasskeyRegisterFinish read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyRegisterFinish instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyRegisterFinish given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyRegisterFinish + * @throws IOException if the JSON string is invalid with respect to PasskeyRegisterFinish + */ + public static PasskeyRegisterFinish fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyRegisterFinish.class); + } + + /** + * Convert an instance of PasskeyRegisterFinish to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyRegisterFinishCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyRegisterFinishCore.java new file mode 100644 index 0000000..9c281e1 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasskeyRegisterFinishCore.java @@ -0,0 +1,289 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.PasskeyCredentialCreationResponse; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * PasskeyRegisterFinishCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PasskeyRegisterFinishCore { + public static final String SERIALIZED_NAME_PASSKEY_CREDENTIAL = "PasskeyCredential"; + @SerializedName(SERIALIZED_NAME_PASSKEY_CREDENTIAL) + @javax.annotation.Nullable + private PasskeyCredentialCreationResponse passkeyCredential; + + public PasskeyRegisterFinishCore() { + } + + public PasskeyRegisterFinishCore passkeyCredential(@javax.annotation.Nullable PasskeyCredentialCreationResponse passkeyCredential) { + this.passkeyCredential = passkeyCredential; + return this; + } + + /** + * Get passkeyCredential + * @return passkeyCredential + */ + @javax.annotation.Nullable + public PasskeyCredentialCreationResponse getPasskeyCredential() { + return passkeyCredential; + } + + public void setPasskeyCredential(@javax.annotation.Nullable PasskeyCredentialCreationResponse passkeyCredential) { + this.passkeyCredential = passkeyCredential; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasskeyRegisterFinishCore instance itself + */ + public PasskeyRegisterFinishCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasskeyRegisterFinishCore passkeyRegisterFinishCore = (PasskeyRegisterFinishCore) o; + return Objects.equals(this.passkeyCredential, passkeyRegisterFinishCore.passkeyCredential)&& + Objects.equals(this.additionalProperties, passkeyRegisterFinishCore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(passkeyCredential, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasskeyRegisterFinishCore {\n"); + sb.append(" passkeyCredential: ").append(toIndentedString(passkeyCredential)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("PasskeyCredential"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 PasskeyRegisterFinishCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasskeyRegisterFinishCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasskeyRegisterFinishCore is not found in the empty JSON string", PasskeyRegisterFinishCore.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `PasskeyCredential` + if (jsonObj.get("PasskeyCredential") != null && !jsonObj.get("PasskeyCredential").isJsonNull()) { + PasskeyCredentialCreationResponse.validateJsonElement(jsonObj.get("PasskeyCredential")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PasskeyRegisterFinishCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasskeyRegisterFinishCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PasskeyRegisterFinishCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasskeyRegisterFinishCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<PasskeyRegisterFinishCore>() { + @Override + public void write(JsonWriter out, PasskeyRegisterFinishCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PasskeyRegisterFinishCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasskeyRegisterFinishCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasskeyRegisterFinishCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasskeyRegisterFinishCore + * @throws IOException if the JSON string is invalid with respect to PasskeyRegisterFinishCore + */ + public static PasskeyRegisterFinishCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasskeyRegisterFinishCore.class); + } + + /** + * Convert an instance of PasskeyRegisterFinishCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordEncryptionModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordEncryptionModel.java new file mode 100644 index 0000000..8d33525 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordEncryptionModel.java @@ -0,0 +1,1028 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * PasswordEncryptionModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PasswordEncryptionModel { + public static final String SERIALIZED_NAME_IS_PER_PASSWORD_SALT = "IsPerPasswordSalt"; + @SerializedName(SERIALIZED_NAME_IS_PER_PASSWORD_SALT) + @javax.annotation.Nullable + private Boolean isPerPasswordSalt = false; + + public static final String SERIALIZED_NAME_NUMBER_OF_ITERATION = "NumberOfIteration"; + @SerializedName(SERIALIZED_NAME_NUMBER_OF_ITERATION) + @javax.annotation.Nullable + private Integer numberOfIteration; + + /** + * Version identifier for the Password hashing algorithm. + */ + @JsonAdapter(PasswordHasherVersionEnum.Adapter.class) + public enum PasswordHasherVersionEnum { + V1("V1"), + + V2("V2"), + + V3("V3"), + + V4("V4"), + + V5("V5"); + + private String value; + + PasswordHasherVersionEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PasswordHasherVersionEnum fromValue(String value) { + for (PasswordHasherVersionEnum b : PasswordHasherVersionEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<PasswordHasherVersionEnum> { + @Override + public void write(final JsonWriter jsonWriter, final PasswordHasherVersionEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PasswordHasherVersionEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PasswordHasherVersionEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PasswordHasherVersionEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_PASSWORD_HASHER_VERSION = "PasswordHasherVersion"; + @SerializedName(SERIALIZED_NAME_PASSWORD_HASHER_VERSION) + @javax.annotation.Nullable + private PasswordHasherVersionEnum passwordHasherVersion = PasswordHasherVersionEnum.V1; + + public static final String SERIALIZED_NAME_SUB_KEY_LENGTH = "SubKeyLength"; + @SerializedName(SERIALIZED_NAME_SUB_KEY_LENGTH) + @javax.annotation.Nullable + private Integer subKeyLength; + + public static final String SERIALIZED_NAME_SALT_KEY_LENGTH = "SaltKeyLength"; + @SerializedName(SERIALIZED_NAME_SALT_KEY_LENGTH) + @javax.annotation.Nullable + private Integer saltKeyLength; + + public static final String SERIALIZED_NAME_SALT = "Salt"; + @SerializedName(SERIALIZED_NAME_SALT) + @javax.annotation.Nullable + private String salt; + + /** + * The encryption or hashing algorithm used. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + MD5("MD5"), + + BCRYPT("BCRYPT"), + + PBKDF2("PBKDF2"), + + SHA1("SHA1"), + + SHA256("SHA256"), + + SHA512("SHA512"), + + HMAC_SHA1("HMAC_SHA1"), + + HMAC_SHA256("HMAC_SHA256"), + + ARGON2_ID("ARGON2ID"), + + ARGON2_I("ARGON2I"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<TypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "Type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + /** + * How to attach salt to password + */ + @JsonAdapter(SaltAttachTypeEnum.Adapter.class) + public enum SaltAttachTypeEnum { + NONE("None"), + + PREPEND("Prepend"), + + APPEND("Append"); + + private String value; + + SaltAttachTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static SaltAttachTypeEnum fromValue(String value) { + for (SaltAttachTypeEnum b : SaltAttachTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<SaltAttachTypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final SaltAttachTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SaltAttachTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SaltAttachTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + SaltAttachTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_SALT_ATTACH_TYPE = "SaltAttachType"; + @SerializedName(SERIALIZED_NAME_SALT_ATTACH_TYPE) + @javax.annotation.Nullable + private SaltAttachTypeEnum saltAttachType; + + /** + * Encoding type for the Password hash output + */ + @JsonAdapter(PasswordHashEncodingTypeEnum.Adapter.class) + public enum PasswordHashEncodingTypeEnum { + DEFAULT("Default"), + + BASE64("Base64"), + + HEXA_DECIMAL("HexaDecimal"), + + UTF8("UTF8"), + + BIT_CONVERTER("BitConverter"); + + private String value; + + PasswordHashEncodingTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PasswordHashEncodingTypeEnum fromValue(String value) { + for (PasswordHashEncodingTypeEnum b : PasswordHashEncodingTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter<PasswordHashEncodingTypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final PasswordHashEncodingTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PasswordHashEncodingTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PasswordHashEncodingTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PasswordHashEncodingTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_PASSWORD_HASH_ENCODING_TYPE = "PasswordHashEncodingType"; + @SerializedName(SERIALIZED_NAME_PASSWORD_HASH_ENCODING_TYPE) + @javax.annotation.Nullable + private PasswordHashEncodingTypeEnum passwordHashEncodingType; + + /** + * Encoding type for the salt + */ + @JsonAdapter(PasswordSaltEncodingTypeEnum.Adapter.class) + public enum PasswordSaltEncodingTypeEnum { + DEFAULT("Default"), + + BASE64("Base64"), + + HEXA_DECIMAL("HexaDecimal"), + + UTF8("UTF8"), + + BIT_CONVERTER("BitConverter"); + + private String value; + + PasswordSaltEncodingTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PasswordSaltEncodingTypeEnum fromValue(String value) { + for (PasswordSaltEncodingTypeEnum b : PasswordSaltEncodingTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter<PasswordSaltEncodingTypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final PasswordSaltEncodingTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PasswordSaltEncodingTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PasswordSaltEncodingTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PasswordSaltEncodingTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_PASSWORD_SALT_ENCODING_TYPE = "PasswordSaltEncodingType"; + @SerializedName(SERIALIZED_NAME_PASSWORD_SALT_ENCODING_TYPE) + @javax.annotation.Nullable + private PasswordSaltEncodingTypeEnum passwordSaltEncodingType; + + /** + * Encoding type for the plaintext Password before hashing. + */ + @JsonAdapter(PlaintextPasswordEncodingEnum.Adapter.class) + public enum PlaintextPasswordEncodingEnum { + DEFAULT("Default"), + + BASE64("Base64"), + + UTF8("UTF8"); + + private String value; + + PlaintextPasswordEncodingEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static PlaintextPasswordEncodingEnum fromValue(String value) { + for (PlaintextPasswordEncodingEnum b : PlaintextPasswordEncodingEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter<PlaintextPasswordEncodingEnum> { + @Override + public void write(final JsonWriter jsonWriter, final PlaintextPasswordEncodingEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public PlaintextPasswordEncodingEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return PlaintextPasswordEncodingEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + PlaintextPasswordEncodingEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_PLAINTEXT_PASSWORD_ENCODING = "PlaintextPasswordEncoding"; + @SerializedName(SERIALIZED_NAME_PLAINTEXT_PASSWORD_ENCODING) + @javax.annotation.Nullable + private PlaintextPasswordEncodingEnum plaintextPasswordEncoding; + + public static final String SERIALIZED_NAME_PASSWORD_HASH_THREAD = "PasswordHashThread"; + @SerializedName(SERIALIZED_NAME_PASSWORD_HASH_THREAD) + @javax.annotation.Nullable + private Integer passwordHashThread; + + public static final String SERIALIZED_NAME_PASSWORD_HASH_MEMORY = "PasswordHashMemory"; + @SerializedName(SERIALIZED_NAME_PASSWORD_HASH_MEMORY) + @javax.annotation.Nullable + private Integer passwordHashMemory; + + public PasswordEncryptionModel() { + } + + public PasswordEncryptionModel isPerPasswordSalt(@javax.annotation.Nullable Boolean isPerPasswordSalt) { + this.isPerPasswordSalt = isPerPasswordSalt; + return this; + } + + /** + * Whether to generate a unique salt for each password + * @return isPerPasswordSalt + */ + @javax.annotation.Nullable + public Boolean getIsPerPasswordSalt() { + return isPerPasswordSalt; + } + + public void setIsPerPasswordSalt(@javax.annotation.Nullable Boolean isPerPasswordSalt) { + this.isPerPasswordSalt = isPerPasswordSalt; + } + + + public PasswordEncryptionModel numberOfIteration(@javax.annotation.Nullable Integer numberOfIteration) { + this.numberOfIteration = numberOfIteration; + return this; + } + + /** + * Number of hashing iterations to apply. + * minimum: 0 + * @return numberOfIteration + */ + @javax.annotation.Nullable + public Integer getNumberOfIteration() { + return numberOfIteration; + } + + public void setNumberOfIteration(@javax.annotation.Nullable Integer numberOfIteration) { + this.numberOfIteration = numberOfIteration; + } + + + public PasswordEncryptionModel passwordHasherVersion(@javax.annotation.Nullable PasswordHasherVersionEnum passwordHasherVersion) { + this.passwordHasherVersion = passwordHasherVersion; + return this; + } + + /** + * Version identifier for the Password hashing algorithm. + * @return passwordHasherVersion + */ + @javax.annotation.Nullable + public PasswordHasherVersionEnum getPasswordHasherVersion() { + return passwordHasherVersion; + } + + public void setPasswordHasherVersion(@javax.annotation.Nullable PasswordHasherVersionEnum passwordHasherVersion) { + this.passwordHasherVersion = passwordHasherVersion; + } + + + public PasswordEncryptionModel subKeyLength(@javax.annotation.Nullable Integer subKeyLength) { + this.subKeyLength = subKeyLength; + return this; + } + + /** + * Length of the derived key (in bytes). + * minimum: 0 + * @return subKeyLength + */ + @javax.annotation.Nullable + public Integer getSubKeyLength() { + return subKeyLength; + } + + public void setSubKeyLength(@javax.annotation.Nullable Integer subKeyLength) { + this.subKeyLength = subKeyLength; + } + + + public PasswordEncryptionModel saltKeyLength(@javax.annotation.Nullable Integer saltKeyLength) { + this.saltKeyLength = saltKeyLength; + return this; + } + + /** + * Length of the salt key (in bytes). + * minimum: 0 + * @return saltKeyLength + */ + @javax.annotation.Nullable + public Integer getSaltKeyLength() { + return saltKeyLength; + } + + public void setSaltKeyLength(@javax.annotation.Nullable Integer saltKeyLength) { + this.saltKeyLength = saltKeyLength; + } + + + public PasswordEncryptionModel salt(@javax.annotation.Nullable String salt) { + this.salt = salt; + return this; + } + + /** + * Global salt value (used when IsPerPasswordSalt is false) + * @return salt + */ + @javax.annotation.Nullable + public String getSalt() { + return salt; + } + + public void setSalt(@javax.annotation.Nullable String salt) { + this.salt = salt; + } + + + public PasswordEncryptionModel type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * The encryption or hashing algorithm used. + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + public PasswordEncryptionModel saltAttachType(@javax.annotation.Nullable SaltAttachTypeEnum saltAttachType) { + this.saltAttachType = saltAttachType; + return this; + } + + /** + * How to attach salt to password + * @return saltAttachType + */ + @javax.annotation.Nullable + public SaltAttachTypeEnum getSaltAttachType() { + return saltAttachType; + } + + public void setSaltAttachType(@javax.annotation.Nullable SaltAttachTypeEnum saltAttachType) { + this.saltAttachType = saltAttachType; + } + + + public PasswordEncryptionModel passwordHashEncodingType(@javax.annotation.Nullable PasswordHashEncodingTypeEnum passwordHashEncodingType) { + this.passwordHashEncodingType = passwordHashEncodingType; + return this; + } + + /** + * Encoding type for the Password hash output + * @return passwordHashEncodingType + */ + @javax.annotation.Nullable + public PasswordHashEncodingTypeEnum getPasswordHashEncodingType() { + return passwordHashEncodingType; + } + + public void setPasswordHashEncodingType(@javax.annotation.Nullable PasswordHashEncodingTypeEnum passwordHashEncodingType) { + this.passwordHashEncodingType = passwordHashEncodingType; + } + + + public PasswordEncryptionModel passwordSaltEncodingType(@javax.annotation.Nullable PasswordSaltEncodingTypeEnum passwordSaltEncodingType) { + this.passwordSaltEncodingType = passwordSaltEncodingType; + return this; + } + + /** + * Encoding type for the salt + * @return passwordSaltEncodingType + */ + @javax.annotation.Nullable + public PasswordSaltEncodingTypeEnum getPasswordSaltEncodingType() { + return passwordSaltEncodingType; + } + + public void setPasswordSaltEncodingType(@javax.annotation.Nullable PasswordSaltEncodingTypeEnum passwordSaltEncodingType) { + this.passwordSaltEncodingType = passwordSaltEncodingType; + } + + + public PasswordEncryptionModel plaintextPasswordEncoding(@javax.annotation.Nullable PlaintextPasswordEncodingEnum plaintextPasswordEncoding) { + this.plaintextPasswordEncoding = plaintextPasswordEncoding; + return this; + } + + /** + * Encoding type for the plaintext Password before hashing. + * @return plaintextPasswordEncoding + */ + @javax.annotation.Nullable + public PlaintextPasswordEncodingEnum getPlaintextPasswordEncoding() { + return plaintextPasswordEncoding; + } + + public void setPlaintextPasswordEncoding(@javax.annotation.Nullable PlaintextPasswordEncodingEnum plaintextPasswordEncoding) { + this.plaintextPasswordEncoding = plaintextPasswordEncoding; + } + + + public PasswordEncryptionModel passwordHashThread(@javax.annotation.Nullable Integer passwordHashThread) { + this.passwordHashThread = passwordHashThread; + return this; + } + + /** + * Number of threads for Argon2 algorithms + * minimum: 0 + * maximum: 128 + * @return passwordHashThread + */ + @javax.annotation.Nullable + public Integer getPasswordHashThread() { + return passwordHashThread; + } + + public void setPasswordHashThread(@javax.annotation.Nullable Integer passwordHashThread) { + this.passwordHashThread = passwordHashThread; + } + + + public PasswordEncryptionModel passwordHashMemory(@javax.annotation.Nullable Integer passwordHashMemory) { + this.passwordHashMemory = passwordHashMemory; + return this; + } + + /** + * Memory usage (in KB) for Argon2 algorithms + * minimum: 0 + * maximum: 8192 + * @return passwordHashMemory + */ + @javax.annotation.Nullable + public Integer getPasswordHashMemory() { + return passwordHashMemory; + } + + public void setPasswordHashMemory(@javax.annotation.Nullable Integer passwordHashMemory) { + this.passwordHashMemory = passwordHashMemory; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasswordEncryptionModel instance itself + */ + public PasswordEncryptionModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasswordEncryptionModel passwordEncryptionModel = (PasswordEncryptionModel) o; + return Objects.equals(this.isPerPasswordSalt, passwordEncryptionModel.isPerPasswordSalt) && + Objects.equals(this.numberOfIteration, passwordEncryptionModel.numberOfIteration) && + Objects.equals(this.passwordHasherVersion, passwordEncryptionModel.passwordHasherVersion) && + Objects.equals(this.subKeyLength, passwordEncryptionModel.subKeyLength) && + Objects.equals(this.saltKeyLength, passwordEncryptionModel.saltKeyLength) && + Objects.equals(this.salt, passwordEncryptionModel.salt) && + Objects.equals(this.type, passwordEncryptionModel.type) && + Objects.equals(this.saltAttachType, passwordEncryptionModel.saltAttachType) && + Objects.equals(this.passwordHashEncodingType, passwordEncryptionModel.passwordHashEncodingType) && + Objects.equals(this.passwordSaltEncodingType, passwordEncryptionModel.passwordSaltEncodingType) && + Objects.equals(this.plaintextPasswordEncoding, passwordEncryptionModel.plaintextPasswordEncoding) && + Objects.equals(this.passwordHashThread, passwordEncryptionModel.passwordHashThread) && + Objects.equals(this.passwordHashMemory, passwordEncryptionModel.passwordHashMemory)&& + Objects.equals(this.additionalProperties, passwordEncryptionModel.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(isPerPasswordSalt, numberOfIteration, passwordHasherVersion, subKeyLength, saltKeyLength, salt, type, saltAttachType, passwordHashEncodingType, passwordSaltEncodingType, plaintextPasswordEncoding, passwordHashThread, passwordHashMemory, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasswordEncryptionModel {\n"); + sb.append(" isPerPasswordSalt: ").append(toIndentedString(isPerPasswordSalt)).append("\n"); + sb.append(" numberOfIteration: ").append(toIndentedString(numberOfIteration)).append("\n"); + sb.append(" passwordHasherVersion: ").append(toIndentedString(passwordHasherVersion)).append("\n"); + sb.append(" subKeyLength: ").append(toIndentedString(subKeyLength)).append("\n"); + sb.append(" saltKeyLength: ").append(toIndentedString(saltKeyLength)).append("\n"); + sb.append(" salt: ").append(toIndentedString(salt)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" saltAttachType: ").append(toIndentedString(saltAttachType)).append("\n"); + sb.append(" passwordHashEncodingType: ").append(toIndentedString(passwordHashEncodingType)).append("\n"); + sb.append(" passwordSaltEncodingType: ").append(toIndentedString(passwordSaltEncodingType)).append("\n"); + sb.append(" plaintextPasswordEncoding: ").append(toIndentedString(plaintextPasswordEncoding)).append("\n"); + sb.append(" passwordHashThread: ").append(toIndentedString(passwordHashThread)).append("\n"); + sb.append(" passwordHashMemory: ").append(toIndentedString(passwordHashMemory)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsPerPasswordSalt"); + openapiFields.add("NumberOfIteration"); + openapiFields.add("PasswordHasherVersion"); + openapiFields.add("SubKeyLength"); + openapiFields.add("SaltKeyLength"); + openapiFields.add("Salt"); + openapiFields.add("Type"); + openapiFields.add("SaltAttachType"); + openapiFields.add("PasswordHashEncodingType"); + openapiFields.add("PasswordSaltEncodingType"); + openapiFields.add("PlaintextPasswordEncoding"); + openapiFields.add("PasswordHashThread"); + openapiFields.add("PasswordHashMemory"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Type"); + } + + /** + * 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 PasswordEncryptionModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasswordEncryptionModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasswordEncryptionModel is not found in the empty JSON string", PasswordEncryptionModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasswordEncryptionModel.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("PasswordHasherVersion") != null && !jsonObj.get("PasswordHasherVersion").isJsonNull()) && !jsonObj.get("PasswordHasherVersion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PasswordHasherVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PasswordHasherVersion").toString())); + } + // validate the optional field `PasswordHasherVersion` + if (jsonObj.get("PasswordHasherVersion") != null && !jsonObj.get("PasswordHasherVersion").isJsonNull()) { + PasswordHasherVersionEnum.validateJsonElement(jsonObj.get("PasswordHasherVersion")); + } + if ((jsonObj.get("Salt") != null && !jsonObj.get("Salt").isJsonNull()) && !jsonObj.get("Salt").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Salt` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Salt").toString())); + } + if (!jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + // validate the required field `Type` + TypeEnum.validateJsonElement(jsonObj.get("Type")); + if ((jsonObj.get("SaltAttachType") != null && !jsonObj.get("SaltAttachType").isJsonNull()) && !jsonObj.get("SaltAttachType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SaltAttachType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SaltAttachType").toString())); + } + // validate the optional field `SaltAttachType` + if (jsonObj.get("SaltAttachType") != null && !jsonObj.get("SaltAttachType").isJsonNull()) { + SaltAttachTypeEnum.validateJsonElement(jsonObj.get("SaltAttachType")); + } + if ((jsonObj.get("PasswordHashEncodingType") != null && !jsonObj.get("PasswordHashEncodingType").isJsonNull()) && !jsonObj.get("PasswordHashEncodingType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PasswordHashEncodingType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PasswordHashEncodingType").toString())); + } + // validate the optional field `PasswordHashEncodingType` + if (jsonObj.get("PasswordHashEncodingType") != null && !jsonObj.get("PasswordHashEncodingType").isJsonNull()) { + PasswordHashEncodingTypeEnum.validateJsonElement(jsonObj.get("PasswordHashEncodingType")); + } + if ((jsonObj.get("PasswordSaltEncodingType") != null && !jsonObj.get("PasswordSaltEncodingType").isJsonNull()) && !jsonObj.get("PasswordSaltEncodingType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PasswordSaltEncodingType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PasswordSaltEncodingType").toString())); + } + // validate the optional field `PasswordSaltEncodingType` + if (jsonObj.get("PasswordSaltEncodingType") != null && !jsonObj.get("PasswordSaltEncodingType").isJsonNull()) { + PasswordSaltEncodingTypeEnum.validateJsonElement(jsonObj.get("PasswordSaltEncodingType")); + } + if ((jsonObj.get("PlaintextPasswordEncoding") != null && !jsonObj.get("PlaintextPasswordEncoding").isJsonNull()) && !jsonObj.get("PlaintextPasswordEncoding").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PlaintextPasswordEncoding` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PlaintextPasswordEncoding").toString())); + } + // validate the optional field `PlaintextPasswordEncoding` + if (jsonObj.get("PlaintextPasswordEncoding") != null && !jsonObj.get("PlaintextPasswordEncoding").isJsonNull()) { + PlaintextPasswordEncodingEnum.validateJsonElement(jsonObj.get("PlaintextPasswordEncoding")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PasswordEncryptionModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasswordEncryptionModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PasswordEncryptionModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasswordEncryptionModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<PasswordEncryptionModel>() { + @Override + public void write(JsonWriter out, PasswordEncryptionModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PasswordEncryptionModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasswordEncryptionModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasswordEncryptionModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasswordEncryptionModel + * @throws IOException if the JSON string is invalid with respect to PasswordEncryptionModel + */ + public static PasswordEncryptionModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasswordEncryptionModel.class); + } + + /** + * Convert an instance of PasswordEncryptionModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordLessEmailOTPModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordLessEmailOTPModel.java new file mode 100644 index 0000000..e9b70ca --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordLessEmailOTPModel.java @@ -0,0 +1,525 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * PasswordLessEmailOTPModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PasswordLessEmailOTPModel { + public static final String SERIALIZED_NAME_G_RECAPTCHA_RESPONSE = "g-recaptcha-response"; + @SerializedName(SERIALIZED_NAME_G_RECAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String gRecaptchaResponse; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_TICKET = "qq_captcha_ticket"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_TICKET) + @javax.annotation.Nullable + private String qqCaptchaTicket; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR = "qq_captcha_randstr"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR) + @javax.annotation.Nullable + private String qqCaptchaRandstr; + + public static final String SERIALIZED_NAME_H_CAPTCHA_RESPONSE = "h-captcha-response"; + @SerializedName(SERIALIZED_NAME_H_CAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String hCaptchaResponse; + + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer; + + public static final String SERIALIZED_NAME_WELCOME_EMAIL_TEMPLATE = "WelcomeEmailTemplate"; + @SerializedName(SERIALIZED_NAME_WELCOME_EMAIL_TEMPLATE) + @javax.annotation.Nullable + private String welcomeEmailTemplate; + + public static final String SERIALIZED_NAME_OTP = "Otp"; + @SerializedName(SERIALIZED_NAME_OTP) + @javax.annotation.Nonnull + private String otp; + + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nonnull + private String email; + + public PasswordLessEmailOTPModel() { + } + + public PasswordLessEmailOTPModel gRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + return this; + } + + /** + * The Google reCAPTCHA response which is sent to the server for verification. + * @return gRecaptchaResponse + */ + @javax.annotation.Nullable + public String getgRecaptchaResponse() { + return gRecaptchaResponse; + } + + public void setgRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + } + + + public PasswordLessEmailOTPModel qqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + return this; + } + + /** + * The QQ Captcha ticket which is sent to the server for verification. + * @return qqCaptchaTicket + */ + @javax.annotation.Nullable + public String getQqCaptchaTicket() { + return qqCaptchaTicket; + } + + public void setQqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + } + + + public PasswordLessEmailOTPModel qqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + return this; + } + + /** + * The QQ Captcha random string which is sent to the server for verification. + * @return qqCaptchaRandstr + */ + @javax.annotation.Nullable + public String getQqCaptchaRandstr() { + return qqCaptchaRandstr; + } + + public void setQqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + } + + + public PasswordLessEmailOTPModel hCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + return this; + } + + /** + * The hCaptcha response which is sent to the server for verification. + * @return hCaptchaResponse + */ + @javax.annotation.Nullable + public String gethCaptchaResponse() { + return hCaptchaResponse; + } + + public void sethCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + } + + + public PasswordLessEmailOTPModel securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public PasswordLessEmailOTPModel putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * The security answers which is set for the User, this will be used when the User is blocked for the security question. + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + + public PasswordLessEmailOTPModel welcomeEmailTemplate(@javax.annotation.Nullable String welcomeEmailTemplate) { + this.welcomeEmailTemplate = welcomeEmailTemplate; + return this; + } + + /** + * The template for the welcome Email. + * @return welcomeEmailTemplate + */ + @javax.annotation.Nullable + public String getWelcomeEmailTemplate() { + return welcomeEmailTemplate; + } + + public void setWelcomeEmailTemplate(@javax.annotation.Nullable String welcomeEmailTemplate) { + this.welcomeEmailTemplate = welcomeEmailTemplate; + } + + + public PasswordLessEmailOTPModel otp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + return this; + } + + /** + * The one-time Password (OTP) for verification. + * @return otp + */ + @javax.annotation.Nonnull + public String getOtp() { + return otp; + } + + public void setOtp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + } + + + public PasswordLessEmailOTPModel email(@javax.annotation.Nonnull String email) { + this.email = email; + return this; + } + + /** + * The Email associated with the Account. + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nonnull String email) { + this.email = email; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasswordLessEmailOTPModel instance itself + */ + public PasswordLessEmailOTPModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasswordLessEmailOTPModel passwordLessEmailOTPModel = (PasswordLessEmailOTPModel) o; + return Objects.equals(this.gRecaptchaResponse, passwordLessEmailOTPModel.gRecaptchaResponse) && + Objects.equals(this.qqCaptchaTicket, passwordLessEmailOTPModel.qqCaptchaTicket) && + Objects.equals(this.qqCaptchaRandstr, passwordLessEmailOTPModel.qqCaptchaRandstr) && + Objects.equals(this.hCaptchaResponse, passwordLessEmailOTPModel.hCaptchaResponse) && + Objects.equals(this.securityAnswer, passwordLessEmailOTPModel.securityAnswer) && + Objects.equals(this.welcomeEmailTemplate, passwordLessEmailOTPModel.welcomeEmailTemplate) && + Objects.equals(this.otp, passwordLessEmailOTPModel.otp) && + Objects.equals(this.email, passwordLessEmailOTPModel.email)&& + Objects.equals(this.additionalProperties, passwordLessEmailOTPModel.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, securityAnswer, welcomeEmailTemplate, otp, email, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasswordLessEmailOTPModel {\n"); + sb.append(" gRecaptchaResponse: ").append(toIndentedString(gRecaptchaResponse)).append("\n"); + sb.append(" qqCaptchaTicket: ").append(toIndentedString(qqCaptchaTicket)).append("\n"); + sb.append(" qqCaptchaRandstr: ").append(toIndentedString(qqCaptchaRandstr)).append("\n"); + sb.append(" hCaptchaResponse: ").append(toIndentedString(hCaptchaResponse)).append("\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" welcomeEmailTemplate: ").append(toIndentedString(welcomeEmailTemplate)).append("\n"); + sb.append(" otp: ").append(toIndentedString(otp)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("g-recaptcha-response"); + openapiFields.add("qq_captcha_ticket"); + openapiFields.add("qq_captcha_randstr"); + openapiFields.add("h-captcha-response"); + openapiFields.add("SecurityAnswer"); + openapiFields.add("WelcomeEmailTemplate"); + openapiFields.add("Otp"); + openapiFields.add("Email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Otp"); + openapiRequiredFields.add("Email"); + } + + /** + * 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 PasswordLessEmailOTPModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasswordLessEmailOTPModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasswordLessEmailOTPModel is not found in the empty JSON string", PasswordLessEmailOTPModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasswordLessEmailOTPModel.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("g-recaptcha-response") != null && !jsonObj.get("g-recaptcha-response").isJsonNull()) && !jsonObj.get("g-recaptcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `g-recaptcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("g-recaptcha-response").toString())); + } + if ((jsonObj.get("qq_captcha_ticket") != null && !jsonObj.get("qq_captcha_ticket").isJsonNull()) && !jsonObj.get("qq_captcha_ticket").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_ticket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_ticket").toString())); + } + if ((jsonObj.get("qq_captcha_randstr") != null && !jsonObj.get("qq_captcha_randstr").isJsonNull()) && !jsonObj.get("qq_captcha_randstr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_randstr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_randstr").toString())); + } + if ((jsonObj.get("h-captcha-response") != null && !jsonObj.get("h-captcha-response").isJsonNull()) && !jsonObj.get("h-captcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `h-captcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("h-captcha-response").toString())); + } + if ((jsonObj.get("WelcomeEmailTemplate") != null && !jsonObj.get("WelcomeEmailTemplate").isJsonNull()) && !jsonObj.get("WelcomeEmailTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `WelcomeEmailTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("WelcomeEmailTemplate").toString())); + } + if (!jsonObj.get("Otp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Otp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Otp").toString())); + } + if (!jsonObj.get("Email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Email").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PasswordLessEmailOTPModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasswordLessEmailOTPModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PasswordLessEmailOTPModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasswordLessEmailOTPModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<PasswordLessEmailOTPModel>() { + @Override + public void write(JsonWriter out, PasswordLessEmailOTPModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PasswordLessEmailOTPModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasswordLessEmailOTPModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasswordLessEmailOTPModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasswordLessEmailOTPModel + * @throws IOException if the JSON string is invalid with respect to PasswordLessEmailOTPModel + */ + public static PasswordLessEmailOTPModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasswordLessEmailOTPModel.class); + } + + /** + * Convert an instance of PasswordLessEmailOTPModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordLessEmailOTPModelCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordLessEmailOTPModelCore.java new file mode 100644 index 0000000..63734ef --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordLessEmailOTPModelCore.java @@ -0,0 +1,405 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * PasswordLessEmailOTPModelCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PasswordLessEmailOTPModelCore { + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer; + + public static final String SERIALIZED_NAME_WELCOME_EMAIL_TEMPLATE = "WelcomeEmailTemplate"; + @SerializedName(SERIALIZED_NAME_WELCOME_EMAIL_TEMPLATE) + @javax.annotation.Nullable + private String welcomeEmailTemplate; + + public static final String SERIALIZED_NAME_OTP = "Otp"; + @SerializedName(SERIALIZED_NAME_OTP) + @javax.annotation.Nonnull + private String otp; + + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nonnull + private String email; + + public PasswordLessEmailOTPModelCore() { + } + + public PasswordLessEmailOTPModelCore securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public PasswordLessEmailOTPModelCore putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * The security answers which is set for the User, this will be used when the User is blocked for the security question. + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + + public PasswordLessEmailOTPModelCore welcomeEmailTemplate(@javax.annotation.Nullable String welcomeEmailTemplate) { + this.welcomeEmailTemplate = welcomeEmailTemplate; + return this; + } + + /** + * The template for the welcome Email. + * @return welcomeEmailTemplate + */ + @javax.annotation.Nullable + public String getWelcomeEmailTemplate() { + return welcomeEmailTemplate; + } + + public void setWelcomeEmailTemplate(@javax.annotation.Nullable String welcomeEmailTemplate) { + this.welcomeEmailTemplate = welcomeEmailTemplate; + } + + + public PasswordLessEmailOTPModelCore otp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + return this; + } + + /** + * The one-time Password (OTP) for verification. + * @return otp + */ + @javax.annotation.Nonnull + public String getOtp() { + return otp; + } + + public void setOtp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + } + + + public PasswordLessEmailOTPModelCore email(@javax.annotation.Nonnull String email) { + this.email = email; + return this; + } + + /** + * The Email associated with the Account. + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nonnull String email) { + this.email = email; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasswordLessEmailOTPModelCore instance itself + */ + public PasswordLessEmailOTPModelCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasswordLessEmailOTPModelCore passwordLessEmailOTPModelCore = (PasswordLessEmailOTPModelCore) o; + return Objects.equals(this.securityAnswer, passwordLessEmailOTPModelCore.securityAnswer) && + Objects.equals(this.welcomeEmailTemplate, passwordLessEmailOTPModelCore.welcomeEmailTemplate) && + Objects.equals(this.otp, passwordLessEmailOTPModelCore.otp) && + Objects.equals(this.email, passwordLessEmailOTPModelCore.email)&& + Objects.equals(this.additionalProperties, passwordLessEmailOTPModelCore.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(securityAnswer, welcomeEmailTemplate, otp, email, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasswordLessEmailOTPModelCore {\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" welcomeEmailTemplate: ").append(toIndentedString(welcomeEmailTemplate)).append("\n"); + sb.append(" otp: ").append(toIndentedString(otp)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("SecurityAnswer"); + openapiFields.add("WelcomeEmailTemplate"); + openapiFields.add("Otp"); + openapiFields.add("Email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Otp"); + openapiRequiredFields.add("Email"); + } + + /** + * 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 PasswordLessEmailOTPModelCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasswordLessEmailOTPModelCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasswordLessEmailOTPModelCore is not found in the empty JSON string", PasswordLessEmailOTPModelCore.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasswordLessEmailOTPModelCore.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("WelcomeEmailTemplate") != null && !jsonObj.get("WelcomeEmailTemplate").isJsonNull()) && !jsonObj.get("WelcomeEmailTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `WelcomeEmailTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("WelcomeEmailTemplate").toString())); + } + if (!jsonObj.get("Otp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Otp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Otp").toString())); + } + if (!jsonObj.get("Email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Email").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PasswordLessEmailOTPModelCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasswordLessEmailOTPModelCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PasswordLessEmailOTPModelCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasswordLessEmailOTPModelCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<PasswordLessEmailOTPModelCore>() { + @Override + public void write(JsonWriter out, PasswordLessEmailOTPModelCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PasswordLessEmailOTPModelCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasswordLessEmailOTPModelCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasswordLessEmailOTPModelCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasswordLessEmailOTPModelCore + * @throws IOException if the JSON string is invalid with respect to PasswordLessEmailOTPModelCore + */ + public static PasswordLessEmailOTPModelCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasswordLessEmailOTPModelCore.class); + } + + /** + * Convert an instance of PasswordLessEmailOTPModelCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordLessUserNameOTPModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordLessUserNameOTPModel.java new file mode 100644 index 0000000..d303b8a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordLessUserNameOTPModel.java @@ -0,0 +1,525 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * PasswordLessUserNameOTPModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PasswordLessUserNameOTPModel { + public static final String SERIALIZED_NAME_G_RECAPTCHA_RESPONSE = "g-recaptcha-response"; + @SerializedName(SERIALIZED_NAME_G_RECAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String gRecaptchaResponse; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_TICKET = "qq_captcha_ticket"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_TICKET) + @javax.annotation.Nullable + private String qqCaptchaTicket; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR = "qq_captcha_randstr"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR) + @javax.annotation.Nullable + private String qqCaptchaRandstr; + + public static final String SERIALIZED_NAME_H_CAPTCHA_RESPONSE = "h-captcha-response"; + @SerializedName(SERIALIZED_NAME_H_CAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String hCaptchaResponse; + + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer; + + public static final String SERIALIZED_NAME_WELCOME_EMAIL_TEMPLATE = "WelcomeEmailTemplate"; + @SerializedName(SERIALIZED_NAME_WELCOME_EMAIL_TEMPLATE) + @javax.annotation.Nullable + private String welcomeEmailTemplate; + + public static final String SERIALIZED_NAME_OTP = "Otp"; + @SerializedName(SERIALIZED_NAME_OTP) + @javax.annotation.Nonnull + private String otp; + + public static final String SERIALIZED_NAME_USER_NAME = "UserName"; + @SerializedName(SERIALIZED_NAME_USER_NAME) + @javax.annotation.Nonnull + private String userName; + + public PasswordLessUserNameOTPModel() { + } + + public PasswordLessUserNameOTPModel gRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + return this; + } + + /** + * The Google reCAPTCHA response which is sent to the server for verification. + * @return gRecaptchaResponse + */ + @javax.annotation.Nullable + public String getgRecaptchaResponse() { + return gRecaptchaResponse; + } + + public void setgRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + } + + + public PasswordLessUserNameOTPModel qqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + return this; + } + + /** + * The QQ Captcha ticket which is sent to the server for verification. + * @return qqCaptchaTicket + */ + @javax.annotation.Nullable + public String getQqCaptchaTicket() { + return qqCaptchaTicket; + } + + public void setQqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + } + + + public PasswordLessUserNameOTPModel qqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + return this; + } + + /** + * The QQ Captcha random string which is sent to the server for verification. + * @return qqCaptchaRandstr + */ + @javax.annotation.Nullable + public String getQqCaptchaRandstr() { + return qqCaptchaRandstr; + } + + public void setQqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + } + + + public PasswordLessUserNameOTPModel hCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + return this; + } + + /** + * The hCaptcha response which is sent to the server for verification. + * @return hCaptchaResponse + */ + @javax.annotation.Nullable + public String gethCaptchaResponse() { + return hCaptchaResponse; + } + + public void sethCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + } + + + public PasswordLessUserNameOTPModel securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public PasswordLessUserNameOTPModel putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * The security answers which is set for the User, this will be used when the User is blocked for the security question. + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + + public PasswordLessUserNameOTPModel welcomeEmailTemplate(@javax.annotation.Nullable String welcomeEmailTemplate) { + this.welcomeEmailTemplate = welcomeEmailTemplate; + return this; + } + + /** + * The template for the welcome Email. + * @return welcomeEmailTemplate + */ + @javax.annotation.Nullable + public String getWelcomeEmailTemplate() { + return welcomeEmailTemplate; + } + + public void setWelcomeEmailTemplate(@javax.annotation.Nullable String welcomeEmailTemplate) { + this.welcomeEmailTemplate = welcomeEmailTemplate; + } + + + public PasswordLessUserNameOTPModel otp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + return this; + } + + /** + * The one-time Password (OTP) for verification. + * @return otp + */ + @javax.annotation.Nonnull + public String getOtp() { + return otp; + } + + public void setOtp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + } + + + public PasswordLessUserNameOTPModel userName(@javax.annotation.Nonnull String userName) { + this.userName = userName; + return this; + } + + /** + * The Username associated with the Account. + * @return userName + */ + @javax.annotation.Nonnull + public String getUserName() { + return userName; + } + + public void setUserName(@javax.annotation.Nonnull String userName) { + this.userName = userName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasswordLessUserNameOTPModel instance itself + */ + public PasswordLessUserNameOTPModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasswordLessUserNameOTPModel passwordLessUserNameOTPModel = (PasswordLessUserNameOTPModel) o; + return Objects.equals(this.gRecaptchaResponse, passwordLessUserNameOTPModel.gRecaptchaResponse) && + Objects.equals(this.qqCaptchaTicket, passwordLessUserNameOTPModel.qqCaptchaTicket) && + Objects.equals(this.qqCaptchaRandstr, passwordLessUserNameOTPModel.qqCaptchaRandstr) && + Objects.equals(this.hCaptchaResponse, passwordLessUserNameOTPModel.hCaptchaResponse) && + Objects.equals(this.securityAnswer, passwordLessUserNameOTPModel.securityAnswer) && + Objects.equals(this.welcomeEmailTemplate, passwordLessUserNameOTPModel.welcomeEmailTemplate) && + Objects.equals(this.otp, passwordLessUserNameOTPModel.otp) && + Objects.equals(this.userName, passwordLessUserNameOTPModel.userName)&& + Objects.equals(this.additionalProperties, passwordLessUserNameOTPModel.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, securityAnswer, welcomeEmailTemplate, otp, userName, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasswordLessUserNameOTPModel {\n"); + sb.append(" gRecaptchaResponse: ").append(toIndentedString(gRecaptchaResponse)).append("\n"); + sb.append(" qqCaptchaTicket: ").append(toIndentedString(qqCaptchaTicket)).append("\n"); + sb.append(" qqCaptchaRandstr: ").append(toIndentedString(qqCaptchaRandstr)).append("\n"); + sb.append(" hCaptchaResponse: ").append(toIndentedString(hCaptchaResponse)).append("\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" welcomeEmailTemplate: ").append(toIndentedString(welcomeEmailTemplate)).append("\n"); + sb.append(" otp: ").append(toIndentedString(otp)).append("\n"); + sb.append(" userName: ").append(toIndentedString(userName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("g-recaptcha-response"); + openapiFields.add("qq_captcha_ticket"); + openapiFields.add("qq_captcha_randstr"); + openapiFields.add("h-captcha-response"); + openapiFields.add("SecurityAnswer"); + openapiFields.add("WelcomeEmailTemplate"); + openapiFields.add("Otp"); + openapiFields.add("UserName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Otp"); + openapiRequiredFields.add("UserName"); + } + + /** + * 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 PasswordLessUserNameOTPModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasswordLessUserNameOTPModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasswordLessUserNameOTPModel is not found in the empty JSON string", PasswordLessUserNameOTPModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasswordLessUserNameOTPModel.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("g-recaptcha-response") != null && !jsonObj.get("g-recaptcha-response").isJsonNull()) && !jsonObj.get("g-recaptcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `g-recaptcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("g-recaptcha-response").toString())); + } + if ((jsonObj.get("qq_captcha_ticket") != null && !jsonObj.get("qq_captcha_ticket").isJsonNull()) && !jsonObj.get("qq_captcha_ticket").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_ticket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_ticket").toString())); + } + if ((jsonObj.get("qq_captcha_randstr") != null && !jsonObj.get("qq_captcha_randstr").isJsonNull()) && !jsonObj.get("qq_captcha_randstr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_randstr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_randstr").toString())); + } + if ((jsonObj.get("h-captcha-response") != null && !jsonObj.get("h-captcha-response").isJsonNull()) && !jsonObj.get("h-captcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `h-captcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("h-captcha-response").toString())); + } + if ((jsonObj.get("WelcomeEmailTemplate") != null && !jsonObj.get("WelcomeEmailTemplate").isJsonNull()) && !jsonObj.get("WelcomeEmailTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `WelcomeEmailTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("WelcomeEmailTemplate").toString())); + } + if (!jsonObj.get("Otp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Otp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Otp").toString())); + } + if (!jsonObj.get("UserName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UserName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UserName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PasswordLessUserNameOTPModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasswordLessUserNameOTPModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PasswordLessUserNameOTPModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasswordLessUserNameOTPModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<PasswordLessUserNameOTPModel>() { + @Override + public void write(JsonWriter out, PasswordLessUserNameOTPModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PasswordLessUserNameOTPModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasswordLessUserNameOTPModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasswordLessUserNameOTPModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasswordLessUserNameOTPModel + * @throws IOException if the JSON string is invalid with respect to PasswordLessUserNameOTPModel + */ + public static PasswordLessUserNameOTPModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasswordLessUserNameOTPModel.class); + } + + /** + * Convert an instance of PasswordLessUserNameOTPModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordLessUserNameOTPModelCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordLessUserNameOTPModelCore.java new file mode 100644 index 0000000..57ca271 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordLessUserNameOTPModelCore.java @@ -0,0 +1,405 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * PasswordLessUserNameOTPModelCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PasswordLessUserNameOTPModelCore { + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer; + + public static final String SERIALIZED_NAME_WELCOME_EMAIL_TEMPLATE = "WelcomeEmailTemplate"; + @SerializedName(SERIALIZED_NAME_WELCOME_EMAIL_TEMPLATE) + @javax.annotation.Nullable + private String welcomeEmailTemplate; + + public static final String SERIALIZED_NAME_OTP = "Otp"; + @SerializedName(SERIALIZED_NAME_OTP) + @javax.annotation.Nonnull + private String otp; + + public static final String SERIALIZED_NAME_USER_NAME = "UserName"; + @SerializedName(SERIALIZED_NAME_USER_NAME) + @javax.annotation.Nonnull + private String userName; + + public PasswordLessUserNameOTPModelCore() { + } + + public PasswordLessUserNameOTPModelCore securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public PasswordLessUserNameOTPModelCore putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * The security answers which is set for the User, this will be used when the User is blocked for the security question. + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + + public PasswordLessUserNameOTPModelCore welcomeEmailTemplate(@javax.annotation.Nullable String welcomeEmailTemplate) { + this.welcomeEmailTemplate = welcomeEmailTemplate; + return this; + } + + /** + * The template for the welcome Email. + * @return welcomeEmailTemplate + */ + @javax.annotation.Nullable + public String getWelcomeEmailTemplate() { + return welcomeEmailTemplate; + } + + public void setWelcomeEmailTemplate(@javax.annotation.Nullable String welcomeEmailTemplate) { + this.welcomeEmailTemplate = welcomeEmailTemplate; + } + + + public PasswordLessUserNameOTPModelCore otp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + return this; + } + + /** + * The one-time Password (OTP) for verification. + * @return otp + */ + @javax.annotation.Nonnull + public String getOtp() { + return otp; + } + + public void setOtp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + } + + + public PasswordLessUserNameOTPModelCore userName(@javax.annotation.Nonnull String userName) { + this.userName = userName; + return this; + } + + /** + * The Username associated with the Account. + * @return userName + */ + @javax.annotation.Nonnull + public String getUserName() { + return userName; + } + + public void setUserName(@javax.annotation.Nonnull String userName) { + this.userName = userName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasswordLessUserNameOTPModelCore instance itself + */ + public PasswordLessUserNameOTPModelCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasswordLessUserNameOTPModelCore passwordLessUserNameOTPModelCore = (PasswordLessUserNameOTPModelCore) o; + return Objects.equals(this.securityAnswer, passwordLessUserNameOTPModelCore.securityAnswer) && + Objects.equals(this.welcomeEmailTemplate, passwordLessUserNameOTPModelCore.welcomeEmailTemplate) && + Objects.equals(this.otp, passwordLessUserNameOTPModelCore.otp) && + Objects.equals(this.userName, passwordLessUserNameOTPModelCore.userName)&& + Objects.equals(this.additionalProperties, passwordLessUserNameOTPModelCore.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(securityAnswer, welcomeEmailTemplate, otp, userName, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasswordLessUserNameOTPModelCore {\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" welcomeEmailTemplate: ").append(toIndentedString(welcomeEmailTemplate)).append("\n"); + sb.append(" otp: ").append(toIndentedString(otp)).append("\n"); + sb.append(" userName: ").append(toIndentedString(userName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("SecurityAnswer"); + openapiFields.add("WelcomeEmailTemplate"); + openapiFields.add("Otp"); + openapiFields.add("UserName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Otp"); + openapiRequiredFields.add("UserName"); + } + + /** + * 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 PasswordLessUserNameOTPModelCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasswordLessUserNameOTPModelCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasswordLessUserNameOTPModelCore is not found in the empty JSON string", PasswordLessUserNameOTPModelCore.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasswordLessUserNameOTPModelCore.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("WelcomeEmailTemplate") != null && !jsonObj.get("WelcomeEmailTemplate").isJsonNull()) && !jsonObj.get("WelcomeEmailTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `WelcomeEmailTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("WelcomeEmailTemplate").toString())); + } + if (!jsonObj.get("Otp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Otp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Otp").toString())); + } + if (!jsonObj.get("UserName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UserName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UserName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PasswordLessUserNameOTPModelCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasswordLessUserNameOTPModelCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PasswordLessUserNameOTPModelCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasswordLessUserNameOTPModelCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<PasswordLessUserNameOTPModelCore>() { + @Override + public void write(JsonWriter out, PasswordLessUserNameOTPModelCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PasswordLessUserNameOTPModelCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasswordLessUserNameOTPModelCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasswordLessUserNameOTPModelCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasswordLessUserNameOTPModelCore + * @throws IOException if the JSON string is invalid with respect to PasswordLessUserNameOTPModelCore + */ + public static PasswordLessUserNameOTPModelCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasswordLessUserNameOTPModelCore.class); + } + + /** + * Convert an instance of PasswordLessUserNameOTPModelCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordModel.java new file mode 100644 index 0000000..22e7eee --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordModel.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * PasswordModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PasswordModel { + public static final String SERIALIZED_NAME_PASSWORD = "Password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nonnull + private String password; + + public PasswordModel() { + } + + public PasswordModel password(@javax.annotation.Nonnull String password) { + this.password = password; + return this; + } + + /** + * The new Password to be set for the Account. + * @return password + */ + @javax.annotation.Nonnull + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nonnull String password) { + this.password = password; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasswordModel instance itself + */ + public PasswordModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasswordModel passwordModel = (PasswordModel) o; + return Objects.equals(this.password, passwordModel.password)&& + Objects.equals(this.additionalProperties, passwordModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(password, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasswordModel {\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Password"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Password"); + } + + /** + * 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 PasswordModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasswordModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasswordModel is not found in the empty JSON string", PasswordModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PasswordModel.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("Password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Password").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PasswordModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasswordModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PasswordModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasswordModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<PasswordModel>() { + @Override + public void write(JsonWriter out, PasswordModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PasswordModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasswordModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasswordModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasswordModel + * @throws IOException if the JSON string is invalid with respect to PasswordModel + */ + public static PasswordModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasswordModel.class); + } + + /** + * Convert an instance of PasswordModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordPolicy.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordPolicy.java new file mode 100644 index 0000000..70a2f8e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordPolicy.java @@ -0,0 +1,549 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * PasswordPolicy + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PasswordPolicy { + public static final String SERIALIZED_NAME_DICTIONARY_PASSWORD_VALIDATION = "DictionaryPasswordValidation"; + @SerializedName(SERIALIZED_NAME_DICTIONARY_PASSWORD_VALIDATION) + @javax.annotation.Nullable + private Boolean dictionaryPasswordValidation; + + public static final String SERIALIZED_NAME_PROFILE_DATA_PASSWORD_VALIDATION = "ProfileDataPasswordValidation"; + @SerializedName(SERIALIZED_NAME_PROFILE_DATA_PASSWORD_VALIDATION) + @javax.annotation.Nullable + private Boolean profileDataPasswordValidation; + + public static final String SERIALIZED_NAME_PROFILE_DATA_PASSWORD_EXACT_MATCH = "ProfileDataPasswordExactMatch"; + @SerializedName(SERIALIZED_NAME_PROFILE_DATA_PASSWORD_EXACT_MATCH) + @javax.annotation.Nullable + private Boolean profileDataPasswordExactMatch; + + public static final String SERIALIZED_NAME_COMMON_PASSWORD_PREVENTION_VALIDATION = "CommonPasswordPreventionValidation"; + @SerializedName(SERIALIZED_NAME_COMMON_PASSWORD_PREVENTION_VALIDATION) + @javax.annotation.Nullable + private Boolean commonPasswordPreventionValidation; + + public static final String SERIALIZED_NAME_MAX_PASSWORD_HISTORY = "MaxPasswordHistory"; + @SerializedName(SERIALIZED_NAME_MAX_PASSWORD_HISTORY) + @javax.annotation.Nullable + private Integer maxPasswordHistory; + + public static final String SERIALIZED_NAME_EXPIRATION_FREQUENCY = "ExpirationFrequency"; + @SerializedName(SERIALIZED_NAME_EXPIRATION_FREQUENCY) + @javax.annotation.Nullable + private Integer expirationFrequency; + + /** + * Gets or Sets expirationFrequencyType + */ + @JsonAdapter(ExpirationFrequencyTypeEnum.Adapter.class) + public enum ExpirationFrequencyTypeEnum { + DAY("day"), + + MONTH("month"), + + YEAR("year"); + + private String value; + + ExpirationFrequencyTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ExpirationFrequencyTypeEnum fromValue(String value) { + for (ExpirationFrequencyTypeEnum b : ExpirationFrequencyTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter<ExpirationFrequencyTypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final ExpirationFrequencyTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ExpirationFrequencyTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ExpirationFrequencyTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ExpirationFrequencyTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_EXPIRATION_FREQUENCY_TYPE = "ExpirationFrequencyType"; + @SerializedName(SERIALIZED_NAME_EXPIRATION_FREQUENCY_TYPE) + @javax.annotation.Nullable + private ExpirationFrequencyTypeEnum expirationFrequencyType; + + public static final String SERIALIZED_NAME_PASSWORD_VALIDATION_RULES = "PasswordValidationRules"; + @SerializedName(SERIALIZED_NAME_PASSWORD_VALIDATION_RULES) + @javax.annotation.Nullable + private String passwordValidationRules; + + public PasswordPolicy() { + } + + public PasswordPolicy dictionaryPasswordValidation(@javax.annotation.Nullable Boolean dictionaryPasswordValidation) { + this.dictionaryPasswordValidation = dictionaryPasswordValidation; + return this; + } + + /** + * Get dictionaryPasswordValidation + * @return dictionaryPasswordValidation + */ + @javax.annotation.Nullable + public Boolean getDictionaryPasswordValidation() { + return dictionaryPasswordValidation; + } + + public void setDictionaryPasswordValidation(@javax.annotation.Nullable Boolean dictionaryPasswordValidation) { + this.dictionaryPasswordValidation = dictionaryPasswordValidation; + } + + + public PasswordPolicy profileDataPasswordValidation(@javax.annotation.Nullable Boolean profileDataPasswordValidation) { + this.profileDataPasswordValidation = profileDataPasswordValidation; + return this; + } + + /** + * Get profileDataPasswordValidation + * @return profileDataPasswordValidation + */ + @javax.annotation.Nullable + public Boolean getProfileDataPasswordValidation() { + return profileDataPasswordValidation; + } + + public void setProfileDataPasswordValidation(@javax.annotation.Nullable Boolean profileDataPasswordValidation) { + this.profileDataPasswordValidation = profileDataPasswordValidation; + } + + + public PasswordPolicy profileDataPasswordExactMatch(@javax.annotation.Nullable Boolean profileDataPasswordExactMatch) { + this.profileDataPasswordExactMatch = profileDataPasswordExactMatch; + return this; + } + + /** + * Get profileDataPasswordExactMatch + * @return profileDataPasswordExactMatch + */ + @javax.annotation.Nullable + public Boolean getProfileDataPasswordExactMatch() { + return profileDataPasswordExactMatch; + } + + public void setProfileDataPasswordExactMatch(@javax.annotation.Nullable Boolean profileDataPasswordExactMatch) { + this.profileDataPasswordExactMatch = profileDataPasswordExactMatch; + } + + + public PasswordPolicy commonPasswordPreventionValidation(@javax.annotation.Nullable Boolean commonPasswordPreventionValidation) { + this.commonPasswordPreventionValidation = commonPasswordPreventionValidation; + return this; + } + + /** + * Get commonPasswordPreventionValidation + * @return commonPasswordPreventionValidation + */ + @javax.annotation.Nullable + public Boolean getCommonPasswordPreventionValidation() { + return commonPasswordPreventionValidation; + } + + public void setCommonPasswordPreventionValidation(@javax.annotation.Nullable Boolean commonPasswordPreventionValidation) { + this.commonPasswordPreventionValidation = commonPasswordPreventionValidation; + } + + + public PasswordPolicy maxPasswordHistory(@javax.annotation.Nullable Integer maxPasswordHistory) { + this.maxPasswordHistory = maxPasswordHistory; + return this; + } + + /** + * Get maxPasswordHistory + * @return maxPasswordHistory + */ + @javax.annotation.Nullable + public Integer getMaxPasswordHistory() { + return maxPasswordHistory; + } + + public void setMaxPasswordHistory(@javax.annotation.Nullable Integer maxPasswordHistory) { + this.maxPasswordHistory = maxPasswordHistory; + } + + + public PasswordPolicy expirationFrequency(@javax.annotation.Nullable Integer expirationFrequency) { + this.expirationFrequency = expirationFrequency; + return this; + } + + /** + * Get expirationFrequency + * @return expirationFrequency + */ + @javax.annotation.Nullable + public Integer getExpirationFrequency() { + return expirationFrequency; + } + + public void setExpirationFrequency(@javax.annotation.Nullable Integer expirationFrequency) { + this.expirationFrequency = expirationFrequency; + } + + + public PasswordPolicy expirationFrequencyType(@javax.annotation.Nullable ExpirationFrequencyTypeEnum expirationFrequencyType) { + this.expirationFrequencyType = expirationFrequencyType; + return this; + } + + /** + * Get expirationFrequencyType + * @return expirationFrequencyType + */ + @javax.annotation.Nullable + public ExpirationFrequencyTypeEnum getExpirationFrequencyType() { + return expirationFrequencyType; + } + + public void setExpirationFrequencyType(@javax.annotation.Nullable ExpirationFrequencyTypeEnum expirationFrequencyType) { + this.expirationFrequencyType = expirationFrequencyType; + } + + + public PasswordPolicy passwordValidationRules(@javax.annotation.Nullable String passwordValidationRules) { + this.passwordValidationRules = passwordValidationRules; + return this; + } + + /** + * Get passwordValidationRules + * @return passwordValidationRules + */ + @javax.annotation.Nullable + public String getPasswordValidationRules() { + return passwordValidationRules; + } + + public void setPasswordValidationRules(@javax.annotation.Nullable String passwordValidationRules) { + this.passwordValidationRules = passwordValidationRules; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasswordPolicy instance itself + */ + public PasswordPolicy putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasswordPolicy passwordPolicy = (PasswordPolicy) o; + return Objects.equals(this.dictionaryPasswordValidation, passwordPolicy.dictionaryPasswordValidation) && + Objects.equals(this.profileDataPasswordValidation, passwordPolicy.profileDataPasswordValidation) && + Objects.equals(this.profileDataPasswordExactMatch, passwordPolicy.profileDataPasswordExactMatch) && + Objects.equals(this.commonPasswordPreventionValidation, passwordPolicy.commonPasswordPreventionValidation) && + Objects.equals(this.maxPasswordHistory, passwordPolicy.maxPasswordHistory) && + Objects.equals(this.expirationFrequency, passwordPolicy.expirationFrequency) && + Objects.equals(this.expirationFrequencyType, passwordPolicy.expirationFrequencyType) && + Objects.equals(this.passwordValidationRules, passwordPolicy.passwordValidationRules)&& + Objects.equals(this.additionalProperties, passwordPolicy.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(dictionaryPasswordValidation, profileDataPasswordValidation, profileDataPasswordExactMatch, commonPasswordPreventionValidation, maxPasswordHistory, expirationFrequency, expirationFrequencyType, passwordValidationRules, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasswordPolicy {\n"); + sb.append(" dictionaryPasswordValidation: ").append(toIndentedString(dictionaryPasswordValidation)).append("\n"); + sb.append(" profileDataPasswordValidation: ").append(toIndentedString(profileDataPasswordValidation)).append("\n"); + sb.append(" profileDataPasswordExactMatch: ").append(toIndentedString(profileDataPasswordExactMatch)).append("\n"); + sb.append(" commonPasswordPreventionValidation: ").append(toIndentedString(commonPasswordPreventionValidation)).append("\n"); + sb.append(" maxPasswordHistory: ").append(toIndentedString(maxPasswordHistory)).append("\n"); + sb.append(" expirationFrequency: ").append(toIndentedString(expirationFrequency)).append("\n"); + sb.append(" expirationFrequencyType: ").append(toIndentedString(expirationFrequencyType)).append("\n"); + sb.append(" passwordValidationRules: ").append(toIndentedString(passwordValidationRules)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("DictionaryPasswordValidation"); + openapiFields.add("ProfileDataPasswordValidation"); + openapiFields.add("ProfileDataPasswordExactMatch"); + openapiFields.add("CommonPasswordPreventionValidation"); + openapiFields.add("MaxPasswordHistory"); + openapiFields.add("ExpirationFrequency"); + openapiFields.add("ExpirationFrequencyType"); + openapiFields.add("PasswordValidationRules"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 PasswordPolicy + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasswordPolicy.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasswordPolicy is not found in the empty JSON string", PasswordPolicy.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ExpirationFrequencyType") != null && !jsonObj.get("ExpirationFrequencyType").isJsonNull()) && !jsonObj.get("ExpirationFrequencyType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ExpirationFrequencyType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ExpirationFrequencyType").toString())); + } + // validate the optional field `ExpirationFrequencyType` + if (jsonObj.get("ExpirationFrequencyType") != null && !jsonObj.get("ExpirationFrequencyType").isJsonNull()) { + ExpirationFrequencyTypeEnum.validateJsonElement(jsonObj.get("ExpirationFrequencyType")); + } + if ((jsonObj.get("PasswordValidationRules") != null && !jsonObj.get("PasswordValidationRules").isJsonNull()) && !jsonObj.get("PasswordValidationRules").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PasswordValidationRules` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PasswordValidationRules").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PasswordPolicy.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasswordPolicy' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PasswordPolicy> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasswordPolicy.class)); + + return (TypeAdapter<T>) new TypeAdapter<PasswordPolicy>() { + @Override + public void write(JsonWriter out, PasswordPolicy value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PasswordPolicy read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasswordPolicy instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasswordPolicy given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasswordPolicy + * @throws IOException if the JSON string is invalid with respect to PasswordPolicy + */ + public static PasswordPolicy fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasswordPolicy.class); + } + + /** + * Convert an instance of PasswordPolicy to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordReauthRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordReauthRequest.java new file mode 100644 index 0000000..de6a987 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordReauthRequest.java @@ -0,0 +1,456 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * PasswordReauthRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PasswordReauthRequest { + public static final String SERIALIZED_NAME_G_RECAPTCHA_RESPONSE = "g-recaptcha-response"; + @SerializedName(SERIALIZED_NAME_G_RECAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String gRecaptchaResponse; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_TICKET = "qq_captcha_ticket"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_TICKET) + @javax.annotation.Nullable + private String qqCaptchaTicket; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR = "qq_captcha_randstr"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR) + @javax.annotation.Nullable + private String qqCaptchaRandstr; + + public static final String SERIALIZED_NAME_H_CAPTCHA_RESPONSE = "h-captcha-response"; + @SerializedName(SERIALIZED_NAME_H_CAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String hCaptchaResponse; + + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer; + + public static final String SERIALIZED_NAME_PASSWORD = "Password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nullable + private String password; + + public PasswordReauthRequest() { + } + + public PasswordReauthRequest gRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + return this; + } + + /** + * The Google reCAPTCHA response which is sent to the server for verification. + * @return gRecaptchaResponse + */ + @javax.annotation.Nullable + public String getgRecaptchaResponse() { + return gRecaptchaResponse; + } + + public void setgRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + } + + + public PasswordReauthRequest qqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + return this; + } + + /** + * The QQ Captcha ticket which is sent to the server for verification. + * @return qqCaptchaTicket + */ + @javax.annotation.Nullable + public String getQqCaptchaTicket() { + return qqCaptchaTicket; + } + + public void setQqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + } + + + public PasswordReauthRequest qqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + return this; + } + + /** + * The QQ Captcha random string which is sent to the server for verification. + * @return qqCaptchaRandstr + */ + @javax.annotation.Nullable + public String getQqCaptchaRandstr() { + return qqCaptchaRandstr; + } + + public void setQqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + } + + + public PasswordReauthRequest hCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + return this; + } + + /** + * The hCaptcha response which is sent to the server for verification. + * @return hCaptchaResponse + */ + @javax.annotation.Nullable + public String gethCaptchaResponse() { + return hCaptchaResponse; + } + + public void sethCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + } + + + public PasswordReauthRequest securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public PasswordReauthRequest putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * The security answers which is set for the User, this will be used when the User is blocked for the security question. + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + + public PasswordReauthRequest password(@javax.annotation.Nullable String password) { + this.password = password; + return this; + } + + /** + * The Password of the User + * @return password + */ + @javax.annotation.Nullable + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nullable String password) { + this.password = password; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasswordReauthRequest instance itself + */ + public PasswordReauthRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasswordReauthRequest passwordReauthRequest = (PasswordReauthRequest) o; + return Objects.equals(this.gRecaptchaResponse, passwordReauthRequest.gRecaptchaResponse) && + Objects.equals(this.qqCaptchaTicket, passwordReauthRequest.qqCaptchaTicket) && + Objects.equals(this.qqCaptchaRandstr, passwordReauthRequest.qqCaptchaRandstr) && + Objects.equals(this.hCaptchaResponse, passwordReauthRequest.hCaptchaResponse) && + Objects.equals(this.securityAnswer, passwordReauthRequest.securityAnswer) && + Objects.equals(this.password, passwordReauthRequest.password)&& + Objects.equals(this.additionalProperties, passwordReauthRequest.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, securityAnswer, password, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasswordReauthRequest {\n"); + sb.append(" gRecaptchaResponse: ").append(toIndentedString(gRecaptchaResponse)).append("\n"); + sb.append(" qqCaptchaTicket: ").append(toIndentedString(qqCaptchaTicket)).append("\n"); + sb.append(" qqCaptchaRandstr: ").append(toIndentedString(qqCaptchaRandstr)).append("\n"); + sb.append(" hCaptchaResponse: ").append(toIndentedString(hCaptchaResponse)).append("\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("g-recaptcha-response"); + openapiFields.add("qq_captcha_ticket"); + openapiFields.add("qq_captcha_randstr"); + openapiFields.add("h-captcha-response"); + openapiFields.add("SecurityAnswer"); + openapiFields.add("Password"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 PasswordReauthRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasswordReauthRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasswordReauthRequest is not found in the empty JSON string", PasswordReauthRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("g-recaptcha-response") != null && !jsonObj.get("g-recaptcha-response").isJsonNull()) && !jsonObj.get("g-recaptcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `g-recaptcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("g-recaptcha-response").toString())); + } + if ((jsonObj.get("qq_captcha_ticket") != null && !jsonObj.get("qq_captcha_ticket").isJsonNull()) && !jsonObj.get("qq_captcha_ticket").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_ticket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_ticket").toString())); + } + if ((jsonObj.get("qq_captcha_randstr") != null && !jsonObj.get("qq_captcha_randstr").isJsonNull()) && !jsonObj.get("qq_captcha_randstr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_randstr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_randstr").toString())); + } + if ((jsonObj.get("h-captcha-response") != null && !jsonObj.get("h-captcha-response").isJsonNull()) && !jsonObj.get("h-captcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `h-captcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("h-captcha-response").toString())); + } + if ((jsonObj.get("Password") != null && !jsonObj.get("Password").isJsonNull()) && !jsonObj.get("Password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Password").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PasswordReauthRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasswordReauthRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PasswordReauthRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasswordReauthRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<PasswordReauthRequest>() { + @Override + public void write(JsonWriter out, PasswordReauthRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PasswordReauthRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasswordReauthRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasswordReauthRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasswordReauthRequest + * @throws IOException if the JSON string is invalid with respect to PasswordReauthRequest + */ + public static PasswordReauthRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasswordReauthRequest.class); + } + + /** + * Convert an instance of PasswordReauthRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordReauthRequestCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordReauthRequestCore.java new file mode 100644 index 0000000..b298327 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordReauthRequestCore.java @@ -0,0 +1,336 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * PasswordReauthRequestCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PasswordReauthRequestCore { + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer; + + public static final String SERIALIZED_NAME_PASSWORD = "Password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nullable + private String password; + + public PasswordReauthRequestCore() { + } + + public PasswordReauthRequestCore securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public PasswordReauthRequestCore putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * The security answers which is set for the User, this will be used when the User is blocked for the security question. + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + + public PasswordReauthRequestCore password(@javax.annotation.Nullable String password) { + this.password = password; + return this; + } + + /** + * The Password of the User + * @return password + */ + @javax.annotation.Nullable + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nullable String password) { + this.password = password; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasswordReauthRequestCore instance itself + */ + public PasswordReauthRequestCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasswordReauthRequestCore passwordReauthRequestCore = (PasswordReauthRequestCore) o; + return Objects.equals(this.securityAnswer, passwordReauthRequestCore.securityAnswer) && + Objects.equals(this.password, passwordReauthRequestCore.password)&& + Objects.equals(this.additionalProperties, passwordReauthRequestCore.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(securityAnswer, password, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasswordReauthRequestCore {\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("SecurityAnswer"); + openapiFields.add("Password"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 PasswordReauthRequestCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasswordReauthRequestCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasswordReauthRequestCore is not found in the empty JSON string", PasswordReauthRequestCore.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Password") != null && !jsonObj.get("Password").isJsonNull()) && !jsonObj.get("Password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Password").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PasswordReauthRequestCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasswordReauthRequestCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PasswordReauthRequestCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasswordReauthRequestCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<PasswordReauthRequestCore>() { + @Override + public void write(JsonWriter out, PasswordReauthRequestCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PasswordReauthRequestCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasswordReauthRequestCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasswordReauthRequestCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasswordReauthRequestCore + * @throws IOException if the JSON string is invalid with respect to PasswordReauthRequestCore + */ + public static PasswordReauthRequestCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasswordReauthRequestCore.class); + } + + /** + * Convert an instance of PasswordReauthRequestCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordResponse.java new file mode 100644 index 0000000..3584c05 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordResponse.java @@ -0,0 +1,299 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * PasswordResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PasswordResponse { + public static final String SERIALIZED_NAME_PASSWORD_HASH = "PasswordHash"; + @SerializedName(SERIALIZED_NAME_PASSWORD_HASH) + @javax.annotation.Nullable + private String passwordHash; + + public PasswordResponse() { + } + + public PasswordResponse passwordHash(@javax.annotation.Nullable String passwordHash) { + this.passwordHash = passwordHash; + return this; + } + + /** + * The hashed Password of the User account. + * @return passwordHash + */ + @javax.annotation.Nullable + public String getPasswordHash() { + return passwordHash; + } + + public void setPasswordHash(@javax.annotation.Nullable String passwordHash) { + this.passwordHash = passwordHash; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PasswordResponse instance itself + */ + public PasswordResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PasswordResponse passwordResponse = (PasswordResponse) o; + return Objects.equals(this.passwordHash, passwordResponse.passwordHash)&& + Objects.equals(this.additionalProperties, passwordResponse.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(passwordHash, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PasswordResponse {\n"); + sb.append(" passwordHash: ").append(toIndentedString(passwordHash)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("PasswordHash"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 PasswordResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PasswordResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PasswordResponse is not found in the empty JSON string", PasswordResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("PasswordHash") != null && !jsonObj.get("PasswordHash").isJsonNull()) && !jsonObj.get("PasswordHash").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PasswordHash` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PasswordHash").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PasswordResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasswordResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PasswordResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PasswordResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<PasswordResponse>() { + @Override + public void write(JsonWriter out, PasswordResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PasswordResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PasswordResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PasswordResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasswordResponse + * @throws IOException if the JSON string is invalid with respect to PasswordResponse + */ + public static PasswordResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasswordResponse.class); + } + + /** + * Convert an instance of PasswordResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordlessEmailVerification200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordlessEmailVerification200Response.java new file mode 100644 index 0000000..71328c1 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PasswordlessEmailVerification200Response.java @@ -0,0 +1,283 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.AuthResponseOptionalMfa; +import com.loginradius.sdk.internal.openapi.model.AuthResponseRequiredMfa; +import com.loginradius.sdk.internal.openapi.model.EmailOTPStatus; +import com.loginradius.sdk.internal.openapi.model.Profile; +import com.loginradius.sdk.internal.openapi.model.SMSResponseData; +import com.loginradius.sdk.internal.openapi.model.SecurityQuestions; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PasswordlessEmailVerification200Response extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(PasswordlessEmailVerification200Response.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PasswordlessEmailVerification200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PasswordlessEmailVerification200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<AuthResponseRequiredMfa> adapterAuthResponseRequiredMfa = gson.getDelegateAdapter(this, TypeToken.get(AuthResponseRequiredMfa.class)); + final TypeAdapter<AuthResponseOptionalMfa> adapterAuthResponseOptionalMfa = gson.getDelegateAdapter(this, TypeToken.get(AuthResponseOptionalMfa.class)); + + return (TypeAdapter<T>) new TypeAdapter<PasswordlessEmailVerification200Response>() { + @Override + public void write(JsonWriter out, PasswordlessEmailVerification200Response value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `AuthResponseRequiredMfa` + if (value.getActualInstance() instanceof AuthResponseRequiredMfa) { + JsonElement element = adapterAuthResponseRequiredMfa.toJsonTree((AuthResponseRequiredMfa)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `AuthResponseOptionalMfa` + if (value.getActualInstance() instanceof AuthResponseOptionalMfa) { + JsonElement element = adapterAuthResponseOptionalMfa.toJsonTree((AuthResponseOptionalMfa)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: AuthResponseOptionalMfa, AuthResponseRequiredMfa"); + } + + @Override + public PasswordlessEmailVerification200Response read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize AuthResponseRequiredMfa + try { + // validate the JSON object to see if any exception is thrown + AuthResponseRequiredMfa.validateJsonElement(jsonElement); + actualAdapter = adapterAuthResponseRequiredMfa; + match++; + log.log(Level.FINER, "Input data matches schema 'AuthResponseRequiredMfa'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for AuthResponseRequiredMfa failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'AuthResponseRequiredMfa'", e); + } + // deserialize AuthResponseOptionalMfa + try { + // validate the JSON object to see if any exception is thrown + AuthResponseOptionalMfa.validateJsonElement(jsonElement); + actualAdapter = adapterAuthResponseOptionalMfa; + match++; + log.log(Level.FINER, "Input data matches schema 'AuthResponseOptionalMfa'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for AuthResponseOptionalMfa failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'AuthResponseOptionalMfa'", e); + } + + if (match == 1) { + PasswordlessEmailVerification200Response ret = new PasswordlessEmailVerification200Response(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for PasswordlessEmailVerification200Response: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public PasswordlessEmailVerification200Response() { + super("oneOf", Boolean.FALSE); + } + + public PasswordlessEmailVerification200Response(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("AuthResponseRequiredMfa", AuthResponseRequiredMfa.class); + schemas.put("AuthResponseOptionalMfa", AuthResponseOptionalMfa.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return PasswordlessEmailVerification200Response.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * AuthResponseOptionalMfa, AuthResponseRequiredMfa + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof AuthResponseRequiredMfa) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof AuthResponseOptionalMfa) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be AuthResponseOptionalMfa, AuthResponseRequiredMfa"); + } + + /** + * Get the actual instance, which can be the following: + * AuthResponseOptionalMfa, AuthResponseRequiredMfa + * + * @return The actual instance (AuthResponseOptionalMfa, AuthResponseRequiredMfa) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `AuthResponseRequiredMfa`. If the actual instance is not `AuthResponseRequiredMfa`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AuthResponseRequiredMfa` + * @throws ClassCastException if the instance is not `AuthResponseRequiredMfa` + */ + public AuthResponseRequiredMfa getAuthResponseRequiredMfa() throws ClassCastException { + return (AuthResponseRequiredMfa)super.getActualInstance(); + } + + /** + * Get the actual instance of `AuthResponseOptionalMfa`. If the actual instance is not `AuthResponseOptionalMfa`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AuthResponseOptionalMfa` + * @throws ClassCastException if the instance is not `AuthResponseOptionalMfa` + */ + public AuthResponseOptionalMfa getAuthResponseOptionalMfa() throws ClassCastException { + return (AuthResponseOptionalMfa)super.getActualInstance(); + } + + /** + * 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 PasswordlessEmailVerification200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with AuthResponseRequiredMfa + try { + AuthResponseRequiredMfa.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for AuthResponseRequiredMfa failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with AuthResponseOptionalMfa + try { + AuthResponseOptionalMfa.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for AuthResponseOptionalMfa failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for PasswordlessEmailVerification200Response with oneOf schemas: AuthResponseOptionalMfa, AuthResponseRequiredMfa. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of PasswordlessEmailVerification200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of PasswordlessEmailVerification200Response + * @throws IOException if the JSON string is invalid with respect to PasswordlessEmailVerification200Response + */ + public static PasswordlessEmailVerification200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PasswordlessEmailVerification200Response.class); + } + + /** + * Convert an instance of PasswordlessEmailVerification200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PerfectMindContactResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PerfectMindContactResponse.java new file mode 100644 index 0000000..5c43c95 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PerfectMindContactResponse.java @@ -0,0 +1,328 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.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.loginradius.sdk.internal.openapi.JSON; + +/** + * PerfectMindContactResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PerfectMindContactResponse { + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private String email; + + public static final String SERIALIZED_NAME_CONTACT_ID = "ContactId"; + @SerializedName(SERIALIZED_NAME_CONTACT_ID) + @javax.annotation.Nullable + private List<String> contactId = new ArrayList<>(); + + public PerfectMindContactResponse() { + } + + public PerfectMindContactResponse email(@javax.annotation.Nullable String email) { + this.email = email; + return this; + } + + /** + * Email address associated with the PerfectMind contact. + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable String email) { + this.email = email; + } + + + public PerfectMindContactResponse contactId(@javax.annotation.Nullable List<String> contactId) { + this.contactId = contactId; + return this; + } + + public PerfectMindContactResponse addContactIdItem(String contactIdItem) { + if (this.contactId == null) { + this.contactId = new ArrayList<>(); + } + this.contactId.add(contactIdItem); + return this; + } + + /** + * List of PerfectMind contact IDs matching the email. + * @return contactId + */ + @javax.annotation.Nullable + public List<String> getContactId() { + return contactId; + } + + public void setContactId(@javax.annotation.Nullable List<String> contactId) { + this.contactId = contactId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PerfectMindContactResponse instance itself + */ + public PerfectMindContactResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PerfectMindContactResponse perfectMindContactResponse = (PerfectMindContactResponse) o; + return Objects.equals(this.email, perfectMindContactResponse.email) && + Objects.equals(this.contactId, perfectMindContactResponse.contactId)&& + Objects.equals(this.additionalProperties, perfectMindContactResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, contactId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PerfectMindContactResponse {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" contactId: ").append(toIndentedString(contactId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Email"); + openapiFields.add("ContactId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 PerfectMindContactResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PerfectMindContactResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PerfectMindContactResponse is not found in the empty JSON string", PerfectMindContactResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Email") != null && !jsonObj.get("Email").isJsonNull()) && !jsonObj.get("Email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Email").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("ContactId") != null && !jsonObj.get("ContactId").isJsonNull() && !jsonObj.get("ContactId").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ContactId` to be an array in the JSON string but got `%s`", jsonObj.get("ContactId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PerfectMindContactResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PerfectMindContactResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PerfectMindContactResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PerfectMindContactResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<PerfectMindContactResponse>() { + @Override + public void write(JsonWriter out, PerfectMindContactResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PerfectMindContactResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PerfectMindContactResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PerfectMindContactResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of PerfectMindContactResponse + * @throws IOException if the JSON string is invalid with respect to PerfectMindContactResponse + */ + public static PerfectMindContactResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PerfectMindContactResponse.class); + } + + /** + * Convert an instance of PerfectMindContactResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PerfectMindSessionResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PerfectMindSessionResponse.java new file mode 100644 index 0000000..93ab24a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PerfectMindSessionResponse.java @@ -0,0 +1,344 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * PerfectMindSessionResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PerfectMindSessionResponse { + public static final String SERIALIZED_NAME_SESSION_ID = "SessionId"; + @SerializedName(SERIALIZED_NAME_SESSION_ID) + @javax.annotation.Nullable + private String sessionId; + + public static final String SERIALIZED_NAME_U_R_L = "URL"; + @SerializedName(SERIALIZED_NAME_U_R_L) + @javax.annotation.Nullable + private String URL; + + public static final String SERIALIZED_NAME_IS_NEW_LINK = "IsNewLink"; + @SerializedName(SERIALIZED_NAME_IS_NEW_LINK) + @javax.annotation.Nullable + private Boolean isNewLink; + + public PerfectMindSessionResponse() { + } + + public PerfectMindSessionResponse sessionId(@javax.annotation.Nullable String sessionId) { + this.sessionId = sessionId; + return this; + } + + /** + * PerfectMind session identifier. + * @return sessionId + */ + @javax.annotation.Nullable + public String getSessionId() { + return sessionId; + } + + public void setSessionId(@javax.annotation.Nullable String sessionId) { + this.sessionId = sessionId; + } + + + public PerfectMindSessionResponse URL(@javax.annotation.Nullable String URL) { + this.URL = URL; + return this; + } + + /** + * PerfectMind login URL with the session. + * @return URL + */ + @javax.annotation.Nullable + public String getURL() { + return URL; + } + + public void setURL(@javax.annotation.Nullable String URL) { + this.URL = URL; + } + + + public PerfectMindSessionResponse isNewLink(@javax.annotation.Nullable Boolean isNewLink) { + this.isNewLink = isNewLink; + return this; + } + + /** + * Whether a new session link was generated. + * @return isNewLink + */ + @javax.annotation.Nullable + public Boolean getIsNewLink() { + return isNewLink; + } + + public void setIsNewLink(@javax.annotation.Nullable Boolean isNewLink) { + this.isNewLink = isNewLink; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PerfectMindSessionResponse instance itself + */ + public PerfectMindSessionResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PerfectMindSessionResponse perfectMindSessionResponse = (PerfectMindSessionResponse) o; + return Objects.equals(this.sessionId, perfectMindSessionResponse.sessionId) && + Objects.equals(this.URL, perfectMindSessionResponse.URL) && + Objects.equals(this.isNewLink, perfectMindSessionResponse.isNewLink)&& + Objects.equals(this.additionalProperties, perfectMindSessionResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(sessionId, URL, isNewLink, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PerfectMindSessionResponse {\n"); + sb.append(" sessionId: ").append(toIndentedString(sessionId)).append("\n"); + sb.append(" URL: ").append(toIndentedString(URL)).append("\n"); + sb.append(" isNewLink: ").append(toIndentedString(isNewLink)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("SessionId"); + openapiFields.add("URL"); + openapiFields.add("IsNewLink"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 PerfectMindSessionResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PerfectMindSessionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PerfectMindSessionResponse is not found in the empty JSON string", PerfectMindSessionResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("SessionId") != null && !jsonObj.get("SessionId").isJsonNull()) && !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("URL") != null && !jsonObj.get("URL").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PerfectMindSessionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PerfectMindSessionResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PerfectMindSessionResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PerfectMindSessionResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<PerfectMindSessionResponse>() { + @Override + public void write(JsonWriter out, PerfectMindSessionResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PerfectMindSessionResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PerfectMindSessionResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PerfectMindSessionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of PerfectMindSessionResponse + * @throws IOException if the JSON string is invalid with respect to PerfectMindSessionResponse + */ + public static PerfectMindSessionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PerfectMindSessionResponse.class); + } + + /** + * Convert an instance of PerfectMindSessionResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/Permission.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/Permission.java new file mode 100644 index 0000000..b38db15 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/Permission.java @@ -0,0 +1,407 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * Permission + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class Permission { + public static final String SERIALIZED_NAME_I_D = "ID"; + @SerializedName(SERIALIZED_NAME_I_D) + @javax.annotation.Nullable + private String ID; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "Description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_ORIGINAL_NAME = "OriginalName"; + @SerializedName(SERIALIZED_NAME_ORIGINAL_NAME) + @javax.annotation.Nullable + private String originalName; + + public static final String SERIALIZED_NAME_RESOURCE_ID = "ResourceId"; + @SerializedName(SERIALIZED_NAME_RESOURCE_ID) + @javax.annotation.Nullable + private String resourceId; + + public Permission() { + } + + public Permission ID(@javax.annotation.Nullable String ID) { + this.ID = ID; + return this; + } + + /** + * Permission ID + * @return ID + */ + @javax.annotation.Nullable + public String getID() { + return ID; + } + + public void setID(@javax.annotation.Nullable String ID) { + this.ID = ID; + } + + + public Permission name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Permission Name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public Permission description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Permission Description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public Permission originalName(@javax.annotation.Nullable String originalName) { + this.originalName = originalName; + return this; + } + + /** + * Original (unnormalized) Permission Name + * @return originalName + */ + @javax.annotation.Nullable + public String getOriginalName() { + return originalName; + } + + public void setOriginalName(@javax.annotation.Nullable String originalName) { + this.originalName = originalName; + } + + + public Permission resourceId(@javax.annotation.Nullable String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * The identifier of the Auth Server API resource this permission belongs to. Only present if the permission is associated with a resource. + * @return resourceId + */ + @javax.annotation.Nullable + public String getResourceId() { + return resourceId; + } + + public void setResourceId(@javax.annotation.Nullable String resourceId) { + this.resourceId = resourceId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Permission instance itself + */ + public Permission putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Permission permission = (Permission) o; + return Objects.equals(this.ID, permission.ID) && + Objects.equals(this.name, permission.name) && + Objects.equals(this.description, permission.description) && + Objects.equals(this.originalName, permission.originalName) && + Objects.equals(this.resourceId, permission.resourceId)&& + Objects.equals(this.additionalProperties, permission.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(ID, name, description, originalName, resourceId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Permission {\n"); + sb.append(" ID: ").append(toIndentedString(ID)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" originalName: ").append(toIndentedString(originalName)).append("\n"); + sb.append(" resourceId: ").append(toIndentedString(resourceId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ID"); + openapiFields.add("Name"); + openapiFields.add("Description"); + openapiFields.add("OriginalName"); + openapiFields.add("ResourceId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 Permission + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Permission.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Permission is not found in the empty JSON string", Permission.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Description") != null && !jsonObj.get("Description").isJsonNull()) && !jsonObj.get("Description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Description").toString())); + } + if ((jsonObj.get("OriginalName") != null && !jsonObj.get("OriginalName").isJsonNull()) && !jsonObj.get("OriginalName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `OriginalName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("OriginalName").toString())); + } + if ((jsonObj.get("ResourceId") != null && !jsonObj.get("ResourceId").isJsonNull()) && !jsonObj.get("ResourceId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ResourceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ResourceId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!Permission.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Permission' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<Permission> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Permission.class)); + + return (TypeAdapter<T>) new TypeAdapter<Permission>() { + @Override + public void write(JsonWriter out, Permission value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Permission read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Permission instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Permission given an JSON string + * + * @param jsonString JSON string + * @return An instance of Permission + * @throws IOException if the JSON string is invalid with respect to Permission + */ + public static Permission fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Permission.class); + } + + /** + * Convert an instance of Permission to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PermissionPutRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PermissionPutRequest.java new file mode 100644 index 0000000..2fa46e6 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PermissionPutRequest.java @@ -0,0 +1,356 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * PermissionPutRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PermissionPutRequest { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "Description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nonnull + private String description; + + public static final String SERIALIZED_NAME_RESOURCE_ID = "ResourceId"; + @SerializedName(SERIALIZED_NAME_RESOURCE_ID) + @javax.annotation.Nullable + private String resourceId; + + public PermissionPutRequest() { + } + + public PermissionPutRequest name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The name of the Permission. For non-B2B apps, the name cannot be modified and must match the existing permission name. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public PermissionPutRequest description(@javax.annotation.Nonnull String description) { + this.description = description; + return this; + } + + /** + * The description of the Permission + * @return description + */ + @javax.annotation.Nonnull + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nonnull String description) { + this.description = description; + } + + + public PermissionPutRequest resourceId(@javax.annotation.Nullable String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * The hex ID of the Auth Server API resource to associate this permission with. + * @return resourceId + */ + @javax.annotation.Nullable + public String getResourceId() { + return resourceId; + } + + public void setResourceId(@javax.annotation.Nullable String resourceId) { + this.resourceId = resourceId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PermissionPutRequest instance itself + */ + public PermissionPutRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PermissionPutRequest permissionPutRequest = (PermissionPutRequest) o; + return Objects.equals(this.name, permissionPutRequest.name) && + Objects.equals(this.description, permissionPutRequest.description) && + Objects.equals(this.resourceId, permissionPutRequest.resourceId)&& + Objects.equals(this.additionalProperties, permissionPutRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, resourceId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PermissionPutRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" resourceId: ").append(toIndentedString(resourceId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + openapiFields.add("Description"); + openapiFields.add("ResourceId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Name"); + openapiRequiredFields.add("Description"); + } + + /** + * 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 PermissionPutRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PermissionPutRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PermissionPutRequest is not found in the empty JSON string", PermissionPutRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PermissionPutRequest.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("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("Description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Description").toString())); + } + if ((jsonObj.get("ResourceId") != null && !jsonObj.get("ResourceId").isJsonNull()) && !jsonObj.get("ResourceId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ResourceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ResourceId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PermissionPutRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PermissionPutRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PermissionPutRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PermissionPutRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<PermissionPutRequest>() { + @Override + public void write(JsonWriter out, PermissionPutRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PermissionPutRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PermissionPutRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PermissionPutRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of PermissionPutRequest + * @throws IOException if the JSON string is invalid with respect to PermissionPutRequest + */ + public static PermissionPutRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PermissionPutRequest.class); + } + + /** + * Convert an instance of PermissionPutRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/Permissions.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/Permissions.java new file mode 100644 index 0000000..b98c91a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/Permissions.java @@ -0,0 +1,432 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Permissions + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class Permissions { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "Description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_RESOURCE_ID = "ResourceId"; + @SerializedName(SERIALIZED_NAME_RESOURCE_ID) + @javax.annotation.Nullable + private String resourceId; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public static final String SERIALIZED_NAME_MODIFIED_DATE = "ModifiedDate"; + @SerializedName(SERIALIZED_NAME_MODIFIED_DATE) + @javax.annotation.Nullable + private OffsetDateTime modifiedDate; + + public Permissions() { + } + + public Permissions id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The unique identifier for the Permission + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public Permissions name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the Permission + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public Permissions description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * The description of the Permission + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public Permissions resourceId(@javax.annotation.Nullable String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * The identifier of the Auth Server API resource this permission belongs to. Only present if the permission is associated with a resource. + * @return resourceId + */ + @javax.annotation.Nullable + public String getResourceId() { + return resourceId; + } + + public void setResourceId(@javax.annotation.Nullable String resourceId) { + this.resourceId = resourceId; + } + + + public Permissions createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * The date the Permission was created + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + + public Permissions modifiedDate(@javax.annotation.Nullable OffsetDateTime modifiedDate) { + this.modifiedDate = modifiedDate; + return this; + } + + /** + * The date the Permission was last modified + * @return modifiedDate + */ + @javax.annotation.Nullable + public OffsetDateTime getModifiedDate() { + return modifiedDate; + } + + public void setModifiedDate(@javax.annotation.Nullable OffsetDateTime modifiedDate) { + this.modifiedDate = modifiedDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Permissions instance itself + */ + public Permissions putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Permissions permissions = (Permissions) o; + return Objects.equals(this.id, permissions.id) && + Objects.equals(this.name, permissions.name) && + Objects.equals(this.description, permissions.description) && + Objects.equals(this.resourceId, permissions.resourceId) && + Objects.equals(this.createdDate, permissions.createdDate) && + Objects.equals(this.modifiedDate, permissions.modifiedDate)&& + Objects.equals(this.additionalProperties, permissions.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, description, resourceId, createdDate, modifiedDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Permissions {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" resourceId: ").append(toIndentedString(resourceId)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" modifiedDate: ").append(toIndentedString(modifiedDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Description"); + openapiFields.add("ResourceId"); + openapiFields.add("CreatedDate"); + openapiFields.add("ModifiedDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 Permissions + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Permissions.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Permissions is not found in the empty JSON string", Permissions.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Description") != null && !jsonObj.get("Description").isJsonNull()) && !jsonObj.get("Description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Description").toString())); + } + if ((jsonObj.get("ResourceId") != null && !jsonObj.get("ResourceId").isJsonNull()) && !jsonObj.get("ResourceId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ResourceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ResourceId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!Permissions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Permissions' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<Permissions> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Permissions.class)); + + return (TypeAdapter<T>) new TypeAdapter<Permissions>() { + @Override + public void write(JsonWriter out, Permissions value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Permissions read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Permissions instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Permissions given an JSON string + * + * @param jsonString JSON string + * @return An instance of Permissions + * @throws IOException if the JSON string is invalid with respect to Permissions + */ + public static Permissions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Permissions.class); + } + + /** + * Convert an instance of Permissions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/Permissions200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/Permissions200Response.java new file mode 100644 index 0000000..7bf28d0 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/Permissions200Response.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.Permissions; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Permissions200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class Permissions200Response { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<Permissions> data = new ArrayList<>(); + + public Permissions200Response() { + } + + public Permissions200Response data(@javax.annotation.Nullable List<Permissions> data) { + this.data = data; + return this; + } + + public Permissions200Response addDataItem(Permissions dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<Permissions> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<Permissions> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Permissions200Response instance itself + */ + public Permissions200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Permissions200Response permissions200Response = (Permissions200Response) o; + return Objects.equals(this.data, permissions200Response.data)&& + Objects.equals(this.additionalProperties, permissions200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Permissions200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 Permissions200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Permissions200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Permissions200Response is not found in the empty JSON string", Permissions200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + Permissions.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!Permissions200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Permissions200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<Permissions200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Permissions200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<Permissions200Response>() { + @Override + public void write(JsonWriter out, Permissions200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Permissions200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Permissions200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Permissions200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of Permissions200Response + * @throws IOException if the JSON string is invalid with respect to Permissions200Response + */ + public static Permissions200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Permissions200Response.class); + } + + /** + * Convert an instance of Permissions200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PermissionsPostRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PermissionsPostRequest.java new file mode 100644 index 0000000..d51ce1c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PermissionsPostRequest.java @@ -0,0 +1,355 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * PermissionsPostRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PermissionsPostRequest { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "Description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_RESOURCE_ID = "ResourceId"; + @SerializedName(SERIALIZED_NAME_RESOURCE_ID) + @javax.annotation.Nullable + private String resourceId; + + public PermissionsPostRequest() { + } + + public PermissionsPostRequest name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The name of the Permission + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public PermissionsPostRequest description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * The description of the Permission + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public PermissionsPostRequest resourceId(@javax.annotation.Nullable String resourceId) { + this.resourceId = resourceId; + return this; + } + + /** + * The hex ID of the Auth Server API resource to associate this permission with. + * @return resourceId + */ + @javax.annotation.Nullable + public String getResourceId() { + return resourceId; + } + + public void setResourceId(@javax.annotation.Nullable String resourceId) { + this.resourceId = resourceId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PermissionsPostRequest instance itself + */ + public PermissionsPostRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PermissionsPostRequest permissionsPostRequest = (PermissionsPostRequest) o; + return Objects.equals(this.name, permissionsPostRequest.name) && + Objects.equals(this.description, permissionsPostRequest.description) && + Objects.equals(this.resourceId, permissionsPostRequest.resourceId)&& + Objects.equals(this.additionalProperties, permissionsPostRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, resourceId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PermissionsPostRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" resourceId: ").append(toIndentedString(resourceId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + openapiFields.add("Description"); + openapiFields.add("ResourceId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Name"); + } + + /** + * 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 PermissionsPostRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PermissionsPostRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PermissionsPostRequest is not found in the empty JSON string", PermissionsPostRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PermissionsPostRequest.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("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("Description") != null && !jsonObj.get("Description").isJsonNull()) && !jsonObj.get("Description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Description").toString())); + } + if ((jsonObj.get("ResourceId") != null && !jsonObj.get("ResourceId").isJsonNull()) && !jsonObj.get("ResourceId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ResourceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ResourceId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PermissionsPostRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PermissionsPostRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PermissionsPostRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PermissionsPostRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<PermissionsPostRequest>() { + @Override + public void write(JsonWriter out, PermissionsPostRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PermissionsPostRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PermissionsPostRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PermissionsPostRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of PermissionsPostRequest + * @throws IOException if the JSON string is invalid with respect to PermissionsPostRequest + */ + public static PermissionsPostRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PermissionsPostRequest.class); + } + + /** + * Convert an instance of PermissionsPostRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PhoneIdModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PhoneIdModel.java new file mode 100644 index 0000000..815fdab --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PhoneIdModel.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * This model is used in changing the Phone number. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PhoneIdModel { + public static final String SERIALIZED_NAME_PHONE = "phone"; + @SerializedName(SERIALIZED_NAME_PHONE) + @javax.annotation.Nonnull + private String phone; + + public PhoneIdModel() { + } + + public PhoneIdModel phone(@javax.annotation.Nonnull String phone) { + this.phone = phone; + return this; + } + + /** + * The Phone number of the User. + * @return phone + */ + @javax.annotation.Nonnull + public String getPhone() { + return phone; + } + + public void setPhone(@javax.annotation.Nonnull String phone) { + this.phone = phone; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PhoneIdModel instance itself + */ + public PhoneIdModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PhoneIdModel phoneIdModel = (PhoneIdModel) o; + return Objects.equals(this.phone, phoneIdModel.phone)&& + Objects.equals(this.additionalProperties, phoneIdModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(phone, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PhoneIdModel {\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("phone"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("phone"); + } + + /** + * 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 PhoneIdModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PhoneIdModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PhoneIdModel is not found in the empty JSON string", PhoneIdModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PhoneIdModel.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("phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phone").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PhoneIdModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PhoneIdModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PhoneIdModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PhoneIdModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<PhoneIdModel>() { + @Override + public void write(JsonWriter out, PhoneIdModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PhoneIdModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PhoneIdModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PhoneIdModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of PhoneIdModel + * @throws IOException if the JSON string is invalid with respect to PhoneIdModel + */ + public static PhoneIdModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PhoneIdModel.class); + } + + /** + * Convert an instance of PhoneIdModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PhoneIdModelOptional.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PhoneIdModelOptional.java new file mode 100644 index 0000000..ab73c86 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PhoneIdModelOptional.java @@ -0,0 +1,287 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * This model is used while resending the OTP to Phone number. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PhoneIdModelOptional { + public static final String SERIALIZED_NAME_PHONE = "phone"; + @SerializedName(SERIALIZED_NAME_PHONE) + @javax.annotation.Nullable + private String phone; + + public PhoneIdModelOptional() { + } + + public PhoneIdModelOptional phone(@javax.annotation.Nullable String phone) { + this.phone = phone; + return this; + } + + /** + * The Phone number of the User. + * @return phone + */ + @javax.annotation.Nullable + public String getPhone() { + return phone; + } + + public void setPhone(@javax.annotation.Nullable String phone) { + this.phone = phone; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PhoneIdModelOptional instance itself + */ + public PhoneIdModelOptional putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PhoneIdModelOptional phoneIdModelOptional = (PhoneIdModelOptional) o; + return Objects.equals(this.phone, phoneIdModelOptional.phone)&& + Objects.equals(this.additionalProperties, phoneIdModelOptional.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(phone, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PhoneIdModelOptional {\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("phone"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 PhoneIdModelOptional + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PhoneIdModelOptional.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PhoneIdModelOptional is not found in the empty JSON string", PhoneIdModelOptional.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("phone") != null && !jsonObj.get("phone").isJsonNull()) && !jsonObj.get("phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phone").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PhoneIdModelOptional.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PhoneIdModelOptional' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PhoneIdModelOptional> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PhoneIdModelOptional.class)); + + return (TypeAdapter<T>) new TypeAdapter<PhoneIdModelOptional>() { + @Override + public void write(JsonWriter out, PhoneIdModelOptional value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PhoneIdModelOptional read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PhoneIdModelOptional instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PhoneIdModelOptional given an JSON string + * + * @param jsonString JSON string + * @return An instance of PhoneIdModelOptional + * @throws IOException if the JSON string is invalid with respect to PhoneIdModelOptional + */ + public static PhoneIdModelOptional fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PhoneIdModelOptional.class); + } + + /** + * Convert an instance of PhoneIdModelOptional to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PhoneModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PhoneModel.java new file mode 100644 index 0000000..9322a28 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PhoneModel.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * PhoneModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PhoneModel { + public static final String SERIALIZED_NAME_PHONE = "phone"; + @SerializedName(SERIALIZED_NAME_PHONE) + @javax.annotation.Nonnull + private String phone; + + public PhoneModel() { + } + + public PhoneModel phone(@javax.annotation.Nonnull String phone) { + this.phone = phone; + return this; + } + + /** + * The Phone number to be updated. + * @return phone + */ + @javax.annotation.Nonnull + public String getPhone() { + return phone; + } + + public void setPhone(@javax.annotation.Nonnull String phone) { + this.phone = phone; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PhoneModel instance itself + */ + public PhoneModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PhoneModel phoneModel = (PhoneModel) o; + return Objects.equals(this.phone, phoneModel.phone)&& + Objects.equals(this.additionalProperties, phoneModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(phone, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PhoneModel {\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("phone"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("phone"); + } + + /** + * 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 PhoneModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PhoneModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PhoneModel is not found in the empty JSON string", PhoneModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PhoneModel.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("phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phone").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PhoneModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PhoneModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PhoneModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PhoneModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<PhoneModel>() { + @Override + public void write(JsonWriter out, PhoneModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PhoneModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PhoneModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PhoneModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of PhoneModel + * @throws IOException if the JSON string is invalid with respect to PhoneModel + */ + public static PhoneModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PhoneModel.class); + } + + /** + * Convert an instance of PhoneModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PhoneOTPModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PhoneOTPModel.java new file mode 100644 index 0000000..ec686fc --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PhoneOTPModel.java @@ -0,0 +1,495 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * PhoneOTPModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PhoneOTPModel { + public static final String SERIALIZED_NAME_G_RECAPTCHA_RESPONSE = "g-recaptcha-response"; + @SerializedName(SERIALIZED_NAME_G_RECAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String gRecaptchaResponse; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_TICKET = "qq_captcha_ticket"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_TICKET) + @javax.annotation.Nullable + private String qqCaptchaTicket; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR = "qq_captcha_randstr"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR) + @javax.annotation.Nullable + private String qqCaptchaRandstr; + + public static final String SERIALIZED_NAME_H_CAPTCHA_RESPONSE = "h-captcha-response"; + @SerializedName(SERIALIZED_NAME_H_CAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String hCaptchaResponse; + + public static final String SERIALIZED_NAME_O_T_P = "OTP"; + @SerializedName(SERIALIZED_NAME_O_T_P) + @javax.annotation.Nonnull + private String OTP; + + public static final String SERIALIZED_NAME_PHONE = "Phone"; + @SerializedName(SERIALIZED_NAME_PHONE) + @javax.annotation.Nonnull + private String phone; + + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer = new HashMap<>(); + + public PhoneOTPModel() { + } + + public PhoneOTPModel gRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + return this; + } + + /** + * The Google reCAPTCHA response which is sent to the server for verification. + * @return gRecaptchaResponse + */ + @javax.annotation.Nullable + public String getgRecaptchaResponse() { + return gRecaptchaResponse; + } + + public void setgRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + } + + + public PhoneOTPModel qqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + return this; + } + + /** + * The QQ Captcha ticket which is sent to the server for verification. + * @return qqCaptchaTicket + */ + @javax.annotation.Nullable + public String getQqCaptchaTicket() { + return qqCaptchaTicket; + } + + public void setQqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + } + + + public PhoneOTPModel qqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + return this; + } + + /** + * The QQ Captcha random string which is sent to the server for verification. + * @return qqCaptchaRandstr + */ + @javax.annotation.Nullable + public String getQqCaptchaRandstr() { + return qqCaptchaRandstr; + } + + public void setQqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + } + + + public PhoneOTPModel hCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + return this; + } + + /** + * The hCaptcha response which is sent to the server for verification. + * @return hCaptchaResponse + */ + @javax.annotation.Nullable + public String gethCaptchaResponse() { + return hCaptchaResponse; + } + + public void sethCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + } + + + public PhoneOTPModel OTP(@javax.annotation.Nonnull String OTP) { + this.OTP = OTP; + return this; + } + + /** + * The one-time Password (OTP). + * @return OTP + */ + @javax.annotation.Nonnull + public String getOTP() { + return OTP; + } + + public void setOTP(@javax.annotation.Nonnull String OTP) { + this.OTP = OTP; + } + + + public PhoneOTPModel phone(@javax.annotation.Nonnull String phone) { + this.phone = phone; + return this; + } + + /** + * The Phone number associated with the OTP. + * @return phone + */ + @javax.annotation.Nonnull + public String getPhone() { + return phone; + } + + public void setPhone(@javax.annotation.Nonnull String phone) { + this.phone = phone; + } + + + public PhoneOTPModel securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public PhoneOTPModel putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * Optional security answers for additional verification. + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PhoneOTPModel instance itself + */ + public PhoneOTPModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PhoneOTPModel phoneOTPModel = (PhoneOTPModel) o; + return Objects.equals(this.gRecaptchaResponse, phoneOTPModel.gRecaptchaResponse) && + Objects.equals(this.qqCaptchaTicket, phoneOTPModel.qqCaptchaTicket) && + Objects.equals(this.qqCaptchaRandstr, phoneOTPModel.qqCaptchaRandstr) && + Objects.equals(this.hCaptchaResponse, phoneOTPModel.hCaptchaResponse) && + Objects.equals(this.OTP, phoneOTPModel.OTP) && + Objects.equals(this.phone, phoneOTPModel.phone) && + Objects.equals(this.securityAnswer, phoneOTPModel.securityAnswer)&& + Objects.equals(this.additionalProperties, phoneOTPModel.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, OTP, phone, securityAnswer, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PhoneOTPModel {\n"); + sb.append(" gRecaptchaResponse: ").append(toIndentedString(gRecaptchaResponse)).append("\n"); + sb.append(" qqCaptchaTicket: ").append(toIndentedString(qqCaptchaTicket)).append("\n"); + sb.append(" qqCaptchaRandstr: ").append(toIndentedString(qqCaptchaRandstr)).append("\n"); + sb.append(" hCaptchaResponse: ").append(toIndentedString(hCaptchaResponse)).append("\n"); + sb.append(" OTP: ").append(toIndentedString(OTP)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("g-recaptcha-response"); + openapiFields.add("qq_captcha_ticket"); + openapiFields.add("qq_captcha_randstr"); + openapiFields.add("h-captcha-response"); + openapiFields.add("OTP"); + openapiFields.add("Phone"); + openapiFields.add("SecurityAnswer"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("OTP"); + openapiRequiredFields.add("Phone"); + } + + /** + * 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 PhoneOTPModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PhoneOTPModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PhoneOTPModel is not found in the empty JSON string", PhoneOTPModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PhoneOTPModel.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("g-recaptcha-response") != null && !jsonObj.get("g-recaptcha-response").isJsonNull()) && !jsonObj.get("g-recaptcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `g-recaptcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("g-recaptcha-response").toString())); + } + if ((jsonObj.get("qq_captcha_ticket") != null && !jsonObj.get("qq_captcha_ticket").isJsonNull()) && !jsonObj.get("qq_captcha_ticket").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_ticket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_ticket").toString())); + } + if ((jsonObj.get("qq_captcha_randstr") != null && !jsonObj.get("qq_captcha_randstr").isJsonNull()) && !jsonObj.get("qq_captcha_randstr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_randstr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_randstr").toString())); + } + if ((jsonObj.get("h-captcha-response") != null && !jsonObj.get("h-captcha-response").isJsonNull()) && !jsonObj.get("h-captcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `h-captcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("h-captcha-response").toString())); + } + if (!jsonObj.get("OTP").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `OTP` to be a primitive type in the JSON string but got `%s`", jsonObj.get("OTP").toString())); + } + if (!jsonObj.get("Phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Phone").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PhoneOTPModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PhoneOTPModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PhoneOTPModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PhoneOTPModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<PhoneOTPModel>() { + @Override + public void write(JsonWriter out, PhoneOTPModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PhoneOTPModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PhoneOTPModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PhoneOTPModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of PhoneOTPModel + * @throws IOException if the JSON string is invalid with respect to PhoneOTPModel + */ + public static PhoneOTPModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PhoneOTPModel.class); + } + + /** + * Convert an instance of PhoneOTPModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PhoneOTPModelCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PhoneOTPModelCore.java new file mode 100644 index 0000000..d70de1b --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PhoneOTPModelCore.java @@ -0,0 +1,363 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * PhoneOTPModelCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PhoneOTPModelCore { + public static final String SERIALIZED_NAME_O_T_P = "OTP"; + @SerializedName(SERIALIZED_NAME_O_T_P) + @javax.annotation.Nonnull + private String OTP; + + public static final String SERIALIZED_NAME_PHONE = "Phone"; + @SerializedName(SERIALIZED_NAME_PHONE) + @javax.annotation.Nonnull + private String phone; + + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer = new HashMap<>(); + + public PhoneOTPModelCore() { + } + + public PhoneOTPModelCore OTP(@javax.annotation.Nonnull String OTP) { + this.OTP = OTP; + return this; + } + + /** + * The one-time Password (OTP). + * @return OTP + */ + @javax.annotation.Nonnull + public String getOTP() { + return OTP; + } + + public void setOTP(@javax.annotation.Nonnull String OTP) { + this.OTP = OTP; + } + + + public PhoneOTPModelCore phone(@javax.annotation.Nonnull String phone) { + this.phone = phone; + return this; + } + + /** + * The Phone number associated with the OTP. + * @return phone + */ + @javax.annotation.Nonnull + public String getPhone() { + return phone; + } + + public void setPhone(@javax.annotation.Nonnull String phone) { + this.phone = phone; + } + + + public PhoneOTPModelCore securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public PhoneOTPModelCore putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * Optional security answers for additional verification. + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PhoneOTPModelCore instance itself + */ + public PhoneOTPModelCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PhoneOTPModelCore phoneOTPModelCore = (PhoneOTPModelCore) o; + return Objects.equals(this.OTP, phoneOTPModelCore.OTP) && + Objects.equals(this.phone, phoneOTPModelCore.phone) && + Objects.equals(this.securityAnswer, phoneOTPModelCore.securityAnswer)&& + Objects.equals(this.additionalProperties, phoneOTPModelCore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(OTP, phone, securityAnswer, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PhoneOTPModelCore {\n"); + sb.append(" OTP: ").append(toIndentedString(OTP)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("OTP"); + openapiFields.add("Phone"); + openapiFields.add("SecurityAnswer"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("OTP"); + openapiRequiredFields.add("Phone"); + } + + /** + * 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 PhoneOTPModelCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PhoneOTPModelCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PhoneOTPModelCore is not found in the empty JSON string", PhoneOTPModelCore.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PhoneOTPModelCore.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("OTP").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `OTP` to be a primitive type in the JSON string but got `%s`", jsonObj.get("OTP").toString())); + } + if (!jsonObj.get("Phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Phone").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PhoneOTPModelCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PhoneOTPModelCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PhoneOTPModelCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PhoneOTPModelCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<PhoneOTPModelCore>() { + @Override + public void write(JsonWriter out, PhoneOTPModelCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PhoneOTPModelCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PhoneOTPModelCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PhoneOTPModelCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of PhoneOTPModelCore + * @throws IOException if the JSON string is invalid with respect to PhoneOTPModelCore + */ + public static PhoneOTPModelCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PhoneOTPModelCore.class); + } + + /** + * Convert an instance of PhoneOTPModelCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PinReauthRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PinReauthRequest.java new file mode 100644 index 0000000..fd758d6 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PinReauthRequest.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * PinReauthRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PinReauthRequest { + public static final String SERIALIZED_NAME_PIN = "pin"; + @SerializedName(SERIALIZED_NAME_PIN) + @javax.annotation.Nonnull + private String pin; + + public PinReauthRequest() { + } + + public PinReauthRequest pin(@javax.annotation.Nonnull String pin) { + this.pin = pin; + return this; + } + + /** + * The PIN code to reauthenticate the User. + * @return pin + */ + @javax.annotation.Nonnull + public String getPin() { + return pin; + } + + public void setPin(@javax.annotation.Nonnull String pin) { + this.pin = pin; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PinReauthRequest instance itself + */ + public PinReauthRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PinReauthRequest pinReauthRequest = (PinReauthRequest) o; + return Objects.equals(this.pin, pinReauthRequest.pin)&& + Objects.equals(this.additionalProperties, pinReauthRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(pin, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PinReauthRequest {\n"); + sb.append(" pin: ").append(toIndentedString(pin)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("pin"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("pin"); + } + + /** + * 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 PinReauthRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PinReauthRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PinReauthRequest is not found in the empty JSON string", PinReauthRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PinReauthRequest.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("pin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pin").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PinReauthRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PinReauthRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PinReauthRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PinReauthRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<PinReauthRequest>() { + @Override + public void write(JsonWriter out, PinReauthRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PinReauthRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PinReauthRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PinReauthRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of PinReauthRequest + * @throws IOException if the JSON string is invalid with respect to PinReauthRequest + */ + public static PinReauthRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PinReauthRequest.class); + } + + /** + * Convert an instance of PinReauthRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PrivacyPolicyHistoryResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PrivacyPolicyHistoryResponse.java new file mode 100644 index 0000000..cb9df42 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PrivacyPolicyHistoryResponse.java @@ -0,0 +1,383 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.PrivacyPolicyHistoryResponseCurrent; +import com.loginradius.sdk.internal.openapi.model.PrivacyPolicyHistoryResponseHistoryInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * PrivacyPolicyHistoryResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PrivacyPolicyHistoryResponse { + public static final String SERIALIZED_NAME_UID = "Uid"; + @SerializedName(SERIALIZED_NAME_UID) + @javax.annotation.Nullable + private String uid; + + public static final String SERIALIZED_NAME_CURRENT = "Current"; + @SerializedName(SERIALIZED_NAME_CURRENT) + @javax.annotation.Nullable + private PrivacyPolicyHistoryResponseCurrent current; + + public static final String SERIALIZED_NAME_HISTORY = "History"; + @SerializedName(SERIALIZED_NAME_HISTORY) + @javax.annotation.Nullable + private List<PrivacyPolicyHistoryResponseHistoryInner> history; + + public PrivacyPolicyHistoryResponse() { + } + + public PrivacyPolicyHistoryResponse uid(@javax.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * The unique identifier (UID) of the User. + * @return uid + */ + @javax.annotation.Nullable + public String getUid() { + return uid; + } + + public void setUid(@javax.annotation.Nullable String uid) { + this.uid = uid; + } + + + public PrivacyPolicyHistoryResponse current(@javax.annotation.Nullable PrivacyPolicyHistoryResponseCurrent current) { + this.current = current; + return this; + } + + /** + * Get current + * @return current + */ + @javax.annotation.Nullable + public PrivacyPolicyHistoryResponseCurrent getCurrent() { + return current; + } + + public void setCurrent(@javax.annotation.Nullable PrivacyPolicyHistoryResponseCurrent current) { + this.current = current; + } + + + public PrivacyPolicyHistoryResponse history(@javax.annotation.Nullable List<PrivacyPolicyHistoryResponseHistoryInner> history) { + this.history = history; + return this; + } + + public PrivacyPolicyHistoryResponse addHistoryItem(PrivacyPolicyHistoryResponseHistoryInner historyItem) { + if (this.history == null) { + this.history = new ArrayList<>(); + } + this.history.add(historyItem); + return this; + } + + /** + * The history of accepted privacy policies. + * @return history + */ + @javax.annotation.Nullable + public List<PrivacyPolicyHistoryResponseHistoryInner> getHistory() { + return history; + } + + public void setHistory(@javax.annotation.Nullable List<PrivacyPolicyHistoryResponseHistoryInner> history) { + this.history = history; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PrivacyPolicyHistoryResponse instance itself + */ + public PrivacyPolicyHistoryResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PrivacyPolicyHistoryResponse privacyPolicyHistoryResponse = (PrivacyPolicyHistoryResponse) o; + return Objects.equals(this.uid, privacyPolicyHistoryResponse.uid) && + Objects.equals(this.current, privacyPolicyHistoryResponse.current) && + Objects.equals(this.history, privacyPolicyHistoryResponse.history)&& + Objects.equals(this.additionalProperties, privacyPolicyHistoryResponse.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(uid, current, history, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PrivacyPolicyHistoryResponse {\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" current: ").append(toIndentedString(current)).append("\n"); + sb.append(" history: ").append(toIndentedString(history)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Uid"); + openapiFields.add("Current"); + openapiFields.add("History"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 PrivacyPolicyHistoryResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PrivacyPolicyHistoryResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PrivacyPolicyHistoryResponse is not found in the empty JSON string", PrivacyPolicyHistoryResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Uid") != null && !jsonObj.get("Uid").isJsonNull()) && !jsonObj.get("Uid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Uid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Uid").toString())); + } + // validate the optional field `Current` + if (jsonObj.get("Current") != null && !jsonObj.get("Current").isJsonNull()) { + PrivacyPolicyHistoryResponseCurrent.validateJsonElement(jsonObj.get("Current")); + } + if (jsonObj.get("History") != null && !jsonObj.get("History").isJsonNull()) { + JsonArray jsonArrayhistory = jsonObj.getAsJsonArray("History"); + if (jsonArrayhistory != null) { + // ensure the json data is an array + if (!jsonObj.get("History").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `History` to be an array in the JSON string but got `%s`", jsonObj.get("History").toString())); + } + + // validate the optional field `History` (array) + for (int i = 0; i < jsonArrayhistory.size(); i++) { + PrivacyPolicyHistoryResponseHistoryInner.validateJsonElement(jsonArrayhistory.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PrivacyPolicyHistoryResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PrivacyPolicyHistoryResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PrivacyPolicyHistoryResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PrivacyPolicyHistoryResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<PrivacyPolicyHistoryResponse>() { + @Override + public void write(JsonWriter out, PrivacyPolicyHistoryResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PrivacyPolicyHistoryResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PrivacyPolicyHistoryResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PrivacyPolicyHistoryResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of PrivacyPolicyHistoryResponse + * @throws IOException if the JSON string is invalid with respect to PrivacyPolicyHistoryResponse + */ + public static PrivacyPolicyHistoryResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PrivacyPolicyHistoryResponse.class); + } + + /** + * Convert an instance of PrivacyPolicyHistoryResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PrivacyPolicyHistoryResponseCurrent.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PrivacyPolicyHistoryResponseCurrent.java new file mode 100644 index 0000000..3fcbbfe --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PrivacyPolicyHistoryResponseCurrent.java @@ -0,0 +1,357 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * The current accepted Privacy Policy. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PrivacyPolicyHistoryResponseCurrent { + public static final String SERIALIZED_NAME_VERSION = "Version"; + @SerializedName(SERIALIZED_NAME_VERSION) + @javax.annotation.Nullable + private String version; + + public static final String SERIALIZED_NAME_ACCEPT_SOURCE = "AcceptSource"; + @SerializedName(SERIALIZED_NAME_ACCEPT_SOURCE) + @javax.annotation.Nullable + private String acceptSource; + + public static final String SERIALIZED_NAME_ACCEPT_DATE_TIME = "AcceptDateTime"; + @SerializedName(SERIALIZED_NAME_ACCEPT_DATE_TIME) + @javax.annotation.Nullable + private OffsetDateTime acceptDateTime; + + public PrivacyPolicyHistoryResponseCurrent() { + } + + public PrivacyPolicyHistoryResponseCurrent version(@javax.annotation.Nullable String version) { + this.version = version; + return this; + } + + /** + * The version of the Privacy Policy. + * @return version + */ + @javax.annotation.Nullable + public String getVersion() { + return version; + } + + public void setVersion(@javax.annotation.Nullable String version) { + this.version = version; + } + + + public PrivacyPolicyHistoryResponseCurrent acceptSource(@javax.annotation.Nullable String acceptSource) { + this.acceptSource = acceptSource; + return this; + } + + /** + * The source from which the Privacy Policy was accepted. + * @return acceptSource + */ + @javax.annotation.Nullable + public String getAcceptSource() { + return acceptSource; + } + + public void setAcceptSource(@javax.annotation.Nullable String acceptSource) { + this.acceptSource = acceptSource; + } + + + public PrivacyPolicyHistoryResponseCurrent acceptDateTime(@javax.annotation.Nullable OffsetDateTime acceptDateTime) { + this.acceptDateTime = acceptDateTime; + return this; + } + + /** + * The date and time when the Privacy Policy was accepted. + * @return acceptDateTime + */ + @javax.annotation.Nullable + public OffsetDateTime getAcceptDateTime() { + return acceptDateTime; + } + + public void setAcceptDateTime(@javax.annotation.Nullable OffsetDateTime acceptDateTime) { + this.acceptDateTime = acceptDateTime; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PrivacyPolicyHistoryResponseCurrent instance itself + */ + public PrivacyPolicyHistoryResponseCurrent putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PrivacyPolicyHistoryResponseCurrent privacyPolicyHistoryResponseCurrent = (PrivacyPolicyHistoryResponseCurrent) o; + return Objects.equals(this.version, privacyPolicyHistoryResponseCurrent.version) && + Objects.equals(this.acceptSource, privacyPolicyHistoryResponseCurrent.acceptSource) && + Objects.equals(this.acceptDateTime, privacyPolicyHistoryResponseCurrent.acceptDateTime)&& + Objects.equals(this.additionalProperties, privacyPolicyHistoryResponseCurrent.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(version, acceptSource, acceptDateTime, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PrivacyPolicyHistoryResponseCurrent {\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" acceptSource: ").append(toIndentedString(acceptSource)).append("\n"); + sb.append(" acceptDateTime: ").append(toIndentedString(acceptDateTime)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Version"); + openapiFields.add("AcceptSource"); + openapiFields.add("AcceptDateTime"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 PrivacyPolicyHistoryResponseCurrent + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PrivacyPolicyHistoryResponseCurrent.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PrivacyPolicyHistoryResponseCurrent is not found in the empty JSON string", PrivacyPolicyHistoryResponseCurrent.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Version") != null && !jsonObj.get("Version").isJsonNull()) && !jsonObj.get("Version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Version").toString())); + } + if ((jsonObj.get("AcceptSource") != null && !jsonObj.get("AcceptSource").isJsonNull()) && !jsonObj.get("AcceptSource").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AcceptSource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AcceptSource").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PrivacyPolicyHistoryResponseCurrent.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PrivacyPolicyHistoryResponseCurrent' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PrivacyPolicyHistoryResponseCurrent> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PrivacyPolicyHistoryResponseCurrent.class)); + + return (TypeAdapter<T>) new TypeAdapter<PrivacyPolicyHistoryResponseCurrent>() { + @Override + public void write(JsonWriter out, PrivacyPolicyHistoryResponseCurrent value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PrivacyPolicyHistoryResponseCurrent read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PrivacyPolicyHistoryResponseCurrent instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PrivacyPolicyHistoryResponseCurrent given an JSON string + * + * @param jsonString JSON string + * @return An instance of PrivacyPolicyHistoryResponseCurrent + * @throws IOException if the JSON string is invalid with respect to PrivacyPolicyHistoryResponseCurrent + */ + public static PrivacyPolicyHistoryResponseCurrent fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PrivacyPolicyHistoryResponseCurrent.class); + } + + /** + * Convert an instance of PrivacyPolicyHistoryResponseCurrent to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PrivacyPolicyHistoryResponseHistoryInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PrivacyPolicyHistoryResponseHistoryInner.java new file mode 100644 index 0000000..cec2163 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PrivacyPolicyHistoryResponseHistoryInner.java @@ -0,0 +1,357 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * PrivacyPolicyHistoryResponseHistoryInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PrivacyPolicyHistoryResponseHistoryInner { + public static final String SERIALIZED_NAME_VERSION = "Version"; + @SerializedName(SERIALIZED_NAME_VERSION) + @javax.annotation.Nullable + private String version; + + public static final String SERIALIZED_NAME_ACCEPT_SOURCE = "AcceptSource"; + @SerializedName(SERIALIZED_NAME_ACCEPT_SOURCE) + @javax.annotation.Nullable + private String acceptSource; + + public static final String SERIALIZED_NAME_ACCEPT_DATE_TIME = "AcceptDateTime"; + @SerializedName(SERIALIZED_NAME_ACCEPT_DATE_TIME) + @javax.annotation.Nullable + private OffsetDateTime acceptDateTime; + + public PrivacyPolicyHistoryResponseHistoryInner() { + } + + public PrivacyPolicyHistoryResponseHistoryInner version(@javax.annotation.Nullable String version) { + this.version = version; + return this; + } + + /** + * The version of the Privacy Policy. + * @return version + */ + @javax.annotation.Nullable + public String getVersion() { + return version; + } + + public void setVersion(@javax.annotation.Nullable String version) { + this.version = version; + } + + + public PrivacyPolicyHistoryResponseHistoryInner acceptSource(@javax.annotation.Nullable String acceptSource) { + this.acceptSource = acceptSource; + return this; + } + + /** + * The source from which the Privacy Policy was accepted. + * @return acceptSource + */ + @javax.annotation.Nullable + public String getAcceptSource() { + return acceptSource; + } + + public void setAcceptSource(@javax.annotation.Nullable String acceptSource) { + this.acceptSource = acceptSource; + } + + + public PrivacyPolicyHistoryResponseHistoryInner acceptDateTime(@javax.annotation.Nullable OffsetDateTime acceptDateTime) { + this.acceptDateTime = acceptDateTime; + return this; + } + + /** + * The date and time when the Privacy Policy was accepted. + * @return acceptDateTime + */ + @javax.annotation.Nullable + public OffsetDateTime getAcceptDateTime() { + return acceptDateTime; + } + + public void setAcceptDateTime(@javax.annotation.Nullable OffsetDateTime acceptDateTime) { + this.acceptDateTime = acceptDateTime; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PrivacyPolicyHistoryResponseHistoryInner instance itself + */ + public PrivacyPolicyHistoryResponseHistoryInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PrivacyPolicyHistoryResponseHistoryInner privacyPolicyHistoryResponseHistoryInner = (PrivacyPolicyHistoryResponseHistoryInner) o; + return Objects.equals(this.version, privacyPolicyHistoryResponseHistoryInner.version) && + Objects.equals(this.acceptSource, privacyPolicyHistoryResponseHistoryInner.acceptSource) && + Objects.equals(this.acceptDateTime, privacyPolicyHistoryResponseHistoryInner.acceptDateTime)&& + Objects.equals(this.additionalProperties, privacyPolicyHistoryResponseHistoryInner.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(version, acceptSource, acceptDateTime, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PrivacyPolicyHistoryResponseHistoryInner {\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" acceptSource: ").append(toIndentedString(acceptSource)).append("\n"); + sb.append(" acceptDateTime: ").append(toIndentedString(acceptDateTime)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Version"); + openapiFields.add("AcceptSource"); + openapiFields.add("AcceptDateTime"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 PrivacyPolicyHistoryResponseHistoryInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PrivacyPolicyHistoryResponseHistoryInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PrivacyPolicyHistoryResponseHistoryInner is not found in the empty JSON string", PrivacyPolicyHistoryResponseHistoryInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Version") != null && !jsonObj.get("Version").isJsonNull()) && !jsonObj.get("Version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Version").toString())); + } + if ((jsonObj.get("AcceptSource") != null && !jsonObj.get("AcceptSource").isJsonNull()) && !jsonObj.get("AcceptSource").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AcceptSource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AcceptSource").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PrivacyPolicyHistoryResponseHistoryInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PrivacyPolicyHistoryResponseHistoryInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PrivacyPolicyHistoryResponseHistoryInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PrivacyPolicyHistoryResponseHistoryInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<PrivacyPolicyHistoryResponseHistoryInner>() { + @Override + public void write(JsonWriter out, PrivacyPolicyHistoryResponseHistoryInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PrivacyPolicyHistoryResponseHistoryInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PrivacyPolicyHistoryResponseHistoryInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PrivacyPolicyHistoryResponseHistoryInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of PrivacyPolicyHistoryResponseHistoryInner + * @throws IOException if the JSON string is invalid with respect to PrivacyPolicyHistoryResponseHistoryInner + */ + public static PrivacyPolicyHistoryResponseHistoryInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PrivacyPolicyHistoryResponseHistoryInner.class); + } + + /** + * Convert an instance of PrivacyPolicyHistoryResponseHistoryInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/Profile.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/Profile.java new file mode 100644 index 0000000..affa26f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/Profile.java @@ -0,0 +1,5432 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProfileAddressesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileAgeRange; +import com.loginradius.sdk.internal.openapi.model.ProfileAwardsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileBadgesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileBooksInner; +import com.loginradius.sdk.internal.openapi.model.ProfileCertificationsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileConsentProfile; +import com.loginradius.sdk.internal.openapi.model.ProfileCountry; +import com.loginradius.sdk.internal.openapi.model.ProfileCoursesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileCurrentStatusInner; +import com.loginradius.sdk.internal.openapi.model.ProfileEducationsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileEmailInner; +import com.loginradius.sdk.internal.openapi.model.ProfileExternalIdsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileFamilyInner; +import com.loginradius.sdk.internal.openapi.model.ProfileFavoriteThingsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileGamesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileIMAccountsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileInspirationalPeopleInner; +import com.loginradius.sdk.internal.openapi.model.ProfileInterestsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileJobBookmarksInner; +import com.loginradius.sdk.internal.openapi.model.ProfileKloutScore; +import com.loginradius.sdk.internal.openapi.model.ProfileLanguagesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileMemberUrlResourcesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileMoviesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileMutualFriendsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileOrganizationsInner; +import com.loginradius.sdk.internal.openapi.model.ProfilePIN; +import com.loginradius.sdk.internal.openapi.model.ProfilePasskeyLogin; +import com.loginradius.sdk.internal.openapi.model.ProfilePatentsInner; +import com.loginradius.sdk.internal.openapi.model.ProfilePhoneNumbersInner; +import com.loginradius.sdk.internal.openapi.model.ProfilePlacesLivedInner; +import com.loginradius.sdk.internal.openapi.model.ProfilePositionsInner; +import com.loginradius.sdk.internal.openapi.model.ProfilePrivacyPolicy; +import com.loginradius.sdk.internal.openapi.model.ProfileProjectsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileProviderAccessCredential; +import com.loginradius.sdk.internal.openapi.model.ProfilePublicationsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRecommendationsReceivedInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRegistrationData; +import com.loginradius.sdk.internal.openapi.model.ProfileRelatedProfileViewsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileSkillsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileSportsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileSubscription; +import com.loginradius.sdk.internal.openapi.model.ProfileSuggestions; +import com.loginradius.sdk.internal.openapi.model.ProfileTelevisionShowInner; +import com.loginradius.sdk.internal.openapi.model.ProfileUnverifiedEmailInner; +import com.loginradius.sdk.internal.openapi.model.ProfileVolunteerInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentity; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Profile + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class Profile { + public static final String SERIALIZED_NAME_IS_PASSWORD_BREACHED = "IsPasswordBreached"; + @SerializedName(SERIALIZED_NAME_IS_PASSWORD_BREACHED) + @javax.annotation.Nullable + private Boolean isPasswordBreached; + + public static final String SERIALIZED_NAME_IS_ACTIVE = "IsActive"; + @SerializedName(SERIALIZED_NAME_IS_ACTIVE) + @javax.annotation.Nullable + private Boolean isActive; + + public static final String SERIALIZED_NAME_IS_DELETED = "IsDeleted"; + @SerializedName(SERIALIZED_NAME_IS_DELETED) + @javax.annotation.Nullable + private Boolean isDeleted; + + public static final String SERIALIZED_NAME_EMAIL_VERIFIED = "EmailVerified"; + @SerializedName(SERIALIZED_NAME_EMAIL_VERIFIED) + @javax.annotation.Nullable + private Boolean emailVerified; + + public static final String SERIALIZED_NAME_IS_LOGIN_LOCKED = "IsLoginLocked"; + @SerializedName(SERIALIZED_NAME_IS_LOGIN_LOCKED) + @javax.annotation.Nullable + private Boolean isLoginLocked; + + public static final String SERIALIZED_NAME_IS_REQUIRED_FIELDS_FILLED_ONCE = "IsRequiredFieldsFilledOnce"; + @SerializedName(SERIALIZED_NAME_IS_REQUIRED_FIELDS_FILLED_ONCE) + @javax.annotation.Nullable + private Boolean isRequiredFieldsFilledOnce; + + public static final String SERIALIZED_NAME_FIRST_LOGIN = "FirstLogin"; + @SerializedName(SERIALIZED_NAME_FIRST_LOGIN) + @javax.annotation.Nullable + private Boolean firstLogin; + + public static final String SERIALIZED_NAME_IS_PROTECTED = "IsProtected"; + @SerializedName(SERIALIZED_NAME_IS_PROTECTED) + @javax.annotation.Nullable + private Boolean isProtected; + + public static final String SERIALIZED_NAME_HIREABLE = "Hireable"; + @SerializedName(SERIALIZED_NAME_HIREABLE) + @javax.annotation.Nullable + private Boolean hireable; + + public static final String SERIALIZED_NAME_IS_SECURE_PASSWORD = "IsSecurePassword"; + @SerializedName(SERIALIZED_NAME_IS_SECURE_PASSWORD) + @javax.annotation.Nullable + private Boolean isSecurePassword; + + public static final String SERIALIZED_NAME_IS_CUSTOM_UID = "IsCustomUid"; + @SerializedName(SERIALIZED_NAME_IS_CUSTOM_UID) + @javax.annotation.Nullable + private Boolean isCustomUid; + + public static final String SERIALIZED_NAME_PHONE_ID_VERIFIED = "PhoneIdVerified"; + @SerializedName(SERIALIZED_NAME_PHONE_ID_VERIFIED) + @javax.annotation.Nullable + private Boolean phoneIdVerified; + + public static final String SERIALIZED_NAME_IS_EMAIL_SUBSCRIBED = "IsEmailSubscribed"; + @SerializedName(SERIALIZED_NAME_IS_EMAIL_SUBSCRIBED) + @javax.annotation.Nullable + private Boolean isEmailSubscribed; + + public static final String SERIALIZED_NAME_NO_OF_LOGINS = "NoOfLogins"; + @SerializedName(SERIALIZED_NAME_NO_OF_LOGINS) + @javax.annotation.Nullable + private Integer noOfLogins; + + public static final String SERIALIZED_NAME_FOLLOWERS_COUNT = "FollowersCount"; + @SerializedName(SERIALIZED_NAME_FOLLOWERS_COUNT) + @javax.annotation.Nullable + private Integer followersCount; + + public static final String SERIALIZED_NAME_FRIENDS_COUNT = "FriendsCount"; + @SerializedName(SERIALIZED_NAME_FRIENDS_COUNT) + @javax.annotation.Nullable + private Integer friendsCount; + + public static final String SERIALIZED_NAME_TOTAL_STATUSES_COUNT = "TotalStatusesCount"; + @SerializedName(SERIALIZED_NAME_TOTAL_STATUSES_COUNT) + @javax.annotation.Nullable + private Integer totalStatusesCount; + + public static final String SERIALIZED_NAME_NUM_RECOMMENDERS = "NumRecommenders"; + @SerializedName(SERIALIZED_NAME_NUM_RECOMMENDERS) + @javax.annotation.Nullable + private Integer numRecommenders; + + public static final String SERIALIZED_NAME_TOTAL_PRIVATE_REPOSITORY = "TotalPrivateRepository"; + @SerializedName(SERIALIZED_NAME_TOTAL_PRIVATE_REPOSITORY) + @javax.annotation.Nullable + private Integer totalPrivateRepository; + + public static final String SERIALIZED_NAME_PUBLIC_GISTS = "PublicGists"; + @SerializedName(SERIALIZED_NAME_PUBLIC_GISTS) + @javax.annotation.Nullable + private Integer publicGists; + + public static final String SERIALIZED_NAME_PRIVATE_GISTS = "PrivateGists"; + @SerializedName(SERIALIZED_NAME_PRIVATE_GISTS) + @javax.annotation.Nullable + private Integer privateGists; + + public static final String SERIALIZED_NAME_PINS_COUNT = "PinsCount"; + @SerializedName(SERIALIZED_NAME_PINS_COUNT) + @javax.annotation.Nullable + private Integer pinsCount; + + public static final String SERIALIZED_NAME_BOARDS_COUNT = "BoardsCount"; + @SerializedName(SERIALIZED_NAME_BOARDS_COUNT) + @javax.annotation.Nullable + private Integer boardsCount; + + public static final String SERIALIZED_NAME_LIKES_COUNT = "LikesCount"; + @SerializedName(SERIALIZED_NAME_LIKES_COUNT) + @javax.annotation.Nullable + private Integer likesCount; + + public static final String SERIALIZED_NAME_SESSION_LIMIT = "SessionLimit"; + @SerializedName(SERIALIZED_NAME_SESSION_LIMIT) + @javax.annotation.Nullable + private Integer sessionLimit; + + public static final String SERIALIZED_NAME_I_D = "ID"; + @SerializedName(SERIALIZED_NAME_I_D) + @javax.annotation.Nullable + private String ID; + + public static final String SERIALIZED_NAME_PASSWORD = "Password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nullable + private String password; + + public static final String SERIALIZED_NAME_LOGIN_LOCKED_TYPE = "LoginLockedType"; + @SerializedName(SERIALIZED_NAME_LOGIN_LOCKED_TYPE) + @javax.annotation.Nullable + private String loginLockedType; + + public static final String SERIALIZED_NAME_PROVIDER = "Provider"; + @SerializedName(SERIALIZED_NAME_PROVIDER) + @javax.annotation.Nullable + private String provider; + + public static final String SERIALIZED_NAME_LAST_PASSWORD_CHANGE_TOKEN = "LastPasswordChangeToken"; + @SerializedName(SERIALIZED_NAME_LAST_PASSWORD_CHANGE_TOKEN) + @javax.annotation.Nullable + private String lastPasswordChangeToken; + + 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_FIRST_NAME = "FirstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nullable + private String firstName; + + public static final String SERIALIZED_NAME_LAST_NAME = "LastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nullable + private String lastName; + + public static final String SERIALIZED_NAME_REGISTRATION_PROVIDER = "RegistrationProvider"; + @SerializedName(SERIALIZED_NAME_REGISTRATION_PROVIDER) + @javax.annotation.Nullable + private String registrationProvider; + + public static final String SERIALIZED_NAME_REGISTRATION_SOURCE = "RegistrationSource"; + @SerializedName(SERIALIZED_NAME_REGISTRATION_SOURCE) + @javax.annotation.Nullable + private String registrationSource; + + public static final String SERIALIZED_NAME_LAST_LOGIN_LOCATION = "LastLoginLocation"; + @SerializedName(SERIALIZED_NAME_LAST_LOGIN_LOCATION) + @javax.annotation.Nullable + private String lastLoginLocation; + + public static final String SERIALIZED_NAME_EXTERNAL_USER_LOGIN_ID = "ExternalUserLoginId"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_USER_LOGIN_ID) + @javax.annotation.Nullable + private String externalUserLoginId; + + public static final String SERIALIZED_NAME_PHONE_ID = "PhoneId"; + @SerializedName(SERIALIZED_NAME_PHONE_ID) + @javax.annotation.Nullable + private String phoneId; + + public static final String SERIALIZED_NAME_USER_NAME = "UserName"; + @SerializedName(SERIALIZED_NAME_USER_NAME) + @javax.annotation.Nullable + private String userName; + + public static final String SERIALIZED_NAME_PREFIX = "Prefix"; + @SerializedName(SERIALIZED_NAME_PREFIX) + @javax.annotation.Nullable + private String prefix; + + public static final String SERIALIZED_NAME_MIDDLE_NAME = "MiddleName"; + @SerializedName(SERIALIZED_NAME_MIDDLE_NAME) + @javax.annotation.Nullable + private String middleName; + + public static final String SERIALIZED_NAME_SUFFIX = "Suffix"; + @SerializedName(SERIALIZED_NAME_SUFFIX) + @javax.annotation.Nullable + private String suffix; + + public static final String SERIALIZED_NAME_NICK_NAME = "NickName"; + @SerializedName(SERIALIZED_NAME_NICK_NAME) + @javax.annotation.Nullable + private String nickName; + + public static final String SERIALIZED_NAME_PROFILE_NAME = "ProfileName"; + @SerializedName(SERIALIZED_NAME_PROFILE_NAME) + @javax.annotation.Nullable + private String profileName; + + public static final String SERIALIZED_NAME_BIRTH_DATE = "BirthDate"; + @SerializedName(SERIALIZED_NAME_BIRTH_DATE) + @javax.annotation.Nullable + private String birthDate; + + public static final String SERIALIZED_NAME_GENDER = "Gender"; + @SerializedName(SERIALIZED_NAME_GENDER) + @javax.annotation.Nullable + private String gender; + + public static final String SERIALIZED_NAME_WEBSITE = "Website"; + @SerializedName(SERIALIZED_NAME_WEBSITE) + @javax.annotation.Nullable + private String website; + + public static final String SERIALIZED_NAME_THUMBNAIL_IMAGE_URL = "ThumbnailImageUrl"; + @SerializedName(SERIALIZED_NAME_THUMBNAIL_IMAGE_URL) + @javax.annotation.Nullable + private String thumbnailImageUrl; + + public static final String SERIALIZED_NAME_IMAGE_URL = "ImageUrl"; + @SerializedName(SERIALIZED_NAME_IMAGE_URL) + @javax.annotation.Nullable + private String imageUrl; + + public static final String SERIALIZED_NAME_FAVICON = "Favicon"; + @SerializedName(SERIALIZED_NAME_FAVICON) + @javax.annotation.Nullable + private String favicon; + + public static final String SERIALIZED_NAME_PROFILE_URL = "ProfileUrl"; + @SerializedName(SERIALIZED_NAME_PROFILE_URL) + @javax.annotation.Nullable + private String profileUrl; + + public static final String SERIALIZED_NAME_HOME_TOWN = "HomeTown"; + @SerializedName(SERIALIZED_NAME_HOME_TOWN) + @javax.annotation.Nullable + private String homeTown; + + public static final String SERIALIZED_NAME_STATE = "State"; + @SerializedName(SERIALIZED_NAME_STATE) + @javax.annotation.Nullable + private String state; + + public static final String SERIALIZED_NAME_CITY = "City"; + @SerializedName(SERIALIZED_NAME_CITY) + @javax.annotation.Nullable + private String city; + + public static final String SERIALIZED_NAME_INDUSTRY = "Industry"; + @SerializedName(SERIALIZED_NAME_INDUSTRY) + @javax.annotation.Nullable + private String industry; + + public static final String SERIALIZED_NAME_ABOUT = "About"; + @SerializedName(SERIALIZED_NAME_ABOUT) + @javax.annotation.Nullable + private String about; + + public static final String SERIALIZED_NAME_TIME_ZONE = "TimeZone"; + @SerializedName(SERIALIZED_NAME_TIME_ZONE) + @javax.annotation.Nullable + private String timeZone; + + public static final String SERIALIZED_NAME_LOCAL_LANGUAGE = "LocalLanguage"; + @SerializedName(SERIALIZED_NAME_LOCAL_LANGUAGE) + @javax.annotation.Nullable + private String localLanguage; + + public static final String SERIALIZED_NAME_COVER_PHOTO = "CoverPhoto"; + @SerializedName(SERIALIZED_NAME_COVER_PHOTO) + @javax.annotation.Nullable + private String coverPhoto; + + public static final String SERIALIZED_NAME_TAG_LINE = "TagLine"; + @SerializedName(SERIALIZED_NAME_TAG_LINE) + @javax.annotation.Nullable + private String tagLine; + + public static final String SERIALIZED_NAME_LANGUAGE = "Language"; + @SerializedName(SERIALIZED_NAME_LANGUAGE) + @javax.annotation.Nullable + private String language; + + public static final String SERIALIZED_NAME_VERIFIED = "Verified"; + @SerializedName(SERIALIZED_NAME_VERIFIED) + @javax.annotation.Nullable + private String verified; + + public static final String SERIALIZED_NAME_UPDATED_TIME = "UpdatedTime"; + @SerializedName(SERIALIZED_NAME_UPDATED_TIME) + @javax.annotation.Nullable + private String updatedTime; + + public static final String SERIALIZED_NAME_IS_GEO_ENABLED = "IsGeoEnabled"; + @SerializedName(SERIALIZED_NAME_IS_GEO_ENABLED) + @javax.annotation.Nullable + private String isGeoEnabled; + + public static final String SERIALIZED_NAME_ASSOCIATIONS = "Associations"; + @SerializedName(SERIALIZED_NAME_ASSOCIATIONS) + @javax.annotation.Nullable + private String associations; + + public static final String SERIALIZED_NAME_HONORS = "Honors"; + @SerializedName(SERIALIZED_NAME_HONORS) + @javax.annotation.Nullable + private String honors; + + public static final String SERIALIZED_NAME_HTTPS_IMAGE_URL = "HttpsImageUrl"; + @SerializedName(SERIALIZED_NAME_HTTPS_IMAGE_URL) + @javax.annotation.Nullable + private String httpsImageUrl; + + public static final String SERIALIZED_NAME_MAIN_ADDRESS = "MainAddress"; + @SerializedName(SERIALIZED_NAME_MAIN_ADDRESS) + @javax.annotation.Nullable + private String mainAddress; + + public static final String SERIALIZED_NAME_CREATED = "Created"; + @SerializedName(SERIALIZED_NAME_CREATED) + @javax.annotation.Nullable + private String created; + + public static final String SERIALIZED_NAME_LOCAL_CITY = "LocalCity"; + @SerializedName(SERIALIZED_NAME_LOCAL_CITY) + @javax.annotation.Nullable + private String localCity; + + public static final String SERIALIZED_NAME_PROFILE_CITY = "ProfileCity"; + @SerializedName(SERIALIZED_NAME_PROFILE_CITY) + @javax.annotation.Nullable + private String profileCity; + + public static final String SERIALIZED_NAME_LOCAL_COUNTRY = "LocalCountry"; + @SerializedName(SERIALIZED_NAME_LOCAL_COUNTRY) + @javax.annotation.Nullable + private String localCountry; + + public static final String SERIALIZED_NAME_PROFILE_COUNTRY = "ProfileCountry"; + @SerializedName(SERIALIZED_NAME_PROFILE_COUNTRY) + @javax.annotation.Nullable + private String profileCountry; + + public static final String SERIALIZED_NAME_RELATIONSHIP_STATUS = "RelationshipStatus"; + @SerializedName(SERIALIZED_NAME_RELATIONSHIP_STATUS) + @javax.annotation.Nullable + private String relationshipStatus; + + public static final String SERIALIZED_NAME_QUOTA = "Quota"; + @SerializedName(SERIALIZED_NAME_QUOTA) + @javax.annotation.Nullable + private String quota; + + public static final String SERIALIZED_NAME_QUOTE = "Quote"; + @SerializedName(SERIALIZED_NAME_QUOTE) + @javax.annotation.Nullable + private String quote; + + public static final String SERIALIZED_NAME_RELIGION = "Religion"; + @SerializedName(SERIALIZED_NAME_RELIGION) + @javax.annotation.Nullable + private String religion; + + public static final String SERIALIZED_NAME_POLITICAL = "Political"; + @SerializedName(SERIALIZED_NAME_POLITICAL) + @javax.annotation.Nullable + private String political; + + public static final String SERIALIZED_NAME_PUBLIC_REPOSITORY = "PublicRepository"; + @SerializedName(SERIALIZED_NAME_PUBLIC_REPOSITORY) + @javax.annotation.Nullable + private String publicRepository; + + public static final String SERIALIZED_NAME_REPOSITORY_URL = "RepositoryUrl"; + @SerializedName(SERIALIZED_NAME_REPOSITORY_URL) + @javax.annotation.Nullable + private String repositoryUrl; + + public static final String SERIALIZED_NAME_AGE = "Age"; + @SerializedName(SERIALIZED_NAME_AGE) + @javax.annotation.Nullable + private String age; + + public static final String SERIALIZED_NAME_PROFESSIONAL_HEADLINE = "ProfessionalHeadline"; + @SerializedName(SERIALIZED_NAME_PROFESSIONAL_HEADLINE) + @javax.annotation.Nullable + private String professionalHeadline; + + public static final String SERIALIZED_NAME_LR_USER_I_D = "LRUserID"; + @SerializedName(SERIALIZED_NAME_LR_USER_I_D) + @javax.annotation.Nullable + private String lrUserID; + + public static final String SERIALIZED_NAME_CURRENCY = "Currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + @javax.annotation.Nullable + private String currency; + + public static final String SERIALIZED_NAME_STARRED_URL = "StarredUrl"; + @SerializedName(SERIALIZED_NAME_STARRED_URL) + @javax.annotation.Nullable + private String starredUrl; + + public static final String SERIALIZED_NAME_GISTS_URL = "GistsUrl"; + @SerializedName(SERIALIZED_NAME_GISTS_URL) + @javax.annotation.Nullable + private String gistsUrl; + + public static final String SERIALIZED_NAME_COMPANY = "Company"; + @SerializedName(SERIALIZED_NAME_COMPANY) + @javax.annotation.Nullable + private String company; + + public static final String SERIALIZED_NAME_GRAVATAR_IMAGE_URL = "GravatarImageUrl"; + @SerializedName(SERIALIZED_NAME_GRAVATAR_IMAGE_URL) + @javax.annotation.Nullable + private String gravatarImageUrl; + + public static final String SERIALIZED_NAME_LAST_PASSWORD_CHANGE_DATE = "LastPasswordChangeDate"; + @SerializedName(SERIALIZED_NAME_LAST_PASSWORD_CHANGE_DATE) + @javax.annotation.Nullable + private OffsetDateTime lastPasswordChangeDate; + + public static final String SERIALIZED_NAME_PASSWORD_EXPIRATION_DATE = "PasswordExpirationDate"; + @SerializedName(SERIALIZED_NAME_PASSWORD_EXPIRATION_DATE) + @javax.annotation.Nullable + private OffsetDateTime passwordExpirationDate; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public static final String SERIALIZED_NAME_MODIFIED_DATE = "ModifiedDate"; + @SerializedName(SERIALIZED_NAME_MODIFIED_DATE) + @javax.annotation.Nullable + private OffsetDateTime modifiedDate; + + public static final String SERIALIZED_NAME_PROFILE_MODIFIED_DATE = "ProfileModifiedDate"; + @SerializedName(SERIALIZED_NAME_PROFILE_MODIFIED_DATE) + @javax.annotation.Nullable + private OffsetDateTime profileModifiedDate; + + public static final String SERIALIZED_NAME_LAST_LOGIN_DATE = "LastLoginDate"; + @SerializedName(SERIALIZED_NAME_LAST_LOGIN_DATE) + @javax.annotation.Nullable + private OffsetDateTime lastLoginDate; + + public static final String SERIALIZED_NAME_SIGNUP_DATE = "SignupDate"; + @SerializedName(SERIALIZED_NAME_SIGNUP_DATE) + @javax.annotation.Nullable + private OffsetDateTime signupDate; + + public static final String SERIALIZED_NAME_PRIVACY_POLICY = "PrivacyPolicy"; + @SerializedName(SERIALIZED_NAME_PRIVACY_POLICY) + @javax.annotation.Nullable + private ProfilePrivacyPolicy privacyPolicy; + + public static final String SERIALIZED_NAME_COUNTRY = "Country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + @javax.annotation.Nullable + private ProfileCountry country; + + public static final String SERIALIZED_NAME_AGE_RANGE = "AgeRange"; + @SerializedName(SERIALIZED_NAME_AGE_RANGE) + @javax.annotation.Nullable + private ProfileAgeRange ageRange; + + public static final String SERIALIZED_NAME_KLOUT_SCORE = "KloutScore"; + @SerializedName(SERIALIZED_NAME_KLOUT_SCORE) + @javax.annotation.Nullable + private ProfileKloutScore kloutScore; + + public static final String SERIALIZED_NAME_SUGGESTIONS = "Suggestions"; + @SerializedName(SERIALIZED_NAME_SUGGESTIONS) + @javax.annotation.Nullable + private ProfileSuggestions suggestions; + + public static final String SERIALIZED_NAME_SUBSCRIPTION = "Subscription"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION) + @javax.annotation.Nullable + private ProfileSubscription subscription; + + public static final String SERIALIZED_NAME_P_I_N = "PIN"; + @SerializedName(SERIALIZED_NAME_P_I_N) + @javax.annotation.Nullable + private ProfilePIN PIN; + + public static final String SERIALIZED_NAME_CONSENT_PROFILE = "ConsentProfile"; + @SerializedName(SERIALIZED_NAME_CONSENT_PROFILE) + @javax.annotation.Nullable + private ProfileConsentProfile consentProfile; + + public static final String SERIALIZED_NAME_REGISTRATION_DATA = "RegistrationData"; + @SerializedName(SERIALIZED_NAME_REGISTRATION_DATA) + @javax.annotation.Nullable + private ProfileRegistrationData registrationData; + + public static final String SERIALIZED_NAME_PROVIDER_ACCESS_CREDENTIAL = "ProviderAccessCredential"; + @SerializedName(SERIALIZED_NAME_PROVIDER_ACCESS_CREDENTIAL) + @javax.annotation.Nullable + private ProfileProviderAccessCredential providerAccessCredential; + + public static final String SERIALIZED_NAME_CUSTOM_FIELDS = "CustomFields"; + @SerializedName(SERIALIZED_NAME_CUSTOM_FIELDS) + @javax.annotation.Nullable + private Map<String, String> customFields; + + public static final String SERIALIZED_NAME_PROFILE_IMAGE_URLS = "ProfileImageUrls"; + @SerializedName(SERIALIZED_NAME_PROFILE_IMAGE_URLS) + @javax.annotation.Nullable + private Map<String, String> profileImageUrls; + + public static final String SERIALIZED_NAME_WEB_PROFILES = "WebProfiles"; + @SerializedName(SERIALIZED_NAME_WEB_PROFILES) + @javax.annotation.Nullable + private Map<String, String> webProfiles; + + public static final String SERIALIZED_NAME_ROLES = "Roles"; + @SerializedName(SERIALIZED_NAME_ROLES) + @javax.annotation.Nullable + private List<String> roles; + + public static final String SERIALIZED_NAME_UID = "Uid"; + @SerializedName(SERIALIZED_NAME_UID) + @javax.annotation.Nullable + private String uid; + + public static final String SERIALIZED_NAME_PREVIOUS_UIDS = "PreviousUids"; + @SerializedName(SERIALIZED_NAME_PREVIOUS_UIDS) + @javax.annotation.Nullable + private List<String> previousUids; + + public static final String SERIALIZED_NAME_INTERESTED_IN = "InterestedIn"; + @SerializedName(SERIALIZED_NAME_INTERESTED_IN) + @javax.annotation.Nullable + private List<String> interestedIn; + + public static final String SERIALIZED_NAME_EXTERNAL_IDS = "ExternalIds"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_IDS) + @javax.annotation.Nullable + private List<ProfileExternalIdsInner> externalIds; + + public static final String SERIALIZED_NAME_UNVERIFIED_EMAIL = "UnverifiedEmail"; + @SerializedName(SERIALIZED_NAME_UNVERIFIED_EMAIL) + @javax.annotation.Nullable + private List<ProfileUnverifiedEmailInner> unverifiedEmail; + + public static final String SERIALIZED_NAME_POSITIONS = "Positions"; + @SerializedName(SERIALIZED_NAME_POSITIONS) + @javax.annotation.Nullable + private List<ProfilePositionsInner> positions; + + public static final String SERIALIZED_NAME_EDUCATIONS = "Educations"; + @SerializedName(SERIALIZED_NAME_EDUCATIONS) + @javax.annotation.Nullable + private List<ProfileEducationsInner> educations; + + public static final String SERIALIZED_NAME_PHONE_NUMBERS = "PhoneNumbers"; + @SerializedName(SERIALIZED_NAME_PHONE_NUMBERS) + @javax.annotation.Nullable + private List<ProfilePhoneNumbersInner> phoneNumbers; + + public static final String SERIALIZED_NAME_IM_ACCOUNTS = "IMAccounts"; + @SerializedName(SERIALIZED_NAME_IM_ACCOUNTS) + @javax.annotation.Nullable + private List<ProfileIMAccountsInner> imAccounts; + + public static final String SERIALIZED_NAME_ADDRESSES = "Addresses"; + @SerializedName(SERIALIZED_NAME_ADDRESSES) + @javax.annotation.Nullable + private List<ProfileAddressesInner> addresses; + + public static final String SERIALIZED_NAME_INTERESTS = "Interests"; + @SerializedName(SERIALIZED_NAME_INTERESTS) + @javax.annotation.Nullable + private List<ProfileInterestsInner> interests; + + public static final String SERIALIZED_NAME_SPORTS = "Sports"; + @SerializedName(SERIALIZED_NAME_SPORTS) + @javax.annotation.Nullable + private List<ProfileSportsInner> sports; + + public static final String SERIALIZED_NAME_INSPIRATIONAL_PEOPLE = "InspirationalPeople"; + @SerializedName(SERIALIZED_NAME_INSPIRATIONAL_PEOPLE) + @javax.annotation.Nullable + private List<ProfileInspirationalPeopleInner> inspirationalPeople; + + public static final String SERIALIZED_NAME_AWARDS = "Awards"; + @SerializedName(SERIALIZED_NAME_AWARDS) + @javax.annotation.Nullable + private List<ProfileAwardsInner> awards; + + public static final String SERIALIZED_NAME_SKILLS = "Skills"; + @SerializedName(SERIALIZED_NAME_SKILLS) + @javax.annotation.Nullable + private List<ProfileSkillsInner> skills; + + public static final String SERIALIZED_NAME_CURRENT_STATUS = "CurrentStatus"; + @SerializedName(SERIALIZED_NAME_CURRENT_STATUS) + @javax.annotation.Nullable + private List<ProfileCurrentStatusInner> currentStatus; + + public static final String SERIALIZED_NAME_CERTIFICATIONS = "Certifications"; + @SerializedName(SERIALIZED_NAME_CERTIFICATIONS) + @javax.annotation.Nullable + private List<ProfileCertificationsInner> certifications; + + public static final String SERIALIZED_NAME_COURSES = "Courses"; + @SerializedName(SERIALIZED_NAME_COURSES) + @javax.annotation.Nullable + private List<ProfileCoursesInner> courses; + + public static final String SERIALIZED_NAME_VOLUNTEER = "Volunteer"; + @SerializedName(SERIALIZED_NAME_VOLUNTEER) + @javax.annotation.Nullable + private List<ProfileVolunteerInner> volunteer; + + public static final String SERIALIZED_NAME_RECOMMENDATIONS_RECEIVED = "RecommendationsReceived"; + @SerializedName(SERIALIZED_NAME_RECOMMENDATIONS_RECEIVED) + @javax.annotation.Nullable + private List<ProfileRecommendationsReceivedInner> recommendationsReceived; + + public static final String SERIALIZED_NAME_LANGUAGES = "Languages"; + @SerializedName(SERIALIZED_NAME_LANGUAGES) + @javax.annotation.Nullable + private List<ProfileLanguagesInner> languages; + + public static final String SERIALIZED_NAME_PROJECTS = "Projects"; + @SerializedName(SERIALIZED_NAME_PROJECTS) + @javax.annotation.Nullable + private List<ProfileProjectsInner> projects; + + public static final String SERIALIZED_NAME_GAMES = "Games"; + @SerializedName(SERIALIZED_NAME_GAMES) + @javax.annotation.Nullable + private List<ProfileGamesInner> games; + + public static final String SERIALIZED_NAME_FAMILY = "Family"; + @SerializedName(SERIALIZED_NAME_FAMILY) + @javax.annotation.Nullable + private List<ProfileFamilyInner> family; + + public static final String SERIALIZED_NAME_TELEVISION_SHOW = "TelevisionShow"; + @SerializedName(SERIALIZED_NAME_TELEVISION_SHOW) + @javax.annotation.Nullable + private List<ProfileTelevisionShowInner> televisionShow; + + public static final String SERIALIZED_NAME_MUTUAL_FRIENDS = "MutualFriends"; + @SerializedName(SERIALIZED_NAME_MUTUAL_FRIENDS) + @javax.annotation.Nullable + private List<ProfileMutualFriendsInner> mutualFriends; + + public static final String SERIALIZED_NAME_MOVIES = "Movies"; + @SerializedName(SERIALIZED_NAME_MOVIES) + @javax.annotation.Nullable + private List<ProfileMoviesInner> movies; + + public static final String SERIALIZED_NAME_BOOKS = "Books"; + @SerializedName(SERIALIZED_NAME_BOOKS) + @javax.annotation.Nullable + private List<ProfileBooksInner> books; + + public static final String SERIALIZED_NAME_PATENTS = "Patents"; + @SerializedName(SERIALIZED_NAME_PATENTS) + @javax.annotation.Nullable + private List<ProfilePatentsInner> patents; + + public static final String SERIALIZED_NAME_FAVORITE_THINGS = "FavoriteThings"; + @SerializedName(SERIALIZED_NAME_FAVORITE_THINGS) + @javax.annotation.Nullable + private List<ProfileFavoriteThingsInner> favoriteThings; + + public static final String SERIALIZED_NAME_RELATED_PROFILE_VIEWS = "RelatedProfileViews"; + @SerializedName(SERIALIZED_NAME_RELATED_PROFILE_VIEWS) + @javax.annotation.Nullable + private List<ProfileRelatedProfileViewsInner> relatedProfileViews; + + public static final String SERIALIZED_NAME_PLACES_LIVED = "PlacesLived"; + @SerializedName(SERIALIZED_NAME_PLACES_LIVED) + @javax.annotation.Nullable + private List<ProfilePlacesLivedInner> placesLived; + + public static final String SERIALIZED_NAME_PUBLICATIONS = "Publications"; + @SerializedName(SERIALIZED_NAME_PUBLICATIONS) + @javax.annotation.Nullable + private List<ProfilePublicationsInner> publications; + + public static final String SERIALIZED_NAME_JOB_BOOKMARKS = "JobBookmarks"; + @SerializedName(SERIALIZED_NAME_JOB_BOOKMARKS) + @javax.annotation.Nullable + private List<ProfileJobBookmarksInner> jobBookmarks; + + public static final String SERIALIZED_NAME_BADGES = "Badges"; + @SerializedName(SERIALIZED_NAME_BADGES) + @javax.annotation.Nullable + private List<ProfileBadgesInner> badges; + + public static final String SERIALIZED_NAME_MEMBER_URL_RESOURCES = "MemberUrlResources"; + @SerializedName(SERIALIZED_NAME_MEMBER_URL_RESOURCES) + @javax.annotation.Nullable + private List<ProfileMemberUrlResourcesInner> memberUrlResources; + + public static final String SERIALIZED_NAME_ORGANIZATIONS = "Organizations"; + @SerializedName(SERIALIZED_NAME_ORGANIZATIONS) + @javax.annotation.Nullable + private List<ProfileOrganizationsInner> organizations; + + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private List<ProfileEmailInner> email; + + public static final String SERIALIZED_NAME_PASSKEY_LOGIN = "PasskeyLogin"; + @SerializedName(SERIALIZED_NAME_PASSKEY_LOGIN) + @javax.annotation.Nullable + private ProfilePasskeyLogin passkeyLogin; + + public static final String SERIALIZED_NAME_IDENTITIES = "Identities"; + @SerializedName(SERIALIZED_NAME_IDENTITIES) + @javax.annotation.Nullable + private List<SocialIdentity> identities; + + public Profile() { + } + + public Profile isPasswordBreached(@javax.annotation.Nullable Boolean isPasswordBreached) { + this.isPasswordBreached = isPasswordBreached; + return this; + } + + /** + * Indicates if the Password has been breached. + * @return isPasswordBreached + */ + @javax.annotation.Nullable + public Boolean getIsPasswordBreached() { + return isPasswordBreached; + } + + public void setIsPasswordBreached(@javax.annotation.Nullable Boolean isPasswordBreached) { + this.isPasswordBreached = isPasswordBreached; + } + + + public Profile isActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Indicates if the User Account is active. + * @return isActive + */ + @javax.annotation.Nullable + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + } + + + public Profile isDeleted(@javax.annotation.Nullable Boolean isDeleted) { + this.isDeleted = isDeleted; + return this; + } + + /** + * Indicates if the User Account is deleted. + * @return isDeleted + */ + @javax.annotation.Nullable + public Boolean getIsDeleted() { + return isDeleted; + } + + public void setIsDeleted(@javax.annotation.Nullable Boolean isDeleted) { + this.isDeleted = isDeleted; + } + + + public Profile emailVerified(@javax.annotation.Nullable Boolean emailVerified) { + this.emailVerified = emailVerified; + return this; + } + + /** + * Indicates if the User's Email is verified. + * @return emailVerified + */ + @javax.annotation.Nullable + public Boolean getEmailVerified() { + return emailVerified; + } + + public void setEmailVerified(@javax.annotation.Nullable Boolean emailVerified) { + this.emailVerified = emailVerified; + } + + + public Profile isLoginLocked(@javax.annotation.Nullable Boolean isLoginLocked) { + this.isLoginLocked = isLoginLocked; + return this; + } + + /** + * Indicates if the User's login is locked. + * @return isLoginLocked + */ + @javax.annotation.Nullable + public Boolean getIsLoginLocked() { + return isLoginLocked; + } + + public void setIsLoginLocked(@javax.annotation.Nullable Boolean isLoginLocked) { + this.isLoginLocked = isLoginLocked; + } + + + public Profile isRequiredFieldsFilledOnce(@javax.annotation.Nullable Boolean isRequiredFieldsFilledOnce) { + this.isRequiredFieldsFilledOnce = isRequiredFieldsFilledOnce; + return this; + } + + /** + * Indicates if required fields have been filled at least once. + * @return isRequiredFieldsFilledOnce + */ + @javax.annotation.Nullable + public Boolean getIsRequiredFieldsFilledOnce() { + return isRequiredFieldsFilledOnce; + } + + public void setIsRequiredFieldsFilledOnce(@javax.annotation.Nullable Boolean isRequiredFieldsFilledOnce) { + this.isRequiredFieldsFilledOnce = isRequiredFieldsFilledOnce; + } + + + public Profile firstLogin(@javax.annotation.Nullable Boolean firstLogin) { + this.firstLogin = firstLogin; + return this; + } + + /** + * Indicates if this is the User's first login. + * @return firstLogin + */ + @javax.annotation.Nullable + public Boolean getFirstLogin() { + return firstLogin; + } + + public void setFirstLogin(@javax.annotation.Nullable Boolean firstLogin) { + this.firstLogin = firstLogin; + } + + + public Profile isProtected(@javax.annotation.Nullable Boolean isProtected) { + this.isProtected = isProtected; + return this; + } + + /** + * Indicates if the User Account is protected. + * @return isProtected + */ + @javax.annotation.Nullable + public Boolean getIsProtected() { + return isProtected; + } + + public void setIsProtected(@javax.annotation.Nullable Boolean isProtected) { + this.isProtected = isProtected; + } + + + public Profile hireable(@javax.annotation.Nullable Boolean hireable) { + this.hireable = hireable; + return this; + } + + /** + * Indicates if the User is hireable. + * @return hireable + */ + @javax.annotation.Nullable + public Boolean getHireable() { + return hireable; + } + + public void setHireable(@javax.annotation.Nullable Boolean hireable) { + this.hireable = hireable; + } + + + public Profile isSecurePassword(@javax.annotation.Nullable Boolean isSecurePassword) { + this.isSecurePassword = isSecurePassword; + return this; + } + + /** + * Indicates if the Password is secure. + * @return isSecurePassword + */ + @javax.annotation.Nullable + public Boolean getIsSecurePassword() { + return isSecurePassword; + } + + public void setIsSecurePassword(@javax.annotation.Nullable Boolean isSecurePassword) { + this.isSecurePassword = isSecurePassword; + } + + + public Profile isCustomUid(@javax.annotation.Nullable Boolean isCustomUid) { + this.isCustomUid = isCustomUid; + return this; + } + + /** + * Indicates if the UID is custom. + * @return isCustomUid + */ + @javax.annotation.Nullable + public Boolean getIsCustomUid() { + return isCustomUid; + } + + public void setIsCustomUid(@javax.annotation.Nullable Boolean isCustomUid) { + this.isCustomUid = isCustomUid; + } + + + public Profile phoneIdVerified(@javax.annotation.Nullable Boolean phoneIdVerified) { + this.phoneIdVerified = phoneIdVerified; + return this; + } + + /** + * Indicates if the Phone ID is verified. + * @return phoneIdVerified + */ + @javax.annotation.Nullable + public Boolean getPhoneIdVerified() { + return phoneIdVerified; + } + + public void setPhoneIdVerified(@javax.annotation.Nullable Boolean phoneIdVerified) { + this.phoneIdVerified = phoneIdVerified; + } + + + public Profile isEmailSubscribed(@javax.annotation.Nullable Boolean isEmailSubscribed) { + this.isEmailSubscribed = isEmailSubscribed; + return this; + } + + /** + * Indicates if the User is subscribed to emails. + * @return isEmailSubscribed + */ + @javax.annotation.Nullable + public Boolean getIsEmailSubscribed() { + return isEmailSubscribed; + } + + public void setIsEmailSubscribed(@javax.annotation.Nullable Boolean isEmailSubscribed) { + this.isEmailSubscribed = isEmailSubscribed; + } + + + public Profile noOfLogins(@javax.annotation.Nullable Integer noOfLogins) { + this.noOfLogins = noOfLogins; + return this; + } + + /** + * Number of logins by the User. + * @return noOfLogins + */ + @javax.annotation.Nullable + public Integer getNoOfLogins() { + return noOfLogins; + } + + public void setNoOfLogins(@javax.annotation.Nullable Integer noOfLogins) { + this.noOfLogins = noOfLogins; + } + + + public Profile followersCount(@javax.annotation.Nullable Integer followersCount) { + this.followersCount = followersCount; + return this; + } + + /** + * Number of followers the User has. + * @return followersCount + */ + @javax.annotation.Nullable + public Integer getFollowersCount() { + return followersCount; + } + + public void setFollowersCount(@javax.annotation.Nullable Integer followersCount) { + this.followersCount = followersCount; + } + + + public Profile friendsCount(@javax.annotation.Nullable Integer friendsCount) { + this.friendsCount = friendsCount; + return this; + } + + /** + * Number of friends the User has. + * @return friendsCount + */ + @javax.annotation.Nullable + public Integer getFriendsCount() { + return friendsCount; + } + + public void setFriendsCount(@javax.annotation.Nullable Integer friendsCount) { + this.friendsCount = friendsCount; + } + + + public Profile totalStatusesCount(@javax.annotation.Nullable Integer totalStatusesCount) { + this.totalStatusesCount = totalStatusesCount; + return this; + } + + /** + * Total number of statuses posted by the User. + * @return totalStatusesCount + */ + @javax.annotation.Nullable + public Integer getTotalStatusesCount() { + return totalStatusesCount; + } + + public void setTotalStatusesCount(@javax.annotation.Nullable Integer totalStatusesCount) { + this.totalStatusesCount = totalStatusesCount; + } + + + public Profile numRecommenders(@javax.annotation.Nullable Integer numRecommenders) { + this.numRecommenders = numRecommenders; + return this; + } + + /** + * Number of recommenders for the User. + * @return numRecommenders + */ + @javax.annotation.Nullable + public Integer getNumRecommenders() { + return numRecommenders; + } + + public void setNumRecommenders(@javax.annotation.Nullable Integer numRecommenders) { + this.numRecommenders = numRecommenders; + } + + + public Profile totalPrivateRepository(@javax.annotation.Nullable Integer totalPrivateRepository) { + this.totalPrivateRepository = totalPrivateRepository; + return this; + } + + /** + * Total number of private repositories. + * @return totalPrivateRepository + */ + @javax.annotation.Nullable + public Integer getTotalPrivateRepository() { + return totalPrivateRepository; + } + + public void setTotalPrivateRepository(@javax.annotation.Nullable Integer totalPrivateRepository) { + this.totalPrivateRepository = totalPrivateRepository; + } + + + public Profile publicGists(@javax.annotation.Nullable Integer publicGists) { + this.publicGists = publicGists; + return this; + } + + /** + * Total number of public gists. + * @return publicGists + */ + @javax.annotation.Nullable + public Integer getPublicGists() { + return publicGists; + } + + public void setPublicGists(@javax.annotation.Nullable Integer publicGists) { + this.publicGists = publicGists; + } + + + public Profile privateGists(@javax.annotation.Nullable Integer privateGists) { + this.privateGists = privateGists; + return this; + } + + /** + * Total number of private gists. + * @return privateGists + */ + @javax.annotation.Nullable + public Integer getPrivateGists() { + return privateGists; + } + + public void setPrivateGists(@javax.annotation.Nullable Integer privateGists) { + this.privateGists = privateGists; + } + + + public Profile pinsCount(@javax.annotation.Nullable Integer pinsCount) { + this.pinsCount = pinsCount; + return this; + } + + /** + * Total number of PINs. + * @return pinsCount + */ + @javax.annotation.Nullable + public Integer getPinsCount() { + return pinsCount; + } + + public void setPinsCount(@javax.annotation.Nullable Integer pinsCount) { + this.pinsCount = pinsCount; + } + + + public Profile boardsCount(@javax.annotation.Nullable Integer boardsCount) { + this.boardsCount = boardsCount; + return this; + } + + /** + * Total number of boards. + * @return boardsCount + */ + @javax.annotation.Nullable + public Integer getBoardsCount() { + return boardsCount; + } + + public void setBoardsCount(@javax.annotation.Nullable Integer boardsCount) { + this.boardsCount = boardsCount; + } + + + public Profile likesCount(@javax.annotation.Nullable Integer likesCount) { + this.likesCount = likesCount; + return this; + } + + /** + * Total number of likes. + * @return likesCount + */ + @javax.annotation.Nullable + public Integer getLikesCount() { + return likesCount; + } + + public void setLikesCount(@javax.annotation.Nullable Integer likesCount) { + this.likesCount = likesCount; + } + + + public Profile sessionLimit(@javax.annotation.Nullable Integer sessionLimit) { + this.sessionLimit = sessionLimit; + return this; + } + + /** + * Get sessionLimit + * @return sessionLimit + */ + @javax.annotation.Nullable + public Integer getSessionLimit() { + return sessionLimit; + } + + public void setSessionLimit(@javax.annotation.Nullable Integer sessionLimit) { + this.sessionLimit = sessionLimit; + } + + + public Profile ID(@javax.annotation.Nullable String ID) { + this.ID = ID; + return this; + } + + /** + * Unique identifier for the User Profile. + * @return ID + */ + @javax.annotation.Nullable + public String getID() { + return ID; + } + + public void setID(@javax.annotation.Nullable String ID) { + this.ID = ID; + } + + + public Profile password(@javax.annotation.Nullable String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + @javax.annotation.Nullable + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nullable String password) { + this.password = password; + } + + + public Profile loginLockedType(@javax.annotation.Nullable String loginLockedType) { + this.loginLockedType = loginLockedType; + return this; + } + + /** + * Get loginLockedType + * @return loginLockedType + */ + @javax.annotation.Nullable + public String getLoginLockedType() { + return loginLockedType; + } + + public void setLoginLockedType(@javax.annotation.Nullable String loginLockedType) { + this.loginLockedType = loginLockedType; + } + + + public Profile provider(@javax.annotation.Nullable String provider) { + this.provider = provider; + return this; + } + + /** + * Provider of the User Profile. + * @return provider + */ + @javax.annotation.Nullable + public String getProvider() { + return provider; + } + + public void setProvider(@javax.annotation.Nullable String provider) { + this.provider = provider; + } + + + public Profile lastPasswordChangeToken(@javax.annotation.Nullable String lastPasswordChangeToken) { + this.lastPasswordChangeToken = lastPasswordChangeToken; + return this; + } + + /** + * Get lastPasswordChangeToken + * @return lastPasswordChangeToken + */ + @javax.annotation.Nullable + public String getLastPasswordChangeToken() { + return lastPasswordChangeToken; + } + + public void setLastPasswordChangeToken(@javax.annotation.Nullable String lastPasswordChangeToken) { + this.lastPasswordChangeToken = lastPasswordChangeToken; + } + + + public Profile fullName(@javax.annotation.Nullable String fullName) { + this.fullName = fullName; + return this; + } + + /** + * Full name of the User. + * @return fullName + */ + @javax.annotation.Nullable + public String getFullName() { + return fullName; + } + + public void setFullName(@javax.annotation.Nullable String fullName) { + this.fullName = fullName; + } + + + public Profile firstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * First name of the User. + * @return firstName + */ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + } + + + public Profile lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Last name of the User. + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + + public Profile registrationProvider(@javax.annotation.Nullable String registrationProvider) { + this.registrationProvider = registrationProvider; + return this; + } + + /** + * Get registrationProvider + * @return registrationProvider + */ + @javax.annotation.Nullable + public String getRegistrationProvider() { + return registrationProvider; + } + + public void setRegistrationProvider(@javax.annotation.Nullable String registrationProvider) { + this.registrationProvider = registrationProvider; + } + + + public Profile registrationSource(@javax.annotation.Nullable String registrationSource) { + this.registrationSource = registrationSource; + return this; + } + + /** + * Get registrationSource + * @return registrationSource + */ + @javax.annotation.Nullable + public String getRegistrationSource() { + return registrationSource; + } + + public void setRegistrationSource(@javax.annotation.Nullable String registrationSource) { + this.registrationSource = registrationSource; + } + + + public Profile lastLoginLocation(@javax.annotation.Nullable String lastLoginLocation) { + this.lastLoginLocation = lastLoginLocation; + return this; + } + + /** + * Get lastLoginLocation + * @return lastLoginLocation + */ + @javax.annotation.Nullable + public String getLastLoginLocation() { + return lastLoginLocation; + } + + public void setLastLoginLocation(@javax.annotation.Nullable String lastLoginLocation) { + this.lastLoginLocation = lastLoginLocation; + } + + + public Profile externalUserLoginId(@javax.annotation.Nullable String externalUserLoginId) { + this.externalUserLoginId = externalUserLoginId; + return this; + } + + /** + * Get externalUserLoginId + * @return externalUserLoginId + */ + @javax.annotation.Nullable + public String getExternalUserLoginId() { + return externalUserLoginId; + } + + public void setExternalUserLoginId(@javax.annotation.Nullable String externalUserLoginId) { + this.externalUserLoginId = externalUserLoginId; + } + + + public Profile phoneId(@javax.annotation.Nullable String phoneId) { + this.phoneId = phoneId; + return this; + } + + /** + * Phone ID of the User. + * @return phoneId + */ + @javax.annotation.Nullable + public String getPhoneId() { + return phoneId; + } + + public void setPhoneId(@javax.annotation.Nullable String phoneId) { + this.phoneId = phoneId; + } + + + public Profile userName(@javax.annotation.Nullable String userName) { + this.userName = userName; + return this; + } + + /** + * The Username of the User. + * @return userName + */ + @javax.annotation.Nullable + public String getUserName() { + return userName; + } + + public void setUserName(@javax.annotation.Nullable String userName) { + this.userName = userName; + } + + + public Profile prefix(@javax.annotation.Nullable String prefix) { + this.prefix = prefix; + return this; + } + + /** + * The prefix for the User's name. + * @return prefix + */ + @javax.annotation.Nullable + public String getPrefix() { + return prefix; + } + + public void setPrefix(@javax.annotation.Nullable String prefix) { + this.prefix = prefix; + } + + + public Profile middleName(@javax.annotation.Nullable String middleName) { + this.middleName = middleName; + return this; + } + + /** + * The middle name of the User. + * @return middleName + */ + @javax.annotation.Nullable + public String getMiddleName() { + return middleName; + } + + public void setMiddleName(@javax.annotation.Nullable String middleName) { + this.middleName = middleName; + } + + + public Profile suffix(@javax.annotation.Nullable String suffix) { + this.suffix = suffix; + return this; + } + + /** + * The suffix for the User's name. + * @return suffix + */ + @javax.annotation.Nullable + public String getSuffix() { + return suffix; + } + + public void setSuffix(@javax.annotation.Nullable String suffix) { + this.suffix = suffix; + } + + + public Profile nickName(@javax.annotation.Nullable String nickName) { + this.nickName = nickName; + return this; + } + + /** + * The nickname of the User. + * @return nickName + */ + @javax.annotation.Nullable + public String getNickName() { + return nickName; + } + + public void setNickName(@javax.annotation.Nullable String nickName) { + this.nickName = nickName; + } + + + public Profile profileName(@javax.annotation.Nullable String profileName) { + this.profileName = profileName; + return this; + } + + /** + * The profile name of the User. + * @return profileName + */ + @javax.annotation.Nullable + public String getProfileName() { + return profileName; + } + + public void setProfileName(@javax.annotation.Nullable String profileName) { + this.profileName = profileName; + } + + + public Profile birthDate(@javax.annotation.Nullable String birthDate) { + this.birthDate = birthDate; + return this; + } + + /** + * The birth date of the User. + * @return birthDate + */ + @javax.annotation.Nullable + public String getBirthDate() { + return birthDate; + } + + public void setBirthDate(@javax.annotation.Nullable String birthDate) { + this.birthDate = birthDate; + } + + + public Profile gender(@javax.annotation.Nullable String gender) { + this.gender = gender; + return this; + } + + /** + * The gender of the User. + * @return gender + */ + @javax.annotation.Nullable + public String getGender() { + return gender; + } + + public void setGender(@javax.annotation.Nullable String gender) { + this.gender = gender; + } + + + public Profile website(@javax.annotation.Nullable String website) { + this.website = website; + return this; + } + + /** + * The website of the User. + * @return website + */ + @javax.annotation.Nullable + public String getWebsite() { + return website; + } + + public void setWebsite(@javax.annotation.Nullable String website) { + this.website = website; + } + + + public Profile thumbnailImageUrl(@javax.annotation.Nullable String thumbnailImageUrl) { + this.thumbnailImageUrl = thumbnailImageUrl; + return this; + } + + /** + * The URL of the User's thumbnail image. + * @return thumbnailImageUrl + */ + @javax.annotation.Nullable + public String getThumbnailImageUrl() { + return thumbnailImageUrl; + } + + public void setThumbnailImageUrl(@javax.annotation.Nullable String thumbnailImageUrl) { + this.thumbnailImageUrl = thumbnailImageUrl; + } + + + public Profile imageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** + * The URL of the User's profile image. + * @return imageUrl + */ + @javax.annotation.Nullable + public String getImageUrl() { + return imageUrl; + } + + public void setImageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + } + + + public Profile favicon(@javax.annotation.Nullable String favicon) { + this.favicon = favicon; + return this; + } + + /** + * The URL of the User's favicon. + * @return favicon + */ + @javax.annotation.Nullable + public String getFavicon() { + return favicon; + } + + public void setFavicon(@javax.annotation.Nullable String favicon) { + this.favicon = favicon; + } + + + public Profile profileUrl(@javax.annotation.Nullable String profileUrl) { + this.profileUrl = profileUrl; + return this; + } + + /** + * The URL of the User's profile. + * @return profileUrl + */ + @javax.annotation.Nullable + public String getProfileUrl() { + return profileUrl; + } + + public void setProfileUrl(@javax.annotation.Nullable String profileUrl) { + this.profileUrl = profileUrl; + } + + + public Profile homeTown(@javax.annotation.Nullable String homeTown) { + this.homeTown = homeTown; + return this; + } + + /** + * The hometown of the User. + * @return homeTown + */ + @javax.annotation.Nullable + public String getHomeTown() { + return homeTown; + } + + public void setHomeTown(@javax.annotation.Nullable String homeTown) { + this.homeTown = homeTown; + } + + + public Profile state(@javax.annotation.Nullable String state) { + this.state = state; + return this; + } + + /** + * The state of the User. + * @return state + */ + @javax.annotation.Nullable + public String getState() { + return state; + } + + public void setState(@javax.annotation.Nullable String state) { + this.state = state; + } + + + public Profile city(@javax.annotation.Nullable String city) { + this.city = city; + return this; + } + + /** + * The city of the User. + * @return city + */ + @javax.annotation.Nullable + public String getCity() { + return city; + } + + public void setCity(@javax.annotation.Nullable String city) { + this.city = city; + } + + + public Profile industry(@javax.annotation.Nullable String industry) { + this.industry = industry; + return this; + } + + /** + * The industry of the User. + * @return industry + */ + @javax.annotation.Nullable + public String getIndustry() { + return industry; + } + + public void setIndustry(@javax.annotation.Nullable String industry) { + this.industry = industry; + } + + + public Profile about(@javax.annotation.Nullable String about) { + this.about = about; + return this; + } + + /** + * A brief description about the User. + * @return about + */ + @javax.annotation.Nullable + public String getAbout() { + return about; + } + + public void setAbout(@javax.annotation.Nullable String about) { + this.about = about; + } + + + public Profile timeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * The time zone of the User. + * @return timeZone + */ + @javax.annotation.Nullable + public String getTimeZone() { + return timeZone; + } + + public void setTimeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + } + + + public Profile localLanguage(@javax.annotation.Nullable String localLanguage) { + this.localLanguage = localLanguage; + return this; + } + + /** + * The local language of the User. + * @return localLanguage + */ + @javax.annotation.Nullable + public String getLocalLanguage() { + return localLanguage; + } + + public void setLocalLanguage(@javax.annotation.Nullable String localLanguage) { + this.localLanguage = localLanguage; + } + + + public Profile coverPhoto(@javax.annotation.Nullable String coverPhoto) { + this.coverPhoto = coverPhoto; + return this; + } + + /** + * The URL of the User's cover photo. + * @return coverPhoto + */ + @javax.annotation.Nullable + public String getCoverPhoto() { + return coverPhoto; + } + + public void setCoverPhoto(@javax.annotation.Nullable String coverPhoto) { + this.coverPhoto = coverPhoto; + } + + + public Profile tagLine(@javax.annotation.Nullable String tagLine) { + this.tagLine = tagLine; + return this; + } + + /** + * The tagline of the User. + * @return tagLine + */ + @javax.annotation.Nullable + public String getTagLine() { + return tagLine; + } + + public void setTagLine(@javax.annotation.Nullable String tagLine) { + this.tagLine = tagLine; + } + + + public Profile language(@javax.annotation.Nullable String language) { + this.language = language; + return this; + } + + /** + * The language of the User. + * @return language + */ + @javax.annotation.Nullable + public String getLanguage() { + return language; + } + + public void setLanguage(@javax.annotation.Nullable String language) { + this.language = language; + } + + + public Profile verified(@javax.annotation.Nullable String verified) { + this.verified = verified; + return this; + } + + /** + * Indicates if the User is verified. + * @return verified + */ + @javax.annotation.Nullable + public String getVerified() { + return verified; + } + + public void setVerified(@javax.annotation.Nullable String verified) { + this.verified = verified; + } + + + public Profile updatedTime(@javax.annotation.Nullable String updatedTime) { + this.updatedTime = updatedTime; + return this; + } + + /** + * The last updated time of the User's profile. + * @return updatedTime + */ + @javax.annotation.Nullable + public String getUpdatedTime() { + return updatedTime; + } + + public void setUpdatedTime(@javax.annotation.Nullable String updatedTime) { + this.updatedTime = updatedTime; + } + + + public Profile isGeoEnabled(@javax.annotation.Nullable String isGeoEnabled) { + this.isGeoEnabled = isGeoEnabled; + return this; + } + + /** + * Indicates if geolocation is enabled for the User. + * @return isGeoEnabled + */ + @javax.annotation.Nullable + public String getIsGeoEnabled() { + return isGeoEnabled; + } + + public void setIsGeoEnabled(@javax.annotation.Nullable String isGeoEnabled) { + this.isGeoEnabled = isGeoEnabled; + } + + + public Profile associations(@javax.annotation.Nullable String associations) { + this.associations = associations; + return this; + } + + /** + * The associations of the User. + * @return associations + */ + @javax.annotation.Nullable + public String getAssociations() { + return associations; + } + + public void setAssociations(@javax.annotation.Nullable String associations) { + this.associations = associations; + } + + + public Profile honors(@javax.annotation.Nullable String honors) { + this.honors = honors; + return this; + } + + /** + * The honors received by the User. + * @return honors + */ + @javax.annotation.Nullable + public String getHonors() { + return honors; + } + + public void setHonors(@javax.annotation.Nullable String honors) { + this.honors = honors; + } + + + public Profile httpsImageUrl(@javax.annotation.Nullable String httpsImageUrl) { + this.httpsImageUrl = httpsImageUrl; + return this; + } + + /** + * The HTTPS URL of the User's profile image. + * @return httpsImageUrl + */ + @javax.annotation.Nullable + public String getHttpsImageUrl() { + return httpsImageUrl; + } + + public void setHttpsImageUrl(@javax.annotation.Nullable String httpsImageUrl) { + this.httpsImageUrl = httpsImageUrl; + } + + + public Profile mainAddress(@javax.annotation.Nullable String mainAddress) { + this.mainAddress = mainAddress; + return this; + } + + /** + * The main address of the User. + * @return mainAddress + */ + @javax.annotation.Nullable + public String getMainAddress() { + return mainAddress; + } + + public void setMainAddress(@javax.annotation.Nullable String mainAddress) { + this.mainAddress = mainAddress; + } + + + public Profile created(@javax.annotation.Nullable String created) { + this.created = created; + return this; + } + + /** + * The creation date of the User's account. + * @return created + */ + @javax.annotation.Nullable + public String getCreated() { + return created; + } + + public void setCreated(@javax.annotation.Nullable String created) { + this.created = created; + } + + + public Profile localCity(@javax.annotation.Nullable String localCity) { + this.localCity = localCity; + return this; + } + + /** + * The local city of the User. + * @return localCity + */ + @javax.annotation.Nullable + public String getLocalCity() { + return localCity; + } + + public void setLocalCity(@javax.annotation.Nullable String localCity) { + this.localCity = localCity; + } + + + public Profile profileCity(@javax.annotation.Nullable String profileCity) { + this.profileCity = profileCity; + return this; + } + + /** + * The profile city of the User. + * @return profileCity + */ + @javax.annotation.Nullable + public String getProfileCity() { + return profileCity; + } + + public void setProfileCity(@javax.annotation.Nullable String profileCity) { + this.profileCity = profileCity; + } + + + public Profile localCountry(@javax.annotation.Nullable String localCountry) { + this.localCountry = localCountry; + return this; + } + + /** + * The local country of the User. + * @return localCountry + */ + @javax.annotation.Nullable + public String getLocalCountry() { + return localCountry; + } + + public void setLocalCountry(@javax.annotation.Nullable String localCountry) { + this.localCountry = localCountry; + } + + + public Profile profileCountry(@javax.annotation.Nullable String profileCountry) { + this.profileCountry = profileCountry; + return this; + } + + /** + * The profile country of the User. + * @return profileCountry + */ + @javax.annotation.Nullable + public String getProfileCountry() { + return profileCountry; + } + + public void setProfileCountry(@javax.annotation.Nullable String profileCountry) { + this.profileCountry = profileCountry; + } + + + public Profile relationshipStatus(@javax.annotation.Nullable String relationshipStatus) { + this.relationshipStatus = relationshipStatus; + return this; + } + + /** + * The relationship status of the User. + * @return relationshipStatus + */ + @javax.annotation.Nullable + public String getRelationshipStatus() { + return relationshipStatus; + } + + public void setRelationshipStatus(@javax.annotation.Nullable String relationshipStatus) { + this.relationshipStatus = relationshipStatus; + } + + + public Profile quota(@javax.annotation.Nullable String quota) { + this.quota = quota; + return this; + } + + /** + * The quota assigned to the User. + * @return quota + */ + @javax.annotation.Nullable + public String getQuota() { + return quota; + } + + public void setQuota(@javax.annotation.Nullable String quota) { + this.quota = quota; + } + + + public Profile quote(@javax.annotation.Nullable String quote) { + this.quote = quote; + return this; + } + + /** + * A quote associated with the User. + * @return quote + */ + @javax.annotation.Nullable + public String getQuote() { + return quote; + } + + public void setQuote(@javax.annotation.Nullable String quote) { + this.quote = quote; + } + + + public Profile religion(@javax.annotation.Nullable String religion) { + this.religion = religion; + return this; + } + + /** + * The religion of the User. + * @return religion + */ + @javax.annotation.Nullable + public String getReligion() { + return religion; + } + + public void setReligion(@javax.annotation.Nullable String religion) { + this.religion = religion; + } + + + public Profile political(@javax.annotation.Nullable String political) { + this.political = political; + return this; + } + + /** + * The political views of the User. + * @return political + */ + @javax.annotation.Nullable + public String getPolitical() { + return political; + } + + public void setPolitical(@javax.annotation.Nullable String political) { + this.political = political; + } + + + public Profile publicRepository(@javax.annotation.Nullable String publicRepository) { + this.publicRepository = publicRepository; + return this; + } + + /** + * The number of public repositories owned by the User. + * @return publicRepository + */ + @javax.annotation.Nullable + public String getPublicRepository() { + return publicRepository; + } + + public void setPublicRepository(@javax.annotation.Nullable String publicRepository) { + this.publicRepository = publicRepository; + } + + + public Profile repositoryUrl(@javax.annotation.Nullable String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + return this; + } + + /** + * The URL of the User's repository. + * @return repositoryUrl + */ + @javax.annotation.Nullable + public String getRepositoryUrl() { + return repositoryUrl; + } + + public void setRepositoryUrl(@javax.annotation.Nullable String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + } + + + public Profile age(@javax.annotation.Nullable String age) { + this.age = age; + return this; + } + + /** + * The age of the User. + * @return age + */ + @javax.annotation.Nullable + public String getAge() { + return age; + } + + public void setAge(@javax.annotation.Nullable String age) { + this.age = age; + } + + + public Profile professionalHeadline(@javax.annotation.Nullable String professionalHeadline) { + this.professionalHeadline = professionalHeadline; + return this; + } + + /** + * The professional headline of the User. + * @return professionalHeadline + */ + @javax.annotation.Nullable + public String getProfessionalHeadline() { + return professionalHeadline; + } + + public void setProfessionalHeadline(@javax.annotation.Nullable String professionalHeadline) { + this.professionalHeadline = professionalHeadline; + } + + + public Profile lrUserID(@javax.annotation.Nullable String lrUserID) { + this.lrUserID = lrUserID; + return this; + } + + /** + * The LoginRadius User ID. + * @return lrUserID + */ + @javax.annotation.Nullable + public String getLrUserID() { + return lrUserID; + } + + public void setLrUserID(@javax.annotation.Nullable String lrUserID) { + this.lrUserID = lrUserID; + } + + + public Profile currency(@javax.annotation.Nullable String currency) { + this.currency = currency; + return this; + } + + /** + * The preferred currency of the User. + * @return currency + */ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + public void setCurrency(@javax.annotation.Nullable String currency) { + this.currency = currency; + } + + + public Profile starredUrl(@javax.annotation.Nullable String starredUrl) { + this.starredUrl = starredUrl; + return this; + } + + /** + * The URL of the User's starred items. + * @return starredUrl + */ + @javax.annotation.Nullable + public String getStarredUrl() { + return starredUrl; + } + + public void setStarredUrl(@javax.annotation.Nullable String starredUrl) { + this.starredUrl = starredUrl; + } + + + public Profile gistsUrl(@javax.annotation.Nullable String gistsUrl) { + this.gistsUrl = gistsUrl; + return this; + } + + /** + * The URL of the User's gists. + * @return gistsUrl + */ + @javax.annotation.Nullable + public String getGistsUrl() { + return gistsUrl; + } + + public void setGistsUrl(@javax.annotation.Nullable String gistsUrl) { + this.gistsUrl = gistsUrl; + } + + + public Profile company(@javax.annotation.Nullable String company) { + this.company = company; + return this; + } + + /** + * The company the User is associated with. + * @return company + */ + @javax.annotation.Nullable + public String getCompany() { + return company; + } + + public void setCompany(@javax.annotation.Nullable String company) { + this.company = company; + } + + + public Profile gravatarImageUrl(@javax.annotation.Nullable String gravatarImageUrl) { + this.gravatarImageUrl = gravatarImageUrl; + return this; + } + + /** + * The URL of the User's Gravatar image. + * @return gravatarImageUrl + */ + @javax.annotation.Nullable + public String getGravatarImageUrl() { + return gravatarImageUrl; + } + + public void setGravatarImageUrl(@javax.annotation.Nullable String gravatarImageUrl) { + this.gravatarImageUrl = gravatarImageUrl; + } + + + public Profile lastPasswordChangeDate(@javax.annotation.Nullable OffsetDateTime lastPasswordChangeDate) { + this.lastPasswordChangeDate = lastPasswordChangeDate; + return this; + } + + /** + * The date of the last Password change. + * @return lastPasswordChangeDate + */ + @javax.annotation.Nullable + public OffsetDateTime getLastPasswordChangeDate() { + return lastPasswordChangeDate; + } + + public void setLastPasswordChangeDate(@javax.annotation.Nullable OffsetDateTime lastPasswordChangeDate) { + this.lastPasswordChangeDate = lastPasswordChangeDate; + } + + + public Profile passwordExpirationDate(@javax.annotation.Nullable OffsetDateTime passwordExpirationDate) { + this.passwordExpirationDate = passwordExpirationDate; + return this; + } + + /** + * The expiration date of the Password. + * @return passwordExpirationDate + */ + @javax.annotation.Nullable + public OffsetDateTime getPasswordExpirationDate() { + return passwordExpirationDate; + } + + public void setPasswordExpirationDate(@javax.annotation.Nullable OffsetDateTime passwordExpirationDate) { + this.passwordExpirationDate = passwordExpirationDate; + } + + + public Profile createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * The date the Account was created. + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + + public Profile modifiedDate(@javax.annotation.Nullable OffsetDateTime modifiedDate) { + this.modifiedDate = modifiedDate; + return this; + } + + /** + * The date the Account was last modified. + * @return modifiedDate + */ + @javax.annotation.Nullable + public OffsetDateTime getModifiedDate() { + return modifiedDate; + } + + public void setModifiedDate(@javax.annotation.Nullable OffsetDateTime modifiedDate) { + this.modifiedDate = modifiedDate; + } + + + public Profile profileModifiedDate(@javax.annotation.Nullable OffsetDateTime profileModifiedDate) { + this.profileModifiedDate = profileModifiedDate; + return this; + } + + /** + * The date the Profile was last modified. + * @return profileModifiedDate + */ + @javax.annotation.Nullable + public OffsetDateTime getProfileModifiedDate() { + return profileModifiedDate; + } + + public void setProfileModifiedDate(@javax.annotation.Nullable OffsetDateTime profileModifiedDate) { + this.profileModifiedDate = profileModifiedDate; + } + + + public Profile lastLoginDate(@javax.annotation.Nullable OffsetDateTime lastLoginDate) { + this.lastLoginDate = lastLoginDate; + return this; + } + + /** + * The date of the last login. + * @return lastLoginDate + */ + @javax.annotation.Nullable + public OffsetDateTime getLastLoginDate() { + return lastLoginDate; + } + + public void setLastLoginDate(@javax.annotation.Nullable OffsetDateTime lastLoginDate) { + this.lastLoginDate = lastLoginDate; + } + + + public Profile signupDate(@javax.annotation.Nullable OffsetDateTime signupDate) { + this.signupDate = signupDate; + return this; + } + + /** + * The date the User signed up. + * @return signupDate + */ + @javax.annotation.Nullable + public OffsetDateTime getSignupDate() { + return signupDate; + } + + public void setSignupDate(@javax.annotation.Nullable OffsetDateTime signupDate) { + this.signupDate = signupDate; + } + + + public Profile privacyPolicy(@javax.annotation.Nullable ProfilePrivacyPolicy privacyPolicy) { + this.privacyPolicy = privacyPolicy; + return this; + } + + /** + * Get privacyPolicy + * @return privacyPolicy + */ + @javax.annotation.Nullable + public ProfilePrivacyPolicy getPrivacyPolicy() { + return privacyPolicy; + } + + public void setPrivacyPolicy(@javax.annotation.Nullable ProfilePrivacyPolicy privacyPolicy) { + this.privacyPolicy = privacyPolicy; + } + + + public Profile country(@javax.annotation.Nullable ProfileCountry country) { + this.country = country; + return this; + } + + /** + * Get country + * @return country + */ + @javax.annotation.Nullable + public ProfileCountry getCountry() { + return country; + } + + public void setCountry(@javax.annotation.Nullable ProfileCountry country) { + this.country = country; + } + + + public Profile ageRange(@javax.annotation.Nullable ProfileAgeRange ageRange) { + this.ageRange = ageRange; + return this; + } + + /** + * Get ageRange + * @return ageRange + */ + @javax.annotation.Nullable + public ProfileAgeRange getAgeRange() { + return ageRange; + } + + public void setAgeRange(@javax.annotation.Nullable ProfileAgeRange ageRange) { + this.ageRange = ageRange; + } + + + public Profile kloutScore(@javax.annotation.Nullable ProfileKloutScore kloutScore) { + this.kloutScore = kloutScore; + return this; + } + + /** + * Get kloutScore + * @return kloutScore + */ + @javax.annotation.Nullable + public ProfileKloutScore getKloutScore() { + return kloutScore; + } + + public void setKloutScore(@javax.annotation.Nullable ProfileKloutScore kloutScore) { + this.kloutScore = kloutScore; + } + + + public Profile suggestions(@javax.annotation.Nullable ProfileSuggestions suggestions) { + this.suggestions = suggestions; + return this; + } + + /** + * Get suggestions + * @return suggestions + */ + @javax.annotation.Nullable + public ProfileSuggestions getSuggestions() { + return suggestions; + } + + public void setSuggestions(@javax.annotation.Nullable ProfileSuggestions suggestions) { + this.suggestions = suggestions; + } + + + public Profile subscription(@javax.annotation.Nullable ProfileSubscription subscription) { + this.subscription = subscription; + return this; + } + + /** + * Get subscription + * @return subscription + */ + @javax.annotation.Nullable + public ProfileSubscription getSubscription() { + return subscription; + } + + public void setSubscription(@javax.annotation.Nullable ProfileSubscription subscription) { + this.subscription = subscription; + } + + + public Profile PIN(@javax.annotation.Nullable ProfilePIN PIN) { + this.PIN = PIN; + return this; + } + + /** + * Get PIN + * @return PIN + */ + @javax.annotation.Nullable + public ProfilePIN getPIN() { + return PIN; + } + + public void setPIN(@javax.annotation.Nullable ProfilePIN PIN) { + this.PIN = PIN; + } + + + public Profile consentProfile(@javax.annotation.Nullable ProfileConsentProfile consentProfile) { + this.consentProfile = consentProfile; + return this; + } + + /** + * Get consentProfile + * @return consentProfile + */ + @javax.annotation.Nullable + public ProfileConsentProfile getConsentProfile() { + return consentProfile; + } + + public void setConsentProfile(@javax.annotation.Nullable ProfileConsentProfile consentProfile) { + this.consentProfile = consentProfile; + } + + + public Profile registrationData(@javax.annotation.Nullable ProfileRegistrationData registrationData) { + this.registrationData = registrationData; + return this; + } + + /** + * Get registrationData + * @return registrationData + */ + @javax.annotation.Nullable + public ProfileRegistrationData getRegistrationData() { + return registrationData; + } + + public void setRegistrationData(@javax.annotation.Nullable ProfileRegistrationData registrationData) { + this.registrationData = registrationData; + } + + + public Profile providerAccessCredential(@javax.annotation.Nullable ProfileProviderAccessCredential providerAccessCredential) { + this.providerAccessCredential = providerAccessCredential; + return this; + } + + /** + * Get providerAccessCredential + * @return providerAccessCredential + */ + @javax.annotation.Nullable + public ProfileProviderAccessCredential getProviderAccessCredential() { + return providerAccessCredential; + } + + public void setProviderAccessCredential(@javax.annotation.Nullable ProfileProviderAccessCredential providerAccessCredential) { + this.providerAccessCredential = providerAccessCredential; + } + + + public Profile customFields(@javax.annotation.Nullable Map<String, String> customFields) { + this.customFields = customFields; + return this; + } + + public Profile putCustomFieldsItem(String key, String customFieldsItem) { + if (this.customFields == null) { + this.customFields = new HashMap<>(); + } + this.customFields.put(key, customFieldsItem); + return this; + } + + /** + * Custom fields associated with the User. + * @return customFields + */ + @javax.annotation.Nullable + public Map<String, String> getCustomFields() { + return customFields; + } + + public void setCustomFields(@javax.annotation.Nullable Map<String, String> customFields) { + this.customFields = customFields; + } + + + public Profile profileImageUrls(@javax.annotation.Nullable Map<String, String> profileImageUrls) { + this.profileImageUrls = profileImageUrls; + return this; + } + + public Profile putProfileImageUrlsItem(String key, String profileImageUrlsItem) { + if (this.profileImageUrls == null) { + this.profileImageUrls = new HashMap<>(); + } + this.profileImageUrls.put(key, profileImageUrlsItem); + return this; + } + + /** + * URLs of the User's profile images. + * @return profileImageUrls + */ + @javax.annotation.Nullable + public Map<String, String> getProfileImageUrls() { + return profileImageUrls; + } + + public void setProfileImageUrls(@javax.annotation.Nullable Map<String, String> profileImageUrls) { + this.profileImageUrls = profileImageUrls; + } + + + public Profile webProfiles(@javax.annotation.Nullable Map<String, String> webProfiles) { + this.webProfiles = webProfiles; + return this; + } + + public Profile putWebProfilesItem(String key, String webProfilesItem) { + if (this.webProfiles == null) { + this.webProfiles = new HashMap<>(); + } + this.webProfiles.put(key, webProfilesItem); + return this; + } + + /** + * The User's web profiles. + * @return webProfiles + */ + @javax.annotation.Nullable + public Map<String, String> getWebProfiles() { + return webProfiles; + } + + public void setWebProfiles(@javax.annotation.Nullable Map<String, String> webProfiles) { + this.webProfiles = webProfiles; + } + + + public Profile roles(@javax.annotation.Nullable List<String> roles) { + this.roles = roles; + return this; + } + + public Profile addRolesItem(String rolesItem) { + if (this.roles == null) { + this.roles = new ArrayList<>(); + } + this.roles.add(rolesItem); + return this; + } + + /** + * Roles assigned to the User. + * @return roles + */ + @javax.annotation.Nullable + public List<String> getRoles() { + return roles; + } + + public void setRoles(@javax.annotation.Nullable List<String> roles) { + this.roles = roles; + } + + + public Profile uid(@javax.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * the unique id which belongs to the Account + * @return uid + */ + @javax.annotation.Nullable + public String getUid() { + return uid; + } + + public void setUid(@javax.annotation.Nullable String uid) { + this.uid = uid; + } + + + public Profile previousUids(@javax.annotation.Nullable List<String> previousUids) { + this.previousUids = previousUids; + return this; + } + + public Profile addPreviousUidsItem(String previousUidsItem) { + if (this.previousUids == null) { + this.previousUids = new ArrayList<>(); + } + this.previousUids.add(previousUidsItem); + return this; + } + + /** + * Previous UIDs associated with the Account. + * @return previousUids + */ + @javax.annotation.Nullable + public List<String> getPreviousUids() { + return previousUids; + } + + public void setPreviousUids(@javax.annotation.Nullable List<String> previousUids) { + this.previousUids = previousUids; + } + + + public Profile interestedIn(@javax.annotation.Nullable List<String> interestedIn) { + this.interestedIn = interestedIn; + return this; + } + + public Profile addInterestedInItem(String interestedInItem) { + if (this.interestedIn == null) { + this.interestedIn = new ArrayList<>(); + } + this.interestedIn.add(interestedInItem); + return this; + } + + /** + * Interests of the User. + * @return interestedIn + */ + @javax.annotation.Nullable + public List<String> getInterestedIn() { + return interestedIn; + } + + public void setInterestedIn(@javax.annotation.Nullable List<String> interestedIn) { + this.interestedIn = interestedIn; + } + + + public Profile externalIds(@javax.annotation.Nullable List<ProfileExternalIdsInner> externalIds) { + this.externalIds = externalIds; + return this; + } + + public Profile addExternalIdsItem(ProfileExternalIdsInner externalIdsItem) { + if (this.externalIds == null) { + this.externalIds = new ArrayList<>(); + } + this.externalIds.add(externalIdsItem); + return this; + } + + /** + * Get externalIds + * @return externalIds + */ + @javax.annotation.Nullable + public List<ProfileExternalIdsInner> getExternalIds() { + return externalIds; + } + + public void setExternalIds(@javax.annotation.Nullable List<ProfileExternalIdsInner> externalIds) { + this.externalIds = externalIds; + } + + + public Profile unverifiedEmail(@javax.annotation.Nullable List<ProfileUnverifiedEmailInner> unverifiedEmail) { + this.unverifiedEmail = unverifiedEmail; + return this; + } + + public Profile addUnverifiedEmailItem(ProfileUnverifiedEmailInner unverifiedEmailItem) { + if (this.unverifiedEmail == null) { + this.unverifiedEmail = new ArrayList<>(); + } + this.unverifiedEmail.add(unverifiedEmailItem); + return this; + } + + /** + * Get unverifiedEmail + * @return unverifiedEmail + */ + @javax.annotation.Nullable + public List<ProfileUnverifiedEmailInner> getUnverifiedEmail() { + return unverifiedEmail; + } + + public void setUnverifiedEmail(@javax.annotation.Nullable List<ProfileUnverifiedEmailInner> unverifiedEmail) { + this.unverifiedEmail = unverifiedEmail; + } + + + public Profile positions(@javax.annotation.Nullable List<ProfilePositionsInner> positions) { + this.positions = positions; + return this; + } + + public Profile addPositionsItem(ProfilePositionsInner positionsItem) { + if (this.positions == null) { + this.positions = new ArrayList<>(); + } + this.positions.add(positionsItem); + return this; + } + + /** + * List of positions held by the User. + * @return positions + */ + @javax.annotation.Nullable + public List<ProfilePositionsInner> getPositions() { + return positions; + } + + public void setPositions(@javax.annotation.Nullable List<ProfilePositionsInner> positions) { + this.positions = positions; + } + + + public Profile educations(@javax.annotation.Nullable List<ProfileEducationsInner> educations) { + this.educations = educations; + return this; + } + + public Profile addEducationsItem(ProfileEducationsInner educationsItem) { + if (this.educations == null) { + this.educations = new ArrayList<>(); + } + this.educations.add(educationsItem); + return this; + } + + /** + * List of educational qualifications of the User. + * @return educations + */ + @javax.annotation.Nullable + public List<ProfileEducationsInner> getEducations() { + return educations; + } + + public void setEducations(@javax.annotation.Nullable List<ProfileEducationsInner> educations) { + this.educations = educations; + } + + + public Profile phoneNumbers(@javax.annotation.Nullable List<ProfilePhoneNumbersInner> phoneNumbers) { + this.phoneNumbers = phoneNumbers; + return this; + } + + public Profile addPhoneNumbersItem(ProfilePhoneNumbersInner phoneNumbersItem) { + if (this.phoneNumbers == null) { + this.phoneNumbers = new ArrayList<>(); + } + this.phoneNumbers.add(phoneNumbersItem); + return this; + } + + /** + * List of Phone numbers associated with the User. + * @return phoneNumbers + */ + @javax.annotation.Nullable + public List<ProfilePhoneNumbersInner> getPhoneNumbers() { + return phoneNumbers; + } + + public void setPhoneNumbers(@javax.annotation.Nullable List<ProfilePhoneNumbersInner> phoneNumbers) { + this.phoneNumbers = phoneNumbers; + } + + + public Profile imAccounts(@javax.annotation.Nullable List<ProfileIMAccountsInner> imAccounts) { + this.imAccounts = imAccounts; + return this; + } + + public Profile addImAccountsItem(ProfileIMAccountsInner imAccountsItem) { + if (this.imAccounts == null) { + this.imAccounts = new ArrayList<>(); + } + this.imAccounts.add(imAccountsItem); + return this; + } + + /** + * List of instant messaging accounts associated with the User. + * @return imAccounts + */ + @javax.annotation.Nullable + public List<ProfileIMAccountsInner> getImAccounts() { + return imAccounts; + } + + public void setImAccounts(@javax.annotation.Nullable List<ProfileIMAccountsInner> imAccounts) { + this.imAccounts = imAccounts; + } + + + public Profile addresses(@javax.annotation.Nullable List<ProfileAddressesInner> addresses) { + this.addresses = addresses; + return this; + } + + public Profile addAddressesItem(ProfileAddressesInner addressesItem) { + if (this.addresses == null) { + this.addresses = new ArrayList<>(); + } + this.addresses.add(addressesItem); + return this; + } + + /** + * List of addresses associated with the User. + * @return addresses + */ + @javax.annotation.Nullable + public List<ProfileAddressesInner> getAddresses() { + return addresses; + } + + public void setAddresses(@javax.annotation.Nullable List<ProfileAddressesInner> addresses) { + this.addresses = addresses; + } + + + public Profile interests(@javax.annotation.Nullable List<ProfileInterestsInner> interests) { + this.interests = interests; + return this; + } + + public Profile addInterestsItem(ProfileInterestsInner interestsItem) { + if (this.interests == null) { + this.interests = new ArrayList<>(); + } + this.interests.add(interestsItem); + return this; + } + + /** + * List of interests of the User. + * @return interests + */ + @javax.annotation.Nullable + public List<ProfileInterestsInner> getInterests() { + return interests; + } + + public void setInterests(@javax.annotation.Nullable List<ProfileInterestsInner> interests) { + this.interests = interests; + } + + + public Profile sports(@javax.annotation.Nullable List<ProfileSportsInner> sports) { + this.sports = sports; + return this; + } + + public Profile addSportsItem(ProfileSportsInner sportsItem) { + if (this.sports == null) { + this.sports = new ArrayList<>(); + } + this.sports.add(sportsItem); + return this; + } + + /** + * List of sports the User is interested in. + * @return sports + */ + @javax.annotation.Nullable + public List<ProfileSportsInner> getSports() { + return sports; + } + + public void setSports(@javax.annotation.Nullable List<ProfileSportsInner> sports) { + this.sports = sports; + } + + + public Profile inspirationalPeople(@javax.annotation.Nullable List<ProfileInspirationalPeopleInner> inspirationalPeople) { + this.inspirationalPeople = inspirationalPeople; + return this; + } + + public Profile addInspirationalPeopleItem(ProfileInspirationalPeopleInner inspirationalPeopleItem) { + if (this.inspirationalPeople == null) { + this.inspirationalPeople = new ArrayList<>(); + } + this.inspirationalPeople.add(inspirationalPeopleItem); + return this; + } + + /** + * List of inspirational people for the User. + * @return inspirationalPeople + */ + @javax.annotation.Nullable + public List<ProfileInspirationalPeopleInner> getInspirationalPeople() { + return inspirationalPeople; + } + + public void setInspirationalPeople(@javax.annotation.Nullable List<ProfileInspirationalPeopleInner> inspirationalPeople) { + this.inspirationalPeople = inspirationalPeople; + } + + + public Profile awards(@javax.annotation.Nullable List<ProfileAwardsInner> awards) { + this.awards = awards; + return this; + } + + public Profile addAwardsItem(ProfileAwardsInner awardsItem) { + if (this.awards == null) { + this.awards = new ArrayList<>(); + } + this.awards.add(awardsItem); + return this; + } + + /** + * List of awards received by the User. + * @return awards + */ + @javax.annotation.Nullable + public List<ProfileAwardsInner> getAwards() { + return awards; + } + + public void setAwards(@javax.annotation.Nullable List<ProfileAwardsInner> awards) { + this.awards = awards; + } + + + public Profile skills(@javax.annotation.Nullable List<ProfileSkillsInner> skills) { + this.skills = skills; + return this; + } + + public Profile addSkillsItem(ProfileSkillsInner skillsItem) { + if (this.skills == null) { + this.skills = new ArrayList<>(); + } + this.skills.add(skillsItem); + return this; + } + + /** + * List of skills possessed by the User. + * @return skills + */ + @javax.annotation.Nullable + public List<ProfileSkillsInner> getSkills() { + return skills; + } + + public void setSkills(@javax.annotation.Nullable List<ProfileSkillsInner> skills) { + this.skills = skills; + } + + + public Profile currentStatus(@javax.annotation.Nullable List<ProfileCurrentStatusInner> currentStatus) { + this.currentStatus = currentStatus; + return this; + } + + public Profile addCurrentStatusItem(ProfileCurrentStatusInner currentStatusItem) { + if (this.currentStatus == null) { + this.currentStatus = new ArrayList<>(); + } + this.currentStatus.add(currentStatusItem); + return this; + } + + /** + * List of current statuses of the User. + * @return currentStatus + */ + @javax.annotation.Nullable + public List<ProfileCurrentStatusInner> getCurrentStatus() { + return currentStatus; + } + + public void setCurrentStatus(@javax.annotation.Nullable List<ProfileCurrentStatusInner> currentStatus) { + this.currentStatus = currentStatus; + } + + + public Profile certifications(@javax.annotation.Nullable List<ProfileCertificationsInner> certifications) { + this.certifications = certifications; + return this; + } + + public Profile addCertificationsItem(ProfileCertificationsInner certificationsItem) { + if (this.certifications == null) { + this.certifications = new ArrayList<>(); + } + this.certifications.add(certificationsItem); + return this; + } + + /** + * List of certifications obtained by the User. + * @return certifications + */ + @javax.annotation.Nullable + public List<ProfileCertificationsInner> getCertifications() { + return certifications; + } + + public void setCertifications(@javax.annotation.Nullable List<ProfileCertificationsInner> certifications) { + this.certifications = certifications; + } + + + public Profile courses(@javax.annotation.Nullable List<ProfileCoursesInner> courses) { + this.courses = courses; + return this; + } + + public Profile addCoursesItem(ProfileCoursesInner coursesItem) { + if (this.courses == null) { + this.courses = new ArrayList<>(); + } + this.courses.add(coursesItem); + return this; + } + + /** + * List of courses completed by the User. + * @return courses + */ + @javax.annotation.Nullable + public List<ProfileCoursesInner> getCourses() { + return courses; + } + + public void setCourses(@javax.annotation.Nullable List<ProfileCoursesInner> courses) { + this.courses = courses; + } + + + public Profile volunteer(@javax.annotation.Nullable List<ProfileVolunteerInner> volunteer) { + this.volunteer = volunteer; + return this; + } + + public Profile addVolunteerItem(ProfileVolunteerInner volunteerItem) { + if (this.volunteer == null) { + this.volunteer = new ArrayList<>(); + } + this.volunteer.add(volunteerItem); + return this; + } + + /** + * List of volunteer activities by the User. + * @return volunteer + */ + @javax.annotation.Nullable + public List<ProfileVolunteerInner> getVolunteer() { + return volunteer; + } + + public void setVolunteer(@javax.annotation.Nullable List<ProfileVolunteerInner> volunteer) { + this.volunteer = volunteer; + } + + + public Profile recommendationsReceived(@javax.annotation.Nullable List<ProfileRecommendationsReceivedInner> recommendationsReceived) { + this.recommendationsReceived = recommendationsReceived; + return this; + } + + public Profile addRecommendationsReceivedItem(ProfileRecommendationsReceivedInner recommendationsReceivedItem) { + if (this.recommendationsReceived == null) { + this.recommendationsReceived = new ArrayList<>(); + } + this.recommendationsReceived.add(recommendationsReceivedItem); + return this; + } + + /** + * List of recommendations received by the User. + * @return recommendationsReceived + */ + @javax.annotation.Nullable + public List<ProfileRecommendationsReceivedInner> getRecommendationsReceived() { + return recommendationsReceived; + } + + public void setRecommendationsReceived(@javax.annotation.Nullable List<ProfileRecommendationsReceivedInner> recommendationsReceived) { + this.recommendationsReceived = recommendationsReceived; + } + + + public Profile languages(@javax.annotation.Nullable List<ProfileLanguagesInner> languages) { + this.languages = languages; + return this; + } + + public Profile addLanguagesItem(ProfileLanguagesInner languagesItem) { + if (this.languages == null) { + this.languages = new ArrayList<>(); + } + this.languages.add(languagesItem); + return this; + } + + /** + * List of languages known by the User. + * @return languages + */ + @javax.annotation.Nullable + public List<ProfileLanguagesInner> getLanguages() { + return languages; + } + + public void setLanguages(@javax.annotation.Nullable List<ProfileLanguagesInner> languages) { + this.languages = languages; + } + + + public Profile projects(@javax.annotation.Nullable List<ProfileProjectsInner> projects) { + this.projects = projects; + return this; + } + + public Profile addProjectsItem(ProfileProjectsInner projectsItem) { + if (this.projects == null) { + this.projects = new ArrayList<>(); + } + this.projects.add(projectsItem); + return this; + } + + /** + * List of projects undertaken by the User. + * @return projects + */ + @javax.annotation.Nullable + public List<ProfileProjectsInner> getProjects() { + return projects; + } + + public void setProjects(@javax.annotation.Nullable List<ProfileProjectsInner> projects) { + this.projects = projects; + } + + + public Profile games(@javax.annotation.Nullable List<ProfileGamesInner> games) { + this.games = games; + return this; + } + + public Profile addGamesItem(ProfileGamesInner gamesItem) { + if (this.games == null) { + this.games = new ArrayList<>(); + } + this.games.add(gamesItem); + return this; + } + + /** + * List of games the User is interested in. + * @return games + */ + @javax.annotation.Nullable + public List<ProfileGamesInner> getGames() { + return games; + } + + public void setGames(@javax.annotation.Nullable List<ProfileGamesInner> games) { + this.games = games; + } + + + public Profile family(@javax.annotation.Nullable List<ProfileFamilyInner> family) { + this.family = family; + return this; + } + + public Profile addFamilyItem(ProfileFamilyInner familyItem) { + if (this.family == null) { + this.family = new ArrayList<>(); + } + this.family.add(familyItem); + return this; + } + + /** + * List of family members of the User. + * @return family + */ + @javax.annotation.Nullable + public List<ProfileFamilyInner> getFamily() { + return family; + } + + public void setFamily(@javax.annotation.Nullable List<ProfileFamilyInner> family) { + this.family = family; + } + + + public Profile televisionShow(@javax.annotation.Nullable List<ProfileTelevisionShowInner> televisionShow) { + this.televisionShow = televisionShow; + return this; + } + + public Profile addTelevisionShowItem(ProfileTelevisionShowInner televisionShowItem) { + if (this.televisionShow == null) { + this.televisionShow = new ArrayList<>(); + } + this.televisionShow.add(televisionShowItem); + return this; + } + + /** + * List of television shows the User is interested in. + * @return televisionShow + */ + @javax.annotation.Nullable + public List<ProfileTelevisionShowInner> getTelevisionShow() { + return televisionShow; + } + + public void setTelevisionShow(@javax.annotation.Nullable List<ProfileTelevisionShowInner> televisionShow) { + this.televisionShow = televisionShow; + } + + + public Profile mutualFriends(@javax.annotation.Nullable List<ProfileMutualFriendsInner> mutualFriends) { + this.mutualFriends = mutualFriends; + return this; + } + + public Profile addMutualFriendsItem(ProfileMutualFriendsInner mutualFriendsItem) { + if (this.mutualFriends == null) { + this.mutualFriends = new ArrayList<>(); + } + this.mutualFriends.add(mutualFriendsItem); + return this; + } + + /** + * List of mutual friends of the User. + * @return mutualFriends + */ + @javax.annotation.Nullable + public List<ProfileMutualFriendsInner> getMutualFriends() { + return mutualFriends; + } + + public void setMutualFriends(@javax.annotation.Nullable List<ProfileMutualFriendsInner> mutualFriends) { + this.mutualFriends = mutualFriends; + } + + + public Profile movies(@javax.annotation.Nullable List<ProfileMoviesInner> movies) { + this.movies = movies; + return this; + } + + public Profile addMoviesItem(ProfileMoviesInner moviesItem) { + if (this.movies == null) { + this.movies = new ArrayList<>(); + } + this.movies.add(moviesItem); + return this; + } + + /** + * List of movies the User is interested in. + * @return movies + */ + @javax.annotation.Nullable + public List<ProfileMoviesInner> getMovies() { + return movies; + } + + public void setMovies(@javax.annotation.Nullable List<ProfileMoviesInner> movies) { + this.movies = movies; + } + + + public Profile books(@javax.annotation.Nullable List<ProfileBooksInner> books) { + this.books = books; + return this; + } + + public Profile addBooksItem(ProfileBooksInner booksItem) { + if (this.books == null) { + this.books = new ArrayList<>(); + } + this.books.add(booksItem); + return this; + } + + /** + * List of books the User is interested in. + * @return books + */ + @javax.annotation.Nullable + public List<ProfileBooksInner> getBooks() { + return books; + } + + public void setBooks(@javax.annotation.Nullable List<ProfileBooksInner> books) { + this.books = books; + } + + + public Profile patents(@javax.annotation.Nullable List<ProfilePatentsInner> patents) { + this.patents = patents; + return this; + } + + public Profile addPatentsItem(ProfilePatentsInner patentsItem) { + if (this.patents == null) { + this.patents = new ArrayList<>(); + } + this.patents.add(patentsItem); + return this; + } + + /** + * List of patents owned by the User. + * @return patents + */ + @javax.annotation.Nullable + public List<ProfilePatentsInner> getPatents() { + return patents; + } + + public void setPatents(@javax.annotation.Nullable List<ProfilePatentsInner> patents) { + this.patents = patents; + } + + + public Profile favoriteThings(@javax.annotation.Nullable List<ProfileFavoriteThingsInner> favoriteThings) { + this.favoriteThings = favoriteThings; + return this; + } + + public Profile addFavoriteThingsItem(ProfileFavoriteThingsInner favoriteThingsItem) { + if (this.favoriteThings == null) { + this.favoriteThings = new ArrayList<>(); + } + this.favoriteThings.add(favoriteThingsItem); + return this; + } + + /** + * List of favorite things of the User. + * @return favoriteThings + */ + @javax.annotation.Nullable + public List<ProfileFavoriteThingsInner> getFavoriteThings() { + return favoriteThings; + } + + public void setFavoriteThings(@javax.annotation.Nullable List<ProfileFavoriteThingsInner> favoriteThings) { + this.favoriteThings = favoriteThings; + } + + + public Profile relatedProfileViews(@javax.annotation.Nullable List<ProfileRelatedProfileViewsInner> relatedProfileViews) { + this.relatedProfileViews = relatedProfileViews; + return this; + } + + public Profile addRelatedProfileViewsItem(ProfileRelatedProfileViewsInner relatedProfileViewsItem) { + if (this.relatedProfileViews == null) { + this.relatedProfileViews = new ArrayList<>(); + } + this.relatedProfileViews.add(relatedProfileViewsItem); + return this; + } + + /** + * List of related profile views of the User. + * @return relatedProfileViews + */ + @javax.annotation.Nullable + public List<ProfileRelatedProfileViewsInner> getRelatedProfileViews() { + return relatedProfileViews; + } + + public void setRelatedProfileViews(@javax.annotation.Nullable List<ProfileRelatedProfileViewsInner> relatedProfileViews) { + this.relatedProfileViews = relatedProfileViews; + } + + + public Profile placesLived(@javax.annotation.Nullable List<ProfilePlacesLivedInner> placesLived) { + this.placesLived = placesLived; + return this; + } + + public Profile addPlacesLivedItem(ProfilePlacesLivedInner placesLivedItem) { + if (this.placesLived == null) { + this.placesLived = new ArrayList<>(); + } + this.placesLived.add(placesLivedItem); + return this; + } + + /** + * List of places the User has lived. + * @return placesLived + */ + @javax.annotation.Nullable + public List<ProfilePlacesLivedInner> getPlacesLived() { + return placesLived; + } + + public void setPlacesLived(@javax.annotation.Nullable List<ProfilePlacesLivedInner> placesLived) { + this.placesLived = placesLived; + } + + + public Profile publications(@javax.annotation.Nullable List<ProfilePublicationsInner> publications) { + this.publications = publications; + return this; + } + + public Profile addPublicationsItem(ProfilePublicationsInner publicationsItem) { + if (this.publications == null) { + this.publications = new ArrayList<>(); + } + this.publications.add(publicationsItem); + return this; + } + + /** + * List of publications by the User. + * @return publications + */ + @javax.annotation.Nullable + public List<ProfilePublicationsInner> getPublications() { + return publications; + } + + public void setPublications(@javax.annotation.Nullable List<ProfilePublicationsInner> publications) { + this.publications = publications; + } + + + public Profile jobBookmarks(@javax.annotation.Nullable List<ProfileJobBookmarksInner> jobBookmarks) { + this.jobBookmarks = jobBookmarks; + return this; + } + + public Profile addJobBookmarksItem(ProfileJobBookmarksInner jobBookmarksItem) { + if (this.jobBookmarks == null) { + this.jobBookmarks = new ArrayList<>(); + } + this.jobBookmarks.add(jobBookmarksItem); + return this; + } + + /** + * List of job bookmarks by the User. + * @return jobBookmarks + */ + @javax.annotation.Nullable + public List<ProfileJobBookmarksInner> getJobBookmarks() { + return jobBookmarks; + } + + public void setJobBookmarks(@javax.annotation.Nullable List<ProfileJobBookmarksInner> jobBookmarks) { + this.jobBookmarks = jobBookmarks; + } + + + public Profile badges(@javax.annotation.Nullable List<ProfileBadgesInner> badges) { + this.badges = badges; + return this; + } + + public Profile addBadgesItem(ProfileBadgesInner badgesItem) { + if (this.badges == null) { + this.badges = new ArrayList<>(); + } + this.badges.add(badgesItem); + return this; + } + + /** + * List of badges earned by the User. + * @return badges + */ + @javax.annotation.Nullable + public List<ProfileBadgesInner> getBadges() { + return badges; + } + + public void setBadges(@javax.annotation.Nullable List<ProfileBadgesInner> badges) { + this.badges = badges; + } + + + public Profile memberUrlResources(@javax.annotation.Nullable List<ProfileMemberUrlResourcesInner> memberUrlResources) { + this.memberUrlResources = memberUrlResources; + return this; + } + + public Profile addMemberUrlResourcesItem(ProfileMemberUrlResourcesInner memberUrlResourcesItem) { + if (this.memberUrlResources == null) { + this.memberUrlResources = new ArrayList<>(); + } + this.memberUrlResources.add(memberUrlResourcesItem); + return this; + } + + /** + * List of member URL resources. + * @return memberUrlResources + */ + @javax.annotation.Nullable + public List<ProfileMemberUrlResourcesInner> getMemberUrlResources() { + return memberUrlResources; + } + + public void setMemberUrlResources(@javax.annotation.Nullable List<ProfileMemberUrlResourcesInner> memberUrlResources) { + this.memberUrlResources = memberUrlResources; + } + + + public Profile organizations(@javax.annotation.Nullable List<ProfileOrganizationsInner> organizations) { + this.organizations = organizations; + return this; + } + + public Profile addOrganizationsItem(ProfileOrganizationsInner organizationsItem) { + if (this.organizations == null) { + this.organizations = new ArrayList<>(); + } + this.organizations.add(organizationsItem); + return this; + } + + /** + * List of organizations associated with the User. + * @return organizations + */ + @javax.annotation.Nullable + public List<ProfileOrganizationsInner> getOrganizations() { + return organizations; + } + + public void setOrganizations(@javax.annotation.Nullable List<ProfileOrganizationsInner> organizations) { + this.organizations = organizations; + } + + + public Profile email(@javax.annotation.Nullable List<ProfileEmailInner> email) { + this.email = email; + return this; + } + + public Profile addEmailItem(ProfileEmailInner emailItem) { + if (this.email == null) { + this.email = new ArrayList<>(); + } + this.email.add(emailItem); + return this; + } + + /** + * List of Email addresses associated with the User. + * @return email + */ + @javax.annotation.Nullable + public List<ProfileEmailInner> getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable List<ProfileEmailInner> email) { + this.email = email; + } + + + public Profile passkeyLogin(@javax.annotation.Nullable ProfilePasskeyLogin passkeyLogin) { + this.passkeyLogin = passkeyLogin; + return this; + } + + /** + * Get passkeyLogin + * @return passkeyLogin + */ + @javax.annotation.Nullable + public ProfilePasskeyLogin getPasskeyLogin() { + return passkeyLogin; + } + + public void setPasskeyLogin(@javax.annotation.Nullable ProfilePasskeyLogin passkeyLogin) { + this.passkeyLogin = passkeyLogin; + } + + + public Profile identities(@javax.annotation.Nullable List<SocialIdentity> identities) { + this.identities = identities; + return this; + } + + public Profile addIdentitiesItem(SocialIdentity identitiesItem) { + if (this.identities == null) { + this.identities = new ArrayList<>(); + } + this.identities.add(identitiesItem); + return this; + } + + /** + * Get identities + * @return identities + */ + @javax.annotation.Nullable + public List<SocialIdentity> getIdentities() { + return identities; + } + + public void setIdentities(@javax.annotation.Nullable List<SocialIdentity> identities) { + this.identities = identities; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Profile instance itself + */ + public Profile putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Profile profile = (Profile) o; + return Objects.equals(this.isPasswordBreached, profile.isPasswordBreached) && + Objects.equals(this.isActive, profile.isActive) && + Objects.equals(this.isDeleted, profile.isDeleted) && + Objects.equals(this.emailVerified, profile.emailVerified) && + Objects.equals(this.isLoginLocked, profile.isLoginLocked) && + Objects.equals(this.isRequiredFieldsFilledOnce, profile.isRequiredFieldsFilledOnce) && + Objects.equals(this.firstLogin, profile.firstLogin) && + Objects.equals(this.isProtected, profile.isProtected) && + Objects.equals(this.hireable, profile.hireable) && + Objects.equals(this.isSecurePassword, profile.isSecurePassword) && + Objects.equals(this.isCustomUid, profile.isCustomUid) && + Objects.equals(this.phoneIdVerified, profile.phoneIdVerified) && + Objects.equals(this.isEmailSubscribed, profile.isEmailSubscribed) && + Objects.equals(this.noOfLogins, profile.noOfLogins) && + Objects.equals(this.followersCount, profile.followersCount) && + Objects.equals(this.friendsCount, profile.friendsCount) && + Objects.equals(this.totalStatusesCount, profile.totalStatusesCount) && + Objects.equals(this.numRecommenders, profile.numRecommenders) && + Objects.equals(this.totalPrivateRepository, profile.totalPrivateRepository) && + Objects.equals(this.publicGists, profile.publicGists) && + Objects.equals(this.privateGists, profile.privateGists) && + Objects.equals(this.pinsCount, profile.pinsCount) && + Objects.equals(this.boardsCount, profile.boardsCount) && + Objects.equals(this.likesCount, profile.likesCount) && + Objects.equals(this.sessionLimit, profile.sessionLimit) && + Objects.equals(this.ID, profile.ID) && + Objects.equals(this.password, profile.password) && + Objects.equals(this.loginLockedType, profile.loginLockedType) && + Objects.equals(this.provider, profile.provider) && + Objects.equals(this.lastPasswordChangeToken, profile.lastPasswordChangeToken) && + Objects.equals(this.fullName, profile.fullName) && + Objects.equals(this.firstName, profile.firstName) && + Objects.equals(this.lastName, profile.lastName) && + Objects.equals(this.registrationProvider, profile.registrationProvider) && + Objects.equals(this.registrationSource, profile.registrationSource) && + Objects.equals(this.lastLoginLocation, profile.lastLoginLocation) && + Objects.equals(this.externalUserLoginId, profile.externalUserLoginId) && + Objects.equals(this.phoneId, profile.phoneId) && + Objects.equals(this.userName, profile.userName) && + Objects.equals(this.prefix, profile.prefix) && + Objects.equals(this.middleName, profile.middleName) && + Objects.equals(this.suffix, profile.suffix) && + Objects.equals(this.nickName, profile.nickName) && + Objects.equals(this.profileName, profile.profileName) && + Objects.equals(this.birthDate, profile.birthDate) && + Objects.equals(this.gender, profile.gender) && + Objects.equals(this.website, profile.website) && + Objects.equals(this.thumbnailImageUrl, profile.thumbnailImageUrl) && + Objects.equals(this.imageUrl, profile.imageUrl) && + Objects.equals(this.favicon, profile.favicon) && + Objects.equals(this.profileUrl, profile.profileUrl) && + Objects.equals(this.homeTown, profile.homeTown) && + Objects.equals(this.state, profile.state) && + Objects.equals(this.city, profile.city) && + Objects.equals(this.industry, profile.industry) && + Objects.equals(this.about, profile.about) && + Objects.equals(this.timeZone, profile.timeZone) && + Objects.equals(this.localLanguage, profile.localLanguage) && + Objects.equals(this.coverPhoto, profile.coverPhoto) && + Objects.equals(this.tagLine, profile.tagLine) && + Objects.equals(this.language, profile.language) && + Objects.equals(this.verified, profile.verified) && + Objects.equals(this.updatedTime, profile.updatedTime) && + Objects.equals(this.isGeoEnabled, profile.isGeoEnabled) && + Objects.equals(this.associations, profile.associations) && + Objects.equals(this.honors, profile.honors) && + Objects.equals(this.httpsImageUrl, profile.httpsImageUrl) && + Objects.equals(this.mainAddress, profile.mainAddress) && + Objects.equals(this.created, profile.created) && + Objects.equals(this.localCity, profile.localCity) && + Objects.equals(this.profileCity, profile.profileCity) && + Objects.equals(this.localCountry, profile.localCountry) && + Objects.equals(this.profileCountry, profile.profileCountry) && + Objects.equals(this.relationshipStatus, profile.relationshipStatus) && + Objects.equals(this.quota, profile.quota) && + Objects.equals(this.quote, profile.quote) && + Objects.equals(this.religion, profile.religion) && + Objects.equals(this.political, profile.political) && + Objects.equals(this.publicRepository, profile.publicRepository) && + Objects.equals(this.repositoryUrl, profile.repositoryUrl) && + Objects.equals(this.age, profile.age) && + Objects.equals(this.professionalHeadline, profile.professionalHeadline) && + Objects.equals(this.lrUserID, profile.lrUserID) && + Objects.equals(this.currency, profile.currency) && + Objects.equals(this.starredUrl, profile.starredUrl) && + Objects.equals(this.gistsUrl, profile.gistsUrl) && + Objects.equals(this.company, profile.company) && + Objects.equals(this.gravatarImageUrl, profile.gravatarImageUrl) && + Objects.equals(this.lastPasswordChangeDate, profile.lastPasswordChangeDate) && + Objects.equals(this.passwordExpirationDate, profile.passwordExpirationDate) && + Objects.equals(this.createdDate, profile.createdDate) && + Objects.equals(this.modifiedDate, profile.modifiedDate) && + Objects.equals(this.profileModifiedDate, profile.profileModifiedDate) && + Objects.equals(this.lastLoginDate, profile.lastLoginDate) && + Objects.equals(this.signupDate, profile.signupDate) && + Objects.equals(this.privacyPolicy, profile.privacyPolicy) && + Objects.equals(this.country, profile.country) && + Objects.equals(this.ageRange, profile.ageRange) && + Objects.equals(this.kloutScore, profile.kloutScore) && + Objects.equals(this.suggestions, profile.suggestions) && + Objects.equals(this.subscription, profile.subscription) && + Objects.equals(this.PIN, profile.PIN) && + Objects.equals(this.consentProfile, profile.consentProfile) && + Objects.equals(this.registrationData, profile.registrationData) && + Objects.equals(this.providerAccessCredential, profile.providerAccessCredential) && + Objects.equals(this.customFields, profile.customFields) && + Objects.equals(this.profileImageUrls, profile.profileImageUrls) && + Objects.equals(this.webProfiles, profile.webProfiles) && + Objects.equals(this.roles, profile.roles) && + Objects.equals(this.uid, profile.uid) && + Objects.equals(this.previousUids, profile.previousUids) && + Objects.equals(this.interestedIn, profile.interestedIn) && + Objects.equals(this.externalIds, profile.externalIds) && + Objects.equals(this.unverifiedEmail, profile.unverifiedEmail) && + Objects.equals(this.positions, profile.positions) && + Objects.equals(this.educations, profile.educations) && + Objects.equals(this.phoneNumbers, profile.phoneNumbers) && + Objects.equals(this.imAccounts, profile.imAccounts) && + Objects.equals(this.addresses, profile.addresses) && + Objects.equals(this.interests, profile.interests) && + Objects.equals(this.sports, profile.sports) && + Objects.equals(this.inspirationalPeople, profile.inspirationalPeople) && + Objects.equals(this.awards, profile.awards) && + Objects.equals(this.skills, profile.skills) && + Objects.equals(this.currentStatus, profile.currentStatus) && + Objects.equals(this.certifications, profile.certifications) && + Objects.equals(this.courses, profile.courses) && + Objects.equals(this.volunteer, profile.volunteer) && + Objects.equals(this.recommendationsReceived, profile.recommendationsReceived) && + Objects.equals(this.languages, profile.languages) && + Objects.equals(this.projects, profile.projects) && + Objects.equals(this.games, profile.games) && + Objects.equals(this.family, profile.family) && + Objects.equals(this.televisionShow, profile.televisionShow) && + Objects.equals(this.mutualFriends, profile.mutualFriends) && + Objects.equals(this.movies, profile.movies) && + Objects.equals(this.books, profile.books) && + Objects.equals(this.patents, profile.patents) && + Objects.equals(this.favoriteThings, profile.favoriteThings) && + Objects.equals(this.relatedProfileViews, profile.relatedProfileViews) && + Objects.equals(this.placesLived, profile.placesLived) && + Objects.equals(this.publications, profile.publications) && + Objects.equals(this.jobBookmarks, profile.jobBookmarks) && + Objects.equals(this.badges, profile.badges) && + Objects.equals(this.memberUrlResources, profile.memberUrlResources) && + Objects.equals(this.organizations, profile.organizations) && + Objects.equals(this.email, profile.email) && + Objects.equals(this.passkeyLogin, profile.passkeyLogin) && + Objects.equals(this.identities, profile.identities)&& + Objects.equals(this.additionalProperties, profile.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(isPasswordBreached, isActive, isDeleted, emailVerified, isLoginLocked, isRequiredFieldsFilledOnce, firstLogin, isProtected, hireable, isSecurePassword, isCustomUid, phoneIdVerified, isEmailSubscribed, noOfLogins, followersCount, friendsCount, totalStatusesCount, numRecommenders, totalPrivateRepository, publicGists, privateGists, pinsCount, boardsCount, likesCount, sessionLimit, ID, password, loginLockedType, provider, lastPasswordChangeToken, fullName, firstName, lastName, registrationProvider, registrationSource, lastLoginLocation, externalUserLoginId, phoneId, userName, prefix, middleName, suffix, nickName, profileName, birthDate, gender, website, thumbnailImageUrl, imageUrl, favicon, profileUrl, homeTown, state, city, industry, about, timeZone, localLanguage, coverPhoto, tagLine, language, verified, updatedTime, isGeoEnabled, associations, honors, httpsImageUrl, mainAddress, created, localCity, profileCity, localCountry, profileCountry, relationshipStatus, quota, quote, religion, political, publicRepository, repositoryUrl, age, professionalHeadline, lrUserID, currency, starredUrl, gistsUrl, company, gravatarImageUrl, lastPasswordChangeDate, passwordExpirationDate, createdDate, modifiedDate, profileModifiedDate, lastLoginDate, signupDate, privacyPolicy, country, ageRange, kloutScore, suggestions, subscription, PIN, consentProfile, registrationData, providerAccessCredential, customFields, profileImageUrls, webProfiles, roles, uid, previousUids, interestedIn, externalIds, unverifiedEmail, positions, educations, phoneNumbers, imAccounts, addresses, interests, sports, inspirationalPeople, awards, skills, currentStatus, certifications, courses, volunteer, recommendationsReceived, languages, projects, games, family, televisionShow, mutualFriends, movies, books, patents, favoriteThings, relatedProfileViews, placesLived, publications, jobBookmarks, badges, memberUrlResources, organizations, email, passkeyLogin, identities, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Profile {\n"); + sb.append(" isPasswordBreached: ").append(toIndentedString(isPasswordBreached)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" isDeleted: ").append(toIndentedString(isDeleted)).append("\n"); + sb.append(" emailVerified: ").append(toIndentedString(emailVerified)).append("\n"); + sb.append(" isLoginLocked: ").append(toIndentedString(isLoginLocked)).append("\n"); + sb.append(" isRequiredFieldsFilledOnce: ").append(toIndentedString(isRequiredFieldsFilledOnce)).append("\n"); + sb.append(" firstLogin: ").append(toIndentedString(firstLogin)).append("\n"); + sb.append(" isProtected: ").append(toIndentedString(isProtected)).append("\n"); + sb.append(" hireable: ").append(toIndentedString(hireable)).append("\n"); + sb.append(" isSecurePassword: ").append(toIndentedString(isSecurePassword)).append("\n"); + sb.append(" isCustomUid: ").append(toIndentedString(isCustomUid)).append("\n"); + sb.append(" phoneIdVerified: ").append(toIndentedString(phoneIdVerified)).append("\n"); + sb.append(" isEmailSubscribed: ").append(toIndentedString(isEmailSubscribed)).append("\n"); + sb.append(" noOfLogins: ").append(toIndentedString(noOfLogins)).append("\n"); + sb.append(" followersCount: ").append(toIndentedString(followersCount)).append("\n"); + sb.append(" friendsCount: ").append(toIndentedString(friendsCount)).append("\n"); + sb.append(" totalStatusesCount: ").append(toIndentedString(totalStatusesCount)).append("\n"); + sb.append(" numRecommenders: ").append(toIndentedString(numRecommenders)).append("\n"); + sb.append(" totalPrivateRepository: ").append(toIndentedString(totalPrivateRepository)).append("\n"); + sb.append(" publicGists: ").append(toIndentedString(publicGists)).append("\n"); + sb.append(" privateGists: ").append(toIndentedString(privateGists)).append("\n"); + sb.append(" pinsCount: ").append(toIndentedString(pinsCount)).append("\n"); + sb.append(" boardsCount: ").append(toIndentedString(boardsCount)).append("\n"); + sb.append(" likesCount: ").append(toIndentedString(likesCount)).append("\n"); + sb.append(" sessionLimit: ").append(toIndentedString(sessionLimit)).append("\n"); + sb.append(" ID: ").append(toIndentedString(ID)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" loginLockedType: ").append(toIndentedString(loginLockedType)).append("\n"); + sb.append(" provider: ").append(toIndentedString(provider)).append("\n"); + sb.append(" lastPasswordChangeToken: ").append(toIndentedString(lastPasswordChangeToken)).append("\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" registrationProvider: ").append(toIndentedString(registrationProvider)).append("\n"); + sb.append(" registrationSource: ").append(toIndentedString(registrationSource)).append("\n"); + sb.append(" lastLoginLocation: ").append(toIndentedString(lastLoginLocation)).append("\n"); + sb.append(" externalUserLoginId: ").append(toIndentedString(externalUserLoginId)).append("\n"); + sb.append(" phoneId: ").append(toIndentedString(phoneId)).append("\n"); + sb.append(" userName: ").append(toIndentedString(userName)).append("\n"); + sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n"); + sb.append(" middleName: ").append(toIndentedString(middleName)).append("\n"); + sb.append(" suffix: ").append(toIndentedString(suffix)).append("\n"); + sb.append(" nickName: ").append(toIndentedString(nickName)).append("\n"); + sb.append(" profileName: ").append(toIndentedString(profileName)).append("\n"); + sb.append(" birthDate: ").append(toIndentedString(birthDate)).append("\n"); + sb.append(" gender: ").append(toIndentedString(gender)).append("\n"); + sb.append(" website: ").append(toIndentedString(website)).append("\n"); + sb.append(" thumbnailImageUrl: ").append(toIndentedString(thumbnailImageUrl)).append("\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append(" favicon: ").append(toIndentedString(favicon)).append("\n"); + sb.append(" profileUrl: ").append(toIndentedString(profileUrl)).append("\n"); + sb.append(" homeTown: ").append(toIndentedString(homeTown)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" industry: ").append(toIndentedString(industry)).append("\n"); + sb.append(" about: ").append(toIndentedString(about)).append("\n"); + sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); + sb.append(" localLanguage: ").append(toIndentedString(localLanguage)).append("\n"); + sb.append(" coverPhoto: ").append(toIndentedString(coverPhoto)).append("\n"); + sb.append(" tagLine: ").append(toIndentedString(tagLine)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" verified: ").append(toIndentedString(verified)).append("\n"); + sb.append(" updatedTime: ").append(toIndentedString(updatedTime)).append("\n"); + sb.append(" isGeoEnabled: ").append(toIndentedString(isGeoEnabled)).append("\n"); + sb.append(" associations: ").append(toIndentedString(associations)).append("\n"); + sb.append(" honors: ").append(toIndentedString(honors)).append("\n"); + sb.append(" httpsImageUrl: ").append(toIndentedString(httpsImageUrl)).append("\n"); + sb.append(" mainAddress: ").append(toIndentedString(mainAddress)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" localCity: ").append(toIndentedString(localCity)).append("\n"); + sb.append(" profileCity: ").append(toIndentedString(profileCity)).append("\n"); + sb.append(" localCountry: ").append(toIndentedString(localCountry)).append("\n"); + sb.append(" profileCountry: ").append(toIndentedString(profileCountry)).append("\n"); + sb.append(" relationshipStatus: ").append(toIndentedString(relationshipStatus)).append("\n"); + sb.append(" quota: ").append(toIndentedString(quota)).append("\n"); + sb.append(" quote: ").append(toIndentedString(quote)).append("\n"); + sb.append(" religion: ").append(toIndentedString(religion)).append("\n"); + sb.append(" political: ").append(toIndentedString(political)).append("\n"); + sb.append(" publicRepository: ").append(toIndentedString(publicRepository)).append("\n"); + sb.append(" repositoryUrl: ").append(toIndentedString(repositoryUrl)).append("\n"); + sb.append(" age: ").append(toIndentedString(age)).append("\n"); + sb.append(" professionalHeadline: ").append(toIndentedString(professionalHeadline)).append("\n"); + sb.append(" lrUserID: ").append(toIndentedString(lrUserID)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" starredUrl: ").append(toIndentedString(starredUrl)).append("\n"); + sb.append(" gistsUrl: ").append(toIndentedString(gistsUrl)).append("\n"); + sb.append(" company: ").append(toIndentedString(company)).append("\n"); + sb.append(" gravatarImageUrl: ").append(toIndentedString(gravatarImageUrl)).append("\n"); + sb.append(" lastPasswordChangeDate: ").append(toIndentedString(lastPasswordChangeDate)).append("\n"); + sb.append(" passwordExpirationDate: ").append(toIndentedString(passwordExpirationDate)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" modifiedDate: ").append(toIndentedString(modifiedDate)).append("\n"); + sb.append(" profileModifiedDate: ").append(toIndentedString(profileModifiedDate)).append("\n"); + sb.append(" lastLoginDate: ").append(toIndentedString(lastLoginDate)).append("\n"); + sb.append(" signupDate: ").append(toIndentedString(signupDate)).append("\n"); + sb.append(" privacyPolicy: ").append(toIndentedString(privacyPolicy)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" ageRange: ").append(toIndentedString(ageRange)).append("\n"); + sb.append(" kloutScore: ").append(toIndentedString(kloutScore)).append("\n"); + sb.append(" suggestions: ").append(toIndentedString(suggestions)).append("\n"); + sb.append(" subscription: ").append(toIndentedString(subscription)).append("\n"); + sb.append(" PIN: ").append(toIndentedString(PIN)).append("\n"); + sb.append(" consentProfile: ").append(toIndentedString(consentProfile)).append("\n"); + sb.append(" registrationData: ").append(toIndentedString(registrationData)).append("\n"); + sb.append(" providerAccessCredential: ").append(toIndentedString(providerAccessCredential)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" profileImageUrls: ").append(toIndentedString(profileImageUrls)).append("\n"); + sb.append(" webProfiles: ").append(toIndentedString(webProfiles)).append("\n"); + sb.append(" roles: ").append(toIndentedString(roles)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" previousUids: ").append(toIndentedString(previousUids)).append("\n"); + sb.append(" interestedIn: ").append(toIndentedString(interestedIn)).append("\n"); + sb.append(" externalIds: ").append(toIndentedString(externalIds)).append("\n"); + sb.append(" unverifiedEmail: ").append(toIndentedString(unverifiedEmail)).append("\n"); + sb.append(" positions: ").append(toIndentedString(positions)).append("\n"); + sb.append(" educations: ").append(toIndentedString(educations)).append("\n"); + sb.append(" phoneNumbers: ").append(toIndentedString(phoneNumbers)).append("\n"); + sb.append(" imAccounts: ").append(toIndentedString(imAccounts)).append("\n"); + sb.append(" addresses: ").append(toIndentedString(addresses)).append("\n"); + sb.append(" interests: ").append(toIndentedString(interests)).append("\n"); + sb.append(" sports: ").append(toIndentedString(sports)).append("\n"); + sb.append(" inspirationalPeople: ").append(toIndentedString(inspirationalPeople)).append("\n"); + sb.append(" awards: ").append(toIndentedString(awards)).append("\n"); + sb.append(" skills: ").append(toIndentedString(skills)).append("\n"); + sb.append(" currentStatus: ").append(toIndentedString(currentStatus)).append("\n"); + sb.append(" certifications: ").append(toIndentedString(certifications)).append("\n"); + sb.append(" courses: ").append(toIndentedString(courses)).append("\n"); + sb.append(" volunteer: ").append(toIndentedString(volunteer)).append("\n"); + sb.append(" recommendationsReceived: ").append(toIndentedString(recommendationsReceived)).append("\n"); + sb.append(" languages: ").append(toIndentedString(languages)).append("\n"); + sb.append(" projects: ").append(toIndentedString(projects)).append("\n"); + sb.append(" games: ").append(toIndentedString(games)).append("\n"); + sb.append(" family: ").append(toIndentedString(family)).append("\n"); + sb.append(" televisionShow: ").append(toIndentedString(televisionShow)).append("\n"); + sb.append(" mutualFriends: ").append(toIndentedString(mutualFriends)).append("\n"); + sb.append(" movies: ").append(toIndentedString(movies)).append("\n"); + sb.append(" books: ").append(toIndentedString(books)).append("\n"); + sb.append(" patents: ").append(toIndentedString(patents)).append("\n"); + sb.append(" favoriteThings: ").append(toIndentedString(favoriteThings)).append("\n"); + sb.append(" relatedProfileViews: ").append(toIndentedString(relatedProfileViews)).append("\n"); + sb.append(" placesLived: ").append(toIndentedString(placesLived)).append("\n"); + sb.append(" publications: ").append(toIndentedString(publications)).append("\n"); + sb.append(" jobBookmarks: ").append(toIndentedString(jobBookmarks)).append("\n"); + sb.append(" badges: ").append(toIndentedString(badges)).append("\n"); + sb.append(" memberUrlResources: ").append(toIndentedString(memberUrlResources)).append("\n"); + sb.append(" organizations: ").append(toIndentedString(organizations)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" passkeyLogin: ").append(toIndentedString(passkeyLogin)).append("\n"); + sb.append(" identities: ").append(toIndentedString(identities)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsPasswordBreached"); + openapiFields.add("IsActive"); + openapiFields.add("IsDeleted"); + openapiFields.add("EmailVerified"); + openapiFields.add("IsLoginLocked"); + openapiFields.add("IsRequiredFieldsFilledOnce"); + openapiFields.add("FirstLogin"); + openapiFields.add("IsProtected"); + openapiFields.add("Hireable"); + openapiFields.add("IsSecurePassword"); + openapiFields.add("IsCustomUid"); + openapiFields.add("PhoneIdVerified"); + openapiFields.add("IsEmailSubscribed"); + openapiFields.add("NoOfLogins"); + openapiFields.add("FollowersCount"); + openapiFields.add("FriendsCount"); + openapiFields.add("TotalStatusesCount"); + openapiFields.add("NumRecommenders"); + openapiFields.add("TotalPrivateRepository"); + openapiFields.add("PublicGists"); + openapiFields.add("PrivateGists"); + openapiFields.add("PinsCount"); + openapiFields.add("BoardsCount"); + openapiFields.add("LikesCount"); + openapiFields.add("SessionLimit"); + openapiFields.add("ID"); + openapiFields.add("Password"); + openapiFields.add("LoginLockedType"); + openapiFields.add("Provider"); + openapiFields.add("LastPasswordChangeToken"); + openapiFields.add("FullName"); + openapiFields.add("FirstName"); + openapiFields.add("LastName"); + openapiFields.add("RegistrationProvider"); + openapiFields.add("RegistrationSource"); + openapiFields.add("LastLoginLocation"); + openapiFields.add("ExternalUserLoginId"); + openapiFields.add("PhoneId"); + openapiFields.add("UserName"); + openapiFields.add("Prefix"); + openapiFields.add("MiddleName"); + openapiFields.add("Suffix"); + openapiFields.add("NickName"); + openapiFields.add("ProfileName"); + openapiFields.add("BirthDate"); + openapiFields.add("Gender"); + openapiFields.add("Website"); + openapiFields.add("ThumbnailImageUrl"); + openapiFields.add("ImageUrl"); + openapiFields.add("Favicon"); + openapiFields.add("ProfileUrl"); + openapiFields.add("HomeTown"); + openapiFields.add("State"); + openapiFields.add("City"); + openapiFields.add("Industry"); + openapiFields.add("About"); + openapiFields.add("TimeZone"); + openapiFields.add("LocalLanguage"); + openapiFields.add("CoverPhoto"); + openapiFields.add("TagLine"); + openapiFields.add("Language"); + openapiFields.add("Verified"); + openapiFields.add("UpdatedTime"); + openapiFields.add("IsGeoEnabled"); + openapiFields.add("Associations"); + openapiFields.add("Honors"); + openapiFields.add("HttpsImageUrl"); + openapiFields.add("MainAddress"); + openapiFields.add("Created"); + openapiFields.add("LocalCity"); + openapiFields.add("ProfileCity"); + openapiFields.add("LocalCountry"); + openapiFields.add("ProfileCountry"); + openapiFields.add("RelationshipStatus"); + openapiFields.add("Quota"); + openapiFields.add("Quote"); + openapiFields.add("Religion"); + openapiFields.add("Political"); + openapiFields.add("PublicRepository"); + openapiFields.add("RepositoryUrl"); + openapiFields.add("Age"); + openapiFields.add("ProfessionalHeadline"); + openapiFields.add("LRUserID"); + openapiFields.add("Currency"); + openapiFields.add("StarredUrl"); + openapiFields.add("GistsUrl"); + openapiFields.add("Company"); + openapiFields.add("GravatarImageUrl"); + openapiFields.add("LastPasswordChangeDate"); + openapiFields.add("PasswordExpirationDate"); + openapiFields.add("CreatedDate"); + openapiFields.add("ModifiedDate"); + openapiFields.add("ProfileModifiedDate"); + openapiFields.add("LastLoginDate"); + openapiFields.add("SignupDate"); + openapiFields.add("PrivacyPolicy"); + openapiFields.add("Country"); + openapiFields.add("AgeRange"); + openapiFields.add("KloutScore"); + openapiFields.add("Suggestions"); + openapiFields.add("Subscription"); + openapiFields.add("PIN"); + openapiFields.add("ConsentProfile"); + openapiFields.add("RegistrationData"); + openapiFields.add("ProviderAccessCredential"); + openapiFields.add("CustomFields"); + openapiFields.add("ProfileImageUrls"); + openapiFields.add("WebProfiles"); + openapiFields.add("Roles"); + openapiFields.add("Uid"); + openapiFields.add("PreviousUids"); + openapiFields.add("InterestedIn"); + openapiFields.add("ExternalIds"); + openapiFields.add("UnverifiedEmail"); + openapiFields.add("Positions"); + openapiFields.add("Educations"); + openapiFields.add("PhoneNumbers"); + openapiFields.add("IMAccounts"); + openapiFields.add("Addresses"); + openapiFields.add("Interests"); + openapiFields.add("Sports"); + openapiFields.add("InspirationalPeople"); + openapiFields.add("Awards"); + openapiFields.add("Skills"); + openapiFields.add("CurrentStatus"); + openapiFields.add("Certifications"); + openapiFields.add("Courses"); + openapiFields.add("Volunteer"); + openapiFields.add("RecommendationsReceived"); + openapiFields.add("Languages"); + openapiFields.add("Projects"); + openapiFields.add("Games"); + openapiFields.add("Family"); + openapiFields.add("TelevisionShow"); + openapiFields.add("MutualFriends"); + openapiFields.add("Movies"); + openapiFields.add("Books"); + openapiFields.add("Patents"); + openapiFields.add("FavoriteThings"); + openapiFields.add("RelatedProfileViews"); + openapiFields.add("PlacesLived"); + openapiFields.add("Publications"); + openapiFields.add("JobBookmarks"); + openapiFields.add("Badges"); + openapiFields.add("MemberUrlResources"); + openapiFields.add("Organizations"); + openapiFields.add("Email"); + openapiFields.add("PasskeyLogin"); + openapiFields.add("Identities"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 Profile + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Profile.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Profile is not found in the empty JSON string", Profile.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonNull()) && !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("Password") != null && !jsonObj.get("Password").isJsonNull()) && !jsonObj.get("Password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Password").toString())); + } + if ((jsonObj.get("LoginLockedType") != null && !jsonObj.get("LoginLockedType").isJsonNull()) && !jsonObj.get("LoginLockedType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LoginLockedType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LoginLockedType").toString())); + } + if ((jsonObj.get("Provider") != null && !jsonObj.get("Provider").isJsonNull()) && !jsonObj.get("Provider").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Provider` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Provider").toString())); + } + if ((jsonObj.get("LastPasswordChangeToken") != null && !jsonObj.get("LastPasswordChangeToken").isJsonNull()) && !jsonObj.get("LastPasswordChangeToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastPasswordChangeToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastPasswordChangeToken").toString())); + } + if ((jsonObj.get("FullName") != null && !jsonObj.get("FullName").isJsonNull()) && !jsonObj.get("FullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FullName").toString())); + } + if ((jsonObj.get("FirstName") != null && !jsonObj.get("FirstName").isJsonNull()) && !jsonObj.get("FirstName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FirstName").toString())); + } + if ((jsonObj.get("LastName") != null && !jsonObj.get("LastName").isJsonNull()) && !jsonObj.get("LastName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastName").toString())); + } + if ((jsonObj.get("RegistrationProvider") != null && !jsonObj.get("RegistrationProvider").isJsonNull()) && !jsonObj.get("RegistrationProvider").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RegistrationProvider` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RegistrationProvider").toString())); + } + if ((jsonObj.get("RegistrationSource") != null && !jsonObj.get("RegistrationSource").isJsonNull()) && !jsonObj.get("RegistrationSource").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RegistrationSource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RegistrationSource").toString())); + } + if ((jsonObj.get("LastLoginLocation") != null && !jsonObj.get("LastLoginLocation").isJsonNull()) && !jsonObj.get("LastLoginLocation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastLoginLocation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastLoginLocation").toString())); + } + if ((jsonObj.get("ExternalUserLoginId") != null && !jsonObj.get("ExternalUserLoginId").isJsonNull()) && !jsonObj.get("ExternalUserLoginId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ExternalUserLoginId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ExternalUserLoginId").toString())); + } + if ((jsonObj.get("PhoneId") != null && !jsonObj.get("PhoneId").isJsonNull()) && !jsonObj.get("PhoneId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PhoneId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PhoneId").toString())); + } + if ((jsonObj.get("UserName") != null && !jsonObj.get("UserName").isJsonNull()) && !jsonObj.get("UserName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UserName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UserName").toString())); + } + if ((jsonObj.get("Prefix") != null && !jsonObj.get("Prefix").isJsonNull()) && !jsonObj.get("Prefix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Prefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Prefix").toString())); + } + if ((jsonObj.get("MiddleName") != null && !jsonObj.get("MiddleName").isJsonNull()) && !jsonObj.get("MiddleName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MiddleName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MiddleName").toString())); + } + if ((jsonObj.get("Suffix") != null && !jsonObj.get("Suffix").isJsonNull()) && !jsonObj.get("Suffix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Suffix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Suffix").toString())); + } + if ((jsonObj.get("NickName") != null && !jsonObj.get("NickName").isJsonNull()) && !jsonObj.get("NickName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NickName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NickName").toString())); + } + if ((jsonObj.get("ProfileName") != null && !jsonObj.get("ProfileName").isJsonNull()) && !jsonObj.get("ProfileName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileName").toString())); + } + if ((jsonObj.get("BirthDate") != null && !jsonObj.get("BirthDate").isJsonNull()) && !jsonObj.get("BirthDate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `BirthDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BirthDate").toString())); + } + if ((jsonObj.get("Gender") != null && !jsonObj.get("Gender").isJsonNull()) && !jsonObj.get("Gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Gender").toString())); + } + if ((jsonObj.get("Website") != null && !jsonObj.get("Website").isJsonNull()) && !jsonObj.get("Website").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Website` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Website").toString())); + } + if ((jsonObj.get("ThumbnailImageUrl") != null && !jsonObj.get("ThumbnailImageUrl").isJsonNull()) && !jsonObj.get("ThumbnailImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ThumbnailImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ThumbnailImageUrl").toString())); + } + if ((jsonObj.get("ImageUrl") != null && !jsonObj.get("ImageUrl").isJsonNull()) && !jsonObj.get("ImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ImageUrl").toString())); + } + if ((jsonObj.get("Favicon") != null && !jsonObj.get("Favicon").isJsonNull()) && !jsonObj.get("Favicon").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Favicon` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Favicon").toString())); + } + if ((jsonObj.get("ProfileUrl") != null && !jsonObj.get("ProfileUrl").isJsonNull()) && !jsonObj.get("ProfileUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileUrl").toString())); + } + if ((jsonObj.get("HomeTown") != null && !jsonObj.get("HomeTown").isJsonNull()) && !jsonObj.get("HomeTown").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HomeTown` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HomeTown").toString())); + } + if ((jsonObj.get("State") != null && !jsonObj.get("State").isJsonNull()) && !jsonObj.get("State").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `State` to be a primitive type in the JSON string but got `%s`", jsonObj.get("State").toString())); + } + if ((jsonObj.get("City") != null && !jsonObj.get("City").isJsonNull()) && !jsonObj.get("City").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `City` to be a primitive type in the JSON string but got `%s`", jsonObj.get("City").toString())); + } + if ((jsonObj.get("Industry") != null && !jsonObj.get("Industry").isJsonNull()) && !jsonObj.get("Industry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Industry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Industry").toString())); + } + if ((jsonObj.get("About") != null && !jsonObj.get("About").isJsonNull()) && !jsonObj.get("About").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `About` to be a primitive type in the JSON string but got `%s`", jsonObj.get("About").toString())); + } + if ((jsonObj.get("TimeZone") != null && !jsonObj.get("TimeZone").isJsonNull()) && !jsonObj.get("TimeZone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TimeZone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TimeZone").toString())); + } + if ((jsonObj.get("LocalLanguage") != null && !jsonObj.get("LocalLanguage").isJsonNull()) && !jsonObj.get("LocalLanguage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalLanguage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalLanguage").toString())); + } + if ((jsonObj.get("CoverPhoto") != null && !jsonObj.get("CoverPhoto").isJsonNull()) && !jsonObj.get("CoverPhoto").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CoverPhoto` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CoverPhoto").toString())); + } + if ((jsonObj.get("TagLine") != null && !jsonObj.get("TagLine").isJsonNull()) && !jsonObj.get("TagLine").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TagLine` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TagLine").toString())); + } + if ((jsonObj.get("Language") != null && !jsonObj.get("Language").isJsonNull()) && !jsonObj.get("Language").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Language` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Language").toString())); + } + if ((jsonObj.get("Verified") != null && !jsonObj.get("Verified").isJsonNull()) && !jsonObj.get("Verified").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Verified` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Verified").toString())); + } + if ((jsonObj.get("UpdatedTime") != null && !jsonObj.get("UpdatedTime").isJsonNull()) && !jsonObj.get("UpdatedTime").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UpdatedTime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UpdatedTime").toString())); + } + if ((jsonObj.get("IsGeoEnabled") != null && !jsonObj.get("IsGeoEnabled").isJsonNull()) && !jsonObj.get("IsGeoEnabled").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IsGeoEnabled` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IsGeoEnabled").toString())); + } + if ((jsonObj.get("Associations") != null && !jsonObj.get("Associations").isJsonNull()) && !jsonObj.get("Associations").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Associations` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Associations").toString())); + } + if ((jsonObj.get("Honors") != null && !jsonObj.get("Honors").isJsonNull()) && !jsonObj.get("Honors").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Honors` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Honors").toString())); + } + if ((jsonObj.get("HttpsImageUrl") != null && !jsonObj.get("HttpsImageUrl").isJsonNull()) && !jsonObj.get("HttpsImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HttpsImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HttpsImageUrl").toString())); + } + if ((jsonObj.get("MainAddress") != null && !jsonObj.get("MainAddress").isJsonNull()) && !jsonObj.get("MainAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MainAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MainAddress").toString())); + } + if ((jsonObj.get("Created") != null && !jsonObj.get("Created").isJsonNull()) && !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("LocalCity") != null && !jsonObj.get("LocalCity").isJsonNull()) && !jsonObj.get("LocalCity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalCity").toString())); + } + if ((jsonObj.get("ProfileCity") != null && !jsonObj.get("ProfileCity").isJsonNull()) && !jsonObj.get("ProfileCity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileCity").toString())); + } + if ((jsonObj.get("LocalCountry") != null && !jsonObj.get("LocalCountry").isJsonNull()) && !jsonObj.get("LocalCountry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalCountry").toString())); + } + if ((jsonObj.get("ProfileCountry") != null && !jsonObj.get("ProfileCountry").isJsonNull()) && !jsonObj.get("ProfileCountry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileCountry").toString())); + } + if ((jsonObj.get("RelationshipStatus") != null && !jsonObj.get("RelationshipStatus").isJsonNull()) && !jsonObj.get("RelationshipStatus").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RelationshipStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RelationshipStatus").toString())); + } + if ((jsonObj.get("Quota") != null && !jsonObj.get("Quota").isJsonNull()) && !jsonObj.get("Quota").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Quota` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Quota").toString())); + } + if ((jsonObj.get("Quote") != null && !jsonObj.get("Quote").isJsonNull()) && !jsonObj.get("Quote").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Quote` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Quote").toString())); + } + if ((jsonObj.get("Religion") != null && !jsonObj.get("Religion").isJsonNull()) && !jsonObj.get("Religion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Religion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Religion").toString())); + } + if ((jsonObj.get("Political") != null && !jsonObj.get("Political").isJsonNull()) && !jsonObj.get("Political").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Political` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Political").toString())); + } + if ((jsonObj.get("PublicRepository") != null && !jsonObj.get("PublicRepository").isJsonNull()) && !jsonObj.get("PublicRepository").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PublicRepository` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PublicRepository").toString())); + } + if ((jsonObj.get("RepositoryUrl") != null && !jsonObj.get("RepositoryUrl").isJsonNull()) && !jsonObj.get("RepositoryUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RepositoryUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RepositoryUrl").toString())); + } + if ((jsonObj.get("Age") != null && !jsonObj.get("Age").isJsonNull()) && !jsonObj.get("Age").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Age` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Age").toString())); + } + if ((jsonObj.get("ProfessionalHeadline") != null && !jsonObj.get("ProfessionalHeadline").isJsonNull()) && !jsonObj.get("ProfessionalHeadline").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfessionalHeadline` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfessionalHeadline").toString())); + } + if ((jsonObj.get("LRUserID") != null && !jsonObj.get("LRUserID").isJsonNull()) && !jsonObj.get("LRUserID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LRUserID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LRUserID").toString())); + } + if ((jsonObj.get("Currency") != null && !jsonObj.get("Currency").isJsonNull()) && !jsonObj.get("Currency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Currency").toString())); + } + if ((jsonObj.get("StarredUrl") != null && !jsonObj.get("StarredUrl").isJsonNull()) && !jsonObj.get("StarredUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `StarredUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("StarredUrl").toString())); + } + if ((jsonObj.get("GistsUrl") != null && !jsonObj.get("GistsUrl").isJsonNull()) && !jsonObj.get("GistsUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GistsUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GistsUrl").toString())); + } + if ((jsonObj.get("Company") != null && !jsonObj.get("Company").isJsonNull()) && !jsonObj.get("Company").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Company` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Company").toString())); + } + if ((jsonObj.get("GravatarImageUrl") != null && !jsonObj.get("GravatarImageUrl").isJsonNull()) && !jsonObj.get("GravatarImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GravatarImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GravatarImageUrl").toString())); + } + // validate the optional field `PrivacyPolicy` + if (jsonObj.get("PrivacyPolicy") != null && !jsonObj.get("PrivacyPolicy").isJsonNull()) { + ProfilePrivacyPolicy.validateJsonElement(jsonObj.get("PrivacyPolicy")); + } + // validate the optional field `Country` + if (jsonObj.get("Country") != null && !jsonObj.get("Country").isJsonNull()) { + ProfileCountry.validateJsonElement(jsonObj.get("Country")); + } + // validate the optional field `AgeRange` + if (jsonObj.get("AgeRange") != null && !jsonObj.get("AgeRange").isJsonNull()) { + ProfileAgeRange.validateJsonElement(jsonObj.get("AgeRange")); + } + // validate the optional field `KloutScore` + if (jsonObj.get("KloutScore") != null && !jsonObj.get("KloutScore").isJsonNull()) { + ProfileKloutScore.validateJsonElement(jsonObj.get("KloutScore")); + } + // validate the optional field `Suggestions` + if (jsonObj.get("Suggestions") != null && !jsonObj.get("Suggestions").isJsonNull()) { + ProfileSuggestions.validateJsonElement(jsonObj.get("Suggestions")); + } + // validate the optional field `Subscription` + if (jsonObj.get("Subscription") != null && !jsonObj.get("Subscription").isJsonNull()) { + ProfileSubscription.validateJsonElement(jsonObj.get("Subscription")); + } + // validate the optional field `PIN` + if (jsonObj.get("PIN") != null && !jsonObj.get("PIN").isJsonNull()) { + ProfilePIN.validateJsonElement(jsonObj.get("PIN")); + } + // validate the optional field `ConsentProfile` + if (jsonObj.get("ConsentProfile") != null && !jsonObj.get("ConsentProfile").isJsonNull()) { + ProfileConsentProfile.validateJsonElement(jsonObj.get("ConsentProfile")); + } + // validate the optional field `RegistrationData` + if (jsonObj.get("RegistrationData") != null && !jsonObj.get("RegistrationData").isJsonNull()) { + ProfileRegistrationData.validateJsonElement(jsonObj.get("RegistrationData")); + } + // validate the optional field `ProviderAccessCredential` + if (jsonObj.get("ProviderAccessCredential") != null && !jsonObj.get("ProviderAccessCredential").isJsonNull()) { + ProfileProviderAccessCredential.validateJsonElement(jsonObj.get("ProviderAccessCredential")); + } + // ensure the optional json data is an array if present + if (jsonObj.get("Roles") != null && !jsonObj.get("Roles").isJsonNull() && !jsonObj.get("Roles").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Roles` to be an array in the JSON string but got `%s`", jsonObj.get("Roles").toString())); + } + if ((jsonObj.get("Uid") != null && !jsonObj.get("Uid").isJsonNull()) && !jsonObj.get("Uid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Uid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Uid").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("PreviousUids") != null && !jsonObj.get("PreviousUids").isJsonNull() && !jsonObj.get("PreviousUids").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PreviousUids` to be an array in the JSON string but got `%s`", jsonObj.get("PreviousUids").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("InterestedIn") != null && !jsonObj.get("InterestedIn").isJsonNull() && !jsonObj.get("InterestedIn").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `InterestedIn` to be an array in the JSON string but got `%s`", jsonObj.get("InterestedIn").toString())); + } + if (jsonObj.get("ExternalIds") != null && !jsonObj.get("ExternalIds").isJsonNull()) { + JsonArray jsonArrayexternalIds = jsonObj.getAsJsonArray("ExternalIds"); + if (jsonArrayexternalIds != null) { + // ensure the json data is an array + if (!jsonObj.get("ExternalIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ExternalIds` to be an array in the JSON string but got `%s`", jsonObj.get("ExternalIds").toString())); + } + + // validate the optional field `ExternalIds` (array) + for (int i = 0; i < jsonArrayexternalIds.size(); i++) { + ProfileExternalIdsInner.validateJsonElement(jsonArrayexternalIds.get(i)); + }; + } + } + if (jsonObj.get("UnverifiedEmail") != null && !jsonObj.get("UnverifiedEmail").isJsonNull()) { + JsonArray jsonArrayunverifiedEmail = jsonObj.getAsJsonArray("UnverifiedEmail"); + if (jsonArrayunverifiedEmail != null) { + // ensure the json data is an array + if (!jsonObj.get("UnverifiedEmail").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `UnverifiedEmail` to be an array in the JSON string but got `%s`", jsonObj.get("UnverifiedEmail").toString())); + } + + // validate the optional field `UnverifiedEmail` (array) + for (int i = 0; i < jsonArrayunverifiedEmail.size(); i++) { + ProfileUnverifiedEmailInner.validateJsonElement(jsonArrayunverifiedEmail.get(i)); + }; + } + } + if (jsonObj.get("Positions") != null && !jsonObj.get("Positions").isJsonNull()) { + JsonArray jsonArraypositions = jsonObj.getAsJsonArray("Positions"); + if (jsonArraypositions != null) { + // ensure the json data is an array + if (!jsonObj.get("Positions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Positions` to be an array in the JSON string but got `%s`", jsonObj.get("Positions").toString())); + } + + // validate the optional field `Positions` (array) + for (int i = 0; i < jsonArraypositions.size(); i++) { + ProfilePositionsInner.validateJsonElement(jsonArraypositions.get(i)); + }; + } + } + if (jsonObj.get("Educations") != null && !jsonObj.get("Educations").isJsonNull()) { + JsonArray jsonArrayeducations = jsonObj.getAsJsonArray("Educations"); + if (jsonArrayeducations != null) { + // ensure the json data is an array + if (!jsonObj.get("Educations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Educations` to be an array in the JSON string but got `%s`", jsonObj.get("Educations").toString())); + } + + // validate the optional field `Educations` (array) + for (int i = 0; i < jsonArrayeducations.size(); i++) { + ProfileEducationsInner.validateJsonElement(jsonArrayeducations.get(i)); + }; + } + } + if (jsonObj.get("PhoneNumbers") != null && !jsonObj.get("PhoneNumbers").isJsonNull()) { + JsonArray jsonArrayphoneNumbers = jsonObj.getAsJsonArray("PhoneNumbers"); + if (jsonArrayphoneNumbers != null) { + // ensure the json data is an array + if (!jsonObj.get("PhoneNumbers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PhoneNumbers` to be an array in the JSON string but got `%s`", jsonObj.get("PhoneNumbers").toString())); + } + + // validate the optional field `PhoneNumbers` (array) + for (int i = 0; i < jsonArrayphoneNumbers.size(); i++) { + ProfilePhoneNumbersInner.validateJsonElement(jsonArrayphoneNumbers.get(i)); + }; + } + } + if (jsonObj.get("IMAccounts") != null && !jsonObj.get("IMAccounts").isJsonNull()) { + JsonArray jsonArrayimAccounts = jsonObj.getAsJsonArray("IMAccounts"); + if (jsonArrayimAccounts != null) { + // ensure the json data is an array + if (!jsonObj.get("IMAccounts").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `IMAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("IMAccounts").toString())); + } + + // validate the optional field `IMAccounts` (array) + for (int i = 0; i < jsonArrayimAccounts.size(); i++) { + ProfileIMAccountsInner.validateJsonElement(jsonArrayimAccounts.get(i)); + }; + } + } + if (jsonObj.get("Addresses") != null && !jsonObj.get("Addresses").isJsonNull()) { + JsonArray jsonArrayaddresses = jsonObj.getAsJsonArray("Addresses"); + if (jsonArrayaddresses != null) { + // ensure the json data is an array + if (!jsonObj.get("Addresses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Addresses` to be an array in the JSON string but got `%s`", jsonObj.get("Addresses").toString())); + } + + // validate the optional field `Addresses` (array) + for (int i = 0; i < jsonArrayaddresses.size(); i++) { + ProfileAddressesInner.validateJsonElement(jsonArrayaddresses.get(i)); + }; + } + } + if (jsonObj.get("Interests") != null && !jsonObj.get("Interests").isJsonNull()) { + JsonArray jsonArrayinterests = jsonObj.getAsJsonArray("Interests"); + if (jsonArrayinterests != null) { + // ensure the json data is an array + if (!jsonObj.get("Interests").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Interests` to be an array in the JSON string but got `%s`", jsonObj.get("Interests").toString())); + } + + // validate the optional field `Interests` (array) + for (int i = 0; i < jsonArrayinterests.size(); i++) { + ProfileInterestsInner.validateJsonElement(jsonArrayinterests.get(i)); + }; + } + } + if (jsonObj.get("Sports") != null && !jsonObj.get("Sports").isJsonNull()) { + JsonArray jsonArraysports = jsonObj.getAsJsonArray("Sports"); + if (jsonArraysports != null) { + // ensure the json data is an array + if (!jsonObj.get("Sports").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Sports` to be an array in the JSON string but got `%s`", jsonObj.get("Sports").toString())); + } + + // validate the optional field `Sports` (array) + for (int i = 0; i < jsonArraysports.size(); i++) { + ProfileSportsInner.validateJsonElement(jsonArraysports.get(i)); + }; + } + } + if (jsonObj.get("InspirationalPeople") != null && !jsonObj.get("InspirationalPeople").isJsonNull()) { + JsonArray jsonArrayinspirationalPeople = jsonObj.getAsJsonArray("InspirationalPeople"); + if (jsonArrayinspirationalPeople != null) { + // ensure the json data is an array + if (!jsonObj.get("InspirationalPeople").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `InspirationalPeople` to be an array in the JSON string but got `%s`", jsonObj.get("InspirationalPeople").toString())); + } + + // validate the optional field `InspirationalPeople` (array) + for (int i = 0; i < jsonArrayinspirationalPeople.size(); i++) { + ProfileInspirationalPeopleInner.validateJsonElement(jsonArrayinspirationalPeople.get(i)); + }; + } + } + if (jsonObj.get("Awards") != null && !jsonObj.get("Awards").isJsonNull()) { + JsonArray jsonArrayawards = jsonObj.getAsJsonArray("Awards"); + if (jsonArrayawards != null) { + // ensure the json data is an array + if (!jsonObj.get("Awards").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Awards` to be an array in the JSON string but got `%s`", jsonObj.get("Awards").toString())); + } + + // validate the optional field `Awards` (array) + for (int i = 0; i < jsonArrayawards.size(); i++) { + ProfileAwardsInner.validateJsonElement(jsonArrayawards.get(i)); + }; + } + } + if (jsonObj.get("Skills") != null && !jsonObj.get("Skills").isJsonNull()) { + JsonArray jsonArrayskills = jsonObj.getAsJsonArray("Skills"); + if (jsonArrayskills != null) { + // ensure the json data is an array + if (!jsonObj.get("Skills").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Skills` to be an array in the JSON string but got `%s`", jsonObj.get("Skills").toString())); + } + + // validate the optional field `Skills` (array) + for (int i = 0; i < jsonArrayskills.size(); i++) { + ProfileSkillsInner.validateJsonElement(jsonArrayskills.get(i)); + }; + } + } + if (jsonObj.get("CurrentStatus") != null && !jsonObj.get("CurrentStatus").isJsonNull()) { + JsonArray jsonArraycurrentStatus = jsonObj.getAsJsonArray("CurrentStatus"); + if (jsonArraycurrentStatus != null) { + // ensure the json data is an array + if (!jsonObj.get("CurrentStatus").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `CurrentStatus` to be an array in the JSON string but got `%s`", jsonObj.get("CurrentStatus").toString())); + } + + // validate the optional field `CurrentStatus` (array) + for (int i = 0; i < jsonArraycurrentStatus.size(); i++) { + ProfileCurrentStatusInner.validateJsonElement(jsonArraycurrentStatus.get(i)); + }; + } + } + if (jsonObj.get("Certifications") != null && !jsonObj.get("Certifications").isJsonNull()) { + JsonArray jsonArraycertifications = jsonObj.getAsJsonArray("Certifications"); + if (jsonArraycertifications != null) { + // ensure the json data is an array + if (!jsonObj.get("Certifications").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Certifications` to be an array in the JSON string but got `%s`", jsonObj.get("Certifications").toString())); + } + + // validate the optional field `Certifications` (array) + for (int i = 0; i < jsonArraycertifications.size(); i++) { + ProfileCertificationsInner.validateJsonElement(jsonArraycertifications.get(i)); + }; + } + } + if (jsonObj.get("Courses") != null && !jsonObj.get("Courses").isJsonNull()) { + JsonArray jsonArraycourses = jsonObj.getAsJsonArray("Courses"); + if (jsonArraycourses != null) { + // ensure the json data is an array + if (!jsonObj.get("Courses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Courses` to be an array in the JSON string but got `%s`", jsonObj.get("Courses").toString())); + } + + // validate the optional field `Courses` (array) + for (int i = 0; i < jsonArraycourses.size(); i++) { + ProfileCoursesInner.validateJsonElement(jsonArraycourses.get(i)); + }; + } + } + if (jsonObj.get("Volunteer") != null && !jsonObj.get("Volunteer").isJsonNull()) { + JsonArray jsonArrayvolunteer = jsonObj.getAsJsonArray("Volunteer"); + if (jsonArrayvolunteer != null) { + // ensure the json data is an array + if (!jsonObj.get("Volunteer").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Volunteer` to be an array in the JSON string but got `%s`", jsonObj.get("Volunteer").toString())); + } + + // validate the optional field `Volunteer` (array) + for (int i = 0; i < jsonArrayvolunteer.size(); i++) { + ProfileVolunteerInner.validateJsonElement(jsonArrayvolunteer.get(i)); + }; + } + } + if (jsonObj.get("RecommendationsReceived") != null && !jsonObj.get("RecommendationsReceived").isJsonNull()) { + JsonArray jsonArrayrecommendationsReceived = jsonObj.getAsJsonArray("RecommendationsReceived"); + if (jsonArrayrecommendationsReceived != null) { + // ensure the json data is an array + if (!jsonObj.get("RecommendationsReceived").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RecommendationsReceived` to be an array in the JSON string but got `%s`", jsonObj.get("RecommendationsReceived").toString())); + } + + // validate the optional field `RecommendationsReceived` (array) + for (int i = 0; i < jsonArrayrecommendationsReceived.size(); i++) { + ProfileRecommendationsReceivedInner.validateJsonElement(jsonArrayrecommendationsReceived.get(i)); + }; + } + } + if (jsonObj.get("Languages") != null && !jsonObj.get("Languages").isJsonNull()) { + JsonArray jsonArraylanguages = jsonObj.getAsJsonArray("Languages"); + if (jsonArraylanguages != null) { + // ensure the json data is an array + if (!jsonObj.get("Languages").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Languages` to be an array in the JSON string but got `%s`", jsonObj.get("Languages").toString())); + } + + // validate the optional field `Languages` (array) + for (int i = 0; i < jsonArraylanguages.size(); i++) { + ProfileLanguagesInner.validateJsonElement(jsonArraylanguages.get(i)); + }; + } + } + if (jsonObj.get("Projects") != null && !jsonObj.get("Projects").isJsonNull()) { + JsonArray jsonArrayprojects = jsonObj.getAsJsonArray("Projects"); + if (jsonArrayprojects != null) { + // ensure the json data is an array + if (!jsonObj.get("Projects").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Projects` to be an array in the JSON string but got `%s`", jsonObj.get("Projects").toString())); + } + + // validate the optional field `Projects` (array) + for (int i = 0; i < jsonArrayprojects.size(); i++) { + ProfileProjectsInner.validateJsonElement(jsonArrayprojects.get(i)); + }; + } + } + if (jsonObj.get("Games") != null && !jsonObj.get("Games").isJsonNull()) { + JsonArray jsonArraygames = jsonObj.getAsJsonArray("Games"); + if (jsonArraygames != null) { + // ensure the json data is an array + if (!jsonObj.get("Games").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Games` to be an array in the JSON string but got `%s`", jsonObj.get("Games").toString())); + } + + // validate the optional field `Games` (array) + for (int i = 0; i < jsonArraygames.size(); i++) { + ProfileGamesInner.validateJsonElement(jsonArraygames.get(i)); + }; + } + } + if (jsonObj.get("Family") != null && !jsonObj.get("Family").isJsonNull()) { + JsonArray jsonArrayfamily = jsonObj.getAsJsonArray("Family"); + if (jsonArrayfamily != null) { + // ensure the json data is an array + if (!jsonObj.get("Family").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Family` to be an array in the JSON string but got `%s`", jsonObj.get("Family").toString())); + } + + // validate the optional field `Family` (array) + for (int i = 0; i < jsonArrayfamily.size(); i++) { + ProfileFamilyInner.validateJsonElement(jsonArrayfamily.get(i)); + }; + } + } + if (jsonObj.get("TelevisionShow") != null && !jsonObj.get("TelevisionShow").isJsonNull()) { + JsonArray jsonArraytelevisionShow = jsonObj.getAsJsonArray("TelevisionShow"); + if (jsonArraytelevisionShow != null) { + // ensure the json data is an array + if (!jsonObj.get("TelevisionShow").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `TelevisionShow` to be an array in the JSON string but got `%s`", jsonObj.get("TelevisionShow").toString())); + } + + // validate the optional field `TelevisionShow` (array) + for (int i = 0; i < jsonArraytelevisionShow.size(); i++) { + ProfileTelevisionShowInner.validateJsonElement(jsonArraytelevisionShow.get(i)); + }; + } + } + if (jsonObj.get("MutualFriends") != null && !jsonObj.get("MutualFriends").isJsonNull()) { + JsonArray jsonArraymutualFriends = jsonObj.getAsJsonArray("MutualFriends"); + if (jsonArraymutualFriends != null) { + // ensure the json data is an array + if (!jsonObj.get("MutualFriends").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `MutualFriends` to be an array in the JSON string but got `%s`", jsonObj.get("MutualFriends").toString())); + } + + // validate the optional field `MutualFriends` (array) + for (int i = 0; i < jsonArraymutualFriends.size(); i++) { + ProfileMutualFriendsInner.validateJsonElement(jsonArraymutualFriends.get(i)); + }; + } + } + if (jsonObj.get("Movies") != null && !jsonObj.get("Movies").isJsonNull()) { + JsonArray jsonArraymovies = jsonObj.getAsJsonArray("Movies"); + if (jsonArraymovies != null) { + // ensure the json data is an array + if (!jsonObj.get("Movies").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Movies` to be an array in the JSON string but got `%s`", jsonObj.get("Movies").toString())); + } + + // validate the optional field `Movies` (array) + for (int i = 0; i < jsonArraymovies.size(); i++) { + ProfileMoviesInner.validateJsonElement(jsonArraymovies.get(i)); + }; + } + } + if (jsonObj.get("Books") != null && !jsonObj.get("Books").isJsonNull()) { + JsonArray jsonArraybooks = jsonObj.getAsJsonArray("Books"); + if (jsonArraybooks != null) { + // ensure the json data is an array + if (!jsonObj.get("Books").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Books` to be an array in the JSON string but got `%s`", jsonObj.get("Books").toString())); + } + + // validate the optional field `Books` (array) + for (int i = 0; i < jsonArraybooks.size(); i++) { + ProfileBooksInner.validateJsonElement(jsonArraybooks.get(i)); + }; + } + } + if (jsonObj.get("Patents") != null && !jsonObj.get("Patents").isJsonNull()) { + JsonArray jsonArraypatents = jsonObj.getAsJsonArray("Patents"); + if (jsonArraypatents != null) { + // ensure the json data is an array + if (!jsonObj.get("Patents").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Patents` to be an array in the JSON string but got `%s`", jsonObj.get("Patents").toString())); + } + + // validate the optional field `Patents` (array) + for (int i = 0; i < jsonArraypatents.size(); i++) { + ProfilePatentsInner.validateJsonElement(jsonArraypatents.get(i)); + }; + } + } + if (jsonObj.get("FavoriteThings") != null && !jsonObj.get("FavoriteThings").isJsonNull()) { + JsonArray jsonArrayfavoriteThings = jsonObj.getAsJsonArray("FavoriteThings"); + if (jsonArrayfavoriteThings != null) { + // ensure the json data is an array + if (!jsonObj.get("FavoriteThings").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `FavoriteThings` to be an array in the JSON string but got `%s`", jsonObj.get("FavoriteThings").toString())); + } + + // validate the optional field `FavoriteThings` (array) + for (int i = 0; i < jsonArrayfavoriteThings.size(); i++) { + ProfileFavoriteThingsInner.validateJsonElement(jsonArrayfavoriteThings.get(i)); + }; + } + } + if (jsonObj.get("RelatedProfileViews") != null && !jsonObj.get("RelatedProfileViews").isJsonNull()) { + JsonArray jsonArrayrelatedProfileViews = jsonObj.getAsJsonArray("RelatedProfileViews"); + if (jsonArrayrelatedProfileViews != null) { + // ensure the json data is an array + if (!jsonObj.get("RelatedProfileViews").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RelatedProfileViews` to be an array in the JSON string but got `%s`", jsonObj.get("RelatedProfileViews").toString())); + } + + // validate the optional field `RelatedProfileViews` (array) + for (int i = 0; i < jsonArrayrelatedProfileViews.size(); i++) { + ProfileRelatedProfileViewsInner.validateJsonElement(jsonArrayrelatedProfileViews.get(i)); + }; + } + } + if (jsonObj.get("PlacesLived") != null && !jsonObj.get("PlacesLived").isJsonNull()) { + JsonArray jsonArrayplacesLived = jsonObj.getAsJsonArray("PlacesLived"); + if (jsonArrayplacesLived != null) { + // ensure the json data is an array + if (!jsonObj.get("PlacesLived").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PlacesLived` to be an array in the JSON string but got `%s`", jsonObj.get("PlacesLived").toString())); + } + + // validate the optional field `PlacesLived` (array) + for (int i = 0; i < jsonArrayplacesLived.size(); i++) { + ProfilePlacesLivedInner.validateJsonElement(jsonArrayplacesLived.get(i)); + }; + } + } + if (jsonObj.get("Publications") != null && !jsonObj.get("Publications").isJsonNull()) { + JsonArray jsonArraypublications = jsonObj.getAsJsonArray("Publications"); + if (jsonArraypublications != null) { + // ensure the json data is an array + if (!jsonObj.get("Publications").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Publications` to be an array in the JSON string but got `%s`", jsonObj.get("Publications").toString())); + } + + // validate the optional field `Publications` (array) + for (int i = 0; i < jsonArraypublications.size(); i++) { + ProfilePublicationsInner.validateJsonElement(jsonArraypublications.get(i)); + }; + } + } + if (jsonObj.get("JobBookmarks") != null && !jsonObj.get("JobBookmarks").isJsonNull()) { + JsonArray jsonArrayjobBookmarks = jsonObj.getAsJsonArray("JobBookmarks"); + if (jsonArrayjobBookmarks != null) { + // ensure the json data is an array + if (!jsonObj.get("JobBookmarks").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `JobBookmarks` to be an array in the JSON string but got `%s`", jsonObj.get("JobBookmarks").toString())); + } + + // validate the optional field `JobBookmarks` (array) + for (int i = 0; i < jsonArrayjobBookmarks.size(); i++) { + ProfileJobBookmarksInner.validateJsonElement(jsonArrayjobBookmarks.get(i)); + }; + } + } + if (jsonObj.get("Badges") != null && !jsonObj.get("Badges").isJsonNull()) { + JsonArray jsonArraybadges = jsonObj.getAsJsonArray("Badges"); + if (jsonArraybadges != null) { + // ensure the json data is an array + if (!jsonObj.get("Badges").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Badges` to be an array in the JSON string but got `%s`", jsonObj.get("Badges").toString())); + } + + // validate the optional field `Badges` (array) + for (int i = 0; i < jsonArraybadges.size(); i++) { + ProfileBadgesInner.validateJsonElement(jsonArraybadges.get(i)); + }; + } + } + if (jsonObj.get("MemberUrlResources") != null && !jsonObj.get("MemberUrlResources").isJsonNull()) { + JsonArray jsonArraymemberUrlResources = jsonObj.getAsJsonArray("MemberUrlResources"); + if (jsonArraymemberUrlResources != null) { + // ensure the json data is an array + if (!jsonObj.get("MemberUrlResources").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `MemberUrlResources` to be an array in the JSON string but got `%s`", jsonObj.get("MemberUrlResources").toString())); + } + + // validate the optional field `MemberUrlResources` (array) + for (int i = 0; i < jsonArraymemberUrlResources.size(); i++) { + ProfileMemberUrlResourcesInner.validateJsonElement(jsonArraymemberUrlResources.get(i)); + }; + } + } + if (jsonObj.get("Organizations") != null && !jsonObj.get("Organizations").isJsonNull()) { + JsonArray jsonArrayorganizations = jsonObj.getAsJsonArray("Organizations"); + if (jsonArrayorganizations != null) { + // ensure the json data is an array + if (!jsonObj.get("Organizations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Organizations` to be an array in the JSON string but got `%s`", jsonObj.get("Organizations").toString())); + } + + // validate the optional field `Organizations` (array) + for (int i = 0; i < jsonArrayorganizations.size(); i++) { + ProfileOrganizationsInner.validateJsonElement(jsonArrayorganizations.get(i)); + }; + } + } + if (jsonObj.get("Email") != null && !jsonObj.get("Email").isJsonNull()) { + JsonArray jsonArrayemail = jsonObj.getAsJsonArray("Email"); + if (jsonArrayemail != null) { + // ensure the json data is an array + if (!jsonObj.get("Email").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Email` to be an array in the JSON string but got `%s`", jsonObj.get("Email").toString())); + } + + // validate the optional field `Email` (array) + for (int i = 0; i < jsonArrayemail.size(); i++) { + ProfileEmailInner.validateJsonElement(jsonArrayemail.get(i)); + }; + } + } + // validate the optional field `PasskeyLogin` + if (jsonObj.get("PasskeyLogin") != null && !jsonObj.get("PasskeyLogin").isJsonNull()) { + ProfilePasskeyLogin.validateJsonElement(jsonObj.get("PasskeyLogin")); + } + if (jsonObj.get("Identities") != null && !jsonObj.get("Identities").isJsonNull()) { + JsonArray jsonArrayidentities = jsonObj.getAsJsonArray("Identities"); + if (jsonArrayidentities != null) { + // ensure the json data is an array + if (!jsonObj.get("Identities").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Identities` to be an array in the JSON string but got `%s`", jsonObj.get("Identities").toString())); + } + + // validate the optional field `Identities` (array) + for (int i = 0; i < jsonArrayidentities.size(); i++) { + SocialIdentity.validateJsonElement(jsonArrayidentities.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!Profile.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Profile' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<Profile> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Profile.class)); + + return (TypeAdapter<T>) new TypeAdapter<Profile>() { + @Override + public void write(JsonWriter out, Profile value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Profile read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Profile instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Profile given an JSON string + * + * @param jsonString JSON string + * @return An instance of Profile + * @throws IOException if the JSON string is invalid with respect to Profile + */ + public static Profile fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Profile.class); + } + + /** + * Convert an instance of Profile to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileAddressesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileAddressesInner.java new file mode 100644 index 0000000..8ed97dd --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileAddressesInner.java @@ -0,0 +1,527 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileAddressesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileAddressesInner { + public static final String SERIALIZED_NAME_TYPE = "Type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_ADDRESS1 = "Address1"; + @SerializedName(SERIALIZED_NAME_ADDRESS1) + @javax.annotation.Nullable + private String address1; + + public static final String SERIALIZED_NAME_ADDRESS2 = "Address2"; + @SerializedName(SERIALIZED_NAME_ADDRESS2) + @javax.annotation.Nullable + private String address2; + + public static final String SERIALIZED_NAME_CITY = "City"; + @SerializedName(SERIALIZED_NAME_CITY) + @javax.annotation.Nullable + private String city; + + public static final String SERIALIZED_NAME_STATE = "State"; + @SerializedName(SERIALIZED_NAME_STATE) + @javax.annotation.Nullable + private String state; + + public static final String SERIALIZED_NAME_POSTAL_CODE = "PostalCode"; + @SerializedName(SERIALIZED_NAME_POSTAL_CODE) + @javax.annotation.Nullable + private String postalCode; + + public static final String SERIALIZED_NAME_REGION = "Region"; + @SerializedName(SERIALIZED_NAME_REGION) + @javax.annotation.Nullable + private String region; + + public static final String SERIALIZED_NAME_COUNTRY = "Country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + @javax.annotation.Nullable + private String country; + + public static final String SERIALIZED_NAME_OPERATION = "Operation"; + @SerializedName(SERIALIZED_NAME_OPERATION) + @javax.annotation.Nullable + private String operation; + + public ProfileAddressesInner() { + } + + public ProfileAddressesInner type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * The type of address (e.g., Home, Work). + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public ProfileAddressesInner address1(@javax.annotation.Nullable String address1) { + this.address1 = address1; + return this; + } + + /** + * The first line of the address. + * @return address1 + */ + @javax.annotation.Nullable + public String getAddress1() { + return address1; + } + + public void setAddress1(@javax.annotation.Nullable String address1) { + this.address1 = address1; + } + + + public ProfileAddressesInner address2(@javax.annotation.Nullable String address2) { + this.address2 = address2; + return this; + } + + /** + * The second line of the address. + * @return address2 + */ + @javax.annotation.Nullable + public String getAddress2() { + return address2; + } + + public void setAddress2(@javax.annotation.Nullable String address2) { + this.address2 = address2; + } + + + public ProfileAddressesInner city(@javax.annotation.Nullable String city) { + this.city = city; + return this; + } + + /** + * The city of the address. + * @return city + */ + @javax.annotation.Nullable + public String getCity() { + return city; + } + + public void setCity(@javax.annotation.Nullable String city) { + this.city = city; + } + + + public ProfileAddressesInner state(@javax.annotation.Nullable String state) { + this.state = state; + return this; + } + + /** + * The state of the address. + * @return state + */ + @javax.annotation.Nullable + public String getState() { + return state; + } + + public void setState(@javax.annotation.Nullable String state) { + this.state = state; + } + + + public ProfileAddressesInner postalCode(@javax.annotation.Nullable String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** + * The postal code of the address. + * @return postalCode + */ + @javax.annotation.Nullable + public String getPostalCode() { + return postalCode; + } + + public void setPostalCode(@javax.annotation.Nullable String postalCode) { + this.postalCode = postalCode; + } + + + public ProfileAddressesInner region(@javax.annotation.Nullable String region) { + this.region = region; + return this; + } + + /** + * The region of the address. + * @return region + */ + @javax.annotation.Nullable + public String getRegion() { + return region; + } + + public void setRegion(@javax.annotation.Nullable String region) { + this.region = region; + } + + + public ProfileAddressesInner country(@javax.annotation.Nullable String country) { + this.country = country; + return this; + } + + /** + * The country of the address. + * @return country + */ + @javax.annotation.Nullable + public String getCountry() { + return country; + } + + public void setCountry(@javax.annotation.Nullable String country) { + this.country = country; + } + + + public ProfileAddressesInner operation(@javax.annotation.Nullable String operation) { + this.operation = operation; + return this; + } + + /** + * The operation performed on the address. + * @return operation + */ + @javax.annotation.Nullable + public String getOperation() { + return operation; + } + + public void setOperation(@javax.annotation.Nullable String operation) { + this.operation = operation; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileAddressesInner instance itself + */ + public ProfileAddressesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileAddressesInner profileAddressesInner = (ProfileAddressesInner) o; + return Objects.equals(this.type, profileAddressesInner.type) && + Objects.equals(this.address1, profileAddressesInner.address1) && + Objects.equals(this.address2, profileAddressesInner.address2) && + Objects.equals(this.city, profileAddressesInner.city) && + Objects.equals(this.state, profileAddressesInner.state) && + Objects.equals(this.postalCode, profileAddressesInner.postalCode) && + Objects.equals(this.region, profileAddressesInner.region) && + Objects.equals(this.country, profileAddressesInner.country) && + Objects.equals(this.operation, profileAddressesInner.operation)&& + Objects.equals(this.additionalProperties, profileAddressesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, address1, address2, city, state, postalCode, region, country, operation, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileAddressesInner {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" address1: ").append(toIndentedString(address1)).append("\n"); + sb.append(" address2: ").append(toIndentedString(address2)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" postalCode: ").append(toIndentedString(postalCode)).append("\n"); + sb.append(" region: ").append(toIndentedString(region)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" operation: ").append(toIndentedString(operation)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Type"); + openapiFields.add("Address1"); + openapiFields.add("Address2"); + openapiFields.add("City"); + openapiFields.add("State"); + openapiFields.add("PostalCode"); + openapiFields.add("Region"); + openapiFields.add("Country"); + openapiFields.add("Operation"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileAddressesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileAddressesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileAddressesInner is not found in the empty JSON string", ProfileAddressesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonNull()) && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + if ((jsonObj.get("Address1") != null && !jsonObj.get("Address1").isJsonNull()) && !jsonObj.get("Address1").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Address1` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Address1").toString())); + } + if ((jsonObj.get("Address2") != null && !jsonObj.get("Address2").isJsonNull()) && !jsonObj.get("Address2").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Address2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Address2").toString())); + } + if ((jsonObj.get("City") != null && !jsonObj.get("City").isJsonNull()) && !jsonObj.get("City").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `City` to be a primitive type in the JSON string but got `%s`", jsonObj.get("City").toString())); + } + if ((jsonObj.get("State") != null && !jsonObj.get("State").isJsonNull()) && !jsonObj.get("State").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `State` to be a primitive type in the JSON string but got `%s`", jsonObj.get("State").toString())); + } + if ((jsonObj.get("PostalCode") != null && !jsonObj.get("PostalCode").isJsonNull()) && !jsonObj.get("PostalCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PostalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PostalCode").toString())); + } + if ((jsonObj.get("Region") != null && !jsonObj.get("Region").isJsonNull()) && !jsonObj.get("Region").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Region").toString())); + } + if ((jsonObj.get("Country") != null && !jsonObj.get("Country").isJsonNull()) && !jsonObj.get("Country").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Country").toString())); + } + if ((jsonObj.get("Operation") != null && !jsonObj.get("Operation").isJsonNull()) && !jsonObj.get("Operation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Operation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Operation").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileAddressesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileAddressesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileAddressesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileAddressesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileAddressesInner>() { + @Override + public void write(JsonWriter out, ProfileAddressesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileAddressesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileAddressesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileAddressesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileAddressesInner + * @throws IOException if the JSON string is invalid with respect to ProfileAddressesInner + */ + public static ProfileAddressesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileAddressesInner.class); + } + + /** + * Convert an instance of ProfileAddressesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileAgeRange.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileAgeRange.java new file mode 100644 index 0000000..106437d --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileAgeRange.java @@ -0,0 +1,311 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileAgeRange + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileAgeRange { + public static final String SERIALIZED_NAME_MIN = "Min"; + @SerializedName(SERIALIZED_NAME_MIN) + @javax.annotation.Nullable + private Integer min; + + public static final String SERIALIZED_NAME_MAX = "Max"; + @SerializedName(SERIALIZED_NAME_MAX) + @javax.annotation.Nullable + private Integer max; + + public ProfileAgeRange() { + } + + public ProfileAgeRange min(@javax.annotation.Nullable Integer min) { + this.min = min; + return this; + } + + /** + * The minimum age in the range. + * @return min + */ + @javax.annotation.Nullable + public Integer getMin() { + return min; + } + + public void setMin(@javax.annotation.Nullable Integer min) { + this.min = min; + } + + + public ProfileAgeRange max(@javax.annotation.Nullable Integer max) { + this.max = max; + return this; + } + + /** + * The maximum age in the range. + * @return max + */ + @javax.annotation.Nullable + public Integer getMax() { + return max; + } + + public void setMax(@javax.annotation.Nullable Integer max) { + this.max = max; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileAgeRange instance itself + */ + public ProfileAgeRange putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileAgeRange profileAgeRange = (ProfileAgeRange) o; + return Objects.equals(this.min, profileAgeRange.min) && + Objects.equals(this.max, profileAgeRange.max)&& + Objects.equals(this.additionalProperties, profileAgeRange.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(min, max, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileAgeRange {\n"); + sb.append(" min: ").append(toIndentedString(min)).append("\n"); + sb.append(" max: ").append(toIndentedString(max)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Min"); + openapiFields.add("Max"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileAgeRange + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileAgeRange.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileAgeRange is not found in the empty JSON string", ProfileAgeRange.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileAgeRange.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileAgeRange' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileAgeRange> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileAgeRange.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileAgeRange>() { + @Override + public void write(JsonWriter out, ProfileAgeRange value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileAgeRange read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileAgeRange instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileAgeRange given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileAgeRange + * @throws IOException if the JSON string is invalid with respect to ProfileAgeRange + */ + public static ProfileAgeRange fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileAgeRange.class); + } + + /** + * Convert an instance of ProfileAgeRange to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileAwardsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileAwardsInner.java new file mode 100644 index 0000000..387a673 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileAwardsInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileAwardsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileAwardsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_ISSUER = "Issuer"; + @SerializedName(SERIALIZED_NAME_ISSUER) + @javax.annotation.Nullable + private String issuer; + + public ProfileAwardsInner() { + } + + public ProfileAwardsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the award. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileAwardsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the award. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileAwardsInner issuer(@javax.annotation.Nullable String issuer) { + this.issuer = issuer; + return this; + } + + /** + * The issuer of the award. + * @return issuer + */ + @javax.annotation.Nullable + public String getIssuer() { + return issuer; + } + + public void setIssuer(@javax.annotation.Nullable String issuer) { + this.issuer = issuer; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileAwardsInner instance itself + */ + public ProfileAwardsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileAwardsInner profileAwardsInner = (ProfileAwardsInner) o; + return Objects.equals(this.id, profileAwardsInner.id) && + Objects.equals(this.name, profileAwardsInner.name) && + Objects.equals(this.issuer, profileAwardsInner.issuer)&& + Objects.equals(this.additionalProperties, profileAwardsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, issuer, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileAwardsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" issuer: ").append(toIndentedString(issuer)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Issuer"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileAwardsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileAwardsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileAwardsInner is not found in the empty JSON string", ProfileAwardsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Issuer") != null && !jsonObj.get("Issuer").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileAwardsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileAwardsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileAwardsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileAwardsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileAwardsInner>() { + @Override + public void write(JsonWriter out, ProfileAwardsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileAwardsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileAwardsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileAwardsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileAwardsInner + * @throws IOException if the JSON string is invalid with respect to ProfileAwardsInner + */ + public static ProfileAwardsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileAwardsInner.class); + } + + /** + * Convert an instance of ProfileAwardsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileBadgesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileBadgesInner.java new file mode 100644 index 0000000..55f5cc8 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileBadgesInner.java @@ -0,0 +1,407 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileBadgesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileBadgesInner { + public static final String SERIALIZED_NAME_BADGE_ID = "BadgeId"; + @SerializedName(SERIALIZED_NAME_BADGE_ID) + @javax.annotation.Nullable + private String badgeId; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_BADGE_MESSAGE = "BadgeMessage"; + @SerializedName(SERIALIZED_NAME_BADGE_MESSAGE) + @javax.annotation.Nullable + private String badgeMessage; + + public static final String SERIALIZED_NAME_DESCRIPTION = "Description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_IMAGE_URL = "ImageUrl"; + @SerializedName(SERIALIZED_NAME_IMAGE_URL) + @javax.annotation.Nullable + private String imageUrl; + + public ProfileBadgesInner() { + } + + public ProfileBadgesInner badgeId(@javax.annotation.Nullable String badgeId) { + this.badgeId = badgeId; + return this; + } + + /** + * The ID of the badge. + * @return badgeId + */ + @javax.annotation.Nullable + public String getBadgeId() { + return badgeId; + } + + public void setBadgeId(@javax.annotation.Nullable String badgeId) { + this.badgeId = badgeId; + } + + + public ProfileBadgesInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the badge. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileBadgesInner badgeMessage(@javax.annotation.Nullable String badgeMessage) { + this.badgeMessage = badgeMessage; + return this; + } + + /** + * The message associated with the badge. + * @return badgeMessage + */ + @javax.annotation.Nullable + public String getBadgeMessage() { + return badgeMessage; + } + + public void setBadgeMessage(@javax.annotation.Nullable String badgeMessage) { + this.badgeMessage = badgeMessage; + } + + + public ProfileBadgesInner description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * A description of the badge. + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public ProfileBadgesInner imageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** + * The URL of the badge image. + * @return imageUrl + */ + @javax.annotation.Nullable + public String getImageUrl() { + return imageUrl; + } + + public void setImageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileBadgesInner instance itself + */ + public ProfileBadgesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileBadgesInner profileBadgesInner = (ProfileBadgesInner) o; + return Objects.equals(this.badgeId, profileBadgesInner.badgeId) && + Objects.equals(this.name, profileBadgesInner.name) && + Objects.equals(this.badgeMessage, profileBadgesInner.badgeMessage) && + Objects.equals(this.description, profileBadgesInner.description) && + Objects.equals(this.imageUrl, profileBadgesInner.imageUrl)&& + Objects.equals(this.additionalProperties, profileBadgesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(badgeId, name, badgeMessage, description, imageUrl, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileBadgesInner {\n"); + sb.append(" badgeId: ").append(toIndentedString(badgeId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" badgeMessage: ").append(toIndentedString(badgeMessage)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("BadgeId"); + openapiFields.add("Name"); + openapiFields.add("BadgeMessage"); + openapiFields.add("Description"); + openapiFields.add("ImageUrl"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileBadgesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileBadgesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileBadgesInner is not found in the empty JSON string", ProfileBadgesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("BadgeId") != null && !jsonObj.get("BadgeId").isJsonNull()) && !jsonObj.get("BadgeId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `BadgeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BadgeId").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("BadgeMessage") != null && !jsonObj.get("BadgeMessage").isJsonNull()) && !jsonObj.get("BadgeMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `BadgeMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BadgeMessage").toString())); + } + if ((jsonObj.get("Description") != null && !jsonObj.get("Description").isJsonNull()) && !jsonObj.get("Description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Description").toString())); + } + if ((jsonObj.get("ImageUrl") != null && !jsonObj.get("ImageUrl").isJsonNull()) && !jsonObj.get("ImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ImageUrl").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileBadgesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileBadgesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileBadgesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileBadgesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileBadgesInner>() { + @Override + public void write(JsonWriter out, ProfileBadgesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileBadgesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileBadgesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileBadgesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileBadgesInner + * @throws IOException if the JSON string is invalid with respect to ProfileBadgesInner + */ + public static ProfileBadgesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileBadgesInner.class); + } + + /** + * Convert an instance of ProfileBadgesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileBooksInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileBooksInner.java new file mode 100644 index 0000000..16f5085 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileBooksInner.java @@ -0,0 +1,375 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileBooksInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileBooksInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_CATEGORY = "Category"; + @SerializedName(SERIALIZED_NAME_CATEGORY) + @javax.annotation.Nullable + private String category; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public ProfileBooksInner() { + } + + public ProfileBooksInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the book. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileBooksInner category(@javax.annotation.Nullable String category) { + this.category = category; + return this; + } + + /** + * The category of the book. + * @return category + */ + @javax.annotation.Nullable + public String getCategory() { + return category; + } + + public void setCategory(@javax.annotation.Nullable String category) { + this.category = category; + } + + + public ProfileBooksInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the book. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileBooksInner createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * The date the book was added. + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileBooksInner instance itself + */ + public ProfileBooksInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileBooksInner profileBooksInner = (ProfileBooksInner) o; + return Objects.equals(this.id, profileBooksInner.id) && + Objects.equals(this.category, profileBooksInner.category) && + Objects.equals(this.name, profileBooksInner.name) && + Objects.equals(this.createdDate, profileBooksInner.createdDate)&& + Objects.equals(this.additionalProperties, profileBooksInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, createdDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileBooksInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Category"); + openapiFields.add("Name"); + openapiFields.add("CreatedDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileBooksInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileBooksInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileBooksInner is not found in the empty JSON string", ProfileBooksInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Category") != null && !jsonObj.get("Category").isJsonNull()) && !jsonObj.get("Category").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Category` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Category").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileBooksInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileBooksInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileBooksInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileBooksInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileBooksInner>() { + @Override + public void write(JsonWriter out, ProfileBooksInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileBooksInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileBooksInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileBooksInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileBooksInner + * @throws IOException if the JSON string is invalid with respect to ProfileBooksInner + */ + public static ProfileBooksInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileBooksInner.class); + } + + /** + * Convert an instance of ProfileBooksInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileCertificationsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileCertificationsInner.java new file mode 100644 index 0000000..00126f7 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileCertificationsInner.java @@ -0,0 +1,432 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileCertificationsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileCertificationsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_AUTHORITY = "Authority"; + @SerializedName(SERIALIZED_NAME_AUTHORITY) + @javax.annotation.Nullable + private String authority; + + public static final String SERIALIZED_NAME_NUMBER = "Number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + @javax.annotation.Nullable + private String number; + + public static final String SERIALIZED_NAME_START_DATE = "StartDate"; + @SerializedName(SERIALIZED_NAME_START_DATE) + @javax.annotation.Nullable + private OffsetDateTime startDate; + + public static final String SERIALIZED_NAME_END_DATE = "EndDate"; + @SerializedName(SERIALIZED_NAME_END_DATE) + @javax.annotation.Nullable + private OffsetDateTime endDate; + + public ProfileCertificationsInner() { + } + + public ProfileCertificationsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the certification. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileCertificationsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the certification. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileCertificationsInner authority(@javax.annotation.Nullable String authority) { + this.authority = authority; + return this; + } + + /** + * The authority issuing the certification. + * @return authority + */ + @javax.annotation.Nullable + public String getAuthority() { + return authority; + } + + public void setAuthority(@javax.annotation.Nullable String authority) { + this.authority = authority; + } + + + public ProfileCertificationsInner number(@javax.annotation.Nullable String number) { + this.number = number; + return this; + } + + /** + * The certification number. + * @return number + */ + @javax.annotation.Nullable + public String getNumber() { + return number; + } + + public void setNumber(@javax.annotation.Nullable String number) { + this.number = number; + } + + + public ProfileCertificationsInner startDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * The start date of the certification. + * @return startDate + */ + @javax.annotation.Nullable + public OffsetDateTime getStartDate() { + return startDate; + } + + public void setStartDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + } + + + public ProfileCertificationsInner endDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * The end date of the certification. + * @return endDate + */ + @javax.annotation.Nullable + public OffsetDateTime getEndDate() { + return endDate; + } + + public void setEndDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileCertificationsInner instance itself + */ + public ProfileCertificationsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileCertificationsInner profileCertificationsInner = (ProfileCertificationsInner) o; + return Objects.equals(this.id, profileCertificationsInner.id) && + Objects.equals(this.name, profileCertificationsInner.name) && + Objects.equals(this.authority, profileCertificationsInner.authority) && + Objects.equals(this.number, profileCertificationsInner.number) && + Objects.equals(this.startDate, profileCertificationsInner.startDate) && + Objects.equals(this.endDate, profileCertificationsInner.endDate)&& + Objects.equals(this.additionalProperties, profileCertificationsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, authority, number, startDate, endDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileCertificationsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" authority: ").append(toIndentedString(authority)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Authority"); + openapiFields.add("Number"); + openapiFields.add("StartDate"); + openapiFields.add("EndDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileCertificationsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileCertificationsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileCertificationsInner is not found in the empty JSON string", ProfileCertificationsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Authority") != null && !jsonObj.get("Authority").isJsonNull()) && !jsonObj.get("Authority").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Authority` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Authority").toString())); + } + if ((jsonObj.get("Number") != null && !jsonObj.get("Number").isJsonNull()) && !jsonObj.get("Number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Number").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileCertificationsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileCertificationsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileCertificationsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileCertificationsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileCertificationsInner>() { + @Override + public void write(JsonWriter out, ProfileCertificationsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileCertificationsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileCertificationsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileCertificationsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileCertificationsInner + * @throws IOException if the JSON string is invalid with respect to ProfileCertificationsInner + */ + public static ProfileCertificationsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileCertificationsInner.class); + } + + /** + * Convert an instance of ProfileCertificationsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileConsentProfile.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileConsentProfile.java new file mode 100644 index 0000000..84e2c83 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileConsentProfile.java @@ -0,0 +1,371 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProfileConsentProfileAcceptedConsentVersionsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileConsentProfileConsentsInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Consent profile details. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileConsentProfile { + public static final String SERIALIZED_NAME_ACCEPTED_CONSENT_VERSIONS = "AcceptedConsentVersions"; + @SerializedName(SERIALIZED_NAME_ACCEPTED_CONSENT_VERSIONS) + @javax.annotation.Nullable + private List<ProfileConsentProfileAcceptedConsentVersionsInner> acceptedConsentVersions; + + public static final String SERIALIZED_NAME_CONSENTS = "Consents"; + @SerializedName(SERIALIZED_NAME_CONSENTS) + @javax.annotation.Nullable + private List<ProfileConsentProfileConsentsInner> consents; + + public ProfileConsentProfile() { + } + + public ProfileConsentProfile acceptedConsentVersions(@javax.annotation.Nullable List<ProfileConsentProfileAcceptedConsentVersionsInner> acceptedConsentVersions) { + this.acceptedConsentVersions = acceptedConsentVersions; + return this; + } + + public ProfileConsentProfile addAcceptedConsentVersionsItem(ProfileConsentProfileAcceptedConsentVersionsInner acceptedConsentVersionsItem) { + if (this.acceptedConsentVersions == null) { + this.acceptedConsentVersions = new ArrayList<>(); + } + this.acceptedConsentVersions.add(acceptedConsentVersionsItem); + return this; + } + + /** + * Get acceptedConsentVersions + * @return acceptedConsentVersions + */ + @javax.annotation.Nullable + public List<ProfileConsentProfileAcceptedConsentVersionsInner> getAcceptedConsentVersions() { + return acceptedConsentVersions; + } + + public void setAcceptedConsentVersions(@javax.annotation.Nullable List<ProfileConsentProfileAcceptedConsentVersionsInner> acceptedConsentVersions) { + this.acceptedConsentVersions = acceptedConsentVersions; + } + + + public ProfileConsentProfile consents(@javax.annotation.Nullable List<ProfileConsentProfileConsentsInner> consents) { + this.consents = consents; + return this; + } + + public ProfileConsentProfile addConsentsItem(ProfileConsentProfileConsentsInner consentsItem) { + if (this.consents == null) { + this.consents = new ArrayList<>(); + } + this.consents.add(consentsItem); + return this; + } + + /** + * Get consents + * @return consents + */ + @javax.annotation.Nullable + public List<ProfileConsentProfileConsentsInner> getConsents() { + return consents; + } + + public void setConsents(@javax.annotation.Nullable List<ProfileConsentProfileConsentsInner> consents) { + this.consents = consents; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileConsentProfile instance itself + */ + public ProfileConsentProfile putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileConsentProfile profileConsentProfile = (ProfileConsentProfile) o; + return Objects.equals(this.acceptedConsentVersions, profileConsentProfile.acceptedConsentVersions) && + Objects.equals(this.consents, profileConsentProfile.consents)&& + Objects.equals(this.additionalProperties, profileConsentProfile.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(acceptedConsentVersions, consents, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileConsentProfile {\n"); + sb.append(" acceptedConsentVersions: ").append(toIndentedString(acceptedConsentVersions)).append("\n"); + sb.append(" consents: ").append(toIndentedString(consents)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AcceptedConsentVersions"); + openapiFields.add("Consents"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileConsentProfile + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileConsentProfile.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileConsentProfile is not found in the empty JSON string", ProfileConsentProfile.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("AcceptedConsentVersions") != null && !jsonObj.get("AcceptedConsentVersions").isJsonNull()) { + JsonArray jsonArrayacceptedConsentVersions = jsonObj.getAsJsonArray("AcceptedConsentVersions"); + if (jsonArrayacceptedConsentVersions != null) { + // ensure the json data is an array + if (!jsonObj.get("AcceptedConsentVersions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `AcceptedConsentVersions` to be an array in the JSON string but got `%s`", jsonObj.get("AcceptedConsentVersions").toString())); + } + + // validate the optional field `AcceptedConsentVersions` (array) + for (int i = 0; i < jsonArrayacceptedConsentVersions.size(); i++) { + ProfileConsentProfileAcceptedConsentVersionsInner.validateJsonElement(jsonArrayacceptedConsentVersions.get(i)); + }; + } + } + if (jsonObj.get("Consents") != null && !jsonObj.get("Consents").isJsonNull()) { + JsonArray jsonArrayconsents = jsonObj.getAsJsonArray("Consents"); + if (jsonArrayconsents != null) { + // ensure the json data is an array + if (!jsonObj.get("Consents").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Consents` to be an array in the JSON string but got `%s`", jsonObj.get("Consents").toString())); + } + + // validate the optional field `Consents` (array) + for (int i = 0; i < jsonArrayconsents.size(); i++) { + ProfileConsentProfileConsentsInner.validateJsonElement(jsonArrayconsents.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileConsentProfile.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileConsentProfile' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileConsentProfile> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileConsentProfile.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileConsentProfile>() { + @Override + public void write(JsonWriter out, ProfileConsentProfile value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileConsentProfile read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileConsentProfile instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileConsentProfile given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileConsentProfile + * @throws IOException if the JSON string is invalid with respect to ProfileConsentProfile + */ + public static ProfileConsentProfile fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileConsentProfile.class); + } + + /** + * Convert an instance of ProfileConsentProfile to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileConsentProfileAcceptedConsentVersionsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileConsentProfileAcceptedConsentVersionsInner.java new file mode 100644 index 0000000..f4d3430 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileConsentProfileAcceptedConsentVersionsInner.java @@ -0,0 +1,341 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileConsentProfileAcceptedConsentVersionsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileConsentProfileAcceptedConsentVersionsInner { + public static final String SERIALIZED_NAME_IS_CUSTOM = "IsCustom"; + @SerializedName(SERIALIZED_NAME_IS_CUSTOM) + @javax.annotation.Nullable + private Boolean isCustom; + + public static final String SERIALIZED_NAME_VERSION = "Version"; + @SerializedName(SERIALIZED_NAME_VERSION) + @javax.annotation.Nullable + private Integer version; + + public static final String SERIALIZED_NAME_EVENT = "Event"; + @SerializedName(SERIALIZED_NAME_EVENT) + @javax.annotation.Nullable + private String event; + + public ProfileConsentProfileAcceptedConsentVersionsInner() { + } + + public ProfileConsentProfileAcceptedConsentVersionsInner isCustom(@javax.annotation.Nullable Boolean isCustom) { + this.isCustom = isCustom; + return this; + } + + /** + * Indicates if the Consent version is custom. + * @return isCustom + */ + @javax.annotation.Nullable + public Boolean getIsCustom() { + return isCustom; + } + + public void setIsCustom(@javax.annotation.Nullable Boolean isCustom) { + this.isCustom = isCustom; + } + + + public ProfileConsentProfileAcceptedConsentVersionsInner version(@javax.annotation.Nullable Integer version) { + this.version = version; + return this; + } + + /** + * The version of the Consent. + * @return version + */ + @javax.annotation.Nullable + public Integer getVersion() { + return version; + } + + public void setVersion(@javax.annotation.Nullable Integer version) { + this.version = version; + } + + + public ProfileConsentProfileAcceptedConsentVersionsInner event(@javax.annotation.Nullable String event) { + this.event = event; + return this; + } + + /** + * The event associated with the Consent. + * @return event + */ + @javax.annotation.Nullable + public String getEvent() { + return event; + } + + public void setEvent(@javax.annotation.Nullable String event) { + this.event = event; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileConsentProfileAcceptedConsentVersionsInner instance itself + */ + public ProfileConsentProfileAcceptedConsentVersionsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileConsentProfileAcceptedConsentVersionsInner profileConsentProfileAcceptedConsentVersionsInner = (ProfileConsentProfileAcceptedConsentVersionsInner) o; + return Objects.equals(this.isCustom, profileConsentProfileAcceptedConsentVersionsInner.isCustom) && + Objects.equals(this.version, profileConsentProfileAcceptedConsentVersionsInner.version) && + Objects.equals(this.event, profileConsentProfileAcceptedConsentVersionsInner.event)&& + Objects.equals(this.additionalProperties, profileConsentProfileAcceptedConsentVersionsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isCustom, version, event, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileConsentProfileAcceptedConsentVersionsInner {\n"); + sb.append(" isCustom: ").append(toIndentedString(isCustom)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" event: ").append(toIndentedString(event)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsCustom"); + openapiFields.add("Version"); + openapiFields.add("Event"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileConsentProfileAcceptedConsentVersionsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileConsentProfileAcceptedConsentVersionsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileConsentProfileAcceptedConsentVersionsInner is not found in the empty JSON string", ProfileConsentProfileAcceptedConsentVersionsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Event") != null && !jsonObj.get("Event").isJsonNull()) && !jsonObj.get("Event").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Event` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Event").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileConsentProfileAcceptedConsentVersionsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileConsentProfileAcceptedConsentVersionsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileConsentProfileAcceptedConsentVersionsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileConsentProfileAcceptedConsentVersionsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileConsentProfileAcceptedConsentVersionsInner>() { + @Override + public void write(JsonWriter out, ProfileConsentProfileAcceptedConsentVersionsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileConsentProfileAcceptedConsentVersionsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileConsentProfileAcceptedConsentVersionsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileConsentProfileAcceptedConsentVersionsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileConsentProfileAcceptedConsentVersionsInner + * @throws IOException if the JSON string is invalid with respect to ProfileConsentProfileAcceptedConsentVersionsInner + */ + public static ProfileConsentProfileAcceptedConsentVersionsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileConsentProfileAcceptedConsentVersionsInner.class); + } + + /** + * Convert an instance of ProfileConsentProfileAcceptedConsentVersionsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileConsentProfileConsentsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileConsentProfileConsentsInner.java new file mode 100644 index 0000000..ef053b8 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileConsentProfileConsentsInner.java @@ -0,0 +1,327 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileConsentProfileConsentsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileConsentProfileConsentsInner { + public static final String SERIALIZED_NAME_CONSENT_OPTION_ID = "ConsentOptionId"; + @SerializedName(SERIALIZED_NAME_CONSENT_OPTION_ID) + @javax.annotation.Nullable + private String consentOptionId; + + public static final String SERIALIZED_NAME_ACCEPT_ON_DATE = "AcceptOnDate"; + @SerializedName(SERIALIZED_NAME_ACCEPT_ON_DATE) + @javax.annotation.Nullable + private OffsetDateTime acceptOnDate; + + public ProfileConsentProfileConsentsInner() { + } + + public ProfileConsentProfileConsentsInner consentOptionId(@javax.annotation.Nullable String consentOptionId) { + this.consentOptionId = consentOptionId; + return this; + } + + /** + * The ID of the Consent option. + * @return consentOptionId + */ + @javax.annotation.Nullable + public String getConsentOptionId() { + return consentOptionId; + } + + public void setConsentOptionId(@javax.annotation.Nullable String consentOptionId) { + this.consentOptionId = consentOptionId; + } + + + public ProfileConsentProfileConsentsInner acceptOnDate(@javax.annotation.Nullable OffsetDateTime acceptOnDate) { + this.acceptOnDate = acceptOnDate; + return this; + } + + /** + * The date the Consent was accepted. + * @return acceptOnDate + */ + @javax.annotation.Nullable + public OffsetDateTime getAcceptOnDate() { + return acceptOnDate; + } + + public void setAcceptOnDate(@javax.annotation.Nullable OffsetDateTime acceptOnDate) { + this.acceptOnDate = acceptOnDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileConsentProfileConsentsInner instance itself + */ + public ProfileConsentProfileConsentsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileConsentProfileConsentsInner profileConsentProfileConsentsInner = (ProfileConsentProfileConsentsInner) o; + return Objects.equals(this.consentOptionId, profileConsentProfileConsentsInner.consentOptionId) && + Objects.equals(this.acceptOnDate, profileConsentProfileConsentsInner.acceptOnDate)&& + Objects.equals(this.additionalProperties, profileConsentProfileConsentsInner.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(consentOptionId, acceptOnDate, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileConsentProfileConsentsInner {\n"); + sb.append(" consentOptionId: ").append(toIndentedString(consentOptionId)).append("\n"); + sb.append(" acceptOnDate: ").append(toIndentedString(acceptOnDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ConsentOptionId"); + openapiFields.add("AcceptOnDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileConsentProfileConsentsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileConsentProfileConsentsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileConsentProfileConsentsInner is not found in the empty JSON string", ProfileConsentProfileConsentsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ConsentOptionId") != null && !jsonObj.get("ConsentOptionId").isJsonNull()) && !jsonObj.get("ConsentOptionId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ConsentOptionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ConsentOptionId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileConsentProfileConsentsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileConsentProfileConsentsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileConsentProfileConsentsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileConsentProfileConsentsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileConsentProfileConsentsInner>() { + @Override + public void write(JsonWriter out, ProfileConsentProfileConsentsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileConsentProfileConsentsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileConsentProfileConsentsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileConsentProfileConsentsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileConsentProfileConsentsInner + * @throws IOException if the JSON string is invalid with respect to ProfileConsentProfileConsentsInner + */ + public static ProfileConsentProfileConsentsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileConsentProfileConsentsInner.class); + } + + /** + * Convert an instance of ProfileConsentProfileConsentsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileCountry.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileCountry.java new file mode 100644 index 0000000..c6803bc --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileCountry.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileCountry + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileCountry { + public static final String SERIALIZED_NAME_CODE = "Code"; + @SerializedName(SERIALIZED_NAME_CODE) + @javax.annotation.Nullable + private String code; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ProfileCountry() { + } + + public ProfileCountry code(@javax.annotation.Nullable String code) { + this.code = code; + return this; + } + + /** + * The country code. + * @return code + */ + @javax.annotation.Nullable + public String getCode() { + return code; + } + + public void setCode(@javax.annotation.Nullable String code) { + this.code = code; + } + + + public ProfileCountry name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The country name. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileCountry instance itself + */ + public ProfileCountry putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileCountry profileCountry = (ProfileCountry) o; + return Objects.equals(this.code, profileCountry.code) && + Objects.equals(this.name, profileCountry.name)&& + Objects.equals(this.additionalProperties, profileCountry.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(code, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileCountry {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Code"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileCountry + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileCountry.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileCountry is not found in the empty JSON string", ProfileCountry.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Code") != null && !jsonObj.get("Code").isJsonNull()) && !jsonObj.get("Code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Code").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileCountry.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileCountry' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileCountry> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileCountry.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileCountry>() { + @Override + public void write(JsonWriter out, ProfileCountry value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileCountry read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileCountry instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileCountry given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileCountry + * @throws IOException if the JSON string is invalid with respect to ProfileCountry + */ + public static ProfileCountry fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileCountry.class); + } + + /** + * Convert an instance of ProfileCountry to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileCoursesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileCoursesInner.java new file mode 100644 index 0000000..744664d --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileCoursesInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileCoursesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileCoursesInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_NUMBER = "Number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + @javax.annotation.Nullable + private String number; + + public ProfileCoursesInner() { + } + + public ProfileCoursesInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the course. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileCoursesInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the course. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileCoursesInner number(@javax.annotation.Nullable String number) { + this.number = number; + return this; + } + + /** + * The course number. + * @return number + */ + @javax.annotation.Nullable + public String getNumber() { + return number; + } + + public void setNumber(@javax.annotation.Nullable String number) { + this.number = number; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileCoursesInner instance itself + */ + public ProfileCoursesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileCoursesInner profileCoursesInner = (ProfileCoursesInner) o; + return Objects.equals(this.id, profileCoursesInner.id) && + Objects.equals(this.name, profileCoursesInner.name) && + Objects.equals(this.number, profileCoursesInner.number)&& + Objects.equals(this.additionalProperties, profileCoursesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, number, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileCoursesInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Number"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileCoursesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileCoursesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileCoursesInner is not found in the empty JSON string", ProfileCoursesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Number") != null && !jsonObj.get("Number").isJsonNull()) && !jsonObj.get("Number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Number").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileCoursesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileCoursesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileCoursesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileCoursesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileCoursesInner>() { + @Override + public void write(JsonWriter out, ProfileCoursesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileCoursesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileCoursesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileCoursesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileCoursesInner + * @throws IOException if the JSON string is invalid with respect to ProfileCoursesInner + */ + public static ProfileCoursesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileCoursesInner.class); + } + + /** + * Convert an instance of ProfileCoursesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileCurrentStatusInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileCurrentStatusInner.java new file mode 100644 index 0000000..88efaed --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileCurrentStatusInner.java @@ -0,0 +1,375 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileCurrentStatusInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileCurrentStatusInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_TEXT = "Text"; + @SerializedName(SERIALIZED_NAME_TEXT) + @javax.annotation.Nullable + private String text; + + public static final String SERIALIZED_NAME_SOURCE = "Source"; + @SerializedName(SERIALIZED_NAME_SOURCE) + @javax.annotation.Nullable + private String source; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public ProfileCurrentStatusInner() { + } + + public ProfileCurrentStatusInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the status. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileCurrentStatusInner text(@javax.annotation.Nullable String text) { + this.text = text; + return this; + } + + /** + * The text of the status. + * @return text + */ + @javax.annotation.Nullable + public String getText() { + return text; + } + + public void setText(@javax.annotation.Nullable String text) { + this.text = text; + } + + + public ProfileCurrentStatusInner source(@javax.annotation.Nullable String source) { + this.source = source; + return this; + } + + /** + * The source of the status. + * @return source + */ + @javax.annotation.Nullable + public String getSource() { + return source; + } + + public void setSource(@javax.annotation.Nullable String source) { + this.source = source; + } + + + public ProfileCurrentStatusInner createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * The date the status was created. + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileCurrentStatusInner instance itself + */ + public ProfileCurrentStatusInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileCurrentStatusInner profileCurrentStatusInner = (ProfileCurrentStatusInner) o; + return Objects.equals(this.id, profileCurrentStatusInner.id) && + Objects.equals(this.text, profileCurrentStatusInner.text) && + Objects.equals(this.source, profileCurrentStatusInner.source) && + Objects.equals(this.createdDate, profileCurrentStatusInner.createdDate)&& + Objects.equals(this.additionalProperties, profileCurrentStatusInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, text, source, createdDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileCurrentStatusInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Text"); + openapiFields.add("Source"); + openapiFields.add("CreatedDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileCurrentStatusInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileCurrentStatusInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileCurrentStatusInner is not found in the empty JSON string", ProfileCurrentStatusInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Text") != null && !jsonObj.get("Text").isJsonNull()) && !jsonObj.get("Text").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Text").toString())); + } + if ((jsonObj.get("Source") != null && !jsonObj.get("Source").isJsonNull()) && !jsonObj.get("Source").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Source").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileCurrentStatusInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileCurrentStatusInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileCurrentStatusInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileCurrentStatusInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileCurrentStatusInner>() { + @Override + public void write(JsonWriter out, ProfileCurrentStatusInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileCurrentStatusInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileCurrentStatusInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileCurrentStatusInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileCurrentStatusInner + * @throws IOException if the JSON string is invalid with respect to ProfileCurrentStatusInner + */ + public static ProfileCurrentStatusInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileCurrentStatusInner.class); + } + + /** + * Convert an instance of ProfileCurrentStatusInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileEducationsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileEducationsInner.java new file mode 100644 index 0000000..c59e514 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileEducationsInner.java @@ -0,0 +1,522 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileEducationsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileEducationsInner { + public static final String SERIALIZED_NAME_SCHOOL = "School"; + @SerializedName(SERIALIZED_NAME_SCHOOL) + @javax.annotation.Nullable + private String school; + + public static final String SERIALIZED_NAME_YEAR = "Year"; + @SerializedName(SERIALIZED_NAME_YEAR) + @javax.annotation.Nullable + private String year; + + public static final String SERIALIZED_NAME_TYPE = "Type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_NOTES = "Notes"; + @SerializedName(SERIALIZED_NAME_NOTES) + @javax.annotation.Nullable + private String notes; + + public static final String SERIALIZED_NAME_ACTIVITIES = "Activities"; + @SerializedName(SERIALIZED_NAME_ACTIVITIES) + @javax.annotation.Nullable + private String activities; + + public static final String SERIALIZED_NAME_DEGREE = "Degree"; + @SerializedName(SERIALIZED_NAME_DEGREE) + @javax.annotation.Nullable + private String degree; + + public static final String SERIALIZED_NAME_FIELD_OF_STUDY = "FieldOfStudy"; + @SerializedName(SERIALIZED_NAME_FIELD_OF_STUDY) + @javax.annotation.Nullable + private String fieldOfStudy; + + public static final String SERIALIZED_NAME_START_DATE = "StartDate"; + @SerializedName(SERIALIZED_NAME_START_DATE) + @javax.annotation.Nullable + private OffsetDateTime startDate; + + public static final String SERIALIZED_NAME_END_DATE = "EndDate"; + @SerializedName(SERIALIZED_NAME_END_DATE) + @javax.annotation.Nullable + private OffsetDateTime endDate; + + public ProfileEducationsInner() { + } + + public ProfileEducationsInner school(@javax.annotation.Nullable String school) { + this.school = school; + return this; + } + + /** + * The name of the school. + * @return school + */ + @javax.annotation.Nullable + public String getSchool() { + return school; + } + + public void setSchool(@javax.annotation.Nullable String school) { + this.school = school; + } + + + public ProfileEducationsInner year(@javax.annotation.Nullable String year) { + this.year = year; + return this; + } + + /** + * The year of graduation. + * @return year + */ + @javax.annotation.Nullable + public String getYear() { + return year; + } + + public void setYear(@javax.annotation.Nullable String year) { + this.year = year; + } + + + public ProfileEducationsInner type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * The type of degree. + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public ProfileEducationsInner notes(@javax.annotation.Nullable String notes) { + this.notes = notes; + return this; + } + + /** + * Additional notes about the education. + * @return notes + */ + @javax.annotation.Nullable + public String getNotes() { + return notes; + } + + public void setNotes(@javax.annotation.Nullable String notes) { + this.notes = notes; + } + + + public ProfileEducationsInner activities(@javax.annotation.Nullable String activities) { + this.activities = activities; + return this; + } + + /** + * Activities participated in during education. + * @return activities + */ + @javax.annotation.Nullable + public String getActivities() { + return activities; + } + + public void setActivities(@javax.annotation.Nullable String activities) { + this.activities = activities; + } + + + public ProfileEducationsInner degree(@javax.annotation.Nullable String degree) { + this.degree = degree; + return this; + } + + /** + * The degree obtained. + * @return degree + */ + @javax.annotation.Nullable + public String getDegree() { + return degree; + } + + public void setDegree(@javax.annotation.Nullable String degree) { + this.degree = degree; + } + + + public ProfileEducationsInner fieldOfStudy(@javax.annotation.Nullable String fieldOfStudy) { + this.fieldOfStudy = fieldOfStudy; + return this; + } + + /** + * The field of study. + * @return fieldOfStudy + */ + @javax.annotation.Nullable + public String getFieldOfStudy() { + return fieldOfStudy; + } + + public void setFieldOfStudy(@javax.annotation.Nullable String fieldOfStudy) { + this.fieldOfStudy = fieldOfStudy; + } + + + public ProfileEducationsInner startDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * The start date of the education. + * @return startDate + */ + @javax.annotation.Nullable + public OffsetDateTime getStartDate() { + return startDate; + } + + public void setStartDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + } + + + public ProfileEducationsInner endDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * The end date of the education. + * @return endDate + */ + @javax.annotation.Nullable + public OffsetDateTime getEndDate() { + return endDate; + } + + public void setEndDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileEducationsInner instance itself + */ + public ProfileEducationsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileEducationsInner profileEducationsInner = (ProfileEducationsInner) o; + return Objects.equals(this.school, profileEducationsInner.school) && + Objects.equals(this.year, profileEducationsInner.year) && + Objects.equals(this.type, profileEducationsInner.type) && + Objects.equals(this.notes, profileEducationsInner.notes) && + Objects.equals(this.activities, profileEducationsInner.activities) && + Objects.equals(this.degree, profileEducationsInner.degree) && + Objects.equals(this.fieldOfStudy, profileEducationsInner.fieldOfStudy) && + Objects.equals(this.startDate, profileEducationsInner.startDate) && + Objects.equals(this.endDate, profileEducationsInner.endDate)&& + Objects.equals(this.additionalProperties, profileEducationsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(school, year, type, notes, activities, degree, fieldOfStudy, startDate, endDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileEducationsInner {\n"); + sb.append(" school: ").append(toIndentedString(school)).append("\n"); + sb.append(" year: ").append(toIndentedString(year)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" notes: ").append(toIndentedString(notes)).append("\n"); + sb.append(" activities: ").append(toIndentedString(activities)).append("\n"); + sb.append(" degree: ").append(toIndentedString(degree)).append("\n"); + sb.append(" fieldOfStudy: ").append(toIndentedString(fieldOfStudy)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("School"); + openapiFields.add("Year"); + openapiFields.add("Type"); + openapiFields.add("Notes"); + openapiFields.add("Activities"); + openapiFields.add("Degree"); + openapiFields.add("FieldOfStudy"); + openapiFields.add("StartDate"); + openapiFields.add("EndDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileEducationsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileEducationsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileEducationsInner is not found in the empty JSON string", ProfileEducationsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("School") != null && !jsonObj.get("School").isJsonNull()) && !jsonObj.get("School").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `School` to be a primitive type in the JSON string but got `%s`", jsonObj.get("School").toString())); + } + if ((jsonObj.get("Year") != null && !jsonObj.get("Year").isJsonNull()) && !jsonObj.get("Year").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Year` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Year").toString())); + } + if ((jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonNull()) && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + if ((jsonObj.get("Notes") != null && !jsonObj.get("Notes").isJsonNull()) && !jsonObj.get("Notes").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Notes` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Notes").toString())); + } + if ((jsonObj.get("Activities") != null && !jsonObj.get("Activities").isJsonNull()) && !jsonObj.get("Activities").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Activities` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Activities").toString())); + } + if ((jsonObj.get("Degree") != null && !jsonObj.get("Degree").isJsonNull()) && !jsonObj.get("Degree").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Degree` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Degree").toString())); + } + if ((jsonObj.get("FieldOfStudy") != null && !jsonObj.get("FieldOfStudy").isJsonNull()) && !jsonObj.get("FieldOfStudy").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FieldOfStudy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FieldOfStudy").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileEducationsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileEducationsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileEducationsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileEducationsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileEducationsInner>() { + @Override + public void write(JsonWriter out, ProfileEducationsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileEducationsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileEducationsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileEducationsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileEducationsInner + * @throws IOException if the JSON string is invalid with respect to ProfileEducationsInner + */ + public static ProfileEducationsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileEducationsInner.class); + } + + /** + * Convert an instance of ProfileEducationsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileEmailInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileEmailInner.java new file mode 100644 index 0000000..fd9c068 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileEmailInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileEmailInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileEmailInner { + public static final String SERIALIZED_NAME_TYPE = "Type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_VALUE = "Value"; + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nullable + private String value; + + public ProfileEmailInner() { + } + + public ProfileEmailInner type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * The type of the Email (e.g., Primary, Secondary). + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public ProfileEmailInner value(@javax.annotation.Nullable String value) { + this.value = value; + return this; + } + + /** + * The Email address. + * @return value + */ + @javax.annotation.Nullable + public String getValue() { + return value; + } + + public void setValue(@javax.annotation.Nullable String value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileEmailInner instance itself + */ + public ProfileEmailInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileEmailInner profileEmailInner = (ProfileEmailInner) o; + return Objects.equals(this.type, profileEmailInner.type) && + Objects.equals(this.value, profileEmailInner.value)&& + Objects.equals(this.additionalProperties, profileEmailInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileEmailInner {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Type"); + openapiFields.add("Value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileEmailInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileEmailInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileEmailInner is not found in the empty JSON string", ProfileEmailInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonNull()) && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + if ((jsonObj.get("Value") != null && !jsonObj.get("Value").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileEmailInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileEmailInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileEmailInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileEmailInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileEmailInner>() { + @Override + public void write(JsonWriter out, ProfileEmailInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileEmailInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileEmailInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileEmailInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileEmailInner + * @throws IOException if the JSON string is invalid with respect to ProfileEmailInner + */ + public static ProfileEmailInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileEmailInner.class); + } + + /** + * Convert an instance of ProfileEmailInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileExternalIdsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileExternalIdsInner.java new file mode 100644 index 0000000..15943fe --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileExternalIdsInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileExternalIdsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileExternalIdsInner { + public static final String SERIALIZED_NAME_OPERATION = "Operation"; + @SerializedName(SERIALIZED_NAME_OPERATION) + @javax.annotation.Nullable + private String operation; + + public static final String SERIALIZED_NAME_SOURCE = "Source"; + @SerializedName(SERIALIZED_NAME_SOURCE) + @javax.annotation.Nullable + private String source; + + public static final String SERIALIZED_NAME_SOURCE_ID = "SourceId"; + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + @javax.annotation.Nullable + private String sourceId; + + public ProfileExternalIdsInner() { + } + + public ProfileExternalIdsInner operation(@javax.annotation.Nullable String operation) { + this.operation = operation; + return this; + } + + /** + * The operation performed on the external ID. + * @return operation + */ + @javax.annotation.Nullable + public String getOperation() { + return operation; + } + + public void setOperation(@javax.annotation.Nullable String operation) { + this.operation = operation; + } + + + public ProfileExternalIdsInner source(@javax.annotation.Nullable String source) { + this.source = source; + return this; + } + + /** + * The source of the external ID. + * @return source + */ + @javax.annotation.Nullable + public String getSource() { + return source; + } + + public void setSource(@javax.annotation.Nullable String source) { + this.source = source; + } + + + public ProfileExternalIdsInner sourceId(@javax.annotation.Nullable String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * The source ID of the external ID. + * @return sourceId + */ + @javax.annotation.Nullable + public String getSourceId() { + return sourceId; + } + + public void setSourceId(@javax.annotation.Nullable String sourceId) { + this.sourceId = sourceId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileExternalIdsInner instance itself + */ + public ProfileExternalIdsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileExternalIdsInner profileExternalIdsInner = (ProfileExternalIdsInner) o; + return Objects.equals(this.operation, profileExternalIdsInner.operation) && + Objects.equals(this.source, profileExternalIdsInner.source) && + Objects.equals(this.sourceId, profileExternalIdsInner.sourceId)&& + Objects.equals(this.additionalProperties, profileExternalIdsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(operation, source, sourceId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileExternalIdsInner {\n"); + sb.append(" operation: ").append(toIndentedString(operation)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Operation"); + openapiFields.add("Source"); + openapiFields.add("SourceId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileExternalIdsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileExternalIdsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileExternalIdsInner is not found in the empty JSON string", ProfileExternalIdsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Operation") != null && !jsonObj.get("Operation").isJsonNull()) && !jsonObj.get("Operation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Operation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Operation").toString())); + } + if ((jsonObj.get("Source") != null && !jsonObj.get("Source").isJsonNull()) && !jsonObj.get("Source").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Source").toString())); + } + if ((jsonObj.get("SourceId") != null && !jsonObj.get("SourceId").isJsonNull()) && !jsonObj.get("SourceId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SourceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SourceId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileExternalIdsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileExternalIdsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileExternalIdsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileExternalIdsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileExternalIdsInner>() { + @Override + public void write(JsonWriter out, ProfileExternalIdsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileExternalIdsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileExternalIdsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileExternalIdsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileExternalIdsInner + * @throws IOException if the JSON string is invalid with respect to ProfileExternalIdsInner + */ + public static ProfileExternalIdsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileExternalIdsInner.class); + } + + /** + * Convert an instance of ProfileExternalIdsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileFamilyInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileFamilyInner.java new file mode 100644 index 0000000..c48526b --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileFamilyInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileFamilyInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileFamilyInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_RELATIONSHIP = "Relationship"; + @SerializedName(SERIALIZED_NAME_RELATIONSHIP) + @javax.annotation.Nullable + private String relationship; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ProfileFamilyInner() { + } + + public ProfileFamilyInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the family member. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileFamilyInner relationship(@javax.annotation.Nullable String relationship) { + this.relationship = relationship; + return this; + } + + /** + * The relationship with the family member. + * @return relationship + */ + @javax.annotation.Nullable + public String getRelationship() { + return relationship; + } + + public void setRelationship(@javax.annotation.Nullable String relationship) { + this.relationship = relationship; + } + + + public ProfileFamilyInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the family member. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileFamilyInner instance itself + */ + public ProfileFamilyInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileFamilyInner profileFamilyInner = (ProfileFamilyInner) o; + return Objects.equals(this.id, profileFamilyInner.id) && + Objects.equals(this.relationship, profileFamilyInner.relationship) && + Objects.equals(this.name, profileFamilyInner.name)&& + Objects.equals(this.additionalProperties, profileFamilyInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, relationship, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileFamilyInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" relationship: ").append(toIndentedString(relationship)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Relationship"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileFamilyInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileFamilyInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileFamilyInner is not found in the empty JSON string", ProfileFamilyInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Relationship") != null && !jsonObj.get("Relationship").isJsonNull()) && !jsonObj.get("Relationship").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Relationship` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Relationship").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileFamilyInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileFamilyInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileFamilyInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileFamilyInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileFamilyInner>() { + @Override + public void write(JsonWriter out, ProfileFamilyInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileFamilyInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileFamilyInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileFamilyInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileFamilyInner + * @throws IOException if the JSON string is invalid with respect to ProfileFamilyInner + */ + public static ProfileFamilyInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileFamilyInner.class); + } + + /** + * Convert an instance of ProfileFamilyInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileFavoriteThingsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileFavoriteThingsInner.java new file mode 100644 index 0000000..9d9e55b --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileFavoriteThingsInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileFavoriteThingsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileFavoriteThingsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_TYPE = "Type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public ProfileFavoriteThingsInner() { + } + + public ProfileFavoriteThingsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the favorite thing. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileFavoriteThingsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the favorite thing. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileFavoriteThingsInner type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * The type of the favorite thing. + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileFavoriteThingsInner instance itself + */ + public ProfileFavoriteThingsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileFavoriteThingsInner profileFavoriteThingsInner = (ProfileFavoriteThingsInner) o; + return Objects.equals(this.id, profileFavoriteThingsInner.id) && + Objects.equals(this.name, profileFavoriteThingsInner.name) && + Objects.equals(this.type, profileFavoriteThingsInner.type)&& + Objects.equals(this.additionalProperties, profileFavoriteThingsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileFavoriteThingsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileFavoriteThingsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileFavoriteThingsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileFavoriteThingsInner is not found in the empty JSON string", ProfileFavoriteThingsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Type") != null && !jsonObj.get("Type").isJsonNull()) && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileFavoriteThingsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileFavoriteThingsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileFavoriteThingsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileFavoriteThingsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileFavoriteThingsInner>() { + @Override + public void write(JsonWriter out, ProfileFavoriteThingsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileFavoriteThingsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileFavoriteThingsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileFavoriteThingsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileFavoriteThingsInner + * @throws IOException if the JSON string is invalid with respect to ProfileFavoriteThingsInner + */ + public static ProfileFavoriteThingsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileFavoriteThingsInner.class); + } + + /** + * Convert an instance of ProfileFavoriteThingsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileGamesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileGamesInner.java new file mode 100644 index 0000000..2009d56 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileGamesInner.java @@ -0,0 +1,375 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileGamesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileGamesInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_CATEGORY = "Category"; + @SerializedName(SERIALIZED_NAME_CATEGORY) + @javax.annotation.Nullable + private String category; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public ProfileGamesInner() { + } + + public ProfileGamesInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the game. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileGamesInner category(@javax.annotation.Nullable String category) { + this.category = category; + return this; + } + + /** + * The category of the game. + * @return category + */ + @javax.annotation.Nullable + public String getCategory() { + return category; + } + + public void setCategory(@javax.annotation.Nullable String category) { + this.category = category; + } + + + public ProfileGamesInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the game. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileGamesInner createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * The date the game was added. + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileGamesInner instance itself + */ + public ProfileGamesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileGamesInner profileGamesInner = (ProfileGamesInner) o; + return Objects.equals(this.id, profileGamesInner.id) && + Objects.equals(this.category, profileGamesInner.category) && + Objects.equals(this.name, profileGamesInner.name) && + Objects.equals(this.createdDate, profileGamesInner.createdDate)&& + Objects.equals(this.additionalProperties, profileGamesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, createdDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileGamesInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Category"); + openapiFields.add("Name"); + openapiFields.add("CreatedDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileGamesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileGamesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileGamesInner is not found in the empty JSON string", ProfileGamesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Category") != null && !jsonObj.get("Category").isJsonNull()) && !jsonObj.get("Category").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Category` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Category").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileGamesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileGamesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileGamesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileGamesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileGamesInner>() { + @Override + public void write(JsonWriter out, ProfileGamesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileGamesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileGamesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileGamesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileGamesInner + * @throws IOException if the JSON string is invalid with respect to ProfileGamesInner + */ + public static ProfileGamesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileGamesInner.class); + } + + /** + * Convert an instance of ProfileGamesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileIMAccountsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileIMAccountsInner.java new file mode 100644 index 0000000..4eae596 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileIMAccountsInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileIMAccountsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileIMAccountsInner { + public static final String SERIALIZED_NAME_ACCOUNT_TYPE = "AccountType"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_TYPE) + @javax.annotation.Nullable + private String accountType; + + public static final String SERIALIZED_NAME_ACCOUNT_NAME = "AccountName"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NAME) + @javax.annotation.Nullable + private String accountName; + + public ProfileIMAccountsInner() { + } + + public ProfileIMAccountsInner accountType(@javax.annotation.Nullable String accountType) { + this.accountType = accountType; + return this; + } + + /** + * The type of instant messaging account. + * @return accountType + */ + @javax.annotation.Nullable + public String getAccountType() { + return accountType; + } + + public void setAccountType(@javax.annotation.Nullable String accountType) { + this.accountType = accountType; + } + + + public ProfileIMAccountsInner accountName(@javax.annotation.Nullable String accountName) { + this.accountName = accountName; + return this; + } + + /** + * The name of the instant messaging account. + * @return accountName + */ + @javax.annotation.Nullable + public String getAccountName() { + return accountName; + } + + public void setAccountName(@javax.annotation.Nullable String accountName) { + this.accountName = accountName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileIMAccountsInner instance itself + */ + public ProfileIMAccountsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileIMAccountsInner profileIMAccountsInner = (ProfileIMAccountsInner) o; + return Objects.equals(this.accountType, profileIMAccountsInner.accountType) && + Objects.equals(this.accountName, profileIMAccountsInner.accountName)&& + Objects.equals(this.additionalProperties, profileIMAccountsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accountType, accountName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileIMAccountsInner {\n"); + sb.append(" accountType: ").append(toIndentedString(accountType)).append("\n"); + sb.append(" accountName: ").append(toIndentedString(accountName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AccountType"); + openapiFields.add("AccountName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileIMAccountsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileIMAccountsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileIMAccountsInner is not found in the empty JSON string", ProfileIMAccountsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("AccountType") != null && !jsonObj.get("AccountType").isJsonNull()) && !jsonObj.get("AccountType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccountType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccountType").toString())); + } + if ((jsonObj.get("AccountName") != null && !jsonObj.get("AccountName").isJsonNull()) && !jsonObj.get("AccountName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccountName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccountName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileIMAccountsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileIMAccountsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileIMAccountsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileIMAccountsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileIMAccountsInner>() { + @Override + public void write(JsonWriter out, ProfileIMAccountsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileIMAccountsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileIMAccountsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileIMAccountsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileIMAccountsInner + * @throws IOException if the JSON string is invalid with respect to ProfileIMAccountsInner + */ + public static ProfileIMAccountsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileIMAccountsInner.class); + } + + /** + * Convert an instance of ProfileIMAccountsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileInspirationalPeopleInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileInspirationalPeopleInner.java new file mode 100644 index 0000000..d040b5c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileInspirationalPeopleInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileInspirationalPeopleInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileInspirationalPeopleInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ProfileInspirationalPeopleInner() { + } + + public ProfileInspirationalPeopleInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the person. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileInspirationalPeopleInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the person. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileInspirationalPeopleInner instance itself + */ + public ProfileInspirationalPeopleInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileInspirationalPeopleInner profileInspirationalPeopleInner = (ProfileInspirationalPeopleInner) o; + return Objects.equals(this.id, profileInspirationalPeopleInner.id) && + Objects.equals(this.name, profileInspirationalPeopleInner.name)&& + Objects.equals(this.additionalProperties, profileInspirationalPeopleInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileInspirationalPeopleInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileInspirationalPeopleInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileInspirationalPeopleInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileInspirationalPeopleInner is not found in the empty JSON string", ProfileInspirationalPeopleInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileInspirationalPeopleInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileInspirationalPeopleInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileInspirationalPeopleInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileInspirationalPeopleInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileInspirationalPeopleInner>() { + @Override + public void write(JsonWriter out, ProfileInspirationalPeopleInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileInspirationalPeopleInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileInspirationalPeopleInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileInspirationalPeopleInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileInspirationalPeopleInner + * @throws IOException if the JSON string is invalid with respect to ProfileInspirationalPeopleInner + */ + public static ProfileInspirationalPeopleInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileInspirationalPeopleInner.class); + } + + /** + * Convert an instance of ProfileInspirationalPeopleInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileInterestsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileInterestsInner.java new file mode 100644 index 0000000..b040b96 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileInterestsInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileInterestsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileInterestsInner { + public static final String SERIALIZED_NAME_INTERESTED_TYPE = "InterestedType"; + @SerializedName(SERIALIZED_NAME_INTERESTED_TYPE) + @javax.annotation.Nullable + private String interestedType; + + public static final String SERIALIZED_NAME_INTERESTED_NAME = "InterestedName"; + @SerializedName(SERIALIZED_NAME_INTERESTED_NAME) + @javax.annotation.Nullable + private String interestedName; + + public ProfileInterestsInner() { + } + + public ProfileInterestsInner interestedType(@javax.annotation.Nullable String interestedType) { + this.interestedType = interestedType; + return this; + } + + /** + * The type of interest (e.g., Professional, Personal). + * @return interestedType + */ + @javax.annotation.Nullable + public String getInterestedType() { + return interestedType; + } + + public void setInterestedType(@javax.annotation.Nullable String interestedType) { + this.interestedType = interestedType; + } + + + public ProfileInterestsInner interestedName(@javax.annotation.Nullable String interestedName) { + this.interestedName = interestedName; + return this; + } + + /** + * The name of the interest. + * @return interestedName + */ + @javax.annotation.Nullable + public String getInterestedName() { + return interestedName; + } + + public void setInterestedName(@javax.annotation.Nullable String interestedName) { + this.interestedName = interestedName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileInterestsInner instance itself + */ + public ProfileInterestsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileInterestsInner profileInterestsInner = (ProfileInterestsInner) o; + return Objects.equals(this.interestedType, profileInterestsInner.interestedType) && + Objects.equals(this.interestedName, profileInterestsInner.interestedName)&& + Objects.equals(this.additionalProperties, profileInterestsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(interestedType, interestedName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileInterestsInner {\n"); + sb.append(" interestedType: ").append(toIndentedString(interestedType)).append("\n"); + sb.append(" interestedName: ").append(toIndentedString(interestedName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("InterestedType"); + openapiFields.add("InterestedName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileInterestsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileInterestsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileInterestsInner is not found in the empty JSON string", ProfileInterestsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("InterestedType") != null && !jsonObj.get("InterestedType").isJsonNull()) && !jsonObj.get("InterestedType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `InterestedType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("InterestedType").toString())); + } + if ((jsonObj.get("InterestedName") != null && !jsonObj.get("InterestedName").isJsonNull()) && !jsonObj.get("InterestedName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `InterestedName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("InterestedName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileInterestsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileInterestsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileInterestsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileInterestsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileInterestsInner>() { + @Override + public void write(JsonWriter out, ProfileInterestsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileInterestsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileInterestsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileInterestsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileInterestsInner + * @throws IOException if the JSON string is invalid with respect to ProfileInterestsInner + */ + public static ProfileInterestsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileInterestsInner.class); + } + + /** + * Convert an instance of ProfileInterestsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileJobBookmarksInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileJobBookmarksInner.java new file mode 100644 index 0000000..5a5d5f2 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileJobBookmarksInner.java @@ -0,0 +1,398 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProfileJobBookmarksInnerJob; +import java.io.IOException; +import java.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileJobBookmarksInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileJobBookmarksInner { + public static final String SERIALIZED_NAME_IS_APPLIED = "IsApplied"; + @SerializedName(SERIALIZED_NAME_IS_APPLIED) + @javax.annotation.Nullable + private Boolean isApplied; + + public static final String SERIALIZED_NAME_IS_SAVED = "IsSaved"; + @SerializedName(SERIALIZED_NAME_IS_SAVED) + @javax.annotation.Nullable + private Boolean isSaved; + + public static final String SERIALIZED_NAME_APPLY_TIMESTAMP = "ApplyTimestamp"; + @SerializedName(SERIALIZED_NAME_APPLY_TIMESTAMP) + @javax.annotation.Nullable + private OffsetDateTime applyTimestamp; + + public static final String SERIALIZED_NAME_SAVED_TIMESTAMP = "SavedTimestamp"; + @SerializedName(SERIALIZED_NAME_SAVED_TIMESTAMP) + @javax.annotation.Nullable + private OffsetDateTime savedTimestamp; + + public static final String SERIALIZED_NAME_JOB = "Job"; + @SerializedName(SERIALIZED_NAME_JOB) + @javax.annotation.Nullable + private ProfileJobBookmarksInnerJob job; + + public ProfileJobBookmarksInner() { + } + + public ProfileJobBookmarksInner isApplied(@javax.annotation.Nullable Boolean isApplied) { + this.isApplied = isApplied; + return this; + } + + /** + * Indicates if the job has been applied for. + * @return isApplied + */ + @javax.annotation.Nullable + public Boolean getIsApplied() { + return isApplied; + } + + public void setIsApplied(@javax.annotation.Nullable Boolean isApplied) { + this.isApplied = isApplied; + } + + + public ProfileJobBookmarksInner isSaved(@javax.annotation.Nullable Boolean isSaved) { + this.isSaved = isSaved; + return this; + } + + /** + * Indicates if the job has been saved. + * @return isSaved + */ + @javax.annotation.Nullable + public Boolean getIsSaved() { + return isSaved; + } + + public void setIsSaved(@javax.annotation.Nullable Boolean isSaved) { + this.isSaved = isSaved; + } + + + public ProfileJobBookmarksInner applyTimestamp(@javax.annotation.Nullable OffsetDateTime applyTimestamp) { + this.applyTimestamp = applyTimestamp; + return this; + } + + /** + * The timestamp of the job application. + * @return applyTimestamp + */ + @javax.annotation.Nullable + public OffsetDateTime getApplyTimestamp() { + return applyTimestamp; + } + + public void setApplyTimestamp(@javax.annotation.Nullable OffsetDateTime applyTimestamp) { + this.applyTimestamp = applyTimestamp; + } + + + public ProfileJobBookmarksInner savedTimestamp(@javax.annotation.Nullable OffsetDateTime savedTimestamp) { + this.savedTimestamp = savedTimestamp; + return this; + } + + /** + * The timestamp of the job being saved. + * @return savedTimestamp + */ + @javax.annotation.Nullable + public OffsetDateTime getSavedTimestamp() { + return savedTimestamp; + } + + public void setSavedTimestamp(@javax.annotation.Nullable OffsetDateTime savedTimestamp) { + this.savedTimestamp = savedTimestamp; + } + + + public ProfileJobBookmarksInner job(@javax.annotation.Nullable ProfileJobBookmarksInnerJob job) { + this.job = job; + return this; + } + + /** + * Get job + * @return job + */ + @javax.annotation.Nullable + public ProfileJobBookmarksInnerJob getJob() { + return job; + } + + public void setJob(@javax.annotation.Nullable ProfileJobBookmarksInnerJob job) { + this.job = job; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileJobBookmarksInner instance itself + */ + public ProfileJobBookmarksInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileJobBookmarksInner profileJobBookmarksInner = (ProfileJobBookmarksInner) o; + return Objects.equals(this.isApplied, profileJobBookmarksInner.isApplied) && + Objects.equals(this.isSaved, profileJobBookmarksInner.isSaved) && + Objects.equals(this.applyTimestamp, profileJobBookmarksInner.applyTimestamp) && + Objects.equals(this.savedTimestamp, profileJobBookmarksInner.savedTimestamp) && + Objects.equals(this.job, profileJobBookmarksInner.job)&& + Objects.equals(this.additionalProperties, profileJobBookmarksInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isApplied, isSaved, applyTimestamp, savedTimestamp, job, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileJobBookmarksInner {\n"); + sb.append(" isApplied: ").append(toIndentedString(isApplied)).append("\n"); + sb.append(" isSaved: ").append(toIndentedString(isSaved)).append("\n"); + sb.append(" applyTimestamp: ").append(toIndentedString(applyTimestamp)).append("\n"); + sb.append(" savedTimestamp: ").append(toIndentedString(savedTimestamp)).append("\n"); + sb.append(" job: ").append(toIndentedString(job)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsApplied"); + openapiFields.add("IsSaved"); + openapiFields.add("ApplyTimestamp"); + openapiFields.add("SavedTimestamp"); + openapiFields.add("Job"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileJobBookmarksInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileJobBookmarksInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileJobBookmarksInner is not found in the empty JSON string", ProfileJobBookmarksInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `Job` + if (jsonObj.get("Job") != null && !jsonObj.get("Job").isJsonNull()) { + ProfileJobBookmarksInnerJob.validateJsonElement(jsonObj.get("Job")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileJobBookmarksInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileJobBookmarksInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileJobBookmarksInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileJobBookmarksInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileJobBookmarksInner>() { + @Override + public void write(JsonWriter out, ProfileJobBookmarksInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileJobBookmarksInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileJobBookmarksInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileJobBookmarksInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileJobBookmarksInner + * @throws IOException if the JSON string is invalid with respect to ProfileJobBookmarksInner + */ + public static ProfileJobBookmarksInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileJobBookmarksInner.class); + } + + /** + * Convert an instance of ProfileJobBookmarksInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileJobBookmarksInnerJob.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileJobBookmarksInnerJob.java new file mode 100644 index 0000000..d971327 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileJobBookmarksInnerJob.java @@ -0,0 +1,372 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileJobBookmarksInnerJob + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileJobBookmarksInnerJob { + public static final String SERIALIZED_NAME_ACTIVE = "Active"; + @SerializedName(SERIALIZED_NAME_ACTIVE) + @javax.annotation.Nullable + private Boolean active; + + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_DESCRIPTION_SNIPPET = "DescriptionSnippet"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION_SNIPPET) + @javax.annotation.Nullable + private String descriptionSnippet; + + public static final String SERIALIZED_NAME_POSTING_TIMESTAMP = "PostingTimestamp"; + @SerializedName(SERIALIZED_NAME_POSTING_TIMESTAMP) + @javax.annotation.Nullable + private OffsetDateTime postingTimestamp; + + public ProfileJobBookmarksInnerJob() { + } + + public ProfileJobBookmarksInnerJob active(@javax.annotation.Nullable Boolean active) { + this.active = active; + return this; + } + + /** + * Indicates if the job is active. + * @return active + */ + @javax.annotation.Nullable + public Boolean getActive() { + return active; + } + + public void setActive(@javax.annotation.Nullable Boolean active) { + this.active = active; + } + + + public ProfileJobBookmarksInnerJob id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the job. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileJobBookmarksInnerJob descriptionSnippet(@javax.annotation.Nullable String descriptionSnippet) { + this.descriptionSnippet = descriptionSnippet; + return this; + } + + /** + * A snippet of the job description. + * @return descriptionSnippet + */ + @javax.annotation.Nullable + public String getDescriptionSnippet() { + return descriptionSnippet; + } + + public void setDescriptionSnippet(@javax.annotation.Nullable String descriptionSnippet) { + this.descriptionSnippet = descriptionSnippet; + } + + + public ProfileJobBookmarksInnerJob postingTimestamp(@javax.annotation.Nullable OffsetDateTime postingTimestamp) { + this.postingTimestamp = postingTimestamp; + return this; + } + + /** + * The timestamp of the job posting. + * @return postingTimestamp + */ + @javax.annotation.Nullable + public OffsetDateTime getPostingTimestamp() { + return postingTimestamp; + } + + public void setPostingTimestamp(@javax.annotation.Nullable OffsetDateTime postingTimestamp) { + this.postingTimestamp = postingTimestamp; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileJobBookmarksInnerJob instance itself + */ + public ProfileJobBookmarksInnerJob putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileJobBookmarksInnerJob profileJobBookmarksInnerJob = (ProfileJobBookmarksInnerJob) o; + return Objects.equals(this.active, profileJobBookmarksInnerJob.active) && + Objects.equals(this.id, profileJobBookmarksInnerJob.id) && + Objects.equals(this.descriptionSnippet, profileJobBookmarksInnerJob.descriptionSnippet) && + Objects.equals(this.postingTimestamp, profileJobBookmarksInnerJob.postingTimestamp)&& + Objects.equals(this.additionalProperties, profileJobBookmarksInnerJob.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(active, id, descriptionSnippet, postingTimestamp, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileJobBookmarksInnerJob {\n"); + sb.append(" active: ").append(toIndentedString(active)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" descriptionSnippet: ").append(toIndentedString(descriptionSnippet)).append("\n"); + sb.append(" postingTimestamp: ").append(toIndentedString(postingTimestamp)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Active"); + openapiFields.add("Id"); + openapiFields.add("DescriptionSnippet"); + openapiFields.add("PostingTimestamp"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileJobBookmarksInnerJob + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileJobBookmarksInnerJob.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileJobBookmarksInnerJob is not found in the empty JSON string", ProfileJobBookmarksInnerJob.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("DescriptionSnippet") != null && !jsonObj.get("DescriptionSnippet").isJsonNull()) && !jsonObj.get("DescriptionSnippet").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DescriptionSnippet` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DescriptionSnippet").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileJobBookmarksInnerJob.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileJobBookmarksInnerJob' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileJobBookmarksInnerJob> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileJobBookmarksInnerJob.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileJobBookmarksInnerJob>() { + @Override + public void write(JsonWriter out, ProfileJobBookmarksInnerJob value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileJobBookmarksInnerJob read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileJobBookmarksInnerJob instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileJobBookmarksInnerJob given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileJobBookmarksInnerJob + * @throws IOException if the JSON string is invalid with respect to ProfileJobBookmarksInnerJob + */ + public static ProfileJobBookmarksInnerJob fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileJobBookmarksInnerJob.class); + } + + /** + * Convert an instance of ProfileJobBookmarksInnerJob to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileKloutScore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileKloutScore.java new file mode 100644 index 0000000..b88966e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileKloutScore.java @@ -0,0 +1,314 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileKloutScore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileKloutScore { + public static final String SERIALIZED_NAME_KLOUT_ID = "KloutId"; + @SerializedName(SERIALIZED_NAME_KLOUT_ID) + @javax.annotation.Nullable + private String kloutId; + + public static final String SERIALIZED_NAME_SCORE = "Score"; + @SerializedName(SERIALIZED_NAME_SCORE) + @javax.annotation.Nullable + private Float score; + + public ProfileKloutScore() { + } + + public ProfileKloutScore kloutId(@javax.annotation.Nullable String kloutId) { + this.kloutId = kloutId; + return this; + } + + /** + * The Klout ID. + * @return kloutId + */ + @javax.annotation.Nullable + public String getKloutId() { + return kloutId; + } + + public void setKloutId(@javax.annotation.Nullable String kloutId) { + this.kloutId = kloutId; + } + + + public ProfileKloutScore score(@javax.annotation.Nullable Float score) { + this.score = score; + return this; + } + + /** + * The Klout score. + * @return score + */ + @javax.annotation.Nullable + public Float getScore() { + return score; + } + + public void setScore(@javax.annotation.Nullable Float score) { + this.score = score; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileKloutScore instance itself + */ + public ProfileKloutScore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileKloutScore profileKloutScore = (ProfileKloutScore) o; + return Objects.equals(this.kloutId, profileKloutScore.kloutId) && + Objects.equals(this.score, profileKloutScore.score)&& + Objects.equals(this.additionalProperties, profileKloutScore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(kloutId, score, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileKloutScore {\n"); + sb.append(" kloutId: ").append(toIndentedString(kloutId)).append("\n"); + sb.append(" score: ").append(toIndentedString(score)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("KloutId"); + openapiFields.add("Score"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileKloutScore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileKloutScore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileKloutScore is not found in the empty JSON string", ProfileKloutScore.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("KloutId") != null && !jsonObj.get("KloutId").isJsonNull()) && !jsonObj.get("KloutId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `KloutId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("KloutId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileKloutScore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileKloutScore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileKloutScore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileKloutScore.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileKloutScore>() { + @Override + public void write(JsonWriter out, ProfileKloutScore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileKloutScore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileKloutScore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileKloutScore given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileKloutScore + * @throws IOException if the JSON string is invalid with respect to ProfileKloutScore + */ + public static ProfileKloutScore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileKloutScore.class); + } + + /** + * Convert an instance of ProfileKloutScore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileLanguagesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileLanguagesInner.java new file mode 100644 index 0000000..1088d7f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileLanguagesInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileLanguagesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileLanguagesInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_PROFICIENCY = "Proficiency"; + @SerializedName(SERIALIZED_NAME_PROFICIENCY) + @javax.annotation.Nullable + private String proficiency; + + public ProfileLanguagesInner() { + } + + public ProfileLanguagesInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the language. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileLanguagesInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the language. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileLanguagesInner proficiency(@javax.annotation.Nullable String proficiency) { + this.proficiency = proficiency; + return this; + } + + /** + * The proficiency level in the language. + * @return proficiency + */ + @javax.annotation.Nullable + public String getProficiency() { + return proficiency; + } + + public void setProficiency(@javax.annotation.Nullable String proficiency) { + this.proficiency = proficiency; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileLanguagesInner instance itself + */ + public ProfileLanguagesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileLanguagesInner profileLanguagesInner = (ProfileLanguagesInner) o; + return Objects.equals(this.id, profileLanguagesInner.id) && + Objects.equals(this.name, profileLanguagesInner.name) && + Objects.equals(this.proficiency, profileLanguagesInner.proficiency)&& + Objects.equals(this.additionalProperties, profileLanguagesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, proficiency, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileLanguagesInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" proficiency: ").append(toIndentedString(proficiency)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Proficiency"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileLanguagesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileLanguagesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileLanguagesInner is not found in the empty JSON string", ProfileLanguagesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Proficiency") != null && !jsonObj.get("Proficiency").isJsonNull()) && !jsonObj.get("Proficiency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Proficiency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Proficiency").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileLanguagesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileLanguagesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileLanguagesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileLanguagesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileLanguagesInner>() { + @Override + public void write(JsonWriter out, ProfileLanguagesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileLanguagesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileLanguagesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileLanguagesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileLanguagesInner + * @throws IOException if the JSON string is invalid with respect to ProfileLanguagesInner + */ + public static ProfileLanguagesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileLanguagesInner.class); + } + + /** + * Convert an instance of ProfileLanguagesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileMemberUrlResourcesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileMemberUrlResourcesInner.java new file mode 100644 index 0000000..bb1b6cb --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileMemberUrlResourcesInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileMemberUrlResourcesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileMemberUrlResourcesInner { + public static final String SERIALIZED_NAME_URL = "Url"; + @SerializedName(SERIALIZED_NAME_URL) + @javax.annotation.Nullable + private String url; + + public static final String SERIALIZED_NAME_URL_NAME = "UrlName"; + @SerializedName(SERIALIZED_NAME_URL_NAME) + @javax.annotation.Nullable + private String urlName; + + public ProfileMemberUrlResourcesInner() { + } + + public ProfileMemberUrlResourcesInner url(@javax.annotation.Nullable String url) { + this.url = url; + return this; + } + + /** + * The URL of the resource. + * @return url + */ + @javax.annotation.Nullable + public String getUrl() { + return url; + } + + public void setUrl(@javax.annotation.Nullable String url) { + this.url = url; + } + + + public ProfileMemberUrlResourcesInner urlName(@javax.annotation.Nullable String urlName) { + this.urlName = urlName; + return this; + } + + /** + * The name of the URL resource. + * @return urlName + */ + @javax.annotation.Nullable + public String getUrlName() { + return urlName; + } + + public void setUrlName(@javax.annotation.Nullable String urlName) { + this.urlName = urlName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileMemberUrlResourcesInner instance itself + */ + public ProfileMemberUrlResourcesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileMemberUrlResourcesInner profileMemberUrlResourcesInner = (ProfileMemberUrlResourcesInner) o; + return Objects.equals(this.url, profileMemberUrlResourcesInner.url) && + Objects.equals(this.urlName, profileMemberUrlResourcesInner.urlName)&& + Objects.equals(this.additionalProperties, profileMemberUrlResourcesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(url, urlName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileMemberUrlResourcesInner {\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" urlName: ").append(toIndentedString(urlName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Url"); + openapiFields.add("UrlName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileMemberUrlResourcesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileMemberUrlResourcesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileMemberUrlResourcesInner is not found in the empty JSON string", ProfileMemberUrlResourcesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Url") != null && !jsonObj.get("Url").isJsonNull()) && !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())); + } + if ((jsonObj.get("UrlName") != null && !jsonObj.get("UrlName").isJsonNull()) && !jsonObj.get("UrlName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UrlName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UrlName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileMemberUrlResourcesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileMemberUrlResourcesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileMemberUrlResourcesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileMemberUrlResourcesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileMemberUrlResourcesInner>() { + @Override + public void write(JsonWriter out, ProfileMemberUrlResourcesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileMemberUrlResourcesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileMemberUrlResourcesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileMemberUrlResourcesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileMemberUrlResourcesInner + * @throws IOException if the JSON string is invalid with respect to ProfileMemberUrlResourcesInner + */ + public static ProfileMemberUrlResourcesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileMemberUrlResourcesInner.class); + } + + /** + * Convert an instance of ProfileMemberUrlResourcesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileMoviesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileMoviesInner.java new file mode 100644 index 0000000..6535ae4 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileMoviesInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileMoviesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileMoviesInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_CATEGORY = "Category"; + @SerializedName(SERIALIZED_NAME_CATEGORY) + @javax.annotation.Nullable + private String category; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ProfileMoviesInner() { + } + + public ProfileMoviesInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the movie. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileMoviesInner category(@javax.annotation.Nullable String category) { + this.category = category; + return this; + } + + /** + * The category of the movie. + * @return category + */ + @javax.annotation.Nullable + public String getCategory() { + return category; + } + + public void setCategory(@javax.annotation.Nullable String category) { + this.category = category; + } + + + public ProfileMoviesInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the movie. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileMoviesInner instance itself + */ + public ProfileMoviesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileMoviesInner profileMoviesInner = (ProfileMoviesInner) o; + return Objects.equals(this.id, profileMoviesInner.id) && + Objects.equals(this.category, profileMoviesInner.category) && + Objects.equals(this.name, profileMoviesInner.name)&& + Objects.equals(this.additionalProperties, profileMoviesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileMoviesInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Category"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileMoviesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileMoviesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileMoviesInner is not found in the empty JSON string", ProfileMoviesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Category") != null && !jsonObj.get("Category").isJsonNull()) && !jsonObj.get("Category").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Category` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Category").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileMoviesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileMoviesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileMoviesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileMoviesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileMoviesInner>() { + @Override + public void write(JsonWriter out, ProfileMoviesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileMoviesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileMoviesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileMoviesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileMoviesInner + * @throws IOException if the JSON string is invalid with respect to ProfileMoviesInner + */ + public static ProfileMoviesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileMoviesInner.class); + } + + /** + * Convert an instance of ProfileMoviesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileMutualFriendsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileMutualFriendsInner.java new file mode 100644 index 0000000..895b5c2 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileMutualFriendsInner.java @@ -0,0 +1,495 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileMutualFriendsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileMutualFriendsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_FIRST_NAME = "FirstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nullable + private String firstName; + + public static final String SERIALIZED_NAME_LAST_NAME = "LastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nullable + private String lastName; + + public static final String SERIALIZED_NAME_BIRTHDAY = "Birthday"; + @SerializedName(SERIALIZED_NAME_BIRTHDAY) + @javax.annotation.Nullable + private OffsetDateTime birthday; + + public static final String SERIALIZED_NAME_HOMETOWN = "Hometown"; + @SerializedName(SERIALIZED_NAME_HOMETOWN) + @javax.annotation.Nullable + private String hometown; + + public static final String SERIALIZED_NAME_LINK = "Link"; + @SerializedName(SERIALIZED_NAME_LINK) + @javax.annotation.Nullable + private String link; + + public static final String SERIALIZED_NAME_GENDER = "Gender"; + @SerializedName(SERIALIZED_NAME_GENDER) + @javax.annotation.Nullable + private String gender; + + public ProfileMutualFriendsInner() { + } + + public ProfileMutualFriendsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the mutual friend. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileMutualFriendsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the mutual friend. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileMutualFriendsInner firstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * The first name of the mutual friend. + * @return firstName + */ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + } + + + public ProfileMutualFriendsInner lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * The last name of the mutual friend. + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + + public ProfileMutualFriendsInner birthday(@javax.annotation.Nullable OffsetDateTime birthday) { + this.birthday = birthday; + return this; + } + + /** + * The birthday of the mutual friend. + * @return birthday + */ + @javax.annotation.Nullable + public OffsetDateTime getBirthday() { + return birthday; + } + + public void setBirthday(@javax.annotation.Nullable OffsetDateTime birthday) { + this.birthday = birthday; + } + + + public ProfileMutualFriendsInner hometown(@javax.annotation.Nullable String hometown) { + this.hometown = hometown; + return this; + } + + /** + * The hometown of the mutual friend. + * @return hometown + */ + @javax.annotation.Nullable + public String getHometown() { + return hometown; + } + + public void setHometown(@javax.annotation.Nullable String hometown) { + this.hometown = hometown; + } + + + public ProfileMutualFriendsInner link(@javax.annotation.Nullable String link) { + this.link = link; + return this; + } + + /** + * The profile link of the mutual friend. + * @return link + */ + @javax.annotation.Nullable + public String getLink() { + return link; + } + + public void setLink(@javax.annotation.Nullable String link) { + this.link = link; + } + + + public ProfileMutualFriendsInner gender(@javax.annotation.Nullable String gender) { + this.gender = gender; + return this; + } + + /** + * The gender of the mutual friend. + * @return gender + */ + @javax.annotation.Nullable + public String getGender() { + return gender; + } + + public void setGender(@javax.annotation.Nullable String gender) { + this.gender = gender; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileMutualFriendsInner instance itself + */ + public ProfileMutualFriendsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileMutualFriendsInner profileMutualFriendsInner = (ProfileMutualFriendsInner) o; + return Objects.equals(this.id, profileMutualFriendsInner.id) && + Objects.equals(this.name, profileMutualFriendsInner.name) && + Objects.equals(this.firstName, profileMutualFriendsInner.firstName) && + Objects.equals(this.lastName, profileMutualFriendsInner.lastName) && + Objects.equals(this.birthday, profileMutualFriendsInner.birthday) && + Objects.equals(this.hometown, profileMutualFriendsInner.hometown) && + Objects.equals(this.link, profileMutualFriendsInner.link) && + Objects.equals(this.gender, profileMutualFriendsInner.gender)&& + Objects.equals(this.additionalProperties, profileMutualFriendsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, firstName, lastName, birthday, hometown, link, gender, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileMutualFriendsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" birthday: ").append(toIndentedString(birthday)).append("\n"); + sb.append(" hometown: ").append(toIndentedString(hometown)).append("\n"); + sb.append(" link: ").append(toIndentedString(link)).append("\n"); + sb.append(" gender: ").append(toIndentedString(gender)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("FirstName"); + openapiFields.add("LastName"); + openapiFields.add("Birthday"); + openapiFields.add("Hometown"); + openapiFields.add("Link"); + openapiFields.add("Gender"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileMutualFriendsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileMutualFriendsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileMutualFriendsInner is not found in the empty JSON string", ProfileMutualFriendsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("FirstName") != null && !jsonObj.get("FirstName").isJsonNull()) && !jsonObj.get("FirstName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FirstName").toString())); + } + if ((jsonObj.get("LastName") != null && !jsonObj.get("LastName").isJsonNull()) && !jsonObj.get("LastName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastName").toString())); + } + if ((jsonObj.get("Hometown") != null && !jsonObj.get("Hometown").isJsonNull()) && !jsonObj.get("Hometown").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Hometown` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Hometown").toString())); + } + 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())); + } + if ((jsonObj.get("Gender") != null && !jsonObj.get("Gender").isJsonNull()) && !jsonObj.get("Gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Gender").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileMutualFriendsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileMutualFriendsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileMutualFriendsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileMutualFriendsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileMutualFriendsInner>() { + @Override + public void write(JsonWriter out, ProfileMutualFriendsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileMutualFriendsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileMutualFriendsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileMutualFriendsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileMutualFriendsInner + * @throws IOException if the JSON string is invalid with respect to ProfileMutualFriendsInner + */ + public static ProfileMutualFriendsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileMutualFriendsInner.class); + } + + /** + * Convert an instance of ProfileMutualFriendsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileOrganizationsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileOrganizationsInner.java new file mode 100644 index 0000000..fe4f630 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileOrganizationsInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileOrganizationsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileOrganizationsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_LOGO_U_R_L = "LogoURL"; + @SerializedName(SERIALIZED_NAME_LOGO_U_R_L) + @javax.annotation.Nullable + private String logoURL; + + public ProfileOrganizationsInner() { + } + + public ProfileOrganizationsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the organization. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileOrganizationsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the organization. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileOrganizationsInner logoURL(@javax.annotation.Nullable String logoURL) { + this.logoURL = logoURL; + return this; + } + + /** + * The logo URL of the organization. + * @return logoURL + */ + @javax.annotation.Nullable + public String getLogoURL() { + return logoURL; + } + + public void setLogoURL(@javax.annotation.Nullable String logoURL) { + this.logoURL = logoURL; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileOrganizationsInner instance itself + */ + public ProfileOrganizationsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileOrganizationsInner profileOrganizationsInner = (ProfileOrganizationsInner) o; + return Objects.equals(this.id, profileOrganizationsInner.id) && + Objects.equals(this.name, profileOrganizationsInner.name) && + Objects.equals(this.logoURL, profileOrganizationsInner.logoURL)&& + Objects.equals(this.additionalProperties, profileOrganizationsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, logoURL, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileOrganizationsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" logoURL: ").append(toIndentedString(logoURL)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("LogoURL"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileOrganizationsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileOrganizationsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileOrganizationsInner is not found in the empty JSON string", ProfileOrganizationsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("LogoURL") != null && !jsonObj.get("LogoURL").isJsonNull()) && !jsonObj.get("LogoURL").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LogoURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LogoURL").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileOrganizationsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileOrganizationsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileOrganizationsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileOrganizationsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileOrganizationsInner>() { + @Override + public void write(JsonWriter out, ProfileOrganizationsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileOrganizationsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileOrganizationsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileOrganizationsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileOrganizationsInner + * @throws IOException if the JSON string is invalid with respect to ProfileOrganizationsInner + */ + public static ProfileOrganizationsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileOrganizationsInner.class); + } + + /** + * Convert an instance of ProfileOrganizationsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfilePIN.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfilePIN.java new file mode 100644 index 0000000..65b16d4 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfilePIN.java @@ -0,0 +1,411 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfilePIN + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfilePIN { + public static final String SERIALIZED_NAME_SKIPPED = "Skipped"; + @SerializedName(SERIALIZED_NAME_SKIPPED) + @javax.annotation.Nullable + private Boolean skipped; + + public static final String SERIALIZED_NAME_P_I_N = "PIN"; + @SerializedName(SERIALIZED_NAME_P_I_N) + @javax.annotation.Nullable + private String PIN; + + public static final String SERIALIZED_NAME_LAST_P_I_N_CHANGE_TOKEN = "LastPINChangeToken"; + @SerializedName(SERIALIZED_NAME_LAST_P_I_N_CHANGE_TOKEN) + @javax.annotation.Nullable + private String lastPINChangeToken; + + public static final String SERIALIZED_NAME_LAST_P_I_N_CHANGE_DATE = "LastPINChangeDate"; + @SerializedName(SERIALIZED_NAME_LAST_P_I_N_CHANGE_DATE) + @javax.annotation.Nullable + private OffsetDateTime lastPINChangeDate; + + public static final String SERIALIZED_NAME_SKIPPED_DATE = "SkippedDate"; + @SerializedName(SERIALIZED_NAME_SKIPPED_DATE) + @javax.annotation.Nullable + private OffsetDateTime skippedDate; + + public ProfilePIN() { + } + + public ProfilePIN skipped(@javax.annotation.Nullable Boolean skipped) { + this.skipped = skipped; + return this; + } + + /** + * Indicates if the PIN setup was skipped. + * @return skipped + */ + @javax.annotation.Nullable + public Boolean getSkipped() { + return skipped; + } + + public void setSkipped(@javax.annotation.Nullable Boolean skipped) { + this.skipped = skipped; + } + + + public ProfilePIN PIN(@javax.annotation.Nullable String PIN) { + this.PIN = PIN; + return this; + } + + /** + * The PIN value. + * @return PIN + */ + @javax.annotation.Nullable + public String getPIN() { + return PIN; + } + + public void setPIN(@javax.annotation.Nullable String PIN) { + this.PIN = PIN; + } + + + public ProfilePIN lastPINChangeToken(@javax.annotation.Nullable String lastPINChangeToken) { + this.lastPINChangeToken = lastPINChangeToken; + return this; + } + + /** + * The token for the last PIN change. + * @return lastPINChangeToken + */ + @javax.annotation.Nullable + public String getLastPINChangeToken() { + return lastPINChangeToken; + } + + public void setLastPINChangeToken(@javax.annotation.Nullable String lastPINChangeToken) { + this.lastPINChangeToken = lastPINChangeToken; + } + + + public ProfilePIN lastPINChangeDate(@javax.annotation.Nullable OffsetDateTime lastPINChangeDate) { + this.lastPINChangeDate = lastPINChangeDate; + return this; + } + + /** + * The date of the last PIN change. + * @return lastPINChangeDate + */ + @javax.annotation.Nullable + public OffsetDateTime getLastPINChangeDate() { + return lastPINChangeDate; + } + + public void setLastPINChangeDate(@javax.annotation.Nullable OffsetDateTime lastPINChangeDate) { + this.lastPINChangeDate = lastPINChangeDate; + } + + + public ProfilePIN skippedDate(@javax.annotation.Nullable OffsetDateTime skippedDate) { + this.skippedDate = skippedDate; + return this; + } + + /** + * The date the PIN setup was skipped. + * @return skippedDate + */ + @javax.annotation.Nullable + public OffsetDateTime getSkippedDate() { + return skippedDate; + } + + public void setSkippedDate(@javax.annotation.Nullable OffsetDateTime skippedDate) { + this.skippedDate = skippedDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfilePIN instance itself + */ + public ProfilePIN putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfilePIN profilePIN = (ProfilePIN) o; + return Objects.equals(this.skipped, profilePIN.skipped) && + Objects.equals(this.PIN, profilePIN.PIN) && + Objects.equals(this.lastPINChangeToken, profilePIN.lastPINChangeToken) && + Objects.equals(this.lastPINChangeDate, profilePIN.lastPINChangeDate) && + Objects.equals(this.skippedDate, profilePIN.skippedDate)&& + Objects.equals(this.additionalProperties, profilePIN.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(skipped, PIN, lastPINChangeToken, lastPINChangeDate, skippedDate, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfilePIN {\n"); + sb.append(" skipped: ").append(toIndentedString(skipped)).append("\n"); + sb.append(" PIN: ").append(toIndentedString(PIN)).append("\n"); + sb.append(" lastPINChangeToken: ").append(toIndentedString(lastPINChangeToken)).append("\n"); + sb.append(" lastPINChangeDate: ").append(toIndentedString(lastPINChangeDate)).append("\n"); + sb.append(" skippedDate: ").append(toIndentedString(skippedDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Skipped"); + openapiFields.add("PIN"); + openapiFields.add("LastPINChangeToken"); + openapiFields.add("LastPINChangeDate"); + openapiFields.add("SkippedDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfilePIN + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfilePIN.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfilePIN is not found in the empty JSON string", ProfilePIN.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("PIN") != null && !jsonObj.get("PIN").isJsonNull()) && !jsonObj.get("PIN").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PIN` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PIN").toString())); + } + if ((jsonObj.get("LastPINChangeToken") != null && !jsonObj.get("LastPINChangeToken").isJsonNull()) && !jsonObj.get("LastPINChangeToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastPINChangeToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastPINChangeToken").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfilePIN.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfilePIN' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfilePIN> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfilePIN.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfilePIN>() { + @Override + public void write(JsonWriter out, ProfilePIN value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfilePIN read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfilePIN instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfilePIN given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfilePIN + * @throws IOException if the JSON string is invalid with respect to ProfilePIN + */ + public static ProfilePIN fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfilePIN.class); + } + + /** + * Convert an instance of ProfilePIN to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfilePasskeyLogin.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfilePasskeyLogin.java new file mode 100644 index 0000000..4fbaaa7 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfilePasskeyLogin.java @@ -0,0 +1,351 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Passkey login details for the User. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfilePasskeyLogin { + public static final String SERIALIZED_NAME_PROGRESSIVE_FLAG = "ProgressiveFlag"; + @SerializedName(SERIALIZED_NAME_PROGRESSIVE_FLAG) + @javax.annotation.Nullable + private Boolean progressiveFlag; + + public static final String SERIALIZED_NAME_LOCAL_ENROLLMENT_FLAG = "LocalEnrollmentFlag"; + @SerializedName(SERIALIZED_NAME_LOCAL_ENROLLMENT_FLAG) + @javax.annotation.Nullable + private Boolean localEnrollmentFlag; + + public static final String SERIALIZED_NAME_PROGRESSIVE_ENROLLMENT_DATE = "ProgressiveEnrollmentDate"; + @SerializedName(SERIALIZED_NAME_PROGRESSIVE_ENROLLMENT_DATE) + @javax.annotation.Nullable + private OffsetDateTime progressiveEnrollmentDate; + + public ProfilePasskeyLogin() { + } + + public ProfilePasskeyLogin progressiveFlag(@javax.annotation.Nullable Boolean progressiveFlag) { + this.progressiveFlag = progressiveFlag; + return this; + } + + /** + * Get progressiveFlag + * @return progressiveFlag + */ + @javax.annotation.Nullable + public Boolean getProgressiveFlag() { + return progressiveFlag; + } + + public void setProgressiveFlag(@javax.annotation.Nullable Boolean progressiveFlag) { + this.progressiveFlag = progressiveFlag; + } + + + public ProfilePasskeyLogin localEnrollmentFlag(@javax.annotation.Nullable Boolean localEnrollmentFlag) { + this.localEnrollmentFlag = localEnrollmentFlag; + return this; + } + + /** + * Get localEnrollmentFlag + * @return localEnrollmentFlag + */ + @javax.annotation.Nullable + public Boolean getLocalEnrollmentFlag() { + return localEnrollmentFlag; + } + + public void setLocalEnrollmentFlag(@javax.annotation.Nullable Boolean localEnrollmentFlag) { + this.localEnrollmentFlag = localEnrollmentFlag; + } + + + public ProfilePasskeyLogin progressiveEnrollmentDate(@javax.annotation.Nullable OffsetDateTime progressiveEnrollmentDate) { + this.progressiveEnrollmentDate = progressiveEnrollmentDate; + return this; + } + + /** + * The date of progressive enrollment. + * @return progressiveEnrollmentDate + */ + @javax.annotation.Nullable + public OffsetDateTime getProgressiveEnrollmentDate() { + return progressiveEnrollmentDate; + } + + public void setProgressiveEnrollmentDate(@javax.annotation.Nullable OffsetDateTime progressiveEnrollmentDate) { + this.progressiveEnrollmentDate = progressiveEnrollmentDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfilePasskeyLogin instance itself + */ + public ProfilePasskeyLogin putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfilePasskeyLogin profilePasskeyLogin = (ProfilePasskeyLogin) o; + return Objects.equals(this.progressiveFlag, profilePasskeyLogin.progressiveFlag) && + Objects.equals(this.localEnrollmentFlag, profilePasskeyLogin.localEnrollmentFlag) && + Objects.equals(this.progressiveEnrollmentDate, profilePasskeyLogin.progressiveEnrollmentDate)&& + Objects.equals(this.additionalProperties, profilePasskeyLogin.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(progressiveFlag, localEnrollmentFlag, progressiveEnrollmentDate, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfilePasskeyLogin {\n"); + sb.append(" progressiveFlag: ").append(toIndentedString(progressiveFlag)).append("\n"); + sb.append(" localEnrollmentFlag: ").append(toIndentedString(localEnrollmentFlag)).append("\n"); + sb.append(" progressiveEnrollmentDate: ").append(toIndentedString(progressiveEnrollmentDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ProgressiveFlag"); + openapiFields.add("LocalEnrollmentFlag"); + openapiFields.add("ProgressiveEnrollmentDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfilePasskeyLogin + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfilePasskeyLogin.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfilePasskeyLogin is not found in the empty JSON string", ProfilePasskeyLogin.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfilePasskeyLogin.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfilePasskeyLogin' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfilePasskeyLogin> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfilePasskeyLogin.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfilePasskeyLogin>() { + @Override + public void write(JsonWriter out, ProfilePasskeyLogin value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfilePasskeyLogin read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfilePasskeyLogin instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfilePasskeyLogin given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfilePasskeyLogin + * @throws IOException if the JSON string is invalid with respect to ProfilePasskeyLogin + */ + public static ProfilePasskeyLogin fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfilePasskeyLogin.class); + } + + /** + * Convert an instance of ProfilePasskeyLogin to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfilePatentsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfilePatentsInner.java new file mode 100644 index 0000000..496c890 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfilePatentsInner.java @@ -0,0 +1,345 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfilePatentsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfilePatentsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_TITLE = "Title"; + @SerializedName(SERIALIZED_NAME_TITLE) + @javax.annotation.Nullable + private String title; + + public static final String SERIALIZED_NAME_DATE = "Date"; + @SerializedName(SERIALIZED_NAME_DATE) + @javax.annotation.Nullable + private OffsetDateTime date; + + public ProfilePatentsInner() { + } + + public ProfilePatentsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the patent. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfilePatentsInner title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * The title of the patent. + * @return title + */ + @javax.annotation.Nullable + public String getTitle() { + return title; + } + + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + public ProfilePatentsInner date(@javax.annotation.Nullable OffsetDateTime date) { + this.date = date; + return this; + } + + /** + * The date the patent was filed. + * @return date + */ + @javax.annotation.Nullable + public OffsetDateTime getDate() { + return date; + } + + public void setDate(@javax.annotation.Nullable OffsetDateTime date) { + this.date = date; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfilePatentsInner instance itself + */ + public ProfilePatentsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfilePatentsInner profilePatentsInner = (ProfilePatentsInner) o; + return Objects.equals(this.id, profilePatentsInner.id) && + Objects.equals(this.title, profilePatentsInner.title) && + Objects.equals(this.date, profilePatentsInner.date)&& + Objects.equals(this.additionalProperties, profilePatentsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, title, date, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfilePatentsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Title"); + openapiFields.add("Date"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfilePatentsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfilePatentsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfilePatentsInner is not found in the empty JSON string", ProfilePatentsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Title") != null && !jsonObj.get("Title").isJsonNull()) && !jsonObj.get("Title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Title").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfilePatentsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfilePatentsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfilePatentsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfilePatentsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfilePatentsInner>() { + @Override + public void write(JsonWriter out, ProfilePatentsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfilePatentsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfilePatentsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfilePatentsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfilePatentsInner + * @throws IOException if the JSON string is invalid with respect to ProfilePatentsInner + */ + public static ProfilePatentsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfilePatentsInner.class); + } + + /** + * Convert an instance of ProfilePatentsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfilePhoneNumbersInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfilePhoneNumbersInner.java new file mode 100644 index 0000000..5dd1bce --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfilePhoneNumbersInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfilePhoneNumbersInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfilePhoneNumbersInner { + public static final String SERIALIZED_NAME_PHONE_TYPE = "PhoneType"; + @SerializedName(SERIALIZED_NAME_PHONE_TYPE) + @javax.annotation.Nullable + private String phoneType; + + public static final String SERIALIZED_NAME_PHONE_NUMBER = "PhoneNumber"; + @SerializedName(SERIALIZED_NAME_PHONE_NUMBER) + @javax.annotation.Nullable + private String phoneNumber; + + public static final String SERIALIZED_NAME_OPERATION = "Operation"; + @SerializedName(SERIALIZED_NAME_OPERATION) + @javax.annotation.Nullable + private String operation; + + public ProfilePhoneNumbersInner() { + } + + public ProfilePhoneNumbersInner phoneType(@javax.annotation.Nullable String phoneType) { + this.phoneType = phoneType; + return this; + } + + /** + * The type of Phone (e.g., Mobile, Home). + * @return phoneType + */ + @javax.annotation.Nullable + public String getPhoneType() { + return phoneType; + } + + public void setPhoneType(@javax.annotation.Nullable String phoneType) { + this.phoneType = phoneType; + } + + + public ProfilePhoneNumbersInner phoneNumber(@javax.annotation.Nullable String phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + * The Phone number. + * @return phoneNumber + */ + @javax.annotation.Nullable + public String getPhoneNumber() { + return phoneNumber; + } + + public void setPhoneNumber(@javax.annotation.Nullable String phoneNumber) { + this.phoneNumber = phoneNumber; + } + + + public ProfilePhoneNumbersInner operation(@javax.annotation.Nullable String operation) { + this.operation = operation; + return this; + } + + /** + * The operation performed on the Phone number. + * @return operation + */ + @javax.annotation.Nullable + public String getOperation() { + return operation; + } + + public void setOperation(@javax.annotation.Nullable String operation) { + this.operation = operation; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfilePhoneNumbersInner instance itself + */ + public ProfilePhoneNumbersInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfilePhoneNumbersInner profilePhoneNumbersInner = (ProfilePhoneNumbersInner) o; + return Objects.equals(this.phoneType, profilePhoneNumbersInner.phoneType) && + Objects.equals(this.phoneNumber, profilePhoneNumbersInner.phoneNumber) && + Objects.equals(this.operation, profilePhoneNumbersInner.operation)&& + Objects.equals(this.additionalProperties, profilePhoneNumbersInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(phoneType, phoneNumber, operation, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfilePhoneNumbersInner {\n"); + sb.append(" phoneType: ").append(toIndentedString(phoneType)).append("\n"); + sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); + sb.append(" operation: ").append(toIndentedString(operation)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("PhoneType"); + openapiFields.add("PhoneNumber"); + openapiFields.add("Operation"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfilePhoneNumbersInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfilePhoneNumbersInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfilePhoneNumbersInner is not found in the empty JSON string", ProfilePhoneNumbersInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("PhoneType") != null && !jsonObj.get("PhoneType").isJsonNull()) && !jsonObj.get("PhoneType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PhoneType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PhoneType").toString())); + } + if ((jsonObj.get("PhoneNumber") != null && !jsonObj.get("PhoneNumber").isJsonNull()) && !jsonObj.get("PhoneNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PhoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PhoneNumber").toString())); + } + if ((jsonObj.get("Operation") != null && !jsonObj.get("Operation").isJsonNull()) && !jsonObj.get("Operation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Operation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Operation").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfilePhoneNumbersInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfilePhoneNumbersInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfilePhoneNumbersInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfilePhoneNumbersInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfilePhoneNumbersInner>() { + @Override + public void write(JsonWriter out, ProfilePhoneNumbersInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfilePhoneNumbersInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfilePhoneNumbersInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfilePhoneNumbersInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfilePhoneNumbersInner + * @throws IOException if the JSON string is invalid with respect to ProfilePhoneNumbersInner + */ + public static ProfilePhoneNumbersInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfilePhoneNumbersInner.class); + } + + /** + * Convert an instance of ProfilePhoneNumbersInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfilePlacesLivedInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfilePlacesLivedInner.java new file mode 100644 index 0000000..8ca2028 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfilePlacesLivedInner.java @@ -0,0 +1,344 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfilePlacesLivedInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfilePlacesLivedInner { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_OPERATION = "Operation"; + @SerializedName(SERIALIZED_NAME_OPERATION) + @javax.annotation.Nullable + private String operation; + + public static final String SERIALIZED_NAME_IS_PRIMARY = "IsPrimary"; + @SerializedName(SERIALIZED_NAME_IS_PRIMARY) + @javax.annotation.Nullable + private Boolean isPrimary; + + public ProfilePlacesLivedInner() { + } + + public ProfilePlacesLivedInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the place. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfilePlacesLivedInner operation(@javax.annotation.Nullable String operation) { + this.operation = operation; + return this; + } + + /** + * The operation performed on the place. + * @return operation + */ + @javax.annotation.Nullable + public String getOperation() { + return operation; + } + + public void setOperation(@javax.annotation.Nullable String operation) { + this.operation = operation; + } + + + public ProfilePlacesLivedInner isPrimary(@javax.annotation.Nullable Boolean isPrimary) { + this.isPrimary = isPrimary; + return this; + } + + /** + * Indicates if the place is the primary residence. + * @return isPrimary + */ + @javax.annotation.Nullable + public Boolean getIsPrimary() { + return isPrimary; + } + + public void setIsPrimary(@javax.annotation.Nullable Boolean isPrimary) { + this.isPrimary = isPrimary; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfilePlacesLivedInner instance itself + */ + public ProfilePlacesLivedInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfilePlacesLivedInner profilePlacesLivedInner = (ProfilePlacesLivedInner) o; + return Objects.equals(this.name, profilePlacesLivedInner.name) && + Objects.equals(this.operation, profilePlacesLivedInner.operation) && + Objects.equals(this.isPrimary, profilePlacesLivedInner.isPrimary)&& + Objects.equals(this.additionalProperties, profilePlacesLivedInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, operation, isPrimary, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfilePlacesLivedInner {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" operation: ").append(toIndentedString(operation)).append("\n"); + sb.append(" isPrimary: ").append(toIndentedString(isPrimary)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + openapiFields.add("Operation"); + openapiFields.add("IsPrimary"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfilePlacesLivedInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfilePlacesLivedInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfilePlacesLivedInner is not found in the empty JSON string", ProfilePlacesLivedInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Operation") != null && !jsonObj.get("Operation").isJsonNull()) && !jsonObj.get("Operation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Operation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Operation").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfilePlacesLivedInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfilePlacesLivedInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfilePlacesLivedInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfilePlacesLivedInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfilePlacesLivedInner>() { + @Override + public void write(JsonWriter out, ProfilePlacesLivedInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfilePlacesLivedInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfilePlacesLivedInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfilePlacesLivedInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfilePlacesLivedInner + * @throws IOException if the JSON string is invalid with respect to ProfilePlacesLivedInner + */ + public static ProfilePlacesLivedInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfilePlacesLivedInner.class); + } + + /** + * Convert an instance of ProfilePlacesLivedInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfilePositionsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfilePositionsInner.java new file mode 100644 index 0000000..bfb3c42 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfilePositionsInner.java @@ -0,0 +1,464 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProfilePositionsInnerCompany; +import java.io.IOException; +import java.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfilePositionsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfilePositionsInner { + public static final String SERIALIZED_NAME_POSITION = "Position"; + @SerializedName(SERIALIZED_NAME_POSITION) + @javax.annotation.Nullable + private String position; + + public static final String SERIALIZED_NAME_SUMMARY = "Summary"; + @SerializedName(SERIALIZED_NAME_SUMMARY) + @javax.annotation.Nullable + private String summary; + + public static final String SERIALIZED_NAME_START_DATE = "StartDate"; + @SerializedName(SERIALIZED_NAME_START_DATE) + @javax.annotation.Nullable + private OffsetDateTime startDate; + + public static final String SERIALIZED_NAME_END_DATE = "EndDate"; + @SerializedName(SERIALIZED_NAME_END_DATE) + @javax.annotation.Nullable + private OffsetDateTime endDate; + + public static final String SERIALIZED_NAME_IS_CURRENT = "IsCurrent"; + @SerializedName(SERIALIZED_NAME_IS_CURRENT) + @javax.annotation.Nullable + private String isCurrent; + + public static final String SERIALIZED_NAME_LOCATION = "Location"; + @SerializedName(SERIALIZED_NAME_LOCATION) + @javax.annotation.Nullable + private String location; + + public static final String SERIALIZED_NAME_COMPANY = "Company"; + @SerializedName(SERIALIZED_NAME_COMPANY) + @javax.annotation.Nullable + private ProfilePositionsInnerCompany company; + + public ProfilePositionsInner() { + } + + public ProfilePositionsInner position(@javax.annotation.Nullable String position) { + this.position = position; + return this; + } + + /** + * The position held by the User. + * @return position + */ + @javax.annotation.Nullable + public String getPosition() { + return position; + } + + public void setPosition(@javax.annotation.Nullable String position) { + this.position = position; + } + + + public ProfilePositionsInner summary(@javax.annotation.Nullable String summary) { + this.summary = summary; + return this; + } + + /** + * A summary of the position. + * @return summary + */ + @javax.annotation.Nullable + public String getSummary() { + return summary; + } + + public void setSummary(@javax.annotation.Nullable String summary) { + this.summary = summary; + } + + + public ProfilePositionsInner startDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * The start date of the position. + * @return startDate + */ + @javax.annotation.Nullable + public OffsetDateTime getStartDate() { + return startDate; + } + + public void setStartDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + } + + + public ProfilePositionsInner endDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * The end date of the position. + * @return endDate + */ + @javax.annotation.Nullable + public OffsetDateTime getEndDate() { + return endDate; + } + + public void setEndDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + } + + + public ProfilePositionsInner isCurrent(@javax.annotation.Nullable String isCurrent) { + this.isCurrent = isCurrent; + return this; + } + + /** + * Indicates if the position is current. + * @return isCurrent + */ + @javax.annotation.Nullable + public String getIsCurrent() { + return isCurrent; + } + + public void setIsCurrent(@javax.annotation.Nullable String isCurrent) { + this.isCurrent = isCurrent; + } + + + public ProfilePositionsInner location(@javax.annotation.Nullable String location) { + this.location = location; + return this; + } + + /** + * The location of the position. + * @return location + */ + @javax.annotation.Nullable + public String getLocation() { + return location; + } + + public void setLocation(@javax.annotation.Nullable String location) { + this.location = location; + } + + + public ProfilePositionsInner company(@javax.annotation.Nullable ProfilePositionsInnerCompany company) { + this.company = company; + return this; + } + + /** + * Get company + * @return company + */ + @javax.annotation.Nullable + public ProfilePositionsInnerCompany getCompany() { + return company; + } + + public void setCompany(@javax.annotation.Nullable ProfilePositionsInnerCompany company) { + this.company = company; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfilePositionsInner instance itself + */ + public ProfilePositionsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfilePositionsInner profilePositionsInner = (ProfilePositionsInner) o; + return Objects.equals(this.position, profilePositionsInner.position) && + Objects.equals(this.summary, profilePositionsInner.summary) && + Objects.equals(this.startDate, profilePositionsInner.startDate) && + Objects.equals(this.endDate, profilePositionsInner.endDate) && + Objects.equals(this.isCurrent, profilePositionsInner.isCurrent) && + Objects.equals(this.location, profilePositionsInner.location) && + Objects.equals(this.company, profilePositionsInner.company)&& + Objects.equals(this.additionalProperties, profilePositionsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(position, summary, startDate, endDate, isCurrent, location, company, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfilePositionsInner {\n"); + sb.append(" position: ").append(toIndentedString(position)).append("\n"); + sb.append(" summary: ").append(toIndentedString(summary)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" isCurrent: ").append(toIndentedString(isCurrent)).append("\n"); + sb.append(" location: ").append(toIndentedString(location)).append("\n"); + sb.append(" company: ").append(toIndentedString(company)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Position"); + openapiFields.add("Summary"); + openapiFields.add("StartDate"); + openapiFields.add("EndDate"); + openapiFields.add("IsCurrent"); + openapiFields.add("Location"); + openapiFields.add("Company"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfilePositionsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfilePositionsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfilePositionsInner is not found in the empty JSON string", ProfilePositionsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Position") != null && !jsonObj.get("Position").isJsonNull()) && !jsonObj.get("Position").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Position` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Position").toString())); + } + if ((jsonObj.get("Summary") != null && !jsonObj.get("Summary").isJsonNull()) && !jsonObj.get("Summary").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Summary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Summary").toString())); + } + if ((jsonObj.get("IsCurrent") != null && !jsonObj.get("IsCurrent").isJsonNull()) && !jsonObj.get("IsCurrent").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IsCurrent` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IsCurrent").toString())); + } + if ((jsonObj.get("Location") != null && !jsonObj.get("Location").isJsonNull()) && !jsonObj.get("Location").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Location` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Location").toString())); + } + // validate the optional field `Company` + if (jsonObj.get("Company") != null && !jsonObj.get("Company").isJsonNull()) { + ProfilePositionsInnerCompany.validateJsonElement(jsonObj.get("Company")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfilePositionsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfilePositionsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfilePositionsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfilePositionsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfilePositionsInner>() { + @Override + public void write(JsonWriter out, ProfilePositionsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfilePositionsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfilePositionsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfilePositionsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfilePositionsInner + * @throws IOException if the JSON string is invalid with respect to ProfilePositionsInner + */ + public static ProfilePositionsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfilePositionsInner.class); + } + + /** + * Convert an instance of ProfilePositionsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfilePositionsInnerCompany.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfilePositionsInnerCompany.java new file mode 100644 index 0000000..fd3f994 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfilePositionsInnerCompany.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfilePositionsInnerCompany + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfilePositionsInnerCompany { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_TYPE = "Type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_INDUSTRY = "Industry"; + @SerializedName(SERIALIZED_NAME_INDUSTRY) + @javax.annotation.Nullable + private String industry; + + public ProfilePositionsInnerCompany() { + } + + public ProfilePositionsInnerCompany name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the company. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfilePositionsInnerCompany type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * The type of the company. + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public ProfilePositionsInnerCompany industry(@javax.annotation.Nullable String industry) { + this.industry = industry; + return this; + } + + /** + * The industry of the company. + * @return industry + */ + @javax.annotation.Nullable + public String getIndustry() { + return industry; + } + + public void setIndustry(@javax.annotation.Nullable String industry) { + this.industry = industry; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfilePositionsInnerCompany instance itself + */ + public ProfilePositionsInnerCompany putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfilePositionsInnerCompany profilePositionsInnerCompany = (ProfilePositionsInnerCompany) o; + return Objects.equals(this.name, profilePositionsInnerCompany.name) && + Objects.equals(this.type, profilePositionsInnerCompany.type) && + Objects.equals(this.industry, profilePositionsInnerCompany.industry)&& + Objects.equals(this.additionalProperties, profilePositionsInnerCompany.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, type, industry, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfilePositionsInnerCompany {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" industry: ").append(toIndentedString(industry)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + openapiFields.add("Type"); + openapiFields.add("Industry"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfilePositionsInnerCompany + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfilePositionsInnerCompany.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfilePositionsInnerCompany is not found in the empty JSON string", ProfilePositionsInnerCompany.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Type") != null && !jsonObj.get("Type").isJsonNull()) && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + if ((jsonObj.get("Industry") != null && !jsonObj.get("Industry").isJsonNull()) && !jsonObj.get("Industry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Industry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Industry").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfilePositionsInnerCompany.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfilePositionsInnerCompany' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfilePositionsInnerCompany> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfilePositionsInnerCompany.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfilePositionsInnerCompany>() { + @Override + public void write(JsonWriter out, ProfilePositionsInnerCompany value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfilePositionsInnerCompany read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfilePositionsInnerCompany instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfilePositionsInnerCompany given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfilePositionsInnerCompany + * @throws IOException if the JSON string is invalid with respect to ProfilePositionsInnerCompany + */ + public static ProfilePositionsInnerCompany fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfilePositionsInnerCompany.class); + } + + /** + * Convert an instance of ProfilePositionsInnerCompany to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfilePrivacyPolicy.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfilePrivacyPolicy.java new file mode 100644 index 0000000..f4f2c99 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfilePrivacyPolicy.java @@ -0,0 +1,345 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfilePrivacyPolicy + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfilePrivacyPolicy { + public static final String SERIALIZED_NAME_VERSION = "Version"; + @SerializedName(SERIALIZED_NAME_VERSION) + @javax.annotation.Nullable + private String version; + + public static final String SERIALIZED_NAME_ACCEPT_SOURCE = "AcceptSource"; + @SerializedName(SERIALIZED_NAME_ACCEPT_SOURCE) + @javax.annotation.Nullable + private String acceptSource; + + public static final String SERIALIZED_NAME_ACCEPT_DATE_TIME = "AcceptDateTime"; + @SerializedName(SERIALIZED_NAME_ACCEPT_DATE_TIME) + @javax.annotation.Nullable + private OffsetDateTime acceptDateTime; + + public ProfilePrivacyPolicy() { + } + + public ProfilePrivacyPolicy version(@javax.annotation.Nullable String version) { + this.version = version; + return this; + } + + /** + * The version of the Privacy Policy. + * @return version + */ + @javax.annotation.Nullable + public String getVersion() { + return version; + } + + public void setVersion(@javax.annotation.Nullable String version) { + this.version = version; + } + + + public ProfilePrivacyPolicy acceptSource(@javax.annotation.Nullable String acceptSource) { + this.acceptSource = acceptSource; + return this; + } + + /** + * The source of the Privacy Policy acceptance. + * @return acceptSource + */ + @javax.annotation.Nullable + public String getAcceptSource() { + return acceptSource; + } + + public void setAcceptSource(@javax.annotation.Nullable String acceptSource) { + this.acceptSource = acceptSource; + } + + + public ProfilePrivacyPolicy acceptDateTime(@javax.annotation.Nullable OffsetDateTime acceptDateTime) { + this.acceptDateTime = acceptDateTime; + return this; + } + + /** + * The date and time of Privacy Policy acceptance. + * @return acceptDateTime + */ + @javax.annotation.Nullable + public OffsetDateTime getAcceptDateTime() { + return acceptDateTime; + } + + public void setAcceptDateTime(@javax.annotation.Nullable OffsetDateTime acceptDateTime) { + this.acceptDateTime = acceptDateTime; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfilePrivacyPolicy instance itself + */ + public ProfilePrivacyPolicy putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfilePrivacyPolicy profilePrivacyPolicy = (ProfilePrivacyPolicy) o; + return Objects.equals(this.version, profilePrivacyPolicy.version) && + Objects.equals(this.acceptSource, profilePrivacyPolicy.acceptSource) && + Objects.equals(this.acceptDateTime, profilePrivacyPolicy.acceptDateTime)&& + Objects.equals(this.additionalProperties, profilePrivacyPolicy.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(version, acceptSource, acceptDateTime, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfilePrivacyPolicy {\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" acceptSource: ").append(toIndentedString(acceptSource)).append("\n"); + sb.append(" acceptDateTime: ").append(toIndentedString(acceptDateTime)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Version"); + openapiFields.add("AcceptSource"); + openapiFields.add("AcceptDateTime"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfilePrivacyPolicy + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfilePrivacyPolicy.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfilePrivacyPolicy is not found in the empty JSON string", ProfilePrivacyPolicy.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Version") != null && !jsonObj.get("Version").isJsonNull()) && !jsonObj.get("Version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Version").toString())); + } + if ((jsonObj.get("AcceptSource") != null && !jsonObj.get("AcceptSource").isJsonNull()) && !jsonObj.get("AcceptSource").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AcceptSource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AcceptSource").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfilePrivacyPolicy.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfilePrivacyPolicy' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfilePrivacyPolicy> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfilePrivacyPolicy.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfilePrivacyPolicy>() { + @Override + public void write(JsonWriter out, ProfilePrivacyPolicy value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfilePrivacyPolicy read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfilePrivacyPolicy instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfilePrivacyPolicy given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfilePrivacyPolicy + * @throws IOException if the JSON string is invalid with respect to ProfilePrivacyPolicy + */ + public static ProfilePrivacyPolicy fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfilePrivacyPolicy.class); + } + + /** + * Convert an instance of ProfilePrivacyPolicy to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileProjectsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileProjectsInner.java new file mode 100644 index 0000000..083b1fb --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileProjectsInner.java @@ -0,0 +1,432 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileProjectsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileProjectsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_SUMMARY = "Summary"; + @SerializedName(SERIALIZED_NAME_SUMMARY) + @javax.annotation.Nullable + private String summary; + + public static final String SERIALIZED_NAME_START_DATE = "StartDate"; + @SerializedName(SERIALIZED_NAME_START_DATE) + @javax.annotation.Nullable + private OffsetDateTime startDate; + + public static final String SERIALIZED_NAME_END_DATE = "EndDate"; + @SerializedName(SERIALIZED_NAME_END_DATE) + @javax.annotation.Nullable + private OffsetDateTime endDate; + + public static final String SERIALIZED_NAME_IS_CURRENT = "IsCurrent"; + @SerializedName(SERIALIZED_NAME_IS_CURRENT) + @javax.annotation.Nullable + private String isCurrent; + + public ProfileProjectsInner() { + } + + public ProfileProjectsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the project. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileProjectsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the project. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileProjectsInner summary(@javax.annotation.Nullable String summary) { + this.summary = summary; + return this; + } + + /** + * A summary of the project. + * @return summary + */ + @javax.annotation.Nullable + public String getSummary() { + return summary; + } + + public void setSummary(@javax.annotation.Nullable String summary) { + this.summary = summary; + } + + + public ProfileProjectsInner startDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * The start date of the project. + * @return startDate + */ + @javax.annotation.Nullable + public OffsetDateTime getStartDate() { + return startDate; + } + + public void setStartDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + } + + + public ProfileProjectsInner endDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * The end date of the project. + * @return endDate + */ + @javax.annotation.Nullable + public OffsetDateTime getEndDate() { + return endDate; + } + + public void setEndDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + } + + + public ProfileProjectsInner isCurrent(@javax.annotation.Nullable String isCurrent) { + this.isCurrent = isCurrent; + return this; + } + + /** + * Indicates if the project is current. + * @return isCurrent + */ + @javax.annotation.Nullable + public String getIsCurrent() { + return isCurrent; + } + + public void setIsCurrent(@javax.annotation.Nullable String isCurrent) { + this.isCurrent = isCurrent; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileProjectsInner instance itself + */ + public ProfileProjectsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileProjectsInner profileProjectsInner = (ProfileProjectsInner) o; + return Objects.equals(this.id, profileProjectsInner.id) && + Objects.equals(this.name, profileProjectsInner.name) && + Objects.equals(this.summary, profileProjectsInner.summary) && + Objects.equals(this.startDate, profileProjectsInner.startDate) && + Objects.equals(this.endDate, profileProjectsInner.endDate) && + Objects.equals(this.isCurrent, profileProjectsInner.isCurrent)&& + Objects.equals(this.additionalProperties, profileProjectsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, summary, startDate, endDate, isCurrent, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileProjectsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" summary: ").append(toIndentedString(summary)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" isCurrent: ").append(toIndentedString(isCurrent)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Summary"); + openapiFields.add("StartDate"); + openapiFields.add("EndDate"); + openapiFields.add("IsCurrent"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileProjectsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileProjectsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileProjectsInner is not found in the empty JSON string", ProfileProjectsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Summary") != null && !jsonObj.get("Summary").isJsonNull()) && !jsonObj.get("Summary").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Summary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Summary").toString())); + } + if ((jsonObj.get("IsCurrent") != null && !jsonObj.get("IsCurrent").isJsonNull()) && !jsonObj.get("IsCurrent").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IsCurrent` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IsCurrent").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileProjectsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileProjectsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileProjectsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileProjectsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileProjectsInner>() { + @Override + public void write(JsonWriter out, ProfileProjectsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileProjectsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileProjectsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileProjectsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileProjectsInner + * @throws IOException if the JSON string is invalid with respect to ProfileProjectsInner + */ + public static ProfileProjectsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileProjectsInner.class); + } + + /** + * Convert an instance of ProfileProjectsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileProviderAccessCredential.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileProviderAccessCredential.java new file mode 100644 index 0000000..a969002 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileProviderAccessCredential.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * Provider access credential details. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileProviderAccessCredential { + public static final String SERIALIZED_NAME_ACCESS_TOKEN = "AccessToken"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN) + @javax.annotation.Nullable + private String accessToken; + + public static final String SERIALIZED_NAME_TOKEN_SECRET = "TokenSecret"; + @SerializedName(SERIALIZED_NAME_TOKEN_SECRET) + @javax.annotation.Nullable + private String tokenSecret; + + public ProfileProviderAccessCredential() { + } + + public ProfileProviderAccessCredential accessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Access Token for the provider. + * @return accessToken + */ + @javax.annotation.Nullable + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + } + + + public ProfileProviderAccessCredential tokenSecret(@javax.annotation.Nullable String tokenSecret) { + this.tokenSecret = tokenSecret; + return this; + } + + /** + * Token secret for the provider. + * @return tokenSecret + */ + @javax.annotation.Nullable + public String getTokenSecret() { + return tokenSecret; + } + + public void setTokenSecret(@javax.annotation.Nullable String tokenSecret) { + this.tokenSecret = tokenSecret; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileProviderAccessCredential instance itself + */ + public ProfileProviderAccessCredential putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileProviderAccessCredential profileProviderAccessCredential = (ProfileProviderAccessCredential) o; + return Objects.equals(this.accessToken, profileProviderAccessCredential.accessToken) && + Objects.equals(this.tokenSecret, profileProviderAccessCredential.tokenSecret)&& + Objects.equals(this.additionalProperties, profileProviderAccessCredential.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accessToken, tokenSecret, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileProviderAccessCredential {\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" tokenSecret: ").append(toIndentedString(tokenSecret)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AccessToken"); + openapiFields.add("TokenSecret"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileProviderAccessCredential + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileProviderAccessCredential.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileProviderAccessCredential is not found in the empty JSON string", ProfileProviderAccessCredential.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("AccessToken") != null && !jsonObj.get("AccessToken").isJsonNull()) && !jsonObj.get("AccessToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccessToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccessToken").toString())); + } + if ((jsonObj.get("TokenSecret") != null && !jsonObj.get("TokenSecret").isJsonNull()) && !jsonObj.get("TokenSecret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TokenSecret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TokenSecret").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileProviderAccessCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileProviderAccessCredential' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileProviderAccessCredential> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileProviderAccessCredential.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileProviderAccessCredential>() { + @Override + public void write(JsonWriter out, ProfileProviderAccessCredential value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileProviderAccessCredential read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileProviderAccessCredential instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileProviderAccessCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileProviderAccessCredential + * @throws IOException if the JSON string is invalid with respect to ProfileProviderAccessCredential + */ + public static ProfileProviderAccessCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileProviderAccessCredential.class); + } + + /** + * Convert an instance of ProfileProviderAccessCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfilePublicationsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfilePublicationsInner.java new file mode 100644 index 0000000..e50db91 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfilePublicationsInner.java @@ -0,0 +1,499 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProfilePublicationsInnerAuthorsInner; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfilePublicationsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfilePublicationsInner { + public static final String SERIALIZED_NAME_TITLE = "Title"; + @SerializedName(SERIALIZED_NAME_TITLE) + @javax.annotation.Nullable + private String title; + + public static final String SERIALIZED_NAME_PUBLISHER = "Publisher"; + @SerializedName(SERIALIZED_NAME_PUBLISHER) + @javax.annotation.Nullable + private String publisher; + + public static final String SERIALIZED_NAME_DATE = "Date"; + @SerializedName(SERIALIZED_NAME_DATE) + @javax.annotation.Nullable + private OffsetDateTime date; + + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_URL = "Url"; + @SerializedName(SERIALIZED_NAME_URL) + @javax.annotation.Nullable + private String url; + + public static final String SERIALIZED_NAME_SUMMARY = "Summary"; + @SerializedName(SERIALIZED_NAME_SUMMARY) + @javax.annotation.Nullable + private String summary; + + public static final String SERIALIZED_NAME_AUTHORS = "Authors"; + @SerializedName(SERIALIZED_NAME_AUTHORS) + @javax.annotation.Nullable + private List<ProfilePublicationsInnerAuthorsInner> authors; + + public ProfilePublicationsInner() { + } + + public ProfilePublicationsInner title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * The title of the publication. + * @return title + */ + @javax.annotation.Nullable + public String getTitle() { + return title; + } + + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + public ProfilePublicationsInner publisher(@javax.annotation.Nullable String publisher) { + this.publisher = publisher; + return this; + } + + /** + * The publisher of the publication. + * @return publisher + */ + @javax.annotation.Nullable + public String getPublisher() { + return publisher; + } + + public void setPublisher(@javax.annotation.Nullable String publisher) { + this.publisher = publisher; + } + + + public ProfilePublicationsInner date(@javax.annotation.Nullable OffsetDateTime date) { + this.date = date; + return this; + } + + /** + * The date the publication was released. + * @return date + */ + @javax.annotation.Nullable + public OffsetDateTime getDate() { + return date; + } + + public void setDate(@javax.annotation.Nullable OffsetDateTime date) { + this.date = date; + } + + + public ProfilePublicationsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the publication. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfilePublicationsInner url(@javax.annotation.Nullable String url) { + this.url = url; + return this; + } + + /** + * The URL of the publication. + * @return url + */ + @javax.annotation.Nullable + public String getUrl() { + return url; + } + + public void setUrl(@javax.annotation.Nullable String url) { + this.url = url; + } + + + public ProfilePublicationsInner summary(@javax.annotation.Nullable String summary) { + this.summary = summary; + return this; + } + + /** + * A summary of the publication. + * @return summary + */ + @javax.annotation.Nullable + public String getSummary() { + return summary; + } + + public void setSummary(@javax.annotation.Nullable String summary) { + this.summary = summary; + } + + + public ProfilePublicationsInner authors(@javax.annotation.Nullable List<ProfilePublicationsInnerAuthorsInner> authors) { + this.authors = authors; + return this; + } + + public ProfilePublicationsInner addAuthorsItem(ProfilePublicationsInnerAuthorsInner authorsItem) { + if (this.authors == null) { + this.authors = new ArrayList<>(); + } + this.authors.add(authorsItem); + return this; + } + + /** + * Get authors + * @return authors + */ + @javax.annotation.Nullable + public List<ProfilePublicationsInnerAuthorsInner> getAuthors() { + return authors; + } + + public void setAuthors(@javax.annotation.Nullable List<ProfilePublicationsInnerAuthorsInner> authors) { + this.authors = authors; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfilePublicationsInner instance itself + */ + public ProfilePublicationsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfilePublicationsInner profilePublicationsInner = (ProfilePublicationsInner) o; + return Objects.equals(this.title, profilePublicationsInner.title) && + Objects.equals(this.publisher, profilePublicationsInner.publisher) && + Objects.equals(this.date, profilePublicationsInner.date) && + Objects.equals(this.id, profilePublicationsInner.id) && + Objects.equals(this.url, profilePublicationsInner.url) && + Objects.equals(this.summary, profilePublicationsInner.summary) && + Objects.equals(this.authors, profilePublicationsInner.authors)&& + Objects.equals(this.additionalProperties, profilePublicationsInner.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(title, publisher, date, id, url, summary, authors, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfilePublicationsInner {\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" publisher: ").append(toIndentedString(publisher)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" summary: ").append(toIndentedString(summary)).append("\n"); + sb.append(" authors: ").append(toIndentedString(authors)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Title"); + openapiFields.add("Publisher"); + openapiFields.add("Date"); + openapiFields.add("Id"); + openapiFields.add("Url"); + openapiFields.add("Summary"); + openapiFields.add("Authors"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfilePublicationsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfilePublicationsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfilePublicationsInner is not found in the empty JSON string", ProfilePublicationsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Title") != null && !jsonObj.get("Title").isJsonNull()) && !jsonObj.get("Title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Title").toString())); + } + if ((jsonObj.get("Publisher") != null && !jsonObj.get("Publisher").isJsonNull()) && !jsonObj.get("Publisher").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Publisher` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Publisher").toString())); + } + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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") != null && !jsonObj.get("Url").isJsonNull()) && !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())); + } + if ((jsonObj.get("Summary") != null && !jsonObj.get("Summary").isJsonNull()) && !jsonObj.get("Summary").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Summary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Summary").toString())); + } + if (jsonObj.get("Authors") != null && !jsonObj.get("Authors").isJsonNull()) { + JsonArray jsonArrayauthors = jsonObj.getAsJsonArray("Authors"); + if (jsonArrayauthors != null) { + // ensure the json data is an array + if (!jsonObj.get("Authors").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Authors` to be an array in the JSON string but got `%s`", jsonObj.get("Authors").toString())); + } + + // validate the optional field `Authors` (array) + for (int i = 0; i < jsonArrayauthors.size(); i++) { + ProfilePublicationsInnerAuthorsInner.validateJsonElement(jsonArrayauthors.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfilePublicationsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfilePublicationsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfilePublicationsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfilePublicationsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfilePublicationsInner>() { + @Override + public void write(JsonWriter out, ProfilePublicationsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfilePublicationsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfilePublicationsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfilePublicationsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfilePublicationsInner + * @throws IOException if the JSON string is invalid with respect to ProfilePublicationsInner + */ + public static ProfilePublicationsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfilePublicationsInner.class); + } + + /** + * Convert an instance of ProfilePublicationsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfilePublicationsInnerAuthorsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfilePublicationsInnerAuthorsInner.java new file mode 100644 index 0000000..5e621fe --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfilePublicationsInnerAuthorsInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfilePublicationsInnerAuthorsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfilePublicationsInnerAuthorsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ProfilePublicationsInnerAuthorsInner() { + } + + public ProfilePublicationsInnerAuthorsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the author. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfilePublicationsInnerAuthorsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the author. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfilePublicationsInnerAuthorsInner instance itself + */ + public ProfilePublicationsInnerAuthorsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfilePublicationsInnerAuthorsInner profilePublicationsInnerAuthorsInner = (ProfilePublicationsInnerAuthorsInner) o; + return Objects.equals(this.id, profilePublicationsInnerAuthorsInner.id) && + Objects.equals(this.name, profilePublicationsInnerAuthorsInner.name)&& + Objects.equals(this.additionalProperties, profilePublicationsInnerAuthorsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfilePublicationsInnerAuthorsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfilePublicationsInnerAuthorsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfilePublicationsInnerAuthorsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfilePublicationsInnerAuthorsInner is not found in the empty JSON string", ProfilePublicationsInnerAuthorsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfilePublicationsInnerAuthorsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfilePublicationsInnerAuthorsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfilePublicationsInnerAuthorsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfilePublicationsInnerAuthorsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfilePublicationsInnerAuthorsInner>() { + @Override + public void write(JsonWriter out, ProfilePublicationsInnerAuthorsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfilePublicationsInnerAuthorsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfilePublicationsInnerAuthorsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfilePublicationsInnerAuthorsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfilePublicationsInnerAuthorsInner + * @throws IOException if the JSON string is invalid with respect to ProfilePublicationsInnerAuthorsInner + */ + public static ProfilePublicationsInnerAuthorsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfilePublicationsInnerAuthorsInner.class); + } + + /** + * Convert an instance of ProfilePublicationsInnerAuthorsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRecommendationsReceivedInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRecommendationsReceivedInner.java new file mode 100644 index 0000000..b219794 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRecommendationsReceivedInner.java @@ -0,0 +1,377 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRecommendationsReceivedInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRecommendationsReceivedInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_RECOMMENDATION_TYPE = "RecommendationType"; + @SerializedName(SERIALIZED_NAME_RECOMMENDATION_TYPE) + @javax.annotation.Nullable + private String recommendationType; + + public static final String SERIALIZED_NAME_RECOMMENDATION_TEXT = "RecommendationText"; + @SerializedName(SERIALIZED_NAME_RECOMMENDATION_TEXT) + @javax.annotation.Nullable + private String recommendationText; + + public static final String SERIALIZED_NAME_RECOMMENDER = "Recommender"; + @SerializedName(SERIALIZED_NAME_RECOMMENDER) + @javax.annotation.Nullable + private String recommender; + + public ProfileRecommendationsReceivedInner() { + } + + public ProfileRecommendationsReceivedInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the recommendation. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileRecommendationsReceivedInner recommendationType(@javax.annotation.Nullable String recommendationType) { + this.recommendationType = recommendationType; + return this; + } + + /** + * The type of recommendation. + * @return recommendationType + */ + @javax.annotation.Nullable + public String getRecommendationType() { + return recommendationType; + } + + public void setRecommendationType(@javax.annotation.Nullable String recommendationType) { + this.recommendationType = recommendationType; + } + + + public ProfileRecommendationsReceivedInner recommendationText(@javax.annotation.Nullable String recommendationText) { + this.recommendationText = recommendationText; + return this; + } + + /** + * The text of the recommendation. + * @return recommendationText + */ + @javax.annotation.Nullable + public String getRecommendationText() { + return recommendationText; + } + + public void setRecommendationText(@javax.annotation.Nullable String recommendationText) { + this.recommendationText = recommendationText; + } + + + public ProfileRecommendationsReceivedInner recommender(@javax.annotation.Nullable String recommender) { + this.recommender = recommender; + return this; + } + + /** + * The name of the recommender. + * @return recommender + */ + @javax.annotation.Nullable + public String getRecommender() { + return recommender; + } + + public void setRecommender(@javax.annotation.Nullable String recommender) { + this.recommender = recommender; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRecommendationsReceivedInner instance itself + */ + public ProfileRecommendationsReceivedInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRecommendationsReceivedInner profileRecommendationsReceivedInner = (ProfileRecommendationsReceivedInner) o; + return Objects.equals(this.id, profileRecommendationsReceivedInner.id) && + Objects.equals(this.recommendationType, profileRecommendationsReceivedInner.recommendationType) && + Objects.equals(this.recommendationText, profileRecommendationsReceivedInner.recommendationText) && + Objects.equals(this.recommender, profileRecommendationsReceivedInner.recommender)&& + Objects.equals(this.additionalProperties, profileRecommendationsReceivedInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, recommendationType, recommendationText, recommender, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRecommendationsReceivedInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" recommendationType: ").append(toIndentedString(recommendationType)).append("\n"); + sb.append(" recommendationText: ").append(toIndentedString(recommendationText)).append("\n"); + sb.append(" recommender: ").append(toIndentedString(recommender)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("RecommendationType"); + openapiFields.add("RecommendationText"); + openapiFields.add("Recommender"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRecommendationsReceivedInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRecommendationsReceivedInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRecommendationsReceivedInner is not found in the empty JSON string", ProfileRecommendationsReceivedInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("RecommendationType") != null && !jsonObj.get("RecommendationType").isJsonNull()) && !jsonObj.get("RecommendationType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RecommendationType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RecommendationType").toString())); + } + if ((jsonObj.get("RecommendationText") != null && !jsonObj.get("RecommendationText").isJsonNull()) && !jsonObj.get("RecommendationText").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RecommendationText` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RecommendationText").toString())); + } + if ((jsonObj.get("Recommender") != null && !jsonObj.get("Recommender").isJsonNull()) && !jsonObj.get("Recommender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Recommender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Recommender").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRecommendationsReceivedInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRecommendationsReceivedInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRecommendationsReceivedInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRecommendationsReceivedInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRecommendationsReceivedInner>() { + @Override + public void write(JsonWriter out, ProfileRecommendationsReceivedInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRecommendationsReceivedInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRecommendationsReceivedInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRecommendationsReceivedInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRecommendationsReceivedInner + * @throws IOException if the JSON string is invalid with respect to ProfileRecommendationsReceivedInner + */ + public static ProfileRecommendationsReceivedInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRecommendationsReceivedInner.class); + } + + /** + * Convert an instance of ProfileRecommendationsReceivedInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRegistrationData.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRegistrationData.java new file mode 100644 index 0000000..dad4d05 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRegistrationData.java @@ -0,0 +1,321 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProfileRegistrationDataDataInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Registration data details. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRegistrationData { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<ProfileRegistrationDataDataInner> data; + + public ProfileRegistrationData() { + } + + public ProfileRegistrationData data(@javax.annotation.Nullable List<ProfileRegistrationDataDataInner> data) { + this.data = data; + return this; + } + + public ProfileRegistrationData addDataItem(ProfileRegistrationDataDataInner dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<ProfileRegistrationDataDataInner> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<ProfileRegistrationDataDataInner> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRegistrationData instance itself + */ + public ProfileRegistrationData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRegistrationData profileRegistrationData = (ProfileRegistrationData) o; + return Objects.equals(this.data, profileRegistrationData.data)&& + Objects.equals(this.additionalProperties, profileRegistrationData.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRegistrationData {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRegistrationData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRegistrationData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRegistrationData is not found in the empty JSON string", ProfileRegistrationData.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + ProfileRegistrationDataDataInner.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRegistrationData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRegistrationData' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRegistrationData> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRegistrationData.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRegistrationData>() { + @Override + public void write(JsonWriter out, ProfileRegistrationData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRegistrationData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRegistrationData instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRegistrationData given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRegistrationData + * @throws IOException if the JSON string is invalid with respect to ProfileRegistrationData + */ + public static ProfileRegistrationData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRegistrationData.class); + } + + /** + * Convert an instance of ProfileRegistrationData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRegistrationDataDataInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRegistrationDataDataInner.java new file mode 100644 index 0000000..8963c89 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRegistrationDataDataInner.java @@ -0,0 +1,319 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProfileRegistrationDataDataInnerValue; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRegistrationDataDataInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRegistrationDataDataInner { + public static final String SERIALIZED_NAME_DATA_SOURCE = "DataSource"; + @SerializedName(SERIALIZED_NAME_DATA_SOURCE) + @javax.annotation.Nullable + private String dataSource; + + public static final String SERIALIZED_NAME_VALUE = "Value"; + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nullable + private ProfileRegistrationDataDataInnerValue value; + + public ProfileRegistrationDataDataInner() { + } + + public ProfileRegistrationDataDataInner dataSource(@javax.annotation.Nullable String dataSource) { + this.dataSource = dataSource; + return this; + } + + /** + * The source of the registration data. + * @return dataSource + */ + @javax.annotation.Nullable + public String getDataSource() { + return dataSource; + } + + public void setDataSource(@javax.annotation.Nullable String dataSource) { + this.dataSource = dataSource; + } + + + public ProfileRegistrationDataDataInner value(@javax.annotation.Nullable ProfileRegistrationDataDataInnerValue value) { + this.value = value; + return this; + } + + /** + * Get value + * @return value + */ + @javax.annotation.Nullable + public ProfileRegistrationDataDataInnerValue getValue() { + return value; + } + + public void setValue(@javax.annotation.Nullable ProfileRegistrationDataDataInnerValue value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRegistrationDataDataInner instance itself + */ + public ProfileRegistrationDataDataInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRegistrationDataDataInner profileRegistrationDataDataInner = (ProfileRegistrationDataDataInner) o; + return Objects.equals(this.dataSource, profileRegistrationDataDataInner.dataSource) && + Objects.equals(this.value, profileRegistrationDataDataInner.value)&& + Objects.equals(this.additionalProperties, profileRegistrationDataDataInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(dataSource, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRegistrationDataDataInner {\n"); + sb.append(" dataSource: ").append(toIndentedString(dataSource)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("DataSource"); + openapiFields.add("Value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRegistrationDataDataInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRegistrationDataDataInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRegistrationDataDataInner is not found in the empty JSON string", ProfileRegistrationDataDataInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("DataSource") != null && !jsonObj.get("DataSource").isJsonNull()) && !jsonObj.get("DataSource").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DataSource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DataSource").toString())); + } + // validate the optional field `Value` + if (jsonObj.get("Value") != null && !jsonObj.get("Value").isJsonNull()) { + ProfileRegistrationDataDataInnerValue.validateJsonElement(jsonObj.get("Value")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRegistrationDataDataInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRegistrationDataDataInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRegistrationDataDataInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRegistrationDataDataInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRegistrationDataDataInner>() { + @Override + public void write(JsonWriter out, ProfileRegistrationDataDataInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRegistrationDataDataInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRegistrationDataDataInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRegistrationDataDataInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRegistrationDataDataInner + * @throws IOException if the JSON string is invalid with respect to ProfileRegistrationDataDataInner + */ + public static ProfileRegistrationDataDataInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRegistrationDataDataInner.class); + } + + /** + * Convert an instance of ProfileRegistrationDataDataInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRegistrationDataDataInnerValue.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRegistrationDataDataInnerValue.java new file mode 100644 index 0000000..52819f9 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRegistrationDataDataInnerValue.java @@ -0,0 +1,287 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRegistrationDataDataInnerValue + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRegistrationDataDataInnerValue { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public ProfileRegistrationDataDataInnerValue() { + } + + public ProfileRegistrationDataDataInnerValue id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the registration data value. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRegistrationDataDataInnerValue instance itself + */ + public ProfileRegistrationDataDataInnerValue putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRegistrationDataDataInnerValue profileRegistrationDataDataInnerValue = (ProfileRegistrationDataDataInnerValue) o; + return Objects.equals(this.id, profileRegistrationDataDataInnerValue.id)&& + Objects.equals(this.additionalProperties, profileRegistrationDataDataInnerValue.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRegistrationDataDataInnerValue {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRegistrationDataDataInnerValue + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRegistrationDataDataInnerValue.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRegistrationDataDataInnerValue is not found in the empty JSON string", ProfileRegistrationDataDataInnerValue.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRegistrationDataDataInnerValue.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRegistrationDataDataInnerValue' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRegistrationDataDataInnerValue> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRegistrationDataDataInnerValue.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRegistrationDataDataInnerValue>() { + @Override + public void write(JsonWriter out, ProfileRegistrationDataDataInnerValue value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRegistrationDataDataInnerValue read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRegistrationDataDataInnerValue instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRegistrationDataDataInnerValue given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRegistrationDataDataInnerValue + * @throws IOException if the JSON string is invalid with respect to ProfileRegistrationDataDataInnerValue + */ + public static ProfileRegistrationDataDataInnerValue fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRegistrationDataDataInnerValue.class); + } + + /** + * Convert an instance of ProfileRegistrationDataDataInnerValue to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRelatedProfileViewsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRelatedProfileViewsInner.java new file mode 100644 index 0000000..6cd6887 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRelatedProfileViewsInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRelatedProfileViewsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRelatedProfileViewsInner { + public static final String SERIALIZED_NAME_FIRST_NAME = "FirstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nullable + private String firstName; + + public static final String SERIALIZED_NAME_LAST_NAME = "LastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nullable + private String lastName; + + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public ProfileRelatedProfileViewsInner() { + } + + public ProfileRelatedProfileViewsInner firstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * The first name of the related profile. + * @return firstName + */ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + } + + + public ProfileRelatedProfileViewsInner lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * The last name of the related profile. + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + + public ProfileRelatedProfileViewsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the related profile. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRelatedProfileViewsInner instance itself + */ + public ProfileRelatedProfileViewsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRelatedProfileViewsInner profileRelatedProfileViewsInner = (ProfileRelatedProfileViewsInner) o; + return Objects.equals(this.firstName, profileRelatedProfileViewsInner.firstName) && + Objects.equals(this.lastName, profileRelatedProfileViewsInner.lastName) && + Objects.equals(this.id, profileRelatedProfileViewsInner.id)&& + Objects.equals(this.additionalProperties, profileRelatedProfileViewsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(firstName, lastName, id, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRelatedProfileViewsInner {\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("FirstName"); + openapiFields.add("LastName"); + openapiFields.add("Id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRelatedProfileViewsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRelatedProfileViewsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRelatedProfileViewsInner is not found in the empty JSON string", ProfileRelatedProfileViewsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("FirstName") != null && !jsonObj.get("FirstName").isJsonNull()) && !jsonObj.get("FirstName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FirstName").toString())); + } + if ((jsonObj.get("LastName") != null && !jsonObj.get("LastName").isJsonNull()) && !jsonObj.get("LastName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastName").toString())); + } + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRelatedProfileViewsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRelatedProfileViewsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRelatedProfileViewsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRelatedProfileViewsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRelatedProfileViewsInner>() { + @Override + public void write(JsonWriter out, ProfileRelatedProfileViewsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRelatedProfileViewsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRelatedProfileViewsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRelatedProfileViewsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRelatedProfileViewsInner + * @throws IOException if the JSON string is invalid with respect to ProfileRelatedProfileViewsInner + */ + public static ProfileRelatedProfileViewsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRelatedProfileViewsInner.class); + } + + /** + * Convert an instance of ProfileRelatedProfileViewsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestEmailOnly.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestEmailOnly.java new file mode 100644 index 0000000..041d19a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestEmailOnly.java @@ -0,0 +1,4073 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProfileRequestModelAddressesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelAwardsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelBadgesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelBooksInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelCertificationsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelConsents; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelCountry; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelCoursesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelCurrentStatusInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelEducationsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelEmailInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelExternalIdsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelFamilyInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelFavoriteThingsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelGamesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelIMAccountsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelInspirationalPeopleInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelInterestsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelJobBookmarksInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelLanguagesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelMemberUrlResourcesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelMoviesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelMutualFriendsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPINInfo; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPatentsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPhoneNumbersInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPlacesLivedInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPositionsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPrivacyPolicy; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelProjectsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPublicationsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelRecommendationsReceivedInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelRelatedProfileViewsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSkillsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSportsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSubscription; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSuggestions; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelTeleVisionShowInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelVolunteerInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestEmailOnly + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestEmailOnly { + public static final String SERIALIZED_NAME_GENDER = "Gender"; + @SerializedName(SERIALIZED_NAME_GENDER) + @javax.annotation.Nullable + private String gender; + + public static final String SERIALIZED_NAME_BIRTH_DATE = "BirthDate"; + @SerializedName(SERIALIZED_NAME_BIRTH_DATE) + @javax.annotation.Nullable + private String birthDate; + + public static final String SERIALIZED_NAME_PREFIX = "Prefix"; + @SerializedName(SERIALIZED_NAME_PREFIX) + @javax.annotation.Nullable + private String prefix; + + public static final String SERIALIZED_NAME_FIRST_NAME = "FirstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nullable + private String firstName; + + public static final String SERIALIZED_NAME_MIDDLE_NAME = "MiddleName"; + @SerializedName(SERIALIZED_NAME_MIDDLE_NAME) + @javax.annotation.Nullable + private String middleName; + + public static final String SERIALIZED_NAME_LAST_NAME = "LastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nullable + private String lastName; + + public static final String SERIALIZED_NAME_SUFFIX = "Suffix"; + @SerializedName(SERIALIZED_NAME_SUFFIX) + @javax.annotation.Nullable + private String suffix; + + public static final String SERIALIZED_NAME_NICK_NAME = "NickName"; + @SerializedName(SERIALIZED_NAME_NICK_NAME) + @javax.annotation.Nullable + private String nickName; + + public static final String SERIALIZED_NAME_PROFILE_NAME = "ProfileName"; + @SerializedName(SERIALIZED_NAME_PROFILE_NAME) + @javax.annotation.Nullable + private String profileName; + + public static final String SERIALIZED_NAME_ABOUT = "About"; + @SerializedName(SERIALIZED_NAME_ABOUT) + @javax.annotation.Nullable + private String about; + + public static final String SERIALIZED_NAME_COMPANY = "Company"; + @SerializedName(SERIALIZED_NAME_COMPANY) + @javax.annotation.Nullable + private String company; + + public static final String SERIALIZED_NAME_IMAGE_URL = "ImageUrl"; + @SerializedName(SERIALIZED_NAME_IMAGE_URL) + @javax.annotation.Nullable + private String imageUrl; + + public static final String SERIALIZED_NAME_TIME_ZONE = "TimeZone"; + @SerializedName(SERIALIZED_NAME_TIME_ZONE) + @javax.annotation.Nullable + private String timeZone; + + public static final String SERIALIZED_NAME_WEBSITE = "Website"; + @SerializedName(SERIALIZED_NAME_WEBSITE) + @javax.annotation.Nullable + private String website; + + public static final String SERIALIZED_NAME_THUMBNAIL_IMAGE_URL = "ThumbnailImageUrl"; + @SerializedName(SERIALIZED_NAME_THUMBNAIL_IMAGE_URL) + @javax.annotation.Nullable + private String thumbnailImageUrl; + + public static final String SERIALIZED_NAME_FAVICON = "Favicon"; + @SerializedName(SERIALIZED_NAME_FAVICON) + @javax.annotation.Nullable + private String favicon; + + public static final String SERIALIZED_NAME_PROFILE_URL = "ProfileUrl"; + @SerializedName(SERIALIZED_NAME_PROFILE_URL) + @javax.annotation.Nullable + private String profileUrl; + + public static final String SERIALIZED_NAME_HOME_TOWN = "HomeTown"; + @SerializedName(SERIALIZED_NAME_HOME_TOWN) + @javax.annotation.Nullable + private String homeTown; + + public static final String SERIALIZED_NAME_STATE = "State"; + @SerializedName(SERIALIZED_NAME_STATE) + @javax.annotation.Nullable + private String state; + + public static final String SERIALIZED_NAME_CITY = "City"; + @SerializedName(SERIALIZED_NAME_CITY) + @javax.annotation.Nullable + private String city; + + public static final String SERIALIZED_NAME_INDUSTRY = "Industry"; + @SerializedName(SERIALIZED_NAME_INDUSTRY) + @javax.annotation.Nullable + private String industry; + + public static final String SERIALIZED_NAME_LOCAL_LANGUAGE = "LocalLanguage"; + @SerializedName(SERIALIZED_NAME_LOCAL_LANGUAGE) + @javax.annotation.Nullable + private String localLanguage; + + public static final String SERIALIZED_NAME_LANGUAGE = "Language"; + @SerializedName(SERIALIZED_NAME_LANGUAGE) + @javax.annotation.Nullable + private String language; + + public static final String SERIALIZED_NAME_COVER_PHOTO = "CoverPhoto"; + @SerializedName(SERIALIZED_NAME_COVER_PHOTO) + @javax.annotation.Nullable + private String coverPhoto; + + public static final String SERIALIZED_NAME_TAG_LINE = "TagLine"; + @SerializedName(SERIALIZED_NAME_TAG_LINE) + @javax.annotation.Nullable + private String tagLine; + + public static final String SERIALIZED_NAME_MAIN_ADDRESS = "MainAddress"; + @SerializedName(SERIALIZED_NAME_MAIN_ADDRESS) + @javax.annotation.Nullable + private String mainAddress; + + public static final String SERIALIZED_NAME_LOCAL_CITY = "LocalCity"; + @SerializedName(SERIALIZED_NAME_LOCAL_CITY) + @javax.annotation.Nullable + private String localCity; + + public static final String SERIALIZED_NAME_PROFILE_CITY = "ProfileCity"; + @SerializedName(SERIALIZED_NAME_PROFILE_CITY) + @javax.annotation.Nullable + private String profileCity; + + public static final String SERIALIZED_NAME_LOCAL_COUNTRY = "LocalCountry"; + @SerializedName(SERIALIZED_NAME_LOCAL_COUNTRY) + @javax.annotation.Nullable + private String localCountry; + + public static final String SERIALIZED_NAME_PROFILE_COUNTRY = "ProfileCountry"; + @SerializedName(SERIALIZED_NAME_PROFILE_COUNTRY) + @javax.annotation.Nullable + private String profileCountry; + + public static final String SERIALIZED_NAME_QUOTA = "Quota"; + @SerializedName(SERIALIZED_NAME_QUOTA) + @javax.annotation.Nullable + private String quota; + + public static final String SERIALIZED_NAME_RELIGION = "Religion"; + @SerializedName(SERIALIZED_NAME_RELIGION) + @javax.annotation.Nullable + private String religion; + + public static final String SERIALIZED_NAME_POLITICAL = "Political"; + @SerializedName(SERIALIZED_NAME_POLITICAL) + @javax.annotation.Nullable + private String political; + + public static final String SERIALIZED_NAME_RELATIONSHIP_STATUS = "RelationshipStatus"; + @SerializedName(SERIALIZED_NAME_RELATIONSHIP_STATUS) + @javax.annotation.Nullable + private String relationshipStatus; + + public static final String SERIALIZED_NAME_HTTPS_IMAGE_URL = "HttpsImageUrl"; + @SerializedName(SERIALIZED_NAME_HTTPS_IMAGE_URL) + @javax.annotation.Nullable + private String httpsImageUrl; + + public static final String SERIALIZED_NAME_IS_GEO_ENABLED = "IsGeoEnabled"; + @SerializedName(SERIALIZED_NAME_IS_GEO_ENABLED) + @javax.annotation.Nullable + private String isGeoEnabled; + + public static final String SERIALIZED_NAME_ASSOCIATIONS = "Associations"; + @SerializedName(SERIALIZED_NAME_ASSOCIATIONS) + @javax.annotation.Nullable + private String associations; + + public static final String SERIALIZED_NAME_HONORS = "Honors"; + @SerializedName(SERIALIZED_NAME_HONORS) + @javax.annotation.Nullable + private String honors; + + public static final String SERIALIZED_NAME_PUBLIC_REPOSITORY = "PublicRepository"; + @SerializedName(SERIALIZED_NAME_PUBLIC_REPOSITORY) + @javax.annotation.Nullable + private String publicRepository; + + public static final String SERIALIZED_NAME_REPOSITORY_URL = "RepositoryUrl"; + @SerializedName(SERIALIZED_NAME_REPOSITORY_URL) + @javax.annotation.Nullable + private String repositoryUrl; + + public static final String SERIALIZED_NAME_PROFESSIONAL_HEADLINE = "ProfessionalHeadline"; + @SerializedName(SERIALIZED_NAME_PROFESSIONAL_HEADLINE) + @javax.annotation.Nullable + private String professionalHeadline; + + public static final String SERIALIZED_NAME_CURRENCY = "Currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + @javax.annotation.Nullable + private String currency; + + public static final String SERIALIZED_NAME_STARRED_URL = "StarredUrl"; + @SerializedName(SERIALIZED_NAME_STARRED_URL) + @javax.annotation.Nullable + private String starredUrl; + + public static final String SERIALIZED_NAME_GISTS_URL = "GistsUrl"; + @SerializedName(SERIALIZED_NAME_GISTS_URL) + @javax.annotation.Nullable + private String gistsUrl; + + public static final String SERIALIZED_NAME_GRAVATAR_IMAGE_URL = "GravatarImageUrl"; + @SerializedName(SERIALIZED_NAME_GRAVATAR_IMAGE_URL) + @javax.annotation.Nullable + private String gravatarImageUrl; + + public static final String SERIALIZED_NAME_EXTERNAL_USER_LOGIN_ID = "ExternalUserLoginId"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_USER_LOGIN_ID) + @javax.annotation.Nullable + private String externalUserLoginId; + + public static final String SERIALIZED_NAME_INTERESTED_IN = "InterestedIn"; + @SerializedName(SERIALIZED_NAME_INTERESTED_IN) + @javax.annotation.Nullable + private List<String> interestedIn = new ArrayList<>(); + + public static final String SERIALIZED_NAME_FOLLOWERS_COUNT = "FollowersCount"; + @SerializedName(SERIALIZED_NAME_FOLLOWERS_COUNT) + @javax.annotation.Nullable + private Integer followersCount; + + public static final String SERIALIZED_NAME_FRIENDS_COUNT = "FriendsCount"; + @SerializedName(SERIALIZED_NAME_FRIENDS_COUNT) + @javax.annotation.Nullable + private Integer friendsCount; + + public static final String SERIALIZED_NAME_TOTAL_STATUSES_COUNT = "TotalStatusesCount"; + @SerializedName(SERIALIZED_NAME_TOTAL_STATUSES_COUNT) + @javax.annotation.Nullable + private Integer totalStatusesCount; + + public static final String SERIALIZED_NAME_NUM_RECOMMENDERS = "NumRecommenders"; + @SerializedName(SERIALIZED_NAME_NUM_RECOMMENDERS) + @javax.annotation.Nullable + private Integer numRecommenders; + + public static final String SERIALIZED_NAME_TOTAL_PRIVATE_REPOSITORY = "TotalPrivateRepository"; + @SerializedName(SERIALIZED_NAME_TOTAL_PRIVATE_REPOSITORY) + @javax.annotation.Nullable + private Integer totalPrivateRepository; + + public static final String SERIALIZED_NAME_PUBLIC_GISTS = "PublicGists"; + @SerializedName(SERIALIZED_NAME_PUBLIC_GISTS) + @javax.annotation.Nullable + private Integer publicGists; + + public static final String SERIALIZED_NAME_PRIVATE_GISTS = "PrivateGists"; + @SerializedName(SERIALIZED_NAME_PRIVATE_GISTS) + @javax.annotation.Nullable + private Integer privateGists; + + public static final String SERIALIZED_NAME_SESSION_LIMIT = "SessionLimit"; + @SerializedName(SERIALIZED_NAME_SESSION_LIMIT) + @javax.annotation.Nullable + private Integer sessionLimit; + + public static final String SERIALIZED_NAME_CUSTOM_FIELDS = "CustomFields"; + @SerializedName(SERIALIZED_NAME_CUSTOM_FIELDS) + @javax.annotation.Nullable + private Map<String, String> customFields = new HashMap<>(); + + public static final String SERIALIZED_NAME_PROFILE_IMAGE_URLS = "ProfileImageUrls"; + @SerializedName(SERIALIZED_NAME_PROFILE_IMAGE_URLS) + @javax.annotation.Nullable + private Map<String, String> profileImageUrls = new HashMap<>(); + + public static final String SERIALIZED_NAME_WEB_PROFILES = "WebProfiles"; + @SerializedName(SERIALIZED_NAME_WEB_PROFILES) + @javax.annotation.Nullable + private Map<String, String> webProfiles = new HashMap<>(); + + public static final String SERIALIZED_NAME_SECURITY_QUESTION_ANSWER = "SecurityQuestionAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_QUESTION_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityQuestionAnswer = new HashMap<>(); + + public static final String SERIALIZED_NAME_COUNTRY = "Country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + @javax.annotation.Nullable + private ProfileRequestModelCountry country; + + public static final String SERIALIZED_NAME_SUGGESTIONS = "Suggestions"; + @SerializedName(SERIALIZED_NAME_SUGGESTIONS) + @javax.annotation.Nullable + private ProfileRequestModelSuggestions suggestions; + + public static final String SERIALIZED_NAME_SUBSCRIPTION = "Subscription"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION) + @javax.annotation.Nullable + private ProfileRequestModelSubscription subscription; + + public static final String SERIALIZED_NAME_PRIVACY_POLICY = "PrivacyPolicy"; + @SerializedName(SERIALIZED_NAME_PRIVACY_POLICY) + @javax.annotation.Nullable + private ProfileRequestModelPrivacyPolicy privacyPolicy; + + public static final String SERIALIZED_NAME_PI_N_INFO = "PINInfo"; + @SerializedName(SERIALIZED_NAME_PI_N_INFO) + @javax.annotation.Nullable + private ProfileRequestModelPINInfo piNInfo; + + public static final String SERIALIZED_NAME_ADDRESSES = "Addresses"; + @SerializedName(SERIALIZED_NAME_ADDRESSES) + @javax.annotation.Nullable + private List<ProfileRequestModelAddressesInner> addresses = new ArrayList<>(); + + public static final String SERIALIZED_NAME_POSITIONS = "Positions"; + @SerializedName(SERIALIZED_NAME_POSITIONS) + @javax.annotation.Nullable + private List<ProfileRequestModelPositionsInner> positions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_EDUCATIONS = "Educations"; + @SerializedName(SERIALIZED_NAME_EDUCATIONS) + @javax.annotation.Nullable + private List<ProfileRequestModelEducationsInner> educations = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PHONE_NUMBERS = "PhoneNumbers"; + @SerializedName(SERIALIZED_NAME_PHONE_NUMBERS) + @javax.annotation.Nullable + private List<ProfileRequestModelPhoneNumbersInner> phoneNumbers = new ArrayList<>(); + + public static final String SERIALIZED_NAME_IM_ACCOUNTS = "IMAccounts"; + @SerializedName(SERIALIZED_NAME_IM_ACCOUNTS) + @javax.annotation.Nullable + private List<ProfileRequestModelIMAccountsInner> imAccounts = new ArrayList<>(); + + public static final String SERIALIZED_NAME_INTERESTS = "Interests"; + @SerializedName(SERIALIZED_NAME_INTERESTS) + @javax.annotation.Nullable + private List<ProfileRequestModelInterestsInner> interests = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SPORTS = "Sports"; + @SerializedName(SERIALIZED_NAME_SPORTS) + @javax.annotation.Nullable + private List<ProfileRequestModelSportsInner> sports = new ArrayList<>(); + + public static final String SERIALIZED_NAME_INSPIRATIONAL_PEOPLE = "InspirationalPeople"; + @SerializedName(SERIALIZED_NAME_INSPIRATIONAL_PEOPLE) + @javax.annotation.Nullable + private List<ProfileRequestModelInspirationalPeopleInner> inspirationalPeople = new ArrayList<>(); + + public static final String SERIALIZED_NAME_AWARDS = "Awards"; + @SerializedName(SERIALIZED_NAME_AWARDS) + @javax.annotation.Nullable + private List<ProfileRequestModelAwardsInner> awards = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SKILLS = "Skills"; + @SerializedName(SERIALIZED_NAME_SKILLS) + @javax.annotation.Nullable + private List<ProfileRequestModelSkillsInner> skills = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CURRENT_STATUS = "CurrentStatus"; + @SerializedName(SERIALIZED_NAME_CURRENT_STATUS) + @javax.annotation.Nullable + private List<ProfileRequestModelCurrentStatusInner> currentStatus = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CERTIFICATIONS = "Certifications"; + @SerializedName(SERIALIZED_NAME_CERTIFICATIONS) + @javax.annotation.Nullable + private List<ProfileRequestModelCertificationsInner> certifications = new ArrayList<>(); + + public static final String SERIALIZED_NAME_COURSES = "Courses"; + @SerializedName(SERIALIZED_NAME_COURSES) + @javax.annotation.Nullable + private List<ProfileRequestModelCoursesInner> courses = new ArrayList<>(); + + public static final String SERIALIZED_NAME_VOLUNTEER = "Volunteer"; + @SerializedName(SERIALIZED_NAME_VOLUNTEER) + @javax.annotation.Nullable + private List<ProfileRequestModelVolunteerInner> volunteer = new ArrayList<>(); + + public static final String SERIALIZED_NAME_RECOMMENDATIONS_RECEIVED = "RecommendationsReceived"; + @SerializedName(SERIALIZED_NAME_RECOMMENDATIONS_RECEIVED) + @javax.annotation.Nullable + private List<ProfileRequestModelRecommendationsReceivedInner> recommendationsReceived = new ArrayList<>(); + + public static final String SERIALIZED_NAME_LANGUAGES = "Languages"; + @SerializedName(SERIALIZED_NAME_LANGUAGES) + @javax.annotation.Nullable + private List<ProfileRequestModelLanguagesInner> languages = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PROJECTS = "Projects"; + @SerializedName(SERIALIZED_NAME_PROJECTS) + @javax.annotation.Nullable + private List<ProfileRequestModelProjectsInner> projects = new ArrayList<>(); + + public static final String SERIALIZED_NAME_GAMES = "Games"; + @SerializedName(SERIALIZED_NAME_GAMES) + @javax.annotation.Nullable + private List<ProfileRequestModelGamesInner> games = new ArrayList<>(); + + public static final String SERIALIZED_NAME_FAMILY = "Family"; + @SerializedName(SERIALIZED_NAME_FAMILY) + @javax.annotation.Nullable + private List<ProfileRequestModelFamilyInner> family = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TELE_VISION_SHOW = "TeleVisionShow"; + @SerializedName(SERIALIZED_NAME_TELE_VISION_SHOW) + @javax.annotation.Nullable + private List<ProfileRequestModelTeleVisionShowInner> teleVisionShow = new ArrayList<>(); + + public static final String SERIALIZED_NAME_MUTUAL_FRIENDS = "MutualFriends"; + @SerializedName(SERIALIZED_NAME_MUTUAL_FRIENDS) + @javax.annotation.Nullable + private List<ProfileRequestModelMutualFriendsInner> mutualFriends = new ArrayList<>(); + + public static final String SERIALIZED_NAME_MOVIES = "Movies"; + @SerializedName(SERIALIZED_NAME_MOVIES) + @javax.annotation.Nullable + private List<ProfileRequestModelMoviesInner> movies = new ArrayList<>(); + + public static final String SERIALIZED_NAME_BOOKS = "Books"; + @SerializedName(SERIALIZED_NAME_BOOKS) + @javax.annotation.Nullable + private List<ProfileRequestModelBooksInner> books = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PATENTS = "Patents"; + @SerializedName(SERIALIZED_NAME_PATENTS) + @javax.annotation.Nullable + private List<ProfileRequestModelPatentsInner> patents = new ArrayList<>(); + + public static final String SERIALIZED_NAME_FAVORITE_THINGS = "FavoriteThings"; + @SerializedName(SERIALIZED_NAME_FAVORITE_THINGS) + @javax.annotation.Nullable + private List<ProfileRequestModelFavoriteThingsInner> favoriteThings = new ArrayList<>(); + + public static final String SERIALIZED_NAME_RELATED_PROFILE_VIEWS = "RelatedProfileViews"; + @SerializedName(SERIALIZED_NAME_RELATED_PROFILE_VIEWS) + @javax.annotation.Nullable + private List<ProfileRequestModelRelatedProfileViewsInner> relatedProfileViews = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PLACES_LIVED = "PlacesLived"; + @SerializedName(SERIALIZED_NAME_PLACES_LIVED) + @javax.annotation.Nullable + private List<ProfileRequestModelPlacesLivedInner> placesLived = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PUBLICATIONS = "Publications"; + @SerializedName(SERIALIZED_NAME_PUBLICATIONS) + @javax.annotation.Nullable + private List<ProfileRequestModelPublicationsInner> publications = new ArrayList<>(); + + public static final String SERIALIZED_NAME_JOB_BOOKMARKS = "JobBookmarks"; + @SerializedName(SERIALIZED_NAME_JOB_BOOKMARKS) + @javax.annotation.Nullable + private List<ProfileRequestModelJobBookmarksInner> jobBookmarks = new ArrayList<>(); + + public static final String SERIALIZED_NAME_BADGES = "Badges"; + @SerializedName(SERIALIZED_NAME_BADGES) + @javax.annotation.Nullable + private List<ProfileRequestModelBadgesInner> badges = new ArrayList<>(); + + public static final String SERIALIZED_NAME_MEMBER_URL_RESOURCES = "MemberUrlResources"; + @SerializedName(SERIALIZED_NAME_MEMBER_URL_RESOURCES) + @javax.annotation.Nullable + private List<ProfileRequestModelMemberUrlResourcesInner> memberUrlResources = new ArrayList<>(); + + public static final String SERIALIZED_NAME_EXTERNAL_IDS = "ExternalIds"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_IDS) + @javax.annotation.Nullable + private List<ProfileRequestModelExternalIdsInner> externalIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_IS_EMAIL_SUBSCRIBED = "IsEmailSubscribed"; + @SerializedName(SERIALIZED_NAME_IS_EMAIL_SUBSCRIBED) + @javax.annotation.Nullable + private Boolean isEmailSubscribed; + + public static final String SERIALIZED_NAME_IS_PROTECTED = "IsProtected"; + @SerializedName(SERIALIZED_NAME_IS_PROTECTED) + @javax.annotation.Nullable + private Boolean isProtected; + + public static final String SERIALIZED_NAME_HIREABLE = "Hireable"; + @SerializedName(SERIALIZED_NAME_HIREABLE) + @javax.annotation.Nullable + private Boolean hireable; + + public static final String SERIALIZED_NAME_DISABLE_LOGIN = "DisableLogin"; + @SerializedName(SERIALIZED_NAME_DISABLE_LOGIN) + @javax.annotation.Nullable + private Boolean disableLogin; + + public static final String SERIALIZED_NAME_ACCEPT_PRIVACY_POLICY = "AcceptPrivacyPolicy"; + @SerializedName(SERIALIZED_NAME_ACCEPT_PRIVACY_POLICY) + @javax.annotation.Nullable + private Boolean acceptPrivacyPolicy; + + public static final String SERIALIZED_NAME_REGISTRATION_SOURCE = "RegistrationSource"; + @SerializedName(SERIALIZED_NAME_REGISTRATION_SOURCE) + @javax.annotation.Nullable + private String registrationSource; + + 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_CONSENTS = "Consents"; + @SerializedName(SERIALIZED_NAME_CONSENTS) + @javax.annotation.Nullable + private ProfileRequestModelConsents consents; + + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private List<ProfileRequestModelEmailInner> email = new ArrayList<>(); + + public ProfileRequestEmailOnly() { + } + + public ProfileRequestEmailOnly gender(@javax.annotation.Nullable String gender) { + this.gender = gender; + return this; + } + + /** + * Get gender + * @return gender + */ + @javax.annotation.Nullable + public String getGender() { + return gender; + } + + public void setGender(@javax.annotation.Nullable String gender) { + this.gender = gender; + } + + + public ProfileRequestEmailOnly birthDate(@javax.annotation.Nullable String birthDate) { + this.birthDate = birthDate; + return this; + } + + /** + * Get birthDate + * @return birthDate + */ + @javax.annotation.Nullable + public String getBirthDate() { + return birthDate; + } + + public void setBirthDate(@javax.annotation.Nullable String birthDate) { + this.birthDate = birthDate; + } + + + public ProfileRequestEmailOnly prefix(@javax.annotation.Nullable String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Get prefix + * @return prefix + */ + @javax.annotation.Nullable + public String getPrefix() { + return prefix; + } + + public void setPrefix(@javax.annotation.Nullable String prefix) { + this.prefix = prefix; + } + + + public ProfileRequestEmailOnly firstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + */ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + } + + + public ProfileRequestEmailOnly middleName(@javax.annotation.Nullable String middleName) { + this.middleName = middleName; + return this; + } + + /** + * Get middleName + * @return middleName + */ + @javax.annotation.Nullable + public String getMiddleName() { + return middleName; + } + + public void setMiddleName(@javax.annotation.Nullable String middleName) { + this.middleName = middleName; + } + + + public ProfileRequestEmailOnly lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + + public ProfileRequestEmailOnly suffix(@javax.annotation.Nullable String suffix) { + this.suffix = suffix; + return this; + } + + /** + * Get suffix + * @return suffix + */ + @javax.annotation.Nullable + public String getSuffix() { + return suffix; + } + + public void setSuffix(@javax.annotation.Nullable String suffix) { + this.suffix = suffix; + } + + + public ProfileRequestEmailOnly nickName(@javax.annotation.Nullable String nickName) { + this.nickName = nickName; + return this; + } + + /** + * Get nickName + * @return nickName + */ + @javax.annotation.Nullable + public String getNickName() { + return nickName; + } + + public void setNickName(@javax.annotation.Nullable String nickName) { + this.nickName = nickName; + } + + + public ProfileRequestEmailOnly profileName(@javax.annotation.Nullable String profileName) { + this.profileName = profileName; + return this; + } + + /** + * Get profileName + * @return profileName + */ + @javax.annotation.Nullable + public String getProfileName() { + return profileName; + } + + public void setProfileName(@javax.annotation.Nullable String profileName) { + this.profileName = profileName; + } + + + public ProfileRequestEmailOnly about(@javax.annotation.Nullable String about) { + this.about = about; + return this; + } + + /** + * Get about + * @return about + */ + @javax.annotation.Nullable + public String getAbout() { + return about; + } + + public void setAbout(@javax.annotation.Nullable String about) { + this.about = about; + } + + + public ProfileRequestEmailOnly company(@javax.annotation.Nullable String company) { + this.company = company; + return this; + } + + /** + * Get company + * @return company + */ + @javax.annotation.Nullable + public String getCompany() { + return company; + } + + public void setCompany(@javax.annotation.Nullable String company) { + this.company = company; + } + + + public ProfileRequestEmailOnly imageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** + * Get imageUrl + * @return imageUrl + */ + @javax.annotation.Nullable + public String getImageUrl() { + return imageUrl; + } + + public void setImageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + } + + + public ProfileRequestEmailOnly timeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * Get timeZone + * @return timeZone + */ + @javax.annotation.Nullable + public String getTimeZone() { + return timeZone; + } + + public void setTimeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + } + + + public ProfileRequestEmailOnly website(@javax.annotation.Nullable String website) { + this.website = website; + return this; + } + + /** + * Get website + * @return website + */ + @javax.annotation.Nullable + public String getWebsite() { + return website; + } + + public void setWebsite(@javax.annotation.Nullable String website) { + this.website = website; + } + + + public ProfileRequestEmailOnly thumbnailImageUrl(@javax.annotation.Nullable String thumbnailImageUrl) { + this.thumbnailImageUrl = thumbnailImageUrl; + return this; + } + + /** + * Get thumbnailImageUrl + * @return thumbnailImageUrl + */ + @javax.annotation.Nullable + public String getThumbnailImageUrl() { + return thumbnailImageUrl; + } + + public void setThumbnailImageUrl(@javax.annotation.Nullable String thumbnailImageUrl) { + this.thumbnailImageUrl = thumbnailImageUrl; + } + + + public ProfileRequestEmailOnly favicon(@javax.annotation.Nullable String favicon) { + this.favicon = favicon; + return this; + } + + /** + * Get favicon + * @return favicon + */ + @javax.annotation.Nullable + public String getFavicon() { + return favicon; + } + + public void setFavicon(@javax.annotation.Nullable String favicon) { + this.favicon = favicon; + } + + + public ProfileRequestEmailOnly profileUrl(@javax.annotation.Nullable String profileUrl) { + this.profileUrl = profileUrl; + return this; + } + + /** + * Get profileUrl + * @return profileUrl + */ + @javax.annotation.Nullable + public String getProfileUrl() { + return profileUrl; + } + + public void setProfileUrl(@javax.annotation.Nullable String profileUrl) { + this.profileUrl = profileUrl; + } + + + public ProfileRequestEmailOnly homeTown(@javax.annotation.Nullable String homeTown) { + this.homeTown = homeTown; + return this; + } + + /** + * Get homeTown + * @return homeTown + */ + @javax.annotation.Nullable + public String getHomeTown() { + return homeTown; + } + + public void setHomeTown(@javax.annotation.Nullable String homeTown) { + this.homeTown = homeTown; + } + + + public ProfileRequestEmailOnly state(@javax.annotation.Nullable String state) { + this.state = state; + return this; + } + + /** + * Get state + * @return state + */ + @javax.annotation.Nullable + public String getState() { + return state; + } + + public void setState(@javax.annotation.Nullable String state) { + this.state = state; + } + + + public ProfileRequestEmailOnly city(@javax.annotation.Nullable String city) { + this.city = city; + return this; + } + + /** + * Get city + * @return city + */ + @javax.annotation.Nullable + public String getCity() { + return city; + } + + public void setCity(@javax.annotation.Nullable String city) { + this.city = city; + } + + + public ProfileRequestEmailOnly industry(@javax.annotation.Nullable String industry) { + this.industry = industry; + return this; + } + + /** + * Get industry + * @return industry + */ + @javax.annotation.Nullable + public String getIndustry() { + return industry; + } + + public void setIndustry(@javax.annotation.Nullable String industry) { + this.industry = industry; + } + + + public ProfileRequestEmailOnly localLanguage(@javax.annotation.Nullable String localLanguage) { + this.localLanguage = localLanguage; + return this; + } + + /** + * Get localLanguage + * @return localLanguage + */ + @javax.annotation.Nullable + public String getLocalLanguage() { + return localLanguage; + } + + public void setLocalLanguage(@javax.annotation.Nullable String localLanguage) { + this.localLanguage = localLanguage; + } + + + public ProfileRequestEmailOnly language(@javax.annotation.Nullable String language) { + this.language = language; + return this; + } + + /** + * Get language + * @return language + */ + @javax.annotation.Nullable + public String getLanguage() { + return language; + } + + public void setLanguage(@javax.annotation.Nullable String language) { + this.language = language; + } + + + public ProfileRequestEmailOnly coverPhoto(@javax.annotation.Nullable String coverPhoto) { + this.coverPhoto = coverPhoto; + return this; + } + + /** + * Get coverPhoto + * @return coverPhoto + */ + @javax.annotation.Nullable + public String getCoverPhoto() { + return coverPhoto; + } + + public void setCoverPhoto(@javax.annotation.Nullable String coverPhoto) { + this.coverPhoto = coverPhoto; + } + + + public ProfileRequestEmailOnly tagLine(@javax.annotation.Nullable String tagLine) { + this.tagLine = tagLine; + return this; + } + + /** + * Get tagLine + * @return tagLine + */ + @javax.annotation.Nullable + public String getTagLine() { + return tagLine; + } + + public void setTagLine(@javax.annotation.Nullable String tagLine) { + this.tagLine = tagLine; + } + + + public ProfileRequestEmailOnly mainAddress(@javax.annotation.Nullable String mainAddress) { + this.mainAddress = mainAddress; + return this; + } + + /** + * Get mainAddress + * @return mainAddress + */ + @javax.annotation.Nullable + public String getMainAddress() { + return mainAddress; + } + + public void setMainAddress(@javax.annotation.Nullable String mainAddress) { + this.mainAddress = mainAddress; + } + + + public ProfileRequestEmailOnly localCity(@javax.annotation.Nullable String localCity) { + this.localCity = localCity; + return this; + } + + /** + * Get localCity + * @return localCity + */ + @javax.annotation.Nullable + public String getLocalCity() { + return localCity; + } + + public void setLocalCity(@javax.annotation.Nullable String localCity) { + this.localCity = localCity; + } + + + public ProfileRequestEmailOnly profileCity(@javax.annotation.Nullable String profileCity) { + this.profileCity = profileCity; + return this; + } + + /** + * Get profileCity + * @return profileCity + */ + @javax.annotation.Nullable + public String getProfileCity() { + return profileCity; + } + + public void setProfileCity(@javax.annotation.Nullable String profileCity) { + this.profileCity = profileCity; + } + + + public ProfileRequestEmailOnly localCountry(@javax.annotation.Nullable String localCountry) { + this.localCountry = localCountry; + return this; + } + + /** + * Get localCountry + * @return localCountry + */ + @javax.annotation.Nullable + public String getLocalCountry() { + return localCountry; + } + + public void setLocalCountry(@javax.annotation.Nullable String localCountry) { + this.localCountry = localCountry; + } + + + public ProfileRequestEmailOnly profileCountry(@javax.annotation.Nullable String profileCountry) { + this.profileCountry = profileCountry; + return this; + } + + /** + * Get profileCountry + * @return profileCountry + */ + @javax.annotation.Nullable + public String getProfileCountry() { + return profileCountry; + } + + public void setProfileCountry(@javax.annotation.Nullable String profileCountry) { + this.profileCountry = profileCountry; + } + + + public ProfileRequestEmailOnly quota(@javax.annotation.Nullable String quota) { + this.quota = quota; + return this; + } + + /** + * Get quota + * @return quota + */ + @javax.annotation.Nullable + public String getQuota() { + return quota; + } + + public void setQuota(@javax.annotation.Nullable String quota) { + this.quota = quota; + } + + + public ProfileRequestEmailOnly religion(@javax.annotation.Nullable String religion) { + this.religion = religion; + return this; + } + + /** + * Get religion + * @return religion + */ + @javax.annotation.Nullable + public String getReligion() { + return religion; + } + + public void setReligion(@javax.annotation.Nullable String religion) { + this.religion = religion; + } + + + public ProfileRequestEmailOnly political(@javax.annotation.Nullable String political) { + this.political = political; + return this; + } + + /** + * Get political + * @return political + */ + @javax.annotation.Nullable + public String getPolitical() { + return political; + } + + public void setPolitical(@javax.annotation.Nullable String political) { + this.political = political; + } + + + public ProfileRequestEmailOnly relationshipStatus(@javax.annotation.Nullable String relationshipStatus) { + this.relationshipStatus = relationshipStatus; + return this; + } + + /** + * Get relationshipStatus + * @return relationshipStatus + */ + @javax.annotation.Nullable + public String getRelationshipStatus() { + return relationshipStatus; + } + + public void setRelationshipStatus(@javax.annotation.Nullable String relationshipStatus) { + this.relationshipStatus = relationshipStatus; + } + + + public ProfileRequestEmailOnly httpsImageUrl(@javax.annotation.Nullable String httpsImageUrl) { + this.httpsImageUrl = httpsImageUrl; + return this; + } + + /** + * Get httpsImageUrl + * @return httpsImageUrl + */ + @javax.annotation.Nullable + public String getHttpsImageUrl() { + return httpsImageUrl; + } + + public void setHttpsImageUrl(@javax.annotation.Nullable String httpsImageUrl) { + this.httpsImageUrl = httpsImageUrl; + } + + + public ProfileRequestEmailOnly isGeoEnabled(@javax.annotation.Nullable String isGeoEnabled) { + this.isGeoEnabled = isGeoEnabled; + return this; + } + + /** + * Get isGeoEnabled + * @return isGeoEnabled + */ + @javax.annotation.Nullable + public String getIsGeoEnabled() { + return isGeoEnabled; + } + + public void setIsGeoEnabled(@javax.annotation.Nullable String isGeoEnabled) { + this.isGeoEnabled = isGeoEnabled; + } + + + public ProfileRequestEmailOnly associations(@javax.annotation.Nullable String associations) { + this.associations = associations; + return this; + } + + /** + * Get associations + * @return associations + */ + @javax.annotation.Nullable + public String getAssociations() { + return associations; + } + + public void setAssociations(@javax.annotation.Nullable String associations) { + this.associations = associations; + } + + + public ProfileRequestEmailOnly honors(@javax.annotation.Nullable String honors) { + this.honors = honors; + return this; + } + + /** + * Get honors + * @return honors + */ + @javax.annotation.Nullable + public String getHonors() { + return honors; + } + + public void setHonors(@javax.annotation.Nullable String honors) { + this.honors = honors; + } + + + public ProfileRequestEmailOnly publicRepository(@javax.annotation.Nullable String publicRepository) { + this.publicRepository = publicRepository; + return this; + } + + /** + * Get publicRepository + * @return publicRepository + */ + @javax.annotation.Nullable + public String getPublicRepository() { + return publicRepository; + } + + public void setPublicRepository(@javax.annotation.Nullable String publicRepository) { + this.publicRepository = publicRepository; + } + + + public ProfileRequestEmailOnly repositoryUrl(@javax.annotation.Nullable String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + return this; + } + + /** + * Get repositoryUrl + * @return repositoryUrl + */ + @javax.annotation.Nullable + public String getRepositoryUrl() { + return repositoryUrl; + } + + public void setRepositoryUrl(@javax.annotation.Nullable String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + } + + + public ProfileRequestEmailOnly professionalHeadline(@javax.annotation.Nullable String professionalHeadline) { + this.professionalHeadline = professionalHeadline; + return this; + } + + /** + * Get professionalHeadline + * @return professionalHeadline + */ + @javax.annotation.Nullable + public String getProfessionalHeadline() { + return professionalHeadline; + } + + public void setProfessionalHeadline(@javax.annotation.Nullable String professionalHeadline) { + this.professionalHeadline = professionalHeadline; + } + + + public ProfileRequestEmailOnly currency(@javax.annotation.Nullable String currency) { + this.currency = currency; + return this; + } + + /** + * Get currency + * @return currency + */ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + public void setCurrency(@javax.annotation.Nullable String currency) { + this.currency = currency; + } + + + public ProfileRequestEmailOnly starredUrl(@javax.annotation.Nullable String starredUrl) { + this.starredUrl = starredUrl; + return this; + } + + /** + * Get starredUrl + * @return starredUrl + */ + @javax.annotation.Nullable + public String getStarredUrl() { + return starredUrl; + } + + public void setStarredUrl(@javax.annotation.Nullable String starredUrl) { + this.starredUrl = starredUrl; + } + + + public ProfileRequestEmailOnly gistsUrl(@javax.annotation.Nullable String gistsUrl) { + this.gistsUrl = gistsUrl; + return this; + } + + /** + * Get gistsUrl + * @return gistsUrl + */ + @javax.annotation.Nullable + public String getGistsUrl() { + return gistsUrl; + } + + public void setGistsUrl(@javax.annotation.Nullable String gistsUrl) { + this.gistsUrl = gistsUrl; + } + + + public ProfileRequestEmailOnly gravatarImageUrl(@javax.annotation.Nullable String gravatarImageUrl) { + this.gravatarImageUrl = gravatarImageUrl; + return this; + } + + /** + * Get gravatarImageUrl + * @return gravatarImageUrl + */ + @javax.annotation.Nullable + public String getGravatarImageUrl() { + return gravatarImageUrl; + } + + public void setGravatarImageUrl(@javax.annotation.Nullable String gravatarImageUrl) { + this.gravatarImageUrl = gravatarImageUrl; + } + + + public ProfileRequestEmailOnly externalUserLoginId(@javax.annotation.Nullable String externalUserLoginId) { + this.externalUserLoginId = externalUserLoginId; + return this; + } + + /** + * Get externalUserLoginId + * @return externalUserLoginId + */ + @javax.annotation.Nullable + public String getExternalUserLoginId() { + return externalUserLoginId; + } + + public void setExternalUserLoginId(@javax.annotation.Nullable String externalUserLoginId) { + this.externalUserLoginId = externalUserLoginId; + } + + + public ProfileRequestEmailOnly interestedIn(@javax.annotation.Nullable List<String> interestedIn) { + this.interestedIn = interestedIn; + return this; + } + + public ProfileRequestEmailOnly addInterestedInItem(String interestedInItem) { + if (this.interestedIn == null) { + this.interestedIn = new ArrayList<>(); + } + this.interestedIn.add(interestedInItem); + return this; + } + + /** + * Get interestedIn + * @return interestedIn + */ + @javax.annotation.Nullable + public List<String> getInterestedIn() { + return interestedIn; + } + + public void setInterestedIn(@javax.annotation.Nullable List<String> interestedIn) { + this.interestedIn = interestedIn; + } + + + public ProfileRequestEmailOnly followersCount(@javax.annotation.Nullable Integer followersCount) { + this.followersCount = followersCount; + return this; + } + + /** + * Get followersCount + * @return followersCount + */ + @javax.annotation.Nullable + public Integer getFollowersCount() { + return followersCount; + } + + public void setFollowersCount(@javax.annotation.Nullable Integer followersCount) { + this.followersCount = followersCount; + } + + + public ProfileRequestEmailOnly friendsCount(@javax.annotation.Nullable Integer friendsCount) { + this.friendsCount = friendsCount; + return this; + } + + /** + * Get friendsCount + * @return friendsCount + */ + @javax.annotation.Nullable + public Integer getFriendsCount() { + return friendsCount; + } + + public void setFriendsCount(@javax.annotation.Nullable Integer friendsCount) { + this.friendsCount = friendsCount; + } + + + public ProfileRequestEmailOnly totalStatusesCount(@javax.annotation.Nullable Integer totalStatusesCount) { + this.totalStatusesCount = totalStatusesCount; + return this; + } + + /** + * Get totalStatusesCount + * @return totalStatusesCount + */ + @javax.annotation.Nullable + public Integer getTotalStatusesCount() { + return totalStatusesCount; + } + + public void setTotalStatusesCount(@javax.annotation.Nullable Integer totalStatusesCount) { + this.totalStatusesCount = totalStatusesCount; + } + + + public ProfileRequestEmailOnly numRecommenders(@javax.annotation.Nullable Integer numRecommenders) { + this.numRecommenders = numRecommenders; + return this; + } + + /** + * Get numRecommenders + * @return numRecommenders + */ + @javax.annotation.Nullable + public Integer getNumRecommenders() { + return numRecommenders; + } + + public void setNumRecommenders(@javax.annotation.Nullable Integer numRecommenders) { + this.numRecommenders = numRecommenders; + } + + + public ProfileRequestEmailOnly totalPrivateRepository(@javax.annotation.Nullable Integer totalPrivateRepository) { + this.totalPrivateRepository = totalPrivateRepository; + return this; + } + + /** + * Get totalPrivateRepository + * @return totalPrivateRepository + */ + @javax.annotation.Nullable + public Integer getTotalPrivateRepository() { + return totalPrivateRepository; + } + + public void setTotalPrivateRepository(@javax.annotation.Nullable Integer totalPrivateRepository) { + this.totalPrivateRepository = totalPrivateRepository; + } + + + public ProfileRequestEmailOnly publicGists(@javax.annotation.Nullable Integer publicGists) { + this.publicGists = publicGists; + return this; + } + + /** + * Get publicGists + * @return publicGists + */ + @javax.annotation.Nullable + public Integer getPublicGists() { + return publicGists; + } + + public void setPublicGists(@javax.annotation.Nullable Integer publicGists) { + this.publicGists = publicGists; + } + + + public ProfileRequestEmailOnly privateGists(@javax.annotation.Nullable Integer privateGists) { + this.privateGists = privateGists; + return this; + } + + /** + * Get privateGists + * @return privateGists + */ + @javax.annotation.Nullable + public Integer getPrivateGists() { + return privateGists; + } + + public void setPrivateGists(@javax.annotation.Nullable Integer privateGists) { + this.privateGists = privateGists; + } + + + public ProfileRequestEmailOnly sessionLimit(@javax.annotation.Nullable Integer sessionLimit) { + this.sessionLimit = sessionLimit; + return this; + } + + /** + * Get sessionLimit + * @return sessionLimit + */ + @javax.annotation.Nullable + public Integer getSessionLimit() { + return sessionLimit; + } + + public void setSessionLimit(@javax.annotation.Nullable Integer sessionLimit) { + this.sessionLimit = sessionLimit; + } + + + public ProfileRequestEmailOnly customFields(@javax.annotation.Nullable Map<String, String> customFields) { + this.customFields = customFields; + return this; + } + + public ProfileRequestEmailOnly putCustomFieldsItem(String key, String customFieldsItem) { + if (this.customFields == null) { + this.customFields = new HashMap<>(); + } + this.customFields.put(key, customFieldsItem); + return this; + } + + /** + * Get customFields + * @return customFields + */ + @javax.annotation.Nullable + public Map<String, String> getCustomFields() { + return customFields; + } + + public void setCustomFields(@javax.annotation.Nullable Map<String, String> customFields) { + this.customFields = customFields; + } + + + public ProfileRequestEmailOnly profileImageUrls(@javax.annotation.Nullable Map<String, String> profileImageUrls) { + this.profileImageUrls = profileImageUrls; + return this; + } + + public ProfileRequestEmailOnly putProfileImageUrlsItem(String key, String profileImageUrlsItem) { + if (this.profileImageUrls == null) { + this.profileImageUrls = new HashMap<>(); + } + this.profileImageUrls.put(key, profileImageUrlsItem); + return this; + } + + /** + * Get profileImageUrls + * @return profileImageUrls + */ + @javax.annotation.Nullable + public Map<String, String> getProfileImageUrls() { + return profileImageUrls; + } + + public void setProfileImageUrls(@javax.annotation.Nullable Map<String, String> profileImageUrls) { + this.profileImageUrls = profileImageUrls; + } + + + public ProfileRequestEmailOnly webProfiles(@javax.annotation.Nullable Map<String, String> webProfiles) { + this.webProfiles = webProfiles; + return this; + } + + public ProfileRequestEmailOnly putWebProfilesItem(String key, String webProfilesItem) { + if (this.webProfiles == null) { + this.webProfiles = new HashMap<>(); + } + this.webProfiles.put(key, webProfilesItem); + return this; + } + + /** + * Get webProfiles + * @return webProfiles + */ + @javax.annotation.Nullable + public Map<String, String> getWebProfiles() { + return webProfiles; + } + + public void setWebProfiles(@javax.annotation.Nullable Map<String, String> webProfiles) { + this.webProfiles = webProfiles; + } + + + public ProfileRequestEmailOnly securityQuestionAnswer(@javax.annotation.Nullable Map<String, String> securityQuestionAnswer) { + this.securityQuestionAnswer = securityQuestionAnswer; + return this; + } + + public ProfileRequestEmailOnly putSecurityQuestionAnswerItem(String key, String securityQuestionAnswerItem) { + if (this.securityQuestionAnswer == null) { + this.securityQuestionAnswer = new HashMap<>(); + } + this.securityQuestionAnswer.put(key, securityQuestionAnswerItem); + return this; + } + + /** + * Get securityQuestionAnswer + * @return securityQuestionAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityQuestionAnswer() { + return securityQuestionAnswer; + } + + public void setSecurityQuestionAnswer(@javax.annotation.Nullable Map<String, String> securityQuestionAnswer) { + this.securityQuestionAnswer = securityQuestionAnswer; + } + + + public ProfileRequestEmailOnly country(@javax.annotation.Nullable ProfileRequestModelCountry country) { + this.country = country; + return this; + } + + /** + * Get country + * @return country + */ + @javax.annotation.Nullable + public ProfileRequestModelCountry getCountry() { + return country; + } + + public void setCountry(@javax.annotation.Nullable ProfileRequestModelCountry country) { + this.country = country; + } + + + public ProfileRequestEmailOnly suggestions(@javax.annotation.Nullable ProfileRequestModelSuggestions suggestions) { + this.suggestions = suggestions; + return this; + } + + /** + * Get suggestions + * @return suggestions + */ + @javax.annotation.Nullable + public ProfileRequestModelSuggestions getSuggestions() { + return suggestions; + } + + public void setSuggestions(@javax.annotation.Nullable ProfileRequestModelSuggestions suggestions) { + this.suggestions = suggestions; + } + + + public ProfileRequestEmailOnly subscription(@javax.annotation.Nullable ProfileRequestModelSubscription subscription) { + this.subscription = subscription; + return this; + } + + /** + * Get subscription + * @return subscription + */ + @javax.annotation.Nullable + public ProfileRequestModelSubscription getSubscription() { + return subscription; + } + + public void setSubscription(@javax.annotation.Nullable ProfileRequestModelSubscription subscription) { + this.subscription = subscription; + } + + + public ProfileRequestEmailOnly privacyPolicy(@javax.annotation.Nullable ProfileRequestModelPrivacyPolicy privacyPolicy) { + this.privacyPolicy = privacyPolicy; + return this; + } + + /** + * Get privacyPolicy + * @return privacyPolicy + */ + @javax.annotation.Nullable + public ProfileRequestModelPrivacyPolicy getPrivacyPolicy() { + return privacyPolicy; + } + + public void setPrivacyPolicy(@javax.annotation.Nullable ProfileRequestModelPrivacyPolicy privacyPolicy) { + this.privacyPolicy = privacyPolicy; + } + + + public ProfileRequestEmailOnly piNInfo(@javax.annotation.Nullable ProfileRequestModelPINInfo piNInfo) { + this.piNInfo = piNInfo; + return this; + } + + /** + * Get piNInfo + * @return piNInfo + */ + @javax.annotation.Nullable + public ProfileRequestModelPINInfo getPiNInfo() { + return piNInfo; + } + + public void setPiNInfo(@javax.annotation.Nullable ProfileRequestModelPINInfo piNInfo) { + this.piNInfo = piNInfo; + } + + + public ProfileRequestEmailOnly addresses(@javax.annotation.Nullable List<ProfileRequestModelAddressesInner> addresses) { + this.addresses = addresses; + return this; + } + + public ProfileRequestEmailOnly addAddressesItem(ProfileRequestModelAddressesInner addressesItem) { + if (this.addresses == null) { + this.addresses = new ArrayList<>(); + } + this.addresses.add(addressesItem); + return this; + } + + /** + * Get addresses + * @return addresses + */ + @javax.annotation.Nullable + public List<ProfileRequestModelAddressesInner> getAddresses() { + return addresses; + } + + public void setAddresses(@javax.annotation.Nullable List<ProfileRequestModelAddressesInner> addresses) { + this.addresses = addresses; + } + + + public ProfileRequestEmailOnly positions(@javax.annotation.Nullable List<ProfileRequestModelPositionsInner> positions) { + this.positions = positions; + return this; + } + + public ProfileRequestEmailOnly addPositionsItem(ProfileRequestModelPositionsInner positionsItem) { + if (this.positions == null) { + this.positions = new ArrayList<>(); + } + this.positions.add(positionsItem); + return this; + } + + /** + * Get positions + * @return positions + */ + @javax.annotation.Nullable + public List<ProfileRequestModelPositionsInner> getPositions() { + return positions; + } + + public void setPositions(@javax.annotation.Nullable List<ProfileRequestModelPositionsInner> positions) { + this.positions = positions; + } + + + public ProfileRequestEmailOnly educations(@javax.annotation.Nullable List<ProfileRequestModelEducationsInner> educations) { + this.educations = educations; + return this; + } + + public ProfileRequestEmailOnly addEducationsItem(ProfileRequestModelEducationsInner educationsItem) { + if (this.educations == null) { + this.educations = new ArrayList<>(); + } + this.educations.add(educationsItem); + return this; + } + + /** + * Get educations + * @return educations + */ + @javax.annotation.Nullable + public List<ProfileRequestModelEducationsInner> getEducations() { + return educations; + } + + public void setEducations(@javax.annotation.Nullable List<ProfileRequestModelEducationsInner> educations) { + this.educations = educations; + } + + + public ProfileRequestEmailOnly phoneNumbers(@javax.annotation.Nullable List<ProfileRequestModelPhoneNumbersInner> phoneNumbers) { + this.phoneNumbers = phoneNumbers; + return this; + } + + public ProfileRequestEmailOnly addPhoneNumbersItem(ProfileRequestModelPhoneNumbersInner phoneNumbersItem) { + if (this.phoneNumbers == null) { + this.phoneNumbers = new ArrayList<>(); + } + this.phoneNumbers.add(phoneNumbersItem); + return this; + } + + /** + * Get phoneNumbers + * @return phoneNumbers + */ + @javax.annotation.Nullable + public List<ProfileRequestModelPhoneNumbersInner> getPhoneNumbers() { + return phoneNumbers; + } + + public void setPhoneNumbers(@javax.annotation.Nullable List<ProfileRequestModelPhoneNumbersInner> phoneNumbers) { + this.phoneNumbers = phoneNumbers; + } + + + public ProfileRequestEmailOnly imAccounts(@javax.annotation.Nullable List<ProfileRequestModelIMAccountsInner> imAccounts) { + this.imAccounts = imAccounts; + return this; + } + + public ProfileRequestEmailOnly addImAccountsItem(ProfileRequestModelIMAccountsInner imAccountsItem) { + if (this.imAccounts == null) { + this.imAccounts = new ArrayList<>(); + } + this.imAccounts.add(imAccountsItem); + return this; + } + + /** + * Get imAccounts + * @return imAccounts + */ + @javax.annotation.Nullable + public List<ProfileRequestModelIMAccountsInner> getImAccounts() { + return imAccounts; + } + + public void setImAccounts(@javax.annotation.Nullable List<ProfileRequestModelIMAccountsInner> imAccounts) { + this.imAccounts = imAccounts; + } + + + public ProfileRequestEmailOnly interests(@javax.annotation.Nullable List<ProfileRequestModelInterestsInner> interests) { + this.interests = interests; + return this; + } + + public ProfileRequestEmailOnly addInterestsItem(ProfileRequestModelInterestsInner interestsItem) { + if (this.interests == null) { + this.interests = new ArrayList<>(); + } + this.interests.add(interestsItem); + return this; + } + + /** + * Get interests + * @return interests + */ + @javax.annotation.Nullable + public List<ProfileRequestModelInterestsInner> getInterests() { + return interests; + } + + public void setInterests(@javax.annotation.Nullable List<ProfileRequestModelInterestsInner> interests) { + this.interests = interests; + } + + + public ProfileRequestEmailOnly sports(@javax.annotation.Nullable List<ProfileRequestModelSportsInner> sports) { + this.sports = sports; + return this; + } + + public ProfileRequestEmailOnly addSportsItem(ProfileRequestModelSportsInner sportsItem) { + if (this.sports == null) { + this.sports = new ArrayList<>(); + } + this.sports.add(sportsItem); + return this; + } + + /** + * Get sports + * @return sports + */ + @javax.annotation.Nullable + public List<ProfileRequestModelSportsInner> getSports() { + return sports; + } + + public void setSports(@javax.annotation.Nullable List<ProfileRequestModelSportsInner> sports) { + this.sports = sports; + } + + + public ProfileRequestEmailOnly inspirationalPeople(@javax.annotation.Nullable List<ProfileRequestModelInspirationalPeopleInner> inspirationalPeople) { + this.inspirationalPeople = inspirationalPeople; + return this; + } + + public ProfileRequestEmailOnly addInspirationalPeopleItem(ProfileRequestModelInspirationalPeopleInner inspirationalPeopleItem) { + if (this.inspirationalPeople == null) { + this.inspirationalPeople = new ArrayList<>(); + } + this.inspirationalPeople.add(inspirationalPeopleItem); + return this; + } + + /** + * Get inspirationalPeople + * @return inspirationalPeople + */ + @javax.annotation.Nullable + public List<ProfileRequestModelInspirationalPeopleInner> getInspirationalPeople() { + return inspirationalPeople; + } + + public void setInspirationalPeople(@javax.annotation.Nullable List<ProfileRequestModelInspirationalPeopleInner> inspirationalPeople) { + this.inspirationalPeople = inspirationalPeople; + } + + + public ProfileRequestEmailOnly awards(@javax.annotation.Nullable List<ProfileRequestModelAwardsInner> awards) { + this.awards = awards; + return this; + } + + public ProfileRequestEmailOnly addAwardsItem(ProfileRequestModelAwardsInner awardsItem) { + if (this.awards == null) { + this.awards = new ArrayList<>(); + } + this.awards.add(awardsItem); + return this; + } + + /** + * Get awards + * @return awards + */ + @javax.annotation.Nullable + public List<ProfileRequestModelAwardsInner> getAwards() { + return awards; + } + + public void setAwards(@javax.annotation.Nullable List<ProfileRequestModelAwardsInner> awards) { + this.awards = awards; + } + + + public ProfileRequestEmailOnly skills(@javax.annotation.Nullable List<ProfileRequestModelSkillsInner> skills) { + this.skills = skills; + return this; + } + + public ProfileRequestEmailOnly addSkillsItem(ProfileRequestModelSkillsInner skillsItem) { + if (this.skills == null) { + this.skills = new ArrayList<>(); + } + this.skills.add(skillsItem); + return this; + } + + /** + * Get skills + * @return skills + */ + @javax.annotation.Nullable + public List<ProfileRequestModelSkillsInner> getSkills() { + return skills; + } + + public void setSkills(@javax.annotation.Nullable List<ProfileRequestModelSkillsInner> skills) { + this.skills = skills; + } + + + public ProfileRequestEmailOnly currentStatus(@javax.annotation.Nullable List<ProfileRequestModelCurrentStatusInner> currentStatus) { + this.currentStatus = currentStatus; + return this; + } + + public ProfileRequestEmailOnly addCurrentStatusItem(ProfileRequestModelCurrentStatusInner currentStatusItem) { + if (this.currentStatus == null) { + this.currentStatus = new ArrayList<>(); + } + this.currentStatus.add(currentStatusItem); + return this; + } + + /** + * Get currentStatus + * @return currentStatus + */ + @javax.annotation.Nullable + public List<ProfileRequestModelCurrentStatusInner> getCurrentStatus() { + return currentStatus; + } + + public void setCurrentStatus(@javax.annotation.Nullable List<ProfileRequestModelCurrentStatusInner> currentStatus) { + this.currentStatus = currentStatus; + } + + + public ProfileRequestEmailOnly certifications(@javax.annotation.Nullable List<ProfileRequestModelCertificationsInner> certifications) { + this.certifications = certifications; + return this; + } + + public ProfileRequestEmailOnly addCertificationsItem(ProfileRequestModelCertificationsInner certificationsItem) { + if (this.certifications == null) { + this.certifications = new ArrayList<>(); + } + this.certifications.add(certificationsItem); + return this; + } + + /** + * Get certifications + * @return certifications + */ + @javax.annotation.Nullable + public List<ProfileRequestModelCertificationsInner> getCertifications() { + return certifications; + } + + public void setCertifications(@javax.annotation.Nullable List<ProfileRequestModelCertificationsInner> certifications) { + this.certifications = certifications; + } + + + public ProfileRequestEmailOnly courses(@javax.annotation.Nullable List<ProfileRequestModelCoursesInner> courses) { + this.courses = courses; + return this; + } + + public ProfileRequestEmailOnly addCoursesItem(ProfileRequestModelCoursesInner coursesItem) { + if (this.courses == null) { + this.courses = new ArrayList<>(); + } + this.courses.add(coursesItem); + return this; + } + + /** + * Get courses + * @return courses + */ + @javax.annotation.Nullable + public List<ProfileRequestModelCoursesInner> getCourses() { + return courses; + } + + public void setCourses(@javax.annotation.Nullable List<ProfileRequestModelCoursesInner> courses) { + this.courses = courses; + } + + + public ProfileRequestEmailOnly volunteer(@javax.annotation.Nullable List<ProfileRequestModelVolunteerInner> volunteer) { + this.volunteer = volunteer; + return this; + } + + public ProfileRequestEmailOnly addVolunteerItem(ProfileRequestModelVolunteerInner volunteerItem) { + if (this.volunteer == null) { + this.volunteer = new ArrayList<>(); + } + this.volunteer.add(volunteerItem); + return this; + } + + /** + * Get volunteer + * @return volunteer + */ + @javax.annotation.Nullable + public List<ProfileRequestModelVolunteerInner> getVolunteer() { + return volunteer; + } + + public void setVolunteer(@javax.annotation.Nullable List<ProfileRequestModelVolunteerInner> volunteer) { + this.volunteer = volunteer; + } + + + public ProfileRequestEmailOnly recommendationsReceived(@javax.annotation.Nullable List<ProfileRequestModelRecommendationsReceivedInner> recommendationsReceived) { + this.recommendationsReceived = recommendationsReceived; + return this; + } + + public ProfileRequestEmailOnly addRecommendationsReceivedItem(ProfileRequestModelRecommendationsReceivedInner recommendationsReceivedItem) { + if (this.recommendationsReceived == null) { + this.recommendationsReceived = new ArrayList<>(); + } + this.recommendationsReceived.add(recommendationsReceivedItem); + return this; + } + + /** + * Get recommendationsReceived + * @return recommendationsReceived + */ + @javax.annotation.Nullable + public List<ProfileRequestModelRecommendationsReceivedInner> getRecommendationsReceived() { + return recommendationsReceived; + } + + public void setRecommendationsReceived(@javax.annotation.Nullable List<ProfileRequestModelRecommendationsReceivedInner> recommendationsReceived) { + this.recommendationsReceived = recommendationsReceived; + } + + + public ProfileRequestEmailOnly languages(@javax.annotation.Nullable List<ProfileRequestModelLanguagesInner> languages) { + this.languages = languages; + return this; + } + + public ProfileRequestEmailOnly addLanguagesItem(ProfileRequestModelLanguagesInner languagesItem) { + if (this.languages == null) { + this.languages = new ArrayList<>(); + } + this.languages.add(languagesItem); + return this; + } + + /** + * Get languages + * @return languages + */ + @javax.annotation.Nullable + public List<ProfileRequestModelLanguagesInner> getLanguages() { + return languages; + } + + public void setLanguages(@javax.annotation.Nullable List<ProfileRequestModelLanguagesInner> languages) { + this.languages = languages; + } + + + public ProfileRequestEmailOnly projects(@javax.annotation.Nullable List<ProfileRequestModelProjectsInner> projects) { + this.projects = projects; + return this; + } + + public ProfileRequestEmailOnly addProjectsItem(ProfileRequestModelProjectsInner projectsItem) { + if (this.projects == null) { + this.projects = new ArrayList<>(); + } + this.projects.add(projectsItem); + return this; + } + + /** + * Get projects + * @return projects + */ + @javax.annotation.Nullable + public List<ProfileRequestModelProjectsInner> getProjects() { + return projects; + } + + public void setProjects(@javax.annotation.Nullable List<ProfileRequestModelProjectsInner> projects) { + this.projects = projects; + } + + + public ProfileRequestEmailOnly games(@javax.annotation.Nullable List<ProfileRequestModelGamesInner> games) { + this.games = games; + return this; + } + + public ProfileRequestEmailOnly addGamesItem(ProfileRequestModelGamesInner gamesItem) { + if (this.games == null) { + this.games = new ArrayList<>(); + } + this.games.add(gamesItem); + return this; + } + + /** + * Get games + * @return games + */ + @javax.annotation.Nullable + public List<ProfileRequestModelGamesInner> getGames() { + return games; + } + + public void setGames(@javax.annotation.Nullable List<ProfileRequestModelGamesInner> games) { + this.games = games; + } + + + public ProfileRequestEmailOnly family(@javax.annotation.Nullable List<ProfileRequestModelFamilyInner> family) { + this.family = family; + return this; + } + + public ProfileRequestEmailOnly addFamilyItem(ProfileRequestModelFamilyInner familyItem) { + if (this.family == null) { + this.family = new ArrayList<>(); + } + this.family.add(familyItem); + return this; + } + + /** + * Get family + * @return family + */ + @javax.annotation.Nullable + public List<ProfileRequestModelFamilyInner> getFamily() { + return family; + } + + public void setFamily(@javax.annotation.Nullable List<ProfileRequestModelFamilyInner> family) { + this.family = family; + } + + + public ProfileRequestEmailOnly teleVisionShow(@javax.annotation.Nullable List<ProfileRequestModelTeleVisionShowInner> teleVisionShow) { + this.teleVisionShow = teleVisionShow; + return this; + } + + public ProfileRequestEmailOnly addTeleVisionShowItem(ProfileRequestModelTeleVisionShowInner teleVisionShowItem) { + if (this.teleVisionShow == null) { + this.teleVisionShow = new ArrayList<>(); + } + this.teleVisionShow.add(teleVisionShowItem); + return this; + } + + /** + * Get teleVisionShow + * @return teleVisionShow + */ + @javax.annotation.Nullable + public List<ProfileRequestModelTeleVisionShowInner> getTeleVisionShow() { + return teleVisionShow; + } + + public void setTeleVisionShow(@javax.annotation.Nullable List<ProfileRequestModelTeleVisionShowInner> teleVisionShow) { + this.teleVisionShow = teleVisionShow; + } + + + public ProfileRequestEmailOnly mutualFriends(@javax.annotation.Nullable List<ProfileRequestModelMutualFriendsInner> mutualFriends) { + this.mutualFriends = mutualFriends; + return this; + } + + public ProfileRequestEmailOnly addMutualFriendsItem(ProfileRequestModelMutualFriendsInner mutualFriendsItem) { + if (this.mutualFriends == null) { + this.mutualFriends = new ArrayList<>(); + } + this.mutualFriends.add(mutualFriendsItem); + return this; + } + + /** + * Get mutualFriends + * @return mutualFriends + */ + @javax.annotation.Nullable + public List<ProfileRequestModelMutualFriendsInner> getMutualFriends() { + return mutualFriends; + } + + public void setMutualFriends(@javax.annotation.Nullable List<ProfileRequestModelMutualFriendsInner> mutualFriends) { + this.mutualFriends = mutualFriends; + } + + + public ProfileRequestEmailOnly movies(@javax.annotation.Nullable List<ProfileRequestModelMoviesInner> movies) { + this.movies = movies; + return this; + } + + public ProfileRequestEmailOnly addMoviesItem(ProfileRequestModelMoviesInner moviesItem) { + if (this.movies == null) { + this.movies = new ArrayList<>(); + } + this.movies.add(moviesItem); + return this; + } + + /** + * Get movies + * @return movies + */ + @javax.annotation.Nullable + public List<ProfileRequestModelMoviesInner> getMovies() { + return movies; + } + + public void setMovies(@javax.annotation.Nullable List<ProfileRequestModelMoviesInner> movies) { + this.movies = movies; + } + + + public ProfileRequestEmailOnly books(@javax.annotation.Nullable List<ProfileRequestModelBooksInner> books) { + this.books = books; + return this; + } + + public ProfileRequestEmailOnly addBooksItem(ProfileRequestModelBooksInner booksItem) { + if (this.books == null) { + this.books = new ArrayList<>(); + } + this.books.add(booksItem); + return this; + } + + /** + * Get books + * @return books + */ + @javax.annotation.Nullable + public List<ProfileRequestModelBooksInner> getBooks() { + return books; + } + + public void setBooks(@javax.annotation.Nullable List<ProfileRequestModelBooksInner> books) { + this.books = books; + } + + + public ProfileRequestEmailOnly patents(@javax.annotation.Nullable List<ProfileRequestModelPatentsInner> patents) { + this.patents = patents; + return this; + } + + public ProfileRequestEmailOnly addPatentsItem(ProfileRequestModelPatentsInner patentsItem) { + if (this.patents == null) { + this.patents = new ArrayList<>(); + } + this.patents.add(patentsItem); + return this; + } + + /** + * Get patents + * @return patents + */ + @javax.annotation.Nullable + public List<ProfileRequestModelPatentsInner> getPatents() { + return patents; + } + + public void setPatents(@javax.annotation.Nullable List<ProfileRequestModelPatentsInner> patents) { + this.patents = patents; + } + + + public ProfileRequestEmailOnly favoriteThings(@javax.annotation.Nullable List<ProfileRequestModelFavoriteThingsInner> favoriteThings) { + this.favoriteThings = favoriteThings; + return this; + } + + public ProfileRequestEmailOnly addFavoriteThingsItem(ProfileRequestModelFavoriteThingsInner favoriteThingsItem) { + if (this.favoriteThings == null) { + this.favoriteThings = new ArrayList<>(); + } + this.favoriteThings.add(favoriteThingsItem); + return this; + } + + /** + * Get favoriteThings + * @return favoriteThings + */ + @javax.annotation.Nullable + public List<ProfileRequestModelFavoriteThingsInner> getFavoriteThings() { + return favoriteThings; + } + + public void setFavoriteThings(@javax.annotation.Nullable List<ProfileRequestModelFavoriteThingsInner> favoriteThings) { + this.favoriteThings = favoriteThings; + } + + + public ProfileRequestEmailOnly relatedProfileViews(@javax.annotation.Nullable List<ProfileRequestModelRelatedProfileViewsInner> relatedProfileViews) { + this.relatedProfileViews = relatedProfileViews; + return this; + } + + public ProfileRequestEmailOnly addRelatedProfileViewsItem(ProfileRequestModelRelatedProfileViewsInner relatedProfileViewsItem) { + if (this.relatedProfileViews == null) { + this.relatedProfileViews = new ArrayList<>(); + } + this.relatedProfileViews.add(relatedProfileViewsItem); + return this; + } + + /** + * Get relatedProfileViews + * @return relatedProfileViews + */ + @javax.annotation.Nullable + public List<ProfileRequestModelRelatedProfileViewsInner> getRelatedProfileViews() { + return relatedProfileViews; + } + + public void setRelatedProfileViews(@javax.annotation.Nullable List<ProfileRequestModelRelatedProfileViewsInner> relatedProfileViews) { + this.relatedProfileViews = relatedProfileViews; + } + + + public ProfileRequestEmailOnly placesLived(@javax.annotation.Nullable List<ProfileRequestModelPlacesLivedInner> placesLived) { + this.placesLived = placesLived; + return this; + } + + public ProfileRequestEmailOnly addPlacesLivedItem(ProfileRequestModelPlacesLivedInner placesLivedItem) { + if (this.placesLived == null) { + this.placesLived = new ArrayList<>(); + } + this.placesLived.add(placesLivedItem); + return this; + } + + /** + * Get placesLived + * @return placesLived + */ + @javax.annotation.Nullable + public List<ProfileRequestModelPlacesLivedInner> getPlacesLived() { + return placesLived; + } + + public void setPlacesLived(@javax.annotation.Nullable List<ProfileRequestModelPlacesLivedInner> placesLived) { + this.placesLived = placesLived; + } + + + public ProfileRequestEmailOnly publications(@javax.annotation.Nullable List<ProfileRequestModelPublicationsInner> publications) { + this.publications = publications; + return this; + } + + public ProfileRequestEmailOnly addPublicationsItem(ProfileRequestModelPublicationsInner publicationsItem) { + if (this.publications == null) { + this.publications = new ArrayList<>(); + } + this.publications.add(publicationsItem); + return this; + } + + /** + * Get publications + * @return publications + */ + @javax.annotation.Nullable + public List<ProfileRequestModelPublicationsInner> getPublications() { + return publications; + } + + public void setPublications(@javax.annotation.Nullable List<ProfileRequestModelPublicationsInner> publications) { + this.publications = publications; + } + + + public ProfileRequestEmailOnly jobBookmarks(@javax.annotation.Nullable List<ProfileRequestModelJobBookmarksInner> jobBookmarks) { + this.jobBookmarks = jobBookmarks; + return this; + } + + public ProfileRequestEmailOnly addJobBookmarksItem(ProfileRequestModelJobBookmarksInner jobBookmarksItem) { + if (this.jobBookmarks == null) { + this.jobBookmarks = new ArrayList<>(); + } + this.jobBookmarks.add(jobBookmarksItem); + return this; + } + + /** + * Get jobBookmarks + * @return jobBookmarks + */ + @javax.annotation.Nullable + public List<ProfileRequestModelJobBookmarksInner> getJobBookmarks() { + return jobBookmarks; + } + + public void setJobBookmarks(@javax.annotation.Nullable List<ProfileRequestModelJobBookmarksInner> jobBookmarks) { + this.jobBookmarks = jobBookmarks; + } + + + public ProfileRequestEmailOnly badges(@javax.annotation.Nullable List<ProfileRequestModelBadgesInner> badges) { + this.badges = badges; + return this; + } + + public ProfileRequestEmailOnly addBadgesItem(ProfileRequestModelBadgesInner badgesItem) { + if (this.badges == null) { + this.badges = new ArrayList<>(); + } + this.badges.add(badgesItem); + return this; + } + + /** + * Get badges + * @return badges + */ + @javax.annotation.Nullable + public List<ProfileRequestModelBadgesInner> getBadges() { + return badges; + } + + public void setBadges(@javax.annotation.Nullable List<ProfileRequestModelBadgesInner> badges) { + this.badges = badges; + } + + + public ProfileRequestEmailOnly memberUrlResources(@javax.annotation.Nullable List<ProfileRequestModelMemberUrlResourcesInner> memberUrlResources) { + this.memberUrlResources = memberUrlResources; + return this; + } + + public ProfileRequestEmailOnly addMemberUrlResourcesItem(ProfileRequestModelMemberUrlResourcesInner memberUrlResourcesItem) { + if (this.memberUrlResources == null) { + this.memberUrlResources = new ArrayList<>(); + } + this.memberUrlResources.add(memberUrlResourcesItem); + return this; + } + + /** + * Get memberUrlResources + * @return memberUrlResources + */ + @javax.annotation.Nullable + public List<ProfileRequestModelMemberUrlResourcesInner> getMemberUrlResources() { + return memberUrlResources; + } + + public void setMemberUrlResources(@javax.annotation.Nullable List<ProfileRequestModelMemberUrlResourcesInner> memberUrlResources) { + this.memberUrlResources = memberUrlResources; + } + + + public ProfileRequestEmailOnly externalIds(@javax.annotation.Nullable List<ProfileRequestModelExternalIdsInner> externalIds) { + this.externalIds = externalIds; + return this; + } + + public ProfileRequestEmailOnly addExternalIdsItem(ProfileRequestModelExternalIdsInner externalIdsItem) { + if (this.externalIds == null) { + this.externalIds = new ArrayList<>(); + } + this.externalIds.add(externalIdsItem); + return this; + } + + /** + * Get externalIds + * @return externalIds + */ + @javax.annotation.Nullable + public List<ProfileRequestModelExternalIdsInner> getExternalIds() { + return externalIds; + } + + public void setExternalIds(@javax.annotation.Nullable List<ProfileRequestModelExternalIdsInner> externalIds) { + this.externalIds = externalIds; + } + + + public ProfileRequestEmailOnly isEmailSubscribed(@javax.annotation.Nullable Boolean isEmailSubscribed) { + this.isEmailSubscribed = isEmailSubscribed; + return this; + } + + /** + * Get isEmailSubscribed + * @return isEmailSubscribed + */ + @javax.annotation.Nullable + public Boolean getIsEmailSubscribed() { + return isEmailSubscribed; + } + + public void setIsEmailSubscribed(@javax.annotation.Nullable Boolean isEmailSubscribed) { + this.isEmailSubscribed = isEmailSubscribed; + } + + + public ProfileRequestEmailOnly isProtected(@javax.annotation.Nullable Boolean isProtected) { + this.isProtected = isProtected; + return this; + } + + /** + * Get isProtected + * @return isProtected + */ + @javax.annotation.Nullable + public Boolean getIsProtected() { + return isProtected; + } + + public void setIsProtected(@javax.annotation.Nullable Boolean isProtected) { + this.isProtected = isProtected; + } + + + public ProfileRequestEmailOnly hireable(@javax.annotation.Nullable Boolean hireable) { + this.hireable = hireable; + return this; + } + + /** + * Get hireable + * @return hireable + */ + @javax.annotation.Nullable + public Boolean getHireable() { + return hireable; + } + + public void setHireable(@javax.annotation.Nullable Boolean hireable) { + this.hireable = hireable; + } + + + public ProfileRequestEmailOnly disableLogin(@javax.annotation.Nullable Boolean disableLogin) { + this.disableLogin = disableLogin; + return this; + } + + /** + * Get disableLogin + * @return disableLogin + */ + @javax.annotation.Nullable + public Boolean getDisableLogin() { + return disableLogin; + } + + public void setDisableLogin(@javax.annotation.Nullable Boolean disableLogin) { + this.disableLogin = disableLogin; + } + + + public ProfileRequestEmailOnly acceptPrivacyPolicy(@javax.annotation.Nullable Boolean acceptPrivacyPolicy) { + this.acceptPrivacyPolicy = acceptPrivacyPolicy; + return this; + } + + /** + * Get acceptPrivacyPolicy + * @return acceptPrivacyPolicy + */ + @javax.annotation.Nullable + public Boolean getAcceptPrivacyPolicy() { + return acceptPrivacyPolicy; + } + + public void setAcceptPrivacyPolicy(@javax.annotation.Nullable Boolean acceptPrivacyPolicy) { + this.acceptPrivacyPolicy = acceptPrivacyPolicy; + } + + + public ProfileRequestEmailOnly registrationSource(@javax.annotation.Nullable String registrationSource) { + this.registrationSource = registrationSource; + return this; + } + + /** + * Get registrationSource + * @return registrationSource + */ + @javax.annotation.Nullable + public String getRegistrationSource() { + return registrationSource; + } + + public void setRegistrationSource(@javax.annotation.Nullable String registrationSource) { + this.registrationSource = registrationSource; + } + + + public ProfileRequestEmailOnly fullName(@javax.annotation.Nullable String fullName) { + this.fullName = fullName; + return this; + } + + /** + * Get fullName + * @return fullName + */ + @javax.annotation.Nullable + public String getFullName() { + return fullName; + } + + public void setFullName(@javax.annotation.Nullable String fullName) { + this.fullName = fullName; + } + + + public ProfileRequestEmailOnly consents(@javax.annotation.Nullable ProfileRequestModelConsents consents) { + this.consents = consents; + return this; + } + + /** + * Get consents + * @return consents + */ + @javax.annotation.Nullable + public ProfileRequestModelConsents getConsents() { + return consents; + } + + public void setConsents(@javax.annotation.Nullable ProfileRequestModelConsents consents) { + this.consents = consents; + } + + + public ProfileRequestEmailOnly email(@javax.annotation.Nullable List<ProfileRequestModelEmailInner> email) { + this.email = email; + return this; + } + + public ProfileRequestEmailOnly addEmailItem(ProfileRequestModelEmailInner emailItem) { + if (this.email == null) { + this.email = new ArrayList<>(); + } + this.email.add(emailItem); + return this; + } + + /** + * Get email + * @return email + */ + @javax.annotation.Nullable + public List<ProfileRequestModelEmailInner> getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable List<ProfileRequestModelEmailInner> email) { + this.email = email; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestEmailOnly instance itself + */ + public ProfileRequestEmailOnly putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestEmailOnly profileRequestEmailOnly = (ProfileRequestEmailOnly) o; + return Objects.equals(this.gender, profileRequestEmailOnly.gender) && + Objects.equals(this.birthDate, profileRequestEmailOnly.birthDate) && + Objects.equals(this.prefix, profileRequestEmailOnly.prefix) && + Objects.equals(this.firstName, profileRequestEmailOnly.firstName) && + Objects.equals(this.middleName, profileRequestEmailOnly.middleName) && + Objects.equals(this.lastName, profileRequestEmailOnly.lastName) && + Objects.equals(this.suffix, profileRequestEmailOnly.suffix) && + Objects.equals(this.nickName, profileRequestEmailOnly.nickName) && + Objects.equals(this.profileName, profileRequestEmailOnly.profileName) && + Objects.equals(this.about, profileRequestEmailOnly.about) && + Objects.equals(this.company, profileRequestEmailOnly.company) && + Objects.equals(this.imageUrl, profileRequestEmailOnly.imageUrl) && + Objects.equals(this.timeZone, profileRequestEmailOnly.timeZone) && + Objects.equals(this.website, profileRequestEmailOnly.website) && + Objects.equals(this.thumbnailImageUrl, profileRequestEmailOnly.thumbnailImageUrl) && + Objects.equals(this.favicon, profileRequestEmailOnly.favicon) && + Objects.equals(this.profileUrl, profileRequestEmailOnly.profileUrl) && + Objects.equals(this.homeTown, profileRequestEmailOnly.homeTown) && + Objects.equals(this.state, profileRequestEmailOnly.state) && + Objects.equals(this.city, profileRequestEmailOnly.city) && + Objects.equals(this.industry, profileRequestEmailOnly.industry) && + Objects.equals(this.localLanguage, profileRequestEmailOnly.localLanguage) && + Objects.equals(this.language, profileRequestEmailOnly.language) && + Objects.equals(this.coverPhoto, profileRequestEmailOnly.coverPhoto) && + Objects.equals(this.tagLine, profileRequestEmailOnly.tagLine) && + Objects.equals(this.mainAddress, profileRequestEmailOnly.mainAddress) && + Objects.equals(this.localCity, profileRequestEmailOnly.localCity) && + Objects.equals(this.profileCity, profileRequestEmailOnly.profileCity) && + Objects.equals(this.localCountry, profileRequestEmailOnly.localCountry) && + Objects.equals(this.profileCountry, profileRequestEmailOnly.profileCountry) && + Objects.equals(this.quota, profileRequestEmailOnly.quota) && + Objects.equals(this.religion, profileRequestEmailOnly.religion) && + Objects.equals(this.political, profileRequestEmailOnly.political) && + Objects.equals(this.relationshipStatus, profileRequestEmailOnly.relationshipStatus) && + Objects.equals(this.httpsImageUrl, profileRequestEmailOnly.httpsImageUrl) && + Objects.equals(this.isGeoEnabled, profileRequestEmailOnly.isGeoEnabled) && + Objects.equals(this.associations, profileRequestEmailOnly.associations) && + Objects.equals(this.honors, profileRequestEmailOnly.honors) && + Objects.equals(this.publicRepository, profileRequestEmailOnly.publicRepository) && + Objects.equals(this.repositoryUrl, profileRequestEmailOnly.repositoryUrl) && + Objects.equals(this.professionalHeadline, profileRequestEmailOnly.professionalHeadline) && + Objects.equals(this.currency, profileRequestEmailOnly.currency) && + Objects.equals(this.starredUrl, profileRequestEmailOnly.starredUrl) && + Objects.equals(this.gistsUrl, profileRequestEmailOnly.gistsUrl) && + Objects.equals(this.gravatarImageUrl, profileRequestEmailOnly.gravatarImageUrl) && + Objects.equals(this.externalUserLoginId, profileRequestEmailOnly.externalUserLoginId) && + Objects.equals(this.interestedIn, profileRequestEmailOnly.interestedIn) && + Objects.equals(this.followersCount, profileRequestEmailOnly.followersCount) && + Objects.equals(this.friendsCount, profileRequestEmailOnly.friendsCount) && + Objects.equals(this.totalStatusesCount, profileRequestEmailOnly.totalStatusesCount) && + Objects.equals(this.numRecommenders, profileRequestEmailOnly.numRecommenders) && + Objects.equals(this.totalPrivateRepository, profileRequestEmailOnly.totalPrivateRepository) && + Objects.equals(this.publicGists, profileRequestEmailOnly.publicGists) && + Objects.equals(this.privateGists, profileRequestEmailOnly.privateGists) && + Objects.equals(this.sessionLimit, profileRequestEmailOnly.sessionLimit) && + Objects.equals(this.customFields, profileRequestEmailOnly.customFields) && + Objects.equals(this.profileImageUrls, profileRequestEmailOnly.profileImageUrls) && + Objects.equals(this.webProfiles, profileRequestEmailOnly.webProfiles) && + Objects.equals(this.securityQuestionAnswer, profileRequestEmailOnly.securityQuestionAnswer) && + Objects.equals(this.country, profileRequestEmailOnly.country) && + Objects.equals(this.suggestions, profileRequestEmailOnly.suggestions) && + Objects.equals(this.subscription, profileRequestEmailOnly.subscription) && + Objects.equals(this.privacyPolicy, profileRequestEmailOnly.privacyPolicy) && + Objects.equals(this.piNInfo, profileRequestEmailOnly.piNInfo) && + Objects.equals(this.addresses, profileRequestEmailOnly.addresses) && + Objects.equals(this.positions, profileRequestEmailOnly.positions) && + Objects.equals(this.educations, profileRequestEmailOnly.educations) && + Objects.equals(this.phoneNumbers, profileRequestEmailOnly.phoneNumbers) && + Objects.equals(this.imAccounts, profileRequestEmailOnly.imAccounts) && + Objects.equals(this.interests, profileRequestEmailOnly.interests) && + Objects.equals(this.sports, profileRequestEmailOnly.sports) && + Objects.equals(this.inspirationalPeople, profileRequestEmailOnly.inspirationalPeople) && + Objects.equals(this.awards, profileRequestEmailOnly.awards) && + Objects.equals(this.skills, profileRequestEmailOnly.skills) && + Objects.equals(this.currentStatus, profileRequestEmailOnly.currentStatus) && + Objects.equals(this.certifications, profileRequestEmailOnly.certifications) && + Objects.equals(this.courses, profileRequestEmailOnly.courses) && + Objects.equals(this.volunteer, profileRequestEmailOnly.volunteer) && + Objects.equals(this.recommendationsReceived, profileRequestEmailOnly.recommendationsReceived) && + Objects.equals(this.languages, profileRequestEmailOnly.languages) && + Objects.equals(this.projects, profileRequestEmailOnly.projects) && + Objects.equals(this.games, profileRequestEmailOnly.games) && + Objects.equals(this.family, profileRequestEmailOnly.family) && + Objects.equals(this.teleVisionShow, profileRequestEmailOnly.teleVisionShow) && + Objects.equals(this.mutualFriends, profileRequestEmailOnly.mutualFriends) && + Objects.equals(this.movies, profileRequestEmailOnly.movies) && + Objects.equals(this.books, profileRequestEmailOnly.books) && + Objects.equals(this.patents, profileRequestEmailOnly.patents) && + Objects.equals(this.favoriteThings, profileRequestEmailOnly.favoriteThings) && + Objects.equals(this.relatedProfileViews, profileRequestEmailOnly.relatedProfileViews) && + Objects.equals(this.placesLived, profileRequestEmailOnly.placesLived) && + Objects.equals(this.publications, profileRequestEmailOnly.publications) && + Objects.equals(this.jobBookmarks, profileRequestEmailOnly.jobBookmarks) && + Objects.equals(this.badges, profileRequestEmailOnly.badges) && + Objects.equals(this.memberUrlResources, profileRequestEmailOnly.memberUrlResources) && + Objects.equals(this.externalIds, profileRequestEmailOnly.externalIds) && + Objects.equals(this.isEmailSubscribed, profileRequestEmailOnly.isEmailSubscribed) && + Objects.equals(this.isProtected, profileRequestEmailOnly.isProtected) && + Objects.equals(this.hireable, profileRequestEmailOnly.hireable) && + Objects.equals(this.disableLogin, profileRequestEmailOnly.disableLogin) && + Objects.equals(this.acceptPrivacyPolicy, profileRequestEmailOnly.acceptPrivacyPolicy) && + Objects.equals(this.registrationSource, profileRequestEmailOnly.registrationSource) && + Objects.equals(this.fullName, profileRequestEmailOnly.fullName) && + Objects.equals(this.consents, profileRequestEmailOnly.consents) && + Objects.equals(this.email, profileRequestEmailOnly.email)&& + Objects.equals(this.additionalProperties, profileRequestEmailOnly.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(gender, birthDate, prefix, firstName, middleName, lastName, suffix, nickName, profileName, about, company, imageUrl, timeZone, website, thumbnailImageUrl, favicon, profileUrl, homeTown, state, city, industry, localLanguage, language, coverPhoto, tagLine, mainAddress, localCity, profileCity, localCountry, profileCountry, quota, religion, political, relationshipStatus, httpsImageUrl, isGeoEnabled, associations, honors, publicRepository, repositoryUrl, professionalHeadline, currency, starredUrl, gistsUrl, gravatarImageUrl, externalUserLoginId, interestedIn, followersCount, friendsCount, totalStatusesCount, numRecommenders, totalPrivateRepository, publicGists, privateGists, sessionLimit, customFields, profileImageUrls, webProfiles, securityQuestionAnswer, country, suggestions, subscription, privacyPolicy, piNInfo, addresses, positions, educations, phoneNumbers, imAccounts, interests, sports, inspirationalPeople, awards, skills, currentStatus, certifications, courses, volunteer, recommendationsReceived, languages, projects, games, family, teleVisionShow, mutualFriends, movies, books, patents, favoriteThings, relatedProfileViews, placesLived, publications, jobBookmarks, badges, memberUrlResources, externalIds, isEmailSubscribed, isProtected, hireable, disableLogin, acceptPrivacyPolicy, registrationSource, fullName, consents, email, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestEmailOnly {\n"); + sb.append(" gender: ").append(toIndentedString(gender)).append("\n"); + sb.append(" birthDate: ").append(toIndentedString(birthDate)).append("\n"); + sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" middleName: ").append(toIndentedString(middleName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" suffix: ").append(toIndentedString(suffix)).append("\n"); + sb.append(" nickName: ").append(toIndentedString(nickName)).append("\n"); + sb.append(" profileName: ").append(toIndentedString(profileName)).append("\n"); + sb.append(" about: ").append(toIndentedString(about)).append("\n"); + sb.append(" company: ").append(toIndentedString(company)).append("\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); + sb.append(" website: ").append(toIndentedString(website)).append("\n"); + sb.append(" thumbnailImageUrl: ").append(toIndentedString(thumbnailImageUrl)).append("\n"); + sb.append(" favicon: ").append(toIndentedString(favicon)).append("\n"); + sb.append(" profileUrl: ").append(toIndentedString(profileUrl)).append("\n"); + sb.append(" homeTown: ").append(toIndentedString(homeTown)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" industry: ").append(toIndentedString(industry)).append("\n"); + sb.append(" localLanguage: ").append(toIndentedString(localLanguage)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" coverPhoto: ").append(toIndentedString(coverPhoto)).append("\n"); + sb.append(" tagLine: ").append(toIndentedString(tagLine)).append("\n"); + sb.append(" mainAddress: ").append(toIndentedString(mainAddress)).append("\n"); + sb.append(" localCity: ").append(toIndentedString(localCity)).append("\n"); + sb.append(" profileCity: ").append(toIndentedString(profileCity)).append("\n"); + sb.append(" localCountry: ").append(toIndentedString(localCountry)).append("\n"); + sb.append(" profileCountry: ").append(toIndentedString(profileCountry)).append("\n"); + sb.append(" quota: ").append(toIndentedString(quota)).append("\n"); + sb.append(" religion: ").append(toIndentedString(religion)).append("\n"); + sb.append(" political: ").append(toIndentedString(political)).append("\n"); + sb.append(" relationshipStatus: ").append(toIndentedString(relationshipStatus)).append("\n"); + sb.append(" httpsImageUrl: ").append(toIndentedString(httpsImageUrl)).append("\n"); + sb.append(" isGeoEnabled: ").append(toIndentedString(isGeoEnabled)).append("\n"); + sb.append(" associations: ").append(toIndentedString(associations)).append("\n"); + sb.append(" honors: ").append(toIndentedString(honors)).append("\n"); + sb.append(" publicRepository: ").append(toIndentedString(publicRepository)).append("\n"); + sb.append(" repositoryUrl: ").append(toIndentedString(repositoryUrl)).append("\n"); + sb.append(" professionalHeadline: ").append(toIndentedString(professionalHeadline)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" starredUrl: ").append(toIndentedString(starredUrl)).append("\n"); + sb.append(" gistsUrl: ").append(toIndentedString(gistsUrl)).append("\n"); + sb.append(" gravatarImageUrl: ").append(toIndentedString(gravatarImageUrl)).append("\n"); + sb.append(" externalUserLoginId: ").append(toIndentedString(externalUserLoginId)).append("\n"); + sb.append(" interestedIn: ").append(toIndentedString(interestedIn)).append("\n"); + sb.append(" followersCount: ").append(toIndentedString(followersCount)).append("\n"); + sb.append(" friendsCount: ").append(toIndentedString(friendsCount)).append("\n"); + sb.append(" totalStatusesCount: ").append(toIndentedString(totalStatusesCount)).append("\n"); + sb.append(" numRecommenders: ").append(toIndentedString(numRecommenders)).append("\n"); + sb.append(" totalPrivateRepository: ").append(toIndentedString(totalPrivateRepository)).append("\n"); + sb.append(" publicGists: ").append(toIndentedString(publicGists)).append("\n"); + sb.append(" privateGists: ").append(toIndentedString(privateGists)).append("\n"); + sb.append(" sessionLimit: ").append(toIndentedString(sessionLimit)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" profileImageUrls: ").append(toIndentedString(profileImageUrls)).append("\n"); + sb.append(" webProfiles: ").append(toIndentedString(webProfiles)).append("\n"); + sb.append(" securityQuestionAnswer: ").append(toIndentedString(securityQuestionAnswer)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" suggestions: ").append(toIndentedString(suggestions)).append("\n"); + sb.append(" subscription: ").append(toIndentedString(subscription)).append("\n"); + sb.append(" privacyPolicy: ").append(toIndentedString(privacyPolicy)).append("\n"); + sb.append(" piNInfo: ").append(toIndentedString(piNInfo)).append("\n"); + sb.append(" addresses: ").append(toIndentedString(addresses)).append("\n"); + sb.append(" positions: ").append(toIndentedString(positions)).append("\n"); + sb.append(" educations: ").append(toIndentedString(educations)).append("\n"); + sb.append(" phoneNumbers: ").append(toIndentedString(phoneNumbers)).append("\n"); + sb.append(" imAccounts: ").append(toIndentedString(imAccounts)).append("\n"); + sb.append(" interests: ").append(toIndentedString(interests)).append("\n"); + sb.append(" sports: ").append(toIndentedString(sports)).append("\n"); + sb.append(" inspirationalPeople: ").append(toIndentedString(inspirationalPeople)).append("\n"); + sb.append(" awards: ").append(toIndentedString(awards)).append("\n"); + sb.append(" skills: ").append(toIndentedString(skills)).append("\n"); + sb.append(" currentStatus: ").append(toIndentedString(currentStatus)).append("\n"); + sb.append(" certifications: ").append(toIndentedString(certifications)).append("\n"); + sb.append(" courses: ").append(toIndentedString(courses)).append("\n"); + sb.append(" volunteer: ").append(toIndentedString(volunteer)).append("\n"); + sb.append(" recommendationsReceived: ").append(toIndentedString(recommendationsReceived)).append("\n"); + sb.append(" languages: ").append(toIndentedString(languages)).append("\n"); + sb.append(" projects: ").append(toIndentedString(projects)).append("\n"); + sb.append(" games: ").append(toIndentedString(games)).append("\n"); + sb.append(" family: ").append(toIndentedString(family)).append("\n"); + sb.append(" teleVisionShow: ").append(toIndentedString(teleVisionShow)).append("\n"); + sb.append(" mutualFriends: ").append(toIndentedString(mutualFriends)).append("\n"); + sb.append(" movies: ").append(toIndentedString(movies)).append("\n"); + sb.append(" books: ").append(toIndentedString(books)).append("\n"); + sb.append(" patents: ").append(toIndentedString(patents)).append("\n"); + sb.append(" favoriteThings: ").append(toIndentedString(favoriteThings)).append("\n"); + sb.append(" relatedProfileViews: ").append(toIndentedString(relatedProfileViews)).append("\n"); + sb.append(" placesLived: ").append(toIndentedString(placesLived)).append("\n"); + sb.append(" publications: ").append(toIndentedString(publications)).append("\n"); + sb.append(" jobBookmarks: ").append(toIndentedString(jobBookmarks)).append("\n"); + sb.append(" badges: ").append(toIndentedString(badges)).append("\n"); + sb.append(" memberUrlResources: ").append(toIndentedString(memberUrlResources)).append("\n"); + sb.append(" externalIds: ").append(toIndentedString(externalIds)).append("\n"); + sb.append(" isEmailSubscribed: ").append(toIndentedString(isEmailSubscribed)).append("\n"); + sb.append(" isProtected: ").append(toIndentedString(isProtected)).append("\n"); + sb.append(" hireable: ").append(toIndentedString(hireable)).append("\n"); + sb.append(" disableLogin: ").append(toIndentedString(disableLogin)).append("\n"); + sb.append(" acceptPrivacyPolicy: ").append(toIndentedString(acceptPrivacyPolicy)).append("\n"); + sb.append(" registrationSource: ").append(toIndentedString(registrationSource)).append("\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append(" consents: ").append(toIndentedString(consents)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Gender"); + openapiFields.add("BirthDate"); + openapiFields.add("Prefix"); + openapiFields.add("FirstName"); + openapiFields.add("MiddleName"); + openapiFields.add("LastName"); + openapiFields.add("Suffix"); + openapiFields.add("NickName"); + openapiFields.add("ProfileName"); + openapiFields.add("About"); + openapiFields.add("Company"); + openapiFields.add("ImageUrl"); + openapiFields.add("TimeZone"); + openapiFields.add("Website"); + openapiFields.add("ThumbnailImageUrl"); + openapiFields.add("Favicon"); + openapiFields.add("ProfileUrl"); + openapiFields.add("HomeTown"); + openapiFields.add("State"); + openapiFields.add("City"); + openapiFields.add("Industry"); + openapiFields.add("LocalLanguage"); + openapiFields.add("Language"); + openapiFields.add("CoverPhoto"); + openapiFields.add("TagLine"); + openapiFields.add("MainAddress"); + openapiFields.add("LocalCity"); + openapiFields.add("ProfileCity"); + openapiFields.add("LocalCountry"); + openapiFields.add("ProfileCountry"); + openapiFields.add("Quota"); + openapiFields.add("Religion"); + openapiFields.add("Political"); + openapiFields.add("RelationshipStatus"); + openapiFields.add("HttpsImageUrl"); + openapiFields.add("IsGeoEnabled"); + openapiFields.add("Associations"); + openapiFields.add("Honors"); + openapiFields.add("PublicRepository"); + openapiFields.add("RepositoryUrl"); + openapiFields.add("ProfessionalHeadline"); + openapiFields.add("Currency"); + openapiFields.add("StarredUrl"); + openapiFields.add("GistsUrl"); + openapiFields.add("GravatarImageUrl"); + openapiFields.add("ExternalUserLoginId"); + openapiFields.add("InterestedIn"); + openapiFields.add("FollowersCount"); + openapiFields.add("FriendsCount"); + openapiFields.add("TotalStatusesCount"); + openapiFields.add("NumRecommenders"); + openapiFields.add("TotalPrivateRepository"); + openapiFields.add("PublicGists"); + openapiFields.add("PrivateGists"); + openapiFields.add("SessionLimit"); + openapiFields.add("CustomFields"); + openapiFields.add("ProfileImageUrls"); + openapiFields.add("WebProfiles"); + openapiFields.add("SecurityQuestionAnswer"); + openapiFields.add("Country"); + openapiFields.add("Suggestions"); + openapiFields.add("Subscription"); + openapiFields.add("PrivacyPolicy"); + openapiFields.add("PINInfo"); + openapiFields.add("Addresses"); + openapiFields.add("Positions"); + openapiFields.add("Educations"); + openapiFields.add("PhoneNumbers"); + openapiFields.add("IMAccounts"); + openapiFields.add("Interests"); + openapiFields.add("Sports"); + openapiFields.add("InspirationalPeople"); + openapiFields.add("Awards"); + openapiFields.add("Skills"); + openapiFields.add("CurrentStatus"); + openapiFields.add("Certifications"); + openapiFields.add("Courses"); + openapiFields.add("Volunteer"); + openapiFields.add("RecommendationsReceived"); + openapiFields.add("Languages"); + openapiFields.add("Projects"); + openapiFields.add("Games"); + openapiFields.add("Family"); + openapiFields.add("TeleVisionShow"); + openapiFields.add("MutualFriends"); + openapiFields.add("Movies"); + openapiFields.add("Books"); + openapiFields.add("Patents"); + openapiFields.add("FavoriteThings"); + openapiFields.add("RelatedProfileViews"); + openapiFields.add("PlacesLived"); + openapiFields.add("Publications"); + openapiFields.add("JobBookmarks"); + openapiFields.add("Badges"); + openapiFields.add("MemberUrlResources"); + openapiFields.add("ExternalIds"); + openapiFields.add("IsEmailSubscribed"); + openapiFields.add("IsProtected"); + openapiFields.add("Hireable"); + openapiFields.add("DisableLogin"); + openapiFields.add("AcceptPrivacyPolicy"); + openapiFields.add("RegistrationSource"); + openapiFields.add("FullName"); + openapiFields.add("Consents"); + openapiFields.add("Email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestEmailOnly + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestEmailOnly.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestEmailOnly is not found in the empty JSON string", ProfileRequestEmailOnly.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Gender") != null && !jsonObj.get("Gender").isJsonNull()) && !jsonObj.get("Gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Gender").toString())); + } + if ((jsonObj.get("BirthDate") != null && !jsonObj.get("BirthDate").isJsonNull()) && !jsonObj.get("BirthDate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `BirthDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BirthDate").toString())); + } + if ((jsonObj.get("Prefix") != null && !jsonObj.get("Prefix").isJsonNull()) && !jsonObj.get("Prefix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Prefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Prefix").toString())); + } + if ((jsonObj.get("FirstName") != null && !jsonObj.get("FirstName").isJsonNull()) && !jsonObj.get("FirstName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FirstName").toString())); + } + if ((jsonObj.get("MiddleName") != null && !jsonObj.get("MiddleName").isJsonNull()) && !jsonObj.get("MiddleName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MiddleName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MiddleName").toString())); + } + if ((jsonObj.get("LastName") != null && !jsonObj.get("LastName").isJsonNull()) && !jsonObj.get("LastName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastName").toString())); + } + if ((jsonObj.get("Suffix") != null && !jsonObj.get("Suffix").isJsonNull()) && !jsonObj.get("Suffix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Suffix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Suffix").toString())); + } + if ((jsonObj.get("NickName") != null && !jsonObj.get("NickName").isJsonNull()) && !jsonObj.get("NickName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NickName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NickName").toString())); + } + if ((jsonObj.get("ProfileName") != null && !jsonObj.get("ProfileName").isJsonNull()) && !jsonObj.get("ProfileName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileName").toString())); + } + if ((jsonObj.get("About") != null && !jsonObj.get("About").isJsonNull()) && !jsonObj.get("About").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `About` to be a primitive type in the JSON string but got `%s`", jsonObj.get("About").toString())); + } + if ((jsonObj.get("Company") != null && !jsonObj.get("Company").isJsonNull()) && !jsonObj.get("Company").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Company` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Company").toString())); + } + if ((jsonObj.get("ImageUrl") != null && !jsonObj.get("ImageUrl").isJsonNull()) && !jsonObj.get("ImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ImageUrl").toString())); + } + if ((jsonObj.get("TimeZone") != null && !jsonObj.get("TimeZone").isJsonNull()) && !jsonObj.get("TimeZone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TimeZone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TimeZone").toString())); + } + if ((jsonObj.get("Website") != null && !jsonObj.get("Website").isJsonNull()) && !jsonObj.get("Website").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Website` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Website").toString())); + } + if ((jsonObj.get("ThumbnailImageUrl") != null && !jsonObj.get("ThumbnailImageUrl").isJsonNull()) && !jsonObj.get("ThumbnailImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ThumbnailImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ThumbnailImageUrl").toString())); + } + if ((jsonObj.get("Favicon") != null && !jsonObj.get("Favicon").isJsonNull()) && !jsonObj.get("Favicon").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Favicon` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Favicon").toString())); + } + if ((jsonObj.get("ProfileUrl") != null && !jsonObj.get("ProfileUrl").isJsonNull()) && !jsonObj.get("ProfileUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileUrl").toString())); + } + if ((jsonObj.get("HomeTown") != null && !jsonObj.get("HomeTown").isJsonNull()) && !jsonObj.get("HomeTown").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HomeTown` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HomeTown").toString())); + } + if ((jsonObj.get("State") != null && !jsonObj.get("State").isJsonNull()) && !jsonObj.get("State").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `State` to be a primitive type in the JSON string but got `%s`", jsonObj.get("State").toString())); + } + if ((jsonObj.get("City") != null && !jsonObj.get("City").isJsonNull()) && !jsonObj.get("City").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `City` to be a primitive type in the JSON string but got `%s`", jsonObj.get("City").toString())); + } + if ((jsonObj.get("Industry") != null && !jsonObj.get("Industry").isJsonNull()) && !jsonObj.get("Industry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Industry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Industry").toString())); + } + if ((jsonObj.get("LocalLanguage") != null && !jsonObj.get("LocalLanguage").isJsonNull()) && !jsonObj.get("LocalLanguage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalLanguage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalLanguage").toString())); + } + if ((jsonObj.get("Language") != null && !jsonObj.get("Language").isJsonNull()) && !jsonObj.get("Language").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Language` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Language").toString())); + } + if ((jsonObj.get("CoverPhoto") != null && !jsonObj.get("CoverPhoto").isJsonNull()) && !jsonObj.get("CoverPhoto").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CoverPhoto` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CoverPhoto").toString())); + } + if ((jsonObj.get("TagLine") != null && !jsonObj.get("TagLine").isJsonNull()) && !jsonObj.get("TagLine").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TagLine` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TagLine").toString())); + } + if ((jsonObj.get("MainAddress") != null && !jsonObj.get("MainAddress").isJsonNull()) && !jsonObj.get("MainAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MainAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MainAddress").toString())); + } + if ((jsonObj.get("LocalCity") != null && !jsonObj.get("LocalCity").isJsonNull()) && !jsonObj.get("LocalCity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalCity").toString())); + } + if ((jsonObj.get("ProfileCity") != null && !jsonObj.get("ProfileCity").isJsonNull()) && !jsonObj.get("ProfileCity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileCity").toString())); + } + if ((jsonObj.get("LocalCountry") != null && !jsonObj.get("LocalCountry").isJsonNull()) && !jsonObj.get("LocalCountry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalCountry").toString())); + } + if ((jsonObj.get("ProfileCountry") != null && !jsonObj.get("ProfileCountry").isJsonNull()) && !jsonObj.get("ProfileCountry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileCountry").toString())); + } + if ((jsonObj.get("Quota") != null && !jsonObj.get("Quota").isJsonNull()) && !jsonObj.get("Quota").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Quota` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Quota").toString())); + } + if ((jsonObj.get("Religion") != null && !jsonObj.get("Religion").isJsonNull()) && !jsonObj.get("Religion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Religion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Religion").toString())); + } + if ((jsonObj.get("Political") != null && !jsonObj.get("Political").isJsonNull()) && !jsonObj.get("Political").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Political` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Political").toString())); + } + if ((jsonObj.get("RelationshipStatus") != null && !jsonObj.get("RelationshipStatus").isJsonNull()) && !jsonObj.get("RelationshipStatus").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RelationshipStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RelationshipStatus").toString())); + } + if ((jsonObj.get("HttpsImageUrl") != null && !jsonObj.get("HttpsImageUrl").isJsonNull()) && !jsonObj.get("HttpsImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HttpsImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HttpsImageUrl").toString())); + } + if ((jsonObj.get("IsGeoEnabled") != null && !jsonObj.get("IsGeoEnabled").isJsonNull()) && !jsonObj.get("IsGeoEnabled").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IsGeoEnabled` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IsGeoEnabled").toString())); + } + if ((jsonObj.get("Associations") != null && !jsonObj.get("Associations").isJsonNull()) && !jsonObj.get("Associations").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Associations` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Associations").toString())); + } + if ((jsonObj.get("Honors") != null && !jsonObj.get("Honors").isJsonNull()) && !jsonObj.get("Honors").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Honors` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Honors").toString())); + } + if ((jsonObj.get("PublicRepository") != null && !jsonObj.get("PublicRepository").isJsonNull()) && !jsonObj.get("PublicRepository").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PublicRepository` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PublicRepository").toString())); + } + if ((jsonObj.get("RepositoryUrl") != null && !jsonObj.get("RepositoryUrl").isJsonNull()) && !jsonObj.get("RepositoryUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RepositoryUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RepositoryUrl").toString())); + } + if ((jsonObj.get("ProfessionalHeadline") != null && !jsonObj.get("ProfessionalHeadline").isJsonNull()) && !jsonObj.get("ProfessionalHeadline").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfessionalHeadline` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfessionalHeadline").toString())); + } + if ((jsonObj.get("Currency") != null && !jsonObj.get("Currency").isJsonNull()) && !jsonObj.get("Currency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Currency").toString())); + } + if ((jsonObj.get("StarredUrl") != null && !jsonObj.get("StarredUrl").isJsonNull()) && !jsonObj.get("StarredUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `StarredUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("StarredUrl").toString())); + } + if ((jsonObj.get("GistsUrl") != null && !jsonObj.get("GistsUrl").isJsonNull()) && !jsonObj.get("GistsUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GistsUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GistsUrl").toString())); + } + if ((jsonObj.get("GravatarImageUrl") != null && !jsonObj.get("GravatarImageUrl").isJsonNull()) && !jsonObj.get("GravatarImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GravatarImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GravatarImageUrl").toString())); + } + if ((jsonObj.get("ExternalUserLoginId") != null && !jsonObj.get("ExternalUserLoginId").isJsonNull()) && !jsonObj.get("ExternalUserLoginId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ExternalUserLoginId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ExternalUserLoginId").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("InterestedIn") != null && !jsonObj.get("InterestedIn").isJsonNull() && !jsonObj.get("InterestedIn").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `InterestedIn` to be an array in the JSON string but got `%s`", jsonObj.get("InterestedIn").toString())); + } + // validate the optional field `Country` + if (jsonObj.get("Country") != null && !jsonObj.get("Country").isJsonNull()) { + ProfileRequestModelCountry.validateJsonElement(jsonObj.get("Country")); + } + // validate the optional field `Suggestions` + if (jsonObj.get("Suggestions") != null && !jsonObj.get("Suggestions").isJsonNull()) { + ProfileRequestModelSuggestions.validateJsonElement(jsonObj.get("Suggestions")); + } + // validate the optional field `Subscription` + if (jsonObj.get("Subscription") != null && !jsonObj.get("Subscription").isJsonNull()) { + ProfileRequestModelSubscription.validateJsonElement(jsonObj.get("Subscription")); + } + // validate the optional field `PrivacyPolicy` + if (jsonObj.get("PrivacyPolicy") != null && !jsonObj.get("PrivacyPolicy").isJsonNull()) { + ProfileRequestModelPrivacyPolicy.validateJsonElement(jsonObj.get("PrivacyPolicy")); + } + // validate the optional field `PINInfo` + if (jsonObj.get("PINInfo") != null && !jsonObj.get("PINInfo").isJsonNull()) { + ProfileRequestModelPINInfo.validateJsonElement(jsonObj.get("PINInfo")); + } + if (jsonObj.get("Addresses") != null && !jsonObj.get("Addresses").isJsonNull()) { + JsonArray jsonArrayaddresses = jsonObj.getAsJsonArray("Addresses"); + if (jsonArrayaddresses != null) { + // ensure the json data is an array + if (!jsonObj.get("Addresses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Addresses` to be an array in the JSON string but got `%s`", jsonObj.get("Addresses").toString())); + } + + // validate the optional field `Addresses` (array) + for (int i = 0; i < jsonArrayaddresses.size(); i++) { + ProfileRequestModelAddressesInner.validateJsonElement(jsonArrayaddresses.get(i)); + }; + } + } + if (jsonObj.get("Positions") != null && !jsonObj.get("Positions").isJsonNull()) { + JsonArray jsonArraypositions = jsonObj.getAsJsonArray("Positions"); + if (jsonArraypositions != null) { + // ensure the json data is an array + if (!jsonObj.get("Positions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Positions` to be an array in the JSON string but got `%s`", jsonObj.get("Positions").toString())); + } + + // validate the optional field `Positions` (array) + for (int i = 0; i < jsonArraypositions.size(); i++) { + ProfileRequestModelPositionsInner.validateJsonElement(jsonArraypositions.get(i)); + }; + } + } + if (jsonObj.get("Educations") != null && !jsonObj.get("Educations").isJsonNull()) { + JsonArray jsonArrayeducations = jsonObj.getAsJsonArray("Educations"); + if (jsonArrayeducations != null) { + // ensure the json data is an array + if (!jsonObj.get("Educations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Educations` to be an array in the JSON string but got `%s`", jsonObj.get("Educations").toString())); + } + + // validate the optional field `Educations` (array) + for (int i = 0; i < jsonArrayeducations.size(); i++) { + ProfileRequestModelEducationsInner.validateJsonElement(jsonArrayeducations.get(i)); + }; + } + } + if (jsonObj.get("PhoneNumbers") != null && !jsonObj.get("PhoneNumbers").isJsonNull()) { + JsonArray jsonArrayphoneNumbers = jsonObj.getAsJsonArray("PhoneNumbers"); + if (jsonArrayphoneNumbers != null) { + // ensure the json data is an array + if (!jsonObj.get("PhoneNumbers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PhoneNumbers` to be an array in the JSON string but got `%s`", jsonObj.get("PhoneNumbers").toString())); + } + + // validate the optional field `PhoneNumbers` (array) + for (int i = 0; i < jsonArrayphoneNumbers.size(); i++) { + ProfileRequestModelPhoneNumbersInner.validateJsonElement(jsonArrayphoneNumbers.get(i)); + }; + } + } + if (jsonObj.get("IMAccounts") != null && !jsonObj.get("IMAccounts").isJsonNull()) { + JsonArray jsonArrayimAccounts = jsonObj.getAsJsonArray("IMAccounts"); + if (jsonArrayimAccounts != null) { + // ensure the json data is an array + if (!jsonObj.get("IMAccounts").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `IMAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("IMAccounts").toString())); + } + + // validate the optional field `IMAccounts` (array) + for (int i = 0; i < jsonArrayimAccounts.size(); i++) { + ProfileRequestModelIMAccountsInner.validateJsonElement(jsonArrayimAccounts.get(i)); + }; + } + } + if (jsonObj.get("Interests") != null && !jsonObj.get("Interests").isJsonNull()) { + JsonArray jsonArrayinterests = jsonObj.getAsJsonArray("Interests"); + if (jsonArrayinterests != null) { + // ensure the json data is an array + if (!jsonObj.get("Interests").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Interests` to be an array in the JSON string but got `%s`", jsonObj.get("Interests").toString())); + } + + // validate the optional field `Interests` (array) + for (int i = 0; i < jsonArrayinterests.size(); i++) { + ProfileRequestModelInterestsInner.validateJsonElement(jsonArrayinterests.get(i)); + }; + } + } + if (jsonObj.get("Sports") != null && !jsonObj.get("Sports").isJsonNull()) { + JsonArray jsonArraysports = jsonObj.getAsJsonArray("Sports"); + if (jsonArraysports != null) { + // ensure the json data is an array + if (!jsonObj.get("Sports").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Sports` to be an array in the JSON string but got `%s`", jsonObj.get("Sports").toString())); + } + + // validate the optional field `Sports` (array) + for (int i = 0; i < jsonArraysports.size(); i++) { + ProfileRequestModelSportsInner.validateJsonElement(jsonArraysports.get(i)); + }; + } + } + if (jsonObj.get("InspirationalPeople") != null && !jsonObj.get("InspirationalPeople").isJsonNull()) { + JsonArray jsonArrayinspirationalPeople = jsonObj.getAsJsonArray("InspirationalPeople"); + if (jsonArrayinspirationalPeople != null) { + // ensure the json data is an array + if (!jsonObj.get("InspirationalPeople").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `InspirationalPeople` to be an array in the JSON string but got `%s`", jsonObj.get("InspirationalPeople").toString())); + } + + // validate the optional field `InspirationalPeople` (array) + for (int i = 0; i < jsonArrayinspirationalPeople.size(); i++) { + ProfileRequestModelInspirationalPeopleInner.validateJsonElement(jsonArrayinspirationalPeople.get(i)); + }; + } + } + if (jsonObj.get("Awards") != null && !jsonObj.get("Awards").isJsonNull()) { + JsonArray jsonArrayawards = jsonObj.getAsJsonArray("Awards"); + if (jsonArrayawards != null) { + // ensure the json data is an array + if (!jsonObj.get("Awards").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Awards` to be an array in the JSON string but got `%s`", jsonObj.get("Awards").toString())); + } + + // validate the optional field `Awards` (array) + for (int i = 0; i < jsonArrayawards.size(); i++) { + ProfileRequestModelAwardsInner.validateJsonElement(jsonArrayawards.get(i)); + }; + } + } + if (jsonObj.get("Skills") != null && !jsonObj.get("Skills").isJsonNull()) { + JsonArray jsonArrayskills = jsonObj.getAsJsonArray("Skills"); + if (jsonArrayskills != null) { + // ensure the json data is an array + if (!jsonObj.get("Skills").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Skills` to be an array in the JSON string but got `%s`", jsonObj.get("Skills").toString())); + } + + // validate the optional field `Skills` (array) + for (int i = 0; i < jsonArrayskills.size(); i++) { + ProfileRequestModelSkillsInner.validateJsonElement(jsonArrayskills.get(i)); + }; + } + } + if (jsonObj.get("CurrentStatus") != null && !jsonObj.get("CurrentStatus").isJsonNull()) { + JsonArray jsonArraycurrentStatus = jsonObj.getAsJsonArray("CurrentStatus"); + if (jsonArraycurrentStatus != null) { + // ensure the json data is an array + if (!jsonObj.get("CurrentStatus").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `CurrentStatus` to be an array in the JSON string but got `%s`", jsonObj.get("CurrentStatus").toString())); + } + + // validate the optional field `CurrentStatus` (array) + for (int i = 0; i < jsonArraycurrentStatus.size(); i++) { + ProfileRequestModelCurrentStatusInner.validateJsonElement(jsonArraycurrentStatus.get(i)); + }; + } + } + if (jsonObj.get("Certifications") != null && !jsonObj.get("Certifications").isJsonNull()) { + JsonArray jsonArraycertifications = jsonObj.getAsJsonArray("Certifications"); + if (jsonArraycertifications != null) { + // ensure the json data is an array + if (!jsonObj.get("Certifications").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Certifications` to be an array in the JSON string but got `%s`", jsonObj.get("Certifications").toString())); + } + + // validate the optional field `Certifications` (array) + for (int i = 0; i < jsonArraycertifications.size(); i++) { + ProfileRequestModelCertificationsInner.validateJsonElement(jsonArraycertifications.get(i)); + }; + } + } + if (jsonObj.get("Courses") != null && !jsonObj.get("Courses").isJsonNull()) { + JsonArray jsonArraycourses = jsonObj.getAsJsonArray("Courses"); + if (jsonArraycourses != null) { + // ensure the json data is an array + if (!jsonObj.get("Courses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Courses` to be an array in the JSON string but got `%s`", jsonObj.get("Courses").toString())); + } + + // validate the optional field `Courses` (array) + for (int i = 0; i < jsonArraycourses.size(); i++) { + ProfileRequestModelCoursesInner.validateJsonElement(jsonArraycourses.get(i)); + }; + } + } + if (jsonObj.get("Volunteer") != null && !jsonObj.get("Volunteer").isJsonNull()) { + JsonArray jsonArrayvolunteer = jsonObj.getAsJsonArray("Volunteer"); + if (jsonArrayvolunteer != null) { + // ensure the json data is an array + if (!jsonObj.get("Volunteer").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Volunteer` to be an array in the JSON string but got `%s`", jsonObj.get("Volunteer").toString())); + } + + // validate the optional field `Volunteer` (array) + for (int i = 0; i < jsonArrayvolunteer.size(); i++) { + ProfileRequestModelVolunteerInner.validateJsonElement(jsonArrayvolunteer.get(i)); + }; + } + } + if (jsonObj.get("RecommendationsReceived") != null && !jsonObj.get("RecommendationsReceived").isJsonNull()) { + JsonArray jsonArrayrecommendationsReceived = jsonObj.getAsJsonArray("RecommendationsReceived"); + if (jsonArrayrecommendationsReceived != null) { + // ensure the json data is an array + if (!jsonObj.get("RecommendationsReceived").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RecommendationsReceived` to be an array in the JSON string but got `%s`", jsonObj.get("RecommendationsReceived").toString())); + } + + // validate the optional field `RecommendationsReceived` (array) + for (int i = 0; i < jsonArrayrecommendationsReceived.size(); i++) { + ProfileRequestModelRecommendationsReceivedInner.validateJsonElement(jsonArrayrecommendationsReceived.get(i)); + }; + } + } + if (jsonObj.get("Languages") != null && !jsonObj.get("Languages").isJsonNull()) { + JsonArray jsonArraylanguages = jsonObj.getAsJsonArray("Languages"); + if (jsonArraylanguages != null) { + // ensure the json data is an array + if (!jsonObj.get("Languages").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Languages` to be an array in the JSON string but got `%s`", jsonObj.get("Languages").toString())); + } + + // validate the optional field `Languages` (array) + for (int i = 0; i < jsonArraylanguages.size(); i++) { + ProfileRequestModelLanguagesInner.validateJsonElement(jsonArraylanguages.get(i)); + }; + } + } + if (jsonObj.get("Projects") != null && !jsonObj.get("Projects").isJsonNull()) { + JsonArray jsonArrayprojects = jsonObj.getAsJsonArray("Projects"); + if (jsonArrayprojects != null) { + // ensure the json data is an array + if (!jsonObj.get("Projects").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Projects` to be an array in the JSON string but got `%s`", jsonObj.get("Projects").toString())); + } + + // validate the optional field `Projects` (array) + for (int i = 0; i < jsonArrayprojects.size(); i++) { + ProfileRequestModelProjectsInner.validateJsonElement(jsonArrayprojects.get(i)); + }; + } + } + if (jsonObj.get("Games") != null && !jsonObj.get("Games").isJsonNull()) { + JsonArray jsonArraygames = jsonObj.getAsJsonArray("Games"); + if (jsonArraygames != null) { + // ensure the json data is an array + if (!jsonObj.get("Games").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Games` to be an array in the JSON string but got `%s`", jsonObj.get("Games").toString())); + } + + // validate the optional field `Games` (array) + for (int i = 0; i < jsonArraygames.size(); i++) { + ProfileRequestModelGamesInner.validateJsonElement(jsonArraygames.get(i)); + }; + } + } + if (jsonObj.get("Family") != null && !jsonObj.get("Family").isJsonNull()) { + JsonArray jsonArrayfamily = jsonObj.getAsJsonArray("Family"); + if (jsonArrayfamily != null) { + // ensure the json data is an array + if (!jsonObj.get("Family").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Family` to be an array in the JSON string but got `%s`", jsonObj.get("Family").toString())); + } + + // validate the optional field `Family` (array) + for (int i = 0; i < jsonArrayfamily.size(); i++) { + ProfileRequestModelFamilyInner.validateJsonElement(jsonArrayfamily.get(i)); + }; + } + } + if (jsonObj.get("TeleVisionShow") != null && !jsonObj.get("TeleVisionShow").isJsonNull()) { + JsonArray jsonArrayteleVisionShow = jsonObj.getAsJsonArray("TeleVisionShow"); + if (jsonArrayteleVisionShow != null) { + // ensure the json data is an array + if (!jsonObj.get("TeleVisionShow").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `TeleVisionShow` to be an array in the JSON string but got `%s`", jsonObj.get("TeleVisionShow").toString())); + } + + // validate the optional field `TeleVisionShow` (array) + for (int i = 0; i < jsonArrayteleVisionShow.size(); i++) { + ProfileRequestModelTeleVisionShowInner.validateJsonElement(jsonArrayteleVisionShow.get(i)); + }; + } + } + if (jsonObj.get("MutualFriends") != null && !jsonObj.get("MutualFriends").isJsonNull()) { + JsonArray jsonArraymutualFriends = jsonObj.getAsJsonArray("MutualFriends"); + if (jsonArraymutualFriends != null) { + // ensure the json data is an array + if (!jsonObj.get("MutualFriends").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `MutualFriends` to be an array in the JSON string but got `%s`", jsonObj.get("MutualFriends").toString())); + } + + // validate the optional field `MutualFriends` (array) + for (int i = 0; i < jsonArraymutualFriends.size(); i++) { + ProfileRequestModelMutualFriendsInner.validateJsonElement(jsonArraymutualFriends.get(i)); + }; + } + } + if (jsonObj.get("Movies") != null && !jsonObj.get("Movies").isJsonNull()) { + JsonArray jsonArraymovies = jsonObj.getAsJsonArray("Movies"); + if (jsonArraymovies != null) { + // ensure the json data is an array + if (!jsonObj.get("Movies").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Movies` to be an array in the JSON string but got `%s`", jsonObj.get("Movies").toString())); + } + + // validate the optional field `Movies` (array) + for (int i = 0; i < jsonArraymovies.size(); i++) { + ProfileRequestModelMoviesInner.validateJsonElement(jsonArraymovies.get(i)); + }; + } + } + if (jsonObj.get("Books") != null && !jsonObj.get("Books").isJsonNull()) { + JsonArray jsonArraybooks = jsonObj.getAsJsonArray("Books"); + if (jsonArraybooks != null) { + // ensure the json data is an array + if (!jsonObj.get("Books").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Books` to be an array in the JSON string but got `%s`", jsonObj.get("Books").toString())); + } + + // validate the optional field `Books` (array) + for (int i = 0; i < jsonArraybooks.size(); i++) { + ProfileRequestModelBooksInner.validateJsonElement(jsonArraybooks.get(i)); + }; + } + } + if (jsonObj.get("Patents") != null && !jsonObj.get("Patents").isJsonNull()) { + JsonArray jsonArraypatents = jsonObj.getAsJsonArray("Patents"); + if (jsonArraypatents != null) { + // ensure the json data is an array + if (!jsonObj.get("Patents").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Patents` to be an array in the JSON string but got `%s`", jsonObj.get("Patents").toString())); + } + + // validate the optional field `Patents` (array) + for (int i = 0; i < jsonArraypatents.size(); i++) { + ProfileRequestModelPatentsInner.validateJsonElement(jsonArraypatents.get(i)); + }; + } + } + if (jsonObj.get("FavoriteThings") != null && !jsonObj.get("FavoriteThings").isJsonNull()) { + JsonArray jsonArrayfavoriteThings = jsonObj.getAsJsonArray("FavoriteThings"); + if (jsonArrayfavoriteThings != null) { + // ensure the json data is an array + if (!jsonObj.get("FavoriteThings").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `FavoriteThings` to be an array in the JSON string but got `%s`", jsonObj.get("FavoriteThings").toString())); + } + + // validate the optional field `FavoriteThings` (array) + for (int i = 0; i < jsonArrayfavoriteThings.size(); i++) { + ProfileRequestModelFavoriteThingsInner.validateJsonElement(jsonArrayfavoriteThings.get(i)); + }; + } + } + if (jsonObj.get("RelatedProfileViews") != null && !jsonObj.get("RelatedProfileViews").isJsonNull()) { + JsonArray jsonArrayrelatedProfileViews = jsonObj.getAsJsonArray("RelatedProfileViews"); + if (jsonArrayrelatedProfileViews != null) { + // ensure the json data is an array + if (!jsonObj.get("RelatedProfileViews").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RelatedProfileViews` to be an array in the JSON string but got `%s`", jsonObj.get("RelatedProfileViews").toString())); + } + + // validate the optional field `RelatedProfileViews` (array) + for (int i = 0; i < jsonArrayrelatedProfileViews.size(); i++) { + ProfileRequestModelRelatedProfileViewsInner.validateJsonElement(jsonArrayrelatedProfileViews.get(i)); + }; + } + } + if (jsonObj.get("PlacesLived") != null && !jsonObj.get("PlacesLived").isJsonNull()) { + JsonArray jsonArrayplacesLived = jsonObj.getAsJsonArray("PlacesLived"); + if (jsonArrayplacesLived != null) { + // ensure the json data is an array + if (!jsonObj.get("PlacesLived").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PlacesLived` to be an array in the JSON string but got `%s`", jsonObj.get("PlacesLived").toString())); + } + + // validate the optional field `PlacesLived` (array) + for (int i = 0; i < jsonArrayplacesLived.size(); i++) { + ProfileRequestModelPlacesLivedInner.validateJsonElement(jsonArrayplacesLived.get(i)); + }; + } + } + if (jsonObj.get("Publications") != null && !jsonObj.get("Publications").isJsonNull()) { + JsonArray jsonArraypublications = jsonObj.getAsJsonArray("Publications"); + if (jsonArraypublications != null) { + // ensure the json data is an array + if (!jsonObj.get("Publications").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Publications` to be an array in the JSON string but got `%s`", jsonObj.get("Publications").toString())); + } + + // validate the optional field `Publications` (array) + for (int i = 0; i < jsonArraypublications.size(); i++) { + ProfileRequestModelPublicationsInner.validateJsonElement(jsonArraypublications.get(i)); + }; + } + } + if (jsonObj.get("JobBookmarks") != null && !jsonObj.get("JobBookmarks").isJsonNull()) { + JsonArray jsonArrayjobBookmarks = jsonObj.getAsJsonArray("JobBookmarks"); + if (jsonArrayjobBookmarks != null) { + // ensure the json data is an array + if (!jsonObj.get("JobBookmarks").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `JobBookmarks` to be an array in the JSON string but got `%s`", jsonObj.get("JobBookmarks").toString())); + } + + // validate the optional field `JobBookmarks` (array) + for (int i = 0; i < jsonArrayjobBookmarks.size(); i++) { + ProfileRequestModelJobBookmarksInner.validateJsonElement(jsonArrayjobBookmarks.get(i)); + }; + } + } + if (jsonObj.get("Badges") != null && !jsonObj.get("Badges").isJsonNull()) { + JsonArray jsonArraybadges = jsonObj.getAsJsonArray("Badges"); + if (jsonArraybadges != null) { + // ensure the json data is an array + if (!jsonObj.get("Badges").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Badges` to be an array in the JSON string but got `%s`", jsonObj.get("Badges").toString())); + } + + // validate the optional field `Badges` (array) + for (int i = 0; i < jsonArraybadges.size(); i++) { + ProfileRequestModelBadgesInner.validateJsonElement(jsonArraybadges.get(i)); + }; + } + } + if (jsonObj.get("MemberUrlResources") != null && !jsonObj.get("MemberUrlResources").isJsonNull()) { + JsonArray jsonArraymemberUrlResources = jsonObj.getAsJsonArray("MemberUrlResources"); + if (jsonArraymemberUrlResources != null) { + // ensure the json data is an array + if (!jsonObj.get("MemberUrlResources").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `MemberUrlResources` to be an array in the JSON string but got `%s`", jsonObj.get("MemberUrlResources").toString())); + } + + // validate the optional field `MemberUrlResources` (array) + for (int i = 0; i < jsonArraymemberUrlResources.size(); i++) { + ProfileRequestModelMemberUrlResourcesInner.validateJsonElement(jsonArraymemberUrlResources.get(i)); + }; + } + } + if (jsonObj.get("ExternalIds") != null && !jsonObj.get("ExternalIds").isJsonNull()) { + JsonArray jsonArrayexternalIds = jsonObj.getAsJsonArray("ExternalIds"); + if (jsonArrayexternalIds != null) { + // ensure the json data is an array + if (!jsonObj.get("ExternalIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ExternalIds` to be an array in the JSON string but got `%s`", jsonObj.get("ExternalIds").toString())); + } + + // validate the optional field `ExternalIds` (array) + for (int i = 0; i < jsonArrayexternalIds.size(); i++) { + ProfileRequestModelExternalIdsInner.validateJsonElement(jsonArrayexternalIds.get(i)); + }; + } + } + if ((jsonObj.get("RegistrationSource") != null && !jsonObj.get("RegistrationSource").isJsonNull()) && !jsonObj.get("RegistrationSource").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RegistrationSource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RegistrationSource").toString())); + } + if ((jsonObj.get("FullName") != null && !jsonObj.get("FullName").isJsonNull()) && !jsonObj.get("FullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FullName").toString())); + } + // validate the optional field `Consents` + if (jsonObj.get("Consents") != null && !jsonObj.get("Consents").isJsonNull()) { + ProfileRequestModelConsents.validateJsonElement(jsonObj.get("Consents")); + } + if (jsonObj.get("Email") != null && !jsonObj.get("Email").isJsonNull()) { + JsonArray jsonArrayemail = jsonObj.getAsJsonArray("Email"); + if (jsonArrayemail != null) { + // ensure the json data is an array + if (!jsonObj.get("Email").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Email` to be an array in the JSON string but got `%s`", jsonObj.get("Email").toString())); + } + + // validate the optional field `Email` (array) + for (int i = 0; i < jsonArrayemail.size(); i++) { + ProfileRequestModelEmailInner.validateJsonElement(jsonArrayemail.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestEmailOnly.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestEmailOnly' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestEmailOnly> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestEmailOnly.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestEmailOnly>() { + @Override + public void write(JsonWriter out, ProfileRequestEmailOnly value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestEmailOnly read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestEmailOnly instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestEmailOnly given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestEmailOnly + * @throws IOException if the JSON string is invalid with respect to ProfileRequestEmailOnly + */ + public static ProfileRequestEmailOnly fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestEmailOnly.class); + } + + /** + * Convert an instance of ProfileRequestEmailOnly to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModel.java new file mode 100644 index 0000000..9f39aed --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModel.java @@ -0,0 +1,4326 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProfileRequestModelAddressesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelAwardsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelBadgesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelBooksInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelCaptchaModel; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelCertificationsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelConsents; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelCountry; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelCoursesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelCurrentStatusInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelEducationsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelEmailInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelExternalIdsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelFamilyInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelFavoriteThingsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelGamesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelIMAccountsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelInspirationalPeopleInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelInterestsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelJobBookmarksInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelLanguagesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelMemberUrlResourcesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelMoviesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelMutualFriendsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPINInfo; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPatentsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPhoneNumbersInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPlacesLivedInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPositionsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPrivacyPolicy; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelProjectsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelProviderAccessCredential; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPublicationsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelRecommendationsReceivedInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelRelatedProfileViewsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSkillsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSportsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSubscription; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSuggestions; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelTeleVisionShowInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelVolunteerInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModel { + public static final String SERIALIZED_NAME_USER_NAME = "UserName"; + @SerializedName(SERIALIZED_NAME_USER_NAME) + @javax.annotation.Nullable + private String userName; + + public static final String SERIALIZED_NAME_PHONE_ID = "PhoneId"; + @SerializedName(SERIALIZED_NAME_PHONE_ID) + @javax.annotation.Nullable + private String phoneId; + + public static final String SERIALIZED_NAME_GENDER = "Gender"; + @SerializedName(SERIALIZED_NAME_GENDER) + @javax.annotation.Nullable + private String gender; + + public static final String SERIALIZED_NAME_BIRTH_DATE = "BirthDate"; + @SerializedName(SERIALIZED_NAME_BIRTH_DATE) + @javax.annotation.Nullable + private String birthDate; + + public static final String SERIALIZED_NAME_PREFIX = "Prefix"; + @SerializedName(SERIALIZED_NAME_PREFIX) + @javax.annotation.Nullable + private String prefix; + + public static final String SERIALIZED_NAME_FIRST_NAME = "FirstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nullable + private String firstName; + + public static final String SERIALIZED_NAME_MIDDLE_NAME = "MiddleName"; + @SerializedName(SERIALIZED_NAME_MIDDLE_NAME) + @javax.annotation.Nullable + private String middleName; + + public static final String SERIALIZED_NAME_LAST_NAME = "LastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nullable + private String lastName; + + public static final String SERIALIZED_NAME_SUFFIX = "Suffix"; + @SerializedName(SERIALIZED_NAME_SUFFIX) + @javax.annotation.Nullable + private String suffix; + + public static final String SERIALIZED_NAME_NICK_NAME = "NickName"; + @SerializedName(SERIALIZED_NAME_NICK_NAME) + @javax.annotation.Nullable + private String nickName; + + public static final String SERIALIZED_NAME_PROFILE_NAME = "ProfileName"; + @SerializedName(SERIALIZED_NAME_PROFILE_NAME) + @javax.annotation.Nullable + private String profileName; + + public static final String SERIALIZED_NAME_ABOUT = "About"; + @SerializedName(SERIALIZED_NAME_ABOUT) + @javax.annotation.Nullable + private String about; + + public static final String SERIALIZED_NAME_COMPANY = "Company"; + @SerializedName(SERIALIZED_NAME_COMPANY) + @javax.annotation.Nullable + private String company; + + public static final String SERIALIZED_NAME_IMAGE_URL = "ImageUrl"; + @SerializedName(SERIALIZED_NAME_IMAGE_URL) + @javax.annotation.Nullable + private String imageUrl; + + public static final String SERIALIZED_NAME_TIME_ZONE = "TimeZone"; + @SerializedName(SERIALIZED_NAME_TIME_ZONE) + @javax.annotation.Nullable + private String timeZone; + + public static final String SERIALIZED_NAME_WEBSITE = "Website"; + @SerializedName(SERIALIZED_NAME_WEBSITE) + @javax.annotation.Nullable + private String website; + + public static final String SERIALIZED_NAME_THUMBNAIL_IMAGE_URL = "ThumbnailImageUrl"; + @SerializedName(SERIALIZED_NAME_THUMBNAIL_IMAGE_URL) + @javax.annotation.Nullable + private String thumbnailImageUrl; + + public static final String SERIALIZED_NAME_FAVICON = "Favicon"; + @SerializedName(SERIALIZED_NAME_FAVICON) + @javax.annotation.Nullable + private String favicon; + + public static final String SERIALIZED_NAME_PROFILE_URL = "ProfileUrl"; + @SerializedName(SERIALIZED_NAME_PROFILE_URL) + @javax.annotation.Nullable + private String profileUrl; + + public static final String SERIALIZED_NAME_HOME_TOWN = "HomeTown"; + @SerializedName(SERIALIZED_NAME_HOME_TOWN) + @javax.annotation.Nullable + private String homeTown; + + public static final String SERIALIZED_NAME_STATE = "State"; + @SerializedName(SERIALIZED_NAME_STATE) + @javax.annotation.Nullable + private String state; + + public static final String SERIALIZED_NAME_CITY = "City"; + @SerializedName(SERIALIZED_NAME_CITY) + @javax.annotation.Nullable + private String city; + + public static final String SERIALIZED_NAME_INDUSTRY = "Industry"; + @SerializedName(SERIALIZED_NAME_INDUSTRY) + @javax.annotation.Nullable + private String industry; + + public static final String SERIALIZED_NAME_LOCAL_LANGUAGE = "LocalLanguage"; + @SerializedName(SERIALIZED_NAME_LOCAL_LANGUAGE) + @javax.annotation.Nullable + private String localLanguage; + + public static final String SERIALIZED_NAME_LANGUAGE = "Language"; + @SerializedName(SERIALIZED_NAME_LANGUAGE) + @javax.annotation.Nullable + private String language; + + public static final String SERIALIZED_NAME_COVER_PHOTO = "CoverPhoto"; + @SerializedName(SERIALIZED_NAME_COVER_PHOTO) + @javax.annotation.Nullable + private String coverPhoto; + + public static final String SERIALIZED_NAME_TAG_LINE = "TagLine"; + @SerializedName(SERIALIZED_NAME_TAG_LINE) + @javax.annotation.Nullable + private String tagLine; + + public static final String SERIALIZED_NAME_MAIN_ADDRESS = "MainAddress"; + @SerializedName(SERIALIZED_NAME_MAIN_ADDRESS) + @javax.annotation.Nullable + private String mainAddress; + + public static final String SERIALIZED_NAME_LOCAL_CITY = "LocalCity"; + @SerializedName(SERIALIZED_NAME_LOCAL_CITY) + @javax.annotation.Nullable + private String localCity; + + public static final String SERIALIZED_NAME_PROFILE_CITY = "ProfileCity"; + @SerializedName(SERIALIZED_NAME_PROFILE_CITY) + @javax.annotation.Nullable + private String profileCity; + + public static final String SERIALIZED_NAME_LOCAL_COUNTRY = "LocalCountry"; + @SerializedName(SERIALIZED_NAME_LOCAL_COUNTRY) + @javax.annotation.Nullable + private String localCountry; + + public static final String SERIALIZED_NAME_PROFILE_COUNTRY = "ProfileCountry"; + @SerializedName(SERIALIZED_NAME_PROFILE_COUNTRY) + @javax.annotation.Nullable + private String profileCountry; + + public static final String SERIALIZED_NAME_QUOTA = "Quota"; + @SerializedName(SERIALIZED_NAME_QUOTA) + @javax.annotation.Nullable + private String quota; + + public static final String SERIALIZED_NAME_RELIGION = "Religion"; + @SerializedName(SERIALIZED_NAME_RELIGION) + @javax.annotation.Nullable + private String religion; + + public static final String SERIALIZED_NAME_POLITICAL = "Political"; + @SerializedName(SERIALIZED_NAME_POLITICAL) + @javax.annotation.Nullable + private String political; + + public static final String SERIALIZED_NAME_RELATIONSHIP_STATUS = "RelationshipStatus"; + @SerializedName(SERIALIZED_NAME_RELATIONSHIP_STATUS) + @javax.annotation.Nullable + private String relationshipStatus; + + public static final String SERIALIZED_NAME_HTTPS_IMAGE_URL = "HttpsImageUrl"; + @SerializedName(SERIALIZED_NAME_HTTPS_IMAGE_URL) + @javax.annotation.Nullable + private String httpsImageUrl; + + public static final String SERIALIZED_NAME_IS_GEO_ENABLED = "IsGeoEnabled"; + @SerializedName(SERIALIZED_NAME_IS_GEO_ENABLED) + @javax.annotation.Nullable + private String isGeoEnabled; + + public static final String SERIALIZED_NAME_ASSOCIATIONS = "Associations"; + @SerializedName(SERIALIZED_NAME_ASSOCIATIONS) + @javax.annotation.Nullable + private String associations; + + public static final String SERIALIZED_NAME_HONORS = "Honors"; + @SerializedName(SERIALIZED_NAME_HONORS) + @javax.annotation.Nullable + private String honors; + + public static final String SERIALIZED_NAME_PUBLIC_REPOSITORY = "PublicRepository"; + @SerializedName(SERIALIZED_NAME_PUBLIC_REPOSITORY) + @javax.annotation.Nullable + private String publicRepository; + + public static final String SERIALIZED_NAME_REPOSITORY_URL = "RepositoryUrl"; + @SerializedName(SERIALIZED_NAME_REPOSITORY_URL) + @javax.annotation.Nullable + private String repositoryUrl; + + public static final String SERIALIZED_NAME_PROFESSIONAL_HEADLINE = "ProfessionalHeadline"; + @SerializedName(SERIALIZED_NAME_PROFESSIONAL_HEADLINE) + @javax.annotation.Nullable + private String professionalHeadline; + + public static final String SERIALIZED_NAME_CURRENCY = "Currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + @javax.annotation.Nullable + private String currency; + + public static final String SERIALIZED_NAME_STARRED_URL = "StarredUrl"; + @SerializedName(SERIALIZED_NAME_STARRED_URL) + @javax.annotation.Nullable + private String starredUrl; + + public static final String SERIALIZED_NAME_GISTS_URL = "GistsUrl"; + @SerializedName(SERIALIZED_NAME_GISTS_URL) + @javax.annotation.Nullable + private String gistsUrl; + + public static final String SERIALIZED_NAME_GRAVATAR_IMAGE_URL = "GravatarImageUrl"; + @SerializedName(SERIALIZED_NAME_GRAVATAR_IMAGE_URL) + @javax.annotation.Nullable + private String gravatarImageUrl; + + public static final String SERIALIZED_NAME_EXTERNAL_USER_LOGIN_ID = "ExternalUserLoginId"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_USER_LOGIN_ID) + @javax.annotation.Nullable + private String externalUserLoginId; + + public static final String SERIALIZED_NAME_INTERESTED_IN = "InterestedIn"; + @SerializedName(SERIALIZED_NAME_INTERESTED_IN) + @javax.annotation.Nullable + private List<String> interestedIn = new ArrayList<>(); + + public static final String SERIALIZED_NAME_FOLLOWERS_COUNT = "FollowersCount"; + @SerializedName(SERIALIZED_NAME_FOLLOWERS_COUNT) + @javax.annotation.Nullable + private Integer followersCount; + + public static final String SERIALIZED_NAME_FRIENDS_COUNT = "FriendsCount"; + @SerializedName(SERIALIZED_NAME_FRIENDS_COUNT) + @javax.annotation.Nullable + private Integer friendsCount; + + public static final String SERIALIZED_NAME_TOTAL_STATUSES_COUNT = "TotalStatusesCount"; + @SerializedName(SERIALIZED_NAME_TOTAL_STATUSES_COUNT) + @javax.annotation.Nullable + private Integer totalStatusesCount; + + public static final String SERIALIZED_NAME_NUM_RECOMMENDERS = "NumRecommenders"; + @SerializedName(SERIALIZED_NAME_NUM_RECOMMENDERS) + @javax.annotation.Nullable + private Integer numRecommenders; + + public static final String SERIALIZED_NAME_TOTAL_PRIVATE_REPOSITORY = "TotalPrivateRepository"; + @SerializedName(SERIALIZED_NAME_TOTAL_PRIVATE_REPOSITORY) + @javax.annotation.Nullable + private Integer totalPrivateRepository; + + public static final String SERIALIZED_NAME_PUBLIC_GISTS = "PublicGists"; + @SerializedName(SERIALIZED_NAME_PUBLIC_GISTS) + @javax.annotation.Nullable + private Integer publicGists; + + public static final String SERIALIZED_NAME_PRIVATE_GISTS = "PrivateGists"; + @SerializedName(SERIALIZED_NAME_PRIVATE_GISTS) + @javax.annotation.Nullable + private Integer privateGists; + + public static final String SERIALIZED_NAME_SESSION_LIMIT = "SessionLimit"; + @SerializedName(SERIALIZED_NAME_SESSION_LIMIT) + @javax.annotation.Nullable + private Integer sessionLimit; + + public static final String SERIALIZED_NAME_CUSTOM_FIELDS = "CustomFields"; + @SerializedName(SERIALIZED_NAME_CUSTOM_FIELDS) + @javax.annotation.Nullable + private Map<String, String> customFields = new HashMap<>(); + + public static final String SERIALIZED_NAME_PROFILE_IMAGE_URLS = "ProfileImageUrls"; + @SerializedName(SERIALIZED_NAME_PROFILE_IMAGE_URLS) + @javax.annotation.Nullable + private Map<String, String> profileImageUrls = new HashMap<>(); + + public static final String SERIALIZED_NAME_WEB_PROFILES = "WebProfiles"; + @SerializedName(SERIALIZED_NAME_WEB_PROFILES) + @javax.annotation.Nullable + private Map<String, String> webProfiles = new HashMap<>(); + + public static final String SERIALIZED_NAME_SECURITY_QUESTION_ANSWER = "SecurityQuestionAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_QUESTION_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityQuestionAnswer = new HashMap<>(); + + public static final String SERIALIZED_NAME_COUNTRY = "Country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + @javax.annotation.Nullable + private ProfileRequestModelCountry country; + + public static final String SERIALIZED_NAME_PROVIDER_ACCESS_CREDENTIAL = "ProviderAccessCredential"; + @SerializedName(SERIALIZED_NAME_PROVIDER_ACCESS_CREDENTIAL) + @javax.annotation.Nullable + private ProfileRequestModelProviderAccessCredential providerAccessCredential; + + public static final String SERIALIZED_NAME_SUGGESTIONS = "Suggestions"; + @SerializedName(SERIALIZED_NAME_SUGGESTIONS) + @javax.annotation.Nullable + private ProfileRequestModelSuggestions suggestions; + + public static final String SERIALIZED_NAME_SUBSCRIPTION = "Subscription"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION) + @javax.annotation.Nullable + private ProfileRequestModelSubscription subscription; + + public static final String SERIALIZED_NAME_PRIVACY_POLICY = "PrivacyPolicy"; + @SerializedName(SERIALIZED_NAME_PRIVACY_POLICY) + @javax.annotation.Nullable + private ProfileRequestModelPrivacyPolicy privacyPolicy; + + public static final String SERIALIZED_NAME_PI_N_INFO = "PINInfo"; + @SerializedName(SERIALIZED_NAME_PI_N_INFO) + @javax.annotation.Nullable + private ProfileRequestModelPINInfo piNInfo; + + public static final String SERIALIZED_NAME_ADDRESSES = "Addresses"; + @SerializedName(SERIALIZED_NAME_ADDRESSES) + @javax.annotation.Nullable + private List<ProfileRequestModelAddressesInner> addresses = new ArrayList<>(); + + public static final String SERIALIZED_NAME_POSITIONS = "Positions"; + @SerializedName(SERIALIZED_NAME_POSITIONS) + @javax.annotation.Nullable + private List<ProfileRequestModelPositionsInner> positions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_EDUCATIONS = "Educations"; + @SerializedName(SERIALIZED_NAME_EDUCATIONS) + @javax.annotation.Nullable + private List<ProfileRequestModelEducationsInner> educations = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PHONE_NUMBERS = "PhoneNumbers"; + @SerializedName(SERIALIZED_NAME_PHONE_NUMBERS) + @javax.annotation.Nullable + private List<ProfileRequestModelPhoneNumbersInner> phoneNumbers = new ArrayList<>(); + + public static final String SERIALIZED_NAME_IM_ACCOUNTS = "IMAccounts"; + @SerializedName(SERIALIZED_NAME_IM_ACCOUNTS) + @javax.annotation.Nullable + private List<ProfileRequestModelIMAccountsInner> imAccounts = new ArrayList<>(); + + public static final String SERIALIZED_NAME_INTERESTS = "Interests"; + @SerializedName(SERIALIZED_NAME_INTERESTS) + @javax.annotation.Nullable + private List<ProfileRequestModelInterestsInner> interests = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SPORTS = "Sports"; + @SerializedName(SERIALIZED_NAME_SPORTS) + @javax.annotation.Nullable + private List<ProfileRequestModelSportsInner> sports = new ArrayList<>(); + + public static final String SERIALIZED_NAME_INSPIRATIONAL_PEOPLE = "InspirationalPeople"; + @SerializedName(SERIALIZED_NAME_INSPIRATIONAL_PEOPLE) + @javax.annotation.Nullable + private List<ProfileRequestModelInspirationalPeopleInner> inspirationalPeople = new ArrayList<>(); + + public static final String SERIALIZED_NAME_AWARDS = "Awards"; + @SerializedName(SERIALIZED_NAME_AWARDS) + @javax.annotation.Nullable + private List<ProfileRequestModelAwardsInner> awards = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SKILLS = "Skills"; + @SerializedName(SERIALIZED_NAME_SKILLS) + @javax.annotation.Nullable + private List<ProfileRequestModelSkillsInner> skills = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CURRENT_STATUS = "CurrentStatus"; + @SerializedName(SERIALIZED_NAME_CURRENT_STATUS) + @javax.annotation.Nullable + private List<ProfileRequestModelCurrentStatusInner> currentStatus = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CERTIFICATIONS = "Certifications"; + @SerializedName(SERIALIZED_NAME_CERTIFICATIONS) + @javax.annotation.Nullable + private List<ProfileRequestModelCertificationsInner> certifications = new ArrayList<>(); + + public static final String SERIALIZED_NAME_COURSES = "Courses"; + @SerializedName(SERIALIZED_NAME_COURSES) + @javax.annotation.Nullable + private List<ProfileRequestModelCoursesInner> courses = new ArrayList<>(); + + public static final String SERIALIZED_NAME_VOLUNTEER = "Volunteer"; + @SerializedName(SERIALIZED_NAME_VOLUNTEER) + @javax.annotation.Nullable + private List<ProfileRequestModelVolunteerInner> volunteer = new ArrayList<>(); + + public static final String SERIALIZED_NAME_RECOMMENDATIONS_RECEIVED = "RecommendationsReceived"; + @SerializedName(SERIALIZED_NAME_RECOMMENDATIONS_RECEIVED) + @javax.annotation.Nullable + private List<ProfileRequestModelRecommendationsReceivedInner> recommendationsReceived = new ArrayList<>(); + + public static final String SERIALIZED_NAME_LANGUAGES = "Languages"; + @SerializedName(SERIALIZED_NAME_LANGUAGES) + @javax.annotation.Nullable + private List<ProfileRequestModelLanguagesInner> languages = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PROJECTS = "Projects"; + @SerializedName(SERIALIZED_NAME_PROJECTS) + @javax.annotation.Nullable + private List<ProfileRequestModelProjectsInner> projects = new ArrayList<>(); + + public static final String SERIALIZED_NAME_GAMES = "Games"; + @SerializedName(SERIALIZED_NAME_GAMES) + @javax.annotation.Nullable + private List<ProfileRequestModelGamesInner> games = new ArrayList<>(); + + public static final String SERIALIZED_NAME_FAMILY = "Family"; + @SerializedName(SERIALIZED_NAME_FAMILY) + @javax.annotation.Nullable + private List<ProfileRequestModelFamilyInner> family = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TELE_VISION_SHOW = "TeleVisionShow"; + @SerializedName(SERIALIZED_NAME_TELE_VISION_SHOW) + @javax.annotation.Nullable + private List<ProfileRequestModelTeleVisionShowInner> teleVisionShow = new ArrayList<>(); + + public static final String SERIALIZED_NAME_MUTUAL_FRIENDS = "MutualFriends"; + @SerializedName(SERIALIZED_NAME_MUTUAL_FRIENDS) + @javax.annotation.Nullable + private List<ProfileRequestModelMutualFriendsInner> mutualFriends = new ArrayList<>(); + + public static final String SERIALIZED_NAME_MOVIES = "Movies"; + @SerializedName(SERIALIZED_NAME_MOVIES) + @javax.annotation.Nullable + private List<ProfileRequestModelMoviesInner> movies = new ArrayList<>(); + + public static final String SERIALIZED_NAME_BOOKS = "Books"; + @SerializedName(SERIALIZED_NAME_BOOKS) + @javax.annotation.Nullable + private List<ProfileRequestModelBooksInner> books = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PATENTS = "Patents"; + @SerializedName(SERIALIZED_NAME_PATENTS) + @javax.annotation.Nullable + private List<ProfileRequestModelPatentsInner> patents = new ArrayList<>(); + + public static final String SERIALIZED_NAME_FAVORITE_THINGS = "FavoriteThings"; + @SerializedName(SERIALIZED_NAME_FAVORITE_THINGS) + @javax.annotation.Nullable + private List<ProfileRequestModelFavoriteThingsInner> favoriteThings = new ArrayList<>(); + + public static final String SERIALIZED_NAME_RELATED_PROFILE_VIEWS = "RelatedProfileViews"; + @SerializedName(SERIALIZED_NAME_RELATED_PROFILE_VIEWS) + @javax.annotation.Nullable + private List<ProfileRequestModelRelatedProfileViewsInner> relatedProfileViews = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PLACES_LIVED = "PlacesLived"; + @SerializedName(SERIALIZED_NAME_PLACES_LIVED) + @javax.annotation.Nullable + private List<ProfileRequestModelPlacesLivedInner> placesLived = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PUBLICATIONS = "Publications"; + @SerializedName(SERIALIZED_NAME_PUBLICATIONS) + @javax.annotation.Nullable + private List<ProfileRequestModelPublicationsInner> publications = new ArrayList<>(); + + public static final String SERIALIZED_NAME_JOB_BOOKMARKS = "JobBookmarks"; + @SerializedName(SERIALIZED_NAME_JOB_BOOKMARKS) + @javax.annotation.Nullable + private List<ProfileRequestModelJobBookmarksInner> jobBookmarks = new ArrayList<>(); + + public static final String SERIALIZED_NAME_BADGES = "Badges"; + @SerializedName(SERIALIZED_NAME_BADGES) + @javax.annotation.Nullable + private List<ProfileRequestModelBadgesInner> badges = new ArrayList<>(); + + public static final String SERIALIZED_NAME_MEMBER_URL_RESOURCES = "MemberUrlResources"; + @SerializedName(SERIALIZED_NAME_MEMBER_URL_RESOURCES) + @javax.annotation.Nullable + private List<ProfileRequestModelMemberUrlResourcesInner> memberUrlResources = new ArrayList<>(); + + public static final String SERIALIZED_NAME_EXTERNAL_IDS = "ExternalIds"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_IDS) + @javax.annotation.Nullable + private List<ProfileRequestModelExternalIdsInner> externalIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_IS_EMAIL_SUBSCRIBED = "IsEmailSubscribed"; + @SerializedName(SERIALIZED_NAME_IS_EMAIL_SUBSCRIBED) + @javax.annotation.Nullable + private Boolean isEmailSubscribed; + + public static final String SERIALIZED_NAME_IS_PROTECTED = "IsProtected"; + @SerializedName(SERIALIZED_NAME_IS_PROTECTED) + @javax.annotation.Nullable + private Boolean isProtected; + + public static final String SERIALIZED_NAME_HIREABLE = "Hireable"; + @SerializedName(SERIALIZED_NAME_HIREABLE) + @javax.annotation.Nullable + private Boolean hireable; + + public static final String SERIALIZED_NAME_IS_TWO_FACTOR_AUTHENTICATION_ENABLED = "IsTwoFactorAuthenticationEnabled"; + @SerializedName(SERIALIZED_NAME_IS_TWO_FACTOR_AUTHENTICATION_ENABLED) + @javax.annotation.Nullable + private Boolean isTwoFactorAuthenticationEnabled; + + public static final String SERIALIZED_NAME_DISABLE_LOGIN = "DisableLogin"; + @SerializedName(SERIALIZED_NAME_DISABLE_LOGIN) + @javax.annotation.Nullable + private Boolean disableLogin; + + public static final String SERIALIZED_NAME_ACCEPT_PRIVACY_POLICY = "AcceptPrivacyPolicy"; + @SerializedName(SERIALIZED_NAME_ACCEPT_PRIVACY_POLICY) + @javax.annotation.Nullable + private Boolean acceptPrivacyPolicy; + + public static final String SERIALIZED_NAME_RECAPTCHA_RESPONSE_FIELD = "recaptcha_response_field"; + @SerializedName(SERIALIZED_NAME_RECAPTCHA_RESPONSE_FIELD) + @javax.annotation.Nullable + private String recaptchaResponseField; + + public static final String SERIALIZED_NAME_RECAPTCHA_CHALLENGE_FIELD = "recaptcha_challenge_field"; + @SerializedName(SERIALIZED_NAME_RECAPTCHA_CHALLENGE_FIELD) + @javax.annotation.Nullable + private String recaptchaChallengeField; + + public static final String SERIALIZED_NAME_CAPTCHA_MODEL = "CaptchaModel"; + @SerializedName(SERIALIZED_NAME_CAPTCHA_MODEL) + @javax.annotation.Nullable + private ProfileRequestModelCaptchaModel captchaModel; + + public static final String SERIALIZED_NAME_REGISTRATION_SOURCE = "RegistrationSource"; + @SerializedName(SERIALIZED_NAME_REGISTRATION_SOURCE) + @javax.annotation.Nullable + private String registrationSource; + + 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_CONSENTS = "Consents"; + @SerializedName(SERIALIZED_NAME_CONSENTS) + @javax.annotation.Nullable + private ProfileRequestModelConsents consents; + + public static final String SERIALIZED_NAME_PASSWORD = "Password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nullable + private String password; + + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private List<ProfileRequestModelEmailInner> email = new ArrayList<>(); + + public ProfileRequestModel() { + } + + public ProfileRequestModel userName(@javax.annotation.Nullable String userName) { + this.userName = userName; + return this; + } + + /** + * Get userName + * @return userName + */ + @javax.annotation.Nullable + public String getUserName() { + return userName; + } + + public void setUserName(@javax.annotation.Nullable String userName) { + this.userName = userName; + } + + + public ProfileRequestModel phoneId(@javax.annotation.Nullable String phoneId) { + this.phoneId = phoneId; + return this; + } + + /** + * Get phoneId + * @return phoneId + */ + @javax.annotation.Nullable + public String getPhoneId() { + return phoneId; + } + + public void setPhoneId(@javax.annotation.Nullable String phoneId) { + this.phoneId = phoneId; + } + + + public ProfileRequestModel gender(@javax.annotation.Nullable String gender) { + this.gender = gender; + return this; + } + + /** + * Get gender + * @return gender + */ + @javax.annotation.Nullable + public String getGender() { + return gender; + } + + public void setGender(@javax.annotation.Nullable String gender) { + this.gender = gender; + } + + + public ProfileRequestModel birthDate(@javax.annotation.Nullable String birthDate) { + this.birthDate = birthDate; + return this; + } + + /** + * Get birthDate + * @return birthDate + */ + @javax.annotation.Nullable + public String getBirthDate() { + return birthDate; + } + + public void setBirthDate(@javax.annotation.Nullable String birthDate) { + this.birthDate = birthDate; + } + + + public ProfileRequestModel prefix(@javax.annotation.Nullable String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Get prefix + * @return prefix + */ + @javax.annotation.Nullable + public String getPrefix() { + return prefix; + } + + public void setPrefix(@javax.annotation.Nullable String prefix) { + this.prefix = prefix; + } + + + public ProfileRequestModel firstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + */ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + } + + + public ProfileRequestModel middleName(@javax.annotation.Nullable String middleName) { + this.middleName = middleName; + return this; + } + + /** + * Get middleName + * @return middleName + */ + @javax.annotation.Nullable + public String getMiddleName() { + return middleName; + } + + public void setMiddleName(@javax.annotation.Nullable String middleName) { + this.middleName = middleName; + } + + + public ProfileRequestModel lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + + public ProfileRequestModel suffix(@javax.annotation.Nullable String suffix) { + this.suffix = suffix; + return this; + } + + /** + * Get suffix + * @return suffix + */ + @javax.annotation.Nullable + public String getSuffix() { + return suffix; + } + + public void setSuffix(@javax.annotation.Nullable String suffix) { + this.suffix = suffix; + } + + + public ProfileRequestModel nickName(@javax.annotation.Nullable String nickName) { + this.nickName = nickName; + return this; + } + + /** + * Get nickName + * @return nickName + */ + @javax.annotation.Nullable + public String getNickName() { + return nickName; + } + + public void setNickName(@javax.annotation.Nullable String nickName) { + this.nickName = nickName; + } + + + public ProfileRequestModel profileName(@javax.annotation.Nullable String profileName) { + this.profileName = profileName; + return this; + } + + /** + * Get profileName + * @return profileName + */ + @javax.annotation.Nullable + public String getProfileName() { + return profileName; + } + + public void setProfileName(@javax.annotation.Nullable String profileName) { + this.profileName = profileName; + } + + + public ProfileRequestModel about(@javax.annotation.Nullable String about) { + this.about = about; + return this; + } + + /** + * Get about + * @return about + */ + @javax.annotation.Nullable + public String getAbout() { + return about; + } + + public void setAbout(@javax.annotation.Nullable String about) { + this.about = about; + } + + + public ProfileRequestModel company(@javax.annotation.Nullable String company) { + this.company = company; + return this; + } + + /** + * Get company + * @return company + */ + @javax.annotation.Nullable + public String getCompany() { + return company; + } + + public void setCompany(@javax.annotation.Nullable String company) { + this.company = company; + } + + + public ProfileRequestModel imageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** + * Get imageUrl + * @return imageUrl + */ + @javax.annotation.Nullable + public String getImageUrl() { + return imageUrl; + } + + public void setImageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + } + + + public ProfileRequestModel timeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * Get timeZone + * @return timeZone + */ + @javax.annotation.Nullable + public String getTimeZone() { + return timeZone; + } + + public void setTimeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + } + + + public ProfileRequestModel website(@javax.annotation.Nullable String website) { + this.website = website; + return this; + } + + /** + * Get website + * @return website + */ + @javax.annotation.Nullable + public String getWebsite() { + return website; + } + + public void setWebsite(@javax.annotation.Nullable String website) { + this.website = website; + } + + + public ProfileRequestModel thumbnailImageUrl(@javax.annotation.Nullable String thumbnailImageUrl) { + this.thumbnailImageUrl = thumbnailImageUrl; + return this; + } + + /** + * Get thumbnailImageUrl + * @return thumbnailImageUrl + */ + @javax.annotation.Nullable + public String getThumbnailImageUrl() { + return thumbnailImageUrl; + } + + public void setThumbnailImageUrl(@javax.annotation.Nullable String thumbnailImageUrl) { + this.thumbnailImageUrl = thumbnailImageUrl; + } + + + public ProfileRequestModel favicon(@javax.annotation.Nullable String favicon) { + this.favicon = favicon; + return this; + } + + /** + * Get favicon + * @return favicon + */ + @javax.annotation.Nullable + public String getFavicon() { + return favicon; + } + + public void setFavicon(@javax.annotation.Nullable String favicon) { + this.favicon = favicon; + } + + + public ProfileRequestModel profileUrl(@javax.annotation.Nullable String profileUrl) { + this.profileUrl = profileUrl; + return this; + } + + /** + * Get profileUrl + * @return profileUrl + */ + @javax.annotation.Nullable + public String getProfileUrl() { + return profileUrl; + } + + public void setProfileUrl(@javax.annotation.Nullable String profileUrl) { + this.profileUrl = profileUrl; + } + + + public ProfileRequestModel homeTown(@javax.annotation.Nullable String homeTown) { + this.homeTown = homeTown; + return this; + } + + /** + * Get homeTown + * @return homeTown + */ + @javax.annotation.Nullable + public String getHomeTown() { + return homeTown; + } + + public void setHomeTown(@javax.annotation.Nullable String homeTown) { + this.homeTown = homeTown; + } + + + public ProfileRequestModel state(@javax.annotation.Nullable String state) { + this.state = state; + return this; + } + + /** + * Get state + * @return state + */ + @javax.annotation.Nullable + public String getState() { + return state; + } + + public void setState(@javax.annotation.Nullable String state) { + this.state = state; + } + + + public ProfileRequestModel city(@javax.annotation.Nullable String city) { + this.city = city; + return this; + } + + /** + * Get city + * @return city + */ + @javax.annotation.Nullable + public String getCity() { + return city; + } + + public void setCity(@javax.annotation.Nullable String city) { + this.city = city; + } + + + public ProfileRequestModel industry(@javax.annotation.Nullable String industry) { + this.industry = industry; + return this; + } + + /** + * Get industry + * @return industry + */ + @javax.annotation.Nullable + public String getIndustry() { + return industry; + } + + public void setIndustry(@javax.annotation.Nullable String industry) { + this.industry = industry; + } + + + public ProfileRequestModel localLanguage(@javax.annotation.Nullable String localLanguage) { + this.localLanguage = localLanguage; + return this; + } + + /** + * Get localLanguage + * @return localLanguage + */ + @javax.annotation.Nullable + public String getLocalLanguage() { + return localLanguage; + } + + public void setLocalLanguage(@javax.annotation.Nullable String localLanguage) { + this.localLanguage = localLanguage; + } + + + public ProfileRequestModel language(@javax.annotation.Nullable String language) { + this.language = language; + return this; + } + + /** + * Get language + * @return language + */ + @javax.annotation.Nullable + public String getLanguage() { + return language; + } + + public void setLanguage(@javax.annotation.Nullable String language) { + this.language = language; + } + + + public ProfileRequestModel coverPhoto(@javax.annotation.Nullable String coverPhoto) { + this.coverPhoto = coverPhoto; + return this; + } + + /** + * Get coverPhoto + * @return coverPhoto + */ + @javax.annotation.Nullable + public String getCoverPhoto() { + return coverPhoto; + } + + public void setCoverPhoto(@javax.annotation.Nullable String coverPhoto) { + this.coverPhoto = coverPhoto; + } + + + public ProfileRequestModel tagLine(@javax.annotation.Nullable String tagLine) { + this.tagLine = tagLine; + return this; + } + + /** + * Get tagLine + * @return tagLine + */ + @javax.annotation.Nullable + public String getTagLine() { + return tagLine; + } + + public void setTagLine(@javax.annotation.Nullable String tagLine) { + this.tagLine = tagLine; + } + + + public ProfileRequestModel mainAddress(@javax.annotation.Nullable String mainAddress) { + this.mainAddress = mainAddress; + return this; + } + + /** + * Get mainAddress + * @return mainAddress + */ + @javax.annotation.Nullable + public String getMainAddress() { + return mainAddress; + } + + public void setMainAddress(@javax.annotation.Nullable String mainAddress) { + this.mainAddress = mainAddress; + } + + + public ProfileRequestModel localCity(@javax.annotation.Nullable String localCity) { + this.localCity = localCity; + return this; + } + + /** + * Get localCity + * @return localCity + */ + @javax.annotation.Nullable + public String getLocalCity() { + return localCity; + } + + public void setLocalCity(@javax.annotation.Nullable String localCity) { + this.localCity = localCity; + } + + + public ProfileRequestModel profileCity(@javax.annotation.Nullable String profileCity) { + this.profileCity = profileCity; + return this; + } + + /** + * Get profileCity + * @return profileCity + */ + @javax.annotation.Nullable + public String getProfileCity() { + return profileCity; + } + + public void setProfileCity(@javax.annotation.Nullable String profileCity) { + this.profileCity = profileCity; + } + + + public ProfileRequestModel localCountry(@javax.annotation.Nullable String localCountry) { + this.localCountry = localCountry; + return this; + } + + /** + * Get localCountry + * @return localCountry + */ + @javax.annotation.Nullable + public String getLocalCountry() { + return localCountry; + } + + public void setLocalCountry(@javax.annotation.Nullable String localCountry) { + this.localCountry = localCountry; + } + + + public ProfileRequestModel profileCountry(@javax.annotation.Nullable String profileCountry) { + this.profileCountry = profileCountry; + return this; + } + + /** + * Get profileCountry + * @return profileCountry + */ + @javax.annotation.Nullable + public String getProfileCountry() { + return profileCountry; + } + + public void setProfileCountry(@javax.annotation.Nullable String profileCountry) { + this.profileCountry = profileCountry; + } + + + public ProfileRequestModel quota(@javax.annotation.Nullable String quota) { + this.quota = quota; + return this; + } + + /** + * Get quota + * @return quota + */ + @javax.annotation.Nullable + public String getQuota() { + return quota; + } + + public void setQuota(@javax.annotation.Nullable String quota) { + this.quota = quota; + } + + + public ProfileRequestModel religion(@javax.annotation.Nullable String religion) { + this.religion = religion; + return this; + } + + /** + * Get religion + * @return religion + */ + @javax.annotation.Nullable + public String getReligion() { + return religion; + } + + public void setReligion(@javax.annotation.Nullable String religion) { + this.religion = religion; + } + + + public ProfileRequestModel political(@javax.annotation.Nullable String political) { + this.political = political; + return this; + } + + /** + * Get political + * @return political + */ + @javax.annotation.Nullable + public String getPolitical() { + return political; + } + + public void setPolitical(@javax.annotation.Nullable String political) { + this.political = political; + } + + + public ProfileRequestModel relationshipStatus(@javax.annotation.Nullable String relationshipStatus) { + this.relationshipStatus = relationshipStatus; + return this; + } + + /** + * Get relationshipStatus + * @return relationshipStatus + */ + @javax.annotation.Nullable + public String getRelationshipStatus() { + return relationshipStatus; + } + + public void setRelationshipStatus(@javax.annotation.Nullable String relationshipStatus) { + this.relationshipStatus = relationshipStatus; + } + + + public ProfileRequestModel httpsImageUrl(@javax.annotation.Nullable String httpsImageUrl) { + this.httpsImageUrl = httpsImageUrl; + return this; + } + + /** + * Get httpsImageUrl + * @return httpsImageUrl + */ + @javax.annotation.Nullable + public String getHttpsImageUrl() { + return httpsImageUrl; + } + + public void setHttpsImageUrl(@javax.annotation.Nullable String httpsImageUrl) { + this.httpsImageUrl = httpsImageUrl; + } + + + public ProfileRequestModel isGeoEnabled(@javax.annotation.Nullable String isGeoEnabled) { + this.isGeoEnabled = isGeoEnabled; + return this; + } + + /** + * Get isGeoEnabled + * @return isGeoEnabled + */ + @javax.annotation.Nullable + public String getIsGeoEnabled() { + return isGeoEnabled; + } + + public void setIsGeoEnabled(@javax.annotation.Nullable String isGeoEnabled) { + this.isGeoEnabled = isGeoEnabled; + } + + + public ProfileRequestModel associations(@javax.annotation.Nullable String associations) { + this.associations = associations; + return this; + } + + /** + * Get associations + * @return associations + */ + @javax.annotation.Nullable + public String getAssociations() { + return associations; + } + + public void setAssociations(@javax.annotation.Nullable String associations) { + this.associations = associations; + } + + + public ProfileRequestModel honors(@javax.annotation.Nullable String honors) { + this.honors = honors; + return this; + } + + /** + * Get honors + * @return honors + */ + @javax.annotation.Nullable + public String getHonors() { + return honors; + } + + public void setHonors(@javax.annotation.Nullable String honors) { + this.honors = honors; + } + + + public ProfileRequestModel publicRepository(@javax.annotation.Nullable String publicRepository) { + this.publicRepository = publicRepository; + return this; + } + + /** + * Get publicRepository + * @return publicRepository + */ + @javax.annotation.Nullable + public String getPublicRepository() { + return publicRepository; + } + + public void setPublicRepository(@javax.annotation.Nullable String publicRepository) { + this.publicRepository = publicRepository; + } + + + public ProfileRequestModel repositoryUrl(@javax.annotation.Nullable String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + return this; + } + + /** + * Get repositoryUrl + * @return repositoryUrl + */ + @javax.annotation.Nullable + public String getRepositoryUrl() { + return repositoryUrl; + } + + public void setRepositoryUrl(@javax.annotation.Nullable String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + } + + + public ProfileRequestModel professionalHeadline(@javax.annotation.Nullable String professionalHeadline) { + this.professionalHeadline = professionalHeadline; + return this; + } + + /** + * Get professionalHeadline + * @return professionalHeadline + */ + @javax.annotation.Nullable + public String getProfessionalHeadline() { + return professionalHeadline; + } + + public void setProfessionalHeadline(@javax.annotation.Nullable String professionalHeadline) { + this.professionalHeadline = professionalHeadline; + } + + + public ProfileRequestModel currency(@javax.annotation.Nullable String currency) { + this.currency = currency; + return this; + } + + /** + * Get currency + * @return currency + */ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + public void setCurrency(@javax.annotation.Nullable String currency) { + this.currency = currency; + } + + + public ProfileRequestModel starredUrl(@javax.annotation.Nullable String starredUrl) { + this.starredUrl = starredUrl; + return this; + } + + /** + * Get starredUrl + * @return starredUrl + */ + @javax.annotation.Nullable + public String getStarredUrl() { + return starredUrl; + } + + public void setStarredUrl(@javax.annotation.Nullable String starredUrl) { + this.starredUrl = starredUrl; + } + + + public ProfileRequestModel gistsUrl(@javax.annotation.Nullable String gistsUrl) { + this.gistsUrl = gistsUrl; + return this; + } + + /** + * Get gistsUrl + * @return gistsUrl + */ + @javax.annotation.Nullable + public String getGistsUrl() { + return gistsUrl; + } + + public void setGistsUrl(@javax.annotation.Nullable String gistsUrl) { + this.gistsUrl = gistsUrl; + } + + + public ProfileRequestModel gravatarImageUrl(@javax.annotation.Nullable String gravatarImageUrl) { + this.gravatarImageUrl = gravatarImageUrl; + return this; + } + + /** + * Get gravatarImageUrl + * @return gravatarImageUrl + */ + @javax.annotation.Nullable + public String getGravatarImageUrl() { + return gravatarImageUrl; + } + + public void setGravatarImageUrl(@javax.annotation.Nullable String gravatarImageUrl) { + this.gravatarImageUrl = gravatarImageUrl; + } + + + public ProfileRequestModel externalUserLoginId(@javax.annotation.Nullable String externalUserLoginId) { + this.externalUserLoginId = externalUserLoginId; + return this; + } + + /** + * Get externalUserLoginId + * @return externalUserLoginId + */ + @javax.annotation.Nullable + public String getExternalUserLoginId() { + return externalUserLoginId; + } + + public void setExternalUserLoginId(@javax.annotation.Nullable String externalUserLoginId) { + this.externalUserLoginId = externalUserLoginId; + } + + + public ProfileRequestModel interestedIn(@javax.annotation.Nullable List<String> interestedIn) { + this.interestedIn = interestedIn; + return this; + } + + public ProfileRequestModel addInterestedInItem(String interestedInItem) { + if (this.interestedIn == null) { + this.interestedIn = new ArrayList<>(); + } + this.interestedIn.add(interestedInItem); + return this; + } + + /** + * Get interestedIn + * @return interestedIn + */ + @javax.annotation.Nullable + public List<String> getInterestedIn() { + return interestedIn; + } + + public void setInterestedIn(@javax.annotation.Nullable List<String> interestedIn) { + this.interestedIn = interestedIn; + } + + + public ProfileRequestModel followersCount(@javax.annotation.Nullable Integer followersCount) { + this.followersCount = followersCount; + return this; + } + + /** + * Get followersCount + * @return followersCount + */ + @javax.annotation.Nullable + public Integer getFollowersCount() { + return followersCount; + } + + public void setFollowersCount(@javax.annotation.Nullable Integer followersCount) { + this.followersCount = followersCount; + } + + + public ProfileRequestModel friendsCount(@javax.annotation.Nullable Integer friendsCount) { + this.friendsCount = friendsCount; + return this; + } + + /** + * Get friendsCount + * @return friendsCount + */ + @javax.annotation.Nullable + public Integer getFriendsCount() { + return friendsCount; + } + + public void setFriendsCount(@javax.annotation.Nullable Integer friendsCount) { + this.friendsCount = friendsCount; + } + + + public ProfileRequestModel totalStatusesCount(@javax.annotation.Nullable Integer totalStatusesCount) { + this.totalStatusesCount = totalStatusesCount; + return this; + } + + /** + * Get totalStatusesCount + * @return totalStatusesCount + */ + @javax.annotation.Nullable + public Integer getTotalStatusesCount() { + return totalStatusesCount; + } + + public void setTotalStatusesCount(@javax.annotation.Nullable Integer totalStatusesCount) { + this.totalStatusesCount = totalStatusesCount; + } + + + public ProfileRequestModel numRecommenders(@javax.annotation.Nullable Integer numRecommenders) { + this.numRecommenders = numRecommenders; + return this; + } + + /** + * Get numRecommenders + * @return numRecommenders + */ + @javax.annotation.Nullable + public Integer getNumRecommenders() { + return numRecommenders; + } + + public void setNumRecommenders(@javax.annotation.Nullable Integer numRecommenders) { + this.numRecommenders = numRecommenders; + } + + + public ProfileRequestModel totalPrivateRepository(@javax.annotation.Nullable Integer totalPrivateRepository) { + this.totalPrivateRepository = totalPrivateRepository; + return this; + } + + /** + * Get totalPrivateRepository + * @return totalPrivateRepository + */ + @javax.annotation.Nullable + public Integer getTotalPrivateRepository() { + return totalPrivateRepository; + } + + public void setTotalPrivateRepository(@javax.annotation.Nullable Integer totalPrivateRepository) { + this.totalPrivateRepository = totalPrivateRepository; + } + + + public ProfileRequestModel publicGists(@javax.annotation.Nullable Integer publicGists) { + this.publicGists = publicGists; + return this; + } + + /** + * Get publicGists + * @return publicGists + */ + @javax.annotation.Nullable + public Integer getPublicGists() { + return publicGists; + } + + public void setPublicGists(@javax.annotation.Nullable Integer publicGists) { + this.publicGists = publicGists; + } + + + public ProfileRequestModel privateGists(@javax.annotation.Nullable Integer privateGists) { + this.privateGists = privateGists; + return this; + } + + /** + * Get privateGists + * @return privateGists + */ + @javax.annotation.Nullable + public Integer getPrivateGists() { + return privateGists; + } + + public void setPrivateGists(@javax.annotation.Nullable Integer privateGists) { + this.privateGists = privateGists; + } + + + public ProfileRequestModel sessionLimit(@javax.annotation.Nullable Integer sessionLimit) { + this.sessionLimit = sessionLimit; + return this; + } + + /** + * Get sessionLimit + * @return sessionLimit + */ + @javax.annotation.Nullable + public Integer getSessionLimit() { + return sessionLimit; + } + + public void setSessionLimit(@javax.annotation.Nullable Integer sessionLimit) { + this.sessionLimit = sessionLimit; + } + + + public ProfileRequestModel customFields(@javax.annotation.Nullable Map<String, String> customFields) { + this.customFields = customFields; + return this; + } + + public ProfileRequestModel putCustomFieldsItem(String key, String customFieldsItem) { + if (this.customFields == null) { + this.customFields = new HashMap<>(); + } + this.customFields.put(key, customFieldsItem); + return this; + } + + /** + * Get customFields + * @return customFields + */ + @javax.annotation.Nullable + public Map<String, String> getCustomFields() { + return customFields; + } + + public void setCustomFields(@javax.annotation.Nullable Map<String, String> customFields) { + this.customFields = customFields; + } + + + public ProfileRequestModel profileImageUrls(@javax.annotation.Nullable Map<String, String> profileImageUrls) { + this.profileImageUrls = profileImageUrls; + return this; + } + + public ProfileRequestModel putProfileImageUrlsItem(String key, String profileImageUrlsItem) { + if (this.profileImageUrls == null) { + this.profileImageUrls = new HashMap<>(); + } + this.profileImageUrls.put(key, profileImageUrlsItem); + return this; + } + + /** + * Get profileImageUrls + * @return profileImageUrls + */ + @javax.annotation.Nullable + public Map<String, String> getProfileImageUrls() { + return profileImageUrls; + } + + public void setProfileImageUrls(@javax.annotation.Nullable Map<String, String> profileImageUrls) { + this.profileImageUrls = profileImageUrls; + } + + + public ProfileRequestModel webProfiles(@javax.annotation.Nullable Map<String, String> webProfiles) { + this.webProfiles = webProfiles; + return this; + } + + public ProfileRequestModel putWebProfilesItem(String key, String webProfilesItem) { + if (this.webProfiles == null) { + this.webProfiles = new HashMap<>(); + } + this.webProfiles.put(key, webProfilesItem); + return this; + } + + /** + * Get webProfiles + * @return webProfiles + */ + @javax.annotation.Nullable + public Map<String, String> getWebProfiles() { + return webProfiles; + } + + public void setWebProfiles(@javax.annotation.Nullable Map<String, String> webProfiles) { + this.webProfiles = webProfiles; + } + + + public ProfileRequestModel securityQuestionAnswer(@javax.annotation.Nullable Map<String, String> securityQuestionAnswer) { + this.securityQuestionAnswer = securityQuestionAnswer; + return this; + } + + public ProfileRequestModel putSecurityQuestionAnswerItem(String key, String securityQuestionAnswerItem) { + if (this.securityQuestionAnswer == null) { + this.securityQuestionAnswer = new HashMap<>(); + } + this.securityQuestionAnswer.put(key, securityQuestionAnswerItem); + return this; + } + + /** + * Get securityQuestionAnswer + * @return securityQuestionAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityQuestionAnswer() { + return securityQuestionAnswer; + } + + public void setSecurityQuestionAnswer(@javax.annotation.Nullable Map<String, String> securityQuestionAnswer) { + this.securityQuestionAnswer = securityQuestionAnswer; + } + + + public ProfileRequestModel country(@javax.annotation.Nullable ProfileRequestModelCountry country) { + this.country = country; + return this; + } + + /** + * Get country + * @return country + */ + @javax.annotation.Nullable + public ProfileRequestModelCountry getCountry() { + return country; + } + + public void setCountry(@javax.annotation.Nullable ProfileRequestModelCountry country) { + this.country = country; + } + + + public ProfileRequestModel providerAccessCredential(@javax.annotation.Nullable ProfileRequestModelProviderAccessCredential providerAccessCredential) { + this.providerAccessCredential = providerAccessCredential; + return this; + } + + /** + * Get providerAccessCredential + * @return providerAccessCredential + */ + @javax.annotation.Nullable + public ProfileRequestModelProviderAccessCredential getProviderAccessCredential() { + return providerAccessCredential; + } + + public void setProviderAccessCredential(@javax.annotation.Nullable ProfileRequestModelProviderAccessCredential providerAccessCredential) { + this.providerAccessCredential = providerAccessCredential; + } + + + public ProfileRequestModel suggestions(@javax.annotation.Nullable ProfileRequestModelSuggestions suggestions) { + this.suggestions = suggestions; + return this; + } + + /** + * Get suggestions + * @return suggestions + */ + @javax.annotation.Nullable + public ProfileRequestModelSuggestions getSuggestions() { + return suggestions; + } + + public void setSuggestions(@javax.annotation.Nullable ProfileRequestModelSuggestions suggestions) { + this.suggestions = suggestions; + } + + + public ProfileRequestModel subscription(@javax.annotation.Nullable ProfileRequestModelSubscription subscription) { + this.subscription = subscription; + return this; + } + + /** + * Get subscription + * @return subscription + */ + @javax.annotation.Nullable + public ProfileRequestModelSubscription getSubscription() { + return subscription; + } + + public void setSubscription(@javax.annotation.Nullable ProfileRequestModelSubscription subscription) { + this.subscription = subscription; + } + + + public ProfileRequestModel privacyPolicy(@javax.annotation.Nullable ProfileRequestModelPrivacyPolicy privacyPolicy) { + this.privacyPolicy = privacyPolicy; + return this; + } + + /** + * Get privacyPolicy + * @return privacyPolicy + */ + @javax.annotation.Nullable + public ProfileRequestModelPrivacyPolicy getPrivacyPolicy() { + return privacyPolicy; + } + + public void setPrivacyPolicy(@javax.annotation.Nullable ProfileRequestModelPrivacyPolicy privacyPolicy) { + this.privacyPolicy = privacyPolicy; + } + + + public ProfileRequestModel piNInfo(@javax.annotation.Nullable ProfileRequestModelPINInfo piNInfo) { + this.piNInfo = piNInfo; + return this; + } + + /** + * Get piNInfo + * @return piNInfo + */ + @javax.annotation.Nullable + public ProfileRequestModelPINInfo getPiNInfo() { + return piNInfo; + } + + public void setPiNInfo(@javax.annotation.Nullable ProfileRequestModelPINInfo piNInfo) { + this.piNInfo = piNInfo; + } + + + public ProfileRequestModel addresses(@javax.annotation.Nullable List<ProfileRequestModelAddressesInner> addresses) { + this.addresses = addresses; + return this; + } + + public ProfileRequestModel addAddressesItem(ProfileRequestModelAddressesInner addressesItem) { + if (this.addresses == null) { + this.addresses = new ArrayList<>(); + } + this.addresses.add(addressesItem); + return this; + } + + /** + * Get addresses + * @return addresses + */ + @javax.annotation.Nullable + public List<ProfileRequestModelAddressesInner> getAddresses() { + return addresses; + } + + public void setAddresses(@javax.annotation.Nullable List<ProfileRequestModelAddressesInner> addresses) { + this.addresses = addresses; + } + + + public ProfileRequestModel positions(@javax.annotation.Nullable List<ProfileRequestModelPositionsInner> positions) { + this.positions = positions; + return this; + } + + public ProfileRequestModel addPositionsItem(ProfileRequestModelPositionsInner positionsItem) { + if (this.positions == null) { + this.positions = new ArrayList<>(); + } + this.positions.add(positionsItem); + return this; + } + + /** + * Get positions + * @return positions + */ + @javax.annotation.Nullable + public List<ProfileRequestModelPositionsInner> getPositions() { + return positions; + } + + public void setPositions(@javax.annotation.Nullable List<ProfileRequestModelPositionsInner> positions) { + this.positions = positions; + } + + + public ProfileRequestModel educations(@javax.annotation.Nullable List<ProfileRequestModelEducationsInner> educations) { + this.educations = educations; + return this; + } + + public ProfileRequestModel addEducationsItem(ProfileRequestModelEducationsInner educationsItem) { + if (this.educations == null) { + this.educations = new ArrayList<>(); + } + this.educations.add(educationsItem); + return this; + } + + /** + * Get educations + * @return educations + */ + @javax.annotation.Nullable + public List<ProfileRequestModelEducationsInner> getEducations() { + return educations; + } + + public void setEducations(@javax.annotation.Nullable List<ProfileRequestModelEducationsInner> educations) { + this.educations = educations; + } + + + public ProfileRequestModel phoneNumbers(@javax.annotation.Nullable List<ProfileRequestModelPhoneNumbersInner> phoneNumbers) { + this.phoneNumbers = phoneNumbers; + return this; + } + + public ProfileRequestModel addPhoneNumbersItem(ProfileRequestModelPhoneNumbersInner phoneNumbersItem) { + if (this.phoneNumbers == null) { + this.phoneNumbers = new ArrayList<>(); + } + this.phoneNumbers.add(phoneNumbersItem); + return this; + } + + /** + * Get phoneNumbers + * @return phoneNumbers + */ + @javax.annotation.Nullable + public List<ProfileRequestModelPhoneNumbersInner> getPhoneNumbers() { + return phoneNumbers; + } + + public void setPhoneNumbers(@javax.annotation.Nullable List<ProfileRequestModelPhoneNumbersInner> phoneNumbers) { + this.phoneNumbers = phoneNumbers; + } + + + public ProfileRequestModel imAccounts(@javax.annotation.Nullable List<ProfileRequestModelIMAccountsInner> imAccounts) { + this.imAccounts = imAccounts; + return this; + } + + public ProfileRequestModel addImAccountsItem(ProfileRequestModelIMAccountsInner imAccountsItem) { + if (this.imAccounts == null) { + this.imAccounts = new ArrayList<>(); + } + this.imAccounts.add(imAccountsItem); + return this; + } + + /** + * Get imAccounts + * @return imAccounts + */ + @javax.annotation.Nullable + public List<ProfileRequestModelIMAccountsInner> getImAccounts() { + return imAccounts; + } + + public void setImAccounts(@javax.annotation.Nullable List<ProfileRequestModelIMAccountsInner> imAccounts) { + this.imAccounts = imAccounts; + } + + + public ProfileRequestModel interests(@javax.annotation.Nullable List<ProfileRequestModelInterestsInner> interests) { + this.interests = interests; + return this; + } + + public ProfileRequestModel addInterestsItem(ProfileRequestModelInterestsInner interestsItem) { + if (this.interests == null) { + this.interests = new ArrayList<>(); + } + this.interests.add(interestsItem); + return this; + } + + /** + * Get interests + * @return interests + */ + @javax.annotation.Nullable + public List<ProfileRequestModelInterestsInner> getInterests() { + return interests; + } + + public void setInterests(@javax.annotation.Nullable List<ProfileRequestModelInterestsInner> interests) { + this.interests = interests; + } + + + public ProfileRequestModel sports(@javax.annotation.Nullable List<ProfileRequestModelSportsInner> sports) { + this.sports = sports; + return this; + } + + public ProfileRequestModel addSportsItem(ProfileRequestModelSportsInner sportsItem) { + if (this.sports == null) { + this.sports = new ArrayList<>(); + } + this.sports.add(sportsItem); + return this; + } + + /** + * Get sports + * @return sports + */ + @javax.annotation.Nullable + public List<ProfileRequestModelSportsInner> getSports() { + return sports; + } + + public void setSports(@javax.annotation.Nullable List<ProfileRequestModelSportsInner> sports) { + this.sports = sports; + } + + + public ProfileRequestModel inspirationalPeople(@javax.annotation.Nullable List<ProfileRequestModelInspirationalPeopleInner> inspirationalPeople) { + this.inspirationalPeople = inspirationalPeople; + return this; + } + + public ProfileRequestModel addInspirationalPeopleItem(ProfileRequestModelInspirationalPeopleInner inspirationalPeopleItem) { + if (this.inspirationalPeople == null) { + this.inspirationalPeople = new ArrayList<>(); + } + this.inspirationalPeople.add(inspirationalPeopleItem); + return this; + } + + /** + * Get inspirationalPeople + * @return inspirationalPeople + */ + @javax.annotation.Nullable + public List<ProfileRequestModelInspirationalPeopleInner> getInspirationalPeople() { + return inspirationalPeople; + } + + public void setInspirationalPeople(@javax.annotation.Nullable List<ProfileRequestModelInspirationalPeopleInner> inspirationalPeople) { + this.inspirationalPeople = inspirationalPeople; + } + + + public ProfileRequestModel awards(@javax.annotation.Nullable List<ProfileRequestModelAwardsInner> awards) { + this.awards = awards; + return this; + } + + public ProfileRequestModel addAwardsItem(ProfileRequestModelAwardsInner awardsItem) { + if (this.awards == null) { + this.awards = new ArrayList<>(); + } + this.awards.add(awardsItem); + return this; + } + + /** + * Get awards + * @return awards + */ + @javax.annotation.Nullable + public List<ProfileRequestModelAwardsInner> getAwards() { + return awards; + } + + public void setAwards(@javax.annotation.Nullable List<ProfileRequestModelAwardsInner> awards) { + this.awards = awards; + } + + + public ProfileRequestModel skills(@javax.annotation.Nullable List<ProfileRequestModelSkillsInner> skills) { + this.skills = skills; + return this; + } + + public ProfileRequestModel addSkillsItem(ProfileRequestModelSkillsInner skillsItem) { + if (this.skills == null) { + this.skills = new ArrayList<>(); + } + this.skills.add(skillsItem); + return this; + } + + /** + * Get skills + * @return skills + */ + @javax.annotation.Nullable + public List<ProfileRequestModelSkillsInner> getSkills() { + return skills; + } + + public void setSkills(@javax.annotation.Nullable List<ProfileRequestModelSkillsInner> skills) { + this.skills = skills; + } + + + public ProfileRequestModel currentStatus(@javax.annotation.Nullable List<ProfileRequestModelCurrentStatusInner> currentStatus) { + this.currentStatus = currentStatus; + return this; + } + + public ProfileRequestModel addCurrentStatusItem(ProfileRequestModelCurrentStatusInner currentStatusItem) { + if (this.currentStatus == null) { + this.currentStatus = new ArrayList<>(); + } + this.currentStatus.add(currentStatusItem); + return this; + } + + /** + * Get currentStatus + * @return currentStatus + */ + @javax.annotation.Nullable + public List<ProfileRequestModelCurrentStatusInner> getCurrentStatus() { + return currentStatus; + } + + public void setCurrentStatus(@javax.annotation.Nullable List<ProfileRequestModelCurrentStatusInner> currentStatus) { + this.currentStatus = currentStatus; + } + + + public ProfileRequestModel certifications(@javax.annotation.Nullable List<ProfileRequestModelCertificationsInner> certifications) { + this.certifications = certifications; + return this; + } + + public ProfileRequestModel addCertificationsItem(ProfileRequestModelCertificationsInner certificationsItem) { + if (this.certifications == null) { + this.certifications = new ArrayList<>(); + } + this.certifications.add(certificationsItem); + return this; + } + + /** + * Get certifications + * @return certifications + */ + @javax.annotation.Nullable + public List<ProfileRequestModelCertificationsInner> getCertifications() { + return certifications; + } + + public void setCertifications(@javax.annotation.Nullable List<ProfileRequestModelCertificationsInner> certifications) { + this.certifications = certifications; + } + + + public ProfileRequestModel courses(@javax.annotation.Nullable List<ProfileRequestModelCoursesInner> courses) { + this.courses = courses; + return this; + } + + public ProfileRequestModel addCoursesItem(ProfileRequestModelCoursesInner coursesItem) { + if (this.courses == null) { + this.courses = new ArrayList<>(); + } + this.courses.add(coursesItem); + return this; + } + + /** + * Get courses + * @return courses + */ + @javax.annotation.Nullable + public List<ProfileRequestModelCoursesInner> getCourses() { + return courses; + } + + public void setCourses(@javax.annotation.Nullable List<ProfileRequestModelCoursesInner> courses) { + this.courses = courses; + } + + + public ProfileRequestModel volunteer(@javax.annotation.Nullable List<ProfileRequestModelVolunteerInner> volunteer) { + this.volunteer = volunteer; + return this; + } + + public ProfileRequestModel addVolunteerItem(ProfileRequestModelVolunteerInner volunteerItem) { + if (this.volunteer == null) { + this.volunteer = new ArrayList<>(); + } + this.volunteer.add(volunteerItem); + return this; + } + + /** + * Get volunteer + * @return volunteer + */ + @javax.annotation.Nullable + public List<ProfileRequestModelVolunteerInner> getVolunteer() { + return volunteer; + } + + public void setVolunteer(@javax.annotation.Nullable List<ProfileRequestModelVolunteerInner> volunteer) { + this.volunteer = volunteer; + } + + + public ProfileRequestModel recommendationsReceived(@javax.annotation.Nullable List<ProfileRequestModelRecommendationsReceivedInner> recommendationsReceived) { + this.recommendationsReceived = recommendationsReceived; + return this; + } + + public ProfileRequestModel addRecommendationsReceivedItem(ProfileRequestModelRecommendationsReceivedInner recommendationsReceivedItem) { + if (this.recommendationsReceived == null) { + this.recommendationsReceived = new ArrayList<>(); + } + this.recommendationsReceived.add(recommendationsReceivedItem); + return this; + } + + /** + * Get recommendationsReceived + * @return recommendationsReceived + */ + @javax.annotation.Nullable + public List<ProfileRequestModelRecommendationsReceivedInner> getRecommendationsReceived() { + return recommendationsReceived; + } + + public void setRecommendationsReceived(@javax.annotation.Nullable List<ProfileRequestModelRecommendationsReceivedInner> recommendationsReceived) { + this.recommendationsReceived = recommendationsReceived; + } + + + public ProfileRequestModel languages(@javax.annotation.Nullable List<ProfileRequestModelLanguagesInner> languages) { + this.languages = languages; + return this; + } + + public ProfileRequestModel addLanguagesItem(ProfileRequestModelLanguagesInner languagesItem) { + if (this.languages == null) { + this.languages = new ArrayList<>(); + } + this.languages.add(languagesItem); + return this; + } + + /** + * Get languages + * @return languages + */ + @javax.annotation.Nullable + public List<ProfileRequestModelLanguagesInner> getLanguages() { + return languages; + } + + public void setLanguages(@javax.annotation.Nullable List<ProfileRequestModelLanguagesInner> languages) { + this.languages = languages; + } + + + public ProfileRequestModel projects(@javax.annotation.Nullable List<ProfileRequestModelProjectsInner> projects) { + this.projects = projects; + return this; + } + + public ProfileRequestModel addProjectsItem(ProfileRequestModelProjectsInner projectsItem) { + if (this.projects == null) { + this.projects = new ArrayList<>(); + } + this.projects.add(projectsItem); + return this; + } + + /** + * Get projects + * @return projects + */ + @javax.annotation.Nullable + public List<ProfileRequestModelProjectsInner> getProjects() { + return projects; + } + + public void setProjects(@javax.annotation.Nullable List<ProfileRequestModelProjectsInner> projects) { + this.projects = projects; + } + + + public ProfileRequestModel games(@javax.annotation.Nullable List<ProfileRequestModelGamesInner> games) { + this.games = games; + return this; + } + + public ProfileRequestModel addGamesItem(ProfileRequestModelGamesInner gamesItem) { + if (this.games == null) { + this.games = new ArrayList<>(); + } + this.games.add(gamesItem); + return this; + } + + /** + * Get games + * @return games + */ + @javax.annotation.Nullable + public List<ProfileRequestModelGamesInner> getGames() { + return games; + } + + public void setGames(@javax.annotation.Nullable List<ProfileRequestModelGamesInner> games) { + this.games = games; + } + + + public ProfileRequestModel family(@javax.annotation.Nullable List<ProfileRequestModelFamilyInner> family) { + this.family = family; + return this; + } + + public ProfileRequestModel addFamilyItem(ProfileRequestModelFamilyInner familyItem) { + if (this.family == null) { + this.family = new ArrayList<>(); + } + this.family.add(familyItem); + return this; + } + + /** + * Get family + * @return family + */ + @javax.annotation.Nullable + public List<ProfileRequestModelFamilyInner> getFamily() { + return family; + } + + public void setFamily(@javax.annotation.Nullable List<ProfileRequestModelFamilyInner> family) { + this.family = family; + } + + + public ProfileRequestModel teleVisionShow(@javax.annotation.Nullable List<ProfileRequestModelTeleVisionShowInner> teleVisionShow) { + this.teleVisionShow = teleVisionShow; + return this; + } + + public ProfileRequestModel addTeleVisionShowItem(ProfileRequestModelTeleVisionShowInner teleVisionShowItem) { + if (this.teleVisionShow == null) { + this.teleVisionShow = new ArrayList<>(); + } + this.teleVisionShow.add(teleVisionShowItem); + return this; + } + + /** + * Get teleVisionShow + * @return teleVisionShow + */ + @javax.annotation.Nullable + public List<ProfileRequestModelTeleVisionShowInner> getTeleVisionShow() { + return teleVisionShow; + } + + public void setTeleVisionShow(@javax.annotation.Nullable List<ProfileRequestModelTeleVisionShowInner> teleVisionShow) { + this.teleVisionShow = teleVisionShow; + } + + + public ProfileRequestModel mutualFriends(@javax.annotation.Nullable List<ProfileRequestModelMutualFriendsInner> mutualFriends) { + this.mutualFriends = mutualFriends; + return this; + } + + public ProfileRequestModel addMutualFriendsItem(ProfileRequestModelMutualFriendsInner mutualFriendsItem) { + if (this.mutualFriends == null) { + this.mutualFriends = new ArrayList<>(); + } + this.mutualFriends.add(mutualFriendsItem); + return this; + } + + /** + * Get mutualFriends + * @return mutualFriends + */ + @javax.annotation.Nullable + public List<ProfileRequestModelMutualFriendsInner> getMutualFriends() { + return mutualFriends; + } + + public void setMutualFriends(@javax.annotation.Nullable List<ProfileRequestModelMutualFriendsInner> mutualFriends) { + this.mutualFriends = mutualFriends; + } + + + public ProfileRequestModel movies(@javax.annotation.Nullable List<ProfileRequestModelMoviesInner> movies) { + this.movies = movies; + return this; + } + + public ProfileRequestModel addMoviesItem(ProfileRequestModelMoviesInner moviesItem) { + if (this.movies == null) { + this.movies = new ArrayList<>(); + } + this.movies.add(moviesItem); + return this; + } + + /** + * Get movies + * @return movies + */ + @javax.annotation.Nullable + public List<ProfileRequestModelMoviesInner> getMovies() { + return movies; + } + + public void setMovies(@javax.annotation.Nullable List<ProfileRequestModelMoviesInner> movies) { + this.movies = movies; + } + + + public ProfileRequestModel books(@javax.annotation.Nullable List<ProfileRequestModelBooksInner> books) { + this.books = books; + return this; + } + + public ProfileRequestModel addBooksItem(ProfileRequestModelBooksInner booksItem) { + if (this.books == null) { + this.books = new ArrayList<>(); + } + this.books.add(booksItem); + return this; + } + + /** + * Get books + * @return books + */ + @javax.annotation.Nullable + public List<ProfileRequestModelBooksInner> getBooks() { + return books; + } + + public void setBooks(@javax.annotation.Nullable List<ProfileRequestModelBooksInner> books) { + this.books = books; + } + + + public ProfileRequestModel patents(@javax.annotation.Nullable List<ProfileRequestModelPatentsInner> patents) { + this.patents = patents; + return this; + } + + public ProfileRequestModel addPatentsItem(ProfileRequestModelPatentsInner patentsItem) { + if (this.patents == null) { + this.patents = new ArrayList<>(); + } + this.patents.add(patentsItem); + return this; + } + + /** + * Get patents + * @return patents + */ + @javax.annotation.Nullable + public List<ProfileRequestModelPatentsInner> getPatents() { + return patents; + } + + public void setPatents(@javax.annotation.Nullable List<ProfileRequestModelPatentsInner> patents) { + this.patents = patents; + } + + + public ProfileRequestModel favoriteThings(@javax.annotation.Nullable List<ProfileRequestModelFavoriteThingsInner> favoriteThings) { + this.favoriteThings = favoriteThings; + return this; + } + + public ProfileRequestModel addFavoriteThingsItem(ProfileRequestModelFavoriteThingsInner favoriteThingsItem) { + if (this.favoriteThings == null) { + this.favoriteThings = new ArrayList<>(); + } + this.favoriteThings.add(favoriteThingsItem); + return this; + } + + /** + * Get favoriteThings + * @return favoriteThings + */ + @javax.annotation.Nullable + public List<ProfileRequestModelFavoriteThingsInner> getFavoriteThings() { + return favoriteThings; + } + + public void setFavoriteThings(@javax.annotation.Nullable List<ProfileRequestModelFavoriteThingsInner> favoriteThings) { + this.favoriteThings = favoriteThings; + } + + + public ProfileRequestModel relatedProfileViews(@javax.annotation.Nullable List<ProfileRequestModelRelatedProfileViewsInner> relatedProfileViews) { + this.relatedProfileViews = relatedProfileViews; + return this; + } + + public ProfileRequestModel addRelatedProfileViewsItem(ProfileRequestModelRelatedProfileViewsInner relatedProfileViewsItem) { + if (this.relatedProfileViews == null) { + this.relatedProfileViews = new ArrayList<>(); + } + this.relatedProfileViews.add(relatedProfileViewsItem); + return this; + } + + /** + * Get relatedProfileViews + * @return relatedProfileViews + */ + @javax.annotation.Nullable + public List<ProfileRequestModelRelatedProfileViewsInner> getRelatedProfileViews() { + return relatedProfileViews; + } + + public void setRelatedProfileViews(@javax.annotation.Nullable List<ProfileRequestModelRelatedProfileViewsInner> relatedProfileViews) { + this.relatedProfileViews = relatedProfileViews; + } + + + public ProfileRequestModel placesLived(@javax.annotation.Nullable List<ProfileRequestModelPlacesLivedInner> placesLived) { + this.placesLived = placesLived; + return this; + } + + public ProfileRequestModel addPlacesLivedItem(ProfileRequestModelPlacesLivedInner placesLivedItem) { + if (this.placesLived == null) { + this.placesLived = new ArrayList<>(); + } + this.placesLived.add(placesLivedItem); + return this; + } + + /** + * Get placesLived + * @return placesLived + */ + @javax.annotation.Nullable + public List<ProfileRequestModelPlacesLivedInner> getPlacesLived() { + return placesLived; + } + + public void setPlacesLived(@javax.annotation.Nullable List<ProfileRequestModelPlacesLivedInner> placesLived) { + this.placesLived = placesLived; + } + + + public ProfileRequestModel publications(@javax.annotation.Nullable List<ProfileRequestModelPublicationsInner> publications) { + this.publications = publications; + return this; + } + + public ProfileRequestModel addPublicationsItem(ProfileRequestModelPublicationsInner publicationsItem) { + if (this.publications == null) { + this.publications = new ArrayList<>(); + } + this.publications.add(publicationsItem); + return this; + } + + /** + * Get publications + * @return publications + */ + @javax.annotation.Nullable + public List<ProfileRequestModelPublicationsInner> getPublications() { + return publications; + } + + public void setPublications(@javax.annotation.Nullable List<ProfileRequestModelPublicationsInner> publications) { + this.publications = publications; + } + + + public ProfileRequestModel jobBookmarks(@javax.annotation.Nullable List<ProfileRequestModelJobBookmarksInner> jobBookmarks) { + this.jobBookmarks = jobBookmarks; + return this; + } + + public ProfileRequestModel addJobBookmarksItem(ProfileRequestModelJobBookmarksInner jobBookmarksItem) { + if (this.jobBookmarks == null) { + this.jobBookmarks = new ArrayList<>(); + } + this.jobBookmarks.add(jobBookmarksItem); + return this; + } + + /** + * Get jobBookmarks + * @return jobBookmarks + */ + @javax.annotation.Nullable + public List<ProfileRequestModelJobBookmarksInner> getJobBookmarks() { + return jobBookmarks; + } + + public void setJobBookmarks(@javax.annotation.Nullable List<ProfileRequestModelJobBookmarksInner> jobBookmarks) { + this.jobBookmarks = jobBookmarks; + } + + + public ProfileRequestModel badges(@javax.annotation.Nullable List<ProfileRequestModelBadgesInner> badges) { + this.badges = badges; + return this; + } + + public ProfileRequestModel addBadgesItem(ProfileRequestModelBadgesInner badgesItem) { + if (this.badges == null) { + this.badges = new ArrayList<>(); + } + this.badges.add(badgesItem); + return this; + } + + /** + * Get badges + * @return badges + */ + @javax.annotation.Nullable + public List<ProfileRequestModelBadgesInner> getBadges() { + return badges; + } + + public void setBadges(@javax.annotation.Nullable List<ProfileRequestModelBadgesInner> badges) { + this.badges = badges; + } + + + public ProfileRequestModel memberUrlResources(@javax.annotation.Nullable List<ProfileRequestModelMemberUrlResourcesInner> memberUrlResources) { + this.memberUrlResources = memberUrlResources; + return this; + } + + public ProfileRequestModel addMemberUrlResourcesItem(ProfileRequestModelMemberUrlResourcesInner memberUrlResourcesItem) { + if (this.memberUrlResources == null) { + this.memberUrlResources = new ArrayList<>(); + } + this.memberUrlResources.add(memberUrlResourcesItem); + return this; + } + + /** + * Get memberUrlResources + * @return memberUrlResources + */ + @javax.annotation.Nullable + public List<ProfileRequestModelMemberUrlResourcesInner> getMemberUrlResources() { + return memberUrlResources; + } + + public void setMemberUrlResources(@javax.annotation.Nullable List<ProfileRequestModelMemberUrlResourcesInner> memberUrlResources) { + this.memberUrlResources = memberUrlResources; + } + + + public ProfileRequestModel externalIds(@javax.annotation.Nullable List<ProfileRequestModelExternalIdsInner> externalIds) { + this.externalIds = externalIds; + return this; + } + + public ProfileRequestModel addExternalIdsItem(ProfileRequestModelExternalIdsInner externalIdsItem) { + if (this.externalIds == null) { + this.externalIds = new ArrayList<>(); + } + this.externalIds.add(externalIdsItem); + return this; + } + + /** + * Get externalIds + * @return externalIds + */ + @javax.annotation.Nullable + public List<ProfileRequestModelExternalIdsInner> getExternalIds() { + return externalIds; + } + + public void setExternalIds(@javax.annotation.Nullable List<ProfileRequestModelExternalIdsInner> externalIds) { + this.externalIds = externalIds; + } + + + public ProfileRequestModel isEmailSubscribed(@javax.annotation.Nullable Boolean isEmailSubscribed) { + this.isEmailSubscribed = isEmailSubscribed; + return this; + } + + /** + * Get isEmailSubscribed + * @return isEmailSubscribed + */ + @javax.annotation.Nullable + public Boolean getIsEmailSubscribed() { + return isEmailSubscribed; + } + + public void setIsEmailSubscribed(@javax.annotation.Nullable Boolean isEmailSubscribed) { + this.isEmailSubscribed = isEmailSubscribed; + } + + + public ProfileRequestModel isProtected(@javax.annotation.Nullable Boolean isProtected) { + this.isProtected = isProtected; + return this; + } + + /** + * Get isProtected + * @return isProtected + */ + @javax.annotation.Nullable + public Boolean getIsProtected() { + return isProtected; + } + + public void setIsProtected(@javax.annotation.Nullable Boolean isProtected) { + this.isProtected = isProtected; + } + + + public ProfileRequestModel hireable(@javax.annotation.Nullable Boolean hireable) { + this.hireable = hireable; + return this; + } + + /** + * Get hireable + * @return hireable + */ + @javax.annotation.Nullable + public Boolean getHireable() { + return hireable; + } + + public void setHireable(@javax.annotation.Nullable Boolean hireable) { + this.hireable = hireable; + } + + + public ProfileRequestModel isTwoFactorAuthenticationEnabled(@javax.annotation.Nullable Boolean isTwoFactorAuthenticationEnabled) { + this.isTwoFactorAuthenticationEnabled = isTwoFactorAuthenticationEnabled; + return this; + } + + /** + * Get isTwoFactorAuthenticationEnabled + * @return isTwoFactorAuthenticationEnabled + */ + @javax.annotation.Nullable + public Boolean getIsTwoFactorAuthenticationEnabled() { + return isTwoFactorAuthenticationEnabled; + } + + public void setIsTwoFactorAuthenticationEnabled(@javax.annotation.Nullable Boolean isTwoFactorAuthenticationEnabled) { + this.isTwoFactorAuthenticationEnabled = isTwoFactorAuthenticationEnabled; + } + + + public ProfileRequestModel disableLogin(@javax.annotation.Nullable Boolean disableLogin) { + this.disableLogin = disableLogin; + return this; + } + + /** + * Get disableLogin + * @return disableLogin + */ + @javax.annotation.Nullable + public Boolean getDisableLogin() { + return disableLogin; + } + + public void setDisableLogin(@javax.annotation.Nullable Boolean disableLogin) { + this.disableLogin = disableLogin; + } + + + public ProfileRequestModel acceptPrivacyPolicy(@javax.annotation.Nullable Boolean acceptPrivacyPolicy) { + this.acceptPrivacyPolicy = acceptPrivacyPolicy; + return this; + } + + /** + * Get acceptPrivacyPolicy + * @return acceptPrivacyPolicy + */ + @javax.annotation.Nullable + public Boolean getAcceptPrivacyPolicy() { + return acceptPrivacyPolicy; + } + + public void setAcceptPrivacyPolicy(@javax.annotation.Nullable Boolean acceptPrivacyPolicy) { + this.acceptPrivacyPolicy = acceptPrivacyPolicy; + } + + + public ProfileRequestModel recaptchaResponseField(@javax.annotation.Nullable String recaptchaResponseField) { + this.recaptchaResponseField = recaptchaResponseField; + return this; + } + + /** + * Get recaptchaResponseField + * @return recaptchaResponseField + */ + @javax.annotation.Nullable + public String getRecaptchaResponseField() { + return recaptchaResponseField; + } + + public void setRecaptchaResponseField(@javax.annotation.Nullable String recaptchaResponseField) { + this.recaptchaResponseField = recaptchaResponseField; + } + + + public ProfileRequestModel recaptchaChallengeField(@javax.annotation.Nullable String recaptchaChallengeField) { + this.recaptchaChallengeField = recaptchaChallengeField; + return this; + } + + /** + * Get recaptchaChallengeField + * @return recaptchaChallengeField + */ + @javax.annotation.Nullable + public String getRecaptchaChallengeField() { + return recaptchaChallengeField; + } + + public void setRecaptchaChallengeField(@javax.annotation.Nullable String recaptchaChallengeField) { + this.recaptchaChallengeField = recaptchaChallengeField; + } + + + public ProfileRequestModel captchaModel(@javax.annotation.Nullable ProfileRequestModelCaptchaModel captchaModel) { + this.captchaModel = captchaModel; + return this; + } + + /** + * Get captchaModel + * @return captchaModel + */ + @javax.annotation.Nullable + public ProfileRequestModelCaptchaModel getCaptchaModel() { + return captchaModel; + } + + public void setCaptchaModel(@javax.annotation.Nullable ProfileRequestModelCaptchaModel captchaModel) { + this.captchaModel = captchaModel; + } + + + public ProfileRequestModel registrationSource(@javax.annotation.Nullable String registrationSource) { + this.registrationSource = registrationSource; + return this; + } + + /** + * Get registrationSource + * @return registrationSource + */ + @javax.annotation.Nullable + public String getRegistrationSource() { + return registrationSource; + } + + public void setRegistrationSource(@javax.annotation.Nullable String registrationSource) { + this.registrationSource = registrationSource; + } + + + public ProfileRequestModel fullName(@javax.annotation.Nullable String fullName) { + this.fullName = fullName; + return this; + } + + /** + * Get fullName + * @return fullName + */ + @javax.annotation.Nullable + public String getFullName() { + return fullName; + } + + public void setFullName(@javax.annotation.Nullable String fullName) { + this.fullName = fullName; + } + + + public ProfileRequestModel consents(@javax.annotation.Nullable ProfileRequestModelConsents consents) { + this.consents = consents; + return this; + } + + /** + * Get consents + * @return consents + */ + @javax.annotation.Nullable + public ProfileRequestModelConsents getConsents() { + return consents; + } + + public void setConsents(@javax.annotation.Nullable ProfileRequestModelConsents consents) { + this.consents = consents; + } + + + public ProfileRequestModel password(@javax.annotation.Nullable String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + @javax.annotation.Nullable + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nullable String password) { + this.password = password; + } + + + public ProfileRequestModel email(@javax.annotation.Nullable List<ProfileRequestModelEmailInner> email) { + this.email = email; + return this; + } + + public ProfileRequestModel addEmailItem(ProfileRequestModelEmailInner emailItem) { + if (this.email == null) { + this.email = new ArrayList<>(); + } + this.email.add(emailItem); + return this; + } + + /** + * Get email + * @return email + */ + @javax.annotation.Nullable + public List<ProfileRequestModelEmailInner> getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable List<ProfileRequestModelEmailInner> email) { + this.email = email; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModel instance itself + */ + public ProfileRequestModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModel profileRequestModel = (ProfileRequestModel) o; + return Objects.equals(this.userName, profileRequestModel.userName) && + Objects.equals(this.phoneId, profileRequestModel.phoneId) && + Objects.equals(this.gender, profileRequestModel.gender) && + Objects.equals(this.birthDate, profileRequestModel.birthDate) && + Objects.equals(this.prefix, profileRequestModel.prefix) && + Objects.equals(this.firstName, profileRequestModel.firstName) && + Objects.equals(this.middleName, profileRequestModel.middleName) && + Objects.equals(this.lastName, profileRequestModel.lastName) && + Objects.equals(this.suffix, profileRequestModel.suffix) && + Objects.equals(this.nickName, profileRequestModel.nickName) && + Objects.equals(this.profileName, profileRequestModel.profileName) && + Objects.equals(this.about, profileRequestModel.about) && + Objects.equals(this.company, profileRequestModel.company) && + Objects.equals(this.imageUrl, profileRequestModel.imageUrl) && + Objects.equals(this.timeZone, profileRequestModel.timeZone) && + Objects.equals(this.website, profileRequestModel.website) && + Objects.equals(this.thumbnailImageUrl, profileRequestModel.thumbnailImageUrl) && + Objects.equals(this.favicon, profileRequestModel.favicon) && + Objects.equals(this.profileUrl, profileRequestModel.profileUrl) && + Objects.equals(this.homeTown, profileRequestModel.homeTown) && + Objects.equals(this.state, profileRequestModel.state) && + Objects.equals(this.city, profileRequestModel.city) && + Objects.equals(this.industry, profileRequestModel.industry) && + Objects.equals(this.localLanguage, profileRequestModel.localLanguage) && + Objects.equals(this.language, profileRequestModel.language) && + Objects.equals(this.coverPhoto, profileRequestModel.coverPhoto) && + Objects.equals(this.tagLine, profileRequestModel.tagLine) && + Objects.equals(this.mainAddress, profileRequestModel.mainAddress) && + Objects.equals(this.localCity, profileRequestModel.localCity) && + Objects.equals(this.profileCity, profileRequestModel.profileCity) && + Objects.equals(this.localCountry, profileRequestModel.localCountry) && + Objects.equals(this.profileCountry, profileRequestModel.profileCountry) && + Objects.equals(this.quota, profileRequestModel.quota) && + Objects.equals(this.religion, profileRequestModel.religion) && + Objects.equals(this.political, profileRequestModel.political) && + Objects.equals(this.relationshipStatus, profileRequestModel.relationshipStatus) && + Objects.equals(this.httpsImageUrl, profileRequestModel.httpsImageUrl) && + Objects.equals(this.isGeoEnabled, profileRequestModel.isGeoEnabled) && + Objects.equals(this.associations, profileRequestModel.associations) && + Objects.equals(this.honors, profileRequestModel.honors) && + Objects.equals(this.publicRepository, profileRequestModel.publicRepository) && + Objects.equals(this.repositoryUrl, profileRequestModel.repositoryUrl) && + Objects.equals(this.professionalHeadline, profileRequestModel.professionalHeadline) && + Objects.equals(this.currency, profileRequestModel.currency) && + Objects.equals(this.starredUrl, profileRequestModel.starredUrl) && + Objects.equals(this.gistsUrl, profileRequestModel.gistsUrl) && + Objects.equals(this.gravatarImageUrl, profileRequestModel.gravatarImageUrl) && + Objects.equals(this.externalUserLoginId, profileRequestModel.externalUserLoginId) && + Objects.equals(this.interestedIn, profileRequestModel.interestedIn) && + Objects.equals(this.followersCount, profileRequestModel.followersCount) && + Objects.equals(this.friendsCount, profileRequestModel.friendsCount) && + Objects.equals(this.totalStatusesCount, profileRequestModel.totalStatusesCount) && + Objects.equals(this.numRecommenders, profileRequestModel.numRecommenders) && + Objects.equals(this.totalPrivateRepository, profileRequestModel.totalPrivateRepository) && + Objects.equals(this.publicGists, profileRequestModel.publicGists) && + Objects.equals(this.privateGists, profileRequestModel.privateGists) && + Objects.equals(this.sessionLimit, profileRequestModel.sessionLimit) && + Objects.equals(this.customFields, profileRequestModel.customFields) && + Objects.equals(this.profileImageUrls, profileRequestModel.profileImageUrls) && + Objects.equals(this.webProfiles, profileRequestModel.webProfiles) && + Objects.equals(this.securityQuestionAnswer, profileRequestModel.securityQuestionAnswer) && + Objects.equals(this.country, profileRequestModel.country) && + Objects.equals(this.providerAccessCredential, profileRequestModel.providerAccessCredential) && + Objects.equals(this.suggestions, profileRequestModel.suggestions) && + Objects.equals(this.subscription, profileRequestModel.subscription) && + Objects.equals(this.privacyPolicy, profileRequestModel.privacyPolicy) && + Objects.equals(this.piNInfo, profileRequestModel.piNInfo) && + Objects.equals(this.addresses, profileRequestModel.addresses) && + Objects.equals(this.positions, profileRequestModel.positions) && + Objects.equals(this.educations, profileRequestModel.educations) && + Objects.equals(this.phoneNumbers, profileRequestModel.phoneNumbers) && + Objects.equals(this.imAccounts, profileRequestModel.imAccounts) && + Objects.equals(this.interests, profileRequestModel.interests) && + Objects.equals(this.sports, profileRequestModel.sports) && + Objects.equals(this.inspirationalPeople, profileRequestModel.inspirationalPeople) && + Objects.equals(this.awards, profileRequestModel.awards) && + Objects.equals(this.skills, profileRequestModel.skills) && + Objects.equals(this.currentStatus, profileRequestModel.currentStatus) && + Objects.equals(this.certifications, profileRequestModel.certifications) && + Objects.equals(this.courses, profileRequestModel.courses) && + Objects.equals(this.volunteer, profileRequestModel.volunteer) && + Objects.equals(this.recommendationsReceived, profileRequestModel.recommendationsReceived) && + Objects.equals(this.languages, profileRequestModel.languages) && + Objects.equals(this.projects, profileRequestModel.projects) && + Objects.equals(this.games, profileRequestModel.games) && + Objects.equals(this.family, profileRequestModel.family) && + Objects.equals(this.teleVisionShow, profileRequestModel.teleVisionShow) && + Objects.equals(this.mutualFriends, profileRequestModel.mutualFriends) && + Objects.equals(this.movies, profileRequestModel.movies) && + Objects.equals(this.books, profileRequestModel.books) && + Objects.equals(this.patents, profileRequestModel.patents) && + Objects.equals(this.favoriteThings, profileRequestModel.favoriteThings) && + Objects.equals(this.relatedProfileViews, profileRequestModel.relatedProfileViews) && + Objects.equals(this.placesLived, profileRequestModel.placesLived) && + Objects.equals(this.publications, profileRequestModel.publications) && + Objects.equals(this.jobBookmarks, profileRequestModel.jobBookmarks) && + Objects.equals(this.badges, profileRequestModel.badges) && + Objects.equals(this.memberUrlResources, profileRequestModel.memberUrlResources) && + Objects.equals(this.externalIds, profileRequestModel.externalIds) && + Objects.equals(this.isEmailSubscribed, profileRequestModel.isEmailSubscribed) && + Objects.equals(this.isProtected, profileRequestModel.isProtected) && + Objects.equals(this.hireable, profileRequestModel.hireable) && + Objects.equals(this.isTwoFactorAuthenticationEnabled, profileRequestModel.isTwoFactorAuthenticationEnabled) && + Objects.equals(this.disableLogin, profileRequestModel.disableLogin) && + Objects.equals(this.acceptPrivacyPolicy, profileRequestModel.acceptPrivacyPolicy) && + Objects.equals(this.recaptchaResponseField, profileRequestModel.recaptchaResponseField) && + Objects.equals(this.recaptchaChallengeField, profileRequestModel.recaptchaChallengeField) && + Objects.equals(this.captchaModel, profileRequestModel.captchaModel) && + Objects.equals(this.registrationSource, profileRequestModel.registrationSource) && + Objects.equals(this.fullName, profileRequestModel.fullName) && + Objects.equals(this.consents, profileRequestModel.consents) && + Objects.equals(this.password, profileRequestModel.password) && + Objects.equals(this.email, profileRequestModel.email)&& + Objects.equals(this.additionalProperties, profileRequestModel.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(userName, phoneId, gender, birthDate, prefix, firstName, middleName, lastName, suffix, nickName, profileName, about, company, imageUrl, timeZone, website, thumbnailImageUrl, favicon, profileUrl, homeTown, state, city, industry, localLanguage, language, coverPhoto, tagLine, mainAddress, localCity, profileCity, localCountry, profileCountry, quota, religion, political, relationshipStatus, httpsImageUrl, isGeoEnabled, associations, honors, publicRepository, repositoryUrl, professionalHeadline, currency, starredUrl, gistsUrl, gravatarImageUrl, externalUserLoginId, interestedIn, followersCount, friendsCount, totalStatusesCount, numRecommenders, totalPrivateRepository, publicGists, privateGists, sessionLimit, customFields, profileImageUrls, webProfiles, securityQuestionAnswer, country, providerAccessCredential, suggestions, subscription, privacyPolicy, piNInfo, addresses, positions, educations, phoneNumbers, imAccounts, interests, sports, inspirationalPeople, awards, skills, currentStatus, certifications, courses, volunteer, recommendationsReceived, languages, projects, games, family, teleVisionShow, mutualFriends, movies, books, patents, favoriteThings, relatedProfileViews, placesLived, publications, jobBookmarks, badges, memberUrlResources, externalIds, isEmailSubscribed, isProtected, hireable, isTwoFactorAuthenticationEnabled, disableLogin, acceptPrivacyPolicy, recaptchaResponseField, recaptchaChallengeField, captchaModel, registrationSource, fullName, consents, password, email, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModel {\n"); + sb.append(" userName: ").append(toIndentedString(userName)).append("\n"); + sb.append(" phoneId: ").append(toIndentedString(phoneId)).append("\n"); + sb.append(" gender: ").append(toIndentedString(gender)).append("\n"); + sb.append(" birthDate: ").append(toIndentedString(birthDate)).append("\n"); + sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" middleName: ").append(toIndentedString(middleName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" suffix: ").append(toIndentedString(suffix)).append("\n"); + sb.append(" nickName: ").append(toIndentedString(nickName)).append("\n"); + sb.append(" profileName: ").append(toIndentedString(profileName)).append("\n"); + sb.append(" about: ").append(toIndentedString(about)).append("\n"); + sb.append(" company: ").append(toIndentedString(company)).append("\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); + sb.append(" website: ").append(toIndentedString(website)).append("\n"); + sb.append(" thumbnailImageUrl: ").append(toIndentedString(thumbnailImageUrl)).append("\n"); + sb.append(" favicon: ").append(toIndentedString(favicon)).append("\n"); + sb.append(" profileUrl: ").append(toIndentedString(profileUrl)).append("\n"); + sb.append(" homeTown: ").append(toIndentedString(homeTown)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" industry: ").append(toIndentedString(industry)).append("\n"); + sb.append(" localLanguage: ").append(toIndentedString(localLanguage)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" coverPhoto: ").append(toIndentedString(coverPhoto)).append("\n"); + sb.append(" tagLine: ").append(toIndentedString(tagLine)).append("\n"); + sb.append(" mainAddress: ").append(toIndentedString(mainAddress)).append("\n"); + sb.append(" localCity: ").append(toIndentedString(localCity)).append("\n"); + sb.append(" profileCity: ").append(toIndentedString(profileCity)).append("\n"); + sb.append(" localCountry: ").append(toIndentedString(localCountry)).append("\n"); + sb.append(" profileCountry: ").append(toIndentedString(profileCountry)).append("\n"); + sb.append(" quota: ").append(toIndentedString(quota)).append("\n"); + sb.append(" religion: ").append(toIndentedString(religion)).append("\n"); + sb.append(" political: ").append(toIndentedString(political)).append("\n"); + sb.append(" relationshipStatus: ").append(toIndentedString(relationshipStatus)).append("\n"); + sb.append(" httpsImageUrl: ").append(toIndentedString(httpsImageUrl)).append("\n"); + sb.append(" isGeoEnabled: ").append(toIndentedString(isGeoEnabled)).append("\n"); + sb.append(" associations: ").append(toIndentedString(associations)).append("\n"); + sb.append(" honors: ").append(toIndentedString(honors)).append("\n"); + sb.append(" publicRepository: ").append(toIndentedString(publicRepository)).append("\n"); + sb.append(" repositoryUrl: ").append(toIndentedString(repositoryUrl)).append("\n"); + sb.append(" professionalHeadline: ").append(toIndentedString(professionalHeadline)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" starredUrl: ").append(toIndentedString(starredUrl)).append("\n"); + sb.append(" gistsUrl: ").append(toIndentedString(gistsUrl)).append("\n"); + sb.append(" gravatarImageUrl: ").append(toIndentedString(gravatarImageUrl)).append("\n"); + sb.append(" externalUserLoginId: ").append(toIndentedString(externalUserLoginId)).append("\n"); + sb.append(" interestedIn: ").append(toIndentedString(interestedIn)).append("\n"); + sb.append(" followersCount: ").append(toIndentedString(followersCount)).append("\n"); + sb.append(" friendsCount: ").append(toIndentedString(friendsCount)).append("\n"); + sb.append(" totalStatusesCount: ").append(toIndentedString(totalStatusesCount)).append("\n"); + sb.append(" numRecommenders: ").append(toIndentedString(numRecommenders)).append("\n"); + sb.append(" totalPrivateRepository: ").append(toIndentedString(totalPrivateRepository)).append("\n"); + sb.append(" publicGists: ").append(toIndentedString(publicGists)).append("\n"); + sb.append(" privateGists: ").append(toIndentedString(privateGists)).append("\n"); + sb.append(" sessionLimit: ").append(toIndentedString(sessionLimit)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" profileImageUrls: ").append(toIndentedString(profileImageUrls)).append("\n"); + sb.append(" webProfiles: ").append(toIndentedString(webProfiles)).append("\n"); + sb.append(" securityQuestionAnswer: ").append(toIndentedString(securityQuestionAnswer)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" providerAccessCredential: ").append(toIndentedString(providerAccessCredential)).append("\n"); + sb.append(" suggestions: ").append(toIndentedString(suggestions)).append("\n"); + sb.append(" subscription: ").append(toIndentedString(subscription)).append("\n"); + sb.append(" privacyPolicy: ").append(toIndentedString(privacyPolicy)).append("\n"); + sb.append(" piNInfo: ").append(toIndentedString(piNInfo)).append("\n"); + sb.append(" addresses: ").append(toIndentedString(addresses)).append("\n"); + sb.append(" positions: ").append(toIndentedString(positions)).append("\n"); + sb.append(" educations: ").append(toIndentedString(educations)).append("\n"); + sb.append(" phoneNumbers: ").append(toIndentedString(phoneNumbers)).append("\n"); + sb.append(" imAccounts: ").append(toIndentedString(imAccounts)).append("\n"); + sb.append(" interests: ").append(toIndentedString(interests)).append("\n"); + sb.append(" sports: ").append(toIndentedString(sports)).append("\n"); + sb.append(" inspirationalPeople: ").append(toIndentedString(inspirationalPeople)).append("\n"); + sb.append(" awards: ").append(toIndentedString(awards)).append("\n"); + sb.append(" skills: ").append(toIndentedString(skills)).append("\n"); + sb.append(" currentStatus: ").append(toIndentedString(currentStatus)).append("\n"); + sb.append(" certifications: ").append(toIndentedString(certifications)).append("\n"); + sb.append(" courses: ").append(toIndentedString(courses)).append("\n"); + sb.append(" volunteer: ").append(toIndentedString(volunteer)).append("\n"); + sb.append(" recommendationsReceived: ").append(toIndentedString(recommendationsReceived)).append("\n"); + sb.append(" languages: ").append(toIndentedString(languages)).append("\n"); + sb.append(" projects: ").append(toIndentedString(projects)).append("\n"); + sb.append(" games: ").append(toIndentedString(games)).append("\n"); + sb.append(" family: ").append(toIndentedString(family)).append("\n"); + sb.append(" teleVisionShow: ").append(toIndentedString(teleVisionShow)).append("\n"); + sb.append(" mutualFriends: ").append(toIndentedString(mutualFriends)).append("\n"); + sb.append(" movies: ").append(toIndentedString(movies)).append("\n"); + sb.append(" books: ").append(toIndentedString(books)).append("\n"); + sb.append(" patents: ").append(toIndentedString(patents)).append("\n"); + sb.append(" favoriteThings: ").append(toIndentedString(favoriteThings)).append("\n"); + sb.append(" relatedProfileViews: ").append(toIndentedString(relatedProfileViews)).append("\n"); + sb.append(" placesLived: ").append(toIndentedString(placesLived)).append("\n"); + sb.append(" publications: ").append(toIndentedString(publications)).append("\n"); + sb.append(" jobBookmarks: ").append(toIndentedString(jobBookmarks)).append("\n"); + sb.append(" badges: ").append(toIndentedString(badges)).append("\n"); + sb.append(" memberUrlResources: ").append(toIndentedString(memberUrlResources)).append("\n"); + sb.append(" externalIds: ").append(toIndentedString(externalIds)).append("\n"); + sb.append(" isEmailSubscribed: ").append(toIndentedString(isEmailSubscribed)).append("\n"); + sb.append(" isProtected: ").append(toIndentedString(isProtected)).append("\n"); + sb.append(" hireable: ").append(toIndentedString(hireable)).append("\n"); + sb.append(" isTwoFactorAuthenticationEnabled: ").append(toIndentedString(isTwoFactorAuthenticationEnabled)).append("\n"); + sb.append(" disableLogin: ").append(toIndentedString(disableLogin)).append("\n"); + sb.append(" acceptPrivacyPolicy: ").append(toIndentedString(acceptPrivacyPolicy)).append("\n"); + sb.append(" recaptchaResponseField: ").append(toIndentedString(recaptchaResponseField)).append("\n"); + sb.append(" recaptchaChallengeField: ").append(toIndentedString(recaptchaChallengeField)).append("\n"); + sb.append(" captchaModel: ").append(toIndentedString(captchaModel)).append("\n"); + sb.append(" registrationSource: ").append(toIndentedString(registrationSource)).append("\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append(" consents: ").append(toIndentedString(consents)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("UserName"); + openapiFields.add("PhoneId"); + openapiFields.add("Gender"); + openapiFields.add("BirthDate"); + openapiFields.add("Prefix"); + openapiFields.add("FirstName"); + openapiFields.add("MiddleName"); + openapiFields.add("LastName"); + openapiFields.add("Suffix"); + openapiFields.add("NickName"); + openapiFields.add("ProfileName"); + openapiFields.add("About"); + openapiFields.add("Company"); + openapiFields.add("ImageUrl"); + openapiFields.add("TimeZone"); + openapiFields.add("Website"); + openapiFields.add("ThumbnailImageUrl"); + openapiFields.add("Favicon"); + openapiFields.add("ProfileUrl"); + openapiFields.add("HomeTown"); + openapiFields.add("State"); + openapiFields.add("City"); + openapiFields.add("Industry"); + openapiFields.add("LocalLanguage"); + openapiFields.add("Language"); + openapiFields.add("CoverPhoto"); + openapiFields.add("TagLine"); + openapiFields.add("MainAddress"); + openapiFields.add("LocalCity"); + openapiFields.add("ProfileCity"); + openapiFields.add("LocalCountry"); + openapiFields.add("ProfileCountry"); + openapiFields.add("Quota"); + openapiFields.add("Religion"); + openapiFields.add("Political"); + openapiFields.add("RelationshipStatus"); + openapiFields.add("HttpsImageUrl"); + openapiFields.add("IsGeoEnabled"); + openapiFields.add("Associations"); + openapiFields.add("Honors"); + openapiFields.add("PublicRepository"); + openapiFields.add("RepositoryUrl"); + openapiFields.add("ProfessionalHeadline"); + openapiFields.add("Currency"); + openapiFields.add("StarredUrl"); + openapiFields.add("GistsUrl"); + openapiFields.add("GravatarImageUrl"); + openapiFields.add("ExternalUserLoginId"); + openapiFields.add("InterestedIn"); + openapiFields.add("FollowersCount"); + openapiFields.add("FriendsCount"); + openapiFields.add("TotalStatusesCount"); + openapiFields.add("NumRecommenders"); + openapiFields.add("TotalPrivateRepository"); + openapiFields.add("PublicGists"); + openapiFields.add("PrivateGists"); + openapiFields.add("SessionLimit"); + openapiFields.add("CustomFields"); + openapiFields.add("ProfileImageUrls"); + openapiFields.add("WebProfiles"); + openapiFields.add("SecurityQuestionAnswer"); + openapiFields.add("Country"); + openapiFields.add("ProviderAccessCredential"); + openapiFields.add("Suggestions"); + openapiFields.add("Subscription"); + openapiFields.add("PrivacyPolicy"); + openapiFields.add("PINInfo"); + openapiFields.add("Addresses"); + openapiFields.add("Positions"); + openapiFields.add("Educations"); + openapiFields.add("PhoneNumbers"); + openapiFields.add("IMAccounts"); + openapiFields.add("Interests"); + openapiFields.add("Sports"); + openapiFields.add("InspirationalPeople"); + openapiFields.add("Awards"); + openapiFields.add("Skills"); + openapiFields.add("CurrentStatus"); + openapiFields.add("Certifications"); + openapiFields.add("Courses"); + openapiFields.add("Volunteer"); + openapiFields.add("RecommendationsReceived"); + openapiFields.add("Languages"); + openapiFields.add("Projects"); + openapiFields.add("Games"); + openapiFields.add("Family"); + openapiFields.add("TeleVisionShow"); + openapiFields.add("MutualFriends"); + openapiFields.add("Movies"); + openapiFields.add("Books"); + openapiFields.add("Patents"); + openapiFields.add("FavoriteThings"); + openapiFields.add("RelatedProfileViews"); + openapiFields.add("PlacesLived"); + openapiFields.add("Publications"); + openapiFields.add("JobBookmarks"); + openapiFields.add("Badges"); + openapiFields.add("MemberUrlResources"); + openapiFields.add("ExternalIds"); + openapiFields.add("IsEmailSubscribed"); + openapiFields.add("IsProtected"); + openapiFields.add("Hireable"); + openapiFields.add("IsTwoFactorAuthenticationEnabled"); + openapiFields.add("DisableLogin"); + openapiFields.add("AcceptPrivacyPolicy"); + openapiFields.add("recaptcha_response_field"); + openapiFields.add("recaptcha_challenge_field"); + openapiFields.add("CaptchaModel"); + openapiFields.add("RegistrationSource"); + openapiFields.add("FullName"); + openapiFields.add("Consents"); + openapiFields.add("Password"); + openapiFields.add("Email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModel is not found in the empty JSON string", ProfileRequestModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("UserName") != null && !jsonObj.get("UserName").isJsonNull()) && !jsonObj.get("UserName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UserName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UserName").toString())); + } + if ((jsonObj.get("PhoneId") != null && !jsonObj.get("PhoneId").isJsonNull()) && !jsonObj.get("PhoneId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PhoneId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PhoneId").toString())); + } + if ((jsonObj.get("Gender") != null && !jsonObj.get("Gender").isJsonNull()) && !jsonObj.get("Gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Gender").toString())); + } + if ((jsonObj.get("BirthDate") != null && !jsonObj.get("BirthDate").isJsonNull()) && !jsonObj.get("BirthDate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `BirthDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BirthDate").toString())); + } + if ((jsonObj.get("Prefix") != null && !jsonObj.get("Prefix").isJsonNull()) && !jsonObj.get("Prefix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Prefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Prefix").toString())); + } + if ((jsonObj.get("FirstName") != null && !jsonObj.get("FirstName").isJsonNull()) && !jsonObj.get("FirstName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FirstName").toString())); + } + if ((jsonObj.get("MiddleName") != null && !jsonObj.get("MiddleName").isJsonNull()) && !jsonObj.get("MiddleName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MiddleName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MiddleName").toString())); + } + if ((jsonObj.get("LastName") != null && !jsonObj.get("LastName").isJsonNull()) && !jsonObj.get("LastName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastName").toString())); + } + if ((jsonObj.get("Suffix") != null && !jsonObj.get("Suffix").isJsonNull()) && !jsonObj.get("Suffix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Suffix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Suffix").toString())); + } + if ((jsonObj.get("NickName") != null && !jsonObj.get("NickName").isJsonNull()) && !jsonObj.get("NickName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NickName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NickName").toString())); + } + if ((jsonObj.get("ProfileName") != null && !jsonObj.get("ProfileName").isJsonNull()) && !jsonObj.get("ProfileName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileName").toString())); + } + if ((jsonObj.get("About") != null && !jsonObj.get("About").isJsonNull()) && !jsonObj.get("About").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `About` to be a primitive type in the JSON string but got `%s`", jsonObj.get("About").toString())); + } + if ((jsonObj.get("Company") != null && !jsonObj.get("Company").isJsonNull()) && !jsonObj.get("Company").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Company` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Company").toString())); + } + if ((jsonObj.get("ImageUrl") != null && !jsonObj.get("ImageUrl").isJsonNull()) && !jsonObj.get("ImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ImageUrl").toString())); + } + if ((jsonObj.get("TimeZone") != null && !jsonObj.get("TimeZone").isJsonNull()) && !jsonObj.get("TimeZone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TimeZone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TimeZone").toString())); + } + if ((jsonObj.get("Website") != null && !jsonObj.get("Website").isJsonNull()) && !jsonObj.get("Website").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Website` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Website").toString())); + } + if ((jsonObj.get("ThumbnailImageUrl") != null && !jsonObj.get("ThumbnailImageUrl").isJsonNull()) && !jsonObj.get("ThumbnailImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ThumbnailImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ThumbnailImageUrl").toString())); + } + if ((jsonObj.get("Favicon") != null && !jsonObj.get("Favicon").isJsonNull()) && !jsonObj.get("Favicon").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Favicon` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Favicon").toString())); + } + if ((jsonObj.get("ProfileUrl") != null && !jsonObj.get("ProfileUrl").isJsonNull()) && !jsonObj.get("ProfileUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileUrl").toString())); + } + if ((jsonObj.get("HomeTown") != null && !jsonObj.get("HomeTown").isJsonNull()) && !jsonObj.get("HomeTown").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HomeTown` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HomeTown").toString())); + } + if ((jsonObj.get("State") != null && !jsonObj.get("State").isJsonNull()) && !jsonObj.get("State").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `State` to be a primitive type in the JSON string but got `%s`", jsonObj.get("State").toString())); + } + if ((jsonObj.get("City") != null && !jsonObj.get("City").isJsonNull()) && !jsonObj.get("City").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `City` to be a primitive type in the JSON string but got `%s`", jsonObj.get("City").toString())); + } + if ((jsonObj.get("Industry") != null && !jsonObj.get("Industry").isJsonNull()) && !jsonObj.get("Industry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Industry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Industry").toString())); + } + if ((jsonObj.get("LocalLanguage") != null && !jsonObj.get("LocalLanguage").isJsonNull()) && !jsonObj.get("LocalLanguage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalLanguage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalLanguage").toString())); + } + if ((jsonObj.get("Language") != null && !jsonObj.get("Language").isJsonNull()) && !jsonObj.get("Language").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Language` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Language").toString())); + } + if ((jsonObj.get("CoverPhoto") != null && !jsonObj.get("CoverPhoto").isJsonNull()) && !jsonObj.get("CoverPhoto").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CoverPhoto` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CoverPhoto").toString())); + } + if ((jsonObj.get("TagLine") != null && !jsonObj.get("TagLine").isJsonNull()) && !jsonObj.get("TagLine").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TagLine` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TagLine").toString())); + } + if ((jsonObj.get("MainAddress") != null && !jsonObj.get("MainAddress").isJsonNull()) && !jsonObj.get("MainAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MainAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MainAddress").toString())); + } + if ((jsonObj.get("LocalCity") != null && !jsonObj.get("LocalCity").isJsonNull()) && !jsonObj.get("LocalCity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalCity").toString())); + } + if ((jsonObj.get("ProfileCity") != null && !jsonObj.get("ProfileCity").isJsonNull()) && !jsonObj.get("ProfileCity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileCity").toString())); + } + if ((jsonObj.get("LocalCountry") != null && !jsonObj.get("LocalCountry").isJsonNull()) && !jsonObj.get("LocalCountry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalCountry").toString())); + } + if ((jsonObj.get("ProfileCountry") != null && !jsonObj.get("ProfileCountry").isJsonNull()) && !jsonObj.get("ProfileCountry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileCountry").toString())); + } + if ((jsonObj.get("Quota") != null && !jsonObj.get("Quota").isJsonNull()) && !jsonObj.get("Quota").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Quota` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Quota").toString())); + } + if ((jsonObj.get("Religion") != null && !jsonObj.get("Religion").isJsonNull()) && !jsonObj.get("Religion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Religion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Religion").toString())); + } + if ((jsonObj.get("Political") != null && !jsonObj.get("Political").isJsonNull()) && !jsonObj.get("Political").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Political` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Political").toString())); + } + if ((jsonObj.get("RelationshipStatus") != null && !jsonObj.get("RelationshipStatus").isJsonNull()) && !jsonObj.get("RelationshipStatus").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RelationshipStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RelationshipStatus").toString())); + } + if ((jsonObj.get("HttpsImageUrl") != null && !jsonObj.get("HttpsImageUrl").isJsonNull()) && !jsonObj.get("HttpsImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HttpsImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HttpsImageUrl").toString())); + } + if ((jsonObj.get("IsGeoEnabled") != null && !jsonObj.get("IsGeoEnabled").isJsonNull()) && !jsonObj.get("IsGeoEnabled").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IsGeoEnabled` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IsGeoEnabled").toString())); + } + if ((jsonObj.get("Associations") != null && !jsonObj.get("Associations").isJsonNull()) && !jsonObj.get("Associations").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Associations` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Associations").toString())); + } + if ((jsonObj.get("Honors") != null && !jsonObj.get("Honors").isJsonNull()) && !jsonObj.get("Honors").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Honors` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Honors").toString())); + } + if ((jsonObj.get("PublicRepository") != null && !jsonObj.get("PublicRepository").isJsonNull()) && !jsonObj.get("PublicRepository").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PublicRepository` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PublicRepository").toString())); + } + if ((jsonObj.get("RepositoryUrl") != null && !jsonObj.get("RepositoryUrl").isJsonNull()) && !jsonObj.get("RepositoryUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RepositoryUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RepositoryUrl").toString())); + } + if ((jsonObj.get("ProfessionalHeadline") != null && !jsonObj.get("ProfessionalHeadline").isJsonNull()) && !jsonObj.get("ProfessionalHeadline").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfessionalHeadline` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfessionalHeadline").toString())); + } + if ((jsonObj.get("Currency") != null && !jsonObj.get("Currency").isJsonNull()) && !jsonObj.get("Currency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Currency").toString())); + } + if ((jsonObj.get("StarredUrl") != null && !jsonObj.get("StarredUrl").isJsonNull()) && !jsonObj.get("StarredUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `StarredUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("StarredUrl").toString())); + } + if ((jsonObj.get("GistsUrl") != null && !jsonObj.get("GistsUrl").isJsonNull()) && !jsonObj.get("GistsUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GistsUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GistsUrl").toString())); + } + if ((jsonObj.get("GravatarImageUrl") != null && !jsonObj.get("GravatarImageUrl").isJsonNull()) && !jsonObj.get("GravatarImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GravatarImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GravatarImageUrl").toString())); + } + if ((jsonObj.get("ExternalUserLoginId") != null && !jsonObj.get("ExternalUserLoginId").isJsonNull()) && !jsonObj.get("ExternalUserLoginId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ExternalUserLoginId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ExternalUserLoginId").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("InterestedIn") != null && !jsonObj.get("InterestedIn").isJsonNull() && !jsonObj.get("InterestedIn").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `InterestedIn` to be an array in the JSON string but got `%s`", jsonObj.get("InterestedIn").toString())); + } + // validate the optional field `Country` + if (jsonObj.get("Country") != null && !jsonObj.get("Country").isJsonNull()) { + ProfileRequestModelCountry.validateJsonElement(jsonObj.get("Country")); + } + // validate the optional field `ProviderAccessCredential` + if (jsonObj.get("ProviderAccessCredential") != null && !jsonObj.get("ProviderAccessCredential").isJsonNull()) { + ProfileRequestModelProviderAccessCredential.validateJsonElement(jsonObj.get("ProviderAccessCredential")); + } + // validate the optional field `Suggestions` + if (jsonObj.get("Suggestions") != null && !jsonObj.get("Suggestions").isJsonNull()) { + ProfileRequestModelSuggestions.validateJsonElement(jsonObj.get("Suggestions")); + } + // validate the optional field `Subscription` + if (jsonObj.get("Subscription") != null && !jsonObj.get("Subscription").isJsonNull()) { + ProfileRequestModelSubscription.validateJsonElement(jsonObj.get("Subscription")); + } + // validate the optional field `PrivacyPolicy` + if (jsonObj.get("PrivacyPolicy") != null && !jsonObj.get("PrivacyPolicy").isJsonNull()) { + ProfileRequestModelPrivacyPolicy.validateJsonElement(jsonObj.get("PrivacyPolicy")); + } + // validate the optional field `PINInfo` + if (jsonObj.get("PINInfo") != null && !jsonObj.get("PINInfo").isJsonNull()) { + ProfileRequestModelPINInfo.validateJsonElement(jsonObj.get("PINInfo")); + } + if (jsonObj.get("Addresses") != null && !jsonObj.get("Addresses").isJsonNull()) { + JsonArray jsonArrayaddresses = jsonObj.getAsJsonArray("Addresses"); + if (jsonArrayaddresses != null) { + // ensure the json data is an array + if (!jsonObj.get("Addresses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Addresses` to be an array in the JSON string but got `%s`", jsonObj.get("Addresses").toString())); + } + + // validate the optional field `Addresses` (array) + for (int i = 0; i < jsonArrayaddresses.size(); i++) { + ProfileRequestModelAddressesInner.validateJsonElement(jsonArrayaddresses.get(i)); + }; + } + } + if (jsonObj.get("Positions") != null && !jsonObj.get("Positions").isJsonNull()) { + JsonArray jsonArraypositions = jsonObj.getAsJsonArray("Positions"); + if (jsonArraypositions != null) { + // ensure the json data is an array + if (!jsonObj.get("Positions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Positions` to be an array in the JSON string but got `%s`", jsonObj.get("Positions").toString())); + } + + // validate the optional field `Positions` (array) + for (int i = 0; i < jsonArraypositions.size(); i++) { + ProfileRequestModelPositionsInner.validateJsonElement(jsonArraypositions.get(i)); + }; + } + } + if (jsonObj.get("Educations") != null && !jsonObj.get("Educations").isJsonNull()) { + JsonArray jsonArrayeducations = jsonObj.getAsJsonArray("Educations"); + if (jsonArrayeducations != null) { + // ensure the json data is an array + if (!jsonObj.get("Educations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Educations` to be an array in the JSON string but got `%s`", jsonObj.get("Educations").toString())); + } + + // validate the optional field `Educations` (array) + for (int i = 0; i < jsonArrayeducations.size(); i++) { + ProfileRequestModelEducationsInner.validateJsonElement(jsonArrayeducations.get(i)); + }; + } + } + if (jsonObj.get("PhoneNumbers") != null && !jsonObj.get("PhoneNumbers").isJsonNull()) { + JsonArray jsonArrayphoneNumbers = jsonObj.getAsJsonArray("PhoneNumbers"); + if (jsonArrayphoneNumbers != null) { + // ensure the json data is an array + if (!jsonObj.get("PhoneNumbers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PhoneNumbers` to be an array in the JSON string but got `%s`", jsonObj.get("PhoneNumbers").toString())); + } + + // validate the optional field `PhoneNumbers` (array) + for (int i = 0; i < jsonArrayphoneNumbers.size(); i++) { + ProfileRequestModelPhoneNumbersInner.validateJsonElement(jsonArrayphoneNumbers.get(i)); + }; + } + } + if (jsonObj.get("IMAccounts") != null && !jsonObj.get("IMAccounts").isJsonNull()) { + JsonArray jsonArrayimAccounts = jsonObj.getAsJsonArray("IMAccounts"); + if (jsonArrayimAccounts != null) { + // ensure the json data is an array + if (!jsonObj.get("IMAccounts").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `IMAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("IMAccounts").toString())); + } + + // validate the optional field `IMAccounts` (array) + for (int i = 0; i < jsonArrayimAccounts.size(); i++) { + ProfileRequestModelIMAccountsInner.validateJsonElement(jsonArrayimAccounts.get(i)); + }; + } + } + if (jsonObj.get("Interests") != null && !jsonObj.get("Interests").isJsonNull()) { + JsonArray jsonArrayinterests = jsonObj.getAsJsonArray("Interests"); + if (jsonArrayinterests != null) { + // ensure the json data is an array + if (!jsonObj.get("Interests").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Interests` to be an array in the JSON string but got `%s`", jsonObj.get("Interests").toString())); + } + + // validate the optional field `Interests` (array) + for (int i = 0; i < jsonArrayinterests.size(); i++) { + ProfileRequestModelInterestsInner.validateJsonElement(jsonArrayinterests.get(i)); + }; + } + } + if (jsonObj.get("Sports") != null && !jsonObj.get("Sports").isJsonNull()) { + JsonArray jsonArraysports = jsonObj.getAsJsonArray("Sports"); + if (jsonArraysports != null) { + // ensure the json data is an array + if (!jsonObj.get("Sports").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Sports` to be an array in the JSON string but got `%s`", jsonObj.get("Sports").toString())); + } + + // validate the optional field `Sports` (array) + for (int i = 0; i < jsonArraysports.size(); i++) { + ProfileRequestModelSportsInner.validateJsonElement(jsonArraysports.get(i)); + }; + } + } + if (jsonObj.get("InspirationalPeople") != null && !jsonObj.get("InspirationalPeople").isJsonNull()) { + JsonArray jsonArrayinspirationalPeople = jsonObj.getAsJsonArray("InspirationalPeople"); + if (jsonArrayinspirationalPeople != null) { + // ensure the json data is an array + if (!jsonObj.get("InspirationalPeople").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `InspirationalPeople` to be an array in the JSON string but got `%s`", jsonObj.get("InspirationalPeople").toString())); + } + + // validate the optional field `InspirationalPeople` (array) + for (int i = 0; i < jsonArrayinspirationalPeople.size(); i++) { + ProfileRequestModelInspirationalPeopleInner.validateJsonElement(jsonArrayinspirationalPeople.get(i)); + }; + } + } + if (jsonObj.get("Awards") != null && !jsonObj.get("Awards").isJsonNull()) { + JsonArray jsonArrayawards = jsonObj.getAsJsonArray("Awards"); + if (jsonArrayawards != null) { + // ensure the json data is an array + if (!jsonObj.get("Awards").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Awards` to be an array in the JSON string but got `%s`", jsonObj.get("Awards").toString())); + } + + // validate the optional field `Awards` (array) + for (int i = 0; i < jsonArrayawards.size(); i++) { + ProfileRequestModelAwardsInner.validateJsonElement(jsonArrayawards.get(i)); + }; + } + } + if (jsonObj.get("Skills") != null && !jsonObj.get("Skills").isJsonNull()) { + JsonArray jsonArrayskills = jsonObj.getAsJsonArray("Skills"); + if (jsonArrayskills != null) { + // ensure the json data is an array + if (!jsonObj.get("Skills").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Skills` to be an array in the JSON string but got `%s`", jsonObj.get("Skills").toString())); + } + + // validate the optional field `Skills` (array) + for (int i = 0; i < jsonArrayskills.size(); i++) { + ProfileRequestModelSkillsInner.validateJsonElement(jsonArrayskills.get(i)); + }; + } + } + if (jsonObj.get("CurrentStatus") != null && !jsonObj.get("CurrentStatus").isJsonNull()) { + JsonArray jsonArraycurrentStatus = jsonObj.getAsJsonArray("CurrentStatus"); + if (jsonArraycurrentStatus != null) { + // ensure the json data is an array + if (!jsonObj.get("CurrentStatus").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `CurrentStatus` to be an array in the JSON string but got `%s`", jsonObj.get("CurrentStatus").toString())); + } + + // validate the optional field `CurrentStatus` (array) + for (int i = 0; i < jsonArraycurrentStatus.size(); i++) { + ProfileRequestModelCurrentStatusInner.validateJsonElement(jsonArraycurrentStatus.get(i)); + }; + } + } + if (jsonObj.get("Certifications") != null && !jsonObj.get("Certifications").isJsonNull()) { + JsonArray jsonArraycertifications = jsonObj.getAsJsonArray("Certifications"); + if (jsonArraycertifications != null) { + // ensure the json data is an array + if (!jsonObj.get("Certifications").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Certifications` to be an array in the JSON string but got `%s`", jsonObj.get("Certifications").toString())); + } + + // validate the optional field `Certifications` (array) + for (int i = 0; i < jsonArraycertifications.size(); i++) { + ProfileRequestModelCertificationsInner.validateJsonElement(jsonArraycertifications.get(i)); + }; + } + } + if (jsonObj.get("Courses") != null && !jsonObj.get("Courses").isJsonNull()) { + JsonArray jsonArraycourses = jsonObj.getAsJsonArray("Courses"); + if (jsonArraycourses != null) { + // ensure the json data is an array + if (!jsonObj.get("Courses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Courses` to be an array in the JSON string but got `%s`", jsonObj.get("Courses").toString())); + } + + // validate the optional field `Courses` (array) + for (int i = 0; i < jsonArraycourses.size(); i++) { + ProfileRequestModelCoursesInner.validateJsonElement(jsonArraycourses.get(i)); + }; + } + } + if (jsonObj.get("Volunteer") != null && !jsonObj.get("Volunteer").isJsonNull()) { + JsonArray jsonArrayvolunteer = jsonObj.getAsJsonArray("Volunteer"); + if (jsonArrayvolunteer != null) { + // ensure the json data is an array + if (!jsonObj.get("Volunteer").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Volunteer` to be an array in the JSON string but got `%s`", jsonObj.get("Volunteer").toString())); + } + + // validate the optional field `Volunteer` (array) + for (int i = 0; i < jsonArrayvolunteer.size(); i++) { + ProfileRequestModelVolunteerInner.validateJsonElement(jsonArrayvolunteer.get(i)); + }; + } + } + if (jsonObj.get("RecommendationsReceived") != null && !jsonObj.get("RecommendationsReceived").isJsonNull()) { + JsonArray jsonArrayrecommendationsReceived = jsonObj.getAsJsonArray("RecommendationsReceived"); + if (jsonArrayrecommendationsReceived != null) { + // ensure the json data is an array + if (!jsonObj.get("RecommendationsReceived").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RecommendationsReceived` to be an array in the JSON string but got `%s`", jsonObj.get("RecommendationsReceived").toString())); + } + + // validate the optional field `RecommendationsReceived` (array) + for (int i = 0; i < jsonArrayrecommendationsReceived.size(); i++) { + ProfileRequestModelRecommendationsReceivedInner.validateJsonElement(jsonArrayrecommendationsReceived.get(i)); + }; + } + } + if (jsonObj.get("Languages") != null && !jsonObj.get("Languages").isJsonNull()) { + JsonArray jsonArraylanguages = jsonObj.getAsJsonArray("Languages"); + if (jsonArraylanguages != null) { + // ensure the json data is an array + if (!jsonObj.get("Languages").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Languages` to be an array in the JSON string but got `%s`", jsonObj.get("Languages").toString())); + } + + // validate the optional field `Languages` (array) + for (int i = 0; i < jsonArraylanguages.size(); i++) { + ProfileRequestModelLanguagesInner.validateJsonElement(jsonArraylanguages.get(i)); + }; + } + } + if (jsonObj.get("Projects") != null && !jsonObj.get("Projects").isJsonNull()) { + JsonArray jsonArrayprojects = jsonObj.getAsJsonArray("Projects"); + if (jsonArrayprojects != null) { + // ensure the json data is an array + if (!jsonObj.get("Projects").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Projects` to be an array in the JSON string but got `%s`", jsonObj.get("Projects").toString())); + } + + // validate the optional field `Projects` (array) + for (int i = 0; i < jsonArrayprojects.size(); i++) { + ProfileRequestModelProjectsInner.validateJsonElement(jsonArrayprojects.get(i)); + }; + } + } + if (jsonObj.get("Games") != null && !jsonObj.get("Games").isJsonNull()) { + JsonArray jsonArraygames = jsonObj.getAsJsonArray("Games"); + if (jsonArraygames != null) { + // ensure the json data is an array + if (!jsonObj.get("Games").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Games` to be an array in the JSON string but got `%s`", jsonObj.get("Games").toString())); + } + + // validate the optional field `Games` (array) + for (int i = 0; i < jsonArraygames.size(); i++) { + ProfileRequestModelGamesInner.validateJsonElement(jsonArraygames.get(i)); + }; + } + } + if (jsonObj.get("Family") != null && !jsonObj.get("Family").isJsonNull()) { + JsonArray jsonArrayfamily = jsonObj.getAsJsonArray("Family"); + if (jsonArrayfamily != null) { + // ensure the json data is an array + if (!jsonObj.get("Family").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Family` to be an array in the JSON string but got `%s`", jsonObj.get("Family").toString())); + } + + // validate the optional field `Family` (array) + for (int i = 0; i < jsonArrayfamily.size(); i++) { + ProfileRequestModelFamilyInner.validateJsonElement(jsonArrayfamily.get(i)); + }; + } + } + if (jsonObj.get("TeleVisionShow") != null && !jsonObj.get("TeleVisionShow").isJsonNull()) { + JsonArray jsonArrayteleVisionShow = jsonObj.getAsJsonArray("TeleVisionShow"); + if (jsonArrayteleVisionShow != null) { + // ensure the json data is an array + if (!jsonObj.get("TeleVisionShow").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `TeleVisionShow` to be an array in the JSON string but got `%s`", jsonObj.get("TeleVisionShow").toString())); + } + + // validate the optional field `TeleVisionShow` (array) + for (int i = 0; i < jsonArrayteleVisionShow.size(); i++) { + ProfileRequestModelTeleVisionShowInner.validateJsonElement(jsonArrayteleVisionShow.get(i)); + }; + } + } + if (jsonObj.get("MutualFriends") != null && !jsonObj.get("MutualFriends").isJsonNull()) { + JsonArray jsonArraymutualFriends = jsonObj.getAsJsonArray("MutualFriends"); + if (jsonArraymutualFriends != null) { + // ensure the json data is an array + if (!jsonObj.get("MutualFriends").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `MutualFriends` to be an array in the JSON string but got `%s`", jsonObj.get("MutualFriends").toString())); + } + + // validate the optional field `MutualFriends` (array) + for (int i = 0; i < jsonArraymutualFriends.size(); i++) { + ProfileRequestModelMutualFriendsInner.validateJsonElement(jsonArraymutualFriends.get(i)); + }; + } + } + if (jsonObj.get("Movies") != null && !jsonObj.get("Movies").isJsonNull()) { + JsonArray jsonArraymovies = jsonObj.getAsJsonArray("Movies"); + if (jsonArraymovies != null) { + // ensure the json data is an array + if (!jsonObj.get("Movies").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Movies` to be an array in the JSON string but got `%s`", jsonObj.get("Movies").toString())); + } + + // validate the optional field `Movies` (array) + for (int i = 0; i < jsonArraymovies.size(); i++) { + ProfileRequestModelMoviesInner.validateJsonElement(jsonArraymovies.get(i)); + }; + } + } + if (jsonObj.get("Books") != null && !jsonObj.get("Books").isJsonNull()) { + JsonArray jsonArraybooks = jsonObj.getAsJsonArray("Books"); + if (jsonArraybooks != null) { + // ensure the json data is an array + if (!jsonObj.get("Books").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Books` to be an array in the JSON string but got `%s`", jsonObj.get("Books").toString())); + } + + // validate the optional field `Books` (array) + for (int i = 0; i < jsonArraybooks.size(); i++) { + ProfileRequestModelBooksInner.validateJsonElement(jsonArraybooks.get(i)); + }; + } + } + if (jsonObj.get("Patents") != null && !jsonObj.get("Patents").isJsonNull()) { + JsonArray jsonArraypatents = jsonObj.getAsJsonArray("Patents"); + if (jsonArraypatents != null) { + // ensure the json data is an array + if (!jsonObj.get("Patents").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Patents` to be an array in the JSON string but got `%s`", jsonObj.get("Patents").toString())); + } + + // validate the optional field `Patents` (array) + for (int i = 0; i < jsonArraypatents.size(); i++) { + ProfileRequestModelPatentsInner.validateJsonElement(jsonArraypatents.get(i)); + }; + } + } + if (jsonObj.get("FavoriteThings") != null && !jsonObj.get("FavoriteThings").isJsonNull()) { + JsonArray jsonArrayfavoriteThings = jsonObj.getAsJsonArray("FavoriteThings"); + if (jsonArrayfavoriteThings != null) { + // ensure the json data is an array + if (!jsonObj.get("FavoriteThings").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `FavoriteThings` to be an array in the JSON string but got `%s`", jsonObj.get("FavoriteThings").toString())); + } + + // validate the optional field `FavoriteThings` (array) + for (int i = 0; i < jsonArrayfavoriteThings.size(); i++) { + ProfileRequestModelFavoriteThingsInner.validateJsonElement(jsonArrayfavoriteThings.get(i)); + }; + } + } + if (jsonObj.get("RelatedProfileViews") != null && !jsonObj.get("RelatedProfileViews").isJsonNull()) { + JsonArray jsonArrayrelatedProfileViews = jsonObj.getAsJsonArray("RelatedProfileViews"); + if (jsonArrayrelatedProfileViews != null) { + // ensure the json data is an array + if (!jsonObj.get("RelatedProfileViews").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RelatedProfileViews` to be an array in the JSON string but got `%s`", jsonObj.get("RelatedProfileViews").toString())); + } + + // validate the optional field `RelatedProfileViews` (array) + for (int i = 0; i < jsonArrayrelatedProfileViews.size(); i++) { + ProfileRequestModelRelatedProfileViewsInner.validateJsonElement(jsonArrayrelatedProfileViews.get(i)); + }; + } + } + if (jsonObj.get("PlacesLived") != null && !jsonObj.get("PlacesLived").isJsonNull()) { + JsonArray jsonArrayplacesLived = jsonObj.getAsJsonArray("PlacesLived"); + if (jsonArrayplacesLived != null) { + // ensure the json data is an array + if (!jsonObj.get("PlacesLived").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PlacesLived` to be an array in the JSON string but got `%s`", jsonObj.get("PlacesLived").toString())); + } + + // validate the optional field `PlacesLived` (array) + for (int i = 0; i < jsonArrayplacesLived.size(); i++) { + ProfileRequestModelPlacesLivedInner.validateJsonElement(jsonArrayplacesLived.get(i)); + }; + } + } + if (jsonObj.get("Publications") != null && !jsonObj.get("Publications").isJsonNull()) { + JsonArray jsonArraypublications = jsonObj.getAsJsonArray("Publications"); + if (jsonArraypublications != null) { + // ensure the json data is an array + if (!jsonObj.get("Publications").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Publications` to be an array in the JSON string but got `%s`", jsonObj.get("Publications").toString())); + } + + // validate the optional field `Publications` (array) + for (int i = 0; i < jsonArraypublications.size(); i++) { + ProfileRequestModelPublicationsInner.validateJsonElement(jsonArraypublications.get(i)); + }; + } + } + if (jsonObj.get("JobBookmarks") != null && !jsonObj.get("JobBookmarks").isJsonNull()) { + JsonArray jsonArrayjobBookmarks = jsonObj.getAsJsonArray("JobBookmarks"); + if (jsonArrayjobBookmarks != null) { + // ensure the json data is an array + if (!jsonObj.get("JobBookmarks").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `JobBookmarks` to be an array in the JSON string but got `%s`", jsonObj.get("JobBookmarks").toString())); + } + + // validate the optional field `JobBookmarks` (array) + for (int i = 0; i < jsonArrayjobBookmarks.size(); i++) { + ProfileRequestModelJobBookmarksInner.validateJsonElement(jsonArrayjobBookmarks.get(i)); + }; + } + } + if (jsonObj.get("Badges") != null && !jsonObj.get("Badges").isJsonNull()) { + JsonArray jsonArraybadges = jsonObj.getAsJsonArray("Badges"); + if (jsonArraybadges != null) { + // ensure the json data is an array + if (!jsonObj.get("Badges").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Badges` to be an array in the JSON string but got `%s`", jsonObj.get("Badges").toString())); + } + + // validate the optional field `Badges` (array) + for (int i = 0; i < jsonArraybadges.size(); i++) { + ProfileRequestModelBadgesInner.validateJsonElement(jsonArraybadges.get(i)); + }; + } + } + if (jsonObj.get("MemberUrlResources") != null && !jsonObj.get("MemberUrlResources").isJsonNull()) { + JsonArray jsonArraymemberUrlResources = jsonObj.getAsJsonArray("MemberUrlResources"); + if (jsonArraymemberUrlResources != null) { + // ensure the json data is an array + if (!jsonObj.get("MemberUrlResources").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `MemberUrlResources` to be an array in the JSON string but got `%s`", jsonObj.get("MemberUrlResources").toString())); + } + + // validate the optional field `MemberUrlResources` (array) + for (int i = 0; i < jsonArraymemberUrlResources.size(); i++) { + ProfileRequestModelMemberUrlResourcesInner.validateJsonElement(jsonArraymemberUrlResources.get(i)); + }; + } + } + if (jsonObj.get("ExternalIds") != null && !jsonObj.get("ExternalIds").isJsonNull()) { + JsonArray jsonArrayexternalIds = jsonObj.getAsJsonArray("ExternalIds"); + if (jsonArrayexternalIds != null) { + // ensure the json data is an array + if (!jsonObj.get("ExternalIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ExternalIds` to be an array in the JSON string but got `%s`", jsonObj.get("ExternalIds").toString())); + } + + // validate the optional field `ExternalIds` (array) + for (int i = 0; i < jsonArrayexternalIds.size(); i++) { + ProfileRequestModelExternalIdsInner.validateJsonElement(jsonArrayexternalIds.get(i)); + }; + } + } + if ((jsonObj.get("recaptcha_response_field") != null && !jsonObj.get("recaptcha_response_field").isJsonNull()) && !jsonObj.get("recaptcha_response_field").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recaptcha_response_field` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recaptcha_response_field").toString())); + } + if ((jsonObj.get("recaptcha_challenge_field") != null && !jsonObj.get("recaptcha_challenge_field").isJsonNull()) && !jsonObj.get("recaptcha_challenge_field").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recaptcha_challenge_field` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recaptcha_challenge_field").toString())); + } + // validate the optional field `CaptchaModel` + if (jsonObj.get("CaptchaModel") != null && !jsonObj.get("CaptchaModel").isJsonNull()) { + ProfileRequestModelCaptchaModel.validateJsonElement(jsonObj.get("CaptchaModel")); + } + if ((jsonObj.get("RegistrationSource") != null && !jsonObj.get("RegistrationSource").isJsonNull()) && !jsonObj.get("RegistrationSource").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RegistrationSource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RegistrationSource").toString())); + } + if ((jsonObj.get("FullName") != null && !jsonObj.get("FullName").isJsonNull()) && !jsonObj.get("FullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FullName").toString())); + } + // validate the optional field `Consents` + if (jsonObj.get("Consents") != null && !jsonObj.get("Consents").isJsonNull()) { + ProfileRequestModelConsents.validateJsonElement(jsonObj.get("Consents")); + } + if ((jsonObj.get("Password") != null && !jsonObj.get("Password").isJsonNull()) && !jsonObj.get("Password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Password").toString())); + } + if (jsonObj.get("Email") != null && !jsonObj.get("Email").isJsonNull()) { + JsonArray jsonArrayemail = jsonObj.getAsJsonArray("Email"); + if (jsonArrayemail != null) { + // ensure the json data is an array + if (!jsonObj.get("Email").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Email` to be an array in the JSON string but got `%s`", jsonObj.get("Email").toString())); + } + + // validate the optional field `Email` (array) + for (int i = 0; i < jsonArrayemail.size(); i++) { + ProfileRequestModelEmailInner.validateJsonElement(jsonArrayemail.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModel>() { + @Override + public void write(JsonWriter out, ProfileRequestModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModel + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModel + */ + public static ProfileRequestModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModel.class); + } + + /** + * Convert an instance of ProfileRequestModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelAddressesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelAddressesInner.java new file mode 100644 index 0000000..17ad7c9 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelAddressesInner.java @@ -0,0 +1,557 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelAddressesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelAddressesInner { + public static final String SERIALIZED_NAME_TYPE = "Type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_ADDRESS_TYPE = "AddressType"; + @SerializedName(SERIALIZED_NAME_ADDRESS_TYPE) + @javax.annotation.Nullable + private String addressType; + + public static final String SERIALIZED_NAME_ADDRESS1 = "Address1"; + @SerializedName(SERIALIZED_NAME_ADDRESS1) + @javax.annotation.Nullable + private String address1; + + public static final String SERIALIZED_NAME_ADDRESS2 = "Address2"; + @SerializedName(SERIALIZED_NAME_ADDRESS2) + @javax.annotation.Nullable + private String address2; + + public static final String SERIALIZED_NAME_CITY = "City"; + @SerializedName(SERIALIZED_NAME_CITY) + @javax.annotation.Nullable + private String city; + + public static final String SERIALIZED_NAME_STATE = "State"; + @SerializedName(SERIALIZED_NAME_STATE) + @javax.annotation.Nullable + private String state; + + public static final String SERIALIZED_NAME_POSTAL_CODE = "PostalCode"; + @SerializedName(SERIALIZED_NAME_POSTAL_CODE) + @javax.annotation.Nullable + private String postalCode; + + public static final String SERIALIZED_NAME_REGION = "Region"; + @SerializedName(SERIALIZED_NAME_REGION) + @javax.annotation.Nullable + private String region; + + public static final String SERIALIZED_NAME_OP = "Op"; + @SerializedName(SERIALIZED_NAME_OP) + @javax.annotation.Nullable + private String op; + + public static final String SERIALIZED_NAME_COUNTRY = "Country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + @javax.annotation.Nullable + private String country; + + public ProfileRequestModelAddressesInner() { + } + + public ProfileRequestModelAddressesInner type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public ProfileRequestModelAddressesInner addressType(@javax.annotation.Nullable String addressType) { + this.addressType = addressType; + return this; + } + + /** + * Get addressType + * @return addressType + */ + @javax.annotation.Nullable + public String getAddressType() { + return addressType; + } + + public void setAddressType(@javax.annotation.Nullable String addressType) { + this.addressType = addressType; + } + + + public ProfileRequestModelAddressesInner address1(@javax.annotation.Nullable String address1) { + this.address1 = address1; + return this; + } + + /** + * Get address1 + * @return address1 + */ + @javax.annotation.Nullable + public String getAddress1() { + return address1; + } + + public void setAddress1(@javax.annotation.Nullable String address1) { + this.address1 = address1; + } + + + public ProfileRequestModelAddressesInner address2(@javax.annotation.Nullable String address2) { + this.address2 = address2; + return this; + } + + /** + * Get address2 + * @return address2 + */ + @javax.annotation.Nullable + public String getAddress2() { + return address2; + } + + public void setAddress2(@javax.annotation.Nullable String address2) { + this.address2 = address2; + } + + + public ProfileRequestModelAddressesInner city(@javax.annotation.Nullable String city) { + this.city = city; + return this; + } + + /** + * Get city + * @return city + */ + @javax.annotation.Nullable + public String getCity() { + return city; + } + + public void setCity(@javax.annotation.Nullable String city) { + this.city = city; + } + + + public ProfileRequestModelAddressesInner state(@javax.annotation.Nullable String state) { + this.state = state; + return this; + } + + /** + * Get state + * @return state + */ + @javax.annotation.Nullable + public String getState() { + return state; + } + + public void setState(@javax.annotation.Nullable String state) { + this.state = state; + } + + + public ProfileRequestModelAddressesInner postalCode(@javax.annotation.Nullable String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** + * Get postalCode + * @return postalCode + */ + @javax.annotation.Nullable + public String getPostalCode() { + return postalCode; + } + + public void setPostalCode(@javax.annotation.Nullable String postalCode) { + this.postalCode = postalCode; + } + + + public ProfileRequestModelAddressesInner region(@javax.annotation.Nullable String region) { + this.region = region; + return this; + } + + /** + * Get region + * @return region + */ + @javax.annotation.Nullable + public String getRegion() { + return region; + } + + public void setRegion(@javax.annotation.Nullable String region) { + this.region = region; + } + + + public ProfileRequestModelAddressesInner op(@javax.annotation.Nullable String op) { + this.op = op; + return this; + } + + /** + * Get op + * @return op + */ + @javax.annotation.Nullable + public String getOp() { + return op; + } + + public void setOp(@javax.annotation.Nullable String op) { + this.op = op; + } + + + public ProfileRequestModelAddressesInner country(@javax.annotation.Nullable String country) { + this.country = country; + return this; + } + + /** + * Get country + * @return country + */ + @javax.annotation.Nullable + public String getCountry() { + return country; + } + + public void setCountry(@javax.annotation.Nullable String country) { + this.country = country; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelAddressesInner instance itself + */ + public ProfileRequestModelAddressesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelAddressesInner profileRequestModelAddressesInner = (ProfileRequestModelAddressesInner) o; + return Objects.equals(this.type, profileRequestModelAddressesInner.type) && + Objects.equals(this.addressType, profileRequestModelAddressesInner.addressType) && + Objects.equals(this.address1, profileRequestModelAddressesInner.address1) && + Objects.equals(this.address2, profileRequestModelAddressesInner.address2) && + Objects.equals(this.city, profileRequestModelAddressesInner.city) && + Objects.equals(this.state, profileRequestModelAddressesInner.state) && + Objects.equals(this.postalCode, profileRequestModelAddressesInner.postalCode) && + Objects.equals(this.region, profileRequestModelAddressesInner.region) && + Objects.equals(this.op, profileRequestModelAddressesInner.op) && + Objects.equals(this.country, profileRequestModelAddressesInner.country)&& + Objects.equals(this.additionalProperties, profileRequestModelAddressesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, addressType, address1, address2, city, state, postalCode, region, op, country, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelAddressesInner {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" addressType: ").append(toIndentedString(addressType)).append("\n"); + sb.append(" address1: ").append(toIndentedString(address1)).append("\n"); + sb.append(" address2: ").append(toIndentedString(address2)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" postalCode: ").append(toIndentedString(postalCode)).append("\n"); + sb.append(" region: ").append(toIndentedString(region)).append("\n"); + sb.append(" op: ").append(toIndentedString(op)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Type"); + openapiFields.add("AddressType"); + openapiFields.add("Address1"); + openapiFields.add("Address2"); + openapiFields.add("City"); + openapiFields.add("State"); + openapiFields.add("PostalCode"); + openapiFields.add("Region"); + openapiFields.add("Op"); + openapiFields.add("Country"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelAddressesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelAddressesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelAddressesInner is not found in the empty JSON string", ProfileRequestModelAddressesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonNull()) && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + if ((jsonObj.get("AddressType") != null && !jsonObj.get("AddressType").isJsonNull()) && !jsonObj.get("AddressType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AddressType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AddressType").toString())); + } + if ((jsonObj.get("Address1") != null && !jsonObj.get("Address1").isJsonNull()) && !jsonObj.get("Address1").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Address1` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Address1").toString())); + } + if ((jsonObj.get("Address2") != null && !jsonObj.get("Address2").isJsonNull()) && !jsonObj.get("Address2").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Address2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Address2").toString())); + } + if ((jsonObj.get("City") != null && !jsonObj.get("City").isJsonNull()) && !jsonObj.get("City").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `City` to be a primitive type in the JSON string but got `%s`", jsonObj.get("City").toString())); + } + if ((jsonObj.get("State") != null && !jsonObj.get("State").isJsonNull()) && !jsonObj.get("State").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `State` to be a primitive type in the JSON string but got `%s`", jsonObj.get("State").toString())); + } + if ((jsonObj.get("PostalCode") != null && !jsonObj.get("PostalCode").isJsonNull()) && !jsonObj.get("PostalCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PostalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PostalCode").toString())); + } + if ((jsonObj.get("Region") != null && !jsonObj.get("Region").isJsonNull()) && !jsonObj.get("Region").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Region").toString())); + } + if ((jsonObj.get("Op") != null && !jsonObj.get("Op").isJsonNull()) && !jsonObj.get("Op").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Op` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Op").toString())); + } + if ((jsonObj.get("Country") != null && !jsonObj.get("Country").isJsonNull()) && !jsonObj.get("Country").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Country").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelAddressesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelAddressesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelAddressesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelAddressesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelAddressesInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelAddressesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelAddressesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelAddressesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelAddressesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelAddressesInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelAddressesInner + */ + public static ProfileRequestModelAddressesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelAddressesInner.class); + } + + /** + * Convert an instance of ProfileRequestModelAddressesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelAwardsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelAwardsInner.java new file mode 100644 index 0000000..fe87470 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelAwardsInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelAwardsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelAwardsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_ISSUER = "Issuer"; + @SerializedName(SERIALIZED_NAME_ISSUER) + @javax.annotation.Nullable + private String issuer; + + public ProfileRequestModelAwardsInner() { + } + + public ProfileRequestModelAwardsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileRequestModelAwardsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileRequestModelAwardsInner issuer(@javax.annotation.Nullable String issuer) { + this.issuer = issuer; + return this; + } + + /** + * Get issuer + * @return issuer + */ + @javax.annotation.Nullable + public String getIssuer() { + return issuer; + } + + public void setIssuer(@javax.annotation.Nullable String issuer) { + this.issuer = issuer; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelAwardsInner instance itself + */ + public ProfileRequestModelAwardsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelAwardsInner profileRequestModelAwardsInner = (ProfileRequestModelAwardsInner) o; + return Objects.equals(this.id, profileRequestModelAwardsInner.id) && + Objects.equals(this.name, profileRequestModelAwardsInner.name) && + Objects.equals(this.issuer, profileRequestModelAwardsInner.issuer)&& + Objects.equals(this.additionalProperties, profileRequestModelAwardsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, issuer, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelAwardsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" issuer: ").append(toIndentedString(issuer)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Issuer"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelAwardsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelAwardsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelAwardsInner is not found in the empty JSON string", ProfileRequestModelAwardsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Issuer") != null && !jsonObj.get("Issuer").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelAwardsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelAwardsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelAwardsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelAwardsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelAwardsInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelAwardsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelAwardsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelAwardsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelAwardsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelAwardsInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelAwardsInner + */ + public static ProfileRequestModelAwardsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelAwardsInner.class); + } + + /** + * Convert an instance of ProfileRequestModelAwardsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelBadgesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelBadgesInner.java new file mode 100644 index 0000000..f18c945 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelBadgesInner.java @@ -0,0 +1,467 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelBadgesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelBadgesInner { + public static final String SERIALIZED_NAME_BADGE_ID = "BadgeId"; + @SerializedName(SERIALIZED_NAME_BADGE_ID) + @javax.annotation.Nullable + private String badgeId; + + public static final String SERIALIZED_NAME_BAGE_ID = "BageId"; + @SerializedName(SERIALIZED_NAME_BAGE_ID) + @javax.annotation.Nullable + private String bageId; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_BADGE_MESSAGE = "BadgeMessage"; + @SerializedName(SERIALIZED_NAME_BADGE_MESSAGE) + @javax.annotation.Nullable + private String badgeMessage; + + public static final String SERIALIZED_NAME_BAGE_MESSAGE = "BageMessage"; + @SerializedName(SERIALIZED_NAME_BAGE_MESSAGE) + @javax.annotation.Nullable + private String bageMessage; + + public static final String SERIALIZED_NAME_DESCRIPTION = "Description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_IMAGE_URL = "ImageUrl"; + @SerializedName(SERIALIZED_NAME_IMAGE_URL) + @javax.annotation.Nullable + private String imageUrl; + + public ProfileRequestModelBadgesInner() { + } + + public ProfileRequestModelBadgesInner badgeId(@javax.annotation.Nullable String badgeId) { + this.badgeId = badgeId; + return this; + } + + /** + * Get badgeId + * @return badgeId + */ + @javax.annotation.Nullable + public String getBadgeId() { + return badgeId; + } + + public void setBadgeId(@javax.annotation.Nullable String badgeId) { + this.badgeId = badgeId; + } + + + public ProfileRequestModelBadgesInner bageId(@javax.annotation.Nullable String bageId) { + this.bageId = bageId; + return this; + } + + /** + * Get bageId + * @return bageId + */ + @javax.annotation.Nullable + public String getBageId() { + return bageId; + } + + public void setBageId(@javax.annotation.Nullable String bageId) { + this.bageId = bageId; + } + + + public ProfileRequestModelBadgesInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileRequestModelBadgesInner badgeMessage(@javax.annotation.Nullable String badgeMessage) { + this.badgeMessage = badgeMessage; + return this; + } + + /** + * Get badgeMessage + * @return badgeMessage + */ + @javax.annotation.Nullable + public String getBadgeMessage() { + return badgeMessage; + } + + public void setBadgeMessage(@javax.annotation.Nullable String badgeMessage) { + this.badgeMessage = badgeMessage; + } + + + public ProfileRequestModelBadgesInner bageMessage(@javax.annotation.Nullable String bageMessage) { + this.bageMessage = bageMessage; + return this; + } + + /** + * Get bageMessage + * @return bageMessage + */ + @javax.annotation.Nullable + public String getBageMessage() { + return bageMessage; + } + + public void setBageMessage(@javax.annotation.Nullable String bageMessage) { + this.bageMessage = bageMessage; + } + + + public ProfileRequestModelBadgesInner description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public ProfileRequestModelBadgesInner imageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** + * Get imageUrl + * @return imageUrl + */ + @javax.annotation.Nullable + public String getImageUrl() { + return imageUrl; + } + + public void setImageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelBadgesInner instance itself + */ + public ProfileRequestModelBadgesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelBadgesInner profileRequestModelBadgesInner = (ProfileRequestModelBadgesInner) o; + return Objects.equals(this.badgeId, profileRequestModelBadgesInner.badgeId) && + Objects.equals(this.bageId, profileRequestModelBadgesInner.bageId) && + Objects.equals(this.name, profileRequestModelBadgesInner.name) && + Objects.equals(this.badgeMessage, profileRequestModelBadgesInner.badgeMessage) && + Objects.equals(this.bageMessage, profileRequestModelBadgesInner.bageMessage) && + Objects.equals(this.description, profileRequestModelBadgesInner.description) && + Objects.equals(this.imageUrl, profileRequestModelBadgesInner.imageUrl)&& + Objects.equals(this.additionalProperties, profileRequestModelBadgesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(badgeId, bageId, name, badgeMessage, bageMessage, description, imageUrl, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelBadgesInner {\n"); + sb.append(" badgeId: ").append(toIndentedString(badgeId)).append("\n"); + sb.append(" bageId: ").append(toIndentedString(bageId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" badgeMessage: ").append(toIndentedString(badgeMessage)).append("\n"); + sb.append(" bageMessage: ").append(toIndentedString(bageMessage)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("BadgeId"); + openapiFields.add("BageId"); + openapiFields.add("Name"); + openapiFields.add("BadgeMessage"); + openapiFields.add("BageMessage"); + openapiFields.add("Description"); + openapiFields.add("ImageUrl"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelBadgesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelBadgesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelBadgesInner is not found in the empty JSON string", ProfileRequestModelBadgesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("BadgeId") != null && !jsonObj.get("BadgeId").isJsonNull()) && !jsonObj.get("BadgeId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `BadgeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BadgeId").toString())); + } + if ((jsonObj.get("BageId") != null && !jsonObj.get("BageId").isJsonNull()) && !jsonObj.get("BageId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `BageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BageId").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("BadgeMessage") != null && !jsonObj.get("BadgeMessage").isJsonNull()) && !jsonObj.get("BadgeMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `BadgeMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BadgeMessage").toString())); + } + if ((jsonObj.get("BageMessage") != null && !jsonObj.get("BageMessage").isJsonNull()) && !jsonObj.get("BageMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `BageMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BageMessage").toString())); + } + if ((jsonObj.get("Description") != null && !jsonObj.get("Description").isJsonNull()) && !jsonObj.get("Description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Description").toString())); + } + if ((jsonObj.get("ImageUrl") != null && !jsonObj.get("ImageUrl").isJsonNull()) && !jsonObj.get("ImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ImageUrl").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelBadgesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelBadgesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelBadgesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelBadgesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelBadgesInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelBadgesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelBadgesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelBadgesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelBadgesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelBadgesInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelBadgesInner + */ + public static ProfileRequestModelBadgesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelBadgesInner.class); + } + + /** + * Convert an instance of ProfileRequestModelBadgesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelBooksInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelBooksInner.java new file mode 100644 index 0000000..3b9b2a0 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelBooksInner.java @@ -0,0 +1,377 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelBooksInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelBooksInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_CATEGORY = "Category"; + @SerializedName(SERIALIZED_NAME_CATEGORY) + @javax.annotation.Nullable + private String category; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private String createdDate; + + public ProfileRequestModelBooksInner() { + } + + public ProfileRequestModelBooksInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileRequestModelBooksInner category(@javax.annotation.Nullable String category) { + this.category = category; + return this; + } + + /** + * Get category + * @return category + */ + @javax.annotation.Nullable + public String getCategory() { + return category; + } + + public void setCategory(@javax.annotation.Nullable String category) { + this.category = category; + } + + + public ProfileRequestModelBooksInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileRequestModelBooksInner createdDate(@javax.annotation.Nullable String createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get createdDate + * @return createdDate + */ + @javax.annotation.Nullable + public String getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable String createdDate) { + this.createdDate = createdDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelBooksInner instance itself + */ + public ProfileRequestModelBooksInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelBooksInner profileRequestModelBooksInner = (ProfileRequestModelBooksInner) o; + return Objects.equals(this.id, profileRequestModelBooksInner.id) && + Objects.equals(this.category, profileRequestModelBooksInner.category) && + Objects.equals(this.name, profileRequestModelBooksInner.name) && + Objects.equals(this.createdDate, profileRequestModelBooksInner.createdDate)&& + Objects.equals(this.additionalProperties, profileRequestModelBooksInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, createdDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelBooksInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Category"); + openapiFields.add("Name"); + openapiFields.add("CreatedDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelBooksInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelBooksInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelBooksInner is not found in the empty JSON string", ProfileRequestModelBooksInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Category") != null && !jsonObj.get("Category").isJsonNull()) && !jsonObj.get("Category").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Category` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Category").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("CreatedDate") != null && !jsonObj.get("CreatedDate").isJsonNull()) && !jsonObj.get("CreatedDate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CreatedDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CreatedDate").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelBooksInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelBooksInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelBooksInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelBooksInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelBooksInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelBooksInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelBooksInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelBooksInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelBooksInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelBooksInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelBooksInner + */ + public static ProfileRequestModelBooksInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelBooksInner.class); + } + + /** + * Convert an instance of ProfileRequestModelBooksInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelCaptchaModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelCaptchaModel.java new file mode 100644 index 0000000..7e699ae --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelCaptchaModel.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelCaptchaModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelCaptchaModel { + public static final String SERIALIZED_NAME_CAPTCHA_ID = "CaptchaId"; + @SerializedName(SERIALIZED_NAME_CAPTCHA_ID) + @javax.annotation.Nullable + private String captchaId; + + public static final String SERIALIZED_NAME_CAPTCHA_VALUE = "CaptchaValue"; + @SerializedName(SERIALIZED_NAME_CAPTCHA_VALUE) + @javax.annotation.Nullable + private String captchaValue; + + public ProfileRequestModelCaptchaModel() { + } + + public ProfileRequestModelCaptchaModel captchaId(@javax.annotation.Nullable String captchaId) { + this.captchaId = captchaId; + return this; + } + + /** + * Get captchaId + * @return captchaId + */ + @javax.annotation.Nullable + public String getCaptchaId() { + return captchaId; + } + + public void setCaptchaId(@javax.annotation.Nullable String captchaId) { + this.captchaId = captchaId; + } + + + public ProfileRequestModelCaptchaModel captchaValue(@javax.annotation.Nullable String captchaValue) { + this.captchaValue = captchaValue; + return this; + } + + /** + * Get captchaValue + * @return captchaValue + */ + @javax.annotation.Nullable + public String getCaptchaValue() { + return captchaValue; + } + + public void setCaptchaValue(@javax.annotation.Nullable String captchaValue) { + this.captchaValue = captchaValue; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelCaptchaModel instance itself + */ + public ProfileRequestModelCaptchaModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelCaptchaModel profileRequestModelCaptchaModel = (ProfileRequestModelCaptchaModel) o; + return Objects.equals(this.captchaId, profileRequestModelCaptchaModel.captchaId) && + Objects.equals(this.captchaValue, profileRequestModelCaptchaModel.captchaValue)&& + Objects.equals(this.additionalProperties, profileRequestModelCaptchaModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(captchaId, captchaValue, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelCaptchaModel {\n"); + sb.append(" captchaId: ").append(toIndentedString(captchaId)).append("\n"); + sb.append(" captchaValue: ").append(toIndentedString(captchaValue)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("CaptchaId"); + openapiFields.add("CaptchaValue"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelCaptchaModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelCaptchaModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelCaptchaModel is not found in the empty JSON string", ProfileRequestModelCaptchaModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("CaptchaId") != null && !jsonObj.get("CaptchaId").isJsonNull()) && !jsonObj.get("CaptchaId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CaptchaId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CaptchaId").toString())); + } + if ((jsonObj.get("CaptchaValue") != null && !jsonObj.get("CaptchaValue").isJsonNull()) && !jsonObj.get("CaptchaValue").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CaptchaValue` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CaptchaValue").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelCaptchaModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelCaptchaModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelCaptchaModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelCaptchaModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelCaptchaModel>() { + @Override + public void write(JsonWriter out, ProfileRequestModelCaptchaModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelCaptchaModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelCaptchaModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelCaptchaModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelCaptchaModel + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelCaptchaModel + */ + public static ProfileRequestModelCaptchaModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelCaptchaModel.class); + } + + /** + * Convert an instance of ProfileRequestModelCaptchaModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelCertificationsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelCertificationsInner.java new file mode 100644 index 0000000..39b6751 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelCertificationsInner.java @@ -0,0 +1,432 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelCertificationsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelCertificationsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_AUTHORITY = "Authority"; + @SerializedName(SERIALIZED_NAME_AUTHORITY) + @javax.annotation.Nullable + private String authority; + + public static final String SERIALIZED_NAME_NUMBER = "Number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + @javax.annotation.Nullable + private String number; + + public static final String SERIALIZED_NAME_START_DATE = "StartDate"; + @SerializedName(SERIALIZED_NAME_START_DATE) + @javax.annotation.Nullable + private OffsetDateTime startDate; + + public static final String SERIALIZED_NAME_END_DATE = "EndDate"; + @SerializedName(SERIALIZED_NAME_END_DATE) + @javax.annotation.Nullable + private OffsetDateTime endDate; + + public ProfileRequestModelCertificationsInner() { + } + + public ProfileRequestModelCertificationsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileRequestModelCertificationsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileRequestModelCertificationsInner authority(@javax.annotation.Nullable String authority) { + this.authority = authority; + return this; + } + + /** + * Get authority + * @return authority + */ + @javax.annotation.Nullable + public String getAuthority() { + return authority; + } + + public void setAuthority(@javax.annotation.Nullable String authority) { + this.authority = authority; + } + + + public ProfileRequestModelCertificationsInner number(@javax.annotation.Nullable String number) { + this.number = number; + return this; + } + + /** + * Get number + * @return number + */ + @javax.annotation.Nullable + public String getNumber() { + return number; + } + + public void setNumber(@javax.annotation.Nullable String number) { + this.number = number; + } + + + public ProfileRequestModelCertificationsInner startDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Get startDate + * @return startDate + */ + @javax.annotation.Nullable + public OffsetDateTime getStartDate() { + return startDate; + } + + public void setStartDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + } + + + public ProfileRequestModelCertificationsInner endDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * Get endDate + * @return endDate + */ + @javax.annotation.Nullable + public OffsetDateTime getEndDate() { + return endDate; + } + + public void setEndDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelCertificationsInner instance itself + */ + public ProfileRequestModelCertificationsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelCertificationsInner profileRequestModelCertificationsInner = (ProfileRequestModelCertificationsInner) o; + return Objects.equals(this.id, profileRequestModelCertificationsInner.id) && + Objects.equals(this.name, profileRequestModelCertificationsInner.name) && + Objects.equals(this.authority, profileRequestModelCertificationsInner.authority) && + Objects.equals(this.number, profileRequestModelCertificationsInner.number) && + Objects.equals(this.startDate, profileRequestModelCertificationsInner.startDate) && + Objects.equals(this.endDate, profileRequestModelCertificationsInner.endDate)&& + Objects.equals(this.additionalProperties, profileRequestModelCertificationsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, authority, number, startDate, endDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelCertificationsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" authority: ").append(toIndentedString(authority)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Authority"); + openapiFields.add("Number"); + openapiFields.add("StartDate"); + openapiFields.add("EndDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelCertificationsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelCertificationsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelCertificationsInner is not found in the empty JSON string", ProfileRequestModelCertificationsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Authority") != null && !jsonObj.get("Authority").isJsonNull()) && !jsonObj.get("Authority").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Authority` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Authority").toString())); + } + if ((jsonObj.get("Number") != null && !jsonObj.get("Number").isJsonNull()) && !jsonObj.get("Number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Number").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelCertificationsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelCertificationsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelCertificationsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelCertificationsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelCertificationsInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelCertificationsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelCertificationsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelCertificationsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelCertificationsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelCertificationsInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelCertificationsInner + */ + public static ProfileRequestModelCertificationsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelCertificationsInner.class); + } + + /** + * Convert an instance of ProfileRequestModelCertificationsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelConsents.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelConsents.java new file mode 100644 index 0000000..e166a88 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelConsents.java @@ -0,0 +1,359 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProfileRequestModelConsentsDataInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelConsentsEventsInner; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelConsents + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelConsents { + public static final String SERIALIZED_NAME_EVENTS = "Events"; + @SerializedName(SERIALIZED_NAME_EVENTS) + @javax.annotation.Nullable + private List<ProfileRequestModelConsentsEventsInner> events = new ArrayList<>(); + + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<ProfileRequestModelConsentsDataInner> data = new ArrayList<>(); + + public ProfileRequestModelConsents() { + } + + public ProfileRequestModelConsents events(@javax.annotation.Nullable List<ProfileRequestModelConsentsEventsInner> events) { + this.events = events; + return this; + } + + public ProfileRequestModelConsents addEventsItem(ProfileRequestModelConsentsEventsInner eventsItem) { + if (this.events == null) { + this.events = new ArrayList<>(); + } + this.events.add(eventsItem); + return this; + } + + /** + * Get events + * @return events + */ + @javax.annotation.Nullable + public List<ProfileRequestModelConsentsEventsInner> getEvents() { + return events; + } + + public void setEvents(@javax.annotation.Nullable List<ProfileRequestModelConsentsEventsInner> events) { + this.events = events; + } + + + public ProfileRequestModelConsents data(@javax.annotation.Nullable List<ProfileRequestModelConsentsDataInner> data) { + this.data = data; + return this; + } + + public ProfileRequestModelConsents addDataItem(ProfileRequestModelConsentsDataInner dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<ProfileRequestModelConsentsDataInner> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<ProfileRequestModelConsentsDataInner> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelConsents instance itself + */ + public ProfileRequestModelConsents putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelConsents profileRequestModelConsents = (ProfileRequestModelConsents) o; + return Objects.equals(this.events, profileRequestModelConsents.events) && + Objects.equals(this.data, profileRequestModelConsents.data)&& + Objects.equals(this.additionalProperties, profileRequestModelConsents.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(events, data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelConsents {\n"); + sb.append(" events: ").append(toIndentedString(events)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Events"); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelConsents + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelConsents.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelConsents is not found in the empty JSON string", ProfileRequestModelConsents.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Events") != null && !jsonObj.get("Events").isJsonNull()) { + JsonArray jsonArrayevents = jsonObj.getAsJsonArray("Events"); + if (jsonArrayevents != null) { + // ensure the json data is an array + if (!jsonObj.get("Events").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Events` to be an array in the JSON string but got `%s`", jsonObj.get("Events").toString())); + } + + // validate the optional field `Events` (array) + for (int i = 0; i < jsonArrayevents.size(); i++) { + ProfileRequestModelConsentsEventsInner.validateJsonElement(jsonArrayevents.get(i)); + }; + } + } + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + ProfileRequestModelConsentsDataInner.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelConsents.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelConsents' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelConsents> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelConsents.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelConsents>() { + @Override + public void write(JsonWriter out, ProfileRequestModelConsents value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelConsents read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelConsents instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelConsents given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelConsents + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelConsents + */ + public static ProfileRequestModelConsents fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelConsents.class); + } + + /** + * Convert an instance of ProfileRequestModelConsents to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelConsentsDataInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelConsentsDataInner.java new file mode 100644 index 0000000..934bb23 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelConsentsDataInner.java @@ -0,0 +1,314 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelConsentsDataInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelConsentsDataInner { + public static final String SERIALIZED_NAME_IS_ACCEPTED = "IsAccepted"; + @SerializedName(SERIALIZED_NAME_IS_ACCEPTED) + @javax.annotation.Nullable + private Boolean isAccepted; + + public static final String SERIALIZED_NAME_CONSENT_OPTION_ID = "ConsentOptionId"; + @SerializedName(SERIALIZED_NAME_CONSENT_OPTION_ID) + @javax.annotation.Nullable + private String consentOptionId; + + public ProfileRequestModelConsentsDataInner() { + } + + public ProfileRequestModelConsentsDataInner isAccepted(@javax.annotation.Nullable Boolean isAccepted) { + this.isAccepted = isAccepted; + return this; + } + + /** + * Get isAccepted + * @return isAccepted + */ + @javax.annotation.Nullable + public Boolean getIsAccepted() { + return isAccepted; + } + + public void setIsAccepted(@javax.annotation.Nullable Boolean isAccepted) { + this.isAccepted = isAccepted; + } + + + public ProfileRequestModelConsentsDataInner consentOptionId(@javax.annotation.Nullable String consentOptionId) { + this.consentOptionId = consentOptionId; + return this; + } + + /** + * Get consentOptionId + * @return consentOptionId + */ + @javax.annotation.Nullable + public String getConsentOptionId() { + return consentOptionId; + } + + public void setConsentOptionId(@javax.annotation.Nullable String consentOptionId) { + this.consentOptionId = consentOptionId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelConsentsDataInner instance itself + */ + public ProfileRequestModelConsentsDataInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelConsentsDataInner profileRequestModelConsentsDataInner = (ProfileRequestModelConsentsDataInner) o; + return Objects.equals(this.isAccepted, profileRequestModelConsentsDataInner.isAccepted) && + Objects.equals(this.consentOptionId, profileRequestModelConsentsDataInner.consentOptionId)&& + Objects.equals(this.additionalProperties, profileRequestModelConsentsDataInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isAccepted, consentOptionId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelConsentsDataInner {\n"); + sb.append(" isAccepted: ").append(toIndentedString(isAccepted)).append("\n"); + sb.append(" consentOptionId: ").append(toIndentedString(consentOptionId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsAccepted"); + openapiFields.add("ConsentOptionId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelConsentsDataInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelConsentsDataInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelConsentsDataInner is not found in the empty JSON string", ProfileRequestModelConsentsDataInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ConsentOptionId") != null && !jsonObj.get("ConsentOptionId").isJsonNull()) && !jsonObj.get("ConsentOptionId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ConsentOptionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ConsentOptionId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelConsentsDataInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelConsentsDataInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelConsentsDataInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelConsentsDataInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelConsentsDataInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelConsentsDataInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelConsentsDataInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelConsentsDataInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelConsentsDataInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelConsentsDataInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelConsentsDataInner + */ + public static ProfileRequestModelConsentsDataInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelConsentsDataInner.class); + } + + /** + * Convert an instance of ProfileRequestModelConsentsDataInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelConsentsEventsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelConsentsEventsInner.java new file mode 100644 index 0000000..488db68 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelConsentsEventsInner.java @@ -0,0 +1,314 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelConsentsEventsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelConsentsEventsInner { + public static final String SERIALIZED_NAME_IS_CUSTOM = "IsCustom"; + @SerializedName(SERIALIZED_NAME_IS_CUSTOM) + @javax.annotation.Nullable + private Boolean isCustom; + + public static final String SERIALIZED_NAME_EVENT = "Event"; + @SerializedName(SERIALIZED_NAME_EVENT) + @javax.annotation.Nullable + private String event; + + public ProfileRequestModelConsentsEventsInner() { + } + + public ProfileRequestModelConsentsEventsInner isCustom(@javax.annotation.Nullable Boolean isCustom) { + this.isCustom = isCustom; + return this; + } + + /** + * Get isCustom + * @return isCustom + */ + @javax.annotation.Nullable + public Boolean getIsCustom() { + return isCustom; + } + + public void setIsCustom(@javax.annotation.Nullable Boolean isCustom) { + this.isCustom = isCustom; + } + + + public ProfileRequestModelConsentsEventsInner event(@javax.annotation.Nullable String event) { + this.event = event; + return this; + } + + /** + * Get event + * @return event + */ + @javax.annotation.Nullable + public String getEvent() { + return event; + } + + public void setEvent(@javax.annotation.Nullable String event) { + this.event = event; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelConsentsEventsInner instance itself + */ + public ProfileRequestModelConsentsEventsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelConsentsEventsInner profileRequestModelConsentsEventsInner = (ProfileRequestModelConsentsEventsInner) o; + return Objects.equals(this.isCustom, profileRequestModelConsentsEventsInner.isCustom) && + Objects.equals(this.event, profileRequestModelConsentsEventsInner.event)&& + Objects.equals(this.additionalProperties, profileRequestModelConsentsEventsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isCustom, event, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelConsentsEventsInner {\n"); + sb.append(" isCustom: ").append(toIndentedString(isCustom)).append("\n"); + sb.append(" event: ").append(toIndentedString(event)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsCustom"); + openapiFields.add("Event"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelConsentsEventsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelConsentsEventsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelConsentsEventsInner is not found in the empty JSON string", ProfileRequestModelConsentsEventsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Event") != null && !jsonObj.get("Event").isJsonNull()) && !jsonObj.get("Event").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Event` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Event").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelConsentsEventsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelConsentsEventsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelConsentsEventsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelConsentsEventsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelConsentsEventsInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelConsentsEventsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelConsentsEventsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelConsentsEventsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelConsentsEventsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelConsentsEventsInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelConsentsEventsInner + */ + public static ProfileRequestModelConsentsEventsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelConsentsEventsInner.class); + } + + /** + * Convert an instance of ProfileRequestModelConsentsEventsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelCountry.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelCountry.java new file mode 100644 index 0000000..22989dc --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelCountry.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelCountry + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelCountry { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_CODE = "Code"; + @SerializedName(SERIALIZED_NAME_CODE) + @javax.annotation.Nullable + private String code; + + public ProfileRequestModelCountry() { + } + + public ProfileRequestModelCountry name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileRequestModelCountry code(@javax.annotation.Nullable String code) { + this.code = code; + return this; + } + + /** + * Get code + * @return code + */ + @javax.annotation.Nullable + public String getCode() { + return code; + } + + public void setCode(@javax.annotation.Nullable String code) { + this.code = code; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelCountry instance itself + */ + public ProfileRequestModelCountry putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelCountry profileRequestModelCountry = (ProfileRequestModelCountry) o; + return Objects.equals(this.name, profileRequestModelCountry.name) && + Objects.equals(this.code, profileRequestModelCountry.code)&& + Objects.equals(this.additionalProperties, profileRequestModelCountry.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, code, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelCountry {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + openapiFields.add("Code"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelCountry + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelCountry.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelCountry is not found in the empty JSON string", ProfileRequestModelCountry.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Code") != null && !jsonObj.get("Code").isJsonNull()) && !jsonObj.get("Code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Code").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelCountry.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelCountry' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelCountry> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelCountry.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelCountry>() { + @Override + public void write(JsonWriter out, ProfileRequestModelCountry value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelCountry read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelCountry instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelCountry given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelCountry + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelCountry + */ + public static ProfileRequestModelCountry fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelCountry.class); + } + + /** + * Convert an instance of ProfileRequestModelCountry to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelCoursesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelCoursesInner.java new file mode 100644 index 0000000..7a18554 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelCoursesInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelCoursesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelCoursesInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_NUMBER = "Number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + @javax.annotation.Nullable + private String number; + + public ProfileRequestModelCoursesInner() { + } + + public ProfileRequestModelCoursesInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileRequestModelCoursesInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileRequestModelCoursesInner number(@javax.annotation.Nullable String number) { + this.number = number; + return this; + } + + /** + * Get number + * @return number + */ + @javax.annotation.Nullable + public String getNumber() { + return number; + } + + public void setNumber(@javax.annotation.Nullable String number) { + this.number = number; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelCoursesInner instance itself + */ + public ProfileRequestModelCoursesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelCoursesInner profileRequestModelCoursesInner = (ProfileRequestModelCoursesInner) o; + return Objects.equals(this.id, profileRequestModelCoursesInner.id) && + Objects.equals(this.name, profileRequestModelCoursesInner.name) && + Objects.equals(this.number, profileRequestModelCoursesInner.number)&& + Objects.equals(this.additionalProperties, profileRequestModelCoursesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, number, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelCoursesInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Number"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelCoursesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelCoursesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelCoursesInner is not found in the empty JSON string", ProfileRequestModelCoursesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Number") != null && !jsonObj.get("Number").isJsonNull()) && !jsonObj.get("Number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Number").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelCoursesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelCoursesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelCoursesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelCoursesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelCoursesInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelCoursesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelCoursesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelCoursesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelCoursesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelCoursesInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelCoursesInner + */ + public static ProfileRequestModelCoursesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelCoursesInner.class); + } + + /** + * Convert an instance of ProfileRequestModelCoursesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelCurrentStatusInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelCurrentStatusInner.java new file mode 100644 index 0000000..9053eea --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelCurrentStatusInner.java @@ -0,0 +1,375 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelCurrentStatusInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelCurrentStatusInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_TEXT = "Text"; + @SerializedName(SERIALIZED_NAME_TEXT) + @javax.annotation.Nullable + private String text; + + public static final String SERIALIZED_NAME_SOURCE = "Source"; + @SerializedName(SERIALIZED_NAME_SOURCE) + @javax.annotation.Nullable + private String source; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public ProfileRequestModelCurrentStatusInner() { + } + + public ProfileRequestModelCurrentStatusInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileRequestModelCurrentStatusInner text(@javax.annotation.Nullable String text) { + this.text = text; + return this; + } + + /** + * Get text + * @return text + */ + @javax.annotation.Nullable + public String getText() { + return text; + } + + public void setText(@javax.annotation.Nullable String text) { + this.text = text; + } + + + public ProfileRequestModelCurrentStatusInner source(@javax.annotation.Nullable String source) { + this.source = source; + return this; + } + + /** + * Get source + * @return source + */ + @javax.annotation.Nullable + public String getSource() { + return source; + } + + public void setSource(@javax.annotation.Nullable String source) { + this.source = source; + } + + + public ProfileRequestModelCurrentStatusInner createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get createdDate + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelCurrentStatusInner instance itself + */ + public ProfileRequestModelCurrentStatusInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelCurrentStatusInner profileRequestModelCurrentStatusInner = (ProfileRequestModelCurrentStatusInner) o; + return Objects.equals(this.id, profileRequestModelCurrentStatusInner.id) && + Objects.equals(this.text, profileRequestModelCurrentStatusInner.text) && + Objects.equals(this.source, profileRequestModelCurrentStatusInner.source) && + Objects.equals(this.createdDate, profileRequestModelCurrentStatusInner.createdDate)&& + Objects.equals(this.additionalProperties, profileRequestModelCurrentStatusInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, text, source, createdDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelCurrentStatusInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Text"); + openapiFields.add("Source"); + openapiFields.add("CreatedDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelCurrentStatusInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelCurrentStatusInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelCurrentStatusInner is not found in the empty JSON string", ProfileRequestModelCurrentStatusInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Text") != null && !jsonObj.get("Text").isJsonNull()) && !jsonObj.get("Text").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Text").toString())); + } + if ((jsonObj.get("Source") != null && !jsonObj.get("Source").isJsonNull()) && !jsonObj.get("Source").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Source").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelCurrentStatusInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelCurrentStatusInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelCurrentStatusInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelCurrentStatusInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelCurrentStatusInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelCurrentStatusInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelCurrentStatusInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelCurrentStatusInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelCurrentStatusInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelCurrentStatusInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelCurrentStatusInner + */ + public static ProfileRequestModelCurrentStatusInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelCurrentStatusInner.class); + } + + /** + * Convert an instance of ProfileRequestModelCurrentStatusInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelEducationsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelEducationsInner.java new file mode 100644 index 0000000..d8b703d --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelEducationsInner.java @@ -0,0 +1,522 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelEducationsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelEducationsInner { + public static final String SERIALIZED_NAME_SCHOOL = "School"; + @SerializedName(SERIALIZED_NAME_SCHOOL) + @javax.annotation.Nullable + private String school; + + public static final String SERIALIZED_NAME_YEAR = "Year"; + @SerializedName(SERIALIZED_NAME_YEAR) + @javax.annotation.Nullable + private String year; + + public static final String SERIALIZED_NAME_TYPE = "Type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_NOTES = "Notes"; + @SerializedName(SERIALIZED_NAME_NOTES) + @javax.annotation.Nullable + private String notes; + + public static final String SERIALIZED_NAME_ACTIVITIES = "Activities"; + @SerializedName(SERIALIZED_NAME_ACTIVITIES) + @javax.annotation.Nullable + private String activities; + + public static final String SERIALIZED_NAME_DEGREE = "Degree"; + @SerializedName(SERIALIZED_NAME_DEGREE) + @javax.annotation.Nullable + private String degree; + + public static final String SERIALIZED_NAME_FIELD_OF_STUDY = "FieldOfStudy"; + @SerializedName(SERIALIZED_NAME_FIELD_OF_STUDY) + @javax.annotation.Nullable + private String fieldOfStudy; + + public static final String SERIALIZED_NAME_START_DATE = "StartDate"; + @SerializedName(SERIALIZED_NAME_START_DATE) + @javax.annotation.Nullable + private OffsetDateTime startDate; + + public static final String SERIALIZED_NAME_END_DATE = "EndDate"; + @SerializedName(SERIALIZED_NAME_END_DATE) + @javax.annotation.Nullable + private OffsetDateTime endDate; + + public ProfileRequestModelEducationsInner() { + } + + public ProfileRequestModelEducationsInner school(@javax.annotation.Nullable String school) { + this.school = school; + return this; + } + + /** + * Get school + * @return school + */ + @javax.annotation.Nullable + public String getSchool() { + return school; + } + + public void setSchool(@javax.annotation.Nullable String school) { + this.school = school; + } + + + public ProfileRequestModelEducationsInner year(@javax.annotation.Nullable String year) { + this.year = year; + return this; + } + + /** + * Get year + * @return year + */ + @javax.annotation.Nullable + public String getYear() { + return year; + } + + public void setYear(@javax.annotation.Nullable String year) { + this.year = year; + } + + + public ProfileRequestModelEducationsInner type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public ProfileRequestModelEducationsInner notes(@javax.annotation.Nullable String notes) { + this.notes = notes; + return this; + } + + /** + * Get notes + * @return notes + */ + @javax.annotation.Nullable + public String getNotes() { + return notes; + } + + public void setNotes(@javax.annotation.Nullable String notes) { + this.notes = notes; + } + + + public ProfileRequestModelEducationsInner activities(@javax.annotation.Nullable String activities) { + this.activities = activities; + return this; + } + + /** + * Get activities + * @return activities + */ + @javax.annotation.Nullable + public String getActivities() { + return activities; + } + + public void setActivities(@javax.annotation.Nullable String activities) { + this.activities = activities; + } + + + public ProfileRequestModelEducationsInner degree(@javax.annotation.Nullable String degree) { + this.degree = degree; + return this; + } + + /** + * Get degree + * @return degree + */ + @javax.annotation.Nullable + public String getDegree() { + return degree; + } + + public void setDegree(@javax.annotation.Nullable String degree) { + this.degree = degree; + } + + + public ProfileRequestModelEducationsInner fieldOfStudy(@javax.annotation.Nullable String fieldOfStudy) { + this.fieldOfStudy = fieldOfStudy; + return this; + } + + /** + * Get fieldOfStudy + * @return fieldOfStudy + */ + @javax.annotation.Nullable + public String getFieldOfStudy() { + return fieldOfStudy; + } + + public void setFieldOfStudy(@javax.annotation.Nullable String fieldOfStudy) { + this.fieldOfStudy = fieldOfStudy; + } + + + public ProfileRequestModelEducationsInner startDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Get startDate + * @return startDate + */ + @javax.annotation.Nullable + public OffsetDateTime getStartDate() { + return startDate; + } + + public void setStartDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + } + + + public ProfileRequestModelEducationsInner endDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * Get endDate + * @return endDate + */ + @javax.annotation.Nullable + public OffsetDateTime getEndDate() { + return endDate; + } + + public void setEndDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelEducationsInner instance itself + */ + public ProfileRequestModelEducationsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelEducationsInner profileRequestModelEducationsInner = (ProfileRequestModelEducationsInner) o; + return Objects.equals(this.school, profileRequestModelEducationsInner.school) && + Objects.equals(this.year, profileRequestModelEducationsInner.year) && + Objects.equals(this.type, profileRequestModelEducationsInner.type) && + Objects.equals(this.notes, profileRequestModelEducationsInner.notes) && + Objects.equals(this.activities, profileRequestModelEducationsInner.activities) && + Objects.equals(this.degree, profileRequestModelEducationsInner.degree) && + Objects.equals(this.fieldOfStudy, profileRequestModelEducationsInner.fieldOfStudy) && + Objects.equals(this.startDate, profileRequestModelEducationsInner.startDate) && + Objects.equals(this.endDate, profileRequestModelEducationsInner.endDate)&& + Objects.equals(this.additionalProperties, profileRequestModelEducationsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(school, year, type, notes, activities, degree, fieldOfStudy, startDate, endDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelEducationsInner {\n"); + sb.append(" school: ").append(toIndentedString(school)).append("\n"); + sb.append(" year: ").append(toIndentedString(year)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" notes: ").append(toIndentedString(notes)).append("\n"); + sb.append(" activities: ").append(toIndentedString(activities)).append("\n"); + sb.append(" degree: ").append(toIndentedString(degree)).append("\n"); + sb.append(" fieldOfStudy: ").append(toIndentedString(fieldOfStudy)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("School"); + openapiFields.add("Year"); + openapiFields.add("Type"); + openapiFields.add("Notes"); + openapiFields.add("Activities"); + openapiFields.add("Degree"); + openapiFields.add("FieldOfStudy"); + openapiFields.add("StartDate"); + openapiFields.add("EndDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelEducationsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelEducationsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelEducationsInner is not found in the empty JSON string", ProfileRequestModelEducationsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("School") != null && !jsonObj.get("School").isJsonNull()) && !jsonObj.get("School").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `School` to be a primitive type in the JSON string but got `%s`", jsonObj.get("School").toString())); + } + if ((jsonObj.get("Year") != null && !jsonObj.get("Year").isJsonNull()) && !jsonObj.get("Year").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Year` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Year").toString())); + } + if ((jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonNull()) && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + if ((jsonObj.get("Notes") != null && !jsonObj.get("Notes").isJsonNull()) && !jsonObj.get("Notes").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Notes` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Notes").toString())); + } + if ((jsonObj.get("Activities") != null && !jsonObj.get("Activities").isJsonNull()) && !jsonObj.get("Activities").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Activities` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Activities").toString())); + } + if ((jsonObj.get("Degree") != null && !jsonObj.get("Degree").isJsonNull()) && !jsonObj.get("Degree").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Degree` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Degree").toString())); + } + if ((jsonObj.get("FieldOfStudy") != null && !jsonObj.get("FieldOfStudy").isJsonNull()) && !jsonObj.get("FieldOfStudy").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FieldOfStudy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FieldOfStudy").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelEducationsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelEducationsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelEducationsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelEducationsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelEducationsInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelEducationsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelEducationsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelEducationsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelEducationsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelEducationsInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelEducationsInner + */ + public static ProfileRequestModelEducationsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelEducationsInner.class); + } + + /** + * Convert an instance of ProfileRequestModelEducationsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelEmailInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelEmailInner.java new file mode 100644 index 0000000..8158b10 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelEmailInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelEmailInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelEmailInner { + public static final String SERIALIZED_NAME_TYPE = "Type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_VALUE = "Value"; + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nullable + private String value; + + public ProfileRequestModelEmailInner() { + } + + public ProfileRequestModelEmailInner type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public ProfileRequestModelEmailInner value(@javax.annotation.Nullable String value) { + this.value = value; + return this; + } + + /** + * Get value + * @return value + */ + @javax.annotation.Nullable + public String getValue() { + return value; + } + + public void setValue(@javax.annotation.Nullable String value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelEmailInner instance itself + */ + public ProfileRequestModelEmailInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelEmailInner profileRequestModelEmailInner = (ProfileRequestModelEmailInner) o; + return Objects.equals(this.type, profileRequestModelEmailInner.type) && + Objects.equals(this.value, profileRequestModelEmailInner.value)&& + Objects.equals(this.additionalProperties, profileRequestModelEmailInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelEmailInner {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Type"); + openapiFields.add("Value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelEmailInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelEmailInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelEmailInner is not found in the empty JSON string", ProfileRequestModelEmailInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonNull()) && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + if ((jsonObj.get("Value") != null && !jsonObj.get("Value").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelEmailInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelEmailInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelEmailInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelEmailInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelEmailInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelEmailInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelEmailInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelEmailInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelEmailInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelEmailInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelEmailInner + */ + public static ProfileRequestModelEmailInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelEmailInner.class); + } + + /** + * Convert an instance of ProfileRequestModelEmailInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelExternalIdsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelExternalIdsInner.java new file mode 100644 index 0000000..c2e4f9b --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelExternalIdsInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelExternalIdsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelExternalIdsInner { + public static final String SERIALIZED_NAME_OPERATION = "Operation"; + @SerializedName(SERIALIZED_NAME_OPERATION) + @javax.annotation.Nullable + private String operation; + + public static final String SERIALIZED_NAME_SOURCE = "Source"; + @SerializedName(SERIALIZED_NAME_SOURCE) + @javax.annotation.Nullable + private String source; + + public static final String SERIALIZED_NAME_SOURCE_ID = "SourceId"; + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + @javax.annotation.Nullable + private String sourceId; + + public ProfileRequestModelExternalIdsInner() { + } + + public ProfileRequestModelExternalIdsInner operation(@javax.annotation.Nullable String operation) { + this.operation = operation; + return this; + } + + /** + * Get operation + * @return operation + */ + @javax.annotation.Nullable + public String getOperation() { + return operation; + } + + public void setOperation(@javax.annotation.Nullable String operation) { + this.operation = operation; + } + + + public ProfileRequestModelExternalIdsInner source(@javax.annotation.Nullable String source) { + this.source = source; + return this; + } + + /** + * Get source + * @return source + */ + @javax.annotation.Nullable + public String getSource() { + return source; + } + + public void setSource(@javax.annotation.Nullable String source) { + this.source = source; + } + + + public ProfileRequestModelExternalIdsInner sourceId(@javax.annotation.Nullable String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get sourceId + * @return sourceId + */ + @javax.annotation.Nullable + public String getSourceId() { + return sourceId; + } + + public void setSourceId(@javax.annotation.Nullable String sourceId) { + this.sourceId = sourceId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelExternalIdsInner instance itself + */ + public ProfileRequestModelExternalIdsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelExternalIdsInner profileRequestModelExternalIdsInner = (ProfileRequestModelExternalIdsInner) o; + return Objects.equals(this.operation, profileRequestModelExternalIdsInner.operation) && + Objects.equals(this.source, profileRequestModelExternalIdsInner.source) && + Objects.equals(this.sourceId, profileRequestModelExternalIdsInner.sourceId)&& + Objects.equals(this.additionalProperties, profileRequestModelExternalIdsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(operation, source, sourceId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelExternalIdsInner {\n"); + sb.append(" operation: ").append(toIndentedString(operation)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Operation"); + openapiFields.add("Source"); + openapiFields.add("SourceId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelExternalIdsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelExternalIdsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelExternalIdsInner is not found in the empty JSON string", ProfileRequestModelExternalIdsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Operation") != null && !jsonObj.get("Operation").isJsonNull()) && !jsonObj.get("Operation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Operation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Operation").toString())); + } + if ((jsonObj.get("Source") != null && !jsonObj.get("Source").isJsonNull()) && !jsonObj.get("Source").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Source").toString())); + } + if ((jsonObj.get("SourceId") != null && !jsonObj.get("SourceId").isJsonNull()) && !jsonObj.get("SourceId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SourceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SourceId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelExternalIdsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelExternalIdsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelExternalIdsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelExternalIdsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelExternalIdsInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelExternalIdsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelExternalIdsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelExternalIdsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelExternalIdsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelExternalIdsInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelExternalIdsInner + */ + public static ProfileRequestModelExternalIdsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelExternalIdsInner.class); + } + + /** + * Convert an instance of ProfileRequestModelExternalIdsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelFamilyInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelFamilyInner.java new file mode 100644 index 0000000..434dbf8 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelFamilyInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelFamilyInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelFamilyInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_RELATIONSHIP = "Relationship"; + @SerializedName(SERIALIZED_NAME_RELATIONSHIP) + @javax.annotation.Nullable + private String relationship; + + public ProfileRequestModelFamilyInner() { + } + + public ProfileRequestModelFamilyInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileRequestModelFamilyInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileRequestModelFamilyInner relationship(@javax.annotation.Nullable String relationship) { + this.relationship = relationship; + return this; + } + + /** + * Get relationship + * @return relationship + */ + @javax.annotation.Nullable + public String getRelationship() { + return relationship; + } + + public void setRelationship(@javax.annotation.Nullable String relationship) { + this.relationship = relationship; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelFamilyInner instance itself + */ + public ProfileRequestModelFamilyInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelFamilyInner profileRequestModelFamilyInner = (ProfileRequestModelFamilyInner) o; + return Objects.equals(this.id, profileRequestModelFamilyInner.id) && + Objects.equals(this.name, profileRequestModelFamilyInner.name) && + Objects.equals(this.relationship, profileRequestModelFamilyInner.relationship)&& + Objects.equals(this.additionalProperties, profileRequestModelFamilyInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, relationship, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelFamilyInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" relationship: ").append(toIndentedString(relationship)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Relationship"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelFamilyInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelFamilyInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelFamilyInner is not found in the empty JSON string", ProfileRequestModelFamilyInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Relationship") != null && !jsonObj.get("Relationship").isJsonNull()) && !jsonObj.get("Relationship").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Relationship` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Relationship").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelFamilyInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelFamilyInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelFamilyInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelFamilyInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelFamilyInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelFamilyInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelFamilyInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelFamilyInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelFamilyInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelFamilyInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelFamilyInner + */ + public static ProfileRequestModelFamilyInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelFamilyInner.class); + } + + /** + * Convert an instance of ProfileRequestModelFamilyInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelFavoriteThingsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelFavoriteThingsInner.java new file mode 100644 index 0000000..417284c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelFavoriteThingsInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelFavoriteThingsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelFavoriteThingsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_TYPE = "Type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public ProfileRequestModelFavoriteThingsInner() { + } + + public ProfileRequestModelFavoriteThingsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileRequestModelFavoriteThingsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileRequestModelFavoriteThingsInner type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelFavoriteThingsInner instance itself + */ + public ProfileRequestModelFavoriteThingsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelFavoriteThingsInner profileRequestModelFavoriteThingsInner = (ProfileRequestModelFavoriteThingsInner) o; + return Objects.equals(this.id, profileRequestModelFavoriteThingsInner.id) && + Objects.equals(this.name, profileRequestModelFavoriteThingsInner.name) && + Objects.equals(this.type, profileRequestModelFavoriteThingsInner.type)&& + Objects.equals(this.additionalProperties, profileRequestModelFavoriteThingsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelFavoriteThingsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelFavoriteThingsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelFavoriteThingsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelFavoriteThingsInner is not found in the empty JSON string", ProfileRequestModelFavoriteThingsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Type") != null && !jsonObj.get("Type").isJsonNull()) && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelFavoriteThingsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelFavoriteThingsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelFavoriteThingsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelFavoriteThingsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelFavoriteThingsInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelFavoriteThingsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelFavoriteThingsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelFavoriteThingsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelFavoriteThingsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelFavoriteThingsInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelFavoriteThingsInner + */ + public static ProfileRequestModelFavoriteThingsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelFavoriteThingsInner.class); + } + + /** + * Convert an instance of ProfileRequestModelFavoriteThingsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelGamesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelGamesInner.java new file mode 100644 index 0000000..b1e5eb1 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelGamesInner.java @@ -0,0 +1,375 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelGamesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelGamesInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_CATEGORY = "Category"; + @SerializedName(SERIALIZED_NAME_CATEGORY) + @javax.annotation.Nullable + private String category; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public ProfileRequestModelGamesInner() { + } + + public ProfileRequestModelGamesInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileRequestModelGamesInner category(@javax.annotation.Nullable String category) { + this.category = category; + return this; + } + + /** + * Get category + * @return category + */ + @javax.annotation.Nullable + public String getCategory() { + return category; + } + + public void setCategory(@javax.annotation.Nullable String category) { + this.category = category; + } + + + public ProfileRequestModelGamesInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileRequestModelGamesInner createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get createdDate + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelGamesInner instance itself + */ + public ProfileRequestModelGamesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelGamesInner profileRequestModelGamesInner = (ProfileRequestModelGamesInner) o; + return Objects.equals(this.id, profileRequestModelGamesInner.id) && + Objects.equals(this.category, profileRequestModelGamesInner.category) && + Objects.equals(this.name, profileRequestModelGamesInner.name) && + Objects.equals(this.createdDate, profileRequestModelGamesInner.createdDate)&& + Objects.equals(this.additionalProperties, profileRequestModelGamesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, createdDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelGamesInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Category"); + openapiFields.add("Name"); + openapiFields.add("CreatedDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelGamesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelGamesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelGamesInner is not found in the empty JSON string", ProfileRequestModelGamesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Category") != null && !jsonObj.get("Category").isJsonNull()) && !jsonObj.get("Category").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Category` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Category").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelGamesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelGamesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelGamesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelGamesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelGamesInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelGamesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelGamesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelGamesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelGamesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelGamesInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelGamesInner + */ + public static ProfileRequestModelGamesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelGamesInner.class); + } + + /** + * Convert an instance of ProfileRequestModelGamesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelIMAccountsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelIMAccountsInner.java new file mode 100644 index 0000000..0390d1c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelIMAccountsInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelIMAccountsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelIMAccountsInner { + public static final String SERIALIZED_NAME_ACCOUNT_TYPE = "AccountType"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_TYPE) + @javax.annotation.Nullable + private String accountType; + + public static final String SERIALIZED_NAME_ACCOUNT_NAME = "AccountName"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NAME) + @javax.annotation.Nullable + private String accountName; + + public ProfileRequestModelIMAccountsInner() { + } + + public ProfileRequestModelIMAccountsInner accountType(@javax.annotation.Nullable String accountType) { + this.accountType = accountType; + return this; + } + + /** + * Get accountType + * @return accountType + */ + @javax.annotation.Nullable + public String getAccountType() { + return accountType; + } + + public void setAccountType(@javax.annotation.Nullable String accountType) { + this.accountType = accountType; + } + + + public ProfileRequestModelIMAccountsInner accountName(@javax.annotation.Nullable String accountName) { + this.accountName = accountName; + return this; + } + + /** + * Get accountName + * @return accountName + */ + @javax.annotation.Nullable + public String getAccountName() { + return accountName; + } + + public void setAccountName(@javax.annotation.Nullable String accountName) { + this.accountName = accountName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelIMAccountsInner instance itself + */ + public ProfileRequestModelIMAccountsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelIMAccountsInner profileRequestModelIMAccountsInner = (ProfileRequestModelIMAccountsInner) o; + return Objects.equals(this.accountType, profileRequestModelIMAccountsInner.accountType) && + Objects.equals(this.accountName, profileRequestModelIMAccountsInner.accountName)&& + Objects.equals(this.additionalProperties, profileRequestModelIMAccountsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accountType, accountName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelIMAccountsInner {\n"); + sb.append(" accountType: ").append(toIndentedString(accountType)).append("\n"); + sb.append(" accountName: ").append(toIndentedString(accountName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AccountType"); + openapiFields.add("AccountName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelIMAccountsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelIMAccountsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelIMAccountsInner is not found in the empty JSON string", ProfileRequestModelIMAccountsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("AccountType") != null && !jsonObj.get("AccountType").isJsonNull()) && !jsonObj.get("AccountType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccountType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccountType").toString())); + } + if ((jsonObj.get("AccountName") != null && !jsonObj.get("AccountName").isJsonNull()) && !jsonObj.get("AccountName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccountName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccountName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelIMAccountsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelIMAccountsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelIMAccountsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelIMAccountsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelIMAccountsInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelIMAccountsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelIMAccountsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelIMAccountsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelIMAccountsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelIMAccountsInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelIMAccountsInner + */ + public static ProfileRequestModelIMAccountsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelIMAccountsInner.class); + } + + /** + * Convert an instance of ProfileRequestModelIMAccountsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelInspirationalPeopleInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelInspirationalPeopleInner.java new file mode 100644 index 0000000..0cfbf9b --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelInspirationalPeopleInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelInspirationalPeopleInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelInspirationalPeopleInner { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public ProfileRequestModelInspirationalPeopleInner() { + } + + public ProfileRequestModelInspirationalPeopleInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileRequestModelInspirationalPeopleInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelInspirationalPeopleInner instance itself + */ + public ProfileRequestModelInspirationalPeopleInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelInspirationalPeopleInner profileRequestModelInspirationalPeopleInner = (ProfileRequestModelInspirationalPeopleInner) o; + return Objects.equals(this.name, profileRequestModelInspirationalPeopleInner.name) && + Objects.equals(this.id, profileRequestModelInspirationalPeopleInner.id)&& + Objects.equals(this.additionalProperties, profileRequestModelInspirationalPeopleInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, id, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelInspirationalPeopleInner {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + openapiFields.add("Id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelInspirationalPeopleInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelInspirationalPeopleInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelInspirationalPeopleInner is not found in the empty JSON string", ProfileRequestModelInspirationalPeopleInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelInspirationalPeopleInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelInspirationalPeopleInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelInspirationalPeopleInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelInspirationalPeopleInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelInspirationalPeopleInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelInspirationalPeopleInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelInspirationalPeopleInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelInspirationalPeopleInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelInspirationalPeopleInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelInspirationalPeopleInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelInspirationalPeopleInner + */ + public static ProfileRequestModelInspirationalPeopleInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelInspirationalPeopleInner.class); + } + + /** + * Convert an instance of ProfileRequestModelInspirationalPeopleInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelInterestsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelInterestsInner.java new file mode 100644 index 0000000..11be5d8 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelInterestsInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelInterestsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelInterestsInner { + public static final String SERIALIZED_NAME_INTEREST_TYPE = "InterestType"; + @SerializedName(SERIALIZED_NAME_INTEREST_TYPE) + @javax.annotation.Nullable + private String interestType; + + public static final String SERIALIZED_NAME_INTEREST_NAME = "InterestName"; + @SerializedName(SERIALIZED_NAME_INTEREST_NAME) + @javax.annotation.Nullable + private String interestName; + + public ProfileRequestModelInterestsInner() { + } + + public ProfileRequestModelInterestsInner interestType(@javax.annotation.Nullable String interestType) { + this.interestType = interestType; + return this; + } + + /** + * Get interestType + * @return interestType + */ + @javax.annotation.Nullable + public String getInterestType() { + return interestType; + } + + public void setInterestType(@javax.annotation.Nullable String interestType) { + this.interestType = interestType; + } + + + public ProfileRequestModelInterestsInner interestName(@javax.annotation.Nullable String interestName) { + this.interestName = interestName; + return this; + } + + /** + * Get interestName + * @return interestName + */ + @javax.annotation.Nullable + public String getInterestName() { + return interestName; + } + + public void setInterestName(@javax.annotation.Nullable String interestName) { + this.interestName = interestName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelInterestsInner instance itself + */ + public ProfileRequestModelInterestsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelInterestsInner profileRequestModelInterestsInner = (ProfileRequestModelInterestsInner) o; + return Objects.equals(this.interestType, profileRequestModelInterestsInner.interestType) && + Objects.equals(this.interestName, profileRequestModelInterestsInner.interestName)&& + Objects.equals(this.additionalProperties, profileRequestModelInterestsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(interestType, interestName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelInterestsInner {\n"); + sb.append(" interestType: ").append(toIndentedString(interestType)).append("\n"); + sb.append(" interestName: ").append(toIndentedString(interestName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("InterestType"); + openapiFields.add("InterestName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelInterestsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelInterestsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelInterestsInner is not found in the empty JSON string", ProfileRequestModelInterestsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("InterestType") != null && !jsonObj.get("InterestType").isJsonNull()) && !jsonObj.get("InterestType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `InterestType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("InterestType").toString())); + } + if ((jsonObj.get("InterestName") != null && !jsonObj.get("InterestName").isJsonNull()) && !jsonObj.get("InterestName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `InterestName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("InterestName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelInterestsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelInterestsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelInterestsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelInterestsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelInterestsInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelInterestsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelInterestsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelInterestsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelInterestsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelInterestsInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelInterestsInner + */ + public static ProfileRequestModelInterestsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelInterestsInner.class); + } + + /** + * Convert an instance of ProfileRequestModelInterestsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelJobBookmarksInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelJobBookmarksInner.java new file mode 100644 index 0000000..97295a6 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelJobBookmarksInner.java @@ -0,0 +1,398 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProfileRequestModelJobBookmarksInnerJob; +import java.io.IOException; +import java.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelJobBookmarksInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelJobBookmarksInner { + public static final String SERIALIZED_NAME_IS_APPLIED = "IsApplied"; + @SerializedName(SERIALIZED_NAME_IS_APPLIED) + @javax.annotation.Nullable + private Boolean isApplied; + + public static final String SERIALIZED_NAME_IS_SAVED = "IsSaved"; + @SerializedName(SERIALIZED_NAME_IS_SAVED) + @javax.annotation.Nullable + private Boolean isSaved; + + public static final String SERIALIZED_NAME_APPLY_TIMESTAMP = "ApplyTimestamp"; + @SerializedName(SERIALIZED_NAME_APPLY_TIMESTAMP) + @javax.annotation.Nullable + private OffsetDateTime applyTimestamp; + + public static final String SERIALIZED_NAME_SAVED_TIMESTAMP = "SavedTimestamp"; + @SerializedName(SERIALIZED_NAME_SAVED_TIMESTAMP) + @javax.annotation.Nullable + private OffsetDateTime savedTimestamp; + + public static final String SERIALIZED_NAME_JOB = "Job"; + @SerializedName(SERIALIZED_NAME_JOB) + @javax.annotation.Nullable + private ProfileRequestModelJobBookmarksInnerJob job; + + public ProfileRequestModelJobBookmarksInner() { + } + + public ProfileRequestModelJobBookmarksInner isApplied(@javax.annotation.Nullable Boolean isApplied) { + this.isApplied = isApplied; + return this; + } + + /** + * Get isApplied + * @return isApplied + */ + @javax.annotation.Nullable + public Boolean getIsApplied() { + return isApplied; + } + + public void setIsApplied(@javax.annotation.Nullable Boolean isApplied) { + this.isApplied = isApplied; + } + + + public ProfileRequestModelJobBookmarksInner isSaved(@javax.annotation.Nullable Boolean isSaved) { + this.isSaved = isSaved; + return this; + } + + /** + * Get isSaved + * @return isSaved + */ + @javax.annotation.Nullable + public Boolean getIsSaved() { + return isSaved; + } + + public void setIsSaved(@javax.annotation.Nullable Boolean isSaved) { + this.isSaved = isSaved; + } + + + public ProfileRequestModelJobBookmarksInner applyTimestamp(@javax.annotation.Nullable OffsetDateTime applyTimestamp) { + this.applyTimestamp = applyTimestamp; + return this; + } + + /** + * Get applyTimestamp + * @return applyTimestamp + */ + @javax.annotation.Nullable + public OffsetDateTime getApplyTimestamp() { + return applyTimestamp; + } + + public void setApplyTimestamp(@javax.annotation.Nullable OffsetDateTime applyTimestamp) { + this.applyTimestamp = applyTimestamp; + } + + + public ProfileRequestModelJobBookmarksInner savedTimestamp(@javax.annotation.Nullable OffsetDateTime savedTimestamp) { + this.savedTimestamp = savedTimestamp; + return this; + } + + /** + * Get savedTimestamp + * @return savedTimestamp + */ + @javax.annotation.Nullable + public OffsetDateTime getSavedTimestamp() { + return savedTimestamp; + } + + public void setSavedTimestamp(@javax.annotation.Nullable OffsetDateTime savedTimestamp) { + this.savedTimestamp = savedTimestamp; + } + + + public ProfileRequestModelJobBookmarksInner job(@javax.annotation.Nullable ProfileRequestModelJobBookmarksInnerJob job) { + this.job = job; + return this; + } + + /** + * Get job + * @return job + */ + @javax.annotation.Nullable + public ProfileRequestModelJobBookmarksInnerJob getJob() { + return job; + } + + public void setJob(@javax.annotation.Nullable ProfileRequestModelJobBookmarksInnerJob job) { + this.job = job; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelJobBookmarksInner instance itself + */ + public ProfileRequestModelJobBookmarksInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelJobBookmarksInner profileRequestModelJobBookmarksInner = (ProfileRequestModelJobBookmarksInner) o; + return Objects.equals(this.isApplied, profileRequestModelJobBookmarksInner.isApplied) && + Objects.equals(this.isSaved, profileRequestModelJobBookmarksInner.isSaved) && + Objects.equals(this.applyTimestamp, profileRequestModelJobBookmarksInner.applyTimestamp) && + Objects.equals(this.savedTimestamp, profileRequestModelJobBookmarksInner.savedTimestamp) && + Objects.equals(this.job, profileRequestModelJobBookmarksInner.job)&& + Objects.equals(this.additionalProperties, profileRequestModelJobBookmarksInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isApplied, isSaved, applyTimestamp, savedTimestamp, job, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelJobBookmarksInner {\n"); + sb.append(" isApplied: ").append(toIndentedString(isApplied)).append("\n"); + sb.append(" isSaved: ").append(toIndentedString(isSaved)).append("\n"); + sb.append(" applyTimestamp: ").append(toIndentedString(applyTimestamp)).append("\n"); + sb.append(" savedTimestamp: ").append(toIndentedString(savedTimestamp)).append("\n"); + sb.append(" job: ").append(toIndentedString(job)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsApplied"); + openapiFields.add("IsSaved"); + openapiFields.add("ApplyTimestamp"); + openapiFields.add("SavedTimestamp"); + openapiFields.add("Job"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelJobBookmarksInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelJobBookmarksInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelJobBookmarksInner is not found in the empty JSON string", ProfileRequestModelJobBookmarksInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `Job` + if (jsonObj.get("Job") != null && !jsonObj.get("Job").isJsonNull()) { + ProfileRequestModelJobBookmarksInnerJob.validateJsonElement(jsonObj.get("Job")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelJobBookmarksInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelJobBookmarksInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelJobBookmarksInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelJobBookmarksInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelJobBookmarksInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelJobBookmarksInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelJobBookmarksInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelJobBookmarksInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelJobBookmarksInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelJobBookmarksInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelJobBookmarksInner + */ + public static ProfileRequestModelJobBookmarksInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelJobBookmarksInner.class); + } + + /** + * Convert an instance of ProfileRequestModelJobBookmarksInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelJobBookmarksInnerJob.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelJobBookmarksInnerJob.java new file mode 100644 index 0000000..8e62d06 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelJobBookmarksInnerJob.java @@ -0,0 +1,436 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProfileRequestModelJobBookmarksInnerJobCompony; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelJobBookmarksInnerJobPosition; +import java.io.IOException; +import java.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelJobBookmarksInnerJob + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelJobBookmarksInnerJob { + public static final String SERIALIZED_NAME_ACTIVE = "Active"; + @SerializedName(SERIALIZED_NAME_ACTIVE) + @javax.annotation.Nullable + private Boolean active; + + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_DESCRIPTION_SNIPPET = "DescriptionSnippet"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION_SNIPPET) + @javax.annotation.Nullable + private String descriptionSnippet; + + public static final String SERIALIZED_NAME_POSTING_TIMESTAMP = "PostingTimestamp"; + @SerializedName(SERIALIZED_NAME_POSTING_TIMESTAMP) + @javax.annotation.Nullable + private OffsetDateTime postingTimestamp; + + public static final String SERIALIZED_NAME_COMPONY = "Compony"; + @SerializedName(SERIALIZED_NAME_COMPONY) + @javax.annotation.Nullable + private ProfileRequestModelJobBookmarksInnerJobCompony compony; + + public static final String SERIALIZED_NAME_POSITION = "Position"; + @SerializedName(SERIALIZED_NAME_POSITION) + @javax.annotation.Nullable + private ProfileRequestModelJobBookmarksInnerJobPosition position; + + public ProfileRequestModelJobBookmarksInnerJob() { + } + + public ProfileRequestModelJobBookmarksInnerJob active(@javax.annotation.Nullable Boolean active) { + this.active = active; + return this; + } + + /** + * Get active + * @return active + */ + @javax.annotation.Nullable + public Boolean getActive() { + return active; + } + + public void setActive(@javax.annotation.Nullable Boolean active) { + this.active = active; + } + + + public ProfileRequestModelJobBookmarksInnerJob id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileRequestModelJobBookmarksInnerJob descriptionSnippet(@javax.annotation.Nullable String descriptionSnippet) { + this.descriptionSnippet = descriptionSnippet; + return this; + } + + /** + * Get descriptionSnippet + * @return descriptionSnippet + */ + @javax.annotation.Nullable + public String getDescriptionSnippet() { + return descriptionSnippet; + } + + public void setDescriptionSnippet(@javax.annotation.Nullable String descriptionSnippet) { + this.descriptionSnippet = descriptionSnippet; + } + + + public ProfileRequestModelJobBookmarksInnerJob postingTimestamp(@javax.annotation.Nullable OffsetDateTime postingTimestamp) { + this.postingTimestamp = postingTimestamp; + return this; + } + + /** + * Get postingTimestamp + * @return postingTimestamp + */ + @javax.annotation.Nullable + public OffsetDateTime getPostingTimestamp() { + return postingTimestamp; + } + + public void setPostingTimestamp(@javax.annotation.Nullable OffsetDateTime postingTimestamp) { + this.postingTimestamp = postingTimestamp; + } + + + public ProfileRequestModelJobBookmarksInnerJob compony(@javax.annotation.Nullable ProfileRequestModelJobBookmarksInnerJobCompony compony) { + this.compony = compony; + return this; + } + + /** + * Get compony + * @return compony + */ + @javax.annotation.Nullable + public ProfileRequestModelJobBookmarksInnerJobCompony getCompony() { + return compony; + } + + public void setCompony(@javax.annotation.Nullable ProfileRequestModelJobBookmarksInnerJobCompony compony) { + this.compony = compony; + } + + + public ProfileRequestModelJobBookmarksInnerJob position(@javax.annotation.Nullable ProfileRequestModelJobBookmarksInnerJobPosition position) { + this.position = position; + return this; + } + + /** + * Get position + * @return position + */ + @javax.annotation.Nullable + public ProfileRequestModelJobBookmarksInnerJobPosition getPosition() { + return position; + } + + public void setPosition(@javax.annotation.Nullable ProfileRequestModelJobBookmarksInnerJobPosition position) { + this.position = position; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelJobBookmarksInnerJob instance itself + */ + public ProfileRequestModelJobBookmarksInnerJob putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelJobBookmarksInnerJob profileRequestModelJobBookmarksInnerJob = (ProfileRequestModelJobBookmarksInnerJob) o; + return Objects.equals(this.active, profileRequestModelJobBookmarksInnerJob.active) && + Objects.equals(this.id, profileRequestModelJobBookmarksInnerJob.id) && + Objects.equals(this.descriptionSnippet, profileRequestModelJobBookmarksInnerJob.descriptionSnippet) && + Objects.equals(this.postingTimestamp, profileRequestModelJobBookmarksInnerJob.postingTimestamp) && + Objects.equals(this.compony, profileRequestModelJobBookmarksInnerJob.compony) && + Objects.equals(this.position, profileRequestModelJobBookmarksInnerJob.position)&& + Objects.equals(this.additionalProperties, profileRequestModelJobBookmarksInnerJob.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(active, id, descriptionSnippet, postingTimestamp, compony, position, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelJobBookmarksInnerJob {\n"); + sb.append(" active: ").append(toIndentedString(active)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" descriptionSnippet: ").append(toIndentedString(descriptionSnippet)).append("\n"); + sb.append(" postingTimestamp: ").append(toIndentedString(postingTimestamp)).append("\n"); + sb.append(" compony: ").append(toIndentedString(compony)).append("\n"); + sb.append(" position: ").append(toIndentedString(position)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Active"); + openapiFields.add("Id"); + openapiFields.add("DescriptionSnippet"); + openapiFields.add("PostingTimestamp"); + openapiFields.add("Compony"); + openapiFields.add("Position"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelJobBookmarksInnerJob + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelJobBookmarksInnerJob.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelJobBookmarksInnerJob is not found in the empty JSON string", ProfileRequestModelJobBookmarksInnerJob.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("DescriptionSnippet") != null && !jsonObj.get("DescriptionSnippet").isJsonNull()) && !jsonObj.get("DescriptionSnippet").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DescriptionSnippet` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DescriptionSnippet").toString())); + } + // validate the optional field `Compony` + if (jsonObj.get("Compony") != null && !jsonObj.get("Compony").isJsonNull()) { + ProfileRequestModelJobBookmarksInnerJobCompony.validateJsonElement(jsonObj.get("Compony")); + } + // validate the optional field `Position` + if (jsonObj.get("Position") != null && !jsonObj.get("Position").isJsonNull()) { + ProfileRequestModelJobBookmarksInnerJobPosition.validateJsonElement(jsonObj.get("Position")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelJobBookmarksInnerJob.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelJobBookmarksInnerJob' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelJobBookmarksInnerJob> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelJobBookmarksInnerJob.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelJobBookmarksInnerJob>() { + @Override + public void write(JsonWriter out, ProfileRequestModelJobBookmarksInnerJob value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelJobBookmarksInnerJob read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelJobBookmarksInnerJob instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelJobBookmarksInnerJob given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelJobBookmarksInnerJob + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelJobBookmarksInnerJob + */ + public static ProfileRequestModelJobBookmarksInnerJob fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelJobBookmarksInnerJob.class); + } + + /** + * Convert an instance of ProfileRequestModelJobBookmarksInnerJob to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelJobBookmarksInnerJobCompony.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelJobBookmarksInnerJobCompony.java new file mode 100644 index 0000000..76b3a56 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelJobBookmarksInnerJobCompony.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelJobBookmarksInnerJobCompony + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelJobBookmarksInnerJobCompony { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ProfileRequestModelJobBookmarksInnerJobCompony() { + } + + public ProfileRequestModelJobBookmarksInnerJobCompony id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileRequestModelJobBookmarksInnerJobCompony name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelJobBookmarksInnerJobCompony instance itself + */ + public ProfileRequestModelJobBookmarksInnerJobCompony putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelJobBookmarksInnerJobCompony profileRequestModelJobBookmarksInnerJobCompony = (ProfileRequestModelJobBookmarksInnerJobCompony) o; + return Objects.equals(this.id, profileRequestModelJobBookmarksInnerJobCompony.id) && + Objects.equals(this.name, profileRequestModelJobBookmarksInnerJobCompony.name)&& + Objects.equals(this.additionalProperties, profileRequestModelJobBookmarksInnerJobCompony.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelJobBookmarksInnerJobCompony {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelJobBookmarksInnerJobCompony + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelJobBookmarksInnerJobCompony.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelJobBookmarksInnerJobCompony is not found in the empty JSON string", ProfileRequestModelJobBookmarksInnerJobCompony.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelJobBookmarksInnerJobCompony.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelJobBookmarksInnerJobCompony' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelJobBookmarksInnerJobCompony> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelJobBookmarksInnerJobCompony.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelJobBookmarksInnerJobCompony>() { + @Override + public void write(JsonWriter out, ProfileRequestModelJobBookmarksInnerJobCompony value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelJobBookmarksInnerJobCompony read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelJobBookmarksInnerJobCompony instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelJobBookmarksInnerJobCompony given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelJobBookmarksInnerJobCompony + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelJobBookmarksInnerJobCompony + */ + public static ProfileRequestModelJobBookmarksInnerJobCompony fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelJobBookmarksInnerJobCompony.class); + } + + /** + * Convert an instance of ProfileRequestModelJobBookmarksInnerJobCompony to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelJobBookmarksInnerJobPosition.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelJobBookmarksInnerJobPosition.java new file mode 100644 index 0000000..2f8b41d --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelJobBookmarksInnerJobPosition.java @@ -0,0 +1,287 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelJobBookmarksInnerJobPosition + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelJobBookmarksInnerJobPosition { + public static final String SERIALIZED_NAME_TITLE = "Title"; + @SerializedName(SERIALIZED_NAME_TITLE) + @javax.annotation.Nullable + private String title; + + public ProfileRequestModelJobBookmarksInnerJobPosition() { + } + + public ProfileRequestModelJobBookmarksInnerJobPosition title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * Get title + * @return title + */ + @javax.annotation.Nullable + public String getTitle() { + return title; + } + + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelJobBookmarksInnerJobPosition instance itself + */ + public ProfileRequestModelJobBookmarksInnerJobPosition putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelJobBookmarksInnerJobPosition profileRequestModelJobBookmarksInnerJobPosition = (ProfileRequestModelJobBookmarksInnerJobPosition) o; + return Objects.equals(this.title, profileRequestModelJobBookmarksInnerJobPosition.title)&& + Objects.equals(this.additionalProperties, profileRequestModelJobBookmarksInnerJobPosition.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(title, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelJobBookmarksInnerJobPosition {\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Title"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelJobBookmarksInnerJobPosition + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelJobBookmarksInnerJobPosition.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelJobBookmarksInnerJobPosition is not found in the empty JSON string", ProfileRequestModelJobBookmarksInnerJobPosition.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Title") != null && !jsonObj.get("Title").isJsonNull()) && !jsonObj.get("Title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Title").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelJobBookmarksInnerJobPosition.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelJobBookmarksInnerJobPosition' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelJobBookmarksInnerJobPosition> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelJobBookmarksInnerJobPosition.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelJobBookmarksInnerJobPosition>() { + @Override + public void write(JsonWriter out, ProfileRequestModelJobBookmarksInnerJobPosition value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelJobBookmarksInnerJobPosition read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelJobBookmarksInnerJobPosition instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelJobBookmarksInnerJobPosition given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelJobBookmarksInnerJobPosition + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelJobBookmarksInnerJobPosition + */ + public static ProfileRequestModelJobBookmarksInnerJobPosition fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelJobBookmarksInnerJobPosition.class); + } + + /** + * Convert an instance of ProfileRequestModelJobBookmarksInnerJobPosition to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelLanguagesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelLanguagesInner.java new file mode 100644 index 0000000..e8b4557 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelLanguagesInner.java @@ -0,0 +1,377 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelLanguagesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelLanguagesInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_PROFICIENCY = "Proficiency"; + @SerializedName(SERIALIZED_NAME_PROFICIENCY) + @javax.annotation.Nullable + private String proficiency; + + public static final String SERIALIZED_NAME_OP = "op"; + @SerializedName(SERIALIZED_NAME_OP) + @javax.annotation.Nullable + private String op; + + public ProfileRequestModelLanguagesInner() { + } + + public ProfileRequestModelLanguagesInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileRequestModelLanguagesInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileRequestModelLanguagesInner proficiency(@javax.annotation.Nullable String proficiency) { + this.proficiency = proficiency; + return this; + } + + /** + * Get proficiency + * @return proficiency + */ + @javax.annotation.Nullable + public String getProficiency() { + return proficiency; + } + + public void setProficiency(@javax.annotation.Nullable String proficiency) { + this.proficiency = proficiency; + } + + + public ProfileRequestModelLanguagesInner op(@javax.annotation.Nullable String op) { + this.op = op; + return this; + } + + /** + * Get op + * @return op + */ + @javax.annotation.Nullable + public String getOp() { + return op; + } + + public void setOp(@javax.annotation.Nullable String op) { + this.op = op; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelLanguagesInner instance itself + */ + public ProfileRequestModelLanguagesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelLanguagesInner profileRequestModelLanguagesInner = (ProfileRequestModelLanguagesInner) o; + return Objects.equals(this.id, profileRequestModelLanguagesInner.id) && + Objects.equals(this.name, profileRequestModelLanguagesInner.name) && + Objects.equals(this.proficiency, profileRequestModelLanguagesInner.proficiency) && + Objects.equals(this.op, profileRequestModelLanguagesInner.op)&& + Objects.equals(this.additionalProperties, profileRequestModelLanguagesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, proficiency, op, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelLanguagesInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" proficiency: ").append(toIndentedString(proficiency)).append("\n"); + sb.append(" op: ").append(toIndentedString(op)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Proficiency"); + openapiFields.add("op"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelLanguagesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelLanguagesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelLanguagesInner is not found in the empty JSON string", ProfileRequestModelLanguagesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Proficiency") != null && !jsonObj.get("Proficiency").isJsonNull()) && !jsonObj.get("Proficiency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Proficiency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Proficiency").toString())); + } + if ((jsonObj.get("op") != null && !jsonObj.get("op").isJsonNull()) && !jsonObj.get("op").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `op` to be a primitive type in the JSON string but got `%s`", jsonObj.get("op").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelLanguagesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelLanguagesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelLanguagesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelLanguagesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelLanguagesInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelLanguagesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelLanguagesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelLanguagesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelLanguagesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelLanguagesInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelLanguagesInner + */ + public static ProfileRequestModelLanguagesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelLanguagesInner.class); + } + + /** + * Convert an instance of ProfileRequestModelLanguagesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelMemberUrlResourcesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelMemberUrlResourcesInner.java new file mode 100644 index 0000000..b4d6d8a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelMemberUrlResourcesInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelMemberUrlResourcesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelMemberUrlResourcesInner { + public static final String SERIALIZED_NAME_URL_NAME = "UrlName"; + @SerializedName(SERIALIZED_NAME_URL_NAME) + @javax.annotation.Nullable + private String urlName; + + public static final String SERIALIZED_NAME_URL = "Url"; + @SerializedName(SERIALIZED_NAME_URL) + @javax.annotation.Nullable + private String url; + + public ProfileRequestModelMemberUrlResourcesInner() { + } + + public ProfileRequestModelMemberUrlResourcesInner urlName(@javax.annotation.Nullable String urlName) { + this.urlName = urlName; + return this; + } + + /** + * Get urlName + * @return urlName + */ + @javax.annotation.Nullable + public String getUrlName() { + return urlName; + } + + public void setUrlName(@javax.annotation.Nullable String urlName) { + this.urlName = urlName; + } + + + public ProfileRequestModelMemberUrlResourcesInner url(@javax.annotation.Nullable String url) { + this.url = url; + return this; + } + + /** + * Get url + * @return url + */ + @javax.annotation.Nullable + public String getUrl() { + return url; + } + + public void setUrl(@javax.annotation.Nullable String url) { + this.url = url; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelMemberUrlResourcesInner instance itself + */ + public ProfileRequestModelMemberUrlResourcesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelMemberUrlResourcesInner profileRequestModelMemberUrlResourcesInner = (ProfileRequestModelMemberUrlResourcesInner) o; + return Objects.equals(this.urlName, profileRequestModelMemberUrlResourcesInner.urlName) && + Objects.equals(this.url, profileRequestModelMemberUrlResourcesInner.url)&& + Objects.equals(this.additionalProperties, profileRequestModelMemberUrlResourcesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(urlName, url, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelMemberUrlResourcesInner {\n"); + sb.append(" urlName: ").append(toIndentedString(urlName)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("UrlName"); + openapiFields.add("Url"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelMemberUrlResourcesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelMemberUrlResourcesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelMemberUrlResourcesInner is not found in the empty JSON string", ProfileRequestModelMemberUrlResourcesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("UrlName") != null && !jsonObj.get("UrlName").isJsonNull()) && !jsonObj.get("UrlName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UrlName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UrlName").toString())); + } + if ((jsonObj.get("Url") != null && !jsonObj.get("Url").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelMemberUrlResourcesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelMemberUrlResourcesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelMemberUrlResourcesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelMemberUrlResourcesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelMemberUrlResourcesInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelMemberUrlResourcesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelMemberUrlResourcesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelMemberUrlResourcesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelMemberUrlResourcesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelMemberUrlResourcesInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelMemberUrlResourcesInner + */ + public static ProfileRequestModelMemberUrlResourcesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelMemberUrlResourcesInner.class); + } + + /** + * Convert an instance of ProfileRequestModelMemberUrlResourcesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelMoviesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelMoviesInner.java new file mode 100644 index 0000000..0038468 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelMoviesInner.java @@ -0,0 +1,375 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelMoviesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelMoviesInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_CATEGORY = "Category"; + @SerializedName(SERIALIZED_NAME_CATEGORY) + @javax.annotation.Nullable + private String category; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public ProfileRequestModelMoviesInner() { + } + + public ProfileRequestModelMoviesInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileRequestModelMoviesInner category(@javax.annotation.Nullable String category) { + this.category = category; + return this; + } + + /** + * Get category + * @return category + */ + @javax.annotation.Nullable + public String getCategory() { + return category; + } + + public void setCategory(@javax.annotation.Nullable String category) { + this.category = category; + } + + + public ProfileRequestModelMoviesInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileRequestModelMoviesInner createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get createdDate + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelMoviesInner instance itself + */ + public ProfileRequestModelMoviesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelMoviesInner profileRequestModelMoviesInner = (ProfileRequestModelMoviesInner) o; + return Objects.equals(this.id, profileRequestModelMoviesInner.id) && + Objects.equals(this.category, profileRequestModelMoviesInner.category) && + Objects.equals(this.name, profileRequestModelMoviesInner.name) && + Objects.equals(this.createdDate, profileRequestModelMoviesInner.createdDate)&& + Objects.equals(this.additionalProperties, profileRequestModelMoviesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, createdDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelMoviesInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Category"); + openapiFields.add("Name"); + openapiFields.add("CreatedDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelMoviesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelMoviesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelMoviesInner is not found in the empty JSON string", ProfileRequestModelMoviesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Category") != null && !jsonObj.get("Category").isJsonNull()) && !jsonObj.get("Category").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Category` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Category").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelMoviesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelMoviesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelMoviesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelMoviesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelMoviesInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelMoviesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelMoviesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelMoviesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelMoviesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelMoviesInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelMoviesInner + */ + public static ProfileRequestModelMoviesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelMoviesInner.class); + } + + /** + * Convert an instance of ProfileRequestModelMoviesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelMutualFriendsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelMutualFriendsInner.java new file mode 100644 index 0000000..3f9f1e7 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelMutualFriendsInner.java @@ -0,0 +1,495 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelMutualFriendsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelMutualFriendsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_FIRST_NAME = "FirstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nullable + private String firstName; + + public static final String SERIALIZED_NAME_LAST_NAME = "LastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nullable + private String lastName; + + public static final String SERIALIZED_NAME_BIRTHDAY = "Birthday"; + @SerializedName(SERIALIZED_NAME_BIRTHDAY) + @javax.annotation.Nullable + private OffsetDateTime birthday; + + public static final String SERIALIZED_NAME_HOMETOWN = "Hometown"; + @SerializedName(SERIALIZED_NAME_HOMETOWN) + @javax.annotation.Nullable + private String hometown; + + public static final String SERIALIZED_NAME_LINK = "Link"; + @SerializedName(SERIALIZED_NAME_LINK) + @javax.annotation.Nullable + private String link; + + public static final String SERIALIZED_NAME_GENDER = "Gender"; + @SerializedName(SERIALIZED_NAME_GENDER) + @javax.annotation.Nullable + private String gender; + + public ProfileRequestModelMutualFriendsInner() { + } + + public ProfileRequestModelMutualFriendsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileRequestModelMutualFriendsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileRequestModelMutualFriendsInner firstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + */ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + } + + + public ProfileRequestModelMutualFriendsInner lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + + public ProfileRequestModelMutualFriendsInner birthday(@javax.annotation.Nullable OffsetDateTime birthday) { + this.birthday = birthday; + return this; + } + + /** + * Get birthday + * @return birthday + */ + @javax.annotation.Nullable + public OffsetDateTime getBirthday() { + return birthday; + } + + public void setBirthday(@javax.annotation.Nullable OffsetDateTime birthday) { + this.birthday = birthday; + } + + + public ProfileRequestModelMutualFriendsInner hometown(@javax.annotation.Nullable String hometown) { + this.hometown = hometown; + return this; + } + + /** + * Get hometown + * @return hometown + */ + @javax.annotation.Nullable + public String getHometown() { + return hometown; + } + + public void setHometown(@javax.annotation.Nullable String hometown) { + this.hometown = hometown; + } + + + public ProfileRequestModelMutualFriendsInner link(@javax.annotation.Nullable String link) { + this.link = link; + return this; + } + + /** + * Get link + * @return link + */ + @javax.annotation.Nullable + public String getLink() { + return link; + } + + public void setLink(@javax.annotation.Nullable String link) { + this.link = link; + } + + + public ProfileRequestModelMutualFriendsInner gender(@javax.annotation.Nullable String gender) { + this.gender = gender; + return this; + } + + /** + * Get gender + * @return gender + */ + @javax.annotation.Nullable + public String getGender() { + return gender; + } + + public void setGender(@javax.annotation.Nullable String gender) { + this.gender = gender; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelMutualFriendsInner instance itself + */ + public ProfileRequestModelMutualFriendsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelMutualFriendsInner profileRequestModelMutualFriendsInner = (ProfileRequestModelMutualFriendsInner) o; + return Objects.equals(this.id, profileRequestModelMutualFriendsInner.id) && + Objects.equals(this.name, profileRequestModelMutualFriendsInner.name) && + Objects.equals(this.firstName, profileRequestModelMutualFriendsInner.firstName) && + Objects.equals(this.lastName, profileRequestModelMutualFriendsInner.lastName) && + Objects.equals(this.birthday, profileRequestModelMutualFriendsInner.birthday) && + Objects.equals(this.hometown, profileRequestModelMutualFriendsInner.hometown) && + Objects.equals(this.link, profileRequestModelMutualFriendsInner.link) && + Objects.equals(this.gender, profileRequestModelMutualFriendsInner.gender)&& + Objects.equals(this.additionalProperties, profileRequestModelMutualFriendsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, firstName, lastName, birthday, hometown, link, gender, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelMutualFriendsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" birthday: ").append(toIndentedString(birthday)).append("\n"); + sb.append(" hometown: ").append(toIndentedString(hometown)).append("\n"); + sb.append(" link: ").append(toIndentedString(link)).append("\n"); + sb.append(" gender: ").append(toIndentedString(gender)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("FirstName"); + openapiFields.add("LastName"); + openapiFields.add("Birthday"); + openapiFields.add("Hometown"); + openapiFields.add("Link"); + openapiFields.add("Gender"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelMutualFriendsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelMutualFriendsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelMutualFriendsInner is not found in the empty JSON string", ProfileRequestModelMutualFriendsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("FirstName") != null && !jsonObj.get("FirstName").isJsonNull()) && !jsonObj.get("FirstName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FirstName").toString())); + } + if ((jsonObj.get("LastName") != null && !jsonObj.get("LastName").isJsonNull()) && !jsonObj.get("LastName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastName").toString())); + } + if ((jsonObj.get("Hometown") != null && !jsonObj.get("Hometown").isJsonNull()) && !jsonObj.get("Hometown").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Hometown` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Hometown").toString())); + } + 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())); + } + if ((jsonObj.get("Gender") != null && !jsonObj.get("Gender").isJsonNull()) && !jsonObj.get("Gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Gender").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelMutualFriendsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelMutualFriendsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelMutualFriendsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelMutualFriendsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelMutualFriendsInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelMutualFriendsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelMutualFriendsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelMutualFriendsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelMutualFriendsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelMutualFriendsInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelMutualFriendsInner + */ + public static ProfileRequestModelMutualFriendsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelMutualFriendsInner.class); + } + + /** + * Convert an instance of ProfileRequestModelMutualFriendsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelPINInfo.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelPINInfo.java new file mode 100644 index 0000000..19d0718 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelPINInfo.java @@ -0,0 +1,314 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelPINInfo + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelPINInfo { + public static final String SERIALIZED_NAME_P_I_N = "PIN"; + @SerializedName(SERIALIZED_NAME_P_I_N) + @javax.annotation.Nullable + private String PIN; + + public static final String SERIALIZED_NAME_SKIPPED = "Skipped"; + @SerializedName(SERIALIZED_NAME_SKIPPED) + @javax.annotation.Nullable + private Boolean skipped; + + public ProfileRequestModelPINInfo() { + } + + public ProfileRequestModelPINInfo PIN(@javax.annotation.Nullable String PIN) { + this.PIN = PIN; + return this; + } + + /** + * Get PIN + * @return PIN + */ + @javax.annotation.Nullable + public String getPIN() { + return PIN; + } + + public void setPIN(@javax.annotation.Nullable String PIN) { + this.PIN = PIN; + } + + + public ProfileRequestModelPINInfo skipped(@javax.annotation.Nullable Boolean skipped) { + this.skipped = skipped; + return this; + } + + /** + * Get skipped + * @return skipped + */ + @javax.annotation.Nullable + public Boolean getSkipped() { + return skipped; + } + + public void setSkipped(@javax.annotation.Nullable Boolean skipped) { + this.skipped = skipped; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelPINInfo instance itself + */ + public ProfileRequestModelPINInfo putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelPINInfo profileRequestModelPINInfo = (ProfileRequestModelPINInfo) o; + return Objects.equals(this.PIN, profileRequestModelPINInfo.PIN) && + Objects.equals(this.skipped, profileRequestModelPINInfo.skipped)&& + Objects.equals(this.additionalProperties, profileRequestModelPINInfo.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(PIN, skipped, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelPINInfo {\n"); + sb.append(" PIN: ").append(toIndentedString(PIN)).append("\n"); + sb.append(" skipped: ").append(toIndentedString(skipped)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("PIN"); + openapiFields.add("Skipped"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelPINInfo + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelPINInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelPINInfo is not found in the empty JSON string", ProfileRequestModelPINInfo.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("PIN") != null && !jsonObj.get("PIN").isJsonNull()) && !jsonObj.get("PIN").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PIN` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PIN").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelPINInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelPINInfo' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelPINInfo> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelPINInfo.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelPINInfo>() { + @Override + public void write(JsonWriter out, ProfileRequestModelPINInfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelPINInfo read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelPINInfo instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelPINInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelPINInfo + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelPINInfo + */ + public static ProfileRequestModelPINInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelPINInfo.class); + } + + /** + * Convert an instance of ProfileRequestModelPINInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelPatentsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelPatentsInner.java new file mode 100644 index 0000000..a8b948e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelPatentsInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelPatentsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelPatentsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_TITLE = "Title"; + @SerializedName(SERIALIZED_NAME_TITLE) + @javax.annotation.Nullable + private String title; + + public static final String SERIALIZED_NAME_DATE = "Date"; + @SerializedName(SERIALIZED_NAME_DATE) + @javax.annotation.Nullable + private String date; + + public ProfileRequestModelPatentsInner() { + } + + public ProfileRequestModelPatentsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileRequestModelPatentsInner title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * Get title + * @return title + */ + @javax.annotation.Nullable + public String getTitle() { + return title; + } + + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + public ProfileRequestModelPatentsInner date(@javax.annotation.Nullable String date) { + this.date = date; + return this; + } + + /** + * Get date + * @return date + */ + @javax.annotation.Nullable + public String getDate() { + return date; + } + + public void setDate(@javax.annotation.Nullable String date) { + this.date = date; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelPatentsInner instance itself + */ + public ProfileRequestModelPatentsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelPatentsInner profileRequestModelPatentsInner = (ProfileRequestModelPatentsInner) o; + return Objects.equals(this.id, profileRequestModelPatentsInner.id) && + Objects.equals(this.title, profileRequestModelPatentsInner.title) && + Objects.equals(this.date, profileRequestModelPatentsInner.date)&& + Objects.equals(this.additionalProperties, profileRequestModelPatentsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, title, date, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelPatentsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Title"); + openapiFields.add("Date"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelPatentsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelPatentsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelPatentsInner is not found in the empty JSON string", ProfileRequestModelPatentsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Title") != null && !jsonObj.get("Title").isJsonNull()) && !jsonObj.get("Title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Title").toString())); + } + if ((jsonObj.get("Date") != null && !jsonObj.get("Date").isJsonNull()) && !jsonObj.get("Date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Date").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelPatentsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelPatentsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelPatentsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelPatentsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelPatentsInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelPatentsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelPatentsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelPatentsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelPatentsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelPatentsInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelPatentsInner + */ + public static ProfileRequestModelPatentsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelPatentsInner.class); + } + + /** + * Convert an instance of ProfileRequestModelPatentsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelPhoneNumbersInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelPhoneNumbersInner.java new file mode 100644 index 0000000..844af91 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelPhoneNumbersInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelPhoneNumbersInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelPhoneNumbersInner { + public static final String SERIALIZED_NAME_PHONE_TYPE = "PhoneType"; + @SerializedName(SERIALIZED_NAME_PHONE_TYPE) + @javax.annotation.Nullable + private String phoneType; + + public static final String SERIALIZED_NAME_PHONE_NUMBER = "PhoneNumber"; + @SerializedName(SERIALIZED_NAME_PHONE_NUMBER) + @javax.annotation.Nullable + private String phoneNumber; + + public static final String SERIALIZED_NAME_OP = "op"; + @SerializedName(SERIALIZED_NAME_OP) + @javax.annotation.Nullable + private String op; + + public ProfileRequestModelPhoneNumbersInner() { + } + + public ProfileRequestModelPhoneNumbersInner phoneType(@javax.annotation.Nullable String phoneType) { + this.phoneType = phoneType; + return this; + } + + /** + * Get phoneType + * @return phoneType + */ + @javax.annotation.Nullable + public String getPhoneType() { + return phoneType; + } + + public void setPhoneType(@javax.annotation.Nullable String phoneType) { + this.phoneType = phoneType; + } + + + public ProfileRequestModelPhoneNumbersInner phoneNumber(@javax.annotation.Nullable String phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + * Get phoneNumber + * @return phoneNumber + */ + @javax.annotation.Nullable + public String getPhoneNumber() { + return phoneNumber; + } + + public void setPhoneNumber(@javax.annotation.Nullable String phoneNumber) { + this.phoneNumber = phoneNumber; + } + + + public ProfileRequestModelPhoneNumbersInner op(@javax.annotation.Nullable String op) { + this.op = op; + return this; + } + + /** + * Get op + * @return op + */ + @javax.annotation.Nullable + public String getOp() { + return op; + } + + public void setOp(@javax.annotation.Nullable String op) { + this.op = op; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelPhoneNumbersInner instance itself + */ + public ProfileRequestModelPhoneNumbersInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelPhoneNumbersInner profileRequestModelPhoneNumbersInner = (ProfileRequestModelPhoneNumbersInner) o; + return Objects.equals(this.phoneType, profileRequestModelPhoneNumbersInner.phoneType) && + Objects.equals(this.phoneNumber, profileRequestModelPhoneNumbersInner.phoneNumber) && + Objects.equals(this.op, profileRequestModelPhoneNumbersInner.op)&& + Objects.equals(this.additionalProperties, profileRequestModelPhoneNumbersInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(phoneType, phoneNumber, op, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelPhoneNumbersInner {\n"); + sb.append(" phoneType: ").append(toIndentedString(phoneType)).append("\n"); + sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); + sb.append(" op: ").append(toIndentedString(op)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("PhoneType"); + openapiFields.add("PhoneNumber"); + openapiFields.add("op"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelPhoneNumbersInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelPhoneNumbersInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelPhoneNumbersInner is not found in the empty JSON string", ProfileRequestModelPhoneNumbersInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("PhoneType") != null && !jsonObj.get("PhoneType").isJsonNull()) && !jsonObj.get("PhoneType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PhoneType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PhoneType").toString())); + } + if ((jsonObj.get("PhoneNumber") != null && !jsonObj.get("PhoneNumber").isJsonNull()) && !jsonObj.get("PhoneNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PhoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PhoneNumber").toString())); + } + if ((jsonObj.get("op") != null && !jsonObj.get("op").isJsonNull()) && !jsonObj.get("op").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `op` to be a primitive type in the JSON string but got `%s`", jsonObj.get("op").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelPhoneNumbersInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelPhoneNumbersInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelPhoneNumbersInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelPhoneNumbersInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelPhoneNumbersInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelPhoneNumbersInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelPhoneNumbersInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelPhoneNumbersInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelPhoneNumbersInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelPhoneNumbersInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelPhoneNumbersInner + */ + public static ProfileRequestModelPhoneNumbersInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelPhoneNumbersInner.class); + } + + /** + * Convert an instance of ProfileRequestModelPhoneNumbersInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelPlacesLivedInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelPlacesLivedInner.java new file mode 100644 index 0000000..8901dc8 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelPlacesLivedInner.java @@ -0,0 +1,344 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelPlacesLivedInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelPlacesLivedInner { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_OPERATION = "Operation"; + @SerializedName(SERIALIZED_NAME_OPERATION) + @javax.annotation.Nullable + private String operation; + + public static final String SERIALIZED_NAME_IS_PRIMARY = "IsPrimary"; + @SerializedName(SERIALIZED_NAME_IS_PRIMARY) + @javax.annotation.Nullable + private Boolean isPrimary; + + public ProfileRequestModelPlacesLivedInner() { + } + + public ProfileRequestModelPlacesLivedInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileRequestModelPlacesLivedInner operation(@javax.annotation.Nullable String operation) { + this.operation = operation; + return this; + } + + /** + * Get operation + * @return operation + */ + @javax.annotation.Nullable + public String getOperation() { + return operation; + } + + public void setOperation(@javax.annotation.Nullable String operation) { + this.operation = operation; + } + + + public ProfileRequestModelPlacesLivedInner isPrimary(@javax.annotation.Nullable Boolean isPrimary) { + this.isPrimary = isPrimary; + return this; + } + + /** + * Get isPrimary + * @return isPrimary + */ + @javax.annotation.Nullable + public Boolean getIsPrimary() { + return isPrimary; + } + + public void setIsPrimary(@javax.annotation.Nullable Boolean isPrimary) { + this.isPrimary = isPrimary; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelPlacesLivedInner instance itself + */ + public ProfileRequestModelPlacesLivedInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelPlacesLivedInner profileRequestModelPlacesLivedInner = (ProfileRequestModelPlacesLivedInner) o; + return Objects.equals(this.name, profileRequestModelPlacesLivedInner.name) && + Objects.equals(this.operation, profileRequestModelPlacesLivedInner.operation) && + Objects.equals(this.isPrimary, profileRequestModelPlacesLivedInner.isPrimary)&& + Objects.equals(this.additionalProperties, profileRequestModelPlacesLivedInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, operation, isPrimary, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelPlacesLivedInner {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" operation: ").append(toIndentedString(operation)).append("\n"); + sb.append(" isPrimary: ").append(toIndentedString(isPrimary)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + openapiFields.add("Operation"); + openapiFields.add("IsPrimary"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelPlacesLivedInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelPlacesLivedInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelPlacesLivedInner is not found in the empty JSON string", ProfileRequestModelPlacesLivedInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Operation") != null && !jsonObj.get("Operation").isJsonNull()) && !jsonObj.get("Operation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Operation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Operation").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelPlacesLivedInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelPlacesLivedInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelPlacesLivedInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelPlacesLivedInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelPlacesLivedInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelPlacesLivedInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelPlacesLivedInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelPlacesLivedInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelPlacesLivedInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelPlacesLivedInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelPlacesLivedInner + */ + public static ProfileRequestModelPlacesLivedInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelPlacesLivedInner.class); + } + + /** + * Convert an instance of ProfileRequestModelPlacesLivedInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelPositionsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelPositionsInner.java new file mode 100644 index 0000000..64ceba5 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelPositionsInner.java @@ -0,0 +1,443 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPositionsInnerCompany; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelPositionsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelPositionsInner { + public static final String SERIALIZED_NAME_POSITION = "Position"; + @SerializedName(SERIALIZED_NAME_POSITION) + @javax.annotation.Nullable + private String position; + + public static final String SERIALIZED_NAME_SUMMARY = "Summary"; + @SerializedName(SERIALIZED_NAME_SUMMARY) + @javax.annotation.Nullable + private String summary; + + public static final String SERIALIZED_NAME_START_DATE = "StartDate"; + @SerializedName(SERIALIZED_NAME_START_DATE) + @javax.annotation.Nullable + private OffsetDateTime startDate; + + public static final String SERIALIZED_NAME_END_DATE = "EndDate"; + @SerializedName(SERIALIZED_NAME_END_DATE) + @javax.annotation.Nullable + private OffsetDateTime endDate; + + public static final String SERIALIZED_NAME_IS_CURRENT = "IsCurrent"; + @SerializedName(SERIALIZED_NAME_IS_CURRENT) + @javax.annotation.Nullable + private Boolean isCurrent; + + public static final String SERIALIZED_NAME_COMPANY = "Company"; + @SerializedName(SERIALIZED_NAME_COMPANY) + @javax.annotation.Nullable + private ProfileRequestModelPositionsInnerCompany company; + + public ProfileRequestModelPositionsInner() { + } + + public ProfileRequestModelPositionsInner position(@javax.annotation.Nullable String position) { + this.position = position; + return this; + } + + /** + * Get position + * @return position + */ + @javax.annotation.Nullable + public String getPosition() { + return position; + } + + public void setPosition(@javax.annotation.Nullable String position) { + this.position = position; + } + + + public ProfileRequestModelPositionsInner summary(@javax.annotation.Nullable String summary) { + this.summary = summary; + return this; + } + + /** + * Get summary + * @return summary + */ + @javax.annotation.Nullable + public String getSummary() { + return summary; + } + + public void setSummary(@javax.annotation.Nullable String summary) { + this.summary = summary; + } + + + public ProfileRequestModelPositionsInner startDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Get startDate + * @return startDate + */ + @javax.annotation.Nullable + public OffsetDateTime getStartDate() { + return startDate; + } + + public void setStartDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + } + + + public ProfileRequestModelPositionsInner endDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * Get endDate + * @return endDate + */ + @javax.annotation.Nullable + public OffsetDateTime getEndDate() { + return endDate; + } + + public void setEndDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + } + + + public ProfileRequestModelPositionsInner isCurrent(@javax.annotation.Nullable Boolean isCurrent) { + this.isCurrent = isCurrent; + return this; + } + + /** + * Get isCurrent + * @return isCurrent + */ + @javax.annotation.Nullable + public Boolean getIsCurrent() { + return isCurrent; + } + + public void setIsCurrent(@javax.annotation.Nullable Boolean isCurrent) { + this.isCurrent = isCurrent; + } + + + public ProfileRequestModelPositionsInner company(@javax.annotation.Nullable ProfileRequestModelPositionsInnerCompany company) { + this.company = company; + return this; + } + + /** + * Get company + * @return company + */ + @javax.annotation.Nullable + public ProfileRequestModelPositionsInnerCompany getCompany() { + return company; + } + + public void setCompany(@javax.annotation.Nullable ProfileRequestModelPositionsInnerCompany company) { + this.company = company; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelPositionsInner instance itself + */ + public ProfileRequestModelPositionsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelPositionsInner profileRequestModelPositionsInner = (ProfileRequestModelPositionsInner) o; + return Objects.equals(this.position, profileRequestModelPositionsInner.position) && + Objects.equals(this.summary, profileRequestModelPositionsInner.summary) && + Objects.equals(this.startDate, profileRequestModelPositionsInner.startDate) && + Objects.equals(this.endDate, profileRequestModelPositionsInner.endDate) && + Objects.equals(this.isCurrent, profileRequestModelPositionsInner.isCurrent) && + Objects.equals(this.company, profileRequestModelPositionsInner.company)&& + Objects.equals(this.additionalProperties, profileRequestModelPositionsInner.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(position, summary, startDate, endDate, isCurrent, company, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelPositionsInner {\n"); + sb.append(" position: ").append(toIndentedString(position)).append("\n"); + sb.append(" summary: ").append(toIndentedString(summary)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" isCurrent: ").append(toIndentedString(isCurrent)).append("\n"); + sb.append(" company: ").append(toIndentedString(company)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Position"); + openapiFields.add("Summary"); + openapiFields.add("StartDate"); + openapiFields.add("EndDate"); + openapiFields.add("IsCurrent"); + openapiFields.add("Company"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelPositionsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelPositionsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelPositionsInner is not found in the empty JSON string", ProfileRequestModelPositionsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Position") != null && !jsonObj.get("Position").isJsonNull()) && !jsonObj.get("Position").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Position` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Position").toString())); + } + if ((jsonObj.get("Summary") != null && !jsonObj.get("Summary").isJsonNull()) && !jsonObj.get("Summary").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Summary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Summary").toString())); + } + // validate the optional field `Company` + if (jsonObj.get("Company") != null && !jsonObj.get("Company").isJsonNull()) { + ProfileRequestModelPositionsInnerCompany.validateJsonElement(jsonObj.get("Company")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelPositionsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelPositionsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelPositionsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelPositionsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelPositionsInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelPositionsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelPositionsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelPositionsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelPositionsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelPositionsInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelPositionsInner + */ + public static ProfileRequestModelPositionsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelPositionsInner.class); + } + + /** + * Convert an instance of ProfileRequestModelPositionsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelPositionsInnerCompany.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelPositionsInnerCompany.java new file mode 100644 index 0000000..fa50002 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelPositionsInnerCompany.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelPositionsInnerCompany + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelPositionsInnerCompany { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_TYPE = "Type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_INDUSTRY = "Industry"; + @SerializedName(SERIALIZED_NAME_INDUSTRY) + @javax.annotation.Nullable + private String industry; + + public ProfileRequestModelPositionsInnerCompany() { + } + + public ProfileRequestModelPositionsInnerCompany name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileRequestModelPositionsInnerCompany type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public ProfileRequestModelPositionsInnerCompany industry(@javax.annotation.Nullable String industry) { + this.industry = industry; + return this; + } + + /** + * Get industry + * @return industry + */ + @javax.annotation.Nullable + public String getIndustry() { + return industry; + } + + public void setIndustry(@javax.annotation.Nullable String industry) { + this.industry = industry; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelPositionsInnerCompany instance itself + */ + public ProfileRequestModelPositionsInnerCompany putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelPositionsInnerCompany profileRequestModelPositionsInnerCompany = (ProfileRequestModelPositionsInnerCompany) o; + return Objects.equals(this.name, profileRequestModelPositionsInnerCompany.name) && + Objects.equals(this.type, profileRequestModelPositionsInnerCompany.type) && + Objects.equals(this.industry, profileRequestModelPositionsInnerCompany.industry)&& + Objects.equals(this.additionalProperties, profileRequestModelPositionsInnerCompany.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, type, industry, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelPositionsInnerCompany {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" industry: ").append(toIndentedString(industry)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + openapiFields.add("Type"); + openapiFields.add("Industry"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelPositionsInnerCompany + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelPositionsInnerCompany.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelPositionsInnerCompany is not found in the empty JSON string", ProfileRequestModelPositionsInnerCompany.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Type") != null && !jsonObj.get("Type").isJsonNull()) && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + if ((jsonObj.get("Industry") != null && !jsonObj.get("Industry").isJsonNull()) && !jsonObj.get("Industry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Industry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Industry").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelPositionsInnerCompany.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelPositionsInnerCompany' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelPositionsInnerCompany> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelPositionsInnerCompany.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelPositionsInnerCompany>() { + @Override + public void write(JsonWriter out, ProfileRequestModelPositionsInnerCompany value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelPositionsInnerCompany read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelPositionsInnerCompany instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelPositionsInnerCompany given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelPositionsInnerCompany + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelPositionsInnerCompany + */ + public static ProfileRequestModelPositionsInnerCompany fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelPositionsInnerCompany.class); + } + + /** + * Convert an instance of ProfileRequestModelPositionsInnerCompany to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelPrivacyPolicy.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelPrivacyPolicy.java new file mode 100644 index 0000000..ecb2529 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelPrivacyPolicy.java @@ -0,0 +1,287 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelPrivacyPolicy + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelPrivacyPolicy { + public static final String SERIALIZED_NAME_VERSION = "Version"; + @SerializedName(SERIALIZED_NAME_VERSION) + @javax.annotation.Nullable + private String version; + + public ProfileRequestModelPrivacyPolicy() { + } + + public ProfileRequestModelPrivacyPolicy version(@javax.annotation.Nullable String version) { + this.version = version; + return this; + } + + /** + * Get version + * @return version + */ + @javax.annotation.Nullable + public String getVersion() { + return version; + } + + public void setVersion(@javax.annotation.Nullable String version) { + this.version = version; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelPrivacyPolicy instance itself + */ + public ProfileRequestModelPrivacyPolicy putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelPrivacyPolicy profileRequestModelPrivacyPolicy = (ProfileRequestModelPrivacyPolicy) o; + return Objects.equals(this.version, profileRequestModelPrivacyPolicy.version)&& + Objects.equals(this.additionalProperties, profileRequestModelPrivacyPolicy.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(version, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelPrivacyPolicy {\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Version"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelPrivacyPolicy + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelPrivacyPolicy.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelPrivacyPolicy is not found in the empty JSON string", ProfileRequestModelPrivacyPolicy.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Version") != null && !jsonObj.get("Version").isJsonNull()) && !jsonObj.get("Version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Version").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelPrivacyPolicy.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelPrivacyPolicy' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelPrivacyPolicy> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelPrivacyPolicy.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelPrivacyPolicy>() { + @Override + public void write(JsonWriter out, ProfileRequestModelPrivacyPolicy value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelPrivacyPolicy read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelPrivacyPolicy instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelPrivacyPolicy given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelPrivacyPolicy + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelPrivacyPolicy + */ + public static ProfileRequestModelPrivacyPolicy fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelPrivacyPolicy.class); + } + + /** + * Convert an instance of ProfileRequestModelPrivacyPolicy to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelProjectsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelProjectsInner.java new file mode 100644 index 0000000..ff12833 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelProjectsInner.java @@ -0,0 +1,484 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProfileRequestModelProjectsInnerWithInner; +import java.io.IOException; +import java.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelProjectsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelProjectsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_SUMMARY = "Summary"; + @SerializedName(SERIALIZED_NAME_SUMMARY) + @javax.annotation.Nullable + private String summary; + + public static final String SERIALIZED_NAME_START_DATE = "StartDate"; + @SerializedName(SERIALIZED_NAME_START_DATE) + @javax.annotation.Nullable + private OffsetDateTime startDate; + + public static final String SERIALIZED_NAME_END_DATE = "EndDate"; + @SerializedName(SERIALIZED_NAME_END_DATE) + @javax.annotation.Nullable + private OffsetDateTime endDate; + + public static final String SERIALIZED_NAME_IS_CURRENT = "IsCurrent"; + @SerializedName(SERIALIZED_NAME_IS_CURRENT) + @javax.annotation.Nullable + private String isCurrent; + + public static final String SERIALIZED_NAME_WITH = "With"; + @SerializedName(SERIALIZED_NAME_WITH) + @javax.annotation.Nullable + private List<ProfileRequestModelProjectsInnerWithInner> with = new ArrayList<>(); + + public ProfileRequestModelProjectsInner() { + } + + public ProfileRequestModelProjectsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileRequestModelProjectsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileRequestModelProjectsInner summary(@javax.annotation.Nullable String summary) { + this.summary = summary; + return this; + } + + /** + * Get summary + * @return summary + */ + @javax.annotation.Nullable + public String getSummary() { + return summary; + } + + public void setSummary(@javax.annotation.Nullable String summary) { + this.summary = summary; + } + + + public ProfileRequestModelProjectsInner startDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Get startDate + * @return startDate + */ + @javax.annotation.Nullable + public OffsetDateTime getStartDate() { + return startDate; + } + + public void setStartDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + } + + + public ProfileRequestModelProjectsInner endDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * Get endDate + * @return endDate + */ + @javax.annotation.Nullable + public OffsetDateTime getEndDate() { + return endDate; + } + + public void setEndDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + } + + + public ProfileRequestModelProjectsInner isCurrent(@javax.annotation.Nullable String isCurrent) { + this.isCurrent = isCurrent; + return this; + } + + /** + * Get isCurrent + * @return isCurrent + */ + @javax.annotation.Nullable + public String getIsCurrent() { + return isCurrent; + } + + public void setIsCurrent(@javax.annotation.Nullable String isCurrent) { + this.isCurrent = isCurrent; + } + + + public ProfileRequestModelProjectsInner with(@javax.annotation.Nullable List<ProfileRequestModelProjectsInnerWithInner> with) { + this.with = with; + return this; + } + + public ProfileRequestModelProjectsInner addWithItem(ProfileRequestModelProjectsInnerWithInner withItem) { + if (this.with == null) { + this.with = new ArrayList<>(); + } + this.with.add(withItem); + return this; + } + + /** + * Get with + * @return with + */ + @javax.annotation.Nullable + public List<ProfileRequestModelProjectsInnerWithInner> getWith() { + return with; + } + + public void setWith(@javax.annotation.Nullable List<ProfileRequestModelProjectsInnerWithInner> with) { + this.with = with; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelProjectsInner instance itself + */ + public ProfileRequestModelProjectsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelProjectsInner profileRequestModelProjectsInner = (ProfileRequestModelProjectsInner) o; + return Objects.equals(this.id, profileRequestModelProjectsInner.id) && + Objects.equals(this.name, profileRequestModelProjectsInner.name) && + Objects.equals(this.summary, profileRequestModelProjectsInner.summary) && + Objects.equals(this.startDate, profileRequestModelProjectsInner.startDate) && + Objects.equals(this.endDate, profileRequestModelProjectsInner.endDate) && + Objects.equals(this.isCurrent, profileRequestModelProjectsInner.isCurrent) && + Objects.equals(this.with, profileRequestModelProjectsInner.with)&& + Objects.equals(this.additionalProperties, profileRequestModelProjectsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, summary, startDate, endDate, isCurrent, with, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelProjectsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" summary: ").append(toIndentedString(summary)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" isCurrent: ").append(toIndentedString(isCurrent)).append("\n"); + sb.append(" with: ").append(toIndentedString(with)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Summary"); + openapiFields.add("StartDate"); + openapiFields.add("EndDate"); + openapiFields.add("IsCurrent"); + openapiFields.add("With"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelProjectsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelProjectsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelProjectsInner is not found in the empty JSON string", ProfileRequestModelProjectsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Summary") != null && !jsonObj.get("Summary").isJsonNull()) && !jsonObj.get("Summary").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Summary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Summary").toString())); + } + if ((jsonObj.get("IsCurrent") != null && !jsonObj.get("IsCurrent").isJsonNull()) && !jsonObj.get("IsCurrent").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IsCurrent` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IsCurrent").toString())); + } + if (jsonObj.get("With") != null && !jsonObj.get("With").isJsonNull()) { + JsonArray jsonArraywith = jsonObj.getAsJsonArray("With"); + if (jsonArraywith != null) { + // ensure the json data is an array + if (!jsonObj.get("With").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `With` to be an array in the JSON string but got `%s`", jsonObj.get("With").toString())); + } + + // validate the optional field `With` (array) + for (int i = 0; i < jsonArraywith.size(); i++) { + ProfileRequestModelProjectsInnerWithInner.validateJsonElement(jsonArraywith.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelProjectsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelProjectsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelProjectsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelProjectsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelProjectsInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelProjectsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelProjectsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelProjectsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelProjectsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelProjectsInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelProjectsInner + */ + public static ProfileRequestModelProjectsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelProjectsInner.class); + } + + /** + * Convert an instance of ProfileRequestModelProjectsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelProjectsInnerWithInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelProjectsInnerWithInner.java new file mode 100644 index 0000000..bbf00e0 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelProjectsInnerWithInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelProjectsInnerWithInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelProjectsInnerWithInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ProfileRequestModelProjectsInnerWithInner() { + } + + public ProfileRequestModelProjectsInnerWithInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileRequestModelProjectsInnerWithInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelProjectsInnerWithInner instance itself + */ + public ProfileRequestModelProjectsInnerWithInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelProjectsInnerWithInner profileRequestModelProjectsInnerWithInner = (ProfileRequestModelProjectsInnerWithInner) o; + return Objects.equals(this.id, profileRequestModelProjectsInnerWithInner.id) && + Objects.equals(this.name, profileRequestModelProjectsInnerWithInner.name)&& + Objects.equals(this.additionalProperties, profileRequestModelProjectsInnerWithInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelProjectsInnerWithInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelProjectsInnerWithInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelProjectsInnerWithInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelProjectsInnerWithInner is not found in the empty JSON string", ProfileRequestModelProjectsInnerWithInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelProjectsInnerWithInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelProjectsInnerWithInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelProjectsInnerWithInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelProjectsInnerWithInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelProjectsInnerWithInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelProjectsInnerWithInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelProjectsInnerWithInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelProjectsInnerWithInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelProjectsInnerWithInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelProjectsInnerWithInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelProjectsInnerWithInner + */ + public static ProfileRequestModelProjectsInnerWithInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelProjectsInnerWithInner.class); + } + + /** + * Convert an instance of ProfileRequestModelProjectsInnerWithInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelProviderAccessCredential.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelProviderAccessCredential.java new file mode 100644 index 0000000..e37e5cd --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelProviderAccessCredential.java @@ -0,0 +1,344 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelProviderAccessCredential + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelProviderAccessCredential { + public static final String SERIALIZED_NAME_ACCESS_TOKEN = "AccessToken"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN) + @javax.annotation.Nullable + private String accessToken; + + public static final String SERIALIZED_NAME_REFRESH_TOKEN = "RefreshToken"; + @SerializedName(SERIALIZED_NAME_REFRESH_TOKEN) + @javax.annotation.Nullable + private String refreshToken; + + public static final String SERIALIZED_NAME_EXPIRES_IN = "ExpiresIn"; + @SerializedName(SERIALIZED_NAME_EXPIRES_IN) + @javax.annotation.Nullable + private Integer expiresIn; + + public ProfileRequestModelProviderAccessCredential() { + } + + public ProfileRequestModelProviderAccessCredential accessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Get accessToken + * @return accessToken + */ + @javax.annotation.Nullable + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + } + + + public ProfileRequestModelProviderAccessCredential refreshToken(@javax.annotation.Nullable String refreshToken) { + this.refreshToken = refreshToken; + return this; + } + + /** + * Get refreshToken + * @return refreshToken + */ + @javax.annotation.Nullable + public String getRefreshToken() { + return refreshToken; + } + + public void setRefreshToken(@javax.annotation.Nullable String refreshToken) { + this.refreshToken = refreshToken; + } + + + public ProfileRequestModelProviderAccessCredential expiresIn(@javax.annotation.Nullable Integer expiresIn) { + this.expiresIn = expiresIn; + return this; + } + + /** + * Get expiresIn + * @return expiresIn + */ + @javax.annotation.Nullable + public Integer getExpiresIn() { + return expiresIn; + } + + public void setExpiresIn(@javax.annotation.Nullable Integer expiresIn) { + this.expiresIn = expiresIn; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelProviderAccessCredential instance itself + */ + public ProfileRequestModelProviderAccessCredential putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelProviderAccessCredential profileRequestModelProviderAccessCredential = (ProfileRequestModelProviderAccessCredential) o; + return Objects.equals(this.accessToken, profileRequestModelProviderAccessCredential.accessToken) && + Objects.equals(this.refreshToken, profileRequestModelProviderAccessCredential.refreshToken) && + Objects.equals(this.expiresIn, profileRequestModelProviderAccessCredential.expiresIn)&& + Objects.equals(this.additionalProperties, profileRequestModelProviderAccessCredential.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accessToken, refreshToken, expiresIn, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelProviderAccessCredential {\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" refreshToken: ").append(toIndentedString(refreshToken)).append("\n"); + sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AccessToken"); + openapiFields.add("RefreshToken"); + openapiFields.add("ExpiresIn"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelProviderAccessCredential + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelProviderAccessCredential.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelProviderAccessCredential is not found in the empty JSON string", ProfileRequestModelProviderAccessCredential.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("AccessToken") != null && !jsonObj.get("AccessToken").isJsonNull()) && !jsonObj.get("AccessToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccessToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccessToken").toString())); + } + if ((jsonObj.get("RefreshToken") != null && !jsonObj.get("RefreshToken").isJsonNull()) && !jsonObj.get("RefreshToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RefreshToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RefreshToken").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelProviderAccessCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelProviderAccessCredential' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelProviderAccessCredential> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelProviderAccessCredential.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelProviderAccessCredential>() { + @Override + public void write(JsonWriter out, ProfileRequestModelProviderAccessCredential value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelProviderAccessCredential read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelProviderAccessCredential instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelProviderAccessCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelProviderAccessCredential + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelProviderAccessCredential + */ + public static ProfileRequestModelProviderAccessCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelProviderAccessCredential.class); + } + + /** + * Convert an instance of ProfileRequestModelProviderAccessCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelPublicationsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelPublicationsInner.java new file mode 100644 index 0000000..206a244 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelPublicationsInner.java @@ -0,0 +1,487 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPublicationsInnerAuthorsInner; +import java.io.IOException; +import java.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelPublicationsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelPublicationsInner { + public static final String SERIALIZED_NAME_TITLE = "Title"; + @SerializedName(SERIALIZED_NAME_TITLE) + @javax.annotation.Nullable + private String title; + + public static final String SERIALIZED_NAME_PUBLISHER = "Publisher"; + @SerializedName(SERIALIZED_NAME_PUBLISHER) + @javax.annotation.Nullable + private String publisher; + + public static final String SERIALIZED_NAME_DATE = "Date"; + @SerializedName(SERIALIZED_NAME_DATE) + @javax.annotation.Nullable + private OffsetDateTime date; + + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_URL = "Url"; + @SerializedName(SERIALIZED_NAME_URL) + @javax.annotation.Nullable + private String url; + + public static final String SERIALIZED_NAME_SUMMARY = "Summary"; + @SerializedName(SERIALIZED_NAME_SUMMARY) + @javax.annotation.Nullable + private String summary; + + public static final String SERIALIZED_NAME_AUTHORS = "Authors"; + @SerializedName(SERIALIZED_NAME_AUTHORS) + @javax.annotation.Nullable + private List<ProfileRequestModelPublicationsInnerAuthorsInner> authors = new ArrayList<>(); + + public ProfileRequestModelPublicationsInner() { + } + + public ProfileRequestModelPublicationsInner title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * Get title + * @return title + */ + @javax.annotation.Nullable + public String getTitle() { + return title; + } + + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + public ProfileRequestModelPublicationsInner publisher(@javax.annotation.Nullable String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get publisher + * @return publisher + */ + @javax.annotation.Nullable + public String getPublisher() { + return publisher; + } + + public void setPublisher(@javax.annotation.Nullable String publisher) { + this.publisher = publisher; + } + + + public ProfileRequestModelPublicationsInner date(@javax.annotation.Nullable OffsetDateTime date) { + this.date = date; + return this; + } + + /** + * Get date + * @return date + */ + @javax.annotation.Nullable + public OffsetDateTime getDate() { + return date; + } + + public void setDate(@javax.annotation.Nullable OffsetDateTime date) { + this.date = date; + } + + + public ProfileRequestModelPublicationsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileRequestModelPublicationsInner url(@javax.annotation.Nullable String url) { + this.url = url; + return this; + } + + /** + * Get url + * @return url + */ + @javax.annotation.Nullable + public String getUrl() { + return url; + } + + public void setUrl(@javax.annotation.Nullable String url) { + this.url = url; + } + + + public ProfileRequestModelPublicationsInner summary(@javax.annotation.Nullable String summary) { + this.summary = summary; + return this; + } + + /** + * Get summary + * @return summary + */ + @javax.annotation.Nullable + public String getSummary() { + return summary; + } + + public void setSummary(@javax.annotation.Nullable String summary) { + this.summary = summary; + } + + + public ProfileRequestModelPublicationsInner authors(@javax.annotation.Nullable List<ProfileRequestModelPublicationsInnerAuthorsInner> authors) { + this.authors = authors; + return this; + } + + public ProfileRequestModelPublicationsInner addAuthorsItem(ProfileRequestModelPublicationsInnerAuthorsInner authorsItem) { + if (this.authors == null) { + this.authors = new ArrayList<>(); + } + this.authors.add(authorsItem); + return this; + } + + /** + * Get authors + * @return authors + */ + @javax.annotation.Nullable + public List<ProfileRequestModelPublicationsInnerAuthorsInner> getAuthors() { + return authors; + } + + public void setAuthors(@javax.annotation.Nullable List<ProfileRequestModelPublicationsInnerAuthorsInner> authors) { + this.authors = authors; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelPublicationsInner instance itself + */ + public ProfileRequestModelPublicationsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelPublicationsInner profileRequestModelPublicationsInner = (ProfileRequestModelPublicationsInner) o; + return Objects.equals(this.title, profileRequestModelPublicationsInner.title) && + Objects.equals(this.publisher, profileRequestModelPublicationsInner.publisher) && + Objects.equals(this.date, profileRequestModelPublicationsInner.date) && + Objects.equals(this.id, profileRequestModelPublicationsInner.id) && + Objects.equals(this.url, profileRequestModelPublicationsInner.url) && + Objects.equals(this.summary, profileRequestModelPublicationsInner.summary) && + Objects.equals(this.authors, profileRequestModelPublicationsInner.authors)&& + Objects.equals(this.additionalProperties, profileRequestModelPublicationsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(title, publisher, date, id, url, summary, authors, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelPublicationsInner {\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" publisher: ").append(toIndentedString(publisher)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" summary: ").append(toIndentedString(summary)).append("\n"); + sb.append(" authors: ").append(toIndentedString(authors)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Title"); + openapiFields.add("Publisher"); + openapiFields.add("Date"); + openapiFields.add("Id"); + openapiFields.add("Url"); + openapiFields.add("Summary"); + openapiFields.add("Authors"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelPublicationsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelPublicationsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelPublicationsInner is not found in the empty JSON string", ProfileRequestModelPublicationsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Title") != null && !jsonObj.get("Title").isJsonNull()) && !jsonObj.get("Title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Title").toString())); + } + if ((jsonObj.get("Publisher") != null && !jsonObj.get("Publisher").isJsonNull()) && !jsonObj.get("Publisher").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Publisher` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Publisher").toString())); + } + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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") != null && !jsonObj.get("Url").isJsonNull()) && !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())); + } + if ((jsonObj.get("Summary") != null && !jsonObj.get("Summary").isJsonNull()) && !jsonObj.get("Summary").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Summary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Summary").toString())); + } + if (jsonObj.get("Authors") != null && !jsonObj.get("Authors").isJsonNull()) { + JsonArray jsonArrayauthors = jsonObj.getAsJsonArray("Authors"); + if (jsonArrayauthors != null) { + // ensure the json data is an array + if (!jsonObj.get("Authors").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Authors` to be an array in the JSON string but got `%s`", jsonObj.get("Authors").toString())); + } + + // validate the optional field `Authors` (array) + for (int i = 0; i < jsonArrayauthors.size(); i++) { + ProfileRequestModelPublicationsInnerAuthorsInner.validateJsonElement(jsonArrayauthors.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelPublicationsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelPublicationsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelPublicationsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelPublicationsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelPublicationsInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelPublicationsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelPublicationsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelPublicationsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelPublicationsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelPublicationsInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelPublicationsInner + */ + public static ProfileRequestModelPublicationsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelPublicationsInner.class); + } + + /** + * Convert an instance of ProfileRequestModelPublicationsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelPublicationsInnerAuthorsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelPublicationsInnerAuthorsInner.java new file mode 100644 index 0000000..52e623e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelPublicationsInnerAuthorsInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelPublicationsInnerAuthorsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelPublicationsInnerAuthorsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ProfileRequestModelPublicationsInnerAuthorsInner() { + } + + public ProfileRequestModelPublicationsInnerAuthorsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileRequestModelPublicationsInnerAuthorsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelPublicationsInnerAuthorsInner instance itself + */ + public ProfileRequestModelPublicationsInnerAuthorsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelPublicationsInnerAuthorsInner profileRequestModelPublicationsInnerAuthorsInner = (ProfileRequestModelPublicationsInnerAuthorsInner) o; + return Objects.equals(this.id, profileRequestModelPublicationsInnerAuthorsInner.id) && + Objects.equals(this.name, profileRequestModelPublicationsInnerAuthorsInner.name)&& + Objects.equals(this.additionalProperties, profileRequestModelPublicationsInnerAuthorsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelPublicationsInnerAuthorsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelPublicationsInnerAuthorsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelPublicationsInnerAuthorsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelPublicationsInnerAuthorsInner is not found in the empty JSON string", ProfileRequestModelPublicationsInnerAuthorsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelPublicationsInnerAuthorsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelPublicationsInnerAuthorsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelPublicationsInnerAuthorsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelPublicationsInnerAuthorsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelPublicationsInnerAuthorsInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelPublicationsInnerAuthorsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelPublicationsInnerAuthorsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelPublicationsInnerAuthorsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelPublicationsInnerAuthorsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelPublicationsInnerAuthorsInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelPublicationsInnerAuthorsInner + */ + public static ProfileRequestModelPublicationsInnerAuthorsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelPublicationsInnerAuthorsInner.class); + } + + /** + * Convert an instance of ProfileRequestModelPublicationsInnerAuthorsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelRecommendationsReceivedInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelRecommendationsReceivedInner.java new file mode 100644 index 0000000..c1ea86e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelRecommendationsReceivedInner.java @@ -0,0 +1,377 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelRecommendationsReceivedInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelRecommendationsReceivedInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_RECOMMENDER = "Recommender"; + @SerializedName(SERIALIZED_NAME_RECOMMENDER) + @javax.annotation.Nullable + private String recommender; + + public static final String SERIALIZED_NAME_RECOMMENDATION_TEXT = "RecommendationText"; + @SerializedName(SERIALIZED_NAME_RECOMMENDATION_TEXT) + @javax.annotation.Nullable + private String recommendationText; + + public static final String SERIALIZED_NAME_RECOMMENDATION_TYPE = "RecommendationType"; + @SerializedName(SERIALIZED_NAME_RECOMMENDATION_TYPE) + @javax.annotation.Nullable + private String recommendationType; + + public ProfileRequestModelRecommendationsReceivedInner() { + } + + public ProfileRequestModelRecommendationsReceivedInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileRequestModelRecommendationsReceivedInner recommender(@javax.annotation.Nullable String recommender) { + this.recommender = recommender; + return this; + } + + /** + * Get recommender + * @return recommender + */ + @javax.annotation.Nullable + public String getRecommender() { + return recommender; + } + + public void setRecommender(@javax.annotation.Nullable String recommender) { + this.recommender = recommender; + } + + + public ProfileRequestModelRecommendationsReceivedInner recommendationText(@javax.annotation.Nullable String recommendationText) { + this.recommendationText = recommendationText; + return this; + } + + /** + * Get recommendationText + * @return recommendationText + */ + @javax.annotation.Nullable + public String getRecommendationText() { + return recommendationText; + } + + public void setRecommendationText(@javax.annotation.Nullable String recommendationText) { + this.recommendationText = recommendationText; + } + + + public ProfileRequestModelRecommendationsReceivedInner recommendationType(@javax.annotation.Nullable String recommendationType) { + this.recommendationType = recommendationType; + return this; + } + + /** + * Get recommendationType + * @return recommendationType + */ + @javax.annotation.Nullable + public String getRecommendationType() { + return recommendationType; + } + + public void setRecommendationType(@javax.annotation.Nullable String recommendationType) { + this.recommendationType = recommendationType; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelRecommendationsReceivedInner instance itself + */ + public ProfileRequestModelRecommendationsReceivedInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelRecommendationsReceivedInner profileRequestModelRecommendationsReceivedInner = (ProfileRequestModelRecommendationsReceivedInner) o; + return Objects.equals(this.id, profileRequestModelRecommendationsReceivedInner.id) && + Objects.equals(this.recommender, profileRequestModelRecommendationsReceivedInner.recommender) && + Objects.equals(this.recommendationText, profileRequestModelRecommendationsReceivedInner.recommendationText) && + Objects.equals(this.recommendationType, profileRequestModelRecommendationsReceivedInner.recommendationType)&& + Objects.equals(this.additionalProperties, profileRequestModelRecommendationsReceivedInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, recommender, recommendationText, recommendationType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelRecommendationsReceivedInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" recommender: ").append(toIndentedString(recommender)).append("\n"); + sb.append(" recommendationText: ").append(toIndentedString(recommendationText)).append("\n"); + sb.append(" recommendationType: ").append(toIndentedString(recommendationType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Recommender"); + openapiFields.add("RecommendationText"); + openapiFields.add("RecommendationType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelRecommendationsReceivedInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelRecommendationsReceivedInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelRecommendationsReceivedInner is not found in the empty JSON string", ProfileRequestModelRecommendationsReceivedInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Recommender") != null && !jsonObj.get("Recommender").isJsonNull()) && !jsonObj.get("Recommender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Recommender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Recommender").toString())); + } + if ((jsonObj.get("RecommendationText") != null && !jsonObj.get("RecommendationText").isJsonNull()) && !jsonObj.get("RecommendationText").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RecommendationText` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RecommendationText").toString())); + } + if ((jsonObj.get("RecommendationType") != null && !jsonObj.get("RecommendationType").isJsonNull()) && !jsonObj.get("RecommendationType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RecommendationType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RecommendationType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelRecommendationsReceivedInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelRecommendationsReceivedInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelRecommendationsReceivedInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelRecommendationsReceivedInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelRecommendationsReceivedInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelRecommendationsReceivedInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelRecommendationsReceivedInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelRecommendationsReceivedInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelRecommendationsReceivedInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelRecommendationsReceivedInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelRecommendationsReceivedInner + */ + public static ProfileRequestModelRecommendationsReceivedInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelRecommendationsReceivedInner.class); + } + + /** + * Convert an instance of ProfileRequestModelRecommendationsReceivedInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelRelatedProfileViewsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelRelatedProfileViewsInner.java new file mode 100644 index 0000000..b5bebf1 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelRelatedProfileViewsInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelRelatedProfileViewsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelRelatedProfileViewsInner { + public static final String SERIALIZED_NAME_FIRST_NAME = "FirstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nullable + private String firstName; + + public static final String SERIALIZED_NAME_LAST_NAME = "LastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nullable + private String lastName; + + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public ProfileRequestModelRelatedProfileViewsInner() { + } + + public ProfileRequestModelRelatedProfileViewsInner firstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + */ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + } + + + public ProfileRequestModelRelatedProfileViewsInner lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + + public ProfileRequestModelRelatedProfileViewsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelRelatedProfileViewsInner instance itself + */ + public ProfileRequestModelRelatedProfileViewsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelRelatedProfileViewsInner profileRequestModelRelatedProfileViewsInner = (ProfileRequestModelRelatedProfileViewsInner) o; + return Objects.equals(this.firstName, profileRequestModelRelatedProfileViewsInner.firstName) && + Objects.equals(this.lastName, profileRequestModelRelatedProfileViewsInner.lastName) && + Objects.equals(this.id, profileRequestModelRelatedProfileViewsInner.id)&& + Objects.equals(this.additionalProperties, profileRequestModelRelatedProfileViewsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(firstName, lastName, id, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelRelatedProfileViewsInner {\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("FirstName"); + openapiFields.add("LastName"); + openapiFields.add("Id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelRelatedProfileViewsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelRelatedProfileViewsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelRelatedProfileViewsInner is not found in the empty JSON string", ProfileRequestModelRelatedProfileViewsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("FirstName") != null && !jsonObj.get("FirstName").isJsonNull()) && !jsonObj.get("FirstName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FirstName").toString())); + } + if ((jsonObj.get("LastName") != null && !jsonObj.get("LastName").isJsonNull()) && !jsonObj.get("LastName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastName").toString())); + } + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelRelatedProfileViewsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelRelatedProfileViewsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelRelatedProfileViewsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelRelatedProfileViewsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelRelatedProfileViewsInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelRelatedProfileViewsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelRelatedProfileViewsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelRelatedProfileViewsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelRelatedProfileViewsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelRelatedProfileViewsInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelRelatedProfileViewsInner + */ + public static ProfileRequestModelRelatedProfileViewsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelRelatedProfileViewsInner.class); + } + + /** + * Convert an instance of ProfileRequestModelRelatedProfileViewsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelSkillsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelSkillsInner.java new file mode 100644 index 0000000..9586dfb --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelSkillsInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelSkillsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelSkillsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ProfileRequestModelSkillsInner() { + } + + public ProfileRequestModelSkillsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileRequestModelSkillsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelSkillsInner instance itself + */ + public ProfileRequestModelSkillsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelSkillsInner profileRequestModelSkillsInner = (ProfileRequestModelSkillsInner) o; + return Objects.equals(this.id, profileRequestModelSkillsInner.id) && + Objects.equals(this.name, profileRequestModelSkillsInner.name)&& + Objects.equals(this.additionalProperties, profileRequestModelSkillsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelSkillsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelSkillsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelSkillsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelSkillsInner is not found in the empty JSON string", ProfileRequestModelSkillsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelSkillsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelSkillsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelSkillsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelSkillsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelSkillsInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelSkillsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelSkillsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelSkillsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelSkillsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelSkillsInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelSkillsInner + */ + public static ProfileRequestModelSkillsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelSkillsInner.class); + } + + /** + * Convert an instance of ProfileRequestModelSkillsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelSportsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelSportsInner.java new file mode 100644 index 0000000..364f709 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelSportsInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelSportsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelSportsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ProfileRequestModelSportsInner() { + } + + public ProfileRequestModelSportsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileRequestModelSportsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelSportsInner instance itself + */ + public ProfileRequestModelSportsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelSportsInner profileRequestModelSportsInner = (ProfileRequestModelSportsInner) o; + return Objects.equals(this.id, profileRequestModelSportsInner.id) && + Objects.equals(this.name, profileRequestModelSportsInner.name)&& + Objects.equals(this.additionalProperties, profileRequestModelSportsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelSportsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelSportsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelSportsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelSportsInner is not found in the empty JSON string", ProfileRequestModelSportsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelSportsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelSportsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelSportsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelSportsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelSportsInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelSportsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelSportsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelSportsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelSportsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelSportsInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelSportsInner + */ + public static ProfileRequestModelSportsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelSportsInner.class); + } + + /** + * Convert an instance of ProfileRequestModelSportsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelSubscription.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelSubscription.java new file mode 100644 index 0000000..6ae9377 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelSubscription.java @@ -0,0 +1,409 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSubscriptionAgeRange; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelSubscription + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelSubscription { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_SPACE = "Space"; + @SerializedName(SERIALIZED_NAME_SPACE) + @javax.annotation.Nullable + private String space; + + public static final String SERIALIZED_NAME_PRIVATE_REPOS = "PrivateRepos"; + @SerializedName(SERIALIZED_NAME_PRIVATE_REPOS) + @javax.annotation.Nullable + private String privateRepos; + + public static final String SERIALIZED_NAME_COLLABORATORS = "Collaborators"; + @SerializedName(SERIALIZED_NAME_COLLABORATORS) + @javax.annotation.Nullable + private String collaborators; + + public static final String SERIALIZED_NAME_AGE_RANGE = "AgeRange"; + @SerializedName(SERIALIZED_NAME_AGE_RANGE) + @javax.annotation.Nullable + private ProfileRequestModelSubscriptionAgeRange ageRange; + + public ProfileRequestModelSubscription() { + } + + public ProfileRequestModelSubscription name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileRequestModelSubscription space(@javax.annotation.Nullable String space) { + this.space = space; + return this; + } + + /** + * Get space + * @return space + */ + @javax.annotation.Nullable + public String getSpace() { + return space; + } + + public void setSpace(@javax.annotation.Nullable String space) { + this.space = space; + } + + + public ProfileRequestModelSubscription privateRepos(@javax.annotation.Nullable String privateRepos) { + this.privateRepos = privateRepos; + return this; + } + + /** + * Get privateRepos + * @return privateRepos + */ + @javax.annotation.Nullable + public String getPrivateRepos() { + return privateRepos; + } + + public void setPrivateRepos(@javax.annotation.Nullable String privateRepos) { + this.privateRepos = privateRepos; + } + + + public ProfileRequestModelSubscription collaborators(@javax.annotation.Nullable String collaborators) { + this.collaborators = collaborators; + return this; + } + + /** + * Get collaborators + * @return collaborators + */ + @javax.annotation.Nullable + public String getCollaborators() { + return collaborators; + } + + public void setCollaborators(@javax.annotation.Nullable String collaborators) { + this.collaborators = collaborators; + } + + + public ProfileRequestModelSubscription ageRange(@javax.annotation.Nullable ProfileRequestModelSubscriptionAgeRange ageRange) { + this.ageRange = ageRange; + return this; + } + + /** + * Get ageRange + * @return ageRange + */ + @javax.annotation.Nullable + public ProfileRequestModelSubscriptionAgeRange getAgeRange() { + return ageRange; + } + + public void setAgeRange(@javax.annotation.Nullable ProfileRequestModelSubscriptionAgeRange ageRange) { + this.ageRange = ageRange; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelSubscription instance itself + */ + public ProfileRequestModelSubscription putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelSubscription profileRequestModelSubscription = (ProfileRequestModelSubscription) o; + return Objects.equals(this.name, profileRequestModelSubscription.name) && + Objects.equals(this.space, profileRequestModelSubscription.space) && + Objects.equals(this.privateRepos, profileRequestModelSubscription.privateRepos) && + Objects.equals(this.collaborators, profileRequestModelSubscription.collaborators) && + Objects.equals(this.ageRange, profileRequestModelSubscription.ageRange)&& + Objects.equals(this.additionalProperties, profileRequestModelSubscription.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, space, privateRepos, collaborators, ageRange, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelSubscription {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" space: ").append(toIndentedString(space)).append("\n"); + sb.append(" privateRepos: ").append(toIndentedString(privateRepos)).append("\n"); + sb.append(" collaborators: ").append(toIndentedString(collaborators)).append("\n"); + sb.append(" ageRange: ").append(toIndentedString(ageRange)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + openapiFields.add("Space"); + openapiFields.add("PrivateRepos"); + openapiFields.add("Collaborators"); + openapiFields.add("AgeRange"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelSubscription + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelSubscription.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelSubscription is not found in the empty JSON string", ProfileRequestModelSubscription.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Space") != null && !jsonObj.get("Space").isJsonNull()) && !jsonObj.get("Space").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Space` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Space").toString())); + } + if ((jsonObj.get("PrivateRepos") != null && !jsonObj.get("PrivateRepos").isJsonNull()) && !jsonObj.get("PrivateRepos").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PrivateRepos` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PrivateRepos").toString())); + } + if ((jsonObj.get("Collaborators") != null && !jsonObj.get("Collaborators").isJsonNull()) && !jsonObj.get("Collaborators").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Collaborators` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Collaborators").toString())); + } + // validate the optional field `AgeRange` + if (jsonObj.get("AgeRange") != null && !jsonObj.get("AgeRange").isJsonNull()) { + ProfileRequestModelSubscriptionAgeRange.validateJsonElement(jsonObj.get("AgeRange")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelSubscription.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelSubscription' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelSubscription> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelSubscription.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelSubscription>() { + @Override + public void write(JsonWriter out, ProfileRequestModelSubscription value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelSubscription read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelSubscription instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelSubscription given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelSubscription + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelSubscription + */ + public static ProfileRequestModelSubscription fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelSubscription.class); + } + + /** + * Convert an instance of ProfileRequestModelSubscription to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelSubscriptionAgeRange.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelSubscriptionAgeRange.java new file mode 100644 index 0000000..34b9bac --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelSubscriptionAgeRange.java @@ -0,0 +1,311 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelSubscriptionAgeRange + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelSubscriptionAgeRange { + public static final String SERIALIZED_NAME_MIN = "Min"; + @SerializedName(SERIALIZED_NAME_MIN) + @javax.annotation.Nullable + private Integer min; + + public static final String SERIALIZED_NAME_MAX = "Max"; + @SerializedName(SERIALIZED_NAME_MAX) + @javax.annotation.Nullable + private Integer max; + + public ProfileRequestModelSubscriptionAgeRange() { + } + + public ProfileRequestModelSubscriptionAgeRange min(@javax.annotation.Nullable Integer min) { + this.min = min; + return this; + } + + /** + * Get min + * @return min + */ + @javax.annotation.Nullable + public Integer getMin() { + return min; + } + + public void setMin(@javax.annotation.Nullable Integer min) { + this.min = min; + } + + + public ProfileRequestModelSubscriptionAgeRange max(@javax.annotation.Nullable Integer max) { + this.max = max; + return this; + } + + /** + * Get max + * @return max + */ + @javax.annotation.Nullable + public Integer getMax() { + return max; + } + + public void setMax(@javax.annotation.Nullable Integer max) { + this.max = max; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelSubscriptionAgeRange instance itself + */ + public ProfileRequestModelSubscriptionAgeRange putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelSubscriptionAgeRange profileRequestModelSubscriptionAgeRange = (ProfileRequestModelSubscriptionAgeRange) o; + return Objects.equals(this.min, profileRequestModelSubscriptionAgeRange.min) && + Objects.equals(this.max, profileRequestModelSubscriptionAgeRange.max)&& + Objects.equals(this.additionalProperties, profileRequestModelSubscriptionAgeRange.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(min, max, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelSubscriptionAgeRange {\n"); + sb.append(" min: ").append(toIndentedString(min)).append("\n"); + sb.append(" max: ").append(toIndentedString(max)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Min"); + openapiFields.add("Max"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelSubscriptionAgeRange + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelSubscriptionAgeRange.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelSubscriptionAgeRange is not found in the empty JSON string", ProfileRequestModelSubscriptionAgeRange.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelSubscriptionAgeRange.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelSubscriptionAgeRange' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelSubscriptionAgeRange> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelSubscriptionAgeRange.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelSubscriptionAgeRange>() { + @Override + public void write(JsonWriter out, ProfileRequestModelSubscriptionAgeRange value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelSubscriptionAgeRange read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelSubscriptionAgeRange instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelSubscriptionAgeRange given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelSubscriptionAgeRange + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelSubscriptionAgeRange + */ + public static ProfileRequestModelSubscriptionAgeRange fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelSubscriptionAgeRange.class); + } + + /** + * Convert an instance of ProfileRequestModelSubscriptionAgeRange to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelSuggestions.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelSuggestions.java new file mode 100644 index 0000000..496739d --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelSuggestions.java @@ -0,0 +1,459 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSuggestionsCompaniesToFollowInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSuggestionsIndustriesToFollowInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSuggestionsNewssourceToFollowInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSuggestionsPeopleToFollowInner; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelSuggestions + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelSuggestions { + public static final String SERIALIZED_NAME_COMPANIES_TO_FOLLOW = "CompaniesToFollow"; + @SerializedName(SERIALIZED_NAME_COMPANIES_TO_FOLLOW) + @javax.annotation.Nullable + private List<ProfileRequestModelSuggestionsCompaniesToFollowInner> companiesToFollow = new ArrayList<>(); + + public static final String SERIALIZED_NAME_INDUSTRIES_TO_FOLLOW = "IndustriesToFollow"; + @SerializedName(SERIALIZED_NAME_INDUSTRIES_TO_FOLLOW) + @javax.annotation.Nullable + private List<ProfileRequestModelSuggestionsIndustriesToFollowInner> industriesToFollow = new ArrayList<>(); + + public static final String SERIALIZED_NAME_NEWSSOURCE_TO_FOLLOW = "NewssourceToFollow"; + @SerializedName(SERIALIZED_NAME_NEWSSOURCE_TO_FOLLOW) + @javax.annotation.Nullable + private List<ProfileRequestModelSuggestionsNewssourceToFollowInner> newssourceToFollow = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PEOPLE_TO_FOLLOW = "PeopleToFollow"; + @SerializedName(SERIALIZED_NAME_PEOPLE_TO_FOLLOW) + @javax.annotation.Nullable + private List<ProfileRequestModelSuggestionsPeopleToFollowInner> peopleToFollow = new ArrayList<>(); + + public ProfileRequestModelSuggestions() { + } + + public ProfileRequestModelSuggestions companiesToFollow(@javax.annotation.Nullable List<ProfileRequestModelSuggestionsCompaniesToFollowInner> companiesToFollow) { + this.companiesToFollow = companiesToFollow; + return this; + } + + public ProfileRequestModelSuggestions addCompaniesToFollowItem(ProfileRequestModelSuggestionsCompaniesToFollowInner companiesToFollowItem) { + if (this.companiesToFollow == null) { + this.companiesToFollow = new ArrayList<>(); + } + this.companiesToFollow.add(companiesToFollowItem); + return this; + } + + /** + * Get companiesToFollow + * @return companiesToFollow + */ + @javax.annotation.Nullable + public List<ProfileRequestModelSuggestionsCompaniesToFollowInner> getCompaniesToFollow() { + return companiesToFollow; + } + + public void setCompaniesToFollow(@javax.annotation.Nullable List<ProfileRequestModelSuggestionsCompaniesToFollowInner> companiesToFollow) { + this.companiesToFollow = companiesToFollow; + } + + + public ProfileRequestModelSuggestions industriesToFollow(@javax.annotation.Nullable List<ProfileRequestModelSuggestionsIndustriesToFollowInner> industriesToFollow) { + this.industriesToFollow = industriesToFollow; + return this; + } + + public ProfileRequestModelSuggestions addIndustriesToFollowItem(ProfileRequestModelSuggestionsIndustriesToFollowInner industriesToFollowItem) { + if (this.industriesToFollow == null) { + this.industriesToFollow = new ArrayList<>(); + } + this.industriesToFollow.add(industriesToFollowItem); + return this; + } + + /** + * Get industriesToFollow + * @return industriesToFollow + */ + @javax.annotation.Nullable + public List<ProfileRequestModelSuggestionsIndustriesToFollowInner> getIndustriesToFollow() { + return industriesToFollow; + } + + public void setIndustriesToFollow(@javax.annotation.Nullable List<ProfileRequestModelSuggestionsIndustriesToFollowInner> industriesToFollow) { + this.industriesToFollow = industriesToFollow; + } + + + public ProfileRequestModelSuggestions newssourceToFollow(@javax.annotation.Nullable List<ProfileRequestModelSuggestionsNewssourceToFollowInner> newssourceToFollow) { + this.newssourceToFollow = newssourceToFollow; + return this; + } + + public ProfileRequestModelSuggestions addNewssourceToFollowItem(ProfileRequestModelSuggestionsNewssourceToFollowInner newssourceToFollowItem) { + if (this.newssourceToFollow == null) { + this.newssourceToFollow = new ArrayList<>(); + } + this.newssourceToFollow.add(newssourceToFollowItem); + return this; + } + + /** + * Get newssourceToFollow + * @return newssourceToFollow + */ + @javax.annotation.Nullable + public List<ProfileRequestModelSuggestionsNewssourceToFollowInner> getNewssourceToFollow() { + return newssourceToFollow; + } + + public void setNewssourceToFollow(@javax.annotation.Nullable List<ProfileRequestModelSuggestionsNewssourceToFollowInner> newssourceToFollow) { + this.newssourceToFollow = newssourceToFollow; + } + + + public ProfileRequestModelSuggestions peopleToFollow(@javax.annotation.Nullable List<ProfileRequestModelSuggestionsPeopleToFollowInner> peopleToFollow) { + this.peopleToFollow = peopleToFollow; + return this; + } + + public ProfileRequestModelSuggestions addPeopleToFollowItem(ProfileRequestModelSuggestionsPeopleToFollowInner peopleToFollowItem) { + if (this.peopleToFollow == null) { + this.peopleToFollow = new ArrayList<>(); + } + this.peopleToFollow.add(peopleToFollowItem); + return this; + } + + /** + * Get peopleToFollow + * @return peopleToFollow + */ + @javax.annotation.Nullable + public List<ProfileRequestModelSuggestionsPeopleToFollowInner> getPeopleToFollow() { + return peopleToFollow; + } + + public void setPeopleToFollow(@javax.annotation.Nullable List<ProfileRequestModelSuggestionsPeopleToFollowInner> peopleToFollow) { + this.peopleToFollow = peopleToFollow; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelSuggestions instance itself + */ + public ProfileRequestModelSuggestions putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelSuggestions profileRequestModelSuggestions = (ProfileRequestModelSuggestions) o; + return Objects.equals(this.companiesToFollow, profileRequestModelSuggestions.companiesToFollow) && + Objects.equals(this.industriesToFollow, profileRequestModelSuggestions.industriesToFollow) && + Objects.equals(this.newssourceToFollow, profileRequestModelSuggestions.newssourceToFollow) && + Objects.equals(this.peopleToFollow, profileRequestModelSuggestions.peopleToFollow)&& + Objects.equals(this.additionalProperties, profileRequestModelSuggestions.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(companiesToFollow, industriesToFollow, newssourceToFollow, peopleToFollow, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelSuggestions {\n"); + sb.append(" companiesToFollow: ").append(toIndentedString(companiesToFollow)).append("\n"); + sb.append(" industriesToFollow: ").append(toIndentedString(industriesToFollow)).append("\n"); + sb.append(" newssourceToFollow: ").append(toIndentedString(newssourceToFollow)).append("\n"); + sb.append(" peopleToFollow: ").append(toIndentedString(peopleToFollow)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("CompaniesToFollow"); + openapiFields.add("IndustriesToFollow"); + openapiFields.add("NewssourceToFollow"); + openapiFields.add("PeopleToFollow"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelSuggestions + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelSuggestions.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelSuggestions is not found in the empty JSON string", ProfileRequestModelSuggestions.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("CompaniesToFollow") != null && !jsonObj.get("CompaniesToFollow").isJsonNull()) { + JsonArray jsonArraycompaniesToFollow = jsonObj.getAsJsonArray("CompaniesToFollow"); + if (jsonArraycompaniesToFollow != null) { + // ensure the json data is an array + if (!jsonObj.get("CompaniesToFollow").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `CompaniesToFollow` to be an array in the JSON string but got `%s`", jsonObj.get("CompaniesToFollow").toString())); + } + + // validate the optional field `CompaniesToFollow` (array) + for (int i = 0; i < jsonArraycompaniesToFollow.size(); i++) { + ProfileRequestModelSuggestionsCompaniesToFollowInner.validateJsonElement(jsonArraycompaniesToFollow.get(i)); + }; + } + } + if (jsonObj.get("IndustriesToFollow") != null && !jsonObj.get("IndustriesToFollow").isJsonNull()) { + JsonArray jsonArrayindustriesToFollow = jsonObj.getAsJsonArray("IndustriesToFollow"); + if (jsonArrayindustriesToFollow != null) { + // ensure the json data is an array + if (!jsonObj.get("IndustriesToFollow").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `IndustriesToFollow` to be an array in the JSON string but got `%s`", jsonObj.get("IndustriesToFollow").toString())); + } + + // validate the optional field `IndustriesToFollow` (array) + for (int i = 0; i < jsonArrayindustriesToFollow.size(); i++) { + ProfileRequestModelSuggestionsIndustriesToFollowInner.validateJsonElement(jsonArrayindustriesToFollow.get(i)); + }; + } + } + if (jsonObj.get("NewssourceToFollow") != null && !jsonObj.get("NewssourceToFollow").isJsonNull()) { + JsonArray jsonArraynewssourceToFollow = jsonObj.getAsJsonArray("NewssourceToFollow"); + if (jsonArraynewssourceToFollow != null) { + // ensure the json data is an array + if (!jsonObj.get("NewssourceToFollow").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `NewssourceToFollow` to be an array in the JSON string but got `%s`", jsonObj.get("NewssourceToFollow").toString())); + } + + // validate the optional field `NewssourceToFollow` (array) + for (int i = 0; i < jsonArraynewssourceToFollow.size(); i++) { + ProfileRequestModelSuggestionsNewssourceToFollowInner.validateJsonElement(jsonArraynewssourceToFollow.get(i)); + }; + } + } + if (jsonObj.get("PeopleToFollow") != null && !jsonObj.get("PeopleToFollow").isJsonNull()) { + JsonArray jsonArraypeopleToFollow = jsonObj.getAsJsonArray("PeopleToFollow"); + if (jsonArraypeopleToFollow != null) { + // ensure the json data is an array + if (!jsonObj.get("PeopleToFollow").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PeopleToFollow` to be an array in the JSON string but got `%s`", jsonObj.get("PeopleToFollow").toString())); + } + + // validate the optional field `PeopleToFollow` (array) + for (int i = 0; i < jsonArraypeopleToFollow.size(); i++) { + ProfileRequestModelSuggestionsPeopleToFollowInner.validateJsonElement(jsonArraypeopleToFollow.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelSuggestions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelSuggestions' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelSuggestions> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelSuggestions.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelSuggestions>() { + @Override + public void write(JsonWriter out, ProfileRequestModelSuggestions value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelSuggestions read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelSuggestions instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelSuggestions given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelSuggestions + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelSuggestions + */ + public static ProfileRequestModelSuggestions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelSuggestions.class); + } + + /** + * Convert an instance of ProfileRequestModelSuggestions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelSuggestionsCompaniesToFollowInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelSuggestionsCompaniesToFollowInner.java new file mode 100644 index 0000000..9898b8a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelSuggestionsCompaniesToFollowInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelSuggestionsCompaniesToFollowInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelSuggestionsCompaniesToFollowInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ProfileRequestModelSuggestionsCompaniesToFollowInner() { + } + + public ProfileRequestModelSuggestionsCompaniesToFollowInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileRequestModelSuggestionsCompaniesToFollowInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelSuggestionsCompaniesToFollowInner instance itself + */ + public ProfileRequestModelSuggestionsCompaniesToFollowInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelSuggestionsCompaniesToFollowInner profileRequestModelSuggestionsCompaniesToFollowInner = (ProfileRequestModelSuggestionsCompaniesToFollowInner) o; + return Objects.equals(this.id, profileRequestModelSuggestionsCompaniesToFollowInner.id) && + Objects.equals(this.name, profileRequestModelSuggestionsCompaniesToFollowInner.name)&& + Objects.equals(this.additionalProperties, profileRequestModelSuggestionsCompaniesToFollowInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelSuggestionsCompaniesToFollowInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelSuggestionsCompaniesToFollowInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelSuggestionsCompaniesToFollowInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelSuggestionsCompaniesToFollowInner is not found in the empty JSON string", ProfileRequestModelSuggestionsCompaniesToFollowInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelSuggestionsCompaniesToFollowInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelSuggestionsCompaniesToFollowInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelSuggestionsCompaniesToFollowInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelSuggestionsCompaniesToFollowInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelSuggestionsCompaniesToFollowInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelSuggestionsCompaniesToFollowInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelSuggestionsCompaniesToFollowInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelSuggestionsCompaniesToFollowInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelSuggestionsCompaniesToFollowInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelSuggestionsCompaniesToFollowInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelSuggestionsCompaniesToFollowInner + */ + public static ProfileRequestModelSuggestionsCompaniesToFollowInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelSuggestionsCompaniesToFollowInner.class); + } + + /** + * Convert an instance of ProfileRequestModelSuggestionsCompaniesToFollowInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelSuggestionsIndustriesToFollowInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelSuggestionsIndustriesToFollowInner.java new file mode 100644 index 0000000..9064248 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelSuggestionsIndustriesToFollowInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelSuggestionsIndustriesToFollowInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelSuggestionsIndustriesToFollowInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ProfileRequestModelSuggestionsIndustriesToFollowInner() { + } + + public ProfileRequestModelSuggestionsIndustriesToFollowInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileRequestModelSuggestionsIndustriesToFollowInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelSuggestionsIndustriesToFollowInner instance itself + */ + public ProfileRequestModelSuggestionsIndustriesToFollowInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelSuggestionsIndustriesToFollowInner profileRequestModelSuggestionsIndustriesToFollowInner = (ProfileRequestModelSuggestionsIndustriesToFollowInner) o; + return Objects.equals(this.id, profileRequestModelSuggestionsIndustriesToFollowInner.id) && + Objects.equals(this.name, profileRequestModelSuggestionsIndustriesToFollowInner.name)&& + Objects.equals(this.additionalProperties, profileRequestModelSuggestionsIndustriesToFollowInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelSuggestionsIndustriesToFollowInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelSuggestionsIndustriesToFollowInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelSuggestionsIndustriesToFollowInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelSuggestionsIndustriesToFollowInner is not found in the empty JSON string", ProfileRequestModelSuggestionsIndustriesToFollowInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelSuggestionsIndustriesToFollowInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelSuggestionsIndustriesToFollowInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelSuggestionsIndustriesToFollowInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelSuggestionsIndustriesToFollowInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelSuggestionsIndustriesToFollowInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelSuggestionsIndustriesToFollowInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelSuggestionsIndustriesToFollowInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelSuggestionsIndustriesToFollowInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelSuggestionsIndustriesToFollowInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelSuggestionsIndustriesToFollowInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelSuggestionsIndustriesToFollowInner + */ + public static ProfileRequestModelSuggestionsIndustriesToFollowInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelSuggestionsIndustriesToFollowInner.class); + } + + /** + * Convert an instance of ProfileRequestModelSuggestionsIndustriesToFollowInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelSuggestionsNewssourceToFollowInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelSuggestionsNewssourceToFollowInner.java new file mode 100644 index 0000000..2628730 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelSuggestionsNewssourceToFollowInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelSuggestionsNewssourceToFollowInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelSuggestionsNewssourceToFollowInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ProfileRequestModelSuggestionsNewssourceToFollowInner() { + } + + public ProfileRequestModelSuggestionsNewssourceToFollowInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileRequestModelSuggestionsNewssourceToFollowInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelSuggestionsNewssourceToFollowInner instance itself + */ + public ProfileRequestModelSuggestionsNewssourceToFollowInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelSuggestionsNewssourceToFollowInner profileRequestModelSuggestionsNewssourceToFollowInner = (ProfileRequestModelSuggestionsNewssourceToFollowInner) o; + return Objects.equals(this.id, profileRequestModelSuggestionsNewssourceToFollowInner.id) && + Objects.equals(this.name, profileRequestModelSuggestionsNewssourceToFollowInner.name)&& + Objects.equals(this.additionalProperties, profileRequestModelSuggestionsNewssourceToFollowInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelSuggestionsNewssourceToFollowInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelSuggestionsNewssourceToFollowInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelSuggestionsNewssourceToFollowInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelSuggestionsNewssourceToFollowInner is not found in the empty JSON string", ProfileRequestModelSuggestionsNewssourceToFollowInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelSuggestionsNewssourceToFollowInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelSuggestionsNewssourceToFollowInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelSuggestionsNewssourceToFollowInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelSuggestionsNewssourceToFollowInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelSuggestionsNewssourceToFollowInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelSuggestionsNewssourceToFollowInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelSuggestionsNewssourceToFollowInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelSuggestionsNewssourceToFollowInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelSuggestionsNewssourceToFollowInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelSuggestionsNewssourceToFollowInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelSuggestionsNewssourceToFollowInner + */ + public static ProfileRequestModelSuggestionsNewssourceToFollowInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelSuggestionsNewssourceToFollowInner.class); + } + + /** + * Convert an instance of ProfileRequestModelSuggestionsNewssourceToFollowInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelSuggestionsPeopleToFollowInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelSuggestionsPeopleToFollowInner.java new file mode 100644 index 0000000..738b614 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelSuggestionsPeopleToFollowInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelSuggestionsPeopleToFollowInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelSuggestionsPeopleToFollowInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ProfileRequestModelSuggestionsPeopleToFollowInner() { + } + + public ProfileRequestModelSuggestionsPeopleToFollowInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileRequestModelSuggestionsPeopleToFollowInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelSuggestionsPeopleToFollowInner instance itself + */ + public ProfileRequestModelSuggestionsPeopleToFollowInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelSuggestionsPeopleToFollowInner profileRequestModelSuggestionsPeopleToFollowInner = (ProfileRequestModelSuggestionsPeopleToFollowInner) o; + return Objects.equals(this.id, profileRequestModelSuggestionsPeopleToFollowInner.id) && + Objects.equals(this.name, profileRequestModelSuggestionsPeopleToFollowInner.name)&& + Objects.equals(this.additionalProperties, profileRequestModelSuggestionsPeopleToFollowInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelSuggestionsPeopleToFollowInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelSuggestionsPeopleToFollowInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelSuggestionsPeopleToFollowInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelSuggestionsPeopleToFollowInner is not found in the empty JSON string", ProfileRequestModelSuggestionsPeopleToFollowInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelSuggestionsPeopleToFollowInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelSuggestionsPeopleToFollowInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelSuggestionsPeopleToFollowInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelSuggestionsPeopleToFollowInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelSuggestionsPeopleToFollowInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelSuggestionsPeopleToFollowInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelSuggestionsPeopleToFollowInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelSuggestionsPeopleToFollowInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelSuggestionsPeopleToFollowInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelSuggestionsPeopleToFollowInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelSuggestionsPeopleToFollowInner + */ + public static ProfileRequestModelSuggestionsPeopleToFollowInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelSuggestionsPeopleToFollowInner.class); + } + + /** + * Convert an instance of ProfileRequestModelSuggestionsPeopleToFollowInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelTeleVisionShowInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelTeleVisionShowInner.java new file mode 100644 index 0000000..f4547ed --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelTeleVisionShowInner.java @@ -0,0 +1,375 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelTeleVisionShowInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelTeleVisionShowInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_CATEGORY = "Category"; + @SerializedName(SERIALIZED_NAME_CATEGORY) + @javax.annotation.Nullable + private String category; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public ProfileRequestModelTeleVisionShowInner() { + } + + public ProfileRequestModelTeleVisionShowInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileRequestModelTeleVisionShowInner category(@javax.annotation.Nullable String category) { + this.category = category; + return this; + } + + /** + * Get category + * @return category + */ + @javax.annotation.Nullable + public String getCategory() { + return category; + } + + public void setCategory(@javax.annotation.Nullable String category) { + this.category = category; + } + + + public ProfileRequestModelTeleVisionShowInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileRequestModelTeleVisionShowInner createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get createdDate + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelTeleVisionShowInner instance itself + */ + public ProfileRequestModelTeleVisionShowInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelTeleVisionShowInner profileRequestModelTeleVisionShowInner = (ProfileRequestModelTeleVisionShowInner) o; + return Objects.equals(this.id, profileRequestModelTeleVisionShowInner.id) && + Objects.equals(this.category, profileRequestModelTeleVisionShowInner.category) && + Objects.equals(this.name, profileRequestModelTeleVisionShowInner.name) && + Objects.equals(this.createdDate, profileRequestModelTeleVisionShowInner.createdDate)&& + Objects.equals(this.additionalProperties, profileRequestModelTeleVisionShowInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, createdDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelTeleVisionShowInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Category"); + openapiFields.add("Name"); + openapiFields.add("CreatedDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelTeleVisionShowInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelTeleVisionShowInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelTeleVisionShowInner is not found in the empty JSON string", ProfileRequestModelTeleVisionShowInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Category") != null && !jsonObj.get("Category").isJsonNull()) && !jsonObj.get("Category").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Category` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Category").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelTeleVisionShowInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelTeleVisionShowInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelTeleVisionShowInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelTeleVisionShowInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelTeleVisionShowInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelTeleVisionShowInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelTeleVisionShowInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelTeleVisionShowInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelTeleVisionShowInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelTeleVisionShowInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelTeleVisionShowInner + */ + public static ProfileRequestModelTeleVisionShowInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelTeleVisionShowInner.class); + } + + /** + * Convert an instance of ProfileRequestModelTeleVisionShowInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelVolunteerInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelVolunteerInner.java new file mode 100644 index 0000000..7ec544a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileRequestModelVolunteerInner.java @@ -0,0 +1,377 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileRequestModelVolunteerInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileRequestModelVolunteerInner { + public static final String SERIALIZED_NAME_ORGANIZATION = "Organization"; + @SerializedName(SERIALIZED_NAME_ORGANIZATION) + @javax.annotation.Nullable + private String organization; + + public static final String SERIALIZED_NAME_ROLE = "Role"; + @SerializedName(SERIALIZED_NAME_ROLE) + @javax.annotation.Nullable + private String role; + + public static final String SERIALIZED_NAME_CAUSE = "Cause"; + @SerializedName(SERIALIZED_NAME_CAUSE) + @javax.annotation.Nullable + private String cause; + + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public ProfileRequestModelVolunteerInner() { + } + + public ProfileRequestModelVolunteerInner organization(@javax.annotation.Nullable String organization) { + this.organization = organization; + return this; + } + + /** + * Get organization + * @return organization + */ + @javax.annotation.Nullable + public String getOrganization() { + return organization; + } + + public void setOrganization(@javax.annotation.Nullable String organization) { + this.organization = organization; + } + + + public ProfileRequestModelVolunteerInner role(@javax.annotation.Nullable String role) { + this.role = role; + return this; + } + + /** + * Get role + * @return role + */ + @javax.annotation.Nullable + public String getRole() { + return role; + } + + public void setRole(@javax.annotation.Nullable String role) { + this.role = role; + } + + + public ProfileRequestModelVolunteerInner cause(@javax.annotation.Nullable String cause) { + this.cause = cause; + return this; + } + + /** + * Get cause + * @return cause + */ + @javax.annotation.Nullable + public String getCause() { + return cause; + } + + public void setCause(@javax.annotation.Nullable String cause) { + this.cause = cause; + } + + + public ProfileRequestModelVolunteerInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileRequestModelVolunteerInner instance itself + */ + public ProfileRequestModelVolunteerInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileRequestModelVolunteerInner profileRequestModelVolunteerInner = (ProfileRequestModelVolunteerInner) o; + return Objects.equals(this.organization, profileRequestModelVolunteerInner.organization) && + Objects.equals(this.role, profileRequestModelVolunteerInner.role) && + Objects.equals(this.cause, profileRequestModelVolunteerInner.cause) && + Objects.equals(this.id, profileRequestModelVolunteerInner.id)&& + Objects.equals(this.additionalProperties, profileRequestModelVolunteerInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(organization, role, cause, id, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileRequestModelVolunteerInner {\n"); + sb.append(" organization: ").append(toIndentedString(organization)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" cause: ").append(toIndentedString(cause)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Organization"); + openapiFields.add("Role"); + openapiFields.add("Cause"); + openapiFields.add("Id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileRequestModelVolunteerInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileRequestModelVolunteerInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileRequestModelVolunteerInner is not found in the empty JSON string", ProfileRequestModelVolunteerInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Organization") != null && !jsonObj.get("Organization").isJsonNull()) && !jsonObj.get("Organization").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Organization` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Organization").toString())); + } + if ((jsonObj.get("Role") != null && !jsonObj.get("Role").isJsonNull()) && !jsonObj.get("Role").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Role` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Role").toString())); + } + if ((jsonObj.get("Cause") != null && !jsonObj.get("Cause").isJsonNull()) && !jsonObj.get("Cause").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Cause` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Cause").toString())); + } + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileRequestModelVolunteerInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileRequestModelVolunteerInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileRequestModelVolunteerInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileRequestModelVolunteerInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileRequestModelVolunteerInner>() { + @Override + public void write(JsonWriter out, ProfileRequestModelVolunteerInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileRequestModelVolunteerInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileRequestModelVolunteerInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileRequestModelVolunteerInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileRequestModelVolunteerInner + * @throws IOException if the JSON string is invalid with respect to ProfileRequestModelVolunteerInner + */ + public static ProfileRequestModelVolunteerInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileRequestModelVolunteerInner.class); + } + + /** + * Convert an instance of ProfileRequestModelVolunteerInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileSkillsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileSkillsInner.java new file mode 100644 index 0000000..00f7456 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileSkillsInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileSkillsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileSkillsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ProfileSkillsInner() { + } + + public ProfileSkillsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the skill. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileSkillsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the skill. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileSkillsInner instance itself + */ + public ProfileSkillsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileSkillsInner profileSkillsInner = (ProfileSkillsInner) o; + return Objects.equals(this.id, profileSkillsInner.id) && + Objects.equals(this.name, profileSkillsInner.name)&& + Objects.equals(this.additionalProperties, profileSkillsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileSkillsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileSkillsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileSkillsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileSkillsInner is not found in the empty JSON string", ProfileSkillsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileSkillsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileSkillsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileSkillsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileSkillsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileSkillsInner>() { + @Override + public void write(JsonWriter out, ProfileSkillsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileSkillsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileSkillsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileSkillsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileSkillsInner + * @throws IOException if the JSON string is invalid with respect to ProfileSkillsInner + */ + public static ProfileSkillsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileSkillsInner.class); + } + + /** + * Convert an instance of ProfileSkillsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileSportsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileSportsInner.java new file mode 100644 index 0000000..bec2b5f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileSportsInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileSportsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileSportsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ProfileSportsInner() { + } + + public ProfileSportsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the sport. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileSportsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the sport. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileSportsInner instance itself + */ + public ProfileSportsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileSportsInner profileSportsInner = (ProfileSportsInner) o; + return Objects.equals(this.id, profileSportsInner.id) && + Objects.equals(this.name, profileSportsInner.name)&& + Objects.equals(this.additionalProperties, profileSportsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileSportsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileSportsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileSportsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileSportsInner is not found in the empty JSON string", ProfileSportsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileSportsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileSportsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileSportsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileSportsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileSportsInner>() { + @Override + public void write(JsonWriter out, ProfileSportsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileSportsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileSportsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileSportsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileSportsInner + * @throws IOException if the JSON string is invalid with respect to ProfileSportsInner + */ + public static ProfileSportsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileSportsInner.class); + } + + /** + * Convert an instance of ProfileSportsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileSubscription.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileSubscription.java new file mode 100644 index 0000000..e48bf4c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileSubscription.java @@ -0,0 +1,377 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileSubscription + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileSubscription { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_SPACE = "Space"; + @SerializedName(SERIALIZED_NAME_SPACE) + @javax.annotation.Nullable + private String space; + + public static final String SERIALIZED_NAME_PRIVATE_REPOS = "PrivateRepos"; + @SerializedName(SERIALIZED_NAME_PRIVATE_REPOS) + @javax.annotation.Nullable + private String privateRepos; + + public static final String SERIALIZED_NAME_COLLABORATORS = "Collaborators"; + @SerializedName(SERIALIZED_NAME_COLLABORATORS) + @javax.annotation.Nullable + private String collaborators; + + public ProfileSubscription() { + } + + public ProfileSubscription name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the subscription. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileSubscription space(@javax.annotation.Nullable String space) { + this.space = space; + return this; + } + + /** + * The allocated space for the subscription. + * @return space + */ + @javax.annotation.Nullable + public String getSpace() { + return space; + } + + public void setSpace(@javax.annotation.Nullable String space) { + this.space = space; + } + + + public ProfileSubscription privateRepos(@javax.annotation.Nullable String privateRepos) { + this.privateRepos = privateRepos; + return this; + } + + /** + * The number of private repositories allowed. + * @return privateRepos + */ + @javax.annotation.Nullable + public String getPrivateRepos() { + return privateRepos; + } + + public void setPrivateRepos(@javax.annotation.Nullable String privateRepos) { + this.privateRepos = privateRepos; + } + + + public ProfileSubscription collaborators(@javax.annotation.Nullable String collaborators) { + this.collaborators = collaborators; + return this; + } + + /** + * The number of collaborators allowed. + * @return collaborators + */ + @javax.annotation.Nullable + public String getCollaborators() { + return collaborators; + } + + public void setCollaborators(@javax.annotation.Nullable String collaborators) { + this.collaborators = collaborators; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileSubscription instance itself + */ + public ProfileSubscription putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileSubscription profileSubscription = (ProfileSubscription) o; + return Objects.equals(this.name, profileSubscription.name) && + Objects.equals(this.space, profileSubscription.space) && + Objects.equals(this.privateRepos, profileSubscription.privateRepos) && + Objects.equals(this.collaborators, profileSubscription.collaborators)&& + Objects.equals(this.additionalProperties, profileSubscription.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, space, privateRepos, collaborators, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileSubscription {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" space: ").append(toIndentedString(space)).append("\n"); + sb.append(" privateRepos: ").append(toIndentedString(privateRepos)).append("\n"); + sb.append(" collaborators: ").append(toIndentedString(collaborators)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + openapiFields.add("Space"); + openapiFields.add("PrivateRepos"); + openapiFields.add("Collaborators"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileSubscription + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileSubscription.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileSubscription is not found in the empty JSON string", ProfileSubscription.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Space") != null && !jsonObj.get("Space").isJsonNull()) && !jsonObj.get("Space").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Space` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Space").toString())); + } + if ((jsonObj.get("PrivateRepos") != null && !jsonObj.get("PrivateRepos").isJsonNull()) && !jsonObj.get("PrivateRepos").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PrivateRepos` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PrivateRepos").toString())); + } + if ((jsonObj.get("Collaborators") != null && !jsonObj.get("Collaborators").isJsonNull()) && !jsonObj.get("Collaborators").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Collaborators` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Collaborators").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileSubscription.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileSubscription' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileSubscription> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileSubscription.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileSubscription>() { + @Override + public void write(JsonWriter out, ProfileSubscription value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileSubscription read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileSubscription instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileSubscription given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileSubscription + * @throws IOException if the JSON string is invalid with respect to ProfileSubscription + */ + public static ProfileSubscription fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileSubscription.class); + } + + /** + * Convert an instance of ProfileSubscription to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileSuggestions.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileSuggestions.java new file mode 100644 index 0000000..751572a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileSuggestions.java @@ -0,0 +1,459 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProfileSuggestionsCompaniesToFollowInner; +import com.loginradius.sdk.internal.openapi.model.ProfileSuggestionsIndustriesToFollowInner; +import com.loginradius.sdk.internal.openapi.model.ProfileSuggestionsNewssourceToFollowInner; +import com.loginradius.sdk.internal.openapi.model.ProfileSuggestionsPeopleToFollowInner; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileSuggestions + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileSuggestions { + public static final String SERIALIZED_NAME_COMPANIES_TO_FOLLOW = "CompaniesToFollow"; + @SerializedName(SERIALIZED_NAME_COMPANIES_TO_FOLLOW) + @javax.annotation.Nullable + private List<ProfileSuggestionsCompaniesToFollowInner> companiesToFollow = new ArrayList<>(); + + public static final String SERIALIZED_NAME_INDUSTRIES_TO_FOLLOW = "IndustriesToFollow"; + @SerializedName(SERIALIZED_NAME_INDUSTRIES_TO_FOLLOW) + @javax.annotation.Nullable + private List<ProfileSuggestionsIndustriesToFollowInner> industriesToFollow = new ArrayList<>(); + + public static final String SERIALIZED_NAME_NEWSSOURCE_TO_FOLLOW = "NewssourceToFollow"; + @SerializedName(SERIALIZED_NAME_NEWSSOURCE_TO_FOLLOW) + @javax.annotation.Nullable + private List<ProfileSuggestionsNewssourceToFollowInner> newssourceToFollow = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PEOPLE_TO_FOLLOW = "PeopleToFollow"; + @SerializedName(SERIALIZED_NAME_PEOPLE_TO_FOLLOW) + @javax.annotation.Nullable + private List<ProfileSuggestionsPeopleToFollowInner> peopleToFollow = new ArrayList<>(); + + public ProfileSuggestions() { + } + + public ProfileSuggestions companiesToFollow(@javax.annotation.Nullable List<ProfileSuggestionsCompaniesToFollowInner> companiesToFollow) { + this.companiesToFollow = companiesToFollow; + return this; + } + + public ProfileSuggestions addCompaniesToFollowItem(ProfileSuggestionsCompaniesToFollowInner companiesToFollowItem) { + if (this.companiesToFollow == null) { + this.companiesToFollow = new ArrayList<>(); + } + this.companiesToFollow.add(companiesToFollowItem); + return this; + } + + /** + * List of companies suggested to follow. + * @return companiesToFollow + */ + @javax.annotation.Nullable + public List<ProfileSuggestionsCompaniesToFollowInner> getCompaniesToFollow() { + return companiesToFollow; + } + + public void setCompaniesToFollow(@javax.annotation.Nullable List<ProfileSuggestionsCompaniesToFollowInner> companiesToFollow) { + this.companiesToFollow = companiesToFollow; + } + + + public ProfileSuggestions industriesToFollow(@javax.annotation.Nullable List<ProfileSuggestionsIndustriesToFollowInner> industriesToFollow) { + this.industriesToFollow = industriesToFollow; + return this; + } + + public ProfileSuggestions addIndustriesToFollowItem(ProfileSuggestionsIndustriesToFollowInner industriesToFollowItem) { + if (this.industriesToFollow == null) { + this.industriesToFollow = new ArrayList<>(); + } + this.industriesToFollow.add(industriesToFollowItem); + return this; + } + + /** + * List of industries suggested to follow. + * @return industriesToFollow + */ + @javax.annotation.Nullable + public List<ProfileSuggestionsIndustriesToFollowInner> getIndustriesToFollow() { + return industriesToFollow; + } + + public void setIndustriesToFollow(@javax.annotation.Nullable List<ProfileSuggestionsIndustriesToFollowInner> industriesToFollow) { + this.industriesToFollow = industriesToFollow; + } + + + public ProfileSuggestions newssourceToFollow(@javax.annotation.Nullable List<ProfileSuggestionsNewssourceToFollowInner> newssourceToFollow) { + this.newssourceToFollow = newssourceToFollow; + return this; + } + + public ProfileSuggestions addNewssourceToFollowItem(ProfileSuggestionsNewssourceToFollowInner newssourceToFollowItem) { + if (this.newssourceToFollow == null) { + this.newssourceToFollow = new ArrayList<>(); + } + this.newssourceToFollow.add(newssourceToFollowItem); + return this; + } + + /** + * List of news sources suggested to follow. + * @return newssourceToFollow + */ + @javax.annotation.Nullable + public List<ProfileSuggestionsNewssourceToFollowInner> getNewssourceToFollow() { + return newssourceToFollow; + } + + public void setNewssourceToFollow(@javax.annotation.Nullable List<ProfileSuggestionsNewssourceToFollowInner> newssourceToFollow) { + this.newssourceToFollow = newssourceToFollow; + } + + + public ProfileSuggestions peopleToFollow(@javax.annotation.Nullable List<ProfileSuggestionsPeopleToFollowInner> peopleToFollow) { + this.peopleToFollow = peopleToFollow; + return this; + } + + public ProfileSuggestions addPeopleToFollowItem(ProfileSuggestionsPeopleToFollowInner peopleToFollowItem) { + if (this.peopleToFollow == null) { + this.peopleToFollow = new ArrayList<>(); + } + this.peopleToFollow.add(peopleToFollowItem); + return this; + } + + /** + * List of people suggested to follow. + * @return peopleToFollow + */ + @javax.annotation.Nullable + public List<ProfileSuggestionsPeopleToFollowInner> getPeopleToFollow() { + return peopleToFollow; + } + + public void setPeopleToFollow(@javax.annotation.Nullable List<ProfileSuggestionsPeopleToFollowInner> peopleToFollow) { + this.peopleToFollow = peopleToFollow; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileSuggestions instance itself + */ + public ProfileSuggestions putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileSuggestions profileSuggestions = (ProfileSuggestions) o; + return Objects.equals(this.companiesToFollow, profileSuggestions.companiesToFollow) && + Objects.equals(this.industriesToFollow, profileSuggestions.industriesToFollow) && + Objects.equals(this.newssourceToFollow, profileSuggestions.newssourceToFollow) && + Objects.equals(this.peopleToFollow, profileSuggestions.peopleToFollow)&& + Objects.equals(this.additionalProperties, profileSuggestions.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(companiesToFollow, industriesToFollow, newssourceToFollow, peopleToFollow, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileSuggestions {\n"); + sb.append(" companiesToFollow: ").append(toIndentedString(companiesToFollow)).append("\n"); + sb.append(" industriesToFollow: ").append(toIndentedString(industriesToFollow)).append("\n"); + sb.append(" newssourceToFollow: ").append(toIndentedString(newssourceToFollow)).append("\n"); + sb.append(" peopleToFollow: ").append(toIndentedString(peopleToFollow)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("CompaniesToFollow"); + openapiFields.add("IndustriesToFollow"); + openapiFields.add("NewssourceToFollow"); + openapiFields.add("PeopleToFollow"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileSuggestions + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileSuggestions.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileSuggestions is not found in the empty JSON string", ProfileSuggestions.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("CompaniesToFollow") != null && !jsonObj.get("CompaniesToFollow").isJsonNull()) { + JsonArray jsonArraycompaniesToFollow = jsonObj.getAsJsonArray("CompaniesToFollow"); + if (jsonArraycompaniesToFollow != null) { + // ensure the json data is an array + if (!jsonObj.get("CompaniesToFollow").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `CompaniesToFollow` to be an array in the JSON string but got `%s`", jsonObj.get("CompaniesToFollow").toString())); + } + + // validate the optional field `CompaniesToFollow` (array) + for (int i = 0; i < jsonArraycompaniesToFollow.size(); i++) { + ProfileSuggestionsCompaniesToFollowInner.validateJsonElement(jsonArraycompaniesToFollow.get(i)); + }; + } + } + if (jsonObj.get("IndustriesToFollow") != null && !jsonObj.get("IndustriesToFollow").isJsonNull()) { + JsonArray jsonArrayindustriesToFollow = jsonObj.getAsJsonArray("IndustriesToFollow"); + if (jsonArrayindustriesToFollow != null) { + // ensure the json data is an array + if (!jsonObj.get("IndustriesToFollow").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `IndustriesToFollow` to be an array in the JSON string but got `%s`", jsonObj.get("IndustriesToFollow").toString())); + } + + // validate the optional field `IndustriesToFollow` (array) + for (int i = 0; i < jsonArrayindustriesToFollow.size(); i++) { + ProfileSuggestionsIndustriesToFollowInner.validateJsonElement(jsonArrayindustriesToFollow.get(i)); + }; + } + } + if (jsonObj.get("NewssourceToFollow") != null && !jsonObj.get("NewssourceToFollow").isJsonNull()) { + JsonArray jsonArraynewssourceToFollow = jsonObj.getAsJsonArray("NewssourceToFollow"); + if (jsonArraynewssourceToFollow != null) { + // ensure the json data is an array + if (!jsonObj.get("NewssourceToFollow").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `NewssourceToFollow` to be an array in the JSON string but got `%s`", jsonObj.get("NewssourceToFollow").toString())); + } + + // validate the optional field `NewssourceToFollow` (array) + for (int i = 0; i < jsonArraynewssourceToFollow.size(); i++) { + ProfileSuggestionsNewssourceToFollowInner.validateJsonElement(jsonArraynewssourceToFollow.get(i)); + }; + } + } + if (jsonObj.get("PeopleToFollow") != null && !jsonObj.get("PeopleToFollow").isJsonNull()) { + JsonArray jsonArraypeopleToFollow = jsonObj.getAsJsonArray("PeopleToFollow"); + if (jsonArraypeopleToFollow != null) { + // ensure the json data is an array + if (!jsonObj.get("PeopleToFollow").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PeopleToFollow` to be an array in the JSON string but got `%s`", jsonObj.get("PeopleToFollow").toString())); + } + + // validate the optional field `PeopleToFollow` (array) + for (int i = 0; i < jsonArraypeopleToFollow.size(); i++) { + ProfileSuggestionsPeopleToFollowInner.validateJsonElement(jsonArraypeopleToFollow.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileSuggestions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileSuggestions' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileSuggestions> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileSuggestions.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileSuggestions>() { + @Override + public void write(JsonWriter out, ProfileSuggestions value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileSuggestions read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileSuggestions instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileSuggestions given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileSuggestions + * @throws IOException if the JSON string is invalid with respect to ProfileSuggestions + */ + public static ProfileSuggestions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileSuggestions.class); + } + + /** + * Convert an instance of ProfileSuggestions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileSuggestionsCompaniesToFollowInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileSuggestionsCompaniesToFollowInner.java new file mode 100644 index 0000000..baafba1 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileSuggestionsCompaniesToFollowInner.java @@ -0,0 +1,329 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileSuggestionsCompaniesToFollowInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileSuggestionsCompaniesToFollowInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ProfileSuggestionsCompaniesToFollowInner() { + } + + public ProfileSuggestionsCompaniesToFollowInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The unique identifier. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileSuggestionsCompaniesToFollowInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the company. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileSuggestionsCompaniesToFollowInner instance itself + */ + public ProfileSuggestionsCompaniesToFollowInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileSuggestionsCompaniesToFollowInner profileSuggestionsCompaniesToFollowInner = (ProfileSuggestionsCompaniesToFollowInner) o; + return Objects.equals(this.id, profileSuggestionsCompaniesToFollowInner.id) && + Objects.equals(this.name, profileSuggestionsCompaniesToFollowInner.name)&& + Objects.equals(this.additionalProperties, profileSuggestionsCompaniesToFollowInner.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileSuggestionsCompaniesToFollowInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileSuggestionsCompaniesToFollowInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileSuggestionsCompaniesToFollowInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileSuggestionsCompaniesToFollowInner is not found in the empty JSON string", ProfileSuggestionsCompaniesToFollowInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileSuggestionsCompaniesToFollowInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileSuggestionsCompaniesToFollowInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileSuggestionsCompaniesToFollowInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileSuggestionsCompaniesToFollowInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileSuggestionsCompaniesToFollowInner>() { + @Override + public void write(JsonWriter out, ProfileSuggestionsCompaniesToFollowInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileSuggestionsCompaniesToFollowInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileSuggestionsCompaniesToFollowInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileSuggestionsCompaniesToFollowInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileSuggestionsCompaniesToFollowInner + * @throws IOException if the JSON string is invalid with respect to ProfileSuggestionsCompaniesToFollowInner + */ + public static ProfileSuggestionsCompaniesToFollowInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileSuggestionsCompaniesToFollowInner.class); + } + + /** + * Convert an instance of ProfileSuggestionsCompaniesToFollowInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileSuggestionsIndustriesToFollowInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileSuggestionsIndustriesToFollowInner.java new file mode 100644 index 0000000..f5c38db --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileSuggestionsIndustriesToFollowInner.java @@ -0,0 +1,329 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileSuggestionsIndustriesToFollowInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileSuggestionsIndustriesToFollowInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ProfileSuggestionsIndustriesToFollowInner() { + } + + public ProfileSuggestionsIndustriesToFollowInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The unique identifier. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileSuggestionsIndustriesToFollowInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the industry. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileSuggestionsIndustriesToFollowInner instance itself + */ + public ProfileSuggestionsIndustriesToFollowInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileSuggestionsIndustriesToFollowInner profileSuggestionsIndustriesToFollowInner = (ProfileSuggestionsIndustriesToFollowInner) o; + return Objects.equals(this.id, profileSuggestionsIndustriesToFollowInner.id) && + Objects.equals(this.name, profileSuggestionsIndustriesToFollowInner.name)&& + Objects.equals(this.additionalProperties, profileSuggestionsIndustriesToFollowInner.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileSuggestionsIndustriesToFollowInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileSuggestionsIndustriesToFollowInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileSuggestionsIndustriesToFollowInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileSuggestionsIndustriesToFollowInner is not found in the empty JSON string", ProfileSuggestionsIndustriesToFollowInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileSuggestionsIndustriesToFollowInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileSuggestionsIndustriesToFollowInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileSuggestionsIndustriesToFollowInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileSuggestionsIndustriesToFollowInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileSuggestionsIndustriesToFollowInner>() { + @Override + public void write(JsonWriter out, ProfileSuggestionsIndustriesToFollowInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileSuggestionsIndustriesToFollowInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileSuggestionsIndustriesToFollowInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileSuggestionsIndustriesToFollowInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileSuggestionsIndustriesToFollowInner + * @throws IOException if the JSON string is invalid with respect to ProfileSuggestionsIndustriesToFollowInner + */ + public static ProfileSuggestionsIndustriesToFollowInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileSuggestionsIndustriesToFollowInner.class); + } + + /** + * Convert an instance of ProfileSuggestionsIndustriesToFollowInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileSuggestionsNewssourceToFollowInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileSuggestionsNewssourceToFollowInner.java new file mode 100644 index 0000000..8cb27be --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileSuggestionsNewssourceToFollowInner.java @@ -0,0 +1,329 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileSuggestionsNewssourceToFollowInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileSuggestionsNewssourceToFollowInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ProfileSuggestionsNewssourceToFollowInner() { + } + + public ProfileSuggestionsNewssourceToFollowInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The unique identifier. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileSuggestionsNewssourceToFollowInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the news source. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileSuggestionsNewssourceToFollowInner instance itself + */ + public ProfileSuggestionsNewssourceToFollowInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileSuggestionsNewssourceToFollowInner profileSuggestionsNewssourceToFollowInner = (ProfileSuggestionsNewssourceToFollowInner) o; + return Objects.equals(this.id, profileSuggestionsNewssourceToFollowInner.id) && + Objects.equals(this.name, profileSuggestionsNewssourceToFollowInner.name)&& + Objects.equals(this.additionalProperties, profileSuggestionsNewssourceToFollowInner.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileSuggestionsNewssourceToFollowInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileSuggestionsNewssourceToFollowInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileSuggestionsNewssourceToFollowInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileSuggestionsNewssourceToFollowInner is not found in the empty JSON string", ProfileSuggestionsNewssourceToFollowInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileSuggestionsNewssourceToFollowInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileSuggestionsNewssourceToFollowInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileSuggestionsNewssourceToFollowInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileSuggestionsNewssourceToFollowInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileSuggestionsNewssourceToFollowInner>() { + @Override + public void write(JsonWriter out, ProfileSuggestionsNewssourceToFollowInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileSuggestionsNewssourceToFollowInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileSuggestionsNewssourceToFollowInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileSuggestionsNewssourceToFollowInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileSuggestionsNewssourceToFollowInner + * @throws IOException if the JSON string is invalid with respect to ProfileSuggestionsNewssourceToFollowInner + */ + public static ProfileSuggestionsNewssourceToFollowInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileSuggestionsNewssourceToFollowInner.class); + } + + /** + * Convert an instance of ProfileSuggestionsNewssourceToFollowInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileSuggestionsPeopleToFollowInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileSuggestionsPeopleToFollowInner.java new file mode 100644 index 0000000..26d12e5 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileSuggestionsPeopleToFollowInner.java @@ -0,0 +1,329 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileSuggestionsPeopleToFollowInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileSuggestionsPeopleToFollowInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ProfileSuggestionsPeopleToFollowInner() { + } + + public ProfileSuggestionsPeopleToFollowInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The unique identifier. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileSuggestionsPeopleToFollowInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the person. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileSuggestionsPeopleToFollowInner instance itself + */ + public ProfileSuggestionsPeopleToFollowInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileSuggestionsPeopleToFollowInner profileSuggestionsPeopleToFollowInner = (ProfileSuggestionsPeopleToFollowInner) o; + return Objects.equals(this.id, profileSuggestionsPeopleToFollowInner.id) && + Objects.equals(this.name, profileSuggestionsPeopleToFollowInner.name)&& + Objects.equals(this.additionalProperties, profileSuggestionsPeopleToFollowInner.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileSuggestionsPeopleToFollowInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileSuggestionsPeopleToFollowInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileSuggestionsPeopleToFollowInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileSuggestionsPeopleToFollowInner is not found in the empty JSON string", ProfileSuggestionsPeopleToFollowInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileSuggestionsPeopleToFollowInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileSuggestionsPeopleToFollowInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileSuggestionsPeopleToFollowInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileSuggestionsPeopleToFollowInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileSuggestionsPeopleToFollowInner>() { + @Override + public void write(JsonWriter out, ProfileSuggestionsPeopleToFollowInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileSuggestionsPeopleToFollowInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileSuggestionsPeopleToFollowInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileSuggestionsPeopleToFollowInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileSuggestionsPeopleToFollowInner + * @throws IOException if the JSON string is invalid with respect to ProfileSuggestionsPeopleToFollowInner + */ + public static ProfileSuggestionsPeopleToFollowInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileSuggestionsPeopleToFollowInner.class); + } + + /** + * Convert an instance of ProfileSuggestionsPeopleToFollowInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileTelevisionShowInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileTelevisionShowInner.java new file mode 100644 index 0000000..83d59af --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileTelevisionShowInner.java @@ -0,0 +1,375 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileTelevisionShowInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileTelevisionShowInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_CATEGORY = "Category"; + @SerializedName(SERIALIZED_NAME_CATEGORY) + @javax.annotation.Nullable + private String category; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public ProfileTelevisionShowInner() { + } + + public ProfileTelevisionShowInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the television show. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileTelevisionShowInner category(@javax.annotation.Nullable String category) { + this.category = category; + return this; + } + + /** + * The category of the television show. + * @return category + */ + @javax.annotation.Nullable + public String getCategory() { + return category; + } + + public void setCategory(@javax.annotation.Nullable String category) { + this.category = category; + } + + + public ProfileTelevisionShowInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the television show. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileTelevisionShowInner createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * The date the television show was added. + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileTelevisionShowInner instance itself + */ + public ProfileTelevisionShowInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileTelevisionShowInner profileTelevisionShowInner = (ProfileTelevisionShowInner) o; + return Objects.equals(this.id, profileTelevisionShowInner.id) && + Objects.equals(this.category, profileTelevisionShowInner.category) && + Objects.equals(this.name, profileTelevisionShowInner.name) && + Objects.equals(this.createdDate, profileTelevisionShowInner.createdDate)&& + Objects.equals(this.additionalProperties, profileTelevisionShowInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, createdDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileTelevisionShowInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Category"); + openapiFields.add("Name"); + openapiFields.add("CreatedDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileTelevisionShowInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileTelevisionShowInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileTelevisionShowInner is not found in the empty JSON string", ProfileTelevisionShowInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Category") != null && !jsonObj.get("Category").isJsonNull()) && !jsonObj.get("Category").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Category` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Category").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileTelevisionShowInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileTelevisionShowInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileTelevisionShowInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileTelevisionShowInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileTelevisionShowInner>() { + @Override + public void write(JsonWriter out, ProfileTelevisionShowInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileTelevisionShowInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileTelevisionShowInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileTelevisionShowInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileTelevisionShowInner + * @throws IOException if the JSON string is invalid with respect to ProfileTelevisionShowInner + */ + public static ProfileTelevisionShowInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileTelevisionShowInner.class); + } + + /** + * Convert an instance of ProfileTelevisionShowInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileUnverifiedEmailInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileUnverifiedEmailInner.java new file mode 100644 index 0000000..2b516bf --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileUnverifiedEmailInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileUnverifiedEmailInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileUnverifiedEmailInner { + public static final String SERIALIZED_NAME_TYPE = "Type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_VALUE = "Value"; + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nullable + private String value; + + public ProfileUnverifiedEmailInner() { + } + + public ProfileUnverifiedEmailInner type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * The type of the Email. + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public ProfileUnverifiedEmailInner value(@javax.annotation.Nullable String value) { + this.value = value; + return this; + } + + /** + * The Email address. + * @return value + */ + @javax.annotation.Nullable + public String getValue() { + return value; + } + + public void setValue(@javax.annotation.Nullable String value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileUnverifiedEmailInner instance itself + */ + public ProfileUnverifiedEmailInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileUnverifiedEmailInner profileUnverifiedEmailInner = (ProfileUnverifiedEmailInner) o; + return Objects.equals(this.type, profileUnverifiedEmailInner.type) && + Objects.equals(this.value, profileUnverifiedEmailInner.value)&& + Objects.equals(this.additionalProperties, profileUnverifiedEmailInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileUnverifiedEmailInner {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Type"); + openapiFields.add("Value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileUnverifiedEmailInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileUnverifiedEmailInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileUnverifiedEmailInner is not found in the empty JSON string", ProfileUnverifiedEmailInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonNull()) && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + if ((jsonObj.get("Value") != null && !jsonObj.get("Value").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileUnverifiedEmailInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileUnverifiedEmailInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileUnverifiedEmailInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileUnverifiedEmailInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileUnverifiedEmailInner>() { + @Override + public void write(JsonWriter out, ProfileUnverifiedEmailInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileUnverifiedEmailInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileUnverifiedEmailInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileUnverifiedEmailInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileUnverifiedEmailInner + * @throws IOException if the JSON string is invalid with respect to ProfileUnverifiedEmailInner + */ + public static ProfileUnverifiedEmailInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileUnverifiedEmailInner.class); + } + + /** + * Convert an instance of ProfileUnverifiedEmailInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileVolunteerInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileVolunteerInner.java new file mode 100644 index 0000000..3d4ea6a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileVolunteerInner.java @@ -0,0 +1,377 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileVolunteerInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileVolunteerInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_ROLE = "Role"; + @SerializedName(SERIALIZED_NAME_ROLE) + @javax.annotation.Nullable + private String role; + + public static final String SERIALIZED_NAME_ORGANIZATION = "Organization"; + @SerializedName(SERIALIZED_NAME_ORGANIZATION) + @javax.annotation.Nullable + private String organization; + + public static final String SERIALIZED_NAME_CAUSE = "Cause"; + @SerializedName(SERIALIZED_NAME_CAUSE) + @javax.annotation.Nullable + private String cause; + + public ProfileVolunteerInner() { + } + + public ProfileVolunteerInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The ID of the volunteer activity. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileVolunteerInner role(@javax.annotation.Nullable String role) { + this.role = role; + return this; + } + + /** + * The Role in the volunteer activity. + * @return role + */ + @javax.annotation.Nullable + public String getRole() { + return role; + } + + public void setRole(@javax.annotation.Nullable String role) { + this.role = role; + } + + + public ProfileVolunteerInner organization(@javax.annotation.Nullable String organization) { + this.organization = organization; + return this; + } + + /** + * The organization for the volunteer activity. + * @return organization + */ + @javax.annotation.Nullable + public String getOrganization() { + return organization; + } + + public void setOrganization(@javax.annotation.Nullable String organization) { + this.organization = organization; + } + + + public ProfileVolunteerInner cause(@javax.annotation.Nullable String cause) { + this.cause = cause; + return this; + } + + /** + * The cause of the volunteer activity. + * @return cause + */ + @javax.annotation.Nullable + public String getCause() { + return cause; + } + + public void setCause(@javax.annotation.Nullable String cause) { + this.cause = cause; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileVolunteerInner instance itself + */ + public ProfileVolunteerInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileVolunteerInner profileVolunteerInner = (ProfileVolunteerInner) o; + return Objects.equals(this.id, profileVolunteerInner.id) && + Objects.equals(this.role, profileVolunteerInner.role) && + Objects.equals(this.organization, profileVolunteerInner.organization) && + Objects.equals(this.cause, profileVolunteerInner.cause)&& + Objects.equals(this.additionalProperties, profileVolunteerInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, role, organization, cause, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileVolunteerInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" organization: ").append(toIndentedString(organization)).append("\n"); + sb.append(" cause: ").append(toIndentedString(cause)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Role"); + openapiFields.add("Organization"); + openapiFields.add("Cause"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileVolunteerInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileVolunteerInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileVolunteerInner is not found in the empty JSON string", ProfileVolunteerInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Role") != null && !jsonObj.get("Role").isJsonNull()) && !jsonObj.get("Role").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Role` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Role").toString())); + } + if ((jsonObj.get("Organization") != null && !jsonObj.get("Organization").isJsonNull()) && !jsonObj.get("Organization").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Organization` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Organization").toString())); + } + if ((jsonObj.get("Cause") != null && !jsonObj.get("Cause").isJsonNull()) && !jsonObj.get("Cause").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Cause` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Cause").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileVolunteerInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileVolunteerInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileVolunteerInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileVolunteerInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileVolunteerInner>() { + @Override + public void write(JsonWriter out, ProfileVolunteerInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileVolunteerInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileVolunteerInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileVolunteerInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileVolunteerInner + * @throws IOException if the JSON string is invalid with respect to ProfileVolunteerInner + */ + public static ProfileVolunteerInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileVolunteerInner.class); + } + + /** + * Convert an instance of ProfileVolunteerInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentities.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentities.java new file mode 100644 index 0000000..3d71156 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentities.java @@ -0,0 +1,5381 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProfileRequestModelCountry; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelFamilyInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSportsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSubscriptionAgeRange; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelVolunteerInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesAddressesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesAwardsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesBadgesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesBooksInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesCertificationsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesConsentProfile; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesCoursesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesCurrentStatusInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesEducationsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesExternalIdsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesFavoriteThingsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesGamesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesIMAccountsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesInspirationalPeopleInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesInterestsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesJobBookmarksInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesKloutScore; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesLanguagesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesMemberUrlResourcesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesMoviesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesMutualFriendsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesOrganizationsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesPIN; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesPasskeyLogin; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesPatentsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesPhoneNumbersInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesPlacesLivedInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesPositionsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesPrivacyPolicy; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesProjectsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesProviderAccessCredential; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesPublicationsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesRecommendationsReceivedInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesRegistrationData; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesRelatedProfileViewsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesSkillsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesSubscription; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesSuggestions; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesTelevisionShowInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesUnverifiedEmailInner; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentities + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentities { + public static final String SERIALIZED_NAME_IS_PASSWORD_BREACHED = "IsPasswordBreached"; + @SerializedName(SERIALIZED_NAME_IS_PASSWORD_BREACHED) + @javax.annotation.Nullable + private Boolean isPasswordBreached; + + public static final String SERIALIZED_NAME_IS_ACTIVE = "IsActive"; + @SerializedName(SERIALIZED_NAME_IS_ACTIVE) + @javax.annotation.Nullable + private Boolean isActive; + + public static final String SERIALIZED_NAME_IS_DELETED = "IsDeleted"; + @SerializedName(SERIALIZED_NAME_IS_DELETED) + @javax.annotation.Nullable + private Boolean isDeleted; + + public static final String SERIALIZED_NAME_EMAIL_VERIFIED = "EmailVerified"; + @SerializedName(SERIALIZED_NAME_EMAIL_VERIFIED) + @javax.annotation.Nullable + private Boolean emailVerified; + + public static final String SERIALIZED_NAME_IS_LOGIN_LOCKED = "IsLoginLocked"; + @SerializedName(SERIALIZED_NAME_IS_LOGIN_LOCKED) + @javax.annotation.Nullable + private Boolean isLoginLocked; + + public static final String SERIALIZED_NAME_IS_REQUIRED_FIELDS_FILLED_ONCE = "IsRequiredFieldsFilledOnce"; + @SerializedName(SERIALIZED_NAME_IS_REQUIRED_FIELDS_FILLED_ONCE) + @javax.annotation.Nullable + private Boolean isRequiredFieldsFilledOnce; + + public static final String SERIALIZED_NAME_FIRST_LOGIN = "FirstLogin"; + @SerializedName(SERIALIZED_NAME_FIRST_LOGIN) + @javax.annotation.Nullable + private Boolean firstLogin; + + public static final String SERIALIZED_NAME_IS_PROTECTED = "IsProtected"; + @SerializedName(SERIALIZED_NAME_IS_PROTECTED) + @javax.annotation.Nullable + private Boolean isProtected; + + public static final String SERIALIZED_NAME_HIREABLE = "Hireable"; + @SerializedName(SERIALIZED_NAME_HIREABLE) + @javax.annotation.Nullable + private Boolean hireable; + + public static final String SERIALIZED_NAME_IS_SECURE_PASSWORD = "IsSecurePassword"; + @SerializedName(SERIALIZED_NAME_IS_SECURE_PASSWORD) + @javax.annotation.Nullable + private Boolean isSecurePassword; + + public static final String SERIALIZED_NAME_IS_CUSTOM_UID = "IsCustomUid"; + @SerializedName(SERIALIZED_NAME_IS_CUSTOM_UID) + @javax.annotation.Nullable + private Boolean isCustomUid; + + public static final String SERIALIZED_NAME_PHONE_ID_VERIFIED = "PhoneIdVerified"; + @SerializedName(SERIALIZED_NAME_PHONE_ID_VERIFIED) + @javax.annotation.Nullable + private Boolean phoneIdVerified; + + public static final String SERIALIZED_NAME_IS_EMAIL_SUBSCRIBED = "IsEmailSubscribed"; + @SerializedName(SERIALIZED_NAME_IS_EMAIL_SUBSCRIBED) + @javax.annotation.Nullable + private Boolean isEmailSubscribed; + + public static final String SERIALIZED_NAME_NO_OF_LOGINS = "NoOfLogins"; + @SerializedName(SERIALIZED_NAME_NO_OF_LOGINS) + @javax.annotation.Nullable + private Integer noOfLogins; + + public static final String SERIALIZED_NAME_FOLLOWERS_COUNT = "FollowersCount"; + @SerializedName(SERIALIZED_NAME_FOLLOWERS_COUNT) + @javax.annotation.Nullable + private Integer followersCount; + + public static final String SERIALIZED_NAME_FRIENDS_COUNT = "FriendsCount"; + @SerializedName(SERIALIZED_NAME_FRIENDS_COUNT) + @javax.annotation.Nullable + private Integer friendsCount; + + public static final String SERIALIZED_NAME_TOTAL_STATUSES_COUNT = "TotalStatusesCount"; + @SerializedName(SERIALIZED_NAME_TOTAL_STATUSES_COUNT) + @javax.annotation.Nullable + private Integer totalStatusesCount; + + public static final String SERIALIZED_NAME_NUM_RECOMMENDERS = "NumRecommenders"; + @SerializedName(SERIALIZED_NAME_NUM_RECOMMENDERS) + @javax.annotation.Nullable + private Integer numRecommenders; + + public static final String SERIALIZED_NAME_TOTAL_PRIVATE_REPOSITORY = "TotalPrivateRepository"; + @SerializedName(SERIALIZED_NAME_TOTAL_PRIVATE_REPOSITORY) + @javax.annotation.Nullable + private Integer totalPrivateRepository; + + public static final String SERIALIZED_NAME_PUBLIC_GISTS = "PublicGists"; + @SerializedName(SERIALIZED_NAME_PUBLIC_GISTS) + @javax.annotation.Nullable + private Integer publicGists; + + public static final String SERIALIZED_NAME_PRIVATE_GISTS = "PrivateGists"; + @SerializedName(SERIALIZED_NAME_PRIVATE_GISTS) + @javax.annotation.Nullable + private Integer privateGists; + + public static final String SERIALIZED_NAME_PINS_COUNT = "PinsCount"; + @SerializedName(SERIALIZED_NAME_PINS_COUNT) + @javax.annotation.Nullable + private Integer pinsCount; + + public static final String SERIALIZED_NAME_BOARDS_COUNT = "BoardsCount"; + @SerializedName(SERIALIZED_NAME_BOARDS_COUNT) + @javax.annotation.Nullable + private Integer boardsCount; + + public static final String SERIALIZED_NAME_LIKES_COUNT = "LikesCount"; + @SerializedName(SERIALIZED_NAME_LIKES_COUNT) + @javax.annotation.Nullable + private Integer likesCount; + + public static final String SERIALIZED_NAME_SESSION_LIMIT = "SessionLimit"; + @SerializedName(SERIALIZED_NAME_SESSION_LIMIT) + @javax.annotation.Nullable + private Integer sessionLimit; + + public static final String SERIALIZED_NAME_I_D = "ID"; + @SerializedName(SERIALIZED_NAME_I_D) + @javax.annotation.Nullable + private String ID; + + public static final String SERIALIZED_NAME_PASSWORD = "Password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nullable + private String password; + + public static final String SERIALIZED_NAME_LOGIN_LOCKED_TYPE = "LoginLockedType"; + @SerializedName(SERIALIZED_NAME_LOGIN_LOCKED_TYPE) + @javax.annotation.Nullable + private String loginLockedType; + + public static final String SERIALIZED_NAME_PROVIDER = "Provider"; + @SerializedName(SERIALIZED_NAME_PROVIDER) + @javax.annotation.Nullable + private String provider; + + public static final String SERIALIZED_NAME_LAST_PASSWORD_CHANGE_TOKEN = "LastPasswordChangeToken"; + @SerializedName(SERIALIZED_NAME_LAST_PASSWORD_CHANGE_TOKEN) + @javax.annotation.Nullable + private String lastPasswordChangeToken; + + 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_FIRST_NAME = "FirstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nullable + private String firstName; + + public static final String SERIALIZED_NAME_LAST_NAME = "LastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nullable + private String lastName; + + public static final String SERIALIZED_NAME_UID = "Uid"; + @SerializedName(SERIALIZED_NAME_UID) + @javax.annotation.Nullable + private String uid; + + public static final String SERIALIZED_NAME_REGISTRATION_PROVIDER = "RegistrationProvider"; + @SerializedName(SERIALIZED_NAME_REGISTRATION_PROVIDER) + @javax.annotation.Nullable + private String registrationProvider; + + public static final String SERIALIZED_NAME_REGISTRATION_SOURCE = "RegistrationSource"; + @SerializedName(SERIALIZED_NAME_REGISTRATION_SOURCE) + @javax.annotation.Nullable + private String registrationSource; + + public static final String SERIALIZED_NAME_LAST_LOGIN_LOCATION = "LastLoginLocation"; + @SerializedName(SERIALIZED_NAME_LAST_LOGIN_LOCATION) + @javax.annotation.Nullable + private String lastLoginLocation; + + public static final String SERIALIZED_NAME_EXTERNAL_USER_LOGIN_ID = "ExternalUserLoginId"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_USER_LOGIN_ID) + @javax.annotation.Nullable + private String externalUserLoginId; + + public static final String SERIALIZED_NAME_PHONE_ID = "PhoneId"; + @SerializedName(SERIALIZED_NAME_PHONE_ID) + @javax.annotation.Nullable + private String phoneId; + + public static final String SERIALIZED_NAME_USER_NAME = "UserName"; + @SerializedName(SERIALIZED_NAME_USER_NAME) + @javax.annotation.Nullable + private String userName; + + public static final String SERIALIZED_NAME_PREFIX = "Prefix"; + @SerializedName(SERIALIZED_NAME_PREFIX) + @javax.annotation.Nullable + private String prefix; + + public static final String SERIALIZED_NAME_MIDDLE_NAME = "MiddleName"; + @SerializedName(SERIALIZED_NAME_MIDDLE_NAME) + @javax.annotation.Nullable + private String middleName; + + public static final String SERIALIZED_NAME_SUFFIX = "Suffix"; + @SerializedName(SERIALIZED_NAME_SUFFIX) + @javax.annotation.Nullable + private String suffix; + + public static final String SERIALIZED_NAME_NICK_NAME = "NickName"; + @SerializedName(SERIALIZED_NAME_NICK_NAME) + @javax.annotation.Nullable + private String nickName; + + public static final String SERIALIZED_NAME_PROFILE_NAME = "ProfileName"; + @SerializedName(SERIALIZED_NAME_PROFILE_NAME) + @javax.annotation.Nullable + private String profileName; + + public static final String SERIALIZED_NAME_BIRTH_DATE = "BirthDate"; + @SerializedName(SERIALIZED_NAME_BIRTH_DATE) + @javax.annotation.Nullable + private String birthDate; + + public static final String SERIALIZED_NAME_GENDER = "Gender"; + @SerializedName(SERIALIZED_NAME_GENDER) + @javax.annotation.Nullable + private String gender; + + public static final String SERIALIZED_NAME_WEBSITE = "Website"; + @SerializedName(SERIALIZED_NAME_WEBSITE) + @javax.annotation.Nullable + private String website; + + public static final String SERIALIZED_NAME_THUMBNAIL_IMAGE_URL = "ThumbnailImageUrl"; + @SerializedName(SERIALIZED_NAME_THUMBNAIL_IMAGE_URL) + @javax.annotation.Nullable + private String thumbnailImageUrl; + + public static final String SERIALIZED_NAME_IMAGE_URL = "ImageUrl"; + @SerializedName(SERIALIZED_NAME_IMAGE_URL) + @javax.annotation.Nullable + private String imageUrl; + + public static final String SERIALIZED_NAME_FAVICON = "Favicon"; + @SerializedName(SERIALIZED_NAME_FAVICON) + @javax.annotation.Nullable + private String favicon; + + public static final String SERIALIZED_NAME_PROFILE_URL = "ProfileUrl"; + @SerializedName(SERIALIZED_NAME_PROFILE_URL) + @javax.annotation.Nullable + private String profileUrl; + + public static final String SERIALIZED_NAME_HOME_TOWN = "HomeTown"; + @SerializedName(SERIALIZED_NAME_HOME_TOWN) + @javax.annotation.Nullable + private String homeTown; + + public static final String SERIALIZED_NAME_STATE = "State"; + @SerializedName(SERIALIZED_NAME_STATE) + @javax.annotation.Nullable + private String state; + + public static final String SERIALIZED_NAME_CITY = "City"; + @SerializedName(SERIALIZED_NAME_CITY) + @javax.annotation.Nullable + private String city; + + public static final String SERIALIZED_NAME_INDUSTRY = "Industry"; + @SerializedName(SERIALIZED_NAME_INDUSTRY) + @javax.annotation.Nullable + private String industry; + + public static final String SERIALIZED_NAME_ABOUT = "About"; + @SerializedName(SERIALIZED_NAME_ABOUT) + @javax.annotation.Nullable + private String about; + + public static final String SERIALIZED_NAME_TIME_ZONE = "TimeZone"; + @SerializedName(SERIALIZED_NAME_TIME_ZONE) + @javax.annotation.Nullable + private String timeZone; + + public static final String SERIALIZED_NAME_LOCAL_LANGUAGE = "LocalLanguage"; + @SerializedName(SERIALIZED_NAME_LOCAL_LANGUAGE) + @javax.annotation.Nullable + private String localLanguage; + + public static final String SERIALIZED_NAME_COVER_PHOTO = "CoverPhoto"; + @SerializedName(SERIALIZED_NAME_COVER_PHOTO) + @javax.annotation.Nullable + private String coverPhoto; + + public static final String SERIALIZED_NAME_TAG_LINE = "TagLine"; + @SerializedName(SERIALIZED_NAME_TAG_LINE) + @javax.annotation.Nullable + private String tagLine; + + public static final String SERIALIZED_NAME_LANGUAGE = "Language"; + @SerializedName(SERIALIZED_NAME_LANGUAGE) + @javax.annotation.Nullable + private String language; + + public static final String SERIALIZED_NAME_VERIFIED = "Verified"; + @SerializedName(SERIALIZED_NAME_VERIFIED) + @javax.annotation.Nullable + private String verified; + + public static final String SERIALIZED_NAME_UPDATED_TIME = "UpdatedTime"; + @SerializedName(SERIALIZED_NAME_UPDATED_TIME) + @javax.annotation.Nullable + private String updatedTime; + + public static final String SERIALIZED_NAME_IS_GEO_ENABLED = "IsGeoEnabled"; + @SerializedName(SERIALIZED_NAME_IS_GEO_ENABLED) + @javax.annotation.Nullable + private String isGeoEnabled; + + public static final String SERIALIZED_NAME_ASSOCIATIONS = "Associations"; + @SerializedName(SERIALIZED_NAME_ASSOCIATIONS) + @javax.annotation.Nullable + private String associations; + + public static final String SERIALIZED_NAME_HONORS = "Honors"; + @SerializedName(SERIALIZED_NAME_HONORS) + @javax.annotation.Nullable + private String honors; + + public static final String SERIALIZED_NAME_HTTPS_IMAGE_URL = "HttpsImageUrl"; + @SerializedName(SERIALIZED_NAME_HTTPS_IMAGE_URL) + @javax.annotation.Nullable + private String httpsImageUrl; + + public static final String SERIALIZED_NAME_MAIN_ADDRESS = "MainAddress"; + @SerializedName(SERIALIZED_NAME_MAIN_ADDRESS) + @javax.annotation.Nullable + private String mainAddress; + + public static final String SERIALIZED_NAME_CREATED = "Created"; + @SerializedName(SERIALIZED_NAME_CREATED) + @javax.annotation.Nullable + private String created; + + public static final String SERIALIZED_NAME_LOCAL_CITY = "LocalCity"; + @SerializedName(SERIALIZED_NAME_LOCAL_CITY) + @javax.annotation.Nullable + private String localCity; + + public static final String SERIALIZED_NAME_PROFILE_CITY = "ProfileCity"; + @SerializedName(SERIALIZED_NAME_PROFILE_CITY) + @javax.annotation.Nullable + private String profileCity; + + public static final String SERIALIZED_NAME_LOCAL_COUNTRY = "LocalCountry"; + @SerializedName(SERIALIZED_NAME_LOCAL_COUNTRY) + @javax.annotation.Nullable + private String localCountry; + + public static final String SERIALIZED_NAME_PROFILE_COUNTRY = "ProfileCountry"; + @SerializedName(SERIALIZED_NAME_PROFILE_COUNTRY) + @javax.annotation.Nullable + private String profileCountry; + + public static final String SERIALIZED_NAME_RELATIONSHIP_STATUS = "RelationshipStatus"; + @SerializedName(SERIALIZED_NAME_RELATIONSHIP_STATUS) + @javax.annotation.Nullable + private String relationshipStatus; + + public static final String SERIALIZED_NAME_QUOTA = "Quota"; + @SerializedName(SERIALIZED_NAME_QUOTA) + @javax.annotation.Nullable + private String quota; + + public static final String SERIALIZED_NAME_QUOTE = "Quote"; + @SerializedName(SERIALIZED_NAME_QUOTE) + @javax.annotation.Nullable + private String quote; + + public static final String SERIALIZED_NAME_RELIGION = "Religion"; + @SerializedName(SERIALIZED_NAME_RELIGION) + @javax.annotation.Nullable + private String religion; + + public static final String SERIALIZED_NAME_POLITICAL = "Political"; + @SerializedName(SERIALIZED_NAME_POLITICAL) + @javax.annotation.Nullable + private String political; + + public static final String SERIALIZED_NAME_PUBLIC_REPOSITORY = "PublicRepository"; + @SerializedName(SERIALIZED_NAME_PUBLIC_REPOSITORY) + @javax.annotation.Nullable + private String publicRepository; + + public static final String SERIALIZED_NAME_REPOSITORY_URL = "RepositoryUrl"; + @SerializedName(SERIALIZED_NAME_REPOSITORY_URL) + @javax.annotation.Nullable + private String repositoryUrl; + + public static final String SERIALIZED_NAME_AGE = "Age"; + @SerializedName(SERIALIZED_NAME_AGE) + @javax.annotation.Nullable + private String age; + + public static final String SERIALIZED_NAME_PROFESSIONAL_HEADLINE = "ProfessionalHeadline"; + @SerializedName(SERIALIZED_NAME_PROFESSIONAL_HEADLINE) + @javax.annotation.Nullable + private String professionalHeadline; + + public static final String SERIALIZED_NAME_LR_USER_I_D = "LRUserID"; + @SerializedName(SERIALIZED_NAME_LR_USER_I_D) + @javax.annotation.Nullable + private String lrUserID; + + public static final String SERIALIZED_NAME_CURRENCY = "Currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + @javax.annotation.Nullable + private String currency; + + public static final String SERIALIZED_NAME_STARRED_URL = "StarredUrl"; + @SerializedName(SERIALIZED_NAME_STARRED_URL) + @javax.annotation.Nullable + private String starredUrl; + + public static final String SERIALIZED_NAME_GISTS_URL = "GistsUrl"; + @SerializedName(SERIALIZED_NAME_GISTS_URL) + @javax.annotation.Nullable + private String gistsUrl; + + public static final String SERIALIZED_NAME_COMPANY = "Company"; + @SerializedName(SERIALIZED_NAME_COMPANY) + @javax.annotation.Nullable + private String company; + + public static final String SERIALIZED_NAME_GRAVATAR_IMAGE_URL = "GravatarImageUrl"; + @SerializedName(SERIALIZED_NAME_GRAVATAR_IMAGE_URL) + @javax.annotation.Nullable + private String gravatarImageUrl; + + public static final String SERIALIZED_NAME_LAST_PASSWORD_CHANGE_DATE = "LastPasswordChangeDate"; + @SerializedName(SERIALIZED_NAME_LAST_PASSWORD_CHANGE_DATE) + @javax.annotation.Nullable + private OffsetDateTime lastPasswordChangeDate; + + public static final String SERIALIZED_NAME_PASSWORD_EXPIRATION_DATE = "PasswordExpirationDate"; + @SerializedName(SERIALIZED_NAME_PASSWORD_EXPIRATION_DATE) + @javax.annotation.Nullable + private OffsetDateTime passwordExpirationDate; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public static final String SERIALIZED_NAME_MODIFIED_DATE = "ModifiedDate"; + @SerializedName(SERIALIZED_NAME_MODIFIED_DATE) + @javax.annotation.Nullable + private OffsetDateTime modifiedDate; + + public static final String SERIALIZED_NAME_PROFILE_MODIFIED_DATE = "ProfileModifiedDate"; + @SerializedName(SERIALIZED_NAME_PROFILE_MODIFIED_DATE) + @javax.annotation.Nullable + private OffsetDateTime profileModifiedDate; + + public static final String SERIALIZED_NAME_LAST_LOGIN_DATE = "LastLoginDate"; + @SerializedName(SERIALIZED_NAME_LAST_LOGIN_DATE) + @javax.annotation.Nullable + private OffsetDateTime lastLoginDate; + + public static final String SERIALIZED_NAME_SIGNUP_DATE = "SignupDate"; + @SerializedName(SERIALIZED_NAME_SIGNUP_DATE) + @javax.annotation.Nullable + private OffsetDateTime signupDate; + + public static final String SERIALIZED_NAME_PRIVACY_POLICY = "PrivacyPolicy"; + @SerializedName(SERIALIZED_NAME_PRIVACY_POLICY) + @javax.annotation.Nullable + private ProfileWithoutIdentitiesPrivacyPolicy privacyPolicy; + + public static final String SERIALIZED_NAME_COUNTRY = "Country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + @javax.annotation.Nullable + private ProfileRequestModelCountry country; + + public static final String SERIALIZED_NAME_AGE_RANGE = "AgeRange"; + @SerializedName(SERIALIZED_NAME_AGE_RANGE) + @javax.annotation.Nullable + private ProfileRequestModelSubscriptionAgeRange ageRange; + + public static final String SERIALIZED_NAME_KLOUT_SCORE = "KloutScore"; + @SerializedName(SERIALIZED_NAME_KLOUT_SCORE) + @javax.annotation.Nullable + private ProfileWithoutIdentitiesKloutScore kloutScore; + + public static final String SERIALIZED_NAME_SUGGESTIONS = "Suggestions"; + @SerializedName(SERIALIZED_NAME_SUGGESTIONS) + @javax.annotation.Nullable + private ProfileWithoutIdentitiesSuggestions suggestions; + + public static final String SERIALIZED_NAME_SUBSCRIPTION = "Subscription"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION) + @javax.annotation.Nullable + private ProfileWithoutIdentitiesSubscription subscription; + + public static final String SERIALIZED_NAME_P_I_N = "PIN"; + @SerializedName(SERIALIZED_NAME_P_I_N) + @javax.annotation.Nullable + private ProfileWithoutIdentitiesPIN PIN; + + public static final String SERIALIZED_NAME_CONSENT_PROFILE = "ConsentProfile"; + @SerializedName(SERIALIZED_NAME_CONSENT_PROFILE) + @javax.annotation.Nullable + private ProfileWithoutIdentitiesConsentProfile consentProfile; + + public static final String SERIALIZED_NAME_REGISTRATION_DATA = "RegistrationData"; + @SerializedName(SERIALIZED_NAME_REGISTRATION_DATA) + @javax.annotation.Nullable + private ProfileWithoutIdentitiesRegistrationData registrationData; + + public static final String SERIALIZED_NAME_PROVIDER_ACCESS_CREDENTIAL = "ProviderAccessCredential"; + @SerializedName(SERIALIZED_NAME_PROVIDER_ACCESS_CREDENTIAL) + @javax.annotation.Nullable + private ProfileWithoutIdentitiesProviderAccessCredential providerAccessCredential; + + public static final String SERIALIZED_NAME_CUSTOM_FIELDS = "CustomFields"; + @SerializedName(SERIALIZED_NAME_CUSTOM_FIELDS) + @javax.annotation.Nullable + private Map<String, String> customFields = new HashMap<>(); + + public static final String SERIALIZED_NAME_PROFILE_IMAGE_URLS = "ProfileImageUrls"; + @SerializedName(SERIALIZED_NAME_PROFILE_IMAGE_URLS) + @javax.annotation.Nullable + private Map<String, String> profileImageUrls = new HashMap<>(); + + public static final String SERIALIZED_NAME_WEB_PROFILES = "WebProfiles"; + @SerializedName(SERIALIZED_NAME_WEB_PROFILES) + @javax.annotation.Nullable + private Map<String, String> webProfiles = new HashMap<>(); + + public static final String SERIALIZED_NAME_ROLES = "Roles"; + @SerializedName(SERIALIZED_NAME_ROLES) + @javax.annotation.Nullable + private List<String> roles = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PREVIOUS_UIDS = "PreviousUids"; + @SerializedName(SERIALIZED_NAME_PREVIOUS_UIDS) + @javax.annotation.Nullable + private List<String> previousUids = new ArrayList<>(); + + public static final String SERIALIZED_NAME_INTERESTED_IN = "InterestedIn"; + @SerializedName(SERIALIZED_NAME_INTERESTED_IN) + @javax.annotation.Nullable + private List<String> interestedIn = new ArrayList<>(); + + public static final String SERIALIZED_NAME_EXTERNAL_IDS = "ExternalIds"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_IDS) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesExternalIdsInner> externalIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_UNVERIFIED_EMAIL = "UnverifiedEmail"; + @SerializedName(SERIALIZED_NAME_UNVERIFIED_EMAIL) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesUnverifiedEmailInner> unverifiedEmail = new ArrayList<>(); + + public static final String SERIALIZED_NAME_POSITIONS = "Positions"; + @SerializedName(SERIALIZED_NAME_POSITIONS) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesPositionsInner> positions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_EDUCATIONS = "Educations"; + @SerializedName(SERIALIZED_NAME_EDUCATIONS) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesEducationsInner> educations = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PHONE_NUMBERS = "PhoneNumbers"; + @SerializedName(SERIALIZED_NAME_PHONE_NUMBERS) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesPhoneNumbersInner> phoneNumbers = new ArrayList<>(); + + public static final String SERIALIZED_NAME_IM_ACCOUNTS = "IMAccounts"; + @SerializedName(SERIALIZED_NAME_IM_ACCOUNTS) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesIMAccountsInner> imAccounts = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ADDRESSES = "Addresses"; + @SerializedName(SERIALIZED_NAME_ADDRESSES) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesAddressesInner> addresses = new ArrayList<>(); + + public static final String SERIALIZED_NAME_INTERESTS = "Interests"; + @SerializedName(SERIALIZED_NAME_INTERESTS) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesInterestsInner> interests = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SPORTS = "Sports"; + @SerializedName(SERIALIZED_NAME_SPORTS) + @javax.annotation.Nullable + private List<ProfileRequestModelSportsInner> sports = new ArrayList<>(); + + public static final String SERIALIZED_NAME_INSPIRATIONAL_PEOPLE = "InspirationalPeople"; + @SerializedName(SERIALIZED_NAME_INSPIRATIONAL_PEOPLE) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesInspirationalPeopleInner> inspirationalPeople = new ArrayList<>(); + + public static final String SERIALIZED_NAME_AWARDS = "Awards"; + @SerializedName(SERIALIZED_NAME_AWARDS) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesAwardsInner> awards = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SKILLS = "Skills"; + @SerializedName(SERIALIZED_NAME_SKILLS) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesSkillsInner> skills = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CURRENT_STATUS = "CurrentStatus"; + @SerializedName(SERIALIZED_NAME_CURRENT_STATUS) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesCurrentStatusInner> currentStatus = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CERTIFICATIONS = "Certifications"; + @SerializedName(SERIALIZED_NAME_CERTIFICATIONS) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesCertificationsInner> certifications = new ArrayList<>(); + + public static final String SERIALIZED_NAME_COURSES = "Courses"; + @SerializedName(SERIALIZED_NAME_COURSES) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesCoursesInner> courses = new ArrayList<>(); + + public static final String SERIALIZED_NAME_VOLUNTEER = "Volunteer"; + @SerializedName(SERIALIZED_NAME_VOLUNTEER) + @javax.annotation.Nullable + private List<ProfileRequestModelVolunteerInner> volunteer = new ArrayList<>(); + + public static final String SERIALIZED_NAME_RECOMMENDATIONS_RECEIVED = "RecommendationsReceived"; + @SerializedName(SERIALIZED_NAME_RECOMMENDATIONS_RECEIVED) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesRecommendationsReceivedInner> recommendationsReceived = new ArrayList<>(); + + public static final String SERIALIZED_NAME_LANGUAGES = "Languages"; + @SerializedName(SERIALIZED_NAME_LANGUAGES) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesLanguagesInner> languages = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PROJECTS = "Projects"; + @SerializedName(SERIALIZED_NAME_PROJECTS) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesProjectsInner> projects = new ArrayList<>(); + + public static final String SERIALIZED_NAME_GAMES = "Games"; + @SerializedName(SERIALIZED_NAME_GAMES) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesGamesInner> games = new ArrayList<>(); + + public static final String SERIALIZED_NAME_FAMILY = "Family"; + @SerializedName(SERIALIZED_NAME_FAMILY) + @javax.annotation.Nullable + private List<ProfileRequestModelFamilyInner> family = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TELEVISION_SHOW = "TelevisionShow"; + @SerializedName(SERIALIZED_NAME_TELEVISION_SHOW) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesTelevisionShowInner> televisionShow = new ArrayList<>(); + + public static final String SERIALIZED_NAME_MUTUAL_FRIENDS = "MutualFriends"; + @SerializedName(SERIALIZED_NAME_MUTUAL_FRIENDS) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesMutualFriendsInner> mutualFriends = new ArrayList<>(); + + public static final String SERIALIZED_NAME_MOVIES = "Movies"; + @SerializedName(SERIALIZED_NAME_MOVIES) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesMoviesInner> movies = new ArrayList<>(); + + public static final String SERIALIZED_NAME_BOOKS = "Books"; + @SerializedName(SERIALIZED_NAME_BOOKS) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesBooksInner> books = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PATENTS = "Patents"; + @SerializedName(SERIALIZED_NAME_PATENTS) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesPatentsInner> patents = new ArrayList<>(); + + public static final String SERIALIZED_NAME_FAVORITE_THINGS = "FavoriteThings"; + @SerializedName(SERIALIZED_NAME_FAVORITE_THINGS) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesFavoriteThingsInner> favoriteThings = new ArrayList<>(); + + public static final String SERIALIZED_NAME_RELATED_PROFILE_VIEWS = "RelatedProfileViews"; + @SerializedName(SERIALIZED_NAME_RELATED_PROFILE_VIEWS) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesRelatedProfileViewsInner> relatedProfileViews = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PLACES_LIVED = "PlacesLived"; + @SerializedName(SERIALIZED_NAME_PLACES_LIVED) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesPlacesLivedInner> placesLived = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PUBLICATIONS = "Publications"; + @SerializedName(SERIALIZED_NAME_PUBLICATIONS) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesPublicationsInner> publications = new ArrayList<>(); + + public static final String SERIALIZED_NAME_JOB_BOOKMARKS = "JobBookmarks"; + @SerializedName(SERIALIZED_NAME_JOB_BOOKMARKS) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesJobBookmarksInner> jobBookmarks = new ArrayList<>(); + + public static final String SERIALIZED_NAME_BADGES = "Badges"; + @SerializedName(SERIALIZED_NAME_BADGES) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesBadgesInner> badges = new ArrayList<>(); + + public static final String SERIALIZED_NAME_MEMBER_URL_RESOURCES = "MemberUrlResources"; + @SerializedName(SERIALIZED_NAME_MEMBER_URL_RESOURCES) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesMemberUrlResourcesInner> memberUrlResources = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ORGANIZATIONS = "Organizations"; + @SerializedName(SERIALIZED_NAME_ORGANIZATIONS) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesOrganizationsInner> organizations = new ArrayList<>(); + + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesUnverifiedEmailInner> email = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PASSKEY_LOGIN = "PasskeyLogin"; + @SerializedName(SERIALIZED_NAME_PASSKEY_LOGIN) + @javax.annotation.Nullable + private ProfileWithoutIdentitiesPasskeyLogin passkeyLogin; + + public ProfileWithoutIdentities() { + } + + public ProfileWithoutIdentities isPasswordBreached(@javax.annotation.Nullable Boolean isPasswordBreached) { + this.isPasswordBreached = isPasswordBreached; + return this; + } + + /** + * Get isPasswordBreached + * @return isPasswordBreached + */ + @javax.annotation.Nullable + public Boolean getIsPasswordBreached() { + return isPasswordBreached; + } + + public void setIsPasswordBreached(@javax.annotation.Nullable Boolean isPasswordBreached) { + this.isPasswordBreached = isPasswordBreached; + } + + + public ProfileWithoutIdentities isActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Get isActive + * @return isActive + */ + @javax.annotation.Nullable + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + } + + + public ProfileWithoutIdentities isDeleted(@javax.annotation.Nullable Boolean isDeleted) { + this.isDeleted = isDeleted; + return this; + } + + /** + * Get isDeleted + * @return isDeleted + */ + @javax.annotation.Nullable + public Boolean getIsDeleted() { + return isDeleted; + } + + public void setIsDeleted(@javax.annotation.Nullable Boolean isDeleted) { + this.isDeleted = isDeleted; + } + + + public ProfileWithoutIdentities emailVerified(@javax.annotation.Nullable Boolean emailVerified) { + this.emailVerified = emailVerified; + return this; + } + + /** + * Get emailVerified + * @return emailVerified + */ + @javax.annotation.Nullable + public Boolean getEmailVerified() { + return emailVerified; + } + + public void setEmailVerified(@javax.annotation.Nullable Boolean emailVerified) { + this.emailVerified = emailVerified; + } + + + public ProfileWithoutIdentities isLoginLocked(@javax.annotation.Nullable Boolean isLoginLocked) { + this.isLoginLocked = isLoginLocked; + return this; + } + + /** + * Get isLoginLocked + * @return isLoginLocked + */ + @javax.annotation.Nullable + public Boolean getIsLoginLocked() { + return isLoginLocked; + } + + public void setIsLoginLocked(@javax.annotation.Nullable Boolean isLoginLocked) { + this.isLoginLocked = isLoginLocked; + } + + + public ProfileWithoutIdentities isRequiredFieldsFilledOnce(@javax.annotation.Nullable Boolean isRequiredFieldsFilledOnce) { + this.isRequiredFieldsFilledOnce = isRequiredFieldsFilledOnce; + return this; + } + + /** + * Get isRequiredFieldsFilledOnce + * @return isRequiredFieldsFilledOnce + */ + @javax.annotation.Nullable + public Boolean getIsRequiredFieldsFilledOnce() { + return isRequiredFieldsFilledOnce; + } + + public void setIsRequiredFieldsFilledOnce(@javax.annotation.Nullable Boolean isRequiredFieldsFilledOnce) { + this.isRequiredFieldsFilledOnce = isRequiredFieldsFilledOnce; + } + + + public ProfileWithoutIdentities firstLogin(@javax.annotation.Nullable Boolean firstLogin) { + this.firstLogin = firstLogin; + return this; + } + + /** + * Get firstLogin + * @return firstLogin + */ + @javax.annotation.Nullable + public Boolean getFirstLogin() { + return firstLogin; + } + + public void setFirstLogin(@javax.annotation.Nullable Boolean firstLogin) { + this.firstLogin = firstLogin; + } + + + public ProfileWithoutIdentities isProtected(@javax.annotation.Nullable Boolean isProtected) { + this.isProtected = isProtected; + return this; + } + + /** + * Get isProtected + * @return isProtected + */ + @javax.annotation.Nullable + public Boolean getIsProtected() { + return isProtected; + } + + public void setIsProtected(@javax.annotation.Nullable Boolean isProtected) { + this.isProtected = isProtected; + } + + + public ProfileWithoutIdentities hireable(@javax.annotation.Nullable Boolean hireable) { + this.hireable = hireable; + return this; + } + + /** + * Get hireable + * @return hireable + */ + @javax.annotation.Nullable + public Boolean getHireable() { + return hireable; + } + + public void setHireable(@javax.annotation.Nullable Boolean hireable) { + this.hireable = hireable; + } + + + public ProfileWithoutIdentities isSecurePassword(@javax.annotation.Nullable Boolean isSecurePassword) { + this.isSecurePassword = isSecurePassword; + return this; + } + + /** + * Get isSecurePassword + * @return isSecurePassword + */ + @javax.annotation.Nullable + public Boolean getIsSecurePassword() { + return isSecurePassword; + } + + public void setIsSecurePassword(@javax.annotation.Nullable Boolean isSecurePassword) { + this.isSecurePassword = isSecurePassword; + } + + + public ProfileWithoutIdentities isCustomUid(@javax.annotation.Nullable Boolean isCustomUid) { + this.isCustomUid = isCustomUid; + return this; + } + + /** + * Get isCustomUid + * @return isCustomUid + */ + @javax.annotation.Nullable + public Boolean getIsCustomUid() { + return isCustomUid; + } + + public void setIsCustomUid(@javax.annotation.Nullable Boolean isCustomUid) { + this.isCustomUid = isCustomUid; + } + + + public ProfileWithoutIdentities phoneIdVerified(@javax.annotation.Nullable Boolean phoneIdVerified) { + this.phoneIdVerified = phoneIdVerified; + return this; + } + + /** + * Get phoneIdVerified + * @return phoneIdVerified + */ + @javax.annotation.Nullable + public Boolean getPhoneIdVerified() { + return phoneIdVerified; + } + + public void setPhoneIdVerified(@javax.annotation.Nullable Boolean phoneIdVerified) { + this.phoneIdVerified = phoneIdVerified; + } + + + public ProfileWithoutIdentities isEmailSubscribed(@javax.annotation.Nullable Boolean isEmailSubscribed) { + this.isEmailSubscribed = isEmailSubscribed; + return this; + } + + /** + * Get isEmailSubscribed + * @return isEmailSubscribed + */ + @javax.annotation.Nullable + public Boolean getIsEmailSubscribed() { + return isEmailSubscribed; + } + + public void setIsEmailSubscribed(@javax.annotation.Nullable Boolean isEmailSubscribed) { + this.isEmailSubscribed = isEmailSubscribed; + } + + + public ProfileWithoutIdentities noOfLogins(@javax.annotation.Nullable Integer noOfLogins) { + this.noOfLogins = noOfLogins; + return this; + } + + /** + * Get noOfLogins + * @return noOfLogins + */ + @javax.annotation.Nullable + public Integer getNoOfLogins() { + return noOfLogins; + } + + public void setNoOfLogins(@javax.annotation.Nullable Integer noOfLogins) { + this.noOfLogins = noOfLogins; + } + + + public ProfileWithoutIdentities followersCount(@javax.annotation.Nullable Integer followersCount) { + this.followersCount = followersCount; + return this; + } + + /** + * Get followersCount + * @return followersCount + */ + @javax.annotation.Nullable + public Integer getFollowersCount() { + return followersCount; + } + + public void setFollowersCount(@javax.annotation.Nullable Integer followersCount) { + this.followersCount = followersCount; + } + + + public ProfileWithoutIdentities friendsCount(@javax.annotation.Nullable Integer friendsCount) { + this.friendsCount = friendsCount; + return this; + } + + /** + * Get friendsCount + * @return friendsCount + */ + @javax.annotation.Nullable + public Integer getFriendsCount() { + return friendsCount; + } + + public void setFriendsCount(@javax.annotation.Nullable Integer friendsCount) { + this.friendsCount = friendsCount; + } + + + public ProfileWithoutIdentities totalStatusesCount(@javax.annotation.Nullable Integer totalStatusesCount) { + this.totalStatusesCount = totalStatusesCount; + return this; + } + + /** + * Get totalStatusesCount + * @return totalStatusesCount + */ + @javax.annotation.Nullable + public Integer getTotalStatusesCount() { + return totalStatusesCount; + } + + public void setTotalStatusesCount(@javax.annotation.Nullable Integer totalStatusesCount) { + this.totalStatusesCount = totalStatusesCount; + } + + + public ProfileWithoutIdentities numRecommenders(@javax.annotation.Nullable Integer numRecommenders) { + this.numRecommenders = numRecommenders; + return this; + } + + /** + * Get numRecommenders + * @return numRecommenders + */ + @javax.annotation.Nullable + public Integer getNumRecommenders() { + return numRecommenders; + } + + public void setNumRecommenders(@javax.annotation.Nullable Integer numRecommenders) { + this.numRecommenders = numRecommenders; + } + + + public ProfileWithoutIdentities totalPrivateRepository(@javax.annotation.Nullable Integer totalPrivateRepository) { + this.totalPrivateRepository = totalPrivateRepository; + return this; + } + + /** + * Get totalPrivateRepository + * @return totalPrivateRepository + */ + @javax.annotation.Nullable + public Integer getTotalPrivateRepository() { + return totalPrivateRepository; + } + + public void setTotalPrivateRepository(@javax.annotation.Nullable Integer totalPrivateRepository) { + this.totalPrivateRepository = totalPrivateRepository; + } + + + public ProfileWithoutIdentities publicGists(@javax.annotation.Nullable Integer publicGists) { + this.publicGists = publicGists; + return this; + } + + /** + * Get publicGists + * @return publicGists + */ + @javax.annotation.Nullable + public Integer getPublicGists() { + return publicGists; + } + + public void setPublicGists(@javax.annotation.Nullable Integer publicGists) { + this.publicGists = publicGists; + } + + + public ProfileWithoutIdentities privateGists(@javax.annotation.Nullable Integer privateGists) { + this.privateGists = privateGists; + return this; + } + + /** + * Get privateGists + * @return privateGists + */ + @javax.annotation.Nullable + public Integer getPrivateGists() { + return privateGists; + } + + public void setPrivateGists(@javax.annotation.Nullable Integer privateGists) { + this.privateGists = privateGists; + } + + + public ProfileWithoutIdentities pinsCount(@javax.annotation.Nullable Integer pinsCount) { + this.pinsCount = pinsCount; + return this; + } + + /** + * Get pinsCount + * @return pinsCount + */ + @javax.annotation.Nullable + public Integer getPinsCount() { + return pinsCount; + } + + public void setPinsCount(@javax.annotation.Nullable Integer pinsCount) { + this.pinsCount = pinsCount; + } + + + public ProfileWithoutIdentities boardsCount(@javax.annotation.Nullable Integer boardsCount) { + this.boardsCount = boardsCount; + return this; + } + + /** + * Get boardsCount + * @return boardsCount + */ + @javax.annotation.Nullable + public Integer getBoardsCount() { + return boardsCount; + } + + public void setBoardsCount(@javax.annotation.Nullable Integer boardsCount) { + this.boardsCount = boardsCount; + } + + + public ProfileWithoutIdentities likesCount(@javax.annotation.Nullable Integer likesCount) { + this.likesCount = likesCount; + return this; + } + + /** + * Get likesCount + * @return likesCount + */ + @javax.annotation.Nullable + public Integer getLikesCount() { + return likesCount; + } + + public void setLikesCount(@javax.annotation.Nullable Integer likesCount) { + this.likesCount = likesCount; + } + + + public ProfileWithoutIdentities sessionLimit(@javax.annotation.Nullable Integer sessionLimit) { + this.sessionLimit = sessionLimit; + return this; + } + + /** + * Get sessionLimit + * @return sessionLimit + */ + @javax.annotation.Nullable + public Integer getSessionLimit() { + return sessionLimit; + } + + public void setSessionLimit(@javax.annotation.Nullable Integer sessionLimit) { + this.sessionLimit = sessionLimit; + } + + + public ProfileWithoutIdentities ID(@javax.annotation.Nullable String ID) { + this.ID = ID; + return this; + } + + /** + * Get ID + * @return ID + */ + @javax.annotation.Nullable + public String getID() { + return ID; + } + + public void setID(@javax.annotation.Nullable String ID) { + this.ID = ID; + } + + + public ProfileWithoutIdentities password(@javax.annotation.Nullable String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + @javax.annotation.Nullable + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nullable String password) { + this.password = password; + } + + + public ProfileWithoutIdentities loginLockedType(@javax.annotation.Nullable String loginLockedType) { + this.loginLockedType = loginLockedType; + return this; + } + + /** + * Get loginLockedType + * @return loginLockedType + */ + @javax.annotation.Nullable + public String getLoginLockedType() { + return loginLockedType; + } + + public void setLoginLockedType(@javax.annotation.Nullable String loginLockedType) { + this.loginLockedType = loginLockedType; + } + + + public ProfileWithoutIdentities provider(@javax.annotation.Nullable String provider) { + this.provider = provider; + return this; + } + + /** + * Get provider + * @return provider + */ + @javax.annotation.Nullable + public String getProvider() { + return provider; + } + + public void setProvider(@javax.annotation.Nullable String provider) { + this.provider = provider; + } + + + public ProfileWithoutIdentities lastPasswordChangeToken(@javax.annotation.Nullable String lastPasswordChangeToken) { + this.lastPasswordChangeToken = lastPasswordChangeToken; + return this; + } + + /** + * Get lastPasswordChangeToken + * @return lastPasswordChangeToken + */ + @javax.annotation.Nullable + public String getLastPasswordChangeToken() { + return lastPasswordChangeToken; + } + + public void setLastPasswordChangeToken(@javax.annotation.Nullable String lastPasswordChangeToken) { + this.lastPasswordChangeToken = lastPasswordChangeToken; + } + + + public ProfileWithoutIdentities fullName(@javax.annotation.Nullable String fullName) { + this.fullName = fullName; + return this; + } + + /** + * Get fullName + * @return fullName + */ + @javax.annotation.Nullable + public String getFullName() { + return fullName; + } + + public void setFullName(@javax.annotation.Nullable String fullName) { + this.fullName = fullName; + } + + + public ProfileWithoutIdentities firstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + */ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + } + + + public ProfileWithoutIdentities lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + + public ProfileWithoutIdentities uid(@javax.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * Get uid + * @return uid + */ + @javax.annotation.Nullable + public String getUid() { + return uid; + } + + public void setUid(@javax.annotation.Nullable String uid) { + this.uid = uid; + } + + + public ProfileWithoutIdentities registrationProvider(@javax.annotation.Nullable String registrationProvider) { + this.registrationProvider = registrationProvider; + return this; + } + + /** + * Get registrationProvider + * @return registrationProvider + */ + @javax.annotation.Nullable + public String getRegistrationProvider() { + return registrationProvider; + } + + public void setRegistrationProvider(@javax.annotation.Nullable String registrationProvider) { + this.registrationProvider = registrationProvider; + } + + + public ProfileWithoutIdentities registrationSource(@javax.annotation.Nullable String registrationSource) { + this.registrationSource = registrationSource; + return this; + } + + /** + * Get registrationSource + * @return registrationSource + */ + @javax.annotation.Nullable + public String getRegistrationSource() { + return registrationSource; + } + + public void setRegistrationSource(@javax.annotation.Nullable String registrationSource) { + this.registrationSource = registrationSource; + } + + + public ProfileWithoutIdentities lastLoginLocation(@javax.annotation.Nullable String lastLoginLocation) { + this.lastLoginLocation = lastLoginLocation; + return this; + } + + /** + * Get lastLoginLocation + * @return lastLoginLocation + */ + @javax.annotation.Nullable + public String getLastLoginLocation() { + return lastLoginLocation; + } + + public void setLastLoginLocation(@javax.annotation.Nullable String lastLoginLocation) { + this.lastLoginLocation = lastLoginLocation; + } + + + public ProfileWithoutIdentities externalUserLoginId(@javax.annotation.Nullable String externalUserLoginId) { + this.externalUserLoginId = externalUserLoginId; + return this; + } + + /** + * Get externalUserLoginId + * @return externalUserLoginId + */ + @javax.annotation.Nullable + public String getExternalUserLoginId() { + return externalUserLoginId; + } + + public void setExternalUserLoginId(@javax.annotation.Nullable String externalUserLoginId) { + this.externalUserLoginId = externalUserLoginId; + } + + + public ProfileWithoutIdentities phoneId(@javax.annotation.Nullable String phoneId) { + this.phoneId = phoneId; + return this; + } + + /** + * Get phoneId + * @return phoneId + */ + @javax.annotation.Nullable + public String getPhoneId() { + return phoneId; + } + + public void setPhoneId(@javax.annotation.Nullable String phoneId) { + this.phoneId = phoneId; + } + + + public ProfileWithoutIdentities userName(@javax.annotation.Nullable String userName) { + this.userName = userName; + return this; + } + + /** + * Get userName + * @return userName + */ + @javax.annotation.Nullable + public String getUserName() { + return userName; + } + + public void setUserName(@javax.annotation.Nullable String userName) { + this.userName = userName; + } + + + public ProfileWithoutIdentities prefix(@javax.annotation.Nullable String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Get prefix + * @return prefix + */ + @javax.annotation.Nullable + public String getPrefix() { + return prefix; + } + + public void setPrefix(@javax.annotation.Nullable String prefix) { + this.prefix = prefix; + } + + + public ProfileWithoutIdentities middleName(@javax.annotation.Nullable String middleName) { + this.middleName = middleName; + return this; + } + + /** + * Get middleName + * @return middleName + */ + @javax.annotation.Nullable + public String getMiddleName() { + return middleName; + } + + public void setMiddleName(@javax.annotation.Nullable String middleName) { + this.middleName = middleName; + } + + + public ProfileWithoutIdentities suffix(@javax.annotation.Nullable String suffix) { + this.suffix = suffix; + return this; + } + + /** + * Get suffix + * @return suffix + */ + @javax.annotation.Nullable + public String getSuffix() { + return suffix; + } + + public void setSuffix(@javax.annotation.Nullable String suffix) { + this.suffix = suffix; + } + + + public ProfileWithoutIdentities nickName(@javax.annotation.Nullable String nickName) { + this.nickName = nickName; + return this; + } + + /** + * Get nickName + * @return nickName + */ + @javax.annotation.Nullable + public String getNickName() { + return nickName; + } + + public void setNickName(@javax.annotation.Nullable String nickName) { + this.nickName = nickName; + } + + + public ProfileWithoutIdentities profileName(@javax.annotation.Nullable String profileName) { + this.profileName = profileName; + return this; + } + + /** + * Get profileName + * @return profileName + */ + @javax.annotation.Nullable + public String getProfileName() { + return profileName; + } + + public void setProfileName(@javax.annotation.Nullable String profileName) { + this.profileName = profileName; + } + + + public ProfileWithoutIdentities birthDate(@javax.annotation.Nullable String birthDate) { + this.birthDate = birthDate; + return this; + } + + /** + * Get birthDate + * @return birthDate + */ + @javax.annotation.Nullable + public String getBirthDate() { + return birthDate; + } + + public void setBirthDate(@javax.annotation.Nullable String birthDate) { + this.birthDate = birthDate; + } + + + public ProfileWithoutIdentities gender(@javax.annotation.Nullable String gender) { + this.gender = gender; + return this; + } + + /** + * Get gender + * @return gender + */ + @javax.annotation.Nullable + public String getGender() { + return gender; + } + + public void setGender(@javax.annotation.Nullable String gender) { + this.gender = gender; + } + + + public ProfileWithoutIdentities website(@javax.annotation.Nullable String website) { + this.website = website; + return this; + } + + /** + * Get website + * @return website + */ + @javax.annotation.Nullable + public String getWebsite() { + return website; + } + + public void setWebsite(@javax.annotation.Nullable String website) { + this.website = website; + } + + + public ProfileWithoutIdentities thumbnailImageUrl(@javax.annotation.Nullable String thumbnailImageUrl) { + this.thumbnailImageUrl = thumbnailImageUrl; + return this; + } + + /** + * Get thumbnailImageUrl + * @return thumbnailImageUrl + */ + @javax.annotation.Nullable + public String getThumbnailImageUrl() { + return thumbnailImageUrl; + } + + public void setThumbnailImageUrl(@javax.annotation.Nullable String thumbnailImageUrl) { + this.thumbnailImageUrl = thumbnailImageUrl; + } + + + public ProfileWithoutIdentities imageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** + * Get imageUrl + * @return imageUrl + */ + @javax.annotation.Nullable + public String getImageUrl() { + return imageUrl; + } + + public void setImageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + } + + + public ProfileWithoutIdentities favicon(@javax.annotation.Nullable String favicon) { + this.favicon = favicon; + return this; + } + + /** + * Get favicon + * @return favicon + */ + @javax.annotation.Nullable + public String getFavicon() { + return favicon; + } + + public void setFavicon(@javax.annotation.Nullable String favicon) { + this.favicon = favicon; + } + + + public ProfileWithoutIdentities profileUrl(@javax.annotation.Nullable String profileUrl) { + this.profileUrl = profileUrl; + return this; + } + + /** + * Get profileUrl + * @return profileUrl + */ + @javax.annotation.Nullable + public String getProfileUrl() { + return profileUrl; + } + + public void setProfileUrl(@javax.annotation.Nullable String profileUrl) { + this.profileUrl = profileUrl; + } + + + public ProfileWithoutIdentities homeTown(@javax.annotation.Nullable String homeTown) { + this.homeTown = homeTown; + return this; + } + + /** + * Get homeTown + * @return homeTown + */ + @javax.annotation.Nullable + public String getHomeTown() { + return homeTown; + } + + public void setHomeTown(@javax.annotation.Nullable String homeTown) { + this.homeTown = homeTown; + } + + + public ProfileWithoutIdentities state(@javax.annotation.Nullable String state) { + this.state = state; + return this; + } + + /** + * Get state + * @return state + */ + @javax.annotation.Nullable + public String getState() { + return state; + } + + public void setState(@javax.annotation.Nullable String state) { + this.state = state; + } + + + public ProfileWithoutIdentities city(@javax.annotation.Nullable String city) { + this.city = city; + return this; + } + + /** + * Get city + * @return city + */ + @javax.annotation.Nullable + public String getCity() { + return city; + } + + public void setCity(@javax.annotation.Nullable String city) { + this.city = city; + } + + + public ProfileWithoutIdentities industry(@javax.annotation.Nullable String industry) { + this.industry = industry; + return this; + } + + /** + * Get industry + * @return industry + */ + @javax.annotation.Nullable + public String getIndustry() { + return industry; + } + + public void setIndustry(@javax.annotation.Nullable String industry) { + this.industry = industry; + } + + + public ProfileWithoutIdentities about(@javax.annotation.Nullable String about) { + this.about = about; + return this; + } + + /** + * Get about + * @return about + */ + @javax.annotation.Nullable + public String getAbout() { + return about; + } + + public void setAbout(@javax.annotation.Nullable String about) { + this.about = about; + } + + + public ProfileWithoutIdentities timeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * Get timeZone + * @return timeZone + */ + @javax.annotation.Nullable + public String getTimeZone() { + return timeZone; + } + + public void setTimeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + } + + + public ProfileWithoutIdentities localLanguage(@javax.annotation.Nullable String localLanguage) { + this.localLanguage = localLanguage; + return this; + } + + /** + * Get localLanguage + * @return localLanguage + */ + @javax.annotation.Nullable + public String getLocalLanguage() { + return localLanguage; + } + + public void setLocalLanguage(@javax.annotation.Nullable String localLanguage) { + this.localLanguage = localLanguage; + } + + + public ProfileWithoutIdentities coverPhoto(@javax.annotation.Nullable String coverPhoto) { + this.coverPhoto = coverPhoto; + return this; + } + + /** + * Get coverPhoto + * @return coverPhoto + */ + @javax.annotation.Nullable + public String getCoverPhoto() { + return coverPhoto; + } + + public void setCoverPhoto(@javax.annotation.Nullable String coverPhoto) { + this.coverPhoto = coverPhoto; + } + + + public ProfileWithoutIdentities tagLine(@javax.annotation.Nullable String tagLine) { + this.tagLine = tagLine; + return this; + } + + /** + * Get tagLine + * @return tagLine + */ + @javax.annotation.Nullable + public String getTagLine() { + return tagLine; + } + + public void setTagLine(@javax.annotation.Nullable String tagLine) { + this.tagLine = tagLine; + } + + + public ProfileWithoutIdentities language(@javax.annotation.Nullable String language) { + this.language = language; + return this; + } + + /** + * Get language + * @return language + */ + @javax.annotation.Nullable + public String getLanguage() { + return language; + } + + public void setLanguage(@javax.annotation.Nullable String language) { + this.language = language; + } + + + public ProfileWithoutIdentities verified(@javax.annotation.Nullable String verified) { + this.verified = verified; + return this; + } + + /** + * Get verified + * @return verified + */ + @javax.annotation.Nullable + public String getVerified() { + return verified; + } + + public void setVerified(@javax.annotation.Nullable String verified) { + this.verified = verified; + } + + + public ProfileWithoutIdentities updatedTime(@javax.annotation.Nullable String updatedTime) { + this.updatedTime = updatedTime; + return this; + } + + /** + * Get updatedTime + * @return updatedTime + */ + @javax.annotation.Nullable + public String getUpdatedTime() { + return updatedTime; + } + + public void setUpdatedTime(@javax.annotation.Nullable String updatedTime) { + this.updatedTime = updatedTime; + } + + + public ProfileWithoutIdentities isGeoEnabled(@javax.annotation.Nullable String isGeoEnabled) { + this.isGeoEnabled = isGeoEnabled; + return this; + } + + /** + * Get isGeoEnabled + * @return isGeoEnabled + */ + @javax.annotation.Nullable + public String getIsGeoEnabled() { + return isGeoEnabled; + } + + public void setIsGeoEnabled(@javax.annotation.Nullable String isGeoEnabled) { + this.isGeoEnabled = isGeoEnabled; + } + + + public ProfileWithoutIdentities associations(@javax.annotation.Nullable String associations) { + this.associations = associations; + return this; + } + + /** + * Get associations + * @return associations + */ + @javax.annotation.Nullable + public String getAssociations() { + return associations; + } + + public void setAssociations(@javax.annotation.Nullable String associations) { + this.associations = associations; + } + + + public ProfileWithoutIdentities honors(@javax.annotation.Nullable String honors) { + this.honors = honors; + return this; + } + + /** + * Get honors + * @return honors + */ + @javax.annotation.Nullable + public String getHonors() { + return honors; + } + + public void setHonors(@javax.annotation.Nullable String honors) { + this.honors = honors; + } + + + public ProfileWithoutIdentities httpsImageUrl(@javax.annotation.Nullable String httpsImageUrl) { + this.httpsImageUrl = httpsImageUrl; + return this; + } + + /** + * Get httpsImageUrl + * @return httpsImageUrl + */ + @javax.annotation.Nullable + public String getHttpsImageUrl() { + return httpsImageUrl; + } + + public void setHttpsImageUrl(@javax.annotation.Nullable String httpsImageUrl) { + this.httpsImageUrl = httpsImageUrl; + } + + + public ProfileWithoutIdentities mainAddress(@javax.annotation.Nullable String mainAddress) { + this.mainAddress = mainAddress; + return this; + } + + /** + * Get mainAddress + * @return mainAddress + */ + @javax.annotation.Nullable + public String getMainAddress() { + return mainAddress; + } + + public void setMainAddress(@javax.annotation.Nullable String mainAddress) { + this.mainAddress = mainAddress; + } + + + public ProfileWithoutIdentities created(@javax.annotation.Nullable String created) { + this.created = created; + return this; + } + + /** + * Get created + * @return created + */ + @javax.annotation.Nullable + public String getCreated() { + return created; + } + + public void setCreated(@javax.annotation.Nullable String created) { + this.created = created; + } + + + public ProfileWithoutIdentities localCity(@javax.annotation.Nullable String localCity) { + this.localCity = localCity; + return this; + } + + /** + * Get localCity + * @return localCity + */ + @javax.annotation.Nullable + public String getLocalCity() { + return localCity; + } + + public void setLocalCity(@javax.annotation.Nullable String localCity) { + this.localCity = localCity; + } + + + public ProfileWithoutIdentities profileCity(@javax.annotation.Nullable String profileCity) { + this.profileCity = profileCity; + return this; + } + + /** + * Get profileCity + * @return profileCity + */ + @javax.annotation.Nullable + public String getProfileCity() { + return profileCity; + } + + public void setProfileCity(@javax.annotation.Nullable String profileCity) { + this.profileCity = profileCity; + } + + + public ProfileWithoutIdentities localCountry(@javax.annotation.Nullable String localCountry) { + this.localCountry = localCountry; + return this; + } + + /** + * Get localCountry + * @return localCountry + */ + @javax.annotation.Nullable + public String getLocalCountry() { + return localCountry; + } + + public void setLocalCountry(@javax.annotation.Nullable String localCountry) { + this.localCountry = localCountry; + } + + + public ProfileWithoutIdentities profileCountry(@javax.annotation.Nullable String profileCountry) { + this.profileCountry = profileCountry; + return this; + } + + /** + * Get profileCountry + * @return profileCountry + */ + @javax.annotation.Nullable + public String getProfileCountry() { + return profileCountry; + } + + public void setProfileCountry(@javax.annotation.Nullable String profileCountry) { + this.profileCountry = profileCountry; + } + + + public ProfileWithoutIdentities relationshipStatus(@javax.annotation.Nullable String relationshipStatus) { + this.relationshipStatus = relationshipStatus; + return this; + } + + /** + * Get relationshipStatus + * @return relationshipStatus + */ + @javax.annotation.Nullable + public String getRelationshipStatus() { + return relationshipStatus; + } + + public void setRelationshipStatus(@javax.annotation.Nullable String relationshipStatus) { + this.relationshipStatus = relationshipStatus; + } + + + public ProfileWithoutIdentities quota(@javax.annotation.Nullable String quota) { + this.quota = quota; + return this; + } + + /** + * Get quota + * @return quota + */ + @javax.annotation.Nullable + public String getQuota() { + return quota; + } + + public void setQuota(@javax.annotation.Nullable String quota) { + this.quota = quota; + } + + + public ProfileWithoutIdentities quote(@javax.annotation.Nullable String quote) { + this.quote = quote; + return this; + } + + /** + * Get quote + * @return quote + */ + @javax.annotation.Nullable + public String getQuote() { + return quote; + } + + public void setQuote(@javax.annotation.Nullable String quote) { + this.quote = quote; + } + + + public ProfileWithoutIdentities religion(@javax.annotation.Nullable String religion) { + this.religion = religion; + return this; + } + + /** + * Get religion + * @return religion + */ + @javax.annotation.Nullable + public String getReligion() { + return religion; + } + + public void setReligion(@javax.annotation.Nullable String religion) { + this.religion = religion; + } + + + public ProfileWithoutIdentities political(@javax.annotation.Nullable String political) { + this.political = political; + return this; + } + + /** + * Get political + * @return political + */ + @javax.annotation.Nullable + public String getPolitical() { + return political; + } + + public void setPolitical(@javax.annotation.Nullable String political) { + this.political = political; + } + + + public ProfileWithoutIdentities publicRepository(@javax.annotation.Nullable String publicRepository) { + this.publicRepository = publicRepository; + return this; + } + + /** + * Get publicRepository + * @return publicRepository + */ + @javax.annotation.Nullable + public String getPublicRepository() { + return publicRepository; + } + + public void setPublicRepository(@javax.annotation.Nullable String publicRepository) { + this.publicRepository = publicRepository; + } + + + public ProfileWithoutIdentities repositoryUrl(@javax.annotation.Nullable String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + return this; + } + + /** + * Get repositoryUrl + * @return repositoryUrl + */ + @javax.annotation.Nullable + public String getRepositoryUrl() { + return repositoryUrl; + } + + public void setRepositoryUrl(@javax.annotation.Nullable String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + } + + + public ProfileWithoutIdentities age(@javax.annotation.Nullable String age) { + this.age = age; + return this; + } + + /** + * Get age + * @return age + */ + @javax.annotation.Nullable + public String getAge() { + return age; + } + + public void setAge(@javax.annotation.Nullable String age) { + this.age = age; + } + + + public ProfileWithoutIdentities professionalHeadline(@javax.annotation.Nullable String professionalHeadline) { + this.professionalHeadline = professionalHeadline; + return this; + } + + /** + * Get professionalHeadline + * @return professionalHeadline + */ + @javax.annotation.Nullable + public String getProfessionalHeadline() { + return professionalHeadline; + } + + public void setProfessionalHeadline(@javax.annotation.Nullable String professionalHeadline) { + this.professionalHeadline = professionalHeadline; + } + + + public ProfileWithoutIdentities lrUserID(@javax.annotation.Nullable String lrUserID) { + this.lrUserID = lrUserID; + return this; + } + + /** + * Get lrUserID + * @return lrUserID + */ + @javax.annotation.Nullable + public String getLrUserID() { + return lrUserID; + } + + public void setLrUserID(@javax.annotation.Nullable String lrUserID) { + this.lrUserID = lrUserID; + } + + + public ProfileWithoutIdentities currency(@javax.annotation.Nullable String currency) { + this.currency = currency; + return this; + } + + /** + * Get currency + * @return currency + */ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + public void setCurrency(@javax.annotation.Nullable String currency) { + this.currency = currency; + } + + + public ProfileWithoutIdentities starredUrl(@javax.annotation.Nullable String starredUrl) { + this.starredUrl = starredUrl; + return this; + } + + /** + * Get starredUrl + * @return starredUrl + */ + @javax.annotation.Nullable + public String getStarredUrl() { + return starredUrl; + } + + public void setStarredUrl(@javax.annotation.Nullable String starredUrl) { + this.starredUrl = starredUrl; + } + + + public ProfileWithoutIdentities gistsUrl(@javax.annotation.Nullable String gistsUrl) { + this.gistsUrl = gistsUrl; + return this; + } + + /** + * Get gistsUrl + * @return gistsUrl + */ + @javax.annotation.Nullable + public String getGistsUrl() { + return gistsUrl; + } + + public void setGistsUrl(@javax.annotation.Nullable String gistsUrl) { + this.gistsUrl = gistsUrl; + } + + + public ProfileWithoutIdentities company(@javax.annotation.Nullable String company) { + this.company = company; + return this; + } + + /** + * Get company + * @return company + */ + @javax.annotation.Nullable + public String getCompany() { + return company; + } + + public void setCompany(@javax.annotation.Nullable String company) { + this.company = company; + } + + + public ProfileWithoutIdentities gravatarImageUrl(@javax.annotation.Nullable String gravatarImageUrl) { + this.gravatarImageUrl = gravatarImageUrl; + return this; + } + + /** + * Get gravatarImageUrl + * @return gravatarImageUrl + */ + @javax.annotation.Nullable + public String getGravatarImageUrl() { + return gravatarImageUrl; + } + + public void setGravatarImageUrl(@javax.annotation.Nullable String gravatarImageUrl) { + this.gravatarImageUrl = gravatarImageUrl; + } + + + public ProfileWithoutIdentities lastPasswordChangeDate(@javax.annotation.Nullable OffsetDateTime lastPasswordChangeDate) { + this.lastPasswordChangeDate = lastPasswordChangeDate; + return this; + } + + /** + * Get lastPasswordChangeDate + * @return lastPasswordChangeDate + */ + @javax.annotation.Nullable + public OffsetDateTime getLastPasswordChangeDate() { + return lastPasswordChangeDate; + } + + public void setLastPasswordChangeDate(@javax.annotation.Nullable OffsetDateTime lastPasswordChangeDate) { + this.lastPasswordChangeDate = lastPasswordChangeDate; + } + + + public ProfileWithoutIdentities passwordExpirationDate(@javax.annotation.Nullable OffsetDateTime passwordExpirationDate) { + this.passwordExpirationDate = passwordExpirationDate; + return this; + } + + /** + * Get passwordExpirationDate + * @return passwordExpirationDate + */ + @javax.annotation.Nullable + public OffsetDateTime getPasswordExpirationDate() { + return passwordExpirationDate; + } + + public void setPasswordExpirationDate(@javax.annotation.Nullable OffsetDateTime passwordExpirationDate) { + this.passwordExpirationDate = passwordExpirationDate; + } + + + public ProfileWithoutIdentities createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get createdDate + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + + public ProfileWithoutIdentities modifiedDate(@javax.annotation.Nullable OffsetDateTime modifiedDate) { + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Get modifiedDate + * @return modifiedDate + */ + @javax.annotation.Nullable + public OffsetDateTime getModifiedDate() { + return modifiedDate; + } + + public void setModifiedDate(@javax.annotation.Nullable OffsetDateTime modifiedDate) { + this.modifiedDate = modifiedDate; + } + + + public ProfileWithoutIdentities profileModifiedDate(@javax.annotation.Nullable OffsetDateTime profileModifiedDate) { + this.profileModifiedDate = profileModifiedDate; + return this; + } + + /** + * Get profileModifiedDate + * @return profileModifiedDate + */ + @javax.annotation.Nullable + public OffsetDateTime getProfileModifiedDate() { + return profileModifiedDate; + } + + public void setProfileModifiedDate(@javax.annotation.Nullable OffsetDateTime profileModifiedDate) { + this.profileModifiedDate = profileModifiedDate; + } + + + public ProfileWithoutIdentities lastLoginDate(@javax.annotation.Nullable OffsetDateTime lastLoginDate) { + this.lastLoginDate = lastLoginDate; + return this; + } + + /** + * Get lastLoginDate + * @return lastLoginDate + */ + @javax.annotation.Nullable + public OffsetDateTime getLastLoginDate() { + return lastLoginDate; + } + + public void setLastLoginDate(@javax.annotation.Nullable OffsetDateTime lastLoginDate) { + this.lastLoginDate = lastLoginDate; + } + + + public ProfileWithoutIdentities signupDate(@javax.annotation.Nullable OffsetDateTime signupDate) { + this.signupDate = signupDate; + return this; + } + + /** + * Get signupDate + * @return signupDate + */ + @javax.annotation.Nullable + public OffsetDateTime getSignupDate() { + return signupDate; + } + + public void setSignupDate(@javax.annotation.Nullable OffsetDateTime signupDate) { + this.signupDate = signupDate; + } + + + public ProfileWithoutIdentities privacyPolicy(@javax.annotation.Nullable ProfileWithoutIdentitiesPrivacyPolicy privacyPolicy) { + this.privacyPolicy = privacyPolicy; + return this; + } + + /** + * Get privacyPolicy + * @return privacyPolicy + */ + @javax.annotation.Nullable + public ProfileWithoutIdentitiesPrivacyPolicy getPrivacyPolicy() { + return privacyPolicy; + } + + public void setPrivacyPolicy(@javax.annotation.Nullable ProfileWithoutIdentitiesPrivacyPolicy privacyPolicy) { + this.privacyPolicy = privacyPolicy; + } + + + public ProfileWithoutIdentities country(@javax.annotation.Nullable ProfileRequestModelCountry country) { + this.country = country; + return this; + } + + /** + * Get country + * @return country + */ + @javax.annotation.Nullable + public ProfileRequestModelCountry getCountry() { + return country; + } + + public void setCountry(@javax.annotation.Nullable ProfileRequestModelCountry country) { + this.country = country; + } + + + public ProfileWithoutIdentities ageRange(@javax.annotation.Nullable ProfileRequestModelSubscriptionAgeRange ageRange) { + this.ageRange = ageRange; + return this; + } + + /** + * Get ageRange + * @return ageRange + */ + @javax.annotation.Nullable + public ProfileRequestModelSubscriptionAgeRange getAgeRange() { + return ageRange; + } + + public void setAgeRange(@javax.annotation.Nullable ProfileRequestModelSubscriptionAgeRange ageRange) { + this.ageRange = ageRange; + } + + + public ProfileWithoutIdentities kloutScore(@javax.annotation.Nullable ProfileWithoutIdentitiesKloutScore kloutScore) { + this.kloutScore = kloutScore; + return this; + } + + /** + * Get kloutScore + * @return kloutScore + */ + @javax.annotation.Nullable + public ProfileWithoutIdentitiesKloutScore getKloutScore() { + return kloutScore; + } + + public void setKloutScore(@javax.annotation.Nullable ProfileWithoutIdentitiesKloutScore kloutScore) { + this.kloutScore = kloutScore; + } + + + public ProfileWithoutIdentities suggestions(@javax.annotation.Nullable ProfileWithoutIdentitiesSuggestions suggestions) { + this.suggestions = suggestions; + return this; + } + + /** + * Get suggestions + * @return suggestions + */ + @javax.annotation.Nullable + public ProfileWithoutIdentitiesSuggestions getSuggestions() { + return suggestions; + } + + public void setSuggestions(@javax.annotation.Nullable ProfileWithoutIdentitiesSuggestions suggestions) { + this.suggestions = suggestions; + } + + + public ProfileWithoutIdentities subscription(@javax.annotation.Nullable ProfileWithoutIdentitiesSubscription subscription) { + this.subscription = subscription; + return this; + } + + /** + * Get subscription + * @return subscription + */ + @javax.annotation.Nullable + public ProfileWithoutIdentitiesSubscription getSubscription() { + return subscription; + } + + public void setSubscription(@javax.annotation.Nullable ProfileWithoutIdentitiesSubscription subscription) { + this.subscription = subscription; + } + + + public ProfileWithoutIdentities PIN(@javax.annotation.Nullable ProfileWithoutIdentitiesPIN PIN) { + this.PIN = PIN; + return this; + } + + /** + * Get PIN + * @return PIN + */ + @javax.annotation.Nullable + public ProfileWithoutIdentitiesPIN getPIN() { + return PIN; + } + + public void setPIN(@javax.annotation.Nullable ProfileWithoutIdentitiesPIN PIN) { + this.PIN = PIN; + } + + + public ProfileWithoutIdentities consentProfile(@javax.annotation.Nullable ProfileWithoutIdentitiesConsentProfile consentProfile) { + this.consentProfile = consentProfile; + return this; + } + + /** + * Get consentProfile + * @return consentProfile + */ + @javax.annotation.Nullable + public ProfileWithoutIdentitiesConsentProfile getConsentProfile() { + return consentProfile; + } + + public void setConsentProfile(@javax.annotation.Nullable ProfileWithoutIdentitiesConsentProfile consentProfile) { + this.consentProfile = consentProfile; + } + + + public ProfileWithoutIdentities registrationData(@javax.annotation.Nullable ProfileWithoutIdentitiesRegistrationData registrationData) { + this.registrationData = registrationData; + return this; + } + + /** + * Get registrationData + * @return registrationData + */ + @javax.annotation.Nullable + public ProfileWithoutIdentitiesRegistrationData getRegistrationData() { + return registrationData; + } + + public void setRegistrationData(@javax.annotation.Nullable ProfileWithoutIdentitiesRegistrationData registrationData) { + this.registrationData = registrationData; + } + + + public ProfileWithoutIdentities providerAccessCredential(@javax.annotation.Nullable ProfileWithoutIdentitiesProviderAccessCredential providerAccessCredential) { + this.providerAccessCredential = providerAccessCredential; + return this; + } + + /** + * Get providerAccessCredential + * @return providerAccessCredential + */ + @javax.annotation.Nullable + public ProfileWithoutIdentitiesProviderAccessCredential getProviderAccessCredential() { + return providerAccessCredential; + } + + public void setProviderAccessCredential(@javax.annotation.Nullable ProfileWithoutIdentitiesProviderAccessCredential providerAccessCredential) { + this.providerAccessCredential = providerAccessCredential; + } + + + public ProfileWithoutIdentities customFields(@javax.annotation.Nullable Map<String, String> customFields) { + this.customFields = customFields; + return this; + } + + public ProfileWithoutIdentities putCustomFieldsItem(String key, String customFieldsItem) { + if (this.customFields == null) { + this.customFields = new HashMap<>(); + } + this.customFields.put(key, customFieldsItem); + return this; + } + + /** + * Get customFields + * @return customFields + */ + @javax.annotation.Nullable + public Map<String, String> getCustomFields() { + return customFields; + } + + public void setCustomFields(@javax.annotation.Nullable Map<String, String> customFields) { + this.customFields = customFields; + } + + + public ProfileWithoutIdentities profileImageUrls(@javax.annotation.Nullable Map<String, String> profileImageUrls) { + this.profileImageUrls = profileImageUrls; + return this; + } + + public ProfileWithoutIdentities putProfileImageUrlsItem(String key, String profileImageUrlsItem) { + if (this.profileImageUrls == null) { + this.profileImageUrls = new HashMap<>(); + } + this.profileImageUrls.put(key, profileImageUrlsItem); + return this; + } + + /** + * Get profileImageUrls + * @return profileImageUrls + */ + @javax.annotation.Nullable + public Map<String, String> getProfileImageUrls() { + return profileImageUrls; + } + + public void setProfileImageUrls(@javax.annotation.Nullable Map<String, String> profileImageUrls) { + this.profileImageUrls = profileImageUrls; + } + + + public ProfileWithoutIdentities webProfiles(@javax.annotation.Nullable Map<String, String> webProfiles) { + this.webProfiles = webProfiles; + return this; + } + + public ProfileWithoutIdentities putWebProfilesItem(String key, String webProfilesItem) { + if (this.webProfiles == null) { + this.webProfiles = new HashMap<>(); + } + this.webProfiles.put(key, webProfilesItem); + return this; + } + + /** + * Get webProfiles + * @return webProfiles + */ + @javax.annotation.Nullable + public Map<String, String> getWebProfiles() { + return webProfiles; + } + + public void setWebProfiles(@javax.annotation.Nullable Map<String, String> webProfiles) { + this.webProfiles = webProfiles; + } + + + public ProfileWithoutIdentities roles(@javax.annotation.Nullable List<String> roles) { + this.roles = roles; + return this; + } + + public ProfileWithoutIdentities addRolesItem(String rolesItem) { + if (this.roles == null) { + this.roles = new ArrayList<>(); + } + this.roles.add(rolesItem); + return this; + } + + /** + * Get roles + * @return roles + */ + @javax.annotation.Nullable + public List<String> getRoles() { + return roles; + } + + public void setRoles(@javax.annotation.Nullable List<String> roles) { + this.roles = roles; + } + + + public ProfileWithoutIdentities previousUids(@javax.annotation.Nullable List<String> previousUids) { + this.previousUids = previousUids; + return this; + } + + public ProfileWithoutIdentities addPreviousUidsItem(String previousUidsItem) { + if (this.previousUids == null) { + this.previousUids = new ArrayList<>(); + } + this.previousUids.add(previousUidsItem); + return this; + } + + /** + * Get previousUids + * @return previousUids + */ + @javax.annotation.Nullable + public List<String> getPreviousUids() { + return previousUids; + } + + public void setPreviousUids(@javax.annotation.Nullable List<String> previousUids) { + this.previousUids = previousUids; + } + + + public ProfileWithoutIdentities interestedIn(@javax.annotation.Nullable List<String> interestedIn) { + this.interestedIn = interestedIn; + return this; + } + + public ProfileWithoutIdentities addInterestedInItem(String interestedInItem) { + if (this.interestedIn == null) { + this.interestedIn = new ArrayList<>(); + } + this.interestedIn.add(interestedInItem); + return this; + } + + /** + * Get interestedIn + * @return interestedIn + */ + @javax.annotation.Nullable + public List<String> getInterestedIn() { + return interestedIn; + } + + public void setInterestedIn(@javax.annotation.Nullable List<String> interestedIn) { + this.interestedIn = interestedIn; + } + + + public ProfileWithoutIdentities externalIds(@javax.annotation.Nullable List<ProfileWithoutIdentitiesExternalIdsInner> externalIds) { + this.externalIds = externalIds; + return this; + } + + public ProfileWithoutIdentities addExternalIdsItem(ProfileWithoutIdentitiesExternalIdsInner externalIdsItem) { + if (this.externalIds == null) { + this.externalIds = new ArrayList<>(); + } + this.externalIds.add(externalIdsItem); + return this; + } + + /** + * Get externalIds + * @return externalIds + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesExternalIdsInner> getExternalIds() { + return externalIds; + } + + public void setExternalIds(@javax.annotation.Nullable List<ProfileWithoutIdentitiesExternalIdsInner> externalIds) { + this.externalIds = externalIds; + } + + + public ProfileWithoutIdentities unverifiedEmail(@javax.annotation.Nullable List<ProfileWithoutIdentitiesUnverifiedEmailInner> unverifiedEmail) { + this.unverifiedEmail = unverifiedEmail; + return this; + } + + public ProfileWithoutIdentities addUnverifiedEmailItem(ProfileWithoutIdentitiesUnverifiedEmailInner unverifiedEmailItem) { + if (this.unverifiedEmail == null) { + this.unverifiedEmail = new ArrayList<>(); + } + this.unverifiedEmail.add(unverifiedEmailItem); + return this; + } + + /** + * Get unverifiedEmail + * @return unverifiedEmail + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesUnverifiedEmailInner> getUnverifiedEmail() { + return unverifiedEmail; + } + + public void setUnverifiedEmail(@javax.annotation.Nullable List<ProfileWithoutIdentitiesUnverifiedEmailInner> unverifiedEmail) { + this.unverifiedEmail = unverifiedEmail; + } + + + public ProfileWithoutIdentities positions(@javax.annotation.Nullable List<ProfileWithoutIdentitiesPositionsInner> positions) { + this.positions = positions; + return this; + } + + public ProfileWithoutIdentities addPositionsItem(ProfileWithoutIdentitiesPositionsInner positionsItem) { + if (this.positions == null) { + this.positions = new ArrayList<>(); + } + this.positions.add(positionsItem); + return this; + } + + /** + * Get positions + * @return positions + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesPositionsInner> getPositions() { + return positions; + } + + public void setPositions(@javax.annotation.Nullable List<ProfileWithoutIdentitiesPositionsInner> positions) { + this.positions = positions; + } + + + public ProfileWithoutIdentities educations(@javax.annotation.Nullable List<ProfileWithoutIdentitiesEducationsInner> educations) { + this.educations = educations; + return this; + } + + public ProfileWithoutIdentities addEducationsItem(ProfileWithoutIdentitiesEducationsInner educationsItem) { + if (this.educations == null) { + this.educations = new ArrayList<>(); + } + this.educations.add(educationsItem); + return this; + } + + /** + * Get educations + * @return educations + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesEducationsInner> getEducations() { + return educations; + } + + public void setEducations(@javax.annotation.Nullable List<ProfileWithoutIdentitiesEducationsInner> educations) { + this.educations = educations; + } + + + public ProfileWithoutIdentities phoneNumbers(@javax.annotation.Nullable List<ProfileWithoutIdentitiesPhoneNumbersInner> phoneNumbers) { + this.phoneNumbers = phoneNumbers; + return this; + } + + public ProfileWithoutIdentities addPhoneNumbersItem(ProfileWithoutIdentitiesPhoneNumbersInner phoneNumbersItem) { + if (this.phoneNumbers == null) { + this.phoneNumbers = new ArrayList<>(); + } + this.phoneNumbers.add(phoneNumbersItem); + return this; + } + + /** + * Get phoneNumbers + * @return phoneNumbers + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesPhoneNumbersInner> getPhoneNumbers() { + return phoneNumbers; + } + + public void setPhoneNumbers(@javax.annotation.Nullable List<ProfileWithoutIdentitiesPhoneNumbersInner> phoneNumbers) { + this.phoneNumbers = phoneNumbers; + } + + + public ProfileWithoutIdentities imAccounts(@javax.annotation.Nullable List<ProfileWithoutIdentitiesIMAccountsInner> imAccounts) { + this.imAccounts = imAccounts; + return this; + } + + public ProfileWithoutIdentities addImAccountsItem(ProfileWithoutIdentitiesIMAccountsInner imAccountsItem) { + if (this.imAccounts == null) { + this.imAccounts = new ArrayList<>(); + } + this.imAccounts.add(imAccountsItem); + return this; + } + + /** + * Get imAccounts + * @return imAccounts + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesIMAccountsInner> getImAccounts() { + return imAccounts; + } + + public void setImAccounts(@javax.annotation.Nullable List<ProfileWithoutIdentitiesIMAccountsInner> imAccounts) { + this.imAccounts = imAccounts; + } + + + public ProfileWithoutIdentities addresses(@javax.annotation.Nullable List<ProfileWithoutIdentitiesAddressesInner> addresses) { + this.addresses = addresses; + return this; + } + + public ProfileWithoutIdentities addAddressesItem(ProfileWithoutIdentitiesAddressesInner addressesItem) { + if (this.addresses == null) { + this.addresses = new ArrayList<>(); + } + this.addresses.add(addressesItem); + return this; + } + + /** + * Get addresses + * @return addresses + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesAddressesInner> getAddresses() { + return addresses; + } + + public void setAddresses(@javax.annotation.Nullable List<ProfileWithoutIdentitiesAddressesInner> addresses) { + this.addresses = addresses; + } + + + public ProfileWithoutIdentities interests(@javax.annotation.Nullable List<ProfileWithoutIdentitiesInterestsInner> interests) { + this.interests = interests; + return this; + } + + public ProfileWithoutIdentities addInterestsItem(ProfileWithoutIdentitiesInterestsInner interestsItem) { + if (this.interests == null) { + this.interests = new ArrayList<>(); + } + this.interests.add(interestsItem); + return this; + } + + /** + * Get interests + * @return interests + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesInterestsInner> getInterests() { + return interests; + } + + public void setInterests(@javax.annotation.Nullable List<ProfileWithoutIdentitiesInterestsInner> interests) { + this.interests = interests; + } + + + public ProfileWithoutIdentities sports(@javax.annotation.Nullable List<ProfileRequestModelSportsInner> sports) { + this.sports = sports; + return this; + } + + public ProfileWithoutIdentities addSportsItem(ProfileRequestModelSportsInner sportsItem) { + if (this.sports == null) { + this.sports = new ArrayList<>(); + } + this.sports.add(sportsItem); + return this; + } + + /** + * Get sports + * @return sports + */ + @javax.annotation.Nullable + public List<ProfileRequestModelSportsInner> getSports() { + return sports; + } + + public void setSports(@javax.annotation.Nullable List<ProfileRequestModelSportsInner> sports) { + this.sports = sports; + } + + + public ProfileWithoutIdentities inspirationalPeople(@javax.annotation.Nullable List<ProfileWithoutIdentitiesInspirationalPeopleInner> inspirationalPeople) { + this.inspirationalPeople = inspirationalPeople; + return this; + } + + public ProfileWithoutIdentities addInspirationalPeopleItem(ProfileWithoutIdentitiesInspirationalPeopleInner inspirationalPeopleItem) { + if (this.inspirationalPeople == null) { + this.inspirationalPeople = new ArrayList<>(); + } + this.inspirationalPeople.add(inspirationalPeopleItem); + return this; + } + + /** + * Get inspirationalPeople + * @return inspirationalPeople + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesInspirationalPeopleInner> getInspirationalPeople() { + return inspirationalPeople; + } + + public void setInspirationalPeople(@javax.annotation.Nullable List<ProfileWithoutIdentitiesInspirationalPeopleInner> inspirationalPeople) { + this.inspirationalPeople = inspirationalPeople; + } + + + public ProfileWithoutIdentities awards(@javax.annotation.Nullable List<ProfileWithoutIdentitiesAwardsInner> awards) { + this.awards = awards; + return this; + } + + public ProfileWithoutIdentities addAwardsItem(ProfileWithoutIdentitiesAwardsInner awardsItem) { + if (this.awards == null) { + this.awards = new ArrayList<>(); + } + this.awards.add(awardsItem); + return this; + } + + /** + * Get awards + * @return awards + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesAwardsInner> getAwards() { + return awards; + } + + public void setAwards(@javax.annotation.Nullable List<ProfileWithoutIdentitiesAwardsInner> awards) { + this.awards = awards; + } + + + public ProfileWithoutIdentities skills(@javax.annotation.Nullable List<ProfileWithoutIdentitiesSkillsInner> skills) { + this.skills = skills; + return this; + } + + public ProfileWithoutIdentities addSkillsItem(ProfileWithoutIdentitiesSkillsInner skillsItem) { + if (this.skills == null) { + this.skills = new ArrayList<>(); + } + this.skills.add(skillsItem); + return this; + } + + /** + * Get skills + * @return skills + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesSkillsInner> getSkills() { + return skills; + } + + public void setSkills(@javax.annotation.Nullable List<ProfileWithoutIdentitiesSkillsInner> skills) { + this.skills = skills; + } + + + public ProfileWithoutIdentities currentStatus(@javax.annotation.Nullable List<ProfileWithoutIdentitiesCurrentStatusInner> currentStatus) { + this.currentStatus = currentStatus; + return this; + } + + public ProfileWithoutIdentities addCurrentStatusItem(ProfileWithoutIdentitiesCurrentStatusInner currentStatusItem) { + if (this.currentStatus == null) { + this.currentStatus = new ArrayList<>(); + } + this.currentStatus.add(currentStatusItem); + return this; + } + + /** + * Get currentStatus + * @return currentStatus + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesCurrentStatusInner> getCurrentStatus() { + return currentStatus; + } + + public void setCurrentStatus(@javax.annotation.Nullable List<ProfileWithoutIdentitiesCurrentStatusInner> currentStatus) { + this.currentStatus = currentStatus; + } + + + public ProfileWithoutIdentities certifications(@javax.annotation.Nullable List<ProfileWithoutIdentitiesCertificationsInner> certifications) { + this.certifications = certifications; + return this; + } + + public ProfileWithoutIdentities addCertificationsItem(ProfileWithoutIdentitiesCertificationsInner certificationsItem) { + if (this.certifications == null) { + this.certifications = new ArrayList<>(); + } + this.certifications.add(certificationsItem); + return this; + } + + /** + * Get certifications + * @return certifications + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesCertificationsInner> getCertifications() { + return certifications; + } + + public void setCertifications(@javax.annotation.Nullable List<ProfileWithoutIdentitiesCertificationsInner> certifications) { + this.certifications = certifications; + } + + + public ProfileWithoutIdentities courses(@javax.annotation.Nullable List<ProfileWithoutIdentitiesCoursesInner> courses) { + this.courses = courses; + return this; + } + + public ProfileWithoutIdentities addCoursesItem(ProfileWithoutIdentitiesCoursesInner coursesItem) { + if (this.courses == null) { + this.courses = new ArrayList<>(); + } + this.courses.add(coursesItem); + return this; + } + + /** + * Get courses + * @return courses + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesCoursesInner> getCourses() { + return courses; + } + + public void setCourses(@javax.annotation.Nullable List<ProfileWithoutIdentitiesCoursesInner> courses) { + this.courses = courses; + } + + + public ProfileWithoutIdentities volunteer(@javax.annotation.Nullable List<ProfileRequestModelVolunteerInner> volunteer) { + this.volunteer = volunteer; + return this; + } + + public ProfileWithoutIdentities addVolunteerItem(ProfileRequestModelVolunteerInner volunteerItem) { + if (this.volunteer == null) { + this.volunteer = new ArrayList<>(); + } + this.volunteer.add(volunteerItem); + return this; + } + + /** + * Get volunteer + * @return volunteer + */ + @javax.annotation.Nullable + public List<ProfileRequestModelVolunteerInner> getVolunteer() { + return volunteer; + } + + public void setVolunteer(@javax.annotation.Nullable List<ProfileRequestModelVolunteerInner> volunteer) { + this.volunteer = volunteer; + } + + + public ProfileWithoutIdentities recommendationsReceived(@javax.annotation.Nullable List<ProfileWithoutIdentitiesRecommendationsReceivedInner> recommendationsReceived) { + this.recommendationsReceived = recommendationsReceived; + return this; + } + + public ProfileWithoutIdentities addRecommendationsReceivedItem(ProfileWithoutIdentitiesRecommendationsReceivedInner recommendationsReceivedItem) { + if (this.recommendationsReceived == null) { + this.recommendationsReceived = new ArrayList<>(); + } + this.recommendationsReceived.add(recommendationsReceivedItem); + return this; + } + + /** + * Get recommendationsReceived + * @return recommendationsReceived + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesRecommendationsReceivedInner> getRecommendationsReceived() { + return recommendationsReceived; + } + + public void setRecommendationsReceived(@javax.annotation.Nullable List<ProfileWithoutIdentitiesRecommendationsReceivedInner> recommendationsReceived) { + this.recommendationsReceived = recommendationsReceived; + } + + + public ProfileWithoutIdentities languages(@javax.annotation.Nullable List<ProfileWithoutIdentitiesLanguagesInner> languages) { + this.languages = languages; + return this; + } + + public ProfileWithoutIdentities addLanguagesItem(ProfileWithoutIdentitiesLanguagesInner languagesItem) { + if (this.languages == null) { + this.languages = new ArrayList<>(); + } + this.languages.add(languagesItem); + return this; + } + + /** + * Get languages + * @return languages + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesLanguagesInner> getLanguages() { + return languages; + } + + public void setLanguages(@javax.annotation.Nullable List<ProfileWithoutIdentitiesLanguagesInner> languages) { + this.languages = languages; + } + + + public ProfileWithoutIdentities projects(@javax.annotation.Nullable List<ProfileWithoutIdentitiesProjectsInner> projects) { + this.projects = projects; + return this; + } + + public ProfileWithoutIdentities addProjectsItem(ProfileWithoutIdentitiesProjectsInner projectsItem) { + if (this.projects == null) { + this.projects = new ArrayList<>(); + } + this.projects.add(projectsItem); + return this; + } + + /** + * Get projects + * @return projects + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesProjectsInner> getProjects() { + return projects; + } + + public void setProjects(@javax.annotation.Nullable List<ProfileWithoutIdentitiesProjectsInner> projects) { + this.projects = projects; + } + + + public ProfileWithoutIdentities games(@javax.annotation.Nullable List<ProfileWithoutIdentitiesGamesInner> games) { + this.games = games; + return this; + } + + public ProfileWithoutIdentities addGamesItem(ProfileWithoutIdentitiesGamesInner gamesItem) { + if (this.games == null) { + this.games = new ArrayList<>(); + } + this.games.add(gamesItem); + return this; + } + + /** + * Get games + * @return games + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesGamesInner> getGames() { + return games; + } + + public void setGames(@javax.annotation.Nullable List<ProfileWithoutIdentitiesGamesInner> games) { + this.games = games; + } + + + public ProfileWithoutIdentities family(@javax.annotation.Nullable List<ProfileRequestModelFamilyInner> family) { + this.family = family; + return this; + } + + public ProfileWithoutIdentities addFamilyItem(ProfileRequestModelFamilyInner familyItem) { + if (this.family == null) { + this.family = new ArrayList<>(); + } + this.family.add(familyItem); + return this; + } + + /** + * Get family + * @return family + */ + @javax.annotation.Nullable + public List<ProfileRequestModelFamilyInner> getFamily() { + return family; + } + + public void setFamily(@javax.annotation.Nullable List<ProfileRequestModelFamilyInner> family) { + this.family = family; + } + + + public ProfileWithoutIdentities televisionShow(@javax.annotation.Nullable List<ProfileWithoutIdentitiesTelevisionShowInner> televisionShow) { + this.televisionShow = televisionShow; + return this; + } + + public ProfileWithoutIdentities addTelevisionShowItem(ProfileWithoutIdentitiesTelevisionShowInner televisionShowItem) { + if (this.televisionShow == null) { + this.televisionShow = new ArrayList<>(); + } + this.televisionShow.add(televisionShowItem); + return this; + } + + /** + * Get televisionShow + * @return televisionShow + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesTelevisionShowInner> getTelevisionShow() { + return televisionShow; + } + + public void setTelevisionShow(@javax.annotation.Nullable List<ProfileWithoutIdentitiesTelevisionShowInner> televisionShow) { + this.televisionShow = televisionShow; + } + + + public ProfileWithoutIdentities mutualFriends(@javax.annotation.Nullable List<ProfileWithoutIdentitiesMutualFriendsInner> mutualFriends) { + this.mutualFriends = mutualFriends; + return this; + } + + public ProfileWithoutIdentities addMutualFriendsItem(ProfileWithoutIdentitiesMutualFriendsInner mutualFriendsItem) { + if (this.mutualFriends == null) { + this.mutualFriends = new ArrayList<>(); + } + this.mutualFriends.add(mutualFriendsItem); + return this; + } + + /** + * Get mutualFriends + * @return mutualFriends + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesMutualFriendsInner> getMutualFriends() { + return mutualFriends; + } + + public void setMutualFriends(@javax.annotation.Nullable List<ProfileWithoutIdentitiesMutualFriendsInner> mutualFriends) { + this.mutualFriends = mutualFriends; + } + + + public ProfileWithoutIdentities movies(@javax.annotation.Nullable List<ProfileWithoutIdentitiesMoviesInner> movies) { + this.movies = movies; + return this; + } + + public ProfileWithoutIdentities addMoviesItem(ProfileWithoutIdentitiesMoviesInner moviesItem) { + if (this.movies == null) { + this.movies = new ArrayList<>(); + } + this.movies.add(moviesItem); + return this; + } + + /** + * Get movies + * @return movies + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesMoviesInner> getMovies() { + return movies; + } + + public void setMovies(@javax.annotation.Nullable List<ProfileWithoutIdentitiesMoviesInner> movies) { + this.movies = movies; + } + + + public ProfileWithoutIdentities books(@javax.annotation.Nullable List<ProfileWithoutIdentitiesBooksInner> books) { + this.books = books; + return this; + } + + public ProfileWithoutIdentities addBooksItem(ProfileWithoutIdentitiesBooksInner booksItem) { + if (this.books == null) { + this.books = new ArrayList<>(); + } + this.books.add(booksItem); + return this; + } + + /** + * Get books + * @return books + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesBooksInner> getBooks() { + return books; + } + + public void setBooks(@javax.annotation.Nullable List<ProfileWithoutIdentitiesBooksInner> books) { + this.books = books; + } + + + public ProfileWithoutIdentities patents(@javax.annotation.Nullable List<ProfileWithoutIdentitiesPatentsInner> patents) { + this.patents = patents; + return this; + } + + public ProfileWithoutIdentities addPatentsItem(ProfileWithoutIdentitiesPatentsInner patentsItem) { + if (this.patents == null) { + this.patents = new ArrayList<>(); + } + this.patents.add(patentsItem); + return this; + } + + /** + * Get patents + * @return patents + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesPatentsInner> getPatents() { + return patents; + } + + public void setPatents(@javax.annotation.Nullable List<ProfileWithoutIdentitiesPatentsInner> patents) { + this.patents = patents; + } + + + public ProfileWithoutIdentities favoriteThings(@javax.annotation.Nullable List<ProfileWithoutIdentitiesFavoriteThingsInner> favoriteThings) { + this.favoriteThings = favoriteThings; + return this; + } + + public ProfileWithoutIdentities addFavoriteThingsItem(ProfileWithoutIdentitiesFavoriteThingsInner favoriteThingsItem) { + if (this.favoriteThings == null) { + this.favoriteThings = new ArrayList<>(); + } + this.favoriteThings.add(favoriteThingsItem); + return this; + } + + /** + * Get favoriteThings + * @return favoriteThings + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesFavoriteThingsInner> getFavoriteThings() { + return favoriteThings; + } + + public void setFavoriteThings(@javax.annotation.Nullable List<ProfileWithoutIdentitiesFavoriteThingsInner> favoriteThings) { + this.favoriteThings = favoriteThings; + } + + + public ProfileWithoutIdentities relatedProfileViews(@javax.annotation.Nullable List<ProfileWithoutIdentitiesRelatedProfileViewsInner> relatedProfileViews) { + this.relatedProfileViews = relatedProfileViews; + return this; + } + + public ProfileWithoutIdentities addRelatedProfileViewsItem(ProfileWithoutIdentitiesRelatedProfileViewsInner relatedProfileViewsItem) { + if (this.relatedProfileViews == null) { + this.relatedProfileViews = new ArrayList<>(); + } + this.relatedProfileViews.add(relatedProfileViewsItem); + return this; + } + + /** + * Get relatedProfileViews + * @return relatedProfileViews + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesRelatedProfileViewsInner> getRelatedProfileViews() { + return relatedProfileViews; + } + + public void setRelatedProfileViews(@javax.annotation.Nullable List<ProfileWithoutIdentitiesRelatedProfileViewsInner> relatedProfileViews) { + this.relatedProfileViews = relatedProfileViews; + } + + + public ProfileWithoutIdentities placesLived(@javax.annotation.Nullable List<ProfileWithoutIdentitiesPlacesLivedInner> placesLived) { + this.placesLived = placesLived; + return this; + } + + public ProfileWithoutIdentities addPlacesLivedItem(ProfileWithoutIdentitiesPlacesLivedInner placesLivedItem) { + if (this.placesLived == null) { + this.placesLived = new ArrayList<>(); + } + this.placesLived.add(placesLivedItem); + return this; + } + + /** + * Get placesLived + * @return placesLived + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesPlacesLivedInner> getPlacesLived() { + return placesLived; + } + + public void setPlacesLived(@javax.annotation.Nullable List<ProfileWithoutIdentitiesPlacesLivedInner> placesLived) { + this.placesLived = placesLived; + } + + + public ProfileWithoutIdentities publications(@javax.annotation.Nullable List<ProfileWithoutIdentitiesPublicationsInner> publications) { + this.publications = publications; + return this; + } + + public ProfileWithoutIdentities addPublicationsItem(ProfileWithoutIdentitiesPublicationsInner publicationsItem) { + if (this.publications == null) { + this.publications = new ArrayList<>(); + } + this.publications.add(publicationsItem); + return this; + } + + /** + * Get publications + * @return publications + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesPublicationsInner> getPublications() { + return publications; + } + + public void setPublications(@javax.annotation.Nullable List<ProfileWithoutIdentitiesPublicationsInner> publications) { + this.publications = publications; + } + + + public ProfileWithoutIdentities jobBookmarks(@javax.annotation.Nullable List<ProfileWithoutIdentitiesJobBookmarksInner> jobBookmarks) { + this.jobBookmarks = jobBookmarks; + return this; + } + + public ProfileWithoutIdentities addJobBookmarksItem(ProfileWithoutIdentitiesJobBookmarksInner jobBookmarksItem) { + if (this.jobBookmarks == null) { + this.jobBookmarks = new ArrayList<>(); + } + this.jobBookmarks.add(jobBookmarksItem); + return this; + } + + /** + * Get jobBookmarks + * @return jobBookmarks + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesJobBookmarksInner> getJobBookmarks() { + return jobBookmarks; + } + + public void setJobBookmarks(@javax.annotation.Nullable List<ProfileWithoutIdentitiesJobBookmarksInner> jobBookmarks) { + this.jobBookmarks = jobBookmarks; + } + + + public ProfileWithoutIdentities badges(@javax.annotation.Nullable List<ProfileWithoutIdentitiesBadgesInner> badges) { + this.badges = badges; + return this; + } + + public ProfileWithoutIdentities addBadgesItem(ProfileWithoutIdentitiesBadgesInner badgesItem) { + if (this.badges == null) { + this.badges = new ArrayList<>(); + } + this.badges.add(badgesItem); + return this; + } + + /** + * Get badges + * @return badges + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesBadgesInner> getBadges() { + return badges; + } + + public void setBadges(@javax.annotation.Nullable List<ProfileWithoutIdentitiesBadgesInner> badges) { + this.badges = badges; + } + + + public ProfileWithoutIdentities memberUrlResources(@javax.annotation.Nullable List<ProfileWithoutIdentitiesMemberUrlResourcesInner> memberUrlResources) { + this.memberUrlResources = memberUrlResources; + return this; + } + + public ProfileWithoutIdentities addMemberUrlResourcesItem(ProfileWithoutIdentitiesMemberUrlResourcesInner memberUrlResourcesItem) { + if (this.memberUrlResources == null) { + this.memberUrlResources = new ArrayList<>(); + } + this.memberUrlResources.add(memberUrlResourcesItem); + return this; + } + + /** + * Get memberUrlResources + * @return memberUrlResources + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesMemberUrlResourcesInner> getMemberUrlResources() { + return memberUrlResources; + } + + public void setMemberUrlResources(@javax.annotation.Nullable List<ProfileWithoutIdentitiesMemberUrlResourcesInner> memberUrlResources) { + this.memberUrlResources = memberUrlResources; + } + + + public ProfileWithoutIdentities organizations(@javax.annotation.Nullable List<ProfileWithoutIdentitiesOrganizationsInner> organizations) { + this.organizations = organizations; + return this; + } + + public ProfileWithoutIdentities addOrganizationsItem(ProfileWithoutIdentitiesOrganizationsInner organizationsItem) { + if (this.organizations == null) { + this.organizations = new ArrayList<>(); + } + this.organizations.add(organizationsItem); + return this; + } + + /** + * Get organizations + * @return organizations + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesOrganizationsInner> getOrganizations() { + return organizations; + } + + public void setOrganizations(@javax.annotation.Nullable List<ProfileWithoutIdentitiesOrganizationsInner> organizations) { + this.organizations = organizations; + } + + + public ProfileWithoutIdentities email(@javax.annotation.Nullable List<ProfileWithoutIdentitiesUnverifiedEmailInner> email) { + this.email = email; + return this; + } + + public ProfileWithoutIdentities addEmailItem(ProfileWithoutIdentitiesUnverifiedEmailInner emailItem) { + if (this.email == null) { + this.email = new ArrayList<>(); + } + this.email.add(emailItem); + return this; + } + + /** + * Get email + * @return email + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesUnverifiedEmailInner> getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable List<ProfileWithoutIdentitiesUnverifiedEmailInner> email) { + this.email = email; + } + + + public ProfileWithoutIdentities passkeyLogin(@javax.annotation.Nullable ProfileWithoutIdentitiesPasskeyLogin passkeyLogin) { + this.passkeyLogin = passkeyLogin; + return this; + } + + /** + * Get passkeyLogin + * @return passkeyLogin + */ + @javax.annotation.Nullable + public ProfileWithoutIdentitiesPasskeyLogin getPasskeyLogin() { + return passkeyLogin; + } + + public void setPasskeyLogin(@javax.annotation.Nullable ProfileWithoutIdentitiesPasskeyLogin passkeyLogin) { + this.passkeyLogin = passkeyLogin; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentities instance itself + */ + public ProfileWithoutIdentities putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentities profileWithoutIdentities = (ProfileWithoutIdentities) o; + return Objects.equals(this.isPasswordBreached, profileWithoutIdentities.isPasswordBreached) && + Objects.equals(this.isActive, profileWithoutIdentities.isActive) && + Objects.equals(this.isDeleted, profileWithoutIdentities.isDeleted) && + Objects.equals(this.emailVerified, profileWithoutIdentities.emailVerified) && + Objects.equals(this.isLoginLocked, profileWithoutIdentities.isLoginLocked) && + Objects.equals(this.isRequiredFieldsFilledOnce, profileWithoutIdentities.isRequiredFieldsFilledOnce) && + Objects.equals(this.firstLogin, profileWithoutIdentities.firstLogin) && + Objects.equals(this.isProtected, profileWithoutIdentities.isProtected) && + Objects.equals(this.hireable, profileWithoutIdentities.hireable) && + Objects.equals(this.isSecurePassword, profileWithoutIdentities.isSecurePassword) && + Objects.equals(this.isCustomUid, profileWithoutIdentities.isCustomUid) && + Objects.equals(this.phoneIdVerified, profileWithoutIdentities.phoneIdVerified) && + Objects.equals(this.isEmailSubscribed, profileWithoutIdentities.isEmailSubscribed) && + Objects.equals(this.noOfLogins, profileWithoutIdentities.noOfLogins) && + Objects.equals(this.followersCount, profileWithoutIdentities.followersCount) && + Objects.equals(this.friendsCount, profileWithoutIdentities.friendsCount) && + Objects.equals(this.totalStatusesCount, profileWithoutIdentities.totalStatusesCount) && + Objects.equals(this.numRecommenders, profileWithoutIdentities.numRecommenders) && + Objects.equals(this.totalPrivateRepository, profileWithoutIdentities.totalPrivateRepository) && + Objects.equals(this.publicGists, profileWithoutIdentities.publicGists) && + Objects.equals(this.privateGists, profileWithoutIdentities.privateGists) && + Objects.equals(this.pinsCount, profileWithoutIdentities.pinsCount) && + Objects.equals(this.boardsCount, profileWithoutIdentities.boardsCount) && + Objects.equals(this.likesCount, profileWithoutIdentities.likesCount) && + Objects.equals(this.sessionLimit, profileWithoutIdentities.sessionLimit) && + Objects.equals(this.ID, profileWithoutIdentities.ID) && + Objects.equals(this.password, profileWithoutIdentities.password) && + Objects.equals(this.loginLockedType, profileWithoutIdentities.loginLockedType) && + Objects.equals(this.provider, profileWithoutIdentities.provider) && + Objects.equals(this.lastPasswordChangeToken, profileWithoutIdentities.lastPasswordChangeToken) && + Objects.equals(this.fullName, profileWithoutIdentities.fullName) && + Objects.equals(this.firstName, profileWithoutIdentities.firstName) && + Objects.equals(this.lastName, profileWithoutIdentities.lastName) && + Objects.equals(this.uid, profileWithoutIdentities.uid) && + Objects.equals(this.registrationProvider, profileWithoutIdentities.registrationProvider) && + Objects.equals(this.registrationSource, profileWithoutIdentities.registrationSource) && + Objects.equals(this.lastLoginLocation, profileWithoutIdentities.lastLoginLocation) && + Objects.equals(this.externalUserLoginId, profileWithoutIdentities.externalUserLoginId) && + Objects.equals(this.phoneId, profileWithoutIdentities.phoneId) && + Objects.equals(this.userName, profileWithoutIdentities.userName) && + Objects.equals(this.prefix, profileWithoutIdentities.prefix) && + Objects.equals(this.middleName, profileWithoutIdentities.middleName) && + Objects.equals(this.suffix, profileWithoutIdentities.suffix) && + Objects.equals(this.nickName, profileWithoutIdentities.nickName) && + Objects.equals(this.profileName, profileWithoutIdentities.profileName) && + Objects.equals(this.birthDate, profileWithoutIdentities.birthDate) && + Objects.equals(this.gender, profileWithoutIdentities.gender) && + Objects.equals(this.website, profileWithoutIdentities.website) && + Objects.equals(this.thumbnailImageUrl, profileWithoutIdentities.thumbnailImageUrl) && + Objects.equals(this.imageUrl, profileWithoutIdentities.imageUrl) && + Objects.equals(this.favicon, profileWithoutIdentities.favicon) && + Objects.equals(this.profileUrl, profileWithoutIdentities.profileUrl) && + Objects.equals(this.homeTown, profileWithoutIdentities.homeTown) && + Objects.equals(this.state, profileWithoutIdentities.state) && + Objects.equals(this.city, profileWithoutIdentities.city) && + Objects.equals(this.industry, profileWithoutIdentities.industry) && + Objects.equals(this.about, profileWithoutIdentities.about) && + Objects.equals(this.timeZone, profileWithoutIdentities.timeZone) && + Objects.equals(this.localLanguage, profileWithoutIdentities.localLanguage) && + Objects.equals(this.coverPhoto, profileWithoutIdentities.coverPhoto) && + Objects.equals(this.tagLine, profileWithoutIdentities.tagLine) && + Objects.equals(this.language, profileWithoutIdentities.language) && + Objects.equals(this.verified, profileWithoutIdentities.verified) && + Objects.equals(this.updatedTime, profileWithoutIdentities.updatedTime) && + Objects.equals(this.isGeoEnabled, profileWithoutIdentities.isGeoEnabled) && + Objects.equals(this.associations, profileWithoutIdentities.associations) && + Objects.equals(this.honors, profileWithoutIdentities.honors) && + Objects.equals(this.httpsImageUrl, profileWithoutIdentities.httpsImageUrl) && + Objects.equals(this.mainAddress, profileWithoutIdentities.mainAddress) && + Objects.equals(this.created, profileWithoutIdentities.created) && + Objects.equals(this.localCity, profileWithoutIdentities.localCity) && + Objects.equals(this.profileCity, profileWithoutIdentities.profileCity) && + Objects.equals(this.localCountry, profileWithoutIdentities.localCountry) && + Objects.equals(this.profileCountry, profileWithoutIdentities.profileCountry) && + Objects.equals(this.relationshipStatus, profileWithoutIdentities.relationshipStatus) && + Objects.equals(this.quota, profileWithoutIdentities.quota) && + Objects.equals(this.quote, profileWithoutIdentities.quote) && + Objects.equals(this.religion, profileWithoutIdentities.religion) && + Objects.equals(this.political, profileWithoutIdentities.political) && + Objects.equals(this.publicRepository, profileWithoutIdentities.publicRepository) && + Objects.equals(this.repositoryUrl, profileWithoutIdentities.repositoryUrl) && + Objects.equals(this.age, profileWithoutIdentities.age) && + Objects.equals(this.professionalHeadline, profileWithoutIdentities.professionalHeadline) && + Objects.equals(this.lrUserID, profileWithoutIdentities.lrUserID) && + Objects.equals(this.currency, profileWithoutIdentities.currency) && + Objects.equals(this.starredUrl, profileWithoutIdentities.starredUrl) && + Objects.equals(this.gistsUrl, profileWithoutIdentities.gistsUrl) && + Objects.equals(this.company, profileWithoutIdentities.company) && + Objects.equals(this.gravatarImageUrl, profileWithoutIdentities.gravatarImageUrl) && + Objects.equals(this.lastPasswordChangeDate, profileWithoutIdentities.lastPasswordChangeDate) && + Objects.equals(this.passwordExpirationDate, profileWithoutIdentities.passwordExpirationDate) && + Objects.equals(this.createdDate, profileWithoutIdentities.createdDate) && + Objects.equals(this.modifiedDate, profileWithoutIdentities.modifiedDate) && + Objects.equals(this.profileModifiedDate, profileWithoutIdentities.profileModifiedDate) && + Objects.equals(this.lastLoginDate, profileWithoutIdentities.lastLoginDate) && + Objects.equals(this.signupDate, profileWithoutIdentities.signupDate) && + Objects.equals(this.privacyPolicy, profileWithoutIdentities.privacyPolicy) && + Objects.equals(this.country, profileWithoutIdentities.country) && + Objects.equals(this.ageRange, profileWithoutIdentities.ageRange) && + Objects.equals(this.kloutScore, profileWithoutIdentities.kloutScore) && + Objects.equals(this.suggestions, profileWithoutIdentities.suggestions) && + Objects.equals(this.subscription, profileWithoutIdentities.subscription) && + Objects.equals(this.PIN, profileWithoutIdentities.PIN) && + Objects.equals(this.consentProfile, profileWithoutIdentities.consentProfile) && + Objects.equals(this.registrationData, profileWithoutIdentities.registrationData) && + Objects.equals(this.providerAccessCredential, profileWithoutIdentities.providerAccessCredential) && + Objects.equals(this.customFields, profileWithoutIdentities.customFields) && + Objects.equals(this.profileImageUrls, profileWithoutIdentities.profileImageUrls) && + Objects.equals(this.webProfiles, profileWithoutIdentities.webProfiles) && + Objects.equals(this.roles, profileWithoutIdentities.roles) && + Objects.equals(this.previousUids, profileWithoutIdentities.previousUids) && + Objects.equals(this.interestedIn, profileWithoutIdentities.interestedIn) && + Objects.equals(this.externalIds, profileWithoutIdentities.externalIds) && + Objects.equals(this.unverifiedEmail, profileWithoutIdentities.unverifiedEmail) && + Objects.equals(this.positions, profileWithoutIdentities.positions) && + Objects.equals(this.educations, profileWithoutIdentities.educations) && + Objects.equals(this.phoneNumbers, profileWithoutIdentities.phoneNumbers) && + Objects.equals(this.imAccounts, profileWithoutIdentities.imAccounts) && + Objects.equals(this.addresses, profileWithoutIdentities.addresses) && + Objects.equals(this.interests, profileWithoutIdentities.interests) && + Objects.equals(this.sports, profileWithoutIdentities.sports) && + Objects.equals(this.inspirationalPeople, profileWithoutIdentities.inspirationalPeople) && + Objects.equals(this.awards, profileWithoutIdentities.awards) && + Objects.equals(this.skills, profileWithoutIdentities.skills) && + Objects.equals(this.currentStatus, profileWithoutIdentities.currentStatus) && + Objects.equals(this.certifications, profileWithoutIdentities.certifications) && + Objects.equals(this.courses, profileWithoutIdentities.courses) && + Objects.equals(this.volunteer, profileWithoutIdentities.volunteer) && + Objects.equals(this.recommendationsReceived, profileWithoutIdentities.recommendationsReceived) && + Objects.equals(this.languages, profileWithoutIdentities.languages) && + Objects.equals(this.projects, profileWithoutIdentities.projects) && + Objects.equals(this.games, profileWithoutIdentities.games) && + Objects.equals(this.family, profileWithoutIdentities.family) && + Objects.equals(this.televisionShow, profileWithoutIdentities.televisionShow) && + Objects.equals(this.mutualFriends, profileWithoutIdentities.mutualFriends) && + Objects.equals(this.movies, profileWithoutIdentities.movies) && + Objects.equals(this.books, profileWithoutIdentities.books) && + Objects.equals(this.patents, profileWithoutIdentities.patents) && + Objects.equals(this.favoriteThings, profileWithoutIdentities.favoriteThings) && + Objects.equals(this.relatedProfileViews, profileWithoutIdentities.relatedProfileViews) && + Objects.equals(this.placesLived, profileWithoutIdentities.placesLived) && + Objects.equals(this.publications, profileWithoutIdentities.publications) && + Objects.equals(this.jobBookmarks, profileWithoutIdentities.jobBookmarks) && + Objects.equals(this.badges, profileWithoutIdentities.badges) && + Objects.equals(this.memberUrlResources, profileWithoutIdentities.memberUrlResources) && + Objects.equals(this.organizations, profileWithoutIdentities.organizations) && + Objects.equals(this.email, profileWithoutIdentities.email) && + Objects.equals(this.passkeyLogin, profileWithoutIdentities.passkeyLogin)&& + Objects.equals(this.additionalProperties, profileWithoutIdentities.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(isPasswordBreached, isActive, isDeleted, emailVerified, isLoginLocked, isRequiredFieldsFilledOnce, firstLogin, isProtected, hireable, isSecurePassword, isCustomUid, phoneIdVerified, isEmailSubscribed, noOfLogins, followersCount, friendsCount, totalStatusesCount, numRecommenders, totalPrivateRepository, publicGists, privateGists, pinsCount, boardsCount, likesCount, sessionLimit, ID, password, loginLockedType, provider, lastPasswordChangeToken, fullName, firstName, lastName, uid, registrationProvider, registrationSource, lastLoginLocation, externalUserLoginId, phoneId, userName, prefix, middleName, suffix, nickName, profileName, birthDate, gender, website, thumbnailImageUrl, imageUrl, favicon, profileUrl, homeTown, state, city, industry, about, timeZone, localLanguage, coverPhoto, tagLine, language, verified, updatedTime, isGeoEnabled, associations, honors, httpsImageUrl, mainAddress, created, localCity, profileCity, localCountry, profileCountry, relationshipStatus, quota, quote, religion, political, publicRepository, repositoryUrl, age, professionalHeadline, lrUserID, currency, starredUrl, gistsUrl, company, gravatarImageUrl, lastPasswordChangeDate, passwordExpirationDate, createdDate, modifiedDate, profileModifiedDate, lastLoginDate, signupDate, privacyPolicy, country, ageRange, kloutScore, suggestions, subscription, PIN, consentProfile, registrationData, providerAccessCredential, customFields, profileImageUrls, webProfiles, roles, previousUids, interestedIn, externalIds, unverifiedEmail, positions, educations, phoneNumbers, imAccounts, addresses, interests, sports, inspirationalPeople, awards, skills, currentStatus, certifications, courses, volunteer, recommendationsReceived, languages, projects, games, family, televisionShow, mutualFriends, movies, books, patents, favoriteThings, relatedProfileViews, placesLived, publications, jobBookmarks, badges, memberUrlResources, organizations, email, passkeyLogin, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentities {\n"); + sb.append(" isPasswordBreached: ").append(toIndentedString(isPasswordBreached)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" isDeleted: ").append(toIndentedString(isDeleted)).append("\n"); + sb.append(" emailVerified: ").append(toIndentedString(emailVerified)).append("\n"); + sb.append(" isLoginLocked: ").append(toIndentedString(isLoginLocked)).append("\n"); + sb.append(" isRequiredFieldsFilledOnce: ").append(toIndentedString(isRequiredFieldsFilledOnce)).append("\n"); + sb.append(" firstLogin: ").append(toIndentedString(firstLogin)).append("\n"); + sb.append(" isProtected: ").append(toIndentedString(isProtected)).append("\n"); + sb.append(" hireable: ").append(toIndentedString(hireable)).append("\n"); + sb.append(" isSecurePassword: ").append(toIndentedString(isSecurePassword)).append("\n"); + sb.append(" isCustomUid: ").append(toIndentedString(isCustomUid)).append("\n"); + sb.append(" phoneIdVerified: ").append(toIndentedString(phoneIdVerified)).append("\n"); + sb.append(" isEmailSubscribed: ").append(toIndentedString(isEmailSubscribed)).append("\n"); + sb.append(" noOfLogins: ").append(toIndentedString(noOfLogins)).append("\n"); + sb.append(" followersCount: ").append(toIndentedString(followersCount)).append("\n"); + sb.append(" friendsCount: ").append(toIndentedString(friendsCount)).append("\n"); + sb.append(" totalStatusesCount: ").append(toIndentedString(totalStatusesCount)).append("\n"); + sb.append(" numRecommenders: ").append(toIndentedString(numRecommenders)).append("\n"); + sb.append(" totalPrivateRepository: ").append(toIndentedString(totalPrivateRepository)).append("\n"); + sb.append(" publicGists: ").append(toIndentedString(publicGists)).append("\n"); + sb.append(" privateGists: ").append(toIndentedString(privateGists)).append("\n"); + sb.append(" pinsCount: ").append(toIndentedString(pinsCount)).append("\n"); + sb.append(" boardsCount: ").append(toIndentedString(boardsCount)).append("\n"); + sb.append(" likesCount: ").append(toIndentedString(likesCount)).append("\n"); + sb.append(" sessionLimit: ").append(toIndentedString(sessionLimit)).append("\n"); + sb.append(" ID: ").append(toIndentedString(ID)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" loginLockedType: ").append(toIndentedString(loginLockedType)).append("\n"); + sb.append(" provider: ").append(toIndentedString(provider)).append("\n"); + sb.append(" lastPasswordChangeToken: ").append(toIndentedString(lastPasswordChangeToken)).append("\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" registrationProvider: ").append(toIndentedString(registrationProvider)).append("\n"); + sb.append(" registrationSource: ").append(toIndentedString(registrationSource)).append("\n"); + sb.append(" lastLoginLocation: ").append(toIndentedString(lastLoginLocation)).append("\n"); + sb.append(" externalUserLoginId: ").append(toIndentedString(externalUserLoginId)).append("\n"); + sb.append(" phoneId: ").append(toIndentedString(phoneId)).append("\n"); + sb.append(" userName: ").append(toIndentedString(userName)).append("\n"); + sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n"); + sb.append(" middleName: ").append(toIndentedString(middleName)).append("\n"); + sb.append(" suffix: ").append(toIndentedString(suffix)).append("\n"); + sb.append(" nickName: ").append(toIndentedString(nickName)).append("\n"); + sb.append(" profileName: ").append(toIndentedString(profileName)).append("\n"); + sb.append(" birthDate: ").append(toIndentedString(birthDate)).append("\n"); + sb.append(" gender: ").append(toIndentedString(gender)).append("\n"); + sb.append(" website: ").append(toIndentedString(website)).append("\n"); + sb.append(" thumbnailImageUrl: ").append(toIndentedString(thumbnailImageUrl)).append("\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append(" favicon: ").append(toIndentedString(favicon)).append("\n"); + sb.append(" profileUrl: ").append(toIndentedString(profileUrl)).append("\n"); + sb.append(" homeTown: ").append(toIndentedString(homeTown)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" industry: ").append(toIndentedString(industry)).append("\n"); + sb.append(" about: ").append(toIndentedString(about)).append("\n"); + sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); + sb.append(" localLanguage: ").append(toIndentedString(localLanguage)).append("\n"); + sb.append(" coverPhoto: ").append(toIndentedString(coverPhoto)).append("\n"); + sb.append(" tagLine: ").append(toIndentedString(tagLine)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" verified: ").append(toIndentedString(verified)).append("\n"); + sb.append(" updatedTime: ").append(toIndentedString(updatedTime)).append("\n"); + sb.append(" isGeoEnabled: ").append(toIndentedString(isGeoEnabled)).append("\n"); + sb.append(" associations: ").append(toIndentedString(associations)).append("\n"); + sb.append(" honors: ").append(toIndentedString(honors)).append("\n"); + sb.append(" httpsImageUrl: ").append(toIndentedString(httpsImageUrl)).append("\n"); + sb.append(" mainAddress: ").append(toIndentedString(mainAddress)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" localCity: ").append(toIndentedString(localCity)).append("\n"); + sb.append(" profileCity: ").append(toIndentedString(profileCity)).append("\n"); + sb.append(" localCountry: ").append(toIndentedString(localCountry)).append("\n"); + sb.append(" profileCountry: ").append(toIndentedString(profileCountry)).append("\n"); + sb.append(" relationshipStatus: ").append(toIndentedString(relationshipStatus)).append("\n"); + sb.append(" quota: ").append(toIndentedString(quota)).append("\n"); + sb.append(" quote: ").append(toIndentedString(quote)).append("\n"); + sb.append(" religion: ").append(toIndentedString(religion)).append("\n"); + sb.append(" political: ").append(toIndentedString(political)).append("\n"); + sb.append(" publicRepository: ").append(toIndentedString(publicRepository)).append("\n"); + sb.append(" repositoryUrl: ").append(toIndentedString(repositoryUrl)).append("\n"); + sb.append(" age: ").append(toIndentedString(age)).append("\n"); + sb.append(" professionalHeadline: ").append(toIndentedString(professionalHeadline)).append("\n"); + sb.append(" lrUserID: ").append(toIndentedString(lrUserID)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" starredUrl: ").append(toIndentedString(starredUrl)).append("\n"); + sb.append(" gistsUrl: ").append(toIndentedString(gistsUrl)).append("\n"); + sb.append(" company: ").append(toIndentedString(company)).append("\n"); + sb.append(" gravatarImageUrl: ").append(toIndentedString(gravatarImageUrl)).append("\n"); + sb.append(" lastPasswordChangeDate: ").append(toIndentedString(lastPasswordChangeDate)).append("\n"); + sb.append(" passwordExpirationDate: ").append(toIndentedString(passwordExpirationDate)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" modifiedDate: ").append(toIndentedString(modifiedDate)).append("\n"); + sb.append(" profileModifiedDate: ").append(toIndentedString(profileModifiedDate)).append("\n"); + sb.append(" lastLoginDate: ").append(toIndentedString(lastLoginDate)).append("\n"); + sb.append(" signupDate: ").append(toIndentedString(signupDate)).append("\n"); + sb.append(" privacyPolicy: ").append(toIndentedString(privacyPolicy)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" ageRange: ").append(toIndentedString(ageRange)).append("\n"); + sb.append(" kloutScore: ").append(toIndentedString(kloutScore)).append("\n"); + sb.append(" suggestions: ").append(toIndentedString(suggestions)).append("\n"); + sb.append(" subscription: ").append(toIndentedString(subscription)).append("\n"); + sb.append(" PIN: ").append(toIndentedString(PIN)).append("\n"); + sb.append(" consentProfile: ").append(toIndentedString(consentProfile)).append("\n"); + sb.append(" registrationData: ").append(toIndentedString(registrationData)).append("\n"); + sb.append(" providerAccessCredential: ").append(toIndentedString(providerAccessCredential)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" profileImageUrls: ").append(toIndentedString(profileImageUrls)).append("\n"); + sb.append(" webProfiles: ").append(toIndentedString(webProfiles)).append("\n"); + sb.append(" roles: ").append(toIndentedString(roles)).append("\n"); + sb.append(" previousUids: ").append(toIndentedString(previousUids)).append("\n"); + sb.append(" interestedIn: ").append(toIndentedString(interestedIn)).append("\n"); + sb.append(" externalIds: ").append(toIndentedString(externalIds)).append("\n"); + sb.append(" unverifiedEmail: ").append(toIndentedString(unverifiedEmail)).append("\n"); + sb.append(" positions: ").append(toIndentedString(positions)).append("\n"); + sb.append(" educations: ").append(toIndentedString(educations)).append("\n"); + sb.append(" phoneNumbers: ").append(toIndentedString(phoneNumbers)).append("\n"); + sb.append(" imAccounts: ").append(toIndentedString(imAccounts)).append("\n"); + sb.append(" addresses: ").append(toIndentedString(addresses)).append("\n"); + sb.append(" interests: ").append(toIndentedString(interests)).append("\n"); + sb.append(" sports: ").append(toIndentedString(sports)).append("\n"); + sb.append(" inspirationalPeople: ").append(toIndentedString(inspirationalPeople)).append("\n"); + sb.append(" awards: ").append(toIndentedString(awards)).append("\n"); + sb.append(" skills: ").append(toIndentedString(skills)).append("\n"); + sb.append(" currentStatus: ").append(toIndentedString(currentStatus)).append("\n"); + sb.append(" certifications: ").append(toIndentedString(certifications)).append("\n"); + sb.append(" courses: ").append(toIndentedString(courses)).append("\n"); + sb.append(" volunteer: ").append(toIndentedString(volunteer)).append("\n"); + sb.append(" recommendationsReceived: ").append(toIndentedString(recommendationsReceived)).append("\n"); + sb.append(" languages: ").append(toIndentedString(languages)).append("\n"); + sb.append(" projects: ").append(toIndentedString(projects)).append("\n"); + sb.append(" games: ").append(toIndentedString(games)).append("\n"); + sb.append(" family: ").append(toIndentedString(family)).append("\n"); + sb.append(" televisionShow: ").append(toIndentedString(televisionShow)).append("\n"); + sb.append(" mutualFriends: ").append(toIndentedString(mutualFriends)).append("\n"); + sb.append(" movies: ").append(toIndentedString(movies)).append("\n"); + sb.append(" books: ").append(toIndentedString(books)).append("\n"); + sb.append(" patents: ").append(toIndentedString(patents)).append("\n"); + sb.append(" favoriteThings: ").append(toIndentedString(favoriteThings)).append("\n"); + sb.append(" relatedProfileViews: ").append(toIndentedString(relatedProfileViews)).append("\n"); + sb.append(" placesLived: ").append(toIndentedString(placesLived)).append("\n"); + sb.append(" publications: ").append(toIndentedString(publications)).append("\n"); + sb.append(" jobBookmarks: ").append(toIndentedString(jobBookmarks)).append("\n"); + sb.append(" badges: ").append(toIndentedString(badges)).append("\n"); + sb.append(" memberUrlResources: ").append(toIndentedString(memberUrlResources)).append("\n"); + sb.append(" organizations: ").append(toIndentedString(organizations)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" passkeyLogin: ").append(toIndentedString(passkeyLogin)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsPasswordBreached"); + openapiFields.add("IsActive"); + openapiFields.add("IsDeleted"); + openapiFields.add("EmailVerified"); + openapiFields.add("IsLoginLocked"); + openapiFields.add("IsRequiredFieldsFilledOnce"); + openapiFields.add("FirstLogin"); + openapiFields.add("IsProtected"); + openapiFields.add("Hireable"); + openapiFields.add("IsSecurePassword"); + openapiFields.add("IsCustomUid"); + openapiFields.add("PhoneIdVerified"); + openapiFields.add("IsEmailSubscribed"); + openapiFields.add("NoOfLogins"); + openapiFields.add("FollowersCount"); + openapiFields.add("FriendsCount"); + openapiFields.add("TotalStatusesCount"); + openapiFields.add("NumRecommenders"); + openapiFields.add("TotalPrivateRepository"); + openapiFields.add("PublicGists"); + openapiFields.add("PrivateGists"); + openapiFields.add("PinsCount"); + openapiFields.add("BoardsCount"); + openapiFields.add("LikesCount"); + openapiFields.add("SessionLimit"); + openapiFields.add("ID"); + openapiFields.add("Password"); + openapiFields.add("LoginLockedType"); + openapiFields.add("Provider"); + openapiFields.add("LastPasswordChangeToken"); + openapiFields.add("FullName"); + openapiFields.add("FirstName"); + openapiFields.add("LastName"); + openapiFields.add("Uid"); + openapiFields.add("RegistrationProvider"); + openapiFields.add("RegistrationSource"); + openapiFields.add("LastLoginLocation"); + openapiFields.add("ExternalUserLoginId"); + openapiFields.add("PhoneId"); + openapiFields.add("UserName"); + openapiFields.add("Prefix"); + openapiFields.add("MiddleName"); + openapiFields.add("Suffix"); + openapiFields.add("NickName"); + openapiFields.add("ProfileName"); + openapiFields.add("BirthDate"); + openapiFields.add("Gender"); + openapiFields.add("Website"); + openapiFields.add("ThumbnailImageUrl"); + openapiFields.add("ImageUrl"); + openapiFields.add("Favicon"); + openapiFields.add("ProfileUrl"); + openapiFields.add("HomeTown"); + openapiFields.add("State"); + openapiFields.add("City"); + openapiFields.add("Industry"); + openapiFields.add("About"); + openapiFields.add("TimeZone"); + openapiFields.add("LocalLanguage"); + openapiFields.add("CoverPhoto"); + openapiFields.add("TagLine"); + openapiFields.add("Language"); + openapiFields.add("Verified"); + openapiFields.add("UpdatedTime"); + openapiFields.add("IsGeoEnabled"); + openapiFields.add("Associations"); + openapiFields.add("Honors"); + openapiFields.add("HttpsImageUrl"); + openapiFields.add("MainAddress"); + openapiFields.add("Created"); + openapiFields.add("LocalCity"); + openapiFields.add("ProfileCity"); + openapiFields.add("LocalCountry"); + openapiFields.add("ProfileCountry"); + openapiFields.add("RelationshipStatus"); + openapiFields.add("Quota"); + openapiFields.add("Quote"); + openapiFields.add("Religion"); + openapiFields.add("Political"); + openapiFields.add("PublicRepository"); + openapiFields.add("RepositoryUrl"); + openapiFields.add("Age"); + openapiFields.add("ProfessionalHeadline"); + openapiFields.add("LRUserID"); + openapiFields.add("Currency"); + openapiFields.add("StarredUrl"); + openapiFields.add("GistsUrl"); + openapiFields.add("Company"); + openapiFields.add("GravatarImageUrl"); + openapiFields.add("LastPasswordChangeDate"); + openapiFields.add("PasswordExpirationDate"); + openapiFields.add("CreatedDate"); + openapiFields.add("ModifiedDate"); + openapiFields.add("ProfileModifiedDate"); + openapiFields.add("LastLoginDate"); + openapiFields.add("SignupDate"); + openapiFields.add("PrivacyPolicy"); + openapiFields.add("Country"); + openapiFields.add("AgeRange"); + openapiFields.add("KloutScore"); + openapiFields.add("Suggestions"); + openapiFields.add("Subscription"); + openapiFields.add("PIN"); + openapiFields.add("ConsentProfile"); + openapiFields.add("RegistrationData"); + openapiFields.add("ProviderAccessCredential"); + openapiFields.add("CustomFields"); + openapiFields.add("ProfileImageUrls"); + openapiFields.add("WebProfiles"); + openapiFields.add("Roles"); + openapiFields.add("PreviousUids"); + openapiFields.add("InterestedIn"); + openapiFields.add("ExternalIds"); + openapiFields.add("UnverifiedEmail"); + openapiFields.add("Positions"); + openapiFields.add("Educations"); + openapiFields.add("PhoneNumbers"); + openapiFields.add("IMAccounts"); + openapiFields.add("Addresses"); + openapiFields.add("Interests"); + openapiFields.add("Sports"); + openapiFields.add("InspirationalPeople"); + openapiFields.add("Awards"); + openapiFields.add("Skills"); + openapiFields.add("CurrentStatus"); + openapiFields.add("Certifications"); + openapiFields.add("Courses"); + openapiFields.add("Volunteer"); + openapiFields.add("RecommendationsReceived"); + openapiFields.add("Languages"); + openapiFields.add("Projects"); + openapiFields.add("Games"); + openapiFields.add("Family"); + openapiFields.add("TelevisionShow"); + openapiFields.add("MutualFriends"); + openapiFields.add("Movies"); + openapiFields.add("Books"); + openapiFields.add("Patents"); + openapiFields.add("FavoriteThings"); + openapiFields.add("RelatedProfileViews"); + openapiFields.add("PlacesLived"); + openapiFields.add("Publications"); + openapiFields.add("JobBookmarks"); + openapiFields.add("Badges"); + openapiFields.add("MemberUrlResources"); + openapiFields.add("Organizations"); + openapiFields.add("Email"); + openapiFields.add("PasskeyLogin"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentities + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentities.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentities is not found in the empty JSON string", ProfileWithoutIdentities.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonNull()) && !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("Password") != null && !jsonObj.get("Password").isJsonNull()) && !jsonObj.get("Password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Password").toString())); + } + if ((jsonObj.get("LoginLockedType") != null && !jsonObj.get("LoginLockedType").isJsonNull()) && !jsonObj.get("LoginLockedType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LoginLockedType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LoginLockedType").toString())); + } + if ((jsonObj.get("Provider") != null && !jsonObj.get("Provider").isJsonNull()) && !jsonObj.get("Provider").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Provider` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Provider").toString())); + } + if ((jsonObj.get("LastPasswordChangeToken") != null && !jsonObj.get("LastPasswordChangeToken").isJsonNull()) && !jsonObj.get("LastPasswordChangeToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastPasswordChangeToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastPasswordChangeToken").toString())); + } + if ((jsonObj.get("FullName") != null && !jsonObj.get("FullName").isJsonNull()) && !jsonObj.get("FullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FullName").toString())); + } + if ((jsonObj.get("FirstName") != null && !jsonObj.get("FirstName").isJsonNull()) && !jsonObj.get("FirstName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FirstName").toString())); + } + if ((jsonObj.get("LastName") != null && !jsonObj.get("LastName").isJsonNull()) && !jsonObj.get("LastName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastName").toString())); + } + if ((jsonObj.get("Uid") != null && !jsonObj.get("Uid").isJsonNull()) && !jsonObj.get("Uid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Uid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Uid").toString())); + } + if ((jsonObj.get("RegistrationProvider") != null && !jsonObj.get("RegistrationProvider").isJsonNull()) && !jsonObj.get("RegistrationProvider").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RegistrationProvider` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RegistrationProvider").toString())); + } + if ((jsonObj.get("RegistrationSource") != null && !jsonObj.get("RegistrationSource").isJsonNull()) && !jsonObj.get("RegistrationSource").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RegistrationSource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RegistrationSource").toString())); + } + if ((jsonObj.get("LastLoginLocation") != null && !jsonObj.get("LastLoginLocation").isJsonNull()) && !jsonObj.get("LastLoginLocation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastLoginLocation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastLoginLocation").toString())); + } + if ((jsonObj.get("ExternalUserLoginId") != null && !jsonObj.get("ExternalUserLoginId").isJsonNull()) && !jsonObj.get("ExternalUserLoginId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ExternalUserLoginId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ExternalUserLoginId").toString())); + } + if ((jsonObj.get("PhoneId") != null && !jsonObj.get("PhoneId").isJsonNull()) && !jsonObj.get("PhoneId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PhoneId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PhoneId").toString())); + } + if ((jsonObj.get("UserName") != null && !jsonObj.get("UserName").isJsonNull()) && !jsonObj.get("UserName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UserName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UserName").toString())); + } + if ((jsonObj.get("Prefix") != null && !jsonObj.get("Prefix").isJsonNull()) && !jsonObj.get("Prefix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Prefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Prefix").toString())); + } + if ((jsonObj.get("MiddleName") != null && !jsonObj.get("MiddleName").isJsonNull()) && !jsonObj.get("MiddleName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MiddleName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MiddleName").toString())); + } + if ((jsonObj.get("Suffix") != null && !jsonObj.get("Suffix").isJsonNull()) && !jsonObj.get("Suffix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Suffix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Suffix").toString())); + } + if ((jsonObj.get("NickName") != null && !jsonObj.get("NickName").isJsonNull()) && !jsonObj.get("NickName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NickName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NickName").toString())); + } + if ((jsonObj.get("ProfileName") != null && !jsonObj.get("ProfileName").isJsonNull()) && !jsonObj.get("ProfileName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileName").toString())); + } + if ((jsonObj.get("BirthDate") != null && !jsonObj.get("BirthDate").isJsonNull()) && !jsonObj.get("BirthDate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `BirthDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BirthDate").toString())); + } + if ((jsonObj.get("Gender") != null && !jsonObj.get("Gender").isJsonNull()) && !jsonObj.get("Gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Gender").toString())); + } + if ((jsonObj.get("Website") != null && !jsonObj.get("Website").isJsonNull()) && !jsonObj.get("Website").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Website` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Website").toString())); + } + if ((jsonObj.get("ThumbnailImageUrl") != null && !jsonObj.get("ThumbnailImageUrl").isJsonNull()) && !jsonObj.get("ThumbnailImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ThumbnailImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ThumbnailImageUrl").toString())); + } + if ((jsonObj.get("ImageUrl") != null && !jsonObj.get("ImageUrl").isJsonNull()) && !jsonObj.get("ImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ImageUrl").toString())); + } + if ((jsonObj.get("Favicon") != null && !jsonObj.get("Favicon").isJsonNull()) && !jsonObj.get("Favicon").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Favicon` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Favicon").toString())); + } + if ((jsonObj.get("ProfileUrl") != null && !jsonObj.get("ProfileUrl").isJsonNull()) && !jsonObj.get("ProfileUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileUrl").toString())); + } + if ((jsonObj.get("HomeTown") != null && !jsonObj.get("HomeTown").isJsonNull()) && !jsonObj.get("HomeTown").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HomeTown` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HomeTown").toString())); + } + if ((jsonObj.get("State") != null && !jsonObj.get("State").isJsonNull()) && !jsonObj.get("State").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `State` to be a primitive type in the JSON string but got `%s`", jsonObj.get("State").toString())); + } + if ((jsonObj.get("City") != null && !jsonObj.get("City").isJsonNull()) && !jsonObj.get("City").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `City` to be a primitive type in the JSON string but got `%s`", jsonObj.get("City").toString())); + } + if ((jsonObj.get("Industry") != null && !jsonObj.get("Industry").isJsonNull()) && !jsonObj.get("Industry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Industry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Industry").toString())); + } + if ((jsonObj.get("About") != null && !jsonObj.get("About").isJsonNull()) && !jsonObj.get("About").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `About` to be a primitive type in the JSON string but got `%s`", jsonObj.get("About").toString())); + } + if ((jsonObj.get("TimeZone") != null && !jsonObj.get("TimeZone").isJsonNull()) && !jsonObj.get("TimeZone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TimeZone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TimeZone").toString())); + } + if ((jsonObj.get("LocalLanguage") != null && !jsonObj.get("LocalLanguage").isJsonNull()) && !jsonObj.get("LocalLanguage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalLanguage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalLanguage").toString())); + } + if ((jsonObj.get("CoverPhoto") != null && !jsonObj.get("CoverPhoto").isJsonNull()) && !jsonObj.get("CoverPhoto").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CoverPhoto` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CoverPhoto").toString())); + } + if ((jsonObj.get("TagLine") != null && !jsonObj.get("TagLine").isJsonNull()) && !jsonObj.get("TagLine").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TagLine` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TagLine").toString())); + } + if ((jsonObj.get("Language") != null && !jsonObj.get("Language").isJsonNull()) && !jsonObj.get("Language").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Language` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Language").toString())); + } + if ((jsonObj.get("Verified") != null && !jsonObj.get("Verified").isJsonNull()) && !jsonObj.get("Verified").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Verified` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Verified").toString())); + } + if ((jsonObj.get("UpdatedTime") != null && !jsonObj.get("UpdatedTime").isJsonNull()) && !jsonObj.get("UpdatedTime").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UpdatedTime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UpdatedTime").toString())); + } + if ((jsonObj.get("IsGeoEnabled") != null && !jsonObj.get("IsGeoEnabled").isJsonNull()) && !jsonObj.get("IsGeoEnabled").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IsGeoEnabled` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IsGeoEnabled").toString())); + } + if ((jsonObj.get("Associations") != null && !jsonObj.get("Associations").isJsonNull()) && !jsonObj.get("Associations").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Associations` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Associations").toString())); + } + if ((jsonObj.get("Honors") != null && !jsonObj.get("Honors").isJsonNull()) && !jsonObj.get("Honors").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Honors` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Honors").toString())); + } + if ((jsonObj.get("HttpsImageUrl") != null && !jsonObj.get("HttpsImageUrl").isJsonNull()) && !jsonObj.get("HttpsImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HttpsImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HttpsImageUrl").toString())); + } + if ((jsonObj.get("MainAddress") != null && !jsonObj.get("MainAddress").isJsonNull()) && !jsonObj.get("MainAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MainAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MainAddress").toString())); + } + if ((jsonObj.get("Created") != null && !jsonObj.get("Created").isJsonNull()) && !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("LocalCity") != null && !jsonObj.get("LocalCity").isJsonNull()) && !jsonObj.get("LocalCity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalCity").toString())); + } + if ((jsonObj.get("ProfileCity") != null && !jsonObj.get("ProfileCity").isJsonNull()) && !jsonObj.get("ProfileCity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileCity").toString())); + } + if ((jsonObj.get("LocalCountry") != null && !jsonObj.get("LocalCountry").isJsonNull()) && !jsonObj.get("LocalCountry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalCountry").toString())); + } + if ((jsonObj.get("ProfileCountry") != null && !jsonObj.get("ProfileCountry").isJsonNull()) && !jsonObj.get("ProfileCountry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileCountry").toString())); + } + if ((jsonObj.get("RelationshipStatus") != null && !jsonObj.get("RelationshipStatus").isJsonNull()) && !jsonObj.get("RelationshipStatus").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RelationshipStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RelationshipStatus").toString())); + } + if ((jsonObj.get("Quota") != null && !jsonObj.get("Quota").isJsonNull()) && !jsonObj.get("Quota").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Quota` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Quota").toString())); + } + if ((jsonObj.get("Quote") != null && !jsonObj.get("Quote").isJsonNull()) && !jsonObj.get("Quote").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Quote` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Quote").toString())); + } + if ((jsonObj.get("Religion") != null && !jsonObj.get("Religion").isJsonNull()) && !jsonObj.get("Religion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Religion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Religion").toString())); + } + if ((jsonObj.get("Political") != null && !jsonObj.get("Political").isJsonNull()) && !jsonObj.get("Political").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Political` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Political").toString())); + } + if ((jsonObj.get("PublicRepository") != null && !jsonObj.get("PublicRepository").isJsonNull()) && !jsonObj.get("PublicRepository").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PublicRepository` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PublicRepository").toString())); + } + if ((jsonObj.get("RepositoryUrl") != null && !jsonObj.get("RepositoryUrl").isJsonNull()) && !jsonObj.get("RepositoryUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RepositoryUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RepositoryUrl").toString())); + } + if ((jsonObj.get("Age") != null && !jsonObj.get("Age").isJsonNull()) && !jsonObj.get("Age").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Age` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Age").toString())); + } + if ((jsonObj.get("ProfessionalHeadline") != null && !jsonObj.get("ProfessionalHeadline").isJsonNull()) && !jsonObj.get("ProfessionalHeadline").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfessionalHeadline` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfessionalHeadline").toString())); + } + if ((jsonObj.get("LRUserID") != null && !jsonObj.get("LRUserID").isJsonNull()) && !jsonObj.get("LRUserID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LRUserID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LRUserID").toString())); + } + if ((jsonObj.get("Currency") != null && !jsonObj.get("Currency").isJsonNull()) && !jsonObj.get("Currency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Currency").toString())); + } + if ((jsonObj.get("StarredUrl") != null && !jsonObj.get("StarredUrl").isJsonNull()) && !jsonObj.get("StarredUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `StarredUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("StarredUrl").toString())); + } + if ((jsonObj.get("GistsUrl") != null && !jsonObj.get("GistsUrl").isJsonNull()) && !jsonObj.get("GistsUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GistsUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GistsUrl").toString())); + } + if ((jsonObj.get("Company") != null && !jsonObj.get("Company").isJsonNull()) && !jsonObj.get("Company").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Company` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Company").toString())); + } + if ((jsonObj.get("GravatarImageUrl") != null && !jsonObj.get("GravatarImageUrl").isJsonNull()) && !jsonObj.get("GravatarImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GravatarImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GravatarImageUrl").toString())); + } + // validate the optional field `PrivacyPolicy` + if (jsonObj.get("PrivacyPolicy") != null && !jsonObj.get("PrivacyPolicy").isJsonNull()) { + ProfileWithoutIdentitiesPrivacyPolicy.validateJsonElement(jsonObj.get("PrivacyPolicy")); + } + // validate the optional field `Country` + if (jsonObj.get("Country") != null && !jsonObj.get("Country").isJsonNull()) { + ProfileRequestModelCountry.validateJsonElement(jsonObj.get("Country")); + } + // validate the optional field `AgeRange` + if (jsonObj.get("AgeRange") != null && !jsonObj.get("AgeRange").isJsonNull()) { + ProfileRequestModelSubscriptionAgeRange.validateJsonElement(jsonObj.get("AgeRange")); + } + // validate the optional field `KloutScore` + if (jsonObj.get("KloutScore") != null && !jsonObj.get("KloutScore").isJsonNull()) { + ProfileWithoutIdentitiesKloutScore.validateJsonElement(jsonObj.get("KloutScore")); + } + // validate the optional field `Suggestions` + if (jsonObj.get("Suggestions") != null && !jsonObj.get("Suggestions").isJsonNull()) { + ProfileWithoutIdentitiesSuggestions.validateJsonElement(jsonObj.get("Suggestions")); + } + // validate the optional field `Subscription` + if (jsonObj.get("Subscription") != null && !jsonObj.get("Subscription").isJsonNull()) { + ProfileWithoutIdentitiesSubscription.validateJsonElement(jsonObj.get("Subscription")); + } + // validate the optional field `PIN` + if (jsonObj.get("PIN") != null && !jsonObj.get("PIN").isJsonNull()) { + ProfileWithoutIdentitiesPIN.validateJsonElement(jsonObj.get("PIN")); + } + // validate the optional field `ConsentProfile` + if (jsonObj.get("ConsentProfile") != null && !jsonObj.get("ConsentProfile").isJsonNull()) { + ProfileWithoutIdentitiesConsentProfile.validateJsonElement(jsonObj.get("ConsentProfile")); + } + // validate the optional field `RegistrationData` + if (jsonObj.get("RegistrationData") != null && !jsonObj.get("RegistrationData").isJsonNull()) { + ProfileWithoutIdentitiesRegistrationData.validateJsonElement(jsonObj.get("RegistrationData")); + } + // validate the optional field `ProviderAccessCredential` + if (jsonObj.get("ProviderAccessCredential") != null && !jsonObj.get("ProviderAccessCredential").isJsonNull()) { + ProfileWithoutIdentitiesProviderAccessCredential.validateJsonElement(jsonObj.get("ProviderAccessCredential")); + } + // ensure the optional json data is an array if present + if (jsonObj.get("Roles") != null && !jsonObj.get("Roles").isJsonNull() && !jsonObj.get("Roles").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Roles` to be an array in the JSON string but got `%s`", jsonObj.get("Roles").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("PreviousUids") != null && !jsonObj.get("PreviousUids").isJsonNull() && !jsonObj.get("PreviousUids").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PreviousUids` to be an array in the JSON string but got `%s`", jsonObj.get("PreviousUids").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("InterestedIn") != null && !jsonObj.get("InterestedIn").isJsonNull() && !jsonObj.get("InterestedIn").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `InterestedIn` to be an array in the JSON string but got `%s`", jsonObj.get("InterestedIn").toString())); + } + if (jsonObj.get("ExternalIds") != null && !jsonObj.get("ExternalIds").isJsonNull()) { + JsonArray jsonArrayexternalIds = jsonObj.getAsJsonArray("ExternalIds"); + if (jsonArrayexternalIds != null) { + // ensure the json data is an array + if (!jsonObj.get("ExternalIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ExternalIds` to be an array in the JSON string but got `%s`", jsonObj.get("ExternalIds").toString())); + } + + // validate the optional field `ExternalIds` (array) + for (int i = 0; i < jsonArrayexternalIds.size(); i++) { + ProfileWithoutIdentitiesExternalIdsInner.validateJsonElement(jsonArrayexternalIds.get(i)); + }; + } + } + if (jsonObj.get("UnverifiedEmail") != null && !jsonObj.get("UnverifiedEmail").isJsonNull()) { + JsonArray jsonArrayunverifiedEmail = jsonObj.getAsJsonArray("UnverifiedEmail"); + if (jsonArrayunverifiedEmail != null) { + // ensure the json data is an array + if (!jsonObj.get("UnverifiedEmail").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `UnverifiedEmail` to be an array in the JSON string but got `%s`", jsonObj.get("UnverifiedEmail").toString())); + } + + // validate the optional field `UnverifiedEmail` (array) + for (int i = 0; i < jsonArrayunverifiedEmail.size(); i++) { + ProfileWithoutIdentitiesUnverifiedEmailInner.validateJsonElement(jsonArrayunverifiedEmail.get(i)); + }; + } + } + if (jsonObj.get("Positions") != null && !jsonObj.get("Positions").isJsonNull()) { + JsonArray jsonArraypositions = jsonObj.getAsJsonArray("Positions"); + if (jsonArraypositions != null) { + // ensure the json data is an array + if (!jsonObj.get("Positions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Positions` to be an array in the JSON string but got `%s`", jsonObj.get("Positions").toString())); + } + + // validate the optional field `Positions` (array) + for (int i = 0; i < jsonArraypositions.size(); i++) { + ProfileWithoutIdentitiesPositionsInner.validateJsonElement(jsonArraypositions.get(i)); + }; + } + } + if (jsonObj.get("Educations") != null && !jsonObj.get("Educations").isJsonNull()) { + JsonArray jsonArrayeducations = jsonObj.getAsJsonArray("Educations"); + if (jsonArrayeducations != null) { + // ensure the json data is an array + if (!jsonObj.get("Educations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Educations` to be an array in the JSON string but got `%s`", jsonObj.get("Educations").toString())); + } + + // validate the optional field `Educations` (array) + for (int i = 0; i < jsonArrayeducations.size(); i++) { + ProfileWithoutIdentitiesEducationsInner.validateJsonElement(jsonArrayeducations.get(i)); + }; + } + } + if (jsonObj.get("PhoneNumbers") != null && !jsonObj.get("PhoneNumbers").isJsonNull()) { + JsonArray jsonArrayphoneNumbers = jsonObj.getAsJsonArray("PhoneNumbers"); + if (jsonArrayphoneNumbers != null) { + // ensure the json data is an array + if (!jsonObj.get("PhoneNumbers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PhoneNumbers` to be an array in the JSON string but got `%s`", jsonObj.get("PhoneNumbers").toString())); + } + + // validate the optional field `PhoneNumbers` (array) + for (int i = 0; i < jsonArrayphoneNumbers.size(); i++) { + ProfileWithoutIdentitiesPhoneNumbersInner.validateJsonElement(jsonArrayphoneNumbers.get(i)); + }; + } + } + if (jsonObj.get("IMAccounts") != null && !jsonObj.get("IMAccounts").isJsonNull()) { + JsonArray jsonArrayimAccounts = jsonObj.getAsJsonArray("IMAccounts"); + if (jsonArrayimAccounts != null) { + // ensure the json data is an array + if (!jsonObj.get("IMAccounts").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `IMAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("IMAccounts").toString())); + } + + // validate the optional field `IMAccounts` (array) + for (int i = 0; i < jsonArrayimAccounts.size(); i++) { + ProfileWithoutIdentitiesIMAccountsInner.validateJsonElement(jsonArrayimAccounts.get(i)); + }; + } + } + if (jsonObj.get("Addresses") != null && !jsonObj.get("Addresses").isJsonNull()) { + JsonArray jsonArrayaddresses = jsonObj.getAsJsonArray("Addresses"); + if (jsonArrayaddresses != null) { + // ensure the json data is an array + if (!jsonObj.get("Addresses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Addresses` to be an array in the JSON string but got `%s`", jsonObj.get("Addresses").toString())); + } + + // validate the optional field `Addresses` (array) + for (int i = 0; i < jsonArrayaddresses.size(); i++) { + ProfileWithoutIdentitiesAddressesInner.validateJsonElement(jsonArrayaddresses.get(i)); + }; + } + } + if (jsonObj.get("Interests") != null && !jsonObj.get("Interests").isJsonNull()) { + JsonArray jsonArrayinterests = jsonObj.getAsJsonArray("Interests"); + if (jsonArrayinterests != null) { + // ensure the json data is an array + if (!jsonObj.get("Interests").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Interests` to be an array in the JSON string but got `%s`", jsonObj.get("Interests").toString())); + } + + // validate the optional field `Interests` (array) + for (int i = 0; i < jsonArrayinterests.size(); i++) { + ProfileWithoutIdentitiesInterestsInner.validateJsonElement(jsonArrayinterests.get(i)); + }; + } + } + if (jsonObj.get("Sports") != null && !jsonObj.get("Sports").isJsonNull()) { + JsonArray jsonArraysports = jsonObj.getAsJsonArray("Sports"); + if (jsonArraysports != null) { + // ensure the json data is an array + if (!jsonObj.get("Sports").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Sports` to be an array in the JSON string but got `%s`", jsonObj.get("Sports").toString())); + } + + // validate the optional field `Sports` (array) + for (int i = 0; i < jsonArraysports.size(); i++) { + ProfileRequestModelSportsInner.validateJsonElement(jsonArraysports.get(i)); + }; + } + } + if (jsonObj.get("InspirationalPeople") != null && !jsonObj.get("InspirationalPeople").isJsonNull()) { + JsonArray jsonArrayinspirationalPeople = jsonObj.getAsJsonArray("InspirationalPeople"); + if (jsonArrayinspirationalPeople != null) { + // ensure the json data is an array + if (!jsonObj.get("InspirationalPeople").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `InspirationalPeople` to be an array in the JSON string but got `%s`", jsonObj.get("InspirationalPeople").toString())); + } + + // validate the optional field `InspirationalPeople` (array) + for (int i = 0; i < jsonArrayinspirationalPeople.size(); i++) { + ProfileWithoutIdentitiesInspirationalPeopleInner.validateJsonElement(jsonArrayinspirationalPeople.get(i)); + }; + } + } + if (jsonObj.get("Awards") != null && !jsonObj.get("Awards").isJsonNull()) { + JsonArray jsonArrayawards = jsonObj.getAsJsonArray("Awards"); + if (jsonArrayawards != null) { + // ensure the json data is an array + if (!jsonObj.get("Awards").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Awards` to be an array in the JSON string but got `%s`", jsonObj.get("Awards").toString())); + } + + // validate the optional field `Awards` (array) + for (int i = 0; i < jsonArrayawards.size(); i++) { + ProfileWithoutIdentitiesAwardsInner.validateJsonElement(jsonArrayawards.get(i)); + }; + } + } + if (jsonObj.get("Skills") != null && !jsonObj.get("Skills").isJsonNull()) { + JsonArray jsonArrayskills = jsonObj.getAsJsonArray("Skills"); + if (jsonArrayskills != null) { + // ensure the json data is an array + if (!jsonObj.get("Skills").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Skills` to be an array in the JSON string but got `%s`", jsonObj.get("Skills").toString())); + } + + // validate the optional field `Skills` (array) + for (int i = 0; i < jsonArrayskills.size(); i++) { + ProfileWithoutIdentitiesSkillsInner.validateJsonElement(jsonArrayskills.get(i)); + }; + } + } + if (jsonObj.get("CurrentStatus") != null && !jsonObj.get("CurrentStatus").isJsonNull()) { + JsonArray jsonArraycurrentStatus = jsonObj.getAsJsonArray("CurrentStatus"); + if (jsonArraycurrentStatus != null) { + // ensure the json data is an array + if (!jsonObj.get("CurrentStatus").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `CurrentStatus` to be an array in the JSON string but got `%s`", jsonObj.get("CurrentStatus").toString())); + } + + // validate the optional field `CurrentStatus` (array) + for (int i = 0; i < jsonArraycurrentStatus.size(); i++) { + ProfileWithoutIdentitiesCurrentStatusInner.validateJsonElement(jsonArraycurrentStatus.get(i)); + }; + } + } + if (jsonObj.get("Certifications") != null && !jsonObj.get("Certifications").isJsonNull()) { + JsonArray jsonArraycertifications = jsonObj.getAsJsonArray("Certifications"); + if (jsonArraycertifications != null) { + // ensure the json data is an array + if (!jsonObj.get("Certifications").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Certifications` to be an array in the JSON string but got `%s`", jsonObj.get("Certifications").toString())); + } + + // validate the optional field `Certifications` (array) + for (int i = 0; i < jsonArraycertifications.size(); i++) { + ProfileWithoutIdentitiesCertificationsInner.validateJsonElement(jsonArraycertifications.get(i)); + }; + } + } + if (jsonObj.get("Courses") != null && !jsonObj.get("Courses").isJsonNull()) { + JsonArray jsonArraycourses = jsonObj.getAsJsonArray("Courses"); + if (jsonArraycourses != null) { + // ensure the json data is an array + if (!jsonObj.get("Courses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Courses` to be an array in the JSON string but got `%s`", jsonObj.get("Courses").toString())); + } + + // validate the optional field `Courses` (array) + for (int i = 0; i < jsonArraycourses.size(); i++) { + ProfileWithoutIdentitiesCoursesInner.validateJsonElement(jsonArraycourses.get(i)); + }; + } + } + if (jsonObj.get("Volunteer") != null && !jsonObj.get("Volunteer").isJsonNull()) { + JsonArray jsonArrayvolunteer = jsonObj.getAsJsonArray("Volunteer"); + if (jsonArrayvolunteer != null) { + // ensure the json data is an array + if (!jsonObj.get("Volunteer").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Volunteer` to be an array in the JSON string but got `%s`", jsonObj.get("Volunteer").toString())); + } + + // validate the optional field `Volunteer` (array) + for (int i = 0; i < jsonArrayvolunteer.size(); i++) { + ProfileRequestModelVolunteerInner.validateJsonElement(jsonArrayvolunteer.get(i)); + }; + } + } + if (jsonObj.get("RecommendationsReceived") != null && !jsonObj.get("RecommendationsReceived").isJsonNull()) { + JsonArray jsonArrayrecommendationsReceived = jsonObj.getAsJsonArray("RecommendationsReceived"); + if (jsonArrayrecommendationsReceived != null) { + // ensure the json data is an array + if (!jsonObj.get("RecommendationsReceived").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RecommendationsReceived` to be an array in the JSON string but got `%s`", jsonObj.get("RecommendationsReceived").toString())); + } + + // validate the optional field `RecommendationsReceived` (array) + for (int i = 0; i < jsonArrayrecommendationsReceived.size(); i++) { + ProfileWithoutIdentitiesRecommendationsReceivedInner.validateJsonElement(jsonArrayrecommendationsReceived.get(i)); + }; + } + } + if (jsonObj.get("Languages") != null && !jsonObj.get("Languages").isJsonNull()) { + JsonArray jsonArraylanguages = jsonObj.getAsJsonArray("Languages"); + if (jsonArraylanguages != null) { + // ensure the json data is an array + if (!jsonObj.get("Languages").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Languages` to be an array in the JSON string but got `%s`", jsonObj.get("Languages").toString())); + } + + // validate the optional field `Languages` (array) + for (int i = 0; i < jsonArraylanguages.size(); i++) { + ProfileWithoutIdentitiesLanguagesInner.validateJsonElement(jsonArraylanguages.get(i)); + }; + } + } + if (jsonObj.get("Projects") != null && !jsonObj.get("Projects").isJsonNull()) { + JsonArray jsonArrayprojects = jsonObj.getAsJsonArray("Projects"); + if (jsonArrayprojects != null) { + // ensure the json data is an array + if (!jsonObj.get("Projects").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Projects` to be an array in the JSON string but got `%s`", jsonObj.get("Projects").toString())); + } + + // validate the optional field `Projects` (array) + for (int i = 0; i < jsonArrayprojects.size(); i++) { + ProfileWithoutIdentitiesProjectsInner.validateJsonElement(jsonArrayprojects.get(i)); + }; + } + } + if (jsonObj.get("Games") != null && !jsonObj.get("Games").isJsonNull()) { + JsonArray jsonArraygames = jsonObj.getAsJsonArray("Games"); + if (jsonArraygames != null) { + // ensure the json data is an array + if (!jsonObj.get("Games").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Games` to be an array in the JSON string but got `%s`", jsonObj.get("Games").toString())); + } + + // validate the optional field `Games` (array) + for (int i = 0; i < jsonArraygames.size(); i++) { + ProfileWithoutIdentitiesGamesInner.validateJsonElement(jsonArraygames.get(i)); + }; + } + } + if (jsonObj.get("Family") != null && !jsonObj.get("Family").isJsonNull()) { + JsonArray jsonArrayfamily = jsonObj.getAsJsonArray("Family"); + if (jsonArrayfamily != null) { + // ensure the json data is an array + if (!jsonObj.get("Family").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Family` to be an array in the JSON string but got `%s`", jsonObj.get("Family").toString())); + } + + // validate the optional field `Family` (array) + for (int i = 0; i < jsonArrayfamily.size(); i++) { + ProfileRequestModelFamilyInner.validateJsonElement(jsonArrayfamily.get(i)); + }; + } + } + if (jsonObj.get("TelevisionShow") != null && !jsonObj.get("TelevisionShow").isJsonNull()) { + JsonArray jsonArraytelevisionShow = jsonObj.getAsJsonArray("TelevisionShow"); + if (jsonArraytelevisionShow != null) { + // ensure the json data is an array + if (!jsonObj.get("TelevisionShow").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `TelevisionShow` to be an array in the JSON string but got `%s`", jsonObj.get("TelevisionShow").toString())); + } + + // validate the optional field `TelevisionShow` (array) + for (int i = 0; i < jsonArraytelevisionShow.size(); i++) { + ProfileWithoutIdentitiesTelevisionShowInner.validateJsonElement(jsonArraytelevisionShow.get(i)); + }; + } + } + if (jsonObj.get("MutualFriends") != null && !jsonObj.get("MutualFriends").isJsonNull()) { + JsonArray jsonArraymutualFriends = jsonObj.getAsJsonArray("MutualFriends"); + if (jsonArraymutualFriends != null) { + // ensure the json data is an array + if (!jsonObj.get("MutualFriends").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `MutualFriends` to be an array in the JSON string but got `%s`", jsonObj.get("MutualFriends").toString())); + } + + // validate the optional field `MutualFriends` (array) + for (int i = 0; i < jsonArraymutualFriends.size(); i++) { + ProfileWithoutIdentitiesMutualFriendsInner.validateJsonElement(jsonArraymutualFriends.get(i)); + }; + } + } + if (jsonObj.get("Movies") != null && !jsonObj.get("Movies").isJsonNull()) { + JsonArray jsonArraymovies = jsonObj.getAsJsonArray("Movies"); + if (jsonArraymovies != null) { + // ensure the json data is an array + if (!jsonObj.get("Movies").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Movies` to be an array in the JSON string but got `%s`", jsonObj.get("Movies").toString())); + } + + // validate the optional field `Movies` (array) + for (int i = 0; i < jsonArraymovies.size(); i++) { + ProfileWithoutIdentitiesMoviesInner.validateJsonElement(jsonArraymovies.get(i)); + }; + } + } + if (jsonObj.get("Books") != null && !jsonObj.get("Books").isJsonNull()) { + JsonArray jsonArraybooks = jsonObj.getAsJsonArray("Books"); + if (jsonArraybooks != null) { + // ensure the json data is an array + if (!jsonObj.get("Books").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Books` to be an array in the JSON string but got `%s`", jsonObj.get("Books").toString())); + } + + // validate the optional field `Books` (array) + for (int i = 0; i < jsonArraybooks.size(); i++) { + ProfileWithoutIdentitiesBooksInner.validateJsonElement(jsonArraybooks.get(i)); + }; + } + } + if (jsonObj.get("Patents") != null && !jsonObj.get("Patents").isJsonNull()) { + JsonArray jsonArraypatents = jsonObj.getAsJsonArray("Patents"); + if (jsonArraypatents != null) { + // ensure the json data is an array + if (!jsonObj.get("Patents").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Patents` to be an array in the JSON string but got `%s`", jsonObj.get("Patents").toString())); + } + + // validate the optional field `Patents` (array) + for (int i = 0; i < jsonArraypatents.size(); i++) { + ProfileWithoutIdentitiesPatentsInner.validateJsonElement(jsonArraypatents.get(i)); + }; + } + } + if (jsonObj.get("FavoriteThings") != null && !jsonObj.get("FavoriteThings").isJsonNull()) { + JsonArray jsonArrayfavoriteThings = jsonObj.getAsJsonArray("FavoriteThings"); + if (jsonArrayfavoriteThings != null) { + // ensure the json data is an array + if (!jsonObj.get("FavoriteThings").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `FavoriteThings` to be an array in the JSON string but got `%s`", jsonObj.get("FavoriteThings").toString())); + } + + // validate the optional field `FavoriteThings` (array) + for (int i = 0; i < jsonArrayfavoriteThings.size(); i++) { + ProfileWithoutIdentitiesFavoriteThingsInner.validateJsonElement(jsonArrayfavoriteThings.get(i)); + }; + } + } + if (jsonObj.get("RelatedProfileViews") != null && !jsonObj.get("RelatedProfileViews").isJsonNull()) { + JsonArray jsonArrayrelatedProfileViews = jsonObj.getAsJsonArray("RelatedProfileViews"); + if (jsonArrayrelatedProfileViews != null) { + // ensure the json data is an array + if (!jsonObj.get("RelatedProfileViews").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RelatedProfileViews` to be an array in the JSON string but got `%s`", jsonObj.get("RelatedProfileViews").toString())); + } + + // validate the optional field `RelatedProfileViews` (array) + for (int i = 0; i < jsonArrayrelatedProfileViews.size(); i++) { + ProfileWithoutIdentitiesRelatedProfileViewsInner.validateJsonElement(jsonArrayrelatedProfileViews.get(i)); + }; + } + } + if (jsonObj.get("PlacesLived") != null && !jsonObj.get("PlacesLived").isJsonNull()) { + JsonArray jsonArrayplacesLived = jsonObj.getAsJsonArray("PlacesLived"); + if (jsonArrayplacesLived != null) { + // ensure the json data is an array + if (!jsonObj.get("PlacesLived").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PlacesLived` to be an array in the JSON string but got `%s`", jsonObj.get("PlacesLived").toString())); + } + + // validate the optional field `PlacesLived` (array) + for (int i = 0; i < jsonArrayplacesLived.size(); i++) { + ProfileWithoutIdentitiesPlacesLivedInner.validateJsonElement(jsonArrayplacesLived.get(i)); + }; + } + } + if (jsonObj.get("Publications") != null && !jsonObj.get("Publications").isJsonNull()) { + JsonArray jsonArraypublications = jsonObj.getAsJsonArray("Publications"); + if (jsonArraypublications != null) { + // ensure the json data is an array + if (!jsonObj.get("Publications").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Publications` to be an array in the JSON string but got `%s`", jsonObj.get("Publications").toString())); + } + + // validate the optional field `Publications` (array) + for (int i = 0; i < jsonArraypublications.size(); i++) { + ProfileWithoutIdentitiesPublicationsInner.validateJsonElement(jsonArraypublications.get(i)); + }; + } + } + if (jsonObj.get("JobBookmarks") != null && !jsonObj.get("JobBookmarks").isJsonNull()) { + JsonArray jsonArrayjobBookmarks = jsonObj.getAsJsonArray("JobBookmarks"); + if (jsonArrayjobBookmarks != null) { + // ensure the json data is an array + if (!jsonObj.get("JobBookmarks").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `JobBookmarks` to be an array in the JSON string but got `%s`", jsonObj.get("JobBookmarks").toString())); + } + + // validate the optional field `JobBookmarks` (array) + for (int i = 0; i < jsonArrayjobBookmarks.size(); i++) { + ProfileWithoutIdentitiesJobBookmarksInner.validateJsonElement(jsonArrayjobBookmarks.get(i)); + }; + } + } + if (jsonObj.get("Badges") != null && !jsonObj.get("Badges").isJsonNull()) { + JsonArray jsonArraybadges = jsonObj.getAsJsonArray("Badges"); + if (jsonArraybadges != null) { + // ensure the json data is an array + if (!jsonObj.get("Badges").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Badges` to be an array in the JSON string but got `%s`", jsonObj.get("Badges").toString())); + } + + // validate the optional field `Badges` (array) + for (int i = 0; i < jsonArraybadges.size(); i++) { + ProfileWithoutIdentitiesBadgesInner.validateJsonElement(jsonArraybadges.get(i)); + }; + } + } + if (jsonObj.get("MemberUrlResources") != null && !jsonObj.get("MemberUrlResources").isJsonNull()) { + JsonArray jsonArraymemberUrlResources = jsonObj.getAsJsonArray("MemberUrlResources"); + if (jsonArraymemberUrlResources != null) { + // ensure the json data is an array + if (!jsonObj.get("MemberUrlResources").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `MemberUrlResources` to be an array in the JSON string but got `%s`", jsonObj.get("MemberUrlResources").toString())); + } + + // validate the optional field `MemberUrlResources` (array) + for (int i = 0; i < jsonArraymemberUrlResources.size(); i++) { + ProfileWithoutIdentitiesMemberUrlResourcesInner.validateJsonElement(jsonArraymemberUrlResources.get(i)); + }; + } + } + if (jsonObj.get("Organizations") != null && !jsonObj.get("Organizations").isJsonNull()) { + JsonArray jsonArrayorganizations = jsonObj.getAsJsonArray("Organizations"); + if (jsonArrayorganizations != null) { + // ensure the json data is an array + if (!jsonObj.get("Organizations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Organizations` to be an array in the JSON string but got `%s`", jsonObj.get("Organizations").toString())); + } + + // validate the optional field `Organizations` (array) + for (int i = 0; i < jsonArrayorganizations.size(); i++) { + ProfileWithoutIdentitiesOrganizationsInner.validateJsonElement(jsonArrayorganizations.get(i)); + }; + } + } + if (jsonObj.get("Email") != null && !jsonObj.get("Email").isJsonNull()) { + JsonArray jsonArrayemail = jsonObj.getAsJsonArray("Email"); + if (jsonArrayemail != null) { + // ensure the json data is an array + if (!jsonObj.get("Email").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Email` to be an array in the JSON string but got `%s`", jsonObj.get("Email").toString())); + } + + // validate the optional field `Email` (array) + for (int i = 0; i < jsonArrayemail.size(); i++) { + ProfileWithoutIdentitiesUnverifiedEmailInner.validateJsonElement(jsonArrayemail.get(i)); + }; + } + } + // validate the optional field `PasskeyLogin` + if (jsonObj.get("PasskeyLogin") != null && !jsonObj.get("PasskeyLogin").isJsonNull()) { + ProfileWithoutIdentitiesPasskeyLogin.validateJsonElement(jsonObj.get("PasskeyLogin")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentities.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentities' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentities> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentities.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentities>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentities value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentities read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentities instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentities given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentities + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentities + */ + public static ProfileWithoutIdentities fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentities.class); + } + + /** + * Convert an instance of ProfileWithoutIdentities to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesAddressesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesAddressesInner.java new file mode 100644 index 0000000..44cabc2 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesAddressesInner.java @@ -0,0 +1,557 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesAddressesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesAddressesInner { + public static final String SERIALIZED_NAME_TYPE = "Type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_ADDRESS_TYPE = "AddressType"; + @SerializedName(SERIALIZED_NAME_ADDRESS_TYPE) + @javax.annotation.Nullable + private String addressType; + + public static final String SERIALIZED_NAME_ADDRESS1 = "Address1"; + @SerializedName(SERIALIZED_NAME_ADDRESS1) + @javax.annotation.Nullable + private String address1; + + public static final String SERIALIZED_NAME_ADDRESS2 = "Address2"; + @SerializedName(SERIALIZED_NAME_ADDRESS2) + @javax.annotation.Nullable + private String address2; + + public static final String SERIALIZED_NAME_CITY = "City"; + @SerializedName(SERIALIZED_NAME_CITY) + @javax.annotation.Nullable + private String city; + + public static final String SERIALIZED_NAME_STATE = "State"; + @SerializedName(SERIALIZED_NAME_STATE) + @javax.annotation.Nullable + private String state; + + public static final String SERIALIZED_NAME_POSTAL_CODE = "PostalCode"; + @SerializedName(SERIALIZED_NAME_POSTAL_CODE) + @javax.annotation.Nullable + private String postalCode; + + public static final String SERIALIZED_NAME_REGION = "Region"; + @SerializedName(SERIALIZED_NAME_REGION) + @javax.annotation.Nullable + private String region; + + public static final String SERIALIZED_NAME_OP = "Op"; + @SerializedName(SERIALIZED_NAME_OP) + @javax.annotation.Nullable + private String op; + + public static final String SERIALIZED_NAME_COUNTRY = "Country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + @javax.annotation.Nullable + private String country; + + public ProfileWithoutIdentitiesAddressesInner() { + } + + public ProfileWithoutIdentitiesAddressesInner type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public ProfileWithoutIdentitiesAddressesInner addressType(@javax.annotation.Nullable String addressType) { + this.addressType = addressType; + return this; + } + + /** + * Get addressType + * @return addressType + */ + @javax.annotation.Nullable + public String getAddressType() { + return addressType; + } + + public void setAddressType(@javax.annotation.Nullable String addressType) { + this.addressType = addressType; + } + + + public ProfileWithoutIdentitiesAddressesInner address1(@javax.annotation.Nullable String address1) { + this.address1 = address1; + return this; + } + + /** + * Get address1 + * @return address1 + */ + @javax.annotation.Nullable + public String getAddress1() { + return address1; + } + + public void setAddress1(@javax.annotation.Nullable String address1) { + this.address1 = address1; + } + + + public ProfileWithoutIdentitiesAddressesInner address2(@javax.annotation.Nullable String address2) { + this.address2 = address2; + return this; + } + + /** + * Get address2 + * @return address2 + */ + @javax.annotation.Nullable + public String getAddress2() { + return address2; + } + + public void setAddress2(@javax.annotation.Nullable String address2) { + this.address2 = address2; + } + + + public ProfileWithoutIdentitiesAddressesInner city(@javax.annotation.Nullable String city) { + this.city = city; + return this; + } + + /** + * Get city + * @return city + */ + @javax.annotation.Nullable + public String getCity() { + return city; + } + + public void setCity(@javax.annotation.Nullable String city) { + this.city = city; + } + + + public ProfileWithoutIdentitiesAddressesInner state(@javax.annotation.Nullable String state) { + this.state = state; + return this; + } + + /** + * Get state + * @return state + */ + @javax.annotation.Nullable + public String getState() { + return state; + } + + public void setState(@javax.annotation.Nullable String state) { + this.state = state; + } + + + public ProfileWithoutIdentitiesAddressesInner postalCode(@javax.annotation.Nullable String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** + * Get postalCode + * @return postalCode + */ + @javax.annotation.Nullable + public String getPostalCode() { + return postalCode; + } + + public void setPostalCode(@javax.annotation.Nullable String postalCode) { + this.postalCode = postalCode; + } + + + public ProfileWithoutIdentitiesAddressesInner region(@javax.annotation.Nullable String region) { + this.region = region; + return this; + } + + /** + * Get region + * @return region + */ + @javax.annotation.Nullable + public String getRegion() { + return region; + } + + public void setRegion(@javax.annotation.Nullable String region) { + this.region = region; + } + + + public ProfileWithoutIdentitiesAddressesInner op(@javax.annotation.Nullable String op) { + this.op = op; + return this; + } + + /** + * Get op + * @return op + */ + @javax.annotation.Nullable + public String getOp() { + return op; + } + + public void setOp(@javax.annotation.Nullable String op) { + this.op = op; + } + + + public ProfileWithoutIdentitiesAddressesInner country(@javax.annotation.Nullable String country) { + this.country = country; + return this; + } + + /** + * Get country + * @return country + */ + @javax.annotation.Nullable + public String getCountry() { + return country; + } + + public void setCountry(@javax.annotation.Nullable String country) { + this.country = country; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesAddressesInner instance itself + */ + public ProfileWithoutIdentitiesAddressesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesAddressesInner profileWithoutIdentitiesAddressesInner = (ProfileWithoutIdentitiesAddressesInner) o; + return Objects.equals(this.type, profileWithoutIdentitiesAddressesInner.type) && + Objects.equals(this.addressType, profileWithoutIdentitiesAddressesInner.addressType) && + Objects.equals(this.address1, profileWithoutIdentitiesAddressesInner.address1) && + Objects.equals(this.address2, profileWithoutIdentitiesAddressesInner.address2) && + Objects.equals(this.city, profileWithoutIdentitiesAddressesInner.city) && + Objects.equals(this.state, profileWithoutIdentitiesAddressesInner.state) && + Objects.equals(this.postalCode, profileWithoutIdentitiesAddressesInner.postalCode) && + Objects.equals(this.region, profileWithoutIdentitiesAddressesInner.region) && + Objects.equals(this.op, profileWithoutIdentitiesAddressesInner.op) && + Objects.equals(this.country, profileWithoutIdentitiesAddressesInner.country)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesAddressesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, addressType, address1, address2, city, state, postalCode, region, op, country, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesAddressesInner {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" addressType: ").append(toIndentedString(addressType)).append("\n"); + sb.append(" address1: ").append(toIndentedString(address1)).append("\n"); + sb.append(" address2: ").append(toIndentedString(address2)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" postalCode: ").append(toIndentedString(postalCode)).append("\n"); + sb.append(" region: ").append(toIndentedString(region)).append("\n"); + sb.append(" op: ").append(toIndentedString(op)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Type"); + openapiFields.add("AddressType"); + openapiFields.add("Address1"); + openapiFields.add("Address2"); + openapiFields.add("City"); + openapiFields.add("State"); + openapiFields.add("PostalCode"); + openapiFields.add("Region"); + openapiFields.add("Op"); + openapiFields.add("Country"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesAddressesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesAddressesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesAddressesInner is not found in the empty JSON string", ProfileWithoutIdentitiesAddressesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonNull()) && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + if ((jsonObj.get("AddressType") != null && !jsonObj.get("AddressType").isJsonNull()) && !jsonObj.get("AddressType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AddressType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AddressType").toString())); + } + if ((jsonObj.get("Address1") != null && !jsonObj.get("Address1").isJsonNull()) && !jsonObj.get("Address1").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Address1` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Address1").toString())); + } + if ((jsonObj.get("Address2") != null && !jsonObj.get("Address2").isJsonNull()) && !jsonObj.get("Address2").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Address2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Address2").toString())); + } + if ((jsonObj.get("City") != null && !jsonObj.get("City").isJsonNull()) && !jsonObj.get("City").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `City` to be a primitive type in the JSON string but got `%s`", jsonObj.get("City").toString())); + } + if ((jsonObj.get("State") != null && !jsonObj.get("State").isJsonNull()) && !jsonObj.get("State").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `State` to be a primitive type in the JSON string but got `%s`", jsonObj.get("State").toString())); + } + if ((jsonObj.get("PostalCode") != null && !jsonObj.get("PostalCode").isJsonNull()) && !jsonObj.get("PostalCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PostalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PostalCode").toString())); + } + if ((jsonObj.get("Region") != null && !jsonObj.get("Region").isJsonNull()) && !jsonObj.get("Region").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Region").toString())); + } + if ((jsonObj.get("Op") != null && !jsonObj.get("Op").isJsonNull()) && !jsonObj.get("Op").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Op` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Op").toString())); + } + if ((jsonObj.get("Country") != null && !jsonObj.get("Country").isJsonNull()) && !jsonObj.get("Country").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Country").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesAddressesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesAddressesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesAddressesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesAddressesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesAddressesInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesAddressesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesAddressesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesAddressesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesAddressesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesAddressesInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesAddressesInner + */ + public static ProfileWithoutIdentitiesAddressesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesAddressesInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesAddressesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesAwardsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesAwardsInner.java new file mode 100644 index 0000000..749e7f0 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesAwardsInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesAwardsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesAwardsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_ISSUER = "Issuer"; + @SerializedName(SERIALIZED_NAME_ISSUER) + @javax.annotation.Nullable + private String issuer; + + public ProfileWithoutIdentitiesAwardsInner() { + } + + public ProfileWithoutIdentitiesAwardsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileWithoutIdentitiesAwardsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileWithoutIdentitiesAwardsInner issuer(@javax.annotation.Nullable String issuer) { + this.issuer = issuer; + return this; + } + + /** + * Get issuer + * @return issuer + */ + @javax.annotation.Nullable + public String getIssuer() { + return issuer; + } + + public void setIssuer(@javax.annotation.Nullable String issuer) { + this.issuer = issuer; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesAwardsInner instance itself + */ + public ProfileWithoutIdentitiesAwardsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesAwardsInner profileWithoutIdentitiesAwardsInner = (ProfileWithoutIdentitiesAwardsInner) o; + return Objects.equals(this.id, profileWithoutIdentitiesAwardsInner.id) && + Objects.equals(this.name, profileWithoutIdentitiesAwardsInner.name) && + Objects.equals(this.issuer, profileWithoutIdentitiesAwardsInner.issuer)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesAwardsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, issuer, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesAwardsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" issuer: ").append(toIndentedString(issuer)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Issuer"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesAwardsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesAwardsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesAwardsInner is not found in the empty JSON string", ProfileWithoutIdentitiesAwardsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Issuer") != null && !jsonObj.get("Issuer").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesAwardsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesAwardsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesAwardsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesAwardsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesAwardsInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesAwardsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesAwardsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesAwardsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesAwardsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesAwardsInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesAwardsInner + */ + public static ProfileWithoutIdentitiesAwardsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesAwardsInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesAwardsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesBadgesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesBadgesInner.java new file mode 100644 index 0000000..aff0e1d --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesBadgesInner.java @@ -0,0 +1,467 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesBadgesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesBadgesInner { + public static final String SERIALIZED_NAME_BADGE_ID = "BadgeId"; + @SerializedName(SERIALIZED_NAME_BADGE_ID) + @javax.annotation.Nullable + private String badgeId; + + public static final String SERIALIZED_NAME_BAGE_ID = "BageId"; + @SerializedName(SERIALIZED_NAME_BAGE_ID) + @javax.annotation.Nullable + private String bageId; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_BADGE_MESSAGE = "BadgeMessage"; + @SerializedName(SERIALIZED_NAME_BADGE_MESSAGE) + @javax.annotation.Nullable + private String badgeMessage; + + public static final String SERIALIZED_NAME_BAGE_MESSAGE = "BageMessage"; + @SerializedName(SERIALIZED_NAME_BAGE_MESSAGE) + @javax.annotation.Nullable + private String bageMessage; + + public static final String SERIALIZED_NAME_DESCRIPTION = "Description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_IMAGE_URL = "ImageUrl"; + @SerializedName(SERIALIZED_NAME_IMAGE_URL) + @javax.annotation.Nullable + private String imageUrl; + + public ProfileWithoutIdentitiesBadgesInner() { + } + + public ProfileWithoutIdentitiesBadgesInner badgeId(@javax.annotation.Nullable String badgeId) { + this.badgeId = badgeId; + return this; + } + + /** + * Get badgeId + * @return badgeId + */ + @javax.annotation.Nullable + public String getBadgeId() { + return badgeId; + } + + public void setBadgeId(@javax.annotation.Nullable String badgeId) { + this.badgeId = badgeId; + } + + + public ProfileWithoutIdentitiesBadgesInner bageId(@javax.annotation.Nullable String bageId) { + this.bageId = bageId; + return this; + } + + /** + * Get bageId + * @return bageId + */ + @javax.annotation.Nullable + public String getBageId() { + return bageId; + } + + public void setBageId(@javax.annotation.Nullable String bageId) { + this.bageId = bageId; + } + + + public ProfileWithoutIdentitiesBadgesInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileWithoutIdentitiesBadgesInner badgeMessage(@javax.annotation.Nullable String badgeMessage) { + this.badgeMessage = badgeMessage; + return this; + } + + /** + * Get badgeMessage + * @return badgeMessage + */ + @javax.annotation.Nullable + public String getBadgeMessage() { + return badgeMessage; + } + + public void setBadgeMessage(@javax.annotation.Nullable String badgeMessage) { + this.badgeMessage = badgeMessage; + } + + + public ProfileWithoutIdentitiesBadgesInner bageMessage(@javax.annotation.Nullable String bageMessage) { + this.bageMessage = bageMessage; + return this; + } + + /** + * Get bageMessage + * @return bageMessage + */ + @javax.annotation.Nullable + public String getBageMessage() { + return bageMessage; + } + + public void setBageMessage(@javax.annotation.Nullable String bageMessage) { + this.bageMessage = bageMessage; + } + + + public ProfileWithoutIdentitiesBadgesInner description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public ProfileWithoutIdentitiesBadgesInner imageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** + * Get imageUrl + * @return imageUrl + */ + @javax.annotation.Nullable + public String getImageUrl() { + return imageUrl; + } + + public void setImageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesBadgesInner instance itself + */ + public ProfileWithoutIdentitiesBadgesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesBadgesInner profileWithoutIdentitiesBadgesInner = (ProfileWithoutIdentitiesBadgesInner) o; + return Objects.equals(this.badgeId, profileWithoutIdentitiesBadgesInner.badgeId) && + Objects.equals(this.bageId, profileWithoutIdentitiesBadgesInner.bageId) && + Objects.equals(this.name, profileWithoutIdentitiesBadgesInner.name) && + Objects.equals(this.badgeMessage, profileWithoutIdentitiesBadgesInner.badgeMessage) && + Objects.equals(this.bageMessage, profileWithoutIdentitiesBadgesInner.bageMessage) && + Objects.equals(this.description, profileWithoutIdentitiesBadgesInner.description) && + Objects.equals(this.imageUrl, profileWithoutIdentitiesBadgesInner.imageUrl)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesBadgesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(badgeId, bageId, name, badgeMessage, bageMessage, description, imageUrl, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesBadgesInner {\n"); + sb.append(" badgeId: ").append(toIndentedString(badgeId)).append("\n"); + sb.append(" bageId: ").append(toIndentedString(bageId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" badgeMessage: ").append(toIndentedString(badgeMessage)).append("\n"); + sb.append(" bageMessage: ").append(toIndentedString(bageMessage)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("BadgeId"); + openapiFields.add("BageId"); + openapiFields.add("Name"); + openapiFields.add("BadgeMessage"); + openapiFields.add("BageMessage"); + openapiFields.add("Description"); + openapiFields.add("ImageUrl"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesBadgesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesBadgesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesBadgesInner is not found in the empty JSON string", ProfileWithoutIdentitiesBadgesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("BadgeId") != null && !jsonObj.get("BadgeId").isJsonNull()) && !jsonObj.get("BadgeId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `BadgeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BadgeId").toString())); + } + if ((jsonObj.get("BageId") != null && !jsonObj.get("BageId").isJsonNull()) && !jsonObj.get("BageId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `BageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BageId").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("BadgeMessage") != null && !jsonObj.get("BadgeMessage").isJsonNull()) && !jsonObj.get("BadgeMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `BadgeMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BadgeMessage").toString())); + } + if ((jsonObj.get("BageMessage") != null && !jsonObj.get("BageMessage").isJsonNull()) && !jsonObj.get("BageMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `BageMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BageMessage").toString())); + } + if ((jsonObj.get("Description") != null && !jsonObj.get("Description").isJsonNull()) && !jsonObj.get("Description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Description").toString())); + } + if ((jsonObj.get("ImageUrl") != null && !jsonObj.get("ImageUrl").isJsonNull()) && !jsonObj.get("ImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ImageUrl").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesBadgesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesBadgesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesBadgesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesBadgesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesBadgesInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesBadgesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesBadgesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesBadgesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesBadgesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesBadgesInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesBadgesInner + */ + public static ProfileWithoutIdentitiesBadgesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesBadgesInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesBadgesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesBooksInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesBooksInner.java new file mode 100644 index 0000000..d85ab60 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesBooksInner.java @@ -0,0 +1,377 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesBooksInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesBooksInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_CATEGORY = "Category"; + @SerializedName(SERIALIZED_NAME_CATEGORY) + @javax.annotation.Nullable + private String category; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private String createdDate; + + public ProfileWithoutIdentitiesBooksInner() { + } + + public ProfileWithoutIdentitiesBooksInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileWithoutIdentitiesBooksInner category(@javax.annotation.Nullable String category) { + this.category = category; + return this; + } + + /** + * Get category + * @return category + */ + @javax.annotation.Nullable + public String getCategory() { + return category; + } + + public void setCategory(@javax.annotation.Nullable String category) { + this.category = category; + } + + + public ProfileWithoutIdentitiesBooksInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileWithoutIdentitiesBooksInner createdDate(@javax.annotation.Nullable String createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get createdDate + * @return createdDate + */ + @javax.annotation.Nullable + public String getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable String createdDate) { + this.createdDate = createdDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesBooksInner instance itself + */ + public ProfileWithoutIdentitiesBooksInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesBooksInner profileWithoutIdentitiesBooksInner = (ProfileWithoutIdentitiesBooksInner) o; + return Objects.equals(this.id, profileWithoutIdentitiesBooksInner.id) && + Objects.equals(this.category, profileWithoutIdentitiesBooksInner.category) && + Objects.equals(this.name, profileWithoutIdentitiesBooksInner.name) && + Objects.equals(this.createdDate, profileWithoutIdentitiesBooksInner.createdDate)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesBooksInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, createdDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesBooksInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Category"); + openapiFields.add("Name"); + openapiFields.add("CreatedDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesBooksInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesBooksInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesBooksInner is not found in the empty JSON string", ProfileWithoutIdentitiesBooksInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Category") != null && !jsonObj.get("Category").isJsonNull()) && !jsonObj.get("Category").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Category` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Category").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("CreatedDate") != null && !jsonObj.get("CreatedDate").isJsonNull()) && !jsonObj.get("CreatedDate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CreatedDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CreatedDate").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesBooksInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesBooksInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesBooksInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesBooksInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesBooksInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesBooksInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesBooksInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesBooksInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesBooksInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesBooksInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesBooksInner + */ + public static ProfileWithoutIdentitiesBooksInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesBooksInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesBooksInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesCertificationsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesCertificationsInner.java new file mode 100644 index 0000000..9888e5b --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesCertificationsInner.java @@ -0,0 +1,432 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesCertificationsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesCertificationsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_AUTHORITY = "Authority"; + @SerializedName(SERIALIZED_NAME_AUTHORITY) + @javax.annotation.Nullable + private String authority; + + public static final String SERIALIZED_NAME_NUMBER = "Number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + @javax.annotation.Nullable + private String number; + + public static final String SERIALIZED_NAME_START_DATE = "StartDate"; + @SerializedName(SERIALIZED_NAME_START_DATE) + @javax.annotation.Nullable + private OffsetDateTime startDate; + + public static final String SERIALIZED_NAME_END_DATE = "EndDate"; + @SerializedName(SERIALIZED_NAME_END_DATE) + @javax.annotation.Nullable + private OffsetDateTime endDate; + + public ProfileWithoutIdentitiesCertificationsInner() { + } + + public ProfileWithoutIdentitiesCertificationsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileWithoutIdentitiesCertificationsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileWithoutIdentitiesCertificationsInner authority(@javax.annotation.Nullable String authority) { + this.authority = authority; + return this; + } + + /** + * Get authority + * @return authority + */ + @javax.annotation.Nullable + public String getAuthority() { + return authority; + } + + public void setAuthority(@javax.annotation.Nullable String authority) { + this.authority = authority; + } + + + public ProfileWithoutIdentitiesCertificationsInner number(@javax.annotation.Nullable String number) { + this.number = number; + return this; + } + + /** + * Get number + * @return number + */ + @javax.annotation.Nullable + public String getNumber() { + return number; + } + + public void setNumber(@javax.annotation.Nullable String number) { + this.number = number; + } + + + public ProfileWithoutIdentitiesCertificationsInner startDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Get startDate + * @return startDate + */ + @javax.annotation.Nullable + public OffsetDateTime getStartDate() { + return startDate; + } + + public void setStartDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + } + + + public ProfileWithoutIdentitiesCertificationsInner endDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * Get endDate + * @return endDate + */ + @javax.annotation.Nullable + public OffsetDateTime getEndDate() { + return endDate; + } + + public void setEndDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesCertificationsInner instance itself + */ + public ProfileWithoutIdentitiesCertificationsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesCertificationsInner profileWithoutIdentitiesCertificationsInner = (ProfileWithoutIdentitiesCertificationsInner) o; + return Objects.equals(this.id, profileWithoutIdentitiesCertificationsInner.id) && + Objects.equals(this.name, profileWithoutIdentitiesCertificationsInner.name) && + Objects.equals(this.authority, profileWithoutIdentitiesCertificationsInner.authority) && + Objects.equals(this.number, profileWithoutIdentitiesCertificationsInner.number) && + Objects.equals(this.startDate, profileWithoutIdentitiesCertificationsInner.startDate) && + Objects.equals(this.endDate, profileWithoutIdentitiesCertificationsInner.endDate)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesCertificationsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, authority, number, startDate, endDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesCertificationsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" authority: ").append(toIndentedString(authority)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Authority"); + openapiFields.add("Number"); + openapiFields.add("StartDate"); + openapiFields.add("EndDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesCertificationsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesCertificationsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesCertificationsInner is not found in the empty JSON string", ProfileWithoutIdentitiesCertificationsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Authority") != null && !jsonObj.get("Authority").isJsonNull()) && !jsonObj.get("Authority").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Authority` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Authority").toString())); + } + if ((jsonObj.get("Number") != null && !jsonObj.get("Number").isJsonNull()) && !jsonObj.get("Number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Number").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesCertificationsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesCertificationsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesCertificationsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesCertificationsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesCertificationsInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesCertificationsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesCertificationsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesCertificationsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesCertificationsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesCertificationsInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesCertificationsInner + */ + public static ProfileWithoutIdentitiesCertificationsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesCertificationsInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesCertificationsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesConsentProfile.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesConsentProfile.java new file mode 100644 index 0000000..c39af5c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesConsentProfile.java @@ -0,0 +1,359 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesConsentProfileConsentsInner; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesConsentProfile + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesConsentProfile { + public static final String SERIALIZED_NAME_CONSENTS = "Consents"; + @SerializedName(SERIALIZED_NAME_CONSENTS) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesConsentProfileConsentsInner> consents = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ACCEPTED_CONSENT_VERSIONS = "AcceptedConsentVersions"; + @SerializedName(SERIALIZED_NAME_ACCEPTED_CONSENT_VERSIONS) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner> acceptedConsentVersions = new ArrayList<>(); + + public ProfileWithoutIdentitiesConsentProfile() { + } + + public ProfileWithoutIdentitiesConsentProfile consents(@javax.annotation.Nullable List<ProfileWithoutIdentitiesConsentProfileConsentsInner> consents) { + this.consents = consents; + return this; + } + + public ProfileWithoutIdentitiesConsentProfile addConsentsItem(ProfileWithoutIdentitiesConsentProfileConsentsInner consentsItem) { + if (this.consents == null) { + this.consents = new ArrayList<>(); + } + this.consents.add(consentsItem); + return this; + } + + /** + * Get consents + * @return consents + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesConsentProfileConsentsInner> getConsents() { + return consents; + } + + public void setConsents(@javax.annotation.Nullable List<ProfileWithoutIdentitiesConsentProfileConsentsInner> consents) { + this.consents = consents; + } + + + public ProfileWithoutIdentitiesConsentProfile acceptedConsentVersions(@javax.annotation.Nullable List<ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner> acceptedConsentVersions) { + this.acceptedConsentVersions = acceptedConsentVersions; + return this; + } + + public ProfileWithoutIdentitiesConsentProfile addAcceptedConsentVersionsItem(ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner acceptedConsentVersionsItem) { + if (this.acceptedConsentVersions == null) { + this.acceptedConsentVersions = new ArrayList<>(); + } + this.acceptedConsentVersions.add(acceptedConsentVersionsItem); + return this; + } + + /** + * Get acceptedConsentVersions + * @return acceptedConsentVersions + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner> getAcceptedConsentVersions() { + return acceptedConsentVersions; + } + + public void setAcceptedConsentVersions(@javax.annotation.Nullable List<ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner> acceptedConsentVersions) { + this.acceptedConsentVersions = acceptedConsentVersions; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesConsentProfile instance itself + */ + public ProfileWithoutIdentitiesConsentProfile putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesConsentProfile profileWithoutIdentitiesConsentProfile = (ProfileWithoutIdentitiesConsentProfile) o; + return Objects.equals(this.consents, profileWithoutIdentitiesConsentProfile.consents) && + Objects.equals(this.acceptedConsentVersions, profileWithoutIdentitiesConsentProfile.acceptedConsentVersions)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesConsentProfile.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(consents, acceptedConsentVersions, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesConsentProfile {\n"); + sb.append(" consents: ").append(toIndentedString(consents)).append("\n"); + sb.append(" acceptedConsentVersions: ").append(toIndentedString(acceptedConsentVersions)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Consents"); + openapiFields.add("AcceptedConsentVersions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesConsentProfile + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesConsentProfile.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesConsentProfile is not found in the empty JSON string", ProfileWithoutIdentitiesConsentProfile.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Consents") != null && !jsonObj.get("Consents").isJsonNull()) { + JsonArray jsonArrayconsents = jsonObj.getAsJsonArray("Consents"); + if (jsonArrayconsents != null) { + // ensure the json data is an array + if (!jsonObj.get("Consents").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Consents` to be an array in the JSON string but got `%s`", jsonObj.get("Consents").toString())); + } + + // validate the optional field `Consents` (array) + for (int i = 0; i < jsonArrayconsents.size(); i++) { + ProfileWithoutIdentitiesConsentProfileConsentsInner.validateJsonElement(jsonArrayconsents.get(i)); + }; + } + } + if (jsonObj.get("AcceptedConsentVersions") != null && !jsonObj.get("AcceptedConsentVersions").isJsonNull()) { + JsonArray jsonArrayacceptedConsentVersions = jsonObj.getAsJsonArray("AcceptedConsentVersions"); + if (jsonArrayacceptedConsentVersions != null) { + // ensure the json data is an array + if (!jsonObj.get("AcceptedConsentVersions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `AcceptedConsentVersions` to be an array in the JSON string but got `%s`", jsonObj.get("AcceptedConsentVersions").toString())); + } + + // validate the optional field `AcceptedConsentVersions` (array) + for (int i = 0; i < jsonArrayacceptedConsentVersions.size(); i++) { + ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner.validateJsonElement(jsonArrayacceptedConsentVersions.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesConsentProfile.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesConsentProfile' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesConsentProfile> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesConsentProfile.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesConsentProfile>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesConsentProfile value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesConsentProfile read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesConsentProfile instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesConsentProfile given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesConsentProfile + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesConsentProfile + */ + public static ProfileWithoutIdentitiesConsentProfile fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesConsentProfile.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesConsentProfile to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner.java new file mode 100644 index 0000000..8ee8a56 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner.java @@ -0,0 +1,344 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner { + public static final String SERIALIZED_NAME_IS_CUSTOM = "IsCustom"; + @SerializedName(SERIALIZED_NAME_IS_CUSTOM) + @javax.annotation.Nullable + private Boolean isCustom; + + public static final String SERIALIZED_NAME_EVENT = "Event"; + @SerializedName(SERIALIZED_NAME_EVENT) + @javax.annotation.Nullable + private String event; + + public static final String SERIALIZED_NAME_VERSION = "Version"; + @SerializedName(SERIALIZED_NAME_VERSION) + @javax.annotation.Nullable + private String version; + + public ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner() { + } + + public ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner isCustom(@javax.annotation.Nullable Boolean isCustom) { + this.isCustom = isCustom; + return this; + } + + /** + * Get isCustom + * @return isCustom + */ + @javax.annotation.Nullable + public Boolean getIsCustom() { + return isCustom; + } + + public void setIsCustom(@javax.annotation.Nullable Boolean isCustom) { + this.isCustom = isCustom; + } + + + public ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner event(@javax.annotation.Nullable String event) { + this.event = event; + return this; + } + + /** + * Get event + * @return event + */ + @javax.annotation.Nullable + public String getEvent() { + return event; + } + + public void setEvent(@javax.annotation.Nullable String event) { + this.event = event; + } + + + public ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner version(@javax.annotation.Nullable String version) { + this.version = version; + return this; + } + + /** + * Get version + * @return version + */ + @javax.annotation.Nullable + public String getVersion() { + return version; + } + + public void setVersion(@javax.annotation.Nullable String version) { + this.version = version; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner instance itself + */ + public ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner profileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner = (ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner) o; + return Objects.equals(this.isCustom, profileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner.isCustom) && + Objects.equals(this.event, profileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner.event) && + Objects.equals(this.version, profileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner.version)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isCustom, event, version, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner {\n"); + sb.append(" isCustom: ").append(toIndentedString(isCustom)).append("\n"); + sb.append(" event: ").append(toIndentedString(event)).append("\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsCustom"); + openapiFields.add("Event"); + openapiFields.add("Version"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner is not found in the empty JSON string", ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Event") != null && !jsonObj.get("Event").isJsonNull()) && !jsonObj.get("Event").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Event` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Event").toString())); + } + if ((jsonObj.get("Version") != null && !jsonObj.get("Version").isJsonNull()) && !jsonObj.get("Version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Version").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner + */ + public static ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesConsentProfileAcceptedConsentVersionsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesConsentProfileConsentsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesConsentProfileConsentsInner.java new file mode 100644 index 0000000..d7f2d99 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesConsentProfileConsentsInner.java @@ -0,0 +1,315 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesConsentProfileConsentsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesConsentProfileConsentsInner { + public static final String SERIALIZED_NAME_CONSENT_OPTION_ID = "ConsentOptionId"; + @SerializedName(SERIALIZED_NAME_CONSENT_OPTION_ID) + @javax.annotation.Nullable + private String consentOptionId; + + public static final String SERIALIZED_NAME_ACCEPTED_ON = "AcceptedOn"; + @SerializedName(SERIALIZED_NAME_ACCEPTED_ON) + @javax.annotation.Nullable + private OffsetDateTime acceptedOn; + + public ProfileWithoutIdentitiesConsentProfileConsentsInner() { + } + + public ProfileWithoutIdentitiesConsentProfileConsentsInner consentOptionId(@javax.annotation.Nullable String consentOptionId) { + this.consentOptionId = consentOptionId; + return this; + } + + /** + * Get consentOptionId + * @return consentOptionId + */ + @javax.annotation.Nullable + public String getConsentOptionId() { + return consentOptionId; + } + + public void setConsentOptionId(@javax.annotation.Nullable String consentOptionId) { + this.consentOptionId = consentOptionId; + } + + + public ProfileWithoutIdentitiesConsentProfileConsentsInner acceptedOn(@javax.annotation.Nullable OffsetDateTime acceptedOn) { + this.acceptedOn = acceptedOn; + return this; + } + + /** + * Get acceptedOn + * @return acceptedOn + */ + @javax.annotation.Nullable + public OffsetDateTime getAcceptedOn() { + return acceptedOn; + } + + public void setAcceptedOn(@javax.annotation.Nullable OffsetDateTime acceptedOn) { + this.acceptedOn = acceptedOn; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesConsentProfileConsentsInner instance itself + */ + public ProfileWithoutIdentitiesConsentProfileConsentsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesConsentProfileConsentsInner profileWithoutIdentitiesConsentProfileConsentsInner = (ProfileWithoutIdentitiesConsentProfileConsentsInner) o; + return Objects.equals(this.consentOptionId, profileWithoutIdentitiesConsentProfileConsentsInner.consentOptionId) && + Objects.equals(this.acceptedOn, profileWithoutIdentitiesConsentProfileConsentsInner.acceptedOn)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesConsentProfileConsentsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(consentOptionId, acceptedOn, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesConsentProfileConsentsInner {\n"); + sb.append(" consentOptionId: ").append(toIndentedString(consentOptionId)).append("\n"); + sb.append(" acceptedOn: ").append(toIndentedString(acceptedOn)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ConsentOptionId"); + openapiFields.add("AcceptedOn"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesConsentProfileConsentsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesConsentProfileConsentsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesConsentProfileConsentsInner is not found in the empty JSON string", ProfileWithoutIdentitiesConsentProfileConsentsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ConsentOptionId") != null && !jsonObj.get("ConsentOptionId").isJsonNull()) && !jsonObj.get("ConsentOptionId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ConsentOptionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ConsentOptionId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesConsentProfileConsentsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesConsentProfileConsentsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesConsentProfileConsentsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesConsentProfileConsentsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesConsentProfileConsentsInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesConsentProfileConsentsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesConsentProfileConsentsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesConsentProfileConsentsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesConsentProfileConsentsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesConsentProfileConsentsInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesConsentProfileConsentsInner + */ + public static ProfileWithoutIdentitiesConsentProfileConsentsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesConsentProfileConsentsInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesConsentProfileConsentsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesCoursesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesCoursesInner.java new file mode 100644 index 0000000..5dd541f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesCoursesInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesCoursesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesCoursesInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_NUMBER = "Number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + @javax.annotation.Nullable + private String number; + + public ProfileWithoutIdentitiesCoursesInner() { + } + + public ProfileWithoutIdentitiesCoursesInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileWithoutIdentitiesCoursesInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileWithoutIdentitiesCoursesInner number(@javax.annotation.Nullable String number) { + this.number = number; + return this; + } + + /** + * Get number + * @return number + */ + @javax.annotation.Nullable + public String getNumber() { + return number; + } + + public void setNumber(@javax.annotation.Nullable String number) { + this.number = number; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesCoursesInner instance itself + */ + public ProfileWithoutIdentitiesCoursesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesCoursesInner profileWithoutIdentitiesCoursesInner = (ProfileWithoutIdentitiesCoursesInner) o; + return Objects.equals(this.id, profileWithoutIdentitiesCoursesInner.id) && + Objects.equals(this.name, profileWithoutIdentitiesCoursesInner.name) && + Objects.equals(this.number, profileWithoutIdentitiesCoursesInner.number)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesCoursesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, number, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesCoursesInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Number"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesCoursesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesCoursesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesCoursesInner is not found in the empty JSON string", ProfileWithoutIdentitiesCoursesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Number") != null && !jsonObj.get("Number").isJsonNull()) && !jsonObj.get("Number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Number").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesCoursesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesCoursesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesCoursesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesCoursesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesCoursesInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesCoursesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesCoursesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesCoursesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesCoursesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesCoursesInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesCoursesInner + */ + public static ProfileWithoutIdentitiesCoursesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesCoursesInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesCoursesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesCurrentStatusInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesCurrentStatusInner.java new file mode 100644 index 0000000..3811fd1 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesCurrentStatusInner.java @@ -0,0 +1,375 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesCurrentStatusInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesCurrentStatusInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_TEXT = "Text"; + @SerializedName(SERIALIZED_NAME_TEXT) + @javax.annotation.Nullable + private String text; + + public static final String SERIALIZED_NAME_SOURCE = "Source"; + @SerializedName(SERIALIZED_NAME_SOURCE) + @javax.annotation.Nullable + private String source; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public ProfileWithoutIdentitiesCurrentStatusInner() { + } + + public ProfileWithoutIdentitiesCurrentStatusInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileWithoutIdentitiesCurrentStatusInner text(@javax.annotation.Nullable String text) { + this.text = text; + return this; + } + + /** + * Get text + * @return text + */ + @javax.annotation.Nullable + public String getText() { + return text; + } + + public void setText(@javax.annotation.Nullable String text) { + this.text = text; + } + + + public ProfileWithoutIdentitiesCurrentStatusInner source(@javax.annotation.Nullable String source) { + this.source = source; + return this; + } + + /** + * Get source + * @return source + */ + @javax.annotation.Nullable + public String getSource() { + return source; + } + + public void setSource(@javax.annotation.Nullable String source) { + this.source = source; + } + + + public ProfileWithoutIdentitiesCurrentStatusInner createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get createdDate + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesCurrentStatusInner instance itself + */ + public ProfileWithoutIdentitiesCurrentStatusInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesCurrentStatusInner profileWithoutIdentitiesCurrentStatusInner = (ProfileWithoutIdentitiesCurrentStatusInner) o; + return Objects.equals(this.id, profileWithoutIdentitiesCurrentStatusInner.id) && + Objects.equals(this.text, profileWithoutIdentitiesCurrentStatusInner.text) && + Objects.equals(this.source, profileWithoutIdentitiesCurrentStatusInner.source) && + Objects.equals(this.createdDate, profileWithoutIdentitiesCurrentStatusInner.createdDate)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesCurrentStatusInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, text, source, createdDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesCurrentStatusInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Text"); + openapiFields.add("Source"); + openapiFields.add("CreatedDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesCurrentStatusInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesCurrentStatusInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesCurrentStatusInner is not found in the empty JSON string", ProfileWithoutIdentitiesCurrentStatusInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Text") != null && !jsonObj.get("Text").isJsonNull()) && !jsonObj.get("Text").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Text").toString())); + } + if ((jsonObj.get("Source") != null && !jsonObj.get("Source").isJsonNull()) && !jsonObj.get("Source").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Source").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesCurrentStatusInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesCurrentStatusInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesCurrentStatusInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesCurrentStatusInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesCurrentStatusInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesCurrentStatusInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesCurrentStatusInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesCurrentStatusInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesCurrentStatusInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesCurrentStatusInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesCurrentStatusInner + */ + public static ProfileWithoutIdentitiesCurrentStatusInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesCurrentStatusInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesCurrentStatusInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesEducationsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesEducationsInner.java new file mode 100644 index 0000000..aac1cb9 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesEducationsInner.java @@ -0,0 +1,522 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesEducationsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesEducationsInner { + public static final String SERIALIZED_NAME_SCHOOL = "School"; + @SerializedName(SERIALIZED_NAME_SCHOOL) + @javax.annotation.Nullable + private String school; + + public static final String SERIALIZED_NAME_YEAR = "Year"; + @SerializedName(SERIALIZED_NAME_YEAR) + @javax.annotation.Nullable + private String year; + + public static final String SERIALIZED_NAME_TYPE = "Type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_NOTES = "Notes"; + @SerializedName(SERIALIZED_NAME_NOTES) + @javax.annotation.Nullable + private String notes; + + public static final String SERIALIZED_NAME_ACTIVITIES = "Activities"; + @SerializedName(SERIALIZED_NAME_ACTIVITIES) + @javax.annotation.Nullable + private String activities; + + public static final String SERIALIZED_NAME_DEGREE = "Degree"; + @SerializedName(SERIALIZED_NAME_DEGREE) + @javax.annotation.Nullable + private String degree; + + public static final String SERIALIZED_NAME_FIELD_OF_STUDY = "FieldOfStudy"; + @SerializedName(SERIALIZED_NAME_FIELD_OF_STUDY) + @javax.annotation.Nullable + private String fieldOfStudy; + + public static final String SERIALIZED_NAME_START_DATE = "StartDate"; + @SerializedName(SERIALIZED_NAME_START_DATE) + @javax.annotation.Nullable + private OffsetDateTime startDate; + + public static final String SERIALIZED_NAME_END_DATE = "EndDate"; + @SerializedName(SERIALIZED_NAME_END_DATE) + @javax.annotation.Nullable + private OffsetDateTime endDate; + + public ProfileWithoutIdentitiesEducationsInner() { + } + + public ProfileWithoutIdentitiesEducationsInner school(@javax.annotation.Nullable String school) { + this.school = school; + return this; + } + + /** + * Get school + * @return school + */ + @javax.annotation.Nullable + public String getSchool() { + return school; + } + + public void setSchool(@javax.annotation.Nullable String school) { + this.school = school; + } + + + public ProfileWithoutIdentitiesEducationsInner year(@javax.annotation.Nullable String year) { + this.year = year; + return this; + } + + /** + * Get year + * @return year + */ + @javax.annotation.Nullable + public String getYear() { + return year; + } + + public void setYear(@javax.annotation.Nullable String year) { + this.year = year; + } + + + public ProfileWithoutIdentitiesEducationsInner type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public ProfileWithoutIdentitiesEducationsInner notes(@javax.annotation.Nullable String notes) { + this.notes = notes; + return this; + } + + /** + * Get notes + * @return notes + */ + @javax.annotation.Nullable + public String getNotes() { + return notes; + } + + public void setNotes(@javax.annotation.Nullable String notes) { + this.notes = notes; + } + + + public ProfileWithoutIdentitiesEducationsInner activities(@javax.annotation.Nullable String activities) { + this.activities = activities; + return this; + } + + /** + * Get activities + * @return activities + */ + @javax.annotation.Nullable + public String getActivities() { + return activities; + } + + public void setActivities(@javax.annotation.Nullable String activities) { + this.activities = activities; + } + + + public ProfileWithoutIdentitiesEducationsInner degree(@javax.annotation.Nullable String degree) { + this.degree = degree; + return this; + } + + /** + * Get degree + * @return degree + */ + @javax.annotation.Nullable + public String getDegree() { + return degree; + } + + public void setDegree(@javax.annotation.Nullable String degree) { + this.degree = degree; + } + + + public ProfileWithoutIdentitiesEducationsInner fieldOfStudy(@javax.annotation.Nullable String fieldOfStudy) { + this.fieldOfStudy = fieldOfStudy; + return this; + } + + /** + * Get fieldOfStudy + * @return fieldOfStudy + */ + @javax.annotation.Nullable + public String getFieldOfStudy() { + return fieldOfStudy; + } + + public void setFieldOfStudy(@javax.annotation.Nullable String fieldOfStudy) { + this.fieldOfStudy = fieldOfStudy; + } + + + public ProfileWithoutIdentitiesEducationsInner startDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Get startDate + * @return startDate + */ + @javax.annotation.Nullable + public OffsetDateTime getStartDate() { + return startDate; + } + + public void setStartDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + } + + + public ProfileWithoutIdentitiesEducationsInner endDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * Get endDate + * @return endDate + */ + @javax.annotation.Nullable + public OffsetDateTime getEndDate() { + return endDate; + } + + public void setEndDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesEducationsInner instance itself + */ + public ProfileWithoutIdentitiesEducationsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesEducationsInner profileWithoutIdentitiesEducationsInner = (ProfileWithoutIdentitiesEducationsInner) o; + return Objects.equals(this.school, profileWithoutIdentitiesEducationsInner.school) && + Objects.equals(this.year, profileWithoutIdentitiesEducationsInner.year) && + Objects.equals(this.type, profileWithoutIdentitiesEducationsInner.type) && + Objects.equals(this.notes, profileWithoutIdentitiesEducationsInner.notes) && + Objects.equals(this.activities, profileWithoutIdentitiesEducationsInner.activities) && + Objects.equals(this.degree, profileWithoutIdentitiesEducationsInner.degree) && + Objects.equals(this.fieldOfStudy, profileWithoutIdentitiesEducationsInner.fieldOfStudy) && + Objects.equals(this.startDate, profileWithoutIdentitiesEducationsInner.startDate) && + Objects.equals(this.endDate, profileWithoutIdentitiesEducationsInner.endDate)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesEducationsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(school, year, type, notes, activities, degree, fieldOfStudy, startDate, endDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesEducationsInner {\n"); + sb.append(" school: ").append(toIndentedString(school)).append("\n"); + sb.append(" year: ").append(toIndentedString(year)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" notes: ").append(toIndentedString(notes)).append("\n"); + sb.append(" activities: ").append(toIndentedString(activities)).append("\n"); + sb.append(" degree: ").append(toIndentedString(degree)).append("\n"); + sb.append(" fieldOfStudy: ").append(toIndentedString(fieldOfStudy)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("School"); + openapiFields.add("Year"); + openapiFields.add("Type"); + openapiFields.add("Notes"); + openapiFields.add("Activities"); + openapiFields.add("Degree"); + openapiFields.add("FieldOfStudy"); + openapiFields.add("StartDate"); + openapiFields.add("EndDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesEducationsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesEducationsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesEducationsInner is not found in the empty JSON string", ProfileWithoutIdentitiesEducationsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("School") != null && !jsonObj.get("School").isJsonNull()) && !jsonObj.get("School").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `School` to be a primitive type in the JSON string but got `%s`", jsonObj.get("School").toString())); + } + if ((jsonObj.get("Year") != null && !jsonObj.get("Year").isJsonNull()) && !jsonObj.get("Year").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Year` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Year").toString())); + } + if ((jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonNull()) && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + if ((jsonObj.get("Notes") != null && !jsonObj.get("Notes").isJsonNull()) && !jsonObj.get("Notes").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Notes` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Notes").toString())); + } + if ((jsonObj.get("Activities") != null && !jsonObj.get("Activities").isJsonNull()) && !jsonObj.get("Activities").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Activities` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Activities").toString())); + } + if ((jsonObj.get("Degree") != null && !jsonObj.get("Degree").isJsonNull()) && !jsonObj.get("Degree").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Degree` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Degree").toString())); + } + if ((jsonObj.get("FieldOfStudy") != null && !jsonObj.get("FieldOfStudy").isJsonNull()) && !jsonObj.get("FieldOfStudy").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FieldOfStudy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FieldOfStudy").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesEducationsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesEducationsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesEducationsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesEducationsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesEducationsInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesEducationsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesEducationsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesEducationsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesEducationsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesEducationsInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesEducationsInner + */ + public static ProfileWithoutIdentitiesEducationsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesEducationsInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesEducationsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesExternalIdsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesExternalIdsInner.java new file mode 100644 index 0000000..287574c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesExternalIdsInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesExternalIdsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesExternalIdsInner { + public static final String SERIALIZED_NAME_OPERATION = "Operation"; + @SerializedName(SERIALIZED_NAME_OPERATION) + @javax.annotation.Nullable + private String operation; + + public static final String SERIALIZED_NAME_SOURCE = "Source"; + @SerializedName(SERIALIZED_NAME_SOURCE) + @javax.annotation.Nullable + private String source; + + public static final String SERIALIZED_NAME_SOURCE_ID = "SourceId"; + @SerializedName(SERIALIZED_NAME_SOURCE_ID) + @javax.annotation.Nullable + private String sourceId; + + public ProfileWithoutIdentitiesExternalIdsInner() { + } + + public ProfileWithoutIdentitiesExternalIdsInner operation(@javax.annotation.Nullable String operation) { + this.operation = operation; + return this; + } + + /** + * Get operation + * @return operation + */ + @javax.annotation.Nullable + public String getOperation() { + return operation; + } + + public void setOperation(@javax.annotation.Nullable String operation) { + this.operation = operation; + } + + + public ProfileWithoutIdentitiesExternalIdsInner source(@javax.annotation.Nullable String source) { + this.source = source; + return this; + } + + /** + * Get source + * @return source + */ + @javax.annotation.Nullable + public String getSource() { + return source; + } + + public void setSource(@javax.annotation.Nullable String source) { + this.source = source; + } + + + public ProfileWithoutIdentitiesExternalIdsInner sourceId(@javax.annotation.Nullable String sourceId) { + this.sourceId = sourceId; + return this; + } + + /** + * Get sourceId + * @return sourceId + */ + @javax.annotation.Nullable + public String getSourceId() { + return sourceId; + } + + public void setSourceId(@javax.annotation.Nullable String sourceId) { + this.sourceId = sourceId; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesExternalIdsInner instance itself + */ + public ProfileWithoutIdentitiesExternalIdsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesExternalIdsInner profileWithoutIdentitiesExternalIdsInner = (ProfileWithoutIdentitiesExternalIdsInner) o; + return Objects.equals(this.operation, profileWithoutIdentitiesExternalIdsInner.operation) && + Objects.equals(this.source, profileWithoutIdentitiesExternalIdsInner.source) && + Objects.equals(this.sourceId, profileWithoutIdentitiesExternalIdsInner.sourceId)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesExternalIdsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(operation, source, sourceId, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesExternalIdsInner {\n"); + sb.append(" operation: ").append(toIndentedString(operation)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" sourceId: ").append(toIndentedString(sourceId)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Operation"); + openapiFields.add("Source"); + openapiFields.add("SourceId"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesExternalIdsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesExternalIdsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesExternalIdsInner is not found in the empty JSON string", ProfileWithoutIdentitiesExternalIdsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Operation") != null && !jsonObj.get("Operation").isJsonNull()) && !jsonObj.get("Operation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Operation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Operation").toString())); + } + if ((jsonObj.get("Source") != null && !jsonObj.get("Source").isJsonNull()) && !jsonObj.get("Source").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Source").toString())); + } + if ((jsonObj.get("SourceId") != null && !jsonObj.get("SourceId").isJsonNull()) && !jsonObj.get("SourceId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SourceId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SourceId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesExternalIdsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesExternalIdsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesExternalIdsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesExternalIdsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesExternalIdsInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesExternalIdsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesExternalIdsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesExternalIdsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesExternalIdsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesExternalIdsInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesExternalIdsInner + */ + public static ProfileWithoutIdentitiesExternalIdsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesExternalIdsInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesExternalIdsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesFavoriteThingsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesFavoriteThingsInner.java new file mode 100644 index 0000000..9a8c3ce --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesFavoriteThingsInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesFavoriteThingsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesFavoriteThingsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_TYPE = "Type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public ProfileWithoutIdentitiesFavoriteThingsInner() { + } + + public ProfileWithoutIdentitiesFavoriteThingsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileWithoutIdentitiesFavoriteThingsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileWithoutIdentitiesFavoriteThingsInner type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesFavoriteThingsInner instance itself + */ + public ProfileWithoutIdentitiesFavoriteThingsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesFavoriteThingsInner profileWithoutIdentitiesFavoriteThingsInner = (ProfileWithoutIdentitiesFavoriteThingsInner) o; + return Objects.equals(this.id, profileWithoutIdentitiesFavoriteThingsInner.id) && + Objects.equals(this.name, profileWithoutIdentitiesFavoriteThingsInner.name) && + Objects.equals(this.type, profileWithoutIdentitiesFavoriteThingsInner.type)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesFavoriteThingsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesFavoriteThingsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesFavoriteThingsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesFavoriteThingsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesFavoriteThingsInner is not found in the empty JSON string", ProfileWithoutIdentitiesFavoriteThingsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Type") != null && !jsonObj.get("Type").isJsonNull()) && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesFavoriteThingsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesFavoriteThingsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesFavoriteThingsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesFavoriteThingsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesFavoriteThingsInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesFavoriteThingsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesFavoriteThingsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesFavoriteThingsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesFavoriteThingsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesFavoriteThingsInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesFavoriteThingsInner + */ + public static ProfileWithoutIdentitiesFavoriteThingsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesFavoriteThingsInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesFavoriteThingsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesGamesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesGamesInner.java new file mode 100644 index 0000000..7a6f492 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesGamesInner.java @@ -0,0 +1,375 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesGamesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesGamesInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_CATEGORY = "Category"; + @SerializedName(SERIALIZED_NAME_CATEGORY) + @javax.annotation.Nullable + private String category; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public ProfileWithoutIdentitiesGamesInner() { + } + + public ProfileWithoutIdentitiesGamesInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileWithoutIdentitiesGamesInner category(@javax.annotation.Nullable String category) { + this.category = category; + return this; + } + + /** + * Get category + * @return category + */ + @javax.annotation.Nullable + public String getCategory() { + return category; + } + + public void setCategory(@javax.annotation.Nullable String category) { + this.category = category; + } + + + public ProfileWithoutIdentitiesGamesInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileWithoutIdentitiesGamesInner createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get createdDate + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesGamesInner instance itself + */ + public ProfileWithoutIdentitiesGamesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesGamesInner profileWithoutIdentitiesGamesInner = (ProfileWithoutIdentitiesGamesInner) o; + return Objects.equals(this.id, profileWithoutIdentitiesGamesInner.id) && + Objects.equals(this.category, profileWithoutIdentitiesGamesInner.category) && + Objects.equals(this.name, profileWithoutIdentitiesGamesInner.name) && + Objects.equals(this.createdDate, profileWithoutIdentitiesGamesInner.createdDate)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesGamesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, createdDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesGamesInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Category"); + openapiFields.add("Name"); + openapiFields.add("CreatedDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesGamesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesGamesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesGamesInner is not found in the empty JSON string", ProfileWithoutIdentitiesGamesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Category") != null && !jsonObj.get("Category").isJsonNull()) && !jsonObj.get("Category").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Category` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Category").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesGamesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesGamesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesGamesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesGamesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesGamesInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesGamesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesGamesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesGamesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesGamesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesGamesInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesGamesInner + */ + public static ProfileWithoutIdentitiesGamesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesGamesInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesGamesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesIMAccountsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesIMAccountsInner.java new file mode 100644 index 0000000..8b4b369 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesIMAccountsInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesIMAccountsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesIMAccountsInner { + public static final String SERIALIZED_NAME_ACCOUNT_TYPE = "AccountType"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_TYPE) + @javax.annotation.Nullable + private String accountType; + + public static final String SERIALIZED_NAME_ACCOUNT_NAME = "AccountName"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NAME) + @javax.annotation.Nullable + private String accountName; + + public ProfileWithoutIdentitiesIMAccountsInner() { + } + + public ProfileWithoutIdentitiesIMAccountsInner accountType(@javax.annotation.Nullable String accountType) { + this.accountType = accountType; + return this; + } + + /** + * Get accountType + * @return accountType + */ + @javax.annotation.Nullable + public String getAccountType() { + return accountType; + } + + public void setAccountType(@javax.annotation.Nullable String accountType) { + this.accountType = accountType; + } + + + public ProfileWithoutIdentitiesIMAccountsInner accountName(@javax.annotation.Nullable String accountName) { + this.accountName = accountName; + return this; + } + + /** + * Get accountName + * @return accountName + */ + @javax.annotation.Nullable + public String getAccountName() { + return accountName; + } + + public void setAccountName(@javax.annotation.Nullable String accountName) { + this.accountName = accountName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesIMAccountsInner instance itself + */ + public ProfileWithoutIdentitiesIMAccountsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesIMAccountsInner profileWithoutIdentitiesIMAccountsInner = (ProfileWithoutIdentitiesIMAccountsInner) o; + return Objects.equals(this.accountType, profileWithoutIdentitiesIMAccountsInner.accountType) && + Objects.equals(this.accountName, profileWithoutIdentitiesIMAccountsInner.accountName)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesIMAccountsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accountType, accountName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesIMAccountsInner {\n"); + sb.append(" accountType: ").append(toIndentedString(accountType)).append("\n"); + sb.append(" accountName: ").append(toIndentedString(accountName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AccountType"); + openapiFields.add("AccountName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesIMAccountsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesIMAccountsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesIMAccountsInner is not found in the empty JSON string", ProfileWithoutIdentitiesIMAccountsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("AccountType") != null && !jsonObj.get("AccountType").isJsonNull()) && !jsonObj.get("AccountType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccountType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccountType").toString())); + } + if ((jsonObj.get("AccountName") != null && !jsonObj.get("AccountName").isJsonNull()) && !jsonObj.get("AccountName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccountName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccountName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesIMAccountsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesIMAccountsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesIMAccountsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesIMAccountsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesIMAccountsInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesIMAccountsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesIMAccountsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesIMAccountsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesIMAccountsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesIMAccountsInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesIMAccountsInner + */ + public static ProfileWithoutIdentitiesIMAccountsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesIMAccountsInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesIMAccountsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesInspirationalPeopleInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesInspirationalPeopleInner.java new file mode 100644 index 0000000..7c04130 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesInspirationalPeopleInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesInspirationalPeopleInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesInspirationalPeopleInner { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public ProfileWithoutIdentitiesInspirationalPeopleInner() { + } + + public ProfileWithoutIdentitiesInspirationalPeopleInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileWithoutIdentitiesInspirationalPeopleInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesInspirationalPeopleInner instance itself + */ + public ProfileWithoutIdentitiesInspirationalPeopleInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesInspirationalPeopleInner profileWithoutIdentitiesInspirationalPeopleInner = (ProfileWithoutIdentitiesInspirationalPeopleInner) o; + return Objects.equals(this.name, profileWithoutIdentitiesInspirationalPeopleInner.name) && + Objects.equals(this.id, profileWithoutIdentitiesInspirationalPeopleInner.id)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesInspirationalPeopleInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, id, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesInspirationalPeopleInner {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + openapiFields.add("Id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesInspirationalPeopleInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesInspirationalPeopleInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesInspirationalPeopleInner is not found in the empty JSON string", ProfileWithoutIdentitiesInspirationalPeopleInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesInspirationalPeopleInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesInspirationalPeopleInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesInspirationalPeopleInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesInspirationalPeopleInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesInspirationalPeopleInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesInspirationalPeopleInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesInspirationalPeopleInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesInspirationalPeopleInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesInspirationalPeopleInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesInspirationalPeopleInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesInspirationalPeopleInner + */ + public static ProfileWithoutIdentitiesInspirationalPeopleInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesInspirationalPeopleInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesInspirationalPeopleInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesInterestsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesInterestsInner.java new file mode 100644 index 0000000..6dc9c44 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesInterestsInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesInterestsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesInterestsInner { + public static final String SERIALIZED_NAME_INTEREST_TYPE = "InterestType"; + @SerializedName(SERIALIZED_NAME_INTEREST_TYPE) + @javax.annotation.Nullable + private String interestType; + + public static final String SERIALIZED_NAME_INTEREST_NAME = "InterestName"; + @SerializedName(SERIALIZED_NAME_INTEREST_NAME) + @javax.annotation.Nullable + private String interestName; + + public ProfileWithoutIdentitiesInterestsInner() { + } + + public ProfileWithoutIdentitiesInterestsInner interestType(@javax.annotation.Nullable String interestType) { + this.interestType = interestType; + return this; + } + + /** + * Get interestType + * @return interestType + */ + @javax.annotation.Nullable + public String getInterestType() { + return interestType; + } + + public void setInterestType(@javax.annotation.Nullable String interestType) { + this.interestType = interestType; + } + + + public ProfileWithoutIdentitiesInterestsInner interestName(@javax.annotation.Nullable String interestName) { + this.interestName = interestName; + return this; + } + + /** + * Get interestName + * @return interestName + */ + @javax.annotation.Nullable + public String getInterestName() { + return interestName; + } + + public void setInterestName(@javax.annotation.Nullable String interestName) { + this.interestName = interestName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesInterestsInner instance itself + */ + public ProfileWithoutIdentitiesInterestsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesInterestsInner profileWithoutIdentitiesInterestsInner = (ProfileWithoutIdentitiesInterestsInner) o; + return Objects.equals(this.interestType, profileWithoutIdentitiesInterestsInner.interestType) && + Objects.equals(this.interestName, profileWithoutIdentitiesInterestsInner.interestName)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesInterestsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(interestType, interestName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesInterestsInner {\n"); + sb.append(" interestType: ").append(toIndentedString(interestType)).append("\n"); + sb.append(" interestName: ").append(toIndentedString(interestName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("InterestType"); + openapiFields.add("InterestName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesInterestsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesInterestsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesInterestsInner is not found in the empty JSON string", ProfileWithoutIdentitiesInterestsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("InterestType") != null && !jsonObj.get("InterestType").isJsonNull()) && !jsonObj.get("InterestType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `InterestType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("InterestType").toString())); + } + if ((jsonObj.get("InterestName") != null && !jsonObj.get("InterestName").isJsonNull()) && !jsonObj.get("InterestName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `InterestName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("InterestName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesInterestsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesInterestsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesInterestsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesInterestsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesInterestsInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesInterestsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesInterestsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesInterestsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesInterestsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesInterestsInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesInterestsInner + */ + public static ProfileWithoutIdentitiesInterestsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesInterestsInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesInterestsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesJobBookmarksInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesJobBookmarksInner.java new file mode 100644 index 0000000..aa4aa3a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesJobBookmarksInner.java @@ -0,0 +1,398 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesJobBookmarksInnerJob; +import java.io.IOException; +import java.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesJobBookmarksInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesJobBookmarksInner { + public static final String SERIALIZED_NAME_IS_APPLIED = "IsApplied"; + @SerializedName(SERIALIZED_NAME_IS_APPLIED) + @javax.annotation.Nullable + private Boolean isApplied; + + public static final String SERIALIZED_NAME_IS_SAVED = "IsSaved"; + @SerializedName(SERIALIZED_NAME_IS_SAVED) + @javax.annotation.Nullable + private Boolean isSaved; + + public static final String SERIALIZED_NAME_APPLY_TIMESTAMP = "ApplyTimestamp"; + @SerializedName(SERIALIZED_NAME_APPLY_TIMESTAMP) + @javax.annotation.Nullable + private OffsetDateTime applyTimestamp; + + public static final String SERIALIZED_NAME_SAVED_TIMESTAMP = "SavedTimestamp"; + @SerializedName(SERIALIZED_NAME_SAVED_TIMESTAMP) + @javax.annotation.Nullable + private OffsetDateTime savedTimestamp; + + public static final String SERIALIZED_NAME_JOB = "Job"; + @SerializedName(SERIALIZED_NAME_JOB) + @javax.annotation.Nullable + private ProfileWithoutIdentitiesJobBookmarksInnerJob job; + + public ProfileWithoutIdentitiesJobBookmarksInner() { + } + + public ProfileWithoutIdentitiesJobBookmarksInner isApplied(@javax.annotation.Nullable Boolean isApplied) { + this.isApplied = isApplied; + return this; + } + + /** + * Get isApplied + * @return isApplied + */ + @javax.annotation.Nullable + public Boolean getIsApplied() { + return isApplied; + } + + public void setIsApplied(@javax.annotation.Nullable Boolean isApplied) { + this.isApplied = isApplied; + } + + + public ProfileWithoutIdentitiesJobBookmarksInner isSaved(@javax.annotation.Nullable Boolean isSaved) { + this.isSaved = isSaved; + return this; + } + + /** + * Get isSaved + * @return isSaved + */ + @javax.annotation.Nullable + public Boolean getIsSaved() { + return isSaved; + } + + public void setIsSaved(@javax.annotation.Nullable Boolean isSaved) { + this.isSaved = isSaved; + } + + + public ProfileWithoutIdentitiesJobBookmarksInner applyTimestamp(@javax.annotation.Nullable OffsetDateTime applyTimestamp) { + this.applyTimestamp = applyTimestamp; + return this; + } + + /** + * Get applyTimestamp + * @return applyTimestamp + */ + @javax.annotation.Nullable + public OffsetDateTime getApplyTimestamp() { + return applyTimestamp; + } + + public void setApplyTimestamp(@javax.annotation.Nullable OffsetDateTime applyTimestamp) { + this.applyTimestamp = applyTimestamp; + } + + + public ProfileWithoutIdentitiesJobBookmarksInner savedTimestamp(@javax.annotation.Nullable OffsetDateTime savedTimestamp) { + this.savedTimestamp = savedTimestamp; + return this; + } + + /** + * Get savedTimestamp + * @return savedTimestamp + */ + @javax.annotation.Nullable + public OffsetDateTime getSavedTimestamp() { + return savedTimestamp; + } + + public void setSavedTimestamp(@javax.annotation.Nullable OffsetDateTime savedTimestamp) { + this.savedTimestamp = savedTimestamp; + } + + + public ProfileWithoutIdentitiesJobBookmarksInner job(@javax.annotation.Nullable ProfileWithoutIdentitiesJobBookmarksInnerJob job) { + this.job = job; + return this; + } + + /** + * Get job + * @return job + */ + @javax.annotation.Nullable + public ProfileWithoutIdentitiesJobBookmarksInnerJob getJob() { + return job; + } + + public void setJob(@javax.annotation.Nullable ProfileWithoutIdentitiesJobBookmarksInnerJob job) { + this.job = job; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesJobBookmarksInner instance itself + */ + public ProfileWithoutIdentitiesJobBookmarksInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesJobBookmarksInner profileWithoutIdentitiesJobBookmarksInner = (ProfileWithoutIdentitiesJobBookmarksInner) o; + return Objects.equals(this.isApplied, profileWithoutIdentitiesJobBookmarksInner.isApplied) && + Objects.equals(this.isSaved, profileWithoutIdentitiesJobBookmarksInner.isSaved) && + Objects.equals(this.applyTimestamp, profileWithoutIdentitiesJobBookmarksInner.applyTimestamp) && + Objects.equals(this.savedTimestamp, profileWithoutIdentitiesJobBookmarksInner.savedTimestamp) && + Objects.equals(this.job, profileWithoutIdentitiesJobBookmarksInner.job)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesJobBookmarksInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isApplied, isSaved, applyTimestamp, savedTimestamp, job, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesJobBookmarksInner {\n"); + sb.append(" isApplied: ").append(toIndentedString(isApplied)).append("\n"); + sb.append(" isSaved: ").append(toIndentedString(isSaved)).append("\n"); + sb.append(" applyTimestamp: ").append(toIndentedString(applyTimestamp)).append("\n"); + sb.append(" savedTimestamp: ").append(toIndentedString(savedTimestamp)).append("\n"); + sb.append(" job: ").append(toIndentedString(job)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsApplied"); + openapiFields.add("IsSaved"); + openapiFields.add("ApplyTimestamp"); + openapiFields.add("SavedTimestamp"); + openapiFields.add("Job"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesJobBookmarksInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesJobBookmarksInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesJobBookmarksInner is not found in the empty JSON string", ProfileWithoutIdentitiesJobBookmarksInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `Job` + if (jsonObj.get("Job") != null && !jsonObj.get("Job").isJsonNull()) { + ProfileWithoutIdentitiesJobBookmarksInnerJob.validateJsonElement(jsonObj.get("Job")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesJobBookmarksInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesJobBookmarksInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesJobBookmarksInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesJobBookmarksInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesJobBookmarksInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesJobBookmarksInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesJobBookmarksInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesJobBookmarksInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesJobBookmarksInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesJobBookmarksInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesJobBookmarksInner + */ + public static ProfileWithoutIdentitiesJobBookmarksInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesJobBookmarksInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesJobBookmarksInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesJobBookmarksInnerJob.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesJobBookmarksInnerJob.java new file mode 100644 index 0000000..ba164e7 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesJobBookmarksInnerJob.java @@ -0,0 +1,436 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesJobBookmarksInnerJobCompony; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesJobBookmarksInnerJobPosition; +import java.io.IOException; +import java.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesJobBookmarksInnerJob + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesJobBookmarksInnerJob { + public static final String SERIALIZED_NAME_ACTIVE = "Active"; + @SerializedName(SERIALIZED_NAME_ACTIVE) + @javax.annotation.Nullable + private Boolean active; + + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_DESCRIPTION_SNIPPET = "DescriptionSnippet"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION_SNIPPET) + @javax.annotation.Nullable + private String descriptionSnippet; + + public static final String SERIALIZED_NAME_POSTING_TIMESTAMP = "PostingTimestamp"; + @SerializedName(SERIALIZED_NAME_POSTING_TIMESTAMP) + @javax.annotation.Nullable + private OffsetDateTime postingTimestamp; + + public static final String SERIALIZED_NAME_COMPONY = "Compony"; + @SerializedName(SERIALIZED_NAME_COMPONY) + @javax.annotation.Nullable + private ProfileWithoutIdentitiesJobBookmarksInnerJobCompony compony; + + public static final String SERIALIZED_NAME_POSITION = "Position"; + @SerializedName(SERIALIZED_NAME_POSITION) + @javax.annotation.Nullable + private ProfileWithoutIdentitiesJobBookmarksInnerJobPosition position; + + public ProfileWithoutIdentitiesJobBookmarksInnerJob() { + } + + public ProfileWithoutIdentitiesJobBookmarksInnerJob active(@javax.annotation.Nullable Boolean active) { + this.active = active; + return this; + } + + /** + * Get active + * @return active + */ + @javax.annotation.Nullable + public Boolean getActive() { + return active; + } + + public void setActive(@javax.annotation.Nullable Boolean active) { + this.active = active; + } + + + public ProfileWithoutIdentitiesJobBookmarksInnerJob id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileWithoutIdentitiesJobBookmarksInnerJob descriptionSnippet(@javax.annotation.Nullable String descriptionSnippet) { + this.descriptionSnippet = descriptionSnippet; + return this; + } + + /** + * Get descriptionSnippet + * @return descriptionSnippet + */ + @javax.annotation.Nullable + public String getDescriptionSnippet() { + return descriptionSnippet; + } + + public void setDescriptionSnippet(@javax.annotation.Nullable String descriptionSnippet) { + this.descriptionSnippet = descriptionSnippet; + } + + + public ProfileWithoutIdentitiesJobBookmarksInnerJob postingTimestamp(@javax.annotation.Nullable OffsetDateTime postingTimestamp) { + this.postingTimestamp = postingTimestamp; + return this; + } + + /** + * Get postingTimestamp + * @return postingTimestamp + */ + @javax.annotation.Nullable + public OffsetDateTime getPostingTimestamp() { + return postingTimestamp; + } + + public void setPostingTimestamp(@javax.annotation.Nullable OffsetDateTime postingTimestamp) { + this.postingTimestamp = postingTimestamp; + } + + + public ProfileWithoutIdentitiesJobBookmarksInnerJob compony(@javax.annotation.Nullable ProfileWithoutIdentitiesJobBookmarksInnerJobCompony compony) { + this.compony = compony; + return this; + } + + /** + * Get compony + * @return compony + */ + @javax.annotation.Nullable + public ProfileWithoutIdentitiesJobBookmarksInnerJobCompony getCompony() { + return compony; + } + + public void setCompony(@javax.annotation.Nullable ProfileWithoutIdentitiesJobBookmarksInnerJobCompony compony) { + this.compony = compony; + } + + + public ProfileWithoutIdentitiesJobBookmarksInnerJob position(@javax.annotation.Nullable ProfileWithoutIdentitiesJobBookmarksInnerJobPosition position) { + this.position = position; + return this; + } + + /** + * Get position + * @return position + */ + @javax.annotation.Nullable + public ProfileWithoutIdentitiesJobBookmarksInnerJobPosition getPosition() { + return position; + } + + public void setPosition(@javax.annotation.Nullable ProfileWithoutIdentitiesJobBookmarksInnerJobPosition position) { + this.position = position; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesJobBookmarksInnerJob instance itself + */ + public ProfileWithoutIdentitiesJobBookmarksInnerJob putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesJobBookmarksInnerJob profileWithoutIdentitiesJobBookmarksInnerJob = (ProfileWithoutIdentitiesJobBookmarksInnerJob) o; + return Objects.equals(this.active, profileWithoutIdentitiesJobBookmarksInnerJob.active) && + Objects.equals(this.id, profileWithoutIdentitiesJobBookmarksInnerJob.id) && + Objects.equals(this.descriptionSnippet, profileWithoutIdentitiesJobBookmarksInnerJob.descriptionSnippet) && + Objects.equals(this.postingTimestamp, profileWithoutIdentitiesJobBookmarksInnerJob.postingTimestamp) && + Objects.equals(this.compony, profileWithoutIdentitiesJobBookmarksInnerJob.compony) && + Objects.equals(this.position, profileWithoutIdentitiesJobBookmarksInnerJob.position)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesJobBookmarksInnerJob.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(active, id, descriptionSnippet, postingTimestamp, compony, position, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesJobBookmarksInnerJob {\n"); + sb.append(" active: ").append(toIndentedString(active)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" descriptionSnippet: ").append(toIndentedString(descriptionSnippet)).append("\n"); + sb.append(" postingTimestamp: ").append(toIndentedString(postingTimestamp)).append("\n"); + sb.append(" compony: ").append(toIndentedString(compony)).append("\n"); + sb.append(" position: ").append(toIndentedString(position)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Active"); + openapiFields.add("Id"); + openapiFields.add("DescriptionSnippet"); + openapiFields.add("PostingTimestamp"); + openapiFields.add("Compony"); + openapiFields.add("Position"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesJobBookmarksInnerJob + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesJobBookmarksInnerJob.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesJobBookmarksInnerJob is not found in the empty JSON string", ProfileWithoutIdentitiesJobBookmarksInnerJob.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("DescriptionSnippet") != null && !jsonObj.get("DescriptionSnippet").isJsonNull()) && !jsonObj.get("DescriptionSnippet").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DescriptionSnippet` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DescriptionSnippet").toString())); + } + // validate the optional field `Compony` + if (jsonObj.get("Compony") != null && !jsonObj.get("Compony").isJsonNull()) { + ProfileWithoutIdentitiesJobBookmarksInnerJobCompony.validateJsonElement(jsonObj.get("Compony")); + } + // validate the optional field `Position` + if (jsonObj.get("Position") != null && !jsonObj.get("Position").isJsonNull()) { + ProfileWithoutIdentitiesJobBookmarksInnerJobPosition.validateJsonElement(jsonObj.get("Position")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesJobBookmarksInnerJob.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesJobBookmarksInnerJob' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesJobBookmarksInnerJob> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesJobBookmarksInnerJob.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesJobBookmarksInnerJob>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesJobBookmarksInnerJob value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesJobBookmarksInnerJob read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesJobBookmarksInnerJob instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesJobBookmarksInnerJob given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesJobBookmarksInnerJob + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesJobBookmarksInnerJob + */ + public static ProfileWithoutIdentitiesJobBookmarksInnerJob fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesJobBookmarksInnerJob.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesJobBookmarksInnerJob to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesJobBookmarksInnerJobCompony.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesJobBookmarksInnerJobCompony.java new file mode 100644 index 0000000..ff5eead --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesJobBookmarksInnerJobCompony.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesJobBookmarksInnerJobCompony + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesJobBookmarksInnerJobCompony { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ProfileWithoutIdentitiesJobBookmarksInnerJobCompony() { + } + + public ProfileWithoutIdentitiesJobBookmarksInnerJobCompony id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileWithoutIdentitiesJobBookmarksInnerJobCompony name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesJobBookmarksInnerJobCompony instance itself + */ + public ProfileWithoutIdentitiesJobBookmarksInnerJobCompony putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesJobBookmarksInnerJobCompony profileWithoutIdentitiesJobBookmarksInnerJobCompony = (ProfileWithoutIdentitiesJobBookmarksInnerJobCompony) o; + return Objects.equals(this.id, profileWithoutIdentitiesJobBookmarksInnerJobCompony.id) && + Objects.equals(this.name, profileWithoutIdentitiesJobBookmarksInnerJobCompony.name)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesJobBookmarksInnerJobCompony.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesJobBookmarksInnerJobCompony {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesJobBookmarksInnerJobCompony + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesJobBookmarksInnerJobCompony.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesJobBookmarksInnerJobCompony is not found in the empty JSON string", ProfileWithoutIdentitiesJobBookmarksInnerJobCompony.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesJobBookmarksInnerJobCompony.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesJobBookmarksInnerJobCompony' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesJobBookmarksInnerJobCompony> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesJobBookmarksInnerJobCompony.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesJobBookmarksInnerJobCompony>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesJobBookmarksInnerJobCompony value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesJobBookmarksInnerJobCompony read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesJobBookmarksInnerJobCompony instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesJobBookmarksInnerJobCompony given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesJobBookmarksInnerJobCompony + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesJobBookmarksInnerJobCompony + */ + public static ProfileWithoutIdentitiesJobBookmarksInnerJobCompony fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesJobBookmarksInnerJobCompony.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesJobBookmarksInnerJobCompony to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesJobBookmarksInnerJobPosition.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesJobBookmarksInnerJobPosition.java new file mode 100644 index 0000000..2cb06d3 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesJobBookmarksInnerJobPosition.java @@ -0,0 +1,287 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesJobBookmarksInnerJobPosition + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesJobBookmarksInnerJobPosition { + public static final String SERIALIZED_NAME_TITLE = "Title"; + @SerializedName(SERIALIZED_NAME_TITLE) + @javax.annotation.Nullable + private String title; + + public ProfileWithoutIdentitiesJobBookmarksInnerJobPosition() { + } + + public ProfileWithoutIdentitiesJobBookmarksInnerJobPosition title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * Get title + * @return title + */ + @javax.annotation.Nullable + public String getTitle() { + return title; + } + + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesJobBookmarksInnerJobPosition instance itself + */ + public ProfileWithoutIdentitiesJobBookmarksInnerJobPosition putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesJobBookmarksInnerJobPosition profileWithoutIdentitiesJobBookmarksInnerJobPosition = (ProfileWithoutIdentitiesJobBookmarksInnerJobPosition) o; + return Objects.equals(this.title, profileWithoutIdentitiesJobBookmarksInnerJobPosition.title)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesJobBookmarksInnerJobPosition.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(title, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesJobBookmarksInnerJobPosition {\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Title"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesJobBookmarksInnerJobPosition + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesJobBookmarksInnerJobPosition.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesJobBookmarksInnerJobPosition is not found in the empty JSON string", ProfileWithoutIdentitiesJobBookmarksInnerJobPosition.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Title") != null && !jsonObj.get("Title").isJsonNull()) && !jsonObj.get("Title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Title").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesJobBookmarksInnerJobPosition.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesJobBookmarksInnerJobPosition' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesJobBookmarksInnerJobPosition> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesJobBookmarksInnerJobPosition.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesJobBookmarksInnerJobPosition>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesJobBookmarksInnerJobPosition value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesJobBookmarksInnerJobPosition read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesJobBookmarksInnerJobPosition instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesJobBookmarksInnerJobPosition given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesJobBookmarksInnerJobPosition + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesJobBookmarksInnerJobPosition + */ + public static ProfileWithoutIdentitiesJobBookmarksInnerJobPosition fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesJobBookmarksInnerJobPosition.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesJobBookmarksInnerJobPosition to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesKloutScore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesKloutScore.java new file mode 100644 index 0000000..d80925f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesKloutScore.java @@ -0,0 +1,314 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesKloutScore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesKloutScore { + public static final String SERIALIZED_NAME_KLOUT_ID = "KloutId"; + @SerializedName(SERIALIZED_NAME_KLOUT_ID) + @javax.annotation.Nullable + private String kloutId; + + public static final String SERIALIZED_NAME_SCORE = "Score"; + @SerializedName(SERIALIZED_NAME_SCORE) + @javax.annotation.Nullable + private Integer score; + + public ProfileWithoutIdentitiesKloutScore() { + } + + public ProfileWithoutIdentitiesKloutScore kloutId(@javax.annotation.Nullable String kloutId) { + this.kloutId = kloutId; + return this; + } + + /** + * Get kloutId + * @return kloutId + */ + @javax.annotation.Nullable + public String getKloutId() { + return kloutId; + } + + public void setKloutId(@javax.annotation.Nullable String kloutId) { + this.kloutId = kloutId; + } + + + public ProfileWithoutIdentitiesKloutScore score(@javax.annotation.Nullable Integer score) { + this.score = score; + return this; + } + + /** + * Get score + * @return score + */ + @javax.annotation.Nullable + public Integer getScore() { + return score; + } + + public void setScore(@javax.annotation.Nullable Integer score) { + this.score = score; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesKloutScore instance itself + */ + public ProfileWithoutIdentitiesKloutScore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesKloutScore profileWithoutIdentitiesKloutScore = (ProfileWithoutIdentitiesKloutScore) o; + return Objects.equals(this.kloutId, profileWithoutIdentitiesKloutScore.kloutId) && + Objects.equals(this.score, profileWithoutIdentitiesKloutScore.score)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesKloutScore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(kloutId, score, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesKloutScore {\n"); + sb.append(" kloutId: ").append(toIndentedString(kloutId)).append("\n"); + sb.append(" score: ").append(toIndentedString(score)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("KloutId"); + openapiFields.add("Score"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesKloutScore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesKloutScore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesKloutScore is not found in the empty JSON string", ProfileWithoutIdentitiesKloutScore.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("KloutId") != null && !jsonObj.get("KloutId").isJsonNull()) && !jsonObj.get("KloutId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `KloutId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("KloutId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesKloutScore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesKloutScore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesKloutScore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesKloutScore.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesKloutScore>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesKloutScore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesKloutScore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesKloutScore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesKloutScore given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesKloutScore + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesKloutScore + */ + public static ProfileWithoutIdentitiesKloutScore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesKloutScore.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesKloutScore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesLanguagesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesLanguagesInner.java new file mode 100644 index 0000000..6a7c39b --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesLanguagesInner.java @@ -0,0 +1,377 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesLanguagesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesLanguagesInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_PROFICIENCY = "Proficiency"; + @SerializedName(SERIALIZED_NAME_PROFICIENCY) + @javax.annotation.Nullable + private String proficiency; + + public static final String SERIALIZED_NAME_OP = "op"; + @SerializedName(SERIALIZED_NAME_OP) + @javax.annotation.Nullable + private String op; + + public ProfileWithoutIdentitiesLanguagesInner() { + } + + public ProfileWithoutIdentitiesLanguagesInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileWithoutIdentitiesLanguagesInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileWithoutIdentitiesLanguagesInner proficiency(@javax.annotation.Nullable String proficiency) { + this.proficiency = proficiency; + return this; + } + + /** + * Get proficiency + * @return proficiency + */ + @javax.annotation.Nullable + public String getProficiency() { + return proficiency; + } + + public void setProficiency(@javax.annotation.Nullable String proficiency) { + this.proficiency = proficiency; + } + + + public ProfileWithoutIdentitiesLanguagesInner op(@javax.annotation.Nullable String op) { + this.op = op; + return this; + } + + /** + * Get op + * @return op + */ + @javax.annotation.Nullable + public String getOp() { + return op; + } + + public void setOp(@javax.annotation.Nullable String op) { + this.op = op; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesLanguagesInner instance itself + */ + public ProfileWithoutIdentitiesLanguagesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesLanguagesInner profileWithoutIdentitiesLanguagesInner = (ProfileWithoutIdentitiesLanguagesInner) o; + return Objects.equals(this.id, profileWithoutIdentitiesLanguagesInner.id) && + Objects.equals(this.name, profileWithoutIdentitiesLanguagesInner.name) && + Objects.equals(this.proficiency, profileWithoutIdentitiesLanguagesInner.proficiency) && + Objects.equals(this.op, profileWithoutIdentitiesLanguagesInner.op)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesLanguagesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, proficiency, op, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesLanguagesInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" proficiency: ").append(toIndentedString(proficiency)).append("\n"); + sb.append(" op: ").append(toIndentedString(op)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Proficiency"); + openapiFields.add("op"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesLanguagesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesLanguagesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesLanguagesInner is not found in the empty JSON string", ProfileWithoutIdentitiesLanguagesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Proficiency") != null && !jsonObj.get("Proficiency").isJsonNull()) && !jsonObj.get("Proficiency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Proficiency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Proficiency").toString())); + } + if ((jsonObj.get("op") != null && !jsonObj.get("op").isJsonNull()) && !jsonObj.get("op").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `op` to be a primitive type in the JSON string but got `%s`", jsonObj.get("op").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesLanguagesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesLanguagesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesLanguagesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesLanguagesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesLanguagesInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesLanguagesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesLanguagesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesLanguagesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesLanguagesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesLanguagesInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesLanguagesInner + */ + public static ProfileWithoutIdentitiesLanguagesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesLanguagesInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesLanguagesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesMemberUrlResourcesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesMemberUrlResourcesInner.java new file mode 100644 index 0000000..d507298 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesMemberUrlResourcesInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesMemberUrlResourcesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesMemberUrlResourcesInner { + public static final String SERIALIZED_NAME_URL_NAME = "UrlName"; + @SerializedName(SERIALIZED_NAME_URL_NAME) + @javax.annotation.Nullable + private String urlName; + + public static final String SERIALIZED_NAME_URL = "Url"; + @SerializedName(SERIALIZED_NAME_URL) + @javax.annotation.Nullable + private String url; + + public ProfileWithoutIdentitiesMemberUrlResourcesInner() { + } + + public ProfileWithoutIdentitiesMemberUrlResourcesInner urlName(@javax.annotation.Nullable String urlName) { + this.urlName = urlName; + return this; + } + + /** + * Get urlName + * @return urlName + */ + @javax.annotation.Nullable + public String getUrlName() { + return urlName; + } + + public void setUrlName(@javax.annotation.Nullable String urlName) { + this.urlName = urlName; + } + + + public ProfileWithoutIdentitiesMemberUrlResourcesInner url(@javax.annotation.Nullable String url) { + this.url = url; + return this; + } + + /** + * Get url + * @return url + */ + @javax.annotation.Nullable + public String getUrl() { + return url; + } + + public void setUrl(@javax.annotation.Nullable String url) { + this.url = url; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesMemberUrlResourcesInner instance itself + */ + public ProfileWithoutIdentitiesMemberUrlResourcesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesMemberUrlResourcesInner profileWithoutIdentitiesMemberUrlResourcesInner = (ProfileWithoutIdentitiesMemberUrlResourcesInner) o; + return Objects.equals(this.urlName, profileWithoutIdentitiesMemberUrlResourcesInner.urlName) && + Objects.equals(this.url, profileWithoutIdentitiesMemberUrlResourcesInner.url)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesMemberUrlResourcesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(urlName, url, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesMemberUrlResourcesInner {\n"); + sb.append(" urlName: ").append(toIndentedString(urlName)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("UrlName"); + openapiFields.add("Url"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesMemberUrlResourcesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesMemberUrlResourcesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesMemberUrlResourcesInner is not found in the empty JSON string", ProfileWithoutIdentitiesMemberUrlResourcesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("UrlName") != null && !jsonObj.get("UrlName").isJsonNull()) && !jsonObj.get("UrlName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UrlName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UrlName").toString())); + } + if ((jsonObj.get("Url") != null && !jsonObj.get("Url").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesMemberUrlResourcesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesMemberUrlResourcesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesMemberUrlResourcesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesMemberUrlResourcesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesMemberUrlResourcesInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesMemberUrlResourcesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesMemberUrlResourcesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesMemberUrlResourcesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesMemberUrlResourcesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesMemberUrlResourcesInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesMemberUrlResourcesInner + */ + public static ProfileWithoutIdentitiesMemberUrlResourcesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesMemberUrlResourcesInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesMemberUrlResourcesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesMoviesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesMoviesInner.java new file mode 100644 index 0000000..aeef2a3 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesMoviesInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesMoviesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesMoviesInner { + public static final String SERIALIZED_NAME_MOVIE_NAME = "MovieName"; + @SerializedName(SERIALIZED_NAME_MOVIE_NAME) + @javax.annotation.Nullable + private String movieName; + + public static final String SERIALIZED_NAME_GENRE = "Genre"; + @SerializedName(SERIALIZED_NAME_GENRE) + @javax.annotation.Nullable + private String genre; + + public ProfileWithoutIdentitiesMoviesInner() { + } + + public ProfileWithoutIdentitiesMoviesInner movieName(@javax.annotation.Nullable String movieName) { + this.movieName = movieName; + return this; + } + + /** + * Get movieName + * @return movieName + */ + @javax.annotation.Nullable + public String getMovieName() { + return movieName; + } + + public void setMovieName(@javax.annotation.Nullable String movieName) { + this.movieName = movieName; + } + + + public ProfileWithoutIdentitiesMoviesInner genre(@javax.annotation.Nullable String genre) { + this.genre = genre; + return this; + } + + /** + * Get genre + * @return genre + */ + @javax.annotation.Nullable + public String getGenre() { + return genre; + } + + public void setGenre(@javax.annotation.Nullable String genre) { + this.genre = genre; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesMoviesInner instance itself + */ + public ProfileWithoutIdentitiesMoviesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesMoviesInner profileWithoutIdentitiesMoviesInner = (ProfileWithoutIdentitiesMoviesInner) o; + return Objects.equals(this.movieName, profileWithoutIdentitiesMoviesInner.movieName) && + Objects.equals(this.genre, profileWithoutIdentitiesMoviesInner.genre)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesMoviesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(movieName, genre, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesMoviesInner {\n"); + sb.append(" movieName: ").append(toIndentedString(movieName)).append("\n"); + sb.append(" genre: ").append(toIndentedString(genre)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("MovieName"); + openapiFields.add("Genre"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesMoviesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesMoviesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesMoviesInner is not found in the empty JSON string", ProfileWithoutIdentitiesMoviesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("MovieName") != null && !jsonObj.get("MovieName").isJsonNull()) && !jsonObj.get("MovieName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MovieName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MovieName").toString())); + } + if ((jsonObj.get("Genre") != null && !jsonObj.get("Genre").isJsonNull()) && !jsonObj.get("Genre").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Genre` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Genre").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesMoviesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesMoviesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesMoviesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesMoviesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesMoviesInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesMoviesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesMoviesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesMoviesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesMoviesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesMoviesInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesMoviesInner + */ + public static ProfileWithoutIdentitiesMoviesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesMoviesInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesMoviesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesMutualFriendsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesMutualFriendsInner.java new file mode 100644 index 0000000..d23c9cd --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesMutualFriendsInner.java @@ -0,0 +1,495 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesMutualFriendsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesMutualFriendsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_FIRST_NAME = "FirstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nullable + private String firstName; + + public static final String SERIALIZED_NAME_LAST_NAME = "LastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nullable + private String lastName; + + public static final String SERIALIZED_NAME_BIRTHDAY = "Birthday"; + @SerializedName(SERIALIZED_NAME_BIRTHDAY) + @javax.annotation.Nullable + private OffsetDateTime birthday; + + public static final String SERIALIZED_NAME_HOMETOWN = "Hometown"; + @SerializedName(SERIALIZED_NAME_HOMETOWN) + @javax.annotation.Nullable + private String hometown; + + public static final String SERIALIZED_NAME_LINK = "Link"; + @SerializedName(SERIALIZED_NAME_LINK) + @javax.annotation.Nullable + private String link; + + public static final String SERIALIZED_NAME_GENDER = "Gender"; + @SerializedName(SERIALIZED_NAME_GENDER) + @javax.annotation.Nullable + private String gender; + + public ProfileWithoutIdentitiesMutualFriendsInner() { + } + + public ProfileWithoutIdentitiesMutualFriendsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileWithoutIdentitiesMutualFriendsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileWithoutIdentitiesMutualFriendsInner firstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + */ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + } + + + public ProfileWithoutIdentitiesMutualFriendsInner lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + + public ProfileWithoutIdentitiesMutualFriendsInner birthday(@javax.annotation.Nullable OffsetDateTime birthday) { + this.birthday = birthday; + return this; + } + + /** + * Get birthday + * @return birthday + */ + @javax.annotation.Nullable + public OffsetDateTime getBirthday() { + return birthday; + } + + public void setBirthday(@javax.annotation.Nullable OffsetDateTime birthday) { + this.birthday = birthday; + } + + + public ProfileWithoutIdentitiesMutualFriendsInner hometown(@javax.annotation.Nullable String hometown) { + this.hometown = hometown; + return this; + } + + /** + * Get hometown + * @return hometown + */ + @javax.annotation.Nullable + public String getHometown() { + return hometown; + } + + public void setHometown(@javax.annotation.Nullable String hometown) { + this.hometown = hometown; + } + + + public ProfileWithoutIdentitiesMutualFriendsInner link(@javax.annotation.Nullable String link) { + this.link = link; + return this; + } + + /** + * Get link + * @return link + */ + @javax.annotation.Nullable + public String getLink() { + return link; + } + + public void setLink(@javax.annotation.Nullable String link) { + this.link = link; + } + + + public ProfileWithoutIdentitiesMutualFriendsInner gender(@javax.annotation.Nullable String gender) { + this.gender = gender; + return this; + } + + /** + * Get gender + * @return gender + */ + @javax.annotation.Nullable + public String getGender() { + return gender; + } + + public void setGender(@javax.annotation.Nullable String gender) { + this.gender = gender; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesMutualFriendsInner instance itself + */ + public ProfileWithoutIdentitiesMutualFriendsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesMutualFriendsInner profileWithoutIdentitiesMutualFriendsInner = (ProfileWithoutIdentitiesMutualFriendsInner) o; + return Objects.equals(this.id, profileWithoutIdentitiesMutualFriendsInner.id) && + Objects.equals(this.name, profileWithoutIdentitiesMutualFriendsInner.name) && + Objects.equals(this.firstName, profileWithoutIdentitiesMutualFriendsInner.firstName) && + Objects.equals(this.lastName, profileWithoutIdentitiesMutualFriendsInner.lastName) && + Objects.equals(this.birthday, profileWithoutIdentitiesMutualFriendsInner.birthday) && + Objects.equals(this.hometown, profileWithoutIdentitiesMutualFriendsInner.hometown) && + Objects.equals(this.link, profileWithoutIdentitiesMutualFriendsInner.link) && + Objects.equals(this.gender, profileWithoutIdentitiesMutualFriendsInner.gender)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesMutualFriendsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, firstName, lastName, birthday, hometown, link, gender, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesMutualFriendsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" birthday: ").append(toIndentedString(birthday)).append("\n"); + sb.append(" hometown: ").append(toIndentedString(hometown)).append("\n"); + sb.append(" link: ").append(toIndentedString(link)).append("\n"); + sb.append(" gender: ").append(toIndentedString(gender)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("FirstName"); + openapiFields.add("LastName"); + openapiFields.add("Birthday"); + openapiFields.add("Hometown"); + openapiFields.add("Link"); + openapiFields.add("Gender"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesMutualFriendsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesMutualFriendsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesMutualFriendsInner is not found in the empty JSON string", ProfileWithoutIdentitiesMutualFriendsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("FirstName") != null && !jsonObj.get("FirstName").isJsonNull()) && !jsonObj.get("FirstName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FirstName").toString())); + } + if ((jsonObj.get("LastName") != null && !jsonObj.get("LastName").isJsonNull()) && !jsonObj.get("LastName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastName").toString())); + } + if ((jsonObj.get("Hometown") != null && !jsonObj.get("Hometown").isJsonNull()) && !jsonObj.get("Hometown").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Hometown` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Hometown").toString())); + } + 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())); + } + if ((jsonObj.get("Gender") != null && !jsonObj.get("Gender").isJsonNull()) && !jsonObj.get("Gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Gender").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesMutualFriendsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesMutualFriendsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesMutualFriendsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesMutualFriendsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesMutualFriendsInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesMutualFriendsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesMutualFriendsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesMutualFriendsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesMutualFriendsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesMutualFriendsInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesMutualFriendsInner + */ + public static ProfileWithoutIdentitiesMutualFriendsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesMutualFriendsInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesMutualFriendsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesOrganizationsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesOrganizationsInner.java new file mode 100644 index 0000000..95c580c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesOrganizationsInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesOrganizationsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesOrganizationsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_LOGO_U_R_L = "LogoURL"; + @SerializedName(SERIALIZED_NAME_LOGO_U_R_L) + @javax.annotation.Nullable + private String logoURL; + + public ProfileWithoutIdentitiesOrganizationsInner() { + } + + public ProfileWithoutIdentitiesOrganizationsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileWithoutIdentitiesOrganizationsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileWithoutIdentitiesOrganizationsInner logoURL(@javax.annotation.Nullable String logoURL) { + this.logoURL = logoURL; + return this; + } + + /** + * Get logoURL + * @return logoURL + */ + @javax.annotation.Nullable + public String getLogoURL() { + return logoURL; + } + + public void setLogoURL(@javax.annotation.Nullable String logoURL) { + this.logoURL = logoURL; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesOrganizationsInner instance itself + */ + public ProfileWithoutIdentitiesOrganizationsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesOrganizationsInner profileWithoutIdentitiesOrganizationsInner = (ProfileWithoutIdentitiesOrganizationsInner) o; + return Objects.equals(this.id, profileWithoutIdentitiesOrganizationsInner.id) && + Objects.equals(this.name, profileWithoutIdentitiesOrganizationsInner.name) && + Objects.equals(this.logoURL, profileWithoutIdentitiesOrganizationsInner.logoURL)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesOrganizationsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, logoURL, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesOrganizationsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" logoURL: ").append(toIndentedString(logoURL)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("LogoURL"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesOrganizationsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesOrganizationsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesOrganizationsInner is not found in the empty JSON string", ProfileWithoutIdentitiesOrganizationsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("LogoURL") != null && !jsonObj.get("LogoURL").isJsonNull()) && !jsonObj.get("LogoURL").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LogoURL` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LogoURL").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesOrganizationsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesOrganizationsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesOrganizationsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesOrganizationsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesOrganizationsInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesOrganizationsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesOrganizationsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesOrganizationsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesOrganizationsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesOrganizationsInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesOrganizationsInner + */ + public static ProfileWithoutIdentitiesOrganizationsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesOrganizationsInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesOrganizationsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesPIN.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesPIN.java new file mode 100644 index 0000000..8744425 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesPIN.java @@ -0,0 +1,456 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesPIN + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesPIN { + public static final String SERIALIZED_NAME_SKIPPED = "Skipped"; + @SerializedName(SERIALIZED_NAME_SKIPPED) + @javax.annotation.Nullable + private Boolean skipped; + + public static final String SERIALIZED_NAME_LAST_P_I_N_CHANGE_TOKEN = "LastPINChangeToken"; + @SerializedName(SERIALIZED_NAME_LAST_P_I_N_CHANGE_TOKEN) + @javax.annotation.Nullable + private String lastPINChangeToken; + + public static final String SERIALIZED_NAME_LAST_P_I_N_CHANGE_DATE = "LastPINChangeDate"; + @SerializedName(SERIALIZED_NAME_LAST_P_I_N_CHANGE_DATE) + @javax.annotation.Nullable + private OffsetDateTime lastPINChangeDate; + + public static final String SERIALIZED_NAME_SKIPPED_DATE = "SkippedDate"; + @SerializedName(SERIALIZED_NAME_SKIPPED_DATE) + @javax.annotation.Nullable + private OffsetDateTime skippedDate; + + public static final String SERIALIZED_NAME_PI_N_HASHING_CONFIG = "PINHashingConfig"; + @SerializedName(SERIALIZED_NAME_PI_N_HASHING_CONFIG) + @javax.annotation.Nullable + private String piNHashingConfig; + + public static final String SERIALIZED_NAME_P_I_N = "PIN"; + @SerializedName(SERIALIZED_NAME_P_I_N) + @javax.annotation.Nullable + private String PIN; + + public static final String SERIALIZED_NAME_IS_P_I_N_SET = "IsPINSet"; + @SerializedName(SERIALIZED_NAME_IS_P_I_N_SET) + @javax.annotation.Nullable + private Boolean isPINSet; + + public ProfileWithoutIdentitiesPIN() { + } + + public ProfileWithoutIdentitiesPIN skipped(@javax.annotation.Nullable Boolean skipped) { + this.skipped = skipped; + return this; + } + + /** + * Get skipped + * @return skipped + */ + @javax.annotation.Nullable + public Boolean getSkipped() { + return skipped; + } + + public void setSkipped(@javax.annotation.Nullable Boolean skipped) { + this.skipped = skipped; + } + + + public ProfileWithoutIdentitiesPIN lastPINChangeToken(@javax.annotation.Nullable String lastPINChangeToken) { + this.lastPINChangeToken = lastPINChangeToken; + return this; + } + + /** + * Get lastPINChangeToken + * @return lastPINChangeToken + */ + @javax.annotation.Nullable + public String getLastPINChangeToken() { + return lastPINChangeToken; + } + + public void setLastPINChangeToken(@javax.annotation.Nullable String lastPINChangeToken) { + this.lastPINChangeToken = lastPINChangeToken; + } + + + public ProfileWithoutIdentitiesPIN lastPINChangeDate(@javax.annotation.Nullable OffsetDateTime lastPINChangeDate) { + this.lastPINChangeDate = lastPINChangeDate; + return this; + } + + /** + * Get lastPINChangeDate + * @return lastPINChangeDate + */ + @javax.annotation.Nullable + public OffsetDateTime getLastPINChangeDate() { + return lastPINChangeDate; + } + + public void setLastPINChangeDate(@javax.annotation.Nullable OffsetDateTime lastPINChangeDate) { + this.lastPINChangeDate = lastPINChangeDate; + } + + + public ProfileWithoutIdentitiesPIN skippedDate(@javax.annotation.Nullable OffsetDateTime skippedDate) { + this.skippedDate = skippedDate; + return this; + } + + /** + * Get skippedDate + * @return skippedDate + */ + @javax.annotation.Nullable + public OffsetDateTime getSkippedDate() { + return skippedDate; + } + + public void setSkippedDate(@javax.annotation.Nullable OffsetDateTime skippedDate) { + this.skippedDate = skippedDate; + } + + + public ProfileWithoutIdentitiesPIN piNHashingConfig(@javax.annotation.Nullable String piNHashingConfig) { + this.piNHashingConfig = piNHashingConfig; + return this; + } + + /** + * Get piNHashingConfig + * @return piNHashingConfig + */ + @javax.annotation.Nullable + public String getPiNHashingConfig() { + return piNHashingConfig; + } + + public void setPiNHashingConfig(@javax.annotation.Nullable String piNHashingConfig) { + this.piNHashingConfig = piNHashingConfig; + } + + + public ProfileWithoutIdentitiesPIN PIN(@javax.annotation.Nullable String PIN) { + this.PIN = PIN; + return this; + } + + /** + * Get PIN + * @return PIN + */ + @javax.annotation.Nullable + public String getPIN() { + return PIN; + } + + public void setPIN(@javax.annotation.Nullable String PIN) { + this.PIN = PIN; + } + + + public ProfileWithoutIdentitiesPIN isPINSet(@javax.annotation.Nullable Boolean isPINSet) { + this.isPINSet = isPINSet; + return this; + } + + /** + * Get isPINSet + * @return isPINSet + */ + @javax.annotation.Nullable + public Boolean getIsPINSet() { + return isPINSet; + } + + public void setIsPINSet(@javax.annotation.Nullable Boolean isPINSet) { + this.isPINSet = isPINSet; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesPIN instance itself + */ + public ProfileWithoutIdentitiesPIN putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesPIN profileWithoutIdentitiesPIN = (ProfileWithoutIdentitiesPIN) o; + return Objects.equals(this.skipped, profileWithoutIdentitiesPIN.skipped) && + Objects.equals(this.lastPINChangeToken, profileWithoutIdentitiesPIN.lastPINChangeToken) && + Objects.equals(this.lastPINChangeDate, profileWithoutIdentitiesPIN.lastPINChangeDate) && + Objects.equals(this.skippedDate, profileWithoutIdentitiesPIN.skippedDate) && + Objects.equals(this.piNHashingConfig, profileWithoutIdentitiesPIN.piNHashingConfig) && + Objects.equals(this.PIN, profileWithoutIdentitiesPIN.PIN) && + Objects.equals(this.isPINSet, profileWithoutIdentitiesPIN.isPINSet)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesPIN.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(skipped, lastPINChangeToken, lastPINChangeDate, skippedDate, piNHashingConfig, PIN, isPINSet, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesPIN {\n"); + sb.append(" skipped: ").append(toIndentedString(skipped)).append("\n"); + sb.append(" lastPINChangeToken: ").append(toIndentedString(lastPINChangeToken)).append("\n"); + sb.append(" lastPINChangeDate: ").append(toIndentedString(lastPINChangeDate)).append("\n"); + sb.append(" skippedDate: ").append(toIndentedString(skippedDate)).append("\n"); + sb.append(" piNHashingConfig: ").append(toIndentedString(piNHashingConfig)).append("\n"); + sb.append(" PIN: ").append(toIndentedString(PIN)).append("\n"); + sb.append(" isPINSet: ").append(toIndentedString(isPINSet)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Skipped"); + openapiFields.add("LastPINChangeToken"); + openapiFields.add("LastPINChangeDate"); + openapiFields.add("SkippedDate"); + openapiFields.add("PINHashingConfig"); + openapiFields.add("PIN"); + openapiFields.add("IsPINSet"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesPIN + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesPIN.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesPIN is not found in the empty JSON string", ProfileWithoutIdentitiesPIN.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("LastPINChangeToken") != null && !jsonObj.get("LastPINChangeToken").isJsonNull()) && !jsonObj.get("LastPINChangeToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastPINChangeToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastPINChangeToken").toString())); + } + if ((jsonObj.get("PINHashingConfig") != null && !jsonObj.get("PINHashingConfig").isJsonNull()) && !jsonObj.get("PINHashingConfig").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PINHashingConfig` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PINHashingConfig").toString())); + } + if ((jsonObj.get("PIN") != null && !jsonObj.get("PIN").isJsonNull()) && !jsonObj.get("PIN").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PIN` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PIN").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesPIN.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesPIN' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesPIN> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesPIN.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesPIN>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesPIN value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesPIN read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesPIN instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesPIN given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesPIN + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesPIN + */ + public static ProfileWithoutIdentitiesPIN fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesPIN.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesPIN to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesPasskeyLogin.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesPasskeyLogin.java new file mode 100644 index 0000000..4b2ad6d --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesPasskeyLogin.java @@ -0,0 +1,339 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesPasskeyLogin + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesPasskeyLogin { + public static final String SERIALIZED_NAME_PROGRESSIVE_FLAG = "ProgressiveFlag"; + @SerializedName(SERIALIZED_NAME_PROGRESSIVE_FLAG) + @javax.annotation.Nullable + private Boolean progressiveFlag; + + public static final String SERIALIZED_NAME_LOCAL_ENROLLMENT_FLAG = "LocalEnrollmentFlag"; + @SerializedName(SERIALIZED_NAME_LOCAL_ENROLLMENT_FLAG) + @javax.annotation.Nullable + private Boolean localEnrollmentFlag; + + public static final String SERIALIZED_NAME_PROGRESSIVE_ENROLLMENT_DATE = "ProgressiveEnrollmentDate"; + @SerializedName(SERIALIZED_NAME_PROGRESSIVE_ENROLLMENT_DATE) + @javax.annotation.Nullable + private OffsetDateTime progressiveEnrollmentDate; + + public ProfileWithoutIdentitiesPasskeyLogin() { + } + + public ProfileWithoutIdentitiesPasskeyLogin progressiveFlag(@javax.annotation.Nullable Boolean progressiveFlag) { + this.progressiveFlag = progressiveFlag; + return this; + } + + /** + * Get progressiveFlag + * @return progressiveFlag + */ + @javax.annotation.Nullable + public Boolean getProgressiveFlag() { + return progressiveFlag; + } + + public void setProgressiveFlag(@javax.annotation.Nullable Boolean progressiveFlag) { + this.progressiveFlag = progressiveFlag; + } + + + public ProfileWithoutIdentitiesPasskeyLogin localEnrollmentFlag(@javax.annotation.Nullable Boolean localEnrollmentFlag) { + this.localEnrollmentFlag = localEnrollmentFlag; + return this; + } + + /** + * Get localEnrollmentFlag + * @return localEnrollmentFlag + */ + @javax.annotation.Nullable + public Boolean getLocalEnrollmentFlag() { + return localEnrollmentFlag; + } + + public void setLocalEnrollmentFlag(@javax.annotation.Nullable Boolean localEnrollmentFlag) { + this.localEnrollmentFlag = localEnrollmentFlag; + } + + + public ProfileWithoutIdentitiesPasskeyLogin progressiveEnrollmentDate(@javax.annotation.Nullable OffsetDateTime progressiveEnrollmentDate) { + this.progressiveEnrollmentDate = progressiveEnrollmentDate; + return this; + } + + /** + * Get progressiveEnrollmentDate + * @return progressiveEnrollmentDate + */ + @javax.annotation.Nullable + public OffsetDateTime getProgressiveEnrollmentDate() { + return progressiveEnrollmentDate; + } + + public void setProgressiveEnrollmentDate(@javax.annotation.Nullable OffsetDateTime progressiveEnrollmentDate) { + this.progressiveEnrollmentDate = progressiveEnrollmentDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesPasskeyLogin instance itself + */ + public ProfileWithoutIdentitiesPasskeyLogin putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesPasskeyLogin profileWithoutIdentitiesPasskeyLogin = (ProfileWithoutIdentitiesPasskeyLogin) o; + return Objects.equals(this.progressiveFlag, profileWithoutIdentitiesPasskeyLogin.progressiveFlag) && + Objects.equals(this.localEnrollmentFlag, profileWithoutIdentitiesPasskeyLogin.localEnrollmentFlag) && + Objects.equals(this.progressiveEnrollmentDate, profileWithoutIdentitiesPasskeyLogin.progressiveEnrollmentDate)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesPasskeyLogin.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(progressiveFlag, localEnrollmentFlag, progressiveEnrollmentDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesPasskeyLogin {\n"); + sb.append(" progressiveFlag: ").append(toIndentedString(progressiveFlag)).append("\n"); + sb.append(" localEnrollmentFlag: ").append(toIndentedString(localEnrollmentFlag)).append("\n"); + sb.append(" progressiveEnrollmentDate: ").append(toIndentedString(progressiveEnrollmentDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ProgressiveFlag"); + openapiFields.add("LocalEnrollmentFlag"); + openapiFields.add("ProgressiveEnrollmentDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesPasskeyLogin + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesPasskeyLogin.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesPasskeyLogin is not found in the empty JSON string", ProfileWithoutIdentitiesPasskeyLogin.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesPasskeyLogin.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesPasskeyLogin' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesPasskeyLogin> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesPasskeyLogin.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesPasskeyLogin>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesPasskeyLogin value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesPasskeyLogin read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesPasskeyLogin instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesPasskeyLogin given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesPasskeyLogin + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesPasskeyLogin + */ + public static ProfileWithoutIdentitiesPasskeyLogin fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesPasskeyLogin.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesPasskeyLogin to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesPatentsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesPatentsInner.java new file mode 100644 index 0000000..cebc4f3 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesPatentsInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesPatentsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesPatentsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_TITLE = "Title"; + @SerializedName(SERIALIZED_NAME_TITLE) + @javax.annotation.Nullable + private String title; + + public static final String SERIALIZED_NAME_DATE = "Date"; + @SerializedName(SERIALIZED_NAME_DATE) + @javax.annotation.Nullable + private String date; + + public ProfileWithoutIdentitiesPatentsInner() { + } + + public ProfileWithoutIdentitiesPatentsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileWithoutIdentitiesPatentsInner title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * Get title + * @return title + */ + @javax.annotation.Nullable + public String getTitle() { + return title; + } + + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + public ProfileWithoutIdentitiesPatentsInner date(@javax.annotation.Nullable String date) { + this.date = date; + return this; + } + + /** + * Get date + * @return date + */ + @javax.annotation.Nullable + public String getDate() { + return date; + } + + public void setDate(@javax.annotation.Nullable String date) { + this.date = date; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesPatentsInner instance itself + */ + public ProfileWithoutIdentitiesPatentsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesPatentsInner profileWithoutIdentitiesPatentsInner = (ProfileWithoutIdentitiesPatentsInner) o; + return Objects.equals(this.id, profileWithoutIdentitiesPatentsInner.id) && + Objects.equals(this.title, profileWithoutIdentitiesPatentsInner.title) && + Objects.equals(this.date, profileWithoutIdentitiesPatentsInner.date)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesPatentsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, title, date, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesPatentsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Title"); + openapiFields.add("Date"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesPatentsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesPatentsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesPatentsInner is not found in the empty JSON string", ProfileWithoutIdentitiesPatentsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Title") != null && !jsonObj.get("Title").isJsonNull()) && !jsonObj.get("Title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Title").toString())); + } + if ((jsonObj.get("Date") != null && !jsonObj.get("Date").isJsonNull()) && !jsonObj.get("Date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Date").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesPatentsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesPatentsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesPatentsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesPatentsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesPatentsInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesPatentsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesPatentsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesPatentsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesPatentsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesPatentsInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesPatentsInner + */ + public static ProfileWithoutIdentitiesPatentsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesPatentsInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesPatentsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesPhoneNumbersInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesPhoneNumbersInner.java new file mode 100644 index 0000000..d95c483 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesPhoneNumbersInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesPhoneNumbersInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesPhoneNumbersInner { + public static final String SERIALIZED_NAME_PHONE_TYPE = "PhoneType"; + @SerializedName(SERIALIZED_NAME_PHONE_TYPE) + @javax.annotation.Nullable + private String phoneType; + + public static final String SERIALIZED_NAME_PHONE_NUMBER = "PhoneNumber"; + @SerializedName(SERIALIZED_NAME_PHONE_NUMBER) + @javax.annotation.Nullable + private String phoneNumber; + + public static final String SERIALIZED_NAME_OP = "op"; + @SerializedName(SERIALIZED_NAME_OP) + @javax.annotation.Nullable + private String op; + + public ProfileWithoutIdentitiesPhoneNumbersInner() { + } + + public ProfileWithoutIdentitiesPhoneNumbersInner phoneType(@javax.annotation.Nullable String phoneType) { + this.phoneType = phoneType; + return this; + } + + /** + * Get phoneType + * @return phoneType + */ + @javax.annotation.Nullable + public String getPhoneType() { + return phoneType; + } + + public void setPhoneType(@javax.annotation.Nullable String phoneType) { + this.phoneType = phoneType; + } + + + public ProfileWithoutIdentitiesPhoneNumbersInner phoneNumber(@javax.annotation.Nullable String phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + * Get phoneNumber + * @return phoneNumber + */ + @javax.annotation.Nullable + public String getPhoneNumber() { + return phoneNumber; + } + + public void setPhoneNumber(@javax.annotation.Nullable String phoneNumber) { + this.phoneNumber = phoneNumber; + } + + + public ProfileWithoutIdentitiesPhoneNumbersInner op(@javax.annotation.Nullable String op) { + this.op = op; + return this; + } + + /** + * Get op + * @return op + */ + @javax.annotation.Nullable + public String getOp() { + return op; + } + + public void setOp(@javax.annotation.Nullable String op) { + this.op = op; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesPhoneNumbersInner instance itself + */ + public ProfileWithoutIdentitiesPhoneNumbersInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesPhoneNumbersInner profileWithoutIdentitiesPhoneNumbersInner = (ProfileWithoutIdentitiesPhoneNumbersInner) o; + return Objects.equals(this.phoneType, profileWithoutIdentitiesPhoneNumbersInner.phoneType) && + Objects.equals(this.phoneNumber, profileWithoutIdentitiesPhoneNumbersInner.phoneNumber) && + Objects.equals(this.op, profileWithoutIdentitiesPhoneNumbersInner.op)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesPhoneNumbersInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(phoneType, phoneNumber, op, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesPhoneNumbersInner {\n"); + sb.append(" phoneType: ").append(toIndentedString(phoneType)).append("\n"); + sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); + sb.append(" op: ").append(toIndentedString(op)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("PhoneType"); + openapiFields.add("PhoneNumber"); + openapiFields.add("op"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesPhoneNumbersInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesPhoneNumbersInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesPhoneNumbersInner is not found in the empty JSON string", ProfileWithoutIdentitiesPhoneNumbersInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("PhoneType") != null && !jsonObj.get("PhoneType").isJsonNull()) && !jsonObj.get("PhoneType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PhoneType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PhoneType").toString())); + } + if ((jsonObj.get("PhoneNumber") != null && !jsonObj.get("PhoneNumber").isJsonNull()) && !jsonObj.get("PhoneNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PhoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PhoneNumber").toString())); + } + if ((jsonObj.get("op") != null && !jsonObj.get("op").isJsonNull()) && !jsonObj.get("op").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `op` to be a primitive type in the JSON string but got `%s`", jsonObj.get("op").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesPhoneNumbersInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesPhoneNumbersInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesPhoneNumbersInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesPhoneNumbersInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesPhoneNumbersInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesPhoneNumbersInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesPhoneNumbersInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesPhoneNumbersInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesPhoneNumbersInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesPhoneNumbersInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesPhoneNumbersInner + */ + public static ProfileWithoutIdentitiesPhoneNumbersInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesPhoneNumbersInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesPhoneNumbersInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesPlacesLivedInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesPlacesLivedInner.java new file mode 100644 index 0000000..d305863 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesPlacesLivedInner.java @@ -0,0 +1,344 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesPlacesLivedInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesPlacesLivedInner { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_OPERATION = "Operation"; + @SerializedName(SERIALIZED_NAME_OPERATION) + @javax.annotation.Nullable + private String operation; + + public static final String SERIALIZED_NAME_IS_PRIMARY = "IsPrimary"; + @SerializedName(SERIALIZED_NAME_IS_PRIMARY) + @javax.annotation.Nullable + private Boolean isPrimary; + + public ProfileWithoutIdentitiesPlacesLivedInner() { + } + + public ProfileWithoutIdentitiesPlacesLivedInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileWithoutIdentitiesPlacesLivedInner operation(@javax.annotation.Nullable String operation) { + this.operation = operation; + return this; + } + + /** + * Get operation + * @return operation + */ + @javax.annotation.Nullable + public String getOperation() { + return operation; + } + + public void setOperation(@javax.annotation.Nullable String operation) { + this.operation = operation; + } + + + public ProfileWithoutIdentitiesPlacesLivedInner isPrimary(@javax.annotation.Nullable Boolean isPrimary) { + this.isPrimary = isPrimary; + return this; + } + + /** + * Get isPrimary + * @return isPrimary + */ + @javax.annotation.Nullable + public Boolean getIsPrimary() { + return isPrimary; + } + + public void setIsPrimary(@javax.annotation.Nullable Boolean isPrimary) { + this.isPrimary = isPrimary; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesPlacesLivedInner instance itself + */ + public ProfileWithoutIdentitiesPlacesLivedInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesPlacesLivedInner profileWithoutIdentitiesPlacesLivedInner = (ProfileWithoutIdentitiesPlacesLivedInner) o; + return Objects.equals(this.name, profileWithoutIdentitiesPlacesLivedInner.name) && + Objects.equals(this.operation, profileWithoutIdentitiesPlacesLivedInner.operation) && + Objects.equals(this.isPrimary, profileWithoutIdentitiesPlacesLivedInner.isPrimary)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesPlacesLivedInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, operation, isPrimary, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesPlacesLivedInner {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" operation: ").append(toIndentedString(operation)).append("\n"); + sb.append(" isPrimary: ").append(toIndentedString(isPrimary)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + openapiFields.add("Operation"); + openapiFields.add("IsPrimary"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesPlacesLivedInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesPlacesLivedInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesPlacesLivedInner is not found in the empty JSON string", ProfileWithoutIdentitiesPlacesLivedInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Operation") != null && !jsonObj.get("Operation").isJsonNull()) && !jsonObj.get("Operation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Operation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Operation").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesPlacesLivedInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesPlacesLivedInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesPlacesLivedInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesPlacesLivedInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesPlacesLivedInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesPlacesLivedInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesPlacesLivedInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesPlacesLivedInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesPlacesLivedInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesPlacesLivedInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesPlacesLivedInner + */ + public static ProfileWithoutIdentitiesPlacesLivedInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesPlacesLivedInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesPlacesLivedInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesPositionsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesPositionsInner.java new file mode 100644 index 0000000..2ca7232 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesPositionsInner.java @@ -0,0 +1,431 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesPositionsInnerCompany; +import java.io.IOException; +import java.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesPositionsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesPositionsInner { + public static final String SERIALIZED_NAME_POSITION = "Position"; + @SerializedName(SERIALIZED_NAME_POSITION) + @javax.annotation.Nullable + private String position; + + public static final String SERIALIZED_NAME_SUMMARY = "Summary"; + @SerializedName(SERIALIZED_NAME_SUMMARY) + @javax.annotation.Nullable + private String summary; + + public static final String SERIALIZED_NAME_START_DATE = "StartDate"; + @SerializedName(SERIALIZED_NAME_START_DATE) + @javax.annotation.Nullable + private OffsetDateTime startDate; + + public static final String SERIALIZED_NAME_END_DATE = "EndDate"; + @SerializedName(SERIALIZED_NAME_END_DATE) + @javax.annotation.Nullable + private OffsetDateTime endDate; + + public static final String SERIALIZED_NAME_IS_CURRENT = "IsCurrent"; + @SerializedName(SERIALIZED_NAME_IS_CURRENT) + @javax.annotation.Nullable + private Boolean isCurrent; + + public static final String SERIALIZED_NAME_COMPANY = "Company"; + @SerializedName(SERIALIZED_NAME_COMPANY) + @javax.annotation.Nullable + private ProfileWithoutIdentitiesPositionsInnerCompany company; + + public ProfileWithoutIdentitiesPositionsInner() { + } + + public ProfileWithoutIdentitiesPositionsInner position(@javax.annotation.Nullable String position) { + this.position = position; + return this; + } + + /** + * Get position + * @return position + */ + @javax.annotation.Nullable + public String getPosition() { + return position; + } + + public void setPosition(@javax.annotation.Nullable String position) { + this.position = position; + } + + + public ProfileWithoutIdentitiesPositionsInner summary(@javax.annotation.Nullable String summary) { + this.summary = summary; + return this; + } + + /** + * Get summary + * @return summary + */ + @javax.annotation.Nullable + public String getSummary() { + return summary; + } + + public void setSummary(@javax.annotation.Nullable String summary) { + this.summary = summary; + } + + + public ProfileWithoutIdentitiesPositionsInner startDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Get startDate + * @return startDate + */ + @javax.annotation.Nullable + public OffsetDateTime getStartDate() { + return startDate; + } + + public void setStartDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + } + + + public ProfileWithoutIdentitiesPositionsInner endDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * Get endDate + * @return endDate + */ + @javax.annotation.Nullable + public OffsetDateTime getEndDate() { + return endDate; + } + + public void setEndDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + } + + + public ProfileWithoutIdentitiesPositionsInner isCurrent(@javax.annotation.Nullable Boolean isCurrent) { + this.isCurrent = isCurrent; + return this; + } + + /** + * Get isCurrent + * @return isCurrent + */ + @javax.annotation.Nullable + public Boolean getIsCurrent() { + return isCurrent; + } + + public void setIsCurrent(@javax.annotation.Nullable Boolean isCurrent) { + this.isCurrent = isCurrent; + } + + + public ProfileWithoutIdentitiesPositionsInner company(@javax.annotation.Nullable ProfileWithoutIdentitiesPositionsInnerCompany company) { + this.company = company; + return this; + } + + /** + * Get company + * @return company + */ + @javax.annotation.Nullable + public ProfileWithoutIdentitiesPositionsInnerCompany getCompany() { + return company; + } + + public void setCompany(@javax.annotation.Nullable ProfileWithoutIdentitiesPositionsInnerCompany company) { + this.company = company; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesPositionsInner instance itself + */ + public ProfileWithoutIdentitiesPositionsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesPositionsInner profileWithoutIdentitiesPositionsInner = (ProfileWithoutIdentitiesPositionsInner) o; + return Objects.equals(this.position, profileWithoutIdentitiesPositionsInner.position) && + Objects.equals(this.summary, profileWithoutIdentitiesPositionsInner.summary) && + Objects.equals(this.startDate, profileWithoutIdentitiesPositionsInner.startDate) && + Objects.equals(this.endDate, profileWithoutIdentitiesPositionsInner.endDate) && + Objects.equals(this.isCurrent, profileWithoutIdentitiesPositionsInner.isCurrent) && + Objects.equals(this.company, profileWithoutIdentitiesPositionsInner.company)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesPositionsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(position, summary, startDate, endDate, isCurrent, company, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesPositionsInner {\n"); + sb.append(" position: ").append(toIndentedString(position)).append("\n"); + sb.append(" summary: ").append(toIndentedString(summary)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" isCurrent: ").append(toIndentedString(isCurrent)).append("\n"); + sb.append(" company: ").append(toIndentedString(company)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Position"); + openapiFields.add("Summary"); + openapiFields.add("StartDate"); + openapiFields.add("EndDate"); + openapiFields.add("IsCurrent"); + openapiFields.add("Company"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesPositionsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesPositionsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesPositionsInner is not found in the empty JSON string", ProfileWithoutIdentitiesPositionsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Position") != null && !jsonObj.get("Position").isJsonNull()) && !jsonObj.get("Position").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Position` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Position").toString())); + } + if ((jsonObj.get("Summary") != null && !jsonObj.get("Summary").isJsonNull()) && !jsonObj.get("Summary").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Summary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Summary").toString())); + } + // validate the optional field `Company` + if (jsonObj.get("Company") != null && !jsonObj.get("Company").isJsonNull()) { + ProfileWithoutIdentitiesPositionsInnerCompany.validateJsonElement(jsonObj.get("Company")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesPositionsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesPositionsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesPositionsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesPositionsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesPositionsInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesPositionsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesPositionsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesPositionsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesPositionsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesPositionsInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesPositionsInner + */ + public static ProfileWithoutIdentitiesPositionsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesPositionsInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesPositionsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesPositionsInnerCompany.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesPositionsInnerCompany.java new file mode 100644 index 0000000..4c399fe --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesPositionsInnerCompany.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesPositionsInnerCompany + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesPositionsInnerCompany { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_TYPE = "Type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_INDUSTRY = "Industry"; + @SerializedName(SERIALIZED_NAME_INDUSTRY) + @javax.annotation.Nullable + private String industry; + + public ProfileWithoutIdentitiesPositionsInnerCompany() { + } + + public ProfileWithoutIdentitiesPositionsInnerCompany name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileWithoutIdentitiesPositionsInnerCompany type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public ProfileWithoutIdentitiesPositionsInnerCompany industry(@javax.annotation.Nullable String industry) { + this.industry = industry; + return this; + } + + /** + * Get industry + * @return industry + */ + @javax.annotation.Nullable + public String getIndustry() { + return industry; + } + + public void setIndustry(@javax.annotation.Nullable String industry) { + this.industry = industry; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesPositionsInnerCompany instance itself + */ + public ProfileWithoutIdentitiesPositionsInnerCompany putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesPositionsInnerCompany profileWithoutIdentitiesPositionsInnerCompany = (ProfileWithoutIdentitiesPositionsInnerCompany) o; + return Objects.equals(this.name, profileWithoutIdentitiesPositionsInnerCompany.name) && + Objects.equals(this.type, profileWithoutIdentitiesPositionsInnerCompany.type) && + Objects.equals(this.industry, profileWithoutIdentitiesPositionsInnerCompany.industry)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesPositionsInnerCompany.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, type, industry, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesPositionsInnerCompany {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" industry: ").append(toIndentedString(industry)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + openapiFields.add("Type"); + openapiFields.add("Industry"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesPositionsInnerCompany + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesPositionsInnerCompany.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesPositionsInnerCompany is not found in the empty JSON string", ProfileWithoutIdentitiesPositionsInnerCompany.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Type") != null && !jsonObj.get("Type").isJsonNull()) && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + if ((jsonObj.get("Industry") != null && !jsonObj.get("Industry").isJsonNull()) && !jsonObj.get("Industry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Industry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Industry").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesPositionsInnerCompany.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesPositionsInnerCompany' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesPositionsInnerCompany> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesPositionsInnerCompany.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesPositionsInnerCompany>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesPositionsInnerCompany value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesPositionsInnerCompany read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesPositionsInnerCompany instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesPositionsInnerCompany given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesPositionsInnerCompany + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesPositionsInnerCompany + */ + public static ProfileWithoutIdentitiesPositionsInnerCompany fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesPositionsInnerCompany.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesPositionsInnerCompany to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesPrivacyPolicy.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesPrivacyPolicy.java new file mode 100644 index 0000000..d7a83ec --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesPrivacyPolicy.java @@ -0,0 +1,345 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesPrivacyPolicy + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesPrivacyPolicy { + public static final String SERIALIZED_NAME_VERSION = "Version"; + @SerializedName(SERIALIZED_NAME_VERSION) + @javax.annotation.Nullable + private String version; + + public static final String SERIALIZED_NAME_ACCEPT_SOURCE = "AcceptSource"; + @SerializedName(SERIALIZED_NAME_ACCEPT_SOURCE) + @javax.annotation.Nullable + private String acceptSource; + + public static final String SERIALIZED_NAME_ACCEPT_DATE_TIME = "AcceptDateTime"; + @SerializedName(SERIALIZED_NAME_ACCEPT_DATE_TIME) + @javax.annotation.Nullable + private OffsetDateTime acceptDateTime; + + public ProfileWithoutIdentitiesPrivacyPolicy() { + } + + public ProfileWithoutIdentitiesPrivacyPolicy version(@javax.annotation.Nullable String version) { + this.version = version; + return this; + } + + /** + * Get version + * @return version + */ + @javax.annotation.Nullable + public String getVersion() { + return version; + } + + public void setVersion(@javax.annotation.Nullable String version) { + this.version = version; + } + + + public ProfileWithoutIdentitiesPrivacyPolicy acceptSource(@javax.annotation.Nullable String acceptSource) { + this.acceptSource = acceptSource; + return this; + } + + /** + * Get acceptSource + * @return acceptSource + */ + @javax.annotation.Nullable + public String getAcceptSource() { + return acceptSource; + } + + public void setAcceptSource(@javax.annotation.Nullable String acceptSource) { + this.acceptSource = acceptSource; + } + + + public ProfileWithoutIdentitiesPrivacyPolicy acceptDateTime(@javax.annotation.Nullable OffsetDateTime acceptDateTime) { + this.acceptDateTime = acceptDateTime; + return this; + } + + /** + * Get acceptDateTime + * @return acceptDateTime + */ + @javax.annotation.Nullable + public OffsetDateTime getAcceptDateTime() { + return acceptDateTime; + } + + public void setAcceptDateTime(@javax.annotation.Nullable OffsetDateTime acceptDateTime) { + this.acceptDateTime = acceptDateTime; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesPrivacyPolicy instance itself + */ + public ProfileWithoutIdentitiesPrivacyPolicy putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesPrivacyPolicy profileWithoutIdentitiesPrivacyPolicy = (ProfileWithoutIdentitiesPrivacyPolicy) o; + return Objects.equals(this.version, profileWithoutIdentitiesPrivacyPolicy.version) && + Objects.equals(this.acceptSource, profileWithoutIdentitiesPrivacyPolicy.acceptSource) && + Objects.equals(this.acceptDateTime, profileWithoutIdentitiesPrivacyPolicy.acceptDateTime)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesPrivacyPolicy.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(version, acceptSource, acceptDateTime, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesPrivacyPolicy {\n"); + sb.append(" version: ").append(toIndentedString(version)).append("\n"); + sb.append(" acceptSource: ").append(toIndentedString(acceptSource)).append("\n"); + sb.append(" acceptDateTime: ").append(toIndentedString(acceptDateTime)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Version"); + openapiFields.add("AcceptSource"); + openapiFields.add("AcceptDateTime"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesPrivacyPolicy + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesPrivacyPolicy.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesPrivacyPolicy is not found in the empty JSON string", ProfileWithoutIdentitiesPrivacyPolicy.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Version") != null && !jsonObj.get("Version").isJsonNull()) && !jsonObj.get("Version").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Version` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Version").toString())); + } + if ((jsonObj.get("AcceptSource") != null && !jsonObj.get("AcceptSource").isJsonNull()) && !jsonObj.get("AcceptSource").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AcceptSource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AcceptSource").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesPrivacyPolicy.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesPrivacyPolicy' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesPrivacyPolicy> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesPrivacyPolicy.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesPrivacyPolicy>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesPrivacyPolicy value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesPrivacyPolicy read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesPrivacyPolicy instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesPrivacyPolicy given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesPrivacyPolicy + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesPrivacyPolicy + */ + public static ProfileWithoutIdentitiesPrivacyPolicy fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesPrivacyPolicy.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesPrivacyPolicy to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesProjectsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesProjectsInner.java new file mode 100644 index 0000000..f0d0ece --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesProjectsInner.java @@ -0,0 +1,484 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesProjectsInnerWithInner; +import java.io.IOException; +import java.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesProjectsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesProjectsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_SUMMARY = "Summary"; + @SerializedName(SERIALIZED_NAME_SUMMARY) + @javax.annotation.Nullable + private String summary; + + public static final String SERIALIZED_NAME_START_DATE = "StartDate"; + @SerializedName(SERIALIZED_NAME_START_DATE) + @javax.annotation.Nullable + private OffsetDateTime startDate; + + public static final String SERIALIZED_NAME_END_DATE = "EndDate"; + @SerializedName(SERIALIZED_NAME_END_DATE) + @javax.annotation.Nullable + private OffsetDateTime endDate; + + public static final String SERIALIZED_NAME_IS_CURRENT = "IsCurrent"; + @SerializedName(SERIALIZED_NAME_IS_CURRENT) + @javax.annotation.Nullable + private String isCurrent; + + public static final String SERIALIZED_NAME_WITH = "With"; + @SerializedName(SERIALIZED_NAME_WITH) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesProjectsInnerWithInner> with = new ArrayList<>(); + + public ProfileWithoutIdentitiesProjectsInner() { + } + + public ProfileWithoutIdentitiesProjectsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileWithoutIdentitiesProjectsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileWithoutIdentitiesProjectsInner summary(@javax.annotation.Nullable String summary) { + this.summary = summary; + return this; + } + + /** + * Get summary + * @return summary + */ + @javax.annotation.Nullable + public String getSummary() { + return summary; + } + + public void setSummary(@javax.annotation.Nullable String summary) { + this.summary = summary; + } + + + public ProfileWithoutIdentitiesProjectsInner startDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Get startDate + * @return startDate + */ + @javax.annotation.Nullable + public OffsetDateTime getStartDate() { + return startDate; + } + + public void setStartDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + } + + + public ProfileWithoutIdentitiesProjectsInner endDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * Get endDate + * @return endDate + */ + @javax.annotation.Nullable + public OffsetDateTime getEndDate() { + return endDate; + } + + public void setEndDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + } + + + public ProfileWithoutIdentitiesProjectsInner isCurrent(@javax.annotation.Nullable String isCurrent) { + this.isCurrent = isCurrent; + return this; + } + + /** + * Get isCurrent + * @return isCurrent + */ + @javax.annotation.Nullable + public String getIsCurrent() { + return isCurrent; + } + + public void setIsCurrent(@javax.annotation.Nullable String isCurrent) { + this.isCurrent = isCurrent; + } + + + public ProfileWithoutIdentitiesProjectsInner with(@javax.annotation.Nullable List<ProfileWithoutIdentitiesProjectsInnerWithInner> with) { + this.with = with; + return this; + } + + public ProfileWithoutIdentitiesProjectsInner addWithItem(ProfileWithoutIdentitiesProjectsInnerWithInner withItem) { + if (this.with == null) { + this.with = new ArrayList<>(); + } + this.with.add(withItem); + return this; + } + + /** + * Get with + * @return with + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesProjectsInnerWithInner> getWith() { + return with; + } + + public void setWith(@javax.annotation.Nullable List<ProfileWithoutIdentitiesProjectsInnerWithInner> with) { + this.with = with; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesProjectsInner instance itself + */ + public ProfileWithoutIdentitiesProjectsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesProjectsInner profileWithoutIdentitiesProjectsInner = (ProfileWithoutIdentitiesProjectsInner) o; + return Objects.equals(this.id, profileWithoutIdentitiesProjectsInner.id) && + Objects.equals(this.name, profileWithoutIdentitiesProjectsInner.name) && + Objects.equals(this.summary, profileWithoutIdentitiesProjectsInner.summary) && + Objects.equals(this.startDate, profileWithoutIdentitiesProjectsInner.startDate) && + Objects.equals(this.endDate, profileWithoutIdentitiesProjectsInner.endDate) && + Objects.equals(this.isCurrent, profileWithoutIdentitiesProjectsInner.isCurrent) && + Objects.equals(this.with, profileWithoutIdentitiesProjectsInner.with)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesProjectsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, summary, startDate, endDate, isCurrent, with, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesProjectsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" summary: ").append(toIndentedString(summary)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" isCurrent: ").append(toIndentedString(isCurrent)).append("\n"); + sb.append(" with: ").append(toIndentedString(with)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Summary"); + openapiFields.add("StartDate"); + openapiFields.add("EndDate"); + openapiFields.add("IsCurrent"); + openapiFields.add("With"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesProjectsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesProjectsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesProjectsInner is not found in the empty JSON string", ProfileWithoutIdentitiesProjectsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Summary") != null && !jsonObj.get("Summary").isJsonNull()) && !jsonObj.get("Summary").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Summary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Summary").toString())); + } + if ((jsonObj.get("IsCurrent") != null && !jsonObj.get("IsCurrent").isJsonNull()) && !jsonObj.get("IsCurrent").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IsCurrent` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IsCurrent").toString())); + } + if (jsonObj.get("With") != null && !jsonObj.get("With").isJsonNull()) { + JsonArray jsonArraywith = jsonObj.getAsJsonArray("With"); + if (jsonArraywith != null) { + // ensure the json data is an array + if (!jsonObj.get("With").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `With` to be an array in the JSON string but got `%s`", jsonObj.get("With").toString())); + } + + // validate the optional field `With` (array) + for (int i = 0; i < jsonArraywith.size(); i++) { + ProfileWithoutIdentitiesProjectsInnerWithInner.validateJsonElement(jsonArraywith.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesProjectsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesProjectsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesProjectsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesProjectsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesProjectsInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesProjectsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesProjectsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesProjectsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesProjectsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesProjectsInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesProjectsInner + */ + public static ProfileWithoutIdentitiesProjectsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesProjectsInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesProjectsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesProjectsInnerWithInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesProjectsInnerWithInner.java new file mode 100644 index 0000000..0d83720 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesProjectsInnerWithInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesProjectsInnerWithInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesProjectsInnerWithInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ProfileWithoutIdentitiesProjectsInnerWithInner() { + } + + public ProfileWithoutIdentitiesProjectsInnerWithInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileWithoutIdentitiesProjectsInnerWithInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesProjectsInnerWithInner instance itself + */ + public ProfileWithoutIdentitiesProjectsInnerWithInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesProjectsInnerWithInner profileWithoutIdentitiesProjectsInnerWithInner = (ProfileWithoutIdentitiesProjectsInnerWithInner) o; + return Objects.equals(this.id, profileWithoutIdentitiesProjectsInnerWithInner.id) && + Objects.equals(this.name, profileWithoutIdentitiesProjectsInnerWithInner.name)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesProjectsInnerWithInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesProjectsInnerWithInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesProjectsInnerWithInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesProjectsInnerWithInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesProjectsInnerWithInner is not found in the empty JSON string", ProfileWithoutIdentitiesProjectsInnerWithInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesProjectsInnerWithInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesProjectsInnerWithInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesProjectsInnerWithInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesProjectsInnerWithInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesProjectsInnerWithInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesProjectsInnerWithInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesProjectsInnerWithInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesProjectsInnerWithInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesProjectsInnerWithInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesProjectsInnerWithInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesProjectsInnerWithInner + */ + public static ProfileWithoutIdentitiesProjectsInnerWithInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesProjectsInnerWithInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesProjectsInnerWithInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesProviderAccessCredential.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesProviderAccessCredential.java new file mode 100644 index 0000000..a7dfb6e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesProviderAccessCredential.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesProviderAccessCredential + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesProviderAccessCredential { + public static final String SERIALIZED_NAME_ACCESS_TOKEN = "AccessToken"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN) + @javax.annotation.Nullable + private String accessToken; + + public static final String SERIALIZED_NAME_TOKEN_SECRET = "TokenSecret"; + @SerializedName(SERIALIZED_NAME_TOKEN_SECRET) + @javax.annotation.Nullable + private String tokenSecret; + + public ProfileWithoutIdentitiesProviderAccessCredential() { + } + + public ProfileWithoutIdentitiesProviderAccessCredential accessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Get accessToken + * @return accessToken + */ + @javax.annotation.Nullable + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + } + + + public ProfileWithoutIdentitiesProviderAccessCredential tokenSecret(@javax.annotation.Nullable String tokenSecret) { + this.tokenSecret = tokenSecret; + return this; + } + + /** + * Get tokenSecret + * @return tokenSecret + */ + @javax.annotation.Nullable + public String getTokenSecret() { + return tokenSecret; + } + + public void setTokenSecret(@javax.annotation.Nullable String tokenSecret) { + this.tokenSecret = tokenSecret; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesProviderAccessCredential instance itself + */ + public ProfileWithoutIdentitiesProviderAccessCredential putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesProviderAccessCredential profileWithoutIdentitiesProviderAccessCredential = (ProfileWithoutIdentitiesProviderAccessCredential) o; + return Objects.equals(this.accessToken, profileWithoutIdentitiesProviderAccessCredential.accessToken) && + Objects.equals(this.tokenSecret, profileWithoutIdentitiesProviderAccessCredential.tokenSecret)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesProviderAccessCredential.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accessToken, tokenSecret, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesProviderAccessCredential {\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" tokenSecret: ").append(toIndentedString(tokenSecret)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AccessToken"); + openapiFields.add("TokenSecret"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesProviderAccessCredential + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesProviderAccessCredential.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesProviderAccessCredential is not found in the empty JSON string", ProfileWithoutIdentitiesProviderAccessCredential.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("AccessToken") != null && !jsonObj.get("AccessToken").isJsonNull()) && !jsonObj.get("AccessToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccessToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccessToken").toString())); + } + if ((jsonObj.get("TokenSecret") != null && !jsonObj.get("TokenSecret").isJsonNull()) && !jsonObj.get("TokenSecret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TokenSecret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TokenSecret").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesProviderAccessCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesProviderAccessCredential' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesProviderAccessCredential> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesProviderAccessCredential.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesProviderAccessCredential>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesProviderAccessCredential value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesProviderAccessCredential read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesProviderAccessCredential instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesProviderAccessCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesProviderAccessCredential + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesProviderAccessCredential + */ + public static ProfileWithoutIdentitiesProviderAccessCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesProviderAccessCredential.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesProviderAccessCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesPublicationsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesPublicationsInner.java new file mode 100644 index 0000000..e69e8b9 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesPublicationsInner.java @@ -0,0 +1,487 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesPublicationsInnerAuthorsInner; +import java.io.IOException; +import java.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesPublicationsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesPublicationsInner { + public static final String SERIALIZED_NAME_TITLE = "Title"; + @SerializedName(SERIALIZED_NAME_TITLE) + @javax.annotation.Nullable + private String title; + + public static final String SERIALIZED_NAME_PUBLISHER = "Publisher"; + @SerializedName(SERIALIZED_NAME_PUBLISHER) + @javax.annotation.Nullable + private String publisher; + + public static final String SERIALIZED_NAME_DATE = "Date"; + @SerializedName(SERIALIZED_NAME_DATE) + @javax.annotation.Nullable + private OffsetDateTime date; + + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_URL = "Url"; + @SerializedName(SERIALIZED_NAME_URL) + @javax.annotation.Nullable + private String url; + + public static final String SERIALIZED_NAME_SUMMARY = "Summary"; + @SerializedName(SERIALIZED_NAME_SUMMARY) + @javax.annotation.Nullable + private String summary; + + public static final String SERIALIZED_NAME_AUTHORS = "Authors"; + @SerializedName(SERIALIZED_NAME_AUTHORS) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesPublicationsInnerAuthorsInner> authors = new ArrayList<>(); + + public ProfileWithoutIdentitiesPublicationsInner() { + } + + public ProfileWithoutIdentitiesPublicationsInner title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * Get title + * @return title + */ + @javax.annotation.Nullable + public String getTitle() { + return title; + } + + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + public ProfileWithoutIdentitiesPublicationsInner publisher(@javax.annotation.Nullable String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get publisher + * @return publisher + */ + @javax.annotation.Nullable + public String getPublisher() { + return publisher; + } + + public void setPublisher(@javax.annotation.Nullable String publisher) { + this.publisher = publisher; + } + + + public ProfileWithoutIdentitiesPublicationsInner date(@javax.annotation.Nullable OffsetDateTime date) { + this.date = date; + return this; + } + + /** + * Get date + * @return date + */ + @javax.annotation.Nullable + public OffsetDateTime getDate() { + return date; + } + + public void setDate(@javax.annotation.Nullable OffsetDateTime date) { + this.date = date; + } + + + public ProfileWithoutIdentitiesPublicationsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileWithoutIdentitiesPublicationsInner url(@javax.annotation.Nullable String url) { + this.url = url; + return this; + } + + /** + * Get url + * @return url + */ + @javax.annotation.Nullable + public String getUrl() { + return url; + } + + public void setUrl(@javax.annotation.Nullable String url) { + this.url = url; + } + + + public ProfileWithoutIdentitiesPublicationsInner summary(@javax.annotation.Nullable String summary) { + this.summary = summary; + return this; + } + + /** + * Get summary + * @return summary + */ + @javax.annotation.Nullable + public String getSummary() { + return summary; + } + + public void setSummary(@javax.annotation.Nullable String summary) { + this.summary = summary; + } + + + public ProfileWithoutIdentitiesPublicationsInner authors(@javax.annotation.Nullable List<ProfileWithoutIdentitiesPublicationsInnerAuthorsInner> authors) { + this.authors = authors; + return this; + } + + public ProfileWithoutIdentitiesPublicationsInner addAuthorsItem(ProfileWithoutIdentitiesPublicationsInnerAuthorsInner authorsItem) { + if (this.authors == null) { + this.authors = new ArrayList<>(); + } + this.authors.add(authorsItem); + return this; + } + + /** + * Get authors + * @return authors + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesPublicationsInnerAuthorsInner> getAuthors() { + return authors; + } + + public void setAuthors(@javax.annotation.Nullable List<ProfileWithoutIdentitiesPublicationsInnerAuthorsInner> authors) { + this.authors = authors; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesPublicationsInner instance itself + */ + public ProfileWithoutIdentitiesPublicationsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesPublicationsInner profileWithoutIdentitiesPublicationsInner = (ProfileWithoutIdentitiesPublicationsInner) o; + return Objects.equals(this.title, profileWithoutIdentitiesPublicationsInner.title) && + Objects.equals(this.publisher, profileWithoutIdentitiesPublicationsInner.publisher) && + Objects.equals(this.date, profileWithoutIdentitiesPublicationsInner.date) && + Objects.equals(this.id, profileWithoutIdentitiesPublicationsInner.id) && + Objects.equals(this.url, profileWithoutIdentitiesPublicationsInner.url) && + Objects.equals(this.summary, profileWithoutIdentitiesPublicationsInner.summary) && + Objects.equals(this.authors, profileWithoutIdentitiesPublicationsInner.authors)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesPublicationsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(title, publisher, date, id, url, summary, authors, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesPublicationsInner {\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" publisher: ").append(toIndentedString(publisher)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" summary: ").append(toIndentedString(summary)).append("\n"); + sb.append(" authors: ").append(toIndentedString(authors)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Title"); + openapiFields.add("Publisher"); + openapiFields.add("Date"); + openapiFields.add("Id"); + openapiFields.add("Url"); + openapiFields.add("Summary"); + openapiFields.add("Authors"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesPublicationsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesPublicationsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesPublicationsInner is not found in the empty JSON string", ProfileWithoutIdentitiesPublicationsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Title") != null && !jsonObj.get("Title").isJsonNull()) && !jsonObj.get("Title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Title").toString())); + } + if ((jsonObj.get("Publisher") != null && !jsonObj.get("Publisher").isJsonNull()) && !jsonObj.get("Publisher").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Publisher` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Publisher").toString())); + } + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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") != null && !jsonObj.get("Url").isJsonNull()) && !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())); + } + if ((jsonObj.get("Summary") != null && !jsonObj.get("Summary").isJsonNull()) && !jsonObj.get("Summary").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Summary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Summary").toString())); + } + if (jsonObj.get("Authors") != null && !jsonObj.get("Authors").isJsonNull()) { + JsonArray jsonArrayauthors = jsonObj.getAsJsonArray("Authors"); + if (jsonArrayauthors != null) { + // ensure the json data is an array + if (!jsonObj.get("Authors").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Authors` to be an array in the JSON string but got `%s`", jsonObj.get("Authors").toString())); + } + + // validate the optional field `Authors` (array) + for (int i = 0; i < jsonArrayauthors.size(); i++) { + ProfileWithoutIdentitiesPublicationsInnerAuthorsInner.validateJsonElement(jsonArrayauthors.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesPublicationsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesPublicationsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesPublicationsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesPublicationsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesPublicationsInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesPublicationsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesPublicationsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesPublicationsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesPublicationsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesPublicationsInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesPublicationsInner + */ + public static ProfileWithoutIdentitiesPublicationsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesPublicationsInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesPublicationsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesPublicationsInnerAuthorsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesPublicationsInnerAuthorsInner.java new file mode 100644 index 0000000..4d82c99 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesPublicationsInnerAuthorsInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesPublicationsInnerAuthorsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesPublicationsInnerAuthorsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ProfileWithoutIdentitiesPublicationsInnerAuthorsInner() { + } + + public ProfileWithoutIdentitiesPublicationsInnerAuthorsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileWithoutIdentitiesPublicationsInnerAuthorsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesPublicationsInnerAuthorsInner instance itself + */ + public ProfileWithoutIdentitiesPublicationsInnerAuthorsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesPublicationsInnerAuthorsInner profileWithoutIdentitiesPublicationsInnerAuthorsInner = (ProfileWithoutIdentitiesPublicationsInnerAuthorsInner) o; + return Objects.equals(this.id, profileWithoutIdentitiesPublicationsInnerAuthorsInner.id) && + Objects.equals(this.name, profileWithoutIdentitiesPublicationsInnerAuthorsInner.name)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesPublicationsInnerAuthorsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesPublicationsInnerAuthorsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesPublicationsInnerAuthorsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesPublicationsInnerAuthorsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesPublicationsInnerAuthorsInner is not found in the empty JSON string", ProfileWithoutIdentitiesPublicationsInnerAuthorsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesPublicationsInnerAuthorsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesPublicationsInnerAuthorsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesPublicationsInnerAuthorsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesPublicationsInnerAuthorsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesPublicationsInnerAuthorsInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesPublicationsInnerAuthorsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesPublicationsInnerAuthorsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesPublicationsInnerAuthorsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesPublicationsInnerAuthorsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesPublicationsInnerAuthorsInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesPublicationsInnerAuthorsInner + */ + public static ProfileWithoutIdentitiesPublicationsInnerAuthorsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesPublicationsInnerAuthorsInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesPublicationsInnerAuthorsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesRecommendationsReceivedInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesRecommendationsReceivedInner.java new file mode 100644 index 0000000..9f8c6c4 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesRecommendationsReceivedInner.java @@ -0,0 +1,377 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesRecommendationsReceivedInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesRecommendationsReceivedInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_RECOMMENDER = "Recommender"; + @SerializedName(SERIALIZED_NAME_RECOMMENDER) + @javax.annotation.Nullable + private String recommender; + + public static final String SERIALIZED_NAME_RECOMMENDATION_TEXT = "RecommendationText"; + @SerializedName(SERIALIZED_NAME_RECOMMENDATION_TEXT) + @javax.annotation.Nullable + private String recommendationText; + + public static final String SERIALIZED_NAME_RECOMMENDATION_TYPE = "RecommendationType"; + @SerializedName(SERIALIZED_NAME_RECOMMENDATION_TYPE) + @javax.annotation.Nullable + private String recommendationType; + + public ProfileWithoutIdentitiesRecommendationsReceivedInner() { + } + + public ProfileWithoutIdentitiesRecommendationsReceivedInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileWithoutIdentitiesRecommendationsReceivedInner recommender(@javax.annotation.Nullable String recommender) { + this.recommender = recommender; + return this; + } + + /** + * Get recommender + * @return recommender + */ + @javax.annotation.Nullable + public String getRecommender() { + return recommender; + } + + public void setRecommender(@javax.annotation.Nullable String recommender) { + this.recommender = recommender; + } + + + public ProfileWithoutIdentitiesRecommendationsReceivedInner recommendationText(@javax.annotation.Nullable String recommendationText) { + this.recommendationText = recommendationText; + return this; + } + + /** + * Get recommendationText + * @return recommendationText + */ + @javax.annotation.Nullable + public String getRecommendationText() { + return recommendationText; + } + + public void setRecommendationText(@javax.annotation.Nullable String recommendationText) { + this.recommendationText = recommendationText; + } + + + public ProfileWithoutIdentitiesRecommendationsReceivedInner recommendationType(@javax.annotation.Nullable String recommendationType) { + this.recommendationType = recommendationType; + return this; + } + + /** + * Get recommendationType + * @return recommendationType + */ + @javax.annotation.Nullable + public String getRecommendationType() { + return recommendationType; + } + + public void setRecommendationType(@javax.annotation.Nullable String recommendationType) { + this.recommendationType = recommendationType; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesRecommendationsReceivedInner instance itself + */ + public ProfileWithoutIdentitiesRecommendationsReceivedInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesRecommendationsReceivedInner profileWithoutIdentitiesRecommendationsReceivedInner = (ProfileWithoutIdentitiesRecommendationsReceivedInner) o; + return Objects.equals(this.id, profileWithoutIdentitiesRecommendationsReceivedInner.id) && + Objects.equals(this.recommender, profileWithoutIdentitiesRecommendationsReceivedInner.recommender) && + Objects.equals(this.recommendationText, profileWithoutIdentitiesRecommendationsReceivedInner.recommendationText) && + Objects.equals(this.recommendationType, profileWithoutIdentitiesRecommendationsReceivedInner.recommendationType)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesRecommendationsReceivedInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, recommender, recommendationText, recommendationType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesRecommendationsReceivedInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" recommender: ").append(toIndentedString(recommender)).append("\n"); + sb.append(" recommendationText: ").append(toIndentedString(recommendationText)).append("\n"); + sb.append(" recommendationType: ").append(toIndentedString(recommendationType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Recommender"); + openapiFields.add("RecommendationText"); + openapiFields.add("RecommendationType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesRecommendationsReceivedInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesRecommendationsReceivedInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesRecommendationsReceivedInner is not found in the empty JSON string", ProfileWithoutIdentitiesRecommendationsReceivedInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Recommender") != null && !jsonObj.get("Recommender").isJsonNull()) && !jsonObj.get("Recommender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Recommender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Recommender").toString())); + } + if ((jsonObj.get("RecommendationText") != null && !jsonObj.get("RecommendationText").isJsonNull()) && !jsonObj.get("RecommendationText").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RecommendationText` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RecommendationText").toString())); + } + if ((jsonObj.get("RecommendationType") != null && !jsonObj.get("RecommendationType").isJsonNull()) && !jsonObj.get("RecommendationType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RecommendationType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RecommendationType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesRecommendationsReceivedInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesRecommendationsReceivedInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesRecommendationsReceivedInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesRecommendationsReceivedInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesRecommendationsReceivedInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesRecommendationsReceivedInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesRecommendationsReceivedInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesRecommendationsReceivedInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesRecommendationsReceivedInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesRecommendationsReceivedInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesRecommendationsReceivedInner + */ + public static ProfileWithoutIdentitiesRecommendationsReceivedInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesRecommendationsReceivedInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesRecommendationsReceivedInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesRegistrationData.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesRegistrationData.java new file mode 100644 index 0000000..3700e82 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesRegistrationData.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesRegistrationDataDataInner; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesRegistrationData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesRegistrationData { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesRegistrationDataDataInner> data = new ArrayList<>(); + + public ProfileWithoutIdentitiesRegistrationData() { + } + + public ProfileWithoutIdentitiesRegistrationData data(@javax.annotation.Nullable List<ProfileWithoutIdentitiesRegistrationDataDataInner> data) { + this.data = data; + return this; + } + + public ProfileWithoutIdentitiesRegistrationData addDataItem(ProfileWithoutIdentitiesRegistrationDataDataInner dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesRegistrationDataDataInner> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<ProfileWithoutIdentitiesRegistrationDataDataInner> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesRegistrationData instance itself + */ + public ProfileWithoutIdentitiesRegistrationData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesRegistrationData profileWithoutIdentitiesRegistrationData = (ProfileWithoutIdentitiesRegistrationData) o; + return Objects.equals(this.data, profileWithoutIdentitiesRegistrationData.data)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesRegistrationData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesRegistrationData {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesRegistrationData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesRegistrationData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesRegistrationData is not found in the empty JSON string", ProfileWithoutIdentitiesRegistrationData.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + ProfileWithoutIdentitiesRegistrationDataDataInner.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesRegistrationData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesRegistrationData' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesRegistrationData> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesRegistrationData.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesRegistrationData>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesRegistrationData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesRegistrationData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesRegistrationData instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesRegistrationData given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesRegistrationData + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesRegistrationData + */ + public static ProfileWithoutIdentitiesRegistrationData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesRegistrationData.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesRegistrationData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesRegistrationDataDataInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesRegistrationDataDataInner.java new file mode 100644 index 0000000..b5e8886 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesRegistrationDataDataInner.java @@ -0,0 +1,319 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesRegistrationDataDataInnerValue; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesRegistrationDataDataInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesRegistrationDataDataInner { + public static final String SERIALIZED_NAME_DATA_SOURCE = "DataSource"; + @SerializedName(SERIALIZED_NAME_DATA_SOURCE) + @javax.annotation.Nullable + private String dataSource; + + public static final String SERIALIZED_NAME_VALUE = "Value"; + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nullable + private ProfileWithoutIdentitiesRegistrationDataDataInnerValue value; + + public ProfileWithoutIdentitiesRegistrationDataDataInner() { + } + + public ProfileWithoutIdentitiesRegistrationDataDataInner dataSource(@javax.annotation.Nullable String dataSource) { + this.dataSource = dataSource; + return this; + } + + /** + * Get dataSource + * @return dataSource + */ + @javax.annotation.Nullable + public String getDataSource() { + return dataSource; + } + + public void setDataSource(@javax.annotation.Nullable String dataSource) { + this.dataSource = dataSource; + } + + + public ProfileWithoutIdentitiesRegistrationDataDataInner value(@javax.annotation.Nullable ProfileWithoutIdentitiesRegistrationDataDataInnerValue value) { + this.value = value; + return this; + } + + /** + * Get value + * @return value + */ + @javax.annotation.Nullable + public ProfileWithoutIdentitiesRegistrationDataDataInnerValue getValue() { + return value; + } + + public void setValue(@javax.annotation.Nullable ProfileWithoutIdentitiesRegistrationDataDataInnerValue value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesRegistrationDataDataInner instance itself + */ + public ProfileWithoutIdentitiesRegistrationDataDataInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesRegistrationDataDataInner profileWithoutIdentitiesRegistrationDataDataInner = (ProfileWithoutIdentitiesRegistrationDataDataInner) o; + return Objects.equals(this.dataSource, profileWithoutIdentitiesRegistrationDataDataInner.dataSource) && + Objects.equals(this.value, profileWithoutIdentitiesRegistrationDataDataInner.value)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesRegistrationDataDataInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(dataSource, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesRegistrationDataDataInner {\n"); + sb.append(" dataSource: ").append(toIndentedString(dataSource)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("DataSource"); + openapiFields.add("Value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesRegistrationDataDataInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesRegistrationDataDataInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesRegistrationDataDataInner is not found in the empty JSON string", ProfileWithoutIdentitiesRegistrationDataDataInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("DataSource") != null && !jsonObj.get("DataSource").isJsonNull()) && !jsonObj.get("DataSource").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DataSource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DataSource").toString())); + } + // validate the optional field `Value` + if (jsonObj.get("Value") != null && !jsonObj.get("Value").isJsonNull()) { + ProfileWithoutIdentitiesRegistrationDataDataInnerValue.validateJsonElement(jsonObj.get("Value")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesRegistrationDataDataInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesRegistrationDataDataInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesRegistrationDataDataInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesRegistrationDataDataInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesRegistrationDataDataInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesRegistrationDataDataInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesRegistrationDataDataInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesRegistrationDataDataInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesRegistrationDataDataInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesRegistrationDataDataInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesRegistrationDataDataInner + */ + public static ProfileWithoutIdentitiesRegistrationDataDataInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesRegistrationDataDataInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesRegistrationDataDataInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesRegistrationDataDataInnerValue.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesRegistrationDataDataInnerValue.java new file mode 100644 index 0000000..ef118b3 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesRegistrationDataDataInnerValue.java @@ -0,0 +1,287 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesRegistrationDataDataInnerValue + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesRegistrationDataDataInnerValue { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public ProfileWithoutIdentitiesRegistrationDataDataInnerValue() { + } + + public ProfileWithoutIdentitiesRegistrationDataDataInnerValue id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesRegistrationDataDataInnerValue instance itself + */ + public ProfileWithoutIdentitiesRegistrationDataDataInnerValue putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesRegistrationDataDataInnerValue profileWithoutIdentitiesRegistrationDataDataInnerValue = (ProfileWithoutIdentitiesRegistrationDataDataInnerValue) o; + return Objects.equals(this.id, profileWithoutIdentitiesRegistrationDataDataInnerValue.id)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesRegistrationDataDataInnerValue.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesRegistrationDataDataInnerValue {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesRegistrationDataDataInnerValue + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesRegistrationDataDataInnerValue.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesRegistrationDataDataInnerValue is not found in the empty JSON string", ProfileWithoutIdentitiesRegistrationDataDataInnerValue.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesRegistrationDataDataInnerValue.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesRegistrationDataDataInnerValue' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesRegistrationDataDataInnerValue> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesRegistrationDataDataInnerValue.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesRegistrationDataDataInnerValue>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesRegistrationDataDataInnerValue value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesRegistrationDataDataInnerValue read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesRegistrationDataDataInnerValue instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesRegistrationDataDataInnerValue given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesRegistrationDataDataInnerValue + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesRegistrationDataDataInnerValue + */ + public static ProfileWithoutIdentitiesRegistrationDataDataInnerValue fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesRegistrationDataDataInnerValue.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesRegistrationDataDataInnerValue to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesRelatedProfileViewsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesRelatedProfileViewsInner.java new file mode 100644 index 0000000..6dc574f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesRelatedProfileViewsInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesRelatedProfileViewsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesRelatedProfileViewsInner { + public static final String SERIALIZED_NAME_FIRST_NAME = "FirstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nullable + private String firstName; + + public static final String SERIALIZED_NAME_LAST_NAME = "LastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nullable + private String lastName; + + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public ProfileWithoutIdentitiesRelatedProfileViewsInner() { + } + + public ProfileWithoutIdentitiesRelatedProfileViewsInner firstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + */ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + } + + + public ProfileWithoutIdentitiesRelatedProfileViewsInner lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + + public ProfileWithoutIdentitiesRelatedProfileViewsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesRelatedProfileViewsInner instance itself + */ + public ProfileWithoutIdentitiesRelatedProfileViewsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesRelatedProfileViewsInner profileWithoutIdentitiesRelatedProfileViewsInner = (ProfileWithoutIdentitiesRelatedProfileViewsInner) o; + return Objects.equals(this.firstName, profileWithoutIdentitiesRelatedProfileViewsInner.firstName) && + Objects.equals(this.lastName, profileWithoutIdentitiesRelatedProfileViewsInner.lastName) && + Objects.equals(this.id, profileWithoutIdentitiesRelatedProfileViewsInner.id)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesRelatedProfileViewsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(firstName, lastName, id, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesRelatedProfileViewsInner {\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("FirstName"); + openapiFields.add("LastName"); + openapiFields.add("Id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesRelatedProfileViewsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesRelatedProfileViewsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesRelatedProfileViewsInner is not found in the empty JSON string", ProfileWithoutIdentitiesRelatedProfileViewsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("FirstName") != null && !jsonObj.get("FirstName").isJsonNull()) && !jsonObj.get("FirstName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FirstName").toString())); + } + if ((jsonObj.get("LastName") != null && !jsonObj.get("LastName").isJsonNull()) && !jsonObj.get("LastName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastName").toString())); + } + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesRelatedProfileViewsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesRelatedProfileViewsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesRelatedProfileViewsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesRelatedProfileViewsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesRelatedProfileViewsInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesRelatedProfileViewsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesRelatedProfileViewsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesRelatedProfileViewsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesRelatedProfileViewsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesRelatedProfileViewsInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesRelatedProfileViewsInner + */ + public static ProfileWithoutIdentitiesRelatedProfileViewsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesRelatedProfileViewsInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesRelatedProfileViewsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesSkillsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesSkillsInner.java new file mode 100644 index 0000000..d7ceb4d --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesSkillsInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesSkillsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesSkillsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ProfileWithoutIdentitiesSkillsInner() { + } + + public ProfileWithoutIdentitiesSkillsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileWithoutIdentitiesSkillsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesSkillsInner instance itself + */ + public ProfileWithoutIdentitiesSkillsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesSkillsInner profileWithoutIdentitiesSkillsInner = (ProfileWithoutIdentitiesSkillsInner) o; + return Objects.equals(this.id, profileWithoutIdentitiesSkillsInner.id) && + Objects.equals(this.name, profileWithoutIdentitiesSkillsInner.name)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesSkillsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesSkillsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesSkillsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesSkillsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesSkillsInner is not found in the empty JSON string", ProfileWithoutIdentitiesSkillsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesSkillsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesSkillsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesSkillsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesSkillsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesSkillsInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesSkillsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesSkillsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesSkillsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesSkillsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesSkillsInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesSkillsInner + */ + public static ProfileWithoutIdentitiesSkillsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesSkillsInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesSkillsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesSubscription.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesSubscription.java new file mode 100644 index 0000000..0e25e3e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesSubscription.java @@ -0,0 +1,377 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesSubscription + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesSubscription { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_SPACE = "Space"; + @SerializedName(SERIALIZED_NAME_SPACE) + @javax.annotation.Nullable + private String space; + + public static final String SERIALIZED_NAME_PRIVATE_REPOS = "PrivateRepos"; + @SerializedName(SERIALIZED_NAME_PRIVATE_REPOS) + @javax.annotation.Nullable + private String privateRepos; + + public static final String SERIALIZED_NAME_COLLABORATORS = "Collaborators"; + @SerializedName(SERIALIZED_NAME_COLLABORATORS) + @javax.annotation.Nullable + private String collaborators; + + public ProfileWithoutIdentitiesSubscription() { + } + + public ProfileWithoutIdentitiesSubscription name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileWithoutIdentitiesSubscription space(@javax.annotation.Nullable String space) { + this.space = space; + return this; + } + + /** + * Get space + * @return space + */ + @javax.annotation.Nullable + public String getSpace() { + return space; + } + + public void setSpace(@javax.annotation.Nullable String space) { + this.space = space; + } + + + public ProfileWithoutIdentitiesSubscription privateRepos(@javax.annotation.Nullable String privateRepos) { + this.privateRepos = privateRepos; + return this; + } + + /** + * Get privateRepos + * @return privateRepos + */ + @javax.annotation.Nullable + public String getPrivateRepos() { + return privateRepos; + } + + public void setPrivateRepos(@javax.annotation.Nullable String privateRepos) { + this.privateRepos = privateRepos; + } + + + public ProfileWithoutIdentitiesSubscription collaborators(@javax.annotation.Nullable String collaborators) { + this.collaborators = collaborators; + return this; + } + + /** + * Get collaborators + * @return collaborators + */ + @javax.annotation.Nullable + public String getCollaborators() { + return collaborators; + } + + public void setCollaborators(@javax.annotation.Nullable String collaborators) { + this.collaborators = collaborators; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesSubscription instance itself + */ + public ProfileWithoutIdentitiesSubscription putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesSubscription profileWithoutIdentitiesSubscription = (ProfileWithoutIdentitiesSubscription) o; + return Objects.equals(this.name, profileWithoutIdentitiesSubscription.name) && + Objects.equals(this.space, profileWithoutIdentitiesSubscription.space) && + Objects.equals(this.privateRepos, profileWithoutIdentitiesSubscription.privateRepos) && + Objects.equals(this.collaborators, profileWithoutIdentitiesSubscription.collaborators)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesSubscription.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, space, privateRepos, collaborators, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesSubscription {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" space: ").append(toIndentedString(space)).append("\n"); + sb.append(" privateRepos: ").append(toIndentedString(privateRepos)).append("\n"); + sb.append(" collaborators: ").append(toIndentedString(collaborators)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + openapiFields.add("Space"); + openapiFields.add("PrivateRepos"); + openapiFields.add("Collaborators"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesSubscription + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesSubscription.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesSubscription is not found in the empty JSON string", ProfileWithoutIdentitiesSubscription.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Space") != null && !jsonObj.get("Space").isJsonNull()) && !jsonObj.get("Space").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Space` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Space").toString())); + } + if ((jsonObj.get("PrivateRepos") != null && !jsonObj.get("PrivateRepos").isJsonNull()) && !jsonObj.get("PrivateRepos").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PrivateRepos` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PrivateRepos").toString())); + } + if ((jsonObj.get("Collaborators") != null && !jsonObj.get("Collaborators").isJsonNull()) && !jsonObj.get("Collaborators").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Collaborators` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Collaborators").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesSubscription.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesSubscription' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesSubscription> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesSubscription.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesSubscription>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesSubscription value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesSubscription read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesSubscription instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesSubscription given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesSubscription + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesSubscription + */ + public static ProfileWithoutIdentitiesSubscription fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesSubscription.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesSubscription to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesSuggestions.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesSuggestions.java new file mode 100644 index 0000000..dec3db4 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesSuggestions.java @@ -0,0 +1,459 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner; +import com.loginradius.sdk.internal.openapi.model.ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesSuggestions + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesSuggestions { + public static final String SERIALIZED_NAME_COMPANIES_TO_FOLLOW = "CompaniesToFollow"; + @SerializedName(SERIALIZED_NAME_COMPANIES_TO_FOLLOW) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner> companiesToFollow = new ArrayList<>(); + + public static final String SERIALIZED_NAME_INDUSTRIES_TO_FOLLOW = "IndustriesToFollow"; + @SerializedName(SERIALIZED_NAME_INDUSTRIES_TO_FOLLOW) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner> industriesToFollow = new ArrayList<>(); + + public static final String SERIALIZED_NAME_NEWSSOURCE_TO_FOLLOW = "NewssourceToFollow"; + @SerializedName(SERIALIZED_NAME_NEWSSOURCE_TO_FOLLOW) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner> newssourceToFollow = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PEOPLE_TO_FOLLOW = "PeopleToFollow"; + @SerializedName(SERIALIZED_NAME_PEOPLE_TO_FOLLOW) + @javax.annotation.Nullable + private List<ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner> peopleToFollow = new ArrayList<>(); + + public ProfileWithoutIdentitiesSuggestions() { + } + + public ProfileWithoutIdentitiesSuggestions companiesToFollow(@javax.annotation.Nullable List<ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner> companiesToFollow) { + this.companiesToFollow = companiesToFollow; + return this; + } + + public ProfileWithoutIdentitiesSuggestions addCompaniesToFollowItem(ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner companiesToFollowItem) { + if (this.companiesToFollow == null) { + this.companiesToFollow = new ArrayList<>(); + } + this.companiesToFollow.add(companiesToFollowItem); + return this; + } + + /** + * Get companiesToFollow + * @return companiesToFollow + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner> getCompaniesToFollow() { + return companiesToFollow; + } + + public void setCompaniesToFollow(@javax.annotation.Nullable List<ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner> companiesToFollow) { + this.companiesToFollow = companiesToFollow; + } + + + public ProfileWithoutIdentitiesSuggestions industriesToFollow(@javax.annotation.Nullable List<ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner> industriesToFollow) { + this.industriesToFollow = industriesToFollow; + return this; + } + + public ProfileWithoutIdentitiesSuggestions addIndustriesToFollowItem(ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner industriesToFollowItem) { + if (this.industriesToFollow == null) { + this.industriesToFollow = new ArrayList<>(); + } + this.industriesToFollow.add(industriesToFollowItem); + return this; + } + + /** + * Get industriesToFollow + * @return industriesToFollow + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner> getIndustriesToFollow() { + return industriesToFollow; + } + + public void setIndustriesToFollow(@javax.annotation.Nullable List<ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner> industriesToFollow) { + this.industriesToFollow = industriesToFollow; + } + + + public ProfileWithoutIdentitiesSuggestions newssourceToFollow(@javax.annotation.Nullable List<ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner> newssourceToFollow) { + this.newssourceToFollow = newssourceToFollow; + return this; + } + + public ProfileWithoutIdentitiesSuggestions addNewssourceToFollowItem(ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner newssourceToFollowItem) { + if (this.newssourceToFollow == null) { + this.newssourceToFollow = new ArrayList<>(); + } + this.newssourceToFollow.add(newssourceToFollowItem); + return this; + } + + /** + * Get newssourceToFollow + * @return newssourceToFollow + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner> getNewssourceToFollow() { + return newssourceToFollow; + } + + public void setNewssourceToFollow(@javax.annotation.Nullable List<ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner> newssourceToFollow) { + this.newssourceToFollow = newssourceToFollow; + } + + + public ProfileWithoutIdentitiesSuggestions peopleToFollow(@javax.annotation.Nullable List<ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner> peopleToFollow) { + this.peopleToFollow = peopleToFollow; + return this; + } + + public ProfileWithoutIdentitiesSuggestions addPeopleToFollowItem(ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner peopleToFollowItem) { + if (this.peopleToFollow == null) { + this.peopleToFollow = new ArrayList<>(); + } + this.peopleToFollow.add(peopleToFollowItem); + return this; + } + + /** + * Get peopleToFollow + * @return peopleToFollow + */ + @javax.annotation.Nullable + public List<ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner> getPeopleToFollow() { + return peopleToFollow; + } + + public void setPeopleToFollow(@javax.annotation.Nullable List<ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner> peopleToFollow) { + this.peopleToFollow = peopleToFollow; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesSuggestions instance itself + */ + public ProfileWithoutIdentitiesSuggestions putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesSuggestions profileWithoutIdentitiesSuggestions = (ProfileWithoutIdentitiesSuggestions) o; + return Objects.equals(this.companiesToFollow, profileWithoutIdentitiesSuggestions.companiesToFollow) && + Objects.equals(this.industriesToFollow, profileWithoutIdentitiesSuggestions.industriesToFollow) && + Objects.equals(this.newssourceToFollow, profileWithoutIdentitiesSuggestions.newssourceToFollow) && + Objects.equals(this.peopleToFollow, profileWithoutIdentitiesSuggestions.peopleToFollow)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesSuggestions.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(companiesToFollow, industriesToFollow, newssourceToFollow, peopleToFollow, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesSuggestions {\n"); + sb.append(" companiesToFollow: ").append(toIndentedString(companiesToFollow)).append("\n"); + sb.append(" industriesToFollow: ").append(toIndentedString(industriesToFollow)).append("\n"); + sb.append(" newssourceToFollow: ").append(toIndentedString(newssourceToFollow)).append("\n"); + sb.append(" peopleToFollow: ").append(toIndentedString(peopleToFollow)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("CompaniesToFollow"); + openapiFields.add("IndustriesToFollow"); + openapiFields.add("NewssourceToFollow"); + openapiFields.add("PeopleToFollow"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesSuggestions + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesSuggestions.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesSuggestions is not found in the empty JSON string", ProfileWithoutIdentitiesSuggestions.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("CompaniesToFollow") != null && !jsonObj.get("CompaniesToFollow").isJsonNull()) { + JsonArray jsonArraycompaniesToFollow = jsonObj.getAsJsonArray("CompaniesToFollow"); + if (jsonArraycompaniesToFollow != null) { + // ensure the json data is an array + if (!jsonObj.get("CompaniesToFollow").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `CompaniesToFollow` to be an array in the JSON string but got `%s`", jsonObj.get("CompaniesToFollow").toString())); + } + + // validate the optional field `CompaniesToFollow` (array) + for (int i = 0; i < jsonArraycompaniesToFollow.size(); i++) { + ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner.validateJsonElement(jsonArraycompaniesToFollow.get(i)); + }; + } + } + if (jsonObj.get("IndustriesToFollow") != null && !jsonObj.get("IndustriesToFollow").isJsonNull()) { + JsonArray jsonArrayindustriesToFollow = jsonObj.getAsJsonArray("IndustriesToFollow"); + if (jsonArrayindustriesToFollow != null) { + // ensure the json data is an array + if (!jsonObj.get("IndustriesToFollow").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `IndustriesToFollow` to be an array in the JSON string but got `%s`", jsonObj.get("IndustriesToFollow").toString())); + } + + // validate the optional field `IndustriesToFollow` (array) + for (int i = 0; i < jsonArrayindustriesToFollow.size(); i++) { + ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner.validateJsonElement(jsonArrayindustriesToFollow.get(i)); + }; + } + } + if (jsonObj.get("NewssourceToFollow") != null && !jsonObj.get("NewssourceToFollow").isJsonNull()) { + JsonArray jsonArraynewssourceToFollow = jsonObj.getAsJsonArray("NewssourceToFollow"); + if (jsonArraynewssourceToFollow != null) { + // ensure the json data is an array + if (!jsonObj.get("NewssourceToFollow").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `NewssourceToFollow` to be an array in the JSON string but got `%s`", jsonObj.get("NewssourceToFollow").toString())); + } + + // validate the optional field `NewssourceToFollow` (array) + for (int i = 0; i < jsonArraynewssourceToFollow.size(); i++) { + ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner.validateJsonElement(jsonArraynewssourceToFollow.get(i)); + }; + } + } + if (jsonObj.get("PeopleToFollow") != null && !jsonObj.get("PeopleToFollow").isJsonNull()) { + JsonArray jsonArraypeopleToFollow = jsonObj.getAsJsonArray("PeopleToFollow"); + if (jsonArraypeopleToFollow != null) { + // ensure the json data is an array + if (!jsonObj.get("PeopleToFollow").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PeopleToFollow` to be an array in the JSON string but got `%s`", jsonObj.get("PeopleToFollow").toString())); + } + + // validate the optional field `PeopleToFollow` (array) + for (int i = 0; i < jsonArraypeopleToFollow.size(); i++) { + ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner.validateJsonElement(jsonArraypeopleToFollow.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesSuggestions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesSuggestions' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesSuggestions> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesSuggestions.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesSuggestions>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesSuggestions value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesSuggestions read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesSuggestions instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesSuggestions given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesSuggestions + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesSuggestions + */ + public static ProfileWithoutIdentitiesSuggestions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesSuggestions.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesSuggestions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner.java new file mode 100644 index 0000000..2b186dd --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner() { + } + + public ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner instance itself + */ + public ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner profileWithoutIdentitiesSuggestionsCompaniesToFollowInner = (ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner) o; + return Objects.equals(this.id, profileWithoutIdentitiesSuggestionsCompaniesToFollowInner.id) && + Objects.equals(this.name, profileWithoutIdentitiesSuggestionsCompaniesToFollowInner.name)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesSuggestionsCompaniesToFollowInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner is not found in the empty JSON string", ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner + */ + public static ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesSuggestionsCompaniesToFollowInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner.java new file mode 100644 index 0000000..d50fa2e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner() { + } + + public ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner instance itself + */ + public ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner profileWithoutIdentitiesSuggestionsIndustriesToFollowInner = (ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner) o; + return Objects.equals(this.id, profileWithoutIdentitiesSuggestionsIndustriesToFollowInner.id) && + Objects.equals(this.name, profileWithoutIdentitiesSuggestionsIndustriesToFollowInner.name)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesSuggestionsIndustriesToFollowInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner is not found in the empty JSON string", ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner + */ + public static ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesSuggestionsIndustriesToFollowInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner.java new file mode 100644 index 0000000..1a0817e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner() { + } + + public ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner instance itself + */ + public ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner profileWithoutIdentitiesSuggestionsNewssourceToFollowInner = (ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner) o; + return Objects.equals(this.id, profileWithoutIdentitiesSuggestionsNewssourceToFollowInner.id) && + Objects.equals(this.name, profileWithoutIdentitiesSuggestionsNewssourceToFollowInner.name)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesSuggestionsNewssourceToFollowInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner is not found in the empty JSON string", ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner + */ + public static ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesSuggestionsNewssourceToFollowInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner.java new file mode 100644 index 0000000..c8182bf --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner() { + } + + public ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner instance itself + */ + public ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner profileWithoutIdentitiesSuggestionsPeopleToFollowInner = (ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner) o; + return Objects.equals(this.id, profileWithoutIdentitiesSuggestionsPeopleToFollowInner.id) && + Objects.equals(this.name, profileWithoutIdentitiesSuggestionsPeopleToFollowInner.name)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesSuggestionsPeopleToFollowInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner is not found in the empty JSON string", ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner + */ + public static ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesSuggestionsPeopleToFollowInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesTelevisionShowInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesTelevisionShowInner.java new file mode 100644 index 0000000..a5afccc --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesTelevisionShowInner.java @@ -0,0 +1,375 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesTelevisionShowInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesTelevisionShowInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_CATEGORY = "Category"; + @SerializedName(SERIALIZED_NAME_CATEGORY) + @javax.annotation.Nullable + private String category; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public ProfileWithoutIdentitiesTelevisionShowInner() { + } + + public ProfileWithoutIdentitiesTelevisionShowInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public ProfileWithoutIdentitiesTelevisionShowInner category(@javax.annotation.Nullable String category) { + this.category = category; + return this; + } + + /** + * Get category + * @return category + */ + @javax.annotation.Nullable + public String getCategory() { + return category; + } + + public void setCategory(@javax.annotation.Nullable String category) { + this.category = category; + } + + + public ProfileWithoutIdentitiesTelevisionShowInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public ProfileWithoutIdentitiesTelevisionShowInner createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get createdDate + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesTelevisionShowInner instance itself + */ + public ProfileWithoutIdentitiesTelevisionShowInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesTelevisionShowInner profileWithoutIdentitiesTelevisionShowInner = (ProfileWithoutIdentitiesTelevisionShowInner) o; + return Objects.equals(this.id, profileWithoutIdentitiesTelevisionShowInner.id) && + Objects.equals(this.category, profileWithoutIdentitiesTelevisionShowInner.category) && + Objects.equals(this.name, profileWithoutIdentitiesTelevisionShowInner.name) && + Objects.equals(this.createdDate, profileWithoutIdentitiesTelevisionShowInner.createdDate)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesTelevisionShowInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, createdDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesTelevisionShowInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Category"); + openapiFields.add("Name"); + openapiFields.add("CreatedDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesTelevisionShowInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesTelevisionShowInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesTelevisionShowInner is not found in the empty JSON string", ProfileWithoutIdentitiesTelevisionShowInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Category") != null && !jsonObj.get("Category").isJsonNull()) && !jsonObj.get("Category").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Category` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Category").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesTelevisionShowInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesTelevisionShowInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesTelevisionShowInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesTelevisionShowInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesTelevisionShowInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesTelevisionShowInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesTelevisionShowInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesTelevisionShowInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesTelevisionShowInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesTelevisionShowInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesTelevisionShowInner + */ + public static ProfileWithoutIdentitiesTelevisionShowInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesTelevisionShowInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesTelevisionShowInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesUnverifiedEmailInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesUnverifiedEmailInner.java new file mode 100644 index 0000000..45d92b5 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProfileWithoutIdentitiesUnverifiedEmailInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProfileWithoutIdentitiesUnverifiedEmailInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProfileWithoutIdentitiesUnverifiedEmailInner { + public static final String SERIALIZED_NAME_TYPE = "Type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_VALUE = "Value"; + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nullable + private String value; + + public ProfileWithoutIdentitiesUnverifiedEmailInner() { + } + + public ProfileWithoutIdentitiesUnverifiedEmailInner type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public ProfileWithoutIdentitiesUnverifiedEmailInner value(@javax.annotation.Nullable String value) { + this.value = value; + return this; + } + + /** + * Get value + * @return value + */ + @javax.annotation.Nullable + public String getValue() { + return value; + } + + public void setValue(@javax.annotation.Nullable String value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProfileWithoutIdentitiesUnverifiedEmailInner instance itself + */ + public ProfileWithoutIdentitiesUnverifiedEmailInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProfileWithoutIdentitiesUnverifiedEmailInner profileWithoutIdentitiesUnverifiedEmailInner = (ProfileWithoutIdentitiesUnverifiedEmailInner) o; + return Objects.equals(this.type, profileWithoutIdentitiesUnverifiedEmailInner.type) && + Objects.equals(this.value, profileWithoutIdentitiesUnverifiedEmailInner.value)&& + Objects.equals(this.additionalProperties, profileWithoutIdentitiesUnverifiedEmailInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProfileWithoutIdentitiesUnverifiedEmailInner {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Type"); + openapiFields.add("Value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProfileWithoutIdentitiesUnverifiedEmailInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProfileWithoutIdentitiesUnverifiedEmailInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProfileWithoutIdentitiesUnverifiedEmailInner is not found in the empty JSON string", ProfileWithoutIdentitiesUnverifiedEmailInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonNull()) && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + if ((jsonObj.get("Value") != null && !jsonObj.get("Value").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProfileWithoutIdentitiesUnverifiedEmailInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProfileWithoutIdentitiesUnverifiedEmailInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProfileWithoutIdentitiesUnverifiedEmailInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProfileWithoutIdentitiesUnverifiedEmailInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProfileWithoutIdentitiesUnverifiedEmailInner>() { + @Override + public void write(JsonWriter out, ProfileWithoutIdentitiesUnverifiedEmailInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProfileWithoutIdentitiesUnverifiedEmailInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProfileWithoutIdentitiesUnverifiedEmailInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProfileWithoutIdentitiesUnverifiedEmailInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProfileWithoutIdentitiesUnverifiedEmailInner + * @throws IOException if the JSON string is invalid with respect to ProfileWithoutIdentitiesUnverifiedEmailInner + */ + public static ProfileWithoutIdentitiesUnverifiedEmailInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProfileWithoutIdentitiesUnverifiedEmailInner.class); + } + + /** + * Convert an instance of ProfileWithoutIdentitiesUnverifiedEmailInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/Provider.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/Provider.java new file mode 100644 index 0000000..3c5cf7d --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/Provider.java @@ -0,0 +1,314 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * Provider + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class Provider { + public static final String SERIALIZED_NAME_PROVIDER_NAME = "ProviderName"; + @SerializedName(SERIALIZED_NAME_PROVIDER_NAME) + @javax.annotation.Nullable + private String providerName; + + public static final String SERIALIZED_NAME_IS_ACTIVE = "IsActive"; + @SerializedName(SERIALIZED_NAME_IS_ACTIVE) + @javax.annotation.Nullable + private Boolean isActive; + + public Provider() { + } + + public Provider providerName(@javax.annotation.Nullable String providerName) { + this.providerName = providerName; + return this; + } + + /** + * Name of the provider + * @return providerName + */ + @javax.annotation.Nullable + public String getProviderName() { + return providerName; + } + + public void setProviderName(@javax.annotation.Nullable String providerName) { + this.providerName = providerName; + } + + + public Provider isActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Status of the provider + * @return isActive + */ + @javax.annotation.Nullable + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Provider instance itself + */ + public Provider putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Provider provider = (Provider) o; + return Objects.equals(this.providerName, provider.providerName) && + Objects.equals(this.isActive, provider.isActive)&& + Objects.equals(this.additionalProperties, provider.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(providerName, isActive, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Provider {\n"); + sb.append(" providerName: ").append(toIndentedString(providerName)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ProviderName"); + openapiFields.add("IsActive"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 Provider + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Provider.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Provider is not found in the empty JSON string", Provider.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ProviderName") != null && !jsonObj.get("ProviderName").isJsonNull()) && !jsonObj.get("ProviderName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProviderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProviderName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!Provider.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Provider' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<Provider> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Provider.class)); + + return (TypeAdapter<T>) new TypeAdapter<Provider>() { + @Override + public void write(JsonWriter out, Provider value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Provider read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Provider instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Provider given an JSON string + * + * @param jsonString JSON string + * @return An instance of Provider + * @throws IOException if the JSON string is invalid with respect to Provider + */ + public static Provider fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Provider.class); + } + + /** + * Convert an instance of Provider to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProviderConfigOptions.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProviderConfigOptions.java new file mode 100644 index 0000000..3104383 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProviderConfigOptions.java @@ -0,0 +1,478 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.AppleSecretConfiguration; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProviderConfigOptions + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProviderConfigOptions { + public static final String SERIALIZED_NAME_PROVIDER = "Provider"; + @SerializedName(SERIALIZED_NAME_PROVIDER) + @javax.annotation.Nullable + private String provider; + + public static final String SERIALIZED_NAME_KEY = "Key"; + @SerializedName(SERIALIZED_NAME_KEY) + @javax.annotation.Nullable + private String key; + + public static final String SERIALIZED_NAME_SECRET = "Secret"; + @SerializedName(SERIALIZED_NAME_SECRET) + @javax.annotation.Nullable + private String secret; + + public static final String SERIALIZED_NAME_EXTRA_FIELD1 = "ExtraField1"; + @SerializedName(SERIALIZED_NAME_EXTRA_FIELD1) + @javax.annotation.Nullable + private String extraField1; + + public static final String SERIALIZED_NAME_EXTRA_FIELD2 = "ExtraField2"; + @SerializedName(SERIALIZED_NAME_EXTRA_FIELD2) + @javax.annotation.Nullable + private String extraField2; + + public static final String SERIALIZED_NAME_IS_ACTIVE = "IsActive"; + @SerializedName(SERIALIZED_NAME_IS_ACTIVE) + @javax.annotation.Nullable + private Boolean isActive; + + public static final String SERIALIZED_NAME_APPLE_SECRET_CONFIGURATION = "AppleSecretConfiguration"; + @SerializedName(SERIALIZED_NAME_APPLE_SECRET_CONFIGURATION) + @javax.annotation.Nullable + private AppleSecretConfiguration appleSecretConfiguration; + + public ProviderConfigOptions() { + } + + public ProviderConfigOptions provider(@javax.annotation.Nullable String provider) { + this.provider = provider; + return this; + } + + /** + * The name of the provider. + * @return provider + */ + @javax.annotation.Nullable + public String getProvider() { + return provider; + } + + public void setProvider(@javax.annotation.Nullable String provider) { + this.provider = provider; + } + + + public ProviderConfigOptions key(@javax.annotation.Nullable String key) { + this.key = key; + return this; + } + + /** + * The key for the provider. + * @return key + */ + @javax.annotation.Nullable + public String getKey() { + return key; + } + + public void setKey(@javax.annotation.Nullable String key) { + this.key = key; + } + + + public ProviderConfigOptions secret(@javax.annotation.Nullable String secret) { + this.secret = secret; + return this; + } + + /** + * The secret for the provider. + * @return secret + */ + @javax.annotation.Nullable + public String getSecret() { + return secret; + } + + public void setSecret(@javax.annotation.Nullable String secret) { + this.secret = secret; + } + + + public ProviderConfigOptions extraField1(@javax.annotation.Nullable String extraField1) { + this.extraField1 = extraField1; + return this; + } + + /** + * An extra field for additional information. + * @return extraField1 + */ + @javax.annotation.Nullable + public String getExtraField1() { + return extraField1; + } + + public void setExtraField1(@javax.annotation.Nullable String extraField1) { + this.extraField1 = extraField1; + } + + + public ProviderConfigOptions extraField2(@javax.annotation.Nullable String extraField2) { + this.extraField2 = extraField2; + return this; + } + + /** + * Another extra field for additional information. + * @return extraField2 + */ + @javax.annotation.Nullable + public String getExtraField2() { + return extraField2; + } + + public void setExtraField2(@javax.annotation.Nullable String extraField2) { + this.extraField2 = extraField2; + } + + + public ProviderConfigOptions isActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * The status of the provider. + * @return isActive + */ + @javax.annotation.Nullable + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + } + + + public ProviderConfigOptions appleSecretConfiguration(@javax.annotation.Nullable AppleSecretConfiguration appleSecretConfiguration) { + this.appleSecretConfiguration = appleSecretConfiguration; + return this; + } + + /** + * Get appleSecretConfiguration + * @return appleSecretConfiguration + */ + @javax.annotation.Nullable + public AppleSecretConfiguration getAppleSecretConfiguration() { + return appleSecretConfiguration; + } + + public void setAppleSecretConfiguration(@javax.annotation.Nullable AppleSecretConfiguration appleSecretConfiguration) { + this.appleSecretConfiguration = appleSecretConfiguration; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProviderConfigOptions instance itself + */ + public ProviderConfigOptions putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProviderConfigOptions providerConfigOptions = (ProviderConfigOptions) o; + return Objects.equals(this.provider, providerConfigOptions.provider) && + Objects.equals(this.key, providerConfigOptions.key) && + Objects.equals(this.secret, providerConfigOptions.secret) && + Objects.equals(this.extraField1, providerConfigOptions.extraField1) && + Objects.equals(this.extraField2, providerConfigOptions.extraField2) && + Objects.equals(this.isActive, providerConfigOptions.isActive) && + Objects.equals(this.appleSecretConfiguration, providerConfigOptions.appleSecretConfiguration)&& + Objects.equals(this.additionalProperties, providerConfigOptions.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(provider, key, secret, extraField1, extraField2, isActive, appleSecretConfiguration, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProviderConfigOptions {\n"); + sb.append(" provider: ").append(toIndentedString(provider)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" secret: ").append(toIndentedString(secret)).append("\n"); + sb.append(" extraField1: ").append(toIndentedString(extraField1)).append("\n"); + sb.append(" extraField2: ").append(toIndentedString(extraField2)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" appleSecretConfiguration: ").append(toIndentedString(appleSecretConfiguration)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Provider"); + openapiFields.add("Key"); + openapiFields.add("Secret"); + openapiFields.add("ExtraField1"); + openapiFields.add("ExtraField2"); + openapiFields.add("IsActive"); + openapiFields.add("AppleSecretConfiguration"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProviderConfigOptions + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProviderConfigOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProviderConfigOptions is not found in the empty JSON string", ProviderConfigOptions.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Provider") != null && !jsonObj.get("Provider").isJsonNull()) && !jsonObj.get("Provider").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Provider` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Provider").toString())); + } + if ((jsonObj.get("Key") != null && !jsonObj.get("Key").isJsonNull()) && !jsonObj.get("Key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Key").toString())); + } + if ((jsonObj.get("Secret") != null && !jsonObj.get("Secret").isJsonNull()) && !jsonObj.get("Secret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Secret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Secret").toString())); + } + if ((jsonObj.get("ExtraField1") != null && !jsonObj.get("ExtraField1").isJsonNull()) && !jsonObj.get("ExtraField1").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ExtraField1` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ExtraField1").toString())); + } + if ((jsonObj.get("ExtraField2") != null && !jsonObj.get("ExtraField2").isJsonNull()) && !jsonObj.get("ExtraField2").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ExtraField2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ExtraField2").toString())); + } + // validate the optional field `AppleSecretConfiguration` + if (jsonObj.get("AppleSecretConfiguration") != null && !jsonObj.get("AppleSecretConfiguration").isJsonNull()) { + AppleSecretConfiguration.validateJsonElement(jsonObj.get("AppleSecretConfiguration")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProviderConfigOptions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProviderConfigOptions' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProviderConfigOptions> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProviderConfigOptions.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProviderConfigOptions>() { + @Override + public void write(JsonWriter out, ProviderConfigOptions value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProviderConfigOptions read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProviderConfigOptions instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProviderConfigOptions given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProviderConfigOptions + * @throws IOException if the JSON string is invalid with respect to ProviderConfigOptions + */ + public static ProviderConfigOptions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProviderConfigOptions.class); + } + + /** + * Convert an instance of ProviderConfigOptions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProviderStatusList.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProviderStatusList.java new file mode 100644 index 0000000..958aba3 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProviderStatusList.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProviderStatusModel; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProviderStatusList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProviderStatusList { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<ProviderStatusModel> data = new ArrayList<>(); + + public ProviderStatusList() { + } + + public ProviderStatusList data(@javax.annotation.Nullable List<ProviderStatusModel> data) { + this.data = data; + return this; + } + + public ProviderStatusList addDataItem(ProviderStatusModel dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * List of provider statuses + * @return data + */ + @javax.annotation.Nullable + public List<ProviderStatusModel> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<ProviderStatusModel> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProviderStatusList instance itself + */ + public ProviderStatusList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProviderStatusList providerStatusList = (ProviderStatusList) o; + return Objects.equals(this.data, providerStatusList.data)&& + Objects.equals(this.additionalProperties, providerStatusList.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProviderStatusList {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ProviderStatusList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProviderStatusList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProviderStatusList is not found in the empty JSON string", ProviderStatusList.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + ProviderStatusModel.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProviderStatusList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProviderStatusList' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProviderStatusList> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProviderStatusList.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProviderStatusList>() { + @Override + public void write(JsonWriter out, ProviderStatusList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProviderStatusList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProviderStatusList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProviderStatusList given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProviderStatusList + * @throws IOException if the JSON string is invalid with respect to ProviderStatusList + */ + public static ProviderStatusList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProviderStatusList.class); + } + + /** + * Convert an instance of ProviderStatusList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ProviderStatusModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProviderStatusModel.java new file mode 100644 index 0000000..66fbf99 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ProviderStatusModel.java @@ -0,0 +1,323 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ProviderStatusModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ProviderStatusModel { + public static final String SERIALIZED_NAME_PROVIDER_NAME = "ProviderName"; + @SerializedName(SERIALIZED_NAME_PROVIDER_NAME) + @javax.annotation.Nonnull + private String providerName; + + public static final String SERIALIZED_NAME_IS_ACTIVE = "IsActive"; + @SerializedName(SERIALIZED_NAME_IS_ACTIVE) + @javax.annotation.Nonnull + private Boolean isActive; + + public ProviderStatusModel() { + } + + public ProviderStatusModel providerName(@javax.annotation.Nonnull String providerName) { + this.providerName = providerName; + return this; + } + + /** + * Name of the provider + * @return providerName + */ + @javax.annotation.Nonnull + public String getProviderName() { + return providerName; + } + + public void setProviderName(@javax.annotation.Nonnull String providerName) { + this.providerName = providerName; + } + + + public ProviderStatusModel isActive(@javax.annotation.Nonnull Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Status of the provider + * @return isActive + */ + @javax.annotation.Nonnull + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(@javax.annotation.Nonnull Boolean isActive) { + this.isActive = isActive; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ProviderStatusModel instance itself + */ + public ProviderStatusModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ProviderStatusModel providerStatusModel = (ProviderStatusModel) o; + return Objects.equals(this.providerName, providerStatusModel.providerName) && + Objects.equals(this.isActive, providerStatusModel.isActive)&& + Objects.equals(this.additionalProperties, providerStatusModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(providerName, isActive, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ProviderStatusModel {\n"); + sb.append(" providerName: ").append(toIndentedString(providerName)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ProviderName"); + openapiFields.add("IsActive"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("ProviderName"); + openapiRequiredFields.add("IsActive"); + } + + /** + * 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 ProviderStatusModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ProviderStatusModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ProviderStatusModel is not found in the empty JSON string", ProviderStatusModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ProviderStatusModel.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("ProviderName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProviderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProviderName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ProviderStatusModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ProviderStatusModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ProviderStatusModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ProviderStatusModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<ProviderStatusModel>() { + @Override + public void write(JsonWriter out, ProviderStatusModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ProviderStatusModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ProviderStatusModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ProviderStatusModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ProviderStatusModel + * @throws IOException if the JSON string is invalid with respect to ProviderStatusModel + */ + public static ProviderStatusModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ProviderStatusModel.class); + } + + /** + * Convert an instance of ProviderStatusModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PublicKeyCredentialCreationOptions.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PublicKeyCredentialCreationOptions.java new file mode 100644 index 0000000..32aacc0 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PublicKeyCredentialCreationOptions.java @@ -0,0 +1,637 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.PublicKeyCredentialCreationOptionsAuthenticatorSelection; +import com.loginradius.sdk.internal.openapi.model.PublicKeyCredentialCreationOptionsExcludeCredentialsInner; +import com.loginradius.sdk.internal.openapi.model.PublicKeyCredentialCreationOptionsExtensions; +import com.loginradius.sdk.internal.openapi.model.PublicKeyCredentialCreationOptionsPubKeyCredParamsInner; +import com.loginradius.sdk.internal.openapi.model.PublicKeyCredentialCreationOptionsRp; +import com.loginradius.sdk.internal.openapi.model.PublicKeyCredentialCreationOptionsUser; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * The parameters for creating a new public key credential. This contains all the necessary information for the client to generate a new credential and for the authenticator to attest to that credential. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PublicKeyCredentialCreationOptions { + public static final String SERIALIZED_NAME_RP = "rp"; + @SerializedName(SERIALIZED_NAME_RP) + @javax.annotation.Nonnull + private PublicKeyCredentialCreationOptionsRp rp; + + public static final String SERIALIZED_NAME_USER = "user"; + @SerializedName(SERIALIZED_NAME_USER) + @javax.annotation.Nonnull + private PublicKeyCredentialCreationOptionsUser user; + + public static final String SERIALIZED_NAME_CHALLENGE = "challenge"; + @SerializedName(SERIALIZED_NAME_CHALLENGE) + @javax.annotation.Nonnull + private String challenge; + + public static final String SERIALIZED_NAME_PUB_KEY_CRED_PARAMS = "pubKeyCredParams"; + @SerializedName(SERIALIZED_NAME_PUB_KEY_CRED_PARAMS) + @javax.annotation.Nonnull + private List<PublicKeyCredentialCreationOptionsPubKeyCredParamsInner> pubKeyCredParams = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TIMEOUT = "timeout"; + @SerializedName(SERIALIZED_NAME_TIMEOUT) + @javax.annotation.Nullable + private Integer timeout; + + public static final String SERIALIZED_NAME_EXCLUDE_CREDENTIALS = "excludeCredentials"; + @SerializedName(SERIALIZED_NAME_EXCLUDE_CREDENTIALS) + @javax.annotation.Nullable + private List<PublicKeyCredentialCreationOptionsExcludeCredentialsInner> excludeCredentials = new ArrayList<>(); + + public static final String SERIALIZED_NAME_AUTHENTICATOR_SELECTION = "authenticatorSelection"; + @SerializedName(SERIALIZED_NAME_AUTHENTICATOR_SELECTION) + @javax.annotation.Nullable + private PublicKeyCredentialCreationOptionsAuthenticatorSelection authenticatorSelection; + + /** + * Optional. Specifies whether the authenticator should attach attestation information to the credential. + */ + @JsonAdapter(AttestationEnum.Adapter.class) + public enum AttestationEnum { + NONE("none"), + + INDIRECT("indirect"), + + DIRECT("direct"), + + ENTERPRISE("enterprise"); + + private String value; + + AttestationEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AttestationEnum fromValue(String value) { + for (AttestationEnum b : AttestationEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<AttestationEnum> { + @Override + public void write(final JsonWriter jsonWriter, final AttestationEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AttestationEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AttestationEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AttestationEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_ATTESTATION = "attestation"; + @SerializedName(SERIALIZED_NAME_ATTESTATION) + @javax.annotation.Nullable + private AttestationEnum attestation; + + public static final String SERIALIZED_NAME_EXTENSIONS = "extensions"; + @SerializedName(SERIALIZED_NAME_EXTENSIONS) + @javax.annotation.Nullable + private PublicKeyCredentialCreationOptionsExtensions extensions; + + public PublicKeyCredentialCreationOptions() { + } + + public PublicKeyCredentialCreationOptions rp(@javax.annotation.Nonnull PublicKeyCredentialCreationOptionsRp rp) { + this.rp = rp; + return this; + } + + /** + * Get rp + * @return rp + */ + @javax.annotation.Nonnull + public PublicKeyCredentialCreationOptionsRp getRp() { + return rp; + } + + public void setRp(@javax.annotation.Nonnull PublicKeyCredentialCreationOptionsRp rp) { + this.rp = rp; + } + + + public PublicKeyCredentialCreationOptions user(@javax.annotation.Nonnull PublicKeyCredentialCreationOptionsUser user) { + this.user = user; + return this; + } + + /** + * Get user + * @return user + */ + @javax.annotation.Nonnull + public PublicKeyCredentialCreationOptionsUser getUser() { + return user; + } + + public void setUser(@javax.annotation.Nonnull PublicKeyCredentialCreationOptionsUser user) { + this.user = user; + } + + + public PublicKeyCredentialCreationOptions challenge(@javax.annotation.Nonnull String challenge) { + this.challenge = challenge; + return this; + } + + /** + * A cryptographically random challenge generated by the Relying Party server. This is used to prevent replay attacks and ensure the credential creation is fresh. + * @return challenge + */ + @javax.annotation.Nonnull + public String getChallenge() { + return challenge; + } + + public void setChallenge(@javax.annotation.Nonnull String challenge) { + this.challenge = challenge; + } + + + public PublicKeyCredentialCreationOptions pubKeyCredParams(@javax.annotation.Nonnull List<PublicKeyCredentialCreationOptionsPubKeyCredParamsInner> pubKeyCredParams) { + this.pubKeyCredParams = pubKeyCredParams; + return this; + } + + public PublicKeyCredentialCreationOptions addPubKeyCredParamsItem(PublicKeyCredentialCreationOptionsPubKeyCredParamsInner pubKeyCredParamsItem) { + if (this.pubKeyCredParams == null) { + this.pubKeyCredParams = new ArrayList<>(); + } + this.pubKeyCredParams.add(pubKeyCredParamsItem); + return this; + } + + /** + * An array of acceptable public key credential types and cryptographic algorithms. The client will select one from this list based on the capabilities of the authenticator. + * @return pubKeyCredParams + */ + @javax.annotation.Nonnull + public List<PublicKeyCredentialCreationOptionsPubKeyCredParamsInner> getPubKeyCredParams() { + return pubKeyCredParams; + } + + public void setPubKeyCredParams(@javax.annotation.Nonnull List<PublicKeyCredentialCreationOptionsPubKeyCredParamsInner> pubKeyCredParams) { + this.pubKeyCredParams = pubKeyCredParams; + } + + + public PublicKeyCredentialCreationOptions timeout(@javax.annotation.Nullable Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Optional. The time, in milliseconds, that the User has to respond to the credential creation request before it times out. + * @return timeout + */ + @javax.annotation.Nullable + public Integer getTimeout() { + return timeout; + } + + public void setTimeout(@javax.annotation.Nullable Integer timeout) { + this.timeout = timeout; + } + + + public PublicKeyCredentialCreationOptions excludeCredentials(@javax.annotation.Nullable List<PublicKeyCredentialCreationOptionsExcludeCredentialsInner> excludeCredentials) { + this.excludeCredentials = excludeCredentials; + return this; + } + + public PublicKeyCredentialCreationOptions addExcludeCredentialsItem(PublicKeyCredentialCreationOptionsExcludeCredentialsInner excludeCredentialsItem) { + if (this.excludeCredentials == null) { + this.excludeCredentials = new ArrayList<>(); + } + this.excludeCredentials.add(excludeCredentialsItem); + return this; + } + + /** + * Optional. An array of credentials that should not be created again. This is used to prevent a User from registering the same credential multiple times. + * @return excludeCredentials + */ + @javax.annotation.Nullable + public List<PublicKeyCredentialCreationOptionsExcludeCredentialsInner> getExcludeCredentials() { + return excludeCredentials; + } + + public void setExcludeCredentials(@javax.annotation.Nullable List<PublicKeyCredentialCreationOptionsExcludeCredentialsInner> excludeCredentials) { + this.excludeCredentials = excludeCredentials; + } + + + public PublicKeyCredentialCreationOptions authenticatorSelection(@javax.annotation.Nullable PublicKeyCredentialCreationOptionsAuthenticatorSelection authenticatorSelection) { + this.authenticatorSelection = authenticatorSelection; + return this; + } + + /** + * Get authenticatorSelection + * @return authenticatorSelection + */ + @javax.annotation.Nullable + public PublicKeyCredentialCreationOptionsAuthenticatorSelection getAuthenticatorSelection() { + return authenticatorSelection; + } + + public void setAuthenticatorSelection(@javax.annotation.Nullable PublicKeyCredentialCreationOptionsAuthenticatorSelection authenticatorSelection) { + this.authenticatorSelection = authenticatorSelection; + } + + + public PublicKeyCredentialCreationOptions attestation(@javax.annotation.Nullable AttestationEnum attestation) { + this.attestation = attestation; + return this; + } + + /** + * Optional. Specifies whether the authenticator should attach attestation information to the credential. + * @return attestation + */ + @javax.annotation.Nullable + public AttestationEnum getAttestation() { + return attestation; + } + + public void setAttestation(@javax.annotation.Nullable AttestationEnum attestation) { + this.attestation = attestation; + } + + + public PublicKeyCredentialCreationOptions extensions(@javax.annotation.Nullable PublicKeyCredentialCreationOptionsExtensions extensions) { + this.extensions = extensions; + return this; + } + + /** + * Get extensions + * @return extensions + */ + @javax.annotation.Nullable + public PublicKeyCredentialCreationOptionsExtensions getExtensions() { + return extensions; + } + + public void setExtensions(@javax.annotation.Nullable PublicKeyCredentialCreationOptionsExtensions extensions) { + this.extensions = extensions; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PublicKeyCredentialCreationOptions instance itself + */ + public PublicKeyCredentialCreationOptions putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PublicKeyCredentialCreationOptions publicKeyCredentialCreationOptions = (PublicKeyCredentialCreationOptions) o; + return Objects.equals(this.rp, publicKeyCredentialCreationOptions.rp) && + Objects.equals(this.user, publicKeyCredentialCreationOptions.user) && + Objects.equals(this.challenge, publicKeyCredentialCreationOptions.challenge) && + Objects.equals(this.pubKeyCredParams, publicKeyCredentialCreationOptions.pubKeyCredParams) && + Objects.equals(this.timeout, publicKeyCredentialCreationOptions.timeout) && + Objects.equals(this.excludeCredentials, publicKeyCredentialCreationOptions.excludeCredentials) && + Objects.equals(this.authenticatorSelection, publicKeyCredentialCreationOptions.authenticatorSelection) && + Objects.equals(this.attestation, publicKeyCredentialCreationOptions.attestation) && + Objects.equals(this.extensions, publicKeyCredentialCreationOptions.extensions)&& + Objects.equals(this.additionalProperties, publicKeyCredentialCreationOptions.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(rp, user, challenge, pubKeyCredParams, timeout, excludeCredentials, authenticatorSelection, attestation, extensions, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PublicKeyCredentialCreationOptions {\n"); + sb.append(" rp: ").append(toIndentedString(rp)).append("\n"); + sb.append(" user: ").append(toIndentedString(user)).append("\n"); + sb.append(" challenge: ").append(toIndentedString(challenge)).append("\n"); + sb.append(" pubKeyCredParams: ").append(toIndentedString(pubKeyCredParams)).append("\n"); + sb.append(" timeout: ").append(toIndentedString(timeout)).append("\n"); + sb.append(" excludeCredentials: ").append(toIndentedString(excludeCredentials)).append("\n"); + sb.append(" authenticatorSelection: ").append(toIndentedString(authenticatorSelection)).append("\n"); + sb.append(" attestation: ").append(toIndentedString(attestation)).append("\n"); + sb.append(" extensions: ").append(toIndentedString(extensions)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("rp"); + openapiFields.add("user"); + openapiFields.add("challenge"); + openapiFields.add("pubKeyCredParams"); + openapiFields.add("timeout"); + openapiFields.add("excludeCredentials"); + openapiFields.add("authenticatorSelection"); + openapiFields.add("attestation"); + openapiFields.add("extensions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("rp"); + openapiRequiredFields.add("user"); + openapiRequiredFields.add("challenge"); + openapiRequiredFields.add("pubKeyCredParams"); + } + + /** + * 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 PublicKeyCredentialCreationOptions + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PublicKeyCredentialCreationOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PublicKeyCredentialCreationOptions is not found in the empty JSON string", PublicKeyCredentialCreationOptions.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PublicKeyCredentialCreationOptions.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 `rp` + PublicKeyCredentialCreationOptionsRp.validateJsonElement(jsonObj.get("rp")); + // validate the required field `user` + PublicKeyCredentialCreationOptionsUser.validateJsonElement(jsonObj.get("user")); + if (!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())); + } + // ensure the json data is an array + if (!jsonObj.get("pubKeyCredParams").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `pubKeyCredParams` to be an array in the JSON string but got `%s`", jsonObj.get("pubKeyCredParams").toString())); + } + + JsonArray jsonArraypubKeyCredParams = jsonObj.getAsJsonArray("pubKeyCredParams"); + // validate the required field `pubKeyCredParams` (array) + for (int i = 0; i < jsonArraypubKeyCredParams.size(); i++) { + PublicKeyCredentialCreationOptionsPubKeyCredParamsInner.validateJsonElement(jsonArraypubKeyCredParams.get(i)); + }; + if (jsonObj.get("excludeCredentials") != null && !jsonObj.get("excludeCredentials").isJsonNull()) { + JsonArray jsonArrayexcludeCredentials = jsonObj.getAsJsonArray("excludeCredentials"); + if (jsonArrayexcludeCredentials != null) { + // ensure the json data is an array + if (!jsonObj.get("excludeCredentials").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `excludeCredentials` to be an array in the JSON string but got `%s`", jsonObj.get("excludeCredentials").toString())); + } + + // validate the optional field `excludeCredentials` (array) + for (int i = 0; i < jsonArrayexcludeCredentials.size(); i++) { + PublicKeyCredentialCreationOptionsExcludeCredentialsInner.validateJsonElement(jsonArrayexcludeCredentials.get(i)); + }; + } + } + // validate the optional field `authenticatorSelection` + if (jsonObj.get("authenticatorSelection") != null && !jsonObj.get("authenticatorSelection").isJsonNull()) { + PublicKeyCredentialCreationOptionsAuthenticatorSelection.validateJsonElement(jsonObj.get("authenticatorSelection")); + } + if ((jsonObj.get("attestation") != null && !jsonObj.get("attestation").isJsonNull()) && !jsonObj.get("attestation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `attestation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("attestation").toString())); + } + // validate the optional field `attestation` + if (jsonObj.get("attestation") != null && !jsonObj.get("attestation").isJsonNull()) { + AttestationEnum.validateJsonElement(jsonObj.get("attestation")); + } + // validate the optional field `extensions` + if (jsonObj.get("extensions") != null && !jsonObj.get("extensions").isJsonNull()) { + PublicKeyCredentialCreationOptionsExtensions.validateJsonElement(jsonObj.get("extensions")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PublicKeyCredentialCreationOptions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PublicKeyCredentialCreationOptions' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PublicKeyCredentialCreationOptions> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PublicKeyCredentialCreationOptions.class)); + + return (TypeAdapter<T>) new TypeAdapter<PublicKeyCredentialCreationOptions>() { + @Override + public void write(JsonWriter out, PublicKeyCredentialCreationOptions value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PublicKeyCredentialCreationOptions read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PublicKeyCredentialCreationOptions instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PublicKeyCredentialCreationOptions given an JSON string + * + * @param jsonString JSON string + * @return An instance of PublicKeyCredentialCreationOptions + * @throws IOException if the JSON string is invalid with respect to PublicKeyCredentialCreationOptions + */ + public static PublicKeyCredentialCreationOptions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PublicKeyCredentialCreationOptions.class); + } + + /** + * Convert an instance of PublicKeyCredentialCreationOptions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PublicKeyCredentialCreationOptionsAuthenticatorSelection.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PublicKeyCredentialCreationOptionsAuthenticatorSelection.java new file mode 100644 index 0000000..faf9664 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PublicKeyCredentialCreationOptionsAuthenticatorSelection.java @@ -0,0 +1,546 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * Optional. Specifies requirements for the authenticator to be used for credential creation. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PublicKeyCredentialCreationOptionsAuthenticatorSelection { + /** + * Optional. Specifies whether the authenticator should be a platform authenticator (like TouchID, Windows Hello) or a cross-platform authenticator (like a security key). + */ + @JsonAdapter(AuthenticatorAttachmentEnum.Adapter.class) + public enum AuthenticatorAttachmentEnum { + PLATFORM("platform"), + + CROSS_PLATFORM("cross-platform"); + + private String value; + + AuthenticatorAttachmentEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AuthenticatorAttachmentEnum fromValue(String value) { + for (AuthenticatorAttachmentEnum b : AuthenticatorAttachmentEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<AuthenticatorAttachmentEnum> { + @Override + public void write(final JsonWriter jsonWriter, final AuthenticatorAttachmentEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AuthenticatorAttachmentEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AuthenticatorAttachmentEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AuthenticatorAttachmentEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_AUTHENTICATOR_ATTACHMENT = "authenticatorAttachment"; + @SerializedName(SERIALIZED_NAME_AUTHENTICATOR_ATTACHMENT) + @javax.annotation.Nullable + private AuthenticatorAttachmentEnum authenticatorAttachment; + + public static final String SERIALIZED_NAME_REQUIRE_RESIDENT_KEY = "requireResidentKey"; + @SerializedName(SERIALIZED_NAME_REQUIRE_RESIDENT_KEY) + @javax.annotation.Nullable + private Boolean requireResidentKey; + + /** + * Optional. Specifies the Relying Party's requirements for client-side discoverable credentials (resident keys). + */ + @JsonAdapter(ResidentKeyEnum.Adapter.class) + public enum ResidentKeyEnum { + DISCOURAGED("discouraged"), + + PREFERRED("preferred"), + + REQUIRED("required"); + + private String value; + + ResidentKeyEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ResidentKeyEnum fromValue(String value) { + for (ResidentKeyEnum b : ResidentKeyEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<ResidentKeyEnum> { + @Override + public void write(final JsonWriter jsonWriter, final ResidentKeyEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ResidentKeyEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ResidentKeyEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ResidentKeyEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_RESIDENT_KEY = "residentKey"; + @SerializedName(SERIALIZED_NAME_RESIDENT_KEY) + @javax.annotation.Nullable + private ResidentKeyEnum residentKey; + + /** + * Optional. Specifies whether User verification is required, preferred, or discouraged for credential creation. + */ + @JsonAdapter(UserVerificationEnum.Adapter.class) + public enum UserVerificationEnum { + REQUIRED("required"), + + PREFERRED("preferred"), + + DISCOURAGED("discouraged"); + + private String value; + + UserVerificationEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static UserVerificationEnum fromValue(String value) { + for (UserVerificationEnum b : UserVerificationEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<UserVerificationEnum> { + @Override + public void write(final JsonWriter jsonWriter, final UserVerificationEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public UserVerificationEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return UserVerificationEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + UserVerificationEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_USER_VERIFICATION = "userVerification"; + @SerializedName(SERIALIZED_NAME_USER_VERIFICATION) + @javax.annotation.Nullable + private UserVerificationEnum userVerification; + + public PublicKeyCredentialCreationOptionsAuthenticatorSelection() { + } + + public PublicKeyCredentialCreationOptionsAuthenticatorSelection authenticatorAttachment(@javax.annotation.Nullable AuthenticatorAttachmentEnum authenticatorAttachment) { + this.authenticatorAttachment = authenticatorAttachment; + return this; + } + + /** + * Optional. Specifies whether the authenticator should be a platform authenticator (like TouchID, Windows Hello) or a cross-platform authenticator (like a security key). + * @return authenticatorAttachment + */ + @javax.annotation.Nullable + public AuthenticatorAttachmentEnum getAuthenticatorAttachment() { + return authenticatorAttachment; + } + + public void setAuthenticatorAttachment(@javax.annotation.Nullable AuthenticatorAttachmentEnum authenticatorAttachment) { + this.authenticatorAttachment = authenticatorAttachment; + } + + + public PublicKeyCredentialCreationOptionsAuthenticatorSelection requireResidentKey(@javax.annotation.Nullable Boolean requireResidentKey) { + this.requireResidentKey = requireResidentKey; + return this; + } + + /** + * Optional. Indicates whether the authenticator must be capable of storing the credential on the device (resident key / discoverable credential). + * @return requireResidentKey + */ + @javax.annotation.Nullable + public Boolean getRequireResidentKey() { + return requireResidentKey; + } + + public void setRequireResidentKey(@javax.annotation.Nullable Boolean requireResidentKey) { + this.requireResidentKey = requireResidentKey; + } + + + public PublicKeyCredentialCreationOptionsAuthenticatorSelection residentKey(@javax.annotation.Nullable ResidentKeyEnum residentKey) { + this.residentKey = residentKey; + return this; + } + + /** + * Optional. Specifies the Relying Party's requirements for client-side discoverable credentials (resident keys). + * @return residentKey + */ + @javax.annotation.Nullable + public ResidentKeyEnum getResidentKey() { + return residentKey; + } + + public void setResidentKey(@javax.annotation.Nullable ResidentKeyEnum residentKey) { + this.residentKey = residentKey; + } + + + public PublicKeyCredentialCreationOptionsAuthenticatorSelection userVerification(@javax.annotation.Nullable UserVerificationEnum userVerification) { + this.userVerification = userVerification; + return this; + } + + /** + * Optional. Specifies whether User verification is required, preferred, or discouraged for credential creation. + * @return userVerification + */ + @javax.annotation.Nullable + public UserVerificationEnum getUserVerification() { + return userVerification; + } + + public void setUserVerification(@javax.annotation.Nullable UserVerificationEnum userVerification) { + this.userVerification = userVerification; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PublicKeyCredentialCreationOptionsAuthenticatorSelection instance itself + */ + public PublicKeyCredentialCreationOptionsAuthenticatorSelection putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PublicKeyCredentialCreationOptionsAuthenticatorSelection publicKeyCredentialCreationOptionsAuthenticatorSelection = (PublicKeyCredentialCreationOptionsAuthenticatorSelection) o; + return Objects.equals(this.authenticatorAttachment, publicKeyCredentialCreationOptionsAuthenticatorSelection.authenticatorAttachment) && + Objects.equals(this.requireResidentKey, publicKeyCredentialCreationOptionsAuthenticatorSelection.requireResidentKey) && + Objects.equals(this.residentKey, publicKeyCredentialCreationOptionsAuthenticatorSelection.residentKey) && + Objects.equals(this.userVerification, publicKeyCredentialCreationOptionsAuthenticatorSelection.userVerification)&& + Objects.equals(this.additionalProperties, publicKeyCredentialCreationOptionsAuthenticatorSelection.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(authenticatorAttachment, requireResidentKey, residentKey, userVerification, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PublicKeyCredentialCreationOptionsAuthenticatorSelection {\n"); + sb.append(" authenticatorAttachment: ").append(toIndentedString(authenticatorAttachment)).append("\n"); + sb.append(" requireResidentKey: ").append(toIndentedString(requireResidentKey)).append("\n"); + sb.append(" residentKey: ").append(toIndentedString(residentKey)).append("\n"); + sb.append(" userVerification: ").append(toIndentedString(userVerification)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("authenticatorAttachment"); + openapiFields.add("requireResidentKey"); + openapiFields.add("residentKey"); + openapiFields.add("userVerification"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 PublicKeyCredentialCreationOptionsAuthenticatorSelection + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PublicKeyCredentialCreationOptionsAuthenticatorSelection.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PublicKeyCredentialCreationOptionsAuthenticatorSelection is not found in the empty JSON string", PublicKeyCredentialCreationOptionsAuthenticatorSelection.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("authenticatorAttachment") != null && !jsonObj.get("authenticatorAttachment").isJsonNull()) && !jsonObj.get("authenticatorAttachment").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `authenticatorAttachment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authenticatorAttachment").toString())); + } + // validate the optional field `authenticatorAttachment` + if (jsonObj.get("authenticatorAttachment") != null && !jsonObj.get("authenticatorAttachment").isJsonNull()) { + AuthenticatorAttachmentEnum.validateJsonElement(jsonObj.get("authenticatorAttachment")); + } + if ((jsonObj.get("residentKey") != null && !jsonObj.get("residentKey").isJsonNull()) && !jsonObj.get("residentKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `residentKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("residentKey").toString())); + } + // validate the optional field `residentKey` + if (jsonObj.get("residentKey") != null && !jsonObj.get("residentKey").isJsonNull()) { + ResidentKeyEnum.validateJsonElement(jsonObj.get("residentKey")); + } + if ((jsonObj.get("userVerification") != null && !jsonObj.get("userVerification").isJsonNull()) && !jsonObj.get("userVerification").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userVerification` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userVerification").toString())); + } + // validate the optional field `userVerification` + if (jsonObj.get("userVerification") != null && !jsonObj.get("userVerification").isJsonNull()) { + UserVerificationEnum.validateJsonElement(jsonObj.get("userVerification")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PublicKeyCredentialCreationOptionsAuthenticatorSelection.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PublicKeyCredentialCreationOptionsAuthenticatorSelection' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PublicKeyCredentialCreationOptionsAuthenticatorSelection> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PublicKeyCredentialCreationOptionsAuthenticatorSelection.class)); + + return (TypeAdapter<T>) new TypeAdapter<PublicKeyCredentialCreationOptionsAuthenticatorSelection>() { + @Override + public void write(JsonWriter out, PublicKeyCredentialCreationOptionsAuthenticatorSelection value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PublicKeyCredentialCreationOptionsAuthenticatorSelection read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PublicKeyCredentialCreationOptionsAuthenticatorSelection instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PublicKeyCredentialCreationOptionsAuthenticatorSelection given an JSON string + * + * @param jsonString JSON string + * @return An instance of PublicKeyCredentialCreationOptionsAuthenticatorSelection + * @throws IOException if the JSON string is invalid with respect to PublicKeyCredentialCreationOptionsAuthenticatorSelection + */ + public static PublicKeyCredentialCreationOptionsAuthenticatorSelection fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PublicKeyCredentialCreationOptionsAuthenticatorSelection.class); + } + + /** + * Convert an instance of PublicKeyCredentialCreationOptionsAuthenticatorSelection to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PublicKeyCredentialCreationOptionsExcludeCredentialsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PublicKeyCredentialCreationOptionsExcludeCredentialsInner.java new file mode 100644 index 0000000..0138c6d --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PublicKeyCredentialCreationOptionsExcludeCredentialsInner.java @@ -0,0 +1,479 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.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.loginradius.sdk.internal.openapi.JSON; + +/** + * PublicKeyCredentialCreationOptionsExcludeCredentialsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PublicKeyCredentialCreationOptionsExcludeCredentialsInner { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private String id; + + /** + * The type of credential to exclude. For WebAuthn this is always \"public-key\". + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + PUBLIC_KEY("public-key"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<TypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + /** + * Gets or Sets transports + */ + @JsonAdapter(TransportsEnum.Adapter.class) + public enum TransportsEnum { + USB("usb"), + + NFC("nfc"), + + BLE("ble"), + + INTERNAL("internal"), + + HYBRID("hybrid"), + + SMART_CARD("smart-card"); + + private String value; + + TransportsEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TransportsEnum fromValue(String value) { + for (TransportsEnum b : TransportsEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<TransportsEnum> { + @Override + public void write(final JsonWriter jsonWriter, final TransportsEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TransportsEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TransportsEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TransportsEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TRANSPORTS = "transports"; + @SerializedName(SERIALIZED_NAME_TRANSPORTS) + @javax.annotation.Nullable + private List<TransportsEnum> transports = new ArrayList<>(); + + public PublicKeyCredentialCreationOptionsExcludeCredentialsInner() { + } + + public PublicKeyCredentialCreationOptionsExcludeCredentialsInner id(@javax.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * The credential ID of the credential to exclude. + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + + public PublicKeyCredentialCreationOptionsExcludeCredentialsInner type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of credential to exclude. For WebAuthn this is always \"public-key\". + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + public PublicKeyCredentialCreationOptionsExcludeCredentialsInner transports(@javax.annotation.Nullable List<TransportsEnum> transports) { + this.transports = transports; + return this; + } + + public PublicKeyCredentialCreationOptionsExcludeCredentialsInner addTransportsItem(TransportsEnum transportsItem) { + if (this.transports == null) { + this.transports = new ArrayList<>(); + } + this.transports.add(transportsItem); + return this; + } + + /** + * Optional. Hints as to how the client might communicate with the authenticator of the credential to exclude. + * @return transports + */ + @javax.annotation.Nullable + public List<TransportsEnum> getTransports() { + return transports; + } + + public void setTransports(@javax.annotation.Nullable List<TransportsEnum> transports) { + this.transports = transports; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PublicKeyCredentialCreationOptionsExcludeCredentialsInner instance itself + */ + public PublicKeyCredentialCreationOptionsExcludeCredentialsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PublicKeyCredentialCreationOptionsExcludeCredentialsInner publicKeyCredentialCreationOptionsExcludeCredentialsInner = (PublicKeyCredentialCreationOptionsExcludeCredentialsInner) o; + return Objects.equals(this.id, publicKeyCredentialCreationOptionsExcludeCredentialsInner.id) && + Objects.equals(this.type, publicKeyCredentialCreationOptionsExcludeCredentialsInner.type) && + Objects.equals(this.transports, publicKeyCredentialCreationOptionsExcludeCredentialsInner.transports)&& + Objects.equals(this.additionalProperties, publicKeyCredentialCreationOptionsExcludeCredentialsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, transports, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PublicKeyCredentialCreationOptionsExcludeCredentialsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" transports: ").append(toIndentedString(transports)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("id"); + openapiFields.add("type"); + openapiFields.add("transports"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("type"); + } + + /** + * 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 PublicKeyCredentialCreationOptionsExcludeCredentialsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PublicKeyCredentialCreationOptionsExcludeCredentialsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PublicKeyCredentialCreationOptionsExcludeCredentialsInner is not found in the empty JSON string", PublicKeyCredentialCreationOptionsExcludeCredentialsInner.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PublicKeyCredentialCreationOptionsExcludeCredentialsInner.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("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + // ensure the optional json data is an array if present + if (jsonObj.get("transports") != null && !jsonObj.get("transports").isJsonNull() && !jsonObj.get("transports").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `transports` to be an array in the JSON string but got `%s`", jsonObj.get("transports").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PublicKeyCredentialCreationOptionsExcludeCredentialsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PublicKeyCredentialCreationOptionsExcludeCredentialsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PublicKeyCredentialCreationOptionsExcludeCredentialsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PublicKeyCredentialCreationOptionsExcludeCredentialsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<PublicKeyCredentialCreationOptionsExcludeCredentialsInner>() { + @Override + public void write(JsonWriter out, PublicKeyCredentialCreationOptionsExcludeCredentialsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PublicKeyCredentialCreationOptionsExcludeCredentialsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PublicKeyCredentialCreationOptionsExcludeCredentialsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PublicKeyCredentialCreationOptionsExcludeCredentialsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of PublicKeyCredentialCreationOptionsExcludeCredentialsInner + * @throws IOException if the JSON string is invalid with respect to PublicKeyCredentialCreationOptionsExcludeCredentialsInner + */ + public static PublicKeyCredentialCreationOptionsExcludeCredentialsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PublicKeyCredentialCreationOptionsExcludeCredentialsInner.class); + } + + /** + * Convert an instance of PublicKeyCredentialCreationOptionsExcludeCredentialsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PublicKeyCredentialCreationOptionsExtensions.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PublicKeyCredentialCreationOptionsExtensions.java new file mode 100644 index 0000000..e240ec8 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PublicKeyCredentialCreationOptionsExtensions.java @@ -0,0 +1,314 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * Optional WebAuthn extensions to influence authenticator behavior + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PublicKeyCredentialCreationOptionsExtensions { + public static final String SERIALIZED_NAME_CRED_PROPS = "credProps"; + @SerializedName(SERIALIZED_NAME_CRED_PROPS) + @javax.annotation.Nullable + private Boolean credProps; + + public static final String SERIALIZED_NAME_EXAMPLE_EXTENSION = "exampleExtension"; + @SerializedName(SERIALIZED_NAME_EXAMPLE_EXTENSION) + @javax.annotation.Nullable + private String exampleExtension; + + public PublicKeyCredentialCreationOptionsExtensions() { + } + + public PublicKeyCredentialCreationOptionsExtensions credProps(@javax.annotation.Nullable Boolean credProps) { + this.credProps = credProps; + return this; + } + + /** + * Requests information about the credential’s properties (e.g., if it's discoverable) + * @return credProps + */ + @javax.annotation.Nullable + public Boolean getCredProps() { + return credProps; + } + + public void setCredProps(@javax.annotation.Nullable Boolean credProps) { + this.credProps = credProps; + } + + + public PublicKeyCredentialCreationOptionsExtensions exampleExtension(@javax.annotation.Nullable String exampleExtension) { + this.exampleExtension = exampleExtension; + return this; + } + + /** + * Placeholder for other extension values (can be vendor-specific) + * @return exampleExtension + */ + @javax.annotation.Nullable + public String getExampleExtension() { + return exampleExtension; + } + + public void setExampleExtension(@javax.annotation.Nullable String exampleExtension) { + this.exampleExtension = exampleExtension; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PublicKeyCredentialCreationOptionsExtensions instance itself + */ + public PublicKeyCredentialCreationOptionsExtensions putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PublicKeyCredentialCreationOptionsExtensions publicKeyCredentialCreationOptionsExtensions = (PublicKeyCredentialCreationOptionsExtensions) o; + return Objects.equals(this.credProps, publicKeyCredentialCreationOptionsExtensions.credProps) && + Objects.equals(this.exampleExtension, publicKeyCredentialCreationOptionsExtensions.exampleExtension)&& + Objects.equals(this.additionalProperties, publicKeyCredentialCreationOptionsExtensions.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(credProps, exampleExtension, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PublicKeyCredentialCreationOptionsExtensions {\n"); + sb.append(" credProps: ").append(toIndentedString(credProps)).append("\n"); + sb.append(" exampleExtension: ").append(toIndentedString(exampleExtension)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("credProps"); + openapiFields.add("exampleExtension"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 PublicKeyCredentialCreationOptionsExtensions + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PublicKeyCredentialCreationOptionsExtensions.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PublicKeyCredentialCreationOptionsExtensions is not found in the empty JSON string", PublicKeyCredentialCreationOptionsExtensions.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("exampleExtension") != null && !jsonObj.get("exampleExtension").isJsonNull()) && !jsonObj.get("exampleExtension").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `exampleExtension` to be a primitive type in the JSON string but got `%s`", jsonObj.get("exampleExtension").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PublicKeyCredentialCreationOptionsExtensions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PublicKeyCredentialCreationOptionsExtensions' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PublicKeyCredentialCreationOptionsExtensions> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PublicKeyCredentialCreationOptionsExtensions.class)); + + return (TypeAdapter<T>) new TypeAdapter<PublicKeyCredentialCreationOptionsExtensions>() { + @Override + public void write(JsonWriter out, PublicKeyCredentialCreationOptionsExtensions value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PublicKeyCredentialCreationOptionsExtensions read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PublicKeyCredentialCreationOptionsExtensions instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PublicKeyCredentialCreationOptionsExtensions given an JSON string + * + * @param jsonString JSON string + * @return An instance of PublicKeyCredentialCreationOptionsExtensions + * @throws IOException if the JSON string is invalid with respect to PublicKeyCredentialCreationOptionsExtensions + */ + public static PublicKeyCredentialCreationOptionsExtensions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PublicKeyCredentialCreationOptionsExtensions.class); + } + + /** + * Convert an instance of PublicKeyCredentialCreationOptionsExtensions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PublicKeyCredentialCreationOptionsPubKeyCredParamsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PublicKeyCredentialCreationOptionsPubKeyCredParamsInner.java new file mode 100644 index 0000000..192ec9a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PublicKeyCredentialCreationOptionsPubKeyCredParamsInner.java @@ -0,0 +1,375 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * PublicKeyCredentialCreationOptionsPubKeyCredParamsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PublicKeyCredentialCreationOptionsPubKeyCredParamsInner { + /** + * The type of credential to be created. For WebAuthn this is always \"public-key\". + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + PUBLIC_KEY("public-key"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<TypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + public static final String SERIALIZED_NAME_ALG = "alg"; + @SerializedName(SERIALIZED_NAME_ALG) + @javax.annotation.Nonnull + private Integer alg; + + public PublicKeyCredentialCreationOptionsPubKeyCredParamsInner() { + } + + public PublicKeyCredentialCreationOptionsPubKeyCredParamsInner type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of credential to be created. For WebAuthn this is always \"public-key\". + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + public PublicKeyCredentialCreationOptionsPubKeyCredParamsInner alg(@javax.annotation.Nonnull Integer alg) { + this.alg = alg; + return this; + } + + /** + * The COSE identifier for the cryptographic algorithm to be used. Common values are -7 (ES256), -257 (RS256), -8 (EdDSA). + * @return alg + */ + @javax.annotation.Nonnull + public Integer getAlg() { + return alg; + } + + public void setAlg(@javax.annotation.Nonnull Integer alg) { + this.alg = alg; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PublicKeyCredentialCreationOptionsPubKeyCredParamsInner instance itself + */ + public PublicKeyCredentialCreationOptionsPubKeyCredParamsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PublicKeyCredentialCreationOptionsPubKeyCredParamsInner publicKeyCredentialCreationOptionsPubKeyCredParamsInner = (PublicKeyCredentialCreationOptionsPubKeyCredParamsInner) o; + return Objects.equals(this.type, publicKeyCredentialCreationOptionsPubKeyCredParamsInner.type) && + Objects.equals(this.alg, publicKeyCredentialCreationOptionsPubKeyCredParamsInner.alg)&& + Objects.equals(this.additionalProperties, publicKeyCredentialCreationOptionsPubKeyCredParamsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, alg, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PublicKeyCredentialCreationOptionsPubKeyCredParamsInner {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" alg: ").append(toIndentedString(alg)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("type"); + openapiFields.add("alg"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("alg"); + } + + /** + * 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 PublicKeyCredentialCreationOptionsPubKeyCredParamsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PublicKeyCredentialCreationOptionsPubKeyCredParamsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PublicKeyCredentialCreationOptionsPubKeyCredParamsInner is not found in the empty JSON string", PublicKeyCredentialCreationOptionsPubKeyCredParamsInner.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PublicKeyCredentialCreationOptionsPubKeyCredParamsInner.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("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // validate the required field `type` + TypeEnum.validateJsonElement(jsonObj.get("type")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PublicKeyCredentialCreationOptionsPubKeyCredParamsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PublicKeyCredentialCreationOptionsPubKeyCredParamsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PublicKeyCredentialCreationOptionsPubKeyCredParamsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PublicKeyCredentialCreationOptionsPubKeyCredParamsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<PublicKeyCredentialCreationOptionsPubKeyCredParamsInner>() { + @Override + public void write(JsonWriter out, PublicKeyCredentialCreationOptionsPubKeyCredParamsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PublicKeyCredentialCreationOptionsPubKeyCredParamsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PublicKeyCredentialCreationOptionsPubKeyCredParamsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PublicKeyCredentialCreationOptionsPubKeyCredParamsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of PublicKeyCredentialCreationOptionsPubKeyCredParamsInner + * @throws IOException if the JSON string is invalid with respect to PublicKeyCredentialCreationOptionsPubKeyCredParamsInner + */ + public static PublicKeyCredentialCreationOptionsPubKeyCredParamsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PublicKeyCredentialCreationOptionsPubKeyCredParamsInner.class); + } + + /** + * Convert an instance of PublicKeyCredentialCreationOptionsPubKeyCredParamsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PublicKeyCredentialCreationOptionsRp.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PublicKeyCredentialCreationOptionsRp.java new file mode 100644 index 0000000..cb43f2c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PublicKeyCredentialCreationOptionsRp.java @@ -0,0 +1,356 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * Information about the Relying Party (the website or service) requesting the credential creation. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PublicKeyCredentialCreationOptionsRp { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private String id; + + 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 = "icon"; + @SerializedName(SERIALIZED_NAME_ICON) + @javax.annotation.Nullable + private String icon; + + public PublicKeyCredentialCreationOptionsRp() { + } + + public PublicKeyCredentialCreationOptionsRp id(@javax.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * The domain name of the Relying Party. This is used by the authenticator to ensure credentials are created for the correct domain. + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + + public PublicKeyCredentialCreationOptionsRp name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The human-readable name of the Relying Party, which may be displayed to the User by the authenticator. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public PublicKeyCredentialCreationOptionsRp icon(@javax.annotation.Nullable String icon) { + this.icon = icon; + return this; + } + + /** + * Optional. A URL pointing to an image resource for the Relying Party, which may be displayed to the User by the authenticator. + * @return icon + */ + @javax.annotation.Nullable + public String getIcon() { + return icon; + } + + public void setIcon(@javax.annotation.Nullable String icon) { + this.icon = icon; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PublicKeyCredentialCreationOptionsRp instance itself + */ + public PublicKeyCredentialCreationOptionsRp putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PublicKeyCredentialCreationOptionsRp publicKeyCredentialCreationOptionsRp = (PublicKeyCredentialCreationOptionsRp) o; + return Objects.equals(this.id, publicKeyCredentialCreationOptionsRp.id) && + Objects.equals(this.name, publicKeyCredentialCreationOptionsRp.name) && + Objects.equals(this.icon, publicKeyCredentialCreationOptionsRp.icon)&& + Objects.equals(this.additionalProperties, publicKeyCredentialCreationOptionsRp.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, icon, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PublicKeyCredentialCreationOptionsRp {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" icon: ").append(toIndentedString(icon)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("icon"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("name"); + } + + /** + * 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 PublicKeyCredentialCreationOptionsRp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PublicKeyCredentialCreationOptionsRp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PublicKeyCredentialCreationOptionsRp is not found in the empty JSON string", PublicKeyCredentialCreationOptionsRp.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PublicKeyCredentialCreationOptionsRp.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("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("icon") != null && !jsonObj.get("icon").isJsonNull()) && !jsonObj.get("icon").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `icon` to be a primitive type in the JSON string but got `%s`", jsonObj.get("icon").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PublicKeyCredentialCreationOptionsRp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PublicKeyCredentialCreationOptionsRp' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PublicKeyCredentialCreationOptionsRp> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PublicKeyCredentialCreationOptionsRp.class)); + + return (TypeAdapter<T>) new TypeAdapter<PublicKeyCredentialCreationOptionsRp>() { + @Override + public void write(JsonWriter out, PublicKeyCredentialCreationOptionsRp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PublicKeyCredentialCreationOptionsRp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PublicKeyCredentialCreationOptionsRp instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PublicKeyCredentialCreationOptionsRp given an JSON string + * + * @param jsonString JSON string + * @return An instance of PublicKeyCredentialCreationOptionsRp + * @throws IOException if the JSON string is invalid with respect to PublicKeyCredentialCreationOptionsRp + */ + public static PublicKeyCredentialCreationOptionsRp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PublicKeyCredentialCreationOptionsRp.class); + } + + /** + * Convert an instance of PublicKeyCredentialCreationOptionsRp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PublicKeyCredentialCreationOptionsUser.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PublicKeyCredentialCreationOptionsUser.java new file mode 100644 index 0000000..9d3ef01 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PublicKeyCredentialCreationOptionsUser.java @@ -0,0 +1,387 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * Information about the User for whom the credential is being created. This information will be stored in the authenticator. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PublicKeyCredentialCreationOptionsUser { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private String id; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + 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_ICON = "icon"; + @SerializedName(SERIALIZED_NAME_ICON) + @javax.annotation.Nullable + private String icon; + + public PublicKeyCredentialCreationOptionsUser() { + } + + public PublicKeyCredentialCreationOptionsUser id(@javax.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * A unique identifier for the User. This should be opaque but stable across different sessions for the same User. + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + + public PublicKeyCredentialCreationOptionsUser name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The User's Username or Email address, which may be displayed to the User by the authenticator. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public PublicKeyCredentialCreationOptionsUser displayName(@javax.annotation.Nonnull String displayName) { + this.displayName = displayName; + return this; + } + + /** + * The User's display name, which may be shown to the User by the authenticator during credential creation. + * @return displayName + */ + @javax.annotation.Nonnull + public String getDisplayName() { + return displayName; + } + + public void setDisplayName(@javax.annotation.Nonnull String displayName) { + this.displayName = displayName; + } + + + public PublicKeyCredentialCreationOptionsUser icon(@javax.annotation.Nullable String icon) { + this.icon = icon; + return this; + } + + /** + * Optional. A URL pointing to an image resource for the User, which may be displayed to the User by the authenticator. + * @return icon + */ + @javax.annotation.Nullable + public String getIcon() { + return icon; + } + + public void setIcon(@javax.annotation.Nullable String icon) { + this.icon = icon; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PublicKeyCredentialCreationOptionsUser instance itself + */ + public PublicKeyCredentialCreationOptionsUser putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PublicKeyCredentialCreationOptionsUser publicKeyCredentialCreationOptionsUser = (PublicKeyCredentialCreationOptionsUser) o; + return Objects.equals(this.id, publicKeyCredentialCreationOptionsUser.id) && + Objects.equals(this.name, publicKeyCredentialCreationOptionsUser.name) && + Objects.equals(this.displayName, publicKeyCredentialCreationOptionsUser.displayName) && + Objects.equals(this.icon, publicKeyCredentialCreationOptionsUser.icon)&& + Objects.equals(this.additionalProperties, publicKeyCredentialCreationOptionsUser.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, displayName, icon, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PublicKeyCredentialCreationOptionsUser {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" displayName: ").append(toIndentedString(displayName)).append("\n"); + sb.append(" icon: ").append(toIndentedString(icon)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("id"); + openapiFields.add("name"); + openapiFields.add("displayName"); + openapiFields.add("icon"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("id"); + openapiRequiredFields.add("name"); + openapiRequiredFields.add("displayName"); + } + + /** + * 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 PublicKeyCredentialCreationOptionsUser + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PublicKeyCredentialCreationOptionsUser.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PublicKeyCredentialCreationOptionsUser is not found in the empty JSON string", PublicKeyCredentialCreationOptionsUser.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PublicKeyCredentialCreationOptionsUser.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("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("displayName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `displayName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("displayName").toString())); + } + if ((jsonObj.get("icon") != null && !jsonObj.get("icon").isJsonNull()) && !jsonObj.get("icon").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `icon` to be a primitive type in the JSON string but got `%s`", jsonObj.get("icon").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PublicKeyCredentialCreationOptionsUser.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PublicKeyCredentialCreationOptionsUser' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PublicKeyCredentialCreationOptionsUser> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PublicKeyCredentialCreationOptionsUser.class)); + + return (TypeAdapter<T>) new TypeAdapter<PublicKeyCredentialCreationOptionsUser>() { + @Override + public void write(JsonWriter out, PublicKeyCredentialCreationOptionsUser value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PublicKeyCredentialCreationOptionsUser read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PublicKeyCredentialCreationOptionsUser instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PublicKeyCredentialCreationOptionsUser given an JSON string + * + * @param jsonString JSON string + * @return An instance of PublicKeyCredentialCreationOptionsUser + * @throws IOException if the JSON string is invalid with respect to PublicKeyCredentialCreationOptionsUser + */ + public static PublicKeyCredentialCreationOptionsUser fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PublicKeyCredentialCreationOptionsUser.class); + } + + /** + * Convert an instance of PublicKeyCredentialCreationOptionsUser to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PublicKeyCredentialRequestOptions.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PublicKeyCredentialRequestOptions.java new file mode 100644 index 0000000..502deeb --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PublicKeyCredentialRequestOptions.java @@ -0,0 +1,523 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.PublicKeyCredentialRequestOptionsAllowCredentialsInner; +import com.loginradius.sdk.internal.openapi.model.PublicKeyCredentialRequestOptionsExtensions; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Represents the options for a WebAuthn credential assertion (authentication). This object is typically generated by the server and sent to the client to initiate the authentication ceremony using `navigator.credentials.get()`. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PublicKeyCredentialRequestOptions { + public static final String SERIALIZED_NAME_CHALLENGE = "challenge"; + @SerializedName(SERIALIZED_NAME_CHALLENGE) + @javax.annotation.Nonnull + private String challenge; + + public static final String SERIALIZED_NAME_RP_ID = "rpId"; + @SerializedName(SERIALIZED_NAME_RP_ID) + @javax.annotation.Nonnull + private String rpId; + + public static final String SERIALIZED_NAME_ALLOW_CREDENTIALS = "allowCredentials"; + @SerializedName(SERIALIZED_NAME_ALLOW_CREDENTIALS) + @javax.annotation.Nonnull + private List<PublicKeyCredentialRequestOptionsAllowCredentialsInner> allowCredentials = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TIMEOUT = "timeout"; + @SerializedName(SERIALIZED_NAME_TIMEOUT) + @javax.annotation.Nonnull + private Integer timeout; + + /** + * Specifies the preferred level of User verification for the authentication. Options are \"required\", \"preferred\", or \"discouraged\". + */ + @JsonAdapter(UserVerificationEnum.Adapter.class) + public enum UserVerificationEnum { + REQUIRED("required"), + + PREFERRED("preferred"), + + DISCOURAGED("discouraged"); + + private String value; + + UserVerificationEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static UserVerificationEnum fromValue(String value) { + for (UserVerificationEnum b : UserVerificationEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<UserVerificationEnum> { + @Override + public void write(final JsonWriter jsonWriter, final UserVerificationEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public UserVerificationEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return UserVerificationEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + UserVerificationEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_USER_VERIFICATION = "userVerification"; + @SerializedName(SERIALIZED_NAME_USER_VERIFICATION) + @javax.annotation.Nullable + private UserVerificationEnum userVerification; + + public static final String SERIALIZED_NAME_EXTENSIONS = "extensions"; + @SerializedName(SERIALIZED_NAME_EXTENSIONS) + @javax.annotation.Nullable + private PublicKeyCredentialRequestOptionsExtensions extensions; + + public PublicKeyCredentialRequestOptions() { + } + + public PublicKeyCredentialRequestOptions challenge(@javax.annotation.Nonnull String challenge) { + this.challenge = challenge; + return this; + } + + /** + * A cryptographic challenge that the authenticator signs over. This is a base64url-encoded string generated by the server to prevent replay attacks. + * @return challenge + */ + @javax.annotation.Nonnull + public String getChallenge() { + return challenge; + } + + public void setChallenge(@javax.annotation.Nonnull String challenge) { + this.challenge = challenge; + } + + + public PublicKeyCredentialRequestOptions rpId(@javax.annotation.Nonnull String rpId) { + this.rpId = rpId; + return this; + } + + /** + * The relying party identifier (usually the domain of the website) that the credential should be scoped to. + * @return rpId + */ + @javax.annotation.Nonnull + public String getRpId() { + return rpId; + } + + public void setRpId(@javax.annotation.Nonnull String rpId) { + this.rpId = rpId; + } + + + public PublicKeyCredentialRequestOptions allowCredentials(@javax.annotation.Nonnull List<PublicKeyCredentialRequestOptionsAllowCredentialsInner> allowCredentials) { + this.allowCredentials = allowCredentials; + return this; + } + + public PublicKeyCredentialRequestOptions addAllowCredentialsItem(PublicKeyCredentialRequestOptionsAllowCredentialsInner allowCredentialsItem) { + if (this.allowCredentials == null) { + this.allowCredentials = new ArrayList<>(); + } + this.allowCredentials.add(allowCredentialsItem); + return this; + } + + /** + * A list of descriptors for credentials acceptable to the server. This allows the server to guide the client to use a particular credential. + * @return allowCredentials + */ + @javax.annotation.Nonnull + public List<PublicKeyCredentialRequestOptionsAllowCredentialsInner> getAllowCredentials() { + return allowCredentials; + } + + public void setAllowCredentials(@javax.annotation.Nonnull List<PublicKeyCredentialRequestOptionsAllowCredentialsInner> allowCredentials) { + this.allowCredentials = allowCredentials; + } + + + public PublicKeyCredentialRequestOptions timeout(@javax.annotation.Nonnull Integer timeout) { + this.timeout = timeout; + return this; + } + + /** + * Time, in milliseconds, that the caller is willing to wait for the authentication operation to complete. + * @return timeout + */ + @javax.annotation.Nonnull + public Integer getTimeout() { + return timeout; + } + + public void setTimeout(@javax.annotation.Nonnull Integer timeout) { + this.timeout = timeout; + } + + + public PublicKeyCredentialRequestOptions userVerification(@javax.annotation.Nullable UserVerificationEnum userVerification) { + this.userVerification = userVerification; + return this; + } + + /** + * Specifies the preferred level of User verification for the authentication. Options are \"required\", \"preferred\", or \"discouraged\". + * @return userVerification + */ + @javax.annotation.Nullable + public UserVerificationEnum getUserVerification() { + return userVerification; + } + + public void setUserVerification(@javax.annotation.Nullable UserVerificationEnum userVerification) { + this.userVerification = userVerification; + } + + + public PublicKeyCredentialRequestOptions extensions(@javax.annotation.Nullable PublicKeyCredentialRequestOptionsExtensions extensions) { + this.extensions = extensions; + return this; + } + + /** + * Get extensions + * @return extensions + */ + @javax.annotation.Nullable + public PublicKeyCredentialRequestOptionsExtensions getExtensions() { + return extensions; + } + + public void setExtensions(@javax.annotation.Nullable PublicKeyCredentialRequestOptionsExtensions extensions) { + this.extensions = extensions; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PublicKeyCredentialRequestOptions instance itself + */ + public PublicKeyCredentialRequestOptions putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PublicKeyCredentialRequestOptions publicKeyCredentialRequestOptions = (PublicKeyCredentialRequestOptions) o; + return Objects.equals(this.challenge, publicKeyCredentialRequestOptions.challenge) && + Objects.equals(this.rpId, publicKeyCredentialRequestOptions.rpId) && + Objects.equals(this.allowCredentials, publicKeyCredentialRequestOptions.allowCredentials) && + Objects.equals(this.timeout, publicKeyCredentialRequestOptions.timeout) && + Objects.equals(this.userVerification, publicKeyCredentialRequestOptions.userVerification) && + Objects.equals(this.extensions, publicKeyCredentialRequestOptions.extensions)&& + Objects.equals(this.additionalProperties, publicKeyCredentialRequestOptions.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(challenge, rpId, allowCredentials, timeout, userVerification, extensions, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PublicKeyCredentialRequestOptions {\n"); + sb.append(" challenge: ").append(toIndentedString(challenge)).append("\n"); + sb.append(" rpId: ").append(toIndentedString(rpId)).append("\n"); + sb.append(" allowCredentials: ").append(toIndentedString(allowCredentials)).append("\n"); + sb.append(" timeout: ").append(toIndentedString(timeout)).append("\n"); + sb.append(" userVerification: ").append(toIndentedString(userVerification)).append("\n"); + sb.append(" extensions: ").append(toIndentedString(extensions)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("challenge"); + openapiFields.add("rpId"); + openapiFields.add("allowCredentials"); + openapiFields.add("timeout"); + openapiFields.add("userVerification"); + openapiFields.add("extensions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("challenge"); + openapiRequiredFields.add("rpId"); + openapiRequiredFields.add("allowCredentials"); + openapiRequiredFields.add("timeout"); + } + + /** + * 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 PublicKeyCredentialRequestOptions + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PublicKeyCredentialRequestOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PublicKeyCredentialRequestOptions is not found in the empty JSON string", PublicKeyCredentialRequestOptions.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PublicKeyCredentialRequestOptions.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("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())); + } + if (!jsonObj.get("rpId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `rpId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("rpId").toString())); + } + // ensure the json data is an array + if (!jsonObj.get("allowCredentials").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `allowCredentials` to be an array in the JSON string but got `%s`", jsonObj.get("allowCredentials").toString())); + } + + JsonArray jsonArrayallowCredentials = jsonObj.getAsJsonArray("allowCredentials"); + // validate the required field `allowCredentials` (array) + for (int i = 0; i < jsonArrayallowCredentials.size(); i++) { + PublicKeyCredentialRequestOptionsAllowCredentialsInner.validateJsonElement(jsonArrayallowCredentials.get(i)); + }; + if ((jsonObj.get("userVerification") != null && !jsonObj.get("userVerification").isJsonNull()) && !jsonObj.get("userVerification").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `userVerification` to be a primitive type in the JSON string but got `%s`", jsonObj.get("userVerification").toString())); + } + // validate the optional field `userVerification` + if (jsonObj.get("userVerification") != null && !jsonObj.get("userVerification").isJsonNull()) { + UserVerificationEnum.validateJsonElement(jsonObj.get("userVerification")); + } + // validate the optional field `extensions` + if (jsonObj.get("extensions") != null && !jsonObj.get("extensions").isJsonNull()) { + PublicKeyCredentialRequestOptionsExtensions.validateJsonElement(jsonObj.get("extensions")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PublicKeyCredentialRequestOptions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PublicKeyCredentialRequestOptions' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PublicKeyCredentialRequestOptions> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PublicKeyCredentialRequestOptions.class)); + + return (TypeAdapter<T>) new TypeAdapter<PublicKeyCredentialRequestOptions>() { + @Override + public void write(JsonWriter out, PublicKeyCredentialRequestOptions value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PublicKeyCredentialRequestOptions read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PublicKeyCredentialRequestOptions instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PublicKeyCredentialRequestOptions given an JSON string + * + * @param jsonString JSON string + * @return An instance of PublicKeyCredentialRequestOptions + * @throws IOException if the JSON string is invalid with respect to PublicKeyCredentialRequestOptions + */ + public static PublicKeyCredentialRequestOptions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PublicKeyCredentialRequestOptions.class); + } + + /** + * Convert an instance of PublicKeyCredentialRequestOptions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PublicKeyCredentialRequestOptionsAllowCredentialsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PublicKeyCredentialRequestOptionsAllowCredentialsInner.java new file mode 100644 index 0000000..04e6576 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PublicKeyCredentialRequestOptionsAllowCredentialsInner.java @@ -0,0 +1,367 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.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.loginradius.sdk.internal.openapi.JSON; + +/** + * PublicKeyCredentialRequestOptionsAllowCredentialsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PublicKeyCredentialRequestOptionsAllowCredentialsInner { + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private String type; + + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nonnull + private String id; + + public static final String SERIALIZED_NAME_TRANSPORTS = "transports"; + @SerializedName(SERIALIZED_NAME_TRANSPORTS) + @javax.annotation.Nullable + private List<String> transports = new ArrayList<>(); + + public PublicKeyCredentialRequestOptionsAllowCredentialsInner() { + } + + public PublicKeyCredentialRequestOptionsAllowCredentialsInner type(@javax.annotation.Nonnull String type) { + this.type = type; + return this; + } + + /** + * The type of public key credential. + * @return type + */ + @javax.annotation.Nonnull + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull String type) { + this.type = type; + } + + + public PublicKeyCredentialRequestOptionsAllowCredentialsInner id(@javax.annotation.Nonnull String id) { + this.id = id; + return this; + } + + /** + * The base64url-encoded identifier of the credential. This corresponds to the ID of a previously registered credential. + * @return id + */ + @javax.annotation.Nonnull + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nonnull String id) { + this.id = id; + } + + + public PublicKeyCredentialRequestOptionsAllowCredentialsInner transports(@javax.annotation.Nullable List<String> transports) { + this.transports = transports; + return this; + } + + public PublicKeyCredentialRequestOptionsAllowCredentialsInner addTransportsItem(String transportsItem) { + if (this.transports == null) { + this.transports = new ArrayList<>(); + } + this.transports.add(transportsItem); + return this; + } + + /** + * An array of transport methods supported by the authenticator for this credential. Values can include \"usb\", \"nfc\", \"ble\", or \"internal\". + * @return transports + */ + @javax.annotation.Nullable + public List<String> getTransports() { + return transports; + } + + public void setTransports(@javax.annotation.Nullable List<String> transports) { + this.transports = transports; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PublicKeyCredentialRequestOptionsAllowCredentialsInner instance itself + */ + public PublicKeyCredentialRequestOptionsAllowCredentialsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PublicKeyCredentialRequestOptionsAllowCredentialsInner publicKeyCredentialRequestOptionsAllowCredentialsInner = (PublicKeyCredentialRequestOptionsAllowCredentialsInner) o; + return Objects.equals(this.type, publicKeyCredentialRequestOptionsAllowCredentialsInner.type) && + Objects.equals(this.id, publicKeyCredentialRequestOptionsAllowCredentialsInner.id) && + Objects.equals(this.transports, publicKeyCredentialRequestOptionsAllowCredentialsInner.transports)&& + Objects.equals(this.additionalProperties, publicKeyCredentialRequestOptionsAllowCredentialsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, id, transports, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PublicKeyCredentialRequestOptionsAllowCredentialsInner {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" transports: ").append(toIndentedString(transports)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("type"); + openapiFields.add("id"); + openapiFields.add("transports"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("type"); + openapiRequiredFields.add("id"); + } + + /** + * 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 PublicKeyCredentialRequestOptionsAllowCredentialsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PublicKeyCredentialRequestOptionsAllowCredentialsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PublicKeyCredentialRequestOptionsAllowCredentialsInner is not found in the empty JSON string", PublicKeyCredentialRequestOptionsAllowCredentialsInner.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : PublicKeyCredentialRequestOptionsAllowCredentialsInner.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("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + 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())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("transports") != null && !jsonObj.get("transports").isJsonNull() && !jsonObj.get("transports").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `transports` to be an array in the JSON string but got `%s`", jsonObj.get("transports").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PublicKeyCredentialRequestOptionsAllowCredentialsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PublicKeyCredentialRequestOptionsAllowCredentialsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PublicKeyCredentialRequestOptionsAllowCredentialsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PublicKeyCredentialRequestOptionsAllowCredentialsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<PublicKeyCredentialRequestOptionsAllowCredentialsInner>() { + @Override + public void write(JsonWriter out, PublicKeyCredentialRequestOptionsAllowCredentialsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PublicKeyCredentialRequestOptionsAllowCredentialsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PublicKeyCredentialRequestOptionsAllowCredentialsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PublicKeyCredentialRequestOptionsAllowCredentialsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of PublicKeyCredentialRequestOptionsAllowCredentialsInner + * @throws IOException if the JSON string is invalid with respect to PublicKeyCredentialRequestOptionsAllowCredentialsInner + */ + public static PublicKeyCredentialRequestOptionsAllowCredentialsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PublicKeyCredentialRequestOptionsAllowCredentialsInner.class); + } + + /** + * Convert an instance of PublicKeyCredentialRequestOptionsAllowCredentialsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PublicKeyCredentialRequestOptionsExtensions.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PublicKeyCredentialRequestOptionsExtensions.java new file mode 100644 index 0000000..2502cb0 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PublicKeyCredentialRequestOptionsExtensions.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * Additional parameters requesting specific processing by the client or authenticator. These are optional and can be used to enable advanced features. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PublicKeyCredentialRequestOptionsExtensions { + public static final String SERIALIZED_NAME_APPID = "appid"; + @SerializedName(SERIALIZED_NAME_APPID) + @javax.annotation.Nullable + private String appid; + + public static final String SERIALIZED_NAME_EXAMPLE_EXTENSION = "exampleExtension"; + @SerializedName(SERIALIZED_NAME_EXAMPLE_EXTENSION) + @javax.annotation.Nullable + private String exampleExtension; + + public PublicKeyCredentialRequestOptionsExtensions() { + } + + public PublicKeyCredentialRequestOptionsExtensions appid(@javax.annotation.Nullable String appid) { + this.appid = appid; + return this; + } + + /** + * Used for backwards compatibility with FIDO U2F authenticators. Indicates the AppID for which the credential should be scoped. + * @return appid + */ + @javax.annotation.Nullable + public String getAppid() { + return appid; + } + + public void setAppid(@javax.annotation.Nullable String appid) { + this.appid = appid; + } + + + public PublicKeyCredentialRequestOptionsExtensions exampleExtension(@javax.annotation.Nullable String exampleExtension) { + this.exampleExtension = exampleExtension; + return this; + } + + /** + * Placeholder for other extension values (can be vendor-specific). + * @return exampleExtension + */ + @javax.annotation.Nullable + public String getExampleExtension() { + return exampleExtension; + } + + public void setExampleExtension(@javax.annotation.Nullable String exampleExtension) { + this.exampleExtension = exampleExtension; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PublicKeyCredentialRequestOptionsExtensions instance itself + */ + public PublicKeyCredentialRequestOptionsExtensions putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PublicKeyCredentialRequestOptionsExtensions publicKeyCredentialRequestOptionsExtensions = (PublicKeyCredentialRequestOptionsExtensions) o; + return Objects.equals(this.appid, publicKeyCredentialRequestOptionsExtensions.appid) && + Objects.equals(this.exampleExtension, publicKeyCredentialRequestOptionsExtensions.exampleExtension)&& + Objects.equals(this.additionalProperties, publicKeyCredentialRequestOptionsExtensions.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(appid, exampleExtension, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PublicKeyCredentialRequestOptionsExtensions {\n"); + sb.append(" appid: ").append(toIndentedString(appid)).append("\n"); + sb.append(" exampleExtension: ").append(toIndentedString(exampleExtension)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("appid"); + openapiFields.add("exampleExtension"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 PublicKeyCredentialRequestOptionsExtensions + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PublicKeyCredentialRequestOptionsExtensions.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PublicKeyCredentialRequestOptionsExtensions is not found in the empty JSON string", PublicKeyCredentialRequestOptionsExtensions.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("appid") != null && !jsonObj.get("appid").isJsonNull()) && !jsonObj.get("appid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `appid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("appid").toString())); + } + if ((jsonObj.get("exampleExtension") != null && !jsonObj.get("exampleExtension").isJsonNull()) && !jsonObj.get("exampleExtension").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `exampleExtension` to be a primitive type in the JSON string but got `%s`", jsonObj.get("exampleExtension").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PublicKeyCredentialRequestOptionsExtensions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PublicKeyCredentialRequestOptionsExtensions' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PublicKeyCredentialRequestOptionsExtensions> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PublicKeyCredentialRequestOptionsExtensions.class)); + + return (TypeAdapter<T>) new TypeAdapter<PublicKeyCredentialRequestOptionsExtensions>() { + @Override + public void write(JsonWriter out, PublicKeyCredentialRequestOptionsExtensions value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PublicKeyCredentialRequestOptionsExtensions read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PublicKeyCredentialRequestOptionsExtensions instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PublicKeyCredentialRequestOptionsExtensions given an JSON string + * + * @param jsonString JSON string + * @return An instance of PublicKeyCredentialRequestOptionsExtensions + * @throws IOException if the JSON string is invalid with respect to PublicKeyCredentialRequestOptionsExtensions + */ + public static PublicKeyCredentialRequestOptionsExtensions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PublicKeyCredentialRequestOptionsExtensions.class); + } + + /** + * Convert an instance of PublicKeyCredentialRequestOptionsExtensions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PushAuthenticator.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PushAuthenticator.java new file mode 100644 index 0000000..48eb5e2 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PushAuthenticator.java @@ -0,0 +1,553 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.AWSPushConfig; +import com.loginradius.sdk.internal.openapi.model.AndroidPushConfig; +import com.loginradius.sdk.internal.openapi.model.IOSPushConfig; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * PushAuthenticator + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PushAuthenticator { + public static final String SERIALIZED_NAME_IS_ENABLED = "IsEnabled"; + @SerializedName(SERIALIZED_NAME_IS_ENABLED) + @javax.annotation.Nullable + private Boolean isEnabled; + + /** + * The type of notification service (e.g., AWS, Native). + */ + @JsonAdapter(NotificationServiceEnum.Adapter.class) + public enum NotificationServiceEnum { + AWS("AWS"), + + NATIVE("Native"); + + private String value; + + NotificationServiceEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static NotificationServiceEnum fromValue(String value) { + for (NotificationServiceEnum b : NotificationServiceEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<NotificationServiceEnum> { + @Override + public void write(final JsonWriter jsonWriter, final NotificationServiceEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public NotificationServiceEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return NotificationServiceEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + NotificationServiceEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_NOTIFICATION_SERVICE = "NotificationService"; + @SerializedName(SERIALIZED_NAME_NOTIFICATION_SERVICE) + @javax.annotation.Nullable + private NotificationServiceEnum notificationService; + + public static final String SERIALIZED_NAME_CUSTOM_APP_NAME = "CustomAppName"; + @SerializedName(SERIALIZED_NAME_CUSTOM_APP_NAME) + @javax.annotation.Nullable + private String customAppName; + + public static final String SERIALIZED_NAME_QR_CODE_WIDTH = "QRCodeWidth"; + @SerializedName(SERIALIZED_NAME_QR_CODE_WIDTH) + @javax.annotation.Nullable + private Integer qrCodeWidth; + + public static final String SERIALIZED_NAME_MESSAGE = "Message"; + @SerializedName(SERIALIZED_NAME_MESSAGE) + @javax.annotation.Nullable + private String message; + + public static final String SERIALIZED_NAME_AW_SSETTINGS = "AWSsettings"; + @SerializedName(SERIALIZED_NAME_AW_SSETTINGS) + @javax.annotation.Nullable + private AWSPushConfig awSsettings; + + public static final String SERIALIZED_NAME_ANDROID_SETTINGS = "AndroidSettings"; + @SerializedName(SERIALIZED_NAME_ANDROID_SETTINGS) + @javax.annotation.Nullable + private AndroidPushConfig androidSettings; + + public static final String SERIALIZED_NAME_IO_SSETTINGS = "IOSsettings"; + @SerializedName(SERIALIZED_NAME_IO_SSETTINGS) + @javax.annotation.Nullable + private IOSPushConfig ioSsettings; + + public PushAuthenticator() { + } + + public PushAuthenticator isEnabled(@javax.annotation.Nullable Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Indicates if push authentication is enabled. + * @return isEnabled + */ + @javax.annotation.Nullable + public Boolean getIsEnabled() { + return isEnabled; + } + + public void setIsEnabled(@javax.annotation.Nullable Boolean isEnabled) { + this.isEnabled = isEnabled; + } + + + public PushAuthenticator notificationService(@javax.annotation.Nullable NotificationServiceEnum notificationService) { + this.notificationService = notificationService; + return this; + } + + /** + * The type of notification service (e.g., AWS, Native). + * @return notificationService + */ + @javax.annotation.Nullable + public NotificationServiceEnum getNotificationService() { + return notificationService; + } + + public void setNotificationService(@javax.annotation.Nullable NotificationServiceEnum notificationService) { + this.notificationService = notificationService; + } + + + public PushAuthenticator customAppName(@javax.annotation.Nullable String customAppName) { + this.customAppName = customAppName; + return this; + } + + /** + * Custom application name if applicable. + * @return customAppName + */ + @javax.annotation.Nullable + public String getCustomAppName() { + return customAppName; + } + + public void setCustomAppName(@javax.annotation.Nullable String customAppName) { + this.customAppName = customAppName; + } + + + public PushAuthenticator qrCodeWidth(@javax.annotation.Nullable Integer qrCodeWidth) { + this.qrCodeWidth = qrCodeWidth; + return this; + } + + /** + * The width of the QR code for push authentication. + * @return qrCodeWidth + */ + @javax.annotation.Nullable + public Integer getQrCodeWidth() { + return qrCodeWidth; + } + + public void setQrCodeWidth(@javax.annotation.Nullable Integer qrCodeWidth) { + this.qrCodeWidth = qrCodeWidth; + } + + + public PushAuthenticator message(@javax.annotation.Nullable String message) { + this.message = message; + return this; + } + + /** + * Custom message for Push Notifications. + * @return message + */ + @javax.annotation.Nullable + public String getMessage() { + return message; + } + + public void setMessage(@javax.annotation.Nullable String message) { + this.message = message; + } + + + public PushAuthenticator awSsettings(@javax.annotation.Nullable AWSPushConfig awSsettings) { + this.awSsettings = awSsettings; + return this; + } + + /** + * Get awSsettings + * @return awSsettings + */ + @javax.annotation.Nullable + public AWSPushConfig getAwSsettings() { + return awSsettings; + } + + public void setAwSsettings(@javax.annotation.Nullable AWSPushConfig awSsettings) { + this.awSsettings = awSsettings; + } + + + public PushAuthenticator androidSettings(@javax.annotation.Nullable AndroidPushConfig androidSettings) { + this.androidSettings = androidSettings; + return this; + } + + /** + * Get androidSettings + * @return androidSettings + */ + @javax.annotation.Nullable + public AndroidPushConfig getAndroidSettings() { + return androidSettings; + } + + public void setAndroidSettings(@javax.annotation.Nullable AndroidPushConfig androidSettings) { + this.androidSettings = androidSettings; + } + + + public PushAuthenticator ioSsettings(@javax.annotation.Nullable IOSPushConfig ioSsettings) { + this.ioSsettings = ioSsettings; + return this; + } + + /** + * Get ioSsettings + * @return ioSsettings + */ + @javax.annotation.Nullable + public IOSPushConfig getIoSsettings() { + return ioSsettings; + } + + public void setIoSsettings(@javax.annotation.Nullable IOSPushConfig ioSsettings) { + this.ioSsettings = ioSsettings; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PushAuthenticator instance itself + */ + public PushAuthenticator putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PushAuthenticator pushAuthenticator = (PushAuthenticator) o; + return Objects.equals(this.isEnabled, pushAuthenticator.isEnabled) && + Objects.equals(this.notificationService, pushAuthenticator.notificationService) && + Objects.equals(this.customAppName, pushAuthenticator.customAppName) && + Objects.equals(this.qrCodeWidth, pushAuthenticator.qrCodeWidth) && + Objects.equals(this.message, pushAuthenticator.message) && + Objects.equals(this.awSsettings, pushAuthenticator.awSsettings) && + Objects.equals(this.androidSettings, pushAuthenticator.androidSettings) && + Objects.equals(this.ioSsettings, pushAuthenticator.ioSsettings)&& + Objects.equals(this.additionalProperties, pushAuthenticator.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isEnabled, notificationService, customAppName, qrCodeWidth, message, awSsettings, androidSettings, ioSsettings, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PushAuthenticator {\n"); + sb.append(" isEnabled: ").append(toIndentedString(isEnabled)).append("\n"); + sb.append(" notificationService: ").append(toIndentedString(notificationService)).append("\n"); + sb.append(" customAppName: ").append(toIndentedString(customAppName)).append("\n"); + sb.append(" qrCodeWidth: ").append(toIndentedString(qrCodeWidth)).append("\n"); + sb.append(" message: ").append(toIndentedString(message)).append("\n"); + sb.append(" awSsettings: ").append(toIndentedString(awSsettings)).append("\n"); + sb.append(" androidSettings: ").append(toIndentedString(androidSettings)).append("\n"); + sb.append(" ioSsettings: ").append(toIndentedString(ioSsettings)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsEnabled"); + openapiFields.add("NotificationService"); + openapiFields.add("CustomAppName"); + openapiFields.add("QRCodeWidth"); + openapiFields.add("Message"); + openapiFields.add("AWSsettings"); + openapiFields.add("AndroidSettings"); + openapiFields.add("IOSsettings"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 PushAuthenticator + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PushAuthenticator.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PushAuthenticator is not found in the empty JSON string", PushAuthenticator.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("NotificationService") != null && !jsonObj.get("NotificationService").isJsonNull()) && !jsonObj.get("NotificationService").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NotificationService` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NotificationService").toString())); + } + // validate the optional field `NotificationService` + if (jsonObj.get("NotificationService") != null && !jsonObj.get("NotificationService").isJsonNull()) { + NotificationServiceEnum.validateJsonElement(jsonObj.get("NotificationService")); + } + if ((jsonObj.get("CustomAppName") != null && !jsonObj.get("CustomAppName").isJsonNull()) && !jsonObj.get("CustomAppName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CustomAppName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CustomAppName").toString())); + } + if ((jsonObj.get("Message") != null && !jsonObj.get("Message").isJsonNull()) && !jsonObj.get("Message").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Message` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Message").toString())); + } + // validate the optional field `AWSsettings` + if (jsonObj.get("AWSsettings") != null && !jsonObj.get("AWSsettings").isJsonNull()) { + AWSPushConfig.validateJsonElement(jsonObj.get("AWSsettings")); + } + // validate the optional field `AndroidSettings` + if (jsonObj.get("AndroidSettings") != null && !jsonObj.get("AndroidSettings").isJsonNull()) { + AndroidPushConfig.validateJsonElement(jsonObj.get("AndroidSettings")); + } + // validate the optional field `IOSsettings` + if (jsonObj.get("IOSsettings") != null && !jsonObj.get("IOSsettings").isJsonNull()) { + IOSPushConfig.validateJsonElement(jsonObj.get("IOSsettings")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PushAuthenticator.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PushAuthenticator' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PushAuthenticator> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PushAuthenticator.class)); + + return (TypeAdapter<T>) new TypeAdapter<PushAuthenticator>() { + @Override + public void write(JsonWriter out, PushAuthenticator value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PushAuthenticator read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PushAuthenticator instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PushAuthenticator given an JSON string + * + * @param jsonString JSON string + * @return An instance of PushAuthenticator + * @throws IOException if the JSON string is invalid with respect to PushAuthenticator + */ + public static PushAuthenticator fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PushAuthenticator.class); + } + + /** + * Convert an instance of PushAuthenticator to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/PushDevice.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/PushDevice.java new file mode 100644 index 0000000..363fbe5 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/PushDevice.java @@ -0,0 +1,405 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * PushDevice + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class PushDevice { + public static final String SERIALIZED_NAME_DEVICE_NAME = "deviceName"; + @SerializedName(SERIALIZED_NAME_DEVICE_NAME) + @javax.annotation.Nullable + private String deviceName; + + public static final String SERIALIZED_NAME_DEVICE_TYPE = "deviceType"; + @SerializedName(SERIALIZED_NAME_DEVICE_TYPE) + @javax.annotation.Nullable + private String deviceType; + + public static final String SERIALIZED_NAME_DEVICE_TOKEN = "deviceToken"; + @SerializedName(SERIALIZED_NAME_DEVICE_TOKEN) + @javax.annotation.Nullable + private String deviceToken; + + public static final String SERIALIZED_NAME_PUBLIC_KEY = "publicKey"; + @SerializedName(SERIALIZED_NAME_PUBLIC_KEY) + @javax.annotation.Nullable + private String publicKey; + + public static final String SERIALIZED_NAME_CREATED_AT = "createdAt"; + @SerializedName(SERIALIZED_NAME_CREATED_AT) + @javax.annotation.Nullable + private OffsetDateTime createdAt; + + public PushDevice() { + } + + public PushDevice deviceName(@javax.annotation.Nullable String deviceName) { + this.deviceName = deviceName; + return this; + } + + /** + * Get deviceName + * @return deviceName + */ + @javax.annotation.Nullable + public String getDeviceName() { + return deviceName; + } + + public void setDeviceName(@javax.annotation.Nullable String deviceName) { + this.deviceName = deviceName; + } + + + public PushDevice deviceType(@javax.annotation.Nullable String deviceType) { + this.deviceType = deviceType; + return this; + } + + /** + * Get deviceType + * @return deviceType + */ + @javax.annotation.Nullable + public String getDeviceType() { + return deviceType; + } + + public void setDeviceType(@javax.annotation.Nullable String deviceType) { + this.deviceType = deviceType; + } + + + public PushDevice deviceToken(@javax.annotation.Nullable String deviceToken) { + this.deviceToken = deviceToken; + return this; + } + + /** + * Get deviceToken + * @return deviceToken + */ + @javax.annotation.Nullable + public String getDeviceToken() { + return deviceToken; + } + + public void setDeviceToken(@javax.annotation.Nullable String deviceToken) { + this.deviceToken = deviceToken; + } + + + public PushDevice publicKey(@javax.annotation.Nullable String publicKey) { + this.publicKey = publicKey; + return this; + } + + /** + * Get publicKey + * @return publicKey + */ + @javax.annotation.Nullable + public String getPublicKey() { + return publicKey; + } + + public void setPublicKey(@javax.annotation.Nullable String publicKey) { + this.publicKey = publicKey; + } + + + public PushDevice createdAt(@javax.annotation.Nullable OffsetDateTime createdAt) { + this.createdAt = createdAt; + return this; + } + + /** + * Get createdAt + * @return createdAt + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedAt() { + return createdAt; + } + + public void setCreatedAt(@javax.annotation.Nullable OffsetDateTime createdAt) { + this.createdAt = createdAt; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the PushDevice instance itself + */ + public PushDevice putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + PushDevice pushDevice = (PushDevice) o; + return Objects.equals(this.deviceName, pushDevice.deviceName) && + Objects.equals(this.deviceType, pushDevice.deviceType) && + Objects.equals(this.deviceToken, pushDevice.deviceToken) && + Objects.equals(this.publicKey, pushDevice.publicKey) && + Objects.equals(this.createdAt, pushDevice.createdAt)&& + Objects.equals(this.additionalProperties, pushDevice.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(deviceName, deviceType, deviceToken, publicKey, createdAt, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class PushDevice {\n"); + sb.append(" deviceName: ").append(toIndentedString(deviceName)).append("\n"); + sb.append(" deviceType: ").append(toIndentedString(deviceType)).append("\n"); + sb.append(" deviceToken: ").append(toIndentedString(deviceToken)).append("\n"); + sb.append(" publicKey: ").append(toIndentedString(publicKey)).append("\n"); + sb.append(" createdAt: ").append(toIndentedString(createdAt)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("deviceName"); + openapiFields.add("deviceType"); + openapiFields.add("deviceToken"); + openapiFields.add("publicKey"); + openapiFields.add("createdAt"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 PushDevice + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!PushDevice.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in PushDevice is not found in the empty JSON string", PushDevice.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("deviceName") != null && !jsonObj.get("deviceName").isJsonNull()) && !jsonObj.get("deviceName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deviceName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deviceName").toString())); + } + if ((jsonObj.get("deviceType") != null && !jsonObj.get("deviceType").isJsonNull()) && !jsonObj.get("deviceType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deviceType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deviceType").toString())); + } + if ((jsonObj.get("deviceToken") != null && !jsonObj.get("deviceToken").isJsonNull()) && !jsonObj.get("deviceToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `deviceToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("deviceToken").toString())); + } + if ((jsonObj.get("publicKey") != null && !jsonObj.get("publicKey").isJsonNull()) && !jsonObj.get("publicKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `publicKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("publicKey").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!PushDevice.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'PushDevice' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<PushDevice> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(PushDevice.class)); + + return (TypeAdapter<T>) new TypeAdapter<PushDevice>() { + @Override + public void write(JsonWriter out, PushDevice value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public PushDevice read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + PushDevice instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of PushDevice given an JSON string + * + * @param jsonString JSON string + * @return An instance of PushDevice + * @throws IOException if the JSON string is invalid with respect to PushDevice + */ + public static PushDevice fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, PushDevice.class); + } + + /** + * Convert an instance of PushDevice to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/QRCodeMapToToken.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/QRCodeMapToToken.java new file mode 100644 index 0000000..e9eaed8 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/QRCodeMapToToken.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * QR Code Map to Access Token Request + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class QRCodeMapToToken { + public static final String SERIALIZED_NAME_ACCESS_TOKEN = "access_token"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN) + @javax.annotation.Nullable + private String accessToken; + + public static final String SERIALIZED_NAME_CODE = "code"; + @SerializedName(SERIALIZED_NAME_CODE) + @javax.annotation.Nullable + private String code; + + public QRCodeMapToToken() { + } + + public QRCodeMapToToken accessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Get accessToken + * @return accessToken + */ + @javax.annotation.Nullable + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + } + + + public QRCodeMapToToken code(@javax.annotation.Nullable String code) { + this.code = code; + return this; + } + + /** + * Get code + * @return code + */ + @javax.annotation.Nullable + public String getCode() { + return code; + } + + public void setCode(@javax.annotation.Nullable String code) { + this.code = code; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the QRCodeMapToToken instance itself + */ + public QRCodeMapToToken putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QRCodeMapToToken qrCodeMapToToken = (QRCodeMapToToken) o; + return Objects.equals(this.accessToken, qrCodeMapToToken.accessToken) && + Objects.equals(this.code, qrCodeMapToToken.code)&& + Objects.equals(this.additionalProperties, qrCodeMapToToken.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accessToken, code, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QRCodeMapToToken {\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("access_token"); + openapiFields.add("code"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 QRCodeMapToToken + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!QRCodeMapToToken.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in QRCodeMapToToken is not found in the empty JSON string", QRCodeMapToToken.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("access_token") != null && !jsonObj.get("access_token").isJsonNull()) && !jsonObj.get("access_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `access_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("access_token").toString())); + } + if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) && !jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!QRCodeMapToToken.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QRCodeMapToToken' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<QRCodeMapToToken> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(QRCodeMapToToken.class)); + + return (TypeAdapter<T>) new TypeAdapter<QRCodeMapToToken>() { + @Override + public void write(JsonWriter out, QRCodeMapToToken value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public QRCodeMapToToken read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + QRCodeMapToToken instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of QRCodeMapToToken given an JSON string + * + * @param jsonString JSON string + * @return An instance of QRCodeMapToToken + * @throws IOException if the JSON string is invalid with respect to QRCodeMapToToken + */ + public static QRCodeMapToToken fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QRCodeMapToToken.class); + } + + /** + * Convert an instance of QRCodeMapToToken to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/QRCodeMapToTokenResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/QRCodeMapToTokenResponse.java new file mode 100644 index 0000000..4275b61 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/QRCodeMapToTokenResponse.java @@ -0,0 +1,284 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * QR Code Map to Access Token Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class QRCodeMapToTokenResponse { + public static final String SERIALIZED_NAME_IS_POSTED = "isPosted"; + @SerializedName(SERIALIZED_NAME_IS_POSTED) + @javax.annotation.Nullable + private Boolean isPosted; + + public QRCodeMapToTokenResponse() { + } + + public QRCodeMapToTokenResponse isPosted(@javax.annotation.Nullable Boolean isPosted) { + this.isPosted = isPosted; + return this; + } + + /** + * Get isPosted + * @return isPosted + */ + @javax.annotation.Nullable + public Boolean getIsPosted() { + return isPosted; + } + + public void setIsPosted(@javax.annotation.Nullable Boolean isPosted) { + this.isPosted = isPosted; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the QRCodeMapToTokenResponse instance itself + */ + public QRCodeMapToTokenResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QRCodeMapToTokenResponse qrCodeMapToTokenResponse = (QRCodeMapToTokenResponse) o; + return Objects.equals(this.isPosted, qrCodeMapToTokenResponse.isPosted)&& + Objects.equals(this.additionalProperties, qrCodeMapToTokenResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isPosted, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QRCodeMapToTokenResponse {\n"); + sb.append(" isPosted: ").append(toIndentedString(isPosted)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("isPosted"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 QRCodeMapToTokenResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!QRCodeMapToTokenResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in QRCodeMapToTokenResponse is not found in the empty JSON string", QRCodeMapToTokenResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!QRCodeMapToTokenResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QRCodeMapToTokenResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<QRCodeMapToTokenResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(QRCodeMapToTokenResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<QRCodeMapToTokenResponse>() { + @Override + public void write(JsonWriter out, QRCodeMapToTokenResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public QRCodeMapToTokenResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + QRCodeMapToTokenResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of QRCodeMapToTokenResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of QRCodeMapToTokenResponse + * @throws IOException if the JSON string is invalid with respect to QRCodeMapToTokenResponse + */ + public static QRCodeMapToTokenResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QRCodeMapToTokenResponse.class); + } + + /** + * Convert an instance of QRCodeMapToTokenResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/QRCodeResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/QRCodeResponse.java new file mode 100644 index 0000000..e2fe8c4 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/QRCodeResponse.java @@ -0,0 +1,287 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * QR Code Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class QRCodeResponse { + public static final String SERIALIZED_NAME_CODE = "code"; + @SerializedName(SERIALIZED_NAME_CODE) + @javax.annotation.Nullable + private String code; + + public QRCodeResponse() { + } + + public QRCodeResponse code(@javax.annotation.Nullable String code) { + this.code = code; + return this; + } + + /** + * Get code + * @return code + */ + @javax.annotation.Nullable + public String getCode() { + return code; + } + + public void setCode(@javax.annotation.Nullable String code) { + this.code = code; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the QRCodeResponse instance itself + */ + public QRCodeResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QRCodeResponse qrCodeResponse = (QRCodeResponse) o; + return Objects.equals(this.code, qrCodeResponse.code)&& + Objects.equals(this.additionalProperties, qrCodeResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(code, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QRCodeResponse {\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("code"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 QRCodeResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!QRCodeResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in QRCodeResponse is not found in the empty JSON string", QRCodeResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("code") != null && !jsonObj.get("code").isJsonNull()) && !jsonObj.get("code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("code").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!QRCodeResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QRCodeResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<QRCodeResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(QRCodeResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<QRCodeResponse>() { + @Override + public void write(JsonWriter out, QRCodeResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public QRCodeResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + QRCodeResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of QRCodeResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of QRCodeResponse + * @throws IOException if the JSON string is invalid with respect to QRCodeResponse + */ + public static QRCodeResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QRCodeResponse.class); + } + + /** + * Convert an instance of QRCodeResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/QueryGroup.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/QueryGroup.java new file mode 100644 index 0000000..463560c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/QueryGroup.java @@ -0,0 +1,398 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.QueryRule; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * QueryGroup + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class QueryGroup { + /** + * Logical operator to combine rules. + */ + @JsonAdapter(OperatorEnum.Adapter.class) + public enum OperatorEnum { + AND("AND"), + + OR("OR"); + + private String value; + + OperatorEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static OperatorEnum fromValue(String value) { + for (OperatorEnum b : OperatorEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<OperatorEnum> { + @Override + public void write(final JsonWriter jsonWriter, final OperatorEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public OperatorEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return OperatorEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + OperatorEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_OPERATOR = "operator"; + @SerializedName(SERIALIZED_NAME_OPERATOR) + @javax.annotation.Nonnull + private OperatorEnum operator; + + public static final String SERIALIZED_NAME_RULES = "rules"; + @SerializedName(SERIALIZED_NAME_RULES) + @javax.annotation.Nonnull + private List<QueryRule> rules = new ArrayList<>(); + + public QueryGroup() { + } + + public QueryGroup operator(@javax.annotation.Nonnull OperatorEnum operator) { + this.operator = operator; + return this; + } + + /** + * Logical operator to combine rules. + * @return operator + */ + @javax.annotation.Nonnull + public OperatorEnum getOperator() { + return operator; + } + + public void setOperator(@javax.annotation.Nonnull OperatorEnum operator) { + this.operator = operator; + } + + + public QueryGroup rules(@javax.annotation.Nonnull List<QueryRule> rules) { + this.rules = rules; + return this; + } + + public QueryGroup addRulesItem(QueryRule rulesItem) { + if (this.rules == null) { + this.rules = new ArrayList<>(); + } + this.rules.add(rulesItem); + return this; + } + + /** + * Get rules + * @return rules + */ + @javax.annotation.Nonnull + public List<QueryRule> getRules() { + return rules; + } + + public void setRules(@javax.annotation.Nonnull List<QueryRule> rules) { + this.rules = rules; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the QueryGroup instance itself + */ + public QueryGroup putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QueryGroup queryGroup = (QueryGroup) o; + return Objects.equals(this.operator, queryGroup.operator) && + Objects.equals(this.rules, queryGroup.rules)&& + Objects.equals(this.additionalProperties, queryGroup.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(operator, rules, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QueryGroup {\n"); + sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); + sb.append(" rules: ").append(toIndentedString(rules)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("operator"); + openapiFields.add("rules"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("operator"); + openapiRequiredFields.add("rules"); + } + + /** + * 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 QueryGroup + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!QueryGroup.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in QueryGroup is not found in the empty JSON string", QueryGroup.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : QueryGroup.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("operator").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `operator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operator").toString())); + } + // validate the required field `operator` + OperatorEnum.validateJsonElement(jsonObj.get("operator")); + // ensure the json data is an array + if (!jsonObj.get("rules").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `rules` to be an array in the JSON string but got `%s`", jsonObj.get("rules").toString())); + } + + JsonArray jsonArrayrules = jsonObj.getAsJsonArray("rules"); + // validate the required field `rules` (array) + for (int i = 0; i < jsonArrayrules.size(); i++) { + QueryRule.validateJsonElement(jsonArrayrules.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!QueryGroup.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QueryGroup' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<QueryGroup> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(QueryGroup.class)); + + return (TypeAdapter<T>) new TypeAdapter<QueryGroup>() { + @Override + public void write(JsonWriter out, QueryGroup value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public QueryGroup read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + QueryGroup instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of QueryGroup given an JSON string + * + * @param jsonString JSON string + * @return An instance of QueryGroup + * @throws IOException if the JSON string is invalid with respect to QueryGroup + */ + public static QueryGroup fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QueryGroup.class); + } + + /** + * Convert an instance of QueryGroup to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/QueryRule.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/QueryRule.java new file mode 100644 index 0000000..bc7ed8c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/QueryRule.java @@ -0,0 +1,388 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.QueryGroup; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * QueryRule + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class QueryRule { + public static final String SERIALIZED_NAME_GROUP = "group"; + @SerializedName(SERIALIZED_NAME_GROUP) + @javax.annotation.Nullable + private QueryGroup group; + + public static final String SERIALIZED_NAME_NAME = "name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_OPERATOR = "operator"; + @SerializedName(SERIALIZED_NAME_OPERATOR) + @javax.annotation.Nullable + private String operator; + + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nullable + private Object value = null; + + public QueryRule() { + } + + public QueryRule group(@javax.annotation.Nullable QueryGroup group) { + this.group = group; + return this; + } + + /** + * Get group + * @return group + */ + @javax.annotation.Nullable + public QueryGroup getGroup() { + return group; + } + + public void setGroup(@javax.annotation.Nullable QueryGroup group) { + this.group = group; + } + + + public QueryRule name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Name of the field to query. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public QueryRule operator(@javax.annotation.Nullable String operator) { + this.operator = operator; + return this; + } + + /** + * Operator for the query (e.g., =, !=, >, <). + * @return operator + */ + @javax.annotation.Nullable + public String getOperator() { + return operator; + } + + public void setOperator(@javax.annotation.Nullable String operator) { + this.operator = operator; + } + + + public QueryRule value(@javax.annotation.Nullable Object value) { + this.value = value; + return this; + } + + /** + * Value to compare against. Can be string, boolean, or number. + * @return value + */ + @javax.annotation.Nullable + public Object getValue() { + return value; + } + + public void setValue(@javax.annotation.Nullable Object value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the QueryRule instance itself + */ + public QueryRule putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + QueryRule queryRule = (QueryRule) o; + return Objects.equals(this.group, queryRule.group) && + Objects.equals(this.name, queryRule.name) && + Objects.equals(this.operator, queryRule.operator) && + Objects.equals(this.value, queryRule.value)&& + Objects.equals(this.additionalProperties, queryRule.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(group, name, operator, value, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class QueryRule {\n"); + sb.append(" group: ").append(toIndentedString(group)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" operator: ").append(toIndentedString(operator)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("group"); + openapiFields.add("name"); + openapiFields.add("operator"); + openapiFields.add("value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 QueryRule + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!QueryRule.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in QueryRule is not found in the empty JSON string", QueryRule.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `group` + if (jsonObj.get("group") != null && !jsonObj.get("group").isJsonNull()) { + QueryGroup.validateJsonElement(jsonObj.get("group")); + } + if ((jsonObj.get("name") != null && !jsonObj.get("name").isJsonNull()) && !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("operator") != null && !jsonObj.get("operator").isJsonNull()) && !jsonObj.get("operator").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `operator` to be a primitive type in the JSON string but got `%s`", jsonObj.get("operator").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!QueryRule.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'QueryRule' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<QueryRule> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(QueryRule.class)); + + return (TypeAdapter<T>) new TypeAdapter<QueryRule>() { + @Override + public void write(JsonWriter out, QueryRule value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public QueryRule read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + QueryRule instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of QueryRule given an JSON string + * + * @param jsonString JSON string + * @return An instance of QueryRule + * @throws IOException if the JSON string is invalid with respect to QueryRule + */ + public static QueryRule fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, QueryRule.class); + } + + /** + * Convert an instance of QueryRule to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/RaasConfig.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/RaasConfig.java new file mode 100644 index 0000000..e792f3d --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/RaasConfig.java @@ -0,0 +1,507 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.RaasOptions; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * RaasConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class RaasConfig { + public static final String SERIALIZED_NAME_TYPE = "Type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_DISPLAY = "Display"; + @SerializedName(SERIALIZED_NAME_DISPLAY) + @javax.annotation.Nullable + private String display; + + public static final String SERIALIZED_NAME_RULES = "Rules"; + @SerializedName(SERIALIZED_NAME_RULES) + @javax.annotation.Nullable + private String rules; + + public static final String SERIALIZED_NAME_PERMISSION = "Permission"; + @SerializedName(SERIALIZED_NAME_PERMISSION) + @javax.annotation.Nullable + private String permission; + + public static final String SERIALIZED_NAME_OPTIONS = "Options"; + @SerializedName(SERIALIZED_NAME_OPTIONS) + @javax.annotation.Nullable + private List<RaasOptions> options = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CHECKED = "Checked"; + @SerializedName(SERIALIZED_NAME_CHECKED) + @javax.annotation.Nullable + private Boolean checked; + + public RaasConfig() { + } + + public RaasConfig type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * The type of the configuration. + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public RaasConfig name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the configuration. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public RaasConfig display(@javax.annotation.Nullable String display) { + this.display = display; + return this; + } + + /** + * The display name of the configuration. + * @return display + */ + @javax.annotation.Nullable + public String getDisplay() { + return display; + } + + public void setDisplay(@javax.annotation.Nullable String display) { + this.display = display; + } + + + public RaasConfig rules(@javax.annotation.Nullable String rules) { + this.rules = rules; + return this; + } + + /** + * The rules associated with the configuration. + * @return rules + */ + @javax.annotation.Nullable + public String getRules() { + return rules; + } + + public void setRules(@javax.annotation.Nullable String rules) { + this.rules = rules; + } + + + public RaasConfig permission(@javax.annotation.Nullable String permission) { + this.permission = permission; + return this; + } + + /** + * The permission level required for the configuration. + * @return permission + */ + @javax.annotation.Nullable + public String getPermission() { + return permission; + } + + public void setPermission(@javax.annotation.Nullable String permission) { + this.permission = permission; + } + + + public RaasConfig options(@javax.annotation.Nullable List<RaasOptions> options) { + this.options = options; + return this; + } + + public RaasConfig addOptionsItem(RaasOptions optionsItem) { + if (this.options == null) { + this.options = new ArrayList<>(); + } + this.options.add(optionsItem); + return this; + } + + /** + * The options available for the configuration. + * @return options + */ + @javax.annotation.Nullable + public List<RaasOptions> getOptions() { + return options; + } + + public void setOptions(@javax.annotation.Nullable List<RaasOptions> options) { + this.options = options; + } + + + public RaasConfig checked(@javax.annotation.Nullable Boolean checked) { + this.checked = checked; + return this; + } + + /** + * Indicates if the configuration is checked. + * @return checked + */ + @javax.annotation.Nullable + public Boolean getChecked() { + return checked; + } + + public void setChecked(@javax.annotation.Nullable Boolean checked) { + this.checked = checked; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RaasConfig instance itself + */ + public RaasConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RaasConfig raasConfig = (RaasConfig) o; + return Objects.equals(this.type, raasConfig.type) && + Objects.equals(this.name, raasConfig.name) && + Objects.equals(this.display, raasConfig.display) && + Objects.equals(this.rules, raasConfig.rules) && + Objects.equals(this.permission, raasConfig.permission) && + Objects.equals(this.options, raasConfig.options) && + Objects.equals(this.checked, raasConfig.checked)&& + Objects.equals(this.additionalProperties, raasConfig.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(type, name, display, rules, permission, options, checked, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RaasConfig {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" display: ").append(toIndentedString(display)).append("\n"); + sb.append(" rules: ").append(toIndentedString(rules)).append("\n"); + sb.append(" permission: ").append(toIndentedString(permission)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" checked: ").append(toIndentedString(checked)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Type"); + openapiFields.add("Name"); + openapiFields.add("Display"); + openapiFields.add("Rules"); + openapiFields.add("Permission"); + openapiFields.add("Options"); + openapiFields.add("Checked"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Type"); + openapiRequiredFields.add("Name"); + } + + /** + * 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 RaasConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RaasConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RaasConfig is not found in the empty JSON string", RaasConfig.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RaasConfig.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("Type") != null && !jsonObj.get("Type").isJsonNull()) && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Display") != null && !jsonObj.get("Display").isJsonNull()) && !jsonObj.get("Display").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Display` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Display").toString())); + } + if ((jsonObj.get("Rules") != null && !jsonObj.get("Rules").isJsonNull()) && !jsonObj.get("Rules").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Rules` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Rules").toString())); + } + if ((jsonObj.get("Permission") != null && !jsonObj.get("Permission").isJsonNull()) && !jsonObj.get("Permission").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Permission` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Permission").toString())); + } + if (jsonObj.get("Options") != null && !jsonObj.get("Options").isJsonNull()) { + JsonArray jsonArrayoptions = jsonObj.getAsJsonArray("Options"); + if (jsonArrayoptions != null) { + // ensure the json data is an array + if (!jsonObj.get("Options").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Options` to be an array in the JSON string but got `%s`", jsonObj.get("Options").toString())); + } + + // validate the optional field `Options` (array) + for (int i = 0; i < jsonArrayoptions.size(); i++) { + RaasOptions.validateJsonElement(jsonArrayoptions.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!RaasConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RaasConfig' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<RaasConfig> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RaasConfig.class)); + + return (TypeAdapter<T>) new TypeAdapter<RaasConfig>() { + @Override + public void write(JsonWriter out, RaasConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RaasConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RaasConfig instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RaasConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of RaasConfig + * @throws IOException if the JSON string is invalid with respect to RaasConfig + */ + public static RaasConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RaasConfig.class); + } + + /** + * Convert an instance of RaasConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/RaasConfigData.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/RaasConfigData.java new file mode 100644 index 0000000..b4a594e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/RaasConfigData.java @@ -0,0 +1,592 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.RaasOptions; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * RaasConfigData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class RaasConfigData { + /** + * The type of the configuration. + */ + @JsonAdapter(TypeEnum.Adapter.class) + public enum TypeEnum { + TEXT("text"), + + HTML("html"), + + PASSWORD("password"), + + HIDDEN("hidden"), + + OPTION("option"), + + MULTI("multi"), + + EMAIL("email"), + + STRING("string"); + + private String value; + + TypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<TypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final TypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public TypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return TypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + TypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_TYPE = "Type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nonnull + private TypeEnum type; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_DISPLAY = "Display"; + @SerializedName(SERIALIZED_NAME_DISPLAY) + @javax.annotation.Nullable + private String display; + + public static final String SERIALIZED_NAME_RULES = "Rules"; + @SerializedName(SERIALIZED_NAME_RULES) + @javax.annotation.Nullable + private String rules; + + public static final String SERIALIZED_NAME_OPTIONS = "Options"; + @SerializedName(SERIALIZED_NAME_OPTIONS) + @javax.annotation.Nullable + private List<RaasOptions> options = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PERMISSION = "Permission"; + @SerializedName(SERIALIZED_NAME_PERMISSION) + @javax.annotation.Nonnull + private String permission; + + public static final String SERIALIZED_NAME_CHECKED = "Checked"; + @SerializedName(SERIALIZED_NAME_CHECKED) + @javax.annotation.Nullable + private Boolean checked; + + public static final String SERIALIZED_NAME_PARENT = "Parent"; + @SerializedName(SERIALIZED_NAME_PARENT) + @javax.annotation.Nullable + private String parent; + + public RaasConfigData() { + } + + public RaasConfigData type(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + return this; + } + + /** + * The type of the configuration. + * @return type + */ + @javax.annotation.Nonnull + public TypeEnum getType() { + return type; + } + + public void setType(@javax.annotation.Nonnull TypeEnum type) { + this.type = type; + } + + + public RaasConfigData name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The name of the configuration. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public RaasConfigData display(@javax.annotation.Nullable String display) { + this.display = display; + return this; + } + + /** + * The display name of the configuration. + * @return display + */ + @javax.annotation.Nullable + public String getDisplay() { + return display; + } + + public void setDisplay(@javax.annotation.Nullable String display) { + this.display = display; + } + + + public RaasConfigData rules(@javax.annotation.Nullable String rules) { + this.rules = rules; + return this; + } + + /** + * The rules associated with the configuration. + * @return rules + */ + @javax.annotation.Nullable + public String getRules() { + return rules; + } + + public void setRules(@javax.annotation.Nullable String rules) { + this.rules = rules; + } + + + public RaasConfigData options(@javax.annotation.Nullable List<RaasOptions> options) { + this.options = options; + return this; + } + + public RaasConfigData addOptionsItem(RaasOptions optionsItem) { + if (this.options == null) { + this.options = new ArrayList<>(); + } + this.options.add(optionsItem); + return this; + } + + /** + * A list of options for the configuration. + * @return options + */ + @javax.annotation.Nullable + public List<RaasOptions> getOptions() { + return options; + } + + public void setOptions(@javax.annotation.Nullable List<RaasOptions> options) { + this.options = options; + } + + + public RaasConfigData permission(@javax.annotation.Nonnull String permission) { + this.permission = permission; + return this; + } + + /** + * The permission required for the configuration. + * @return permission + */ + @javax.annotation.Nonnull + public String getPermission() { + return permission; + } + + public void setPermission(@javax.annotation.Nonnull String permission) { + this.permission = permission; + } + + + public RaasConfigData checked(@javax.annotation.Nullable Boolean checked) { + this.checked = checked; + return this; + } + + /** + * Indicates whether the configuration is checked. + * @return checked + */ + @javax.annotation.Nullable + public Boolean getChecked() { + return checked; + } + + public void setChecked(@javax.annotation.Nullable Boolean checked) { + this.checked = checked; + } + + + public RaasConfigData parent(@javax.annotation.Nullable String parent) { + this.parent = parent; + return this; + } + + /** + * The parent field + * @return parent + */ + @javax.annotation.Nullable + public String getParent() { + return parent; + } + + public void setParent(@javax.annotation.Nullable String parent) { + this.parent = parent; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RaasConfigData instance itself + */ + public RaasConfigData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RaasConfigData raasConfigData = (RaasConfigData) o; + return Objects.equals(this.type, raasConfigData.type) && + Objects.equals(this.name, raasConfigData.name) && + Objects.equals(this.display, raasConfigData.display) && + Objects.equals(this.rules, raasConfigData.rules) && + Objects.equals(this.options, raasConfigData.options) && + Objects.equals(this.permission, raasConfigData.permission) && + Objects.equals(this.checked, raasConfigData.checked) && + Objects.equals(this.parent, raasConfigData.parent)&& + Objects.equals(this.additionalProperties, raasConfigData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, name, display, rules, options, permission, checked, parent, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RaasConfigData {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" display: ").append(toIndentedString(display)).append("\n"); + sb.append(" rules: ").append(toIndentedString(rules)).append("\n"); + sb.append(" options: ").append(toIndentedString(options)).append("\n"); + sb.append(" permission: ").append(toIndentedString(permission)).append("\n"); + sb.append(" checked: ").append(toIndentedString(checked)).append("\n"); + sb.append(" parent: ").append(toIndentedString(parent)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Type"); + openapiFields.add("Name"); + openapiFields.add("Display"); + openapiFields.add("Rules"); + openapiFields.add("Options"); + openapiFields.add("Permission"); + openapiFields.add("Checked"); + openapiFields.add("Parent"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Type"); + openapiRequiredFields.add("Name"); + openapiRequiredFields.add("Permission"); + } + + /** + * 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 RaasConfigData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RaasConfigData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RaasConfigData is not found in the empty JSON string", RaasConfigData.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RaasConfigData.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("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + // validate the required field `Type` + TypeEnum.validateJsonElement(jsonObj.get("Type")); + 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("Display") != null && !jsonObj.get("Display").isJsonNull()) && !jsonObj.get("Display").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Display` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Display").toString())); + } + if ((jsonObj.get("Rules") != null && !jsonObj.get("Rules").isJsonNull()) && !jsonObj.get("Rules").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Rules` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Rules").toString())); + } + if (jsonObj.get("Options") != null && !jsonObj.get("Options").isJsonNull()) { + JsonArray jsonArrayoptions = jsonObj.getAsJsonArray("Options"); + if (jsonArrayoptions != null) { + // ensure the json data is an array + if (!jsonObj.get("Options").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Options` to be an array in the JSON string but got `%s`", jsonObj.get("Options").toString())); + } + + // validate the optional field `Options` (array) + for (int i = 0; i < jsonArrayoptions.size(); i++) { + RaasOptions.validateJsonElement(jsonArrayoptions.get(i)); + }; + } + } + if (!jsonObj.get("Permission").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Permission` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Permission").toString())); + } + if ((jsonObj.get("Parent") != null && !jsonObj.get("Parent").isJsonNull()) && !jsonObj.get("Parent").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Parent` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Parent").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!RaasConfigData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RaasConfigData' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<RaasConfigData> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RaasConfigData.class)); + + return (TypeAdapter<T>) new TypeAdapter<RaasConfigData>() { + @Override + public void write(JsonWriter out, RaasConfigData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RaasConfigData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RaasConfigData instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RaasConfigData given an JSON string + * + * @param jsonString JSON string + * @return An instance of RaasConfigData + * @throws IOException if the JSON string is invalid with respect to RaasConfigData + */ + public static RaasConfigData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RaasConfigData.class); + } + + /** + * Convert an instance of RaasConfigData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/RaasCustomField.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/RaasCustomField.java new file mode 100644 index 0000000..50919c8 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/RaasCustomField.java @@ -0,0 +1,329 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * RaasCustomField + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class RaasCustomField { + public static final String SERIALIZED_NAME_KEY = "Key"; + @SerializedName(SERIALIZED_NAME_KEY) + @javax.annotation.Nullable + private String key; + + public static final String SERIALIZED_NAME_DISPLAY = "Display"; + @SerializedName(SERIALIZED_NAME_DISPLAY) + @javax.annotation.Nullable + private String display; + + public RaasCustomField() { + } + + public RaasCustomField key(@javax.annotation.Nullable String key) { + this.key = key; + return this; + } + + /** + * The key of the custom field. + * @return key + */ + @javax.annotation.Nullable + public String getKey() { + return key; + } + + public void setKey(@javax.annotation.Nullable String key) { + this.key = key; + } + + + public RaasCustomField display(@javax.annotation.Nullable String display) { + this.display = display; + return this; + } + + /** + * The display name of the custom field. + * @return display + */ + @javax.annotation.Nullable + public String getDisplay() { + return display; + } + + public void setDisplay(@javax.annotation.Nullable String display) { + this.display = display; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RaasCustomField instance itself + */ + public RaasCustomField putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RaasCustomField raasCustomField = (RaasCustomField) o; + return Objects.equals(this.key, raasCustomField.key) && + Objects.equals(this.display, raasCustomField.display)&& + Objects.equals(this.additionalProperties, raasCustomField.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(key, display, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RaasCustomField {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" display: ").append(toIndentedString(display)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Key"); + openapiFields.add("Display"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 RaasCustomField + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RaasCustomField.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RaasCustomField is not found in the empty JSON string", RaasCustomField.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Key") != null && !jsonObj.get("Key").isJsonNull()) && !jsonObj.get("Key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Key").toString())); + } + if ((jsonObj.get("Display") != null && !jsonObj.get("Display").isJsonNull()) && !jsonObj.get("Display").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Display` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Display").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!RaasCustomField.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RaasCustomField' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<RaasCustomField> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RaasCustomField.class)); + + return (TypeAdapter<T>) new TypeAdapter<RaasCustomField>() { + @Override + public void write(JsonWriter out, RaasCustomField value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RaasCustomField read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RaasCustomField instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RaasCustomField given an JSON string + * + * @param jsonString JSON string + * @return An instance of RaasCustomField + * @throws IOException if the JSON string is invalid with respect to RaasCustomField + */ + public static RaasCustomField fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RaasCustomField.class); + } + + /** + * Convert an instance of RaasCustomField to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/RaasCustomFieldModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/RaasCustomFieldModel.java new file mode 100644 index 0000000..96319c2 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/RaasCustomFieldModel.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * RaasCustomFieldModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class RaasCustomFieldModel { + public static final String SERIALIZED_NAME_CUSTOM_FIELD = "CustomField"; + @SerializedName(SERIALIZED_NAME_CUSTOM_FIELD) + @javax.annotation.Nonnull + private String customField; + + public RaasCustomFieldModel() { + } + + public RaasCustomFieldModel customField(@javax.annotation.Nonnull String customField) { + this.customField = customField; + return this; + } + + /** + * Name of the field you want to add as a custom field in the configuration. Must be alphanumeric with optional internal hyphens (-) or underscores (_), must start and end with an alphanumeric character, and cannot contain dots, spaces, or other special characters (max length 60). + * @return customField + */ + @javax.annotation.Nonnull + public String getCustomField() { + return customField; + } + + public void setCustomField(@javax.annotation.Nonnull String customField) { + this.customField = customField; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RaasCustomFieldModel instance itself + */ + public RaasCustomFieldModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RaasCustomFieldModel raasCustomFieldModel = (RaasCustomFieldModel) o; + return Objects.equals(this.customField, raasCustomFieldModel.customField)&& + Objects.equals(this.additionalProperties, raasCustomFieldModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(customField, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RaasCustomFieldModel {\n"); + sb.append(" customField: ").append(toIndentedString(customField)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("CustomField"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("CustomField"); + } + + /** + * 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 RaasCustomFieldModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RaasCustomFieldModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RaasCustomFieldModel is not found in the empty JSON string", RaasCustomFieldModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RaasCustomFieldModel.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("CustomField").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CustomField` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CustomField").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!RaasCustomFieldModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RaasCustomFieldModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<RaasCustomFieldModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RaasCustomFieldModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<RaasCustomFieldModel>() { + @Override + public void write(JsonWriter out, RaasCustomFieldModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RaasCustomFieldModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RaasCustomFieldModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RaasCustomFieldModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of RaasCustomFieldModel + * @throws IOException if the JSON string is invalid with respect to RaasCustomFieldModel + */ + public static RaasCustomFieldModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RaasCustomFieldModel.class); + } + + /** + * Convert an instance of RaasCustomFieldModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/RaasOptions.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/RaasOptions.java new file mode 100644 index 0000000..333f318 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/RaasOptions.java @@ -0,0 +1,329 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * RaasOptions + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class RaasOptions { + public static final String SERIALIZED_NAME_VALUE = "Value"; + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nullable + private String value; + + public static final String SERIALIZED_NAME_TEXT = "Text"; + @SerializedName(SERIALIZED_NAME_TEXT) + @javax.annotation.Nullable + private String text; + + public RaasOptions() { + } + + public RaasOptions value(@javax.annotation.Nullable String value) { + this.value = value; + return this; + } + + /** + * The value of the option. + * @return value + */ + @javax.annotation.Nullable + public String getValue() { + return value; + } + + public void setValue(@javax.annotation.Nullable String value) { + this.value = value; + } + + + public RaasOptions text(@javax.annotation.Nullable String text) { + this.text = text; + return this; + } + + /** + * The text of the option. + * @return text + */ + @javax.annotation.Nullable + public String getText() { + return text; + } + + public void setText(@javax.annotation.Nullable String text) { + this.text = text; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RaasOptions instance itself + */ + public RaasOptions putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RaasOptions raasOptions = (RaasOptions) o; + return Objects.equals(this.value, raasOptions.value) && + Objects.equals(this.text, raasOptions.text)&& + Objects.equals(this.additionalProperties, raasOptions.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(value, text, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RaasOptions {\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Value"); + openapiFields.add("Text"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 RaasOptions + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RaasOptions.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RaasOptions is not found in the empty JSON string", RaasOptions.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Value") != null && !jsonObj.get("Value").isJsonNull()) && !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("Text") != null && !jsonObj.get("Text").isJsonNull()) && !jsonObj.get("Text").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Text").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!RaasOptions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RaasOptions' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<RaasOptions> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RaasOptions.class)); + + return (TypeAdapter<T>) new TypeAdapter<RaasOptions>() { + @Override + public void write(JsonWriter out, RaasOptions value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RaasOptions read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RaasOptions instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RaasOptions given an JSON string + * + * @param jsonString JSON string + * @return An instance of RaasOptions + * @throws IOException if the JSON string is invalid with respect to RaasOptions + */ + public static RaasOptions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RaasOptions.class); + } + + /** + * Convert an instance of RaasOptions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/RangeObj.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/RangeObj.java new file mode 100644 index 0000000..d5560d0 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/RangeObj.java @@ -0,0 +1,351 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.RangeObjFrom; +import com.loginradius.sdk.internal.openapi.model.RangeObjTo; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Defines a single range for range-based aggregations, with optional key. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class RangeObj { + public static final String SERIALIZED_NAME_KEY = "key"; + @SerializedName(SERIALIZED_NAME_KEY) + @javax.annotation.Nullable + private String key; + + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + @javax.annotation.Nullable + private RangeObjTo to; + + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + @javax.annotation.Nullable + private RangeObjFrom from; + + public RangeObj() { + } + + public RangeObj key(@javax.annotation.Nullable String key) { + this.key = key; + return this; + } + + /** + * Optional. Key for the range bucket. + * @return key + */ + @javax.annotation.Nullable + public String getKey() { + return key; + } + + public void setKey(@javax.annotation.Nullable String key) { + this.key = key; + } + + + public RangeObj to(@javax.annotation.Nullable RangeObjTo to) { + this.to = to; + return this; + } + + /** + * Get to + * @return to + */ + @javax.annotation.Nullable + public RangeObjTo getTo() { + return to; + } + + public void setTo(@javax.annotation.Nullable RangeObjTo to) { + this.to = to; + } + + + public RangeObj from(@javax.annotation.Nullable RangeObjFrom from) { + this.from = from; + return this; + } + + /** + * Get from + * @return from + */ + @javax.annotation.Nullable + public RangeObjFrom getFrom() { + return from; + } + + public void setFrom(@javax.annotation.Nullable RangeObjFrom from) { + this.from = from; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RangeObj instance itself + */ + public RangeObj putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RangeObj rangeObj = (RangeObj) o; + return Objects.equals(this.key, rangeObj.key) && + Objects.equals(this.to, rangeObj.to) && + Objects.equals(this.from, rangeObj.from)&& + Objects.equals(this.additionalProperties, rangeObj.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(key, to, from, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RangeObj {\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("key"); + openapiFields.add("to"); + openapiFields.add("from"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 RangeObj + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RangeObj.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RangeObj is not found in the empty JSON string", RangeObj.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("key") != null && !jsonObj.get("key").isJsonNull()) && !jsonObj.get("key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("key").toString())); + } + // validate the optional field `to` + if (jsonObj.get("to") != null && !jsonObj.get("to").isJsonNull()) { + RangeObjTo.validateJsonElement(jsonObj.get("to")); + } + // validate the optional field `from` + if (jsonObj.get("from") != null && !jsonObj.get("from").isJsonNull()) { + RangeObjFrom.validateJsonElement(jsonObj.get("from")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!RangeObj.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RangeObj' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<RangeObj> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RangeObj.class)); + + return (TypeAdapter<T>) new TypeAdapter<RangeObj>() { + @Override + public void write(JsonWriter out, RangeObj value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RangeObj read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RangeObj instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RangeObj given an JSON string + * + * @param jsonString JSON string + * @return An instance of RangeObj + * @throws IOException if the JSON string is invalid with respect to RangeObj + */ + public static RangeObj fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RangeObj.class); + } + + /** + * Convert an instance of RangeObj to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/RangeObjFrom.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/RangeObjFrom.java new file mode 100644 index 0000000..16bbdf6 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/RangeObjFrom.java @@ -0,0 +1,323 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.math.BigDecimal; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class RangeObjFrom extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(RangeObjFrom.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!RangeObjFrom.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RangeObjFrom' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<String> adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + final TypeAdapter<Integer> adapterInteger = gson.getDelegateAdapter(this, TypeToken.get(Integer.class)); + final TypeAdapter<BigDecimal> adapterBigDecimal = gson.getDelegateAdapter(this, TypeToken.get(BigDecimal.class)); + + return (TypeAdapter<T>) new TypeAdapter<RangeObjFrom>() { + @Override + public void write(JsonWriter out, RangeObjFrom value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonPrimitive primitive = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Integer` + if (value.getActualInstance() instanceof Integer) { + JsonPrimitive primitive = adapterInteger.toJsonTree((Integer)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `BigDecimal` + if (value.getActualInstance() instanceof BigDecimal) { + JsonElement element = adapterBigDecimal.toJsonTree((BigDecimal)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: BigDecimal, Integer, String"); + } + + @Override + public RangeObjFrom read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + // deserialize Integer + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterInteger; + match++; + log.log(Level.FINER, "Input data matches schema 'Integer'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Integer failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Integer'", e); + } + // deserialize BigDecimal + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterBigDecimal; + match++; + log.log(Level.FINER, "Input data matches schema 'BigDecimal'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'BigDecimal'", e); + } + + if (match == 1) { + RangeObjFrom ret = new RangeObjFrom(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for RangeObjFrom: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public RangeObjFrom() { + super("oneOf", Boolean.FALSE); + } + + public RangeObjFrom(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", String.class); + schemas.put("Integer", Integer.class); + schemas.put("BigDecimal", BigDecimal.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return RangeObjFrom.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * BigDecimal, Integer, String + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Integer) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof BigDecimal) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be BigDecimal, Integer, String"); + } + + /** + * Get the actual instance, which can be the following: + * BigDecimal, Integer, String + * + * @return The actual instance (BigDecimal, Integer, String) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + /** + * Get the actual instance of `Integer`. If the actual instance is not `Integer`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Integer` + * @throws ClassCastException if the instance is not `Integer` + */ + public Integer getInteger() throws ClassCastException { + return (Integer)super.getActualInstance(); + } + + /** + * Get the actual instance of `BigDecimal`. If the actual instance is not `BigDecimal`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `BigDecimal` + * @throws ClassCastException if the instance is not `BigDecimal` + */ + public BigDecimal getBigDecimal() throws ClassCastException { + return (BigDecimal)super.getActualInstance(); + } + + /** + * 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 RangeObjFrom + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with String + try { + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Integer + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Integer failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with BigDecimal + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for RangeObjFrom with oneOf schemas: BigDecimal, Integer, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of RangeObjFrom given an JSON string + * + * @param jsonString JSON string + * @return An instance of RangeObjFrom + * @throws IOException if the JSON string is invalid with respect to RangeObjFrom + */ + public static RangeObjFrom fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RangeObjFrom.class); + } + + /** + * Convert an instance of RangeObjFrom to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/RangeObjTo.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/RangeObjTo.java new file mode 100644 index 0000000..3a6adbc --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/RangeObjTo.java @@ -0,0 +1,323 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.math.BigDecimal; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class RangeObjTo extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(RangeObjTo.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!RangeObjTo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RangeObjTo' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<String> adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + final TypeAdapter<Integer> adapterInteger = gson.getDelegateAdapter(this, TypeToken.get(Integer.class)); + final TypeAdapter<BigDecimal> adapterBigDecimal = gson.getDelegateAdapter(this, TypeToken.get(BigDecimal.class)); + + return (TypeAdapter<T>) new TypeAdapter<RangeObjTo>() { + @Override + public void write(JsonWriter out, RangeObjTo value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonPrimitive primitive = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Integer` + if (value.getActualInstance() instanceof Integer) { + JsonPrimitive primitive = adapterInteger.toJsonTree((Integer)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `BigDecimal` + if (value.getActualInstance() instanceof BigDecimal) { + JsonElement element = adapterBigDecimal.toJsonTree((BigDecimal)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: BigDecimal, Integer, String"); + } + + @Override + public RangeObjTo read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + // deserialize Integer + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterInteger; + match++; + log.log(Level.FINER, "Input data matches schema 'Integer'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Integer failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Integer'", e); + } + // deserialize BigDecimal + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterBigDecimal; + match++; + log.log(Level.FINER, "Input data matches schema 'BigDecimal'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'BigDecimal'", e); + } + + if (match == 1) { + RangeObjTo ret = new RangeObjTo(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for RangeObjTo: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public RangeObjTo() { + super("oneOf", Boolean.FALSE); + } + + public RangeObjTo(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", String.class); + schemas.put("Integer", Integer.class); + schemas.put("BigDecimal", BigDecimal.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return RangeObjTo.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * BigDecimal, Integer, String + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Integer) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof BigDecimal) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be BigDecimal, Integer, String"); + } + + /** + * Get the actual instance, which can be the following: + * BigDecimal, Integer, String + * + * @return The actual instance (BigDecimal, Integer, String) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + /** + * Get the actual instance of `Integer`. If the actual instance is not `Integer`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Integer` + * @throws ClassCastException if the instance is not `Integer` + */ + public Integer getInteger() throws ClassCastException { + return (Integer)super.getActualInstance(); + } + + /** + * Get the actual instance of `BigDecimal`. If the actual instance is not `BigDecimal`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `BigDecimal` + * @throws ClassCastException if the instance is not `BigDecimal` + */ + public BigDecimal getBigDecimal() throws ClassCastException { + return (BigDecimal)super.getActualInstance(); + } + + /** + * 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 RangeObjTo + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with String + try { + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Integer + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Integer failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with BigDecimal + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for RangeObjTo with oneOf schemas: BigDecimal, Integer, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of RangeObjTo given an JSON string + * + * @param jsonString JSON string + * @return An instance of RangeObjTo + * @throws IOException if the JSON string is invalid with respect to RangeObjTo + */ + public static RangeObjTo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RangeObjTo.class); + } + + /** + * Convert an instance of RangeObjTo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ReAuthModelByEmailOtp.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ReAuthModelByEmailOtp.java new file mode 100644 index 0000000..31f0f37 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ReAuthModelByEmailOtp.java @@ -0,0 +1,326 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ReAuthModelByEmailOtp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ReAuthModelByEmailOtp { + public static final String SERIALIZED_NAME_EMAILID = "emailid"; + @SerializedName(SERIALIZED_NAME_EMAILID) + @javax.annotation.Nonnull + private String emailid; + + public static final String SERIALIZED_NAME_OTP = "otp"; + @SerializedName(SERIALIZED_NAME_OTP) + @javax.annotation.Nonnull + private String otp; + + public ReAuthModelByEmailOtp() { + } + + public ReAuthModelByEmailOtp emailid(@javax.annotation.Nonnull String emailid) { + this.emailid = emailid; + return this; + } + + /** + * User's Email address. + * @return emailid + */ + @javax.annotation.Nonnull + public String getEmailid() { + return emailid; + } + + public void setEmailid(@javax.annotation.Nonnull String emailid) { + this.emailid = emailid; + } + + + public ReAuthModelByEmailOtp otp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + return this; + } + + /** + * One-Time Password sent to the User's Email. + * @return otp + */ + @javax.annotation.Nonnull + public String getOtp() { + return otp; + } + + public void setOtp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ReAuthModelByEmailOtp instance itself + */ + public ReAuthModelByEmailOtp putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReAuthModelByEmailOtp reAuthModelByEmailOtp = (ReAuthModelByEmailOtp) o; + return Objects.equals(this.emailid, reAuthModelByEmailOtp.emailid) && + Objects.equals(this.otp, reAuthModelByEmailOtp.otp)&& + Objects.equals(this.additionalProperties, reAuthModelByEmailOtp.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(emailid, otp, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReAuthModelByEmailOtp {\n"); + sb.append(" emailid: ").append(toIndentedString(emailid)).append("\n"); + sb.append(" otp: ").append(toIndentedString(otp)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("emailid"); + openapiFields.add("otp"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("emailid"); + openapiRequiredFields.add("otp"); + } + + /** + * 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 ReAuthModelByEmailOtp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReAuthModelByEmailOtp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ReAuthModelByEmailOtp is not found in the empty JSON string", ReAuthModelByEmailOtp.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReAuthModelByEmailOtp.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("emailid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `emailid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("emailid").toString())); + } + if (!jsonObj.get("otp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `otp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("otp").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ReAuthModelByEmailOtp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReAuthModelByEmailOtp' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ReAuthModelByEmailOtp> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReAuthModelByEmailOtp.class)); + + return (TypeAdapter<T>) new TypeAdapter<ReAuthModelByEmailOtp>() { + @Override + public void write(JsonWriter out, ReAuthModelByEmailOtp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ReAuthModelByEmailOtp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ReAuthModelByEmailOtp instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ReAuthModelByEmailOtp given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReAuthModelByEmailOtp + * @throws IOException if the JSON string is invalid with respect to ReAuthModelByEmailOtp + */ + public static ReAuthModelByEmailOtp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReAuthModelByEmailOtp.class); + } + + /** + * Convert an instance of ReAuthModelByEmailOtp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ReAuthResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ReAuthResponse.java new file mode 100644 index 0000000..c36c37d --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ReAuthResponse.java @@ -0,0 +1,324 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ReAuthResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ReAuthResponse { + public static final String SERIALIZED_NAME_SECOND_FACTOR_VALIDATION_TOKEN = "SecondFactorValidationToken"; + @SerializedName(SERIALIZED_NAME_SECOND_FACTOR_VALIDATION_TOKEN) + @javax.annotation.Nonnull + private String secondFactorValidationToken; + + public static final String SERIALIZED_NAME_EXPIRE_IN = "ExpireIn"; + @SerializedName(SERIALIZED_NAME_EXPIRE_IN) + @javax.annotation.Nonnull + private OffsetDateTime expireIn; + + public ReAuthResponse() { + } + + public ReAuthResponse secondFactorValidationToken(@javax.annotation.Nonnull String secondFactorValidationToken) { + this.secondFactorValidationToken = secondFactorValidationToken; + return this; + } + + /** + * The token used for second factor validation. + * @return secondFactorValidationToken + */ + @javax.annotation.Nonnull + public String getSecondFactorValidationToken() { + return secondFactorValidationToken; + } + + public void setSecondFactorValidationToken(@javax.annotation.Nonnull String secondFactorValidationToken) { + this.secondFactorValidationToken = secondFactorValidationToken; + } + + + public ReAuthResponse expireIn(@javax.annotation.Nonnull OffsetDateTime expireIn) { + this.expireIn = expireIn; + return this; + } + + /** + * Expiry timestamp for the token. + * @return expireIn + */ + @javax.annotation.Nonnull + public OffsetDateTime getExpireIn() { + return expireIn; + } + + public void setExpireIn(@javax.annotation.Nonnull OffsetDateTime expireIn) { + this.expireIn = expireIn; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ReAuthResponse instance itself + */ + public ReAuthResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReAuthResponse reAuthResponse = (ReAuthResponse) o; + return Objects.equals(this.secondFactorValidationToken, reAuthResponse.secondFactorValidationToken) && + Objects.equals(this.expireIn, reAuthResponse.expireIn)&& + Objects.equals(this.additionalProperties, reAuthResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(secondFactorValidationToken, expireIn, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReAuthResponse {\n"); + sb.append(" secondFactorValidationToken: ").append(toIndentedString(secondFactorValidationToken)).append("\n"); + sb.append(" expireIn: ").append(toIndentedString(expireIn)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("SecondFactorValidationToken"); + openapiFields.add("ExpireIn"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("SecondFactorValidationToken"); + openapiRequiredFields.add("ExpireIn"); + } + + /** + * 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 ReAuthResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReAuthResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ReAuthResponse is not found in the empty JSON string", ReAuthResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ReAuthResponse.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("SecondFactorValidationToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SecondFactorValidationToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SecondFactorValidationToken").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ReAuthResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReAuthResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ReAuthResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReAuthResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<ReAuthResponse>() { + @Override + public void write(JsonWriter out, ReAuthResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ReAuthResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ReAuthResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ReAuthResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReAuthResponse + * @throws IOException if the JSON string is invalid with respect to ReAuthResponse + */ + public static ReAuthResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReAuthResponse.class); + } + + /** + * Convert an instance of ReAuthResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ReAuthTwoFAModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ReAuthTwoFAModel.java new file mode 100644 index 0000000..54364ae --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ReAuthTwoFAModel.java @@ -0,0 +1,546 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ReAuthTwoFAModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ReAuthTwoFAModel { + public static final String SERIALIZED_NAME_G_RECAPTCHA_RESPONSE = "g-recaptcha-response"; + @SerializedName(SERIALIZED_NAME_G_RECAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String gRecaptchaResponse; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_TICKET = "qq_captcha_ticket"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_TICKET) + @javax.annotation.Nullable + private String qqCaptchaTicket; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR = "qq_captcha_randstr"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR) + @javax.annotation.Nullable + private String qqCaptchaRandstr; + + public static final String SERIALIZED_NAME_H_CAPTCHA_RESPONSE = "h-captcha-response"; + @SerializedName(SERIALIZED_NAME_H_CAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String hCaptchaResponse; + + public static final String SERIALIZED_NAME_GOOGLEAUTHENTICATORCODE = "googleauthenticatorcode"; + @SerializedName(SERIALIZED_NAME_GOOGLEAUTHENTICATORCODE) + @javax.annotation.Nullable + private String googleauthenticatorcode; + + public static final String SERIALIZED_NAME_OTP = "otp"; + @SerializedName(SERIALIZED_NAME_OTP) + @javax.annotation.Nullable + private String otp; + + public static final String SERIALIZED_NAME_BACKUPCODE = "backupcode"; + @SerializedName(SERIALIZED_NAME_BACKUPCODE) + @javax.annotation.Nullable + private String backupcode; + + public static final String SERIALIZED_NAME_AUTHENTICATORCODE = "authenticatorcode"; + @SerializedName(SERIALIZED_NAME_AUTHENTICATORCODE) + @javax.annotation.Nullable + private String authenticatorcode; + + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "securityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer = new HashMap<>(); + + public ReAuthTwoFAModel() { + } + + public ReAuthTwoFAModel gRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + return this; + } + + /** + * The Google reCAPTCHA response which is sent to the server for verification. + * @return gRecaptchaResponse + */ + @javax.annotation.Nullable + public String getgRecaptchaResponse() { + return gRecaptchaResponse; + } + + public void setgRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + } + + + public ReAuthTwoFAModel qqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + return this; + } + + /** + * The QQ Captcha ticket which is sent to the server for verification. + * @return qqCaptchaTicket + */ + @javax.annotation.Nullable + public String getQqCaptchaTicket() { + return qqCaptchaTicket; + } + + public void setQqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + } + + + public ReAuthTwoFAModel qqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + return this; + } + + /** + * The QQ Captcha random string which is sent to the server for verification. + * @return qqCaptchaRandstr + */ + @javax.annotation.Nullable + public String getQqCaptchaRandstr() { + return qqCaptchaRandstr; + } + + public void setQqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + } + + + public ReAuthTwoFAModel hCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + return this; + } + + /** + * The hCaptcha response which is sent to the server for verification. + * @return hCaptchaResponse + */ + @javax.annotation.Nullable + public String gethCaptchaResponse() { + return hCaptchaResponse; + } + + public void sethCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + } + + + public ReAuthTwoFAModel googleauthenticatorcode(@javax.annotation.Nullable String googleauthenticatorcode) { + this.googleauthenticatorcode = googleauthenticatorcode; + return this; + } + + /** + * Get googleauthenticatorcode + * @return googleauthenticatorcode + */ + @javax.annotation.Nullable + public String getGoogleauthenticatorcode() { + return googleauthenticatorcode; + } + + public void setGoogleauthenticatorcode(@javax.annotation.Nullable String googleauthenticatorcode) { + this.googleauthenticatorcode = googleauthenticatorcode; + } + + + public ReAuthTwoFAModel otp(@javax.annotation.Nullable String otp) { + this.otp = otp; + return this; + } + + /** + * Get otp + * @return otp + */ + @javax.annotation.Nullable + public String getOtp() { + return otp; + } + + public void setOtp(@javax.annotation.Nullable String otp) { + this.otp = otp; + } + + + public ReAuthTwoFAModel backupcode(@javax.annotation.Nullable String backupcode) { + this.backupcode = backupcode; + return this; + } + + /** + * Get backupcode + * @return backupcode + */ + @javax.annotation.Nullable + public String getBackupcode() { + return backupcode; + } + + public void setBackupcode(@javax.annotation.Nullable String backupcode) { + this.backupcode = backupcode; + } + + + public ReAuthTwoFAModel authenticatorcode(@javax.annotation.Nullable String authenticatorcode) { + this.authenticatorcode = authenticatorcode; + return this; + } + + /** + * Get authenticatorcode + * @return authenticatorcode + */ + @javax.annotation.Nullable + public String getAuthenticatorcode() { + return authenticatorcode; + } + + public void setAuthenticatorcode(@javax.annotation.Nullable String authenticatorcode) { + this.authenticatorcode = authenticatorcode; + } + + + public ReAuthTwoFAModel securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public ReAuthTwoFAModel putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * Get securityAnswer + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ReAuthTwoFAModel instance itself + */ + public ReAuthTwoFAModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReAuthTwoFAModel reAuthTwoFAModel = (ReAuthTwoFAModel) o; + return Objects.equals(this.gRecaptchaResponse, reAuthTwoFAModel.gRecaptchaResponse) && + Objects.equals(this.qqCaptchaTicket, reAuthTwoFAModel.qqCaptchaTicket) && + Objects.equals(this.qqCaptchaRandstr, reAuthTwoFAModel.qqCaptchaRandstr) && + Objects.equals(this.hCaptchaResponse, reAuthTwoFAModel.hCaptchaResponse) && + Objects.equals(this.googleauthenticatorcode, reAuthTwoFAModel.googleauthenticatorcode) && + Objects.equals(this.otp, reAuthTwoFAModel.otp) && + Objects.equals(this.backupcode, reAuthTwoFAModel.backupcode) && + Objects.equals(this.authenticatorcode, reAuthTwoFAModel.authenticatorcode) && + Objects.equals(this.securityAnswer, reAuthTwoFAModel.securityAnswer)&& + Objects.equals(this.additionalProperties, reAuthTwoFAModel.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, googleauthenticatorcode, otp, backupcode, authenticatorcode, securityAnswer, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReAuthTwoFAModel {\n"); + sb.append(" gRecaptchaResponse: ").append(toIndentedString(gRecaptchaResponse)).append("\n"); + sb.append(" qqCaptchaTicket: ").append(toIndentedString(qqCaptchaTicket)).append("\n"); + sb.append(" qqCaptchaRandstr: ").append(toIndentedString(qqCaptchaRandstr)).append("\n"); + sb.append(" hCaptchaResponse: ").append(toIndentedString(hCaptchaResponse)).append("\n"); + sb.append(" googleauthenticatorcode: ").append(toIndentedString(googleauthenticatorcode)).append("\n"); + sb.append(" otp: ").append(toIndentedString(otp)).append("\n"); + sb.append(" backupcode: ").append(toIndentedString(backupcode)).append("\n"); + sb.append(" authenticatorcode: ").append(toIndentedString(authenticatorcode)).append("\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("g-recaptcha-response"); + openapiFields.add("qq_captcha_ticket"); + openapiFields.add("qq_captcha_randstr"); + openapiFields.add("h-captcha-response"); + openapiFields.add("googleauthenticatorcode"); + openapiFields.add("otp"); + openapiFields.add("backupcode"); + openapiFields.add("authenticatorcode"); + openapiFields.add("securityAnswer"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ReAuthTwoFAModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReAuthTwoFAModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ReAuthTwoFAModel is not found in the empty JSON string", ReAuthTwoFAModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("g-recaptcha-response") != null && !jsonObj.get("g-recaptcha-response").isJsonNull()) && !jsonObj.get("g-recaptcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `g-recaptcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("g-recaptcha-response").toString())); + } + if ((jsonObj.get("qq_captcha_ticket") != null && !jsonObj.get("qq_captcha_ticket").isJsonNull()) && !jsonObj.get("qq_captcha_ticket").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_ticket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_ticket").toString())); + } + if ((jsonObj.get("qq_captcha_randstr") != null && !jsonObj.get("qq_captcha_randstr").isJsonNull()) && !jsonObj.get("qq_captcha_randstr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_randstr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_randstr").toString())); + } + if ((jsonObj.get("h-captcha-response") != null && !jsonObj.get("h-captcha-response").isJsonNull()) && !jsonObj.get("h-captcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `h-captcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("h-captcha-response").toString())); + } + if ((jsonObj.get("googleauthenticatorcode") != null && !jsonObj.get("googleauthenticatorcode").isJsonNull()) && !jsonObj.get("googleauthenticatorcode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `googleauthenticatorcode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("googleauthenticatorcode").toString())); + } + if ((jsonObj.get("otp") != null && !jsonObj.get("otp").isJsonNull()) && !jsonObj.get("otp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `otp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("otp").toString())); + } + if ((jsonObj.get("backupcode") != null && !jsonObj.get("backupcode").isJsonNull()) && !jsonObj.get("backupcode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `backupcode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("backupcode").toString())); + } + if ((jsonObj.get("authenticatorcode") != null && !jsonObj.get("authenticatorcode").isJsonNull()) && !jsonObj.get("authenticatorcode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `authenticatorcode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authenticatorcode").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ReAuthTwoFAModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReAuthTwoFAModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ReAuthTwoFAModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReAuthTwoFAModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<ReAuthTwoFAModel>() { + @Override + public void write(JsonWriter out, ReAuthTwoFAModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ReAuthTwoFAModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ReAuthTwoFAModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ReAuthTwoFAModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReAuthTwoFAModel + * @throws IOException if the JSON string is invalid with respect to ReAuthTwoFAModel + */ + public static ReAuthTwoFAModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReAuthTwoFAModel.class); + } + + /** + * Convert an instance of ReAuthTwoFAModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ReAuthTwoFAModelCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ReAuthTwoFAModelCore.java new file mode 100644 index 0000000..0a05b23 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ReAuthTwoFAModelCore.java @@ -0,0 +1,409 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ReAuthTwoFAModelCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ReAuthTwoFAModelCore { + public static final String SERIALIZED_NAME_GOOGLEAUTHENTICATORCODE = "googleauthenticatorcode"; + @SerializedName(SERIALIZED_NAME_GOOGLEAUTHENTICATORCODE) + @javax.annotation.Nullable + private String googleauthenticatorcode; + + public static final String SERIALIZED_NAME_OTP = "otp"; + @SerializedName(SERIALIZED_NAME_OTP) + @javax.annotation.Nullable + private String otp; + + public static final String SERIALIZED_NAME_BACKUPCODE = "backupcode"; + @SerializedName(SERIALIZED_NAME_BACKUPCODE) + @javax.annotation.Nullable + private String backupcode; + + public static final String SERIALIZED_NAME_AUTHENTICATORCODE = "authenticatorcode"; + @SerializedName(SERIALIZED_NAME_AUTHENTICATORCODE) + @javax.annotation.Nullable + private String authenticatorcode; + + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "securityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer = new HashMap<>(); + + public ReAuthTwoFAModelCore() { + } + + public ReAuthTwoFAModelCore googleauthenticatorcode(@javax.annotation.Nullable String googleauthenticatorcode) { + this.googleauthenticatorcode = googleauthenticatorcode; + return this; + } + + /** + * Get googleauthenticatorcode + * @return googleauthenticatorcode + */ + @javax.annotation.Nullable + public String getGoogleauthenticatorcode() { + return googleauthenticatorcode; + } + + public void setGoogleauthenticatorcode(@javax.annotation.Nullable String googleauthenticatorcode) { + this.googleauthenticatorcode = googleauthenticatorcode; + } + + + public ReAuthTwoFAModelCore otp(@javax.annotation.Nullable String otp) { + this.otp = otp; + return this; + } + + /** + * Get otp + * @return otp + */ + @javax.annotation.Nullable + public String getOtp() { + return otp; + } + + public void setOtp(@javax.annotation.Nullable String otp) { + this.otp = otp; + } + + + public ReAuthTwoFAModelCore backupcode(@javax.annotation.Nullable String backupcode) { + this.backupcode = backupcode; + return this; + } + + /** + * Get backupcode + * @return backupcode + */ + @javax.annotation.Nullable + public String getBackupcode() { + return backupcode; + } + + public void setBackupcode(@javax.annotation.Nullable String backupcode) { + this.backupcode = backupcode; + } + + + public ReAuthTwoFAModelCore authenticatorcode(@javax.annotation.Nullable String authenticatorcode) { + this.authenticatorcode = authenticatorcode; + return this; + } + + /** + * Get authenticatorcode + * @return authenticatorcode + */ + @javax.annotation.Nullable + public String getAuthenticatorcode() { + return authenticatorcode; + } + + public void setAuthenticatorcode(@javax.annotation.Nullable String authenticatorcode) { + this.authenticatorcode = authenticatorcode; + } + + + public ReAuthTwoFAModelCore securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public ReAuthTwoFAModelCore putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * Get securityAnswer + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ReAuthTwoFAModelCore instance itself + */ + public ReAuthTwoFAModelCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ReAuthTwoFAModelCore reAuthTwoFAModelCore = (ReAuthTwoFAModelCore) o; + return Objects.equals(this.googleauthenticatorcode, reAuthTwoFAModelCore.googleauthenticatorcode) && + Objects.equals(this.otp, reAuthTwoFAModelCore.otp) && + Objects.equals(this.backupcode, reAuthTwoFAModelCore.backupcode) && + Objects.equals(this.authenticatorcode, reAuthTwoFAModelCore.authenticatorcode) && + Objects.equals(this.securityAnswer, reAuthTwoFAModelCore.securityAnswer)&& + Objects.equals(this.additionalProperties, reAuthTwoFAModelCore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(googleauthenticatorcode, otp, backupcode, authenticatorcode, securityAnswer, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ReAuthTwoFAModelCore {\n"); + sb.append(" googleauthenticatorcode: ").append(toIndentedString(googleauthenticatorcode)).append("\n"); + sb.append(" otp: ").append(toIndentedString(otp)).append("\n"); + sb.append(" backupcode: ").append(toIndentedString(backupcode)).append("\n"); + sb.append(" authenticatorcode: ").append(toIndentedString(authenticatorcode)).append("\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ReAuthTwoFAModelCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ReAuthTwoFAModelCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ReAuthTwoFAModelCore is not found in the empty JSON string", ReAuthTwoFAModelCore.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("googleauthenticatorcode") != null && !jsonObj.get("googleauthenticatorcode").isJsonNull()) && !jsonObj.get("googleauthenticatorcode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `googleauthenticatorcode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("googleauthenticatorcode").toString())); + } + if ((jsonObj.get("otp") != null && !jsonObj.get("otp").isJsonNull()) && !jsonObj.get("otp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `otp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("otp").toString())); + } + if ((jsonObj.get("backupcode") != null && !jsonObj.get("backupcode").isJsonNull()) && !jsonObj.get("backupcode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `backupcode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("backupcode").toString())); + } + if ((jsonObj.get("authenticatorcode") != null && !jsonObj.get("authenticatorcode").isJsonNull()) && !jsonObj.get("authenticatorcode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `authenticatorcode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("authenticatorcode").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ReAuthTwoFAModelCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ReAuthTwoFAModelCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ReAuthTwoFAModelCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ReAuthTwoFAModelCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<ReAuthTwoFAModelCore>() { + @Override + public void write(JsonWriter out, ReAuthTwoFAModelCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ReAuthTwoFAModelCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ReAuthTwoFAModelCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ReAuthTwoFAModelCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of ReAuthTwoFAModelCore + * @throws IOException if the JSON string is invalid with respect to ReAuthTwoFAModelCore + */ + public static ReAuthTwoFAModelCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ReAuthTwoFAModelCore.class); + } + + /** + * Convert an instance of ReAuthTwoFAModelCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/RegistrationResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/RegistrationResponse.java new file mode 100644 index 0000000..d0f2b0e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/RegistrationResponse.java @@ -0,0 +1,316 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.AuthResponseWithoutIdentites; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * RegistrationResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class RegistrationResponse { + public static final String SERIALIZED_NAME_IS_POSTED = "IsPosted"; + @SerializedName(SERIALIZED_NAME_IS_POSTED) + @javax.annotation.Nullable + private Boolean isPosted; + + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private AuthResponseWithoutIdentites data; + + public RegistrationResponse() { + } + + public RegistrationResponse isPosted(@javax.annotation.Nullable Boolean isPosted) { + this.isPosted = isPosted; + return this; + } + + /** + * Get isPosted + * @return isPosted + */ + @javax.annotation.Nullable + public Boolean getIsPosted() { + return isPosted; + } + + public void setIsPosted(@javax.annotation.Nullable Boolean isPosted) { + this.isPosted = isPosted; + } + + + public RegistrationResponse data(@javax.annotation.Nullable AuthResponseWithoutIdentites data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public AuthResponseWithoutIdentites getData() { + return data; + } + + public void setData(@javax.annotation.Nullable AuthResponseWithoutIdentites data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RegistrationResponse instance itself + */ + public RegistrationResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RegistrationResponse registrationResponse = (RegistrationResponse) o; + return Objects.equals(this.isPosted, registrationResponse.isPosted) && + Objects.equals(this.data, registrationResponse.data)&& + Objects.equals(this.additionalProperties, registrationResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isPosted, data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RegistrationResponse {\n"); + sb.append(" isPosted: ").append(toIndentedString(isPosted)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsPosted"); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 RegistrationResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RegistrationResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RegistrationResponse is not found in the empty JSON string", RegistrationResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `Data` + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + AuthResponseWithoutIdentites.validateJsonElement(jsonObj.get("Data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!RegistrationResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RegistrationResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<RegistrationResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RegistrationResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<RegistrationResponse>() { + @Override + public void write(JsonWriter out, RegistrationResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RegistrationResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RegistrationResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RegistrationResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of RegistrationResponse + * @throws IOException if the JSON string is invalid with respect to RegistrationResponse + */ + public static RegistrationResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RegistrationResponse.class); + } + + /** + * Convert an instance of RegistrationResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/RemoveRoleContextAdditionalPermissionsModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/RemoveRoleContextAdditionalPermissionsModel.java new file mode 100644 index 0000000..5ea56be --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/RemoveRoleContextAdditionalPermissionsModel.java @@ -0,0 +1,308 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.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.loginradius.sdk.internal.openapi.JSON; + +/** + * RemoveRoleContextAdditionalPermissionsModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class RemoveRoleContextAdditionalPermissionsModel { + public static final String SERIALIZED_NAME_ADDITIONALPERMISSIONS = "additionalpermissions"; + @SerializedName(SERIALIZED_NAME_ADDITIONALPERMISSIONS) + @javax.annotation.Nonnull + private List<String> additionalpermissions = new ArrayList<>(); + + public RemoveRoleContextAdditionalPermissionsModel() { + } + + public RemoveRoleContextAdditionalPermissionsModel additionalpermissions(@javax.annotation.Nonnull List<String> additionalpermissions) { + this.additionalpermissions = additionalpermissions; + return this; + } + + public RemoveRoleContextAdditionalPermissionsModel addAdditionalpermissionsItem(String additionalpermissionsItem) { + if (this.additionalpermissions == null) { + this.additionalpermissions = new ArrayList<>(); + } + this.additionalpermissions.add(additionalpermissionsItem); + return this; + } + + /** + * List of Additional Permissions to remove. + * @return additionalpermissions + */ + @javax.annotation.Nonnull + public List<String> getAdditionalpermissions() { + return additionalpermissions; + } + + public void setAdditionalpermissions(@javax.annotation.Nonnull List<String> additionalpermissions) { + this.additionalpermissions = additionalpermissions; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RemoveRoleContextAdditionalPermissionsModel instance itself + */ + public RemoveRoleContextAdditionalPermissionsModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoveRoleContextAdditionalPermissionsModel removeRoleContextAdditionalPermissionsModel = (RemoveRoleContextAdditionalPermissionsModel) o; + return Objects.equals(this.additionalpermissions, removeRoleContextAdditionalPermissionsModel.additionalpermissions)&& + Objects.equals(this.additionalProperties, removeRoleContextAdditionalPermissionsModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(additionalpermissions, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoveRoleContextAdditionalPermissionsModel {\n"); + sb.append(" additionalpermissions: ").append(toIndentedString(additionalpermissions)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("additionalpermissions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("additionalpermissions"); + } + + /** + * 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 RemoveRoleContextAdditionalPermissionsModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RemoveRoleContextAdditionalPermissionsModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RemoveRoleContextAdditionalPermissionsModel is not found in the empty JSON string", RemoveRoleContextAdditionalPermissionsModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RemoveRoleContextAdditionalPermissionsModel.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 required json array is present + if (jsonObj.get("additionalpermissions") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("additionalpermissions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `additionalpermissions` to be an array in the JSON string but got `%s`", jsonObj.get("additionalpermissions").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!RemoveRoleContextAdditionalPermissionsModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RemoveRoleContextAdditionalPermissionsModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<RemoveRoleContextAdditionalPermissionsModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RemoveRoleContextAdditionalPermissionsModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<RemoveRoleContextAdditionalPermissionsModel>() { + @Override + public void write(JsonWriter out, RemoveRoleContextAdditionalPermissionsModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RemoveRoleContextAdditionalPermissionsModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RemoveRoleContextAdditionalPermissionsModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RemoveRoleContextAdditionalPermissionsModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of RemoveRoleContextAdditionalPermissionsModel + * @throws IOException if the JSON string is invalid with respect to RemoveRoleContextAdditionalPermissionsModel + */ + public static RemoveRoleContextAdditionalPermissionsModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RemoveRoleContextAdditionalPermissionsModel.class); + } + + /** + * Convert an instance of RemoveRoleContextAdditionalPermissionsModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/RemoveRoleContextRoleModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/RemoveRoleContextRoleModel.java new file mode 100644 index 0000000..7084979 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/RemoveRoleContextRoleModel.java @@ -0,0 +1,308 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.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.loginradius.sdk.internal.openapi.JSON; + +/** + * RemoveRoleContextRoleModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class RemoveRoleContextRoleModel { + public static final String SERIALIZED_NAME_ROLES = "roles"; + @SerializedName(SERIALIZED_NAME_ROLES) + @javax.annotation.Nonnull + private List<String> roles = new ArrayList<>(); + + public RemoveRoleContextRoleModel() { + } + + public RemoveRoleContextRoleModel roles(@javax.annotation.Nonnull List<String> roles) { + this.roles = roles; + return this; + } + + public RemoveRoleContextRoleModel addRolesItem(String rolesItem) { + if (this.roles == null) { + this.roles = new ArrayList<>(); + } + this.roles.add(rolesItem); + return this; + } + + /** + * List of Roles to remove. + * @return roles + */ + @javax.annotation.Nonnull + public List<String> getRoles() { + return roles; + } + + public void setRoles(@javax.annotation.Nonnull List<String> roles) { + this.roles = roles; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RemoveRoleContextRoleModel instance itself + */ + public RemoveRoleContextRoleModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RemoveRoleContextRoleModel removeRoleContextRoleModel = (RemoveRoleContextRoleModel) o; + return Objects.equals(this.roles, removeRoleContextRoleModel.roles)&& + Objects.equals(this.additionalProperties, removeRoleContextRoleModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(roles, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RemoveRoleContextRoleModel {\n"); + sb.append(" roles: ").append(toIndentedString(roles)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("roles"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("roles"); + } + + /** + * 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 RemoveRoleContextRoleModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RemoveRoleContextRoleModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RemoveRoleContextRoleModel is not found in the empty JSON string", RemoveRoleContextRoleModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RemoveRoleContextRoleModel.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 required json array is present + if (jsonObj.get("roles") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("roles").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `roles` to be an array in the JSON string but got `%s`", jsonObj.get("roles").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!RemoveRoleContextRoleModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RemoveRoleContextRoleModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<RemoveRoleContextRoleModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RemoveRoleContextRoleModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<RemoveRoleContextRoleModel>() { + @Override + public void write(JsonWriter out, RemoveRoleContextRoleModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RemoveRoleContextRoleModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RemoveRoleContextRoleModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RemoveRoleContextRoleModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of RemoveRoleContextRoleModel + * @throws IOException if the JSON string is invalid with respect to RemoveRoleContextRoleModel + */ + public static RemoveRoleContextRoleModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RemoveRoleContextRoleModel.class); + } + + /** + * Convert an instance of RemoveRoleContextRoleModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/RequestPayload.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/RequestPayload.java new file mode 100644 index 0000000..ff0ed03 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/RequestPayload.java @@ -0,0 +1,344 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.Aggregation; +import java.io.IOException; +import java.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * The request payload for insights queries, specifying the time range and aggregation details. + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class RequestPayload { + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + @javax.annotation.Nullable + private OffsetDateTime from; + + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + @javax.annotation.Nullable + private OffsetDateTime to; + + public static final String SERIALIZED_NAME_Q = "q"; + @SerializedName(SERIALIZED_NAME_Q) + @javax.annotation.Nullable + private Aggregation q; + + public RequestPayload() { + } + + public RequestPayload from(@javax.annotation.Nullable OffsetDateTime from) { + this.from = from; + return this; + } + + /** + * Start of the time range for the query (ISO 8601 format). + * @return from + */ + @javax.annotation.Nullable + public OffsetDateTime getFrom() { + return from; + } + + public void setFrom(@javax.annotation.Nullable OffsetDateTime from) { + this.from = from; + } + + + public RequestPayload to(@javax.annotation.Nullable OffsetDateTime to) { + this.to = to; + return this; + } + + /** + * End of the time range for the query (ISO 8601 format). + * @return to + */ + @javax.annotation.Nullable + public OffsetDateTime getTo() { + return to; + } + + public void setTo(@javax.annotation.Nullable OffsetDateTime to) { + this.to = to; + } + + + public RequestPayload q(@javax.annotation.Nullable Aggregation q) { + this.q = q; + return this; + } + + /** + * Get q + * @return q + */ + @javax.annotation.Nullable + public Aggregation getQ() { + return q; + } + + public void setQ(@javax.annotation.Nullable Aggregation q) { + this.q = q; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RequestPayload instance itself + */ + public RequestPayload putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RequestPayload requestPayload = (RequestPayload) o; + return Objects.equals(this.from, requestPayload.from) && + Objects.equals(this.to, requestPayload.to) && + Objects.equals(this.q, requestPayload.q)&& + Objects.equals(this.additionalProperties, requestPayload.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(from, to, q, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RequestPayload {\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" q: ").append(toIndentedString(q)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("from"); + openapiFields.add("to"); + openapiFields.add("q"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 RequestPayload + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RequestPayload.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RequestPayload is not found in the empty JSON string", RequestPayload.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `q` + if (jsonObj.get("q") != null && !jsonObj.get("q").isJsonNull()) { + Aggregation.validateJsonElement(jsonObj.get("q")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!RequestPayload.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RequestPayload' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<RequestPayload> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RequestPayload.class)); + + return (TypeAdapter<T>) new TypeAdapter<RequestPayload>() { + @Override + public void write(JsonWriter out, RequestPayload value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RequestPayload read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RequestPayload instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RequestPayload given an JSON string + * + * @param jsonString JSON string + * @return An instance of RequestPayload + * @throws IOException if the JSON string is invalid with respect to RequestPayload + */ + public static RequestPayload fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RequestPayload.class); + } + + /** + * Convert an instance of RequestPayload to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ResendInvitation.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ResendInvitation.java new file mode 100644 index 0000000..62975f0 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ResendInvitation.java @@ -0,0 +1,284 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ResendInvitation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ResendInvitation { + public static final String SERIALIZED_NAME_RESENT = "Resent"; + @SerializedName(SERIALIZED_NAME_RESENT) + @javax.annotation.Nullable + private Boolean resent; + + public ResendInvitation() { + } + + public ResendInvitation resent(@javax.annotation.Nullable Boolean resent) { + this.resent = resent; + return this; + } + + /** + * Indicates whether the invitation was resent + * @return resent + */ + @javax.annotation.Nullable + public Boolean getResent() { + return resent; + } + + public void setResent(@javax.annotation.Nullable Boolean resent) { + this.resent = resent; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ResendInvitation instance itself + */ + public ResendInvitation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResendInvitation resendInvitation = (ResendInvitation) o; + return Objects.equals(this.resent, resendInvitation.resent)&& + Objects.equals(this.additionalProperties, resendInvitation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(resent, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResendInvitation {\n"); + sb.append(" resent: ").append(toIndentedString(resent)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Resent"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ResendInvitation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ResendInvitation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ResendInvitation is not found in the empty JSON string", ResendInvitation.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ResendInvitation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ResendInvitation' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ResendInvitation> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ResendInvitation.class)); + + return (TypeAdapter<T>) new TypeAdapter<ResendInvitation>() { + @Override + public void write(JsonWriter out, ResendInvitation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ResendInvitation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ResendInvitation instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ResendInvitation given an JSON string + * + * @param jsonString JSON string + * @return An instance of ResendInvitation + * @throws IOException if the JSON string is invalid with respect to ResendInvitation + */ + public static ResendInvitation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ResendInvitation.class); + } + + /** + * Convert an instance of ResendInvitation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPINByOTP.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPINByOTP.java new file mode 100644 index 0000000..3b8ecd8 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPINByOTP.java @@ -0,0 +1,539 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ResetPINByOTP + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ResetPINByOTP { + public static final String SERIALIZED_NAME_OTP = "otp"; + @SerializedName(SERIALIZED_NAME_OTP) + @javax.annotation.Nonnull + private String otp; + + public static final String SERIALIZED_NAME_PIN = "pin"; + @SerializedName(SERIALIZED_NAME_PIN) + @javax.annotation.Nonnull + private String pin; + + public static final String SERIALIZED_NAME_PHONE = "phone"; + @SerializedName(SERIALIZED_NAME_PHONE) + @javax.annotation.Nullable + private String phone; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nullable + private String username; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private String email; + + public static final String SERIALIZED_NAME_G_RECAPTCHA_RESPONSE = "g-recaptcha-response"; + @SerializedName(SERIALIZED_NAME_G_RECAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String gRecaptchaResponse; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_TICKET = "qq_captcha_ticket"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_TICKET) + @javax.annotation.Nullable + private String qqCaptchaTicket; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR = "qq_captcha_randstr"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR) + @javax.annotation.Nullable + private String qqCaptchaRandstr; + + public static final String SERIALIZED_NAME_H_CAPTCHA_RESPONSE = "h-captcha-response"; + @SerializedName(SERIALIZED_NAME_H_CAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String hCaptchaResponse; + + public ResetPINByOTP() { + } + + public ResetPINByOTP otp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + return this; + } + + /** + * One-Time Password received by the User for verification. + * @return otp + */ + @javax.annotation.Nonnull + public String getOtp() { + return otp; + } + + public void setOtp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + } + + + public ResetPINByOTP pin(@javax.annotation.Nonnull String pin) { + this.pin = pin; + return this; + } + + /** + * New PIN to be set by the User. + * @return pin + */ + @javax.annotation.Nonnull + public String getPin() { + return pin; + } + + public void setPin(@javax.annotation.Nonnull String pin) { + this.pin = pin; + } + + + public ResetPINByOTP phone(@javax.annotation.Nullable String phone) { + this.phone = phone; + return this; + } + + /** + * Phone number associated with the User's account. + * @return phone + */ + @javax.annotation.Nullable + public String getPhone() { + return phone; + } + + public void setPhone(@javax.annotation.Nullable String phone) { + this.phone = phone; + } + + + public ResetPINByOTP username(@javax.annotation.Nullable String username) { + this.username = username; + return this; + } + + /** + * Username of the User. + * @return username + */ + @javax.annotation.Nullable + public String getUsername() { + return username; + } + + public void setUsername(@javax.annotation.Nullable String username) { + this.username = username; + } + + + public ResetPINByOTP email(@javax.annotation.Nullable String email) { + this.email = email; + return this; + } + + /** + * Email address associated with the User's account. + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable String email) { + this.email = email; + } + + + public ResetPINByOTP gRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + return this; + } + + /** + * Google reCAPTCHA response. + * @return gRecaptchaResponse + */ + @javax.annotation.Nullable + public String getgRecaptchaResponse() { + return gRecaptchaResponse; + } + + public void setgRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + } + + + public ResetPINByOTP qqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + return this; + } + + /** + * QQ captcha ticket. + * @return qqCaptchaTicket + */ + @javax.annotation.Nullable + public String getQqCaptchaTicket() { + return qqCaptchaTicket; + } + + public void setQqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + } + + + public ResetPINByOTP qqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + return this; + } + + /** + * QQ captcha random string. + * @return qqCaptchaRandstr + */ + @javax.annotation.Nullable + public String getQqCaptchaRandstr() { + return qqCaptchaRandstr; + } + + public void setQqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + } + + + public ResetPINByOTP hCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + return this; + } + + /** + * hCaptcha response. + * @return hCaptchaResponse + */ + @javax.annotation.Nullable + public String gethCaptchaResponse() { + return hCaptchaResponse; + } + + public void sethCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ResetPINByOTP instance itself + */ + public ResetPINByOTP putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResetPINByOTP resetPINByOTP = (ResetPINByOTP) o; + return Objects.equals(this.otp, resetPINByOTP.otp) && + Objects.equals(this.pin, resetPINByOTP.pin) && + Objects.equals(this.phone, resetPINByOTP.phone) && + Objects.equals(this.username, resetPINByOTP.username) && + Objects.equals(this.email, resetPINByOTP.email) && + Objects.equals(this.gRecaptchaResponse, resetPINByOTP.gRecaptchaResponse) && + Objects.equals(this.qqCaptchaTicket, resetPINByOTP.qqCaptchaTicket) && + Objects.equals(this.qqCaptchaRandstr, resetPINByOTP.qqCaptchaRandstr) && + Objects.equals(this.hCaptchaResponse, resetPINByOTP.hCaptchaResponse)&& + Objects.equals(this.additionalProperties, resetPINByOTP.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(otp, pin, phone, username, email, gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResetPINByOTP {\n"); + sb.append(" otp: ").append(toIndentedString(otp)).append("\n"); + sb.append(" pin: ").append(toIndentedString(pin)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" gRecaptchaResponse: ").append(toIndentedString(gRecaptchaResponse)).append("\n"); + sb.append(" qqCaptchaTicket: ").append(toIndentedString(qqCaptchaTicket)).append("\n"); + sb.append(" qqCaptchaRandstr: ").append(toIndentedString(qqCaptchaRandstr)).append("\n"); + sb.append(" hCaptchaResponse: ").append(toIndentedString(hCaptchaResponse)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("otp"); + openapiRequiredFields.add("pin"); + } + + /** + * 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 ResetPINByOTP + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ResetPINByOTP.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ResetPINByOTP is not found in the empty JSON string", ResetPINByOTP.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ResetPINByOTP.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("otp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `otp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("otp").toString())); + } + if (!jsonObj.get("pin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pin").toString())); + } + if ((jsonObj.get("phone") != null && !jsonObj.get("phone").isJsonNull()) && !jsonObj.get("phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phone").toString())); + } + if ((jsonObj.get("username") != null && !jsonObj.get("username").isJsonNull()) && !jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("g-recaptcha-response") != null && !jsonObj.get("g-recaptcha-response").isJsonNull()) && !jsonObj.get("g-recaptcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `g-recaptcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("g-recaptcha-response").toString())); + } + if ((jsonObj.get("qq_captcha_ticket") != null && !jsonObj.get("qq_captcha_ticket").isJsonNull()) && !jsonObj.get("qq_captcha_ticket").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_ticket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_ticket").toString())); + } + if ((jsonObj.get("qq_captcha_randstr") != null && !jsonObj.get("qq_captcha_randstr").isJsonNull()) && !jsonObj.get("qq_captcha_randstr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_randstr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_randstr").toString())); + } + if ((jsonObj.get("h-captcha-response") != null && !jsonObj.get("h-captcha-response").isJsonNull()) && !jsonObj.get("h-captcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `h-captcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("h-captcha-response").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ResetPINByOTP.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ResetPINByOTP' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ResetPINByOTP> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ResetPINByOTP.class)); + + return (TypeAdapter<T>) new TypeAdapter<ResetPINByOTP>() { + @Override + public void write(JsonWriter out, ResetPINByOTP value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ResetPINByOTP read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ResetPINByOTP instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ResetPINByOTP given an JSON string + * + * @param jsonString JSON string + * @return An instance of ResetPINByOTP + * @throws IOException if the JSON string is invalid with respect to ResetPINByOTP + */ + public static ResetPINByOTP fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ResetPINByOTP.class); + } + + /** + * Convert an instance of ResetPINByOTP to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPINByToken.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPINByToken.java new file mode 100644 index 0000000..edadb62 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPINByToken.java @@ -0,0 +1,326 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ResetPINByToken + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ResetPINByToken { + public static final String SERIALIZED_NAME_RESETTOKEN = "resettoken"; + @SerializedName(SERIALIZED_NAME_RESETTOKEN) + @javax.annotation.Nonnull + private String resettoken; + + public static final String SERIALIZED_NAME_PIN = "pin"; + @SerializedName(SERIALIZED_NAME_PIN) + @javax.annotation.Nonnull + private String pin; + + public ResetPINByToken() { + } + + public ResetPINByToken resettoken(@javax.annotation.Nonnull String resettoken) { + this.resettoken = resettoken; + return this; + } + + /** + * The reset token received via Email. + * @return resettoken + */ + @javax.annotation.Nonnull + public String getResettoken() { + return resettoken; + } + + public void setResettoken(@javax.annotation.Nonnull String resettoken) { + this.resettoken = resettoken; + } + + + public ResetPINByToken pin(@javax.annotation.Nonnull String pin) { + this.pin = pin; + return this; + } + + /** + * New PIN to be set by the User. + * @return pin + */ + @javax.annotation.Nonnull + public String getPin() { + return pin; + } + + public void setPin(@javax.annotation.Nonnull String pin) { + this.pin = pin; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ResetPINByToken instance itself + */ + public ResetPINByToken putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResetPINByToken resetPINByToken = (ResetPINByToken) o; + return Objects.equals(this.resettoken, resetPINByToken.resettoken) && + Objects.equals(this.pin, resetPINByToken.pin)&& + Objects.equals(this.additionalProperties, resetPINByToken.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(resettoken, pin, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResetPINByToken {\n"); + sb.append(" resettoken: ").append(toIndentedString(resettoken)).append("\n"); + sb.append(" pin: ").append(toIndentedString(pin)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("resettoken"); + openapiFields.add("pin"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("resettoken"); + openapiRequiredFields.add("pin"); + } + + /** + * 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 ResetPINByToken + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ResetPINByToken.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ResetPINByToken is not found in the empty JSON string", ResetPINByToken.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ResetPINByToken.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("resettoken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `resettoken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resettoken").toString())); + } + if (!jsonObj.get("pin").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `pin` to be a primitive type in the JSON string but got `%s`", jsonObj.get("pin").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ResetPINByToken.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ResetPINByToken' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ResetPINByToken> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ResetPINByToken.class)); + + return (TypeAdapter<T>) new TypeAdapter<ResetPINByToken>() { + @Override + public void write(JsonWriter out, ResetPINByToken value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ResetPINByToken read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ResetPINByToken instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ResetPINByToken given an JSON string + * + * @param jsonString JSON string + * @return An instance of ResetPINByToken + * @throws IOException if the JSON string is invalid with respect to ResetPINByToken + */ + public static ResetPINByToken fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ResetPINByToken.class); + } + + /** + * Convert an instance of ResetPINByToken to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPassword.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPassword.java new file mode 100644 index 0000000..956b989 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPassword.java @@ -0,0 +1,323 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ResetPasswordOneOf; +import com.loginradius.sdk.internal.openapi.model.ResetPasswordOneOf1; +import com.loginradius.sdk.internal.openapi.model.ResetPasswordOneOf2; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ResetPassword extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(ResetPassword.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ResetPassword.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ResetPassword' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ResetPasswordOneOf> adapterResetPasswordOneOf = gson.getDelegateAdapter(this, TypeToken.get(ResetPasswordOneOf.class)); + final TypeAdapter<ResetPasswordOneOf1> adapterResetPasswordOneOf1 = gson.getDelegateAdapter(this, TypeToken.get(ResetPasswordOneOf1.class)); + final TypeAdapter<ResetPasswordOneOf2> adapterResetPasswordOneOf2 = gson.getDelegateAdapter(this, TypeToken.get(ResetPasswordOneOf2.class)); + + return (TypeAdapter<T>) new TypeAdapter<ResetPassword>() { + @Override + public void write(JsonWriter out, ResetPassword value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `ResetPasswordOneOf` + if (value.getActualInstance() instanceof ResetPasswordOneOf) { + JsonElement element = adapterResetPasswordOneOf.toJsonTree((ResetPasswordOneOf)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `ResetPasswordOneOf1` + if (value.getActualInstance() instanceof ResetPasswordOneOf1) { + JsonElement element = adapterResetPasswordOneOf1.toJsonTree((ResetPasswordOneOf1)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `ResetPasswordOneOf2` + if (value.getActualInstance() instanceof ResetPasswordOneOf2) { + JsonElement element = adapterResetPasswordOneOf2.toJsonTree((ResetPasswordOneOf2)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: ResetPasswordOneOf, ResetPasswordOneOf1, ResetPasswordOneOf2"); + } + + @Override + public ResetPassword read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize ResetPasswordOneOf + try { + // validate the JSON object to see if any exception is thrown + ResetPasswordOneOf.validateJsonElement(jsonElement); + actualAdapter = adapterResetPasswordOneOf; + match++; + log.log(Level.FINER, "Input data matches schema 'ResetPasswordOneOf'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for ResetPasswordOneOf failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'ResetPasswordOneOf'", e); + } + // deserialize ResetPasswordOneOf1 + try { + // validate the JSON object to see if any exception is thrown + ResetPasswordOneOf1.validateJsonElement(jsonElement); + actualAdapter = adapterResetPasswordOneOf1; + match++; + log.log(Level.FINER, "Input data matches schema 'ResetPasswordOneOf1'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for ResetPasswordOneOf1 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'ResetPasswordOneOf1'", e); + } + // deserialize ResetPasswordOneOf2 + try { + // validate the JSON object to see if any exception is thrown + ResetPasswordOneOf2.validateJsonElement(jsonElement); + actualAdapter = adapterResetPasswordOneOf2; + match++; + log.log(Level.FINER, "Input data matches schema 'ResetPasswordOneOf2'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for ResetPasswordOneOf2 failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'ResetPasswordOneOf2'", e); + } + + if (match == 1) { + ResetPassword ret = new ResetPassword(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for ResetPassword: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public ResetPassword() { + super("oneOf", Boolean.FALSE); + } + + public ResetPassword(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("ResetPasswordOneOf", ResetPasswordOneOf.class); + schemas.put("ResetPasswordOneOf1", ResetPasswordOneOf1.class); + schemas.put("ResetPasswordOneOf2", ResetPasswordOneOf2.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return ResetPassword.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * ResetPasswordOneOf, ResetPasswordOneOf1, ResetPasswordOneOf2 + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof ResetPasswordOneOf) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ResetPasswordOneOf1) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof ResetPasswordOneOf2) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be ResetPasswordOneOf, ResetPasswordOneOf1, ResetPasswordOneOf2"); + } + + /** + * Get the actual instance, which can be the following: + * ResetPasswordOneOf, ResetPasswordOneOf1, ResetPasswordOneOf2 + * + * @return The actual instance (ResetPasswordOneOf, ResetPasswordOneOf1, ResetPasswordOneOf2) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `ResetPasswordOneOf`. If the actual instance is not `ResetPasswordOneOf`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ResetPasswordOneOf` + * @throws ClassCastException if the instance is not `ResetPasswordOneOf` + */ + public ResetPasswordOneOf getResetPasswordOneOf() throws ClassCastException { + return (ResetPasswordOneOf)super.getActualInstance(); + } + + /** + * Get the actual instance of `ResetPasswordOneOf1`. If the actual instance is not `ResetPasswordOneOf1`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ResetPasswordOneOf1` + * @throws ClassCastException if the instance is not `ResetPasswordOneOf1` + */ + public ResetPasswordOneOf1 getResetPasswordOneOf1() throws ClassCastException { + return (ResetPasswordOneOf1)super.getActualInstance(); + } + + /** + * Get the actual instance of `ResetPasswordOneOf2`. If the actual instance is not `ResetPasswordOneOf2`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `ResetPasswordOneOf2` + * @throws ClassCastException if the instance is not `ResetPasswordOneOf2` + */ + public ResetPasswordOneOf2 getResetPasswordOneOf2() throws ClassCastException { + return (ResetPasswordOneOf2)super.getActualInstance(); + } + + /** + * 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 ResetPassword + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with ResetPasswordOneOf + try { + ResetPasswordOneOf.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for ResetPasswordOneOf failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with ResetPasswordOneOf1 + try { + ResetPasswordOneOf1.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for ResetPasswordOneOf1 failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with ResetPasswordOneOf2 + try { + ResetPasswordOneOf2.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for ResetPasswordOneOf2 failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for ResetPassword with oneOf schemas: ResetPasswordOneOf, ResetPasswordOneOf1, ResetPasswordOneOf2. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of ResetPassword given an JSON string + * + * @param jsonString JSON string + * @return An instance of ResetPassword + * @throws IOException if the JSON string is invalid with respect to ResetPassword + */ + public static ResetPassword fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ResetPassword.class); + } + + /** + * Convert an instance of ResetPassword to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPasswordByEmailOtpCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPasswordByEmailOtpCore.java new file mode 100644 index 0000000..42c41e6 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPasswordByEmailOtpCore.java @@ -0,0 +1,466 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ResetPasswordByEmailOtpCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ResetPasswordByEmailOtpCore { + public static final String SERIALIZED_NAME_OTP = "otp"; + @SerializedName(SERIALIZED_NAME_OTP) + @javax.annotation.Nonnull + private String otp; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nonnull + private String email; + + public static final String SERIALIZED_NAME_PASSWORD = "Password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nonnull + private String password; + + public static final String SERIALIZED_NAME_WELCOMEEMAILTEMPLATE = "welcomeemailtemplate"; + @SerializedName(SERIALIZED_NAME_WELCOMEEMAILTEMPLATE) + @javax.annotation.Nullable + private String welcomeemailtemplate; + + public static final String SERIALIZED_NAME_RESET_PASSWORD_EMAIL_TEMPLATE = "ResetPasswordEmailTemplate"; + @SerializedName(SERIALIZED_NAME_RESET_PASSWORD_EMAIL_TEMPLATE) + @javax.annotation.Nullable + private String resetPasswordEmailTemplate; + + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer; + + public ResetPasswordByEmailOtpCore() { + } + + public ResetPasswordByEmailOtpCore otp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + return this; + } + + /** + * One-time passcode sent to the User's Email. + * @return otp + */ + @javax.annotation.Nonnull + public String getOtp() { + return otp; + } + + public void setOtp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + } + + + public ResetPasswordByEmailOtpCore email(@javax.annotation.Nonnull String email) { + this.email = email; + return this; + } + + /** + * User's Email address. + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nonnull String email) { + this.email = email; + } + + + public ResetPasswordByEmailOtpCore password(@javax.annotation.Nonnull String password) { + this.password = password; + return this; + } + + /** + * The new Password for the Account. + * @return password + */ + @javax.annotation.Nonnull + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nonnull String password) { + this.password = password; + } + + + public ResetPasswordByEmailOtpCore welcomeemailtemplate(@javax.annotation.Nullable String welcomeemailtemplate) { + this.welcomeemailtemplate = welcomeemailtemplate; + return this; + } + + /** + * Optional welcome Email template. + * @return welcomeemailtemplate + */ + @javax.annotation.Nullable + public String getWelcomeemailtemplate() { + return welcomeemailtemplate; + } + + public void setWelcomeemailtemplate(@javax.annotation.Nullable String welcomeemailtemplate) { + this.welcomeemailtemplate = welcomeemailtemplate; + } + + + public ResetPasswordByEmailOtpCore resetPasswordEmailTemplate(@javax.annotation.Nullable String resetPasswordEmailTemplate) { + this.resetPasswordEmailTemplate = resetPasswordEmailTemplate; + return this; + } + + /** + * Optional reset Password Email template. + * @return resetPasswordEmailTemplate + */ + @javax.annotation.Nullable + public String getResetPasswordEmailTemplate() { + return resetPasswordEmailTemplate; + } + + public void setResetPasswordEmailTemplate(@javax.annotation.Nullable String resetPasswordEmailTemplate) { + this.resetPasswordEmailTemplate = resetPasswordEmailTemplate; + } + + + public ResetPasswordByEmailOtpCore securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public ResetPasswordByEmailOtpCore putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * A map of security question keys and their corresponding answers. + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ResetPasswordByEmailOtpCore instance itself + */ + public ResetPasswordByEmailOtpCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResetPasswordByEmailOtpCore resetPasswordByEmailOtpCore = (ResetPasswordByEmailOtpCore) o; + return Objects.equals(this.otp, resetPasswordByEmailOtpCore.otp) && + Objects.equals(this.email, resetPasswordByEmailOtpCore.email) && + Objects.equals(this.password, resetPasswordByEmailOtpCore.password) && + Objects.equals(this.welcomeemailtemplate, resetPasswordByEmailOtpCore.welcomeemailtemplate) && + Objects.equals(this.resetPasswordEmailTemplate, resetPasswordByEmailOtpCore.resetPasswordEmailTemplate) && + Objects.equals(this.securityAnswer, resetPasswordByEmailOtpCore.securityAnswer)&& + Objects.equals(this.additionalProperties, resetPasswordByEmailOtpCore.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(otp, email, password, welcomeemailtemplate, resetPasswordEmailTemplate, securityAnswer, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResetPasswordByEmailOtpCore {\n"); + sb.append(" otp: ").append(toIndentedString(otp)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" welcomeemailtemplate: ").append(toIndentedString(welcomeemailtemplate)).append("\n"); + sb.append(" resetPasswordEmailTemplate: ").append(toIndentedString(resetPasswordEmailTemplate)).append("\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("otp"); + openapiFields.add("email"); + openapiFields.add("Password"); + openapiFields.add("welcomeemailtemplate"); + openapiFields.add("ResetPasswordEmailTemplate"); + openapiFields.add("SecurityAnswer"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("otp"); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("Password"); + } + + /** + * 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 ResetPasswordByEmailOtpCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ResetPasswordByEmailOtpCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ResetPasswordByEmailOtpCore is not found in the empty JSON string", ResetPasswordByEmailOtpCore.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ResetPasswordByEmailOtpCore.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("otp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `otp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("otp").toString())); + } + if (!jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if (!jsonObj.get("Password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Password").toString())); + } + if ((jsonObj.get("welcomeemailtemplate") != null && !jsonObj.get("welcomeemailtemplate").isJsonNull()) && !jsonObj.get("welcomeemailtemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `welcomeemailtemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("welcomeemailtemplate").toString())); + } + if ((jsonObj.get("ResetPasswordEmailTemplate") != null && !jsonObj.get("ResetPasswordEmailTemplate").isJsonNull()) && !jsonObj.get("ResetPasswordEmailTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ResetPasswordEmailTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ResetPasswordEmailTemplate").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ResetPasswordByEmailOtpCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ResetPasswordByEmailOtpCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ResetPasswordByEmailOtpCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ResetPasswordByEmailOtpCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<ResetPasswordByEmailOtpCore>() { + @Override + public void write(JsonWriter out, ResetPasswordByEmailOtpCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ResetPasswordByEmailOtpCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ResetPasswordByEmailOtpCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ResetPasswordByEmailOtpCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of ResetPasswordByEmailOtpCore + * @throws IOException if the JSON string is invalid with respect to ResetPasswordByEmailOtpCore + */ + public static ResetPasswordByEmailOtpCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ResetPasswordByEmailOtpCore.class); + } + + /** + * Convert an instance of ResetPasswordByEmailOtpCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPasswordByResetTokenCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPasswordByResetTokenCore.java new file mode 100644 index 0000000..1b5889a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPasswordByResetTokenCore.java @@ -0,0 +1,435 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ResetPasswordByResetTokenCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ResetPasswordByResetTokenCore { + public static final String SERIALIZED_NAME_RESET_TOKEN = "ResetToken"; + @SerializedName(SERIALIZED_NAME_RESET_TOKEN) + @javax.annotation.Nonnull + private String resetToken; + + public static final String SERIALIZED_NAME_PASSWORD = "Password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nonnull + private String password; + + public static final String SERIALIZED_NAME_WELCOMEEMAILTEMPLATE = "welcomeemailtemplate"; + @SerializedName(SERIALIZED_NAME_WELCOMEEMAILTEMPLATE) + @javax.annotation.Nullable + private String welcomeemailtemplate; + + public static final String SERIALIZED_NAME_RESET_PASSWORD_EMAIL_TEMPLATE = "ResetPasswordEmailTemplate"; + @SerializedName(SERIALIZED_NAME_RESET_PASSWORD_EMAIL_TEMPLATE) + @javax.annotation.Nullable + private String resetPasswordEmailTemplate; + + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer; + + public ResetPasswordByResetTokenCore() { + } + + public ResetPasswordByResetTokenCore resetToken(@javax.annotation.Nonnull String resetToken) { + this.resetToken = resetToken; + return this; + } + + /** + * The reset token received via Email. + * @return resetToken + */ + @javax.annotation.Nonnull + public String getResetToken() { + return resetToken; + } + + public void setResetToken(@javax.annotation.Nonnull String resetToken) { + this.resetToken = resetToken; + } + + + public ResetPasswordByResetTokenCore password(@javax.annotation.Nonnull String password) { + this.password = password; + return this; + } + + /** + * The new Password for the Account. + * @return password + */ + @javax.annotation.Nonnull + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nonnull String password) { + this.password = password; + } + + + public ResetPasswordByResetTokenCore welcomeemailtemplate(@javax.annotation.Nullable String welcomeemailtemplate) { + this.welcomeemailtemplate = welcomeemailtemplate; + return this; + } + + /** + * Optional welcome Email template. + * @return welcomeemailtemplate + */ + @javax.annotation.Nullable + public String getWelcomeemailtemplate() { + return welcomeemailtemplate; + } + + public void setWelcomeemailtemplate(@javax.annotation.Nullable String welcomeemailtemplate) { + this.welcomeemailtemplate = welcomeemailtemplate; + } + + + public ResetPasswordByResetTokenCore resetPasswordEmailTemplate(@javax.annotation.Nullable String resetPasswordEmailTemplate) { + this.resetPasswordEmailTemplate = resetPasswordEmailTemplate; + return this; + } + + /** + * Optional reset Password Email template. + * @return resetPasswordEmailTemplate + */ + @javax.annotation.Nullable + public String getResetPasswordEmailTemplate() { + return resetPasswordEmailTemplate; + } + + public void setResetPasswordEmailTemplate(@javax.annotation.Nullable String resetPasswordEmailTemplate) { + this.resetPasswordEmailTemplate = resetPasswordEmailTemplate; + } + + + public ResetPasswordByResetTokenCore securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public ResetPasswordByResetTokenCore putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * A map of security question keys and their corresponding answers. + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ResetPasswordByResetTokenCore instance itself + */ + public ResetPasswordByResetTokenCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResetPasswordByResetTokenCore resetPasswordByResetTokenCore = (ResetPasswordByResetTokenCore) o; + return Objects.equals(this.resetToken, resetPasswordByResetTokenCore.resetToken) && + Objects.equals(this.password, resetPasswordByResetTokenCore.password) && + Objects.equals(this.welcomeemailtemplate, resetPasswordByResetTokenCore.welcomeemailtemplate) && + Objects.equals(this.resetPasswordEmailTemplate, resetPasswordByResetTokenCore.resetPasswordEmailTemplate) && + Objects.equals(this.securityAnswer, resetPasswordByResetTokenCore.securityAnswer)&& + Objects.equals(this.additionalProperties, resetPasswordByResetTokenCore.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(resetToken, password, welcomeemailtemplate, resetPasswordEmailTemplate, securityAnswer, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResetPasswordByResetTokenCore {\n"); + sb.append(" resetToken: ").append(toIndentedString(resetToken)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" welcomeemailtemplate: ").append(toIndentedString(welcomeemailtemplate)).append("\n"); + sb.append(" resetPasswordEmailTemplate: ").append(toIndentedString(resetPasswordEmailTemplate)).append("\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ResetToken"); + openapiFields.add("Password"); + openapiFields.add("welcomeemailtemplate"); + openapiFields.add("ResetPasswordEmailTemplate"); + openapiFields.add("SecurityAnswer"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("ResetToken"); + openapiRequiredFields.add("Password"); + } + + /** + * 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 ResetPasswordByResetTokenCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ResetPasswordByResetTokenCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ResetPasswordByResetTokenCore is not found in the empty JSON string", ResetPasswordByResetTokenCore.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ResetPasswordByResetTokenCore.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("ResetToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ResetToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ResetToken").toString())); + } + if (!jsonObj.get("Password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Password").toString())); + } + if ((jsonObj.get("welcomeemailtemplate") != null && !jsonObj.get("welcomeemailtemplate").isJsonNull()) && !jsonObj.get("welcomeemailtemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `welcomeemailtemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("welcomeemailtemplate").toString())); + } + if ((jsonObj.get("ResetPasswordEmailTemplate") != null && !jsonObj.get("ResetPasswordEmailTemplate").isJsonNull()) && !jsonObj.get("ResetPasswordEmailTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ResetPasswordEmailTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ResetPasswordEmailTemplate").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ResetPasswordByResetTokenCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ResetPasswordByResetTokenCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ResetPasswordByResetTokenCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ResetPasswordByResetTokenCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<ResetPasswordByResetTokenCore>() { + @Override + public void write(JsonWriter out, ResetPasswordByResetTokenCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ResetPasswordByResetTokenCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ResetPasswordByResetTokenCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ResetPasswordByResetTokenCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of ResetPasswordByResetTokenCore + * @throws IOException if the JSON string is invalid with respect to ResetPasswordByResetTokenCore + */ + public static ResetPasswordByResetTokenCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ResetPasswordByResetTokenCore.class); + } + + /** + * Convert an instance of ResetPasswordByResetTokenCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPasswordBySecurityAnswer.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPasswordBySecurityAnswer.java new file mode 100644 index 0000000..bcc10ee --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPasswordBySecurityAnswer.java @@ -0,0 +1,483 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ResetPasswordBySecurityAnswer + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ResetPasswordBySecurityAnswer { + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nonnull + private Map<String, String> securityAnswer = new HashMap<>(); + + public static final String SERIALIZED_NAME_RESET_PASSWORD_EMAIL_TEMPLATE = "ResetPasswordEmailTemplate"; + @SerializedName(SERIALIZED_NAME_RESET_PASSWORD_EMAIL_TEMPLATE) + @javax.annotation.Nullable + private String resetPasswordEmailTemplate; + + public static final String SERIALIZED_NAME_PASSWORD = "password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nonnull + private String password; + + public static final String SERIALIZED_NAME_PHONE = "Phone"; + @SerializedName(SERIALIZED_NAME_PHONE) + @javax.annotation.Nullable + private String phone; + + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private String email; + + public static final String SERIALIZED_NAME_USER_NAME = "UserName"; + @SerializedName(SERIALIZED_NAME_USER_NAME) + @javax.annotation.Nullable + private String userName; + + public static final String SERIALIZED_NAME_USERID = "userid"; + @SerializedName(SERIALIZED_NAME_USERID) + @javax.annotation.Nullable + private String userid; + + public ResetPasswordBySecurityAnswer() { + } + + public ResetPasswordBySecurityAnswer securityAnswer(@javax.annotation.Nonnull Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public ResetPasswordBySecurityAnswer putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * A map of question IDs or keys to answers + * @return securityAnswer + */ + @javax.annotation.Nonnull + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nonnull Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + + public ResetPasswordBySecurityAnswer resetPasswordEmailTemplate(@javax.annotation.Nullable String resetPasswordEmailTemplate) { + this.resetPasswordEmailTemplate = resetPasswordEmailTemplate; + return this; + } + + /** + * Optional Email template to use for Password reset + * @return resetPasswordEmailTemplate + */ + @javax.annotation.Nullable + public String getResetPasswordEmailTemplate() { + return resetPasswordEmailTemplate; + } + + public void setResetPasswordEmailTemplate(@javax.annotation.Nullable String resetPasswordEmailTemplate) { + this.resetPasswordEmailTemplate = resetPasswordEmailTemplate; + } + + + public ResetPasswordBySecurityAnswer password(@javax.annotation.Nonnull String password) { + this.password = password; + return this; + } + + /** + * New Password to set + * @return password + */ + @javax.annotation.Nonnull + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nonnull String password) { + this.password = password; + } + + + public ResetPasswordBySecurityAnswer phone(@javax.annotation.Nullable String phone) { + this.phone = phone; + return this; + } + + /** + * User's Phone number + * @return phone + */ + @javax.annotation.Nullable + public String getPhone() { + return phone; + } + + public void setPhone(@javax.annotation.Nullable String phone) { + this.phone = phone; + } + + + public ResetPasswordBySecurityAnswer email(@javax.annotation.Nullable String email) { + this.email = email; + return this; + } + + /** + * User's Email address + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable String email) { + this.email = email; + } + + + public ResetPasswordBySecurityAnswer userName(@javax.annotation.Nullable String userName) { + this.userName = userName; + return this; + } + + /** + * Optional username + * @return userName + */ + @javax.annotation.Nullable + public String getUserName() { + return userName; + } + + public void setUserName(@javax.annotation.Nullable String userName) { + this.userName = userName; + } + + + public ResetPasswordBySecurityAnswer userid(@javax.annotation.Nullable String userid) { + this.userid = userid; + return this; + } + + /** + * Optional User ID + * @return userid + */ + @javax.annotation.Nullable + public String getUserid() { + return userid; + } + + public void setUserid(@javax.annotation.Nullable String userid) { + this.userid = userid; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ResetPasswordBySecurityAnswer instance itself + */ + public ResetPasswordBySecurityAnswer putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResetPasswordBySecurityAnswer resetPasswordBySecurityAnswer = (ResetPasswordBySecurityAnswer) o; + return Objects.equals(this.securityAnswer, resetPasswordBySecurityAnswer.securityAnswer) && + Objects.equals(this.resetPasswordEmailTemplate, resetPasswordBySecurityAnswer.resetPasswordEmailTemplate) && + Objects.equals(this.password, resetPasswordBySecurityAnswer.password) && + Objects.equals(this.phone, resetPasswordBySecurityAnswer.phone) && + Objects.equals(this.email, resetPasswordBySecurityAnswer.email) && + Objects.equals(this.userName, resetPasswordBySecurityAnswer.userName) && + Objects.equals(this.userid, resetPasswordBySecurityAnswer.userid)&& + Objects.equals(this.additionalProperties, resetPasswordBySecurityAnswer.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(securityAnswer, resetPasswordEmailTemplate, password, phone, email, userName, userid, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResetPasswordBySecurityAnswer {\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" resetPasswordEmailTemplate: ").append(toIndentedString(resetPasswordEmailTemplate)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" userName: ").append(toIndentedString(userName)).append("\n"); + sb.append(" userid: ").append(toIndentedString(userid)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("SecurityAnswer"); + openapiFields.add("ResetPasswordEmailTemplate"); + openapiFields.add("password"); + openapiFields.add("Phone"); + openapiFields.add("Email"); + openapiFields.add("UserName"); + openapiFields.add("userid"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("SecurityAnswer"); + openapiRequiredFields.add("password"); + } + + /** + * 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 ResetPasswordBySecurityAnswer + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ResetPasswordBySecurityAnswer.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ResetPasswordBySecurityAnswer is not found in the empty JSON string", ResetPasswordBySecurityAnswer.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ResetPasswordBySecurityAnswer.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("ResetPasswordEmailTemplate") != null && !jsonObj.get("ResetPasswordEmailTemplate").isJsonNull()) && !jsonObj.get("ResetPasswordEmailTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ResetPasswordEmailTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ResetPasswordEmailTemplate").toString())); + } + if (!jsonObj.get("password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("password").toString())); + } + if ((jsonObj.get("Phone") != null && !jsonObj.get("Phone").isJsonNull()) && !jsonObj.get("Phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Phone").toString())); + } + if ((jsonObj.get("Email") != null && !jsonObj.get("Email").isJsonNull()) && !jsonObj.get("Email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Email").toString())); + } + if ((jsonObj.get("UserName") != null && !jsonObj.get("UserName").isJsonNull()) && !jsonObj.get("UserName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UserName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UserName").toString())); + } + if ((jsonObj.get("userid") != null && !jsonObj.get("userid").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ResetPasswordBySecurityAnswer.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ResetPasswordBySecurityAnswer' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ResetPasswordBySecurityAnswer> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ResetPasswordBySecurityAnswer.class)); + + return (TypeAdapter<T>) new TypeAdapter<ResetPasswordBySecurityAnswer>() { + @Override + public void write(JsonWriter out, ResetPasswordBySecurityAnswer value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ResetPasswordBySecurityAnswer read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ResetPasswordBySecurityAnswer instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ResetPasswordBySecurityAnswer given an JSON string + * + * @param jsonString JSON string + * @return An instance of ResetPasswordBySecurityAnswer + * @throws IOException if the JSON string is invalid with respect to ResetPasswordBySecurityAnswer + */ + public static ResetPasswordBySecurityAnswer fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ResetPasswordBySecurityAnswer.class); + } + + /** + * Convert an instance of ResetPasswordBySecurityAnswer to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPasswordByUsernameOtpCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPasswordByUsernameOtpCore.java new file mode 100644 index 0000000..79710ec --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPasswordByUsernameOtpCore.java @@ -0,0 +1,466 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ResetPasswordByUsernameOtpCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ResetPasswordByUsernameOtpCore { + public static final String SERIALIZED_NAME_OTP = "otp"; + @SerializedName(SERIALIZED_NAME_OTP) + @javax.annotation.Nonnull + private String otp; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nonnull + private String username; + + public static final String SERIALIZED_NAME_PASSWORD = "Password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nonnull + private String password; + + public static final String SERIALIZED_NAME_WELCOMEEMAILTEMPLATE = "welcomeemailtemplate"; + @SerializedName(SERIALIZED_NAME_WELCOMEEMAILTEMPLATE) + @javax.annotation.Nullable + private String welcomeemailtemplate; + + public static final String SERIALIZED_NAME_RESET_PASSWORD_EMAIL_TEMPLATE = "ResetPasswordEmailTemplate"; + @SerializedName(SERIALIZED_NAME_RESET_PASSWORD_EMAIL_TEMPLATE) + @javax.annotation.Nullable + private String resetPasswordEmailTemplate; + + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer; + + public ResetPasswordByUsernameOtpCore() { + } + + public ResetPasswordByUsernameOtpCore otp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + return this; + } + + /** + * One-Time Password for verification. + * @return otp + */ + @javax.annotation.Nonnull + public String getOtp() { + return otp; + } + + public void setOtp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + } + + + public ResetPasswordByUsernameOtpCore username(@javax.annotation.Nonnull String username) { + this.username = username; + return this; + } + + /** + * Username of the Account. + * @return username + */ + @javax.annotation.Nonnull + public String getUsername() { + return username; + } + + public void setUsername(@javax.annotation.Nonnull String username) { + this.username = username; + } + + + public ResetPasswordByUsernameOtpCore password(@javax.annotation.Nonnull String password) { + this.password = password; + return this; + } + + /** + * The new Password for the Account. + * @return password + */ + @javax.annotation.Nonnull + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nonnull String password) { + this.password = password; + } + + + public ResetPasswordByUsernameOtpCore welcomeemailtemplate(@javax.annotation.Nullable String welcomeemailtemplate) { + this.welcomeemailtemplate = welcomeemailtemplate; + return this; + } + + /** + * Optional welcome Email template. + * @return welcomeemailtemplate + */ + @javax.annotation.Nullable + public String getWelcomeemailtemplate() { + return welcomeemailtemplate; + } + + public void setWelcomeemailtemplate(@javax.annotation.Nullable String welcomeemailtemplate) { + this.welcomeemailtemplate = welcomeemailtemplate; + } + + + public ResetPasswordByUsernameOtpCore resetPasswordEmailTemplate(@javax.annotation.Nullable String resetPasswordEmailTemplate) { + this.resetPasswordEmailTemplate = resetPasswordEmailTemplate; + return this; + } + + /** + * Optional reset Password Email template. + * @return resetPasswordEmailTemplate + */ + @javax.annotation.Nullable + public String getResetPasswordEmailTemplate() { + return resetPasswordEmailTemplate; + } + + public void setResetPasswordEmailTemplate(@javax.annotation.Nullable String resetPasswordEmailTemplate) { + this.resetPasswordEmailTemplate = resetPasswordEmailTemplate; + } + + + public ResetPasswordByUsernameOtpCore securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public ResetPasswordByUsernameOtpCore putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * A map of security question keys and their corresponding answers. + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ResetPasswordByUsernameOtpCore instance itself + */ + public ResetPasswordByUsernameOtpCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResetPasswordByUsernameOtpCore resetPasswordByUsernameOtpCore = (ResetPasswordByUsernameOtpCore) o; + return Objects.equals(this.otp, resetPasswordByUsernameOtpCore.otp) && + Objects.equals(this.username, resetPasswordByUsernameOtpCore.username) && + Objects.equals(this.password, resetPasswordByUsernameOtpCore.password) && + Objects.equals(this.welcomeemailtemplate, resetPasswordByUsernameOtpCore.welcomeemailtemplate) && + Objects.equals(this.resetPasswordEmailTemplate, resetPasswordByUsernameOtpCore.resetPasswordEmailTemplate) && + Objects.equals(this.securityAnswer, resetPasswordByUsernameOtpCore.securityAnswer)&& + Objects.equals(this.additionalProperties, resetPasswordByUsernameOtpCore.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(otp, username, password, welcomeemailtemplate, resetPasswordEmailTemplate, securityAnswer, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResetPasswordByUsernameOtpCore {\n"); + sb.append(" otp: ").append(toIndentedString(otp)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" welcomeemailtemplate: ").append(toIndentedString(welcomeemailtemplate)).append("\n"); + sb.append(" resetPasswordEmailTemplate: ").append(toIndentedString(resetPasswordEmailTemplate)).append("\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("otp"); + openapiFields.add("username"); + openapiFields.add("Password"); + openapiFields.add("welcomeemailtemplate"); + openapiFields.add("ResetPasswordEmailTemplate"); + openapiFields.add("SecurityAnswer"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("otp"); + openapiRequiredFields.add("username"); + openapiRequiredFields.add("Password"); + } + + /** + * 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 ResetPasswordByUsernameOtpCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ResetPasswordByUsernameOtpCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ResetPasswordByUsernameOtpCore is not found in the empty JSON string", ResetPasswordByUsernameOtpCore.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ResetPasswordByUsernameOtpCore.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("otp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `otp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("otp").toString())); + } + if (!jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + if (!jsonObj.get("Password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Password").toString())); + } + if ((jsonObj.get("welcomeemailtemplate") != null && !jsonObj.get("welcomeemailtemplate").isJsonNull()) && !jsonObj.get("welcomeemailtemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `welcomeemailtemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("welcomeemailtemplate").toString())); + } + if ((jsonObj.get("ResetPasswordEmailTemplate") != null && !jsonObj.get("ResetPasswordEmailTemplate").isJsonNull()) && !jsonObj.get("ResetPasswordEmailTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ResetPasswordEmailTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ResetPasswordEmailTemplate").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ResetPasswordByUsernameOtpCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ResetPasswordByUsernameOtpCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ResetPasswordByUsernameOtpCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ResetPasswordByUsernameOtpCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<ResetPasswordByUsernameOtpCore>() { + @Override + public void write(JsonWriter out, ResetPasswordByUsernameOtpCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ResetPasswordByUsernameOtpCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ResetPasswordByUsernameOtpCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ResetPasswordByUsernameOtpCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of ResetPasswordByUsernameOtpCore + * @throws IOException if the JSON string is invalid with respect to ResetPasswordByUsernameOtpCore + */ + public static ResetPasswordByUsernameOtpCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ResetPasswordByUsernameOtpCore.class); + } + + /** + * Convert an instance of ResetPasswordByUsernameOtpCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPasswordOneOf.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPasswordOneOf.java new file mode 100644 index 0000000..626cde1 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPasswordOneOf.java @@ -0,0 +1,555 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ResetPasswordOneOf + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ResetPasswordOneOf { + public static final String SERIALIZED_NAME_G_RECAPTCHA_RESPONSE = "g-recaptcha-response"; + @SerializedName(SERIALIZED_NAME_G_RECAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String gRecaptchaResponse; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_TICKET = "qq_captcha_ticket"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_TICKET) + @javax.annotation.Nullable + private String qqCaptchaTicket; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR = "qq_captcha_randstr"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR) + @javax.annotation.Nullable + private String qqCaptchaRandstr; + + public static final String SERIALIZED_NAME_H_CAPTCHA_RESPONSE = "h-captcha-response"; + @SerializedName(SERIALIZED_NAME_H_CAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String hCaptchaResponse; + + public static final String SERIALIZED_NAME_RESET_TOKEN = "ResetToken"; + @SerializedName(SERIALIZED_NAME_RESET_TOKEN) + @javax.annotation.Nonnull + private String resetToken; + + public static final String SERIALIZED_NAME_PASSWORD = "Password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nonnull + private String password; + + public static final String SERIALIZED_NAME_WELCOMEEMAILTEMPLATE = "welcomeemailtemplate"; + @SerializedName(SERIALIZED_NAME_WELCOMEEMAILTEMPLATE) + @javax.annotation.Nullable + private String welcomeemailtemplate; + + public static final String SERIALIZED_NAME_RESET_PASSWORD_EMAIL_TEMPLATE = "ResetPasswordEmailTemplate"; + @SerializedName(SERIALIZED_NAME_RESET_PASSWORD_EMAIL_TEMPLATE) + @javax.annotation.Nullable + private String resetPasswordEmailTemplate; + + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer; + + public ResetPasswordOneOf() { + } + + public ResetPasswordOneOf gRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + return this; + } + + /** + * The Google reCAPTCHA response which is sent to the server for verification. + * @return gRecaptchaResponse + */ + @javax.annotation.Nullable + public String getgRecaptchaResponse() { + return gRecaptchaResponse; + } + + public void setgRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + } + + + public ResetPasswordOneOf qqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + return this; + } + + /** + * The QQ Captcha ticket which is sent to the server for verification. + * @return qqCaptchaTicket + */ + @javax.annotation.Nullable + public String getQqCaptchaTicket() { + return qqCaptchaTicket; + } + + public void setQqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + } + + + public ResetPasswordOneOf qqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + return this; + } + + /** + * The QQ Captcha random string which is sent to the server for verification. + * @return qqCaptchaRandstr + */ + @javax.annotation.Nullable + public String getQqCaptchaRandstr() { + return qqCaptchaRandstr; + } + + public void setQqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + } + + + public ResetPasswordOneOf hCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + return this; + } + + /** + * The hCaptcha response which is sent to the server for verification. + * @return hCaptchaResponse + */ + @javax.annotation.Nullable + public String gethCaptchaResponse() { + return hCaptchaResponse; + } + + public void sethCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + } + + + public ResetPasswordOneOf resetToken(@javax.annotation.Nonnull String resetToken) { + this.resetToken = resetToken; + return this; + } + + /** + * The reset token received via Email. + * @return resetToken + */ + @javax.annotation.Nonnull + public String getResetToken() { + return resetToken; + } + + public void setResetToken(@javax.annotation.Nonnull String resetToken) { + this.resetToken = resetToken; + } + + + public ResetPasswordOneOf password(@javax.annotation.Nonnull String password) { + this.password = password; + return this; + } + + /** + * The new Password for the Account. + * @return password + */ + @javax.annotation.Nonnull + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nonnull String password) { + this.password = password; + } + + + public ResetPasswordOneOf welcomeemailtemplate(@javax.annotation.Nullable String welcomeemailtemplate) { + this.welcomeemailtemplate = welcomeemailtemplate; + return this; + } + + /** + * Optional welcome Email template. + * @return welcomeemailtemplate + */ + @javax.annotation.Nullable + public String getWelcomeemailtemplate() { + return welcomeemailtemplate; + } + + public void setWelcomeemailtemplate(@javax.annotation.Nullable String welcomeemailtemplate) { + this.welcomeemailtemplate = welcomeemailtemplate; + } + + + public ResetPasswordOneOf resetPasswordEmailTemplate(@javax.annotation.Nullable String resetPasswordEmailTemplate) { + this.resetPasswordEmailTemplate = resetPasswordEmailTemplate; + return this; + } + + /** + * Optional reset Password Email template. + * @return resetPasswordEmailTemplate + */ + @javax.annotation.Nullable + public String getResetPasswordEmailTemplate() { + return resetPasswordEmailTemplate; + } + + public void setResetPasswordEmailTemplate(@javax.annotation.Nullable String resetPasswordEmailTemplate) { + this.resetPasswordEmailTemplate = resetPasswordEmailTemplate; + } + + + public ResetPasswordOneOf securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public ResetPasswordOneOf putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * A map of security question keys and their corresponding answers. + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ResetPasswordOneOf instance itself + */ + public ResetPasswordOneOf putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResetPasswordOneOf resetPasswordOneOf = (ResetPasswordOneOf) o; + return Objects.equals(this.gRecaptchaResponse, resetPasswordOneOf.gRecaptchaResponse) && + Objects.equals(this.qqCaptchaTicket, resetPasswordOneOf.qqCaptchaTicket) && + Objects.equals(this.qqCaptchaRandstr, resetPasswordOneOf.qqCaptchaRandstr) && + Objects.equals(this.hCaptchaResponse, resetPasswordOneOf.hCaptchaResponse) && + Objects.equals(this.resetToken, resetPasswordOneOf.resetToken) && + Objects.equals(this.password, resetPasswordOneOf.password) && + Objects.equals(this.welcomeemailtemplate, resetPasswordOneOf.welcomeemailtemplate) && + Objects.equals(this.resetPasswordEmailTemplate, resetPasswordOneOf.resetPasswordEmailTemplate) && + Objects.equals(this.securityAnswer, resetPasswordOneOf.securityAnswer)&& + Objects.equals(this.additionalProperties, resetPasswordOneOf.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, resetToken, password, welcomeemailtemplate, resetPasswordEmailTemplate, securityAnswer, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResetPasswordOneOf {\n"); + sb.append(" gRecaptchaResponse: ").append(toIndentedString(gRecaptchaResponse)).append("\n"); + sb.append(" qqCaptchaTicket: ").append(toIndentedString(qqCaptchaTicket)).append("\n"); + sb.append(" qqCaptchaRandstr: ").append(toIndentedString(qqCaptchaRandstr)).append("\n"); + sb.append(" hCaptchaResponse: ").append(toIndentedString(hCaptchaResponse)).append("\n"); + sb.append(" resetToken: ").append(toIndentedString(resetToken)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" welcomeemailtemplate: ").append(toIndentedString(welcomeemailtemplate)).append("\n"); + sb.append(" resetPasswordEmailTemplate: ").append(toIndentedString(resetPasswordEmailTemplate)).append("\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("g-recaptcha-response"); + openapiFields.add("qq_captcha_ticket"); + openapiFields.add("qq_captcha_randstr"); + openapiFields.add("h-captcha-response"); + openapiFields.add("ResetToken"); + openapiFields.add("Password"); + openapiFields.add("welcomeemailtemplate"); + openapiFields.add("ResetPasswordEmailTemplate"); + openapiFields.add("SecurityAnswer"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("ResetToken"); + openapiRequiredFields.add("Password"); + } + + /** + * 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 ResetPasswordOneOf + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ResetPasswordOneOf.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ResetPasswordOneOf is not found in the empty JSON string", ResetPasswordOneOf.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ResetPasswordOneOf.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("g-recaptcha-response") != null && !jsonObj.get("g-recaptcha-response").isJsonNull()) && !jsonObj.get("g-recaptcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `g-recaptcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("g-recaptcha-response").toString())); + } + if ((jsonObj.get("qq_captcha_ticket") != null && !jsonObj.get("qq_captcha_ticket").isJsonNull()) && !jsonObj.get("qq_captcha_ticket").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_ticket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_ticket").toString())); + } + if ((jsonObj.get("qq_captcha_randstr") != null && !jsonObj.get("qq_captcha_randstr").isJsonNull()) && !jsonObj.get("qq_captcha_randstr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_randstr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_randstr").toString())); + } + if ((jsonObj.get("h-captcha-response") != null && !jsonObj.get("h-captcha-response").isJsonNull()) && !jsonObj.get("h-captcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `h-captcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("h-captcha-response").toString())); + } + if (!jsonObj.get("ResetToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ResetToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ResetToken").toString())); + } + if (!jsonObj.get("Password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Password").toString())); + } + if ((jsonObj.get("welcomeemailtemplate") != null && !jsonObj.get("welcomeemailtemplate").isJsonNull()) && !jsonObj.get("welcomeemailtemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `welcomeemailtemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("welcomeemailtemplate").toString())); + } + if ((jsonObj.get("ResetPasswordEmailTemplate") != null && !jsonObj.get("ResetPasswordEmailTemplate").isJsonNull()) && !jsonObj.get("ResetPasswordEmailTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ResetPasswordEmailTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ResetPasswordEmailTemplate").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ResetPasswordOneOf.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ResetPasswordOneOf' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ResetPasswordOneOf> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ResetPasswordOneOf.class)); + + return (TypeAdapter<T>) new TypeAdapter<ResetPasswordOneOf>() { + @Override + public void write(JsonWriter out, ResetPasswordOneOf value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ResetPasswordOneOf read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ResetPasswordOneOf instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ResetPasswordOneOf given an JSON string + * + * @param jsonString JSON string + * @return An instance of ResetPasswordOneOf + * @throws IOException if the JSON string is invalid with respect to ResetPasswordOneOf + */ + public static ResetPasswordOneOf fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ResetPasswordOneOf.class); + } + + /** + * Convert an instance of ResetPasswordOneOf to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPasswordOneOf1.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPasswordOneOf1.java new file mode 100644 index 0000000..659823f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPasswordOneOf1.java @@ -0,0 +1,586 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ResetPasswordOneOf1 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ResetPasswordOneOf1 { + public static final String SERIALIZED_NAME_G_RECAPTCHA_RESPONSE = "g-recaptcha-response"; + @SerializedName(SERIALIZED_NAME_G_RECAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String gRecaptchaResponse; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_TICKET = "qq_captcha_ticket"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_TICKET) + @javax.annotation.Nullable + private String qqCaptchaTicket; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR = "qq_captcha_randstr"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR) + @javax.annotation.Nullable + private String qqCaptchaRandstr; + + public static final String SERIALIZED_NAME_H_CAPTCHA_RESPONSE = "h-captcha-response"; + @SerializedName(SERIALIZED_NAME_H_CAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String hCaptchaResponse; + + public static final String SERIALIZED_NAME_OTP = "otp"; + @SerializedName(SERIALIZED_NAME_OTP) + @javax.annotation.Nonnull + private String otp; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nonnull + private String email; + + public static final String SERIALIZED_NAME_PASSWORD = "Password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nonnull + private String password; + + public static final String SERIALIZED_NAME_WELCOMEEMAILTEMPLATE = "welcomeemailtemplate"; + @SerializedName(SERIALIZED_NAME_WELCOMEEMAILTEMPLATE) + @javax.annotation.Nullable + private String welcomeemailtemplate; + + public static final String SERIALIZED_NAME_RESET_PASSWORD_EMAIL_TEMPLATE = "ResetPasswordEmailTemplate"; + @SerializedName(SERIALIZED_NAME_RESET_PASSWORD_EMAIL_TEMPLATE) + @javax.annotation.Nullable + private String resetPasswordEmailTemplate; + + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer; + + public ResetPasswordOneOf1() { + } + + public ResetPasswordOneOf1 gRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + return this; + } + + /** + * The Google reCAPTCHA response which is sent to the server for verification. + * @return gRecaptchaResponse + */ + @javax.annotation.Nullable + public String getgRecaptchaResponse() { + return gRecaptchaResponse; + } + + public void setgRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + } + + + public ResetPasswordOneOf1 qqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + return this; + } + + /** + * The QQ Captcha ticket which is sent to the server for verification. + * @return qqCaptchaTicket + */ + @javax.annotation.Nullable + public String getQqCaptchaTicket() { + return qqCaptchaTicket; + } + + public void setQqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + } + + + public ResetPasswordOneOf1 qqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + return this; + } + + /** + * The QQ Captcha random string which is sent to the server for verification. + * @return qqCaptchaRandstr + */ + @javax.annotation.Nullable + public String getQqCaptchaRandstr() { + return qqCaptchaRandstr; + } + + public void setQqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + } + + + public ResetPasswordOneOf1 hCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + return this; + } + + /** + * The hCaptcha response which is sent to the server for verification. + * @return hCaptchaResponse + */ + @javax.annotation.Nullable + public String gethCaptchaResponse() { + return hCaptchaResponse; + } + + public void sethCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + } + + + public ResetPasswordOneOf1 otp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + return this; + } + + /** + * One-time passcode sent to the User's Email. + * @return otp + */ + @javax.annotation.Nonnull + public String getOtp() { + return otp; + } + + public void setOtp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + } + + + public ResetPasswordOneOf1 email(@javax.annotation.Nonnull String email) { + this.email = email; + return this; + } + + /** + * User's Email address. + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nonnull String email) { + this.email = email; + } + + + public ResetPasswordOneOf1 password(@javax.annotation.Nonnull String password) { + this.password = password; + return this; + } + + /** + * The new Password for the Account. + * @return password + */ + @javax.annotation.Nonnull + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nonnull String password) { + this.password = password; + } + + + public ResetPasswordOneOf1 welcomeemailtemplate(@javax.annotation.Nullable String welcomeemailtemplate) { + this.welcomeemailtemplate = welcomeemailtemplate; + return this; + } + + /** + * Optional welcome Email template. + * @return welcomeemailtemplate + */ + @javax.annotation.Nullable + public String getWelcomeemailtemplate() { + return welcomeemailtemplate; + } + + public void setWelcomeemailtemplate(@javax.annotation.Nullable String welcomeemailtemplate) { + this.welcomeemailtemplate = welcomeemailtemplate; + } + + + public ResetPasswordOneOf1 resetPasswordEmailTemplate(@javax.annotation.Nullable String resetPasswordEmailTemplate) { + this.resetPasswordEmailTemplate = resetPasswordEmailTemplate; + return this; + } + + /** + * Optional reset Password Email template. + * @return resetPasswordEmailTemplate + */ + @javax.annotation.Nullable + public String getResetPasswordEmailTemplate() { + return resetPasswordEmailTemplate; + } + + public void setResetPasswordEmailTemplate(@javax.annotation.Nullable String resetPasswordEmailTemplate) { + this.resetPasswordEmailTemplate = resetPasswordEmailTemplate; + } + + + public ResetPasswordOneOf1 securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public ResetPasswordOneOf1 putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * A map of security question keys and their corresponding answers. + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ResetPasswordOneOf1 instance itself + */ + public ResetPasswordOneOf1 putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResetPasswordOneOf1 resetPasswordOneOf1 = (ResetPasswordOneOf1) o; + return Objects.equals(this.gRecaptchaResponse, resetPasswordOneOf1.gRecaptchaResponse) && + Objects.equals(this.qqCaptchaTicket, resetPasswordOneOf1.qqCaptchaTicket) && + Objects.equals(this.qqCaptchaRandstr, resetPasswordOneOf1.qqCaptchaRandstr) && + Objects.equals(this.hCaptchaResponse, resetPasswordOneOf1.hCaptchaResponse) && + Objects.equals(this.otp, resetPasswordOneOf1.otp) && + Objects.equals(this.email, resetPasswordOneOf1.email) && + Objects.equals(this.password, resetPasswordOneOf1.password) && + Objects.equals(this.welcomeemailtemplate, resetPasswordOneOf1.welcomeemailtemplate) && + Objects.equals(this.resetPasswordEmailTemplate, resetPasswordOneOf1.resetPasswordEmailTemplate) && + Objects.equals(this.securityAnswer, resetPasswordOneOf1.securityAnswer)&& + Objects.equals(this.additionalProperties, resetPasswordOneOf1.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, otp, email, password, welcomeemailtemplate, resetPasswordEmailTemplate, securityAnswer, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResetPasswordOneOf1 {\n"); + sb.append(" gRecaptchaResponse: ").append(toIndentedString(gRecaptchaResponse)).append("\n"); + sb.append(" qqCaptchaTicket: ").append(toIndentedString(qqCaptchaTicket)).append("\n"); + sb.append(" qqCaptchaRandstr: ").append(toIndentedString(qqCaptchaRandstr)).append("\n"); + sb.append(" hCaptchaResponse: ").append(toIndentedString(hCaptchaResponse)).append("\n"); + sb.append(" otp: ").append(toIndentedString(otp)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" welcomeemailtemplate: ").append(toIndentedString(welcomeemailtemplate)).append("\n"); + sb.append(" resetPasswordEmailTemplate: ").append(toIndentedString(resetPasswordEmailTemplate)).append("\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("g-recaptcha-response"); + openapiFields.add("qq_captcha_ticket"); + openapiFields.add("qq_captcha_randstr"); + openapiFields.add("h-captcha-response"); + openapiFields.add("otp"); + openapiFields.add("email"); + openapiFields.add("Password"); + openapiFields.add("welcomeemailtemplate"); + openapiFields.add("ResetPasswordEmailTemplate"); + openapiFields.add("SecurityAnswer"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("otp"); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("Password"); + } + + /** + * 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 ResetPasswordOneOf1 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ResetPasswordOneOf1.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ResetPasswordOneOf1 is not found in the empty JSON string", ResetPasswordOneOf1.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ResetPasswordOneOf1.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("g-recaptcha-response") != null && !jsonObj.get("g-recaptcha-response").isJsonNull()) && !jsonObj.get("g-recaptcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `g-recaptcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("g-recaptcha-response").toString())); + } + if ((jsonObj.get("qq_captcha_ticket") != null && !jsonObj.get("qq_captcha_ticket").isJsonNull()) && !jsonObj.get("qq_captcha_ticket").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_ticket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_ticket").toString())); + } + if ((jsonObj.get("qq_captcha_randstr") != null && !jsonObj.get("qq_captcha_randstr").isJsonNull()) && !jsonObj.get("qq_captcha_randstr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_randstr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_randstr").toString())); + } + if ((jsonObj.get("h-captcha-response") != null && !jsonObj.get("h-captcha-response").isJsonNull()) && !jsonObj.get("h-captcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `h-captcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("h-captcha-response").toString())); + } + if (!jsonObj.get("otp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `otp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("otp").toString())); + } + if (!jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if (!jsonObj.get("Password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Password").toString())); + } + if ((jsonObj.get("welcomeemailtemplate") != null && !jsonObj.get("welcomeemailtemplate").isJsonNull()) && !jsonObj.get("welcomeemailtemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `welcomeemailtemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("welcomeemailtemplate").toString())); + } + if ((jsonObj.get("ResetPasswordEmailTemplate") != null && !jsonObj.get("ResetPasswordEmailTemplate").isJsonNull()) && !jsonObj.get("ResetPasswordEmailTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ResetPasswordEmailTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ResetPasswordEmailTemplate").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ResetPasswordOneOf1.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ResetPasswordOneOf1' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ResetPasswordOneOf1> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ResetPasswordOneOf1.class)); + + return (TypeAdapter<T>) new TypeAdapter<ResetPasswordOneOf1>() { + @Override + public void write(JsonWriter out, ResetPasswordOneOf1 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ResetPasswordOneOf1 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ResetPasswordOneOf1 instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ResetPasswordOneOf1 given an JSON string + * + * @param jsonString JSON string + * @return An instance of ResetPasswordOneOf1 + * @throws IOException if the JSON string is invalid with respect to ResetPasswordOneOf1 + */ + public static ResetPasswordOneOf1 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ResetPasswordOneOf1.class); + } + + /** + * Convert an instance of ResetPasswordOneOf1 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPasswordOneOf2.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPasswordOneOf2.java new file mode 100644 index 0000000..f7b0400 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPasswordOneOf2.java @@ -0,0 +1,586 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ResetPasswordOneOf2 + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ResetPasswordOneOf2 { + public static final String SERIALIZED_NAME_G_RECAPTCHA_RESPONSE = "g-recaptcha-response"; + @SerializedName(SERIALIZED_NAME_G_RECAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String gRecaptchaResponse; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_TICKET = "qq_captcha_ticket"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_TICKET) + @javax.annotation.Nullable + private String qqCaptchaTicket; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR = "qq_captcha_randstr"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR) + @javax.annotation.Nullable + private String qqCaptchaRandstr; + + public static final String SERIALIZED_NAME_H_CAPTCHA_RESPONSE = "h-captcha-response"; + @SerializedName(SERIALIZED_NAME_H_CAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String hCaptchaResponse; + + public static final String SERIALIZED_NAME_OTP = "otp"; + @SerializedName(SERIALIZED_NAME_OTP) + @javax.annotation.Nonnull + private String otp; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nonnull + private String username; + + public static final String SERIALIZED_NAME_PASSWORD = "Password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nonnull + private String password; + + public static final String SERIALIZED_NAME_WELCOMEEMAILTEMPLATE = "welcomeemailtemplate"; + @SerializedName(SERIALIZED_NAME_WELCOMEEMAILTEMPLATE) + @javax.annotation.Nullable + private String welcomeemailtemplate; + + public static final String SERIALIZED_NAME_RESET_PASSWORD_EMAIL_TEMPLATE = "ResetPasswordEmailTemplate"; + @SerializedName(SERIALIZED_NAME_RESET_PASSWORD_EMAIL_TEMPLATE) + @javax.annotation.Nullable + private String resetPasswordEmailTemplate; + + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer; + + public ResetPasswordOneOf2() { + } + + public ResetPasswordOneOf2 gRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + return this; + } + + /** + * The Google reCAPTCHA response which is sent to the server for verification. + * @return gRecaptchaResponse + */ + @javax.annotation.Nullable + public String getgRecaptchaResponse() { + return gRecaptchaResponse; + } + + public void setgRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + } + + + public ResetPasswordOneOf2 qqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + return this; + } + + /** + * The QQ Captcha ticket which is sent to the server for verification. + * @return qqCaptchaTicket + */ + @javax.annotation.Nullable + public String getQqCaptchaTicket() { + return qqCaptchaTicket; + } + + public void setQqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + } + + + public ResetPasswordOneOf2 qqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + return this; + } + + /** + * The QQ Captcha random string which is sent to the server for verification. + * @return qqCaptchaRandstr + */ + @javax.annotation.Nullable + public String getQqCaptchaRandstr() { + return qqCaptchaRandstr; + } + + public void setQqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + } + + + public ResetPasswordOneOf2 hCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + return this; + } + + /** + * The hCaptcha response which is sent to the server for verification. + * @return hCaptchaResponse + */ + @javax.annotation.Nullable + public String gethCaptchaResponse() { + return hCaptchaResponse; + } + + public void sethCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + } + + + public ResetPasswordOneOf2 otp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + return this; + } + + /** + * One-Time Password for verification. + * @return otp + */ + @javax.annotation.Nonnull + public String getOtp() { + return otp; + } + + public void setOtp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + } + + + public ResetPasswordOneOf2 username(@javax.annotation.Nonnull String username) { + this.username = username; + return this; + } + + /** + * Username of the Account. + * @return username + */ + @javax.annotation.Nonnull + public String getUsername() { + return username; + } + + public void setUsername(@javax.annotation.Nonnull String username) { + this.username = username; + } + + + public ResetPasswordOneOf2 password(@javax.annotation.Nonnull String password) { + this.password = password; + return this; + } + + /** + * The new Password for the Account. + * @return password + */ + @javax.annotation.Nonnull + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nonnull String password) { + this.password = password; + } + + + public ResetPasswordOneOf2 welcomeemailtemplate(@javax.annotation.Nullable String welcomeemailtemplate) { + this.welcomeemailtemplate = welcomeemailtemplate; + return this; + } + + /** + * Optional welcome Email template. + * @return welcomeemailtemplate + */ + @javax.annotation.Nullable + public String getWelcomeemailtemplate() { + return welcomeemailtemplate; + } + + public void setWelcomeemailtemplate(@javax.annotation.Nullable String welcomeemailtemplate) { + this.welcomeemailtemplate = welcomeemailtemplate; + } + + + public ResetPasswordOneOf2 resetPasswordEmailTemplate(@javax.annotation.Nullable String resetPasswordEmailTemplate) { + this.resetPasswordEmailTemplate = resetPasswordEmailTemplate; + return this; + } + + /** + * Optional reset Password Email template. + * @return resetPasswordEmailTemplate + */ + @javax.annotation.Nullable + public String getResetPasswordEmailTemplate() { + return resetPasswordEmailTemplate; + } + + public void setResetPasswordEmailTemplate(@javax.annotation.Nullable String resetPasswordEmailTemplate) { + this.resetPasswordEmailTemplate = resetPasswordEmailTemplate; + } + + + public ResetPasswordOneOf2 securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public ResetPasswordOneOf2 putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * A map of security question keys and their corresponding answers. + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ResetPasswordOneOf2 instance itself + */ + public ResetPasswordOneOf2 putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResetPasswordOneOf2 resetPasswordOneOf2 = (ResetPasswordOneOf2) o; + return Objects.equals(this.gRecaptchaResponse, resetPasswordOneOf2.gRecaptchaResponse) && + Objects.equals(this.qqCaptchaTicket, resetPasswordOneOf2.qqCaptchaTicket) && + Objects.equals(this.qqCaptchaRandstr, resetPasswordOneOf2.qqCaptchaRandstr) && + Objects.equals(this.hCaptchaResponse, resetPasswordOneOf2.hCaptchaResponse) && + Objects.equals(this.otp, resetPasswordOneOf2.otp) && + Objects.equals(this.username, resetPasswordOneOf2.username) && + Objects.equals(this.password, resetPasswordOneOf2.password) && + Objects.equals(this.welcomeemailtemplate, resetPasswordOneOf2.welcomeemailtemplate) && + Objects.equals(this.resetPasswordEmailTemplate, resetPasswordOneOf2.resetPasswordEmailTemplate) && + Objects.equals(this.securityAnswer, resetPasswordOneOf2.securityAnswer)&& + Objects.equals(this.additionalProperties, resetPasswordOneOf2.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, otp, username, password, welcomeemailtemplate, resetPasswordEmailTemplate, securityAnswer, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResetPasswordOneOf2 {\n"); + sb.append(" gRecaptchaResponse: ").append(toIndentedString(gRecaptchaResponse)).append("\n"); + sb.append(" qqCaptchaTicket: ").append(toIndentedString(qqCaptchaTicket)).append("\n"); + sb.append(" qqCaptchaRandstr: ").append(toIndentedString(qqCaptchaRandstr)).append("\n"); + sb.append(" hCaptchaResponse: ").append(toIndentedString(hCaptchaResponse)).append("\n"); + sb.append(" otp: ").append(toIndentedString(otp)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" welcomeemailtemplate: ").append(toIndentedString(welcomeemailtemplate)).append("\n"); + sb.append(" resetPasswordEmailTemplate: ").append(toIndentedString(resetPasswordEmailTemplate)).append("\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("g-recaptcha-response"); + openapiFields.add("qq_captcha_ticket"); + openapiFields.add("qq_captcha_randstr"); + openapiFields.add("h-captcha-response"); + openapiFields.add("otp"); + openapiFields.add("username"); + openapiFields.add("Password"); + openapiFields.add("welcomeemailtemplate"); + openapiFields.add("ResetPasswordEmailTemplate"); + openapiFields.add("SecurityAnswer"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("otp"); + openapiRequiredFields.add("username"); + openapiRequiredFields.add("Password"); + } + + /** + * 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 ResetPasswordOneOf2 + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ResetPasswordOneOf2.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ResetPasswordOneOf2 is not found in the empty JSON string", ResetPasswordOneOf2.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ResetPasswordOneOf2.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("g-recaptcha-response") != null && !jsonObj.get("g-recaptcha-response").isJsonNull()) && !jsonObj.get("g-recaptcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `g-recaptcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("g-recaptcha-response").toString())); + } + if ((jsonObj.get("qq_captcha_ticket") != null && !jsonObj.get("qq_captcha_ticket").isJsonNull()) && !jsonObj.get("qq_captcha_ticket").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_ticket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_ticket").toString())); + } + if ((jsonObj.get("qq_captcha_randstr") != null && !jsonObj.get("qq_captcha_randstr").isJsonNull()) && !jsonObj.get("qq_captcha_randstr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_randstr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_randstr").toString())); + } + if ((jsonObj.get("h-captcha-response") != null && !jsonObj.get("h-captcha-response").isJsonNull()) && !jsonObj.get("h-captcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `h-captcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("h-captcha-response").toString())); + } + if (!jsonObj.get("otp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `otp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("otp").toString())); + } + if (!jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + if (!jsonObj.get("Password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Password").toString())); + } + if ((jsonObj.get("welcomeemailtemplate") != null && !jsonObj.get("welcomeemailtemplate").isJsonNull()) && !jsonObj.get("welcomeemailtemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `welcomeemailtemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("welcomeemailtemplate").toString())); + } + if ((jsonObj.get("ResetPasswordEmailTemplate") != null && !jsonObj.get("ResetPasswordEmailTemplate").isJsonNull()) && !jsonObj.get("ResetPasswordEmailTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ResetPasswordEmailTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ResetPasswordEmailTemplate").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ResetPasswordOneOf2.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ResetPasswordOneOf2' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ResetPasswordOneOf2> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ResetPasswordOneOf2.class)); + + return (TypeAdapter<T>) new TypeAdapter<ResetPasswordOneOf2>() { + @Override + public void write(JsonWriter out, ResetPasswordOneOf2 value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ResetPasswordOneOf2 read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ResetPasswordOneOf2 instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ResetPasswordOneOf2 given an JSON string + * + * @param jsonString JSON string + * @return An instance of ResetPasswordOneOf2 + * @throws IOException if the JSON string is invalid with respect to ResetPasswordOneOf2 + */ + public static ResetPasswordOneOf2 fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ResetPasswordOneOf2.class); + } + + /** + * Convert an instance of ResetPasswordOneOf2 to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPasswordResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPasswordResponse.java new file mode 100644 index 0000000..2f24e63 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPasswordResponse.java @@ -0,0 +1,316 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.AuthResponse; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ResetPasswordResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ResetPasswordResponse { + public static final String SERIALIZED_NAME_IS_POSTED = "IsPosted"; + @SerializedName(SERIALIZED_NAME_IS_POSTED) + @javax.annotation.Nullable + private Boolean isPosted; + + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private AuthResponse data; + + public ResetPasswordResponse() { + } + + public ResetPasswordResponse isPosted(@javax.annotation.Nullable Boolean isPosted) { + this.isPosted = isPosted; + return this; + } + + /** + * Get isPosted + * @return isPosted + */ + @javax.annotation.Nullable + public Boolean getIsPosted() { + return isPosted; + } + + public void setIsPosted(@javax.annotation.Nullable Boolean isPosted) { + this.isPosted = isPosted; + } + + + public ResetPasswordResponse data(@javax.annotation.Nullable AuthResponse data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public AuthResponse getData() { + return data; + } + + public void setData(@javax.annotation.Nullable AuthResponse data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ResetPasswordResponse instance itself + */ + public ResetPasswordResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResetPasswordResponse resetPasswordResponse = (ResetPasswordResponse) o; + return Objects.equals(this.isPosted, resetPasswordResponse.isPosted) && + Objects.equals(this.data, resetPasswordResponse.data)&& + Objects.equals(this.additionalProperties, resetPasswordResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isPosted, data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResetPasswordResponse {\n"); + sb.append(" isPosted: ").append(toIndentedString(isPosted)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsPosted"); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ResetPasswordResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ResetPasswordResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ResetPasswordResponse is not found in the empty JSON string", ResetPasswordResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `Data` + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + AuthResponse.validateJsonElement(jsonObj.get("Data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ResetPasswordResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ResetPasswordResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ResetPasswordResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ResetPasswordResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<ResetPasswordResponse>() { + @Override + public void write(JsonWriter out, ResetPasswordResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ResetPasswordResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ResetPasswordResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ResetPasswordResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ResetPasswordResponse + * @throws IOException if the JSON string is invalid with respect to ResetPasswordResponse + */ + public static ResetPasswordResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ResetPasswordResponse.class); + } + + /** + * Convert an instance of ResetPasswordResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPasswordWithOTP.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPasswordWithOTP.java new file mode 100644 index 0000000..3042b77 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPasswordWithOTP.java @@ -0,0 +1,616 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * ResetPasswordWithOTP + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ResetPasswordWithOTP { + public static final String SERIALIZED_NAME_RESETPASSWORDEMAILTEMPLATE = "resetpasswordemailtemplate"; + @SerializedName(SERIALIZED_NAME_RESETPASSWORDEMAILTEMPLATE) + @javax.annotation.Nullable + private String resetpasswordemailtemplate; + + public static final String SERIALIZED_NAME_RESET_PASSWORD_SMS_TEMPLATE = "resetPasswordSmsTemplate"; + @SerializedName(SERIALIZED_NAME_RESET_PASSWORD_SMS_TEMPLATE) + @javax.annotation.Nullable + private String resetPasswordSmsTemplate; + + public static final String SERIALIZED_NAME_SMSTEMPLATE = "smstemplate"; + @SerializedName(SERIALIZED_NAME_SMSTEMPLATE) + @javax.annotation.Nullable + private String smstemplate; + + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer = new HashMap<>(); + + public static final String SERIALIZED_NAME_PASSWORD = "Password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nonnull + private String password; + + public static final String SERIALIZED_NAME_OTP = "otp"; + @SerializedName(SERIALIZED_NAME_OTP) + @javax.annotation.Nonnull + private String otp; + + public static final String SERIALIZED_NAME_PHONE = "phone"; + @SerializedName(SERIALIZED_NAME_PHONE) + @javax.annotation.Nonnull + private String phone; + + public static final String SERIALIZED_NAME_G_RECAPTCHA_RESPONSE = "g-recaptcha-response"; + @SerializedName(SERIALIZED_NAME_G_RECAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String gRecaptchaResponse; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_TICKET = "qq_captcha_ticket"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_TICKET) + @javax.annotation.Nullable + private String qqCaptchaTicket; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR = "qq_captcha_randstr"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR) + @javax.annotation.Nullable + private String qqCaptchaRandstr; + + public static final String SERIALIZED_NAME_H_CAPTCHA_RESPONSE = "h-captcha-response"; + @SerializedName(SERIALIZED_NAME_H_CAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String hCaptchaResponse; + + public ResetPasswordWithOTP() { + } + + public ResetPasswordWithOTP resetpasswordemailtemplate(@javax.annotation.Nullable String resetpasswordemailtemplate) { + this.resetpasswordemailtemplate = resetpasswordemailtemplate; + return this; + } + + /** + * Email template for Password reset (optional) + * @return resetpasswordemailtemplate + */ + @javax.annotation.Nullable + public String getResetpasswordemailtemplate() { + return resetpasswordemailtemplate; + } + + public void setResetpasswordemailtemplate(@javax.annotation.Nullable String resetpasswordemailtemplate) { + this.resetpasswordemailtemplate = resetpasswordemailtemplate; + } + + + public ResetPasswordWithOTP resetPasswordSmsTemplate(@javax.annotation.Nullable String resetPasswordSmsTemplate) { + this.resetPasswordSmsTemplate = resetPasswordSmsTemplate; + return this; + } + + /** + * SMS template for Password reset (optional) + * @return resetPasswordSmsTemplate + */ + @javax.annotation.Nullable + public String getResetPasswordSmsTemplate() { + return resetPasswordSmsTemplate; + } + + public void setResetPasswordSmsTemplate(@javax.annotation.Nullable String resetPasswordSmsTemplate) { + this.resetPasswordSmsTemplate = resetPasswordSmsTemplate; + } + + + public ResetPasswordWithOTP smstemplate(@javax.annotation.Nullable String smstemplate) { + this.smstemplate = smstemplate; + return this; + } + + /** + * SMS template (optional) + * @return smstemplate + */ + @javax.annotation.Nullable + public String getSmstemplate() { + return smstemplate; + } + + public void setSmstemplate(@javax.annotation.Nullable String smstemplate) { + this.smstemplate = smstemplate; + } + + + public ResetPasswordWithOTP securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public ResetPasswordWithOTP putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * Map of security question answers + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + + public ResetPasswordWithOTP password(@javax.annotation.Nonnull String password) { + this.password = password; + return this; + } + + /** + * New password + * @return password + */ + @javax.annotation.Nonnull + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nonnull String password) { + this.password = password; + } + + + public ResetPasswordWithOTP otp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + return this; + } + + /** + * One-Time Password received via SMS/email + * @return otp + */ + @javax.annotation.Nonnull + public String getOtp() { + return otp; + } + + public void setOtp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + } + + + public ResetPasswordWithOTP phone(@javax.annotation.Nonnull String phone) { + this.phone = phone; + return this; + } + + /** + * Phone number for OTP delivery + * @return phone + */ + @javax.annotation.Nonnull + public String getPhone() { + return phone; + } + + public void setPhone(@javax.annotation.Nonnull String phone) { + this.phone = phone; + } + + + public ResetPasswordWithOTP gRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + return this; + } + + /** + * The Google reCAPTCHA response which is sent to the server for verification. + * @return gRecaptchaResponse + */ + @javax.annotation.Nullable + public String getgRecaptchaResponse() { + return gRecaptchaResponse; + } + + public void setgRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + } + + + public ResetPasswordWithOTP qqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + return this; + } + + /** + * The QQ Captcha ticket which is sent to the server for verification. + * @return qqCaptchaTicket + */ + @javax.annotation.Nullable + public String getQqCaptchaTicket() { + return qqCaptchaTicket; + } + + public void setQqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + } + + + public ResetPasswordWithOTP qqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + return this; + } + + /** + * The QQ Captcha random string which is sent to the server for verification. + * @return qqCaptchaRandstr + */ + @javax.annotation.Nullable + public String getQqCaptchaRandstr() { + return qqCaptchaRandstr; + } + + public void setQqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + } + + + public ResetPasswordWithOTP hCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + return this; + } + + /** + * The hCaptcha response which is sent to the server for verification. + * @return hCaptchaResponse + */ + @javax.annotation.Nullable + public String gethCaptchaResponse() { + return hCaptchaResponse; + } + + public void sethCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ResetPasswordWithOTP instance itself + */ + public ResetPasswordWithOTP putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResetPasswordWithOTP resetPasswordWithOTP = (ResetPasswordWithOTP) o; + return Objects.equals(this.resetpasswordemailtemplate, resetPasswordWithOTP.resetpasswordemailtemplate) && + Objects.equals(this.resetPasswordSmsTemplate, resetPasswordWithOTP.resetPasswordSmsTemplate) && + Objects.equals(this.smstemplate, resetPasswordWithOTP.smstemplate) && + Objects.equals(this.securityAnswer, resetPasswordWithOTP.securityAnswer) && + Objects.equals(this.password, resetPasswordWithOTP.password) && + Objects.equals(this.otp, resetPasswordWithOTP.otp) && + Objects.equals(this.phone, resetPasswordWithOTP.phone) && + Objects.equals(this.gRecaptchaResponse, resetPasswordWithOTP.gRecaptchaResponse) && + Objects.equals(this.qqCaptchaTicket, resetPasswordWithOTP.qqCaptchaTicket) && + Objects.equals(this.qqCaptchaRandstr, resetPasswordWithOTP.qqCaptchaRandstr) && + Objects.equals(this.hCaptchaResponse, resetPasswordWithOTP.hCaptchaResponse)&& + Objects.equals(this.additionalProperties, resetPasswordWithOTP.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(resetpasswordemailtemplate, resetPasswordSmsTemplate, smstemplate, securityAnswer, password, otp, phone, gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResetPasswordWithOTP {\n"); + sb.append(" resetpasswordemailtemplate: ").append(toIndentedString(resetpasswordemailtemplate)).append("\n"); + sb.append(" resetPasswordSmsTemplate: ").append(toIndentedString(resetPasswordSmsTemplate)).append("\n"); + sb.append(" smstemplate: ").append(toIndentedString(smstemplate)).append("\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" otp: ").append(toIndentedString(otp)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" gRecaptchaResponse: ").append(toIndentedString(gRecaptchaResponse)).append("\n"); + sb.append(" qqCaptchaTicket: ").append(toIndentedString(qqCaptchaTicket)).append("\n"); + sb.append(" qqCaptchaRandstr: ").append(toIndentedString(qqCaptchaRandstr)).append("\n"); + sb.append(" hCaptchaResponse: ").append(toIndentedString(hCaptchaResponse)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("resetpasswordemailtemplate"); + openapiFields.add("resetPasswordSmsTemplate"); + openapiFields.add("smstemplate"); + openapiFields.add("SecurityAnswer"); + openapiFields.add("Password"); + openapiFields.add("otp"); + openapiFields.add("phone"); + openapiFields.add("g-recaptcha-response"); + openapiFields.add("qq_captcha_ticket"); + openapiFields.add("qq_captcha_randstr"); + openapiFields.add("h-captcha-response"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Password"); + openapiRequiredFields.add("otp"); + openapiRequiredFields.add("phone"); + } + + /** + * 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 ResetPasswordWithOTP + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ResetPasswordWithOTP.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ResetPasswordWithOTP is not found in the empty JSON string", ResetPasswordWithOTP.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ResetPasswordWithOTP.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("resetpasswordemailtemplate") != null && !jsonObj.get("resetpasswordemailtemplate").isJsonNull()) && !jsonObj.get("resetpasswordemailtemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `resetpasswordemailtemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resetpasswordemailtemplate").toString())); + } + if ((jsonObj.get("resetPasswordSmsTemplate") != null && !jsonObj.get("resetPasswordSmsTemplate").isJsonNull()) && !jsonObj.get("resetPasswordSmsTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `resetPasswordSmsTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resetPasswordSmsTemplate").toString())); + } + if ((jsonObj.get("smstemplate") != null && !jsonObj.get("smstemplate").isJsonNull()) && !jsonObj.get("smstemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `smstemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smstemplate").toString())); + } + if (!jsonObj.get("Password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Password").toString())); + } + if (!jsonObj.get("otp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `otp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("otp").toString())); + } + if (!jsonObj.get("phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phone").toString())); + } + if ((jsonObj.get("g-recaptcha-response") != null && !jsonObj.get("g-recaptcha-response").isJsonNull()) && !jsonObj.get("g-recaptcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `g-recaptcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("g-recaptcha-response").toString())); + } + if ((jsonObj.get("qq_captcha_ticket") != null && !jsonObj.get("qq_captcha_ticket").isJsonNull()) && !jsonObj.get("qq_captcha_ticket").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_ticket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_ticket").toString())); + } + if ((jsonObj.get("qq_captcha_randstr") != null && !jsonObj.get("qq_captcha_randstr").isJsonNull()) && !jsonObj.get("qq_captcha_randstr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_randstr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_randstr").toString())); + } + if ((jsonObj.get("h-captcha-response") != null && !jsonObj.get("h-captcha-response").isJsonNull()) && !jsonObj.get("h-captcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `h-captcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("h-captcha-response").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ResetPasswordWithOTP.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ResetPasswordWithOTP' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ResetPasswordWithOTP> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ResetPasswordWithOTP.class)); + + return (TypeAdapter<T>) new TypeAdapter<ResetPasswordWithOTP>() { + @Override + public void write(JsonWriter out, ResetPasswordWithOTP value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ResetPasswordWithOTP read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ResetPasswordWithOTP instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ResetPasswordWithOTP given an JSON string + * + * @param jsonString JSON string + * @return An instance of ResetPasswordWithOTP + * @throws IOException if the JSON string is invalid with respect to ResetPasswordWithOTP + */ + public static ResetPasswordWithOTP fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ResetPasswordWithOTP.class); + } + + /** + * Convert an instance of ResetPasswordWithOTP to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPasswordWithOTPCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPasswordWithOTPCore.java new file mode 100644 index 0000000..f833b2d --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ResetPasswordWithOTPCore.java @@ -0,0 +1,484 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Reset Password by Phone and otp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ResetPasswordWithOTPCore { + public static final String SERIALIZED_NAME_RESETPASSWORDEMAILTEMPLATE = "resetpasswordemailtemplate"; + @SerializedName(SERIALIZED_NAME_RESETPASSWORDEMAILTEMPLATE) + @javax.annotation.Nullable + private String resetpasswordemailtemplate; + + public static final String SERIALIZED_NAME_RESET_PASSWORD_SMS_TEMPLATE = "resetPasswordSmsTemplate"; + @SerializedName(SERIALIZED_NAME_RESET_PASSWORD_SMS_TEMPLATE) + @javax.annotation.Nullable + private String resetPasswordSmsTemplate; + + public static final String SERIALIZED_NAME_SMSTEMPLATE = "smstemplate"; + @SerializedName(SERIALIZED_NAME_SMSTEMPLATE) + @javax.annotation.Nullable + private String smstemplate; + + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer = new HashMap<>(); + + public static final String SERIALIZED_NAME_PASSWORD = "Password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nonnull + private String password; + + public static final String SERIALIZED_NAME_OTP = "otp"; + @SerializedName(SERIALIZED_NAME_OTP) + @javax.annotation.Nonnull + private String otp; + + public static final String SERIALIZED_NAME_PHONE = "phone"; + @SerializedName(SERIALIZED_NAME_PHONE) + @javax.annotation.Nonnull + private String phone; + + public ResetPasswordWithOTPCore() { + } + + public ResetPasswordWithOTPCore resetpasswordemailtemplate(@javax.annotation.Nullable String resetpasswordemailtemplate) { + this.resetpasswordemailtemplate = resetpasswordemailtemplate; + return this; + } + + /** + * Email template for Password reset (optional) + * @return resetpasswordemailtemplate + */ + @javax.annotation.Nullable + public String getResetpasswordemailtemplate() { + return resetpasswordemailtemplate; + } + + public void setResetpasswordemailtemplate(@javax.annotation.Nullable String resetpasswordemailtemplate) { + this.resetpasswordemailtemplate = resetpasswordemailtemplate; + } + + + public ResetPasswordWithOTPCore resetPasswordSmsTemplate(@javax.annotation.Nullable String resetPasswordSmsTemplate) { + this.resetPasswordSmsTemplate = resetPasswordSmsTemplate; + return this; + } + + /** + * SMS template for Password reset (optional) + * @return resetPasswordSmsTemplate + */ + @javax.annotation.Nullable + public String getResetPasswordSmsTemplate() { + return resetPasswordSmsTemplate; + } + + public void setResetPasswordSmsTemplate(@javax.annotation.Nullable String resetPasswordSmsTemplate) { + this.resetPasswordSmsTemplate = resetPasswordSmsTemplate; + } + + + public ResetPasswordWithOTPCore smstemplate(@javax.annotation.Nullable String smstemplate) { + this.smstemplate = smstemplate; + return this; + } + + /** + * SMS template (optional) + * @return smstemplate + */ + @javax.annotation.Nullable + public String getSmstemplate() { + return smstemplate; + } + + public void setSmstemplate(@javax.annotation.Nullable String smstemplate) { + this.smstemplate = smstemplate; + } + + + public ResetPasswordWithOTPCore securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public ResetPasswordWithOTPCore putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * Map of security question answers + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + + public ResetPasswordWithOTPCore password(@javax.annotation.Nonnull String password) { + this.password = password; + return this; + } + + /** + * New password + * @return password + */ + @javax.annotation.Nonnull + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nonnull String password) { + this.password = password; + } + + + public ResetPasswordWithOTPCore otp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + return this; + } + + /** + * One-Time Password received via SMS/email + * @return otp + */ + @javax.annotation.Nonnull + public String getOtp() { + return otp; + } + + public void setOtp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + } + + + public ResetPasswordWithOTPCore phone(@javax.annotation.Nonnull String phone) { + this.phone = phone; + return this; + } + + /** + * Phone number for OTP delivery + * @return phone + */ + @javax.annotation.Nonnull + public String getPhone() { + return phone; + } + + public void setPhone(@javax.annotation.Nonnull String phone) { + this.phone = phone; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ResetPasswordWithOTPCore instance itself + */ + public ResetPasswordWithOTPCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ResetPasswordWithOTPCore resetPasswordWithOTPCore = (ResetPasswordWithOTPCore) o; + return Objects.equals(this.resetpasswordemailtemplate, resetPasswordWithOTPCore.resetpasswordemailtemplate) && + Objects.equals(this.resetPasswordSmsTemplate, resetPasswordWithOTPCore.resetPasswordSmsTemplate) && + Objects.equals(this.smstemplate, resetPasswordWithOTPCore.smstemplate) && + Objects.equals(this.securityAnswer, resetPasswordWithOTPCore.securityAnswer) && + Objects.equals(this.password, resetPasswordWithOTPCore.password) && + Objects.equals(this.otp, resetPasswordWithOTPCore.otp) && + Objects.equals(this.phone, resetPasswordWithOTPCore.phone)&& + Objects.equals(this.additionalProperties, resetPasswordWithOTPCore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(resetpasswordemailtemplate, resetPasswordSmsTemplate, smstemplate, securityAnswer, password, otp, phone, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ResetPasswordWithOTPCore {\n"); + sb.append(" resetpasswordemailtemplate: ").append(toIndentedString(resetpasswordemailtemplate)).append("\n"); + sb.append(" resetPasswordSmsTemplate: ").append(toIndentedString(resetPasswordSmsTemplate)).append("\n"); + sb.append(" smstemplate: ").append(toIndentedString(smstemplate)).append("\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" otp: ").append(toIndentedString(otp)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("resetpasswordemailtemplate"); + openapiFields.add("resetPasswordSmsTemplate"); + openapiFields.add("smstemplate"); + openapiFields.add("SecurityAnswer"); + openapiFields.add("Password"); + openapiFields.add("otp"); + openapiFields.add("phone"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Password"); + openapiRequiredFields.add("otp"); + openapiRequiredFields.add("phone"); + } + + /** + * 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 ResetPasswordWithOTPCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ResetPasswordWithOTPCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ResetPasswordWithOTPCore is not found in the empty JSON string", ResetPasswordWithOTPCore.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : ResetPasswordWithOTPCore.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("resetpasswordemailtemplate") != null && !jsonObj.get("resetpasswordemailtemplate").isJsonNull()) && !jsonObj.get("resetpasswordemailtemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `resetpasswordemailtemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resetpasswordemailtemplate").toString())); + } + if ((jsonObj.get("resetPasswordSmsTemplate") != null && !jsonObj.get("resetPasswordSmsTemplate").isJsonNull()) && !jsonObj.get("resetPasswordSmsTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `resetPasswordSmsTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("resetPasswordSmsTemplate").toString())); + } + if ((jsonObj.get("smstemplate") != null && !jsonObj.get("smstemplate").isJsonNull()) && !jsonObj.get("smstemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `smstemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("smstemplate").toString())); + } + if (!jsonObj.get("Password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Password").toString())); + } + if (!jsonObj.get("otp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `otp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("otp").toString())); + } + if (!jsonObj.get("phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("phone").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ResetPasswordWithOTPCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ResetPasswordWithOTPCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ResetPasswordWithOTPCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ResetPasswordWithOTPCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<ResetPasswordWithOTPCore>() { + @Override + public void write(JsonWriter out, ResetPasswordWithOTPCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ResetPasswordWithOTPCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ResetPasswordWithOTPCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ResetPasswordWithOTPCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of ResetPasswordWithOTPCore + * @throws IOException if the JSON string is invalid with respect to ResetPasswordWithOTPCore + */ + public static ResetPasswordWithOTPCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ResetPasswordWithOTPCore.class); + } + + /** + * Convert an instance of ResetPasswordWithOTPCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/RestoreWorkflowVersion200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/RestoreWorkflowVersion200Response.java new file mode 100644 index 0000000..083eb64 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/RestoreWorkflowVersion200Response.java @@ -0,0 +1,289 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.WorkflowData; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * RestoreWorkflowVersion200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class RestoreWorkflowVersion200Response { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private WorkflowData data; + + public RestoreWorkflowVersion200Response() { + } + + public RestoreWorkflowVersion200Response data(@javax.annotation.Nullable WorkflowData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public WorkflowData getData() { + return data; + } + + public void setData(@javax.annotation.Nullable WorkflowData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RestoreWorkflowVersion200Response instance itself + */ + public RestoreWorkflowVersion200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RestoreWorkflowVersion200Response restoreWorkflowVersion200Response = (RestoreWorkflowVersion200Response) o; + return Objects.equals(this.data, restoreWorkflowVersion200Response.data)&& + Objects.equals(this.additionalProperties, restoreWorkflowVersion200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RestoreWorkflowVersion200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 RestoreWorkflowVersion200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RestoreWorkflowVersion200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RestoreWorkflowVersion200Response is not found in the empty JSON string", RestoreWorkflowVersion200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `Data` + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + WorkflowData.validateJsonElement(jsonObj.get("Data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!RestoreWorkflowVersion200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RestoreWorkflowVersion200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<RestoreWorkflowVersion200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RestoreWorkflowVersion200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<RestoreWorkflowVersion200Response>() { + @Override + public void write(JsonWriter out, RestoreWorkflowVersion200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RestoreWorkflowVersion200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RestoreWorkflowVersion200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RestoreWorkflowVersion200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of RestoreWorkflowVersion200Response + * @throws IOException if the JSON string is invalid with respect to RestoreWorkflowVersion200Response + */ + public static RestoreWorkflowVersion200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RestoreWorkflowVersion200Response.class); + } + + /** + * Convert an instance of RestoreWorkflowVersion200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/Role.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/Role.java new file mode 100644 index 0000000..c5baa9f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/Role.java @@ -0,0 +1,544 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.Permission; +import java.io.IOException; +import java.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Role + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class Role { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "Description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_LEVEL = "Level"; + @SerializedName(SERIALIZED_NAME_LEVEL) + @javax.annotation.Nullable + private String level; + + public static final String SERIALIZED_NAME_ORG_ID = "OrgId"; + @SerializedName(SERIALIZED_NAME_ORG_ID) + @javax.annotation.Nullable + private String orgId; + + public static final String SERIALIZED_NAME_ORIGINAL_NAME = "OriginalName"; + @SerializedName(SERIALIZED_NAME_ORIGINAL_NAME) + @javax.annotation.Nullable + private String originalName; + + public static final String SERIALIZED_NAME_PERMISSIONS = "Permissions"; + @SerializedName(SERIALIZED_NAME_PERMISSIONS) + @javax.annotation.Nullable + private List<Permission> permissions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public static final String SERIALIZED_NAME_MODIFIED_DATE = "ModifiedDate"; + @SerializedName(SERIALIZED_NAME_MODIFIED_DATE) + @javax.annotation.Nullable + private OffsetDateTime modifiedDate; + + public Role() { + } + + public Role id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Role ID + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public Role name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Role Name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public Role description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Role Description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public Role level(@javax.annotation.Nullable String level) { + this.level = level; + return this; + } + + /** + * Role Level + * @return level + */ + @javax.annotation.Nullable + public String getLevel() { + return level; + } + + public void setLevel(@javax.annotation.Nullable String level) { + this.level = level; + } + + + public Role orgId(@javax.annotation.Nullable String orgId) { + this.orgId = orgId; + return this; + } + + /** + * Organization ID + * @return orgId + */ + @javax.annotation.Nullable + public String getOrgId() { + return orgId; + } + + public void setOrgId(@javax.annotation.Nullable String orgId) { + this.orgId = orgId; + } + + + public Role originalName(@javax.annotation.Nullable String originalName) { + this.originalName = originalName; + return this; + } + + /** + * Original (unnormalized) Role Name + * @return originalName + */ + @javax.annotation.Nullable + public String getOriginalName() { + return originalName; + } + + public void setOriginalName(@javax.annotation.Nullable String originalName) { + this.originalName = originalName; + } + + + public Role permissions(@javax.annotation.Nullable List<Permission> permissions) { + this.permissions = permissions; + return this; + } + + public Role addPermissionsItem(Permission permissionsItem) { + if (this.permissions == null) { + this.permissions = new ArrayList<>(); + } + this.permissions.add(permissionsItem); + return this; + } + + /** + * Get permissions + * @return permissions + */ + @javax.annotation.Nullable + public List<Permission> getPermissions() { + return permissions; + } + + public void setPermissions(@javax.annotation.Nullable List<Permission> permissions) { + this.permissions = permissions; + } + + + public Role createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Role Created Date + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + + public Role modifiedDate(@javax.annotation.Nullable OffsetDateTime modifiedDate) { + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Role Modified Date + * @return modifiedDate + */ + @javax.annotation.Nullable + public OffsetDateTime getModifiedDate() { + return modifiedDate; + } + + public void setModifiedDate(@javax.annotation.Nullable OffsetDateTime modifiedDate) { + this.modifiedDate = modifiedDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the Role instance itself + */ + public Role putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + Role role = (Role) o; + return Objects.equals(this.id, role.id) && + Objects.equals(this.name, role.name) && + Objects.equals(this.description, role.description) && + Objects.equals(this.level, role.level) && + Objects.equals(this.orgId, role.orgId) && + Objects.equals(this.originalName, role.originalName) && + Objects.equals(this.permissions, role.permissions) && + Objects.equals(this.createdDate, role.createdDate) && + Objects.equals(this.modifiedDate, role.modifiedDate)&& + Objects.equals(this.additionalProperties, role.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, description, level, orgId, originalName, permissions, createdDate, modifiedDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class Role {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" level: ").append(toIndentedString(level)).append("\n"); + sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n"); + sb.append(" originalName: ").append(toIndentedString(originalName)).append("\n"); + sb.append(" permissions: ").append(toIndentedString(permissions)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" modifiedDate: ").append(toIndentedString(modifiedDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Description"); + openapiFields.add("Level"); + openapiFields.add("OrgId"); + openapiFields.add("OriginalName"); + openapiFields.add("Permissions"); + openapiFields.add("CreatedDate"); + openapiFields.add("ModifiedDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 Role + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!Role.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in Role is not found in the empty JSON string", Role.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Description") != null && !jsonObj.get("Description").isJsonNull()) && !jsonObj.get("Description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Description").toString())); + } + if ((jsonObj.get("Level") != null && !jsonObj.get("Level").isJsonNull()) && !jsonObj.get("Level").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Level` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Level").toString())); + } + if ((jsonObj.get("OrgId") != null && !jsonObj.get("OrgId").isJsonNull()) && !jsonObj.get("OrgId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `OrgId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("OrgId").toString())); + } + if ((jsonObj.get("OriginalName") != null && !jsonObj.get("OriginalName").isJsonNull()) && !jsonObj.get("OriginalName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `OriginalName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("OriginalName").toString())); + } + if (jsonObj.get("Permissions") != null && !jsonObj.get("Permissions").isJsonNull()) { + JsonArray jsonArraypermissions = jsonObj.getAsJsonArray("Permissions"); + if (jsonArraypermissions != null) { + // ensure the json data is an array + if (!jsonObj.get("Permissions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Permissions` to be an array in the JSON string but got `%s`", jsonObj.get("Permissions").toString())); + } + + // validate the optional field `Permissions` (array) + for (int i = 0; i < jsonArraypermissions.size(); i++) { + Permission.validateJsonElement(jsonArraypermissions.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!Role.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'Role' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<Role> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(Role.class)); + + return (TypeAdapter<T>) new TypeAdapter<Role>() { + @Override + public void write(JsonWriter out, Role value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public Role read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + Role instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of Role given an JSON string + * + * @param jsonString JSON string + * @return An instance of Role + * @throws IOException if the JSON string is invalid with respect to Role + */ + public static Role fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, Role.class); + } + + /** + * Convert an instance of Role to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/RoleByName200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/RoleByName200Response.java new file mode 100644 index 0000000..b3bbfba --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/RoleByName200Response.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.Role; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * RoleByName200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class RoleByName200Response { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<Role> data = new ArrayList<>(); + + public RoleByName200Response() { + } + + public RoleByName200Response data(@javax.annotation.Nullable List<Role> data) { + this.data = data; + return this; + } + + public RoleByName200Response addDataItem(Role dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<Role> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<Role> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RoleByName200Response instance itself + */ + public RoleByName200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RoleByName200Response roleByName200Response = (RoleByName200Response) o; + return Objects.equals(this.data, roleByName200Response.data)&& + Objects.equals(this.additionalProperties, roleByName200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RoleByName200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 RoleByName200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RoleByName200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RoleByName200Response is not found in the empty JSON string", RoleByName200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + Role.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!RoleByName200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RoleByName200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<RoleByName200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RoleByName200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<RoleByName200Response>() { + @Override + public void write(JsonWriter out, RoleByName200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RoleByName200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RoleByName200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RoleByName200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of RoleByName200Response + * @throws IOException if the JSON string is invalid with respect to RoleByName200Response + */ + public static RoleByName200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RoleByName200Response.class); + } + + /** + * Convert an instance of RoleByName200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/RoleContext.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/RoleContext.java new file mode 100644 index 0000000..d5ec9e2 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/RoleContext.java @@ -0,0 +1,407 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * RoleContext + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class RoleContext { + public static final String SERIALIZED_NAME_CONTEXT = "Context"; + @SerializedName(SERIALIZED_NAME_CONTEXT) + @javax.annotation.Nullable + private String context; + + public static final String SERIALIZED_NAME_ROLES = "Roles"; + @SerializedName(SERIALIZED_NAME_ROLES) + @javax.annotation.Nullable + private List<String> roles = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ADDITIONAL_PERMISSIONS = "AdditionalPermissions"; + @SerializedName(SERIALIZED_NAME_ADDITIONAL_PERMISSIONS) + @javax.annotation.Nullable + private List<String> additionalPermissions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_EXPIRATION = "Expiration"; + @SerializedName(SERIALIZED_NAME_EXPIRATION) + @javax.annotation.Nullable + private OffsetDateTime expiration; + + public RoleContext() { + } + + public RoleContext context(@javax.annotation.Nullable String context) { + this.context = context; + return this; + } + + /** + * The Context name. + * @return context + */ + @javax.annotation.Nullable + public String getContext() { + return context; + } + + public void setContext(@javax.annotation.Nullable String context) { + this.context = context; + } + + + public RoleContext roles(@javax.annotation.Nullable List<String> roles) { + this.roles = roles; + return this; + } + + public RoleContext addRolesItem(String rolesItem) { + if (this.roles == null) { + this.roles = new ArrayList<>(); + } + this.roles.add(rolesItem); + return this; + } + + /** + * List of Roles in this Context. + * @return roles + */ + @javax.annotation.Nullable + public List<String> getRoles() { + return roles; + } + + public void setRoles(@javax.annotation.Nullable List<String> roles) { + this.roles = roles; + } + + + public RoleContext additionalPermissions(@javax.annotation.Nullable List<String> additionalPermissions) { + this.additionalPermissions = additionalPermissions; + return this; + } + + public RoleContext addAdditionalPermissionsItem(String additionalPermissionsItem) { + if (this.additionalPermissions == null) { + this.additionalPermissions = new ArrayList<>(); + } + this.additionalPermissions.add(additionalPermissionsItem); + return this; + } + + /** + * Additional Permissions for this Context. + * @return additionalPermissions + */ + @javax.annotation.Nullable + public List<String> getAdditionalPermissions() { + return additionalPermissions; + } + + public void setAdditionalPermissions(@javax.annotation.Nullable List<String> additionalPermissions) { + this.additionalPermissions = additionalPermissions; + } + + + public RoleContext expiration(@javax.annotation.Nullable OffsetDateTime expiration) { + this.expiration = expiration; + return this; + } + + /** + * Timestamp in ISO 8601 format with milliseconds and timezone. + * @return expiration + */ + @javax.annotation.Nullable + public OffsetDateTime getExpiration() { + return expiration; + } + + public void setExpiration(@javax.annotation.Nullable OffsetDateTime expiration) { + this.expiration = expiration; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RoleContext instance itself + */ + public RoleContext putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RoleContext roleContext = (RoleContext) o; + return Objects.equals(this.context, roleContext.context) && + Objects.equals(this.roles, roleContext.roles) && + Objects.equals(this.additionalPermissions, roleContext.additionalPermissions) && + Objects.equals(this.expiration, roleContext.expiration)&& + Objects.equals(this.additionalProperties, roleContext.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(context, roles, additionalPermissions, expiration, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RoleContext {\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" roles: ").append(toIndentedString(roles)).append("\n"); + sb.append(" additionalPermissions: ").append(toIndentedString(additionalPermissions)).append("\n"); + sb.append(" expiration: ").append(toIndentedString(expiration)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Context"); + openapiFields.add("Roles"); + openapiFields.add("AdditionalPermissions"); + openapiFields.add("Expiration"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 RoleContext + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RoleContext.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RoleContext is not found in the empty JSON string", RoleContext.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Context") != null && !jsonObj.get("Context").isJsonNull()) && !jsonObj.get("Context").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Context` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Context").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("Roles") != null && !jsonObj.get("Roles").isJsonNull() && !jsonObj.get("Roles").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Roles` to be an array in the JSON string but got `%s`", jsonObj.get("Roles").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("AdditionalPermissions") != null && !jsonObj.get("AdditionalPermissions").isJsonNull() && !jsonObj.get("AdditionalPermissions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `AdditionalPermissions` to be an array in the JSON string but got `%s`", jsonObj.get("AdditionalPermissions").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!RoleContext.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RoleContext' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<RoleContext> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RoleContext.class)); + + return (TypeAdapter<T>) new TypeAdapter<RoleContext>() { + @Override + public void write(JsonWriter out, RoleContext value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RoleContext read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RoleContext instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RoleContext given an JSON string + * + * @param jsonString JSON string + * @return An instance of RoleContext + * @throws IOException if the JSON string is invalid with respect to RoleContext + */ + public static RoleContext fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RoleContext.class); + } + + /** + * Convert an instance of RoleContext to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/RoleContextBody.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/RoleContextBody.java new file mode 100644 index 0000000..2bcaa64 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/RoleContextBody.java @@ -0,0 +1,407 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * RoleContextBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class RoleContextBody { + public static final String SERIALIZED_NAME_CONTEXT = "Context"; + @SerializedName(SERIALIZED_NAME_CONTEXT) + @javax.annotation.Nullable + private String context; + + public static final String SERIALIZED_NAME_ROLES = "Roles"; + @SerializedName(SERIALIZED_NAME_ROLES) + @javax.annotation.Nullable + private List<String> roles = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ADDITIONAL_PERMISSIONS = "AdditionalPermissions"; + @SerializedName(SERIALIZED_NAME_ADDITIONAL_PERMISSIONS) + @javax.annotation.Nullable + private List<String> additionalPermissions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_EXPIRATION = "Expiration"; + @SerializedName(SERIALIZED_NAME_EXPIRATION) + @javax.annotation.Nullable + private OffsetDateTime expiration; + + public RoleContextBody() { + } + + public RoleContextBody context(@javax.annotation.Nullable String context) { + this.context = context; + return this; + } + + /** + * Get context + * @return context + */ + @javax.annotation.Nullable + public String getContext() { + return context; + } + + public void setContext(@javax.annotation.Nullable String context) { + this.context = context; + } + + + public RoleContextBody roles(@javax.annotation.Nullable List<String> roles) { + this.roles = roles; + return this; + } + + public RoleContextBody addRolesItem(String rolesItem) { + if (this.roles == null) { + this.roles = new ArrayList<>(); + } + this.roles.add(rolesItem); + return this; + } + + /** + * Get roles + * @return roles + */ + @javax.annotation.Nullable + public List<String> getRoles() { + return roles; + } + + public void setRoles(@javax.annotation.Nullable List<String> roles) { + this.roles = roles; + } + + + public RoleContextBody additionalPermissions(@javax.annotation.Nullable List<String> additionalPermissions) { + this.additionalPermissions = additionalPermissions; + return this; + } + + public RoleContextBody addAdditionalPermissionsItem(String additionalPermissionsItem) { + if (this.additionalPermissions == null) { + this.additionalPermissions = new ArrayList<>(); + } + this.additionalPermissions.add(additionalPermissionsItem); + return this; + } + + /** + * Get additionalPermissions + * @return additionalPermissions + */ + @javax.annotation.Nullable + public List<String> getAdditionalPermissions() { + return additionalPermissions; + } + + public void setAdditionalPermissions(@javax.annotation.Nullable List<String> additionalPermissions) { + this.additionalPermissions = additionalPermissions; + } + + + public RoleContextBody expiration(@javax.annotation.Nullable OffsetDateTime expiration) { + this.expiration = expiration; + return this; + } + + /** + * Timestamp in ISO 8601 format with milliseconds and timezone. + * @return expiration + */ + @javax.annotation.Nullable + public OffsetDateTime getExpiration() { + return expiration; + } + + public void setExpiration(@javax.annotation.Nullable OffsetDateTime expiration) { + this.expiration = expiration; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RoleContextBody instance itself + */ + public RoleContextBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RoleContextBody roleContextBody = (RoleContextBody) o; + return Objects.equals(this.context, roleContextBody.context) && + Objects.equals(this.roles, roleContextBody.roles) && + Objects.equals(this.additionalPermissions, roleContextBody.additionalPermissions) && + Objects.equals(this.expiration, roleContextBody.expiration)&& + Objects.equals(this.additionalProperties, roleContextBody.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(context, roles, additionalPermissions, expiration, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RoleContextBody {\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" roles: ").append(toIndentedString(roles)).append("\n"); + sb.append(" additionalPermissions: ").append(toIndentedString(additionalPermissions)).append("\n"); + sb.append(" expiration: ").append(toIndentedString(expiration)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Context"); + openapiFields.add("Roles"); + openapiFields.add("AdditionalPermissions"); + openapiFields.add("Expiration"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 RoleContextBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RoleContextBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RoleContextBody is not found in the empty JSON string", RoleContextBody.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Context") != null && !jsonObj.get("Context").isJsonNull()) && !jsonObj.get("Context").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Context` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Context").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("Roles") != null && !jsonObj.get("Roles").isJsonNull() && !jsonObj.get("Roles").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Roles` to be an array in the JSON string but got `%s`", jsonObj.get("Roles").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("AdditionalPermissions") != null && !jsonObj.get("AdditionalPermissions").isJsonNull() && !jsonObj.get("AdditionalPermissions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `AdditionalPermissions` to be an array in the JSON string but got `%s`", jsonObj.get("AdditionalPermissions").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!RoleContextBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RoleContextBody' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<RoleContextBody> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RoleContextBody.class)); + + return (TypeAdapter<T>) new TypeAdapter<RoleContextBody>() { + @Override + public void write(JsonWriter out, RoleContextBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RoleContextBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RoleContextBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RoleContextBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of RoleContextBody + * @throws IOException if the JSON string is invalid with respect to RoleContextBody + */ + public static RoleContextBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RoleContextBody.class); + } + + /** + * Convert an instance of RoleContextBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/RoleContextBodyModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/RoleContextBodyModel.java new file mode 100644 index 0000000..96f3e53 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/RoleContextBodyModel.java @@ -0,0 +1,421 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * RoleContextBodyModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class RoleContextBodyModel { + public static final String SERIALIZED_NAME_ROLES = "Roles"; + @SerializedName(SERIALIZED_NAME_ROLES) + @javax.annotation.Nonnull + private List<String> roles = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ADDITIONAL_PERMISSIONS = "AdditionalPermissions"; + @SerializedName(SERIALIZED_NAME_ADDITIONAL_PERMISSIONS) + @javax.annotation.Nonnull + private List<String> additionalPermissions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_EXPIRATION = "Expiration"; + @SerializedName(SERIALIZED_NAME_EXPIRATION) + @javax.annotation.Nullable + private OffsetDateTime expiration; + + public static final String SERIALIZED_NAME_CONTEXT = "Context"; + @SerializedName(SERIALIZED_NAME_CONTEXT) + @javax.annotation.Nonnull + private String context; + + public RoleContextBodyModel() { + } + + public RoleContextBodyModel roles(@javax.annotation.Nonnull List<String> roles) { + this.roles = roles; + return this; + } + + public RoleContextBodyModel addRolesItem(String rolesItem) { + if (this.roles == null) { + this.roles = new ArrayList<>(); + } + this.roles.add(rolesItem); + return this; + } + + /** + * List of Roles for the Context. + * @return roles + */ + @javax.annotation.Nonnull + public List<String> getRoles() { + return roles; + } + + public void setRoles(@javax.annotation.Nonnull List<String> roles) { + this.roles = roles; + } + + + public RoleContextBodyModel additionalPermissions(@javax.annotation.Nonnull List<String> additionalPermissions) { + this.additionalPermissions = additionalPermissions; + return this; + } + + public RoleContextBodyModel addAdditionalPermissionsItem(String additionalPermissionsItem) { + if (this.additionalPermissions == null) { + this.additionalPermissions = new ArrayList<>(); + } + this.additionalPermissions.add(additionalPermissionsItem); + return this; + } + + /** + * Additional Permissions for the Context. + * @return additionalPermissions + */ + @javax.annotation.Nonnull + public List<String> getAdditionalPermissions() { + return additionalPermissions; + } + + public void setAdditionalPermissions(@javax.annotation.Nonnull List<String> additionalPermissions) { + this.additionalPermissions = additionalPermissions; + } + + + public RoleContextBodyModel expiration(@javax.annotation.Nullable OffsetDateTime expiration) { + this.expiration = expiration; + return this; + } + + /** + * Expiration date/time in ISO 8601 format. + * @return expiration + */ + @javax.annotation.Nullable + public OffsetDateTime getExpiration() { + return expiration; + } + + public void setExpiration(@javax.annotation.Nullable OffsetDateTime expiration) { + this.expiration = expiration; + } + + + public RoleContextBodyModel context(@javax.annotation.Nonnull String context) { + this.context = context; + return this; + } + + /** + * The Context name or identifier. + * @return context + */ + @javax.annotation.Nonnull + public String getContext() { + return context; + } + + public void setContext(@javax.annotation.Nonnull String context) { + this.context = context; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RoleContextBodyModel instance itself + */ + public RoleContextBodyModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RoleContextBodyModel roleContextBodyModel = (RoleContextBodyModel) o; + return Objects.equals(this.roles, roleContextBodyModel.roles) && + Objects.equals(this.additionalPermissions, roleContextBodyModel.additionalPermissions) && + Objects.equals(this.expiration, roleContextBodyModel.expiration) && + Objects.equals(this.context, roleContextBodyModel.context)&& + Objects.equals(this.additionalProperties, roleContextBodyModel.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(roles, additionalPermissions, expiration, context, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RoleContextBodyModel {\n"); + sb.append(" roles: ").append(toIndentedString(roles)).append("\n"); + sb.append(" additionalPermissions: ").append(toIndentedString(additionalPermissions)).append("\n"); + sb.append(" expiration: ").append(toIndentedString(expiration)).append("\n"); + sb.append(" context: ").append(toIndentedString(context)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Roles"); + openapiFields.add("AdditionalPermissions"); + openapiFields.add("Expiration"); + openapiFields.add("Context"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Roles"); + openapiRequiredFields.add("AdditionalPermissions"); + openapiRequiredFields.add("Context"); + } + + /** + * 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 RoleContextBodyModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RoleContextBodyModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RoleContextBodyModel is not found in the empty JSON string", RoleContextBodyModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RoleContextBodyModel.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 required json array is present + if (jsonObj.get("Roles") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("Roles").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Roles` to be an array in the JSON string but got `%s`", jsonObj.get("Roles").toString())); + } + // ensure the required json array is present + if (jsonObj.get("AdditionalPermissions") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("AdditionalPermissions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `AdditionalPermissions` to be an array in the JSON string but got `%s`", jsonObj.get("AdditionalPermissions").toString())); + } + if (!jsonObj.get("Context").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Context` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Context").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!RoleContextBodyModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RoleContextBodyModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<RoleContextBodyModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RoleContextBodyModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<RoleContextBodyModel>() { + @Override + public void write(JsonWriter out, RoleContextBodyModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RoleContextBodyModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RoleContextBodyModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RoleContextBodyModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of RoleContextBodyModel + * @throws IOException if the JSON string is invalid with respect to RoleContextBodyModel + */ + public static RoleContextBodyModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RoleContextBodyModel.class); + } + + /** + * Convert an instance of RoleContextBodyModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/RoleContextProfileModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/RoleContextProfileModel.java new file mode 100644 index 0000000..f23c53d --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/RoleContextProfileModel.java @@ -0,0 +1,506 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.Email; +import com.loginradius.sdk.internal.openapi.model.RoleContextBody; +import com.loginradius.sdk.internal.openapi.model.SecondFactorAuthentication; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * RoleContextProfileModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class RoleContextProfileModel { + public static final String SERIALIZED_NAME_ROLE_CONTEXT = "RoleContext"; + @SerializedName(SERIALIZED_NAME_ROLE_CONTEXT) + @javax.annotation.Nonnull + private RoleContextBody roleContext; + + public static final String SERIALIZED_NAME_UID = "Uid"; + @SerializedName(SERIALIZED_NAME_UID) + @javax.annotation.Nullable + private String uid; + + public static final String SERIALIZED_NAME_LAST_LOGIN_DATE = "LastLoginDate"; + @SerializedName(SERIALIZED_NAME_LAST_LOGIN_DATE) + @javax.annotation.Nullable + private OffsetDateTime lastLoginDate; + + 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_IMAGE_URL = "ImageUrl"; + @SerializedName(SERIALIZED_NAME_IMAGE_URL) + @javax.annotation.Nullable + private String imageUrl; + + public static final String SERIALIZED_NAME_SECOND_FACTOR_AUTHENTICATION = "SecondFactorAuthentication"; + @SerializedName(SERIALIZED_NAME_SECOND_FACTOR_AUTHENTICATION) + @javax.annotation.Nullable + private SecondFactorAuthentication secondFactorAuthentication; + + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nonnull + private List<Email> email = new ArrayList<>(); + + public RoleContextProfileModel() { + } + + public RoleContextProfileModel roleContext(@javax.annotation.Nonnull RoleContextBody roleContext) { + this.roleContext = roleContext; + return this; + } + + /** + * Get roleContext + * @return roleContext + */ + @javax.annotation.Nonnull + public RoleContextBody getRoleContext() { + return roleContext; + } + + public void setRoleContext(@javax.annotation.Nonnull RoleContextBody roleContext) { + this.roleContext = roleContext; + } + + + public RoleContextProfileModel uid(@javax.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * Unique identifier for the User. + * @return uid + */ + @javax.annotation.Nullable + public String getUid() { + return uid; + } + + public void setUid(@javax.annotation.Nullable String uid) { + this.uid = uid; + } + + + public RoleContextProfileModel lastLoginDate(@javax.annotation.Nullable OffsetDateTime lastLoginDate) { + this.lastLoginDate = lastLoginDate; + return this; + } + + /** + * Last login date in ISO 8601 format. + * @return lastLoginDate + */ + @javax.annotation.Nullable + public OffsetDateTime getLastLoginDate() { + return lastLoginDate; + } + + public void setLastLoginDate(@javax.annotation.Nullable OffsetDateTime lastLoginDate) { + this.lastLoginDate = lastLoginDate; + } + + + public RoleContextProfileModel fullName(@javax.annotation.Nullable String fullName) { + this.fullName = fullName; + return this; + } + + /** + * Full name of the User. + * @return fullName + */ + @javax.annotation.Nullable + public String getFullName() { + return fullName; + } + + public void setFullName(@javax.annotation.Nullable String fullName) { + this.fullName = fullName; + } + + + public RoleContextProfileModel imageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** + * URL to the User's image. + * @return imageUrl + */ + @javax.annotation.Nullable + public String getImageUrl() { + return imageUrl; + } + + public void setImageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + } + + + public RoleContextProfileModel secondFactorAuthentication(@javax.annotation.Nullable SecondFactorAuthentication secondFactorAuthentication) { + this.secondFactorAuthentication = secondFactorAuthentication; + return this; + } + + /** + * Get secondFactorAuthentication + * @return secondFactorAuthentication + */ + @javax.annotation.Nullable + public SecondFactorAuthentication getSecondFactorAuthentication() { + return secondFactorAuthentication; + } + + public void setSecondFactorAuthentication(@javax.annotation.Nullable SecondFactorAuthentication secondFactorAuthentication) { + this.secondFactorAuthentication = secondFactorAuthentication; + } + + + public RoleContextProfileModel email(@javax.annotation.Nonnull List<Email> email) { + this.email = email; + return this; + } + + public RoleContextProfileModel addEmailItem(Email emailItem) { + if (this.email == null) { + this.email = new ArrayList<>(); + } + this.email.add(emailItem); + return this; + } + + /** + * Get email + * @return email + */ + @javax.annotation.Nonnull + public List<Email> getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nonnull List<Email> email) { + this.email = email; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RoleContextProfileModel instance itself + */ + public RoleContextProfileModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RoleContextProfileModel roleContextProfileModel = (RoleContextProfileModel) o; + return Objects.equals(this.roleContext, roleContextProfileModel.roleContext) && + Objects.equals(this.uid, roleContextProfileModel.uid) && + Objects.equals(this.lastLoginDate, roleContextProfileModel.lastLoginDate) && + Objects.equals(this.fullName, roleContextProfileModel.fullName) && + Objects.equals(this.imageUrl, roleContextProfileModel.imageUrl) && + Objects.equals(this.secondFactorAuthentication, roleContextProfileModel.secondFactorAuthentication) && + Objects.equals(this.email, roleContextProfileModel.email)&& + Objects.equals(this.additionalProperties, roleContextProfileModel.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(roleContext, uid, lastLoginDate, fullName, imageUrl, secondFactorAuthentication, email, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RoleContextProfileModel {\n"); + sb.append(" roleContext: ").append(toIndentedString(roleContext)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" lastLoginDate: ").append(toIndentedString(lastLoginDate)).append("\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append(" secondFactorAuthentication: ").append(toIndentedString(secondFactorAuthentication)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("RoleContext"); + openapiFields.add("Uid"); + openapiFields.add("LastLoginDate"); + openapiFields.add("FullName"); + openapiFields.add("ImageUrl"); + openapiFields.add("SecondFactorAuthentication"); + openapiFields.add("Email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("RoleContext"); + openapiRequiredFields.add("Email"); + } + + /** + * 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 RoleContextProfileModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RoleContextProfileModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RoleContextProfileModel is not found in the empty JSON string", RoleContextProfileModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RoleContextProfileModel.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 `RoleContext` + RoleContextBody.validateJsonElement(jsonObj.get("RoleContext")); + if ((jsonObj.get("Uid") != null && !jsonObj.get("Uid").isJsonNull()) && !jsonObj.get("Uid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Uid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Uid").toString())); + } + if ((jsonObj.get("FullName") != null && !jsonObj.get("FullName").isJsonNull()) && !jsonObj.get("FullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FullName").toString())); + } + if ((jsonObj.get("ImageUrl") != null && !jsonObj.get("ImageUrl").isJsonNull()) && !jsonObj.get("ImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ImageUrl").toString())); + } + // validate the optional field `SecondFactorAuthentication` + if (jsonObj.get("SecondFactorAuthentication") != null && !jsonObj.get("SecondFactorAuthentication").isJsonNull()) { + SecondFactorAuthentication.validateJsonElement(jsonObj.get("SecondFactorAuthentication")); + } + // ensure the json data is an array + if (!jsonObj.get("Email").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Email` to be an array in the JSON string but got `%s`", jsonObj.get("Email").toString())); + } + + JsonArray jsonArrayemail = jsonObj.getAsJsonArray("Email"); + // validate the required field `Email` (array) + for (int i = 0; i < jsonArrayemail.size(); i++) { + Email.validateJsonElement(jsonArrayemail.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!RoleContextProfileModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RoleContextProfileModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<RoleContextProfileModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RoleContextProfileModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<RoleContextProfileModel>() { + @Override + public void write(JsonWriter out, RoleContextProfileModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RoleContextProfileModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RoleContextProfileModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RoleContextProfileModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of RoleContextProfileModel + * @throws IOException if the JSON string is invalid with respect to RoleContextProfileModel + */ + public static RoleContextProfileModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RoleContextProfileModel.class); + } + + /** + * Convert an instance of RoleContextProfileModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/RoleContextProfileResponseModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/RoleContextProfileResponseModel.java new file mode 100644 index 0000000..6cae980 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/RoleContextProfileResponseModel.java @@ -0,0 +1,313 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.RoleContextProfileModel; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * RoleContextProfileResponseModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class RoleContextProfileResponseModel { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private List<RoleContextProfileModel> data = new ArrayList<>(); + + public RoleContextProfileResponseModel() { + } + + public RoleContextProfileResponseModel data(@javax.annotation.Nonnull List<RoleContextProfileModel> data) { + this.data = data; + return this; + } + + public RoleContextProfileResponseModel addDataItem(RoleContextProfileModel dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * List of Role Context profiles. + * @return data + */ + @javax.annotation.Nonnull + public List<RoleContextProfileModel> getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull List<RoleContextProfileModel> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RoleContextProfileResponseModel instance itself + */ + public RoleContextProfileResponseModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RoleContextProfileResponseModel roleContextProfileResponseModel = (RoleContextProfileResponseModel) o; + return Objects.equals(this.data, roleContextProfileResponseModel.data)&& + Objects.equals(this.additionalProperties, roleContextProfileResponseModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RoleContextProfileResponseModel {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Data"); + } + + /** + * 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 RoleContextProfileResponseModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RoleContextProfileResponseModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RoleContextProfileResponseModel is not found in the empty JSON string", RoleContextProfileResponseModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RoleContextProfileResponseModel.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("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + // validate the required field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + RoleContextProfileModel.validateJsonElement(jsonArraydata.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!RoleContextProfileResponseModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RoleContextProfileResponseModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<RoleContextProfileResponseModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RoleContextProfileResponseModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<RoleContextProfileResponseModel>() { + @Override + public void write(JsonWriter out, RoleContextProfileResponseModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RoleContextProfileResponseModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RoleContextProfileResponseModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RoleContextProfileResponseModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of RoleContextProfileResponseModel + * @throws IOException if the JSON string is invalid with respect to RoleContextProfileResponseModel + */ + public static RoleContextProfileResponseModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RoleContextProfileResponseModel.class); + } + + /** + * Convert an instance of RoleContextProfileResponseModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/RoleContextResponseModal.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/RoleContextResponseModal.java new file mode 100644 index 0000000..291d0fd --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/RoleContextResponseModal.java @@ -0,0 +1,313 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.RoleContext; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * RoleContextResponseModal + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class RoleContextResponseModal { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private List<RoleContext> data = new ArrayList<>(); + + public RoleContextResponseModal() { + } + + public RoleContextResponseModal data(@javax.annotation.Nonnull List<RoleContext> data) { + this.data = data; + return this; + } + + public RoleContextResponseModal addDataItem(RoleContext dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * List of Role Contexts. + * @return data + */ + @javax.annotation.Nonnull + public List<RoleContext> getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull List<RoleContext> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RoleContextResponseModal instance itself + */ + public RoleContextResponseModal putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RoleContextResponseModal roleContextResponseModal = (RoleContextResponseModal) o; + return Objects.equals(this.data, roleContextResponseModal.data)&& + Objects.equals(this.additionalProperties, roleContextResponseModal.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RoleContextResponseModal {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Data"); + } + + /** + * 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 RoleContextResponseModal + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RoleContextResponseModal.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RoleContextResponseModal is not found in the empty JSON string", RoleContextResponseModal.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RoleContextResponseModal.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("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + // validate the required field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + RoleContext.validateJsonElement(jsonArraydata.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!RoleContextResponseModal.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RoleContextResponseModal' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<RoleContextResponseModal> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RoleContextResponseModal.class)); + + return (TypeAdapter<T>) new TypeAdapter<RoleContextResponseModal>() { + @Override + public void write(JsonWriter out, RoleContextResponseModal value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RoleContextResponseModal read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RoleContextResponseModal instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RoleContextResponseModal given an JSON string + * + * @param jsonString JSON string + * @return An instance of RoleContextResponseModal + * @throws IOException if the JSON string is invalid with respect to RoleContextResponseModal + */ + public static RoleContextResponseModal fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RoleContextResponseModal.class); + } + + /** + * Convert an instance of RoleContextResponseModal to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/RolePostRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/RolePostRequest.java new file mode 100644 index 0000000..936f6c8 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/RolePostRequest.java @@ -0,0 +1,366 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.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.loginradius.sdk.internal.openapi.JSON; + +/** + * RolePostRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class RolePostRequest { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "Description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_PERMISSIONS = "Permissions"; + @SerializedName(SERIALIZED_NAME_PERMISSIONS) + @javax.annotation.Nullable + private List<String> permissions = new ArrayList<>(); + + public RolePostRequest() { + } + + public RolePostRequest name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Role Name + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public RolePostRequest description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Role Description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public RolePostRequest permissions(@javax.annotation.Nullable List<String> permissions) { + this.permissions = permissions; + return this; + } + + public RolePostRequest addPermissionsItem(String permissionsItem) { + if (this.permissions == null) { + this.permissions = new ArrayList<>(); + } + this.permissions.add(permissionsItem); + return this; + } + + /** + * Get permissions + * @return permissions + */ + @javax.annotation.Nullable + public List<String> getPermissions() { + return permissions; + } + + public void setPermissions(@javax.annotation.Nullable List<String> permissions) { + this.permissions = permissions; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RolePostRequest instance itself + */ + public RolePostRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RolePostRequest rolePostRequest = (RolePostRequest) o; + return Objects.equals(this.name, rolePostRequest.name) && + Objects.equals(this.description, rolePostRequest.description) && + Objects.equals(this.permissions, rolePostRequest.permissions)&& + Objects.equals(this.additionalProperties, rolePostRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, permissions, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RolePostRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" permissions: ").append(toIndentedString(permissions)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + openapiFields.add("Description"); + openapiFields.add("Permissions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Name"); + } + + /** + * 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 RolePostRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RolePostRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RolePostRequest is not found in the empty JSON string", RolePostRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RolePostRequest.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("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("Description") != null && !jsonObj.get("Description").isJsonNull()) && !jsonObj.get("Description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Description").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("Permissions") != null && !jsonObj.get("Permissions").isJsonNull() && !jsonObj.get("Permissions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Permissions` to be an array in the JSON string but got `%s`", jsonObj.get("Permissions").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!RolePostRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RolePostRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<RolePostRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RolePostRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<RolePostRequest>() { + @Override + public void write(JsonWriter out, RolePostRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RolePostRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RolePostRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RolePostRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of RolePostRequest + * @throws IOException if the JSON string is invalid with respect to RolePostRequest + */ + public static RolePostRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RolePostRequest.class); + } + + /** + * Convert an instance of RolePostRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/RolesPutRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/RolesPutRequest.java new file mode 100644 index 0000000..470fe3e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/RolesPutRequest.java @@ -0,0 +1,370 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.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.loginradius.sdk.internal.openapi.JSON; + +/** + * RolesPutRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class RolesPutRequest { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "Description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nonnull + private String description; + + public static final String SERIALIZED_NAME_PERMISSIONS = "Permissions"; + @SerializedName(SERIALIZED_NAME_PERMISSIONS) + @javax.annotation.Nonnull + private List<String> permissions = new ArrayList<>(); + + public RolesPutRequest() { + } + + public RolesPutRequest name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Role Name + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public RolesPutRequest description(@javax.annotation.Nonnull String description) { + this.description = description; + return this; + } + + /** + * Role Description + * @return description + */ + @javax.annotation.Nonnull + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nonnull String description) { + this.description = description; + } + + + public RolesPutRequest permissions(@javax.annotation.Nonnull List<String> permissions) { + this.permissions = permissions; + return this; + } + + public RolesPutRequest addPermissionsItem(String permissionsItem) { + if (this.permissions == null) { + this.permissions = new ArrayList<>(); + } + this.permissions.add(permissionsItem); + return this; + } + + /** + * Get permissions + * @return permissions + */ + @javax.annotation.Nonnull + public List<String> getPermissions() { + return permissions; + } + + public void setPermissions(@javax.annotation.Nonnull List<String> permissions) { + this.permissions = permissions; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the RolesPutRequest instance itself + */ + public RolesPutRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RolesPutRequest rolesPutRequest = (RolesPutRequest) o; + return Objects.equals(this.name, rolesPutRequest.name) && + Objects.equals(this.description, rolesPutRequest.description) && + Objects.equals(this.permissions, rolesPutRequest.permissions)&& + Objects.equals(this.additionalProperties, rolesPutRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, description, permissions, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RolesPutRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" permissions: ").append(toIndentedString(permissions)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + openapiFields.add("Description"); + openapiFields.add("Permissions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Name"); + openapiRequiredFields.add("Description"); + openapiRequiredFields.add("Permissions"); + } + + /** + * 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 RolesPutRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!RolesPutRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in RolesPutRequest is not found in the empty JSON string", RolesPutRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : RolesPutRequest.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("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("Description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Description").toString())); + } + // ensure the required json array is present + if (jsonObj.get("Permissions") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("Permissions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Permissions` to be an array in the JSON string but got `%s`", jsonObj.get("Permissions").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!RolesPutRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'RolesPutRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<RolesPutRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(RolesPutRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<RolesPutRequest>() { + @Override + public void write(JsonWriter out, RolesPutRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public RolesPutRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + RolesPutRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of RolesPutRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of RolesPutRequest + * @throws IOException if the JSON string is invalid with respect to RolesPutRequest + */ + public static RolesPutRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, RolesPutRequest.class); + } + + /** + * Convert an instance of RolesPutRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SAMLConnectionCreateRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SAMLConnectionCreateRequest.java new file mode 100644 index 0000000..076ef8f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SAMLConnectionCreateRequest.java @@ -0,0 +1,626 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.OrganizationsConnectionBaseAttributes; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SAMLConnectionCreateRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SAMLConnectionCreateRequest { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_DOMAIN = "Domain"; + @SerializedName(SERIALIZED_NAME_DOMAIN) + @javax.annotation.Nonnull + private String domain; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "Attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nullable + private OrganizationsConnectionBaseAttributes attributes; + + public static final String SERIALIZED_NAME_ID_P_ENTITY_ID = "IDPEntityId"; + @SerializedName(SERIALIZED_NAME_ID_P_ENTITY_ID) + @javax.annotation.Nullable + private String idPEntityId; + + public static final String SERIALIZED_NAME_ID_P_METADATA_URL = "IDPMetadataUrl"; + @SerializedName(SERIALIZED_NAME_ID_P_METADATA_URL) + @javax.annotation.Nullable + private String idPMetadataUrl; + + public static final String SERIALIZED_NAME_IS_I_D_P_INITIATED = "IsIDPInitiated"; + @SerializedName(SERIALIZED_NAME_IS_I_D_P_INITIATED) + @javax.annotation.Nullable + private Boolean isIDPInitiated; + + public static final String SERIALIZED_NAME_ID_P_LOGIN_URL = "IDPLoginUrl"; + @SerializedName(SERIALIZED_NAME_ID_P_LOGIN_URL) + @javax.annotation.Nullable + private String idPLoginUrl; + + public static final String SERIALIZED_NAME_ID_P_LOGOUT_URL = "IDPLogoutUrl"; + @SerializedName(SERIALIZED_NAME_ID_P_LOGOUT_URL) + @javax.annotation.Nullable + private String idPLogoutUrl; + + public static final String SERIALIZED_NAME_ID_P_CERTIFICATE = "IDPCertificate"; + @SerializedName(SERIALIZED_NAME_ID_P_CERTIFICATE) + @javax.annotation.Nullable + private String idPCertificate; + + /** + * Type of the connection, which is SAML in this case. + */ + @JsonAdapter(ConnectionTypeEnum.Adapter.class) + public enum ConnectionTypeEnum { + CUSTOM("saml_custom"), + + OKTA("saml_okta"), + + ENTRAID("saml_entraid"), + + GOOGLE_WORKSPACE("saml_google_workspace"), + + SALESFORCE("saml_salesforce"); + + private String value; + + ConnectionTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ConnectionTypeEnum fromValue(String value) { + for (ConnectionTypeEnum b : ConnectionTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<ConnectionTypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final ConnectionTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ConnectionTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ConnectionTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ConnectionTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CONNECTION_TYPE = "ConnectionType"; + @SerializedName(SERIALIZED_NAME_CONNECTION_TYPE) + @javax.annotation.Nonnull + private ConnectionTypeEnum connectionType; + + public SAMLConnectionCreateRequest() { + } + + public SAMLConnectionCreateRequest name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * Name of the connection + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public SAMLConnectionCreateRequest domain(@javax.annotation.Nonnull String domain) { + this.domain = domain; + return this; + } + + /** + * Domain associated with the connection + * @return domain + */ + @javax.annotation.Nonnull + public String getDomain() { + return domain; + } + + public void setDomain(@javax.annotation.Nonnull String domain) { + this.domain = domain; + } + + + public SAMLConnectionCreateRequest attributes(@javax.annotation.Nullable OrganizationsConnectionBaseAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nullable + public OrganizationsConnectionBaseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nullable OrganizationsConnectionBaseAttributes attributes) { + this.attributes = attributes; + } + + + public SAMLConnectionCreateRequest idPEntityId(@javax.annotation.Nullable String idPEntityId) { + this.idPEntityId = idPEntityId; + return this; + } + + /** + * Unique identifier for the Identity Provider (IdP). + * @return idPEntityId + */ + @javax.annotation.Nullable + public String getIdPEntityId() { + return idPEntityId; + } + + public void setIdPEntityId(@javax.annotation.Nullable String idPEntityId) { + this.idPEntityId = idPEntityId; + } + + + public SAMLConnectionCreateRequest idPMetadataUrl(@javax.annotation.Nullable String idPMetadataUrl) { + this.idPMetadataUrl = idPMetadataUrl; + return this; + } + + /** + * URL to the IdP metadata XML file. + * @return idPMetadataUrl + */ + @javax.annotation.Nullable + public String getIdPMetadataUrl() { + return idPMetadataUrl; + } + + public void setIdPMetadataUrl(@javax.annotation.Nullable String idPMetadataUrl) { + this.idPMetadataUrl = idPMetadataUrl; + } + + + public SAMLConnectionCreateRequest isIDPInitiated(@javax.annotation.Nullable Boolean isIDPInitiated) { + this.isIDPInitiated = isIDPInitiated; + return this; + } + + /** + * Indicates whether the SAML connection is initiated by the IdP. + * @return isIDPInitiated + */ + @javax.annotation.Nullable + public Boolean getIsIDPInitiated() { + return isIDPInitiated; + } + + public void setIsIDPInitiated(@javax.annotation.Nullable Boolean isIDPInitiated) { + this.isIDPInitiated = isIDPInitiated; + } + + + public SAMLConnectionCreateRequest idPLoginUrl(@javax.annotation.Nullable String idPLoginUrl) { + this.idPLoginUrl = idPLoginUrl; + return this; + } + + /** + * The IdP's SAML single sign-on (login) URL. + * @return idPLoginUrl + */ + @javax.annotation.Nullable + public String getIdPLoginUrl() { + return idPLoginUrl; + } + + public void setIdPLoginUrl(@javax.annotation.Nullable String idPLoginUrl) { + this.idPLoginUrl = idPLoginUrl; + } + + + public SAMLConnectionCreateRequest idPLogoutUrl(@javax.annotation.Nullable String idPLogoutUrl) { + this.idPLogoutUrl = idPLogoutUrl; + return this; + } + + /** + * The IdP's SAML single logout (SLO) URL. + * @return idPLogoutUrl + */ + @javax.annotation.Nullable + public String getIdPLogoutUrl() { + return idPLogoutUrl; + } + + public void setIdPLogoutUrl(@javax.annotation.Nullable String idPLogoutUrl) { + this.idPLogoutUrl = idPLogoutUrl; + } + + + public SAMLConnectionCreateRequest idPCertificate(@javax.annotation.Nullable String idPCertificate) { + this.idPCertificate = idPCertificate; + return this; + } + + /** + * PEM-encoded IdP signing certificate used to verify SAML assertions. + * @return idPCertificate + */ + @javax.annotation.Nullable + public String getIdPCertificate() { + return idPCertificate; + } + + public void setIdPCertificate(@javax.annotation.Nullable String idPCertificate) { + this.idPCertificate = idPCertificate; + } + + + public SAMLConnectionCreateRequest connectionType(@javax.annotation.Nonnull ConnectionTypeEnum connectionType) { + this.connectionType = connectionType; + return this; + } + + /** + * Type of the connection, which is SAML in this case. + * @return connectionType + */ + @javax.annotation.Nonnull + public ConnectionTypeEnum getConnectionType() { + return connectionType; + } + + public void setConnectionType(@javax.annotation.Nonnull ConnectionTypeEnum connectionType) { + this.connectionType = connectionType; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SAMLConnectionCreateRequest instance itself + */ + public SAMLConnectionCreateRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SAMLConnectionCreateRequest saMLConnectionCreateRequest = (SAMLConnectionCreateRequest) o; + return Objects.equals(this.name, saMLConnectionCreateRequest.name) && + Objects.equals(this.domain, saMLConnectionCreateRequest.domain) && + Objects.equals(this.attributes, saMLConnectionCreateRequest.attributes) && + Objects.equals(this.idPEntityId, saMLConnectionCreateRequest.idPEntityId) && + Objects.equals(this.idPMetadataUrl, saMLConnectionCreateRequest.idPMetadataUrl) && + Objects.equals(this.isIDPInitiated, saMLConnectionCreateRequest.isIDPInitiated) && + Objects.equals(this.idPLoginUrl, saMLConnectionCreateRequest.idPLoginUrl) && + Objects.equals(this.idPLogoutUrl, saMLConnectionCreateRequest.idPLogoutUrl) && + Objects.equals(this.idPCertificate, saMLConnectionCreateRequest.idPCertificate) && + Objects.equals(this.connectionType, saMLConnectionCreateRequest.connectionType)&& + Objects.equals(this.additionalProperties, saMLConnectionCreateRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, domain, attributes, idPEntityId, idPMetadataUrl, isIDPInitiated, idPLoginUrl, idPLogoutUrl, idPCertificate, connectionType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SAMLConnectionCreateRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" idPEntityId: ").append(toIndentedString(idPEntityId)).append("\n"); + sb.append(" idPMetadataUrl: ").append(toIndentedString(idPMetadataUrl)).append("\n"); + sb.append(" isIDPInitiated: ").append(toIndentedString(isIDPInitiated)).append("\n"); + sb.append(" idPLoginUrl: ").append(toIndentedString(idPLoginUrl)).append("\n"); + sb.append(" idPLogoutUrl: ").append(toIndentedString(idPLogoutUrl)).append("\n"); + sb.append(" idPCertificate: ").append(toIndentedString(idPCertificate)).append("\n"); + sb.append(" connectionType: ").append(toIndentedString(connectionType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + openapiFields.add("Domain"); + openapiFields.add("Attributes"); + openapiFields.add("IDPEntityId"); + openapiFields.add("IDPMetadataUrl"); + openapiFields.add("IsIDPInitiated"); + openapiFields.add("IDPLoginUrl"); + openapiFields.add("IDPLogoutUrl"); + openapiFields.add("IDPCertificate"); + openapiFields.add("ConnectionType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Name"); + openapiRequiredFields.add("Domain"); + openapiRequiredFields.add("ConnectionType"); + } + + /** + * 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 SAMLConnectionCreateRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SAMLConnectionCreateRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SAMLConnectionCreateRequest is not found in the empty JSON string", SAMLConnectionCreateRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SAMLConnectionCreateRequest.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("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("Domain").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Domain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Domain").toString())); + } + // validate the optional field `Attributes` + if (jsonObj.get("Attributes") != null && !jsonObj.get("Attributes").isJsonNull()) { + OrganizationsConnectionBaseAttributes.validateJsonElement(jsonObj.get("Attributes")); + } + if ((jsonObj.get("IDPEntityId") != null && !jsonObj.get("IDPEntityId").isJsonNull()) && !jsonObj.get("IDPEntityId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IDPEntityId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IDPEntityId").toString())); + } + if ((jsonObj.get("IDPMetadataUrl") != null && !jsonObj.get("IDPMetadataUrl").isJsonNull()) && !jsonObj.get("IDPMetadataUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IDPMetadataUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IDPMetadataUrl").toString())); + } + if ((jsonObj.get("IDPLoginUrl") != null && !jsonObj.get("IDPLoginUrl").isJsonNull()) && !jsonObj.get("IDPLoginUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IDPLoginUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IDPLoginUrl").toString())); + } + if ((jsonObj.get("IDPLogoutUrl") != null && !jsonObj.get("IDPLogoutUrl").isJsonNull()) && !jsonObj.get("IDPLogoutUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IDPLogoutUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IDPLogoutUrl").toString())); + } + if ((jsonObj.get("IDPCertificate") != null && !jsonObj.get("IDPCertificate").isJsonNull()) && !jsonObj.get("IDPCertificate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IDPCertificate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IDPCertificate").toString())); + } + if (!jsonObj.get("ConnectionType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ConnectionType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ConnectionType").toString())); + } + // validate the required field `ConnectionType` + ConnectionTypeEnum.validateJsonElement(jsonObj.get("ConnectionType")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SAMLConnectionCreateRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SAMLConnectionCreateRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SAMLConnectionCreateRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SAMLConnectionCreateRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<SAMLConnectionCreateRequest>() { + @Override + public void write(JsonWriter out, SAMLConnectionCreateRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SAMLConnectionCreateRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SAMLConnectionCreateRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SAMLConnectionCreateRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of SAMLConnectionCreateRequest + * @throws IOException if the JSON string is invalid with respect to SAMLConnectionCreateRequest + */ + public static SAMLConnectionCreateRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SAMLConnectionCreateRequest.class); + } + + /** + * Convert an instance of SAMLConnectionCreateRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SMSResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SMSResponse.java new file mode 100644 index 0000000..44ade28 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SMSResponse.java @@ -0,0 +1,323 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.SMSResponseData; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SMSResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SMSResponse { + public static final String SERIALIZED_NAME_IS_POSTED = "IsPosted"; + @SerializedName(SERIALIZED_NAME_IS_POSTED) + @javax.annotation.Nonnull + private Boolean isPosted; + + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nonnull + private SMSResponseData data; + + public SMSResponse() { + } + + public SMSResponse isPosted(@javax.annotation.Nonnull Boolean isPosted) { + this.isPosted = isPosted; + return this; + } + + /** + * Indicates whether the SMS was successfully posted + * @return isPosted + */ + @javax.annotation.Nonnull + public Boolean getIsPosted() { + return isPosted; + } + + public void setIsPosted(@javax.annotation.Nonnull Boolean isPosted) { + this.isPosted = isPosted; + } + + + public SMSResponse data(@javax.annotation.Nonnull SMSResponseData data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nonnull + public SMSResponseData getData() { + return data; + } + + public void setData(@javax.annotation.Nonnull SMSResponseData data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SMSResponse instance itself + */ + public SMSResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SMSResponse smSResponse = (SMSResponse) o; + return Objects.equals(this.isPosted, smSResponse.isPosted) && + Objects.equals(this.data, smSResponse.data)&& + Objects.equals(this.additionalProperties, smSResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isPosted, data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SMSResponse {\n"); + sb.append(" isPosted: ").append(toIndentedString(isPosted)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsPosted"); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("IsPosted"); + openapiRequiredFields.add("Data"); + } + + /** + * 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 SMSResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SMSResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SMSResponse is not found in the empty JSON string", SMSResponse.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SMSResponse.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 `Data` + SMSResponseData.validateJsonElement(jsonObj.get("Data")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SMSResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SMSResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SMSResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SMSResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<SMSResponse>() { + @Override + public void write(JsonWriter out, SMSResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SMSResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SMSResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SMSResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SMSResponse + * @throws IOException if the JSON string is invalid with respect to SMSResponse + */ + public static SMSResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SMSResponse.class); + } + + /** + * Convert an instance of SMSResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SMSResponseData.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SMSResponseData.java new file mode 100644 index 0000000..b3dcb1a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SMSResponseData.java @@ -0,0 +1,337 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SMS response data details + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SMSResponseData { + public static final String SERIALIZED_NAME_ACCOUNT_SID = "AccountSid"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_SID) + @javax.annotation.Nullable + private String accountSid; + + public static final String SERIALIZED_NAME_SID = "Sid"; + @SerializedName(SERIALIZED_NAME_SID) + @javax.annotation.Nonnull + private String sid; + + public SMSResponseData() { + } + + public SMSResponseData accountSid(@javax.annotation.Nullable String accountSid) { + this.accountSid = accountSid; + return this; + } + + /** + * The unique identifier for the Account + * @return accountSid + */ + @javax.annotation.Nullable + public String getAccountSid() { + return accountSid; + } + + public void setAccountSid(@javax.annotation.Nullable String accountSid) { + this.accountSid = accountSid; + } + + + public SMSResponseData sid(@javax.annotation.Nonnull String sid) { + this.sid = sid; + return this; + } + + /** + * The unique identifier for the SMS message + * @return sid + */ + @javax.annotation.Nonnull + public String getSid() { + return sid; + } + + public void setSid(@javax.annotation.Nonnull String sid) { + this.sid = sid; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SMSResponseData instance itself + */ + public SMSResponseData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SMSResponseData smSResponseData = (SMSResponseData) o; + return Objects.equals(this.accountSid, smSResponseData.accountSid) && + Objects.equals(this.sid, smSResponseData.sid)&& + Objects.equals(this.additionalProperties, smSResponseData.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(accountSid, sid, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SMSResponseData {\n"); + sb.append(" accountSid: ").append(toIndentedString(accountSid)).append("\n"); + sb.append(" sid: ").append(toIndentedString(sid)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AccountSid"); + openapiFields.add("Sid"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Sid"); + } + + /** + * 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 SMSResponseData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SMSResponseData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SMSResponseData is not found in the empty JSON string", SMSResponseData.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SMSResponseData.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("AccountSid") != null && !jsonObj.get("AccountSid").isJsonNull()) && !jsonObj.get("AccountSid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccountSid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccountSid").toString())); + } + if (!jsonObj.get("Sid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Sid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Sid").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SMSResponseData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SMSResponseData' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SMSResponseData> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SMSResponseData.class)); + + return (TypeAdapter<T>) new TypeAdapter<SMSResponseData>() { + @Override + public void write(JsonWriter out, SMSResponseData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SMSResponseData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SMSResponseData instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SMSResponseData given an JSON string + * + * @param jsonString JSON string + * @return An instance of SMSResponseData + * @throws IOException if the JSON string is invalid with respect to SMSResponseData + */ + public static SMSResponseData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SMSResponseData.class); + } + + /** + * Convert an instance of SMSResponseData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlConnectionRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlConnectionRequest.java new file mode 100644 index 0000000..2b40d8b --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlConnectionRequest.java @@ -0,0 +1,618 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.OrganizationsConnectionBaseAttributes; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SamlConnectionRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SamlConnectionRequest { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_DOMAIN = "Domain"; + @SerializedName(SERIALIZED_NAME_DOMAIN) + @javax.annotation.Nullable + private String domain; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "Attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nullable + private OrganizationsConnectionBaseAttributes attributes; + + public static final String SERIALIZED_NAME_ID_P_ENTITY_ID = "IDPEntityId"; + @SerializedName(SERIALIZED_NAME_ID_P_ENTITY_ID) + @javax.annotation.Nullable + private String idPEntityId; + + public static final String SERIALIZED_NAME_ID_P_METADATA_URL = "IDPMetadataUrl"; + @SerializedName(SERIALIZED_NAME_ID_P_METADATA_URL) + @javax.annotation.Nullable + private String idPMetadataUrl; + + public static final String SERIALIZED_NAME_IS_I_D_P_INITIATED = "IsIDPInitiated"; + @SerializedName(SERIALIZED_NAME_IS_I_D_P_INITIATED) + @javax.annotation.Nullable + private Boolean isIDPInitiated; + + public static final String SERIALIZED_NAME_ID_P_LOGIN_URL = "IDPLoginUrl"; + @SerializedName(SERIALIZED_NAME_ID_P_LOGIN_URL) + @javax.annotation.Nullable + private String idPLoginUrl; + + public static final String SERIALIZED_NAME_ID_P_LOGOUT_URL = "IDPLogoutUrl"; + @SerializedName(SERIALIZED_NAME_ID_P_LOGOUT_URL) + @javax.annotation.Nullable + private String idPLogoutUrl; + + public static final String SERIALIZED_NAME_ID_P_CERTIFICATE = "IDPCertificate"; + @SerializedName(SERIALIZED_NAME_ID_P_CERTIFICATE) + @javax.annotation.Nullable + private String idPCertificate; + + /** + * Type of the connection, which is SAML in this case. + */ + @JsonAdapter(ConnectionTypeEnum.Adapter.class) + public enum ConnectionTypeEnum { + CUSTOM("saml_custom"), + + OKTA("saml_okta"), + + ENTRAID("saml_entraid"), + + GOOGLE_WORKSPACE("saml_google_workspace"), + + SALESFORCE("saml_salesforce"); + + private String value; + + ConnectionTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ConnectionTypeEnum fromValue(String value) { + for (ConnectionTypeEnum b : ConnectionTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<ConnectionTypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final ConnectionTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ConnectionTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ConnectionTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ConnectionTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CONNECTION_TYPE = "ConnectionType"; + @SerializedName(SERIALIZED_NAME_CONNECTION_TYPE) + @javax.annotation.Nullable + private ConnectionTypeEnum connectionType; + + public SamlConnectionRequest() { + } + + public SamlConnectionRequest name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Name of the connection + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public SamlConnectionRequest domain(@javax.annotation.Nullable String domain) { + this.domain = domain; + return this; + } + + /** + * Domain associated with the connection + * @return domain + */ + @javax.annotation.Nullable + public String getDomain() { + return domain; + } + + public void setDomain(@javax.annotation.Nullable String domain) { + this.domain = domain; + } + + + public SamlConnectionRequest attributes(@javax.annotation.Nullable OrganizationsConnectionBaseAttributes attributes) { + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nullable + public OrganizationsConnectionBaseAttributes getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nullable OrganizationsConnectionBaseAttributes attributes) { + this.attributes = attributes; + } + + + public SamlConnectionRequest idPEntityId(@javax.annotation.Nullable String idPEntityId) { + this.idPEntityId = idPEntityId; + return this; + } + + /** + * Unique identifier for the Identity Provider (IdP). + * @return idPEntityId + */ + @javax.annotation.Nullable + public String getIdPEntityId() { + return idPEntityId; + } + + public void setIdPEntityId(@javax.annotation.Nullable String idPEntityId) { + this.idPEntityId = idPEntityId; + } + + + public SamlConnectionRequest idPMetadataUrl(@javax.annotation.Nullable String idPMetadataUrl) { + this.idPMetadataUrl = idPMetadataUrl; + return this; + } + + /** + * URL to the IdP metadata XML file. + * @return idPMetadataUrl + */ + @javax.annotation.Nullable + public String getIdPMetadataUrl() { + return idPMetadataUrl; + } + + public void setIdPMetadataUrl(@javax.annotation.Nullable String idPMetadataUrl) { + this.idPMetadataUrl = idPMetadataUrl; + } + + + public SamlConnectionRequest isIDPInitiated(@javax.annotation.Nullable Boolean isIDPInitiated) { + this.isIDPInitiated = isIDPInitiated; + return this; + } + + /** + * Indicates whether the SAML connection is initiated by the IdP. + * @return isIDPInitiated + */ + @javax.annotation.Nullable + public Boolean getIsIDPInitiated() { + return isIDPInitiated; + } + + public void setIsIDPInitiated(@javax.annotation.Nullable Boolean isIDPInitiated) { + this.isIDPInitiated = isIDPInitiated; + } + + + public SamlConnectionRequest idPLoginUrl(@javax.annotation.Nullable String idPLoginUrl) { + this.idPLoginUrl = idPLoginUrl; + return this; + } + + /** + * The IdP's SAML single sign-on (login) URL. + * @return idPLoginUrl + */ + @javax.annotation.Nullable + public String getIdPLoginUrl() { + return idPLoginUrl; + } + + public void setIdPLoginUrl(@javax.annotation.Nullable String idPLoginUrl) { + this.idPLoginUrl = idPLoginUrl; + } + + + public SamlConnectionRequest idPLogoutUrl(@javax.annotation.Nullable String idPLogoutUrl) { + this.idPLogoutUrl = idPLogoutUrl; + return this; + } + + /** + * The IdP's SAML single logout (SLO) URL. + * @return idPLogoutUrl + */ + @javax.annotation.Nullable + public String getIdPLogoutUrl() { + return idPLogoutUrl; + } + + public void setIdPLogoutUrl(@javax.annotation.Nullable String idPLogoutUrl) { + this.idPLogoutUrl = idPLogoutUrl; + } + + + public SamlConnectionRequest idPCertificate(@javax.annotation.Nullable String idPCertificate) { + this.idPCertificate = idPCertificate; + return this; + } + + /** + * PEM-encoded IdP signing certificate used to verify SAML assertions. + * @return idPCertificate + */ + @javax.annotation.Nullable + public String getIdPCertificate() { + return idPCertificate; + } + + public void setIdPCertificate(@javax.annotation.Nullable String idPCertificate) { + this.idPCertificate = idPCertificate; + } + + + public SamlConnectionRequest connectionType(@javax.annotation.Nullable ConnectionTypeEnum connectionType) { + this.connectionType = connectionType; + return this; + } + + /** + * Type of the connection, which is SAML in this case. + * @return connectionType + */ + @javax.annotation.Nullable + public ConnectionTypeEnum getConnectionType() { + return connectionType; + } + + public void setConnectionType(@javax.annotation.Nullable ConnectionTypeEnum connectionType) { + this.connectionType = connectionType; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SamlConnectionRequest instance itself + */ + public SamlConnectionRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SamlConnectionRequest samlConnectionRequest = (SamlConnectionRequest) o; + return Objects.equals(this.name, samlConnectionRequest.name) && + Objects.equals(this.domain, samlConnectionRequest.domain) && + Objects.equals(this.attributes, samlConnectionRequest.attributes) && + Objects.equals(this.idPEntityId, samlConnectionRequest.idPEntityId) && + Objects.equals(this.idPMetadataUrl, samlConnectionRequest.idPMetadataUrl) && + Objects.equals(this.isIDPInitiated, samlConnectionRequest.isIDPInitiated) && + Objects.equals(this.idPLoginUrl, samlConnectionRequest.idPLoginUrl) && + Objects.equals(this.idPLogoutUrl, samlConnectionRequest.idPLogoutUrl) && + Objects.equals(this.idPCertificate, samlConnectionRequest.idPCertificate) && + Objects.equals(this.connectionType, samlConnectionRequest.connectionType)&& + Objects.equals(this.additionalProperties, samlConnectionRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, domain, attributes, idPEntityId, idPMetadataUrl, isIDPInitiated, idPLoginUrl, idPLogoutUrl, idPCertificate, connectionType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SamlConnectionRequest {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" idPEntityId: ").append(toIndentedString(idPEntityId)).append("\n"); + sb.append(" idPMetadataUrl: ").append(toIndentedString(idPMetadataUrl)).append("\n"); + sb.append(" isIDPInitiated: ").append(toIndentedString(isIDPInitiated)).append("\n"); + sb.append(" idPLoginUrl: ").append(toIndentedString(idPLoginUrl)).append("\n"); + sb.append(" idPLogoutUrl: ").append(toIndentedString(idPLogoutUrl)).append("\n"); + sb.append(" idPCertificate: ").append(toIndentedString(idPCertificate)).append("\n"); + sb.append(" connectionType: ").append(toIndentedString(connectionType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + openapiFields.add("Domain"); + openapiFields.add("Attributes"); + openapiFields.add("IDPEntityId"); + openapiFields.add("IDPMetadataUrl"); + openapiFields.add("IsIDPInitiated"); + openapiFields.add("IDPLoginUrl"); + openapiFields.add("IDPLogoutUrl"); + openapiFields.add("IDPCertificate"); + openapiFields.add("ConnectionType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SamlConnectionRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SamlConnectionRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SamlConnectionRequest is not found in the empty JSON string", SamlConnectionRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Domain") != null && !jsonObj.get("Domain").isJsonNull()) && !jsonObj.get("Domain").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Domain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Domain").toString())); + } + // validate the optional field `Attributes` + if (jsonObj.get("Attributes") != null && !jsonObj.get("Attributes").isJsonNull()) { + OrganizationsConnectionBaseAttributes.validateJsonElement(jsonObj.get("Attributes")); + } + if ((jsonObj.get("IDPEntityId") != null && !jsonObj.get("IDPEntityId").isJsonNull()) && !jsonObj.get("IDPEntityId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IDPEntityId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IDPEntityId").toString())); + } + if ((jsonObj.get("IDPMetadataUrl") != null && !jsonObj.get("IDPMetadataUrl").isJsonNull()) && !jsonObj.get("IDPMetadataUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IDPMetadataUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IDPMetadataUrl").toString())); + } + if ((jsonObj.get("IDPLoginUrl") != null && !jsonObj.get("IDPLoginUrl").isJsonNull()) && !jsonObj.get("IDPLoginUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IDPLoginUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IDPLoginUrl").toString())); + } + if ((jsonObj.get("IDPLogoutUrl") != null && !jsonObj.get("IDPLogoutUrl").isJsonNull()) && !jsonObj.get("IDPLogoutUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IDPLogoutUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IDPLogoutUrl").toString())); + } + if ((jsonObj.get("IDPCertificate") != null && !jsonObj.get("IDPCertificate").isJsonNull()) && !jsonObj.get("IDPCertificate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IDPCertificate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IDPCertificate").toString())); + } + if ((jsonObj.get("ConnectionType") != null && !jsonObj.get("ConnectionType").isJsonNull()) && !jsonObj.get("ConnectionType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ConnectionType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ConnectionType").toString())); + } + // validate the optional field `ConnectionType` + if (jsonObj.get("ConnectionType") != null && !jsonObj.get("ConnectionType").isJsonNull()) { + ConnectionTypeEnum.validateJsonElement(jsonObj.get("ConnectionType")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SamlConnectionRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SamlConnectionRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SamlConnectionRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SamlConnectionRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<SamlConnectionRequest>() { + @Override + public void write(JsonWriter out, SamlConnectionRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SamlConnectionRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SamlConnectionRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SamlConnectionRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of SamlConnectionRequest + * @throws IOException if the JSON string is invalid with respect to SamlConnectionRequest + */ + public static SamlConnectionRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SamlConnectionRequest.class); + } + + /** + * Convert an instance of SamlConnectionRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlConnectionRequestCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlConnectionRequestCore.java new file mode 100644 index 0000000..ca9d93a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlConnectionRequestCore.java @@ -0,0 +1,379 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SamlConnectionRequestCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SamlConnectionRequestCore { + /** + * Type of the connection, which is SAML in this case. + */ + @JsonAdapter(ConnectionTypeEnum.Adapter.class) + public enum ConnectionTypeEnum { + CUSTOM("saml_custom"), + + OKTA("saml_okta"), + + ENTRAID("saml_entraid"), + + GOOGLE_WORKSPACE("saml_google_workspace"), + + SALESFORCE("saml_salesforce"); + + private String value; + + ConnectionTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ConnectionTypeEnum fromValue(String value) { + for (ConnectionTypeEnum b : ConnectionTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<ConnectionTypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final ConnectionTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ConnectionTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ConnectionTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ConnectionTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CONNECTION_TYPE = "ConnectionType"; + @SerializedName(SERIALIZED_NAME_CONNECTION_TYPE) + @javax.annotation.Nullable + private ConnectionTypeEnum connectionType; + + public static final String SERIALIZED_NAME_ID_P_CERTIFICATE = "IDPCertificate"; + @SerializedName(SERIALIZED_NAME_ID_P_CERTIFICATE) + @javax.annotation.Nullable + private String idPCertificate; + + public SamlConnectionRequestCore() { + } + + public SamlConnectionRequestCore connectionType(@javax.annotation.Nullable ConnectionTypeEnum connectionType) { + this.connectionType = connectionType; + return this; + } + + /** + * Type of the connection, which is SAML in this case. + * @return connectionType + */ + @javax.annotation.Nullable + public ConnectionTypeEnum getConnectionType() { + return connectionType; + } + + public void setConnectionType(@javax.annotation.Nullable ConnectionTypeEnum connectionType) { + this.connectionType = connectionType; + } + + + public SamlConnectionRequestCore idPCertificate(@javax.annotation.Nullable String idPCertificate) { + this.idPCertificate = idPCertificate; + return this; + } + + /** + * PEM-encoded IdP signing certificate used to verify SAML assertions. + * @return idPCertificate + */ + @javax.annotation.Nullable + public String getIdPCertificate() { + return idPCertificate; + } + + public void setIdPCertificate(@javax.annotation.Nullable String idPCertificate) { + this.idPCertificate = idPCertificate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SamlConnectionRequestCore instance itself + */ + public SamlConnectionRequestCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SamlConnectionRequestCore samlConnectionRequestCore = (SamlConnectionRequestCore) o; + return Objects.equals(this.connectionType, samlConnectionRequestCore.connectionType) && + Objects.equals(this.idPCertificate, samlConnectionRequestCore.idPCertificate)&& + Objects.equals(this.additionalProperties, samlConnectionRequestCore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(connectionType, idPCertificate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SamlConnectionRequestCore {\n"); + sb.append(" connectionType: ").append(toIndentedString(connectionType)).append("\n"); + sb.append(" idPCertificate: ").append(toIndentedString(idPCertificate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ConnectionType"); + openapiFields.add("IDPCertificate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SamlConnectionRequestCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SamlConnectionRequestCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SamlConnectionRequestCore is not found in the empty JSON string", SamlConnectionRequestCore.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ConnectionType") != null && !jsonObj.get("ConnectionType").isJsonNull()) && !jsonObj.get("ConnectionType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ConnectionType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ConnectionType").toString())); + } + // validate the optional field `ConnectionType` + if (jsonObj.get("ConnectionType") != null && !jsonObj.get("ConnectionType").isJsonNull()) { + ConnectionTypeEnum.validateJsonElement(jsonObj.get("ConnectionType")); + } + if ((jsonObj.get("IDPCertificate") != null && !jsonObj.get("IDPCertificate").isJsonNull()) && !jsonObj.get("IDPCertificate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IDPCertificate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IDPCertificate").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SamlConnectionRequestCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SamlConnectionRequestCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SamlConnectionRequestCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SamlConnectionRequestCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<SamlConnectionRequestCore>() { + @Override + public void write(JsonWriter out, SamlConnectionRequestCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SamlConnectionRequestCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SamlConnectionRequestCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SamlConnectionRequestCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of SamlConnectionRequestCore + * @throws IOException if the JSON string is invalid with respect to SamlConnectionRequestCore + */ + public static SamlConnectionRequestCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SamlConnectionRequestCore.class); + } + + /** + * Convert an instance of SamlConnectionRequestCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlConnectionResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlConnectionResponse.java new file mode 100644 index 0000000..98742b1 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlConnectionResponse.java @@ -0,0 +1,697 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.OrganizationsConnectionSamlBaseIDPCertificate; +import com.loginradius.sdk.internal.openapi.model.SamlConnectionResponseCoreSPCertificate; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SamlConnectionResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SamlConnectionResponse { + public static final String SERIALIZED_NAME_ID_P_ENTITY_ID = "IDPEntityId"; + @SerializedName(SERIALIZED_NAME_ID_P_ENTITY_ID) + @javax.annotation.Nullable + private String idPEntityId; + + public static final String SERIALIZED_NAME_ID_P_METADATA_URL = "IDPMetadataUrl"; + @SerializedName(SERIALIZED_NAME_ID_P_METADATA_URL) + @javax.annotation.Nullable + private String idPMetadataUrl; + + public static final String SERIALIZED_NAME_IS_I_D_P_INITIATED = "IsIDPInitiated"; + @SerializedName(SERIALIZED_NAME_IS_I_D_P_INITIATED) + @javax.annotation.Nullable + private Boolean isIDPInitiated; + + public static final String SERIALIZED_NAME_ID_P_LOGIN_URL = "IDPLoginUrl"; + @SerializedName(SERIALIZED_NAME_ID_P_LOGIN_URL) + @javax.annotation.Nullable + private String idPLoginUrl; + + public static final String SERIALIZED_NAME_ID_P_LOGOUT_URL = "IDPLogoutUrl"; + @SerializedName(SERIALIZED_NAME_ID_P_LOGOUT_URL) + @javax.annotation.Nullable + private String idPLogoutUrl; + + public static final String SERIALIZED_NAME_ID_P_CERTIFICATE = "IDPCertificate"; + @SerializedName(SERIALIZED_NAME_ID_P_CERTIFICATE) + @javax.annotation.Nullable + private OrganizationsConnectionSamlBaseIDPCertificate idPCertificate; + + /** + * The type of SAML connection. + */ + @JsonAdapter(ConnectionTypeEnum.Adapter.class) + public enum ConnectionTypeEnum { + CUSTOM("saml_custom"), + + OKTA("saml_okta"), + + ENTRAID("saml_entraid"), + + GOOGLE_WORKSPACE("saml_google_workspace"), + + SALESFORCE("saml_salesforce"); + + private String value; + + ConnectionTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ConnectionTypeEnum fromValue(String value) { + for (ConnectionTypeEnum b : ConnectionTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<ConnectionTypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final ConnectionTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ConnectionTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ConnectionTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ConnectionTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CONNECTION_TYPE = "ConnectionType"; + @SerializedName(SERIALIZED_NAME_CONNECTION_TYPE) + @javax.annotation.Nullable + private ConnectionTypeEnum connectionType; + + public static final String SERIALIZED_NAME_ID_P_LOGIN_BINDING = "IDPLoginBinding"; + @SerializedName(SERIALIZED_NAME_ID_P_LOGIN_BINDING) + @javax.annotation.Nullable + private String idPLoginBinding; + + public static final String SERIALIZED_NAME_ID_P_LOGOUT_BINDING = "IDPLogoutBinding"; + @SerializedName(SERIALIZED_NAME_ID_P_LOGOUT_BINDING) + @javax.annotation.Nullable + private String idPLogoutBinding; + + public static final String SERIALIZED_NAME_ENTITY_ID = "EntityId"; + @SerializedName(SERIALIZED_NAME_ENTITY_ID) + @javax.annotation.Nullable + private String entityId; + + public static final String SERIALIZED_NAME_METADATA_URL = "MetadataUrl"; + @SerializedName(SERIALIZED_NAME_METADATA_URL) + @javax.annotation.Nullable + private String metadataUrl; + + public static final String SERIALIZED_NAME_AC_S_ENDPOINT = "ACSEndpoint"; + @SerializedName(SERIALIZED_NAME_AC_S_ENDPOINT) + @javax.annotation.Nullable + private String acSEndpoint; + + public static final String SERIALIZED_NAME_SP_CERTIFICATE = "SPCertificate"; + @SerializedName(SERIALIZED_NAME_SP_CERTIFICATE) + @javax.annotation.Nullable + private SamlConnectionResponseCoreSPCertificate spCertificate; + + public SamlConnectionResponse() { + } + + public SamlConnectionResponse( + String idPLoginBinding, + String idPLogoutBinding, + String entityId, + String metadataUrl, + String acSEndpoint + ) { + this(); + this.idPLoginBinding = idPLoginBinding; + this.idPLogoutBinding = idPLogoutBinding; + this.entityId = entityId; + this.metadataUrl = metadataUrl; + this.acSEndpoint = acSEndpoint; + } + + public SamlConnectionResponse idPEntityId(@javax.annotation.Nullable String idPEntityId) { + this.idPEntityId = idPEntityId; + return this; + } + + /** + * Unique identifier for the Identity Provider (IdP). + * @return idPEntityId + */ + @javax.annotation.Nullable + public String getIdPEntityId() { + return idPEntityId; + } + + public void setIdPEntityId(@javax.annotation.Nullable String idPEntityId) { + this.idPEntityId = idPEntityId; + } + + + public SamlConnectionResponse idPMetadataUrl(@javax.annotation.Nullable String idPMetadataUrl) { + this.idPMetadataUrl = idPMetadataUrl; + return this; + } + + /** + * URL to the IdP metadata XML file. + * @return idPMetadataUrl + */ + @javax.annotation.Nullable + public String getIdPMetadataUrl() { + return idPMetadataUrl; + } + + public void setIdPMetadataUrl(@javax.annotation.Nullable String idPMetadataUrl) { + this.idPMetadataUrl = idPMetadataUrl; + } + + + public SamlConnectionResponse isIDPInitiated(@javax.annotation.Nullable Boolean isIDPInitiated) { + this.isIDPInitiated = isIDPInitiated; + return this; + } + + /** + * Indicates whether the SAML connection is initiated by the IdP. + * @return isIDPInitiated + */ + @javax.annotation.Nullable + public Boolean getIsIDPInitiated() { + return isIDPInitiated; + } + + public void setIsIDPInitiated(@javax.annotation.Nullable Boolean isIDPInitiated) { + this.isIDPInitiated = isIDPInitiated; + } + + + public SamlConnectionResponse idPLoginUrl(@javax.annotation.Nullable String idPLoginUrl) { + this.idPLoginUrl = idPLoginUrl; + return this; + } + + /** + * The IdP's SAML single sign-on (login) URL. + * @return idPLoginUrl + */ + @javax.annotation.Nullable + public String getIdPLoginUrl() { + return idPLoginUrl; + } + + public void setIdPLoginUrl(@javax.annotation.Nullable String idPLoginUrl) { + this.idPLoginUrl = idPLoginUrl; + } + + + public SamlConnectionResponse idPLogoutUrl(@javax.annotation.Nullable String idPLogoutUrl) { + this.idPLogoutUrl = idPLogoutUrl; + return this; + } + + /** + * The IdP's SAML single logout (SLO) URL. + * @return idPLogoutUrl + */ + @javax.annotation.Nullable + public String getIdPLogoutUrl() { + return idPLogoutUrl; + } + + public void setIdPLogoutUrl(@javax.annotation.Nullable String idPLogoutUrl) { + this.idPLogoutUrl = idPLogoutUrl; + } + + + public SamlConnectionResponse idPCertificate(@javax.annotation.Nullable OrganizationsConnectionSamlBaseIDPCertificate idPCertificate) { + this.idPCertificate = idPCertificate; + return this; + } + + /** + * Get idPCertificate + * @return idPCertificate + */ + @javax.annotation.Nullable + public OrganizationsConnectionSamlBaseIDPCertificate getIdPCertificate() { + return idPCertificate; + } + + public void setIdPCertificate(@javax.annotation.Nullable OrganizationsConnectionSamlBaseIDPCertificate idPCertificate) { + this.idPCertificate = idPCertificate; + } + + + public SamlConnectionResponse connectionType(@javax.annotation.Nullable ConnectionTypeEnum connectionType) { + this.connectionType = connectionType; + return this; + } + + /** + * The type of SAML connection. + * @return connectionType + */ + @javax.annotation.Nullable + public ConnectionTypeEnum getConnectionType() { + return connectionType; + } + + public void setConnectionType(@javax.annotation.Nullable ConnectionTypeEnum connectionType) { + this.connectionType = connectionType; + } + + + /** + * SAML binding for the IdP login URL, derived from the IdP metadata. + * @return idPLoginBinding + */ + @javax.annotation.Nullable + public String getIdPLoginBinding() { + return idPLoginBinding; + } + + + + /** + * SAML binding for the IdP logout URL, derived from the IdP metadata. + * @return idPLogoutBinding + */ + @javax.annotation.Nullable + public String getIdPLogoutBinding() { + return idPLogoutBinding; + } + + + + /** + * The unique identifier for the SAML service provider. + * @return entityId + */ + @javax.annotation.Nullable + public String getEntityId() { + return entityId; + } + + + + /** + * The URL to the SAML metadata XML file. + * @return metadataUrl + */ + @javax.annotation.Nullable + public String getMetadataUrl() { + return metadataUrl; + } + + + + /** + * The Assertion Consumer Service (ACS) endpoint URL for SAML responses. + * @return acSEndpoint + */ + @javax.annotation.Nullable + public String getAcSEndpoint() { + return acSEndpoint; + } + + + + public SamlConnectionResponse spCertificate(@javax.annotation.Nullable SamlConnectionResponseCoreSPCertificate spCertificate) { + this.spCertificate = spCertificate; + return this; + } + + /** + * Get spCertificate + * @return spCertificate + */ + @javax.annotation.Nullable + public SamlConnectionResponseCoreSPCertificate getSpCertificate() { + return spCertificate; + } + + public void setSpCertificate(@javax.annotation.Nullable SamlConnectionResponseCoreSPCertificate spCertificate) { + this.spCertificate = spCertificate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SamlConnectionResponse instance itself + */ + public SamlConnectionResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SamlConnectionResponse samlConnectionResponse = (SamlConnectionResponse) o; + return Objects.equals(this.idPEntityId, samlConnectionResponse.idPEntityId) && + Objects.equals(this.idPMetadataUrl, samlConnectionResponse.idPMetadataUrl) && + Objects.equals(this.isIDPInitiated, samlConnectionResponse.isIDPInitiated) && + Objects.equals(this.idPLoginUrl, samlConnectionResponse.idPLoginUrl) && + Objects.equals(this.idPLogoutUrl, samlConnectionResponse.idPLogoutUrl) && + Objects.equals(this.idPCertificate, samlConnectionResponse.idPCertificate) && + Objects.equals(this.connectionType, samlConnectionResponse.connectionType) && + Objects.equals(this.idPLoginBinding, samlConnectionResponse.idPLoginBinding) && + Objects.equals(this.idPLogoutBinding, samlConnectionResponse.idPLogoutBinding) && + Objects.equals(this.entityId, samlConnectionResponse.entityId) && + Objects.equals(this.metadataUrl, samlConnectionResponse.metadataUrl) && + Objects.equals(this.acSEndpoint, samlConnectionResponse.acSEndpoint) && + Objects.equals(this.spCertificate, samlConnectionResponse.spCertificate)&& + Objects.equals(this.additionalProperties, samlConnectionResponse.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(idPEntityId, idPMetadataUrl, isIDPInitiated, idPLoginUrl, idPLogoutUrl, idPCertificate, connectionType, idPLoginBinding, idPLogoutBinding, entityId, metadataUrl, acSEndpoint, spCertificate, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SamlConnectionResponse {\n"); + sb.append(" idPEntityId: ").append(toIndentedString(idPEntityId)).append("\n"); + sb.append(" idPMetadataUrl: ").append(toIndentedString(idPMetadataUrl)).append("\n"); + sb.append(" isIDPInitiated: ").append(toIndentedString(isIDPInitiated)).append("\n"); + sb.append(" idPLoginUrl: ").append(toIndentedString(idPLoginUrl)).append("\n"); + sb.append(" idPLogoutUrl: ").append(toIndentedString(idPLogoutUrl)).append("\n"); + sb.append(" idPCertificate: ").append(toIndentedString(idPCertificate)).append("\n"); + sb.append(" connectionType: ").append(toIndentedString(connectionType)).append("\n"); + sb.append(" idPLoginBinding: ").append(toIndentedString(idPLoginBinding)).append("\n"); + sb.append(" idPLogoutBinding: ").append(toIndentedString(idPLogoutBinding)).append("\n"); + sb.append(" entityId: ").append(toIndentedString(entityId)).append("\n"); + sb.append(" metadataUrl: ").append(toIndentedString(metadataUrl)).append("\n"); + sb.append(" acSEndpoint: ").append(toIndentedString(acSEndpoint)).append("\n"); + sb.append(" spCertificate: ").append(toIndentedString(spCertificate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IDPEntityId"); + openapiFields.add("IDPMetadataUrl"); + openapiFields.add("IsIDPInitiated"); + openapiFields.add("IDPLoginUrl"); + openapiFields.add("IDPLogoutUrl"); + openapiFields.add("IDPCertificate"); + openapiFields.add("ConnectionType"); + openapiFields.add("IDPLoginBinding"); + openapiFields.add("IDPLogoutBinding"); + openapiFields.add("EntityId"); + openapiFields.add("MetadataUrl"); + openapiFields.add("ACSEndpoint"); + openapiFields.add("SPCertificate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SamlConnectionResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SamlConnectionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SamlConnectionResponse is not found in the empty JSON string", SamlConnectionResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("IDPEntityId") != null && !jsonObj.get("IDPEntityId").isJsonNull()) && !jsonObj.get("IDPEntityId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IDPEntityId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IDPEntityId").toString())); + } + if ((jsonObj.get("IDPMetadataUrl") != null && !jsonObj.get("IDPMetadataUrl").isJsonNull()) && !jsonObj.get("IDPMetadataUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IDPMetadataUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IDPMetadataUrl").toString())); + } + if ((jsonObj.get("IDPLoginUrl") != null && !jsonObj.get("IDPLoginUrl").isJsonNull()) && !jsonObj.get("IDPLoginUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IDPLoginUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IDPLoginUrl").toString())); + } + if ((jsonObj.get("IDPLogoutUrl") != null && !jsonObj.get("IDPLogoutUrl").isJsonNull()) && !jsonObj.get("IDPLogoutUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IDPLogoutUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IDPLogoutUrl").toString())); + } + // validate the optional field `IDPCertificate` + if (jsonObj.get("IDPCertificate") != null && !jsonObj.get("IDPCertificate").isJsonNull()) { + OrganizationsConnectionSamlBaseIDPCertificate.validateJsonElement(jsonObj.get("IDPCertificate")); + } + if ((jsonObj.get("ConnectionType") != null && !jsonObj.get("ConnectionType").isJsonNull()) && !jsonObj.get("ConnectionType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ConnectionType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ConnectionType").toString())); + } + // validate the optional field `ConnectionType` + if (jsonObj.get("ConnectionType") != null && !jsonObj.get("ConnectionType").isJsonNull()) { + ConnectionTypeEnum.validateJsonElement(jsonObj.get("ConnectionType")); + } + if ((jsonObj.get("IDPLoginBinding") != null && !jsonObj.get("IDPLoginBinding").isJsonNull()) && !jsonObj.get("IDPLoginBinding").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IDPLoginBinding` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IDPLoginBinding").toString())); + } + if ((jsonObj.get("IDPLogoutBinding") != null && !jsonObj.get("IDPLogoutBinding").isJsonNull()) && !jsonObj.get("IDPLogoutBinding").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IDPLogoutBinding` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IDPLogoutBinding").toString())); + } + if ((jsonObj.get("EntityId") != null && !jsonObj.get("EntityId").isJsonNull()) && !jsonObj.get("EntityId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `EntityId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("EntityId").toString())); + } + if ((jsonObj.get("MetadataUrl") != null && !jsonObj.get("MetadataUrl").isJsonNull()) && !jsonObj.get("MetadataUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MetadataUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MetadataUrl").toString())); + } + if ((jsonObj.get("ACSEndpoint") != null && !jsonObj.get("ACSEndpoint").isJsonNull()) && !jsonObj.get("ACSEndpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ACSEndpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ACSEndpoint").toString())); + } + // validate the optional field `SPCertificate` + if (jsonObj.get("SPCertificate") != null && !jsonObj.get("SPCertificate").isJsonNull()) { + SamlConnectionResponseCoreSPCertificate.validateJsonElement(jsonObj.get("SPCertificate")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SamlConnectionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SamlConnectionResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SamlConnectionResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SamlConnectionResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<SamlConnectionResponse>() { + @Override + public void write(JsonWriter out, SamlConnectionResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SamlConnectionResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SamlConnectionResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SamlConnectionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SamlConnectionResponse + * @throws IOException if the JSON string is invalid with respect to SamlConnectionResponse + */ + public static SamlConnectionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SamlConnectionResponse.class); + } + + /** + * Convert an instance of SamlConnectionResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlConnectionResponseCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlConnectionResponseCore.java new file mode 100644 index 0000000..c7b1a08 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlConnectionResponseCore.java @@ -0,0 +1,518 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.SamlConnectionResponseCoreSPCertificate; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SamlConnectionResponseCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SamlConnectionResponseCore { + /** + * The type of SAML connection. + */ + @JsonAdapter(ConnectionTypeEnum.Adapter.class) + public enum ConnectionTypeEnum { + CUSTOM("saml_custom"), + + OKTA("saml_okta"), + + ENTRAID("saml_entraid"), + + GOOGLE_WORKSPACE("saml_google_workspace"), + + SALESFORCE("saml_salesforce"); + + private String value; + + ConnectionTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ConnectionTypeEnum fromValue(String value) { + for (ConnectionTypeEnum b : ConnectionTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<ConnectionTypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final ConnectionTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ConnectionTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ConnectionTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + ConnectionTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_CONNECTION_TYPE = "ConnectionType"; + @SerializedName(SERIALIZED_NAME_CONNECTION_TYPE) + @javax.annotation.Nullable + private ConnectionTypeEnum connectionType; + + public static final String SERIALIZED_NAME_ID_P_LOGIN_BINDING = "IDPLoginBinding"; + @SerializedName(SERIALIZED_NAME_ID_P_LOGIN_BINDING) + @javax.annotation.Nullable + private String idPLoginBinding; + + public static final String SERIALIZED_NAME_ID_P_LOGOUT_BINDING = "IDPLogoutBinding"; + @SerializedName(SERIALIZED_NAME_ID_P_LOGOUT_BINDING) + @javax.annotation.Nullable + private String idPLogoutBinding; + + public static final String SERIALIZED_NAME_ENTITY_ID = "EntityId"; + @SerializedName(SERIALIZED_NAME_ENTITY_ID) + @javax.annotation.Nullable + private String entityId; + + public static final String SERIALIZED_NAME_METADATA_URL = "MetadataUrl"; + @SerializedName(SERIALIZED_NAME_METADATA_URL) + @javax.annotation.Nullable + private String metadataUrl; + + public static final String SERIALIZED_NAME_AC_S_ENDPOINT = "ACSEndpoint"; + @SerializedName(SERIALIZED_NAME_AC_S_ENDPOINT) + @javax.annotation.Nullable + private String acSEndpoint; + + public static final String SERIALIZED_NAME_SP_CERTIFICATE = "SPCertificate"; + @SerializedName(SERIALIZED_NAME_SP_CERTIFICATE) + @javax.annotation.Nullable + private SamlConnectionResponseCoreSPCertificate spCertificate; + + public SamlConnectionResponseCore() { + } + + public SamlConnectionResponseCore( + String idPLoginBinding, + String idPLogoutBinding, + String entityId, + String metadataUrl, + String acSEndpoint + ) { + this(); + this.idPLoginBinding = idPLoginBinding; + this.idPLogoutBinding = idPLogoutBinding; + this.entityId = entityId; + this.metadataUrl = metadataUrl; + this.acSEndpoint = acSEndpoint; + } + + public SamlConnectionResponseCore connectionType(@javax.annotation.Nullable ConnectionTypeEnum connectionType) { + this.connectionType = connectionType; + return this; + } + + /** + * The type of SAML connection. + * @return connectionType + */ + @javax.annotation.Nullable + public ConnectionTypeEnum getConnectionType() { + return connectionType; + } + + public void setConnectionType(@javax.annotation.Nullable ConnectionTypeEnum connectionType) { + this.connectionType = connectionType; + } + + + /** + * SAML binding for the IdP login URL, derived from the IdP metadata. + * @return idPLoginBinding + */ + @javax.annotation.Nullable + public String getIdPLoginBinding() { + return idPLoginBinding; + } + + + + /** + * SAML binding for the IdP logout URL, derived from the IdP metadata. + * @return idPLogoutBinding + */ + @javax.annotation.Nullable + public String getIdPLogoutBinding() { + return idPLogoutBinding; + } + + + + /** + * The unique identifier for the SAML service provider. + * @return entityId + */ + @javax.annotation.Nullable + public String getEntityId() { + return entityId; + } + + + + /** + * The URL to the SAML metadata XML file. + * @return metadataUrl + */ + @javax.annotation.Nullable + public String getMetadataUrl() { + return metadataUrl; + } + + + + /** + * The Assertion Consumer Service (ACS) endpoint URL for SAML responses. + * @return acSEndpoint + */ + @javax.annotation.Nullable + public String getAcSEndpoint() { + return acSEndpoint; + } + + + + public SamlConnectionResponseCore spCertificate(@javax.annotation.Nullable SamlConnectionResponseCoreSPCertificate spCertificate) { + this.spCertificate = spCertificate; + return this; + } + + /** + * Get spCertificate + * @return spCertificate + */ + @javax.annotation.Nullable + public SamlConnectionResponseCoreSPCertificate getSpCertificate() { + return spCertificate; + } + + public void setSpCertificate(@javax.annotation.Nullable SamlConnectionResponseCoreSPCertificate spCertificate) { + this.spCertificate = spCertificate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SamlConnectionResponseCore instance itself + */ + public SamlConnectionResponseCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SamlConnectionResponseCore samlConnectionResponseCore = (SamlConnectionResponseCore) o; + return Objects.equals(this.connectionType, samlConnectionResponseCore.connectionType) && + Objects.equals(this.idPLoginBinding, samlConnectionResponseCore.idPLoginBinding) && + Objects.equals(this.idPLogoutBinding, samlConnectionResponseCore.idPLogoutBinding) && + Objects.equals(this.entityId, samlConnectionResponseCore.entityId) && + Objects.equals(this.metadataUrl, samlConnectionResponseCore.metadataUrl) && + Objects.equals(this.acSEndpoint, samlConnectionResponseCore.acSEndpoint) && + Objects.equals(this.spCertificate, samlConnectionResponseCore.spCertificate)&& + Objects.equals(this.additionalProperties, samlConnectionResponseCore.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(connectionType, idPLoginBinding, idPLogoutBinding, entityId, metadataUrl, acSEndpoint, spCertificate, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SamlConnectionResponseCore {\n"); + sb.append(" connectionType: ").append(toIndentedString(connectionType)).append("\n"); + sb.append(" idPLoginBinding: ").append(toIndentedString(idPLoginBinding)).append("\n"); + sb.append(" idPLogoutBinding: ").append(toIndentedString(idPLogoutBinding)).append("\n"); + sb.append(" entityId: ").append(toIndentedString(entityId)).append("\n"); + sb.append(" metadataUrl: ").append(toIndentedString(metadataUrl)).append("\n"); + sb.append(" acSEndpoint: ").append(toIndentedString(acSEndpoint)).append("\n"); + sb.append(" spCertificate: ").append(toIndentedString(spCertificate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ConnectionType"); + openapiFields.add("IDPLoginBinding"); + openapiFields.add("IDPLogoutBinding"); + openapiFields.add("EntityId"); + openapiFields.add("MetadataUrl"); + openapiFields.add("ACSEndpoint"); + openapiFields.add("SPCertificate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SamlConnectionResponseCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SamlConnectionResponseCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SamlConnectionResponseCore is not found in the empty JSON string", SamlConnectionResponseCore.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ConnectionType") != null && !jsonObj.get("ConnectionType").isJsonNull()) && !jsonObj.get("ConnectionType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ConnectionType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ConnectionType").toString())); + } + // validate the optional field `ConnectionType` + if (jsonObj.get("ConnectionType") != null && !jsonObj.get("ConnectionType").isJsonNull()) { + ConnectionTypeEnum.validateJsonElement(jsonObj.get("ConnectionType")); + } + if ((jsonObj.get("IDPLoginBinding") != null && !jsonObj.get("IDPLoginBinding").isJsonNull()) && !jsonObj.get("IDPLoginBinding").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IDPLoginBinding` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IDPLoginBinding").toString())); + } + if ((jsonObj.get("IDPLogoutBinding") != null && !jsonObj.get("IDPLogoutBinding").isJsonNull()) && !jsonObj.get("IDPLogoutBinding").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IDPLogoutBinding` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IDPLogoutBinding").toString())); + } + if ((jsonObj.get("EntityId") != null && !jsonObj.get("EntityId").isJsonNull()) && !jsonObj.get("EntityId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `EntityId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("EntityId").toString())); + } + if ((jsonObj.get("MetadataUrl") != null && !jsonObj.get("MetadataUrl").isJsonNull()) && !jsonObj.get("MetadataUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MetadataUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MetadataUrl").toString())); + } + if ((jsonObj.get("ACSEndpoint") != null && !jsonObj.get("ACSEndpoint").isJsonNull()) && !jsonObj.get("ACSEndpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ACSEndpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ACSEndpoint").toString())); + } + // validate the optional field `SPCertificate` + if (jsonObj.get("SPCertificate") != null && !jsonObj.get("SPCertificate").isJsonNull()) { + SamlConnectionResponseCoreSPCertificate.validateJsonElement(jsonObj.get("SPCertificate")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SamlConnectionResponseCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SamlConnectionResponseCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SamlConnectionResponseCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SamlConnectionResponseCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<SamlConnectionResponseCore>() { + @Override + public void write(JsonWriter out, SamlConnectionResponseCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SamlConnectionResponseCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SamlConnectionResponseCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SamlConnectionResponseCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of SamlConnectionResponseCore + * @throws IOException if the JSON string is invalid with respect to SamlConnectionResponseCore + */ + public static SamlConnectionResponseCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SamlConnectionResponseCore.class); + } + + /** + * Convert an instance of SamlConnectionResponseCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlConnectionResponseCoreSPCertificate.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlConnectionResponseCoreSPCertificate.java new file mode 100644 index 0000000..cfb06a2 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlConnectionResponseCoreSPCertificate.java @@ -0,0 +1,287 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SamlConnectionResponseCoreSPCertificate + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SamlConnectionResponseCoreSPCertificate { + public static final String SERIALIZED_NAME_CERTIFICATE = "Certificate"; + @SerializedName(SERIALIZED_NAME_CERTIFICATE) + @javax.annotation.Nullable + private String certificate; + + public SamlConnectionResponseCoreSPCertificate() { + } + + public SamlConnectionResponseCoreSPCertificate certificate(@javax.annotation.Nullable String certificate) { + this.certificate = certificate; + return this; + } + + /** + * The SAML service provider's certificate in PEM format. + * @return certificate + */ + @javax.annotation.Nullable + public String getCertificate() { + return certificate; + } + + public void setCertificate(@javax.annotation.Nullable String certificate) { + this.certificate = certificate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SamlConnectionResponseCoreSPCertificate instance itself + */ + public SamlConnectionResponseCoreSPCertificate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SamlConnectionResponseCoreSPCertificate samlConnectionResponseCoreSPCertificate = (SamlConnectionResponseCoreSPCertificate) o; + return Objects.equals(this.certificate, samlConnectionResponseCoreSPCertificate.certificate)&& + Objects.equals(this.additionalProperties, samlConnectionResponseCoreSPCertificate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(certificate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SamlConnectionResponseCoreSPCertificate {\n"); + sb.append(" certificate: ").append(toIndentedString(certificate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Certificate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SamlConnectionResponseCoreSPCertificate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SamlConnectionResponseCoreSPCertificate.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SamlConnectionResponseCoreSPCertificate is not found in the empty JSON string", SamlConnectionResponseCoreSPCertificate.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Certificate") != null && !jsonObj.get("Certificate").isJsonNull()) && !jsonObj.get("Certificate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Certificate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Certificate").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SamlConnectionResponseCoreSPCertificate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SamlConnectionResponseCoreSPCertificate' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SamlConnectionResponseCoreSPCertificate> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SamlConnectionResponseCoreSPCertificate.class)); + + return (TypeAdapter<T>) new TypeAdapter<SamlConnectionResponseCoreSPCertificate>() { + @Override + public void write(JsonWriter out, SamlConnectionResponseCoreSPCertificate value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SamlConnectionResponseCoreSPCertificate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SamlConnectionResponseCoreSPCertificate instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SamlConnectionResponseCoreSPCertificate given an JSON string + * + * @param jsonString JSON string + * @return An instance of SamlConnectionResponseCoreSPCertificate + * @throws IOException if the JSON string is invalid with respect to SamlConnectionResponseCoreSPCertificate + */ + public static SamlConnectionResponseCoreSPCertificate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SamlConnectionResponseCoreSPCertificate.class); + } + + /** + * Convert an instance of SamlConnectionResponseCoreSPCertificate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIdpMetadataResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIdpMetadataResponse.java new file mode 100644 index 0000000..f5142e4 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIdpMetadataResponse.java @@ -0,0 +1,379 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.SamlIdpMetadataResponseIDPSSODescriptor; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * Saml IdP Metadata Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SamlIdpMetadataResponse { + public static final String SERIALIZED_NAME_D_S_N_S = "DSNS"; + @SerializedName(SERIALIZED_NAME_D_S_N_S) + @javax.annotation.Nullable + private String DSNS; + + public static final String SERIALIZED_NAME_ENTITY_ID = "EntityId"; + @SerializedName(SERIALIZED_NAME_ENTITY_ID) + @javax.annotation.Nullable + private String entityId; + + public static final String SERIALIZED_NAME_ID_P_S_S_O_DESCRIPTOR = "IDPSSODescriptor"; + @SerializedName(SERIALIZED_NAME_ID_P_S_S_O_DESCRIPTOR) + @javax.annotation.Nullable + private SamlIdpMetadataResponseIDPSSODescriptor idPSSODescriptor; + + public static final String SERIALIZED_NAME_X_M_L_N_S = "XMLNS"; + @SerializedName(SERIALIZED_NAME_X_M_L_N_S) + @javax.annotation.Nullable + private String XMLNS; + + public SamlIdpMetadataResponse() { + } + + public SamlIdpMetadataResponse DSNS(@javax.annotation.Nullable String DSNS) { + this.DSNS = DSNS; + return this; + } + + /** + * Get DSNS + * @return DSNS + */ + @javax.annotation.Nullable + public String getDSNS() { + return DSNS; + } + + public void setDSNS(@javax.annotation.Nullable String DSNS) { + this.DSNS = DSNS; + } + + + public SamlIdpMetadataResponse entityId(@javax.annotation.Nullable String entityId) { + this.entityId = entityId; + return this; + } + + /** + * Get entityId + * @return entityId + */ + @javax.annotation.Nullable + public String getEntityId() { + return entityId; + } + + public void setEntityId(@javax.annotation.Nullable String entityId) { + this.entityId = entityId; + } + + + public SamlIdpMetadataResponse idPSSODescriptor(@javax.annotation.Nullable SamlIdpMetadataResponseIDPSSODescriptor idPSSODescriptor) { + this.idPSSODescriptor = idPSSODescriptor; + return this; + } + + /** + * Get idPSSODescriptor + * @return idPSSODescriptor + */ + @javax.annotation.Nullable + public SamlIdpMetadataResponseIDPSSODescriptor getIdPSSODescriptor() { + return idPSSODescriptor; + } + + public void setIdPSSODescriptor(@javax.annotation.Nullable SamlIdpMetadataResponseIDPSSODescriptor idPSSODescriptor) { + this.idPSSODescriptor = idPSSODescriptor; + } + + + public SamlIdpMetadataResponse XMLNS(@javax.annotation.Nullable String XMLNS) { + this.XMLNS = XMLNS; + return this; + } + + /** + * Get XMLNS + * @return XMLNS + */ + @javax.annotation.Nullable + public String getXMLNS() { + return XMLNS; + } + + public void setXMLNS(@javax.annotation.Nullable String XMLNS) { + this.XMLNS = XMLNS; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SamlIdpMetadataResponse instance itself + */ + public SamlIdpMetadataResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SamlIdpMetadataResponse samlIdpMetadataResponse = (SamlIdpMetadataResponse) o; + return Objects.equals(this.DSNS, samlIdpMetadataResponse.DSNS) && + Objects.equals(this.entityId, samlIdpMetadataResponse.entityId) && + Objects.equals(this.idPSSODescriptor, samlIdpMetadataResponse.idPSSODescriptor) && + Objects.equals(this.XMLNS, samlIdpMetadataResponse.XMLNS)&& + Objects.equals(this.additionalProperties, samlIdpMetadataResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(DSNS, entityId, idPSSODescriptor, XMLNS, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SamlIdpMetadataResponse {\n"); + sb.append(" DSNS: ").append(toIndentedString(DSNS)).append("\n"); + sb.append(" entityId: ").append(toIndentedString(entityId)).append("\n"); + sb.append(" idPSSODescriptor: ").append(toIndentedString(idPSSODescriptor)).append("\n"); + sb.append(" XMLNS: ").append(toIndentedString(XMLNS)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("DSNS"); + openapiFields.add("EntityId"); + openapiFields.add("IDPSSODescriptor"); + openapiFields.add("XMLNS"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SamlIdpMetadataResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SamlIdpMetadataResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SamlIdpMetadataResponse is not found in the empty JSON string", SamlIdpMetadataResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("DSNS") != null && !jsonObj.get("DSNS").isJsonNull()) && !jsonObj.get("DSNS").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DSNS` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DSNS").toString())); + } + if ((jsonObj.get("EntityId") != null && !jsonObj.get("EntityId").isJsonNull()) && !jsonObj.get("EntityId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `EntityId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("EntityId").toString())); + } + // validate the optional field `IDPSSODescriptor` + if (jsonObj.get("IDPSSODescriptor") != null && !jsonObj.get("IDPSSODescriptor").isJsonNull()) { + SamlIdpMetadataResponseIDPSSODescriptor.validateJsonElement(jsonObj.get("IDPSSODescriptor")); + } + if ((jsonObj.get("XMLNS") != null && !jsonObj.get("XMLNS").isJsonNull()) && !jsonObj.get("XMLNS").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `XMLNS` to be a primitive type in the JSON string but got `%s`", jsonObj.get("XMLNS").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SamlIdpMetadataResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SamlIdpMetadataResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SamlIdpMetadataResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SamlIdpMetadataResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<SamlIdpMetadataResponse>() { + @Override + public void write(JsonWriter out, SamlIdpMetadataResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SamlIdpMetadataResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SamlIdpMetadataResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SamlIdpMetadataResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SamlIdpMetadataResponse + * @throws IOException if the JSON string is invalid with respect to SamlIdpMetadataResponse + */ + public static SamlIdpMetadataResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SamlIdpMetadataResponse.class); + } + + /** + * Convert an instance of SamlIdpMetadataResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIdpMetadataResponseIDPSSODescriptor.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIdpMetadataResponseIDPSSODescriptor.java new file mode 100644 index 0000000..4d5ce1d --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIdpMetadataResponseIDPSSODescriptor.java @@ -0,0 +1,451 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor; +import com.loginradius.sdk.internal.openapi.model.SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner; +import com.loginradius.sdk.internal.openapi.model.SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SamlIdpMetadataResponseIDPSSODescriptor + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SamlIdpMetadataResponseIDPSSODescriptor { + public static final String SERIALIZED_NAME_PROTOCOL_SUPPORT_ENUMERATION = "ProtocolSupportEnumeration"; + @SerializedName(SERIALIZED_NAME_PROTOCOL_SUPPORT_ENUMERATION) + @javax.annotation.Nullable + private String protocolSupportEnumeration; + + public static final String SERIALIZED_NAME_SIGNING_KEY_DESCRIPTOR = "SigningKeyDescriptor"; + @SerializedName(SERIALIZED_NAME_SIGNING_KEY_DESCRIPTOR) + @javax.annotation.Nullable + private SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor signingKeyDescriptor; + + public static final String SERIALIZED_NAME_SINGLE_LOGOUT_SERVICE = "SingleLogoutService"; + @SerializedName(SERIALIZED_NAME_SINGLE_LOGOUT_SERVICE) + @javax.annotation.Nullable + private List<SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner> singleLogoutService = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SINGLE_SIGN_ON_SERVICE = "SingleSignOnService"; + @SerializedName(SERIALIZED_NAME_SINGLE_SIGN_ON_SERVICE) + @javax.annotation.Nullable + private List<SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner> singleSignOnService = new ArrayList<>(); + + public static final String SERIALIZED_NAME_WANT_AUTHN_REQUESTS_SIGNED = "WantAuthnRequestsSigned"; + @SerializedName(SERIALIZED_NAME_WANT_AUTHN_REQUESTS_SIGNED) + @javax.annotation.Nullable + private String wantAuthnRequestsSigned; + + public SamlIdpMetadataResponseIDPSSODescriptor() { + } + + public SamlIdpMetadataResponseIDPSSODescriptor protocolSupportEnumeration(@javax.annotation.Nullable String protocolSupportEnumeration) { + this.protocolSupportEnumeration = protocolSupportEnumeration; + return this; + } + + /** + * Get protocolSupportEnumeration + * @return protocolSupportEnumeration + */ + @javax.annotation.Nullable + public String getProtocolSupportEnumeration() { + return protocolSupportEnumeration; + } + + public void setProtocolSupportEnumeration(@javax.annotation.Nullable String protocolSupportEnumeration) { + this.protocolSupportEnumeration = protocolSupportEnumeration; + } + + + public SamlIdpMetadataResponseIDPSSODescriptor signingKeyDescriptor(@javax.annotation.Nullable SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor signingKeyDescriptor) { + this.signingKeyDescriptor = signingKeyDescriptor; + return this; + } + + /** + * Get signingKeyDescriptor + * @return signingKeyDescriptor + */ + @javax.annotation.Nullable + public SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor getSigningKeyDescriptor() { + return signingKeyDescriptor; + } + + public void setSigningKeyDescriptor(@javax.annotation.Nullable SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor signingKeyDescriptor) { + this.signingKeyDescriptor = signingKeyDescriptor; + } + + + public SamlIdpMetadataResponseIDPSSODescriptor singleLogoutService(@javax.annotation.Nullable List<SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner> singleLogoutService) { + this.singleLogoutService = singleLogoutService; + return this; + } + + public SamlIdpMetadataResponseIDPSSODescriptor addSingleLogoutServiceItem(SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner singleLogoutServiceItem) { + if (this.singleLogoutService == null) { + this.singleLogoutService = new ArrayList<>(); + } + this.singleLogoutService.add(singleLogoutServiceItem); + return this; + } + + /** + * Get singleLogoutService + * @return singleLogoutService + */ + @javax.annotation.Nullable + public List<SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner> getSingleLogoutService() { + return singleLogoutService; + } + + public void setSingleLogoutService(@javax.annotation.Nullable List<SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner> singleLogoutService) { + this.singleLogoutService = singleLogoutService; + } + + + public SamlIdpMetadataResponseIDPSSODescriptor singleSignOnService(@javax.annotation.Nullable List<SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner> singleSignOnService) { + this.singleSignOnService = singleSignOnService; + return this; + } + + public SamlIdpMetadataResponseIDPSSODescriptor addSingleSignOnServiceItem(SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner singleSignOnServiceItem) { + if (this.singleSignOnService == null) { + this.singleSignOnService = new ArrayList<>(); + } + this.singleSignOnService.add(singleSignOnServiceItem); + return this; + } + + /** + * Get singleSignOnService + * @return singleSignOnService + */ + @javax.annotation.Nullable + public List<SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner> getSingleSignOnService() { + return singleSignOnService; + } + + public void setSingleSignOnService(@javax.annotation.Nullable List<SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner> singleSignOnService) { + this.singleSignOnService = singleSignOnService; + } + + + public SamlIdpMetadataResponseIDPSSODescriptor wantAuthnRequestsSigned(@javax.annotation.Nullable String wantAuthnRequestsSigned) { + this.wantAuthnRequestsSigned = wantAuthnRequestsSigned; + return this; + } + + /** + * Get wantAuthnRequestsSigned + * @return wantAuthnRequestsSigned + */ + @javax.annotation.Nullable + public String getWantAuthnRequestsSigned() { + return wantAuthnRequestsSigned; + } + + public void setWantAuthnRequestsSigned(@javax.annotation.Nullable String wantAuthnRequestsSigned) { + this.wantAuthnRequestsSigned = wantAuthnRequestsSigned; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SamlIdpMetadataResponseIDPSSODescriptor instance itself + */ + public SamlIdpMetadataResponseIDPSSODescriptor putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SamlIdpMetadataResponseIDPSSODescriptor samlIdpMetadataResponseIDPSSODescriptor = (SamlIdpMetadataResponseIDPSSODescriptor) o; + return Objects.equals(this.protocolSupportEnumeration, samlIdpMetadataResponseIDPSSODescriptor.protocolSupportEnumeration) && + Objects.equals(this.signingKeyDescriptor, samlIdpMetadataResponseIDPSSODescriptor.signingKeyDescriptor) && + Objects.equals(this.singleLogoutService, samlIdpMetadataResponseIDPSSODescriptor.singleLogoutService) && + Objects.equals(this.singleSignOnService, samlIdpMetadataResponseIDPSSODescriptor.singleSignOnService) && + Objects.equals(this.wantAuthnRequestsSigned, samlIdpMetadataResponseIDPSSODescriptor.wantAuthnRequestsSigned)&& + Objects.equals(this.additionalProperties, samlIdpMetadataResponseIDPSSODescriptor.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(protocolSupportEnumeration, signingKeyDescriptor, singleLogoutService, singleSignOnService, wantAuthnRequestsSigned, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SamlIdpMetadataResponseIDPSSODescriptor {\n"); + sb.append(" protocolSupportEnumeration: ").append(toIndentedString(protocolSupportEnumeration)).append("\n"); + sb.append(" signingKeyDescriptor: ").append(toIndentedString(signingKeyDescriptor)).append("\n"); + sb.append(" singleLogoutService: ").append(toIndentedString(singleLogoutService)).append("\n"); + sb.append(" singleSignOnService: ").append(toIndentedString(singleSignOnService)).append("\n"); + sb.append(" wantAuthnRequestsSigned: ").append(toIndentedString(wantAuthnRequestsSigned)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ProtocolSupportEnumeration"); + openapiFields.add("SigningKeyDescriptor"); + openapiFields.add("SingleLogoutService"); + openapiFields.add("SingleSignOnService"); + openapiFields.add("WantAuthnRequestsSigned"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SamlIdpMetadataResponseIDPSSODescriptor + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SamlIdpMetadataResponseIDPSSODescriptor.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SamlIdpMetadataResponseIDPSSODescriptor is not found in the empty JSON string", SamlIdpMetadataResponseIDPSSODescriptor.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ProtocolSupportEnumeration") != null && !jsonObj.get("ProtocolSupportEnumeration").isJsonNull()) && !jsonObj.get("ProtocolSupportEnumeration").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProtocolSupportEnumeration` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProtocolSupportEnumeration").toString())); + } + // validate the optional field `SigningKeyDescriptor` + if (jsonObj.get("SigningKeyDescriptor") != null && !jsonObj.get("SigningKeyDescriptor").isJsonNull()) { + SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor.validateJsonElement(jsonObj.get("SigningKeyDescriptor")); + } + if (jsonObj.get("SingleLogoutService") != null && !jsonObj.get("SingleLogoutService").isJsonNull()) { + JsonArray jsonArraysingleLogoutService = jsonObj.getAsJsonArray("SingleLogoutService"); + if (jsonArraysingleLogoutService != null) { + // ensure the json data is an array + if (!jsonObj.get("SingleLogoutService").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `SingleLogoutService` to be an array in the JSON string but got `%s`", jsonObj.get("SingleLogoutService").toString())); + } + + // validate the optional field `SingleLogoutService` (array) + for (int i = 0; i < jsonArraysingleLogoutService.size(); i++) { + SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner.validateJsonElement(jsonArraysingleLogoutService.get(i)); + }; + } + } + if (jsonObj.get("SingleSignOnService") != null && !jsonObj.get("SingleSignOnService").isJsonNull()) { + JsonArray jsonArraysingleSignOnService = jsonObj.getAsJsonArray("SingleSignOnService"); + if (jsonArraysingleSignOnService != null) { + // ensure the json data is an array + if (!jsonObj.get("SingleSignOnService").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `SingleSignOnService` to be an array in the JSON string but got `%s`", jsonObj.get("SingleSignOnService").toString())); + } + + // validate the optional field `SingleSignOnService` (array) + for (int i = 0; i < jsonArraysingleSignOnService.size(); i++) { + SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner.validateJsonElement(jsonArraysingleSignOnService.get(i)); + }; + } + } + if ((jsonObj.get("WantAuthnRequestsSigned") != null && !jsonObj.get("WantAuthnRequestsSigned").isJsonNull()) && !jsonObj.get("WantAuthnRequestsSigned").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `WantAuthnRequestsSigned` to be a primitive type in the JSON string but got `%s`", jsonObj.get("WantAuthnRequestsSigned").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SamlIdpMetadataResponseIDPSSODescriptor.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SamlIdpMetadataResponseIDPSSODescriptor' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SamlIdpMetadataResponseIDPSSODescriptor> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SamlIdpMetadataResponseIDPSSODescriptor.class)); + + return (TypeAdapter<T>) new TypeAdapter<SamlIdpMetadataResponseIDPSSODescriptor>() { + @Override + public void write(JsonWriter out, SamlIdpMetadataResponseIDPSSODescriptor value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SamlIdpMetadataResponseIDPSSODescriptor read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SamlIdpMetadataResponseIDPSSODescriptor instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SamlIdpMetadataResponseIDPSSODescriptor given an JSON string + * + * @param jsonString JSON string + * @return An instance of SamlIdpMetadataResponseIDPSSODescriptor + * @throws IOException if the JSON string is invalid with respect to SamlIdpMetadataResponseIDPSSODescriptor + */ + public static SamlIdpMetadataResponseIDPSSODescriptor fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SamlIdpMetadataResponseIDPSSODescriptor.class); + } + + /** + * Convert an instance of SamlIdpMetadataResponseIDPSSODescriptor to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor.java new file mode 100644 index 0000000..71ecbb2 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor.java @@ -0,0 +1,319 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor { + public static final String SERIALIZED_NAME_KEY_INFO = "KeyInfo"; + @SerializedName(SERIALIZED_NAME_KEY_INFO) + @javax.annotation.Nullable + private SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo keyInfo; + + public static final String SERIALIZED_NAME_USE = "Use"; + @SerializedName(SERIALIZED_NAME_USE) + @javax.annotation.Nullable + private String use; + + public SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor() { + } + + public SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor keyInfo(@javax.annotation.Nullable SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo keyInfo) { + this.keyInfo = keyInfo; + return this; + } + + /** + * Get keyInfo + * @return keyInfo + */ + @javax.annotation.Nullable + public SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo getKeyInfo() { + return keyInfo; + } + + public void setKeyInfo(@javax.annotation.Nullable SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo keyInfo) { + this.keyInfo = keyInfo; + } + + + public SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor use(@javax.annotation.Nullable String use) { + this.use = use; + return this; + } + + /** + * Get use + * @return use + */ + @javax.annotation.Nullable + public String getUse() { + return use; + } + + public void setUse(@javax.annotation.Nullable String use) { + this.use = use; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor instance itself + */ + public SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor samlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor = (SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor) o; + return Objects.equals(this.keyInfo, samlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor.keyInfo) && + Objects.equals(this.use, samlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor.use)&& + Objects.equals(this.additionalProperties, samlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(keyInfo, use, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor {\n"); + sb.append(" keyInfo: ").append(toIndentedString(keyInfo)).append("\n"); + sb.append(" use: ").append(toIndentedString(use)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("KeyInfo"); + openapiFields.add("Use"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor is not found in the empty JSON string", SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `KeyInfo` + if (jsonObj.get("KeyInfo") != null && !jsonObj.get("KeyInfo").isJsonNull()) { + SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo.validateJsonElement(jsonObj.get("KeyInfo")); + } + if ((jsonObj.get("Use") != null && !jsonObj.get("Use").isJsonNull()) && !jsonObj.get("Use").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Use` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Use").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor.class)); + + return (TypeAdapter<T>) new TypeAdapter<SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor>() { + @Override + public void write(JsonWriter out, SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor given an JSON string + * + * @param jsonString JSON string + * @return An instance of SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor + * @throws IOException if the JSON string is invalid with respect to SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor + */ + public static SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor.class); + } + + /** + * Convert an instance of SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptor to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo.java new file mode 100644 index 0000000..b341661 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo.java @@ -0,0 +1,289 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo { + public static final String SERIALIZED_NAME_X509_DATA = "X509Data"; + @SerializedName(SERIALIZED_NAME_X509_DATA) + @javax.annotation.Nullable + private SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data x509Data; + + public SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo() { + } + + public SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo x509Data(@javax.annotation.Nullable SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data x509Data) { + this.x509Data = x509Data; + return this; + } + + /** + * Get x509Data + * @return x509Data + */ + @javax.annotation.Nullable + public SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data getX509Data() { + return x509Data; + } + + public void setX509Data(@javax.annotation.Nullable SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data x509Data) { + this.x509Data = x509Data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo instance itself + */ + public SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo samlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo = (SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo) o; + return Objects.equals(this.x509Data, samlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo.x509Data)&& + Objects.equals(this.additionalProperties, samlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(x509Data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo {\n"); + sb.append(" x509Data: ").append(toIndentedString(x509Data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("X509Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo is not found in the empty JSON string", SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `X509Data` + if (jsonObj.get("X509Data") != null && !jsonObj.get("X509Data").isJsonNull()) { + SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data.validateJsonElement(jsonObj.get("X509Data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo.class)); + + return (TypeAdapter<T>) new TypeAdapter<SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo>() { + @Override + public void write(JsonWriter out, SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo given an JSON string + * + * @param jsonString JSON string + * @return An instance of SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo + * @throws IOException if the JSON string is invalid with respect to SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo + */ + public static SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo.class); + } + + /** + * Convert an instance of SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfo to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data.java new file mode 100644 index 0000000..79cd689 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data.java @@ -0,0 +1,289 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data { + public static final String SERIALIZED_NAME_X509_CERTIFICATE = "X509Certificate"; + @SerializedName(SERIALIZED_NAME_X509_CERTIFICATE) + @javax.annotation.Nullable + private SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate x509Certificate; + + public SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data() { + } + + public SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data x509Certificate(@javax.annotation.Nullable SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate x509Certificate) { + this.x509Certificate = x509Certificate; + return this; + } + + /** + * Get x509Certificate + * @return x509Certificate + */ + @javax.annotation.Nullable + public SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate getX509Certificate() { + return x509Certificate; + } + + public void setX509Certificate(@javax.annotation.Nullable SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate x509Certificate) { + this.x509Certificate = x509Certificate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data instance itself + */ + public SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data samlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data = (SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data) o; + return Objects.equals(this.x509Certificate, samlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data.x509Certificate)&& + Objects.equals(this.additionalProperties, samlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(x509Certificate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data {\n"); + sb.append(" x509Certificate: ").append(toIndentedString(x509Certificate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("X509Certificate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data is not found in the empty JSON string", SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `X509Certificate` + if (jsonObj.get("X509Certificate") != null && !jsonObj.get("X509Certificate").isJsonNull()) { + SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate.validateJsonElement(jsonObj.get("X509Certificate")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data.class)); + + return (TypeAdapter<T>) new TypeAdapter<SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data>() { + @Override + public void write(JsonWriter out, SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data given an JSON string + * + * @param jsonString JSON string + * @return An instance of SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data + * @throws IOException if the JSON string is invalid with respect to SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data + */ + public static SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data.class); + } + + /** + * Convert an instance of SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509Data to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate.java new file mode 100644 index 0000000..2d5d046 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate.java @@ -0,0 +1,287 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate { + public static final String SERIALIZED_NAME_CERT = "Cert"; + @SerializedName(SERIALIZED_NAME_CERT) + @javax.annotation.Nullable + private String cert; + + public SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate() { + } + + public SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate cert(@javax.annotation.Nullable String cert) { + this.cert = cert; + return this; + } + + /** + * Get cert + * @return cert + */ + @javax.annotation.Nullable + public String getCert() { + return cert; + } + + public void setCert(@javax.annotation.Nullable String cert) { + this.cert = cert; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate instance itself + */ + public SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate samlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate = (SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate) o; + return Objects.equals(this.cert, samlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate.cert)&& + Objects.equals(this.additionalProperties, samlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(cert, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate {\n"); + sb.append(" cert: ").append(toIndentedString(cert)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Cert"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate is not found in the empty JSON string", SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Cert") != null && !jsonObj.get("Cert").isJsonNull()) && !jsonObj.get("Cert").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Cert` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Cert").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate.class)); + + return (TypeAdapter<T>) new TypeAdapter<SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate>() { + @Override + public void write(JsonWriter out, SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate given an JSON string + * + * @param jsonString JSON string + * @return An instance of SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate + * @throws IOException if the JSON string is invalid with respect to SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate + */ + public static SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate.class); + } + + /** + * Convert an instance of SamlIdpMetadataResponseIDPSSODescriptorSigningKeyDescriptorKeyInfoX509DataX509Certificate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner.java new file mode 100644 index 0000000..891a8fb --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner { + public static final String SERIALIZED_NAME_BINDING = "Binding"; + @SerializedName(SERIALIZED_NAME_BINDING) + @javax.annotation.Nullable + private String binding; + + public static final String SERIALIZED_NAME_LOCATION = "Location"; + @SerializedName(SERIALIZED_NAME_LOCATION) + @javax.annotation.Nullable + private String location; + + public SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner() { + } + + public SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner binding(@javax.annotation.Nullable String binding) { + this.binding = binding; + return this; + } + + /** + * Get binding + * @return binding + */ + @javax.annotation.Nullable + public String getBinding() { + return binding; + } + + public void setBinding(@javax.annotation.Nullable String binding) { + this.binding = binding; + } + + + public SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner location(@javax.annotation.Nullable String location) { + this.location = location; + return this; + } + + /** + * Get location + * @return location + */ + @javax.annotation.Nullable + public String getLocation() { + return location; + } + + public void setLocation(@javax.annotation.Nullable String location) { + this.location = location; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner instance itself + */ + public SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner samlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner = (SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner) o; + return Objects.equals(this.binding, samlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner.binding) && + Objects.equals(this.location, samlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner.location)&& + Objects.equals(this.additionalProperties, samlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(binding, location, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner {\n"); + sb.append(" binding: ").append(toIndentedString(binding)).append("\n"); + sb.append(" location: ").append(toIndentedString(location)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Binding"); + openapiFields.add("Location"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner is not found in the empty JSON string", SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Binding") != null && !jsonObj.get("Binding").isJsonNull()) && !jsonObj.get("Binding").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Binding` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Binding").toString())); + } + if ((jsonObj.get("Location") != null && !jsonObj.get("Location").isJsonNull()) && !jsonObj.get("Location").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Location` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Location").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner>() { + @Override + public void write(JsonWriter out, SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner + * @throws IOException if the JSON string is invalid with respect to SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner + */ + public static SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner.class); + } + + /** + * Convert an instance of SamlIdpMetadataResponseIDPSSODescriptorSingleLogoutServiceInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner.java new file mode 100644 index 0000000..6e0a9b1 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner { + public static final String SERIALIZED_NAME_BINDING = "Binding"; + @SerializedName(SERIALIZED_NAME_BINDING) + @javax.annotation.Nullable + private String binding; + + public static final String SERIALIZED_NAME_LOCATION = "Location"; + @SerializedName(SERIALIZED_NAME_LOCATION) + @javax.annotation.Nullable + private String location; + + public SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner() { + } + + public SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner binding(@javax.annotation.Nullable String binding) { + this.binding = binding; + return this; + } + + /** + * Get binding + * @return binding + */ + @javax.annotation.Nullable + public String getBinding() { + return binding; + } + + public void setBinding(@javax.annotation.Nullable String binding) { + this.binding = binding; + } + + + public SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner location(@javax.annotation.Nullable String location) { + this.location = location; + return this; + } + + /** + * Get location + * @return location + */ + @javax.annotation.Nullable + public String getLocation() { + return location; + } + + public void setLocation(@javax.annotation.Nullable String location) { + this.location = location; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner instance itself + */ + public SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner samlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner = (SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner) o; + return Objects.equals(this.binding, samlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner.binding) && + Objects.equals(this.location, samlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner.location)&& + Objects.equals(this.additionalProperties, samlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(binding, location, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner {\n"); + sb.append(" binding: ").append(toIndentedString(binding)).append("\n"); + sb.append(" location: ").append(toIndentedString(location)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Binding"); + openapiFields.add("Location"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner is not found in the empty JSON string", SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Binding") != null && !jsonObj.get("Binding").isJsonNull()) && !jsonObj.get("Binding").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Binding` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Binding").toString())); + } + if ((jsonObj.get("Location") != null && !jsonObj.get("Location").isJsonNull()) && !jsonObj.get("Location").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Location` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Location").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner>() { + @Override + public void write(JsonWriter out, SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner + * @throws IOException if the JSON string is invalid with respect to SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner + */ + public static SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner.class); + } + + /** + * Convert an instance of SamlIdpMetadataResponseIDPSSODescriptorSingleSignOnServiceInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIntegrationCreateCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIntegrationCreateCore.java new file mode 100644 index 0000000..a877a98 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIntegrationCreateCore.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SamlIntegrationCreateCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SamlIntegrationCreateCore { + public static final String SERIALIZED_NAME_APP_NAME = "AppName"; + @SerializedName(SERIALIZED_NAME_APP_NAME) + @javax.annotation.Nonnull + private String appName; + + public SamlIntegrationCreateCore() { + } + + public SamlIntegrationCreateCore appName(@javax.annotation.Nonnull String appName) { + this.appName = appName; + return this; + } + + /** + * Get appName + * @return appName + */ + @javax.annotation.Nonnull + public String getAppName() { + return appName; + } + + public void setAppName(@javax.annotation.Nonnull String appName) { + this.appName = appName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SamlIntegrationCreateCore instance itself + */ + public SamlIntegrationCreateCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SamlIntegrationCreateCore samlIntegrationCreateCore = (SamlIntegrationCreateCore) o; + return Objects.equals(this.appName, samlIntegrationCreateCore.appName)&& + Objects.equals(this.additionalProperties, samlIntegrationCreateCore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(appName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SamlIntegrationCreateCore {\n"); + sb.append(" appName: ").append(toIndentedString(appName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AppName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("AppName"); + } + + /** + * 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 SamlIntegrationCreateCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SamlIntegrationCreateCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SamlIntegrationCreateCore is not found in the empty JSON string", SamlIntegrationCreateCore.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SamlIntegrationCreateCore.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("AppName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AppName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AppName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SamlIntegrationCreateCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SamlIntegrationCreateCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SamlIntegrationCreateCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SamlIntegrationCreateCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<SamlIntegrationCreateCore>() { + @Override + public void write(JsonWriter out, SamlIntegrationCreateCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SamlIntegrationCreateCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SamlIntegrationCreateCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SamlIntegrationCreateCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of SamlIntegrationCreateCore + * @throws IOException if the JSON string is invalid with respect to SamlIntegrationCreateCore + */ + public static SamlIntegrationCreateCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SamlIntegrationCreateCore.class); + } + + /** + * Convert an instance of SamlIntegrationCreateCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIntegrationRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIntegrationRequest.java new file mode 100644 index 0000000..bea78dc --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIntegrationRequest.java @@ -0,0 +1,780 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.Certificates; +import com.loginradius.sdk.internal.openapi.model.SamlIntegrationResponseAssertionConsumerService; +import com.loginradius.sdk.internal.openapi.model.SamlIntegrationResponseAttributesValue; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SamlIntegrationRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SamlIntegrationRequest { + public static final String SERIALIZED_NAME_AFTER_LOGOUT_URL = "AfterLogoutUrl"; + @SerializedName(SERIALIZED_NAME_AFTER_LOGOUT_URL) + @javax.annotation.Nullable + private String afterLogoutUrl; + + public static final String SERIALIZED_NAME_ASSERTION_CONSUMER_SERVICE = "AssertionConsumerService"; + @SerializedName(SERIALIZED_NAME_ASSERTION_CONSUMER_SERVICE) + @javax.annotation.Nullable + private SamlIntegrationResponseAssertionConsumerService assertionConsumerService; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "Attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nullable + private Map<String, SamlIntegrationResponseAttributesValue> attributes = new HashMap<>(); + + public static final String SERIALIZED_NAME_AUDIENCES = "Audiences"; + @SerializedName(SERIALIZED_NAME_AUDIENCES) + @javax.annotation.Nullable + private List<String> audiences = new ArrayList<>(); + + /** + * Gets or Sets defaultRequestBinding + */ + @JsonAdapter(DefaultRequestBindingEnum.Adapter.class) + public enum DefaultRequestBindingEnum { + POST("urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"), + + REDIRECT("urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"); + + private String value; + + DefaultRequestBindingEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static DefaultRequestBindingEnum fromValue(String value) { + for (DefaultRequestBindingEnum b : DefaultRequestBindingEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<DefaultRequestBindingEnum> { + @Override + public void write(final JsonWriter jsonWriter, final DefaultRequestBindingEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public DefaultRequestBindingEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return DefaultRequestBindingEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + DefaultRequestBindingEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_DEFAULT_REQUEST_BINDING = "DefaultRequestBinding"; + @SerializedName(SERIALIZED_NAME_DEFAULT_REQUEST_BINDING) + @javax.annotation.Nullable + private DefaultRequestBindingEnum defaultRequestBinding; + + public static final String SERIALIZED_NAME_IS_IDP_INITIATED = "IsIdpInitiated"; + @SerializedName(SERIALIZED_NAME_IS_IDP_INITIATED) + @javax.annotation.Nullable + private Boolean isIdpInitiated; + + public static final String SERIALIZED_NAME_ISSUER_URL = "IssuerUrl"; + @SerializedName(SERIALIZED_NAME_ISSUER_URL) + @javax.annotation.Nullable + private String issuerUrl; + + public static final String SERIALIZED_NAME_LOGIN_URL = "LoginUrl"; + @SerializedName(SERIALIZED_NAME_LOGIN_URL) + @javax.annotation.Nullable + private String loginUrl; + + /** + * Gets or Sets nameIdFormat + */ + @JsonAdapter(NameIdFormatEnum.Adapter.class) + public enum NameIdFormatEnum { + _1_1_NAMEID_FORMAT_UNSPECIFIED("urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified"), + + _1_1_NAMEID_FORMAT_EMAIL_ADDRESS("urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"), + + _2_0_NAMEID_FORMAT_PERSISTENT("urn:oasis:names:tc:SAML:2.0:nameid-format:persistent"), + + _2_0_NAMEID_FORMAT_TRANSIENT("urn:oasis:names:tc:SAML:2.0:nameid-format:transient"); + + private String value; + + NameIdFormatEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static NameIdFormatEnum fromValue(String value) { + for (NameIdFormatEnum b : NameIdFormatEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<NameIdFormatEnum> { + @Override + public void write(final JsonWriter jsonWriter, final NameIdFormatEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public NameIdFormatEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return NameIdFormatEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + NameIdFormatEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_NAME_ID_FORMAT = "NameIdFormat"; + @SerializedName(SERIALIZED_NAME_NAME_ID_FORMAT) + @javax.annotation.Nullable + private NameIdFormatEnum nameIdFormat; + + public static final String SERIALIZED_NAME_NOT_ON_OR_AFTER = "NotOnOrAfter"; + @SerializedName(SERIALIZED_NAME_NOT_ON_OR_AFTER) + @javax.annotation.Nullable + private Integer notOnOrAfter; + + public static final String SERIALIZED_NAME_RELAY_STATE_PARAMETER = "RelayStateParameter"; + @SerializedName(SERIALIZED_NAME_RELAY_STATE_PARAMETER) + @javax.annotation.Nullable + private String relayStateParameter; + + public static final String SERIALIZED_NAME_SP_CERTIFICATE = "SpCertificate"; + @SerializedName(SERIALIZED_NAME_SP_CERTIFICATE) + @javax.annotation.Nullable + private Certificates spCertificate; + + public static final String SERIALIZED_NAME_SP_LOGOUT_URL = "SpLogoutUrl"; + @SerializedName(SERIALIZED_NAME_SP_LOGOUT_URL) + @javax.annotation.Nullable + private String spLogoutUrl; + + public SamlIntegrationRequest() { + } + + public SamlIntegrationRequest afterLogoutUrl(@javax.annotation.Nullable String afterLogoutUrl) { + this.afterLogoutUrl = afterLogoutUrl; + return this; + } + + /** + * Get afterLogoutUrl + * @return afterLogoutUrl + */ + @javax.annotation.Nullable + public String getAfterLogoutUrl() { + return afterLogoutUrl; + } + + public void setAfterLogoutUrl(@javax.annotation.Nullable String afterLogoutUrl) { + this.afterLogoutUrl = afterLogoutUrl; + } + + + public SamlIntegrationRequest assertionConsumerService(@javax.annotation.Nullable SamlIntegrationResponseAssertionConsumerService assertionConsumerService) { + this.assertionConsumerService = assertionConsumerService; + return this; + } + + /** + * Get assertionConsumerService + * @return assertionConsumerService + */ + @javax.annotation.Nullable + public SamlIntegrationResponseAssertionConsumerService getAssertionConsumerService() { + return assertionConsumerService; + } + + public void setAssertionConsumerService(@javax.annotation.Nullable SamlIntegrationResponseAssertionConsumerService assertionConsumerService) { + this.assertionConsumerService = assertionConsumerService; + } + + + public SamlIntegrationRequest attributes(@javax.annotation.Nullable Map<String, SamlIntegrationResponseAttributesValue> attributes) { + this.attributes = attributes; + return this; + } + + public SamlIntegrationRequest putAttributesItem(String key, SamlIntegrationResponseAttributesValue attributesItem) { + if (this.attributes == null) { + this.attributes = new HashMap<>(); + } + this.attributes.put(key, attributesItem); + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nullable + public Map<String, SamlIntegrationResponseAttributesValue> getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nullable Map<String, SamlIntegrationResponseAttributesValue> attributes) { + this.attributes = attributes; + } + + + public SamlIntegrationRequest audiences(@javax.annotation.Nullable List<String> audiences) { + this.audiences = audiences; + return this; + } + + public SamlIntegrationRequest addAudiencesItem(String audiencesItem) { + if (this.audiences == null) { + this.audiences = new ArrayList<>(); + } + this.audiences.add(audiencesItem); + return this; + } + + /** + * Get audiences + * @return audiences + */ + @javax.annotation.Nullable + public List<String> getAudiences() { + return audiences; + } + + public void setAudiences(@javax.annotation.Nullable List<String> audiences) { + this.audiences = audiences; + } + + + public SamlIntegrationRequest defaultRequestBinding(@javax.annotation.Nullable DefaultRequestBindingEnum defaultRequestBinding) { + this.defaultRequestBinding = defaultRequestBinding; + return this; + } + + /** + * Get defaultRequestBinding + * @return defaultRequestBinding + */ + @javax.annotation.Nullable + public DefaultRequestBindingEnum getDefaultRequestBinding() { + return defaultRequestBinding; + } + + public void setDefaultRequestBinding(@javax.annotation.Nullable DefaultRequestBindingEnum defaultRequestBinding) { + this.defaultRequestBinding = defaultRequestBinding; + } + + + public SamlIntegrationRequest isIdpInitiated(@javax.annotation.Nullable Boolean isIdpInitiated) { + this.isIdpInitiated = isIdpInitiated; + return this; + } + + /** + * Get isIdpInitiated + * @return isIdpInitiated + */ + @javax.annotation.Nullable + public Boolean getIsIdpInitiated() { + return isIdpInitiated; + } + + public void setIsIdpInitiated(@javax.annotation.Nullable Boolean isIdpInitiated) { + this.isIdpInitiated = isIdpInitiated; + } + + + public SamlIntegrationRequest issuerUrl(@javax.annotation.Nullable String issuerUrl) { + this.issuerUrl = issuerUrl; + return this; + } + + /** + * Get issuerUrl + * @return issuerUrl + */ + @javax.annotation.Nullable + public String getIssuerUrl() { + return issuerUrl; + } + + public void setIssuerUrl(@javax.annotation.Nullable String issuerUrl) { + this.issuerUrl = issuerUrl; + } + + + public SamlIntegrationRequest loginUrl(@javax.annotation.Nullable String loginUrl) { + this.loginUrl = loginUrl; + return this; + } + + /** + * Get loginUrl + * @return loginUrl + */ + @javax.annotation.Nullable + public String getLoginUrl() { + return loginUrl; + } + + public void setLoginUrl(@javax.annotation.Nullable String loginUrl) { + this.loginUrl = loginUrl; + } + + + public SamlIntegrationRequest nameIdFormat(@javax.annotation.Nullable NameIdFormatEnum nameIdFormat) { + this.nameIdFormat = nameIdFormat; + return this; + } + + /** + * Get nameIdFormat + * @return nameIdFormat + */ + @javax.annotation.Nullable + public NameIdFormatEnum getNameIdFormat() { + return nameIdFormat; + } + + public void setNameIdFormat(@javax.annotation.Nullable NameIdFormatEnum nameIdFormat) { + this.nameIdFormat = nameIdFormat; + } + + + public SamlIntegrationRequest notOnOrAfter(@javax.annotation.Nullable Integer notOnOrAfter) { + this.notOnOrAfter = notOnOrAfter; + return this; + } + + /** + * Get notOnOrAfter + * @return notOnOrAfter + */ + @javax.annotation.Nullable + public Integer getNotOnOrAfter() { + return notOnOrAfter; + } + + public void setNotOnOrAfter(@javax.annotation.Nullable Integer notOnOrAfter) { + this.notOnOrAfter = notOnOrAfter; + } + + + public SamlIntegrationRequest relayStateParameter(@javax.annotation.Nullable String relayStateParameter) { + this.relayStateParameter = relayStateParameter; + return this; + } + + /** + * Get relayStateParameter + * @return relayStateParameter + */ + @javax.annotation.Nullable + public String getRelayStateParameter() { + return relayStateParameter; + } + + public void setRelayStateParameter(@javax.annotation.Nullable String relayStateParameter) { + this.relayStateParameter = relayStateParameter; + } + + + public SamlIntegrationRequest spCertificate(@javax.annotation.Nullable Certificates spCertificate) { + this.spCertificate = spCertificate; + return this; + } + + /** + * Get spCertificate + * @return spCertificate + */ + @javax.annotation.Nullable + public Certificates getSpCertificate() { + return spCertificate; + } + + public void setSpCertificate(@javax.annotation.Nullable Certificates spCertificate) { + this.spCertificate = spCertificate; + } + + + public SamlIntegrationRequest spLogoutUrl(@javax.annotation.Nullable String spLogoutUrl) { + this.spLogoutUrl = spLogoutUrl; + return this; + } + + /** + * Get spLogoutUrl + * @return spLogoutUrl + */ + @javax.annotation.Nullable + public String getSpLogoutUrl() { + return spLogoutUrl; + } + + public void setSpLogoutUrl(@javax.annotation.Nullable String spLogoutUrl) { + this.spLogoutUrl = spLogoutUrl; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SamlIntegrationRequest instance itself + */ + public SamlIntegrationRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SamlIntegrationRequest samlIntegrationRequest = (SamlIntegrationRequest) o; + return Objects.equals(this.afterLogoutUrl, samlIntegrationRequest.afterLogoutUrl) && + Objects.equals(this.assertionConsumerService, samlIntegrationRequest.assertionConsumerService) && + Objects.equals(this.attributes, samlIntegrationRequest.attributes) && + Objects.equals(this.audiences, samlIntegrationRequest.audiences) && + Objects.equals(this.defaultRequestBinding, samlIntegrationRequest.defaultRequestBinding) && + Objects.equals(this.isIdpInitiated, samlIntegrationRequest.isIdpInitiated) && + Objects.equals(this.issuerUrl, samlIntegrationRequest.issuerUrl) && + Objects.equals(this.loginUrl, samlIntegrationRequest.loginUrl) && + Objects.equals(this.nameIdFormat, samlIntegrationRequest.nameIdFormat) && + Objects.equals(this.notOnOrAfter, samlIntegrationRequest.notOnOrAfter) && + Objects.equals(this.relayStateParameter, samlIntegrationRequest.relayStateParameter) && + Objects.equals(this.spCertificate, samlIntegrationRequest.spCertificate) && + Objects.equals(this.spLogoutUrl, samlIntegrationRequest.spLogoutUrl)&& + Objects.equals(this.additionalProperties, samlIntegrationRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(afterLogoutUrl, assertionConsumerService, attributes, audiences, defaultRequestBinding, isIdpInitiated, issuerUrl, loginUrl, nameIdFormat, notOnOrAfter, relayStateParameter, spCertificate, spLogoutUrl, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SamlIntegrationRequest {\n"); + sb.append(" afterLogoutUrl: ").append(toIndentedString(afterLogoutUrl)).append("\n"); + sb.append(" assertionConsumerService: ").append(toIndentedString(assertionConsumerService)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" audiences: ").append(toIndentedString(audiences)).append("\n"); + sb.append(" defaultRequestBinding: ").append(toIndentedString(defaultRequestBinding)).append("\n"); + sb.append(" isIdpInitiated: ").append(toIndentedString(isIdpInitiated)).append("\n"); + sb.append(" issuerUrl: ").append(toIndentedString(issuerUrl)).append("\n"); + sb.append(" loginUrl: ").append(toIndentedString(loginUrl)).append("\n"); + sb.append(" nameIdFormat: ").append(toIndentedString(nameIdFormat)).append("\n"); + sb.append(" notOnOrAfter: ").append(toIndentedString(notOnOrAfter)).append("\n"); + sb.append(" relayStateParameter: ").append(toIndentedString(relayStateParameter)).append("\n"); + sb.append(" spCertificate: ").append(toIndentedString(spCertificate)).append("\n"); + sb.append(" spLogoutUrl: ").append(toIndentedString(spLogoutUrl)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AfterLogoutUrl"); + openapiFields.add("AssertionConsumerService"); + openapiFields.add("Attributes"); + openapiFields.add("Audiences"); + openapiFields.add("DefaultRequestBinding"); + openapiFields.add("IsIdpInitiated"); + openapiFields.add("IssuerUrl"); + openapiFields.add("LoginUrl"); + openapiFields.add("NameIdFormat"); + openapiFields.add("NotOnOrAfter"); + openapiFields.add("RelayStateParameter"); + openapiFields.add("SpCertificate"); + openapiFields.add("SpLogoutUrl"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SamlIntegrationRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SamlIntegrationRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SamlIntegrationRequest is not found in the empty JSON string", SamlIntegrationRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("AfterLogoutUrl") != null && !jsonObj.get("AfterLogoutUrl").isJsonNull()) && !jsonObj.get("AfterLogoutUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AfterLogoutUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AfterLogoutUrl").toString())); + } + // validate the optional field `AssertionConsumerService` + if (jsonObj.get("AssertionConsumerService") != null && !jsonObj.get("AssertionConsumerService").isJsonNull()) { + SamlIntegrationResponseAssertionConsumerService.validateJsonElement(jsonObj.get("AssertionConsumerService")); + } + // ensure the optional json data is an array if present + if (jsonObj.get("Audiences") != null && !jsonObj.get("Audiences").isJsonNull() && !jsonObj.get("Audiences").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Audiences` to be an array in the JSON string but got `%s`", jsonObj.get("Audiences").toString())); + } + if ((jsonObj.get("DefaultRequestBinding") != null && !jsonObj.get("DefaultRequestBinding").isJsonNull()) && !jsonObj.get("DefaultRequestBinding").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DefaultRequestBinding` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DefaultRequestBinding").toString())); + } + // validate the optional field `DefaultRequestBinding` + if (jsonObj.get("DefaultRequestBinding") != null && !jsonObj.get("DefaultRequestBinding").isJsonNull()) { + DefaultRequestBindingEnum.validateJsonElement(jsonObj.get("DefaultRequestBinding")); + } + if ((jsonObj.get("IssuerUrl") != null && !jsonObj.get("IssuerUrl").isJsonNull()) && !jsonObj.get("IssuerUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IssuerUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IssuerUrl").toString())); + } + if ((jsonObj.get("LoginUrl") != null && !jsonObj.get("LoginUrl").isJsonNull()) && !jsonObj.get("LoginUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LoginUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LoginUrl").toString())); + } + if ((jsonObj.get("NameIdFormat") != null && !jsonObj.get("NameIdFormat").isJsonNull()) && !jsonObj.get("NameIdFormat").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NameIdFormat` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NameIdFormat").toString())); + } + // validate the optional field `NameIdFormat` + if (jsonObj.get("NameIdFormat") != null && !jsonObj.get("NameIdFormat").isJsonNull()) { + NameIdFormatEnum.validateJsonElement(jsonObj.get("NameIdFormat")); + } + if ((jsonObj.get("RelayStateParameter") != null && !jsonObj.get("RelayStateParameter").isJsonNull()) && !jsonObj.get("RelayStateParameter").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RelayStateParameter` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RelayStateParameter").toString())); + } + // validate the optional field `SpCertificate` + if (jsonObj.get("SpCertificate") != null && !jsonObj.get("SpCertificate").isJsonNull()) { + Certificates.validateJsonElement(jsonObj.get("SpCertificate")); + } + if ((jsonObj.get("SpLogoutUrl") != null && !jsonObj.get("SpLogoutUrl").isJsonNull()) && !jsonObj.get("SpLogoutUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SpLogoutUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SpLogoutUrl").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SamlIntegrationRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SamlIntegrationRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SamlIntegrationRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SamlIntegrationRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<SamlIntegrationRequest>() { + @Override + public void write(JsonWriter out, SamlIntegrationRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SamlIntegrationRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SamlIntegrationRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SamlIntegrationRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of SamlIntegrationRequest + * @throws IOException if the JSON string is invalid with respect to SamlIntegrationRequest + */ + public static SamlIntegrationRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SamlIntegrationRequest.class); + } + + /** + * Convert an instance of SamlIntegrationRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIntegrationResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIntegrationResponse.java new file mode 100644 index 0000000..443c51a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIntegrationResponse.java @@ -0,0 +1,905 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.SamlIntegrationResponseAssertionConsumerService; +import com.loginradius.sdk.internal.openapi.model.SamlIntegrationResponseAttributesValue; +import com.loginradius.sdk.internal.openapi.model.SamlIntegrationResponseIdpCertificate; +import com.loginradius.sdk.internal.openapi.model.SamlIntegrationResponseIntegrationConfigs; +import com.loginradius.sdk.internal.openapi.model.SamlIntegrationResponseSpCertificate; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SamlIntegrationResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SamlIntegrationResponse { + public static final String SERIALIZED_NAME_AFTER_LOGOUT_URL = "AfterLogoutUrl"; + @SerializedName(SERIALIZED_NAME_AFTER_LOGOUT_URL) + @javax.annotation.Nullable + private String afterLogoutUrl; + + public static final String SERIALIZED_NAME_APP_NAME = "AppName"; + @SerializedName(SERIALIZED_NAME_APP_NAME) + @javax.annotation.Nullable + private String appName; + + public static final String SERIALIZED_NAME_ARTIFACT_RECEIVER = "ArtifactReceiver"; + @SerializedName(SERIALIZED_NAME_ARTIFACT_RECEIVER) + @javax.annotation.Nullable + private String artifactReceiver; + + public static final String SERIALIZED_NAME_ASSERTION_CONSUMER_SERVICE = "AssertionConsumerService"; + @SerializedName(SERIALIZED_NAME_ASSERTION_CONSUMER_SERVICE) + @javax.annotation.Nullable + private SamlIntegrationResponseAssertionConsumerService assertionConsumerService; + + public static final String SERIALIZED_NAME_ATTRIBUTES = "Attributes"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTES) + @javax.annotation.Nullable + private Map<String, SamlIntegrationResponseAttributesValue> attributes = new HashMap<>(); + + public static final String SERIALIZED_NAME_AUDIENCES = "Audiences"; + @SerializedName(SERIALIZED_NAME_AUDIENCES) + @javax.annotation.Nullable + private List<String> audiences = new ArrayList<>(); + + public static final String SERIALIZED_NAME_DEFAULT_REQUEST_BINDING = "DefaultRequestBinding"; + @SerializedName(SERIALIZED_NAME_DEFAULT_REQUEST_BINDING) + @javax.annotation.Nullable + private String defaultRequestBinding; + + public static final String SERIALIZED_NAME_IDP_CERTIFICATE = "IdpCertificate"; + @SerializedName(SERIALIZED_NAME_IDP_CERTIFICATE) + @javax.annotation.Nullable + private SamlIntegrationResponseIdpCertificate idpCertificate; + + public static final String SERIALIZED_NAME_IS_IDP_INITIATED = "IsIdpInitiated"; + @SerializedName(SERIALIZED_NAME_IS_IDP_INITIATED) + @javax.annotation.Nullable + private Boolean isIdpInitiated; + + public static final String SERIALIZED_NAME_ISSUER_URL = "IssuerUrl"; + @SerializedName(SERIALIZED_NAME_ISSUER_URL) + @javax.annotation.Nullable + private String issuerUrl; + + public static final String SERIALIZED_NAME_LOGIN_URL = "LoginUrl"; + @SerializedName(SERIALIZED_NAME_LOGIN_URL) + @javax.annotation.Nullable + private String loginUrl; + + public static final String SERIALIZED_NAME_NAME_ID_FORMAT = "NameIdFormat"; + @SerializedName(SERIALIZED_NAME_NAME_ID_FORMAT) + @javax.annotation.Nullable + private String nameIdFormat; + + public static final String SERIALIZED_NAME_NOT_ON_OR_AFTER = "NotOnOrAfter"; + @SerializedName(SERIALIZED_NAME_NOT_ON_OR_AFTER) + @javax.annotation.Nullable + private Integer notOnOrAfter; + + public static final String SERIALIZED_NAME_RELAY_STATE_PARAMETER = "RelayStateParameter"; + @SerializedName(SERIALIZED_NAME_RELAY_STATE_PARAMETER) + @javax.annotation.Nullable + private String relayStateParameter; + + public static final String SERIALIZED_NAME_SAML_VERSION = "SamlVersion"; + @SerializedName(SERIALIZED_NAME_SAML_VERSION) + @javax.annotation.Nullable + private String samlVersion; + + public static final String SERIALIZED_NAME_SP_CERTIFICATE = "SpCertificate"; + @SerializedName(SERIALIZED_NAME_SP_CERTIFICATE) + @javax.annotation.Nullable + private SamlIntegrationResponseSpCertificate spCertificate; + + public static final String SERIALIZED_NAME_SP_LOGOUT_URL = "SpLogoutUrl"; + @SerializedName(SERIALIZED_NAME_SP_LOGOUT_URL) + @javax.annotation.Nullable + private String spLogoutUrl; + + public static final String SERIALIZED_NAME_IS_PREBUILT_INTEGRATION = "IsPrebuiltIntegration"; + @SerializedName(SERIALIZED_NAME_IS_PREBUILT_INTEGRATION) + @javax.annotation.Nullable + private Boolean isPrebuiltIntegration; + + public static final String SERIALIZED_NAME_REPLY_URL = "ReplyUrl"; + @SerializedName(SERIALIZED_NAME_REPLY_URL) + @javax.annotation.Nullable + private String replyUrl; + + public static final String SERIALIZED_NAME_INTEGRATION_TYPE = "IntegrationType"; + @SerializedName(SERIALIZED_NAME_INTEGRATION_TYPE) + @javax.annotation.Nullable + private String integrationType; + + public static final String SERIALIZED_NAME_INTEGRATION_CONFIGS = "IntegrationConfigs"; + @SerializedName(SERIALIZED_NAME_INTEGRATION_CONFIGS) + @javax.annotation.Nullable + private SamlIntegrationResponseIntegrationConfigs integrationConfigs; + + public SamlIntegrationResponse() { + } + + public SamlIntegrationResponse afterLogoutUrl(@javax.annotation.Nullable String afterLogoutUrl) { + this.afterLogoutUrl = afterLogoutUrl; + return this; + } + + /** + * Get afterLogoutUrl + * @return afterLogoutUrl + */ + @javax.annotation.Nullable + public String getAfterLogoutUrl() { + return afterLogoutUrl; + } + + public void setAfterLogoutUrl(@javax.annotation.Nullable String afterLogoutUrl) { + this.afterLogoutUrl = afterLogoutUrl; + } + + + public SamlIntegrationResponse appName(@javax.annotation.Nullable String appName) { + this.appName = appName; + return this; + } + + /** + * Get appName + * @return appName + */ + @javax.annotation.Nullable + public String getAppName() { + return appName; + } + + public void setAppName(@javax.annotation.Nullable String appName) { + this.appName = appName; + } + + + public SamlIntegrationResponse artifactReceiver(@javax.annotation.Nullable String artifactReceiver) { + this.artifactReceiver = artifactReceiver; + return this; + } + + /** + * Get artifactReceiver + * @return artifactReceiver + */ + @javax.annotation.Nullable + public String getArtifactReceiver() { + return artifactReceiver; + } + + public void setArtifactReceiver(@javax.annotation.Nullable String artifactReceiver) { + this.artifactReceiver = artifactReceiver; + } + + + public SamlIntegrationResponse assertionConsumerService(@javax.annotation.Nullable SamlIntegrationResponseAssertionConsumerService assertionConsumerService) { + this.assertionConsumerService = assertionConsumerService; + return this; + } + + /** + * Get assertionConsumerService + * @return assertionConsumerService + */ + @javax.annotation.Nullable + public SamlIntegrationResponseAssertionConsumerService getAssertionConsumerService() { + return assertionConsumerService; + } + + public void setAssertionConsumerService(@javax.annotation.Nullable SamlIntegrationResponseAssertionConsumerService assertionConsumerService) { + this.assertionConsumerService = assertionConsumerService; + } + + + public SamlIntegrationResponse attributes(@javax.annotation.Nullable Map<String, SamlIntegrationResponseAttributesValue> attributes) { + this.attributes = attributes; + return this; + } + + public SamlIntegrationResponse putAttributesItem(String key, SamlIntegrationResponseAttributesValue attributesItem) { + if (this.attributes == null) { + this.attributes = new HashMap<>(); + } + this.attributes.put(key, attributesItem); + return this; + } + + /** + * Get attributes + * @return attributes + */ + @javax.annotation.Nullable + public Map<String, SamlIntegrationResponseAttributesValue> getAttributes() { + return attributes; + } + + public void setAttributes(@javax.annotation.Nullable Map<String, SamlIntegrationResponseAttributesValue> attributes) { + this.attributes = attributes; + } + + + public SamlIntegrationResponse audiences(@javax.annotation.Nullable List<String> audiences) { + this.audiences = audiences; + return this; + } + + public SamlIntegrationResponse addAudiencesItem(String audiencesItem) { + if (this.audiences == null) { + this.audiences = new ArrayList<>(); + } + this.audiences.add(audiencesItem); + return this; + } + + /** + * Get audiences + * @return audiences + */ + @javax.annotation.Nullable + public List<String> getAudiences() { + return audiences; + } + + public void setAudiences(@javax.annotation.Nullable List<String> audiences) { + this.audiences = audiences; + } + + + public SamlIntegrationResponse defaultRequestBinding(@javax.annotation.Nullable String defaultRequestBinding) { + this.defaultRequestBinding = defaultRequestBinding; + return this; + } + + /** + * Get defaultRequestBinding + * @return defaultRequestBinding + */ + @javax.annotation.Nullable + public String getDefaultRequestBinding() { + return defaultRequestBinding; + } + + public void setDefaultRequestBinding(@javax.annotation.Nullable String defaultRequestBinding) { + this.defaultRequestBinding = defaultRequestBinding; + } + + + public SamlIntegrationResponse idpCertificate(@javax.annotation.Nullable SamlIntegrationResponseIdpCertificate idpCertificate) { + this.idpCertificate = idpCertificate; + return this; + } + + /** + * Get idpCertificate + * @return idpCertificate + */ + @javax.annotation.Nullable + public SamlIntegrationResponseIdpCertificate getIdpCertificate() { + return idpCertificate; + } + + public void setIdpCertificate(@javax.annotation.Nullable SamlIntegrationResponseIdpCertificate idpCertificate) { + this.idpCertificate = idpCertificate; + } + + + public SamlIntegrationResponse isIdpInitiated(@javax.annotation.Nullable Boolean isIdpInitiated) { + this.isIdpInitiated = isIdpInitiated; + return this; + } + + /** + * Get isIdpInitiated + * @return isIdpInitiated + */ + @javax.annotation.Nullable + public Boolean getIsIdpInitiated() { + return isIdpInitiated; + } + + public void setIsIdpInitiated(@javax.annotation.Nullable Boolean isIdpInitiated) { + this.isIdpInitiated = isIdpInitiated; + } + + + public SamlIntegrationResponse issuerUrl(@javax.annotation.Nullable String issuerUrl) { + this.issuerUrl = issuerUrl; + return this; + } + + /** + * Get issuerUrl + * @return issuerUrl + */ + @javax.annotation.Nullable + public String getIssuerUrl() { + return issuerUrl; + } + + public void setIssuerUrl(@javax.annotation.Nullable String issuerUrl) { + this.issuerUrl = issuerUrl; + } + + + public SamlIntegrationResponse loginUrl(@javax.annotation.Nullable String loginUrl) { + this.loginUrl = loginUrl; + return this; + } + + /** + * Get loginUrl + * @return loginUrl + */ + @javax.annotation.Nullable + public String getLoginUrl() { + return loginUrl; + } + + public void setLoginUrl(@javax.annotation.Nullable String loginUrl) { + this.loginUrl = loginUrl; + } + + + public SamlIntegrationResponse nameIdFormat(@javax.annotation.Nullable String nameIdFormat) { + this.nameIdFormat = nameIdFormat; + return this; + } + + /** + * Get nameIdFormat + * @return nameIdFormat + */ + @javax.annotation.Nullable + public String getNameIdFormat() { + return nameIdFormat; + } + + public void setNameIdFormat(@javax.annotation.Nullable String nameIdFormat) { + this.nameIdFormat = nameIdFormat; + } + + + public SamlIntegrationResponse notOnOrAfter(@javax.annotation.Nullable Integer notOnOrAfter) { + this.notOnOrAfter = notOnOrAfter; + return this; + } + + /** + * Get notOnOrAfter + * @return notOnOrAfter + */ + @javax.annotation.Nullable + public Integer getNotOnOrAfter() { + return notOnOrAfter; + } + + public void setNotOnOrAfter(@javax.annotation.Nullable Integer notOnOrAfter) { + this.notOnOrAfter = notOnOrAfter; + } + + + public SamlIntegrationResponse relayStateParameter(@javax.annotation.Nullable String relayStateParameter) { + this.relayStateParameter = relayStateParameter; + return this; + } + + /** + * Get relayStateParameter + * @return relayStateParameter + */ + @javax.annotation.Nullable + public String getRelayStateParameter() { + return relayStateParameter; + } + + public void setRelayStateParameter(@javax.annotation.Nullable String relayStateParameter) { + this.relayStateParameter = relayStateParameter; + } + + + public SamlIntegrationResponse samlVersion(@javax.annotation.Nullable String samlVersion) { + this.samlVersion = samlVersion; + return this; + } + + /** + * Get samlVersion + * @return samlVersion + */ + @javax.annotation.Nullable + public String getSamlVersion() { + return samlVersion; + } + + public void setSamlVersion(@javax.annotation.Nullable String samlVersion) { + this.samlVersion = samlVersion; + } + + + public SamlIntegrationResponse spCertificate(@javax.annotation.Nullable SamlIntegrationResponseSpCertificate spCertificate) { + this.spCertificate = spCertificate; + return this; + } + + /** + * Get spCertificate + * @return spCertificate + */ + @javax.annotation.Nullable + public SamlIntegrationResponseSpCertificate getSpCertificate() { + return spCertificate; + } + + public void setSpCertificate(@javax.annotation.Nullable SamlIntegrationResponseSpCertificate spCertificate) { + this.spCertificate = spCertificate; + } + + + public SamlIntegrationResponse spLogoutUrl(@javax.annotation.Nullable String spLogoutUrl) { + this.spLogoutUrl = spLogoutUrl; + return this; + } + + /** + * Get spLogoutUrl + * @return spLogoutUrl + */ + @javax.annotation.Nullable + public String getSpLogoutUrl() { + return spLogoutUrl; + } + + public void setSpLogoutUrl(@javax.annotation.Nullable String spLogoutUrl) { + this.spLogoutUrl = spLogoutUrl; + } + + + public SamlIntegrationResponse isPrebuiltIntegration(@javax.annotation.Nullable Boolean isPrebuiltIntegration) { + this.isPrebuiltIntegration = isPrebuiltIntegration; + return this; + } + + /** + * Get isPrebuiltIntegration + * @return isPrebuiltIntegration + */ + @javax.annotation.Nullable + public Boolean getIsPrebuiltIntegration() { + return isPrebuiltIntegration; + } + + public void setIsPrebuiltIntegration(@javax.annotation.Nullable Boolean isPrebuiltIntegration) { + this.isPrebuiltIntegration = isPrebuiltIntegration; + } + + + public SamlIntegrationResponse replyUrl(@javax.annotation.Nullable String replyUrl) { + this.replyUrl = replyUrl; + return this; + } + + /** + * Get replyUrl + * @return replyUrl + */ + @javax.annotation.Nullable + public String getReplyUrl() { + return replyUrl; + } + + public void setReplyUrl(@javax.annotation.Nullable String replyUrl) { + this.replyUrl = replyUrl; + } + + + public SamlIntegrationResponse integrationType(@javax.annotation.Nullable String integrationType) { + this.integrationType = integrationType; + return this; + } + + /** + * Get integrationType + * @return integrationType + */ + @javax.annotation.Nullable + public String getIntegrationType() { + return integrationType; + } + + public void setIntegrationType(@javax.annotation.Nullable String integrationType) { + this.integrationType = integrationType; + } + + + public SamlIntegrationResponse integrationConfigs(@javax.annotation.Nullable SamlIntegrationResponseIntegrationConfigs integrationConfigs) { + this.integrationConfigs = integrationConfigs; + return this; + } + + /** + * Get integrationConfigs + * @return integrationConfigs + */ + @javax.annotation.Nullable + public SamlIntegrationResponseIntegrationConfigs getIntegrationConfigs() { + return integrationConfigs; + } + + public void setIntegrationConfigs(@javax.annotation.Nullable SamlIntegrationResponseIntegrationConfigs integrationConfigs) { + this.integrationConfigs = integrationConfigs; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SamlIntegrationResponse instance itself + */ + public SamlIntegrationResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SamlIntegrationResponse samlIntegrationResponse = (SamlIntegrationResponse) o; + return Objects.equals(this.afterLogoutUrl, samlIntegrationResponse.afterLogoutUrl) && + Objects.equals(this.appName, samlIntegrationResponse.appName) && + Objects.equals(this.artifactReceiver, samlIntegrationResponse.artifactReceiver) && + Objects.equals(this.assertionConsumerService, samlIntegrationResponse.assertionConsumerService) && + Objects.equals(this.attributes, samlIntegrationResponse.attributes) && + Objects.equals(this.audiences, samlIntegrationResponse.audiences) && + Objects.equals(this.defaultRequestBinding, samlIntegrationResponse.defaultRequestBinding) && + Objects.equals(this.idpCertificate, samlIntegrationResponse.idpCertificate) && + Objects.equals(this.isIdpInitiated, samlIntegrationResponse.isIdpInitiated) && + Objects.equals(this.issuerUrl, samlIntegrationResponse.issuerUrl) && + Objects.equals(this.loginUrl, samlIntegrationResponse.loginUrl) && + Objects.equals(this.nameIdFormat, samlIntegrationResponse.nameIdFormat) && + Objects.equals(this.notOnOrAfter, samlIntegrationResponse.notOnOrAfter) && + Objects.equals(this.relayStateParameter, samlIntegrationResponse.relayStateParameter) && + Objects.equals(this.samlVersion, samlIntegrationResponse.samlVersion) && + Objects.equals(this.spCertificate, samlIntegrationResponse.spCertificate) && + Objects.equals(this.spLogoutUrl, samlIntegrationResponse.spLogoutUrl) && + Objects.equals(this.isPrebuiltIntegration, samlIntegrationResponse.isPrebuiltIntegration) && + Objects.equals(this.replyUrl, samlIntegrationResponse.replyUrl) && + Objects.equals(this.integrationType, samlIntegrationResponse.integrationType) && + Objects.equals(this.integrationConfigs, samlIntegrationResponse.integrationConfigs)&& + Objects.equals(this.additionalProperties, samlIntegrationResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(afterLogoutUrl, appName, artifactReceiver, assertionConsumerService, attributes, audiences, defaultRequestBinding, idpCertificate, isIdpInitiated, issuerUrl, loginUrl, nameIdFormat, notOnOrAfter, relayStateParameter, samlVersion, spCertificate, spLogoutUrl, isPrebuiltIntegration, replyUrl, integrationType, integrationConfigs, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SamlIntegrationResponse {\n"); + sb.append(" afterLogoutUrl: ").append(toIndentedString(afterLogoutUrl)).append("\n"); + sb.append(" appName: ").append(toIndentedString(appName)).append("\n"); + sb.append(" artifactReceiver: ").append(toIndentedString(artifactReceiver)).append("\n"); + sb.append(" assertionConsumerService: ").append(toIndentedString(assertionConsumerService)).append("\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" audiences: ").append(toIndentedString(audiences)).append("\n"); + sb.append(" defaultRequestBinding: ").append(toIndentedString(defaultRequestBinding)).append("\n"); + sb.append(" idpCertificate: ").append(toIndentedString(idpCertificate)).append("\n"); + sb.append(" isIdpInitiated: ").append(toIndentedString(isIdpInitiated)).append("\n"); + sb.append(" issuerUrl: ").append(toIndentedString(issuerUrl)).append("\n"); + sb.append(" loginUrl: ").append(toIndentedString(loginUrl)).append("\n"); + sb.append(" nameIdFormat: ").append(toIndentedString(nameIdFormat)).append("\n"); + sb.append(" notOnOrAfter: ").append(toIndentedString(notOnOrAfter)).append("\n"); + sb.append(" relayStateParameter: ").append(toIndentedString(relayStateParameter)).append("\n"); + sb.append(" samlVersion: ").append(toIndentedString(samlVersion)).append("\n"); + sb.append(" spCertificate: ").append(toIndentedString(spCertificate)).append("\n"); + sb.append(" spLogoutUrl: ").append(toIndentedString(spLogoutUrl)).append("\n"); + sb.append(" isPrebuiltIntegration: ").append(toIndentedString(isPrebuiltIntegration)).append("\n"); + sb.append(" replyUrl: ").append(toIndentedString(replyUrl)).append("\n"); + sb.append(" integrationType: ").append(toIndentedString(integrationType)).append("\n"); + sb.append(" integrationConfigs: ").append(toIndentedString(integrationConfigs)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AfterLogoutUrl"); + openapiFields.add("AppName"); + openapiFields.add("ArtifactReceiver"); + openapiFields.add("AssertionConsumerService"); + openapiFields.add("Attributes"); + openapiFields.add("Audiences"); + openapiFields.add("DefaultRequestBinding"); + openapiFields.add("IdpCertificate"); + openapiFields.add("IsIdpInitiated"); + openapiFields.add("IssuerUrl"); + openapiFields.add("LoginUrl"); + openapiFields.add("NameIdFormat"); + openapiFields.add("NotOnOrAfter"); + openapiFields.add("RelayStateParameter"); + openapiFields.add("SamlVersion"); + openapiFields.add("SpCertificate"); + openapiFields.add("SpLogoutUrl"); + openapiFields.add("IsPrebuiltIntegration"); + openapiFields.add("ReplyUrl"); + openapiFields.add("IntegrationType"); + openapiFields.add("IntegrationConfigs"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SamlIntegrationResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SamlIntegrationResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SamlIntegrationResponse is not found in the empty JSON string", SamlIntegrationResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("AfterLogoutUrl") != null && !jsonObj.get("AfterLogoutUrl").isJsonNull()) && !jsonObj.get("AfterLogoutUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AfterLogoutUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AfterLogoutUrl").toString())); + } + if ((jsonObj.get("AppName") != null && !jsonObj.get("AppName").isJsonNull()) && !jsonObj.get("AppName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AppName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AppName").toString())); + } + if ((jsonObj.get("ArtifactReceiver") != null && !jsonObj.get("ArtifactReceiver").isJsonNull()) && !jsonObj.get("ArtifactReceiver").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ArtifactReceiver` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ArtifactReceiver").toString())); + } + // validate the optional field `AssertionConsumerService` + if (jsonObj.get("AssertionConsumerService") != null && !jsonObj.get("AssertionConsumerService").isJsonNull()) { + SamlIntegrationResponseAssertionConsumerService.validateJsonElement(jsonObj.get("AssertionConsumerService")); + } + // ensure the optional json data is an array if present + if (jsonObj.get("Audiences") != null && !jsonObj.get("Audiences").isJsonNull() && !jsonObj.get("Audiences").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Audiences` to be an array in the JSON string but got `%s`", jsonObj.get("Audiences").toString())); + } + if ((jsonObj.get("DefaultRequestBinding") != null && !jsonObj.get("DefaultRequestBinding").isJsonNull()) && !jsonObj.get("DefaultRequestBinding").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DefaultRequestBinding` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DefaultRequestBinding").toString())); + } + // validate the optional field `IdpCertificate` + if (jsonObj.get("IdpCertificate") != null && !jsonObj.get("IdpCertificate").isJsonNull()) { + SamlIntegrationResponseIdpCertificate.validateJsonElement(jsonObj.get("IdpCertificate")); + } + if ((jsonObj.get("IssuerUrl") != null && !jsonObj.get("IssuerUrl").isJsonNull()) && !jsonObj.get("IssuerUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IssuerUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IssuerUrl").toString())); + } + if ((jsonObj.get("LoginUrl") != null && !jsonObj.get("LoginUrl").isJsonNull()) && !jsonObj.get("LoginUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LoginUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LoginUrl").toString())); + } + if ((jsonObj.get("NameIdFormat") != null && !jsonObj.get("NameIdFormat").isJsonNull()) && !jsonObj.get("NameIdFormat").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NameIdFormat` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NameIdFormat").toString())); + } + if ((jsonObj.get("RelayStateParameter") != null && !jsonObj.get("RelayStateParameter").isJsonNull()) && !jsonObj.get("RelayStateParameter").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RelayStateParameter` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RelayStateParameter").toString())); + } + if ((jsonObj.get("SamlVersion") != null && !jsonObj.get("SamlVersion").isJsonNull()) && !jsonObj.get("SamlVersion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SamlVersion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SamlVersion").toString())); + } + // validate the optional field `SpCertificate` + if (jsonObj.get("SpCertificate") != null && !jsonObj.get("SpCertificate").isJsonNull()) { + SamlIntegrationResponseSpCertificate.validateJsonElement(jsonObj.get("SpCertificate")); + } + if ((jsonObj.get("SpLogoutUrl") != null && !jsonObj.get("SpLogoutUrl").isJsonNull()) && !jsonObj.get("SpLogoutUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SpLogoutUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SpLogoutUrl").toString())); + } + if ((jsonObj.get("ReplyUrl") != null && !jsonObj.get("ReplyUrl").isJsonNull()) && !jsonObj.get("ReplyUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ReplyUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ReplyUrl").toString())); + } + if ((jsonObj.get("IntegrationType") != null && !jsonObj.get("IntegrationType").isJsonNull()) && !jsonObj.get("IntegrationType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IntegrationType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IntegrationType").toString())); + } + // validate the optional field `IntegrationConfigs` + if (jsonObj.get("IntegrationConfigs") != null && !jsonObj.get("IntegrationConfigs").isJsonNull()) { + SamlIntegrationResponseIntegrationConfigs.validateJsonElement(jsonObj.get("IntegrationConfigs")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SamlIntegrationResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SamlIntegrationResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SamlIntegrationResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SamlIntegrationResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<SamlIntegrationResponse>() { + @Override + public void write(JsonWriter out, SamlIntegrationResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SamlIntegrationResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SamlIntegrationResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SamlIntegrationResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SamlIntegrationResponse + * @throws IOException if the JSON string is invalid with respect to SamlIntegrationResponse + */ + public static SamlIntegrationResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SamlIntegrationResponse.class); + } + + /** + * Convert an instance of SamlIntegrationResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIntegrationResponseAssertionConsumerService.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIntegrationResponseAssertionConsumerService.java new file mode 100644 index 0000000..16b28bb --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIntegrationResponseAssertionConsumerService.java @@ -0,0 +1,373 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SamlIntegrationResponseAssertionConsumerService + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SamlIntegrationResponseAssertionConsumerService { + /** + * Gets or Sets binding + */ + @JsonAdapter(BindingEnum.Adapter.class) + public enum BindingEnum { + POST("urn:oasis:names:tc:SAML:2.0:bindings:HTTP-POST"), + + REDIRECT("urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect"); + + private String value; + + BindingEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static BindingEnum fromValue(String value) { + for (BindingEnum b : BindingEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<BindingEnum> { + @Override + public void write(final JsonWriter jsonWriter, final BindingEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public BindingEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return BindingEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + BindingEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_BINDING = "Binding"; + @SerializedName(SERIALIZED_NAME_BINDING) + @javax.annotation.Nullable + private BindingEnum binding; + + public static final String SERIALIZED_NAME_LOCATION = "Location"; + @SerializedName(SERIALIZED_NAME_LOCATION) + @javax.annotation.Nullable + private String location; + + public SamlIntegrationResponseAssertionConsumerService() { + } + + public SamlIntegrationResponseAssertionConsumerService binding(@javax.annotation.Nullable BindingEnum binding) { + this.binding = binding; + return this; + } + + /** + * Get binding + * @return binding + */ + @javax.annotation.Nullable + public BindingEnum getBinding() { + return binding; + } + + public void setBinding(@javax.annotation.Nullable BindingEnum binding) { + this.binding = binding; + } + + + public SamlIntegrationResponseAssertionConsumerService location(@javax.annotation.Nullable String location) { + this.location = location; + return this; + } + + /** + * Get location + * @return location + */ + @javax.annotation.Nullable + public String getLocation() { + return location; + } + + public void setLocation(@javax.annotation.Nullable String location) { + this.location = location; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SamlIntegrationResponseAssertionConsumerService instance itself + */ + public SamlIntegrationResponseAssertionConsumerService putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SamlIntegrationResponseAssertionConsumerService samlIntegrationResponseAssertionConsumerService = (SamlIntegrationResponseAssertionConsumerService) o; + return Objects.equals(this.binding, samlIntegrationResponseAssertionConsumerService.binding) && + Objects.equals(this.location, samlIntegrationResponseAssertionConsumerService.location)&& + Objects.equals(this.additionalProperties, samlIntegrationResponseAssertionConsumerService.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(binding, location, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SamlIntegrationResponseAssertionConsumerService {\n"); + sb.append(" binding: ").append(toIndentedString(binding)).append("\n"); + sb.append(" location: ").append(toIndentedString(location)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Binding"); + openapiFields.add("Location"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SamlIntegrationResponseAssertionConsumerService + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SamlIntegrationResponseAssertionConsumerService.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SamlIntegrationResponseAssertionConsumerService is not found in the empty JSON string", SamlIntegrationResponseAssertionConsumerService.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Binding") != null && !jsonObj.get("Binding").isJsonNull()) && !jsonObj.get("Binding").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Binding` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Binding").toString())); + } + // validate the optional field `Binding` + if (jsonObj.get("Binding") != null && !jsonObj.get("Binding").isJsonNull()) { + BindingEnum.validateJsonElement(jsonObj.get("Binding")); + } + if ((jsonObj.get("Location") != null && !jsonObj.get("Location").isJsonNull()) && !jsonObj.get("Location").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Location` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Location").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SamlIntegrationResponseAssertionConsumerService.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SamlIntegrationResponseAssertionConsumerService' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SamlIntegrationResponseAssertionConsumerService> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SamlIntegrationResponseAssertionConsumerService.class)); + + return (TypeAdapter<T>) new TypeAdapter<SamlIntegrationResponseAssertionConsumerService>() { + @Override + public void write(JsonWriter out, SamlIntegrationResponseAssertionConsumerService value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SamlIntegrationResponseAssertionConsumerService read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SamlIntegrationResponseAssertionConsumerService instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SamlIntegrationResponseAssertionConsumerService given an JSON string + * + * @param jsonString JSON string + * @return An instance of SamlIntegrationResponseAssertionConsumerService + * @throws IOException if the JSON string is invalid with respect to SamlIntegrationResponseAssertionConsumerService + */ + public static SamlIntegrationResponseAssertionConsumerService fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SamlIntegrationResponseAssertionConsumerService.class); + } + + /** + * Convert an instance of SamlIntegrationResponseAssertionConsumerService to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIntegrationResponseAttributesValue.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIntegrationResponseAttributesValue.java new file mode 100644 index 0000000..b9b17ee --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIntegrationResponseAttributesValue.java @@ -0,0 +1,374 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SamlIntegrationResponseAttributesValue + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SamlIntegrationResponseAttributesValue { + public static final String SERIALIZED_NAME_ALTERNATIVE_MAPPING_KEY = "AlternativeMappingKey"; + @SerializedName(SERIALIZED_NAME_ALTERNATIVE_MAPPING_KEY) + @javax.annotation.Nullable + private String alternativeMappingKey; + + public static final String SERIALIZED_NAME_FORMAT = "Format"; + @SerializedName(SERIALIZED_NAME_FORMAT) + @javax.annotation.Nullable + private String format; + + public static final String SERIALIZED_NAME_IS_STATIC = "IsStatic"; + @SerializedName(SERIALIZED_NAME_IS_STATIC) + @javax.annotation.Nullable + private Boolean isStatic; + + public static final String SERIALIZED_NAME_VALUE = "Value"; + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nullable + private String value; + + public SamlIntegrationResponseAttributesValue() { + } + + public SamlIntegrationResponseAttributesValue alternativeMappingKey(@javax.annotation.Nullable String alternativeMappingKey) { + this.alternativeMappingKey = alternativeMappingKey; + return this; + } + + /** + * Get alternativeMappingKey + * @return alternativeMappingKey + */ + @javax.annotation.Nullable + public String getAlternativeMappingKey() { + return alternativeMappingKey; + } + + public void setAlternativeMappingKey(@javax.annotation.Nullable String alternativeMappingKey) { + this.alternativeMappingKey = alternativeMappingKey; + } + + + public SamlIntegrationResponseAttributesValue format(@javax.annotation.Nullable String format) { + this.format = format; + return this; + } + + /** + * Get format + * @return format + */ + @javax.annotation.Nullable + public String getFormat() { + return format; + } + + public void setFormat(@javax.annotation.Nullable String format) { + this.format = format; + } + + + public SamlIntegrationResponseAttributesValue isStatic(@javax.annotation.Nullable Boolean isStatic) { + this.isStatic = isStatic; + return this; + } + + /** + * Get isStatic + * @return isStatic + */ + @javax.annotation.Nullable + public Boolean getIsStatic() { + return isStatic; + } + + public void setIsStatic(@javax.annotation.Nullable Boolean isStatic) { + this.isStatic = isStatic; + } + + + public SamlIntegrationResponseAttributesValue value(@javax.annotation.Nullable String value) { + this.value = value; + return this; + } + + /** + * Get value + * @return value + */ + @javax.annotation.Nullable + public String getValue() { + return value; + } + + public void setValue(@javax.annotation.Nullable String value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SamlIntegrationResponseAttributesValue instance itself + */ + public SamlIntegrationResponseAttributesValue putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SamlIntegrationResponseAttributesValue samlIntegrationResponseAttributesValue = (SamlIntegrationResponseAttributesValue) o; + return Objects.equals(this.alternativeMappingKey, samlIntegrationResponseAttributesValue.alternativeMappingKey) && + Objects.equals(this.format, samlIntegrationResponseAttributesValue.format) && + Objects.equals(this.isStatic, samlIntegrationResponseAttributesValue.isStatic) && + Objects.equals(this.value, samlIntegrationResponseAttributesValue.value)&& + Objects.equals(this.additionalProperties, samlIntegrationResponseAttributesValue.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(alternativeMappingKey, format, isStatic, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SamlIntegrationResponseAttributesValue {\n"); + sb.append(" alternativeMappingKey: ").append(toIndentedString(alternativeMappingKey)).append("\n"); + sb.append(" format: ").append(toIndentedString(format)).append("\n"); + sb.append(" isStatic: ").append(toIndentedString(isStatic)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AlternativeMappingKey"); + openapiFields.add("Format"); + openapiFields.add("IsStatic"); + openapiFields.add("Value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SamlIntegrationResponseAttributesValue + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SamlIntegrationResponseAttributesValue.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SamlIntegrationResponseAttributesValue is not found in the empty JSON string", SamlIntegrationResponseAttributesValue.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("AlternativeMappingKey") != null && !jsonObj.get("AlternativeMappingKey").isJsonNull()) && !jsonObj.get("AlternativeMappingKey").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AlternativeMappingKey` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AlternativeMappingKey").toString())); + } + if ((jsonObj.get("Format") != null && !jsonObj.get("Format").isJsonNull()) && !jsonObj.get("Format").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Format` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Format").toString())); + } + if ((jsonObj.get("Value") != null && !jsonObj.get("Value").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SamlIntegrationResponseAttributesValue.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SamlIntegrationResponseAttributesValue' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SamlIntegrationResponseAttributesValue> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SamlIntegrationResponseAttributesValue.class)); + + return (TypeAdapter<T>) new TypeAdapter<SamlIntegrationResponseAttributesValue>() { + @Override + public void write(JsonWriter out, SamlIntegrationResponseAttributesValue value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SamlIntegrationResponseAttributesValue read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SamlIntegrationResponseAttributesValue instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SamlIntegrationResponseAttributesValue given an JSON string + * + * @param jsonString JSON string + * @return An instance of SamlIntegrationResponseAttributesValue + * @throws IOException if the JSON string is invalid with respect to SamlIntegrationResponseAttributesValue + */ + public static SamlIntegrationResponseAttributesValue fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SamlIntegrationResponseAttributesValue.class); + } + + /** + * Convert an instance of SamlIntegrationResponseAttributesValue to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIntegrationResponseIdpCertificate.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIntegrationResponseIdpCertificate.java new file mode 100644 index 0000000..49b1803 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIntegrationResponseIdpCertificate.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SamlIntegrationResponseIdpCertificate + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SamlIntegrationResponseIdpCertificate { + public static final String SERIALIZED_NAME_CERTIFICATE = "Certificate"; + @SerializedName(SERIALIZED_NAME_CERTIFICATE) + @javax.annotation.Nullable + private String certificate; + + public static final String SERIALIZED_NAME_KEY = "Key"; + @SerializedName(SERIALIZED_NAME_KEY) + @javax.annotation.Nullable + private String key; + + public SamlIntegrationResponseIdpCertificate() { + } + + public SamlIntegrationResponseIdpCertificate certificate(@javax.annotation.Nullable String certificate) { + this.certificate = certificate; + return this; + } + + /** + * Get certificate + * @return certificate + */ + @javax.annotation.Nullable + public String getCertificate() { + return certificate; + } + + public void setCertificate(@javax.annotation.Nullable String certificate) { + this.certificate = certificate; + } + + + public SamlIntegrationResponseIdpCertificate key(@javax.annotation.Nullable String key) { + this.key = key; + return this; + } + + /** + * Get key + * @return key + */ + @javax.annotation.Nullable + public String getKey() { + return key; + } + + public void setKey(@javax.annotation.Nullable String key) { + this.key = key; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SamlIntegrationResponseIdpCertificate instance itself + */ + public SamlIntegrationResponseIdpCertificate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SamlIntegrationResponseIdpCertificate samlIntegrationResponseIdpCertificate = (SamlIntegrationResponseIdpCertificate) o; + return Objects.equals(this.certificate, samlIntegrationResponseIdpCertificate.certificate) && + Objects.equals(this.key, samlIntegrationResponseIdpCertificate.key)&& + Objects.equals(this.additionalProperties, samlIntegrationResponseIdpCertificate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(certificate, key, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SamlIntegrationResponseIdpCertificate {\n"); + sb.append(" certificate: ").append(toIndentedString(certificate)).append("\n"); + sb.append(" key: ").append(toIndentedString(key)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Certificate"); + openapiFields.add("Key"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SamlIntegrationResponseIdpCertificate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SamlIntegrationResponseIdpCertificate.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SamlIntegrationResponseIdpCertificate is not found in the empty JSON string", SamlIntegrationResponseIdpCertificate.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Certificate") != null && !jsonObj.get("Certificate").isJsonNull()) && !jsonObj.get("Certificate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Certificate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Certificate").toString())); + } + if ((jsonObj.get("Key") != null && !jsonObj.get("Key").isJsonNull()) && !jsonObj.get("Key").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Key` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Key").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SamlIntegrationResponseIdpCertificate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SamlIntegrationResponseIdpCertificate' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SamlIntegrationResponseIdpCertificate> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SamlIntegrationResponseIdpCertificate.class)); + + return (TypeAdapter<T>) new TypeAdapter<SamlIntegrationResponseIdpCertificate>() { + @Override + public void write(JsonWriter out, SamlIntegrationResponseIdpCertificate value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SamlIntegrationResponseIdpCertificate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SamlIntegrationResponseIdpCertificate instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SamlIntegrationResponseIdpCertificate given an JSON string + * + * @param jsonString JSON string + * @return An instance of SamlIntegrationResponseIdpCertificate + * @throws IOException if the JSON string is invalid with respect to SamlIntegrationResponseIdpCertificate + */ + public static SamlIntegrationResponseIdpCertificate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SamlIntegrationResponseIdpCertificate.class); + } + + /** + * Convert an instance of SamlIntegrationResponseIdpCertificate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIntegrationResponseIntegrationConfigs.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIntegrationResponseIntegrationConfigs.java new file mode 100644 index 0000000..9827e02 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIntegrationResponseIntegrationConfigs.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SamlIntegrationResponseIntegrationConfigs + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SamlIntegrationResponseIntegrationConfigs { + public static final String SERIALIZED_NAME_IDP_S_H_A1_FINGERPRINT = "IdpSHA1Fingerprint"; + @SerializedName(SERIALIZED_NAME_IDP_S_H_A1_FINGERPRINT) + @javax.annotation.Nullable + private String idpSHA1Fingerprint; + + public static final String SERIALIZED_NAME_ACCOUNT_NAME = "AccountName"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NAME) + @javax.annotation.Nullable + private String accountName; + + public SamlIntegrationResponseIntegrationConfigs() { + } + + public SamlIntegrationResponseIntegrationConfigs idpSHA1Fingerprint(@javax.annotation.Nullable String idpSHA1Fingerprint) { + this.idpSHA1Fingerprint = idpSHA1Fingerprint; + return this; + } + + /** + * Get idpSHA1Fingerprint + * @return idpSHA1Fingerprint + */ + @javax.annotation.Nullable + public String getIdpSHA1Fingerprint() { + return idpSHA1Fingerprint; + } + + public void setIdpSHA1Fingerprint(@javax.annotation.Nullable String idpSHA1Fingerprint) { + this.idpSHA1Fingerprint = idpSHA1Fingerprint; + } + + + public SamlIntegrationResponseIntegrationConfigs accountName(@javax.annotation.Nullable String accountName) { + this.accountName = accountName; + return this; + } + + /** + * Get accountName + * @return accountName + */ + @javax.annotation.Nullable + public String getAccountName() { + return accountName; + } + + public void setAccountName(@javax.annotation.Nullable String accountName) { + this.accountName = accountName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SamlIntegrationResponseIntegrationConfigs instance itself + */ + public SamlIntegrationResponseIntegrationConfigs putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SamlIntegrationResponseIntegrationConfigs samlIntegrationResponseIntegrationConfigs = (SamlIntegrationResponseIntegrationConfigs) o; + return Objects.equals(this.idpSHA1Fingerprint, samlIntegrationResponseIntegrationConfigs.idpSHA1Fingerprint) && + Objects.equals(this.accountName, samlIntegrationResponseIntegrationConfigs.accountName)&& + Objects.equals(this.additionalProperties, samlIntegrationResponseIntegrationConfigs.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(idpSHA1Fingerprint, accountName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SamlIntegrationResponseIntegrationConfigs {\n"); + sb.append(" idpSHA1Fingerprint: ").append(toIndentedString(idpSHA1Fingerprint)).append("\n"); + sb.append(" accountName: ").append(toIndentedString(accountName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IdpSHA1Fingerprint"); + openapiFields.add("AccountName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SamlIntegrationResponseIntegrationConfigs + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SamlIntegrationResponseIntegrationConfigs.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SamlIntegrationResponseIntegrationConfigs is not found in the empty JSON string", SamlIntegrationResponseIntegrationConfigs.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("IdpSHA1Fingerprint") != null && !jsonObj.get("IdpSHA1Fingerprint").isJsonNull()) && !jsonObj.get("IdpSHA1Fingerprint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IdpSHA1Fingerprint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IdpSHA1Fingerprint").toString())); + } + if ((jsonObj.get("AccountName") != null && !jsonObj.get("AccountName").isJsonNull()) && !jsonObj.get("AccountName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccountName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccountName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SamlIntegrationResponseIntegrationConfigs.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SamlIntegrationResponseIntegrationConfigs' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SamlIntegrationResponseIntegrationConfigs> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SamlIntegrationResponseIntegrationConfigs.class)); + + return (TypeAdapter<T>) new TypeAdapter<SamlIntegrationResponseIntegrationConfigs>() { + @Override + public void write(JsonWriter out, SamlIntegrationResponseIntegrationConfigs value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SamlIntegrationResponseIntegrationConfigs read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SamlIntegrationResponseIntegrationConfigs instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SamlIntegrationResponseIntegrationConfigs given an JSON string + * + * @param jsonString JSON string + * @return An instance of SamlIntegrationResponseIntegrationConfigs + * @throws IOException if the JSON string is invalid with respect to SamlIntegrationResponseIntegrationConfigs + */ + public static SamlIntegrationResponseIntegrationConfigs fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SamlIntegrationResponseIntegrationConfigs.class); + } + + /** + * Convert an instance of SamlIntegrationResponseIntegrationConfigs to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIntegrationResponseSpCertificate.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIntegrationResponseSpCertificate.java new file mode 100644 index 0000000..70470f9 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlIntegrationResponseSpCertificate.java @@ -0,0 +1,287 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SamlIntegrationResponseSpCertificate + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SamlIntegrationResponseSpCertificate { + public static final String SERIALIZED_NAME_CERTIFICATE = "Certificate"; + @SerializedName(SERIALIZED_NAME_CERTIFICATE) + @javax.annotation.Nullable + private String certificate; + + public SamlIntegrationResponseSpCertificate() { + } + + public SamlIntegrationResponseSpCertificate certificate(@javax.annotation.Nullable String certificate) { + this.certificate = certificate; + return this; + } + + /** + * Get certificate + * @return certificate + */ + @javax.annotation.Nullable + public String getCertificate() { + return certificate; + } + + public void setCertificate(@javax.annotation.Nullable String certificate) { + this.certificate = certificate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SamlIntegrationResponseSpCertificate instance itself + */ + public SamlIntegrationResponseSpCertificate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SamlIntegrationResponseSpCertificate samlIntegrationResponseSpCertificate = (SamlIntegrationResponseSpCertificate) o; + return Objects.equals(this.certificate, samlIntegrationResponseSpCertificate.certificate)&& + Objects.equals(this.additionalProperties, samlIntegrationResponseSpCertificate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(certificate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SamlIntegrationResponseSpCertificate {\n"); + sb.append(" certificate: ").append(toIndentedString(certificate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Certificate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SamlIntegrationResponseSpCertificate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SamlIntegrationResponseSpCertificate.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SamlIntegrationResponseSpCertificate is not found in the empty JSON string", SamlIntegrationResponseSpCertificate.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Certificate") != null && !jsonObj.get("Certificate").isJsonNull()) && !jsonObj.get("Certificate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Certificate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Certificate").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SamlIntegrationResponseSpCertificate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SamlIntegrationResponseSpCertificate' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SamlIntegrationResponseSpCertificate> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SamlIntegrationResponseSpCertificate.class)); + + return (TypeAdapter<T>) new TypeAdapter<SamlIntegrationResponseSpCertificate>() { + @Override + public void write(JsonWriter out, SamlIntegrationResponseSpCertificate value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SamlIntegrationResponseSpCertificate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SamlIntegrationResponseSpCertificate instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SamlIntegrationResponseSpCertificate given an JSON string + * + * @param jsonString JSON string + * @return An instance of SamlIntegrationResponseSpCertificate + * @throws IOException if the JSON string is invalid with respect to SamlIntegrationResponseSpCertificate + */ + public static SamlIntegrationResponseSpCertificate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SamlIntegrationResponseSpCertificate.class); + } + + /** + * Convert an instance of SamlIntegrationResponseSpCertificate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlSpConfig.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlSpConfig.java new file mode 100644 index 0000000..5860efe --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlSpConfig.java @@ -0,0 +1,889 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.CertificateWithoutKey; +import com.loginradius.sdk.internal.openapi.model.Certificates; +import com.loginradius.sdk.internal.openapi.model.IdentityProvider; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SamlSpConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SamlSpConfig { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_IS_ACTIVE = "IsActive"; + @SerializedName(SERIALIZED_NAME_IS_ACTIVE) + @javax.annotation.Nullable + private Boolean isActive; + + public static final String SERIALIZED_NAME_IS_DELETED = "IsDeleted"; + @SerializedName(SERIALIZED_NAME_IS_DELETED) + @javax.annotation.Nullable + private Boolean isDeleted; + + public static final String SERIALIZED_NAME_IS_IDP_INITIATED = "IsIdpInitiated"; + @SerializedName(SERIALIZED_NAME_IS_IDP_INITIATED) + @javax.annotation.Nullable + private Boolean isIdpInitiated; + + public static final String SERIALIZED_NAME_DATA_MAP = "DataMap"; + @SerializedName(SERIALIZED_NAME_DATA_MAP) + @javax.annotation.Nullable + private Map<String, String> dataMap = new HashMap<>(); + + public static final String SERIALIZED_NAME_APP_ID = "AppId"; + @SerializedName(SERIALIZED_NAME_APP_ID) + @javax.annotation.Nullable + private String appId; + + public static final String SERIALIZED_NAME_APP_I_D = "AppID"; + @SerializedName(SERIALIZED_NAME_APP_I_D) + @javax.annotation.Nullable + private Integer appID; + + public static final String SERIALIZED_NAME_RELAY_STATE_PARAMETER = "RelayStateParameter"; + @SerializedName(SERIALIZED_NAME_RELAY_STATE_PARAMETER) + @javax.annotation.Nullable + private String relayStateParameter; + + public static final String SERIALIZED_NAME_PROVIDER = "Provider"; + @SerializedName(SERIALIZED_NAME_PROVIDER) + @javax.annotation.Nullable + private String provider; + + public static final String SERIALIZED_NAME_FRIENDLY_PROVIDER_NAME = "FriendlyProviderName"; + @SerializedName(SERIALIZED_NAME_FRIENDLY_PROVIDER_NAME) + @javax.annotation.Nullable + private String friendlyProviderName; + + public static final String SERIALIZED_NAME_DEFAULT_LOGOUT_URL = "DefaultLogoutUrl"; + @SerializedName(SERIALIZED_NAME_DEFAULT_LOGOUT_URL) + @javax.annotation.Nullable + private String defaultLogoutUrl; + + public static final String SERIALIZED_NAME_SERVICE_PROVIDER_A_C_S_URL = "ServiceProviderACSUrl"; + @SerializedName(SERIALIZED_NAME_SERVICE_PROVIDER_A_C_S_URL) + @javax.annotation.Nullable + private String serviceProviderACSUrl; + + public static final String SERIALIZED_NAME_SAML_SERVICE_PROVIDER = "SamlServiceProvider"; + @SerializedName(SERIALIZED_NAME_SAML_SERVICE_PROVIDER) + @javax.annotation.Nullable + private String samlServiceProvider; + + public static final String SERIALIZED_NAME_IDP_CERTIFICATE = "IdpCertificate"; + @SerializedName(SERIALIZED_NAME_IDP_CERTIFICATE) + @javax.annotation.Nullable + private Certificates idpCertificate; + + public static final String SERIALIZED_NAME_SP_CERTIFICATE = "SpCertificate"; + @SerializedName(SERIALIZED_NAME_SP_CERTIFICATE) + @javax.annotation.Nullable + private CertificateWithoutKey spCertificate; + + public static final String SERIALIZED_NAME_IDENTITY_PROVIDER = "IdentityProvider"; + @SerializedName(SERIALIZED_NAME_IDENTITY_PROVIDER) + @javax.annotation.Nullable + private IdentityProvider identityProvider; + + public static final String SERIALIZED_NAME_ENABLE_AUTO_LOOK_UP = "EnableAutoLookUp"; + @SerializedName(SERIALIZED_NAME_ENABLE_AUTO_LOOK_UP) + @javax.annotation.Nullable + private Boolean enableAutoLookUp; + + public static final String SERIALIZED_NAME_DOMAIN = "Domain"; + @SerializedName(SERIALIZED_NAME_DOMAIN) + @javax.annotation.Nullable + private String domain; + + public static final String SERIALIZED_NAME_LIST_IN_INTERFACE = "ListInInterface"; + @SerializedName(SERIALIZED_NAME_LIST_IN_INTERFACE) + @javax.annotation.Nullable + private Boolean listInInterface; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public static final String SERIALIZED_NAME_LAST_MODIFIED_DATE = "LastModifiedDate"; + @SerializedName(SERIALIZED_NAME_LAST_MODIFIED_DATE) + @javax.annotation.Nullable + private OffsetDateTime lastModifiedDate; + + public SamlSpConfig() { + } + + public SamlSpConfig id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public SamlSpConfig isActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Get isActive + * @return isActive + */ + @javax.annotation.Nullable + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + } + + + public SamlSpConfig isDeleted(@javax.annotation.Nullable Boolean isDeleted) { + this.isDeleted = isDeleted; + return this; + } + + /** + * Get isDeleted + * @return isDeleted + */ + @javax.annotation.Nullable + public Boolean getIsDeleted() { + return isDeleted; + } + + public void setIsDeleted(@javax.annotation.Nullable Boolean isDeleted) { + this.isDeleted = isDeleted; + } + + + public SamlSpConfig isIdpInitiated(@javax.annotation.Nullable Boolean isIdpInitiated) { + this.isIdpInitiated = isIdpInitiated; + return this; + } + + /** + * Get isIdpInitiated + * @return isIdpInitiated + */ + @javax.annotation.Nullable + public Boolean getIsIdpInitiated() { + return isIdpInitiated; + } + + public void setIsIdpInitiated(@javax.annotation.Nullable Boolean isIdpInitiated) { + this.isIdpInitiated = isIdpInitiated; + } + + + public SamlSpConfig dataMap(@javax.annotation.Nullable Map<String, String> dataMap) { + this.dataMap = dataMap; + return this; + } + + public SamlSpConfig putDataMapItem(String key, String dataMapItem) { + if (this.dataMap == null) { + this.dataMap = new HashMap<>(); + } + this.dataMap.put(key, dataMapItem); + return this; + } + + /** + * Get dataMap + * @return dataMap + */ + @javax.annotation.Nullable + public Map<String, String> getDataMap() { + return dataMap; + } + + public void setDataMap(@javax.annotation.Nullable Map<String, String> dataMap) { + this.dataMap = dataMap; + } + + + public SamlSpConfig appId(@javax.annotation.Nullable String appId) { + this.appId = appId; + return this; + } + + /** + * Get appId + * @return appId + */ + @javax.annotation.Nullable + public String getAppId() { + return appId; + } + + public void setAppId(@javax.annotation.Nullable String appId) { + this.appId = appId; + } + + + public SamlSpConfig appID(@javax.annotation.Nullable Integer appID) { + this.appID = appID; + return this; + } + + /** + * Get appID + * @return appID + */ + @javax.annotation.Nullable + public Integer getAppID() { + return appID; + } + + public void setAppID(@javax.annotation.Nullable Integer appID) { + this.appID = appID; + } + + + public SamlSpConfig relayStateParameter(@javax.annotation.Nullable String relayStateParameter) { + this.relayStateParameter = relayStateParameter; + return this; + } + + /** + * Get relayStateParameter + * @return relayStateParameter + */ + @javax.annotation.Nullable + public String getRelayStateParameter() { + return relayStateParameter; + } + + public void setRelayStateParameter(@javax.annotation.Nullable String relayStateParameter) { + this.relayStateParameter = relayStateParameter; + } + + + public SamlSpConfig provider(@javax.annotation.Nullable String provider) { + this.provider = provider; + return this; + } + + /** + * Get provider + * @return provider + */ + @javax.annotation.Nullable + public String getProvider() { + return provider; + } + + public void setProvider(@javax.annotation.Nullable String provider) { + this.provider = provider; + } + + + public SamlSpConfig friendlyProviderName(@javax.annotation.Nullable String friendlyProviderName) { + this.friendlyProviderName = friendlyProviderName; + return this; + } + + /** + * Get friendlyProviderName + * @return friendlyProviderName + */ + @javax.annotation.Nullable + public String getFriendlyProviderName() { + return friendlyProviderName; + } + + public void setFriendlyProviderName(@javax.annotation.Nullable String friendlyProviderName) { + this.friendlyProviderName = friendlyProviderName; + } + + + public SamlSpConfig defaultLogoutUrl(@javax.annotation.Nullable String defaultLogoutUrl) { + this.defaultLogoutUrl = defaultLogoutUrl; + return this; + } + + /** + * Get defaultLogoutUrl + * @return defaultLogoutUrl + */ + @javax.annotation.Nullable + public String getDefaultLogoutUrl() { + return defaultLogoutUrl; + } + + public void setDefaultLogoutUrl(@javax.annotation.Nullable String defaultLogoutUrl) { + this.defaultLogoutUrl = defaultLogoutUrl; + } + + + public SamlSpConfig serviceProviderACSUrl(@javax.annotation.Nullable String serviceProviderACSUrl) { + this.serviceProviderACSUrl = serviceProviderACSUrl; + return this; + } + + /** + * Get serviceProviderACSUrl + * @return serviceProviderACSUrl + */ + @javax.annotation.Nullable + public String getServiceProviderACSUrl() { + return serviceProviderACSUrl; + } + + public void setServiceProviderACSUrl(@javax.annotation.Nullable String serviceProviderACSUrl) { + this.serviceProviderACSUrl = serviceProviderACSUrl; + } + + + public SamlSpConfig samlServiceProvider(@javax.annotation.Nullable String samlServiceProvider) { + this.samlServiceProvider = samlServiceProvider; + return this; + } + + /** + * Get samlServiceProvider + * @return samlServiceProvider + */ + @javax.annotation.Nullable + public String getSamlServiceProvider() { + return samlServiceProvider; + } + + public void setSamlServiceProvider(@javax.annotation.Nullable String samlServiceProvider) { + this.samlServiceProvider = samlServiceProvider; + } + + + public SamlSpConfig idpCertificate(@javax.annotation.Nullable Certificates idpCertificate) { + this.idpCertificate = idpCertificate; + return this; + } + + /** + * Get idpCertificate + * @return idpCertificate + */ + @javax.annotation.Nullable + public Certificates getIdpCertificate() { + return idpCertificate; + } + + public void setIdpCertificate(@javax.annotation.Nullable Certificates idpCertificate) { + this.idpCertificate = idpCertificate; + } + + + public SamlSpConfig spCertificate(@javax.annotation.Nullable CertificateWithoutKey spCertificate) { + this.spCertificate = spCertificate; + return this; + } + + /** + * Get spCertificate + * @return spCertificate + */ + @javax.annotation.Nullable + public CertificateWithoutKey getSpCertificate() { + return spCertificate; + } + + public void setSpCertificate(@javax.annotation.Nullable CertificateWithoutKey spCertificate) { + this.spCertificate = spCertificate; + } + + + public SamlSpConfig identityProvider(@javax.annotation.Nullable IdentityProvider identityProvider) { + this.identityProvider = identityProvider; + return this; + } + + /** + * Get identityProvider + * @return identityProvider + */ + @javax.annotation.Nullable + public IdentityProvider getIdentityProvider() { + return identityProvider; + } + + public void setIdentityProvider(@javax.annotation.Nullable IdentityProvider identityProvider) { + this.identityProvider = identityProvider; + } + + + public SamlSpConfig enableAutoLookUp(@javax.annotation.Nullable Boolean enableAutoLookUp) { + this.enableAutoLookUp = enableAutoLookUp; + return this; + } + + /** + * Get enableAutoLookUp + * @return enableAutoLookUp + */ + @javax.annotation.Nullable + public Boolean getEnableAutoLookUp() { + return enableAutoLookUp; + } + + public void setEnableAutoLookUp(@javax.annotation.Nullable Boolean enableAutoLookUp) { + this.enableAutoLookUp = enableAutoLookUp; + } + + + public SamlSpConfig domain(@javax.annotation.Nullable String domain) { + this.domain = domain; + return this; + } + + /** + * Get domain + * @return domain + */ + @javax.annotation.Nullable + public String getDomain() { + return domain; + } + + public void setDomain(@javax.annotation.Nullable String domain) { + this.domain = domain; + } + + + public SamlSpConfig listInInterface(@javax.annotation.Nullable Boolean listInInterface) { + this.listInInterface = listInInterface; + return this; + } + + /** + * Get listInInterface + * @return listInInterface + */ + @javax.annotation.Nullable + public Boolean getListInInterface() { + return listInInterface; + } + + public void setListInInterface(@javax.annotation.Nullable Boolean listInInterface) { + this.listInInterface = listInInterface; + } + + + public SamlSpConfig createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get createdDate + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + + public SamlSpConfig lastModifiedDate(@javax.annotation.Nullable OffsetDateTime lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + return this; + } + + /** + * Get lastModifiedDate + * @return lastModifiedDate + */ + @javax.annotation.Nullable + public OffsetDateTime getLastModifiedDate() { + return lastModifiedDate; + } + + public void setLastModifiedDate(@javax.annotation.Nullable OffsetDateTime lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SamlSpConfig instance itself + */ + public SamlSpConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SamlSpConfig samlSpConfig = (SamlSpConfig) o; + return Objects.equals(this.id, samlSpConfig.id) && + Objects.equals(this.isActive, samlSpConfig.isActive) && + Objects.equals(this.isDeleted, samlSpConfig.isDeleted) && + Objects.equals(this.isIdpInitiated, samlSpConfig.isIdpInitiated) && + Objects.equals(this.dataMap, samlSpConfig.dataMap) && + Objects.equals(this.appId, samlSpConfig.appId) && + Objects.equals(this.appID, samlSpConfig.appID) && + Objects.equals(this.relayStateParameter, samlSpConfig.relayStateParameter) && + Objects.equals(this.provider, samlSpConfig.provider) && + Objects.equals(this.friendlyProviderName, samlSpConfig.friendlyProviderName) && + Objects.equals(this.defaultLogoutUrl, samlSpConfig.defaultLogoutUrl) && + Objects.equals(this.serviceProviderACSUrl, samlSpConfig.serviceProviderACSUrl) && + Objects.equals(this.samlServiceProvider, samlSpConfig.samlServiceProvider) && + Objects.equals(this.idpCertificate, samlSpConfig.idpCertificate) && + Objects.equals(this.spCertificate, samlSpConfig.spCertificate) && + Objects.equals(this.identityProvider, samlSpConfig.identityProvider) && + Objects.equals(this.enableAutoLookUp, samlSpConfig.enableAutoLookUp) && + Objects.equals(this.domain, samlSpConfig.domain) && + Objects.equals(this.listInInterface, samlSpConfig.listInInterface) && + Objects.equals(this.createdDate, samlSpConfig.createdDate) && + Objects.equals(this.lastModifiedDate, samlSpConfig.lastModifiedDate)&& + Objects.equals(this.additionalProperties, samlSpConfig.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(id, isActive, isDeleted, isIdpInitiated, dataMap, appId, appID, relayStateParameter, provider, friendlyProviderName, defaultLogoutUrl, serviceProviderACSUrl, samlServiceProvider, idpCertificate, spCertificate, identityProvider, enableAutoLookUp, domain, listInInterface, createdDate, lastModifiedDate, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SamlSpConfig {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" isDeleted: ").append(toIndentedString(isDeleted)).append("\n"); + sb.append(" isIdpInitiated: ").append(toIndentedString(isIdpInitiated)).append("\n"); + sb.append(" dataMap: ").append(toIndentedString(dataMap)).append("\n"); + sb.append(" appId: ").append(toIndentedString(appId)).append("\n"); + sb.append(" appID: ").append(toIndentedString(appID)).append("\n"); + sb.append(" relayStateParameter: ").append(toIndentedString(relayStateParameter)).append("\n"); + sb.append(" provider: ").append(toIndentedString(provider)).append("\n"); + sb.append(" friendlyProviderName: ").append(toIndentedString(friendlyProviderName)).append("\n"); + sb.append(" defaultLogoutUrl: ").append(toIndentedString(defaultLogoutUrl)).append("\n"); + sb.append(" serviceProviderACSUrl: ").append(toIndentedString(serviceProviderACSUrl)).append("\n"); + sb.append(" samlServiceProvider: ").append(toIndentedString(samlServiceProvider)).append("\n"); + sb.append(" idpCertificate: ").append(toIndentedString(idpCertificate)).append("\n"); + sb.append(" spCertificate: ").append(toIndentedString(spCertificate)).append("\n"); + sb.append(" identityProvider: ").append(toIndentedString(identityProvider)).append("\n"); + sb.append(" enableAutoLookUp: ").append(toIndentedString(enableAutoLookUp)).append("\n"); + sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); + sb.append(" listInInterface: ").append(toIndentedString(listInInterface)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" lastModifiedDate: ").append(toIndentedString(lastModifiedDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("IsActive"); + openapiFields.add("IsDeleted"); + openapiFields.add("IsIdpInitiated"); + openapiFields.add("DataMap"); + openapiFields.add("AppId"); + openapiFields.add("AppID"); + openapiFields.add("RelayStateParameter"); + openapiFields.add("Provider"); + openapiFields.add("FriendlyProviderName"); + openapiFields.add("DefaultLogoutUrl"); + openapiFields.add("ServiceProviderACSUrl"); + openapiFields.add("SamlServiceProvider"); + openapiFields.add("IdpCertificate"); + openapiFields.add("SpCertificate"); + openapiFields.add("IdentityProvider"); + openapiFields.add("EnableAutoLookUp"); + openapiFields.add("Domain"); + openapiFields.add("ListInInterface"); + openapiFields.add("CreatedDate"); + openapiFields.add("LastModifiedDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SamlSpConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SamlSpConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SamlSpConfig is not found in the empty JSON string", SamlSpConfig.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("AppId") != null && !jsonObj.get("AppId").isJsonNull()) && !jsonObj.get("AppId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AppId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AppId").toString())); + } + if ((jsonObj.get("RelayStateParameter") != null && !jsonObj.get("RelayStateParameter").isJsonNull()) && !jsonObj.get("RelayStateParameter").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RelayStateParameter` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RelayStateParameter").toString())); + } + if ((jsonObj.get("Provider") != null && !jsonObj.get("Provider").isJsonNull()) && !jsonObj.get("Provider").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Provider` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Provider").toString())); + } + if ((jsonObj.get("FriendlyProviderName") != null && !jsonObj.get("FriendlyProviderName").isJsonNull()) && !jsonObj.get("FriendlyProviderName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FriendlyProviderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FriendlyProviderName").toString())); + } + if ((jsonObj.get("DefaultLogoutUrl") != null && !jsonObj.get("DefaultLogoutUrl").isJsonNull()) && !jsonObj.get("DefaultLogoutUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DefaultLogoutUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DefaultLogoutUrl").toString())); + } + if ((jsonObj.get("ServiceProviderACSUrl") != null && !jsonObj.get("ServiceProviderACSUrl").isJsonNull()) && !jsonObj.get("ServiceProviderACSUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ServiceProviderACSUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ServiceProviderACSUrl").toString())); + } + if ((jsonObj.get("SamlServiceProvider") != null && !jsonObj.get("SamlServiceProvider").isJsonNull()) && !jsonObj.get("SamlServiceProvider").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SamlServiceProvider` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SamlServiceProvider").toString())); + } + // validate the optional field `IdpCertificate` + if (jsonObj.get("IdpCertificate") != null && !jsonObj.get("IdpCertificate").isJsonNull()) { + Certificates.validateJsonElement(jsonObj.get("IdpCertificate")); + } + // validate the optional field `SpCertificate` + if (jsonObj.get("SpCertificate") != null && !jsonObj.get("SpCertificate").isJsonNull()) { + CertificateWithoutKey.validateJsonElement(jsonObj.get("SpCertificate")); + } + // validate the optional field `IdentityProvider` + if (jsonObj.get("IdentityProvider") != null && !jsonObj.get("IdentityProvider").isJsonNull()) { + IdentityProvider.validateJsonElement(jsonObj.get("IdentityProvider")); + } + if ((jsonObj.get("Domain") != null && !jsonObj.get("Domain").isJsonNull()) && !jsonObj.get("Domain").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Domain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Domain").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SamlSpConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SamlSpConfig' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SamlSpConfig> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SamlSpConfig.class)); + + return (TypeAdapter<T>) new TypeAdapter<SamlSpConfig>() { + @Override + public void write(JsonWriter out, SamlSpConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SamlSpConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SamlSpConfig instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SamlSpConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of SamlSpConfig + * @throws IOException if the JSON string is invalid with respect to SamlSpConfig + */ + public static SamlSpConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SamlSpConfig.class); + } + + /** + * Convert an instance of SamlSpConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlSpConfigModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlSpConfigModel.java new file mode 100644 index 0000000..96bc9c0 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SamlSpConfigModel.java @@ -0,0 +1,610 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.Certificates; +import com.loginradius.sdk.internal.openapi.model.IdentityProvider; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SamlSpConfigModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SamlSpConfigModel { + public static final String SERIALIZED_NAME_PROVIDER = "Provider"; + @SerializedName(SERIALIZED_NAME_PROVIDER) + @javax.annotation.Nonnull + private String provider; + + public static final String SERIALIZED_NAME_IS_IDP_INITIATED = "IsIdpInitiated"; + @SerializedName(SERIALIZED_NAME_IS_IDP_INITIATED) + @javax.annotation.Nullable + private Boolean isIdpInitiated; + + public static final String SERIALIZED_NAME_DATA_MAP = "DataMap"; + @SerializedName(SERIALIZED_NAME_DATA_MAP) + @javax.annotation.Nonnull + private Map<String, String> dataMap = new HashMap<>(); + + public static final String SERIALIZED_NAME_RELAY_STATE_PARAMETER = "RelayStateParameter"; + @SerializedName(SERIALIZED_NAME_RELAY_STATE_PARAMETER) + @javax.annotation.Nullable + private String relayStateParameter; + + public static final String SERIALIZED_NAME_FRIENDLY_PROVIDER_NAME = "FriendlyProviderName"; + @SerializedName(SERIALIZED_NAME_FRIENDLY_PROVIDER_NAME) + @javax.annotation.Nullable + private String friendlyProviderName; + + public static final String SERIALIZED_NAME_IDP_CERTIFICATE = "IdpCertificate"; + @SerializedName(SERIALIZED_NAME_IDP_CERTIFICATE) + @javax.annotation.Nullable + private Certificates idpCertificate; + + public static final String SERIALIZED_NAME_IDENTITY_PROVIDER = "IdentityProvider"; + @SerializedName(SERIALIZED_NAME_IDENTITY_PROVIDER) + @javax.annotation.Nullable + private IdentityProvider identityProvider; + + public static final String SERIALIZED_NAME_ENABLE_AUTO_LOOK_UP = "EnableAutoLookUp"; + @SerializedName(SERIALIZED_NAME_ENABLE_AUTO_LOOK_UP) + @javax.annotation.Nullable + private Boolean enableAutoLookUp; + + public static final String SERIALIZED_NAME_DOMAIN = "Domain"; + @SerializedName(SERIALIZED_NAME_DOMAIN) + @javax.annotation.Nullable + private String domain; + + public static final String SERIALIZED_NAME_LIST_IN_INTERFACE = "ListInInterface"; + @SerializedName(SERIALIZED_NAME_LIST_IN_INTERFACE) + @javax.annotation.Nullable + private Boolean listInInterface; + + public static final String SERIALIZED_NAME_SAML_SERVICE_PROVIDER = "SamlServiceProvider"; + @SerializedName(SERIALIZED_NAME_SAML_SERVICE_PROVIDER) + @javax.annotation.Nullable + private String samlServiceProvider; + + public SamlSpConfigModel() { + } + + public SamlSpConfigModel provider(@javax.annotation.Nonnull String provider) { + this.provider = provider; + return this; + } + + /** + * Get provider + * @return provider + */ + @javax.annotation.Nonnull + public String getProvider() { + return provider; + } + + public void setProvider(@javax.annotation.Nonnull String provider) { + this.provider = provider; + } + + + public SamlSpConfigModel isIdpInitiated(@javax.annotation.Nullable Boolean isIdpInitiated) { + this.isIdpInitiated = isIdpInitiated; + return this; + } + + /** + * Get isIdpInitiated + * @return isIdpInitiated + */ + @javax.annotation.Nullable + public Boolean getIsIdpInitiated() { + return isIdpInitiated; + } + + public void setIsIdpInitiated(@javax.annotation.Nullable Boolean isIdpInitiated) { + this.isIdpInitiated = isIdpInitiated; + } + + + public SamlSpConfigModel dataMap(@javax.annotation.Nonnull Map<String, String> dataMap) { + this.dataMap = dataMap; + return this; + } + + public SamlSpConfigModel putDataMapItem(String key, String dataMapItem) { + if (this.dataMap == null) { + this.dataMap = new HashMap<>(); + } + this.dataMap.put(key, dataMapItem); + return this; + } + + /** + * Get dataMap + * @return dataMap + */ + @javax.annotation.Nonnull + public Map<String, String> getDataMap() { + return dataMap; + } + + public void setDataMap(@javax.annotation.Nonnull Map<String, String> dataMap) { + this.dataMap = dataMap; + } + + + public SamlSpConfigModel relayStateParameter(@javax.annotation.Nullable String relayStateParameter) { + this.relayStateParameter = relayStateParameter; + return this; + } + + /** + * Get relayStateParameter + * @return relayStateParameter + */ + @javax.annotation.Nullable + public String getRelayStateParameter() { + return relayStateParameter; + } + + public void setRelayStateParameter(@javax.annotation.Nullable String relayStateParameter) { + this.relayStateParameter = relayStateParameter; + } + + + public SamlSpConfigModel friendlyProviderName(@javax.annotation.Nullable String friendlyProviderName) { + this.friendlyProviderName = friendlyProviderName; + return this; + } + + /** + * Get friendlyProviderName + * @return friendlyProviderName + */ + @javax.annotation.Nullable + public String getFriendlyProviderName() { + return friendlyProviderName; + } + + public void setFriendlyProviderName(@javax.annotation.Nullable String friendlyProviderName) { + this.friendlyProviderName = friendlyProviderName; + } + + + public SamlSpConfigModel idpCertificate(@javax.annotation.Nullable Certificates idpCertificate) { + this.idpCertificate = idpCertificate; + return this; + } + + /** + * Get idpCertificate + * @return idpCertificate + */ + @javax.annotation.Nullable + public Certificates getIdpCertificate() { + return idpCertificate; + } + + public void setIdpCertificate(@javax.annotation.Nullable Certificates idpCertificate) { + this.idpCertificate = idpCertificate; + } + + + public SamlSpConfigModel identityProvider(@javax.annotation.Nullable IdentityProvider identityProvider) { + this.identityProvider = identityProvider; + return this; + } + + /** + * Get identityProvider + * @return identityProvider + */ + @javax.annotation.Nullable + public IdentityProvider getIdentityProvider() { + return identityProvider; + } + + public void setIdentityProvider(@javax.annotation.Nullable IdentityProvider identityProvider) { + this.identityProvider = identityProvider; + } + + + public SamlSpConfigModel enableAutoLookUp(@javax.annotation.Nullable Boolean enableAutoLookUp) { + this.enableAutoLookUp = enableAutoLookUp; + return this; + } + + /** + * Get enableAutoLookUp + * @return enableAutoLookUp + */ + @javax.annotation.Nullable + public Boolean getEnableAutoLookUp() { + return enableAutoLookUp; + } + + public void setEnableAutoLookUp(@javax.annotation.Nullable Boolean enableAutoLookUp) { + this.enableAutoLookUp = enableAutoLookUp; + } + + + public SamlSpConfigModel domain(@javax.annotation.Nullable String domain) { + this.domain = domain; + return this; + } + + /** + * Get domain + * @return domain + */ + @javax.annotation.Nullable + public String getDomain() { + return domain; + } + + public void setDomain(@javax.annotation.Nullable String domain) { + this.domain = domain; + } + + + public SamlSpConfigModel listInInterface(@javax.annotation.Nullable Boolean listInInterface) { + this.listInInterface = listInInterface; + return this; + } + + /** + * Get listInInterface + * @return listInInterface + */ + @javax.annotation.Nullable + public Boolean getListInInterface() { + return listInInterface; + } + + public void setListInInterface(@javax.annotation.Nullable Boolean listInInterface) { + this.listInInterface = listInInterface; + } + + + public SamlSpConfigModel samlServiceProvider(@javax.annotation.Nullable String samlServiceProvider) { + this.samlServiceProvider = samlServiceProvider; + return this; + } + + /** + * Get samlServiceProvider + * @return samlServiceProvider + */ + @javax.annotation.Nullable + public String getSamlServiceProvider() { + return samlServiceProvider; + } + + public void setSamlServiceProvider(@javax.annotation.Nullable String samlServiceProvider) { + this.samlServiceProvider = samlServiceProvider; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SamlSpConfigModel instance itself + */ + public SamlSpConfigModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SamlSpConfigModel samlSpConfigModel = (SamlSpConfigModel) o; + return Objects.equals(this.provider, samlSpConfigModel.provider) && + Objects.equals(this.isIdpInitiated, samlSpConfigModel.isIdpInitiated) && + Objects.equals(this.dataMap, samlSpConfigModel.dataMap) && + Objects.equals(this.relayStateParameter, samlSpConfigModel.relayStateParameter) && + Objects.equals(this.friendlyProviderName, samlSpConfigModel.friendlyProviderName) && + Objects.equals(this.idpCertificate, samlSpConfigModel.idpCertificate) && + Objects.equals(this.identityProvider, samlSpConfigModel.identityProvider) && + Objects.equals(this.enableAutoLookUp, samlSpConfigModel.enableAutoLookUp) && + Objects.equals(this.domain, samlSpConfigModel.domain) && + Objects.equals(this.listInInterface, samlSpConfigModel.listInInterface) && + Objects.equals(this.samlServiceProvider, samlSpConfigModel.samlServiceProvider)&& + Objects.equals(this.additionalProperties, samlSpConfigModel.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(provider, isIdpInitiated, dataMap, relayStateParameter, friendlyProviderName, idpCertificate, identityProvider, enableAutoLookUp, domain, listInInterface, samlServiceProvider, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SamlSpConfigModel {\n"); + sb.append(" provider: ").append(toIndentedString(provider)).append("\n"); + sb.append(" isIdpInitiated: ").append(toIndentedString(isIdpInitiated)).append("\n"); + sb.append(" dataMap: ").append(toIndentedString(dataMap)).append("\n"); + sb.append(" relayStateParameter: ").append(toIndentedString(relayStateParameter)).append("\n"); + sb.append(" friendlyProviderName: ").append(toIndentedString(friendlyProviderName)).append("\n"); + sb.append(" idpCertificate: ").append(toIndentedString(idpCertificate)).append("\n"); + sb.append(" identityProvider: ").append(toIndentedString(identityProvider)).append("\n"); + sb.append(" enableAutoLookUp: ").append(toIndentedString(enableAutoLookUp)).append("\n"); + sb.append(" domain: ").append(toIndentedString(domain)).append("\n"); + sb.append(" listInInterface: ").append(toIndentedString(listInInterface)).append("\n"); + sb.append(" samlServiceProvider: ").append(toIndentedString(samlServiceProvider)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Provider"); + openapiFields.add("IsIdpInitiated"); + openapiFields.add("DataMap"); + openapiFields.add("RelayStateParameter"); + openapiFields.add("FriendlyProviderName"); + openapiFields.add("IdpCertificate"); + openapiFields.add("IdentityProvider"); + openapiFields.add("EnableAutoLookUp"); + openapiFields.add("Domain"); + openapiFields.add("ListInInterface"); + openapiFields.add("SamlServiceProvider"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Provider"); + openapiRequiredFields.add("DataMap"); + } + + /** + * 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 SamlSpConfigModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SamlSpConfigModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SamlSpConfigModel is not found in the empty JSON string", SamlSpConfigModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SamlSpConfigModel.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("Provider").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Provider` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Provider").toString())); + } + if ((jsonObj.get("RelayStateParameter") != null && !jsonObj.get("RelayStateParameter").isJsonNull()) && !jsonObj.get("RelayStateParameter").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RelayStateParameter` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RelayStateParameter").toString())); + } + if ((jsonObj.get("FriendlyProviderName") != null && !jsonObj.get("FriendlyProviderName").isJsonNull()) && !jsonObj.get("FriendlyProviderName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FriendlyProviderName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FriendlyProviderName").toString())); + } + // validate the optional field `IdpCertificate` + if (jsonObj.get("IdpCertificate") != null && !jsonObj.get("IdpCertificate").isJsonNull()) { + Certificates.validateJsonElement(jsonObj.get("IdpCertificate")); + } + // validate the optional field `IdentityProvider` + if (jsonObj.get("IdentityProvider") != null && !jsonObj.get("IdentityProvider").isJsonNull()) { + IdentityProvider.validateJsonElement(jsonObj.get("IdentityProvider")); + } + if ((jsonObj.get("Domain") != null && !jsonObj.get("Domain").isJsonNull()) && !jsonObj.get("Domain").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Domain` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Domain").toString())); + } + if ((jsonObj.get("SamlServiceProvider") != null && !jsonObj.get("SamlServiceProvider").isJsonNull()) && !jsonObj.get("SamlServiceProvider").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SamlServiceProvider` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SamlServiceProvider").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SamlSpConfigModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SamlSpConfigModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SamlSpConfigModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SamlSpConfigModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<SamlSpConfigModel>() { + @Override + public void write(JsonWriter out, SamlSpConfigModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SamlSpConfigModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SamlSpConfigModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SamlSpConfigModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of SamlSpConfigModel + * @throws IOException if the JSON string is invalid with respect to SamlSpConfigModel + */ + public static SamlSpConfigModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SamlSpConfigModel.class); + } + + /** + * Convert an instance of SamlSpConfigModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SecondFactorAuthentication.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SecondFactorAuthentication.java new file mode 100644 index 0000000..c473cd5 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SecondFactorAuthentication.java @@ -0,0 +1,549 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.SecondFactorAuthenticationPasskeyCredential; +import com.loginradius.sdk.internal.openapi.model.SecondFactorAuthenticationPushDevice; +import com.loginradius.sdk.internal.openapi.model.SecondFactorAuthenticator; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SecondFactorAuthentication + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SecondFactorAuthentication { + public static final String SERIALIZED_NAME_GOOGLE_AUTHENTICATOR = "GoogleAuthenticator"; + @SerializedName(SERIALIZED_NAME_GOOGLE_AUTHENTICATOR) + @javax.annotation.Nullable + private SecondFactorAuthenticator googleAuthenticator; + + public static final String SERIALIZED_NAME_OT_P_AUTHENTICATOR = "OTPAuthenticator"; + @SerializedName(SERIALIZED_NAME_OT_P_AUTHENTICATOR) + @javax.annotation.Nullable + private SecondFactorAuthenticator otPAuthenticator; + + public static final String SERIALIZED_NAME_EMAIL_O_T_P_AUTHENTICATOR = "EmailOTPAuthenticator"; + @SerializedName(SERIALIZED_NAME_EMAIL_O_T_P_AUTHENTICATOR) + @javax.annotation.Nullable + private SecondFactorAuthenticator emailOTPAuthenticator; + + public static final String SERIALIZED_NAME_BACK_UP_CODES = "BackUpCodes"; + @SerializedName(SERIALIZED_NAME_BACK_UP_CODES) + @javax.annotation.Nullable + private List<String> backUpCodes = new ArrayList<>(); + + public static final String SERIALIZED_NAME_AUTHENTICATOR = "Authenticator"; + @SerializedName(SERIALIZED_NAME_AUTHENTICATOR) + @javax.annotation.Nullable + private SecondFactorAuthenticator authenticator; + + public static final String SERIALIZED_NAME_PUSH_AUTHENTICATOR = "PushAuthenticator"; + @SerializedName(SERIALIZED_NAME_PUSH_AUTHENTICATOR) + @javax.annotation.Nullable + private SecondFactorAuthenticationPushDevice pushAuthenticator; + + public static final String SERIALIZED_NAME_DUO_SECURITY_AUTHENTICATOR = "DuoSecurityAuthenticator"; + @SerializedName(SERIALIZED_NAME_DUO_SECURITY_AUTHENTICATOR) + @javax.annotation.Nullable + private SecondFactorAuthenticator duoSecurityAuthenticator; + + public static final String SERIALIZED_NAME_PASSKEY_AUTHENTICATOR = "PasskeyAuthenticator"; + @SerializedName(SERIALIZED_NAME_PASSKEY_AUTHENTICATOR) + @javax.annotation.Nullable + private SecondFactorAuthenticationPasskeyCredential passkeyAuthenticator; + + public static final String SERIALIZED_NAME_SECURITY_QUESTION_AUTHENTICATOR = "SecurityQuestionAuthenticator"; + @SerializedName(SERIALIZED_NAME_SECURITY_QUESTION_AUTHENTICATOR) + @javax.annotation.Nullable + private SecondFactorAuthenticator securityQuestionAuthenticator; + + public SecondFactorAuthentication() { + } + + public SecondFactorAuthentication googleAuthenticator(@javax.annotation.Nullable SecondFactorAuthenticator googleAuthenticator) { + this.googleAuthenticator = googleAuthenticator; + return this; + } + + /** + * Get googleAuthenticator + * @return googleAuthenticator + */ + @javax.annotation.Nullable + public SecondFactorAuthenticator getGoogleAuthenticator() { + return googleAuthenticator; + } + + public void setGoogleAuthenticator(@javax.annotation.Nullable SecondFactorAuthenticator googleAuthenticator) { + this.googleAuthenticator = googleAuthenticator; + } + + + public SecondFactorAuthentication otPAuthenticator(@javax.annotation.Nullable SecondFactorAuthenticator otPAuthenticator) { + this.otPAuthenticator = otPAuthenticator; + return this; + } + + /** + * Get otPAuthenticator + * @return otPAuthenticator + */ + @javax.annotation.Nullable + public SecondFactorAuthenticator getOtPAuthenticator() { + return otPAuthenticator; + } + + public void setOtPAuthenticator(@javax.annotation.Nullable SecondFactorAuthenticator otPAuthenticator) { + this.otPAuthenticator = otPAuthenticator; + } + + + public SecondFactorAuthentication emailOTPAuthenticator(@javax.annotation.Nullable SecondFactorAuthenticator emailOTPAuthenticator) { + this.emailOTPAuthenticator = emailOTPAuthenticator; + return this; + } + + /** + * Get emailOTPAuthenticator + * @return emailOTPAuthenticator + */ + @javax.annotation.Nullable + public SecondFactorAuthenticator getEmailOTPAuthenticator() { + return emailOTPAuthenticator; + } + + public void setEmailOTPAuthenticator(@javax.annotation.Nullable SecondFactorAuthenticator emailOTPAuthenticator) { + this.emailOTPAuthenticator = emailOTPAuthenticator; + } + + + public SecondFactorAuthentication backUpCodes(@javax.annotation.Nullable List<String> backUpCodes) { + this.backUpCodes = backUpCodes; + return this; + } + + public SecondFactorAuthentication addBackUpCodesItem(String backUpCodesItem) { + if (this.backUpCodes == null) { + this.backUpCodes = new ArrayList<>(); + } + this.backUpCodes.add(backUpCodesItem); + return this; + } + + /** + * Get backUpCodes + * @return backUpCodes + */ + @javax.annotation.Nullable + public List<String> getBackUpCodes() { + return backUpCodes; + } + + public void setBackUpCodes(@javax.annotation.Nullable List<String> backUpCodes) { + this.backUpCodes = backUpCodes; + } + + + public SecondFactorAuthentication authenticator(@javax.annotation.Nullable SecondFactorAuthenticator authenticator) { + this.authenticator = authenticator; + return this; + } + + /** + * Get authenticator + * @return authenticator + */ + @javax.annotation.Nullable + public SecondFactorAuthenticator getAuthenticator() { + return authenticator; + } + + public void setAuthenticator(@javax.annotation.Nullable SecondFactorAuthenticator authenticator) { + this.authenticator = authenticator; + } + + + public SecondFactorAuthentication pushAuthenticator(@javax.annotation.Nullable SecondFactorAuthenticationPushDevice pushAuthenticator) { + this.pushAuthenticator = pushAuthenticator; + return this; + } + + /** + * Get pushAuthenticator + * @return pushAuthenticator + */ + @javax.annotation.Nullable + public SecondFactorAuthenticationPushDevice getPushAuthenticator() { + return pushAuthenticator; + } + + public void setPushAuthenticator(@javax.annotation.Nullable SecondFactorAuthenticationPushDevice pushAuthenticator) { + this.pushAuthenticator = pushAuthenticator; + } + + + public SecondFactorAuthentication duoSecurityAuthenticator(@javax.annotation.Nullable SecondFactorAuthenticator duoSecurityAuthenticator) { + this.duoSecurityAuthenticator = duoSecurityAuthenticator; + return this; + } + + /** + * Get duoSecurityAuthenticator + * @return duoSecurityAuthenticator + */ + @javax.annotation.Nullable + public SecondFactorAuthenticator getDuoSecurityAuthenticator() { + return duoSecurityAuthenticator; + } + + public void setDuoSecurityAuthenticator(@javax.annotation.Nullable SecondFactorAuthenticator duoSecurityAuthenticator) { + this.duoSecurityAuthenticator = duoSecurityAuthenticator; + } + + + public SecondFactorAuthentication passkeyAuthenticator(@javax.annotation.Nullable SecondFactorAuthenticationPasskeyCredential passkeyAuthenticator) { + this.passkeyAuthenticator = passkeyAuthenticator; + return this; + } + + /** + * Get passkeyAuthenticator + * @return passkeyAuthenticator + */ + @javax.annotation.Nullable + public SecondFactorAuthenticationPasskeyCredential getPasskeyAuthenticator() { + return passkeyAuthenticator; + } + + public void setPasskeyAuthenticator(@javax.annotation.Nullable SecondFactorAuthenticationPasskeyCredential passkeyAuthenticator) { + this.passkeyAuthenticator = passkeyAuthenticator; + } + + + public SecondFactorAuthentication securityQuestionAuthenticator(@javax.annotation.Nullable SecondFactorAuthenticator securityQuestionAuthenticator) { + this.securityQuestionAuthenticator = securityQuestionAuthenticator; + return this; + } + + /** + * Get securityQuestionAuthenticator + * @return securityQuestionAuthenticator + */ + @javax.annotation.Nullable + public SecondFactorAuthenticator getSecurityQuestionAuthenticator() { + return securityQuestionAuthenticator; + } + + public void setSecurityQuestionAuthenticator(@javax.annotation.Nullable SecondFactorAuthenticator securityQuestionAuthenticator) { + this.securityQuestionAuthenticator = securityQuestionAuthenticator; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SecondFactorAuthentication instance itself + */ + public SecondFactorAuthentication putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SecondFactorAuthentication secondFactorAuthentication = (SecondFactorAuthentication) o; + return Objects.equals(this.googleAuthenticator, secondFactorAuthentication.googleAuthenticator) && + Objects.equals(this.otPAuthenticator, secondFactorAuthentication.otPAuthenticator) && + Objects.equals(this.emailOTPAuthenticator, secondFactorAuthentication.emailOTPAuthenticator) && + Objects.equals(this.backUpCodes, secondFactorAuthentication.backUpCodes) && + Objects.equals(this.authenticator, secondFactorAuthentication.authenticator) && + Objects.equals(this.pushAuthenticator, secondFactorAuthentication.pushAuthenticator) && + Objects.equals(this.duoSecurityAuthenticator, secondFactorAuthentication.duoSecurityAuthenticator) && + Objects.equals(this.passkeyAuthenticator, secondFactorAuthentication.passkeyAuthenticator) && + Objects.equals(this.securityQuestionAuthenticator, secondFactorAuthentication.securityQuestionAuthenticator)&& + Objects.equals(this.additionalProperties, secondFactorAuthentication.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(googleAuthenticator, otPAuthenticator, emailOTPAuthenticator, backUpCodes, authenticator, pushAuthenticator, duoSecurityAuthenticator, passkeyAuthenticator, securityQuestionAuthenticator, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SecondFactorAuthentication {\n"); + sb.append(" googleAuthenticator: ").append(toIndentedString(googleAuthenticator)).append("\n"); + sb.append(" otPAuthenticator: ").append(toIndentedString(otPAuthenticator)).append("\n"); + sb.append(" emailOTPAuthenticator: ").append(toIndentedString(emailOTPAuthenticator)).append("\n"); + sb.append(" backUpCodes: ").append(toIndentedString(backUpCodes)).append("\n"); + sb.append(" authenticator: ").append(toIndentedString(authenticator)).append("\n"); + sb.append(" pushAuthenticator: ").append(toIndentedString(pushAuthenticator)).append("\n"); + sb.append(" duoSecurityAuthenticator: ").append(toIndentedString(duoSecurityAuthenticator)).append("\n"); + sb.append(" passkeyAuthenticator: ").append(toIndentedString(passkeyAuthenticator)).append("\n"); + sb.append(" securityQuestionAuthenticator: ").append(toIndentedString(securityQuestionAuthenticator)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("GoogleAuthenticator"); + openapiFields.add("OTPAuthenticator"); + openapiFields.add("EmailOTPAuthenticator"); + openapiFields.add("BackUpCodes"); + openapiFields.add("Authenticator"); + openapiFields.add("PushAuthenticator"); + openapiFields.add("DuoSecurityAuthenticator"); + openapiFields.add("PasskeyAuthenticator"); + openapiFields.add("SecurityQuestionAuthenticator"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SecondFactorAuthentication + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SecondFactorAuthentication.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SecondFactorAuthentication is not found in the empty JSON string", SecondFactorAuthentication.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `GoogleAuthenticator` + if (jsonObj.get("GoogleAuthenticator") != null && !jsonObj.get("GoogleAuthenticator").isJsonNull()) { + SecondFactorAuthenticator.validateJsonElement(jsonObj.get("GoogleAuthenticator")); + } + // validate the optional field `OTPAuthenticator` + if (jsonObj.get("OTPAuthenticator") != null && !jsonObj.get("OTPAuthenticator").isJsonNull()) { + SecondFactorAuthenticator.validateJsonElement(jsonObj.get("OTPAuthenticator")); + } + // validate the optional field `EmailOTPAuthenticator` + if (jsonObj.get("EmailOTPAuthenticator") != null && !jsonObj.get("EmailOTPAuthenticator").isJsonNull()) { + SecondFactorAuthenticator.validateJsonElement(jsonObj.get("EmailOTPAuthenticator")); + } + // ensure the optional json data is an array if present + if (jsonObj.get("BackUpCodes") != null && !jsonObj.get("BackUpCodes").isJsonNull() && !jsonObj.get("BackUpCodes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `BackUpCodes` to be an array in the JSON string but got `%s`", jsonObj.get("BackUpCodes").toString())); + } + // validate the optional field `Authenticator` + if (jsonObj.get("Authenticator") != null && !jsonObj.get("Authenticator").isJsonNull()) { + SecondFactorAuthenticator.validateJsonElement(jsonObj.get("Authenticator")); + } + // validate the optional field `PushAuthenticator` + if (jsonObj.get("PushAuthenticator") != null && !jsonObj.get("PushAuthenticator").isJsonNull()) { + SecondFactorAuthenticationPushDevice.validateJsonElement(jsonObj.get("PushAuthenticator")); + } + // validate the optional field `DuoSecurityAuthenticator` + if (jsonObj.get("DuoSecurityAuthenticator") != null && !jsonObj.get("DuoSecurityAuthenticator").isJsonNull()) { + SecondFactorAuthenticator.validateJsonElement(jsonObj.get("DuoSecurityAuthenticator")); + } + // validate the optional field `PasskeyAuthenticator` + if (jsonObj.get("PasskeyAuthenticator") != null && !jsonObj.get("PasskeyAuthenticator").isJsonNull()) { + SecondFactorAuthenticationPasskeyCredential.validateJsonElement(jsonObj.get("PasskeyAuthenticator")); + } + // validate the optional field `SecurityQuestionAuthenticator` + if (jsonObj.get("SecurityQuestionAuthenticator") != null && !jsonObj.get("SecurityQuestionAuthenticator").isJsonNull()) { + SecondFactorAuthenticator.validateJsonElement(jsonObj.get("SecurityQuestionAuthenticator")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SecondFactorAuthentication.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SecondFactorAuthentication' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SecondFactorAuthentication> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SecondFactorAuthentication.class)); + + return (TypeAdapter<T>) new TypeAdapter<SecondFactorAuthentication>() { + @Override + public void write(JsonWriter out, SecondFactorAuthentication value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SecondFactorAuthentication read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SecondFactorAuthentication instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SecondFactorAuthentication given an JSON string + * + * @param jsonString JSON string + * @return An instance of SecondFactorAuthentication + * @throws IOException if the JSON string is invalid with respect to SecondFactorAuthentication + */ + public static SecondFactorAuthentication fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SecondFactorAuthentication.class); + } + + /** + * Convert an instance of SecondFactorAuthentication to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SecondFactorAuthenticationCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SecondFactorAuthenticationCore.java new file mode 100644 index 0000000..ebf4f87 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SecondFactorAuthenticationCore.java @@ -0,0 +1,289 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.SecondFactorAuthenticator; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SecondFactorAuthenticationCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SecondFactorAuthenticationCore { + public static final String SERIALIZED_NAME_SECURITY_QUESTION_AUTHENTICATOR = "SecurityQuestionAuthenticator"; + @SerializedName(SERIALIZED_NAME_SECURITY_QUESTION_AUTHENTICATOR) + @javax.annotation.Nullable + private SecondFactorAuthenticator securityQuestionAuthenticator; + + public SecondFactorAuthenticationCore() { + } + + public SecondFactorAuthenticationCore securityQuestionAuthenticator(@javax.annotation.Nullable SecondFactorAuthenticator securityQuestionAuthenticator) { + this.securityQuestionAuthenticator = securityQuestionAuthenticator; + return this; + } + + /** + * Get securityQuestionAuthenticator + * @return securityQuestionAuthenticator + */ + @javax.annotation.Nullable + public SecondFactorAuthenticator getSecurityQuestionAuthenticator() { + return securityQuestionAuthenticator; + } + + public void setSecurityQuestionAuthenticator(@javax.annotation.Nullable SecondFactorAuthenticator securityQuestionAuthenticator) { + this.securityQuestionAuthenticator = securityQuestionAuthenticator; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SecondFactorAuthenticationCore instance itself + */ + public SecondFactorAuthenticationCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SecondFactorAuthenticationCore secondFactorAuthenticationCore = (SecondFactorAuthenticationCore) o; + return Objects.equals(this.securityQuestionAuthenticator, secondFactorAuthenticationCore.securityQuestionAuthenticator)&& + Objects.equals(this.additionalProperties, secondFactorAuthenticationCore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(securityQuestionAuthenticator, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SecondFactorAuthenticationCore {\n"); + sb.append(" securityQuestionAuthenticator: ").append(toIndentedString(securityQuestionAuthenticator)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("SecurityQuestionAuthenticator"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SecondFactorAuthenticationCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SecondFactorAuthenticationCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SecondFactorAuthenticationCore is not found in the empty JSON string", SecondFactorAuthenticationCore.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `SecurityQuestionAuthenticator` + if (jsonObj.get("SecurityQuestionAuthenticator") != null && !jsonObj.get("SecurityQuestionAuthenticator").isJsonNull()) { + SecondFactorAuthenticator.validateJsonElement(jsonObj.get("SecurityQuestionAuthenticator")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SecondFactorAuthenticationCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SecondFactorAuthenticationCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SecondFactorAuthenticationCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SecondFactorAuthenticationCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<SecondFactorAuthenticationCore>() { + @Override + public void write(JsonWriter out, SecondFactorAuthenticationCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SecondFactorAuthenticationCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SecondFactorAuthenticationCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SecondFactorAuthenticationCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of SecondFactorAuthenticationCore + * @throws IOException if the JSON string is invalid with respect to SecondFactorAuthenticationCore + */ + public static SecondFactorAuthenticationCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SecondFactorAuthenticationCore.class); + } + + /** + * Convert an instance of SecondFactorAuthenticationCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SecondFactorAuthenticationPasskeyCredential.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SecondFactorAuthenticationPasskeyCredential.java new file mode 100644 index 0000000..40e094b --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SecondFactorAuthenticationPasskeyCredential.java @@ -0,0 +1,343 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.CredentialObj; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SecondFactorAuthenticationPasskeyCredential + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SecondFactorAuthenticationPasskeyCredential { + public static final String SERIALIZED_NAME_IS_VERIFIED = "IsVerified"; + @SerializedName(SERIALIZED_NAME_IS_VERIFIED) + @javax.annotation.Nullable + private Boolean isVerified; + + public static final String SERIALIZED_NAME_IS_ENABLED = "IsEnabled"; + @SerializedName(SERIALIZED_NAME_IS_ENABLED) + @javax.annotation.Nullable + private Boolean isEnabled; + + public static final String SERIALIZED_NAME_PASSKEY_CREDENTIAL = "PasskeyCredential"; + @SerializedName(SERIALIZED_NAME_PASSKEY_CREDENTIAL) + @javax.annotation.Nullable + private CredentialObj passkeyCredential; + + public SecondFactorAuthenticationPasskeyCredential() { + } + + public SecondFactorAuthenticationPasskeyCredential isVerified(@javax.annotation.Nullable Boolean isVerified) { + this.isVerified = isVerified; + return this; + } + + /** + * Get isVerified + * @return isVerified + */ + @javax.annotation.Nullable + public Boolean getIsVerified() { + return isVerified; + } + + public void setIsVerified(@javax.annotation.Nullable Boolean isVerified) { + this.isVerified = isVerified; + } + + + public SecondFactorAuthenticationPasskeyCredential isEnabled(@javax.annotation.Nullable Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Get isEnabled + * @return isEnabled + */ + @javax.annotation.Nullable + public Boolean getIsEnabled() { + return isEnabled; + } + + public void setIsEnabled(@javax.annotation.Nullable Boolean isEnabled) { + this.isEnabled = isEnabled; + } + + + public SecondFactorAuthenticationPasskeyCredential passkeyCredential(@javax.annotation.Nullable CredentialObj passkeyCredential) { + this.passkeyCredential = passkeyCredential; + return this; + } + + /** + * Get passkeyCredential + * @return passkeyCredential + */ + @javax.annotation.Nullable + public CredentialObj getPasskeyCredential() { + return passkeyCredential; + } + + public void setPasskeyCredential(@javax.annotation.Nullable CredentialObj passkeyCredential) { + this.passkeyCredential = passkeyCredential; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SecondFactorAuthenticationPasskeyCredential instance itself + */ + public SecondFactorAuthenticationPasskeyCredential putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SecondFactorAuthenticationPasskeyCredential secondFactorAuthenticationPasskeyCredential = (SecondFactorAuthenticationPasskeyCredential) o; + return Objects.equals(this.isVerified, secondFactorAuthenticationPasskeyCredential.isVerified) && + Objects.equals(this.isEnabled, secondFactorAuthenticationPasskeyCredential.isEnabled) && + Objects.equals(this.passkeyCredential, secondFactorAuthenticationPasskeyCredential.passkeyCredential)&& + Objects.equals(this.additionalProperties, secondFactorAuthenticationPasskeyCredential.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isVerified, isEnabled, passkeyCredential, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SecondFactorAuthenticationPasskeyCredential {\n"); + sb.append(" isVerified: ").append(toIndentedString(isVerified)).append("\n"); + sb.append(" isEnabled: ").append(toIndentedString(isEnabled)).append("\n"); + sb.append(" passkeyCredential: ").append(toIndentedString(passkeyCredential)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsVerified"); + openapiFields.add("IsEnabled"); + openapiFields.add("PasskeyCredential"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SecondFactorAuthenticationPasskeyCredential + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SecondFactorAuthenticationPasskeyCredential.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SecondFactorAuthenticationPasskeyCredential is not found in the empty JSON string", SecondFactorAuthenticationPasskeyCredential.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `PasskeyCredential` + if (jsonObj.get("PasskeyCredential") != null && !jsonObj.get("PasskeyCredential").isJsonNull()) { + CredentialObj.validateJsonElement(jsonObj.get("PasskeyCredential")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SecondFactorAuthenticationPasskeyCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SecondFactorAuthenticationPasskeyCredential' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SecondFactorAuthenticationPasskeyCredential> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SecondFactorAuthenticationPasskeyCredential.class)); + + return (TypeAdapter<T>) new TypeAdapter<SecondFactorAuthenticationPasskeyCredential>() { + @Override + public void write(JsonWriter out, SecondFactorAuthenticationPasskeyCredential value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SecondFactorAuthenticationPasskeyCredential read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SecondFactorAuthenticationPasskeyCredential instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SecondFactorAuthenticationPasskeyCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of SecondFactorAuthenticationPasskeyCredential + * @throws IOException if the JSON string is invalid with respect to SecondFactorAuthenticationPasskeyCredential + */ + public static SecondFactorAuthenticationPasskeyCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SecondFactorAuthenticationPasskeyCredential.class); + } + + /** + * Convert an instance of SecondFactorAuthenticationPasskeyCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SecondFactorAuthenticationPushDevice.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SecondFactorAuthenticationPushDevice.java new file mode 100644 index 0000000..7c0a444 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SecondFactorAuthenticationPushDevice.java @@ -0,0 +1,343 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.PushDevice; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SecondFactorAuthenticationPushDevice + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SecondFactorAuthenticationPushDevice { + public static final String SERIALIZED_NAME_IS_VERIFIED = "IsVerified"; + @SerializedName(SERIALIZED_NAME_IS_VERIFIED) + @javax.annotation.Nullable + private Boolean isVerified; + + public static final String SERIALIZED_NAME_IS_ENABLED = "IsEnabled"; + @SerializedName(SERIALIZED_NAME_IS_ENABLED) + @javax.annotation.Nullable + private Boolean isEnabled; + + public static final String SERIALIZED_NAME_PUSH_DEVICE = "PushDevice"; + @SerializedName(SERIALIZED_NAME_PUSH_DEVICE) + @javax.annotation.Nullable + private PushDevice pushDevice; + + public SecondFactorAuthenticationPushDevice() { + } + + public SecondFactorAuthenticationPushDevice isVerified(@javax.annotation.Nullable Boolean isVerified) { + this.isVerified = isVerified; + return this; + } + + /** + * Get isVerified + * @return isVerified + */ + @javax.annotation.Nullable + public Boolean getIsVerified() { + return isVerified; + } + + public void setIsVerified(@javax.annotation.Nullable Boolean isVerified) { + this.isVerified = isVerified; + } + + + public SecondFactorAuthenticationPushDevice isEnabled(@javax.annotation.Nullable Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Get isEnabled + * @return isEnabled + */ + @javax.annotation.Nullable + public Boolean getIsEnabled() { + return isEnabled; + } + + public void setIsEnabled(@javax.annotation.Nullable Boolean isEnabled) { + this.isEnabled = isEnabled; + } + + + public SecondFactorAuthenticationPushDevice pushDevice(@javax.annotation.Nullable PushDevice pushDevice) { + this.pushDevice = pushDevice; + return this; + } + + /** + * Get pushDevice + * @return pushDevice + */ + @javax.annotation.Nullable + public PushDevice getPushDevice() { + return pushDevice; + } + + public void setPushDevice(@javax.annotation.Nullable PushDevice pushDevice) { + this.pushDevice = pushDevice; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SecondFactorAuthenticationPushDevice instance itself + */ + public SecondFactorAuthenticationPushDevice putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SecondFactorAuthenticationPushDevice secondFactorAuthenticationPushDevice = (SecondFactorAuthenticationPushDevice) o; + return Objects.equals(this.isVerified, secondFactorAuthenticationPushDevice.isVerified) && + Objects.equals(this.isEnabled, secondFactorAuthenticationPushDevice.isEnabled) && + Objects.equals(this.pushDevice, secondFactorAuthenticationPushDevice.pushDevice)&& + Objects.equals(this.additionalProperties, secondFactorAuthenticationPushDevice.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isVerified, isEnabled, pushDevice, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SecondFactorAuthenticationPushDevice {\n"); + sb.append(" isVerified: ").append(toIndentedString(isVerified)).append("\n"); + sb.append(" isEnabled: ").append(toIndentedString(isEnabled)).append("\n"); + sb.append(" pushDevice: ").append(toIndentedString(pushDevice)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsVerified"); + openapiFields.add("IsEnabled"); + openapiFields.add("PushDevice"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SecondFactorAuthenticationPushDevice + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SecondFactorAuthenticationPushDevice.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SecondFactorAuthenticationPushDevice is not found in the empty JSON string", SecondFactorAuthenticationPushDevice.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `PushDevice` + if (jsonObj.get("PushDevice") != null && !jsonObj.get("PushDevice").isJsonNull()) { + PushDevice.validateJsonElement(jsonObj.get("PushDevice")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SecondFactorAuthenticationPushDevice.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SecondFactorAuthenticationPushDevice' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SecondFactorAuthenticationPushDevice> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SecondFactorAuthenticationPushDevice.class)); + + return (TypeAdapter<T>) new TypeAdapter<SecondFactorAuthenticationPushDevice>() { + @Override + public void write(JsonWriter out, SecondFactorAuthenticationPushDevice value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SecondFactorAuthenticationPushDevice read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SecondFactorAuthenticationPushDevice instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SecondFactorAuthenticationPushDevice given an JSON string + * + * @param jsonString JSON string + * @return An instance of SecondFactorAuthenticationPushDevice + * @throws IOException if the JSON string is invalid with respect to SecondFactorAuthenticationPushDevice + */ + public static SecondFactorAuthenticationPushDevice fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SecondFactorAuthenticationPushDevice.class); + } + + /** + * Convert an instance of SecondFactorAuthenticationPushDevice to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SecondFactorAuthenticator.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SecondFactorAuthenticator.java new file mode 100644 index 0000000..f1ecb09 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SecondFactorAuthenticator.java @@ -0,0 +1,353 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SecondFactorAuthenticator + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SecondFactorAuthenticator { + public static final String SERIALIZED_NAME_IS_VERIFIED = "IsVerified"; + @SerializedName(SERIALIZED_NAME_IS_VERIFIED) + @javax.annotation.Nullable + private Boolean isVerified; + + public static final String SERIALIZED_NAME_IS_ENABLED = "IsEnabled"; + @SerializedName(SERIALIZED_NAME_IS_ENABLED) + @javax.annotation.Nullable + private Boolean isEnabled; + + public static final String SERIALIZED_NAME_SECOND_FACTOR = "SecondFactor"; + @SerializedName(SERIALIZED_NAME_SECOND_FACTOR) + @javax.annotation.Nullable + private String secondFactor; + + public SecondFactorAuthenticator() { + } + + public SecondFactorAuthenticator isVerified(@javax.annotation.Nullable Boolean isVerified) { + this.isVerified = isVerified; + return this; + } + + /** + * Get isVerified + * @return isVerified + */ + @javax.annotation.Nullable + public Boolean getIsVerified() { + return isVerified; + } + + public void setIsVerified(@javax.annotation.Nullable Boolean isVerified) { + this.isVerified = isVerified; + } + + + public SecondFactorAuthenticator isEnabled(@javax.annotation.Nullable Boolean isEnabled) { + this.isEnabled = isEnabled; + return this; + } + + /** + * Get isEnabled + * @return isEnabled + */ + @javax.annotation.Nullable + public Boolean getIsEnabled() { + return isEnabled; + } + + public void setIsEnabled(@javax.annotation.Nullable Boolean isEnabled) { + this.isEnabled = isEnabled; + } + + + public SecondFactorAuthenticator secondFactor(@javax.annotation.Nullable String secondFactor) { + this.secondFactor = secondFactor; + return this; + } + + /** + * Get secondFactor + * @return secondFactor + */ + @javax.annotation.Nullable + public String getSecondFactor() { + return secondFactor; + } + + public void setSecondFactor(@javax.annotation.Nullable String secondFactor) { + this.secondFactor = secondFactor; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SecondFactorAuthenticator instance itself + */ + public SecondFactorAuthenticator putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SecondFactorAuthenticator secondFactorAuthenticator = (SecondFactorAuthenticator) o; + return Objects.equals(this.isVerified, secondFactorAuthenticator.isVerified) && + Objects.equals(this.isEnabled, secondFactorAuthenticator.isEnabled) && + Objects.equals(this.secondFactor, secondFactorAuthenticator.secondFactor)&& + Objects.equals(this.additionalProperties, secondFactorAuthenticator.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(isVerified, isEnabled, secondFactor, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SecondFactorAuthenticator {\n"); + sb.append(" isVerified: ").append(toIndentedString(isVerified)).append("\n"); + sb.append(" isEnabled: ").append(toIndentedString(isEnabled)).append("\n"); + sb.append(" secondFactor: ").append(toIndentedString(secondFactor)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsVerified"); + openapiFields.add("IsEnabled"); + openapiFields.add("SecondFactor"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SecondFactorAuthenticator + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SecondFactorAuthenticator.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SecondFactorAuthenticator is not found in the empty JSON string", SecondFactorAuthenticator.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("SecondFactor") != null && !jsonObj.get("SecondFactor").isJsonNull()) && !jsonObj.get("SecondFactor").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SecondFactor` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SecondFactor").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SecondFactorAuthenticator.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SecondFactorAuthenticator' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SecondFactorAuthenticator> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SecondFactorAuthenticator.class)); + + return (TypeAdapter<T>) new TypeAdapter<SecondFactorAuthenticator>() { + @Override + public void write(JsonWriter out, SecondFactorAuthenticator value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SecondFactorAuthenticator read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SecondFactorAuthenticator instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SecondFactorAuthenticator given an JSON string + * + * @param jsonString JSON string + * @return An instance of SecondFactorAuthenticator + * @throws IOException if the JSON string is invalid with respect to SecondFactorAuthenticator + */ + public static SecondFactorAuthenticator fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SecondFactorAuthenticator.class); + } + + /** + * Convert an instance of SecondFactorAuthenticator to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SecurityQuestion.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SecurityQuestion.java new file mode 100644 index 0000000..6901d4f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SecurityQuestion.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SecurityQuestion + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SecurityQuestion { + public static final String SERIALIZED_NAME_QUESTION_ID = "QuestionId"; + @SerializedName(SERIALIZED_NAME_QUESTION_ID) + @javax.annotation.Nullable + private String questionId; + + public static final String SERIALIZED_NAME_QUESTION = "Question"; + @SerializedName(SERIALIZED_NAME_QUESTION) + @javax.annotation.Nullable + private String question; + + public SecurityQuestion() { + } + + public SecurityQuestion questionId(@javax.annotation.Nullable String questionId) { + this.questionId = questionId; + return this; + } + + /** + * Unique identifier of the security question. + * @return questionId + */ + @javax.annotation.Nullable + public String getQuestionId() { + return questionId; + } + + public void setQuestionId(@javax.annotation.Nullable String questionId) { + this.questionId = questionId; + } + + + public SecurityQuestion question(@javax.annotation.Nullable String question) { + this.question = question; + return this; + } + + /** + * The security question text. + * @return question + */ + @javax.annotation.Nullable + public String getQuestion() { + return question; + } + + public void setQuestion(@javax.annotation.Nullable String question) { + this.question = question; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SecurityQuestion instance itself + */ + public SecurityQuestion putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SecurityQuestion securityQuestion = (SecurityQuestion) o; + return Objects.equals(this.questionId, securityQuestion.questionId) && + Objects.equals(this.question, securityQuestion.question)&& + Objects.equals(this.additionalProperties, securityQuestion.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(questionId, question, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SecurityQuestion {\n"); + sb.append(" questionId: ").append(toIndentedString(questionId)).append("\n"); + sb.append(" question: ").append(toIndentedString(question)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("QuestionId"); + openapiFields.add("Question"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SecurityQuestion + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SecurityQuestion.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SecurityQuestion is not found in the empty JSON string", SecurityQuestion.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("QuestionId") != null && !jsonObj.get("QuestionId").isJsonNull()) && !jsonObj.get("QuestionId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `QuestionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("QuestionId").toString())); + } + if ((jsonObj.get("Question") != null && !jsonObj.get("Question").isJsonNull()) && !jsonObj.get("Question").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Question` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Question").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SecurityQuestion.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SecurityQuestion' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SecurityQuestion> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SecurityQuestion.class)); + + return (TypeAdapter<T>) new TypeAdapter<SecurityQuestion>() { + @Override + public void write(JsonWriter out, SecurityQuestion value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SecurityQuestion read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SecurityQuestion instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SecurityQuestion given an JSON string + * + * @param jsonString JSON string + * @return An instance of SecurityQuestion + * @throws IOException if the JSON string is invalid with respect to SecurityQuestion + */ + public static SecurityQuestion fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SecurityQuestion.class); + } + + /** + * Convert an instance of SecurityQuestion to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SecurityQuestionInput.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SecurityQuestionInput.java new file mode 100644 index 0000000..ee3bb48 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SecurityQuestionInput.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SecurityQuestionInput + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SecurityQuestionInput { + public static final String SERIALIZED_NAME_QUESTION = "question"; + @SerializedName(SERIALIZED_NAME_QUESTION) + @javax.annotation.Nonnull + private String question; + + public SecurityQuestionInput() { + } + + public SecurityQuestionInput question(@javax.annotation.Nonnull String question) { + this.question = question; + return this; + } + + /** + * The security question text. + * @return question + */ + @javax.annotation.Nonnull + public String getQuestion() { + return question; + } + + public void setQuestion(@javax.annotation.Nonnull String question) { + this.question = question; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SecurityQuestionInput instance itself + */ + public SecurityQuestionInput putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SecurityQuestionInput securityQuestionInput = (SecurityQuestionInput) o; + return Objects.equals(this.question, securityQuestionInput.question)&& + Objects.equals(this.additionalProperties, securityQuestionInput.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(question, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SecurityQuestionInput {\n"); + sb.append(" question: ").append(toIndentedString(question)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("question"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("question"); + } + + /** + * 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 SecurityQuestionInput + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SecurityQuestionInput.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SecurityQuestionInput is not found in the empty JSON string", SecurityQuestionInput.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SecurityQuestionInput.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("question").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `question` to be a primitive type in the JSON string but got `%s`", jsonObj.get("question").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SecurityQuestionInput.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SecurityQuestionInput' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SecurityQuestionInput> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SecurityQuestionInput.class)); + + return (TypeAdapter<T>) new TypeAdapter<SecurityQuestionInput>() { + @Override + public void write(JsonWriter out, SecurityQuestionInput value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SecurityQuestionInput read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SecurityQuestionInput instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SecurityQuestionInput given an JSON string + * + * @param jsonString JSON string + * @return An instance of SecurityQuestionInput + * @throws IOException if the JSON string is invalid with respect to SecurityQuestionInput + */ + public static SecurityQuestionInput fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SecurityQuestionInput.class); + } + + /** + * Convert an instance of SecurityQuestionInput to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SecurityQuestions.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SecurityQuestions.java new file mode 100644 index 0000000..e3f781b --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SecurityQuestions.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SecurityQuestions + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SecurityQuestions { + public static final String SERIALIZED_NAME_QUESTION_ID = "QuestionId"; + @SerializedName(SERIALIZED_NAME_QUESTION_ID) + @javax.annotation.Nullable + private String questionId; + + public static final String SERIALIZED_NAME_QUESTION = "Question"; + @SerializedName(SERIALIZED_NAME_QUESTION) + @javax.annotation.Nullable + private String question; + + public SecurityQuestions() { + } + + public SecurityQuestions questionId(@javax.annotation.Nullable String questionId) { + this.questionId = questionId; + return this; + } + + /** + * Get questionId + * @return questionId + */ + @javax.annotation.Nullable + public String getQuestionId() { + return questionId; + } + + public void setQuestionId(@javax.annotation.Nullable String questionId) { + this.questionId = questionId; + } + + + public SecurityQuestions question(@javax.annotation.Nullable String question) { + this.question = question; + return this; + } + + /** + * Get question + * @return question + */ + @javax.annotation.Nullable + public String getQuestion() { + return question; + } + + public void setQuestion(@javax.annotation.Nullable String question) { + this.question = question; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SecurityQuestions instance itself + */ + public SecurityQuestions putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SecurityQuestions securityQuestions = (SecurityQuestions) o; + return Objects.equals(this.questionId, securityQuestions.questionId) && + Objects.equals(this.question, securityQuestions.question)&& + Objects.equals(this.additionalProperties, securityQuestions.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(questionId, question, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SecurityQuestions {\n"); + sb.append(" questionId: ").append(toIndentedString(questionId)).append("\n"); + sb.append(" question: ").append(toIndentedString(question)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("QuestionId"); + openapiFields.add("Question"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SecurityQuestions + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SecurityQuestions.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SecurityQuestions is not found in the empty JSON string", SecurityQuestions.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("QuestionId") != null && !jsonObj.get("QuestionId").isJsonNull()) && !jsonObj.get("QuestionId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `QuestionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("QuestionId").toString())); + } + if ((jsonObj.get("Question") != null && !jsonObj.get("Question").isJsonNull()) && !jsonObj.get("Question").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Question` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Question").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SecurityQuestions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SecurityQuestions' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SecurityQuestions> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SecurityQuestions.class)); + + return (TypeAdapter<T>) new TypeAdapter<SecurityQuestions>() { + @Override + public void write(JsonWriter out, SecurityQuestions value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SecurityQuestions read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SecurityQuestions instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SecurityQuestions given an JSON string + * + * @param jsonString JSON string + * @return An instance of SecurityQuestions + * @throws IOException if the JSON string is invalid with respect to SecurityQuestions + */ + public static SecurityQuestions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SecurityQuestions.class); + } + + /** + * Convert an instance of SecurityQuestions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SecurityQuestionsRender.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SecurityQuestionsRender.java new file mode 100644 index 0000000..01ab0c8 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SecurityQuestionsRender.java @@ -0,0 +1,294 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SecurityQuestionsRender + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SecurityQuestionsRender { + public static final String SERIALIZED_NAME_RENDER_QUESTION_COUNT = "RenderQuestionCount"; + @SerializedName(SERIALIZED_NAME_RENDER_QUESTION_COUNT) + @javax.annotation.Nonnull + private Integer renderQuestionCount; + + public SecurityQuestionsRender() { + } + + public SecurityQuestionsRender renderQuestionCount(@javax.annotation.Nonnull Integer renderQuestionCount) { + this.renderQuestionCount = renderQuestionCount; + return this; + } + + /** + * The number of security questions to render. + * minimum: 1 + * maximum: 10 + * @return renderQuestionCount + */ + @javax.annotation.Nonnull + public Integer getRenderQuestionCount() { + return renderQuestionCount; + } + + public void setRenderQuestionCount(@javax.annotation.Nonnull Integer renderQuestionCount) { + this.renderQuestionCount = renderQuestionCount; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SecurityQuestionsRender instance itself + */ + public SecurityQuestionsRender putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SecurityQuestionsRender securityQuestionsRender = (SecurityQuestionsRender) o; + return Objects.equals(this.renderQuestionCount, securityQuestionsRender.renderQuestionCount)&& + Objects.equals(this.additionalProperties, securityQuestionsRender.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(renderQuestionCount, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SecurityQuestionsRender {\n"); + sb.append(" renderQuestionCount: ").append(toIndentedString(renderQuestionCount)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("RenderQuestionCount"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("RenderQuestionCount"); + } + + /** + * 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 SecurityQuestionsRender + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SecurityQuestionsRender.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SecurityQuestionsRender is not found in the empty JSON string", SecurityQuestionsRender.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SecurityQuestionsRender.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(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SecurityQuestionsRender.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SecurityQuestionsRender' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SecurityQuestionsRender> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SecurityQuestionsRender.class)); + + return (TypeAdapter<T>) new TypeAdapter<SecurityQuestionsRender>() { + @Override + public void write(JsonWriter out, SecurityQuestionsRender value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SecurityQuestionsRender read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SecurityQuestionsRender instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SecurityQuestionsRender given an JSON string + * + * @param jsonString JSON string + * @return An instance of SecurityQuestionsRender + * @throws IOException if the JSON string is invalid with respect to SecurityQuestionsRender + */ + public static SecurityQuestionsRender fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SecurityQuestionsRender.class); + } + + /** + * Convert an instance of SecurityQuestionsRender to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SendEmailVerificationResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SendEmailVerificationResponse.java new file mode 100644 index 0000000..acb6359 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SendEmailVerificationResponse.java @@ -0,0 +1,314 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SendEmailVerificationResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SendEmailVerificationResponse { + public static final String SERIALIZED_NAME_IS_POSTED = "IsPosted"; + @SerializedName(SERIALIZED_NAME_IS_POSTED) + @javax.annotation.Nullable + private Boolean isPosted; + + public static final String SERIALIZED_NAME_U_U_I_D = "UUID"; + @SerializedName(SERIALIZED_NAME_U_U_I_D) + @javax.annotation.Nullable + private String UUID; + + public SendEmailVerificationResponse() { + } + + public SendEmailVerificationResponse isPosted(@javax.annotation.Nullable Boolean isPosted) { + this.isPosted = isPosted; + return this; + } + + /** + * Indicates if the Email was successfully posted. + * @return isPosted + */ + @javax.annotation.Nullable + public Boolean getIsPosted() { + return isPosted; + } + + public void setIsPosted(@javax.annotation.Nullable Boolean isPosted) { + this.isPosted = isPosted; + } + + + public SendEmailVerificationResponse UUID(@javax.annotation.Nullable String UUID) { + this.UUID = UUID; + return this; + } + + /** + * Unique identifier for the request. + * @return UUID + */ + @javax.annotation.Nullable + public String getUUID() { + return UUID; + } + + public void setUUID(@javax.annotation.Nullable String UUID) { + this.UUID = UUID; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SendEmailVerificationResponse instance itself + */ + public SendEmailVerificationResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendEmailVerificationResponse sendEmailVerificationResponse = (SendEmailVerificationResponse) o; + return Objects.equals(this.isPosted, sendEmailVerificationResponse.isPosted) && + Objects.equals(this.UUID, sendEmailVerificationResponse.UUID)&& + Objects.equals(this.additionalProperties, sendEmailVerificationResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isPosted, UUID, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendEmailVerificationResponse {\n"); + sb.append(" isPosted: ").append(toIndentedString(isPosted)).append("\n"); + sb.append(" UUID: ").append(toIndentedString(UUID)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsPosted"); + openapiFields.add("UUID"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SendEmailVerificationResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SendEmailVerificationResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SendEmailVerificationResponse is not found in the empty JSON string", SendEmailVerificationResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("UUID") != null && !jsonObj.get("UUID").isJsonNull()) && !jsonObj.get("UUID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UUID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UUID").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SendEmailVerificationResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SendEmailVerificationResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SendEmailVerificationResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SendEmailVerificationResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<SendEmailVerificationResponse>() { + @Override + public void write(JsonWriter out, SendEmailVerificationResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SendEmailVerificationResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SendEmailVerificationResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SendEmailVerificationResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SendEmailVerificationResponse + * @throws IOException if the JSON string is invalid with respect to SendEmailVerificationResponse + */ + public static SendEmailVerificationResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SendEmailVerificationResponse.class); + } + + /** + * Convert an instance of SendEmailVerificationResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SendInvitation.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SendInvitation.java new file mode 100644 index 0000000..861abf8 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SendInvitation.java @@ -0,0 +1,401 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SendInvitation + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SendInvitation { + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nonnull + private String email; + + public static final String SERIALIZED_NAME_ROLE_IDS = "roleIds"; + @SerializedName(SERIALIZED_NAME_ROLE_IDS) + @javax.annotation.Nonnull + private List<String> roleIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ORG_ID = "orgId"; + @SerializedName(SERIALIZED_NAME_ORG_ID) + @javax.annotation.Nonnull + private String orgId; + + public static final String SERIALIZED_NAME_INVITER_UID = "inviterUid"; + @SerializedName(SERIALIZED_NAME_INVITER_UID) + @javax.annotation.Nonnull + private String inviterUid; + + public SendInvitation() { + } + + public SendInvitation email(@javax.annotation.Nonnull String email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + */ + @javax.annotation.Nonnull + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nonnull String email) { + this.email = email; + } + + + public SendInvitation roleIds(@javax.annotation.Nonnull List<String> roleIds) { + this.roleIds = roleIds; + return this; + } + + public SendInvitation addRoleIdsItem(String roleIdsItem) { + if (this.roleIds == null) { + this.roleIds = new ArrayList<>(); + } + this.roleIds.add(roleIdsItem); + return this; + } + + /** + * Get roleIds + * @return roleIds + */ + @javax.annotation.Nonnull + public List<String> getRoleIds() { + return roleIds; + } + + public void setRoleIds(@javax.annotation.Nonnull List<String> roleIds) { + this.roleIds = roleIds; + } + + + public SendInvitation orgId(@javax.annotation.Nonnull String orgId) { + this.orgId = orgId; + return this; + } + + /** + * Get orgId + * @return orgId + */ + @javax.annotation.Nonnull + public String getOrgId() { + return orgId; + } + + public void setOrgId(@javax.annotation.Nonnull String orgId) { + this.orgId = orgId; + } + + + public SendInvitation inviterUid(@javax.annotation.Nonnull String inviterUid) { + this.inviterUid = inviterUid; + return this; + } + + /** + * Get inviterUid + * @return inviterUid + */ + @javax.annotation.Nonnull + public String getInviterUid() { + return inviterUid; + } + + public void setInviterUid(@javax.annotation.Nonnull String inviterUid) { + this.inviterUid = inviterUid; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SendInvitation instance itself + */ + public SendInvitation putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SendInvitation sendInvitation = (SendInvitation) o; + return Objects.equals(this.email, sendInvitation.email) && + Objects.equals(this.roleIds, sendInvitation.roleIds) && + Objects.equals(this.orgId, sendInvitation.orgId) && + Objects.equals(this.inviterUid, sendInvitation.inviterUid)&& + Objects.equals(this.additionalProperties, sendInvitation.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, roleIds, orgId, inviterUid, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SendInvitation {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" roleIds: ").append(toIndentedString(roleIds)).append("\n"); + sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n"); + sb.append(" inviterUid: ").append(toIndentedString(inviterUid)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("email"); + openapiFields.add("roleIds"); + openapiFields.add("orgId"); + openapiFields.add("inviterUid"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("email"); + openapiRequiredFields.add("roleIds"); + openapiRequiredFields.add("orgId"); + openapiRequiredFields.add("inviterUid"); + } + + /** + * 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 SendInvitation + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SendInvitation.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SendInvitation is not found in the empty JSON string", SendInvitation.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SendInvitation.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("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + // ensure the required json array is present + if (jsonObj.get("roleIds") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("roleIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `roleIds` to be an array in the JSON string but got `%s`", jsonObj.get("roleIds").toString())); + } + if (!jsonObj.get("orgId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `orgId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("orgId").toString())); + } + if (!jsonObj.get("inviterUid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `inviterUid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("inviterUid").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SendInvitation.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SendInvitation' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SendInvitation> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SendInvitation.class)); + + return (TypeAdapter<T>) new TypeAdapter<SendInvitation>() { + @Override + public void write(JsonWriter out, SendInvitation value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SendInvitation read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SendInvitation instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SendInvitation given an JSON string + * + * @param jsonString JSON string + * @return An instance of SendInvitation + * @throws IOException if the JSON string is invalid with respect to SendInvitation + */ + public static SendInvitation fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SendInvitation.class); + } + + /** + * Convert an instance of SendInvitation to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SetCustomField200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SetCustomField200Response.java new file mode 100644 index 0000000..b0f4f29 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SetCustomField200Response.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.RaasConfig; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SetCustomField200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SetCustomField200Response { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<RaasConfig> data = new ArrayList<>(); + + public SetCustomField200Response() { + } + + public SetCustomField200Response data(@javax.annotation.Nullable List<RaasConfig> data) { + this.data = data; + return this; + } + + public SetCustomField200Response addDataItem(RaasConfig dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<RaasConfig> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<RaasConfig> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SetCustomField200Response instance itself + */ + public SetCustomField200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetCustomField200Response setCustomField200Response = (SetCustomField200Response) o; + return Objects.equals(this.data, setCustomField200Response.data)&& + Objects.equals(this.additionalProperties, setCustomField200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetCustomField200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SetCustomField200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SetCustomField200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetCustomField200Response is not found in the empty JSON string", SetCustomField200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + RaasConfig.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SetCustomField200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetCustomField200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SetCustomField200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetCustomField200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<SetCustomField200Response>() { + @Override + public void write(JsonWriter out, SetCustomField200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SetCustomField200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SetCustomField200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetCustomField200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetCustomField200Response + * @throws IOException if the JSON string is invalid with respect to SetCustomField200Response + */ + public static SetCustomField200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetCustomField200Response.class); + } + + /** + * Convert an instance of SetCustomField200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SetCustomFieldRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SetCustomFieldRequest.java new file mode 100644 index 0000000..b21d783 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SetCustomFieldRequest.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.RaasConfigData; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SetCustomFieldRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SetCustomFieldRequest { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<RaasConfigData> data = new ArrayList<>(); + + public SetCustomFieldRequest() { + } + + public SetCustomFieldRequest data(@javax.annotation.Nullable List<RaasConfigData> data) { + this.data = data; + return this; + } + + public SetCustomFieldRequest addDataItem(RaasConfigData dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<RaasConfigData> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<RaasConfigData> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SetCustomFieldRequest instance itself + */ + public SetCustomFieldRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetCustomFieldRequest setCustomFieldRequest = (SetCustomFieldRequest) o; + return Objects.equals(this.data, setCustomFieldRequest.data)&& + Objects.equals(this.additionalProperties, setCustomFieldRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetCustomFieldRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SetCustomFieldRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SetCustomFieldRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetCustomFieldRequest is not found in the empty JSON string", SetCustomFieldRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + RaasConfigData.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SetCustomFieldRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetCustomFieldRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SetCustomFieldRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetCustomFieldRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<SetCustomFieldRequest>() { + @Override + public void write(JsonWriter out, SetCustomFieldRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SetCustomFieldRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SetCustomFieldRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetCustomFieldRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetCustomFieldRequest + * @throws IOException if the JSON string is invalid with respect to SetCustomFieldRequest + */ + public static SetCustomFieldRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetCustomFieldRequest.class); + } + + /** + * Convert an instance of SetCustomFieldRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SetProvidersOrderRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SetProvidersOrderRequest.java new file mode 100644 index 0000000..2f1af2c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SetProvidersOrderRequest.java @@ -0,0 +1,298 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SetProvidersOrderRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SetProvidersOrderRequest { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<String> data = new ArrayList<>(); + + public SetProvidersOrderRequest() { + } + + public SetProvidersOrderRequest data(@javax.annotation.Nullable List<String> data) { + this.data = data; + return this; + } + + public SetProvidersOrderRequest addDataItem(String dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<String> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<String> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SetProvidersOrderRequest instance itself + */ + public SetProvidersOrderRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetProvidersOrderRequest setProvidersOrderRequest = (SetProvidersOrderRequest) o; + return Objects.equals(this.data, setProvidersOrderRequest.data)&& + Objects.equals(this.additionalProperties, setProvidersOrderRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetProvidersOrderRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SetProvidersOrderRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SetProvidersOrderRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetProvidersOrderRequest is not found in the empty JSON string", SetProvidersOrderRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull() && !jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SetProvidersOrderRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetProvidersOrderRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SetProvidersOrderRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetProvidersOrderRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<SetProvidersOrderRequest>() { + @Override + public void write(JsonWriter out, SetProvidersOrderRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SetProvidersOrderRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SetProvidersOrderRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetProvidersOrderRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetProvidersOrderRequest + * @throws IOException if the JSON string is invalid with respect to SetProvidersOrderRequest + */ + public static SetProvidersOrderRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetProvidersOrderRequest.class); + } + + /** + * Convert an instance of SetProvidersOrderRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SetProvidersStatus200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SetProvidersStatus200Response.java new file mode 100644 index 0000000..b16f4a5 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SetProvidersStatus200Response.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.Provider; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SetProvidersStatus200Response + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SetProvidersStatus200Response { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<Provider> data = new ArrayList<>(); + + public SetProvidersStatus200Response() { + } + + public SetProvidersStatus200Response data(@javax.annotation.Nullable List<Provider> data) { + this.data = data; + return this; + } + + public SetProvidersStatus200Response addDataItem(Provider dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<Provider> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<Provider> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SetProvidersStatus200Response instance itself + */ + public SetProvidersStatus200Response putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetProvidersStatus200Response setProvidersStatus200Response = (SetProvidersStatus200Response) o; + return Objects.equals(this.data, setProvidersStatus200Response.data)&& + Objects.equals(this.additionalProperties, setProvidersStatus200Response.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetProvidersStatus200Response {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SetProvidersStatus200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SetProvidersStatus200Response.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetProvidersStatus200Response is not found in the empty JSON string", SetProvidersStatus200Response.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + Provider.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SetProvidersStatus200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetProvidersStatus200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SetProvidersStatus200Response> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetProvidersStatus200Response.class)); + + return (TypeAdapter<T>) new TypeAdapter<SetProvidersStatus200Response>() { + @Override + public void write(JsonWriter out, SetProvidersStatus200Response value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SetProvidersStatus200Response read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SetProvidersStatus200Response instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetProvidersStatus200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetProvidersStatus200Response + * @throws IOException if the JSON string is invalid with respect to SetProvidersStatus200Response + */ + public static SetProvidersStatus200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetProvidersStatus200Response.class); + } + + /** + * Convert an instance of SetProvidersStatus200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SetUserNameRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SetUserNameRequest.java new file mode 100644 index 0000000..29ab761 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SetUserNameRequest.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * Structure of the request body for set or change username + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SetUserNameRequest { + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nonnull + private String username; + + public SetUserNameRequest() { + } + + public SetUserNameRequest username(@javax.annotation.Nonnull String username) { + this.username = username; + return this; + } + + /** + * The Username to change of the User + * @return username + */ + @javax.annotation.Nonnull + public String getUsername() { + return username; + } + + public void setUsername(@javax.annotation.Nonnull String username) { + this.username = username; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SetUserNameRequest instance itself + */ + public SetUserNameRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SetUserNameRequest setUserNameRequest = (SetUserNameRequest) o; + return Objects.equals(this.username, setUserNameRequest.username)&& + Objects.equals(this.additionalProperties, setUserNameRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(username, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SetUserNameRequest {\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("username"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("username"); + } + + /** + * 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 SetUserNameRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SetUserNameRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SetUserNameRequest is not found in the empty JSON string", SetUserNameRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SetUserNameRequest.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("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SetUserNameRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SetUserNameRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SetUserNameRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SetUserNameRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<SetUserNameRequest>() { + @Override + public void write(JsonWriter out, SetUserNameRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SetUserNameRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SetUserNameRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SetUserNameRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of SetUserNameRequest + * @throws IOException if the JSON string is invalid with respect to SetUserNameRequest + */ + public static SetUserNameRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SetUserNameRequest.class); + } + + /** + * Convert an instance of SetUserNameRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/ShopifyLoginUrlResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/ShopifyLoginUrlResponse.java new file mode 100644 index 0000000..025836f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/ShopifyLoginUrlResponse.java @@ -0,0 +1,287 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * ShopifyLoginUrlResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class ShopifyLoginUrlResponse { + public static final String SERIALIZED_NAME_URL = "url"; + @SerializedName(SERIALIZED_NAME_URL) + @javax.annotation.Nullable + private String url; + + public ShopifyLoginUrlResponse() { + } + + public ShopifyLoginUrlResponse url(@javax.annotation.Nullable String url) { + this.url = url; + return this; + } + + /** + * Shopify Multipass login URL for the customer. + * @return url + */ + @javax.annotation.Nullable + public String getUrl() { + return url; + } + + public void setUrl(@javax.annotation.Nullable String url) { + this.url = url; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the ShopifyLoginUrlResponse instance itself + */ + public ShopifyLoginUrlResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ShopifyLoginUrlResponse shopifyLoginUrlResponse = (ShopifyLoginUrlResponse) o; + return Objects.equals(this.url, shopifyLoginUrlResponse.url)&& + Objects.equals(this.additionalProperties, shopifyLoginUrlResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(url, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ShopifyLoginUrlResponse {\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("url"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 ShopifyLoginUrlResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!ShopifyLoginUrlResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in ShopifyLoginUrlResponse is not found in the empty JSON string", ShopifyLoginUrlResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("url") != null && !jsonObj.get("url").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!ShopifyLoginUrlResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'ShopifyLoginUrlResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<ShopifyLoginUrlResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(ShopifyLoginUrlResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<ShopifyLoginUrlResponse>() { + @Override + public void write(JsonWriter out, ShopifyLoginUrlResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public ShopifyLoginUrlResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + ShopifyLoginUrlResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of ShopifyLoginUrlResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of ShopifyLoginUrlResponse + * @throws IOException if the JSON string is invalid with respect to ShopifyLoginUrlResponse + */ + public static ShopifyLoginUrlResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, ShopifyLoginUrlResponse.class); + } + + /** + * Convert an instance of ShopifyLoginUrlResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SimpleUserProfileResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SimpleUserProfileResponse.java new file mode 100644 index 0000000..2082d8c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SimpleUserProfileResponse.java @@ -0,0 +1,463 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SimpleUserProfileResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SimpleUserProfileResponse { + public static final String SERIALIZED_NAME_ID = "_id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_DATE_CREATED = "DateCreated"; + @SerializedName(SERIALIZED_NAME_DATE_CREATED) + @javax.annotation.Nullable + private OffsetDateTime dateCreated; + + public static final String SERIALIZED_NAME_DATE_MODIFIED = "DateModified"; + @SerializedName(SERIALIZED_NAME_DATE_MODIFIED) + @javax.annotation.Nullable + private OffsetDateTime dateModified; + + public static final String SERIALIZED_NAME_IS_ACTIVE = "IsActive"; + @SerializedName(SERIALIZED_NAME_IS_ACTIVE) + @javax.annotation.Nullable + private Boolean isActive; + + public static final String SERIALIZED_NAME_IS_DELETED = "IsDeleted"; + @SerializedName(SERIALIZED_NAME_IS_DELETED) + @javax.annotation.Nullable + private Boolean isDeleted; + + public static final String SERIALIZED_NAME_CUSTOM_OBJECT = "CustomObject"; + @SerializedName(SERIALIZED_NAME_CUSTOM_OBJECT) + @javax.annotation.Nullable + private Map<String, Object> customObject = new HashMap<>(); + + public static final String SERIALIZED_NAME_UID = "Uid"; + @SerializedName(SERIALIZED_NAME_UID) + @javax.annotation.Nullable + private String uid; + + public SimpleUserProfileResponse() { + } + + public SimpleUserProfileResponse id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Unique identifier for the User profile + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public SimpleUserProfileResponse dateCreated(@javax.annotation.Nullable OffsetDateTime dateCreated) { + this.dateCreated = dateCreated; + return this; + } + + /** + * Date and time when the profile was created + * @return dateCreated + */ + @javax.annotation.Nullable + public OffsetDateTime getDateCreated() { + return dateCreated; + } + + public void setDateCreated(@javax.annotation.Nullable OffsetDateTime dateCreated) { + this.dateCreated = dateCreated; + } + + + public SimpleUserProfileResponse dateModified(@javax.annotation.Nullable OffsetDateTime dateModified) { + this.dateModified = dateModified; + return this; + } + + /** + * Date and time when the profile was last modified + * @return dateModified + */ + @javax.annotation.Nullable + public OffsetDateTime getDateModified() { + return dateModified; + } + + public void setDateModified(@javax.annotation.Nullable OffsetDateTime dateModified) { + this.dateModified = dateModified; + } + + + public SimpleUserProfileResponse isActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Whether the profile is active + * @return isActive + */ + @javax.annotation.Nullable + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + } + + + public SimpleUserProfileResponse isDeleted(@javax.annotation.Nullable Boolean isDeleted) { + this.isDeleted = isDeleted; + return this; + } + + /** + * Whether the profile is deleted + * @return isDeleted + */ + @javax.annotation.Nullable + public Boolean getIsDeleted() { + return isDeleted; + } + + public void setIsDeleted(@javax.annotation.Nullable Boolean isDeleted) { + this.isDeleted = isDeleted; + } + + + public SimpleUserProfileResponse customObject(@javax.annotation.Nullable Map<String, Object> customObject) { + this.customObject = customObject; + return this; + } + + public SimpleUserProfileResponse putCustomObjectItem(String key, Object customObjectItem) { + if (this.customObject == null) { + this.customObject = new HashMap<>(); + } + this.customObject.put(key, customObjectItem); + return this; + } + + /** + * Custom data associated with the User + * @return customObject + */ + @javax.annotation.Nullable + public Map<String, Object> getCustomObject() { + return customObject; + } + + public void setCustomObject(@javax.annotation.Nullable Map<String, Object> customObject) { + this.customObject = customObject; + } + + + public SimpleUserProfileResponse uid(@javax.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * Unique identifier of the User + * @return uid + */ + @javax.annotation.Nullable + public String getUid() { + return uid; + } + + public void setUid(@javax.annotation.Nullable String uid) { + this.uid = uid; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SimpleUserProfileResponse instance itself + */ + public SimpleUserProfileResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SimpleUserProfileResponse simpleUserProfileResponse = (SimpleUserProfileResponse) o; + return Objects.equals(this.id, simpleUserProfileResponse.id) && + Objects.equals(this.dateCreated, simpleUserProfileResponse.dateCreated) && + Objects.equals(this.dateModified, simpleUserProfileResponse.dateModified) && + Objects.equals(this.isActive, simpleUserProfileResponse.isActive) && + Objects.equals(this.isDeleted, simpleUserProfileResponse.isDeleted) && + Objects.equals(this.customObject, simpleUserProfileResponse.customObject) && + Objects.equals(this.uid, simpleUserProfileResponse.uid)&& + Objects.equals(this.additionalProperties, simpleUserProfileResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, dateCreated, dateModified, isActive, isDeleted, customObject, uid, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SimpleUserProfileResponse {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" dateCreated: ").append(toIndentedString(dateCreated)).append("\n"); + sb.append(" dateModified: ").append(toIndentedString(dateModified)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" isDeleted: ").append(toIndentedString(isDeleted)).append("\n"); + sb.append(" customObject: ").append(toIndentedString(customObject)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("_id"); + openapiFields.add("DateCreated"); + openapiFields.add("DateModified"); + openapiFields.add("IsActive"); + openapiFields.add("IsDeleted"); + openapiFields.add("CustomObject"); + openapiFields.add("Uid"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SimpleUserProfileResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SimpleUserProfileResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SimpleUserProfileResponse is not found in the empty JSON string", SimpleUserProfileResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("_id") != null && !jsonObj.get("_id").isJsonNull()) && !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("Uid") != null && !jsonObj.get("Uid").isJsonNull()) && !jsonObj.get("Uid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Uid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Uid").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SimpleUserProfileResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SimpleUserProfileResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SimpleUserProfileResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SimpleUserProfileResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<SimpleUserProfileResponse>() { + @Override + public void write(JsonWriter out, SimpleUserProfileResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SimpleUserProfileResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SimpleUserProfileResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SimpleUserProfileResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SimpleUserProfileResponse + * @throws IOException if the JSON string is invalid with respect to SimpleUserProfileResponse + */ + public static SimpleUserProfileResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SimpleUserProfileResponse.class); + } + + /** + * Convert an instance of SimpleUserProfileResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SmsTemplate.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SmsTemplate.java new file mode 100644 index 0000000..622b500 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SmsTemplate.java @@ -0,0 +1,466 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SmsTemplate + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SmsTemplate { + /** + * The type of the SMS template. + */ + @JsonAdapter(SmsTemplateTypeEnum.Adapter.class) + public enum SmsTemplateTypeEnum { + VERIFICATION("verification"), + + FORGOTPASSWORD("forgotpassword"), + + WELCOME("welcome"), + + CHANGEPHONENO("changephoneno"), + + ONETIMEPASSCODE("onetimepasscode"), + + SECONDFACTORAUTHENTICATION("secondfactorauthentication"), + + NOREGISTRATIONPASSWORDLESSLOGIN("noregistrationpasswordlesslogin"), + + RESETPASSWORD("resetpassword"), + + SUSPICIOUS_IP_SMS_TO_USER("suspicious_ip_sms_to_user"), + + SUSPICIOUS_CITY_SMS_TO_USER("suspicious_city_sms_to_user"), + + SUSPICIOUS_COUNTRY_SMS_TO_USER("suspicious_country_sms_to_user"), + + SUSPICIOUS_BROWSER_SMS_TO_USER("suspicious_browser_sms_to_user"), + + SUSPICIOUS_DEVICE_SMS_TO_USER("suspicious_device_sms_to_user"), + + FORGOTPIN("forgotpin"), + + DELETEUSER("deleteuser"), + + BREACHED_PASSWORD("breached_password"); + + private String value; + + SmsTemplateTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static SmsTemplateTypeEnum fromValue(String value) { + for (SmsTemplateTypeEnum b : SmsTemplateTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<SmsTemplateTypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final SmsTemplateTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public SmsTemplateTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return SmsTemplateTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + SmsTemplateTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_SMS_TEMPLATE_TYPE = "SmsTemplateType"; + @SerializedName(SERIALIZED_NAME_SMS_TEMPLATE_TYPE) + @javax.annotation.Nonnull + private SmsTemplateTypeEnum smsTemplateType; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nonnull + private String name; + + public static final String SERIALIZED_NAME_TEMPLATE = "Template"; + @SerializedName(SERIALIZED_NAME_TEMPLATE) + @javax.annotation.Nonnull + private String template; + + public static final String SERIALIZED_NAME_IS_DEFAULT = "IsDefault"; + @SerializedName(SERIALIZED_NAME_IS_DEFAULT) + @javax.annotation.Nullable + private Boolean isDefault = false; + + public SmsTemplate() { + } + + public SmsTemplate smsTemplateType(@javax.annotation.Nonnull SmsTemplateTypeEnum smsTemplateType) { + this.smsTemplateType = smsTemplateType; + return this; + } + + /** + * The type of the SMS template. + * @return smsTemplateType + */ + @javax.annotation.Nonnull + public SmsTemplateTypeEnum getSmsTemplateType() { + return smsTemplateType; + } + + public void setSmsTemplateType(@javax.annotation.Nonnull SmsTemplateTypeEnum smsTemplateType) { + this.smsTemplateType = smsTemplateType; + } + + + public SmsTemplate name(@javax.annotation.Nonnull String name) { + this.name = name; + return this; + } + + /** + * The name of the SMS template. + * @return name + */ + @javax.annotation.Nonnull + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nonnull String name) { + this.name = name; + } + + + public SmsTemplate template(@javax.annotation.Nonnull String template) { + this.template = template; + return this; + } + + /** + * The content of the SMS template. + * @return template + */ + @javax.annotation.Nonnull + public String getTemplate() { + return template; + } + + public void setTemplate(@javax.annotation.Nonnull String template) { + this.template = template; + } + + + public SmsTemplate isDefault(@javax.annotation.Nullable Boolean isDefault) { + this.isDefault = isDefault; + return this; + } + + /** + * Set to true to mark this template as the default for its SmsTemplateType. + * @return isDefault + */ + @javax.annotation.Nullable + public Boolean getIsDefault() { + return isDefault; + } + + public void setIsDefault(@javax.annotation.Nullable Boolean isDefault) { + this.isDefault = isDefault; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SmsTemplate instance itself + */ + public SmsTemplate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SmsTemplate smsTemplate = (SmsTemplate) o; + return Objects.equals(this.smsTemplateType, smsTemplate.smsTemplateType) && + Objects.equals(this.name, smsTemplate.name) && + Objects.equals(this.template, smsTemplate.template) && + Objects.equals(this.isDefault, smsTemplate.isDefault)&& + Objects.equals(this.additionalProperties, smsTemplate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(smsTemplateType, name, template, isDefault, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SmsTemplate {\n"); + sb.append(" smsTemplateType: ").append(toIndentedString(smsTemplateType)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" template: ").append(toIndentedString(template)).append("\n"); + sb.append(" isDefault: ").append(toIndentedString(isDefault)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("SmsTemplateType"); + openapiFields.add("Name"); + openapiFields.add("Template"); + openapiFields.add("IsDefault"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("SmsTemplateType"); + openapiRequiredFields.add("Name"); + openapiRequiredFields.add("Template"); + } + + /** + * 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 SmsTemplate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SmsTemplate.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SmsTemplate is not found in the empty JSON string", SmsTemplate.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SmsTemplate.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("SmsTemplateType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SmsTemplateType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SmsTemplateType").toString())); + } + // validate the required field `SmsTemplateType` + SmsTemplateTypeEnum.validateJsonElement(jsonObj.get("SmsTemplateType")); + 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("Template").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Template` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Template").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SmsTemplate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SmsTemplate' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SmsTemplate> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SmsTemplate.class)); + + return (TypeAdapter<T>) new TypeAdapter<SmsTemplate>() { + @Override + public void write(JsonWriter out, SmsTemplate value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SmsTemplate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SmsTemplate instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SmsTemplate given an JSON string + * + * @param jsonString JSON string + * @return An instance of SmsTemplate + * @throws IOException if the JSON string is invalid with respect to SmsTemplate + */ + public static SmsTemplate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SmsTemplate.class); + } + + /** + * Convert an instance of SmsTemplate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentity.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentity.java new file mode 100644 index 0000000..5a153c7 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentity.java @@ -0,0 +1,4404 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.SocialIdentityAddressesInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityAgeRange; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityAwardsInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityBadgesInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityBooksInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityCertificationsInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityCountry; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityCoursesInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityCurrentStatusInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityEducationsInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityEmailInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityFamilyInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityFavoriteThingsInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityGamesInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityIMAccountsInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityInspirationalPeopleInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityInterestsInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityJobBookmarksInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityKloutScore; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityLanguagesInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityMemberUrlResourcesInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityMoviesInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityMutualFriendsInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityPatentsInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityPhoneNumbersInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityPlacesLivedInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityPositionsInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityProjectsInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityProviderAccessCredential; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityPublicationsInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityRecommendationsReceivedInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityRelatedProfileViewsInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentitySkillsInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentitySportsInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentitySubscription; +import com.loginradius.sdk.internal.openapi.model.SocialIdentitySuggestions; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityTelevisionShowInner; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityVolunteerInner; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentity + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentity { + public static final String SERIALIZED_NAME_TOKEN_SIGN_SECRET = "TokenSignSecret"; + @SerializedName(SERIALIZED_NAME_TOKEN_SIGN_SECRET) + @javax.annotation.Nullable + private Integer tokenSignSecret; + + public static final String SERIALIZED_NAME_FIRST_LOGIN = "FirstLogin"; + @SerializedName(SERIALIZED_NAME_FIRST_LOGIN) + @javax.annotation.Nullable + private Boolean firstLogin; + + public static final String SERIALIZED_NAME_IS_PROTECTED = "IsProtected"; + @SerializedName(SERIALIZED_NAME_IS_PROTECTED) + @javax.annotation.Nullable + private Boolean isProtected; + + public static final String SERIALIZED_NAME_HIREABLE = "Hireable"; + @SerializedName(SERIALIZED_NAME_HIREABLE) + @javax.annotation.Nullable + private Boolean hireable; + + public static final String SERIALIZED_NAME_FOLLOWERS_COUNT = "FollowersCount"; + @SerializedName(SERIALIZED_NAME_FOLLOWERS_COUNT) + @javax.annotation.Nullable + private Integer followersCount; + + public static final String SERIALIZED_NAME_FRIENDS_COUNT = "FriendsCount"; + @SerializedName(SERIALIZED_NAME_FRIENDS_COUNT) + @javax.annotation.Nullable + private Integer friendsCount; + + public static final String SERIALIZED_NAME_TOTAL_STATUSES_COUNT = "TotalStatusesCount"; + @SerializedName(SERIALIZED_NAME_TOTAL_STATUSES_COUNT) + @javax.annotation.Nullable + private Integer totalStatusesCount; + + public static final String SERIALIZED_NAME_NUM_RECOMMENDERS = "NumRecommenders"; + @SerializedName(SERIALIZED_NAME_NUM_RECOMMENDERS) + @javax.annotation.Nullable + private Integer numRecommenders; + + public static final String SERIALIZED_NAME_TOTAL_PRIVATE_REPOSITORY = "TotalPrivateRepository"; + @SerializedName(SERIALIZED_NAME_TOTAL_PRIVATE_REPOSITORY) + @javax.annotation.Nullable + private Integer totalPrivateRepository; + + public static final String SERIALIZED_NAME_PUBLIC_GISTS = "PublicGists"; + @SerializedName(SERIALIZED_NAME_PUBLIC_GISTS) + @javax.annotation.Nullable + private Integer publicGists; + + public static final String SERIALIZED_NAME_PRIVATE_GISTS = "PrivateGists"; + @SerializedName(SERIALIZED_NAME_PRIVATE_GISTS) + @javax.annotation.Nullable + private Integer privateGists; + + public static final String SERIALIZED_NAME_PINS_COUNT = "PinsCount"; + @SerializedName(SERIALIZED_NAME_PINS_COUNT) + @javax.annotation.Nullable + private Integer pinsCount; + + public static final String SERIALIZED_NAME_BOARDS_COUNT = "BoardsCount"; + @SerializedName(SERIALIZED_NAME_BOARDS_COUNT) + @javax.annotation.Nullable + private Integer boardsCount; + + public static final String SERIALIZED_NAME_LIKES_COUNT = "LikesCount"; + @SerializedName(SERIALIZED_NAME_LIKES_COUNT) + @javax.annotation.Nullable + private Integer likesCount; + + public static final String SERIALIZED_NAME_SESSION_LIMIT = "SessionLimit"; + @SerializedName(SERIALIZED_NAME_SESSION_LIMIT) + @javax.annotation.Nullable + private Integer sessionLimit; + + public static final String SERIALIZED_NAME_I_D = "ID"; + @SerializedName(SERIALIZED_NAME_I_D) + @javax.annotation.Nullable + private String ID; + + public static final String SERIALIZED_NAME_PROVIDER = "Provider"; + @SerializedName(SERIALIZED_NAME_PROVIDER) + @javax.annotation.Nullable + private String provider; + + 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_FIRST_NAME = "FirstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nullable + private String firstName; + + public static final String SERIALIZED_NAME_LAST_NAME = "LastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nullable + private String lastName; + + public static final String SERIALIZED_NAME_PHONE_ID = "PhoneId"; + @SerializedName(SERIALIZED_NAME_PHONE_ID) + @javax.annotation.Nullable + private String phoneId; + + public static final String SERIALIZED_NAME_PREFIX = "Prefix"; + @SerializedName(SERIALIZED_NAME_PREFIX) + @javax.annotation.Nullable + private String prefix; + + public static final String SERIALIZED_NAME_MIDDLE_NAME = "MiddleName"; + @SerializedName(SERIALIZED_NAME_MIDDLE_NAME) + @javax.annotation.Nullable + private String middleName; + + public static final String SERIALIZED_NAME_SUFFIX = "Suffix"; + @SerializedName(SERIALIZED_NAME_SUFFIX) + @javax.annotation.Nullable + private String suffix; + + public static final String SERIALIZED_NAME_NICK_NAME = "NickName"; + @SerializedName(SERIALIZED_NAME_NICK_NAME) + @javax.annotation.Nullable + private String nickName; + + public static final String SERIALIZED_NAME_PROFILE_NAME = "ProfileName"; + @SerializedName(SERIALIZED_NAME_PROFILE_NAME) + @javax.annotation.Nullable + private String profileName; + + public static final String SERIALIZED_NAME_BIRTH_DATE = "BirthDate"; + @SerializedName(SERIALIZED_NAME_BIRTH_DATE) + @javax.annotation.Nullable + private String birthDate; + + public static final String SERIALIZED_NAME_GENDER = "Gender"; + @SerializedName(SERIALIZED_NAME_GENDER) + @javax.annotation.Nullable + private String gender; + + public static final String SERIALIZED_NAME_WEBSITE = "Website"; + @SerializedName(SERIALIZED_NAME_WEBSITE) + @javax.annotation.Nullable + private String website; + + public static final String SERIALIZED_NAME_THUMBNAIL_IMAGE_URL = "ThumbnailImageUrl"; + @SerializedName(SERIALIZED_NAME_THUMBNAIL_IMAGE_URL) + @javax.annotation.Nullable + private String thumbnailImageUrl; + + public static final String SERIALIZED_NAME_IMAGE_URL = "ImageUrl"; + @SerializedName(SERIALIZED_NAME_IMAGE_URL) + @javax.annotation.Nullable + private String imageUrl; + + public static final String SERIALIZED_NAME_FAVICON = "Favicon"; + @SerializedName(SERIALIZED_NAME_FAVICON) + @javax.annotation.Nullable + private String favicon; + + public static final String SERIALIZED_NAME_PROFILE_URL = "ProfileUrl"; + @SerializedName(SERIALIZED_NAME_PROFILE_URL) + @javax.annotation.Nullable + private String profileUrl; + + public static final String SERIALIZED_NAME_HOME_TOWN = "HomeTown"; + @SerializedName(SERIALIZED_NAME_HOME_TOWN) + @javax.annotation.Nullable + private String homeTown; + + public static final String SERIALIZED_NAME_STATE = "State"; + @SerializedName(SERIALIZED_NAME_STATE) + @javax.annotation.Nullable + private String state; + + public static final String SERIALIZED_NAME_CITY = "City"; + @SerializedName(SERIALIZED_NAME_CITY) + @javax.annotation.Nullable + private String city; + + public static final String SERIALIZED_NAME_INDUSTRY = "Industry"; + @SerializedName(SERIALIZED_NAME_INDUSTRY) + @javax.annotation.Nullable + private String industry; + + public static final String SERIALIZED_NAME_ABOUT = "About"; + @SerializedName(SERIALIZED_NAME_ABOUT) + @javax.annotation.Nullable + private String about; + + public static final String SERIALIZED_NAME_TIME_ZONE = "TimeZone"; + @SerializedName(SERIALIZED_NAME_TIME_ZONE) + @javax.annotation.Nullable + private String timeZone; + + public static final String SERIALIZED_NAME_LOCAL_LANGUAGE = "LocalLanguage"; + @SerializedName(SERIALIZED_NAME_LOCAL_LANGUAGE) + @javax.annotation.Nullable + private String localLanguage; + + public static final String SERIALIZED_NAME_COVER_PHOTO = "CoverPhoto"; + @SerializedName(SERIALIZED_NAME_COVER_PHOTO) + @javax.annotation.Nullable + private String coverPhoto; + + public static final String SERIALIZED_NAME_TAG_LINE = "TagLine"; + @SerializedName(SERIALIZED_NAME_TAG_LINE) + @javax.annotation.Nullable + private String tagLine; + + public static final String SERIALIZED_NAME_LANGUAGE = "Language"; + @SerializedName(SERIALIZED_NAME_LANGUAGE) + @javax.annotation.Nullable + private String language; + + public static final String SERIALIZED_NAME_VERIFIED = "Verified"; + @SerializedName(SERIALIZED_NAME_VERIFIED) + @javax.annotation.Nullable + private String verified; + + public static final String SERIALIZED_NAME_UPDATED_TIME = "UpdatedTime"; + @SerializedName(SERIALIZED_NAME_UPDATED_TIME) + @javax.annotation.Nullable + private String updatedTime; + + public static final String SERIALIZED_NAME_IS_GEO_ENABLED = "IsGeoEnabled"; + @SerializedName(SERIALIZED_NAME_IS_GEO_ENABLED) + @javax.annotation.Nullable + private String isGeoEnabled; + + public static final String SERIALIZED_NAME_ASSOCIATIONS = "Associations"; + @SerializedName(SERIALIZED_NAME_ASSOCIATIONS) + @javax.annotation.Nullable + private String associations; + + public static final String SERIALIZED_NAME_HONORS = "Honors"; + @SerializedName(SERIALIZED_NAME_HONORS) + @javax.annotation.Nullable + private String honors; + + public static final String SERIALIZED_NAME_HTTPS_IMAGE_URL = "HttpsImageUrl"; + @SerializedName(SERIALIZED_NAME_HTTPS_IMAGE_URL) + @javax.annotation.Nullable + private String httpsImageUrl; + + public static final String SERIALIZED_NAME_MAIN_ADDRESS = "MainAddress"; + @SerializedName(SERIALIZED_NAME_MAIN_ADDRESS) + @javax.annotation.Nullable + private String mainAddress; + + public static final String SERIALIZED_NAME_CREATED = "Created"; + @SerializedName(SERIALIZED_NAME_CREATED) + @javax.annotation.Nullable + private String created; + + public static final String SERIALIZED_NAME_LOCAL_CITY = "LocalCity"; + @SerializedName(SERIALIZED_NAME_LOCAL_CITY) + @javax.annotation.Nullable + private String localCity; + + public static final String SERIALIZED_NAME_PROFILE_CITY = "ProfileCity"; + @SerializedName(SERIALIZED_NAME_PROFILE_CITY) + @javax.annotation.Nullable + private String profileCity; + + public static final String SERIALIZED_NAME_LOCAL_COUNTRY = "LocalCountry"; + @SerializedName(SERIALIZED_NAME_LOCAL_COUNTRY) + @javax.annotation.Nullable + private String localCountry; + + public static final String SERIALIZED_NAME_PROFILE_COUNTRY = "ProfileCountry"; + @SerializedName(SERIALIZED_NAME_PROFILE_COUNTRY) + @javax.annotation.Nullable + private String profileCountry; + + public static final String SERIALIZED_NAME_RELATIONSHIP_STATUS = "RelationshipStatus"; + @SerializedName(SERIALIZED_NAME_RELATIONSHIP_STATUS) + @javax.annotation.Nullable + private String relationshipStatus; + + public static final String SERIALIZED_NAME_QUOTA = "Quota"; + @SerializedName(SERIALIZED_NAME_QUOTA) + @javax.annotation.Nullable + private String quota; + + public static final String SERIALIZED_NAME_QUOTE = "Quote"; + @SerializedName(SERIALIZED_NAME_QUOTE) + @javax.annotation.Nullable + private String quote; + + public static final String SERIALIZED_NAME_RELIGION = "Religion"; + @SerializedName(SERIALIZED_NAME_RELIGION) + @javax.annotation.Nullable + private String religion; + + public static final String SERIALIZED_NAME_POLITICAL = "Political"; + @SerializedName(SERIALIZED_NAME_POLITICAL) + @javax.annotation.Nullable + private String political; + + public static final String SERIALIZED_NAME_PUBLIC_REPOSITORY = "PublicRepository"; + @SerializedName(SERIALIZED_NAME_PUBLIC_REPOSITORY) + @javax.annotation.Nullable + private String publicRepository; + + public static final String SERIALIZED_NAME_REPOSITORY_URL = "RepositoryUrl"; + @SerializedName(SERIALIZED_NAME_REPOSITORY_URL) + @javax.annotation.Nullable + private String repositoryUrl; + + public static final String SERIALIZED_NAME_AGE = "Age"; + @SerializedName(SERIALIZED_NAME_AGE) + @javax.annotation.Nullable + private String age; + + public static final String SERIALIZED_NAME_PROFESSIONAL_HEADLINE = "ProfessionalHeadline"; + @SerializedName(SERIALIZED_NAME_PROFESSIONAL_HEADLINE) + @javax.annotation.Nullable + private String professionalHeadline; + + public static final String SERIALIZED_NAME_LR_USER_I_D = "LRUserID"; + @SerializedName(SERIALIZED_NAME_LR_USER_I_D) + @javax.annotation.Nullable + private String lrUserID; + + public static final String SERIALIZED_NAME_CURRENCY = "Currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + @javax.annotation.Nullable + private String currency; + + public static final String SERIALIZED_NAME_STARRED_URL = "StarredUrl"; + @SerializedName(SERIALIZED_NAME_STARRED_URL) + @javax.annotation.Nullable + private String starredUrl; + + public static final String SERIALIZED_NAME_GISTS_URL = "GistsUrl"; + @SerializedName(SERIALIZED_NAME_GISTS_URL) + @javax.annotation.Nullable + private String gistsUrl; + + public static final String SERIALIZED_NAME_COMPANY = "Company"; + @SerializedName(SERIALIZED_NAME_COMPANY) + @javax.annotation.Nullable + private String company; + + public static final String SERIALIZED_NAME_GRAVATAR_IMAGE_URL = "GravatarImageUrl"; + @SerializedName(SERIALIZED_NAME_GRAVATAR_IMAGE_URL) + @javax.annotation.Nullable + private String gravatarImageUrl; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public static final String SERIALIZED_NAME_MODIFIED_DATE = "ModifiedDate"; + @SerializedName(SERIALIZED_NAME_MODIFIED_DATE) + @javax.annotation.Nullable + private OffsetDateTime modifiedDate; + + public static final String SERIALIZED_NAME_PROFILE_MODIFIED_DATE = "ProfileModifiedDate"; + @SerializedName(SERIALIZED_NAME_PROFILE_MODIFIED_DATE) + @javax.annotation.Nullable + private OffsetDateTime profileModifiedDate; + + public static final String SERIALIZED_NAME_LAST_LOGIN_DATE = "LastLoginDate"; + @SerializedName(SERIALIZED_NAME_LAST_LOGIN_DATE) + @javax.annotation.Nullable + private OffsetDateTime lastLoginDate; + + public static final String SERIALIZED_NAME_SIGNUP_DATE = "SignupDate"; + @SerializedName(SERIALIZED_NAME_SIGNUP_DATE) + @javax.annotation.Nullable + private OffsetDateTime signupDate; + + public static final String SERIALIZED_NAME_COUNTRY = "Country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + @javax.annotation.Nullable + private SocialIdentityCountry country; + + public static final String SERIALIZED_NAME_AGE_RANGE = "AgeRange"; + @SerializedName(SERIALIZED_NAME_AGE_RANGE) + @javax.annotation.Nullable + private SocialIdentityAgeRange ageRange; + + public static final String SERIALIZED_NAME_KLOUT_SCORE = "KloutScore"; + @SerializedName(SERIALIZED_NAME_KLOUT_SCORE) + @javax.annotation.Nullable + private SocialIdentityKloutScore kloutScore; + + public static final String SERIALIZED_NAME_SUGGESTIONS = "Suggestions"; + @SerializedName(SERIALIZED_NAME_SUGGESTIONS) + @javax.annotation.Nullable + private SocialIdentitySuggestions suggestions; + + public static final String SERIALIZED_NAME_SUBSCRIPTION = "Subscription"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION) + @javax.annotation.Nullable + private SocialIdentitySubscription subscription; + + public static final String SERIALIZED_NAME_PROVIDER_ACCESS_CREDENTIAL = "ProviderAccessCredential"; + @SerializedName(SERIALIZED_NAME_PROVIDER_ACCESS_CREDENTIAL) + @javax.annotation.Nullable + private SocialIdentityProviderAccessCredential providerAccessCredential; + + public static final String SERIALIZED_NAME_PROFILE_IMAGE_URLS = "ProfileImageUrls"; + @SerializedName(SERIALIZED_NAME_PROFILE_IMAGE_URLS) + @javax.annotation.Nullable + private Map<String, String> profileImageUrls; + + public static final String SERIALIZED_NAME_WEB_PROFILES = "WebProfiles"; + @SerializedName(SERIALIZED_NAME_WEB_PROFILES) + @javax.annotation.Nullable + private Map<String, String> webProfiles; + + public static final String SERIALIZED_NAME_PREVIOUS_UIDS = "PreviousUids"; + @SerializedName(SERIALIZED_NAME_PREVIOUS_UIDS) + @javax.annotation.Nullable + private List<String> previousUids; + + public static final String SERIALIZED_NAME_INTERESTED_IN = "InterestedIn"; + @SerializedName(SERIALIZED_NAME_INTERESTED_IN) + @javax.annotation.Nullable + private List<String> interestedIn; + + public static final String SERIALIZED_NAME_POSITIONS = "Positions"; + @SerializedName(SERIALIZED_NAME_POSITIONS) + @javax.annotation.Nullable + private List<SocialIdentityPositionsInner> positions; + + public static final String SERIALIZED_NAME_EDUCATIONS = "Educations"; + @SerializedName(SERIALIZED_NAME_EDUCATIONS) + @javax.annotation.Nullable + private List<SocialIdentityEducationsInner> educations; + + public static final String SERIALIZED_NAME_PHONE_NUMBERS = "PhoneNumbers"; + @SerializedName(SERIALIZED_NAME_PHONE_NUMBERS) + @javax.annotation.Nullable + private List<SocialIdentityPhoneNumbersInner> phoneNumbers; + + public static final String SERIALIZED_NAME_IM_ACCOUNTS = "IMAccounts"; + @SerializedName(SERIALIZED_NAME_IM_ACCOUNTS) + @javax.annotation.Nullable + private List<SocialIdentityIMAccountsInner> imAccounts; + + public static final String SERIALIZED_NAME_ADDRESSES = "Addresses"; + @SerializedName(SERIALIZED_NAME_ADDRESSES) + @javax.annotation.Nullable + private List<SocialIdentityAddressesInner> addresses; + + public static final String SERIALIZED_NAME_INTERESTS = "Interests"; + @SerializedName(SERIALIZED_NAME_INTERESTS) + @javax.annotation.Nullable + private List<SocialIdentityInterestsInner> interests; + + public static final String SERIALIZED_NAME_SPORTS = "Sports"; + @SerializedName(SERIALIZED_NAME_SPORTS) + @javax.annotation.Nullable + private List<SocialIdentitySportsInner> sports; + + public static final String SERIALIZED_NAME_INSPIRATIONAL_PEOPLE = "InspirationalPeople"; + @SerializedName(SERIALIZED_NAME_INSPIRATIONAL_PEOPLE) + @javax.annotation.Nullable + private List<SocialIdentityInspirationalPeopleInner> inspirationalPeople; + + public static final String SERIALIZED_NAME_AWARDS = "Awards"; + @SerializedName(SERIALIZED_NAME_AWARDS) + @javax.annotation.Nullable + private List<SocialIdentityAwardsInner> awards; + + public static final String SERIALIZED_NAME_SKILLS = "Skills"; + @SerializedName(SERIALIZED_NAME_SKILLS) + @javax.annotation.Nullable + private List<SocialIdentitySkillsInner> skills; + + public static final String SERIALIZED_NAME_CURRENT_STATUS = "CurrentStatus"; + @SerializedName(SERIALIZED_NAME_CURRENT_STATUS) + @javax.annotation.Nullable + private List<SocialIdentityCurrentStatusInner> currentStatus; + + public static final String SERIALIZED_NAME_CERTIFICATIONS = "Certifications"; + @SerializedName(SERIALIZED_NAME_CERTIFICATIONS) + @javax.annotation.Nullable + private List<SocialIdentityCertificationsInner> certifications; + + public static final String SERIALIZED_NAME_COURSES = "Courses"; + @SerializedName(SERIALIZED_NAME_COURSES) + @javax.annotation.Nullable + private List<SocialIdentityCoursesInner> courses; + + public static final String SERIALIZED_NAME_VOLUNTEER = "Volunteer"; + @SerializedName(SERIALIZED_NAME_VOLUNTEER) + @javax.annotation.Nullable + private List<SocialIdentityVolunteerInner> volunteer; + + public static final String SERIALIZED_NAME_RECOMMENDATIONS_RECEIVED = "RecommendationsReceived"; + @SerializedName(SERIALIZED_NAME_RECOMMENDATIONS_RECEIVED) + @javax.annotation.Nullable + private List<SocialIdentityRecommendationsReceivedInner> recommendationsReceived; + + public static final String SERIALIZED_NAME_LANGUAGES = "Languages"; + @SerializedName(SERIALIZED_NAME_LANGUAGES) + @javax.annotation.Nullable + private List<SocialIdentityLanguagesInner> languages; + + public static final String SERIALIZED_NAME_PROJECTS = "Projects"; + @SerializedName(SERIALIZED_NAME_PROJECTS) + @javax.annotation.Nullable + private List<SocialIdentityProjectsInner> projects; + + public static final String SERIALIZED_NAME_GAMES = "Games"; + @SerializedName(SERIALIZED_NAME_GAMES) + @javax.annotation.Nullable + private List<SocialIdentityGamesInner> games; + + public static final String SERIALIZED_NAME_FAMILY = "Family"; + @SerializedName(SERIALIZED_NAME_FAMILY) + @javax.annotation.Nullable + private List<SocialIdentityFamilyInner> family; + + public static final String SERIALIZED_NAME_TELEVISION_SHOW = "TelevisionShow"; + @SerializedName(SERIALIZED_NAME_TELEVISION_SHOW) + @javax.annotation.Nullable + private List<SocialIdentityTelevisionShowInner> televisionShow; + + public static final String SERIALIZED_NAME_MUTUAL_FRIENDS = "MutualFriends"; + @SerializedName(SERIALIZED_NAME_MUTUAL_FRIENDS) + @javax.annotation.Nullable + private List<SocialIdentityMutualFriendsInner> mutualFriends; + + public static final String SERIALIZED_NAME_MOVIES = "Movies"; + @SerializedName(SERIALIZED_NAME_MOVIES) + @javax.annotation.Nullable + private List<SocialIdentityMoviesInner> movies; + + public static final String SERIALIZED_NAME_BOOKS = "Books"; + @SerializedName(SERIALIZED_NAME_BOOKS) + @javax.annotation.Nullable + private List<SocialIdentityBooksInner> books; + + public static final String SERIALIZED_NAME_PATENTS = "Patents"; + @SerializedName(SERIALIZED_NAME_PATENTS) + @javax.annotation.Nullable + private List<SocialIdentityPatentsInner> patents; + + public static final String SERIALIZED_NAME_FAVORITE_THINGS = "FavoriteThings"; + @SerializedName(SERIALIZED_NAME_FAVORITE_THINGS) + @javax.annotation.Nullable + private List<SocialIdentityFavoriteThingsInner> favoriteThings; + + public static final String SERIALIZED_NAME_RELATED_PROFILE_VIEWS = "RelatedProfileViews"; + @SerializedName(SERIALIZED_NAME_RELATED_PROFILE_VIEWS) + @javax.annotation.Nullable + private List<SocialIdentityRelatedProfileViewsInner> relatedProfileViews; + + public static final String SERIALIZED_NAME_PLACES_LIVED = "PlacesLived"; + @SerializedName(SERIALIZED_NAME_PLACES_LIVED) + @javax.annotation.Nullable + private List<SocialIdentityPlacesLivedInner> placesLived; + + public static final String SERIALIZED_NAME_PUBLICATIONS = "Publications"; + @SerializedName(SERIALIZED_NAME_PUBLICATIONS) + @javax.annotation.Nullable + private List<SocialIdentityPublicationsInner> publications; + + public static final String SERIALIZED_NAME_JOB_BOOKMARKS = "JobBookmarks"; + @SerializedName(SERIALIZED_NAME_JOB_BOOKMARKS) + @javax.annotation.Nullable + private List<SocialIdentityJobBookmarksInner> jobBookmarks; + + public static final String SERIALIZED_NAME_BADGES = "Badges"; + @SerializedName(SERIALIZED_NAME_BADGES) + @javax.annotation.Nullable + private List<SocialIdentityBadgesInner> badges; + + public static final String SERIALIZED_NAME_MEMBER_URL_RESOURCES = "MemberUrlResources"; + @SerializedName(SERIALIZED_NAME_MEMBER_URL_RESOURCES) + @javax.annotation.Nullable + private List<SocialIdentityMemberUrlResourcesInner> memberUrlResources; + + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private List<SocialIdentityEmailInner> email; + + public SocialIdentity() { + } + + public SocialIdentity tokenSignSecret(@javax.annotation.Nullable Integer tokenSignSecret) { + this.tokenSignSecret = tokenSignSecret; + return this; + } + + /** + * Get tokenSignSecret + * @return tokenSignSecret + */ + @javax.annotation.Nullable + public Integer getTokenSignSecret() { + return tokenSignSecret; + } + + public void setTokenSignSecret(@javax.annotation.Nullable Integer tokenSignSecret) { + this.tokenSignSecret = tokenSignSecret; + } + + + public SocialIdentity firstLogin(@javax.annotation.Nullable Boolean firstLogin) { + this.firstLogin = firstLogin; + return this; + } + + /** + * Get firstLogin + * @return firstLogin + */ + @javax.annotation.Nullable + public Boolean getFirstLogin() { + return firstLogin; + } + + public void setFirstLogin(@javax.annotation.Nullable Boolean firstLogin) { + this.firstLogin = firstLogin; + } + + + public SocialIdentity isProtected(@javax.annotation.Nullable Boolean isProtected) { + this.isProtected = isProtected; + return this; + } + + /** + * Get isProtected + * @return isProtected + */ + @javax.annotation.Nullable + public Boolean getIsProtected() { + return isProtected; + } + + public void setIsProtected(@javax.annotation.Nullable Boolean isProtected) { + this.isProtected = isProtected; + } + + + public SocialIdentity hireable(@javax.annotation.Nullable Boolean hireable) { + this.hireable = hireable; + return this; + } + + /** + * Get hireable + * @return hireable + */ + @javax.annotation.Nullable + public Boolean getHireable() { + return hireable; + } + + public void setHireable(@javax.annotation.Nullable Boolean hireable) { + this.hireable = hireable; + } + + + public SocialIdentity followersCount(@javax.annotation.Nullable Integer followersCount) { + this.followersCount = followersCount; + return this; + } + + /** + * Get followersCount + * @return followersCount + */ + @javax.annotation.Nullable + public Integer getFollowersCount() { + return followersCount; + } + + public void setFollowersCount(@javax.annotation.Nullable Integer followersCount) { + this.followersCount = followersCount; + } + + + public SocialIdentity friendsCount(@javax.annotation.Nullable Integer friendsCount) { + this.friendsCount = friendsCount; + return this; + } + + /** + * Get friendsCount + * @return friendsCount + */ + @javax.annotation.Nullable + public Integer getFriendsCount() { + return friendsCount; + } + + public void setFriendsCount(@javax.annotation.Nullable Integer friendsCount) { + this.friendsCount = friendsCount; + } + + + public SocialIdentity totalStatusesCount(@javax.annotation.Nullable Integer totalStatusesCount) { + this.totalStatusesCount = totalStatusesCount; + return this; + } + + /** + * Get totalStatusesCount + * @return totalStatusesCount + */ + @javax.annotation.Nullable + public Integer getTotalStatusesCount() { + return totalStatusesCount; + } + + public void setTotalStatusesCount(@javax.annotation.Nullable Integer totalStatusesCount) { + this.totalStatusesCount = totalStatusesCount; + } + + + public SocialIdentity numRecommenders(@javax.annotation.Nullable Integer numRecommenders) { + this.numRecommenders = numRecommenders; + return this; + } + + /** + * Get numRecommenders + * @return numRecommenders + */ + @javax.annotation.Nullable + public Integer getNumRecommenders() { + return numRecommenders; + } + + public void setNumRecommenders(@javax.annotation.Nullable Integer numRecommenders) { + this.numRecommenders = numRecommenders; + } + + + public SocialIdentity totalPrivateRepository(@javax.annotation.Nullable Integer totalPrivateRepository) { + this.totalPrivateRepository = totalPrivateRepository; + return this; + } + + /** + * Get totalPrivateRepository + * @return totalPrivateRepository + */ + @javax.annotation.Nullable + public Integer getTotalPrivateRepository() { + return totalPrivateRepository; + } + + public void setTotalPrivateRepository(@javax.annotation.Nullable Integer totalPrivateRepository) { + this.totalPrivateRepository = totalPrivateRepository; + } + + + public SocialIdentity publicGists(@javax.annotation.Nullable Integer publicGists) { + this.publicGists = publicGists; + return this; + } + + /** + * Get publicGists + * @return publicGists + */ + @javax.annotation.Nullable + public Integer getPublicGists() { + return publicGists; + } + + public void setPublicGists(@javax.annotation.Nullable Integer publicGists) { + this.publicGists = publicGists; + } + + + public SocialIdentity privateGists(@javax.annotation.Nullable Integer privateGists) { + this.privateGists = privateGists; + return this; + } + + /** + * Get privateGists + * @return privateGists + */ + @javax.annotation.Nullable + public Integer getPrivateGists() { + return privateGists; + } + + public void setPrivateGists(@javax.annotation.Nullable Integer privateGists) { + this.privateGists = privateGists; + } + + + public SocialIdentity pinsCount(@javax.annotation.Nullable Integer pinsCount) { + this.pinsCount = pinsCount; + return this; + } + + /** + * Get pinsCount + * @return pinsCount + */ + @javax.annotation.Nullable + public Integer getPinsCount() { + return pinsCount; + } + + public void setPinsCount(@javax.annotation.Nullable Integer pinsCount) { + this.pinsCount = pinsCount; + } + + + public SocialIdentity boardsCount(@javax.annotation.Nullable Integer boardsCount) { + this.boardsCount = boardsCount; + return this; + } + + /** + * Get boardsCount + * @return boardsCount + */ + @javax.annotation.Nullable + public Integer getBoardsCount() { + return boardsCount; + } + + public void setBoardsCount(@javax.annotation.Nullable Integer boardsCount) { + this.boardsCount = boardsCount; + } + + + public SocialIdentity likesCount(@javax.annotation.Nullable Integer likesCount) { + this.likesCount = likesCount; + return this; + } + + /** + * Get likesCount + * @return likesCount + */ + @javax.annotation.Nullable + public Integer getLikesCount() { + return likesCount; + } + + public void setLikesCount(@javax.annotation.Nullable Integer likesCount) { + this.likesCount = likesCount; + } + + + public SocialIdentity sessionLimit(@javax.annotation.Nullable Integer sessionLimit) { + this.sessionLimit = sessionLimit; + return this; + } + + /** + * Get sessionLimit + * @return sessionLimit + */ + @javax.annotation.Nullable + public Integer getSessionLimit() { + return sessionLimit; + } + + public void setSessionLimit(@javax.annotation.Nullable Integer sessionLimit) { + this.sessionLimit = sessionLimit; + } + + + public SocialIdentity ID(@javax.annotation.Nullable String ID) { + this.ID = ID; + return this; + } + + /** + * Get ID + * @return ID + */ + @javax.annotation.Nullable + public String getID() { + return ID; + } + + public void setID(@javax.annotation.Nullable String ID) { + this.ID = ID; + } + + + public SocialIdentity provider(@javax.annotation.Nullable String provider) { + this.provider = provider; + return this; + } + + /** + * Get provider + * @return provider + */ + @javax.annotation.Nullable + public String getProvider() { + return provider; + } + + public void setProvider(@javax.annotation.Nullable String provider) { + this.provider = provider; + } + + + public SocialIdentity fullName(@javax.annotation.Nullable String fullName) { + this.fullName = fullName; + return this; + } + + /** + * Get fullName + * @return fullName + */ + @javax.annotation.Nullable + public String getFullName() { + return fullName; + } + + public void setFullName(@javax.annotation.Nullable String fullName) { + this.fullName = fullName; + } + + + public SocialIdentity firstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + */ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + } + + + public SocialIdentity lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + + public SocialIdentity phoneId(@javax.annotation.Nullable String phoneId) { + this.phoneId = phoneId; + return this; + } + + /** + * Get phoneId + * @return phoneId + */ + @javax.annotation.Nullable + public String getPhoneId() { + return phoneId; + } + + public void setPhoneId(@javax.annotation.Nullable String phoneId) { + this.phoneId = phoneId; + } + + + public SocialIdentity prefix(@javax.annotation.Nullable String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Get prefix + * @return prefix + */ + @javax.annotation.Nullable + public String getPrefix() { + return prefix; + } + + public void setPrefix(@javax.annotation.Nullable String prefix) { + this.prefix = prefix; + } + + + public SocialIdentity middleName(@javax.annotation.Nullable String middleName) { + this.middleName = middleName; + return this; + } + + /** + * Get middleName + * @return middleName + */ + @javax.annotation.Nullable + public String getMiddleName() { + return middleName; + } + + public void setMiddleName(@javax.annotation.Nullable String middleName) { + this.middleName = middleName; + } + + + public SocialIdentity suffix(@javax.annotation.Nullable String suffix) { + this.suffix = suffix; + return this; + } + + /** + * Get suffix + * @return suffix + */ + @javax.annotation.Nullable + public String getSuffix() { + return suffix; + } + + public void setSuffix(@javax.annotation.Nullable String suffix) { + this.suffix = suffix; + } + + + public SocialIdentity nickName(@javax.annotation.Nullable String nickName) { + this.nickName = nickName; + return this; + } + + /** + * Get nickName + * @return nickName + */ + @javax.annotation.Nullable + public String getNickName() { + return nickName; + } + + public void setNickName(@javax.annotation.Nullable String nickName) { + this.nickName = nickName; + } + + + public SocialIdentity profileName(@javax.annotation.Nullable String profileName) { + this.profileName = profileName; + return this; + } + + /** + * Get profileName + * @return profileName + */ + @javax.annotation.Nullable + public String getProfileName() { + return profileName; + } + + public void setProfileName(@javax.annotation.Nullable String profileName) { + this.profileName = profileName; + } + + + public SocialIdentity birthDate(@javax.annotation.Nullable String birthDate) { + this.birthDate = birthDate; + return this; + } + + /** + * Get birthDate + * @return birthDate + */ + @javax.annotation.Nullable + public String getBirthDate() { + return birthDate; + } + + public void setBirthDate(@javax.annotation.Nullable String birthDate) { + this.birthDate = birthDate; + } + + + public SocialIdentity gender(@javax.annotation.Nullable String gender) { + this.gender = gender; + return this; + } + + /** + * Get gender + * @return gender + */ + @javax.annotation.Nullable + public String getGender() { + return gender; + } + + public void setGender(@javax.annotation.Nullable String gender) { + this.gender = gender; + } + + + public SocialIdentity website(@javax.annotation.Nullable String website) { + this.website = website; + return this; + } + + /** + * Get website + * @return website + */ + @javax.annotation.Nullable + public String getWebsite() { + return website; + } + + public void setWebsite(@javax.annotation.Nullable String website) { + this.website = website; + } + + + public SocialIdentity thumbnailImageUrl(@javax.annotation.Nullable String thumbnailImageUrl) { + this.thumbnailImageUrl = thumbnailImageUrl; + return this; + } + + /** + * Get thumbnailImageUrl + * @return thumbnailImageUrl + */ + @javax.annotation.Nullable + public String getThumbnailImageUrl() { + return thumbnailImageUrl; + } + + public void setThumbnailImageUrl(@javax.annotation.Nullable String thumbnailImageUrl) { + this.thumbnailImageUrl = thumbnailImageUrl; + } + + + public SocialIdentity imageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** + * Get imageUrl + * @return imageUrl + */ + @javax.annotation.Nullable + public String getImageUrl() { + return imageUrl; + } + + public void setImageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + } + + + public SocialIdentity favicon(@javax.annotation.Nullable String favicon) { + this.favicon = favicon; + return this; + } + + /** + * Get favicon + * @return favicon + */ + @javax.annotation.Nullable + public String getFavicon() { + return favicon; + } + + public void setFavicon(@javax.annotation.Nullable String favicon) { + this.favicon = favicon; + } + + + public SocialIdentity profileUrl(@javax.annotation.Nullable String profileUrl) { + this.profileUrl = profileUrl; + return this; + } + + /** + * Get profileUrl + * @return profileUrl + */ + @javax.annotation.Nullable + public String getProfileUrl() { + return profileUrl; + } + + public void setProfileUrl(@javax.annotation.Nullable String profileUrl) { + this.profileUrl = profileUrl; + } + + + public SocialIdentity homeTown(@javax.annotation.Nullable String homeTown) { + this.homeTown = homeTown; + return this; + } + + /** + * Get homeTown + * @return homeTown + */ + @javax.annotation.Nullable + public String getHomeTown() { + return homeTown; + } + + public void setHomeTown(@javax.annotation.Nullable String homeTown) { + this.homeTown = homeTown; + } + + + public SocialIdentity state(@javax.annotation.Nullable String state) { + this.state = state; + return this; + } + + /** + * Get state + * @return state + */ + @javax.annotation.Nullable + public String getState() { + return state; + } + + public void setState(@javax.annotation.Nullable String state) { + this.state = state; + } + + + public SocialIdentity city(@javax.annotation.Nullable String city) { + this.city = city; + return this; + } + + /** + * Get city + * @return city + */ + @javax.annotation.Nullable + public String getCity() { + return city; + } + + public void setCity(@javax.annotation.Nullable String city) { + this.city = city; + } + + + public SocialIdentity industry(@javax.annotation.Nullable String industry) { + this.industry = industry; + return this; + } + + /** + * Get industry + * @return industry + */ + @javax.annotation.Nullable + public String getIndustry() { + return industry; + } + + public void setIndustry(@javax.annotation.Nullable String industry) { + this.industry = industry; + } + + + public SocialIdentity about(@javax.annotation.Nullable String about) { + this.about = about; + return this; + } + + /** + * Get about + * @return about + */ + @javax.annotation.Nullable + public String getAbout() { + return about; + } + + public void setAbout(@javax.annotation.Nullable String about) { + this.about = about; + } + + + public SocialIdentity timeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * Get timeZone + * @return timeZone + */ + @javax.annotation.Nullable + public String getTimeZone() { + return timeZone; + } + + public void setTimeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + } + + + public SocialIdentity localLanguage(@javax.annotation.Nullable String localLanguage) { + this.localLanguage = localLanguage; + return this; + } + + /** + * Get localLanguage + * @return localLanguage + */ + @javax.annotation.Nullable + public String getLocalLanguage() { + return localLanguage; + } + + public void setLocalLanguage(@javax.annotation.Nullable String localLanguage) { + this.localLanguage = localLanguage; + } + + + public SocialIdentity coverPhoto(@javax.annotation.Nullable String coverPhoto) { + this.coverPhoto = coverPhoto; + return this; + } + + /** + * Get coverPhoto + * @return coverPhoto + */ + @javax.annotation.Nullable + public String getCoverPhoto() { + return coverPhoto; + } + + public void setCoverPhoto(@javax.annotation.Nullable String coverPhoto) { + this.coverPhoto = coverPhoto; + } + + + public SocialIdentity tagLine(@javax.annotation.Nullable String tagLine) { + this.tagLine = tagLine; + return this; + } + + /** + * Get tagLine + * @return tagLine + */ + @javax.annotation.Nullable + public String getTagLine() { + return tagLine; + } + + public void setTagLine(@javax.annotation.Nullable String tagLine) { + this.tagLine = tagLine; + } + + + public SocialIdentity language(@javax.annotation.Nullable String language) { + this.language = language; + return this; + } + + /** + * Get language + * @return language + */ + @javax.annotation.Nullable + public String getLanguage() { + return language; + } + + public void setLanguage(@javax.annotation.Nullable String language) { + this.language = language; + } + + + public SocialIdentity verified(@javax.annotation.Nullable String verified) { + this.verified = verified; + return this; + } + + /** + * Get verified + * @return verified + */ + @javax.annotation.Nullable + public String getVerified() { + return verified; + } + + public void setVerified(@javax.annotation.Nullable String verified) { + this.verified = verified; + } + + + public SocialIdentity updatedTime(@javax.annotation.Nullable String updatedTime) { + this.updatedTime = updatedTime; + return this; + } + + /** + * Get updatedTime + * @return updatedTime + */ + @javax.annotation.Nullable + public String getUpdatedTime() { + return updatedTime; + } + + public void setUpdatedTime(@javax.annotation.Nullable String updatedTime) { + this.updatedTime = updatedTime; + } + + + public SocialIdentity isGeoEnabled(@javax.annotation.Nullable String isGeoEnabled) { + this.isGeoEnabled = isGeoEnabled; + return this; + } + + /** + * Get isGeoEnabled + * @return isGeoEnabled + */ + @javax.annotation.Nullable + public String getIsGeoEnabled() { + return isGeoEnabled; + } + + public void setIsGeoEnabled(@javax.annotation.Nullable String isGeoEnabled) { + this.isGeoEnabled = isGeoEnabled; + } + + + public SocialIdentity associations(@javax.annotation.Nullable String associations) { + this.associations = associations; + return this; + } + + /** + * Get associations + * @return associations + */ + @javax.annotation.Nullable + public String getAssociations() { + return associations; + } + + public void setAssociations(@javax.annotation.Nullable String associations) { + this.associations = associations; + } + + + public SocialIdentity honors(@javax.annotation.Nullable String honors) { + this.honors = honors; + return this; + } + + /** + * Get honors + * @return honors + */ + @javax.annotation.Nullable + public String getHonors() { + return honors; + } + + public void setHonors(@javax.annotation.Nullable String honors) { + this.honors = honors; + } + + + public SocialIdentity httpsImageUrl(@javax.annotation.Nullable String httpsImageUrl) { + this.httpsImageUrl = httpsImageUrl; + return this; + } + + /** + * Get httpsImageUrl + * @return httpsImageUrl + */ + @javax.annotation.Nullable + public String getHttpsImageUrl() { + return httpsImageUrl; + } + + public void setHttpsImageUrl(@javax.annotation.Nullable String httpsImageUrl) { + this.httpsImageUrl = httpsImageUrl; + } + + + public SocialIdentity mainAddress(@javax.annotation.Nullable String mainAddress) { + this.mainAddress = mainAddress; + return this; + } + + /** + * Get mainAddress + * @return mainAddress + */ + @javax.annotation.Nullable + public String getMainAddress() { + return mainAddress; + } + + public void setMainAddress(@javax.annotation.Nullable String mainAddress) { + this.mainAddress = mainAddress; + } + + + public SocialIdentity created(@javax.annotation.Nullable String created) { + this.created = created; + return this; + } + + /** + * Get created + * @return created + */ + @javax.annotation.Nullable + public String getCreated() { + return created; + } + + public void setCreated(@javax.annotation.Nullable String created) { + this.created = created; + } + + + public SocialIdentity localCity(@javax.annotation.Nullable String localCity) { + this.localCity = localCity; + return this; + } + + /** + * Get localCity + * @return localCity + */ + @javax.annotation.Nullable + public String getLocalCity() { + return localCity; + } + + public void setLocalCity(@javax.annotation.Nullable String localCity) { + this.localCity = localCity; + } + + + public SocialIdentity profileCity(@javax.annotation.Nullable String profileCity) { + this.profileCity = profileCity; + return this; + } + + /** + * Get profileCity + * @return profileCity + */ + @javax.annotation.Nullable + public String getProfileCity() { + return profileCity; + } + + public void setProfileCity(@javax.annotation.Nullable String profileCity) { + this.profileCity = profileCity; + } + + + public SocialIdentity localCountry(@javax.annotation.Nullable String localCountry) { + this.localCountry = localCountry; + return this; + } + + /** + * Get localCountry + * @return localCountry + */ + @javax.annotation.Nullable + public String getLocalCountry() { + return localCountry; + } + + public void setLocalCountry(@javax.annotation.Nullable String localCountry) { + this.localCountry = localCountry; + } + + + public SocialIdentity profileCountry(@javax.annotation.Nullable String profileCountry) { + this.profileCountry = profileCountry; + return this; + } + + /** + * Get profileCountry + * @return profileCountry + */ + @javax.annotation.Nullable + public String getProfileCountry() { + return profileCountry; + } + + public void setProfileCountry(@javax.annotation.Nullable String profileCountry) { + this.profileCountry = profileCountry; + } + + + public SocialIdentity relationshipStatus(@javax.annotation.Nullable String relationshipStatus) { + this.relationshipStatus = relationshipStatus; + return this; + } + + /** + * Get relationshipStatus + * @return relationshipStatus + */ + @javax.annotation.Nullable + public String getRelationshipStatus() { + return relationshipStatus; + } + + public void setRelationshipStatus(@javax.annotation.Nullable String relationshipStatus) { + this.relationshipStatus = relationshipStatus; + } + + + public SocialIdentity quota(@javax.annotation.Nullable String quota) { + this.quota = quota; + return this; + } + + /** + * Get quota + * @return quota + */ + @javax.annotation.Nullable + public String getQuota() { + return quota; + } + + public void setQuota(@javax.annotation.Nullable String quota) { + this.quota = quota; + } + + + public SocialIdentity quote(@javax.annotation.Nullable String quote) { + this.quote = quote; + return this; + } + + /** + * Get quote + * @return quote + */ + @javax.annotation.Nullable + public String getQuote() { + return quote; + } + + public void setQuote(@javax.annotation.Nullable String quote) { + this.quote = quote; + } + + + public SocialIdentity religion(@javax.annotation.Nullable String religion) { + this.religion = religion; + return this; + } + + /** + * Get religion + * @return religion + */ + @javax.annotation.Nullable + public String getReligion() { + return religion; + } + + public void setReligion(@javax.annotation.Nullable String religion) { + this.religion = religion; + } + + + public SocialIdentity political(@javax.annotation.Nullable String political) { + this.political = political; + return this; + } + + /** + * Get political + * @return political + */ + @javax.annotation.Nullable + public String getPolitical() { + return political; + } + + public void setPolitical(@javax.annotation.Nullable String political) { + this.political = political; + } + + + public SocialIdentity publicRepository(@javax.annotation.Nullable String publicRepository) { + this.publicRepository = publicRepository; + return this; + } + + /** + * Get publicRepository + * @return publicRepository + */ + @javax.annotation.Nullable + public String getPublicRepository() { + return publicRepository; + } + + public void setPublicRepository(@javax.annotation.Nullable String publicRepository) { + this.publicRepository = publicRepository; + } + + + public SocialIdentity repositoryUrl(@javax.annotation.Nullable String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + return this; + } + + /** + * Get repositoryUrl + * @return repositoryUrl + */ + @javax.annotation.Nullable + public String getRepositoryUrl() { + return repositoryUrl; + } + + public void setRepositoryUrl(@javax.annotation.Nullable String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + } + + + public SocialIdentity age(@javax.annotation.Nullable String age) { + this.age = age; + return this; + } + + /** + * Get age + * @return age + */ + @javax.annotation.Nullable + public String getAge() { + return age; + } + + public void setAge(@javax.annotation.Nullable String age) { + this.age = age; + } + + + public SocialIdentity professionalHeadline(@javax.annotation.Nullable String professionalHeadline) { + this.professionalHeadline = professionalHeadline; + return this; + } + + /** + * Get professionalHeadline + * @return professionalHeadline + */ + @javax.annotation.Nullable + public String getProfessionalHeadline() { + return professionalHeadline; + } + + public void setProfessionalHeadline(@javax.annotation.Nullable String professionalHeadline) { + this.professionalHeadline = professionalHeadline; + } + + + public SocialIdentity lrUserID(@javax.annotation.Nullable String lrUserID) { + this.lrUserID = lrUserID; + return this; + } + + /** + * Get lrUserID + * @return lrUserID + */ + @javax.annotation.Nullable + public String getLrUserID() { + return lrUserID; + } + + public void setLrUserID(@javax.annotation.Nullable String lrUserID) { + this.lrUserID = lrUserID; + } + + + public SocialIdentity currency(@javax.annotation.Nullable String currency) { + this.currency = currency; + return this; + } + + /** + * Get currency + * @return currency + */ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + public void setCurrency(@javax.annotation.Nullable String currency) { + this.currency = currency; + } + + + public SocialIdentity starredUrl(@javax.annotation.Nullable String starredUrl) { + this.starredUrl = starredUrl; + return this; + } + + /** + * Get starredUrl + * @return starredUrl + */ + @javax.annotation.Nullable + public String getStarredUrl() { + return starredUrl; + } + + public void setStarredUrl(@javax.annotation.Nullable String starredUrl) { + this.starredUrl = starredUrl; + } + + + public SocialIdentity gistsUrl(@javax.annotation.Nullable String gistsUrl) { + this.gistsUrl = gistsUrl; + return this; + } + + /** + * Get gistsUrl + * @return gistsUrl + */ + @javax.annotation.Nullable + public String getGistsUrl() { + return gistsUrl; + } + + public void setGistsUrl(@javax.annotation.Nullable String gistsUrl) { + this.gistsUrl = gistsUrl; + } + + + public SocialIdentity company(@javax.annotation.Nullable String company) { + this.company = company; + return this; + } + + /** + * Get company + * @return company + */ + @javax.annotation.Nullable + public String getCompany() { + return company; + } + + public void setCompany(@javax.annotation.Nullable String company) { + this.company = company; + } + + + public SocialIdentity gravatarImageUrl(@javax.annotation.Nullable String gravatarImageUrl) { + this.gravatarImageUrl = gravatarImageUrl; + return this; + } + + /** + * Get gravatarImageUrl + * @return gravatarImageUrl + */ + @javax.annotation.Nullable + public String getGravatarImageUrl() { + return gravatarImageUrl; + } + + public void setGravatarImageUrl(@javax.annotation.Nullable String gravatarImageUrl) { + this.gravatarImageUrl = gravatarImageUrl; + } + + + public SocialIdentity createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get createdDate + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + + public SocialIdentity modifiedDate(@javax.annotation.Nullable OffsetDateTime modifiedDate) { + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Get modifiedDate + * @return modifiedDate + */ + @javax.annotation.Nullable + public OffsetDateTime getModifiedDate() { + return modifiedDate; + } + + public void setModifiedDate(@javax.annotation.Nullable OffsetDateTime modifiedDate) { + this.modifiedDate = modifiedDate; + } + + + public SocialIdentity profileModifiedDate(@javax.annotation.Nullable OffsetDateTime profileModifiedDate) { + this.profileModifiedDate = profileModifiedDate; + return this; + } + + /** + * Get profileModifiedDate + * @return profileModifiedDate + */ + @javax.annotation.Nullable + public OffsetDateTime getProfileModifiedDate() { + return profileModifiedDate; + } + + public void setProfileModifiedDate(@javax.annotation.Nullable OffsetDateTime profileModifiedDate) { + this.profileModifiedDate = profileModifiedDate; + } + + + public SocialIdentity lastLoginDate(@javax.annotation.Nullable OffsetDateTime lastLoginDate) { + this.lastLoginDate = lastLoginDate; + return this; + } + + /** + * Get lastLoginDate + * @return lastLoginDate + */ + @javax.annotation.Nullable + public OffsetDateTime getLastLoginDate() { + return lastLoginDate; + } + + public void setLastLoginDate(@javax.annotation.Nullable OffsetDateTime lastLoginDate) { + this.lastLoginDate = lastLoginDate; + } + + + public SocialIdentity signupDate(@javax.annotation.Nullable OffsetDateTime signupDate) { + this.signupDate = signupDate; + return this; + } + + /** + * Get signupDate + * @return signupDate + */ + @javax.annotation.Nullable + public OffsetDateTime getSignupDate() { + return signupDate; + } + + public void setSignupDate(@javax.annotation.Nullable OffsetDateTime signupDate) { + this.signupDate = signupDate; + } + + + public SocialIdentity country(@javax.annotation.Nullable SocialIdentityCountry country) { + this.country = country; + return this; + } + + /** + * Get country + * @return country + */ + @javax.annotation.Nullable + public SocialIdentityCountry getCountry() { + return country; + } + + public void setCountry(@javax.annotation.Nullable SocialIdentityCountry country) { + this.country = country; + } + + + public SocialIdentity ageRange(@javax.annotation.Nullable SocialIdentityAgeRange ageRange) { + this.ageRange = ageRange; + return this; + } + + /** + * Get ageRange + * @return ageRange + */ + @javax.annotation.Nullable + public SocialIdentityAgeRange getAgeRange() { + return ageRange; + } + + public void setAgeRange(@javax.annotation.Nullable SocialIdentityAgeRange ageRange) { + this.ageRange = ageRange; + } + + + public SocialIdentity kloutScore(@javax.annotation.Nullable SocialIdentityKloutScore kloutScore) { + this.kloutScore = kloutScore; + return this; + } + + /** + * Get kloutScore + * @return kloutScore + */ + @javax.annotation.Nullable + public SocialIdentityKloutScore getKloutScore() { + return kloutScore; + } + + public void setKloutScore(@javax.annotation.Nullable SocialIdentityKloutScore kloutScore) { + this.kloutScore = kloutScore; + } + + + public SocialIdentity suggestions(@javax.annotation.Nullable SocialIdentitySuggestions suggestions) { + this.suggestions = suggestions; + return this; + } + + /** + * Get suggestions + * @return suggestions + */ + @javax.annotation.Nullable + public SocialIdentitySuggestions getSuggestions() { + return suggestions; + } + + public void setSuggestions(@javax.annotation.Nullable SocialIdentitySuggestions suggestions) { + this.suggestions = suggestions; + } + + + public SocialIdentity subscription(@javax.annotation.Nullable SocialIdentitySubscription subscription) { + this.subscription = subscription; + return this; + } + + /** + * Get subscription + * @return subscription + */ + @javax.annotation.Nullable + public SocialIdentitySubscription getSubscription() { + return subscription; + } + + public void setSubscription(@javax.annotation.Nullable SocialIdentitySubscription subscription) { + this.subscription = subscription; + } + + + public SocialIdentity providerAccessCredential(@javax.annotation.Nullable SocialIdentityProviderAccessCredential providerAccessCredential) { + this.providerAccessCredential = providerAccessCredential; + return this; + } + + /** + * Get providerAccessCredential + * @return providerAccessCredential + */ + @javax.annotation.Nullable + public SocialIdentityProviderAccessCredential getProviderAccessCredential() { + return providerAccessCredential; + } + + public void setProviderAccessCredential(@javax.annotation.Nullable SocialIdentityProviderAccessCredential providerAccessCredential) { + this.providerAccessCredential = providerAccessCredential; + } + + + public SocialIdentity profileImageUrls(@javax.annotation.Nullable Map<String, String> profileImageUrls) { + this.profileImageUrls = profileImageUrls; + return this; + } + + public SocialIdentity putProfileImageUrlsItem(String key, String profileImageUrlsItem) { + if (this.profileImageUrls == null) { + this.profileImageUrls = new HashMap<>(); + } + this.profileImageUrls.put(key, profileImageUrlsItem); + return this; + } + + /** + * Get profileImageUrls + * @return profileImageUrls + */ + @javax.annotation.Nullable + public Map<String, String> getProfileImageUrls() { + return profileImageUrls; + } + + public void setProfileImageUrls(@javax.annotation.Nullable Map<String, String> profileImageUrls) { + this.profileImageUrls = profileImageUrls; + } + + + public SocialIdentity webProfiles(@javax.annotation.Nullable Map<String, String> webProfiles) { + this.webProfiles = webProfiles; + return this; + } + + public SocialIdentity putWebProfilesItem(String key, String webProfilesItem) { + if (this.webProfiles == null) { + this.webProfiles = new HashMap<>(); + } + this.webProfiles.put(key, webProfilesItem); + return this; + } + + /** + * Get webProfiles + * @return webProfiles + */ + @javax.annotation.Nullable + public Map<String, String> getWebProfiles() { + return webProfiles; + } + + public void setWebProfiles(@javax.annotation.Nullable Map<String, String> webProfiles) { + this.webProfiles = webProfiles; + } + + + public SocialIdentity previousUids(@javax.annotation.Nullable List<String> previousUids) { + this.previousUids = previousUids; + return this; + } + + public SocialIdentity addPreviousUidsItem(String previousUidsItem) { + if (this.previousUids == null) { + this.previousUids = new ArrayList<>(); + } + this.previousUids.add(previousUidsItem); + return this; + } + + /** + * Get previousUids + * @return previousUids + */ + @javax.annotation.Nullable + public List<String> getPreviousUids() { + return previousUids; + } + + public void setPreviousUids(@javax.annotation.Nullable List<String> previousUids) { + this.previousUids = previousUids; + } + + + public SocialIdentity interestedIn(@javax.annotation.Nullable List<String> interestedIn) { + this.interestedIn = interestedIn; + return this; + } + + public SocialIdentity addInterestedInItem(String interestedInItem) { + if (this.interestedIn == null) { + this.interestedIn = new ArrayList<>(); + } + this.interestedIn.add(interestedInItem); + return this; + } + + /** + * Get interestedIn + * @return interestedIn + */ + @javax.annotation.Nullable + public List<String> getInterestedIn() { + return interestedIn; + } + + public void setInterestedIn(@javax.annotation.Nullable List<String> interestedIn) { + this.interestedIn = interestedIn; + } + + + public SocialIdentity positions(@javax.annotation.Nullable List<SocialIdentityPositionsInner> positions) { + this.positions = positions; + return this; + } + + public SocialIdentity addPositionsItem(SocialIdentityPositionsInner positionsItem) { + if (this.positions == null) { + this.positions = new ArrayList<>(); + } + this.positions.add(positionsItem); + return this; + } + + /** + * Get positions + * @return positions + */ + @javax.annotation.Nullable + public List<SocialIdentityPositionsInner> getPositions() { + return positions; + } + + public void setPositions(@javax.annotation.Nullable List<SocialIdentityPositionsInner> positions) { + this.positions = positions; + } + + + public SocialIdentity educations(@javax.annotation.Nullable List<SocialIdentityEducationsInner> educations) { + this.educations = educations; + return this; + } + + public SocialIdentity addEducationsItem(SocialIdentityEducationsInner educationsItem) { + if (this.educations == null) { + this.educations = new ArrayList<>(); + } + this.educations.add(educationsItem); + return this; + } + + /** + * Get educations + * @return educations + */ + @javax.annotation.Nullable + public List<SocialIdentityEducationsInner> getEducations() { + return educations; + } + + public void setEducations(@javax.annotation.Nullable List<SocialIdentityEducationsInner> educations) { + this.educations = educations; + } + + + public SocialIdentity phoneNumbers(@javax.annotation.Nullable List<SocialIdentityPhoneNumbersInner> phoneNumbers) { + this.phoneNumbers = phoneNumbers; + return this; + } + + public SocialIdentity addPhoneNumbersItem(SocialIdentityPhoneNumbersInner phoneNumbersItem) { + if (this.phoneNumbers == null) { + this.phoneNumbers = new ArrayList<>(); + } + this.phoneNumbers.add(phoneNumbersItem); + return this; + } + + /** + * Get phoneNumbers + * @return phoneNumbers + */ + @javax.annotation.Nullable + public List<SocialIdentityPhoneNumbersInner> getPhoneNumbers() { + return phoneNumbers; + } + + public void setPhoneNumbers(@javax.annotation.Nullable List<SocialIdentityPhoneNumbersInner> phoneNumbers) { + this.phoneNumbers = phoneNumbers; + } + + + public SocialIdentity imAccounts(@javax.annotation.Nullable List<SocialIdentityIMAccountsInner> imAccounts) { + this.imAccounts = imAccounts; + return this; + } + + public SocialIdentity addImAccountsItem(SocialIdentityIMAccountsInner imAccountsItem) { + if (this.imAccounts == null) { + this.imAccounts = new ArrayList<>(); + } + this.imAccounts.add(imAccountsItem); + return this; + } + + /** + * Get imAccounts + * @return imAccounts + */ + @javax.annotation.Nullable + public List<SocialIdentityIMAccountsInner> getImAccounts() { + return imAccounts; + } + + public void setImAccounts(@javax.annotation.Nullable List<SocialIdentityIMAccountsInner> imAccounts) { + this.imAccounts = imAccounts; + } + + + public SocialIdentity addresses(@javax.annotation.Nullable List<SocialIdentityAddressesInner> addresses) { + this.addresses = addresses; + return this; + } + + public SocialIdentity addAddressesItem(SocialIdentityAddressesInner addressesItem) { + if (this.addresses == null) { + this.addresses = new ArrayList<>(); + } + this.addresses.add(addressesItem); + return this; + } + + /** + * Get addresses + * @return addresses + */ + @javax.annotation.Nullable + public List<SocialIdentityAddressesInner> getAddresses() { + return addresses; + } + + public void setAddresses(@javax.annotation.Nullable List<SocialIdentityAddressesInner> addresses) { + this.addresses = addresses; + } + + + public SocialIdentity interests(@javax.annotation.Nullable List<SocialIdentityInterestsInner> interests) { + this.interests = interests; + return this; + } + + public SocialIdentity addInterestsItem(SocialIdentityInterestsInner interestsItem) { + if (this.interests == null) { + this.interests = new ArrayList<>(); + } + this.interests.add(interestsItem); + return this; + } + + /** + * Get interests + * @return interests + */ + @javax.annotation.Nullable + public List<SocialIdentityInterestsInner> getInterests() { + return interests; + } + + public void setInterests(@javax.annotation.Nullable List<SocialIdentityInterestsInner> interests) { + this.interests = interests; + } + + + public SocialIdentity sports(@javax.annotation.Nullable List<SocialIdentitySportsInner> sports) { + this.sports = sports; + return this; + } + + public SocialIdentity addSportsItem(SocialIdentitySportsInner sportsItem) { + if (this.sports == null) { + this.sports = new ArrayList<>(); + } + this.sports.add(sportsItem); + return this; + } + + /** + * Get sports + * @return sports + */ + @javax.annotation.Nullable + public List<SocialIdentitySportsInner> getSports() { + return sports; + } + + public void setSports(@javax.annotation.Nullable List<SocialIdentitySportsInner> sports) { + this.sports = sports; + } + + + public SocialIdentity inspirationalPeople(@javax.annotation.Nullable List<SocialIdentityInspirationalPeopleInner> inspirationalPeople) { + this.inspirationalPeople = inspirationalPeople; + return this; + } + + public SocialIdentity addInspirationalPeopleItem(SocialIdentityInspirationalPeopleInner inspirationalPeopleItem) { + if (this.inspirationalPeople == null) { + this.inspirationalPeople = new ArrayList<>(); + } + this.inspirationalPeople.add(inspirationalPeopleItem); + return this; + } + + /** + * Get inspirationalPeople + * @return inspirationalPeople + */ + @javax.annotation.Nullable + public List<SocialIdentityInspirationalPeopleInner> getInspirationalPeople() { + return inspirationalPeople; + } + + public void setInspirationalPeople(@javax.annotation.Nullable List<SocialIdentityInspirationalPeopleInner> inspirationalPeople) { + this.inspirationalPeople = inspirationalPeople; + } + + + public SocialIdentity awards(@javax.annotation.Nullable List<SocialIdentityAwardsInner> awards) { + this.awards = awards; + return this; + } + + public SocialIdentity addAwardsItem(SocialIdentityAwardsInner awardsItem) { + if (this.awards == null) { + this.awards = new ArrayList<>(); + } + this.awards.add(awardsItem); + return this; + } + + /** + * Get awards + * @return awards + */ + @javax.annotation.Nullable + public List<SocialIdentityAwardsInner> getAwards() { + return awards; + } + + public void setAwards(@javax.annotation.Nullable List<SocialIdentityAwardsInner> awards) { + this.awards = awards; + } + + + public SocialIdentity skills(@javax.annotation.Nullable List<SocialIdentitySkillsInner> skills) { + this.skills = skills; + return this; + } + + public SocialIdentity addSkillsItem(SocialIdentitySkillsInner skillsItem) { + if (this.skills == null) { + this.skills = new ArrayList<>(); + } + this.skills.add(skillsItem); + return this; + } + + /** + * Get skills + * @return skills + */ + @javax.annotation.Nullable + public List<SocialIdentitySkillsInner> getSkills() { + return skills; + } + + public void setSkills(@javax.annotation.Nullable List<SocialIdentitySkillsInner> skills) { + this.skills = skills; + } + + + public SocialIdentity currentStatus(@javax.annotation.Nullable List<SocialIdentityCurrentStatusInner> currentStatus) { + this.currentStatus = currentStatus; + return this; + } + + public SocialIdentity addCurrentStatusItem(SocialIdentityCurrentStatusInner currentStatusItem) { + if (this.currentStatus == null) { + this.currentStatus = new ArrayList<>(); + } + this.currentStatus.add(currentStatusItem); + return this; + } + + /** + * Get currentStatus + * @return currentStatus + */ + @javax.annotation.Nullable + public List<SocialIdentityCurrentStatusInner> getCurrentStatus() { + return currentStatus; + } + + public void setCurrentStatus(@javax.annotation.Nullable List<SocialIdentityCurrentStatusInner> currentStatus) { + this.currentStatus = currentStatus; + } + + + public SocialIdentity certifications(@javax.annotation.Nullable List<SocialIdentityCertificationsInner> certifications) { + this.certifications = certifications; + return this; + } + + public SocialIdentity addCertificationsItem(SocialIdentityCertificationsInner certificationsItem) { + if (this.certifications == null) { + this.certifications = new ArrayList<>(); + } + this.certifications.add(certificationsItem); + return this; + } + + /** + * Get certifications + * @return certifications + */ + @javax.annotation.Nullable + public List<SocialIdentityCertificationsInner> getCertifications() { + return certifications; + } + + public void setCertifications(@javax.annotation.Nullable List<SocialIdentityCertificationsInner> certifications) { + this.certifications = certifications; + } + + + public SocialIdentity courses(@javax.annotation.Nullable List<SocialIdentityCoursesInner> courses) { + this.courses = courses; + return this; + } + + public SocialIdentity addCoursesItem(SocialIdentityCoursesInner coursesItem) { + if (this.courses == null) { + this.courses = new ArrayList<>(); + } + this.courses.add(coursesItem); + return this; + } + + /** + * Get courses + * @return courses + */ + @javax.annotation.Nullable + public List<SocialIdentityCoursesInner> getCourses() { + return courses; + } + + public void setCourses(@javax.annotation.Nullable List<SocialIdentityCoursesInner> courses) { + this.courses = courses; + } + + + public SocialIdentity volunteer(@javax.annotation.Nullable List<SocialIdentityVolunteerInner> volunteer) { + this.volunteer = volunteer; + return this; + } + + public SocialIdentity addVolunteerItem(SocialIdentityVolunteerInner volunteerItem) { + if (this.volunteer == null) { + this.volunteer = new ArrayList<>(); + } + this.volunteer.add(volunteerItem); + return this; + } + + /** + * Get volunteer + * @return volunteer + */ + @javax.annotation.Nullable + public List<SocialIdentityVolunteerInner> getVolunteer() { + return volunteer; + } + + public void setVolunteer(@javax.annotation.Nullable List<SocialIdentityVolunteerInner> volunteer) { + this.volunteer = volunteer; + } + + + public SocialIdentity recommendationsReceived(@javax.annotation.Nullable List<SocialIdentityRecommendationsReceivedInner> recommendationsReceived) { + this.recommendationsReceived = recommendationsReceived; + return this; + } + + public SocialIdentity addRecommendationsReceivedItem(SocialIdentityRecommendationsReceivedInner recommendationsReceivedItem) { + if (this.recommendationsReceived == null) { + this.recommendationsReceived = new ArrayList<>(); + } + this.recommendationsReceived.add(recommendationsReceivedItem); + return this; + } + + /** + * Get recommendationsReceived + * @return recommendationsReceived + */ + @javax.annotation.Nullable + public List<SocialIdentityRecommendationsReceivedInner> getRecommendationsReceived() { + return recommendationsReceived; + } + + public void setRecommendationsReceived(@javax.annotation.Nullable List<SocialIdentityRecommendationsReceivedInner> recommendationsReceived) { + this.recommendationsReceived = recommendationsReceived; + } + + + public SocialIdentity languages(@javax.annotation.Nullable List<SocialIdentityLanguagesInner> languages) { + this.languages = languages; + return this; + } + + public SocialIdentity addLanguagesItem(SocialIdentityLanguagesInner languagesItem) { + if (this.languages == null) { + this.languages = new ArrayList<>(); + } + this.languages.add(languagesItem); + return this; + } + + /** + * Get languages + * @return languages + */ + @javax.annotation.Nullable + public List<SocialIdentityLanguagesInner> getLanguages() { + return languages; + } + + public void setLanguages(@javax.annotation.Nullable List<SocialIdentityLanguagesInner> languages) { + this.languages = languages; + } + + + public SocialIdentity projects(@javax.annotation.Nullable List<SocialIdentityProjectsInner> projects) { + this.projects = projects; + return this; + } + + public SocialIdentity addProjectsItem(SocialIdentityProjectsInner projectsItem) { + if (this.projects == null) { + this.projects = new ArrayList<>(); + } + this.projects.add(projectsItem); + return this; + } + + /** + * Get projects + * @return projects + */ + @javax.annotation.Nullable + public List<SocialIdentityProjectsInner> getProjects() { + return projects; + } + + public void setProjects(@javax.annotation.Nullable List<SocialIdentityProjectsInner> projects) { + this.projects = projects; + } + + + public SocialIdentity games(@javax.annotation.Nullable List<SocialIdentityGamesInner> games) { + this.games = games; + return this; + } + + public SocialIdentity addGamesItem(SocialIdentityGamesInner gamesItem) { + if (this.games == null) { + this.games = new ArrayList<>(); + } + this.games.add(gamesItem); + return this; + } + + /** + * Get games + * @return games + */ + @javax.annotation.Nullable + public List<SocialIdentityGamesInner> getGames() { + return games; + } + + public void setGames(@javax.annotation.Nullable List<SocialIdentityGamesInner> games) { + this.games = games; + } + + + public SocialIdentity family(@javax.annotation.Nullable List<SocialIdentityFamilyInner> family) { + this.family = family; + return this; + } + + public SocialIdentity addFamilyItem(SocialIdentityFamilyInner familyItem) { + if (this.family == null) { + this.family = new ArrayList<>(); + } + this.family.add(familyItem); + return this; + } + + /** + * Get family + * @return family + */ + @javax.annotation.Nullable + public List<SocialIdentityFamilyInner> getFamily() { + return family; + } + + public void setFamily(@javax.annotation.Nullable List<SocialIdentityFamilyInner> family) { + this.family = family; + } + + + public SocialIdentity televisionShow(@javax.annotation.Nullable List<SocialIdentityTelevisionShowInner> televisionShow) { + this.televisionShow = televisionShow; + return this; + } + + public SocialIdentity addTelevisionShowItem(SocialIdentityTelevisionShowInner televisionShowItem) { + if (this.televisionShow == null) { + this.televisionShow = new ArrayList<>(); + } + this.televisionShow.add(televisionShowItem); + return this; + } + + /** + * Get televisionShow + * @return televisionShow + */ + @javax.annotation.Nullable + public List<SocialIdentityTelevisionShowInner> getTelevisionShow() { + return televisionShow; + } + + public void setTelevisionShow(@javax.annotation.Nullable List<SocialIdentityTelevisionShowInner> televisionShow) { + this.televisionShow = televisionShow; + } + + + public SocialIdentity mutualFriends(@javax.annotation.Nullable List<SocialIdentityMutualFriendsInner> mutualFriends) { + this.mutualFriends = mutualFriends; + return this; + } + + public SocialIdentity addMutualFriendsItem(SocialIdentityMutualFriendsInner mutualFriendsItem) { + if (this.mutualFriends == null) { + this.mutualFriends = new ArrayList<>(); + } + this.mutualFriends.add(mutualFriendsItem); + return this; + } + + /** + * Get mutualFriends + * @return mutualFriends + */ + @javax.annotation.Nullable + public List<SocialIdentityMutualFriendsInner> getMutualFriends() { + return mutualFriends; + } + + public void setMutualFriends(@javax.annotation.Nullable List<SocialIdentityMutualFriendsInner> mutualFriends) { + this.mutualFriends = mutualFriends; + } + + + public SocialIdentity movies(@javax.annotation.Nullable List<SocialIdentityMoviesInner> movies) { + this.movies = movies; + return this; + } + + public SocialIdentity addMoviesItem(SocialIdentityMoviesInner moviesItem) { + if (this.movies == null) { + this.movies = new ArrayList<>(); + } + this.movies.add(moviesItem); + return this; + } + + /** + * Get movies + * @return movies + */ + @javax.annotation.Nullable + public List<SocialIdentityMoviesInner> getMovies() { + return movies; + } + + public void setMovies(@javax.annotation.Nullable List<SocialIdentityMoviesInner> movies) { + this.movies = movies; + } + + + public SocialIdentity books(@javax.annotation.Nullable List<SocialIdentityBooksInner> books) { + this.books = books; + return this; + } + + public SocialIdentity addBooksItem(SocialIdentityBooksInner booksItem) { + if (this.books == null) { + this.books = new ArrayList<>(); + } + this.books.add(booksItem); + return this; + } + + /** + * Get books + * @return books + */ + @javax.annotation.Nullable + public List<SocialIdentityBooksInner> getBooks() { + return books; + } + + public void setBooks(@javax.annotation.Nullable List<SocialIdentityBooksInner> books) { + this.books = books; + } + + + public SocialIdentity patents(@javax.annotation.Nullable List<SocialIdentityPatentsInner> patents) { + this.patents = patents; + return this; + } + + public SocialIdentity addPatentsItem(SocialIdentityPatentsInner patentsItem) { + if (this.patents == null) { + this.patents = new ArrayList<>(); + } + this.patents.add(patentsItem); + return this; + } + + /** + * Get patents + * @return patents + */ + @javax.annotation.Nullable + public List<SocialIdentityPatentsInner> getPatents() { + return patents; + } + + public void setPatents(@javax.annotation.Nullable List<SocialIdentityPatentsInner> patents) { + this.patents = patents; + } + + + public SocialIdentity favoriteThings(@javax.annotation.Nullable List<SocialIdentityFavoriteThingsInner> favoriteThings) { + this.favoriteThings = favoriteThings; + return this; + } + + public SocialIdentity addFavoriteThingsItem(SocialIdentityFavoriteThingsInner favoriteThingsItem) { + if (this.favoriteThings == null) { + this.favoriteThings = new ArrayList<>(); + } + this.favoriteThings.add(favoriteThingsItem); + return this; + } + + /** + * Get favoriteThings + * @return favoriteThings + */ + @javax.annotation.Nullable + public List<SocialIdentityFavoriteThingsInner> getFavoriteThings() { + return favoriteThings; + } + + public void setFavoriteThings(@javax.annotation.Nullable List<SocialIdentityFavoriteThingsInner> favoriteThings) { + this.favoriteThings = favoriteThings; + } + + + public SocialIdentity relatedProfileViews(@javax.annotation.Nullable List<SocialIdentityRelatedProfileViewsInner> relatedProfileViews) { + this.relatedProfileViews = relatedProfileViews; + return this; + } + + public SocialIdentity addRelatedProfileViewsItem(SocialIdentityRelatedProfileViewsInner relatedProfileViewsItem) { + if (this.relatedProfileViews == null) { + this.relatedProfileViews = new ArrayList<>(); + } + this.relatedProfileViews.add(relatedProfileViewsItem); + return this; + } + + /** + * Get relatedProfileViews + * @return relatedProfileViews + */ + @javax.annotation.Nullable + public List<SocialIdentityRelatedProfileViewsInner> getRelatedProfileViews() { + return relatedProfileViews; + } + + public void setRelatedProfileViews(@javax.annotation.Nullable List<SocialIdentityRelatedProfileViewsInner> relatedProfileViews) { + this.relatedProfileViews = relatedProfileViews; + } + + + public SocialIdentity placesLived(@javax.annotation.Nullable List<SocialIdentityPlacesLivedInner> placesLived) { + this.placesLived = placesLived; + return this; + } + + public SocialIdentity addPlacesLivedItem(SocialIdentityPlacesLivedInner placesLivedItem) { + if (this.placesLived == null) { + this.placesLived = new ArrayList<>(); + } + this.placesLived.add(placesLivedItem); + return this; + } + + /** + * Get placesLived + * @return placesLived + */ + @javax.annotation.Nullable + public List<SocialIdentityPlacesLivedInner> getPlacesLived() { + return placesLived; + } + + public void setPlacesLived(@javax.annotation.Nullable List<SocialIdentityPlacesLivedInner> placesLived) { + this.placesLived = placesLived; + } + + + public SocialIdentity publications(@javax.annotation.Nullable List<SocialIdentityPublicationsInner> publications) { + this.publications = publications; + return this; + } + + public SocialIdentity addPublicationsItem(SocialIdentityPublicationsInner publicationsItem) { + if (this.publications == null) { + this.publications = new ArrayList<>(); + } + this.publications.add(publicationsItem); + return this; + } + + /** + * Get publications + * @return publications + */ + @javax.annotation.Nullable + public List<SocialIdentityPublicationsInner> getPublications() { + return publications; + } + + public void setPublications(@javax.annotation.Nullable List<SocialIdentityPublicationsInner> publications) { + this.publications = publications; + } + + + public SocialIdentity jobBookmarks(@javax.annotation.Nullable List<SocialIdentityJobBookmarksInner> jobBookmarks) { + this.jobBookmarks = jobBookmarks; + return this; + } + + public SocialIdentity addJobBookmarksItem(SocialIdentityJobBookmarksInner jobBookmarksItem) { + if (this.jobBookmarks == null) { + this.jobBookmarks = new ArrayList<>(); + } + this.jobBookmarks.add(jobBookmarksItem); + return this; + } + + /** + * Get jobBookmarks + * @return jobBookmarks + */ + @javax.annotation.Nullable + public List<SocialIdentityJobBookmarksInner> getJobBookmarks() { + return jobBookmarks; + } + + public void setJobBookmarks(@javax.annotation.Nullable List<SocialIdentityJobBookmarksInner> jobBookmarks) { + this.jobBookmarks = jobBookmarks; + } + + + public SocialIdentity badges(@javax.annotation.Nullable List<SocialIdentityBadgesInner> badges) { + this.badges = badges; + return this; + } + + public SocialIdentity addBadgesItem(SocialIdentityBadgesInner badgesItem) { + if (this.badges == null) { + this.badges = new ArrayList<>(); + } + this.badges.add(badgesItem); + return this; + } + + /** + * Get badges + * @return badges + */ + @javax.annotation.Nullable + public List<SocialIdentityBadgesInner> getBadges() { + return badges; + } + + public void setBadges(@javax.annotation.Nullable List<SocialIdentityBadgesInner> badges) { + this.badges = badges; + } + + + public SocialIdentity memberUrlResources(@javax.annotation.Nullable List<SocialIdentityMemberUrlResourcesInner> memberUrlResources) { + this.memberUrlResources = memberUrlResources; + return this; + } + + public SocialIdentity addMemberUrlResourcesItem(SocialIdentityMemberUrlResourcesInner memberUrlResourcesItem) { + if (this.memberUrlResources == null) { + this.memberUrlResources = new ArrayList<>(); + } + this.memberUrlResources.add(memberUrlResourcesItem); + return this; + } + + /** + * Get memberUrlResources + * @return memberUrlResources + */ + @javax.annotation.Nullable + public List<SocialIdentityMemberUrlResourcesInner> getMemberUrlResources() { + return memberUrlResources; + } + + public void setMemberUrlResources(@javax.annotation.Nullable List<SocialIdentityMemberUrlResourcesInner> memberUrlResources) { + this.memberUrlResources = memberUrlResources; + } + + + public SocialIdentity email(@javax.annotation.Nullable List<SocialIdentityEmailInner> email) { + this.email = email; + return this; + } + + public SocialIdentity addEmailItem(SocialIdentityEmailInner emailItem) { + if (this.email == null) { + this.email = new ArrayList<>(); + } + this.email.add(emailItem); + return this; + } + + /** + * Get email + * @return email + */ + @javax.annotation.Nullable + public List<SocialIdentityEmailInner> getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable List<SocialIdentityEmailInner> email) { + this.email = email; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentity instance itself + */ + public SocialIdentity putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentity socialIdentity = (SocialIdentity) o; + return Objects.equals(this.tokenSignSecret, socialIdentity.tokenSignSecret) && + Objects.equals(this.firstLogin, socialIdentity.firstLogin) && + Objects.equals(this.isProtected, socialIdentity.isProtected) && + Objects.equals(this.hireable, socialIdentity.hireable) && + Objects.equals(this.followersCount, socialIdentity.followersCount) && + Objects.equals(this.friendsCount, socialIdentity.friendsCount) && + Objects.equals(this.totalStatusesCount, socialIdentity.totalStatusesCount) && + Objects.equals(this.numRecommenders, socialIdentity.numRecommenders) && + Objects.equals(this.totalPrivateRepository, socialIdentity.totalPrivateRepository) && + Objects.equals(this.publicGists, socialIdentity.publicGists) && + Objects.equals(this.privateGists, socialIdentity.privateGists) && + Objects.equals(this.pinsCount, socialIdentity.pinsCount) && + Objects.equals(this.boardsCount, socialIdentity.boardsCount) && + Objects.equals(this.likesCount, socialIdentity.likesCount) && + Objects.equals(this.sessionLimit, socialIdentity.sessionLimit) && + Objects.equals(this.ID, socialIdentity.ID) && + Objects.equals(this.provider, socialIdentity.provider) && + Objects.equals(this.fullName, socialIdentity.fullName) && + Objects.equals(this.firstName, socialIdentity.firstName) && + Objects.equals(this.lastName, socialIdentity.lastName) && + Objects.equals(this.phoneId, socialIdentity.phoneId) && + Objects.equals(this.prefix, socialIdentity.prefix) && + Objects.equals(this.middleName, socialIdentity.middleName) && + Objects.equals(this.suffix, socialIdentity.suffix) && + Objects.equals(this.nickName, socialIdentity.nickName) && + Objects.equals(this.profileName, socialIdentity.profileName) && + Objects.equals(this.birthDate, socialIdentity.birthDate) && + Objects.equals(this.gender, socialIdentity.gender) && + Objects.equals(this.website, socialIdentity.website) && + Objects.equals(this.thumbnailImageUrl, socialIdentity.thumbnailImageUrl) && + Objects.equals(this.imageUrl, socialIdentity.imageUrl) && + Objects.equals(this.favicon, socialIdentity.favicon) && + Objects.equals(this.profileUrl, socialIdentity.profileUrl) && + Objects.equals(this.homeTown, socialIdentity.homeTown) && + Objects.equals(this.state, socialIdentity.state) && + Objects.equals(this.city, socialIdentity.city) && + Objects.equals(this.industry, socialIdentity.industry) && + Objects.equals(this.about, socialIdentity.about) && + Objects.equals(this.timeZone, socialIdentity.timeZone) && + Objects.equals(this.localLanguage, socialIdentity.localLanguage) && + Objects.equals(this.coverPhoto, socialIdentity.coverPhoto) && + Objects.equals(this.tagLine, socialIdentity.tagLine) && + Objects.equals(this.language, socialIdentity.language) && + Objects.equals(this.verified, socialIdentity.verified) && + Objects.equals(this.updatedTime, socialIdentity.updatedTime) && + Objects.equals(this.isGeoEnabled, socialIdentity.isGeoEnabled) && + Objects.equals(this.associations, socialIdentity.associations) && + Objects.equals(this.honors, socialIdentity.honors) && + Objects.equals(this.httpsImageUrl, socialIdentity.httpsImageUrl) && + Objects.equals(this.mainAddress, socialIdentity.mainAddress) && + Objects.equals(this.created, socialIdentity.created) && + Objects.equals(this.localCity, socialIdentity.localCity) && + Objects.equals(this.profileCity, socialIdentity.profileCity) && + Objects.equals(this.localCountry, socialIdentity.localCountry) && + Objects.equals(this.profileCountry, socialIdentity.profileCountry) && + Objects.equals(this.relationshipStatus, socialIdentity.relationshipStatus) && + Objects.equals(this.quota, socialIdentity.quota) && + Objects.equals(this.quote, socialIdentity.quote) && + Objects.equals(this.religion, socialIdentity.religion) && + Objects.equals(this.political, socialIdentity.political) && + Objects.equals(this.publicRepository, socialIdentity.publicRepository) && + Objects.equals(this.repositoryUrl, socialIdentity.repositoryUrl) && + Objects.equals(this.age, socialIdentity.age) && + Objects.equals(this.professionalHeadline, socialIdentity.professionalHeadline) && + Objects.equals(this.lrUserID, socialIdentity.lrUserID) && + Objects.equals(this.currency, socialIdentity.currency) && + Objects.equals(this.starredUrl, socialIdentity.starredUrl) && + Objects.equals(this.gistsUrl, socialIdentity.gistsUrl) && + Objects.equals(this.company, socialIdentity.company) && + Objects.equals(this.gravatarImageUrl, socialIdentity.gravatarImageUrl) && + Objects.equals(this.createdDate, socialIdentity.createdDate) && + Objects.equals(this.modifiedDate, socialIdentity.modifiedDate) && + Objects.equals(this.profileModifiedDate, socialIdentity.profileModifiedDate) && + Objects.equals(this.lastLoginDate, socialIdentity.lastLoginDate) && + Objects.equals(this.signupDate, socialIdentity.signupDate) && + Objects.equals(this.country, socialIdentity.country) && + Objects.equals(this.ageRange, socialIdentity.ageRange) && + Objects.equals(this.kloutScore, socialIdentity.kloutScore) && + Objects.equals(this.suggestions, socialIdentity.suggestions) && + Objects.equals(this.subscription, socialIdentity.subscription) && + Objects.equals(this.providerAccessCredential, socialIdentity.providerAccessCredential) && + Objects.equals(this.profileImageUrls, socialIdentity.profileImageUrls) && + Objects.equals(this.webProfiles, socialIdentity.webProfiles) && + Objects.equals(this.previousUids, socialIdentity.previousUids) && + Objects.equals(this.interestedIn, socialIdentity.interestedIn) && + Objects.equals(this.positions, socialIdentity.positions) && + Objects.equals(this.educations, socialIdentity.educations) && + Objects.equals(this.phoneNumbers, socialIdentity.phoneNumbers) && + Objects.equals(this.imAccounts, socialIdentity.imAccounts) && + Objects.equals(this.addresses, socialIdentity.addresses) && + Objects.equals(this.interests, socialIdentity.interests) && + Objects.equals(this.sports, socialIdentity.sports) && + Objects.equals(this.inspirationalPeople, socialIdentity.inspirationalPeople) && + Objects.equals(this.awards, socialIdentity.awards) && + Objects.equals(this.skills, socialIdentity.skills) && + Objects.equals(this.currentStatus, socialIdentity.currentStatus) && + Objects.equals(this.certifications, socialIdentity.certifications) && + Objects.equals(this.courses, socialIdentity.courses) && + Objects.equals(this.volunteer, socialIdentity.volunteer) && + Objects.equals(this.recommendationsReceived, socialIdentity.recommendationsReceived) && + Objects.equals(this.languages, socialIdentity.languages) && + Objects.equals(this.projects, socialIdentity.projects) && + Objects.equals(this.games, socialIdentity.games) && + Objects.equals(this.family, socialIdentity.family) && + Objects.equals(this.televisionShow, socialIdentity.televisionShow) && + Objects.equals(this.mutualFriends, socialIdentity.mutualFriends) && + Objects.equals(this.movies, socialIdentity.movies) && + Objects.equals(this.books, socialIdentity.books) && + Objects.equals(this.patents, socialIdentity.patents) && + Objects.equals(this.favoriteThings, socialIdentity.favoriteThings) && + Objects.equals(this.relatedProfileViews, socialIdentity.relatedProfileViews) && + Objects.equals(this.placesLived, socialIdentity.placesLived) && + Objects.equals(this.publications, socialIdentity.publications) && + Objects.equals(this.jobBookmarks, socialIdentity.jobBookmarks) && + Objects.equals(this.badges, socialIdentity.badges) && + Objects.equals(this.memberUrlResources, socialIdentity.memberUrlResources) && + Objects.equals(this.email, socialIdentity.email)&& + Objects.equals(this.additionalProperties, socialIdentity.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(tokenSignSecret, firstLogin, isProtected, hireable, followersCount, friendsCount, totalStatusesCount, numRecommenders, totalPrivateRepository, publicGists, privateGists, pinsCount, boardsCount, likesCount, sessionLimit, ID, provider, fullName, firstName, lastName, phoneId, prefix, middleName, suffix, nickName, profileName, birthDate, gender, website, thumbnailImageUrl, imageUrl, favicon, profileUrl, homeTown, state, city, industry, about, timeZone, localLanguage, coverPhoto, tagLine, language, verified, updatedTime, isGeoEnabled, associations, honors, httpsImageUrl, mainAddress, created, localCity, profileCity, localCountry, profileCountry, relationshipStatus, quota, quote, religion, political, publicRepository, repositoryUrl, age, professionalHeadline, lrUserID, currency, starredUrl, gistsUrl, company, gravatarImageUrl, createdDate, modifiedDate, profileModifiedDate, lastLoginDate, signupDate, country, ageRange, kloutScore, suggestions, subscription, providerAccessCredential, profileImageUrls, webProfiles, previousUids, interestedIn, positions, educations, phoneNumbers, imAccounts, addresses, interests, sports, inspirationalPeople, awards, skills, currentStatus, certifications, courses, volunteer, recommendationsReceived, languages, projects, games, family, televisionShow, mutualFriends, movies, books, patents, favoriteThings, relatedProfileViews, placesLived, publications, jobBookmarks, badges, memberUrlResources, email, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentity {\n"); + sb.append(" tokenSignSecret: ").append(toIndentedString(tokenSignSecret)).append("\n"); + sb.append(" firstLogin: ").append(toIndentedString(firstLogin)).append("\n"); + sb.append(" isProtected: ").append(toIndentedString(isProtected)).append("\n"); + sb.append(" hireable: ").append(toIndentedString(hireable)).append("\n"); + sb.append(" followersCount: ").append(toIndentedString(followersCount)).append("\n"); + sb.append(" friendsCount: ").append(toIndentedString(friendsCount)).append("\n"); + sb.append(" totalStatusesCount: ").append(toIndentedString(totalStatusesCount)).append("\n"); + sb.append(" numRecommenders: ").append(toIndentedString(numRecommenders)).append("\n"); + sb.append(" totalPrivateRepository: ").append(toIndentedString(totalPrivateRepository)).append("\n"); + sb.append(" publicGists: ").append(toIndentedString(publicGists)).append("\n"); + sb.append(" privateGists: ").append(toIndentedString(privateGists)).append("\n"); + sb.append(" pinsCount: ").append(toIndentedString(pinsCount)).append("\n"); + sb.append(" boardsCount: ").append(toIndentedString(boardsCount)).append("\n"); + sb.append(" likesCount: ").append(toIndentedString(likesCount)).append("\n"); + sb.append(" sessionLimit: ").append(toIndentedString(sessionLimit)).append("\n"); + sb.append(" ID: ").append(toIndentedString(ID)).append("\n"); + sb.append(" provider: ").append(toIndentedString(provider)).append("\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" phoneId: ").append(toIndentedString(phoneId)).append("\n"); + sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n"); + sb.append(" middleName: ").append(toIndentedString(middleName)).append("\n"); + sb.append(" suffix: ").append(toIndentedString(suffix)).append("\n"); + sb.append(" nickName: ").append(toIndentedString(nickName)).append("\n"); + sb.append(" profileName: ").append(toIndentedString(profileName)).append("\n"); + sb.append(" birthDate: ").append(toIndentedString(birthDate)).append("\n"); + sb.append(" gender: ").append(toIndentedString(gender)).append("\n"); + sb.append(" website: ").append(toIndentedString(website)).append("\n"); + sb.append(" thumbnailImageUrl: ").append(toIndentedString(thumbnailImageUrl)).append("\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append(" favicon: ").append(toIndentedString(favicon)).append("\n"); + sb.append(" profileUrl: ").append(toIndentedString(profileUrl)).append("\n"); + sb.append(" homeTown: ").append(toIndentedString(homeTown)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" industry: ").append(toIndentedString(industry)).append("\n"); + sb.append(" about: ").append(toIndentedString(about)).append("\n"); + sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); + sb.append(" localLanguage: ").append(toIndentedString(localLanguage)).append("\n"); + sb.append(" coverPhoto: ").append(toIndentedString(coverPhoto)).append("\n"); + sb.append(" tagLine: ").append(toIndentedString(tagLine)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" verified: ").append(toIndentedString(verified)).append("\n"); + sb.append(" updatedTime: ").append(toIndentedString(updatedTime)).append("\n"); + sb.append(" isGeoEnabled: ").append(toIndentedString(isGeoEnabled)).append("\n"); + sb.append(" associations: ").append(toIndentedString(associations)).append("\n"); + sb.append(" honors: ").append(toIndentedString(honors)).append("\n"); + sb.append(" httpsImageUrl: ").append(toIndentedString(httpsImageUrl)).append("\n"); + sb.append(" mainAddress: ").append(toIndentedString(mainAddress)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" localCity: ").append(toIndentedString(localCity)).append("\n"); + sb.append(" profileCity: ").append(toIndentedString(profileCity)).append("\n"); + sb.append(" localCountry: ").append(toIndentedString(localCountry)).append("\n"); + sb.append(" profileCountry: ").append(toIndentedString(profileCountry)).append("\n"); + sb.append(" relationshipStatus: ").append(toIndentedString(relationshipStatus)).append("\n"); + sb.append(" quota: ").append(toIndentedString(quota)).append("\n"); + sb.append(" quote: ").append(toIndentedString(quote)).append("\n"); + sb.append(" religion: ").append(toIndentedString(religion)).append("\n"); + sb.append(" political: ").append(toIndentedString(political)).append("\n"); + sb.append(" publicRepository: ").append(toIndentedString(publicRepository)).append("\n"); + sb.append(" repositoryUrl: ").append(toIndentedString(repositoryUrl)).append("\n"); + sb.append(" age: ").append(toIndentedString(age)).append("\n"); + sb.append(" professionalHeadline: ").append(toIndentedString(professionalHeadline)).append("\n"); + sb.append(" lrUserID: ").append(toIndentedString(lrUserID)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" starredUrl: ").append(toIndentedString(starredUrl)).append("\n"); + sb.append(" gistsUrl: ").append(toIndentedString(gistsUrl)).append("\n"); + sb.append(" company: ").append(toIndentedString(company)).append("\n"); + sb.append(" gravatarImageUrl: ").append(toIndentedString(gravatarImageUrl)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" modifiedDate: ").append(toIndentedString(modifiedDate)).append("\n"); + sb.append(" profileModifiedDate: ").append(toIndentedString(profileModifiedDate)).append("\n"); + sb.append(" lastLoginDate: ").append(toIndentedString(lastLoginDate)).append("\n"); + sb.append(" signupDate: ").append(toIndentedString(signupDate)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" ageRange: ").append(toIndentedString(ageRange)).append("\n"); + sb.append(" kloutScore: ").append(toIndentedString(kloutScore)).append("\n"); + sb.append(" suggestions: ").append(toIndentedString(suggestions)).append("\n"); + sb.append(" subscription: ").append(toIndentedString(subscription)).append("\n"); + sb.append(" providerAccessCredential: ").append(toIndentedString(providerAccessCredential)).append("\n"); + sb.append(" profileImageUrls: ").append(toIndentedString(profileImageUrls)).append("\n"); + sb.append(" webProfiles: ").append(toIndentedString(webProfiles)).append("\n"); + sb.append(" previousUids: ").append(toIndentedString(previousUids)).append("\n"); + sb.append(" interestedIn: ").append(toIndentedString(interestedIn)).append("\n"); + sb.append(" positions: ").append(toIndentedString(positions)).append("\n"); + sb.append(" educations: ").append(toIndentedString(educations)).append("\n"); + sb.append(" phoneNumbers: ").append(toIndentedString(phoneNumbers)).append("\n"); + sb.append(" imAccounts: ").append(toIndentedString(imAccounts)).append("\n"); + sb.append(" addresses: ").append(toIndentedString(addresses)).append("\n"); + sb.append(" interests: ").append(toIndentedString(interests)).append("\n"); + sb.append(" sports: ").append(toIndentedString(sports)).append("\n"); + sb.append(" inspirationalPeople: ").append(toIndentedString(inspirationalPeople)).append("\n"); + sb.append(" awards: ").append(toIndentedString(awards)).append("\n"); + sb.append(" skills: ").append(toIndentedString(skills)).append("\n"); + sb.append(" currentStatus: ").append(toIndentedString(currentStatus)).append("\n"); + sb.append(" certifications: ").append(toIndentedString(certifications)).append("\n"); + sb.append(" courses: ").append(toIndentedString(courses)).append("\n"); + sb.append(" volunteer: ").append(toIndentedString(volunteer)).append("\n"); + sb.append(" recommendationsReceived: ").append(toIndentedString(recommendationsReceived)).append("\n"); + sb.append(" languages: ").append(toIndentedString(languages)).append("\n"); + sb.append(" projects: ").append(toIndentedString(projects)).append("\n"); + sb.append(" games: ").append(toIndentedString(games)).append("\n"); + sb.append(" family: ").append(toIndentedString(family)).append("\n"); + sb.append(" televisionShow: ").append(toIndentedString(televisionShow)).append("\n"); + sb.append(" mutualFriends: ").append(toIndentedString(mutualFriends)).append("\n"); + sb.append(" movies: ").append(toIndentedString(movies)).append("\n"); + sb.append(" books: ").append(toIndentedString(books)).append("\n"); + sb.append(" patents: ").append(toIndentedString(patents)).append("\n"); + sb.append(" favoriteThings: ").append(toIndentedString(favoriteThings)).append("\n"); + sb.append(" relatedProfileViews: ").append(toIndentedString(relatedProfileViews)).append("\n"); + sb.append(" placesLived: ").append(toIndentedString(placesLived)).append("\n"); + sb.append(" publications: ").append(toIndentedString(publications)).append("\n"); + sb.append(" jobBookmarks: ").append(toIndentedString(jobBookmarks)).append("\n"); + sb.append(" badges: ").append(toIndentedString(badges)).append("\n"); + sb.append(" memberUrlResources: ").append(toIndentedString(memberUrlResources)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("TokenSignSecret"); + openapiFields.add("FirstLogin"); + openapiFields.add("IsProtected"); + openapiFields.add("Hireable"); + openapiFields.add("FollowersCount"); + openapiFields.add("FriendsCount"); + openapiFields.add("TotalStatusesCount"); + openapiFields.add("NumRecommenders"); + openapiFields.add("TotalPrivateRepository"); + openapiFields.add("PublicGists"); + openapiFields.add("PrivateGists"); + openapiFields.add("PinsCount"); + openapiFields.add("BoardsCount"); + openapiFields.add("LikesCount"); + openapiFields.add("SessionLimit"); + openapiFields.add("ID"); + openapiFields.add("Provider"); + openapiFields.add("FullName"); + openapiFields.add("FirstName"); + openapiFields.add("LastName"); + openapiFields.add("PhoneId"); + openapiFields.add("Prefix"); + openapiFields.add("MiddleName"); + openapiFields.add("Suffix"); + openapiFields.add("NickName"); + openapiFields.add("ProfileName"); + openapiFields.add("BirthDate"); + openapiFields.add("Gender"); + openapiFields.add("Website"); + openapiFields.add("ThumbnailImageUrl"); + openapiFields.add("ImageUrl"); + openapiFields.add("Favicon"); + openapiFields.add("ProfileUrl"); + openapiFields.add("HomeTown"); + openapiFields.add("State"); + openapiFields.add("City"); + openapiFields.add("Industry"); + openapiFields.add("About"); + openapiFields.add("TimeZone"); + openapiFields.add("LocalLanguage"); + openapiFields.add("CoverPhoto"); + openapiFields.add("TagLine"); + openapiFields.add("Language"); + openapiFields.add("Verified"); + openapiFields.add("UpdatedTime"); + openapiFields.add("IsGeoEnabled"); + openapiFields.add("Associations"); + openapiFields.add("Honors"); + openapiFields.add("HttpsImageUrl"); + openapiFields.add("MainAddress"); + openapiFields.add("Created"); + openapiFields.add("LocalCity"); + openapiFields.add("ProfileCity"); + openapiFields.add("LocalCountry"); + openapiFields.add("ProfileCountry"); + openapiFields.add("RelationshipStatus"); + openapiFields.add("Quota"); + openapiFields.add("Quote"); + openapiFields.add("Religion"); + openapiFields.add("Political"); + openapiFields.add("PublicRepository"); + openapiFields.add("RepositoryUrl"); + openapiFields.add("Age"); + openapiFields.add("ProfessionalHeadline"); + openapiFields.add("LRUserID"); + openapiFields.add("Currency"); + openapiFields.add("StarredUrl"); + openapiFields.add("GistsUrl"); + openapiFields.add("Company"); + openapiFields.add("GravatarImageUrl"); + openapiFields.add("CreatedDate"); + openapiFields.add("ModifiedDate"); + openapiFields.add("ProfileModifiedDate"); + openapiFields.add("LastLoginDate"); + openapiFields.add("SignupDate"); + openapiFields.add("Country"); + openapiFields.add("AgeRange"); + openapiFields.add("KloutScore"); + openapiFields.add("Suggestions"); + openapiFields.add("Subscription"); + openapiFields.add("ProviderAccessCredential"); + openapiFields.add("ProfileImageUrls"); + openapiFields.add("WebProfiles"); + openapiFields.add("PreviousUids"); + openapiFields.add("InterestedIn"); + openapiFields.add("Positions"); + openapiFields.add("Educations"); + openapiFields.add("PhoneNumbers"); + openapiFields.add("IMAccounts"); + openapiFields.add("Addresses"); + openapiFields.add("Interests"); + openapiFields.add("Sports"); + openapiFields.add("InspirationalPeople"); + openapiFields.add("Awards"); + openapiFields.add("Skills"); + openapiFields.add("CurrentStatus"); + openapiFields.add("Certifications"); + openapiFields.add("Courses"); + openapiFields.add("Volunteer"); + openapiFields.add("RecommendationsReceived"); + openapiFields.add("Languages"); + openapiFields.add("Projects"); + openapiFields.add("Games"); + openapiFields.add("Family"); + openapiFields.add("TelevisionShow"); + openapiFields.add("MutualFriends"); + openapiFields.add("Movies"); + openapiFields.add("Books"); + openapiFields.add("Patents"); + openapiFields.add("FavoriteThings"); + openapiFields.add("RelatedProfileViews"); + openapiFields.add("PlacesLived"); + openapiFields.add("Publications"); + openapiFields.add("JobBookmarks"); + openapiFields.add("Badges"); + openapiFields.add("MemberUrlResources"); + openapiFields.add("Email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentity + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentity.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentity is not found in the empty JSON string", SocialIdentity.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonNull()) && !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("Provider") != null && !jsonObj.get("Provider").isJsonNull()) && !jsonObj.get("Provider").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Provider` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Provider").toString())); + } + if ((jsonObj.get("FullName") != null && !jsonObj.get("FullName").isJsonNull()) && !jsonObj.get("FullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FullName").toString())); + } + if ((jsonObj.get("FirstName") != null && !jsonObj.get("FirstName").isJsonNull()) && !jsonObj.get("FirstName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FirstName").toString())); + } + if ((jsonObj.get("LastName") != null && !jsonObj.get("LastName").isJsonNull()) && !jsonObj.get("LastName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastName").toString())); + } + if ((jsonObj.get("PhoneId") != null && !jsonObj.get("PhoneId").isJsonNull()) && !jsonObj.get("PhoneId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PhoneId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PhoneId").toString())); + } + if ((jsonObj.get("Prefix") != null && !jsonObj.get("Prefix").isJsonNull()) && !jsonObj.get("Prefix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Prefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Prefix").toString())); + } + if ((jsonObj.get("MiddleName") != null && !jsonObj.get("MiddleName").isJsonNull()) && !jsonObj.get("MiddleName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MiddleName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MiddleName").toString())); + } + if ((jsonObj.get("Suffix") != null && !jsonObj.get("Suffix").isJsonNull()) && !jsonObj.get("Suffix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Suffix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Suffix").toString())); + } + if ((jsonObj.get("NickName") != null && !jsonObj.get("NickName").isJsonNull()) && !jsonObj.get("NickName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NickName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NickName").toString())); + } + if ((jsonObj.get("ProfileName") != null && !jsonObj.get("ProfileName").isJsonNull()) && !jsonObj.get("ProfileName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileName").toString())); + } + if ((jsonObj.get("BirthDate") != null && !jsonObj.get("BirthDate").isJsonNull()) && !jsonObj.get("BirthDate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `BirthDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BirthDate").toString())); + } + if ((jsonObj.get("Gender") != null && !jsonObj.get("Gender").isJsonNull()) && !jsonObj.get("Gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Gender").toString())); + } + if ((jsonObj.get("Website") != null && !jsonObj.get("Website").isJsonNull()) && !jsonObj.get("Website").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Website` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Website").toString())); + } + if ((jsonObj.get("ThumbnailImageUrl") != null && !jsonObj.get("ThumbnailImageUrl").isJsonNull()) && !jsonObj.get("ThumbnailImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ThumbnailImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ThumbnailImageUrl").toString())); + } + if ((jsonObj.get("ImageUrl") != null && !jsonObj.get("ImageUrl").isJsonNull()) && !jsonObj.get("ImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ImageUrl").toString())); + } + if ((jsonObj.get("Favicon") != null && !jsonObj.get("Favicon").isJsonNull()) && !jsonObj.get("Favicon").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Favicon` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Favicon").toString())); + } + if ((jsonObj.get("ProfileUrl") != null && !jsonObj.get("ProfileUrl").isJsonNull()) && !jsonObj.get("ProfileUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileUrl").toString())); + } + if ((jsonObj.get("HomeTown") != null && !jsonObj.get("HomeTown").isJsonNull()) && !jsonObj.get("HomeTown").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HomeTown` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HomeTown").toString())); + } + if ((jsonObj.get("State") != null && !jsonObj.get("State").isJsonNull()) && !jsonObj.get("State").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `State` to be a primitive type in the JSON string but got `%s`", jsonObj.get("State").toString())); + } + if ((jsonObj.get("City") != null && !jsonObj.get("City").isJsonNull()) && !jsonObj.get("City").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `City` to be a primitive type in the JSON string but got `%s`", jsonObj.get("City").toString())); + } + if ((jsonObj.get("Industry") != null && !jsonObj.get("Industry").isJsonNull()) && !jsonObj.get("Industry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Industry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Industry").toString())); + } + if ((jsonObj.get("About") != null && !jsonObj.get("About").isJsonNull()) && !jsonObj.get("About").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `About` to be a primitive type in the JSON string but got `%s`", jsonObj.get("About").toString())); + } + if ((jsonObj.get("TimeZone") != null && !jsonObj.get("TimeZone").isJsonNull()) && !jsonObj.get("TimeZone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TimeZone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TimeZone").toString())); + } + if ((jsonObj.get("LocalLanguage") != null && !jsonObj.get("LocalLanguage").isJsonNull()) && !jsonObj.get("LocalLanguage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalLanguage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalLanguage").toString())); + } + if ((jsonObj.get("CoverPhoto") != null && !jsonObj.get("CoverPhoto").isJsonNull()) && !jsonObj.get("CoverPhoto").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CoverPhoto` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CoverPhoto").toString())); + } + if ((jsonObj.get("TagLine") != null && !jsonObj.get("TagLine").isJsonNull()) && !jsonObj.get("TagLine").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TagLine` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TagLine").toString())); + } + if ((jsonObj.get("Language") != null && !jsonObj.get("Language").isJsonNull()) && !jsonObj.get("Language").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Language` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Language").toString())); + } + if ((jsonObj.get("Verified") != null && !jsonObj.get("Verified").isJsonNull()) && !jsonObj.get("Verified").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Verified` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Verified").toString())); + } + if ((jsonObj.get("UpdatedTime") != null && !jsonObj.get("UpdatedTime").isJsonNull()) && !jsonObj.get("UpdatedTime").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UpdatedTime` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UpdatedTime").toString())); + } + if ((jsonObj.get("IsGeoEnabled") != null && !jsonObj.get("IsGeoEnabled").isJsonNull()) && !jsonObj.get("IsGeoEnabled").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IsGeoEnabled` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IsGeoEnabled").toString())); + } + if ((jsonObj.get("Associations") != null && !jsonObj.get("Associations").isJsonNull()) && !jsonObj.get("Associations").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Associations` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Associations").toString())); + } + if ((jsonObj.get("Honors") != null && !jsonObj.get("Honors").isJsonNull()) && !jsonObj.get("Honors").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Honors` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Honors").toString())); + } + if ((jsonObj.get("HttpsImageUrl") != null && !jsonObj.get("HttpsImageUrl").isJsonNull()) && !jsonObj.get("HttpsImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HttpsImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HttpsImageUrl").toString())); + } + if ((jsonObj.get("MainAddress") != null && !jsonObj.get("MainAddress").isJsonNull()) && !jsonObj.get("MainAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MainAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MainAddress").toString())); + } + if ((jsonObj.get("Created") != null && !jsonObj.get("Created").isJsonNull()) && !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("LocalCity") != null && !jsonObj.get("LocalCity").isJsonNull()) && !jsonObj.get("LocalCity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalCity").toString())); + } + if ((jsonObj.get("ProfileCity") != null && !jsonObj.get("ProfileCity").isJsonNull()) && !jsonObj.get("ProfileCity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileCity").toString())); + } + if ((jsonObj.get("LocalCountry") != null && !jsonObj.get("LocalCountry").isJsonNull()) && !jsonObj.get("LocalCountry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalCountry").toString())); + } + if ((jsonObj.get("ProfileCountry") != null && !jsonObj.get("ProfileCountry").isJsonNull()) && !jsonObj.get("ProfileCountry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileCountry").toString())); + } + if ((jsonObj.get("RelationshipStatus") != null && !jsonObj.get("RelationshipStatus").isJsonNull()) && !jsonObj.get("RelationshipStatus").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RelationshipStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RelationshipStatus").toString())); + } + if ((jsonObj.get("Quota") != null && !jsonObj.get("Quota").isJsonNull()) && !jsonObj.get("Quota").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Quota` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Quota").toString())); + } + if ((jsonObj.get("Quote") != null && !jsonObj.get("Quote").isJsonNull()) && !jsonObj.get("Quote").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Quote` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Quote").toString())); + } + if ((jsonObj.get("Religion") != null && !jsonObj.get("Religion").isJsonNull()) && !jsonObj.get("Religion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Religion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Religion").toString())); + } + if ((jsonObj.get("Political") != null && !jsonObj.get("Political").isJsonNull()) && !jsonObj.get("Political").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Political` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Political").toString())); + } + if ((jsonObj.get("PublicRepository") != null && !jsonObj.get("PublicRepository").isJsonNull()) && !jsonObj.get("PublicRepository").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PublicRepository` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PublicRepository").toString())); + } + if ((jsonObj.get("RepositoryUrl") != null && !jsonObj.get("RepositoryUrl").isJsonNull()) && !jsonObj.get("RepositoryUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RepositoryUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RepositoryUrl").toString())); + } + if ((jsonObj.get("Age") != null && !jsonObj.get("Age").isJsonNull()) && !jsonObj.get("Age").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Age` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Age").toString())); + } + if ((jsonObj.get("ProfessionalHeadline") != null && !jsonObj.get("ProfessionalHeadline").isJsonNull()) && !jsonObj.get("ProfessionalHeadline").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfessionalHeadline` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfessionalHeadline").toString())); + } + if ((jsonObj.get("LRUserID") != null && !jsonObj.get("LRUserID").isJsonNull()) && !jsonObj.get("LRUserID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LRUserID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LRUserID").toString())); + } + if ((jsonObj.get("Currency") != null && !jsonObj.get("Currency").isJsonNull()) && !jsonObj.get("Currency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Currency").toString())); + } + if ((jsonObj.get("StarredUrl") != null && !jsonObj.get("StarredUrl").isJsonNull()) && !jsonObj.get("StarredUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `StarredUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("StarredUrl").toString())); + } + if ((jsonObj.get("GistsUrl") != null && !jsonObj.get("GistsUrl").isJsonNull()) && !jsonObj.get("GistsUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GistsUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GistsUrl").toString())); + } + if ((jsonObj.get("Company") != null && !jsonObj.get("Company").isJsonNull()) && !jsonObj.get("Company").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Company` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Company").toString())); + } + if ((jsonObj.get("GravatarImageUrl") != null && !jsonObj.get("GravatarImageUrl").isJsonNull()) && !jsonObj.get("GravatarImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GravatarImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GravatarImageUrl").toString())); + } + // validate the optional field `Country` + if (jsonObj.get("Country") != null && !jsonObj.get("Country").isJsonNull()) { + SocialIdentityCountry.validateJsonElement(jsonObj.get("Country")); + } + // validate the optional field `AgeRange` + if (jsonObj.get("AgeRange") != null && !jsonObj.get("AgeRange").isJsonNull()) { + SocialIdentityAgeRange.validateJsonElement(jsonObj.get("AgeRange")); + } + // validate the optional field `KloutScore` + if (jsonObj.get("KloutScore") != null && !jsonObj.get("KloutScore").isJsonNull()) { + SocialIdentityKloutScore.validateJsonElement(jsonObj.get("KloutScore")); + } + // validate the optional field `Suggestions` + if (jsonObj.get("Suggestions") != null && !jsonObj.get("Suggestions").isJsonNull()) { + SocialIdentitySuggestions.validateJsonElement(jsonObj.get("Suggestions")); + } + // validate the optional field `Subscription` + if (jsonObj.get("Subscription") != null && !jsonObj.get("Subscription").isJsonNull()) { + SocialIdentitySubscription.validateJsonElement(jsonObj.get("Subscription")); + } + // validate the optional field `ProviderAccessCredential` + if (jsonObj.get("ProviderAccessCredential") != null && !jsonObj.get("ProviderAccessCredential").isJsonNull()) { + SocialIdentityProviderAccessCredential.validateJsonElement(jsonObj.get("ProviderAccessCredential")); + } + // ensure the optional json data is an array if present + if (jsonObj.get("PreviousUids") != null && !jsonObj.get("PreviousUids").isJsonNull() && !jsonObj.get("PreviousUids").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PreviousUids` to be an array in the JSON string but got `%s`", jsonObj.get("PreviousUids").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("InterestedIn") != null && !jsonObj.get("InterestedIn").isJsonNull() && !jsonObj.get("InterestedIn").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `InterestedIn` to be an array in the JSON string but got `%s`", jsonObj.get("InterestedIn").toString())); + } + if (jsonObj.get("Positions") != null && !jsonObj.get("Positions").isJsonNull()) { + JsonArray jsonArraypositions = jsonObj.getAsJsonArray("Positions"); + if (jsonArraypositions != null) { + // ensure the json data is an array + if (!jsonObj.get("Positions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Positions` to be an array in the JSON string but got `%s`", jsonObj.get("Positions").toString())); + } + + // validate the optional field `Positions` (array) + for (int i = 0; i < jsonArraypositions.size(); i++) { + SocialIdentityPositionsInner.validateJsonElement(jsonArraypositions.get(i)); + }; + } + } + if (jsonObj.get("Educations") != null && !jsonObj.get("Educations").isJsonNull()) { + JsonArray jsonArrayeducations = jsonObj.getAsJsonArray("Educations"); + if (jsonArrayeducations != null) { + // ensure the json data is an array + if (!jsonObj.get("Educations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Educations` to be an array in the JSON string but got `%s`", jsonObj.get("Educations").toString())); + } + + // validate the optional field `Educations` (array) + for (int i = 0; i < jsonArrayeducations.size(); i++) { + SocialIdentityEducationsInner.validateJsonElement(jsonArrayeducations.get(i)); + }; + } + } + if (jsonObj.get("PhoneNumbers") != null && !jsonObj.get("PhoneNumbers").isJsonNull()) { + JsonArray jsonArrayphoneNumbers = jsonObj.getAsJsonArray("PhoneNumbers"); + if (jsonArrayphoneNumbers != null) { + // ensure the json data is an array + if (!jsonObj.get("PhoneNumbers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PhoneNumbers` to be an array in the JSON string but got `%s`", jsonObj.get("PhoneNumbers").toString())); + } + + // validate the optional field `PhoneNumbers` (array) + for (int i = 0; i < jsonArrayphoneNumbers.size(); i++) { + SocialIdentityPhoneNumbersInner.validateJsonElement(jsonArrayphoneNumbers.get(i)); + }; + } + } + if (jsonObj.get("IMAccounts") != null && !jsonObj.get("IMAccounts").isJsonNull()) { + JsonArray jsonArrayimAccounts = jsonObj.getAsJsonArray("IMAccounts"); + if (jsonArrayimAccounts != null) { + // ensure the json data is an array + if (!jsonObj.get("IMAccounts").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `IMAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("IMAccounts").toString())); + } + + // validate the optional field `IMAccounts` (array) + for (int i = 0; i < jsonArrayimAccounts.size(); i++) { + SocialIdentityIMAccountsInner.validateJsonElement(jsonArrayimAccounts.get(i)); + }; + } + } + if (jsonObj.get("Addresses") != null && !jsonObj.get("Addresses").isJsonNull()) { + JsonArray jsonArrayaddresses = jsonObj.getAsJsonArray("Addresses"); + if (jsonArrayaddresses != null) { + // ensure the json data is an array + if (!jsonObj.get("Addresses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Addresses` to be an array in the JSON string but got `%s`", jsonObj.get("Addresses").toString())); + } + + // validate the optional field `Addresses` (array) + for (int i = 0; i < jsonArrayaddresses.size(); i++) { + SocialIdentityAddressesInner.validateJsonElement(jsonArrayaddresses.get(i)); + }; + } + } + if (jsonObj.get("Interests") != null && !jsonObj.get("Interests").isJsonNull()) { + JsonArray jsonArrayinterests = jsonObj.getAsJsonArray("Interests"); + if (jsonArrayinterests != null) { + // ensure the json data is an array + if (!jsonObj.get("Interests").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Interests` to be an array in the JSON string but got `%s`", jsonObj.get("Interests").toString())); + } + + // validate the optional field `Interests` (array) + for (int i = 0; i < jsonArrayinterests.size(); i++) { + SocialIdentityInterestsInner.validateJsonElement(jsonArrayinterests.get(i)); + }; + } + } + if (jsonObj.get("Sports") != null && !jsonObj.get("Sports").isJsonNull()) { + JsonArray jsonArraysports = jsonObj.getAsJsonArray("Sports"); + if (jsonArraysports != null) { + // ensure the json data is an array + if (!jsonObj.get("Sports").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Sports` to be an array in the JSON string but got `%s`", jsonObj.get("Sports").toString())); + } + + // validate the optional field `Sports` (array) + for (int i = 0; i < jsonArraysports.size(); i++) { + SocialIdentitySportsInner.validateJsonElement(jsonArraysports.get(i)); + }; + } + } + if (jsonObj.get("InspirationalPeople") != null && !jsonObj.get("InspirationalPeople").isJsonNull()) { + JsonArray jsonArrayinspirationalPeople = jsonObj.getAsJsonArray("InspirationalPeople"); + if (jsonArrayinspirationalPeople != null) { + // ensure the json data is an array + if (!jsonObj.get("InspirationalPeople").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `InspirationalPeople` to be an array in the JSON string but got `%s`", jsonObj.get("InspirationalPeople").toString())); + } + + // validate the optional field `InspirationalPeople` (array) + for (int i = 0; i < jsonArrayinspirationalPeople.size(); i++) { + SocialIdentityInspirationalPeopleInner.validateJsonElement(jsonArrayinspirationalPeople.get(i)); + }; + } + } + if (jsonObj.get("Awards") != null && !jsonObj.get("Awards").isJsonNull()) { + JsonArray jsonArrayawards = jsonObj.getAsJsonArray("Awards"); + if (jsonArrayawards != null) { + // ensure the json data is an array + if (!jsonObj.get("Awards").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Awards` to be an array in the JSON string but got `%s`", jsonObj.get("Awards").toString())); + } + + // validate the optional field `Awards` (array) + for (int i = 0; i < jsonArrayawards.size(); i++) { + SocialIdentityAwardsInner.validateJsonElement(jsonArrayawards.get(i)); + }; + } + } + if (jsonObj.get("Skills") != null && !jsonObj.get("Skills").isJsonNull()) { + JsonArray jsonArrayskills = jsonObj.getAsJsonArray("Skills"); + if (jsonArrayskills != null) { + // ensure the json data is an array + if (!jsonObj.get("Skills").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Skills` to be an array in the JSON string but got `%s`", jsonObj.get("Skills").toString())); + } + + // validate the optional field `Skills` (array) + for (int i = 0; i < jsonArrayskills.size(); i++) { + SocialIdentitySkillsInner.validateJsonElement(jsonArrayskills.get(i)); + }; + } + } + if (jsonObj.get("CurrentStatus") != null && !jsonObj.get("CurrentStatus").isJsonNull()) { + JsonArray jsonArraycurrentStatus = jsonObj.getAsJsonArray("CurrentStatus"); + if (jsonArraycurrentStatus != null) { + // ensure the json data is an array + if (!jsonObj.get("CurrentStatus").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `CurrentStatus` to be an array in the JSON string but got `%s`", jsonObj.get("CurrentStatus").toString())); + } + + // validate the optional field `CurrentStatus` (array) + for (int i = 0; i < jsonArraycurrentStatus.size(); i++) { + SocialIdentityCurrentStatusInner.validateJsonElement(jsonArraycurrentStatus.get(i)); + }; + } + } + if (jsonObj.get("Certifications") != null && !jsonObj.get("Certifications").isJsonNull()) { + JsonArray jsonArraycertifications = jsonObj.getAsJsonArray("Certifications"); + if (jsonArraycertifications != null) { + // ensure the json data is an array + if (!jsonObj.get("Certifications").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Certifications` to be an array in the JSON string but got `%s`", jsonObj.get("Certifications").toString())); + } + + // validate the optional field `Certifications` (array) + for (int i = 0; i < jsonArraycertifications.size(); i++) { + SocialIdentityCertificationsInner.validateJsonElement(jsonArraycertifications.get(i)); + }; + } + } + if (jsonObj.get("Courses") != null && !jsonObj.get("Courses").isJsonNull()) { + JsonArray jsonArraycourses = jsonObj.getAsJsonArray("Courses"); + if (jsonArraycourses != null) { + // ensure the json data is an array + if (!jsonObj.get("Courses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Courses` to be an array in the JSON string but got `%s`", jsonObj.get("Courses").toString())); + } + + // validate the optional field `Courses` (array) + for (int i = 0; i < jsonArraycourses.size(); i++) { + SocialIdentityCoursesInner.validateJsonElement(jsonArraycourses.get(i)); + }; + } + } + if (jsonObj.get("Volunteer") != null && !jsonObj.get("Volunteer").isJsonNull()) { + JsonArray jsonArrayvolunteer = jsonObj.getAsJsonArray("Volunteer"); + if (jsonArrayvolunteer != null) { + // ensure the json data is an array + if (!jsonObj.get("Volunteer").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Volunteer` to be an array in the JSON string but got `%s`", jsonObj.get("Volunteer").toString())); + } + + // validate the optional field `Volunteer` (array) + for (int i = 0; i < jsonArrayvolunteer.size(); i++) { + SocialIdentityVolunteerInner.validateJsonElement(jsonArrayvolunteer.get(i)); + }; + } + } + if (jsonObj.get("RecommendationsReceived") != null && !jsonObj.get("RecommendationsReceived").isJsonNull()) { + JsonArray jsonArrayrecommendationsReceived = jsonObj.getAsJsonArray("RecommendationsReceived"); + if (jsonArrayrecommendationsReceived != null) { + // ensure the json data is an array + if (!jsonObj.get("RecommendationsReceived").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RecommendationsReceived` to be an array in the JSON string but got `%s`", jsonObj.get("RecommendationsReceived").toString())); + } + + // validate the optional field `RecommendationsReceived` (array) + for (int i = 0; i < jsonArrayrecommendationsReceived.size(); i++) { + SocialIdentityRecommendationsReceivedInner.validateJsonElement(jsonArrayrecommendationsReceived.get(i)); + }; + } + } + if (jsonObj.get("Languages") != null && !jsonObj.get("Languages").isJsonNull()) { + JsonArray jsonArraylanguages = jsonObj.getAsJsonArray("Languages"); + if (jsonArraylanguages != null) { + // ensure the json data is an array + if (!jsonObj.get("Languages").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Languages` to be an array in the JSON string but got `%s`", jsonObj.get("Languages").toString())); + } + + // validate the optional field `Languages` (array) + for (int i = 0; i < jsonArraylanguages.size(); i++) { + SocialIdentityLanguagesInner.validateJsonElement(jsonArraylanguages.get(i)); + }; + } + } + if (jsonObj.get("Projects") != null && !jsonObj.get("Projects").isJsonNull()) { + JsonArray jsonArrayprojects = jsonObj.getAsJsonArray("Projects"); + if (jsonArrayprojects != null) { + // ensure the json data is an array + if (!jsonObj.get("Projects").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Projects` to be an array in the JSON string but got `%s`", jsonObj.get("Projects").toString())); + } + + // validate the optional field `Projects` (array) + for (int i = 0; i < jsonArrayprojects.size(); i++) { + SocialIdentityProjectsInner.validateJsonElement(jsonArrayprojects.get(i)); + }; + } + } + if (jsonObj.get("Games") != null && !jsonObj.get("Games").isJsonNull()) { + JsonArray jsonArraygames = jsonObj.getAsJsonArray("Games"); + if (jsonArraygames != null) { + // ensure the json data is an array + if (!jsonObj.get("Games").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Games` to be an array in the JSON string but got `%s`", jsonObj.get("Games").toString())); + } + + // validate the optional field `Games` (array) + for (int i = 0; i < jsonArraygames.size(); i++) { + SocialIdentityGamesInner.validateJsonElement(jsonArraygames.get(i)); + }; + } + } + if (jsonObj.get("Family") != null && !jsonObj.get("Family").isJsonNull()) { + JsonArray jsonArrayfamily = jsonObj.getAsJsonArray("Family"); + if (jsonArrayfamily != null) { + // ensure the json data is an array + if (!jsonObj.get("Family").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Family` to be an array in the JSON string but got `%s`", jsonObj.get("Family").toString())); + } + + // validate the optional field `Family` (array) + for (int i = 0; i < jsonArrayfamily.size(); i++) { + SocialIdentityFamilyInner.validateJsonElement(jsonArrayfamily.get(i)); + }; + } + } + if (jsonObj.get("TelevisionShow") != null && !jsonObj.get("TelevisionShow").isJsonNull()) { + JsonArray jsonArraytelevisionShow = jsonObj.getAsJsonArray("TelevisionShow"); + if (jsonArraytelevisionShow != null) { + // ensure the json data is an array + if (!jsonObj.get("TelevisionShow").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `TelevisionShow` to be an array in the JSON string but got `%s`", jsonObj.get("TelevisionShow").toString())); + } + + // validate the optional field `TelevisionShow` (array) + for (int i = 0; i < jsonArraytelevisionShow.size(); i++) { + SocialIdentityTelevisionShowInner.validateJsonElement(jsonArraytelevisionShow.get(i)); + }; + } + } + if (jsonObj.get("MutualFriends") != null && !jsonObj.get("MutualFriends").isJsonNull()) { + JsonArray jsonArraymutualFriends = jsonObj.getAsJsonArray("MutualFriends"); + if (jsonArraymutualFriends != null) { + // ensure the json data is an array + if (!jsonObj.get("MutualFriends").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `MutualFriends` to be an array in the JSON string but got `%s`", jsonObj.get("MutualFriends").toString())); + } + + // validate the optional field `MutualFriends` (array) + for (int i = 0; i < jsonArraymutualFriends.size(); i++) { + SocialIdentityMutualFriendsInner.validateJsonElement(jsonArraymutualFriends.get(i)); + }; + } + } + if (jsonObj.get("Movies") != null && !jsonObj.get("Movies").isJsonNull()) { + JsonArray jsonArraymovies = jsonObj.getAsJsonArray("Movies"); + if (jsonArraymovies != null) { + // ensure the json data is an array + if (!jsonObj.get("Movies").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Movies` to be an array in the JSON string but got `%s`", jsonObj.get("Movies").toString())); + } + + // validate the optional field `Movies` (array) + for (int i = 0; i < jsonArraymovies.size(); i++) { + SocialIdentityMoviesInner.validateJsonElement(jsonArraymovies.get(i)); + }; + } + } + if (jsonObj.get("Books") != null && !jsonObj.get("Books").isJsonNull()) { + JsonArray jsonArraybooks = jsonObj.getAsJsonArray("Books"); + if (jsonArraybooks != null) { + // ensure the json data is an array + if (!jsonObj.get("Books").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Books` to be an array in the JSON string but got `%s`", jsonObj.get("Books").toString())); + } + + // validate the optional field `Books` (array) + for (int i = 0; i < jsonArraybooks.size(); i++) { + SocialIdentityBooksInner.validateJsonElement(jsonArraybooks.get(i)); + }; + } + } + if (jsonObj.get("Patents") != null && !jsonObj.get("Patents").isJsonNull()) { + JsonArray jsonArraypatents = jsonObj.getAsJsonArray("Patents"); + if (jsonArraypatents != null) { + // ensure the json data is an array + if (!jsonObj.get("Patents").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Patents` to be an array in the JSON string but got `%s`", jsonObj.get("Patents").toString())); + } + + // validate the optional field `Patents` (array) + for (int i = 0; i < jsonArraypatents.size(); i++) { + SocialIdentityPatentsInner.validateJsonElement(jsonArraypatents.get(i)); + }; + } + } + if (jsonObj.get("FavoriteThings") != null && !jsonObj.get("FavoriteThings").isJsonNull()) { + JsonArray jsonArrayfavoriteThings = jsonObj.getAsJsonArray("FavoriteThings"); + if (jsonArrayfavoriteThings != null) { + // ensure the json data is an array + if (!jsonObj.get("FavoriteThings").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `FavoriteThings` to be an array in the JSON string but got `%s`", jsonObj.get("FavoriteThings").toString())); + } + + // validate the optional field `FavoriteThings` (array) + for (int i = 0; i < jsonArrayfavoriteThings.size(); i++) { + SocialIdentityFavoriteThingsInner.validateJsonElement(jsonArrayfavoriteThings.get(i)); + }; + } + } + if (jsonObj.get("RelatedProfileViews") != null && !jsonObj.get("RelatedProfileViews").isJsonNull()) { + JsonArray jsonArrayrelatedProfileViews = jsonObj.getAsJsonArray("RelatedProfileViews"); + if (jsonArrayrelatedProfileViews != null) { + // ensure the json data is an array + if (!jsonObj.get("RelatedProfileViews").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RelatedProfileViews` to be an array in the JSON string but got `%s`", jsonObj.get("RelatedProfileViews").toString())); + } + + // validate the optional field `RelatedProfileViews` (array) + for (int i = 0; i < jsonArrayrelatedProfileViews.size(); i++) { + SocialIdentityRelatedProfileViewsInner.validateJsonElement(jsonArrayrelatedProfileViews.get(i)); + }; + } + } + if (jsonObj.get("PlacesLived") != null && !jsonObj.get("PlacesLived").isJsonNull()) { + JsonArray jsonArrayplacesLived = jsonObj.getAsJsonArray("PlacesLived"); + if (jsonArrayplacesLived != null) { + // ensure the json data is an array + if (!jsonObj.get("PlacesLived").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PlacesLived` to be an array in the JSON string but got `%s`", jsonObj.get("PlacesLived").toString())); + } + + // validate the optional field `PlacesLived` (array) + for (int i = 0; i < jsonArrayplacesLived.size(); i++) { + SocialIdentityPlacesLivedInner.validateJsonElement(jsonArrayplacesLived.get(i)); + }; + } + } + if (jsonObj.get("Publications") != null && !jsonObj.get("Publications").isJsonNull()) { + JsonArray jsonArraypublications = jsonObj.getAsJsonArray("Publications"); + if (jsonArraypublications != null) { + // ensure the json data is an array + if (!jsonObj.get("Publications").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Publications` to be an array in the JSON string but got `%s`", jsonObj.get("Publications").toString())); + } + + // validate the optional field `Publications` (array) + for (int i = 0; i < jsonArraypublications.size(); i++) { + SocialIdentityPublicationsInner.validateJsonElement(jsonArraypublications.get(i)); + }; + } + } + if (jsonObj.get("JobBookmarks") != null && !jsonObj.get("JobBookmarks").isJsonNull()) { + JsonArray jsonArrayjobBookmarks = jsonObj.getAsJsonArray("JobBookmarks"); + if (jsonArrayjobBookmarks != null) { + // ensure the json data is an array + if (!jsonObj.get("JobBookmarks").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `JobBookmarks` to be an array in the JSON string but got `%s`", jsonObj.get("JobBookmarks").toString())); + } + + // validate the optional field `JobBookmarks` (array) + for (int i = 0; i < jsonArrayjobBookmarks.size(); i++) { + SocialIdentityJobBookmarksInner.validateJsonElement(jsonArrayjobBookmarks.get(i)); + }; + } + } + if (jsonObj.get("Badges") != null && !jsonObj.get("Badges").isJsonNull()) { + JsonArray jsonArraybadges = jsonObj.getAsJsonArray("Badges"); + if (jsonArraybadges != null) { + // ensure the json data is an array + if (!jsonObj.get("Badges").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Badges` to be an array in the JSON string but got `%s`", jsonObj.get("Badges").toString())); + } + + // validate the optional field `Badges` (array) + for (int i = 0; i < jsonArraybadges.size(); i++) { + SocialIdentityBadgesInner.validateJsonElement(jsonArraybadges.get(i)); + }; + } + } + if (jsonObj.get("MemberUrlResources") != null && !jsonObj.get("MemberUrlResources").isJsonNull()) { + JsonArray jsonArraymemberUrlResources = jsonObj.getAsJsonArray("MemberUrlResources"); + if (jsonArraymemberUrlResources != null) { + // ensure the json data is an array + if (!jsonObj.get("MemberUrlResources").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `MemberUrlResources` to be an array in the JSON string but got `%s`", jsonObj.get("MemberUrlResources").toString())); + } + + // validate the optional field `MemberUrlResources` (array) + for (int i = 0; i < jsonArraymemberUrlResources.size(); i++) { + SocialIdentityMemberUrlResourcesInner.validateJsonElement(jsonArraymemberUrlResources.get(i)); + }; + } + } + if (jsonObj.get("Email") != null && !jsonObj.get("Email").isJsonNull()) { + JsonArray jsonArrayemail = jsonObj.getAsJsonArray("Email"); + if (jsonArrayemail != null) { + // ensure the json data is an array + if (!jsonObj.get("Email").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Email` to be an array in the JSON string but got `%s`", jsonObj.get("Email").toString())); + } + + // validate the optional field `Email` (array) + for (int i = 0; i < jsonArrayemail.size(); i++) { + SocialIdentityEmailInner.validateJsonElement(jsonArrayemail.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentity.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentity' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentity> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentity.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentity>() { + @Override + public void write(JsonWriter out, SocialIdentity value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentity read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentity instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentity given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentity + * @throws IOException if the JSON string is invalid with respect to SocialIdentity + */ + public static SocialIdentity fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentity.class); + } + + /** + * Convert an instance of SocialIdentity to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityAddressesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityAddressesInner.java new file mode 100644 index 0000000..35a2320 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityAddressesInner.java @@ -0,0 +1,557 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityAddressesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityAddressesInner { + public static final String SERIALIZED_NAME_TYPE = "Type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_ADDRESS_TYPE = "AddressType"; + @SerializedName(SERIALIZED_NAME_ADDRESS_TYPE) + @javax.annotation.Nullable + private String addressType; + + public static final String SERIALIZED_NAME_ADDRESS1 = "Address1"; + @SerializedName(SERIALIZED_NAME_ADDRESS1) + @javax.annotation.Nullable + private String address1; + + public static final String SERIALIZED_NAME_ADDRESS2 = "Address2"; + @SerializedName(SERIALIZED_NAME_ADDRESS2) + @javax.annotation.Nullable + private String address2; + + public static final String SERIALIZED_NAME_CITY = "City"; + @SerializedName(SERIALIZED_NAME_CITY) + @javax.annotation.Nullable + private String city; + + public static final String SERIALIZED_NAME_STATE = "State"; + @SerializedName(SERIALIZED_NAME_STATE) + @javax.annotation.Nullable + private String state; + + public static final String SERIALIZED_NAME_POSTAL_CODE = "PostalCode"; + @SerializedName(SERIALIZED_NAME_POSTAL_CODE) + @javax.annotation.Nullable + private String postalCode; + + public static final String SERIALIZED_NAME_REGION = "Region"; + @SerializedName(SERIALIZED_NAME_REGION) + @javax.annotation.Nullable + private String region; + + public static final String SERIALIZED_NAME_OP = "Op"; + @SerializedName(SERIALIZED_NAME_OP) + @javax.annotation.Nullable + private String op; + + public static final String SERIALIZED_NAME_COUNTRY = "Country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + @javax.annotation.Nullable + private String country; + + public SocialIdentityAddressesInner() { + } + + public SocialIdentityAddressesInner type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public SocialIdentityAddressesInner addressType(@javax.annotation.Nullable String addressType) { + this.addressType = addressType; + return this; + } + + /** + * Get addressType + * @return addressType + */ + @javax.annotation.Nullable + public String getAddressType() { + return addressType; + } + + public void setAddressType(@javax.annotation.Nullable String addressType) { + this.addressType = addressType; + } + + + public SocialIdentityAddressesInner address1(@javax.annotation.Nullable String address1) { + this.address1 = address1; + return this; + } + + /** + * Get address1 + * @return address1 + */ + @javax.annotation.Nullable + public String getAddress1() { + return address1; + } + + public void setAddress1(@javax.annotation.Nullable String address1) { + this.address1 = address1; + } + + + public SocialIdentityAddressesInner address2(@javax.annotation.Nullable String address2) { + this.address2 = address2; + return this; + } + + /** + * Get address2 + * @return address2 + */ + @javax.annotation.Nullable + public String getAddress2() { + return address2; + } + + public void setAddress2(@javax.annotation.Nullable String address2) { + this.address2 = address2; + } + + + public SocialIdentityAddressesInner city(@javax.annotation.Nullable String city) { + this.city = city; + return this; + } + + /** + * Get city + * @return city + */ + @javax.annotation.Nullable + public String getCity() { + return city; + } + + public void setCity(@javax.annotation.Nullable String city) { + this.city = city; + } + + + public SocialIdentityAddressesInner state(@javax.annotation.Nullable String state) { + this.state = state; + return this; + } + + /** + * Get state + * @return state + */ + @javax.annotation.Nullable + public String getState() { + return state; + } + + public void setState(@javax.annotation.Nullable String state) { + this.state = state; + } + + + public SocialIdentityAddressesInner postalCode(@javax.annotation.Nullable String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** + * Get postalCode + * @return postalCode + */ + @javax.annotation.Nullable + public String getPostalCode() { + return postalCode; + } + + public void setPostalCode(@javax.annotation.Nullable String postalCode) { + this.postalCode = postalCode; + } + + + public SocialIdentityAddressesInner region(@javax.annotation.Nullable String region) { + this.region = region; + return this; + } + + /** + * Get region + * @return region + */ + @javax.annotation.Nullable + public String getRegion() { + return region; + } + + public void setRegion(@javax.annotation.Nullable String region) { + this.region = region; + } + + + public SocialIdentityAddressesInner op(@javax.annotation.Nullable String op) { + this.op = op; + return this; + } + + /** + * Get op + * @return op + */ + @javax.annotation.Nullable + public String getOp() { + return op; + } + + public void setOp(@javax.annotation.Nullable String op) { + this.op = op; + } + + + public SocialIdentityAddressesInner country(@javax.annotation.Nullable String country) { + this.country = country; + return this; + } + + /** + * Get country + * @return country + */ + @javax.annotation.Nullable + public String getCountry() { + return country; + } + + public void setCountry(@javax.annotation.Nullable String country) { + this.country = country; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityAddressesInner instance itself + */ + public SocialIdentityAddressesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityAddressesInner socialIdentityAddressesInner = (SocialIdentityAddressesInner) o; + return Objects.equals(this.type, socialIdentityAddressesInner.type) && + Objects.equals(this.addressType, socialIdentityAddressesInner.addressType) && + Objects.equals(this.address1, socialIdentityAddressesInner.address1) && + Objects.equals(this.address2, socialIdentityAddressesInner.address2) && + Objects.equals(this.city, socialIdentityAddressesInner.city) && + Objects.equals(this.state, socialIdentityAddressesInner.state) && + Objects.equals(this.postalCode, socialIdentityAddressesInner.postalCode) && + Objects.equals(this.region, socialIdentityAddressesInner.region) && + Objects.equals(this.op, socialIdentityAddressesInner.op) && + Objects.equals(this.country, socialIdentityAddressesInner.country)&& + Objects.equals(this.additionalProperties, socialIdentityAddressesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, addressType, address1, address2, city, state, postalCode, region, op, country, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityAddressesInner {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" addressType: ").append(toIndentedString(addressType)).append("\n"); + sb.append(" address1: ").append(toIndentedString(address1)).append("\n"); + sb.append(" address2: ").append(toIndentedString(address2)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" postalCode: ").append(toIndentedString(postalCode)).append("\n"); + sb.append(" region: ").append(toIndentedString(region)).append("\n"); + sb.append(" op: ").append(toIndentedString(op)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Type"); + openapiFields.add("AddressType"); + openapiFields.add("Address1"); + openapiFields.add("Address2"); + openapiFields.add("City"); + openapiFields.add("State"); + openapiFields.add("PostalCode"); + openapiFields.add("Region"); + openapiFields.add("Op"); + openapiFields.add("Country"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityAddressesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityAddressesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityAddressesInner is not found in the empty JSON string", SocialIdentityAddressesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonNull()) && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + if ((jsonObj.get("AddressType") != null && !jsonObj.get("AddressType").isJsonNull()) && !jsonObj.get("AddressType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AddressType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AddressType").toString())); + } + if ((jsonObj.get("Address1") != null && !jsonObj.get("Address1").isJsonNull()) && !jsonObj.get("Address1").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Address1` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Address1").toString())); + } + if ((jsonObj.get("Address2") != null && !jsonObj.get("Address2").isJsonNull()) && !jsonObj.get("Address2").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Address2` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Address2").toString())); + } + if ((jsonObj.get("City") != null && !jsonObj.get("City").isJsonNull()) && !jsonObj.get("City").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `City` to be a primitive type in the JSON string but got `%s`", jsonObj.get("City").toString())); + } + if ((jsonObj.get("State") != null && !jsonObj.get("State").isJsonNull()) && !jsonObj.get("State").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `State` to be a primitive type in the JSON string but got `%s`", jsonObj.get("State").toString())); + } + if ((jsonObj.get("PostalCode") != null && !jsonObj.get("PostalCode").isJsonNull()) && !jsonObj.get("PostalCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PostalCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PostalCode").toString())); + } + if ((jsonObj.get("Region") != null && !jsonObj.get("Region").isJsonNull()) && !jsonObj.get("Region").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Region` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Region").toString())); + } + if ((jsonObj.get("Op") != null && !jsonObj.get("Op").isJsonNull()) && !jsonObj.get("Op").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Op` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Op").toString())); + } + if ((jsonObj.get("Country") != null && !jsonObj.get("Country").isJsonNull()) && !jsonObj.get("Country").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Country` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Country").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityAddressesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityAddressesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityAddressesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityAddressesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityAddressesInner>() { + @Override + public void write(JsonWriter out, SocialIdentityAddressesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityAddressesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityAddressesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityAddressesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityAddressesInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityAddressesInner + */ + public static SocialIdentityAddressesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityAddressesInner.class); + } + + /** + * Convert an instance of SocialIdentityAddressesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityAgeRange.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityAgeRange.java new file mode 100644 index 0000000..afec47d --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityAgeRange.java @@ -0,0 +1,311 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityAgeRange + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityAgeRange { + public static final String SERIALIZED_NAME_MIN = "Min"; + @SerializedName(SERIALIZED_NAME_MIN) + @javax.annotation.Nullable + private Integer min; + + public static final String SERIALIZED_NAME_MAX = "Max"; + @SerializedName(SERIALIZED_NAME_MAX) + @javax.annotation.Nullable + private Integer max; + + public SocialIdentityAgeRange() { + } + + public SocialIdentityAgeRange min(@javax.annotation.Nullable Integer min) { + this.min = min; + return this; + } + + /** + * Get min + * @return min + */ + @javax.annotation.Nullable + public Integer getMin() { + return min; + } + + public void setMin(@javax.annotation.Nullable Integer min) { + this.min = min; + } + + + public SocialIdentityAgeRange max(@javax.annotation.Nullable Integer max) { + this.max = max; + return this; + } + + /** + * Get max + * @return max + */ + @javax.annotation.Nullable + public Integer getMax() { + return max; + } + + public void setMax(@javax.annotation.Nullable Integer max) { + this.max = max; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityAgeRange instance itself + */ + public SocialIdentityAgeRange putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityAgeRange socialIdentityAgeRange = (SocialIdentityAgeRange) o; + return Objects.equals(this.min, socialIdentityAgeRange.min) && + Objects.equals(this.max, socialIdentityAgeRange.max)&& + Objects.equals(this.additionalProperties, socialIdentityAgeRange.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(min, max, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityAgeRange {\n"); + sb.append(" min: ").append(toIndentedString(min)).append("\n"); + sb.append(" max: ").append(toIndentedString(max)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Min"); + openapiFields.add("Max"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityAgeRange + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityAgeRange.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityAgeRange is not found in the empty JSON string", SocialIdentityAgeRange.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityAgeRange.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityAgeRange' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityAgeRange> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityAgeRange.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityAgeRange>() { + @Override + public void write(JsonWriter out, SocialIdentityAgeRange value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityAgeRange read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityAgeRange instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityAgeRange given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityAgeRange + * @throws IOException if the JSON string is invalid with respect to SocialIdentityAgeRange + */ + public static SocialIdentityAgeRange fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityAgeRange.class); + } + + /** + * Convert an instance of SocialIdentityAgeRange to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityAwardsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityAwardsInner.java new file mode 100644 index 0000000..473b28f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityAwardsInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityAwardsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityAwardsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_ISSUER = "Issuer"; + @SerializedName(SERIALIZED_NAME_ISSUER) + @javax.annotation.Nullable + private String issuer; + + public SocialIdentityAwardsInner() { + } + + public SocialIdentityAwardsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public SocialIdentityAwardsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public SocialIdentityAwardsInner issuer(@javax.annotation.Nullable String issuer) { + this.issuer = issuer; + return this; + } + + /** + * Get issuer + * @return issuer + */ + @javax.annotation.Nullable + public String getIssuer() { + return issuer; + } + + public void setIssuer(@javax.annotation.Nullable String issuer) { + this.issuer = issuer; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityAwardsInner instance itself + */ + public SocialIdentityAwardsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityAwardsInner socialIdentityAwardsInner = (SocialIdentityAwardsInner) o; + return Objects.equals(this.id, socialIdentityAwardsInner.id) && + Objects.equals(this.name, socialIdentityAwardsInner.name) && + Objects.equals(this.issuer, socialIdentityAwardsInner.issuer)&& + Objects.equals(this.additionalProperties, socialIdentityAwardsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, issuer, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityAwardsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" issuer: ").append(toIndentedString(issuer)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Issuer"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityAwardsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityAwardsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityAwardsInner is not found in the empty JSON string", SocialIdentityAwardsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Issuer") != null && !jsonObj.get("Issuer").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityAwardsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityAwardsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityAwardsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityAwardsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityAwardsInner>() { + @Override + public void write(JsonWriter out, SocialIdentityAwardsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityAwardsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityAwardsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityAwardsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityAwardsInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityAwardsInner + */ + public static SocialIdentityAwardsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityAwardsInner.class); + } + + /** + * Convert an instance of SocialIdentityAwardsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityBadgesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityBadgesInner.java new file mode 100644 index 0000000..fd00f52 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityBadgesInner.java @@ -0,0 +1,467 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityBadgesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityBadgesInner { + public static final String SERIALIZED_NAME_BADGE_ID = "BadgeId"; + @SerializedName(SERIALIZED_NAME_BADGE_ID) + @javax.annotation.Nullable + private String badgeId; + + public static final String SERIALIZED_NAME_BAGE_ID = "BageId"; + @SerializedName(SERIALIZED_NAME_BAGE_ID) + @javax.annotation.Nullable + private String bageId; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_BADGE_MESSAGE = "BadgeMessage"; + @SerializedName(SERIALIZED_NAME_BADGE_MESSAGE) + @javax.annotation.Nullable + private String badgeMessage; + + public static final String SERIALIZED_NAME_BAGE_MESSAGE = "BageMessage"; + @SerializedName(SERIALIZED_NAME_BAGE_MESSAGE) + @javax.annotation.Nullable + private String bageMessage; + + public static final String SERIALIZED_NAME_DESCRIPTION = "Description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_IMAGE_URL = "ImageUrl"; + @SerializedName(SERIALIZED_NAME_IMAGE_URL) + @javax.annotation.Nullable + private String imageUrl; + + public SocialIdentityBadgesInner() { + } + + public SocialIdentityBadgesInner badgeId(@javax.annotation.Nullable String badgeId) { + this.badgeId = badgeId; + return this; + } + + /** + * Get badgeId + * @return badgeId + */ + @javax.annotation.Nullable + public String getBadgeId() { + return badgeId; + } + + public void setBadgeId(@javax.annotation.Nullable String badgeId) { + this.badgeId = badgeId; + } + + + public SocialIdentityBadgesInner bageId(@javax.annotation.Nullable String bageId) { + this.bageId = bageId; + return this; + } + + /** + * Get bageId + * @return bageId + */ + @javax.annotation.Nullable + public String getBageId() { + return bageId; + } + + public void setBageId(@javax.annotation.Nullable String bageId) { + this.bageId = bageId; + } + + + public SocialIdentityBadgesInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public SocialIdentityBadgesInner badgeMessage(@javax.annotation.Nullable String badgeMessage) { + this.badgeMessage = badgeMessage; + return this; + } + + /** + * Get badgeMessage + * @return badgeMessage + */ + @javax.annotation.Nullable + public String getBadgeMessage() { + return badgeMessage; + } + + public void setBadgeMessage(@javax.annotation.Nullable String badgeMessage) { + this.badgeMessage = badgeMessage; + } + + + public SocialIdentityBadgesInner bageMessage(@javax.annotation.Nullable String bageMessage) { + this.bageMessage = bageMessage; + return this; + } + + /** + * Get bageMessage + * @return bageMessage + */ + @javax.annotation.Nullable + public String getBageMessage() { + return bageMessage; + } + + public void setBageMessage(@javax.annotation.Nullable String bageMessage) { + this.bageMessage = bageMessage; + } + + + public SocialIdentityBadgesInner description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public SocialIdentityBadgesInner imageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** + * Get imageUrl + * @return imageUrl + */ + @javax.annotation.Nullable + public String getImageUrl() { + return imageUrl; + } + + public void setImageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityBadgesInner instance itself + */ + public SocialIdentityBadgesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityBadgesInner socialIdentityBadgesInner = (SocialIdentityBadgesInner) o; + return Objects.equals(this.badgeId, socialIdentityBadgesInner.badgeId) && + Objects.equals(this.bageId, socialIdentityBadgesInner.bageId) && + Objects.equals(this.name, socialIdentityBadgesInner.name) && + Objects.equals(this.badgeMessage, socialIdentityBadgesInner.badgeMessage) && + Objects.equals(this.bageMessage, socialIdentityBadgesInner.bageMessage) && + Objects.equals(this.description, socialIdentityBadgesInner.description) && + Objects.equals(this.imageUrl, socialIdentityBadgesInner.imageUrl)&& + Objects.equals(this.additionalProperties, socialIdentityBadgesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(badgeId, bageId, name, badgeMessage, bageMessage, description, imageUrl, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityBadgesInner {\n"); + sb.append(" badgeId: ").append(toIndentedString(badgeId)).append("\n"); + sb.append(" bageId: ").append(toIndentedString(bageId)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" badgeMessage: ").append(toIndentedString(badgeMessage)).append("\n"); + sb.append(" bageMessage: ").append(toIndentedString(bageMessage)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("BadgeId"); + openapiFields.add("BageId"); + openapiFields.add("Name"); + openapiFields.add("BadgeMessage"); + openapiFields.add("BageMessage"); + openapiFields.add("Description"); + openapiFields.add("ImageUrl"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityBadgesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityBadgesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityBadgesInner is not found in the empty JSON string", SocialIdentityBadgesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("BadgeId") != null && !jsonObj.get("BadgeId").isJsonNull()) && !jsonObj.get("BadgeId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `BadgeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BadgeId").toString())); + } + if ((jsonObj.get("BageId") != null && !jsonObj.get("BageId").isJsonNull()) && !jsonObj.get("BageId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `BageId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BageId").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("BadgeMessage") != null && !jsonObj.get("BadgeMessage").isJsonNull()) && !jsonObj.get("BadgeMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `BadgeMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BadgeMessage").toString())); + } + if ((jsonObj.get("BageMessage") != null && !jsonObj.get("BageMessage").isJsonNull()) && !jsonObj.get("BageMessage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `BageMessage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BageMessage").toString())); + } + if ((jsonObj.get("Description") != null && !jsonObj.get("Description").isJsonNull()) && !jsonObj.get("Description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Description").toString())); + } + if ((jsonObj.get("ImageUrl") != null && !jsonObj.get("ImageUrl").isJsonNull()) && !jsonObj.get("ImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ImageUrl").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityBadgesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityBadgesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityBadgesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityBadgesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityBadgesInner>() { + @Override + public void write(JsonWriter out, SocialIdentityBadgesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityBadgesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityBadgesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityBadgesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityBadgesInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityBadgesInner + */ + public static SocialIdentityBadgesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityBadgesInner.class); + } + + /** + * Convert an instance of SocialIdentityBadgesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityBooksInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityBooksInner.java new file mode 100644 index 0000000..194df0c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityBooksInner.java @@ -0,0 +1,377 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityBooksInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityBooksInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_CATEGORY = "Category"; + @SerializedName(SERIALIZED_NAME_CATEGORY) + @javax.annotation.Nullable + private String category; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private String createdDate; + + public SocialIdentityBooksInner() { + } + + public SocialIdentityBooksInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public SocialIdentityBooksInner category(@javax.annotation.Nullable String category) { + this.category = category; + return this; + } + + /** + * Get category + * @return category + */ + @javax.annotation.Nullable + public String getCategory() { + return category; + } + + public void setCategory(@javax.annotation.Nullable String category) { + this.category = category; + } + + + public SocialIdentityBooksInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public SocialIdentityBooksInner createdDate(@javax.annotation.Nullable String createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get createdDate + * @return createdDate + */ + @javax.annotation.Nullable + public String getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable String createdDate) { + this.createdDate = createdDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityBooksInner instance itself + */ + public SocialIdentityBooksInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityBooksInner socialIdentityBooksInner = (SocialIdentityBooksInner) o; + return Objects.equals(this.id, socialIdentityBooksInner.id) && + Objects.equals(this.category, socialIdentityBooksInner.category) && + Objects.equals(this.name, socialIdentityBooksInner.name) && + Objects.equals(this.createdDate, socialIdentityBooksInner.createdDate)&& + Objects.equals(this.additionalProperties, socialIdentityBooksInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, createdDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityBooksInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Category"); + openapiFields.add("Name"); + openapiFields.add("CreatedDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityBooksInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityBooksInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityBooksInner is not found in the empty JSON string", SocialIdentityBooksInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Category") != null && !jsonObj.get("Category").isJsonNull()) && !jsonObj.get("Category").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Category` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Category").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("CreatedDate") != null && !jsonObj.get("CreatedDate").isJsonNull()) && !jsonObj.get("CreatedDate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CreatedDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CreatedDate").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityBooksInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityBooksInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityBooksInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityBooksInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityBooksInner>() { + @Override + public void write(JsonWriter out, SocialIdentityBooksInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityBooksInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityBooksInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityBooksInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityBooksInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityBooksInner + */ + public static SocialIdentityBooksInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityBooksInner.class); + } + + /** + * Convert an instance of SocialIdentityBooksInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityCertificationsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityCertificationsInner.java new file mode 100644 index 0000000..6e63c9c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityCertificationsInner.java @@ -0,0 +1,432 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityCertificationsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityCertificationsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_AUTHORITY = "Authority"; + @SerializedName(SERIALIZED_NAME_AUTHORITY) + @javax.annotation.Nullable + private String authority; + + public static final String SERIALIZED_NAME_NUMBER = "Number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + @javax.annotation.Nullable + private String number; + + public static final String SERIALIZED_NAME_START_DATE = "StartDate"; + @SerializedName(SERIALIZED_NAME_START_DATE) + @javax.annotation.Nullable + private OffsetDateTime startDate; + + public static final String SERIALIZED_NAME_END_DATE = "EndDate"; + @SerializedName(SERIALIZED_NAME_END_DATE) + @javax.annotation.Nullable + private OffsetDateTime endDate; + + public SocialIdentityCertificationsInner() { + } + + public SocialIdentityCertificationsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public SocialIdentityCertificationsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public SocialIdentityCertificationsInner authority(@javax.annotation.Nullable String authority) { + this.authority = authority; + return this; + } + + /** + * Get authority + * @return authority + */ + @javax.annotation.Nullable + public String getAuthority() { + return authority; + } + + public void setAuthority(@javax.annotation.Nullable String authority) { + this.authority = authority; + } + + + public SocialIdentityCertificationsInner number(@javax.annotation.Nullable String number) { + this.number = number; + return this; + } + + /** + * Get number + * @return number + */ + @javax.annotation.Nullable + public String getNumber() { + return number; + } + + public void setNumber(@javax.annotation.Nullable String number) { + this.number = number; + } + + + public SocialIdentityCertificationsInner startDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Get startDate + * @return startDate + */ + @javax.annotation.Nullable + public OffsetDateTime getStartDate() { + return startDate; + } + + public void setStartDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + } + + + public SocialIdentityCertificationsInner endDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * Get endDate + * @return endDate + */ + @javax.annotation.Nullable + public OffsetDateTime getEndDate() { + return endDate; + } + + public void setEndDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityCertificationsInner instance itself + */ + public SocialIdentityCertificationsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityCertificationsInner socialIdentityCertificationsInner = (SocialIdentityCertificationsInner) o; + return Objects.equals(this.id, socialIdentityCertificationsInner.id) && + Objects.equals(this.name, socialIdentityCertificationsInner.name) && + Objects.equals(this.authority, socialIdentityCertificationsInner.authority) && + Objects.equals(this.number, socialIdentityCertificationsInner.number) && + Objects.equals(this.startDate, socialIdentityCertificationsInner.startDate) && + Objects.equals(this.endDate, socialIdentityCertificationsInner.endDate)&& + Objects.equals(this.additionalProperties, socialIdentityCertificationsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, authority, number, startDate, endDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityCertificationsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" authority: ").append(toIndentedString(authority)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Authority"); + openapiFields.add("Number"); + openapiFields.add("StartDate"); + openapiFields.add("EndDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityCertificationsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityCertificationsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityCertificationsInner is not found in the empty JSON string", SocialIdentityCertificationsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Authority") != null && !jsonObj.get("Authority").isJsonNull()) && !jsonObj.get("Authority").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Authority` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Authority").toString())); + } + if ((jsonObj.get("Number") != null && !jsonObj.get("Number").isJsonNull()) && !jsonObj.get("Number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Number").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityCertificationsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityCertificationsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityCertificationsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityCertificationsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityCertificationsInner>() { + @Override + public void write(JsonWriter out, SocialIdentityCertificationsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityCertificationsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityCertificationsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityCertificationsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityCertificationsInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityCertificationsInner + */ + public static SocialIdentityCertificationsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityCertificationsInner.class); + } + + /** + * Convert an instance of SocialIdentityCertificationsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityCountry.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityCountry.java new file mode 100644 index 0000000..cb44d00 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityCountry.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityCountry + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityCountry { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_CODE = "Code"; + @SerializedName(SERIALIZED_NAME_CODE) + @javax.annotation.Nullable + private String code; + + public SocialIdentityCountry() { + } + + public SocialIdentityCountry name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public SocialIdentityCountry code(@javax.annotation.Nullable String code) { + this.code = code; + return this; + } + + /** + * Get code + * @return code + */ + @javax.annotation.Nullable + public String getCode() { + return code; + } + + public void setCode(@javax.annotation.Nullable String code) { + this.code = code; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityCountry instance itself + */ + public SocialIdentityCountry putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityCountry socialIdentityCountry = (SocialIdentityCountry) o; + return Objects.equals(this.name, socialIdentityCountry.name) && + Objects.equals(this.code, socialIdentityCountry.code)&& + Objects.equals(this.additionalProperties, socialIdentityCountry.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, code, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityCountry {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" code: ").append(toIndentedString(code)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + openapiFields.add("Code"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityCountry + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityCountry.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityCountry is not found in the empty JSON string", SocialIdentityCountry.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Code") != null && !jsonObj.get("Code").isJsonNull()) && !jsonObj.get("Code").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Code` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Code").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityCountry.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityCountry' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityCountry> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityCountry.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityCountry>() { + @Override + public void write(JsonWriter out, SocialIdentityCountry value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityCountry read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityCountry instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityCountry given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityCountry + * @throws IOException if the JSON string is invalid with respect to SocialIdentityCountry + */ + public static SocialIdentityCountry fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityCountry.class); + } + + /** + * Convert an instance of SocialIdentityCountry to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityCoursesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityCoursesInner.java new file mode 100644 index 0000000..72052a4 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityCoursesInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityCoursesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityCoursesInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_NUMBER = "Number"; + @SerializedName(SERIALIZED_NAME_NUMBER) + @javax.annotation.Nullable + private String number; + + public SocialIdentityCoursesInner() { + } + + public SocialIdentityCoursesInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public SocialIdentityCoursesInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public SocialIdentityCoursesInner number(@javax.annotation.Nullable String number) { + this.number = number; + return this; + } + + /** + * Get number + * @return number + */ + @javax.annotation.Nullable + public String getNumber() { + return number; + } + + public void setNumber(@javax.annotation.Nullable String number) { + this.number = number; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityCoursesInner instance itself + */ + public SocialIdentityCoursesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityCoursesInner socialIdentityCoursesInner = (SocialIdentityCoursesInner) o; + return Objects.equals(this.id, socialIdentityCoursesInner.id) && + Objects.equals(this.name, socialIdentityCoursesInner.name) && + Objects.equals(this.number, socialIdentityCoursesInner.number)&& + Objects.equals(this.additionalProperties, socialIdentityCoursesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, number, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityCoursesInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" number: ").append(toIndentedString(number)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Number"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityCoursesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityCoursesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityCoursesInner is not found in the empty JSON string", SocialIdentityCoursesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Number") != null && !jsonObj.get("Number").isJsonNull()) && !jsonObj.get("Number").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Number` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Number").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityCoursesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityCoursesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityCoursesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityCoursesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityCoursesInner>() { + @Override + public void write(JsonWriter out, SocialIdentityCoursesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityCoursesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityCoursesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityCoursesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityCoursesInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityCoursesInner + */ + public static SocialIdentityCoursesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityCoursesInner.class); + } + + /** + * Convert an instance of SocialIdentityCoursesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityCurrentStatusInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityCurrentStatusInner.java new file mode 100644 index 0000000..9dcb65f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityCurrentStatusInner.java @@ -0,0 +1,375 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityCurrentStatusInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityCurrentStatusInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_TEXT = "Text"; + @SerializedName(SERIALIZED_NAME_TEXT) + @javax.annotation.Nullable + private String text; + + public static final String SERIALIZED_NAME_SOURCE = "Source"; + @SerializedName(SERIALIZED_NAME_SOURCE) + @javax.annotation.Nullable + private String source; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public SocialIdentityCurrentStatusInner() { + } + + public SocialIdentityCurrentStatusInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public SocialIdentityCurrentStatusInner text(@javax.annotation.Nullable String text) { + this.text = text; + return this; + } + + /** + * Get text + * @return text + */ + @javax.annotation.Nullable + public String getText() { + return text; + } + + public void setText(@javax.annotation.Nullable String text) { + this.text = text; + } + + + public SocialIdentityCurrentStatusInner source(@javax.annotation.Nullable String source) { + this.source = source; + return this; + } + + /** + * Get source + * @return source + */ + @javax.annotation.Nullable + public String getSource() { + return source; + } + + public void setSource(@javax.annotation.Nullable String source) { + this.source = source; + } + + + public SocialIdentityCurrentStatusInner createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get createdDate + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityCurrentStatusInner instance itself + */ + public SocialIdentityCurrentStatusInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityCurrentStatusInner socialIdentityCurrentStatusInner = (SocialIdentityCurrentStatusInner) o; + return Objects.equals(this.id, socialIdentityCurrentStatusInner.id) && + Objects.equals(this.text, socialIdentityCurrentStatusInner.text) && + Objects.equals(this.source, socialIdentityCurrentStatusInner.source) && + Objects.equals(this.createdDate, socialIdentityCurrentStatusInner.createdDate)&& + Objects.equals(this.additionalProperties, socialIdentityCurrentStatusInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, text, source, createdDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityCurrentStatusInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" source: ").append(toIndentedString(source)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Text"); + openapiFields.add("Source"); + openapiFields.add("CreatedDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityCurrentStatusInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityCurrentStatusInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityCurrentStatusInner is not found in the empty JSON string", SocialIdentityCurrentStatusInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Text") != null && !jsonObj.get("Text").isJsonNull()) && !jsonObj.get("Text").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Text").toString())); + } + if ((jsonObj.get("Source") != null && !jsonObj.get("Source").isJsonNull()) && !jsonObj.get("Source").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Source` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Source").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityCurrentStatusInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityCurrentStatusInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityCurrentStatusInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityCurrentStatusInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityCurrentStatusInner>() { + @Override + public void write(JsonWriter out, SocialIdentityCurrentStatusInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityCurrentStatusInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityCurrentStatusInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityCurrentStatusInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityCurrentStatusInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityCurrentStatusInner + */ + public static SocialIdentityCurrentStatusInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityCurrentStatusInner.class); + } + + /** + * Convert an instance of SocialIdentityCurrentStatusInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityEducationsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityEducationsInner.java new file mode 100644 index 0000000..804fecb --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityEducationsInner.java @@ -0,0 +1,522 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityEducationsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityEducationsInner { + public static final String SERIALIZED_NAME_SCHOOL = "School"; + @SerializedName(SERIALIZED_NAME_SCHOOL) + @javax.annotation.Nullable + private String school; + + public static final String SERIALIZED_NAME_YEAR = "Year"; + @SerializedName(SERIALIZED_NAME_YEAR) + @javax.annotation.Nullable + private String year; + + public static final String SERIALIZED_NAME_TYPE = "Type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_NOTES = "Notes"; + @SerializedName(SERIALIZED_NAME_NOTES) + @javax.annotation.Nullable + private String notes; + + public static final String SERIALIZED_NAME_ACTIVITIES = "Activities"; + @SerializedName(SERIALIZED_NAME_ACTIVITIES) + @javax.annotation.Nullable + private String activities; + + public static final String SERIALIZED_NAME_DEGREE = "Degree"; + @SerializedName(SERIALIZED_NAME_DEGREE) + @javax.annotation.Nullable + private String degree; + + public static final String SERIALIZED_NAME_FIELD_OF_STUDY = "FieldOfStudy"; + @SerializedName(SERIALIZED_NAME_FIELD_OF_STUDY) + @javax.annotation.Nullable + private String fieldOfStudy; + + public static final String SERIALIZED_NAME_START_DATE = "StartDate"; + @SerializedName(SERIALIZED_NAME_START_DATE) + @javax.annotation.Nullable + private OffsetDateTime startDate; + + public static final String SERIALIZED_NAME_END_DATE = "EndDate"; + @SerializedName(SERIALIZED_NAME_END_DATE) + @javax.annotation.Nullable + private OffsetDateTime endDate; + + public SocialIdentityEducationsInner() { + } + + public SocialIdentityEducationsInner school(@javax.annotation.Nullable String school) { + this.school = school; + return this; + } + + /** + * Get school + * @return school + */ + @javax.annotation.Nullable + public String getSchool() { + return school; + } + + public void setSchool(@javax.annotation.Nullable String school) { + this.school = school; + } + + + public SocialIdentityEducationsInner year(@javax.annotation.Nullable String year) { + this.year = year; + return this; + } + + /** + * Get year + * @return year + */ + @javax.annotation.Nullable + public String getYear() { + return year; + } + + public void setYear(@javax.annotation.Nullable String year) { + this.year = year; + } + + + public SocialIdentityEducationsInner type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public SocialIdentityEducationsInner notes(@javax.annotation.Nullable String notes) { + this.notes = notes; + return this; + } + + /** + * Get notes + * @return notes + */ + @javax.annotation.Nullable + public String getNotes() { + return notes; + } + + public void setNotes(@javax.annotation.Nullable String notes) { + this.notes = notes; + } + + + public SocialIdentityEducationsInner activities(@javax.annotation.Nullable String activities) { + this.activities = activities; + return this; + } + + /** + * Get activities + * @return activities + */ + @javax.annotation.Nullable + public String getActivities() { + return activities; + } + + public void setActivities(@javax.annotation.Nullable String activities) { + this.activities = activities; + } + + + public SocialIdentityEducationsInner degree(@javax.annotation.Nullable String degree) { + this.degree = degree; + return this; + } + + /** + * Get degree + * @return degree + */ + @javax.annotation.Nullable + public String getDegree() { + return degree; + } + + public void setDegree(@javax.annotation.Nullable String degree) { + this.degree = degree; + } + + + public SocialIdentityEducationsInner fieldOfStudy(@javax.annotation.Nullable String fieldOfStudy) { + this.fieldOfStudy = fieldOfStudy; + return this; + } + + /** + * Get fieldOfStudy + * @return fieldOfStudy + */ + @javax.annotation.Nullable + public String getFieldOfStudy() { + return fieldOfStudy; + } + + public void setFieldOfStudy(@javax.annotation.Nullable String fieldOfStudy) { + this.fieldOfStudy = fieldOfStudy; + } + + + public SocialIdentityEducationsInner startDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Get startDate + * @return startDate + */ + @javax.annotation.Nullable + public OffsetDateTime getStartDate() { + return startDate; + } + + public void setStartDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + } + + + public SocialIdentityEducationsInner endDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * Get endDate + * @return endDate + */ + @javax.annotation.Nullable + public OffsetDateTime getEndDate() { + return endDate; + } + + public void setEndDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityEducationsInner instance itself + */ + public SocialIdentityEducationsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityEducationsInner socialIdentityEducationsInner = (SocialIdentityEducationsInner) o; + return Objects.equals(this.school, socialIdentityEducationsInner.school) && + Objects.equals(this.year, socialIdentityEducationsInner.year) && + Objects.equals(this.type, socialIdentityEducationsInner.type) && + Objects.equals(this.notes, socialIdentityEducationsInner.notes) && + Objects.equals(this.activities, socialIdentityEducationsInner.activities) && + Objects.equals(this.degree, socialIdentityEducationsInner.degree) && + Objects.equals(this.fieldOfStudy, socialIdentityEducationsInner.fieldOfStudy) && + Objects.equals(this.startDate, socialIdentityEducationsInner.startDate) && + Objects.equals(this.endDate, socialIdentityEducationsInner.endDate)&& + Objects.equals(this.additionalProperties, socialIdentityEducationsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(school, year, type, notes, activities, degree, fieldOfStudy, startDate, endDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityEducationsInner {\n"); + sb.append(" school: ").append(toIndentedString(school)).append("\n"); + sb.append(" year: ").append(toIndentedString(year)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" notes: ").append(toIndentedString(notes)).append("\n"); + sb.append(" activities: ").append(toIndentedString(activities)).append("\n"); + sb.append(" degree: ").append(toIndentedString(degree)).append("\n"); + sb.append(" fieldOfStudy: ").append(toIndentedString(fieldOfStudy)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("School"); + openapiFields.add("Year"); + openapiFields.add("Type"); + openapiFields.add("Notes"); + openapiFields.add("Activities"); + openapiFields.add("Degree"); + openapiFields.add("FieldOfStudy"); + openapiFields.add("StartDate"); + openapiFields.add("EndDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityEducationsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityEducationsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityEducationsInner is not found in the empty JSON string", SocialIdentityEducationsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("School") != null && !jsonObj.get("School").isJsonNull()) && !jsonObj.get("School").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `School` to be a primitive type in the JSON string but got `%s`", jsonObj.get("School").toString())); + } + if ((jsonObj.get("Year") != null && !jsonObj.get("Year").isJsonNull()) && !jsonObj.get("Year").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Year` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Year").toString())); + } + if ((jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonNull()) && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + if ((jsonObj.get("Notes") != null && !jsonObj.get("Notes").isJsonNull()) && !jsonObj.get("Notes").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Notes` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Notes").toString())); + } + if ((jsonObj.get("Activities") != null && !jsonObj.get("Activities").isJsonNull()) && !jsonObj.get("Activities").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Activities` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Activities").toString())); + } + if ((jsonObj.get("Degree") != null && !jsonObj.get("Degree").isJsonNull()) && !jsonObj.get("Degree").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Degree` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Degree").toString())); + } + if ((jsonObj.get("FieldOfStudy") != null && !jsonObj.get("FieldOfStudy").isJsonNull()) && !jsonObj.get("FieldOfStudy").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FieldOfStudy` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FieldOfStudy").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityEducationsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityEducationsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityEducationsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityEducationsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityEducationsInner>() { + @Override + public void write(JsonWriter out, SocialIdentityEducationsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityEducationsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityEducationsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityEducationsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityEducationsInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityEducationsInner + */ + public static SocialIdentityEducationsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityEducationsInner.class); + } + + /** + * Convert an instance of SocialIdentityEducationsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityEmailInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityEmailInner.java new file mode 100644 index 0000000..06d8e5b --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityEmailInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityEmailInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityEmailInner { + public static final String SERIALIZED_NAME_TYPE = "Type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_VALUE = "Value"; + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nullable + private String value; + + public SocialIdentityEmailInner() { + } + + public SocialIdentityEmailInner type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public SocialIdentityEmailInner value(@javax.annotation.Nullable String value) { + this.value = value; + return this; + } + + /** + * Get value + * @return value + */ + @javax.annotation.Nullable + public String getValue() { + return value; + } + + public void setValue(@javax.annotation.Nullable String value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityEmailInner instance itself + */ + public SocialIdentityEmailInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityEmailInner socialIdentityEmailInner = (SocialIdentityEmailInner) o; + return Objects.equals(this.type, socialIdentityEmailInner.type) && + Objects.equals(this.value, socialIdentityEmailInner.value)&& + Objects.equals(this.additionalProperties, socialIdentityEmailInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityEmailInner {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Type"); + openapiFields.add("Value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityEmailInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityEmailInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityEmailInner is not found in the empty JSON string", SocialIdentityEmailInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonNull()) && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + if ((jsonObj.get("Value") != null && !jsonObj.get("Value").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityEmailInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityEmailInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityEmailInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityEmailInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityEmailInner>() { + @Override + public void write(JsonWriter out, SocialIdentityEmailInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityEmailInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityEmailInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityEmailInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityEmailInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityEmailInner + */ + public static SocialIdentityEmailInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityEmailInner.class); + } + + /** + * Convert an instance of SocialIdentityEmailInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityFamilyInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityFamilyInner.java new file mode 100644 index 0000000..ef4b9a0 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityFamilyInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityFamilyInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityFamilyInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_RELATIONSHIP = "Relationship"; + @SerializedName(SERIALIZED_NAME_RELATIONSHIP) + @javax.annotation.Nullable + private String relationship; + + public SocialIdentityFamilyInner() { + } + + public SocialIdentityFamilyInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public SocialIdentityFamilyInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public SocialIdentityFamilyInner relationship(@javax.annotation.Nullable String relationship) { + this.relationship = relationship; + return this; + } + + /** + * Get relationship + * @return relationship + */ + @javax.annotation.Nullable + public String getRelationship() { + return relationship; + } + + public void setRelationship(@javax.annotation.Nullable String relationship) { + this.relationship = relationship; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityFamilyInner instance itself + */ + public SocialIdentityFamilyInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityFamilyInner socialIdentityFamilyInner = (SocialIdentityFamilyInner) o; + return Objects.equals(this.id, socialIdentityFamilyInner.id) && + Objects.equals(this.name, socialIdentityFamilyInner.name) && + Objects.equals(this.relationship, socialIdentityFamilyInner.relationship)&& + Objects.equals(this.additionalProperties, socialIdentityFamilyInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, relationship, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityFamilyInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" relationship: ").append(toIndentedString(relationship)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Relationship"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityFamilyInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityFamilyInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityFamilyInner is not found in the empty JSON string", SocialIdentityFamilyInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Relationship") != null && !jsonObj.get("Relationship").isJsonNull()) && !jsonObj.get("Relationship").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Relationship` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Relationship").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityFamilyInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityFamilyInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityFamilyInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityFamilyInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityFamilyInner>() { + @Override + public void write(JsonWriter out, SocialIdentityFamilyInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityFamilyInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityFamilyInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityFamilyInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityFamilyInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityFamilyInner + */ + public static SocialIdentityFamilyInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityFamilyInner.class); + } + + /** + * Convert an instance of SocialIdentityFamilyInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityFavoriteThingsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityFavoriteThingsInner.java new file mode 100644 index 0000000..c17f76d --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityFavoriteThingsInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityFavoriteThingsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityFavoriteThingsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_TYPE = "Type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public SocialIdentityFavoriteThingsInner() { + } + + public SocialIdentityFavoriteThingsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public SocialIdentityFavoriteThingsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public SocialIdentityFavoriteThingsInner type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityFavoriteThingsInner instance itself + */ + public SocialIdentityFavoriteThingsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityFavoriteThingsInner socialIdentityFavoriteThingsInner = (SocialIdentityFavoriteThingsInner) o; + return Objects.equals(this.id, socialIdentityFavoriteThingsInner.id) && + Objects.equals(this.name, socialIdentityFavoriteThingsInner.name) && + Objects.equals(this.type, socialIdentityFavoriteThingsInner.type)&& + Objects.equals(this.additionalProperties, socialIdentityFavoriteThingsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, type, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityFavoriteThingsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Type"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityFavoriteThingsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityFavoriteThingsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityFavoriteThingsInner is not found in the empty JSON string", SocialIdentityFavoriteThingsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Type") != null && !jsonObj.get("Type").isJsonNull()) && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityFavoriteThingsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityFavoriteThingsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityFavoriteThingsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityFavoriteThingsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityFavoriteThingsInner>() { + @Override + public void write(JsonWriter out, SocialIdentityFavoriteThingsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityFavoriteThingsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityFavoriteThingsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityFavoriteThingsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityFavoriteThingsInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityFavoriteThingsInner + */ + public static SocialIdentityFavoriteThingsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityFavoriteThingsInner.class); + } + + /** + * Convert an instance of SocialIdentityFavoriteThingsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityGamesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityGamesInner.java new file mode 100644 index 0000000..d6e53ec --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityGamesInner.java @@ -0,0 +1,375 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityGamesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityGamesInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_CATEGORY = "Category"; + @SerializedName(SERIALIZED_NAME_CATEGORY) + @javax.annotation.Nullable + private String category; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public SocialIdentityGamesInner() { + } + + public SocialIdentityGamesInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public SocialIdentityGamesInner category(@javax.annotation.Nullable String category) { + this.category = category; + return this; + } + + /** + * Get category + * @return category + */ + @javax.annotation.Nullable + public String getCategory() { + return category; + } + + public void setCategory(@javax.annotation.Nullable String category) { + this.category = category; + } + + + public SocialIdentityGamesInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public SocialIdentityGamesInner createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get createdDate + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityGamesInner instance itself + */ + public SocialIdentityGamesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityGamesInner socialIdentityGamesInner = (SocialIdentityGamesInner) o; + return Objects.equals(this.id, socialIdentityGamesInner.id) && + Objects.equals(this.category, socialIdentityGamesInner.category) && + Objects.equals(this.name, socialIdentityGamesInner.name) && + Objects.equals(this.createdDate, socialIdentityGamesInner.createdDate)&& + Objects.equals(this.additionalProperties, socialIdentityGamesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, createdDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityGamesInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Category"); + openapiFields.add("Name"); + openapiFields.add("CreatedDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityGamesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityGamesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityGamesInner is not found in the empty JSON string", SocialIdentityGamesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Category") != null && !jsonObj.get("Category").isJsonNull()) && !jsonObj.get("Category").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Category` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Category").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityGamesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityGamesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityGamesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityGamesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityGamesInner>() { + @Override + public void write(JsonWriter out, SocialIdentityGamesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityGamesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityGamesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityGamesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityGamesInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityGamesInner + */ + public static SocialIdentityGamesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityGamesInner.class); + } + + /** + * Convert an instance of SocialIdentityGamesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityIMAccountsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityIMAccountsInner.java new file mode 100644 index 0000000..f16796c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityIMAccountsInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityIMAccountsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityIMAccountsInner { + public static final String SERIALIZED_NAME_ACCOUNT_TYPE = "AccountType"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_TYPE) + @javax.annotation.Nullable + private String accountType; + + public static final String SERIALIZED_NAME_ACCOUNT_NAME = "AccountName"; + @SerializedName(SERIALIZED_NAME_ACCOUNT_NAME) + @javax.annotation.Nullable + private String accountName; + + public SocialIdentityIMAccountsInner() { + } + + public SocialIdentityIMAccountsInner accountType(@javax.annotation.Nullable String accountType) { + this.accountType = accountType; + return this; + } + + /** + * Get accountType + * @return accountType + */ + @javax.annotation.Nullable + public String getAccountType() { + return accountType; + } + + public void setAccountType(@javax.annotation.Nullable String accountType) { + this.accountType = accountType; + } + + + public SocialIdentityIMAccountsInner accountName(@javax.annotation.Nullable String accountName) { + this.accountName = accountName; + return this; + } + + /** + * Get accountName + * @return accountName + */ + @javax.annotation.Nullable + public String getAccountName() { + return accountName; + } + + public void setAccountName(@javax.annotation.Nullable String accountName) { + this.accountName = accountName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityIMAccountsInner instance itself + */ + public SocialIdentityIMAccountsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityIMAccountsInner socialIdentityIMAccountsInner = (SocialIdentityIMAccountsInner) o; + return Objects.equals(this.accountType, socialIdentityIMAccountsInner.accountType) && + Objects.equals(this.accountName, socialIdentityIMAccountsInner.accountName)&& + Objects.equals(this.additionalProperties, socialIdentityIMAccountsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accountType, accountName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityIMAccountsInner {\n"); + sb.append(" accountType: ").append(toIndentedString(accountType)).append("\n"); + sb.append(" accountName: ").append(toIndentedString(accountName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AccountType"); + openapiFields.add("AccountName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityIMAccountsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityIMAccountsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityIMAccountsInner is not found in the empty JSON string", SocialIdentityIMAccountsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("AccountType") != null && !jsonObj.get("AccountType").isJsonNull()) && !jsonObj.get("AccountType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccountType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccountType").toString())); + } + if ((jsonObj.get("AccountName") != null && !jsonObj.get("AccountName").isJsonNull()) && !jsonObj.get("AccountName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccountName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccountName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityIMAccountsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityIMAccountsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityIMAccountsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityIMAccountsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityIMAccountsInner>() { + @Override + public void write(JsonWriter out, SocialIdentityIMAccountsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityIMAccountsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityIMAccountsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityIMAccountsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityIMAccountsInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityIMAccountsInner + */ + public static SocialIdentityIMAccountsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityIMAccountsInner.class); + } + + /** + * Convert an instance of SocialIdentityIMAccountsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityInspirationalPeopleInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityInspirationalPeopleInner.java new file mode 100644 index 0000000..0f8824a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityInspirationalPeopleInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityInspirationalPeopleInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityInspirationalPeopleInner { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public SocialIdentityInspirationalPeopleInner() { + } + + public SocialIdentityInspirationalPeopleInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public SocialIdentityInspirationalPeopleInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityInspirationalPeopleInner instance itself + */ + public SocialIdentityInspirationalPeopleInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityInspirationalPeopleInner socialIdentityInspirationalPeopleInner = (SocialIdentityInspirationalPeopleInner) o; + return Objects.equals(this.name, socialIdentityInspirationalPeopleInner.name) && + Objects.equals(this.id, socialIdentityInspirationalPeopleInner.id)&& + Objects.equals(this.additionalProperties, socialIdentityInspirationalPeopleInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, id, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityInspirationalPeopleInner {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + openapiFields.add("Id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityInspirationalPeopleInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityInspirationalPeopleInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityInspirationalPeopleInner is not found in the empty JSON string", SocialIdentityInspirationalPeopleInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityInspirationalPeopleInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityInspirationalPeopleInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityInspirationalPeopleInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityInspirationalPeopleInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityInspirationalPeopleInner>() { + @Override + public void write(JsonWriter out, SocialIdentityInspirationalPeopleInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityInspirationalPeopleInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityInspirationalPeopleInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityInspirationalPeopleInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityInspirationalPeopleInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityInspirationalPeopleInner + */ + public static SocialIdentityInspirationalPeopleInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityInspirationalPeopleInner.class); + } + + /** + * Convert an instance of SocialIdentityInspirationalPeopleInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityInterestsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityInterestsInner.java new file mode 100644 index 0000000..aed7575 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityInterestsInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityInterestsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityInterestsInner { + public static final String SERIALIZED_NAME_INTEREST_TYPE = "InterestType"; + @SerializedName(SERIALIZED_NAME_INTEREST_TYPE) + @javax.annotation.Nullable + private String interestType; + + public static final String SERIALIZED_NAME_INTEREST_NAME = "InterestName"; + @SerializedName(SERIALIZED_NAME_INTEREST_NAME) + @javax.annotation.Nullable + private String interestName; + + public SocialIdentityInterestsInner() { + } + + public SocialIdentityInterestsInner interestType(@javax.annotation.Nullable String interestType) { + this.interestType = interestType; + return this; + } + + /** + * Get interestType + * @return interestType + */ + @javax.annotation.Nullable + public String getInterestType() { + return interestType; + } + + public void setInterestType(@javax.annotation.Nullable String interestType) { + this.interestType = interestType; + } + + + public SocialIdentityInterestsInner interestName(@javax.annotation.Nullable String interestName) { + this.interestName = interestName; + return this; + } + + /** + * Get interestName + * @return interestName + */ + @javax.annotation.Nullable + public String getInterestName() { + return interestName; + } + + public void setInterestName(@javax.annotation.Nullable String interestName) { + this.interestName = interestName; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityInterestsInner instance itself + */ + public SocialIdentityInterestsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityInterestsInner socialIdentityInterestsInner = (SocialIdentityInterestsInner) o; + return Objects.equals(this.interestType, socialIdentityInterestsInner.interestType) && + Objects.equals(this.interestName, socialIdentityInterestsInner.interestName)&& + Objects.equals(this.additionalProperties, socialIdentityInterestsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(interestType, interestName, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityInterestsInner {\n"); + sb.append(" interestType: ").append(toIndentedString(interestType)).append("\n"); + sb.append(" interestName: ").append(toIndentedString(interestName)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("InterestType"); + openapiFields.add("InterestName"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityInterestsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityInterestsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityInterestsInner is not found in the empty JSON string", SocialIdentityInterestsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("InterestType") != null && !jsonObj.get("InterestType").isJsonNull()) && !jsonObj.get("InterestType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `InterestType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("InterestType").toString())); + } + if ((jsonObj.get("InterestName") != null && !jsonObj.get("InterestName").isJsonNull()) && !jsonObj.get("InterestName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `InterestName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("InterestName").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityInterestsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityInterestsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityInterestsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityInterestsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityInterestsInner>() { + @Override + public void write(JsonWriter out, SocialIdentityInterestsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityInterestsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityInterestsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityInterestsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityInterestsInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityInterestsInner + */ + public static SocialIdentityInterestsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityInterestsInner.class); + } + + /** + * Convert an instance of SocialIdentityInterestsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityJobBookmarksInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityJobBookmarksInner.java new file mode 100644 index 0000000..a424cd3 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityJobBookmarksInner.java @@ -0,0 +1,410 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.SocialIdentityJobBookmarksInnerJob; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityJobBookmarksInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityJobBookmarksInner { + public static final String SERIALIZED_NAME_IS_APPLIED = "IsApplied"; + @SerializedName(SERIALIZED_NAME_IS_APPLIED) + @javax.annotation.Nullable + private Boolean isApplied; + + public static final String SERIALIZED_NAME_IS_SAVED = "IsSaved"; + @SerializedName(SERIALIZED_NAME_IS_SAVED) + @javax.annotation.Nullable + private Boolean isSaved; + + public static final String SERIALIZED_NAME_APPLY_TIMESTAMP = "ApplyTimestamp"; + @SerializedName(SERIALIZED_NAME_APPLY_TIMESTAMP) + @javax.annotation.Nullable + private OffsetDateTime applyTimestamp; + + public static final String SERIALIZED_NAME_SAVED_TIMESTAMP = "SavedTimestamp"; + @SerializedName(SERIALIZED_NAME_SAVED_TIMESTAMP) + @javax.annotation.Nullable + private OffsetDateTime savedTimestamp; + + public static final String SERIALIZED_NAME_JOB = "Job"; + @SerializedName(SERIALIZED_NAME_JOB) + @javax.annotation.Nullable + private SocialIdentityJobBookmarksInnerJob job; + + public SocialIdentityJobBookmarksInner() { + } + + public SocialIdentityJobBookmarksInner isApplied(@javax.annotation.Nullable Boolean isApplied) { + this.isApplied = isApplied; + return this; + } + + /** + * Get isApplied + * @return isApplied + */ + @javax.annotation.Nullable + public Boolean getIsApplied() { + return isApplied; + } + + public void setIsApplied(@javax.annotation.Nullable Boolean isApplied) { + this.isApplied = isApplied; + } + + + public SocialIdentityJobBookmarksInner isSaved(@javax.annotation.Nullable Boolean isSaved) { + this.isSaved = isSaved; + return this; + } + + /** + * Get isSaved + * @return isSaved + */ + @javax.annotation.Nullable + public Boolean getIsSaved() { + return isSaved; + } + + public void setIsSaved(@javax.annotation.Nullable Boolean isSaved) { + this.isSaved = isSaved; + } + + + public SocialIdentityJobBookmarksInner applyTimestamp(@javax.annotation.Nullable OffsetDateTime applyTimestamp) { + this.applyTimestamp = applyTimestamp; + return this; + } + + /** + * Get applyTimestamp + * @return applyTimestamp + */ + @javax.annotation.Nullable + public OffsetDateTime getApplyTimestamp() { + return applyTimestamp; + } + + public void setApplyTimestamp(@javax.annotation.Nullable OffsetDateTime applyTimestamp) { + this.applyTimestamp = applyTimestamp; + } + + + public SocialIdentityJobBookmarksInner savedTimestamp(@javax.annotation.Nullable OffsetDateTime savedTimestamp) { + this.savedTimestamp = savedTimestamp; + return this; + } + + /** + * Get savedTimestamp + * @return savedTimestamp + */ + @javax.annotation.Nullable + public OffsetDateTime getSavedTimestamp() { + return savedTimestamp; + } + + public void setSavedTimestamp(@javax.annotation.Nullable OffsetDateTime savedTimestamp) { + this.savedTimestamp = savedTimestamp; + } + + + public SocialIdentityJobBookmarksInner job(@javax.annotation.Nullable SocialIdentityJobBookmarksInnerJob job) { + this.job = job; + return this; + } + + /** + * Get job + * @return job + */ + @javax.annotation.Nullable + public SocialIdentityJobBookmarksInnerJob getJob() { + return job; + } + + public void setJob(@javax.annotation.Nullable SocialIdentityJobBookmarksInnerJob job) { + this.job = job; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityJobBookmarksInner instance itself + */ + public SocialIdentityJobBookmarksInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityJobBookmarksInner socialIdentityJobBookmarksInner = (SocialIdentityJobBookmarksInner) o; + return Objects.equals(this.isApplied, socialIdentityJobBookmarksInner.isApplied) && + Objects.equals(this.isSaved, socialIdentityJobBookmarksInner.isSaved) && + Objects.equals(this.applyTimestamp, socialIdentityJobBookmarksInner.applyTimestamp) && + Objects.equals(this.savedTimestamp, socialIdentityJobBookmarksInner.savedTimestamp) && + Objects.equals(this.job, socialIdentityJobBookmarksInner.job)&& + Objects.equals(this.additionalProperties, socialIdentityJobBookmarksInner.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(isApplied, isSaved, applyTimestamp, savedTimestamp, job, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityJobBookmarksInner {\n"); + sb.append(" isApplied: ").append(toIndentedString(isApplied)).append("\n"); + sb.append(" isSaved: ").append(toIndentedString(isSaved)).append("\n"); + sb.append(" applyTimestamp: ").append(toIndentedString(applyTimestamp)).append("\n"); + sb.append(" savedTimestamp: ").append(toIndentedString(savedTimestamp)).append("\n"); + sb.append(" job: ").append(toIndentedString(job)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsApplied"); + openapiFields.add("IsSaved"); + openapiFields.add("ApplyTimestamp"); + openapiFields.add("SavedTimestamp"); + openapiFields.add("Job"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityJobBookmarksInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityJobBookmarksInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityJobBookmarksInner is not found in the empty JSON string", SocialIdentityJobBookmarksInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `Job` + if (jsonObj.get("Job") != null && !jsonObj.get("Job").isJsonNull()) { + SocialIdentityJobBookmarksInnerJob.validateJsonElement(jsonObj.get("Job")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityJobBookmarksInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityJobBookmarksInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityJobBookmarksInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityJobBookmarksInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityJobBookmarksInner>() { + @Override + public void write(JsonWriter out, SocialIdentityJobBookmarksInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityJobBookmarksInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityJobBookmarksInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityJobBookmarksInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityJobBookmarksInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityJobBookmarksInner + */ + public static SocialIdentityJobBookmarksInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityJobBookmarksInner.class); + } + + /** + * Convert an instance of SocialIdentityJobBookmarksInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityJobBookmarksInnerJob.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityJobBookmarksInnerJob.java new file mode 100644 index 0000000..3e2460b --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityJobBookmarksInnerJob.java @@ -0,0 +1,448 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.SocialIdentityJobBookmarksInnerJobCompony; +import com.loginradius.sdk.internal.openapi.model.SocialIdentityJobBookmarksInnerJobPosition; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityJobBookmarksInnerJob + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityJobBookmarksInnerJob { + public static final String SERIALIZED_NAME_ACTIVE = "Active"; + @SerializedName(SERIALIZED_NAME_ACTIVE) + @javax.annotation.Nullable + private Boolean active; + + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_DESCRIPTION_SNIPPET = "DescriptionSnippet"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION_SNIPPET) + @javax.annotation.Nullable + private String descriptionSnippet; + + public static final String SERIALIZED_NAME_POSTING_TIMESTAMP = "PostingTimestamp"; + @SerializedName(SERIALIZED_NAME_POSTING_TIMESTAMP) + @javax.annotation.Nullable + private OffsetDateTime postingTimestamp; + + public static final String SERIALIZED_NAME_COMPONY = "Compony"; + @SerializedName(SERIALIZED_NAME_COMPONY) + @javax.annotation.Nullable + private SocialIdentityJobBookmarksInnerJobCompony compony; + + public static final String SERIALIZED_NAME_POSITION = "Position"; + @SerializedName(SERIALIZED_NAME_POSITION) + @javax.annotation.Nullable + private SocialIdentityJobBookmarksInnerJobPosition position; + + public SocialIdentityJobBookmarksInnerJob() { + } + + public SocialIdentityJobBookmarksInnerJob active(@javax.annotation.Nullable Boolean active) { + this.active = active; + return this; + } + + /** + * Get active + * @return active + */ + @javax.annotation.Nullable + public Boolean getActive() { + return active; + } + + public void setActive(@javax.annotation.Nullable Boolean active) { + this.active = active; + } + + + public SocialIdentityJobBookmarksInnerJob id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public SocialIdentityJobBookmarksInnerJob descriptionSnippet(@javax.annotation.Nullable String descriptionSnippet) { + this.descriptionSnippet = descriptionSnippet; + return this; + } + + /** + * Get descriptionSnippet + * @return descriptionSnippet + */ + @javax.annotation.Nullable + public String getDescriptionSnippet() { + return descriptionSnippet; + } + + public void setDescriptionSnippet(@javax.annotation.Nullable String descriptionSnippet) { + this.descriptionSnippet = descriptionSnippet; + } + + + public SocialIdentityJobBookmarksInnerJob postingTimestamp(@javax.annotation.Nullable OffsetDateTime postingTimestamp) { + this.postingTimestamp = postingTimestamp; + return this; + } + + /** + * Get postingTimestamp + * @return postingTimestamp + */ + @javax.annotation.Nullable + public OffsetDateTime getPostingTimestamp() { + return postingTimestamp; + } + + public void setPostingTimestamp(@javax.annotation.Nullable OffsetDateTime postingTimestamp) { + this.postingTimestamp = postingTimestamp; + } + + + public SocialIdentityJobBookmarksInnerJob compony(@javax.annotation.Nullable SocialIdentityJobBookmarksInnerJobCompony compony) { + this.compony = compony; + return this; + } + + /** + * Get compony + * @return compony + */ + @javax.annotation.Nullable + public SocialIdentityJobBookmarksInnerJobCompony getCompony() { + return compony; + } + + public void setCompony(@javax.annotation.Nullable SocialIdentityJobBookmarksInnerJobCompony compony) { + this.compony = compony; + } + + + public SocialIdentityJobBookmarksInnerJob position(@javax.annotation.Nullable SocialIdentityJobBookmarksInnerJobPosition position) { + this.position = position; + return this; + } + + /** + * Get position + * @return position + */ + @javax.annotation.Nullable + public SocialIdentityJobBookmarksInnerJobPosition getPosition() { + return position; + } + + public void setPosition(@javax.annotation.Nullable SocialIdentityJobBookmarksInnerJobPosition position) { + this.position = position; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityJobBookmarksInnerJob instance itself + */ + public SocialIdentityJobBookmarksInnerJob putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityJobBookmarksInnerJob socialIdentityJobBookmarksInnerJob = (SocialIdentityJobBookmarksInnerJob) o; + return Objects.equals(this.active, socialIdentityJobBookmarksInnerJob.active) && + Objects.equals(this.id, socialIdentityJobBookmarksInnerJob.id) && + Objects.equals(this.descriptionSnippet, socialIdentityJobBookmarksInnerJob.descriptionSnippet) && + Objects.equals(this.postingTimestamp, socialIdentityJobBookmarksInnerJob.postingTimestamp) && + Objects.equals(this.compony, socialIdentityJobBookmarksInnerJob.compony) && + Objects.equals(this.position, socialIdentityJobBookmarksInnerJob.position)&& + Objects.equals(this.additionalProperties, socialIdentityJobBookmarksInnerJob.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(active, id, descriptionSnippet, postingTimestamp, compony, position, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityJobBookmarksInnerJob {\n"); + sb.append(" active: ").append(toIndentedString(active)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" descriptionSnippet: ").append(toIndentedString(descriptionSnippet)).append("\n"); + sb.append(" postingTimestamp: ").append(toIndentedString(postingTimestamp)).append("\n"); + sb.append(" compony: ").append(toIndentedString(compony)).append("\n"); + sb.append(" position: ").append(toIndentedString(position)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Active"); + openapiFields.add("Id"); + openapiFields.add("DescriptionSnippet"); + openapiFields.add("PostingTimestamp"); + openapiFields.add("Compony"); + openapiFields.add("Position"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityJobBookmarksInnerJob + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityJobBookmarksInnerJob.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityJobBookmarksInnerJob is not found in the empty JSON string", SocialIdentityJobBookmarksInnerJob.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("DescriptionSnippet") != null && !jsonObj.get("DescriptionSnippet").isJsonNull()) && !jsonObj.get("DescriptionSnippet").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DescriptionSnippet` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DescriptionSnippet").toString())); + } + // validate the optional field `Compony` + if (jsonObj.get("Compony") != null && !jsonObj.get("Compony").isJsonNull()) { + SocialIdentityJobBookmarksInnerJobCompony.validateJsonElement(jsonObj.get("Compony")); + } + // validate the optional field `Position` + if (jsonObj.get("Position") != null && !jsonObj.get("Position").isJsonNull()) { + SocialIdentityJobBookmarksInnerJobPosition.validateJsonElement(jsonObj.get("Position")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityJobBookmarksInnerJob.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityJobBookmarksInnerJob' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityJobBookmarksInnerJob> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityJobBookmarksInnerJob.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityJobBookmarksInnerJob>() { + @Override + public void write(JsonWriter out, SocialIdentityJobBookmarksInnerJob value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityJobBookmarksInnerJob read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityJobBookmarksInnerJob instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityJobBookmarksInnerJob given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityJobBookmarksInnerJob + * @throws IOException if the JSON string is invalid with respect to SocialIdentityJobBookmarksInnerJob + */ + public static SocialIdentityJobBookmarksInnerJob fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityJobBookmarksInnerJob.class); + } + + /** + * Convert an instance of SocialIdentityJobBookmarksInnerJob to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityJobBookmarksInnerJobCompony.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityJobBookmarksInnerJobCompony.java new file mode 100644 index 0000000..37716d8 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityJobBookmarksInnerJobCompony.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityJobBookmarksInnerJobCompony + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityJobBookmarksInnerJobCompony { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public SocialIdentityJobBookmarksInnerJobCompony() { + } + + public SocialIdentityJobBookmarksInnerJobCompony id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public SocialIdentityJobBookmarksInnerJobCompony name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityJobBookmarksInnerJobCompony instance itself + */ + public SocialIdentityJobBookmarksInnerJobCompony putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityJobBookmarksInnerJobCompony socialIdentityJobBookmarksInnerJobCompony = (SocialIdentityJobBookmarksInnerJobCompony) o; + return Objects.equals(this.id, socialIdentityJobBookmarksInnerJobCompony.id) && + Objects.equals(this.name, socialIdentityJobBookmarksInnerJobCompony.name)&& + Objects.equals(this.additionalProperties, socialIdentityJobBookmarksInnerJobCompony.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityJobBookmarksInnerJobCompony {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityJobBookmarksInnerJobCompony + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityJobBookmarksInnerJobCompony.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityJobBookmarksInnerJobCompony is not found in the empty JSON string", SocialIdentityJobBookmarksInnerJobCompony.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityJobBookmarksInnerJobCompony.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityJobBookmarksInnerJobCompony' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityJobBookmarksInnerJobCompony> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityJobBookmarksInnerJobCompony.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityJobBookmarksInnerJobCompony>() { + @Override + public void write(JsonWriter out, SocialIdentityJobBookmarksInnerJobCompony value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityJobBookmarksInnerJobCompony read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityJobBookmarksInnerJobCompony instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityJobBookmarksInnerJobCompony given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityJobBookmarksInnerJobCompony + * @throws IOException if the JSON string is invalid with respect to SocialIdentityJobBookmarksInnerJobCompony + */ + public static SocialIdentityJobBookmarksInnerJobCompony fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityJobBookmarksInnerJobCompony.class); + } + + /** + * Convert an instance of SocialIdentityJobBookmarksInnerJobCompony to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityJobBookmarksInnerJobPosition.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityJobBookmarksInnerJobPosition.java new file mode 100644 index 0000000..3ff09f4 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityJobBookmarksInnerJobPosition.java @@ -0,0 +1,287 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityJobBookmarksInnerJobPosition + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityJobBookmarksInnerJobPosition { + public static final String SERIALIZED_NAME_TITLE = "Title"; + @SerializedName(SERIALIZED_NAME_TITLE) + @javax.annotation.Nullable + private String title; + + public SocialIdentityJobBookmarksInnerJobPosition() { + } + + public SocialIdentityJobBookmarksInnerJobPosition title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * Get title + * @return title + */ + @javax.annotation.Nullable + public String getTitle() { + return title; + } + + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityJobBookmarksInnerJobPosition instance itself + */ + public SocialIdentityJobBookmarksInnerJobPosition putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityJobBookmarksInnerJobPosition socialIdentityJobBookmarksInnerJobPosition = (SocialIdentityJobBookmarksInnerJobPosition) o; + return Objects.equals(this.title, socialIdentityJobBookmarksInnerJobPosition.title)&& + Objects.equals(this.additionalProperties, socialIdentityJobBookmarksInnerJobPosition.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(title, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityJobBookmarksInnerJobPosition {\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Title"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityJobBookmarksInnerJobPosition + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityJobBookmarksInnerJobPosition.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityJobBookmarksInnerJobPosition is not found in the empty JSON string", SocialIdentityJobBookmarksInnerJobPosition.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Title") != null && !jsonObj.get("Title").isJsonNull()) && !jsonObj.get("Title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Title").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityJobBookmarksInnerJobPosition.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityJobBookmarksInnerJobPosition' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityJobBookmarksInnerJobPosition> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityJobBookmarksInnerJobPosition.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityJobBookmarksInnerJobPosition>() { + @Override + public void write(JsonWriter out, SocialIdentityJobBookmarksInnerJobPosition value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityJobBookmarksInnerJobPosition read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityJobBookmarksInnerJobPosition instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityJobBookmarksInnerJobPosition given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityJobBookmarksInnerJobPosition + * @throws IOException if the JSON string is invalid with respect to SocialIdentityJobBookmarksInnerJobPosition + */ + public static SocialIdentityJobBookmarksInnerJobPosition fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityJobBookmarksInnerJobPosition.class); + } + + /** + * Convert an instance of SocialIdentityJobBookmarksInnerJobPosition to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityKloutScore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityKloutScore.java new file mode 100644 index 0000000..fa55283 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityKloutScore.java @@ -0,0 +1,314 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityKloutScore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityKloutScore { + public static final String SERIALIZED_NAME_KLOUT_ID = "KloutId"; + @SerializedName(SERIALIZED_NAME_KLOUT_ID) + @javax.annotation.Nullable + private String kloutId; + + public static final String SERIALIZED_NAME_SCORE = "Score"; + @SerializedName(SERIALIZED_NAME_SCORE) + @javax.annotation.Nullable + private Integer score; + + public SocialIdentityKloutScore() { + } + + public SocialIdentityKloutScore kloutId(@javax.annotation.Nullable String kloutId) { + this.kloutId = kloutId; + return this; + } + + /** + * Get kloutId + * @return kloutId + */ + @javax.annotation.Nullable + public String getKloutId() { + return kloutId; + } + + public void setKloutId(@javax.annotation.Nullable String kloutId) { + this.kloutId = kloutId; + } + + + public SocialIdentityKloutScore score(@javax.annotation.Nullable Integer score) { + this.score = score; + return this; + } + + /** + * Get score + * @return score + */ + @javax.annotation.Nullable + public Integer getScore() { + return score; + } + + public void setScore(@javax.annotation.Nullable Integer score) { + this.score = score; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityKloutScore instance itself + */ + public SocialIdentityKloutScore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityKloutScore socialIdentityKloutScore = (SocialIdentityKloutScore) o; + return Objects.equals(this.kloutId, socialIdentityKloutScore.kloutId) && + Objects.equals(this.score, socialIdentityKloutScore.score)&& + Objects.equals(this.additionalProperties, socialIdentityKloutScore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(kloutId, score, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityKloutScore {\n"); + sb.append(" kloutId: ").append(toIndentedString(kloutId)).append("\n"); + sb.append(" score: ").append(toIndentedString(score)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("KloutId"); + openapiFields.add("Score"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityKloutScore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityKloutScore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityKloutScore is not found in the empty JSON string", SocialIdentityKloutScore.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("KloutId") != null && !jsonObj.get("KloutId").isJsonNull()) && !jsonObj.get("KloutId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `KloutId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("KloutId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityKloutScore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityKloutScore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityKloutScore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityKloutScore.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityKloutScore>() { + @Override + public void write(JsonWriter out, SocialIdentityKloutScore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityKloutScore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityKloutScore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityKloutScore given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityKloutScore + * @throws IOException if the JSON string is invalid with respect to SocialIdentityKloutScore + */ + public static SocialIdentityKloutScore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityKloutScore.class); + } + + /** + * Convert an instance of SocialIdentityKloutScore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityLanguagesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityLanguagesInner.java new file mode 100644 index 0000000..7aa710a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityLanguagesInner.java @@ -0,0 +1,377 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityLanguagesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityLanguagesInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_PROFICIENCY = "Proficiency"; + @SerializedName(SERIALIZED_NAME_PROFICIENCY) + @javax.annotation.Nullable + private String proficiency; + + public static final String SERIALIZED_NAME_OP = "op"; + @SerializedName(SERIALIZED_NAME_OP) + @javax.annotation.Nullable + private String op; + + public SocialIdentityLanguagesInner() { + } + + public SocialIdentityLanguagesInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public SocialIdentityLanguagesInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public SocialIdentityLanguagesInner proficiency(@javax.annotation.Nullable String proficiency) { + this.proficiency = proficiency; + return this; + } + + /** + * Get proficiency + * @return proficiency + */ + @javax.annotation.Nullable + public String getProficiency() { + return proficiency; + } + + public void setProficiency(@javax.annotation.Nullable String proficiency) { + this.proficiency = proficiency; + } + + + public SocialIdentityLanguagesInner op(@javax.annotation.Nullable String op) { + this.op = op; + return this; + } + + /** + * Get op + * @return op + */ + @javax.annotation.Nullable + public String getOp() { + return op; + } + + public void setOp(@javax.annotation.Nullable String op) { + this.op = op; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityLanguagesInner instance itself + */ + public SocialIdentityLanguagesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityLanguagesInner socialIdentityLanguagesInner = (SocialIdentityLanguagesInner) o; + return Objects.equals(this.id, socialIdentityLanguagesInner.id) && + Objects.equals(this.name, socialIdentityLanguagesInner.name) && + Objects.equals(this.proficiency, socialIdentityLanguagesInner.proficiency) && + Objects.equals(this.op, socialIdentityLanguagesInner.op)&& + Objects.equals(this.additionalProperties, socialIdentityLanguagesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, proficiency, op, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityLanguagesInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" proficiency: ").append(toIndentedString(proficiency)).append("\n"); + sb.append(" op: ").append(toIndentedString(op)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Proficiency"); + openapiFields.add("op"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityLanguagesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityLanguagesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityLanguagesInner is not found in the empty JSON string", SocialIdentityLanguagesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Proficiency") != null && !jsonObj.get("Proficiency").isJsonNull()) && !jsonObj.get("Proficiency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Proficiency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Proficiency").toString())); + } + if ((jsonObj.get("op") != null && !jsonObj.get("op").isJsonNull()) && !jsonObj.get("op").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `op` to be a primitive type in the JSON string but got `%s`", jsonObj.get("op").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityLanguagesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityLanguagesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityLanguagesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityLanguagesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityLanguagesInner>() { + @Override + public void write(JsonWriter out, SocialIdentityLanguagesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityLanguagesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityLanguagesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityLanguagesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityLanguagesInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityLanguagesInner + */ + public static SocialIdentityLanguagesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityLanguagesInner.class); + } + + /** + * Convert an instance of SocialIdentityLanguagesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityMemberUrlResourcesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityMemberUrlResourcesInner.java new file mode 100644 index 0000000..abdd470 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityMemberUrlResourcesInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityMemberUrlResourcesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityMemberUrlResourcesInner { + public static final String SERIALIZED_NAME_URL_NAME = "UrlName"; + @SerializedName(SERIALIZED_NAME_URL_NAME) + @javax.annotation.Nullable + private String urlName; + + public static final String SERIALIZED_NAME_URL = "Url"; + @SerializedName(SERIALIZED_NAME_URL) + @javax.annotation.Nullable + private String url; + + public SocialIdentityMemberUrlResourcesInner() { + } + + public SocialIdentityMemberUrlResourcesInner urlName(@javax.annotation.Nullable String urlName) { + this.urlName = urlName; + return this; + } + + /** + * Get urlName + * @return urlName + */ + @javax.annotation.Nullable + public String getUrlName() { + return urlName; + } + + public void setUrlName(@javax.annotation.Nullable String urlName) { + this.urlName = urlName; + } + + + public SocialIdentityMemberUrlResourcesInner url(@javax.annotation.Nullable String url) { + this.url = url; + return this; + } + + /** + * Get url + * @return url + */ + @javax.annotation.Nullable + public String getUrl() { + return url; + } + + public void setUrl(@javax.annotation.Nullable String url) { + this.url = url; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityMemberUrlResourcesInner instance itself + */ + public SocialIdentityMemberUrlResourcesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityMemberUrlResourcesInner socialIdentityMemberUrlResourcesInner = (SocialIdentityMemberUrlResourcesInner) o; + return Objects.equals(this.urlName, socialIdentityMemberUrlResourcesInner.urlName) && + Objects.equals(this.url, socialIdentityMemberUrlResourcesInner.url)&& + Objects.equals(this.additionalProperties, socialIdentityMemberUrlResourcesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(urlName, url, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityMemberUrlResourcesInner {\n"); + sb.append(" urlName: ").append(toIndentedString(urlName)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("UrlName"); + openapiFields.add("Url"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityMemberUrlResourcesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityMemberUrlResourcesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityMemberUrlResourcesInner is not found in the empty JSON string", SocialIdentityMemberUrlResourcesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("UrlName") != null && !jsonObj.get("UrlName").isJsonNull()) && !jsonObj.get("UrlName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UrlName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UrlName").toString())); + } + if ((jsonObj.get("Url") != null && !jsonObj.get("Url").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityMemberUrlResourcesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityMemberUrlResourcesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityMemberUrlResourcesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityMemberUrlResourcesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityMemberUrlResourcesInner>() { + @Override + public void write(JsonWriter out, SocialIdentityMemberUrlResourcesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityMemberUrlResourcesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityMemberUrlResourcesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityMemberUrlResourcesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityMemberUrlResourcesInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityMemberUrlResourcesInner + */ + public static SocialIdentityMemberUrlResourcesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityMemberUrlResourcesInner.class); + } + + /** + * Convert an instance of SocialIdentityMemberUrlResourcesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityMoviesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityMoviesInner.java new file mode 100644 index 0000000..5b555dd --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityMoviesInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityMoviesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityMoviesInner { + public static final String SERIALIZED_NAME_MOVIE_NAME = "MovieName"; + @SerializedName(SERIALIZED_NAME_MOVIE_NAME) + @javax.annotation.Nullable + private String movieName; + + public static final String SERIALIZED_NAME_GENRE = "Genre"; + @SerializedName(SERIALIZED_NAME_GENRE) + @javax.annotation.Nullable + private String genre; + + public SocialIdentityMoviesInner() { + } + + public SocialIdentityMoviesInner movieName(@javax.annotation.Nullable String movieName) { + this.movieName = movieName; + return this; + } + + /** + * Get movieName + * @return movieName + */ + @javax.annotation.Nullable + public String getMovieName() { + return movieName; + } + + public void setMovieName(@javax.annotation.Nullable String movieName) { + this.movieName = movieName; + } + + + public SocialIdentityMoviesInner genre(@javax.annotation.Nullable String genre) { + this.genre = genre; + return this; + } + + /** + * Get genre + * @return genre + */ + @javax.annotation.Nullable + public String getGenre() { + return genre; + } + + public void setGenre(@javax.annotation.Nullable String genre) { + this.genre = genre; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityMoviesInner instance itself + */ + public SocialIdentityMoviesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityMoviesInner socialIdentityMoviesInner = (SocialIdentityMoviesInner) o; + return Objects.equals(this.movieName, socialIdentityMoviesInner.movieName) && + Objects.equals(this.genre, socialIdentityMoviesInner.genre)&& + Objects.equals(this.additionalProperties, socialIdentityMoviesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(movieName, genre, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityMoviesInner {\n"); + sb.append(" movieName: ").append(toIndentedString(movieName)).append("\n"); + sb.append(" genre: ").append(toIndentedString(genre)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("MovieName"); + openapiFields.add("Genre"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityMoviesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityMoviesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityMoviesInner is not found in the empty JSON string", SocialIdentityMoviesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("MovieName") != null && !jsonObj.get("MovieName").isJsonNull()) && !jsonObj.get("MovieName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MovieName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MovieName").toString())); + } + if ((jsonObj.get("Genre") != null && !jsonObj.get("Genre").isJsonNull()) && !jsonObj.get("Genre").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Genre` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Genre").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityMoviesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityMoviesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityMoviesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityMoviesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityMoviesInner>() { + @Override + public void write(JsonWriter out, SocialIdentityMoviesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityMoviesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityMoviesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityMoviesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityMoviesInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityMoviesInner + */ + public static SocialIdentityMoviesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityMoviesInner.class); + } + + /** + * Convert an instance of SocialIdentityMoviesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityMutualFriendsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityMutualFriendsInner.java new file mode 100644 index 0000000..9fd5c21 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityMutualFriendsInner.java @@ -0,0 +1,495 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityMutualFriendsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityMutualFriendsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_FIRST_NAME = "FirstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nullable + private String firstName; + + public static final String SERIALIZED_NAME_LAST_NAME = "LastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nullable + private String lastName; + + public static final String SERIALIZED_NAME_BIRTHDAY = "Birthday"; + @SerializedName(SERIALIZED_NAME_BIRTHDAY) + @javax.annotation.Nullable + private OffsetDateTime birthday; + + public static final String SERIALIZED_NAME_HOMETOWN = "Hometown"; + @SerializedName(SERIALIZED_NAME_HOMETOWN) + @javax.annotation.Nullable + private String hometown; + + public static final String SERIALIZED_NAME_LINK = "Link"; + @SerializedName(SERIALIZED_NAME_LINK) + @javax.annotation.Nullable + private String link; + + public static final String SERIALIZED_NAME_GENDER = "Gender"; + @SerializedName(SERIALIZED_NAME_GENDER) + @javax.annotation.Nullable + private String gender; + + public SocialIdentityMutualFriendsInner() { + } + + public SocialIdentityMutualFriendsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public SocialIdentityMutualFriendsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public SocialIdentityMutualFriendsInner firstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + */ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + } + + + public SocialIdentityMutualFriendsInner lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + + public SocialIdentityMutualFriendsInner birthday(@javax.annotation.Nullable OffsetDateTime birthday) { + this.birthday = birthday; + return this; + } + + /** + * Get birthday + * @return birthday + */ + @javax.annotation.Nullable + public OffsetDateTime getBirthday() { + return birthday; + } + + public void setBirthday(@javax.annotation.Nullable OffsetDateTime birthday) { + this.birthday = birthday; + } + + + public SocialIdentityMutualFriendsInner hometown(@javax.annotation.Nullable String hometown) { + this.hometown = hometown; + return this; + } + + /** + * Get hometown + * @return hometown + */ + @javax.annotation.Nullable + public String getHometown() { + return hometown; + } + + public void setHometown(@javax.annotation.Nullable String hometown) { + this.hometown = hometown; + } + + + public SocialIdentityMutualFriendsInner link(@javax.annotation.Nullable String link) { + this.link = link; + return this; + } + + /** + * Get link + * @return link + */ + @javax.annotation.Nullable + public String getLink() { + return link; + } + + public void setLink(@javax.annotation.Nullable String link) { + this.link = link; + } + + + public SocialIdentityMutualFriendsInner gender(@javax.annotation.Nullable String gender) { + this.gender = gender; + return this; + } + + /** + * Get gender + * @return gender + */ + @javax.annotation.Nullable + public String getGender() { + return gender; + } + + public void setGender(@javax.annotation.Nullable String gender) { + this.gender = gender; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityMutualFriendsInner instance itself + */ + public SocialIdentityMutualFriendsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityMutualFriendsInner socialIdentityMutualFriendsInner = (SocialIdentityMutualFriendsInner) o; + return Objects.equals(this.id, socialIdentityMutualFriendsInner.id) && + Objects.equals(this.name, socialIdentityMutualFriendsInner.name) && + Objects.equals(this.firstName, socialIdentityMutualFriendsInner.firstName) && + Objects.equals(this.lastName, socialIdentityMutualFriendsInner.lastName) && + Objects.equals(this.birthday, socialIdentityMutualFriendsInner.birthday) && + Objects.equals(this.hometown, socialIdentityMutualFriendsInner.hometown) && + Objects.equals(this.link, socialIdentityMutualFriendsInner.link) && + Objects.equals(this.gender, socialIdentityMutualFriendsInner.gender)&& + Objects.equals(this.additionalProperties, socialIdentityMutualFriendsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, firstName, lastName, birthday, hometown, link, gender, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityMutualFriendsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" birthday: ").append(toIndentedString(birthday)).append("\n"); + sb.append(" hometown: ").append(toIndentedString(hometown)).append("\n"); + sb.append(" link: ").append(toIndentedString(link)).append("\n"); + sb.append(" gender: ").append(toIndentedString(gender)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("FirstName"); + openapiFields.add("LastName"); + openapiFields.add("Birthday"); + openapiFields.add("Hometown"); + openapiFields.add("Link"); + openapiFields.add("Gender"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityMutualFriendsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityMutualFriendsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityMutualFriendsInner is not found in the empty JSON string", SocialIdentityMutualFriendsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("FirstName") != null && !jsonObj.get("FirstName").isJsonNull()) && !jsonObj.get("FirstName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FirstName").toString())); + } + if ((jsonObj.get("LastName") != null && !jsonObj.get("LastName").isJsonNull()) && !jsonObj.get("LastName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastName").toString())); + } + if ((jsonObj.get("Hometown") != null && !jsonObj.get("Hometown").isJsonNull()) && !jsonObj.get("Hometown").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Hometown` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Hometown").toString())); + } + 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())); + } + if ((jsonObj.get("Gender") != null && !jsonObj.get("Gender").isJsonNull()) && !jsonObj.get("Gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Gender").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityMutualFriendsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityMutualFriendsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityMutualFriendsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityMutualFriendsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityMutualFriendsInner>() { + @Override + public void write(JsonWriter out, SocialIdentityMutualFriendsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityMutualFriendsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityMutualFriendsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityMutualFriendsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityMutualFriendsInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityMutualFriendsInner + */ + public static SocialIdentityMutualFriendsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityMutualFriendsInner.class); + } + + /** + * Convert an instance of SocialIdentityMutualFriendsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityPatentsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityPatentsInner.java new file mode 100644 index 0000000..b844a0a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityPatentsInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityPatentsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityPatentsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_TITLE = "Title"; + @SerializedName(SERIALIZED_NAME_TITLE) + @javax.annotation.Nullable + private String title; + + public static final String SERIALIZED_NAME_DATE = "Date"; + @SerializedName(SERIALIZED_NAME_DATE) + @javax.annotation.Nullable + private String date; + + public SocialIdentityPatentsInner() { + } + + public SocialIdentityPatentsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public SocialIdentityPatentsInner title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * Get title + * @return title + */ + @javax.annotation.Nullable + public String getTitle() { + return title; + } + + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + public SocialIdentityPatentsInner date(@javax.annotation.Nullable String date) { + this.date = date; + return this; + } + + /** + * Get date + * @return date + */ + @javax.annotation.Nullable + public String getDate() { + return date; + } + + public void setDate(@javax.annotation.Nullable String date) { + this.date = date; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityPatentsInner instance itself + */ + public SocialIdentityPatentsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityPatentsInner socialIdentityPatentsInner = (SocialIdentityPatentsInner) o; + return Objects.equals(this.id, socialIdentityPatentsInner.id) && + Objects.equals(this.title, socialIdentityPatentsInner.title) && + Objects.equals(this.date, socialIdentityPatentsInner.date)&& + Objects.equals(this.additionalProperties, socialIdentityPatentsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, title, date, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityPatentsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Title"); + openapiFields.add("Date"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityPatentsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityPatentsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityPatentsInner is not found in the empty JSON string", SocialIdentityPatentsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Title") != null && !jsonObj.get("Title").isJsonNull()) && !jsonObj.get("Title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Title").toString())); + } + if ((jsonObj.get("Date") != null && !jsonObj.get("Date").isJsonNull()) && !jsonObj.get("Date").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Date` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Date").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityPatentsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityPatentsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityPatentsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityPatentsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityPatentsInner>() { + @Override + public void write(JsonWriter out, SocialIdentityPatentsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityPatentsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityPatentsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityPatentsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityPatentsInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityPatentsInner + */ + public static SocialIdentityPatentsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityPatentsInner.class); + } + + /** + * Convert an instance of SocialIdentityPatentsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityPhoneNumbersInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityPhoneNumbersInner.java new file mode 100644 index 0000000..b53e798 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityPhoneNumbersInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityPhoneNumbersInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityPhoneNumbersInner { + public static final String SERIALIZED_NAME_PHONE_TYPE = "PhoneType"; + @SerializedName(SERIALIZED_NAME_PHONE_TYPE) + @javax.annotation.Nullable + private String phoneType; + + public static final String SERIALIZED_NAME_PHONE_NUMBER = "PhoneNumber"; + @SerializedName(SERIALIZED_NAME_PHONE_NUMBER) + @javax.annotation.Nullable + private String phoneNumber; + + public static final String SERIALIZED_NAME_OP = "op"; + @SerializedName(SERIALIZED_NAME_OP) + @javax.annotation.Nullable + private String op; + + public SocialIdentityPhoneNumbersInner() { + } + + public SocialIdentityPhoneNumbersInner phoneType(@javax.annotation.Nullable String phoneType) { + this.phoneType = phoneType; + return this; + } + + /** + * Get phoneType + * @return phoneType + */ + @javax.annotation.Nullable + public String getPhoneType() { + return phoneType; + } + + public void setPhoneType(@javax.annotation.Nullable String phoneType) { + this.phoneType = phoneType; + } + + + public SocialIdentityPhoneNumbersInner phoneNumber(@javax.annotation.Nullable String phoneNumber) { + this.phoneNumber = phoneNumber; + return this; + } + + /** + * Get phoneNumber + * @return phoneNumber + */ + @javax.annotation.Nullable + public String getPhoneNumber() { + return phoneNumber; + } + + public void setPhoneNumber(@javax.annotation.Nullable String phoneNumber) { + this.phoneNumber = phoneNumber; + } + + + public SocialIdentityPhoneNumbersInner op(@javax.annotation.Nullable String op) { + this.op = op; + return this; + } + + /** + * Get op + * @return op + */ + @javax.annotation.Nullable + public String getOp() { + return op; + } + + public void setOp(@javax.annotation.Nullable String op) { + this.op = op; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityPhoneNumbersInner instance itself + */ + public SocialIdentityPhoneNumbersInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityPhoneNumbersInner socialIdentityPhoneNumbersInner = (SocialIdentityPhoneNumbersInner) o; + return Objects.equals(this.phoneType, socialIdentityPhoneNumbersInner.phoneType) && + Objects.equals(this.phoneNumber, socialIdentityPhoneNumbersInner.phoneNumber) && + Objects.equals(this.op, socialIdentityPhoneNumbersInner.op)&& + Objects.equals(this.additionalProperties, socialIdentityPhoneNumbersInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(phoneType, phoneNumber, op, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityPhoneNumbersInner {\n"); + sb.append(" phoneType: ").append(toIndentedString(phoneType)).append("\n"); + sb.append(" phoneNumber: ").append(toIndentedString(phoneNumber)).append("\n"); + sb.append(" op: ").append(toIndentedString(op)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("PhoneType"); + openapiFields.add("PhoneNumber"); + openapiFields.add("op"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityPhoneNumbersInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityPhoneNumbersInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityPhoneNumbersInner is not found in the empty JSON string", SocialIdentityPhoneNumbersInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("PhoneType") != null && !jsonObj.get("PhoneType").isJsonNull()) && !jsonObj.get("PhoneType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PhoneType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PhoneType").toString())); + } + if ((jsonObj.get("PhoneNumber") != null && !jsonObj.get("PhoneNumber").isJsonNull()) && !jsonObj.get("PhoneNumber").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PhoneNumber` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PhoneNumber").toString())); + } + if ((jsonObj.get("op") != null && !jsonObj.get("op").isJsonNull()) && !jsonObj.get("op").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `op` to be a primitive type in the JSON string but got `%s`", jsonObj.get("op").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityPhoneNumbersInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityPhoneNumbersInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityPhoneNumbersInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityPhoneNumbersInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityPhoneNumbersInner>() { + @Override + public void write(JsonWriter out, SocialIdentityPhoneNumbersInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityPhoneNumbersInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityPhoneNumbersInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityPhoneNumbersInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityPhoneNumbersInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityPhoneNumbersInner + */ + public static SocialIdentityPhoneNumbersInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityPhoneNumbersInner.class); + } + + /** + * Convert an instance of SocialIdentityPhoneNumbersInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityPlacesLivedInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityPlacesLivedInner.java new file mode 100644 index 0000000..4d3d641 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityPlacesLivedInner.java @@ -0,0 +1,344 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityPlacesLivedInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityPlacesLivedInner { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_OPERATION = "Operation"; + @SerializedName(SERIALIZED_NAME_OPERATION) + @javax.annotation.Nullable + private String operation; + + public static final String SERIALIZED_NAME_IS_PRIMARY = "IsPrimary"; + @SerializedName(SERIALIZED_NAME_IS_PRIMARY) + @javax.annotation.Nullable + private Boolean isPrimary; + + public SocialIdentityPlacesLivedInner() { + } + + public SocialIdentityPlacesLivedInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public SocialIdentityPlacesLivedInner operation(@javax.annotation.Nullable String operation) { + this.operation = operation; + return this; + } + + /** + * Get operation + * @return operation + */ + @javax.annotation.Nullable + public String getOperation() { + return operation; + } + + public void setOperation(@javax.annotation.Nullable String operation) { + this.operation = operation; + } + + + public SocialIdentityPlacesLivedInner isPrimary(@javax.annotation.Nullable Boolean isPrimary) { + this.isPrimary = isPrimary; + return this; + } + + /** + * Get isPrimary + * @return isPrimary + */ + @javax.annotation.Nullable + public Boolean getIsPrimary() { + return isPrimary; + } + + public void setIsPrimary(@javax.annotation.Nullable Boolean isPrimary) { + this.isPrimary = isPrimary; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityPlacesLivedInner instance itself + */ + public SocialIdentityPlacesLivedInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityPlacesLivedInner socialIdentityPlacesLivedInner = (SocialIdentityPlacesLivedInner) o; + return Objects.equals(this.name, socialIdentityPlacesLivedInner.name) && + Objects.equals(this.operation, socialIdentityPlacesLivedInner.operation) && + Objects.equals(this.isPrimary, socialIdentityPlacesLivedInner.isPrimary)&& + Objects.equals(this.additionalProperties, socialIdentityPlacesLivedInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, operation, isPrimary, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityPlacesLivedInner {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" operation: ").append(toIndentedString(operation)).append("\n"); + sb.append(" isPrimary: ").append(toIndentedString(isPrimary)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + openapiFields.add("Operation"); + openapiFields.add("IsPrimary"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityPlacesLivedInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityPlacesLivedInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityPlacesLivedInner is not found in the empty JSON string", SocialIdentityPlacesLivedInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Operation") != null && !jsonObj.get("Operation").isJsonNull()) && !jsonObj.get("Operation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Operation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Operation").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityPlacesLivedInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityPlacesLivedInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityPlacesLivedInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityPlacesLivedInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityPlacesLivedInner>() { + @Override + public void write(JsonWriter out, SocialIdentityPlacesLivedInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityPlacesLivedInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityPlacesLivedInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityPlacesLivedInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityPlacesLivedInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityPlacesLivedInner + */ + public static SocialIdentityPlacesLivedInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityPlacesLivedInner.class); + } + + /** + * Convert an instance of SocialIdentityPlacesLivedInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityPositionsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityPositionsInner.java new file mode 100644 index 0000000..cd5e3c2 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityPositionsInner.java @@ -0,0 +1,474 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.SocialIdentityPositionsInnerCompany; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityPositionsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityPositionsInner { + public static final String SERIALIZED_NAME_POSITION = "Position"; + @SerializedName(SERIALIZED_NAME_POSITION) + @javax.annotation.Nullable + private String position; + + public static final String SERIALIZED_NAME_SUMMARY = "Summary"; + @SerializedName(SERIALIZED_NAME_SUMMARY) + @javax.annotation.Nullable + private String summary; + + public static final String SERIALIZED_NAME_START_DATE = "StartDate"; + @SerializedName(SERIALIZED_NAME_START_DATE) + @javax.annotation.Nullable + private OffsetDateTime startDate; + + public static final String SERIALIZED_NAME_END_DATE = "EndDate"; + @SerializedName(SERIALIZED_NAME_END_DATE) + @javax.annotation.Nullable + private OffsetDateTime endDate; + + public static final String SERIALIZED_NAME_IS_CURRENT = "IsCurrent"; + @SerializedName(SERIALIZED_NAME_IS_CURRENT) + @javax.annotation.Nullable + private Boolean isCurrent; + + public static final String SERIALIZED_NAME_COMPANY = "Company"; + @SerializedName(SERIALIZED_NAME_COMPANY) + @javax.annotation.Nullable + private SocialIdentityPositionsInnerCompany company; + + public static final String SERIALIZED_NAME_COMAPNY = "Comapny"; + @SerializedName(SERIALIZED_NAME_COMAPNY) + @javax.annotation.Nullable + private SocialIdentityPositionsInnerCompany comapny; + + public SocialIdentityPositionsInner() { + } + + public SocialIdentityPositionsInner position(@javax.annotation.Nullable String position) { + this.position = position; + return this; + } + + /** + * Get position + * @return position + */ + @javax.annotation.Nullable + public String getPosition() { + return position; + } + + public void setPosition(@javax.annotation.Nullable String position) { + this.position = position; + } + + + public SocialIdentityPositionsInner summary(@javax.annotation.Nullable String summary) { + this.summary = summary; + return this; + } + + /** + * Get summary + * @return summary + */ + @javax.annotation.Nullable + public String getSummary() { + return summary; + } + + public void setSummary(@javax.annotation.Nullable String summary) { + this.summary = summary; + } + + + public SocialIdentityPositionsInner startDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Get startDate + * @return startDate + */ + @javax.annotation.Nullable + public OffsetDateTime getStartDate() { + return startDate; + } + + public void setStartDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + } + + + public SocialIdentityPositionsInner endDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * Get endDate + * @return endDate + */ + @javax.annotation.Nullable + public OffsetDateTime getEndDate() { + return endDate; + } + + public void setEndDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + } + + + public SocialIdentityPositionsInner isCurrent(@javax.annotation.Nullable Boolean isCurrent) { + this.isCurrent = isCurrent; + return this; + } + + /** + * Get isCurrent + * @return isCurrent + */ + @javax.annotation.Nullable + public Boolean getIsCurrent() { + return isCurrent; + } + + public void setIsCurrent(@javax.annotation.Nullable Boolean isCurrent) { + this.isCurrent = isCurrent; + } + + + public SocialIdentityPositionsInner company(@javax.annotation.Nullable SocialIdentityPositionsInnerCompany company) { + this.company = company; + return this; + } + + /** + * Get company + * @return company + */ + @javax.annotation.Nullable + public SocialIdentityPositionsInnerCompany getCompany() { + return company; + } + + public void setCompany(@javax.annotation.Nullable SocialIdentityPositionsInnerCompany company) { + this.company = company; + } + + + public SocialIdentityPositionsInner comapny(@javax.annotation.Nullable SocialIdentityPositionsInnerCompany comapny) { + this.comapny = comapny; + return this; + } + + /** + * Get comapny + * @return comapny + */ + @javax.annotation.Nullable + public SocialIdentityPositionsInnerCompany getComapny() { + return comapny; + } + + public void setComapny(@javax.annotation.Nullable SocialIdentityPositionsInnerCompany comapny) { + this.comapny = comapny; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityPositionsInner instance itself + */ + public SocialIdentityPositionsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityPositionsInner socialIdentityPositionsInner = (SocialIdentityPositionsInner) o; + return Objects.equals(this.position, socialIdentityPositionsInner.position) && + Objects.equals(this.summary, socialIdentityPositionsInner.summary) && + Objects.equals(this.startDate, socialIdentityPositionsInner.startDate) && + Objects.equals(this.endDate, socialIdentityPositionsInner.endDate) && + Objects.equals(this.isCurrent, socialIdentityPositionsInner.isCurrent) && + Objects.equals(this.company, socialIdentityPositionsInner.company) && + Objects.equals(this.comapny, socialIdentityPositionsInner.comapny)&& + Objects.equals(this.additionalProperties, socialIdentityPositionsInner.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(position, summary, startDate, endDate, isCurrent, company, comapny, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityPositionsInner {\n"); + sb.append(" position: ").append(toIndentedString(position)).append("\n"); + sb.append(" summary: ").append(toIndentedString(summary)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" isCurrent: ").append(toIndentedString(isCurrent)).append("\n"); + sb.append(" company: ").append(toIndentedString(company)).append("\n"); + sb.append(" comapny: ").append(toIndentedString(comapny)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Position"); + openapiFields.add("Summary"); + openapiFields.add("StartDate"); + openapiFields.add("EndDate"); + openapiFields.add("IsCurrent"); + openapiFields.add("Company"); + openapiFields.add("Comapny"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityPositionsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityPositionsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityPositionsInner is not found in the empty JSON string", SocialIdentityPositionsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Position") != null && !jsonObj.get("Position").isJsonNull()) && !jsonObj.get("Position").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Position` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Position").toString())); + } + if ((jsonObj.get("Summary") != null && !jsonObj.get("Summary").isJsonNull()) && !jsonObj.get("Summary").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Summary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Summary").toString())); + } + // validate the optional field `Company` + if (jsonObj.get("Company") != null && !jsonObj.get("Company").isJsonNull()) { + SocialIdentityPositionsInnerCompany.validateJsonElement(jsonObj.get("Company")); + } + // validate the optional field `Comapny` + if (jsonObj.get("Comapny") != null && !jsonObj.get("Comapny").isJsonNull()) { + SocialIdentityPositionsInnerCompany.validateJsonElement(jsonObj.get("Comapny")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityPositionsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityPositionsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityPositionsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityPositionsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityPositionsInner>() { + @Override + public void write(JsonWriter out, SocialIdentityPositionsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityPositionsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityPositionsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityPositionsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityPositionsInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityPositionsInner + */ + public static SocialIdentityPositionsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityPositionsInner.class); + } + + /** + * Convert an instance of SocialIdentityPositionsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityPositionsInnerCompany.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityPositionsInnerCompany.java new file mode 100644 index 0000000..a679f43 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityPositionsInnerCompany.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityPositionsInnerCompany + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityPositionsInnerCompany { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_TYPE = "Type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_INDUSTRY = "Industry"; + @SerializedName(SERIALIZED_NAME_INDUSTRY) + @javax.annotation.Nullable + private String industry; + + public SocialIdentityPositionsInnerCompany() { + } + + public SocialIdentityPositionsInnerCompany name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public SocialIdentityPositionsInnerCompany type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public SocialIdentityPositionsInnerCompany industry(@javax.annotation.Nullable String industry) { + this.industry = industry; + return this; + } + + /** + * Get industry + * @return industry + */ + @javax.annotation.Nullable + public String getIndustry() { + return industry; + } + + public void setIndustry(@javax.annotation.Nullable String industry) { + this.industry = industry; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityPositionsInnerCompany instance itself + */ + public SocialIdentityPositionsInnerCompany putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityPositionsInnerCompany socialIdentityPositionsInnerCompany = (SocialIdentityPositionsInnerCompany) o; + return Objects.equals(this.name, socialIdentityPositionsInnerCompany.name) && + Objects.equals(this.type, socialIdentityPositionsInnerCompany.type) && + Objects.equals(this.industry, socialIdentityPositionsInnerCompany.industry)&& + Objects.equals(this.additionalProperties, socialIdentityPositionsInnerCompany.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, type, industry, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityPositionsInnerCompany {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" industry: ").append(toIndentedString(industry)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + openapiFields.add("Type"); + openapiFields.add("Industry"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityPositionsInnerCompany + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityPositionsInnerCompany.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityPositionsInnerCompany is not found in the empty JSON string", SocialIdentityPositionsInnerCompany.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Type") != null && !jsonObj.get("Type").isJsonNull()) && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + if ((jsonObj.get("Industry") != null && !jsonObj.get("Industry").isJsonNull()) && !jsonObj.get("Industry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Industry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Industry").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityPositionsInnerCompany.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityPositionsInnerCompany' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityPositionsInnerCompany> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityPositionsInnerCompany.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityPositionsInnerCompany>() { + @Override + public void write(JsonWriter out, SocialIdentityPositionsInnerCompany value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityPositionsInnerCompany read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityPositionsInnerCompany instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityPositionsInnerCompany given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityPositionsInnerCompany + * @throws IOException if the JSON string is invalid with respect to SocialIdentityPositionsInnerCompany + */ + public static SocialIdentityPositionsInnerCompany fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityPositionsInnerCompany.class); + } + + /** + * Convert an instance of SocialIdentityPositionsInnerCompany to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityProjectsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityProjectsInner.java new file mode 100644 index 0000000..b00eae3 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityProjectsInner.java @@ -0,0 +1,496 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.SocialIdentityProjectsInnerWithInner; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityProjectsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityProjectsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_SUMMARY = "Summary"; + @SerializedName(SERIALIZED_NAME_SUMMARY) + @javax.annotation.Nullable + private String summary; + + public static final String SERIALIZED_NAME_START_DATE = "StartDate"; + @SerializedName(SERIALIZED_NAME_START_DATE) + @javax.annotation.Nullable + private OffsetDateTime startDate; + + public static final String SERIALIZED_NAME_END_DATE = "EndDate"; + @SerializedName(SERIALIZED_NAME_END_DATE) + @javax.annotation.Nullable + private OffsetDateTime endDate; + + public static final String SERIALIZED_NAME_IS_CURRENT = "IsCurrent"; + @SerializedName(SERIALIZED_NAME_IS_CURRENT) + @javax.annotation.Nullable + private String isCurrent; + + public static final String SERIALIZED_NAME_WITH = "With"; + @SerializedName(SERIALIZED_NAME_WITH) + @javax.annotation.Nullable + private List<SocialIdentityProjectsInnerWithInner> with; + + public SocialIdentityProjectsInner() { + } + + public SocialIdentityProjectsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public SocialIdentityProjectsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public SocialIdentityProjectsInner summary(@javax.annotation.Nullable String summary) { + this.summary = summary; + return this; + } + + /** + * Get summary + * @return summary + */ + @javax.annotation.Nullable + public String getSummary() { + return summary; + } + + public void setSummary(@javax.annotation.Nullable String summary) { + this.summary = summary; + } + + + public SocialIdentityProjectsInner startDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + return this; + } + + /** + * Get startDate + * @return startDate + */ + @javax.annotation.Nullable + public OffsetDateTime getStartDate() { + return startDate; + } + + public void setStartDate(@javax.annotation.Nullable OffsetDateTime startDate) { + this.startDate = startDate; + } + + + public SocialIdentityProjectsInner endDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + return this; + } + + /** + * Get endDate + * @return endDate + */ + @javax.annotation.Nullable + public OffsetDateTime getEndDate() { + return endDate; + } + + public void setEndDate(@javax.annotation.Nullable OffsetDateTime endDate) { + this.endDate = endDate; + } + + + public SocialIdentityProjectsInner isCurrent(@javax.annotation.Nullable String isCurrent) { + this.isCurrent = isCurrent; + return this; + } + + /** + * Get isCurrent + * @return isCurrent + */ + @javax.annotation.Nullable + public String getIsCurrent() { + return isCurrent; + } + + public void setIsCurrent(@javax.annotation.Nullable String isCurrent) { + this.isCurrent = isCurrent; + } + + + public SocialIdentityProjectsInner with(@javax.annotation.Nullable List<SocialIdentityProjectsInnerWithInner> with) { + this.with = with; + return this; + } + + public SocialIdentityProjectsInner addWithItem(SocialIdentityProjectsInnerWithInner withItem) { + if (this.with == null) { + this.with = new ArrayList<>(); + } + this.with.add(withItem); + return this; + } + + /** + * Get with + * @return with + */ + @javax.annotation.Nullable + public List<SocialIdentityProjectsInnerWithInner> getWith() { + return with; + } + + public void setWith(@javax.annotation.Nullable List<SocialIdentityProjectsInnerWithInner> with) { + this.with = with; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityProjectsInner instance itself + */ + public SocialIdentityProjectsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityProjectsInner socialIdentityProjectsInner = (SocialIdentityProjectsInner) o; + return Objects.equals(this.id, socialIdentityProjectsInner.id) && + Objects.equals(this.name, socialIdentityProjectsInner.name) && + Objects.equals(this.summary, socialIdentityProjectsInner.summary) && + Objects.equals(this.startDate, socialIdentityProjectsInner.startDate) && + Objects.equals(this.endDate, socialIdentityProjectsInner.endDate) && + Objects.equals(this.isCurrent, socialIdentityProjectsInner.isCurrent) && + Objects.equals(this.with, socialIdentityProjectsInner.with)&& + Objects.equals(this.additionalProperties, socialIdentityProjectsInner.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, summary, startDate, endDate, isCurrent, with, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityProjectsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" summary: ").append(toIndentedString(summary)).append("\n"); + sb.append(" startDate: ").append(toIndentedString(startDate)).append("\n"); + sb.append(" endDate: ").append(toIndentedString(endDate)).append("\n"); + sb.append(" isCurrent: ").append(toIndentedString(isCurrent)).append("\n"); + sb.append(" with: ").append(toIndentedString(with)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Summary"); + openapiFields.add("StartDate"); + openapiFields.add("EndDate"); + openapiFields.add("IsCurrent"); + openapiFields.add("With"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityProjectsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityProjectsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityProjectsInner is not found in the empty JSON string", SocialIdentityProjectsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Summary") != null && !jsonObj.get("Summary").isJsonNull()) && !jsonObj.get("Summary").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Summary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Summary").toString())); + } + if ((jsonObj.get("IsCurrent") != null && !jsonObj.get("IsCurrent").isJsonNull()) && !jsonObj.get("IsCurrent").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IsCurrent` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IsCurrent").toString())); + } + if (jsonObj.get("With") != null && !jsonObj.get("With").isJsonNull()) { + JsonArray jsonArraywith = jsonObj.getAsJsonArray("With"); + if (jsonArraywith != null) { + // ensure the json data is an array + if (!jsonObj.get("With").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `With` to be an array in the JSON string but got `%s`", jsonObj.get("With").toString())); + } + + // validate the optional field `With` (array) + for (int i = 0; i < jsonArraywith.size(); i++) { + SocialIdentityProjectsInnerWithInner.validateJsonElement(jsonArraywith.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityProjectsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityProjectsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityProjectsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityProjectsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityProjectsInner>() { + @Override + public void write(JsonWriter out, SocialIdentityProjectsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityProjectsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityProjectsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityProjectsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityProjectsInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityProjectsInner + */ + public static SocialIdentityProjectsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityProjectsInner.class); + } + + /** + * Convert an instance of SocialIdentityProjectsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityProjectsInnerWithInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityProjectsInnerWithInner.java new file mode 100644 index 0000000..bf4f759 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityProjectsInnerWithInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityProjectsInnerWithInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityProjectsInnerWithInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public SocialIdentityProjectsInnerWithInner() { + } + + public SocialIdentityProjectsInnerWithInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public SocialIdentityProjectsInnerWithInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityProjectsInnerWithInner instance itself + */ + public SocialIdentityProjectsInnerWithInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityProjectsInnerWithInner socialIdentityProjectsInnerWithInner = (SocialIdentityProjectsInnerWithInner) o; + return Objects.equals(this.id, socialIdentityProjectsInnerWithInner.id) && + Objects.equals(this.name, socialIdentityProjectsInnerWithInner.name)&& + Objects.equals(this.additionalProperties, socialIdentityProjectsInnerWithInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityProjectsInnerWithInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityProjectsInnerWithInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityProjectsInnerWithInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityProjectsInnerWithInner is not found in the empty JSON string", SocialIdentityProjectsInnerWithInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityProjectsInnerWithInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityProjectsInnerWithInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityProjectsInnerWithInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityProjectsInnerWithInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityProjectsInnerWithInner>() { + @Override + public void write(JsonWriter out, SocialIdentityProjectsInnerWithInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityProjectsInnerWithInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityProjectsInnerWithInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityProjectsInnerWithInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityProjectsInnerWithInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityProjectsInnerWithInner + */ + public static SocialIdentityProjectsInnerWithInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityProjectsInnerWithInner.class); + } + + /** + * Convert an instance of SocialIdentityProjectsInnerWithInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityProviderAccessCredential.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityProviderAccessCredential.java new file mode 100644 index 0000000..1c3d983 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityProviderAccessCredential.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityProviderAccessCredential + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityProviderAccessCredential { + public static final String SERIALIZED_NAME_ACCESS_TOKEN = "AccessToken"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN) + @javax.annotation.Nullable + private String accessToken; + + public static final String SERIALIZED_NAME_TOKEN_SECRET = "TokenSecret"; + @SerializedName(SERIALIZED_NAME_TOKEN_SECRET) + @javax.annotation.Nullable + private String tokenSecret; + + public SocialIdentityProviderAccessCredential() { + } + + public SocialIdentityProviderAccessCredential accessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Get accessToken + * @return accessToken + */ + @javax.annotation.Nullable + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + } + + + public SocialIdentityProviderAccessCredential tokenSecret(@javax.annotation.Nullable String tokenSecret) { + this.tokenSecret = tokenSecret; + return this; + } + + /** + * Get tokenSecret + * @return tokenSecret + */ + @javax.annotation.Nullable + public String getTokenSecret() { + return tokenSecret; + } + + public void setTokenSecret(@javax.annotation.Nullable String tokenSecret) { + this.tokenSecret = tokenSecret; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityProviderAccessCredential instance itself + */ + public SocialIdentityProviderAccessCredential putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityProviderAccessCredential socialIdentityProviderAccessCredential = (SocialIdentityProviderAccessCredential) o; + return Objects.equals(this.accessToken, socialIdentityProviderAccessCredential.accessToken) && + Objects.equals(this.tokenSecret, socialIdentityProviderAccessCredential.tokenSecret)&& + Objects.equals(this.additionalProperties, socialIdentityProviderAccessCredential.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(accessToken, tokenSecret, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityProviderAccessCredential {\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" tokenSecret: ").append(toIndentedString(tokenSecret)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AccessToken"); + openapiFields.add("TokenSecret"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityProviderAccessCredential + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityProviderAccessCredential.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityProviderAccessCredential is not found in the empty JSON string", SocialIdentityProviderAccessCredential.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("AccessToken") != null && !jsonObj.get("AccessToken").isJsonNull()) && !jsonObj.get("AccessToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AccessToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AccessToken").toString())); + } + if ((jsonObj.get("TokenSecret") != null && !jsonObj.get("TokenSecret").isJsonNull()) && !jsonObj.get("TokenSecret").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TokenSecret` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TokenSecret").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityProviderAccessCredential.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityProviderAccessCredential' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityProviderAccessCredential> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityProviderAccessCredential.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityProviderAccessCredential>() { + @Override + public void write(JsonWriter out, SocialIdentityProviderAccessCredential value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityProviderAccessCredential read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityProviderAccessCredential instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityProviderAccessCredential given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityProviderAccessCredential + * @throws IOException if the JSON string is invalid with respect to SocialIdentityProviderAccessCredential + */ + public static SocialIdentityProviderAccessCredential fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityProviderAccessCredential.class); + } + + /** + * Convert an instance of SocialIdentityProviderAccessCredential to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityPublicationsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityPublicationsInner.java new file mode 100644 index 0000000..98fbb23 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityPublicationsInner.java @@ -0,0 +1,499 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.SocialIdentityPublicationsInnerAuthorsInner; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityPublicationsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityPublicationsInner { + public static final String SERIALIZED_NAME_TITLE = "Title"; + @SerializedName(SERIALIZED_NAME_TITLE) + @javax.annotation.Nullable + private String title; + + public static final String SERIALIZED_NAME_PUBLISHER = "Publisher"; + @SerializedName(SERIALIZED_NAME_PUBLISHER) + @javax.annotation.Nullable + private String publisher; + + public static final String SERIALIZED_NAME_DATE = "Date"; + @SerializedName(SERIALIZED_NAME_DATE) + @javax.annotation.Nullable + private OffsetDateTime date; + + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_URL = "Url"; + @SerializedName(SERIALIZED_NAME_URL) + @javax.annotation.Nullable + private String url; + + public static final String SERIALIZED_NAME_SUMMARY = "Summary"; + @SerializedName(SERIALIZED_NAME_SUMMARY) + @javax.annotation.Nullable + private String summary; + + public static final String SERIALIZED_NAME_AUTHORS = "Authors"; + @SerializedName(SERIALIZED_NAME_AUTHORS) + @javax.annotation.Nullable + private List<SocialIdentityPublicationsInnerAuthorsInner> authors; + + public SocialIdentityPublicationsInner() { + } + + public SocialIdentityPublicationsInner title(@javax.annotation.Nullable String title) { + this.title = title; + return this; + } + + /** + * Get title + * @return title + */ + @javax.annotation.Nullable + public String getTitle() { + return title; + } + + public void setTitle(@javax.annotation.Nullable String title) { + this.title = title; + } + + + public SocialIdentityPublicationsInner publisher(@javax.annotation.Nullable String publisher) { + this.publisher = publisher; + return this; + } + + /** + * Get publisher + * @return publisher + */ + @javax.annotation.Nullable + public String getPublisher() { + return publisher; + } + + public void setPublisher(@javax.annotation.Nullable String publisher) { + this.publisher = publisher; + } + + + public SocialIdentityPublicationsInner date(@javax.annotation.Nullable OffsetDateTime date) { + this.date = date; + return this; + } + + /** + * Get date + * @return date + */ + @javax.annotation.Nullable + public OffsetDateTime getDate() { + return date; + } + + public void setDate(@javax.annotation.Nullable OffsetDateTime date) { + this.date = date; + } + + + public SocialIdentityPublicationsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public SocialIdentityPublicationsInner url(@javax.annotation.Nullable String url) { + this.url = url; + return this; + } + + /** + * Get url + * @return url + */ + @javax.annotation.Nullable + public String getUrl() { + return url; + } + + public void setUrl(@javax.annotation.Nullable String url) { + this.url = url; + } + + + public SocialIdentityPublicationsInner summary(@javax.annotation.Nullable String summary) { + this.summary = summary; + return this; + } + + /** + * Get summary + * @return summary + */ + @javax.annotation.Nullable + public String getSummary() { + return summary; + } + + public void setSummary(@javax.annotation.Nullable String summary) { + this.summary = summary; + } + + + public SocialIdentityPublicationsInner authors(@javax.annotation.Nullable List<SocialIdentityPublicationsInnerAuthorsInner> authors) { + this.authors = authors; + return this; + } + + public SocialIdentityPublicationsInner addAuthorsItem(SocialIdentityPublicationsInnerAuthorsInner authorsItem) { + if (this.authors == null) { + this.authors = new ArrayList<>(); + } + this.authors.add(authorsItem); + return this; + } + + /** + * Get authors + * @return authors + */ + @javax.annotation.Nullable + public List<SocialIdentityPublicationsInnerAuthorsInner> getAuthors() { + return authors; + } + + public void setAuthors(@javax.annotation.Nullable List<SocialIdentityPublicationsInnerAuthorsInner> authors) { + this.authors = authors; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityPublicationsInner instance itself + */ + public SocialIdentityPublicationsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityPublicationsInner socialIdentityPublicationsInner = (SocialIdentityPublicationsInner) o; + return Objects.equals(this.title, socialIdentityPublicationsInner.title) && + Objects.equals(this.publisher, socialIdentityPublicationsInner.publisher) && + Objects.equals(this.date, socialIdentityPublicationsInner.date) && + Objects.equals(this.id, socialIdentityPublicationsInner.id) && + Objects.equals(this.url, socialIdentityPublicationsInner.url) && + Objects.equals(this.summary, socialIdentityPublicationsInner.summary) && + Objects.equals(this.authors, socialIdentityPublicationsInner.authors)&& + Objects.equals(this.additionalProperties, socialIdentityPublicationsInner.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(title, publisher, date, id, url, summary, authors, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityPublicationsInner {\n"); + sb.append(" title: ").append(toIndentedString(title)).append("\n"); + sb.append(" publisher: ").append(toIndentedString(publisher)).append("\n"); + sb.append(" date: ").append(toIndentedString(date)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" url: ").append(toIndentedString(url)).append("\n"); + sb.append(" summary: ").append(toIndentedString(summary)).append("\n"); + sb.append(" authors: ").append(toIndentedString(authors)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Title"); + openapiFields.add("Publisher"); + openapiFields.add("Date"); + openapiFields.add("Id"); + openapiFields.add("Url"); + openapiFields.add("Summary"); + openapiFields.add("Authors"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityPublicationsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityPublicationsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityPublicationsInner is not found in the empty JSON string", SocialIdentityPublicationsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Title") != null && !jsonObj.get("Title").isJsonNull()) && !jsonObj.get("Title").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Title` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Title").toString())); + } + if ((jsonObj.get("Publisher") != null && !jsonObj.get("Publisher").isJsonNull()) && !jsonObj.get("Publisher").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Publisher` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Publisher").toString())); + } + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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") != null && !jsonObj.get("Url").isJsonNull()) && !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())); + } + if ((jsonObj.get("Summary") != null && !jsonObj.get("Summary").isJsonNull()) && !jsonObj.get("Summary").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Summary` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Summary").toString())); + } + if (jsonObj.get("Authors") != null && !jsonObj.get("Authors").isJsonNull()) { + JsonArray jsonArrayauthors = jsonObj.getAsJsonArray("Authors"); + if (jsonArrayauthors != null) { + // ensure the json data is an array + if (!jsonObj.get("Authors").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Authors` to be an array in the JSON string but got `%s`", jsonObj.get("Authors").toString())); + } + + // validate the optional field `Authors` (array) + for (int i = 0; i < jsonArrayauthors.size(); i++) { + SocialIdentityPublicationsInnerAuthorsInner.validateJsonElement(jsonArrayauthors.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityPublicationsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityPublicationsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityPublicationsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityPublicationsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityPublicationsInner>() { + @Override + public void write(JsonWriter out, SocialIdentityPublicationsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityPublicationsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityPublicationsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityPublicationsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityPublicationsInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityPublicationsInner + */ + public static SocialIdentityPublicationsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityPublicationsInner.class); + } + + /** + * Convert an instance of SocialIdentityPublicationsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityPublicationsInnerAuthorsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityPublicationsInnerAuthorsInner.java new file mode 100644 index 0000000..d40ea7d --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityPublicationsInnerAuthorsInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityPublicationsInnerAuthorsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityPublicationsInnerAuthorsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public SocialIdentityPublicationsInnerAuthorsInner() { + } + + public SocialIdentityPublicationsInnerAuthorsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public SocialIdentityPublicationsInnerAuthorsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityPublicationsInnerAuthorsInner instance itself + */ + public SocialIdentityPublicationsInnerAuthorsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityPublicationsInnerAuthorsInner socialIdentityPublicationsInnerAuthorsInner = (SocialIdentityPublicationsInnerAuthorsInner) o; + return Objects.equals(this.id, socialIdentityPublicationsInnerAuthorsInner.id) && + Objects.equals(this.name, socialIdentityPublicationsInnerAuthorsInner.name)&& + Objects.equals(this.additionalProperties, socialIdentityPublicationsInnerAuthorsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityPublicationsInnerAuthorsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityPublicationsInnerAuthorsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityPublicationsInnerAuthorsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityPublicationsInnerAuthorsInner is not found in the empty JSON string", SocialIdentityPublicationsInnerAuthorsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityPublicationsInnerAuthorsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityPublicationsInnerAuthorsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityPublicationsInnerAuthorsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityPublicationsInnerAuthorsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityPublicationsInnerAuthorsInner>() { + @Override + public void write(JsonWriter out, SocialIdentityPublicationsInnerAuthorsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityPublicationsInnerAuthorsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityPublicationsInnerAuthorsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityPublicationsInnerAuthorsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityPublicationsInnerAuthorsInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityPublicationsInnerAuthorsInner + */ + public static SocialIdentityPublicationsInnerAuthorsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityPublicationsInnerAuthorsInner.class); + } + + /** + * Convert an instance of SocialIdentityPublicationsInnerAuthorsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityRecommendationsReceivedInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityRecommendationsReceivedInner.java new file mode 100644 index 0000000..f92eb19 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityRecommendationsReceivedInner.java @@ -0,0 +1,377 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityRecommendationsReceivedInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityRecommendationsReceivedInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_RECOMMENDER = "Recommender"; + @SerializedName(SERIALIZED_NAME_RECOMMENDER) + @javax.annotation.Nullable + private String recommender; + + public static final String SERIALIZED_NAME_RECOMMENDATION_TEXT = "RecommendationText"; + @SerializedName(SERIALIZED_NAME_RECOMMENDATION_TEXT) + @javax.annotation.Nullable + private String recommendationText; + + public static final String SERIALIZED_NAME_RECOMMENDATION_TYPE = "RecommendationType"; + @SerializedName(SERIALIZED_NAME_RECOMMENDATION_TYPE) + @javax.annotation.Nullable + private String recommendationType; + + public SocialIdentityRecommendationsReceivedInner() { + } + + public SocialIdentityRecommendationsReceivedInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public SocialIdentityRecommendationsReceivedInner recommender(@javax.annotation.Nullable String recommender) { + this.recommender = recommender; + return this; + } + + /** + * Get recommender + * @return recommender + */ + @javax.annotation.Nullable + public String getRecommender() { + return recommender; + } + + public void setRecommender(@javax.annotation.Nullable String recommender) { + this.recommender = recommender; + } + + + public SocialIdentityRecommendationsReceivedInner recommendationText(@javax.annotation.Nullable String recommendationText) { + this.recommendationText = recommendationText; + return this; + } + + /** + * Get recommendationText + * @return recommendationText + */ + @javax.annotation.Nullable + public String getRecommendationText() { + return recommendationText; + } + + public void setRecommendationText(@javax.annotation.Nullable String recommendationText) { + this.recommendationText = recommendationText; + } + + + public SocialIdentityRecommendationsReceivedInner recommendationType(@javax.annotation.Nullable String recommendationType) { + this.recommendationType = recommendationType; + return this; + } + + /** + * Get recommendationType + * @return recommendationType + */ + @javax.annotation.Nullable + public String getRecommendationType() { + return recommendationType; + } + + public void setRecommendationType(@javax.annotation.Nullable String recommendationType) { + this.recommendationType = recommendationType; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityRecommendationsReceivedInner instance itself + */ + public SocialIdentityRecommendationsReceivedInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityRecommendationsReceivedInner socialIdentityRecommendationsReceivedInner = (SocialIdentityRecommendationsReceivedInner) o; + return Objects.equals(this.id, socialIdentityRecommendationsReceivedInner.id) && + Objects.equals(this.recommender, socialIdentityRecommendationsReceivedInner.recommender) && + Objects.equals(this.recommendationText, socialIdentityRecommendationsReceivedInner.recommendationText) && + Objects.equals(this.recommendationType, socialIdentityRecommendationsReceivedInner.recommendationType)&& + Objects.equals(this.additionalProperties, socialIdentityRecommendationsReceivedInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, recommender, recommendationText, recommendationType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityRecommendationsReceivedInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" recommender: ").append(toIndentedString(recommender)).append("\n"); + sb.append(" recommendationText: ").append(toIndentedString(recommendationText)).append("\n"); + sb.append(" recommendationType: ").append(toIndentedString(recommendationType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Recommender"); + openapiFields.add("RecommendationText"); + openapiFields.add("RecommendationType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityRecommendationsReceivedInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityRecommendationsReceivedInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityRecommendationsReceivedInner is not found in the empty JSON string", SocialIdentityRecommendationsReceivedInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Recommender") != null && !jsonObj.get("Recommender").isJsonNull()) && !jsonObj.get("Recommender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Recommender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Recommender").toString())); + } + if ((jsonObj.get("RecommendationText") != null && !jsonObj.get("RecommendationText").isJsonNull()) && !jsonObj.get("RecommendationText").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RecommendationText` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RecommendationText").toString())); + } + if ((jsonObj.get("RecommendationType") != null && !jsonObj.get("RecommendationType").isJsonNull()) && !jsonObj.get("RecommendationType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RecommendationType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RecommendationType").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityRecommendationsReceivedInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityRecommendationsReceivedInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityRecommendationsReceivedInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityRecommendationsReceivedInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityRecommendationsReceivedInner>() { + @Override + public void write(JsonWriter out, SocialIdentityRecommendationsReceivedInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityRecommendationsReceivedInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityRecommendationsReceivedInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityRecommendationsReceivedInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityRecommendationsReceivedInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityRecommendationsReceivedInner + */ + public static SocialIdentityRecommendationsReceivedInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityRecommendationsReceivedInner.class); + } + + /** + * Convert an instance of SocialIdentityRecommendationsReceivedInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityRelatedProfileViewsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityRelatedProfileViewsInner.java new file mode 100644 index 0000000..b1503e8 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityRelatedProfileViewsInner.java @@ -0,0 +1,347 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityRelatedProfileViewsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityRelatedProfileViewsInner { + public static final String SERIALIZED_NAME_FIRST_NAME = "FirstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nullable + private String firstName; + + public static final String SERIALIZED_NAME_LAST_NAME = "LastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nullable + private String lastName; + + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public SocialIdentityRelatedProfileViewsInner() { + } + + public SocialIdentityRelatedProfileViewsInner firstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + */ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + } + + + public SocialIdentityRelatedProfileViewsInner lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + + public SocialIdentityRelatedProfileViewsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityRelatedProfileViewsInner instance itself + */ + public SocialIdentityRelatedProfileViewsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityRelatedProfileViewsInner socialIdentityRelatedProfileViewsInner = (SocialIdentityRelatedProfileViewsInner) o; + return Objects.equals(this.firstName, socialIdentityRelatedProfileViewsInner.firstName) && + Objects.equals(this.lastName, socialIdentityRelatedProfileViewsInner.lastName) && + Objects.equals(this.id, socialIdentityRelatedProfileViewsInner.id)&& + Objects.equals(this.additionalProperties, socialIdentityRelatedProfileViewsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(firstName, lastName, id, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityRelatedProfileViewsInner {\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("FirstName"); + openapiFields.add("LastName"); + openapiFields.add("Id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityRelatedProfileViewsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityRelatedProfileViewsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityRelatedProfileViewsInner is not found in the empty JSON string", SocialIdentityRelatedProfileViewsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("FirstName") != null && !jsonObj.get("FirstName").isJsonNull()) && !jsonObj.get("FirstName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FirstName").toString())); + } + if ((jsonObj.get("LastName") != null && !jsonObj.get("LastName").isJsonNull()) && !jsonObj.get("LastName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastName").toString())); + } + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityRelatedProfileViewsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityRelatedProfileViewsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityRelatedProfileViewsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityRelatedProfileViewsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityRelatedProfileViewsInner>() { + @Override + public void write(JsonWriter out, SocialIdentityRelatedProfileViewsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityRelatedProfileViewsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityRelatedProfileViewsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityRelatedProfileViewsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityRelatedProfileViewsInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityRelatedProfileViewsInner + */ + public static SocialIdentityRelatedProfileViewsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityRelatedProfileViewsInner.class); + } + + /** + * Convert an instance of SocialIdentityRelatedProfileViewsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentitySkillsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentitySkillsInner.java new file mode 100644 index 0000000..cfa2157 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentitySkillsInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentitySkillsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentitySkillsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public SocialIdentitySkillsInner() { + } + + public SocialIdentitySkillsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public SocialIdentitySkillsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentitySkillsInner instance itself + */ + public SocialIdentitySkillsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentitySkillsInner socialIdentitySkillsInner = (SocialIdentitySkillsInner) o; + return Objects.equals(this.id, socialIdentitySkillsInner.id) && + Objects.equals(this.name, socialIdentitySkillsInner.name)&& + Objects.equals(this.additionalProperties, socialIdentitySkillsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentitySkillsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentitySkillsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentitySkillsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentitySkillsInner is not found in the empty JSON string", SocialIdentitySkillsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentitySkillsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentitySkillsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentitySkillsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentitySkillsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentitySkillsInner>() { + @Override + public void write(JsonWriter out, SocialIdentitySkillsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentitySkillsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentitySkillsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentitySkillsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentitySkillsInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentitySkillsInner + */ + public static SocialIdentitySkillsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentitySkillsInner.class); + } + + /** + * Convert an instance of SocialIdentitySkillsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentitySportsInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentitySportsInner.java new file mode 100644 index 0000000..7669424 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentitySportsInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentitySportsInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentitySportsInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public SocialIdentitySportsInner() { + } + + public SocialIdentitySportsInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public SocialIdentitySportsInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentitySportsInner instance itself + */ + public SocialIdentitySportsInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentitySportsInner socialIdentitySportsInner = (SocialIdentitySportsInner) o; + return Objects.equals(this.id, socialIdentitySportsInner.id) && + Objects.equals(this.name, socialIdentitySportsInner.name)&& + Objects.equals(this.additionalProperties, socialIdentitySportsInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentitySportsInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentitySportsInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentitySportsInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentitySportsInner is not found in the empty JSON string", SocialIdentitySportsInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentitySportsInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentitySportsInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentitySportsInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentitySportsInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentitySportsInner>() { + @Override + public void write(JsonWriter out, SocialIdentitySportsInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentitySportsInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentitySportsInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentitySportsInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentitySportsInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentitySportsInner + */ + public static SocialIdentitySportsInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentitySportsInner.class); + } + + /** + * Convert an instance of SocialIdentitySportsInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentitySubscription.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentitySubscription.java new file mode 100644 index 0000000..0a4f921 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentitySubscription.java @@ -0,0 +1,377 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentitySubscription + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentitySubscription { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_SPACE = "Space"; + @SerializedName(SERIALIZED_NAME_SPACE) + @javax.annotation.Nullable + private String space; + + public static final String SERIALIZED_NAME_PRIVATE_REPOS = "PrivateRepos"; + @SerializedName(SERIALIZED_NAME_PRIVATE_REPOS) + @javax.annotation.Nullable + private String privateRepos; + + public static final String SERIALIZED_NAME_COLLABORATORS = "Collaborators"; + @SerializedName(SERIALIZED_NAME_COLLABORATORS) + @javax.annotation.Nullable + private String collaborators; + + public SocialIdentitySubscription() { + } + + public SocialIdentitySubscription name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public SocialIdentitySubscription space(@javax.annotation.Nullable String space) { + this.space = space; + return this; + } + + /** + * Get space + * @return space + */ + @javax.annotation.Nullable + public String getSpace() { + return space; + } + + public void setSpace(@javax.annotation.Nullable String space) { + this.space = space; + } + + + public SocialIdentitySubscription privateRepos(@javax.annotation.Nullable String privateRepos) { + this.privateRepos = privateRepos; + return this; + } + + /** + * Get privateRepos + * @return privateRepos + */ + @javax.annotation.Nullable + public String getPrivateRepos() { + return privateRepos; + } + + public void setPrivateRepos(@javax.annotation.Nullable String privateRepos) { + this.privateRepos = privateRepos; + } + + + public SocialIdentitySubscription collaborators(@javax.annotation.Nullable String collaborators) { + this.collaborators = collaborators; + return this; + } + + /** + * Get collaborators + * @return collaborators + */ + @javax.annotation.Nullable + public String getCollaborators() { + return collaborators; + } + + public void setCollaborators(@javax.annotation.Nullable String collaborators) { + this.collaborators = collaborators; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentitySubscription instance itself + */ + public SocialIdentitySubscription putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentitySubscription socialIdentitySubscription = (SocialIdentitySubscription) o; + return Objects.equals(this.name, socialIdentitySubscription.name) && + Objects.equals(this.space, socialIdentitySubscription.space) && + Objects.equals(this.privateRepos, socialIdentitySubscription.privateRepos) && + Objects.equals(this.collaborators, socialIdentitySubscription.collaborators)&& + Objects.equals(this.additionalProperties, socialIdentitySubscription.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, space, privateRepos, collaborators, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentitySubscription {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" space: ").append(toIndentedString(space)).append("\n"); + sb.append(" privateRepos: ").append(toIndentedString(privateRepos)).append("\n"); + sb.append(" collaborators: ").append(toIndentedString(collaborators)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + openapiFields.add("Space"); + openapiFields.add("PrivateRepos"); + openapiFields.add("Collaborators"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentitySubscription + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentitySubscription.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentitySubscription is not found in the empty JSON string", SocialIdentitySubscription.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Space") != null && !jsonObj.get("Space").isJsonNull()) && !jsonObj.get("Space").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Space` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Space").toString())); + } + if ((jsonObj.get("PrivateRepos") != null && !jsonObj.get("PrivateRepos").isJsonNull()) && !jsonObj.get("PrivateRepos").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PrivateRepos` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PrivateRepos").toString())); + } + if ((jsonObj.get("Collaborators") != null && !jsonObj.get("Collaborators").isJsonNull()) && !jsonObj.get("Collaborators").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Collaborators` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Collaborators").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentitySubscription.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentitySubscription' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentitySubscription> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentitySubscription.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentitySubscription>() { + @Override + public void write(JsonWriter out, SocialIdentitySubscription value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentitySubscription read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentitySubscription instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentitySubscription given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentitySubscription + * @throws IOException if the JSON string is invalid with respect to SocialIdentitySubscription + */ + public static SocialIdentitySubscription fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentitySubscription.class); + } + + /** + * Convert an instance of SocialIdentitySubscription to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentitySuggestions.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentitySuggestions.java new file mode 100644 index 0000000..08a8012 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentitySuggestions.java @@ -0,0 +1,310 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentitySuggestions + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentitySuggestions { + public static final String SERIALIZED_NAME_SUGGESTED_FRIENDS = "SuggestedFriends"; + @SerializedName(SERIALIZED_NAME_SUGGESTED_FRIENDS) + @javax.annotation.Nullable + private List<String> suggestedFriends; + + public SocialIdentitySuggestions() { + } + + public SocialIdentitySuggestions suggestedFriends(@javax.annotation.Nullable List<String> suggestedFriends) { + this.suggestedFriends = suggestedFriends; + return this; + } + + public SocialIdentitySuggestions addSuggestedFriendsItem(String suggestedFriendsItem) { + if (this.suggestedFriends == null) { + this.suggestedFriends = new ArrayList<>(); + } + this.suggestedFriends.add(suggestedFriendsItem); + return this; + } + + /** + * Get suggestedFriends + * @return suggestedFriends + */ + @javax.annotation.Nullable + public List<String> getSuggestedFriends() { + return suggestedFriends; + } + + public void setSuggestedFriends(@javax.annotation.Nullable List<String> suggestedFriends) { + this.suggestedFriends = suggestedFriends; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentitySuggestions instance itself + */ + public SocialIdentitySuggestions putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentitySuggestions socialIdentitySuggestions = (SocialIdentitySuggestions) o; + return Objects.equals(this.suggestedFriends, socialIdentitySuggestions.suggestedFriends)&& + Objects.equals(this.additionalProperties, socialIdentitySuggestions.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(suggestedFriends, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentitySuggestions {\n"); + sb.append(" suggestedFriends: ").append(toIndentedString(suggestedFriends)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("SuggestedFriends"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentitySuggestions + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentitySuggestions.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentitySuggestions is not found in the empty JSON string", SocialIdentitySuggestions.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("SuggestedFriends") != null && !jsonObj.get("SuggestedFriends").isJsonNull() && !jsonObj.get("SuggestedFriends").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `SuggestedFriends` to be an array in the JSON string but got `%s`", jsonObj.get("SuggestedFriends").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentitySuggestions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentitySuggestions' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentitySuggestions> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentitySuggestions.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentitySuggestions>() { + @Override + public void write(JsonWriter out, SocialIdentitySuggestions value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentitySuggestions read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentitySuggestions instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentitySuggestions given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentitySuggestions + * @throws IOException if the JSON string is invalid with respect to SocialIdentitySuggestions + */ + public static SocialIdentitySuggestions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentitySuggestions.class); + } + + /** + * Convert an instance of SocialIdentitySuggestions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityTelevisionShowInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityTelevisionShowInner.java new file mode 100644 index 0000000..6a65018 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityTelevisionShowInner.java @@ -0,0 +1,375 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityTelevisionShowInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityTelevisionShowInner { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_CATEGORY = "Category"; + @SerializedName(SERIALIZED_NAME_CATEGORY) + @javax.annotation.Nullable + private String category; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public SocialIdentityTelevisionShowInner() { + } + + public SocialIdentityTelevisionShowInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public SocialIdentityTelevisionShowInner category(@javax.annotation.Nullable String category) { + this.category = category; + return this; + } + + /** + * Get category + * @return category + */ + @javax.annotation.Nullable + public String getCategory() { + return category; + } + + public void setCategory(@javax.annotation.Nullable String category) { + this.category = category; + } + + + public SocialIdentityTelevisionShowInner name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public SocialIdentityTelevisionShowInner createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Get createdDate + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityTelevisionShowInner instance itself + */ + public SocialIdentityTelevisionShowInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityTelevisionShowInner socialIdentityTelevisionShowInner = (SocialIdentityTelevisionShowInner) o; + return Objects.equals(this.id, socialIdentityTelevisionShowInner.id) && + Objects.equals(this.category, socialIdentityTelevisionShowInner.category) && + Objects.equals(this.name, socialIdentityTelevisionShowInner.name) && + Objects.equals(this.createdDate, socialIdentityTelevisionShowInner.createdDate)&& + Objects.equals(this.additionalProperties, socialIdentityTelevisionShowInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, category, name, createdDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityTelevisionShowInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" category: ").append(toIndentedString(category)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Category"); + openapiFields.add("Name"); + openapiFields.add("CreatedDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityTelevisionShowInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityTelevisionShowInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityTelevisionShowInner is not found in the empty JSON string", SocialIdentityTelevisionShowInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Category") != null && !jsonObj.get("Category").isJsonNull()) && !jsonObj.get("Category").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Category` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Category").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityTelevisionShowInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityTelevisionShowInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityTelevisionShowInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityTelevisionShowInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityTelevisionShowInner>() { + @Override + public void write(JsonWriter out, SocialIdentityTelevisionShowInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityTelevisionShowInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityTelevisionShowInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityTelevisionShowInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityTelevisionShowInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityTelevisionShowInner + */ + public static SocialIdentityTelevisionShowInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityTelevisionShowInner.class); + } + + /** + * Convert an instance of SocialIdentityTelevisionShowInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityVolunteerInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityVolunteerInner.java new file mode 100644 index 0000000..d46d1c8 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SocialIdentityVolunteerInner.java @@ -0,0 +1,377 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SocialIdentityVolunteerInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SocialIdentityVolunteerInner { + public static final String SERIALIZED_NAME_ORGANIZATION = "Organization"; + @SerializedName(SERIALIZED_NAME_ORGANIZATION) + @javax.annotation.Nullable + private String organization; + + public static final String SERIALIZED_NAME_ROLE = "Role"; + @SerializedName(SERIALIZED_NAME_ROLE) + @javax.annotation.Nullable + private String role; + + public static final String SERIALIZED_NAME_CAUSE = "Cause"; + @SerializedName(SERIALIZED_NAME_CAUSE) + @javax.annotation.Nullable + private String cause; + + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public SocialIdentityVolunteerInner() { + } + + public SocialIdentityVolunteerInner organization(@javax.annotation.Nullable String organization) { + this.organization = organization; + return this; + } + + /** + * Get organization + * @return organization + */ + @javax.annotation.Nullable + public String getOrganization() { + return organization; + } + + public void setOrganization(@javax.annotation.Nullable String organization) { + this.organization = organization; + } + + + public SocialIdentityVolunteerInner role(@javax.annotation.Nullable String role) { + this.role = role; + return this; + } + + /** + * Get role + * @return role + */ + @javax.annotation.Nullable + public String getRole() { + return role; + } + + public void setRole(@javax.annotation.Nullable String role) { + this.role = role; + } + + + public SocialIdentityVolunteerInner cause(@javax.annotation.Nullable String cause) { + this.cause = cause; + return this; + } + + /** + * Get cause + * @return cause + */ + @javax.annotation.Nullable + public String getCause() { + return cause; + } + + public void setCause(@javax.annotation.Nullable String cause) { + this.cause = cause; + } + + + public SocialIdentityVolunteerInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SocialIdentityVolunteerInner instance itself + */ + public SocialIdentityVolunteerInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SocialIdentityVolunteerInner socialIdentityVolunteerInner = (SocialIdentityVolunteerInner) o; + return Objects.equals(this.organization, socialIdentityVolunteerInner.organization) && + Objects.equals(this.role, socialIdentityVolunteerInner.role) && + Objects.equals(this.cause, socialIdentityVolunteerInner.cause) && + Objects.equals(this.id, socialIdentityVolunteerInner.id)&& + Objects.equals(this.additionalProperties, socialIdentityVolunteerInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(organization, role, cause, id, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SocialIdentityVolunteerInner {\n"); + sb.append(" organization: ").append(toIndentedString(organization)).append("\n"); + sb.append(" role: ").append(toIndentedString(role)).append("\n"); + sb.append(" cause: ").append(toIndentedString(cause)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Organization"); + openapiFields.add("Role"); + openapiFields.add("Cause"); + openapiFields.add("Id"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SocialIdentityVolunteerInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SocialIdentityVolunteerInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SocialIdentityVolunteerInner is not found in the empty JSON string", SocialIdentityVolunteerInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Organization") != null && !jsonObj.get("Organization").isJsonNull()) && !jsonObj.get("Organization").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Organization` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Organization").toString())); + } + if ((jsonObj.get("Role") != null && !jsonObj.get("Role").isJsonNull()) && !jsonObj.get("Role").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Role` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Role").toString())); + } + if ((jsonObj.get("Cause") != null && !jsonObj.get("Cause").isJsonNull()) && !jsonObj.get("Cause").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Cause` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Cause").toString())); + } + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SocialIdentityVolunteerInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SocialIdentityVolunteerInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SocialIdentityVolunteerInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SocialIdentityVolunteerInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<SocialIdentityVolunteerInner>() { + @Override + public void write(JsonWriter out, SocialIdentityVolunteerInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SocialIdentityVolunteerInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SocialIdentityVolunteerInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SocialIdentityVolunteerInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of SocialIdentityVolunteerInner + * @throws IOException if the JSON string is invalid with respect to SocialIdentityVolunteerInner + */ + public static SocialIdentityVolunteerInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SocialIdentityVolunteerInner.class); + } + + /** + * Convert an instance of SocialIdentityVolunteerInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SottGenerate.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SottGenerate.java new file mode 100644 index 0000000..04239d5 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SottGenerate.java @@ -0,0 +1,349 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * SottGenerate + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SottGenerate { + public static final String SERIALIZED_NAME_EXPIRES_IN_MINUTES = "ExpiresInMinutes"; + @SerializedName(SERIALIZED_NAME_EXPIRES_IN_MINUTES) + @javax.annotation.Nonnull + private Integer expiresInMinutes; + + public static final String SERIALIZED_NAME_ENCODED = "Encoded"; + @SerializedName(SERIALIZED_NAME_ENCODED) + @javax.annotation.Nullable + private Boolean encoded; + + public static final String SERIALIZED_NAME_COMMENT = "Comment"; + @SerializedName(SERIALIZED_NAME_COMMENT) + @javax.annotation.Nullable + private String comment; + + public SottGenerate() { + } + + public SottGenerate expiresInMinutes(@javax.annotation.Nonnull Integer expiresInMinutes) { + this.expiresInMinutes = expiresInMinutes; + return this; + } + + /** + * The number of minutes until the SOTT expires. + * @return expiresInMinutes + */ + @javax.annotation.Nonnull + public Integer getExpiresInMinutes() { + return expiresInMinutes; + } + + public void setExpiresInMinutes(@javax.annotation.Nonnull Integer expiresInMinutes) { + this.expiresInMinutes = expiresInMinutes; + } + + + public SottGenerate encoded(@javax.annotation.Nullable Boolean encoded) { + this.encoded = encoded; + return this; + } + + /** + * Indicates whether the SOTT should be encoded. + * @return encoded + */ + @javax.annotation.Nullable + public Boolean getEncoded() { + return encoded; + } + + public void setEncoded(@javax.annotation.Nullable Boolean encoded) { + this.encoded = encoded; + } + + + public SottGenerate comment(@javax.annotation.Nullable String comment) { + this.comment = comment; + return this; + } + + /** + * A comment associated with the SOTT. + * @return comment + */ + @javax.annotation.Nullable + public String getComment() { + return comment; + } + + public void setComment(@javax.annotation.Nullable String comment) { + this.comment = comment; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SottGenerate instance itself + */ + public SottGenerate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SottGenerate sottGenerate = (SottGenerate) o; + return Objects.equals(this.expiresInMinutes, sottGenerate.expiresInMinutes) && + Objects.equals(this.encoded, sottGenerate.encoded) && + Objects.equals(this.comment, sottGenerate.comment)&& + Objects.equals(this.additionalProperties, sottGenerate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(expiresInMinutes, encoded, comment, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SottGenerate {\n"); + sb.append(" expiresInMinutes: ").append(toIndentedString(expiresInMinutes)).append("\n"); + sb.append(" encoded: ").append(toIndentedString(encoded)).append("\n"); + sb.append(" comment: ").append(toIndentedString(comment)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ExpiresInMinutes"); + openapiFields.add("Encoded"); + openapiFields.add("Comment"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("ExpiresInMinutes"); + } + + /** + * 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 SottGenerate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SottGenerate.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SottGenerate is not found in the empty JSON string", SottGenerate.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SottGenerate.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("Comment") != null && !jsonObj.get("Comment").isJsonNull()) && !jsonObj.get("Comment").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Comment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Comment").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SottGenerate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SottGenerate' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SottGenerate> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SottGenerate.class)); + + return (TypeAdapter<T>) new TypeAdapter<SottGenerate>() { + @Override + public void write(JsonWriter out, SottGenerate value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SottGenerate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SottGenerate instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SottGenerate given an JSON string + * + * @param jsonString JSON string + * @return An instance of SottGenerate + * @throws IOException if the JSON string is invalid with respect to SottGenerate + */ + public static SottGenerate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SottGenerate.class); + } + + /** + * Convert an instance of SottGenerate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SottGenerateTechnology.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SottGenerateTechnology.java new file mode 100644 index 0000000..37f8a4f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SottGenerateTechnology.java @@ -0,0 +1,380 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.Technology; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SottGenerateTechnology + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SottGenerateTechnology { + public static final String SERIALIZED_NAME_EXPIRES_IN_MINUTES = "ExpiresInMinutes"; + @SerializedName(SERIALIZED_NAME_EXPIRES_IN_MINUTES) + @javax.annotation.Nonnull + private Integer expiresInMinutes; + + public static final String SERIALIZED_NAME_ENCODED = "Encoded"; + @SerializedName(SERIALIZED_NAME_ENCODED) + @javax.annotation.Nullable + private Boolean encoded; + + public static final String SERIALIZED_NAME_COMMENT = "Comment"; + @SerializedName(SERIALIZED_NAME_COMMENT) + @javax.annotation.Nullable + private String comment; + + public static final String SERIALIZED_NAME_TECHNOLOGY = "Technology"; + @SerializedName(SERIALIZED_NAME_TECHNOLOGY) + @javax.annotation.Nonnull + private Technology technology; + + public SottGenerateTechnology() { + } + + public SottGenerateTechnology expiresInMinutes(@javax.annotation.Nonnull Integer expiresInMinutes) { + this.expiresInMinutes = expiresInMinutes; + return this; + } + + /** + * The number of minutes until the SOTT expires. + * @return expiresInMinutes + */ + @javax.annotation.Nonnull + public Integer getExpiresInMinutes() { + return expiresInMinutes; + } + + public void setExpiresInMinutes(@javax.annotation.Nonnull Integer expiresInMinutes) { + this.expiresInMinutes = expiresInMinutes; + } + + + public SottGenerateTechnology encoded(@javax.annotation.Nullable Boolean encoded) { + this.encoded = encoded; + return this; + } + + /** + * Indicates whether the SOTT should be encoded. + * @return encoded + */ + @javax.annotation.Nullable + public Boolean getEncoded() { + return encoded; + } + + public void setEncoded(@javax.annotation.Nullable Boolean encoded) { + this.encoded = encoded; + } + + + public SottGenerateTechnology comment(@javax.annotation.Nullable String comment) { + this.comment = comment; + return this; + } + + /** + * A comment associated with the SOTT. + * @return comment + */ + @javax.annotation.Nullable + public String getComment() { + return comment; + } + + public void setComment(@javax.annotation.Nullable String comment) { + this.comment = comment; + } + + + public SottGenerateTechnology technology(@javax.annotation.Nonnull Technology technology) { + this.technology = technology; + return this; + } + + /** + * Get technology + * @return technology + */ + @javax.annotation.Nonnull + public Technology getTechnology() { + return technology; + } + + public void setTechnology(@javax.annotation.Nonnull Technology technology) { + this.technology = technology; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SottGenerateTechnology instance itself + */ + public SottGenerateTechnology putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SottGenerateTechnology sottGenerateTechnology = (SottGenerateTechnology) o; + return Objects.equals(this.expiresInMinutes, sottGenerateTechnology.expiresInMinutes) && + Objects.equals(this.encoded, sottGenerateTechnology.encoded) && + Objects.equals(this.comment, sottGenerateTechnology.comment) && + Objects.equals(this.technology, sottGenerateTechnology.technology)&& + Objects.equals(this.additionalProperties, sottGenerateTechnology.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(expiresInMinutes, encoded, comment, technology, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SottGenerateTechnology {\n"); + sb.append(" expiresInMinutes: ").append(toIndentedString(expiresInMinutes)).append("\n"); + sb.append(" encoded: ").append(toIndentedString(encoded)).append("\n"); + sb.append(" comment: ").append(toIndentedString(comment)).append("\n"); + sb.append(" technology: ").append(toIndentedString(technology)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ExpiresInMinutes"); + openapiFields.add("Encoded"); + openapiFields.add("Comment"); + openapiFields.add("Technology"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("ExpiresInMinutes"); + openapiRequiredFields.add("Technology"); + } + + /** + * 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 SottGenerateTechnology + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SottGenerateTechnology.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SottGenerateTechnology is not found in the empty JSON string", SottGenerateTechnology.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SottGenerateTechnology.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("Comment") != null && !jsonObj.get("Comment").isJsonNull()) && !jsonObj.get("Comment").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Comment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Comment").toString())); + } + // validate the required field `Technology` + Technology.validateJsonElement(jsonObj.get("Technology")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SottGenerateTechnology.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SottGenerateTechnology' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SottGenerateTechnology> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SottGenerateTechnology.class)); + + return (TypeAdapter<T>) new TypeAdapter<SottGenerateTechnology>() { + @Override + public void write(JsonWriter out, SottGenerateTechnology value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SottGenerateTechnology read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SottGenerateTechnology instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SottGenerateTechnology given an JSON string + * + * @param jsonString JSON string + * @return An instance of SottGenerateTechnology + * @throws IOException if the JSON string is invalid with respect to SottGenerateTechnology + */ + public static SottGenerateTechnology fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SottGenerateTechnology.class); + } + + /** + * Convert an instance of SottGenerateTechnology to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SottGenerateTechnologyCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SottGenerateTechnologyCore.java new file mode 100644 index 0000000..67de8a4 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SottGenerateTechnologyCore.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.Technology; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SottGenerateTechnologyCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SottGenerateTechnologyCore { + public static final String SERIALIZED_NAME_TECHNOLOGY = "Technology"; + @SerializedName(SERIALIZED_NAME_TECHNOLOGY) + @javax.annotation.Nonnull + private Technology technology; + + public SottGenerateTechnologyCore() { + } + + public SottGenerateTechnologyCore technology(@javax.annotation.Nonnull Technology technology) { + this.technology = technology; + return this; + } + + /** + * Get technology + * @return technology + */ + @javax.annotation.Nonnull + public Technology getTechnology() { + return technology; + } + + public void setTechnology(@javax.annotation.Nonnull Technology technology) { + this.technology = technology; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SottGenerateTechnologyCore instance itself + */ + public SottGenerateTechnologyCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SottGenerateTechnologyCore sottGenerateTechnologyCore = (SottGenerateTechnologyCore) o; + return Objects.equals(this.technology, sottGenerateTechnologyCore.technology)&& + Objects.equals(this.additionalProperties, sottGenerateTechnologyCore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(technology, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SottGenerateTechnologyCore {\n"); + sb.append(" technology: ").append(toIndentedString(technology)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Technology"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Technology"); + } + + /** + * 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 SottGenerateTechnologyCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SottGenerateTechnologyCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SottGenerateTechnologyCore is not found in the empty JSON string", SottGenerateTechnologyCore.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : SottGenerateTechnologyCore.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 `Technology` + Technology.validateJsonElement(jsonObj.get("Technology")); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SottGenerateTechnologyCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SottGenerateTechnologyCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SottGenerateTechnologyCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SottGenerateTechnologyCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<SottGenerateTechnologyCore>() { + @Override + public void write(JsonWriter out, SottGenerateTechnologyCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SottGenerateTechnologyCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SottGenerateTechnologyCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SottGenerateTechnologyCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of SottGenerateTechnologyCore + * @throws IOException if the JSON string is invalid with respect to SottGenerateTechnologyCore + */ + public static SottGenerateTechnologyCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SottGenerateTechnologyCore.class); + } + + /** + * Convert an instance of SottGenerateTechnologyCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SottList.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SottList.java new file mode 100644 index 0000000..3b3bc9b --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SottList.java @@ -0,0 +1,434 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.Technology; +import java.io.IOException; +import java.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SottList + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SottList { + public static final String SERIALIZED_NAME_AUTHENTICITY_TOKEN = "AuthenticityToken"; + @SerializedName(SERIALIZED_NAME_AUTHENTICITY_TOKEN) + @javax.annotation.Nullable + private String authenticityToken; + + public static final String SERIALIZED_NAME_TECHNOLOGY = "Technology"; + @SerializedName(SERIALIZED_NAME_TECHNOLOGY) + @javax.annotation.Nullable + private Technology technology; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public static final String SERIALIZED_NAME_DATE_RANGE = "DateRange"; + @SerializedName(SERIALIZED_NAME_DATE_RANGE) + @javax.annotation.Nullable + private String dateRange; + + public static final String SERIALIZED_NAME_IS_ENCODED = "IsEncoded"; + @SerializedName(SERIALIZED_NAME_IS_ENCODED) + @javax.annotation.Nullable + private Boolean isEncoded; + + public static final String SERIALIZED_NAME_COMMENT = "Comment"; + @SerializedName(SERIALIZED_NAME_COMMENT) + @javax.annotation.Nullable + private String comment; + + public SottList() { + } + + public SottList authenticityToken(@javax.annotation.Nullable String authenticityToken) { + this.authenticityToken = authenticityToken; + return this; + } + + /** + * The authenticity token + * @return authenticityToken + */ + @javax.annotation.Nullable + public String getAuthenticityToken() { + return authenticityToken; + } + + public void setAuthenticityToken(@javax.annotation.Nullable String authenticityToken) { + this.authenticityToken = authenticityToken; + } + + + public SottList technology(@javax.annotation.Nullable Technology technology) { + this.technology = technology; + return this; + } + + /** + * Get technology + * @return technology + */ + @javax.annotation.Nullable + public Technology getTechnology() { + return technology; + } + + public void setTechnology(@javax.annotation.Nullable Technology technology) { + this.technology = technology; + } + + + public SottList createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * The date the SOTT was created + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + + public SottList dateRange(@javax.annotation.Nullable String dateRange) { + this.dateRange = dateRange; + return this; + } + + /** + * The date range for the SOTT + * @return dateRange + */ + @javax.annotation.Nullable + public String getDateRange() { + return dateRange; + } + + public void setDateRange(@javax.annotation.Nullable String dateRange) { + this.dateRange = dateRange; + } + + + public SottList isEncoded(@javax.annotation.Nullable Boolean isEncoded) { + this.isEncoded = isEncoded; + return this; + } + + /** + * Indicates if the SOTT is encoded + * @return isEncoded + */ + @javax.annotation.Nullable + public Boolean getIsEncoded() { + return isEncoded; + } + + public void setIsEncoded(@javax.annotation.Nullable Boolean isEncoded) { + this.isEncoded = isEncoded; + } + + + public SottList comment(@javax.annotation.Nullable String comment) { + this.comment = comment; + return this; + } + + /** + * Additional comments + * @return comment + */ + @javax.annotation.Nullable + public String getComment() { + return comment; + } + + public void setComment(@javax.annotation.Nullable String comment) { + this.comment = comment; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SottList instance itself + */ + public SottList putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SottList sottList = (SottList) o; + return Objects.equals(this.authenticityToken, sottList.authenticityToken) && + Objects.equals(this.technology, sottList.technology) && + Objects.equals(this.createdDate, sottList.createdDate) && + Objects.equals(this.dateRange, sottList.dateRange) && + Objects.equals(this.isEncoded, sottList.isEncoded) && + Objects.equals(this.comment, sottList.comment)&& + Objects.equals(this.additionalProperties, sottList.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(authenticityToken, technology, createdDate, dateRange, isEncoded, comment, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SottList {\n"); + sb.append(" authenticityToken: ").append(toIndentedString(authenticityToken)).append("\n"); + sb.append(" technology: ").append(toIndentedString(technology)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" dateRange: ").append(toIndentedString(dateRange)).append("\n"); + sb.append(" isEncoded: ").append(toIndentedString(isEncoded)).append("\n"); + sb.append(" comment: ").append(toIndentedString(comment)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AuthenticityToken"); + openapiFields.add("Technology"); + openapiFields.add("CreatedDate"); + openapiFields.add("DateRange"); + openapiFields.add("IsEncoded"); + openapiFields.add("Comment"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SottList + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SottList.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SottList is not found in the empty JSON string", SottList.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("AuthenticityToken") != null && !jsonObj.get("AuthenticityToken").isJsonNull()) && !jsonObj.get("AuthenticityToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AuthenticityToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AuthenticityToken").toString())); + } + // validate the optional field `Technology` + if (jsonObj.get("Technology") != null && !jsonObj.get("Technology").isJsonNull()) { + Technology.validateJsonElement(jsonObj.get("Technology")); + } + if ((jsonObj.get("DateRange") != null && !jsonObj.get("DateRange").isJsonNull()) && !jsonObj.get("DateRange").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DateRange` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DateRange").toString())); + } + if ((jsonObj.get("Comment") != null && !jsonObj.get("Comment").isJsonNull()) && !jsonObj.get("Comment").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Comment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Comment").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SottList.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SottList' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SottList> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SottList.class)); + + return (TypeAdapter<T>) new TypeAdapter<SottList>() { + @Override + public void write(JsonWriter out, SottList value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SottList read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SottList instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SottList given an JSON string + * + * @param jsonString JSON string + * @return An instance of SottList + * @throws IOException if the JSON string is invalid with respect to SottList + */ + public static SottList fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SottList.class); + } + + /** + * Convert an instance of SottList to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/SottResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/SottResponse.java new file mode 100644 index 0000000..eefcc9b --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/SottResponse.java @@ -0,0 +1,464 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.Technology; +import java.io.IOException; +import java.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * SottResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class SottResponse { + public static final String SERIALIZED_NAME_AUTHENTICITY_TOKEN = "AuthenticityToken"; + @SerializedName(SERIALIZED_NAME_AUTHENTICITY_TOKEN) + @javax.annotation.Nullable + private String authenticityToken; + + public static final String SERIALIZED_NAME_TECHNOLOGY = "Technology"; + @SerializedName(SERIALIZED_NAME_TECHNOLOGY) + @javax.annotation.Nullable + private Technology technology; + + public static final String SERIALIZED_NAME_SOTT = "Sott"; + @SerializedName(SERIALIZED_NAME_SOTT) + @javax.annotation.Nullable + private String sott; + + public static final String SERIALIZED_NAME_COMMENT = "Comment"; + @SerializedName(SERIALIZED_NAME_COMMENT) + @javax.annotation.Nullable + private String comment; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public static final String SERIALIZED_NAME_DATE_RANGE = "DateRange"; + @SerializedName(SERIALIZED_NAME_DATE_RANGE) + @javax.annotation.Nullable + private String dateRange; + + public static final String SERIALIZED_NAME_IS_ENCODED = "IsEncoded"; + @SerializedName(SERIALIZED_NAME_IS_ENCODED) + @javax.annotation.Nullable + private Boolean isEncoded; + + public SottResponse() { + } + + public SottResponse authenticityToken(@javax.annotation.Nullable String authenticityToken) { + this.authenticityToken = authenticityToken; + return this; + } + + /** + * The authenticity token + * @return authenticityToken + */ + @javax.annotation.Nullable + public String getAuthenticityToken() { + return authenticityToken; + } + + public void setAuthenticityToken(@javax.annotation.Nullable String authenticityToken) { + this.authenticityToken = authenticityToken; + } + + + public SottResponse technology(@javax.annotation.Nullable Technology technology) { + this.technology = technology; + return this; + } + + /** + * Get technology + * @return technology + */ + @javax.annotation.Nullable + public Technology getTechnology() { + return technology; + } + + public void setTechnology(@javax.annotation.Nullable Technology technology) { + this.technology = technology; + } + + + public SottResponse sott(@javax.annotation.Nullable String sott) { + this.sott = sott; + return this; + } + + /** + * The SOTT (Secure One Time Token) + * @return sott + */ + @javax.annotation.Nullable + public String getSott() { + return sott; + } + + public void setSott(@javax.annotation.Nullable String sott) { + this.sott = sott; + } + + + public SottResponse comment(@javax.annotation.Nullable String comment) { + this.comment = comment; + return this; + } + + /** + * Additional comments + * @return comment + */ + @javax.annotation.Nullable + public String getComment() { + return comment; + } + + public void setComment(@javax.annotation.Nullable String comment) { + this.comment = comment; + } + + + public SottResponse createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * The date the SOTT was created + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + + public SottResponse dateRange(@javax.annotation.Nullable String dateRange) { + this.dateRange = dateRange; + return this; + } + + /** + * The date range for the SOTT + * @return dateRange + */ + @javax.annotation.Nullable + public String getDateRange() { + return dateRange; + } + + public void setDateRange(@javax.annotation.Nullable String dateRange) { + this.dateRange = dateRange; + } + + + public SottResponse isEncoded(@javax.annotation.Nullable Boolean isEncoded) { + this.isEncoded = isEncoded; + return this; + } + + /** + * Indicates if the SOTT is encoded + * @return isEncoded + */ + @javax.annotation.Nullable + public Boolean getIsEncoded() { + return isEncoded; + } + + public void setIsEncoded(@javax.annotation.Nullable Boolean isEncoded) { + this.isEncoded = isEncoded; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the SottResponse instance itself + */ + public SottResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SottResponse sottResponse = (SottResponse) o; + return Objects.equals(this.authenticityToken, sottResponse.authenticityToken) && + Objects.equals(this.technology, sottResponse.technology) && + Objects.equals(this.sott, sottResponse.sott) && + Objects.equals(this.comment, sottResponse.comment) && + Objects.equals(this.createdDate, sottResponse.createdDate) && + Objects.equals(this.dateRange, sottResponse.dateRange) && + Objects.equals(this.isEncoded, sottResponse.isEncoded)&& + Objects.equals(this.additionalProperties, sottResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(authenticityToken, technology, sott, comment, createdDate, dateRange, isEncoded, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class SottResponse {\n"); + sb.append(" authenticityToken: ").append(toIndentedString(authenticityToken)).append("\n"); + sb.append(" technology: ").append(toIndentedString(technology)).append("\n"); + sb.append(" sott: ").append(toIndentedString(sott)).append("\n"); + sb.append(" comment: ").append(toIndentedString(comment)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" dateRange: ").append(toIndentedString(dateRange)).append("\n"); + sb.append(" isEncoded: ").append(toIndentedString(isEncoded)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AuthenticityToken"); + openapiFields.add("Technology"); + openapiFields.add("Sott"); + openapiFields.add("Comment"); + openapiFields.add("CreatedDate"); + openapiFields.add("DateRange"); + openapiFields.add("IsEncoded"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 SottResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!SottResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in SottResponse is not found in the empty JSON string", SottResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("AuthenticityToken") != null && !jsonObj.get("AuthenticityToken").isJsonNull()) && !jsonObj.get("AuthenticityToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AuthenticityToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AuthenticityToken").toString())); + } + // validate the optional field `Technology` + if (jsonObj.get("Technology") != null && !jsonObj.get("Technology").isJsonNull()) { + Technology.validateJsonElement(jsonObj.get("Technology")); + } + if ((jsonObj.get("Sott") != null && !jsonObj.get("Sott").isJsonNull()) && !jsonObj.get("Sott").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Sott` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Sott").toString())); + } + if ((jsonObj.get("Comment") != null && !jsonObj.get("Comment").isJsonNull()) && !jsonObj.get("Comment").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Comment` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Comment").toString())); + } + if ((jsonObj.get("DateRange") != null && !jsonObj.get("DateRange").isJsonNull()) && !jsonObj.get("DateRange").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DateRange` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DateRange").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!SottResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'SottResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<SottResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(SottResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<SottResponse>() { + @Override + public void write(JsonWriter out, SottResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public SottResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + SottResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of SottResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of SottResponse + * @throws IOException if the JSON string is invalid with respect to SottResponse + */ + public static SottResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, SottResponse.class); + } + + /** + * Convert an instance of SottResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/Technology.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/Technology.java new file mode 100644 index 0000000..cbc8fd6 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/Technology.java @@ -0,0 +1,86 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * The technologies provided by LR + */ +@JsonAdapter(Technology.Adapter.class) +public enum Technology { + + ANDROID("android"), + + IOS("ios"), + + PHONEGAP("phonegap"), + + IONIC("ionic"), + + XAMARIN("xamarin"), + + REACTNATIVE("reactnative"); + + private String value; + + Technology(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Technology fromValue(String value) { + for (Technology b : Technology.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<Technology> { + @Override + public void write(final JsonWriter jsonWriter, final Technology enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Technology read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return Technology.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + Technology.fromValue(value); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/TenantRole.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/TenantRole.java new file mode 100644 index 0000000..bd0fd97 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/TenantRole.java @@ -0,0 +1,514 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.Permission; +import java.io.IOException; +import java.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * TenantRole + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class TenantRole { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_DESCRIPTION = "Description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_LEVEL = "Level"; + @SerializedName(SERIALIZED_NAME_LEVEL) + @javax.annotation.Nullable + private String level; + + public static final String SERIALIZED_NAME_ORG_ID = "OrgId"; + @SerializedName(SERIALIZED_NAME_ORG_ID) + @javax.annotation.Nullable + private String orgId; + + public static final String SERIALIZED_NAME_PERMISSIONS = "Permissions"; + @SerializedName(SERIALIZED_NAME_PERMISSIONS) + @javax.annotation.Nullable + private List<Permission> permissions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public static final String SERIALIZED_NAME_MODIFIED_DATE = "ModifiedDate"; + @SerializedName(SERIALIZED_NAME_MODIFIED_DATE) + @javax.annotation.Nullable + private OffsetDateTime modifiedDate; + + public TenantRole() { + } + + public TenantRole id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Role ID + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public TenantRole name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Role Name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public TenantRole description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Role Description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public TenantRole level(@javax.annotation.Nullable String level) { + this.level = level; + return this; + } + + /** + * Role Level + * @return level + */ + @javax.annotation.Nullable + public String getLevel() { + return level; + } + + public void setLevel(@javax.annotation.Nullable String level) { + this.level = level; + } + + + public TenantRole orgId(@javax.annotation.Nullable String orgId) { + this.orgId = orgId; + return this; + } + + /** + * Organization ID + * @return orgId + */ + @javax.annotation.Nullable + public String getOrgId() { + return orgId; + } + + public void setOrgId(@javax.annotation.Nullable String orgId) { + this.orgId = orgId; + } + + + public TenantRole permissions(@javax.annotation.Nullable List<Permission> permissions) { + this.permissions = permissions; + return this; + } + + public TenantRole addPermissionsItem(Permission permissionsItem) { + if (this.permissions == null) { + this.permissions = new ArrayList<>(); + } + this.permissions.add(permissionsItem); + return this; + } + + /** + * Get permissions + * @return permissions + */ + @javax.annotation.Nullable + public List<Permission> getPermissions() { + return permissions; + } + + public void setPermissions(@javax.annotation.Nullable List<Permission> permissions) { + this.permissions = permissions; + } + + + public TenantRole createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Role Created Date + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + + public TenantRole modifiedDate(@javax.annotation.Nullable OffsetDateTime modifiedDate) { + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Role Modified Date + * @return modifiedDate + */ + @javax.annotation.Nullable + public OffsetDateTime getModifiedDate() { + return modifiedDate; + } + + public void setModifiedDate(@javax.annotation.Nullable OffsetDateTime modifiedDate) { + this.modifiedDate = modifiedDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the TenantRole instance itself + */ + public TenantRole putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TenantRole tenantRole = (TenantRole) o; + return Objects.equals(this.id, tenantRole.id) && + Objects.equals(this.name, tenantRole.name) && + Objects.equals(this.description, tenantRole.description) && + Objects.equals(this.level, tenantRole.level) && + Objects.equals(this.orgId, tenantRole.orgId) && + Objects.equals(this.permissions, tenantRole.permissions) && + Objects.equals(this.createdDate, tenantRole.createdDate) && + Objects.equals(this.modifiedDate, tenantRole.modifiedDate)&& + Objects.equals(this.additionalProperties, tenantRole.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, description, level, orgId, permissions, createdDate, modifiedDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TenantRole {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" level: ").append(toIndentedString(level)).append("\n"); + sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n"); + sb.append(" permissions: ").append(toIndentedString(permissions)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" modifiedDate: ").append(toIndentedString(modifiedDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("Description"); + openapiFields.add("Level"); + openapiFields.add("OrgId"); + openapiFields.add("Permissions"); + openapiFields.add("CreatedDate"); + openapiFields.add("ModifiedDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 TenantRole + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TenantRole.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TenantRole is not found in the empty JSON string", TenantRole.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Description") != null && !jsonObj.get("Description").isJsonNull()) && !jsonObj.get("Description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Description").toString())); + } + if ((jsonObj.get("Level") != null && !jsonObj.get("Level").isJsonNull()) && !jsonObj.get("Level").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Level` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Level").toString())); + } + if ((jsonObj.get("OrgId") != null && !jsonObj.get("OrgId").isJsonNull()) && !jsonObj.get("OrgId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `OrgId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("OrgId").toString())); + } + if (jsonObj.get("Permissions") != null && !jsonObj.get("Permissions").isJsonNull()) { + JsonArray jsonArraypermissions = jsonObj.getAsJsonArray("Permissions"); + if (jsonArraypermissions != null) { + // ensure the json data is an array + if (!jsonObj.get("Permissions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Permissions` to be an array in the JSON string but got `%s`", jsonObj.get("Permissions").toString())); + } + + // validate the optional field `Permissions` (array) + for (int i = 0; i < jsonArraypermissions.size(); i++) { + Permission.validateJsonElement(jsonArraypermissions.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!TenantRole.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TenantRole' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<TenantRole> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TenantRole.class)); + + return (TypeAdapter<T>) new TypeAdapter<TenantRole>() { + @Override + public void write(JsonWriter out, TenantRole value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public TenantRole read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + TenantRole instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TenantRole given an JSON string + * + * @param jsonString JSON string + * @return An instance of TenantRole + * @throws IOException if the JSON string is invalid with respect to TenantRole + */ + public static TenantRole fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TenantRole.class); + } + + /** + * Convert an instance of TenantRole to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/TwoFAAuthByBackupCode.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/TwoFAAuthByBackupCode.java new file mode 100644 index 0000000..83ff1e7 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/TwoFAAuthByBackupCode.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * TwoFAAuthByBackupCode + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class TwoFAAuthByBackupCode { + public static final String SERIALIZED_NAME_BACKUPCODE = "backupcode"; + @SerializedName(SERIALIZED_NAME_BACKUPCODE) + @javax.annotation.Nonnull + private String backupcode; + + public TwoFAAuthByBackupCode() { + } + + public TwoFAAuthByBackupCode backupcode(@javax.annotation.Nonnull String backupcode) { + this.backupcode = backupcode; + return this; + } + + /** + * The backup code to verify MFA + * @return backupcode + */ + @javax.annotation.Nonnull + public String getBackupcode() { + return backupcode; + } + + public void setBackupcode(@javax.annotation.Nonnull String backupcode) { + this.backupcode = backupcode; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the TwoFAAuthByBackupCode instance itself + */ + public TwoFAAuthByBackupCode putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TwoFAAuthByBackupCode twoFAAuthByBackupCode = (TwoFAAuthByBackupCode) o; + return Objects.equals(this.backupcode, twoFAAuthByBackupCode.backupcode)&& + Objects.equals(this.additionalProperties, twoFAAuthByBackupCode.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(backupcode, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TwoFAAuthByBackupCode {\n"); + sb.append(" backupcode: ").append(toIndentedString(backupcode)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("backupcode"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("backupcode"); + } + + /** + * 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 TwoFAAuthByBackupCode + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TwoFAAuthByBackupCode.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TwoFAAuthByBackupCode is not found in the empty JSON string", TwoFAAuthByBackupCode.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TwoFAAuthByBackupCode.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("backupcode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `backupcode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("backupcode").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!TwoFAAuthByBackupCode.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TwoFAAuthByBackupCode' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<TwoFAAuthByBackupCode> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TwoFAAuthByBackupCode.class)); + + return (TypeAdapter<T>) new TypeAdapter<TwoFAAuthByBackupCode>() { + @Override + public void write(JsonWriter out, TwoFAAuthByBackupCode value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public TwoFAAuthByBackupCode read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + TwoFAAuthByBackupCode instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TwoFAAuthByBackupCode given an JSON string + * + * @param jsonString JSON string + * @return An instance of TwoFAAuthByBackupCode + * @throws IOException if the JSON string is invalid with respect to TwoFAAuthByBackupCode + */ + public static TwoFAAuthByBackupCode fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TwoFAAuthByBackupCode.class); + } + + /** + * Convert an instance of TwoFAAuthByBackupCode to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/TwoFAAuthBySecQuesAuthModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/TwoFAAuthBySecQuesAuthModel.java new file mode 100644 index 0000000..e747af5 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/TwoFAAuthBySecQuesAuthModel.java @@ -0,0 +1,313 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * TwoFAAuthBySecQuesAuthModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class TwoFAAuthBySecQuesAuthModel { + public static final String SERIALIZED_NAME_SECURITYQUESTIONANSWER = "securityquestionanswer"; + @SerializedName(SERIALIZED_NAME_SECURITYQUESTIONANSWER) + @javax.annotation.Nonnull + private List<TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner> securityquestionanswer = new ArrayList<>(); + + public TwoFAAuthBySecQuesAuthModel() { + } + + public TwoFAAuthBySecQuesAuthModel securityquestionanswer(@javax.annotation.Nonnull List<TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner> securityquestionanswer) { + this.securityquestionanswer = securityquestionanswer; + return this; + } + + public TwoFAAuthBySecQuesAuthModel addSecurityquestionanswerItem(TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner securityquestionanswerItem) { + if (this.securityquestionanswer == null) { + this.securityquestionanswer = new ArrayList<>(); + } + this.securityquestionanswer.add(securityquestionanswerItem); + return this; + } + + /** + * List of security question answers (required, not blank) + * @return securityquestionanswer + */ + @javax.annotation.Nonnull + public List<TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner> getSecurityquestionanswer() { + return securityquestionanswer; + } + + public void setSecurityquestionanswer(@javax.annotation.Nonnull List<TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner> securityquestionanswer) { + this.securityquestionanswer = securityquestionanswer; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the TwoFAAuthBySecQuesAuthModel instance itself + */ + public TwoFAAuthBySecQuesAuthModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TwoFAAuthBySecQuesAuthModel twoFAAuthBySecQuesAuthModel = (TwoFAAuthBySecQuesAuthModel) o; + return Objects.equals(this.securityquestionanswer, twoFAAuthBySecQuesAuthModel.securityquestionanswer)&& + Objects.equals(this.additionalProperties, twoFAAuthBySecQuesAuthModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(securityquestionanswer, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TwoFAAuthBySecQuesAuthModel {\n"); + sb.append(" securityquestionanswer: ").append(toIndentedString(securityquestionanswer)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("securityquestionanswer"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("securityquestionanswer"); + } + + /** + * 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 TwoFAAuthBySecQuesAuthModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TwoFAAuthBySecQuesAuthModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TwoFAAuthBySecQuesAuthModel is not found in the empty JSON string", TwoFAAuthBySecQuesAuthModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TwoFAAuthBySecQuesAuthModel.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("securityquestionanswer").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `securityquestionanswer` to be an array in the JSON string but got `%s`", jsonObj.get("securityquestionanswer").toString())); + } + + JsonArray jsonArraysecurityquestionanswer = jsonObj.getAsJsonArray("securityquestionanswer"); + // validate the required field `securityquestionanswer` (array) + for (int i = 0; i < jsonArraysecurityquestionanswer.size(); i++) { + TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner.validateJsonElement(jsonArraysecurityquestionanswer.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!TwoFAAuthBySecQuesAuthModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TwoFAAuthBySecQuesAuthModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<TwoFAAuthBySecQuesAuthModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TwoFAAuthBySecQuesAuthModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<TwoFAAuthBySecQuesAuthModel>() { + @Override + public void write(JsonWriter out, TwoFAAuthBySecQuesAuthModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public TwoFAAuthBySecQuesAuthModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + TwoFAAuthBySecQuesAuthModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TwoFAAuthBySecQuesAuthModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of TwoFAAuthBySecQuesAuthModel + * @throws IOException if the JSON string is invalid with respect to TwoFAAuthBySecQuesAuthModel + */ + public static TwoFAAuthBySecQuesAuthModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TwoFAAuthBySecQuesAuthModel.class); + } + + /** + * Convert an instance of TwoFAAuthBySecQuesAuthModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner.java new file mode 100644 index 0000000..99f506a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner.java @@ -0,0 +1,326 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner { + public static final String SERIALIZED_NAME_QUESTION_ID = "QuestionId"; + @SerializedName(SERIALIZED_NAME_QUESTION_ID) + @javax.annotation.Nonnull + private String questionId; + + public static final String SERIALIZED_NAME_ANSWER = "Answer"; + @SerializedName(SERIALIZED_NAME_ANSWER) + @javax.annotation.Nonnull + private String answer; + + public TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner() { + } + + public TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner questionId(@javax.annotation.Nonnull String questionId) { + this.questionId = questionId; + return this; + } + + /** + * ID of the security question (required, not blank) + * @return questionId + */ + @javax.annotation.Nonnull + public String getQuestionId() { + return questionId; + } + + public void setQuestionId(@javax.annotation.Nonnull String questionId) { + this.questionId = questionId; + } + + + public TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner answer(@javax.annotation.Nonnull String answer) { + this.answer = answer; + return this; + } + + /** + * Answer to the security question (required, not blank) + * @return answer + */ + @javax.annotation.Nonnull + public String getAnswer() { + return answer; + } + + public void setAnswer(@javax.annotation.Nonnull String answer) { + this.answer = answer; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner instance itself + */ + public TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner twoFAAuthBySecQuesAuthModelSecurityquestionanswerInner = (TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner) o; + return Objects.equals(this.questionId, twoFAAuthBySecQuesAuthModelSecurityquestionanswerInner.questionId) && + Objects.equals(this.answer, twoFAAuthBySecQuesAuthModelSecurityquestionanswerInner.answer)&& + Objects.equals(this.additionalProperties, twoFAAuthBySecQuesAuthModelSecurityquestionanswerInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(questionId, answer, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner {\n"); + sb.append(" questionId: ").append(toIndentedString(questionId)).append("\n"); + sb.append(" answer: ").append(toIndentedString(answer)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("QuestionId"); + openapiFields.add("Answer"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("QuestionId"); + openapiRequiredFields.add("Answer"); + } + + /** + * 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 TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner is not found in the empty JSON string", TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner.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("QuestionId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `QuestionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("QuestionId").toString())); + } + if (!jsonObj.get("Answer").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Answer` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Answer").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner>() { + @Override + public void write(JsonWriter out, TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner + * @throws IOException if the JSON string is invalid with respect to TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner + */ + public static TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner.class); + } + + /** + * Convert an instance of TwoFAAuthBySecQuesAuthModelSecurityquestionanswerInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/TwoFactorAuthenticationSettings.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/TwoFactorAuthenticationSettings.java new file mode 100644 index 0000000..857369e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/TwoFactorAuthenticationSettings.java @@ -0,0 +1,790 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.EmailOTPStatus; +import com.loginradius.sdk.internal.openapi.model.SMSResponseData; +import com.loginradius.sdk.internal.openapi.model.SecurityQuestions; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * This holds the second factor authentication settings excluding SecondFactorAuthentication token + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class TwoFactorAuthenticationSettings { + public static final String SERIALIZED_NAME_QR_CODE = "QRCode"; + @SerializedName(SERIALIZED_NAME_QR_CODE) + @javax.annotation.Nullable + private String qrCode; + + public static final String SERIALIZED_NAME_PUSH_Q_R_CODE = "PushQRCode"; + @SerializedName(SERIALIZED_NAME_PUSH_Q_R_CODE) + @javax.annotation.Nullable + private String pushQRCode; + + public static final String SERIALIZED_NAME_MANUAL_ENTRY_CODE = "ManualEntryCode"; + @SerializedName(SERIALIZED_NAME_MANUAL_ENTRY_CODE) + @javax.annotation.Nullable + private String manualEntryCode; + + public static final String SERIALIZED_NAME_DUO_AUTH_ENDPOINT = "DuoAuthEndpoint"; + @SerializedName(SERIALIZED_NAME_DUO_AUTH_ENDPOINT) + @javax.annotation.Nullable + private String duoAuthEndpoint; + + public static final String SERIALIZED_NAME_IS_GOOGLE_AUTHENTICATOR_VERIFIED = "IsGoogleAuthenticatorVerified"; + @SerializedName(SERIALIZED_NAME_IS_GOOGLE_AUTHENTICATOR_VERIFIED) + @javax.annotation.Nullable + private Boolean isGoogleAuthenticatorVerified; + + public static final String SERIALIZED_NAME_IS_PUSH_DEVICE_REGISTERED = "IsPushDeviceRegistered"; + @SerializedName(SERIALIZED_NAME_IS_PUSH_DEVICE_REGISTERED) + @javax.annotation.Nullable + private Boolean isPushDeviceRegistered; + + public static final String SERIALIZED_NAME_IS_AUTHENTICATOR_VERIFIED = "IsAuthenticatorVerified"; + @SerializedName(SERIALIZED_NAME_IS_AUTHENTICATOR_VERIFIED) + @javax.annotation.Nullable + private Boolean isAuthenticatorVerified; + + public static final String SERIALIZED_NAME_IS_EMAIL_OTP_AUTHENTICATOR_VERIFIED = "IsEmailOtpAuthenticatorVerified"; + @SerializedName(SERIALIZED_NAME_IS_EMAIL_OTP_AUTHENTICATOR_VERIFIED) + @javax.annotation.Nullable + private Boolean isEmailOtpAuthenticatorVerified; + + public static final String SERIALIZED_NAME_IS_O_T_P_AUTHENTICATOR_VERIFIED = "IsOTPAuthenticatorVerified"; + @SerializedName(SERIALIZED_NAME_IS_O_T_P_AUTHENTICATOR_VERIFIED) + @javax.annotation.Nullable + private Boolean isOTPAuthenticatorVerified; + + public static final String SERIALIZED_NAME_IS_DUO_AUTHENTICATOR_VERIFIED = "IsDuoAuthenticatorVerified"; + @SerializedName(SERIALIZED_NAME_IS_DUO_AUTHENTICATOR_VERIFIED) + @javax.annotation.Nullable + private Boolean isDuoAuthenticatorVerified; + + public static final String SERIALIZED_NAME_IS_PASSKEY_AUTHENTICATOR_VERIFIED = "IsPasskeyAuthenticatorVerified"; + @SerializedName(SERIALIZED_NAME_IS_PASSKEY_AUTHENTICATOR_VERIFIED) + @javax.annotation.Nullable + private Boolean isPasskeyAuthenticatorVerified; + + public static final String SERIALIZED_NAME_OT_P_PHONE_NO = "OTPPhoneNo"; + @SerializedName(SERIALIZED_NAME_OT_P_PHONE_NO) + @javax.annotation.Nullable + private String otPPhoneNo; + + public static final String SERIALIZED_NAME_OT_P_STATUS = "OTPStatus"; + @SerializedName(SERIALIZED_NAME_OT_P_STATUS) + @javax.annotation.Nullable + private SMSResponseData otPStatus; + + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private List<String> email = new ArrayList<>(); + + public static final String SERIALIZED_NAME_EMAIL_O_T_P_STATUS = "EmailOTPStatus"; + @SerializedName(SERIALIZED_NAME_EMAIL_O_T_P_STATUS) + @javax.annotation.Nullable + private EmailOTPStatus emailOTPStatus; + + public static final String SERIALIZED_NAME_IS_SECURITY_QUESTION_AUTHENTICATOR_VERIFIED = "IsSecurityQuestionAuthenticatorVerified"; + @SerializedName(SERIALIZED_NAME_IS_SECURITY_QUESTION_AUTHENTICATOR_VERIFIED) + @javax.annotation.Nullable + private Boolean isSecurityQuestionAuthenticatorVerified; + + public static final String SERIALIZED_NAME_SECURITY_QUESTIONS = "SecurityQuestions"; + @SerializedName(SERIALIZED_NAME_SECURITY_QUESTIONS) + @javax.annotation.Nullable + private List<SecurityQuestions> securityQuestions = new ArrayList<>(); + + public TwoFactorAuthenticationSettings() { + } + + public TwoFactorAuthenticationSettings qrCode(@javax.annotation.Nullable String qrCode) { + this.qrCode = qrCode; + return this; + } + + /** + * Get qrCode + * @return qrCode + */ + @javax.annotation.Nullable + public String getQrCode() { + return qrCode; + } + + public void setQrCode(@javax.annotation.Nullable String qrCode) { + this.qrCode = qrCode; + } + + + public TwoFactorAuthenticationSettings pushQRCode(@javax.annotation.Nullable String pushQRCode) { + this.pushQRCode = pushQRCode; + return this; + } + + /** + * Get pushQRCode + * @return pushQRCode + */ + @javax.annotation.Nullable + public String getPushQRCode() { + return pushQRCode; + } + + public void setPushQRCode(@javax.annotation.Nullable String pushQRCode) { + this.pushQRCode = pushQRCode; + } + + + public TwoFactorAuthenticationSettings manualEntryCode(@javax.annotation.Nullable String manualEntryCode) { + this.manualEntryCode = manualEntryCode; + return this; + } + + /** + * Get manualEntryCode + * @return manualEntryCode + */ + @javax.annotation.Nullable + public String getManualEntryCode() { + return manualEntryCode; + } + + public void setManualEntryCode(@javax.annotation.Nullable String manualEntryCode) { + this.manualEntryCode = manualEntryCode; + } + + + public TwoFactorAuthenticationSettings duoAuthEndpoint(@javax.annotation.Nullable String duoAuthEndpoint) { + this.duoAuthEndpoint = duoAuthEndpoint; + return this; + } + + /** + * Get duoAuthEndpoint + * @return duoAuthEndpoint + */ + @javax.annotation.Nullable + public String getDuoAuthEndpoint() { + return duoAuthEndpoint; + } + + public void setDuoAuthEndpoint(@javax.annotation.Nullable String duoAuthEndpoint) { + this.duoAuthEndpoint = duoAuthEndpoint; + } + + + public TwoFactorAuthenticationSettings isGoogleAuthenticatorVerified(@javax.annotation.Nullable Boolean isGoogleAuthenticatorVerified) { + this.isGoogleAuthenticatorVerified = isGoogleAuthenticatorVerified; + return this; + } + + /** + * Get isGoogleAuthenticatorVerified + * @return isGoogleAuthenticatorVerified + */ + @javax.annotation.Nullable + public Boolean getIsGoogleAuthenticatorVerified() { + return isGoogleAuthenticatorVerified; + } + + public void setIsGoogleAuthenticatorVerified(@javax.annotation.Nullable Boolean isGoogleAuthenticatorVerified) { + this.isGoogleAuthenticatorVerified = isGoogleAuthenticatorVerified; + } + + + public TwoFactorAuthenticationSettings isPushDeviceRegistered(@javax.annotation.Nullable Boolean isPushDeviceRegistered) { + this.isPushDeviceRegistered = isPushDeviceRegistered; + return this; + } + + /** + * Get isPushDeviceRegistered + * @return isPushDeviceRegistered + */ + @javax.annotation.Nullable + public Boolean getIsPushDeviceRegistered() { + return isPushDeviceRegistered; + } + + public void setIsPushDeviceRegistered(@javax.annotation.Nullable Boolean isPushDeviceRegistered) { + this.isPushDeviceRegistered = isPushDeviceRegistered; + } + + + public TwoFactorAuthenticationSettings isAuthenticatorVerified(@javax.annotation.Nullable Boolean isAuthenticatorVerified) { + this.isAuthenticatorVerified = isAuthenticatorVerified; + return this; + } + + /** + * Get isAuthenticatorVerified + * @return isAuthenticatorVerified + */ + @javax.annotation.Nullable + public Boolean getIsAuthenticatorVerified() { + return isAuthenticatorVerified; + } + + public void setIsAuthenticatorVerified(@javax.annotation.Nullable Boolean isAuthenticatorVerified) { + this.isAuthenticatorVerified = isAuthenticatorVerified; + } + + + public TwoFactorAuthenticationSettings isEmailOtpAuthenticatorVerified(@javax.annotation.Nullable Boolean isEmailOtpAuthenticatorVerified) { + this.isEmailOtpAuthenticatorVerified = isEmailOtpAuthenticatorVerified; + return this; + } + + /** + * Get isEmailOtpAuthenticatorVerified + * @return isEmailOtpAuthenticatorVerified + */ + @javax.annotation.Nullable + public Boolean getIsEmailOtpAuthenticatorVerified() { + return isEmailOtpAuthenticatorVerified; + } + + public void setIsEmailOtpAuthenticatorVerified(@javax.annotation.Nullable Boolean isEmailOtpAuthenticatorVerified) { + this.isEmailOtpAuthenticatorVerified = isEmailOtpAuthenticatorVerified; + } + + + public TwoFactorAuthenticationSettings isOTPAuthenticatorVerified(@javax.annotation.Nullable Boolean isOTPAuthenticatorVerified) { + this.isOTPAuthenticatorVerified = isOTPAuthenticatorVerified; + return this; + } + + /** + * Get isOTPAuthenticatorVerified + * @return isOTPAuthenticatorVerified + */ + @javax.annotation.Nullable + public Boolean getIsOTPAuthenticatorVerified() { + return isOTPAuthenticatorVerified; + } + + public void setIsOTPAuthenticatorVerified(@javax.annotation.Nullable Boolean isOTPAuthenticatorVerified) { + this.isOTPAuthenticatorVerified = isOTPAuthenticatorVerified; + } + + + public TwoFactorAuthenticationSettings isDuoAuthenticatorVerified(@javax.annotation.Nullable Boolean isDuoAuthenticatorVerified) { + this.isDuoAuthenticatorVerified = isDuoAuthenticatorVerified; + return this; + } + + /** + * Get isDuoAuthenticatorVerified + * @return isDuoAuthenticatorVerified + */ + @javax.annotation.Nullable + public Boolean getIsDuoAuthenticatorVerified() { + return isDuoAuthenticatorVerified; + } + + public void setIsDuoAuthenticatorVerified(@javax.annotation.Nullable Boolean isDuoAuthenticatorVerified) { + this.isDuoAuthenticatorVerified = isDuoAuthenticatorVerified; + } + + + public TwoFactorAuthenticationSettings isPasskeyAuthenticatorVerified(@javax.annotation.Nullable Boolean isPasskeyAuthenticatorVerified) { + this.isPasskeyAuthenticatorVerified = isPasskeyAuthenticatorVerified; + return this; + } + + /** + * Get isPasskeyAuthenticatorVerified + * @return isPasskeyAuthenticatorVerified + */ + @javax.annotation.Nullable + public Boolean getIsPasskeyAuthenticatorVerified() { + return isPasskeyAuthenticatorVerified; + } + + public void setIsPasskeyAuthenticatorVerified(@javax.annotation.Nullable Boolean isPasskeyAuthenticatorVerified) { + this.isPasskeyAuthenticatorVerified = isPasskeyAuthenticatorVerified; + } + + + public TwoFactorAuthenticationSettings otPPhoneNo(@javax.annotation.Nullable String otPPhoneNo) { + this.otPPhoneNo = otPPhoneNo; + return this; + } + + /** + * Get otPPhoneNo + * @return otPPhoneNo + */ + @javax.annotation.Nullable + public String getOtPPhoneNo() { + return otPPhoneNo; + } + + public void setOtPPhoneNo(@javax.annotation.Nullable String otPPhoneNo) { + this.otPPhoneNo = otPPhoneNo; + } + + + public TwoFactorAuthenticationSettings otPStatus(@javax.annotation.Nullable SMSResponseData otPStatus) { + this.otPStatus = otPStatus; + return this; + } + + /** + * Get otPStatus + * @return otPStatus + */ + @javax.annotation.Nullable + public SMSResponseData getOtPStatus() { + return otPStatus; + } + + public void setOtPStatus(@javax.annotation.Nullable SMSResponseData otPStatus) { + this.otPStatus = otPStatus; + } + + + public TwoFactorAuthenticationSettings email(@javax.annotation.Nullable List<String> email) { + this.email = email; + return this; + } + + public TwoFactorAuthenticationSettings addEmailItem(String emailItem) { + if (this.email == null) { + this.email = new ArrayList<>(); + } + this.email.add(emailItem); + return this; + } + + /** + * Get email + * @return email + */ + @javax.annotation.Nullable + public List<String> getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable List<String> email) { + this.email = email; + } + + + public TwoFactorAuthenticationSettings emailOTPStatus(@javax.annotation.Nullable EmailOTPStatus emailOTPStatus) { + this.emailOTPStatus = emailOTPStatus; + return this; + } + + /** + * Get emailOTPStatus + * @return emailOTPStatus + */ + @javax.annotation.Nullable + public EmailOTPStatus getEmailOTPStatus() { + return emailOTPStatus; + } + + public void setEmailOTPStatus(@javax.annotation.Nullable EmailOTPStatus emailOTPStatus) { + this.emailOTPStatus = emailOTPStatus; + } + + + public TwoFactorAuthenticationSettings isSecurityQuestionAuthenticatorVerified(@javax.annotation.Nullable Boolean isSecurityQuestionAuthenticatorVerified) { + this.isSecurityQuestionAuthenticatorVerified = isSecurityQuestionAuthenticatorVerified; + return this; + } + + /** + * Get isSecurityQuestionAuthenticatorVerified + * @return isSecurityQuestionAuthenticatorVerified + */ + @javax.annotation.Nullable + public Boolean getIsSecurityQuestionAuthenticatorVerified() { + return isSecurityQuestionAuthenticatorVerified; + } + + public void setIsSecurityQuestionAuthenticatorVerified(@javax.annotation.Nullable Boolean isSecurityQuestionAuthenticatorVerified) { + this.isSecurityQuestionAuthenticatorVerified = isSecurityQuestionAuthenticatorVerified; + } + + + public TwoFactorAuthenticationSettings securityQuestions(@javax.annotation.Nullable List<SecurityQuestions> securityQuestions) { + this.securityQuestions = securityQuestions; + return this; + } + + public TwoFactorAuthenticationSettings addSecurityQuestionsItem(SecurityQuestions securityQuestionsItem) { + if (this.securityQuestions == null) { + this.securityQuestions = new ArrayList<>(); + } + this.securityQuestions.add(securityQuestionsItem); + return this; + } + + /** + * Get securityQuestions + * @return securityQuestions + */ + @javax.annotation.Nullable + public List<SecurityQuestions> getSecurityQuestions() { + return securityQuestions; + } + + public void setSecurityQuestions(@javax.annotation.Nullable List<SecurityQuestions> securityQuestions) { + this.securityQuestions = securityQuestions; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the TwoFactorAuthenticationSettings instance itself + */ + public TwoFactorAuthenticationSettings putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TwoFactorAuthenticationSettings twoFactorAuthenticationSettings = (TwoFactorAuthenticationSettings) o; + return Objects.equals(this.qrCode, twoFactorAuthenticationSettings.qrCode) && + Objects.equals(this.pushQRCode, twoFactorAuthenticationSettings.pushQRCode) && + Objects.equals(this.manualEntryCode, twoFactorAuthenticationSettings.manualEntryCode) && + Objects.equals(this.duoAuthEndpoint, twoFactorAuthenticationSettings.duoAuthEndpoint) && + Objects.equals(this.isGoogleAuthenticatorVerified, twoFactorAuthenticationSettings.isGoogleAuthenticatorVerified) && + Objects.equals(this.isPushDeviceRegistered, twoFactorAuthenticationSettings.isPushDeviceRegistered) && + Objects.equals(this.isAuthenticatorVerified, twoFactorAuthenticationSettings.isAuthenticatorVerified) && + Objects.equals(this.isEmailOtpAuthenticatorVerified, twoFactorAuthenticationSettings.isEmailOtpAuthenticatorVerified) && + Objects.equals(this.isOTPAuthenticatorVerified, twoFactorAuthenticationSettings.isOTPAuthenticatorVerified) && + Objects.equals(this.isDuoAuthenticatorVerified, twoFactorAuthenticationSettings.isDuoAuthenticatorVerified) && + Objects.equals(this.isPasskeyAuthenticatorVerified, twoFactorAuthenticationSettings.isPasskeyAuthenticatorVerified) && + Objects.equals(this.otPPhoneNo, twoFactorAuthenticationSettings.otPPhoneNo) && + Objects.equals(this.otPStatus, twoFactorAuthenticationSettings.otPStatus) && + Objects.equals(this.email, twoFactorAuthenticationSettings.email) && + Objects.equals(this.emailOTPStatus, twoFactorAuthenticationSettings.emailOTPStatus) && + Objects.equals(this.isSecurityQuestionAuthenticatorVerified, twoFactorAuthenticationSettings.isSecurityQuestionAuthenticatorVerified) && + Objects.equals(this.securityQuestions, twoFactorAuthenticationSettings.securityQuestions)&& + Objects.equals(this.additionalProperties, twoFactorAuthenticationSettings.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(qrCode, pushQRCode, manualEntryCode, duoAuthEndpoint, isGoogleAuthenticatorVerified, isPushDeviceRegistered, isAuthenticatorVerified, isEmailOtpAuthenticatorVerified, isOTPAuthenticatorVerified, isDuoAuthenticatorVerified, isPasskeyAuthenticatorVerified, otPPhoneNo, otPStatus, email, emailOTPStatus, isSecurityQuestionAuthenticatorVerified, securityQuestions, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TwoFactorAuthenticationSettings {\n"); + sb.append(" qrCode: ").append(toIndentedString(qrCode)).append("\n"); + sb.append(" pushQRCode: ").append(toIndentedString(pushQRCode)).append("\n"); + sb.append(" manualEntryCode: ").append(toIndentedString(manualEntryCode)).append("\n"); + sb.append(" duoAuthEndpoint: ").append(toIndentedString(duoAuthEndpoint)).append("\n"); + sb.append(" isGoogleAuthenticatorVerified: ").append(toIndentedString(isGoogleAuthenticatorVerified)).append("\n"); + sb.append(" isPushDeviceRegistered: ").append(toIndentedString(isPushDeviceRegistered)).append("\n"); + sb.append(" isAuthenticatorVerified: ").append(toIndentedString(isAuthenticatorVerified)).append("\n"); + sb.append(" isEmailOtpAuthenticatorVerified: ").append(toIndentedString(isEmailOtpAuthenticatorVerified)).append("\n"); + sb.append(" isOTPAuthenticatorVerified: ").append(toIndentedString(isOTPAuthenticatorVerified)).append("\n"); + sb.append(" isDuoAuthenticatorVerified: ").append(toIndentedString(isDuoAuthenticatorVerified)).append("\n"); + sb.append(" isPasskeyAuthenticatorVerified: ").append(toIndentedString(isPasskeyAuthenticatorVerified)).append("\n"); + sb.append(" otPPhoneNo: ").append(toIndentedString(otPPhoneNo)).append("\n"); + sb.append(" otPStatus: ").append(toIndentedString(otPStatus)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" emailOTPStatus: ").append(toIndentedString(emailOTPStatus)).append("\n"); + sb.append(" isSecurityQuestionAuthenticatorVerified: ").append(toIndentedString(isSecurityQuestionAuthenticatorVerified)).append("\n"); + sb.append(" securityQuestions: ").append(toIndentedString(securityQuestions)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("QRCode"); + openapiFields.add("PushQRCode"); + openapiFields.add("ManualEntryCode"); + openapiFields.add("DuoAuthEndpoint"); + openapiFields.add("IsGoogleAuthenticatorVerified"); + openapiFields.add("IsPushDeviceRegistered"); + openapiFields.add("IsAuthenticatorVerified"); + openapiFields.add("IsEmailOtpAuthenticatorVerified"); + openapiFields.add("IsOTPAuthenticatorVerified"); + openapiFields.add("IsDuoAuthenticatorVerified"); + openapiFields.add("IsPasskeyAuthenticatorVerified"); + openapiFields.add("OTPPhoneNo"); + openapiFields.add("OTPStatus"); + openapiFields.add("Email"); + openapiFields.add("EmailOTPStatus"); + openapiFields.add("IsSecurityQuestionAuthenticatorVerified"); + openapiFields.add("SecurityQuestions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 TwoFactorAuthenticationSettings + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TwoFactorAuthenticationSettings.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TwoFactorAuthenticationSettings is not found in the empty JSON string", TwoFactorAuthenticationSettings.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("QRCode") != null && !jsonObj.get("QRCode").isJsonNull()) && !jsonObj.get("QRCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `QRCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("QRCode").toString())); + } + if ((jsonObj.get("PushQRCode") != null && !jsonObj.get("PushQRCode").isJsonNull()) && !jsonObj.get("PushQRCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PushQRCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PushQRCode").toString())); + } + if ((jsonObj.get("ManualEntryCode") != null && !jsonObj.get("ManualEntryCode").isJsonNull()) && !jsonObj.get("ManualEntryCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ManualEntryCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ManualEntryCode").toString())); + } + if ((jsonObj.get("DuoAuthEndpoint") != null && !jsonObj.get("DuoAuthEndpoint").isJsonNull()) && !jsonObj.get("DuoAuthEndpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DuoAuthEndpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DuoAuthEndpoint").toString())); + } + if ((jsonObj.get("OTPPhoneNo") != null && !jsonObj.get("OTPPhoneNo").isJsonNull()) && !jsonObj.get("OTPPhoneNo").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `OTPPhoneNo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("OTPPhoneNo").toString())); + } + // validate the optional field `OTPStatus` + if (jsonObj.get("OTPStatus") != null && !jsonObj.get("OTPStatus").isJsonNull()) { + SMSResponseData.validateJsonElement(jsonObj.get("OTPStatus")); + } + // ensure the optional json data is an array if present + if (jsonObj.get("Email") != null && !jsonObj.get("Email").isJsonNull() && !jsonObj.get("Email").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Email` to be an array in the JSON string but got `%s`", jsonObj.get("Email").toString())); + } + // validate the optional field `EmailOTPStatus` + if (jsonObj.get("EmailOTPStatus") != null && !jsonObj.get("EmailOTPStatus").isJsonNull()) { + EmailOTPStatus.validateJsonElement(jsonObj.get("EmailOTPStatus")); + } + if (jsonObj.get("SecurityQuestions") != null && !jsonObj.get("SecurityQuestions").isJsonNull()) { + JsonArray jsonArraysecurityQuestions = jsonObj.getAsJsonArray("SecurityQuestions"); + if (jsonArraysecurityQuestions != null) { + // ensure the json data is an array + if (!jsonObj.get("SecurityQuestions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `SecurityQuestions` to be an array in the JSON string but got `%s`", jsonObj.get("SecurityQuestions").toString())); + } + + // validate the optional field `SecurityQuestions` (array) + for (int i = 0; i < jsonArraysecurityQuestions.size(); i++) { + SecurityQuestions.validateJsonElement(jsonArraysecurityQuestions.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!TwoFactorAuthenticationSettings.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TwoFactorAuthenticationSettings' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<TwoFactorAuthenticationSettings> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TwoFactorAuthenticationSettings.class)); + + return (TypeAdapter<T>) new TypeAdapter<TwoFactorAuthenticationSettings>() { + @Override + public void write(JsonWriter out, TwoFactorAuthenticationSettings value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public TwoFactorAuthenticationSettings read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + TwoFactorAuthenticationSettings instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TwoFactorAuthenticationSettings given an JSON string + * + * @param jsonString JSON string + * @return An instance of TwoFactorAuthenticationSettings + * @throws IOException if the JSON string is invalid with respect to TwoFactorAuthenticationSettings + */ + public static TwoFactorAuthenticationSettings fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TwoFactorAuthenticationSettings.class); + } + + /** + * Convert an instance of TwoFactorAuthenticationSettings to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/TwoFactorAuthenticationTokenObject.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/TwoFactorAuthenticationTokenObject.java new file mode 100644 index 0000000..3a6fef8 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/TwoFactorAuthenticationTokenObject.java @@ -0,0 +1,848 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.EmailOTPStatus; +import com.loginradius.sdk.internal.openapi.model.SMSResponseData; +import com.loginradius.sdk.internal.openapi.model.SecurityQuestions; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * This holds the second factor authentication settings including SecondFactorAuthentication token + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class TwoFactorAuthenticationTokenObject { + public static final String SERIALIZED_NAME_SECOND_FACTOR_AUTHENTICATION_TOKEN = "SecondFactorAuthenticationToken"; + @SerializedName(SERIALIZED_NAME_SECOND_FACTOR_AUTHENTICATION_TOKEN) + @javax.annotation.Nullable + private String secondFactorAuthenticationToken; + + public static final String SERIALIZED_NAME_EXPIRE_IN = "ExpireIn"; + @SerializedName(SERIALIZED_NAME_EXPIRE_IN) + @javax.annotation.Nullable + private OffsetDateTime expireIn; + + public static final String SERIALIZED_NAME_QR_CODE = "QRCode"; + @SerializedName(SERIALIZED_NAME_QR_CODE) + @javax.annotation.Nullable + private String qrCode; + + public static final String SERIALIZED_NAME_PUSH_Q_R_CODE = "PushQRCode"; + @SerializedName(SERIALIZED_NAME_PUSH_Q_R_CODE) + @javax.annotation.Nullable + private String pushQRCode; + + public static final String SERIALIZED_NAME_MANUAL_ENTRY_CODE = "ManualEntryCode"; + @SerializedName(SERIALIZED_NAME_MANUAL_ENTRY_CODE) + @javax.annotation.Nullable + private String manualEntryCode; + + public static final String SERIALIZED_NAME_DUO_AUTH_ENDPOINT = "DuoAuthEndpoint"; + @SerializedName(SERIALIZED_NAME_DUO_AUTH_ENDPOINT) + @javax.annotation.Nullable + private String duoAuthEndpoint; + + public static final String SERIALIZED_NAME_IS_GOOGLE_AUTHENTICATOR_VERIFIED = "IsGoogleAuthenticatorVerified"; + @SerializedName(SERIALIZED_NAME_IS_GOOGLE_AUTHENTICATOR_VERIFIED) + @javax.annotation.Nullable + private Boolean isGoogleAuthenticatorVerified; + + public static final String SERIALIZED_NAME_IS_PUSH_DEVICE_REGISTERED = "IsPushDeviceRegistered"; + @SerializedName(SERIALIZED_NAME_IS_PUSH_DEVICE_REGISTERED) + @javax.annotation.Nullable + private Boolean isPushDeviceRegistered; + + public static final String SERIALIZED_NAME_IS_AUTHENTICATOR_VERIFIED = "IsAuthenticatorVerified"; + @SerializedName(SERIALIZED_NAME_IS_AUTHENTICATOR_VERIFIED) + @javax.annotation.Nullable + private Boolean isAuthenticatorVerified; + + public static final String SERIALIZED_NAME_IS_EMAIL_OTP_AUTHENTICATOR_VERIFIED = "IsEmailOtpAuthenticatorVerified"; + @SerializedName(SERIALIZED_NAME_IS_EMAIL_OTP_AUTHENTICATOR_VERIFIED) + @javax.annotation.Nullable + private Boolean isEmailOtpAuthenticatorVerified; + + public static final String SERIALIZED_NAME_IS_O_T_P_AUTHENTICATOR_VERIFIED = "IsOTPAuthenticatorVerified"; + @SerializedName(SERIALIZED_NAME_IS_O_T_P_AUTHENTICATOR_VERIFIED) + @javax.annotation.Nullable + private Boolean isOTPAuthenticatorVerified; + + public static final String SERIALIZED_NAME_IS_DUO_AUTHENTICATOR_VERIFIED = "IsDuoAuthenticatorVerified"; + @SerializedName(SERIALIZED_NAME_IS_DUO_AUTHENTICATOR_VERIFIED) + @javax.annotation.Nullable + private Boolean isDuoAuthenticatorVerified; + + public static final String SERIALIZED_NAME_IS_PASSKEY_AUTHENTICATOR_VERIFIED = "IsPasskeyAuthenticatorVerified"; + @SerializedName(SERIALIZED_NAME_IS_PASSKEY_AUTHENTICATOR_VERIFIED) + @javax.annotation.Nullable + private Boolean isPasskeyAuthenticatorVerified; + + public static final String SERIALIZED_NAME_OT_P_PHONE_NO = "OTPPhoneNo"; + @SerializedName(SERIALIZED_NAME_OT_P_PHONE_NO) + @javax.annotation.Nullable + private String otPPhoneNo; + + public static final String SERIALIZED_NAME_OT_P_STATUS = "OTPStatus"; + @SerializedName(SERIALIZED_NAME_OT_P_STATUS) + @javax.annotation.Nullable + private SMSResponseData otPStatus; + + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private List<String> email = new ArrayList<>(); + + public static final String SERIALIZED_NAME_EMAIL_O_T_P_STATUS = "EmailOTPStatus"; + @SerializedName(SERIALIZED_NAME_EMAIL_O_T_P_STATUS) + @javax.annotation.Nullable + private EmailOTPStatus emailOTPStatus; + + public static final String SERIALIZED_NAME_IS_SECURITY_QUESTION_AUTHENTICATOR_VERIFIED = "IsSecurityQuestionAuthenticatorVerified"; + @SerializedName(SERIALIZED_NAME_IS_SECURITY_QUESTION_AUTHENTICATOR_VERIFIED) + @javax.annotation.Nullable + private Boolean isSecurityQuestionAuthenticatorVerified; + + public static final String SERIALIZED_NAME_SECURITY_QUESTIONS = "SecurityQuestions"; + @SerializedName(SERIALIZED_NAME_SECURITY_QUESTIONS) + @javax.annotation.Nullable + private List<SecurityQuestions> securityQuestions = new ArrayList<>(); + + public TwoFactorAuthenticationTokenObject() { + } + + public TwoFactorAuthenticationTokenObject secondFactorAuthenticationToken(@javax.annotation.Nullable String secondFactorAuthenticationToken) { + this.secondFactorAuthenticationToken = secondFactorAuthenticationToken; + return this; + } + + /** + * Token for second factor authentication + * @return secondFactorAuthenticationToken + */ + @javax.annotation.Nullable + public String getSecondFactorAuthenticationToken() { + return secondFactorAuthenticationToken; + } + + public void setSecondFactorAuthenticationToken(@javax.annotation.Nullable String secondFactorAuthenticationToken) { + this.secondFactorAuthenticationToken = secondFactorAuthenticationToken; + } + + + public TwoFactorAuthenticationTokenObject expireIn(@javax.annotation.Nullable OffsetDateTime expireIn) { + this.expireIn = expireIn; + return this; + } + + /** + * Expiration time of the token + * @return expireIn + */ + @javax.annotation.Nullable + public OffsetDateTime getExpireIn() { + return expireIn; + } + + public void setExpireIn(@javax.annotation.Nullable OffsetDateTime expireIn) { + this.expireIn = expireIn; + } + + + public TwoFactorAuthenticationTokenObject qrCode(@javax.annotation.Nullable String qrCode) { + this.qrCode = qrCode; + return this; + } + + /** + * Get qrCode + * @return qrCode + */ + @javax.annotation.Nullable + public String getQrCode() { + return qrCode; + } + + public void setQrCode(@javax.annotation.Nullable String qrCode) { + this.qrCode = qrCode; + } + + + public TwoFactorAuthenticationTokenObject pushQRCode(@javax.annotation.Nullable String pushQRCode) { + this.pushQRCode = pushQRCode; + return this; + } + + /** + * Get pushQRCode + * @return pushQRCode + */ + @javax.annotation.Nullable + public String getPushQRCode() { + return pushQRCode; + } + + public void setPushQRCode(@javax.annotation.Nullable String pushQRCode) { + this.pushQRCode = pushQRCode; + } + + + public TwoFactorAuthenticationTokenObject manualEntryCode(@javax.annotation.Nullable String manualEntryCode) { + this.manualEntryCode = manualEntryCode; + return this; + } + + /** + * Get manualEntryCode + * @return manualEntryCode + */ + @javax.annotation.Nullable + public String getManualEntryCode() { + return manualEntryCode; + } + + public void setManualEntryCode(@javax.annotation.Nullable String manualEntryCode) { + this.manualEntryCode = manualEntryCode; + } + + + public TwoFactorAuthenticationTokenObject duoAuthEndpoint(@javax.annotation.Nullable String duoAuthEndpoint) { + this.duoAuthEndpoint = duoAuthEndpoint; + return this; + } + + /** + * Get duoAuthEndpoint + * @return duoAuthEndpoint + */ + @javax.annotation.Nullable + public String getDuoAuthEndpoint() { + return duoAuthEndpoint; + } + + public void setDuoAuthEndpoint(@javax.annotation.Nullable String duoAuthEndpoint) { + this.duoAuthEndpoint = duoAuthEndpoint; + } + + + public TwoFactorAuthenticationTokenObject isGoogleAuthenticatorVerified(@javax.annotation.Nullable Boolean isGoogleAuthenticatorVerified) { + this.isGoogleAuthenticatorVerified = isGoogleAuthenticatorVerified; + return this; + } + + /** + * Get isGoogleAuthenticatorVerified + * @return isGoogleAuthenticatorVerified + */ + @javax.annotation.Nullable + public Boolean getIsGoogleAuthenticatorVerified() { + return isGoogleAuthenticatorVerified; + } + + public void setIsGoogleAuthenticatorVerified(@javax.annotation.Nullable Boolean isGoogleAuthenticatorVerified) { + this.isGoogleAuthenticatorVerified = isGoogleAuthenticatorVerified; + } + + + public TwoFactorAuthenticationTokenObject isPushDeviceRegistered(@javax.annotation.Nullable Boolean isPushDeviceRegistered) { + this.isPushDeviceRegistered = isPushDeviceRegistered; + return this; + } + + /** + * Get isPushDeviceRegistered + * @return isPushDeviceRegistered + */ + @javax.annotation.Nullable + public Boolean getIsPushDeviceRegistered() { + return isPushDeviceRegistered; + } + + public void setIsPushDeviceRegistered(@javax.annotation.Nullable Boolean isPushDeviceRegistered) { + this.isPushDeviceRegistered = isPushDeviceRegistered; + } + + + public TwoFactorAuthenticationTokenObject isAuthenticatorVerified(@javax.annotation.Nullable Boolean isAuthenticatorVerified) { + this.isAuthenticatorVerified = isAuthenticatorVerified; + return this; + } + + /** + * Get isAuthenticatorVerified + * @return isAuthenticatorVerified + */ + @javax.annotation.Nullable + public Boolean getIsAuthenticatorVerified() { + return isAuthenticatorVerified; + } + + public void setIsAuthenticatorVerified(@javax.annotation.Nullable Boolean isAuthenticatorVerified) { + this.isAuthenticatorVerified = isAuthenticatorVerified; + } + + + public TwoFactorAuthenticationTokenObject isEmailOtpAuthenticatorVerified(@javax.annotation.Nullable Boolean isEmailOtpAuthenticatorVerified) { + this.isEmailOtpAuthenticatorVerified = isEmailOtpAuthenticatorVerified; + return this; + } + + /** + * Get isEmailOtpAuthenticatorVerified + * @return isEmailOtpAuthenticatorVerified + */ + @javax.annotation.Nullable + public Boolean getIsEmailOtpAuthenticatorVerified() { + return isEmailOtpAuthenticatorVerified; + } + + public void setIsEmailOtpAuthenticatorVerified(@javax.annotation.Nullable Boolean isEmailOtpAuthenticatorVerified) { + this.isEmailOtpAuthenticatorVerified = isEmailOtpAuthenticatorVerified; + } + + + public TwoFactorAuthenticationTokenObject isOTPAuthenticatorVerified(@javax.annotation.Nullable Boolean isOTPAuthenticatorVerified) { + this.isOTPAuthenticatorVerified = isOTPAuthenticatorVerified; + return this; + } + + /** + * Get isOTPAuthenticatorVerified + * @return isOTPAuthenticatorVerified + */ + @javax.annotation.Nullable + public Boolean getIsOTPAuthenticatorVerified() { + return isOTPAuthenticatorVerified; + } + + public void setIsOTPAuthenticatorVerified(@javax.annotation.Nullable Boolean isOTPAuthenticatorVerified) { + this.isOTPAuthenticatorVerified = isOTPAuthenticatorVerified; + } + + + public TwoFactorAuthenticationTokenObject isDuoAuthenticatorVerified(@javax.annotation.Nullable Boolean isDuoAuthenticatorVerified) { + this.isDuoAuthenticatorVerified = isDuoAuthenticatorVerified; + return this; + } + + /** + * Get isDuoAuthenticatorVerified + * @return isDuoAuthenticatorVerified + */ + @javax.annotation.Nullable + public Boolean getIsDuoAuthenticatorVerified() { + return isDuoAuthenticatorVerified; + } + + public void setIsDuoAuthenticatorVerified(@javax.annotation.Nullable Boolean isDuoAuthenticatorVerified) { + this.isDuoAuthenticatorVerified = isDuoAuthenticatorVerified; + } + + + public TwoFactorAuthenticationTokenObject isPasskeyAuthenticatorVerified(@javax.annotation.Nullable Boolean isPasskeyAuthenticatorVerified) { + this.isPasskeyAuthenticatorVerified = isPasskeyAuthenticatorVerified; + return this; + } + + /** + * Get isPasskeyAuthenticatorVerified + * @return isPasskeyAuthenticatorVerified + */ + @javax.annotation.Nullable + public Boolean getIsPasskeyAuthenticatorVerified() { + return isPasskeyAuthenticatorVerified; + } + + public void setIsPasskeyAuthenticatorVerified(@javax.annotation.Nullable Boolean isPasskeyAuthenticatorVerified) { + this.isPasskeyAuthenticatorVerified = isPasskeyAuthenticatorVerified; + } + + + public TwoFactorAuthenticationTokenObject otPPhoneNo(@javax.annotation.Nullable String otPPhoneNo) { + this.otPPhoneNo = otPPhoneNo; + return this; + } + + /** + * Get otPPhoneNo + * @return otPPhoneNo + */ + @javax.annotation.Nullable + public String getOtPPhoneNo() { + return otPPhoneNo; + } + + public void setOtPPhoneNo(@javax.annotation.Nullable String otPPhoneNo) { + this.otPPhoneNo = otPPhoneNo; + } + + + public TwoFactorAuthenticationTokenObject otPStatus(@javax.annotation.Nullable SMSResponseData otPStatus) { + this.otPStatus = otPStatus; + return this; + } + + /** + * Get otPStatus + * @return otPStatus + */ + @javax.annotation.Nullable + public SMSResponseData getOtPStatus() { + return otPStatus; + } + + public void setOtPStatus(@javax.annotation.Nullable SMSResponseData otPStatus) { + this.otPStatus = otPStatus; + } + + + public TwoFactorAuthenticationTokenObject email(@javax.annotation.Nullable List<String> email) { + this.email = email; + return this; + } + + public TwoFactorAuthenticationTokenObject addEmailItem(String emailItem) { + if (this.email == null) { + this.email = new ArrayList<>(); + } + this.email.add(emailItem); + return this; + } + + /** + * Get email + * @return email + */ + @javax.annotation.Nullable + public List<String> getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable List<String> email) { + this.email = email; + } + + + public TwoFactorAuthenticationTokenObject emailOTPStatus(@javax.annotation.Nullable EmailOTPStatus emailOTPStatus) { + this.emailOTPStatus = emailOTPStatus; + return this; + } + + /** + * Get emailOTPStatus + * @return emailOTPStatus + */ + @javax.annotation.Nullable + public EmailOTPStatus getEmailOTPStatus() { + return emailOTPStatus; + } + + public void setEmailOTPStatus(@javax.annotation.Nullable EmailOTPStatus emailOTPStatus) { + this.emailOTPStatus = emailOTPStatus; + } + + + public TwoFactorAuthenticationTokenObject isSecurityQuestionAuthenticatorVerified(@javax.annotation.Nullable Boolean isSecurityQuestionAuthenticatorVerified) { + this.isSecurityQuestionAuthenticatorVerified = isSecurityQuestionAuthenticatorVerified; + return this; + } + + /** + * Get isSecurityQuestionAuthenticatorVerified + * @return isSecurityQuestionAuthenticatorVerified + */ + @javax.annotation.Nullable + public Boolean getIsSecurityQuestionAuthenticatorVerified() { + return isSecurityQuestionAuthenticatorVerified; + } + + public void setIsSecurityQuestionAuthenticatorVerified(@javax.annotation.Nullable Boolean isSecurityQuestionAuthenticatorVerified) { + this.isSecurityQuestionAuthenticatorVerified = isSecurityQuestionAuthenticatorVerified; + } + + + public TwoFactorAuthenticationTokenObject securityQuestions(@javax.annotation.Nullable List<SecurityQuestions> securityQuestions) { + this.securityQuestions = securityQuestions; + return this; + } + + public TwoFactorAuthenticationTokenObject addSecurityQuestionsItem(SecurityQuestions securityQuestionsItem) { + if (this.securityQuestions == null) { + this.securityQuestions = new ArrayList<>(); + } + this.securityQuestions.add(securityQuestionsItem); + return this; + } + + /** + * Get securityQuestions + * @return securityQuestions + */ + @javax.annotation.Nullable + public List<SecurityQuestions> getSecurityQuestions() { + return securityQuestions; + } + + public void setSecurityQuestions(@javax.annotation.Nullable List<SecurityQuestions> securityQuestions) { + this.securityQuestions = securityQuestions; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the TwoFactorAuthenticationTokenObject instance itself + */ + public TwoFactorAuthenticationTokenObject putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TwoFactorAuthenticationTokenObject twoFactorAuthenticationTokenObject = (TwoFactorAuthenticationTokenObject) o; + return Objects.equals(this.secondFactorAuthenticationToken, twoFactorAuthenticationTokenObject.secondFactorAuthenticationToken) && + Objects.equals(this.expireIn, twoFactorAuthenticationTokenObject.expireIn) && + Objects.equals(this.qrCode, twoFactorAuthenticationTokenObject.qrCode) && + Objects.equals(this.pushQRCode, twoFactorAuthenticationTokenObject.pushQRCode) && + Objects.equals(this.manualEntryCode, twoFactorAuthenticationTokenObject.manualEntryCode) && + Objects.equals(this.duoAuthEndpoint, twoFactorAuthenticationTokenObject.duoAuthEndpoint) && + Objects.equals(this.isGoogleAuthenticatorVerified, twoFactorAuthenticationTokenObject.isGoogleAuthenticatorVerified) && + Objects.equals(this.isPushDeviceRegistered, twoFactorAuthenticationTokenObject.isPushDeviceRegistered) && + Objects.equals(this.isAuthenticatorVerified, twoFactorAuthenticationTokenObject.isAuthenticatorVerified) && + Objects.equals(this.isEmailOtpAuthenticatorVerified, twoFactorAuthenticationTokenObject.isEmailOtpAuthenticatorVerified) && + Objects.equals(this.isOTPAuthenticatorVerified, twoFactorAuthenticationTokenObject.isOTPAuthenticatorVerified) && + Objects.equals(this.isDuoAuthenticatorVerified, twoFactorAuthenticationTokenObject.isDuoAuthenticatorVerified) && + Objects.equals(this.isPasskeyAuthenticatorVerified, twoFactorAuthenticationTokenObject.isPasskeyAuthenticatorVerified) && + Objects.equals(this.otPPhoneNo, twoFactorAuthenticationTokenObject.otPPhoneNo) && + Objects.equals(this.otPStatus, twoFactorAuthenticationTokenObject.otPStatus) && + Objects.equals(this.email, twoFactorAuthenticationTokenObject.email) && + Objects.equals(this.emailOTPStatus, twoFactorAuthenticationTokenObject.emailOTPStatus) && + Objects.equals(this.isSecurityQuestionAuthenticatorVerified, twoFactorAuthenticationTokenObject.isSecurityQuestionAuthenticatorVerified) && + Objects.equals(this.securityQuestions, twoFactorAuthenticationTokenObject.securityQuestions)&& + Objects.equals(this.additionalProperties, twoFactorAuthenticationTokenObject.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(secondFactorAuthenticationToken, expireIn, qrCode, pushQRCode, manualEntryCode, duoAuthEndpoint, isGoogleAuthenticatorVerified, isPushDeviceRegistered, isAuthenticatorVerified, isEmailOtpAuthenticatorVerified, isOTPAuthenticatorVerified, isDuoAuthenticatorVerified, isPasskeyAuthenticatorVerified, otPPhoneNo, otPStatus, email, emailOTPStatus, isSecurityQuestionAuthenticatorVerified, securityQuestions, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TwoFactorAuthenticationTokenObject {\n"); + sb.append(" secondFactorAuthenticationToken: ").append(toIndentedString(secondFactorAuthenticationToken)).append("\n"); + sb.append(" expireIn: ").append(toIndentedString(expireIn)).append("\n"); + sb.append(" qrCode: ").append(toIndentedString(qrCode)).append("\n"); + sb.append(" pushQRCode: ").append(toIndentedString(pushQRCode)).append("\n"); + sb.append(" manualEntryCode: ").append(toIndentedString(manualEntryCode)).append("\n"); + sb.append(" duoAuthEndpoint: ").append(toIndentedString(duoAuthEndpoint)).append("\n"); + sb.append(" isGoogleAuthenticatorVerified: ").append(toIndentedString(isGoogleAuthenticatorVerified)).append("\n"); + sb.append(" isPushDeviceRegistered: ").append(toIndentedString(isPushDeviceRegistered)).append("\n"); + sb.append(" isAuthenticatorVerified: ").append(toIndentedString(isAuthenticatorVerified)).append("\n"); + sb.append(" isEmailOtpAuthenticatorVerified: ").append(toIndentedString(isEmailOtpAuthenticatorVerified)).append("\n"); + sb.append(" isOTPAuthenticatorVerified: ").append(toIndentedString(isOTPAuthenticatorVerified)).append("\n"); + sb.append(" isDuoAuthenticatorVerified: ").append(toIndentedString(isDuoAuthenticatorVerified)).append("\n"); + sb.append(" isPasskeyAuthenticatorVerified: ").append(toIndentedString(isPasskeyAuthenticatorVerified)).append("\n"); + sb.append(" otPPhoneNo: ").append(toIndentedString(otPPhoneNo)).append("\n"); + sb.append(" otPStatus: ").append(toIndentedString(otPStatus)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" emailOTPStatus: ").append(toIndentedString(emailOTPStatus)).append("\n"); + sb.append(" isSecurityQuestionAuthenticatorVerified: ").append(toIndentedString(isSecurityQuestionAuthenticatorVerified)).append("\n"); + sb.append(" securityQuestions: ").append(toIndentedString(securityQuestions)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("SecondFactorAuthenticationToken"); + openapiFields.add("ExpireIn"); + openapiFields.add("QRCode"); + openapiFields.add("PushQRCode"); + openapiFields.add("ManualEntryCode"); + openapiFields.add("DuoAuthEndpoint"); + openapiFields.add("IsGoogleAuthenticatorVerified"); + openapiFields.add("IsPushDeviceRegistered"); + openapiFields.add("IsAuthenticatorVerified"); + openapiFields.add("IsEmailOtpAuthenticatorVerified"); + openapiFields.add("IsOTPAuthenticatorVerified"); + openapiFields.add("IsDuoAuthenticatorVerified"); + openapiFields.add("IsPasskeyAuthenticatorVerified"); + openapiFields.add("OTPPhoneNo"); + openapiFields.add("OTPStatus"); + openapiFields.add("Email"); + openapiFields.add("EmailOTPStatus"); + openapiFields.add("IsSecurityQuestionAuthenticatorVerified"); + openapiFields.add("SecurityQuestions"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 TwoFactorAuthenticationTokenObject + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TwoFactorAuthenticationTokenObject.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TwoFactorAuthenticationTokenObject is not found in the empty JSON string", TwoFactorAuthenticationTokenObject.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("SecondFactorAuthenticationToken") != null && !jsonObj.get("SecondFactorAuthenticationToken").isJsonNull()) && !jsonObj.get("SecondFactorAuthenticationToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SecondFactorAuthenticationToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SecondFactorAuthenticationToken").toString())); + } + if ((jsonObj.get("QRCode") != null && !jsonObj.get("QRCode").isJsonNull()) && !jsonObj.get("QRCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `QRCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("QRCode").toString())); + } + if ((jsonObj.get("PushQRCode") != null && !jsonObj.get("PushQRCode").isJsonNull()) && !jsonObj.get("PushQRCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PushQRCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PushQRCode").toString())); + } + if ((jsonObj.get("ManualEntryCode") != null && !jsonObj.get("ManualEntryCode").isJsonNull()) && !jsonObj.get("ManualEntryCode").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ManualEntryCode` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ManualEntryCode").toString())); + } + if ((jsonObj.get("DuoAuthEndpoint") != null && !jsonObj.get("DuoAuthEndpoint").isJsonNull()) && !jsonObj.get("DuoAuthEndpoint").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `DuoAuthEndpoint` to be a primitive type in the JSON string but got `%s`", jsonObj.get("DuoAuthEndpoint").toString())); + } + if ((jsonObj.get("OTPPhoneNo") != null && !jsonObj.get("OTPPhoneNo").isJsonNull()) && !jsonObj.get("OTPPhoneNo").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `OTPPhoneNo` to be a primitive type in the JSON string but got `%s`", jsonObj.get("OTPPhoneNo").toString())); + } + // validate the optional field `OTPStatus` + if (jsonObj.get("OTPStatus") != null && !jsonObj.get("OTPStatus").isJsonNull()) { + SMSResponseData.validateJsonElement(jsonObj.get("OTPStatus")); + } + // ensure the optional json data is an array if present + if (jsonObj.get("Email") != null && !jsonObj.get("Email").isJsonNull() && !jsonObj.get("Email").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Email` to be an array in the JSON string but got `%s`", jsonObj.get("Email").toString())); + } + // validate the optional field `EmailOTPStatus` + if (jsonObj.get("EmailOTPStatus") != null && !jsonObj.get("EmailOTPStatus").isJsonNull()) { + EmailOTPStatus.validateJsonElement(jsonObj.get("EmailOTPStatus")); + } + if (jsonObj.get("SecurityQuestions") != null && !jsonObj.get("SecurityQuestions").isJsonNull()) { + JsonArray jsonArraysecurityQuestions = jsonObj.getAsJsonArray("SecurityQuestions"); + if (jsonArraysecurityQuestions != null) { + // ensure the json data is an array + if (!jsonObj.get("SecurityQuestions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `SecurityQuestions` to be an array in the JSON string but got `%s`", jsonObj.get("SecurityQuestions").toString())); + } + + // validate the optional field `SecurityQuestions` (array) + for (int i = 0; i < jsonArraysecurityQuestions.size(); i++) { + SecurityQuestions.validateJsonElement(jsonArraysecurityQuestions.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!TwoFactorAuthenticationTokenObject.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TwoFactorAuthenticationTokenObject' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<TwoFactorAuthenticationTokenObject> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TwoFactorAuthenticationTokenObject.class)); + + return (TypeAdapter<T>) new TypeAdapter<TwoFactorAuthenticationTokenObject>() { + @Override + public void write(JsonWriter out, TwoFactorAuthenticationTokenObject value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public TwoFactorAuthenticationTokenObject read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + TwoFactorAuthenticationTokenObject instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TwoFactorAuthenticationTokenObject given an JSON string + * + * @param jsonString JSON string + * @return An instance of TwoFactorAuthenticationTokenObject + * @throws IOException if the JSON string is invalid with respect to TwoFactorAuthenticationTokenObject + */ + public static TwoFactorAuthenticationTokenObject fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TwoFactorAuthenticationTokenObject.class); + } + + /** + * Convert an instance of TwoFactorAuthenticationTokenObject to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/TwoFactorAuthenticationTokenObjectCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/TwoFactorAuthenticationTokenObjectCore.java new file mode 100644 index 0000000..b73b566 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/TwoFactorAuthenticationTokenObjectCore.java @@ -0,0 +1,315 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * TwoFactorAuthenticationTokenObjectCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class TwoFactorAuthenticationTokenObjectCore { + public static final String SERIALIZED_NAME_SECOND_FACTOR_AUTHENTICATION_TOKEN = "SecondFactorAuthenticationToken"; + @SerializedName(SERIALIZED_NAME_SECOND_FACTOR_AUTHENTICATION_TOKEN) + @javax.annotation.Nullable + private String secondFactorAuthenticationToken; + + public static final String SERIALIZED_NAME_EXPIRE_IN = "ExpireIn"; + @SerializedName(SERIALIZED_NAME_EXPIRE_IN) + @javax.annotation.Nullable + private OffsetDateTime expireIn; + + public TwoFactorAuthenticationTokenObjectCore() { + } + + public TwoFactorAuthenticationTokenObjectCore secondFactorAuthenticationToken(@javax.annotation.Nullable String secondFactorAuthenticationToken) { + this.secondFactorAuthenticationToken = secondFactorAuthenticationToken; + return this; + } + + /** + * Token for second factor authentication + * @return secondFactorAuthenticationToken + */ + @javax.annotation.Nullable + public String getSecondFactorAuthenticationToken() { + return secondFactorAuthenticationToken; + } + + public void setSecondFactorAuthenticationToken(@javax.annotation.Nullable String secondFactorAuthenticationToken) { + this.secondFactorAuthenticationToken = secondFactorAuthenticationToken; + } + + + public TwoFactorAuthenticationTokenObjectCore expireIn(@javax.annotation.Nullable OffsetDateTime expireIn) { + this.expireIn = expireIn; + return this; + } + + /** + * Expiration time of the token + * @return expireIn + */ + @javax.annotation.Nullable + public OffsetDateTime getExpireIn() { + return expireIn; + } + + public void setExpireIn(@javax.annotation.Nullable OffsetDateTime expireIn) { + this.expireIn = expireIn; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the TwoFactorAuthenticationTokenObjectCore instance itself + */ + public TwoFactorAuthenticationTokenObjectCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + TwoFactorAuthenticationTokenObjectCore twoFactorAuthenticationTokenObjectCore = (TwoFactorAuthenticationTokenObjectCore) o; + return Objects.equals(this.secondFactorAuthenticationToken, twoFactorAuthenticationTokenObjectCore.secondFactorAuthenticationToken) && + Objects.equals(this.expireIn, twoFactorAuthenticationTokenObjectCore.expireIn)&& + Objects.equals(this.additionalProperties, twoFactorAuthenticationTokenObjectCore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(secondFactorAuthenticationToken, expireIn, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class TwoFactorAuthenticationTokenObjectCore {\n"); + sb.append(" secondFactorAuthenticationToken: ").append(toIndentedString(secondFactorAuthenticationToken)).append("\n"); + sb.append(" expireIn: ").append(toIndentedString(expireIn)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("SecondFactorAuthenticationToken"); + openapiFields.add("ExpireIn"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 TwoFactorAuthenticationTokenObjectCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!TwoFactorAuthenticationTokenObjectCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in TwoFactorAuthenticationTokenObjectCore is not found in the empty JSON string", TwoFactorAuthenticationTokenObjectCore.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("SecondFactorAuthenticationToken") != null && !jsonObj.get("SecondFactorAuthenticationToken").isJsonNull()) && !jsonObj.get("SecondFactorAuthenticationToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SecondFactorAuthenticationToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SecondFactorAuthenticationToken").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!TwoFactorAuthenticationTokenObjectCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'TwoFactorAuthenticationTokenObjectCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<TwoFactorAuthenticationTokenObjectCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(TwoFactorAuthenticationTokenObjectCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<TwoFactorAuthenticationTokenObjectCore>() { + @Override + public void write(JsonWriter out, TwoFactorAuthenticationTokenObjectCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public TwoFactorAuthenticationTokenObjectCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + TwoFactorAuthenticationTokenObjectCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of TwoFactorAuthenticationTokenObjectCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of TwoFactorAuthenticationTokenObjectCore + * @throws IOException if the JSON string is invalid with respect to TwoFactorAuthenticationTokenObjectCore + */ + public static TwoFactorAuthenticationTokenObjectCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, TwoFactorAuthenticationTokenObjectCore.class); + } + + /** + * Convert an instance of TwoFactorAuthenticationTokenObjectCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UnlinkSocialIdentityRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UnlinkSocialIdentityRequest.java new file mode 100644 index 0000000..8f973c9 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UnlinkSocialIdentityRequest.java @@ -0,0 +1,356 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * Structure of the request body for unlinking the social identities from profile + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UnlinkSocialIdentityRequest { + public static final String SERIALIZED_NAME_PROVIDER = "provider"; + @SerializedName(SERIALIZED_NAME_PROVIDER) + @javax.annotation.Nonnull + private String provider; + + public static final String SERIALIZED_NAME_PROVIDERID = "providerid"; + @SerializedName(SERIALIZED_NAME_PROVIDERID) + @javax.annotation.Nonnull + private String providerid; + + public static final String SERIALIZED_NAME_ACCESS_TOKEN = "access_token"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN) + @javax.annotation.Nullable + private String accessToken; + + public UnlinkSocialIdentityRequest() { + } + + public UnlinkSocialIdentityRequest provider(@javax.annotation.Nonnull String provider) { + this.provider = provider; + return this; + } + + /** + * Get provider + * @return provider + */ + @javax.annotation.Nonnull + public String getProvider() { + return provider; + } + + public void setProvider(@javax.annotation.Nonnull String provider) { + this.provider = provider; + } + + + public UnlinkSocialIdentityRequest providerid(@javax.annotation.Nonnull String providerid) { + this.providerid = providerid; + return this; + } + + /** + * Get providerid + * @return providerid + */ + @javax.annotation.Nonnull + public String getProviderid() { + return providerid; + } + + public void setProviderid(@javax.annotation.Nonnull String providerid) { + this.providerid = providerid; + } + + + public UnlinkSocialIdentityRequest accessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Get accessToken + * @return accessToken + */ + @javax.annotation.Nullable + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UnlinkSocialIdentityRequest instance itself + */ + public UnlinkSocialIdentityRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnlinkSocialIdentityRequest unlinkSocialIdentityRequest = (UnlinkSocialIdentityRequest) o; + return Objects.equals(this.provider, unlinkSocialIdentityRequest.provider) && + Objects.equals(this.providerid, unlinkSocialIdentityRequest.providerid) && + Objects.equals(this.accessToken, unlinkSocialIdentityRequest.accessToken)&& + Objects.equals(this.additionalProperties, unlinkSocialIdentityRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(provider, providerid, accessToken, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnlinkSocialIdentityRequest {\n"); + sb.append(" provider: ").append(toIndentedString(provider)).append("\n"); + sb.append(" providerid: ").append(toIndentedString(providerid)).append("\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("provider"); + openapiFields.add("providerid"); + openapiFields.add("access_token"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("provider"); + openapiRequiredFields.add("providerid"); + } + + /** + * 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 UnlinkSocialIdentityRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UnlinkSocialIdentityRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UnlinkSocialIdentityRequest is not found in the empty JSON string", UnlinkSocialIdentityRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UnlinkSocialIdentityRequest.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("provider").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `provider` to be a primitive type in the JSON string but got `%s`", jsonObj.get("provider").toString())); + } + if (!jsonObj.get("providerid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `providerid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("providerid").toString())); + } + if ((jsonObj.get("access_token") != null && !jsonObj.get("access_token").isJsonNull()) && !jsonObj.get("access_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `access_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("access_token").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UnlinkSocialIdentityRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UnlinkSocialIdentityRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<UnlinkSocialIdentityRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UnlinkSocialIdentityRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<UnlinkSocialIdentityRequest>() { + @Override + public void write(JsonWriter out, UnlinkSocialIdentityRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UnlinkSocialIdentityRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UnlinkSocialIdentityRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UnlinkSocialIdentityRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of UnlinkSocialIdentityRequest + * @throws IOException if the JSON string is invalid with respect to UnlinkSocialIdentityRequest + */ + public static UnlinkSocialIdentityRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UnlinkSocialIdentityRequest.class); + } + + /** + * Convert an instance of UnlinkSocialIdentityRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UnlockAccountRequestCore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UnlockAccountRequestCore.java new file mode 100644 index 0000000..5bfaee4 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UnlockAccountRequestCore.java @@ -0,0 +1,292 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * UnlockAccountRequestCore + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UnlockAccountRequestCore { + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nonnull + private Object securityAnswer; + + public UnlockAccountRequestCore() { + } + + public UnlockAccountRequestCore securityAnswer(@javax.annotation.Nonnull Object securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + /** + * Security answer's of the User if the User is locked by security questions + * @return securityAnswer + */ + @javax.annotation.Nonnull + public Object getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nonnull Object securityAnswer) { + this.securityAnswer = securityAnswer; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UnlockAccountRequestCore instance itself + */ + public UnlockAccountRequestCore putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnlockAccountRequestCore unlockAccountRequestCore = (UnlockAccountRequestCore) o; + return Objects.equals(this.securityAnswer, unlockAccountRequestCore.securityAnswer)&& + Objects.equals(this.additionalProperties, unlockAccountRequestCore.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(securityAnswer, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnlockAccountRequestCore {\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("SecurityAnswer"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("SecurityAnswer"); + } + + /** + * 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 UnlockAccountRequestCore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UnlockAccountRequestCore.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UnlockAccountRequestCore is not found in the empty JSON string", UnlockAccountRequestCore.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UnlockAccountRequestCore.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(); + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UnlockAccountRequestCore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UnlockAccountRequestCore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<UnlockAccountRequestCore> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UnlockAccountRequestCore.class)); + + return (TypeAdapter<T>) new TypeAdapter<UnlockAccountRequestCore>() { + @Override + public void write(JsonWriter out, UnlockAccountRequestCore value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UnlockAccountRequestCore read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UnlockAccountRequestCore instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UnlockAccountRequestCore given an JSON string + * + * @param jsonString JSON string + * @return An instance of UnlockAccountRequestCore + * @throws IOException if the JSON string is invalid with respect to UnlockAccountRequestCore + */ + public static UnlockAccountRequestCore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UnlockAccountRequestCore.class); + } + + /** + * Convert an instance of UnlockAccountRequestCore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UnlockaccountbyaccesstokenRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UnlockaccountbyaccesstokenRequest.java new file mode 100644 index 0000000..753edfa --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UnlockaccountbyaccesstokenRequest.java @@ -0,0 +1,424 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * UnlockaccountbyaccesstokenRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UnlockaccountbyaccesstokenRequest { + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nonnull + private Object securityAnswer; + + public static final String SERIALIZED_NAME_G_RECAPTCHA_RESPONSE = "g-recaptcha-response"; + @SerializedName(SERIALIZED_NAME_G_RECAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String gRecaptchaResponse; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_TICKET = "qq_captcha_ticket"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_TICKET) + @javax.annotation.Nullable + private String qqCaptchaTicket; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR = "qq_captcha_randstr"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR) + @javax.annotation.Nullable + private String qqCaptchaRandstr; + + public static final String SERIALIZED_NAME_H_CAPTCHA_RESPONSE = "h-captcha-response"; + @SerializedName(SERIALIZED_NAME_H_CAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String hCaptchaResponse; + + public UnlockaccountbyaccesstokenRequest() { + } + + public UnlockaccountbyaccesstokenRequest securityAnswer(@javax.annotation.Nonnull Object securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + /** + * Security answer's of the User if the User is locked by security questions + * @return securityAnswer + */ + @javax.annotation.Nonnull + public Object getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nonnull Object securityAnswer) { + this.securityAnswer = securityAnswer; + } + + + public UnlockaccountbyaccesstokenRequest gRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + return this; + } + + /** + * The Google reCAPTCHA response which is sent to the server for verification. + * @return gRecaptchaResponse + */ + @javax.annotation.Nullable + public String getgRecaptchaResponse() { + return gRecaptchaResponse; + } + + public void setgRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + } + + + public UnlockaccountbyaccesstokenRequest qqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + return this; + } + + /** + * The QQ Captcha ticket which is sent to the server for verification. + * @return qqCaptchaTicket + */ + @javax.annotation.Nullable + public String getQqCaptchaTicket() { + return qqCaptchaTicket; + } + + public void setQqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + } + + + public UnlockaccountbyaccesstokenRequest qqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + return this; + } + + /** + * The QQ Captcha random string which is sent to the server for verification. + * @return qqCaptchaRandstr + */ + @javax.annotation.Nullable + public String getQqCaptchaRandstr() { + return qqCaptchaRandstr; + } + + public void setQqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + } + + + public UnlockaccountbyaccesstokenRequest hCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + return this; + } + + /** + * The hCaptcha response which is sent to the server for verification. + * @return hCaptchaResponse + */ + @javax.annotation.Nullable + public String gethCaptchaResponse() { + return hCaptchaResponse; + } + + public void sethCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UnlockaccountbyaccesstokenRequest instance itself + */ + public UnlockaccountbyaccesstokenRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UnlockaccountbyaccesstokenRequest unlockaccountbyaccesstokenRequest = (UnlockaccountbyaccesstokenRequest) o; + return Objects.equals(this.securityAnswer, unlockaccountbyaccesstokenRequest.securityAnswer) && + Objects.equals(this.gRecaptchaResponse, unlockaccountbyaccesstokenRequest.gRecaptchaResponse) && + Objects.equals(this.qqCaptchaTicket, unlockaccountbyaccesstokenRequest.qqCaptchaTicket) && + Objects.equals(this.qqCaptchaRandstr, unlockaccountbyaccesstokenRequest.qqCaptchaRandstr) && + Objects.equals(this.hCaptchaResponse, unlockaccountbyaccesstokenRequest.hCaptchaResponse)&& + Objects.equals(this.additionalProperties, unlockaccountbyaccesstokenRequest.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(securityAnswer, gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UnlockaccountbyaccesstokenRequest {\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" gRecaptchaResponse: ").append(toIndentedString(gRecaptchaResponse)).append("\n"); + sb.append(" qqCaptchaTicket: ").append(toIndentedString(qqCaptchaTicket)).append("\n"); + sb.append(" qqCaptchaRandstr: ").append(toIndentedString(qqCaptchaRandstr)).append("\n"); + sb.append(" hCaptchaResponse: ").append(toIndentedString(hCaptchaResponse)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("SecurityAnswer"); + openapiFields.add("g-recaptcha-response"); + openapiFields.add("qq_captcha_ticket"); + openapiFields.add("qq_captcha_randstr"); + openapiFields.add("h-captcha-response"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("SecurityAnswer"); + } + + /** + * 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 UnlockaccountbyaccesstokenRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UnlockaccountbyaccesstokenRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UnlockaccountbyaccesstokenRequest is not found in the empty JSON string", UnlockaccountbyaccesstokenRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UnlockaccountbyaccesstokenRequest.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("g-recaptcha-response") != null && !jsonObj.get("g-recaptcha-response").isJsonNull()) && !jsonObj.get("g-recaptcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `g-recaptcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("g-recaptcha-response").toString())); + } + if ((jsonObj.get("qq_captcha_ticket") != null && !jsonObj.get("qq_captcha_ticket").isJsonNull()) && !jsonObj.get("qq_captcha_ticket").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_ticket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_ticket").toString())); + } + if ((jsonObj.get("qq_captcha_randstr") != null && !jsonObj.get("qq_captcha_randstr").isJsonNull()) && !jsonObj.get("qq_captcha_randstr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_randstr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_randstr").toString())); + } + if ((jsonObj.get("h-captcha-response") != null && !jsonObj.get("h-captcha-response").isJsonNull()) && !jsonObj.get("h-captcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `h-captcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("h-captcha-response").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UnlockaccountbyaccesstokenRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UnlockaccountbyaccesstokenRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<UnlockaccountbyaccesstokenRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UnlockaccountbyaccesstokenRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<UnlockaccountbyaccesstokenRequest>() { + @Override + public void write(JsonWriter out, UnlockaccountbyaccesstokenRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UnlockaccountbyaccesstokenRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UnlockaccountbyaccesstokenRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UnlockaccountbyaccesstokenRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of UnlockaccountbyaccesstokenRequest + * @throws IOException if the JSON string is invalid with respect to UnlockaccountbyaccesstokenRequest + */ + public static UnlockaccountbyaccesstokenRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UnlockaccountbyaccesstokenRequest.class); + } + + /** + * Convert an instance of UnlockaccountbyaccesstokenRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UpdateAccountByAccessTokenRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UpdateAccountByAccessTokenRequest.java new file mode 100644 index 0000000..75fd4f4 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UpdateAccountByAccessTokenRequest.java @@ -0,0 +1,4356 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProfileRequestModelAddressesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelAwardsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelBadgesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelBooksInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelCaptchaModel; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelCertificationsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelConsents; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelCountry; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelCoursesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelCurrentStatusInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelEducationsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelEmailInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelExternalIdsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelFamilyInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelFavoriteThingsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelGamesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelIMAccountsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelInspirationalPeopleInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelInterestsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelJobBookmarksInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelLanguagesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelMemberUrlResourcesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelMoviesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelMutualFriendsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPINInfo; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPatentsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPhoneNumbersInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPlacesLivedInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPositionsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPrivacyPolicy; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelProjectsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelProviderAccessCredential; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPublicationsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelRecommendationsReceivedInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelRelatedProfileViewsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSkillsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSportsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSubscription; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSuggestions; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelTeleVisionShowInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelVolunteerInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * UpdateAccountByAccessTokenRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UpdateAccountByAccessTokenRequest { + public static final String SERIALIZED_NAME_ACCESS_TOKEN = "access_token"; + @SerializedName(SERIALIZED_NAME_ACCESS_TOKEN) + @javax.annotation.Nullable + private String accessToken; + + public static final String SERIALIZED_NAME_USER_NAME = "UserName"; + @SerializedName(SERIALIZED_NAME_USER_NAME) + @javax.annotation.Nullable + private String userName; + + public static final String SERIALIZED_NAME_PHONE_ID = "PhoneId"; + @SerializedName(SERIALIZED_NAME_PHONE_ID) + @javax.annotation.Nullable + private String phoneId; + + public static final String SERIALIZED_NAME_GENDER = "Gender"; + @SerializedName(SERIALIZED_NAME_GENDER) + @javax.annotation.Nullable + private String gender; + + public static final String SERIALIZED_NAME_BIRTH_DATE = "BirthDate"; + @SerializedName(SERIALIZED_NAME_BIRTH_DATE) + @javax.annotation.Nullable + private String birthDate; + + public static final String SERIALIZED_NAME_PREFIX = "Prefix"; + @SerializedName(SERIALIZED_NAME_PREFIX) + @javax.annotation.Nullable + private String prefix; + + public static final String SERIALIZED_NAME_FIRST_NAME = "FirstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nullable + private String firstName; + + public static final String SERIALIZED_NAME_MIDDLE_NAME = "MiddleName"; + @SerializedName(SERIALIZED_NAME_MIDDLE_NAME) + @javax.annotation.Nullable + private String middleName; + + public static final String SERIALIZED_NAME_LAST_NAME = "LastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nullable + private String lastName; + + public static final String SERIALIZED_NAME_SUFFIX = "Suffix"; + @SerializedName(SERIALIZED_NAME_SUFFIX) + @javax.annotation.Nullable + private String suffix; + + public static final String SERIALIZED_NAME_NICK_NAME = "NickName"; + @SerializedName(SERIALIZED_NAME_NICK_NAME) + @javax.annotation.Nullable + private String nickName; + + public static final String SERIALIZED_NAME_PROFILE_NAME = "ProfileName"; + @SerializedName(SERIALIZED_NAME_PROFILE_NAME) + @javax.annotation.Nullable + private String profileName; + + public static final String SERIALIZED_NAME_ABOUT = "About"; + @SerializedName(SERIALIZED_NAME_ABOUT) + @javax.annotation.Nullable + private String about; + + public static final String SERIALIZED_NAME_COMPANY = "Company"; + @SerializedName(SERIALIZED_NAME_COMPANY) + @javax.annotation.Nullable + private String company; + + public static final String SERIALIZED_NAME_IMAGE_URL = "ImageUrl"; + @SerializedName(SERIALIZED_NAME_IMAGE_URL) + @javax.annotation.Nullable + private String imageUrl; + + public static final String SERIALIZED_NAME_TIME_ZONE = "TimeZone"; + @SerializedName(SERIALIZED_NAME_TIME_ZONE) + @javax.annotation.Nullable + private String timeZone; + + public static final String SERIALIZED_NAME_WEBSITE = "Website"; + @SerializedName(SERIALIZED_NAME_WEBSITE) + @javax.annotation.Nullable + private String website; + + public static final String SERIALIZED_NAME_THUMBNAIL_IMAGE_URL = "ThumbnailImageUrl"; + @SerializedName(SERIALIZED_NAME_THUMBNAIL_IMAGE_URL) + @javax.annotation.Nullable + private String thumbnailImageUrl; + + public static final String SERIALIZED_NAME_FAVICON = "Favicon"; + @SerializedName(SERIALIZED_NAME_FAVICON) + @javax.annotation.Nullable + private String favicon; + + public static final String SERIALIZED_NAME_PROFILE_URL = "ProfileUrl"; + @SerializedName(SERIALIZED_NAME_PROFILE_URL) + @javax.annotation.Nullable + private String profileUrl; + + public static final String SERIALIZED_NAME_HOME_TOWN = "HomeTown"; + @SerializedName(SERIALIZED_NAME_HOME_TOWN) + @javax.annotation.Nullable + private String homeTown; + + public static final String SERIALIZED_NAME_STATE = "State"; + @SerializedName(SERIALIZED_NAME_STATE) + @javax.annotation.Nullable + private String state; + + public static final String SERIALIZED_NAME_CITY = "City"; + @SerializedName(SERIALIZED_NAME_CITY) + @javax.annotation.Nullable + private String city; + + public static final String SERIALIZED_NAME_INDUSTRY = "Industry"; + @SerializedName(SERIALIZED_NAME_INDUSTRY) + @javax.annotation.Nullable + private String industry; + + public static final String SERIALIZED_NAME_LOCAL_LANGUAGE = "LocalLanguage"; + @SerializedName(SERIALIZED_NAME_LOCAL_LANGUAGE) + @javax.annotation.Nullable + private String localLanguage; + + public static final String SERIALIZED_NAME_LANGUAGE = "Language"; + @SerializedName(SERIALIZED_NAME_LANGUAGE) + @javax.annotation.Nullable + private String language; + + public static final String SERIALIZED_NAME_COVER_PHOTO = "CoverPhoto"; + @SerializedName(SERIALIZED_NAME_COVER_PHOTO) + @javax.annotation.Nullable + private String coverPhoto; + + public static final String SERIALIZED_NAME_TAG_LINE = "TagLine"; + @SerializedName(SERIALIZED_NAME_TAG_LINE) + @javax.annotation.Nullable + private String tagLine; + + public static final String SERIALIZED_NAME_MAIN_ADDRESS = "MainAddress"; + @SerializedName(SERIALIZED_NAME_MAIN_ADDRESS) + @javax.annotation.Nullable + private String mainAddress; + + public static final String SERIALIZED_NAME_LOCAL_CITY = "LocalCity"; + @SerializedName(SERIALIZED_NAME_LOCAL_CITY) + @javax.annotation.Nullable + private String localCity; + + public static final String SERIALIZED_NAME_PROFILE_CITY = "ProfileCity"; + @SerializedName(SERIALIZED_NAME_PROFILE_CITY) + @javax.annotation.Nullable + private String profileCity; + + public static final String SERIALIZED_NAME_LOCAL_COUNTRY = "LocalCountry"; + @SerializedName(SERIALIZED_NAME_LOCAL_COUNTRY) + @javax.annotation.Nullable + private String localCountry; + + public static final String SERIALIZED_NAME_PROFILE_COUNTRY = "ProfileCountry"; + @SerializedName(SERIALIZED_NAME_PROFILE_COUNTRY) + @javax.annotation.Nullable + private String profileCountry; + + public static final String SERIALIZED_NAME_QUOTA = "Quota"; + @SerializedName(SERIALIZED_NAME_QUOTA) + @javax.annotation.Nullable + private String quota; + + public static final String SERIALIZED_NAME_RELIGION = "Religion"; + @SerializedName(SERIALIZED_NAME_RELIGION) + @javax.annotation.Nullable + private String religion; + + public static final String SERIALIZED_NAME_POLITICAL = "Political"; + @SerializedName(SERIALIZED_NAME_POLITICAL) + @javax.annotation.Nullable + private String political; + + public static final String SERIALIZED_NAME_RELATIONSHIP_STATUS = "RelationshipStatus"; + @SerializedName(SERIALIZED_NAME_RELATIONSHIP_STATUS) + @javax.annotation.Nullable + private String relationshipStatus; + + public static final String SERIALIZED_NAME_HTTPS_IMAGE_URL = "HttpsImageUrl"; + @SerializedName(SERIALIZED_NAME_HTTPS_IMAGE_URL) + @javax.annotation.Nullable + private String httpsImageUrl; + + public static final String SERIALIZED_NAME_IS_GEO_ENABLED = "IsGeoEnabled"; + @SerializedName(SERIALIZED_NAME_IS_GEO_ENABLED) + @javax.annotation.Nullable + private String isGeoEnabled; + + public static final String SERIALIZED_NAME_ASSOCIATIONS = "Associations"; + @SerializedName(SERIALIZED_NAME_ASSOCIATIONS) + @javax.annotation.Nullable + private String associations; + + public static final String SERIALIZED_NAME_HONORS = "Honors"; + @SerializedName(SERIALIZED_NAME_HONORS) + @javax.annotation.Nullable + private String honors; + + public static final String SERIALIZED_NAME_PUBLIC_REPOSITORY = "PublicRepository"; + @SerializedName(SERIALIZED_NAME_PUBLIC_REPOSITORY) + @javax.annotation.Nullable + private String publicRepository; + + public static final String SERIALIZED_NAME_REPOSITORY_URL = "RepositoryUrl"; + @SerializedName(SERIALIZED_NAME_REPOSITORY_URL) + @javax.annotation.Nullable + private String repositoryUrl; + + public static final String SERIALIZED_NAME_PROFESSIONAL_HEADLINE = "ProfessionalHeadline"; + @SerializedName(SERIALIZED_NAME_PROFESSIONAL_HEADLINE) + @javax.annotation.Nullable + private String professionalHeadline; + + public static final String SERIALIZED_NAME_CURRENCY = "Currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + @javax.annotation.Nullable + private String currency; + + public static final String SERIALIZED_NAME_STARRED_URL = "StarredUrl"; + @SerializedName(SERIALIZED_NAME_STARRED_URL) + @javax.annotation.Nullable + private String starredUrl; + + public static final String SERIALIZED_NAME_GISTS_URL = "GistsUrl"; + @SerializedName(SERIALIZED_NAME_GISTS_URL) + @javax.annotation.Nullable + private String gistsUrl; + + public static final String SERIALIZED_NAME_GRAVATAR_IMAGE_URL = "GravatarImageUrl"; + @SerializedName(SERIALIZED_NAME_GRAVATAR_IMAGE_URL) + @javax.annotation.Nullable + private String gravatarImageUrl; + + public static final String SERIALIZED_NAME_EXTERNAL_USER_LOGIN_ID = "ExternalUserLoginId"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_USER_LOGIN_ID) + @javax.annotation.Nullable + private String externalUserLoginId; + + public static final String SERIALIZED_NAME_INTERESTED_IN = "InterestedIn"; + @SerializedName(SERIALIZED_NAME_INTERESTED_IN) + @javax.annotation.Nullable + private List<String> interestedIn = new ArrayList<>(); + + public static final String SERIALIZED_NAME_FOLLOWERS_COUNT = "FollowersCount"; + @SerializedName(SERIALIZED_NAME_FOLLOWERS_COUNT) + @javax.annotation.Nullable + private Integer followersCount; + + public static final String SERIALIZED_NAME_FRIENDS_COUNT = "FriendsCount"; + @SerializedName(SERIALIZED_NAME_FRIENDS_COUNT) + @javax.annotation.Nullable + private Integer friendsCount; + + public static final String SERIALIZED_NAME_TOTAL_STATUSES_COUNT = "TotalStatusesCount"; + @SerializedName(SERIALIZED_NAME_TOTAL_STATUSES_COUNT) + @javax.annotation.Nullable + private Integer totalStatusesCount; + + public static final String SERIALIZED_NAME_NUM_RECOMMENDERS = "NumRecommenders"; + @SerializedName(SERIALIZED_NAME_NUM_RECOMMENDERS) + @javax.annotation.Nullable + private Integer numRecommenders; + + public static final String SERIALIZED_NAME_TOTAL_PRIVATE_REPOSITORY = "TotalPrivateRepository"; + @SerializedName(SERIALIZED_NAME_TOTAL_PRIVATE_REPOSITORY) + @javax.annotation.Nullable + private Integer totalPrivateRepository; + + public static final String SERIALIZED_NAME_PUBLIC_GISTS = "PublicGists"; + @SerializedName(SERIALIZED_NAME_PUBLIC_GISTS) + @javax.annotation.Nullable + private Integer publicGists; + + public static final String SERIALIZED_NAME_PRIVATE_GISTS = "PrivateGists"; + @SerializedName(SERIALIZED_NAME_PRIVATE_GISTS) + @javax.annotation.Nullable + private Integer privateGists; + + public static final String SERIALIZED_NAME_SESSION_LIMIT = "SessionLimit"; + @SerializedName(SERIALIZED_NAME_SESSION_LIMIT) + @javax.annotation.Nullable + private Integer sessionLimit; + + public static final String SERIALIZED_NAME_CUSTOM_FIELDS = "CustomFields"; + @SerializedName(SERIALIZED_NAME_CUSTOM_FIELDS) + @javax.annotation.Nullable + private Map<String, String> customFields = new HashMap<>(); + + public static final String SERIALIZED_NAME_PROFILE_IMAGE_URLS = "ProfileImageUrls"; + @SerializedName(SERIALIZED_NAME_PROFILE_IMAGE_URLS) + @javax.annotation.Nullable + private Map<String, String> profileImageUrls = new HashMap<>(); + + public static final String SERIALIZED_NAME_WEB_PROFILES = "WebProfiles"; + @SerializedName(SERIALIZED_NAME_WEB_PROFILES) + @javax.annotation.Nullable + private Map<String, String> webProfiles = new HashMap<>(); + + public static final String SERIALIZED_NAME_SECURITY_QUESTION_ANSWER = "SecurityQuestionAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_QUESTION_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityQuestionAnswer = new HashMap<>(); + + public static final String SERIALIZED_NAME_COUNTRY = "Country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + @javax.annotation.Nullable + private ProfileRequestModelCountry country; + + public static final String SERIALIZED_NAME_PROVIDER_ACCESS_CREDENTIAL = "ProviderAccessCredential"; + @SerializedName(SERIALIZED_NAME_PROVIDER_ACCESS_CREDENTIAL) + @javax.annotation.Nullable + private ProfileRequestModelProviderAccessCredential providerAccessCredential; + + public static final String SERIALIZED_NAME_SUGGESTIONS = "Suggestions"; + @SerializedName(SERIALIZED_NAME_SUGGESTIONS) + @javax.annotation.Nullable + private ProfileRequestModelSuggestions suggestions; + + public static final String SERIALIZED_NAME_SUBSCRIPTION = "Subscription"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION) + @javax.annotation.Nullable + private ProfileRequestModelSubscription subscription; + + public static final String SERIALIZED_NAME_PRIVACY_POLICY = "PrivacyPolicy"; + @SerializedName(SERIALIZED_NAME_PRIVACY_POLICY) + @javax.annotation.Nullable + private ProfileRequestModelPrivacyPolicy privacyPolicy; + + public static final String SERIALIZED_NAME_PI_N_INFO = "PINInfo"; + @SerializedName(SERIALIZED_NAME_PI_N_INFO) + @javax.annotation.Nullable + private ProfileRequestModelPINInfo piNInfo; + + public static final String SERIALIZED_NAME_ADDRESSES = "Addresses"; + @SerializedName(SERIALIZED_NAME_ADDRESSES) + @javax.annotation.Nullable + private List<ProfileRequestModelAddressesInner> addresses = new ArrayList<>(); + + public static final String SERIALIZED_NAME_POSITIONS = "Positions"; + @SerializedName(SERIALIZED_NAME_POSITIONS) + @javax.annotation.Nullable + private List<ProfileRequestModelPositionsInner> positions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_EDUCATIONS = "Educations"; + @SerializedName(SERIALIZED_NAME_EDUCATIONS) + @javax.annotation.Nullable + private List<ProfileRequestModelEducationsInner> educations = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PHONE_NUMBERS = "PhoneNumbers"; + @SerializedName(SERIALIZED_NAME_PHONE_NUMBERS) + @javax.annotation.Nullable + private List<ProfileRequestModelPhoneNumbersInner> phoneNumbers = new ArrayList<>(); + + public static final String SERIALIZED_NAME_IM_ACCOUNTS = "IMAccounts"; + @SerializedName(SERIALIZED_NAME_IM_ACCOUNTS) + @javax.annotation.Nullable + private List<ProfileRequestModelIMAccountsInner> imAccounts = new ArrayList<>(); + + public static final String SERIALIZED_NAME_INTERESTS = "Interests"; + @SerializedName(SERIALIZED_NAME_INTERESTS) + @javax.annotation.Nullable + private List<ProfileRequestModelInterestsInner> interests = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SPORTS = "Sports"; + @SerializedName(SERIALIZED_NAME_SPORTS) + @javax.annotation.Nullable + private List<ProfileRequestModelSportsInner> sports = new ArrayList<>(); + + public static final String SERIALIZED_NAME_INSPIRATIONAL_PEOPLE = "InspirationalPeople"; + @SerializedName(SERIALIZED_NAME_INSPIRATIONAL_PEOPLE) + @javax.annotation.Nullable + private List<ProfileRequestModelInspirationalPeopleInner> inspirationalPeople = new ArrayList<>(); + + public static final String SERIALIZED_NAME_AWARDS = "Awards"; + @SerializedName(SERIALIZED_NAME_AWARDS) + @javax.annotation.Nullable + private List<ProfileRequestModelAwardsInner> awards = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SKILLS = "Skills"; + @SerializedName(SERIALIZED_NAME_SKILLS) + @javax.annotation.Nullable + private List<ProfileRequestModelSkillsInner> skills = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CURRENT_STATUS = "CurrentStatus"; + @SerializedName(SERIALIZED_NAME_CURRENT_STATUS) + @javax.annotation.Nullable + private List<ProfileRequestModelCurrentStatusInner> currentStatus = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CERTIFICATIONS = "Certifications"; + @SerializedName(SERIALIZED_NAME_CERTIFICATIONS) + @javax.annotation.Nullable + private List<ProfileRequestModelCertificationsInner> certifications = new ArrayList<>(); + + public static final String SERIALIZED_NAME_COURSES = "Courses"; + @SerializedName(SERIALIZED_NAME_COURSES) + @javax.annotation.Nullable + private List<ProfileRequestModelCoursesInner> courses = new ArrayList<>(); + + public static final String SERIALIZED_NAME_VOLUNTEER = "Volunteer"; + @SerializedName(SERIALIZED_NAME_VOLUNTEER) + @javax.annotation.Nullable + private List<ProfileRequestModelVolunteerInner> volunteer = new ArrayList<>(); + + public static final String SERIALIZED_NAME_RECOMMENDATIONS_RECEIVED = "RecommendationsReceived"; + @SerializedName(SERIALIZED_NAME_RECOMMENDATIONS_RECEIVED) + @javax.annotation.Nullable + private List<ProfileRequestModelRecommendationsReceivedInner> recommendationsReceived = new ArrayList<>(); + + public static final String SERIALIZED_NAME_LANGUAGES = "Languages"; + @SerializedName(SERIALIZED_NAME_LANGUAGES) + @javax.annotation.Nullable + private List<ProfileRequestModelLanguagesInner> languages = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PROJECTS = "Projects"; + @SerializedName(SERIALIZED_NAME_PROJECTS) + @javax.annotation.Nullable + private List<ProfileRequestModelProjectsInner> projects = new ArrayList<>(); + + public static final String SERIALIZED_NAME_GAMES = "Games"; + @SerializedName(SERIALIZED_NAME_GAMES) + @javax.annotation.Nullable + private List<ProfileRequestModelGamesInner> games = new ArrayList<>(); + + public static final String SERIALIZED_NAME_FAMILY = "Family"; + @SerializedName(SERIALIZED_NAME_FAMILY) + @javax.annotation.Nullable + private List<ProfileRequestModelFamilyInner> family = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TELE_VISION_SHOW = "TeleVisionShow"; + @SerializedName(SERIALIZED_NAME_TELE_VISION_SHOW) + @javax.annotation.Nullable + private List<ProfileRequestModelTeleVisionShowInner> teleVisionShow = new ArrayList<>(); + + public static final String SERIALIZED_NAME_MUTUAL_FRIENDS = "MutualFriends"; + @SerializedName(SERIALIZED_NAME_MUTUAL_FRIENDS) + @javax.annotation.Nullable + private List<ProfileRequestModelMutualFriendsInner> mutualFriends = new ArrayList<>(); + + public static final String SERIALIZED_NAME_MOVIES = "Movies"; + @SerializedName(SERIALIZED_NAME_MOVIES) + @javax.annotation.Nullable + private List<ProfileRequestModelMoviesInner> movies = new ArrayList<>(); + + public static final String SERIALIZED_NAME_BOOKS = "Books"; + @SerializedName(SERIALIZED_NAME_BOOKS) + @javax.annotation.Nullable + private List<ProfileRequestModelBooksInner> books = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PATENTS = "Patents"; + @SerializedName(SERIALIZED_NAME_PATENTS) + @javax.annotation.Nullable + private List<ProfileRequestModelPatentsInner> patents = new ArrayList<>(); + + public static final String SERIALIZED_NAME_FAVORITE_THINGS = "FavoriteThings"; + @SerializedName(SERIALIZED_NAME_FAVORITE_THINGS) + @javax.annotation.Nullable + private List<ProfileRequestModelFavoriteThingsInner> favoriteThings = new ArrayList<>(); + + public static final String SERIALIZED_NAME_RELATED_PROFILE_VIEWS = "RelatedProfileViews"; + @SerializedName(SERIALIZED_NAME_RELATED_PROFILE_VIEWS) + @javax.annotation.Nullable + private List<ProfileRequestModelRelatedProfileViewsInner> relatedProfileViews = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PLACES_LIVED = "PlacesLived"; + @SerializedName(SERIALIZED_NAME_PLACES_LIVED) + @javax.annotation.Nullable + private List<ProfileRequestModelPlacesLivedInner> placesLived = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PUBLICATIONS = "Publications"; + @SerializedName(SERIALIZED_NAME_PUBLICATIONS) + @javax.annotation.Nullable + private List<ProfileRequestModelPublicationsInner> publications = new ArrayList<>(); + + public static final String SERIALIZED_NAME_JOB_BOOKMARKS = "JobBookmarks"; + @SerializedName(SERIALIZED_NAME_JOB_BOOKMARKS) + @javax.annotation.Nullable + private List<ProfileRequestModelJobBookmarksInner> jobBookmarks = new ArrayList<>(); + + public static final String SERIALIZED_NAME_BADGES = "Badges"; + @SerializedName(SERIALIZED_NAME_BADGES) + @javax.annotation.Nullable + private List<ProfileRequestModelBadgesInner> badges = new ArrayList<>(); + + public static final String SERIALIZED_NAME_MEMBER_URL_RESOURCES = "MemberUrlResources"; + @SerializedName(SERIALIZED_NAME_MEMBER_URL_RESOURCES) + @javax.annotation.Nullable + private List<ProfileRequestModelMemberUrlResourcesInner> memberUrlResources = new ArrayList<>(); + + public static final String SERIALIZED_NAME_EXTERNAL_IDS = "ExternalIds"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_IDS) + @javax.annotation.Nullable + private List<ProfileRequestModelExternalIdsInner> externalIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_IS_EMAIL_SUBSCRIBED = "IsEmailSubscribed"; + @SerializedName(SERIALIZED_NAME_IS_EMAIL_SUBSCRIBED) + @javax.annotation.Nullable + private Boolean isEmailSubscribed; + + public static final String SERIALIZED_NAME_IS_PROTECTED = "IsProtected"; + @SerializedName(SERIALIZED_NAME_IS_PROTECTED) + @javax.annotation.Nullable + private Boolean isProtected; + + public static final String SERIALIZED_NAME_HIREABLE = "Hireable"; + @SerializedName(SERIALIZED_NAME_HIREABLE) + @javax.annotation.Nullable + private Boolean hireable; + + public static final String SERIALIZED_NAME_IS_TWO_FACTOR_AUTHENTICATION_ENABLED = "IsTwoFactorAuthenticationEnabled"; + @SerializedName(SERIALIZED_NAME_IS_TWO_FACTOR_AUTHENTICATION_ENABLED) + @javax.annotation.Nullable + private Boolean isTwoFactorAuthenticationEnabled; + + public static final String SERIALIZED_NAME_DISABLE_LOGIN = "DisableLogin"; + @SerializedName(SERIALIZED_NAME_DISABLE_LOGIN) + @javax.annotation.Nullable + private Boolean disableLogin; + + public static final String SERIALIZED_NAME_ACCEPT_PRIVACY_POLICY = "AcceptPrivacyPolicy"; + @SerializedName(SERIALIZED_NAME_ACCEPT_PRIVACY_POLICY) + @javax.annotation.Nullable + private Boolean acceptPrivacyPolicy; + + public static final String SERIALIZED_NAME_RECAPTCHA_RESPONSE_FIELD = "recaptcha_response_field"; + @SerializedName(SERIALIZED_NAME_RECAPTCHA_RESPONSE_FIELD) + @javax.annotation.Nullable + private String recaptchaResponseField; + + public static final String SERIALIZED_NAME_RECAPTCHA_CHALLENGE_FIELD = "recaptcha_challenge_field"; + @SerializedName(SERIALIZED_NAME_RECAPTCHA_CHALLENGE_FIELD) + @javax.annotation.Nullable + private String recaptchaChallengeField; + + public static final String SERIALIZED_NAME_CAPTCHA_MODEL = "CaptchaModel"; + @SerializedName(SERIALIZED_NAME_CAPTCHA_MODEL) + @javax.annotation.Nullable + private ProfileRequestModelCaptchaModel captchaModel; + + public static final String SERIALIZED_NAME_REGISTRATION_SOURCE = "RegistrationSource"; + @SerializedName(SERIALIZED_NAME_REGISTRATION_SOURCE) + @javax.annotation.Nullable + private String registrationSource; + + 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_CONSENTS = "Consents"; + @SerializedName(SERIALIZED_NAME_CONSENTS) + @javax.annotation.Nullable + private ProfileRequestModelConsents consents; + + public static final String SERIALIZED_NAME_PASSWORD = "Password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nullable + private String password; + + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private List<ProfileRequestModelEmailInner> email = new ArrayList<>(); + + public UpdateAccountByAccessTokenRequest() { + } + + public UpdateAccountByAccessTokenRequest accessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + return this; + } + + /** + * Access Token for authentication + * @return accessToken + */ + @javax.annotation.Nullable + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(@javax.annotation.Nullable String accessToken) { + this.accessToken = accessToken; + } + + + public UpdateAccountByAccessTokenRequest userName(@javax.annotation.Nullable String userName) { + this.userName = userName; + return this; + } + + /** + * Get userName + * @return userName + */ + @javax.annotation.Nullable + public String getUserName() { + return userName; + } + + public void setUserName(@javax.annotation.Nullable String userName) { + this.userName = userName; + } + + + public UpdateAccountByAccessTokenRequest phoneId(@javax.annotation.Nullable String phoneId) { + this.phoneId = phoneId; + return this; + } + + /** + * Get phoneId + * @return phoneId + */ + @javax.annotation.Nullable + public String getPhoneId() { + return phoneId; + } + + public void setPhoneId(@javax.annotation.Nullable String phoneId) { + this.phoneId = phoneId; + } + + + public UpdateAccountByAccessTokenRequest gender(@javax.annotation.Nullable String gender) { + this.gender = gender; + return this; + } + + /** + * Get gender + * @return gender + */ + @javax.annotation.Nullable + public String getGender() { + return gender; + } + + public void setGender(@javax.annotation.Nullable String gender) { + this.gender = gender; + } + + + public UpdateAccountByAccessTokenRequest birthDate(@javax.annotation.Nullable String birthDate) { + this.birthDate = birthDate; + return this; + } + + /** + * Get birthDate + * @return birthDate + */ + @javax.annotation.Nullable + public String getBirthDate() { + return birthDate; + } + + public void setBirthDate(@javax.annotation.Nullable String birthDate) { + this.birthDate = birthDate; + } + + + public UpdateAccountByAccessTokenRequest prefix(@javax.annotation.Nullable String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Get prefix + * @return prefix + */ + @javax.annotation.Nullable + public String getPrefix() { + return prefix; + } + + public void setPrefix(@javax.annotation.Nullable String prefix) { + this.prefix = prefix; + } + + + public UpdateAccountByAccessTokenRequest firstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + */ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + } + + + public UpdateAccountByAccessTokenRequest middleName(@javax.annotation.Nullable String middleName) { + this.middleName = middleName; + return this; + } + + /** + * Get middleName + * @return middleName + */ + @javax.annotation.Nullable + public String getMiddleName() { + return middleName; + } + + public void setMiddleName(@javax.annotation.Nullable String middleName) { + this.middleName = middleName; + } + + + public UpdateAccountByAccessTokenRequest lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + + public UpdateAccountByAccessTokenRequest suffix(@javax.annotation.Nullable String suffix) { + this.suffix = suffix; + return this; + } + + /** + * Get suffix + * @return suffix + */ + @javax.annotation.Nullable + public String getSuffix() { + return suffix; + } + + public void setSuffix(@javax.annotation.Nullable String suffix) { + this.suffix = suffix; + } + + + public UpdateAccountByAccessTokenRequest nickName(@javax.annotation.Nullable String nickName) { + this.nickName = nickName; + return this; + } + + /** + * Get nickName + * @return nickName + */ + @javax.annotation.Nullable + public String getNickName() { + return nickName; + } + + public void setNickName(@javax.annotation.Nullable String nickName) { + this.nickName = nickName; + } + + + public UpdateAccountByAccessTokenRequest profileName(@javax.annotation.Nullable String profileName) { + this.profileName = profileName; + return this; + } + + /** + * Get profileName + * @return profileName + */ + @javax.annotation.Nullable + public String getProfileName() { + return profileName; + } + + public void setProfileName(@javax.annotation.Nullable String profileName) { + this.profileName = profileName; + } + + + public UpdateAccountByAccessTokenRequest about(@javax.annotation.Nullable String about) { + this.about = about; + return this; + } + + /** + * Get about + * @return about + */ + @javax.annotation.Nullable + public String getAbout() { + return about; + } + + public void setAbout(@javax.annotation.Nullable String about) { + this.about = about; + } + + + public UpdateAccountByAccessTokenRequest company(@javax.annotation.Nullable String company) { + this.company = company; + return this; + } + + /** + * Get company + * @return company + */ + @javax.annotation.Nullable + public String getCompany() { + return company; + } + + public void setCompany(@javax.annotation.Nullable String company) { + this.company = company; + } + + + public UpdateAccountByAccessTokenRequest imageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** + * Get imageUrl + * @return imageUrl + */ + @javax.annotation.Nullable + public String getImageUrl() { + return imageUrl; + } + + public void setImageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + } + + + public UpdateAccountByAccessTokenRequest timeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * Get timeZone + * @return timeZone + */ + @javax.annotation.Nullable + public String getTimeZone() { + return timeZone; + } + + public void setTimeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + } + + + public UpdateAccountByAccessTokenRequest website(@javax.annotation.Nullable String website) { + this.website = website; + return this; + } + + /** + * Get website + * @return website + */ + @javax.annotation.Nullable + public String getWebsite() { + return website; + } + + public void setWebsite(@javax.annotation.Nullable String website) { + this.website = website; + } + + + public UpdateAccountByAccessTokenRequest thumbnailImageUrl(@javax.annotation.Nullable String thumbnailImageUrl) { + this.thumbnailImageUrl = thumbnailImageUrl; + return this; + } + + /** + * Get thumbnailImageUrl + * @return thumbnailImageUrl + */ + @javax.annotation.Nullable + public String getThumbnailImageUrl() { + return thumbnailImageUrl; + } + + public void setThumbnailImageUrl(@javax.annotation.Nullable String thumbnailImageUrl) { + this.thumbnailImageUrl = thumbnailImageUrl; + } + + + public UpdateAccountByAccessTokenRequest favicon(@javax.annotation.Nullable String favicon) { + this.favicon = favicon; + return this; + } + + /** + * Get favicon + * @return favicon + */ + @javax.annotation.Nullable + public String getFavicon() { + return favicon; + } + + public void setFavicon(@javax.annotation.Nullable String favicon) { + this.favicon = favicon; + } + + + public UpdateAccountByAccessTokenRequest profileUrl(@javax.annotation.Nullable String profileUrl) { + this.profileUrl = profileUrl; + return this; + } + + /** + * Get profileUrl + * @return profileUrl + */ + @javax.annotation.Nullable + public String getProfileUrl() { + return profileUrl; + } + + public void setProfileUrl(@javax.annotation.Nullable String profileUrl) { + this.profileUrl = profileUrl; + } + + + public UpdateAccountByAccessTokenRequest homeTown(@javax.annotation.Nullable String homeTown) { + this.homeTown = homeTown; + return this; + } + + /** + * Get homeTown + * @return homeTown + */ + @javax.annotation.Nullable + public String getHomeTown() { + return homeTown; + } + + public void setHomeTown(@javax.annotation.Nullable String homeTown) { + this.homeTown = homeTown; + } + + + public UpdateAccountByAccessTokenRequest state(@javax.annotation.Nullable String state) { + this.state = state; + return this; + } + + /** + * Get state + * @return state + */ + @javax.annotation.Nullable + public String getState() { + return state; + } + + public void setState(@javax.annotation.Nullable String state) { + this.state = state; + } + + + public UpdateAccountByAccessTokenRequest city(@javax.annotation.Nullable String city) { + this.city = city; + return this; + } + + /** + * Get city + * @return city + */ + @javax.annotation.Nullable + public String getCity() { + return city; + } + + public void setCity(@javax.annotation.Nullable String city) { + this.city = city; + } + + + public UpdateAccountByAccessTokenRequest industry(@javax.annotation.Nullable String industry) { + this.industry = industry; + return this; + } + + /** + * Get industry + * @return industry + */ + @javax.annotation.Nullable + public String getIndustry() { + return industry; + } + + public void setIndustry(@javax.annotation.Nullable String industry) { + this.industry = industry; + } + + + public UpdateAccountByAccessTokenRequest localLanguage(@javax.annotation.Nullable String localLanguage) { + this.localLanguage = localLanguage; + return this; + } + + /** + * Get localLanguage + * @return localLanguage + */ + @javax.annotation.Nullable + public String getLocalLanguage() { + return localLanguage; + } + + public void setLocalLanguage(@javax.annotation.Nullable String localLanguage) { + this.localLanguage = localLanguage; + } + + + public UpdateAccountByAccessTokenRequest language(@javax.annotation.Nullable String language) { + this.language = language; + return this; + } + + /** + * Get language + * @return language + */ + @javax.annotation.Nullable + public String getLanguage() { + return language; + } + + public void setLanguage(@javax.annotation.Nullable String language) { + this.language = language; + } + + + public UpdateAccountByAccessTokenRequest coverPhoto(@javax.annotation.Nullable String coverPhoto) { + this.coverPhoto = coverPhoto; + return this; + } + + /** + * Get coverPhoto + * @return coverPhoto + */ + @javax.annotation.Nullable + public String getCoverPhoto() { + return coverPhoto; + } + + public void setCoverPhoto(@javax.annotation.Nullable String coverPhoto) { + this.coverPhoto = coverPhoto; + } + + + public UpdateAccountByAccessTokenRequest tagLine(@javax.annotation.Nullable String tagLine) { + this.tagLine = tagLine; + return this; + } + + /** + * Get tagLine + * @return tagLine + */ + @javax.annotation.Nullable + public String getTagLine() { + return tagLine; + } + + public void setTagLine(@javax.annotation.Nullable String tagLine) { + this.tagLine = tagLine; + } + + + public UpdateAccountByAccessTokenRequest mainAddress(@javax.annotation.Nullable String mainAddress) { + this.mainAddress = mainAddress; + return this; + } + + /** + * Get mainAddress + * @return mainAddress + */ + @javax.annotation.Nullable + public String getMainAddress() { + return mainAddress; + } + + public void setMainAddress(@javax.annotation.Nullable String mainAddress) { + this.mainAddress = mainAddress; + } + + + public UpdateAccountByAccessTokenRequest localCity(@javax.annotation.Nullable String localCity) { + this.localCity = localCity; + return this; + } + + /** + * Get localCity + * @return localCity + */ + @javax.annotation.Nullable + public String getLocalCity() { + return localCity; + } + + public void setLocalCity(@javax.annotation.Nullable String localCity) { + this.localCity = localCity; + } + + + public UpdateAccountByAccessTokenRequest profileCity(@javax.annotation.Nullable String profileCity) { + this.profileCity = profileCity; + return this; + } + + /** + * Get profileCity + * @return profileCity + */ + @javax.annotation.Nullable + public String getProfileCity() { + return profileCity; + } + + public void setProfileCity(@javax.annotation.Nullable String profileCity) { + this.profileCity = profileCity; + } + + + public UpdateAccountByAccessTokenRequest localCountry(@javax.annotation.Nullable String localCountry) { + this.localCountry = localCountry; + return this; + } + + /** + * Get localCountry + * @return localCountry + */ + @javax.annotation.Nullable + public String getLocalCountry() { + return localCountry; + } + + public void setLocalCountry(@javax.annotation.Nullable String localCountry) { + this.localCountry = localCountry; + } + + + public UpdateAccountByAccessTokenRequest profileCountry(@javax.annotation.Nullable String profileCountry) { + this.profileCountry = profileCountry; + return this; + } + + /** + * Get profileCountry + * @return profileCountry + */ + @javax.annotation.Nullable + public String getProfileCountry() { + return profileCountry; + } + + public void setProfileCountry(@javax.annotation.Nullable String profileCountry) { + this.profileCountry = profileCountry; + } + + + public UpdateAccountByAccessTokenRequest quota(@javax.annotation.Nullable String quota) { + this.quota = quota; + return this; + } + + /** + * Get quota + * @return quota + */ + @javax.annotation.Nullable + public String getQuota() { + return quota; + } + + public void setQuota(@javax.annotation.Nullable String quota) { + this.quota = quota; + } + + + public UpdateAccountByAccessTokenRequest religion(@javax.annotation.Nullable String religion) { + this.religion = religion; + return this; + } + + /** + * Get religion + * @return religion + */ + @javax.annotation.Nullable + public String getReligion() { + return religion; + } + + public void setReligion(@javax.annotation.Nullable String religion) { + this.religion = religion; + } + + + public UpdateAccountByAccessTokenRequest political(@javax.annotation.Nullable String political) { + this.political = political; + return this; + } + + /** + * Get political + * @return political + */ + @javax.annotation.Nullable + public String getPolitical() { + return political; + } + + public void setPolitical(@javax.annotation.Nullable String political) { + this.political = political; + } + + + public UpdateAccountByAccessTokenRequest relationshipStatus(@javax.annotation.Nullable String relationshipStatus) { + this.relationshipStatus = relationshipStatus; + return this; + } + + /** + * Get relationshipStatus + * @return relationshipStatus + */ + @javax.annotation.Nullable + public String getRelationshipStatus() { + return relationshipStatus; + } + + public void setRelationshipStatus(@javax.annotation.Nullable String relationshipStatus) { + this.relationshipStatus = relationshipStatus; + } + + + public UpdateAccountByAccessTokenRequest httpsImageUrl(@javax.annotation.Nullable String httpsImageUrl) { + this.httpsImageUrl = httpsImageUrl; + return this; + } + + /** + * Get httpsImageUrl + * @return httpsImageUrl + */ + @javax.annotation.Nullable + public String getHttpsImageUrl() { + return httpsImageUrl; + } + + public void setHttpsImageUrl(@javax.annotation.Nullable String httpsImageUrl) { + this.httpsImageUrl = httpsImageUrl; + } + + + public UpdateAccountByAccessTokenRequest isGeoEnabled(@javax.annotation.Nullable String isGeoEnabled) { + this.isGeoEnabled = isGeoEnabled; + return this; + } + + /** + * Get isGeoEnabled + * @return isGeoEnabled + */ + @javax.annotation.Nullable + public String getIsGeoEnabled() { + return isGeoEnabled; + } + + public void setIsGeoEnabled(@javax.annotation.Nullable String isGeoEnabled) { + this.isGeoEnabled = isGeoEnabled; + } + + + public UpdateAccountByAccessTokenRequest associations(@javax.annotation.Nullable String associations) { + this.associations = associations; + return this; + } + + /** + * Get associations + * @return associations + */ + @javax.annotation.Nullable + public String getAssociations() { + return associations; + } + + public void setAssociations(@javax.annotation.Nullable String associations) { + this.associations = associations; + } + + + public UpdateAccountByAccessTokenRequest honors(@javax.annotation.Nullable String honors) { + this.honors = honors; + return this; + } + + /** + * Get honors + * @return honors + */ + @javax.annotation.Nullable + public String getHonors() { + return honors; + } + + public void setHonors(@javax.annotation.Nullable String honors) { + this.honors = honors; + } + + + public UpdateAccountByAccessTokenRequest publicRepository(@javax.annotation.Nullable String publicRepository) { + this.publicRepository = publicRepository; + return this; + } + + /** + * Get publicRepository + * @return publicRepository + */ + @javax.annotation.Nullable + public String getPublicRepository() { + return publicRepository; + } + + public void setPublicRepository(@javax.annotation.Nullable String publicRepository) { + this.publicRepository = publicRepository; + } + + + public UpdateAccountByAccessTokenRequest repositoryUrl(@javax.annotation.Nullable String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + return this; + } + + /** + * Get repositoryUrl + * @return repositoryUrl + */ + @javax.annotation.Nullable + public String getRepositoryUrl() { + return repositoryUrl; + } + + public void setRepositoryUrl(@javax.annotation.Nullable String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + } + + + public UpdateAccountByAccessTokenRequest professionalHeadline(@javax.annotation.Nullable String professionalHeadline) { + this.professionalHeadline = professionalHeadline; + return this; + } + + /** + * Get professionalHeadline + * @return professionalHeadline + */ + @javax.annotation.Nullable + public String getProfessionalHeadline() { + return professionalHeadline; + } + + public void setProfessionalHeadline(@javax.annotation.Nullable String professionalHeadline) { + this.professionalHeadline = professionalHeadline; + } + + + public UpdateAccountByAccessTokenRequest currency(@javax.annotation.Nullable String currency) { + this.currency = currency; + return this; + } + + /** + * Get currency + * @return currency + */ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + public void setCurrency(@javax.annotation.Nullable String currency) { + this.currency = currency; + } + + + public UpdateAccountByAccessTokenRequest starredUrl(@javax.annotation.Nullable String starredUrl) { + this.starredUrl = starredUrl; + return this; + } + + /** + * Get starredUrl + * @return starredUrl + */ + @javax.annotation.Nullable + public String getStarredUrl() { + return starredUrl; + } + + public void setStarredUrl(@javax.annotation.Nullable String starredUrl) { + this.starredUrl = starredUrl; + } + + + public UpdateAccountByAccessTokenRequest gistsUrl(@javax.annotation.Nullable String gistsUrl) { + this.gistsUrl = gistsUrl; + return this; + } + + /** + * Get gistsUrl + * @return gistsUrl + */ + @javax.annotation.Nullable + public String getGistsUrl() { + return gistsUrl; + } + + public void setGistsUrl(@javax.annotation.Nullable String gistsUrl) { + this.gistsUrl = gistsUrl; + } + + + public UpdateAccountByAccessTokenRequest gravatarImageUrl(@javax.annotation.Nullable String gravatarImageUrl) { + this.gravatarImageUrl = gravatarImageUrl; + return this; + } + + /** + * Get gravatarImageUrl + * @return gravatarImageUrl + */ + @javax.annotation.Nullable + public String getGravatarImageUrl() { + return gravatarImageUrl; + } + + public void setGravatarImageUrl(@javax.annotation.Nullable String gravatarImageUrl) { + this.gravatarImageUrl = gravatarImageUrl; + } + + + public UpdateAccountByAccessTokenRequest externalUserLoginId(@javax.annotation.Nullable String externalUserLoginId) { + this.externalUserLoginId = externalUserLoginId; + return this; + } + + /** + * Get externalUserLoginId + * @return externalUserLoginId + */ + @javax.annotation.Nullable + public String getExternalUserLoginId() { + return externalUserLoginId; + } + + public void setExternalUserLoginId(@javax.annotation.Nullable String externalUserLoginId) { + this.externalUserLoginId = externalUserLoginId; + } + + + public UpdateAccountByAccessTokenRequest interestedIn(@javax.annotation.Nullable List<String> interestedIn) { + this.interestedIn = interestedIn; + return this; + } + + public UpdateAccountByAccessTokenRequest addInterestedInItem(String interestedInItem) { + if (this.interestedIn == null) { + this.interestedIn = new ArrayList<>(); + } + this.interestedIn.add(interestedInItem); + return this; + } + + /** + * Get interestedIn + * @return interestedIn + */ + @javax.annotation.Nullable + public List<String> getInterestedIn() { + return interestedIn; + } + + public void setInterestedIn(@javax.annotation.Nullable List<String> interestedIn) { + this.interestedIn = interestedIn; + } + + + public UpdateAccountByAccessTokenRequest followersCount(@javax.annotation.Nullable Integer followersCount) { + this.followersCount = followersCount; + return this; + } + + /** + * Get followersCount + * @return followersCount + */ + @javax.annotation.Nullable + public Integer getFollowersCount() { + return followersCount; + } + + public void setFollowersCount(@javax.annotation.Nullable Integer followersCount) { + this.followersCount = followersCount; + } + + + public UpdateAccountByAccessTokenRequest friendsCount(@javax.annotation.Nullable Integer friendsCount) { + this.friendsCount = friendsCount; + return this; + } + + /** + * Get friendsCount + * @return friendsCount + */ + @javax.annotation.Nullable + public Integer getFriendsCount() { + return friendsCount; + } + + public void setFriendsCount(@javax.annotation.Nullable Integer friendsCount) { + this.friendsCount = friendsCount; + } + + + public UpdateAccountByAccessTokenRequest totalStatusesCount(@javax.annotation.Nullable Integer totalStatusesCount) { + this.totalStatusesCount = totalStatusesCount; + return this; + } + + /** + * Get totalStatusesCount + * @return totalStatusesCount + */ + @javax.annotation.Nullable + public Integer getTotalStatusesCount() { + return totalStatusesCount; + } + + public void setTotalStatusesCount(@javax.annotation.Nullable Integer totalStatusesCount) { + this.totalStatusesCount = totalStatusesCount; + } + + + public UpdateAccountByAccessTokenRequest numRecommenders(@javax.annotation.Nullable Integer numRecommenders) { + this.numRecommenders = numRecommenders; + return this; + } + + /** + * Get numRecommenders + * @return numRecommenders + */ + @javax.annotation.Nullable + public Integer getNumRecommenders() { + return numRecommenders; + } + + public void setNumRecommenders(@javax.annotation.Nullable Integer numRecommenders) { + this.numRecommenders = numRecommenders; + } + + + public UpdateAccountByAccessTokenRequest totalPrivateRepository(@javax.annotation.Nullable Integer totalPrivateRepository) { + this.totalPrivateRepository = totalPrivateRepository; + return this; + } + + /** + * Get totalPrivateRepository + * @return totalPrivateRepository + */ + @javax.annotation.Nullable + public Integer getTotalPrivateRepository() { + return totalPrivateRepository; + } + + public void setTotalPrivateRepository(@javax.annotation.Nullable Integer totalPrivateRepository) { + this.totalPrivateRepository = totalPrivateRepository; + } + + + public UpdateAccountByAccessTokenRequest publicGists(@javax.annotation.Nullable Integer publicGists) { + this.publicGists = publicGists; + return this; + } + + /** + * Get publicGists + * @return publicGists + */ + @javax.annotation.Nullable + public Integer getPublicGists() { + return publicGists; + } + + public void setPublicGists(@javax.annotation.Nullable Integer publicGists) { + this.publicGists = publicGists; + } + + + public UpdateAccountByAccessTokenRequest privateGists(@javax.annotation.Nullable Integer privateGists) { + this.privateGists = privateGists; + return this; + } + + /** + * Get privateGists + * @return privateGists + */ + @javax.annotation.Nullable + public Integer getPrivateGists() { + return privateGists; + } + + public void setPrivateGists(@javax.annotation.Nullable Integer privateGists) { + this.privateGists = privateGists; + } + + + public UpdateAccountByAccessTokenRequest sessionLimit(@javax.annotation.Nullable Integer sessionLimit) { + this.sessionLimit = sessionLimit; + return this; + } + + /** + * Get sessionLimit + * @return sessionLimit + */ + @javax.annotation.Nullable + public Integer getSessionLimit() { + return sessionLimit; + } + + public void setSessionLimit(@javax.annotation.Nullable Integer sessionLimit) { + this.sessionLimit = sessionLimit; + } + + + public UpdateAccountByAccessTokenRequest customFields(@javax.annotation.Nullable Map<String, String> customFields) { + this.customFields = customFields; + return this; + } + + public UpdateAccountByAccessTokenRequest putCustomFieldsItem(String key, String customFieldsItem) { + if (this.customFields == null) { + this.customFields = new HashMap<>(); + } + this.customFields.put(key, customFieldsItem); + return this; + } + + /** + * Get customFields + * @return customFields + */ + @javax.annotation.Nullable + public Map<String, String> getCustomFields() { + return customFields; + } + + public void setCustomFields(@javax.annotation.Nullable Map<String, String> customFields) { + this.customFields = customFields; + } + + + public UpdateAccountByAccessTokenRequest profileImageUrls(@javax.annotation.Nullable Map<String, String> profileImageUrls) { + this.profileImageUrls = profileImageUrls; + return this; + } + + public UpdateAccountByAccessTokenRequest putProfileImageUrlsItem(String key, String profileImageUrlsItem) { + if (this.profileImageUrls == null) { + this.profileImageUrls = new HashMap<>(); + } + this.profileImageUrls.put(key, profileImageUrlsItem); + return this; + } + + /** + * Get profileImageUrls + * @return profileImageUrls + */ + @javax.annotation.Nullable + public Map<String, String> getProfileImageUrls() { + return profileImageUrls; + } + + public void setProfileImageUrls(@javax.annotation.Nullable Map<String, String> profileImageUrls) { + this.profileImageUrls = profileImageUrls; + } + + + public UpdateAccountByAccessTokenRequest webProfiles(@javax.annotation.Nullable Map<String, String> webProfiles) { + this.webProfiles = webProfiles; + return this; + } + + public UpdateAccountByAccessTokenRequest putWebProfilesItem(String key, String webProfilesItem) { + if (this.webProfiles == null) { + this.webProfiles = new HashMap<>(); + } + this.webProfiles.put(key, webProfilesItem); + return this; + } + + /** + * Get webProfiles + * @return webProfiles + */ + @javax.annotation.Nullable + public Map<String, String> getWebProfiles() { + return webProfiles; + } + + public void setWebProfiles(@javax.annotation.Nullable Map<String, String> webProfiles) { + this.webProfiles = webProfiles; + } + + + public UpdateAccountByAccessTokenRequest securityQuestionAnswer(@javax.annotation.Nullable Map<String, String> securityQuestionAnswer) { + this.securityQuestionAnswer = securityQuestionAnswer; + return this; + } + + public UpdateAccountByAccessTokenRequest putSecurityQuestionAnswerItem(String key, String securityQuestionAnswerItem) { + if (this.securityQuestionAnswer == null) { + this.securityQuestionAnswer = new HashMap<>(); + } + this.securityQuestionAnswer.put(key, securityQuestionAnswerItem); + return this; + } + + /** + * Get securityQuestionAnswer + * @return securityQuestionAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityQuestionAnswer() { + return securityQuestionAnswer; + } + + public void setSecurityQuestionAnswer(@javax.annotation.Nullable Map<String, String> securityQuestionAnswer) { + this.securityQuestionAnswer = securityQuestionAnswer; + } + + + public UpdateAccountByAccessTokenRequest country(@javax.annotation.Nullable ProfileRequestModelCountry country) { + this.country = country; + return this; + } + + /** + * Get country + * @return country + */ + @javax.annotation.Nullable + public ProfileRequestModelCountry getCountry() { + return country; + } + + public void setCountry(@javax.annotation.Nullable ProfileRequestModelCountry country) { + this.country = country; + } + + + public UpdateAccountByAccessTokenRequest providerAccessCredential(@javax.annotation.Nullable ProfileRequestModelProviderAccessCredential providerAccessCredential) { + this.providerAccessCredential = providerAccessCredential; + return this; + } + + /** + * Get providerAccessCredential + * @return providerAccessCredential + */ + @javax.annotation.Nullable + public ProfileRequestModelProviderAccessCredential getProviderAccessCredential() { + return providerAccessCredential; + } + + public void setProviderAccessCredential(@javax.annotation.Nullable ProfileRequestModelProviderAccessCredential providerAccessCredential) { + this.providerAccessCredential = providerAccessCredential; + } + + + public UpdateAccountByAccessTokenRequest suggestions(@javax.annotation.Nullable ProfileRequestModelSuggestions suggestions) { + this.suggestions = suggestions; + return this; + } + + /** + * Get suggestions + * @return suggestions + */ + @javax.annotation.Nullable + public ProfileRequestModelSuggestions getSuggestions() { + return suggestions; + } + + public void setSuggestions(@javax.annotation.Nullable ProfileRequestModelSuggestions suggestions) { + this.suggestions = suggestions; + } + + + public UpdateAccountByAccessTokenRequest subscription(@javax.annotation.Nullable ProfileRequestModelSubscription subscription) { + this.subscription = subscription; + return this; + } + + /** + * Get subscription + * @return subscription + */ + @javax.annotation.Nullable + public ProfileRequestModelSubscription getSubscription() { + return subscription; + } + + public void setSubscription(@javax.annotation.Nullable ProfileRequestModelSubscription subscription) { + this.subscription = subscription; + } + + + public UpdateAccountByAccessTokenRequest privacyPolicy(@javax.annotation.Nullable ProfileRequestModelPrivacyPolicy privacyPolicy) { + this.privacyPolicy = privacyPolicy; + return this; + } + + /** + * Get privacyPolicy + * @return privacyPolicy + */ + @javax.annotation.Nullable + public ProfileRequestModelPrivacyPolicy getPrivacyPolicy() { + return privacyPolicy; + } + + public void setPrivacyPolicy(@javax.annotation.Nullable ProfileRequestModelPrivacyPolicy privacyPolicy) { + this.privacyPolicy = privacyPolicy; + } + + + public UpdateAccountByAccessTokenRequest piNInfo(@javax.annotation.Nullable ProfileRequestModelPINInfo piNInfo) { + this.piNInfo = piNInfo; + return this; + } + + /** + * Get piNInfo + * @return piNInfo + */ + @javax.annotation.Nullable + public ProfileRequestModelPINInfo getPiNInfo() { + return piNInfo; + } + + public void setPiNInfo(@javax.annotation.Nullable ProfileRequestModelPINInfo piNInfo) { + this.piNInfo = piNInfo; + } + + + public UpdateAccountByAccessTokenRequest addresses(@javax.annotation.Nullable List<ProfileRequestModelAddressesInner> addresses) { + this.addresses = addresses; + return this; + } + + public UpdateAccountByAccessTokenRequest addAddressesItem(ProfileRequestModelAddressesInner addressesItem) { + if (this.addresses == null) { + this.addresses = new ArrayList<>(); + } + this.addresses.add(addressesItem); + return this; + } + + /** + * Get addresses + * @return addresses + */ + @javax.annotation.Nullable + public List<ProfileRequestModelAddressesInner> getAddresses() { + return addresses; + } + + public void setAddresses(@javax.annotation.Nullable List<ProfileRequestModelAddressesInner> addresses) { + this.addresses = addresses; + } + + + public UpdateAccountByAccessTokenRequest positions(@javax.annotation.Nullable List<ProfileRequestModelPositionsInner> positions) { + this.positions = positions; + return this; + } + + public UpdateAccountByAccessTokenRequest addPositionsItem(ProfileRequestModelPositionsInner positionsItem) { + if (this.positions == null) { + this.positions = new ArrayList<>(); + } + this.positions.add(positionsItem); + return this; + } + + /** + * Get positions + * @return positions + */ + @javax.annotation.Nullable + public List<ProfileRequestModelPositionsInner> getPositions() { + return positions; + } + + public void setPositions(@javax.annotation.Nullable List<ProfileRequestModelPositionsInner> positions) { + this.positions = positions; + } + + + public UpdateAccountByAccessTokenRequest educations(@javax.annotation.Nullable List<ProfileRequestModelEducationsInner> educations) { + this.educations = educations; + return this; + } + + public UpdateAccountByAccessTokenRequest addEducationsItem(ProfileRequestModelEducationsInner educationsItem) { + if (this.educations == null) { + this.educations = new ArrayList<>(); + } + this.educations.add(educationsItem); + return this; + } + + /** + * Get educations + * @return educations + */ + @javax.annotation.Nullable + public List<ProfileRequestModelEducationsInner> getEducations() { + return educations; + } + + public void setEducations(@javax.annotation.Nullable List<ProfileRequestModelEducationsInner> educations) { + this.educations = educations; + } + + + public UpdateAccountByAccessTokenRequest phoneNumbers(@javax.annotation.Nullable List<ProfileRequestModelPhoneNumbersInner> phoneNumbers) { + this.phoneNumbers = phoneNumbers; + return this; + } + + public UpdateAccountByAccessTokenRequest addPhoneNumbersItem(ProfileRequestModelPhoneNumbersInner phoneNumbersItem) { + if (this.phoneNumbers == null) { + this.phoneNumbers = new ArrayList<>(); + } + this.phoneNumbers.add(phoneNumbersItem); + return this; + } + + /** + * Get phoneNumbers + * @return phoneNumbers + */ + @javax.annotation.Nullable + public List<ProfileRequestModelPhoneNumbersInner> getPhoneNumbers() { + return phoneNumbers; + } + + public void setPhoneNumbers(@javax.annotation.Nullable List<ProfileRequestModelPhoneNumbersInner> phoneNumbers) { + this.phoneNumbers = phoneNumbers; + } + + + public UpdateAccountByAccessTokenRequest imAccounts(@javax.annotation.Nullable List<ProfileRequestModelIMAccountsInner> imAccounts) { + this.imAccounts = imAccounts; + return this; + } + + public UpdateAccountByAccessTokenRequest addImAccountsItem(ProfileRequestModelIMAccountsInner imAccountsItem) { + if (this.imAccounts == null) { + this.imAccounts = new ArrayList<>(); + } + this.imAccounts.add(imAccountsItem); + return this; + } + + /** + * Get imAccounts + * @return imAccounts + */ + @javax.annotation.Nullable + public List<ProfileRequestModelIMAccountsInner> getImAccounts() { + return imAccounts; + } + + public void setImAccounts(@javax.annotation.Nullable List<ProfileRequestModelIMAccountsInner> imAccounts) { + this.imAccounts = imAccounts; + } + + + public UpdateAccountByAccessTokenRequest interests(@javax.annotation.Nullable List<ProfileRequestModelInterestsInner> interests) { + this.interests = interests; + return this; + } + + public UpdateAccountByAccessTokenRequest addInterestsItem(ProfileRequestModelInterestsInner interestsItem) { + if (this.interests == null) { + this.interests = new ArrayList<>(); + } + this.interests.add(interestsItem); + return this; + } + + /** + * Get interests + * @return interests + */ + @javax.annotation.Nullable + public List<ProfileRequestModelInterestsInner> getInterests() { + return interests; + } + + public void setInterests(@javax.annotation.Nullable List<ProfileRequestModelInterestsInner> interests) { + this.interests = interests; + } + + + public UpdateAccountByAccessTokenRequest sports(@javax.annotation.Nullable List<ProfileRequestModelSportsInner> sports) { + this.sports = sports; + return this; + } + + public UpdateAccountByAccessTokenRequest addSportsItem(ProfileRequestModelSportsInner sportsItem) { + if (this.sports == null) { + this.sports = new ArrayList<>(); + } + this.sports.add(sportsItem); + return this; + } + + /** + * Get sports + * @return sports + */ + @javax.annotation.Nullable + public List<ProfileRequestModelSportsInner> getSports() { + return sports; + } + + public void setSports(@javax.annotation.Nullable List<ProfileRequestModelSportsInner> sports) { + this.sports = sports; + } + + + public UpdateAccountByAccessTokenRequest inspirationalPeople(@javax.annotation.Nullable List<ProfileRequestModelInspirationalPeopleInner> inspirationalPeople) { + this.inspirationalPeople = inspirationalPeople; + return this; + } + + public UpdateAccountByAccessTokenRequest addInspirationalPeopleItem(ProfileRequestModelInspirationalPeopleInner inspirationalPeopleItem) { + if (this.inspirationalPeople == null) { + this.inspirationalPeople = new ArrayList<>(); + } + this.inspirationalPeople.add(inspirationalPeopleItem); + return this; + } + + /** + * Get inspirationalPeople + * @return inspirationalPeople + */ + @javax.annotation.Nullable + public List<ProfileRequestModelInspirationalPeopleInner> getInspirationalPeople() { + return inspirationalPeople; + } + + public void setInspirationalPeople(@javax.annotation.Nullable List<ProfileRequestModelInspirationalPeopleInner> inspirationalPeople) { + this.inspirationalPeople = inspirationalPeople; + } + + + public UpdateAccountByAccessTokenRequest awards(@javax.annotation.Nullable List<ProfileRequestModelAwardsInner> awards) { + this.awards = awards; + return this; + } + + public UpdateAccountByAccessTokenRequest addAwardsItem(ProfileRequestModelAwardsInner awardsItem) { + if (this.awards == null) { + this.awards = new ArrayList<>(); + } + this.awards.add(awardsItem); + return this; + } + + /** + * Get awards + * @return awards + */ + @javax.annotation.Nullable + public List<ProfileRequestModelAwardsInner> getAwards() { + return awards; + } + + public void setAwards(@javax.annotation.Nullable List<ProfileRequestModelAwardsInner> awards) { + this.awards = awards; + } + + + public UpdateAccountByAccessTokenRequest skills(@javax.annotation.Nullable List<ProfileRequestModelSkillsInner> skills) { + this.skills = skills; + return this; + } + + public UpdateAccountByAccessTokenRequest addSkillsItem(ProfileRequestModelSkillsInner skillsItem) { + if (this.skills == null) { + this.skills = new ArrayList<>(); + } + this.skills.add(skillsItem); + return this; + } + + /** + * Get skills + * @return skills + */ + @javax.annotation.Nullable + public List<ProfileRequestModelSkillsInner> getSkills() { + return skills; + } + + public void setSkills(@javax.annotation.Nullable List<ProfileRequestModelSkillsInner> skills) { + this.skills = skills; + } + + + public UpdateAccountByAccessTokenRequest currentStatus(@javax.annotation.Nullable List<ProfileRequestModelCurrentStatusInner> currentStatus) { + this.currentStatus = currentStatus; + return this; + } + + public UpdateAccountByAccessTokenRequest addCurrentStatusItem(ProfileRequestModelCurrentStatusInner currentStatusItem) { + if (this.currentStatus == null) { + this.currentStatus = new ArrayList<>(); + } + this.currentStatus.add(currentStatusItem); + return this; + } + + /** + * Get currentStatus + * @return currentStatus + */ + @javax.annotation.Nullable + public List<ProfileRequestModelCurrentStatusInner> getCurrentStatus() { + return currentStatus; + } + + public void setCurrentStatus(@javax.annotation.Nullable List<ProfileRequestModelCurrentStatusInner> currentStatus) { + this.currentStatus = currentStatus; + } + + + public UpdateAccountByAccessTokenRequest certifications(@javax.annotation.Nullable List<ProfileRequestModelCertificationsInner> certifications) { + this.certifications = certifications; + return this; + } + + public UpdateAccountByAccessTokenRequest addCertificationsItem(ProfileRequestModelCertificationsInner certificationsItem) { + if (this.certifications == null) { + this.certifications = new ArrayList<>(); + } + this.certifications.add(certificationsItem); + return this; + } + + /** + * Get certifications + * @return certifications + */ + @javax.annotation.Nullable + public List<ProfileRequestModelCertificationsInner> getCertifications() { + return certifications; + } + + public void setCertifications(@javax.annotation.Nullable List<ProfileRequestModelCertificationsInner> certifications) { + this.certifications = certifications; + } + + + public UpdateAccountByAccessTokenRequest courses(@javax.annotation.Nullable List<ProfileRequestModelCoursesInner> courses) { + this.courses = courses; + return this; + } + + public UpdateAccountByAccessTokenRequest addCoursesItem(ProfileRequestModelCoursesInner coursesItem) { + if (this.courses == null) { + this.courses = new ArrayList<>(); + } + this.courses.add(coursesItem); + return this; + } + + /** + * Get courses + * @return courses + */ + @javax.annotation.Nullable + public List<ProfileRequestModelCoursesInner> getCourses() { + return courses; + } + + public void setCourses(@javax.annotation.Nullable List<ProfileRequestModelCoursesInner> courses) { + this.courses = courses; + } + + + public UpdateAccountByAccessTokenRequest volunteer(@javax.annotation.Nullable List<ProfileRequestModelVolunteerInner> volunteer) { + this.volunteer = volunteer; + return this; + } + + public UpdateAccountByAccessTokenRequest addVolunteerItem(ProfileRequestModelVolunteerInner volunteerItem) { + if (this.volunteer == null) { + this.volunteer = new ArrayList<>(); + } + this.volunteer.add(volunteerItem); + return this; + } + + /** + * Get volunteer + * @return volunteer + */ + @javax.annotation.Nullable + public List<ProfileRequestModelVolunteerInner> getVolunteer() { + return volunteer; + } + + public void setVolunteer(@javax.annotation.Nullable List<ProfileRequestModelVolunteerInner> volunteer) { + this.volunteer = volunteer; + } + + + public UpdateAccountByAccessTokenRequest recommendationsReceived(@javax.annotation.Nullable List<ProfileRequestModelRecommendationsReceivedInner> recommendationsReceived) { + this.recommendationsReceived = recommendationsReceived; + return this; + } + + public UpdateAccountByAccessTokenRequest addRecommendationsReceivedItem(ProfileRequestModelRecommendationsReceivedInner recommendationsReceivedItem) { + if (this.recommendationsReceived == null) { + this.recommendationsReceived = new ArrayList<>(); + } + this.recommendationsReceived.add(recommendationsReceivedItem); + return this; + } + + /** + * Get recommendationsReceived + * @return recommendationsReceived + */ + @javax.annotation.Nullable + public List<ProfileRequestModelRecommendationsReceivedInner> getRecommendationsReceived() { + return recommendationsReceived; + } + + public void setRecommendationsReceived(@javax.annotation.Nullable List<ProfileRequestModelRecommendationsReceivedInner> recommendationsReceived) { + this.recommendationsReceived = recommendationsReceived; + } + + + public UpdateAccountByAccessTokenRequest languages(@javax.annotation.Nullable List<ProfileRequestModelLanguagesInner> languages) { + this.languages = languages; + return this; + } + + public UpdateAccountByAccessTokenRequest addLanguagesItem(ProfileRequestModelLanguagesInner languagesItem) { + if (this.languages == null) { + this.languages = new ArrayList<>(); + } + this.languages.add(languagesItem); + return this; + } + + /** + * Get languages + * @return languages + */ + @javax.annotation.Nullable + public List<ProfileRequestModelLanguagesInner> getLanguages() { + return languages; + } + + public void setLanguages(@javax.annotation.Nullable List<ProfileRequestModelLanguagesInner> languages) { + this.languages = languages; + } + + + public UpdateAccountByAccessTokenRequest projects(@javax.annotation.Nullable List<ProfileRequestModelProjectsInner> projects) { + this.projects = projects; + return this; + } + + public UpdateAccountByAccessTokenRequest addProjectsItem(ProfileRequestModelProjectsInner projectsItem) { + if (this.projects == null) { + this.projects = new ArrayList<>(); + } + this.projects.add(projectsItem); + return this; + } + + /** + * Get projects + * @return projects + */ + @javax.annotation.Nullable + public List<ProfileRequestModelProjectsInner> getProjects() { + return projects; + } + + public void setProjects(@javax.annotation.Nullable List<ProfileRequestModelProjectsInner> projects) { + this.projects = projects; + } + + + public UpdateAccountByAccessTokenRequest games(@javax.annotation.Nullable List<ProfileRequestModelGamesInner> games) { + this.games = games; + return this; + } + + public UpdateAccountByAccessTokenRequest addGamesItem(ProfileRequestModelGamesInner gamesItem) { + if (this.games == null) { + this.games = new ArrayList<>(); + } + this.games.add(gamesItem); + return this; + } + + /** + * Get games + * @return games + */ + @javax.annotation.Nullable + public List<ProfileRequestModelGamesInner> getGames() { + return games; + } + + public void setGames(@javax.annotation.Nullable List<ProfileRequestModelGamesInner> games) { + this.games = games; + } + + + public UpdateAccountByAccessTokenRequest family(@javax.annotation.Nullable List<ProfileRequestModelFamilyInner> family) { + this.family = family; + return this; + } + + public UpdateAccountByAccessTokenRequest addFamilyItem(ProfileRequestModelFamilyInner familyItem) { + if (this.family == null) { + this.family = new ArrayList<>(); + } + this.family.add(familyItem); + return this; + } + + /** + * Get family + * @return family + */ + @javax.annotation.Nullable + public List<ProfileRequestModelFamilyInner> getFamily() { + return family; + } + + public void setFamily(@javax.annotation.Nullable List<ProfileRequestModelFamilyInner> family) { + this.family = family; + } + + + public UpdateAccountByAccessTokenRequest teleVisionShow(@javax.annotation.Nullable List<ProfileRequestModelTeleVisionShowInner> teleVisionShow) { + this.teleVisionShow = teleVisionShow; + return this; + } + + public UpdateAccountByAccessTokenRequest addTeleVisionShowItem(ProfileRequestModelTeleVisionShowInner teleVisionShowItem) { + if (this.teleVisionShow == null) { + this.teleVisionShow = new ArrayList<>(); + } + this.teleVisionShow.add(teleVisionShowItem); + return this; + } + + /** + * Get teleVisionShow + * @return teleVisionShow + */ + @javax.annotation.Nullable + public List<ProfileRequestModelTeleVisionShowInner> getTeleVisionShow() { + return teleVisionShow; + } + + public void setTeleVisionShow(@javax.annotation.Nullable List<ProfileRequestModelTeleVisionShowInner> teleVisionShow) { + this.teleVisionShow = teleVisionShow; + } + + + public UpdateAccountByAccessTokenRequest mutualFriends(@javax.annotation.Nullable List<ProfileRequestModelMutualFriendsInner> mutualFriends) { + this.mutualFriends = mutualFriends; + return this; + } + + public UpdateAccountByAccessTokenRequest addMutualFriendsItem(ProfileRequestModelMutualFriendsInner mutualFriendsItem) { + if (this.mutualFriends == null) { + this.mutualFriends = new ArrayList<>(); + } + this.mutualFriends.add(mutualFriendsItem); + return this; + } + + /** + * Get mutualFriends + * @return mutualFriends + */ + @javax.annotation.Nullable + public List<ProfileRequestModelMutualFriendsInner> getMutualFriends() { + return mutualFriends; + } + + public void setMutualFriends(@javax.annotation.Nullable List<ProfileRequestModelMutualFriendsInner> mutualFriends) { + this.mutualFriends = mutualFriends; + } + + + public UpdateAccountByAccessTokenRequest movies(@javax.annotation.Nullable List<ProfileRequestModelMoviesInner> movies) { + this.movies = movies; + return this; + } + + public UpdateAccountByAccessTokenRequest addMoviesItem(ProfileRequestModelMoviesInner moviesItem) { + if (this.movies == null) { + this.movies = new ArrayList<>(); + } + this.movies.add(moviesItem); + return this; + } + + /** + * Get movies + * @return movies + */ + @javax.annotation.Nullable + public List<ProfileRequestModelMoviesInner> getMovies() { + return movies; + } + + public void setMovies(@javax.annotation.Nullable List<ProfileRequestModelMoviesInner> movies) { + this.movies = movies; + } + + + public UpdateAccountByAccessTokenRequest books(@javax.annotation.Nullable List<ProfileRequestModelBooksInner> books) { + this.books = books; + return this; + } + + public UpdateAccountByAccessTokenRequest addBooksItem(ProfileRequestModelBooksInner booksItem) { + if (this.books == null) { + this.books = new ArrayList<>(); + } + this.books.add(booksItem); + return this; + } + + /** + * Get books + * @return books + */ + @javax.annotation.Nullable + public List<ProfileRequestModelBooksInner> getBooks() { + return books; + } + + public void setBooks(@javax.annotation.Nullable List<ProfileRequestModelBooksInner> books) { + this.books = books; + } + + + public UpdateAccountByAccessTokenRequest patents(@javax.annotation.Nullable List<ProfileRequestModelPatentsInner> patents) { + this.patents = patents; + return this; + } + + public UpdateAccountByAccessTokenRequest addPatentsItem(ProfileRequestModelPatentsInner patentsItem) { + if (this.patents == null) { + this.patents = new ArrayList<>(); + } + this.patents.add(patentsItem); + return this; + } + + /** + * Get patents + * @return patents + */ + @javax.annotation.Nullable + public List<ProfileRequestModelPatentsInner> getPatents() { + return patents; + } + + public void setPatents(@javax.annotation.Nullable List<ProfileRequestModelPatentsInner> patents) { + this.patents = patents; + } + + + public UpdateAccountByAccessTokenRequest favoriteThings(@javax.annotation.Nullable List<ProfileRequestModelFavoriteThingsInner> favoriteThings) { + this.favoriteThings = favoriteThings; + return this; + } + + public UpdateAccountByAccessTokenRequest addFavoriteThingsItem(ProfileRequestModelFavoriteThingsInner favoriteThingsItem) { + if (this.favoriteThings == null) { + this.favoriteThings = new ArrayList<>(); + } + this.favoriteThings.add(favoriteThingsItem); + return this; + } + + /** + * Get favoriteThings + * @return favoriteThings + */ + @javax.annotation.Nullable + public List<ProfileRequestModelFavoriteThingsInner> getFavoriteThings() { + return favoriteThings; + } + + public void setFavoriteThings(@javax.annotation.Nullable List<ProfileRequestModelFavoriteThingsInner> favoriteThings) { + this.favoriteThings = favoriteThings; + } + + + public UpdateAccountByAccessTokenRequest relatedProfileViews(@javax.annotation.Nullable List<ProfileRequestModelRelatedProfileViewsInner> relatedProfileViews) { + this.relatedProfileViews = relatedProfileViews; + return this; + } + + public UpdateAccountByAccessTokenRequest addRelatedProfileViewsItem(ProfileRequestModelRelatedProfileViewsInner relatedProfileViewsItem) { + if (this.relatedProfileViews == null) { + this.relatedProfileViews = new ArrayList<>(); + } + this.relatedProfileViews.add(relatedProfileViewsItem); + return this; + } + + /** + * Get relatedProfileViews + * @return relatedProfileViews + */ + @javax.annotation.Nullable + public List<ProfileRequestModelRelatedProfileViewsInner> getRelatedProfileViews() { + return relatedProfileViews; + } + + public void setRelatedProfileViews(@javax.annotation.Nullable List<ProfileRequestModelRelatedProfileViewsInner> relatedProfileViews) { + this.relatedProfileViews = relatedProfileViews; + } + + + public UpdateAccountByAccessTokenRequest placesLived(@javax.annotation.Nullable List<ProfileRequestModelPlacesLivedInner> placesLived) { + this.placesLived = placesLived; + return this; + } + + public UpdateAccountByAccessTokenRequest addPlacesLivedItem(ProfileRequestModelPlacesLivedInner placesLivedItem) { + if (this.placesLived == null) { + this.placesLived = new ArrayList<>(); + } + this.placesLived.add(placesLivedItem); + return this; + } + + /** + * Get placesLived + * @return placesLived + */ + @javax.annotation.Nullable + public List<ProfileRequestModelPlacesLivedInner> getPlacesLived() { + return placesLived; + } + + public void setPlacesLived(@javax.annotation.Nullable List<ProfileRequestModelPlacesLivedInner> placesLived) { + this.placesLived = placesLived; + } + + + public UpdateAccountByAccessTokenRequest publications(@javax.annotation.Nullable List<ProfileRequestModelPublicationsInner> publications) { + this.publications = publications; + return this; + } + + public UpdateAccountByAccessTokenRequest addPublicationsItem(ProfileRequestModelPublicationsInner publicationsItem) { + if (this.publications == null) { + this.publications = new ArrayList<>(); + } + this.publications.add(publicationsItem); + return this; + } + + /** + * Get publications + * @return publications + */ + @javax.annotation.Nullable + public List<ProfileRequestModelPublicationsInner> getPublications() { + return publications; + } + + public void setPublications(@javax.annotation.Nullable List<ProfileRequestModelPublicationsInner> publications) { + this.publications = publications; + } + + + public UpdateAccountByAccessTokenRequest jobBookmarks(@javax.annotation.Nullable List<ProfileRequestModelJobBookmarksInner> jobBookmarks) { + this.jobBookmarks = jobBookmarks; + return this; + } + + public UpdateAccountByAccessTokenRequest addJobBookmarksItem(ProfileRequestModelJobBookmarksInner jobBookmarksItem) { + if (this.jobBookmarks == null) { + this.jobBookmarks = new ArrayList<>(); + } + this.jobBookmarks.add(jobBookmarksItem); + return this; + } + + /** + * Get jobBookmarks + * @return jobBookmarks + */ + @javax.annotation.Nullable + public List<ProfileRequestModelJobBookmarksInner> getJobBookmarks() { + return jobBookmarks; + } + + public void setJobBookmarks(@javax.annotation.Nullable List<ProfileRequestModelJobBookmarksInner> jobBookmarks) { + this.jobBookmarks = jobBookmarks; + } + + + public UpdateAccountByAccessTokenRequest badges(@javax.annotation.Nullable List<ProfileRequestModelBadgesInner> badges) { + this.badges = badges; + return this; + } + + public UpdateAccountByAccessTokenRequest addBadgesItem(ProfileRequestModelBadgesInner badgesItem) { + if (this.badges == null) { + this.badges = new ArrayList<>(); + } + this.badges.add(badgesItem); + return this; + } + + /** + * Get badges + * @return badges + */ + @javax.annotation.Nullable + public List<ProfileRequestModelBadgesInner> getBadges() { + return badges; + } + + public void setBadges(@javax.annotation.Nullable List<ProfileRequestModelBadgesInner> badges) { + this.badges = badges; + } + + + public UpdateAccountByAccessTokenRequest memberUrlResources(@javax.annotation.Nullable List<ProfileRequestModelMemberUrlResourcesInner> memberUrlResources) { + this.memberUrlResources = memberUrlResources; + return this; + } + + public UpdateAccountByAccessTokenRequest addMemberUrlResourcesItem(ProfileRequestModelMemberUrlResourcesInner memberUrlResourcesItem) { + if (this.memberUrlResources == null) { + this.memberUrlResources = new ArrayList<>(); + } + this.memberUrlResources.add(memberUrlResourcesItem); + return this; + } + + /** + * Get memberUrlResources + * @return memberUrlResources + */ + @javax.annotation.Nullable + public List<ProfileRequestModelMemberUrlResourcesInner> getMemberUrlResources() { + return memberUrlResources; + } + + public void setMemberUrlResources(@javax.annotation.Nullable List<ProfileRequestModelMemberUrlResourcesInner> memberUrlResources) { + this.memberUrlResources = memberUrlResources; + } + + + public UpdateAccountByAccessTokenRequest externalIds(@javax.annotation.Nullable List<ProfileRequestModelExternalIdsInner> externalIds) { + this.externalIds = externalIds; + return this; + } + + public UpdateAccountByAccessTokenRequest addExternalIdsItem(ProfileRequestModelExternalIdsInner externalIdsItem) { + if (this.externalIds == null) { + this.externalIds = new ArrayList<>(); + } + this.externalIds.add(externalIdsItem); + return this; + } + + /** + * Get externalIds + * @return externalIds + */ + @javax.annotation.Nullable + public List<ProfileRequestModelExternalIdsInner> getExternalIds() { + return externalIds; + } + + public void setExternalIds(@javax.annotation.Nullable List<ProfileRequestModelExternalIdsInner> externalIds) { + this.externalIds = externalIds; + } + + + public UpdateAccountByAccessTokenRequest isEmailSubscribed(@javax.annotation.Nullable Boolean isEmailSubscribed) { + this.isEmailSubscribed = isEmailSubscribed; + return this; + } + + /** + * Get isEmailSubscribed + * @return isEmailSubscribed + */ + @javax.annotation.Nullable + public Boolean getIsEmailSubscribed() { + return isEmailSubscribed; + } + + public void setIsEmailSubscribed(@javax.annotation.Nullable Boolean isEmailSubscribed) { + this.isEmailSubscribed = isEmailSubscribed; + } + + + public UpdateAccountByAccessTokenRequest isProtected(@javax.annotation.Nullable Boolean isProtected) { + this.isProtected = isProtected; + return this; + } + + /** + * Get isProtected + * @return isProtected + */ + @javax.annotation.Nullable + public Boolean getIsProtected() { + return isProtected; + } + + public void setIsProtected(@javax.annotation.Nullable Boolean isProtected) { + this.isProtected = isProtected; + } + + + public UpdateAccountByAccessTokenRequest hireable(@javax.annotation.Nullable Boolean hireable) { + this.hireable = hireable; + return this; + } + + /** + * Get hireable + * @return hireable + */ + @javax.annotation.Nullable + public Boolean getHireable() { + return hireable; + } + + public void setHireable(@javax.annotation.Nullable Boolean hireable) { + this.hireable = hireable; + } + + + public UpdateAccountByAccessTokenRequest isTwoFactorAuthenticationEnabled(@javax.annotation.Nullable Boolean isTwoFactorAuthenticationEnabled) { + this.isTwoFactorAuthenticationEnabled = isTwoFactorAuthenticationEnabled; + return this; + } + + /** + * Get isTwoFactorAuthenticationEnabled + * @return isTwoFactorAuthenticationEnabled + */ + @javax.annotation.Nullable + public Boolean getIsTwoFactorAuthenticationEnabled() { + return isTwoFactorAuthenticationEnabled; + } + + public void setIsTwoFactorAuthenticationEnabled(@javax.annotation.Nullable Boolean isTwoFactorAuthenticationEnabled) { + this.isTwoFactorAuthenticationEnabled = isTwoFactorAuthenticationEnabled; + } + + + public UpdateAccountByAccessTokenRequest disableLogin(@javax.annotation.Nullable Boolean disableLogin) { + this.disableLogin = disableLogin; + return this; + } + + /** + * Get disableLogin + * @return disableLogin + */ + @javax.annotation.Nullable + public Boolean getDisableLogin() { + return disableLogin; + } + + public void setDisableLogin(@javax.annotation.Nullable Boolean disableLogin) { + this.disableLogin = disableLogin; + } + + + public UpdateAccountByAccessTokenRequest acceptPrivacyPolicy(@javax.annotation.Nullable Boolean acceptPrivacyPolicy) { + this.acceptPrivacyPolicy = acceptPrivacyPolicy; + return this; + } + + /** + * Get acceptPrivacyPolicy + * @return acceptPrivacyPolicy + */ + @javax.annotation.Nullable + public Boolean getAcceptPrivacyPolicy() { + return acceptPrivacyPolicy; + } + + public void setAcceptPrivacyPolicy(@javax.annotation.Nullable Boolean acceptPrivacyPolicy) { + this.acceptPrivacyPolicy = acceptPrivacyPolicy; + } + + + public UpdateAccountByAccessTokenRequest recaptchaResponseField(@javax.annotation.Nullable String recaptchaResponseField) { + this.recaptchaResponseField = recaptchaResponseField; + return this; + } + + /** + * Get recaptchaResponseField + * @return recaptchaResponseField + */ + @javax.annotation.Nullable + public String getRecaptchaResponseField() { + return recaptchaResponseField; + } + + public void setRecaptchaResponseField(@javax.annotation.Nullable String recaptchaResponseField) { + this.recaptchaResponseField = recaptchaResponseField; + } + + + public UpdateAccountByAccessTokenRequest recaptchaChallengeField(@javax.annotation.Nullable String recaptchaChallengeField) { + this.recaptchaChallengeField = recaptchaChallengeField; + return this; + } + + /** + * Get recaptchaChallengeField + * @return recaptchaChallengeField + */ + @javax.annotation.Nullable + public String getRecaptchaChallengeField() { + return recaptchaChallengeField; + } + + public void setRecaptchaChallengeField(@javax.annotation.Nullable String recaptchaChallengeField) { + this.recaptchaChallengeField = recaptchaChallengeField; + } + + + public UpdateAccountByAccessTokenRequest captchaModel(@javax.annotation.Nullable ProfileRequestModelCaptchaModel captchaModel) { + this.captchaModel = captchaModel; + return this; + } + + /** + * Get captchaModel + * @return captchaModel + */ + @javax.annotation.Nullable + public ProfileRequestModelCaptchaModel getCaptchaModel() { + return captchaModel; + } + + public void setCaptchaModel(@javax.annotation.Nullable ProfileRequestModelCaptchaModel captchaModel) { + this.captchaModel = captchaModel; + } + + + public UpdateAccountByAccessTokenRequest registrationSource(@javax.annotation.Nullable String registrationSource) { + this.registrationSource = registrationSource; + return this; + } + + /** + * Get registrationSource + * @return registrationSource + */ + @javax.annotation.Nullable + public String getRegistrationSource() { + return registrationSource; + } + + public void setRegistrationSource(@javax.annotation.Nullable String registrationSource) { + this.registrationSource = registrationSource; + } + + + public UpdateAccountByAccessTokenRequest fullName(@javax.annotation.Nullable String fullName) { + this.fullName = fullName; + return this; + } + + /** + * Get fullName + * @return fullName + */ + @javax.annotation.Nullable + public String getFullName() { + return fullName; + } + + public void setFullName(@javax.annotation.Nullable String fullName) { + this.fullName = fullName; + } + + + public UpdateAccountByAccessTokenRequest consents(@javax.annotation.Nullable ProfileRequestModelConsents consents) { + this.consents = consents; + return this; + } + + /** + * Get consents + * @return consents + */ + @javax.annotation.Nullable + public ProfileRequestModelConsents getConsents() { + return consents; + } + + public void setConsents(@javax.annotation.Nullable ProfileRequestModelConsents consents) { + this.consents = consents; + } + + + public UpdateAccountByAccessTokenRequest password(@javax.annotation.Nullable String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + @javax.annotation.Nullable + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nullable String password) { + this.password = password; + } + + + public UpdateAccountByAccessTokenRequest email(@javax.annotation.Nullable List<ProfileRequestModelEmailInner> email) { + this.email = email; + return this; + } + + public UpdateAccountByAccessTokenRequest addEmailItem(ProfileRequestModelEmailInner emailItem) { + if (this.email == null) { + this.email = new ArrayList<>(); + } + this.email.add(emailItem); + return this; + } + + /** + * Get email + * @return email + */ + @javax.annotation.Nullable + public List<ProfileRequestModelEmailInner> getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable List<ProfileRequestModelEmailInner> email) { + this.email = email; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateAccountByAccessTokenRequest instance itself + */ + public UpdateAccountByAccessTokenRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateAccountByAccessTokenRequest updateAccountByAccessTokenRequest = (UpdateAccountByAccessTokenRequest) o; + return Objects.equals(this.accessToken, updateAccountByAccessTokenRequest.accessToken) && + Objects.equals(this.userName, updateAccountByAccessTokenRequest.userName) && + Objects.equals(this.phoneId, updateAccountByAccessTokenRequest.phoneId) && + Objects.equals(this.gender, updateAccountByAccessTokenRequest.gender) && + Objects.equals(this.birthDate, updateAccountByAccessTokenRequest.birthDate) && + Objects.equals(this.prefix, updateAccountByAccessTokenRequest.prefix) && + Objects.equals(this.firstName, updateAccountByAccessTokenRequest.firstName) && + Objects.equals(this.middleName, updateAccountByAccessTokenRequest.middleName) && + Objects.equals(this.lastName, updateAccountByAccessTokenRequest.lastName) && + Objects.equals(this.suffix, updateAccountByAccessTokenRequest.suffix) && + Objects.equals(this.nickName, updateAccountByAccessTokenRequest.nickName) && + Objects.equals(this.profileName, updateAccountByAccessTokenRequest.profileName) && + Objects.equals(this.about, updateAccountByAccessTokenRequest.about) && + Objects.equals(this.company, updateAccountByAccessTokenRequest.company) && + Objects.equals(this.imageUrl, updateAccountByAccessTokenRequest.imageUrl) && + Objects.equals(this.timeZone, updateAccountByAccessTokenRequest.timeZone) && + Objects.equals(this.website, updateAccountByAccessTokenRequest.website) && + Objects.equals(this.thumbnailImageUrl, updateAccountByAccessTokenRequest.thumbnailImageUrl) && + Objects.equals(this.favicon, updateAccountByAccessTokenRequest.favicon) && + Objects.equals(this.profileUrl, updateAccountByAccessTokenRequest.profileUrl) && + Objects.equals(this.homeTown, updateAccountByAccessTokenRequest.homeTown) && + Objects.equals(this.state, updateAccountByAccessTokenRequest.state) && + Objects.equals(this.city, updateAccountByAccessTokenRequest.city) && + Objects.equals(this.industry, updateAccountByAccessTokenRequest.industry) && + Objects.equals(this.localLanguage, updateAccountByAccessTokenRequest.localLanguage) && + Objects.equals(this.language, updateAccountByAccessTokenRequest.language) && + Objects.equals(this.coverPhoto, updateAccountByAccessTokenRequest.coverPhoto) && + Objects.equals(this.tagLine, updateAccountByAccessTokenRequest.tagLine) && + Objects.equals(this.mainAddress, updateAccountByAccessTokenRequest.mainAddress) && + Objects.equals(this.localCity, updateAccountByAccessTokenRequest.localCity) && + Objects.equals(this.profileCity, updateAccountByAccessTokenRequest.profileCity) && + Objects.equals(this.localCountry, updateAccountByAccessTokenRequest.localCountry) && + Objects.equals(this.profileCountry, updateAccountByAccessTokenRequest.profileCountry) && + Objects.equals(this.quota, updateAccountByAccessTokenRequest.quota) && + Objects.equals(this.religion, updateAccountByAccessTokenRequest.religion) && + Objects.equals(this.political, updateAccountByAccessTokenRequest.political) && + Objects.equals(this.relationshipStatus, updateAccountByAccessTokenRequest.relationshipStatus) && + Objects.equals(this.httpsImageUrl, updateAccountByAccessTokenRequest.httpsImageUrl) && + Objects.equals(this.isGeoEnabled, updateAccountByAccessTokenRequest.isGeoEnabled) && + Objects.equals(this.associations, updateAccountByAccessTokenRequest.associations) && + Objects.equals(this.honors, updateAccountByAccessTokenRequest.honors) && + Objects.equals(this.publicRepository, updateAccountByAccessTokenRequest.publicRepository) && + Objects.equals(this.repositoryUrl, updateAccountByAccessTokenRequest.repositoryUrl) && + Objects.equals(this.professionalHeadline, updateAccountByAccessTokenRequest.professionalHeadline) && + Objects.equals(this.currency, updateAccountByAccessTokenRequest.currency) && + Objects.equals(this.starredUrl, updateAccountByAccessTokenRequest.starredUrl) && + Objects.equals(this.gistsUrl, updateAccountByAccessTokenRequest.gistsUrl) && + Objects.equals(this.gravatarImageUrl, updateAccountByAccessTokenRequest.gravatarImageUrl) && + Objects.equals(this.externalUserLoginId, updateAccountByAccessTokenRequest.externalUserLoginId) && + Objects.equals(this.interestedIn, updateAccountByAccessTokenRequest.interestedIn) && + Objects.equals(this.followersCount, updateAccountByAccessTokenRequest.followersCount) && + Objects.equals(this.friendsCount, updateAccountByAccessTokenRequest.friendsCount) && + Objects.equals(this.totalStatusesCount, updateAccountByAccessTokenRequest.totalStatusesCount) && + Objects.equals(this.numRecommenders, updateAccountByAccessTokenRequest.numRecommenders) && + Objects.equals(this.totalPrivateRepository, updateAccountByAccessTokenRequest.totalPrivateRepository) && + Objects.equals(this.publicGists, updateAccountByAccessTokenRequest.publicGists) && + Objects.equals(this.privateGists, updateAccountByAccessTokenRequest.privateGists) && + Objects.equals(this.sessionLimit, updateAccountByAccessTokenRequest.sessionLimit) && + Objects.equals(this.customFields, updateAccountByAccessTokenRequest.customFields) && + Objects.equals(this.profileImageUrls, updateAccountByAccessTokenRequest.profileImageUrls) && + Objects.equals(this.webProfiles, updateAccountByAccessTokenRequest.webProfiles) && + Objects.equals(this.securityQuestionAnswer, updateAccountByAccessTokenRequest.securityQuestionAnswer) && + Objects.equals(this.country, updateAccountByAccessTokenRequest.country) && + Objects.equals(this.providerAccessCredential, updateAccountByAccessTokenRequest.providerAccessCredential) && + Objects.equals(this.suggestions, updateAccountByAccessTokenRequest.suggestions) && + Objects.equals(this.subscription, updateAccountByAccessTokenRequest.subscription) && + Objects.equals(this.privacyPolicy, updateAccountByAccessTokenRequest.privacyPolicy) && + Objects.equals(this.piNInfo, updateAccountByAccessTokenRequest.piNInfo) && + Objects.equals(this.addresses, updateAccountByAccessTokenRequest.addresses) && + Objects.equals(this.positions, updateAccountByAccessTokenRequest.positions) && + Objects.equals(this.educations, updateAccountByAccessTokenRequest.educations) && + Objects.equals(this.phoneNumbers, updateAccountByAccessTokenRequest.phoneNumbers) && + Objects.equals(this.imAccounts, updateAccountByAccessTokenRequest.imAccounts) && + Objects.equals(this.interests, updateAccountByAccessTokenRequest.interests) && + Objects.equals(this.sports, updateAccountByAccessTokenRequest.sports) && + Objects.equals(this.inspirationalPeople, updateAccountByAccessTokenRequest.inspirationalPeople) && + Objects.equals(this.awards, updateAccountByAccessTokenRequest.awards) && + Objects.equals(this.skills, updateAccountByAccessTokenRequest.skills) && + Objects.equals(this.currentStatus, updateAccountByAccessTokenRequest.currentStatus) && + Objects.equals(this.certifications, updateAccountByAccessTokenRequest.certifications) && + Objects.equals(this.courses, updateAccountByAccessTokenRequest.courses) && + Objects.equals(this.volunteer, updateAccountByAccessTokenRequest.volunteer) && + Objects.equals(this.recommendationsReceived, updateAccountByAccessTokenRequest.recommendationsReceived) && + Objects.equals(this.languages, updateAccountByAccessTokenRequest.languages) && + Objects.equals(this.projects, updateAccountByAccessTokenRequest.projects) && + Objects.equals(this.games, updateAccountByAccessTokenRequest.games) && + Objects.equals(this.family, updateAccountByAccessTokenRequest.family) && + Objects.equals(this.teleVisionShow, updateAccountByAccessTokenRequest.teleVisionShow) && + Objects.equals(this.mutualFriends, updateAccountByAccessTokenRequest.mutualFriends) && + Objects.equals(this.movies, updateAccountByAccessTokenRequest.movies) && + Objects.equals(this.books, updateAccountByAccessTokenRequest.books) && + Objects.equals(this.patents, updateAccountByAccessTokenRequest.patents) && + Objects.equals(this.favoriteThings, updateAccountByAccessTokenRequest.favoriteThings) && + Objects.equals(this.relatedProfileViews, updateAccountByAccessTokenRequest.relatedProfileViews) && + Objects.equals(this.placesLived, updateAccountByAccessTokenRequest.placesLived) && + Objects.equals(this.publications, updateAccountByAccessTokenRequest.publications) && + Objects.equals(this.jobBookmarks, updateAccountByAccessTokenRequest.jobBookmarks) && + Objects.equals(this.badges, updateAccountByAccessTokenRequest.badges) && + Objects.equals(this.memberUrlResources, updateAccountByAccessTokenRequest.memberUrlResources) && + Objects.equals(this.externalIds, updateAccountByAccessTokenRequest.externalIds) && + Objects.equals(this.isEmailSubscribed, updateAccountByAccessTokenRequest.isEmailSubscribed) && + Objects.equals(this.isProtected, updateAccountByAccessTokenRequest.isProtected) && + Objects.equals(this.hireable, updateAccountByAccessTokenRequest.hireable) && + Objects.equals(this.isTwoFactorAuthenticationEnabled, updateAccountByAccessTokenRequest.isTwoFactorAuthenticationEnabled) && + Objects.equals(this.disableLogin, updateAccountByAccessTokenRequest.disableLogin) && + Objects.equals(this.acceptPrivacyPolicy, updateAccountByAccessTokenRequest.acceptPrivacyPolicy) && + Objects.equals(this.recaptchaResponseField, updateAccountByAccessTokenRequest.recaptchaResponseField) && + Objects.equals(this.recaptchaChallengeField, updateAccountByAccessTokenRequest.recaptchaChallengeField) && + Objects.equals(this.captchaModel, updateAccountByAccessTokenRequest.captchaModel) && + Objects.equals(this.registrationSource, updateAccountByAccessTokenRequest.registrationSource) && + Objects.equals(this.fullName, updateAccountByAccessTokenRequest.fullName) && + Objects.equals(this.consents, updateAccountByAccessTokenRequest.consents) && + Objects.equals(this.password, updateAccountByAccessTokenRequest.password) && + Objects.equals(this.email, updateAccountByAccessTokenRequest.email)&& + Objects.equals(this.additionalProperties, updateAccountByAccessTokenRequest.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(accessToken, userName, phoneId, gender, birthDate, prefix, firstName, middleName, lastName, suffix, nickName, profileName, about, company, imageUrl, timeZone, website, thumbnailImageUrl, favicon, profileUrl, homeTown, state, city, industry, localLanguage, language, coverPhoto, tagLine, mainAddress, localCity, profileCity, localCountry, profileCountry, quota, religion, political, relationshipStatus, httpsImageUrl, isGeoEnabled, associations, honors, publicRepository, repositoryUrl, professionalHeadline, currency, starredUrl, gistsUrl, gravatarImageUrl, externalUserLoginId, interestedIn, followersCount, friendsCount, totalStatusesCount, numRecommenders, totalPrivateRepository, publicGists, privateGists, sessionLimit, customFields, profileImageUrls, webProfiles, securityQuestionAnswer, country, providerAccessCredential, suggestions, subscription, privacyPolicy, piNInfo, addresses, positions, educations, phoneNumbers, imAccounts, interests, sports, inspirationalPeople, awards, skills, currentStatus, certifications, courses, volunteer, recommendationsReceived, languages, projects, games, family, teleVisionShow, mutualFriends, movies, books, patents, favoriteThings, relatedProfileViews, placesLived, publications, jobBookmarks, badges, memberUrlResources, externalIds, isEmailSubscribed, isProtected, hireable, isTwoFactorAuthenticationEnabled, disableLogin, acceptPrivacyPolicy, recaptchaResponseField, recaptchaChallengeField, captchaModel, registrationSource, fullName, consents, password, email, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateAccountByAccessTokenRequest {\n"); + sb.append(" accessToken: ").append(toIndentedString(accessToken)).append("\n"); + sb.append(" userName: ").append(toIndentedString(userName)).append("\n"); + sb.append(" phoneId: ").append(toIndentedString(phoneId)).append("\n"); + sb.append(" gender: ").append(toIndentedString(gender)).append("\n"); + sb.append(" birthDate: ").append(toIndentedString(birthDate)).append("\n"); + sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" middleName: ").append(toIndentedString(middleName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" suffix: ").append(toIndentedString(suffix)).append("\n"); + sb.append(" nickName: ").append(toIndentedString(nickName)).append("\n"); + sb.append(" profileName: ").append(toIndentedString(profileName)).append("\n"); + sb.append(" about: ").append(toIndentedString(about)).append("\n"); + sb.append(" company: ").append(toIndentedString(company)).append("\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); + sb.append(" website: ").append(toIndentedString(website)).append("\n"); + sb.append(" thumbnailImageUrl: ").append(toIndentedString(thumbnailImageUrl)).append("\n"); + sb.append(" favicon: ").append(toIndentedString(favicon)).append("\n"); + sb.append(" profileUrl: ").append(toIndentedString(profileUrl)).append("\n"); + sb.append(" homeTown: ").append(toIndentedString(homeTown)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" industry: ").append(toIndentedString(industry)).append("\n"); + sb.append(" localLanguage: ").append(toIndentedString(localLanguage)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" coverPhoto: ").append(toIndentedString(coverPhoto)).append("\n"); + sb.append(" tagLine: ").append(toIndentedString(tagLine)).append("\n"); + sb.append(" mainAddress: ").append(toIndentedString(mainAddress)).append("\n"); + sb.append(" localCity: ").append(toIndentedString(localCity)).append("\n"); + sb.append(" profileCity: ").append(toIndentedString(profileCity)).append("\n"); + sb.append(" localCountry: ").append(toIndentedString(localCountry)).append("\n"); + sb.append(" profileCountry: ").append(toIndentedString(profileCountry)).append("\n"); + sb.append(" quota: ").append(toIndentedString(quota)).append("\n"); + sb.append(" religion: ").append(toIndentedString(religion)).append("\n"); + sb.append(" political: ").append(toIndentedString(political)).append("\n"); + sb.append(" relationshipStatus: ").append(toIndentedString(relationshipStatus)).append("\n"); + sb.append(" httpsImageUrl: ").append(toIndentedString(httpsImageUrl)).append("\n"); + sb.append(" isGeoEnabled: ").append(toIndentedString(isGeoEnabled)).append("\n"); + sb.append(" associations: ").append(toIndentedString(associations)).append("\n"); + sb.append(" honors: ").append(toIndentedString(honors)).append("\n"); + sb.append(" publicRepository: ").append(toIndentedString(publicRepository)).append("\n"); + sb.append(" repositoryUrl: ").append(toIndentedString(repositoryUrl)).append("\n"); + sb.append(" professionalHeadline: ").append(toIndentedString(professionalHeadline)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" starredUrl: ").append(toIndentedString(starredUrl)).append("\n"); + sb.append(" gistsUrl: ").append(toIndentedString(gistsUrl)).append("\n"); + sb.append(" gravatarImageUrl: ").append(toIndentedString(gravatarImageUrl)).append("\n"); + sb.append(" externalUserLoginId: ").append(toIndentedString(externalUserLoginId)).append("\n"); + sb.append(" interestedIn: ").append(toIndentedString(interestedIn)).append("\n"); + sb.append(" followersCount: ").append(toIndentedString(followersCount)).append("\n"); + sb.append(" friendsCount: ").append(toIndentedString(friendsCount)).append("\n"); + sb.append(" totalStatusesCount: ").append(toIndentedString(totalStatusesCount)).append("\n"); + sb.append(" numRecommenders: ").append(toIndentedString(numRecommenders)).append("\n"); + sb.append(" totalPrivateRepository: ").append(toIndentedString(totalPrivateRepository)).append("\n"); + sb.append(" publicGists: ").append(toIndentedString(publicGists)).append("\n"); + sb.append(" privateGists: ").append(toIndentedString(privateGists)).append("\n"); + sb.append(" sessionLimit: ").append(toIndentedString(sessionLimit)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" profileImageUrls: ").append(toIndentedString(profileImageUrls)).append("\n"); + sb.append(" webProfiles: ").append(toIndentedString(webProfiles)).append("\n"); + sb.append(" securityQuestionAnswer: ").append(toIndentedString(securityQuestionAnswer)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" providerAccessCredential: ").append(toIndentedString(providerAccessCredential)).append("\n"); + sb.append(" suggestions: ").append(toIndentedString(suggestions)).append("\n"); + sb.append(" subscription: ").append(toIndentedString(subscription)).append("\n"); + sb.append(" privacyPolicy: ").append(toIndentedString(privacyPolicy)).append("\n"); + sb.append(" piNInfo: ").append(toIndentedString(piNInfo)).append("\n"); + sb.append(" addresses: ").append(toIndentedString(addresses)).append("\n"); + sb.append(" positions: ").append(toIndentedString(positions)).append("\n"); + sb.append(" educations: ").append(toIndentedString(educations)).append("\n"); + sb.append(" phoneNumbers: ").append(toIndentedString(phoneNumbers)).append("\n"); + sb.append(" imAccounts: ").append(toIndentedString(imAccounts)).append("\n"); + sb.append(" interests: ").append(toIndentedString(interests)).append("\n"); + sb.append(" sports: ").append(toIndentedString(sports)).append("\n"); + sb.append(" inspirationalPeople: ").append(toIndentedString(inspirationalPeople)).append("\n"); + sb.append(" awards: ").append(toIndentedString(awards)).append("\n"); + sb.append(" skills: ").append(toIndentedString(skills)).append("\n"); + sb.append(" currentStatus: ").append(toIndentedString(currentStatus)).append("\n"); + sb.append(" certifications: ").append(toIndentedString(certifications)).append("\n"); + sb.append(" courses: ").append(toIndentedString(courses)).append("\n"); + sb.append(" volunteer: ").append(toIndentedString(volunteer)).append("\n"); + sb.append(" recommendationsReceived: ").append(toIndentedString(recommendationsReceived)).append("\n"); + sb.append(" languages: ").append(toIndentedString(languages)).append("\n"); + sb.append(" projects: ").append(toIndentedString(projects)).append("\n"); + sb.append(" games: ").append(toIndentedString(games)).append("\n"); + sb.append(" family: ").append(toIndentedString(family)).append("\n"); + sb.append(" teleVisionShow: ").append(toIndentedString(teleVisionShow)).append("\n"); + sb.append(" mutualFriends: ").append(toIndentedString(mutualFriends)).append("\n"); + sb.append(" movies: ").append(toIndentedString(movies)).append("\n"); + sb.append(" books: ").append(toIndentedString(books)).append("\n"); + sb.append(" patents: ").append(toIndentedString(patents)).append("\n"); + sb.append(" favoriteThings: ").append(toIndentedString(favoriteThings)).append("\n"); + sb.append(" relatedProfileViews: ").append(toIndentedString(relatedProfileViews)).append("\n"); + sb.append(" placesLived: ").append(toIndentedString(placesLived)).append("\n"); + sb.append(" publications: ").append(toIndentedString(publications)).append("\n"); + sb.append(" jobBookmarks: ").append(toIndentedString(jobBookmarks)).append("\n"); + sb.append(" badges: ").append(toIndentedString(badges)).append("\n"); + sb.append(" memberUrlResources: ").append(toIndentedString(memberUrlResources)).append("\n"); + sb.append(" externalIds: ").append(toIndentedString(externalIds)).append("\n"); + sb.append(" isEmailSubscribed: ").append(toIndentedString(isEmailSubscribed)).append("\n"); + sb.append(" isProtected: ").append(toIndentedString(isProtected)).append("\n"); + sb.append(" hireable: ").append(toIndentedString(hireable)).append("\n"); + sb.append(" isTwoFactorAuthenticationEnabled: ").append(toIndentedString(isTwoFactorAuthenticationEnabled)).append("\n"); + sb.append(" disableLogin: ").append(toIndentedString(disableLogin)).append("\n"); + sb.append(" acceptPrivacyPolicy: ").append(toIndentedString(acceptPrivacyPolicy)).append("\n"); + sb.append(" recaptchaResponseField: ").append(toIndentedString(recaptchaResponseField)).append("\n"); + sb.append(" recaptchaChallengeField: ").append(toIndentedString(recaptchaChallengeField)).append("\n"); + sb.append(" captchaModel: ").append(toIndentedString(captchaModel)).append("\n"); + sb.append(" registrationSource: ").append(toIndentedString(registrationSource)).append("\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append(" consents: ").append(toIndentedString(consents)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("access_token"); + openapiFields.add("UserName"); + openapiFields.add("PhoneId"); + openapiFields.add("Gender"); + openapiFields.add("BirthDate"); + openapiFields.add("Prefix"); + openapiFields.add("FirstName"); + openapiFields.add("MiddleName"); + openapiFields.add("LastName"); + openapiFields.add("Suffix"); + openapiFields.add("NickName"); + openapiFields.add("ProfileName"); + openapiFields.add("About"); + openapiFields.add("Company"); + openapiFields.add("ImageUrl"); + openapiFields.add("TimeZone"); + openapiFields.add("Website"); + openapiFields.add("ThumbnailImageUrl"); + openapiFields.add("Favicon"); + openapiFields.add("ProfileUrl"); + openapiFields.add("HomeTown"); + openapiFields.add("State"); + openapiFields.add("City"); + openapiFields.add("Industry"); + openapiFields.add("LocalLanguage"); + openapiFields.add("Language"); + openapiFields.add("CoverPhoto"); + openapiFields.add("TagLine"); + openapiFields.add("MainAddress"); + openapiFields.add("LocalCity"); + openapiFields.add("ProfileCity"); + openapiFields.add("LocalCountry"); + openapiFields.add("ProfileCountry"); + openapiFields.add("Quota"); + openapiFields.add("Religion"); + openapiFields.add("Political"); + openapiFields.add("RelationshipStatus"); + openapiFields.add("HttpsImageUrl"); + openapiFields.add("IsGeoEnabled"); + openapiFields.add("Associations"); + openapiFields.add("Honors"); + openapiFields.add("PublicRepository"); + openapiFields.add("RepositoryUrl"); + openapiFields.add("ProfessionalHeadline"); + openapiFields.add("Currency"); + openapiFields.add("StarredUrl"); + openapiFields.add("GistsUrl"); + openapiFields.add("GravatarImageUrl"); + openapiFields.add("ExternalUserLoginId"); + openapiFields.add("InterestedIn"); + openapiFields.add("FollowersCount"); + openapiFields.add("FriendsCount"); + openapiFields.add("TotalStatusesCount"); + openapiFields.add("NumRecommenders"); + openapiFields.add("TotalPrivateRepository"); + openapiFields.add("PublicGists"); + openapiFields.add("PrivateGists"); + openapiFields.add("SessionLimit"); + openapiFields.add("CustomFields"); + openapiFields.add("ProfileImageUrls"); + openapiFields.add("WebProfiles"); + openapiFields.add("SecurityQuestionAnswer"); + openapiFields.add("Country"); + openapiFields.add("ProviderAccessCredential"); + openapiFields.add("Suggestions"); + openapiFields.add("Subscription"); + openapiFields.add("PrivacyPolicy"); + openapiFields.add("PINInfo"); + openapiFields.add("Addresses"); + openapiFields.add("Positions"); + openapiFields.add("Educations"); + openapiFields.add("PhoneNumbers"); + openapiFields.add("IMAccounts"); + openapiFields.add("Interests"); + openapiFields.add("Sports"); + openapiFields.add("InspirationalPeople"); + openapiFields.add("Awards"); + openapiFields.add("Skills"); + openapiFields.add("CurrentStatus"); + openapiFields.add("Certifications"); + openapiFields.add("Courses"); + openapiFields.add("Volunteer"); + openapiFields.add("RecommendationsReceived"); + openapiFields.add("Languages"); + openapiFields.add("Projects"); + openapiFields.add("Games"); + openapiFields.add("Family"); + openapiFields.add("TeleVisionShow"); + openapiFields.add("MutualFriends"); + openapiFields.add("Movies"); + openapiFields.add("Books"); + openapiFields.add("Patents"); + openapiFields.add("FavoriteThings"); + openapiFields.add("RelatedProfileViews"); + openapiFields.add("PlacesLived"); + openapiFields.add("Publications"); + openapiFields.add("JobBookmarks"); + openapiFields.add("Badges"); + openapiFields.add("MemberUrlResources"); + openapiFields.add("ExternalIds"); + openapiFields.add("IsEmailSubscribed"); + openapiFields.add("IsProtected"); + openapiFields.add("Hireable"); + openapiFields.add("IsTwoFactorAuthenticationEnabled"); + openapiFields.add("DisableLogin"); + openapiFields.add("AcceptPrivacyPolicy"); + openapiFields.add("recaptcha_response_field"); + openapiFields.add("recaptcha_challenge_field"); + openapiFields.add("CaptchaModel"); + openapiFields.add("RegistrationSource"); + openapiFields.add("FullName"); + openapiFields.add("Consents"); + openapiFields.add("Password"); + openapiFields.add("Email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 UpdateAccountByAccessTokenRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateAccountByAccessTokenRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateAccountByAccessTokenRequest is not found in the empty JSON string", UpdateAccountByAccessTokenRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("access_token") != null && !jsonObj.get("access_token").isJsonNull()) && !jsonObj.get("access_token").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `access_token` to be a primitive type in the JSON string but got `%s`", jsonObj.get("access_token").toString())); + } + if ((jsonObj.get("UserName") != null && !jsonObj.get("UserName").isJsonNull()) && !jsonObj.get("UserName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UserName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UserName").toString())); + } + if ((jsonObj.get("PhoneId") != null && !jsonObj.get("PhoneId").isJsonNull()) && !jsonObj.get("PhoneId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PhoneId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PhoneId").toString())); + } + if ((jsonObj.get("Gender") != null && !jsonObj.get("Gender").isJsonNull()) && !jsonObj.get("Gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Gender").toString())); + } + if ((jsonObj.get("BirthDate") != null && !jsonObj.get("BirthDate").isJsonNull()) && !jsonObj.get("BirthDate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `BirthDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BirthDate").toString())); + } + if ((jsonObj.get("Prefix") != null && !jsonObj.get("Prefix").isJsonNull()) && !jsonObj.get("Prefix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Prefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Prefix").toString())); + } + if ((jsonObj.get("FirstName") != null && !jsonObj.get("FirstName").isJsonNull()) && !jsonObj.get("FirstName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FirstName").toString())); + } + if ((jsonObj.get("MiddleName") != null && !jsonObj.get("MiddleName").isJsonNull()) && !jsonObj.get("MiddleName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MiddleName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MiddleName").toString())); + } + if ((jsonObj.get("LastName") != null && !jsonObj.get("LastName").isJsonNull()) && !jsonObj.get("LastName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastName").toString())); + } + if ((jsonObj.get("Suffix") != null && !jsonObj.get("Suffix").isJsonNull()) && !jsonObj.get("Suffix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Suffix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Suffix").toString())); + } + if ((jsonObj.get("NickName") != null && !jsonObj.get("NickName").isJsonNull()) && !jsonObj.get("NickName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NickName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NickName").toString())); + } + if ((jsonObj.get("ProfileName") != null && !jsonObj.get("ProfileName").isJsonNull()) && !jsonObj.get("ProfileName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileName").toString())); + } + if ((jsonObj.get("About") != null && !jsonObj.get("About").isJsonNull()) && !jsonObj.get("About").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `About` to be a primitive type in the JSON string but got `%s`", jsonObj.get("About").toString())); + } + if ((jsonObj.get("Company") != null && !jsonObj.get("Company").isJsonNull()) && !jsonObj.get("Company").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Company` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Company").toString())); + } + if ((jsonObj.get("ImageUrl") != null && !jsonObj.get("ImageUrl").isJsonNull()) && !jsonObj.get("ImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ImageUrl").toString())); + } + if ((jsonObj.get("TimeZone") != null && !jsonObj.get("TimeZone").isJsonNull()) && !jsonObj.get("TimeZone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TimeZone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TimeZone").toString())); + } + if ((jsonObj.get("Website") != null && !jsonObj.get("Website").isJsonNull()) && !jsonObj.get("Website").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Website` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Website").toString())); + } + if ((jsonObj.get("ThumbnailImageUrl") != null && !jsonObj.get("ThumbnailImageUrl").isJsonNull()) && !jsonObj.get("ThumbnailImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ThumbnailImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ThumbnailImageUrl").toString())); + } + if ((jsonObj.get("Favicon") != null && !jsonObj.get("Favicon").isJsonNull()) && !jsonObj.get("Favicon").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Favicon` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Favicon").toString())); + } + if ((jsonObj.get("ProfileUrl") != null && !jsonObj.get("ProfileUrl").isJsonNull()) && !jsonObj.get("ProfileUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileUrl").toString())); + } + if ((jsonObj.get("HomeTown") != null && !jsonObj.get("HomeTown").isJsonNull()) && !jsonObj.get("HomeTown").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HomeTown` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HomeTown").toString())); + } + if ((jsonObj.get("State") != null && !jsonObj.get("State").isJsonNull()) && !jsonObj.get("State").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `State` to be a primitive type in the JSON string but got `%s`", jsonObj.get("State").toString())); + } + if ((jsonObj.get("City") != null && !jsonObj.get("City").isJsonNull()) && !jsonObj.get("City").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `City` to be a primitive type in the JSON string but got `%s`", jsonObj.get("City").toString())); + } + if ((jsonObj.get("Industry") != null && !jsonObj.get("Industry").isJsonNull()) && !jsonObj.get("Industry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Industry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Industry").toString())); + } + if ((jsonObj.get("LocalLanguage") != null && !jsonObj.get("LocalLanguage").isJsonNull()) && !jsonObj.get("LocalLanguage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalLanguage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalLanguage").toString())); + } + if ((jsonObj.get("Language") != null && !jsonObj.get("Language").isJsonNull()) && !jsonObj.get("Language").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Language` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Language").toString())); + } + if ((jsonObj.get("CoverPhoto") != null && !jsonObj.get("CoverPhoto").isJsonNull()) && !jsonObj.get("CoverPhoto").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CoverPhoto` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CoverPhoto").toString())); + } + if ((jsonObj.get("TagLine") != null && !jsonObj.get("TagLine").isJsonNull()) && !jsonObj.get("TagLine").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TagLine` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TagLine").toString())); + } + if ((jsonObj.get("MainAddress") != null && !jsonObj.get("MainAddress").isJsonNull()) && !jsonObj.get("MainAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MainAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MainAddress").toString())); + } + if ((jsonObj.get("LocalCity") != null && !jsonObj.get("LocalCity").isJsonNull()) && !jsonObj.get("LocalCity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalCity").toString())); + } + if ((jsonObj.get("ProfileCity") != null && !jsonObj.get("ProfileCity").isJsonNull()) && !jsonObj.get("ProfileCity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileCity").toString())); + } + if ((jsonObj.get("LocalCountry") != null && !jsonObj.get("LocalCountry").isJsonNull()) && !jsonObj.get("LocalCountry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalCountry").toString())); + } + if ((jsonObj.get("ProfileCountry") != null && !jsonObj.get("ProfileCountry").isJsonNull()) && !jsonObj.get("ProfileCountry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileCountry").toString())); + } + if ((jsonObj.get("Quota") != null && !jsonObj.get("Quota").isJsonNull()) && !jsonObj.get("Quota").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Quota` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Quota").toString())); + } + if ((jsonObj.get("Religion") != null && !jsonObj.get("Religion").isJsonNull()) && !jsonObj.get("Religion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Religion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Religion").toString())); + } + if ((jsonObj.get("Political") != null && !jsonObj.get("Political").isJsonNull()) && !jsonObj.get("Political").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Political` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Political").toString())); + } + if ((jsonObj.get("RelationshipStatus") != null && !jsonObj.get("RelationshipStatus").isJsonNull()) && !jsonObj.get("RelationshipStatus").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RelationshipStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RelationshipStatus").toString())); + } + if ((jsonObj.get("HttpsImageUrl") != null && !jsonObj.get("HttpsImageUrl").isJsonNull()) && !jsonObj.get("HttpsImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HttpsImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HttpsImageUrl").toString())); + } + if ((jsonObj.get("IsGeoEnabled") != null && !jsonObj.get("IsGeoEnabled").isJsonNull()) && !jsonObj.get("IsGeoEnabled").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IsGeoEnabled` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IsGeoEnabled").toString())); + } + if ((jsonObj.get("Associations") != null && !jsonObj.get("Associations").isJsonNull()) && !jsonObj.get("Associations").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Associations` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Associations").toString())); + } + if ((jsonObj.get("Honors") != null && !jsonObj.get("Honors").isJsonNull()) && !jsonObj.get("Honors").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Honors` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Honors").toString())); + } + if ((jsonObj.get("PublicRepository") != null && !jsonObj.get("PublicRepository").isJsonNull()) && !jsonObj.get("PublicRepository").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PublicRepository` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PublicRepository").toString())); + } + if ((jsonObj.get("RepositoryUrl") != null && !jsonObj.get("RepositoryUrl").isJsonNull()) && !jsonObj.get("RepositoryUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RepositoryUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RepositoryUrl").toString())); + } + if ((jsonObj.get("ProfessionalHeadline") != null && !jsonObj.get("ProfessionalHeadline").isJsonNull()) && !jsonObj.get("ProfessionalHeadline").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfessionalHeadline` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfessionalHeadline").toString())); + } + if ((jsonObj.get("Currency") != null && !jsonObj.get("Currency").isJsonNull()) && !jsonObj.get("Currency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Currency").toString())); + } + if ((jsonObj.get("StarredUrl") != null && !jsonObj.get("StarredUrl").isJsonNull()) && !jsonObj.get("StarredUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `StarredUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("StarredUrl").toString())); + } + if ((jsonObj.get("GistsUrl") != null && !jsonObj.get("GistsUrl").isJsonNull()) && !jsonObj.get("GistsUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GistsUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GistsUrl").toString())); + } + if ((jsonObj.get("GravatarImageUrl") != null && !jsonObj.get("GravatarImageUrl").isJsonNull()) && !jsonObj.get("GravatarImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GravatarImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GravatarImageUrl").toString())); + } + if ((jsonObj.get("ExternalUserLoginId") != null && !jsonObj.get("ExternalUserLoginId").isJsonNull()) && !jsonObj.get("ExternalUserLoginId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ExternalUserLoginId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ExternalUserLoginId").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("InterestedIn") != null && !jsonObj.get("InterestedIn").isJsonNull() && !jsonObj.get("InterestedIn").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `InterestedIn` to be an array in the JSON string but got `%s`", jsonObj.get("InterestedIn").toString())); + } + // validate the optional field `Country` + if (jsonObj.get("Country") != null && !jsonObj.get("Country").isJsonNull()) { + ProfileRequestModelCountry.validateJsonElement(jsonObj.get("Country")); + } + // validate the optional field `ProviderAccessCredential` + if (jsonObj.get("ProviderAccessCredential") != null && !jsonObj.get("ProviderAccessCredential").isJsonNull()) { + ProfileRequestModelProviderAccessCredential.validateJsonElement(jsonObj.get("ProviderAccessCredential")); + } + // validate the optional field `Suggestions` + if (jsonObj.get("Suggestions") != null && !jsonObj.get("Suggestions").isJsonNull()) { + ProfileRequestModelSuggestions.validateJsonElement(jsonObj.get("Suggestions")); + } + // validate the optional field `Subscription` + if (jsonObj.get("Subscription") != null && !jsonObj.get("Subscription").isJsonNull()) { + ProfileRequestModelSubscription.validateJsonElement(jsonObj.get("Subscription")); + } + // validate the optional field `PrivacyPolicy` + if (jsonObj.get("PrivacyPolicy") != null && !jsonObj.get("PrivacyPolicy").isJsonNull()) { + ProfileRequestModelPrivacyPolicy.validateJsonElement(jsonObj.get("PrivacyPolicy")); + } + // validate the optional field `PINInfo` + if (jsonObj.get("PINInfo") != null && !jsonObj.get("PINInfo").isJsonNull()) { + ProfileRequestModelPINInfo.validateJsonElement(jsonObj.get("PINInfo")); + } + if (jsonObj.get("Addresses") != null && !jsonObj.get("Addresses").isJsonNull()) { + JsonArray jsonArrayaddresses = jsonObj.getAsJsonArray("Addresses"); + if (jsonArrayaddresses != null) { + // ensure the json data is an array + if (!jsonObj.get("Addresses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Addresses` to be an array in the JSON string but got `%s`", jsonObj.get("Addresses").toString())); + } + + // validate the optional field `Addresses` (array) + for (int i = 0; i < jsonArrayaddresses.size(); i++) { + ProfileRequestModelAddressesInner.validateJsonElement(jsonArrayaddresses.get(i)); + }; + } + } + if (jsonObj.get("Positions") != null && !jsonObj.get("Positions").isJsonNull()) { + JsonArray jsonArraypositions = jsonObj.getAsJsonArray("Positions"); + if (jsonArraypositions != null) { + // ensure the json data is an array + if (!jsonObj.get("Positions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Positions` to be an array in the JSON string but got `%s`", jsonObj.get("Positions").toString())); + } + + // validate the optional field `Positions` (array) + for (int i = 0; i < jsonArraypositions.size(); i++) { + ProfileRequestModelPositionsInner.validateJsonElement(jsonArraypositions.get(i)); + }; + } + } + if (jsonObj.get("Educations") != null && !jsonObj.get("Educations").isJsonNull()) { + JsonArray jsonArrayeducations = jsonObj.getAsJsonArray("Educations"); + if (jsonArrayeducations != null) { + // ensure the json data is an array + if (!jsonObj.get("Educations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Educations` to be an array in the JSON string but got `%s`", jsonObj.get("Educations").toString())); + } + + // validate the optional field `Educations` (array) + for (int i = 0; i < jsonArrayeducations.size(); i++) { + ProfileRequestModelEducationsInner.validateJsonElement(jsonArrayeducations.get(i)); + }; + } + } + if (jsonObj.get("PhoneNumbers") != null && !jsonObj.get("PhoneNumbers").isJsonNull()) { + JsonArray jsonArrayphoneNumbers = jsonObj.getAsJsonArray("PhoneNumbers"); + if (jsonArrayphoneNumbers != null) { + // ensure the json data is an array + if (!jsonObj.get("PhoneNumbers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PhoneNumbers` to be an array in the JSON string but got `%s`", jsonObj.get("PhoneNumbers").toString())); + } + + // validate the optional field `PhoneNumbers` (array) + for (int i = 0; i < jsonArrayphoneNumbers.size(); i++) { + ProfileRequestModelPhoneNumbersInner.validateJsonElement(jsonArrayphoneNumbers.get(i)); + }; + } + } + if (jsonObj.get("IMAccounts") != null && !jsonObj.get("IMAccounts").isJsonNull()) { + JsonArray jsonArrayimAccounts = jsonObj.getAsJsonArray("IMAccounts"); + if (jsonArrayimAccounts != null) { + // ensure the json data is an array + if (!jsonObj.get("IMAccounts").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `IMAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("IMAccounts").toString())); + } + + // validate the optional field `IMAccounts` (array) + for (int i = 0; i < jsonArrayimAccounts.size(); i++) { + ProfileRequestModelIMAccountsInner.validateJsonElement(jsonArrayimAccounts.get(i)); + }; + } + } + if (jsonObj.get("Interests") != null && !jsonObj.get("Interests").isJsonNull()) { + JsonArray jsonArrayinterests = jsonObj.getAsJsonArray("Interests"); + if (jsonArrayinterests != null) { + // ensure the json data is an array + if (!jsonObj.get("Interests").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Interests` to be an array in the JSON string but got `%s`", jsonObj.get("Interests").toString())); + } + + // validate the optional field `Interests` (array) + for (int i = 0; i < jsonArrayinterests.size(); i++) { + ProfileRequestModelInterestsInner.validateJsonElement(jsonArrayinterests.get(i)); + }; + } + } + if (jsonObj.get("Sports") != null && !jsonObj.get("Sports").isJsonNull()) { + JsonArray jsonArraysports = jsonObj.getAsJsonArray("Sports"); + if (jsonArraysports != null) { + // ensure the json data is an array + if (!jsonObj.get("Sports").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Sports` to be an array in the JSON string but got `%s`", jsonObj.get("Sports").toString())); + } + + // validate the optional field `Sports` (array) + for (int i = 0; i < jsonArraysports.size(); i++) { + ProfileRequestModelSportsInner.validateJsonElement(jsonArraysports.get(i)); + }; + } + } + if (jsonObj.get("InspirationalPeople") != null && !jsonObj.get("InspirationalPeople").isJsonNull()) { + JsonArray jsonArrayinspirationalPeople = jsonObj.getAsJsonArray("InspirationalPeople"); + if (jsonArrayinspirationalPeople != null) { + // ensure the json data is an array + if (!jsonObj.get("InspirationalPeople").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `InspirationalPeople` to be an array in the JSON string but got `%s`", jsonObj.get("InspirationalPeople").toString())); + } + + // validate the optional field `InspirationalPeople` (array) + for (int i = 0; i < jsonArrayinspirationalPeople.size(); i++) { + ProfileRequestModelInspirationalPeopleInner.validateJsonElement(jsonArrayinspirationalPeople.get(i)); + }; + } + } + if (jsonObj.get("Awards") != null && !jsonObj.get("Awards").isJsonNull()) { + JsonArray jsonArrayawards = jsonObj.getAsJsonArray("Awards"); + if (jsonArrayawards != null) { + // ensure the json data is an array + if (!jsonObj.get("Awards").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Awards` to be an array in the JSON string but got `%s`", jsonObj.get("Awards").toString())); + } + + // validate the optional field `Awards` (array) + for (int i = 0; i < jsonArrayawards.size(); i++) { + ProfileRequestModelAwardsInner.validateJsonElement(jsonArrayawards.get(i)); + }; + } + } + if (jsonObj.get("Skills") != null && !jsonObj.get("Skills").isJsonNull()) { + JsonArray jsonArrayskills = jsonObj.getAsJsonArray("Skills"); + if (jsonArrayskills != null) { + // ensure the json data is an array + if (!jsonObj.get("Skills").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Skills` to be an array in the JSON string but got `%s`", jsonObj.get("Skills").toString())); + } + + // validate the optional field `Skills` (array) + for (int i = 0; i < jsonArrayskills.size(); i++) { + ProfileRequestModelSkillsInner.validateJsonElement(jsonArrayskills.get(i)); + }; + } + } + if (jsonObj.get("CurrentStatus") != null && !jsonObj.get("CurrentStatus").isJsonNull()) { + JsonArray jsonArraycurrentStatus = jsonObj.getAsJsonArray("CurrentStatus"); + if (jsonArraycurrentStatus != null) { + // ensure the json data is an array + if (!jsonObj.get("CurrentStatus").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `CurrentStatus` to be an array in the JSON string but got `%s`", jsonObj.get("CurrentStatus").toString())); + } + + // validate the optional field `CurrentStatus` (array) + for (int i = 0; i < jsonArraycurrentStatus.size(); i++) { + ProfileRequestModelCurrentStatusInner.validateJsonElement(jsonArraycurrentStatus.get(i)); + }; + } + } + if (jsonObj.get("Certifications") != null && !jsonObj.get("Certifications").isJsonNull()) { + JsonArray jsonArraycertifications = jsonObj.getAsJsonArray("Certifications"); + if (jsonArraycertifications != null) { + // ensure the json data is an array + if (!jsonObj.get("Certifications").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Certifications` to be an array in the JSON string but got `%s`", jsonObj.get("Certifications").toString())); + } + + // validate the optional field `Certifications` (array) + for (int i = 0; i < jsonArraycertifications.size(); i++) { + ProfileRequestModelCertificationsInner.validateJsonElement(jsonArraycertifications.get(i)); + }; + } + } + if (jsonObj.get("Courses") != null && !jsonObj.get("Courses").isJsonNull()) { + JsonArray jsonArraycourses = jsonObj.getAsJsonArray("Courses"); + if (jsonArraycourses != null) { + // ensure the json data is an array + if (!jsonObj.get("Courses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Courses` to be an array in the JSON string but got `%s`", jsonObj.get("Courses").toString())); + } + + // validate the optional field `Courses` (array) + for (int i = 0; i < jsonArraycourses.size(); i++) { + ProfileRequestModelCoursesInner.validateJsonElement(jsonArraycourses.get(i)); + }; + } + } + if (jsonObj.get("Volunteer") != null && !jsonObj.get("Volunteer").isJsonNull()) { + JsonArray jsonArrayvolunteer = jsonObj.getAsJsonArray("Volunteer"); + if (jsonArrayvolunteer != null) { + // ensure the json data is an array + if (!jsonObj.get("Volunteer").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Volunteer` to be an array in the JSON string but got `%s`", jsonObj.get("Volunteer").toString())); + } + + // validate the optional field `Volunteer` (array) + for (int i = 0; i < jsonArrayvolunteer.size(); i++) { + ProfileRequestModelVolunteerInner.validateJsonElement(jsonArrayvolunteer.get(i)); + }; + } + } + if (jsonObj.get("RecommendationsReceived") != null && !jsonObj.get("RecommendationsReceived").isJsonNull()) { + JsonArray jsonArrayrecommendationsReceived = jsonObj.getAsJsonArray("RecommendationsReceived"); + if (jsonArrayrecommendationsReceived != null) { + // ensure the json data is an array + if (!jsonObj.get("RecommendationsReceived").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RecommendationsReceived` to be an array in the JSON string but got `%s`", jsonObj.get("RecommendationsReceived").toString())); + } + + // validate the optional field `RecommendationsReceived` (array) + for (int i = 0; i < jsonArrayrecommendationsReceived.size(); i++) { + ProfileRequestModelRecommendationsReceivedInner.validateJsonElement(jsonArrayrecommendationsReceived.get(i)); + }; + } + } + if (jsonObj.get("Languages") != null && !jsonObj.get("Languages").isJsonNull()) { + JsonArray jsonArraylanguages = jsonObj.getAsJsonArray("Languages"); + if (jsonArraylanguages != null) { + // ensure the json data is an array + if (!jsonObj.get("Languages").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Languages` to be an array in the JSON string but got `%s`", jsonObj.get("Languages").toString())); + } + + // validate the optional field `Languages` (array) + for (int i = 0; i < jsonArraylanguages.size(); i++) { + ProfileRequestModelLanguagesInner.validateJsonElement(jsonArraylanguages.get(i)); + }; + } + } + if (jsonObj.get("Projects") != null && !jsonObj.get("Projects").isJsonNull()) { + JsonArray jsonArrayprojects = jsonObj.getAsJsonArray("Projects"); + if (jsonArrayprojects != null) { + // ensure the json data is an array + if (!jsonObj.get("Projects").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Projects` to be an array in the JSON string but got `%s`", jsonObj.get("Projects").toString())); + } + + // validate the optional field `Projects` (array) + for (int i = 0; i < jsonArrayprojects.size(); i++) { + ProfileRequestModelProjectsInner.validateJsonElement(jsonArrayprojects.get(i)); + }; + } + } + if (jsonObj.get("Games") != null && !jsonObj.get("Games").isJsonNull()) { + JsonArray jsonArraygames = jsonObj.getAsJsonArray("Games"); + if (jsonArraygames != null) { + // ensure the json data is an array + if (!jsonObj.get("Games").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Games` to be an array in the JSON string but got `%s`", jsonObj.get("Games").toString())); + } + + // validate the optional field `Games` (array) + for (int i = 0; i < jsonArraygames.size(); i++) { + ProfileRequestModelGamesInner.validateJsonElement(jsonArraygames.get(i)); + }; + } + } + if (jsonObj.get("Family") != null && !jsonObj.get("Family").isJsonNull()) { + JsonArray jsonArrayfamily = jsonObj.getAsJsonArray("Family"); + if (jsonArrayfamily != null) { + // ensure the json data is an array + if (!jsonObj.get("Family").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Family` to be an array in the JSON string but got `%s`", jsonObj.get("Family").toString())); + } + + // validate the optional field `Family` (array) + for (int i = 0; i < jsonArrayfamily.size(); i++) { + ProfileRequestModelFamilyInner.validateJsonElement(jsonArrayfamily.get(i)); + }; + } + } + if (jsonObj.get("TeleVisionShow") != null && !jsonObj.get("TeleVisionShow").isJsonNull()) { + JsonArray jsonArrayteleVisionShow = jsonObj.getAsJsonArray("TeleVisionShow"); + if (jsonArrayteleVisionShow != null) { + // ensure the json data is an array + if (!jsonObj.get("TeleVisionShow").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `TeleVisionShow` to be an array in the JSON string but got `%s`", jsonObj.get("TeleVisionShow").toString())); + } + + // validate the optional field `TeleVisionShow` (array) + for (int i = 0; i < jsonArrayteleVisionShow.size(); i++) { + ProfileRequestModelTeleVisionShowInner.validateJsonElement(jsonArrayteleVisionShow.get(i)); + }; + } + } + if (jsonObj.get("MutualFriends") != null && !jsonObj.get("MutualFriends").isJsonNull()) { + JsonArray jsonArraymutualFriends = jsonObj.getAsJsonArray("MutualFriends"); + if (jsonArraymutualFriends != null) { + // ensure the json data is an array + if (!jsonObj.get("MutualFriends").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `MutualFriends` to be an array in the JSON string but got `%s`", jsonObj.get("MutualFriends").toString())); + } + + // validate the optional field `MutualFriends` (array) + for (int i = 0; i < jsonArraymutualFriends.size(); i++) { + ProfileRequestModelMutualFriendsInner.validateJsonElement(jsonArraymutualFriends.get(i)); + }; + } + } + if (jsonObj.get("Movies") != null && !jsonObj.get("Movies").isJsonNull()) { + JsonArray jsonArraymovies = jsonObj.getAsJsonArray("Movies"); + if (jsonArraymovies != null) { + // ensure the json data is an array + if (!jsonObj.get("Movies").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Movies` to be an array in the JSON string but got `%s`", jsonObj.get("Movies").toString())); + } + + // validate the optional field `Movies` (array) + for (int i = 0; i < jsonArraymovies.size(); i++) { + ProfileRequestModelMoviesInner.validateJsonElement(jsonArraymovies.get(i)); + }; + } + } + if (jsonObj.get("Books") != null && !jsonObj.get("Books").isJsonNull()) { + JsonArray jsonArraybooks = jsonObj.getAsJsonArray("Books"); + if (jsonArraybooks != null) { + // ensure the json data is an array + if (!jsonObj.get("Books").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Books` to be an array in the JSON string but got `%s`", jsonObj.get("Books").toString())); + } + + // validate the optional field `Books` (array) + for (int i = 0; i < jsonArraybooks.size(); i++) { + ProfileRequestModelBooksInner.validateJsonElement(jsonArraybooks.get(i)); + }; + } + } + if (jsonObj.get("Patents") != null && !jsonObj.get("Patents").isJsonNull()) { + JsonArray jsonArraypatents = jsonObj.getAsJsonArray("Patents"); + if (jsonArraypatents != null) { + // ensure the json data is an array + if (!jsonObj.get("Patents").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Patents` to be an array in the JSON string but got `%s`", jsonObj.get("Patents").toString())); + } + + // validate the optional field `Patents` (array) + for (int i = 0; i < jsonArraypatents.size(); i++) { + ProfileRequestModelPatentsInner.validateJsonElement(jsonArraypatents.get(i)); + }; + } + } + if (jsonObj.get("FavoriteThings") != null && !jsonObj.get("FavoriteThings").isJsonNull()) { + JsonArray jsonArrayfavoriteThings = jsonObj.getAsJsonArray("FavoriteThings"); + if (jsonArrayfavoriteThings != null) { + // ensure the json data is an array + if (!jsonObj.get("FavoriteThings").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `FavoriteThings` to be an array in the JSON string but got `%s`", jsonObj.get("FavoriteThings").toString())); + } + + // validate the optional field `FavoriteThings` (array) + for (int i = 0; i < jsonArrayfavoriteThings.size(); i++) { + ProfileRequestModelFavoriteThingsInner.validateJsonElement(jsonArrayfavoriteThings.get(i)); + }; + } + } + if (jsonObj.get("RelatedProfileViews") != null && !jsonObj.get("RelatedProfileViews").isJsonNull()) { + JsonArray jsonArrayrelatedProfileViews = jsonObj.getAsJsonArray("RelatedProfileViews"); + if (jsonArrayrelatedProfileViews != null) { + // ensure the json data is an array + if (!jsonObj.get("RelatedProfileViews").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RelatedProfileViews` to be an array in the JSON string but got `%s`", jsonObj.get("RelatedProfileViews").toString())); + } + + // validate the optional field `RelatedProfileViews` (array) + for (int i = 0; i < jsonArrayrelatedProfileViews.size(); i++) { + ProfileRequestModelRelatedProfileViewsInner.validateJsonElement(jsonArrayrelatedProfileViews.get(i)); + }; + } + } + if (jsonObj.get("PlacesLived") != null && !jsonObj.get("PlacesLived").isJsonNull()) { + JsonArray jsonArrayplacesLived = jsonObj.getAsJsonArray("PlacesLived"); + if (jsonArrayplacesLived != null) { + // ensure the json data is an array + if (!jsonObj.get("PlacesLived").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PlacesLived` to be an array in the JSON string but got `%s`", jsonObj.get("PlacesLived").toString())); + } + + // validate the optional field `PlacesLived` (array) + for (int i = 0; i < jsonArrayplacesLived.size(); i++) { + ProfileRequestModelPlacesLivedInner.validateJsonElement(jsonArrayplacesLived.get(i)); + }; + } + } + if (jsonObj.get("Publications") != null && !jsonObj.get("Publications").isJsonNull()) { + JsonArray jsonArraypublications = jsonObj.getAsJsonArray("Publications"); + if (jsonArraypublications != null) { + // ensure the json data is an array + if (!jsonObj.get("Publications").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Publications` to be an array in the JSON string but got `%s`", jsonObj.get("Publications").toString())); + } + + // validate the optional field `Publications` (array) + for (int i = 0; i < jsonArraypublications.size(); i++) { + ProfileRequestModelPublicationsInner.validateJsonElement(jsonArraypublications.get(i)); + }; + } + } + if (jsonObj.get("JobBookmarks") != null && !jsonObj.get("JobBookmarks").isJsonNull()) { + JsonArray jsonArrayjobBookmarks = jsonObj.getAsJsonArray("JobBookmarks"); + if (jsonArrayjobBookmarks != null) { + // ensure the json data is an array + if (!jsonObj.get("JobBookmarks").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `JobBookmarks` to be an array in the JSON string but got `%s`", jsonObj.get("JobBookmarks").toString())); + } + + // validate the optional field `JobBookmarks` (array) + for (int i = 0; i < jsonArrayjobBookmarks.size(); i++) { + ProfileRequestModelJobBookmarksInner.validateJsonElement(jsonArrayjobBookmarks.get(i)); + }; + } + } + if (jsonObj.get("Badges") != null && !jsonObj.get("Badges").isJsonNull()) { + JsonArray jsonArraybadges = jsonObj.getAsJsonArray("Badges"); + if (jsonArraybadges != null) { + // ensure the json data is an array + if (!jsonObj.get("Badges").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Badges` to be an array in the JSON string but got `%s`", jsonObj.get("Badges").toString())); + } + + // validate the optional field `Badges` (array) + for (int i = 0; i < jsonArraybadges.size(); i++) { + ProfileRequestModelBadgesInner.validateJsonElement(jsonArraybadges.get(i)); + }; + } + } + if (jsonObj.get("MemberUrlResources") != null && !jsonObj.get("MemberUrlResources").isJsonNull()) { + JsonArray jsonArraymemberUrlResources = jsonObj.getAsJsonArray("MemberUrlResources"); + if (jsonArraymemberUrlResources != null) { + // ensure the json data is an array + if (!jsonObj.get("MemberUrlResources").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `MemberUrlResources` to be an array in the JSON string but got `%s`", jsonObj.get("MemberUrlResources").toString())); + } + + // validate the optional field `MemberUrlResources` (array) + for (int i = 0; i < jsonArraymemberUrlResources.size(); i++) { + ProfileRequestModelMemberUrlResourcesInner.validateJsonElement(jsonArraymemberUrlResources.get(i)); + }; + } + } + if (jsonObj.get("ExternalIds") != null && !jsonObj.get("ExternalIds").isJsonNull()) { + JsonArray jsonArrayexternalIds = jsonObj.getAsJsonArray("ExternalIds"); + if (jsonArrayexternalIds != null) { + // ensure the json data is an array + if (!jsonObj.get("ExternalIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ExternalIds` to be an array in the JSON string but got `%s`", jsonObj.get("ExternalIds").toString())); + } + + // validate the optional field `ExternalIds` (array) + for (int i = 0; i < jsonArrayexternalIds.size(); i++) { + ProfileRequestModelExternalIdsInner.validateJsonElement(jsonArrayexternalIds.get(i)); + }; + } + } + if ((jsonObj.get("recaptcha_response_field") != null && !jsonObj.get("recaptcha_response_field").isJsonNull()) && !jsonObj.get("recaptcha_response_field").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recaptcha_response_field` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recaptcha_response_field").toString())); + } + if ((jsonObj.get("recaptcha_challenge_field") != null && !jsonObj.get("recaptcha_challenge_field").isJsonNull()) && !jsonObj.get("recaptcha_challenge_field").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recaptcha_challenge_field` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recaptcha_challenge_field").toString())); + } + // validate the optional field `CaptchaModel` + if (jsonObj.get("CaptchaModel") != null && !jsonObj.get("CaptchaModel").isJsonNull()) { + ProfileRequestModelCaptchaModel.validateJsonElement(jsonObj.get("CaptchaModel")); + } + if ((jsonObj.get("RegistrationSource") != null && !jsonObj.get("RegistrationSource").isJsonNull()) && !jsonObj.get("RegistrationSource").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RegistrationSource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RegistrationSource").toString())); + } + if ((jsonObj.get("FullName") != null && !jsonObj.get("FullName").isJsonNull()) && !jsonObj.get("FullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FullName").toString())); + } + // validate the optional field `Consents` + if (jsonObj.get("Consents") != null && !jsonObj.get("Consents").isJsonNull()) { + ProfileRequestModelConsents.validateJsonElement(jsonObj.get("Consents")); + } + if ((jsonObj.get("Password") != null && !jsonObj.get("Password").isJsonNull()) && !jsonObj.get("Password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Password").toString())); + } + if (jsonObj.get("Email") != null && !jsonObj.get("Email").isJsonNull()) { + JsonArray jsonArrayemail = jsonObj.getAsJsonArray("Email"); + if (jsonArrayemail != null) { + // ensure the json data is an array + if (!jsonObj.get("Email").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Email` to be an array in the JSON string but got `%s`", jsonObj.get("Email").toString())); + } + + // validate the optional field `Email` (array) + for (int i = 0; i < jsonArrayemail.size(); i++) { + ProfileRequestModelEmailInner.validateJsonElement(jsonArrayemail.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UpdateAccountByAccessTokenRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateAccountByAccessTokenRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<UpdateAccountByAccessTokenRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateAccountByAccessTokenRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<UpdateAccountByAccessTokenRequest>() { + @Override + public void write(JsonWriter out, UpdateAccountByAccessTokenRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateAccountByAccessTokenRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateAccountByAccessTokenRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateAccountByAccessTokenRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateAccountByAccessTokenRequest + * @throws IOException if the JSON string is invalid with respect to UpdateAccountByAccessTokenRequest + */ + public static UpdateAccountByAccessTokenRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateAccountByAccessTokenRequest.class); + } + + /** + * Convert an instance of UpdateAccountByAccessTokenRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UpdateByTokenResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UpdateByTokenResponse.java new file mode 100644 index 0000000..7312b41 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UpdateByTokenResponse.java @@ -0,0 +1,316 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.IdentityResponseWithSocialWithoutLogins; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * UpdateByTokenResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UpdateByTokenResponse { + public static final String SERIALIZED_NAME_IS_POSTED = "IsPosted"; + @SerializedName(SERIALIZED_NAME_IS_POSTED) + @javax.annotation.Nullable + private Boolean isPosted; + + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private IdentityResponseWithSocialWithoutLogins data; + + public UpdateByTokenResponse() { + } + + public UpdateByTokenResponse isPosted(@javax.annotation.Nullable Boolean isPosted) { + this.isPosted = isPosted; + return this; + } + + /** + * Get isPosted + * @return isPosted + */ + @javax.annotation.Nullable + public Boolean getIsPosted() { + return isPosted; + } + + public void setIsPosted(@javax.annotation.Nullable Boolean isPosted) { + this.isPosted = isPosted; + } + + + public UpdateByTokenResponse data(@javax.annotation.Nullable IdentityResponseWithSocialWithoutLogins data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public IdentityResponseWithSocialWithoutLogins getData() { + return data; + } + + public void setData(@javax.annotation.Nullable IdentityResponseWithSocialWithoutLogins data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateByTokenResponse instance itself + */ + public UpdateByTokenResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateByTokenResponse updateByTokenResponse = (UpdateByTokenResponse) o; + return Objects.equals(this.isPosted, updateByTokenResponse.isPosted) && + Objects.equals(this.data, updateByTokenResponse.data)&& + Objects.equals(this.additionalProperties, updateByTokenResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isPosted, data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateByTokenResponse {\n"); + sb.append(" isPosted: ").append(toIndentedString(isPosted)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("IsPosted"); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 UpdateByTokenResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateByTokenResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateByTokenResponse is not found in the empty JSON string", UpdateByTokenResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `Data` + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + IdentityResponseWithSocialWithoutLogins.validateJsonElement(jsonObj.get("Data")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UpdateByTokenResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateByTokenResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<UpdateByTokenResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateByTokenResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<UpdateByTokenResponse>() { + @Override + public void write(JsonWriter out, UpdateByTokenResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateByTokenResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateByTokenResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateByTokenResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateByTokenResponse + * @throws IOException if the JSON string is invalid with respect to UpdateByTokenResponse + */ + public static UpdateByTokenResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateByTokenResponse.class); + } + + /** + * Convert an instance of UpdateByTokenResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UpdateEmail200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UpdateEmail200Response.java new file mode 100644 index 0000000..24be08f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UpdateEmail200Response.java @@ -0,0 +1,322 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.AuthResponse; +import com.loginradius.sdk.internal.openapi.model.AuthResponseEmailVerification; +import com.loginradius.sdk.internal.openapi.model.AuthResponseForgotReset; +import com.loginradius.sdk.internal.openapi.model.Profile; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UpdateEmail200Response extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UpdateEmail200Response.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UpdateEmail200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateEmail200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<AuthResponse> adapterAuthResponse = gson.getDelegateAdapter(this, TypeToken.get(AuthResponse.class)); + final TypeAdapter<AuthResponseEmailVerification> adapterAuthResponseEmailVerification = gson.getDelegateAdapter(this, TypeToken.get(AuthResponseEmailVerification.class)); + final TypeAdapter<AuthResponseForgotReset> adapterAuthResponseForgotReset = gson.getDelegateAdapter(this, TypeToken.get(AuthResponseForgotReset.class)); + + return (TypeAdapter<T>) new TypeAdapter<UpdateEmail200Response>() { + @Override + public void write(JsonWriter out, UpdateEmail200Response value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `AuthResponse` + if (value.getActualInstance() instanceof AuthResponse) { + JsonElement element = adapterAuthResponse.toJsonTree((AuthResponse)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `AuthResponseEmailVerification` + if (value.getActualInstance() instanceof AuthResponseEmailVerification) { + JsonElement element = adapterAuthResponseEmailVerification.toJsonTree((AuthResponseEmailVerification)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `AuthResponseForgotReset` + if (value.getActualInstance() instanceof AuthResponseForgotReset) { + JsonElement element = adapterAuthResponseForgotReset.toJsonTree((AuthResponseForgotReset)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: AuthResponse, AuthResponseEmailVerification, AuthResponseForgotReset"); + } + + @Override + public UpdateEmail200Response read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize AuthResponse + try { + // validate the JSON object to see if any exception is thrown + AuthResponse.validateJsonElement(jsonElement); + actualAdapter = adapterAuthResponse; + match++; + log.log(Level.FINER, "Input data matches schema 'AuthResponse'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for AuthResponse failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'AuthResponse'", e); + } + // deserialize AuthResponseEmailVerification + try { + // validate the JSON object to see if any exception is thrown + AuthResponseEmailVerification.validateJsonElement(jsonElement); + actualAdapter = adapterAuthResponseEmailVerification; + match++; + log.log(Level.FINER, "Input data matches schema 'AuthResponseEmailVerification'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for AuthResponseEmailVerification failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'AuthResponseEmailVerification'", e); + } + // deserialize AuthResponseForgotReset + try { + // validate the JSON object to see if any exception is thrown + AuthResponseForgotReset.validateJsonElement(jsonElement); + actualAdapter = adapterAuthResponseForgotReset; + match++; + log.log(Level.FINER, "Input data matches schema 'AuthResponseForgotReset'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for AuthResponseForgotReset failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'AuthResponseForgotReset'", e); + } + + if (match == 1) { + UpdateEmail200Response ret = new UpdateEmail200Response(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UpdateEmail200Response: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UpdateEmail200Response() { + super("oneOf", Boolean.FALSE); + } + + public UpdateEmail200Response(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("AuthResponse", AuthResponse.class); + schemas.put("AuthResponseEmailVerification", AuthResponseEmailVerification.class); + schemas.put("AuthResponseForgotReset", AuthResponseForgotReset.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UpdateEmail200Response.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * AuthResponse, AuthResponseEmailVerification, AuthResponseForgotReset + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof AuthResponse) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof AuthResponseEmailVerification) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof AuthResponseForgotReset) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be AuthResponse, AuthResponseEmailVerification, AuthResponseForgotReset"); + } + + /** + * Get the actual instance, which can be the following: + * AuthResponse, AuthResponseEmailVerification, AuthResponseForgotReset + * + * @return The actual instance (AuthResponse, AuthResponseEmailVerification, AuthResponseForgotReset) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `AuthResponse`. If the actual instance is not `AuthResponse`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AuthResponse` + * @throws ClassCastException if the instance is not `AuthResponse` + */ + public AuthResponse getAuthResponse() throws ClassCastException { + return (AuthResponse)super.getActualInstance(); + } + + /** + * Get the actual instance of `AuthResponseEmailVerification`. If the actual instance is not `AuthResponseEmailVerification`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AuthResponseEmailVerification` + * @throws ClassCastException if the instance is not `AuthResponseEmailVerification` + */ + public AuthResponseEmailVerification getAuthResponseEmailVerification() throws ClassCastException { + return (AuthResponseEmailVerification)super.getActualInstance(); + } + + /** + * Get the actual instance of `AuthResponseForgotReset`. If the actual instance is not `AuthResponseForgotReset`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AuthResponseForgotReset` + * @throws ClassCastException if the instance is not `AuthResponseForgotReset` + */ + public AuthResponseForgotReset getAuthResponseForgotReset() throws ClassCastException { + return (AuthResponseForgotReset)super.getActualInstance(); + } + + /** + * 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 UpdateEmail200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with AuthResponse + try { + AuthResponse.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for AuthResponse failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with AuthResponseEmailVerification + try { + AuthResponseEmailVerification.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for AuthResponseEmailVerification failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with AuthResponseForgotReset + try { + AuthResponseForgotReset.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for AuthResponseForgotReset failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UpdateEmail200Response with oneOf schemas: AuthResponse, AuthResponseEmailVerification, AuthResponseForgotReset. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UpdateEmail200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateEmail200Response + * @throws IOException if the JSON string is invalid with respect to UpdateEmail200Response + */ + public static UpdateEmail200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateEmail200Response.class); + } + + /** + * Convert an instance of UpdateEmail200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UpdateEmailRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UpdateEmailRequest.java new file mode 100644 index 0000000..d784e5e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UpdateEmailRequest.java @@ -0,0 +1,574 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * UpdateEmailRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UpdateEmailRequest { + public static final String SERIALIZED_NAME_OTP = "otp"; + @SerializedName(SERIALIZED_NAME_OTP) + @javax.annotation.Nonnull + private String otp; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private String email; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nullable + private String username; + + public static final String SERIALIZED_NAME_U_U_I_D = "UUID"; + @SerializedName(SERIALIZED_NAME_U_U_I_D) + @javax.annotation.Nullable + private String UUID; + + public static final String SERIALIZED_NAME_VERIFICATIONTOKEN = "verificationtoken"; + @SerializedName(SERIALIZED_NAME_VERIFICATIONTOKEN) + @javax.annotation.Nullable + private String verificationtoken; + + public static final String SERIALIZED_NAME_SECURITYANSWER = "securityanswer"; + @SerializedName(SERIALIZED_NAME_SECURITYANSWER) + @javax.annotation.Nullable + private Object securityanswer; + + public static final String SERIALIZED_NAME_G_RECAPTCHA_RESPONSE = "g-recaptcha-response"; + @SerializedName(SERIALIZED_NAME_G_RECAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String gRecaptchaResponse; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_TICKET = "qq_captcha_ticket"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_TICKET) + @javax.annotation.Nullable + private String qqCaptchaTicket; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR = "qq_captcha_randstr"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR) + @javax.annotation.Nullable + private String qqCaptchaRandstr; + + public static final String SERIALIZED_NAME_H_CAPTCHA_RESPONSE = "h-captcha-response"; + @SerializedName(SERIALIZED_NAME_H_CAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String hCaptchaResponse; + + public UpdateEmailRequest() { + } + + public UpdateEmailRequest otp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + return this; + } + + /** + * One-time passcode sent to the User's Email. [required if 'email' or 'uuid' is passed] + * @return otp + */ + @javax.annotation.Nonnull + public String getOtp() { + return otp; + } + + public void setOtp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + } + + + public UpdateEmailRequest email(@javax.annotation.Nullable String email) { + this.email = email; + return this; + } + + /** + * User's Email address (required if `uuid` or `username` is not passed). + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable String email) { + this.email = email; + } + + + public UpdateEmailRequest username(@javax.annotation.Nullable String username) { + this.username = username; + return this; + } + + /** + * Username of the associated Account (required if `email` or `uuid` is not passed). Cannot be combined with `email`. + * @return username + */ + @javax.annotation.Nullable + public String getUsername() { + return username; + } + + public void setUsername(@javax.annotation.Nullable String username) { + this.username = username; + } + + + public UpdateEmailRequest UUID(@javax.annotation.Nullable String UUID) { + this.UUID = UUID; + return this; + } + + /** + * UUID received in the response of the Auth send verification Email API (required if `email` or `username` is not passed). + * @return UUID + */ + @javax.annotation.Nullable + public String getUUID() { + return UUID; + } + + public void setUUID(@javax.annotation.Nullable String UUID) { + this.UUID = UUID; + } + + + public UpdateEmailRequest verificationtoken(@javax.annotation.Nullable String verificationtoken) { + this.verificationtoken = verificationtoken; + return this; + } + + /** + * Verification token received in Email (required if `email` is not passed). + * @return verificationtoken + */ + @javax.annotation.Nullable + public String getVerificationtoken() { + return verificationtoken; + } + + public void setVerificationtoken(@javax.annotation.Nullable String verificationtoken) { + this.verificationtoken = verificationtoken; + } + + + public UpdateEmailRequest securityanswer(@javax.annotation.Nullable Object securityanswer) { + this.securityanswer = securityanswer; + return this; + } + + /** + * JSON object with unique security question IDs and answers. + * @return securityanswer + */ + @javax.annotation.Nullable + public Object getSecurityanswer() { + return securityanswer; + } + + public void setSecurityanswer(@javax.annotation.Nullable Object securityanswer) { + this.securityanswer = securityanswer; + } + + + public UpdateEmailRequest gRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + return this; + } + + /** + * The Google reCAPTCHA response which is sent to the server for verification. + * @return gRecaptchaResponse + */ + @javax.annotation.Nullable + public String getgRecaptchaResponse() { + return gRecaptchaResponse; + } + + public void setgRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + } + + + public UpdateEmailRequest qqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + return this; + } + + /** + * The QQ Captcha ticket which is sent to the server for verification. + * @return qqCaptchaTicket + */ + @javax.annotation.Nullable + public String getQqCaptchaTicket() { + return qqCaptchaTicket; + } + + public void setQqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + } + + + public UpdateEmailRequest qqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + return this; + } + + /** + * The QQ Captcha random string which is sent to the server for verification. + * @return qqCaptchaRandstr + */ + @javax.annotation.Nullable + public String getQqCaptchaRandstr() { + return qqCaptchaRandstr; + } + + public void setQqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + } + + + public UpdateEmailRequest hCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + return this; + } + + /** + * The hCaptcha response which is sent to the server for verification. + * @return hCaptchaResponse + */ + @javax.annotation.Nullable + public String gethCaptchaResponse() { + return hCaptchaResponse; + } + + public void sethCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateEmailRequest instance itself + */ + public UpdateEmailRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateEmailRequest updateEmailRequest = (UpdateEmailRequest) o; + return Objects.equals(this.otp, updateEmailRequest.otp) && + Objects.equals(this.email, updateEmailRequest.email) && + Objects.equals(this.username, updateEmailRequest.username) && + Objects.equals(this.UUID, updateEmailRequest.UUID) && + Objects.equals(this.verificationtoken, updateEmailRequest.verificationtoken) && + Objects.equals(this.securityanswer, updateEmailRequest.securityanswer) && + Objects.equals(this.gRecaptchaResponse, updateEmailRequest.gRecaptchaResponse) && + Objects.equals(this.qqCaptchaTicket, updateEmailRequest.qqCaptchaTicket) && + Objects.equals(this.qqCaptchaRandstr, updateEmailRequest.qqCaptchaRandstr) && + Objects.equals(this.hCaptchaResponse, updateEmailRequest.hCaptchaResponse)&& + Objects.equals(this.additionalProperties, updateEmailRequest.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(otp, email, username, UUID, verificationtoken, securityanswer, gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateEmailRequest {\n"); + sb.append(" otp: ").append(toIndentedString(otp)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" UUID: ").append(toIndentedString(UUID)).append("\n"); + sb.append(" verificationtoken: ").append(toIndentedString(verificationtoken)).append("\n"); + sb.append(" securityanswer: ").append(toIndentedString(securityanswer)).append("\n"); + sb.append(" gRecaptchaResponse: ").append(toIndentedString(gRecaptchaResponse)).append("\n"); + sb.append(" qqCaptchaTicket: ").append(toIndentedString(qqCaptchaTicket)).append("\n"); + sb.append(" qqCaptchaRandstr: ").append(toIndentedString(qqCaptchaRandstr)).append("\n"); + sb.append(" hCaptchaResponse: ").append(toIndentedString(hCaptchaResponse)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("otp"); + openapiFields.add("email"); + openapiFields.add("username"); + openapiFields.add("UUID"); + openapiFields.add("verificationtoken"); + openapiFields.add("securityanswer"); + openapiFields.add("g-recaptcha-response"); + openapiFields.add("qq_captcha_ticket"); + openapiFields.add("qq_captcha_randstr"); + openapiFields.add("h-captcha-response"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("otp"); + } + + /** + * 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 UpdateEmailRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateEmailRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateEmailRequest is not found in the empty JSON string", UpdateEmailRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateEmailRequest.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("otp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `otp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("otp").toString())); + } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("username") != null && !jsonObj.get("username").isJsonNull()) && !jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + if ((jsonObj.get("UUID") != null && !jsonObj.get("UUID").isJsonNull()) && !jsonObj.get("UUID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UUID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UUID").toString())); + } + if ((jsonObj.get("verificationtoken") != null && !jsonObj.get("verificationtoken").isJsonNull()) && !jsonObj.get("verificationtoken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verificationtoken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verificationtoken").toString())); + } + if ((jsonObj.get("g-recaptcha-response") != null && !jsonObj.get("g-recaptcha-response").isJsonNull()) && !jsonObj.get("g-recaptcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `g-recaptcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("g-recaptcha-response").toString())); + } + if ((jsonObj.get("qq_captcha_ticket") != null && !jsonObj.get("qq_captcha_ticket").isJsonNull()) && !jsonObj.get("qq_captcha_ticket").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_ticket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_ticket").toString())); + } + if ((jsonObj.get("qq_captcha_randstr") != null && !jsonObj.get("qq_captcha_randstr").isJsonNull()) && !jsonObj.get("qq_captcha_randstr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_randstr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_randstr").toString())); + } + if ((jsonObj.get("h-captcha-response") != null && !jsonObj.get("h-captcha-response").isJsonNull()) && !jsonObj.get("h-captcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `h-captcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("h-captcha-response").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UpdateEmailRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateEmailRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<UpdateEmailRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateEmailRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<UpdateEmailRequest>() { + @Override + public void write(JsonWriter out, UpdateEmailRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateEmailRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateEmailRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateEmailRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateEmailRequest + * @throws IOException if the JSON string is invalid with respect to UpdateEmailRequest + */ + public static UpdateEmailRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateEmailRequest.class); + } + + /** + * Convert an instance of UpdateEmailRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UpdateEmailTemplate.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UpdateEmailTemplate.java new file mode 100644 index 0000000..7b01700 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UpdateEmailTemplate.java @@ -0,0 +1,589 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * UpdateEmailTemplate + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UpdateEmailTemplate { + public static final String SERIALIZED_NAME_TEMPLATE_NAME = "TemplateName"; + @SerializedName(SERIALIZED_NAME_TEMPLATE_NAME) + @javax.annotation.Nullable + private String templateName; + + public static final String SERIALIZED_NAME_TEMPLATE = "Template"; + @SerializedName(SERIALIZED_NAME_TEMPLATE) + @javax.annotation.Nonnull + private String template; + + public static final String SERIALIZED_NAME_SUBJECT = "Subject"; + @SerializedName(SERIALIZED_NAME_SUBJECT) + @javax.annotation.Nonnull + private String subject; + + public static final String SERIALIZED_NAME_TEXT_TEMPLATE = "TextTemplate"; + @SerializedName(SERIALIZED_NAME_TEXT_TEMPLATE) + @javax.annotation.Nullable + private String textTemplate; + + public static final String SERIALIZED_NAME_FROM_NAME = "FromName"; + @SerializedName(SERIALIZED_NAME_FROM_NAME) + @javax.annotation.Nullable + private String fromName; + + public static final String SERIALIZED_NAME_FROM_EMAIL = "FromEmail"; + @SerializedName(SERIALIZED_NAME_FROM_EMAIL) + @javax.annotation.Nullable + private String fromEmail; + + public static final String SERIALIZED_NAME_EMAIL_CONFIG_ID = "EmailConfigId"; + @SerializedName(SERIALIZED_NAME_EMAIL_CONFIG_ID) + @javax.annotation.Nullable + private String emailConfigId; + + public static final String SERIALIZED_NAME_IS_DEFAULT = "IsDefault"; + @SerializedName(SERIALIZED_NAME_IS_DEFAULT) + @javax.annotation.Nullable + private Boolean isDefault = false; + + /** + * The Email Verification token type for the template. This will be set only for 'registration','forgotpassword','deleteaccount','add_email','oneclicksignin', 'autologin','noregistrationpasswordlesslogin','forgotpin','breached_password' and 'forget_passkey' templates. + */ + @JsonAdapter(VerificationTokenTypeEnum.Adapter.class) + public enum VerificationTokenTypeEnum { + MAGIC_LINK("MagicLink"), + + OTP("Otp"); + + private String value; + + VerificationTokenTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static VerificationTokenTypeEnum fromValue(String value) { + for (VerificationTokenTypeEnum b : VerificationTokenTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<VerificationTokenTypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final VerificationTokenTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public VerificationTokenTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return VerificationTokenTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + VerificationTokenTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_VERIFICATION_TOKEN_TYPE = "VerificationTokenType"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_TOKEN_TYPE) + @javax.annotation.Nullable + private VerificationTokenTypeEnum verificationTokenType; + + public UpdateEmailTemplate() { + } + + public UpdateEmailTemplate templateName(@javax.annotation.Nullable String templateName) { + this.templateName = templateName; + return this; + } + + /** + * The name of the Email template + * @return templateName + */ + @javax.annotation.Nullable + public String getTemplateName() { + return templateName; + } + + public void setTemplateName(@javax.annotation.Nullable String templateName) { + this.templateName = templateName; + } + + + public UpdateEmailTemplate template(@javax.annotation.Nonnull String template) { + this.template = template; + return this; + } + + /** + * The content of the Email template + * @return template + */ + @javax.annotation.Nonnull + public String getTemplate() { + return template; + } + + public void setTemplate(@javax.annotation.Nonnull String template) { + this.template = template; + } + + + public UpdateEmailTemplate subject(@javax.annotation.Nonnull String subject) { + this.subject = subject; + return this; + } + + /** + * The subject of the Email template + * @return subject + */ + @javax.annotation.Nonnull + public String getSubject() { + return subject; + } + + public void setSubject(@javax.annotation.Nonnull String subject) { + this.subject = subject; + } + + + public UpdateEmailTemplate textTemplate(@javax.annotation.Nullable String textTemplate) { + this.textTemplate = textTemplate; + return this; + } + + /** + * The text version of the Email template + * @return textTemplate + */ + @javax.annotation.Nullable + public String getTextTemplate() { + return textTemplate; + } + + public void setTextTemplate(@javax.annotation.Nullable String textTemplate) { + this.textTemplate = textTemplate; + } + + + public UpdateEmailTemplate fromName(@javax.annotation.Nullable String fromName) { + this.fromName = fromName; + return this; + } + + /** + * The name of the sender + * @return fromName + */ + @javax.annotation.Nullable + public String getFromName() { + return fromName; + } + + public void setFromName(@javax.annotation.Nullable String fromName) { + this.fromName = fromName; + } + + + public UpdateEmailTemplate fromEmail(@javax.annotation.Nullable String fromEmail) { + this.fromEmail = fromEmail; + return this; + } + + /** + * The Email address of the sender + * @return fromEmail + */ + @javax.annotation.Nullable + public String getFromEmail() { + return fromEmail; + } + + public void setFromEmail(@javax.annotation.Nullable String fromEmail) { + this.fromEmail = fromEmail; + } + + + public UpdateEmailTemplate emailConfigId(@javax.annotation.Nullable String emailConfigId) { + this.emailConfigId = emailConfigId; + return this; + } + + /** + * Email configuration ID for sending this template. + * @return emailConfigId + */ + @javax.annotation.Nullable + public String getEmailConfigId() { + return emailConfigId; + } + + public void setEmailConfigId(@javax.annotation.Nullable String emailConfigId) { + this.emailConfigId = emailConfigId; + } + + + public UpdateEmailTemplate isDefault(@javax.annotation.Nullable Boolean isDefault) { + this.isDefault = isDefault; + return this; + } + + /** + * Set to true to mark this template as the default for its TemplateType. + * @return isDefault + */ + @javax.annotation.Nullable + public Boolean getIsDefault() { + return isDefault; + } + + public void setIsDefault(@javax.annotation.Nullable Boolean isDefault) { + this.isDefault = isDefault; + } + + + public UpdateEmailTemplate verificationTokenType(@javax.annotation.Nullable VerificationTokenTypeEnum verificationTokenType) { + this.verificationTokenType = verificationTokenType; + return this; + } + + /** + * The Email Verification token type for the template. This will be set only for 'registration','forgotpassword','deleteaccount','add_email','oneclicksignin', 'autologin','noregistrationpasswordlesslogin','forgotpin','breached_password' and 'forget_passkey' templates. + * @return verificationTokenType + */ + @javax.annotation.Nullable + public VerificationTokenTypeEnum getVerificationTokenType() { + return verificationTokenType; + } + + public void setVerificationTokenType(@javax.annotation.Nullable VerificationTokenTypeEnum verificationTokenType) { + this.verificationTokenType = verificationTokenType; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateEmailTemplate instance itself + */ + public UpdateEmailTemplate putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateEmailTemplate updateEmailTemplate = (UpdateEmailTemplate) o; + return Objects.equals(this.templateName, updateEmailTemplate.templateName) && + Objects.equals(this.template, updateEmailTemplate.template) && + Objects.equals(this.subject, updateEmailTemplate.subject) && + Objects.equals(this.textTemplate, updateEmailTemplate.textTemplate) && + Objects.equals(this.fromName, updateEmailTemplate.fromName) && + Objects.equals(this.fromEmail, updateEmailTemplate.fromEmail) && + Objects.equals(this.emailConfigId, updateEmailTemplate.emailConfigId) && + Objects.equals(this.isDefault, updateEmailTemplate.isDefault) && + Objects.equals(this.verificationTokenType, updateEmailTemplate.verificationTokenType)&& + Objects.equals(this.additionalProperties, updateEmailTemplate.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(templateName, template, subject, textTemplate, fromName, fromEmail, emailConfigId, isDefault, verificationTokenType, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateEmailTemplate {\n"); + sb.append(" templateName: ").append(toIndentedString(templateName)).append("\n"); + sb.append(" template: ").append(toIndentedString(template)).append("\n"); + sb.append(" subject: ").append(toIndentedString(subject)).append("\n"); + sb.append(" textTemplate: ").append(toIndentedString(textTemplate)).append("\n"); + sb.append(" fromName: ").append(toIndentedString(fromName)).append("\n"); + sb.append(" fromEmail: ").append(toIndentedString(fromEmail)).append("\n"); + sb.append(" emailConfigId: ").append(toIndentedString(emailConfigId)).append("\n"); + sb.append(" isDefault: ").append(toIndentedString(isDefault)).append("\n"); + sb.append(" verificationTokenType: ").append(toIndentedString(verificationTokenType)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("TemplateName"); + openapiFields.add("Template"); + openapiFields.add("Subject"); + openapiFields.add("TextTemplate"); + openapiFields.add("FromName"); + openapiFields.add("FromEmail"); + openapiFields.add("EmailConfigId"); + openapiFields.add("IsDefault"); + openapiFields.add("VerificationTokenType"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Template"); + openapiRequiredFields.add("Subject"); + } + + /** + * 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 UpdateEmailTemplate + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateEmailTemplate.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateEmailTemplate is not found in the empty JSON string", UpdateEmailTemplate.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateEmailTemplate.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("TemplateName") != null && !jsonObj.get("TemplateName").isJsonNull()) && !jsonObj.get("TemplateName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TemplateName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TemplateName").toString())); + } + if (!jsonObj.get("Template").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Template` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Template").toString())); + } + if (!jsonObj.get("Subject").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Subject` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Subject").toString())); + } + if ((jsonObj.get("TextTemplate") != null && !jsonObj.get("TextTemplate").isJsonNull()) && !jsonObj.get("TextTemplate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TextTemplate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TextTemplate").toString())); + } + if ((jsonObj.get("FromName") != null && !jsonObj.get("FromName").isJsonNull()) && !jsonObj.get("FromName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FromName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FromName").toString())); + } + if ((jsonObj.get("FromEmail") != null && !jsonObj.get("FromEmail").isJsonNull()) && !jsonObj.get("FromEmail").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FromEmail` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FromEmail").toString())); + } + if ((jsonObj.get("EmailConfigId") != null && !jsonObj.get("EmailConfigId").isJsonNull()) && !jsonObj.get("EmailConfigId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `EmailConfigId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("EmailConfigId").toString())); + } + if ((jsonObj.get("VerificationTokenType") != null && !jsonObj.get("VerificationTokenType").isJsonNull()) && !jsonObj.get("VerificationTokenType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `VerificationTokenType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("VerificationTokenType").toString())); + } + // validate the optional field `VerificationTokenType` + if (jsonObj.get("VerificationTokenType") != null && !jsonObj.get("VerificationTokenType").isJsonNull()) { + VerificationTokenTypeEnum.validateJsonElement(jsonObj.get("VerificationTokenType")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UpdateEmailTemplate.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateEmailTemplate' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<UpdateEmailTemplate> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateEmailTemplate.class)); + + return (TypeAdapter<T>) new TypeAdapter<UpdateEmailTemplate>() { + @Override + public void write(JsonWriter out, UpdateEmailTemplate value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateEmailTemplate read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateEmailTemplate instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateEmailTemplate given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateEmailTemplate + * @throws IOException if the JSON string is invalid with respect to UpdateEmailTemplate + */ + public static UpdateEmailTemplate fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateEmailTemplate.class); + } + + /** + * Convert an instance of UpdateEmailTemplate to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UpdateInvitationByInvitationIdRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UpdateInvitationByInvitationIdRequest.java new file mode 100644 index 0000000..f8498ef --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UpdateInvitationByInvitationIdRequest.java @@ -0,0 +1,325 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.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.loginradius.sdk.internal.openapi.JSON; + +/** + * UpdateInvitationByInvitationIdRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UpdateInvitationByInvitationIdRequest { + public static final String SERIALIZED_NAME_ROLES_IDS = "RolesIds"; + @SerializedName(SERIALIZED_NAME_ROLES_IDS) + @javax.annotation.Nullable + private List<String> rolesIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_RESEND_EMAIL = "ResendEmail"; + @SerializedName(SERIALIZED_NAME_RESEND_EMAIL) + @javax.annotation.Nullable + private Boolean resendEmail; + + public UpdateInvitationByInvitationIdRequest() { + } + + public UpdateInvitationByInvitationIdRequest rolesIds(@javax.annotation.Nullable List<String> rolesIds) { + this.rolesIds = rolesIds; + return this; + } + + public UpdateInvitationByInvitationIdRequest addRolesIdsItem(String rolesIdsItem) { + if (this.rolesIds == null) { + this.rolesIds = new ArrayList<>(); + } + this.rolesIds.add(rolesIdsItem); + return this; + } + + /** + * The list of Role IDs associated with the invitation. Each Role ID is typically in the format *role_<unique_id>*, where *<unique_id>* is a string of alphanumeric characters. + * @return rolesIds + */ + @javax.annotation.Nullable + public List<String> getRolesIds() { + return rolesIds; + } + + public void setRolesIds(@javax.annotation.Nullable List<String> rolesIds) { + this.rolesIds = rolesIds; + } + + + public UpdateInvitationByInvitationIdRequest resendEmail(@javax.annotation.Nullable Boolean resendEmail) { + this.resendEmail = resendEmail; + return this; + } + + /** + * Indicates whether to resend the invitation Email. If set to true, the invitation Email will be resent to the User. + * @return resendEmail + */ + @javax.annotation.Nullable + public Boolean getResendEmail() { + return resendEmail; + } + + public void setResendEmail(@javax.annotation.Nullable Boolean resendEmail) { + this.resendEmail = resendEmail; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateInvitationByInvitationIdRequest instance itself + */ + public UpdateInvitationByInvitationIdRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateInvitationByInvitationIdRequest updateInvitationByInvitationIdRequest = (UpdateInvitationByInvitationIdRequest) o; + return Objects.equals(this.rolesIds, updateInvitationByInvitationIdRequest.rolesIds) && + Objects.equals(this.resendEmail, updateInvitationByInvitationIdRequest.resendEmail)&& + Objects.equals(this.additionalProperties, updateInvitationByInvitationIdRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(rolesIds, resendEmail, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateInvitationByInvitationIdRequest {\n"); + sb.append(" rolesIds: ").append(toIndentedString(rolesIds)).append("\n"); + sb.append(" resendEmail: ").append(toIndentedString(resendEmail)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("RolesIds"); + openapiFields.add("ResendEmail"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 UpdateInvitationByInvitationIdRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateInvitationByInvitationIdRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateInvitationByInvitationIdRequest is not found in the empty JSON string", UpdateInvitationByInvitationIdRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("RolesIds") != null && !jsonObj.get("RolesIds").isJsonNull() && !jsonObj.get("RolesIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RolesIds` to be an array in the JSON string but got `%s`", jsonObj.get("RolesIds").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UpdateInvitationByInvitationIdRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateInvitationByInvitationIdRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<UpdateInvitationByInvitationIdRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateInvitationByInvitationIdRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<UpdateInvitationByInvitationIdRequest>() { + @Override + public void write(JsonWriter out, UpdateInvitationByInvitationIdRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateInvitationByInvitationIdRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateInvitationByInvitationIdRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateInvitationByInvitationIdRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateInvitationByInvitationIdRequest + * @throws IOException if the JSON string is invalid with respect to UpdateInvitationByInvitationIdRequest + */ + public static UpdateInvitationByInvitationIdRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateInvitationByInvitationIdRequest.class); + } + + /** + * Convert an instance of UpdateInvitationByInvitationIdRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UpdateRoleContextBodyModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UpdateRoleContextBodyModel.java new file mode 100644 index 0000000..ab3c7ca --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UpdateRoleContextBodyModel.java @@ -0,0 +1,313 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.RoleContextBodyModel; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * UpdateRoleContextBodyModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UpdateRoleContextBodyModel { + public static final String SERIALIZED_NAME_ROLECONTEXT = "rolecontext"; + @SerializedName(SERIALIZED_NAME_ROLECONTEXT) + @javax.annotation.Nonnull + private List<RoleContextBodyModel> rolecontext = new ArrayList<>(); + + public UpdateRoleContextBodyModel() { + } + + public UpdateRoleContextBodyModel rolecontext(@javax.annotation.Nonnull List<RoleContextBodyModel> rolecontext) { + this.rolecontext = rolecontext; + return this; + } + + public UpdateRoleContextBodyModel addRolecontextItem(RoleContextBodyModel rolecontextItem) { + if (this.rolecontext == null) { + this.rolecontext = new ArrayList<>(); + } + this.rolecontext.add(rolecontextItem); + return this; + } + + /** + * List of Role Context objects. + * @return rolecontext + */ + @javax.annotation.Nonnull + public List<RoleContextBodyModel> getRolecontext() { + return rolecontext; + } + + public void setRolecontext(@javax.annotation.Nonnull List<RoleContextBodyModel> rolecontext) { + this.rolecontext = rolecontext; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateRoleContextBodyModel instance itself + */ + public UpdateRoleContextBodyModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateRoleContextBodyModel updateRoleContextBodyModel = (UpdateRoleContextBodyModel) o; + return Objects.equals(this.rolecontext, updateRoleContextBodyModel.rolecontext)&& + Objects.equals(this.additionalProperties, updateRoleContextBodyModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(rolecontext, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateRoleContextBodyModel {\n"); + sb.append(" rolecontext: ").append(toIndentedString(rolecontext)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("rolecontext"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("rolecontext"); + } + + /** + * 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 UpdateRoleContextBodyModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateRoleContextBodyModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateRoleContextBodyModel is not found in the empty JSON string", UpdateRoleContextBodyModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpdateRoleContextBodyModel.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("rolecontext").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `rolecontext` to be an array in the JSON string but got `%s`", jsonObj.get("rolecontext").toString())); + } + + JsonArray jsonArrayrolecontext = jsonObj.getAsJsonArray("rolecontext"); + // validate the required field `rolecontext` (array) + for (int i = 0; i < jsonArrayrolecontext.size(); i++) { + RoleContextBodyModel.validateJsonElement(jsonArrayrolecontext.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UpdateRoleContextBodyModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateRoleContextBodyModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<UpdateRoleContextBodyModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateRoleContextBodyModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<UpdateRoleContextBodyModel>() { + @Override + public void write(JsonWriter out, UpdateRoleContextBodyModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateRoleContextBodyModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateRoleContextBodyModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateRoleContextBodyModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateRoleContextBodyModel + * @throws IOException if the JSON string is invalid with respect to UpdateRoleContextBodyModel + */ + public static UpdateRoleContextBodyModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateRoleContextBodyModel.class); + } + + /** + * Convert an instance of UpdateRoleContextBodyModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UpdateSmsTemplateModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UpdateSmsTemplateModel.java new file mode 100644 index 0000000..a2138c2 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UpdateSmsTemplateModel.java @@ -0,0 +1,371 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * UpdateSmsTemplateModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UpdateSmsTemplateModel { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_TEMPLATE = "Template"; + @SerializedName(SERIALIZED_NAME_TEMPLATE) + @javax.annotation.Nullable + private String template; + + public static final String SERIALIZED_NAME_IS_ACTIVE = "IsActive"; + @SerializedName(SERIALIZED_NAME_IS_ACTIVE) + @javax.annotation.Nullable + private Boolean isActive; + + public static final String SERIALIZED_NAME_IS_DEFAULT = "IsDefault"; + @SerializedName(SERIALIZED_NAME_IS_DEFAULT) + @javax.annotation.Nullable + private Boolean isDefault; + + public UpdateSmsTemplateModel() { + } + + public UpdateSmsTemplateModel name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the SMS template. + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public UpdateSmsTemplateModel template(@javax.annotation.Nullable String template) { + this.template = template; + return this; + } + + /** + * The updated template content. + * @return template + */ + @javax.annotation.Nullable + public String getTemplate() { + return template; + } + + public void setTemplate(@javax.annotation.Nullable String template) { + this.template = template; + } + + + public UpdateSmsTemplateModel isActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Indicates if the template is active. + * @return isActive + */ + @javax.annotation.Nullable + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + } + + + public UpdateSmsTemplateModel isDefault(@javax.annotation.Nullable Boolean isDefault) { + this.isDefault = isDefault; + return this; + } + + /** + * Set to true to mark this template as the default for its SmsTemplateType. + * @return isDefault + */ + @javax.annotation.Nullable + public Boolean getIsDefault() { + return isDefault; + } + + public void setIsDefault(@javax.annotation.Nullable Boolean isDefault) { + this.isDefault = isDefault; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateSmsTemplateModel instance itself + */ + public UpdateSmsTemplateModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateSmsTemplateModel updateSmsTemplateModel = (UpdateSmsTemplateModel) o; + return Objects.equals(this.name, updateSmsTemplateModel.name) && + Objects.equals(this.template, updateSmsTemplateModel.template) && + Objects.equals(this.isActive, updateSmsTemplateModel.isActive) && + Objects.equals(this.isDefault, updateSmsTemplateModel.isDefault)&& + Objects.equals(this.additionalProperties, updateSmsTemplateModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, template, isActive, isDefault, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateSmsTemplateModel {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" template: ").append(toIndentedString(template)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" isDefault: ").append(toIndentedString(isDefault)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + openapiFields.add("Template"); + openapiFields.add("IsActive"); + openapiFields.add("IsDefault"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 UpdateSmsTemplateModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateSmsTemplateModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateSmsTemplateModel is not found in the empty JSON string", UpdateSmsTemplateModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("Template") != null && !jsonObj.get("Template").isJsonNull()) && !jsonObj.get("Template").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Template` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Template").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UpdateSmsTemplateModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateSmsTemplateModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<UpdateSmsTemplateModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateSmsTemplateModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<UpdateSmsTemplateModel>() { + @Override + public void write(JsonWriter out, UpdateSmsTemplateModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateSmsTemplateModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateSmsTemplateModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateSmsTemplateModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateSmsTemplateModel + * @throws IOException if the JSON string is invalid with respect to UpdateSmsTemplateModel + */ + public static UpdateSmsTemplateModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateSmsTemplateModel.class); + } + + /** + * Convert an instance of UpdateSmsTemplateModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UpdateWorkflowConfig.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UpdateWorkflowConfig.java new file mode 100644 index 0000000..40ad732 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UpdateWorkflowConfig.java @@ -0,0 +1,462 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * UpdateWorkflowConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UpdateWorkflowConfig { + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_THEME_NAME = "ThemeName"; + @SerializedName(SERIALIZED_NAME_THEME_NAME) + @javax.annotation.Nullable + private String themeName; + + public static final String SERIALIZED_NAME_DESCRIPTION = "Description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private Object data; + + /** + * Gets or Sets state + */ + @JsonAdapter(StateEnum.Adapter.class) + public enum StateEnum { + ACTIVE("ACTIVE"), + + DEBUG("DEBUG"), + + ARCHIVE("ARCHIVE"); + + private String value; + + StateEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static StateEnum fromValue(String value) { + for (StateEnum b : StateEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<StateEnum> { + @Override + public void write(final JsonWriter jsonWriter, final StateEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public StateEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return StateEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + StateEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_STATE = "State"; + @SerializedName(SERIALIZED_NAME_STATE) + @javax.annotation.Nullable + private StateEnum state; + + public UpdateWorkflowConfig() { + } + + public UpdateWorkflowConfig name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public UpdateWorkflowConfig themeName(@javax.annotation.Nullable String themeName) { + this.themeName = themeName; + return this; + } + + /** + * Get themeName + * @return themeName + */ + @javax.annotation.Nullable + public String getThemeName() { + return themeName; + } + + public void setThemeName(@javax.annotation.Nullable String themeName) { + this.themeName = themeName; + } + + + public UpdateWorkflowConfig description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public UpdateWorkflowConfig data(@javax.annotation.Nullable Object data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public Object getData() { + return data; + } + + public void setData(@javax.annotation.Nullable Object data) { + this.data = data; + } + + + public UpdateWorkflowConfig state(@javax.annotation.Nullable StateEnum state) { + this.state = state; + return this; + } + + /** + * Get state + * @return state + */ + @javax.annotation.Nullable + public StateEnum getState() { + return state; + } + + public void setState(@javax.annotation.Nullable StateEnum state) { + this.state = state; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpdateWorkflowConfig instance itself + */ + public UpdateWorkflowConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpdateWorkflowConfig updateWorkflowConfig = (UpdateWorkflowConfig) o; + return Objects.equals(this.name, updateWorkflowConfig.name) && + Objects.equals(this.themeName, updateWorkflowConfig.themeName) && + Objects.equals(this.description, updateWorkflowConfig.description) && + Objects.equals(this.data, updateWorkflowConfig.data) && + Objects.equals(this.state, updateWorkflowConfig.state)&& + Objects.equals(this.additionalProperties, updateWorkflowConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(name, themeName, description, data, state, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpdateWorkflowConfig {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" themeName: ").append(toIndentedString(themeName)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Name"); + openapiFields.add("ThemeName"); + openapiFields.add("Description"); + openapiFields.add("Data"); + openapiFields.add("State"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 UpdateWorkflowConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpdateWorkflowConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpdateWorkflowConfig is not found in the empty JSON string", UpdateWorkflowConfig.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("ThemeName") != null && !jsonObj.get("ThemeName").isJsonNull()) && !jsonObj.get("ThemeName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ThemeName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ThemeName").toString())); + } + if ((jsonObj.get("Description") != null && !jsonObj.get("Description").isJsonNull()) && !jsonObj.get("Description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Description").toString())); + } + if ((jsonObj.get("State") != null && !jsonObj.get("State").isJsonNull()) && !jsonObj.get("State").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `State` to be a primitive type in the JSON string but got `%s`", jsonObj.get("State").toString())); + } + // validate the optional field `State` + if (jsonObj.get("State") != null && !jsonObj.get("State").isJsonNull()) { + StateEnum.validateJsonElement(jsonObj.get("State")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UpdateWorkflowConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpdateWorkflowConfig' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<UpdateWorkflowConfig> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpdateWorkflowConfig.class)); + + return (TypeAdapter<T>) new TypeAdapter<UpdateWorkflowConfig>() { + @Override + public void write(JsonWriter out, UpdateWorkflowConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpdateWorkflowConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpdateWorkflowConfig instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpdateWorkflowConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpdateWorkflowConfig + * @throws IOException if the JSON string is invalid with respect to UpdateWorkflowConfig + */ + public static UpdateWorkflowConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpdateWorkflowConfig.class); + } + + /** + * Convert an instance of UpdateWorkflowConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UpsertEmailModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UpsertEmailModel.java new file mode 100644 index 0000000..a915fe6 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UpsertEmailModel.java @@ -0,0 +1,313 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.UpsertEmailModelEmailInner; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * UpsertEmailModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UpsertEmailModel { + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nonnull + private List<UpsertEmailModelEmailInner> email = new ArrayList<>(); + + public UpsertEmailModel() { + } + + public UpsertEmailModel email(@javax.annotation.Nonnull List<UpsertEmailModelEmailInner> email) { + this.email = email; + return this; + } + + public UpsertEmailModel addEmailItem(UpsertEmailModelEmailInner emailItem) { + if (this.email == null) { + this.email = new ArrayList<>(); + } + this.email.add(emailItem); + return this; + } + + /** + * A list of Email addresses to be added or updated for the Account. + * @return email + */ + @javax.annotation.Nonnull + public List<UpsertEmailModelEmailInner> getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nonnull List<UpsertEmailModelEmailInner> email) { + this.email = email; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpsertEmailModel instance itself + */ + public UpsertEmailModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpsertEmailModel upsertEmailModel = (UpsertEmailModel) o; + return Objects.equals(this.email, upsertEmailModel.email)&& + Objects.equals(this.additionalProperties, upsertEmailModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(email, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpsertEmailModel {\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Email"); + } + + /** + * 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 UpsertEmailModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpsertEmailModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpsertEmailModel is not found in the empty JSON string", UpsertEmailModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UpsertEmailModel.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("Email").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Email` to be an array in the JSON string but got `%s`", jsonObj.get("Email").toString())); + } + + JsonArray jsonArrayemail = jsonObj.getAsJsonArray("Email"); + // validate the required field `Email` (array) + for (int i = 0; i < jsonArrayemail.size(); i++) { + UpsertEmailModelEmailInner.validateJsonElement(jsonArrayemail.get(i)); + }; + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UpsertEmailModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpsertEmailModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<UpsertEmailModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpsertEmailModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<UpsertEmailModel>() { + @Override + public void write(JsonWriter out, UpsertEmailModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpsertEmailModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpsertEmailModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpsertEmailModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpsertEmailModel + * @throws IOException if the JSON string is invalid with respect to UpsertEmailModel + */ + public static UpsertEmailModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpsertEmailModel.class); + } + + /** + * Convert an instance of UpsertEmailModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UpsertEmailModelEmailInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UpsertEmailModelEmailInner.java new file mode 100644 index 0000000..6f9af1a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UpsertEmailModelEmailInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * UpsertEmailModelEmailInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UpsertEmailModelEmailInner { + public static final String SERIALIZED_NAME_TYPE = "Type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_VALUE = "Value"; + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nullable + private String value; + + public UpsertEmailModelEmailInner() { + } + + public UpsertEmailModelEmailInner type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * The type of Email (e.g., primary, secondary). + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public UpsertEmailModelEmailInner value(@javax.annotation.Nullable String value) { + this.value = value; + return this; + } + + /** + * The Email address to be added or updated. + * @return value + */ + @javax.annotation.Nullable + public String getValue() { + return value; + } + + public void setValue(@javax.annotation.Nullable String value) { + this.value = value; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UpsertEmailModelEmailInner instance itself + */ + public UpsertEmailModelEmailInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UpsertEmailModelEmailInner upsertEmailModelEmailInner = (UpsertEmailModelEmailInner) o; + return Objects.equals(this.type, upsertEmailModelEmailInner.type) && + Objects.equals(this.value, upsertEmailModelEmailInner.value)&& + Objects.equals(this.additionalProperties, upsertEmailModelEmailInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(type, value, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UpsertEmailModelEmailInner {\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Type"); + openapiFields.add("Value"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 UpsertEmailModelEmailInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UpsertEmailModelEmailInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UpsertEmailModelEmailInner is not found in the empty JSON string", UpsertEmailModelEmailInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Type") != null && !jsonObj.get("Type").isJsonNull()) && !jsonObj.get("Type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Type").toString())); + } + if ((jsonObj.get("Value") != null && !jsonObj.get("Value").isJsonNull()) && !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())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UpsertEmailModelEmailInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UpsertEmailModelEmailInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<UpsertEmailModelEmailInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UpsertEmailModelEmailInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<UpsertEmailModelEmailInner>() { + @Override + public void write(JsonWriter out, UpsertEmailModelEmailInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UpsertEmailModelEmailInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UpsertEmailModelEmailInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UpsertEmailModelEmailInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of UpsertEmailModelEmailInner + * @throws IOException if the JSON string is invalid with respect to UpsertEmailModelEmailInner + */ + public static UpsertEmailModelEmailInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UpsertEmailModelEmailInner.class); + } + + /** + * Convert an instance of UpsertEmailModelEmailInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfile.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfile.java new file mode 100644 index 0000000..3b64663 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfile.java @@ -0,0 +1,4794 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.UserProfileAddresses; +import com.loginradius.sdk.internal.openapi.model.UserProfileAgeRange; +import com.loginradius.sdk.internal.openapi.model.UserProfileAwards; +import com.loginradius.sdk.internal.openapi.model.UserProfileBadges; +import com.loginradius.sdk.internal.openapi.model.UserProfileBooks; +import com.loginradius.sdk.internal.openapi.model.UserProfileCertifications; +import com.loginradius.sdk.internal.openapi.model.UserProfileCountry; +import com.loginradius.sdk.internal.openapi.model.UserProfileCourses; +import com.loginradius.sdk.internal.openapi.model.UserProfileCoverPhoto; +import com.loginradius.sdk.internal.openapi.model.UserProfileCurrentStatus; +import com.loginradius.sdk.internal.openapi.model.UserProfileCustomFields; +import com.loginradius.sdk.internal.openapi.model.UserProfileEducations; +import com.loginradius.sdk.internal.openapi.model.UserProfileEmail; +import com.loginradius.sdk.internal.openapi.model.UserProfileExternalIds; +import com.loginradius.sdk.internal.openapi.model.UserProfileFamily; +import com.loginradius.sdk.internal.openapi.model.UserProfileFavicon; +import com.loginradius.sdk.internal.openapi.model.UserProfileFavoriteThings; +import com.loginradius.sdk.internal.openapi.model.UserProfileGames; +import com.loginradius.sdk.internal.openapi.model.UserProfileGistsUrl; +import com.loginradius.sdk.internal.openapi.model.UserProfileGravatarImageUrl; +import com.loginradius.sdk.internal.openapi.model.UserProfileHttpsImageUrl; +import com.loginradius.sdk.internal.openapi.model.UserProfileIMAccounts; +import com.loginradius.sdk.internal.openapi.model.UserProfileImageUrl; +import com.loginradius.sdk.internal.openapi.model.UserProfileInspirationalPeople; +import com.loginradius.sdk.internal.openapi.model.UserProfileInterests; +import com.loginradius.sdk.internal.openapi.model.UserProfileJobBookmarks; +import com.loginradius.sdk.internal.openapi.model.UserProfileKloutScore; +import com.loginradius.sdk.internal.openapi.model.UserProfileKnownLoginVariables; +import com.loginradius.sdk.internal.openapi.model.UserProfileLanguages; +import com.loginradius.sdk.internal.openapi.model.UserProfileMemberUrlResources; +import com.loginradius.sdk.internal.openapi.model.UserProfileMovies; +import com.loginradius.sdk.internal.openapi.model.UserProfileMutualFriends; +import com.loginradius.sdk.internal.openapi.model.UserProfilePatents; +import com.loginradius.sdk.internal.openapi.model.UserProfilePhoneNumbers; +import com.loginradius.sdk.internal.openapi.model.UserProfilePlacesLived; +import com.loginradius.sdk.internal.openapi.model.UserProfilePositions; +import com.loginradius.sdk.internal.openapi.model.UserProfilePrivacyPolicy; +import com.loginradius.sdk.internal.openapi.model.UserProfileProfileImageUrls; +import com.loginradius.sdk.internal.openapi.model.UserProfileProfileUrl; +import com.loginradius.sdk.internal.openapi.model.UserProfileProjects; +import com.loginradius.sdk.internal.openapi.model.UserProfilePublicRepository; +import com.loginradius.sdk.internal.openapi.model.UserProfilePublications; +import com.loginradius.sdk.internal.openapi.model.UserProfileRecommendationsReceived; +import com.loginradius.sdk.internal.openapi.model.UserProfileRelatedProfileViews; +import com.loginradius.sdk.internal.openapi.model.UserProfileRepositoryUrl; +import com.loginradius.sdk.internal.openapi.model.UserProfileRoleContext; +import com.loginradius.sdk.internal.openapi.model.UserProfileSignupLog; +import com.loginradius.sdk.internal.openapi.model.UserProfileSkills; +import com.loginradius.sdk.internal.openapi.model.UserProfileSports; +import com.loginradius.sdk.internal.openapi.model.UserProfileStarredUrl; +import com.loginradius.sdk.internal.openapi.model.UserProfileSubscription; +import com.loginradius.sdk.internal.openapi.model.UserProfileSuggestions; +import com.loginradius.sdk.internal.openapi.model.UserProfileTeleVisionShow; +import com.loginradius.sdk.internal.openapi.model.UserProfileUnverifiedEmail; +import com.loginradius.sdk.internal.openapi.model.UserProfileUserAgent; +import com.loginradius.sdk.internal.openapi.model.UserProfileVolunteer; +import com.loginradius.sdk.internal.openapi.model.UserProfileWebProfiles; +import java.io.IOException; +import java.time.LocalDate; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * UserProfile + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfile { + public static final String SERIALIZED_NAME_APP_NAME = "AppName"; + @SerializedName(SERIALIZED_NAME_APP_NAME) + @javax.annotation.Nullable + private String appName; + + public static final String SERIALIZED_NAME_UID = "Uid"; + @SerializedName(SERIALIZED_NAME_UID) + @javax.annotation.Nullable + private String uid; + + public static final String SERIALIZED_NAME_I_D = "ID"; + @SerializedName(SERIALIZED_NAME_I_D) + @javax.annotation.Nullable + private String ID; + + public static final String SERIALIZED_NAME_PROVIDER = "Provider"; + @SerializedName(SERIALIZED_NAME_PROVIDER) + @javax.annotation.Nullable + private String provider; + + public static final String SERIALIZED_NAME_PREFIX = "Prefix"; + @SerializedName(SERIALIZED_NAME_PREFIX) + @javax.annotation.Nullable + private String prefix; + + public static final String SERIALIZED_NAME_FIRST_NAME = "FirstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nullable + private String firstName; + + public static final String SERIALIZED_NAME_MIDDLE_NAME = "MiddleName"; + @SerializedName(SERIALIZED_NAME_MIDDLE_NAME) + @javax.annotation.Nullable + private String middleName; + + public static final String SERIALIZED_NAME_LAST_NAME = "LastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nullable + private String lastName; + + public static final String SERIALIZED_NAME_SUFFIX = "Suffix"; + @SerializedName(SERIALIZED_NAME_SUFFIX) + @javax.annotation.Nullable + private String suffix; + + 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_NICK_NAME = "NickName"; + @SerializedName(SERIALIZED_NAME_NICK_NAME) + @javax.annotation.Nullable + private String nickName; + + public static final String SERIALIZED_NAME_PROFILE_NAME = "ProfileName"; + @SerializedName(SERIALIZED_NAME_PROFILE_NAME) + @javax.annotation.Nullable + private String profileName; + + public static final String SERIALIZED_NAME_BIRTH_DATE = "BirthDate"; + @SerializedName(SERIALIZED_NAME_BIRTH_DATE) + @javax.annotation.Nullable + private LocalDate birthDate; + + public static final String SERIALIZED_NAME_GENDER = "Gender"; + @SerializedName(SERIALIZED_NAME_GENDER) + @javax.annotation.Nullable + private String gender; + + public static final String SERIALIZED_NAME_WEBSITE = "Website"; + @SerializedName(SERIALIZED_NAME_WEBSITE) + @javax.annotation.Nullable + private String website; + + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private UserProfileEmail email; + + public static final String SERIALIZED_NAME_COUNTRY = "Country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + @javax.annotation.Nullable + private UserProfileCountry country; + + public static final String SERIALIZED_NAME_THUMBNAIL_IMAGE_URL = "ThumbnailImageUrl"; + @SerializedName(SERIALIZED_NAME_THUMBNAIL_IMAGE_URL) + @javax.annotation.Nullable + private String thumbnailImageUrl; + + public static final String SERIALIZED_NAME_IMAGE_URL = "ImageUrl"; + @SerializedName(SERIALIZED_NAME_IMAGE_URL) + @javax.annotation.Nullable + private UserProfileImageUrl imageUrl; + + public static final String SERIALIZED_NAME_FAVICON = "Favicon"; + @SerializedName(SERIALIZED_NAME_FAVICON) + @javax.annotation.Nullable + private UserProfileFavicon favicon; + + public static final String SERIALIZED_NAME_PROFILE_URL = "ProfileUrl"; + @SerializedName(SERIALIZED_NAME_PROFILE_URL) + @javax.annotation.Nullable + private UserProfileProfileUrl profileUrl; + + public static final String SERIALIZED_NAME_HOME_TOWN = "HomeTown"; + @SerializedName(SERIALIZED_NAME_HOME_TOWN) + @javax.annotation.Nullable + private String homeTown; + + public static final String SERIALIZED_NAME_STATE = "State"; + @SerializedName(SERIALIZED_NAME_STATE) + @javax.annotation.Nullable + private String state; + + public static final String SERIALIZED_NAME_CITY = "City"; + @SerializedName(SERIALIZED_NAME_CITY) + @javax.annotation.Nullable + private String city; + + public static final String SERIALIZED_NAME_INDUSTRY = "Industry"; + @SerializedName(SERIALIZED_NAME_INDUSTRY) + @javax.annotation.Nullable + private String industry; + + public static final String SERIALIZED_NAME_ABOUT = "About"; + @SerializedName(SERIALIZED_NAME_ABOUT) + @javax.annotation.Nullable + private String about; + + public static final String SERIALIZED_NAME_TIME_ZONE = "TimeZone"; + @SerializedName(SERIALIZED_NAME_TIME_ZONE) + @javax.annotation.Nullable + private String timeZone; + + public static final String SERIALIZED_NAME_LOCAL_LANGUAGE = "LocalLanguage"; + @SerializedName(SERIALIZED_NAME_LOCAL_LANGUAGE) + @javax.annotation.Nullable + private String localLanguage; + + public static final String SERIALIZED_NAME_COVER_PHOTO = "CoverPhoto"; + @SerializedName(SERIALIZED_NAME_COVER_PHOTO) + @javax.annotation.Nullable + private UserProfileCoverPhoto coverPhoto; + + public static final String SERIALIZED_NAME_TAG_LINE = "TagLine"; + @SerializedName(SERIALIZED_NAME_TAG_LINE) + @javax.annotation.Nullable + private String tagLine; + + public static final String SERIALIZED_NAME_LANGUAGE = "Language"; + @SerializedName(SERIALIZED_NAME_LANGUAGE) + @javax.annotation.Nullable + private String language; + + public static final String SERIALIZED_NAME_VERIFIED = "Verified"; + @SerializedName(SERIALIZED_NAME_VERIFIED) + @javax.annotation.Nullable + private String verified; + + public static final String SERIALIZED_NAME_UPDATED_TIME = "UpdatedTime"; + @SerializedName(SERIALIZED_NAME_UPDATED_TIME) + @javax.annotation.Nullable + private OffsetDateTime updatedTime; + + public static final String SERIALIZED_NAME_POSITIONS = "Positions"; + @SerializedName(SERIALIZED_NAME_POSITIONS) + @javax.annotation.Nullable + private UserProfilePositions positions; + + public static final String SERIALIZED_NAME_EDUCATIONS = "Educations"; + @SerializedName(SERIALIZED_NAME_EDUCATIONS) + @javax.annotation.Nullable + private UserProfileEducations educations; + + public static final String SERIALIZED_NAME_PHONE_NUMBERS = "PhoneNumbers"; + @SerializedName(SERIALIZED_NAME_PHONE_NUMBERS) + @javax.annotation.Nullable + private UserProfilePhoneNumbers phoneNumbers; + + public static final String SERIALIZED_NAME_IM_ACCOUNTS = "IMAccounts"; + @SerializedName(SERIALIZED_NAME_IM_ACCOUNTS) + @javax.annotation.Nullable + private UserProfileIMAccounts imAccounts; + + public static final String SERIALIZED_NAME_ADDRESSES = "Addresses"; + @SerializedName(SERIALIZED_NAME_ADDRESSES) + @javax.annotation.Nullable + private UserProfileAddresses addresses; + + public static final String SERIALIZED_NAME_MAIN_ADDRESS = "MainAddress"; + @SerializedName(SERIALIZED_NAME_MAIN_ADDRESS) + @javax.annotation.Nullable + private String mainAddress; + + public static final String SERIALIZED_NAME_CREATED = "Created"; + @SerializedName(SERIALIZED_NAME_CREATED) + @javax.annotation.Nullable + private OffsetDateTime created; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public static final String SERIALIZED_NAME_MODIFIED_DATE = "ModifiedDate"; + @SerializedName(SERIALIZED_NAME_MODIFIED_DATE) + @javax.annotation.Nullable + private OffsetDateTime modifiedDate; + + public static final String SERIALIZED_NAME_PROFILE_MODIFIED_DATE = "ProfileModifiedDate"; + @SerializedName(SERIALIZED_NAME_PROFILE_MODIFIED_DATE) + @javax.annotation.Nullable + private OffsetDateTime profileModifiedDate; + + public static final String SERIALIZED_NAME_LOCAL_CITY = "LocalCity"; + @SerializedName(SERIALIZED_NAME_LOCAL_CITY) + @javax.annotation.Nullable + private String localCity; + + public static final String SERIALIZED_NAME_PROFILE_CITY = "ProfileCity"; + @SerializedName(SERIALIZED_NAME_PROFILE_CITY) + @javax.annotation.Nullable + private String profileCity; + + public static final String SERIALIZED_NAME_LOCAL_COUNTRY = "LocalCountry"; + @SerializedName(SERIALIZED_NAME_LOCAL_COUNTRY) + @javax.annotation.Nullable + private String localCountry; + + public static final String SERIALIZED_NAME_PROFILE_COUNTRY = "ProfileCountry"; + @SerializedName(SERIALIZED_NAME_PROFILE_COUNTRY) + @javax.annotation.Nullable + private String profileCountry; + + public static final String SERIALIZED_NAME_FIRST_LOGIN = "FirstLogin"; + @SerializedName(SERIALIZED_NAME_FIRST_LOGIN) + @javax.annotation.Nullable + private Boolean firstLogin; + + public static final String SERIALIZED_NAME_IS_PROTECTED = "IsProtected"; + @SerializedName(SERIALIZED_NAME_IS_PROTECTED) + @javax.annotation.Nullable + private Boolean isProtected; + + public static final String SERIALIZED_NAME_RELATIONSHIP_STATUS = "RelationshipStatus"; + @SerializedName(SERIALIZED_NAME_RELATIONSHIP_STATUS) + @javax.annotation.Nullable + private String relationshipStatus; + + public static final String SERIALIZED_NAME_QUOTA = "Quota"; + @SerializedName(SERIALIZED_NAME_QUOTA) + @javax.annotation.Nullable + private String quota; + + public static final String SERIALIZED_NAME_INTERESTED_IN = "InterestedIn"; + @SerializedName(SERIALIZED_NAME_INTERESTED_IN) + @javax.annotation.Nullable + private List<String> interestedIn; + + public static final String SERIALIZED_NAME_INTERESTS = "Interests"; + @SerializedName(SERIALIZED_NAME_INTERESTS) + @javax.annotation.Nullable + private UserProfileInterests interests; + + public static final String SERIALIZED_NAME_RELIGION = "Religion"; + @SerializedName(SERIALIZED_NAME_RELIGION) + @javax.annotation.Nullable + private String religion; + + public static final String SERIALIZED_NAME_POLITICAL = "Political"; + @SerializedName(SERIALIZED_NAME_POLITICAL) + @javax.annotation.Nullable + private String political; + + public static final String SERIALIZED_NAME_SPORTS = "Sports"; + @SerializedName(SERIALIZED_NAME_SPORTS) + @javax.annotation.Nullable + private UserProfileSports sports; + + public static final String SERIALIZED_NAME_INSPIRATIONAL_PEOPLE = "InspirationalPeople"; + @SerializedName(SERIALIZED_NAME_INSPIRATIONAL_PEOPLE) + @javax.annotation.Nullable + private UserProfileInspirationalPeople inspirationalPeople; + + public static final String SERIALIZED_NAME_HTTPS_IMAGE_URL = "HttpsImageUrl"; + @SerializedName(SERIALIZED_NAME_HTTPS_IMAGE_URL) + @javax.annotation.Nullable + private UserProfileHttpsImageUrl httpsImageUrl; + + public static final String SERIALIZED_NAME_FOLLOWERS_COUNT = "FollowersCount"; + @SerializedName(SERIALIZED_NAME_FOLLOWERS_COUNT) + @javax.annotation.Nullable + private Integer followersCount; + + public static final String SERIALIZED_NAME_FRIENDS_COUNT = "FriendsCount"; + @SerializedName(SERIALIZED_NAME_FRIENDS_COUNT) + @javax.annotation.Nullable + private Integer friendsCount; + + public static final String SERIALIZED_NAME_IS_GEO_ENABLED = "IsGeoEnabled"; + @SerializedName(SERIALIZED_NAME_IS_GEO_ENABLED) + @javax.annotation.Nullable + private String isGeoEnabled; + + public static final String SERIALIZED_NAME_TOTAL_STATUSES_COUNT = "TotalStatusesCount"; + @SerializedName(SERIALIZED_NAME_TOTAL_STATUSES_COUNT) + @javax.annotation.Nullable + private Integer totalStatusesCount; + + public static final String SERIALIZED_NAME_ASSOCIATIONS = "Associations"; + @SerializedName(SERIALIZED_NAME_ASSOCIATIONS) + @javax.annotation.Nullable + private String associations; + + public static final String SERIALIZED_NAME_NUM_RECOMMENDERS = "NumRecommenders"; + @SerializedName(SERIALIZED_NAME_NUM_RECOMMENDERS) + @javax.annotation.Nullable + private Integer numRecommenders; + + public static final String SERIALIZED_NAME_HONORS = "Honors"; + @SerializedName(SERIALIZED_NAME_HONORS) + @javax.annotation.Nullable + private String honors; + + public static final String SERIALIZED_NAME_AWARDS = "Awards"; + @SerializedName(SERIALIZED_NAME_AWARDS) + @javax.annotation.Nullable + private UserProfileAwards awards; + + public static final String SERIALIZED_NAME_SKILLS = "Skills"; + @SerializedName(SERIALIZED_NAME_SKILLS) + @javax.annotation.Nullable + private UserProfileSkills skills; + + public static final String SERIALIZED_NAME_CURRENT_STATUS = "CurrentStatus"; + @SerializedName(SERIALIZED_NAME_CURRENT_STATUS) + @javax.annotation.Nullable + private UserProfileCurrentStatus currentStatus; + + public static final String SERIALIZED_NAME_CERTIFICATIONS = "Certifications"; + @SerializedName(SERIALIZED_NAME_CERTIFICATIONS) + @javax.annotation.Nullable + private UserProfileCertifications certifications; + + public static final String SERIALIZED_NAME_COURSES = "Courses"; + @SerializedName(SERIALIZED_NAME_COURSES) + @javax.annotation.Nullable + private UserProfileCourses courses; + + public static final String SERIALIZED_NAME_VOLUNTEER = "Volunteer"; + @SerializedName(SERIALIZED_NAME_VOLUNTEER) + @javax.annotation.Nullable + private UserProfileVolunteer volunteer; + + public static final String SERIALIZED_NAME_RECOMMENDATIONS_RECEIVED = "RecommendationsReceived"; + @SerializedName(SERIALIZED_NAME_RECOMMENDATIONS_RECEIVED) + @javax.annotation.Nullable + private UserProfileRecommendationsReceived recommendationsReceived; + + public static final String SERIALIZED_NAME_LANGUAGES = "Languages"; + @SerializedName(SERIALIZED_NAME_LANGUAGES) + @javax.annotation.Nullable + private UserProfileLanguages languages; + + public static final String SERIALIZED_NAME_PROJECTS = "Projects"; + @SerializedName(SERIALIZED_NAME_PROJECTS) + @javax.annotation.Nullable + private UserProfileProjects projects; + + public static final String SERIALIZED_NAME_GAMES = "Games"; + @SerializedName(SERIALIZED_NAME_GAMES) + @javax.annotation.Nullable + private UserProfileGames games; + + public static final String SERIALIZED_NAME_FAMILY = "Family"; + @SerializedName(SERIALIZED_NAME_FAMILY) + @javax.annotation.Nullable + private UserProfileFamily family; + + public static final String SERIALIZED_NAME_TELE_VISION_SHOW = "TeleVisionShow"; + @SerializedName(SERIALIZED_NAME_TELE_VISION_SHOW) + @javax.annotation.Nullable + private UserProfileTeleVisionShow teleVisionShow; + + public static final String SERIALIZED_NAME_MUTUAL_FRIENDS = "MutualFriends"; + @SerializedName(SERIALIZED_NAME_MUTUAL_FRIENDS) + @javax.annotation.Nullable + private UserProfileMutualFriends mutualFriends; + + public static final String SERIALIZED_NAME_MOVIES = "Movies"; + @SerializedName(SERIALIZED_NAME_MOVIES) + @javax.annotation.Nullable + private UserProfileMovies movies; + + public static final String SERIALIZED_NAME_BOOKS = "Books"; + @SerializedName(SERIALIZED_NAME_BOOKS) + @javax.annotation.Nullable + private UserProfileBooks books; + + public static final String SERIALIZED_NAME_AGE_RANGE = "AgeRange"; + @SerializedName(SERIALIZED_NAME_AGE_RANGE) + @javax.annotation.Nullable + private UserProfileAgeRange ageRange; + + public static final String SERIALIZED_NAME_PUBLIC_REPOSITORY = "PublicRepository"; + @SerializedName(SERIALIZED_NAME_PUBLIC_REPOSITORY) + @javax.annotation.Nullable + private UserProfilePublicRepository publicRepository; + + public static final String SERIALIZED_NAME_HIREABLE = "Hireable"; + @SerializedName(SERIALIZED_NAME_HIREABLE) + @javax.annotation.Nullable + private Boolean hireable; + + public static final String SERIALIZED_NAME_REPOSITORY_URL = "RepositoryUrl"; + @SerializedName(SERIALIZED_NAME_REPOSITORY_URL) + @javax.annotation.Nullable + private UserProfileRepositoryUrl repositoryUrl; + + public static final String SERIALIZED_NAME_AGE = "Age"; + @SerializedName(SERIALIZED_NAME_AGE) + @javax.annotation.Nullable + private Integer age; + + public static final String SERIALIZED_NAME_PATENTS = "Patents"; + @SerializedName(SERIALIZED_NAME_PATENTS) + @javax.annotation.Nullable + private UserProfilePatents patents; + + public static final String SERIALIZED_NAME_FAVORITE_THINGS = "FavoriteThings"; + @SerializedName(SERIALIZED_NAME_FAVORITE_THINGS) + @javax.annotation.Nullable + private UserProfileFavoriteThings favoriteThings; + + public static final String SERIALIZED_NAME_PROFESSIONAL_HEADLINE = "ProfessionalHeadline"; + @SerializedName(SERIALIZED_NAME_PROFESSIONAL_HEADLINE) + @javax.annotation.Nullable + private String professionalHeadline; + + public static final String SERIALIZED_NAME_RELATED_PROFILE_VIEWS = "RelatedProfileViews"; + @SerializedName(SERIALIZED_NAME_RELATED_PROFILE_VIEWS) + @javax.annotation.Nullable + private UserProfileRelatedProfileViews relatedProfileViews; + + public static final String SERIALIZED_NAME_KLOUT_SCORE = "KloutScore"; + @SerializedName(SERIALIZED_NAME_KLOUT_SCORE) + @javax.annotation.Nullable + private UserProfileKloutScore kloutScore; + + public static final String SERIALIZED_NAME_LR_USER_I_D = "LRUserID"; + @SerializedName(SERIALIZED_NAME_LR_USER_I_D) + @javax.annotation.Nullable + private String lrUserID; + + public static final String SERIALIZED_NAME_PLACES_LIVED = "PlacesLived"; + @SerializedName(SERIALIZED_NAME_PLACES_LIVED) + @javax.annotation.Nullable + private UserProfilePlacesLived placesLived; + + public static final String SERIALIZED_NAME_PUBLICATIONS = "Publications"; + @SerializedName(SERIALIZED_NAME_PUBLICATIONS) + @javax.annotation.Nullable + private UserProfilePublications publications; + + public static final String SERIALIZED_NAME_JOB_BOOKMARKS = "JobBookmarks"; + @SerializedName(SERIALIZED_NAME_JOB_BOOKMARKS) + @javax.annotation.Nullable + private UserProfileJobBookmarks jobBookmarks; + + public static final String SERIALIZED_NAME_SUGGESTIONS = "Suggestions"; + @SerializedName(SERIALIZED_NAME_SUGGESTIONS) + @javax.annotation.Nullable + private UserProfileSuggestions suggestions; + + public static final String SERIALIZED_NAME_BADGES = "Badges"; + @SerializedName(SERIALIZED_NAME_BADGES) + @javax.annotation.Nullable + private UserProfileBadges badges; + + public static final String SERIALIZED_NAME_MEMBER_URL_RESOURCES = "MemberUrlResources"; + @SerializedName(SERIALIZED_NAME_MEMBER_URL_RESOURCES) + @javax.annotation.Nullable + private UserProfileMemberUrlResources memberUrlResources; + + public static final String SERIALIZED_NAME_TOTAL_PRIVATE_REPOSITORY = "TotalPrivateRepository"; + @SerializedName(SERIALIZED_NAME_TOTAL_PRIVATE_REPOSITORY) + @javax.annotation.Nullable + private Integer totalPrivateRepository; + + public static final String SERIALIZED_NAME_CURRENCY = "Currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + @javax.annotation.Nullable + private String currency; + + public static final String SERIALIZED_NAME_STARRED_URL = "StarredUrl"; + @SerializedName(SERIALIZED_NAME_STARRED_URL) + @javax.annotation.Nullable + private UserProfileStarredUrl starredUrl; + + public static final String SERIALIZED_NAME_GISTS_URL = "GistsUrl"; + @SerializedName(SERIALIZED_NAME_GISTS_URL) + @javax.annotation.Nullable + private UserProfileGistsUrl gistsUrl; + + public static final String SERIALIZED_NAME_PUBLIC_GISTS = "PublicGists"; + @SerializedName(SERIALIZED_NAME_PUBLIC_GISTS) + @javax.annotation.Nullable + private Integer publicGists; + + public static final String SERIALIZED_NAME_PRIVATE_GISTS = "PrivateGists"; + @SerializedName(SERIALIZED_NAME_PRIVATE_GISTS) + @javax.annotation.Nullable + private Integer privateGists; + + public static final String SERIALIZED_NAME_SUBSCRIPTION = "Subscription"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION) + @javax.annotation.Nullable + private UserProfileSubscription subscription; + + public static final String SERIALIZED_NAME_COMPANY = "Company"; + @SerializedName(SERIALIZED_NAME_COMPANY) + @javax.annotation.Nullable + private String company; + + public static final String SERIALIZED_NAME_GRAVATAR_IMAGE_URL = "GravatarImageUrl"; + @SerializedName(SERIALIZED_NAME_GRAVATAR_IMAGE_URL) + @javax.annotation.Nullable + private UserProfileGravatarImageUrl gravatarImageUrl; + + public static final String SERIALIZED_NAME_PROFILE_IMAGE_URLS = "ProfileImageUrls"; + @SerializedName(SERIALIZED_NAME_PROFILE_IMAGE_URLS) + @javax.annotation.Nullable + private UserProfileProfileImageUrls profileImageUrls; + + public static final String SERIALIZED_NAME_WEB_PROFILES = "WebProfiles"; + @SerializedName(SERIALIZED_NAME_WEB_PROFILES) + @javax.annotation.Nullable + private UserProfileWebProfiles webProfiles; + + public static final String SERIALIZED_NAME_PINS_COUNT = "PinsCount"; + @SerializedName(SERIALIZED_NAME_PINS_COUNT) + @javax.annotation.Nullable + private Integer pinsCount; + + public static final String SERIALIZED_NAME_BOARDS_COUNT = "BoardsCount"; + @SerializedName(SERIALIZED_NAME_BOARDS_COUNT) + @javax.annotation.Nullable + private Integer boardsCount; + + public static final String SERIALIZED_NAME_LIKES_COUNT = "LikesCount"; + @SerializedName(SERIALIZED_NAME_LIKES_COUNT) + @javax.annotation.Nullable + private Integer likesCount; + + public static final String SERIALIZED_NAME_EMAIL_VERIFIED_FROM_SOCIAL = "EmailVerifiedFromSocial"; + @SerializedName(SERIALIZED_NAME_EMAIL_VERIFIED_FROM_SOCIAL) + @javax.annotation.Nullable + private Boolean emailVerifiedFromSocial; + + public static final String SERIALIZED_NAME_SIGNUP_DATE = "SignupDate"; + @SerializedName(SERIALIZED_NAME_SIGNUP_DATE) + @javax.annotation.Nullable + private OffsetDateTime signupDate; + + public static final String SERIALIZED_NAME_LAST_LOGIN_DATE = "LastLoginDate"; + @SerializedName(SERIALIZED_NAME_LAST_LOGIN_DATE) + @javax.annotation.Nullable + private OffsetDateTime lastLoginDate; + + public static final String SERIALIZED_NAME_CUSTOM_FIELDS = "CustomFields"; + @SerializedName(SERIALIZED_NAME_CUSTOM_FIELDS) + @javax.annotation.Nullable + private UserProfileCustomFields customFields; + + public static final String SERIALIZED_NAME_LAST_PASSWORD_CHANGE_DATE = "LastPasswordChangeDate"; + @SerializedName(SERIALIZED_NAME_LAST_PASSWORD_CHANGE_DATE) + @javax.annotation.Nullable + private OffsetDateTime lastPasswordChangeDate; + + public static final String SERIALIZED_NAME_PASSWORD_EXPIRATION_DATE = "PasswordExpirationDate"; + @SerializedName(SERIALIZED_NAME_PASSWORD_EXPIRATION_DATE) + @javax.annotation.Nullable + private OffsetDateTime passwordExpirationDate; + + public static final String SERIALIZED_NAME_LAST_PASSWORD_CHANGE_TOKEN = "LastPasswordChangeToken"; + @SerializedName(SERIALIZED_NAME_LAST_PASSWORD_CHANGE_TOKEN) + @javax.annotation.Nullable + private String lastPasswordChangeToken; + + public static final String SERIALIZED_NAME_EMAIL_VERIFIED = "EmailVerified"; + @SerializedName(SERIALIZED_NAME_EMAIL_VERIFIED) + @javax.annotation.Nullable + private Boolean emailVerified; + + public static final String SERIALIZED_NAME_IS_ACTIVE = "IsActive"; + @SerializedName(SERIALIZED_NAME_IS_ACTIVE) + @javax.annotation.Nullable + private Boolean isActive; + + public static final String SERIALIZED_NAME_IS_DELETED = "IsDeleted"; + @SerializedName(SERIALIZED_NAME_IS_DELETED) + @javax.annotation.Nullable + private Boolean isDeleted; + + public static final String SERIALIZED_NAME_IS_EMAIL_SUBSCRIBED = "IsEmailSubscribed"; + @SerializedName(SERIALIZED_NAME_IS_EMAIL_SUBSCRIBED) + @javax.annotation.Nullable + private Boolean isEmailSubscribed; + + public static final String SERIALIZED_NAME_USER_NAME = "UserName"; + @SerializedName(SERIALIZED_NAME_USER_NAME) + @javax.annotation.Nullable + private String userName; + + public static final String SERIALIZED_NAME_NO_OF_LOGINS = "NoOfLogins"; + @SerializedName(SERIALIZED_NAME_NO_OF_LOGINS) + @javax.annotation.Nullable + private Integer noOfLogins; + + public static final String SERIALIZED_NAME_PREVIOUS_UIDS = "PreviousUids"; + @SerializedName(SERIALIZED_NAME_PREVIOUS_UIDS) + @javax.annotation.Nullable + private List<String> previousUids; + + public static final String SERIALIZED_NAME_PHONE_ID = "PhoneId"; + @SerializedName(SERIALIZED_NAME_PHONE_ID) + @javax.annotation.Nullable + private String phoneId; + + public static final String SERIALIZED_NAME_PHONE_ID_VERIFIED = "PhoneIdVerified"; + @SerializedName(SERIALIZED_NAME_PHONE_ID_VERIFIED) + @javax.annotation.Nullable + private Boolean phoneIdVerified; + + public static final String SERIALIZED_NAME_ROLES = "Roles"; + @SerializedName(SERIALIZED_NAME_ROLES) + @javax.annotation.Nullable + private List<String> roles; + + public static final String SERIALIZED_NAME_EXTERNAL_USER_LOGIN_ID = "ExternalUserLoginId"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_USER_LOGIN_ID) + @javax.annotation.Nullable + private String externalUserLoginId; + + public static final String SERIALIZED_NAME_FAILED_LOGIN_ATTEMPT = "FailedLoginAttempt"; + @SerializedName(SERIALIZED_NAME_FAILED_LOGIN_ATTEMPT) + @javax.annotation.Nullable + private Integer failedLoginAttempt; + + public static final String SERIALIZED_NAME_SECURITY_QUESTION_FAILED_RESET_PASSWORD_ATTEMPTS = "SecurityQuestionFailedResetPasswordAttempts"; + @SerializedName(SERIALIZED_NAME_SECURITY_QUESTION_FAILED_RESET_PASSWORD_ATTEMPTS) + @javax.annotation.Nullable + private Integer securityQuestionFailedResetPasswordAttempts; + + public static final String SERIALIZED_NAME_SECURITY_QUESTION_FAILED_LOGIN_ATTEMPT = "SecurityQuestionFailedLoginAttempt"; + @SerializedName(SERIALIZED_NAME_SECURITY_QUESTION_FAILED_LOGIN_ATTEMPT) + @javax.annotation.Nullable + private Integer securityQuestionFailedLoginAttempt; + + public static final String SERIALIZED_NAME_DISABLE_LOGIN = "DisableLogin"; + @SerializedName(SERIALIZED_NAME_DISABLE_LOGIN) + @javax.annotation.Nullable + private Boolean disableLogin; + + public static final String SERIALIZED_NAME_REGISTRATION_PROVIDER = "RegistrationProvider"; + @SerializedName(SERIALIZED_NAME_REGISTRATION_PROVIDER) + @javax.annotation.Nullable + private String registrationProvider; + + public static final String SERIALIZED_NAME_IS_LOGIN_LOCKED = "IsLoginLocked"; + @SerializedName(SERIALIZED_NAME_IS_LOGIN_LOCKED) + @javax.annotation.Nullable + private Boolean isLoginLocked; + + public static final String SERIALIZED_NAME_LOGIN_LOCKED_TYPE = "LoginLockedType"; + @SerializedName(SERIALIZED_NAME_LOGIN_LOCKED_TYPE) + @javax.annotation.Nullable + private String loginLockedType; + + public static final String SERIALIZED_NAME_LAST_LOGIN_LOCATION = "LastLoginLocation"; + @SerializedName(SERIALIZED_NAME_LAST_LOGIN_LOCATION) + @javax.annotation.Nullable + private String lastLoginLocation; + + public static final String SERIALIZED_NAME_REGISTRATION_SOURCE = "RegistrationSource"; + @SerializedName(SERIALIZED_NAME_REGISTRATION_SOURCE) + @javax.annotation.Nullable + private String registrationSource; + + public static final String SERIALIZED_NAME_IS_CUSTOM_UID = "IsCustomUid"; + @SerializedName(SERIALIZED_NAME_IS_CUSTOM_UID) + @javax.annotation.Nullable + private Boolean isCustomUid; + + public static final String SERIALIZED_NAME_UNVERIFIED_EMAIL = "UnverifiedEmail"; + @SerializedName(SERIALIZED_NAME_UNVERIFIED_EMAIL) + @javax.annotation.Nullable + private UserProfileUnverifiedEmail unverifiedEmail; + + public static final String SERIALIZED_NAME_ROLE_CONTEXT = "RoleContext"; + @SerializedName(SERIALIZED_NAME_ROLE_CONTEXT) + @javax.annotation.Nullable + private UserProfileRoleContext roleContext; + + public static final String SERIALIZED_NAME_KNOWN_LOGIN_VARIABLES = "KnownLoginVariables"; + @SerializedName(SERIALIZED_NAME_KNOWN_LOGIN_VARIABLES) + @javax.annotation.Nullable + private UserProfileKnownLoginVariables knownLoginVariables; + + public static final String SERIALIZED_NAME_IS_SECURE_PASSWORD = "IsSecurePassword"; + @SerializedName(SERIALIZED_NAME_IS_SECURE_PASSWORD) + @javax.annotation.Nullable + private Boolean isSecurePassword; + + public static final String SERIALIZED_NAME_PRIVACY_POLICY = "PrivacyPolicy"; + @SerializedName(SERIALIZED_NAME_PRIVACY_POLICY) + @javax.annotation.Nullable + private UserProfilePrivacyPolicy privacyPolicy; + + public static final String SERIALIZED_NAME_LOGIN_LOCKED_TIMEOUT = "LoginLockedTimeout"; + @SerializedName(SERIALIZED_NAME_LOGIN_LOCKED_TIMEOUT) + @javax.annotation.Nullable + private String loginLockedTimeout; + + public static final String SERIALIZED_NAME_EXTERNAL_IDS = "ExternalIds"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_IDS) + @javax.annotation.Nullable + private UserProfileExternalIds externalIds; + + public static final String SERIALIZED_NAME_IS_REQUIRED_FIELDS_FILLED_ONCE = "IsRequiredFieldsFilledOnce"; + @SerializedName(SERIALIZED_NAME_IS_REQUIRED_FIELDS_FILLED_ONCE) + @javax.annotation.Nullable + private Boolean isRequiredFieldsFilledOnce; + + public static final String SERIALIZED_NAME_SIGNUP_LOG = "SignupLog"; + @SerializedName(SERIALIZED_NAME_SIGNUP_LOG) + @javax.annotation.Nullable + private UserProfileSignupLog signupLog; + + public static final String SERIALIZED_NAME_LAST_ACCEPTED_CONSENT_VERSION = "LastAcceptedConsentVersion"; + @SerializedName(SERIALIZED_NAME_LAST_ACCEPTED_CONSENT_VERSION) + @javax.annotation.Nullable + private Float lastAcceptedConsentVersion; + + public static final String SERIALIZED_NAME_USER_AGENT = "user_agent"; + @SerializedName(SERIALIZED_NAME_USER_AGENT) + @javax.annotation.Nullable + private UserProfileUserAgent userAgent; + + public UserProfile() { + } + + public UserProfile appName(@javax.annotation.Nullable String appName) { + this.appName = appName; + return this; + } + + /** + * Application name. + * @return appName + */ + @javax.annotation.Nullable + public String getAppName() { + return appName; + } + + public void setAppName(@javax.annotation.Nullable String appName) { + this.appName = appName; + } + + + public UserProfile uid(@javax.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * Unique User identifier. + * @return uid + */ + @javax.annotation.Nullable + public String getUid() { + return uid; + } + + public void setUid(@javax.annotation.Nullable String uid) { + this.uid = uid; + } + + + public UserProfile ID(@javax.annotation.Nullable String ID) { + this.ID = ID; + return this; + } + + /** + * Internal User ID. + * @return ID + */ + @javax.annotation.Nullable + public String getID() { + return ID; + } + + public void setID(@javax.annotation.Nullable String ID) { + this.ID = ID; + } + + + public UserProfile provider(@javax.annotation.Nullable String provider) { + this.provider = provider; + return this; + } + + /** + * Authentication provider. + * @return provider + */ + @javax.annotation.Nullable + public String getProvider() { + return provider; + } + + public void setProvider(@javax.annotation.Nullable String provider) { + this.provider = provider; + } + + + public UserProfile prefix(@javax.annotation.Nullable String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Name prefix. + * @return prefix + */ + @javax.annotation.Nullable + public String getPrefix() { + return prefix; + } + + public void setPrefix(@javax.annotation.Nullable String prefix) { + this.prefix = prefix; + } + + + public UserProfile firstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * User's first name. + * @return firstName + */ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + } + + + public UserProfile middleName(@javax.annotation.Nullable String middleName) { + this.middleName = middleName; + return this; + } + + /** + * User's middle name. + * @return middleName + */ + @javax.annotation.Nullable + public String getMiddleName() { + return middleName; + } + + public void setMiddleName(@javax.annotation.Nullable String middleName) { + this.middleName = middleName; + } + + + public UserProfile lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * User's last name. + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + + public UserProfile suffix(@javax.annotation.Nullable String suffix) { + this.suffix = suffix; + return this; + } + + /** + * Name suffix. + * @return suffix + */ + @javax.annotation.Nullable + public String getSuffix() { + return suffix; + } + + public void setSuffix(@javax.annotation.Nullable String suffix) { + this.suffix = suffix; + } + + + public UserProfile fullName(@javax.annotation.Nullable String fullName) { + this.fullName = fullName; + return this; + } + + /** + * Full name. + * @return fullName + */ + @javax.annotation.Nullable + public String getFullName() { + return fullName; + } + + public void setFullName(@javax.annotation.Nullable String fullName) { + this.fullName = fullName; + } + + + public UserProfile nickName(@javax.annotation.Nullable String nickName) { + this.nickName = nickName; + return this; + } + + /** + * Nickname. + * @return nickName + */ + @javax.annotation.Nullable + public String getNickName() { + return nickName; + } + + public void setNickName(@javax.annotation.Nullable String nickName) { + this.nickName = nickName; + } + + + public UserProfile profileName(@javax.annotation.Nullable String profileName) { + this.profileName = profileName; + return this; + } + + /** + * Profile name. + * @return profileName + */ + @javax.annotation.Nullable + public String getProfileName() { + return profileName; + } + + public void setProfileName(@javax.annotation.Nullable String profileName) { + this.profileName = profileName; + } + + + public UserProfile birthDate(@javax.annotation.Nullable LocalDate birthDate) { + this.birthDate = birthDate; + return this; + } + + /** + * Birth date. + * @return birthDate + */ + @javax.annotation.Nullable + public LocalDate getBirthDate() { + return birthDate; + } + + public void setBirthDate(@javax.annotation.Nullable LocalDate birthDate) { + this.birthDate = birthDate; + } + + + public UserProfile gender(@javax.annotation.Nullable String gender) { + this.gender = gender; + return this; + } + + /** + * Gender. + * @return gender + */ + @javax.annotation.Nullable + public String getGender() { + return gender; + } + + public void setGender(@javax.annotation.Nullable String gender) { + this.gender = gender; + } + + + public UserProfile website(@javax.annotation.Nullable String website) { + this.website = website; + return this; + } + + /** + * Personal website URL. + * @return website + */ + @javax.annotation.Nullable + public String getWebsite() { + return website; + } + + public void setWebsite(@javax.annotation.Nullable String website) { + this.website = website; + } + + + public UserProfile email(@javax.annotation.Nullable UserProfileEmail email) { + this.email = email; + return this; + } + + /** + * Get email + * @return email + */ + @javax.annotation.Nullable + public UserProfileEmail getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable UserProfileEmail email) { + this.email = email; + } + + + public UserProfile country(@javax.annotation.Nullable UserProfileCountry country) { + this.country = country; + return this; + } + + /** + * Get country + * @return country + */ + @javax.annotation.Nullable + public UserProfileCountry getCountry() { + return country; + } + + public void setCountry(@javax.annotation.Nullable UserProfileCountry country) { + this.country = country; + } + + + public UserProfile thumbnailImageUrl(@javax.annotation.Nullable String thumbnailImageUrl) { + this.thumbnailImageUrl = thumbnailImageUrl; + return this; + } + + /** + * Thumbnail image URL. + * @return thumbnailImageUrl + */ + @javax.annotation.Nullable + public String getThumbnailImageUrl() { + return thumbnailImageUrl; + } + + public void setThumbnailImageUrl(@javax.annotation.Nullable String thumbnailImageUrl) { + this.thumbnailImageUrl = thumbnailImageUrl; + } + + + public UserProfile imageUrl(@javax.annotation.Nullable UserProfileImageUrl imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** + * Get imageUrl + * @return imageUrl + */ + @javax.annotation.Nullable + public UserProfileImageUrl getImageUrl() { + return imageUrl; + } + + public void setImageUrl(@javax.annotation.Nullable UserProfileImageUrl imageUrl) { + this.imageUrl = imageUrl; + } + + + public UserProfile favicon(@javax.annotation.Nullable UserProfileFavicon favicon) { + this.favicon = favicon; + return this; + } + + /** + * Get favicon + * @return favicon + */ + @javax.annotation.Nullable + public UserProfileFavicon getFavicon() { + return favicon; + } + + public void setFavicon(@javax.annotation.Nullable UserProfileFavicon favicon) { + this.favicon = favicon; + } + + + public UserProfile profileUrl(@javax.annotation.Nullable UserProfileProfileUrl profileUrl) { + this.profileUrl = profileUrl; + return this; + } + + /** + * Get profileUrl + * @return profileUrl + */ + @javax.annotation.Nullable + public UserProfileProfileUrl getProfileUrl() { + return profileUrl; + } + + public void setProfileUrl(@javax.annotation.Nullable UserProfileProfileUrl profileUrl) { + this.profileUrl = profileUrl; + } + + + public UserProfile homeTown(@javax.annotation.Nullable String homeTown) { + this.homeTown = homeTown; + return this; + } + + /** + * Hometown. + * @return homeTown + */ + @javax.annotation.Nullable + public String getHomeTown() { + return homeTown; + } + + public void setHomeTown(@javax.annotation.Nullable String homeTown) { + this.homeTown = homeTown; + } + + + public UserProfile state(@javax.annotation.Nullable String state) { + this.state = state; + return this; + } + + /** + * State. + * @return state + */ + @javax.annotation.Nullable + public String getState() { + return state; + } + + public void setState(@javax.annotation.Nullable String state) { + this.state = state; + } + + + public UserProfile city(@javax.annotation.Nullable String city) { + this.city = city; + return this; + } + + /** + * City. + * @return city + */ + @javax.annotation.Nullable + public String getCity() { + return city; + } + + public void setCity(@javax.annotation.Nullable String city) { + this.city = city; + } + + + public UserProfile industry(@javax.annotation.Nullable String industry) { + this.industry = industry; + return this; + } + + /** + * Industry. + * @return industry + */ + @javax.annotation.Nullable + public String getIndustry() { + return industry; + } + + public void setIndustry(@javax.annotation.Nullable String industry) { + this.industry = industry; + } + + + public UserProfile about(@javax.annotation.Nullable String about) { + this.about = about; + return this; + } + + /** + * About the User. + * @return about + */ + @javax.annotation.Nullable + public String getAbout() { + return about; + } + + public void setAbout(@javax.annotation.Nullable String about) { + this.about = about; + } + + + public UserProfile timeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * Time zone. + * @return timeZone + */ + @javax.annotation.Nullable + public String getTimeZone() { + return timeZone; + } + + public void setTimeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + } + + + public UserProfile localLanguage(@javax.annotation.Nullable String localLanguage) { + this.localLanguage = localLanguage; + return this; + } + + /** + * Local language. + * @return localLanguage + */ + @javax.annotation.Nullable + public String getLocalLanguage() { + return localLanguage; + } + + public void setLocalLanguage(@javax.annotation.Nullable String localLanguage) { + this.localLanguage = localLanguage; + } + + + public UserProfile coverPhoto(@javax.annotation.Nullable UserProfileCoverPhoto coverPhoto) { + this.coverPhoto = coverPhoto; + return this; + } + + /** + * Get coverPhoto + * @return coverPhoto + */ + @javax.annotation.Nullable + public UserProfileCoverPhoto getCoverPhoto() { + return coverPhoto; + } + + public void setCoverPhoto(@javax.annotation.Nullable UserProfileCoverPhoto coverPhoto) { + this.coverPhoto = coverPhoto; + } + + + public UserProfile tagLine(@javax.annotation.Nullable String tagLine) { + this.tagLine = tagLine; + return this; + } + + /** + * Tag line. + * @return tagLine + */ + @javax.annotation.Nullable + public String getTagLine() { + return tagLine; + } + + public void setTagLine(@javax.annotation.Nullable String tagLine) { + this.tagLine = tagLine; + } + + + public UserProfile language(@javax.annotation.Nullable String language) { + this.language = language; + return this; + } + + /** + * Preferred language. + * @return language + */ + @javax.annotation.Nullable + public String getLanguage() { + return language; + } + + public void setLanguage(@javax.annotation.Nullable String language) { + this.language = language; + } + + + public UserProfile verified(@javax.annotation.Nullable String verified) { + this.verified = verified; + return this; + } + + /** + * Verification status. + * @return verified + */ + @javax.annotation.Nullable + public String getVerified() { + return verified; + } + + public void setVerified(@javax.annotation.Nullable String verified) { + this.verified = verified; + } + + + public UserProfile updatedTime(@javax.annotation.Nullable OffsetDateTime updatedTime) { + this.updatedTime = updatedTime; + return this; + } + + /** + * Last updated time. + * @return updatedTime + */ + @javax.annotation.Nullable + public OffsetDateTime getUpdatedTime() { + return updatedTime; + } + + public void setUpdatedTime(@javax.annotation.Nullable OffsetDateTime updatedTime) { + this.updatedTime = updatedTime; + } + + + public UserProfile positions(@javax.annotation.Nullable UserProfilePositions positions) { + this.positions = positions; + return this; + } + + /** + * Get positions + * @return positions + */ + @javax.annotation.Nullable + public UserProfilePositions getPositions() { + return positions; + } + + public void setPositions(@javax.annotation.Nullable UserProfilePositions positions) { + this.positions = positions; + } + + + public UserProfile educations(@javax.annotation.Nullable UserProfileEducations educations) { + this.educations = educations; + return this; + } + + /** + * Get educations + * @return educations + */ + @javax.annotation.Nullable + public UserProfileEducations getEducations() { + return educations; + } + + public void setEducations(@javax.annotation.Nullable UserProfileEducations educations) { + this.educations = educations; + } + + + public UserProfile phoneNumbers(@javax.annotation.Nullable UserProfilePhoneNumbers phoneNumbers) { + this.phoneNumbers = phoneNumbers; + return this; + } + + /** + * Get phoneNumbers + * @return phoneNumbers + */ + @javax.annotation.Nullable + public UserProfilePhoneNumbers getPhoneNumbers() { + return phoneNumbers; + } + + public void setPhoneNumbers(@javax.annotation.Nullable UserProfilePhoneNumbers phoneNumbers) { + this.phoneNumbers = phoneNumbers; + } + + + public UserProfile imAccounts(@javax.annotation.Nullable UserProfileIMAccounts imAccounts) { + this.imAccounts = imAccounts; + return this; + } + + /** + * Get imAccounts + * @return imAccounts + */ + @javax.annotation.Nullable + public UserProfileIMAccounts getImAccounts() { + return imAccounts; + } + + public void setImAccounts(@javax.annotation.Nullable UserProfileIMAccounts imAccounts) { + this.imAccounts = imAccounts; + } + + + public UserProfile addresses(@javax.annotation.Nullable UserProfileAddresses addresses) { + this.addresses = addresses; + return this; + } + + /** + * Get addresses + * @return addresses + */ + @javax.annotation.Nullable + public UserProfileAddresses getAddresses() { + return addresses; + } + + public void setAddresses(@javax.annotation.Nullable UserProfileAddresses addresses) { + this.addresses = addresses; + } + + + public UserProfile mainAddress(@javax.annotation.Nullable String mainAddress) { + this.mainAddress = mainAddress; + return this; + } + + /** + * Main address. + * @return mainAddress + */ + @javax.annotation.Nullable + public String getMainAddress() { + return mainAddress; + } + + public void setMainAddress(@javax.annotation.Nullable String mainAddress) { + this.mainAddress = mainAddress; + } + + + public UserProfile created(@javax.annotation.Nullable OffsetDateTime created) { + this.created = created; + return this; + } + + /** + * Created timestamp. + * @return created + */ + @javax.annotation.Nullable + public OffsetDateTime getCreated() { + return created; + } + + public void setCreated(@javax.annotation.Nullable OffsetDateTime created) { + this.created = created; + } + + + public UserProfile createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Created date. + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + + public UserProfile modifiedDate(@javax.annotation.Nullable OffsetDateTime modifiedDate) { + this.modifiedDate = modifiedDate; + return this; + } + + /** + * Modified date. + * @return modifiedDate + */ + @javax.annotation.Nullable + public OffsetDateTime getModifiedDate() { + return modifiedDate; + } + + public void setModifiedDate(@javax.annotation.Nullable OffsetDateTime modifiedDate) { + this.modifiedDate = modifiedDate; + } + + + public UserProfile profileModifiedDate(@javax.annotation.Nullable OffsetDateTime profileModifiedDate) { + this.profileModifiedDate = profileModifiedDate; + return this; + } + + /** + * Profile modified date. + * @return profileModifiedDate + */ + @javax.annotation.Nullable + public OffsetDateTime getProfileModifiedDate() { + return profileModifiedDate; + } + + public void setProfileModifiedDate(@javax.annotation.Nullable OffsetDateTime profileModifiedDate) { + this.profileModifiedDate = profileModifiedDate; + } + + + public UserProfile localCity(@javax.annotation.Nullable String localCity) { + this.localCity = localCity; + return this; + } + + /** + * Local city. + * @return localCity + */ + @javax.annotation.Nullable + public String getLocalCity() { + return localCity; + } + + public void setLocalCity(@javax.annotation.Nullable String localCity) { + this.localCity = localCity; + } + + + public UserProfile profileCity(@javax.annotation.Nullable String profileCity) { + this.profileCity = profileCity; + return this; + } + + /** + * Profile city. + * @return profileCity + */ + @javax.annotation.Nullable + public String getProfileCity() { + return profileCity; + } + + public void setProfileCity(@javax.annotation.Nullable String profileCity) { + this.profileCity = profileCity; + } + + + public UserProfile localCountry(@javax.annotation.Nullable String localCountry) { + this.localCountry = localCountry; + return this; + } + + /** + * Local country. + * @return localCountry + */ + @javax.annotation.Nullable + public String getLocalCountry() { + return localCountry; + } + + public void setLocalCountry(@javax.annotation.Nullable String localCountry) { + this.localCountry = localCountry; + } + + + public UserProfile profileCountry(@javax.annotation.Nullable String profileCountry) { + this.profileCountry = profileCountry; + return this; + } + + /** + * Profile country. + * @return profileCountry + */ + @javax.annotation.Nullable + public String getProfileCountry() { + return profileCountry; + } + + public void setProfileCountry(@javax.annotation.Nullable String profileCountry) { + this.profileCountry = profileCountry; + } + + + public UserProfile firstLogin(@javax.annotation.Nullable Boolean firstLogin) { + this.firstLogin = firstLogin; + return this; + } + + /** + * Whether this is the User's first login. + * @return firstLogin + */ + @javax.annotation.Nullable + public Boolean getFirstLogin() { + return firstLogin; + } + + public void setFirstLogin(@javax.annotation.Nullable Boolean firstLogin) { + this.firstLogin = firstLogin; + } + + + public UserProfile isProtected(@javax.annotation.Nullable Boolean isProtected) { + this.isProtected = isProtected; + return this; + } + + /** + * Whether the profile is protected. + * @return isProtected + */ + @javax.annotation.Nullable + public Boolean getIsProtected() { + return isProtected; + } + + public void setIsProtected(@javax.annotation.Nullable Boolean isProtected) { + this.isProtected = isProtected; + } + + + public UserProfile relationshipStatus(@javax.annotation.Nullable String relationshipStatus) { + this.relationshipStatus = relationshipStatus; + return this; + } + + /** + * Relationship status. + * @return relationshipStatus + */ + @javax.annotation.Nullable + public String getRelationshipStatus() { + return relationshipStatus; + } + + public void setRelationshipStatus(@javax.annotation.Nullable String relationshipStatus) { + this.relationshipStatus = relationshipStatus; + } + + + public UserProfile quota(@javax.annotation.Nullable String quota) { + this.quota = quota; + return this; + } + + /** + * Quota. + * @return quota + */ + @javax.annotation.Nullable + public String getQuota() { + return quota; + } + + public void setQuota(@javax.annotation.Nullable String quota) { + this.quota = quota; + } + + + public UserProfile interestedIn(@javax.annotation.Nullable List<String> interestedIn) { + this.interestedIn = interestedIn; + return this; + } + + public UserProfile addInterestedInItem(String interestedInItem) { + if (this.interestedIn == null) { + this.interestedIn = new ArrayList<>(); + } + this.interestedIn.add(interestedInItem); + return this; + } + + /** + * List of interests. + * @return interestedIn + */ + @javax.annotation.Nullable + public List<String> getInterestedIn() { + return interestedIn; + } + + public void setInterestedIn(@javax.annotation.Nullable List<String> interestedIn) { + this.interestedIn = interestedIn; + } + + + public UserProfile interests(@javax.annotation.Nullable UserProfileInterests interests) { + this.interests = interests; + return this; + } + + /** + * Get interests + * @return interests + */ + @javax.annotation.Nullable + public UserProfileInterests getInterests() { + return interests; + } + + public void setInterests(@javax.annotation.Nullable UserProfileInterests interests) { + this.interests = interests; + } + + + public UserProfile religion(@javax.annotation.Nullable String religion) { + this.religion = religion; + return this; + } + + /** + * Religion. + * @return religion + */ + @javax.annotation.Nullable + public String getReligion() { + return religion; + } + + public void setReligion(@javax.annotation.Nullable String religion) { + this.religion = religion; + } + + + public UserProfile political(@javax.annotation.Nullable String political) { + this.political = political; + return this; + } + + /** + * Political views. + * @return political + */ + @javax.annotation.Nullable + public String getPolitical() { + return political; + } + + public void setPolitical(@javax.annotation.Nullable String political) { + this.political = political; + } + + + public UserProfile sports(@javax.annotation.Nullable UserProfileSports sports) { + this.sports = sports; + return this; + } + + /** + * Get sports + * @return sports + */ + @javax.annotation.Nullable + public UserProfileSports getSports() { + return sports; + } + + public void setSports(@javax.annotation.Nullable UserProfileSports sports) { + this.sports = sports; + } + + + public UserProfile inspirationalPeople(@javax.annotation.Nullable UserProfileInspirationalPeople inspirationalPeople) { + this.inspirationalPeople = inspirationalPeople; + return this; + } + + /** + * Get inspirationalPeople + * @return inspirationalPeople + */ + @javax.annotation.Nullable + public UserProfileInspirationalPeople getInspirationalPeople() { + return inspirationalPeople; + } + + public void setInspirationalPeople(@javax.annotation.Nullable UserProfileInspirationalPeople inspirationalPeople) { + this.inspirationalPeople = inspirationalPeople; + } + + + public UserProfile httpsImageUrl(@javax.annotation.Nullable UserProfileHttpsImageUrl httpsImageUrl) { + this.httpsImageUrl = httpsImageUrl; + return this; + } + + /** + * Get httpsImageUrl + * @return httpsImageUrl + */ + @javax.annotation.Nullable + public UserProfileHttpsImageUrl getHttpsImageUrl() { + return httpsImageUrl; + } + + public void setHttpsImageUrl(@javax.annotation.Nullable UserProfileHttpsImageUrl httpsImageUrl) { + this.httpsImageUrl = httpsImageUrl; + } + + + public UserProfile followersCount(@javax.annotation.Nullable Integer followersCount) { + this.followersCount = followersCount; + return this; + } + + /** + * Number of followers. + * @return followersCount + */ + @javax.annotation.Nullable + public Integer getFollowersCount() { + return followersCount; + } + + public void setFollowersCount(@javax.annotation.Nullable Integer followersCount) { + this.followersCount = followersCount; + } + + + public UserProfile friendsCount(@javax.annotation.Nullable Integer friendsCount) { + this.friendsCount = friendsCount; + return this; + } + + /** + * Number of friends. + * @return friendsCount + */ + @javax.annotation.Nullable + public Integer getFriendsCount() { + return friendsCount; + } + + public void setFriendsCount(@javax.annotation.Nullable Integer friendsCount) { + this.friendsCount = friendsCount; + } + + + public UserProfile isGeoEnabled(@javax.annotation.Nullable String isGeoEnabled) { + this.isGeoEnabled = isGeoEnabled; + return this; + } + + /** + * Whether geo is enabled. + * @return isGeoEnabled + */ + @javax.annotation.Nullable + public String getIsGeoEnabled() { + return isGeoEnabled; + } + + public void setIsGeoEnabled(@javax.annotation.Nullable String isGeoEnabled) { + this.isGeoEnabled = isGeoEnabled; + } + + + public UserProfile totalStatusesCount(@javax.annotation.Nullable Integer totalStatusesCount) { + this.totalStatusesCount = totalStatusesCount; + return this; + } + + /** + * Total number of statuses. + * @return totalStatusesCount + */ + @javax.annotation.Nullable + public Integer getTotalStatusesCount() { + return totalStatusesCount; + } + + public void setTotalStatusesCount(@javax.annotation.Nullable Integer totalStatusesCount) { + this.totalStatusesCount = totalStatusesCount; + } + + + public UserProfile associations(@javax.annotation.Nullable String associations) { + this.associations = associations; + return this; + } + + /** + * Associations. + * @return associations + */ + @javax.annotation.Nullable + public String getAssociations() { + return associations; + } + + public void setAssociations(@javax.annotation.Nullable String associations) { + this.associations = associations; + } + + + public UserProfile numRecommenders(@javax.annotation.Nullable Integer numRecommenders) { + this.numRecommenders = numRecommenders; + return this; + } + + /** + * Number of recommenders. + * @return numRecommenders + */ + @javax.annotation.Nullable + public Integer getNumRecommenders() { + return numRecommenders; + } + + public void setNumRecommenders(@javax.annotation.Nullable Integer numRecommenders) { + this.numRecommenders = numRecommenders; + } + + + public UserProfile honors(@javax.annotation.Nullable String honors) { + this.honors = honors; + return this; + } + + /** + * Honors. + * @return honors + */ + @javax.annotation.Nullable + public String getHonors() { + return honors; + } + + public void setHonors(@javax.annotation.Nullable String honors) { + this.honors = honors; + } + + + public UserProfile awards(@javax.annotation.Nullable UserProfileAwards awards) { + this.awards = awards; + return this; + } + + /** + * Get awards + * @return awards + */ + @javax.annotation.Nullable + public UserProfileAwards getAwards() { + return awards; + } + + public void setAwards(@javax.annotation.Nullable UserProfileAwards awards) { + this.awards = awards; + } + + + public UserProfile skills(@javax.annotation.Nullable UserProfileSkills skills) { + this.skills = skills; + return this; + } + + /** + * Get skills + * @return skills + */ + @javax.annotation.Nullable + public UserProfileSkills getSkills() { + return skills; + } + + public void setSkills(@javax.annotation.Nullable UserProfileSkills skills) { + this.skills = skills; + } + + + public UserProfile currentStatus(@javax.annotation.Nullable UserProfileCurrentStatus currentStatus) { + this.currentStatus = currentStatus; + return this; + } + + /** + * Get currentStatus + * @return currentStatus + */ + @javax.annotation.Nullable + public UserProfileCurrentStatus getCurrentStatus() { + return currentStatus; + } + + public void setCurrentStatus(@javax.annotation.Nullable UserProfileCurrentStatus currentStatus) { + this.currentStatus = currentStatus; + } + + + public UserProfile certifications(@javax.annotation.Nullable UserProfileCertifications certifications) { + this.certifications = certifications; + return this; + } + + /** + * Get certifications + * @return certifications + */ + @javax.annotation.Nullable + public UserProfileCertifications getCertifications() { + return certifications; + } + + public void setCertifications(@javax.annotation.Nullable UserProfileCertifications certifications) { + this.certifications = certifications; + } + + + public UserProfile courses(@javax.annotation.Nullable UserProfileCourses courses) { + this.courses = courses; + return this; + } + + /** + * Get courses + * @return courses + */ + @javax.annotation.Nullable + public UserProfileCourses getCourses() { + return courses; + } + + public void setCourses(@javax.annotation.Nullable UserProfileCourses courses) { + this.courses = courses; + } + + + public UserProfile volunteer(@javax.annotation.Nullable UserProfileVolunteer volunteer) { + this.volunteer = volunteer; + return this; + } + + /** + * Get volunteer + * @return volunteer + */ + @javax.annotation.Nullable + public UserProfileVolunteer getVolunteer() { + return volunteer; + } + + public void setVolunteer(@javax.annotation.Nullable UserProfileVolunteer volunteer) { + this.volunteer = volunteer; + } + + + public UserProfile recommendationsReceived(@javax.annotation.Nullable UserProfileRecommendationsReceived recommendationsReceived) { + this.recommendationsReceived = recommendationsReceived; + return this; + } + + /** + * Get recommendationsReceived + * @return recommendationsReceived + */ + @javax.annotation.Nullable + public UserProfileRecommendationsReceived getRecommendationsReceived() { + return recommendationsReceived; + } + + public void setRecommendationsReceived(@javax.annotation.Nullable UserProfileRecommendationsReceived recommendationsReceived) { + this.recommendationsReceived = recommendationsReceived; + } + + + public UserProfile languages(@javax.annotation.Nullable UserProfileLanguages languages) { + this.languages = languages; + return this; + } + + /** + * Get languages + * @return languages + */ + @javax.annotation.Nullable + public UserProfileLanguages getLanguages() { + return languages; + } + + public void setLanguages(@javax.annotation.Nullable UserProfileLanguages languages) { + this.languages = languages; + } + + + public UserProfile projects(@javax.annotation.Nullable UserProfileProjects projects) { + this.projects = projects; + return this; + } + + /** + * Get projects + * @return projects + */ + @javax.annotation.Nullable + public UserProfileProjects getProjects() { + return projects; + } + + public void setProjects(@javax.annotation.Nullable UserProfileProjects projects) { + this.projects = projects; + } + + + public UserProfile games(@javax.annotation.Nullable UserProfileGames games) { + this.games = games; + return this; + } + + /** + * Get games + * @return games + */ + @javax.annotation.Nullable + public UserProfileGames getGames() { + return games; + } + + public void setGames(@javax.annotation.Nullable UserProfileGames games) { + this.games = games; + } + + + public UserProfile family(@javax.annotation.Nullable UserProfileFamily family) { + this.family = family; + return this; + } + + /** + * Get family + * @return family + */ + @javax.annotation.Nullable + public UserProfileFamily getFamily() { + return family; + } + + public void setFamily(@javax.annotation.Nullable UserProfileFamily family) { + this.family = family; + } + + + public UserProfile teleVisionShow(@javax.annotation.Nullable UserProfileTeleVisionShow teleVisionShow) { + this.teleVisionShow = teleVisionShow; + return this; + } + + /** + * Get teleVisionShow + * @return teleVisionShow + */ + @javax.annotation.Nullable + public UserProfileTeleVisionShow getTeleVisionShow() { + return teleVisionShow; + } + + public void setTeleVisionShow(@javax.annotation.Nullable UserProfileTeleVisionShow teleVisionShow) { + this.teleVisionShow = teleVisionShow; + } + + + public UserProfile mutualFriends(@javax.annotation.Nullable UserProfileMutualFriends mutualFriends) { + this.mutualFriends = mutualFriends; + return this; + } + + /** + * Get mutualFriends + * @return mutualFriends + */ + @javax.annotation.Nullable + public UserProfileMutualFriends getMutualFriends() { + return mutualFriends; + } + + public void setMutualFriends(@javax.annotation.Nullable UserProfileMutualFriends mutualFriends) { + this.mutualFriends = mutualFriends; + } + + + public UserProfile movies(@javax.annotation.Nullable UserProfileMovies movies) { + this.movies = movies; + return this; + } + + /** + * Get movies + * @return movies + */ + @javax.annotation.Nullable + public UserProfileMovies getMovies() { + return movies; + } + + public void setMovies(@javax.annotation.Nullable UserProfileMovies movies) { + this.movies = movies; + } + + + public UserProfile books(@javax.annotation.Nullable UserProfileBooks books) { + this.books = books; + return this; + } + + /** + * Get books + * @return books + */ + @javax.annotation.Nullable + public UserProfileBooks getBooks() { + return books; + } + + public void setBooks(@javax.annotation.Nullable UserProfileBooks books) { + this.books = books; + } + + + public UserProfile ageRange(@javax.annotation.Nullable UserProfileAgeRange ageRange) { + this.ageRange = ageRange; + return this; + } + + /** + * Get ageRange + * @return ageRange + */ + @javax.annotation.Nullable + public UserProfileAgeRange getAgeRange() { + return ageRange; + } + + public void setAgeRange(@javax.annotation.Nullable UserProfileAgeRange ageRange) { + this.ageRange = ageRange; + } + + + public UserProfile publicRepository(@javax.annotation.Nullable UserProfilePublicRepository publicRepository) { + this.publicRepository = publicRepository; + return this; + } + + /** + * Get publicRepository + * @return publicRepository + */ + @javax.annotation.Nullable + public UserProfilePublicRepository getPublicRepository() { + return publicRepository; + } + + public void setPublicRepository(@javax.annotation.Nullable UserProfilePublicRepository publicRepository) { + this.publicRepository = publicRepository; + } + + + public UserProfile hireable(@javax.annotation.Nullable Boolean hireable) { + this.hireable = hireable; + return this; + } + + /** + * Whether the User is hireable. + * @return hireable + */ + @javax.annotation.Nullable + public Boolean getHireable() { + return hireable; + } + + public void setHireable(@javax.annotation.Nullable Boolean hireable) { + this.hireable = hireable; + } + + + public UserProfile repositoryUrl(@javax.annotation.Nullable UserProfileRepositoryUrl repositoryUrl) { + this.repositoryUrl = repositoryUrl; + return this; + } + + /** + * Get repositoryUrl + * @return repositoryUrl + */ + @javax.annotation.Nullable + public UserProfileRepositoryUrl getRepositoryUrl() { + return repositoryUrl; + } + + public void setRepositoryUrl(@javax.annotation.Nullable UserProfileRepositoryUrl repositoryUrl) { + this.repositoryUrl = repositoryUrl; + } + + + public UserProfile age(@javax.annotation.Nullable Integer age) { + this.age = age; + return this; + } + + /** + * Age of the User. + * @return age + */ + @javax.annotation.Nullable + public Integer getAge() { + return age; + } + + public void setAge(@javax.annotation.Nullable Integer age) { + this.age = age; + } + + + public UserProfile patents(@javax.annotation.Nullable UserProfilePatents patents) { + this.patents = patents; + return this; + } + + /** + * Get patents + * @return patents + */ + @javax.annotation.Nullable + public UserProfilePatents getPatents() { + return patents; + } + + public void setPatents(@javax.annotation.Nullable UserProfilePatents patents) { + this.patents = patents; + } + + + public UserProfile favoriteThings(@javax.annotation.Nullable UserProfileFavoriteThings favoriteThings) { + this.favoriteThings = favoriteThings; + return this; + } + + /** + * Get favoriteThings + * @return favoriteThings + */ + @javax.annotation.Nullable + public UserProfileFavoriteThings getFavoriteThings() { + return favoriteThings; + } + + public void setFavoriteThings(@javax.annotation.Nullable UserProfileFavoriteThings favoriteThings) { + this.favoriteThings = favoriteThings; + } + + + public UserProfile professionalHeadline(@javax.annotation.Nullable String professionalHeadline) { + this.professionalHeadline = professionalHeadline; + return this; + } + + /** + * Professional headline. + * @return professionalHeadline + */ + @javax.annotation.Nullable + public String getProfessionalHeadline() { + return professionalHeadline; + } + + public void setProfessionalHeadline(@javax.annotation.Nullable String professionalHeadline) { + this.professionalHeadline = professionalHeadline; + } + + + public UserProfile relatedProfileViews(@javax.annotation.Nullable UserProfileRelatedProfileViews relatedProfileViews) { + this.relatedProfileViews = relatedProfileViews; + return this; + } + + /** + * Get relatedProfileViews + * @return relatedProfileViews + */ + @javax.annotation.Nullable + public UserProfileRelatedProfileViews getRelatedProfileViews() { + return relatedProfileViews; + } + + public void setRelatedProfileViews(@javax.annotation.Nullable UserProfileRelatedProfileViews relatedProfileViews) { + this.relatedProfileViews = relatedProfileViews; + } + + + public UserProfile kloutScore(@javax.annotation.Nullable UserProfileKloutScore kloutScore) { + this.kloutScore = kloutScore; + return this; + } + + /** + * Get kloutScore + * @return kloutScore + */ + @javax.annotation.Nullable + public UserProfileKloutScore getKloutScore() { + return kloutScore; + } + + public void setKloutScore(@javax.annotation.Nullable UserProfileKloutScore kloutScore) { + this.kloutScore = kloutScore; + } + + + public UserProfile lrUserID(@javax.annotation.Nullable String lrUserID) { + this.lrUserID = lrUserID; + return this; + } + + /** + * LoginRadius User ID. + * @return lrUserID + */ + @javax.annotation.Nullable + public String getLrUserID() { + return lrUserID; + } + + public void setLrUserID(@javax.annotation.Nullable String lrUserID) { + this.lrUserID = lrUserID; + } + + + public UserProfile placesLived(@javax.annotation.Nullable UserProfilePlacesLived placesLived) { + this.placesLived = placesLived; + return this; + } + + /** + * Get placesLived + * @return placesLived + */ + @javax.annotation.Nullable + public UserProfilePlacesLived getPlacesLived() { + return placesLived; + } + + public void setPlacesLived(@javax.annotation.Nullable UserProfilePlacesLived placesLived) { + this.placesLived = placesLived; + } + + + public UserProfile publications(@javax.annotation.Nullable UserProfilePublications publications) { + this.publications = publications; + return this; + } + + /** + * Get publications + * @return publications + */ + @javax.annotation.Nullable + public UserProfilePublications getPublications() { + return publications; + } + + public void setPublications(@javax.annotation.Nullable UserProfilePublications publications) { + this.publications = publications; + } + + + public UserProfile jobBookmarks(@javax.annotation.Nullable UserProfileJobBookmarks jobBookmarks) { + this.jobBookmarks = jobBookmarks; + return this; + } + + /** + * Get jobBookmarks + * @return jobBookmarks + */ + @javax.annotation.Nullable + public UserProfileJobBookmarks getJobBookmarks() { + return jobBookmarks; + } + + public void setJobBookmarks(@javax.annotation.Nullable UserProfileJobBookmarks jobBookmarks) { + this.jobBookmarks = jobBookmarks; + } + + + public UserProfile suggestions(@javax.annotation.Nullable UserProfileSuggestions suggestions) { + this.suggestions = suggestions; + return this; + } + + /** + * Get suggestions + * @return suggestions + */ + @javax.annotation.Nullable + public UserProfileSuggestions getSuggestions() { + return suggestions; + } + + public void setSuggestions(@javax.annotation.Nullable UserProfileSuggestions suggestions) { + this.suggestions = suggestions; + } + + + public UserProfile badges(@javax.annotation.Nullable UserProfileBadges badges) { + this.badges = badges; + return this; + } + + /** + * Get badges + * @return badges + */ + @javax.annotation.Nullable + public UserProfileBadges getBadges() { + return badges; + } + + public void setBadges(@javax.annotation.Nullable UserProfileBadges badges) { + this.badges = badges; + } + + + public UserProfile memberUrlResources(@javax.annotation.Nullable UserProfileMemberUrlResources memberUrlResources) { + this.memberUrlResources = memberUrlResources; + return this; + } + + /** + * Get memberUrlResources + * @return memberUrlResources + */ + @javax.annotation.Nullable + public UserProfileMemberUrlResources getMemberUrlResources() { + return memberUrlResources; + } + + public void setMemberUrlResources(@javax.annotation.Nullable UserProfileMemberUrlResources memberUrlResources) { + this.memberUrlResources = memberUrlResources; + } + + + public UserProfile totalPrivateRepository(@javax.annotation.Nullable Integer totalPrivateRepository) { + this.totalPrivateRepository = totalPrivateRepository; + return this; + } + + /** + * Total number of private repositories. + * @return totalPrivateRepository + */ + @javax.annotation.Nullable + public Integer getTotalPrivateRepository() { + return totalPrivateRepository; + } + + public void setTotalPrivateRepository(@javax.annotation.Nullable Integer totalPrivateRepository) { + this.totalPrivateRepository = totalPrivateRepository; + } + + + public UserProfile currency(@javax.annotation.Nullable String currency) { + this.currency = currency; + return this; + } + + /** + * Currency. + * @return currency + */ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + public void setCurrency(@javax.annotation.Nullable String currency) { + this.currency = currency; + } + + + public UserProfile starredUrl(@javax.annotation.Nullable UserProfileStarredUrl starredUrl) { + this.starredUrl = starredUrl; + return this; + } + + /** + * Get starredUrl + * @return starredUrl + */ + @javax.annotation.Nullable + public UserProfileStarredUrl getStarredUrl() { + return starredUrl; + } + + public void setStarredUrl(@javax.annotation.Nullable UserProfileStarredUrl starredUrl) { + this.starredUrl = starredUrl; + } + + + public UserProfile gistsUrl(@javax.annotation.Nullable UserProfileGistsUrl gistsUrl) { + this.gistsUrl = gistsUrl; + return this; + } + + /** + * Get gistsUrl + * @return gistsUrl + */ + @javax.annotation.Nullable + public UserProfileGistsUrl getGistsUrl() { + return gistsUrl; + } + + public void setGistsUrl(@javax.annotation.Nullable UserProfileGistsUrl gistsUrl) { + this.gistsUrl = gistsUrl; + } + + + public UserProfile publicGists(@javax.annotation.Nullable Integer publicGists) { + this.publicGists = publicGists; + return this; + } + + /** + * Number of public gists. + * @return publicGists + */ + @javax.annotation.Nullable + public Integer getPublicGists() { + return publicGists; + } + + public void setPublicGists(@javax.annotation.Nullable Integer publicGists) { + this.publicGists = publicGists; + } + + + public UserProfile privateGists(@javax.annotation.Nullable Integer privateGists) { + this.privateGists = privateGists; + return this; + } + + /** + * Number of private gists. + * @return privateGists + */ + @javax.annotation.Nullable + public Integer getPrivateGists() { + return privateGists; + } + + public void setPrivateGists(@javax.annotation.Nullable Integer privateGists) { + this.privateGists = privateGists; + } + + + public UserProfile subscription(@javax.annotation.Nullable UserProfileSubscription subscription) { + this.subscription = subscription; + return this; + } + + /** + * Get subscription + * @return subscription + */ + @javax.annotation.Nullable + public UserProfileSubscription getSubscription() { + return subscription; + } + + public void setSubscription(@javax.annotation.Nullable UserProfileSubscription subscription) { + this.subscription = subscription; + } + + + public UserProfile company(@javax.annotation.Nullable String company) { + this.company = company; + return this; + } + + /** + * Company name. + * @return company + */ + @javax.annotation.Nullable + public String getCompany() { + return company; + } + + public void setCompany(@javax.annotation.Nullable String company) { + this.company = company; + } + + + public UserProfile gravatarImageUrl(@javax.annotation.Nullable UserProfileGravatarImageUrl gravatarImageUrl) { + this.gravatarImageUrl = gravatarImageUrl; + return this; + } + + /** + * Get gravatarImageUrl + * @return gravatarImageUrl + */ + @javax.annotation.Nullable + public UserProfileGravatarImageUrl getGravatarImageUrl() { + return gravatarImageUrl; + } + + public void setGravatarImageUrl(@javax.annotation.Nullable UserProfileGravatarImageUrl gravatarImageUrl) { + this.gravatarImageUrl = gravatarImageUrl; + } + + + public UserProfile profileImageUrls(@javax.annotation.Nullable UserProfileProfileImageUrls profileImageUrls) { + this.profileImageUrls = profileImageUrls; + return this; + } + + /** + * Get profileImageUrls + * @return profileImageUrls + */ + @javax.annotation.Nullable + public UserProfileProfileImageUrls getProfileImageUrls() { + return profileImageUrls; + } + + public void setProfileImageUrls(@javax.annotation.Nullable UserProfileProfileImageUrls profileImageUrls) { + this.profileImageUrls = profileImageUrls; + } + + + public UserProfile webProfiles(@javax.annotation.Nullable UserProfileWebProfiles webProfiles) { + this.webProfiles = webProfiles; + return this; + } + + /** + * Get webProfiles + * @return webProfiles + */ + @javax.annotation.Nullable + public UserProfileWebProfiles getWebProfiles() { + return webProfiles; + } + + public void setWebProfiles(@javax.annotation.Nullable UserProfileWebProfiles webProfiles) { + this.webProfiles = webProfiles; + } + + + public UserProfile pinsCount(@javax.annotation.Nullable Integer pinsCount) { + this.pinsCount = pinsCount; + return this; + } + + /** + * Number of PINs. + * @return pinsCount + */ + @javax.annotation.Nullable + public Integer getPinsCount() { + return pinsCount; + } + + public void setPinsCount(@javax.annotation.Nullable Integer pinsCount) { + this.pinsCount = pinsCount; + } + + + public UserProfile boardsCount(@javax.annotation.Nullable Integer boardsCount) { + this.boardsCount = boardsCount; + return this; + } + + /** + * Number of boards. + * @return boardsCount + */ + @javax.annotation.Nullable + public Integer getBoardsCount() { + return boardsCount; + } + + public void setBoardsCount(@javax.annotation.Nullable Integer boardsCount) { + this.boardsCount = boardsCount; + } + + + public UserProfile likesCount(@javax.annotation.Nullable Integer likesCount) { + this.likesCount = likesCount; + return this; + } + + /** + * Number of likes. + * @return likesCount + */ + @javax.annotation.Nullable + public Integer getLikesCount() { + return likesCount; + } + + public void setLikesCount(@javax.annotation.Nullable Integer likesCount) { + this.likesCount = likesCount; + } + + + public UserProfile emailVerifiedFromSocial(@javax.annotation.Nullable Boolean emailVerifiedFromSocial) { + this.emailVerifiedFromSocial = emailVerifiedFromSocial; + return this; + } + + /** + * Whether Email is verified from social login. + * @return emailVerifiedFromSocial + */ + @javax.annotation.Nullable + public Boolean getEmailVerifiedFromSocial() { + return emailVerifiedFromSocial; + } + + public void setEmailVerifiedFromSocial(@javax.annotation.Nullable Boolean emailVerifiedFromSocial) { + this.emailVerifiedFromSocial = emailVerifiedFromSocial; + } + + + public UserProfile signupDate(@javax.annotation.Nullable OffsetDateTime signupDate) { + this.signupDate = signupDate; + return this; + } + + /** + * Signup date. + * @return signupDate + */ + @javax.annotation.Nullable + public OffsetDateTime getSignupDate() { + return signupDate; + } + + public void setSignupDate(@javax.annotation.Nullable OffsetDateTime signupDate) { + this.signupDate = signupDate; + } + + + public UserProfile lastLoginDate(@javax.annotation.Nullable OffsetDateTime lastLoginDate) { + this.lastLoginDate = lastLoginDate; + return this; + } + + /** + * Last login date. + * @return lastLoginDate + */ + @javax.annotation.Nullable + public OffsetDateTime getLastLoginDate() { + return lastLoginDate; + } + + public void setLastLoginDate(@javax.annotation.Nullable OffsetDateTime lastLoginDate) { + this.lastLoginDate = lastLoginDate; + } + + + public UserProfile customFields(@javax.annotation.Nullable UserProfileCustomFields customFields) { + this.customFields = customFields; + return this; + } + + /** + * Get customFields + * @return customFields + */ + @javax.annotation.Nullable + public UserProfileCustomFields getCustomFields() { + return customFields; + } + + public void setCustomFields(@javax.annotation.Nullable UserProfileCustomFields customFields) { + this.customFields = customFields; + } + + + public UserProfile lastPasswordChangeDate(@javax.annotation.Nullable OffsetDateTime lastPasswordChangeDate) { + this.lastPasswordChangeDate = lastPasswordChangeDate; + return this; + } + + /** + * Last Password change date. + * @return lastPasswordChangeDate + */ + @javax.annotation.Nullable + public OffsetDateTime getLastPasswordChangeDate() { + return lastPasswordChangeDate; + } + + public void setLastPasswordChangeDate(@javax.annotation.Nullable OffsetDateTime lastPasswordChangeDate) { + this.lastPasswordChangeDate = lastPasswordChangeDate; + } + + + public UserProfile passwordExpirationDate(@javax.annotation.Nullable OffsetDateTime passwordExpirationDate) { + this.passwordExpirationDate = passwordExpirationDate; + return this; + } + + /** + * Password expiration date. + * @return passwordExpirationDate + */ + @javax.annotation.Nullable + public OffsetDateTime getPasswordExpirationDate() { + return passwordExpirationDate; + } + + public void setPasswordExpirationDate(@javax.annotation.Nullable OffsetDateTime passwordExpirationDate) { + this.passwordExpirationDate = passwordExpirationDate; + } + + + public UserProfile lastPasswordChangeToken(@javax.annotation.Nullable String lastPasswordChangeToken) { + this.lastPasswordChangeToken = lastPasswordChangeToken; + return this; + } + + /** + * Last Password change token. + * @return lastPasswordChangeToken + */ + @javax.annotation.Nullable + public String getLastPasswordChangeToken() { + return lastPasswordChangeToken; + } + + public void setLastPasswordChangeToken(@javax.annotation.Nullable String lastPasswordChangeToken) { + this.lastPasswordChangeToken = lastPasswordChangeToken; + } + + + public UserProfile emailVerified(@javax.annotation.Nullable Boolean emailVerified) { + this.emailVerified = emailVerified; + return this; + } + + /** + * Whether Email is verified. + * @return emailVerified + */ + @javax.annotation.Nullable + public Boolean getEmailVerified() { + return emailVerified; + } + + public void setEmailVerified(@javax.annotation.Nullable Boolean emailVerified) { + this.emailVerified = emailVerified; + } + + + public UserProfile isActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + return this; + } + + /** + * Whether the User is active. + * @return isActive + */ + @javax.annotation.Nullable + public Boolean getIsActive() { + return isActive; + } + + public void setIsActive(@javax.annotation.Nullable Boolean isActive) { + this.isActive = isActive; + } + + + public UserProfile isDeleted(@javax.annotation.Nullable Boolean isDeleted) { + this.isDeleted = isDeleted; + return this; + } + + /** + * Whether the User is deleted. + * @return isDeleted + */ + @javax.annotation.Nullable + public Boolean getIsDeleted() { + return isDeleted; + } + + public void setIsDeleted(@javax.annotation.Nullable Boolean isDeleted) { + this.isDeleted = isDeleted; + } + + + public UserProfile isEmailSubscribed(@javax.annotation.Nullable Boolean isEmailSubscribed) { + this.isEmailSubscribed = isEmailSubscribed; + return this; + } + + /** + * Whether the User is subscribed to emails. + * @return isEmailSubscribed + */ + @javax.annotation.Nullable + public Boolean getIsEmailSubscribed() { + return isEmailSubscribed; + } + + public void setIsEmailSubscribed(@javax.annotation.Nullable Boolean isEmailSubscribed) { + this.isEmailSubscribed = isEmailSubscribed; + } + + + public UserProfile userName(@javax.annotation.Nullable String userName) { + this.userName = userName; + return this; + } + + /** + * Username. + * @return userName + */ + @javax.annotation.Nullable + public String getUserName() { + return userName; + } + + public void setUserName(@javax.annotation.Nullable String userName) { + this.userName = userName; + } + + + public UserProfile noOfLogins(@javax.annotation.Nullable Integer noOfLogins) { + this.noOfLogins = noOfLogins; + return this; + } + + /** + * Number of logins. + * @return noOfLogins + */ + @javax.annotation.Nullable + public Integer getNoOfLogins() { + return noOfLogins; + } + + public void setNoOfLogins(@javax.annotation.Nullable Integer noOfLogins) { + this.noOfLogins = noOfLogins; + } + + + public UserProfile previousUids(@javax.annotation.Nullable List<String> previousUids) { + this.previousUids = previousUids; + return this; + } + + public UserProfile addPreviousUidsItem(String previousUidsItem) { + if (this.previousUids == null) { + this.previousUids = new ArrayList<>(); + } + this.previousUids.add(previousUidsItem); + return this; + } + + /** + * Previous UIDs. + * @return previousUids + */ + @javax.annotation.Nullable + public List<String> getPreviousUids() { + return previousUids; + } + + public void setPreviousUids(@javax.annotation.Nullable List<String> previousUids) { + this.previousUids = previousUids; + } + + + public UserProfile phoneId(@javax.annotation.Nullable String phoneId) { + this.phoneId = phoneId; + return this; + } + + /** + * Phone ID. + * @return phoneId + */ + @javax.annotation.Nullable + public String getPhoneId() { + return phoneId; + } + + public void setPhoneId(@javax.annotation.Nullable String phoneId) { + this.phoneId = phoneId; + } + + + public UserProfile phoneIdVerified(@javax.annotation.Nullable Boolean phoneIdVerified) { + this.phoneIdVerified = phoneIdVerified; + return this; + } + + /** + * Whether Phone ID is verified. + * @return phoneIdVerified + */ + @javax.annotation.Nullable + public Boolean getPhoneIdVerified() { + return phoneIdVerified; + } + + public void setPhoneIdVerified(@javax.annotation.Nullable Boolean phoneIdVerified) { + this.phoneIdVerified = phoneIdVerified; + } + + + public UserProfile roles(@javax.annotation.Nullable List<String> roles) { + this.roles = roles; + return this; + } + + public UserProfile addRolesItem(String rolesItem) { + if (this.roles == null) { + this.roles = new ArrayList<>(); + } + this.roles.add(rolesItem); + return this; + } + + /** + * List of Roles. + * @return roles + */ + @javax.annotation.Nullable + public List<String> getRoles() { + return roles; + } + + public void setRoles(@javax.annotation.Nullable List<String> roles) { + this.roles = roles; + } + + + public UserProfile externalUserLoginId(@javax.annotation.Nullable String externalUserLoginId) { + this.externalUserLoginId = externalUserLoginId; + return this; + } + + /** + * External User login ID. + * @return externalUserLoginId + */ + @javax.annotation.Nullable + public String getExternalUserLoginId() { + return externalUserLoginId; + } + + public void setExternalUserLoginId(@javax.annotation.Nullable String externalUserLoginId) { + this.externalUserLoginId = externalUserLoginId; + } + + + public UserProfile failedLoginAttempt(@javax.annotation.Nullable Integer failedLoginAttempt) { + this.failedLoginAttempt = failedLoginAttempt; + return this; + } + + /** + * Number of failed login attempts. + * @return failedLoginAttempt + */ + @javax.annotation.Nullable + public Integer getFailedLoginAttempt() { + return failedLoginAttempt; + } + + public void setFailedLoginAttempt(@javax.annotation.Nullable Integer failedLoginAttempt) { + this.failedLoginAttempt = failedLoginAttempt; + } + + + public UserProfile securityQuestionFailedResetPasswordAttempts(@javax.annotation.Nullable Integer securityQuestionFailedResetPasswordAttempts) { + this.securityQuestionFailedResetPasswordAttempts = securityQuestionFailedResetPasswordAttempts; + return this; + } + + /** + * Failed security question attempts for Password reset. + * @return securityQuestionFailedResetPasswordAttempts + */ + @javax.annotation.Nullable + public Integer getSecurityQuestionFailedResetPasswordAttempts() { + return securityQuestionFailedResetPasswordAttempts; + } + + public void setSecurityQuestionFailedResetPasswordAttempts(@javax.annotation.Nullable Integer securityQuestionFailedResetPasswordAttempts) { + this.securityQuestionFailedResetPasswordAttempts = securityQuestionFailedResetPasswordAttempts; + } + + + public UserProfile securityQuestionFailedLoginAttempt(@javax.annotation.Nullable Integer securityQuestionFailedLoginAttempt) { + this.securityQuestionFailedLoginAttempt = securityQuestionFailedLoginAttempt; + return this; + } + + /** + * Failed security question attempts for login. + * @return securityQuestionFailedLoginAttempt + */ + @javax.annotation.Nullable + public Integer getSecurityQuestionFailedLoginAttempt() { + return securityQuestionFailedLoginAttempt; + } + + public void setSecurityQuestionFailedLoginAttempt(@javax.annotation.Nullable Integer securityQuestionFailedLoginAttempt) { + this.securityQuestionFailedLoginAttempt = securityQuestionFailedLoginAttempt; + } + + + public UserProfile disableLogin(@javax.annotation.Nullable Boolean disableLogin) { + this.disableLogin = disableLogin; + return this; + } + + /** + * Whether login is disabled. + * @return disableLogin + */ + @javax.annotation.Nullable + public Boolean getDisableLogin() { + return disableLogin; + } + + public void setDisableLogin(@javax.annotation.Nullable Boolean disableLogin) { + this.disableLogin = disableLogin; + } + + + public UserProfile registrationProvider(@javax.annotation.Nullable String registrationProvider) { + this.registrationProvider = registrationProvider; + return this; + } + + /** + * Registration provider. + * @return registrationProvider + */ + @javax.annotation.Nullable + public String getRegistrationProvider() { + return registrationProvider; + } + + public void setRegistrationProvider(@javax.annotation.Nullable String registrationProvider) { + this.registrationProvider = registrationProvider; + } + + + public UserProfile isLoginLocked(@javax.annotation.Nullable Boolean isLoginLocked) { + this.isLoginLocked = isLoginLocked; + return this; + } + + /** + * Whether login is locked. + * @return isLoginLocked + */ + @javax.annotation.Nullable + public Boolean getIsLoginLocked() { + return isLoginLocked; + } + + public void setIsLoginLocked(@javax.annotation.Nullable Boolean isLoginLocked) { + this.isLoginLocked = isLoginLocked; + } + + + public UserProfile loginLockedType(@javax.annotation.Nullable String loginLockedType) { + this.loginLockedType = loginLockedType; + return this; + } + + /** + * Type of login lock. + * @return loginLockedType + */ + @javax.annotation.Nullable + public String getLoginLockedType() { + return loginLockedType; + } + + public void setLoginLockedType(@javax.annotation.Nullable String loginLockedType) { + this.loginLockedType = loginLockedType; + } + + + public UserProfile lastLoginLocation(@javax.annotation.Nullable String lastLoginLocation) { + this.lastLoginLocation = lastLoginLocation; + return this; + } + + /** + * Last login location. + * @return lastLoginLocation + */ + @javax.annotation.Nullable + public String getLastLoginLocation() { + return lastLoginLocation; + } + + public void setLastLoginLocation(@javax.annotation.Nullable String lastLoginLocation) { + this.lastLoginLocation = lastLoginLocation; + } + + + public UserProfile registrationSource(@javax.annotation.Nullable String registrationSource) { + this.registrationSource = registrationSource; + return this; + } + + /** + * Registration source. + * @return registrationSource + */ + @javax.annotation.Nullable + public String getRegistrationSource() { + return registrationSource; + } + + public void setRegistrationSource(@javax.annotation.Nullable String registrationSource) { + this.registrationSource = registrationSource; + } + + + public UserProfile isCustomUid(@javax.annotation.Nullable Boolean isCustomUid) { + this.isCustomUid = isCustomUid; + return this; + } + + /** + * Whether UID is custom. + * @return isCustomUid + */ + @javax.annotation.Nullable + public Boolean getIsCustomUid() { + return isCustomUid; + } + + public void setIsCustomUid(@javax.annotation.Nullable Boolean isCustomUid) { + this.isCustomUid = isCustomUid; + } + + + public UserProfile unverifiedEmail(@javax.annotation.Nullable UserProfileUnverifiedEmail unverifiedEmail) { + this.unverifiedEmail = unverifiedEmail; + return this; + } + + /** + * Get unverifiedEmail + * @return unverifiedEmail + */ + @javax.annotation.Nullable + public UserProfileUnverifiedEmail getUnverifiedEmail() { + return unverifiedEmail; + } + + public void setUnverifiedEmail(@javax.annotation.Nullable UserProfileUnverifiedEmail unverifiedEmail) { + this.unverifiedEmail = unverifiedEmail; + } + + + public UserProfile roleContext(@javax.annotation.Nullable UserProfileRoleContext roleContext) { + this.roleContext = roleContext; + return this; + } + + /** + * Get roleContext + * @return roleContext + */ + @javax.annotation.Nullable + public UserProfileRoleContext getRoleContext() { + return roleContext; + } + + public void setRoleContext(@javax.annotation.Nullable UserProfileRoleContext roleContext) { + this.roleContext = roleContext; + } + + + public UserProfile knownLoginVariables(@javax.annotation.Nullable UserProfileKnownLoginVariables knownLoginVariables) { + this.knownLoginVariables = knownLoginVariables; + return this; + } + + /** + * Get knownLoginVariables + * @return knownLoginVariables + */ + @javax.annotation.Nullable + public UserProfileKnownLoginVariables getKnownLoginVariables() { + return knownLoginVariables; + } + + public void setKnownLoginVariables(@javax.annotation.Nullable UserProfileKnownLoginVariables knownLoginVariables) { + this.knownLoginVariables = knownLoginVariables; + } + + + public UserProfile isSecurePassword(@javax.annotation.Nullable Boolean isSecurePassword) { + this.isSecurePassword = isSecurePassword; + return this; + } + + /** + * Whether the Password is secure. + * @return isSecurePassword + */ + @javax.annotation.Nullable + public Boolean getIsSecurePassword() { + return isSecurePassword; + } + + public void setIsSecurePassword(@javax.annotation.Nullable Boolean isSecurePassword) { + this.isSecurePassword = isSecurePassword; + } + + + public UserProfile privacyPolicy(@javax.annotation.Nullable UserProfilePrivacyPolicy privacyPolicy) { + this.privacyPolicy = privacyPolicy; + return this; + } + + /** + * Get privacyPolicy + * @return privacyPolicy + */ + @javax.annotation.Nullable + public UserProfilePrivacyPolicy getPrivacyPolicy() { + return privacyPolicy; + } + + public void setPrivacyPolicy(@javax.annotation.Nullable UserProfilePrivacyPolicy privacyPolicy) { + this.privacyPolicy = privacyPolicy; + } + + + public UserProfile loginLockedTimeout(@javax.annotation.Nullable String loginLockedTimeout) { + this.loginLockedTimeout = loginLockedTimeout; + return this; + } + + /** + * Login locked timeout. + * @return loginLockedTimeout + */ + @javax.annotation.Nullable + public String getLoginLockedTimeout() { + return loginLockedTimeout; + } + + public void setLoginLockedTimeout(@javax.annotation.Nullable String loginLockedTimeout) { + this.loginLockedTimeout = loginLockedTimeout; + } + + + public UserProfile externalIds(@javax.annotation.Nullable UserProfileExternalIds externalIds) { + this.externalIds = externalIds; + return this; + } + + /** + * Get externalIds + * @return externalIds + */ + @javax.annotation.Nullable + public UserProfileExternalIds getExternalIds() { + return externalIds; + } + + public void setExternalIds(@javax.annotation.Nullable UserProfileExternalIds externalIds) { + this.externalIds = externalIds; + } + + + public UserProfile isRequiredFieldsFilledOnce(@javax.annotation.Nullable Boolean isRequiredFieldsFilledOnce) { + this.isRequiredFieldsFilledOnce = isRequiredFieldsFilledOnce; + return this; + } + + /** + * Whether required fields are filled at least once. + * @return isRequiredFieldsFilledOnce + */ + @javax.annotation.Nullable + public Boolean getIsRequiredFieldsFilledOnce() { + return isRequiredFieldsFilledOnce; + } + + public void setIsRequiredFieldsFilledOnce(@javax.annotation.Nullable Boolean isRequiredFieldsFilledOnce) { + this.isRequiredFieldsFilledOnce = isRequiredFieldsFilledOnce; + } + + + public UserProfile signupLog(@javax.annotation.Nullable UserProfileSignupLog signupLog) { + this.signupLog = signupLog; + return this; + } + + /** + * Get signupLog + * @return signupLog + */ + @javax.annotation.Nullable + public UserProfileSignupLog getSignupLog() { + return signupLog; + } + + public void setSignupLog(@javax.annotation.Nullable UserProfileSignupLog signupLog) { + this.signupLog = signupLog; + } + + + public UserProfile lastAcceptedConsentVersion(@javax.annotation.Nullable Float lastAcceptedConsentVersion) { + this.lastAcceptedConsentVersion = lastAcceptedConsentVersion; + return this; + } + + /** + * Last accepted consent version. + * @return lastAcceptedConsentVersion + */ + @javax.annotation.Nullable + public Float getLastAcceptedConsentVersion() { + return lastAcceptedConsentVersion; + } + + public void setLastAcceptedConsentVersion(@javax.annotation.Nullable Float lastAcceptedConsentVersion) { + this.lastAcceptedConsentVersion = lastAcceptedConsentVersion; + } + + + public UserProfile userAgent(@javax.annotation.Nullable UserProfileUserAgent userAgent) { + this.userAgent = userAgent; + return this; + } + + /** + * Get userAgent + * @return userAgent + */ + @javax.annotation.Nullable + public UserProfileUserAgent getUserAgent() { + return userAgent; + } + + public void setUserAgent(@javax.annotation.Nullable UserProfileUserAgent userAgent) { + this.userAgent = userAgent; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UserProfile instance itself + */ + public UserProfile putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserProfile userProfile = (UserProfile) o; + return Objects.equals(this.appName, userProfile.appName) && + Objects.equals(this.uid, userProfile.uid) && + Objects.equals(this.ID, userProfile.ID) && + Objects.equals(this.provider, userProfile.provider) && + Objects.equals(this.prefix, userProfile.prefix) && + Objects.equals(this.firstName, userProfile.firstName) && + Objects.equals(this.middleName, userProfile.middleName) && + Objects.equals(this.lastName, userProfile.lastName) && + Objects.equals(this.suffix, userProfile.suffix) && + Objects.equals(this.fullName, userProfile.fullName) && + Objects.equals(this.nickName, userProfile.nickName) && + Objects.equals(this.profileName, userProfile.profileName) && + Objects.equals(this.birthDate, userProfile.birthDate) && + Objects.equals(this.gender, userProfile.gender) && + Objects.equals(this.website, userProfile.website) && + Objects.equals(this.email, userProfile.email) && + Objects.equals(this.country, userProfile.country) && + Objects.equals(this.thumbnailImageUrl, userProfile.thumbnailImageUrl) && + Objects.equals(this.imageUrl, userProfile.imageUrl) && + Objects.equals(this.favicon, userProfile.favicon) && + Objects.equals(this.profileUrl, userProfile.profileUrl) && + Objects.equals(this.homeTown, userProfile.homeTown) && + Objects.equals(this.state, userProfile.state) && + Objects.equals(this.city, userProfile.city) && + Objects.equals(this.industry, userProfile.industry) && + Objects.equals(this.about, userProfile.about) && + Objects.equals(this.timeZone, userProfile.timeZone) && + Objects.equals(this.localLanguage, userProfile.localLanguage) && + Objects.equals(this.coverPhoto, userProfile.coverPhoto) && + Objects.equals(this.tagLine, userProfile.tagLine) && + Objects.equals(this.language, userProfile.language) && + Objects.equals(this.verified, userProfile.verified) && + Objects.equals(this.updatedTime, userProfile.updatedTime) && + Objects.equals(this.positions, userProfile.positions) && + Objects.equals(this.educations, userProfile.educations) && + Objects.equals(this.phoneNumbers, userProfile.phoneNumbers) && + Objects.equals(this.imAccounts, userProfile.imAccounts) && + Objects.equals(this.addresses, userProfile.addresses) && + Objects.equals(this.mainAddress, userProfile.mainAddress) && + Objects.equals(this.created, userProfile.created) && + Objects.equals(this.createdDate, userProfile.createdDate) && + Objects.equals(this.modifiedDate, userProfile.modifiedDate) && + Objects.equals(this.profileModifiedDate, userProfile.profileModifiedDate) && + Objects.equals(this.localCity, userProfile.localCity) && + Objects.equals(this.profileCity, userProfile.profileCity) && + Objects.equals(this.localCountry, userProfile.localCountry) && + Objects.equals(this.profileCountry, userProfile.profileCountry) && + Objects.equals(this.firstLogin, userProfile.firstLogin) && + Objects.equals(this.isProtected, userProfile.isProtected) && + Objects.equals(this.relationshipStatus, userProfile.relationshipStatus) && + Objects.equals(this.quota, userProfile.quota) && + Objects.equals(this.interestedIn, userProfile.interestedIn) && + Objects.equals(this.interests, userProfile.interests) && + Objects.equals(this.religion, userProfile.religion) && + Objects.equals(this.political, userProfile.political) && + Objects.equals(this.sports, userProfile.sports) && + Objects.equals(this.inspirationalPeople, userProfile.inspirationalPeople) && + Objects.equals(this.httpsImageUrl, userProfile.httpsImageUrl) && + Objects.equals(this.followersCount, userProfile.followersCount) && + Objects.equals(this.friendsCount, userProfile.friendsCount) && + Objects.equals(this.isGeoEnabled, userProfile.isGeoEnabled) && + Objects.equals(this.totalStatusesCount, userProfile.totalStatusesCount) && + Objects.equals(this.associations, userProfile.associations) && + Objects.equals(this.numRecommenders, userProfile.numRecommenders) && + Objects.equals(this.honors, userProfile.honors) && + Objects.equals(this.awards, userProfile.awards) && + Objects.equals(this.skills, userProfile.skills) && + Objects.equals(this.currentStatus, userProfile.currentStatus) && + Objects.equals(this.certifications, userProfile.certifications) && + Objects.equals(this.courses, userProfile.courses) && + Objects.equals(this.volunteer, userProfile.volunteer) && + Objects.equals(this.recommendationsReceived, userProfile.recommendationsReceived) && + Objects.equals(this.languages, userProfile.languages) && + Objects.equals(this.projects, userProfile.projects) && + Objects.equals(this.games, userProfile.games) && + Objects.equals(this.family, userProfile.family) && + Objects.equals(this.teleVisionShow, userProfile.teleVisionShow) && + Objects.equals(this.mutualFriends, userProfile.mutualFriends) && + Objects.equals(this.movies, userProfile.movies) && + Objects.equals(this.books, userProfile.books) && + Objects.equals(this.ageRange, userProfile.ageRange) && + Objects.equals(this.publicRepository, userProfile.publicRepository) && + Objects.equals(this.hireable, userProfile.hireable) && + Objects.equals(this.repositoryUrl, userProfile.repositoryUrl) && + Objects.equals(this.age, userProfile.age) && + Objects.equals(this.patents, userProfile.patents) && + Objects.equals(this.favoriteThings, userProfile.favoriteThings) && + Objects.equals(this.professionalHeadline, userProfile.professionalHeadline) && + Objects.equals(this.relatedProfileViews, userProfile.relatedProfileViews) && + Objects.equals(this.kloutScore, userProfile.kloutScore) && + Objects.equals(this.lrUserID, userProfile.lrUserID) && + Objects.equals(this.placesLived, userProfile.placesLived) && + Objects.equals(this.publications, userProfile.publications) && + Objects.equals(this.jobBookmarks, userProfile.jobBookmarks) && + Objects.equals(this.suggestions, userProfile.suggestions) && + Objects.equals(this.badges, userProfile.badges) && + Objects.equals(this.memberUrlResources, userProfile.memberUrlResources) && + Objects.equals(this.totalPrivateRepository, userProfile.totalPrivateRepository) && + Objects.equals(this.currency, userProfile.currency) && + Objects.equals(this.starredUrl, userProfile.starredUrl) && + Objects.equals(this.gistsUrl, userProfile.gistsUrl) && + Objects.equals(this.publicGists, userProfile.publicGists) && + Objects.equals(this.privateGists, userProfile.privateGists) && + Objects.equals(this.subscription, userProfile.subscription) && + Objects.equals(this.company, userProfile.company) && + Objects.equals(this.gravatarImageUrl, userProfile.gravatarImageUrl) && + Objects.equals(this.profileImageUrls, userProfile.profileImageUrls) && + Objects.equals(this.webProfiles, userProfile.webProfiles) && + Objects.equals(this.pinsCount, userProfile.pinsCount) && + Objects.equals(this.boardsCount, userProfile.boardsCount) && + Objects.equals(this.likesCount, userProfile.likesCount) && + Objects.equals(this.emailVerifiedFromSocial, userProfile.emailVerifiedFromSocial) && + Objects.equals(this.signupDate, userProfile.signupDate) && + Objects.equals(this.lastLoginDate, userProfile.lastLoginDate) && + Objects.equals(this.customFields, userProfile.customFields) && + Objects.equals(this.lastPasswordChangeDate, userProfile.lastPasswordChangeDate) && + Objects.equals(this.passwordExpirationDate, userProfile.passwordExpirationDate) && + Objects.equals(this.lastPasswordChangeToken, userProfile.lastPasswordChangeToken) && + Objects.equals(this.emailVerified, userProfile.emailVerified) && + Objects.equals(this.isActive, userProfile.isActive) && + Objects.equals(this.isDeleted, userProfile.isDeleted) && + Objects.equals(this.isEmailSubscribed, userProfile.isEmailSubscribed) && + Objects.equals(this.userName, userProfile.userName) && + Objects.equals(this.noOfLogins, userProfile.noOfLogins) && + Objects.equals(this.previousUids, userProfile.previousUids) && + Objects.equals(this.phoneId, userProfile.phoneId) && + Objects.equals(this.phoneIdVerified, userProfile.phoneIdVerified) && + Objects.equals(this.roles, userProfile.roles) && + Objects.equals(this.externalUserLoginId, userProfile.externalUserLoginId) && + Objects.equals(this.failedLoginAttempt, userProfile.failedLoginAttempt) && + Objects.equals(this.securityQuestionFailedResetPasswordAttempts, userProfile.securityQuestionFailedResetPasswordAttempts) && + Objects.equals(this.securityQuestionFailedLoginAttempt, userProfile.securityQuestionFailedLoginAttempt) && + Objects.equals(this.disableLogin, userProfile.disableLogin) && + Objects.equals(this.registrationProvider, userProfile.registrationProvider) && + Objects.equals(this.isLoginLocked, userProfile.isLoginLocked) && + Objects.equals(this.loginLockedType, userProfile.loginLockedType) && + Objects.equals(this.lastLoginLocation, userProfile.lastLoginLocation) && + Objects.equals(this.registrationSource, userProfile.registrationSource) && + Objects.equals(this.isCustomUid, userProfile.isCustomUid) && + Objects.equals(this.unverifiedEmail, userProfile.unverifiedEmail) && + Objects.equals(this.roleContext, userProfile.roleContext) && + Objects.equals(this.knownLoginVariables, userProfile.knownLoginVariables) && + Objects.equals(this.isSecurePassword, userProfile.isSecurePassword) && + Objects.equals(this.privacyPolicy, userProfile.privacyPolicy) && + Objects.equals(this.loginLockedTimeout, userProfile.loginLockedTimeout) && + Objects.equals(this.externalIds, userProfile.externalIds) && + Objects.equals(this.isRequiredFieldsFilledOnce, userProfile.isRequiredFieldsFilledOnce) && + Objects.equals(this.signupLog, userProfile.signupLog) && + Objects.equals(this.lastAcceptedConsentVersion, userProfile.lastAcceptedConsentVersion) && + Objects.equals(this.userAgent, userProfile.userAgent)&& + Objects.equals(this.additionalProperties, userProfile.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(appName, uid, ID, provider, prefix, firstName, middleName, lastName, suffix, fullName, nickName, profileName, birthDate, gender, website, email, country, thumbnailImageUrl, imageUrl, favicon, profileUrl, homeTown, state, city, industry, about, timeZone, localLanguage, coverPhoto, tagLine, language, verified, updatedTime, positions, educations, phoneNumbers, imAccounts, addresses, mainAddress, created, createdDate, modifiedDate, profileModifiedDate, localCity, profileCity, localCountry, profileCountry, firstLogin, isProtected, relationshipStatus, quota, interestedIn, interests, religion, political, sports, inspirationalPeople, httpsImageUrl, followersCount, friendsCount, isGeoEnabled, totalStatusesCount, associations, numRecommenders, honors, awards, skills, currentStatus, certifications, courses, volunteer, recommendationsReceived, languages, projects, games, family, teleVisionShow, mutualFriends, movies, books, ageRange, publicRepository, hireable, repositoryUrl, age, patents, favoriteThings, professionalHeadline, relatedProfileViews, kloutScore, lrUserID, placesLived, publications, jobBookmarks, suggestions, badges, memberUrlResources, totalPrivateRepository, currency, starredUrl, gistsUrl, publicGists, privateGists, subscription, company, gravatarImageUrl, profileImageUrls, webProfiles, pinsCount, boardsCount, likesCount, emailVerifiedFromSocial, signupDate, lastLoginDate, customFields, lastPasswordChangeDate, passwordExpirationDate, lastPasswordChangeToken, emailVerified, isActive, isDeleted, isEmailSubscribed, userName, noOfLogins, previousUids, phoneId, phoneIdVerified, roles, externalUserLoginId, failedLoginAttempt, securityQuestionFailedResetPasswordAttempts, securityQuestionFailedLoginAttempt, disableLogin, registrationProvider, isLoginLocked, loginLockedType, lastLoginLocation, registrationSource, isCustomUid, unverifiedEmail, roleContext, knownLoginVariables, isSecurePassword, privacyPolicy, loginLockedTimeout, externalIds, isRequiredFieldsFilledOnce, signupLog, lastAcceptedConsentVersion, userAgent, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserProfile {\n"); + sb.append(" appName: ").append(toIndentedString(appName)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" ID: ").append(toIndentedString(ID)).append("\n"); + sb.append(" provider: ").append(toIndentedString(provider)).append("\n"); + sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" middleName: ").append(toIndentedString(middleName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" suffix: ").append(toIndentedString(suffix)).append("\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append(" nickName: ").append(toIndentedString(nickName)).append("\n"); + sb.append(" profileName: ").append(toIndentedString(profileName)).append("\n"); + sb.append(" birthDate: ").append(toIndentedString(birthDate)).append("\n"); + sb.append(" gender: ").append(toIndentedString(gender)).append("\n"); + sb.append(" website: ").append(toIndentedString(website)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" thumbnailImageUrl: ").append(toIndentedString(thumbnailImageUrl)).append("\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append(" favicon: ").append(toIndentedString(favicon)).append("\n"); + sb.append(" profileUrl: ").append(toIndentedString(profileUrl)).append("\n"); + sb.append(" homeTown: ").append(toIndentedString(homeTown)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" industry: ").append(toIndentedString(industry)).append("\n"); + sb.append(" about: ").append(toIndentedString(about)).append("\n"); + sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); + sb.append(" localLanguage: ").append(toIndentedString(localLanguage)).append("\n"); + sb.append(" coverPhoto: ").append(toIndentedString(coverPhoto)).append("\n"); + sb.append(" tagLine: ").append(toIndentedString(tagLine)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" verified: ").append(toIndentedString(verified)).append("\n"); + sb.append(" updatedTime: ").append(toIndentedString(updatedTime)).append("\n"); + sb.append(" positions: ").append(toIndentedString(positions)).append("\n"); + sb.append(" educations: ").append(toIndentedString(educations)).append("\n"); + sb.append(" phoneNumbers: ").append(toIndentedString(phoneNumbers)).append("\n"); + sb.append(" imAccounts: ").append(toIndentedString(imAccounts)).append("\n"); + sb.append(" addresses: ").append(toIndentedString(addresses)).append("\n"); + sb.append(" mainAddress: ").append(toIndentedString(mainAddress)).append("\n"); + sb.append(" created: ").append(toIndentedString(created)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" modifiedDate: ").append(toIndentedString(modifiedDate)).append("\n"); + sb.append(" profileModifiedDate: ").append(toIndentedString(profileModifiedDate)).append("\n"); + sb.append(" localCity: ").append(toIndentedString(localCity)).append("\n"); + sb.append(" profileCity: ").append(toIndentedString(profileCity)).append("\n"); + sb.append(" localCountry: ").append(toIndentedString(localCountry)).append("\n"); + sb.append(" profileCountry: ").append(toIndentedString(profileCountry)).append("\n"); + sb.append(" firstLogin: ").append(toIndentedString(firstLogin)).append("\n"); + sb.append(" isProtected: ").append(toIndentedString(isProtected)).append("\n"); + sb.append(" relationshipStatus: ").append(toIndentedString(relationshipStatus)).append("\n"); + sb.append(" quota: ").append(toIndentedString(quota)).append("\n"); + sb.append(" interestedIn: ").append(toIndentedString(interestedIn)).append("\n"); + sb.append(" interests: ").append(toIndentedString(interests)).append("\n"); + sb.append(" religion: ").append(toIndentedString(religion)).append("\n"); + sb.append(" political: ").append(toIndentedString(political)).append("\n"); + sb.append(" sports: ").append(toIndentedString(sports)).append("\n"); + sb.append(" inspirationalPeople: ").append(toIndentedString(inspirationalPeople)).append("\n"); + sb.append(" httpsImageUrl: ").append(toIndentedString(httpsImageUrl)).append("\n"); + sb.append(" followersCount: ").append(toIndentedString(followersCount)).append("\n"); + sb.append(" friendsCount: ").append(toIndentedString(friendsCount)).append("\n"); + sb.append(" isGeoEnabled: ").append(toIndentedString(isGeoEnabled)).append("\n"); + sb.append(" totalStatusesCount: ").append(toIndentedString(totalStatusesCount)).append("\n"); + sb.append(" associations: ").append(toIndentedString(associations)).append("\n"); + sb.append(" numRecommenders: ").append(toIndentedString(numRecommenders)).append("\n"); + sb.append(" honors: ").append(toIndentedString(honors)).append("\n"); + sb.append(" awards: ").append(toIndentedString(awards)).append("\n"); + sb.append(" skills: ").append(toIndentedString(skills)).append("\n"); + sb.append(" currentStatus: ").append(toIndentedString(currentStatus)).append("\n"); + sb.append(" certifications: ").append(toIndentedString(certifications)).append("\n"); + sb.append(" courses: ").append(toIndentedString(courses)).append("\n"); + sb.append(" volunteer: ").append(toIndentedString(volunteer)).append("\n"); + sb.append(" recommendationsReceived: ").append(toIndentedString(recommendationsReceived)).append("\n"); + sb.append(" languages: ").append(toIndentedString(languages)).append("\n"); + sb.append(" projects: ").append(toIndentedString(projects)).append("\n"); + sb.append(" games: ").append(toIndentedString(games)).append("\n"); + sb.append(" family: ").append(toIndentedString(family)).append("\n"); + sb.append(" teleVisionShow: ").append(toIndentedString(teleVisionShow)).append("\n"); + sb.append(" mutualFriends: ").append(toIndentedString(mutualFriends)).append("\n"); + sb.append(" movies: ").append(toIndentedString(movies)).append("\n"); + sb.append(" books: ").append(toIndentedString(books)).append("\n"); + sb.append(" ageRange: ").append(toIndentedString(ageRange)).append("\n"); + sb.append(" publicRepository: ").append(toIndentedString(publicRepository)).append("\n"); + sb.append(" hireable: ").append(toIndentedString(hireable)).append("\n"); + sb.append(" repositoryUrl: ").append(toIndentedString(repositoryUrl)).append("\n"); + sb.append(" age: ").append(toIndentedString(age)).append("\n"); + sb.append(" patents: ").append(toIndentedString(patents)).append("\n"); + sb.append(" favoriteThings: ").append(toIndentedString(favoriteThings)).append("\n"); + sb.append(" professionalHeadline: ").append(toIndentedString(professionalHeadline)).append("\n"); + sb.append(" relatedProfileViews: ").append(toIndentedString(relatedProfileViews)).append("\n"); + sb.append(" kloutScore: ").append(toIndentedString(kloutScore)).append("\n"); + sb.append(" lrUserID: ").append(toIndentedString(lrUserID)).append("\n"); + sb.append(" placesLived: ").append(toIndentedString(placesLived)).append("\n"); + sb.append(" publications: ").append(toIndentedString(publications)).append("\n"); + sb.append(" jobBookmarks: ").append(toIndentedString(jobBookmarks)).append("\n"); + sb.append(" suggestions: ").append(toIndentedString(suggestions)).append("\n"); + sb.append(" badges: ").append(toIndentedString(badges)).append("\n"); + sb.append(" memberUrlResources: ").append(toIndentedString(memberUrlResources)).append("\n"); + sb.append(" totalPrivateRepository: ").append(toIndentedString(totalPrivateRepository)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" starredUrl: ").append(toIndentedString(starredUrl)).append("\n"); + sb.append(" gistsUrl: ").append(toIndentedString(gistsUrl)).append("\n"); + sb.append(" publicGists: ").append(toIndentedString(publicGists)).append("\n"); + sb.append(" privateGists: ").append(toIndentedString(privateGists)).append("\n"); + sb.append(" subscription: ").append(toIndentedString(subscription)).append("\n"); + sb.append(" company: ").append(toIndentedString(company)).append("\n"); + sb.append(" gravatarImageUrl: ").append(toIndentedString(gravatarImageUrl)).append("\n"); + sb.append(" profileImageUrls: ").append(toIndentedString(profileImageUrls)).append("\n"); + sb.append(" webProfiles: ").append(toIndentedString(webProfiles)).append("\n"); + sb.append(" pinsCount: ").append(toIndentedString(pinsCount)).append("\n"); + sb.append(" boardsCount: ").append(toIndentedString(boardsCount)).append("\n"); + sb.append(" likesCount: ").append(toIndentedString(likesCount)).append("\n"); + sb.append(" emailVerifiedFromSocial: ").append(toIndentedString(emailVerifiedFromSocial)).append("\n"); + sb.append(" signupDate: ").append(toIndentedString(signupDate)).append("\n"); + sb.append(" lastLoginDate: ").append(toIndentedString(lastLoginDate)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" lastPasswordChangeDate: ").append(toIndentedString(lastPasswordChangeDate)).append("\n"); + sb.append(" passwordExpirationDate: ").append(toIndentedString(passwordExpirationDate)).append("\n"); + sb.append(" lastPasswordChangeToken: ").append(toIndentedString(lastPasswordChangeToken)).append("\n"); + sb.append(" emailVerified: ").append(toIndentedString(emailVerified)).append("\n"); + sb.append(" isActive: ").append(toIndentedString(isActive)).append("\n"); + sb.append(" isDeleted: ").append(toIndentedString(isDeleted)).append("\n"); + sb.append(" isEmailSubscribed: ").append(toIndentedString(isEmailSubscribed)).append("\n"); + sb.append(" userName: ").append(toIndentedString(userName)).append("\n"); + sb.append(" noOfLogins: ").append(toIndentedString(noOfLogins)).append("\n"); + sb.append(" previousUids: ").append(toIndentedString(previousUids)).append("\n"); + sb.append(" phoneId: ").append(toIndentedString(phoneId)).append("\n"); + sb.append(" phoneIdVerified: ").append(toIndentedString(phoneIdVerified)).append("\n"); + sb.append(" roles: ").append(toIndentedString(roles)).append("\n"); + sb.append(" externalUserLoginId: ").append(toIndentedString(externalUserLoginId)).append("\n"); + sb.append(" failedLoginAttempt: ").append(toIndentedString(failedLoginAttempt)).append("\n"); + sb.append(" securityQuestionFailedResetPasswordAttempts: ").append(toIndentedString(securityQuestionFailedResetPasswordAttempts)).append("\n"); + sb.append(" securityQuestionFailedLoginAttempt: ").append(toIndentedString(securityQuestionFailedLoginAttempt)).append("\n"); + sb.append(" disableLogin: ").append(toIndentedString(disableLogin)).append("\n"); + sb.append(" registrationProvider: ").append(toIndentedString(registrationProvider)).append("\n"); + sb.append(" isLoginLocked: ").append(toIndentedString(isLoginLocked)).append("\n"); + sb.append(" loginLockedType: ").append(toIndentedString(loginLockedType)).append("\n"); + sb.append(" lastLoginLocation: ").append(toIndentedString(lastLoginLocation)).append("\n"); + sb.append(" registrationSource: ").append(toIndentedString(registrationSource)).append("\n"); + sb.append(" isCustomUid: ").append(toIndentedString(isCustomUid)).append("\n"); + sb.append(" unverifiedEmail: ").append(toIndentedString(unverifiedEmail)).append("\n"); + sb.append(" roleContext: ").append(toIndentedString(roleContext)).append("\n"); + sb.append(" knownLoginVariables: ").append(toIndentedString(knownLoginVariables)).append("\n"); + sb.append(" isSecurePassword: ").append(toIndentedString(isSecurePassword)).append("\n"); + sb.append(" privacyPolicy: ").append(toIndentedString(privacyPolicy)).append("\n"); + sb.append(" loginLockedTimeout: ").append(toIndentedString(loginLockedTimeout)).append("\n"); + sb.append(" externalIds: ").append(toIndentedString(externalIds)).append("\n"); + sb.append(" isRequiredFieldsFilledOnce: ").append(toIndentedString(isRequiredFieldsFilledOnce)).append("\n"); + sb.append(" signupLog: ").append(toIndentedString(signupLog)).append("\n"); + sb.append(" lastAcceptedConsentVersion: ").append(toIndentedString(lastAcceptedConsentVersion)).append("\n"); + sb.append(" userAgent: ").append(toIndentedString(userAgent)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AppName"); + openapiFields.add("Uid"); + openapiFields.add("ID"); + openapiFields.add("Provider"); + openapiFields.add("Prefix"); + openapiFields.add("FirstName"); + openapiFields.add("MiddleName"); + openapiFields.add("LastName"); + openapiFields.add("Suffix"); + openapiFields.add("FullName"); + openapiFields.add("NickName"); + openapiFields.add("ProfileName"); + openapiFields.add("BirthDate"); + openapiFields.add("Gender"); + openapiFields.add("Website"); + openapiFields.add("Email"); + openapiFields.add("Country"); + openapiFields.add("ThumbnailImageUrl"); + openapiFields.add("ImageUrl"); + openapiFields.add("Favicon"); + openapiFields.add("ProfileUrl"); + openapiFields.add("HomeTown"); + openapiFields.add("State"); + openapiFields.add("City"); + openapiFields.add("Industry"); + openapiFields.add("About"); + openapiFields.add("TimeZone"); + openapiFields.add("LocalLanguage"); + openapiFields.add("CoverPhoto"); + openapiFields.add("TagLine"); + openapiFields.add("Language"); + openapiFields.add("Verified"); + openapiFields.add("UpdatedTime"); + openapiFields.add("Positions"); + openapiFields.add("Educations"); + openapiFields.add("PhoneNumbers"); + openapiFields.add("IMAccounts"); + openapiFields.add("Addresses"); + openapiFields.add("MainAddress"); + openapiFields.add("Created"); + openapiFields.add("CreatedDate"); + openapiFields.add("ModifiedDate"); + openapiFields.add("ProfileModifiedDate"); + openapiFields.add("LocalCity"); + openapiFields.add("ProfileCity"); + openapiFields.add("LocalCountry"); + openapiFields.add("ProfileCountry"); + openapiFields.add("FirstLogin"); + openapiFields.add("IsProtected"); + openapiFields.add("RelationshipStatus"); + openapiFields.add("Quota"); + openapiFields.add("InterestedIn"); + openapiFields.add("Interests"); + openapiFields.add("Religion"); + openapiFields.add("Political"); + openapiFields.add("Sports"); + openapiFields.add("InspirationalPeople"); + openapiFields.add("HttpsImageUrl"); + openapiFields.add("FollowersCount"); + openapiFields.add("FriendsCount"); + openapiFields.add("IsGeoEnabled"); + openapiFields.add("TotalStatusesCount"); + openapiFields.add("Associations"); + openapiFields.add("NumRecommenders"); + openapiFields.add("Honors"); + openapiFields.add("Awards"); + openapiFields.add("Skills"); + openapiFields.add("CurrentStatus"); + openapiFields.add("Certifications"); + openapiFields.add("Courses"); + openapiFields.add("Volunteer"); + openapiFields.add("RecommendationsReceived"); + openapiFields.add("Languages"); + openapiFields.add("Projects"); + openapiFields.add("Games"); + openapiFields.add("Family"); + openapiFields.add("TeleVisionShow"); + openapiFields.add("MutualFriends"); + openapiFields.add("Movies"); + openapiFields.add("Books"); + openapiFields.add("AgeRange"); + openapiFields.add("PublicRepository"); + openapiFields.add("Hireable"); + openapiFields.add("RepositoryUrl"); + openapiFields.add("Age"); + openapiFields.add("Patents"); + openapiFields.add("FavoriteThings"); + openapiFields.add("ProfessionalHeadline"); + openapiFields.add("RelatedProfileViews"); + openapiFields.add("KloutScore"); + openapiFields.add("LRUserID"); + openapiFields.add("PlacesLived"); + openapiFields.add("Publications"); + openapiFields.add("JobBookmarks"); + openapiFields.add("Suggestions"); + openapiFields.add("Badges"); + openapiFields.add("MemberUrlResources"); + openapiFields.add("TotalPrivateRepository"); + openapiFields.add("Currency"); + openapiFields.add("StarredUrl"); + openapiFields.add("GistsUrl"); + openapiFields.add("PublicGists"); + openapiFields.add("PrivateGists"); + openapiFields.add("Subscription"); + openapiFields.add("Company"); + openapiFields.add("GravatarImageUrl"); + openapiFields.add("ProfileImageUrls"); + openapiFields.add("WebProfiles"); + openapiFields.add("PinsCount"); + openapiFields.add("BoardsCount"); + openapiFields.add("LikesCount"); + openapiFields.add("EmailVerifiedFromSocial"); + openapiFields.add("SignupDate"); + openapiFields.add("LastLoginDate"); + openapiFields.add("CustomFields"); + openapiFields.add("LastPasswordChangeDate"); + openapiFields.add("PasswordExpirationDate"); + openapiFields.add("LastPasswordChangeToken"); + openapiFields.add("EmailVerified"); + openapiFields.add("IsActive"); + openapiFields.add("IsDeleted"); + openapiFields.add("IsEmailSubscribed"); + openapiFields.add("UserName"); + openapiFields.add("NoOfLogins"); + openapiFields.add("PreviousUids"); + openapiFields.add("PhoneId"); + openapiFields.add("PhoneIdVerified"); + openapiFields.add("Roles"); + openapiFields.add("ExternalUserLoginId"); + openapiFields.add("FailedLoginAttempt"); + openapiFields.add("SecurityQuestionFailedResetPasswordAttempts"); + openapiFields.add("SecurityQuestionFailedLoginAttempt"); + openapiFields.add("DisableLogin"); + openapiFields.add("RegistrationProvider"); + openapiFields.add("IsLoginLocked"); + openapiFields.add("LoginLockedType"); + openapiFields.add("LastLoginLocation"); + openapiFields.add("RegistrationSource"); + openapiFields.add("IsCustomUid"); + openapiFields.add("UnverifiedEmail"); + openapiFields.add("RoleContext"); + openapiFields.add("KnownLoginVariables"); + openapiFields.add("IsSecurePassword"); + openapiFields.add("PrivacyPolicy"); + openapiFields.add("LoginLockedTimeout"); + openapiFields.add("ExternalIds"); + openapiFields.add("IsRequiredFieldsFilledOnce"); + openapiFields.add("SignupLog"); + openapiFields.add("LastAcceptedConsentVersion"); + openapiFields.add("user_agent"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 UserProfile + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserProfile.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserProfile is not found in the empty JSON string", UserProfile.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("AppName") != null && !jsonObj.get("AppName").isJsonNull()) && !jsonObj.get("AppName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AppName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AppName").toString())); + } + if ((jsonObj.get("Uid") != null && !jsonObj.get("Uid").isJsonNull()) && !jsonObj.get("Uid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Uid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Uid").toString())); + } + if ((jsonObj.get("ID") != null && !jsonObj.get("ID").isJsonNull()) && !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("Provider") != null && !jsonObj.get("Provider").isJsonNull()) && !jsonObj.get("Provider").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Provider` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Provider").toString())); + } + if ((jsonObj.get("Prefix") != null && !jsonObj.get("Prefix").isJsonNull()) && !jsonObj.get("Prefix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Prefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Prefix").toString())); + } + if ((jsonObj.get("FirstName") != null && !jsonObj.get("FirstName").isJsonNull()) && !jsonObj.get("FirstName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FirstName").toString())); + } + if ((jsonObj.get("MiddleName") != null && !jsonObj.get("MiddleName").isJsonNull()) && !jsonObj.get("MiddleName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MiddleName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MiddleName").toString())); + } + if ((jsonObj.get("LastName") != null && !jsonObj.get("LastName").isJsonNull()) && !jsonObj.get("LastName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastName").toString())); + } + if ((jsonObj.get("Suffix") != null && !jsonObj.get("Suffix").isJsonNull()) && !jsonObj.get("Suffix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Suffix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Suffix").toString())); + } + if ((jsonObj.get("FullName") != null && !jsonObj.get("FullName").isJsonNull()) && !jsonObj.get("FullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FullName").toString())); + } + if ((jsonObj.get("NickName") != null && !jsonObj.get("NickName").isJsonNull()) && !jsonObj.get("NickName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NickName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NickName").toString())); + } + if ((jsonObj.get("ProfileName") != null && !jsonObj.get("ProfileName").isJsonNull()) && !jsonObj.get("ProfileName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileName").toString())); + } + if ((jsonObj.get("Gender") != null && !jsonObj.get("Gender").isJsonNull()) && !jsonObj.get("Gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Gender").toString())); + } + if ((jsonObj.get("Website") != null && !jsonObj.get("Website").isJsonNull()) && !jsonObj.get("Website").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Website` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Website").toString())); + } + // validate the optional field `Email` + if (jsonObj.get("Email") != null && !jsonObj.get("Email").isJsonNull()) { + UserProfileEmail.validateJsonElement(jsonObj.get("Email")); + } + // validate the optional field `Country` + if (jsonObj.get("Country") != null && !jsonObj.get("Country").isJsonNull()) { + UserProfileCountry.validateJsonElement(jsonObj.get("Country")); + } + if ((jsonObj.get("ThumbnailImageUrl") != null && !jsonObj.get("ThumbnailImageUrl").isJsonNull()) && !jsonObj.get("ThumbnailImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ThumbnailImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ThumbnailImageUrl").toString())); + } + // validate the optional field `ImageUrl` + if (jsonObj.get("ImageUrl") != null && !jsonObj.get("ImageUrl").isJsonNull()) { + UserProfileImageUrl.validateJsonElement(jsonObj.get("ImageUrl")); + } + // validate the optional field `Favicon` + if (jsonObj.get("Favicon") != null && !jsonObj.get("Favicon").isJsonNull()) { + UserProfileFavicon.validateJsonElement(jsonObj.get("Favicon")); + } + // validate the optional field `ProfileUrl` + if (jsonObj.get("ProfileUrl") != null && !jsonObj.get("ProfileUrl").isJsonNull()) { + UserProfileProfileUrl.validateJsonElement(jsonObj.get("ProfileUrl")); + } + if ((jsonObj.get("HomeTown") != null && !jsonObj.get("HomeTown").isJsonNull()) && !jsonObj.get("HomeTown").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HomeTown` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HomeTown").toString())); + } + if ((jsonObj.get("State") != null && !jsonObj.get("State").isJsonNull()) && !jsonObj.get("State").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `State` to be a primitive type in the JSON string but got `%s`", jsonObj.get("State").toString())); + } + if ((jsonObj.get("City") != null && !jsonObj.get("City").isJsonNull()) && !jsonObj.get("City").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `City` to be a primitive type in the JSON string but got `%s`", jsonObj.get("City").toString())); + } + if ((jsonObj.get("Industry") != null && !jsonObj.get("Industry").isJsonNull()) && !jsonObj.get("Industry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Industry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Industry").toString())); + } + if ((jsonObj.get("About") != null && !jsonObj.get("About").isJsonNull()) && !jsonObj.get("About").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `About` to be a primitive type in the JSON string but got `%s`", jsonObj.get("About").toString())); + } + if ((jsonObj.get("TimeZone") != null && !jsonObj.get("TimeZone").isJsonNull()) && !jsonObj.get("TimeZone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TimeZone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TimeZone").toString())); + } + if ((jsonObj.get("LocalLanguage") != null && !jsonObj.get("LocalLanguage").isJsonNull()) && !jsonObj.get("LocalLanguage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalLanguage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalLanguage").toString())); + } + // validate the optional field `CoverPhoto` + if (jsonObj.get("CoverPhoto") != null && !jsonObj.get("CoverPhoto").isJsonNull()) { + UserProfileCoverPhoto.validateJsonElement(jsonObj.get("CoverPhoto")); + } + if ((jsonObj.get("TagLine") != null && !jsonObj.get("TagLine").isJsonNull()) && !jsonObj.get("TagLine").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TagLine` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TagLine").toString())); + } + if ((jsonObj.get("Language") != null && !jsonObj.get("Language").isJsonNull()) && !jsonObj.get("Language").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Language` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Language").toString())); + } + if ((jsonObj.get("Verified") != null && !jsonObj.get("Verified").isJsonNull()) && !jsonObj.get("Verified").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Verified` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Verified").toString())); + } + // validate the optional field `Positions` + if (jsonObj.get("Positions") != null && !jsonObj.get("Positions").isJsonNull()) { + UserProfilePositions.validateJsonElement(jsonObj.get("Positions")); + } + // validate the optional field `Educations` + if (jsonObj.get("Educations") != null && !jsonObj.get("Educations").isJsonNull()) { + UserProfileEducations.validateJsonElement(jsonObj.get("Educations")); + } + // validate the optional field `PhoneNumbers` + if (jsonObj.get("PhoneNumbers") != null && !jsonObj.get("PhoneNumbers").isJsonNull()) { + UserProfilePhoneNumbers.validateJsonElement(jsonObj.get("PhoneNumbers")); + } + // validate the optional field `IMAccounts` + if (jsonObj.get("IMAccounts") != null && !jsonObj.get("IMAccounts").isJsonNull()) { + UserProfileIMAccounts.validateJsonElement(jsonObj.get("IMAccounts")); + } + // validate the optional field `Addresses` + if (jsonObj.get("Addresses") != null && !jsonObj.get("Addresses").isJsonNull()) { + UserProfileAddresses.validateJsonElement(jsonObj.get("Addresses")); + } + if ((jsonObj.get("MainAddress") != null && !jsonObj.get("MainAddress").isJsonNull()) && !jsonObj.get("MainAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MainAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MainAddress").toString())); + } + if ((jsonObj.get("LocalCity") != null && !jsonObj.get("LocalCity").isJsonNull()) && !jsonObj.get("LocalCity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalCity").toString())); + } + if ((jsonObj.get("ProfileCity") != null && !jsonObj.get("ProfileCity").isJsonNull()) && !jsonObj.get("ProfileCity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileCity").toString())); + } + if ((jsonObj.get("LocalCountry") != null && !jsonObj.get("LocalCountry").isJsonNull()) && !jsonObj.get("LocalCountry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalCountry").toString())); + } + if ((jsonObj.get("ProfileCountry") != null && !jsonObj.get("ProfileCountry").isJsonNull()) && !jsonObj.get("ProfileCountry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileCountry").toString())); + } + if ((jsonObj.get("RelationshipStatus") != null && !jsonObj.get("RelationshipStatus").isJsonNull()) && !jsonObj.get("RelationshipStatus").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RelationshipStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RelationshipStatus").toString())); + } + if ((jsonObj.get("Quota") != null && !jsonObj.get("Quota").isJsonNull()) && !jsonObj.get("Quota").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Quota` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Quota").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("InterestedIn") != null && !jsonObj.get("InterestedIn").isJsonNull() && !jsonObj.get("InterestedIn").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `InterestedIn` to be an array in the JSON string but got `%s`", jsonObj.get("InterestedIn").toString())); + } + // validate the optional field `Interests` + if (jsonObj.get("Interests") != null && !jsonObj.get("Interests").isJsonNull()) { + UserProfileInterests.validateJsonElement(jsonObj.get("Interests")); + } + if ((jsonObj.get("Religion") != null && !jsonObj.get("Religion").isJsonNull()) && !jsonObj.get("Religion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Religion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Religion").toString())); + } + if ((jsonObj.get("Political") != null && !jsonObj.get("Political").isJsonNull()) && !jsonObj.get("Political").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Political` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Political").toString())); + } + // validate the optional field `Sports` + if (jsonObj.get("Sports") != null && !jsonObj.get("Sports").isJsonNull()) { + UserProfileSports.validateJsonElement(jsonObj.get("Sports")); + } + // validate the optional field `InspirationalPeople` + if (jsonObj.get("InspirationalPeople") != null && !jsonObj.get("InspirationalPeople").isJsonNull()) { + UserProfileInspirationalPeople.validateJsonElement(jsonObj.get("InspirationalPeople")); + } + // validate the optional field `HttpsImageUrl` + if (jsonObj.get("HttpsImageUrl") != null && !jsonObj.get("HttpsImageUrl").isJsonNull()) { + UserProfileHttpsImageUrl.validateJsonElement(jsonObj.get("HttpsImageUrl")); + } + if ((jsonObj.get("IsGeoEnabled") != null && !jsonObj.get("IsGeoEnabled").isJsonNull()) && !jsonObj.get("IsGeoEnabled").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IsGeoEnabled` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IsGeoEnabled").toString())); + } + if ((jsonObj.get("Associations") != null && !jsonObj.get("Associations").isJsonNull()) && !jsonObj.get("Associations").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Associations` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Associations").toString())); + } + if ((jsonObj.get("Honors") != null && !jsonObj.get("Honors").isJsonNull()) && !jsonObj.get("Honors").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Honors` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Honors").toString())); + } + // validate the optional field `Awards` + if (jsonObj.get("Awards") != null && !jsonObj.get("Awards").isJsonNull()) { + UserProfileAwards.validateJsonElement(jsonObj.get("Awards")); + } + // validate the optional field `Skills` + if (jsonObj.get("Skills") != null && !jsonObj.get("Skills").isJsonNull()) { + UserProfileSkills.validateJsonElement(jsonObj.get("Skills")); + } + // validate the optional field `CurrentStatus` + if (jsonObj.get("CurrentStatus") != null && !jsonObj.get("CurrentStatus").isJsonNull()) { + UserProfileCurrentStatus.validateJsonElement(jsonObj.get("CurrentStatus")); + } + // validate the optional field `Certifications` + if (jsonObj.get("Certifications") != null && !jsonObj.get("Certifications").isJsonNull()) { + UserProfileCertifications.validateJsonElement(jsonObj.get("Certifications")); + } + // validate the optional field `Courses` + if (jsonObj.get("Courses") != null && !jsonObj.get("Courses").isJsonNull()) { + UserProfileCourses.validateJsonElement(jsonObj.get("Courses")); + } + // validate the optional field `Volunteer` + if (jsonObj.get("Volunteer") != null && !jsonObj.get("Volunteer").isJsonNull()) { + UserProfileVolunteer.validateJsonElement(jsonObj.get("Volunteer")); + } + // validate the optional field `RecommendationsReceived` + if (jsonObj.get("RecommendationsReceived") != null && !jsonObj.get("RecommendationsReceived").isJsonNull()) { + UserProfileRecommendationsReceived.validateJsonElement(jsonObj.get("RecommendationsReceived")); + } + // validate the optional field `Languages` + if (jsonObj.get("Languages") != null && !jsonObj.get("Languages").isJsonNull()) { + UserProfileLanguages.validateJsonElement(jsonObj.get("Languages")); + } + // validate the optional field `Projects` + if (jsonObj.get("Projects") != null && !jsonObj.get("Projects").isJsonNull()) { + UserProfileProjects.validateJsonElement(jsonObj.get("Projects")); + } + // validate the optional field `Games` + if (jsonObj.get("Games") != null && !jsonObj.get("Games").isJsonNull()) { + UserProfileGames.validateJsonElement(jsonObj.get("Games")); + } + // validate the optional field `Family` + if (jsonObj.get("Family") != null && !jsonObj.get("Family").isJsonNull()) { + UserProfileFamily.validateJsonElement(jsonObj.get("Family")); + } + // validate the optional field `TeleVisionShow` + if (jsonObj.get("TeleVisionShow") != null && !jsonObj.get("TeleVisionShow").isJsonNull()) { + UserProfileTeleVisionShow.validateJsonElement(jsonObj.get("TeleVisionShow")); + } + // validate the optional field `MutualFriends` + if (jsonObj.get("MutualFriends") != null && !jsonObj.get("MutualFriends").isJsonNull()) { + UserProfileMutualFriends.validateJsonElement(jsonObj.get("MutualFriends")); + } + // validate the optional field `Movies` + if (jsonObj.get("Movies") != null && !jsonObj.get("Movies").isJsonNull()) { + UserProfileMovies.validateJsonElement(jsonObj.get("Movies")); + } + // validate the optional field `Books` + if (jsonObj.get("Books") != null && !jsonObj.get("Books").isJsonNull()) { + UserProfileBooks.validateJsonElement(jsonObj.get("Books")); + } + // validate the optional field `AgeRange` + if (jsonObj.get("AgeRange") != null && !jsonObj.get("AgeRange").isJsonNull()) { + UserProfileAgeRange.validateJsonElement(jsonObj.get("AgeRange")); + } + // validate the optional field `PublicRepository` + if (jsonObj.get("PublicRepository") != null && !jsonObj.get("PublicRepository").isJsonNull()) { + UserProfilePublicRepository.validateJsonElement(jsonObj.get("PublicRepository")); + } + // validate the optional field `RepositoryUrl` + if (jsonObj.get("RepositoryUrl") != null && !jsonObj.get("RepositoryUrl").isJsonNull()) { + UserProfileRepositoryUrl.validateJsonElement(jsonObj.get("RepositoryUrl")); + } + // validate the optional field `Patents` + if (jsonObj.get("Patents") != null && !jsonObj.get("Patents").isJsonNull()) { + UserProfilePatents.validateJsonElement(jsonObj.get("Patents")); + } + // validate the optional field `FavoriteThings` + if (jsonObj.get("FavoriteThings") != null && !jsonObj.get("FavoriteThings").isJsonNull()) { + UserProfileFavoriteThings.validateJsonElement(jsonObj.get("FavoriteThings")); + } + if ((jsonObj.get("ProfessionalHeadline") != null && !jsonObj.get("ProfessionalHeadline").isJsonNull()) && !jsonObj.get("ProfessionalHeadline").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfessionalHeadline` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfessionalHeadline").toString())); + } + // validate the optional field `RelatedProfileViews` + if (jsonObj.get("RelatedProfileViews") != null && !jsonObj.get("RelatedProfileViews").isJsonNull()) { + UserProfileRelatedProfileViews.validateJsonElement(jsonObj.get("RelatedProfileViews")); + } + // validate the optional field `KloutScore` + if (jsonObj.get("KloutScore") != null && !jsonObj.get("KloutScore").isJsonNull()) { + UserProfileKloutScore.validateJsonElement(jsonObj.get("KloutScore")); + } + if ((jsonObj.get("LRUserID") != null && !jsonObj.get("LRUserID").isJsonNull()) && !jsonObj.get("LRUserID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LRUserID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LRUserID").toString())); + } + // validate the optional field `PlacesLived` + if (jsonObj.get("PlacesLived") != null && !jsonObj.get("PlacesLived").isJsonNull()) { + UserProfilePlacesLived.validateJsonElement(jsonObj.get("PlacesLived")); + } + // validate the optional field `Publications` + if (jsonObj.get("Publications") != null && !jsonObj.get("Publications").isJsonNull()) { + UserProfilePublications.validateJsonElement(jsonObj.get("Publications")); + } + // validate the optional field `JobBookmarks` + if (jsonObj.get("JobBookmarks") != null && !jsonObj.get("JobBookmarks").isJsonNull()) { + UserProfileJobBookmarks.validateJsonElement(jsonObj.get("JobBookmarks")); + } + // validate the optional field `Suggestions` + if (jsonObj.get("Suggestions") != null && !jsonObj.get("Suggestions").isJsonNull()) { + UserProfileSuggestions.validateJsonElement(jsonObj.get("Suggestions")); + } + // validate the optional field `Badges` + if (jsonObj.get("Badges") != null && !jsonObj.get("Badges").isJsonNull()) { + UserProfileBadges.validateJsonElement(jsonObj.get("Badges")); + } + // validate the optional field `MemberUrlResources` + if (jsonObj.get("MemberUrlResources") != null && !jsonObj.get("MemberUrlResources").isJsonNull()) { + UserProfileMemberUrlResources.validateJsonElement(jsonObj.get("MemberUrlResources")); + } + if ((jsonObj.get("Currency") != null && !jsonObj.get("Currency").isJsonNull()) && !jsonObj.get("Currency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Currency").toString())); + } + // validate the optional field `StarredUrl` + if (jsonObj.get("StarredUrl") != null && !jsonObj.get("StarredUrl").isJsonNull()) { + UserProfileStarredUrl.validateJsonElement(jsonObj.get("StarredUrl")); + } + // validate the optional field `GistsUrl` + if (jsonObj.get("GistsUrl") != null && !jsonObj.get("GistsUrl").isJsonNull()) { + UserProfileGistsUrl.validateJsonElement(jsonObj.get("GistsUrl")); + } + // validate the optional field `Subscription` + if (jsonObj.get("Subscription") != null && !jsonObj.get("Subscription").isJsonNull()) { + UserProfileSubscription.validateJsonElement(jsonObj.get("Subscription")); + } + if ((jsonObj.get("Company") != null && !jsonObj.get("Company").isJsonNull()) && !jsonObj.get("Company").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Company` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Company").toString())); + } + // validate the optional field `GravatarImageUrl` + if (jsonObj.get("GravatarImageUrl") != null && !jsonObj.get("GravatarImageUrl").isJsonNull()) { + UserProfileGravatarImageUrl.validateJsonElement(jsonObj.get("GravatarImageUrl")); + } + // validate the optional field `ProfileImageUrls` + if (jsonObj.get("ProfileImageUrls") != null && !jsonObj.get("ProfileImageUrls").isJsonNull()) { + UserProfileProfileImageUrls.validateJsonElement(jsonObj.get("ProfileImageUrls")); + } + // validate the optional field `WebProfiles` + if (jsonObj.get("WebProfiles") != null && !jsonObj.get("WebProfiles").isJsonNull()) { + UserProfileWebProfiles.validateJsonElement(jsonObj.get("WebProfiles")); + } + // validate the optional field `CustomFields` + if (jsonObj.get("CustomFields") != null && !jsonObj.get("CustomFields").isJsonNull()) { + UserProfileCustomFields.validateJsonElement(jsonObj.get("CustomFields")); + } + if ((jsonObj.get("LastPasswordChangeToken") != null && !jsonObj.get("LastPasswordChangeToken").isJsonNull()) && !jsonObj.get("LastPasswordChangeToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastPasswordChangeToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastPasswordChangeToken").toString())); + } + if ((jsonObj.get("UserName") != null && !jsonObj.get("UserName").isJsonNull()) && !jsonObj.get("UserName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UserName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UserName").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("PreviousUids") != null && !jsonObj.get("PreviousUids").isJsonNull() && !jsonObj.get("PreviousUids").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PreviousUids` to be an array in the JSON string but got `%s`", jsonObj.get("PreviousUids").toString())); + } + if ((jsonObj.get("PhoneId") != null && !jsonObj.get("PhoneId").isJsonNull()) && !jsonObj.get("PhoneId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PhoneId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PhoneId").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("Roles") != null && !jsonObj.get("Roles").isJsonNull() && !jsonObj.get("Roles").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Roles` to be an array in the JSON string but got `%s`", jsonObj.get("Roles").toString())); + } + if ((jsonObj.get("ExternalUserLoginId") != null && !jsonObj.get("ExternalUserLoginId").isJsonNull()) && !jsonObj.get("ExternalUserLoginId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ExternalUserLoginId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ExternalUserLoginId").toString())); + } + if ((jsonObj.get("RegistrationProvider") != null && !jsonObj.get("RegistrationProvider").isJsonNull()) && !jsonObj.get("RegistrationProvider").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RegistrationProvider` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RegistrationProvider").toString())); + } + if ((jsonObj.get("LoginLockedType") != null && !jsonObj.get("LoginLockedType").isJsonNull()) && !jsonObj.get("LoginLockedType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LoginLockedType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LoginLockedType").toString())); + } + if ((jsonObj.get("LastLoginLocation") != null && !jsonObj.get("LastLoginLocation").isJsonNull()) && !jsonObj.get("LastLoginLocation").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastLoginLocation` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastLoginLocation").toString())); + } + if ((jsonObj.get("RegistrationSource") != null && !jsonObj.get("RegistrationSource").isJsonNull()) && !jsonObj.get("RegistrationSource").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RegistrationSource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RegistrationSource").toString())); + } + // validate the optional field `UnverifiedEmail` + if (jsonObj.get("UnverifiedEmail") != null && !jsonObj.get("UnverifiedEmail").isJsonNull()) { + UserProfileUnverifiedEmail.validateJsonElement(jsonObj.get("UnverifiedEmail")); + } + // validate the optional field `RoleContext` + if (jsonObj.get("RoleContext") != null && !jsonObj.get("RoleContext").isJsonNull()) { + UserProfileRoleContext.validateJsonElement(jsonObj.get("RoleContext")); + } + // validate the optional field `KnownLoginVariables` + if (jsonObj.get("KnownLoginVariables") != null && !jsonObj.get("KnownLoginVariables").isJsonNull()) { + UserProfileKnownLoginVariables.validateJsonElement(jsonObj.get("KnownLoginVariables")); + } + // validate the optional field `PrivacyPolicy` + if (jsonObj.get("PrivacyPolicy") != null && !jsonObj.get("PrivacyPolicy").isJsonNull()) { + UserProfilePrivacyPolicy.validateJsonElement(jsonObj.get("PrivacyPolicy")); + } + if ((jsonObj.get("LoginLockedTimeout") != null && !jsonObj.get("LoginLockedTimeout").isJsonNull()) && !jsonObj.get("LoginLockedTimeout").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LoginLockedTimeout` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LoginLockedTimeout").toString())); + } + // validate the optional field `ExternalIds` + if (jsonObj.get("ExternalIds") != null && !jsonObj.get("ExternalIds").isJsonNull()) { + UserProfileExternalIds.validateJsonElement(jsonObj.get("ExternalIds")); + } + // validate the optional field `SignupLog` + if (jsonObj.get("SignupLog") != null && !jsonObj.get("SignupLog").isJsonNull()) { + UserProfileSignupLog.validateJsonElement(jsonObj.get("SignupLog")); + } + // validate the optional field `user_agent` + if (jsonObj.get("user_agent") != null && !jsonObj.get("user_agent").isJsonNull()) { + UserProfileUserAgent.validateJsonElement(jsonObj.get("user_agent")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfile.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfile' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<UserProfile> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserProfile.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfile>() { + @Override + public void write(JsonWriter out, UserProfile value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UserProfile read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UserProfile instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserProfile given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfile + * @throws IOException if the JSON string is invalid with respect to UserProfile + */ + public static UserProfile fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfile.class); + } + + /** + * Convert an instance of UserProfile to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileAddresses.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileAddresses.java new file mode 100644 index 0000000..009632a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileAddresses.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileAddresses extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileAddresses.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileAddresses.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileAddresses' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileAddresses>() { + @Override + public void write(JsonWriter out, UserProfileAddresses value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileAddresses read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileAddresses ret = new UserProfileAddresses(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileAddresses: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileAddresses() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileAddresses(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileAddresses.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileAddresses + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileAddresses with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileAddresses given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileAddresses + * @throws IOException if the JSON string is invalid with respect to UserProfileAddresses + */ + public static UserProfileAddresses fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileAddresses.class); + } + + /** + * Convert an instance of UserProfileAddresses to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileAgeRange.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileAgeRange.java new file mode 100644 index 0000000..66ad894 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileAgeRange.java @@ -0,0 +1,274 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileAgeRange extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileAgeRange.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileAgeRange.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileAgeRange' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<String> adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileAgeRange>() { + @Override + public void write(JsonWriter out, UserProfileAgeRange value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonPrimitive primitive = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Object, String"); + } + + @Override + public UserProfileAgeRange read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileAgeRange ret = new UserProfileAgeRange(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileAgeRange: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileAgeRange() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileAgeRange(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", String.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileAgeRange.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Object, String + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Object, String"); + } + + /** + * Get the actual instance, which can be the following: + * Object, String + * + * @return The actual instance (Object, String) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileAgeRange + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with String + try { + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileAgeRange with oneOf schemas: Object, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileAgeRange given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileAgeRange + * @throws IOException if the JSON string is invalid with respect to UserProfileAgeRange + */ + public static UserProfileAgeRange fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileAgeRange.class); + } + + /** + * Convert an instance of UserProfileAgeRange to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileAwards.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileAwards.java new file mode 100644 index 0000000..4a1b07e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileAwards.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileAwards extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileAwards.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileAwards.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileAwards' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileAwards>() { + @Override + public void write(JsonWriter out, UserProfileAwards value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileAwards read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileAwards ret = new UserProfileAwards(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileAwards: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileAwards() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileAwards(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileAwards.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileAwards + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileAwards with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileAwards given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileAwards + * @throws IOException if the JSON string is invalid with respect to UserProfileAwards + */ + public static UserProfileAwards fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileAwards.class); + } + + /** + * Convert an instance of UserProfileAwards to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileBadges.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileBadges.java new file mode 100644 index 0000000..20901f6 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileBadges.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileBadges extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileBadges.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileBadges.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileBadges' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileBadges>() { + @Override + public void write(JsonWriter out, UserProfileBadges value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileBadges read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileBadges ret = new UserProfileBadges(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileBadges: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileBadges() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileBadges(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileBadges.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileBadges + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileBadges with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileBadges given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileBadges + * @throws IOException if the JSON string is invalid with respect to UserProfileBadges + */ + public static UserProfileBadges fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileBadges.class); + } + + /** + * Convert an instance of UserProfileBadges to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileBooks.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileBooks.java new file mode 100644 index 0000000..ba79e5a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileBooks.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileBooks extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileBooks.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileBooks.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileBooks' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileBooks>() { + @Override + public void write(JsonWriter out, UserProfileBooks value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileBooks read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileBooks ret = new UserProfileBooks(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileBooks: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileBooks() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileBooks(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileBooks.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileBooks + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileBooks with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileBooks given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileBooks + * @throws IOException if the JSON string is invalid with respect to UserProfileBooks + */ + public static UserProfileBooks fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileBooks.class); + } + + /** + * Convert an instance of UserProfileBooks to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileCertifications.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileCertifications.java new file mode 100644 index 0000000..205cd0f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileCertifications.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileCertifications extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileCertifications.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileCertifications.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileCertifications' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileCertifications>() { + @Override + public void write(JsonWriter out, UserProfileCertifications value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileCertifications read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileCertifications ret = new UserProfileCertifications(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileCertifications: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileCertifications() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileCertifications(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileCertifications.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileCertifications + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileCertifications with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileCertifications given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileCertifications + * @throws IOException if the JSON string is invalid with respect to UserProfileCertifications + */ + public static UserProfileCertifications fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileCertifications.class); + } + + /** + * Convert an instance of UserProfileCertifications to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileCountry.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileCountry.java new file mode 100644 index 0000000..963e68b --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileCountry.java @@ -0,0 +1,274 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileCountry extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileCountry.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileCountry.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileCountry' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<String> adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileCountry>() { + @Override + public void write(JsonWriter out, UserProfileCountry value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonPrimitive primitive = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Object, String"); + } + + @Override + public UserProfileCountry read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileCountry ret = new UserProfileCountry(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileCountry: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileCountry() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileCountry(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", String.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileCountry.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Object, String + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Object, String"); + } + + /** + * Get the actual instance, which can be the following: + * Object, String + * + * @return The actual instance (Object, String) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileCountry + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with String + try { + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileCountry with oneOf schemas: Object, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileCountry given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileCountry + * @throws IOException if the JSON string is invalid with respect to UserProfileCountry + */ + public static UserProfileCountry fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileCountry.class); + } + + /** + * Convert an instance of UserProfileCountry to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileCourses.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileCourses.java new file mode 100644 index 0000000..47ec664 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileCourses.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileCourses extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileCourses.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileCourses.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileCourses' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileCourses>() { + @Override + public void write(JsonWriter out, UserProfileCourses value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileCourses read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileCourses ret = new UserProfileCourses(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileCourses: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileCourses() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileCourses(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileCourses.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileCourses + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileCourses with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileCourses given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileCourses + * @throws IOException if the JSON string is invalid with respect to UserProfileCourses + */ + public static UserProfileCourses fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileCourses.class); + } + + /** + * Convert an instance of UserProfileCourses to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileCoverPhoto.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileCoverPhoto.java new file mode 100644 index 0000000..b38ef6c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileCoverPhoto.java @@ -0,0 +1,274 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileCoverPhoto extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileCoverPhoto.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileCoverPhoto.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileCoverPhoto' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<String> adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileCoverPhoto>() { + @Override + public void write(JsonWriter out, UserProfileCoverPhoto value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonPrimitive primitive = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Object, String"); + } + + @Override + public UserProfileCoverPhoto read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileCoverPhoto ret = new UserProfileCoverPhoto(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileCoverPhoto: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileCoverPhoto() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileCoverPhoto(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", String.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileCoverPhoto.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Object, String + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Object, String"); + } + + /** + * Get the actual instance, which can be the following: + * Object, String + * + * @return The actual instance (Object, String) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileCoverPhoto + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with String + try { + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileCoverPhoto with oneOf schemas: Object, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileCoverPhoto given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileCoverPhoto + * @throws IOException if the JSON string is invalid with respect to UserProfileCoverPhoto + */ + public static UserProfileCoverPhoto fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileCoverPhoto.class); + } + + /** + * Convert an instance of UserProfileCoverPhoto to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileCurrentStatus.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileCurrentStatus.java new file mode 100644 index 0000000..555abab --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileCurrentStatus.java @@ -0,0 +1,274 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileCurrentStatus extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileCurrentStatus.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileCurrentStatus.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileCurrentStatus' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<String> adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileCurrentStatus>() { + @Override + public void write(JsonWriter out, UserProfileCurrentStatus value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonPrimitive primitive = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Object, String"); + } + + @Override + public UserProfileCurrentStatus read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileCurrentStatus ret = new UserProfileCurrentStatus(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileCurrentStatus: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileCurrentStatus() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileCurrentStatus(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", String.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileCurrentStatus.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Object, String + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Object, String"); + } + + /** + * Get the actual instance, which can be the following: + * Object, String + * + * @return The actual instance (Object, String) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileCurrentStatus + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with String + try { + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileCurrentStatus with oneOf schemas: Object, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileCurrentStatus given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileCurrentStatus + * @throws IOException if the JSON string is invalid with respect to UserProfileCurrentStatus + */ + public static UserProfileCurrentStatus fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileCurrentStatus.class); + } + + /** + * Convert an instance of UserProfileCurrentStatus to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileCustomFields.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileCustomFields.java new file mode 100644 index 0000000..94b6e1d --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileCustomFields.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileCustomFields extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileCustomFields.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileCustomFields.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileCustomFields' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileCustomFields>() { + @Override + public void write(JsonWriter out, UserProfileCustomFields value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileCustomFields read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + + if (match == 1) { + UserProfileCustomFields ret = new UserProfileCustomFields(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileCustomFields: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileCustomFields() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileCustomFields(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Object", Object.class); + schemas.put("List<Object>", List.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileCustomFields.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * 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 UserProfileCustomFields + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileCustomFields with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileCustomFields given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileCustomFields + * @throws IOException if the JSON string is invalid with respect to UserProfileCustomFields + */ + public static UserProfileCustomFields fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileCustomFields.class); + } + + /** + * Convert an instance of UserProfileCustomFields to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileEducations.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileEducations.java new file mode 100644 index 0000000..3a02910 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileEducations.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileEducations extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileEducations.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileEducations.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileEducations' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileEducations>() { + @Override + public void write(JsonWriter out, UserProfileEducations value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileEducations read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileEducations ret = new UserProfileEducations(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileEducations: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileEducations() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileEducations(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileEducations.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileEducations + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileEducations with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileEducations given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileEducations + * @throws IOException if the JSON string is invalid with respect to UserProfileEducations + */ + public static UserProfileEducations fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileEducations.class); + } + + /** + * Convert an instance of UserProfileEducations to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileEmail.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileEmail.java new file mode 100644 index 0000000..bccec76 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileEmail.java @@ -0,0 +1,274 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileEmail extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileEmail.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileEmail.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileEmail' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<String> adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileEmail>() { + @Override + public void write(JsonWriter out, UserProfileEmail value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonPrimitive primitive = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Object, String"); + } + + @Override + public UserProfileEmail read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileEmail ret = new UserProfileEmail(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileEmail: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileEmail() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileEmail(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", String.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileEmail.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Object, String + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Object, String"); + } + + /** + * Get the actual instance, which can be the following: + * Object, String + * + * @return The actual instance (Object, String) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileEmail + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with String + try { + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileEmail with oneOf schemas: Object, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileEmail given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileEmail + * @throws IOException if the JSON string is invalid with respect to UserProfileEmail + */ + public static UserProfileEmail fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileEmail.class); + } + + /** + * Convert an instance of UserProfileEmail to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileExternalIds.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileExternalIds.java new file mode 100644 index 0000000..f1ff5d5 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileExternalIds.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileExternalIds extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileExternalIds.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileExternalIds.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileExternalIds' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileExternalIds>() { + @Override + public void write(JsonWriter out, UserProfileExternalIds value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileExternalIds read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + + if (match == 1) { + UserProfileExternalIds ret = new UserProfileExternalIds(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileExternalIds: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileExternalIds() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileExternalIds(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Object", Object.class); + schemas.put("List<Object>", List.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileExternalIds.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * 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 UserProfileExternalIds + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileExternalIds with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileExternalIds given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileExternalIds + * @throws IOException if the JSON string is invalid with respect to UserProfileExternalIds + */ + public static UserProfileExternalIds fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileExternalIds.class); + } + + /** + * Convert an instance of UserProfileExternalIds to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileFamily.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileFamily.java new file mode 100644 index 0000000..7d441f3 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileFamily.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileFamily extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileFamily.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileFamily.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileFamily' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileFamily>() { + @Override + public void write(JsonWriter out, UserProfileFamily value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileFamily read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileFamily ret = new UserProfileFamily(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileFamily: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileFamily() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileFamily(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileFamily.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileFamily + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileFamily with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileFamily given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileFamily + * @throws IOException if the JSON string is invalid with respect to UserProfileFamily + */ + public static UserProfileFamily fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileFamily.class); + } + + /** + * Convert an instance of UserProfileFamily to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileFavicon.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileFavicon.java new file mode 100644 index 0000000..5d38440 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileFavicon.java @@ -0,0 +1,274 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileFavicon extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileFavicon.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileFavicon.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileFavicon' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<String> adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileFavicon>() { + @Override + public void write(JsonWriter out, UserProfileFavicon value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonPrimitive primitive = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Object, String"); + } + + @Override + public UserProfileFavicon read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileFavicon ret = new UserProfileFavicon(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileFavicon: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileFavicon() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileFavicon(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", String.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileFavicon.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Object, String + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Object, String"); + } + + /** + * Get the actual instance, which can be the following: + * Object, String + * + * @return The actual instance (Object, String) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileFavicon + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with String + try { + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileFavicon with oneOf schemas: Object, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileFavicon given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileFavicon + * @throws IOException if the JSON string is invalid with respect to UserProfileFavicon + */ + public static UserProfileFavicon fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileFavicon.class); + } + + /** + * Convert an instance of UserProfileFavicon to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileFavoriteThings.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileFavoriteThings.java new file mode 100644 index 0000000..0b717cc --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileFavoriteThings.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileFavoriteThings extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileFavoriteThings.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileFavoriteThings.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileFavoriteThings' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileFavoriteThings>() { + @Override + public void write(JsonWriter out, UserProfileFavoriteThings value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileFavoriteThings read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileFavoriteThings ret = new UserProfileFavoriteThings(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileFavoriteThings: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileFavoriteThings() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileFavoriteThings(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileFavoriteThings.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileFavoriteThings + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileFavoriteThings with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileFavoriteThings given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileFavoriteThings + * @throws IOException if the JSON string is invalid with respect to UserProfileFavoriteThings + */ + public static UserProfileFavoriteThings fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileFavoriteThings.class); + } + + /** + * Convert an instance of UserProfileFavoriteThings to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileGames.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileGames.java new file mode 100644 index 0000000..09ed61d --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileGames.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileGames extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileGames.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileGames.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileGames' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileGames>() { + @Override + public void write(JsonWriter out, UserProfileGames value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileGames read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileGames ret = new UserProfileGames(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileGames: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileGames() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileGames(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileGames.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileGames + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileGames with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileGames given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileGames + * @throws IOException if the JSON string is invalid with respect to UserProfileGames + */ + public static UserProfileGames fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileGames.class); + } + + /** + * Convert an instance of UserProfileGames to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileGistsUrl.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileGistsUrl.java new file mode 100644 index 0000000..0b7d984 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileGistsUrl.java @@ -0,0 +1,274 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileGistsUrl extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileGistsUrl.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileGistsUrl.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileGistsUrl' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<String> adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileGistsUrl>() { + @Override + public void write(JsonWriter out, UserProfileGistsUrl value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonPrimitive primitive = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Object, String"); + } + + @Override + public UserProfileGistsUrl read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileGistsUrl ret = new UserProfileGistsUrl(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileGistsUrl: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileGistsUrl() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileGistsUrl(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", String.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileGistsUrl.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Object, String + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Object, String"); + } + + /** + * Get the actual instance, which can be the following: + * Object, String + * + * @return The actual instance (Object, String) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileGistsUrl + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with String + try { + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileGistsUrl with oneOf schemas: Object, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileGistsUrl given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileGistsUrl + * @throws IOException if the JSON string is invalid with respect to UserProfileGistsUrl + */ + public static UserProfileGistsUrl fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileGistsUrl.class); + } + + /** + * Convert an instance of UserProfileGistsUrl to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileGravatarImageUrl.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileGravatarImageUrl.java new file mode 100644 index 0000000..3e78951 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileGravatarImageUrl.java @@ -0,0 +1,274 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileGravatarImageUrl extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileGravatarImageUrl.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileGravatarImageUrl.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileGravatarImageUrl' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<String> adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileGravatarImageUrl>() { + @Override + public void write(JsonWriter out, UserProfileGravatarImageUrl value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonPrimitive primitive = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Object, String"); + } + + @Override + public UserProfileGravatarImageUrl read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileGravatarImageUrl ret = new UserProfileGravatarImageUrl(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileGravatarImageUrl: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileGravatarImageUrl() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileGravatarImageUrl(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", String.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileGravatarImageUrl.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Object, String + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Object, String"); + } + + /** + * Get the actual instance, which can be the following: + * Object, String + * + * @return The actual instance (Object, String) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileGravatarImageUrl + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with String + try { + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileGravatarImageUrl with oneOf schemas: Object, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileGravatarImageUrl given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileGravatarImageUrl + * @throws IOException if the JSON string is invalid with respect to UserProfileGravatarImageUrl + */ + public static UserProfileGravatarImageUrl fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileGravatarImageUrl.class); + } + + /** + * Convert an instance of UserProfileGravatarImageUrl to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileHttpsImageUrl.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileHttpsImageUrl.java new file mode 100644 index 0000000..f4b3981 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileHttpsImageUrl.java @@ -0,0 +1,274 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileHttpsImageUrl extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileHttpsImageUrl.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileHttpsImageUrl.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileHttpsImageUrl' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<String> adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileHttpsImageUrl>() { + @Override + public void write(JsonWriter out, UserProfileHttpsImageUrl value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonPrimitive primitive = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Object, String"); + } + + @Override + public UserProfileHttpsImageUrl read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileHttpsImageUrl ret = new UserProfileHttpsImageUrl(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileHttpsImageUrl: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileHttpsImageUrl() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileHttpsImageUrl(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", String.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileHttpsImageUrl.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Object, String + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Object, String"); + } + + /** + * Get the actual instance, which can be the following: + * Object, String + * + * @return The actual instance (Object, String) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileHttpsImageUrl + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with String + try { + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileHttpsImageUrl with oneOf schemas: Object, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileHttpsImageUrl given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileHttpsImageUrl + * @throws IOException if the JSON string is invalid with respect to UserProfileHttpsImageUrl + */ + public static UserProfileHttpsImageUrl fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileHttpsImageUrl.class); + } + + /** + * Convert an instance of UserProfileHttpsImageUrl to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileIMAccounts.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileIMAccounts.java new file mode 100644 index 0000000..b3bd27d --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileIMAccounts.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileIMAccounts extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileIMAccounts.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileIMAccounts.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileIMAccounts' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileIMAccounts>() { + @Override + public void write(JsonWriter out, UserProfileIMAccounts value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileIMAccounts read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileIMAccounts ret = new UserProfileIMAccounts(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileIMAccounts: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileIMAccounts() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileIMAccounts(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileIMAccounts.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileIMAccounts + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileIMAccounts with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileIMAccounts given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileIMAccounts + * @throws IOException if the JSON string is invalid with respect to UserProfileIMAccounts + */ + public static UserProfileIMAccounts fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileIMAccounts.class); + } + + /** + * Convert an instance of UserProfileIMAccounts to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileImageUrl.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileImageUrl.java new file mode 100644 index 0000000..282a413 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileImageUrl.java @@ -0,0 +1,274 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileImageUrl extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileImageUrl.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileImageUrl.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileImageUrl' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<String> adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileImageUrl>() { + @Override + public void write(JsonWriter out, UserProfileImageUrl value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonPrimitive primitive = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Object, String"); + } + + @Override + public UserProfileImageUrl read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileImageUrl ret = new UserProfileImageUrl(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileImageUrl: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileImageUrl() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileImageUrl(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", String.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileImageUrl.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Object, String + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Object, String"); + } + + /** + * Get the actual instance, which can be the following: + * Object, String + * + * @return The actual instance (Object, String) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileImageUrl + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with String + try { + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileImageUrl with oneOf schemas: Object, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileImageUrl given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileImageUrl + * @throws IOException if the JSON string is invalid with respect to UserProfileImageUrl + */ + public static UserProfileImageUrl fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileImageUrl.class); + } + + /** + * Convert an instance of UserProfileImageUrl to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileInspirationalPeople.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileInspirationalPeople.java new file mode 100644 index 0000000..1e334f4 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileInspirationalPeople.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileInspirationalPeople extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileInspirationalPeople.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileInspirationalPeople.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileInspirationalPeople' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileInspirationalPeople>() { + @Override + public void write(JsonWriter out, UserProfileInspirationalPeople value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileInspirationalPeople read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileInspirationalPeople ret = new UserProfileInspirationalPeople(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileInspirationalPeople: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileInspirationalPeople() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileInspirationalPeople(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileInspirationalPeople.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileInspirationalPeople + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileInspirationalPeople with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileInspirationalPeople given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileInspirationalPeople + * @throws IOException if the JSON string is invalid with respect to UserProfileInspirationalPeople + */ + public static UserProfileInspirationalPeople fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileInspirationalPeople.class); + } + + /** + * Convert an instance of UserProfileInspirationalPeople to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileInterests.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileInterests.java new file mode 100644 index 0000000..2e3d637 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileInterests.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileInterests extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileInterests.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileInterests.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileInterests' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileInterests>() { + @Override + public void write(JsonWriter out, UserProfileInterests value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileInterests read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileInterests ret = new UserProfileInterests(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileInterests: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileInterests() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileInterests(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileInterests.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileInterests + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileInterests with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileInterests given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileInterests + * @throws IOException if the JSON string is invalid with respect to UserProfileInterests + */ + public static UserProfileInterests fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileInterests.class); + } + + /** + * Convert an instance of UserProfileInterests to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileJobBookmarks.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileJobBookmarks.java new file mode 100644 index 0000000..c235fd2 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileJobBookmarks.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileJobBookmarks extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileJobBookmarks.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileJobBookmarks.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileJobBookmarks' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileJobBookmarks>() { + @Override + public void write(JsonWriter out, UserProfileJobBookmarks value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileJobBookmarks read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileJobBookmarks ret = new UserProfileJobBookmarks(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileJobBookmarks: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileJobBookmarks() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileJobBookmarks(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileJobBookmarks.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileJobBookmarks + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileJobBookmarks with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileJobBookmarks given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileJobBookmarks + * @throws IOException if the JSON string is invalid with respect to UserProfileJobBookmarks + */ + public static UserProfileJobBookmarks fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileJobBookmarks.class); + } + + /** + * Convert an instance of UserProfileJobBookmarks to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileKloutScore.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileKloutScore.java new file mode 100644 index 0000000..0018e98 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileKloutScore.java @@ -0,0 +1,275 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.math.BigDecimal; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileKloutScore extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileKloutScore.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileKloutScore.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileKloutScore' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<BigDecimal> adapterBigDecimal = gson.getDelegateAdapter(this, TypeToken.get(BigDecimal.class)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileKloutScore>() { + @Override + public void write(JsonWriter out, UserProfileKloutScore value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `BigDecimal` + if (value.getActualInstance() instanceof BigDecimal) { + JsonElement element = adapterBigDecimal.toJsonTree((BigDecimal)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: BigDecimal, Object"); + } + + @Override + public UserProfileKloutScore read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize BigDecimal + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterBigDecimal; + match++; + log.log(Level.FINER, "Input data matches schema 'BigDecimal'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'BigDecimal'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileKloutScore ret = new UserProfileKloutScore(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileKloutScore: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileKloutScore() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileKloutScore(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("BigDecimal", BigDecimal.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileKloutScore.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * BigDecimal, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof BigDecimal) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be BigDecimal, Object"); + } + + /** + * Get the actual instance, which can be the following: + * BigDecimal, Object + * + * @return The actual instance (BigDecimal, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `BigDecimal`. If the actual instance is not `BigDecimal`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `BigDecimal` + * @throws ClassCastException if the instance is not `BigDecimal` + */ + public BigDecimal getBigDecimal() throws ClassCastException { + return (BigDecimal)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileKloutScore + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with BigDecimal + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for BigDecimal failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileKloutScore with oneOf schemas: BigDecimal, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileKloutScore given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileKloutScore + * @throws IOException if the JSON string is invalid with respect to UserProfileKloutScore + */ + public static UserProfileKloutScore fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileKloutScore.class); + } + + /** + * Convert an instance of UserProfileKloutScore to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileKnownLoginVariables.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileKnownLoginVariables.java new file mode 100644 index 0000000..089be72 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileKnownLoginVariables.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileKnownLoginVariables extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileKnownLoginVariables.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileKnownLoginVariables.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileKnownLoginVariables' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileKnownLoginVariables>() { + @Override + public void write(JsonWriter out, UserProfileKnownLoginVariables value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileKnownLoginVariables read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + + if (match == 1) { + UserProfileKnownLoginVariables ret = new UserProfileKnownLoginVariables(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileKnownLoginVariables: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileKnownLoginVariables() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileKnownLoginVariables(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Object", Object.class); + schemas.put("List<Object>", List.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileKnownLoginVariables.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * 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 UserProfileKnownLoginVariables + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileKnownLoginVariables with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileKnownLoginVariables given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileKnownLoginVariables + * @throws IOException if the JSON string is invalid with respect to UserProfileKnownLoginVariables + */ + public static UserProfileKnownLoginVariables fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileKnownLoginVariables.class); + } + + /** + * Convert an instance of UserProfileKnownLoginVariables to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileLanguages.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileLanguages.java new file mode 100644 index 0000000..3eaff94 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileLanguages.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileLanguages extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileLanguages.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileLanguages.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileLanguages' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileLanguages>() { + @Override + public void write(JsonWriter out, UserProfileLanguages value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileLanguages read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileLanguages ret = new UserProfileLanguages(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileLanguages: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileLanguages() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileLanguages(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileLanguages.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileLanguages + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileLanguages with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileLanguages given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileLanguages + * @throws IOException if the JSON string is invalid with respect to UserProfileLanguages + */ + public static UserProfileLanguages fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileLanguages.class); + } + + /** + * Convert an instance of UserProfileLanguages to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileMemberUrlResources.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileMemberUrlResources.java new file mode 100644 index 0000000..0fdd941 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileMemberUrlResources.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileMemberUrlResources extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileMemberUrlResources.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileMemberUrlResources.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileMemberUrlResources' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileMemberUrlResources>() { + @Override + public void write(JsonWriter out, UserProfileMemberUrlResources value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileMemberUrlResources read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileMemberUrlResources ret = new UserProfileMemberUrlResources(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileMemberUrlResources: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileMemberUrlResources() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileMemberUrlResources(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileMemberUrlResources.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileMemberUrlResources + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileMemberUrlResources with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileMemberUrlResources given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileMemberUrlResources + * @throws IOException if the JSON string is invalid with respect to UserProfileMemberUrlResources + */ + public static UserProfileMemberUrlResources fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileMemberUrlResources.class); + } + + /** + * Convert an instance of UserProfileMemberUrlResources to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileMovies.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileMovies.java new file mode 100644 index 0000000..50d617e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileMovies.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileMovies extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileMovies.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileMovies.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileMovies' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileMovies>() { + @Override + public void write(JsonWriter out, UserProfileMovies value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileMovies read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileMovies ret = new UserProfileMovies(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileMovies: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileMovies() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileMovies(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileMovies.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileMovies + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileMovies with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileMovies given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileMovies + * @throws IOException if the JSON string is invalid with respect to UserProfileMovies + */ + public static UserProfileMovies fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileMovies.class); + } + + /** + * Convert an instance of UserProfileMovies to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileMutualFriends.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileMutualFriends.java new file mode 100644 index 0000000..7f4dafc --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileMutualFriends.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileMutualFriends extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileMutualFriends.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileMutualFriends.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileMutualFriends' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileMutualFriends>() { + @Override + public void write(JsonWriter out, UserProfileMutualFriends value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileMutualFriends read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileMutualFriends ret = new UserProfileMutualFriends(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileMutualFriends: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileMutualFriends() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileMutualFriends(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileMutualFriends.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileMutualFriends + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileMutualFriends with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileMutualFriends given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileMutualFriends + * @throws IOException if the JSON string is invalid with respect to UserProfileMutualFriends + */ + public static UserProfileMutualFriends fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileMutualFriends.class); + } + + /** + * Convert an instance of UserProfileMutualFriends to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileNextResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileNextResponse.java new file mode 100644 index 0000000..cc377dc --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileNextResponse.java @@ -0,0 +1,351 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.SimpleUserProfileResponse; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * UserProfileNextResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileNextResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<SimpleUserProfileResponse> data = new ArrayList<>(); + + public static final String SERIALIZED_NAME_NEXT = "next"; + @SerializedName(SERIALIZED_NAME_NEXT) + @javax.annotation.Nullable + private String next; + + public UserProfileNextResponse() { + } + + public UserProfileNextResponse data(@javax.annotation.Nullable List<SimpleUserProfileResponse> data) { + this.data = data; + return this; + } + + public UserProfileNextResponse addDataItem(SimpleUserProfileResponse dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<SimpleUserProfileResponse> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<SimpleUserProfileResponse> data) { + this.data = data; + } + + + public UserProfileNextResponse next(@javax.annotation.Nullable String next) { + this.next = next; + return this; + } + + /** + * The token to retrieve the next page of results. + * @return next + */ + @javax.annotation.Nullable + public String getNext() { + return next; + } + + public void setNext(@javax.annotation.Nullable String next) { + this.next = next; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UserProfileNextResponse instance itself + */ + public UserProfileNextResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserProfileNextResponse userProfileNextResponse = (UserProfileNextResponse) o; + return Objects.equals(this.data, userProfileNextResponse.data) && + Objects.equals(this.next, userProfileNextResponse.next)&& + Objects.equals(this.additionalProperties, userProfileNextResponse.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(data, next, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserProfileNextResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" next: ").append(toIndentedString(next)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("data"); + openapiFields.add("next"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 UserProfileNextResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserProfileNextResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserProfileNextResponse is not found in the empty JSON string", UserProfileNextResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + // validate the optional field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + SimpleUserProfileResponse.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + if ((jsonObj.get("next") != null && !jsonObj.get("next").isJsonNull()) && !jsonObj.get("next").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `next` to be a primitive type in the JSON string but got `%s`", jsonObj.get("next").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileNextResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileNextResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<UserProfileNextResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserProfileNextResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileNextResponse>() { + @Override + public void write(JsonWriter out, UserProfileNextResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UserProfileNextResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UserProfileNextResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserProfileNextResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileNextResponse + * @throws IOException if the JSON string is invalid with respect to UserProfileNextResponse + */ + public static UserProfileNextResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileNextResponse.class); + } + + /** + * Convert an instance of UserProfileNextResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileNextResponseWithCustomObject.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileNextResponseWithCustomObject.java new file mode 100644 index 0000000..8a55829 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileNextResponseWithCustomObject.java @@ -0,0 +1,351 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ExtendUserProfileWithCustomObject; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * UserProfileNextResponseWithCustomObject + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileNextResponseWithCustomObject { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<ExtendUserProfileWithCustomObject> data = new ArrayList<>(); + + public static final String SERIALIZED_NAME_NEXT = "next"; + @SerializedName(SERIALIZED_NAME_NEXT) + @javax.annotation.Nullable + private String next; + + public UserProfileNextResponseWithCustomObject() { + } + + public UserProfileNextResponseWithCustomObject data(@javax.annotation.Nullable List<ExtendUserProfileWithCustomObject> data) { + this.data = data; + return this; + } + + public UserProfileNextResponseWithCustomObject addDataItem(ExtendUserProfileWithCustomObject dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<ExtendUserProfileWithCustomObject> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<ExtendUserProfileWithCustomObject> data) { + this.data = data; + } + + + public UserProfileNextResponseWithCustomObject next(@javax.annotation.Nullable String next) { + this.next = next; + return this; + } + + /** + * The token to retrieve the next page of results. + * @return next + */ + @javax.annotation.Nullable + public String getNext() { + return next; + } + + public void setNext(@javax.annotation.Nullable String next) { + this.next = next; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UserProfileNextResponseWithCustomObject instance itself + */ + public UserProfileNextResponseWithCustomObject putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserProfileNextResponseWithCustomObject userProfileNextResponseWithCustomObject = (UserProfileNextResponseWithCustomObject) o; + return Objects.equals(this.data, userProfileNextResponseWithCustomObject.data) && + Objects.equals(this.next, userProfileNextResponseWithCustomObject.next)&& + Objects.equals(this.additionalProperties, userProfileNextResponseWithCustomObject.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(data, next, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserProfileNextResponseWithCustomObject {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" next: ").append(toIndentedString(next)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("data"); + openapiFields.add("next"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 UserProfileNextResponseWithCustomObject + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserProfileNextResponseWithCustomObject.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserProfileNextResponseWithCustomObject is not found in the empty JSON string", UserProfileNextResponseWithCustomObject.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + // validate the optional field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + ExtendUserProfileWithCustomObject.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + if ((jsonObj.get("next") != null && !jsonObj.get("next").isJsonNull()) && !jsonObj.get("next").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `next` to be a primitive type in the JSON string but got `%s`", jsonObj.get("next").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileNextResponseWithCustomObject.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileNextResponseWithCustomObject' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<UserProfileNextResponseWithCustomObject> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserProfileNextResponseWithCustomObject.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileNextResponseWithCustomObject>() { + @Override + public void write(JsonWriter out, UserProfileNextResponseWithCustomObject value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UserProfileNextResponseWithCustomObject read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UserProfileNextResponseWithCustomObject instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserProfileNextResponseWithCustomObject given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileNextResponseWithCustomObject + * @throws IOException if the JSON string is invalid with respect to UserProfileNextResponseWithCustomObject + */ + public static UserProfileNextResponseWithCustomObject fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileNextResponseWithCustomObject.class); + } + + /** + * Convert an instance of UserProfileNextResponseWithCustomObject to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfilePatents.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfilePatents.java new file mode 100644 index 0000000..6000eef --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfilePatents.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfilePatents extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfilePatents.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfilePatents.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfilePatents' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfilePatents>() { + @Override + public void write(JsonWriter out, UserProfilePatents value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfilePatents read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfilePatents ret = new UserProfilePatents(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfilePatents: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfilePatents() { + super("oneOf", Boolean.FALSE); + } + + public UserProfilePatents(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfilePatents.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfilePatents + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfilePatents with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfilePatents given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfilePatents + * @throws IOException if the JSON string is invalid with respect to UserProfilePatents + */ + public static UserProfilePatents fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfilePatents.class); + } + + /** + * Convert an instance of UserProfilePatents to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfilePhoneNumbers.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfilePhoneNumbers.java new file mode 100644 index 0000000..1510cd8 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfilePhoneNumbers.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfilePhoneNumbers extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfilePhoneNumbers.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfilePhoneNumbers.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfilePhoneNumbers' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfilePhoneNumbers>() { + @Override + public void write(JsonWriter out, UserProfilePhoneNumbers value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfilePhoneNumbers read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfilePhoneNumbers ret = new UserProfilePhoneNumbers(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfilePhoneNumbers: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfilePhoneNumbers() { + super("oneOf", Boolean.FALSE); + } + + public UserProfilePhoneNumbers(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfilePhoneNumbers.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfilePhoneNumbers + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfilePhoneNumbers with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfilePhoneNumbers given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfilePhoneNumbers + * @throws IOException if the JSON string is invalid with respect to UserProfilePhoneNumbers + */ + public static UserProfilePhoneNumbers fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfilePhoneNumbers.class); + } + + /** + * Convert an instance of UserProfilePhoneNumbers to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfilePlacesLived.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfilePlacesLived.java new file mode 100644 index 0000000..214f077 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfilePlacesLived.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfilePlacesLived extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfilePlacesLived.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfilePlacesLived.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfilePlacesLived' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfilePlacesLived>() { + @Override + public void write(JsonWriter out, UserProfilePlacesLived value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfilePlacesLived read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfilePlacesLived ret = new UserProfilePlacesLived(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfilePlacesLived: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfilePlacesLived() { + super("oneOf", Boolean.FALSE); + } + + public UserProfilePlacesLived(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfilePlacesLived.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfilePlacesLived + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfilePlacesLived with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfilePlacesLived given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfilePlacesLived + * @throws IOException if the JSON string is invalid with respect to UserProfilePlacesLived + */ + public static UserProfilePlacesLived fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfilePlacesLived.class); + } + + /** + * Convert an instance of UserProfilePlacesLived to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfilePositions.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfilePositions.java new file mode 100644 index 0000000..2dd24b0 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfilePositions.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfilePositions extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfilePositions.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfilePositions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfilePositions' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfilePositions>() { + @Override + public void write(JsonWriter out, UserProfilePositions value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfilePositions read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfilePositions ret = new UserProfilePositions(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfilePositions: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfilePositions() { + super("oneOf", Boolean.FALSE); + } + + public UserProfilePositions(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfilePositions.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfilePositions + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfilePositions with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfilePositions given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfilePositions + * @throws IOException if the JSON string is invalid with respect to UserProfilePositions + */ + public static UserProfilePositions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfilePositions.class); + } + + /** + * Convert an instance of UserProfilePositions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfilePrivacyPolicy.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfilePrivacyPolicy.java new file mode 100644 index 0000000..334ad89 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfilePrivacyPolicy.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfilePrivacyPolicy extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfilePrivacyPolicy.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfilePrivacyPolicy.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfilePrivacyPolicy' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfilePrivacyPolicy>() { + @Override + public void write(JsonWriter out, UserProfilePrivacyPolicy value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfilePrivacyPolicy read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + + if (match == 1) { + UserProfilePrivacyPolicy ret = new UserProfilePrivacyPolicy(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfilePrivacyPolicy: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfilePrivacyPolicy() { + super("oneOf", Boolean.FALSE); + } + + public UserProfilePrivacyPolicy(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Object", Object.class); + schemas.put("List<Object>", List.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfilePrivacyPolicy.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * 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 UserProfilePrivacyPolicy + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfilePrivacyPolicy with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfilePrivacyPolicy given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfilePrivacyPolicy + * @throws IOException if the JSON string is invalid with respect to UserProfilePrivacyPolicy + */ + public static UserProfilePrivacyPolicy fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfilePrivacyPolicy.class); + } + + /** + * Convert an instance of UserProfilePrivacyPolicy to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileProfileImageUrls.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileProfileImageUrls.java new file mode 100644 index 0000000..a64bfed --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileProfileImageUrls.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileProfileImageUrls extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileProfileImageUrls.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileProfileImageUrls.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileProfileImageUrls' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileProfileImageUrls>() { + @Override + public void write(JsonWriter out, UserProfileProfileImageUrls value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileProfileImageUrls read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileProfileImageUrls ret = new UserProfileProfileImageUrls(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileProfileImageUrls: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileProfileImageUrls() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileProfileImageUrls(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileProfileImageUrls.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileProfileImageUrls + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileProfileImageUrls with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileProfileImageUrls given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileProfileImageUrls + * @throws IOException if the JSON string is invalid with respect to UserProfileProfileImageUrls + */ + public static UserProfileProfileImageUrls fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileProfileImageUrls.class); + } + + /** + * Convert an instance of UserProfileProfileImageUrls to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileProfileUrl.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileProfileUrl.java new file mode 100644 index 0000000..4d5efff --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileProfileUrl.java @@ -0,0 +1,274 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileProfileUrl extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileProfileUrl.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileProfileUrl.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileProfileUrl' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<String> adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileProfileUrl>() { + @Override + public void write(JsonWriter out, UserProfileProfileUrl value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonPrimitive primitive = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Object, String"); + } + + @Override + public UserProfileProfileUrl read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileProfileUrl ret = new UserProfileProfileUrl(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileProfileUrl: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileProfileUrl() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileProfileUrl(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", String.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileProfileUrl.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Object, String + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Object, String"); + } + + /** + * Get the actual instance, which can be the following: + * Object, String + * + * @return The actual instance (Object, String) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileProfileUrl + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with String + try { + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileProfileUrl with oneOf schemas: Object, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileProfileUrl given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileProfileUrl + * @throws IOException if the JSON string is invalid with respect to UserProfileProfileUrl + */ + public static UserProfileProfileUrl fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileProfileUrl.class); + } + + /** + * Convert an instance of UserProfileProfileUrl to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileProjects.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileProjects.java new file mode 100644 index 0000000..db751f5 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileProjects.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileProjects extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileProjects.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileProjects.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileProjects' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileProjects>() { + @Override + public void write(JsonWriter out, UserProfileProjects value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileProjects read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileProjects ret = new UserProfileProjects(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileProjects: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileProjects() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileProjects(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileProjects.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileProjects + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileProjects with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileProjects given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileProjects + * @throws IOException if the JSON string is invalid with respect to UserProfileProjects + */ + public static UserProfileProjects fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileProjects.class); + } + + /** + * Convert an instance of UserProfileProjects to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfilePublicRepository.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfilePublicRepository.java new file mode 100644 index 0000000..21aa017 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfilePublicRepository.java @@ -0,0 +1,274 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfilePublicRepository extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfilePublicRepository.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfilePublicRepository.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfilePublicRepository' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<String> adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfilePublicRepository>() { + @Override + public void write(JsonWriter out, UserProfilePublicRepository value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonPrimitive primitive = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Object, String"); + } + + @Override + public UserProfilePublicRepository read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfilePublicRepository ret = new UserProfilePublicRepository(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfilePublicRepository: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfilePublicRepository() { + super("oneOf", Boolean.FALSE); + } + + public UserProfilePublicRepository(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", String.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfilePublicRepository.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Object, String + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Object, String"); + } + + /** + * Get the actual instance, which can be the following: + * Object, String + * + * @return The actual instance (Object, String) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfilePublicRepository + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with String + try { + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfilePublicRepository with oneOf schemas: Object, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfilePublicRepository given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfilePublicRepository + * @throws IOException if the JSON string is invalid with respect to UserProfilePublicRepository + */ + public static UserProfilePublicRepository fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfilePublicRepository.class); + } + + /** + * Convert an instance of UserProfilePublicRepository to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfilePublications.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfilePublications.java new file mode 100644 index 0000000..e67a519 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfilePublications.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfilePublications extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfilePublications.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfilePublications.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfilePublications' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfilePublications>() { + @Override + public void write(JsonWriter out, UserProfilePublications value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfilePublications read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfilePublications ret = new UserProfilePublications(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfilePublications: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfilePublications() { + super("oneOf", Boolean.FALSE); + } + + public UserProfilePublications(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfilePublications.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfilePublications + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfilePublications with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfilePublications given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfilePublications + * @throws IOException if the JSON string is invalid with respect to UserProfilePublications + */ + public static UserProfilePublications fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfilePublications.class); + } + + /** + * Convert an instance of UserProfilePublications to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileRecommendationsReceived.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileRecommendationsReceived.java new file mode 100644 index 0000000..ecaf7e2 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileRecommendationsReceived.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileRecommendationsReceived extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileRecommendationsReceived.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileRecommendationsReceived.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileRecommendationsReceived' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileRecommendationsReceived>() { + @Override + public void write(JsonWriter out, UserProfileRecommendationsReceived value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileRecommendationsReceived read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileRecommendationsReceived ret = new UserProfileRecommendationsReceived(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileRecommendationsReceived: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileRecommendationsReceived() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileRecommendationsReceived(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileRecommendationsReceived.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileRecommendationsReceived + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileRecommendationsReceived with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileRecommendationsReceived given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileRecommendationsReceived + * @throws IOException if the JSON string is invalid with respect to UserProfileRecommendationsReceived + */ + public static UserProfileRecommendationsReceived fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileRecommendationsReceived.class); + } + + /** + * Convert an instance of UserProfileRecommendationsReceived to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileRelatedProfileViews.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileRelatedProfileViews.java new file mode 100644 index 0000000..791c0a5 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileRelatedProfileViews.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileRelatedProfileViews extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileRelatedProfileViews.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileRelatedProfileViews.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileRelatedProfileViews' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileRelatedProfileViews>() { + @Override + public void write(JsonWriter out, UserProfileRelatedProfileViews value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileRelatedProfileViews read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileRelatedProfileViews ret = new UserProfileRelatedProfileViews(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileRelatedProfileViews: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileRelatedProfileViews() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileRelatedProfileViews(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileRelatedProfileViews.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileRelatedProfileViews + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileRelatedProfileViews with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileRelatedProfileViews given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileRelatedProfileViews + * @throws IOException if the JSON string is invalid with respect to UserProfileRelatedProfileViews + */ + public static UserProfileRelatedProfileViews fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileRelatedProfileViews.class); + } + + /** + * Convert an instance of UserProfileRelatedProfileViews to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileRepositoryUrl.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileRepositoryUrl.java new file mode 100644 index 0000000..9594d7e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileRepositoryUrl.java @@ -0,0 +1,274 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileRepositoryUrl extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileRepositoryUrl.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileRepositoryUrl.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileRepositoryUrl' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<String> adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileRepositoryUrl>() { + @Override + public void write(JsonWriter out, UserProfileRepositoryUrl value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonPrimitive primitive = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Object, String"); + } + + @Override + public UserProfileRepositoryUrl read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileRepositoryUrl ret = new UserProfileRepositoryUrl(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileRepositoryUrl: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileRepositoryUrl() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileRepositoryUrl(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", String.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileRepositoryUrl.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Object, String + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Object, String"); + } + + /** + * Get the actual instance, which can be the following: + * Object, String + * + * @return The actual instance (Object, String) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileRepositoryUrl + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with String + try { + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileRepositoryUrl with oneOf schemas: Object, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileRepositoryUrl given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileRepositoryUrl + * @throws IOException if the JSON string is invalid with respect to UserProfileRepositoryUrl + */ + public static UserProfileRepositoryUrl fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileRepositoryUrl.class); + } + + /** + * Convert an instance of UserProfileRepositoryUrl to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileRequestBody.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileRequestBody.java new file mode 100644 index 0000000..a61765e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileRequestBody.java @@ -0,0 +1,373 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.IdentityQuery; +import java.io.IOException; +import java.time.LocalDate; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * UserProfileRequestBody + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileRequestBody { + public static final String SERIALIZED_NAME_FROM = "from"; + @SerializedName(SERIALIZED_NAME_FROM) + @javax.annotation.Nullable + private LocalDate from; + + public static final String SERIALIZED_NAME_TO = "to"; + @SerializedName(SERIALIZED_NAME_TO) + @javax.annotation.Nullable + private LocalDate to; + + public static final String SERIALIZED_NAME_SIZE = "size"; + @SerializedName(SERIALIZED_NAME_SIZE) + @javax.annotation.Nullable + private Integer size; + + public static final String SERIALIZED_NAME_Q = "q"; + @SerializedName(SERIALIZED_NAME_Q) + @javax.annotation.Nullable + private IdentityQuery q; + + public UserProfileRequestBody() { + } + + public UserProfileRequestBody from(@javax.annotation.Nullable LocalDate from) { + this.from = from; + return this; + } + + /** + * Start date in YYYY-MM-DD format. + * @return from + */ + @javax.annotation.Nullable + public LocalDate getFrom() { + return from; + } + + public void setFrom(@javax.annotation.Nullable LocalDate from) { + this.from = from; + } + + + public UserProfileRequestBody to(@javax.annotation.Nullable LocalDate to) { + this.to = to; + return this; + } + + /** + * End date in YYYY-MM-DD format. + * @return to + */ + @javax.annotation.Nullable + public LocalDate getTo() { + return to; + } + + public void setTo(@javax.annotation.Nullable LocalDate to) { + this.to = to; + } + + + public UserProfileRequestBody size(@javax.annotation.Nullable Integer size) { + this.size = size; + return this; + } + + /** + * Number of results to return. + * minimum: 1 + * maximum: 1000 + * @return size + */ + @javax.annotation.Nullable + public Integer getSize() { + return size; + } + + public void setSize(@javax.annotation.Nullable Integer size) { + this.size = size; + } + + + public UserProfileRequestBody q(@javax.annotation.Nullable IdentityQuery q) { + this.q = q; + return this; + } + + /** + * Get q + * @return q + */ + @javax.annotation.Nullable + public IdentityQuery getQ() { + return q; + } + + public void setQ(@javax.annotation.Nullable IdentityQuery q) { + this.q = q; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UserProfileRequestBody instance itself + */ + public UserProfileRequestBody putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserProfileRequestBody userProfileRequestBody = (UserProfileRequestBody) o; + return Objects.equals(this.from, userProfileRequestBody.from) && + Objects.equals(this.to, userProfileRequestBody.to) && + Objects.equals(this.size, userProfileRequestBody.size) && + Objects.equals(this.q, userProfileRequestBody.q)&& + Objects.equals(this.additionalProperties, userProfileRequestBody.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(from, to, size, q, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserProfileRequestBody {\n"); + sb.append(" from: ").append(toIndentedString(from)).append("\n"); + sb.append(" to: ").append(toIndentedString(to)).append("\n"); + sb.append(" size: ").append(toIndentedString(size)).append("\n"); + sb.append(" q: ").append(toIndentedString(q)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("from"); + openapiFields.add("to"); + openapiFields.add("size"); + openapiFields.add("q"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 UserProfileRequestBody + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserProfileRequestBody.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserProfileRequestBody is not found in the empty JSON string", UserProfileRequestBody.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `q` + if (jsonObj.get("q") != null && !jsonObj.get("q").isJsonNull()) { + IdentityQuery.validateJsonElement(jsonObj.get("q")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileRequestBody.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileRequestBody' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<UserProfileRequestBody> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserProfileRequestBody.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileRequestBody>() { + @Override + public void write(JsonWriter out, UserProfileRequestBody value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UserProfileRequestBody read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UserProfileRequestBody instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserProfileRequestBody given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileRequestBody + * @throws IOException if the JSON string is invalid with respect to UserProfileRequestBody + */ + public static UserProfileRequestBody fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileRequestBody.class); + } + + /** + * Convert an instance of UserProfileRequestBody to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileResponse.java new file mode 100644 index 0000000..ccdec9a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileResponse.java @@ -0,0 +1,339 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.UserProfile; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * UserProfileResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileResponse { + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<UserProfile> data = new ArrayList<>(); + + public static final String SERIALIZED_NAME_NEXT = "next"; + @SerializedName(SERIALIZED_NAME_NEXT) + @javax.annotation.Nullable + private String next; + + public UserProfileResponse() { + } + + public UserProfileResponse data(@javax.annotation.Nullable List<UserProfile> data) { + this.data = data; + return this; + } + + public UserProfileResponse addDataItem(UserProfile dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * List of User profiles. + * @return data + */ + @javax.annotation.Nullable + public List<UserProfile> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<UserProfile> data) { + this.data = data; + } + + + public UserProfileResponse next(@javax.annotation.Nullable String next) { + this.next = next; + return this; + } + + /** + * Scroll or pagination token for fetching the next set of results. + * @return next + */ + @javax.annotation.Nullable + public String getNext() { + return next; + } + + public void setNext(@javax.annotation.Nullable String next) { + this.next = next; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UserProfileResponse instance itself + */ + public UserProfileResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserProfileResponse userProfileResponse = (UserProfileResponse) o; + return Objects.equals(this.data, userProfileResponse.data) && + Objects.equals(this.next, userProfileResponse.next)&& + Objects.equals(this.additionalProperties, userProfileResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, next, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserProfileResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" next: ").append(toIndentedString(next)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("data"); + openapiFields.add("next"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 UserProfileResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserProfileResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserProfileResponse is not found in the empty JSON string", UserProfileResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + // validate the optional field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + UserProfile.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + if ((jsonObj.get("next") != null && !jsonObj.get("next").isJsonNull()) && !jsonObj.get("next").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `next` to be a primitive type in the JSON string but got `%s`", jsonObj.get("next").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<UserProfileResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserProfileResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileResponse>() { + @Override + public void write(JsonWriter out, UserProfileResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UserProfileResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UserProfileResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserProfileResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileResponse + * @throws IOException if the JSON string is invalid with respect to UserProfileResponse + */ + public static UserProfileResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileResponse.class); + } + + /** + * Convert an instance of UserProfileResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileRoleContext.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileRoleContext.java new file mode 100644 index 0000000..5dbba46 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileRoleContext.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileRoleContext extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileRoleContext.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileRoleContext.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileRoleContext' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileRoleContext>() { + @Override + public void write(JsonWriter out, UserProfileRoleContext value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileRoleContext read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + + if (match == 1) { + UserProfileRoleContext ret = new UserProfileRoleContext(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileRoleContext: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileRoleContext() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileRoleContext(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Object", Object.class); + schemas.put("List<Object>", List.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileRoleContext.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * 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 UserProfileRoleContext + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileRoleContext with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileRoleContext given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileRoleContext + * @throws IOException if the JSON string is invalid with respect to UserProfileRoleContext + */ + public static UserProfileRoleContext fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileRoleContext.class); + } + + /** + * Convert an instance of UserProfileRoleContext to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileScrollResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileScrollResponse.java new file mode 100644 index 0000000..800e191 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileScrollResponse.java @@ -0,0 +1,366 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.SimpleUserProfileResponse; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * UserProfileScrollResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileScrollResponse { + public static final String SERIALIZED_NAME_TOTAL = "total"; + @SerializedName(SERIALIZED_NAME_TOTAL) + @javax.annotation.Nullable + private Integer total; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<SimpleUserProfileResponse> data = new ArrayList<>(); + + public static final String SERIALIZED_NAME_NEXT = "next"; + @SerializedName(SERIALIZED_NAME_NEXT) + @javax.annotation.Nullable + private String next; + + public UserProfileScrollResponse() { + } + + public UserProfileScrollResponse total(@javax.annotation.Nullable Integer total) { + this.total = total; + return this; + } + + /** + * Total number of User profiles matching the query. + * @return total + */ + @javax.annotation.Nullable + public Integer getTotal() { + return total; + } + + public void setTotal(@javax.annotation.Nullable Integer total) { + this.total = total; + } + + + public UserProfileScrollResponse data(@javax.annotation.Nullable List<SimpleUserProfileResponse> data) { + this.data = data; + return this; + } + + public UserProfileScrollResponse addDataItem(SimpleUserProfileResponse dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * List of User profiles. + * @return data + */ + @javax.annotation.Nullable + public List<SimpleUserProfileResponse> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<SimpleUserProfileResponse> data) { + this.data = data; + } + + + public UserProfileScrollResponse next(@javax.annotation.Nullable String next) { + this.next = next; + return this; + } + + /** + * Scroll or pagination token for fetching the next set of results. + * @return next + */ + @javax.annotation.Nullable + public String getNext() { + return next; + } + + public void setNext(@javax.annotation.Nullable String next) { + this.next = next; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UserProfileScrollResponse instance itself + */ + public UserProfileScrollResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserProfileScrollResponse userProfileScrollResponse = (UserProfileScrollResponse) o; + return Objects.equals(this.total, userProfileScrollResponse.total) && + Objects.equals(this.data, userProfileScrollResponse.data) && + Objects.equals(this.next, userProfileScrollResponse.next)&& + Objects.equals(this.additionalProperties, userProfileScrollResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(total, data, next, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserProfileScrollResponse {\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" next: ").append(toIndentedString(next)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("total"); + openapiFields.add("data"); + openapiFields.add("next"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 UserProfileScrollResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserProfileScrollResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserProfileScrollResponse is not found in the empty JSON string", UserProfileScrollResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + // validate the optional field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + SimpleUserProfileResponse.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + if ((jsonObj.get("next") != null && !jsonObj.get("next").isJsonNull()) && !jsonObj.get("next").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `next` to be a primitive type in the JSON string but got `%s`", jsonObj.get("next").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileScrollResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileScrollResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<UserProfileScrollResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserProfileScrollResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileScrollResponse>() { + @Override + public void write(JsonWriter out, UserProfileScrollResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UserProfileScrollResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UserProfileScrollResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserProfileScrollResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileScrollResponse + * @throws IOException if the JSON string is invalid with respect to UserProfileScrollResponse + */ + public static UserProfileScrollResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileScrollResponse.class); + } + + /** + * Convert an instance of UserProfileScrollResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileScrollResponseWithCustomObject.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileScrollResponseWithCustomObject.java new file mode 100644 index 0000000..57803f5 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileScrollResponseWithCustomObject.java @@ -0,0 +1,366 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ExtendUserProfileWithCustomObject; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * UserProfileScrollResponseWithCustomObject + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileScrollResponseWithCustomObject { + public static final String SERIALIZED_NAME_TOTAL = "total"; + @SerializedName(SERIALIZED_NAME_TOTAL) + @javax.annotation.Nullable + private Integer total; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<ExtendUserProfileWithCustomObject> data = new ArrayList<>(); + + public static final String SERIALIZED_NAME_NEXT = "next"; + @SerializedName(SERIALIZED_NAME_NEXT) + @javax.annotation.Nullable + private String next; + + public UserProfileScrollResponseWithCustomObject() { + } + + public UserProfileScrollResponseWithCustomObject total(@javax.annotation.Nullable Integer total) { + this.total = total; + return this; + } + + /** + * Total number of User profiles matching the query. + * @return total + */ + @javax.annotation.Nullable + public Integer getTotal() { + return total; + } + + public void setTotal(@javax.annotation.Nullable Integer total) { + this.total = total; + } + + + public UserProfileScrollResponseWithCustomObject data(@javax.annotation.Nullable List<ExtendUserProfileWithCustomObject> data) { + this.data = data; + return this; + } + + public UserProfileScrollResponseWithCustomObject addDataItem(ExtendUserProfileWithCustomObject dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * List of User profiles. + * @return data + */ + @javax.annotation.Nullable + public List<ExtendUserProfileWithCustomObject> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<ExtendUserProfileWithCustomObject> data) { + this.data = data; + } + + + public UserProfileScrollResponseWithCustomObject next(@javax.annotation.Nullable String next) { + this.next = next; + return this; + } + + /** + * Scroll or pagination token for fetching the next set of results. + * @return next + */ + @javax.annotation.Nullable + public String getNext() { + return next; + } + + public void setNext(@javax.annotation.Nullable String next) { + this.next = next; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UserProfileScrollResponseWithCustomObject instance itself + */ + public UserProfileScrollResponseWithCustomObject putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserProfileScrollResponseWithCustomObject userProfileScrollResponseWithCustomObject = (UserProfileScrollResponseWithCustomObject) o; + return Objects.equals(this.total, userProfileScrollResponseWithCustomObject.total) && + Objects.equals(this.data, userProfileScrollResponseWithCustomObject.data) && + Objects.equals(this.next, userProfileScrollResponseWithCustomObject.next)&& + Objects.equals(this.additionalProperties, userProfileScrollResponseWithCustomObject.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(total, data, next, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserProfileScrollResponseWithCustomObject {\n"); + sb.append(" total: ").append(toIndentedString(total)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" next: ").append(toIndentedString(next)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("total"); + openapiFields.add("data"); + openapiFields.add("next"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 UserProfileScrollResponseWithCustomObject + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserProfileScrollResponseWithCustomObject.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserProfileScrollResponseWithCustomObject is not found in the empty JSON string", UserProfileScrollResponseWithCustomObject.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("data") != null && !jsonObj.get("data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `data` to be an array in the JSON string but got `%s`", jsonObj.get("data").toString())); + } + + // validate the optional field `data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + ExtendUserProfileWithCustomObject.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + if ((jsonObj.get("next") != null && !jsonObj.get("next").isJsonNull()) && !jsonObj.get("next").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `next` to be a primitive type in the JSON string but got `%s`", jsonObj.get("next").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileScrollResponseWithCustomObject.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileScrollResponseWithCustomObject' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<UserProfileScrollResponseWithCustomObject> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserProfileScrollResponseWithCustomObject.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileScrollResponseWithCustomObject>() { + @Override + public void write(JsonWriter out, UserProfileScrollResponseWithCustomObject value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UserProfileScrollResponseWithCustomObject read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UserProfileScrollResponseWithCustomObject instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserProfileScrollResponseWithCustomObject given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileScrollResponseWithCustomObject + * @throws IOException if the JSON string is invalid with respect to UserProfileScrollResponseWithCustomObject + */ + public static UserProfileScrollResponseWithCustomObject fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileScrollResponseWithCustomObject.class); + } + + /** + * Convert an instance of UserProfileScrollResponseWithCustomObject to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileSignupLog.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileSignupLog.java new file mode 100644 index 0000000..e9cde3c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileSignupLog.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileSignupLog extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileSignupLog.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileSignupLog.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileSignupLog' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileSignupLog>() { + @Override + public void write(JsonWriter out, UserProfileSignupLog value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileSignupLog read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + + if (match == 1) { + UserProfileSignupLog ret = new UserProfileSignupLog(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileSignupLog: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileSignupLog() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileSignupLog(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("Object", Object.class); + schemas.put("List<Object>", List.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileSignupLog.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * 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 UserProfileSignupLog + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileSignupLog with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileSignupLog given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileSignupLog + * @throws IOException if the JSON string is invalid with respect to UserProfileSignupLog + */ + public static UserProfileSignupLog fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileSignupLog.class); + } + + /** + * Convert an instance of UserProfileSignupLog to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileSkills.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileSkills.java new file mode 100644 index 0000000..9e20c03 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileSkills.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileSkills extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileSkills.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileSkills.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileSkills' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileSkills>() { + @Override + public void write(JsonWriter out, UserProfileSkills value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileSkills read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileSkills ret = new UserProfileSkills(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileSkills: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileSkills() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileSkills(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileSkills.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileSkills + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileSkills with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileSkills given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileSkills + * @throws IOException if the JSON string is invalid with respect to UserProfileSkills + */ + public static UserProfileSkills fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileSkills.class); + } + + /** + * Convert an instance of UserProfileSkills to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileSports.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileSports.java new file mode 100644 index 0000000..59da53b --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileSports.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileSports extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileSports.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileSports.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileSports' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileSports>() { + @Override + public void write(JsonWriter out, UserProfileSports value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileSports read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileSports ret = new UserProfileSports(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileSports: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileSports() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileSports(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileSports.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileSports + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileSports with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileSports given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileSports + * @throws IOException if the JSON string is invalid with respect to UserProfileSports + */ + public static UserProfileSports fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileSports.class); + } + + /** + * Convert an instance of UserProfileSports to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileStarredUrl.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileStarredUrl.java new file mode 100644 index 0000000..dac1a06 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileStarredUrl.java @@ -0,0 +1,274 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileStarredUrl extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileStarredUrl.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileStarredUrl.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileStarredUrl' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<String> adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileStarredUrl>() { + @Override + public void write(JsonWriter out, UserProfileStarredUrl value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonPrimitive primitive = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Object, String"); + } + + @Override + public UserProfileStarredUrl read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileStarredUrl ret = new UserProfileStarredUrl(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileStarredUrl: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileStarredUrl() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileStarredUrl(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", String.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileStarredUrl.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Object, String + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Object, String"); + } + + /** + * Get the actual instance, which can be the following: + * Object, String + * + * @return The actual instance (Object, String) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileStarredUrl + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with String + try { + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileStarredUrl with oneOf schemas: Object, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileStarredUrl given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileStarredUrl + * @throws IOException if the JSON string is invalid with respect to UserProfileStarredUrl + */ + public static UserProfileStarredUrl fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileStarredUrl.class); + } + + /** + * Convert an instance of UserProfileStarredUrl to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileSubscription.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileSubscription.java new file mode 100644 index 0000000..88328c8 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileSubscription.java @@ -0,0 +1,274 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileSubscription extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileSubscription.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileSubscription.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileSubscription' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<String> adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileSubscription>() { + @Override + public void write(JsonWriter out, UserProfileSubscription value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonPrimitive primitive = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Object, String"); + } + + @Override + public UserProfileSubscription read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileSubscription ret = new UserProfileSubscription(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileSubscription: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileSubscription() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileSubscription(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", String.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileSubscription.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Object, String + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Object, String"); + } + + /** + * Get the actual instance, which can be the following: + * Object, String + * + * @return The actual instance (Object, String) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileSubscription + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with String + try { + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileSubscription with oneOf schemas: Object, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileSubscription given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileSubscription + * @throws IOException if the JSON string is invalid with respect to UserProfileSubscription + */ + public static UserProfileSubscription fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileSubscription.class); + } + + /** + * Convert an instance of UserProfileSubscription to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileSuggestions.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileSuggestions.java new file mode 100644 index 0000000..b111304 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileSuggestions.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileSuggestions extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileSuggestions.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileSuggestions.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileSuggestions' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileSuggestions>() { + @Override + public void write(JsonWriter out, UserProfileSuggestions value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileSuggestions read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileSuggestions ret = new UserProfileSuggestions(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileSuggestions: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileSuggestions() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileSuggestions(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileSuggestions.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileSuggestions + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileSuggestions with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileSuggestions given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileSuggestions + * @throws IOException if the JSON string is invalid with respect to UserProfileSuggestions + */ + public static UserProfileSuggestions fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileSuggestions.class); + } + + /** + * Convert an instance of UserProfileSuggestions to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileTeleVisionShow.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileTeleVisionShow.java new file mode 100644 index 0000000..edb938a --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileTeleVisionShow.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileTeleVisionShow extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileTeleVisionShow.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileTeleVisionShow.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileTeleVisionShow' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileTeleVisionShow>() { + @Override + public void write(JsonWriter out, UserProfileTeleVisionShow value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileTeleVisionShow read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileTeleVisionShow ret = new UserProfileTeleVisionShow(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileTeleVisionShow: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileTeleVisionShow() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileTeleVisionShow(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileTeleVisionShow.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileTeleVisionShow + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileTeleVisionShow with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileTeleVisionShow given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileTeleVisionShow + * @throws IOException if the JSON string is invalid with respect to UserProfileTeleVisionShow + */ + public static UserProfileTeleVisionShow fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileTeleVisionShow.class); + } + + /** + * Convert an instance of UserProfileTeleVisionShow to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileUnverifiedEmail.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileUnverifiedEmail.java new file mode 100644 index 0000000..713eb3b --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileUnverifiedEmail.java @@ -0,0 +1,274 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileUnverifiedEmail extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileUnverifiedEmail.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileUnverifiedEmail.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileUnverifiedEmail' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<String> adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileUnverifiedEmail>() { + @Override + public void write(JsonWriter out, UserProfileUnverifiedEmail value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonPrimitive primitive = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Object, String"); + } + + @Override + public UserProfileUnverifiedEmail read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileUnverifiedEmail ret = new UserProfileUnverifiedEmail(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileUnverifiedEmail: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileUnverifiedEmail() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileUnverifiedEmail(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", String.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileUnverifiedEmail.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Object, String + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Object, String"); + } + + /** + * Get the actual instance, which can be the following: + * Object, String + * + * @return The actual instance (Object, String) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileUnverifiedEmail + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with String + try { + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileUnverifiedEmail with oneOf schemas: Object, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileUnverifiedEmail given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileUnverifiedEmail + * @throws IOException if the JSON string is invalid with respect to UserProfileUnverifiedEmail + */ + public static UserProfileUnverifiedEmail fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileUnverifiedEmail.class); + } + + /** + * Convert an instance of UserProfileUnverifiedEmail to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileUserAgent.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileUserAgent.java new file mode 100644 index 0000000..20634d3 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileUserAgent.java @@ -0,0 +1,274 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileUserAgent extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileUserAgent.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileUserAgent.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileUserAgent' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<String> adapterString = gson.getDelegateAdapter(this, TypeToken.get(String.class)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileUserAgent>() { + @Override + public void write(JsonWriter out, UserProfileUserAgent value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `String` + if (value.getActualInstance() instanceof String) { + JsonPrimitive primitive = adapterString.toJsonTree((String)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: Object, String"); + } + + @Override + public UserProfileUserAgent read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize String + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterString; + match++; + log.log(Level.FINER, "Input data matches schema 'String'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'String'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileUserAgent ret = new UserProfileUserAgent(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileUserAgent: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileUserAgent() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileUserAgent(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("String", String.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileUserAgent.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * Object, String + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof String) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be Object, String"); + } + + /** + * Get the actual instance, which can be the following: + * Object, String + * + * @return The actual instance (Object, String) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `String`. If the actual instance is not `String`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `String` + * @throws ClassCastException if the instance is not `String` + */ + public String getString() throws ClassCastException { + return (String)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileUserAgent + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with String + try { + if (!jsonElement.getAsJsonPrimitive().isString()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type String in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for String failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileUserAgent with oneOf schemas: Object, String. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileUserAgent given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileUserAgent + * @throws IOException if the JSON string is invalid with respect to UserProfileUserAgent + */ + public static UserProfileUserAgent fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileUserAgent.class); + } + + /** + * Convert an instance of UserProfileUserAgent to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileVolunteer.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileVolunteer.java new file mode 100644 index 0000000..f72f0bb --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileVolunteer.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileVolunteer extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileVolunteer.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileVolunteer.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileVolunteer' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileVolunteer>() { + @Override + public void write(JsonWriter out, UserProfileVolunteer value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileVolunteer read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileVolunteer ret = new UserProfileVolunteer(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileVolunteer: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileVolunteer() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileVolunteer(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileVolunteer.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileVolunteer + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileVolunteer with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileVolunteer given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileVolunteer + * @throws IOException if the JSON string is invalid with respect to UserProfileVolunteer + */ + public static UserProfileVolunteer fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileVolunteer.class); + } + + /** + * Convert an instance of UserProfileVolunteer to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileWebProfiles.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileWebProfiles.java new file mode 100644 index 0000000..79930aa --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserProfileWebProfiles.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import java.util.List; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserProfileWebProfiles extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(UserProfileWebProfiles.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserProfileWebProfiles.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserProfileWebProfiles' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + + final Type typeInstanceListObject = new TypeToken<List<Object>>(){}.getType(); + final TypeAdapter<List<Object>> adapterListObject = (TypeAdapter<List<Object>>) gson.getDelegateAdapter(this, TypeToken.get(typeInstanceListObject)); + final TypeAdapter<Object> adapterObject = gson.getDelegateAdapter(this, TypeToken.get(Object.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserProfileWebProfiles>() { + @Override + public void write(JsonWriter out, UserProfileWebProfiles value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `List<Object>` + if (value.getActualInstance() instanceof List<?>) { + JsonPrimitive primitive = adapterListObject.toJsonTree((List<Object>)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + // check if the actual instance is of the type `Object` + if (value.getActualInstance() instanceof Object) { + JsonPrimitive primitive = adapterObject.toJsonTree((Object)value.getActualInstance()).getAsJsonPrimitive(); + elementAdapter.write(out, primitive); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: List<Object>, Object"); + } + + @Override + public UserProfileWebProfiles read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize List<Object> + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + actualAdapter = adapterListObject; + match++; + log.log(Level.FINER, "Input data matches schema 'List<Object>'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'List<Object>'", e); + } + // deserialize Object + try { + // validate the JSON object to see if any exception is thrown + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + actualAdapter = adapterObject; + match++; + log.log(Level.FINER, "Input data matches schema 'Object'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'Object'", e); + } + + if (match == 1) { + UserProfileWebProfiles ret = new UserProfileWebProfiles(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for UserProfileWebProfiles: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public UserProfileWebProfiles() { + super("oneOf", Boolean.FALSE); + } + + public UserProfileWebProfiles(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("List<Object>", List.class); + schemas.put("Object", Object.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return UserProfileWebProfiles.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * List<Object>, Object + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof List<?>) { + List<?> list = (List<?>) instance; + if (list.get(0) instanceof Object) { + super.setActualInstance(instance); + return; + } + } + + if (instance instanceof Object) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be List<Object>, Object"); + } + + /** + * Get the actual instance, which can be the following: + * List<Object>, Object + * + * @return The actual instance (List<Object>, Object) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `List<Object>`. If the actual instance is not `List<Object>`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `List<Object>` + * @throws ClassCastException if the instance is not `List<Object>` + */ + public List<Object> getListObject() throws ClassCastException { + return (List<Object>)super.getActualInstance(); + } + + /** + * Get the actual instance of `Object`. If the actual instance is not `Object`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `Object` + * @throws ClassCastException if the instance is not `Object` + */ + public Object getObject() throws ClassCastException { + return (Object)super.getActualInstance(); + } + + /** + * 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 UserProfileWebProfiles + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with List<Object> + try { + if (!jsonElement.isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected json element to be a array type in the JSON string but got `%s`", jsonElement.toString())); + } + JsonArray array = jsonElement.getAsJsonArray(); + // validate array items + for(JsonElement element : array) { + if (!element.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected array items to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for List<Object> failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with Object + try { + if (!jsonElement.getAsJsonPrimitive().isNumber()) { + throw new IllegalArgumentException(String.format("Expected json element to be of type Number in the JSON string but got `%s`", jsonElement.toString())); + } + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for Object failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for UserProfileWebProfiles with oneOf schemas: List<Object>, Object. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of UserProfileWebProfiles given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserProfileWebProfiles + * @throws IOException if the JSON string is invalid with respect to UserProfileWebProfiles + */ + public static UserProfileWebProfiles fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserProfileWebProfiles.class); + } + + /** + * Convert an instance of UserProfileWebProfiles to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserRegistrationByReCaptchaEmailPhoneUserNameRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserRegistrationByReCaptchaEmailPhoneUserNameRequest.java new file mode 100644 index 0000000..648c83d --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserRegistrationByReCaptchaEmailPhoneUserNameRequest.java @@ -0,0 +1,4446 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ProfileRequestModelAddressesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelAwardsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelBadgesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelBooksInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelCaptchaModel; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelCertificationsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelConsents; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelCountry; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelCoursesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelCurrentStatusInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelEducationsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelEmailInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelExternalIdsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelFamilyInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelFavoriteThingsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelGamesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelIMAccountsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelInspirationalPeopleInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelInterestsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelJobBookmarksInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelLanguagesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelMemberUrlResourcesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelMoviesInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelMutualFriendsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPINInfo; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPatentsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPhoneNumbersInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPlacesLivedInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPositionsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPrivacyPolicy; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelProjectsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelProviderAccessCredential; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelPublicationsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelRecommendationsReceivedInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelRelatedProfileViewsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSkillsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSportsInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSubscription; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelSuggestions; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelTeleVisionShowInner; +import com.loginradius.sdk.internal.openapi.model.ProfileRequestModelVolunteerInner; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * UserRegistrationByReCaptchaEmailPhoneUserNameRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserRegistrationByReCaptchaEmailPhoneUserNameRequest { + public static final String SERIALIZED_NAME_G_RECAPTCHA_RESPONSE = "g-recaptcha-response"; + @SerializedName(SERIALIZED_NAME_G_RECAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String gRecaptchaResponse; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_TICKET = "qq_captcha_ticket"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_TICKET) + @javax.annotation.Nullable + private String qqCaptchaTicket; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR = "qq_captcha_randstr"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR) + @javax.annotation.Nullable + private String qqCaptchaRandstr; + + public static final String SERIALIZED_NAME_H_CAPTCHA_RESPONSE = "h-captcha-response"; + @SerializedName(SERIALIZED_NAME_H_CAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String hCaptchaResponse; + + public static final String SERIALIZED_NAME_USER_NAME = "UserName"; + @SerializedName(SERIALIZED_NAME_USER_NAME) + @javax.annotation.Nullable + private String userName; + + public static final String SERIALIZED_NAME_PHONE_ID = "PhoneId"; + @SerializedName(SERIALIZED_NAME_PHONE_ID) + @javax.annotation.Nullable + private String phoneId; + + public static final String SERIALIZED_NAME_GENDER = "Gender"; + @SerializedName(SERIALIZED_NAME_GENDER) + @javax.annotation.Nullable + private String gender; + + public static final String SERIALIZED_NAME_BIRTH_DATE = "BirthDate"; + @SerializedName(SERIALIZED_NAME_BIRTH_DATE) + @javax.annotation.Nullable + private String birthDate; + + public static final String SERIALIZED_NAME_PREFIX = "Prefix"; + @SerializedName(SERIALIZED_NAME_PREFIX) + @javax.annotation.Nullable + private String prefix; + + public static final String SERIALIZED_NAME_FIRST_NAME = "FirstName"; + @SerializedName(SERIALIZED_NAME_FIRST_NAME) + @javax.annotation.Nullable + private String firstName; + + public static final String SERIALIZED_NAME_MIDDLE_NAME = "MiddleName"; + @SerializedName(SERIALIZED_NAME_MIDDLE_NAME) + @javax.annotation.Nullable + private String middleName; + + public static final String SERIALIZED_NAME_LAST_NAME = "LastName"; + @SerializedName(SERIALIZED_NAME_LAST_NAME) + @javax.annotation.Nullable + private String lastName; + + public static final String SERIALIZED_NAME_SUFFIX = "Suffix"; + @SerializedName(SERIALIZED_NAME_SUFFIX) + @javax.annotation.Nullable + private String suffix; + + public static final String SERIALIZED_NAME_NICK_NAME = "NickName"; + @SerializedName(SERIALIZED_NAME_NICK_NAME) + @javax.annotation.Nullable + private String nickName; + + public static final String SERIALIZED_NAME_PROFILE_NAME = "ProfileName"; + @SerializedName(SERIALIZED_NAME_PROFILE_NAME) + @javax.annotation.Nullable + private String profileName; + + public static final String SERIALIZED_NAME_ABOUT = "About"; + @SerializedName(SERIALIZED_NAME_ABOUT) + @javax.annotation.Nullable + private String about; + + public static final String SERIALIZED_NAME_COMPANY = "Company"; + @SerializedName(SERIALIZED_NAME_COMPANY) + @javax.annotation.Nullable + private String company; + + public static final String SERIALIZED_NAME_IMAGE_URL = "ImageUrl"; + @SerializedName(SERIALIZED_NAME_IMAGE_URL) + @javax.annotation.Nullable + private String imageUrl; + + public static final String SERIALIZED_NAME_TIME_ZONE = "TimeZone"; + @SerializedName(SERIALIZED_NAME_TIME_ZONE) + @javax.annotation.Nullable + private String timeZone; + + public static final String SERIALIZED_NAME_WEBSITE = "Website"; + @SerializedName(SERIALIZED_NAME_WEBSITE) + @javax.annotation.Nullable + private String website; + + public static final String SERIALIZED_NAME_THUMBNAIL_IMAGE_URL = "ThumbnailImageUrl"; + @SerializedName(SERIALIZED_NAME_THUMBNAIL_IMAGE_URL) + @javax.annotation.Nullable + private String thumbnailImageUrl; + + public static final String SERIALIZED_NAME_FAVICON = "Favicon"; + @SerializedName(SERIALIZED_NAME_FAVICON) + @javax.annotation.Nullable + private String favicon; + + public static final String SERIALIZED_NAME_PROFILE_URL = "ProfileUrl"; + @SerializedName(SERIALIZED_NAME_PROFILE_URL) + @javax.annotation.Nullable + private String profileUrl; + + public static final String SERIALIZED_NAME_HOME_TOWN = "HomeTown"; + @SerializedName(SERIALIZED_NAME_HOME_TOWN) + @javax.annotation.Nullable + private String homeTown; + + public static final String SERIALIZED_NAME_STATE = "State"; + @SerializedName(SERIALIZED_NAME_STATE) + @javax.annotation.Nullable + private String state; + + public static final String SERIALIZED_NAME_CITY = "City"; + @SerializedName(SERIALIZED_NAME_CITY) + @javax.annotation.Nullable + private String city; + + public static final String SERIALIZED_NAME_INDUSTRY = "Industry"; + @SerializedName(SERIALIZED_NAME_INDUSTRY) + @javax.annotation.Nullable + private String industry; + + public static final String SERIALIZED_NAME_LOCAL_LANGUAGE = "LocalLanguage"; + @SerializedName(SERIALIZED_NAME_LOCAL_LANGUAGE) + @javax.annotation.Nullable + private String localLanguage; + + public static final String SERIALIZED_NAME_LANGUAGE = "Language"; + @SerializedName(SERIALIZED_NAME_LANGUAGE) + @javax.annotation.Nullable + private String language; + + public static final String SERIALIZED_NAME_COVER_PHOTO = "CoverPhoto"; + @SerializedName(SERIALIZED_NAME_COVER_PHOTO) + @javax.annotation.Nullable + private String coverPhoto; + + public static final String SERIALIZED_NAME_TAG_LINE = "TagLine"; + @SerializedName(SERIALIZED_NAME_TAG_LINE) + @javax.annotation.Nullable + private String tagLine; + + public static final String SERIALIZED_NAME_MAIN_ADDRESS = "MainAddress"; + @SerializedName(SERIALIZED_NAME_MAIN_ADDRESS) + @javax.annotation.Nullable + private String mainAddress; + + public static final String SERIALIZED_NAME_LOCAL_CITY = "LocalCity"; + @SerializedName(SERIALIZED_NAME_LOCAL_CITY) + @javax.annotation.Nullable + private String localCity; + + public static final String SERIALIZED_NAME_PROFILE_CITY = "ProfileCity"; + @SerializedName(SERIALIZED_NAME_PROFILE_CITY) + @javax.annotation.Nullable + private String profileCity; + + public static final String SERIALIZED_NAME_LOCAL_COUNTRY = "LocalCountry"; + @SerializedName(SERIALIZED_NAME_LOCAL_COUNTRY) + @javax.annotation.Nullable + private String localCountry; + + public static final String SERIALIZED_NAME_PROFILE_COUNTRY = "ProfileCountry"; + @SerializedName(SERIALIZED_NAME_PROFILE_COUNTRY) + @javax.annotation.Nullable + private String profileCountry; + + public static final String SERIALIZED_NAME_QUOTA = "Quota"; + @SerializedName(SERIALIZED_NAME_QUOTA) + @javax.annotation.Nullable + private String quota; + + public static final String SERIALIZED_NAME_RELIGION = "Religion"; + @SerializedName(SERIALIZED_NAME_RELIGION) + @javax.annotation.Nullable + private String religion; + + public static final String SERIALIZED_NAME_POLITICAL = "Political"; + @SerializedName(SERIALIZED_NAME_POLITICAL) + @javax.annotation.Nullable + private String political; + + public static final String SERIALIZED_NAME_RELATIONSHIP_STATUS = "RelationshipStatus"; + @SerializedName(SERIALIZED_NAME_RELATIONSHIP_STATUS) + @javax.annotation.Nullable + private String relationshipStatus; + + public static final String SERIALIZED_NAME_HTTPS_IMAGE_URL = "HttpsImageUrl"; + @SerializedName(SERIALIZED_NAME_HTTPS_IMAGE_URL) + @javax.annotation.Nullable + private String httpsImageUrl; + + public static final String SERIALIZED_NAME_IS_GEO_ENABLED = "IsGeoEnabled"; + @SerializedName(SERIALIZED_NAME_IS_GEO_ENABLED) + @javax.annotation.Nullable + private String isGeoEnabled; + + public static final String SERIALIZED_NAME_ASSOCIATIONS = "Associations"; + @SerializedName(SERIALIZED_NAME_ASSOCIATIONS) + @javax.annotation.Nullable + private String associations; + + public static final String SERIALIZED_NAME_HONORS = "Honors"; + @SerializedName(SERIALIZED_NAME_HONORS) + @javax.annotation.Nullable + private String honors; + + public static final String SERIALIZED_NAME_PUBLIC_REPOSITORY = "PublicRepository"; + @SerializedName(SERIALIZED_NAME_PUBLIC_REPOSITORY) + @javax.annotation.Nullable + private String publicRepository; + + public static final String SERIALIZED_NAME_REPOSITORY_URL = "RepositoryUrl"; + @SerializedName(SERIALIZED_NAME_REPOSITORY_URL) + @javax.annotation.Nullable + private String repositoryUrl; + + public static final String SERIALIZED_NAME_PROFESSIONAL_HEADLINE = "ProfessionalHeadline"; + @SerializedName(SERIALIZED_NAME_PROFESSIONAL_HEADLINE) + @javax.annotation.Nullable + private String professionalHeadline; + + public static final String SERIALIZED_NAME_CURRENCY = "Currency"; + @SerializedName(SERIALIZED_NAME_CURRENCY) + @javax.annotation.Nullable + private String currency; + + public static final String SERIALIZED_NAME_STARRED_URL = "StarredUrl"; + @SerializedName(SERIALIZED_NAME_STARRED_URL) + @javax.annotation.Nullable + private String starredUrl; + + public static final String SERIALIZED_NAME_GISTS_URL = "GistsUrl"; + @SerializedName(SERIALIZED_NAME_GISTS_URL) + @javax.annotation.Nullable + private String gistsUrl; + + public static final String SERIALIZED_NAME_GRAVATAR_IMAGE_URL = "GravatarImageUrl"; + @SerializedName(SERIALIZED_NAME_GRAVATAR_IMAGE_URL) + @javax.annotation.Nullable + private String gravatarImageUrl; + + public static final String SERIALIZED_NAME_EXTERNAL_USER_LOGIN_ID = "ExternalUserLoginId"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_USER_LOGIN_ID) + @javax.annotation.Nullable + private String externalUserLoginId; + + public static final String SERIALIZED_NAME_INTERESTED_IN = "InterestedIn"; + @SerializedName(SERIALIZED_NAME_INTERESTED_IN) + @javax.annotation.Nullable + private List<String> interestedIn = new ArrayList<>(); + + public static final String SERIALIZED_NAME_FOLLOWERS_COUNT = "FollowersCount"; + @SerializedName(SERIALIZED_NAME_FOLLOWERS_COUNT) + @javax.annotation.Nullable + private Integer followersCount; + + public static final String SERIALIZED_NAME_FRIENDS_COUNT = "FriendsCount"; + @SerializedName(SERIALIZED_NAME_FRIENDS_COUNT) + @javax.annotation.Nullable + private Integer friendsCount; + + public static final String SERIALIZED_NAME_TOTAL_STATUSES_COUNT = "TotalStatusesCount"; + @SerializedName(SERIALIZED_NAME_TOTAL_STATUSES_COUNT) + @javax.annotation.Nullable + private Integer totalStatusesCount; + + public static final String SERIALIZED_NAME_NUM_RECOMMENDERS = "NumRecommenders"; + @SerializedName(SERIALIZED_NAME_NUM_RECOMMENDERS) + @javax.annotation.Nullable + private Integer numRecommenders; + + public static final String SERIALIZED_NAME_TOTAL_PRIVATE_REPOSITORY = "TotalPrivateRepository"; + @SerializedName(SERIALIZED_NAME_TOTAL_PRIVATE_REPOSITORY) + @javax.annotation.Nullable + private Integer totalPrivateRepository; + + public static final String SERIALIZED_NAME_PUBLIC_GISTS = "PublicGists"; + @SerializedName(SERIALIZED_NAME_PUBLIC_GISTS) + @javax.annotation.Nullable + private Integer publicGists; + + public static final String SERIALIZED_NAME_PRIVATE_GISTS = "PrivateGists"; + @SerializedName(SERIALIZED_NAME_PRIVATE_GISTS) + @javax.annotation.Nullable + private Integer privateGists; + + public static final String SERIALIZED_NAME_SESSION_LIMIT = "SessionLimit"; + @SerializedName(SERIALIZED_NAME_SESSION_LIMIT) + @javax.annotation.Nullable + private Integer sessionLimit; + + public static final String SERIALIZED_NAME_CUSTOM_FIELDS = "CustomFields"; + @SerializedName(SERIALIZED_NAME_CUSTOM_FIELDS) + @javax.annotation.Nullable + private Map<String, String> customFields = new HashMap<>(); + + public static final String SERIALIZED_NAME_PROFILE_IMAGE_URLS = "ProfileImageUrls"; + @SerializedName(SERIALIZED_NAME_PROFILE_IMAGE_URLS) + @javax.annotation.Nullable + private Map<String, String> profileImageUrls = new HashMap<>(); + + public static final String SERIALIZED_NAME_WEB_PROFILES = "WebProfiles"; + @SerializedName(SERIALIZED_NAME_WEB_PROFILES) + @javax.annotation.Nullable + private Map<String, String> webProfiles = new HashMap<>(); + + public static final String SERIALIZED_NAME_SECURITY_QUESTION_ANSWER = "SecurityQuestionAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_QUESTION_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityQuestionAnswer = new HashMap<>(); + + public static final String SERIALIZED_NAME_COUNTRY = "Country"; + @SerializedName(SERIALIZED_NAME_COUNTRY) + @javax.annotation.Nullable + private ProfileRequestModelCountry country; + + public static final String SERIALIZED_NAME_PROVIDER_ACCESS_CREDENTIAL = "ProviderAccessCredential"; + @SerializedName(SERIALIZED_NAME_PROVIDER_ACCESS_CREDENTIAL) + @javax.annotation.Nullable + private ProfileRequestModelProviderAccessCredential providerAccessCredential; + + public static final String SERIALIZED_NAME_SUGGESTIONS = "Suggestions"; + @SerializedName(SERIALIZED_NAME_SUGGESTIONS) + @javax.annotation.Nullable + private ProfileRequestModelSuggestions suggestions; + + public static final String SERIALIZED_NAME_SUBSCRIPTION = "Subscription"; + @SerializedName(SERIALIZED_NAME_SUBSCRIPTION) + @javax.annotation.Nullable + private ProfileRequestModelSubscription subscription; + + public static final String SERIALIZED_NAME_PRIVACY_POLICY = "PrivacyPolicy"; + @SerializedName(SERIALIZED_NAME_PRIVACY_POLICY) + @javax.annotation.Nullable + private ProfileRequestModelPrivacyPolicy privacyPolicy; + + public static final String SERIALIZED_NAME_PI_N_INFO = "PINInfo"; + @SerializedName(SERIALIZED_NAME_PI_N_INFO) + @javax.annotation.Nullable + private ProfileRequestModelPINInfo piNInfo; + + public static final String SERIALIZED_NAME_ADDRESSES = "Addresses"; + @SerializedName(SERIALIZED_NAME_ADDRESSES) + @javax.annotation.Nullable + private List<ProfileRequestModelAddressesInner> addresses = new ArrayList<>(); + + public static final String SERIALIZED_NAME_POSITIONS = "Positions"; + @SerializedName(SERIALIZED_NAME_POSITIONS) + @javax.annotation.Nullable + private List<ProfileRequestModelPositionsInner> positions = new ArrayList<>(); + + public static final String SERIALIZED_NAME_EDUCATIONS = "Educations"; + @SerializedName(SERIALIZED_NAME_EDUCATIONS) + @javax.annotation.Nullable + private List<ProfileRequestModelEducationsInner> educations = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PHONE_NUMBERS = "PhoneNumbers"; + @SerializedName(SERIALIZED_NAME_PHONE_NUMBERS) + @javax.annotation.Nullable + private List<ProfileRequestModelPhoneNumbersInner> phoneNumbers = new ArrayList<>(); + + public static final String SERIALIZED_NAME_IM_ACCOUNTS = "IMAccounts"; + @SerializedName(SERIALIZED_NAME_IM_ACCOUNTS) + @javax.annotation.Nullable + private List<ProfileRequestModelIMAccountsInner> imAccounts = new ArrayList<>(); + + public static final String SERIALIZED_NAME_INTERESTS = "Interests"; + @SerializedName(SERIALIZED_NAME_INTERESTS) + @javax.annotation.Nullable + private List<ProfileRequestModelInterestsInner> interests = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SPORTS = "Sports"; + @SerializedName(SERIALIZED_NAME_SPORTS) + @javax.annotation.Nullable + private List<ProfileRequestModelSportsInner> sports = new ArrayList<>(); + + public static final String SERIALIZED_NAME_INSPIRATIONAL_PEOPLE = "InspirationalPeople"; + @SerializedName(SERIALIZED_NAME_INSPIRATIONAL_PEOPLE) + @javax.annotation.Nullable + private List<ProfileRequestModelInspirationalPeopleInner> inspirationalPeople = new ArrayList<>(); + + public static final String SERIALIZED_NAME_AWARDS = "Awards"; + @SerializedName(SERIALIZED_NAME_AWARDS) + @javax.annotation.Nullable + private List<ProfileRequestModelAwardsInner> awards = new ArrayList<>(); + + public static final String SERIALIZED_NAME_SKILLS = "Skills"; + @SerializedName(SERIALIZED_NAME_SKILLS) + @javax.annotation.Nullable + private List<ProfileRequestModelSkillsInner> skills = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CURRENT_STATUS = "CurrentStatus"; + @SerializedName(SERIALIZED_NAME_CURRENT_STATUS) + @javax.annotation.Nullable + private List<ProfileRequestModelCurrentStatusInner> currentStatus = new ArrayList<>(); + + public static final String SERIALIZED_NAME_CERTIFICATIONS = "Certifications"; + @SerializedName(SERIALIZED_NAME_CERTIFICATIONS) + @javax.annotation.Nullable + private List<ProfileRequestModelCertificationsInner> certifications = new ArrayList<>(); + + public static final String SERIALIZED_NAME_COURSES = "Courses"; + @SerializedName(SERIALIZED_NAME_COURSES) + @javax.annotation.Nullable + private List<ProfileRequestModelCoursesInner> courses = new ArrayList<>(); + + public static final String SERIALIZED_NAME_VOLUNTEER = "Volunteer"; + @SerializedName(SERIALIZED_NAME_VOLUNTEER) + @javax.annotation.Nullable + private List<ProfileRequestModelVolunteerInner> volunteer = new ArrayList<>(); + + public static final String SERIALIZED_NAME_RECOMMENDATIONS_RECEIVED = "RecommendationsReceived"; + @SerializedName(SERIALIZED_NAME_RECOMMENDATIONS_RECEIVED) + @javax.annotation.Nullable + private List<ProfileRequestModelRecommendationsReceivedInner> recommendationsReceived = new ArrayList<>(); + + public static final String SERIALIZED_NAME_LANGUAGES = "Languages"; + @SerializedName(SERIALIZED_NAME_LANGUAGES) + @javax.annotation.Nullable + private List<ProfileRequestModelLanguagesInner> languages = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PROJECTS = "Projects"; + @SerializedName(SERIALIZED_NAME_PROJECTS) + @javax.annotation.Nullable + private List<ProfileRequestModelProjectsInner> projects = new ArrayList<>(); + + public static final String SERIALIZED_NAME_GAMES = "Games"; + @SerializedName(SERIALIZED_NAME_GAMES) + @javax.annotation.Nullable + private List<ProfileRequestModelGamesInner> games = new ArrayList<>(); + + public static final String SERIALIZED_NAME_FAMILY = "Family"; + @SerializedName(SERIALIZED_NAME_FAMILY) + @javax.annotation.Nullable + private List<ProfileRequestModelFamilyInner> family = new ArrayList<>(); + + public static final String SERIALIZED_NAME_TELE_VISION_SHOW = "TeleVisionShow"; + @SerializedName(SERIALIZED_NAME_TELE_VISION_SHOW) + @javax.annotation.Nullable + private List<ProfileRequestModelTeleVisionShowInner> teleVisionShow = new ArrayList<>(); + + public static final String SERIALIZED_NAME_MUTUAL_FRIENDS = "MutualFriends"; + @SerializedName(SERIALIZED_NAME_MUTUAL_FRIENDS) + @javax.annotation.Nullable + private List<ProfileRequestModelMutualFriendsInner> mutualFriends = new ArrayList<>(); + + public static final String SERIALIZED_NAME_MOVIES = "Movies"; + @SerializedName(SERIALIZED_NAME_MOVIES) + @javax.annotation.Nullable + private List<ProfileRequestModelMoviesInner> movies = new ArrayList<>(); + + public static final String SERIALIZED_NAME_BOOKS = "Books"; + @SerializedName(SERIALIZED_NAME_BOOKS) + @javax.annotation.Nullable + private List<ProfileRequestModelBooksInner> books = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PATENTS = "Patents"; + @SerializedName(SERIALIZED_NAME_PATENTS) + @javax.annotation.Nullable + private List<ProfileRequestModelPatentsInner> patents = new ArrayList<>(); + + public static final String SERIALIZED_NAME_FAVORITE_THINGS = "FavoriteThings"; + @SerializedName(SERIALIZED_NAME_FAVORITE_THINGS) + @javax.annotation.Nullable + private List<ProfileRequestModelFavoriteThingsInner> favoriteThings = new ArrayList<>(); + + public static final String SERIALIZED_NAME_RELATED_PROFILE_VIEWS = "RelatedProfileViews"; + @SerializedName(SERIALIZED_NAME_RELATED_PROFILE_VIEWS) + @javax.annotation.Nullable + private List<ProfileRequestModelRelatedProfileViewsInner> relatedProfileViews = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PLACES_LIVED = "PlacesLived"; + @SerializedName(SERIALIZED_NAME_PLACES_LIVED) + @javax.annotation.Nullable + private List<ProfileRequestModelPlacesLivedInner> placesLived = new ArrayList<>(); + + public static final String SERIALIZED_NAME_PUBLICATIONS = "Publications"; + @SerializedName(SERIALIZED_NAME_PUBLICATIONS) + @javax.annotation.Nullable + private List<ProfileRequestModelPublicationsInner> publications = new ArrayList<>(); + + public static final String SERIALIZED_NAME_JOB_BOOKMARKS = "JobBookmarks"; + @SerializedName(SERIALIZED_NAME_JOB_BOOKMARKS) + @javax.annotation.Nullable + private List<ProfileRequestModelJobBookmarksInner> jobBookmarks = new ArrayList<>(); + + public static final String SERIALIZED_NAME_BADGES = "Badges"; + @SerializedName(SERIALIZED_NAME_BADGES) + @javax.annotation.Nullable + private List<ProfileRequestModelBadgesInner> badges = new ArrayList<>(); + + public static final String SERIALIZED_NAME_MEMBER_URL_RESOURCES = "MemberUrlResources"; + @SerializedName(SERIALIZED_NAME_MEMBER_URL_RESOURCES) + @javax.annotation.Nullable + private List<ProfileRequestModelMemberUrlResourcesInner> memberUrlResources = new ArrayList<>(); + + public static final String SERIALIZED_NAME_EXTERNAL_IDS = "ExternalIds"; + @SerializedName(SERIALIZED_NAME_EXTERNAL_IDS) + @javax.annotation.Nullable + private List<ProfileRequestModelExternalIdsInner> externalIds = new ArrayList<>(); + + public static final String SERIALIZED_NAME_IS_EMAIL_SUBSCRIBED = "IsEmailSubscribed"; + @SerializedName(SERIALIZED_NAME_IS_EMAIL_SUBSCRIBED) + @javax.annotation.Nullable + private Boolean isEmailSubscribed; + + public static final String SERIALIZED_NAME_IS_PROTECTED = "IsProtected"; + @SerializedName(SERIALIZED_NAME_IS_PROTECTED) + @javax.annotation.Nullable + private Boolean isProtected; + + public static final String SERIALIZED_NAME_HIREABLE = "Hireable"; + @SerializedName(SERIALIZED_NAME_HIREABLE) + @javax.annotation.Nullable + private Boolean hireable; + + public static final String SERIALIZED_NAME_IS_TWO_FACTOR_AUTHENTICATION_ENABLED = "IsTwoFactorAuthenticationEnabled"; + @SerializedName(SERIALIZED_NAME_IS_TWO_FACTOR_AUTHENTICATION_ENABLED) + @javax.annotation.Nullable + private Boolean isTwoFactorAuthenticationEnabled; + + public static final String SERIALIZED_NAME_DISABLE_LOGIN = "DisableLogin"; + @SerializedName(SERIALIZED_NAME_DISABLE_LOGIN) + @javax.annotation.Nullable + private Boolean disableLogin; + + public static final String SERIALIZED_NAME_ACCEPT_PRIVACY_POLICY = "AcceptPrivacyPolicy"; + @SerializedName(SERIALIZED_NAME_ACCEPT_PRIVACY_POLICY) + @javax.annotation.Nullable + private Boolean acceptPrivacyPolicy; + + public static final String SERIALIZED_NAME_RECAPTCHA_RESPONSE_FIELD = "recaptcha_response_field"; + @SerializedName(SERIALIZED_NAME_RECAPTCHA_RESPONSE_FIELD) + @javax.annotation.Nullable + private String recaptchaResponseField; + + public static final String SERIALIZED_NAME_RECAPTCHA_CHALLENGE_FIELD = "recaptcha_challenge_field"; + @SerializedName(SERIALIZED_NAME_RECAPTCHA_CHALLENGE_FIELD) + @javax.annotation.Nullable + private String recaptchaChallengeField; + + public static final String SERIALIZED_NAME_CAPTCHA_MODEL = "CaptchaModel"; + @SerializedName(SERIALIZED_NAME_CAPTCHA_MODEL) + @javax.annotation.Nullable + private ProfileRequestModelCaptchaModel captchaModel; + + public static final String SERIALIZED_NAME_REGISTRATION_SOURCE = "RegistrationSource"; + @SerializedName(SERIALIZED_NAME_REGISTRATION_SOURCE) + @javax.annotation.Nullable + private String registrationSource; + + 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_CONSENTS = "Consents"; + @SerializedName(SERIALIZED_NAME_CONSENTS) + @javax.annotation.Nullable + private ProfileRequestModelConsents consents; + + public static final String SERIALIZED_NAME_PASSWORD = "Password"; + @SerializedName(SERIALIZED_NAME_PASSWORD) + @javax.annotation.Nullable + private String password; + + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private List<ProfileRequestModelEmailInner> email = new ArrayList<>(); + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest() { + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest gRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + return this; + } + + /** + * The Google reCAPTCHA response which is sent to the server for verification. + * @return gRecaptchaResponse + */ + @javax.annotation.Nullable + public String getgRecaptchaResponse() { + return gRecaptchaResponse; + } + + public void setgRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest qqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + return this; + } + + /** + * The QQ Captcha ticket which is sent to the server for verification. + * @return qqCaptchaTicket + */ + @javax.annotation.Nullable + public String getQqCaptchaTicket() { + return qqCaptchaTicket; + } + + public void setQqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest qqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + return this; + } + + /** + * The QQ Captcha random string which is sent to the server for verification. + * @return qqCaptchaRandstr + */ + @javax.annotation.Nullable + public String getQqCaptchaRandstr() { + return qqCaptchaRandstr; + } + + public void setQqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest hCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + return this; + } + + /** + * The hCaptcha response which is sent to the server for verification. + * @return hCaptchaResponse + */ + @javax.annotation.Nullable + public String gethCaptchaResponse() { + return hCaptchaResponse; + } + + public void sethCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest userName(@javax.annotation.Nullable String userName) { + this.userName = userName; + return this; + } + + /** + * Get userName + * @return userName + */ + @javax.annotation.Nullable + public String getUserName() { + return userName; + } + + public void setUserName(@javax.annotation.Nullable String userName) { + this.userName = userName; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest phoneId(@javax.annotation.Nullable String phoneId) { + this.phoneId = phoneId; + return this; + } + + /** + * Get phoneId + * @return phoneId + */ + @javax.annotation.Nullable + public String getPhoneId() { + return phoneId; + } + + public void setPhoneId(@javax.annotation.Nullable String phoneId) { + this.phoneId = phoneId; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest gender(@javax.annotation.Nullable String gender) { + this.gender = gender; + return this; + } + + /** + * Get gender + * @return gender + */ + @javax.annotation.Nullable + public String getGender() { + return gender; + } + + public void setGender(@javax.annotation.Nullable String gender) { + this.gender = gender; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest birthDate(@javax.annotation.Nullable String birthDate) { + this.birthDate = birthDate; + return this; + } + + /** + * Get birthDate + * @return birthDate + */ + @javax.annotation.Nullable + public String getBirthDate() { + return birthDate; + } + + public void setBirthDate(@javax.annotation.Nullable String birthDate) { + this.birthDate = birthDate; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest prefix(@javax.annotation.Nullable String prefix) { + this.prefix = prefix; + return this; + } + + /** + * Get prefix + * @return prefix + */ + @javax.annotation.Nullable + public String getPrefix() { + return prefix; + } + + public void setPrefix(@javax.annotation.Nullable String prefix) { + this.prefix = prefix; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest firstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + return this; + } + + /** + * Get firstName + * @return firstName + */ + @javax.annotation.Nullable + public String getFirstName() { + return firstName; + } + + public void setFirstName(@javax.annotation.Nullable String firstName) { + this.firstName = firstName; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest middleName(@javax.annotation.Nullable String middleName) { + this.middleName = middleName; + return this; + } + + /** + * Get middleName + * @return middleName + */ + @javax.annotation.Nullable + public String getMiddleName() { + return middleName; + } + + public void setMiddleName(@javax.annotation.Nullable String middleName) { + this.middleName = middleName; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest lastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + return this; + } + + /** + * Get lastName + * @return lastName + */ + @javax.annotation.Nullable + public String getLastName() { + return lastName; + } + + public void setLastName(@javax.annotation.Nullable String lastName) { + this.lastName = lastName; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest suffix(@javax.annotation.Nullable String suffix) { + this.suffix = suffix; + return this; + } + + /** + * Get suffix + * @return suffix + */ + @javax.annotation.Nullable + public String getSuffix() { + return suffix; + } + + public void setSuffix(@javax.annotation.Nullable String suffix) { + this.suffix = suffix; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest nickName(@javax.annotation.Nullable String nickName) { + this.nickName = nickName; + return this; + } + + /** + * Get nickName + * @return nickName + */ + @javax.annotation.Nullable + public String getNickName() { + return nickName; + } + + public void setNickName(@javax.annotation.Nullable String nickName) { + this.nickName = nickName; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest profileName(@javax.annotation.Nullable String profileName) { + this.profileName = profileName; + return this; + } + + /** + * Get profileName + * @return profileName + */ + @javax.annotation.Nullable + public String getProfileName() { + return profileName; + } + + public void setProfileName(@javax.annotation.Nullable String profileName) { + this.profileName = profileName; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest about(@javax.annotation.Nullable String about) { + this.about = about; + return this; + } + + /** + * Get about + * @return about + */ + @javax.annotation.Nullable + public String getAbout() { + return about; + } + + public void setAbout(@javax.annotation.Nullable String about) { + this.about = about; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest company(@javax.annotation.Nullable String company) { + this.company = company; + return this; + } + + /** + * Get company + * @return company + */ + @javax.annotation.Nullable + public String getCompany() { + return company; + } + + public void setCompany(@javax.annotation.Nullable String company) { + this.company = company; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest imageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** + * Get imageUrl + * @return imageUrl + */ + @javax.annotation.Nullable + public String getImageUrl() { + return imageUrl; + } + + public void setImageUrl(@javax.annotation.Nullable String imageUrl) { + this.imageUrl = imageUrl; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest timeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + return this; + } + + /** + * Get timeZone + * @return timeZone + */ + @javax.annotation.Nullable + public String getTimeZone() { + return timeZone; + } + + public void setTimeZone(@javax.annotation.Nullable String timeZone) { + this.timeZone = timeZone; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest website(@javax.annotation.Nullable String website) { + this.website = website; + return this; + } + + /** + * Get website + * @return website + */ + @javax.annotation.Nullable + public String getWebsite() { + return website; + } + + public void setWebsite(@javax.annotation.Nullable String website) { + this.website = website; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest thumbnailImageUrl(@javax.annotation.Nullable String thumbnailImageUrl) { + this.thumbnailImageUrl = thumbnailImageUrl; + return this; + } + + /** + * Get thumbnailImageUrl + * @return thumbnailImageUrl + */ + @javax.annotation.Nullable + public String getThumbnailImageUrl() { + return thumbnailImageUrl; + } + + public void setThumbnailImageUrl(@javax.annotation.Nullable String thumbnailImageUrl) { + this.thumbnailImageUrl = thumbnailImageUrl; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest favicon(@javax.annotation.Nullable String favicon) { + this.favicon = favicon; + return this; + } + + /** + * Get favicon + * @return favicon + */ + @javax.annotation.Nullable + public String getFavicon() { + return favicon; + } + + public void setFavicon(@javax.annotation.Nullable String favicon) { + this.favicon = favicon; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest profileUrl(@javax.annotation.Nullable String profileUrl) { + this.profileUrl = profileUrl; + return this; + } + + /** + * Get profileUrl + * @return profileUrl + */ + @javax.annotation.Nullable + public String getProfileUrl() { + return profileUrl; + } + + public void setProfileUrl(@javax.annotation.Nullable String profileUrl) { + this.profileUrl = profileUrl; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest homeTown(@javax.annotation.Nullable String homeTown) { + this.homeTown = homeTown; + return this; + } + + /** + * Get homeTown + * @return homeTown + */ + @javax.annotation.Nullable + public String getHomeTown() { + return homeTown; + } + + public void setHomeTown(@javax.annotation.Nullable String homeTown) { + this.homeTown = homeTown; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest state(@javax.annotation.Nullable String state) { + this.state = state; + return this; + } + + /** + * Get state + * @return state + */ + @javax.annotation.Nullable + public String getState() { + return state; + } + + public void setState(@javax.annotation.Nullable String state) { + this.state = state; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest city(@javax.annotation.Nullable String city) { + this.city = city; + return this; + } + + /** + * Get city + * @return city + */ + @javax.annotation.Nullable + public String getCity() { + return city; + } + + public void setCity(@javax.annotation.Nullable String city) { + this.city = city; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest industry(@javax.annotation.Nullable String industry) { + this.industry = industry; + return this; + } + + /** + * Get industry + * @return industry + */ + @javax.annotation.Nullable + public String getIndustry() { + return industry; + } + + public void setIndustry(@javax.annotation.Nullable String industry) { + this.industry = industry; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest localLanguage(@javax.annotation.Nullable String localLanguage) { + this.localLanguage = localLanguage; + return this; + } + + /** + * Get localLanguage + * @return localLanguage + */ + @javax.annotation.Nullable + public String getLocalLanguage() { + return localLanguage; + } + + public void setLocalLanguage(@javax.annotation.Nullable String localLanguage) { + this.localLanguage = localLanguage; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest language(@javax.annotation.Nullable String language) { + this.language = language; + return this; + } + + /** + * Get language + * @return language + */ + @javax.annotation.Nullable + public String getLanguage() { + return language; + } + + public void setLanguage(@javax.annotation.Nullable String language) { + this.language = language; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest coverPhoto(@javax.annotation.Nullable String coverPhoto) { + this.coverPhoto = coverPhoto; + return this; + } + + /** + * Get coverPhoto + * @return coverPhoto + */ + @javax.annotation.Nullable + public String getCoverPhoto() { + return coverPhoto; + } + + public void setCoverPhoto(@javax.annotation.Nullable String coverPhoto) { + this.coverPhoto = coverPhoto; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest tagLine(@javax.annotation.Nullable String tagLine) { + this.tagLine = tagLine; + return this; + } + + /** + * Get tagLine + * @return tagLine + */ + @javax.annotation.Nullable + public String getTagLine() { + return tagLine; + } + + public void setTagLine(@javax.annotation.Nullable String tagLine) { + this.tagLine = tagLine; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest mainAddress(@javax.annotation.Nullable String mainAddress) { + this.mainAddress = mainAddress; + return this; + } + + /** + * Get mainAddress + * @return mainAddress + */ + @javax.annotation.Nullable + public String getMainAddress() { + return mainAddress; + } + + public void setMainAddress(@javax.annotation.Nullable String mainAddress) { + this.mainAddress = mainAddress; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest localCity(@javax.annotation.Nullable String localCity) { + this.localCity = localCity; + return this; + } + + /** + * Get localCity + * @return localCity + */ + @javax.annotation.Nullable + public String getLocalCity() { + return localCity; + } + + public void setLocalCity(@javax.annotation.Nullable String localCity) { + this.localCity = localCity; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest profileCity(@javax.annotation.Nullable String profileCity) { + this.profileCity = profileCity; + return this; + } + + /** + * Get profileCity + * @return profileCity + */ + @javax.annotation.Nullable + public String getProfileCity() { + return profileCity; + } + + public void setProfileCity(@javax.annotation.Nullable String profileCity) { + this.profileCity = profileCity; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest localCountry(@javax.annotation.Nullable String localCountry) { + this.localCountry = localCountry; + return this; + } + + /** + * Get localCountry + * @return localCountry + */ + @javax.annotation.Nullable + public String getLocalCountry() { + return localCountry; + } + + public void setLocalCountry(@javax.annotation.Nullable String localCountry) { + this.localCountry = localCountry; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest profileCountry(@javax.annotation.Nullable String profileCountry) { + this.profileCountry = profileCountry; + return this; + } + + /** + * Get profileCountry + * @return profileCountry + */ + @javax.annotation.Nullable + public String getProfileCountry() { + return profileCountry; + } + + public void setProfileCountry(@javax.annotation.Nullable String profileCountry) { + this.profileCountry = profileCountry; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest quota(@javax.annotation.Nullable String quota) { + this.quota = quota; + return this; + } + + /** + * Get quota + * @return quota + */ + @javax.annotation.Nullable + public String getQuota() { + return quota; + } + + public void setQuota(@javax.annotation.Nullable String quota) { + this.quota = quota; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest religion(@javax.annotation.Nullable String religion) { + this.religion = religion; + return this; + } + + /** + * Get religion + * @return religion + */ + @javax.annotation.Nullable + public String getReligion() { + return religion; + } + + public void setReligion(@javax.annotation.Nullable String religion) { + this.religion = religion; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest political(@javax.annotation.Nullable String political) { + this.political = political; + return this; + } + + /** + * Get political + * @return political + */ + @javax.annotation.Nullable + public String getPolitical() { + return political; + } + + public void setPolitical(@javax.annotation.Nullable String political) { + this.political = political; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest relationshipStatus(@javax.annotation.Nullable String relationshipStatus) { + this.relationshipStatus = relationshipStatus; + return this; + } + + /** + * Get relationshipStatus + * @return relationshipStatus + */ + @javax.annotation.Nullable + public String getRelationshipStatus() { + return relationshipStatus; + } + + public void setRelationshipStatus(@javax.annotation.Nullable String relationshipStatus) { + this.relationshipStatus = relationshipStatus; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest httpsImageUrl(@javax.annotation.Nullable String httpsImageUrl) { + this.httpsImageUrl = httpsImageUrl; + return this; + } + + /** + * Get httpsImageUrl + * @return httpsImageUrl + */ + @javax.annotation.Nullable + public String getHttpsImageUrl() { + return httpsImageUrl; + } + + public void setHttpsImageUrl(@javax.annotation.Nullable String httpsImageUrl) { + this.httpsImageUrl = httpsImageUrl; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest isGeoEnabled(@javax.annotation.Nullable String isGeoEnabled) { + this.isGeoEnabled = isGeoEnabled; + return this; + } + + /** + * Get isGeoEnabled + * @return isGeoEnabled + */ + @javax.annotation.Nullable + public String getIsGeoEnabled() { + return isGeoEnabled; + } + + public void setIsGeoEnabled(@javax.annotation.Nullable String isGeoEnabled) { + this.isGeoEnabled = isGeoEnabled; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest associations(@javax.annotation.Nullable String associations) { + this.associations = associations; + return this; + } + + /** + * Get associations + * @return associations + */ + @javax.annotation.Nullable + public String getAssociations() { + return associations; + } + + public void setAssociations(@javax.annotation.Nullable String associations) { + this.associations = associations; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest honors(@javax.annotation.Nullable String honors) { + this.honors = honors; + return this; + } + + /** + * Get honors + * @return honors + */ + @javax.annotation.Nullable + public String getHonors() { + return honors; + } + + public void setHonors(@javax.annotation.Nullable String honors) { + this.honors = honors; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest publicRepository(@javax.annotation.Nullable String publicRepository) { + this.publicRepository = publicRepository; + return this; + } + + /** + * Get publicRepository + * @return publicRepository + */ + @javax.annotation.Nullable + public String getPublicRepository() { + return publicRepository; + } + + public void setPublicRepository(@javax.annotation.Nullable String publicRepository) { + this.publicRepository = publicRepository; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest repositoryUrl(@javax.annotation.Nullable String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + return this; + } + + /** + * Get repositoryUrl + * @return repositoryUrl + */ + @javax.annotation.Nullable + public String getRepositoryUrl() { + return repositoryUrl; + } + + public void setRepositoryUrl(@javax.annotation.Nullable String repositoryUrl) { + this.repositoryUrl = repositoryUrl; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest professionalHeadline(@javax.annotation.Nullable String professionalHeadline) { + this.professionalHeadline = professionalHeadline; + return this; + } + + /** + * Get professionalHeadline + * @return professionalHeadline + */ + @javax.annotation.Nullable + public String getProfessionalHeadline() { + return professionalHeadline; + } + + public void setProfessionalHeadline(@javax.annotation.Nullable String professionalHeadline) { + this.professionalHeadline = professionalHeadline; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest currency(@javax.annotation.Nullable String currency) { + this.currency = currency; + return this; + } + + /** + * Get currency + * @return currency + */ + @javax.annotation.Nullable + public String getCurrency() { + return currency; + } + + public void setCurrency(@javax.annotation.Nullable String currency) { + this.currency = currency; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest starredUrl(@javax.annotation.Nullable String starredUrl) { + this.starredUrl = starredUrl; + return this; + } + + /** + * Get starredUrl + * @return starredUrl + */ + @javax.annotation.Nullable + public String getStarredUrl() { + return starredUrl; + } + + public void setStarredUrl(@javax.annotation.Nullable String starredUrl) { + this.starredUrl = starredUrl; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest gistsUrl(@javax.annotation.Nullable String gistsUrl) { + this.gistsUrl = gistsUrl; + return this; + } + + /** + * Get gistsUrl + * @return gistsUrl + */ + @javax.annotation.Nullable + public String getGistsUrl() { + return gistsUrl; + } + + public void setGistsUrl(@javax.annotation.Nullable String gistsUrl) { + this.gistsUrl = gistsUrl; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest gravatarImageUrl(@javax.annotation.Nullable String gravatarImageUrl) { + this.gravatarImageUrl = gravatarImageUrl; + return this; + } + + /** + * Get gravatarImageUrl + * @return gravatarImageUrl + */ + @javax.annotation.Nullable + public String getGravatarImageUrl() { + return gravatarImageUrl; + } + + public void setGravatarImageUrl(@javax.annotation.Nullable String gravatarImageUrl) { + this.gravatarImageUrl = gravatarImageUrl; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest externalUserLoginId(@javax.annotation.Nullable String externalUserLoginId) { + this.externalUserLoginId = externalUserLoginId; + return this; + } + + /** + * Get externalUserLoginId + * @return externalUserLoginId + */ + @javax.annotation.Nullable + public String getExternalUserLoginId() { + return externalUserLoginId; + } + + public void setExternalUserLoginId(@javax.annotation.Nullable String externalUserLoginId) { + this.externalUserLoginId = externalUserLoginId; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest interestedIn(@javax.annotation.Nullable List<String> interestedIn) { + this.interestedIn = interestedIn; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addInterestedInItem(String interestedInItem) { + if (this.interestedIn == null) { + this.interestedIn = new ArrayList<>(); + } + this.interestedIn.add(interestedInItem); + return this; + } + + /** + * Get interestedIn + * @return interestedIn + */ + @javax.annotation.Nullable + public List<String> getInterestedIn() { + return interestedIn; + } + + public void setInterestedIn(@javax.annotation.Nullable List<String> interestedIn) { + this.interestedIn = interestedIn; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest followersCount(@javax.annotation.Nullable Integer followersCount) { + this.followersCount = followersCount; + return this; + } + + /** + * Get followersCount + * @return followersCount + */ + @javax.annotation.Nullable + public Integer getFollowersCount() { + return followersCount; + } + + public void setFollowersCount(@javax.annotation.Nullable Integer followersCount) { + this.followersCount = followersCount; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest friendsCount(@javax.annotation.Nullable Integer friendsCount) { + this.friendsCount = friendsCount; + return this; + } + + /** + * Get friendsCount + * @return friendsCount + */ + @javax.annotation.Nullable + public Integer getFriendsCount() { + return friendsCount; + } + + public void setFriendsCount(@javax.annotation.Nullable Integer friendsCount) { + this.friendsCount = friendsCount; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest totalStatusesCount(@javax.annotation.Nullable Integer totalStatusesCount) { + this.totalStatusesCount = totalStatusesCount; + return this; + } + + /** + * Get totalStatusesCount + * @return totalStatusesCount + */ + @javax.annotation.Nullable + public Integer getTotalStatusesCount() { + return totalStatusesCount; + } + + public void setTotalStatusesCount(@javax.annotation.Nullable Integer totalStatusesCount) { + this.totalStatusesCount = totalStatusesCount; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest numRecommenders(@javax.annotation.Nullable Integer numRecommenders) { + this.numRecommenders = numRecommenders; + return this; + } + + /** + * Get numRecommenders + * @return numRecommenders + */ + @javax.annotation.Nullable + public Integer getNumRecommenders() { + return numRecommenders; + } + + public void setNumRecommenders(@javax.annotation.Nullable Integer numRecommenders) { + this.numRecommenders = numRecommenders; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest totalPrivateRepository(@javax.annotation.Nullable Integer totalPrivateRepository) { + this.totalPrivateRepository = totalPrivateRepository; + return this; + } + + /** + * Get totalPrivateRepository + * @return totalPrivateRepository + */ + @javax.annotation.Nullable + public Integer getTotalPrivateRepository() { + return totalPrivateRepository; + } + + public void setTotalPrivateRepository(@javax.annotation.Nullable Integer totalPrivateRepository) { + this.totalPrivateRepository = totalPrivateRepository; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest publicGists(@javax.annotation.Nullable Integer publicGists) { + this.publicGists = publicGists; + return this; + } + + /** + * Get publicGists + * @return publicGists + */ + @javax.annotation.Nullable + public Integer getPublicGists() { + return publicGists; + } + + public void setPublicGists(@javax.annotation.Nullable Integer publicGists) { + this.publicGists = publicGists; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest privateGists(@javax.annotation.Nullable Integer privateGists) { + this.privateGists = privateGists; + return this; + } + + /** + * Get privateGists + * @return privateGists + */ + @javax.annotation.Nullable + public Integer getPrivateGists() { + return privateGists; + } + + public void setPrivateGists(@javax.annotation.Nullable Integer privateGists) { + this.privateGists = privateGists; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest sessionLimit(@javax.annotation.Nullable Integer sessionLimit) { + this.sessionLimit = sessionLimit; + return this; + } + + /** + * Get sessionLimit + * @return sessionLimit + */ + @javax.annotation.Nullable + public Integer getSessionLimit() { + return sessionLimit; + } + + public void setSessionLimit(@javax.annotation.Nullable Integer sessionLimit) { + this.sessionLimit = sessionLimit; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest customFields(@javax.annotation.Nullable Map<String, String> customFields) { + this.customFields = customFields; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest putCustomFieldsItem(String key, String customFieldsItem) { + if (this.customFields == null) { + this.customFields = new HashMap<>(); + } + this.customFields.put(key, customFieldsItem); + return this; + } + + /** + * Get customFields + * @return customFields + */ + @javax.annotation.Nullable + public Map<String, String> getCustomFields() { + return customFields; + } + + public void setCustomFields(@javax.annotation.Nullable Map<String, String> customFields) { + this.customFields = customFields; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest profileImageUrls(@javax.annotation.Nullable Map<String, String> profileImageUrls) { + this.profileImageUrls = profileImageUrls; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest putProfileImageUrlsItem(String key, String profileImageUrlsItem) { + if (this.profileImageUrls == null) { + this.profileImageUrls = new HashMap<>(); + } + this.profileImageUrls.put(key, profileImageUrlsItem); + return this; + } + + /** + * Get profileImageUrls + * @return profileImageUrls + */ + @javax.annotation.Nullable + public Map<String, String> getProfileImageUrls() { + return profileImageUrls; + } + + public void setProfileImageUrls(@javax.annotation.Nullable Map<String, String> profileImageUrls) { + this.profileImageUrls = profileImageUrls; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest webProfiles(@javax.annotation.Nullable Map<String, String> webProfiles) { + this.webProfiles = webProfiles; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest putWebProfilesItem(String key, String webProfilesItem) { + if (this.webProfiles == null) { + this.webProfiles = new HashMap<>(); + } + this.webProfiles.put(key, webProfilesItem); + return this; + } + + /** + * Get webProfiles + * @return webProfiles + */ + @javax.annotation.Nullable + public Map<String, String> getWebProfiles() { + return webProfiles; + } + + public void setWebProfiles(@javax.annotation.Nullable Map<String, String> webProfiles) { + this.webProfiles = webProfiles; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest securityQuestionAnswer(@javax.annotation.Nullable Map<String, String> securityQuestionAnswer) { + this.securityQuestionAnswer = securityQuestionAnswer; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest putSecurityQuestionAnswerItem(String key, String securityQuestionAnswerItem) { + if (this.securityQuestionAnswer == null) { + this.securityQuestionAnswer = new HashMap<>(); + } + this.securityQuestionAnswer.put(key, securityQuestionAnswerItem); + return this; + } + + /** + * Get securityQuestionAnswer + * @return securityQuestionAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityQuestionAnswer() { + return securityQuestionAnswer; + } + + public void setSecurityQuestionAnswer(@javax.annotation.Nullable Map<String, String> securityQuestionAnswer) { + this.securityQuestionAnswer = securityQuestionAnswer; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest country(@javax.annotation.Nullable ProfileRequestModelCountry country) { + this.country = country; + return this; + } + + /** + * Get country + * @return country + */ + @javax.annotation.Nullable + public ProfileRequestModelCountry getCountry() { + return country; + } + + public void setCountry(@javax.annotation.Nullable ProfileRequestModelCountry country) { + this.country = country; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest providerAccessCredential(@javax.annotation.Nullable ProfileRequestModelProviderAccessCredential providerAccessCredential) { + this.providerAccessCredential = providerAccessCredential; + return this; + } + + /** + * Get providerAccessCredential + * @return providerAccessCredential + */ + @javax.annotation.Nullable + public ProfileRequestModelProviderAccessCredential getProviderAccessCredential() { + return providerAccessCredential; + } + + public void setProviderAccessCredential(@javax.annotation.Nullable ProfileRequestModelProviderAccessCredential providerAccessCredential) { + this.providerAccessCredential = providerAccessCredential; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest suggestions(@javax.annotation.Nullable ProfileRequestModelSuggestions suggestions) { + this.suggestions = suggestions; + return this; + } + + /** + * Get suggestions + * @return suggestions + */ + @javax.annotation.Nullable + public ProfileRequestModelSuggestions getSuggestions() { + return suggestions; + } + + public void setSuggestions(@javax.annotation.Nullable ProfileRequestModelSuggestions suggestions) { + this.suggestions = suggestions; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest subscription(@javax.annotation.Nullable ProfileRequestModelSubscription subscription) { + this.subscription = subscription; + return this; + } + + /** + * Get subscription + * @return subscription + */ + @javax.annotation.Nullable + public ProfileRequestModelSubscription getSubscription() { + return subscription; + } + + public void setSubscription(@javax.annotation.Nullable ProfileRequestModelSubscription subscription) { + this.subscription = subscription; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest privacyPolicy(@javax.annotation.Nullable ProfileRequestModelPrivacyPolicy privacyPolicy) { + this.privacyPolicy = privacyPolicy; + return this; + } + + /** + * Get privacyPolicy + * @return privacyPolicy + */ + @javax.annotation.Nullable + public ProfileRequestModelPrivacyPolicy getPrivacyPolicy() { + return privacyPolicy; + } + + public void setPrivacyPolicy(@javax.annotation.Nullable ProfileRequestModelPrivacyPolicy privacyPolicy) { + this.privacyPolicy = privacyPolicy; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest piNInfo(@javax.annotation.Nullable ProfileRequestModelPINInfo piNInfo) { + this.piNInfo = piNInfo; + return this; + } + + /** + * Get piNInfo + * @return piNInfo + */ + @javax.annotation.Nullable + public ProfileRequestModelPINInfo getPiNInfo() { + return piNInfo; + } + + public void setPiNInfo(@javax.annotation.Nullable ProfileRequestModelPINInfo piNInfo) { + this.piNInfo = piNInfo; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addresses(@javax.annotation.Nullable List<ProfileRequestModelAddressesInner> addresses) { + this.addresses = addresses; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addAddressesItem(ProfileRequestModelAddressesInner addressesItem) { + if (this.addresses == null) { + this.addresses = new ArrayList<>(); + } + this.addresses.add(addressesItem); + return this; + } + + /** + * Get addresses + * @return addresses + */ + @javax.annotation.Nullable + public List<ProfileRequestModelAddressesInner> getAddresses() { + return addresses; + } + + public void setAddresses(@javax.annotation.Nullable List<ProfileRequestModelAddressesInner> addresses) { + this.addresses = addresses; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest positions(@javax.annotation.Nullable List<ProfileRequestModelPositionsInner> positions) { + this.positions = positions; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addPositionsItem(ProfileRequestModelPositionsInner positionsItem) { + if (this.positions == null) { + this.positions = new ArrayList<>(); + } + this.positions.add(positionsItem); + return this; + } + + /** + * Get positions + * @return positions + */ + @javax.annotation.Nullable + public List<ProfileRequestModelPositionsInner> getPositions() { + return positions; + } + + public void setPositions(@javax.annotation.Nullable List<ProfileRequestModelPositionsInner> positions) { + this.positions = positions; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest educations(@javax.annotation.Nullable List<ProfileRequestModelEducationsInner> educations) { + this.educations = educations; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addEducationsItem(ProfileRequestModelEducationsInner educationsItem) { + if (this.educations == null) { + this.educations = new ArrayList<>(); + } + this.educations.add(educationsItem); + return this; + } + + /** + * Get educations + * @return educations + */ + @javax.annotation.Nullable + public List<ProfileRequestModelEducationsInner> getEducations() { + return educations; + } + + public void setEducations(@javax.annotation.Nullable List<ProfileRequestModelEducationsInner> educations) { + this.educations = educations; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest phoneNumbers(@javax.annotation.Nullable List<ProfileRequestModelPhoneNumbersInner> phoneNumbers) { + this.phoneNumbers = phoneNumbers; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addPhoneNumbersItem(ProfileRequestModelPhoneNumbersInner phoneNumbersItem) { + if (this.phoneNumbers == null) { + this.phoneNumbers = new ArrayList<>(); + } + this.phoneNumbers.add(phoneNumbersItem); + return this; + } + + /** + * Get phoneNumbers + * @return phoneNumbers + */ + @javax.annotation.Nullable + public List<ProfileRequestModelPhoneNumbersInner> getPhoneNumbers() { + return phoneNumbers; + } + + public void setPhoneNumbers(@javax.annotation.Nullable List<ProfileRequestModelPhoneNumbersInner> phoneNumbers) { + this.phoneNumbers = phoneNumbers; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest imAccounts(@javax.annotation.Nullable List<ProfileRequestModelIMAccountsInner> imAccounts) { + this.imAccounts = imAccounts; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addImAccountsItem(ProfileRequestModelIMAccountsInner imAccountsItem) { + if (this.imAccounts == null) { + this.imAccounts = new ArrayList<>(); + } + this.imAccounts.add(imAccountsItem); + return this; + } + + /** + * Get imAccounts + * @return imAccounts + */ + @javax.annotation.Nullable + public List<ProfileRequestModelIMAccountsInner> getImAccounts() { + return imAccounts; + } + + public void setImAccounts(@javax.annotation.Nullable List<ProfileRequestModelIMAccountsInner> imAccounts) { + this.imAccounts = imAccounts; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest interests(@javax.annotation.Nullable List<ProfileRequestModelInterestsInner> interests) { + this.interests = interests; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addInterestsItem(ProfileRequestModelInterestsInner interestsItem) { + if (this.interests == null) { + this.interests = new ArrayList<>(); + } + this.interests.add(interestsItem); + return this; + } + + /** + * Get interests + * @return interests + */ + @javax.annotation.Nullable + public List<ProfileRequestModelInterestsInner> getInterests() { + return interests; + } + + public void setInterests(@javax.annotation.Nullable List<ProfileRequestModelInterestsInner> interests) { + this.interests = interests; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest sports(@javax.annotation.Nullable List<ProfileRequestModelSportsInner> sports) { + this.sports = sports; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addSportsItem(ProfileRequestModelSportsInner sportsItem) { + if (this.sports == null) { + this.sports = new ArrayList<>(); + } + this.sports.add(sportsItem); + return this; + } + + /** + * Get sports + * @return sports + */ + @javax.annotation.Nullable + public List<ProfileRequestModelSportsInner> getSports() { + return sports; + } + + public void setSports(@javax.annotation.Nullable List<ProfileRequestModelSportsInner> sports) { + this.sports = sports; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest inspirationalPeople(@javax.annotation.Nullable List<ProfileRequestModelInspirationalPeopleInner> inspirationalPeople) { + this.inspirationalPeople = inspirationalPeople; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addInspirationalPeopleItem(ProfileRequestModelInspirationalPeopleInner inspirationalPeopleItem) { + if (this.inspirationalPeople == null) { + this.inspirationalPeople = new ArrayList<>(); + } + this.inspirationalPeople.add(inspirationalPeopleItem); + return this; + } + + /** + * Get inspirationalPeople + * @return inspirationalPeople + */ + @javax.annotation.Nullable + public List<ProfileRequestModelInspirationalPeopleInner> getInspirationalPeople() { + return inspirationalPeople; + } + + public void setInspirationalPeople(@javax.annotation.Nullable List<ProfileRequestModelInspirationalPeopleInner> inspirationalPeople) { + this.inspirationalPeople = inspirationalPeople; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest awards(@javax.annotation.Nullable List<ProfileRequestModelAwardsInner> awards) { + this.awards = awards; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addAwardsItem(ProfileRequestModelAwardsInner awardsItem) { + if (this.awards == null) { + this.awards = new ArrayList<>(); + } + this.awards.add(awardsItem); + return this; + } + + /** + * Get awards + * @return awards + */ + @javax.annotation.Nullable + public List<ProfileRequestModelAwardsInner> getAwards() { + return awards; + } + + public void setAwards(@javax.annotation.Nullable List<ProfileRequestModelAwardsInner> awards) { + this.awards = awards; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest skills(@javax.annotation.Nullable List<ProfileRequestModelSkillsInner> skills) { + this.skills = skills; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addSkillsItem(ProfileRequestModelSkillsInner skillsItem) { + if (this.skills == null) { + this.skills = new ArrayList<>(); + } + this.skills.add(skillsItem); + return this; + } + + /** + * Get skills + * @return skills + */ + @javax.annotation.Nullable + public List<ProfileRequestModelSkillsInner> getSkills() { + return skills; + } + + public void setSkills(@javax.annotation.Nullable List<ProfileRequestModelSkillsInner> skills) { + this.skills = skills; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest currentStatus(@javax.annotation.Nullable List<ProfileRequestModelCurrentStatusInner> currentStatus) { + this.currentStatus = currentStatus; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addCurrentStatusItem(ProfileRequestModelCurrentStatusInner currentStatusItem) { + if (this.currentStatus == null) { + this.currentStatus = new ArrayList<>(); + } + this.currentStatus.add(currentStatusItem); + return this; + } + + /** + * Get currentStatus + * @return currentStatus + */ + @javax.annotation.Nullable + public List<ProfileRequestModelCurrentStatusInner> getCurrentStatus() { + return currentStatus; + } + + public void setCurrentStatus(@javax.annotation.Nullable List<ProfileRequestModelCurrentStatusInner> currentStatus) { + this.currentStatus = currentStatus; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest certifications(@javax.annotation.Nullable List<ProfileRequestModelCertificationsInner> certifications) { + this.certifications = certifications; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addCertificationsItem(ProfileRequestModelCertificationsInner certificationsItem) { + if (this.certifications == null) { + this.certifications = new ArrayList<>(); + } + this.certifications.add(certificationsItem); + return this; + } + + /** + * Get certifications + * @return certifications + */ + @javax.annotation.Nullable + public List<ProfileRequestModelCertificationsInner> getCertifications() { + return certifications; + } + + public void setCertifications(@javax.annotation.Nullable List<ProfileRequestModelCertificationsInner> certifications) { + this.certifications = certifications; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest courses(@javax.annotation.Nullable List<ProfileRequestModelCoursesInner> courses) { + this.courses = courses; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addCoursesItem(ProfileRequestModelCoursesInner coursesItem) { + if (this.courses == null) { + this.courses = new ArrayList<>(); + } + this.courses.add(coursesItem); + return this; + } + + /** + * Get courses + * @return courses + */ + @javax.annotation.Nullable + public List<ProfileRequestModelCoursesInner> getCourses() { + return courses; + } + + public void setCourses(@javax.annotation.Nullable List<ProfileRequestModelCoursesInner> courses) { + this.courses = courses; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest volunteer(@javax.annotation.Nullable List<ProfileRequestModelVolunteerInner> volunteer) { + this.volunteer = volunteer; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addVolunteerItem(ProfileRequestModelVolunteerInner volunteerItem) { + if (this.volunteer == null) { + this.volunteer = new ArrayList<>(); + } + this.volunteer.add(volunteerItem); + return this; + } + + /** + * Get volunteer + * @return volunteer + */ + @javax.annotation.Nullable + public List<ProfileRequestModelVolunteerInner> getVolunteer() { + return volunteer; + } + + public void setVolunteer(@javax.annotation.Nullable List<ProfileRequestModelVolunteerInner> volunteer) { + this.volunteer = volunteer; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest recommendationsReceived(@javax.annotation.Nullable List<ProfileRequestModelRecommendationsReceivedInner> recommendationsReceived) { + this.recommendationsReceived = recommendationsReceived; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addRecommendationsReceivedItem(ProfileRequestModelRecommendationsReceivedInner recommendationsReceivedItem) { + if (this.recommendationsReceived == null) { + this.recommendationsReceived = new ArrayList<>(); + } + this.recommendationsReceived.add(recommendationsReceivedItem); + return this; + } + + /** + * Get recommendationsReceived + * @return recommendationsReceived + */ + @javax.annotation.Nullable + public List<ProfileRequestModelRecommendationsReceivedInner> getRecommendationsReceived() { + return recommendationsReceived; + } + + public void setRecommendationsReceived(@javax.annotation.Nullable List<ProfileRequestModelRecommendationsReceivedInner> recommendationsReceived) { + this.recommendationsReceived = recommendationsReceived; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest languages(@javax.annotation.Nullable List<ProfileRequestModelLanguagesInner> languages) { + this.languages = languages; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addLanguagesItem(ProfileRequestModelLanguagesInner languagesItem) { + if (this.languages == null) { + this.languages = new ArrayList<>(); + } + this.languages.add(languagesItem); + return this; + } + + /** + * Get languages + * @return languages + */ + @javax.annotation.Nullable + public List<ProfileRequestModelLanguagesInner> getLanguages() { + return languages; + } + + public void setLanguages(@javax.annotation.Nullable List<ProfileRequestModelLanguagesInner> languages) { + this.languages = languages; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest projects(@javax.annotation.Nullable List<ProfileRequestModelProjectsInner> projects) { + this.projects = projects; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addProjectsItem(ProfileRequestModelProjectsInner projectsItem) { + if (this.projects == null) { + this.projects = new ArrayList<>(); + } + this.projects.add(projectsItem); + return this; + } + + /** + * Get projects + * @return projects + */ + @javax.annotation.Nullable + public List<ProfileRequestModelProjectsInner> getProjects() { + return projects; + } + + public void setProjects(@javax.annotation.Nullable List<ProfileRequestModelProjectsInner> projects) { + this.projects = projects; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest games(@javax.annotation.Nullable List<ProfileRequestModelGamesInner> games) { + this.games = games; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addGamesItem(ProfileRequestModelGamesInner gamesItem) { + if (this.games == null) { + this.games = new ArrayList<>(); + } + this.games.add(gamesItem); + return this; + } + + /** + * Get games + * @return games + */ + @javax.annotation.Nullable + public List<ProfileRequestModelGamesInner> getGames() { + return games; + } + + public void setGames(@javax.annotation.Nullable List<ProfileRequestModelGamesInner> games) { + this.games = games; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest family(@javax.annotation.Nullable List<ProfileRequestModelFamilyInner> family) { + this.family = family; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addFamilyItem(ProfileRequestModelFamilyInner familyItem) { + if (this.family == null) { + this.family = new ArrayList<>(); + } + this.family.add(familyItem); + return this; + } + + /** + * Get family + * @return family + */ + @javax.annotation.Nullable + public List<ProfileRequestModelFamilyInner> getFamily() { + return family; + } + + public void setFamily(@javax.annotation.Nullable List<ProfileRequestModelFamilyInner> family) { + this.family = family; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest teleVisionShow(@javax.annotation.Nullable List<ProfileRequestModelTeleVisionShowInner> teleVisionShow) { + this.teleVisionShow = teleVisionShow; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addTeleVisionShowItem(ProfileRequestModelTeleVisionShowInner teleVisionShowItem) { + if (this.teleVisionShow == null) { + this.teleVisionShow = new ArrayList<>(); + } + this.teleVisionShow.add(teleVisionShowItem); + return this; + } + + /** + * Get teleVisionShow + * @return teleVisionShow + */ + @javax.annotation.Nullable + public List<ProfileRequestModelTeleVisionShowInner> getTeleVisionShow() { + return teleVisionShow; + } + + public void setTeleVisionShow(@javax.annotation.Nullable List<ProfileRequestModelTeleVisionShowInner> teleVisionShow) { + this.teleVisionShow = teleVisionShow; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest mutualFriends(@javax.annotation.Nullable List<ProfileRequestModelMutualFriendsInner> mutualFriends) { + this.mutualFriends = mutualFriends; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addMutualFriendsItem(ProfileRequestModelMutualFriendsInner mutualFriendsItem) { + if (this.mutualFriends == null) { + this.mutualFriends = new ArrayList<>(); + } + this.mutualFriends.add(mutualFriendsItem); + return this; + } + + /** + * Get mutualFriends + * @return mutualFriends + */ + @javax.annotation.Nullable + public List<ProfileRequestModelMutualFriendsInner> getMutualFriends() { + return mutualFriends; + } + + public void setMutualFriends(@javax.annotation.Nullable List<ProfileRequestModelMutualFriendsInner> mutualFriends) { + this.mutualFriends = mutualFriends; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest movies(@javax.annotation.Nullable List<ProfileRequestModelMoviesInner> movies) { + this.movies = movies; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addMoviesItem(ProfileRequestModelMoviesInner moviesItem) { + if (this.movies == null) { + this.movies = new ArrayList<>(); + } + this.movies.add(moviesItem); + return this; + } + + /** + * Get movies + * @return movies + */ + @javax.annotation.Nullable + public List<ProfileRequestModelMoviesInner> getMovies() { + return movies; + } + + public void setMovies(@javax.annotation.Nullable List<ProfileRequestModelMoviesInner> movies) { + this.movies = movies; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest books(@javax.annotation.Nullable List<ProfileRequestModelBooksInner> books) { + this.books = books; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addBooksItem(ProfileRequestModelBooksInner booksItem) { + if (this.books == null) { + this.books = new ArrayList<>(); + } + this.books.add(booksItem); + return this; + } + + /** + * Get books + * @return books + */ + @javax.annotation.Nullable + public List<ProfileRequestModelBooksInner> getBooks() { + return books; + } + + public void setBooks(@javax.annotation.Nullable List<ProfileRequestModelBooksInner> books) { + this.books = books; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest patents(@javax.annotation.Nullable List<ProfileRequestModelPatentsInner> patents) { + this.patents = patents; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addPatentsItem(ProfileRequestModelPatentsInner patentsItem) { + if (this.patents == null) { + this.patents = new ArrayList<>(); + } + this.patents.add(patentsItem); + return this; + } + + /** + * Get patents + * @return patents + */ + @javax.annotation.Nullable + public List<ProfileRequestModelPatentsInner> getPatents() { + return patents; + } + + public void setPatents(@javax.annotation.Nullable List<ProfileRequestModelPatentsInner> patents) { + this.patents = patents; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest favoriteThings(@javax.annotation.Nullable List<ProfileRequestModelFavoriteThingsInner> favoriteThings) { + this.favoriteThings = favoriteThings; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addFavoriteThingsItem(ProfileRequestModelFavoriteThingsInner favoriteThingsItem) { + if (this.favoriteThings == null) { + this.favoriteThings = new ArrayList<>(); + } + this.favoriteThings.add(favoriteThingsItem); + return this; + } + + /** + * Get favoriteThings + * @return favoriteThings + */ + @javax.annotation.Nullable + public List<ProfileRequestModelFavoriteThingsInner> getFavoriteThings() { + return favoriteThings; + } + + public void setFavoriteThings(@javax.annotation.Nullable List<ProfileRequestModelFavoriteThingsInner> favoriteThings) { + this.favoriteThings = favoriteThings; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest relatedProfileViews(@javax.annotation.Nullable List<ProfileRequestModelRelatedProfileViewsInner> relatedProfileViews) { + this.relatedProfileViews = relatedProfileViews; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addRelatedProfileViewsItem(ProfileRequestModelRelatedProfileViewsInner relatedProfileViewsItem) { + if (this.relatedProfileViews == null) { + this.relatedProfileViews = new ArrayList<>(); + } + this.relatedProfileViews.add(relatedProfileViewsItem); + return this; + } + + /** + * Get relatedProfileViews + * @return relatedProfileViews + */ + @javax.annotation.Nullable + public List<ProfileRequestModelRelatedProfileViewsInner> getRelatedProfileViews() { + return relatedProfileViews; + } + + public void setRelatedProfileViews(@javax.annotation.Nullable List<ProfileRequestModelRelatedProfileViewsInner> relatedProfileViews) { + this.relatedProfileViews = relatedProfileViews; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest placesLived(@javax.annotation.Nullable List<ProfileRequestModelPlacesLivedInner> placesLived) { + this.placesLived = placesLived; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addPlacesLivedItem(ProfileRequestModelPlacesLivedInner placesLivedItem) { + if (this.placesLived == null) { + this.placesLived = new ArrayList<>(); + } + this.placesLived.add(placesLivedItem); + return this; + } + + /** + * Get placesLived + * @return placesLived + */ + @javax.annotation.Nullable + public List<ProfileRequestModelPlacesLivedInner> getPlacesLived() { + return placesLived; + } + + public void setPlacesLived(@javax.annotation.Nullable List<ProfileRequestModelPlacesLivedInner> placesLived) { + this.placesLived = placesLived; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest publications(@javax.annotation.Nullable List<ProfileRequestModelPublicationsInner> publications) { + this.publications = publications; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addPublicationsItem(ProfileRequestModelPublicationsInner publicationsItem) { + if (this.publications == null) { + this.publications = new ArrayList<>(); + } + this.publications.add(publicationsItem); + return this; + } + + /** + * Get publications + * @return publications + */ + @javax.annotation.Nullable + public List<ProfileRequestModelPublicationsInner> getPublications() { + return publications; + } + + public void setPublications(@javax.annotation.Nullable List<ProfileRequestModelPublicationsInner> publications) { + this.publications = publications; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest jobBookmarks(@javax.annotation.Nullable List<ProfileRequestModelJobBookmarksInner> jobBookmarks) { + this.jobBookmarks = jobBookmarks; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addJobBookmarksItem(ProfileRequestModelJobBookmarksInner jobBookmarksItem) { + if (this.jobBookmarks == null) { + this.jobBookmarks = new ArrayList<>(); + } + this.jobBookmarks.add(jobBookmarksItem); + return this; + } + + /** + * Get jobBookmarks + * @return jobBookmarks + */ + @javax.annotation.Nullable + public List<ProfileRequestModelJobBookmarksInner> getJobBookmarks() { + return jobBookmarks; + } + + public void setJobBookmarks(@javax.annotation.Nullable List<ProfileRequestModelJobBookmarksInner> jobBookmarks) { + this.jobBookmarks = jobBookmarks; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest badges(@javax.annotation.Nullable List<ProfileRequestModelBadgesInner> badges) { + this.badges = badges; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addBadgesItem(ProfileRequestModelBadgesInner badgesItem) { + if (this.badges == null) { + this.badges = new ArrayList<>(); + } + this.badges.add(badgesItem); + return this; + } + + /** + * Get badges + * @return badges + */ + @javax.annotation.Nullable + public List<ProfileRequestModelBadgesInner> getBadges() { + return badges; + } + + public void setBadges(@javax.annotation.Nullable List<ProfileRequestModelBadgesInner> badges) { + this.badges = badges; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest memberUrlResources(@javax.annotation.Nullable List<ProfileRequestModelMemberUrlResourcesInner> memberUrlResources) { + this.memberUrlResources = memberUrlResources; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addMemberUrlResourcesItem(ProfileRequestModelMemberUrlResourcesInner memberUrlResourcesItem) { + if (this.memberUrlResources == null) { + this.memberUrlResources = new ArrayList<>(); + } + this.memberUrlResources.add(memberUrlResourcesItem); + return this; + } + + /** + * Get memberUrlResources + * @return memberUrlResources + */ + @javax.annotation.Nullable + public List<ProfileRequestModelMemberUrlResourcesInner> getMemberUrlResources() { + return memberUrlResources; + } + + public void setMemberUrlResources(@javax.annotation.Nullable List<ProfileRequestModelMemberUrlResourcesInner> memberUrlResources) { + this.memberUrlResources = memberUrlResources; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest externalIds(@javax.annotation.Nullable List<ProfileRequestModelExternalIdsInner> externalIds) { + this.externalIds = externalIds; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addExternalIdsItem(ProfileRequestModelExternalIdsInner externalIdsItem) { + if (this.externalIds == null) { + this.externalIds = new ArrayList<>(); + } + this.externalIds.add(externalIdsItem); + return this; + } + + /** + * Get externalIds + * @return externalIds + */ + @javax.annotation.Nullable + public List<ProfileRequestModelExternalIdsInner> getExternalIds() { + return externalIds; + } + + public void setExternalIds(@javax.annotation.Nullable List<ProfileRequestModelExternalIdsInner> externalIds) { + this.externalIds = externalIds; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest isEmailSubscribed(@javax.annotation.Nullable Boolean isEmailSubscribed) { + this.isEmailSubscribed = isEmailSubscribed; + return this; + } + + /** + * Get isEmailSubscribed + * @return isEmailSubscribed + */ + @javax.annotation.Nullable + public Boolean getIsEmailSubscribed() { + return isEmailSubscribed; + } + + public void setIsEmailSubscribed(@javax.annotation.Nullable Boolean isEmailSubscribed) { + this.isEmailSubscribed = isEmailSubscribed; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest isProtected(@javax.annotation.Nullable Boolean isProtected) { + this.isProtected = isProtected; + return this; + } + + /** + * Get isProtected + * @return isProtected + */ + @javax.annotation.Nullable + public Boolean getIsProtected() { + return isProtected; + } + + public void setIsProtected(@javax.annotation.Nullable Boolean isProtected) { + this.isProtected = isProtected; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest hireable(@javax.annotation.Nullable Boolean hireable) { + this.hireable = hireable; + return this; + } + + /** + * Get hireable + * @return hireable + */ + @javax.annotation.Nullable + public Boolean getHireable() { + return hireable; + } + + public void setHireable(@javax.annotation.Nullable Boolean hireable) { + this.hireable = hireable; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest isTwoFactorAuthenticationEnabled(@javax.annotation.Nullable Boolean isTwoFactorAuthenticationEnabled) { + this.isTwoFactorAuthenticationEnabled = isTwoFactorAuthenticationEnabled; + return this; + } + + /** + * Get isTwoFactorAuthenticationEnabled + * @return isTwoFactorAuthenticationEnabled + */ + @javax.annotation.Nullable + public Boolean getIsTwoFactorAuthenticationEnabled() { + return isTwoFactorAuthenticationEnabled; + } + + public void setIsTwoFactorAuthenticationEnabled(@javax.annotation.Nullable Boolean isTwoFactorAuthenticationEnabled) { + this.isTwoFactorAuthenticationEnabled = isTwoFactorAuthenticationEnabled; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest disableLogin(@javax.annotation.Nullable Boolean disableLogin) { + this.disableLogin = disableLogin; + return this; + } + + /** + * Get disableLogin + * @return disableLogin + */ + @javax.annotation.Nullable + public Boolean getDisableLogin() { + return disableLogin; + } + + public void setDisableLogin(@javax.annotation.Nullable Boolean disableLogin) { + this.disableLogin = disableLogin; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest acceptPrivacyPolicy(@javax.annotation.Nullable Boolean acceptPrivacyPolicy) { + this.acceptPrivacyPolicy = acceptPrivacyPolicy; + return this; + } + + /** + * Get acceptPrivacyPolicy + * @return acceptPrivacyPolicy + */ + @javax.annotation.Nullable + public Boolean getAcceptPrivacyPolicy() { + return acceptPrivacyPolicy; + } + + public void setAcceptPrivacyPolicy(@javax.annotation.Nullable Boolean acceptPrivacyPolicy) { + this.acceptPrivacyPolicy = acceptPrivacyPolicy; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest recaptchaResponseField(@javax.annotation.Nullable String recaptchaResponseField) { + this.recaptchaResponseField = recaptchaResponseField; + return this; + } + + /** + * Get recaptchaResponseField + * @return recaptchaResponseField + */ + @javax.annotation.Nullable + public String getRecaptchaResponseField() { + return recaptchaResponseField; + } + + public void setRecaptchaResponseField(@javax.annotation.Nullable String recaptchaResponseField) { + this.recaptchaResponseField = recaptchaResponseField; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest recaptchaChallengeField(@javax.annotation.Nullable String recaptchaChallengeField) { + this.recaptchaChallengeField = recaptchaChallengeField; + return this; + } + + /** + * Get recaptchaChallengeField + * @return recaptchaChallengeField + */ + @javax.annotation.Nullable + public String getRecaptchaChallengeField() { + return recaptchaChallengeField; + } + + public void setRecaptchaChallengeField(@javax.annotation.Nullable String recaptchaChallengeField) { + this.recaptchaChallengeField = recaptchaChallengeField; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest captchaModel(@javax.annotation.Nullable ProfileRequestModelCaptchaModel captchaModel) { + this.captchaModel = captchaModel; + return this; + } + + /** + * Get captchaModel + * @return captchaModel + */ + @javax.annotation.Nullable + public ProfileRequestModelCaptchaModel getCaptchaModel() { + return captchaModel; + } + + public void setCaptchaModel(@javax.annotation.Nullable ProfileRequestModelCaptchaModel captchaModel) { + this.captchaModel = captchaModel; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest registrationSource(@javax.annotation.Nullable String registrationSource) { + this.registrationSource = registrationSource; + return this; + } + + /** + * Get registrationSource + * @return registrationSource + */ + @javax.annotation.Nullable + public String getRegistrationSource() { + return registrationSource; + } + + public void setRegistrationSource(@javax.annotation.Nullable String registrationSource) { + this.registrationSource = registrationSource; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest fullName(@javax.annotation.Nullable String fullName) { + this.fullName = fullName; + return this; + } + + /** + * Get fullName + * @return fullName + */ + @javax.annotation.Nullable + public String getFullName() { + return fullName; + } + + public void setFullName(@javax.annotation.Nullable String fullName) { + this.fullName = fullName; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest consents(@javax.annotation.Nullable ProfileRequestModelConsents consents) { + this.consents = consents; + return this; + } + + /** + * Get consents + * @return consents + */ + @javax.annotation.Nullable + public ProfileRequestModelConsents getConsents() { + return consents; + } + + public void setConsents(@javax.annotation.Nullable ProfileRequestModelConsents consents) { + this.consents = consents; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest password(@javax.annotation.Nullable String password) { + this.password = password; + return this; + } + + /** + * Get password + * @return password + */ + @javax.annotation.Nullable + public String getPassword() { + return password; + } + + public void setPassword(@javax.annotation.Nullable String password) { + this.password = password; + } + + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest email(@javax.annotation.Nullable List<ProfileRequestModelEmailInner> email) { + this.email = email; + return this; + } + + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest addEmailItem(ProfileRequestModelEmailInner emailItem) { + if (this.email == null) { + this.email = new ArrayList<>(); + } + this.email.add(emailItem); + return this; + } + + /** + * Get email + * @return email + */ + @javax.annotation.Nullable + public List<ProfileRequestModelEmailInner> getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable List<ProfileRequestModelEmailInner> email) { + this.email = email; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UserRegistrationByReCaptchaEmailPhoneUserNameRequest instance itself + */ + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserRegistrationByReCaptchaEmailPhoneUserNameRequest userRegistrationByReCaptchaEmailPhoneUserNameRequest = (UserRegistrationByReCaptchaEmailPhoneUserNameRequest) o; + return Objects.equals(this.gRecaptchaResponse, userRegistrationByReCaptchaEmailPhoneUserNameRequest.gRecaptchaResponse) && + Objects.equals(this.qqCaptchaTicket, userRegistrationByReCaptchaEmailPhoneUserNameRequest.qqCaptchaTicket) && + Objects.equals(this.qqCaptchaRandstr, userRegistrationByReCaptchaEmailPhoneUserNameRequest.qqCaptchaRandstr) && + Objects.equals(this.hCaptchaResponse, userRegistrationByReCaptchaEmailPhoneUserNameRequest.hCaptchaResponse) && + Objects.equals(this.userName, userRegistrationByReCaptchaEmailPhoneUserNameRequest.userName) && + Objects.equals(this.phoneId, userRegistrationByReCaptchaEmailPhoneUserNameRequest.phoneId) && + Objects.equals(this.gender, userRegistrationByReCaptchaEmailPhoneUserNameRequest.gender) && + Objects.equals(this.birthDate, userRegistrationByReCaptchaEmailPhoneUserNameRequest.birthDate) && + Objects.equals(this.prefix, userRegistrationByReCaptchaEmailPhoneUserNameRequest.prefix) && + Objects.equals(this.firstName, userRegistrationByReCaptchaEmailPhoneUserNameRequest.firstName) && + Objects.equals(this.middleName, userRegistrationByReCaptchaEmailPhoneUserNameRequest.middleName) && + Objects.equals(this.lastName, userRegistrationByReCaptchaEmailPhoneUserNameRequest.lastName) && + Objects.equals(this.suffix, userRegistrationByReCaptchaEmailPhoneUserNameRequest.suffix) && + Objects.equals(this.nickName, userRegistrationByReCaptchaEmailPhoneUserNameRequest.nickName) && + Objects.equals(this.profileName, userRegistrationByReCaptchaEmailPhoneUserNameRequest.profileName) && + Objects.equals(this.about, userRegistrationByReCaptchaEmailPhoneUserNameRequest.about) && + Objects.equals(this.company, userRegistrationByReCaptchaEmailPhoneUserNameRequest.company) && + Objects.equals(this.imageUrl, userRegistrationByReCaptchaEmailPhoneUserNameRequest.imageUrl) && + Objects.equals(this.timeZone, userRegistrationByReCaptchaEmailPhoneUserNameRequest.timeZone) && + Objects.equals(this.website, userRegistrationByReCaptchaEmailPhoneUserNameRequest.website) && + Objects.equals(this.thumbnailImageUrl, userRegistrationByReCaptchaEmailPhoneUserNameRequest.thumbnailImageUrl) && + Objects.equals(this.favicon, userRegistrationByReCaptchaEmailPhoneUserNameRequest.favicon) && + Objects.equals(this.profileUrl, userRegistrationByReCaptchaEmailPhoneUserNameRequest.profileUrl) && + Objects.equals(this.homeTown, userRegistrationByReCaptchaEmailPhoneUserNameRequest.homeTown) && + Objects.equals(this.state, userRegistrationByReCaptchaEmailPhoneUserNameRequest.state) && + Objects.equals(this.city, userRegistrationByReCaptchaEmailPhoneUserNameRequest.city) && + Objects.equals(this.industry, userRegistrationByReCaptchaEmailPhoneUserNameRequest.industry) && + Objects.equals(this.localLanguage, userRegistrationByReCaptchaEmailPhoneUserNameRequest.localLanguage) && + Objects.equals(this.language, userRegistrationByReCaptchaEmailPhoneUserNameRequest.language) && + Objects.equals(this.coverPhoto, userRegistrationByReCaptchaEmailPhoneUserNameRequest.coverPhoto) && + Objects.equals(this.tagLine, userRegistrationByReCaptchaEmailPhoneUserNameRequest.tagLine) && + Objects.equals(this.mainAddress, userRegistrationByReCaptchaEmailPhoneUserNameRequest.mainAddress) && + Objects.equals(this.localCity, userRegistrationByReCaptchaEmailPhoneUserNameRequest.localCity) && + Objects.equals(this.profileCity, userRegistrationByReCaptchaEmailPhoneUserNameRequest.profileCity) && + Objects.equals(this.localCountry, userRegistrationByReCaptchaEmailPhoneUserNameRequest.localCountry) && + Objects.equals(this.profileCountry, userRegistrationByReCaptchaEmailPhoneUserNameRequest.profileCountry) && + Objects.equals(this.quota, userRegistrationByReCaptchaEmailPhoneUserNameRequest.quota) && + Objects.equals(this.religion, userRegistrationByReCaptchaEmailPhoneUserNameRequest.religion) && + Objects.equals(this.political, userRegistrationByReCaptchaEmailPhoneUserNameRequest.political) && + Objects.equals(this.relationshipStatus, userRegistrationByReCaptchaEmailPhoneUserNameRequest.relationshipStatus) && + Objects.equals(this.httpsImageUrl, userRegistrationByReCaptchaEmailPhoneUserNameRequest.httpsImageUrl) && + Objects.equals(this.isGeoEnabled, userRegistrationByReCaptchaEmailPhoneUserNameRequest.isGeoEnabled) && + Objects.equals(this.associations, userRegistrationByReCaptchaEmailPhoneUserNameRequest.associations) && + Objects.equals(this.honors, userRegistrationByReCaptchaEmailPhoneUserNameRequest.honors) && + Objects.equals(this.publicRepository, userRegistrationByReCaptchaEmailPhoneUserNameRequest.publicRepository) && + Objects.equals(this.repositoryUrl, userRegistrationByReCaptchaEmailPhoneUserNameRequest.repositoryUrl) && + Objects.equals(this.professionalHeadline, userRegistrationByReCaptchaEmailPhoneUserNameRequest.professionalHeadline) && + Objects.equals(this.currency, userRegistrationByReCaptchaEmailPhoneUserNameRequest.currency) && + Objects.equals(this.starredUrl, userRegistrationByReCaptchaEmailPhoneUserNameRequest.starredUrl) && + Objects.equals(this.gistsUrl, userRegistrationByReCaptchaEmailPhoneUserNameRequest.gistsUrl) && + Objects.equals(this.gravatarImageUrl, userRegistrationByReCaptchaEmailPhoneUserNameRequest.gravatarImageUrl) && + Objects.equals(this.externalUserLoginId, userRegistrationByReCaptchaEmailPhoneUserNameRequest.externalUserLoginId) && + Objects.equals(this.interestedIn, userRegistrationByReCaptchaEmailPhoneUserNameRequest.interestedIn) && + Objects.equals(this.followersCount, userRegistrationByReCaptchaEmailPhoneUserNameRequest.followersCount) && + Objects.equals(this.friendsCount, userRegistrationByReCaptchaEmailPhoneUserNameRequest.friendsCount) && + Objects.equals(this.totalStatusesCount, userRegistrationByReCaptchaEmailPhoneUserNameRequest.totalStatusesCount) && + Objects.equals(this.numRecommenders, userRegistrationByReCaptchaEmailPhoneUserNameRequest.numRecommenders) && + Objects.equals(this.totalPrivateRepository, userRegistrationByReCaptchaEmailPhoneUserNameRequest.totalPrivateRepository) && + Objects.equals(this.publicGists, userRegistrationByReCaptchaEmailPhoneUserNameRequest.publicGists) && + Objects.equals(this.privateGists, userRegistrationByReCaptchaEmailPhoneUserNameRequest.privateGists) && + Objects.equals(this.sessionLimit, userRegistrationByReCaptchaEmailPhoneUserNameRequest.sessionLimit) && + Objects.equals(this.customFields, userRegistrationByReCaptchaEmailPhoneUserNameRequest.customFields) && + Objects.equals(this.profileImageUrls, userRegistrationByReCaptchaEmailPhoneUserNameRequest.profileImageUrls) && + Objects.equals(this.webProfiles, userRegistrationByReCaptchaEmailPhoneUserNameRequest.webProfiles) && + Objects.equals(this.securityQuestionAnswer, userRegistrationByReCaptchaEmailPhoneUserNameRequest.securityQuestionAnswer) && + Objects.equals(this.country, userRegistrationByReCaptchaEmailPhoneUserNameRequest.country) && + Objects.equals(this.providerAccessCredential, userRegistrationByReCaptchaEmailPhoneUserNameRequest.providerAccessCredential) && + Objects.equals(this.suggestions, userRegistrationByReCaptchaEmailPhoneUserNameRequest.suggestions) && + Objects.equals(this.subscription, userRegistrationByReCaptchaEmailPhoneUserNameRequest.subscription) && + Objects.equals(this.privacyPolicy, userRegistrationByReCaptchaEmailPhoneUserNameRequest.privacyPolicy) && + Objects.equals(this.piNInfo, userRegistrationByReCaptchaEmailPhoneUserNameRequest.piNInfo) && + Objects.equals(this.addresses, userRegistrationByReCaptchaEmailPhoneUserNameRequest.addresses) && + Objects.equals(this.positions, userRegistrationByReCaptchaEmailPhoneUserNameRequest.positions) && + Objects.equals(this.educations, userRegistrationByReCaptchaEmailPhoneUserNameRequest.educations) && + Objects.equals(this.phoneNumbers, userRegistrationByReCaptchaEmailPhoneUserNameRequest.phoneNumbers) && + Objects.equals(this.imAccounts, userRegistrationByReCaptchaEmailPhoneUserNameRequest.imAccounts) && + Objects.equals(this.interests, userRegistrationByReCaptchaEmailPhoneUserNameRequest.interests) && + Objects.equals(this.sports, userRegistrationByReCaptchaEmailPhoneUserNameRequest.sports) && + Objects.equals(this.inspirationalPeople, userRegistrationByReCaptchaEmailPhoneUserNameRequest.inspirationalPeople) && + Objects.equals(this.awards, userRegistrationByReCaptchaEmailPhoneUserNameRequest.awards) && + Objects.equals(this.skills, userRegistrationByReCaptchaEmailPhoneUserNameRequest.skills) && + Objects.equals(this.currentStatus, userRegistrationByReCaptchaEmailPhoneUserNameRequest.currentStatus) && + Objects.equals(this.certifications, userRegistrationByReCaptchaEmailPhoneUserNameRequest.certifications) && + Objects.equals(this.courses, userRegistrationByReCaptchaEmailPhoneUserNameRequest.courses) && + Objects.equals(this.volunteer, userRegistrationByReCaptchaEmailPhoneUserNameRequest.volunteer) && + Objects.equals(this.recommendationsReceived, userRegistrationByReCaptchaEmailPhoneUserNameRequest.recommendationsReceived) && + Objects.equals(this.languages, userRegistrationByReCaptchaEmailPhoneUserNameRequest.languages) && + Objects.equals(this.projects, userRegistrationByReCaptchaEmailPhoneUserNameRequest.projects) && + Objects.equals(this.games, userRegistrationByReCaptchaEmailPhoneUserNameRequest.games) && + Objects.equals(this.family, userRegistrationByReCaptchaEmailPhoneUserNameRequest.family) && + Objects.equals(this.teleVisionShow, userRegistrationByReCaptchaEmailPhoneUserNameRequest.teleVisionShow) && + Objects.equals(this.mutualFriends, userRegistrationByReCaptchaEmailPhoneUserNameRequest.mutualFriends) && + Objects.equals(this.movies, userRegistrationByReCaptchaEmailPhoneUserNameRequest.movies) && + Objects.equals(this.books, userRegistrationByReCaptchaEmailPhoneUserNameRequest.books) && + Objects.equals(this.patents, userRegistrationByReCaptchaEmailPhoneUserNameRequest.patents) && + Objects.equals(this.favoriteThings, userRegistrationByReCaptchaEmailPhoneUserNameRequest.favoriteThings) && + Objects.equals(this.relatedProfileViews, userRegistrationByReCaptchaEmailPhoneUserNameRequest.relatedProfileViews) && + Objects.equals(this.placesLived, userRegistrationByReCaptchaEmailPhoneUserNameRequest.placesLived) && + Objects.equals(this.publications, userRegistrationByReCaptchaEmailPhoneUserNameRequest.publications) && + Objects.equals(this.jobBookmarks, userRegistrationByReCaptchaEmailPhoneUserNameRequest.jobBookmarks) && + Objects.equals(this.badges, userRegistrationByReCaptchaEmailPhoneUserNameRequest.badges) && + Objects.equals(this.memberUrlResources, userRegistrationByReCaptchaEmailPhoneUserNameRequest.memberUrlResources) && + Objects.equals(this.externalIds, userRegistrationByReCaptchaEmailPhoneUserNameRequest.externalIds) && + Objects.equals(this.isEmailSubscribed, userRegistrationByReCaptchaEmailPhoneUserNameRequest.isEmailSubscribed) && + Objects.equals(this.isProtected, userRegistrationByReCaptchaEmailPhoneUserNameRequest.isProtected) && + Objects.equals(this.hireable, userRegistrationByReCaptchaEmailPhoneUserNameRequest.hireable) && + Objects.equals(this.isTwoFactorAuthenticationEnabled, userRegistrationByReCaptchaEmailPhoneUserNameRequest.isTwoFactorAuthenticationEnabled) && + Objects.equals(this.disableLogin, userRegistrationByReCaptchaEmailPhoneUserNameRequest.disableLogin) && + Objects.equals(this.acceptPrivacyPolicy, userRegistrationByReCaptchaEmailPhoneUserNameRequest.acceptPrivacyPolicy) && + Objects.equals(this.recaptchaResponseField, userRegistrationByReCaptchaEmailPhoneUserNameRequest.recaptchaResponseField) && + Objects.equals(this.recaptchaChallengeField, userRegistrationByReCaptchaEmailPhoneUserNameRequest.recaptchaChallengeField) && + Objects.equals(this.captchaModel, userRegistrationByReCaptchaEmailPhoneUserNameRequest.captchaModel) && + Objects.equals(this.registrationSource, userRegistrationByReCaptchaEmailPhoneUserNameRequest.registrationSource) && + Objects.equals(this.fullName, userRegistrationByReCaptchaEmailPhoneUserNameRequest.fullName) && + Objects.equals(this.consents, userRegistrationByReCaptchaEmailPhoneUserNameRequest.consents) && + Objects.equals(this.password, userRegistrationByReCaptchaEmailPhoneUserNameRequest.password) && + Objects.equals(this.email, userRegistrationByReCaptchaEmailPhoneUserNameRequest.email)&& + Objects.equals(this.additionalProperties, userRegistrationByReCaptchaEmailPhoneUserNameRequest.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, userName, phoneId, gender, birthDate, prefix, firstName, middleName, lastName, suffix, nickName, profileName, about, company, imageUrl, timeZone, website, thumbnailImageUrl, favicon, profileUrl, homeTown, state, city, industry, localLanguage, language, coverPhoto, tagLine, mainAddress, localCity, profileCity, localCountry, profileCountry, quota, religion, political, relationshipStatus, httpsImageUrl, isGeoEnabled, associations, honors, publicRepository, repositoryUrl, professionalHeadline, currency, starredUrl, gistsUrl, gravatarImageUrl, externalUserLoginId, interestedIn, followersCount, friendsCount, totalStatusesCount, numRecommenders, totalPrivateRepository, publicGists, privateGists, sessionLimit, customFields, profileImageUrls, webProfiles, securityQuestionAnswer, country, providerAccessCredential, suggestions, subscription, privacyPolicy, piNInfo, addresses, positions, educations, phoneNumbers, imAccounts, interests, sports, inspirationalPeople, awards, skills, currentStatus, certifications, courses, volunteer, recommendationsReceived, languages, projects, games, family, teleVisionShow, mutualFriends, movies, books, patents, favoriteThings, relatedProfileViews, placesLived, publications, jobBookmarks, badges, memberUrlResources, externalIds, isEmailSubscribed, isProtected, hireable, isTwoFactorAuthenticationEnabled, disableLogin, acceptPrivacyPolicy, recaptchaResponseField, recaptchaChallengeField, captchaModel, registrationSource, fullName, consents, password, email, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserRegistrationByReCaptchaEmailPhoneUserNameRequest {\n"); + sb.append(" gRecaptchaResponse: ").append(toIndentedString(gRecaptchaResponse)).append("\n"); + sb.append(" qqCaptchaTicket: ").append(toIndentedString(qqCaptchaTicket)).append("\n"); + sb.append(" qqCaptchaRandstr: ").append(toIndentedString(qqCaptchaRandstr)).append("\n"); + sb.append(" hCaptchaResponse: ").append(toIndentedString(hCaptchaResponse)).append("\n"); + sb.append(" userName: ").append(toIndentedString(userName)).append("\n"); + sb.append(" phoneId: ").append(toIndentedString(phoneId)).append("\n"); + sb.append(" gender: ").append(toIndentedString(gender)).append("\n"); + sb.append(" birthDate: ").append(toIndentedString(birthDate)).append("\n"); + sb.append(" prefix: ").append(toIndentedString(prefix)).append("\n"); + sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); + sb.append(" middleName: ").append(toIndentedString(middleName)).append("\n"); + sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); + sb.append(" suffix: ").append(toIndentedString(suffix)).append("\n"); + sb.append(" nickName: ").append(toIndentedString(nickName)).append("\n"); + sb.append(" profileName: ").append(toIndentedString(profileName)).append("\n"); + sb.append(" about: ").append(toIndentedString(about)).append("\n"); + sb.append(" company: ").append(toIndentedString(company)).append("\n"); + sb.append(" imageUrl: ").append(toIndentedString(imageUrl)).append("\n"); + sb.append(" timeZone: ").append(toIndentedString(timeZone)).append("\n"); + sb.append(" website: ").append(toIndentedString(website)).append("\n"); + sb.append(" thumbnailImageUrl: ").append(toIndentedString(thumbnailImageUrl)).append("\n"); + sb.append(" favicon: ").append(toIndentedString(favicon)).append("\n"); + sb.append(" profileUrl: ").append(toIndentedString(profileUrl)).append("\n"); + sb.append(" homeTown: ").append(toIndentedString(homeTown)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" city: ").append(toIndentedString(city)).append("\n"); + sb.append(" industry: ").append(toIndentedString(industry)).append("\n"); + sb.append(" localLanguage: ").append(toIndentedString(localLanguage)).append("\n"); + sb.append(" language: ").append(toIndentedString(language)).append("\n"); + sb.append(" coverPhoto: ").append(toIndentedString(coverPhoto)).append("\n"); + sb.append(" tagLine: ").append(toIndentedString(tagLine)).append("\n"); + sb.append(" mainAddress: ").append(toIndentedString(mainAddress)).append("\n"); + sb.append(" localCity: ").append(toIndentedString(localCity)).append("\n"); + sb.append(" profileCity: ").append(toIndentedString(profileCity)).append("\n"); + sb.append(" localCountry: ").append(toIndentedString(localCountry)).append("\n"); + sb.append(" profileCountry: ").append(toIndentedString(profileCountry)).append("\n"); + sb.append(" quota: ").append(toIndentedString(quota)).append("\n"); + sb.append(" religion: ").append(toIndentedString(religion)).append("\n"); + sb.append(" political: ").append(toIndentedString(political)).append("\n"); + sb.append(" relationshipStatus: ").append(toIndentedString(relationshipStatus)).append("\n"); + sb.append(" httpsImageUrl: ").append(toIndentedString(httpsImageUrl)).append("\n"); + sb.append(" isGeoEnabled: ").append(toIndentedString(isGeoEnabled)).append("\n"); + sb.append(" associations: ").append(toIndentedString(associations)).append("\n"); + sb.append(" honors: ").append(toIndentedString(honors)).append("\n"); + sb.append(" publicRepository: ").append(toIndentedString(publicRepository)).append("\n"); + sb.append(" repositoryUrl: ").append(toIndentedString(repositoryUrl)).append("\n"); + sb.append(" professionalHeadline: ").append(toIndentedString(professionalHeadline)).append("\n"); + sb.append(" currency: ").append(toIndentedString(currency)).append("\n"); + sb.append(" starredUrl: ").append(toIndentedString(starredUrl)).append("\n"); + sb.append(" gistsUrl: ").append(toIndentedString(gistsUrl)).append("\n"); + sb.append(" gravatarImageUrl: ").append(toIndentedString(gravatarImageUrl)).append("\n"); + sb.append(" externalUserLoginId: ").append(toIndentedString(externalUserLoginId)).append("\n"); + sb.append(" interestedIn: ").append(toIndentedString(interestedIn)).append("\n"); + sb.append(" followersCount: ").append(toIndentedString(followersCount)).append("\n"); + sb.append(" friendsCount: ").append(toIndentedString(friendsCount)).append("\n"); + sb.append(" totalStatusesCount: ").append(toIndentedString(totalStatusesCount)).append("\n"); + sb.append(" numRecommenders: ").append(toIndentedString(numRecommenders)).append("\n"); + sb.append(" totalPrivateRepository: ").append(toIndentedString(totalPrivateRepository)).append("\n"); + sb.append(" publicGists: ").append(toIndentedString(publicGists)).append("\n"); + sb.append(" privateGists: ").append(toIndentedString(privateGists)).append("\n"); + sb.append(" sessionLimit: ").append(toIndentedString(sessionLimit)).append("\n"); + sb.append(" customFields: ").append(toIndentedString(customFields)).append("\n"); + sb.append(" profileImageUrls: ").append(toIndentedString(profileImageUrls)).append("\n"); + sb.append(" webProfiles: ").append(toIndentedString(webProfiles)).append("\n"); + sb.append(" securityQuestionAnswer: ").append(toIndentedString(securityQuestionAnswer)).append("\n"); + sb.append(" country: ").append(toIndentedString(country)).append("\n"); + sb.append(" providerAccessCredential: ").append(toIndentedString(providerAccessCredential)).append("\n"); + sb.append(" suggestions: ").append(toIndentedString(suggestions)).append("\n"); + sb.append(" subscription: ").append(toIndentedString(subscription)).append("\n"); + sb.append(" privacyPolicy: ").append(toIndentedString(privacyPolicy)).append("\n"); + sb.append(" piNInfo: ").append(toIndentedString(piNInfo)).append("\n"); + sb.append(" addresses: ").append(toIndentedString(addresses)).append("\n"); + sb.append(" positions: ").append(toIndentedString(positions)).append("\n"); + sb.append(" educations: ").append(toIndentedString(educations)).append("\n"); + sb.append(" phoneNumbers: ").append(toIndentedString(phoneNumbers)).append("\n"); + sb.append(" imAccounts: ").append(toIndentedString(imAccounts)).append("\n"); + sb.append(" interests: ").append(toIndentedString(interests)).append("\n"); + sb.append(" sports: ").append(toIndentedString(sports)).append("\n"); + sb.append(" inspirationalPeople: ").append(toIndentedString(inspirationalPeople)).append("\n"); + sb.append(" awards: ").append(toIndentedString(awards)).append("\n"); + sb.append(" skills: ").append(toIndentedString(skills)).append("\n"); + sb.append(" currentStatus: ").append(toIndentedString(currentStatus)).append("\n"); + sb.append(" certifications: ").append(toIndentedString(certifications)).append("\n"); + sb.append(" courses: ").append(toIndentedString(courses)).append("\n"); + sb.append(" volunteer: ").append(toIndentedString(volunteer)).append("\n"); + sb.append(" recommendationsReceived: ").append(toIndentedString(recommendationsReceived)).append("\n"); + sb.append(" languages: ").append(toIndentedString(languages)).append("\n"); + sb.append(" projects: ").append(toIndentedString(projects)).append("\n"); + sb.append(" games: ").append(toIndentedString(games)).append("\n"); + sb.append(" family: ").append(toIndentedString(family)).append("\n"); + sb.append(" teleVisionShow: ").append(toIndentedString(teleVisionShow)).append("\n"); + sb.append(" mutualFriends: ").append(toIndentedString(mutualFriends)).append("\n"); + sb.append(" movies: ").append(toIndentedString(movies)).append("\n"); + sb.append(" books: ").append(toIndentedString(books)).append("\n"); + sb.append(" patents: ").append(toIndentedString(patents)).append("\n"); + sb.append(" favoriteThings: ").append(toIndentedString(favoriteThings)).append("\n"); + sb.append(" relatedProfileViews: ").append(toIndentedString(relatedProfileViews)).append("\n"); + sb.append(" placesLived: ").append(toIndentedString(placesLived)).append("\n"); + sb.append(" publications: ").append(toIndentedString(publications)).append("\n"); + sb.append(" jobBookmarks: ").append(toIndentedString(jobBookmarks)).append("\n"); + sb.append(" badges: ").append(toIndentedString(badges)).append("\n"); + sb.append(" memberUrlResources: ").append(toIndentedString(memberUrlResources)).append("\n"); + sb.append(" externalIds: ").append(toIndentedString(externalIds)).append("\n"); + sb.append(" isEmailSubscribed: ").append(toIndentedString(isEmailSubscribed)).append("\n"); + sb.append(" isProtected: ").append(toIndentedString(isProtected)).append("\n"); + sb.append(" hireable: ").append(toIndentedString(hireable)).append("\n"); + sb.append(" isTwoFactorAuthenticationEnabled: ").append(toIndentedString(isTwoFactorAuthenticationEnabled)).append("\n"); + sb.append(" disableLogin: ").append(toIndentedString(disableLogin)).append("\n"); + sb.append(" acceptPrivacyPolicy: ").append(toIndentedString(acceptPrivacyPolicy)).append("\n"); + sb.append(" recaptchaResponseField: ").append(toIndentedString(recaptchaResponseField)).append("\n"); + sb.append(" recaptchaChallengeField: ").append(toIndentedString(recaptchaChallengeField)).append("\n"); + sb.append(" captchaModel: ").append(toIndentedString(captchaModel)).append("\n"); + sb.append(" registrationSource: ").append(toIndentedString(registrationSource)).append("\n"); + sb.append(" fullName: ").append(toIndentedString(fullName)).append("\n"); + sb.append(" consents: ").append(toIndentedString(consents)).append("\n"); + sb.append(" password: ").append(toIndentedString(password)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("g-recaptcha-response"); + openapiFields.add("qq_captcha_ticket"); + openapiFields.add("qq_captcha_randstr"); + openapiFields.add("h-captcha-response"); + openapiFields.add("UserName"); + openapiFields.add("PhoneId"); + openapiFields.add("Gender"); + openapiFields.add("BirthDate"); + openapiFields.add("Prefix"); + openapiFields.add("FirstName"); + openapiFields.add("MiddleName"); + openapiFields.add("LastName"); + openapiFields.add("Suffix"); + openapiFields.add("NickName"); + openapiFields.add("ProfileName"); + openapiFields.add("About"); + openapiFields.add("Company"); + openapiFields.add("ImageUrl"); + openapiFields.add("TimeZone"); + openapiFields.add("Website"); + openapiFields.add("ThumbnailImageUrl"); + openapiFields.add("Favicon"); + openapiFields.add("ProfileUrl"); + openapiFields.add("HomeTown"); + openapiFields.add("State"); + openapiFields.add("City"); + openapiFields.add("Industry"); + openapiFields.add("LocalLanguage"); + openapiFields.add("Language"); + openapiFields.add("CoverPhoto"); + openapiFields.add("TagLine"); + openapiFields.add("MainAddress"); + openapiFields.add("LocalCity"); + openapiFields.add("ProfileCity"); + openapiFields.add("LocalCountry"); + openapiFields.add("ProfileCountry"); + openapiFields.add("Quota"); + openapiFields.add("Religion"); + openapiFields.add("Political"); + openapiFields.add("RelationshipStatus"); + openapiFields.add("HttpsImageUrl"); + openapiFields.add("IsGeoEnabled"); + openapiFields.add("Associations"); + openapiFields.add("Honors"); + openapiFields.add("PublicRepository"); + openapiFields.add("RepositoryUrl"); + openapiFields.add("ProfessionalHeadline"); + openapiFields.add("Currency"); + openapiFields.add("StarredUrl"); + openapiFields.add("GistsUrl"); + openapiFields.add("GravatarImageUrl"); + openapiFields.add("ExternalUserLoginId"); + openapiFields.add("InterestedIn"); + openapiFields.add("FollowersCount"); + openapiFields.add("FriendsCount"); + openapiFields.add("TotalStatusesCount"); + openapiFields.add("NumRecommenders"); + openapiFields.add("TotalPrivateRepository"); + openapiFields.add("PublicGists"); + openapiFields.add("PrivateGists"); + openapiFields.add("SessionLimit"); + openapiFields.add("CustomFields"); + openapiFields.add("ProfileImageUrls"); + openapiFields.add("WebProfiles"); + openapiFields.add("SecurityQuestionAnswer"); + openapiFields.add("Country"); + openapiFields.add("ProviderAccessCredential"); + openapiFields.add("Suggestions"); + openapiFields.add("Subscription"); + openapiFields.add("PrivacyPolicy"); + openapiFields.add("PINInfo"); + openapiFields.add("Addresses"); + openapiFields.add("Positions"); + openapiFields.add("Educations"); + openapiFields.add("PhoneNumbers"); + openapiFields.add("IMAccounts"); + openapiFields.add("Interests"); + openapiFields.add("Sports"); + openapiFields.add("InspirationalPeople"); + openapiFields.add("Awards"); + openapiFields.add("Skills"); + openapiFields.add("CurrentStatus"); + openapiFields.add("Certifications"); + openapiFields.add("Courses"); + openapiFields.add("Volunteer"); + openapiFields.add("RecommendationsReceived"); + openapiFields.add("Languages"); + openapiFields.add("Projects"); + openapiFields.add("Games"); + openapiFields.add("Family"); + openapiFields.add("TeleVisionShow"); + openapiFields.add("MutualFriends"); + openapiFields.add("Movies"); + openapiFields.add("Books"); + openapiFields.add("Patents"); + openapiFields.add("FavoriteThings"); + openapiFields.add("RelatedProfileViews"); + openapiFields.add("PlacesLived"); + openapiFields.add("Publications"); + openapiFields.add("JobBookmarks"); + openapiFields.add("Badges"); + openapiFields.add("MemberUrlResources"); + openapiFields.add("ExternalIds"); + openapiFields.add("IsEmailSubscribed"); + openapiFields.add("IsProtected"); + openapiFields.add("Hireable"); + openapiFields.add("IsTwoFactorAuthenticationEnabled"); + openapiFields.add("DisableLogin"); + openapiFields.add("AcceptPrivacyPolicy"); + openapiFields.add("recaptcha_response_field"); + openapiFields.add("recaptcha_challenge_field"); + openapiFields.add("CaptchaModel"); + openapiFields.add("RegistrationSource"); + openapiFields.add("FullName"); + openapiFields.add("Consents"); + openapiFields.add("Password"); + openapiFields.add("Email"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 UserRegistrationByReCaptchaEmailPhoneUserNameRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserRegistrationByReCaptchaEmailPhoneUserNameRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserRegistrationByReCaptchaEmailPhoneUserNameRequest is not found in the empty JSON string", UserRegistrationByReCaptchaEmailPhoneUserNameRequest.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("g-recaptcha-response") != null && !jsonObj.get("g-recaptcha-response").isJsonNull()) && !jsonObj.get("g-recaptcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `g-recaptcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("g-recaptcha-response").toString())); + } + if ((jsonObj.get("qq_captcha_ticket") != null && !jsonObj.get("qq_captcha_ticket").isJsonNull()) && !jsonObj.get("qq_captcha_ticket").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_ticket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_ticket").toString())); + } + if ((jsonObj.get("qq_captcha_randstr") != null && !jsonObj.get("qq_captcha_randstr").isJsonNull()) && !jsonObj.get("qq_captcha_randstr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_randstr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_randstr").toString())); + } + if ((jsonObj.get("h-captcha-response") != null && !jsonObj.get("h-captcha-response").isJsonNull()) && !jsonObj.get("h-captcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `h-captcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("h-captcha-response").toString())); + } + if ((jsonObj.get("UserName") != null && !jsonObj.get("UserName").isJsonNull()) && !jsonObj.get("UserName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UserName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UserName").toString())); + } + if ((jsonObj.get("PhoneId") != null && !jsonObj.get("PhoneId").isJsonNull()) && !jsonObj.get("PhoneId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PhoneId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PhoneId").toString())); + } + if ((jsonObj.get("Gender") != null && !jsonObj.get("Gender").isJsonNull()) && !jsonObj.get("Gender").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Gender` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Gender").toString())); + } + if ((jsonObj.get("BirthDate") != null && !jsonObj.get("BirthDate").isJsonNull()) && !jsonObj.get("BirthDate").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `BirthDate` to be a primitive type in the JSON string but got `%s`", jsonObj.get("BirthDate").toString())); + } + if ((jsonObj.get("Prefix") != null && !jsonObj.get("Prefix").isJsonNull()) && !jsonObj.get("Prefix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Prefix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Prefix").toString())); + } + if ((jsonObj.get("FirstName") != null && !jsonObj.get("FirstName").isJsonNull()) && !jsonObj.get("FirstName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FirstName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FirstName").toString())); + } + if ((jsonObj.get("MiddleName") != null && !jsonObj.get("MiddleName").isJsonNull()) && !jsonObj.get("MiddleName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MiddleName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MiddleName").toString())); + } + if ((jsonObj.get("LastName") != null && !jsonObj.get("LastName").isJsonNull()) && !jsonObj.get("LastName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LastName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LastName").toString())); + } + if ((jsonObj.get("Suffix") != null && !jsonObj.get("Suffix").isJsonNull()) && !jsonObj.get("Suffix").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Suffix` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Suffix").toString())); + } + if ((jsonObj.get("NickName") != null && !jsonObj.get("NickName").isJsonNull()) && !jsonObj.get("NickName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `NickName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("NickName").toString())); + } + if ((jsonObj.get("ProfileName") != null && !jsonObj.get("ProfileName").isJsonNull()) && !jsonObj.get("ProfileName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileName").toString())); + } + if ((jsonObj.get("About") != null && !jsonObj.get("About").isJsonNull()) && !jsonObj.get("About").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `About` to be a primitive type in the JSON string but got `%s`", jsonObj.get("About").toString())); + } + if ((jsonObj.get("Company") != null && !jsonObj.get("Company").isJsonNull()) && !jsonObj.get("Company").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Company` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Company").toString())); + } + if ((jsonObj.get("ImageUrl") != null && !jsonObj.get("ImageUrl").isJsonNull()) && !jsonObj.get("ImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ImageUrl").toString())); + } + if ((jsonObj.get("TimeZone") != null && !jsonObj.get("TimeZone").isJsonNull()) && !jsonObj.get("TimeZone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TimeZone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TimeZone").toString())); + } + if ((jsonObj.get("Website") != null && !jsonObj.get("Website").isJsonNull()) && !jsonObj.get("Website").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Website` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Website").toString())); + } + if ((jsonObj.get("ThumbnailImageUrl") != null && !jsonObj.get("ThumbnailImageUrl").isJsonNull()) && !jsonObj.get("ThumbnailImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ThumbnailImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ThumbnailImageUrl").toString())); + } + if ((jsonObj.get("Favicon") != null && !jsonObj.get("Favicon").isJsonNull()) && !jsonObj.get("Favicon").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Favicon` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Favicon").toString())); + } + if ((jsonObj.get("ProfileUrl") != null && !jsonObj.get("ProfileUrl").isJsonNull()) && !jsonObj.get("ProfileUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileUrl").toString())); + } + if ((jsonObj.get("HomeTown") != null && !jsonObj.get("HomeTown").isJsonNull()) && !jsonObj.get("HomeTown").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HomeTown` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HomeTown").toString())); + } + if ((jsonObj.get("State") != null && !jsonObj.get("State").isJsonNull()) && !jsonObj.get("State").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `State` to be a primitive type in the JSON string but got `%s`", jsonObj.get("State").toString())); + } + if ((jsonObj.get("City") != null && !jsonObj.get("City").isJsonNull()) && !jsonObj.get("City").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `City` to be a primitive type in the JSON string but got `%s`", jsonObj.get("City").toString())); + } + if ((jsonObj.get("Industry") != null && !jsonObj.get("Industry").isJsonNull()) && !jsonObj.get("Industry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Industry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Industry").toString())); + } + if ((jsonObj.get("LocalLanguage") != null && !jsonObj.get("LocalLanguage").isJsonNull()) && !jsonObj.get("LocalLanguage").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalLanguage` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalLanguage").toString())); + } + if ((jsonObj.get("Language") != null && !jsonObj.get("Language").isJsonNull()) && !jsonObj.get("Language").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Language` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Language").toString())); + } + if ((jsonObj.get("CoverPhoto") != null && !jsonObj.get("CoverPhoto").isJsonNull()) && !jsonObj.get("CoverPhoto").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CoverPhoto` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CoverPhoto").toString())); + } + if ((jsonObj.get("TagLine") != null && !jsonObj.get("TagLine").isJsonNull()) && !jsonObj.get("TagLine").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TagLine` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TagLine").toString())); + } + if ((jsonObj.get("MainAddress") != null && !jsonObj.get("MainAddress").isJsonNull()) && !jsonObj.get("MainAddress").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `MainAddress` to be a primitive type in the JSON string but got `%s`", jsonObj.get("MainAddress").toString())); + } + if ((jsonObj.get("LocalCity") != null && !jsonObj.get("LocalCity").isJsonNull()) && !jsonObj.get("LocalCity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalCity").toString())); + } + if ((jsonObj.get("ProfileCity") != null && !jsonObj.get("ProfileCity").isJsonNull()) && !jsonObj.get("ProfileCity").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileCity` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileCity").toString())); + } + if ((jsonObj.get("LocalCountry") != null && !jsonObj.get("LocalCountry").isJsonNull()) && !jsonObj.get("LocalCountry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `LocalCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("LocalCountry").toString())); + } + if ((jsonObj.get("ProfileCountry") != null && !jsonObj.get("ProfileCountry").isJsonNull()) && !jsonObj.get("ProfileCountry").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfileCountry` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfileCountry").toString())); + } + if ((jsonObj.get("Quota") != null && !jsonObj.get("Quota").isJsonNull()) && !jsonObj.get("Quota").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Quota` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Quota").toString())); + } + if ((jsonObj.get("Religion") != null && !jsonObj.get("Religion").isJsonNull()) && !jsonObj.get("Religion").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Religion` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Religion").toString())); + } + if ((jsonObj.get("Political") != null && !jsonObj.get("Political").isJsonNull()) && !jsonObj.get("Political").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Political` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Political").toString())); + } + if ((jsonObj.get("RelationshipStatus") != null && !jsonObj.get("RelationshipStatus").isJsonNull()) && !jsonObj.get("RelationshipStatus").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RelationshipStatus` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RelationshipStatus").toString())); + } + if ((jsonObj.get("HttpsImageUrl") != null && !jsonObj.get("HttpsImageUrl").isJsonNull()) && !jsonObj.get("HttpsImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HttpsImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HttpsImageUrl").toString())); + } + if ((jsonObj.get("IsGeoEnabled") != null && !jsonObj.get("IsGeoEnabled").isJsonNull()) && !jsonObj.get("IsGeoEnabled").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `IsGeoEnabled` to be a primitive type in the JSON string but got `%s`", jsonObj.get("IsGeoEnabled").toString())); + } + if ((jsonObj.get("Associations") != null && !jsonObj.get("Associations").isJsonNull()) && !jsonObj.get("Associations").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Associations` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Associations").toString())); + } + if ((jsonObj.get("Honors") != null && !jsonObj.get("Honors").isJsonNull()) && !jsonObj.get("Honors").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Honors` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Honors").toString())); + } + if ((jsonObj.get("PublicRepository") != null && !jsonObj.get("PublicRepository").isJsonNull()) && !jsonObj.get("PublicRepository").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `PublicRepository` to be a primitive type in the JSON string but got `%s`", jsonObj.get("PublicRepository").toString())); + } + if ((jsonObj.get("RepositoryUrl") != null && !jsonObj.get("RepositoryUrl").isJsonNull()) && !jsonObj.get("RepositoryUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RepositoryUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RepositoryUrl").toString())); + } + if ((jsonObj.get("ProfessionalHeadline") != null && !jsonObj.get("ProfessionalHeadline").isJsonNull()) && !jsonObj.get("ProfessionalHeadline").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ProfessionalHeadline` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ProfessionalHeadline").toString())); + } + if ((jsonObj.get("Currency") != null && !jsonObj.get("Currency").isJsonNull()) && !jsonObj.get("Currency").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Currency` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Currency").toString())); + } + if ((jsonObj.get("StarredUrl") != null && !jsonObj.get("StarredUrl").isJsonNull()) && !jsonObj.get("StarredUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `StarredUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("StarredUrl").toString())); + } + if ((jsonObj.get("GistsUrl") != null && !jsonObj.get("GistsUrl").isJsonNull()) && !jsonObj.get("GistsUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GistsUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GistsUrl").toString())); + } + if ((jsonObj.get("GravatarImageUrl") != null && !jsonObj.get("GravatarImageUrl").isJsonNull()) && !jsonObj.get("GravatarImageUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GravatarImageUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GravatarImageUrl").toString())); + } + if ((jsonObj.get("ExternalUserLoginId") != null && !jsonObj.get("ExternalUserLoginId").isJsonNull()) && !jsonObj.get("ExternalUserLoginId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ExternalUserLoginId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ExternalUserLoginId").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("InterestedIn") != null && !jsonObj.get("InterestedIn").isJsonNull() && !jsonObj.get("InterestedIn").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `InterestedIn` to be an array in the JSON string but got `%s`", jsonObj.get("InterestedIn").toString())); + } + // validate the optional field `Country` + if (jsonObj.get("Country") != null && !jsonObj.get("Country").isJsonNull()) { + ProfileRequestModelCountry.validateJsonElement(jsonObj.get("Country")); + } + // validate the optional field `ProviderAccessCredential` + if (jsonObj.get("ProviderAccessCredential") != null && !jsonObj.get("ProviderAccessCredential").isJsonNull()) { + ProfileRequestModelProviderAccessCredential.validateJsonElement(jsonObj.get("ProviderAccessCredential")); + } + // validate the optional field `Suggestions` + if (jsonObj.get("Suggestions") != null && !jsonObj.get("Suggestions").isJsonNull()) { + ProfileRequestModelSuggestions.validateJsonElement(jsonObj.get("Suggestions")); + } + // validate the optional field `Subscription` + if (jsonObj.get("Subscription") != null && !jsonObj.get("Subscription").isJsonNull()) { + ProfileRequestModelSubscription.validateJsonElement(jsonObj.get("Subscription")); + } + // validate the optional field `PrivacyPolicy` + if (jsonObj.get("PrivacyPolicy") != null && !jsonObj.get("PrivacyPolicy").isJsonNull()) { + ProfileRequestModelPrivacyPolicy.validateJsonElement(jsonObj.get("PrivacyPolicy")); + } + // validate the optional field `PINInfo` + if (jsonObj.get("PINInfo") != null && !jsonObj.get("PINInfo").isJsonNull()) { + ProfileRequestModelPINInfo.validateJsonElement(jsonObj.get("PINInfo")); + } + if (jsonObj.get("Addresses") != null && !jsonObj.get("Addresses").isJsonNull()) { + JsonArray jsonArrayaddresses = jsonObj.getAsJsonArray("Addresses"); + if (jsonArrayaddresses != null) { + // ensure the json data is an array + if (!jsonObj.get("Addresses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Addresses` to be an array in the JSON string but got `%s`", jsonObj.get("Addresses").toString())); + } + + // validate the optional field `Addresses` (array) + for (int i = 0; i < jsonArrayaddresses.size(); i++) { + ProfileRequestModelAddressesInner.validateJsonElement(jsonArrayaddresses.get(i)); + }; + } + } + if (jsonObj.get("Positions") != null && !jsonObj.get("Positions").isJsonNull()) { + JsonArray jsonArraypositions = jsonObj.getAsJsonArray("Positions"); + if (jsonArraypositions != null) { + // ensure the json data is an array + if (!jsonObj.get("Positions").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Positions` to be an array in the JSON string but got `%s`", jsonObj.get("Positions").toString())); + } + + // validate the optional field `Positions` (array) + for (int i = 0; i < jsonArraypositions.size(); i++) { + ProfileRequestModelPositionsInner.validateJsonElement(jsonArraypositions.get(i)); + }; + } + } + if (jsonObj.get("Educations") != null && !jsonObj.get("Educations").isJsonNull()) { + JsonArray jsonArrayeducations = jsonObj.getAsJsonArray("Educations"); + if (jsonArrayeducations != null) { + // ensure the json data is an array + if (!jsonObj.get("Educations").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Educations` to be an array in the JSON string but got `%s`", jsonObj.get("Educations").toString())); + } + + // validate the optional field `Educations` (array) + for (int i = 0; i < jsonArrayeducations.size(); i++) { + ProfileRequestModelEducationsInner.validateJsonElement(jsonArrayeducations.get(i)); + }; + } + } + if (jsonObj.get("PhoneNumbers") != null && !jsonObj.get("PhoneNumbers").isJsonNull()) { + JsonArray jsonArrayphoneNumbers = jsonObj.getAsJsonArray("PhoneNumbers"); + if (jsonArrayphoneNumbers != null) { + // ensure the json data is an array + if (!jsonObj.get("PhoneNumbers").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PhoneNumbers` to be an array in the JSON string but got `%s`", jsonObj.get("PhoneNumbers").toString())); + } + + // validate the optional field `PhoneNumbers` (array) + for (int i = 0; i < jsonArrayphoneNumbers.size(); i++) { + ProfileRequestModelPhoneNumbersInner.validateJsonElement(jsonArrayphoneNumbers.get(i)); + }; + } + } + if (jsonObj.get("IMAccounts") != null && !jsonObj.get("IMAccounts").isJsonNull()) { + JsonArray jsonArrayimAccounts = jsonObj.getAsJsonArray("IMAccounts"); + if (jsonArrayimAccounts != null) { + // ensure the json data is an array + if (!jsonObj.get("IMAccounts").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `IMAccounts` to be an array in the JSON string but got `%s`", jsonObj.get("IMAccounts").toString())); + } + + // validate the optional field `IMAccounts` (array) + for (int i = 0; i < jsonArrayimAccounts.size(); i++) { + ProfileRequestModelIMAccountsInner.validateJsonElement(jsonArrayimAccounts.get(i)); + }; + } + } + if (jsonObj.get("Interests") != null && !jsonObj.get("Interests").isJsonNull()) { + JsonArray jsonArrayinterests = jsonObj.getAsJsonArray("Interests"); + if (jsonArrayinterests != null) { + // ensure the json data is an array + if (!jsonObj.get("Interests").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Interests` to be an array in the JSON string but got `%s`", jsonObj.get("Interests").toString())); + } + + // validate the optional field `Interests` (array) + for (int i = 0; i < jsonArrayinterests.size(); i++) { + ProfileRequestModelInterestsInner.validateJsonElement(jsonArrayinterests.get(i)); + }; + } + } + if (jsonObj.get("Sports") != null && !jsonObj.get("Sports").isJsonNull()) { + JsonArray jsonArraysports = jsonObj.getAsJsonArray("Sports"); + if (jsonArraysports != null) { + // ensure the json data is an array + if (!jsonObj.get("Sports").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Sports` to be an array in the JSON string but got `%s`", jsonObj.get("Sports").toString())); + } + + // validate the optional field `Sports` (array) + for (int i = 0; i < jsonArraysports.size(); i++) { + ProfileRequestModelSportsInner.validateJsonElement(jsonArraysports.get(i)); + }; + } + } + if (jsonObj.get("InspirationalPeople") != null && !jsonObj.get("InspirationalPeople").isJsonNull()) { + JsonArray jsonArrayinspirationalPeople = jsonObj.getAsJsonArray("InspirationalPeople"); + if (jsonArrayinspirationalPeople != null) { + // ensure the json data is an array + if (!jsonObj.get("InspirationalPeople").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `InspirationalPeople` to be an array in the JSON string but got `%s`", jsonObj.get("InspirationalPeople").toString())); + } + + // validate the optional field `InspirationalPeople` (array) + for (int i = 0; i < jsonArrayinspirationalPeople.size(); i++) { + ProfileRequestModelInspirationalPeopleInner.validateJsonElement(jsonArrayinspirationalPeople.get(i)); + }; + } + } + if (jsonObj.get("Awards") != null && !jsonObj.get("Awards").isJsonNull()) { + JsonArray jsonArrayawards = jsonObj.getAsJsonArray("Awards"); + if (jsonArrayawards != null) { + // ensure the json data is an array + if (!jsonObj.get("Awards").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Awards` to be an array in the JSON string but got `%s`", jsonObj.get("Awards").toString())); + } + + // validate the optional field `Awards` (array) + for (int i = 0; i < jsonArrayawards.size(); i++) { + ProfileRequestModelAwardsInner.validateJsonElement(jsonArrayawards.get(i)); + }; + } + } + if (jsonObj.get("Skills") != null && !jsonObj.get("Skills").isJsonNull()) { + JsonArray jsonArrayskills = jsonObj.getAsJsonArray("Skills"); + if (jsonArrayskills != null) { + // ensure the json data is an array + if (!jsonObj.get("Skills").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Skills` to be an array in the JSON string but got `%s`", jsonObj.get("Skills").toString())); + } + + // validate the optional field `Skills` (array) + for (int i = 0; i < jsonArrayskills.size(); i++) { + ProfileRequestModelSkillsInner.validateJsonElement(jsonArrayskills.get(i)); + }; + } + } + if (jsonObj.get("CurrentStatus") != null && !jsonObj.get("CurrentStatus").isJsonNull()) { + JsonArray jsonArraycurrentStatus = jsonObj.getAsJsonArray("CurrentStatus"); + if (jsonArraycurrentStatus != null) { + // ensure the json data is an array + if (!jsonObj.get("CurrentStatus").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `CurrentStatus` to be an array in the JSON string but got `%s`", jsonObj.get("CurrentStatus").toString())); + } + + // validate the optional field `CurrentStatus` (array) + for (int i = 0; i < jsonArraycurrentStatus.size(); i++) { + ProfileRequestModelCurrentStatusInner.validateJsonElement(jsonArraycurrentStatus.get(i)); + }; + } + } + if (jsonObj.get("Certifications") != null && !jsonObj.get("Certifications").isJsonNull()) { + JsonArray jsonArraycertifications = jsonObj.getAsJsonArray("Certifications"); + if (jsonArraycertifications != null) { + // ensure the json data is an array + if (!jsonObj.get("Certifications").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Certifications` to be an array in the JSON string but got `%s`", jsonObj.get("Certifications").toString())); + } + + // validate the optional field `Certifications` (array) + for (int i = 0; i < jsonArraycertifications.size(); i++) { + ProfileRequestModelCertificationsInner.validateJsonElement(jsonArraycertifications.get(i)); + }; + } + } + if (jsonObj.get("Courses") != null && !jsonObj.get("Courses").isJsonNull()) { + JsonArray jsonArraycourses = jsonObj.getAsJsonArray("Courses"); + if (jsonArraycourses != null) { + // ensure the json data is an array + if (!jsonObj.get("Courses").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Courses` to be an array in the JSON string but got `%s`", jsonObj.get("Courses").toString())); + } + + // validate the optional field `Courses` (array) + for (int i = 0; i < jsonArraycourses.size(); i++) { + ProfileRequestModelCoursesInner.validateJsonElement(jsonArraycourses.get(i)); + }; + } + } + if (jsonObj.get("Volunteer") != null && !jsonObj.get("Volunteer").isJsonNull()) { + JsonArray jsonArrayvolunteer = jsonObj.getAsJsonArray("Volunteer"); + if (jsonArrayvolunteer != null) { + // ensure the json data is an array + if (!jsonObj.get("Volunteer").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Volunteer` to be an array in the JSON string but got `%s`", jsonObj.get("Volunteer").toString())); + } + + // validate the optional field `Volunteer` (array) + for (int i = 0; i < jsonArrayvolunteer.size(); i++) { + ProfileRequestModelVolunteerInner.validateJsonElement(jsonArrayvolunteer.get(i)); + }; + } + } + if (jsonObj.get("RecommendationsReceived") != null && !jsonObj.get("RecommendationsReceived").isJsonNull()) { + JsonArray jsonArrayrecommendationsReceived = jsonObj.getAsJsonArray("RecommendationsReceived"); + if (jsonArrayrecommendationsReceived != null) { + // ensure the json data is an array + if (!jsonObj.get("RecommendationsReceived").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RecommendationsReceived` to be an array in the JSON string but got `%s`", jsonObj.get("RecommendationsReceived").toString())); + } + + // validate the optional field `RecommendationsReceived` (array) + for (int i = 0; i < jsonArrayrecommendationsReceived.size(); i++) { + ProfileRequestModelRecommendationsReceivedInner.validateJsonElement(jsonArrayrecommendationsReceived.get(i)); + }; + } + } + if (jsonObj.get("Languages") != null && !jsonObj.get("Languages").isJsonNull()) { + JsonArray jsonArraylanguages = jsonObj.getAsJsonArray("Languages"); + if (jsonArraylanguages != null) { + // ensure the json data is an array + if (!jsonObj.get("Languages").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Languages` to be an array in the JSON string but got `%s`", jsonObj.get("Languages").toString())); + } + + // validate the optional field `Languages` (array) + for (int i = 0; i < jsonArraylanguages.size(); i++) { + ProfileRequestModelLanguagesInner.validateJsonElement(jsonArraylanguages.get(i)); + }; + } + } + if (jsonObj.get("Projects") != null && !jsonObj.get("Projects").isJsonNull()) { + JsonArray jsonArrayprojects = jsonObj.getAsJsonArray("Projects"); + if (jsonArrayprojects != null) { + // ensure the json data is an array + if (!jsonObj.get("Projects").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Projects` to be an array in the JSON string but got `%s`", jsonObj.get("Projects").toString())); + } + + // validate the optional field `Projects` (array) + for (int i = 0; i < jsonArrayprojects.size(); i++) { + ProfileRequestModelProjectsInner.validateJsonElement(jsonArrayprojects.get(i)); + }; + } + } + if (jsonObj.get("Games") != null && !jsonObj.get("Games").isJsonNull()) { + JsonArray jsonArraygames = jsonObj.getAsJsonArray("Games"); + if (jsonArraygames != null) { + // ensure the json data is an array + if (!jsonObj.get("Games").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Games` to be an array in the JSON string but got `%s`", jsonObj.get("Games").toString())); + } + + // validate the optional field `Games` (array) + for (int i = 0; i < jsonArraygames.size(); i++) { + ProfileRequestModelGamesInner.validateJsonElement(jsonArraygames.get(i)); + }; + } + } + if (jsonObj.get("Family") != null && !jsonObj.get("Family").isJsonNull()) { + JsonArray jsonArrayfamily = jsonObj.getAsJsonArray("Family"); + if (jsonArrayfamily != null) { + // ensure the json data is an array + if (!jsonObj.get("Family").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Family` to be an array in the JSON string but got `%s`", jsonObj.get("Family").toString())); + } + + // validate the optional field `Family` (array) + for (int i = 0; i < jsonArrayfamily.size(); i++) { + ProfileRequestModelFamilyInner.validateJsonElement(jsonArrayfamily.get(i)); + }; + } + } + if (jsonObj.get("TeleVisionShow") != null && !jsonObj.get("TeleVisionShow").isJsonNull()) { + JsonArray jsonArrayteleVisionShow = jsonObj.getAsJsonArray("TeleVisionShow"); + if (jsonArrayteleVisionShow != null) { + // ensure the json data is an array + if (!jsonObj.get("TeleVisionShow").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `TeleVisionShow` to be an array in the JSON string but got `%s`", jsonObj.get("TeleVisionShow").toString())); + } + + // validate the optional field `TeleVisionShow` (array) + for (int i = 0; i < jsonArrayteleVisionShow.size(); i++) { + ProfileRequestModelTeleVisionShowInner.validateJsonElement(jsonArrayteleVisionShow.get(i)); + }; + } + } + if (jsonObj.get("MutualFriends") != null && !jsonObj.get("MutualFriends").isJsonNull()) { + JsonArray jsonArraymutualFriends = jsonObj.getAsJsonArray("MutualFriends"); + if (jsonArraymutualFriends != null) { + // ensure the json data is an array + if (!jsonObj.get("MutualFriends").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `MutualFriends` to be an array in the JSON string but got `%s`", jsonObj.get("MutualFriends").toString())); + } + + // validate the optional field `MutualFriends` (array) + for (int i = 0; i < jsonArraymutualFriends.size(); i++) { + ProfileRequestModelMutualFriendsInner.validateJsonElement(jsonArraymutualFriends.get(i)); + }; + } + } + if (jsonObj.get("Movies") != null && !jsonObj.get("Movies").isJsonNull()) { + JsonArray jsonArraymovies = jsonObj.getAsJsonArray("Movies"); + if (jsonArraymovies != null) { + // ensure the json data is an array + if (!jsonObj.get("Movies").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Movies` to be an array in the JSON string but got `%s`", jsonObj.get("Movies").toString())); + } + + // validate the optional field `Movies` (array) + for (int i = 0; i < jsonArraymovies.size(); i++) { + ProfileRequestModelMoviesInner.validateJsonElement(jsonArraymovies.get(i)); + }; + } + } + if (jsonObj.get("Books") != null && !jsonObj.get("Books").isJsonNull()) { + JsonArray jsonArraybooks = jsonObj.getAsJsonArray("Books"); + if (jsonArraybooks != null) { + // ensure the json data is an array + if (!jsonObj.get("Books").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Books` to be an array in the JSON string but got `%s`", jsonObj.get("Books").toString())); + } + + // validate the optional field `Books` (array) + for (int i = 0; i < jsonArraybooks.size(); i++) { + ProfileRequestModelBooksInner.validateJsonElement(jsonArraybooks.get(i)); + }; + } + } + if (jsonObj.get("Patents") != null && !jsonObj.get("Patents").isJsonNull()) { + JsonArray jsonArraypatents = jsonObj.getAsJsonArray("Patents"); + if (jsonArraypatents != null) { + // ensure the json data is an array + if (!jsonObj.get("Patents").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Patents` to be an array in the JSON string but got `%s`", jsonObj.get("Patents").toString())); + } + + // validate the optional field `Patents` (array) + for (int i = 0; i < jsonArraypatents.size(); i++) { + ProfileRequestModelPatentsInner.validateJsonElement(jsonArraypatents.get(i)); + }; + } + } + if (jsonObj.get("FavoriteThings") != null && !jsonObj.get("FavoriteThings").isJsonNull()) { + JsonArray jsonArrayfavoriteThings = jsonObj.getAsJsonArray("FavoriteThings"); + if (jsonArrayfavoriteThings != null) { + // ensure the json data is an array + if (!jsonObj.get("FavoriteThings").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `FavoriteThings` to be an array in the JSON string but got `%s`", jsonObj.get("FavoriteThings").toString())); + } + + // validate the optional field `FavoriteThings` (array) + for (int i = 0; i < jsonArrayfavoriteThings.size(); i++) { + ProfileRequestModelFavoriteThingsInner.validateJsonElement(jsonArrayfavoriteThings.get(i)); + }; + } + } + if (jsonObj.get("RelatedProfileViews") != null && !jsonObj.get("RelatedProfileViews").isJsonNull()) { + JsonArray jsonArrayrelatedProfileViews = jsonObj.getAsJsonArray("RelatedProfileViews"); + if (jsonArrayrelatedProfileViews != null) { + // ensure the json data is an array + if (!jsonObj.get("RelatedProfileViews").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RelatedProfileViews` to be an array in the JSON string but got `%s`", jsonObj.get("RelatedProfileViews").toString())); + } + + // validate the optional field `RelatedProfileViews` (array) + for (int i = 0; i < jsonArrayrelatedProfileViews.size(); i++) { + ProfileRequestModelRelatedProfileViewsInner.validateJsonElement(jsonArrayrelatedProfileViews.get(i)); + }; + } + } + if (jsonObj.get("PlacesLived") != null && !jsonObj.get("PlacesLived").isJsonNull()) { + JsonArray jsonArrayplacesLived = jsonObj.getAsJsonArray("PlacesLived"); + if (jsonArrayplacesLived != null) { + // ensure the json data is an array + if (!jsonObj.get("PlacesLived").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `PlacesLived` to be an array in the JSON string but got `%s`", jsonObj.get("PlacesLived").toString())); + } + + // validate the optional field `PlacesLived` (array) + for (int i = 0; i < jsonArrayplacesLived.size(); i++) { + ProfileRequestModelPlacesLivedInner.validateJsonElement(jsonArrayplacesLived.get(i)); + }; + } + } + if (jsonObj.get("Publications") != null && !jsonObj.get("Publications").isJsonNull()) { + JsonArray jsonArraypublications = jsonObj.getAsJsonArray("Publications"); + if (jsonArraypublications != null) { + // ensure the json data is an array + if (!jsonObj.get("Publications").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Publications` to be an array in the JSON string but got `%s`", jsonObj.get("Publications").toString())); + } + + // validate the optional field `Publications` (array) + for (int i = 0; i < jsonArraypublications.size(); i++) { + ProfileRequestModelPublicationsInner.validateJsonElement(jsonArraypublications.get(i)); + }; + } + } + if (jsonObj.get("JobBookmarks") != null && !jsonObj.get("JobBookmarks").isJsonNull()) { + JsonArray jsonArrayjobBookmarks = jsonObj.getAsJsonArray("JobBookmarks"); + if (jsonArrayjobBookmarks != null) { + // ensure the json data is an array + if (!jsonObj.get("JobBookmarks").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `JobBookmarks` to be an array in the JSON string but got `%s`", jsonObj.get("JobBookmarks").toString())); + } + + // validate the optional field `JobBookmarks` (array) + for (int i = 0; i < jsonArrayjobBookmarks.size(); i++) { + ProfileRequestModelJobBookmarksInner.validateJsonElement(jsonArrayjobBookmarks.get(i)); + }; + } + } + if (jsonObj.get("Badges") != null && !jsonObj.get("Badges").isJsonNull()) { + JsonArray jsonArraybadges = jsonObj.getAsJsonArray("Badges"); + if (jsonArraybadges != null) { + // ensure the json data is an array + if (!jsonObj.get("Badges").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Badges` to be an array in the JSON string but got `%s`", jsonObj.get("Badges").toString())); + } + + // validate the optional field `Badges` (array) + for (int i = 0; i < jsonArraybadges.size(); i++) { + ProfileRequestModelBadgesInner.validateJsonElement(jsonArraybadges.get(i)); + }; + } + } + if (jsonObj.get("MemberUrlResources") != null && !jsonObj.get("MemberUrlResources").isJsonNull()) { + JsonArray jsonArraymemberUrlResources = jsonObj.getAsJsonArray("MemberUrlResources"); + if (jsonArraymemberUrlResources != null) { + // ensure the json data is an array + if (!jsonObj.get("MemberUrlResources").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `MemberUrlResources` to be an array in the JSON string but got `%s`", jsonObj.get("MemberUrlResources").toString())); + } + + // validate the optional field `MemberUrlResources` (array) + for (int i = 0; i < jsonArraymemberUrlResources.size(); i++) { + ProfileRequestModelMemberUrlResourcesInner.validateJsonElement(jsonArraymemberUrlResources.get(i)); + }; + } + } + if (jsonObj.get("ExternalIds") != null && !jsonObj.get("ExternalIds").isJsonNull()) { + JsonArray jsonArrayexternalIds = jsonObj.getAsJsonArray("ExternalIds"); + if (jsonArrayexternalIds != null) { + // ensure the json data is an array + if (!jsonObj.get("ExternalIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `ExternalIds` to be an array in the JSON string but got `%s`", jsonObj.get("ExternalIds").toString())); + } + + // validate the optional field `ExternalIds` (array) + for (int i = 0; i < jsonArrayexternalIds.size(); i++) { + ProfileRequestModelExternalIdsInner.validateJsonElement(jsonArrayexternalIds.get(i)); + }; + } + } + if ((jsonObj.get("recaptcha_response_field") != null && !jsonObj.get("recaptcha_response_field").isJsonNull()) && !jsonObj.get("recaptcha_response_field").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recaptcha_response_field` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recaptcha_response_field").toString())); + } + if ((jsonObj.get("recaptcha_challenge_field") != null && !jsonObj.get("recaptcha_challenge_field").isJsonNull()) && !jsonObj.get("recaptcha_challenge_field").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `recaptcha_challenge_field` to be a primitive type in the JSON string but got `%s`", jsonObj.get("recaptcha_challenge_field").toString())); + } + // validate the optional field `CaptchaModel` + if (jsonObj.get("CaptchaModel") != null && !jsonObj.get("CaptchaModel").isJsonNull()) { + ProfileRequestModelCaptchaModel.validateJsonElement(jsonObj.get("CaptchaModel")); + } + if ((jsonObj.get("RegistrationSource") != null && !jsonObj.get("RegistrationSource").isJsonNull()) && !jsonObj.get("RegistrationSource").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RegistrationSource` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RegistrationSource").toString())); + } + if ((jsonObj.get("FullName") != null && !jsonObj.get("FullName").isJsonNull()) && !jsonObj.get("FullName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `FullName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("FullName").toString())); + } + // validate the optional field `Consents` + if (jsonObj.get("Consents") != null && !jsonObj.get("Consents").isJsonNull()) { + ProfileRequestModelConsents.validateJsonElement(jsonObj.get("Consents")); + } + if ((jsonObj.get("Password") != null && !jsonObj.get("Password").isJsonNull()) && !jsonObj.get("Password").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Password` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Password").toString())); + } + if (jsonObj.get("Email") != null && !jsonObj.get("Email").isJsonNull()) { + JsonArray jsonArrayemail = jsonObj.getAsJsonArray("Email"); + if (jsonArrayemail != null) { + // ensure the json data is an array + if (!jsonObj.get("Email").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Email` to be an array in the JSON string but got `%s`", jsonObj.get("Email").toString())); + } + + // validate the optional field `Email` (array) + for (int i = 0; i < jsonArrayemail.size(); i++) { + ProfileRequestModelEmailInner.validateJsonElement(jsonArrayemail.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserRegistrationByReCaptchaEmailPhoneUserNameRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserRegistrationByReCaptchaEmailPhoneUserNameRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<UserRegistrationByReCaptchaEmailPhoneUserNameRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserRegistrationByReCaptchaEmailPhoneUserNameRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserRegistrationByReCaptchaEmailPhoneUserNameRequest>() { + @Override + public void write(JsonWriter out, UserRegistrationByReCaptchaEmailPhoneUserNameRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UserRegistrationByReCaptchaEmailPhoneUserNameRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UserRegistrationByReCaptchaEmailPhoneUserNameRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserRegistrationByReCaptchaEmailPhoneUserNameRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserRegistrationByReCaptchaEmailPhoneUserNameRequest + * @throws IOException if the JSON string is invalid with respect to UserRegistrationByReCaptchaEmailPhoneUserNameRequest + */ + public static UserRegistrationByReCaptchaEmailPhoneUserNameRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserRegistrationByReCaptchaEmailPhoneUserNameRequest.class); + } + + /** + * Convert an instance of UserRegistrationByReCaptchaEmailPhoneUserNameRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserRole.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserRole.java new file mode 100644 index 0000000..ecd626e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserRole.java @@ -0,0 +1,435 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * UserRole + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserRole { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_UID = "Uid"; + @SerializedName(SERIALIZED_NAME_UID) + @javax.annotation.Nullable + private String uid; + + public static final String SERIALIZED_NAME_ROLE_ID = "RoleId"; + @SerializedName(SERIALIZED_NAME_ROLE_ID) + @javax.annotation.Nullable + private String roleId; + + public static final String SERIALIZED_NAME_ORG_ID = "OrgId"; + @SerializedName(SERIALIZED_NAME_ORG_ID) + @javax.annotation.Nullable + private String orgId; + + public static final String SERIALIZED_NAME_EMAIL = "Email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private String email; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public UserRole() { + } + + public UserRole id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Unique identifier of the User Role. + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public UserRole uid(@javax.annotation.Nullable String uid) { + this.uid = uid; + return this; + } + + /** + * Unique identifier of the User. + * @return uid + */ + @javax.annotation.Nullable + public String getUid() { + return uid; + } + + public void setUid(@javax.annotation.Nullable String uid) { + this.uid = uid; + } + + + public UserRole roleId(@javax.annotation.Nullable String roleId) { + this.roleId = roleId; + return this; + } + + /** + * Unique identifier of the Role. + * @return roleId + */ + @javax.annotation.Nullable + public String getRoleId() { + return roleId; + } + + public void setRoleId(@javax.annotation.Nullable String roleId) { + this.roleId = roleId; + } + + + public UserRole orgId(@javax.annotation.Nullable String orgId) { + this.orgId = orgId; + return this; + } + + /** + * Unique identifier of the organization. + * @return orgId + */ + @javax.annotation.Nullable + public String getOrgId() { + return orgId; + } + + public void setOrgId(@javax.annotation.Nullable String orgId) { + this.orgId = orgId; + } + + + public UserRole email(@javax.annotation.Nullable String email) { + this.email = email; + return this; + } + + /** + * Email address of the User. + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable String email) { + this.email = email; + } + + + public UserRole createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * Date and time when the User Role was created. + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UserRole instance itself + */ + public UserRole putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserRole userRole = (UserRole) o; + return Objects.equals(this.id, userRole.id) && + Objects.equals(this.uid, userRole.uid) && + Objects.equals(this.roleId, userRole.roleId) && + Objects.equals(this.orgId, userRole.orgId) && + Objects.equals(this.email, userRole.email) && + Objects.equals(this.createdDate, userRole.createdDate)&& + Objects.equals(this.additionalProperties, userRole.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, uid, roleId, orgId, email, createdDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserRole {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" uid: ").append(toIndentedString(uid)).append("\n"); + sb.append(" roleId: ").append(toIndentedString(roleId)).append("\n"); + sb.append(" orgId: ").append(toIndentedString(orgId)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Uid"); + openapiFields.add("RoleId"); + openapiFields.add("OrgId"); + openapiFields.add("Email"); + openapiFields.add("CreatedDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 UserRole + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserRole.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserRole is not found in the empty JSON string", UserRole.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Uid") != null && !jsonObj.get("Uid").isJsonNull()) && !jsonObj.get("Uid").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Uid` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Uid").toString())); + } + if ((jsonObj.get("RoleId") != null && !jsonObj.get("RoleId").isJsonNull()) && !jsonObj.get("RoleId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `RoleId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("RoleId").toString())); + } + if ((jsonObj.get("OrgId") != null && !jsonObj.get("OrgId").isJsonNull()) && !jsonObj.get("OrgId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `OrgId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("OrgId").toString())); + } + if ((jsonObj.get("Email") != null && !jsonObj.get("Email").isJsonNull()) && !jsonObj.get("Email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Email").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserRole.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserRole' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<UserRole> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserRole.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserRole>() { + @Override + public void write(JsonWriter out, UserRole value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UserRole read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UserRole instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserRole given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserRole + * @throws IOException if the JSON string is invalid with respect to UserRole + */ + public static UserRole fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserRole.class); + } + + /** + * Convert an instance of UserRole to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserRolePutRequest.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserRolePutRequest.java new file mode 100644 index 0000000..17344cf --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserRolePutRequest.java @@ -0,0 +1,308 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.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.loginradius.sdk.internal.openapi.JSON; + +/** + * UserRolePutRequest + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserRolePutRequest { + public static final String SERIALIZED_NAME_ROLE_IDS = "RoleIds"; + @SerializedName(SERIALIZED_NAME_ROLE_IDS) + @javax.annotation.Nonnull + private List<String> roleIds = new ArrayList<>(); + + public UserRolePutRequest() { + } + + public UserRolePutRequest roleIds(@javax.annotation.Nonnull List<String> roleIds) { + this.roleIds = roleIds; + return this; + } + + public UserRolePutRequest addRoleIdsItem(String roleIdsItem) { + if (this.roleIds == null) { + this.roleIds = new ArrayList<>(); + } + this.roleIds.add(roleIdsItem); + return this; + } + + /** + * Unique identifier of the Role. + * @return roleIds + */ + @javax.annotation.Nonnull + public List<String> getRoleIds() { + return roleIds; + } + + public void setRoleIds(@javax.annotation.Nonnull List<String> roleIds) { + this.roleIds = roleIds; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UserRolePutRequest instance itself + */ + public UserRolePutRequest putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserRolePutRequest userRolePutRequest = (UserRolePutRequest) o; + return Objects.equals(this.roleIds, userRolePutRequest.roleIds)&& + Objects.equals(this.additionalProperties, userRolePutRequest.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(roleIds, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserRolePutRequest {\n"); + sb.append(" roleIds: ").append(toIndentedString(roleIds)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("RoleIds"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("RoleIds"); + } + + /** + * 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 UserRolePutRequest + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserRolePutRequest.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserRolePutRequest is not found in the empty JSON string", UserRolePutRequest.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UserRolePutRequest.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 required json array is present + if (jsonObj.get("RoleIds") == null) { + throw new IllegalArgumentException("Expected the field `linkedContent` to be an array in the JSON string but got `null`"); + } else if (!jsonObj.get("RoleIds").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `RoleIds` to be an array in the JSON string but got `%s`", jsonObj.get("RoleIds").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserRolePutRequest.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserRolePutRequest' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<UserRolePutRequest> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserRolePutRequest.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserRolePutRequest>() { + @Override + public void write(JsonWriter out, UserRolePutRequest value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UserRolePutRequest read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UserRolePutRequest instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserRolePutRequest given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserRolePutRequest + * @throws IOException if the JSON string is invalid with respect to UserRolePutRequest + */ + public static UserRolePutRequest fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserRolePutRequest.class); + } + + /** + * Convert an instance of UserRolePutRequest to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UserRolesModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserRolesModel.java new file mode 100644 index 0000000..2c55afc --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UserRolesModel.java @@ -0,0 +1,298 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.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.loginradius.sdk.internal.openapi.JSON; + +/** + * UserRolesModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UserRolesModel { + public static final String SERIALIZED_NAME_ROLES = "Roles"; + @SerializedName(SERIALIZED_NAME_ROLES) + @javax.annotation.Nullable + private List<String> roles = new ArrayList<>(); + + public UserRolesModel() { + } + + public UserRolesModel roles(@javax.annotation.Nullable List<String> roles) { + this.roles = roles; + return this; + } + + public UserRolesModel addRolesItem(String rolesItem) { + if (this.roles == null) { + this.roles = new ArrayList<>(); + } + this.roles.add(rolesItem); + return this; + } + + /** + * List of User Roles. + * @return roles + */ + @javax.annotation.Nullable + public List<String> getRoles() { + return roles; + } + + public void setRoles(@javax.annotation.Nullable List<String> roles) { + this.roles = roles; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UserRolesModel instance itself + */ + public UserRolesModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UserRolesModel userRolesModel = (UserRolesModel) o; + return Objects.equals(this.roles, userRolesModel.roles)&& + Objects.equals(this.additionalProperties, userRolesModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(roles, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UserRolesModel {\n"); + sb.append(" roles: ").append(toIndentedString(roles)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Roles"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 UserRolesModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UserRolesModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UserRolesModel is not found in the empty JSON string", UserRolesModel.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // ensure the optional json data is an array if present + if (jsonObj.get("Roles") != null && !jsonObj.get("Roles").isJsonNull() && !jsonObj.get("Roles").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Roles` to be an array in the JSON string but got `%s`", jsonObj.get("Roles").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UserRolesModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UserRolesModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<UserRolesModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UserRolesModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<UserRolesModel>() { + @Override + public void write(JsonWriter out, UserRolesModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UserRolesModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UserRolesModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UserRolesModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UserRolesModel + * @throws IOException if the JSON string is invalid with respect to UserRolesModel + */ + public static UserRolesModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UserRolesModel.class); + } + + /** + * Convert an instance of UserRolesModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/UsernameModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/UsernameModel.java new file mode 100644 index 0000000..e928d9e --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/UsernameModel.java @@ -0,0 +1,295 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * UsernameModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class UsernameModel { + public static final String SERIALIZED_NAME_USERNAME = "Username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nonnull + private String username; + + public UsernameModel() { + } + + public UsernameModel username(@javax.annotation.Nonnull String username) { + this.username = username; + return this; + } + + /** + * The Username to validate or process. + * @return username + */ + @javax.annotation.Nonnull + public String getUsername() { + return username; + } + + public void setUsername(@javax.annotation.Nonnull String username) { + this.username = username; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the UsernameModel instance itself + */ + public UsernameModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + UsernameModel usernameModel = (UsernameModel) o; + return Objects.equals(this.username, usernameModel.username)&& + Objects.equals(this.additionalProperties, usernameModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(username, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class UsernameModel {\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Username"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Username"); + } + + /** + * 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 UsernameModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!UsernameModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in UsernameModel is not found in the empty JSON string", UsernameModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : UsernameModel.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("Username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Username").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!UsernameModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'UsernameModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<UsernameModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(UsernameModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<UsernameModel>() { + @Override + public void write(JsonWriter out, UsernameModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public UsernameModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + UsernameModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of UsernameModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of UsernameModel + * @throws IOException if the JSON string is invalid with respect to UsernameModel + */ + public static UsernameModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, UsernameModel.class); + } + + /** + * Convert an instance of UsernameModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/VerificationLinkResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/VerificationLinkResponse.java new file mode 100644 index 0000000..0bc086c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/VerificationLinkResponse.java @@ -0,0 +1,315 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * VerificationLinkResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class VerificationLinkResponse { + public static final String SERIALIZED_NAME_VERIFICATION_TOKEN = "VerificationToken"; + @SerializedName(SERIALIZED_NAME_VERIFICATION_TOKEN) + @javax.annotation.Nullable + private String verificationToken; + + public static final String SERIALIZED_NAME_EXPIRES_IN = "expires_in"; + @SerializedName(SERIALIZED_NAME_EXPIRES_IN) + @javax.annotation.Nullable + private OffsetDateTime expiresIn; + + public VerificationLinkResponse() { + } + + public VerificationLinkResponse verificationToken(@javax.annotation.Nullable String verificationToken) { + this.verificationToken = verificationToken; + return this; + } + + /** + * The generated Verification Token. + * @return verificationToken + */ + @javax.annotation.Nullable + public String getVerificationToken() { + return verificationToken; + } + + public void setVerificationToken(@javax.annotation.Nullable String verificationToken) { + this.verificationToken = verificationToken; + } + + + public VerificationLinkResponse expiresIn(@javax.annotation.Nullable OffsetDateTime expiresIn) { + this.expiresIn = expiresIn; + return this; + } + + /** + * The expiration time of the token. + * @return expiresIn + */ + @javax.annotation.Nullable + public OffsetDateTime getExpiresIn() { + return expiresIn; + } + + public void setExpiresIn(@javax.annotation.Nullable OffsetDateTime expiresIn) { + this.expiresIn = expiresIn; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the VerificationLinkResponse instance itself + */ + public VerificationLinkResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VerificationLinkResponse verificationLinkResponse = (VerificationLinkResponse) o; + return Objects.equals(this.verificationToken, verificationLinkResponse.verificationToken) && + Objects.equals(this.expiresIn, verificationLinkResponse.expiresIn)&& + Objects.equals(this.additionalProperties, verificationLinkResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(verificationToken, expiresIn, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VerificationLinkResponse {\n"); + sb.append(" verificationToken: ").append(toIndentedString(verificationToken)).append("\n"); + sb.append(" expiresIn: ").append(toIndentedString(expiresIn)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("VerificationToken"); + openapiFields.add("expires_in"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 VerificationLinkResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!VerificationLinkResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in VerificationLinkResponse is not found in the empty JSON string", VerificationLinkResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("VerificationToken") != null && !jsonObj.get("VerificationToken").isJsonNull()) && !jsonObj.get("VerificationToken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `VerificationToken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("VerificationToken").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!VerificationLinkResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VerificationLinkResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<VerificationLinkResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(VerificationLinkResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<VerificationLinkResponse>() { + @Override + public void write(JsonWriter out, VerificationLinkResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public VerificationLinkResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + VerificationLinkResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of VerificationLinkResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of VerificationLinkResponse + * @throws IOException if the JSON string is invalid with respect to VerificationLinkResponse + */ + public static VerificationLinkResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VerificationLinkResponse.class); + } + + /** + * Convert an instance of VerificationLinkResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/VerifyConsent.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/VerifyConsent.java new file mode 100644 index 0000000..1c2e057 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/VerifyConsent.java @@ -0,0 +1,316 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.ConsentProfile; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * VerifyConsent + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class VerifyConsent { + public static final String SERIALIZED_NAME_CONSENT_PROFILE = "ConsentProfile"; + @SerializedName(SERIALIZED_NAME_CONSENT_PROFILE) + @javax.annotation.Nullable + private ConsentProfile consentProfile; + + public static final String SERIALIZED_NAME_IS_VALID = "IsValid"; + @SerializedName(SERIALIZED_NAME_IS_VALID) + @javax.annotation.Nullable + private Boolean isValid; + + public VerifyConsent() { + } + + public VerifyConsent consentProfile(@javax.annotation.Nullable ConsentProfile consentProfile) { + this.consentProfile = consentProfile; + return this; + } + + /** + * Get consentProfile + * @return consentProfile + */ + @javax.annotation.Nullable + public ConsentProfile getConsentProfile() { + return consentProfile; + } + + public void setConsentProfile(@javax.annotation.Nullable ConsentProfile consentProfile) { + this.consentProfile = consentProfile; + } + + + public VerifyConsent isValid(@javax.annotation.Nullable Boolean isValid) { + this.isValid = isValid; + return this; + } + + /** + * Indicates if the consent is valid + * @return isValid + */ + @javax.annotation.Nullable + public Boolean getIsValid() { + return isValid; + } + + public void setIsValid(@javax.annotation.Nullable Boolean isValid) { + this.isValid = isValid; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the VerifyConsent instance itself + */ + public VerifyConsent putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VerifyConsent verifyConsent = (VerifyConsent) o; + return Objects.equals(this.consentProfile, verifyConsent.consentProfile) && + Objects.equals(this.isValid, verifyConsent.isValid)&& + Objects.equals(this.additionalProperties, verifyConsent.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(consentProfile, isValid, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VerifyConsent {\n"); + sb.append(" consentProfile: ").append(toIndentedString(consentProfile)).append("\n"); + sb.append(" isValid: ").append(toIndentedString(isValid)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("ConsentProfile"); + openapiFields.add("IsValid"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 VerifyConsent + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!VerifyConsent.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in VerifyConsent is not found in the empty JSON string", VerifyConsent.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `ConsentProfile` + if (jsonObj.get("ConsentProfile") != null && !jsonObj.get("ConsentProfile").isJsonNull()) { + ConsentProfile.validateJsonElement(jsonObj.get("ConsentProfile")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!VerifyConsent.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VerifyConsent' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<VerifyConsent> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(VerifyConsent.class)); + + return (TypeAdapter<T>) new TypeAdapter<VerifyConsent>() { + @Override + public void write(JsonWriter out, VerifyConsent value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public VerifyConsent read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + VerifyConsent instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of VerifyConsent given an JSON string + * + * @param jsonString JSON string + * @return An instance of VerifyConsent + * @throws IOException if the JSON string is invalid with respect to VerifyConsent + */ + public static VerifyConsent fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VerifyConsent.class); + } + + /** + * Convert an instance of VerifyConsent to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/VerifyDeleteAccountOtp.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/VerifyDeleteAccountOtp.java new file mode 100644 index 0000000..a779b43 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/VerifyDeleteAccountOtp.java @@ -0,0 +1,464 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * VerifyDeleteAccountOtp + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class VerifyDeleteAccountOtp { + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer; + + public static final String SERIALIZED_NAME_OTP = "otp"; + @SerializedName(SERIALIZED_NAME_OTP) + @javax.annotation.Nonnull + private String otp; + + public static final String SERIALIZED_NAME_G_RECAPTCHA_RESPONSE = "g-recaptcha-response"; + @SerializedName(SERIALIZED_NAME_G_RECAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String gRecaptchaResponse; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_TICKET = "qq_captcha_ticket"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_TICKET) + @javax.annotation.Nullable + private String qqCaptchaTicket; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR = "qq_captcha_randstr"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_RANDSTR) + @javax.annotation.Nullable + private String qqCaptchaRandstr; + + public static final String SERIALIZED_NAME_H_CAPTCHA_RESPONSE = "h-captcha-response"; + @SerializedName(SERIALIZED_NAME_H_CAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String hCaptchaResponse; + + public VerifyDeleteAccountOtp() { + } + + public VerifyDeleteAccountOtp securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public VerifyDeleteAccountOtp putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * Security answers for Account verification + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + + public VerifyDeleteAccountOtp otp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + return this; + } + + /** + * One-Time Password for Account deletion + * @return otp + */ + @javax.annotation.Nonnull + public String getOtp() { + return otp; + } + + public void setOtp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + } + + + public VerifyDeleteAccountOtp gRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + return this; + } + + /** + * Google reCAPTCHA response + * @return gRecaptchaResponse + */ + @javax.annotation.Nullable + public String getgRecaptchaResponse() { + return gRecaptchaResponse; + } + + public void setgRecaptchaResponse(@javax.annotation.Nullable String gRecaptchaResponse) { + this.gRecaptchaResponse = gRecaptchaResponse; + } + + + public VerifyDeleteAccountOtp qqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + return this; + } + + /** + * QQ captcha ticket + * @return qqCaptchaTicket + */ + @javax.annotation.Nullable + public String getQqCaptchaTicket() { + return qqCaptchaTicket; + } + + public void setQqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + } + + + public VerifyDeleteAccountOtp qqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + return this; + } + + /** + * QQ captcha random string + * @return qqCaptchaRandstr + */ + @javax.annotation.Nullable + public String getQqCaptchaRandstr() { + return qqCaptchaRandstr; + } + + public void setQqCaptchaRandstr(@javax.annotation.Nullable String qqCaptchaRandstr) { + this.qqCaptchaRandstr = qqCaptchaRandstr; + } + + + public VerifyDeleteAccountOtp hCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + return this; + } + + /** + * hCaptcha response + * @return hCaptchaResponse + */ + @javax.annotation.Nullable + public String gethCaptchaResponse() { + return hCaptchaResponse; + } + + public void sethCaptchaResponse(@javax.annotation.Nullable String hCaptchaResponse) { + this.hCaptchaResponse = hCaptchaResponse; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the VerifyDeleteAccountOtp instance itself + */ + public VerifyDeleteAccountOtp putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VerifyDeleteAccountOtp verifyDeleteAccountOtp = (VerifyDeleteAccountOtp) o; + return Objects.equals(this.securityAnswer, verifyDeleteAccountOtp.securityAnswer) && + Objects.equals(this.otp, verifyDeleteAccountOtp.otp) && + Objects.equals(this.gRecaptchaResponse, verifyDeleteAccountOtp.gRecaptchaResponse) && + Objects.equals(this.qqCaptchaTicket, verifyDeleteAccountOtp.qqCaptchaTicket) && + Objects.equals(this.qqCaptchaRandstr, verifyDeleteAccountOtp.qqCaptchaRandstr) && + Objects.equals(this.hCaptchaResponse, verifyDeleteAccountOtp.hCaptchaResponse)&& + Objects.equals(this.additionalProperties, verifyDeleteAccountOtp.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(securityAnswer, otp, gRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandstr, hCaptchaResponse, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VerifyDeleteAccountOtp {\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" otp: ").append(toIndentedString(otp)).append("\n"); + sb.append(" gRecaptchaResponse: ").append(toIndentedString(gRecaptchaResponse)).append("\n"); + sb.append(" qqCaptchaTicket: ").append(toIndentedString(qqCaptchaTicket)).append("\n"); + sb.append(" qqCaptchaRandstr: ").append(toIndentedString(qqCaptchaRandstr)).append("\n"); + sb.append(" hCaptchaResponse: ").append(toIndentedString(hCaptchaResponse)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("SecurityAnswer"); + openapiFields.add("otp"); + openapiFields.add("g-recaptcha-response"); + openapiFields.add("qq_captcha_ticket"); + openapiFields.add("qq_captcha_randstr"); + openapiFields.add("h-captcha-response"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("otp"); + } + + /** + * 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 VerifyDeleteAccountOtp + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!VerifyDeleteAccountOtp.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in VerifyDeleteAccountOtp is not found in the empty JSON string", VerifyDeleteAccountOtp.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : VerifyDeleteAccountOtp.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("otp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `otp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("otp").toString())); + } + if ((jsonObj.get("g-recaptcha-response") != null && !jsonObj.get("g-recaptcha-response").isJsonNull()) && !jsonObj.get("g-recaptcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `g-recaptcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("g-recaptcha-response").toString())); + } + if ((jsonObj.get("qq_captcha_ticket") != null && !jsonObj.get("qq_captcha_ticket").isJsonNull()) && !jsonObj.get("qq_captcha_ticket").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_ticket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_ticket").toString())); + } + if ((jsonObj.get("qq_captcha_randstr") != null && !jsonObj.get("qq_captcha_randstr").isJsonNull()) && !jsonObj.get("qq_captcha_randstr").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `qq_captcha_randstr` to be a primitive type in the JSON string but got `%s`", jsonObj.get("qq_captcha_randstr").toString())); + } + if ((jsonObj.get("h-captcha-response") != null && !jsonObj.get("h-captcha-response").isJsonNull()) && !jsonObj.get("h-captcha-response").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `h-captcha-response` to be a primitive type in the JSON string but got `%s`", jsonObj.get("h-captcha-response").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!VerifyDeleteAccountOtp.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VerifyDeleteAccountOtp' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<VerifyDeleteAccountOtp> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(VerifyDeleteAccountOtp.class)); + + return (TypeAdapter<T>) new TypeAdapter<VerifyDeleteAccountOtp>() { + @Override + public void write(JsonWriter out, VerifyDeleteAccountOtp value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public VerifyDeleteAccountOtp read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + VerifyDeleteAccountOtp instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of VerifyDeleteAccountOtp given an JSON string + * + * @param jsonString JSON string + * @return An instance of VerifyDeleteAccountOtp + * @throws IOException if the JSON string is invalid with respect to VerifyDeleteAccountOtp + */ + public static VerifyDeleteAccountOtp fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VerifyDeleteAccountOtp.class); + } + + /** + * Convert an instance of VerifyDeleteAccountOtp to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/VerifyEmailModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/VerifyEmailModel.java new file mode 100644 index 0000000..53d7c90 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/VerifyEmailModel.java @@ -0,0 +1,442 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * VerifyEmailModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class VerifyEmailModel { + public static final String SERIALIZED_NAME_OTP = "otp"; + @SerializedName(SERIALIZED_NAME_OTP) + @javax.annotation.Nonnull + private String otp; + + public static final String SERIALIZED_NAME_EMAIL = "email"; + @SerializedName(SERIALIZED_NAME_EMAIL) + @javax.annotation.Nullable + private String email; + + public static final String SERIALIZED_NAME_USERNAME = "username"; + @SerializedName(SERIALIZED_NAME_USERNAME) + @javax.annotation.Nullable + private String username; + + public static final String SERIALIZED_NAME_U_U_I_D = "UUID"; + @SerializedName(SERIALIZED_NAME_U_U_I_D) + @javax.annotation.Nullable + private String UUID; + + public static final String SERIALIZED_NAME_VERIFICATIONTOKEN = "verificationtoken"; + @SerializedName(SERIALIZED_NAME_VERIFICATIONTOKEN) + @javax.annotation.Nullable + private String verificationtoken; + + public static final String SERIALIZED_NAME_SECURITYANSWER = "securityanswer"; + @SerializedName(SERIALIZED_NAME_SECURITYANSWER) + @javax.annotation.Nullable + private Object securityanswer; + + public VerifyEmailModel() { + } + + public VerifyEmailModel otp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + return this; + } + + /** + * One-time passcode sent to the User's Email. [required if 'email' or 'uuid' is passed] + * @return otp + */ + @javax.annotation.Nonnull + public String getOtp() { + return otp; + } + + public void setOtp(@javax.annotation.Nonnull String otp) { + this.otp = otp; + } + + + public VerifyEmailModel email(@javax.annotation.Nullable String email) { + this.email = email; + return this; + } + + /** + * User's Email address (required if `uuid` or `username` is not passed). + * @return email + */ + @javax.annotation.Nullable + public String getEmail() { + return email; + } + + public void setEmail(@javax.annotation.Nullable String email) { + this.email = email; + } + + + public VerifyEmailModel username(@javax.annotation.Nullable String username) { + this.username = username; + return this; + } + + /** + * Username of the associated Account (required if `email` or `uuid` is not passed). Cannot be combined with `email`. + * @return username + */ + @javax.annotation.Nullable + public String getUsername() { + return username; + } + + public void setUsername(@javax.annotation.Nullable String username) { + this.username = username; + } + + + public VerifyEmailModel UUID(@javax.annotation.Nullable String UUID) { + this.UUID = UUID; + return this; + } + + /** + * UUID received in the response of the Auth send verification Email API (required if `email` or `username` is not passed). + * @return UUID + */ + @javax.annotation.Nullable + public String getUUID() { + return UUID; + } + + public void setUUID(@javax.annotation.Nullable String UUID) { + this.UUID = UUID; + } + + + public VerifyEmailModel verificationtoken(@javax.annotation.Nullable String verificationtoken) { + this.verificationtoken = verificationtoken; + return this; + } + + /** + * Verification token received in Email (required if `email` is not passed). + * @return verificationtoken + */ + @javax.annotation.Nullable + public String getVerificationtoken() { + return verificationtoken; + } + + public void setVerificationtoken(@javax.annotation.Nullable String verificationtoken) { + this.verificationtoken = verificationtoken; + } + + + public VerifyEmailModel securityanswer(@javax.annotation.Nullable Object securityanswer) { + this.securityanswer = securityanswer; + return this; + } + + /** + * JSON object with unique security question IDs and answers. + * @return securityanswer + */ + @javax.annotation.Nullable + public Object getSecurityanswer() { + return securityanswer; + } + + public void setSecurityanswer(@javax.annotation.Nullable Object securityanswer) { + this.securityanswer = securityanswer; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the VerifyEmailModel instance itself + */ + public VerifyEmailModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VerifyEmailModel verifyEmailModel = (VerifyEmailModel) o; + return Objects.equals(this.otp, verifyEmailModel.otp) && + Objects.equals(this.email, verifyEmailModel.email) && + Objects.equals(this.username, verifyEmailModel.username) && + Objects.equals(this.UUID, verifyEmailModel.UUID) && + Objects.equals(this.verificationtoken, verifyEmailModel.verificationtoken) && + Objects.equals(this.securityanswer, verifyEmailModel.securityanswer)&& + Objects.equals(this.additionalProperties, verifyEmailModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(otp, email, username, UUID, verificationtoken, securityanswer, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VerifyEmailModel {\n"); + sb.append(" otp: ").append(toIndentedString(otp)).append("\n"); + sb.append(" email: ").append(toIndentedString(email)).append("\n"); + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" UUID: ").append(toIndentedString(UUID)).append("\n"); + sb.append(" verificationtoken: ").append(toIndentedString(verificationtoken)).append("\n"); + sb.append(" securityanswer: ").append(toIndentedString(securityanswer)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("otp"); + openapiFields.add("email"); + openapiFields.add("username"); + openapiFields.add("UUID"); + openapiFields.add("verificationtoken"); + openapiFields.add("securityanswer"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("otp"); + } + + /** + * 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 VerifyEmailModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!VerifyEmailModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in VerifyEmailModel is not found in the empty JSON string", VerifyEmailModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : VerifyEmailModel.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("otp").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `otp` to be a primitive type in the JSON string but got `%s`", jsonObj.get("otp").toString())); + } + if ((jsonObj.get("email") != null && !jsonObj.get("email").isJsonNull()) && !jsonObj.get("email").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `email` to be a primitive type in the JSON string but got `%s`", jsonObj.get("email").toString())); + } + if ((jsonObj.get("username") != null && !jsonObj.get("username").isJsonNull()) && !jsonObj.get("username").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `username` to be a primitive type in the JSON string but got `%s`", jsonObj.get("username").toString())); + } + if ((jsonObj.get("UUID") != null && !jsonObj.get("UUID").isJsonNull()) && !jsonObj.get("UUID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UUID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UUID").toString())); + } + if ((jsonObj.get("verificationtoken") != null && !jsonObj.get("verificationtoken").isJsonNull()) && !jsonObj.get("verificationtoken").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `verificationtoken` to be a primitive type in the JSON string but got `%s`", jsonObj.get("verificationtoken").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!VerifyEmailModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VerifyEmailModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<VerifyEmailModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(VerifyEmailModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<VerifyEmailModel>() { + @Override + public void write(JsonWriter out, VerifyEmailModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public VerifyEmailModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + VerifyEmailModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of VerifyEmailModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of VerifyEmailModel + * @throws IOException if the JSON string is invalid with respect to VerifyEmailModel + */ + public static VerifyEmailModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VerifyEmailModel.class); + } + + /** + * Convert an instance of VerifyEmailModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/VerifyOtpPhoneModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/VerifyOtpPhoneModel.java new file mode 100644 index 0000000..fdcce88 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/VerifyOtpPhoneModel.java @@ -0,0 +1,452 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 java.util.HashMap; +import java.util.Map; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * VerifyOtpPhoneModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class VerifyOtpPhoneModel { + public static final String SERIALIZED_NAME_SECURITY_ANSWER = "SecurityAnswer"; + @SerializedName(SERIALIZED_NAME_SECURITY_ANSWER) + @javax.annotation.Nullable + private Map<String, String> securityAnswer = new HashMap<>(); + + public static final String SERIALIZED_NAME_PHONE = "Phone"; + @SerializedName(SERIALIZED_NAME_PHONE) + @javax.annotation.Nonnull + private String phone; + + public static final String SERIALIZED_NAME_GOOGLE_RECAPTCHA_RESPONSE = "GoogleRecaptchaResponse"; + @SerializedName(SERIALIZED_NAME_GOOGLE_RECAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String googleRecaptchaResponse; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_TICKET = "QQCaptchaTicket"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_TICKET) + @javax.annotation.Nullable + private String qqCaptchaTicket; + + public static final String SERIALIZED_NAME_QQ_CAPTCHA_RANDOM_STRING = "QQCaptchaRandomString"; + @SerializedName(SERIALIZED_NAME_QQ_CAPTCHA_RANDOM_STRING) + @javax.annotation.Nullable + private String qqCaptchaRandomString; + + public static final String SERIALIZED_NAME_HCAPTCHA_RESPONSE = "HCaptchaResponse"; + @SerializedName(SERIALIZED_NAME_HCAPTCHA_RESPONSE) + @javax.annotation.Nullable + private String hcaptchaResponse; + + public VerifyOtpPhoneModel() { + } + + public VerifyOtpPhoneModel securityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + return this; + } + + public VerifyOtpPhoneModel putSecurityAnswerItem(String key, String securityAnswerItem) { + if (this.securityAnswer == null) { + this.securityAnswer = new HashMap<>(); + } + this.securityAnswer.put(key, securityAnswerItem); + return this; + } + + /** + * Optional security answers for additional verification. + * @return securityAnswer + */ + @javax.annotation.Nullable + public Map<String, String> getSecurityAnswer() { + return securityAnswer; + } + + public void setSecurityAnswer(@javax.annotation.Nullable Map<String, String> securityAnswer) { + this.securityAnswer = securityAnswer; + } + + + public VerifyOtpPhoneModel phone(@javax.annotation.Nonnull String phone) { + this.phone = phone; + return this; + } + + /** + * The Phone number for OTP verification. + * @return phone + */ + @javax.annotation.Nonnull + public String getPhone() { + return phone; + } + + public void setPhone(@javax.annotation.Nonnull String phone) { + this.phone = phone; + } + + + public VerifyOtpPhoneModel googleRecaptchaResponse(@javax.annotation.Nullable String googleRecaptchaResponse) { + this.googleRecaptchaResponse = googleRecaptchaResponse; + return this; + } + + /** + * Google reCAPTCHA response. + * @return googleRecaptchaResponse + */ + @javax.annotation.Nullable + public String getGoogleRecaptchaResponse() { + return googleRecaptchaResponse; + } + + public void setGoogleRecaptchaResponse(@javax.annotation.Nullable String googleRecaptchaResponse) { + this.googleRecaptchaResponse = googleRecaptchaResponse; + } + + + public VerifyOtpPhoneModel qqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + return this; + } + + /** + * QQ Captcha ticket. + * @return qqCaptchaTicket + */ + @javax.annotation.Nullable + public String getQqCaptchaTicket() { + return qqCaptchaTicket; + } + + public void setQqCaptchaTicket(@javax.annotation.Nullable String qqCaptchaTicket) { + this.qqCaptchaTicket = qqCaptchaTicket; + } + + + public VerifyOtpPhoneModel qqCaptchaRandomString(@javax.annotation.Nullable String qqCaptchaRandomString) { + this.qqCaptchaRandomString = qqCaptchaRandomString; + return this; + } + + /** + * QQ Captcha random string. + * @return qqCaptchaRandomString + */ + @javax.annotation.Nullable + public String getQqCaptchaRandomString() { + return qqCaptchaRandomString; + } + + public void setQqCaptchaRandomString(@javax.annotation.Nullable String qqCaptchaRandomString) { + this.qqCaptchaRandomString = qqCaptchaRandomString; + } + + + public VerifyOtpPhoneModel hcaptchaResponse(@javax.annotation.Nullable String hcaptchaResponse) { + this.hcaptchaResponse = hcaptchaResponse; + return this; + } + + /** + * hCaptcha response. + * @return hcaptchaResponse + */ + @javax.annotation.Nullable + public String getHcaptchaResponse() { + return hcaptchaResponse; + } + + public void setHcaptchaResponse(@javax.annotation.Nullable String hcaptchaResponse) { + this.hcaptchaResponse = hcaptchaResponse; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the VerifyOtpPhoneModel instance itself + */ + public VerifyOtpPhoneModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VerifyOtpPhoneModel verifyOtpPhoneModel = (VerifyOtpPhoneModel) o; + return Objects.equals(this.securityAnswer, verifyOtpPhoneModel.securityAnswer) && + Objects.equals(this.phone, verifyOtpPhoneModel.phone) && + Objects.equals(this.googleRecaptchaResponse, verifyOtpPhoneModel.googleRecaptchaResponse) && + Objects.equals(this.qqCaptchaTicket, verifyOtpPhoneModel.qqCaptchaTicket) && + Objects.equals(this.qqCaptchaRandomString, verifyOtpPhoneModel.qqCaptchaRandomString) && + Objects.equals(this.hcaptchaResponse, verifyOtpPhoneModel.hcaptchaResponse)&& + Objects.equals(this.additionalProperties, verifyOtpPhoneModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(securityAnswer, phone, googleRecaptchaResponse, qqCaptchaTicket, qqCaptchaRandomString, hcaptchaResponse, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VerifyOtpPhoneModel {\n"); + sb.append(" securityAnswer: ").append(toIndentedString(securityAnswer)).append("\n"); + sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); + sb.append(" googleRecaptchaResponse: ").append(toIndentedString(googleRecaptchaResponse)).append("\n"); + sb.append(" qqCaptchaTicket: ").append(toIndentedString(qqCaptchaTicket)).append("\n"); + sb.append(" qqCaptchaRandomString: ").append(toIndentedString(qqCaptchaRandomString)).append("\n"); + sb.append(" hcaptchaResponse: ").append(toIndentedString(hcaptchaResponse)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("SecurityAnswer"); + openapiFields.add("Phone"); + openapiFields.add("GoogleRecaptchaResponse"); + openapiFields.add("QQCaptchaTicket"); + openapiFields.add("QQCaptchaRandomString"); + openapiFields.add("HCaptchaResponse"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Phone"); + } + + /** + * 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 VerifyOtpPhoneModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!VerifyOtpPhoneModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in VerifyOtpPhoneModel is not found in the empty JSON string", VerifyOtpPhoneModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : VerifyOtpPhoneModel.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("Phone").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Phone` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Phone").toString())); + } + if ((jsonObj.get("GoogleRecaptchaResponse") != null && !jsonObj.get("GoogleRecaptchaResponse").isJsonNull()) && !jsonObj.get("GoogleRecaptchaResponse").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `GoogleRecaptchaResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("GoogleRecaptchaResponse").toString())); + } + if ((jsonObj.get("QQCaptchaTicket") != null && !jsonObj.get("QQCaptchaTicket").isJsonNull()) && !jsonObj.get("QQCaptchaTicket").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `QQCaptchaTicket` to be a primitive type in the JSON string but got `%s`", jsonObj.get("QQCaptchaTicket").toString())); + } + if ((jsonObj.get("QQCaptchaRandomString") != null && !jsonObj.get("QQCaptchaRandomString").isJsonNull()) && !jsonObj.get("QQCaptchaRandomString").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `QQCaptchaRandomString` to be a primitive type in the JSON string but got `%s`", jsonObj.get("QQCaptchaRandomString").toString())); + } + if ((jsonObj.get("HCaptchaResponse") != null && !jsonObj.get("HCaptchaResponse").isJsonNull()) && !jsonObj.get("HCaptchaResponse").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `HCaptchaResponse` to be a primitive type in the JSON string but got `%s`", jsonObj.get("HCaptchaResponse").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!VerifyOtpPhoneModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VerifyOtpPhoneModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<VerifyOtpPhoneModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(VerifyOtpPhoneModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<VerifyOtpPhoneModel>() { + @Override + public void write(JsonWriter out, VerifyOtpPhoneModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public VerifyOtpPhoneModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + VerifyOtpPhoneModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of VerifyOtpPhoneModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of VerifyOtpPhoneModel + * @throws IOException if the JSON string is invalid with respect to VerifyOtpPhoneModel + */ + public static VerifyOtpPhoneModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VerifyOtpPhoneModel.class); + } + + /** + * Convert an instance of VerifyOtpPhoneModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/VerifyPhoneOtp200Response.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/VerifyPhoneOtp200Response.java new file mode 100644 index 0000000..b8bf835 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/VerifyPhoneOtp200Response.java @@ -0,0 +1,277 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.AuthResponse; +import com.loginradius.sdk.internal.openapi.model.IsPostedResponse; +import com.loginradius.sdk.internal.openapi.model.Profile; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; + + + +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import com.google.gson.JsonParseException; +import com.google.gson.TypeAdapter; +import com.google.gson.TypeAdapterFactory; +import com.google.gson.reflect.TypeToken; +import com.google.gson.JsonPrimitive; +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 com.google.gson.JsonDeserializationContext; +import com.google.gson.JsonDeserializer; +import com.google.gson.JsonSerializationContext; +import com.google.gson.JsonSerializer; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonArray; +import com.google.gson.JsonParseException; + +import com.loginradius.sdk.internal.openapi.JSON; + +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class VerifyPhoneOtp200Response extends AbstractOpenApiSchema { + private static final Logger log = Logger.getLogger(VerifyPhoneOtp200Response.class.getName()); + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!VerifyPhoneOtp200Response.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VerifyPhoneOtp200Response' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<IsPostedResponse> adapterIsPostedResponse = gson.getDelegateAdapter(this, TypeToken.get(IsPostedResponse.class)); + final TypeAdapter<AuthResponse> adapterAuthResponse = gson.getDelegateAdapter(this, TypeToken.get(AuthResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<VerifyPhoneOtp200Response>() { + @Override + public void write(JsonWriter out, VerifyPhoneOtp200Response value) throws IOException { + if (value == null || value.getActualInstance() == null) { + elementAdapter.write(out, null); + return; + } + + // check if the actual instance is of the type `IsPostedResponse` + if (value.getActualInstance() instanceof IsPostedResponse) { + JsonElement element = adapterIsPostedResponse.toJsonTree((IsPostedResponse)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + // check if the actual instance is of the type `AuthResponse` + if (value.getActualInstance() instanceof AuthResponse) { + JsonElement element = adapterAuthResponse.toJsonTree((AuthResponse)value.getActualInstance()); + elementAdapter.write(out, element); + return; + } + throw new IOException("Failed to serialize as the type doesn't match oneOf schemas: AuthResponse, IsPostedResponse"); + } + + @Override + public VerifyPhoneOtp200Response read(JsonReader in) throws IOException { + Object deserialized = null; + JsonElement jsonElement = elementAdapter.read(in); + + int match = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + TypeAdapter actualAdapter = elementAdapter; + + // deserialize IsPostedResponse + try { + // validate the JSON object to see if any exception is thrown + IsPostedResponse.validateJsonElement(jsonElement); + actualAdapter = adapterIsPostedResponse; + match++; + log.log(Level.FINER, "Input data matches schema 'IsPostedResponse'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for IsPostedResponse failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'IsPostedResponse'", e); + } + // deserialize AuthResponse + try { + // validate the JSON object to see if any exception is thrown + AuthResponse.validateJsonElement(jsonElement); + actualAdapter = adapterAuthResponse; + match++; + log.log(Level.FINER, "Input data matches schema 'AuthResponse'"); + } catch (Exception e) { + // deserialization failed, continue + errorMessages.add(String.format("Deserialization for AuthResponse failed with `%s`.", e.getMessage())); + log.log(Level.FINER, "Input data does not match schema 'AuthResponse'", e); + } + + if (match == 1) { + VerifyPhoneOtp200Response ret = new VerifyPhoneOtp200Response(); + ret.setActualInstance(actualAdapter.fromJsonTree(jsonElement)); + return ret; + } + + throw new IOException(String.format("Failed deserialization for VerifyPhoneOtp200Response: %d classes match result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", match, errorMessages, jsonElement.toString())); + } + }.nullSafe(); + } + } + + // store a list of schema names defined in oneOf + public static final Map<String, Class<?>> schemas = new HashMap<String, Class<?>>(); + + public VerifyPhoneOtp200Response() { + super("oneOf", Boolean.FALSE); + } + + public VerifyPhoneOtp200Response(Object o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("IsPostedResponse", IsPostedResponse.class); + schemas.put("AuthResponse", AuthResponse.class); + } + + @Override + public Map<String, Class<?>> getSchemas() { + return VerifyPhoneOtp200Response.schemas; + } + + /** + * Set the instance that matches the oneOf child schema, check + * the instance parameter is valid against the oneOf child schemas: + * AuthResponse, IsPostedResponse + * + * It could be an instance of the 'oneOf' schemas. + */ + @Override + public void setActualInstance(Object instance) { + if (instance instanceof IsPostedResponse) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof AuthResponse) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be AuthResponse, IsPostedResponse"); + } + + /** + * Get the actual instance, which can be the following: + * AuthResponse, IsPostedResponse + * + * @return The actual instance (AuthResponse, IsPostedResponse) + */ + @SuppressWarnings("unchecked") + @Override + public Object getActualInstance() { + return super.getActualInstance(); + } + + /** + * Get the actual instance of `IsPostedResponse`. If the actual instance is not `IsPostedResponse`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `IsPostedResponse` + * @throws ClassCastException if the instance is not `IsPostedResponse` + */ + public IsPostedResponse getIsPostedResponse() throws ClassCastException { + return (IsPostedResponse)super.getActualInstance(); + } + + /** + * Get the actual instance of `AuthResponse`. If the actual instance is not `AuthResponse`, + * the ClassCastException will be thrown. + * + * @return The actual instance of `AuthResponse` + * @throws ClassCastException if the instance is not `AuthResponse` + */ + public AuthResponse getAuthResponse() throws ClassCastException { + return (AuthResponse)super.getActualInstance(); + } + + /** + * 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 VerifyPhoneOtp200Response + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + // validate oneOf schemas one by one + int validCount = 0; + ArrayList<String> errorMessages = new ArrayList<>(); + // validate the json string with IsPostedResponse + try { + IsPostedResponse.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for IsPostedResponse failed with `%s`.", e.getMessage())); + // continue to the next one + } + // validate the json string with AuthResponse + try { + AuthResponse.validateJsonElement(jsonElement); + validCount++; + } catch (Exception e) { + errorMessages.add(String.format("Deserialization for AuthResponse failed with `%s`.", e.getMessage())); + // continue to the next one + } + if (validCount != 1) { + throw new IOException(String.format("The JSON string is invalid for VerifyPhoneOtp200Response with oneOf schemas: AuthResponse, IsPostedResponse. %d class(es) match the result, expected 1. Detailed failure message for oneOf schemas: %s. JSON: %s", validCount, errorMessages, jsonElement.toString())); + } + } + + /** + * Create an instance of VerifyPhoneOtp200Response given an JSON string + * + * @param jsonString JSON string + * @return An instance of VerifyPhoneOtp200Response + * @throws IOException if the JSON string is invalid with respect to VerifyPhoneOtp200Response + */ + public static VerifyPhoneOtp200Response fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VerifyPhoneOtp200Response.class); + } + + /** + * Convert an instance of VerifyPhoneOtp200Response to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/VersionListResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/VersionListResponse.java new file mode 100644 index 0000000..88cc7ca --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/VersionListResponse.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.VersionListResponseDataInner; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * VersionListResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class VersionListResponse { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<VersionListResponseDataInner> data = new ArrayList<>(); + + public VersionListResponse() { + } + + public VersionListResponse data(@javax.annotation.Nullable List<VersionListResponseDataInner> data) { + this.data = data; + return this; + } + + public VersionListResponse addDataItem(VersionListResponseDataInner dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<VersionListResponseDataInner> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<VersionListResponseDataInner> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the VersionListResponse instance itself + */ + public VersionListResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VersionListResponse versionListResponse = (VersionListResponse) o; + return Objects.equals(this.data, versionListResponse.data)&& + Objects.equals(this.additionalProperties, versionListResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VersionListResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 VersionListResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!VersionListResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in VersionListResponse is not found in the empty JSON string", VersionListResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + VersionListResponseDataInner.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!VersionListResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VersionListResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<VersionListResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(VersionListResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<VersionListResponse>() { + @Override + public void write(JsonWriter out, VersionListResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public VersionListResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + VersionListResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of VersionListResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of VersionListResponse + * @throws IOException if the JSON string is invalid with respect to VersionListResponse + */ + public static VersionListResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VersionListResponse.class); + } + + /** + * Convert an instance of VersionListResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/VersionListResponseDataInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/VersionListResponseDataInner.java new file mode 100644 index 0000000..83bacaa --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/VersionListResponseDataInner.java @@ -0,0 +1,315 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.time.OffsetDateTime; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * VersionListResponseDataInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class VersionListResponseDataInner { + public static final String SERIALIZED_NAME_VERSION_ID = "versionId"; + @SerializedName(SERIALIZED_NAME_VERSION_ID) + @javax.annotation.Nullable + private String versionId; + + public static final String SERIALIZED_NAME_CREATED_DATE = "createdDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public VersionListResponseDataInner() { + } + + public VersionListResponseDataInner versionId(@javax.annotation.Nullable String versionId) { + this.versionId = versionId; + return this; + } + + /** + * The version ID of the workflow. + * @return versionId + */ + @javax.annotation.Nullable + public String getVersionId() { + return versionId; + } + + public void setVersionId(@javax.annotation.Nullable String versionId) { + this.versionId = versionId; + } + + + public VersionListResponseDataInner createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * The creation date of the workflow version. + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the VersionListResponseDataInner instance itself + */ + public VersionListResponseDataInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + VersionListResponseDataInner versionListResponseDataInner = (VersionListResponseDataInner) o; + return Objects.equals(this.versionId, versionListResponseDataInner.versionId) && + Objects.equals(this.createdDate, versionListResponseDataInner.createdDate)&& + Objects.equals(this.additionalProperties, versionListResponseDataInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(versionId, createdDate, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class VersionListResponseDataInner {\n"); + sb.append(" versionId: ").append(toIndentedString(versionId)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("versionId"); + openapiFields.add("createdDate"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 VersionListResponseDataInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!VersionListResponseDataInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in VersionListResponseDataInner is not found in the empty JSON string", VersionListResponseDataInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("versionId") != null && !jsonObj.get("versionId").isJsonNull()) && !jsonObj.get("versionId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `versionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("versionId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!VersionListResponseDataInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'VersionListResponseDataInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<VersionListResponseDataInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(VersionListResponseDataInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<VersionListResponseDataInner>() { + @Override + public void write(JsonWriter out, VersionListResponseDataInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public VersionListResponseDataInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + VersionListResponseDataInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of VersionListResponseDataInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of VersionListResponseDataInner + * @throws IOException if the JSON string is invalid with respect to VersionListResponseDataInner + */ + public static VersionListResponseDataInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, VersionListResponseDataInner.class); + } + + /** + * Convert an instance of VersionListResponseDataInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/WebhookAuthentication.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/WebhookAuthentication.java new file mode 100644 index 0000000..ada81ac --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/WebhookAuthentication.java @@ -0,0 +1,407 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.BasicAuthWebhook; +import com.loginradius.sdk.internal.openapi.model.Bearertoken; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * WebhookAuthentication + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class WebhookAuthentication { + /** + * The type of authentication used for the webhook + */ + @JsonAdapter(AuthTypeEnum.Adapter.class) + public enum AuthTypeEnum { + BASIC("Basic"), + + BEARER("Bearer"); + + private String value; + + AuthTypeEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static AuthTypeEnum fromValue(String value) { + for (AuthTypeEnum b : AuthTypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<AuthTypeEnum> { + @Override + public void write(final JsonWriter jsonWriter, final AuthTypeEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public AuthTypeEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return AuthTypeEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + AuthTypeEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_AUTH_TYPE = "AuthType"; + @SerializedName(SERIALIZED_NAME_AUTH_TYPE) + @javax.annotation.Nullable + private AuthTypeEnum authType; + + public static final String SERIALIZED_NAME_BASIC_AUTH = "BasicAuth"; + @SerializedName(SERIALIZED_NAME_BASIC_AUTH) + @javax.annotation.Nullable + private BasicAuthWebhook basicAuth; + + public static final String SERIALIZED_NAME_BEARER_TOKEN = "BearerToken"; + @SerializedName(SERIALIZED_NAME_BEARER_TOKEN) + @javax.annotation.Nullable + private Bearertoken bearerToken; + + public WebhookAuthentication() { + } + + public WebhookAuthentication authType(@javax.annotation.Nullable AuthTypeEnum authType) { + this.authType = authType; + return this; + } + + /** + * The type of authentication used for the webhook + * @return authType + */ + @javax.annotation.Nullable + public AuthTypeEnum getAuthType() { + return authType; + } + + public void setAuthType(@javax.annotation.Nullable AuthTypeEnum authType) { + this.authType = authType; + } + + + public WebhookAuthentication basicAuth(@javax.annotation.Nullable BasicAuthWebhook basicAuth) { + this.basicAuth = basicAuth; + return this; + } + + /** + * Get basicAuth + * @return basicAuth + */ + @javax.annotation.Nullable + public BasicAuthWebhook getBasicAuth() { + return basicAuth; + } + + public void setBasicAuth(@javax.annotation.Nullable BasicAuthWebhook basicAuth) { + this.basicAuth = basicAuth; + } + + + public WebhookAuthentication bearerToken(@javax.annotation.Nullable Bearertoken bearerToken) { + this.bearerToken = bearerToken; + return this; + } + + /** + * Get bearerToken + * @return bearerToken + */ + @javax.annotation.Nullable + public Bearertoken getBearerToken() { + return bearerToken; + } + + public void setBearerToken(@javax.annotation.Nullable Bearertoken bearerToken) { + this.bearerToken = bearerToken; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the WebhookAuthentication instance itself + */ + public WebhookAuthentication putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebhookAuthentication webhookAuthentication = (WebhookAuthentication) o; + return Objects.equals(this.authType, webhookAuthentication.authType) && + Objects.equals(this.basicAuth, webhookAuthentication.basicAuth) && + Objects.equals(this.bearerToken, webhookAuthentication.bearerToken)&& + Objects.equals(this.additionalProperties, webhookAuthentication.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(authType, basicAuth, bearerToken, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebhookAuthentication {\n"); + sb.append(" authType: ").append(toIndentedString(authType)).append("\n"); + sb.append(" basicAuth: ").append(toIndentedString(basicAuth)).append("\n"); + sb.append(" bearerToken: ").append(toIndentedString(bearerToken)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("AuthType"); + openapiFields.add("BasicAuth"); + openapiFields.add("BearerToken"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 WebhookAuthentication + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebhookAuthentication.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookAuthentication is not found in the empty JSON string", WebhookAuthentication.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("AuthType") != null && !jsonObj.get("AuthType").isJsonNull()) && !jsonObj.get("AuthType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `AuthType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("AuthType").toString())); + } + // validate the optional field `AuthType` + if (jsonObj.get("AuthType") != null && !jsonObj.get("AuthType").isJsonNull()) { + AuthTypeEnum.validateJsonElement(jsonObj.get("AuthType")); + } + // validate the optional field `BasicAuth` + if (jsonObj.get("BasicAuth") != null && !jsonObj.get("BasicAuth").isJsonNull()) { + BasicAuthWebhook.validateJsonElement(jsonObj.get("BasicAuth")); + } + // validate the optional field `BearerToken` + if (jsonObj.get("BearerToken") != null && !jsonObj.get("BearerToken").isJsonNull()) { + Bearertoken.validateJsonElement(jsonObj.get("BearerToken")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!WebhookAuthentication.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebhookAuthentication' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<WebhookAuthentication> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebhookAuthentication.class)); + + return (TypeAdapter<T>) new TypeAdapter<WebhookAuthentication>() { + @Override + public void write(JsonWriter out, WebhookAuthentication value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public WebhookAuthentication read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + WebhookAuthentication instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebhookAuthentication given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebhookAuthentication + * @throws IOException if the JSON string is invalid with respect to WebhookAuthentication + */ + public static WebhookAuthentication fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebhookAuthentication.class); + } + + /** + * Convert an instance of WebhookAuthentication to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/WebhookEvents.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/WebhookEvents.java new file mode 100644 index 0000000..56314f5 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/WebhookEvents.java @@ -0,0 +1,158 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.model; + +import java.util.Objects; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.JsonElement; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * Gets or Sets WebhookEvents + */ +@JsonAdapter(WebhookEvents.Adapter.class) +public enum WebhookEvents { + + LOGIN("Login"), + + REGISTER("Register"), + + UPDATE_PROFILE("UpdateProfile"), + + RESET_PASSWORD("ResetPassword"), + + CHANGE_PASSWORD("ChangePassword"), + + EMAIL_VERIFICATION("EmailVerification"), + + ADD_EMAIL("AddEmail"), + + REMOVE_EMAIL("RemoveEmail"), + + BLOCK_ACCOUNT("BlockAccount"), + + DELETE_ACCOUNT("DeleteAccount"), + + SET_USERNAME("SetUsername"), + + ASSIGN_ROLES("AssignRoles"), + + UNASSIGN_ROLES("UnassignRoles"), + + SET_PASSWORD("SetPassword"), + + LINK_ACCOUNT("LinkAccount"), + + UNLINK_ACCOUNT("UnlinkAccount"), + + UPDATE_PHONE_ID("UpdatePhoneId"), + + VERIFY_PHONE_NUMBER("VerifyPhoneNumber"), + + INVALIDATE_EMAIL_VERIFICATION("InvalidateEmailVerification"), + + REMOVE_ROLE_CONTEXT("RemoveRoleContext"), + + CREATE_CUSTOM_OBJECT("CreateCustomObject"), + + UPDATE_CUSTOM_OBJECT("UpdateCustomObject"), + + DELETE_CUSTOM_OBJECT("DeleteCustomObject"), + + INVALIDATE_PHONE_VERIFICATION("InvalidatePhoneVerification"), + + REMOVE_PHONE_ID("RemovePhoneId"), + + CONSENT_PROFILE_UPDATE("ConsentProfileUpdate"), + + SET_PIN("SetPIN"), + + RESET_PIN("ResetPIN"), + + CHANGE_PIN("ChangePIN"), + + ORG_CREATED("OrgCreated"), + + ORG_UPDATED("OrgUpdated"), + + ORG_DELETED("OrgDeleted"), + + ORG_ROLE_CREATED("OrgRoleCreated"), + + ORG_ROLE_UPDATED("OrgRoleUpdated"), + + ORG_ROLE_DELETED("OrgRoleDeleted"), + + ORG_CONNECTION_CREATED("OrgConnectionCreated"), + + ORG_CONNECTION_UPDATED("OrgConnectionUpdated"), + + ORG_CONNECTION_DELETED("OrgConnectionDeleted"), + + ORG_MEMBERSHIP_CREATED("OrgMembershipCreated"), + + ORG_MEMBERSHIP_UPDATED("OrgMembershipUpdated"), + + ORG_MEMBERSHIP_DELETED("OrgMembershipDeleted"), + + ORG_INVITATION_CREATED("OrgInvitationCreated"); + + private String value; + + WebhookEvents(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static WebhookEvents fromValue(String value) { + for (WebhookEvents b : WebhookEvents.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<WebhookEvents> { + @Override + public void write(final JsonWriter jsonWriter, final WebhookEvents enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public WebhookEvents read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return WebhookEvents.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + WebhookEvents.fromValue(value); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/WebhookSubscription.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/WebhookSubscription.java new file mode 100644 index 0000000..fd0a88f --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/WebhookSubscription.java @@ -0,0 +1,593 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.WebhookAuthentication; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * WebhookSubscription + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class WebhookSubscription { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_TARGET_URL = "TargetUrl"; + @SerializedName(SERIALIZED_NAME_TARGET_URL) + @javax.annotation.Nullable + private String targetUrl; + + public static final String SERIALIZED_NAME_EVENT = "Event"; + @SerializedName(SERIALIZED_NAME_EVENT) + @javax.annotation.Nullable + private String event; + + public static final String SERIALIZED_NAME_CREATED_DATE = "CreatedDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public static final String SERIALIZED_NAME_LAST_MODIFIED_DATE = "LastModifiedDate"; + @SerializedName(SERIALIZED_NAME_LAST_MODIFIED_DATE) + @javax.annotation.Nullable + private OffsetDateTime lastModifiedDate; + + public static final String SERIALIZED_NAME_SECRET_NAME = "SecretName"; + @SerializedName(SERIALIZED_NAME_SECRET_NAME) + @javax.annotation.Nullable + private String secretName; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_IS_INTEGRATION_WEBHOOK = "IsIntegrationWebhook"; + @SerializedName(SERIALIZED_NAME_IS_INTEGRATION_WEBHOOK) + @javax.annotation.Nullable + private Boolean isIntegrationWebhook; + + public static final String SERIALIZED_NAME_HEADERS = "Headers"; + @SerializedName(SERIALIZED_NAME_HEADERS) + @javax.annotation.Nullable + private Map<String, String> headers = new HashMap<>(); + + public static final String SERIALIZED_NAME_QUERY_PARAMS = "QueryParams"; + @SerializedName(SERIALIZED_NAME_QUERY_PARAMS) + @javax.annotation.Nullable + private Map<String, String> queryParams = new HashMap<>(); + + public static final String SERIALIZED_NAME_AUTHENTICATION = "Authentication"; + @SerializedName(SERIALIZED_NAME_AUTHENTICATION) + @javax.annotation.Nullable + private WebhookAuthentication authentication; + + public WebhookSubscription() { + } + + public WebhookSubscription id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * The unique identifier for the webhook subscription + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public WebhookSubscription targetUrl(@javax.annotation.Nullable String targetUrl) { + this.targetUrl = targetUrl; + return this; + } + + /** + * The target URL for the webhook + * @return targetUrl + */ + @javax.annotation.Nullable + public String getTargetUrl() { + return targetUrl; + } + + public void setTargetUrl(@javax.annotation.Nullable String targetUrl) { + this.targetUrl = targetUrl; + } + + + public WebhookSubscription event(@javax.annotation.Nullable String event) { + this.event = event; + return this; + } + + /** + * The event that triggers the webhook + * @return event + */ + @javax.annotation.Nullable + public String getEvent() { + return event; + } + + public void setEvent(@javax.annotation.Nullable String event) { + this.event = event; + } + + + public WebhookSubscription createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * The date when the webhook subscription was created + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + + public WebhookSubscription lastModifiedDate(@javax.annotation.Nullable OffsetDateTime lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + return this; + } + + /** + * The date when the webhook subscription was last modified + * @return lastModifiedDate + */ + @javax.annotation.Nullable + public OffsetDateTime getLastModifiedDate() { + return lastModifiedDate; + } + + public void setLastModifiedDate(@javax.annotation.Nullable OffsetDateTime lastModifiedDate) { + this.lastModifiedDate = lastModifiedDate; + } + + + public WebhookSubscription secretName(@javax.annotation.Nullable String secretName) { + this.secretName = secretName; + return this; + } + + /** + * The name of the secret used for the webhook + * @return secretName + */ + @javax.annotation.Nullable + public String getSecretName() { + return secretName; + } + + public void setSecretName(@javax.annotation.Nullable String secretName) { + this.secretName = secretName; + } + + + public WebhookSubscription name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the webhook subscription + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public WebhookSubscription isIntegrationWebhook(@javax.annotation.Nullable Boolean isIntegrationWebhook) { + this.isIntegrationWebhook = isIntegrationWebhook; + return this; + } + + /** + * Indicates if the webhook is an integration webhook + * @return isIntegrationWebhook + */ + @javax.annotation.Nullable + public Boolean getIsIntegrationWebhook() { + return isIntegrationWebhook; + } + + public void setIsIntegrationWebhook(@javax.annotation.Nullable Boolean isIntegrationWebhook) { + this.isIntegrationWebhook = isIntegrationWebhook; + } + + + public WebhookSubscription headers(@javax.annotation.Nullable Map<String, String> headers) { + this.headers = headers; + return this; + } + + public WebhookSubscription putHeadersItem(String key, String headersItem) { + if (this.headers == null) { + this.headers = new HashMap<>(); + } + this.headers.put(key, headersItem); + return this; + } + + /** + * The headers to be included in the webhook request + * @return headers + */ + @javax.annotation.Nullable + public Map<String, String> getHeaders() { + return headers; + } + + public void setHeaders(@javax.annotation.Nullable Map<String, String> headers) { + this.headers = headers; + } + + + public WebhookSubscription queryParams(@javax.annotation.Nullable Map<String, String> queryParams) { + this.queryParams = queryParams; + return this; + } + + public WebhookSubscription putQueryParamsItem(String key, String queryParamsItem) { + if (this.queryParams == null) { + this.queryParams = new HashMap<>(); + } + this.queryParams.put(key, queryParamsItem); + return this; + } + + /** + * The query parameters to be included in the webhook request + * @return queryParams + */ + @javax.annotation.Nullable + public Map<String, String> getQueryParams() { + return queryParams; + } + + public void setQueryParams(@javax.annotation.Nullable Map<String, String> queryParams) { + this.queryParams = queryParams; + } + + + public WebhookSubscription authentication(@javax.annotation.Nullable WebhookAuthentication authentication) { + this.authentication = authentication; + return this; + } + + /** + * Get authentication + * @return authentication + */ + @javax.annotation.Nullable + public WebhookAuthentication getAuthentication() { + return authentication; + } + + public void setAuthentication(@javax.annotation.Nullable WebhookAuthentication authentication) { + this.authentication = authentication; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the WebhookSubscription instance itself + */ + public WebhookSubscription putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebhookSubscription webhookSubscription = (WebhookSubscription) o; + return Objects.equals(this.id, webhookSubscription.id) && + Objects.equals(this.targetUrl, webhookSubscription.targetUrl) && + Objects.equals(this.event, webhookSubscription.event) && + Objects.equals(this.createdDate, webhookSubscription.createdDate) && + Objects.equals(this.lastModifiedDate, webhookSubscription.lastModifiedDate) && + Objects.equals(this.secretName, webhookSubscription.secretName) && + Objects.equals(this.name, webhookSubscription.name) && + Objects.equals(this.isIntegrationWebhook, webhookSubscription.isIntegrationWebhook) && + Objects.equals(this.headers, webhookSubscription.headers) && + Objects.equals(this.queryParams, webhookSubscription.queryParams) && + Objects.equals(this.authentication, webhookSubscription.authentication)&& + Objects.equals(this.additionalProperties, webhookSubscription.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, targetUrl, event, createdDate, lastModifiedDate, secretName, name, isIntegrationWebhook, headers, queryParams, authentication, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebhookSubscription {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" targetUrl: ").append(toIndentedString(targetUrl)).append("\n"); + sb.append(" event: ").append(toIndentedString(event)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" lastModifiedDate: ").append(toIndentedString(lastModifiedDate)).append("\n"); + sb.append(" secretName: ").append(toIndentedString(secretName)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" isIntegrationWebhook: ").append(toIndentedString(isIntegrationWebhook)).append("\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append(" queryParams: ").append(toIndentedString(queryParams)).append("\n"); + sb.append(" authentication: ").append(toIndentedString(authentication)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("TargetUrl"); + openapiFields.add("Event"); + openapiFields.add("CreatedDate"); + openapiFields.add("LastModifiedDate"); + openapiFields.add("SecretName"); + openapiFields.add("Name"); + openapiFields.add("IsIntegrationWebhook"); + openapiFields.add("Headers"); + openapiFields.add("QueryParams"); + openapiFields.add("Authentication"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 WebhookSubscription + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebhookSubscription.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookSubscription is not found in the empty JSON string", WebhookSubscription.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("TargetUrl") != null && !jsonObj.get("TargetUrl").isJsonNull()) && !jsonObj.get("TargetUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TargetUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TargetUrl").toString())); + } + if ((jsonObj.get("Event") != null && !jsonObj.get("Event").isJsonNull()) && !jsonObj.get("Event").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Event` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Event").toString())); + } + if ((jsonObj.get("SecretName") != null && !jsonObj.get("SecretName").isJsonNull()) && !jsonObj.get("SecretName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SecretName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SecretName").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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())); + } + // validate the optional field `Authentication` + if (jsonObj.get("Authentication") != null && !jsonObj.get("Authentication").isJsonNull()) { + WebhookAuthentication.validateJsonElement(jsonObj.get("Authentication")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!WebhookSubscription.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebhookSubscription' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<WebhookSubscription> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebhookSubscription.class)); + + return (TypeAdapter<T>) new TypeAdapter<WebhookSubscription>() { + @Override + public void write(JsonWriter out, WebhookSubscription value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public WebhookSubscription read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + WebhookSubscription instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebhookSubscription given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebhookSubscription + * @throws IOException if the JSON string is invalid with respect to WebhookSubscription + */ + public static WebhookSubscription fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebhookSubscription.class); + } + + /** + * Convert an instance of WebhookSubscription to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/WebhookSubscriptionCreateModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/WebhookSubscriptionCreateModel.java new file mode 100644 index 0000000..4647aa2 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/WebhookSubscriptionCreateModel.java @@ -0,0 +1,628 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.WebhookAuthentication; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * WebhookSubscriptionCreateModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class WebhookSubscriptionCreateModel { + /** + * The event that triggers the webhook + */ + @JsonAdapter(EventEnum.Adapter.class) + public enum EventEnum { + LOGIN("Login"), + + REGISTER("Register"), + + UPDATE_PROFILE("UpdateProfile"), + + RESET_PASSWORD("ResetPassword"), + + CHANGE_PASSWORD("ChangePassword"), + + EMAIL_VERIFICATION("EmailVerification"), + + ADD_EMAIL("AddEmail"), + + REMOVE_EMAIL("RemoveEmail"), + + BLOCK_ACCOUNT("BlockAccount"), + + DELETE_ACCOUNT("DeleteAccount"), + + SET_USERNAME("SetUsername"), + + ASSIGN_ROLES("AssignRoles"), + + UNASSIGN_ROLES("UnassignRoles"), + + SET_PASSWORD("SetPassword"), + + LINK_ACCOUNT("LinkAccount"), + + UNLINK_ACCOUNT("UnlinkAccount"), + + UPDATE_PHONE_ID("UpdatePhoneId"), + + VERIFY_PHONE_NUMBER("VerifyPhoneNumber"), + + INVALIDATE_EMAIL_VERIFICATION("InvalidateEmailVerification"), + + REMOVE_ROLE_CONTEXT("RemoveRoleContext"), + + CREATE_CUSTOM_OBJECT("CreateCustomObject"), + + UPDATE_CUSTOM_OBJECT("UpdateCustomObject"), + + DELETE_CUSTOM_OBJECT("DeleteCustomObject"), + + INVALIDATE_PHONE_VERIFICATION("InvalidatePhoneVerification"), + + REMOVE_PHONE_ID("RemovePhoneId"), + + CONSENT_PROFILE_UPDATE("ConsentProfileUpdate"), + + SET_PIN("SetPIN"), + + RESET_PIN("ResetPIN"), + + CHANGE_PIN("ChangePIN"); + + private String value; + + EventEnum(String value) { + this.value = value; + } + + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static EventEnum fromValue(String value) { + for (EventEnum b : EventEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } + + public static class Adapter extends TypeAdapter<EventEnum> { + @Override + public void write(final JsonWriter jsonWriter, final EventEnum enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public EventEnum read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return EventEnum.fromValue(value); + } + } + + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + String value = jsonElement.getAsString(); + EventEnum.fromValue(value); + } + } + + public static final String SERIALIZED_NAME_EVENT = "Event"; + @SerializedName(SERIALIZED_NAME_EVENT) + @javax.annotation.Nonnull + private EventEnum event; + + public static final String SERIALIZED_NAME_TARGET_URL = "TargetUrl"; + @SerializedName(SERIALIZED_NAME_TARGET_URL) + @javax.annotation.Nonnull + private String targetUrl; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_SECRET_NAME = "SecretName"; + @SerializedName(SERIALIZED_NAME_SECRET_NAME) + @javax.annotation.Nullable + private String secretName; + + public static final String SERIALIZED_NAME_CUSTOM_OBJECTS = "CustomObjects"; + @SerializedName(SERIALIZED_NAME_CUSTOM_OBJECTS) + @javax.annotation.Nullable + private String customObjects; + + public static final String SERIALIZED_NAME_HEADERS = "Headers"; + @SerializedName(SERIALIZED_NAME_HEADERS) + @javax.annotation.Nullable + private Map<String, String> headers = new HashMap<>(); + + public static final String SERIALIZED_NAME_QUERY_PARAMS = "QueryParams"; + @SerializedName(SERIALIZED_NAME_QUERY_PARAMS) + @javax.annotation.Nullable + private Map<String, String> queryParams = new HashMap<>(); + + public static final String SERIALIZED_NAME_AUTHENTICATION = "Authentication"; + @SerializedName(SERIALIZED_NAME_AUTHENTICATION) + @javax.annotation.Nullable + private WebhookAuthentication authentication; + + public WebhookSubscriptionCreateModel() { + } + + public WebhookSubscriptionCreateModel event(@javax.annotation.Nonnull EventEnum event) { + this.event = event; + return this; + } + + /** + * The event that triggers the webhook + * @return event + */ + @javax.annotation.Nonnull + public EventEnum getEvent() { + return event; + } + + public void setEvent(@javax.annotation.Nonnull EventEnum event) { + this.event = event; + } + + + public WebhookSubscriptionCreateModel targetUrl(@javax.annotation.Nonnull String targetUrl) { + this.targetUrl = targetUrl; + return this; + } + + /** + * The target URL for the webhook + * @return targetUrl + */ + @javax.annotation.Nonnull + public String getTargetUrl() { + return targetUrl; + } + + public void setTargetUrl(@javax.annotation.Nonnull String targetUrl) { + this.targetUrl = targetUrl; + } + + + public WebhookSubscriptionCreateModel name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the webhook subscription + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public WebhookSubscriptionCreateModel secretName(@javax.annotation.Nullable String secretName) { + this.secretName = secretName; + return this; + } + + /** + * The name of the secret used for the webhook + * @return secretName + */ + @javax.annotation.Nullable + public String getSecretName() { + return secretName; + } + + public void setSecretName(@javax.annotation.Nullable String secretName) { + this.secretName = secretName; + } + + + public WebhookSubscriptionCreateModel customObjects(@javax.annotation.Nullable String customObjects) { + this.customObjects = customObjects; + return this; + } + + /** + * Custom Objects associated with the webhook + * @return customObjects + */ + @javax.annotation.Nullable + public String getCustomObjects() { + return customObjects; + } + + public void setCustomObjects(@javax.annotation.Nullable String customObjects) { + this.customObjects = customObjects; + } + + + public WebhookSubscriptionCreateModel headers(@javax.annotation.Nullable Map<String, String> headers) { + this.headers = headers; + return this; + } + + public WebhookSubscriptionCreateModel putHeadersItem(String key, String headersItem) { + if (this.headers == null) { + this.headers = new HashMap<>(); + } + this.headers.put(key, headersItem); + return this; + } + + /** + * The headers to be included in the webhook request + * @return headers + */ + @javax.annotation.Nullable + public Map<String, String> getHeaders() { + return headers; + } + + public void setHeaders(@javax.annotation.Nullable Map<String, String> headers) { + this.headers = headers; + } + + + public WebhookSubscriptionCreateModel queryParams(@javax.annotation.Nullable Map<String, String> queryParams) { + this.queryParams = queryParams; + return this; + } + + public WebhookSubscriptionCreateModel putQueryParamsItem(String key, String queryParamsItem) { + if (this.queryParams == null) { + this.queryParams = new HashMap<>(); + } + this.queryParams.put(key, queryParamsItem); + return this; + } + + /** + * The query parameters to be included in the webhook request + * @return queryParams + */ + @javax.annotation.Nullable + public Map<String, String> getQueryParams() { + return queryParams; + } + + public void setQueryParams(@javax.annotation.Nullable Map<String, String> queryParams) { + this.queryParams = queryParams; + } + + + public WebhookSubscriptionCreateModel authentication(@javax.annotation.Nullable WebhookAuthentication authentication) { + this.authentication = authentication; + return this; + } + + /** + * Get authentication + * @return authentication + */ + @javax.annotation.Nullable + public WebhookAuthentication getAuthentication() { + return authentication; + } + + public void setAuthentication(@javax.annotation.Nullable WebhookAuthentication authentication) { + this.authentication = authentication; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the WebhookSubscriptionCreateModel instance itself + */ + public WebhookSubscriptionCreateModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebhookSubscriptionCreateModel webhookSubscriptionCreateModel = (WebhookSubscriptionCreateModel) o; + return Objects.equals(this.event, webhookSubscriptionCreateModel.event) && + Objects.equals(this.targetUrl, webhookSubscriptionCreateModel.targetUrl) && + Objects.equals(this.name, webhookSubscriptionCreateModel.name) && + Objects.equals(this.secretName, webhookSubscriptionCreateModel.secretName) && + Objects.equals(this.customObjects, webhookSubscriptionCreateModel.customObjects) && + Objects.equals(this.headers, webhookSubscriptionCreateModel.headers) && + Objects.equals(this.queryParams, webhookSubscriptionCreateModel.queryParams) && + Objects.equals(this.authentication, webhookSubscriptionCreateModel.authentication)&& + Objects.equals(this.additionalProperties, webhookSubscriptionCreateModel.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(event, targetUrl, name, secretName, customObjects, headers, queryParams, authentication, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebhookSubscriptionCreateModel {\n"); + sb.append(" event: ").append(toIndentedString(event)).append("\n"); + sb.append(" targetUrl: ").append(toIndentedString(targetUrl)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" secretName: ").append(toIndentedString(secretName)).append("\n"); + sb.append(" customObjects: ").append(toIndentedString(customObjects)).append("\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append(" queryParams: ").append(toIndentedString(queryParams)).append("\n"); + sb.append(" authentication: ").append(toIndentedString(authentication)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Event"); + openapiFields.add("TargetUrl"); + openapiFields.add("Name"); + openapiFields.add("SecretName"); + openapiFields.add("CustomObjects"); + openapiFields.add("Headers"); + openapiFields.add("QueryParams"); + openapiFields.add("Authentication"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("Event"); + openapiRequiredFields.add("TargetUrl"); + } + + /** + * 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 WebhookSubscriptionCreateModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebhookSubscriptionCreateModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookSubscriptionCreateModel is not found in the empty JSON string", WebhookSubscriptionCreateModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebhookSubscriptionCreateModel.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("Event").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Event` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Event").toString())); + } + // validate the required field `Event` + EventEnum.validateJsonElement(jsonObj.get("Event")); + if (!jsonObj.get("TargetUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TargetUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TargetUrl").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("SecretName") != null && !jsonObj.get("SecretName").isJsonNull()) && !jsonObj.get("SecretName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SecretName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SecretName").toString())); + } + if ((jsonObj.get("CustomObjects") != null && !jsonObj.get("CustomObjects").isJsonNull()) && !jsonObj.get("CustomObjects").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CustomObjects` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CustomObjects").toString())); + } + // validate the optional field `Authentication` + if (jsonObj.get("Authentication") != null && !jsonObj.get("Authentication").isJsonNull()) { + WebhookAuthentication.validateJsonElement(jsonObj.get("Authentication")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!WebhookSubscriptionCreateModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebhookSubscriptionCreateModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<WebhookSubscriptionCreateModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebhookSubscriptionCreateModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<WebhookSubscriptionCreateModel>() { + @Override + public void write(JsonWriter out, WebhookSubscriptionCreateModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public WebhookSubscriptionCreateModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + WebhookSubscriptionCreateModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebhookSubscriptionCreateModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebhookSubscriptionCreateModel + * @throws IOException if the JSON string is invalid with respect to WebhookSubscriptionCreateModel + */ + public static WebhookSubscriptionCreateModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebhookSubscriptionCreateModel.class); + } + + /** + * Convert an instance of WebhookSubscriptionCreateModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/WebhookSubscriptionResponse.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/WebhookSubscriptionResponse.java new file mode 100644 index 0000000..9e23c53 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/WebhookSubscriptionResponse.java @@ -0,0 +1,309 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.WebhookSubscription; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * WebhookSubscriptionResponse + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class WebhookSubscriptionResponse { + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private List<WebhookSubscription> data = new ArrayList<>(); + + public WebhookSubscriptionResponse() { + } + + public WebhookSubscriptionResponse data(@javax.annotation.Nullable List<WebhookSubscription> data) { + this.data = data; + return this; + } + + public WebhookSubscriptionResponse addDataItem(WebhookSubscription dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public List<WebhookSubscription> getData() { + return data; + } + + public void setData(@javax.annotation.Nullable List<WebhookSubscription> data) { + this.data = data; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the WebhookSubscriptionResponse instance itself + */ + public WebhookSubscriptionResponse putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebhookSubscriptionResponse webhookSubscriptionResponse = (WebhookSubscriptionResponse) o; + return Objects.equals(this.data, webhookSubscriptionResponse.data)&& + Objects.equals(this.additionalProperties, webhookSubscriptionResponse.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(data, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebhookSubscriptionResponse {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Data"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 WebhookSubscriptionResponse + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebhookSubscriptionResponse.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookSubscriptionResponse is not found in the empty JSON string", WebhookSubscriptionResponse.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if (jsonObj.get("Data") != null && !jsonObj.get("Data").isJsonNull()) { + JsonArray jsonArraydata = jsonObj.getAsJsonArray("Data"); + if (jsonArraydata != null) { + // ensure the json data is an array + if (!jsonObj.get("Data").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `Data` to be an array in the JSON string but got `%s`", jsonObj.get("Data").toString())); + } + + // validate the optional field `Data` (array) + for (int i = 0; i < jsonArraydata.size(); i++) { + WebhookSubscription.validateJsonElement(jsonArraydata.get(i)); + }; + } + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!WebhookSubscriptionResponse.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebhookSubscriptionResponse' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<WebhookSubscriptionResponse> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebhookSubscriptionResponse.class)); + + return (TypeAdapter<T>) new TypeAdapter<WebhookSubscriptionResponse>() { + @Override + public void write(JsonWriter out, WebhookSubscriptionResponse value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public WebhookSubscriptionResponse read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + WebhookSubscriptionResponse instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebhookSubscriptionResponse given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebhookSubscriptionResponse + * @throws IOException if the JSON string is invalid with respect to WebhookSubscriptionResponse + */ + public static WebhookSubscriptionResponse fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebhookSubscriptionResponse.class); + } + + /** + * Convert an instance of WebhookSubscriptionResponse to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/WebhookSubscriptionUpdateModel.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/WebhookSubscriptionUpdateModel.java new file mode 100644 index 0000000..ff6f02c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/WebhookSubscriptionUpdateModel.java @@ -0,0 +1,501 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.WebhookAuthentication; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * WebhookSubscriptionUpdateModel + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class WebhookSubscriptionUpdateModel { + public static final String SERIALIZED_NAME_TARGET_URL = "TargetUrl"; + @SerializedName(SERIALIZED_NAME_TARGET_URL) + @javax.annotation.Nonnull + private String targetUrl; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_SECRET_NAME = "SecretName"; + @SerializedName(SERIALIZED_NAME_SECRET_NAME) + @javax.annotation.Nullable + private String secretName; + + public static final String SERIALIZED_NAME_CUSTOM_OBJECTS = "CustomObjects"; + @SerializedName(SERIALIZED_NAME_CUSTOM_OBJECTS) + @javax.annotation.Nullable + private String customObjects; + + public static final String SERIALIZED_NAME_HEADERS = "Headers"; + @SerializedName(SERIALIZED_NAME_HEADERS) + @javax.annotation.Nullable + private Map<String, String> headers = new HashMap<>(); + + public static final String SERIALIZED_NAME_QUERY_PARAMS = "QueryParams"; + @SerializedName(SERIALIZED_NAME_QUERY_PARAMS) + @javax.annotation.Nullable + private Map<String, String> queryParams = new HashMap<>(); + + public static final String SERIALIZED_NAME_AUTHENTICATION = "Authentication"; + @SerializedName(SERIALIZED_NAME_AUTHENTICATION) + @javax.annotation.Nullable + private WebhookAuthentication authentication; + + public WebhookSubscriptionUpdateModel() { + } + + public WebhookSubscriptionUpdateModel targetUrl(@javax.annotation.Nonnull String targetUrl) { + this.targetUrl = targetUrl; + return this; + } + + /** + * The target URL for the webhook + * @return targetUrl + */ + @javax.annotation.Nonnull + public String getTargetUrl() { + return targetUrl; + } + + public void setTargetUrl(@javax.annotation.Nonnull String targetUrl) { + this.targetUrl = targetUrl; + } + + + public WebhookSubscriptionUpdateModel name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * The name of the webhook subscription + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public WebhookSubscriptionUpdateModel secretName(@javax.annotation.Nullable String secretName) { + this.secretName = secretName; + return this; + } + + /** + * The name of the secret used for the webhook + * @return secretName + */ + @javax.annotation.Nullable + public String getSecretName() { + return secretName; + } + + public void setSecretName(@javax.annotation.Nullable String secretName) { + this.secretName = secretName; + } + + + public WebhookSubscriptionUpdateModel customObjects(@javax.annotation.Nullable String customObjects) { + this.customObjects = customObjects; + return this; + } + + /** + * Custom Objects associated with the webhook + * @return customObjects + */ + @javax.annotation.Nullable + public String getCustomObjects() { + return customObjects; + } + + public void setCustomObjects(@javax.annotation.Nullable String customObjects) { + this.customObjects = customObjects; + } + + + public WebhookSubscriptionUpdateModel headers(@javax.annotation.Nullable Map<String, String> headers) { + this.headers = headers; + return this; + } + + public WebhookSubscriptionUpdateModel putHeadersItem(String key, String headersItem) { + if (this.headers == null) { + this.headers = new HashMap<>(); + } + this.headers.put(key, headersItem); + return this; + } + + /** + * The headers to be included in the webhook request + * @return headers + */ + @javax.annotation.Nullable + public Map<String, String> getHeaders() { + return headers; + } + + public void setHeaders(@javax.annotation.Nullable Map<String, String> headers) { + this.headers = headers; + } + + + public WebhookSubscriptionUpdateModel queryParams(@javax.annotation.Nullable Map<String, String> queryParams) { + this.queryParams = queryParams; + return this; + } + + public WebhookSubscriptionUpdateModel putQueryParamsItem(String key, String queryParamsItem) { + if (this.queryParams == null) { + this.queryParams = new HashMap<>(); + } + this.queryParams.put(key, queryParamsItem); + return this; + } + + /** + * The query parameters to be included in the webhook request + * @return queryParams + */ + @javax.annotation.Nullable + public Map<String, String> getQueryParams() { + return queryParams; + } + + public void setQueryParams(@javax.annotation.Nullable Map<String, String> queryParams) { + this.queryParams = queryParams; + } + + + public WebhookSubscriptionUpdateModel authentication(@javax.annotation.Nullable WebhookAuthentication authentication) { + this.authentication = authentication; + return this; + } + + /** + * Get authentication + * @return authentication + */ + @javax.annotation.Nullable + public WebhookAuthentication getAuthentication() { + return authentication; + } + + public void setAuthentication(@javax.annotation.Nullable WebhookAuthentication authentication) { + this.authentication = authentication; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the WebhookSubscriptionUpdateModel instance itself + */ + public WebhookSubscriptionUpdateModel putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WebhookSubscriptionUpdateModel webhookSubscriptionUpdateModel = (WebhookSubscriptionUpdateModel) o; + return Objects.equals(this.targetUrl, webhookSubscriptionUpdateModel.targetUrl) && + Objects.equals(this.name, webhookSubscriptionUpdateModel.name) && + Objects.equals(this.secretName, webhookSubscriptionUpdateModel.secretName) && + Objects.equals(this.customObjects, webhookSubscriptionUpdateModel.customObjects) && + Objects.equals(this.headers, webhookSubscriptionUpdateModel.headers) && + Objects.equals(this.queryParams, webhookSubscriptionUpdateModel.queryParams) && + Objects.equals(this.authentication, webhookSubscriptionUpdateModel.authentication)&& + Objects.equals(this.additionalProperties, webhookSubscriptionUpdateModel.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(targetUrl, name, secretName, customObjects, headers, queryParams, authentication, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WebhookSubscriptionUpdateModel {\n"); + sb.append(" targetUrl: ").append(toIndentedString(targetUrl)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" secretName: ").append(toIndentedString(secretName)).append("\n"); + sb.append(" customObjects: ").append(toIndentedString(customObjects)).append("\n"); + sb.append(" headers: ").append(toIndentedString(headers)).append("\n"); + sb.append(" queryParams: ").append(toIndentedString(queryParams)).append("\n"); + sb.append(" authentication: ").append(toIndentedString(authentication)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("TargetUrl"); + openapiFields.add("Name"); + openapiFields.add("SecretName"); + openapiFields.add("CustomObjects"); + openapiFields.add("Headers"); + openapiFields.add("QueryParams"); + openapiFields.add("Authentication"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + openapiRequiredFields.add("TargetUrl"); + } + + /** + * 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 WebhookSubscriptionUpdateModel + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WebhookSubscriptionUpdateModel.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WebhookSubscriptionUpdateModel is not found in the empty JSON string", WebhookSubscriptionUpdateModel.openapiRequiredFields.toString())); + } + } + + // check to make sure all required properties/fields are present in the JSON string + for (String requiredField : WebhookSubscriptionUpdateModel.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("TargetUrl").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `TargetUrl` to be a primitive type in the JSON string but got `%s`", jsonObj.get("TargetUrl").toString())); + } + if ((jsonObj.get("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("SecretName") != null && !jsonObj.get("SecretName").isJsonNull()) && !jsonObj.get("SecretName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `SecretName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("SecretName").toString())); + } + if ((jsonObj.get("CustomObjects") != null && !jsonObj.get("CustomObjects").isJsonNull()) && !jsonObj.get("CustomObjects").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `CustomObjects` to be a primitive type in the JSON string but got `%s`", jsonObj.get("CustomObjects").toString())); + } + // validate the optional field `Authentication` + if (jsonObj.get("Authentication") != null && !jsonObj.get("Authentication").isJsonNull()) { + WebhookAuthentication.validateJsonElement(jsonObj.get("Authentication")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!WebhookSubscriptionUpdateModel.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WebhookSubscriptionUpdateModel' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<WebhookSubscriptionUpdateModel> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WebhookSubscriptionUpdateModel.class)); + + return (TypeAdapter<T>) new TypeAdapter<WebhookSubscriptionUpdateModel>() { + @Override + public void write(JsonWriter out, WebhookSubscriptionUpdateModel value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public WebhookSubscriptionUpdateModel read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + WebhookSubscriptionUpdateModel instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WebhookSubscriptionUpdateModel given an JSON string + * + * @param jsonString JSON string + * @return An instance of WebhookSubscriptionUpdateModel + * @throws IOException if the JSON string is invalid with respect to WebhookSubscriptionUpdateModel + */ + public static WebhookSubscriptionUpdateModel fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WebhookSubscriptionUpdateModel.class); + } + + /** + * Convert an instance of WebhookSubscriptionUpdateModel to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowConfig.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowConfig.java new file mode 100644 index 0000000..f44ea58 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowConfig.java @@ -0,0 +1,434 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * WorkflowConfig + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class WorkflowConfig { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_WORKFLOW_NAME = "WorkflowName"; + @SerializedName(SERIALIZED_NAME_WORKFLOW_NAME) + @javax.annotation.Nullable + private String workflowName; + + public static final String SERIALIZED_NAME_THEME_NAME = "ThemeName"; + @SerializedName(SERIALIZED_NAME_THEME_NAME) + @javax.annotation.Nullable + private String themeName; + + public static final String SERIALIZED_NAME_DESCRIPTION = "Description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_DATA = "Data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private Object data; + + public static final String SERIALIZED_NAME_STATE = "State"; + @SerializedName(SERIALIZED_NAME_STATE) + @javax.annotation.Nullable + private String state; + + public WorkflowConfig() { + } + + public WorkflowConfig id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public WorkflowConfig workflowName(@javax.annotation.Nullable String workflowName) { + this.workflowName = workflowName; + return this; + } + + /** + * Get workflowName + * @return workflowName + */ + @javax.annotation.Nullable + public String getWorkflowName() { + return workflowName; + } + + public void setWorkflowName(@javax.annotation.Nullable String workflowName) { + this.workflowName = workflowName; + } + + + public WorkflowConfig themeName(@javax.annotation.Nullable String themeName) { + this.themeName = themeName; + return this; + } + + /** + * Get themeName + * @return themeName + */ + @javax.annotation.Nullable + public String getThemeName() { + return themeName; + } + + public void setThemeName(@javax.annotation.Nullable String themeName) { + this.themeName = themeName; + } + + + public WorkflowConfig description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public WorkflowConfig data(@javax.annotation.Nullable Object data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public Object getData() { + return data; + } + + public void setData(@javax.annotation.Nullable Object data) { + this.data = data; + } + + + public WorkflowConfig state(@javax.annotation.Nullable String state) { + this.state = state; + return this; + } + + /** + * Get state + * @return state + */ + @javax.annotation.Nullable + public String getState() { + return state; + } + + public void setState(@javax.annotation.Nullable String state) { + this.state = state; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the WorkflowConfig instance itself + */ + public WorkflowConfig putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WorkflowConfig workflowConfig = (WorkflowConfig) o; + return Objects.equals(this.id, workflowConfig.id) && + Objects.equals(this.workflowName, workflowConfig.workflowName) && + Objects.equals(this.themeName, workflowConfig.themeName) && + Objects.equals(this.description, workflowConfig.description) && + Objects.equals(this.data, workflowConfig.data) && + Objects.equals(this.state, workflowConfig.state)&& + Objects.equals(this.additionalProperties, workflowConfig.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, workflowName, themeName, description, data, state, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WorkflowConfig {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" workflowName: ").append(toIndentedString(workflowName)).append("\n"); + sb.append(" themeName: ").append(toIndentedString(themeName)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("WorkflowName"); + openapiFields.add("ThemeName"); + openapiFields.add("Description"); + openapiFields.add("Data"); + openapiFields.add("State"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 WorkflowConfig + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WorkflowConfig.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WorkflowConfig is not found in the empty JSON string", WorkflowConfig.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("WorkflowName") != null && !jsonObj.get("WorkflowName").isJsonNull()) && !jsonObj.get("WorkflowName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `WorkflowName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("WorkflowName").toString())); + } + if ((jsonObj.get("ThemeName") != null && !jsonObj.get("ThemeName").isJsonNull()) && !jsonObj.get("ThemeName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ThemeName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ThemeName").toString())); + } + if ((jsonObj.get("Description") != null && !jsonObj.get("Description").isJsonNull()) && !jsonObj.get("Description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Description").toString())); + } + if ((jsonObj.get("State") != null && !jsonObj.get("State").isJsonNull()) && !jsonObj.get("State").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `State` to be a primitive type in the JSON string but got `%s`", jsonObj.get("State").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!WorkflowConfig.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WorkflowConfig' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<WorkflowConfig> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WorkflowConfig.class)); + + return (TypeAdapter<T>) new TypeAdapter<WorkflowConfig>() { + @Override + public void write(JsonWriter out, WorkflowConfig value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public WorkflowConfig read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + WorkflowConfig instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WorkflowConfig given an JSON string + * + * @param jsonString JSON string + * @return An instance of WorkflowConfig + * @throws IOException if the JSON string is invalid with respect to WorkflowConfig + */ + public static WorkflowConfig fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WorkflowConfig.class); + } + + /** + * Convert an instance of WorkflowConfig to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowConfigWithoutData.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowConfigWithoutData.java new file mode 100644 index 0000000..ff758c6 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowConfigWithoutData.java @@ -0,0 +1,407 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * WorkflowConfigWithoutData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class WorkflowConfigWithoutData { + public static final String SERIALIZED_NAME_ID = "Id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_NAME = "Name"; + @SerializedName(SERIALIZED_NAME_NAME) + @javax.annotation.Nullable + private String name; + + public static final String SERIALIZED_NAME_THEME_NAME = "ThemeName"; + @SerializedName(SERIALIZED_NAME_THEME_NAME) + @javax.annotation.Nullable + private String themeName; + + public static final String SERIALIZED_NAME_DESCRIPTION = "Description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public static final String SERIALIZED_NAME_STATE = "State"; + @SerializedName(SERIALIZED_NAME_STATE) + @javax.annotation.Nullable + private String state; + + public WorkflowConfigWithoutData() { + } + + public WorkflowConfigWithoutData id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public WorkflowConfigWithoutData name(@javax.annotation.Nullable String name) { + this.name = name; + return this; + } + + /** + * Get name + * @return name + */ + @javax.annotation.Nullable + public String getName() { + return name; + } + + public void setName(@javax.annotation.Nullable String name) { + this.name = name; + } + + + public WorkflowConfigWithoutData themeName(@javax.annotation.Nullable String themeName) { + this.themeName = themeName; + return this; + } + + /** + * Get themeName + * @return themeName + */ + @javax.annotation.Nullable + public String getThemeName() { + return themeName; + } + + public void setThemeName(@javax.annotation.Nullable String themeName) { + this.themeName = themeName; + } + + + public WorkflowConfigWithoutData description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Get description + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + + public WorkflowConfigWithoutData state(@javax.annotation.Nullable String state) { + this.state = state; + return this; + } + + /** + * Get state + * @return state + */ + @javax.annotation.Nullable + public String getState() { + return state; + } + + public void setState(@javax.annotation.Nullable String state) { + this.state = state; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the WorkflowConfigWithoutData instance itself + */ + public WorkflowConfigWithoutData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WorkflowConfigWithoutData workflowConfigWithoutData = (WorkflowConfigWithoutData) o; + return Objects.equals(this.id, workflowConfigWithoutData.id) && + Objects.equals(this.name, workflowConfigWithoutData.name) && + Objects.equals(this.themeName, workflowConfigWithoutData.themeName) && + Objects.equals(this.description, workflowConfigWithoutData.description) && + Objects.equals(this.state, workflowConfigWithoutData.state)&& + Objects.equals(this.additionalProperties, workflowConfigWithoutData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, name, themeName, description, state, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WorkflowConfigWithoutData {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" themeName: ").append(toIndentedString(themeName)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("Id"); + openapiFields.add("Name"); + openapiFields.add("ThemeName"); + openapiFields.add("Description"); + openapiFields.add("State"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 WorkflowConfigWithoutData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WorkflowConfigWithoutData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WorkflowConfigWithoutData is not found in the empty JSON string", WorkflowConfigWithoutData.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("Id") != null && !jsonObj.get("Id").isJsonNull()) && !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("Name") != null && !jsonObj.get("Name").isJsonNull()) && !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("ThemeName") != null && !jsonObj.get("ThemeName").isJsonNull()) && !jsonObj.get("ThemeName").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `ThemeName` to be a primitive type in the JSON string but got `%s`", jsonObj.get("ThemeName").toString())); + } + if ((jsonObj.get("Description") != null && !jsonObj.get("Description").isJsonNull()) && !jsonObj.get("Description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `Description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("Description").toString())); + } + if ((jsonObj.get("State") != null && !jsonObj.get("State").isJsonNull()) && !jsonObj.get("State").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `State` to be a primitive type in the JSON string but got `%s`", jsonObj.get("State").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!WorkflowConfigWithoutData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WorkflowConfigWithoutData' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<WorkflowConfigWithoutData> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WorkflowConfigWithoutData.class)); + + return (TypeAdapter<T>) new TypeAdapter<WorkflowConfigWithoutData>() { + @Override + public void write(JsonWriter out, WorkflowConfigWithoutData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public WorkflowConfigWithoutData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + WorkflowConfigWithoutData instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WorkflowConfigWithoutData given an JSON string + * + * @param jsonString JSON string + * @return An instance of WorkflowConfigWithoutData + * @throws IOException if the JSON string is invalid with respect to WorkflowConfigWithoutData + */ + public static WorkflowConfigWithoutData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WorkflowConfigWithoutData.class); + } + + /** + * Convert an instance of WorkflowConfigWithoutData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowData.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowData.java new file mode 100644 index 0000000..3c84be0 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowData.java @@ -0,0 +1,487 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.WorkflowDataInnerNodesValue; +import com.loginradius.sdk.internal.openapi.model.WorkflowDataNodesValue; +import com.loginradius.sdk.internal.openapi.model.WorkflowDataTree; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * WorkflowData + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class WorkflowData { + public static final String SERIALIZED_NAME_TREE = "tree"; + @SerializedName(SERIALIZED_NAME_TREE) + @javax.annotation.Nullable + private WorkflowDataTree tree; + + public static final String SERIALIZED_NAME_NODES = "nodes"; + @SerializedName(SERIALIZED_NAME_NODES) + @javax.annotation.Nullable + private Map<String, WorkflowDataNodesValue> nodes = new HashMap<>(); + + public static final String SERIALIZED_NAME_INNER_NODES = "innerNodes"; + @SerializedName(SERIALIZED_NAME_INNER_NODES) + @javax.annotation.Nullable + private Map<String, WorkflowDataInnerNodesValue> innerNodes = new HashMap<>(); + + public static final String SERIALIZED_NAME_POLICIES = "policies"; + @SerializedName(SERIALIZED_NAME_POLICIES) + @javax.annotation.Nullable + private Map<String, List<Object>> policies = new HashMap<>(); + + public static final String SERIALIZED_NAME_VERSION_ID = "versionId"; + @SerializedName(SERIALIZED_NAME_VERSION_ID) + @javax.annotation.Nullable + private String versionId; + + public static final String SERIALIZED_NAME_CREATED_DATE = "createdDate"; + @SerializedName(SERIALIZED_NAME_CREATED_DATE) + @javax.annotation.Nullable + private OffsetDateTime createdDate; + + public static final String SERIALIZED_NAME_DESCRIPTION = "description"; + @SerializedName(SERIALIZED_NAME_DESCRIPTION) + @javax.annotation.Nullable + private String description; + + public WorkflowData() { + } + + public WorkflowData tree(@javax.annotation.Nullable WorkflowDataTree tree) { + this.tree = tree; + return this; + } + + /** + * Get tree + * @return tree + */ + @javax.annotation.Nullable + public WorkflowDataTree getTree() { + return tree; + } + + public void setTree(@javax.annotation.Nullable WorkflowDataTree tree) { + this.tree = tree; + } + + + public WorkflowData nodes(@javax.annotation.Nullable Map<String, WorkflowDataNodesValue> nodes) { + this.nodes = nodes; + return this; + } + + public WorkflowData putNodesItem(String key, WorkflowDataNodesValue nodesItem) { + if (this.nodes == null) { + this.nodes = new HashMap<>(); + } + this.nodes.put(key, nodesItem); + return this; + } + + /** + * Get nodes + * @return nodes + */ + @javax.annotation.Nullable + public Map<String, WorkflowDataNodesValue> getNodes() { + return nodes; + } + + public void setNodes(@javax.annotation.Nullable Map<String, WorkflowDataNodesValue> nodes) { + this.nodes = nodes; + } + + + public WorkflowData innerNodes(@javax.annotation.Nullable Map<String, WorkflowDataInnerNodesValue> innerNodes) { + this.innerNodes = innerNodes; + return this; + } + + public WorkflowData putInnerNodesItem(String key, WorkflowDataInnerNodesValue innerNodesItem) { + if (this.innerNodes == null) { + this.innerNodes = new HashMap<>(); + } + this.innerNodes.put(key, innerNodesItem); + return this; + } + + /** + * Get innerNodes + * @return innerNodes + */ + @javax.annotation.Nullable + public Map<String, WorkflowDataInnerNodesValue> getInnerNodes() { + return innerNodes; + } + + public void setInnerNodes(@javax.annotation.Nullable Map<String, WorkflowDataInnerNodesValue> innerNodes) { + this.innerNodes = innerNodes; + } + + + public WorkflowData policies(@javax.annotation.Nullable Map<String, List<Object>> policies) { + this.policies = policies; + return this; + } + + public WorkflowData putPoliciesItem(String key, List<Object> policiesItem) { + if (this.policies == null) { + this.policies = new HashMap<>(); + } + this.policies.put(key, policiesItem); + return this; + } + + /** + * Get policies + * @return policies + */ + @javax.annotation.Nullable + public Map<String, List<Object>> getPolicies() { + return policies; + } + + public void setPolicies(@javax.annotation.Nullable Map<String, List<Object>> policies) { + this.policies = policies; + } + + + public WorkflowData versionId(@javax.annotation.Nullable String versionId) { + this.versionId = versionId; + return this; + } + + /** + * The version ID of the workflow. + * @return versionId + */ + @javax.annotation.Nullable + public String getVersionId() { + return versionId; + } + + public void setVersionId(@javax.annotation.Nullable String versionId) { + this.versionId = versionId; + } + + + public WorkflowData createdDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + return this; + } + + /** + * The creation date of the workflow version. + * @return createdDate + */ + @javax.annotation.Nullable + public OffsetDateTime getCreatedDate() { + return createdDate; + } + + public void setCreatedDate(@javax.annotation.Nullable OffsetDateTime createdDate) { + this.createdDate = createdDate; + } + + + public WorkflowData description(@javax.annotation.Nullable String description) { + this.description = description; + return this; + } + + /** + * Description of the workflow version. + * @return description + */ + @javax.annotation.Nullable + public String getDescription() { + return description; + } + + public void setDescription(@javax.annotation.Nullable String description) { + this.description = description; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the WorkflowData instance itself + */ + public WorkflowData putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WorkflowData workflowData = (WorkflowData) o; + return Objects.equals(this.tree, workflowData.tree) && + Objects.equals(this.nodes, workflowData.nodes) && + Objects.equals(this.innerNodes, workflowData.innerNodes) && + Objects.equals(this.policies, workflowData.policies) && + Objects.equals(this.versionId, workflowData.versionId) && + Objects.equals(this.createdDate, workflowData.createdDate) && + Objects.equals(this.description, workflowData.description)&& + Objects.equals(this.additionalProperties, workflowData.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(tree, nodes, innerNodes, policies, versionId, createdDate, description, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WorkflowData {\n"); + sb.append(" tree: ").append(toIndentedString(tree)).append("\n"); + sb.append(" nodes: ").append(toIndentedString(nodes)).append("\n"); + sb.append(" innerNodes: ").append(toIndentedString(innerNodes)).append("\n"); + sb.append(" policies: ").append(toIndentedString(policies)).append("\n"); + sb.append(" versionId: ").append(toIndentedString(versionId)).append("\n"); + sb.append(" createdDate: ").append(toIndentedString(createdDate)).append("\n"); + sb.append(" description: ").append(toIndentedString(description)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("tree"); + openapiFields.add("nodes"); + openapiFields.add("innerNodes"); + openapiFields.add("policies"); + openapiFields.add("versionId"); + openapiFields.add("createdDate"); + openapiFields.add("description"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 WorkflowData + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WorkflowData.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WorkflowData is not found in the empty JSON string", WorkflowData.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // validate the optional field `tree` + if (jsonObj.get("tree") != null && !jsonObj.get("tree").isJsonNull()) { + WorkflowDataTree.validateJsonElement(jsonObj.get("tree")); + } + if ((jsonObj.get("versionId") != null && !jsonObj.get("versionId").isJsonNull()) && !jsonObj.get("versionId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `versionId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("versionId").toString())); + } + if ((jsonObj.get("description") != null && !jsonObj.get("description").isJsonNull()) && !jsonObj.get("description").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `description` to be a primitive type in the JSON string but got `%s`", jsonObj.get("description").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!WorkflowData.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WorkflowData' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<WorkflowData> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WorkflowData.class)); + + return (TypeAdapter<T>) new TypeAdapter<WorkflowData>() { + @Override + public void write(JsonWriter out, WorkflowData value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public WorkflowData read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + WorkflowData instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WorkflowData given an JSON string + * + * @param jsonString JSON string + * @return An instance of WorkflowData + * @throws IOException if the JSON string is invalid with respect to WorkflowData + */ + public static WorkflowData fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WorkflowData.class); + } + + /** + * Convert an instance of WorkflowData to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowDataInnerNodesValue.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowDataInnerNodesValue.java new file mode 100644 index 0000000..ae1a900 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowDataInnerNodesValue.java @@ -0,0 +1,448 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.WorkflowDataInnerNodesValueFormnodeprops; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * WorkflowDataInnerNodesValue + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class WorkflowDataInnerNodesValue { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_U_I_D = "UID"; + @SerializedName(SERIALIZED_NAME_U_I_D) + @javax.annotation.Nullable + private String UID; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_CHILD_TYPE = "childType"; + @SerializedName(SERIALIZED_NAME_CHILD_TYPE) + @javax.annotation.Nullable + private String childType; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private Object data; + + public static final String SERIALIZED_NAME_FORMNODEPROPS = "formnodeprops"; + @SerializedName(SERIALIZED_NAME_FORMNODEPROPS) + @javax.annotation.Nullable + private WorkflowDataInnerNodesValueFormnodeprops formnodeprops; + + public WorkflowDataInnerNodesValue() { + } + + public WorkflowDataInnerNodesValue id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public WorkflowDataInnerNodesValue UID(@javax.annotation.Nullable String UID) { + this.UID = UID; + return this; + } + + /** + * Get UID + * @return UID + */ + @javax.annotation.Nullable + public String getUID() { + return UID; + } + + public void setUID(@javax.annotation.Nullable String UID) { + this.UID = UID; + } + + + public WorkflowDataInnerNodesValue type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public WorkflowDataInnerNodesValue childType(@javax.annotation.Nullable String childType) { + this.childType = childType; + return this; + } + + /** + * Get childType + * @return childType + */ + @javax.annotation.Nullable + public String getChildType() { + return childType; + } + + public void setChildType(@javax.annotation.Nullable String childType) { + this.childType = childType; + } + + + public WorkflowDataInnerNodesValue data(@javax.annotation.Nullable Object data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public Object getData() { + return data; + } + + public void setData(@javax.annotation.Nullable Object data) { + this.data = data; + } + + + public WorkflowDataInnerNodesValue formnodeprops(@javax.annotation.Nullable WorkflowDataInnerNodesValueFormnodeprops formnodeprops) { + this.formnodeprops = formnodeprops; + return this; + } + + /** + * Get formnodeprops + * @return formnodeprops + */ + @javax.annotation.Nullable + public WorkflowDataInnerNodesValueFormnodeprops getFormnodeprops() { + return formnodeprops; + } + + public void setFormnodeprops(@javax.annotation.Nullable WorkflowDataInnerNodesValueFormnodeprops formnodeprops) { + this.formnodeprops = formnodeprops; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the WorkflowDataInnerNodesValue instance itself + */ + public WorkflowDataInnerNodesValue putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WorkflowDataInnerNodesValue workflowDataInnerNodesValue = (WorkflowDataInnerNodesValue) o; + return Objects.equals(this.id, workflowDataInnerNodesValue.id) && + Objects.equals(this.UID, workflowDataInnerNodesValue.UID) && + Objects.equals(this.type, workflowDataInnerNodesValue.type) && + Objects.equals(this.childType, workflowDataInnerNodesValue.childType) && + Objects.equals(this.data, workflowDataInnerNodesValue.data) && + Objects.equals(this.formnodeprops, workflowDataInnerNodesValue.formnodeprops)&& + Objects.equals(this.additionalProperties, workflowDataInnerNodesValue.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(id, UID, type, childType, data, formnodeprops, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WorkflowDataInnerNodesValue {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" UID: ").append(toIndentedString(UID)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" childType: ").append(toIndentedString(childType)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" formnodeprops: ").append(toIndentedString(formnodeprops)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("id"); + openapiFields.add("UID"); + openapiFields.add("type"); + openapiFields.add("childType"); + openapiFields.add("data"); + openapiFields.add("formnodeprops"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 WorkflowDataInnerNodesValue + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WorkflowDataInnerNodesValue.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WorkflowDataInnerNodesValue is not found in the empty JSON string", WorkflowDataInnerNodesValue.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !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("UID") != null && !jsonObj.get("UID").isJsonNull()) && !jsonObj.get("UID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UID").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if ((jsonObj.get("childType") != null && !jsonObj.get("childType").isJsonNull()) && !jsonObj.get("childType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `childType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("childType").toString())); + } + // validate the optional field `formnodeprops` + if (jsonObj.get("formnodeprops") != null && !jsonObj.get("formnodeprops").isJsonNull()) { + WorkflowDataInnerNodesValueFormnodeprops.validateJsonElement(jsonObj.get("formnodeprops")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!WorkflowDataInnerNodesValue.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WorkflowDataInnerNodesValue' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<WorkflowDataInnerNodesValue> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WorkflowDataInnerNodesValue.class)); + + return (TypeAdapter<T>) new TypeAdapter<WorkflowDataInnerNodesValue>() { + @Override + public void write(JsonWriter out, WorkflowDataInnerNodesValue value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public WorkflowDataInnerNodesValue read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + WorkflowDataInnerNodesValue instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WorkflowDataInnerNodesValue given an JSON string + * + * @param jsonString JSON string + * @return An instance of WorkflowDataInnerNodesValue + * @throws IOException if the JSON string is invalid with respect to WorkflowDataInnerNodesValue + */ + public static WorkflowDataInnerNodesValue fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WorkflowDataInnerNodesValue.class); + } + + /** + * Convert an instance of WorkflowDataInnerNodesValue to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowDataInnerNodesValueFormnodeprops.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowDataInnerNodesValueFormnodeprops.java new file mode 100644 index 0000000..9c4a5b7 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowDataInnerNodesValueFormnodeprops.java @@ -0,0 +1,399 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.WorkflowDataInnerNodesValueFormnodepropsChoicesInner; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * WorkflowDataInnerNodesValueFormnodeprops + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class WorkflowDataInnerNodesValueFormnodeprops { + public static final String SERIALIZED_NAME_CHOICE_FIELD_TYPE = "choiceFieldType"; + @SerializedName(SERIALIZED_NAME_CHOICE_FIELD_TYPE) + @javax.annotation.Nullable + private String choiceFieldType; + + public static final String SERIALIZED_NAME_CHOICES = "choices"; + @SerializedName(SERIALIZED_NAME_CHOICES) + @javax.annotation.Nullable + private List<WorkflowDataInnerNodesValueFormnodepropsChoicesInner> choices = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ATTRIBUTE_MAPPING = "attributeMapping"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTE_MAPPING) + @javax.annotation.Nullable + private String attributeMapping; + + public static final String SERIALIZED_NAME_DEFAULT_CHOICE = "defaultChoice"; + @SerializedName(SERIALIZED_NAME_DEFAULT_CHOICE) + @javax.annotation.Nullable + private String defaultChoice; + + public WorkflowDataInnerNodesValueFormnodeprops() { + } + + public WorkflowDataInnerNodesValueFormnodeprops choiceFieldType(@javax.annotation.Nullable String choiceFieldType) { + this.choiceFieldType = choiceFieldType; + return this; + } + + /** + * Get choiceFieldType + * @return choiceFieldType + */ + @javax.annotation.Nullable + public String getChoiceFieldType() { + return choiceFieldType; + } + + public void setChoiceFieldType(@javax.annotation.Nullable String choiceFieldType) { + this.choiceFieldType = choiceFieldType; + } + + + public WorkflowDataInnerNodesValueFormnodeprops choices(@javax.annotation.Nullable List<WorkflowDataInnerNodesValueFormnodepropsChoicesInner> choices) { + this.choices = choices; + return this; + } + + public WorkflowDataInnerNodesValueFormnodeprops addChoicesItem(WorkflowDataInnerNodesValueFormnodepropsChoicesInner choicesItem) { + if (this.choices == null) { + this.choices = new ArrayList<>(); + } + this.choices.add(choicesItem); + return this; + } + + /** + * Get choices + * @return choices + */ + @javax.annotation.Nullable + public List<WorkflowDataInnerNodesValueFormnodepropsChoicesInner> getChoices() { + return choices; + } + + public void setChoices(@javax.annotation.Nullable List<WorkflowDataInnerNodesValueFormnodepropsChoicesInner> choices) { + this.choices = choices; + } + + + public WorkflowDataInnerNodesValueFormnodeprops attributeMapping(@javax.annotation.Nullable String attributeMapping) { + this.attributeMapping = attributeMapping; + return this; + } + + /** + * Get attributeMapping + * @return attributeMapping + */ + @javax.annotation.Nullable + public String getAttributeMapping() { + return attributeMapping; + } + + public void setAttributeMapping(@javax.annotation.Nullable String attributeMapping) { + this.attributeMapping = attributeMapping; + } + + + public WorkflowDataInnerNodesValueFormnodeprops defaultChoice(@javax.annotation.Nullable String defaultChoice) { + this.defaultChoice = defaultChoice; + return this; + } + + /** + * Get defaultChoice + * @return defaultChoice + */ + @javax.annotation.Nullable + public String getDefaultChoice() { + return defaultChoice; + } + + public void setDefaultChoice(@javax.annotation.Nullable String defaultChoice) { + this.defaultChoice = defaultChoice; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the WorkflowDataInnerNodesValueFormnodeprops instance itself + */ + public WorkflowDataInnerNodesValueFormnodeprops putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WorkflowDataInnerNodesValueFormnodeprops workflowDataInnerNodesValueFormnodeprops = (WorkflowDataInnerNodesValueFormnodeprops) o; + return Objects.equals(this.choiceFieldType, workflowDataInnerNodesValueFormnodeprops.choiceFieldType) && + Objects.equals(this.choices, workflowDataInnerNodesValueFormnodeprops.choices) && + Objects.equals(this.attributeMapping, workflowDataInnerNodesValueFormnodeprops.attributeMapping) && + Objects.equals(this.defaultChoice, workflowDataInnerNodesValueFormnodeprops.defaultChoice)&& + Objects.equals(this.additionalProperties, workflowDataInnerNodesValueFormnodeprops.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(choiceFieldType, choices, attributeMapping, defaultChoice, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WorkflowDataInnerNodesValueFormnodeprops {\n"); + sb.append(" choiceFieldType: ").append(toIndentedString(choiceFieldType)).append("\n"); + sb.append(" choices: ").append(toIndentedString(choices)).append("\n"); + sb.append(" attributeMapping: ").append(toIndentedString(attributeMapping)).append("\n"); + sb.append(" defaultChoice: ").append(toIndentedString(defaultChoice)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("choiceFieldType"); + openapiFields.add("choices"); + openapiFields.add("attributeMapping"); + openapiFields.add("defaultChoice"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 WorkflowDataInnerNodesValueFormnodeprops + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WorkflowDataInnerNodesValueFormnodeprops.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WorkflowDataInnerNodesValueFormnodeprops is not found in the empty JSON string", WorkflowDataInnerNodesValueFormnodeprops.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("choiceFieldType") != null && !jsonObj.get("choiceFieldType").isJsonNull()) && !jsonObj.get("choiceFieldType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `choiceFieldType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("choiceFieldType").toString())); + } + if (jsonObj.get("choices") != null && !jsonObj.get("choices").isJsonNull()) { + JsonArray jsonArraychoices = jsonObj.getAsJsonArray("choices"); + if (jsonArraychoices != null) { + // ensure the json data is an array + if (!jsonObj.get("choices").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `choices` to be an array in the JSON string but got `%s`", jsonObj.get("choices").toString())); + } + + // validate the optional field `choices` (array) + for (int i = 0; i < jsonArraychoices.size(); i++) { + WorkflowDataInnerNodesValueFormnodepropsChoicesInner.validateJsonElement(jsonArraychoices.get(i)); + }; + } + } + if ((jsonObj.get("attributeMapping") != null && !jsonObj.get("attributeMapping").isJsonNull()) && !jsonObj.get("attributeMapping").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `attributeMapping` to be a primitive type in the JSON string but got `%s`", jsonObj.get("attributeMapping").toString())); + } + if ((jsonObj.get("defaultChoice") != null && !jsonObj.get("defaultChoice").isJsonNull()) && !jsonObj.get("defaultChoice").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `defaultChoice` to be a primitive type in the JSON string but got `%s`", jsonObj.get("defaultChoice").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!WorkflowDataInnerNodesValueFormnodeprops.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WorkflowDataInnerNodesValueFormnodeprops' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<WorkflowDataInnerNodesValueFormnodeprops> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WorkflowDataInnerNodesValueFormnodeprops.class)); + + return (TypeAdapter<T>) new TypeAdapter<WorkflowDataInnerNodesValueFormnodeprops>() { + @Override + public void write(JsonWriter out, WorkflowDataInnerNodesValueFormnodeprops value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public WorkflowDataInnerNodesValueFormnodeprops read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + WorkflowDataInnerNodesValueFormnodeprops instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WorkflowDataInnerNodesValueFormnodeprops given an JSON string + * + * @param jsonString JSON string + * @return An instance of WorkflowDataInnerNodesValueFormnodeprops + * @throws IOException if the JSON string is invalid with respect to WorkflowDataInnerNodesValueFormnodeprops + */ + public static WorkflowDataInnerNodesValueFormnodeprops fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WorkflowDataInnerNodesValueFormnodeprops.class); + } + + /** + * Convert an instance of WorkflowDataInnerNodesValueFormnodeprops to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowDataInnerNodesValueFormnodepropsChoicesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowDataInnerNodesValueFormnodepropsChoicesInner.java new file mode 100644 index 0000000..9be5c25 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowDataInnerNodesValueFormnodepropsChoicesInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * WorkflowDataInnerNodesValueFormnodepropsChoicesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class WorkflowDataInnerNodesValueFormnodepropsChoicesInner { + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nullable + private String value; + + public static final String SERIALIZED_NAME_TEXT = "text"; + @SerializedName(SERIALIZED_NAME_TEXT) + @javax.annotation.Nullable + private String text; + + public WorkflowDataInnerNodesValueFormnodepropsChoicesInner() { + } + + public WorkflowDataInnerNodesValueFormnodepropsChoicesInner value(@javax.annotation.Nullable String value) { + this.value = value; + return this; + } + + /** + * Get value + * @return value + */ + @javax.annotation.Nullable + public String getValue() { + return value; + } + + public void setValue(@javax.annotation.Nullable String value) { + this.value = value; + } + + + public WorkflowDataInnerNodesValueFormnodepropsChoicesInner text(@javax.annotation.Nullable String text) { + this.text = text; + return this; + } + + /** + * Get text + * @return text + */ + @javax.annotation.Nullable + public String getText() { + return text; + } + + public void setText(@javax.annotation.Nullable String text) { + this.text = text; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the WorkflowDataInnerNodesValueFormnodepropsChoicesInner instance itself + */ + public WorkflowDataInnerNodesValueFormnodepropsChoicesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WorkflowDataInnerNodesValueFormnodepropsChoicesInner workflowDataInnerNodesValueFormnodepropsChoicesInner = (WorkflowDataInnerNodesValueFormnodepropsChoicesInner) o; + return Objects.equals(this.value, workflowDataInnerNodesValueFormnodepropsChoicesInner.value) && + Objects.equals(this.text, workflowDataInnerNodesValueFormnodepropsChoicesInner.text)&& + Objects.equals(this.additionalProperties, workflowDataInnerNodesValueFormnodepropsChoicesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(value, text, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WorkflowDataInnerNodesValueFormnodepropsChoicesInner {\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("value"); + openapiFields.add("text"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 WorkflowDataInnerNodesValueFormnodepropsChoicesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WorkflowDataInnerNodesValueFormnodepropsChoicesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WorkflowDataInnerNodesValueFormnodepropsChoicesInner is not found in the empty JSON string", WorkflowDataInnerNodesValueFormnodepropsChoicesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) && !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("text") != null && !jsonObj.get("text").isJsonNull()) && !jsonObj.get("text").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("text").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!WorkflowDataInnerNodesValueFormnodepropsChoicesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WorkflowDataInnerNodesValueFormnodepropsChoicesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<WorkflowDataInnerNodesValueFormnodepropsChoicesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WorkflowDataInnerNodesValueFormnodepropsChoicesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<WorkflowDataInnerNodesValueFormnodepropsChoicesInner>() { + @Override + public void write(JsonWriter out, WorkflowDataInnerNodesValueFormnodepropsChoicesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public WorkflowDataInnerNodesValueFormnodepropsChoicesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + WorkflowDataInnerNodesValueFormnodepropsChoicesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WorkflowDataInnerNodesValueFormnodepropsChoicesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of WorkflowDataInnerNodesValueFormnodepropsChoicesInner + * @throws IOException if the JSON string is invalid with respect to WorkflowDataInnerNodesValueFormnodepropsChoicesInner + */ + public static WorkflowDataInnerNodesValueFormnodepropsChoicesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WorkflowDataInnerNodesValueFormnodepropsChoicesInner.class); + } + + /** + * Convert an instance of WorkflowDataInnerNodesValueFormnodepropsChoicesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowDataNodesValue.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowDataNodesValue.java new file mode 100644 index 0000000..4fbc012 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowDataNodesValue.java @@ -0,0 +1,462 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.WorkflowDataNodesValueNodesInner; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * WorkflowDataNodesValue + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class WorkflowDataNodesValue { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_NODES = "nodes"; + @SerializedName(SERIALIZED_NAME_NODES) + @javax.annotation.Nullable + private List<WorkflowDataNodesValueNodesInner> nodes = new ArrayList<>(); + + public static final String SERIALIZED_NAME_OUTPUT = "output"; + @SerializedName(SERIALIZED_NAME_OUTPUT) + @javax.annotation.Nullable + private List<Object> output = new ArrayList<>(); + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private Object data; + + public static final String SERIALIZED_NAME_SELECTED = "selected"; + @SerializedName(SERIALIZED_NAME_SELECTED) + @javax.annotation.Nullable + private Boolean selected; + + public WorkflowDataNodesValue() { + } + + public WorkflowDataNodesValue id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public WorkflowDataNodesValue type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public WorkflowDataNodesValue nodes(@javax.annotation.Nullable List<WorkflowDataNodesValueNodesInner> nodes) { + this.nodes = nodes; + return this; + } + + public WorkflowDataNodesValue addNodesItem(WorkflowDataNodesValueNodesInner nodesItem) { + if (this.nodes == null) { + this.nodes = new ArrayList<>(); + } + this.nodes.add(nodesItem); + return this; + } + + /** + * Get nodes + * @return nodes + */ + @javax.annotation.Nullable + public List<WorkflowDataNodesValueNodesInner> getNodes() { + return nodes; + } + + public void setNodes(@javax.annotation.Nullable List<WorkflowDataNodesValueNodesInner> nodes) { + this.nodes = nodes; + } + + + public WorkflowDataNodesValue output(@javax.annotation.Nullable List<Object> output) { + this.output = output; + return this; + } + + public WorkflowDataNodesValue addOutputItem(Object outputItem) { + if (this.output == null) { + this.output = new ArrayList<>(); + } + this.output.add(outputItem); + return this; + } + + /** + * Get output + * @return output + */ + @javax.annotation.Nullable + public List<Object> getOutput() { + return output; + } + + public void setOutput(@javax.annotation.Nullable List<Object> output) { + this.output = output; + } + + + public WorkflowDataNodesValue data(@javax.annotation.Nullable Object data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public Object getData() { + return data; + } + + public void setData(@javax.annotation.Nullable Object data) { + this.data = data; + } + + + public WorkflowDataNodesValue selected(@javax.annotation.Nullable Boolean selected) { + this.selected = selected; + return this; + } + + /** + * Get selected + * @return selected + */ + @javax.annotation.Nullable + public Boolean getSelected() { + return selected; + } + + public void setSelected(@javax.annotation.Nullable Boolean selected) { + this.selected = selected; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the WorkflowDataNodesValue instance itself + */ + public WorkflowDataNodesValue putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WorkflowDataNodesValue workflowDataNodesValue = (WorkflowDataNodesValue) o; + return Objects.equals(this.id, workflowDataNodesValue.id) && + Objects.equals(this.type, workflowDataNodesValue.type) && + Objects.equals(this.nodes, workflowDataNodesValue.nodes) && + Objects.equals(this.output, workflowDataNodesValue.output) && + Objects.equals(this.data, workflowDataNodesValue.data) && + Objects.equals(this.selected, workflowDataNodesValue.selected)&& + Objects.equals(this.additionalProperties, workflowDataNodesValue.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, nodes, output, data, selected, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WorkflowDataNodesValue {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" nodes: ").append(toIndentedString(nodes)).append("\n"); + sb.append(" output: ").append(toIndentedString(output)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" selected: ").append(toIndentedString(selected)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("id"); + openapiFields.add("type"); + openapiFields.add("nodes"); + openapiFields.add("output"); + openapiFields.add("data"); + openapiFields.add("selected"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 WorkflowDataNodesValue + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WorkflowDataNodesValue.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WorkflowDataNodesValue is not found in the empty JSON string", WorkflowDataNodesValue.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !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("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if (jsonObj.get("nodes") != null && !jsonObj.get("nodes").isJsonNull()) { + JsonArray jsonArraynodes = jsonObj.getAsJsonArray("nodes"); + if (jsonArraynodes != null) { + // ensure the json data is an array + if (!jsonObj.get("nodes").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `nodes` to be an array in the JSON string but got `%s`", jsonObj.get("nodes").toString())); + } + + // validate the optional field `nodes` (array) + for (int i = 0; i < jsonArraynodes.size(); i++) { + WorkflowDataNodesValueNodesInner.validateJsonElement(jsonArraynodes.get(i)); + }; + } + } + // ensure the optional json data is an array if present + if (jsonObj.get("output") != null && !jsonObj.get("output").isJsonNull() && !jsonObj.get("output").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `output` to be an array in the JSON string but got `%s`", jsonObj.get("output").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!WorkflowDataNodesValue.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WorkflowDataNodesValue' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<WorkflowDataNodesValue> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WorkflowDataNodesValue.class)); + + return (TypeAdapter<T>) new TypeAdapter<WorkflowDataNodesValue>() { + @Override + public void write(JsonWriter out, WorkflowDataNodesValue value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public WorkflowDataNodesValue read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + WorkflowDataNodesValue instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WorkflowDataNodesValue given an JSON string + * + * @param jsonString JSON string + * @return An instance of WorkflowDataNodesValue + * @throws IOException if the JSON string is invalid with respect to WorkflowDataNodesValue + */ + public static WorkflowDataNodesValue fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WorkflowDataNodesValue.class); + } + + /** + * Convert an instance of WorkflowDataNodesValue to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowDataNodesValueNodesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowDataNodesValueNodesInner.java new file mode 100644 index 0000000..49e636c --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowDataNodesValueNodesInner.java @@ -0,0 +1,448 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.WorkflowDataNodesValueNodesInnerFormnodeprops; +import java.io.IOException; +import java.util.Arrays; +import org.openapitools.jackson.nullable.JsonNullable; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * WorkflowDataNodesValueNodesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class WorkflowDataNodesValueNodesInner { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_U_I_D = "UID"; + @SerializedName(SERIALIZED_NAME_U_I_D) + @javax.annotation.Nullable + private String UID; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_CHILD_TYPE = "childType"; + @SerializedName(SERIALIZED_NAME_CHILD_TYPE) + @javax.annotation.Nullable + private String childType; + + public static final String SERIALIZED_NAME_DATA = "data"; + @SerializedName(SERIALIZED_NAME_DATA) + @javax.annotation.Nullable + private Object data; + + public static final String SERIALIZED_NAME_FORMNODEPROPS = "formnodeprops"; + @SerializedName(SERIALIZED_NAME_FORMNODEPROPS) + @javax.annotation.Nullable + private WorkflowDataNodesValueNodesInnerFormnodeprops formnodeprops; + + public WorkflowDataNodesValueNodesInner() { + } + + public WorkflowDataNodesValueNodesInner id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public WorkflowDataNodesValueNodesInner UID(@javax.annotation.Nullable String UID) { + this.UID = UID; + return this; + } + + /** + * Get UID + * @return UID + */ + @javax.annotation.Nullable + public String getUID() { + return UID; + } + + public void setUID(@javax.annotation.Nullable String UID) { + this.UID = UID; + } + + + public WorkflowDataNodesValueNodesInner type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public WorkflowDataNodesValueNodesInner childType(@javax.annotation.Nullable String childType) { + this.childType = childType; + return this; + } + + /** + * Get childType + * @return childType + */ + @javax.annotation.Nullable + public String getChildType() { + return childType; + } + + public void setChildType(@javax.annotation.Nullable String childType) { + this.childType = childType; + } + + + public WorkflowDataNodesValueNodesInner data(@javax.annotation.Nullable Object data) { + this.data = data; + return this; + } + + /** + * Get data + * @return data + */ + @javax.annotation.Nullable + public Object getData() { + return data; + } + + public void setData(@javax.annotation.Nullable Object data) { + this.data = data; + } + + + public WorkflowDataNodesValueNodesInner formnodeprops(@javax.annotation.Nullable WorkflowDataNodesValueNodesInnerFormnodeprops formnodeprops) { + this.formnodeprops = formnodeprops; + return this; + } + + /** + * Get formnodeprops + * @return formnodeprops + */ + @javax.annotation.Nullable + public WorkflowDataNodesValueNodesInnerFormnodeprops getFormnodeprops() { + return formnodeprops; + } + + public void setFormnodeprops(@javax.annotation.Nullable WorkflowDataNodesValueNodesInnerFormnodeprops formnodeprops) { + this.formnodeprops = formnodeprops; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the WorkflowDataNodesValueNodesInner instance itself + */ + public WorkflowDataNodesValueNodesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WorkflowDataNodesValueNodesInner workflowDataNodesValueNodesInner = (WorkflowDataNodesValueNodesInner) o; + return Objects.equals(this.id, workflowDataNodesValueNodesInner.id) && + Objects.equals(this.UID, workflowDataNodesValueNodesInner.UID) && + Objects.equals(this.type, workflowDataNodesValueNodesInner.type) && + Objects.equals(this.childType, workflowDataNodesValueNodesInner.childType) && + Objects.equals(this.data, workflowDataNodesValueNodesInner.data) && + Objects.equals(this.formnodeprops, workflowDataNodesValueNodesInner.formnodeprops)&& + Objects.equals(this.additionalProperties, workflowDataNodesValueNodesInner.additionalProperties); + } + + private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(id, UID, type, childType, data, formnodeprops, additionalProperties); + } + + private static <T> int hashCodeNullable(JsonNullable<T> a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WorkflowDataNodesValueNodesInner {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" UID: ").append(toIndentedString(UID)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" childType: ").append(toIndentedString(childType)).append("\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append(" formnodeprops: ").append(toIndentedString(formnodeprops)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("id"); + openapiFields.add("UID"); + openapiFields.add("type"); + openapiFields.add("childType"); + openapiFields.add("data"); + openapiFields.add("formnodeprops"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 WorkflowDataNodesValueNodesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WorkflowDataNodesValueNodesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WorkflowDataNodesValueNodesInner is not found in the empty JSON string", WorkflowDataNodesValueNodesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !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("UID") != null && !jsonObj.get("UID").isJsonNull()) && !jsonObj.get("UID").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `UID` to be a primitive type in the JSON string but got `%s`", jsonObj.get("UID").toString())); + } + if ((jsonObj.get("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + if ((jsonObj.get("childType") != null && !jsonObj.get("childType").isJsonNull()) && !jsonObj.get("childType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `childType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("childType").toString())); + } + // validate the optional field `formnodeprops` + if (jsonObj.get("formnodeprops") != null && !jsonObj.get("formnodeprops").isJsonNull()) { + WorkflowDataNodesValueNodesInnerFormnodeprops.validateJsonElement(jsonObj.get("formnodeprops")); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!WorkflowDataNodesValueNodesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WorkflowDataNodesValueNodesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<WorkflowDataNodesValueNodesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WorkflowDataNodesValueNodesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<WorkflowDataNodesValueNodesInner>() { + @Override + public void write(JsonWriter out, WorkflowDataNodesValueNodesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public WorkflowDataNodesValueNodesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + WorkflowDataNodesValueNodesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WorkflowDataNodesValueNodesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of WorkflowDataNodesValueNodesInner + * @throws IOException if the JSON string is invalid with respect to WorkflowDataNodesValueNodesInner + */ + public static WorkflowDataNodesValueNodesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WorkflowDataNodesValueNodesInner.class); + } + + /** + * Convert an instance of WorkflowDataNodesValueNodesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowDataNodesValueNodesInnerFormnodeprops.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowDataNodesValueNodesInnerFormnodeprops.java new file mode 100644 index 0000000..32607e4 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowDataNodesValueNodesInnerFormnodeprops.java @@ -0,0 +1,399 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner; +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.loginradius.sdk.internal.openapi.JSON; + +/** + * WorkflowDataNodesValueNodesInnerFormnodeprops + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class WorkflowDataNodesValueNodesInnerFormnodeprops { + public static final String SERIALIZED_NAME_CHOICE_FIELD_TYPE = "choiceFieldType"; + @SerializedName(SERIALIZED_NAME_CHOICE_FIELD_TYPE) + @javax.annotation.Nullable + private String choiceFieldType; + + public static final String SERIALIZED_NAME_CHOICES = "choices"; + @SerializedName(SERIALIZED_NAME_CHOICES) + @javax.annotation.Nullable + private List<WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner> choices = new ArrayList<>(); + + public static final String SERIALIZED_NAME_ATTRIBUTE_MAPPING = "attributeMapping"; + @SerializedName(SERIALIZED_NAME_ATTRIBUTE_MAPPING) + @javax.annotation.Nullable + private String attributeMapping; + + public static final String SERIALIZED_NAME_DEFAULT_CHOICE = "defaultChoice"; + @SerializedName(SERIALIZED_NAME_DEFAULT_CHOICE) + @javax.annotation.Nullable + private String defaultChoice; + + public WorkflowDataNodesValueNodesInnerFormnodeprops() { + } + + public WorkflowDataNodesValueNodesInnerFormnodeprops choiceFieldType(@javax.annotation.Nullable String choiceFieldType) { + this.choiceFieldType = choiceFieldType; + return this; + } + + /** + * Get choiceFieldType + * @return choiceFieldType + */ + @javax.annotation.Nullable + public String getChoiceFieldType() { + return choiceFieldType; + } + + public void setChoiceFieldType(@javax.annotation.Nullable String choiceFieldType) { + this.choiceFieldType = choiceFieldType; + } + + + public WorkflowDataNodesValueNodesInnerFormnodeprops choices(@javax.annotation.Nullable List<WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner> choices) { + this.choices = choices; + return this; + } + + public WorkflowDataNodesValueNodesInnerFormnodeprops addChoicesItem(WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner choicesItem) { + if (this.choices == null) { + this.choices = new ArrayList<>(); + } + this.choices.add(choicesItem); + return this; + } + + /** + * Get choices + * @return choices + */ + @javax.annotation.Nullable + public List<WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner> getChoices() { + return choices; + } + + public void setChoices(@javax.annotation.Nullable List<WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner> choices) { + this.choices = choices; + } + + + public WorkflowDataNodesValueNodesInnerFormnodeprops attributeMapping(@javax.annotation.Nullable String attributeMapping) { + this.attributeMapping = attributeMapping; + return this; + } + + /** + * Get attributeMapping + * @return attributeMapping + */ + @javax.annotation.Nullable + public String getAttributeMapping() { + return attributeMapping; + } + + public void setAttributeMapping(@javax.annotation.Nullable String attributeMapping) { + this.attributeMapping = attributeMapping; + } + + + public WorkflowDataNodesValueNodesInnerFormnodeprops defaultChoice(@javax.annotation.Nullable String defaultChoice) { + this.defaultChoice = defaultChoice; + return this; + } + + /** + * Get defaultChoice + * @return defaultChoice + */ + @javax.annotation.Nullable + public String getDefaultChoice() { + return defaultChoice; + } + + public void setDefaultChoice(@javax.annotation.Nullable String defaultChoice) { + this.defaultChoice = defaultChoice; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the WorkflowDataNodesValueNodesInnerFormnodeprops instance itself + */ + public WorkflowDataNodesValueNodesInnerFormnodeprops putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WorkflowDataNodesValueNodesInnerFormnodeprops workflowDataNodesValueNodesInnerFormnodeprops = (WorkflowDataNodesValueNodesInnerFormnodeprops) o; + return Objects.equals(this.choiceFieldType, workflowDataNodesValueNodesInnerFormnodeprops.choiceFieldType) && + Objects.equals(this.choices, workflowDataNodesValueNodesInnerFormnodeprops.choices) && + Objects.equals(this.attributeMapping, workflowDataNodesValueNodesInnerFormnodeprops.attributeMapping) && + Objects.equals(this.defaultChoice, workflowDataNodesValueNodesInnerFormnodeprops.defaultChoice)&& + Objects.equals(this.additionalProperties, workflowDataNodesValueNodesInnerFormnodeprops.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(choiceFieldType, choices, attributeMapping, defaultChoice, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WorkflowDataNodesValueNodesInnerFormnodeprops {\n"); + sb.append(" choiceFieldType: ").append(toIndentedString(choiceFieldType)).append("\n"); + sb.append(" choices: ").append(toIndentedString(choices)).append("\n"); + sb.append(" attributeMapping: ").append(toIndentedString(attributeMapping)).append("\n"); + sb.append(" defaultChoice: ").append(toIndentedString(defaultChoice)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("choiceFieldType"); + openapiFields.add("choices"); + openapiFields.add("attributeMapping"); + openapiFields.add("defaultChoice"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 WorkflowDataNodesValueNodesInnerFormnodeprops + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WorkflowDataNodesValueNodesInnerFormnodeprops.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WorkflowDataNodesValueNodesInnerFormnodeprops is not found in the empty JSON string", WorkflowDataNodesValueNodesInnerFormnodeprops.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("choiceFieldType") != null && !jsonObj.get("choiceFieldType").isJsonNull()) && !jsonObj.get("choiceFieldType").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `choiceFieldType` to be a primitive type in the JSON string but got `%s`", jsonObj.get("choiceFieldType").toString())); + } + if (jsonObj.get("choices") != null && !jsonObj.get("choices").isJsonNull()) { + JsonArray jsonArraychoices = jsonObj.getAsJsonArray("choices"); + if (jsonArraychoices != null) { + // ensure the json data is an array + if (!jsonObj.get("choices").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `choices` to be an array in the JSON string but got `%s`", jsonObj.get("choices").toString())); + } + + // validate the optional field `choices` (array) + for (int i = 0; i < jsonArraychoices.size(); i++) { + WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner.validateJsonElement(jsonArraychoices.get(i)); + }; + } + } + if ((jsonObj.get("attributeMapping") != null && !jsonObj.get("attributeMapping").isJsonNull()) && !jsonObj.get("attributeMapping").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `attributeMapping` to be a primitive type in the JSON string but got `%s`", jsonObj.get("attributeMapping").toString())); + } + if ((jsonObj.get("defaultChoice") != null && !jsonObj.get("defaultChoice").isJsonNull()) && !jsonObj.get("defaultChoice").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `defaultChoice` to be a primitive type in the JSON string but got `%s`", jsonObj.get("defaultChoice").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!WorkflowDataNodesValueNodesInnerFormnodeprops.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WorkflowDataNodesValueNodesInnerFormnodeprops' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<WorkflowDataNodesValueNodesInnerFormnodeprops> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WorkflowDataNodesValueNodesInnerFormnodeprops.class)); + + return (TypeAdapter<T>) new TypeAdapter<WorkflowDataNodesValueNodesInnerFormnodeprops>() { + @Override + public void write(JsonWriter out, WorkflowDataNodesValueNodesInnerFormnodeprops value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public WorkflowDataNodesValueNodesInnerFormnodeprops read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + WorkflowDataNodesValueNodesInnerFormnodeprops instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WorkflowDataNodesValueNodesInnerFormnodeprops given an JSON string + * + * @param jsonString JSON string + * @return An instance of WorkflowDataNodesValueNodesInnerFormnodeprops + * @throws IOException if the JSON string is invalid with respect to WorkflowDataNodesValueNodesInnerFormnodeprops + */ + public static WorkflowDataNodesValueNodesInnerFormnodeprops fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WorkflowDataNodesValueNodesInnerFormnodeprops.class); + } + + /** + * Convert an instance of WorkflowDataNodesValueNodesInnerFormnodeprops to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner.java new file mode 100644 index 0000000..26b45f4 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner.java @@ -0,0 +1,317 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.loginradius.sdk.internal.openapi.JSON; + +/** + * WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner { + public static final String SERIALIZED_NAME_VALUE = "value"; + @SerializedName(SERIALIZED_NAME_VALUE) + @javax.annotation.Nullable + private String value; + + public static final String SERIALIZED_NAME_TEXT = "text"; + @SerializedName(SERIALIZED_NAME_TEXT) + @javax.annotation.Nullable + private String text; + + public WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner() { + } + + public WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner value(@javax.annotation.Nullable String value) { + this.value = value; + return this; + } + + /** + * Get value + * @return value + */ + @javax.annotation.Nullable + public String getValue() { + return value; + } + + public void setValue(@javax.annotation.Nullable String value) { + this.value = value; + } + + + public WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner text(@javax.annotation.Nullable String text) { + this.text = text; + return this; + } + + /** + * Get text + * @return text + */ + @javax.annotation.Nullable + public String getText() { + return text; + } + + public void setText(@javax.annotation.Nullable String text) { + this.text = text; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner instance itself + */ + public WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner workflowDataNodesValueNodesInnerFormnodepropsChoicesInner = (WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner) o; + return Objects.equals(this.value, workflowDataNodesValueNodesInnerFormnodepropsChoicesInner.value) && + Objects.equals(this.text, workflowDataNodesValueNodesInnerFormnodepropsChoicesInner.text)&& + Objects.equals(this.additionalProperties, workflowDataNodesValueNodesInnerFormnodepropsChoicesInner.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(value, text, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner {\n"); + sb.append(" value: ").append(toIndentedString(value)).append("\n"); + sb.append(" text: ").append(toIndentedString(text)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("value"); + openapiFields.add("text"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner is not found in the empty JSON string", WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("value") != null && !jsonObj.get("value").isJsonNull()) && !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("text") != null && !jsonObj.get("text").isJsonNull()) && !jsonObj.get("text").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `text` to be a primitive type in the JSON string but got `%s`", jsonObj.get("text").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner.class)); + + return (TypeAdapter<T>) new TypeAdapter<WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner>() { + @Override + public void write(JsonWriter out, WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner given an JSON string + * + * @param jsonString JSON string + * @return An instance of WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner + * @throws IOException if the JSON string is invalid with respect to WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner + */ + public static WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner.class); + } + + /** + * Convert an instance of WorkflowDataNodesValueNodesInnerFormnodepropsChoicesInner to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowDataTree.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowDataTree.java new file mode 100644 index 0000000..e7225df --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowDataTree.java @@ -0,0 +1,325 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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 com.loginradius.sdk.internal.openapi.model.WorkflowDataTreeNodesValue; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * WorkflowDataTree + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class WorkflowDataTree { + public static final String SERIALIZED_NAME_ENTRY_NODE_ID = "entryNodeId"; + @SerializedName(SERIALIZED_NAME_ENTRY_NODE_ID) + @javax.annotation.Nullable + private String entryNodeId; + + public static final String SERIALIZED_NAME_NODES = "nodes"; + @SerializedName(SERIALIZED_NAME_NODES) + @javax.annotation.Nullable + private Map<String, WorkflowDataTreeNodesValue> nodes = new HashMap<>(); + + public WorkflowDataTree() { + } + + public WorkflowDataTree entryNodeId(@javax.annotation.Nullable String entryNodeId) { + this.entryNodeId = entryNodeId; + return this; + } + + /** + * The entry node ID of the tree. + * @return entryNodeId + */ + @javax.annotation.Nullable + public String getEntryNodeId() { + return entryNodeId; + } + + public void setEntryNodeId(@javax.annotation.Nullable String entryNodeId) { + this.entryNodeId = entryNodeId; + } + + + public WorkflowDataTree nodes(@javax.annotation.Nullable Map<String, WorkflowDataTreeNodesValue> nodes) { + this.nodes = nodes; + return this; + } + + public WorkflowDataTree putNodesItem(String key, WorkflowDataTreeNodesValue nodesItem) { + if (this.nodes == null) { + this.nodes = new HashMap<>(); + } + this.nodes.put(key, nodesItem); + return this; + } + + /** + * Get nodes + * @return nodes + */ + @javax.annotation.Nullable + public Map<String, WorkflowDataTreeNodesValue> getNodes() { + return nodes; + } + + public void setNodes(@javax.annotation.Nullable Map<String, WorkflowDataTreeNodesValue> nodes) { + this.nodes = nodes; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the WorkflowDataTree instance itself + */ + public WorkflowDataTree putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WorkflowDataTree workflowDataTree = (WorkflowDataTree) o; + return Objects.equals(this.entryNodeId, workflowDataTree.entryNodeId) && + Objects.equals(this.nodes, workflowDataTree.nodes)&& + Objects.equals(this.additionalProperties, workflowDataTree.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(entryNodeId, nodes, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WorkflowDataTree {\n"); + sb.append(" entryNodeId: ").append(toIndentedString(entryNodeId)).append("\n"); + sb.append(" nodes: ").append(toIndentedString(nodes)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("entryNodeId"); + openapiFields.add("nodes"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 WorkflowDataTree + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WorkflowDataTree.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WorkflowDataTree is not found in the empty JSON string", WorkflowDataTree.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("entryNodeId") != null && !jsonObj.get("entryNodeId").isJsonNull()) && !jsonObj.get("entryNodeId").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `entryNodeId` to be a primitive type in the JSON string but got `%s`", jsonObj.get("entryNodeId").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!WorkflowDataTree.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WorkflowDataTree' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<WorkflowDataTree> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WorkflowDataTree.class)); + + return (TypeAdapter<T>) new TypeAdapter<WorkflowDataTree>() { + @Override + public void write(JsonWriter out, WorkflowDataTree value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public WorkflowDataTree read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + WorkflowDataTree instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WorkflowDataTree given an JSON string + * + * @param jsonString JSON string + * @return An instance of WorkflowDataTree + * @throws IOException if the JSON string is invalid with respect to WorkflowDataTree + */ + public static WorkflowDataTree fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WorkflowDataTree.class); + } + + /** + * Convert an instance of WorkflowDataTree to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowDataTreeNodesValue.java b/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowDataTreeNodesValue.java new file mode 100644 index 0000000..1dd9831 --- /dev/null +++ b/src/main/java/com/loginradius/sdk/internal/openapi/model/WorkflowDataTreeNodesValue.java @@ -0,0 +1,359 @@ +/* + * LoginRadius API + * This is a LoginRadius API server. Which you can use to authenticate and manage the user. + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@loginradius.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.loginradius.sdk.internal.openapi.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.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +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.loginradius.sdk.internal.openapi.JSON; + +/** + * WorkflowDataTreeNodesValue + */ +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.10.0") +public class WorkflowDataTreeNodesValue { + public static final String SERIALIZED_NAME_ID = "id"; + @SerializedName(SERIALIZED_NAME_ID) + @javax.annotation.Nullable + private String id; + + public static final String SERIALIZED_NAME_TYPE = "type"; + @SerializedName(SERIALIZED_NAME_TYPE) + @javax.annotation.Nullable + private String type; + + public static final String SERIALIZED_NAME_CONNECTIONS = "connections"; + @SerializedName(SERIALIZED_NAME_CONNECTIONS) + @javax.annotation.Nullable + private List<Map<String, String>> connections = new ArrayList<>(); + + public WorkflowDataTreeNodesValue() { + } + + public WorkflowDataTreeNodesValue id(@javax.annotation.Nullable String id) { + this.id = id; + return this; + } + + /** + * Get id + * @return id + */ + @javax.annotation.Nullable + public String getId() { + return id; + } + + public void setId(@javax.annotation.Nullable String id) { + this.id = id; + } + + + public WorkflowDataTreeNodesValue type(@javax.annotation.Nullable String type) { + this.type = type; + return this; + } + + /** + * Get type + * @return type + */ + @javax.annotation.Nullable + public String getType() { + return type; + } + + public void setType(@javax.annotation.Nullable String type) { + this.type = type; + } + + + public WorkflowDataTreeNodesValue connections(@javax.annotation.Nullable List<Map<String, String>> connections) { + this.connections = connections; + return this; + } + + public WorkflowDataTreeNodesValue addConnectionsItem(Map<String, String> connectionsItem) { + if (this.connections == null) { + this.connections = new ArrayList<>(); + } + this.connections.add(connectionsItem); + return this; + } + + /** + * Get connections + * @return connections + */ + @javax.annotation.Nullable + public List<Map<String, String>> getConnections() { + return connections; + } + + public void setConnections(@javax.annotation.Nullable List<Map<String, String>> connections) { + this.connections = connections; + } + + /** + * A container for additional, undeclared properties. + * This is a holder for any undeclared properties as specified with + * the 'additionalProperties' keyword in the OAS document. + */ + private Map<String, Object> additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. + * If the property does not already exist, create it otherwise replace it. + * + * @param key name of the property + * @param value value of the property + * @return the WorkflowDataTreeNodesValue instance itself + */ + public WorkflowDataTreeNodesValue putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap<String, Object>(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return a map of objects + */ + public Map<String, Object> getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key name of the property + * @return an object + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WorkflowDataTreeNodesValue workflowDataTreeNodesValue = (WorkflowDataTreeNodesValue) o; + return Objects.equals(this.id, workflowDataTreeNodesValue.id) && + Objects.equals(this.type, workflowDataTreeNodesValue.type) && + Objects.equals(this.connections, workflowDataTreeNodesValue.connections)&& + Objects.equals(this.additionalProperties, workflowDataTreeNodesValue.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(id, type, connections, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class WorkflowDataTreeNodesValue {\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" connections: ").append(toIndentedString(connections)).append("\n"); + sb.append(" additionalProperties: ").append(toIndentedString(additionalProperties)).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<String> openapiFields; + public static HashSet<String> openapiRequiredFields; + + static { + // a set of all properties/fields (JSON key names) + openapiFields = new HashSet<String>(); + openapiFields.add("id"); + openapiFields.add("type"); + openapiFields.add("connections"); + + // a set of required properties/fields (JSON key names) + openapiRequiredFields = new HashSet<String>(); + } + + /** + * 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 WorkflowDataTreeNodesValue + */ + public static void validateJsonElement(JsonElement jsonElement) throws IOException { + if (jsonElement == null) { + if (!WorkflowDataTreeNodesValue.openapiRequiredFields.isEmpty()) { // has required fields but JSON element is null + throw new IllegalArgumentException(String.format("The required field(s) %s in WorkflowDataTreeNodesValue is not found in the empty JSON string", WorkflowDataTreeNodesValue.openapiRequiredFields.toString())); + } + } + JsonObject jsonObj = jsonElement.getAsJsonObject(); + if ((jsonObj.get("id") != null && !jsonObj.get("id").isJsonNull()) && !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("type") != null && !jsonObj.get("type").isJsonNull()) && !jsonObj.get("type").isJsonPrimitive()) { + throw new IllegalArgumentException(String.format("Expected the field `type` to be a primitive type in the JSON string but got `%s`", jsonObj.get("type").toString())); + } + // ensure the optional json data is an array if present + if (jsonObj.get("connections") != null && !jsonObj.get("connections").isJsonNull() && !jsonObj.get("connections").isJsonArray()) { + throw new IllegalArgumentException(String.format("Expected the field `connections` to be an array in the JSON string but got `%s`", jsonObj.get("connections").toString())); + } + } + + public static class CustomTypeAdapterFactory implements TypeAdapterFactory { + @SuppressWarnings("unchecked") + @Override + public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { + if (!WorkflowDataTreeNodesValue.class.isAssignableFrom(type.getRawType())) { + return null; // this class only serializes 'WorkflowDataTreeNodesValue' and its subtypes + } + final TypeAdapter<JsonElement> elementAdapter = gson.getAdapter(JsonElement.class); + final TypeAdapter<WorkflowDataTreeNodesValue> thisAdapter + = gson.getDelegateAdapter(this, TypeToken.get(WorkflowDataTreeNodesValue.class)); + + return (TypeAdapter<T>) new TypeAdapter<WorkflowDataTreeNodesValue>() { + @Override + public void write(JsonWriter out, WorkflowDataTreeNodesValue value) throws IOException { + JsonObject obj = thisAdapter.toJsonTree(value).getAsJsonObject(); + obj.remove("additionalProperties"); + // serialize additional properties + if (value.getAdditionalProperties() != null) { + for (Map.Entry<String, Object> entry : value.getAdditionalProperties().entrySet()) { + if (entry.getValue() instanceof String) + obj.addProperty(entry.getKey(), (String) entry.getValue()); + else if (entry.getValue() instanceof Number) + obj.addProperty(entry.getKey(), (Number) entry.getValue()); + else if (entry.getValue() instanceof Boolean) + obj.addProperty(entry.getKey(), (Boolean) entry.getValue()); + else if (entry.getValue() instanceof Character) + obj.addProperty(entry.getKey(), (Character) entry.getValue()); + else { + JsonElement jsonElement = gson.toJsonTree(entry.getValue()); + if (jsonElement.isJsonArray()) { + obj.add(entry.getKey(), jsonElement.getAsJsonArray()); + } else { + obj.add(entry.getKey(), jsonElement.getAsJsonObject()); + } + } + } + } + elementAdapter.write(out, obj); + } + + @Override + public WorkflowDataTreeNodesValue read(JsonReader in) throws IOException { + JsonElement jsonElement = elementAdapter.read(in); + validateJsonElement(jsonElement); + JsonObject jsonObj = jsonElement.getAsJsonObject(); + // store additional fields in the deserialized instance + WorkflowDataTreeNodesValue instance = thisAdapter.fromJsonTree(jsonObj); + for (Map.Entry<String, JsonElement> entry : jsonObj.entrySet()) { + if (!openapiFields.contains(entry.getKey())) { + if (entry.getValue().isJsonPrimitive()) { // primitive type + if (entry.getValue().getAsJsonPrimitive().isString()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsString()); + else if (entry.getValue().getAsJsonPrimitive().isNumber()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsNumber()); + else if (entry.getValue().getAsJsonPrimitive().isBoolean()) + instance.putAdditionalProperty(entry.getKey(), entry.getValue().getAsBoolean()); + else + throw new IllegalArgumentException(String.format("The field `%s` has unknown primitive type. Value: %s", entry.getKey(), entry.getValue().toString())); + } else if (entry.getValue().isJsonArray()) { + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), List.class)); + } else { // JSON object + instance.putAdditionalProperty(entry.getKey(), gson.fromJson(entry.getValue(), HashMap.class)); + } + } + } + return instance; + } + + }.nullSafe(); + } + } + + /** + * Create an instance of WorkflowDataTreeNodesValue given an JSON string + * + * @param jsonString JSON string + * @return An instance of WorkflowDataTreeNodesValue + * @throws IOException if the JSON string is invalid with respect to WorkflowDataTreeNodesValue + */ + public static WorkflowDataTreeNodesValue fromJson(String jsonString) throws IOException { + return JSON.getGson().fromJson(jsonString, WorkflowDataTreeNodesValue.class); + } + + /** + * Convert an instance of WorkflowDataTreeNodesValue to an JSON string + * + * @return JSON string + */ + public String toJson() { + return JSON.getGson().toJson(this); + } +} + diff --git a/src/main/resources/demo/demo.css b/src/main/resources/demo/demo.css new file mode 100644 index 0000000..7e8bf12 --- /dev/null +++ b/src/main/resources/demo/demo.css @@ -0,0 +1,261 @@ +/* Code generated by the LoginRadius SDK generator; DO NOT EDIT. + * + * The shared demo stylesheet. Every LoginRadius SDK demo renders this same + * file, so the five demos look like one product rather than five. + * + * What is shared is the LOOK: palette, type scale, and the components below. + * What each demo keeps is its own STRUCTURE — which controls exist, and how + * many pages they sit on — because that follows the routes its tiers declare, + * and those legitimately differ. A rule here that needs a per-language branch + * does not belong here. + * + * Add a component class to this file, not to a demo's <style> block: an inline + * override is exactly the drift this file exists to prevent. + */ + +:root { + --bg: #f6f7f9; + --card: #ffffff; + --fg: #1b1f24; + --mut: #6b7280; + --acc: #2563eb; + --acc-fg: #ffffff; + --line: #e3e6ea; + --ok: #0a7f3f; + --ok-bg: #e7f6ed; + --err: #b42318; + --err-bg: #fdeceb; + --radius: 10px; +} + +*, *::before, *::after { box-sizing: border-box } + +/* Explicit, not left to the UA sheet: several rules below set `display` on the + * same elements a demo hides with the `hidden` attribute, and a UA default + * loses to any author rule. */ +[hidden] { display: none !important } + +body { + margin: 0; + background: var(--bg); + color: var(--fg); + font: 15px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; +} + +/* Page container. + * + * The demos do not agree on markup, and this file has to work with all of them: + * Java, .NET and PHP wrap their content in <main> beneath a full-bleed + * <header>; Go and Node put it straight in <body> with no wrapper at all. + * Constraining <main> alone left those two sprawling edge to edge. + * + * So the constraint lives on <body> by default, and a demo that has its own + * <header> steps out of the way so that header still spans the viewport. */ +body { + max-width: 940px; + margin: 0 auto; + padding: 24px 20px 80px; +} +body:has(header) { + max-width: none; + margin: 0; + padding: 0; +} + +/* Page title for the demos with no <header> bar of their own. Not scoped to + * `body > h1`: Go nests its whole page inside a wrapper, so a direct-child + * selector would miss it. The header rule below wins where a header exists. */ +h1 { + margin: 0 0 4px; + font-size: 21px; + font-weight: 650; + letter-spacing: -.01em; +} +.subtitle, +h1 + p { + margin: 0 0 20px; + color: var(--mut); + font-size: 14px; +} + +/* ── Header ─────────────────────────────────────────────────────────────── */ + +header { background: var(--acc); color: var(--acc-fg); padding: 26px 20px } +header > div { max-width: 940px; margin: 0 auto } +header h1 { margin: 0 0 4px; font-size: 21px; font-weight: 650 } +/* The colour is load-bearing, not inherited by luck: the `.subtitle, h1 + p` + * rule above exists for the headerless demos, and Java, .NET and PHP put their + * subtitle in exactly that position — <header><div><h1>..</h1><p>..</p></div>. + * At equal specificity this rule wins on order, but only for what it declares, + * so without an explicit colour the subtitle stays var(--mut): grey on blue. */ +header p, header .subtitle { + margin: 0; + color: var(--acc-fg); + opacity: .85; + font-size: 14px; +} + +main { max-width: 940px; margin: 0 auto; padding: 24px 20px 80px } + +/* ── Cards ──────────────────────────────────────────────────────────────── */ + +.card, fieldset, form { + background: var(--card); + border: 1px solid var(--line); + border-radius: var(--radius); + padding: 18px; + margin: 0 0 16px; +} +fieldset { min-width: 0 } +.card h2, legend, form h2 { + margin: 0 0 2px; + padding: 0; + font-size: 15px; + font-weight: 650; + color: var(--fg); +} +.hint { margin: 0 0 14px; color: var(--mut); font-size: 13px } + +/* Multi-card layouts. Demos that lay cards out in a grid put this on <main>. */ +.cards { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); + gap: 16px; +} +.row { display: flex; gap: 10px; flex-wrap: wrap } +.row > * { flex: 1; min-width: 160px } + +/* ── Tabs ───────────────────────────────────────────────────────────────── */ + +.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px } +.tab { + padding: 7px 14px; + font: inherit; + font-weight: 600; + /* An explicit colour is load-bearing: these are <button> elements, and the + * button rule below sets colour: var(--acc-fg). Without this an unselected + * tab inherits white-on-white and disappears. */ + color: var(--mut); + background: transparent; + border: 1px solid transparent; + border-radius: 999px; + cursor: pointer; +} +.tab:hover { color: var(--fg); background: var(--card) } +.tab.active { + color: var(--acc-fg); + background: var(--acc); + border-color: var(--acc); +} +.panel { display: none } +.panel.active { display: block } + +/* ── Forms ──────────────────────────────────────────────────────────────── */ + +label { display: block; font-size: 13px; color: var(--mut); margin-bottom: 10px } +input, select, textarea { + width: 100%; + margin-top: 4px; + padding: 8px 10px; + font: inherit; + color: var(--fg); + background: var(--card); + border: 1px solid var(--line); + border-radius: 6px; +} +input:focus, select:focus, textarea:focus { + outline: 2px solid var(--acc); + outline-offset: -1px; +} + +button { + padding: 8px 14px; + font: inherit; + font-weight: 600; + color: var(--acc-fg); + background: var(--acc); + border: 0; + border-radius: 6px; + cursor: pointer; + margin: 2px 6px 2px 0; +} +button:hover { filter: brightness(1.08) } +button:disabled { opacity: .5; cursor: default } +button.ghost, button.secondary { + background: var(--card); + color: var(--acc); + border: 1px solid var(--acc); +} + +/* ── Output panes ───────────────────────────────────────────────────────── */ + +pre, .result, .out { + margin: 12px 0 0; + padding: 10px; + font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; + background: var(--bg); + border: 1px solid var(--line); + border-radius: 6px; + overflow-x: auto; + white-space: pre-wrap; + word-break: break-word; + max-height: 260px; +} +pre:empty, .result:empty, .out:empty { display: none } +.ok, .success { border-color: var(--ok); background: var(--ok-bg) } +.err, .error { border-color: var(--err); background: var(--err-bg) } +.muted { color: var(--mut) } + +/* A result pane that a demo reveals explicitly rather than by filling it. + * `.show` is what the toggling demos add; `:empty` above covers the rest, and + * the two agree because a demo that toggles also sets the content. */ +.result.show { display: block } +.result-title { margin: 0; font-size: .9rem; font-weight: 600 } +.result-detail { + margin: .5rem 0 0; + padding: 0; + font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; + white-space: pre-wrap; + word-break: break-word; + max-height: 18rem; + overflow: auto; +} + +.msg { margin: 8px 0 0; font-size: 13px } +.msg.ok { color: var(--ok) } .msg.error { color: var(--err) } + +.banner { + max-width: 940px; + margin: 16px auto 0; + padding: 10px 14px; + border-radius: 8px; + font-size: 14px; +} +.banner.ok { background: var(--ok-bg); color: var(--ok) } +.banner.err { background: var(--err-bg); color: var(--err) } +/* Java, .NET and PHP ship the banner div unconditionally and fill it only on + * the email-verification redirect — their scripts set display:block, which is + * the tell that it is meant to start hidden. Without this an empty div's own + * padding leaves a stray gap under the header on every other page load. */ +.banner:empty { display: none } + +/* A standalone chip above the first card (Node marks which half of its dual + * build is running). It needs the same gap any block above a card gets, or it + * sits flush against the card's border. */ +.tag { + display: inline-block; + margin: 0 0 16px; + padding: 1px 8px; + font-size: 12px; + font-weight: 600; + color: var(--mut); + background: var(--bg); + border: 1px solid var(--line); + border-radius: 999px; +} +/* Go's page-level caveat, above the first card — same gap, same reason. */ +.warning { margin: 0 0 16px; color: var(--err) } + +nav.pages { margin: 0 0 18px } +nav.pages a { color: var(--acc); margin-right: 14px; text-decoration: none } +nav.pages a:hover { text-decoration: underline } diff --git a/src/main/resources/demo/index.html b/src/main/resources/demo/index.html new file mode 100644 index 0000000..a5d4a86 --- /dev/null +++ b/src/main/resources/demo/index.html @@ -0,0 +1,482 @@ +<!doctype html> +<meta charset="utf-8" /> +<meta name="viewport" content="width=device-width, initial-scale=1" /> +<title>LoginRadius Java SDK — demo + + +
+
+

LoginRadius Java SDK

+

+ Every endpoint below comes from the shared demo contract in + the shared SDK manifest — the same nine routes every LoginRadius SDK demo + exposes. Only this page's design is Java's own. +

+
+
+ + + +
+
+

Register

+

Mints a SOTT server-side; the browser never sees the secret.

+ + + + + +
+
+ +
+

Session

+

Log in, then use Log out under Profile to clear the demo session cookie.

+ + + +
+
+ + + + +
+

Passwordless login

+

+ No password: a one-time code is emailed or texted to an existing user, + then verified here to start a session. A tenant with MFA enabled still + enforces its second factor afterward, same as the Session card. +

+ + + + + + + + +
+
+ +
+

Forgot password

+

The reset token arrives by email; the SMS route sends an OTP instead.

+ + + + +
+
+ +
+

Reset password

+

Paste the token from the reset email, or use the SMS OTP instead.

+ + + + + + + +
+
+
+ +
+

Change password

+

Needs a signed-in session; returns 401 otherwise.

+ + + +
+
+ +
+

Profile

+

Needs a signed-in session; returns 401 otherwise.

+ + +
+
+ +
+

Update profile

+ + + + +
+
+ +
+

Identifiers

+

Add / delete need a signed-in session.

+ + + + + + + +
+
+ +
+

Delete account

+

+ The demo refuses any address other than the one you are signed in as. The + underlying API is admin-scoped and would delete any account in the tenant. +

+ + +
+
+ +
+

Custom Objects

+

Needs a signed-in session.

+ + + + + + + +
+
+ +
+

Access token

+

+ Refresh uses the /manage/ operation. Refreshing rotates the + session's tokens server-side, so the cookie does not change. +

+ + + +
+
+ +
+

Multi-factor authentication

+ +

+ Optional. Where Duo returns the user after its challenge — only needed if + this tenant has Duo configured. Left blank, the parameter is omitted + entirely rather than sent empty. +

+ + + + +
+
+ +
+

Passkey

+

+ WebAuthn needs a secure context. http://localhost counts, so + this works as shipped; over plain HTTP on any other host the browser refuses. +

+ + + +
+
+
+ + diff --git a/src/test/java/com/loginradius/sdk/ClientTest.java b/src/test/java/com/loginradius/sdk/ClientTest.java new file mode 100644 index 0000000..4e701bc --- /dev/null +++ b/src/test/java/com/loginradius/sdk/ClientTest.java @@ -0,0 +1,157 @@ +package com.loginradius.sdk; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +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.loginradius.sdk.internal.openapi.ApiException; +import java.lang.reflect.Field; +import java.util.Locale; +import okhttp3.OkHttpClient; +import org.junit.jupiter.api.Test; + +/** + * CROSS-LANGUAGE PARITY. Mirrors Go's {@code TestResolveBaseURLPrecedence}, + * {@code TestNewClientWiresEveryService}, and + * {@code TestOperationServersHonourClientConfiguration}. + */ +class ClientTest { + + // ---- base URL precedence ------------------------------------------------- + + @Test + void resolveBaseUrlPrecedence() { + // Declared in the shared SDK manifest as an ordered list; the order is the + // contract, so assert each level beats the ones below it. + assertEquals( + "https://staging.internal", + LoginRadiusConfig.builder() + .apiKey("k") + .baseURL("https://staging.internal") + .customDomain("auth.acme.com") + .domain("acme") + .build() + .resolveBaseUrl()); + + assertEquals( + "https://auth.acme.com", + LoginRadiusConfig.builder() + .apiKey("k") + .customDomain("auth.acme.com") + .domain("acme") + .build() + .resolveBaseUrl()); + + assertEquals( + "https://acme.hub.loginradius.com", + LoginRadiusConfig.builder().apiKey("k").domain("acme").build().resolveBaseUrl()); + + assertEquals( + "https://api.loginradius.com", + LoginRadiusConfig.builder().apiKey("k").build().resolveBaseUrl()); + } + + @Test + void constructionRequiresACredential() { + // A client with no credential at all would send unauthenticated requests + // and fail per-call with a confusing 401. + assertThrows( + IllegalArgumentException.class, + () -> LoginRadiusClient.create(LoginRadiusConfig.builder().build())); + + assertNotNull(LoginRadiusClient.create(LoginRadiusConfig.builder().apiKey("k").build())); + } + + @Test + void wiresEveryService() throws IllegalAccessException { + LoginRadiusClient client = + LoginRadiusClient.create(LoginRadiusConfig.builder().apiKey("k").build()); + + // Every service field is derived from the generated client, so a null here + // means a service the facade failed to wire. + int services = 0; + for (Field field : LoginRadiusClient.class.getDeclaredFields()) { + if (!field.getType().getName().endsWith("Api")) { + continue; + } + assertNotNull(field.get(client), field.getName() + " was not wired"); + services++; + } + assertTrue(services > 50, "expected the full service set, found " + services); + } + + // ---- operation servers --------------------------------------------------- + + /** + * Issues a request against an operation the spec pins to {@code + * https://{domain}.hub.loginradius.com} and reports the host it actually + * addressed. + */ + private static String pinnedOperationHost(String domain, String baseUrl) { + RecordingInterceptor recorder = new RecordingInterceptor(); + LoginRadiusConfig.Builder cfg = + LoginRadiusConfig.builder() + .apiKey("k") + .httpClient(new OkHttpClient.Builder().addInterceptor(recorder).build()); + if (domain != null) { + cfg.domain(domain); + } + if (baseUrl != null) { + cfg.baseURL(baseUrl); + } + + LoginRadiusClient client = LoginRadiusClient.create(cfg.build()); + try { + client.bigCommerceSso.getBigCommerceLoginUrl("tok", "mystore", null, null); + } catch (ApiException | RuntimeException e) { + // The canned response does not deserialise into the operation's model, + // which is fine — the request has already been recorded. + } + + assertNotNull(recorder.request(), "no request reached the transport"); + return recorder.request().url().host(); + } + + @Test + void operationServersHonourClientConfiguration() { + // No server options: the spec's own placeholder stands, exactly as it does + // in Go. Before ApiClient.buildUrl substituted variables this was a literal + // "{domain}.hub.loginradius.com" — okhttp accepts that host and lowercases + // it, so the call failed as a DNS error rather than as anything actionable. + assertEquals("example.hub.loginradius.com", pinnedOperationHost(null, null)); + + // domain() fills the {domain} template variable. + assertEquals("acme.hub.loginradius.com", pinnedOperationHost("acme", null)); + + // An explicit base URL means "send everything here" and wins over the pin — + // otherwise a caller pointing at a proxy or a staging host would still have + // this operation go to production. + assertEquals("staging.internal", pinnedOperationHost(null, "https://staging.internal")); + } + + @Test + void pinnedOperationKeepsItsOwnPath() { + RecordingInterceptor recorder = new RecordingInterceptor(); + LoginRadiusClient client = + LoginRadiusClient.create( + LoginRadiusConfig.builder() + .apiKey("k") + .domain("acme") + .httpClient(new OkHttpClient.Builder().addInterceptor(recorder).build()) + .build()); + + try { + client.bigCommerceSso.getBigCommerceLoginUrl("tok", "mystore", null, null); + } catch (ApiException | RuntimeException e) { + // See pinnedOperationHost. + } + + String path = recorder.request().url().encodedPath(); + assertNotEquals("/", path, "the operation's own path was dropped"); + assertTrue( + path.toLowerCase(Locale.ROOT).contains("bigcommerce"), + "unexpected path for a pinned operation: " + path); + } +} diff --git a/src/test/java/com/loginradius/sdk/CryptoParityTest.java b/src/test/java/com/loginradius/sdk/CryptoParityTest.java new file mode 100644 index 0000000..69dd729 --- /dev/null +++ b/src/test/java/com/loginradius/sdk/CryptoParityTest.java @@ -0,0 +1,91 @@ +package com.loginradius.sdk; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.Calendar; +import java.util.Date; +import java.util.TimeZone; +import org.junit.jupiter.api.Test; + +/** + * CROSS-LANGUAGE PARITY. + * + *

The golden values below are asserted identically by the Go, Node, and + * .NET SDKs. Every LoginRadius SDK must emit a byte-identical SOTT and request + * signature, because the API validates the payload exactly — a drifted IV, + * iteration count, salt, or timestamp format yields a token that is silently + * rejected. + * + *

The signing values came from the reference implementation in + * admin-console-backend, not from this SDK's own output, so these prove the + * port matches the known-working algorithm rather than merely matching itself. + * + *

If this fails, fix the implementation, not the expectation. The shared + * parameters live in the SDK generator's shared configuration. + */ +class CryptoParityTest { + + private static final String API_KEY = "test-api-key"; + private static final String API_SECRET = "test-api-secret"; + private static final String URI = + "https://api.loginradius.com/identity/v2/manage/account/uid?apikey=test-api-key"; + + private static Date utc(int y, int mo, int d, int h, int mi, int s) { + Calendar c = Calendar.getInstance(TimeZone.getTimeZone("UTC")); + c.clear(); + c.set(y, mo - 1, d, h, mi, s); + return c.getTime(); + } + + @Test + void sottMatchesTheOtherSdks() { + assertEquals( + "yvLBFPR3aRNl1YlisgPpEdphb73sUfne2Jem7hTKWU6RLlkcfjYOhe5B7kSHorQS" + + "*1059092e1510bfbc5388d7438b943106", + Sott.generateWithWindow(API_KEY, API_SECRET, utc(2026, 1, 2, 3, 4, 5), utc(2026, 1, 2, 3, 14, 5))); + } + + @Test + void sottRejectsMissingCredentials() { + Date start = utc(2026, 1, 2, 3, 4, 5); + Date end = utc(2026, 1, 2, 3, 14, 5); + org.junit.jupiter.api.Assertions.assertThrows( + IllegalArgumentException.class, () -> Sott.generateWithWindow("", API_SECRET, start, end)); + org.junit.jupiter.api.Assertions.assertThrows( + IllegalArgumentException.class, () -> Sott.generateWithWindow(API_KEY, "", start, end)); + } + + @Test + void signingMatchesTheReferenceImplementation() { + Date now = utc(2026, 1, 2, 3, 4, 5); + + Signing.Headers noBody = Signing.sign(API_SECRET, URI, null, now); + assertEquals("SHA-256=WhdnDwiFzLUkrhBOUQYzrec+ZllDrY6X0hdovov8bKY=", noBody.digest); + assertEquals("2026-01-02 03:24:05", noBody.expires); + + Signing.Headers withBody = Signing.sign(API_SECRET, URI, "{\"Uid\":\"abc123\"}", now); + assertEquals("SHA-256=cVEPKKM+Dd1fzQePAPDKMKCn+2QollSbzWfVx8YxSzM=", withBody.digest); + } + + /** + * Guards the escaper. {@code URLEncoder} is NOT encodeURIComponent: it renders + * a space as {@code +} and escapes {@code !'()*~}. Signing a URL containing an + * email address with the wrong escaper yields a digest the API rejects. + */ + @Test + void encodeUriComponentMatchesJavaScript() { + assertEquals( + "a%20b!'()*~-_.%C3%A9%2F%3F%26%3D", Signing.encodeUriComponent("a b!'()*~-_.é/?&=")); + } + + @Test + void signingScopeIsManagementPathsOnly() { + assertTrue(Signing.shouldSign("/identity/v2/manage/account/uid")); + assertTrue(Signing.shouldSign("/v2/manage/roles")); + assertFalse(Signing.shouldSign("/identity/v2/auth/login")); + // The access-token exchange is explicitly excluded by the reference. + assertFalse(Signing.shouldSign("/identity/v2/manage/account/access_token")); + } +} diff --git a/src/test/java/com/loginradius/sdk/ErrorTest.java b/src/test/java/com/loginradius/sdk/ErrorTest.java new file mode 100644 index 0000000..d14b91c --- /dev/null +++ b/src/test/java/com/loginradius/sdk/ErrorTest.java @@ -0,0 +1,111 @@ +package com.loginradius.sdk; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.loginradius.sdk.internal.openapi.ApiException; +import java.util.Collections; +import org.junit.jupiter.api.Test; + +/** + * CROSS-LANGUAGE PARITY. Mirrors Go's {@code TestExtractEnvelopeAcrossWireShapes}, + * {@code TestErrorPredicates}, and {@code TestDefaultDescriptionForStatus}, and + * Node's {@code errors.test.ts}. + * + *

Table-driven, like the Go suite: junit-jupiter-params is not on the + * generated project's test classpath and adding a dependency to prove the same + * thing a loop proves is not worth the drift risk. + */ +class ErrorTest { + + private static LoginRadiusException from(int status, String body) { + return LoginRadiusException.from(new ApiException(status, Collections.emptyMap(), body)); + } + + /** + * The LoginRadius API returns three different error envelopes depending on + * which family of endpoints answered. All three must classify identically, or + * a caller's error handling works on some endpoints and not others. + */ + @Test + void extractsEnvelopeAcrossWireShapes() { + String[][] cases = { + { + "ApiError / ErrorResponse (PascalCase)", + "{\"ErrorCode\":1043,\"Message\":\"Invalid credentials\"," + + "\"Description\":\"The email and password do not match.\"}", + "1043", + "The email and password do not match.", + }, + { + "ErrorResponseNative (camelCase, /api/v2/*)", + "{\"errorCode\":1066,\"message\":\"Token expired\"," + + "\"description\":\"The access token has expired.\"}", + "1066", + "The access token has expired.", + }, + { + "OAuthErrorResponse (token endpoints)", + "{\"error\":\"invalid_grant\",\"error_description\":\"Refresh token is invalid.\"}", + "invalid_grant", + "Refresh token is invalid.", + }, + }; + + for (String[] tc : cases) { + LoginRadiusException e = from(400, tc[1]); + assertEquals(tc[2], e.code(), tc[0]); + assertEquals(tc[3], e.description(), tc[0]); + } + } + + @Test + void predicates() { + // status, isAuth, isForbidden, isRateLimit, isServer + Object[][] cases = { + {401, true, false, false, false}, + {403, false, true, false, false}, + {429, false, false, true, false}, + {500, false, false, false, true}, + {503, false, false, false, true}, + {599, false, false, false, true}, + {400, false, false, false, false}, + {200, false, false, false, false}, + }; + + for (Object[] tc : cases) { + int status = (Integer) tc[0]; + LoginRadiusException e = from(status, "{}"); + assertEquals(tc[1], e.isAuth(), "isAuth for " + status); + assertEquals(tc[2], e.isForbidden(), "isForbidden for " + status); + assertEquals(tc[3], e.isRateLimit(), "isRateLimit for " + status); + assertEquals(tc[4], e.isServer(), "isServer for " + status); + } + } + + @Test + void unusableBodiesStillProduceATypedError() { + // An HTML error page from a proxy, or an empty body, must not throw while + // building the error — the status code is still actionable. + for (String body : new String[] {"", "not json", "502", "[]"}) { + LoginRadiusException e = from(502, body); + assertEquals(502, e.statusCode(), "body: " + body); + assertTrue(e.isServer(), "body: " + body); + } + } + + @Test + void carriesAHintForStatusesWithoutAnEnvelope() { + // The hints come from the shared SDK manifest so all four SDKs say the same thing + // for a bare 401 or 403. + assertFalse(from(401, "").description().isEmpty()); + assertFalse(from(403, "").description().isEmpty()); + } + + @Test + void keepsTheRawBodyForDiagnosis() { + String body = "{\"ErrorCode\":1043,\"Message\":\"Invalid credentials\"}"; + assertTrue(from(400, body).rawBody().contains("1043")); + } +} diff --git a/src/test/java/com/loginradius/sdk/JwtValidationTest.java b/src/test/java/com/loginradius/sdk/JwtValidationTest.java new file mode 100644 index 0000000..33214b6 --- /dev/null +++ b/src/test/java/com/loginradius/sdk/JwtValidationTest.java @@ -0,0 +1,264 @@ +package com.loginradius.sdk; + +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 static org.junit.jupiter.api.Assertions.fail; + +import com.loginradius.sdk.JwtValidation.Algorithm; +import com.loginradius.sdk.JwtValidation.JwtValidationException; +import com.loginradius.sdk.JwtValidation.Params; +import com.nimbusds.jose.JWSAlgorithm; +import com.nimbusds.jose.JWSHeader; +import com.nimbusds.jose.crypto.ECDSASigner; +import com.nimbusds.jose.crypto.MACSigner; +import com.nimbusds.jose.crypto.RSASSASigner; +import com.nimbusds.jwt.JWTClaimsSet; +import com.nimbusds.jwt.SignedJWT; +import java.nio.charset.StandardCharsets; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.interfaces.ECPrivateKey; +import java.security.spec.ECGenParameterSpec; +import java.util.Base64; +import java.util.Date; +import java.util.Map; +import org.junit.jupiter.api.Test; + +/** + * The security-relevant cases mirror the Go and Node suites case for case, so a + * weakness fixed in one language cannot quietly persist in another. + */ +class JwtValidationTest { + + private static final String SECRET = "a-shared-secret-at-least-32-bytes-long!!"; + + private static JWTClaimsSet liveClaims() { + long now = System.currentTimeMillis(); + return new JWTClaimsSet.Builder() + .subject("uid-123") + .issuer("LoginRadius") + .audience("my-app") + .expirationTime(new Date(now + 3_600_000L)) + .notBeforeTime(new Date(now - 60_000L)) + .build(); + } + + private static String hs(JWSAlgorithm alg, JWTClaimsSet claims, byte[] secret) throws Exception { + SignedJWT jwt = new SignedJWT(new JWSHeader(alg), claims); + jwt.sign(new MACSigner(secret)); + return jwt.serialize(); + } + + private static String pem(java.security.PublicKey key) { + return "-----BEGIN PUBLIC KEY-----\n" + + Base64.getMimeEncoder(64, new byte[] {'\n'}).encodeToString(key.getEncoded()) + + "\n-----END PUBLIC KEY-----\n"; + } + + @Test + void acceptsAWellFormedToken() throws Exception { + Map claims = + JwtValidation.validate( + hs(JWSAlgorithm.HS256, liveClaims(), SECRET.getBytes(StandardCharsets.UTF_8)), + new Params(Algorithm.HS256, SECRET.getBytes(StandardCharsets.UTF_8)) + .issuer("LoginRadius") + .audience("my-app")); + assertEquals("uid-123", claims.get("sub")); + } + + /** + * THE attack this utility exists to stop. Against an RS256-configured app an attacker signs with + * HS256 using the PUBLIC key as the HMAC secret; a validator that reads the algorithm from the + * token header accepts it. + */ + @Test + void rejectsAlgorithmConfusion() throws Exception { + KeyPairGenerator gen = KeyPairGenerator.getInstance("RSA"); + gen.initialize(2048); + KeyPair pair = gen.generateKeyPair(); + byte[] pub = pem(pair.getPublic()).getBytes(StandardCharsets.UTF_8); + + String forged = hs(JWSAlgorithm.HS256, liveClaims(), pub); + + assertThrows( + JwtValidationException.class, + () -> JwtValidation.validate(forged, new Params(Algorithm.RS256, pub))); + } + + @Test + void rejectsAlgNone() { + // Assembled by hand, exactly as an attacker would: nimbus refuses to sign one. + String unsigned = + "eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0." + + "eyJzdWIiOiJhdHRhY2tlciIsImV4cCI6NDEwMjQ0NDgwMH0."; + assertThrows( + JwtValidationException.class, + () -> + JwtValidation.validate( + unsigned, new Params(Algorithm.HS256, SECRET.getBytes(StandardCharsets.UTF_8)))); + } + + @Test + void rejectsAWrongSecret() throws Exception { + String token = + hs( + JWSAlgorithm.HS256, + liveClaims(), + "a-different-secret-entirely-32-bytes".getBytes(StandardCharsets.UTF_8)); + JwtValidationException e = + assertThrows( + JwtValidationException.class, + () -> + JwtValidation.validate( + token, new Params(Algorithm.HS256, SECRET.getBytes(StandardCharsets.UTF_8)))); + assertEquals("signature", e.code()); + } + + @Test + void rejectsExpiredAndNotYetValid() throws Exception { + long now = System.currentTimeMillis(); + byte[] key = SECRET.getBytes(StandardCharsets.UTF_8); + + String expired = + hs( + JWSAlgorithm.HS256, + new JWTClaimsSet.Builder().expirationTime(new Date(now - 600_000L)).build(), + key); + assertEquals( + "expired", + assertThrows( + JwtValidationException.class, + () -> JwtValidation.validate(expired, new Params(Algorithm.HS256, key))) + .code()); + + String early = + hs( + JWSAlgorithm.HS256, + new JWTClaimsSet.Builder() + .expirationTime(new Date(now + 3_600_000L)) + .notBeforeTime(new Date(now + 600_000L)) + .build(), + key); + assertEquals( + "not_yet_valid", + assertThrows( + JwtValidationException.class, + () -> JwtValidation.validate(early, new Params(Algorithm.HS256, key))) + .code()); + } + + /** A token with no exp never stops being valid. */ + @Test + void requiresAnExpiryClaim() throws Exception { + byte[] key = SECRET.getBytes(StandardCharsets.UTF_8); + String token = + hs(JWSAlgorithm.HS256, new JWTClaimsSet.Builder().subject("uid-123").build(), key); + assertEquals( + "missing_exp", + assertThrows( + JwtValidationException.class, + () -> JwtValidation.validate(token, new Params(Algorithm.HS256, key))) + .code()); + } + + @Test + void checksIssuerAndAudienceWhenSupplied() throws Exception { + byte[] key = SECRET.getBytes(StandardCharsets.UTF_8); + String token = hs(JWSAlgorithm.HS256, liveClaims(), key); + assertEquals( + "issuer", + assertThrows( + JwtValidationException.class, + () -> + JwtValidation.validate( + token, new Params(Algorithm.HS256, key).issuer("SomeoneElse"))) + .code()); + assertEquals( + "audience", + assertThrows( + JwtValidationException.class, + () -> + JwtValidation.validate( + token, new Params(Algorithm.HS256, key).audience("another-app"))) + .code()); + } + + /** Omitting them must not silently disable the checks that are NOT optional. */ + @Test + void issuerAndAudienceAreOptional() throws Exception { + byte[] key = SECRET.getBytes(StandardCharsets.UTF_8); + assertNotNull( + JwtValidation.validate(hs(JWSAlgorithm.HS256, liveClaims(), key), new Params(Algorithm.HS256, key))); + } + + @Test + void verifiesRsaAndEcdsa() throws Exception { + KeyPairGenerator rsaGen = KeyPairGenerator.getInstance("RSA"); + rsaGen.initialize(2048); + KeyPair rsa = rsaGen.generateKeyPair(); + SignedJWT rsaJwt = new SignedJWT(new JWSHeader(JWSAlgorithm.RS256), liveClaims()); + rsaJwt.sign(new RSASSASigner(rsa.getPrivate())); + assertEquals( + "uid-123", + JwtValidation.validate( + rsaJwt.serialize(), + new Params(Algorithm.RS256, pem(rsa.getPublic()).getBytes(StandardCharsets.UTF_8))) + .get("sub")); + + KeyPairGenerator ecGen = KeyPairGenerator.getInstance("EC"); + ecGen.initialize(new ECGenParameterSpec("secp256r1")); + KeyPair ec = ecGen.generateKeyPair(); + SignedJWT ecJwt = new SignedJWT(new JWSHeader(JWSAlgorithm.ES256), liveClaims()); + ecJwt.sign(new ECDSASigner((ECPrivateKey) ec.getPrivate())); + assertEquals( + "uid-123", + JwtValidation.validate( + ecJwt.serialize(), + new Params(Algorithm.ES256, pem(ec.getPublic()).getBytes(StandardCharsets.UTF_8))) + .get("sub")); + } + + /** Handing over a PRIVATE key is a serious mistake; it is named, not swallowed. */ + @Test + void refusesAPrivateKeyAsTheVerificationKey() throws Exception { + KeyPairGenerator gen = KeyPairGenerator.getInstance("RSA"); + gen.initialize(2048); + KeyPair pair = gen.generateKeyPair(); + String priv = + "-----BEGIN PRIVATE KEY-----\n" + + Base64.getMimeEncoder(64, new byte[] {'\n'}) + .encodeToString(pair.getPrivate().getEncoded()) + + "\n-----END PRIVATE KEY-----\n"; + SignedJWT jwt = new SignedJWT(new JWSHeader(JWSAlgorithm.RS256), liveClaims()); + jwt.sign(new RSASSASigner(pair.getPrivate())); + JwtValidationException e = + assertThrows( + JwtValidationException.class, + () -> + JwtValidation.validate( + jwt.serialize(), + new Params(Algorithm.RS256, priv.getBytes(StandardCharsets.UTF_8)))); + assertEquals("invalid_key", e.code()); + } + + @Test + void rejectsAnEmptyKeyAndAMalformedToken() { + byte[] key = SECRET.getBytes(StandardCharsets.UTF_8); + assertEquals( + "invalid_key", + assertThrows( + JwtValidationException.class, + () -> JwtValidation.validate("a.b.c", new Params(Algorithm.HS256, new byte[0]))) + .code()); + assertEquals( + "malformed", + assertThrows( + JwtValidationException.class, + () -> JwtValidation.validate("not-a-jwt", new Params(Algorithm.HS256, key))) + .code()); + if (false) { + fail("unreachable"); + } + } +} diff --git a/src/test/java/com/loginradius/sdk/RecordingInterceptor.java b/src/test/java/com/loginradius/sdk/RecordingInterceptor.java new file mode 100644 index 0000000..ad354a4 --- /dev/null +++ b/src/test/java/com/loginradius/sdk/RecordingInterceptor.java @@ -0,0 +1,68 @@ +package com.loginradius.sdk; + +import java.io.IOException; +import okhttp3.Interceptor; +import okhttp3.MediaType; +import okhttp3.Protocol; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; + +/** + * Terminal interceptor that captures the fully decorated request and answers + * with a canned response, so a test can assert on what the SDK would put on the + * wire without one going anywhere. + * + *

This is the Java counterpart of the recording transport the Go suite uses. + * It must sit after {@code AuthInterceptor} in the chain — anything + * earlier sees the request before the credentials are applied and asserts + * nothing. + */ +final class RecordingInterceptor implements Interceptor { + + private final int status; + private final String body; + + private Request captured; + + RecordingInterceptor() { + this(200, "{}"); + } + + RecordingInterceptor(int status, String body) { + this.status = status; + this.body = body; + } + + /** The last request that reached the transport. */ + Request request() { + return captured; + } + + /** Header value, or null when the header is absent. */ + String header(String name) { + return captured == null ? null : captured.header(name); + } + + /** Query-parameter value, or null when the parameter is absent. */ + String query(String name) { + return captured == null ? null : captured.url().queryParameter(name); + } + + /** How many times a query parameter appears — a duplicate is a bug. */ + int queryCount(String name) { + return captured == null ? 0 : captured.url().queryParameterValues(name).size(); + } + + @Override + public Response intercept(Chain chain) throws IOException { + captured = chain.request(); + return new Response.Builder() + .request(captured) + .protocol(Protocol.HTTP_1_1) + .code(status) + .message("OK") + .body(ResponseBody.create(body, MediaType.get("application/json"))) + .build(); + } +} diff --git a/src/test/java/com/loginradius/sdk/TransportTest.java b/src/test/java/com/loginradius/sdk/TransportTest.java new file mode 100644 index 0000000..bc5093b --- /dev/null +++ b/src/test/java/com/loginradius/sdk/TransportTest.java @@ -0,0 +1,224 @@ +package com.loginradius.sdk; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.io.UncheckedIOException; +import java.nio.charset.StandardCharsets; +import java.util.LinkedHashMap; +import java.util.Map; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.Response; +import org.junit.jupiter.api.Test; + +/** + * CROSS-LANGUAGE PARITY. + * + *

Every case here mirrors one in the Go suite ({@code loginradius_test.go}) + * and the Node suite ({@code __tests__/request-options.test.ts}), asserting the + * same concrete values from {@code the shared SDK manifest}. The manifest is the + * contract; these are what stop one language drifting away from it quietly. + * + *

A manifest change is supposed to break these. Update every + * language's suite in the same change. + */ +class TransportTest { + + private static final String LOGIN_PATH = "https://api.loginradius.com/identity/v2/auth/login"; + private static final String MANAGE_PATH = + "https://api.loginradius.com/identity/v2/manage/account/uid"; + + /** + * Drives the credential interceptor, the way Go's {@code roundTrip} helper + * drives its transport, and hands back what reached the wire. + */ + private static RecordingInterceptor send(LoginRadiusConfig cfg, String url) { + RecordingInterceptor recorder = new RecordingInterceptor(); + OkHttpClient http = + new OkHttpClient.Builder() + .addInterceptor(new AuthInterceptor(cfg)) + // Added after, so it observes the request the SDK actually built. + .addInterceptor(recorder) + .build(); + + try (Response ignored = http.newCall(new Request.Builder().url(url).build()).execute()) { + // The response is irrelevant; the request has been captured. + } catch (IOException e) { + throw new UncheckedIOException(e); + } + + assertNotNull(recorder.request(), "transport was not reached"); + return recorder; + } + + private static RecordingInterceptor send(LoginRadiusConfig cfg) { + return send(cfg, LOGIN_PATH); + } + + // ---- credentials --------------------------------------------------------- + + @Test + void injectsCredentialsAsHeadersAndQueryParameters() { + RecordingInterceptor got = + send(LoginRadiusConfig.builder().apiKey("KEY").apiSecret("SECRET").build()); + + assertEquals("KEY", got.header("X-LoginRadius-ApiKey")); + assertEquals("SECRET", got.header("X-LoginRadius-ApiSecret")); + // The query form exists because some LoginRadius operations accept nothing + // else; it must be sent alongside the header, not instead of it. + assertEquals("KEY", got.query("apikey")); + } + + @Test + void omitsUnsetCredentials() { + RecordingInterceptor got = send(LoginRadiusConfig.builder().apiKey("KEY").build()); + + assertNull(got.header("X-LoginRadius-ApiSecret")); + assertNull(got.query("apisecret")); + } + + @Test + void perCallParametersWinOverClientWideOnes() { + RecordingInterceptor got = + send( + LoginRadiusConfig.builder().apiKey("CLIENT_KEY").build(), + LOGIN_PATH + "?apikey=PER_CALL_KEY"); + + // An operation that already carries the credential must not have it + // appended a second time — two values would go out and the API would read + // whichever came first. + assertEquals("PER_CALL_KEY", got.query("apikey")); + assertEquals(1, got.queryCount("apikey")); + } + + // ---- cross-cutting request options --------------------------------------- + + @Test + void requestOptionsAppliedToEveryRequest() { + RecordingInterceptor got = + send( + LoginRadiusConfig.builder() + .apiKey("KEY") + .originIp("203.0.113.7") + .serverRegion("eu") + .fields("Email,Uid") + .preventWebhook(true) + .build()); + + assertEquals("203.0.113.7", got.header("X-Origin-IP")); + assertEquals("true", got.header("X-PreventWebhook")); + assertEquals("eu", got.query("region")); + assertEquals("Email,Uid", got.query("fields")); + } + + @Test + void requestOptionsOmittedWhenUnset() { + RecordingInterceptor got = send(LoginRadiusConfig.builder().apiKey("KEY").build()); + + assertNull(got.header("X-Origin-IP")); + assertNull(got.header("X-PreventWebhook")); + assertNull(got.query("region")); + assertNull(got.query("fields")); + } + + @Test + void defaultHeadersNeverMaskACredential() { + // Default headers are applied first so the SDK's own headers overwrite + // them. Letting a caller override X-LoginRadius-ApiKey here would silently + // send the wrong credential. + Map defaults = new LinkedHashMap<>(); + defaults.put("X-Tenant-Trace", "abc123"); + defaults.put("X-LoginRadius-ApiKey", "HIJACKED"); + defaults.put("User-Agent", "HIJACKED"); + + RecordingInterceptor got = + send(LoginRadiusConfig.builder().apiKey("REAL_KEY").defaultHeaders(defaults).build()); + + assertEquals("abc123", got.header("X-Tenant-Trace")); + assertEquals("REAL_KEY", got.header("X-LoginRadius-ApiKey")); + assertNotEquals("HIJACKED", got.header("User-Agent")); + } + + // ---- request signing ----------------------------------------------------- + + private static LoginRadiusConfig signingConfig() { + return LoginRadiusConfig.builder() + .apiKey("KEY") + .apiSecret("SECRET") + .apiRequestSigning(true) + .build(); + } + + @Test + void signingAppliedOnlyToManagementPaths() { + RecordingInterceptor signed = send(signingConfig(), MANAGE_PATH); + assertNotNull(signed.header(Signing.DIGEST_HEADER), "management request was not signed"); + assertNotNull(signed.header(Signing.EXPIRES_HEADER), "management request has no expiry stamp"); + + RecordingInterceptor unsigned = send(signingConfig(), LOGIN_PATH); + assertNull(unsigned.header(Signing.DIGEST_HEADER), "only /manage/ paths should be signed"); + + // The access-token exchange lives under /manage/ but is explicitly + // excluded: it is the call that obtains the credential to sign with. + RecordingInterceptor excluded = + send(signingConfig(), "https://api.loginradius.com/identity/v2/manage/account/access_token"); + assertNull(excluded.header(Signing.DIGEST_HEADER), "access_token exchange must not be signed"); + } + + @Test + void signingStripsTheSecretFromTheSignedUrl() { + RecordingInterceptor got = send(signingConfig(), MANAGE_PATH); + + // apisecret is removed before the URL is signed AND before it is sent — a + // signature computed over a URL carrying the secret would also mean the + // secret went out on the wire. + assertNull(got.query("apisecret")); + assertNotNull(got.header(Signing.DIGEST_HEADER)); + } + + @Test + void signingRequiresBothOptInAndSecret() { + RecordingInterceptor noOptIn = + send(LoginRadiusConfig.builder().apiKey("KEY").apiSecret("SECRET").build(), MANAGE_PATH); + assertNull(noOptIn.header(Signing.DIGEST_HEADER)); + + RecordingInterceptor noSecret = + send( + LoginRadiusConfig.builder().apiKey("KEY").apiRequestSigning(true).build(), MANAGE_PATH); + assertNull(noSecret.header(Signing.DIGEST_HEADER)); + } + + // ---- debug logging ------------------------------------------------------- + + @Test + void debugRedactsCredentialValues() { + ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + + send( + LoginRadiusConfig.builder() + .apiKey("SUPER_SECRET_KEY") + .apiSecret("SUPER_SECRET_VALUE") + .bearerToken("SUPER_SECRET_TOKEN") + .debug(new PrintStream(buffer, true, StandardCharsets.UTF_8)) + .build()); + + String out = buffer.toString(StandardCharsets.UTF_8); + assertFalse(out.isEmpty(), "debug stream received nothing"); + for (String secret : + new String[] {"SUPER_SECRET_KEY", "SUPER_SECRET_VALUE", "SUPER_SECRET_TOKEN"}) { + assertFalse(out.contains(secret), "debug log leaked a credential value: " + out); + } + assertTrue( + out.toLowerCase(java.util.Locale.ROOT).contains("x-loginradius-apikey"), + "debug log should name the header: " + out); + assertTrue(out.contains("[REDACTED]"), "debug log should mark redacted values: " + out); + } +}